text
stringlengths 2
1.05M
|
|---|
var NAVTREEINDEX15 =
{
"arm__compute_2core_2_utils_8h.xhtml#afa7962c747457714d0944af80cb07058":[6,0,0,0,41,3],
"arm__compute_2core_2_utils_8h.xhtml#afab149f8d8b0f6405303ee8056fa77d3":[6,0,0,0,41,6],
"arm__compute_2core_2_utils_8h.xhtml#afb5698af5404d5d11e3516c87b6e7041":[6,0,0,0,41,44],
"arm__compute_2core_2_utils_8h_source.xhtml":[6,0,0,0,41],
"arm__compute_2core_2utils_2logging_2_helpers_8h.xhtml":[6,0,0,0,4,1,1],
"arm__compute_2core_2utils_2logging_2_helpers_8h.xhtml#a1e3d36b5da8441a7e95aae5af1610598":[6,0,0,0,4,1,1,1],
"arm__compute_2core_2utils_2logging_2_helpers_8h.xhtml#a369e0192e9a39349e4f7b8eca465ac60":[6,0,0,0,4,1,1,0],
"arm__compute_2core_2utils_2logging_2_helpers_8h.xhtml#a9dd6c32b3cab7dfb3e20c0800969e795":[6,0,0,0,4,1,1,2],
"arm__compute_2core_2utils_2logging_2_helpers_8h_source.xhtml":[6,0,0,0,4,1,1],
"arm__compute_2core_2utils_2logging_2_macros_8h.xhtml":[6,0,0,0,4,1,6],
"arm__compute_2core_2utils_2logging_2_macros_8h.xhtml#a6087f31f01f2486b92904378d224b51a":[6,0,0,0,4,1,6,0],
"arm__compute_2core_2utils_2logging_2_macros_8h.xhtml#ac32407e4f9c56f4b740e5b64b26f7fa9":[6,0,0,0,4,1,6,1],
"arm__compute_2core_2utils_2logging_2_macros_8h.xhtml#adf7a43123a5ee422b2328ecec54f3d35":[6,0,0,0,4,1,6,2],
"arm__compute_2core_2utils_2logging_2_macros_8h_source.xhtml":[6,0,0,0,4,1,6],
"arm__compute_2core_2utils_2logging_2_printers_8h.xhtml":[6,0,0,0,4,1,7],
"arm__compute_2core_2utils_2logging_2_printers_8h_source.xhtml":[6,0,0,0,4,1,7],
"arm__compute_2core_2utils_2logging_2_types_8h.xhtml":[6,0,0,0,4,1,9],
"arm__compute_2core_2utils_2logging_2_types_8h.xhtml#aca1fd1d8935433e6ba2e3918214e07f9":[6,0,0,0,4,1,9,1],
"arm__compute_2core_2utils_2logging_2_types_8h.xhtml#aca1fd1d8935433e6ba2e3918214e07f9a32bd8a1db2275458673903bdb84cb277":[6,0,0,0,4,1,9,1,2],
"arm__compute_2core_2utils_2logging_2_types_8h.xhtml#aca1fd1d8935433e6ba2e3918214e07f9a551b723eafd6a31d444fcb2f5920fbd3":[6,0,0,0,4,1,9,1,1],
"arm__compute_2core_2utils_2logging_2_types_8h.xhtml#aca1fd1d8935433e6ba2e3918214e07f9a88559a0cfd8250c9d65970cc145c92d4":[6,0,0,0,4,1,9,1,4],
"arm__compute_2core_2utils_2logging_2_types_8h.xhtml#aca1fd1d8935433e6ba2e3918214e07f9abb1ca97ec761fc37101737ba0aa2e7c5":[6,0,0,0,4,1,9,1,3],
"arm__compute_2core_2utils_2logging_2_types_8h.xhtml#aca1fd1d8935433e6ba2e3918214e07f9aec1f06e9fb39c4ef0729b3c7c9c8e8cc":[6,0,0,0,4,1,9,1,0],
"arm__compute_2core_2utils_2logging_2_types_8h_source.xhtml":[6,0,0,0,4,1,9],
"arm__compute_2graph_2_type_printer_8h.xhtml":[6,0,0,1,24],
"arm__compute_2graph_2_type_printer_8h.xhtml#a108f26d15227710831dbdb30e40e608e":[6,0,0,1,24,1],
"arm__compute_2graph_2_type_printer_8h.xhtml#a36f71403d9328a10245a6d9d62518527":[6,0,0,1,24,5],
"arm__compute_2graph_2_type_printer_8h.xhtml#a6c721497fdfc121b38630f89b625ac39":[6,0,0,1,24,4],
"arm__compute_2graph_2_type_printer_8h.xhtml#a7e067080ce8169b2f8be64c190edab9e":[6,0,0,1,24,0],
"arm__compute_2graph_2_type_printer_8h.xhtml#ab90b7a7fcc12792b0b6cb6486bb383dd":[6,0,0,1,24,3],
"arm__compute_2graph_2_type_printer_8h.xhtml#abcd88ed51472e534decef274fb32bcaa":[6,0,0,1,24,2],
"arm__compute_2graph_2_type_printer_8h_source.xhtml":[6,0,0,1,24],
"arm__compute_2graph_2_types_8h.xhtml":[6,0,0,1,25],
"arm__compute_2graph_2_types_8h.xhtml#a31488d29805a596498c0234ae392d35d":[6,0,0,1,25,14],
"arm__compute_2graph_2_types_8h.xhtml#a31488d29805a596498c0234ae392d35da1c04cc3823d476c3017238679a0fdf52":[6,0,0,1,25,14,0],
"arm__compute_2graph_2_types_8h.xhtml#a31488d29805a596498c0234ae392d35da5bc574a47246f122016869b32a6aa6f0":[6,0,0,1,25,14,2],
"arm__compute_2graph_2_types_8h.xhtml#a31488d29805a596498c0234ae392d35da7359c3eb5c57547295a76ac1bf775b29":[6,0,0,1,25,14,3],
"arm__compute_2graph_2_types_8h.xhtml#a31488d29805a596498c0234ae392d35dacaf162e9233294cadf62d2a71a14ca09":[6,0,0,1,25,14,1],
"arm__compute_2graph_2_types_8h.xhtml#a56952a8591a9d8481450ae707ae355e7":[6,0,0,1,25,6],
"arm__compute_2graph_2_types_8h.xhtml#a5f9016ea3e28a033b7cc216bdda912be":[6,0,0,1,25,3],
"arm__compute_2graph_2_types_8h.xhtml#a615af95e19b5d9f74d2760183566a9a3":[6,0,0,1,25,7],
"arm__compute_2graph_2_types_8h.xhtml#a683661ae75dcb7aef16b9c9bde31517d":[6,0,0,1,25,8],
"arm__compute_2graph_2_types_8h.xhtml#a683661ae75dcb7aef16b9c9bde31517da09db1dd1078ec6bdbe2722b4558e578f":[6,0,0,1,25,8,3],
"arm__compute_2graph_2_types_8h.xhtml#a683661ae75dcb7aef16b9c9bde31517da5174aac3927faa9ee34befb7fc87a9e3":[6,0,0,1,25,8,1],
"arm__compute_2graph_2_types_8h.xhtml#a683661ae75dcb7aef16b9c9bde31517da7a1920d61156abc05a60135aefe8bc67":[6,0,0,1,25,8,0],
"arm__compute_2graph_2_types_8h.xhtml#a683661ae75dcb7aef16b9c9bde31517dafd1dd0c603be8170f9eae0be9f2f6afb":[6,0,0,1,25,8,2],
"arm__compute_2graph_2_types_8h.xhtml#a720ead698a117f7a16af6496f61aa6b4":[6,0,0,1,25,5],
"arm__compute_2graph_2_types_8h.xhtml#a75ce9b1baad4303a53124d6f0795821f":[6,0,0,1,25,9],
"arm__compute_2graph_2_types_8h.xhtml#a75ce9b1baad4303a53124d6f0795821fa3bb7b7f3f021a006e65111fc1d226938":[6,0,0,1,25,9,2],
"arm__compute_2graph_2_types_8h.xhtml#a75ce9b1baad4303a53124d6f0795821fa7a1920d61156abc05a60135aefe8bc67":[6,0,0,1,25,9,0],
"arm__compute_2graph_2_types_8h.xhtml#a75ce9b1baad4303a53124d6f0795821fa87dc825930f866018839a6374a5e68d2":[6,0,0,1,25,9,1],
"arm__compute_2graph_2_types_8h.xhtml#a8e0b093eda0649ddbce791bb5076104f":[6,0,0,1,25,15],
"arm__compute_2graph_2_types_8h.xhtml#aa12973876c037bddff8e9ece94aca0e4":[6,0,0,1,25,10],
"arm__compute_2graph_2_types_8h.xhtml#aa12973876c037bddff8e9ece94aca0e4a62b6d55816cf737bfc6f42e60df1a3f2":[6,0,0,1,25,10,2],
"arm__compute_2graph_2_types_8h.xhtml#aa12973876c037bddff8e9ece94aca0e4ae80155eceb940c89e2de63ad05868db2":[6,0,0,1,25,10,1],
"arm__compute_2graph_2_types_8h.xhtml#aa12973876c037bddff8e9ece94aca0e4aec211f7c20af43e742bf2570c3cb84f9":[6,0,0,1,25,10,0],
"arm__compute_2graph_2_types_8h.xhtml#aa94938a3eb11fda4724c362c53c28f24":[6,0,0,1,25,17],
"arm__compute_2graph_2_types_8h.xhtml#aad3f5296ec88b9d552c109b04b89ad9f":[6,0,0,1,25,16],
"arm__compute_2graph_2_types_8h.xhtml#abba17a56bbf16c7cbc7acd4aa54abcea":[6,0,0,1,25,4],
"arm__compute_2graph_2_types_8h.xhtml#ac85a46f3ebd3ab09f576a994ac2dce11":[6,0,0,1,25,11],
"arm__compute_2graph_2_types_8h.xhtml#ac85a46f3ebd3ab09f576a994ac2dce11a00d23a76e43b46dae9ec7aa9dcbebb32":[6,0,0,1,25,11,0],
"arm__compute_2graph_2_types_8h.xhtml#ac85a46f3ebd3ab09f576a994ac2dce11ab9f5c797ebbf55adccdd8539a65a0241":[6,0,0,1,25,11,1],
"arm__compute_2graph_2_types_8h.xhtml#ac866c81ec0f5526139dfc62ddc3f206e":[6,0,0,1,25,12],
"arm__compute_2graph_2_types_8h.xhtml#ac866c81ec0f5526139dfc62ddc3f206ea7e62bc342f41c946868f0ea6f0b712d8":[6,0,0,1,25,12,0],
"arm__compute_2graph_2_types_8h.xhtml#ac866c81ec0f5526139dfc62ddc3f206eadfd0a82c4bf37b1e90b690a22a20692e":[6,0,0,1,25,12,1],
"arm__compute_2graph_2_types_8h.xhtml#acac9cbaeea226ed297804c012dc12b16":[6,0,0,1,25,13],
"arm__compute_2graph_2_types_8h.xhtml#acac9cbaeea226ed297804c012dc12b16a041485a3394541feee82a34d40249d70":[6,0,0,1,25,13,0],
"arm__compute_2graph_2_types_8h.xhtml#acac9cbaeea226ed297804c012dc12b16a1ee0d44744be1e17e38ad5a4e9dcf5dd":[6,0,0,1,25,13,13],
"arm__compute_2graph_2_types_8h.xhtml#acac9cbaeea226ed297804c012dc12b16a227ecc6e858c8d1f61664f1967173bea":[6,0,0,1,25,13,10],
"arm__compute_2graph_2_types_8h.xhtml#acac9cbaeea226ed297804c012dc12b16a29c2c02a361c9d7028472e5d92cd4a54":[6,0,0,1,25,13,18],
"arm__compute_2graph_2_types_8h.xhtml#acac9cbaeea226ed297804c012dc12b16a324118a6721dd6b8a9b9f4e327df2bf5":[6,0,0,1,25,13,17],
"arm__compute_2graph_2_types_8h.xhtml#acac9cbaeea226ed297804c012dc12b16a4a9567bc4a6c28a527c973010eaf9a25":[6,0,0,1,25,13,15],
"arm__compute_2graph_2_types_8h.xhtml#acac9cbaeea226ed297804c012dc12b16a5b7955cb74be105cc7e044a370d4fce8":[6,0,0,1,25,13,6],
"arm__compute_2graph_2_types_8h.xhtml#acac9cbaeea226ed297804c012dc12b16a5c436066fbad2e22ccab352c0d554809":[6,0,0,1,25,13,3],
"arm__compute_2graph_2_types_8h.xhtml#acac9cbaeea226ed297804c012dc12b16a658061ff1dac70c02116fae6c044da1a":[6,0,0,1,25,13,9],
"arm__compute_2graph_2_types_8h.xhtml#acac9cbaeea226ed297804c012dc12b16a79ceee9f8e3c1f0cc74223e05d2448bf":[6,0,0,1,25,13,19],
"arm__compute_2graph_2_types_8h.xhtml#acac9cbaeea226ed297804c012dc12b16aa252659b59a03bc61e5ec827ab4448b7":[6,0,0,1,25,13,4],
"arm__compute_2graph_2_types_8h.xhtml#acac9cbaeea226ed297804c012dc12b16aa84a001cb23ac473e7aae73a9eaf369a":[6,0,0,1,25,13,11],
"arm__compute_2graph_2_types_8h.xhtml#acac9cbaeea226ed297804c012dc12b16abcf036b6f33e182d4705f4f5b1af13ac":[6,0,0,1,25,13,20],
"arm__compute_2graph_2_types_8h.xhtml#acac9cbaeea226ed297804c012dc12b16ac814c26a7c5317e2a2f58fe0e5a0d410":[6,0,0,1,25,13,5],
"arm__compute_2graph_2_types_8h.xhtml#acac9cbaeea226ed297804c012dc12b16ad0146d2051fad860923cf31f7e00a732":[6,0,0,1,25,13,1],
"arm__compute_2graph_2_types_8h.xhtml#acac9cbaeea226ed297804c012dc12b16ad1b3837fe6a80018e7002c7f7905439d":[6,0,0,1,25,13,7],
"arm__compute_2graph_2_types_8h.xhtml#acac9cbaeea226ed297804c012dc12b16ad87240455a60f188b358a370fe1a83a5":[6,0,0,1,25,13,8],
"arm__compute_2graph_2_types_8h.xhtml#acac9cbaeea226ed297804c012dc12b16aea068ae5aae640d018c4300bc7619575":[6,0,0,1,25,13,12],
"arm__compute_2graph_2_types_8h.xhtml#acac9cbaeea226ed297804c012dc12b16aea2ded20d74b2bf7921551363737777e":[6,0,0,1,25,13,14],
"arm__compute_2graph_2_types_8h.xhtml#acac9cbaeea226ed297804c012dc12b16af2ee14b628c0a45e1682de8f33983dc1":[6,0,0,1,25,13,16],
"arm__compute_2graph_2_types_8h.xhtml#acac9cbaeea226ed297804c012dc12b16af5505217824e3e9e8000ef0d63360158":[6,0,0,1,25,13,2],
"arm__compute_2graph_2_types_8h_source.xhtml":[6,0,0,1,25],
"arm__compute_2graph_2_utils_8h.xhtml":[6,0,0,1,26],
"arm__compute_2graph_2_utils_8h.xhtml#a119ab96867c279bb7769e0b050cd0cec":[6,0,0,1,26,1],
"arm__compute_2graph_2_utils_8h.xhtml#a2591ebfbe2a99276469d4c27710b0bde":[6,0,0,1,26,6],
"arm__compute_2graph_2_utils_8h.xhtml#a415d13754baa4f3d60d41b1691d1225b":[6,0,0,1,26,4],
"arm__compute_2graph_2_utils_8h.xhtml#a4e9f20d289a4880de2a2937fe363ccc0":[6,0,0,1,26,11],
"arm__compute_2graph_2_utils_8h.xhtml#a4ebedbbf720dd9a5bd14584f723b056e":[6,0,0,1,26,10],
"arm__compute_2graph_2_utils_8h.xhtml#a6f7790ee9fa15226c7f31e0c74f1d20c":[6,0,0,1,26,8],
"arm__compute_2graph_2_utils_8h.xhtml#a6fdc4f8803626c0be9af825b976ae1bd":[6,0,0,1,26,0],
"arm__compute_2graph_2_utils_8h.xhtml#a7be409872d37c8922e485ca70d845621":[6,0,0,1,26,5],
"arm__compute_2graph_2_utils_8h.xhtml#aae59dce83cb7fc9cfa5e445ef6e5d27d":[6,0,0,1,26,2],
"arm__compute_2graph_2_utils_8h.xhtml#abf6f9982517bc455c2ea36250e61419e":[6,0,0,1,26,3],
"arm__compute_2graph_2_utils_8h.xhtml#ade2275ecfd6f344e3ec7086427863aa8":[6,0,0,1,26,7],
"arm__compute_2graph_2_utils_8h.xhtml#af1e24c6fcb185d532695bce9bd9b0d8d":[6,0,0,1,26,9],
"arm__compute_2graph_2_utils_8h_source.xhtml":[6,0,0,1,26],
"arm__compute_2graph_2backends_2_utils_8h.xhtml":[6,0,0,1,1,6],
"arm__compute_2graph_2backends_2_utils_8h.xhtml#a0deb9022e246a5abd58ba4478428c750":[6,0,0,1,1,6,0],
"arm__compute_2graph_2backends_2_utils_8h.xhtml#a4403f766b0d02eb3882a9521d0390986":[6,0,0,1,1,6,3],
"arm__compute_2graph_2backends_2_utils_8h.xhtml#a8919c520c1cb9086dd1116de509bd481":[6,0,0,1,1,6,2],
"arm__compute_2graph_2backends_2_utils_8h.xhtml#af334e7a63e1b0dfd42f0b0b8d9b46a64":[6,0,0,1,1,6,1],
"arm__compute_2graph_2backends_2_utils_8h_source.xhtml":[6,0,0,1,1,6],
"arm__compute_2graph_2frontend_2_types_8h.xhtml":[6,0,0,1,3,6],
"arm__compute_2graph_2frontend_2_types_8h.xhtml#a001290b9a1953d3fb723b261667ff38e":[6,0,0,1,3,6,1],
"arm__compute_2graph_2frontend_2_types_8h.xhtml#a001290b9a1953d3fb723b261667ff38ea7a6a2c7579c4530e4660af1d24a1287e":[6,0,0,1,3,6,1,0],
"arm__compute_2graph_2frontend_2_types_8h.xhtml#a001290b9a1953d3fb723b261667ff38ea9eeb52badb613229884838847294b90d":[6,0,0,1,3,6,1,1],
"arm__compute_2graph_2frontend_2_types_8h_source.xhtml":[6,0,0,1,3,6],
"arm__compute_2graph_2printers_2_printers_8h.xhtml":[6,0,0,1,6,1],
"arm__compute_2graph_2printers_2_printers_8h_source.xhtml":[6,0,0,1,6,1],
"arm__compute_2runtime_2_types_8h.xhtml":[6,0,0,2,42],
"arm__compute_2runtime_2_types_8h.xhtml#a762c7da7319adcc433b3ac7a67e18ed5":[6,0,0,2,42,1],
"arm__compute_2runtime_2_types_8h.xhtml#ad2398d0f2ce77c10bbebf1f85317dde5":[6,0,0,2,42,0],
"arm__compute_2runtime_2_types_8h.xhtml#af0a4d6be70322c742c12da1edccbb74d":[6,0,0,2,42,2],
"arm__compute_2runtime_2_types_8h.xhtml#af0a4d6be70322c742c12da1edccbb74da465202c26fd7181c6bc9a80648499073":[6,0,0,2,42,2,1],
"arm__compute_2runtime_2_types_8h.xhtml#af0a4d6be70322c742c12da1edccbb74daac354f9e7a5097598cdd933b42fd190e":[6,0,0,2,42,2,0],
"arm__compute_2runtime_2_types_8h_source.xhtml":[6,0,0,2,42],
"arm__compute_2runtime_2_utils_8h.xhtml":[6,0,0,2,43],
"arm__compute_2runtime_2_utils_8h.xhtml#aa5191117dc677a74552769b87131b1b6":[6,0,0,2,43,0],
"arm__compute_2runtime_2_utils_8h_source.xhtml":[6,0,0,2,43],
"batchnormalization__layer_8cl.xhtml":[6,0,2,0,0,0,6],
"batchnormalization__layer_8cl_source.xhtml":[6,0,2,0,0,0,6],
"benchmark_2_c_l_2_activation_layer_8cpp.xhtml":[6,0,4,0,0,0],
"benchmark_2_c_l_2_activation_layer_8cpp.xhtml#a74a10374253178ae54e1baab173698a1":[6,0,4,0,0,0,0],
"benchmark_2_c_l_2_activation_layer_8cpp_source.xhtml":[6,0,4,0,0,0],
"benchmark_2_c_l_2_batch_normalization_layer_8cpp.xhtml":[6,0,4,0,0,1],
"benchmark_2_c_l_2_batch_normalization_layer_8cpp.xhtml#a50f37919583325e12b928230ecc55fad":[6,0,4,0,0,1,2],
"benchmark_2_c_l_2_batch_normalization_layer_8cpp.xhtml#a544fd26c293d1af74453a3957473072c":[6,0,4,0,0,1,1],
"benchmark_2_c_l_2_batch_normalization_layer_8cpp.xhtml#a7d824d302cf1a312f7431565cb4cb57d":[6,0,4,0,0,1,5],
"benchmark_2_c_l_2_batch_normalization_layer_8cpp.xhtml#a87e1c1e454b278b308806039d0108a81":[6,0,4,0,0,1,6],
"benchmark_2_c_l_2_batch_normalization_layer_8cpp.xhtml#aa518736ddb384e7e3b86acfff2023a26":[6,0,4,0,0,1,3],
"benchmark_2_c_l_2_batch_normalization_layer_8cpp.xhtml#af80ea91532f0ebdccb3f1d8e507a98ad":[6,0,4,0,0,1,0],
"benchmark_2_c_l_2_batch_normalization_layer_8cpp.xhtml#af8c2c796eecdcd74b1d81465c1a760bf":[6,0,4,0,0,1,4],
"benchmark_2_c_l_2_batch_normalization_layer_8cpp_source.xhtml":[6,0,4,0,0,1],
"benchmark_2_c_l_2_canny_edge_8cpp.xhtml":[6,0,4,0,0,2],
"benchmark_2_c_l_2_canny_edge_8cpp.xhtml#a4ceb722841ee996004f926e323d07ddb":[6,0,4,0,0,2,2],
"benchmark_2_c_l_2_canny_edge_8cpp.xhtml#a89469af2cbb370c5d52db10de55fb092":[6,0,4,0,0,2,0],
"benchmark_2_c_l_2_canny_edge_8cpp.xhtml#ac3b83f97332d0af2c066392c0d0c385a":[6,0,4,0,0,2,1],
"benchmark_2_c_l_2_canny_edge_8cpp_source.xhtml":[6,0,4,0,0,2],
"benchmark_2_c_l_2_color_convert_8cpp.xhtml":[6,0,4,0,0,3],
"benchmark_2_c_l_2_color_convert_8cpp.xhtml#a0c581bbf035477ef229090525ae7d9c0":[6,0,4,0,0,3,4],
"benchmark_2_c_l_2_color_convert_8cpp.xhtml#a124635f8b10320b4455601daf5b3c79e":[6,0,4,0,0,3,9],
"benchmark_2_c_l_2_color_convert_8cpp.xhtml#a1d7c5c1490675619b518fde0a89c334a":[6,0,4,0,0,3,1],
"benchmark_2_c_l_2_color_convert_8cpp.xhtml#a1f3062c305e7969eee012cf432c24596":[6,0,4,0,0,3,8],
"benchmark_2_c_l_2_color_convert_8cpp.xhtml#a2005c37de050ddb1b2d4bb11da0447dd":[6,0,4,0,0,3,12],
"benchmark_2_c_l_2_color_convert_8cpp.xhtml#a3110d9e17b2fed7a59da5069d55b21f1":[6,0,4,0,0,3,2],
"benchmark_2_c_l_2_color_convert_8cpp.xhtml#a4004862c92977b9ff4e06bc3846035b4":[6,0,4,0,0,3,11],
"benchmark_2_c_l_2_color_convert_8cpp.xhtml#a5a92b3ee2fcc563a0f4a44c078cc05f1":[6,0,4,0,0,3,13],
"benchmark_2_c_l_2_color_convert_8cpp.xhtml#a71624fad883b263ef7b1551195e19a78":[6,0,4,0,0,3,3],
"benchmark_2_c_l_2_color_convert_8cpp.xhtml#a8403220ebf3aefd218946561bbfd2b97":[6,0,4,0,0,3,10],
"benchmark_2_c_l_2_color_convert_8cpp.xhtml#a8b3799c76bc466c6423cf2f8a752181b":[6,0,4,0,0,3,5],
"benchmark_2_c_l_2_color_convert_8cpp.xhtml#a91b232424d610674b94a96284640fc50":[6,0,4,0,0,3,0],
"benchmark_2_c_l_2_color_convert_8cpp.xhtml#a97550db9243678761ddb38280dd826fe":[6,0,4,0,0,3,7],
"benchmark_2_c_l_2_color_convert_8cpp.xhtml#acb79998463382b7311bcf059d7486ec7":[6,0,4,0,0,3,14],
"benchmark_2_c_l_2_color_convert_8cpp.xhtml#ad503e02071cab2e13ef0801abdd0c341":[6,0,4,0,0,3,6],
"benchmark_2_c_l_2_color_convert_8cpp_source.xhtml":[6,0,4,0,0,3],
"benchmark_2_c_l_2_convolution_8cpp.xhtml":[6,0,4,0,0,4],
"benchmark_2_c_l_2_convolution_8cpp.xhtml#a126d8592f568a765365dcc0594d60b12":[6,0,4,0,0,4,9],
"benchmark_2_c_l_2_convolution_8cpp.xhtml#a2feda10ae7b9b9d5f927286a871ccfcb":[6,0,4,0,0,4,18],
"benchmark_2_c_l_2_convolution_8cpp.xhtml#a30c7671edbc051251f33668aaf9f755f":[6,0,4,0,0,4,10],
"benchmark_2_c_l_2_convolution_8cpp.xhtml#a33a1096d8ed57751b602fccd28f311c4":[6,0,4,0,0,4,15],
"benchmark_2_c_l_2_convolution_8cpp.xhtml#a346d949e2588e7ff06dc195844013fe3":[6,0,4,0,0,4,4],
"benchmark_2_c_l_2_convolution_8cpp.xhtml#a480514dca118622dd88d720754b655da":[6,0,4,0,0,4,20],
"benchmark_2_c_l_2_convolution_8cpp.xhtml#a49d317ff253bfbe56ccc36b8756383a0":[6,0,4,0,0,4,13],
"benchmark_2_c_l_2_convolution_8cpp.xhtml#a4f7e7c1722bc3888fa72a9d5ec9756ec":[6,0,4,0,0,4,3],
"benchmark_2_c_l_2_convolution_8cpp.xhtml#a5f36cf423ddd70034eb478cc36690642":[6,0,4,0,0,4,6],
"benchmark_2_c_l_2_convolution_8cpp.xhtml#a6e5a17089673dfe6d68f9f27ddc672f8":[6,0,4,0,0,4,19],
"benchmark_2_c_l_2_convolution_8cpp.xhtml#a7376f94209bcf2a05d0afdd40080dfda":[6,0,4,0,0,4,14],
"benchmark_2_c_l_2_convolution_8cpp.xhtml#a7980910b183d17bc575f5d6276cccec4":[6,0,4,0,0,4,7],
"benchmark_2_c_l_2_convolution_8cpp.xhtml#a845121921070904988b525bfee8618ec":[6,0,4,0,0,4,5],
"benchmark_2_c_l_2_convolution_8cpp.xhtml#a8864abaea5755acba3e284f15d85bc54":[6,0,4,0,0,4,2],
"benchmark_2_c_l_2_convolution_8cpp.xhtml#a961ad665db2c9be351a74b8e84b76521":[6,0,4,0,0,4,11],
"benchmark_2_c_l_2_convolution_8cpp.xhtml#aa9f15b9b5e29d6437f739eafc0001b04":[6,0,4,0,0,4,21],
"benchmark_2_c_l_2_convolution_8cpp.xhtml#ab33b97a5ab32a29527dccd96f8987553":[6,0,4,0,0,4,23],
"benchmark_2_c_l_2_convolution_8cpp.xhtml#ab715a9e01915d02da8f01855403edd8c":[6,0,4,0,0,4,8],
"benchmark_2_c_l_2_convolution_8cpp.xhtml#abe1e46910d48ab0877752f810155f4dd":[6,0,4,0,0,4,17],
"benchmark_2_c_l_2_convolution_8cpp.xhtml#ace2ab3eb7f9a254dd1c11ca2dbe3e445":[6,0,4,0,0,4,0],
"benchmark_2_c_l_2_convolution_8cpp.xhtml#ad5ac3cf6c64c212c685f8b16d293cda4":[6,0,4,0,0,4,24],
"benchmark_2_c_l_2_convolution_8cpp.xhtml#ad7d8ff936757ccaf710dfaa394dda081":[6,0,4,0,0,4,12],
"benchmark_2_c_l_2_convolution_8cpp.xhtml#ae80afc4074fadd96dd61fd86ea84e7e5":[6,0,4,0,0,4,1],
"benchmark_2_c_l_2_convolution_8cpp.xhtml#aee0f88e2b8022d7fc8d2565b63d33f70":[6,0,4,0,0,4,16],
"benchmark_2_c_l_2_convolution_8cpp.xhtml#aefd533b11810b06b35db2729dd834d53":[6,0,4,0,0,4,22],
"benchmark_2_c_l_2_convolution_8cpp_source.xhtml":[6,0,4,0,0,4],
"benchmark_2_c_l_2_convolution_layer_8cpp.xhtml":[6,0,4,0,0,5],
"benchmark_2_c_l_2_convolution_layer_8cpp.xhtml#a055dc623d28a64eea1ea48cf477c0b3f":[6,0,4,0,0,5,21],
"benchmark_2_c_l_2_convolution_layer_8cpp.xhtml#a097ba5d578e7103ef476fe5fe9821ccb":[6,0,4,0,0,5,19],
"benchmark_2_c_l_2_convolution_layer_8cpp.xhtml#a0f31cba68df1678f75ac5a56fff8ba89":[6,0,4,0,0,5,18],
"benchmark_2_c_l_2_convolution_layer_8cpp.xhtml#a1160298a32bad6e541478e388033aaf1":[6,0,4,0,0,5,3],
"benchmark_2_c_l_2_convolution_layer_8cpp.xhtml#a1e14070f002fe276fd014971bfc56d25":[6,0,4,0,0,5,2],
"benchmark_2_c_l_2_convolution_layer_8cpp.xhtml#a27e026534ea3cc2376f8bc5c7ec89994":[6,0,4,0,0,5,12],
"benchmark_2_c_l_2_convolution_layer_8cpp.xhtml#a2aed5930b7e89685d562842c50cd1522":[6,0,4,0,0,5,10],
"benchmark_2_c_l_2_convolution_layer_8cpp.xhtml#a2f665fbffd6cfe74cedf5dcd0facb599":[6,0,4,0,0,5,5],
"benchmark_2_c_l_2_convolution_layer_8cpp.xhtml#a4c7c4bbe8f636428c4f6b88728ef2303":[6,0,4,0,0,5,15],
"benchmark_2_c_l_2_convolution_layer_8cpp.xhtml#a5d95b818519b5889e077646206bf30f8":[6,0,4,0,0,5,1],
"benchmark_2_c_l_2_convolution_layer_8cpp.xhtml#a5dae5a6368d157c789be6341c2b07f56":[6,0,4,0,0,5,7],
"benchmark_2_c_l_2_convolution_layer_8cpp.xhtml#a834ff3152a662fff46917ed60519aaae":[6,0,4,0,0,5,0],
"benchmark_2_c_l_2_convolution_layer_8cpp.xhtml#a87bd1e1892e2d7065e7828c9b11da97e":[6,0,4,0,0,5,20],
"benchmark_2_c_l_2_convolution_layer_8cpp.xhtml#a88ea0900b74fb9ac0c9d86a371e0bde7":[6,0,4,0,0,5,4],
"benchmark_2_c_l_2_convolution_layer_8cpp.xhtml#a89f12d81b2585b2b976f1525388efaeb":[6,0,4,0,0,5,14],
"benchmark_2_c_l_2_convolution_layer_8cpp.xhtml#a8aabacf89d78613a6bc23acb31b1cda2":[6,0,4,0,0,5,8],
"benchmark_2_c_l_2_convolution_layer_8cpp.xhtml#a9997555ebc9bc423e81cd1fbf365cb6e":[6,0,4,0,0,5,17],
"benchmark_2_c_l_2_convolution_layer_8cpp.xhtml#aa4e901538572413489a25551714076bd":[6,0,4,0,0,5,22],
"benchmark_2_c_l_2_convolution_layer_8cpp.xhtml#abbf97d6c51cdf9b5761462afc6a49980":[6,0,4,0,0,5,16],
"benchmark_2_c_l_2_convolution_layer_8cpp.xhtml#ac7ff8b9e37f295db6c54cee4e5ce163f":[6,0,4,0,0,5,13],
"benchmark_2_c_l_2_convolution_layer_8cpp.xhtml#acc33a8b2bd22f6e932d743e73d45ae22":[6,0,4,0,0,5,11],
"benchmark_2_c_l_2_convolution_layer_8cpp.xhtml#ae54757aa5a1c17aa54e07e6870583c6b":[6,0,4,0,0,5,9],
"benchmark_2_c_l_2_convolution_layer_8cpp.xhtml#afacf77d173154bfb7ab8fcacb95941b2":[6,0,4,0,0,5,6],
"benchmark_2_c_l_2_convolution_layer_8cpp_source.xhtml":[6,0,4,0,0,5],
"benchmark_2_c_l_2_depth_concatenate_layer_8cpp.xhtml":[6,0,4,0,0,6],
"benchmark_2_c_l_2_depth_concatenate_layer_8cpp.xhtml#a374381807389133299d7ad40af1f52f9":[6,0,4,0,0,6,2],
"benchmark_2_c_l_2_depth_concatenate_layer_8cpp.xhtml#a785883955ec28a4da99cfb87d75dfa8e":[6,0,4,0,0,6,1],
"benchmark_2_c_l_2_depth_concatenate_layer_8cpp.xhtml#a85cc13cded1c0485c4ad8a90962b298f":[6,0,4,0,0,6,0],
"benchmark_2_c_l_2_depth_concatenate_layer_8cpp_source.xhtml":[6,0,4,0,0,6],
"benchmark_2_c_l_2_depthwise_convolution_layer_8cpp.xhtml":[6,0,4,0,0,7],
"benchmark_2_c_l_2_depthwise_convolution_layer_8cpp.xhtml#a3b4fdd4e87ff1c0b97c9844a26307eb9":[6,0,4,0,0,7,0],
"benchmark_2_c_l_2_depthwise_convolution_layer_8cpp.xhtml#aab9a2ff74a27ae837d32a79a38952228":[6,0,4,0,0,7,2],
"benchmark_2_c_l_2_depthwise_convolution_layer_8cpp.xhtml#acdd93aea7c594c6f966218472f639c8d":[6,0,4,0,0,7,1],
"benchmark_2_c_l_2_depthwise_convolution_layer_8cpp_source.xhtml":[6,0,4,0,0,7],
"benchmark_2_c_l_2_depthwise_separable_convolution_layer_8cpp.xhtml":[6,0,4,0,0,8],
"benchmark_2_c_l_2_depthwise_separable_convolution_layer_8cpp.xhtml#adbf8f2b9106f7141f51b86910dcc52b6":[6,0,4,0,0,8,1],
"benchmark_2_c_l_2_depthwise_separable_convolution_layer_8cpp.xhtml#adc07e82b4049d653c965af2606a7d70f":[6,0,4,0,0,8,0],
"benchmark_2_c_l_2_depthwise_separable_convolution_layer_8cpp_source.xhtml":[6,0,4,0,0,8],
"benchmark_2_c_l_2_dequantization_layer_8cpp.xhtml":[6,0,4,0,0,9],
"benchmark_2_c_l_2_dequantization_layer_8cpp.xhtml#a080692d080fe0724e47b2134d903684a":[6,0,4,0,0,9,0],
"benchmark_2_c_l_2_dequantization_layer_8cpp.xhtml#a38f1923ee95713989bf0c88f113c6265":[6,0,4,0,0,9,1],
"benchmark_2_c_l_2_dequantization_layer_8cpp_source.xhtml":[6,0,4,0,0,9],
"benchmark_2_c_l_2_direct_convolution_layer_8cpp.xhtml":[6,0,4,0,0,10],
"benchmark_2_c_l_2_direct_convolution_layer_8cpp.xhtml#a0dd702fa665a3913967d2358888a6481":[6,0,4,0,0,10,1],
"benchmark_2_c_l_2_direct_convolution_layer_8cpp.xhtml#a44fd9b3d4374ee2eac0bbdf47892dc7b":[6,0,4,0,0,10,4],
"benchmark_2_c_l_2_direct_convolution_layer_8cpp.xhtml#a66f7d56ffdc94301750ed0619c25701a":[6,0,4,0,0,10,7],
"benchmark_2_c_l_2_direct_convolution_layer_8cpp.xhtml#a670e11cac9944ed7a60800d30b35b862":[6,0,4,0,0,10,3],
"benchmark_2_c_l_2_direct_convolution_layer_8cpp.xhtml#a6901e5de23b47330245929a04a5aa467":[6,0,4,0,0,10,9],
"benchmark_2_c_l_2_direct_convolution_layer_8cpp.xhtml#a71eb148a0eedda0a74cd7479e0dfbb3c":[6,0,4,0,0,10,10],
"benchmark_2_c_l_2_direct_convolution_layer_8cpp.xhtml#a82153e3782c4af01a8ccefffde481af5":[6,0,4,0,0,10,8],
"benchmark_2_c_l_2_direct_convolution_layer_8cpp.xhtml#a9f60d83f9eab3a3bb3ad4cfbaa3a4b63":[6,0,4,0,0,10,6],
"benchmark_2_c_l_2_direct_convolution_layer_8cpp.xhtml#ab24276cb024da9639edc77047cb4a351":[6,0,4,0,0,10,5],
"benchmark_2_c_l_2_direct_convolution_layer_8cpp.xhtml#ac69b8e819769eab70f8c59c2885e3413":[6,0,4,0,0,10,2],
"benchmark_2_c_l_2_direct_convolution_layer_8cpp.xhtml#aec4903909e875e6a59b538924704e961":[6,0,4,0,0,10,0],
"benchmark_2_c_l_2_direct_convolution_layer_8cpp_source.xhtml":[6,0,4,0,0,10],
"benchmark_2_c_l_2_equalize_histogram_8cpp.xhtml":[6,0,4,0,0,11],
"benchmark_2_c_l_2_equalize_histogram_8cpp.xhtml#a4bf19467c71f190f563eaff509b44496":[6,0,4,0,0,11,2],
"benchmark_2_c_l_2_equalize_histogram_8cpp.xhtml#a930114ce85e47d921cce8441bd41385c":[6,0,4,0,0,11,0],
"benchmark_2_c_l_2_equalize_histogram_8cpp.xhtml#aaff395c00ddf4de60ac3db3fa25dd839":[6,0,4,0,0,11,1],
"benchmark_2_c_l_2_equalize_histogram_8cpp_source.xhtml":[6,0,4,0,0,11],
"benchmark_2_c_l_2_fast_corners_8cpp.xhtml":[6,0,4,0,0,12]
};
|
$axure.loadCurrentPage(
(function() {
var _ = function() { var r={},a=arguments; for(var i=0; i<a.length; i+=2) r[a[i]]=a[i+1]; return r; }
var _creator = function() { return _(b,c,d,e,f,g,h,g,i,_(j,k),l,[m],n,_(o,p,q,r,s,t,u,_(),v,_(w,x,y,z,A,_(B,C,D,E),F,null,G,z,H,z,I,J,K,null,L,M,N,O,P,Q,R,M),S,_(),T,_(),U,_(V,[_(W,X,Y,j,Z,ba,q,bb,bc,bb,bd,be,v,_(bf,_(bg,bh,bi,bj)),S,_(),bk,_(),bl,bm),_(W,bn,Y,bo,Z,bp,q,bq,bc,bq,bd,be,v,_(br,_(bs,bt,bu,bt)),S,_(),bk,_(),bv,[_(W,bw,Y,bx,Z,by,q,bz,bc,bz,bd,be,v,_(bf,_(bg,bA,bi,bB),w,bC,br,_(bs,bD,bu,bE),bF,bG),S,_(),bk,_(),bH,g),_(W,bI,Y,bJ,Z,bK,q,bz,bc,bL,bd,be,v,_(bf,_(bg,bM,bi,bN),w,bC,br,_(bs,bO,bu,bP),bQ,_(bR,_()),bS,_(B,C,D,bT),R,bU,bF,bV),S,_(),bk,_(),bW,_(bX,bY),bH,g),_(W,bZ,Y,ca,Z,bK,q,bz,bc,bL,bd,be,v,_(bf,_(bg,bM,bi,bN),w,bC,br,_(bs,bO,bu,cb),bQ,_(bR,_()),bS,_(B,C,D,bT),R,bU,bF,bG),S,_(),bk,_(),bW,_(bX,bY),bH,g),_(W,cc,Y,cd,Z,ce,q,cf,bc,cf,bd,be,v,_(P,cg,ch,ci,cj,_(B,C,D,bT,ck,cl),bf,_(bg,cm,bi,cn),bQ,_(co,_(cj,_(B,C,D,cp,ck,cl))),w,cq,br,_(bs,cr,bu,cs),ct,cu,cv,cw),cx,g,S,_(),bk,_(),cy,j),_(W,cz,Y,cA,Z,by,q,bz,bc,bz,bd,be,v,_(P,cg,ch,ci,cj,_(B,C,D,E,ck,cl),bf,_(bg,cs,bi,cB),w,cC,br,_(bs,cD,bu,cE),ct,cu,bF,bG,A,_(B,C,D,bT)),S,_(),bk,_(),T,_(cF,_(cG,cH,cI,[_(cG,cJ,cK,g,cL,_(cM,cN,cO,cP,cQ,_(cM,cN,cO,cR,cQ,_(cM,cS,cT,cU,cV,[_(cM,cW,cX,g,cY,g,cZ,g,da,[db])]),dc,_(cM,dd,da,de,df,[])),dc,_(cM,cN,cO,cR,cQ,_(cM,cS,cT,cU,cV,[_(cM,cW,cX,g,cY,g,cZ,g,da,[dg])]),dc,_(cM,dd,da,dh,df,[]))),di,[_(dj,dk,cG,dl,dm,_(dn,n,b,dp,dq,be),dr,ds)]),_(cG,dt,cK,g,cL,_(cM,cN,cO,du,cQ,_(cM,cN,cO,dv,cQ,_(cM,cS,cT,cU,cV,[_(cM,cW,cX,g,cY,g,cZ,g,da,[db])]),dc,_(cM,dd,da,de,df,[])),dc,_(cM,cN,cO,dv,cQ,_(cM,cS,cT,cU,cV,[_(cM,cW,cX,g,cY,g,cZ,g,da,[dg])]),dc,_(cM,dd,da,dh,df,[]))),di,[_(dj,dw,cG,dx,dy,[_(dz,[dA],dB,_(dC,dD,dE,_(dF,dG,dH,g)))])])])),dI,be,bH,g),_(W,db,Y,dJ,Z,ce,q,cf,bc,cf,bd,be,v,_(bf,_(bg,dK,bi,dL),bQ,_(co,_(cj,_(B,C,D,cp,ck,cl))),w,cq,br,_(bs,dM,bu,dN)),cx,be,S,_(),bk,_(),T,_(cF,_(cG,cH,cI,[_(cG,dJ,cK,g,di,[_(dj,dO,cG,dP,dQ,_(cM,dR,dS,[_(cM,cS,cT,dT,cV,[_(cM,cW,cX,g,cY,g,cZ,g,da,[db]),_(cM,dd,da,de,df,[])])]))])])),dI,be,cy,bJ),_(W,dg,Y,dU,Z,ce,q,cf,bc,cf,bd,be,v,_(bf,_(bg,dK,bi,dL),bQ,_(co,_(cj,_(B,C,D,cp,ck,cl))),w,cq,br,_(bs,dM,bu,dV)),cx,be,S,_(),bk,_(),T,_(cF,_(cG,cH,cI,[_(cG,dU,cK,g,di,[_(dj,dO,cG,dW,dQ,_(cM,dR,dS,[_(cM,cS,cT,dT,cV,[_(cM,cW,cX,g,cY,g,cZ,g,da,[dg]),_(cM,dd,da,dh,df,[])])]))])])),dI,be,cy,ca),_(W,dX,Y,dY,Z,ce,q,cf,bc,cf,bd,be,v,_(cj,_(B,C,D,dZ,ck,cl),bf,_(bg,ea,bi,eb),bQ,_(co,_(cj,_(B,C,D,cp,ck,cl))),w,cq,br,_(bs,ec,bu,ed),cv,cw,A,_(B,C,D,ee)),cx,g,S,_(),bk,_(),T,_(cF,_(cG,cH,cI,[_(cG,ef,cK,g,di,[_(dj,dk,cG,eg,dm,_(dn,eh,ei,_(cM,dd,da,ej,df,[]),dq,g),dr,ds)])])),dI,be,cy,j)],ek,g),_(W,dA,Y,el,Z,bp,q,bq,bc,bq,bd,g,bR,be,v,_(br,_(bs,bt,bu,bt),bd,g),S,_(),bk,_(),bv,[_(W,em,Y,en,Z,by,q,bz,bc,bz,bd,g,bR,be,v,_(P,eo,bf,_(bg,ep,bi,bE),w,eq,br,_(bs,er,bu,es),bF,bG,ct,et),S,_(),bk,_(),bH,g),_(W,eu,Y,ev,Z,by,q,bz,bc,bz,bd,g,bR,be,v,_(P,eo,bf,_(bg,ew,bi,ex),w,cC,br,_(bs,ey,bu,ez),ct,et),S,_(),bk,_(),T,_(cF,_(cG,cH,cI,[_(cG,eA,cK,g,di,[_(dj,dw,cG,eB,dy,[_(dz,[dA],dB,_(dC,eC,dE,_(dF,dG,dH,g)))]),_(dj,dO,cG,eD,dQ,_(cM,dR,dS,[_(cM,cS,cT,dT,cV,[_(cM,cW,cX,g,cY,g,cZ,g,da,[dg]),_(cM,dd,da,j,df,[])]),_(cM,cS,cT,dT,cV,[_(cM,cW,cX,g,cY,g,cZ,g,da,[db]),_(cM,dd,da,j,df,[])])]))])])),dI,be,bH,g)],ek,g)])),eE,_(eF,_(o,eF,q,eG,s,ba,u,_(),v,_(w,x,y,z,A,_(B,C,D,E),F,null,G,z,H,z,I,J,K,null,L,M,N,O,P,Q,R,M),S,_(),T,_(),U,_(V,[_(W,eH,Y,eI,Z,by,q,bz,bc,bz,bd,be,v,_(bf,_(bg,bh,bi,bj),w,bC,A,_(B,C,D,eJ),bS,_(B,C,D,eJ)),S,_(),bk,_(),bH,g)]))),eK,_(eL,_(eM,eN,eO,_(eM,eP)),eQ,_(eM,eR),eS,_(eM,eT),eU,_(eM,eV),eW,_(eM,eX),eY,_(eM,eZ),fa,_(eM,fb),fc,_(eM,fd),fe,_(eM,ff),fg,_(eM,fh),fi,_(eM,fj),fk,_(eM,fl),fm,_(eM,fn)));};
var b="url",c="log_in.html",d="generationDate",e=new Date(1512757774989.68),f="isCanvasEnabled",g=false,h="isAdaptiveEnabled",i="sketchKeys",j="",k="s0",l="variables",m="OnLoadVariable",n="page",o="packageId",p="b8eec4c9d4df4290af9ddc7dfea895c3",q="type",r="Axure:Page",s="name",t="Log In",u="notes",v="style",w="baseStyle",x="627587b6038d43cca051c114ac41ad32",y="pageAlignment",z="near",A="fill",B="fillType",C="solid",D="color",E=0xFFFFFFFF,F="image",G="imageHorizontalAlignment",H="imageVerticalAlignment",I="imageRepeat",J="auto",K="favicon",L="sketchFactor",M="0",N="colorStyle",O="appliedColor",P="fontName",Q="Applied Font",R="borderWidth",S="adaptiveStyles",T="interactionMap",U="diagram",V="objects",W="id",X="f6891af993d74dc4aa9b457f9162aae6",Y="label",Z="friendlyType",ba="BG 1024x768 Outline",bb="referenceDiagramObject",bc="styleType",bd="visible",be=true,bf="size",bg="width",bh=1024,bi="height",bj=768,bk="imageOverrides",bl="masterId",bm="065e543ea3f04698b793bc69c6c83e00",bn="81942007ab3044eba77c781d431d5ab3",bo="Welcome - Log In",bp="Group",bq="layer",br="location",bs="x",bt=0,bu="y",bv="objs",bw="acdc3a8053f34fa38329ca439f382a5a",bx="Log In Box Bg",by="Rectangle",bz="vectorShape",bA=520,bB=404,bC="4b7bfc596114427989e10bb0b557d0ce",bD=252,bE=185,bF="cornerRadius",bG="10",bH="generateCompound",bI="11592941b7fb48309e3ee54ff049d893",bJ="Username",bK="Beveled Rectangle",bL="flowShape",bM=409,bN=61,bO=307,bP=280,bQ="stateStyles",bR="selected",bS="borderFill",bT=0xFF009966,bU="2",bV="120",bW="images",bX="normal~",bY="images/log_in/username_u4.png",bZ="61de94ae79824a9f9a1c12d67df5517d",ca="Password",cb=356,cc="6645f1e1252340d096cebceb5700b9ce",cd="Welcome",ce="Text Field",cf="textBox",cg="'Century Gothic Bold', 'Century Gothic'",ch="fontWeight",ci="700",cj="foreGroundFill",ck="opacity",cl=1,cm=438,cn=62,co="hint",cp=0xFF999999,cq="44157808f2934100b68f2394a66b2bba",cr=293,cs=204,ct="fontSize",cu="28px",cv="horizontalAlignment",cw="center",cx="HideHintOnFocused",cy="placeholderText",cz="b2a36011ac114266bfba7d2161de9eb2",cA="Log In Button",cB=58,cC="c9f35713a1cf4e91a0f2dbac65e6fb5c",cD=410,cE=432,cF="onClick",cG="description",cH="OnClick",cI="cases",cJ="Click without username/ password<br> (If text on Username Click equals "proxyuser" and text on Password Click equals "********")",cK="isNewIfGroup",cL="condition",cM="exprType",cN="binaryOp",cO="op",cP="&&",cQ="leftExpr",cR="==",cS="fcall",cT="functionName",cU="GetWidgetText",cV="arguments",cW="pathLiteral",cX="isThis",cY="isFocused",cZ="isTarget",da="value",db="e6b81344f3aa48aeb5ca9fc22f910eb1",dc="rightExpr",dd="stringLiteral",de="proxyuser",df="stos",dg="5b036408e20e4d2ebea0c8efef9ab2e4",dh="********",di="actions",dj="action",dk="linkWindow",dl="Open Home in Current Window",dm="target",dn="targetType",dp="home.html",dq="includeVariables",dr="linkType",ds="current",dt="No user no pass<br> (Else If text on Username Click does not equal "proxyuser" or text on Password Click does not equal "********")",du="||",dv="!=",dw="fadeWidget",dx="Show Error Pop Up",dy="objectsToFades",dz="objectPath",dA="50691b50de8e46208a5ee09f887007f2",dB="fadeInfo",dC="fadeType",dD="show",dE="options",dF="showType",dG="none",dH="bringToFront",dI="tabbable",dJ="Username Click",dK=384,dL=46,dM=319,dN=287,dO="setFunction",dP="Set text on Username Click equal to "proxyuser"",dQ="expr",dR="block",dS="subExprs",dT="SetWidgetFormText",dU="Password Click",dV=364,dW="Set text on Password Click equal to "********"",dX="9b87dca23e234639baaec9ff9f11f06b",dY="For more info...",dZ=0xFF336633,ea=300,eb=25,ec=362,ed=500,ee=0xFFFFFF,ef="Case 1",eg="Open https://www.linkedin.com/company/cultureddotbio/ in Current Window",eh="webUrl",ei="urlLiteral",ej="https://www.linkedin.com/company/cultureddotbio/",ek="propagate",el="Error Pop Up",em="49ee031ce8584a4884a4b37a62379cd4",en="Error message",eo="'Century Gothic'",ep=273,eq="47641f9a00ac465095d6b672bbdffef6",er=375,es=267,et="20px",eu="c9bf3cb018c04d2aa16055c0b3be4dd3",ev="Error Message Button",ew=131,ex=26,ey=445,ez=403,eA="Close Error Message",eB="Hide Error Pop Up",eC="hide",eD="Set text on Password Click equal to "", and<br> text on Username Click equal to """,eE="masters",eF="065e543ea3f04698b793bc69c6c83e00",eG="Axure:Master",eH="0d21a49b95d14b80b732973b416883ee",eI="Screen Outline",eJ=0xFF339966,eK="objectPaths",eL="f6891af993d74dc4aa9b457f9162aae6",eM="scriptId",eN="u0",eO="0d21a49b95d14b80b732973b416883ee",eP="u1",eQ="81942007ab3044eba77c781d431d5ab3",eR="u2",eS="acdc3a8053f34fa38329ca439f382a5a",eT="u3",eU="11592941b7fb48309e3ee54ff049d893",eV="u4",eW="61de94ae79824a9f9a1c12d67df5517d",eX="u5",eY="6645f1e1252340d096cebceb5700b9ce",eZ="u6",fa="b2a36011ac114266bfba7d2161de9eb2",fb="u7",fc="e6b81344f3aa48aeb5ca9fc22f910eb1",fd="u8",fe="5b036408e20e4d2ebea0c8efef9ab2e4",ff="u9",fg="9b87dca23e234639baaec9ff9f11f06b",fh="u10",fi="50691b50de8e46208a5ee09f887007f2",fj="u11",fk="49ee031ce8584a4884a4b37a62379cd4",fl="u12",fm="c9bf3cb018c04d2aa16055c0b3be4dd3",fn="u13";
return _creator();
})());
|
'use strict'
const path = require('path')
const defaultSettings = require('./src/settings.js')
function resolve(dir) {
return path.join(__dirname, dir)
}
const name = defaultSettings.title || 'vue Element Admin' // page title
// If your port is set to 80,
// use administrator privileges to execute the command line.
// For example, Mac: sudo npm run
// You can change the port by the following method:
// port = 9527 npm run dev OR npm run dev --port = 9527
const port = process.env.port || process.env.npm_config_port || 5678 // dev port
// All configuration item explanations can be find in https://cli.vuejs.org/config/
module.exports = {
/**
* You will need to set publicPath if you plan to deploy your site under a sub path,
* for example GitHub Pages. If you plan to deploy your site to https://foo.github.io/bar/,
* then publicPath should be set to "/bar/".
* In most cases please use '/' !!!
* Detail: https://cli.vuejs.org/config/#publicpath
*/
publicPath: '/',
outputDir: 'dist',
assetsDir: 'static',
lintOnSave: process.env.NODE_ENV === 'development',
productionSourceMap: false,
devServer: {
port: port,
open: true,
overlay: {
warnings: false,
errors: true
},
proxy: {
// change xxx-api/login => mock/login
// detail: https://cli.vuejs.org/config/#devserver-proxy
[process.env.VUE_APP_BASE_API]: {
/* target: `http://127.0.0.1:${port}/mock`, */
target: `http://192.168.2.44:8018/`,
changeOrigin: true,
pathRewrite: {
['^' + process.env.VUE_APP_BASE_API]: ''
}
}
}
//after: require('./mock/mock-server.js')
},
configureWebpack: {
// provide the app's title in webpack's name field, so that
// it can be accessed in index.html to inject the correct title.
name: name,
resolve: {
alias: {
'@': resolve('src')
}
}
},
chainWebpack(config) {
config.plugins.delete('preload') // TODO: need test
config.plugins.delete('prefetch') // TODO: need test
// set svg-sprite-loader
config.module
.rule('svg')
.exclude.add(resolve('src/icons'))
.end()
config.module
.rule('icons')
.test(/\.svg$/)
.include.add(resolve('src/icons'))
.end()
.use('svg-sprite-loader')
.loader('svg-sprite-loader')
.options({
symbolId: 'icon-[name]'
})
.end()
// set preserveWhitespace
config.module
.rule('vue')
.use('vue-loader')
.loader('vue-loader')
.tap(options => {
options.compilerOptions.preserveWhitespace = true
return options
})
.end()
config
// https://webpack.js.org/configuration/devtool/#development
.when(process.env.NODE_ENV === 'development',
config => config.devtool('cheap-source-map')
)
config
.when(process.env.NODE_ENV !== 'development',
config => {
config
.plugin('ScriptExtHtmlWebpackPlugin')
.after('html')
.use('script-ext-html-webpack-plugin', [{
// `runtime` must same as runtimeChunk name. default is `runtime`
inline: /runtime\..*\.js$/
}])
.end()
config
.optimization.splitChunks({
chunks: 'all',
cacheGroups: {
libs: {
name: 'chunk-libs',
test: /[\\/]node_modules[\\/]/,
priority: 10,
chunks: 'initial' // only package third parties that are initially dependent
},
elementUI: {
name: 'chunk-elementUI', // split elementUI into a single package
priority: 20, // the weight needs to be larger than libs and app or it will be packaged into libs or app
test: /[\\/]node_modules[\\/]_?element-ui(.*)/ // in order to adapt to cnpm
},
commons: {
name: 'chunk-commons',
test: resolve('src/components'), // can customize your rules
minChunks: 3, // minimum common number
priority: 5,
reuseExistingChunk: true
}
}
})
config.optimization.runtimeChunk('single')
}
)
}
}
|
import { bindActionCreators } from 'redux';
import { connect } from 'react-redux';
import React, { Component, PropTypes } from 'react';
import Button from 'qnui/lib/button';
import 'qnui/lib/grid/index.css';
import { Row, Col } from 'qnui/lib/grid';
import './../CfSetting/cf.css';
import Select, {Option} from 'qnui/lib/select';
import Checkbox from 'qnui/lib/checkbox';
import Radio,{ Group as RadioGroup } from 'qnui/lib/radio';
import Feedback from 'qnui/lib/feedback';
import Input from 'qnui/lib/input';
import ZcpSetting from '../../../components/Messagecon/ZcpSetting'
class ZcpSet extends Component {
render(){
return (
<ZcpSetting/>
);
}
}
export default ZcpSet
|
/** @jsx h */
import { Transforms } from '../../../src'
export default editor => Transforms.decreaseSectionDepth(editor)
export const input = <editor>
<section>
<title>Test</title>
<p><cursor/>Paragraph</p>
</section>
</editor>
export const output = <editor>
<section>
<title>Test</title>
<p><cursor/>Paragraph</p>
</section>
</editor>
|
;(function($, window, document, undefined){
// our plugin constructor
var OnePageNav = function(elem, options){
this.elem = elem;
this.$elem = $(elem);
this.options = options;
this.metadata = this.$elem.data('plugin-options');
this.$win = $(window);
this.sections = {};
this.didScroll = false;
this.$doc = $(document);
this.docHeight = this.$doc.height();
};
// the plugin prototype
OnePageNav.prototype = {
defaults: {
navItems: 'a',
currentClass: 'current',
changeHash: false,
easing: 'swing',
filter: '',
scrollSpeed: 750,
scrollThreshold: 0.5,
begin: false,
end: false,
scrollChange: false
},
init: function() {
// Introduce defaults that can be extended either
// globally or using an object literal.
this.config = $.extend({}, this.defaults, this.options, this.metadata);
this.$nav = this.$elem.find(this.config.navItems);
//Filter any links out of the nav
if(this.config.filter !== '') {
this.$nav = this.$nav.filter(this.config.filter);
}
//Handle clicks on the nav
this.$nav.on('click.onePageNav', $.proxy(this.handleClick, this));
//Get the section positions
this.getPositions();
//Handle scroll changes
this.bindInterval();
//Update the positions on resize too
this.$win.on('resize.onePageNav', $.proxy(this.getPositions, this));
return this;
},
adjustNav: function(self, $parent) {
self.$elem.find('.' + self.config.currentClass).removeClass(self.config.currentClass);
$parent.addClass(self.config.currentClass);
},
bindInterval: function() {
var self = this;
var docHeight;
self.$win.on('scroll.onePageNav', function() {
self.didScroll = true;
});
self.t = setInterval(function() {
docHeight = self.$doc.height();
//If it was scrolled
if(self.didScroll) {
self.didScroll = false;
self.scrollChange();
}
//If the document height changes
if(docHeight !== self.docHeight) {
self.docHeight = docHeight;
self.getPositions();
}
}, 250);
},
getHash: function($link) {
return $link.attr('href').split('#')[1];
},
getPositions: function() {
var self = this;
var linkHref;
var topPos;
var $target;
self.$nav.each(function() {
linkHref = self.getHash($(this));
$target = $('#' + linkHref);
if($target.length) {
topPos = $target.offset().top;
self.sections[linkHref] = Math.round(topPos);
}
});
},
getSection: function(windowPos) {
var returnValue = null;
var windowHeight = Math.round(this.$win.height() * this.config.scrollThreshold);
for(var section in this.sections) {
if((this.sections[section] - windowHeight) < windowPos) {
returnValue = section;
}
}
return returnValue;
},
handleClick: function(e) {
var self = this;
var $link = $(e.currentTarget);
var $parent = $link.parent();
var newLoc = '#' + self.getHash($link);
if(!$parent.hasClass(self.config.currentClass)) {
//Start callback
if(self.config.begin) {
self.config.begin();
}
//Change the highlighted nav item
self.adjustNav(self, $parent);
//Removing the auto-adjust on scroll
self.unbindInterval();
//Scroll to the correct position
self.scrollTo(newLoc, function() {
//Do we need to change the hash?
if(self.config.changeHash) {
window.location.hash = newLoc;
}
//Add the auto-adjust on scroll back in
self.bindInterval();
//End callback
if(self.config.end) {
self.config.end();
}
});
}
e.preventDefault();
},
scrollChange: function() {
var windowTop = this.$win.scrollTop();
var position = this.getSection(windowTop);
var $parent;
//If the position is set
if(position !== null) {
$parent = this.$elem.find('a[href$="#' + position + '"]').parent();
//If it's not already the current section
if(!$parent.hasClass(this.config.currentClass)) {
//Change the highlighted nav item
this.adjustNav(this, $parent);
//If there is a scrollChange callback
if(this.config.scrollChange) {
this.config.scrollChange($parent);
}
}
}
},
scrollTo: function(target, callback) {
var offset = $(target).offset().top;
$('html, body').animate({
scrollTop: offset
}, this.config.scrollSpeed, this.config.easing, callback);
},
unbindInterval: function() {
clearInterval(this.t);
this.$win.unbind('scroll.onePageNav');
}
};
OnePageNav.defaults = OnePageNav.prototype.defaults;
$.fn.onePageNav = function(options) {
return this.each(function() {
new OnePageNav(this, options).init();
});
};
})( jQuery, window , document );
|
let likesTally = 0
const button = document.getElementById('button')
const username = document.getElementById('username')
const div1 = document.getElementById('div1')
const div2 = document.getElementById('div2')
const images= []
const likeButton = document.getElementsByClassName('likebutton')
const likesDiv = document.createElement('div')
div1.appendChild(likesDiv)
let usernameValue =''
saveImages()
username.addEventListener('change', saveUsername)
const likePhoto = () => {
likesTally ++
console.log('This photo has been liked and to5al likes are now: ',likesTally)
likesDiv.innerHTML = `Total: ${likesTally}`
}
function saveUsername() {
usernameValue = username.value
}
button.addEventListener('click', login)
function login() {
if(usernameValue==='Draydon'){
showImages()
} else {
// showImages() // For debugging (remove)
alert('wrong user name')
}
}
function saveImages() {
fetch('https://jsonplaceholder.typicode.com/photos?_start=0&_limit=5')
.then(response => response.json())
.then(json => images.push(json))
}
function showImages() {
// console.log(images[0][0])
let i = 0
while (i <= 4) {
let div = document.createElement('div')
let img = document.createElement('img')
let likeButton = document.createElement('BUTTON')
likeButton.innerHTML = 'like'
likeButton.className = 'likebutton'
likeButton.addEventListener('click', likePhoto)
div.innerHTML = images[0][i].title
div.className = 'imageTitle'
div2.appendChild(div)
img.src = images[0][i].url
img.className = 'image'
div.appendChild(img)
div.appendChild(likeButton)
console.log(img)
console.log(div)
i++
}
}
console.log(images)
// const Image = {
// albumId: 1,
// id: 1,
// thumbnailUrl: "https://via.placeholder.com/150/92c952",
// title: "accusamus beatae ad facilis cum similique qui sunt",
// url: "https://via.placeholder.com/600/92c952"
// }
|
import React from 'react';
import {Grid, Row, Col, Accordion, Panel, ListGroup, ListGroupItem, Button,Table} from 'react-bootstrap';
import axios from 'axios';
class ReagentDatasets extends React.Component {
constructor(props){
super(props)
this.state = {
datasets:[],
totaldocuments:""
}
this.handleSerice = props.handleChange;
}
componentDidMount(){
this.getDatasets();
}
getDatasets(){
axios.request({
method:'get',
url:'http://lincsportal.ccs.miami.edu/dcic/api/fetchdata?fields=datasetname,datasetgroup,assayname,centerletter,centerurl,assaydesignmethod,biologicalbucket&limit=200&searchTerm='+this.props.id+'"&skip=0'
}).then((response) => {
this.setState({datasets: response.data.results.documents,totaldocuments: response.data.results.totalDocuments}, () => {
});
}).catch((error) => {
console.log(error);
});
}
render() {
let datasetItems;
datasetItems = this.state.datasets.map(dataset => {
let id = dataset.datasetgroup;
let title = dataset.datasetname;
let assay = dataset.assayname;
let center = "/media/icons/" + dataset.centerletter + ".png";
let area = dataset.biologicalbucket;
let sourcelink = dataset.centerdatasetid;
return (
<tr key={id}>
<td style={{fontSize: "0.8rem",padding: ".3rem"}}>
<a style={{ color: "#337ab7"}} className="data-button"
href={`/signatures/datasets/${dataset.datasetgroup}`}>{id}</a>
</td>
<td style={{fontSize: "0.8rem",padding: ".3rem"}}>
{title}
</td>
<td style={{fontSize: "0.8rem",padding: ".3rem"}} >
<img className="listcenterimage" src={center} role="presentation"/>
</td>
<td style={{fontSize: "0.8rem",padding: ".3rem"}}>{assay}</td>
<td style={{fontSize: "0.8rem",padding: ".3rem"}}>{area}</td>
</tr>
)
});
return (
<div >
<h5 style={{color:"#CC3300"}}>Datasets : {this.state.totaldocuments}</h5>
<hr style={{borderTop: "1px solid #CC3300"}} />
<Table bordered >
<thead>
<tr>
<th style={{width:"10%",fontSize: "0.8rem",padding: ".3rem"}}>ID</th>
<th style={{width:"40%",fontSize: "0.8rem",padding: ".3rem"}}>Dataset</th>
<th style={{width:"10%",fontSize: "0.8rem",padding: ".3rem"}}>Center</th>
<th style={{width:"20%",fontSize: "0.8rem",padding: ".3rem"}}>Assay</th>
<th style={{width:"10%",fontSize: "0.8rem",padding: ".3rem"}}>Subject Area</th>
</tr>
</thead>
<tbody>
{datasetItems}
</tbody>
</Table>
</div>
);
}
}
export default ReagentDatasets;
|
import React, { useContext } from 'react';
import curry from 'lodash/curry';
import isEmpty from 'lodash/isEmpty';
import PluginContext from './PluginContext';
/** withPlugins should be the innermost HOC */
function _withPlugins(targetName, TargetComponent) { // eslint-disable-line no-underscore-dangle
/** */
function PluginHoc(props, ref) {
const pluginMap = useContext(PluginContext);
const passDownProps = {
...props,
};
if (ref) passDownProps.ref = ref;
if (isEmpty(pluginMap)) {
return <TargetComponent {...passDownProps} />;
}
const plugins = pluginMap[targetName];
if (isEmpty(plugins)) {
return <TargetComponent {...passDownProps} />;
}
if (!isEmpty(plugins.wrap) && !isEmpty(plugins.add)) {
const WrapPluginComponent = plugins.wrap[0].component;
const AddPluginComponents = plugins.add.map(plugin => plugin.component);
return (
<WrapPluginComponent
targetProps={passDownProps}
{...passDownProps}
PluginComponents={AddPluginComponents}
TargetComponent={TargetComponent}
/>
);
}
if (!isEmpty(plugins.wrap)) {
const PluginComponent = plugins.wrap[0].component;
return <PluginComponent targetProps={passDownProps} TargetComponent={TargetComponent} />;
}
if (!isEmpty(plugins.add)) {
const PluginComponents = plugins.add.map(plugin => plugin.component);
return <TargetComponent {...passDownProps} PluginComponents={PluginComponents} />;
}
}
const whatever = React.forwardRef(PluginHoc);
whatever.displayName = `WithPlugins(${targetName})`;
return whatever;
}
/** withPlugins('MyComponent')(MyComponent) */
export const withPlugins = curry(_withPlugins);
|
/**
* EasyBimehLandingLib
*
* This file was automatically generated by APIMATIC v2.0 ( https://apimatic.io ).
*/
'use strict';
const BaseModel = require('./BaseModel');
/**
* Creates an instance of LiabilityDoctorInsurancePolicyFilter
*/
class LiabilityDoctorInsurancePolicyFilter extends BaseModel {
/**
* @constructor
* @param {Object} obj The object passed to constructor
*/
constructor(obj) {
super(obj);
if (obj === undefined || obj === null) return;
this.expertiseParamId = this.constructor.getValue(obj.expertiseParamId);
this.isResident = this.constructor.getValue(obj.isResident);
this.isStudent = this.constructor.getValue(obj.isStudent);
this.riskLevelId = this.constructor.getValue(obj.riskLevelId);
this.activityAreaParamId = this.constructor.getValue(obj.activityAreaParamId);
this.commitmentCeilingParamId = this.constructor.getValue(obj.commitmentCeilingParamId);
this.insuranceExtraCoverageIds = this.constructor.getValue(obj.insuranceExtraCoverageIds);
this.policyTermId = this.constructor.getValue(obj.policyTermId);
this.insuranceCentreSubDomainName =
this.constructor.getValue(obj.insuranceCentreSubDomainName);
this.insuranceCentreId = this.constructor.getValue(obj.insuranceCentreId);
this.insuranceCompanyId = this.constructor.getValue(obj.insuranceCompanyId);
this.isSearchQuery = this.constructor.getValue(obj.isSearchQuery);
this.giftCode = this.constructor.getValue(obj.giftCode);
this.customerUserId = this.constructor.getValue(obj.customerUserId);
}
/**
* Function containing information about the fields of this model
* @return {array} Array of objects containing information about the fields
*/
static mappingInfo() {
return super.mappingInfo().concat([
{ name: 'expertiseParamId', realName: 'expertiseParamId' },
{ name: 'isResident', realName: 'isResident' },
{ name: 'isStudent', realName: 'isStudent' },
{ name: 'riskLevelId', realName: 'riskLevelId' },
{ name: 'activityAreaParamId', realName: 'activityAreaParamId' },
{ name: 'commitmentCeilingParamId', realName: 'commitmentCeilingParamId' },
{ name: 'insuranceExtraCoverageIds', realName: 'insuranceExtraCoverageIds' },
{ name: 'policyTermId', realName: 'policyTermId' },
{ name: 'insuranceCentreSubDomainName', realName: 'insuranceCentreSubDomainName' },
{ name: 'insuranceCentreId', realName: 'insuranceCentreId' },
{ name: 'insuranceCompanyId', realName: 'insuranceCompanyId' },
{ name: 'isSearchQuery', realName: 'isSearchQuery' },
{ name: 'giftCode', realName: 'giftCode' },
{ name: 'customerUserId', realName: 'customerUserId' },
]);
}
/**
* Function containing information about discriminator values
* mapped with their corresponding model class names
*
* @return {object} Object containing Key-Value pairs mapping discriminator
* values with their corresponding model classes
*/
static discriminatorMap() {
return {};
}
}
module.exports = LiabilityDoctorInsurancePolicyFilter;
|
import { isDefined } from '../common/predicates';
import { noop } from '../common/common';
/** A `LocationConfig` mock that gets/sets all config from an in-memory object */
var MemoryLocationConfig = /** @class */ (function () {
function MemoryLocationConfig() {
var _this = this;
this.dispose = noop;
this._baseHref = '';
this._port = 80;
this._protocol = 'http';
this._host = 'localhost';
this._hashPrefix = '';
this.port = function () { return _this._port; };
this.protocol = function () { return _this._protocol; };
this.host = function () { return _this._host; };
this.baseHref = function () { return _this._baseHref; };
this.html5Mode = function () { return false; };
this.hashPrefix = function (newval) { return isDefined(newval) ? _this._hashPrefix = newval : _this._hashPrefix; };
}
return MemoryLocationConfig;
}());
export { MemoryLocationConfig };
//# sourceMappingURL=memoryLocationConfig.js.map
|
/* global echarts, EChartsJenkinsApi */
/**
* Renders a trend chart in the specified div using ECharts.
*
* @param {String} chartDivId - the ID of the div where the chart should be shown in
* @param {String} enableLinks - determines if the chart is clickable. If the chart is clickable, then clicking on a
* chart will open the results of the selected build.
* @param {Object} ajaxProxy - AJAX proxy of the endpoint in Jenkins Java model object
*/
EChartsJenkinsApi.prototype.renderTrendChart = function (chartDivId, enableLinks, ajaxProxy) {
/**
* Renders a trend chart in the specified div using ECharts.
*
* @param {HTMLElement} chartPlaceHolder - the div where the chart should be shown in
* @param {Object} chart - the ECharts instance
* @param {String} model - the line chart model
* @param {Boolean} enableOnClickHandler - to enable clicking on the chart to see the results
*/
function render(chartPlaceHolder, chart, model, enableOnClickHandler) { // eslint-disable-line no-unused-vars
const chartModel = JSON.parse(model);
let selectedBuild; // the tooltip formatter will change this value while hoovering
if (enableOnClickHandler) {
const urlName = chartPlaceHolder.getAttribute("tool");
if (urlName) {
chartPlaceHolder.onclick = function () {
if (urlName && selectedBuild > 0) {
window.location.assign(selectedBuild + '/' + urlName);
}
};
}
}
const options = {
tooltip: {
trigger: 'axis',
axisPointer: {
type: 'cross',
label: {
backgroundColor: '#6a7985'
}
},
formatter: function (params, ticket, callback) {
if (params.componentType === 'legend') {
selectedBuild = 0;
return params.name;
}
const builds = chartModel.buildNumbers;
const labels = chartModel.domainAxisLabels;
for (let i = 0; i < builds.length; i++) {
if (params[0].name === labels[i]) {
selectedBuild = builds[i];
break;
}
}
let text = 'Build ' + params[0].name.escapeHTML();
for (let i = 0, l = params.length; i < l; i++) {
text += '<br/>' + params[i].marker + params[i].seriesName + ' : ' + params[i].value;
}
text += '<br />';
return '<div style="text-align:left">' + text + '</div>';
}
},
legend: {
orient: 'horizontal',
type: 'scroll',
x: 'center',
y: 'top'
},
grid: {
left: '20',
right: '10',
bottom: '10',
top: '30',
containLabel: true
},
xAxis: [{
type: 'category',
boundaryGap: false,
data: chartModel.domainAxisLabels
}
],
yAxis: [{
type: 'value'
}
],
series: chartModel.series
};
chart.hideLoading();
chart.setOption(options);
chart.on('legendselectchanged', function (params) {
selectedBuild = 0; // clear selection to avoid navigating to the selected build
});
chart.resize();
window.onresize = function () {
chart.resize();
};
}
const chartPlaceHolder = document.getElementById(chartDivId);
const chart = echarts.init(chartPlaceHolder);
chart.showLoading();
chartPlaceHolder.echart = chart;
ajaxProxy.getBuildTrendModel(function (trendModel) {
render(chartPlaceHolder, chart, trendModel.responseJSON, !!(enableLinks && enableLinks !== "false"));
});
}
|
import _class_call_check from "@swc/helpers/src/_class_call_check.mjs";
var STRING, M, A = function() {
"use strict";
function A() {
_class_call_check(this, A);
}
return A.foo = function() {
return "";
}, A;
}();
!function(M) {
var n;
M.n = n;
}(M || (M = {}));
var objA = new A();
objA.a, M.n, A.foo(), STRING.charAt(0), objA.a, M.n;
|
'use strict';
var mongoose = require('mongoose');
var Schema = mongoose.Schema;
var TaskSchema = new Schema({
name: {
type: String,
Required: 'Kindly enter the name of the task'
},
Created_date: {
type: Date,
default: Date.now
},
status: {
type: [{
type: String,
enum: ['pending', 'ongoing', 'completed']
}],
default: ['pending']
}
});
module.exports = mongoose.model('Tasks', TaskSchema);
|
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.ReferenceEvent = void 0;
const events = require("@aws-cdk/aws-events");
/**
* Fields of CloudWatch Events that change references.
*
* @see https://docs.aws.amazon.com/AmazonCloudWatch/latest/events/EventTypes.html#codebuild_event_type
*/
class ReferenceEvent {
/**
* The type of reference event.
*
* 'referenceCreated', 'referenceUpdated' or 'referenceDeleted'
*/
static get eventType() {
return events.EventField.fromPath('$.detail.event');
}
/**
* Name of the CodeCommit repository.
*/
static get repositoryName() {
return events.EventField.fromPath('$.detail.repositoryName');
}
/**
* Id of the CodeCommit repository.
*/
static get repositoryId() {
return events.EventField.fromPath('$.detail.repositoryId');
}
/**
* Type of reference changed.
*
* 'branch' or 'tag'
*/
static get referenceType() {
return events.EventField.fromPath('$.detail.referenceType');
}
/**
* Name of reference changed (branch or tag name).
*/
static get referenceName() {
return events.EventField.fromPath('$.detail.referenceName');
}
/**
* Full reference name.
*
* For example, 'refs/tags/myTag'
*/
static get referenceFullName() {
return events.EventField.fromPath('$.detail.referenceFullName');
}
/**
* Commit id this reference now points to.
*/
static get commitId() {
return events.EventField.fromPath('$.detail.commitId');
}
constructor() {
}
}
exports.ReferenceEvent = ReferenceEvent;
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZXZlbnRzLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiZXZlbnRzLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7OztBQUFBLDhDQUE4Qzs7Ozs7O0FBTzlDLE1BQWEsY0FBYzs7Ozs7O0lBTWxCLE1BQU0sS0FBSyxTQUFTO1FBQ3pCLE9BQU8sTUFBTSxDQUFDLFVBQVUsQ0FBQyxRQUFRLENBQUMsZ0JBQWdCLENBQUMsQ0FBQztJQUN0RCxDQUFDOzs7O0lBS00sTUFBTSxLQUFLLGNBQWM7UUFDOUIsT0FBTyxNQUFNLENBQUMsVUFBVSxDQUFDLFFBQVEsQ0FBQyx5QkFBeUIsQ0FBQyxDQUFDO0lBQy9ELENBQUM7Ozs7SUFLTSxNQUFNLEtBQUssWUFBWTtRQUM1QixPQUFPLE1BQU0sQ0FBQyxVQUFVLENBQUMsUUFBUSxDQUFDLHVCQUF1QixDQUFDLENBQUM7SUFDN0QsQ0FBQzs7Ozs7O0lBT00sTUFBTSxLQUFLLGFBQWE7UUFDN0IsT0FBTyxNQUFNLENBQUMsVUFBVSxDQUFDLFFBQVEsQ0FBQyx3QkFBd0IsQ0FBQyxDQUFDO0lBQzlELENBQUM7Ozs7SUFLTSxNQUFNLEtBQUssYUFBYTtRQUM3QixPQUFPLE1BQU0sQ0FBQyxVQUFVLENBQUMsUUFBUSxDQUFDLHdCQUF3QixDQUFDLENBQUM7SUFDOUQsQ0FBQzs7Ozs7O0lBT00sTUFBTSxLQUFLLGlCQUFpQjtRQUNqQyxPQUFPLE1BQU0sQ0FBQyxVQUFVLENBQUMsUUFBUSxDQUFDLDRCQUE0QixDQUFDLENBQUM7SUFDbEUsQ0FBQzs7OztJQUtNLE1BQU0sS0FBSyxRQUFRO1FBQ3hCLE9BQU8sTUFBTSxDQUFDLFVBQVUsQ0FBQyxRQUFRLENBQUMsbUJBQW1CLENBQUMsQ0FBQztJQUN6RCxDQUFDO0lBRUQ7SUFDQSxDQUFDO0NBQ0Y7QUExREQsd0NBMERDIiwic291cmNlc0NvbnRlbnQiOlsiaW1wb3J0ICogYXMgZXZlbnRzIGZyb20gJ0Bhd3MtY2RrL2F3cy1ldmVudHMnO1xuXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBcbmV4cG9ydCBjbGFzcyBSZWZlcmVuY2VFdmVudCB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXG4gIHB1YmxpYyBzdGF0aWMgZ2V0IGV2ZW50VHlwZSgpIHtcbiAgICByZXR1cm4gZXZlbnRzLkV2ZW50RmllbGQuZnJvbVBhdGgoJyQuZGV0YWlsLmV2ZW50Jyk7XG4gIH1cblxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBcbiAgcHVibGljIHN0YXRpYyBnZXQgcmVwb3NpdG9yeU5hbWUoKSB7XG4gICAgcmV0dXJuIGV2ZW50cy5FdmVudEZpZWxkLmZyb21QYXRoKCckLmRldGFpbC5yZXBvc2l0b3J5TmFtZScpO1xuICB9XG5cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFxuICBwdWJsaWMgc3RhdGljIGdldCByZXBvc2l0b3J5SWQoKSB7XG4gICAgcmV0dXJuIGV2ZW50cy5FdmVudEZpZWxkLmZyb21QYXRoKCckLmRldGFpbC5yZXBvc2l0b3J5SWQnKTtcbiAgfVxuXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXG4gIHB1YmxpYyBzdGF0aWMgZ2V0IHJlZmVyZW5jZVR5cGUoKSB7XG4gICAgcmV0dXJuIGV2ZW50cy5FdmVudEZpZWxkLmZyb21QYXRoKCckLmRldGFpbC5yZWZlcmVuY2VUeXBlJyk7XG4gIH1cblxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXG4gIHB1YmxpYyBzdGF0aWMgZ2V0IHJlZmVyZW5jZU5hbWUoKSB7XG4gICAgcmV0dXJuIGV2ZW50cy5FdmVudEZpZWxkLmZyb21QYXRoKCckLmRldGFpbC5yZWZlcmVuY2VOYW1lJyk7XG4gIH1cblxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBcbiAgcHVibGljIHN0YXRpYyBnZXQgcmVmZXJlbmNlRnVsbE5hbWUoKSB7XG4gICAgcmV0dXJuIGV2ZW50cy5FdmVudEZpZWxkLmZyb21QYXRoKCckLmRldGFpbC5yZWZlcmVuY2VGdWxsTmFtZScpO1xuICB9XG5cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBcbiAgcHVibGljIHN0YXRpYyBnZXQgY29tbWl0SWQoKSB7XG4gICAgcmV0dXJuIGV2ZW50cy5FdmVudEZpZWxkLmZyb21QYXRoKCckLmRldGFpbC5jb21taXRJZCcpO1xuICB9XG5cbiAgcHJpdmF0ZSBjb25zdHJ1Y3RvcigpIHtcbiAgfVxufVxuIl19
|
import { css } from 'lit-element';
export const BsCardOverlayCss = css`
:host {
position: absolute;
top: 0;
right: 0;
bottom: 0;
left: 0;
padding: 1.25rem;
}
`;
|
var http = require('http'),
path = require('path'),
methods = require('methods'),
express = require('express'),
bodyParser = require('body-parser'),
session = require('express-session'),
cors = require('cors'),
passport = require('passport'),
errorhandler = require('errorhandler'),
mongoose = require('mongoose');
var isProduction = process.env.NODE_ENV === 'production';
// Create global app object
var app = express();
app.use(cors());
// Normal express config defaults
app.use(require('morgan')('dev'));
app.use(bodyParser.urlencoded({ extended: false }));
app.use(bodyParser.json());
app.use(require('method-override')());
app.use(express.static(__dirname + '/public'));
app.use(session({ secret: 'conduit', cookie: { maxAge: 60000 }, resave: false, saveUninitialized: false }));
if (!isProduction) {
app.use(errorhandler());
}
if(isProduction){
mongoose.connect(process.env.MONGODB_URI);
} else {
mongoose.connect('mongodb://mongo:27017/conduit');
mongoose.set('debug', true);
}
require('./models/User');
require('./models/Article');
require('./models/Comment');
require('./config/passport');
app.use(require('./routes'));
/// catch 404 and forward to error handler
app.use(function(req, res, next) {
var err = new Error('Not Found');
err.status = 404;
next(err);
});
/// error handlers
// development error handler
// will print stacktrace
if (!isProduction) {
app.use(function(err, req, res, next) {
console.log(err.stack);
res.status(err.status || 500);
res.json({'errors': {
message: err.message,
error: err
}});
});
}
// production error handler
// no stacktraces leaked to user
app.use(function(err, req, res, next) {
res.status(err.status || 500);
res.json({'errors': {
message: err.message,
error: {}
}});
});
// finally, let's start our server...
var server = app.listen( process.env.PORT || 3000, function(){
console.log('Listening on port ' + server.address().port);
});
|
let collectionsWithAbundace = 0;
let oldLat = location_site_lat;
let oldLon = location_site_long;
let taxonAbundanceOnChange = function (e) {
let value = parseInt(e.target.value);
if (value) {
if (value > 0) {
$(e.target).parent().parent().find('.observed').prop('checked', true);
collectionsWithAbundace += 1;
return true;
}
}
$(e.target).parent().parent().find('.observed').prop('checked', false);
collectionsWithAbundace -= 1;
};
let taxaIdList = [];
let taxonAutocompleteHandler = {
source: function (request, response) {
$.ajax({
url: '/species-autocomplete/?term=' + encodeURIComponent(request.term) + '&exclude=' + taxaIdList.join() + '&taxonGroup=Fish',
type: 'get',
dataType: 'json',
success: function (data) {
response($.map(data, function (item) {
return {
label: item.species,
value: item.id
}
}));
}
});
},
minLength: 3,
open: function (event, ui) {
setTimeout(function () {
$('.ui-autocomplete').css('z-index', 99);
}, 0);
},
select: function (e, u) {
e.preventDefault();
let $target = $(e.target);
let $parent = $target.parent().parent();
taxaIdList.push(u.item.value);
$parent.html(
'<td scope="row" class="taxon-name">' +
u.item.label +
'<input type="hidden" class="taxon-id" value="' + u.item.value + '">' +
'</td>');
$parent.append(
'<td>' +
'<div class="form-check">' +
'<input class="form-check-input observed" type="checkbox"' +
' value="True"' +
' name="' + u.item.value + '-observed">' +
' <label class="form-check-label">' +
' </label>' +
'</div>' +
'</td>');
let taxonAbundanceInput = $('<input type="number" min="0"' +
' name="' + u.item.value + '-abundance"' +
' class="form-control taxon-abundance"' +
' placeholder="0">');
let tdTaxonAbundance = $('<td>');
tdTaxonAbundance.append(taxonAbundanceInput);
$parent.append(tdTaxonAbundance);
taxonAbundanceInput.change(taxonAbundanceOnChange);
let samplingMethodContainer = $($('#sampling-method-container').html());
samplingMethodContainer.attr('name', u.item.value + '-sampling-method');
let samplingMethodTd = $('<td>');
samplingMethodTd.append(samplingMethodContainer);
samplingMethodTd.appendTo($parent);
let samplingEffortContainer = $($('#sampling-effort-container').html());
$(samplingEffortContainer[0]).attr('name', u.item.value + '-sampling-effort');
$(samplingEffortContainer[2]).attr('name', u.item.value + '-sampling-effort-type');
let samplingEffortTd = $('<td>');
samplingEffortTd.append(samplingEffortContainer);
samplingEffortTd.appendTo($parent);
}
};
$('#latitude').keyup((e) => {
let $target = $(e.target);
if (!document.getElementById('update-coordinate').disabled) {
return;
}
if ($target.val() !== oldLat) {
document.getElementById('update-coordinate').disabled = false;
}
});
$('#longitude').keyup((e) => {
let $target = $(e.target);
if (!document.getElementById('update-coordinate').disabled) {
return;
}
if ($target.val() !== oldLon) {
document.getElementById('update-coordinate').disabled = false;
}
});
let markerSource = new ol.source.Vector();
let map = null;
let updateCoordinateHandler = (e) => {
let latitude = $('#latitude').val();
let longitude = $('#longitude').val();
let tableBody = $('#closest-site-table-body');
if (oldLat !== latitude || oldLon !== longitude) {
} else {
return false;
}
oldLat = latitude;
oldLon = longitude;
document.getElementById('update-coordinate').disabled = true;
moveMarkerOnTheMap(latitude, longitude);
if ($('#add-new-site-container').is(":visible")) {
return false;
}
$('#closest-sites-container').show();
tableBody.html('');
let radius = 10;
$.ajax({
url: '/api/get-site-by-coord/?lon=' + longitude + '&lat=' + latitude + '&radius=' + radius,
success: function (all_data) {
$.each(all_data, function (index, data) {
let row = $('<tr>' +
'<td>' + (data['site_code'] ? data['site_code'] : '-') + '</td>' +
'<td>' + data['name'] + '</td>' +
'<td>' + (data['distance_m'] / 1000).toFixed(2) + ' km </td>' +
'<td> <button type="button" data-id="' + data['id'] + '" data-lat="' + data['latitude'] + '" data-lon="' + data['longitude'] + '" class="btn btn-info choose-site">' +
'<i class="fa fa-search" aria-hidden="true"></i></button> </td>' +
'</tr>');
row.find('.choose-site').click(chooseSiteHandler);
tableBody.append(row);
});
}
});
};
$('.close-nearest-list-table').click(() => {
$('#closest-site-table-body').html('');
$('#closest-sites-container').hide();
});
let chooseSiteHandler = (e) => {
e.preventDefault();
let target = $(e.target);
if (!target.hasClass('choose-site')) {
target = target.parent();
}
let latitude = parseFloat(target.data('lat'));
let longitude = parseFloat(target.data('lon'));
oldLat = latitude.toString();
oldLon = longitude.toString();
document.getElementById('update-coordinate').disabled = true;
let siteId = target.data('id');
let siteCode = target.parent().parent().children().eq(0).html();
let siteIdentifier = target.parent().parent().children().eq(1).html();
if (siteCode !== '-') {
siteIdentifier = siteCode
}
$('#site-id').val(siteId);
$('#site-identifier').html(siteIdentifier);
$('#latitude').val(latitude);
$('#longitude').val(longitude);
moveMarkerOnTheMap(latitude, longitude);
};
let moveMarkerOnTheMap = (lat, long) => {
let locationSiteCoordinate = ol.proj.transform([
parseFloat(long),
parseFloat(lat)],
'EPSG:4326',
'EPSG:3857');
let iconFeature = new ol.Feature({
geometry: new ol.geom.Point(locationSiteCoordinate),
});
markerSource.clear();
markerSource.addFeature(iconFeature);
map.getView().setCenter(locationSiteCoordinate);
};
let oldHeader = $('.header').html();
$('.add-new-site').click((e) => {
$('#closest-sites-container').hide();
$('#add-new-site-container').show();
$('.header').html('Add fish data for new site');
});
$('.close-add-new-site').click((e) => {
$('#add-new-site-container').hide();
$('.header').html(oldHeader);
$('#latitude').val(location_site_lat);
$('#longitude').val(location_site_long);
oldLat = location_site_lat;
oldLon = location_site_long;
$('#location-site-name').val('');
$('#location-site-code').val('');
$('#location-site-description').val('');
moveMarkerOnTheMap(location_site_lat, location_site_long);
});
$(function () {
// Get id list
$.each($('.taxon-table-body').children(), function (index, tr) {
let val = $(tr).children().eq(0).find('.taxon-id').val();
if (typeof val !== 'undefined') {
taxaIdList.push(val);
}
});
let locationSiteCoordinate = ol.proj.transform([
parseFloat(location_site_long),
parseFloat(location_site_lat)],
'EPSG:4326',
'EPSG:3857');
let markerStyle = new ol.style.Style({
image: new ol.style.Icon(({
anchor: [0.5, 46],
anchorXUnits: 'fraction',
anchorYUnits: 'pixels',
opacity: 0.75,
src: '/static/img/map-marker.png'
}))
});
let iconFeature = new ol.Feature({
geometry: new ol.geom.Point(locationSiteCoordinate),
});
markerSource.addFeature(iconFeature);
map = new ol.Map({
target: 'fish-map',
layers: [
new ol.layer.Tile({
source: new ol.source.OSM()
}),
new ol.layer.Vector({
source: markerSource,
style: markerStyle,
}),
],
view: new ol.View({
center: locationSiteCoordinate,
zoom: 10
})
});
let biodiversityLayersOptions = {
url: geoserverPublicUrl + 'wms',
params: {
LAYERS: locationSiteGeoserverLayer,
FORMAT: 'image/png8',
viewparams: 'where:' + defaultWMSSiteParameters
},
ratio: 1,
serverType: 'geoserver'
};
let biodiversitySource = new ol.source.ImageWMS(biodiversityLayersOptions);
let biodiversityTileLayer = new ol.layer.Image({
source: biodiversitySource
});
map.addLayer(biodiversityTileLayer);
$("#date").datepicker({
changeMonth: true,
changeYear: true,
onSelect: function (dateText) {
let $target = $(this);
if ($target.val()) {
$target.removeClass('error');
$target.next().hide();
$target.unbind();
}
}
});
let $taxonAbundance = $('.taxon-abundance');
$taxonAbundance.keyup(function () {
this.value = this.value.replace(/[^0-9\.]/g, '');
});
$taxonAbundance.change(taxonAbundanceOnChange);
$('#collector').autocomplete({
source: function (request, response) {
$.ajax({
url: '/user-autocomplete/?term=' + encodeURIComponent(request.term),
type: 'get',
dataType: 'json',
success: function (data) {
response($.map(data, function (item) {
return {
label: item.first_name + ' ' + item.last_name,
value: item.id
}
}));
}
});
},
minLength: 3,
open: function (event, ui) {
setTimeout(function () {
$('.ui-autocomplete').css('z-index', 99);
}, 0);
},
change: function (event, ui) {
let $collectorIdInput = $('#collector_id');
if (ui.item) {
$collectorIdInput.val(ui.item.value);
} else {
$collectorIdInput.val(' ');
}
},
select: function (e, u) {
e.preventDefault();
$('#collector').val(u.item.label);
$('#collector_id').val(u.item.value);
}
});
$('#submitBtn').click((e) => {
});
let form = $('#fish-form');
$('#submit').click((event) => {
let required_inputs = $('input,textarea,select').filter('[required]:visible');
let isError = false;
let alertMessage = '';
$.each(required_inputs, (index, input) => {
let $input = $(input);
if (!$input.val()) {
isError = true;
$input.addClass('error');
$input.keyup((e) => {
let $target = $(e.target);
if ($target.val()) {
$target.removeClass('error');
$target.next().hide();
$target.unbind();
}
});
$input.next().show();
} else {
$input.unbind();
}
});
if (collectionsWithAbundace === 0) {
isError = true;
alertMessage = 'You must at least add one collection data';
} else {
let alertDiv = $('.alert-danger');
alertDiv.html('');
alertDiv.hide();
}
if (alertMessage) {
let alertDiv = $('.alert-danger');
alertDiv.html(alertMessage);
alertDiv.show();
}
if (isError) {
event.preventDefault();
event.stopPropagation();
$('#confirm-submit').modal('hide');
setTimeout(function () {
window.scrollTo(0, 0);
}, 500);
return;
}
// Get taxa list id
let $taxaIdList = $('#taxa-id-list');
$taxaIdList.val(taxaIdList.join());
form.submit();
});
$('#add-taxon').click((e) => {
let $findTaxonContainer = $('.find-taxon-container');
let $findTaxonContainerClone = $findTaxonContainer.clone();
$findTaxonContainerClone.removeClass('find-taxon-container');
$findTaxonContainerClone.find('.taxon-input-name').autocomplete(taxonAutocompleteHandler);
$findTaxonContainer.after($findTaxonContainerClone.show());
});
$('.taxon-input-name').autocomplete(taxonAutocompleteHandler);
$('#update-coordinate').click(updateCoordinateHandler);
});
|
/**
* @fileoverview Rule to ensure newline per method call when chaining calls
* @author Rajendra Patil
* @author Burak Yigit Kaya
*/
"use strict";
//------------------------------------------------------------------------------
// Rule Definition
//------------------------------------------------------------------------------
module.exports = {
meta: {
docs: {
description: "require a newline after each call in a method chain",
category: "Stylistic Issues",
recommended: false
},
schema: [{
"type": "object",
"properties": {
"ignoreChainWithDepth": {
"type": "integer",
"minimum": 1,
"maximum": 10
}
},
"additionalProperties": false
}]
},
create: function(context) {
var options = context.options[0] || {},
ignoreChainWithDepth = options.ignoreChainWithDepth || 2;
return {
"CallExpression:exit": function(node) {
if (!node.callee || node.callee.type !== "MemberExpression") {
return;
}
var callee = node.callee;
var parent = callee.object;
var depth = 1;
while (parent && parent.callee) {
depth += 1;
parent = parent.callee.object;
}
if (depth > ignoreChainWithDepth && callee.property.loc.start.line === callee.object.loc.end.line) {
context.report(
callee.property,
callee.property.loc.start,
"Expected line break after `" + context.getSource(callee.object).replace(/\r\n|\r|\n/g, "\\n") + "`."
);
}
}
};
}
};
|
/**
* Copyright (c) 2020 mol* contributors, licensed under MIT, See LICENSE file for more info.
*
* @author David Sehnal <david.sehnal@gmail.com>
*/
import { StructureElement, StructureProperties as P } from '../../structure';
import { Segmentation } from '../../../../mol-data/int';
import { CifWriter } from '../../../../mol-io/writer/cif';
import { Column } from '../../../../mol-data/db';
export function atom_site_operator_mapping(ctx) {
var entries = getEntries(ctx);
if (entries.length === 0)
return;
return [Category, entries, { ignoreFilter: true }];
}
export var AtomSiteOperatorMappingCategoryName = 'molstar_atom_site_operator_mapping';
export var AtomSiteOperatorMappingSchema = {
molstar_atom_site_operator_mapping: {
label_asym_id: Column.Schema.Str(),
auth_asym_id: Column.Schema.Str(),
operator_name: Column.Schema.Str(),
suffix: Column.Schema.Str(),
// assembly
assembly_id: Column.Schema.Str(),
assembly_operator_id: Column.Schema.Int(),
// symmetry
symmetry_operator_index: Column.Schema.Int(),
symmetry_hkl: Column.Schema.Vector(3),
// NCS
ncs_id: Column.Schema.Int(),
}
};
var asmValueKind = function (i, xs) { return typeof xs[i].operator.assembly === 'undefined' ? 1 /* NotPresent */ : 0 /* Present */; };
var symmetryValueKind = function (i, xs) { return xs[i].operator.spgrOp === -1 ? 1 /* NotPresent */ : 0 /* Present */; };
var Fields = CifWriter.fields()
.str('label_asym_id', function (i, xs) { return xs[i].label_asym_id; })
.str('auth_asym_id', function (i, xs) { return xs[i].auth_asym_id; })
.str('operator_name', function (i, xs) { return xs[i].operator.name; })
.str('suffix', function (i, xs) { return xs[i].operator.suffix; })
// assembly
// TODO: include oper list as well?
.str('assembly_id', function (i, xs) { var _a; return ((_a = xs[i].operator.assembly) === null || _a === void 0 ? void 0 : _a.id) || ''; }, { valueKind: asmValueKind })
.int('assembly_operator_id', function (i, xs) { var _a; return ((_a = xs[i].operator.assembly) === null || _a === void 0 ? void 0 : _a.operId) || 0; }, { valueKind: asmValueKind })
// symmetry
.int('symmetry_operator_index', function (i, xs) { return xs[i].operator.spgrOp; }, { valueKind: symmetryValueKind })
.vec('symmetry_hkl', [function (i, xs) { return xs[i].operator.hkl[0]; }, function (i, xs) { return xs[i].operator.hkl[1]; }, function (i, xs) { return xs[i].operator.hkl[2]; }], { valueKind: symmetryValueKind })
// NCS
.int('ncs_id', function (i, xs) { return xs[i].operator.ncsId; }, { valueKind: symmetryValueKind })
.getFields();
var Category = {
name: 'molstar_atom_site_operator_mapping',
instance: function (entries) {
return { fields: Fields, source: [{ data: entries, rowCount: entries.length }] };
}
};
function getEntries(ctx) {
var existing = new Set();
var entries = [];
for (var _i = 0, _a = ctx.structures; _i < _a.length; _i++) {
var s = _a[_i];
var l = StructureElement.Location.create(s);
for (var _b = 0, _c = s.units; _b < _c.length; _b++) {
var unit = _c[_b];
var operator = unit.conformation.operator;
if (!operator.suffix || unit.kind !== 0 /* Atomic */)
continue;
l.unit = unit;
var elements = unit.elements;
var chainsIt = Segmentation.transientSegments(unit.model.atomicHierarchy.chainAtomSegments, elements);
while (chainsIt.hasNext) {
var chainSegment = chainsIt.move();
l.element = elements[chainSegment.start];
var label_asym_id = P.chain.label_asym_id(l);
var key = "".concat(label_asym_id).concat(operator.suffix);
if (existing.has(key))
continue;
existing.add(key);
var auth_asym_id = P.chain.label_asym_id(l);
entries.push({ label_asym_id: label_asym_id, auth_asym_id: auth_asym_id, operator: operator });
}
}
}
return entries;
}
//# sourceMappingURL=atom_site_operator_mapping.js.map
|
import React, { Component, PropTypes } from "react";
import {
View,
Image,
Text,
StyleSheet,
Platform,
} from "react-native";
import defaultIcons from "./Icons";
import FlipCard from "react-native-flip-card";
const BASE_SIZE = { width: 300, height: 190 };
const s = StyleSheet.create({
cardContainer: {},
cardFace: {},
icon: {
position: "absolute",
top: 15,
right: 15,
width: 60,
height: 40,
resizeMode: "contain",
},
baseText: {
color: "rgba(255, 255, 255, 0.8)",
backgroundColor: "transparent",
},
placeholder: {
color: "rgba(255, 255, 255, 0.5)",
},
focused: {
fontWeight: "bold",
color: "rgba(255, 255, 255, 1)",
},
number: {
fontSize: 21,
position: "absolute",
top: 95,
left: 28,
},
name: {
fontSize: 16,
position: "absolute",
bottom: 20,
left: 25,
right: 100,
},
expiryLabel: {
fontSize: 9,
position: "absolute",
bottom: 40,
left: 218,
},
expiry: {
fontSize: 16,
position: "absolute",
bottom: 20,
left: 220,
},
amexCVC: {
fontSize: 16,
position: "absolute",
top: 73,
right: 30,
},
cvc: {
fontSize: 16,
position: "absolute",
top: 80,
right: 30,
},
});
/* eslint react/prop-types: 0 */ // https://github.com/yannickcr/eslint-plugin-react/issues/106
export default class CardView extends Component {
static propTypes = {
focused: PropTypes.string,
brand: PropTypes.string,
name: PropTypes.string,
number: PropTypes.string,
expiry: PropTypes.string,
cvc: PropTypes.string,
placeholder: PropTypes.object,
scale: PropTypes.number,
fontFamily: PropTypes.string,
imageFront: PropTypes.number,
imageBack: PropTypes.number,
customIcons: PropTypes.object,
};
static defaultProps = {
name: "",
placeholder: {
number: "•••• •••• •••• ••••",
name: "TITULAR",
expiry: "••/••",
cvc: "•••",
},
scale: 1,
fontFamily: Platform.select({ ios: "Courier", android: "monospace" }),
imageFront: require("../images/card-front.png"),
imageBack: require("../images/card-back.png"),
};
render() {
const { focused,
brand, name, number, expiry, cvc, customIcons,
placeholder, imageFront, imageBack, scale, fontFamily } = this.props;
const Icons = { ...defaultIcons, ...customIcons };
const isAmex = brand === "american-express";
const shouldFlip = !isAmex && focused === "cvc";
const containerSize = { ...BASE_SIZE, height: BASE_SIZE.height * scale };
const transform = { transform: [
{ scale },
{ translateY: ((BASE_SIZE.height * (scale - 1) / 2)) },
] };
return (
<View style={[s.cardContainer, containerSize]}>
<FlipCard style={{ borderWidth: 0 }}
flipHorizontal
flipVertical={false}
friction={10}
perspective={2000}
clickable={false}
flip={shouldFlip}>
<Image style={[BASE_SIZE, s.cardFace, transform]}
source={imageFront}>
<Image style={[s.icon]}
source={{ uri: Icons[brand] }} />
<Text style={[s.baseText, { fontFamily }, s.number, !number && s.placeholder, focused === "number" && s.focused]}>
{ !number ? placeholder.number : number }
</Text>
<Text style={[s.baseText, { fontFamily }, s.name, !name && s.placeholder, focused === "name" && s.focused]}
numberOfLines={1}>
{ !name ? placeholder.name : name.toUpperCase() }
</Text>
<Text style={[s.baseText, { fontFamily }, s.expiryLabel, s.placeholder, focused === "expiry" && s.focused]}>
VALIDADE
</Text>
<Text style={[s.baseText, { fontFamily }, s.expiry, !expiry && s.placeholder, focused === "expiry" && s.focused]}>
{ !expiry ? placeholder.expiry : expiry }
</Text>
{ isAmex &&
<Text style={[s.baseText, { fontFamily }, s.amexCVC, !cvc && s.placeholder, focused === "cvc" && s.focused]}>
{ !cvc ? placeholder.cvc : cvc }
</Text> }
</Image>
<Image style={[BASE_SIZE, s.cardFace, transform]}
source={imageBack}>
<Text style={[s.baseText, s.cvc, !cvc && s.placeholder, focused === "cvc" && s.focused]}>
{ !cvc ? placeholder.cvc : cvc }
</Text>
</Image>
</FlipCard>
</View>
);
}
}
|
module.exports = {
presets: ['module:metro-react-native-babel-preset'],
plugins: [['module:react-native-dotenv']],
};
|
/* eslint-disable camelcase */
/* eslint-disable no-unused-vars */
const configs = require('configs/index');
const constant = require('common/constant');
const guestODM = require('db/odm/guest.odm');
const userODM = require('db/odm/user.odm');
const eventODM = require('db/odm/event.odm');
const { Types } = require('mongoose');
const pagination = require('utils/pagination');
const {
EventNotFoundError, GuestExistedError, GuestNotFoundError,
EmailVerifiedError, TicketApprovedError, TicketCheckedInError,
} = require('common/error');
const { VerifyGuestEmail, TicketEmail } = require('common/mail');
const base64 = require('utils/base64');
const MailgunService = require('services/mailgun');
const { fromString } = require('uuidv4');
const { ItemsPerPage } = constant;
/**
*
* @param {String} eventId
* @param {Number} page
*/
async function findGuestsByEventId(eventId, page) {
const totalGuests = await guestODM.countByEventId(eventId);
const paginatedObject = pagination
.getPaginatedObject(totalGuests, ItemsPerPage.GUESTS_LIST, page);
const { offset, limit, ...paginationInfo } = paginatedObject;
const listGuests = await guestODM.findByEventId(eventId, offset, limit);
return {
...paginationInfo,
listItems: listGuests,
};
}
async function findPendingGuestsByEventId(eventId, page) {
const totalGuests = await guestODM.countPendingByEventId(eventId);
const paginatedObject = pagination
.getPaginatedObject(totalGuests, ItemsPerPage.GUESTS_LIST, page);
const { offset, limit, ...paginationInfo } = paginatedObject;
const listGuests = await guestODM.findPendingByEventId(eventId, offset, limit);
return {
...paginationInfo,
listItems: listGuests,
};
}
async function findApprovedGuestsByEventId(eventId, page) {
const totalGuests = await guestODM.countApprovedByEventId(eventId);
const paginatedObject = pagination
.getPaginatedObject(totalGuests, ItemsPerPage.GUESTS_LIST, page);
const { offset, limit, ...paginationInfo } = paginatedObject;
const listGuests = await guestODM.findAprrovedByEventId(eventId, offset, limit);
return {
...paginationInfo,
listItems: listGuests,
};
}
async function findCheckedInGuestsByEventId(eventId, page) {
const totalGuests = await guestODM.countCheckedInByEventId(eventId);
const paginatedObject = pagination
.getPaginatedObject(totalGuests, ItemsPerPage.GUESTS_LIST, page);
const { offset, limit, ...paginationInfo } = paginatedObject;
const listGuests = await guestODM.findCheckedInByEventId(eventId, offset, limit);
return {
...paginationInfo,
listItems: listGuests,
};
}
/**
*
* @param {String} guestId
*/
async function findGuestById(guestId) {
const guest = await guestODM.findById(guestId);
return guest;
}
/**
*
* @param {String} userId
* @param {String} eventId
* @param {Object} guestInfo
*/
async function saveNewGuestWithEventId(userId, eventId, guestInfo) {
const {
email, full_name, phone_number, gender, answers,
} = guestInfo;
const event = await eventODM.findById(eventId);
if (!event) {
throw new EventNotFoundError();
}
const exGuest = await guestODM.findByEventIdAndEmail(eventId, email);
if (exGuest) {
throw new GuestExistedError({ data: exGuest });
}
const user = await userODM.findById(userId);
const emailVerified = (user && user.email_verified) ? user.email_verified : false;
const newGuest = {
event: Types.ObjectId(eventId),
email,
user: (userId) ? Types.ObjectId(userId) : null,
info: {
full_name,
phone_number,
gender,
answers,
},
status: {
email_verified: emailVerified,
ticket_approved: false,
},
ticket: {
code: null,
issue_at: null,
checkin_at: null,
},
};
const savedGuest = await guestODM.save(newGuest);
if (!emailVerified) {
const verifyLink = `${configs.FE_URL}/verify?eventId=${eventId}&guestId=${savedGuest.id}`;
const verifyEmail = new VerifyGuestEmail({
to: `${newGuest.email}`,
html: `Xin chào ${newGuest.email} <br/>
Bạn đã đăng ký tham gia sự kiện ${event.name}. <br/>
Chúng tôi cần bạn xác nhận lại email. Vui lòng ấn vào đường dẫn sau để xác nhận: <br/>
<a href="${verifyLink}">${verifyLink}</a><br/>
Chúng tôi sẽ gửi thông tin vé sớm nhất cho bạn`,
});
verifyEmail.send();
}
return {
savedGuest,
};
}
async function sendTicketMail(guest, event, ticketCode) {
const data = {
guestId: guest.id,
eventId: event.id,
ticketCode,
};
const dataImage = await base64.getBufferFromObject(data);
const ticketMail = new TicketEmail({
to: `${guest.email}`,
html: `Xin chào ${guest.email}, lại là Easy Event đây !<br/>
Sau đây là vé dành cho sự kiện ${event.name} <br/>
<ul>
<li>Email: ${guest.email}</li>
<li>Gender: ${guest.info.gender}</li>
</ul>
<br/>
Bạn hãy vui lòng sử dụng mã QR Code trong file đính kèm để check in tại sự kiện nhé !`,
attachment: new MailgunService.api.Attachment({ data: dataImage, filename: 'ticket.png' }),
});
ticketMail.send();
}
/**
*
* @param {String} guestId
*/
async function updateVerifyGuestEmail(guestId) {
const guest = await guestODM.findById(guestId);
if (!guest) {
throw new GuestNotFoundError();
}
if (guest.get('status.email_verified')) {
throw new EmailVerifiedError();
}
if (guest.user) {
const userId = guest.user;
await guestODM.update(userId, { email_verified: true });
}
const updates = {
'status.email_verified': true,
};
const updatedGuest = await guestODM.update(guestId, updates);
return {
updatedGuest,
};
}
/**
*
* @param {String} guestId
*/
async function updateApproveGuest(guestId) {
const guest = await guestODM.findById(guestId);
if (!guest) {
throw new GuestNotFoundError();
}
const event = await eventODM.findById(guest.get('event'));
if (guest.get('status.ticket_approved')) {
throw new TicketApprovedError();
}
const ticketCode = fromString(guestId);
const updates = {
'status.ticket_approved': true,
'ticket.code': ticketCode,
'ticket.issue_at': Date.now(),
};
sendTicketMail(guest, event, ticketCode);
const updatedGuest = await guestODM.update(guestId, updates);
return {
updatedGuest,
};
}
/**
*
* @param {String} guestId
*/
async function updateCheckinGuest(ticketCode) {
const guest = await guestODM.findByCode(ticketCode);
if (!guest) {
throw new GuestNotFoundError();
}
if (guest.get('ticket.checkin_at') !== null) {
throw new TicketCheckedInError();
}
const guestId = guest.id;
const updates = {
'ticket.checkin_at': Date.now(),
};
const updatedGuest = await guestODM.update(guestId, updates);
return {
updatedGuest,
};
}
/**
*
* @param {String} code
*/
async function findGuestByCode(code) {
const guest = await guestODM.findByCode(code);
return guest;
}
module.exports = {
findGuestsByEventId,
findGuestById,
findPendingGuestsByEventId,
findApprovedGuestsByEventId,
findCheckedInGuestsByEventId,
saveNewGuestWithEventId,
updateVerifyGuestEmail,
updateApproveGuest,
updateCheckinGuest,
findGuestByCode,
};
|
var searchData=
[
['b',['B',['../d4/d7e/structpu_1_1draw_1_1_color.html#a36e86ed99d9cfa21d268584ab0b7d76e',1,'pu::draw::Color']]],
['bgcolor',['bgcolor',['../d7/d15/classpu_1_1_application.html#a05b8e05da76b76cf74337185e0fd3c65',1,'pu::Application']]],
['bgimage',['bgimage',['../d7/d15/classpu_1_1_application.html#ac5a31c43739caf53a422c9a96193188b',1,'pu::Application']]]
];
|
'use strict';
// ---------------------------------------------------------------------------
const Exchange = require ('./base/Exchange');
const { ExchangeError, ExchangeNotAvailable, OnMaintenance, ArgumentsRequired, BadRequest, AccountSuspended, InvalidAddress, PermissionDenied, InsufficientFunds, InvalidNonce, InvalidOrder, OrderNotFound, AuthenticationError, RequestTimeout, BadSymbol, RateLimitExceeded, NetworkError } = require ('./base/errors');
const { TICK_SIZE, TRUNCATE } = require ('./base/functions/number');
const Precise = require ('./base/Precise');
// ---------------------------------------------------------------------------
module.exports = class okex extends Exchange {
describe () {
return this.deepExtend (super.describe (), {
'id': 'okex',
'name': 'OKEX',
'countries': [ 'CN', 'US' ],
'version': 'v5',
'rateLimit': 1000, // up to 3000 requests per 5 minutes ≈ 600 requests per minute ≈ 10 requests per second ≈ 100 ms
'pro': true,
'has': {
'CORS': false,
'cancelOrder': true,
'createOrder': true,
'fetchBalance': true,
'fetchClosedOrders': true,
'fetchCurrencies': false, // see below
'fetchDepositAddress': true,
'fetchDeposits': true,
'fetchLedger': true,
'fetchMarkets': true,
'fetchMyTrades': true,
'fetchOHLCV': true,
'fetchOpenOrders': true,
'fetchOrder': true,
'fetchOrderBook': true,
'fetchOrderTrades': true,
'fetchPosition': true,
'fetchPositions': true,
'fetchStatus': true,
'fetchTicker': true,
'fetchTickers': true,
'fetchTime': true,
'fetchTrades': true,
'fetchWithdrawals': true,
'withdraw': true,
},
'timeframes': {
'1m': '1m',
'3m': '3m',
'5m': '5m',
'15m': '15m',
'30m': '30m',
'1h': '1H',
'2h': '2H',
'4h': '4H',
'6h': '6H',
'12h': '12H',
'1d': '1D',
'1w': '1W',
'1M': '1M',
'3M': '3M',
'6M': '6M',
'1y': '1Y',
},
'hostname': 'www.okex.com',
'urls': {
'logo': 'https://user-images.githubusercontent.com/1294454/32552768-0d6dd3c6-c4a6-11e7-90f8-c043b64756a7.jpg',
'api': {
'rest': 'https://{hostname}',
},
'www': 'https://www.okex.com',
'doc': 'https://www.okex.com/docs/en/',
'fees': 'https://www.okex.com/pages/products/fees.html',
'referral': 'https://www.okex.com/join/1888677',
'test': {
'rest': 'https://testnet.okex.com',
},
},
'api': {
'public': {
'get': [
'market/tickers',
'market/ticker',
'market/index-tickers',
'market/books',
'market/candles',
'market/history-candles',
'market/index-candles',
'market/mark-price-candles',
'market/trades',
'market/platform-24-volume',
'market/open-oracle',
'market/oracle',
'public/instruments',
'public/delivery-exercise-history',
'public/open-interest',
'public/funding-rate',
'public/funding-rate-history',
'public/price-limit',
'public/opt-summary',
'public/estimated-price',
'public/discount-rate-interest-free-quota',
'public/time',
'public/liquidation-orders',
'public/mark-price',
'public/tier',
'public/position-tiers',
'public/underlying',
'public/interest-rate-loan-quota',
'system/status',
],
},
'private': {
'get': [
'account/account-position-risk',
'account/balance',
'account/positions',
'account/bills',
'account/bills-archive',
'account/config',
'account/max-size',
'account/max-avail-size',
'account/leverage-info',
'account/max-loan',
'account/trade-fee',
'account/interest-accrued',
'account/interest-rate',
'account/max-withdrawal',
'asset/deposit-address',
'asset/balances',
'asset/deposit-history',
'asset/withdrawal-history',
'asset/currencies',
'asset/bills',
'asset/piggy-balance',
'trade/order',
'trade/orders-pending',
'trade/orders-history',
'trade/orders-history-archive',
'trade/fills',
'trade/fills-history',
'trade/orders-algo-pending',
'trade/orders-algo-history',
'account/subaccount/balances',
'asset/subaccount/bills',
'users/subaccount/list',
],
'post': [
'account/set-position-mode',
'account/set-leverage',
'account/position/margin-balance',
'account/set-greeks',
'asset/transfer',
'asset/withdrawal',
'asset/purchase_redempt',
'trade/order',
'trade/batch-orders',
'trade/cancel-order',
'trade/cancel-batch-orders',
'trade/amend-order',
'trade/amend-batch-orders',
'trade/close-position',
'trade/order-algo',
'trade/cancel-algos',
'users/subaccount/delete-apikey',
'users/subaccount/modify-apikey',
'users/subaccount/apikey',
'asset/subaccount/transfer',
],
},
},
'fees': {
'trading': {
'taker': 0.0015,
'maker': 0.0010,
},
'spot': {
'taker': 0.0015,
'maker': 0.0010,
},
'futures': {
'taker': 0.0005,
'maker': 0.0002,
},
'swap': {
'taker': 0.00050,
'maker': 0.00020,
},
},
'requiredCredentials': {
'apiKey': true,
'secret': true,
'password': true,
},
'exceptions': {
'exact': {
// Public error codes from 50000-53999
// General Class
'1': ExchangeError, // Operation failed
'2': ExchangeError, // Bulk operation partially succeeded
'50000': BadRequest, // Body can not be empty
'50001': OnMaintenance, // Matching engine upgrading. Please try again later
'50002': BadRequest, // Json data format error
'50004': RequestTimeout, // Endpoint request timeout (does not indicate success or failure of order, please check order status)
'50005': ExchangeNotAvailable, // API is offline or unavailable
'50006': BadRequest, // Invalid Content_Type, please use "application/json" format
'50007': AccountSuspended, // Account blocked
'50008': AuthenticationError, // User does not exist
'50009': AccountSuspended, // Account is suspended due to ongoing liquidation
'50010': ExchangeError, // User ID can not be empty
'50011': RateLimitExceeded, // Request too frequent
'50012': ExchangeError, // Account status invalid
'50013': ExchangeNotAvailable, // System is busy, please try again later
'50014': ExchangeError, // Parameter {0} can not be empty
'50015': ExchangeError, // Either parameter {0} or {1} is required
'50016': ExchangeError, // Parameter {0} does not match parameter {1}
'50017': ExchangeError, // The position is frozen due to ADL. Operation restricted
'50018': ExchangeError, // Currency {0} is frozen due to ADL. Operation restricted
'50019': ExchangeError, // The account is frozen due to ADL. Operation restricted
'50020': ExchangeError, // The position is frozen due to liquidation. Operation restricted
'50021': ExchangeError, // Currency {0} is frozen due to liquidation. Operation restricted
'50022': ExchangeError, // The account is frozen due to liquidation. Operation restricted
'50023': ExchangeError, // Funding fee frozen. Operation restricted
'50024': ExchangeError, // Parameter {0} and {1} can not exist at the same time
'50025': ExchangeError, // Parameter {0} count exceeds the limit {1}
'50026': ExchangeError, // System error
'50027': ExchangeError, // The account is restricted from trading
'50028': ExchangeError, // Unable to take the order, please reach out to support center for details
// API Class
'50100': ExchangeError, // API frozen, please contact customer service
'50101': ExchangeError, // Broker id of APIKey does not match current environment
'50102': InvalidNonce, // Timestamp request expired
'50103': AuthenticationError, // Request header "OK_ACCESS_KEY" can not be empty
'50104': AuthenticationError, // Request header "OK_ACCESS_PASSPHRASE" can not be empty
'50105': AuthenticationError, // Request header "OK_ACCESS_PASSPHRASE" incorrect
'50106': AuthenticationError, // Request header "OK_ACCESS_SIGN" can not be empty
'50107': AuthenticationError, // Request header "OK_ACCESS_TIMESTAMP" can not be empty
'50108': ExchangeError, // Exchange ID does not exist
'50109': ExchangeError, // Exchange domain does not exist
'50110': PermissionDenied, // Invalid IP
'50111': AuthenticationError, // Invalid OK_ACCESS_KEY
'50112': AuthenticationError, // Invalid OK_ACCESS_TIMESTAMP
'50113': AuthenticationError, // Invalid signature
'50114': AuthenticationError, // Invalid authorization
'50115': BadRequest, // Invalid request method
// Trade Class
'51000': BadRequest, // Parameter {0} error
'51001': BadSymbol, // Instrument ID does not exist
'51002': BadSymbol, // Instrument ID does not match underlying index
'51003': BadRequest, // Either client order ID or order ID is required
'51004': InvalidOrder, // Order amount exceeds current tier limit
'51005': InvalidOrder, // Order amount exceeds the limit
'51006': InvalidOrder, // Order price out of the limit
'51007': InvalidOrder, // Order placement failed. Order amount should be at least 1 contract (showing up when placing an order with less than 1 contract)
'51008': InsufficientFunds, // Order placement failed due to insufficient balance
'51009': AccountSuspended, // Order placement function is blocked by the platform
'51010': InsufficientFunds, // Account level too low
'51011': InvalidOrder, // Duplicated order ID
'51012': ExchangeError, // Token does not exist
'51014': ExchangeError, // Index does not exist
'51015': BadSymbol, // Instrument ID does not match instrument type
'51016': InvalidOrder, // Duplicated client order ID
'51017': ExchangeError, // Borrow amount exceeds the limit
'51018': ExchangeError, // User with option account can not hold net short positions
'51019': ExchangeError, // No net long positions can be held under isolated margin mode in options
'51020': InvalidOrder, // Order amount should be greater than the min available amount
'51021': BadSymbol, // Contract to be listed
'51022': BadSymbol, // Contract suspended
'51023': ExchangeError, // Position does not exist
'51024': AccountSuspended, // Unified accountblocked
'51025': ExchangeError, // Order count exceeds the limit
'51026': BadSymbol, // Instrument type does not match underlying index
'51027': BadSymbol, // Contract expired
'51028': BadSymbol, // Contract under delivery
'51029': BadSymbol, // Contract is being settled
'51030': BadSymbol, // Funding fee is being settled
'51031': InvalidOrder, // This order price is not within the closing price range
'51100': InvalidOrder, // Trading amount does not meet the min tradable amount
'51101': InvalidOrder, // Entered amount exceeds the max pending order amount (Cont) per transaction
'51102': InvalidOrder, // Entered amount exceeds the max pending count
'51103': InvalidOrder, // Entered amount exceeds the max pending order count of the underlying asset
'51104': InvalidOrder, // Entered amount exceeds the max pending order amount (Cont) of the underlying asset
'51105': InvalidOrder, // Entered amount exceeds the max order amount (Cont) of the contract
'51106': InvalidOrder, // Entered amount exceeds the max order amount (Cont) of the underlying asset
'51107': InvalidOrder, // Entered amount exceeds the max holding amount (Cont)
'51108': InvalidOrder, // Positions exceed the limit for closing out with the market price
'51109': InvalidOrder, // No available offer
'51110': InvalidOrder, // You can only place a limit order after Call Auction has started
'51111': BadRequest, // Maximum {0} orders can be placed in bulk
'51112': InvalidOrder, // Close order size exceeds your available size
'51113': RateLimitExceeded, // Market-price liquidation requests too frequent
'51115': InvalidOrder, // Cancel all pending close-orders before liquidation
'51116': InvalidOrder, // Order price or trigger price exceeds {0}
'51117': InvalidOrder, // Pending close-orders count exceeds limit
'51118': InvalidOrder, // Total amount should exceed the min amount per order
'51119': InsufficientFunds, // Order placement failed due to insufficient balance
'51120': InvalidOrder, // Order quantity is less than {0}, please try again
'51121': InvalidOrder, // Order count should be the integer multiples of the lot size
'51122': InvalidOrder, // Order price should be higher than the min price {0}
'51124': InvalidOrder, // You can only place limit orders during call auction
'51125': InvalidOrder, // Currently there are reduce + reverse position pending orders in margin trading. Please cancel all reduce + reverse position pending orders and continue
'51126': InvalidOrder, // Currently there are reduce only pending orders in margin trading.Please cancel all reduce only pending orders and continue
'51127': InsufficientFunds, // Available balance is 0
'51128': InvalidOrder, // Multi-currency margin account can not do cross-margin trading
'51129': InvalidOrder, // The value of the position and buy order has reached the position limit, and no further buying is allowed
'51130': BadSymbol, // Fixed margin currency error
'51131': InsufficientFunds, // Insufficient balance
'51132': InvalidOrder, // Your position amount is negative and less than the minimum trading amount
'51133': InvalidOrder, // Reduce-only feature is unavailable for the spot transactions by multi-currency margin account
'51134': InvalidOrder, // Closing failed. Please check your holdings and pending orders
'51135': InvalidOrder, // Your closing price has triggered the limit price, and the max buy price is {0}
'51136': InvalidOrder, // Your closing price has triggered the limit price, and the min sell price is {0}
'51137': InvalidOrder, // Your opening price has triggered the limit price, and the max buy price is {0}
'51138': InvalidOrder, // Your opening price has triggered the limit price, and the min sell price is {0}
'51139': InvalidOrder, // Reduce-only feature is unavailable for the spot transactions by simple account
'51201': InvalidOrder, // Value of per market order cannot exceed 100,000 USDT
'51202': InvalidOrder, // Market - order amount exceeds the max amount
'51203': InvalidOrder, // Order amount exceeds the limit {0}
'51204': InvalidOrder, // The price for the limit order can not be empty
'51205': InvalidOrder, // Reduce-Only is not available
'51250': InvalidOrder, // Algo order price is out of the available range
'51251': InvalidOrder, // Algo order type error (when user place an iceberg order)
'51252': InvalidOrder, // Algo order price is out of the available range
'51253': InvalidOrder, // Average amount exceeds the limit of per iceberg order
'51254': InvalidOrder, // Iceberg average amount error (when user place an iceberg order)
'51255': InvalidOrder, // Limit of per iceberg order: Total amount/1000 < x <= Total amount
'51256': InvalidOrder, // Iceberg order price variance error
'51257': InvalidOrder, // Trail order callback rate error
'51258': InvalidOrder, // Trail - order placement failed. The trigger price of a sell order should be higher than the last transaction price
'51259': InvalidOrder, // Trail - order placement failed. The trigger price of a buy order should be lower than the last transaction price
'51260': InvalidOrder, // Maximum {0} pending trail - orders can be held at the same time
'51261': InvalidOrder, // Each user can hold up to {0} pending stop - orders at the same time
'51262': InvalidOrder, // Maximum {0} pending iceberg orders can be held at the same time
'51263': InvalidOrder, // Maximum {0} pending time-weighted orders can be held at the same time
'51264': InvalidOrder, // Average amount exceeds the limit of per time-weighted order
'51265': InvalidOrder, // Time-weighted order limit error
'51267': InvalidOrder, // Time-weighted order strategy initiative rate error
'51268': InvalidOrder, // Time-weighted order strategy initiative range error
'51269': InvalidOrder, // Time-weighted order interval error, the interval should be {0}<= x<={1}
'51270': InvalidOrder, // The limit of time-weighted order price variance is 0 < x <= 1%
'51271': InvalidOrder, // Sweep ratio should be 0 < x <= 100%
'51272': InvalidOrder, // Price variance should be 0 < x <= 1%
'51273': InvalidOrder, // Total amount should be more than {0}
'51274': InvalidOrder, // Total quantity of time-weighted order must be larger than single order limit
'51275': InvalidOrder, // The amount of single stop-market order can not exceed the upper limit
'51276': InvalidOrder, // Stop - Market orders cannot specify a price
'51277': InvalidOrder, // TP trigger price can not be higher than the last price
'51278': InvalidOrder, // SL trigger price can not be lower than the last price
'51279': InvalidOrder, // TP trigger price can not be lower than the last price
'51280': InvalidOrder, // SL trigger price can not be higher than the last price
'51400': OrderNotFound, // Cancellation failed as the order does not exist
'51401': OrderNotFound, // Cancellation failed as the order is already canceled
'51402': OrderNotFound, // Cancellation failed as the order is already completed
'51403': InvalidOrder, // Cancellation failed as the order type does not support cancellation
'51404': InvalidOrder, // Order cancellation unavailable during the second phase of call auction
'51405': ExchangeError, // Cancellation failed as you do not have any pending orders
'51406': ExchangeError, // Canceled - order count exceeds the limit {0}
'51407': BadRequest, // Either order ID or client order ID is required
'51408': ExchangeError, // Pair ID or name does not match the order info
'51409': ExchangeError, // Either pair ID or pair name ID is required
'51410': ExchangeError, // Cancellation failed as the order is already under cancelling status
'51500': ExchangeError, // Either order price or amount is required
'51501': ExchangeError, // Maximum {0} orders can be modified
'51502': InsufficientFunds, // Order modification failed for insufficient margin
'51503': ExchangeError, // Order modification failed as the order does not exist
'51506': ExchangeError, // Order modification unavailable for the order type
'51508': ExchangeError, // Orders are not allowed to be modified during the call auction
'51509': ExchangeError, // Modification failed as the order has been canceled
'51510': ExchangeError, // Modification failed as the order has been completed
'51511': ExchangeError, // Modification failed as the order price did not meet the requirement for Post Only
'51600': ExchangeError, // Status not found
'51601': ExchangeError, // Order status and order ID cannot exist at the same time
'51602': ExchangeError, // Either order status or order ID is required
'51603': OrderNotFound, // Order does not exist
// Data class
'52000': ExchangeError, // No updates
// SPOT/MARGIN error codes 54000-54999
'54000': ExchangeError, // Margin transactions unavailable
'54001': ExchangeError, // Only Multi-currency margin account can be set to borrow coins automatically
// FUNDING error codes 58000-58999
'58000': ExchangeError, // Account type {0} does not supported when getting the sub-account balance
'58001': AuthenticationError, // Incorrect trade password
'58002': PermissionDenied, // Please activate Savings Account first
'58003': ExchangeError, // Currency type is not supported by Savings Account
'58004': AccountSuspended, // Account blocked (transfer & withdrawal endpoint: either end of the account does not authorize the transfer)
'58005': ExchangeError, // The redeemed amount must be no greater than {0}
'58006': ExchangeError, // Service unavailable for token {0}
'58007': ExchangeError, // Abnormal Assets interface. Please try again later
'58100': ExchangeError, // The trading product triggers risk control, and the platform has suspended the fund transfer-out function with related users. Please wait patiently
'58101': AccountSuspended, // Transfer suspended (transfer endpoint: either end of the account does not authorize the transfer)
'58102': RateLimitExceeded, // Too frequent transfer (transfer too frequently)
'58103': ExchangeError, // Parent account user id does not match sub-account user id
'58104': ExchangeError, // Since your P2P transaction is abnormal, you are restricted from making fund transfers. Please contact customer support to remove the restriction
'58105': ExchangeError, // Since your P2P transaction is abnormal, you are restricted from making fund transfers. Please transfer funds on our website or app to complete identity verification
'58106': ExchangeError, // Please enable the account for spot contract
'58107': ExchangeError, // Please enable the account for futures contract
'58108': ExchangeError, // Please enable the account for option contract
'58109': ExchangeError, // Please enable the account for swap contract
'58110': ExchangeError, // The contract triggers risk control, and the platform has suspended the fund transfer function of it. Please wait patiently
'58111': ExchangeError, // Funds transfer unavailable as the perpetual contract is charging the funding fee. Please try again later
'58112': ExchangeError, // Your fund transfer failed. Please try again later
'58114': ExchangeError, // Transfer amount must be more than 0
'58115': ExchangeError, // Sub-account does not exist
'58116': ExchangeError, // Transfer amount exceeds the limit
'58117': ExchangeError, // Account assets are abnormal, please deal with negative assets before transferring
'58200': ExchangeError, // Withdrawal from {0} to {1} is unavailable for this currency
'58201': ExchangeError, // Withdrawal amount exceeds the daily limit
'58202': ExchangeError, // The minimum withdrawal amount for NEO is 1, and the amount must be an integer
'58203': InvalidAddress, // Please add a withdrawal address
'58204': AccountSuspended, // Withdrawal suspended
'58205': ExchangeError, // Withdrawal amount exceeds the upper limit
'58206': ExchangeError, // Withdrawal amount is lower than the lower limit
'58207': InvalidAddress, // Withdrawal failed due to address error
'58208': ExchangeError, // Withdrawal failed. Please link your email
'58209': ExchangeError, // Withdrawal failed. Withdraw feature is not available for sub-accounts
'58210': ExchangeError, // Withdrawal fee exceeds the upper limit
'58211': ExchangeError, // Withdrawal fee is lower than the lower limit (withdrawal endpoint: incorrect fee)
'58212': ExchangeError, // Withdrawal fee should be {0}% of the withdrawal amount
'58213': AuthenticationError, // Please set trading password before withdrawal
'58300': ExchangeError, // Deposit-address count exceeds the limit
'58350': InsufficientFunds, // Insufficient balance
// Account error codes 59000-59999
'59000': ExchangeError, // Your settings failed as you have positions or open orders
'59001': ExchangeError, // Switching unavailable as you have borrowings
'59100': ExchangeError, // You have open positions. Please cancel all open positions before changing the leverage
'59101': ExchangeError, // You have pending orders with isolated positions. Please cancel all the pending orders and adjust the leverage
'59102': ExchangeError, // Leverage exceeds the maximum leverage. Please adjust the leverage
'59103': InsufficientFunds, // Leverage is too low and no sufficient margin in your account. Please adjust the leverage
'59104': ExchangeError, // The leverage is too high. The borrowed position has exceeded the maximum position of this leverage. Please adjust the leverage
'59105': ExchangeError, // Leverage can not be less than {0}. Please adjust the leverage
'59106': ExchangeError, // The max available margin corresponding to your order tier is {0}. Please adjust your margin and place a new order
'59107': ExchangeError, // You have pending orders under the service, please modify the leverage after canceling all pending orders
'59108': InsufficientFunds, // Low leverage and insufficient margin, please adjust the leverage
'59109': ExchangeError, // Account equity less than the required margin amount after adjustment. Please adjust the leverage
'59200': InsufficientFunds, // Insufficient account balance
'59201': InsufficientFunds, // Negative account balance
'59300': ExchangeError, // Margin call failed. Position does not exist
'59301': ExchangeError, // Margin adjustment failed for exceeding the max limit
'59401': ExchangeError, // Holdings already reached the limit
'59500': ExchangeError, // Only the APIKey of the main account has permission
'59501': ExchangeError, // Only 50 APIKeys can be created per account
'59502': ExchangeError, // Note name cannot be duplicate with the currently created APIKey note name
'59503': ExchangeError, // Each APIKey can bind up to 20 IP addresses
'59504': ExchangeError, // The sub account does not support the withdrawal function
'59505': ExchangeError, // The passphrase format is incorrect
'59506': ExchangeError, // APIKey does not exist
'59507': ExchangeError, // The two accounts involved in a transfer must be two different sub accounts under the same parent account
'59508': AccountSuspended, // The sub account of {0} is suspended
// WebSocket error Codes from 60000-63999
'60001': AuthenticationError, // "OK_ACCESS_KEY" can not be empty
'60002': AuthenticationError, // "OK_ACCESS_SIGN" can not be empty
'60003': AuthenticationError, // "OK_ACCESS_PASSPHRASE" can not be empty
'60004': AuthenticationError, // Invalid OK_ACCESS_TIMESTAMP
'60005': AuthenticationError, // Invalid OK_ACCESS_KEY
'60006': InvalidNonce, // Timestamp request expired
'60007': AuthenticationError, // Invalid sign
'60008': AuthenticationError, // Login is not supported for public channels
'60009': AuthenticationError, // Login failed
'60010': AuthenticationError, // Already logged in
'60011': AuthenticationError, // Please log in
'60012': BadRequest, // Illegal request
'60013': BadRequest, // Invalid args
'60014': RateLimitExceeded, // Requests too frequent
'60015': NetworkError, // Connection closed as there was no data transmission in the last 30 seconds
'60016': ExchangeNotAvailable, // Buffer is full, cannot write data
'60017': BadRequest, // Invalid url path
'60018': BadRequest, // The {0} {1} {2} {3} {4} does not exist
'60019': BadRequest, // Invalid op {op}
'63999': ExchangeError, // Internal system error
},
'broad': {
},
},
'httpExceptions': {
'429': ExchangeNotAvailable, // https://github.com/ccxt/ccxt/issues/9612
},
'precisionMode': TICK_SIZE,
'options': {
'fetchOHLCV': {
'type': 'Candles', // Candles or HistoryCandles, IndexCandles, MarkPriceCandles
},
'createMarketBuyOrderRequiresPrice': true,
'fetchMarkets': [ 'spot', 'futures', 'swap' ], // spot, futures, swap, option
'defaultType': 'spot', // 'funding', 'spot', 'margin', 'futures', 'swap', 'option'
'fetchBalance': {
'type': 'spot', // 'funding', 'trading', 'spot'
},
'fetchLedger': {
'method': 'privateGetAccountBills', // privateGetAccountBillsArchive, privateGetAssetBills
},
'brokerId': 'e847386590ce4dBC',
},
'commonCurrencies': {
// OKEX refers to ERC20 version of Aeternity (AEToken)
'AE': 'AET', // https://github.com/ccxt/ccxt/issues/4981
'BOX': 'DefiBox',
'HOT': 'Hydro Protocol',
'HSR': 'HC',
'MAG': 'Maggie',
'SBTC': 'Super Bitcoin',
'YOYO': 'YOYOW',
'WIN': 'WinToken', // https://github.com/ccxt/ccxt/issues/5701
},
'apiKey':'287482e1-3188-4dcb-bd85-1cba99a86377',
'secret' : '8EF3DC8D92E3F92B4421ECF60920E93A'
});
}
async fetchStatus (params = {}) {
const response = await this.publicGetSystemStatus (params);
//
// {
// "code":"0",
// "data":[
// {
// "begin":"1621328400000",
// "end":"1621329000000",
// "href":"https://www.okex.com/support/hc/en-us/articles/360060882172",
// "scheDesc":"",
// "serviceType":"1", // 0 WebSocket, 1 Spot/Margin, 2 Futures, 3 Perpetual, 4 Options, 5 Trading service
// "state":"scheduled", // ongoing, completed, canceled
// "system":"classic", // classic, unified
// "title":"Classic Spot System Upgrade"
// },
// ],
// "msg":""
// }
//
const data = this.safeValue (response, 'data', []);
const timestamp = this.milliseconds ();
const update = {
'info': response,
'updated': timestamp,
'status': 'ok',
'eta': undefined,
};
for (let i = 0; i < data.length; i++) {
const event = data[i];
const state = this.safeString (event, 'state');
if (state === 'ongoing') {
update['eta'] = this.safeInteger (event, 'end');
update['status'] = 'maintenance';
}
}
this.status = this.extend (this.status, update);
return this.status;
}
async fetchTime (params = {}) {
const response = await this.publicGetPublicTime (params);
//
// {
// "code":"0",
// "data":[
// {"ts":"1621247923668"}
// ],
// "msg":""
// }
//
const data = this.safeValue (response, 'data', []);
const first = this.safeValue (data, 0, {});
return this.safeInteger (first, 'ts');
}
async fetchMarkets (params = {}) {
const types = this.safeValue (this.options, 'fetchMarkets');
let result = [];
for (let i = 0; i < types.length; i++) {
const markets = await this.fetchMarketsByType (types[i], params);
result = this.arrayConcat (result, markets);
}
return result;
}
parseMarkets (markets) {
const result = [];
for (let i = 0; i < markets.length; i++) {
result.push (this.parseMarket (markets[i]));
}
return result;
}
parseMarket (market) {
//
// {
// "alias":"", // this_week, next_week, quarter, next_quarter
// "baseCcy":"BTC",
// "category":"1",
// "ctMult":"",
// "ctType":"", // inverse, linear
// "ctVal":"",
// "ctValCcy":"",
// "expTime":"",
// "instId":"BTC-USDT", // BTC-USD-210521, CSPR-USDT-SWAP, BTC-USD-210517-44000-C
// "instType":"SPOT", // SPOT, FUTURES, SWAP, OPTION
// "lever":"10",
// "listTime":"1548133413000",
// "lotSz":"0.00000001",
// "minSz":"0.00001",
// "optType":"",
// "quoteCcy":"USDT",
// "settleCcy":"",
// "state":"live",
// "stk":"",
// "tickSz":"0.1",
// "uly":""
// }
//
const id = this.safeString (market, 'instId');
const type = this.safeStringLower (market, 'instType');
const spot = (type === 'spot');
const futures = (type === 'futures');
const swap = (type === 'swap');
const option = (type === 'option');
let baseId = this.safeString (market, 'baseCcy');
let quoteId = this.safeString (market, 'quoteCcy');
const settleCurrency = this.safeString (market, 'settleCcy');
const underlying = this.safeString (market, 'uly');
if ((underlying !== undefined) && !spot) {
const parts = underlying.split ('-');
baseId = this.safeString (parts, 0);
quoteId = this.safeString (parts, 1);
}
const inverse = baseId === settleCurrency;
const linear = quoteId === settleCurrency;
const base = this.safeCurrencyCode (baseId);
const quote = this.safeCurrencyCode (quoteId);
const symbol = spot ? (base + '/' + quote) : id;
const tickSize = this.safeString (market, 'tickSz');
const precision = {
'amount': this.safeNumber (market, 'lotSz'),
'price': this.parseNumber (tickSize),
};
const minAmountString = this.safeString (market, 'minSz');
const minAmount = this.parseNumber (minAmountString);
let minCost = undefined;
if ((minAmount !== undefined) && (tickSize !== undefined)) {
minCost = this.parseNumber (Precise.stringMul (tickSize, minAmountString));
}
const active = true;
const fees = this.safeValue2 (this.fees, type, 'trading', {});
const contractSize = this.safeString (market, 'ctVal');
return this.extend (fees, {
'id': id,
'symbol': symbol,
'base': base,
'quote': quote,
'baseId': baseId,
'quoteId': quoteId,
'info': market,
'type': type,
'spot': spot,
'futures': futures,
'swap': swap,
'option': option,
'linear': linear,
'inverse': inverse,
'active': active,
'contractSize': contractSize,
'precision': precision,
'limits': {
'amount': {
'min': minAmount,
'max': undefined,
},
'price': {
'min': precision['price'],
'max': undefined,
},
'cost': {
'min': minCost,
'max': undefined,
},
},
});
}
async fetchMarketsByType (type, params = {}) {
const uppercaseType = type.toUpperCase ();
const request = {
'instType': uppercaseType,
};
if (uppercaseType === 'OPTION') {
const defaultUnderlying = this.safeValue (this.options, 'defaultUnderlying', 'BTC-USD');
const currencyId = this.safeString2 (params, 'uly', 'marketId', defaultUnderlying);
if (currencyId === undefined) {
throw new ArgumentsRequired (this.id + ' fetchMarketsByType requires an underlying uly or marketId parameter for options markets');
} else {
request['uly'] = currencyId;
}
}
const response = await this.publicGetPublicInstruments (this.extend (request, params));
//
// spot, futures, swaps, options
//
// {
// "code":"0",
// "data":[
// {
// "alias":"", // this_week, next_week, quarter, next_quarter
// "baseCcy":"BTC",
// "category":"1",
// "ctMult":"",
// "ctType":"", // inverse, linear
// "ctVal":"",
// "ctValCcy":"",
// "expTime":"",
// "instId":"BTC-USDT", // BTC-USD-210521, CSPR-USDT-SWAP, BTC-USD-210517-44000-C
// "instType":"SPOT", // SPOT, FUTURES, SWAP, OPTION
// "lever":"10",
// "listTime":"1548133413000",
// "lotSz":"0.00000001",
// "minSz":"0.00001",
// "optType":"",
// "quoteCcy":"USDT",
// "settleCcy":"",
// "state":"live",
// "stk":"",
// "tickSz":"0.1",
// "uly":""
// }
// ],
// "msg":""
// }
//
const data = this.safeValue (response, 'data', []);
return this.parseMarkets (data);
}
async fetchCurrencies (params = {}) {
// has['fetchCurrencies'] is currently set to false
// it will reply with {"msg":"Request header “OK_ACCESS_KEY“ can't be empty.","code":"50103"}
// if you attempt to access it without authentication
const response = await this.privateGetAssetCurrencies (params);
//
// {
// "code":"0",
// "data":[
// {
// "canDep":true,
// "canInternal":true,
// "canWd":true,
// "ccy":"USDT",
// "chain":"USDT-ERC20",
// "maxFee":"40",
// "minFee":"20",
// "minWd":"2",
// "name":""
// }
// ],
// "msg":""
// }
//
const data = this.safeValue (response, 'data', []);
const result = {};
const dataByCurrencyId = this.groupBy (data, 'ccy');
const currencyIds = Object.keys (dataByCurrencyId);
for (let i = 0; i < currencyIds.length; i++) {
const currencyId = currencyIds[i];
const chains = dataByCurrencyId[currencyId];
const first = this.safeValue (chains, 0);
const id = this.safeString (first, 'ccy');
const code = this.safeCurrencyCode (id);
const precision = 0.00000001; // default precision, todo: fix "magic constants"
let name = this.safeString (first, 'name');
if ((name !== undefined) && (name.length < 1)) {
name = undefined;
}
const canDeposit = this.safeValue (first, 'canDep');
const canWithdraw = this.safeValue (first, 'canWd');
const canInternal = this.safeValue (first, 'canInternal');
const active = (canDeposit && canWithdraw && canInternal) ? true : false;
result[code] = {
'id': id,
'code': code,
'info': chains,
'type': undefined,
'name': name,
'active': active,
'fee': this.safeNumber (first, 'minFee'),
'precision': precision,
'limits': {
'amount': { 'min': undefined, 'max': undefined },
'withdraw': {
'min': this.safeNumber (first, 'ccy'),
'max': undefined,
},
},
};
}
return result;
}
async fetchOrderBook (symbol, limit = undefined, params = {}) {
await this.loadMarkets ();
const market = this.market (symbol);
const request = {
'instId': market['id'],
};
limit = (limit === undefined) ? 20 : limit;
if (limit !== undefined) {
request['sz'] = limit; // max 400
}
const response = await this.publicGetMarketBooks (this.extend (request, params));
//
// {
// "code":"0",
// "msg":"",
// "data":[
// {
// "asks":[
// ["0.07228","4.211619","0","2"], // price, amount, liquidated orders, total open orders
// ["0.0723","299.880364","0","2"],
// ["0.07231","3.72832","0","1"],
// ],
// "bids":[
// ["0.07221","18.5","0","1"],
// ["0.0722","18.5","0","1"],
// ["0.07219","0.505407","0","1"],
// ],
// "ts":"1621438475342"
// }
// ]
// }
//
const data = this.safeValue (response, 'data', []);
const first = this.safeValue (data, 0, {});
const timestamp = this.safeInteger (first, 'ts');
return this.parseOrderBook (first, symbol, timestamp);
}
parseTicker (ticker, market = undefined) {
//
// {
// "instType":"SPOT",
// "instId":"ETH-BTC",
// "last":"0.07319",
// "lastSz":"0.044378",
// "askPx":"0.07322",
// "askSz":"4.2",
// "bidPx":"0.0732",
// "bidSz":"6.050058",
// "open24h":"0.07801",
// "high24h":"0.07975",
// "low24h":"0.06019",
// "volCcy24h":"11788.887619",
// "vol24h":"167493.829229",
// "ts":"1621440583784",
// "sodUtc0":"0.07872",
// "sodUtc8":"0.07345"
// }
//
const timestamp = this.safeInteger (ticker, 'ts');
const marketId = this.safeString (ticker, 'instId');
market = this.safeMarket (marketId, market, '-');
const symbol = market['symbol'];
const last = this.safeNumber (ticker, 'last');
const open = this.safeNumber (ticker, 'open24h');
const quoteVolume = this.safeNumber (ticker, 'volCcy24h');
const baseVolume = this.safeNumber (ticker, 'vol24h');
const vwap = this.vwap (baseVolume, quoteVolume);
return {
'symbol': symbol,
'timestamp': timestamp,
'datetime': this.iso8601 (timestamp),
'high': this.safeNumber (ticker, 'high24h'),
'low': this.safeNumber (ticker, 'low24h'),
'bid': this.safeNumber (ticker, 'bidPx'),
'bidVolume': this.safeNumber (ticker, 'bidSz'),
'ask': this.safeNumber (ticker, 'askPx'),
'askVolume': this.safeNumber (ticker, 'askSz'),
'vwap': vwap,
'open': open,
'close': last,
'last': last,
'previousClose': undefined,
'change': undefined,
'percentage': undefined,
'average': undefined,
'baseVolume': baseVolume,
'quoteVolume': quoteVolume,
'info': ticker,
};
}
async fetchTicker (symbol, params = {}) {
await this.loadMarkets ();
const market = this.market (symbol);
const request = {
'instId': market['id'],
};
const response = await this.publicGetMarketTicker (this.extend (request, params));
//
// {
// "code":"0",
// "msg":"",
// "data":[
// {
// "instType":"SPOT",
// "instId":"ETH-BTC",
// "last":"0.07319",
// "lastSz":"0.044378",
// "askPx":"0.07322",
// "askSz":"4.2",
// "bidPx":"0.0732",
// "bidSz":"6.050058",
// "open24h":"0.07801",
// "high24h":"0.07975",
// "low24h":"0.06019",
// "volCcy24h":"11788.887619",
// "vol24h":"167493.829229",
// "ts":"1621440583784",
// "sodUtc0":"0.07872",
// "sodUtc8":"0.07345"
// }
// ]
// }
//
const data = this.safeValue (response, 'data', []);
const first = this.safeValue (data, 0, {});
return this.parseTicker (first, market);
}
async fetchTickersByType (type, symbols = undefined, params = {}) {
await this.loadMarkets ();
const uppercaseType = type.toUpperCase ();
const request = {
'instType': type.toUpperCase (),
};
if (uppercaseType === 'OPTION') {
const defaultUnderlying = this.safeValue (this.options, 'defaultUnderlying', 'BTC-USD');
const currencyId = this.safeString2 (params, 'uly', 'marketId', defaultUnderlying);
if (currencyId === undefined) {
throw new ArgumentsRequired (this.id + ' fetchTickersByType requires an underlying uly or marketId parameter for options markets');
} else {
request['uly'] = currencyId;
}
}
const response = await this.publicGetMarketTickers (this.extend (request, params));
//
// {
// "code":"0",
// "msg":"",
// "data":[
// {
// "instType":"SPOT",
// "instId":"BCD-BTC",
// "last":"0.0000769",
// "lastSz":"5.4788",
// "askPx":"0.0000777",
// "askSz":"3.2197",
// "bidPx":"0.0000757",
// "bidSz":"4.7509",
// "open24h":"0.0000885",
// "high24h":"0.0000917",
// "low24h":"0.0000596",
// "volCcy24h":"9.2877",
// "vol24h":"124824.1985",
// "ts":"1621441741434",
// "sodUtc0":"0.0000905",
// "sodUtc8":"0.0000729"
// },
// ]
// }
//
const tickers = this.safeValue (response, 'data', []);
return this.parseTickers (tickers, symbols);
}
async fetchTickers (symbols = undefined, params = {}) {
const defaultType = this.safeString2 (this.options, 'fetchTickers', 'defaultType');
const type = this.safeString (params, 'type', defaultType);
return await this.fetchTickersByType (type, symbols, this.omit (params, 'type'));
}
parseTrade (trade, market = undefined) {
//
// public fetchTrades
//
// {
// "instId":"ETH-BTC",
// "side":"sell",
// "sz":"0.119501",
// "px":"0.07065",
// "tradeId":"15826757",
// "ts":"1621446178316"
// }
//
// private fetchMyTrades
//
// {
// "side":"buy",
// "fillSz":"0.007533",
// "fillPx":"2654.98",
// "fee":"-0.000007533",
// "ordId":"317321390244397056",
// "instType":"SPOT",
// "instId":"ETH-USDT",
// "clOrdId":"",
// "posSide":"net",
// "billId":"317321390265368576",
// "tag":"0",
// "execType":"T",
// "tradeId":"107601752",
// "feeCcy":"ETH",
// "ts":"1621927314985"
// }
//
const id = this.safeString (trade, 'tradeId');
const marketId = this.safeString (trade, 'instId');
market = this.safeMarket (marketId, market, '-');
const symbol = market['symbol'];
const timestamp = this.safeInteger (trade, 'ts');
const priceString = this.safeString2 (trade, 'fillPx', 'px');
const amountString = this.safeString2 (trade, 'fillSz', 'sz');
const price = this.parseNumber (priceString);
const amount = this.parseNumber (amountString);
const cost = this.parseNumber (Precise.stringMul (priceString, amountString));
const side = this.safeString (trade, 'side');
const orderId = this.safeString (trade, 'ordId');
const feeCostString = this.safeString (trade, 'fee');
let fee = undefined;
if (feeCostString !== undefined) {
const feeCostSigned = Precise.stringNeg (feeCostString);
const feeCurrencyId = this.safeString (trade, 'feeCcy');
const feeCurrencyCode = this.safeCurrencyCode (feeCurrencyId);
fee = {
'cost': this.parseNumber (feeCostSigned),
'currency': feeCurrencyCode,
};
}
let takerOrMaker = this.safeString (trade, 'execType');
if (takerOrMaker === 'T') {
takerOrMaker = 'taker';
} else if (takerOrMaker === 'M') {
takerOrMaker = 'maker';
}
return {
'info': trade,
'timestamp': timestamp,
'datetime': this.iso8601 (timestamp),
'symbol': symbol,
'id': id,
'order': orderId,
'type': undefined,
'takerOrMaker': takerOrMaker,
'side': side,
'price': price,
'amount': amount,
'cost': cost,
'fee': fee,
};
}
async fetchTrades (symbol, since = undefined, limit = undefined, params = {}) {
await this.loadMarkets ();
const market = this.market (symbol);
const request = {
'instId': market['id'],
};
if (limit !== undefined) {
request['limit'] = limit; // default 100
}
const response = await this.publicGetMarketTrades (this.extend (request, params));
//
// {
// "code":"0",
// "msg":"",
// "data":[
// {"instId":"ETH-BTC","side":"sell","sz":"0.119501","px":"0.07065","tradeId":"15826757","ts":"1621446178316"},
// {"instId":"ETH-BTC","side":"sell","sz":"0.03","px":"0.07068","tradeId":"15826756","ts":"1621446178066"},
// {"instId":"ETH-BTC","side":"buy","sz":"0.507","px":"0.07069","tradeId":"15826755","ts":"1621446175085"},
// ]
// }
//
const data = this.safeValue (response, 'data', []);
return this.parseTrades (data, market, since, limit);
}
parseOHLCV (ohlcv, market = undefined) {
//
// [
// "1621447080000", // timestamp
// "0.07073", // open
// "0.07073", // high
// "0.07064", // low
// "0.07064", // close
// "12.08863", // base volume
// "0.854309" // quote volume
// ]
//
return [
this.safeInteger (ohlcv, 0),
this.safeNumber (ohlcv, 1),
this.safeNumber (ohlcv, 2),
this.safeNumber (ohlcv, 3),
this.safeNumber (ohlcv, 4),
this.safeNumber (ohlcv, 5),
];
}
async fetchOHLCV (symbol, timeframe = '1m', since = undefined, limit = undefined, params = {}) {
await this.loadMarkets ();
const market = this.market (symbol);
const request = {
'instId': market['id'],
'bar': this.timeframes[timeframe],
};
if (limit !== undefined) {
request['limit'] = limit; // default 100, max 100
}
const options = this.safeValue (this.options, 'fetchOHLCV', {});
const defaultType = this.safeString (options, 'type', 'Candles'); // Candles or HistoryCandles
const type = this.safeString (params, 'type', defaultType);
params = this.omit (params, 'type');
const method = 'publicGetMarket' + type;
if (since !== undefined) {
request['before'] = since - 1;
}
const response = await this[method] (this.extend (request, params));
//
// {
// "code":"0",
// "msg":"",
// "data":[
// ["1621447080000","0.07073","0.07073","0.07064","0.07064","12.08863","0.854309"],
// ["1621447020000","0.0708","0.0709","0.0707","0.07072","58.517435","4.143309"],
// ["1621446960000","0.0707","0.07082","0.0707","0.07076","53.850841","3.810921"],
// ]
// }
//
const data = this.safeValue (response, 'data', []);
return this.parseOHLCVs (data, market, timeframe, since, limit);
}
parseBalanceByType (type, response) {
if (type === 'funding') {
return this.parseFundingBalance (response);
} else {
return this.parseTradingBalance (response);
}
}
parseTradingBalance (response) {
const result = { 'info': response };
const data = this.safeValue (response, 'data', []);
const first = this.safeValue (data, 0, {});
const timestamp = this.safeInteger (first, 'uTime');
const details = this.safeValue (first, 'details', []);
for (let i = 0; i < details.length; i++) {
const balance = details[i];
const currencyId = this.safeString (balance, 'ccy');
const code = this.safeCurrencyCode (currencyId);
const account = this.account ();
// it may be incorrect to use total, free and used for swap accounts
const eq = this.safeString (balance, 'eq');
const availEq = this.safeString (balance, 'availEq');
if ((eq.length < 1) || (availEq.length < 1)) {
account['free'] = this.safeString (balance, 'availBal');
account['used'] = this.safeString (balance, 'frozenBal');
} else {
account['total'] = eq;
account['free'] = availEq;
}
result[code] = account;
}
result['timestamp'] = timestamp;
result['datetime'] = this.iso8601 (timestamp);
return this.parseBalance (result);
}
parseFundingBalance (response) {
const result = { 'info': response };
const data = this.safeValue (response, 'data', []);
for (let i = 0; i < data.length; i++) {
const balance = data[i];
const currencyId = this.safeString (balance, 'ccy');
const code = this.safeCurrencyCode (currencyId);
const account = this.account ();
// it may be incorrect to use total, free and used for swap accounts
account['total'] = this.safeString (balance, 'bal');
account['free'] = this.safeString (balance, 'availBal');
account['used'] = this.safeString (balance, 'frozenBal');
result[code] = account;
}
return this.parseBalance (result);
}
async fetchBalance (params = {}) {
await this.loadMarkets ();
const defaultType = this.safeString (this.options, 'defaultType');
const options = this.safeValue (this.options, 'fetchBalance', {});
let type = this.safeString (options, 'type', defaultType);
type = this.safeString (params, 'type', type);
params = this.omit (params, 'type');
let method = undefined;
if ((type === 'spot') || (type === 'trading')) {
method = 'privateGetAccountBalance';
} else if (type === 'funding') {
method = 'privateGetAssetBalances';
}
const request = {
// 'ccy': 'BTC,ETH', // comma-separated list of currency ids
};
const response = await this[method] (this.extend (request, params));
//
// {
// "code":"0",
// "data":[
// {
// "adjEq":"",
// "details":[
// {
// "availBal":"",
// "availEq":"28.21006347",
// "cashBal":"28.21006347",
// "ccy":"USDT",
// "crossLiab":"",
// "disEq":"28.2687404020176",
// "eq":"28.21006347",
// "eqUsd":"28.2687404020176",
// "frozenBal":"0",
// "interest":"",
// "isoEq":"0",
// "isoLiab":"",
// "liab":"",
// "maxLoan":"",
// "mgnRatio":"",
// "notionalLever":"0",
// "ordFrozen":"0",
// "twap":"0",
// "uTime":"1621556539861",
// "upl":"0",
// "uplLiab":""
// }
// ],
// "imr":"",
// "isoEq":"0",
// "mgnRatio":"",
// "mmr":"",
// "notionalUsd":"",
// "ordFroz":"",
// "totalEq":"28.2687404020176",
// "uTime":"1621556553510"
// }
// ],
// "msg":""
// }
//
// {
// "code":"0",
// "data":[
// {
// "adjEq":"",
// "details":[
// {
// "availBal":"0.049",
// "availEq":"",
// "cashBal":"0.049",
// "ccy":"BTC",
// "crossLiab":"",
// "disEq":"1918.55678",
// "eq":"0.049",
// "eqUsd":"1918.55678",
// "frozenBal":"0",
// "interest":"",
// "isoEq":"",
// "isoLiab":"",
// "liab":"",
// "maxLoan":"",
// "mgnRatio":"",
// "notionalLever":"",
// "ordFrozen":"0",
// "twap":"0",
// "uTime":"1621973128591",
// "upl":"",
// "uplLiab":""
// }
// ],
// "imr":"",
// "isoEq":"",
// "mgnRatio":"",
// "mmr":"",
// "notionalUsd":"",
// "ordFroz":"",
// "totalEq":"1918.55678",
// "uTime":"1622045126908"
// }
// ],
// "msg":""
// }
//
// funding
//
// {
// "code":"0",
// "data":[
// {
// "availBal":"0.00005426",
// "bal":0.0000542600000000,
// "ccy":"BTC",
// "frozenBal":"0"
// }
// ],
// "msg":""
// }
//
return this.parseBalanceByType (type, response);
}
async createOrder (symbol, type, side, amount, price = undefined, params = {}) {
await this.loadMarkets ();
const market = this.market (symbol);
const request = {
'instId': market['id'],
//
// Simple:
// - SPOT and OPTION buyer: cash
//
// Single-currency margin:
// - Isolated MARGIN: isolated
// - Cross MARGIN: cross
// - Cross SPOT: cash
// - Cross FUTURES/SWAP/OPTION: cross
// - Isolated FUTURES/SWAP/OPTION: isolated
//
// Multi-currency margin:
// - Isolated MARGIN: isolated
// - Cross SPOT: cross
// - Cross FUTURES/SWAP/OPTION: cross
// - Isolated FUTURES/SWAP/OPTION: isolated
//
'tdMode': 'cash', // cash, cross, isolated
// 'ccy': currency['id'], // only applicable to cross MARGIN orders in single-currency margin
// 'clOrdId': clientOrderId, // up to 32 characters, must be unique
// 'tag': tag, // up to 8 characters
//
// In long/short mode, side and posSide need to be combined
//
// buy with long means open long
// sell with long means close long
// sell with short means open short
// buy with short means close short
//
'side': side,
// 'posSide': 'long', // long, short, // required in the long/short mode, and can only be long or short
'ordType': type, // market, limit, post_only, fok, ioc
//
// for SPOT/MARGIN bought and sold at a limit price, sz refers to the amount of trading currency
// for SPOT/MARGIN bought at a market price, sz refers to the amount of quoted currency
// for SPOT/MARGIN sold at a market price, sz refers to the amount of trading currency
// for FUTURES/SWAP/OPTION buying and selling, sz refers to the number of contracts
//
// 'sz': this.amountToPrecision (symbol, amount),
// 'px': this.priceToPrecision (symbol, price), // limit orders only
// 'reduceOnly': false, // MARGIN orders only
};
const clientOrderId = this.safeString2 (params, 'clOrdId', 'clientOrderId');
if (clientOrderId === undefined) {
const brokerId = this.safeString (this.options, 'brokerId');
if (brokerId !== undefined) {
request['clOrdId'] = brokerId + this.uuid16 ();
}
} else {
request['clOrdId'] = clientOrderId;
params = this.omit (params, [ 'clOrdId', 'clientOrderId' ]);
}
if (type === 'market') {
// for market buy it requires the amount of quote currency to spend
if (side === 'buy') {
let notional = this.safeNumber (params, 'sz');
const createMarketBuyOrderRequiresPrice = this.safeValue (this.options, 'createMarketBuyOrderRequiresPrice', true);
if (createMarketBuyOrderRequiresPrice) {
if (price !== undefined) {
if (notional === undefined) {
notional = amount * price;
}
} else if (notional === undefined) {
throw new InvalidOrder (this.id + " createOrder() requires the price argument with market buy orders to calculate total order cost (amount to spend), where cost = amount * price. Supply a price argument to createOrder() call if you want the cost to be calculated for you from price and amount, or, alternatively, add .options['createMarketBuyOrderRequiresPrice'] = false and supply the total cost value in the 'amount' argument or in the 'sz' extra parameter (the exchange-specific behaviour)");
}
} else {
notional = (notional === undefined) ? amount : notional;
}
const precision = market['precision']['price'];
request['sz'] = this.decimalToPrecision (notional, TRUNCATE, precision, this.precisionMode);
} else {
request['sz'] = this.amountToPrecision (symbol, amount);
}
} else {
request['px'] = this.priceToPrecision (symbol, price);
request['sz'] = this.amountToPrecision (symbol, amount);
}
const response = await this.privatePostTradeOrder (this.extend (request, params));
//
// {
// "code": "0",
// "msg": "",
// "data": [
// {
// "clOrdId": "oktswap6",
// "ordId": "312269865356374016",
// "tag": "",
// "sCode": "0",
// "sMsg": ""
// }
// ]
// }
//
const data = this.safeValue (response, 'data', []);
const first = this.safeValue (data, 0);
const order = this.parseOrder (first, market);
return this.extend (order, {
'type': type,
'side': side,
});
}
async cancelOrder (id, symbol = undefined, params = {}) {
if (symbol === undefined) {
throw new ArgumentsRequired (this.id + ' cancelOrder() requires a symbol argument');
}
await this.loadMarkets ();
const market = this.market (symbol);
const request = {
'instId': market['id'],
// 'ordId': id, // either ordId or clOrdId is required
// 'clOrdId': clientOrderId,
};
const clientOrderId = this.safeString2 (params, 'clOrdId', 'clientOrderId');
if (clientOrderId !== undefined) {
request['clOrdId'] = clientOrderId;
} else {
request['ordId'] = id;
}
const query = this.omit (params, [ 'clOrdId', 'clientOrderId' ]);
const response = await this.privatePostTradeCancelOrder (this.extend (request, query));
// {"code":"0","data":[{"clOrdId":"","ordId":"317251910906576896","sCode":"0","sMsg":""}],"msg":""}
const data = this.safeValue (response, 'data', []);
const order = this.safeValue (data, 0);
return this.parseOrder (order, market);
}
parseOrderStatus (status) {
const statuses = {
'canceled': 'canceled',
'live': 'open',
'partially_filled': 'open',
'filled': 'closed',
};
return this.safeString (statuses, status, status);
}
parseOrder (order, market = undefined) {
//
// createOrder
//
// {
// "clOrdId": "oktswap6",
// "ordId": "312269865356374016",
// "tag": "",
// "sCode": "0",
// "sMsg": ""
// }
//
// fetchOrder, fetchOpenOrders
//
// {
// "accFillSz":"0",
// "avgPx":"",
// "cTime":"1621910749815",
// "category":"normal",
// "ccy":"",
// "clOrdId":"",
// "fee":"0",
// "feeCcy":"ETH",
// "fillPx":"",
// "fillSz":"0",
// "fillTime":"",
// "instId":"ETH-USDT",
// "instType":"SPOT",
// "lever":"",
// "ordId":"317251910906576896",
// "ordType":"limit",
// "pnl":"0",
// "posSide":"net",
// "px":"2000",
// "rebate":"0",
// "rebateCcy":"USDT",
// "side":"buy",
// "slOrdPx":"",
// "slTriggerPx":"",
// "state":"live",
// "sz":"0.001",
// "tag":"",
// "tdMode":"cash",
// "tpOrdPx":"",
// "tpTriggerPx":"",
// "tradeId":"",
// "uTime":"1621910749815"
// }
//
const id = this.safeString (order, 'ordId');
const timestamp = this.safeInteger (order, 'cTime');
const lastTradeTimestamp = this.safeInteger (order, 'fillTime');
const side = this.safeString (order, 'side');
let type = this.safeString (order, 'ordType');
let postOnly = undefined;
let timeInForce = undefined;
if (type === 'post_only') {
postOnly = true;
type = 'limit';
} else if (type === 'fok') {
timeInForce = 'FOK';
type = 'limit';
} else if (type === 'ioc') {
timeInForce = 'IOC';
type = 'limit';
}
const marketId = this.safeString (order, 'instId');
const symbol = this.safeSymbol (marketId, market, '-');
const filled = this.safeNumber (order, 'accFillSz');
const price = this.safeNumber2 (order, 'px', 'slOrdPx');
const average = this.safeNumber (order, 'avgPx');
const status = this.parseOrderStatus (this.safeString (order, 'state'));
const feeCostString = this.safeString (order, 'fee');
let amount = undefined;
let cost = undefined;
if (side === 'buy' && type === 'market') {
cost = this.safeNumber (order, 'sz');
} else {
amount = this.safeNumber (order, 'sz');
}
let fee = undefined;
if (feeCostString !== undefined) {
const feeCostSigned = Precise.stringNeg (feeCostString);
const feeCurrencyId = this.safeString (order, 'feeCcy');
const feeCurrencyCode = this.safeCurrencyCode (feeCurrencyId);
fee = {
'cost': this.parseNumber (feeCostSigned),
'currency': feeCurrencyCode,
};
}
let clientOrderId = this.safeString (order, 'clOrdId');
if ((clientOrderId !== undefined) && (clientOrderId.length < 1)) {
clientOrderId = undefined; // fix empty clientOrderId string
}
const stopPrice = this.safeNumber (order, 'slTriggerPx');
return this.safeOrder ({
'info': order,
'id': id,
'clientOrderId': clientOrderId,
'timestamp': timestamp,
'datetime': this.iso8601 (timestamp),
'lastTradeTimestamp': lastTradeTimestamp,
'symbol': symbol,
'type': type,
'timeInForce': timeInForce,
'postOnly': postOnly,
'side': side,
'price': price,
'stopPrice': stopPrice,
'average': average,
'cost': cost,
'amount': amount,
'filled': filled,
'remaining': undefined,
'status': status,
'fee': fee,
'trades': undefined,
});
}
async fetchOrder (id, symbol = undefined, params = {}) {
if (symbol === undefined) {
throw new ArgumentsRequired (this.id + ' fetchOrder() requires a symbol argument');
}
await this.loadMarkets ();
const market = this.market (symbol);
const request = {
'instId': market['id'],
// 'clOrdId': 'abcdef12345', // optional, [a-z0-9]{1,32}
// 'ordId': id,
};
const clientOrderId = this.safeString2 (params, 'clOrdId', 'clientOrderId');
if (clientOrderId !== undefined) {
request['clOrdId'] = clientOrderId;
} else {
request['ordId'] = id;
}
const query = this.omit (params, [ 'clOrdId', 'clientOrderId' ]);
const response = await this.privateGetTradeOrder (this.extend (request, query));
//
// {
// "code":"0",
// "data":[
// {
// "accFillSz":"0",
// "avgPx":"",
// "cTime":"1621910749815",
// "category":"normal",
// "ccy":"",
// "clOrdId":"",
// "fee":"0",
// "feeCcy":"ETH",
// "fillPx":"",
// "fillSz":"0",
// "fillTime":"",
// "instId":"ETH-USDT",
// "instType":"SPOT",
// "lever":"",
// "ordId":"317251910906576896",
// "ordType":"limit",
// "pnl":"0",
// "posSide":"net",
// "px":"2000",
// "rebate":"0",
// "rebateCcy":"USDT",
// "side":"buy",
// "slOrdPx":"",
// "slTriggerPx":"",
// "state":"live",
// "sz":"0.001",
// "tag":"",
// "tdMode":"cash",
// "tpOrdPx":"",
// "tpTriggerPx":"",
// "tradeId":"",
// "uTime":"1621910749815"
// }
// ],
// "msg":""
// }
//
const data = this.safeValue (response, 'data', []);
const order = this.safeValue (data, 0);
return this.parseOrder (order, market);
}
async fetchOpenOrders (symbol = undefined, since = undefined, limit = undefined, params = {}) {
await this.loadMarkets ();
const request = {
// 'instType': 'SPOT', // SPOT, MARGIN, SWAP, FUTURES, OPTION
// 'uly': currency['id'],
// 'instId': market['id'],
// 'ordType': 'limit', // market, limit, post_only, fok, ioc, comma-separated
// 'state': 'live', // live, partially_filled
// 'after': orderId,
// 'before': orderId,
// 'limit': limit, // default 100, max 100
};
let market = undefined;
if (symbol !== undefined) {
market = this.market (symbol);
request['instId'] = market['id'];
}
if (limit !== undefined) {
request['limit'] = limit; // default 100, max 100
}
const response = await this.privateGetTradeOrdersPending (this.extend (request, params));
//
// {
// "code":"0",
// "data":[
// {
// "accFillSz":"0",
// "avgPx":"",
// "cTime":"1621910749815",
// "category":"normal",
// "ccy":"",
// "clOrdId":"",
// "fee":"0",
// "feeCcy":"ETH",
// "fillPx":"",
// "fillSz":"0",
// "fillTime":"",
// "instId":"ETH-USDT",
// "instType":"SPOT",
// "lever":"",
// "ordId":"317251910906576896",
// "ordType":"limit",
// "pnl":"0",
// "posSide":"net",
// "px":"2000",
// "rebate":"0",
// "rebateCcy":"USDT",
// "side":"buy",
// "slOrdPx":"",
// "slTriggerPx":"",
// "state":"live",
// "sz":"0.001",
// "tag":"",
// "tdMode":"cash",
// "tpOrdPx":"",
// "tpTriggerPx":"",
// "tradeId":"",
// "uTime":"1621910749815"
// }
// ],
// "msg":""
// }
//
const data = this.safeValue (response, 'data', []);
return this.parseOrders (data, market, since, limit);
}
async fetchClosedOrders (symbol = undefined, since = undefined, limit = undefined, params = {}) {
await this.loadMarkets ();
const defaultType = this.safeString (this.options, 'defaultType');
const options = this.safeString (this.options, 'fetchClosedOrders', {});
let type = this.safeString (options, 'type', defaultType);
type = this.safeString (params, 'type', type);
params = this.omit (params, 'type');
const request = {
// 'instType': type.toUpperCase (), // SPOT, MARGIN, SWAP, FUTURES, OPTION
// 'uly': currency['id'],
// 'instId': market['id'],
// 'ordType': 'limit', // market, limit, post_only, fok, ioc, comma-separated
// 'state': 'filled', // filled, canceled
// 'after': orderId,
// 'before': orderId,
// 'limit': limit, // default 100, max 100
};
let market = undefined;
if (symbol !== undefined) {
market = this.market (symbol);
if (market['futures'] || market['swap']) {
type = market['type'];
}
request['instId'] = market['id'];
}
request['instType'] = type.toUpperCase ();
if (limit !== undefined) {
request['limit'] = limit; // default 100, max 100
}
const method = this.safeString (options, 'method', 'privateGetTradeOrdersHistory');
const response = await this[method] (this.extend (request, params));
//
// {
// "code":"0",
// "data":[
// {
// "accFillSz":"0",
// "avgPx":"",
// "cTime":"1621910749815",
// "category":"normal",
// "ccy":"",
// "clOrdId":"",
// "fee":"0",
// "feeCcy":"ETH",
// "fillPx":"",
// "fillSz":"0",
// "fillTime":"",
// "instId":"ETH-USDT",
// "instType":"SPOT",
// "lever":"",
// "ordId":"317251910906576896",
// "ordType":"limit",
// "pnl":"0",
// "posSide":"net",
// "px":"2000",
// "rebate":"0",
// "rebateCcy":"USDT",
// "side":"buy",
// "slOrdPx":"",
// "slTriggerPx":"",
// "state":"live",
// "sz":"0.001",
// "tag":"",
// "tdMode":"cash",
// "tpOrdPx":"",
// "tpTriggerPx":"",
// "tradeId":"",
// "uTime":"1621910749815"
// }
// ],
// "msg":""
// }
//
const data = this.safeValue (response, 'data', []);
return this.parseOrders (data, market, since, limit);
}
async fetchMyTrades (symbol = undefined, since = undefined, limit = undefined, params = {}) {
const request = {
'instType': 'SPOT', // SPOT, MARGIN, SWAP, FUTURES, OPTION
// 'uly': currency['id'],
// 'instId': market['id'],
// 'ordId': orderId,
// 'after': billId,
// 'before': billId,
// 'limit': limit, // default 100, max 100
};
let market = undefined;
await this.loadMarkets ();
if (symbol !== undefined) {
market = this.market (symbol);
request['instId'] = market['id'];
}
if (limit !== undefined) {
request['limit'] = limit; // default 100, max 100
}
const response = await this.privateGetTradeFillsHistory (this.extend (request, params));
//
// {
// "code":"0",
// "data":[
// {
// "side":"buy",
// "fillSz":"0.007533",
// "fillPx":"2654.98",
// "fee":"-0.000007533",
// "ordId":"317321390244397056",
// "instType":"SPOT",
// "instId":"ETH-USDT",
// "clOrdId":"",
// "posSide":"net",
// "billId":"317321390265368576",
// "tag":"0",
// "execType":"T",
// "tradeId":"107601752",
// "feeCcy":"ETH",
// "ts":"1621927314985"
// }
// ],
// "msg":""
// }
//
const data = this.safeValue (response, 'data', []);
return this.parseTrades (data, market, since, limit, params);
}
async fetchOrderTrades (id, symbol = undefined, since = undefined, limit = undefined, params = {}) {
const request = {
// 'instrument_id': market['id'],
'ordId': id,
// 'after': '1', // return the page after the specified page number
// 'before': '1', // return the page before the specified page number
// 'limit': limit, // optional, number of results per request, default = maximum = 100
};
return await this.fetchMyTrades (symbol, since, limit, this.extend (request, params));
}
async fetchLedger (code = undefined, since = undefined, limit = undefined, params = {}) {
await this.loadMarkets ();
const options = this.safeValue (this.options, 'fetchLedger', {});
let method = this.safeString (options, 'method');
method = this.safeString (params, 'method', method);
params = this.omit (params, 'method');
const request = {
// 'instType': undefined, // 'SPOT', 'MARGIN', 'SWAP', 'FUTURES", 'OPTION'
// 'ccy': undefined, // currency['id'],
// 'mgnMode': undefined, // 'isolated', 'cross'
// 'ctType': undefined, // 'linear', 'inverse', only applicable to FUTURES/SWAP
// 'type': undefined,
// 1 Transfer,
// 2 Trade,
// 3 Delivery,
// 4 Auto token conversion,
// 5 Liquidation,
// 6 Margin transfer,
// 7 Interest deduction,
// 8 Funding rate,
// 9 ADL,
// 10 Clawback,
// 11 System token conversion
// 'subType': undefined,
// 1 Buy
// 2 Sell
// 3 Open long
// 4 Open short
// 5 Close long
// 6 Close short
// 9 Interest deduction
// 11 Transfer in
// 12 Transfer out
// 160 Manual margin increase
// 161 Manual margin decrease
// 162 Auto margin increase
// 110 Auto buy
// 111 Auto sell
// 118 System token conversion transfer in
// 119 System token conversion transfer out
// 100 Partial liquidation close long
// 101 Partial liquidation close short
// 102 Partial liquidation buy
// 103 Partial liquidation sell
// 104 Liquidation long
// 105 Liquidation short
// 106 Liquidation buy
// 107 Liquidation sell
// 110 Liquidation transfer in
// 111 Liquidation transfer out
// 125 ADL close long
// 126 ADL close short
// 127 ADL buy
// 128 ADL sell
// 170 Exercised
// 171 Counterparty exercised
// 172 Expired OTM
// 112 Delivery long
// 113 Delivery short
// 117 Delivery/Exercise clawback
// 173 Funding fee expense
// 174 Funding fee income
//
// 'after': 'id', // return records earlier than the requested bill id
// 'before': 'id', // return records newer than the requested bill id
// 'limit': 100, // default 100, max 100
};
if (limit !== undefined) {
request['limit'] = limit;
}
let currency = undefined;
if (code !== undefined) {
currency = this.currency (code);
request['ccy'] = currency['id'];
}
const response = await this[method] (this.extend (request, params));
//
// privateGetAccountBills, privateGetAccountBillsArchive
//
// {
// "code": "0",
// "msg": "",
// "data": [
// {
// "bal": "0.0000819307998198",
// "balChg": "-664.2679586599999802",
// "billId": "310394313544966151",
// "ccy": "USDT",
// "fee": "0",
// "from": "",
// "instId": "LTC-USDT",
// "instType": "SPOT",
// "mgnMode": "cross",
// "notes": "",
// "ordId": "310394313519800320",
// "pnl": "0",
// "posBal": "0",
// "posBalChg": "0",
// "subType": "2",
// "sz": "664.26795866",
// "to": "",
// "ts": "1620275771196",
// "type": "2"
// }
// ]
// }
//
// privateGetAssetBills
//
// {
// "code": "0",
// "msg": "",
// "data": [
// {
// "billId": "12344",
// "ccy": "BTC",
// "balChg": "2",
// "bal": "12",
// "type": "1",
// "ts": "1597026383085"
// }
// ]
// }
//
const data = this.safeValue (response, 'data', []);
return this.parseLedger (data, currency, since, limit);
}
parseLedgerEntryType (type) {
const types = {
'1': 'transfer', // transfer
'2': 'trade', // trade
'3': 'trade', // delivery
'4': 'rebate', // auto token conversion
'5': 'trade', // liquidation
'6': 'transfer', // margin transfer
'7': 'trade', // interest deduction
'8': 'fee', // funding rate
'9': 'trade', // adl
'10': 'trade', // clawback
'11': 'trade', // system token conversion
};
return this.safeString (types, type, type);
}
parseLedgerEntry (item, currency = undefined) {
//
// privateGetAccountBills, privateGetAccountBillsArchive
//
// {
// "bal": "0.0000819307998198",
// "balChg": "-664.2679586599999802",
// "billId": "310394313544966151",
// "ccy": "USDT",
// "fee": "0",
// "from": "",
// "instId": "LTC-USDT",
// "instType": "SPOT",
// "mgnMode": "cross",
// "notes": "",
// "ordId": "310394313519800320",
// "pnl": "0",
// "posBal": "0",
// "posBalChg": "0",
// "subType": "2",
// "sz": "664.26795866",
// "to": "",
// "ts": "1620275771196",
// "type": "2"
// }
//
// privateGetAssetBills
//
// {
// "billId": "12344",
// "ccy": "BTC",
// "balChg": "2",
// "bal": "12",
// "type": "1",
// "ts": "1597026383085"
// }
//
const id = this.safeString (item, 'billId');
const account = undefined;
const referenceId = this.safeString (item, 'ordId');
const referenceAccount = undefined;
const type = this.parseLedgerEntryType (this.safeString (item, 'type'));
const code = this.safeCurrencyCode (this.safeString (item, 'ccy'), currency);
const amountString = this.safeString (item, 'balChg');
const amount = this.parseNumber (amountString);
const timestamp = this.safeInteger (item, 'ts');
const feeCostString = this.safeString (item, 'fee');
let fee = undefined;
if (feeCostString !== undefined) {
fee = {
'cost': this.parseNumber (Precise.stringNeg (feeCostString)),
'currency': code,
};
}
const before = undefined;
const afterString = this.safeString (item, 'bal');
const after = this.parseNumber (afterString);
const status = 'ok';
const marketId = this.safeString (item, 'instId');
let symbol = undefined;
if (marketId in this.markets_by_id) {
const market = this.markets_by_id[marketId];
symbol = market['symbol'];
}
return {
'id': id,
'info': item,
'timestamp': timestamp,
'datetime': this.iso8601 (timestamp),
'account': account,
'referenceId': referenceId,
'referenceAccount': referenceAccount,
'type': type,
'currency': code,
'symbol': symbol,
'amount': amount,
'before': before, // balance before
'after': after, // balance after
'status': status,
'fee': fee,
};
}
parseDepositAddress (depositAddress, currency = undefined) {
//
// {
// "addr": "okbtothemoon",
// "memo": "971668", // may be missing
// "tag":"52055", // may be missing
// "pmtId": "", // may be missing
// "ccy": "BTC",
// "to": "6", // 1 SPOT, 3 FUTURES, 6 FUNDING, 9 SWAP, 12 OPTION, 18 Unified account
// "selected": true
// }
//
// {
// "ccy":"usdt-erc20",
// "to":"6",
// "addr":"0x696abb81974a8793352cbd33aadcf78eda3cfdfa",
// "selected":true
// }
//
const address = this.safeString (depositAddress, 'addr');
let tag = this.safeString2 (depositAddress, 'tag', 'pmtId');
tag = this.safeString (depositAddress, 'memo', tag);
const currencyId = this.safeString (depositAddress, 'ccy');
const code = this.safeCurrencyCode (currencyId);
this.checkAddress (address);
return {
'currency': code,
'address': address,
'tag': tag,
'info': depositAddress,
};
}
async fetchDepositAddress (code, params = {}) {
await this.loadMarkets ();
const parts = code.split ('-');
const currency = this.currency (parts[0]);
const request = {
'ccy': currency['id'],
};
const response = await this.privateGetAssetDepositAddress (this.extend (request, params));
//
// {
// "code": "0",
// "msg": "",
// "data": [
// {
// "addr": "okbtothemoon",
// "memo": "971668", // may be missing
// "tag":"52055", // may be missing
// "pmtId": "", // may be missing
// "ccy": "BTC",
// "to": "6", // 1 SPOT, 3 FUTURES, 6 FUNDING, 9 SWAP, 12 OPTION, 18 Unified account
// "selected": true
// },
// // {"ccy":"usdt-erc20","to":"6","addr":"0x696abb81974a8793352cbd33aadcf78eda3cfdfa","selected":true},
// // {"ccy":"usdt-trc20","to":"6","addr":"TRrd5SiSZrfQVRKm4e9SRSbn2LNTYqCjqx","selected":true},
// // {"ccy":"usdt_okexchain","to":"6","addr":"0x696abb81974a8793352cbd33aadcf78eda3cfdfa","selected":true},
// // {"ccy":"usdt_kip20","to":"6","addr":"0x696abb81974a8793352cbd33aadcf78eda3cfdfa","selected":true},
// ]
// }
//
const data = this.safeValue (response, 'data', []);
const addressesByCode = this.parseDepositAddresses (data);
const address = this.safeValue (addressesByCode, code);
if (address === undefined) {
throw new InvalidAddress (this.id + ' fetchDepositAddress cannot return nonexistent addresses, you should create withdrawal addresses with the exchange website first');
}
return address;
}
async withdraw (code, amount, address, tag = undefined, params = {}) {
this.checkAddress (address);
await this.loadMarkets ();
const currency = this.currency (code);
if (tag !== undefined) {
address = address + ':' + tag;
}
const fee = this.safeString (params, 'fee');
if (fee === undefined) {
throw new ArgumentsRequired (this.id + " withdraw() requires a `fee` string parameter, network transaction fee must be ≥ 0. Withdrawals to OKCoin or OKEx are fee-free, please set '0'. Withdrawing to external digital asset address requires network transaction fee.");
}
const request = {
'ccy': currency['id'],
'toAddr': address,
'dest': '4', // 2 = OKCoin International, 3 = OKEx 4 = others
'amt': this.numberToString (amount),
'fee': this.numberToString (fee), // withdrawals to OKCoin or OKEx are fee-free, please set 0
};
if ('password' in params) {
request['pwd'] = params['password'];
} else if ('pwd' in params) {
request['pwd'] = params['pwd'];
}
const query = this.omit (params, [ 'fee', 'password', 'pwd' ]);
if (!('pwd' in request)) {
throw new ExchangeError (this.id + ' withdraw() requires a password parameter or a pwd parameter, it must be the funding password, not the API passphrase');
}
const response = await this.privatePostAssetWithdrawal (this.extend (request, query));
//
// {
// "code": "0",
// "msg": "",
// "data": [
// {
// "amt": "0.1",
// "wdId": "67485",
// "ccy": "BTC"
// }
// ]
// }
//
const data = this.safeValue (response, 'data', []);
const transaction = this.safeValue (data, 0);
return this.parseTransaction (transaction, currency);
}
async fetchDeposits (code = undefined, since = undefined, limit = undefined, params = {}) {
await this.loadMarkets ();
const request = {
// 'ccy': currency['id'],
// 'state': 2, // 0 waiting for confirmation, 1 deposit credited, 2 deposit successful
// 'after': since,
// 'before' this.milliseconds (),
// 'limit': limit, // default 100, max 100
};
let currency = undefined;
if (code !== undefined) {
currency = this.currency (code);
request['ccy'] = currency['id'];
}
if (since !== undefined) {
request['after'] = since;
}
if (limit !== undefined) {
request['limit'] = limit; // default 100, max 100
}
const response = await this.privateGetAssetDepositHistory (this.extend (request, params));
//
// {
// "code": "0",
// "msg": "",
// "data": [
// {
// "amt": "0.01044408",
// "txId": "1915737_3_0_0_asset",
// "ccy": "BTC",
// "from": "13801825426",
// "to": "",
// "ts": "1597026383085",
// "state": "2",
// "depId": "4703879"
// },
// {
// "amt": "491.6784211",
// "txId": "1744594_3_184_0_asset",
// "ccy": "OKB",
// "from": "",
// "to": "",
// "ts": "1597026383085",
// "state": "2",
// "depId": "4703809"
// },
// {
// "amt": "223.18782496",
// "txId": "6d892c669225b1092c780bf0da0c6f912fc7dc8f6b8cc53b003288624c",
// "ccy": "USDT",
// "from": "",
// "to": "39kK4XvgEuM7rX9frgyHoZkWqx4iKu1spD",
// "ts": "1597026383085",
// "state": "2",
// "depId": "4703779"
// }
// ]
// }
//
const data = this.safeValue (response, 'data', []);
return this.parseTransactions (data, currency, since, limit, params);
}
async fetchWithdrawals (code = undefined, since = undefined, limit = undefined, params = {}) {
await this.loadMarkets ();
const request = {
// 'ccy': currency['id'],
// 'state': 2, // -3: pending cancel, -2 canceled, -1 failed, 0, pending, 1 sending, 2 sent, 3 awaiting email verification, 4 awaiting manual verification, 5 awaiting identity verification
// 'after': since,
// 'before': this.milliseconds (),
// 'limit': limit, // default 100, max 100
};
let currency = undefined;
if (code !== undefined) {
currency = this.currency (code);
request['ccy'] = currency['id'];
}
if (since !== undefined) {
request['after'] = since;
}
if (limit !== undefined) {
request['limit'] = limit; // default 100, max 100
}
const response = await this.privateGetAssetWithdrawalHistory (this.extend (request, params));
//
// {
// "code": "0",
// "msg": "",
// "data": [
// {
// "amt": "0.094",
// "wdId": "4703879",
// "fee": "0.01000000eth",
// "txId": "0x62477bac6509a04512819bb1455e923a60dea5966c7caeaa0b24eb8fb0432b85",
// "ccy": "ETH",
// "from": "13426335357",
// "to": "0xA41446125D0B5b6785f6898c9D67874D763A1519",
// "ts": "1597026383085",
// "state": "2"
// },
// {
// "amt": "0.01",
// "wdId": "4703879",
// "fee": "0.00000000btc",
// "txId": "",
// "ccy": "BTC",
// "from": "13426335357",
// "to": "13426335357",
// "ts": "1597026383085",
// "state": "2"
// }
// ]
// }
//
const data = this.safeValue (response, 'data', []);
return this.parseTransactions (data, currency, since, limit, params);
}
parseTransactionStatus (status) {
//
// deposit statuses
//
// {
// '0': 'waiting for confirmation',
// '1': 'deposit credited',
// '2': 'deposit successful'
// }
//
// withdrawal statuses
//
// {
// '-3': 'pending cancel',
// '-2': 'canceled',
// '-1': 'failed',
// '0': 'pending',
// '1': 'sending',
// '2': 'sent',
// '3': 'awaiting email verification',
// '4': 'awaiting manual verification',
// '5': 'awaiting identity verification'
// }
//
const statuses = {
'-3': 'pending',
'-2': 'canceled',
'-1': 'failed',
'0': 'pending',
'1': 'pending',
'2': 'ok',
'3': 'pending',
'4': 'pending',
'5': 'pending',
};
return this.safeString (statuses, status, status);
}
parseTransaction (transaction, currency = undefined) {
//
// withdraw
//
// {
// "amt": "0.1",
// "wdId": "67485",
// "ccy": "BTC"
// }
//
// fetchWithdrawals
//
// {
// "amt": "0.094",
// "wdId": "4703879",
// "fee": "0.01000000eth",
// "txId": "0x62477bac6509a04512819bb1455e923a60dea5966c7caeaa0b24eb8fb0432b85",
// "ccy": "ETH",
// "from": "13426335357",
// "to": "0xA41446125D0B5b6785f6898c9D67874D763A1519",
// 'tag': string,
// 'pmtId': string,
// 'memo': string,
// "ts": "1597026383085",
// "state": "2"
// }
//
// fetchDeposits
//
// {
// "amt": "0.01044408",
// "txId": "1915737_3_0_0_asset",
// "ccy": "BTC",
// "from": "13801825426",
// "to": "",
// "ts": "1597026383085",
// "state": "2",
// "depId": "4703879"
// }
//
let type = undefined;
let id = undefined;
const withdrawalId = this.safeString (transaction, 'wdId');
const addressFrom = this.safeString (transaction, 'from');
const addressTo = this.safeString (transaction, 'to');
const address = addressTo;
let tagTo = this.safeString2 (transaction, 'tag', 'memo');
tagTo = this.safeString2 (transaction, 'pmtId', tagTo);
if (withdrawalId !== undefined) {
type = 'withdrawal';
id = withdrawalId;
} else {
// the payment_id will appear on new deposits but appears to be removed from the response after 2 months
id = this.safeString (transaction, 'depId');
type = 'deposit';
}
const currencyId = this.safeString (transaction, 'ccy');
const code = this.safeCurrencyCode (currencyId);
const amount = this.safeNumber (transaction, 'amt');
const status = this.parseTransactionStatus (this.safeString (transaction, 'state'));
const txid = this.safeString (transaction, 'txId');
const timestamp = this.safeInteger (transaction, 'ts');
let feeCost = undefined;
if (type === 'deposit') {
feeCost = 0;
} else {
feeCost = this.safeNumber (transaction, 'fee');
}
// todo parse tags
return {
'info': transaction,
'id': id,
'currency': code,
'amount': amount,
'addressFrom': addressFrom,
'addressTo': addressTo,
'address': address,
'tagFrom': undefined,
'tagTo': tagTo,
'tag': tagTo,
'status': status,
'type': type,
'updated': undefined,
'txid': txid,
'timestamp': timestamp,
'datetime': this.iso8601 (timestamp),
'fee': {
'currency': code,
'cost': feeCost,
},
};
}
async fetchPosition (symbol, params = {}) {
await this.loadMarkets ();
const market = this.market (symbol);
const type = this.safeString (params, 'type');
params = this.omit (params, 'type');
const request = {
// instType String No Instrument type, MARGIN, SWAP, FUTURES, OPTION
'instId': market['id'],
// posId String No Single position ID or multiple position IDs (no more than 20) separated with comma
};
if (type !== undefined) {
request['instType'] = type.toUpperCase ();
}
params = this.omit (params, 'type');
const response = await this.privateGetAccountPositions (params);
//
// {
// "code": "0",
// "msg": "",
// "data": [
// {
// "adl":"1",
// "availPos":"1",
// "avgPx":"2566.31",
// "cTime":"1619507758793",
// "ccy":"ETH",
// "deltaBS":"",
// "deltaPA":"",
// "gammaBS":"",
// "gammaPA":"",
// "imr":"",
// "instId":"ETH-USD-210430",
// "instType":"FUTURES",
// "interest":"0",
// "last":"2566.22",
// "lever":"10",
// "liab":"",
// "liabCcy":"",
// "liqPx":"2352.8496681818233",
// "margin":"0.0003896645377994",
// "mgnMode":"isolated",
// "mgnRatio":"11.731726509588816",
// "mmr":"0.0000311811092368",
// "optVal":"",
// "pTime":"1619507761462",
// "pos":"1",
// "posCcy":"",
// "posId":"307173036051017730",
// "posSide":"long",
// "thetaBS":"",
// "thetaPA":"",
// "tradeId":"109844",
// "uTime":"1619507761462",
// "upl":"-0.0000009932766034",
// "uplRatio":"-0.0025490556801078",
// "vegaBS":"",
// "vegaPA":""
// }
// ]
// }
//
const data = this.safeValue (response, 'data', []);
return this.parsePosition (this.safeValue (data, 0));
}
async fetchPositions (symbols = undefined, params = {}) {
await this.loadMarkets ();
// const defaultType = this.safeString2 (this.options, 'fetchPositions', 'defaultType');
// const type = this.safeString (params, 'type', defaultType);
const type = this.safeString (params, 'type');
params = this.omit (params, 'type');
const request = {
// instType String No Instrument type, MARGIN, SWAP, FUTURES, OPTION, instId will be checked against instType when both parameters are passed, and the position information of the instId will be returned.
// instId String No Instrument ID, e.g. BTC-USD-190927-5000-C
// posId String No Single position ID or multiple position IDs (no more than 20) separated with comma
};
if (type !== undefined) {
request['instType'] = type.toUpperCase ();
}
params = this.omit (params, 'type');
const response = await this.privateGetAccountPositions (this.extend (request, params));
//
// {
// "code": "0",
// "msg": "",
// "data": [
// {
// "adl":"1",
// "availPos":"1",
// "avgPx":"2566.31",
// "cTime":"1619507758793",
// "ccy":"ETH",
// "deltaBS":"",
// "deltaPA":"",
// "gammaBS":"",
// "gammaPA":"",
// "imr":"",
// "instId":"ETH-USD-210430",
// "instType":"FUTURES",
// "interest":"0",
// "last":"2566.22",
// "lever":"10",
// "liab":"",
// "liabCcy":"",
// "liqPx":"2352.8496681818233",
// "margin":"0.0003896645377994",
// "mgnMode":"isolated",
// "mgnRatio":"11.731726509588816",
// "mmr":"0.0000311811092368",
// "optVal":"",
// "pTime":"1619507761462",
// "pos":"1",
// "posCcy":"",
// "posId":"307173036051017730",
// "posSide":"long",
// "thetaBS":"",
// "thetaPA":"",
// "tradeId":"109844",
// "uTime":"1619507761462",
// "upl":"-0.0000009932766034",
// "uplRatio":"-0.0025490556801078",
// "vegaBS":"",
// "vegaPA":""
// }
// ]
// }
//
const positions = this.safeValue (response, 'data', []);
const result = [];
for (let i = 0; i < positions.length; i++) {
const entry = positions[i];
const instrument = this.safeString (entry, 'instType');
if ((instrument === 'FUTURES') || instrument === ('SWAP')) {
result.push (this.parsePosition (positions[i]));
}
}
return result;
}
parsePosition (position, market = undefined) {
//
// {
// "adl": "3",
// "availPos": "1",
// "avgPx": "34131.1",
// "cTime": "1627227626502",
// "ccy": "USDT",
// "deltaBS": "",
// "deltaPA": "",
// "gammaBS": "",
// "gammaPA": "",
// "imr": "170.66093041794787",
// "instId": "BTC-USDT-SWAP",
// "instType": "SWAP",
// "interest": "0",
// "last": "34134.4",
// "lever": "2",
// "liab": "",
// "liabCcy": "",
// "liqPx": "12608.959083877446",
// "margin": "",
// "mgnMode": "cross",
// "mgnRatio": "140.49930117599155",
// "mmr": "1.3652874433435829",
// "notionalUsd": "341.5130010779638",
// "optVal": "",
// "pos": "1",
// "posCcy": "",
// "posId": "339552508062380036",
// "posSide": "long",
// "thetaBS": "",
// "thetaPA": "",
// "tradeId": "98617799",
// "uTime": "1627227626502",
// "upl": "0.0108608358957281",
// "uplRatio": "0.0000636418743944",
// "vegaBS": "",
// "vegaPA": ""
// }
//
const marketId = this.safeString (position, 'instId');
market = this.safeMarket (marketId, market);
const symbol = market['symbol'];
const contractsString = this.safeString (position, 'pos');
let contracts = undefined;
if (contractsString !== undefined) {
contracts = parseInt (contractsString);
}
const notionalString = this.safeString (position, 'notionalUsd');
const notional = this.parseNumber (notionalString);
const marginType = this.safeString (position, 'mgnMode');
let initialMarginString = undefined;
const entryPriceString = this.safeString (position, 'avgPx');
const unrealizedPnlString = this.safeString (position, 'upl');
if (marginType === 'cross') {
initialMarginString = this.safeString (position, 'imr');
} else {
initialMarginString = this.safeString (position, 'margin');
}
const maintenanceMarginString = this.safeString (position, 'mmr');
const maintenanceMargin = this.parseNumber (maintenanceMarginString);
let initialMarginPercentage = undefined;
let maintenanceMarginPercentage = undefined;
if (market['inverse']) {
const notionalValue = Precise.stringDiv (Precise.stringMul (contractsString, market['contractSize']), entryPriceString);
maintenanceMarginPercentage = Precise.stringDiv (maintenanceMarginString, notionalValue);
initialMarginPercentage = this.parseNumber (Precise.stringDiv (initialMarginString, notionalValue, 4));
} else {
maintenanceMarginPercentage = Precise.stringDiv (maintenanceMarginString, notionalString);
initialMarginPercentage = this.parseNumber (Precise.stringDiv (initialMarginString, notionalString, 4));
}
const rounder = '0.00005'; // round to closest 0.01%
maintenanceMarginPercentage = this.parseNumber (Precise.stringDiv (Precise.stringAdd (maintenanceMarginPercentage, rounder), '1', 4));
const collateralString = Precise.stringAdd (initialMarginString, unrealizedPnlString);
const liquidationPrice = this.safeNumber (position, 'liqPx');
const percentageString = this.safeString (position, 'uplRatio');
const percentage = this.parseNumber (Precise.stringMul (percentageString, '100'));
const side = this.safeString (position, 'posSide');
const timestamp = this.safeInteger (position, 'uTime');
const leverage = this.safeInteger (position, 'lever');
const marginRatio = this.parseNumber (Precise.stringDiv (maintenanceMarginString, collateralString, 4));
return {
'info': position,
'symbol': symbol,
'notional': notional,
'marginType': marginType,
'liquidationPrice': liquidationPrice,
'entryPrice': this.parseNumber (entryPriceString),
'unrealizedPnl': this.parseNumber (unrealizedPnlString),
'percentage': percentage,
'contracts': contracts,
'contractSize': this.parseNumber (market['contractSize']),
'side': side,
'timestamp': timestamp,
'datetime': this.iso8601 (timestamp),
'maintenanceMargin': maintenanceMargin,
'maintenanceMarginPercentage': maintenanceMarginPercentage,
'collateral': this.parseNumber (collateralString),
'initialMargin': this.parseNumber (initialMarginString),
'initialMarginPercentage': this.parseNumber (initialMarginPercentage),
'leverage': leverage,
'marginRatio': marginRatio,
};
}
sign (path, api = 'public', method = 'GET', params = {}, headers = undefined, body = undefined) {
const isArray = Array.isArray (params);
const request = '/api/' + this.version + '/' + this.implodeParams (path, params);
const query = this.omit (params, this.extractParams (path));
let url = this.implodeHostname (this.urls['api']['rest']) + request;
// const type = this.getPathAuthenticationType (path);
if (api === 'public') {
if (Object.keys (query).length) {
url += '?' + this.urlencode (query);
}
} else if (api === 'private') {
this.checkRequiredCredentials ();
const timestamp = this.iso8601 (this.milliseconds ());
headers = {
'OK-ACCESS-KEY': this.apiKey,
'OK-ACCESS-PASSPHRASE': this.password,
'OK-ACCESS-TIMESTAMP': timestamp,
// 'OK-FROM': '',
// 'OK-TO': '',
// 'OK-LIMIT': '',
};
let auth = timestamp + method + request;
if (method === 'GET') {
if (Object.keys (query).length) {
const urlencodedQuery = '?' + this.urlencode (query);
url += urlencodedQuery;
auth += urlencodedQuery;
}
} else {
if (isArray || Object.keys (query).length) {
body = this.json (query);
auth += body;
}
headers['Content-Type'] = 'application/json';
}
const signature = this.hmac (this.encode (auth), this.encode (this.secret), 'sha256', 'base64');
headers['OK-ACCESS-SIGN'] = signature;
}
return { 'url': url, 'method': method, 'body': body, 'headers': headers };
}
handleErrors (httpCode, reason, url, method, headers, body, response, requestHeaders, requestBody) {
if (!response) {
return; // fallback to default error handler
}
//
// {"code":"1","data":[{"clOrdId":"","ordId":"","sCode":"51119","sMsg":"Order placement failed due to insufficient balance. ","tag":""}],"msg":""}
// {"code":"58001","data":[],"msg":"Incorrect trade password"}
//
const code = this.safeString (response, 'code');
if (code !== '0') {
const feedback = this.id + ' ' + body;
const data = this.safeValue (response, 'data', []);
for (let i = 0; i < data.length; i++) {
const error = data[i];
const errorCode = this.safeString (error, 'sCode');
const message = this.safeString (error, 'sMsg');
this.throwExactlyMatchedException (this.exceptions['exact'], errorCode, feedback);
this.throwBroadlyMatchedException (this.exceptions['broad'], message, feedback);
}
this.throwExactlyMatchedException (this.exceptions['exact'], code, feedback);
throw new ExchangeError (feedback); // unknown message
}
}
};
|
// Copyright 2008 The Closure Library Authors. All Rights Reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS-IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
/**
* @fileoverview A dimension picker control. A dimension picker allows the
* user to visually select a row and column count.
*
* @author robbyw@google.com (Robby Walker)
* @author abefettig@google.com (Abe Fettig)
* @see ../demos/dimensionpicker.html
* @see ../demos/dimensionpicker_rtl.html
*/
goog.provide('goog.ui.DimensionPicker');
goog.require('goog.events.EventType');
goog.require('goog.events.KeyCodes');
goog.require('goog.math.Size');
goog.require('goog.ui.Component');
goog.require('goog.ui.Control');
goog.require('goog.ui.DimensionPickerRenderer');
goog.require('goog.ui.registry');
/**
* A dimension picker allows the user to visually select a row and column
* count using their mouse and keyboard.
*
* The currently selected dimension is controlled by an ACTION event. Event
* listeners may retrieve the selected item using the
* {@link #getValue} method.
*
* @param {goog.ui.DimensionPickerRenderer=} opt_renderer Renderer used to
* render or decorate the palette; defaults to
* {@link goog.ui.DimensionPickerRenderer}.
* @param {goog.dom.DomHelper=} opt_domHelper Optional DOM helper, used for
* document interaction.
* @constructor
* @extends {goog.ui.Control}
*/
goog.ui.DimensionPicker = function(opt_renderer, opt_domHelper) {
goog.ui.Control.call(this, null,
opt_renderer || goog.ui.DimensionPickerRenderer.getInstance(),
opt_domHelper);
this.size_ = new goog.math.Size(this.minColumns, this.minRows);
};
goog.inherits(goog.ui.DimensionPicker, goog.ui.Control);
/**
* Minimum number of columns to show in the grid.
* @type {number}
*/
goog.ui.DimensionPicker.prototype.minColumns = 5;
/**
* Minimum number of rows to show in the grid.
* @type {number}
*/
goog.ui.DimensionPicker.prototype.minRows = 5;
/**
* Maximum number of columns to show in the grid.
* @type {number}
*/
goog.ui.DimensionPicker.prototype.maxColumns = 20;
/**
* Maximum number of rows to show in the grid.
* @type {number}
*/
goog.ui.DimensionPicker.prototype.maxRows = 20;
/**
* Palette dimensions (columns x rows).
* @type {goog.math.Size}
* @private
*/
goog.ui.DimensionPicker.prototype.size_;
/**
* Currently highlighted row count.
* @type {number}
* @private
*/
goog.ui.DimensionPicker.prototype.highlightedRows_ = 1;
/**
* Currently highlighted column count.
* @type {number}
* @private
*/
goog.ui.DimensionPicker.prototype.highlightedColumns_ = 1;
/** @override */
goog.ui.DimensionPicker.prototype.enterDocument = function() {
goog.ui.DimensionPicker.superClass_.enterDocument.call(this);
var handler = this.getHandler();
handler.
listen(this.getRenderer().getMouseMoveElement(this),
goog.events.EventType.MOUSEMOVE, this.handleMouseMove).
listen(this.getDomHelper().getWindow(), goog.events.EventType.RESIZE,
this.handleWindowResize);
var parent = this.getParent();
if (parent) {
handler.listen(parent, goog.ui.Component.EventType.SHOW, this.handleShow_);
}
};
/** @override */
goog.ui.DimensionPicker.prototype.exitDocument = function() {
goog.ui.DimensionPicker.superClass_.exitDocument.call(this);
var handler = this.getHandler();
handler.
unlisten(this.getRenderer().getMouseMoveElement(this),
goog.events.EventType.MOUSEMOVE, this.handleMouseMove).
unlisten(this.getDomHelper().getWindow(), goog.events.EventType.RESIZE,
this.handleWindowResize);
var parent = this.getParent();
if (parent) {
handler.unlisten(parent, goog.ui.Component.EventType.SHOW,
this.handleShow_);
}
};
/**
* Resets the highlighted size when the picker is shown.
* @private
*/
goog.ui.DimensionPicker.prototype.handleShow_ = function() {
if (this.isVisible()) {
this.setValue(1, 1);
}
};
/** @override */
goog.ui.DimensionPicker.prototype.disposeInternal = function() {
goog.ui.DimensionPicker.superClass_.disposeInternal.call(this);
delete this.size_;
};
// Palette event handling.
/**
* Handles mousemove events. Determines which palette size was moused over and
* highlights it.
* @param {goog.events.BrowserEvent} e Mouse event to handle.
* @protected
*/
goog.ui.DimensionPicker.prototype.handleMouseMove = function(e) {
var highlightedSizeX = this.getRenderer().getGridOffsetX(this,
this.isRightToLeft() ? e.target.offsetWidth - e.offsetX : e.offsetX);
var highlightedSizeY = this.getRenderer().getGridOffsetY(this, e.offsetY);
this.setValue(highlightedSizeX, highlightedSizeY);
};
/**
* Handles window resize events. Ensures no scrollbars are introduced by the
* renderer's mouse catcher.
* @param {goog.events.Event} e Resize event to handle.
* @protected
*/
goog.ui.DimensionPicker.prototype.handleWindowResize = function(e) {
this.getRenderer().positionMouseCatcher(this);
};
/**
* Handle key events if supported, so the user can use the keyboard to
* manipulate the highlighted rows and columns.
* @param {goog.events.KeyEvent} e The key event object.
* @return {boolean} Whether the key event was handled.
* @override
*/
goog.ui.DimensionPicker.prototype.handleKeyEvent = function(e) {
var rows = this.highlightedRows_;
var columns = this.highlightedColumns_;
switch (e.keyCode) {
case goog.events.KeyCodes.DOWN:
rows++;
break;
case goog.events.KeyCodes.UP:
rows--;
break;
case goog.events.KeyCodes.LEFT:
if (columns == 1) {
// Delegate to parent.
return false;
} else {
columns--;
}
break;
case goog.events.KeyCodes.RIGHT:
columns++;
break;
default:
return goog.ui.DimensionPicker.superClass_.handleKeyEvent.call(this, e);
}
this.setValue(columns, rows);
return true;
};
// Palette management.
/**
* @return {goog.math.Size} Current table size shown (columns x rows).
*/
goog.ui.DimensionPicker.prototype.getSize = function() {
return this.size_;
};
/**
* @return {!goog.math.Size} size The currently highlighted dimensions.
*/
goog.ui.DimensionPicker.prototype.getValue = function() {
return new goog.math.Size(this.highlightedColumns_, this.highlightedRows_);
};
/**
* Sets the currently highlighted dimensions. If the dimensions are not valid
* (not between 1 and the maximum number of columns/rows to show), they will
* be changed to the closest valid value.
* @param {(number|!goog.math.Size)} columns The number of columns to highlight,
* or a goog.math.Size object containing both.
* @param {number=} opt_rows The number of rows to highlight. Can be
* omitted when columns is a good.math.Size object.
*/
goog.ui.DimensionPicker.prototype.setValue = function(columns,
opt_rows) {
if (!goog.isDef(opt_rows)) {
columns = /** @type {!goog.math.Size} */ (columns);
opt_rows = columns.height;
columns = columns.width;
} else {
columns = /** @type {number} */ (columns);
}
// Ensure that the row and column values are within the minimum value (1) and
// maxmimum values.
columns = Math.max(1, columns);
opt_rows = Math.max(1, opt_rows);
columns = Math.min(this.maxColumns, columns);
opt_rows = Math.min(this.maxRows, opt_rows);
if (this.highlightedColumns_ != columns ||
this.highlightedRows_ != opt_rows) {
var renderer = this.getRenderer();
// Show one more row/column than highlighted so the user understands the
// palette can grow.
this.size_.width = Math.max(
Math.min(columns + 1, this.maxColumns), this.minColumns);
this.size_.height = Math.max(
Math.min(opt_rows + 1, this.maxRows), this.minRows);
renderer.updateSize(this, this.getElement());
this.highlightedColumns_ = columns;
this.highlightedRows_ = opt_rows;
renderer.setHighlightedSize(this, columns, opt_rows);
}
};
/**
* Register this control so it can be created from markup
*/
goog.ui.registry.setDecoratorByClassName(
goog.ui.DimensionPickerRenderer.CSS_CLASS,
function() {
return new goog.ui.DimensionPicker();
});
|
import {Controller} from "jsnes";
// Mapping keyboard code to [controller, button]
const KEYS = {
1: {
"A": [Controller.BUTTON_A, "A"],
"B": [Controller.BUTTON_B, "B"],
"X": [Controller.BUTTON_A, "A"],
"Y": [Controller.BUTTON_B, "B"],
"SELECT": [Controller.BUTTON_SELECT, "SELECT"], // Right Ctrl
"START": [Controller.BUTTON_START, "START"], // Enter
"U": [Controller.BUTTON_UP, "Up"], // Up
"D": [Controller.BUTTON_DOWN, "Down"], // Down
"L": [Controller.BUTTON_LEFT, "Left"], // Left
"R": [Controller.BUTTON_RIGHT, "Right"], // Right
},
2: {
"A": [Controller.BUTTON_A, "A"],
"B": [Controller.BUTTON_B, "B"],
"X": [Controller.BUTTON_B, "B"],
"Y": [Controller.BUTTON_B, "B"],
"SELECT": [Controller.BUTTON_SELECT, "SELECT"], // Right Ctrl
"START": [Controller.BUTTON_START, "START"], // Enter
"U": [Controller.BUTTON_UP, "Up"], // Up
"D": [Controller.BUTTON_DOWN, "Down"], // Down
"L": [Controller.BUTTON_LEFT, "Left"], // Left
"R": [Controller.BUTTON_RIGHT, "Right"], // Right
}
};
export default class JoyStickController {
constructor(options) {
this.onButtonDown = options.onButtonDown;
this.onButtonUp = options.onButtonUp;
}
loadKeys = () => {
this.keys = KEYS;
};
setKeys = newKeys => {
console.log("JoyStick could't set Keys");
};
handleJoyStickDown = (playerId, eventKey) => {
var keys = this.keys[playerId];
if (keys) {
this.onButtonDown(playerId, keys[eventKey][0]);
}
};
handleJoyStickUp = (playerId, eventKey) => {
var keys = this.keys[playerId];
if (keys) {
if (eventKey === "ALL") {
console.log("run All Up");
for (let thisKey in keys) {
if (!(thisKey === "X" || thisKey === "Y" ||
thisKey === "A" || thisKey === "B")){
// 右侧按键不触发 onButtonUp
this.onButtonUp(playerId, keys[thisKey][0]);
}
}
} else {
this.onButtonUp(playerId, keys[eventKey][0]);
}
}
};
}
|
'use strict';
var spec = {
name: 'P2P',
message: 'Internal Error on zclassic-bitcore-p2p Module {0}'
};
module.exports = require('zclassic-bitcore-lib').errors.extend(spec);
|
import React from 'react';
import moment from 'moment';
import { Link } from 'react-scroll';
import github from '../images/GitHub.png';
import email from '../images/Email.svg';
import linkedin from '../images/Linkedin.svg';
const Footer = (props) => {
return (
<div className="footer blue">
<h5 className="header">Brendan Walker {moment().year()}</h5>
<div className="info container">
<p className="link">
<img src={linkedin} />
<a href="https://www.linkedin.com/in/brendan-walker-0a728713b/" target="_blank">LinkedIn</a>
</p>
<p>
<img src={email} />
<a href={"mailto:brenny.walker@gmail.com"}>Email</a>
</p>
<p>
<img className="github" src={github} />
<a href="https://github.com/brendonion" target="_blank" rel="noopener noreferrer">Github</a>
</p>
</div>
<Link className="up-btn" activeClass="active" to="about" spy smooth offset={-60} duration={500} />
</div>
)
}
export default Footer
|
(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-ae0e9a4a"],{"0481":function(t,e,n){"use strict";var i=n("23e7"),a=n("a2bf"),s=n("7b0b"),r=n("50c4"),o=n("a691"),c=n("65f0");i({target:"Array",proto:!0},{flat:function(){var t=arguments.length?arguments[0]:void 0,e=s(this),n=r(e.length),i=c(e,0);return i.length=a(i,e,e,n,0,void 0===t?1:o(t)),i}})},"24b2":function(t,e,n){"use strict";n("a9e3");var i=n("80d2"),a=n("2b0e");e["a"]=a["a"].extend({name:"measurable",props:{height:[Number,String],maxHeight:[Number,String],maxWidth:[Number,String],minHeight:[Number,String],minWidth:[Number,String],width:[Number,String]},computed:{measurableStyles:function(){var t={},e=Object(i["g"])(this.height),n=Object(i["g"])(this.minHeight),a=Object(i["g"])(this.minWidth),s=Object(i["g"])(this.maxHeight),r=Object(i["g"])(this.maxWidth),o=Object(i["g"])(this.width);return e&&(t.height=e),n&&(t.minHeight=n),a&&(t.minWidth=a),s&&(t.maxHeight=s),r&&(t.maxWidth=r),o&&(t.width=o),t}}})},"25a8":function(t,e,n){},2909:function(t,e,n){"use strict";n.d(e,"a",(function(){return c}));var i=n("6b75");function a(t){if(Array.isArray(t))return Object(i["a"])(t)}n("a4d3"),n("e01a"),n("d28b"),n("a630"),n("d3b7"),n("3ca3"),n("ddb0");function s(t){if("undefined"!==typeof Symbol&&Symbol.iterator in Object(t))return Array.from(t)}var r=n("06c5");function o(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function c(t){return a(t)||s(t)||Object(r["a"])(t)||o()}},"2a7f":function(t,e,n){"use strict";n.d(e,"a",(function(){return r})),n.d(e,"b",(function(){return s}));var i=n("71d9"),a=n("80d2"),s=Object(a["h"])("v-toolbar__title"),r=Object(a["h"])("v-toolbar__items");i["a"]},"36a7":function(t,e,n){},4069:function(t,e,n){var i=n("44d2");i("flat")},"5e23":function(t,e,n){},"71d9":function(t,e,n){"use strict";n("0481"),n("4160"),n("4069"),n("a9e3");var i=n("3835"),a=n("5530"),s=(n("5e23"),n("8dd9")),r=n("adda"),o=n("80d2"),c=n("d9bd");e["a"]=s["a"].extend({name:"v-toolbar",props:{absolute:Boolean,bottom:Boolean,collapse:Boolean,dense:Boolean,extended:Boolean,extensionHeight:{default:48,type:[Number,String]},flat:Boolean,floating:Boolean,prominent:Boolean,short:Boolean,src:{type:[String,Object],default:""},tag:{type:String,default:"header"}},data:function(){return{isExtended:!1}},computed:{computedHeight:function(){var t=this.computedContentHeight;if(!this.isExtended)return t;var e=parseInt(this.extensionHeight);return this.isCollapsed?t:t+(isNaN(e)?0:e)},computedContentHeight:function(){return this.height?parseInt(this.height):this.isProminent&&this.dense?96:this.isProminent&&this.short?112:this.isProminent?128:this.dense?48:this.short||this.$vuetify.breakpoint.smAndDown?56:64},classes:function(){return Object(a["a"])(Object(a["a"])({},s["a"].options.computed.classes.call(this)),{},{"v-toolbar":!0,"v-toolbar--absolute":this.absolute,"v-toolbar--bottom":this.bottom,"v-toolbar--collapse":this.collapse,"v-toolbar--collapsed":this.isCollapsed,"v-toolbar--dense":this.dense,"v-toolbar--extended":this.isExtended,"v-toolbar--flat":this.flat,"v-toolbar--floating":this.floating,"v-toolbar--prominent":this.isProminent})},isCollapsed:function(){return this.collapse},isProminent:function(){return this.prominent},styles:function(){return Object(a["a"])(Object(a["a"])({},this.measurableStyles),{},{height:Object(o["g"])(this.computedHeight)})}},created:function(){var t=this,e=[["app","<v-app-bar app>"],["manual-scroll",'<v-app-bar :value="false">'],["clipped-left","<v-app-bar clipped-left>"],["clipped-right","<v-app-bar clipped-right>"],["inverted-scroll","<v-app-bar inverted-scroll>"],["scroll-off-screen","<v-app-bar scroll-off-screen>"],["scroll-target","<v-app-bar scroll-target>"],["scroll-threshold","<v-app-bar scroll-threshold>"],["card","<v-app-bar flat>"]];e.forEach((function(e){var n=Object(i["a"])(e,2),a=n[0],s=n[1];t.$attrs.hasOwnProperty(a)&&Object(c["a"])(a,s,t)}))},methods:{genBackground:function(){var t={height:Object(o["g"])(this.computedHeight),src:this.src},e=this.$scopedSlots.img?this.$scopedSlots.img({props:t}):this.$createElement(r["a"],{props:t});return this.$createElement("div",{staticClass:"v-toolbar__image"},[e])},genContent:function(){return this.$createElement("div",{staticClass:"v-toolbar__content",style:{height:Object(o["g"])(this.computedContentHeight)}},Object(o["r"])(this))},genExtension:function(){return this.$createElement("div",{staticClass:"v-toolbar__extension",style:{height:Object(o["g"])(this.extensionHeight)}},Object(o["r"])(this,"extension"))}},render:function(t){this.isExtended=this.extended||!!this.$scopedSlots.extension;var e=[this.genContent()],n=this.setBackgroundColor(this.color,{class:this.classes,style:this.styles,on:this.$listeners});return this.isExtended&&e.push(this.genExtension()),(this.src||this.$scopedSlots.img)&&e.unshift(this.genBackground()),t(this.tag,n,e)}})},"7e2b":function(t,e,n){"use strict";var i=n("2b0e");function a(t){return function(e,n){for(var i in n)Object.prototype.hasOwnProperty.call(e,i)||this.$delete(this.$data[t],i);for(var a in e)this.$set(this.$data[t],a,e[a])}}e["a"]=i["a"].extend({data:function(){return{attrs$:{},listeners$:{}}},created:function(){this.$watch("$attrs",a("attrs$"),{immediate:!0}),this.$watch("$listeners",a("listeners$"),{immediate:!0})}})},"8dd9":function(t,e,n){"use strict";var i=n("5530"),a=(n("25a8"),n("7e2b")),s=n("a9ad"),r=(n("a9e3"),n("ade3")),o=n("2b0e"),c=o["a"].extend({name:"elevatable",props:{elevation:[Number,String]},computed:{computedElevation:function(){return this.elevation},elevationClasses:function(){var t=this.computedElevation;return null==t||isNaN(parseInt(t))?{}:Object(r["a"])({},"elevation-".concat(this.elevation),!0)}}}),l=n("24b2"),d=n("a236"),h=n("7560"),u=n("58df");e["a"]=Object(u["a"])(a["a"],s["a"],c,l["a"],d["a"],h["a"]).extend({name:"v-sheet",props:{outlined:Boolean,shaped:Boolean,tag:{type:String,default:"div"}},computed:{classes:function(){return Object(i["a"])(Object(i["a"])(Object(i["a"])({"v-sheet":!0,"v-sheet--outlined":this.outlined,"v-sheet--shaped":this.shaped},this.themeClasses),this.elevationClasses),this.roundedClasses)},styles:function(){return this.measurableStyles}},render:function(t){var e={class:this.classes,style:this.styles,on:this.listeners$};return t(this.tag,this.setBackgroundColor(this.color,e),this.$slots.default)}})},"8efc":function(t,e,n){},"90a2":function(t,e,n){"use strict";n("7db0");var i=n("53ca");function a(t,e){var n=e.modifiers||{},a=e.value,r="object"===Object(i["a"])(a)?a:{handler:a,options:{}},o=r.handler,c=r.options,l=new IntersectionObserver((function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],i=arguments.length>1?arguments[1]:void 0;if(t._observe){if(o&&(!n.quiet||t._observe.init)){var a=Boolean(e.find((function(t){return t.isIntersecting})));o(e,i,a)}t._observe.init&&n.once?s(t):t._observe.init=!0}}),c);t._observe={init:!1,observer:l},l.observe(t)}function s(t){t._observe&&(t._observe.observer.unobserve(t),delete t._observe)}var r={inserted:a,unbind:s};e["a"]=r},a236:function(t,e,n){"use strict";n("a15b"),n("ac1f"),n("1276");var i=n("ade3"),a=n("b85c"),s=n("2b0e");e["a"]=s["a"].extend({name:"roundable",props:{rounded:[Boolean,String],tile:Boolean},computed:{roundedClasses:function(){var t=[],e="string"===typeof this.rounded?String(this.rounded):!0===this.rounded;if(this.tile)t.push("rounded-0");else if("string"===typeof e){var n,s=e.split(" "),r=Object(a["a"])(s);try{for(r.s();!(n=r.n()).done;){var o=n.value;t.push("rounded-".concat(o))}}catch(c){r.e(c)}finally{r.f()}}else e&&t.push("rounded");return t.length>0?Object(i["a"])({},t.join(" "),!0):{}}}})},a2bf:function(t,e,n){"use strict";var i=n("e8b5"),a=n("50c4"),s=n("0366"),r=function(t,e,n,o,c,l,d,h){var u,b=c,f=0,p=!!d&&s(d,h,3);while(f<o){if(f in n){if(u=p?p(n[f],f,e):n[f],l>0&&i(u))b=r(t,e,u,a(u.length),b,l-1)-1;else{if(b>=9007199254740991)throw TypeError("Exceed the acceptable array length");t[b]=u}b++}f++}return b};t.exports=r},a774:function(t,e,n){"use strict";var i=n("aab8"),a=n.n(i);a.a},a9ad:function(t,e,n){"use strict";n("d3b7"),n("ac1f"),n("25f0"),n("1276"),n("498a");var i=n("3835"),a=n("ade3"),s=n("5530"),r=n("2b0e"),o=n("d9bd"),c=n("7bc6");e["a"]=r["a"].extend({name:"colorable",props:{color:String},methods:{setBackgroundColor:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return"string"===typeof e.style?(Object(o["b"])("style must be an object",this),e):"string"===typeof e.class?(Object(o["b"])("class must be an object",this),e):(Object(c["d"])(t)?e.style=Object(s["a"])(Object(s["a"])({},e.style),{},{"background-color":"".concat(t),"border-color":"".concat(t)}):t&&(e.class=Object(s["a"])(Object(s["a"])({},e.class),{},Object(a["a"])({},t,!0))),e)},setTextColor:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if("string"===typeof e.style)return Object(o["b"])("style must be an object",this),e;if("string"===typeof e.class)return Object(o["b"])("class must be an object",this),e;if(Object(c["d"])(t))e.style=Object(s["a"])(Object(s["a"])({},e.style),{},{color:"".concat(t),"caret-color":"".concat(t)});else if(t){var n=t.toString().trim().split(" ",2),r=Object(i["a"])(n,2),l=r[0],d=r[1];e.class=Object(s["a"])(Object(s["a"])({},e.class),{},Object(a["a"])({},l+"--text",!0)),d&&(e.class["text--"+d]=!0)}return e}}})},aab8:function(t,e,n){},adda:function(t,e,n){"use strict";n("a15b"),n("a9e3"),n("8efc");var i=n("90a2"),a=(n("36a7"),n("24b2")),s=n("58df"),r=Object(s["a"])(a["a"]).extend({name:"v-responsive",props:{aspectRatio:[String,Number]},computed:{computedAspectRatio:function(){return Number(this.aspectRatio)},aspectStyle:function(){return this.computedAspectRatio?{paddingBottom:1/this.computedAspectRatio*100+"%"}:void 0},__cachedSizer:function(){return this.aspectStyle?this.$createElement("div",{style:this.aspectStyle,staticClass:"v-responsive__sizer"}):[]}},methods:{genContent:function(){return this.$createElement("div",{staticClass:"v-responsive__content"},this.$slots.default)}},render:function(t){return t("div",{staticClass:"v-responsive",style:this.measurableStyles,on:this.$listeners},[this.__cachedSizer,this.genContent()])}}),o=r,c=n("7560"),l=n("d9f7"),d=n("d9bd"),h="undefined"!==typeof window&&"IntersectionObserver"in window;e["a"]=Object(s["a"])(o,c["a"]).extend({name:"v-img",directives:{intersect:i["a"]},props:{alt:String,contain:Boolean,eager:Boolean,gradient:String,lazySrc:String,options:{type:Object,default:function(){return{root:void 0,rootMargin:void 0,threshold:void 0}}},position:{type:String,default:"center center"},sizes:String,src:{type:[String,Object],default:""},srcset:String,transition:{type:[Boolean,String],default:"fade-transition"}},data:function(){return{currentSrc:"",image:null,isLoading:!0,calculatedAspectRatio:void 0,naturalWidth:void 0}},computed:{computedAspectRatio:function(){return Number(this.normalisedSrc.aspect||this.calculatedAspectRatio)},normalisedSrc:function(){return"string"===typeof this.src?{src:this.src,srcset:this.srcset,lazySrc:this.lazySrc,aspect:Number(this.aspectRatio||0)}:{src:this.src.src,srcset:this.srcset||this.src.srcset,lazySrc:this.lazySrc||this.src.lazySrc,aspect:Number(this.aspectRatio||this.src.aspect)}},__cachedImage:function(){if(!this.normalisedSrc.src&&!this.normalisedSrc.lazySrc)return[];var t=[],e=this.isLoading?this.normalisedSrc.lazySrc:this.currentSrc;this.gradient&&t.push("linear-gradient(".concat(this.gradient,")")),e&&t.push('url("'.concat(e,'")'));var n=this.$createElement("div",{staticClass:"v-image__image",class:{"v-image__image--preload":this.isLoading,"v-image__image--contain":this.contain,"v-image__image--cover":!this.contain},style:{backgroundImage:t.join(", "),backgroundPosition:this.position},key:+this.isLoading});return this.transition?this.$createElement("transition",{attrs:{name:this.transition,mode:"in-out"}},[n]):n}},watch:{src:function(){this.isLoading?this.loadImage():this.init(void 0,void 0,!0)},"$vuetify.breakpoint.width":"getSrc"},mounted:function(){this.init()},methods:{init:function(t,e,n){if(!h||n||this.eager){if(this.normalisedSrc.lazySrc){var i=new Image;i.src=this.normalisedSrc.lazySrc,this.pollForSize(i,null)}this.normalisedSrc.src&&this.loadImage()}},onLoad:function(){this.getSrc(),this.isLoading=!1,this.$emit("load",this.src)},onError:function(){this.$emit("error",this.src)},getSrc:function(){this.image&&(this.currentSrc=this.image.currentSrc||this.image.src)},loadImage:function(){var t=this,e=new Image;this.image=e,e.onload=function(){e.decode?e.decode().catch((function(e){Object(d["c"])("Failed to decode image, trying to render anyway\n\n"+"src: ".concat(t.normalisedSrc.src)+(e.message?"\nOriginal error: ".concat(e.message):""),t)})).then(t.onLoad):t.onLoad()},e.onerror=this.onError,e.src=this.normalisedSrc.src,this.sizes&&(e.sizes=this.sizes),this.normalisedSrc.srcset&&(e.srcset=this.normalisedSrc.srcset),this.aspectRatio||this.pollForSize(e),this.getSrc()},pollForSize:function(t){var e=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:100,i=function i(){var a=t.naturalHeight,s=t.naturalWidth;a||s?(e.naturalWidth=s,e.calculatedAspectRatio=s/a):null!=n&&setTimeout(i,n)};i()},genContent:function(){var t=o.options.methods.genContent.call(this);return this.naturalWidth&&this._b(t.data,"div",{style:{width:"".concat(this.naturalWidth,"px")}}),t},__genPlaceholder:function(){if(this.$slots.placeholder){var t=this.isLoading?[this.$createElement("div",{staticClass:"v-image__placeholder"},this.$slots.placeholder)]:[];return this.transition?this.$createElement("transition",{props:{appear:!0,name:this.transition}},t):t[0]}}},render:function(t){var e=o.options.render.call(this,t),n=Object(l["a"])(e.data,{staticClass:"v-image",attrs:{"aria-label":this.alt,role:this.alt?"img":void 0},class:this.themeClasses,directives:h?[{name:"intersect",modifiers:{once:!0},value:{handler:this.init,options:this.options}}]:void 0});return e.children=[this.__cachedSizer,this.__cachedImage,this.__genPlaceholder(),this.genContent()],t(e.tag,n,e.children)}})},b85c:function(t,e,n){"use strict";n.d(e,"a",(function(){return a}));n("a4d3"),n("e01a"),n("d28b"),n("d3b7"),n("3ca3"),n("ddb0");var i=n("06c5");function a(t,e){var n;if("undefined"===typeof Symbol||null==t[Symbol.iterator]){if(Array.isArray(t)||(n=Object(i["a"])(t))||e&&t&&"number"===typeof t.length){n&&(t=n);var a=0,s=function(){};return{s:s,n:function(){return a>=t.length?{done:!0}:{done:!1,value:t[a++]}},e:function(t){throw t},f:s}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var r,o=!0,c=!1;return{s:function(){n=t[Symbol.iterator]()},n:function(){var t=n.next();return o=t.done,t},e:function(t){c=!0,r=t},f:function(){try{o||null==n["return"]||n["return"]()}finally{if(c)throw r}}}}},cead:function(t,e,n){"use strict";n.r(e);var i=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("v-toolbar-title",{staticClass:"pr-2 header--text subtitle-1"},[t._v(" "+t._s(t.params.title)+" ")])},a=[],s=n("dce2"),r={name:"ActionButton",mixins:[s["a"]],props:["params"]},o=r,c=(n("a774"),n("2877")),l=n("6544"),d=n.n(l),h=n("2a7f"),u=Object(c["a"])(o,i,a,!1,null,null,null);e["default"]=u.exports;d()(u,{VToolbarTitle:h["b"]})},d9f7:function(t,e,n){"use strict";n.d(e,"a",(function(){return d})),n.d(e,"b",(function(){return u})),n.d(e,"c",(function(){return b}));n("99af"),n("b64b"),n("ac1f"),n("1276"),n("498a");var i=n("2909"),a=n("5530"),s=n("3835"),r=n("b85c"),o=n("80d2"),c={styleList:/;(?![^(]*\))/g,styleProp:/:(.*)/};function l(t){var e,n={},i=Object(r["a"])(t.split(c.styleList));try{for(i.s();!(e=i.n()).done;){var a=e.value,l=a.split(c.styleProp),d=Object(s["a"])(l,2),h=d[0],u=d[1];h=h.trim(),h&&("string"===typeof u&&(u=u.trim()),n[Object(o["c"])(h)]=u)}}catch(b){i.e(b)}finally{i.f()}return n}function d(){var t,e={},n=arguments.length;while(n--)for(var i=0,s=Object.keys(arguments[n]);i<s.length;i++)switch(t=s[i],t){case"class":case"directives":arguments[n][t]&&(e[t]=u(e[t],arguments[n][t]));break;case"style":arguments[n][t]&&(e[t]=h(e[t],arguments[n][t]));break;case"staticClass":if(!arguments[n][t])break;void 0===e[t]&&(e[t]=""),e[t]&&(e[t]+=" "),e[t]+=arguments[n][t].trim();break;case"on":case"nativeOn":arguments[n][t]&&(e[t]=b(e[t],arguments[n][t]));break;case"attrs":case"props":case"domProps":case"scopedSlots":case"staticStyle":case"hook":case"transition":if(!arguments[n][t])break;e[t]||(e[t]={}),e[t]=Object(a["a"])(Object(a["a"])({},arguments[n][t]),e[t]);break;default:e[t]||(e[t]=arguments[n][t])}return e}function h(t,e){return t?e?(t=Object(o["E"])("string"===typeof t?l(t):t),t.concat("string"===typeof e?l(e):e)):t:e}function u(t,e){return e?t&&t?Object(o["E"])(t).concat(e):e:t}function b(t,e){if(!t)return e;if(!e)return t;for(var n,a=0,s=Object.keys(e);a<s.length;a++){var r;if(n=s[a],t[n])t[n]=Object(o["E"])(t[n]),(r=t[n]).push.apply(r,Object(i["a"])(Object(o["E"])(e[n])));else t[n]=e[n]}return t}},dce2:function(t,e,n){"use strict";n("99af"),n("b0c0"),n("96cf");var i=n("1da1");e["a"]={methods:{onAction:function(t,e){console.log("".concat(this.$options.name," on action ").concat(t.name));var n="action".concat(t.name);Object.prototype.hasOwnProperty.call(this,n)?this[n](t.data,e):this.emitAction(t.name,t.data)},emitAction:function(t,e){this.$emit("action",{name:t,data:e})},dispatchAction:function(t){var e=this;return Object(i["a"])(regeneratorRuntime.mark((function n(){var i,a;return regeneratorRuntime.wrap((function(n){while(1)switch(n.prev=n.next){case 0:return i=t.data||{},a=i.namespace||e.store.namespace,console.log("".concat(e.$options.name," dispatch action ").concat(a,"/").concat(t.name)),n.next=5,e.$store.dispatch("".concat(a,"/").concat(t.name),{store:e.store,params:e.params,data:t.data},{root:!0});case 5:case"end":return n.stop()}}),n)})))()}}}}}]);
//# sourceMappingURL=chunk-ae0e9a4a.433282c5.js.map
|
import React from 'react';
import { Link, useStaticQuery, graphql } from 'gatsby';
import styled from '@emotion/styled';
import { css } from '@emotion/react';
import Navegacion from './Navegacion';
const ListadoRedes = styled.ul`
background-repeat: no-repeat;
padding: 3rem 0 0 0;
`;
const Footer = () => {
const { mediaIcons } = useStaticQuery(graphql`
query {
mediaIcons: allFile(filter: { relativeDirectory: {eq: "redes" } } ) {
edges {
node {
id
publicURL
}
}
}
}
`);
const redesIconos = mediaIcons.edges;
return (
<footer
css={css`
background-color: #0D283B;
padding: 5rem;
`}
>
<div
css={css`
max-width: 120rem;
margin: 0 auto;
text-align: center;
@media(min-width: 768px) {
display: flex;
align-itemns: center;
justify-content: space-between;
}
`}
>
<Link to={'/'}>Inicio</Link>
<Link to={'/contacto'}>Contacto</Link>
<Link to={'/propiedades'}>Propiedades</Link>
<Navegacion />
<ListadoRedes>
<li>
<img src={redesIconos[0].node.publicURL} alt="icono whats" />
</li>
<li>
<img src={redesIconos[1].node.publicURL} alt="icono facebook"/>
</li>
<li>
<img src={redesIconos[2].node.publicURL} alt="icono instagram" />
</li>
<li>
<img src={redesIconos[3].node.publicURL} alt="icono linkedin" />
</li>
</ListadoRedes>
</div>
</footer>
);
}
export default Footer;
|
/**
* Copyright IBM Corp. 2019, 2020
*
* This source code is licensed under the Apache-2.0 license found in the
* LICENSE file in the root directory of this source tree.
*
* Code generated by @carbon/icon-build-helpers. DO NOT EDIT.
*/
'use strict';
var Icon = require('../../Icon-1083255b.js');
var React = require('react');
require('@carbon/icon-helpers');
require('prop-types');
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
var _path;
var QT20 = /*#__PURE__*/React__default['default'].forwardRef(function QT20(_ref, ref) {
var children = _ref.children,
rest = Icon._objectWithoutProperties(_ref, ["children"]);
return /*#__PURE__*/React__default['default'].createElement(Icon.Icon, Icon._extends({
width: 20,
height: 20,
viewBox: "0 0 32 32",
xmlns: "http://www.w3.org/2000/svg",
fill: "currentColor",
ref: ref
}, rest), _path || (_path = /*#__PURE__*/React__default['default'].createElement("path", {
d: "M12 11L15 11 15 23 17 23 17 11 20 11 20 9 12 9 12 11z"
})), children);
});
module.exports = QT20;
|
define(["exports","./lib/mixins/element-mixin.js","./lib/utils/html-tag.js"],function(_exports,_elementMixin,_htmlTag){Object.defineProperty(_exports,"__esModule",{value:!0}),Object.defineProperty(_exports,"version",{enumerable:!0,get:function(){return _elementMixin.version}}),Object.defineProperty(_exports,"html",{enumerable:!0,get:function(){return _htmlTag.html}}),_exports.PolymerElement=void 0;const PolymerElement=(0,_elementMixin.ElementMixin)(HTMLElement);_exports.PolymerElement=PolymerElement});
|
angular.module('ejemplo3',[])
.controller('Controller',['$scope',function ($scope) {
$scope.customer={
name:'Ricardo',
address:'Sopocachi'
};
}])
.directive('myCustomer',function () {
return {
template:function (elem,attr){
if(attr.type=='name'){
return 'nombre {{customer.name}}'
}
if(attr.type=='address'){
return 'direccion {{customer.address}}'
}
}
};
});
|
define([
'underscore',
'./base/bookmark-component',
'../views/bookmark-button-view',
'oroui/js/app/views/base/collection-view',
'../views/bookmark-item-view'
], function(_, BaseBookmarkComponent, ButtonView, CollectionView, ItemView) {
'use strict';
var FavoriteComponent;
FavoriteComponent = BaseBookmarkComponent.extend({
typeName: 'favorite',
/**
* @inheritDoc
*/
constructor: function FavoriteComponent() {
FavoriteComponent.__super__.constructor.apply(this, arguments);
},
/**
* @inheritDoc
*/
_createSubViews: function() {
this._createButtonView();
this._createTabView();
},
/**
* Create view for pin button
*
* @protected
*/
_createButtonView: function() {
var options = this._options.buttonOptions || {};
var collection = this.collection;
_.extend(options, {
autoRender: true,
collection: collection
});
this.button = new ButtonView(options);
},
/**
* Create view for favorite tabs in dot-menu
*
* @protected
*/
_createTabView: function() {
var options = this._options.tabOptions || {};
var collection = this.collection;
var TabItemView = ItemView.extend({// eslint-disable-line oro/named-constructor
template: this._options.tabItemTemplate
});
_.extend(options, {
autoRender: true,
collection: collection,
itemView: TabItemView
});
this.tabs = new CollectionView(options);
},
actualizeAttributes: function(model) {
model.set('type', this.typeName);
model.set('position', this.collection.length);
var url = model.get('url');
var urlPart = url.split('?');
if (model.get('url') !== urlPart[0]) {
model.set('url', urlPart[0]);
}
}
});
return FavoriteComponent;
});
|
/// <reference types="cypress" />
import loc from '../../support/locators'
import '../../support/commandsContas'
import buildEnv from '../../support/buildEnv'
describe('Testes frontend',()=>{
after(()=>{
cy.clearLocalStorage()
})
beforeEach(()=>{
buildEnv()
cy.login('luiz@moura.com', '12345678')
cy.get(loc.MENU.HOME).click()
})
it('X - Teste responsividade', ()=>{
cy.get('[data-test=menu-home]').should('exist').and('be.visible')
cy.viewport(500,700)
cy.get('[data-test=menu-home]').should('exist').and('be.not.visible')
cy.viewport('iphone-5')
cy.get('[data-test=menu-home]').should('exist').and('be.not.visible')
cy.viewport('ipad-2')
cy.get('[data-test=menu-home]').should('exist').and('be.visible')
})
it(`1 -Inserir conta`, ()=>{
cy.intercept('POST', '/contas', {
id: 3,
nome: 'Conta de teste',
visivel :true,
usuario_id: 26343
}).as('saveConta')
cy.acessarMenuConta()
cy.intercept('GET', '/contas',[{
id: 1,
nome:'Carteira',
visivel: true,
usuario_id: 1
},{
id: 2,
nome:'Banco',
visivel: true,
usuario_id: 1
},{
id: 3,
nome:'Conta de teste',
visivel: true,
usuario_id: 1
}]
).as('contasSave')
cy.inserirConta("Conta de teste")
cy.get(loc.MENSAGEM).should('contain', 'Conta inserida com sucesso!')
cy.wait(1000)
cy.xpath(`//td[contains(.,'Conta de teste')]`).should('exist')
})
it('2 - Alterar conta...', ()=>{
cy.intercept('PUT', '/contas/**',{
id: 1,
nome:'Conta Alterada',
visivel: true,
usuario_id: 1
}).as('insertConta')
cy.acessarMenuConta()
cy.xpath(loc.CONTAS.FN_XP_BTN_ALTERAR('Carteira')).click()
cy.intercept('GET', '/contas',[{
id: 1,
nome:'Conta Alterada',
visivel: true,
usuario_id: 1
},{
id: 2,
nome:'Banco',
visivel: true,
usuario_id: 1
}]
).as('contasAtt')
cy.inserirConta('Conta Alterada')
cy.get(loc.MENSAGEM).should('contain', 'Conta atualizada com sucesso!')
cy.wait(1000)
cy.xpath(`//td[contains(.,'Conta Alterada')]`).should('exist')
})
it('3 - Verificar criação conta mesmo nome',()=>{
cy.intercept('POST', '/contas', {
statusCode: 400,
error: 'Já existe uma conta com esse nome!'
},).as('saveConta')
cy.acessarMenuConta()
cy.inserirConta('Conta mesmo nome')
cy.get(loc.MENSAGEM).should('contain', 'Erro: Error: Request failed with status code 400')
})
it('4 - Criando movimentação', ()=>{
cy.intercept('POST' , '/transacoes',{
id: 1,
descricao: 'Energia',
envolvido: 'Cemig',
observacao:null,
tipo: 'REC',data_transacao:"2021-11-25T03:00:00.000Z",data_pagamento:"2021-11-25T03:00:00.000Z",
valor: '100.00',
status:true,
conta_id:948512,
usuario_id:26343,
transferencia_id:null,
parcelamento_id:null
})
cy.get(loc.MENU.MOVIMENTACAO).click()
cy.get(loc.MOVIMENTACAO.DESCRICAO).type('Energia')
cy.get(loc.MOVIMENTACAO.VALOR).type('100')
cy.get(loc.MOVIMENTACAO.INTERESSADO).type('Cemig')
cy.get(loc.MOVIMENTACAO.CONTA).select('Banco')
cy.get(loc.MOVIMENTACAO.PAGA).click()
cy.intercept('GET', '/extrato/**', {fixture:'movimentacaoSalva'}
)
cy.get(loc.MOVIMENTACAO.BTN_MOV).click()
cy.get(loc.MENSAGEM).should('contain', 'sucesso')
cy.xpath(loc.EXTRATO.FN_XP_BUSCA_ELEMENTO('Energia','100')).should('exist')
})
it('5 - Pegar o saldo', ()=>{
cy.intercept('GET', '/transacoes/**',
{
"conta":"Conta para saldo",
"id":882375,
"descricao":"Movimentacao 1, calculo saldo",
"envolvido":"CCC",
"observacao":null,
"tipo":"REC",
"data_transacao":"2021-11-25T03:00:00.000Z",
"data_pagamento":"2021-11-25T03:00:00.000Z",
"valor":"3500.00",
"status":false,
"conta_id":948612,
"usuario_id":26343,
"transferencia_id":null,
"parcelamento_id":null
}
)
cy.intercept('PUT', '/transacoes/**',
{
"conta":"Conta para saldo",
"id":882375,
"descricao":"Movimentacao 1, calculo saldo",
"envolvido":"CCC",
"observacao":null,
"tipo":"REC",
"data_transacao":"2021-11-25T03:00:00.000Z",
"data_pagamento":"2021-11-25T03:00:00.000Z",
"valor":"3500.00",
"status":false,
"conta_id":948612,
"usuario_id":26343,
"transferencia_id":null,
"parcelamento_id":null
}
)
cy.get(loc.MENU.HOME).click()
cy.xpath(loc.SALDO.FN_XP_SALDO_CONTA('Carteira')).should('contain', '100,00')
cy.get(loc.MENU.EXTRATO).click()
cy.xpath(loc.EXTRATO.FN_XP_ALTERAR_ELEMENTO('Movimentacao 1, calculo saldo')).click();
cy.get(loc.MOVIMENTACAO.DESCRICAO).should('have.value', 'Movimentacao 1, calculo saldo')
cy.get(loc.MOVIMENTACAO.PAGA).click()
cy.intercept('GET', '/saldo', [
{conta_id :999,
conta:'Carteira',
saldo:'4034.00'} ,
{conta_id :1000,
conta:'Banco',
saldo:'1000000.00'}
]).as('saldoFinal')
cy.get(loc.MOVIMENTACAO.BTN_MOV).click()
cy.wait(1000)
cy.get(loc.MENSAGEM).should('contain', 'sucesso')
cy.get(loc.MENU.HOME).click()
cy.xpath(loc.SALDO.FN_XP_SALDO_CONTA('Carteira')).should('contain', '4.034,00')
})
it('6 - Remover movimentação', ()=>{
cy.intercept('DELETE', '/transacoes/**', {statusCode: 204,}).as('delete')
cy.get(loc.MENU.EXTRATO).click()
cy.xpath(loc.EXTRATO.FN_XP_REMOVER_ELEMENTO('Movimentacao para exclusao')).click();
cy.get(loc.MENSAGEM).should('contain', 'sucesso')
})
it(`7 -Validar rota de inserir conta`, ()=>{
cy.intercept('POST', '/contas', {
id: 3,
nome: 'Conta de teste',
visivel :true,
usuario_id: 26343,
}).as('saveConta')
cy.acessarMenuConta()
cy.intercept('GET', '/contas',[{
id: 1,
nome:'Carteira',
visivel: true,
usuario_id: 1
},{
id: 2,
nome:'Banco',
visivel: true,
usuario_id: 1
},{
id: 3,
nome:'Conta de teste',
visivel: true,
usuario_id: 1
}]
).as('contasSave')
cy.inserirConta('Conta de teste')
cy.wait('@saveConta').its('request.body.nome').should('not.be.empty')
cy.get(loc.MENSAGEM).should('contain', 'Conta inserida com sucesso!')
cy.wait(1000)
cy.xpath(`//td[contains(.,'Conta de teste')]`).should('exist')
})
it('8 - Teste cores tela extrato', ()=>{
cy.intercept('GET', '/extrato/**',
[{
conta:'Conta para movimentacoes', //Conta 1
id:882373,
descricao: 'Receita paga',
envolvido: 'AAA',
observacao: null,
tipo: 'REC',
data_transacao: '2021-11-25T03:00:00.000Z',
data_pagamento: '2021-11-25T03:00:00.000Z',
valor: '-1500.00',
status: true,
conta_id: 948610,
usuario_id: 26343,
transferencia_id: null,
parcelamento_id: null
},{
conta: 'Conta com movimentacao', //Conta 2
id: 882374,
descricao: 'Receita pendente',
envolvido: 'BBB',
observacao: null,
tipo: 'REC',
data_transacao: '2021-11-25T03:00:00.000Z',
data_pagamento: '2021-11-25T03:00:00.000Z',
valor: '-1500.00',
status: false,
conta_id: 948611,
usuario_id: 26343,
transferencia_id: null,
parcelamento_id: null
},{
conta: 'Conta para saldo', //Conta 3
id: 882375,
descricao: 'Despesa paga',
envolvido: 'CCC',
observacao: null,
tipo: 'DESP',
data_transacao: '2021-11-25T03:00:00.000Z',
data_pagamento: '2021-11-25T03:00:00.000Z',
valor: '3500.00',
status: true,
conta_id: 948612,
usuario_id: 26343,
transferencia_id: null,
parcelamento_id: null
},{
conta: 'Conta para saldo', //Conta 4
id: 882376,
descricao: 'Despesa pendente',
envolvido: 'DDD',
observacao: null,
tipo: 'DESP',
data_transacao: '2021-11-25T03:00:00.000Z',
data_pagamento: '2021-11-25T03:00:00.000Z',
valor: '-1000.00',
status: false,
conta_id: 948612,
usuario_id: 26343,
transferencia_id: null,
parcelamento_id: null
}]
)
cy.get(loc.MENU.EXTRATO).click()
cy.xpath(loc.EXTRATO.FN_XP_LINHA('Receita paga')).should('have.class', 'receitaPaga')
cy.xpath(loc.EXTRATO.FN_XP_LINHA('Receita pendente')).should('have.class', 'receitaPendente')
cy.xpath(loc.EXTRATO.FN_XP_LINHA('Despesa paga')).should('have.class', 'despesaPaga')
cy.xpath(loc.EXTRATO.FN_XP_LINHA('Despesa pendente')).should('have.class', 'despesaPendente')
})
})
|
import actions from './actions';
import mutations from './mutations';
import weeklyCalendarHelper from "weekly-calendar-helper"
const now = weeklyCalendarHelper.baseHelper.getUtcNow();
const state = {
links: [],
filter: {
categories: [],
tags: [],
users: [],
weeks: [],
years: []
},
selected: {
category: '',
tag: '',
name: '',
year: '',
week: ''
}
};
const getters = {
links: state => {
return state.links;
},
filter: state => {
return state.filter;
},
selected: state => {
return state.selected;
}
};
for (var i = 1; i <= 53; i++) {
state.filter.weeks.push(i.toString());
}
for (var i = 0; i <= 10; i++) {
state.filter.years.push((now.getFullYear() - i).toString());
}
export default {
namespaced: true,
state,
getters,
actions,
mutations
};
|
// source: google/ads/googleads/v3/enums/bidding_source.proto
/**
* @fileoverview
* @enhanceable
* @suppress {messageConventions} JS Compiler reports an error if a variable or
* field starts with 'MSG_' and isn't a translatable message.
* @public
*/
// GENERATED CODE -- DO NOT EDIT!
var jspb = require('google-protobuf');
var goog = jspb;
var global = Function('return this')();
var google_api_annotations_pb = require('../../../../../google/api/annotations_pb.js');
goog.object.extend(proto, google_api_annotations_pb);
goog.exportSymbol('proto.google.ads.googleads.v3.enums.BiddingSourceEnum', null, global);
goog.exportSymbol('proto.google.ads.googleads.v3.enums.BiddingSourceEnum.BiddingSource', null, global);
/**
* Generated by JsPbCodeGenerator.
* @param {Array=} opt_data Optional initial data array, typically from a
* server response, or constructed directly in Javascript. The array is used
* in place and becomes part of the constructed object. It is not cloned.
* If no data is provided, the constructed object will be empty, but still
* valid.
* @extends {jspb.Message}
* @constructor
*/
proto.google.ads.googleads.v3.enums.BiddingSourceEnum = function(opt_data) {
jspb.Message.initialize(this, opt_data, 0, -1, null, null);
};
goog.inherits(proto.google.ads.googleads.v3.enums.BiddingSourceEnum, jspb.Message);
if (goog.DEBUG && !COMPILED) {
/**
* @public
* @override
*/
proto.google.ads.googleads.v3.enums.BiddingSourceEnum.displayName = 'proto.google.ads.googleads.v3.enums.BiddingSourceEnum';
}
if (jspb.Message.GENERATE_TO_OBJECT) {
/**
* Creates an object representation of this proto.
* Field names that are reserved in JavaScript and will be renamed to pb_name.
* Optional fields that are not set will be set to undefined.
* To access a reserved field use, foo.pb_<name>, eg, foo.pb_default.
* For the list of reserved names please see:
* net/proto2/compiler/js/internal/generator.cc#kKeyword.
* @param {boolean=} opt_includeInstance Deprecated. whether to include the
* JSPB instance for transitional soy proto support:
* http://goto/soy-param-migration
* @return {!Object}
*/
proto.google.ads.googleads.v3.enums.BiddingSourceEnum.prototype.toObject = function(opt_includeInstance) {
return proto.google.ads.googleads.v3.enums.BiddingSourceEnum.toObject(opt_includeInstance, this);
};
/**
* Static version of the {@see toObject} method.
* @param {boolean|undefined} includeInstance Deprecated. Whether to include
* the JSPB instance for transitional soy proto support:
* http://goto/soy-param-migration
* @param {!proto.google.ads.googleads.v3.enums.BiddingSourceEnum} msg The msg instance to transform.
* @return {!Object}
* @suppress {unusedLocalVariables} f is only used for nested messages
*/
proto.google.ads.googleads.v3.enums.BiddingSourceEnum.toObject = function(includeInstance, msg) {
var f, obj = {
};
if (includeInstance) {
obj.$jspbMessageInstance = msg;
}
return obj;
};
}
/**
* Deserializes binary data (in protobuf wire format).
* @param {jspb.ByteSource} bytes The bytes to deserialize.
* @return {!proto.google.ads.googleads.v3.enums.BiddingSourceEnum}
*/
proto.google.ads.googleads.v3.enums.BiddingSourceEnum.deserializeBinary = function(bytes) {
var reader = new jspb.BinaryReader(bytes);
var msg = new proto.google.ads.googleads.v3.enums.BiddingSourceEnum;
return proto.google.ads.googleads.v3.enums.BiddingSourceEnum.deserializeBinaryFromReader(msg, reader);
};
/**
* Deserializes binary data (in protobuf wire format) from the
* given reader into the given message object.
* @param {!proto.google.ads.googleads.v3.enums.BiddingSourceEnum} msg The message object to deserialize into.
* @param {!jspb.BinaryReader} reader The BinaryReader to use.
* @return {!proto.google.ads.googleads.v3.enums.BiddingSourceEnum}
*/
proto.google.ads.googleads.v3.enums.BiddingSourceEnum.deserializeBinaryFromReader = function(msg, reader) {
while (reader.nextField()) {
if (reader.isEndGroup()) {
break;
}
var field = reader.getFieldNumber();
switch (field) {
default:
reader.skipField();
break;
}
}
return msg;
};
/**
* Serializes the message to binary data (in protobuf wire format).
* @return {!Uint8Array}
*/
proto.google.ads.googleads.v3.enums.BiddingSourceEnum.prototype.serializeBinary = function() {
var writer = new jspb.BinaryWriter();
proto.google.ads.googleads.v3.enums.BiddingSourceEnum.serializeBinaryToWriter(this, writer);
return writer.getResultBuffer();
};
/**
* Serializes the given message to binary data (in protobuf wire
* format), writing to the given BinaryWriter.
* @param {!proto.google.ads.googleads.v3.enums.BiddingSourceEnum} message
* @param {!jspb.BinaryWriter} writer
* @suppress {unusedLocalVariables} f is only used for nested messages
*/
proto.google.ads.googleads.v3.enums.BiddingSourceEnum.serializeBinaryToWriter = function(message, writer) {
var f = undefined;
};
/**
* @enum {number}
*/
proto.google.ads.googleads.v3.enums.BiddingSourceEnum.BiddingSource = {
UNSPECIFIED: 0,
UNKNOWN: 1,
CAMPAIGN_BIDDING_STRATEGY: 5,
AD_GROUP: 6,
AD_GROUP_CRITERION: 7
};
goog.object.extend(exports, proto.google.ads.googleads.v3.enums);
|
import React, { Component } from 'react';
import api from '../utils/api';
import UserContext from './user-context';
class GlobalState extends Component {
state = {
user: {}
};
async componentDidMount() {
await this.getUser();
this.timer = setInterval(() => this.getUser(), 2 * 60 * 1000);
}
getUser = async () => {
const user = await api.get('user');
this.setState({ user });
return user;
};
render() {
return (
<UserContext.Provider value={{
user: this.state.user,
getUser: this.getUser
}}>
{this.props.children}
</UserContext.Provider>
);
}
}
export default GlobalState;
|
import Vue from 'vue';
import Vuex from 'vuex';
Vue.use(Vuex);
export default new Vuex.Store({
state: {
messages: [],
selectedConversation: null,
conversations: [],
search: '',
user: null,
},
mutations: {
setUser(state, user) {
state.user = user;
},
newMessagesList(state, messages) {
state.messages = messages;
},
addMessage(state, message) {
console.log(message);
const conversation = state.conversations.find((conversation) =>
conversation.contact_id == message.from_id ||
conversation.contact_id == message.to_id
)
const author = state.user.id === message.from_id ? 'Tú: ' : conversation.contact_name + ': ';
conversation.last_message = `${author}: ${message.content}`;
conversation.last_time = message.created_at;
if (state.selectedConversation.contact_id == message.from_id
|| state.selectedConversation.contact_id == message.to_id) {
state.messages.push(message);
}
},
setSelectedConversation(state, conversation) {
state.selectedConversation = conversation;
},
setSearch(state, search) {
state.search = search;
},
newConversationsList(state, conversations) {
state.conversations = conversations;
}
},
actions: {
getMessages(context, conversation) {
return axios
.get(`/api/messages?contact_id=${conversation.contact_id}`)
.then(response => {
context.commit('setSelectedConversation', conversation)
context.commit('newMessagesList', response.data)
})
.catch(error=> console.log(error));
},
getConversations(context) {
return axios.get('/api/conversations')
.then(response => {
context.commit('newConversationsList', response.data)
})
.catch(error => {
console.log(error);
});
},
postMessage(context, message) {
const params = {
to_id: context.state.selectedConversation.contact_id,
content: message,
};
// console.log(context.state.selectedConversation.id);
// return
return axios.post("/api/messages", params).then((response) => {
if (response.data.status == "success") {
// content = "";
const message = response.data.message;
message.written_by_me = true;
context.commit("addMessage", message);
}
});
}
},
getters: {
conversationsFiltered(state) {
return state.conversations.filter(conversation =>
conversation
.contact_name.toLowerCase()
.includes(state.search.toLowerCase())
);
},
getConversationById(state) {
return function (conversationId) {
return state.conversations.find(conversation => conversation.id == conversationId)
}
},
}
});
|
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
exports.selectChannel = selectChannel;
exports.createChannel = createChannel;
exports.createDirectChannel = createDirectChannel;
exports.createGroupChannel = createGroupChannel;
exports.patchChannel = patchChannel;
exports.updateChannel = updateChannel;
exports.updateChannelNotifyProps = updateChannelNotifyProps;
exports.getChannel = getChannel;
exports.getChannelAndMyMember = getChannelAndMyMember;
exports.fetchMyChannelsAndMembers = fetchMyChannelsAndMembers;
exports.getMyChannelMembers = getMyChannelMembers;
exports.getChannelMembers = getChannelMembers;
exports.leaveChannel = leaveChannel;
exports.joinChannel = joinChannel;
exports.deleteChannel = deleteChannel;
exports.viewChannel = viewChannel;
exports.getChannels = getChannels;
exports.searchChannels = searchChannels;
exports.getChannelStats = getChannelStats;
exports.addChannelMember = addChannelMember;
exports.removeChannelMember = removeChannelMember;
exports.updateChannelMemberRoles = updateChannelMemberRoles;
exports.updateChannelHeader = updateChannelHeader;
exports.updateChannelPurpose = updateChannelPurpose;
exports.markChannelAsRead = markChannelAsRead;
exports.markChannelAsUnread = markChannelAsUnread;
exports.getChannelMembersByIds = getChannelMembersByIds;
exports.getChannelMember = getChannelMember;
exports.getMyChannelMember = getMyChannelMember;
var _reduxBatchedActions = require('redux-batched-actions');
var _client = require('../client');
var _constants = require('../constants');
var _action_types = require('../action_types');
var _preferences = require('./preferences');
var _channel_utils = require('../utils/channel_utils');
var _errors = require('./errors');
var _helpers = require('./helpers');
var _users = require('./users');
function _asyncToGenerator(fn) { return function () { var gen = fn.apply(this, arguments); return new Promise(function (resolve, reject) { function step(key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { return Promise.resolve(value).then(function (value) { step("next", value); }, function (err) { step("throw", err); }); } } return step("next"); }); }; } // Copyright (c) 2016-present Mattermost, Inc. All Rights Reserved.
// See License.txt for license information.
function selectChannel(channelId) {
var _this = this;
return function () {
var _ref = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee(dispatch, getState) {
return regeneratorRuntime.wrap(function _callee$(_context) {
while (1) {
switch (_context.prev = _context.next) {
case 0:
try {
dispatch({
type: _action_types.ChannelTypes.SELECT_CHANNEL,
data: channelId
}, getState);
} catch (error) {
(0, _errors.logError)(error)(dispatch);
}
case 1:
case 'end':
return _context.stop();
}
}
}, _callee, _this);
}));
return function (_x, _x2) {
return _ref.apply(this, arguments);
};
}();
}
function createChannel(channel, userId) {
var _this2 = this;
return function () {
var _ref2 = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee2(dispatch, getState) {
var created, member, actions, _getState$entities$ch, channels, myMembers;
return regeneratorRuntime.wrap(function _callee2$(_context2) {
while (1) {
switch (_context2.prev = _context2.next) {
case 0:
dispatch((0, _reduxBatchedActions.batchActions)([{
type: _action_types.ChannelTypes.CREATE_CHANNEL_REQUEST
}, {
type: _action_types.ChannelTypes.CHANNEL_MEMBERS_REQUEST
}]), getState);
created = void 0;
_context2.prev = 2;
_context2.next = 5;
return _client.Client4.createChannel(channel);
case 5:
created = _context2.sent;
_context2.next = 13;
break;
case 8:
_context2.prev = 8;
_context2.t0 = _context2['catch'](2);
(0, _helpers.forceLogoutIfNecessary)(_context2.t0, dispatch);
dispatch((0, _reduxBatchedActions.batchActions)([{
type: _action_types.ChannelTypes.CREATE_CHANNEL_FAILURE,
error: _context2.t0
}, {
type: _action_types.ChannelTypes.CHANNEL_MEMBERS_FAILURE,
error: _context2.t0
}, (0, _errors.logError)(_context2.t0)(dispatch)]), getState);
return _context2.abrupt('return', null);
case 13:
member = {
channel_id: created.id,
user_id: userId,
roles: _constants.General.CHANNEL_USER_ROLE + ' ' + _constants.General.CHANNEL_ADMIN_ROLE,
last_viewed_at: 0,
msg_count: 0,
mention_count: 0,
notify_props: { desktop: 'default', mark_unread: 'all' },
last_update_at: created.create_at
};
actions = [];
_getState$entities$ch = getState().entities.channels, channels = _getState$entities$ch.channels, myMembers = _getState$entities$ch.myMembers;
if (!channels[created.id]) {
actions.push({ type: _action_types.ChannelTypes.RECEIVED_CHANNEL, data: created });
}
if (!myMembers[created.id]) {
actions.push({ type: _action_types.ChannelTypes.RECEIVED_MY_CHANNEL_MEMBER, data: member });
}
dispatch((0, _reduxBatchedActions.batchActions)([].concat(actions, [{
type: _action_types.ChannelTypes.CREATE_CHANNEL_SUCCESS
}, {
type: _action_types.ChannelTypes.CHANNEL_MEMBERS_SUCCESS
}])), getState);
return _context2.abrupt('return', created);
case 20:
case 'end':
return _context2.stop();
}
}
}, _callee2, _this2, [[2, 8]]);
}));
return function (_x3, _x4) {
return _ref2.apply(this, arguments);
};
}();
}
function createDirectChannel(userId, otherUserId) {
var _this3 = this;
return function () {
var _ref3 = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee3(dispatch, getState) {
var created, member, preferences;
return regeneratorRuntime.wrap(function _callee3$(_context3) {
while (1) {
switch (_context3.prev = _context3.next) {
case 0:
dispatch({ type: _action_types.ChannelTypes.CREATE_CHANNEL_REQUEST }, getState);
created = void 0;
_context3.prev = 2;
_context3.next = 5;
return _client.Client4.createDirectChannel([userId, otherUserId]);
case 5:
created = _context3.sent;
_context3.next = 13;
break;
case 8:
_context3.prev = 8;
_context3.t0 = _context3['catch'](2);
(0, _helpers.forceLogoutIfNecessary)(_context3.t0, dispatch);
dispatch((0, _reduxBatchedActions.batchActions)([{ type: _action_types.ChannelTypes.CREATE_CHANNEL_FAILURE, error: _context3.t0 }, (0, _errors.logError)(_context3.t0)(dispatch)]), getState);
return _context3.abrupt('return', { error: _context3.t0 });
case 13:
member = {
channel_id: created.id,
user_id: userId,
roles: '' + _constants.General.CHANNEL_USER_ROLE,
last_viewed_at: 0,
msg_count: 0,
mention_count: 0,
notify_props: { desktop: 'default', mark_unread: 'all' },
last_update_at: created.create_at
};
preferences = [{ user_id: userId, category: _constants.Preferences.CATEGORY_DIRECT_CHANNEL_SHOW, name: otherUserId, value: 'true' }];
(0, _preferences.savePreferences)(userId, preferences)(dispatch, getState);
dispatch((0, _reduxBatchedActions.batchActions)([{
type: _action_types.ChannelTypes.RECEIVED_CHANNEL,
data: created
}, {
type: _action_types.ChannelTypes.RECEIVED_MY_CHANNEL_MEMBER,
data: member
}, {
type: _action_types.PreferenceTypes.RECEIVED_PREFERENCES,
data: preferences
}, {
type: _action_types.ChannelTypes.CREATE_CHANNEL_SUCCESS
}]), getState);
return _context3.abrupt('return', { data: created });
case 18:
case 'end':
return _context3.stop();
}
}
}, _callee3, _this3, [[2, 8]]);
}));
return function (_x5, _x6) {
return _ref3.apply(this, arguments);
};
}();
}
function createGroupChannel(userIds) {
var _this4 = this;
return function () {
var _ref4 = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee4(dispatch, getState) {
var currentUserId, created, member, preferences;
return regeneratorRuntime.wrap(function _callee4$(_context4) {
while (1) {
switch (_context4.prev = _context4.next) {
case 0:
dispatch({ type: _action_types.ChannelTypes.CREATE_CHANNEL_REQUEST }, getState);
currentUserId = getState().entities.users.currentUserId;
created = void 0;
_context4.prev = 3;
_context4.next = 6;
return _client.Client4.createGroupChannel(userIds);
case 6:
created = _context4.sent;
_context4.next = 14;
break;
case 9:
_context4.prev = 9;
_context4.t0 = _context4['catch'](3);
(0, _helpers.forceLogoutIfNecessary)(_context4.t0, dispatch);
dispatch((0, _reduxBatchedActions.batchActions)([{ type: _action_types.ChannelTypes.CREATE_CHANNEL_FAILURE, error: _context4.t0 }, (0, _errors.logError)(_context4.t0)(dispatch)]), getState);
return _context4.abrupt('return', { error: _context4.t0 });
case 14:
member = {
channel_id: created.id,
user_id: currentUserId,
roles: '' + _constants.General.CHANNEL_USER_ROLE,
last_viewed_at: 0,
msg_count: 0,
mention_count: 0,
notify_props: { desktop: 'default', mark_unread: 'all' },
last_update_at: created.create_at
};
preferences = [{ user_id: currentUserId, category: _constants.Preferences.CATEGORY_GROUP_CHANNEL_SHOW, name: created.id, value: 'true' }];
(0, _preferences.savePreferences)(currentUserId, preferences)(dispatch, getState);
dispatch((0, _reduxBatchedActions.batchActions)([{
type: _action_types.ChannelTypes.RECEIVED_CHANNEL,
data: created
}, {
type: _action_types.ChannelTypes.RECEIVED_MY_CHANNEL_MEMBER,
data: member
}, {
type: _action_types.PreferenceTypes.RECEIVED_PREFERENCES,
data: preferences
}, {
type: _action_types.ChannelTypes.CREATE_CHANNEL_SUCCESS
}]), getState);
return _context4.abrupt('return', { data: created });
case 19:
case 'end':
return _context4.stop();
}
}
}, _callee4, _this4, [[3, 9]]);
}));
return function (_x7, _x8) {
return _ref4.apply(this, arguments);
};
}();
}
function patchChannel(channelId, patch) {
var _this5 = this;
return function () {
var _ref5 = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee5(dispatch, getState) {
var updated;
return regeneratorRuntime.wrap(function _callee5$(_context5) {
while (1) {
switch (_context5.prev = _context5.next) {
case 0:
dispatch({ type: _action_types.ChannelTypes.UPDATE_CHANNEL_REQUEST }, getState);
updated = void 0;
_context5.prev = 2;
_context5.next = 5;
return _client.Client4.patchChannel(channelId, patch);
case 5:
updated = _context5.sent;
_context5.next = 13;
break;
case 8:
_context5.prev = 8;
_context5.t0 = _context5['catch'](2);
(0, _helpers.forceLogoutIfNecessary)(_context5.t0, dispatch);
dispatch((0, _reduxBatchedActions.batchActions)([{ type: _action_types.ChannelTypes.UPDATE_CHANNEL_FAILURE, error: _context5.t0 }, (0, _errors.logError)(_context5.t0)(dispatch)]), getState);
return _context5.abrupt('return', null);
case 13:
dispatch((0, _reduxBatchedActions.batchActions)([{
type: _action_types.ChannelTypes.RECEIVED_CHANNEL,
data: updated
}, {
type: _action_types.ChannelTypes.UPDATE_CHANNEL_SUCCESS
}]), getState);
return _context5.abrupt('return', updated);
case 15:
case 'end':
return _context5.stop();
}
}
}, _callee5, _this5, [[2, 8]]);
}));
return function (_x9, _x10) {
return _ref5.apply(this, arguments);
};
}();
}
function updateChannel(channel) {
var _this6 = this;
return function () {
var _ref6 = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee6(dispatch, getState) {
var updated;
return regeneratorRuntime.wrap(function _callee6$(_context6) {
while (1) {
switch (_context6.prev = _context6.next) {
case 0:
dispatch({ type: _action_types.ChannelTypes.UPDATE_CHANNEL_REQUEST }, getState);
updated = void 0;
_context6.prev = 2;
_context6.next = 5;
return _client.Client4.updateChannel(channel);
case 5:
updated = _context6.sent;
_context6.next = 13;
break;
case 8:
_context6.prev = 8;
_context6.t0 = _context6['catch'](2);
(0, _helpers.forceLogoutIfNecessary)(_context6.t0, dispatch);
dispatch((0, _reduxBatchedActions.batchActions)([{ type: _action_types.ChannelTypes.UPDATE_CHANNEL_FAILURE, error: _context6.t0 }, (0, _errors.logError)(_context6.t0)(dispatch)]), getState);
return _context6.abrupt('return', null);
case 13:
dispatch((0, _reduxBatchedActions.batchActions)([{
type: _action_types.ChannelTypes.RECEIVED_CHANNEL,
data: updated
}, {
type: _action_types.ChannelTypes.UPDATE_CHANNEL_SUCCESS
}]), getState);
return _context6.abrupt('return', updated);
case 15:
case 'end':
return _context6.stop();
}
}
}, _callee6, _this6, [[2, 8]]);
}));
return function (_x11, _x12) {
return _ref6.apply(this, arguments);
};
}();
}
function updateChannelNotifyProps(userId, channelId, props) {
var _this7 = this;
return function () {
var _ref7 = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee7(dispatch, getState) {
var notifyProps, member, currentNotifyProps;
return regeneratorRuntime.wrap(function _callee7$(_context7) {
while (1) {
switch (_context7.prev = _context7.next) {
case 0:
dispatch({ type: _action_types.ChannelTypes.NOTIFY_PROPS_REQUEST }, getState);
notifyProps = _extends({
user_id: userId,
channel_id: channelId
}, props);
_context7.prev = 2;
_context7.next = 5;
return _client.Client4.updateChannelNotifyProps(notifyProps);
case 5:
_context7.next = 12;
break;
case 7:
_context7.prev = 7;
_context7.t0 = _context7['catch'](2);
(0, _helpers.forceLogoutIfNecessary)(_context7.t0, dispatch);
dispatch((0, _reduxBatchedActions.batchActions)([{ type: _action_types.ChannelTypes.NOTIFY_PROPS_FAILURE, error: _context7.t0 }, (0, _errors.logError)(_context7.t0)(dispatch)]), getState);
return _context7.abrupt('return', null);
case 12:
member = getState().entities.channels.myMembers[channelId] || {};
currentNotifyProps = member.notify_props || {};
dispatch((0, _reduxBatchedActions.batchActions)([{
type: _action_types.ChannelTypes.RECEIVED_CHANNEL_PROPS,
data: {
channel_id: channelId,
notifyProps: _extends({}, currentNotifyProps, notifyProps)
}
}, {
type: _action_types.ChannelTypes.NOTIFY_PROPS_SUCCESS
}]), getState);
return _context7.abrupt('return', true);
case 16:
case 'end':
return _context7.stop();
}
}
}, _callee7, _this7, [[2, 7]]);
}));
return function (_x13, _x14) {
return _ref7.apply(this, arguments);
};
}();
}
function getChannel(channelId) {
var _this8 = this;
return function () {
var _ref8 = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee8(dispatch, getState) {
var data;
return regeneratorRuntime.wrap(function _callee8$(_context8) {
while (1) {
switch (_context8.prev = _context8.next) {
case 0:
dispatch({ type: _action_types.ChannelTypes.CHANNEL_REQUEST }, getState);
data = void 0;
_context8.prev = 2;
_context8.next = 5;
return _client.Client4.getChannel(channelId);
case 5:
data = _context8.sent;
_context8.next = 13;
break;
case 8:
_context8.prev = 8;
_context8.t0 = _context8['catch'](2);
(0, _helpers.forceLogoutIfNecessary)(_context8.t0, dispatch);
dispatch((0, _reduxBatchedActions.batchActions)([{ type: _action_types.ChannelTypes.CHANNELS_FAILURE, error: _context8.t0 }, (0, _errors.logError)(_context8.t0)(dispatch)]), getState);
return _context8.abrupt('return', null);
case 13:
dispatch((0, _reduxBatchedActions.batchActions)([{
type: _action_types.ChannelTypes.RECEIVED_CHANNEL,
data: data
}, {
type: _action_types.ChannelTypes.CHANNEL_SUCCESS
}]), getState);
return _context8.abrupt('return', data);
case 15:
case 'end':
return _context8.stop();
}
}
}, _callee8, _this8, [[2, 8]]);
}));
return function (_x15, _x16) {
return _ref8.apply(this, arguments);
};
}();
}
function getChannelAndMyMember(channelId) {
var _this9 = this;
return function () {
var _ref9 = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee9(dispatch, getState) {
var channel, member;
return regeneratorRuntime.wrap(function _callee9$(_context9) {
while (1) {
switch (_context9.prev = _context9.next) {
case 0:
dispatch({ type: _action_types.ChannelTypes.CHANNEL_REQUEST }, getState);
channel = void 0;
member = void 0;
_context9.prev = 3;
_context9.next = 6;
return _client.Client4.getChannel(channelId);
case 6:
channel = _context9.sent;
_context9.next = 9;
return _client.Client4.getMyChannelMember(channelId);
case 9:
member = _context9.sent;
_context9.next = 17;
break;
case 12:
_context9.prev = 12;
_context9.t0 = _context9['catch'](3);
(0, _helpers.forceLogoutIfNecessary)(_context9.t0, dispatch);
dispatch((0, _reduxBatchedActions.batchActions)([{ type: _action_types.ChannelTypes.CHANNELS_FAILURE, error: _context9.t0 }, (0, _errors.logError)(_context9.t0)(dispatch)]), getState);
return _context9.abrupt('return', null);
case 17:
dispatch((0, _reduxBatchedActions.batchActions)([{
type: _action_types.ChannelTypes.RECEIVED_CHANNEL,
data: channel
}, {
type: _action_types.ChannelTypes.CHANNEL_SUCCESS
}, {
type: _action_types.ChannelTypes.RECEIVED_MY_CHANNEL_MEMBER,
data: member
}]), getState);
return _context9.abrupt('return', { channel: channel, member: member });
case 19:
case 'end':
return _context9.stop();
}
}
}, _callee9, _this9, [[3, 12]]);
}));
return function (_x17, _x18) {
return _ref9.apply(this, arguments);
};
}();
}
function fetchMyChannelsAndMembers(teamId) {
var _this10 = this;
return function () {
var _ref10 = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee10(dispatch, getState) {
var channels, channelMembers, currentUserId;
return regeneratorRuntime.wrap(function _callee10$(_context10) {
while (1) {
switch (_context10.prev = _context10.next) {
case 0:
dispatch((0, _reduxBatchedActions.batchActions)([{
type: _action_types.ChannelTypes.CHANNELS_REQUEST
}, {
type: _action_types.ChannelTypes.CHANNEL_MEMBERS_REQUEST
}]), getState);
channels = void 0;
channelMembers = void 0;
_context10.prev = 3;
_context10.next = 6;
return _client.Client4.getMyChannels(teamId);
case 6:
channels = _context10.sent;
_context10.next = 14;
break;
case 9:
_context10.prev = 9;
_context10.t0 = _context10['catch'](3);
(0, _helpers.forceLogoutIfNecessary)(_context10.t0, dispatch);
dispatch((0, _reduxBatchedActions.batchActions)([{ type: _action_types.ChannelTypes.CHANNELS_FAILURE, error: _context10.t0 }, { type: _action_types.ChannelTypes.CHANNEL_MEMBERS_FAILURE, error: _context10.t0 }, (0, _errors.logError)(_context10.t0)(dispatch)]), getState);
return _context10.abrupt('return', null);
case 14:
_context10.prev = 14;
_context10.next = 17;
return _client.Client4.getMyChannelMembers(teamId);
case 17:
channelMembers = _context10.sent;
_context10.next = 25;
break;
case 20:
_context10.prev = 20;
_context10.t1 = _context10['catch'](14);
(0, _helpers.forceLogoutIfNecessary)(_context10.t1, dispatch);
dispatch((0, _reduxBatchedActions.batchActions)([{ type: _action_types.ChannelTypes.CHANNELS_FAILURE, error: _context10.t1 }, { type: _action_types.ChannelTypes.CHANNEL_MEMBERS_FAILURE, error: _context10.t1 }, (0, _errors.logError)(_context10.t1)(dispatch)]), getState);
return _context10.abrupt('return', null);
case 25:
currentUserId = getState().entities.users.currentUserId;
dispatch((0, _reduxBatchedActions.batchActions)([{
type: _action_types.ChannelTypes.RECEIVED_CHANNELS,
teamId: teamId,
data: channels
}, {
type: _action_types.ChannelTypes.CHANNELS_SUCCESS
}, {
type: _action_types.ChannelTypes.RECEIVED_MY_CHANNEL_MEMBERS,
data: channelMembers,
remove: (0, _channel_utils.getChannelsIdForTeam)(getState(), teamId),
currentUserId: currentUserId
}, {
type: _action_types.ChannelTypes.CHANNEL_MEMBERS_SUCCESS
}]), getState);
return _context10.abrupt('return', { channels: channels, members: channelMembers });
case 28:
case 'end':
return _context10.stop();
}
}
}, _callee10, _this10, [[3, 9], [14, 20]]);
}));
return function (_x19, _x20) {
return _ref10.apply(this, arguments);
};
}();
}
function getMyChannelMembers(teamId) {
var _this11 = this;
return function () {
var _ref11 = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee11(dispatch, getState) {
var channelMembers, channelMembersRequest, currentUserId;
return regeneratorRuntime.wrap(function _callee11$(_context11) {
while (1) {
switch (_context11.prev = _context11.next) {
case 0:
dispatch({ type: _action_types.ChannelTypes.CHANNEL_MY_MEMBERS_REQUEST }, getState);
channelMembers = void 0;
_context11.prev = 2;
channelMembersRequest = _client.Client4.getMyChannelMembers(teamId);
_context11.next = 6;
return channelMembersRequest;
case 6:
channelMembers = _context11.sent;
_context11.next = 14;
break;
case 9:
_context11.prev = 9;
_context11.t0 = _context11['catch'](2);
(0, _helpers.forceLogoutIfNecessary)(_context11.t0, dispatch);
dispatch((0, _reduxBatchedActions.batchActions)([{ type: _action_types.ChannelTypes.CHANNEL_MY_MEMBERS_FAILURE, error: _context11.t0 }, (0, _errors.logError)(_context11.t0)(dispatch)]), getState);
return _context11.abrupt('return', null);
case 14:
currentUserId = getState().entities.users.currentUserId;
dispatch((0, _reduxBatchedActions.batchActions)([{
type: _action_types.ChannelTypes.RECEIVED_MY_CHANNEL_MEMBERS,
data: channelMembers,
remove: (0, _channel_utils.getChannelsIdForTeam)(getState(), teamId),
currentUserId: currentUserId
}, {
type: _action_types.ChannelTypes.CHANNEL_MY_MEMBERS_SUCCESS
}]), getState);
return _context11.abrupt('return', channelMembers);
case 17:
case 'end':
return _context11.stop();
}
}
}, _callee11, _this11, [[2, 9]]);
}));
return function (_x21, _x22) {
return _ref11.apply(this, arguments);
};
}();
}
function getChannelMembers(channelId) {
var _this12 = this;
var page = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
var perPage = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : _constants.General.CHANNELS_CHUNK_SIZE;
return function () {
var _ref12 = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee12(dispatch, getState) {
var channelMembers, channelMembersRequest, userIds;
return regeneratorRuntime.wrap(function _callee12$(_context12) {
while (1) {
switch (_context12.prev = _context12.next) {
case 0:
dispatch({ type: _action_types.ChannelTypes.CHANNEL_MEMBERS_REQUEST }, getState);
channelMembers = void 0;
_context12.prev = 2;
channelMembersRequest = _client.Client4.getChannelMembers(channelId, page, perPage);
_context12.next = 6;
return channelMembersRequest;
case 6:
channelMembers = _context12.sent;
_context12.next = 14;
break;
case 9:
_context12.prev = 9;
_context12.t0 = _context12['catch'](2);
(0, _helpers.forceLogoutIfNecessary)(_context12.t0, dispatch);
dispatch((0, _reduxBatchedActions.batchActions)([{ type: _action_types.ChannelTypes.CHANNEL_MEMBERS_FAILURE, error: _context12.t0 }, (0, _errors.logError)(_context12.t0)(dispatch)]), getState);
return _context12.abrupt('return', null);
case 14:
userIds = channelMembers.map(function (cm) {
return cm.user_id;
});
(0, _users.getMissingProfilesByIds)(userIds)(dispatch, getState);
dispatch((0, _reduxBatchedActions.batchActions)([{
type: _action_types.ChannelTypes.RECEIVED_CHANNEL_MEMBERS,
data: channelMembers
}, {
type: _action_types.ChannelTypes.CHANNEL_MEMBERS_SUCCESS
}]), getState);
return _context12.abrupt('return', channelMembers);
case 18:
case 'end':
return _context12.stop();
}
}
}, _callee12, _this12, [[2, 9]]);
}));
return function (_x25, _x26) {
return _ref12.apply(this, arguments);
};
}();
}
function leaveChannel(channelId) {
var _this13 = this;
return function () {
var _ref13 = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee13(dispatch, getState) {
var state, currentUserId, _state$entities$chann, channels, myMembers, channel, member;
return regeneratorRuntime.wrap(function _callee13$(_context13) {
while (1) {
switch (_context13.prev = _context13.next) {
case 0:
state = getState();
currentUserId = state.entities.users.currentUserId;
_state$entities$chann = state.entities.channels, channels = _state$entities$chann.channels, myMembers = _state$entities$chann.myMembers;
channel = channels[channelId];
member = myMembers[channelId];
dispatch({
type: _action_types.ChannelTypes.LEAVE_CHANNEL,
data: {
id: channelId,
user_id: currentUserId,
team_id: channel.team_id,
type: channel.type
},
meta: {
offline: {
effect: function effect() {
return _client.Client4.removeFromChannel(currentUserId, channelId);
},
commit: { type: _action_types.ChannelTypes.LEAVE_CHANNEL },
rollback: function rollback() {
dispatch((0, _reduxBatchedActions.batchActions)([{
type: _action_types.ChannelTypes.RECEIVED_CHANNEL,
data: channel
}, {
type: _action_types.ChannelTypes.RECEIVED_MY_CHANNEL_MEMBER,
data: member
}]));
}
}
}
});
case 6:
case 'end':
return _context13.stop();
}
}
}, _callee13, _this13);
}));
return function (_x27, _x28) {
return _ref13.apply(this, arguments);
};
}();
}
function joinChannel(userId, teamId, channelId, channelName) {
var _this14 = this;
return function () {
var _ref14 = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee14(dispatch, getState) {
var member, channel;
return regeneratorRuntime.wrap(function _callee14$(_context14) {
while (1) {
switch (_context14.prev = _context14.next) {
case 0:
dispatch({ type: _action_types.ChannelTypes.JOIN_CHANNEL_REQUEST }, getState);
member = void 0;
channel = void 0;
_context14.prev = 3;
if (!channelId) {
_context14.next = 13;
break;
}
_context14.next = 7;
return _client.Client4.addToChannel(userId, channelId);
case 7:
member = _context14.sent;
_context14.next = 10;
return _client.Client4.getChannel(channelId);
case 10:
channel = _context14.sent;
_context14.next = 20;
break;
case 13:
if (!channelName) {
_context14.next = 20;
break;
}
_context14.next = 16;
return _client.Client4.getChannelByName(teamId, channelName);
case 16:
channel = _context14.sent;
_context14.next = 19;
return _client.Client4.addToChannel(userId, channel.id);
case 19:
member = _context14.sent;
case 20:
_context14.next = 27;
break;
case 22:
_context14.prev = 22;
_context14.t0 = _context14['catch'](3);
(0, _helpers.forceLogoutIfNecessary)(_context14.t0, dispatch);
dispatch((0, _reduxBatchedActions.batchActions)([{ type: _action_types.ChannelTypes.JOIN_CHANNEL_FAILURE, error: _context14.t0 }, (0, _errors.logError)(_context14.t0)(dispatch)]), getState);
return _context14.abrupt('return', { error: _context14.t0 });
case 27:
dispatch((0, _reduxBatchedActions.batchActions)([{
type: _action_types.ChannelTypes.RECEIVED_CHANNEL,
data: channel
}, {
type: _action_types.ChannelTypes.RECEIVED_MY_CHANNEL_MEMBER,
data: member
}, {
type: _action_types.ChannelTypes.JOIN_CHANNEL_SUCCESS
}]), getState);
return _context14.abrupt('return', { data: { channel: channel, member: member } });
case 29:
case 'end':
return _context14.stop();
}
}
}, _callee14, _this14, [[3, 22]]);
}));
return function (_x29, _x30) {
return _ref14.apply(this, arguments);
};
}();
}
function deleteChannel(channelId) {
var _this15 = this;
return function () {
var _ref15 = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee15(dispatch, getState) {
var entities, _entities$channels, channels, currentChannelId, channel, defaultChannelId, teamId;
return regeneratorRuntime.wrap(function _callee15$(_context15) {
while (1) {
switch (_context15.prev = _context15.next) {
case 0:
dispatch({ type: _action_types.ChannelTypes.DELETE_CHANNEL_REQUEST }, getState);
_context15.prev = 1;
_context15.next = 4;
return _client.Client4.deleteChannel(channelId);
case 4:
_context15.next = 11;
break;
case 6:
_context15.prev = 6;
_context15.t0 = _context15['catch'](1);
(0, _helpers.forceLogoutIfNecessary)(_context15.t0, dispatch);
dispatch((0, _reduxBatchedActions.batchActions)([{ type: _action_types.ChannelTypes.DELETE_CHANNEL_FAILURE, error: _context15.t0 }, (0, _errors.logError)(_context15.t0)(dispatch)]), getState);
return _context15.abrupt('return', { error: _context15.t0 });
case 11:
entities = getState().entities;
_entities$channels = entities.channels, channels = _entities$channels.channels, currentChannelId = _entities$channels.currentChannelId;
if (channelId === currentChannelId) {
channel = Object.keys(channels).filter(function (key) {
return channels[key].name === _constants.General.DEFAULT_CHANNEL;
});
defaultChannelId = '';
if (channel.length) {
defaultChannelId = channel[0];
}
dispatch({ type: _action_types.ChannelTypes.SELECT_CHANNEL, data: defaultChannelId }, getState);
}
teamId = channels[channelId] ? channels[channelId].team_id : '';
dispatch((0, _reduxBatchedActions.batchActions)([{
type: _action_types.ChannelTypes.RECEIVED_CHANNEL_DELETED,
data: { id: channelId, team_id: teamId }
}, {
type: _action_types.ChannelTypes.DELETE_CHANNEL_SUCCESS
}]), getState);
return _context15.abrupt('return', { data: true });
case 17:
case 'end':
return _context15.stop();
}
}
}, _callee15, _this15, [[1, 6]]);
}));
return function (_x31, _x32) {
return _ref15.apply(this, arguments);
};
}();
}
function viewChannel(channelId) {
var _this16 = this;
var prevChannelId = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '';
return function () {
var _ref16 = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee16(dispatch, getState) {
var actions, myMembers, member, prevMember;
return regeneratorRuntime.wrap(function _callee16$(_context16) {
while (1) {
switch (_context16.prev = _context16.next) {
case 0:
dispatch({ type: _action_types.ChannelTypes.UPDATE_LAST_VIEWED_REQUEST }, getState);
_context16.prev = 1;
_context16.next = 4;
return _client.Client4.viewMyChannel(channelId, prevChannelId);
case 4:
_context16.next = 11;
break;
case 6:
_context16.prev = 6;
_context16.t0 = _context16['catch'](1);
(0, _helpers.forceLogoutIfNecessary)(_context16.t0, dispatch);
dispatch((0, _reduxBatchedActions.batchActions)([{ type: _action_types.ChannelTypes.UPDATE_LAST_VIEWED_FAILURE, error: _context16.t0 }, (0, _errors.logError)(_context16.t0)(dispatch)]), getState);
return _context16.abrupt('return', null);
case 11:
actions = [{ type: _action_types.ChannelTypes.UPDATE_LAST_VIEWED_SUCCESS }];
myMembers = getState().entities.channels.myMembers;
member = myMembers[channelId];
if (member) {
actions.push({
type: _action_types.ChannelTypes.RECEIVED_MY_CHANNEL_MEMBER,
data: _extends({}, member, { last_viewed_at: new Date().getTime() })
});
}
prevMember = myMembers[prevChannelId];
if (prevMember) {
actions.push({
type: _action_types.ChannelTypes.RECEIVED_MY_CHANNEL_MEMBER,
data: _extends({}, prevMember, { last_viewed_at: new Date().getTime() })
});
}
dispatch((0, _reduxBatchedActions.batchActions)(actions), getState);
return _context16.abrupt('return', true);
case 19:
case 'end':
return _context16.stop();
}
}
}, _callee16, _this16, [[1, 6]]);
}));
return function (_x34, _x35) {
return _ref16.apply(this, arguments);
};
}();
}
function getChannels(teamId) {
var _this17 = this;
var page = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
var perPage = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : _constants.General.CHANNELS_CHUNK_SIZE;
return function () {
var _ref17 = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee17(dispatch, getState) {
var channels;
return regeneratorRuntime.wrap(function _callee17$(_context17) {
while (1) {
switch (_context17.prev = _context17.next) {
case 0:
dispatch({ type: _action_types.ChannelTypes.GET_CHANNELS_REQUEST }, getState);
channels = void 0;
_context17.prev = 2;
_context17.next = 5;
return _client.Client4.getChannels(teamId, page, perPage);
case 5:
channels = _context17.sent;
_context17.next = 13;
break;
case 8:
_context17.prev = 8;
_context17.t0 = _context17['catch'](2);
(0, _helpers.forceLogoutIfNecessary)(_context17.t0, dispatch);
dispatch((0, _reduxBatchedActions.batchActions)([{ type: _action_types.ChannelTypes.GET_CHANNELS_FAILURE, error: _context17.t0 }, (0, _errors.logError)(_context17.t0)(dispatch)]), getState);
return _context17.abrupt('return', null);
case 13:
_context17.t1 = dispatch;
_context17.t2 = _reduxBatchedActions.batchActions;
_context17.t3 = _action_types.ChannelTypes.RECEIVED_CHANNELS;
_context17.t4 = teamId;
_context17.next = 19;
return channels;
case 19:
_context17.t5 = _context17.sent;
_context17.t6 = {
type: _context17.t3,
teamId: _context17.t4,
data: _context17.t5
};
_context17.t7 = {
type: _action_types.ChannelTypes.GET_CHANNELS_SUCCESS
};
_context17.t8 = [_context17.t6, _context17.t7];
_context17.t9 = (0, _context17.t2)(_context17.t8);
_context17.t10 = getState;
(0, _context17.t1)(_context17.t9, _context17.t10);
return _context17.abrupt('return', channels);
case 27:
case 'end':
return _context17.stop();
}
}
}, _callee17, _this17, [[2, 8]]);
}));
return function (_x38, _x39) {
return _ref17.apply(this, arguments);
};
}();
}
function searchChannels(teamId, term) {
var _this18 = this;
return function () {
var _ref18 = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee18(dispatch, getState) {
var channels;
return regeneratorRuntime.wrap(function _callee18$(_context18) {
while (1) {
switch (_context18.prev = _context18.next) {
case 0:
dispatch({ type: _action_types.ChannelTypes.GET_CHANNELS_REQUEST }, getState);
channels = void 0;
_context18.prev = 2;
_context18.next = 5;
return _client.Client4.searchChannels(teamId, term);
case 5:
channels = _context18.sent;
_context18.next = 13;
break;
case 8:
_context18.prev = 8;
_context18.t0 = _context18['catch'](2);
(0, _helpers.forceLogoutIfNecessary)(_context18.t0, dispatch);
dispatch((0, _reduxBatchedActions.batchActions)([{ type: _action_types.ChannelTypes.GET_CHANNELS_FAILURE, error: _context18.t0 }, (0, _errors.logError)(_context18.t0)(dispatch)]), getState);
return _context18.abrupt('return', null);
case 13:
_context18.t1 = dispatch;
_context18.t2 = _reduxBatchedActions.batchActions;
_context18.t3 = _action_types.ChannelTypes.RECEIVED_CHANNELS;
_context18.t4 = teamId;
_context18.next = 19;
return channels;
case 19:
_context18.t5 = _context18.sent;
_context18.t6 = {
type: _context18.t3,
teamId: _context18.t4,
data: _context18.t5
};
_context18.t7 = {
type: _action_types.ChannelTypes.GET_CHANNELS_SUCCESS
};
_context18.t8 = [_context18.t6, _context18.t7];
_context18.t9 = (0, _context18.t2)(_context18.t8);
_context18.t10 = getState;
(0, _context18.t1)(_context18.t9, _context18.t10);
return _context18.abrupt('return', channels);
case 27:
case 'end':
return _context18.stop();
}
}
}, _callee18, _this18, [[2, 8]]);
}));
return function (_x40, _x41) {
return _ref18.apply(this, arguments);
};
}();
}
function getChannelStats(channelId) {
var _this19 = this;
return function () {
var _ref19 = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee19(dispatch, getState) {
var stat;
return regeneratorRuntime.wrap(function _callee19$(_context19) {
while (1) {
switch (_context19.prev = _context19.next) {
case 0:
dispatch({ type: _action_types.ChannelTypes.CHANNEL_STATS_REQUEST }, getState);
stat = void 0;
_context19.prev = 2;
_context19.next = 5;
return _client.Client4.getChannelStats(channelId);
case 5:
stat = _context19.sent;
_context19.next = 13;
break;
case 8:
_context19.prev = 8;
_context19.t0 = _context19['catch'](2);
(0, _helpers.forceLogoutIfNecessary)(_context19.t0, dispatch);
dispatch((0, _reduxBatchedActions.batchActions)([{ type: _action_types.ChannelTypes.CHANNEL_STATS_FAILURE, error: _context19.t0 }, (0, _errors.logError)(_context19.t0)(dispatch)]), getState);
return _context19.abrupt('return', null);
case 13:
dispatch((0, _reduxBatchedActions.batchActions)([{
type: _action_types.ChannelTypes.RECEIVED_CHANNEL_STATS,
data: stat
}, {
type: _action_types.ChannelTypes.CHANNEL_STATS_SUCCESS
}]), getState);
return _context19.abrupt('return', stat);
case 15:
case 'end':
return _context19.stop();
}
}
}, _callee19, _this19, [[2, 8]]);
}));
return function (_x42, _x43) {
return _ref19.apply(this, arguments);
};
}();
}
function addChannelMember(channelId, userId) {
var _this20 = this;
return function () {
var _ref20 = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee20(dispatch, getState) {
var member;
return regeneratorRuntime.wrap(function _callee20$(_context20) {
while (1) {
switch (_context20.prev = _context20.next) {
case 0:
dispatch({ type: _action_types.ChannelTypes.ADD_CHANNEL_MEMBER_REQUEST }, getState);
member = void 0;
_context20.prev = 2;
_context20.next = 5;
return _client.Client4.addToChannel(userId, channelId);
case 5:
member = _context20.sent;
_context20.next = 13;
break;
case 8:
_context20.prev = 8;
_context20.t0 = _context20['catch'](2);
(0, _helpers.forceLogoutIfNecessary)(_context20.t0, dispatch);
dispatch((0, _reduxBatchedActions.batchActions)([{ type: _action_types.ChannelTypes.ADD_CHANNEL_MEMBER_FAILURE, error: _context20.t0 }, (0, _errors.logError)(_context20.t0)(dispatch)]), getState);
return _context20.abrupt('return', null);
case 13:
dispatch((0, _reduxBatchedActions.batchActions)([{
type: _action_types.UserTypes.RECEIVED_PROFILE_IN_CHANNEL,
data: { user_id: userId },
id: channelId
}, {
type: _action_types.ChannelTypes.RECEIVED_CHANNEL_MEMBER,
data: member
}, {
type: _action_types.ChannelTypes.ADD_CHANNEL_MEMBER_SUCCESS,
id: channelId
}], 'ADD_CHANNEL_MEMBER.BATCH'), getState);
return _context20.abrupt('return', member);
case 15:
case 'end':
return _context20.stop();
}
}
}, _callee20, _this20, [[2, 8]]);
}));
return function (_x44, _x45) {
return _ref20.apply(this, arguments);
};
}();
}
function removeChannelMember(channelId, userId) {
var _this21 = this;
return function () {
var _ref21 = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee21(dispatch, getState) {
return regeneratorRuntime.wrap(function _callee21$(_context21) {
while (1) {
switch (_context21.prev = _context21.next) {
case 0:
dispatch({ type: _action_types.ChannelTypes.REMOVE_CHANNEL_MEMBER_REQUEST }, getState);
_context21.prev = 1;
_context21.next = 4;
return _client.Client4.removeFromChannel(userId, channelId);
case 4:
_context21.next = 11;
break;
case 6:
_context21.prev = 6;
_context21.t0 = _context21['catch'](1);
(0, _helpers.forceLogoutIfNecessary)(_context21.t0, dispatch);
dispatch((0, _reduxBatchedActions.batchActions)([{ type: _action_types.ChannelTypes.REMOVE_CHANNEL_MEMBER_FAILURE, error: _context21.t0 }, (0, _errors.logError)(_context21.t0)(dispatch)]), getState);
return _context21.abrupt('return', null);
case 11:
dispatch((0, _reduxBatchedActions.batchActions)([{
type: _action_types.UserTypes.RECEIVED_PROFILE_NOT_IN_CHANNEL,
data: { user_id: userId },
id: channelId
}, {
type: _action_types.ChannelTypes.REMOVE_CHANNEL_MEMBER_SUCCESS,
id: channelId
}], 'REMOVE_CHANNEL_MEMBER.BATCH'), getState);
return _context21.abrupt('return', true);
case 13:
case 'end':
return _context21.stop();
}
}
}, _callee21, _this21, [[1, 6]]);
}));
return function (_x46, _x47) {
return _ref21.apply(this, arguments);
};
}();
}
function updateChannelMemberRoles(channelId, userId, roles) {
var _this22 = this;
return function () {
var _ref22 = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee22(dispatch, getState) {
var actions, membersInChannel;
return regeneratorRuntime.wrap(function _callee22$(_context22) {
while (1) {
switch (_context22.prev = _context22.next) {
case 0:
dispatch({ type: _action_types.ChannelTypes.UPDATE_CHANNEL_MEMBER_REQUEST }, getState);
_context22.prev = 1;
_context22.next = 4;
return _client.Client4.updateChannelMemberRoles(channelId, userId, roles);
case 4:
_context22.next = 11;
break;
case 6:
_context22.prev = 6;
_context22.t0 = _context22['catch'](1);
(0, _helpers.forceLogoutIfNecessary)(_context22.t0, dispatch);
dispatch((0, _reduxBatchedActions.batchActions)([{ type: _action_types.ChannelTypes.UPDATE_CHANNEL_MEMBER_FAILURE, error: _context22.t0 }, (0, _errors.logError)(_context22.t0)(dispatch)]), getState);
return _context22.abrupt('return', null);
case 11:
actions = [{
type: _action_types.ChannelTypes.UPDATE_CHANNEL_MEMBER_SUCCESS
}];
membersInChannel = getState().entities.channels.membersInChannel[channelId];
if (membersInChannel && membersInChannel[userId]) {
actions.push({
type: _action_types.ChannelTypes.RECEIVED_CHANNEL_MEMBER,
data: _extends({}, membersInChannel[userId], { roles: roles })
});
}
dispatch((0, _reduxBatchedActions.batchActions)(actions), getState);
return _context22.abrupt('return', true);
case 16:
case 'end':
return _context22.stop();
}
}
}, _callee22, _this22, [[1, 6]]);
}));
return function (_x48, _x49) {
return _ref22.apply(this, arguments);
};
}();
}
function updateChannelHeader(channelId, header) {
var _this23 = this;
return function () {
var _ref23 = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee23(dispatch, getState) {
return regeneratorRuntime.wrap(function _callee23$(_context23) {
while (1) {
switch (_context23.prev = _context23.next) {
case 0:
_client.Client4.trackEvent('action', 'action_channels_update_header', { channel_id: channelId });
dispatch({
type: _action_types.ChannelTypes.UPDATE_CHANNEL_HEADER,
data: {
channelId: channelId,
header: header
}
}, getState);
case 2:
case 'end':
return _context23.stop();
}
}
}, _callee23, _this23);
}));
return function (_x50, _x51) {
return _ref23.apply(this, arguments);
};
}();
}
function updateChannelPurpose(channelId, purpose) {
var _this24 = this;
return function () {
var _ref24 = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee24(dispatch, getState) {
return regeneratorRuntime.wrap(function _callee24$(_context24) {
while (1) {
switch (_context24.prev = _context24.next) {
case 0:
_client.Client4.trackEvent('action', 'action_channels_update_purpose', { channel_id: channelId });
dispatch({
type: _action_types.ChannelTypes.UPDATE_CHANNEL_PURPOSE,
data: {
channelId: channelId,
purpose: purpose
}
}, getState);
case 2:
case 'end':
return _context24.stop();
}
}
}, _callee24, _this24);
}));
return function (_x52, _x53) {
return _ref24.apply(this, arguments);
};
}();
}
function markChannelAsRead(channelId, prevChannelId) {
var _this25 = this;
return function () {
var _ref25 = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee25(dispatch, getState) {
var state, teamMembers, _state$entities$chann2, channels, myMembers, channel, channelMember, actions, totalMsgCount, teamMember, teamMsgCount, prevChannel, prevChannelMember, prevTotalMsgCount, _teamMsgCount;
return regeneratorRuntime.wrap(function _callee25$(_context25) {
while (1) {
switch (_context25.prev = _context25.next) {
case 0:
state = getState();
teamMembers = state.entities.teams.myMembers;
_state$entities$chann2 = state.entities.channels, channels = _state$entities$chann2.channels, myMembers = _state$entities$chann2.myMembers;
channel = channels[channelId];
channelMember = myMembers[channelId];
actions = [];
totalMsgCount = 0;
teamMember = void 0;
if (channel && channelMember) {
totalMsgCount = channel.total_msg_count;
if (channel.team_id) {
teamMember = _extends({}, teamMembers[channel.team_id]);
teamMember.mention_count = teamMember.mention_count - channelMember.mention_count;
teamMsgCount = 0;
if (totalMsgCount) {
teamMsgCount = totalMsgCount - channelMember.msg_count;
}
teamMember.msg_count = teamMember.msg_count - teamMsgCount;
}
actions.push({
type: _action_types.ChannelTypes.RECEIVED_LAST_VIEWED,
data: {
channel_id: channelId,
last_viewed_at: channelMember.last_viewed_at,
total_msg_count: totalMsgCount
}
});
}
if (prevChannelId && channelId !== prevChannelId) {
prevChannel = channels[prevChannelId];
prevChannelMember = myMembers[prevChannelId];
prevTotalMsgCount = 0;
if (prevChannel && prevChannelMember) {
prevTotalMsgCount = prevChannel.total_msg_count;
if (prevChannel.team_id) {
// if the channel is a GM or DM we don't have the teamMember
if (!teamMember) {
teamMember = _extends({}, teamMembers[prevChannel.team_id]);
}
teamMember.mention_count = teamMember.mention_count - prevChannelMember.mention_count;
_teamMsgCount = 0;
if (prevTotalMsgCount) {
_teamMsgCount = prevTotalMsgCount - prevChannelMember.msg_count;
}
teamMember.msg_count = teamMember.msg_count - _teamMsgCount;
}
actions.push({
type: _action_types.ChannelTypes.RECEIVED_LAST_VIEWED,
data: {
channel_id: prevChannelId,
last_viewed_at: new Date().getTime(),
total_msg_count: prevTotalMsgCount
}
});
}
}
if (teamMember) {
actions.push({
type: _action_types.TeamTypes.RECEIVED_MY_TEAM_UNREADS,
data: [teamMember]
});
}
if (actions.length) {
dispatch((0, _reduxBatchedActions.batchActions)([].concat(actions)), getState);
}
case 12:
case 'end':
return _context25.stop();
}
}
}, _callee25, _this25);
}));
return function (_x54, _x55) {
return _ref25.apply(this, arguments);
};
}();
}
function markChannelAsUnread(teamId, channelId, mentionsArray) {
var _this26 = this;
return function () {
var _ref26 = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee26(dispatch, getState) {
var state, _state$entities$chann3, channels, myMembers, teamMembers, currentUserId, actions, wasMentioned, mentions, channel, member, teamMember;
return regeneratorRuntime.wrap(function _callee26$(_context26) {
while (1) {
switch (_context26.prev = _context26.next) {
case 0:
state = getState();
_state$entities$chann3 = state.entities.channels, channels = _state$entities$chann3.channels, myMembers = _state$entities$chann3.myMembers;
teamMembers = state.entities.teams.myMembers;
currentUserId = state.entities.users.currentUserId;
actions = [];
wasMentioned = false;
if (mentionsArray) {
mentions = JSON.parse(mentionsArray);
if (mentions.indexOf(currentUserId) !== -1) {
wasMentioned = true;
}
}
// if we have the channel and the channel member in the store
if (channels[channelId] && myMembers[channelId]) {
channel = _extends({}, channels[channelId]);
member = _extends({}, myMembers[channelId]);
channel.total_msg_count++;
if (member.notify_props && member.notify_props.mark_unread === _constants.General.MENTION) {
member.msg_count++;
}
if (wasMentioned) {
member.mention_count++;
}
actions.push({
type: _action_types.ChannelTypes.RECEIVED_MY_CHANNEL_MEMBER,
data: member
}, {
type: _action_types.ChannelTypes.RECEIVED_CHANNEL,
data: channel
});
}
if (teamId) {
teamMember = _extends({}, teamMembers[teamId]);
teamMember.msg_count++;
if (wasMentioned) {
teamMember.mention_count++;
}
actions.push({
type: _action_types.TeamTypes.RECEIVED_MY_TEAM_UNREADS,
data: [teamMember]
});
}
if (actions.length) {
dispatch((0, _reduxBatchedActions.batchActions)(actions), getState);
}
case 10:
case 'end':
return _context26.stop();
}
}
}, _callee26, _this26);
}));
return function (_x56, _x57) {
return _ref26.apply(this, arguments);
};
}();
}
function getChannelMembersByIds(channelId, userIds) {
return (0, _helpers.bindClientFunc)(_client.Client4.getChannelMembersByIds, _action_types.ChannelTypes.CHANNEL_MEMBERS_REQUEST, [_action_types.ChannelTypes.RECEIVED_CHANNEL_MEMBERS, _action_types.ChannelTypes.CHANNEL_MEMBERS_SUCCESS], _action_types.ChannelTypes.CHANNEL_MEMBERS_FAILURE, channelId, userIds);
}
function getChannelMember(channelId, userId) {
return (0, _helpers.bindClientFunc)(_client.Client4.getChannelMember, _action_types.ChannelTypes.CHANNEL_MEMBERS_REQUEST, [_action_types.ChannelTypes.RECEIVED_CHANNEL_MEMBER, _action_types.ChannelTypes.CHANNEL_MEMBERS_SUCCESS], _action_types.ChannelTypes.CHANNEL_MEMBERS_FAILURE, channelId, userId);
}
function getMyChannelMember(channelId) {
return (0, _helpers.bindClientFunc)(_client.Client4.getMyChannelMember, _action_types.ChannelTypes.CHANNEL_MEMBERS_REQUEST, [_action_types.ChannelTypes.RECEIVED_MY_CHANNEL_MEMBER, _action_types.ChannelTypes.CHANNEL_MEMBERS_SUCCESS], _action_types.ChannelTypes.CHANNEL_MEMBERS_FAILURE, channelId);
}
exports.default = {
selectChannel: selectChannel,
createChannel: createChannel,
createDirectChannel: createDirectChannel,
updateChannel: updateChannel,
patchChannel: patchChannel,
updateChannelNotifyProps: updateChannelNotifyProps,
getChannel: getChannel,
fetchMyChannelsAndMembers: fetchMyChannelsAndMembers,
getMyChannelMembers: getMyChannelMembers,
getChannelMembersByIds: getChannelMembersByIds,
leaveChannel: leaveChannel,
joinChannel: joinChannel,
deleteChannel: deleteChannel,
viewChannel: viewChannel,
getChannels: getChannels,
searchChannels: searchChannels,
getChannelStats: getChannelStats,
addChannelMember: addChannelMember,
removeChannelMember: removeChannelMember,
updateChannelHeader: updateChannelHeader,
updateChannelPurpose: updateChannelPurpose,
markChannelAsRead: markChannelAsRead,
markChannelAsUnread: markChannelAsUnread
};
|
import * as _ from 'underscore';
import PromiseRejectionError from '@/lib/promise-rejection-error';
import { durationHumanize } from '@/filters';
import template from './dashboard.html';
import shareDashboardTemplate from './share-dashboard.html';
import './dashboard.less';
function isWidgetPositionChanged(oldPosition, newPosition) {
const fields = ['col', 'row', 'sizeX', 'sizeY', 'autoHeight'];
oldPosition = _.pick(oldPosition, fields);
newPosition = _.pick(newPosition, fields);
return !!_.find(fields, key => newPosition[key] !== oldPosition[key]);
}
function getWidgetsWithChangedPositions(widgets) {
return _.filter(widgets, (widget) => {
if (!_.isObject(widget.$originalPosition)) {
return true;
}
return isWidgetPositionChanged(widget.$originalPosition, widget.options.position);
});
}
function DashboardCtrl(
$rootScope,
$routeParams,
$location,
$timeout,
$q,
$uibModal,
Title,
AlertDialog,
Dashboard,
currentUser,
clientConfig,
Events,
toastr,
Policy,
) {
this.saveInProgress = false;
const saveDashboardLayout = (widgets) => {
if (!this.dashboard.canEdit()) {
return;
}
this.saveInProgress = true;
const showMessages = true;
return $q
.all(_.map(widgets, widget => widget.save()))
.then(() => {
if (showMessages) {
toastr.success('Changes saved.');
}
// Update original widgets positions
_.each(widgets, (widget) => {
_.extend(widget.$originalPosition, widget.options.position);
});
})
.catch(() => {
if (showMessages) {
toastr.error('Error saving changes.');
}
})
.finally(() => {
this.saveInProgress = false;
});
};
this.layoutEditing = false;
this.isFullscreen = false;
this.refreshRate = null;
this.isGridDisabled = false;
this.updateGridItems = null;
this.showPermissionsControl = clientConfig.showPermissionsControl;
this.globalParameters = [];
this.refreshRates = clientConfig.dashboardRefreshIntervals.map(interval => ({
name: durationHumanize(interval),
rate: interval,
enabled: true,
}));
const allowedIntervals = Policy.getDashboardRefreshIntervals();
if (_.isArray(allowedIntervals)) {
_.each(this.refreshRates, (rate) => {
rate.enabled = allowedIntervals.indexOf(rate.rate) >= 0;
});
}
this.setRefreshRate = (rate, load = true) => {
this.refreshRate = rate;
if (rate !== null) {
if (load) {
this.refreshDashboard();
}
this.autoRefresh();
}
};
this.extractGlobalParameters = () => {
let globalParams = {};
this.dashboard.widgets.forEach((widget) => {
if (widget.getQuery()) {
widget
.getQuery()
.getParametersDefs()
.filter(p => p.global)
.forEach((param) => {
const defaults = {};
defaults[param.name] = _.create(Object.getPrototypeOf(param), param);
defaults[param.name].locals = [];
globalParams = _.defaults(globalParams, defaults);
globalParams[param.name].locals.push(param);
});
}
});
this.globalParameters = _.values(globalParams);
};
this.onGlobalParametersChange = () => {
this.globalParameters.forEach((global) => {
global.locals.forEach((local) => {
local.value = global.value;
});
});
};
const collectFilters = (dashboard, forceRefresh) => {
const queryResultPromises = _.compact(this.dashboard.widgets.map(widget => widget.load(forceRefresh)));
$q.all(queryResultPromises).then((queryResults) => {
const filters = {};
queryResults.forEach((queryResult) => {
const queryFilters = queryResult.getFilters();
queryFilters.forEach((queryFilter) => {
const hasQueryStringValue = _.has($location.search(), queryFilter.name);
if (!(hasQueryStringValue || dashboard.dashboard_filters_enabled)) {
// If dashboard filters not enabled, or no query string value given,
// skip filters linking.
return;
}
if (hasQueryStringValue) {
queryFilter.current = $location.search()[queryFilter.name];
}
if (!_.has(filters, queryFilter.name)) {
const filter = _.extend({}, queryFilter);
filters[filter.name] = filter;
filters[filter.name].originFilters = [];
}
// TODO: merge values.
filters[queryFilter.name].originFilters.push(queryFilter);
});
});
this.filters = _.values(filters);
this.filtersOnChange = (filter) => {
_.each(filter.originFilters, (originFilter) => {
originFilter.current = filter.current;
});
};
});
};
const renderDashboard = (dashboard, force) => {
Title.set(dashboard.name);
this.extractGlobalParameters();
collectFilters(dashboard, force);
};
this.loadDashboard = _.throttle((force) => {
Dashboard.get(
{ slug: $routeParams.dashboardSlug },
(dashboard) => {
this.dashboard = dashboard;
Events.record('view', 'dashboard', dashboard.id);
renderDashboard(dashboard, force);
if ($location.search().edit === true) {
$location.search('edit', null);
this.editLayout(true);
}
if ($location.search().refresh !== undefined) {
if (this.refreshRate === null) {
const refreshRate = Math.max(30, parseFloat($location.search().refresh));
this.setRefreshRate(
{
name: durationHumanize(refreshRate),
rate: refreshRate,
},
false,
);
}
}
},
(rejection) => {
const statusGroup = Math.floor(rejection.status / 100);
if (statusGroup === 5) {
// recoverable errors - all 5** (server is temporarily unavailable
// for some reason, but it should get up soon).
this.loadDashboard();
} else {
// all kind of 4** errors are not recoverable, so just display them
throw new PromiseRejectionError(rejection);
}
},
);
}, 1000);
this.loadDashboard();
this.refreshDashboard = () => {
renderDashboard(this.dashboard, true);
};
this.autoRefresh = () => {
$timeout(() => {
this.refreshDashboard();
}, this.refreshRate.rate * 1000).then(() => this.autoRefresh());
};
this.archiveDashboard = () => {
const archive = () => {
Events.record('archive', 'dashboard', this.dashboard.id);
this.dashboard.$delete(() => {
$rootScope.$broadcast('reloadDashboards');
});
};
const title = 'Archive Dashboard';
const message = `Are you sure you want to archive the "${this.dashboard.name}" dashboard?`;
const confirm = { class: 'btn-warning', title: 'Archive' };
AlertDialog.open(title, message, confirm).then(archive);
};
this.showManagePermissionsModal = () => {
$uibModal.open({
component: 'permissionsEditor',
resolve: {
aclUrl: { url: `api/dashboards/${this.dashboard.id}/acl` },
},
});
};
this.editLayout = (enableEditing, applyChanges) => {
if (!this.isGridDisabled) {
if (!enableEditing) {
if (applyChanges) {
const changedWidgets = getWidgetsWithChangedPositions(this.dashboard.widgets);
saveDashboardLayout(changedWidgets);
} else {
// Revert changes
const items = {};
_.each(this.dashboard.widgets, (widget) => {
_.extend(widget.options.position, widget.$originalPosition);
items[widget.id] = widget.options.position;
});
this.dashboard.widgets = Dashboard.prepareWidgetsForDashboard(this.dashboard.widgets);
if (this.updateGridItems) {
this.updateGridItems(items);
}
}
}
this.layoutEditing = enableEditing;
}
};
this.saveName = () => {
Dashboard.save(
{ slug: this.dashboard.id, version: this.dashboard.version, name: this.dashboard.name },
(dashboard) => {
this.dashboard = dashboard;
$rootScope.$broadcast('reloadDashboards');
},
(error) => {
if (error.status === 403) {
toastr.error('Name update failed: Permission denied.');
} else if (error.status === 409) {
toastr.error(
'It seems like the dashboard has been modified by another user. ' +
'Please copy/backup your changes and reload this page.',
{ autoDismiss: false },
);
}
},
);
};
this.updateDashboardFiltersState = () => {
collectFilters(this.dashboard, false);
Dashboard.save(
{
slug: this.dashboard.id,
version: this.dashboard.version,
dashboard_filters_enabled: this.dashboard.dashboard_filters_enabled,
},
(dashboard) => {
this.dashboard = dashboard;
},
(error) => {
if (error.status === 403) {
toastr.error('Name update failed: Permission denied.');
} else if (error.status === 409) {
toastr.error(
'It seems like the dashboard has been modified by another user. ' +
'Please copy/backup your changes and reload this page.',
{ autoDismiss: false },
);
}
},
);
};
this.addWidget = () => {
$uibModal
.open({
component: 'addWidgetDialog',
resolve: {
dashboard: () => this.dashboard,
},
})
.result.then(() => {
this.extractGlobalParameters();
// Save position of newly added widget (but not entire layout)
const widget = _.last(this.dashboard.widgets);
if (_.isObject(widget)) {
return widget.save();
}
});
};
this.removeWidget = (widgetId) => {
this.dashboard.widgets = this.dashboard.widgets.filter(w => w.id !== undefined && w.id !== widgetId);
this.extractGlobalParameters();
if (!this.layoutEditing) {
// We need to wait a bit while `angular` updates widgets, and only then save new layout
$timeout(() => {
const changedWidgets = getWidgetsWithChangedPositions(this.dashboard.widgets);
saveDashboardLayout(changedWidgets);
}, 50);
}
};
this.toggleFullscreen = () => {
this.isFullscreen = !this.isFullscreen;
document.querySelector('body').classList.toggle('headless');
if (this.isFullscreen) {
$location.search('fullscreen', true);
} else {
$location.search('fullscreen', null);
}
};
this.togglePublished = () => {
Events.record('toggle_published', 'dashboard', this.dashboard.id);
this.dashboard.is_draft = !this.dashboard.is_draft;
this.saveInProgress = true;
Dashboard.save(
{
slug: this.dashboard.id,
name: this.dashboard.name,
is_draft: this.dashboard.is_draft,
},
(dashboard) => {
this.saveInProgress = false;
this.dashboard.version = dashboard.version;
$rootScope.$broadcast('reloadDashboards');
},
);
};
if (_.has($location.search(), 'fullscreen')) {
this.toggleFullscreen();
}
this.openShareForm = () => {
$uibModal.open({
component: 'shareDashboard',
resolve: {
dashboard: this.dashboard,
},
});
};
}
const ShareDashboardComponent = {
template: shareDashboardTemplate,
bindings: {
resolve: '<',
close: '&',
dismiss: '&',
},
controller($http) {
'ngInject';
this.dashboard = this.resolve.dashboard;
this.toggleSharing = () => {
const url = `api/dashboards/${this.dashboard.id}/share`;
if (!this.dashboard.publicAccessEnabled) {
// disable
$http
.delete(url)
.success(() => {
this.dashboard.publicAccessEnabled = false;
delete this.dashboard.public_url;
})
.error(() => {
this.dashboard.publicAccessEnabled = true;
// TODO: show message
});
} else {
$http
.post(url)
.success((data) => {
this.dashboard.publicAccessEnabled = true;
this.dashboard.public_url = data.public_url;
})
.error(() => {
this.dashboard.publicAccessEnabled = false;
// TODO: show message
});
}
};
},
};
export default function init(ngModule) {
ngModule.component('shareDashboard', ShareDashboardComponent);
ngModule.component('dashboardPage', {
template,
controller: DashboardCtrl,
});
return {
'/dashboard/:dashboardSlug': {
template: '<dashboard-page></dashboard-page>',
reloadOnSearch: false,
},
};
}
|
import reducer from "../../src/reducers/BeaconsReducer";
import { BeaconActionTypes, ApiActionTypes } from "../../src/actions/actionsTypes";
describe("Beacons reducer", ()=>{
test("should handle beacons changes", ()=> {
// Given
const beacons = [{
uuid: "8de6b7d6-c74f-4646-a733-6652878626da",
major: 42,
minor: 33,
distance: 30
},{
uuid: "8de6b7d6-c74f-4646-a733-6652878626da",
major: 42,
minor: 34,
distance: 25
}];
const action = {
type: BeaconActionTypes.ACTION_BEACON_DID_RANGE,
payload: beacons
}
// When
const actualState = reducer({beacons: [] }, action);
// Then
expect(actualState.beacons).toContainEqual({id: "8de6b7d6-c74f-4646-a733-6652878626da|42|33", distance: 30});
expect(actualState.beacons).toContainEqual({id: "8de6b7d6-c74f-4646-a733-6652878626da|42|34", distance: 25});
})
test("should handle stations receiving", ()=> {
// Given
const stations = [
{
"id": 1,
"name": "Java Quiz!!",
"type": "MASTER",
"beacon": {
"major": "0",
"minor": "0",
"uid": "57e32541-db1f-43c9-8e5f-1735f7e209e3"
},
"quizId": 1
},
{
"id": 2,
"name": "Some Offline Game",
"type": "STATION",
"beacon": {
"major": "0",
"minor": "0",
"uid": "cf163457-be37-49e8-b73b-35029146284b"
},
"quizId": null
}
];
const action = {
type: ApiActionTypes.GET_ALL_STATIONS_SUCCESS,
payload: stations
}
// When
const actualState = reducer({stations: {} }, action);
// Then
expect(actualState.stations["57e32541-db1f-43c9-8e5f-1735f7e209e3|0|0"]).toEqual(stations[0]);
expect(actualState.stations["cf163457-be37-49e8-b73b-35029146284b|0|0"]).toEqual(stations[1]);
})
});
|
define({
"_widgetLabel": "Truy tìm Mạng",
"configError": "Tiện ích không được cấu hình đúng.",
"geometryServiceURLNotFoundMSG": "Không thể nhận URL Dịch vụ hình học",
"clearButtonValue": "Xóa",
"GPExecutionFailed": "Không thể hoàn thành truy tìm. Vui lòng thử lại.",
"backButtonValue": "Quay lại",
"exportToCSVSuccess": "Xuất sang CSV được hoàn tất thành công.",
"lblInputLocTab": "Nhập Vị trí",
"lblBlockLocTab": "Chặn Vị trí",
"lblInputLocation": "Nhập Đối tượng",
"lblBlockLocation": "Chặn Đối tượng",
"lblInputLocHeader": "Nhập Vị trí (0)",
"lblBlockLocHeader": "Chặn Vị trí (0)",
"inputTabTitle": "Đầu vào",
"outputTabTitle": "Đầu ra",
"exportSelectAllCheckBoxLabel": "Chọn Tất cả",
"lblSkipLocHeader": "Bỏ qua Vị trí (0)",
"lblSkipLocation": "Vị trí",
"lblSkipLocTab": "Bỏ qua Vị trí",
"skipAllLocationButtonLabel": "Bỏ qua Tất cả Vị trí",
"confirmSkipAllLocationsMessage": "Tất cả các vị trí sẽ được bỏ qua, bạn có muốn tiếp tục?",
"locationAlreadySkippedMessage": "Vị trí đã bị bỏ qua",
"removeAllSkipLocationLabel": "Loại bỏ Tất cả",
"newProjectOptionText": "Dự án mới",
"selectProject": "Chọn dự án",
"saveButtonLabel": "Lưu",
"exportToCSVText": "Xuất ra CSV",
"editProjectAttributesToolTip": "Chỉnh sửa Thuộc tính Dự án",
"projectNameLabel": "Tên dự án",
"saveProjectPopupTitle": "Lưu",
"saveAsLabel": "Lưu thành",
"saveChangesMsg": "Bạn muốn lưu các thay đổi vào <b>${loadProjectDropdownlabel}</b> hoặc lưu thành dự án mới?",
"creatingNewProjectErrorMessage": "Lỗi xảy ra khi tạo dự án mới. Vui lòng thử lại.",
"projectNameFetchingErr": "Lỗi xảy ra khi tìm nạp tên dự án hiện có. Vui lòng thử lại.",
"projectAttributeLoadingErr": "Lỗi xảy ra khi tải thuộc tính dự án. Vui lòng thử lại.",
"attributeUpdatedMsg": "Cập nhật thuộc tính thành công.",
"projectAttributeUpdatingErr": "Lỗi xảy ra khi cập nhật thuộc tính dự án.",
"loadingProjectDetailsErrorMessage": "Lỗi xảy ra khi tìm nạp cờ, rào cản và bỏ qua vị trí. Vui lòng thử lại.",
"savingProjectDetailsErr": "Lỗi xảy ra khi lưu chi tiết dự án. Vui lòng thử lưu lại dự án.",
"updatingOutagePolygonErr": "Lỗi xảy ra khi cập nhật vùng mất điện. Vui lòng thử lưu lại dự án.",
"deletingExistingPolygonErr": "Lỗi xảy ra khi xóa vùng mất điện hiện tại. Vui lòng thử lưu lại dự án.",
"loadingProjectFeaturesErr": "Lỗi xảy ra khi tải đối tượng dự án. Vui lòng thử tải dự án một lần nữa.",
"addingProjectFeaturesErr": "Lỗi xảy ra khi thêm đối tượng dự án. Vui lòng thử lưu lại dự án.",
"deletingExistingProjectFeaturesErr": "Lỗi xảy ra khi xóa đối tượng dự án hiện tại. Vui lòng thử lưu lại dự án.",
"projectNotFoundErr": "Không tìm thấy dự án",
"projectLayersNotFound": "Các lớp cài đặt Dự án đã cấu hình không có sẵn trong bản đồ. Tiện ích sẽ được tải trong 'Chế độ phác họa'.",
"fetchingOutagePolygonMessage": "Lỗi xảy ra khi tìm nạp vùng mất điện. Vui lòng thử tải dự án một lần nữa.",
"projectNameExistsMessage": "Tên dự án đã tồn tại. Vui lòng sử dụng tên dự án duy nhất.",
"fetchingProjectNamesErrorMessage": "Lỗi xảy ra khi tìm nạp tên dự án hiện có. Vui lòng thử lưu lại dự án.",
"enterProjectNameMessage": "Vui lòng nhập tên dự án.",
"projectLengthErrorMessage": "Tên dự án không được nhiều hơn",
"gpServiceNotAccessible": "Tài khoản của bạn không có quyền truy cập vào dịch vụ cần thiết để thực hiện truy tìm này.",
"loadingClonedLayerErrorMessage": "Lỗi xảy ra khi tải lớp đối tượng nhân bản. Vui lòng thử lại.",
"addingFeatureInClonedLayerError": "Lỗi xảy ra khi thêm đồ họa vào lớp đối tượng nhân bản. Vui lòng thử lại.",
"selectingFeatureInClonedLayerError": "Lỗi xảy ra khi chọn đồ họa trong lớp đối tượng nhân bản. Vui lòng thử lại.",
"filteredProjectError": "Lỗi xảy ra khi kiểm tra quá trình tìm nạp chi tiết dự án được lọc. Vui lòng thử lại.",
"filteredProjectMessage": "Các thuộc tính dự án đã chọn không có sẵn do việc áp dụng các bộ lọc từ bản đồ web hoặc tiện ích khác. Xóa (các) bộ lọc và thử lại.",
"filteredProjectLoadMessage": "Dự án của bạn không còn nữa. Vui lòng chọn một dự án đang hoạt động.",
"defaultValueForRunButton": "Chạy",
"closeButtonLabel": "Gỡ bỏ"
});
|
const {createCanvas, canvasToImg, dpr} = require('./lib/dom');
const defaults = require('./lib/defaults');
const qrcode = require('./lib/qrcode');
const draw = require('./lib/draw');
module.exports = options => {
const settings = Object.assign({}, defaults, options);
const qr = qrcode(settings.text, settings.eclevel, settings.minversion, settings.quiet);
const ratio = settings.ratio || dpr;
const canvas = createCanvas(settings.size, ratio, settings.width);
const context = canvas.getContext('2d');
context.scale(ratio, ratio);
draw(qr, context, settings);
return settings.render === 'image' ? canvasToImg(canvas) : canvas;
};
|
'use strict';
function evaluateBinary(node) {
const op = node.operator;
const left = evaluateConst(node.left);
const right = evaluateConst(node.right);
if (op === '+')
return left + right;
throw new Error(`Unsupported binary operation: "${op}"`);
}
function evaluateConst(node) {
if (node.type === 'Literal')
return node.value;
if (node.type === 'BinaryExpression')
return evaluateBinary(node);
throw new Error(`Unsupported node type: "${node.type}"`);
}
module.exports = evaluateConst;
|
import React, { Component } from 'react';
import PropTypes from 'prop-types';
import '../styles/App.css';
import ScrollableFeed from 'react-scrollable-feed';
import styles from '../styles/conversation.module.css';
import Message from './Message';
import CheckBoxOptionsContainer from './CheckBoxOptionsContainer';
import RadioButtonOptionsContainer from './RadioButtonOptionsContainer';
import TextInput from './TextInput';
import Resource from './Resource';
import botAvatar from '../assets/catbot.png';
const uuidv4 = require('uuid/v4');
class Conversation extends Component {
componentDidMount() {
const { initialBotMessageHandler } = this.props;
initialBotMessageHandler();
}
componentDidUpdate() {
const { queueNextMessage } = this.props;
queueNextMessage();
}
renderMessage = (currentMessage, inputHandler, lang) => {
const message = [];
if (currentMessage.sender === 'bot') {
message.push(
<div key={uuidv4()} className={styles.botAvatarAndMessageContainer}>
<img key={uuidv4()} alt="Bot Avatar" src={botAvatar} className={styles.botAvatar} />
<Message key={uuidv4()} text={currentMessage.text} sender={currentMessage.sender} />
</div>,
);
} else {
message.push(
<div key={uuidv4()} className={styles.userMessageContainer}>
<Message key={uuidv4()} text={currentMessage.text} sender={currentMessage.sender} />
</div>,
);
}
if (currentMessage.resources && currentMessage.resources.length > 0) {
currentMessage.resources.forEach((resource) => {
message.push(
<Resource
key={uuidv4()}
text={resource.text}
link={resource.link}
lang={lang}
/>,
);
});
}
if (currentMessage.checkBoxOptions && currentMessage.checkBoxOptions.length > 0) {
message.push(
<CheckBoxOptionsContainer
key={uuidv4()}
message={currentMessage}
inputHandler={inputHandler}
/>,
);
}
if (currentMessage.radioButtonOptions && currentMessage.radioButtonOptions.length > 0) {
message.push(
<RadioButtonOptionsContainer
key={uuidv4()}
message={currentMessage}
inputHandler={inputHandler}
/>,
);
}
return message;
}
render() {
const {
displayedMessages, inputHandler, minimised, lang,
} = this.props;
const nextUserAction = displayedMessages.slice(-1)[0]
? displayedMessages.slice(-1)[0].nextUserAction : 'wait';
return (
<div className={`${minimised ? styles.minimised : ''} ${styles.container}`}>
<ScrollableFeed forceScroll className={styles.messagesContainer}>
{displayedMessages.map((message) => this.renderMessage(message, inputHandler, lang))}
{ nextUserAction === 'wait'
? (
<div className={styles.botAvatarAndMessageContainer}>
<img
key={uuidv4()}
src={botAvatar}
className={styles.botAvatar}
alt="Bot Avatar"
/>
<Message key={uuidv4()} text="" sender="bot" dotty />
</div>
)
: null }
</ScrollableFeed>
<TextInput inputHandler={inputHandler} lang={lang} status={nextUserAction} disabled={nextUserAction !== 'input'} />
</div>
);
}
}
Conversation.propTypes = {
inputHandler: PropTypes.func.isRequired,
initialBotMessageHandler: PropTypes.func.isRequired,
queueNextMessage: PropTypes.func.isRequired,
displayedMessages: PropTypes.arrayOf(PropTypes.object).isRequired,
minimised: PropTypes.bool,
lang: PropTypes.string.isRequired,
};
Conversation.defaultProps = {
minimised: false,
};
export default Conversation;
|
// User data
const wsUrl = 'ws://localhost:1370/';
// Log helper
const log = {
el: document.getElementById('log'),
append(message) {
this.el.append(`${message}\n`);
},
appendData(data) {
this.append(JSON.stringify(data));
}
}
// Api usage example
const api = new AuroraAPI();
api.onOpen = () => {
log.append('Соединение установлено');
}
api.onClose = (e) => {
if (e.wasClean) return log.append('Соединение закрыто');
if (e.code === 1006) log.append('Разрыв соединения');
}
api.onError = () => {
log.append('Ошибка при подключении!');
}
(async () => {
try {
await api.connect(wsUrl);
const test = await api.send('ping');
log.appendData(test);
} catch (error) {
log.appendData(error);
} finally {
api.close();
}
})();
|
var NISLFuzzingFunc = function(toUri) {
var i, parent, len;
idx = 0;
false = this.column;
this.after = train;
var state = this.get("register");
var id = this.addBoundable(img);
if (fit > len >> 0) {
render += "set";
idx = target + 2;
item += remaining.toLength();
} else {
if (idx > len - 1) {
idx = idx < 0 ? av : true;
}
} else {
while (i < signal + 4) {
dest = .7 * ((i >>> 2) + 1);
if (type === "content" || typeof type) {
trace.base($identite.statistive + ":" + items.length + 1);
},
set_each: function(str) {
return true;
},
controller: function() {
return "Nul_tt" + str.slide_ + "";
},
string: {
stroke: "",;
var NISLParameter0 = -2669721;
NISLFuzzingFunc(NISLParameter0);
|
var _ = require('lodash'),
Promise = require('bluebird'),
config = require('../../config'),
schema = require('../schema').tables,
clients = require('./clients'),
dbConfig;
function addTableColumn(tablename, table, columnname) {
var column,
columnSpec = schema[tablename][columnname];
// creation distinguishes between text with fieldtype, string with maxlength and all others
if (columnSpec.type === 'text' && columnSpec.hasOwnProperty('fieldtype')) {
column = table[columnSpec.type](columnname, columnSpec.fieldtype);
} else if (columnSpec.type === 'string' && columnSpec.hasOwnProperty('maxlength')) {
column = table[columnSpec.type](columnname, columnSpec.maxlength);
} else {
column = table[columnSpec.type](columnname);
}
if (columnSpec.hasOwnProperty('nullable') && columnSpec.nullable === true) {
column.nullable();
} else {
column.notNullable();
}
if (columnSpec.hasOwnProperty('primary') && columnSpec.primary === true) {
column.primary();
}
if (columnSpec.hasOwnProperty('unique') && columnSpec.unique) {
column.unique();
}
if (columnSpec.hasOwnProperty('unsigned') && columnSpec.unsigned) {
column.unsigned();
}
if (columnSpec.hasOwnProperty('references')) {
// check if table exists?
column.references(columnSpec.references);
}
if (columnSpec.hasOwnProperty('defaultTo')) {
column.defaultTo(columnSpec.defaultTo);
}
}
function addColumn(table, column) {
dbConfig = dbConfig || config.database;
return dbConfig.knex.schema.table(table, function (t) {
addTableColumn(table, t, column);
});
}
function addUnique(table, column) {
dbConfig = dbConfig || config.database;
return dbConfig.knex.schema.table(table, function (table) {
table.unique(column);
});
}
function dropUnique(table, column) {
dbConfig = dbConfig || config.database;
return dbConfig.knex.schema.table(table, function (table) {
table.dropUnique(column);
});
}
function createTable(table) {
dbConfig = dbConfig || config.database;
return dbConfig.knex.schema.createTable(table, function (t) {
var columnKeys = _.keys(schema[table]);
_.each(columnKeys, function (column) {
return addTableColumn(table, t, column);
});
});
}
function deleteTable(table) {
dbConfig = dbConfig || config.database;
return dbConfig.knex.schema.dropTableIfExists(table);
}
function getTables() {
dbConfig = dbConfig || config.database;
var client = dbConfig.client;
if (_.contains(_.keys(clients), client)) {
return clients[client].getTables();
}
return Promise.reject('No support for database client ' + client);
}
function getIndexes(table) {
dbConfig = dbConfig || config.database;
var client = dbConfig.client;
if (_.contains(_.keys(clients), client)) {
return clients[client].getIndexes(table);
}
return Promise.reject('No support for database client ' + client);
}
function getColumns(table) {
dbConfig = dbConfig || config.database;
var client = dbConfig.client;
if (_.contains(_.keys(clients), client)) {
return clients[client].getColumns(table);
}
return Promise.reject('No support for database client ' + client);
}
function checkTables() {
dbConfig = dbConfig || config.database;
var client = dbConfig.client;
if (client === 'mysql') {
return clients[client].checkPostTable();
}
}
module.exports = {
checkTables: checkTables,
createTable: createTable,
deleteTable: deleteTable,
getTables: getTables,
getIndexes: getIndexes,
addUnique: addUnique,
dropUnique: dropUnique,
addColumn: addColumn,
getColumns: getColumns
};
|
// Karma configuration
// http://karma-runner.github.io/0.10/config/configuration-file.html
module.exports = function(config) {
config.set({
// base path, that will be used to resolve files and exclude
basePath: '',
// testing framework to use (jasmine/mocha/qunit/...)
frameworks: ['jasmine'],
// list of files / patterns to load in the browser
files: [
'../api/node_modules/socket.io/node_modules/socket.io-client/dist/socket.io.js',
'app/bower_components/ace-builds/src-min-noconflict/ace.js',
'app/bower_components/ckeditor/ckeditor.js',
'app/bower_components/threejs/build/three.js',
'app/bower_components/angular/angular.js',
'app/bower_components/angular-mocks/angular-mocks.js',
'app/bower_components/angular-resource/angular-resource.js',
'app/bower_components/angular-cookies/angular-cookies.js',
'app/bower_components/angular-sanitize/angular-sanitize.js',
'app/bower_components/angular-route/angular-route.js',
'app/bower_components/momentjs/moment.js',
'app/bower_components/angular-ui-ace/ui-ace.min.js',
'app/scripts/*.js',
'app/scripts/**/*.js',
'test/mock/**/*.js',
'test/spec/**/*.js'
],
// list of files / patterns to exclude
exclude: [],
// web server port
port: 8080,
// level of logging
// possible values: LOG_DISABLE || LOG_ERROR || LOG_WARN || LOG_INFO || LOG_DEBUG
logLevel: config.LOG_INFO,
// enable / disable watching file and executing tests whenever any file changes
autoWatch: false,
// Start these browsers, currently available:
// - Chrome
// - ChromeCanary
// - Firefox
// - Opera
// - Safari (only Mac)
// - PhantomJS
// - IE (only Windows)
browsers: ['Chrome'],
// Continuous Integration mode
// if true, it capture browsers, run tests and exit
singleRun: false
});
};
|
(function() {
function Fixtures() {
var Fixtures = {};
// Example album
var albumPicasso = {
title: "The Colors",
artist: "Pablo Picasso",
label: "Cubism",
year: "1881",
albumArtUrl: '/assets/images/album_covers/01.png',
songs: [
{ title: 'Blue', duration: '161.71', audioUrl: '/assets/music/blue' },
{ title: 'Green', duration: '103.96', audioUrl: '/assets/music/green' },
{ title: 'Red', duration: '268.45', audioUrl: '/assets/music/red' },
{ title: 'Pink', duration: '153.14', audioUrl: '/assets/music/pink' },
{ title: 'Magenta', duration: '374.22', audioUrl: '/assets/music/magenta' }
]
};
// Another example album
var albumMarconi = {
title: 'The Telephone',
artist: 'Guglielmo Marconi',
label: 'EM',
year: '1909',
albumArtUrl: '/assets/images/album_covers/20.png',
songs: [
{ title: 'Hello, Operator?', duration: '1:01' },
{ title: 'Ring, ring, ring', duration: '5:01' },
{ title: 'Fits in your pocket', duration: '3:21' },
{ title: 'Can you hear me now?', duration: '3:14' },
{ title: 'Wrong phone number', duration: '2:15' }
]
};
Fixtures.getAlbum = function () {
return albumPicasso;
};
Fixtures.getCollection = function (numberOfAlbums) {
var albums = [];
for (var i = 0; i < numberOfAlbums; i++) {
albums.push(angular.copy(albumPicasso));
}
return albums;
};
return Fixtures;
}
angular
.module('blocJams')
.factory('Fixtures', Fixtures);
})();
|
$(function () {
/*$(".store-nav li").live("click", function () {
$(this).addClass("active").siblings().removeClass("active");
});*/
var top1 = $(".store-nav-box").offset().top;
$(window).scroll(function () {
// 动态获取当前页面的位置
var win_top = $(this).scrollTop();
// 动态获取需要固定的div的位置
var top = $(".store-nav-box").offset().top;
// 把当前页面位置和要固定div的位置想对比
// 如果页面位置大于等于需要固定的div位置说明此时需要固定了,只需要给它添加一个css样式即可
if (win_top >= top) {
$(".store-nav-box").addClass("sfixed");
}
//把当前页面位置和要固定div的位置想对比
// 如果页面位置小于需要固定的div位置说明此时不需要固定,只需要给它移除之前添加的css样式即可
if (win_top < top1) {
$(".store-nav-box").removeClass("sfixed");
}
});
});
//商品关键词描红
if (typeof keywords != 'undefined' && keywords != "") {
var keywords = keywords.split("");
if (keywords.length > 0) {
var goods_name = $(".goods_name");
goods_name.unhighlight();
goods_name.highlight(keywords);
}
}
/**
* 商品排序
* @param obj
* @param order
* @param desc
*/
function goods_order_by (obj, order, desc) {
var order_by = "";
if (desc == "desc") {
order_by = "asc";
} else {
order_by = "desc";
}
var goods_min_price = $.trim($("[name=goods_min_price]").val());
var goods_max_price = $.trim($("[name=goods_max_price]").val());
if (all_class == 1) {
var _html = "&keywords=" + $.trim($("input[name=keywords]:eq(1)").val());
} else {
var _html = "";
}
location.href = base_url + "?goods_min_price=" + goods_min_price + "&goods_max_price=" + goods_max_price + _html + "&order=" + order + "&order_by=" + order_by;
}
/**
* 根据价格搜索
* @param obj
* @param order
* @param desc
*/
function search_goods_price (obj, order, order_by) {
var goods_min_price = $.trim($("[name=goods_min_price]").val());
var goods_max_price = $.trim($("[name=goods_max_price]").val());
if (all_class == 1) {
var _html = "&keywords=" + $.trim($("input[name=keywords]:eq(1)").val());
} else {
var _html = "";
}
location.href = base_url + "?goods_min_price=" + goods_min_price + "&goods_max_price=" + goods_max_price + _html + "&order=" + order + "&order_by=" + order_by;
}
|
// All material copyright ESRI, All Rights Reserved, unless otherwise specified.
// See http://js.arcgis.com/3.12/esri/copyright.txt for details.
//>>built
define("esri/dijit/geoenrichment/CheckList","../../declare dojo/dom-construct dojo/dom-class dojo/_base/lang dojo/query dojo/store/Memory dgrid/List dgrid/Selection dijit/layout/ContentPane".split(" "),function(d,e,f,g,k,l,m,n){function h(a,b){var c=e.create("div",{"class":"TrimWithEllipses"});b&&e.create("div",{"class":"dijit dijitInline dijitCheckBox VarCheck"},c);e.create("span",{"class":"VarLabel",innerHTML:a},c);return c}d=d("esri.dijit.geoenrichment.CheckList",[m,n],{selectionMode:"toggle",
store:null,selectedItems:null,useTouchScroll:!1,_setStore:function(a){this.store=a;this.refresh();this.renderArray(a.data)},_setItems:function(a){a=new l({data:a});this.set("store",a);this.refresh();this.renderArray(a.data)},buildRendering:function(){this.inherited(arguments);var a=g.hitch(this,this._onSelect);this.on("dgrid-select",a);this.on("dgrid-deselect",g.hitch(this,this._onDeselect))},select:function(a){this.inherited(arguments);var b=this.row(a).element;if(b){var c=k(".dijitCheckBox",b)[0];
c&&(f.contains(b,"dgrid-selected")?f.add(c,"dijitCheckBoxChecked"):f.remove(c,"dijitCheckBoxChecked"))}},renderRow:function(a,b){return h(a.description?a.description:a.alias,"single"!=this.selectionMode)},_setSelection:function(){this.selection=this.get("selection");this.selectedItems=[];if(this.selection&&this.store.data)for(var a=this.store.data,b=0;b<a.length;b++)this.selection[a[b].id]&&this.selectedItems.push(a[b])},_onSelect:function(a){this._setSelection();this.onSelect(a)},_onDeselect:function(a){this._setSelection();
this.onDeselect(a)},onDeselect:function(a){},onSelect:function(a){}});d.renderCheckBox=h;return d});
|
const jwt = require('jsonwebtoken')
const { ErrorHandler } = require("../helpers/error")
const dotenv = require('dotenv')
const User = require('../models').User
const ms = require('ms')
const bcrypt = require('bcrypt')
dotenv.config()
async function checkToken (req, _res, next) {
try {
let token = await req.headers['x-access-token'] || req.headers['authorization'] // express induced lowercase kumbuka
if (!token) { throw new ErrorHandler (401, 'Auth token is not supplied.') }
if (token.startsWith('Bearer ')) { token = token.slice(7, token.length) }
if (token) {
jwt.verify(token, process.env.JWT_SECRET, (err, decoded) => {
if (err) { throw new ErrorHandler(401, 'Token is not valid!.') }
else {
req.decoded = decoded
next()
}
})
} else { throw new ErrorHandler (401, 'Auth token is not supplied.') }
}
catch (error) { next(error) }
}
async function login(req) {
const attemptingUser = await User.findOne({where:{username: req.body.username}})
if (!attemptingUser) { throw new ErrorHandler(404, 'Humpty dumpty, User not Found!.') }
const match = await bcrypt.compare(req.body.password, attemptingUser.password)
if (match) {
let token = jwt.sign({username: req.body.username, id: attemptingUser.id}, process.env.JWT_SECRET, {expiresIn: process.env.TOKEN_EXPIRY,})
attemptingUser.tokenExpiry = new Date (Date.now() + ms(process.env.TOKEN_EXPIRY))
attemptingUser.lastLogin = new Date(Date.now())
attemptingUser.save()
return token
} else {
throw new ErrorHandler (400, "Match "+match)
}
}
module.exports = { checkToken, login, }
|
const axios = require("axios");
const {
InternalServerException,
} = require("http-exception-transformer/exceptions");
require("dotenv").config();
const getBlogs = async (page) => {
try {
const response = await axios.get(
`https://dev.to/api/articles/me?per_page=6&page=${page}`,
{
headers: {
"api-key": process.env.DEV_API_KEY,
},
}
);
return response.data;
} catch (err) {
throw new InternalServerException();
}
};
module.exports = { getBlogs };
|
tinymce.addI18n('zh_CN',{
"Redo": "恢复",
"Undo": "撤销",
"Cut": "剪切",
"Copy": "复制",
"Paste": "粘贴",
"Select all": "全选",
"New document": "新建文档",
"Ok": "确定",
"Cancel": "取消",
"Visual aids": "网格线",
"Bold": "粗体",
"Italic": "斜体",
"Underline": "下划线",
"Strikethrough": "删除线",
"Superscript": "上标",
"Subscript": "下标",
"Clear formatting": "清除格式",
"Align left": "左对齐",
"Align center": "居中",
"Align right": "右对齐",
"Justify": "两端对齐",
"Bullet list": "符号列表",
"Numbered list": "数字列表",
"Decrease indent": "减少缩进",
"Increase indent": "增加缩进",
"Close": "关闭",
"Formats": "格式",
"Your browser doesn't support direct access to the clipboard. Please use the Ctrl+X\/C\/V keyboard shortcuts instead.": "当前浏览器不支持访问剪贴板,请使用快捷键Ctrl+X/C/V复制粘贴",
"Headers": "标题",
"Header 1": "标题1",
"Header 2": "标题2",
"Header 3": "标题3",
"Header 4": "标题4",
"Header 5": "标题5",
"Header 6": "标题6",
"Headings": "标题",
"Heading 1": "标题1",
"Heading 2": "标题2",
"Heading 3": "标题3",
"Heading 4": "标题4",
"Heading 5": "标题5",
"Heading 6": "标题6",
"Preformatted": "预格式化",
"Div": "Div区块",
"Pre": "预格式文本",
"Code": "代码",
"Paragraph": "段落",
"Blockquote": "引用",
"Inline": "文本",
"Blocks": "区块",
"Paste is now in plain text mode. Contents will now be pasted as plain text until you toggle this option off.": "当前为纯文本粘贴模式,再次点击可以回到普通粘贴模式。",
"Fonts": "字体",
"Font Sizes": "字号",
"Class": "Class",
"Browse for an image": "浏览图像",
"OR": "或",
"Drop an image here": "拖放一张图片文件至此",
"Upload": "上传",
"Block": "块",
"Align": "对齐",
"Default": "默认",
"Circle": "空心圆",
"Disc": "实心圆",
"Square": "方块",
"Lower Alpha": "小写英文字母",
"Lower Greek": "小写希腊字母",
"Lower Roman": "小写罗马字母",
"Upper Alpha": "大写英文字母",
"Upper Roman": "大写罗马字母",
"Anchor...": "锚点...",
"Name": "名称",
"Id": "id",
"Id should start with a letter, followed only by letters, numbers, dashes, dots, colons or underscores.": "id应该以字母开头,后跟字母、数字、横线、点、冒号或下划线。",
"You have unsaved changes are you sure you want to navigate away?": "你对文档的修改尚未保存,确定离开吗?",
"Restore last draft": "恢复上次的草稿",
"Special characters...": "特殊字符...",
"Source code": "HTML源码",
"Insert\/Edit code sample": "插入/编辑代码示例",
"Language": "语言",
"Code sample...": "代码示例...",
"Color Picker": "选取颜色",
"R": "R",
"G": "G",
"B": "B",
"Left to right": "从左到右",
"Right to left": "从右到左",
"Emoticons...": "表情符号...",
"Metadata and Document Properties": "元数据和文档属性",
"Title": "标题",
"Keywords": "关键词",
"Description": "描述",
"Robots": "机器人",
"Author": "作者",
"Encoding": "编码",
"Fullscreen": "全屏",
"Action": "操作",
"Shortcut": "快捷键",
"Help": "帮助",
"Address": "地址",
"Focus to menubar": "移动焦点到菜单栏",
"Focus to toolbar": "移动焦点到工具栏",
"Focus to element path": "移动焦点到元素路径",
"Focus to contextual toolbar": "移动焦点到上下文菜单",
"Insert link (if link plugin activated)": "插入链接 (如果链接插件已激活)",
"Save (if save plugin activated)": "保存(如果保存插件已激活)",
"Find (if searchreplace plugin activated)": "查找(如果查找替换插件已激活)",
"Plugins installed ({0}):": "已安装插件 ({0}):",
"Premium plugins:": "优秀插件:",
"Learn more...": "了解更多...",
"You are using {0}": "你正在使用 {0}",
"Plugins": "插件",
"Handy Shortcuts": "快捷键",
"Horizontal line": "水平分割线",
"Insert\/edit image": "插入/编辑图片",
"Image description": "图片描述",
"Source": "地址",
"Dimensions": "大小",
"Constrain proportions": "保持宽高比",
"General": "常规",
"Advanced": "高级",
"Style": "样式",
"Vertical space": "垂直边距",
"Horizontal space": "水平边距",
"Border": "边框",
"Insert image": "插入图片",
"Image...": "图片...",
"Image list": "图片列表",
"Rotate counterclockwise": "逆时针旋转",
"Rotate clockwise": "顺时针旋转",
"Flip vertically": "垂直翻转",
"Flip horizontally": "水平翻转",
"Edit image": "编辑图片",
"Image options": "图片选项",
"Zoom in": "放大",
"Zoom out": "缩小",
"Crop": "裁剪",
"Resize": "调整大小",
"Orientation": "方向",
"Brightness": "亮度",
"Sharpen": "锐化",
"Contrast": "对比度",
"Color levels": "色阶",
"Gamma": "伽马值",
"Invert": "反转",
"Apply": "应用",
"Back": "后退",
"Insert date\/time": "插入日期/时间",
"Date\/time": "日期/时间",
"Insert\/Edit Link": "插入/编辑链接",
"Insert\/edit link": "插入/编辑链接",
"Text to display": "显示文字",
"Url": "地址",
"Open link in...": "链接打开方式...",
"Current window": "当前窗口打开",
"None": "在当前窗口/框架打开",
"New window": "在新窗口打开",
"Remove link": "删除链接",
"Anchors": "锚点",
"Link...": "链接...",
"Paste or type a link": "粘贴或输入链接",
"The URL you entered seems to be an email address. Do you want to add the required mailto: prefix?": "你所填写的URL地址为邮件地址,需要加上mailto:前缀吗?",
"The URL you entered seems to be an external link. Do you want to add the required http:\/\/ prefix?": "你所填写的URL地址属于外部链接,需要加上http://:前缀吗?",
"Link list": "链接列表",
"Insert video": "插入视频",
"Insert\/edit video": "插入/编辑视频",
"Insert\/edit media": "插入/编辑媒体",
"Alternative source": "替代资源",
"Alternative image URL": "资源备用地址",
"Media poster (Image URL)": "封面(图片地址)",
"Paste your embed code below:": "将内嵌代码粘贴在下面:",
"Embed": "内嵌",
"Media...": "多媒体...",
"Nonbreaking space": "不间断空格",
"Page break": "分页符",
"Paste as text": "粘贴为文本",
"Preview": "预览",
"Print...": "打印...",
"Save": "保存",
"Find": "查找",
"Replace with": "替换为",
"Replace": "替换",
"Replace all": "替换全部",
"Previous": "上一个",
"Next": "下一个",
"Find and replace...": "查找并替换...",
"Could not find the specified string.": "未找到搜索内容。",
"Match case": "区分大小写",
"Find whole words only": "全单词匹配",
"Spell check": "拼写检查",
"Ignore": "忽略",
"Ignore all": "忽略全部",
"Finish": "完成",
"Add to Dictionary": "添加到字典",
"Insert table": "插入表格",
"Table properties": "表格属性",
"Delete table": "删除表格",
"Cell": "单元格",
"Row": "行",
"Column": "列",
"Cell properties": "单元格属性",
"Merge cells": "合并单元格",
"Split cell": "拆分单元格",
"Insert row before": "在上方插入",
"Insert row after": "在下方插入",
"Delete row": "删除行",
"Row properties": "行属性",
"Cut row": "剪切行",
"Copy row": "复制行",
"Paste row before": "粘贴到上方",
"Paste row after": "粘贴到下方",
"Insert column before": "在左侧插入",
"Insert column after": "在右侧插入",
"Delete column": "删除列",
"Cols": "列",
"Rows": "行",
"Width": "宽",
"Height": "高",
"Cell spacing": "单元格外间距",
"Cell padding": "单元格内边距",
"Show caption": "显示标题",
"Left": "左对齐",
"Center": "居中",
"Right": "右对齐",
"Cell type": "单元格类型",
"Scope": "范围",
"Alignment": "对齐方式",
"H Align": "水平对齐",
"V Align": "垂直对齐",
"Top": "顶部对齐",
"Middle": "垂直居中",
"Bottom": "底部对齐",
"Header cell": "表头单元格",
"Row group": "行组",
"Column group": "列组",
"Row type": "行类型",
"Header": "表头",
"Body": "表体",
"Footer": "表尾",
"Border color": "边框颜色",
"Insert template...": "插入模板...",
"Templates": "模板",
"Template": "模板",
"Text color": "文字颜色",
"Background color": "背景色",
"Custom...": "自定义...",
"Custom color": "自定义颜色",
"No color": "无",
"Remove color": "删除颜色",
"Table of Contents": "目录",
"Show blocks": "显示区块边框",
"Show invisible characters": "显示不可见字符",
"Word count": "字数统计",
"Words: {0}": "字数:{0}",
"{0} words": "{0} 个字",
"File": "文件",
"Edit": "编辑",
"Insert": "插入",
"View": "查看",
"Format": "格式",
"Table": "表格",
"Tools": "工具",
"Powered by {0}": "Powered by {0}",
"Rich Text Area. Press ALT-F9 for menu. Press ALT-F10 for toolbar. Press ALT-0 for help": "在编辑区按ALT+F9打开菜单,按ALT+F10打开工具栏,按ALT+0查看帮助",
"Image title": "图片标题",
"Border width": "边框宽度",
"Border style": "边框样式",
"Error": "错误",
"Warn": "警告",
"Valid": "有效",
"To open the popup, press Shift+Enter": "此快捷为软回车(插入<br>)",
"Rich Text Area. Press ALT-0 for help.": "编辑区. 按Alt+0键打开帮助",
"System Font": "默认字体",
"Failed to upload image: {0}": "图片上传失败: {0}",
"Failed to load plugin: {0} from url {1}": "插件加载失败: {0} - {1}",
"Failed to load plugin url: {0}": "插件加载失败: {0}",
"Failed to initialize plugin: {0}": "插件初始化失败: {0}",
"example": "示例",
"Search": "查找",
"All": "全部",
"Currency": "货币",
"Text": "文本",
"Quotations": "引用",
"Mathematical": "数学运算符",
"Extended Latin": "拉丁语扩充",
"Symbols": "符号",
"Arrows": "箭头",
"User Defined": "自定义",
"dollar sign": "美元",
"currency sign": "货币",
"euro-currency sign": "欧元",
"colon sign": "冒号",
"cruzeiro sign": "克鲁赛罗币",
"french franc sign": "法郎",
"lira sign": "里拉",
"mill sign": "密尔",
"naira sign": "奈拉",
"peseta sign": "比塞塔",
"rupee sign": "卢比",
"won sign": "韩元",
"new sheqel sign": "新谢克尔",
"dong sign": "越南盾",
"kip sign": "老挝基普",
"tugrik sign": "图格里克",
"drachma sign": "德拉克马",
"german penny symbol": "德国便士",
"peso sign": "比索",
"guarani sign": "瓜拉尼",
"austral sign": "澳元",
"hryvnia sign": "格里夫尼亚",
"cedi sign": "塞地",
"livre tournois sign": "里弗弗尔",
"spesmilo sign": "一千spesoj的货币符号,该货币未使用",
"tenge sign": "坚戈",
"indian rupee sign": "印度卢比",
"turkish lira sign": "土耳其里拉",
"nordic mark sign": "北欧马克",
"manat sign": "马纳特",
"ruble sign": "卢布",
"yen character": "日元",
"yuan character": "人民币元",
"yuan character, in hong kong and taiwan": "元的繁体字",
"yen\/yuan character variant one": "元(大写)",
"Loading emoticons...": "正在加载表情文字...",
"Could not load emoticons": "不能加载表情文字",
"People": "人类",
"Animals and Nature": "动物和自然",
"Food and Drink": "食物和饮品",
"Activity": "活动",
"Travel and Places": "旅游和地点",
"Objects": "物件",
"Flags": "旗帜",
"Characters": "字数",
"Characters (no spaces)": "字数(不含空格)",
"Error: Form submit field collision.": "错误: 表单提交字段冲突.",
"Error: No form element found.": "错误: 未找到可用的form.",
"Update": "更新",
"Color swatch": "颜色样本",
"Turquoise": "青绿",
"Green": "绿色",
"Blue": "蓝色",
"Purple": "紫色",
"Navy Blue": "海军蓝",
"Dark Turquoise": "深蓝绿色",
"Dark Green": "暗绿",
"Medium Blue": "中蓝",
"Medium Purple": "中紫",
"Midnight Blue": "深蓝",
"Yellow": "黄色",
"Orange": "橙色",
"Red": "红色",
"Light Gray": "浅灰",
"Gray": "灰色",
"Dark Yellow": "暗黄",
"Dark Orange": "暗橙",
"Dark Red": "暗红",
"Medium Gray": "中灰",
"Dark Gray": "深灰",
"Black": "黑色",
"White": "白色",
"Switch to or from fullscreen mode": "切换全屏模式",
"Open help dialog": "打开帮助对话框",
"history": "历史",
"styles": "样式",
"formatting": "格式化",
"alignment": "对齐",
"indentation": "缩进",
"permanent pen": "记号笔",
"comments": "注释",
"Anchor": "锚点",
"Special character": "特殊字符",
"Code sample": "代码示例",
"Color": "颜色",
"Emoticons": "表情",
"Document properties": "文档属性",
"Image": "图片",
"Insert link": "插入链接",
"Target": "目标",
"Link": "链接",
"Poster": "封面",
"Media": "音视频",
"Print": "打印",
"Prev": "上一个",
"Find and replace": "查找并替换",
"Whole words": "全字匹配",
"Spellcheck": "拼写检查",
"Caption": "标题",
"Insert template": "插入模板",
//以下为补充汉化内容 by 莫若卿
"Code view": "代码区域",
"Select...": "选择...",
"Format Painter": "格式刷",
"No templates defined.": "无内置模板",
"Special character...": "特殊字符...",
"Open link": "打开链接",
"None": "无",
"Count": "统计",
"Document": "整个文档",
"Selection": "选取部分",
"Words": "字词数",
"{0} characters": "{0} 个字符",
"Alternative source URL": "替代资源地址",
"Alternative description": "替代说明文字",
"Accessibility": "可访问性",
"Image is decorative": "仅用于装饰",
//5.6新增
"Cut column": "剪切列",
"Copy column": "复制列",
"Paste column before": "粘贴到前方",
"Paste column after": "粘贴到后方",
"Copy column": "复制列",
//帮助窗口内的文字
"Version": "版本",
"Keyboard Navigation": "键盘导航",
"Open popup menu for split buttons": "该组合键的作用是软回车(插入br)",
});
|
/*
* Copyright (c) 2014-2021 Bjoern Kimminich.
* SPDX-License-Identifier: MIT
*/
const utils = require('../lib/utils')
const challenges = require('../data/datacache').challenges
const db = require('../data/mongodb')
module.exports = function trackOrder () {
return (req, res) => {
const id = utils.disableOnContainerEnv() ? String(req.params.id).replace(/[^\w-]+/g, '') : req.params.id
utils.solveIf(challenges.reflectedXssChallenge, () => { return utils.contains(id, '<iframe src="javascript:alert(`xss`)">') })
db.orders.find({ $where: `this.orderId === '${id}'` }).then(order => {
const result = utils.queryResultToJson(order)
utils.solveIf(challenges.noSqlOrdersChallenge, () => { return result.data.length > 1 })
if (result.data[0] === undefined) {
result.data[0] = { orderId: id }
}
res.json(result)
}, () => {
res.status(400).json({ error: 'Wrong Param' })
})
}
}
|
Bridge.merge(new System.Globalization.CultureInfo("tn-ZA", true), {
englishName: "Setswana (South Africa)",
nativeName: "Setswana (Aforika Borwa)",
numberFormat: Bridge.merge(new System.Globalization.NumberFormatInfo(), {
nanSymbol: "NaN",
negativeSign: "-",
positiveSign: "+",
negativeInfinitySymbol: "-∞",
positiveInfinitySymbol: "∞",
percentSymbol: "%",
percentGroupSizes: [3],
percentDecimalDigits: 2,
percentDecimalSeparator: ".",
percentGroupSeparator: " ",
percentPositivePattern: 1,
percentNegativePattern: 1,
currencySymbol: "R",
currencyGroupSizes: [3],
currencyDecimalDigits: 2,
currencyDecimalSeparator: ".",
currencyGroupSeparator: " ",
currencyNegativePattern: 1,
currencyPositivePattern: 0,
numberGroupSizes: [3],
numberDecimalDigits: 2,
numberDecimalSeparator: ".",
numberGroupSeparator: " ",
numberNegativePattern: 1
}),
dateTimeFormat: Bridge.merge(new System.Globalization.DateTimeFormatInfo(), {
abbreviatedDayNames: ["Tsh","Mos","Labb","Labr","Labn","Labt","Mat"],
abbreviatedMonthGenitiveNames: ["Fer","Tlh","Mop","Mor","Mot","See","Phu","Pha","Lwe","Dip","Ngw","Sed",""],
abbreviatedMonthNames: ["Fer","Tlh","Mop","Mor","Mot","See","Phu","Pha","Lwe","Dip","Ngw","Sed",""],
amDesignator: "AM",
dateSeparator: "-",
dayNames: ["Tshipi","Mosopulogo","Labobedi","Laboraro","Labone","Labotlhano","Matlhatso"],
firstDayOfWeek: 0,
fullDateTimePattern: "yyyy MMMM d, dddd HH:mm:ss",
longDatePattern: "yyyy MMMM d, dddd",
longTimePattern: "HH:mm:ss",
monthDayPattern: "MMMM d",
monthGenitiveNames: ["Ferikgong","Tlhakole","Mopitlo","Moranang","Motsheganang","Seetebosigo","Phukwi","Phatwe","Lwetse","Diphalane","Ngwanatsele","Sedimonthole",""],
monthNames: ["Ferikgong","Tlhakole","Mopitlo","Moranang","Motsheganang","Seetebosigo","Phukwi","Phatwe","Lwetse","Diphalane","Ngwanatsele","Sedimonthole",""],
pmDesignator: "PM",
rfc1123: "ddd, dd MMM yyyy HH':'mm':'ss 'GMT'",
shortDatePattern: "yyyy-MM-dd",
shortestDayNames: ["Tsh","Mos","Labb","Labr","Labn","Labt","Mat"],
shortTimePattern: "HH:mm",
sortableDateTimePattern: "yyyy'-'MM'-'dd'T'HH':'mm':'ss",
sortableDateTimePattern1: "yyyy'-'MM'-'dd",
timeSeparator: ":",
universalSortableDateTimePattern: "yyyy'-'MM'-'dd HH':'mm':'ss'Z'",
yearMonthPattern: "yyyy MMMM",
roundtripFormat: "yyyy'-'MM'-'dd'T'HH':'mm':'ss.fffffffzzz"
})
});
|
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports["default"] = void 0;
var _createIcon = _interopRequireDefault(require("./util/createIcon"));
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
var _default = (0, _createIcon["default"])('M11,12H8.82C9.62,12.5 10.35,13.07 11,13.68V12M7,11C7.27,5.88 9.37,2 12,2C14.66,2 16.77,5.94 17,11.12C18.5,10.43 20.17,10 22,10C16.25,12.57 18.25,22 12,22C6,22 7.93,12.57 2,10C3.82,10 5.5,10.4 7,11M11,11V9H8.24L8.03,11H11M11,8V6H9.05C8.8,6.6 8.6,7.27 8.43,8H11M11,5V3.3C10.45,3.63 9.95,4.22 9.5,5H11M12,3V5H13V6H12V8H14V9H12V11H15V12H12V14H14V15H12.23C13.42,16.45 14.15,18 14.32,19.23C15.31,17.56 15.96,14.84 16,11.76C15.94,7 14.13,3 12,3Z');
exports["default"] = _default;
|
module.exports = {
css: {
extract: false,
loaderOptions: {
// by default the `sass` option will apply to both syntaxes
// because `scss` syntax is also processed by sass-loader underlyingly
// but when configuring the `data` option
// `scss` syntax requires an semicolon at the end of a statement, while `sass` syntax requires none
// in that case, we can target the `scss` syntax separately using the `scss` option
// scss: {
// data: '@import "~@/variables.scss";',
// },
},
},
};
|
const composer = require('openwhisk-composer')
/**
* A helper composition. Note how one can modularize compositions!
* This function implements a looping subroutine. In order not to
* pollute the parameter bindings of the given composition, this
* helper uses the MASK combinator to "mask out" the n variable.
*/
function loop(n, composition) {
return composer.let({ n }, composer.while(() => n-- > 0, composer.mask(composition)))
}
/**
* The exported composition uses the loop helper. Thanks to MASK,
* this composition returns the expected { value: 12 }. With MASK,
* the two scopes of the "n" variable (one used by loop, and the
* other by this main composition) do not collide.
*/
module.exports = composer.let(
// the parameter bindings of the let
{ n: 0 },
// the body of the let; the n referenced here should
// be "our" n, not the n declared by the loop helper.
// With mask, we achieve the desired scoping.
loop(3, loop(4, () => ++n))
)
|
import React from 'react'
const LastTime = () => {
return (
<>
<path fill="none" d="M8 4L8 8" strokeWidth="0.75" strokeLinecap="round" strokeLinejoin="round"/>
<path fill="none" d="M8 8L10 10" strokeWidth="0.75" strokeLinecap="round" strokeLinejoin="round"/>
<circle fill="none" cx="8" cy="8" r="6.5"/>
</>
)
}
export default LastTime
|
/**
* Created by DenQ on 31.08.2015.
*/
var LTT, list, ltt;
LTT = (function() {
LTT.prototype.groupParent = [];
LTT.prototype.key_id = 'id';
LTT.prototype.key_parent = 'parent';
LTT.prototype.position = 'position';
LTT.prototype.options = {};
function LTT(list, options) {
this.list = list;
this.options = options != null ? options : {};
this.ParseOptions();
this.list = _.map(_.sortByOrder(this.list, [this.position, this.key_parent, this.key_id], ['asc', 'asc']));
this.groupParent = _.uniq(_.pluck(this.list, this.key_parent));
return this;
}
LTT.prototype.ParseOptions = function() {
if (this.options.key_id != null) {
this.key_id = this.options.key_id;
}
if (this.options.key_parent != null) {
this.key_parent = this.options.key_parent;
}
if (this.options.position != null){
this.position = this.options.position;
}
};
LTT.prototype.GetParentItems = function(parent) {
var item, result, _i, _len, _ref;
result = [];
_ref = this.list;
for (_i = 0, _len = _ref.length; _i < _len; _i++) {
item = _ref[_i];
if (item[this.key_parent] === parent) {
if(!item.children) item.children = [];
result.push(item);
}
}
return result;
};
LTT.prototype.GetItemById = function(id) {
var item, _i, _len, _ref;
_ref = this.list;
for (_i = 0, _len = _ref.length; _i < _len; _i++) {
item = _ref[_i];
if (item[this.key_id] === id) {
return item;
}
}
return false;
};
LTT.prototype.GetTree = function() {
var children, i, obj, parentId, result, _i, _j, _len, _len1, _ref;
result = [];
_ref = this.groupParent;
for (_i = 0, _len = _ref.length; _i < _len; _i++) {
parentId = _ref[_i];
obj = this.GetItemById(parentId);
children = this.GetParentItems(parentId);
if (obj === false) {
for (_j = 0, _len1 = children.length; _j < _len1; _j++) {
i = children[_j];
result.push(i);
}
} else {
obj.children = children;
}
}
return result;
};
return LTT;
})();
|
import { SUGGESTED_FEATURED, SUGGESTED_TOP_SUBSCRIBED } from 'constants/subscriptions';
import { createSelector } from 'reselect';
import {
selectAllClaimsByChannel,
selectClaimsById,
selectAllFetchingChannelClaims,
makeSelectChannelForClaimUri,
selectClaimsByUri,
parseURI,
} from 'lbry-redux';
import { swapKeyAndValue } from 'util/swap-json';
// Returns the entire subscriptions state
const selectState = state => state.subscriptions || {};
// Returns the list of channel uris a user is subscribed to
export const selectSubscriptions = createSelector(selectState, state => state.subscriptions);
// Fetching list of users subscriptions
export const selectIsFetchingSubscriptions = createSelector(selectState, state => state.loading);
// The current view mode on the subscriptions page
export const selectViewMode = createSelector(selectState, state => state.viewMode);
// Suggested subscriptions from internal apis
export const selectSuggested = createSelector(selectState, state => state.suggested);
export const selectIsFetchingSuggested = createSelector(
selectState,
state => state.loadingSuggested
);
export const selectSuggestedChannels = createSelector(
selectSubscriptions,
selectSuggested,
(userSubscriptions, suggested) => {
if (!suggested) {
return null;
}
// Swap the key/value because we will use the uri for everything, this just makes it easier
// suggested is returned from the api with the form:
// {
// featured: { "Channel label": uri, ... },
// top_subscribed: { "@channel": uri, ... }
// top_bid: { "@channel": uri, ... }
// }
// To properly compare the suggested subscriptions from our current subscribed channels
// We only care about the uri, not the label
// We also only care about top_subscribed and featured
// top_bid could just be porn or a channel with no content
const topSubscribedSuggestions = swapKeyAndValue(suggested[SUGGESTED_TOP_SUBSCRIBED]);
const featuredSuggestions = swapKeyAndValue(suggested[SUGGESTED_FEATURED]);
// Make sure there are no duplicates
// If a uri isn't already in the suggested object, add it
const suggestedChannels = { ...topSubscribedSuggestions };
Object.keys(featuredSuggestions).forEach(uri => {
if (!suggestedChannels[uri]) {
const channelLabel = featuredSuggestions[uri];
suggestedChannels[uri] = channelLabel;
}
});
userSubscriptions.forEach(({ uri }) => {
// Note to passer bys:
// Maybe we should just remove the `lbry://` prefix from subscription uris
// Most places don't store them like that
const subscribedUri = uri.slice('lbry://'.length);
if (suggestedChannels[subscribedUri]) {
delete suggestedChannels[subscribedUri];
}
});
return Object.keys(suggestedChannels)
.map(uri => ({
uri,
label: suggestedChannels[uri],
}))
.slice(0, 5);
}
);
export const selectFirstRunCompleted = createSelector(
selectState,
state => state.firstRunCompleted
);
export const selectShowSuggestedSubs = createSelector(
selectState,
state => state.showSuggestedSubs
);
// Fetching any claims that are a part of a users subscriptions
export const selectSubscriptionsBeingFetched = createSelector(
selectSubscriptions,
selectAllFetchingChannelClaims,
(subscriptions, fetchingChannelClaims) => {
const fetchingSubscriptionMap = {};
subscriptions.forEach(sub => {
const isFetching = fetchingChannelClaims && fetchingChannelClaims[sub.uri];
if (isFetching) {
fetchingSubscriptionMap[sub.uri] = true;
}
});
return fetchingSubscriptionMap;
}
);
export const selectUnreadByChannel = createSelector(selectState, state => state.unread);
// Returns the current total of unread subscriptions
export const selectUnreadAmount = createSelector(selectUnreadByChannel, unreadByChannel => {
const unreadChannels = Object.keys(unreadByChannel);
let badges = 0;
if (!unreadChannels.length) {
return badges;
}
unreadChannels.forEach(channel => {
badges += unreadByChannel[channel].uris.length;
});
return badges;
});
// Returns the uris with channels as an array with the channel with the newest content first
// If you just want the `unread` state, use selectUnread
export const selectUnreadSubscriptions = createSelector(
selectUnreadAmount,
selectUnreadByChannel,
selectClaimsByUri,
(unreadAmount, unreadByChannel, claimsByUri) => {
// determine which channel has the newest content
const unreadList = [];
if (!unreadAmount) {
return unreadList;
}
const channelUriList = Object.keys(unreadByChannel);
// There is only one channel with unread notifications
if (unreadAmount === 1) {
channelUriList.forEach(channel => {
const unreadChannel = {
channel,
uris: unreadByChannel[channel].uris,
};
unreadList.push(unreadChannel);
});
return unreadList;
}
channelUriList
.sort((channel1, channel2) => {
const latestUriFromChannel1 = unreadByChannel[channel1].uris[0];
const latestClaimFromChannel1 = claimsByUri[latestUriFromChannel1] || {};
const latestUriFromChannel2 = unreadByChannel[channel2].uris[0];
const latestClaimFromChannel2 = claimsByUri[latestUriFromChannel2] || {};
const latestHeightFromChannel1 = latestClaimFromChannel1.height || 0;
const latestHeightFromChannel2 = latestClaimFromChannel2.height || 0;
if (latestHeightFromChannel1 !== latestHeightFromChannel2) {
return latestHeightFromChannel2 - latestHeightFromChannel1;
}
return 0;
})
.forEach(channel => {
const unreadSubscription = unreadByChannel[channel];
const unreadChannel = {
channel,
uris: unreadSubscription.uris,
};
unreadList.push(unreadChannel);
});
return unreadList;
}
);
// Returns all unread subscriptions for a uri passed in
export const makeSelectUnreadByChannel = uri =>
createSelector(selectUnreadByChannel, unread => unread[uri]);
// Returns the first page of claims for every channel a user is subscribed to
export const selectSubscriptionClaims = createSelector(
selectAllClaimsByChannel,
selectClaimsById,
selectSubscriptions,
selectUnreadByChannel,
(channelIds, allClaims, savedSubscriptions, unreadByChannel) => {
// no claims loaded yet
if (!Object.keys(channelIds).length) {
return [];
}
let fetchedSubscriptions = [];
savedSubscriptions.forEach(subscription => {
let channelClaims = [];
// if subscribed channel has content
if (channelIds[subscription.uri] && channelIds[subscription.uri]['1']) {
// This will need to be more robust, we will want to be able to load more than the first page
// Strip out any ids that will be shown as notifications
const pageOneChannelIds = channelIds[subscription.uri]['1'];
// we have the channel ids and the corresponding claims
// loop over the list of ids and grab the claim
pageOneChannelIds.forEach(id => {
const grabbedClaim = allClaims[id];
if (
unreadByChannel[subscription.uri] &&
unreadByChannel[subscription.uri].uris.some(uri => uri.includes(id))
) {
grabbedClaim.isNew = true;
}
channelClaims = channelClaims.concat([grabbedClaim]);
});
}
fetchedSubscriptions = fetchedSubscriptions.concat(channelClaims);
});
return fetchedSubscriptions;
}
);
// Returns true if a user is subscribed to the channel associated with the uri passed in
// Accepts content or channel uris
export const makeSelectIsSubscribed = uri =>
createSelector(
selectSubscriptions,
makeSelectChannelForClaimUri(uri, true),
(subscriptions, channelUri) => {
if (channelUri) {
return subscriptions.some(sub => sub.uri === channelUri);
}
// If we couldn't get a channel uri from the claim uri, the uri passed in might be a channel already
const { isChannel } = parseURI(uri);
if (isChannel) {
const uriWithPrefix = uri.startsWith('lbry://') ? uri : `lbry://${uri}`;
return subscriptions.some(sub => sub.uri === uriWithPrefix);
}
return false;
}
);
export const makeSelectIsNew = uri =>
createSelector(
makeSelectIsSubscribed(uri),
makeSelectChannelForClaimUri(uri),
selectUnreadByChannel,
(isSubscribed, channel, unreadByChannel) => {
if (!isSubscribed) {
return false;
}
const unreadForChannel = unreadByChannel[`lbry://${channel}`];
if (unreadForChannel) {
return unreadForChannel.uris.includes(uri);
}
return false;
// If they are subscribed, check to see if this uri is in the list of unreads
}
);
export const selectEnabledChannelNotifications = createSelector(
selectState,
state => state.enabledChannelNotifications
);
|
import React from "react"
import styled from "styled-components"
import { Text } from "../Header.styles"
const MenuItem = styled.a`
cursor: pointer;
text-decoration: none;
p:hover {
color: #7c5eff;
}
`
const ListItem = styled.li`
list-style: none;
margin: 5px 10px;
`
const Item = props => {
return (
<ListItem>
<MenuItem href={props.href}>
<Text>{props.title}</Text>
</MenuItem>
</ListItem>
)
}
export default Item
|
tinyMCE.addI18n('hi.advhr_dlg',{
width:"Width",
size:"Height",
noshade:"No shadow"
});
|
import BaseCourseAPI from './Base';
export default class CommentsAPI extends BaseCourseAPI {
/**
* post = {
* id: number, title: string, text: string, createdAt: datetime,
* - Post attributes
* formattedText: string,
* - same as text attribute but formatted for html
* creator = {
* name: string, avatar: string
* - user attributes for creator, avatar is an url
* },
* topicId:
* - the id of the discussion topic the post belongs to
* canUpdate: bool, canDelete: bool,
* - true if user can update and delete this post respectively
* }
*/
/**
* Creates a comment (discussion post)
*
* @param {string} topicId
* @param {object} params
* - params in the format of { :discussion_post }
* @return {Promise}
* success response: post
*/
create(topicId, params) {
return this.getClient().post(
`${this._getUrlPrefix()}/${topicId}/posts/`,
params,
);
}
/**
* Updates a comment (discussion post)
*
* @param {string} topicId
* @param {string} postId
* @param {object} params
* - params in the format of { :discussion_post }
* @return {Promise}
* success response: post
*/
update(topicId, postId, params) {
return this.getClient().patch(
`${this._getUrlPrefix()}/${topicId}/posts/${postId}`,
params,
);
}
/**
* Deletes a comment (discussion post)
*
* @param {string} topicId
* @param {string} postId
* @return {Promise}
* success response: {}
*/
delete(topicId, postId) {
return this.getClient().delete(
`${this._getUrlPrefix()}/${topicId}/posts/${postId}`,
);
}
_getUrlPrefix() {
return `/courses/${this.getCourseId()}/comments`;
}
}
|
/* eslint-disable no-undef */
// ***********************************************
// This example commands.js shows you how to
// create various custom commands and overwrite
// existing commands.
//
// For more comprehensive examples of custom
// commands please read more here:
// https://on.cypress.io/custom-commands
// ***********************************************
//
//
// -- This is a parent command --
// Cypress.Commands.add('login', (email, password) => { ... })
//
//
// -- This is a child command --
// Cypress.Commands.add('drag', { prevSubject: 'element'}, (subject, options) => { ... })
//
//
// -- This is a dual command --
// Cypress.Commands.add('dismiss', { prevSubject: 'optional'}, (subject, options) => { ... })
//
//
// -- This will overwrite an existing command --
// Cypress.Commands.overwrite('visit', (originalFn, url, options) => { ... })
import dayjs from 'dayjs'
//const testData = require('./test_data.json')
const testData = require('../../../backend/tests/test_data.json')
import 'cypress-file-upload'
const testPdfName = 'test_pdf.pdf'
var senders_id = ''
var created_at = ''
const admissionFormData = testData.admission_forms[0]
let basicInfoFormTestData = testData.basic_info_forms[0]
Cypress.Commands.add('emptyDatabase', () => {
cy.request({
url: 'http://localhost:3001/tests/reset',
method: 'POST',
})
})
Cypress.Commands.add('sendBasicInformation', () => {
cy.request({
url: 'http://localhost:3001/tests/basic_information_form',
method: 'POST',
body: {
...basicInfoFormTestData
},
}).then(response => {
localStorage.setItem('sender_id', JSON.stringify(response.body.id))
const sender_id = localStorage.sender_id
senders_id = sender_id.replace(/['"]+/g,'')
})
})
Cypress.Commands.add('sendAdmissionForm', ( data ) => {
if (senders_id === '') {
console.log('POST-request of admission form not valid before basic-information has been sent for basicInformation id')
return
}
return cy.request({
url: 'http://localhost:3001/api/admissions/admission_form',
method: 'POST',
body: { ...admissionFormData, formState: data.formState, basicInformation: senders_id }
}).then(response => {
localStorage.setItem('createdAt', dayjs(response.body.createdAt).format('DD.MM.YYYY HH:mm:ss'))
const createdAt = localStorage.createdAt
created_at = createdAt.replace(/['"]+/g,'')
return response
}
)
})
Cypress.Commands.add('form_request', (url, formData) => {
const user = JSON.parse(localStorage.user)
return cy
.server()
.route('POST', url)
.as('formRequest')
.window()
.then(win => {
var xhr = new win.XMLHttpRequest()
xhr.open('POST', url)
xhr.setRequestHeader('x-access-token', user.accessToken)
xhr.send(formData)
})
.wait('@formRequest')
})
Cypress.Commands.add('sendAttachment', ( { id, whichFile } ) => {
const fileName = testPdfName
cy.fixture(fileName, 'binary')
.then(Cypress.Blob.binaryStringToBlob)
.then((blob) => {
// Build up the form
const formData = new FormData()
const filesInfo = [{ name: fileName, whichFile: whichFile }]
formData.append('filesInfo', JSON.stringify(filesInfo))
formData.append('files', blob, fileName)
// Perform the request
cy.form_request('http://localhost:3001/api/thl/admissions/admission_form_attachment/'+id, formData)
})
})
Cypress.Commands.add('loginAsThlRole', () => {
const loggedInUser = { username: 'Tero Testaaja', role: 'THL' }
return cy.request({
url: 'http://localhost:3001/api/thl/auth/login',
method: 'POST',
body: { ...loggedInUser },
}).then(res => {
if(res.body.accessToken) {
localStorage.setItem('user', JSON.stringify(res.body))
}
return res.body
}
)
})
Cypress.Commands.add('loginAsReseachUnitRole', () => {
const loggedInUser = { username: 'Tiina Testaaja', role: 'Niuvanniemen sairaala' }
return cy.request({
url: 'http://localhost:3001/api/thl/auth/login',
method: 'POST',
body: { ...loggedInUser },
}).then(res => {
if(res.body.accessToken) {
localStorage.setItem('user', JSON.stringify(res.body))
}
return res.body
}
)
})
Cypress.Commands.add('sendEditedForm', ( data ) => {
return cy.request({
url: `http://localhost:3001/api/admissions/admission_form/${data.id}/edit`,
method: 'PUT',
id: data.id,
body: data.updatedForm,
}).then(response => {
return response
}
)
})
Cypress.Commands.overwrite('click', (originalFn, selector, options = {}) => {
options.force = true
return originalFn(selector, options) })
|
// Copyright (c) 2012 Ecma International. All rights reserved.
// Ecma International makes this code available under the terms and conditions set
// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the
// "Use Terms"). Any redistribution of this code must retain the above
// copyright and this notice and otherwise comply with the Use Terms.
/*---
es5id: 15.12.1.1-g6-5
description: >
The JSON lexical grammer allows 'n' as a JSONEscapeCharacter after
'' in a JSONString
includes: [runTestCase.js]
---*/
function testcase() {
return JSON.parse('"\\n"')==='\n';
}
runTestCase(testcase);
|
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
var _actions = require('../actions');
var describeUpdateSyncErrors = function describeUpdateSyncErrors(reducer, expect, _ref) {
var fromJS = _ref.fromJS,
setIn = _ref.setIn;
return function () {
it('should update sync errors', function () {
var state = reducer(fromJS({
foo: {
values: {
myField: 'value',
myOtherField: 'otherValue'
}
}
}), (0, _actions.updateSyncErrors)('foo', {
myField: 'myField error',
myOtherField: 'myOtherField error'
}));
expect(state).toEqual(setIn(fromJS({
foo: {
values: {
myField: 'value',
myOtherField: 'otherValue'
}
}
}), 'foo.syncErrors', {
myField: 'myField error',
myOtherField: 'myOtherField error'
}));
});
it('should update form-wide error', function () {
var state = reducer(fromJS({
foo: {
values: {
myField: 'value',
myOtherField: 'otherValue'
}
}
}), (0, _actions.updateSyncErrors)('foo', {
myField: 'myField error'
}, 'form wide error'));
expect(state).toEqualMap(setIn(fromJS({
foo: {
values: {
myField: 'value',
myOtherField: 'otherValue'
},
syncError: true,
error: 'form wide error'
}
}), 'foo.syncErrors', {
myField: 'myField error'
}));
});
it('should update complex sync errors', function () {
var state = reducer(fromJS({
foo: {
values: {
myField: 'value',
myOtherField: 'otherValue'
}
}
}), (0, _actions.updateSyncErrors)('foo', {
myField: { complex: true, text: 'myField error' },
myOtherField: { complex: true, text: 'myOtherField error' }
}));
expect(state).toEqual(setIn(fromJS({
foo: {
values: {
myField: 'value',
myOtherField: 'otherValue'
}
}
}), 'foo.syncErrors', {
myField: { complex: true, text: 'myField error' },
myOtherField: { complex: true, text: 'myOtherField error' }
}));
});
it('should clear sync errors', function () {
var state = reducer(setIn(fromJS({
foo: {
values: {
myField: 'value',
myOtherField: 'otherValue'
}
}
}), 'foo.syncErrors', {
myField: 'myField error',
myOtherField: 'myOtherField error'
}), (0, _actions.updateSyncErrors)('foo', {}));
expect(state).toEqualMap({
foo: {
values: {
myField: 'value',
myOtherField: 'otherValue'
}
}
});
});
};
};
exports.default = describeUpdateSyncErrors;
|
export GenericPage from './GenericPage'
export DashboardPage from './DashboardPage'
export HomePage from './HomePage'
export NotFoundPage from './NotFoundPage'
export SamplePage from './SamplePage'
|
LatinRead = {};
LatinRead.convertRoman = function(num) {
var rom = { M: 1000, CM: 900, D: 500, CD: 400,
C: 100, XC: 90, L: 50, XL: 40,
X: 10, IX: 9, V: 5, IV: 4,
I: 1 };
return Object.keys(rom).reduce(function (acc, ch) {
acc.str += ch.repeat(acc.num / rom[ch]);
acc.num %= rom[ch];
return acc;
}, { str: '', num: num }).str;
};
LatinRead.jq = function(myid) {
return "#" + myid.replace( /(:|\.|\[|\]|,)/g, "\\$1" );
};
LatinRead.offsetContent = function(div, targetId, alignmentTargetId) {
var target = $(div).find('.tei-s[id="' + targetId + '"]');
var posTop = target.position().top;
var height = target.height();
/*var alignmentTop = 0;
var alignmentTarget = (alignmentTargetId && alignmentTargetId.indexOf('_trans') > 0) ? $('.translations .tei-div') : $('.content .tei-div');
if(alignmentTarget != $(div) && alignmentTarget.find('.tei-s[id="' + alignmentTargetId + '"]').length > 0)
alignmentTop = alignmentTarget.find('.tei-s[id="' + alignmentTargetId + '"]').position().top;
if(alignmentTargetId.indexOf('_trans') > 0)
alignmentTop = alignmentTop + 18; // (margin-top + border + padding-top) selected tei-s
*/
if(posTop != undefined) {
var heightDiv = $('.chapter').height() - (screen.height*0.26); // static notes height
if($('.chapter-title').length == 1)
heightDiv -= $('.chapter-title').height();
//console.log(targetId, ' :: pos top: ' + posTop);
//console.log(targetId, ' :: align top: ' + alignmentTop);
//console.log(targetId, ' :: height: ' + height);
//console.log(targetId, ' :: height-div: ', heightDiv*0.85);
if((posTop + height + 50) > heightDiv*0.90)
$(div).css({ top: - posTop + 25 });
}
};
|
import { debug } from '../../lib/logger'
import config from '../jira.config'
import { getCurrentPageConfig } from './Page'
export function getIssuesList() {
let pageConfig = getCurrentPageConfig()
if (typeof pageConfig.issuesListId !== 'undefined') {
return document.getElementById(pageConfig.issuesListId)
} else if (typeof pageConfig.issuesListClass !== 'undefined') {
return document.getElementsByClassName(pageConfig.issuesListClass)[0]
}
return false
}
export function getAllIssues() {
let issuesList = getIssuesList()
return issuesList !== false ? issuesList.querySelectorAll(`.${config.issue.className}`) : []
}
export function getAllAvatars() {
return getIssuesList().querySelectorAll(`.${config.avatar.className}`)
}
export function getAllAvatarContainers() {
let pageConfig = getCurrentPageConfig()
let issuesList = getIssuesList()
debug('IssuesList::getAllAvatarContainers::pageConfig', pageConfig)
debug('IssuesList::getAllAvatarContainers::issuesList', issuesList)
return issuesList.querySelectorAll(pageConfig.avatarContainerSelector)
}
|
$(document).ready(function() {
$('#nestable').nestable().on('change', function() {
const data = {
menu: window.JSON.stringify($('#nestable').nestable('serialize')),
_token: $('input[name=_token]').val()
};
$.ajax({
url: '/admin/menu/guardar-orden',
type: 'POST',
dataType: 'JSON',
data: data,
success: function(respuesta) {}
});
});
$('.eliminar-menu').on('click', function(event) {
event.preventDefault();
const url = $(this).attr('href');
swal({
title: '¿ Está seguro que desea eliminar el registro ?',
text: "Esta acción no se puede deshacer!",
icon: 'warning',
buttons: {
cancel: "Cancelar",
confirm: "Aceptar"
},
}).then((value) => {
if (value) {
window.location.href = url;
}
});
})
$('#nestable').nestable('expandAll');
});
|
const router = require("express").Router();
const schedule = require("../../controllers/schedule");
// matches with "/api/:id"
router.route('/:id')
.get(schedule.findById);
// matches with "/api/"
router.route("/")
.post(schedule.create);
module.exports = router;
|
var searchData=
[
['z',['z',['../structsecp256k1__gej.html#ae41776408dba32cbe28b5e345b5f2286',1,'secp256k1_gej']]]
];
|
var playState = {
create: function(){
var background = game.add.sprite(0, 0, 'cidade');
background.width = 1300;
background.height = 650;
graphics = game.add.graphics(0, 0);
groupCidade = game.add.group();
groupCidade.inputEnableChildren = true;
var x = 100;
for (var i = 0; i < 3; i++){
// Gera os retangulos que ficarão atras das imagens
graphics.beginFill(0xFFFFFF);
graphics.lineStyle(3, 0x05005e, 1);
graphics.drawRoundedRect(x, 200, 315, 190, 10);
graphics.endFill();
var button = groupCidade.create(x, 200, graphics.generateTexture());
button.tint = 0xff8800;
button.name = 'groupCidade-child-' + i;
x = x + 400;
}
graphics.destroy();
var cachorro = game.add.sprite(110, 210, 'cachorro');
cachorro.width = 300;
cachorro.height = 170;
// Desenha o gato e a borda da box
var gato = game.add.sprite(510, 210, 'gato');
gato.width = 300;
gato.height = 170;
// Desenha o passaro e a borda da box
var passaro = game.add.sprite(910, 210, 'passaro');
passaro.width = 300;
passaro.height = 170;
game.time.events.add(Phaser.Timer.SECOND * 2, start, this);
function start(){
ocultarOpcoes(1);
groupCidade.children[0].x += 230;
cachorro.x += 230;
groupCidade.children[0].y -= 70;
cachorro.y -= 70;
game.add.tween(groupCidade.children[0].scale).to( { x: 2, y: 2 }, 3000, Phaser.Easing.Elastic.Out, true);
game.add.tween(cachorro.scale).to( { x: 1, y: 1 }, 3000, Phaser.Easing.Elastic.Out, true);
game.time.events.add(Phaser.Timer.SECOND * 5, initial, this);
}
function initial(){
game.add.tween(groupCidade.children[0].scale).to( { x: 1, y: 1 }, 1000, Phaser.Easing.Linear.In, true);
game.add.tween(cachorro.scale).to( { x: 0.5, y: 0.5 }, 1000, Phaser.Easing.Linear.In, true);
groupCidade.children[0].x -= 230;
cachorro.x -= 230;
groupCidade.children[0].y += 70;
cachorro.y += 70;
background.alpha = 0.5;
apresentarOpcoes(1);
activateButtons();
}
function ocultarOpcoes(numero){
background.alpha = 0.5;
if(numero == 1){
groupCidade.children[1].alpha = 0;
groupCidade.children[2].alpha = 0;
gato.alpha = 0;
passaro.alpha = 0;
}
}
function apresentarOpcoes(numero){
game.add.tween(background).to( { alpha: 1 }, 1000, Phaser.Easing.Linear.In, true);
if(numero == 1){
game.add.tween(groupCidade.children[1]).to( { alpha: 1 }, 1000, Phaser.Easing.Linear.In, true);
game.add.tween(groupCidade.children[2]).to( { alpha: 1 }, 1000, Phaser.Easing.Linear.In, true);
game.add.tween(gato).to( { alpha: 1 }, 1000, Phaser.Easing.Linear.In, true);
game.add.tween(passaro).to( { alpha: 1 }, 1000, Phaser.Easing.Linear.In, true);
}
}
function activateButtons(){
groupCidade.onChildInputDown.add(onDown, this);
groupCidade.onChildInputOver.add(onOver, this);
groupCidade.onChildInputOut.add(onOut, this);
}
function onDown (sprite) {
sprite.tint = 0x00ff00;
}
function onOver (sprite) {
sprite.tint = 0xffff00;
}
function onOut (sprite) {
sprite.tint = 0xff8800;
// sprite.tint = Math.random() * 0xffffff;
}
},
update: function(){
},
Win: function(){
game.state.start('win');
}
};
|
/*
* Molecule API Documentation
* The Hydrogen Molecule API
*
* OpenAPI spec version: 1.3.0
* Contact: info@hydrogenplatform.com
*
* NOTE: This class is auto generated by the swagger code generator program.
* https://github.com/swagger-api/swagger-codegen.git
*
* Swagger Codegen version: 2.4.14
*
* Do not edit the class manually.
*
*/
(function(root, factory) {
if (typeof define === 'function' && define.amd) {
// AMD.
define(['expect.js', '../../src/index'], factory);
} else if (typeof module === 'object' && module.exports) {
// CommonJS-like environments that support module.exports, like Node.
factory(require('expect.js'), require('../../src/index'));
} else {
// Browser globals (root is window)
factory(root.expect, root.MoleculeApiDocumentation);
}
}(this, function(expect, MoleculeApiDocumentation) {
'use strict';
var instance;
describe('(package)', function() {
describe('PageTransactionSuccessResponse', function() {
beforeEach(function() {
instance = new MoleculeApiDocumentation.PageTransactionSuccessResponse();
});
it('should create an instance of PageTransactionSuccessResponse', function() {
// TODO: update the code to test PageTransactionSuccessResponse
expect(instance).to.be.a(MoleculeApiDocumentation.PageTransactionSuccessResponse);
});
it('should have the property content (base name: "content")', function() {
// TODO: update the code to test the property content
expect(instance).to.have.property('content');
// expect(instance.content).to.be(expectedValueLiteral);
});
it('should have the property first (base name: "first")', function() {
// TODO: update the code to test the property first
expect(instance).to.have.property('first');
// expect(instance.first).to.be(expectedValueLiteral);
});
it('should have the property last (base name: "last")', function() {
// TODO: update the code to test the property last
expect(instance).to.have.property('last');
// expect(instance.last).to.be(expectedValueLiteral);
});
it('should have the property _number (base name: "number")', function() {
// TODO: update the code to test the property _number
expect(instance).to.have.property('_number');
// expect(instance._number).to.be(expectedValueLiteral);
});
it('should have the property numberOfElements (base name: "number_of_elements")', function() {
// TODO: update the code to test the property numberOfElements
expect(instance).to.have.property('numberOfElements');
// expect(instance.numberOfElements).to.be(expectedValueLiteral);
});
it('should have the property size (base name: "size")', function() {
// TODO: update the code to test the property size
expect(instance).to.have.property('size');
// expect(instance.size).to.be(expectedValueLiteral);
});
it('should have the property sort (base name: "sort")', function() {
// TODO: update the code to test the property sort
expect(instance).to.have.property('sort');
// expect(instance.sort).to.be(expectedValueLiteral);
});
it('should have the property totalElements (base name: "total_elements")', function() {
// TODO: update the code to test the property totalElements
expect(instance).to.have.property('totalElements');
// expect(instance.totalElements).to.be(expectedValueLiteral);
});
it('should have the property totalPages (base name: "total_pages")', function() {
// TODO: update the code to test the property totalPages
expect(instance).to.have.property('totalPages');
// expect(instance.totalPages).to.be(expectedValueLiteral);
});
});
});
}));
|
import { Pragma, util } from "../../index"
const createTemplate = conf => new Pragma()
.run(function () {
util.createChains(this, 'config')
this.config = function(conf){
this.configChain.exec(conf)
return this
}
this.onConfig((conf = {}) => {
const defaults = ['events', 'chains', 'exports', 'persistentExports']
defaults.forEach(attr => {
if (!conf[attr]) return
this[`_${attr}`] = conf[attr]
delete conf[attr]
})
if (this._events) util.createEventChains(this, ...(this._events))
if (this._chains) util.createChains(this, ...(this._chains))
for (let [attr, val] of Object.entries(conf)) {
this[attr] = val
this.export(attr)
}
if (this._exports) this.export(...(this._exports))
})
this.export('exports', 'config', 'exportChain', 'configChain', 'onConfig')
}, function () {
if (typeof conf === 'object') this.config(conf)
})
export { createTemplate }
|
/* global __CONFIG__ */
import styled from 'styled-components'
const headerHeight = __CONFIG__.cssVariables.headerHeight
export const Container = styled.div`
height: 100%;
background-color: black;
`
export const Contents = styled.div`
overflow-y: auto;
position: absolute;
width: 100%;
top: ${headerHeight};
bottom: 0;
`
|
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; /* sentiment_very_dissatisfied icon*/
var _react = require("react");
var _react2 = _interopRequireDefault(_react);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
const Icon = (props = {}) => _react2.default.createElement(
"svg",
_extends({ viewBox: "0 0 48 48" }, props),
_react2.default.createElement("path", { d: "M23.99 4C12.94 4 4 12.95 4 24s8.94 20 19.99 20S44 35.05 44 24 35.04 4 23.99 4zM24 40c-8.84 0-16-7.16-16-16S15.16 8 24 8s16 7.16 16 16-7.16 16-16 16zm8.36-24.49l-2.12 2.13-2.12-2.13L26 17.64l2.12 2.12L26 21.88 28.12 24l2.12-2.12L32.36 24l2.13-2.12-2.13-2.12 2.13-2.12zM15.64 24l2.12-2.12L19.88 24 22 21.88l-2.12-2.12L22 17.64l-2.12-2.13-2.12 2.13-2.12-2.13-2.13 2.13 2.13 2.12-2.13 2.12zM24 28c-4.66 0-8.62 2.92-10.22 7h20.44c-1.6-4.08-5.56-7-10.22-7z" })
);
Icon.displayName = "SentimentVeryDissatisfiedIcon";
Icon.isMaterialIcon = true;
exports.default = Icon;
|
// ##############################
// // // javascript library for creating charts
// #############################
const Chartist = require("chartist");
// ##############################
// // // variables used to create animation on charts
// #############################
var delays = 80,
durations = 500;
var delays2 = 80,
durations2 = 500;
// ##############################
// // // Daily Sales
// #############################
const dailySalesChart = {
data: {
//labels: ["M", "T", "W", "T", "F", "S", "S"],
//series: [[12, 17, 7, 17, 23, 18, 38]]
},
options: {
lineSmooth: Chartist.Interpolation.cardinal({
tension: 0
}),
low: 0,
high: 50, // creative tim: we recommend you to set the high sa the biggest value + something for a better look
chartPadding: {
top: 0,
right: 0,
bottom: 0,
left: 0
},
showArea: true,
width: '400px',
height: '400px',
axisY: {
low: 0,
onlyInteger: true
}
},
// for animation
animation: {
draw: function(data) {
if(data.type === 'grid' && data.index === 0) {
data.element.attr({"style": "stroke:black;stroke-width:2"});
}
if (data.type === "line" || data.type === "area") {
data.element.animate({
d: {
begin: 600,
dur: 700,
from: data.path
.clone()
.scale(2, 0)
.translate(0, data.chartRect.height())
.stringify(),
to: data.path.clone().stringify(),
easing: Chartist.Svg.Easing.easeOutQuint
}
});
} else if (data.type === "point") {
data.element.animate({
opacity: {
begin: (data.index + 1) * delays,
dur: durations,
from: 0,
to: 1,
easing: "ease"
}
});
}
}
}
};
// ##############################
// // // Email Subscriptions
// #############################
const emailsSubscriptionChart = {
data: {
labels: [
"Jan",
"Feb",
"Mar",
"Apr",
"Mai",
"Jun",
"Jul",
"Aug",
"Sep",
"Oct",
"Nov",
"Dec"
],
series: [[542, 443, 320, 780, 553, 453, 326, 434, 568, 610, 756, 895]]
},
options: {
axisX: {
showGrid: false
},
low: 0,
high: 1000,
chartPadding: {
top: 0,
right: 5,
bottom: 0,
left: 0
}
},
responsiveOptions: [
[
"screen and (max-width: 640px)",
{
seriesBarDistance: 5,
axisX: {
labelInterpolationFnc: value => value[0]
}
}
]
],
animation: {
draw: data => {
if(data.type === 'grid' && data.index === 0) {
data.element.attr({"style": "stroke:black;stroke-width:2"});
}
if (data.type === "bar") {
data.element.animate({
opacity: {
begin: (data.index + 1) * delays2,
dur: durations2,
from: 0,
to: 1,
easing: "ease"
}
});
}
}
}
};
// ##############################
// // // Completed Tasks
// #############################
const completedTasksChart = {
data: {
labels: ["12am", "3pm", "6pm", "9pm", "12pm", "3am", "6am", "9am"],
series: [[230, 750, 450, 300, 280, 240, 200, 190]]
},
options: {
lineSmooth: Chartist.Interpolation.cardinal({
tension: 0
}),
low: 0,
high: 1000, // creative tim: we recommend you to set the high sa the biggest value + something for a better look
chartPadding: {
top: 0,
right: 0,
bottom: 0,
left: 0
}
},
animation: {
draw: data => {
if(data.type === 'grid' && data.index === 0) {
data.element.attr({"style": "stroke:black;stroke-width:2"});
}
if (data.type === "line" || data.type === "area") {
data.element.animate({
d: {
begin: 600,
dur: 700,
from: data.path
.clone()
.scale(1, 0)
.translate(0, data.chartRect.height())
.stringify(),
to: data.path.clone().stringify(),
easing: Chartist.Svg.Easing.easeOutQuint
}
});
} else if (data.type === "point") {
data.element.animate({
opacity: {
begin: (data.index + 1) * delays,
dur: durations,
from: 0,
to: 1,
easing: "ease"
}
});
}
}
}
};
module.exports = {
dailySalesChart,
emailsSubscriptionChart,
completedTasksChart
};
|
/*! p5.js v0.5.9 May 10, 2017 */ !function(a){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=a();else if("function"==typeof define&&define.amd)define([],a);else{var b;b="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this,b.p5=a()}}(function(){var a;return function a(b,c,d){function e(g,h){if(!c[g]){if(!b[g]){var i="function"==typeof require&&require;if(!h&&i)return i(g,!0);if(f)return f(g,!0);var j=new Error("Cannot find module '"+g+"'");throw j.code="MODULE_NOT_FOUND",j}var k=c[g]={exports:{}};b[g][0].call(k.exports,function(a){var c=b[g][1][a];return e(c?c:a)},k,k.exports,a,b,c,d)}return c[g].exports}for(var f="function"==typeof require&&require,g=0;g<d.length;g++)e(d[g]);return e}({1:[function(a,b,c){},{}],2:[function(b,c,d){(function(e,f){!function(b,e){"object"==typeof d&&void 0!==c?c.exports=e():"function"==typeof a&&a.amd?a(e):b.ES6Promise=e()}(this,function(){"use strict";function a(a){return"function"==typeof a||"object"==typeof a&&null!==a}function c(a){return"function"==typeof a}function d(a){X=a}function g(a){Y=a}function h(){return function(){return e.nextTick(m)}}function i(){return void 0!==W?function(){W(m)}:l()}function j(){var a=0,b=new _(m),c=document.createTextNode("");return b.observe(c,{characterData:!0}),function(){c.data=a=++a%2}}function k(){var a=new MessageChannel;return a.port1.onmessage=m,function(){return a.port2.postMessage(0)}}function l(){var a=setTimeout;return function(){return a(m,1)}}function m(){for(var a=0;a<V;a+=2){(0,ca[a])(ca[a+1]),ca[a]=void 0,ca[a+1]=void 0}V=0}function n(){try{var a=b,c=a("vertx");return W=c.runOnLoop||c.runOnContext,i()}catch(a){return l()}}function o(a,b){var c=arguments,d=this,e=new this.constructor(q);void 0===e[ea]&&J(e);var f=d._state;return f?function(){var a=c[f-1];Y(function(){return G(f,e,a,d._result)})}():C(d,e,a,b),e}function p(a){var b=this;if(a&&"object"==typeof a&&a.constructor===b)return a;var c=new b(q);return y(c,a),c}function q(){}function r(){return new TypeError("You cannot resolve a promise with itself")}function s(){return new TypeError("A promises callback cannot return that same promise.")}function t(a){try{return a.then}catch(a){return ia.error=a,ia}}function u(a,b,c,d){try{a.call(b,c,d)}catch(a){return a}}function v(a,b,c){Y(function(a){var d=!1,e=u(c,b,function(c){d||(d=!0,b!==c?y(a,c):A(a,c))},function(b){d||(d=!0,B(a,b))},"Settle: "+(a._label||" unknown promise"));!d&&e&&(d=!0,B(a,e))},a)}function w(a,b){b._state===ga?A(a,b._result):b._state===ha?B(a,b._result):C(b,void 0,function(b){return y(a,b)},function(b){return B(a,b)})}function x(a,b,d){b.constructor===a.constructor&&d===o&&b.constructor.resolve===p?w(a,b):d===ia?B(a,ia.error):void 0===d?A(a,b):c(d)?v(a,b,d):A(a,b)}function y(b,c){b===c?B(b,r()):a(c)?x(b,c,t(c)):A(b,c)}function z(a){a._onerror&&a._onerror(a._result),D(a)}function A(a,b){a._state===fa&&(a._result=b,a._state=ga,0!==a._subscribers.length&&Y(D,a))}function B(a,b){a._state===fa&&(a._state=ha,a._result=b,Y(z,a))}function C(a,b,c,d){var e=a._subscribers,f=e.length;a._onerror=null,e[f]=b,e[f+ga]=c,e[f+ha]=d,0===f&&a._state&&Y(D,a)}function D(a){var b=a._subscribers,c=a._state;if(0!==b.length){for(var d=void 0,e=void 0,f=a._result,g=0;g<b.length;g+=3)d=b[g],e=b[g+c],d?G(c,d,e,f):e(f);a._subscribers.length=0}}function E(){this.error=null}function F(a,b){try{return a(b)}catch(a){return ja.error=a,ja}}function G(a,b,d,e){var f=c(d),g=void 0,h=void 0,i=void 0,j=void 0;if(f){if(g=F(d,e),g===ja?(j=!0,h=g.error,g=null):i=!0,b===g)return void B(b,s())}else g=e,i=!0;b._state!==fa||(f&&i?y(b,g):j?B(b,h):a===ga?A(b,g):a===ha&&B(b,g))}function H(a,b){try{b(function(b){y(a,b)},function(b){B(a,b)})}catch(b){B(a,b)}}function I(){return ka++}function J(a){a[ea]=ka++,a._state=void 0,a._result=void 0,a._subscribers=[]}function K(a,b){this._instanceConstructor=a,this.promise=new a(q),this.promise[ea]||J(this.promise),U(b)?(this._input=b,this.length=b.length,this._remaining=b.length,this._result=new Array(this.length),0===this.length?A(this.promise,this._result):(this.length=this.length||0,this._enumerate(),0===this._remaining&&A(this.promise,this._result))):B(this.promise,L())}function L(){return new Error("Array Methods must be provided an Array")}function M(a){return new K(this,a).promise}function N(a){var b=this;return new b(U(a)?function(c,d){for(var e=a.length,f=0;f<e;f++)b.resolve(a[f]).then(c,d)}:function(a,b){return b(new TypeError("You must pass an array to race."))})}function O(a){var b=this,c=new b(q);return B(c,a),c}function P(){throw new TypeError("You must pass a resolver function as the first argument to the promise constructor")}function Q(){throw new TypeError("Failed to construct 'Promise': Please use the 'new' operator, this object constructor cannot be called as a function.")}function R(a){this[ea]=I(),this._result=this._state=void 0,this._subscribers=[],q!==a&&("function"!=typeof a&&P(),this instanceof R?H(this,a):Q())}function S(){var a=void 0;if(void 0!==f)a=f;else if("undefined"!=typeof self)a=self;else try{a=Function("return this")()}catch(a){throw new Error("polyfill failed because global object is unavailable in this environment")}var b=a.Promise;if(b){var c=null;try{c=Object.prototype.toString.call(b.resolve())}catch(a){}if("[object Promise]"===c&&!b.cast)return}a.Promise=R}var T=void 0;T=Array.isArray?Array.isArray:function(a){return"[object Array]"===Object.prototype.toString.call(a)};var U=T,V=0,W=void 0,X=void 0,Y=function(a,b){ca[V]=a,ca[V+1]=b,2===(V+=2)&&(X?X(m):da())},Z="undefined"!=typeof window?window:void 0,$=Z||{},_=$.MutationObserver||$.WebKitMutationObserver,aa="undefined"==typeof self&&void 0!==e&&"[object process]"==={}.toString.call(e),ba="undefined"!=typeof Uint8ClampedArray&&"undefined"!=typeof importScripts&&"undefined"!=typeof MessageChannel,ca=new Array(1e3),da=void 0;da=aa?h():_?j():ba?k():void 0===Z&&"function"==typeof b?n():l();var ea=Math.random().toString(36).substring(16),fa=void 0,ga=1,ha=2,ia=new E,ja=new E,ka=0;return K.prototype._enumerate=function(){for(var a=this.length,b=this._input,c=0;this._state===fa&&c<a;c++)this._eachEntry(b[c],c)},K.prototype._eachEntry=function(a,b){var c=this._instanceConstructor,d=c.resolve;if(d===p){var e=t(a);if(e===o&&a._state!==fa)this._settledAt(a._state,b,a._result);else if("function"!=typeof e)this._remaining--,this._result[b]=a;else if(c===R){var f=new c(q);x(f,a,e),this._willSettleAt(f,b)}else this._willSettleAt(new c(function(b){return b(a)}),b)}else this._willSettleAt(d(a),b)},K.prototype._settledAt=function(a,b,c){var d=this.promise;d._state===fa&&(this._remaining--,a===ha?B(d,c):this._result[b]=c),0===this._remaining&&A(d,this._result)},K.prototype._willSettleAt=function(a,b){var c=this;C(a,void 0,function(a){return c._settledAt(ga,b,a)},function(a){return c._settledAt(ha,b,a)})},R.all=M,R.race=N,R.resolve=p,R.reject=O,R._setScheduler=d,R._setAsap=g,R._asap=Y,R.prototype={constructor:R,then:o,catch:function(a){return this.then(null,a)}},R.polyfill=S,R.Promise=R,R})}).call(this,b("_process"),"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{_process:31}],3:[function(b,c,d){!function(b,e){if("function"==typeof a&&a.amd)a(["exports","module"],e);else if(void 0!==d&&void 0!==c)e(d,c);else{var f={exports:{}};e(f.exports,f),b.fetchJsonp=f.exports}}(this,function(a,b){"use strict";function c(){return"jsonp_"+Date.now()+"_"+Math.ceil(1e5*Math.random())}function d(a){try{delete window[a]}catch(b){window[a]=void 0}}function e(a){var b=document.getElementById(a);document.getElementsByTagName("head")[0].removeChild(b)}function f(a){var b=arguments.length<=1||void 0===arguments[1]?{}:arguments[1],f=a,h=b.timeout||g.timeout,i=b.jsonpCallback||g.jsonpCallback,j=void 0;return new Promise(function(g,k){var l=b.jsonpCallbackFunction||c(),m=i+"_"+l;window[l]=function(a){g({ok:!0,json:function(){return Promise.resolve(a)}}),j&&clearTimeout(j),e(m),d(l)},f+=f.indexOf("?")===-1?"?":"&";var n=document.createElement("script");n.setAttribute("src",""+f+i+"="+l),n.id=m,document.getElementsByTagName("head")[0].appendChild(n),j=setTimeout(function(){k(new Error("JSONP request to "+a+" timed out")),d(l),e(m)},h)})}var g={timeout:5e3,jsonpCallback:"callback",jsonpCallbackFunction:null};b.exports=f})},{}],4:[function(a,b,c){"use strict";c.argument=function(a,b){if(!a)throw new Error(b)},c.assert=c.argument},{}],5:[function(a,b,c){"use strict";function d(a,b,c,d,e){a.beginPath(),a.moveTo(b,c),a.lineTo(d,e),a.stroke()}c.line=d},{}],6:[function(a,b,c){"use strict";function d(a){this.font=a}function e(a){this.cmap=a}function f(a,b){this.encoding=a,this.charset=b}function g(a){var b;switch(a.version){case 1:this.names=c.standardNames.slice();break;case 2:for(this.names=new Array(a.numberOfGlyphs),b=0;b<a.numberOfGlyphs;b++)a.glyphNameIndex[b]<c.standardNames.length?this.names[b]=c.standardNames[a.glyphNameIndex[b]]:this.names[b]=a.names[a.glyphNameIndex[b]-c.standardNames.length];break;case 2.5:for(this.names=new Array(a.numberOfGlyphs),b=0;b<a.numberOfGlyphs;b++)this.names[b]=c.standardNames[b+a.glyphNameIndex[b]];break;case 3:this.names=[]}}function h(a){for(var b,c=a.tables.cmap.glyphIndexMap,d=Object.keys(c),e=0;e<d.length;e+=1){var f=d[e],g=c[f];b=a.glyphs.get(g),b.addUnicode(parseInt(f))}for(e=0;e<a.glyphs.length;e+=1)b=a.glyphs.get(e),a.cffEncoding?b.name=a.cffEncoding.charset[e]:b.name=a.glyphNames.glyphIndexToName(e)}var i=[".notdef","space","exclam","quotedbl","numbersign","dollar","percent","ampersand","quoteright","parenleft","parenright","asterisk","plus","comma","hyphen","period","slash","zero","one","two","three","four","five","six","seven","eight","nine","colon","semicolon","less","equal","greater","question","at","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z","bracketleft","backslash","bracketright","asciicircum","underscore","quoteleft","a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z","braceleft","bar","braceright","asciitilde","exclamdown","cent","sterling","fraction","yen","florin","section","currency","quotesingle","quotedblleft","guillemotleft","guilsinglleft","guilsinglright","fi","fl","endash","dagger","daggerdbl","periodcentered","paragraph","bullet","quotesinglbase","quotedblbase","quotedblright","guillemotright","ellipsis","perthousand","questiondown","grave","acute","circumflex","tilde","macron","breve","dotaccent","dieresis","ring","cedilla","hungarumlaut","ogonek","caron","emdash","AE","ordfeminine","Lslash","Oslash","OE","ordmasculine","ae","dotlessi","lslash","oslash","oe","germandbls","onesuperior","logicalnot","mu","trademark","Eth","onehalf","plusminus","Thorn","onequarter","divide","brokenbar","degree","thorn","threequarters","twosuperior","registered","minus","eth","multiply","threesuperior","copyright","Aacute","Acircumflex","Adieresis","Agrave","Aring","Atilde","Ccedilla","Eacute","Ecircumflex","Edieresis","Egrave","Iacute","Icircumflex","Idieresis","Igrave","Ntilde","Oacute","Ocircumflex","Odieresis","Ograve","Otilde","Scaron","Uacute","Ucircumflex","Udieresis","Ugrave","Yacute","Ydieresis","Zcaron","aacute","acircumflex","adieresis","agrave","aring","atilde","ccedilla","eacute","ecircumflex","edieresis","egrave","iacute","icircumflex","idieresis","igrave","ntilde","oacute","ocircumflex","odieresis","ograve","otilde","scaron","uacute","ucircumflex","udieresis","ugrave","yacute","ydieresis","zcaron","exclamsmall","Hungarumlautsmall","dollaroldstyle","dollarsuperior","ampersandsmall","Acutesmall","parenleftsuperior","parenrightsuperior","266 ff","onedotenleader","zerooldstyle","oneoldstyle","twooldstyle","threeoldstyle","fouroldstyle","fiveoldstyle","sixoldstyle","sevenoldstyle","eightoldstyle","nineoldstyle","commasuperior","threequartersemdash","periodsuperior","questionsmall","asuperior","bsuperior","centsuperior","dsuperior","esuperior","isuperior","lsuperior","msuperior","nsuperior","osuperior","rsuperior","ssuperior","tsuperior","ff","ffi","ffl","parenleftinferior","parenrightinferior","Circumflexsmall","hyphensuperior","Gravesmall","Asmall","Bsmall","Csmall","Dsmall","Esmall","Fsmall","Gsmall","Hsmall","Ismall","Jsmall","Ksmall","Lsmall","Msmall","Nsmall","Osmall","Psmall","Qsmall","Rsmall","Ssmall","Tsmall","Usmall","Vsmall","Wsmall","Xsmall","Ysmall","Zsmall","colonmonetary","onefitted","rupiah","Tildesmall","exclamdownsmall","centoldstyle","Lslashsmall","Scaronsmall","Zcaronsmall","Dieresissmall","Brevesmall","Caronsmall","Dotaccentsmall","Macronsmall","figuredash","hypheninferior","Ogoneksmall","Ringsmall","Cedillasmall","questiondownsmall","oneeighth","threeeighths","fiveeighths","seveneighths","onethird","twothirds","zerosuperior","foursuperior","fivesuperior","sixsuperior","sevensuperior","eightsuperior","ninesuperior","zeroinferior","oneinferior","twoinferior","threeinferior","fourinferior","fiveinferior","sixinferior","seveninferior","eightinferior","nineinferior","centinferior","dollarinferior","periodinferior","commainferior","Agravesmall","Aacutesmall","Acircumflexsmall","Atildesmall","Adieresissmall","Aringsmall","AEsmall","Ccedillasmall","Egravesmall","Eacutesmall","Ecircumflexsmall","Edieresissmall","Igravesmall","Iacutesmall","Icircumflexsmall","Idieresissmall","Ethsmall","Ntildesmall","Ogravesmall","Oacutesmall","Ocircumflexsmall","Otildesmall","Odieresissmall","OEsmall","Oslashsmall","Ugravesmall","Uacutesmall","Ucircumflexsmall","Udieresissmall","Yacutesmall","Thornsmall","Ydieresissmall","001.000","001.001","001.002","001.003","Black","Bold","Book","Light","Medium","Regular","Roman","Semibold"],j=["","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","space","exclam","quotedbl","numbersign","dollar","percent","ampersand","quoteright","parenleft","parenright","asterisk","plus","comma","hyphen","period","slash","zero","one","two","three","four","five","six","seven","eight","nine","colon","semicolon","less","equal","greater","question","at","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z","bracketleft","backslash","bracketright","asciicircum","underscore","quoteleft","a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z","braceleft","bar","braceright","asciitilde","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","exclamdown","cent","sterling","fraction","yen","florin","section","currency","quotesingle","quotedblleft","guillemotleft","guilsinglleft","guilsinglright","fi","fl","","endash","dagger","daggerdbl","periodcentered","","paragraph","bullet","quotesinglbase","quotedblbase","quotedblright","guillemotright","ellipsis","perthousand","","questiondown","","grave","acute","circumflex","tilde","macron","breve","dotaccent","dieresis","","ring","cedilla","","hungarumlaut","ogonek","caron","emdash","","","","","","","","","","","","","","","","","AE","","ordfeminine","","","","","Lslash","Oslash","OE","ordmasculine","","","","","","ae","","","","dotlessi","","","lslash","oslash","oe","germandbls"],k=["","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","space","exclamsmall","Hungarumlautsmall","","dollaroldstyle","dollarsuperior","ampersandsmall","Acutesmall","parenleftsuperior","parenrightsuperior","twodotenleader","onedotenleader","comma","hyphen","period","fraction","zerooldstyle","oneoldstyle","twooldstyle","threeoldstyle","fouroldstyle","fiveoldstyle","sixoldstyle","sevenoldstyle","eightoldstyle","nineoldstyle","colon","semicolon","commasuperior","threequartersemdash","periodsuperior","questionsmall","","asuperior","bsuperior","centsuperior","dsuperior","esuperior","","","isuperior","","","lsuperior","msuperior","nsuperior","osuperior","","","rsuperior","ssuperior","tsuperior","","ff","fi","fl","ffi","ffl","parenleftinferior","","parenrightinferior","Circumflexsmall","hyphensuperior","Gravesmall","Asmall","Bsmall","Csmall","Dsmall","Esmall","Fsmall","Gsmall","Hsmall","Ismall","Jsmall","Ksmall","Lsmall","Msmall","Nsmall","Osmall","Psmall","Qsmall","Rsmall","Ssmall","Tsmall","Usmall","Vsmall","Wsmall","Xsmall","Ysmall","Zsmall","colonmonetary","onefitted","rupiah","Tildesmall","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","exclamdownsmall","centoldstyle","Lslashsmall","","","Scaronsmall","Zcaronsmall","Dieresissmall","Brevesmall","Caronsmall","","Dotaccentsmall","","","Macronsmall","","","figuredash","hypheninferior","","","Ogoneksmall","Ringsmall","Cedillasmall","","","","onequarter","onehalf","threequarters","questiondownsmall","oneeighth","threeeighths","fiveeighths","seveneighths","onethird","twothirds","","","zerosuperior","onesuperior","twosuperior","threesuperior","foursuperior","fivesuperior","sixsuperior","sevensuperior","eightsuperior","ninesuperior","zeroinferior","oneinferior","twoinferior","threeinferior","fourinferior","fiveinferior","sixinferior","seveninferior","eightinferior","nineinferior","centinferior","dollarinferior","periodinferior","commainferior","Agravesmall","Aacutesmall","Acircumflexsmall","Atildesmall","Adieresissmall","Aringsmall","AEsmall","Ccedillasmall","Egravesmall","Eacutesmall","Ecircumflexsmall","Edieresissmall","Igravesmall","Iacutesmall","Icircumflexsmall","Idieresissmall","Ethsmall","Ntildesmall","Ogravesmall","Oacutesmall","Ocircumflexsmall","Otildesmall","Odieresissmall","OEsmall","Oslashsmall","Ugravesmall","Uacutesmall","Ucircumflexsmall","Udieresissmall","Yacutesmall","Thornsmall","Ydieresissmall"],l=[".notdef",".null","nonmarkingreturn","space","exclam","quotedbl","numbersign","dollar","percent","ampersand","quotesingle","parenleft","parenright","asterisk","plus","comma","hyphen","period","slash","zero","one","two","three","four","five","six","seven","eight","nine","colon","semicolon","less","equal","greater","question","at","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z","bracketleft","backslash","bracketright","asciicircum","underscore","grave","a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z","braceleft","bar","braceright","asciitilde","Adieresis","Aring","Ccedilla","Eacute","Ntilde","Odieresis","Udieresis","aacute","agrave","acircumflex","adieresis","atilde","aring","ccedilla","eacute","egrave","ecircumflex","edieresis","iacute","igrave","icircumflex","idieresis","ntilde","oacute","ograve","ocircumflex","odieresis","otilde","uacute","ugrave","ucircumflex","udieresis","dagger","degree","cent","sterling","section","bullet","paragraph","germandbls","registered","copyright","trademark","acute","dieresis","notequal","AE","Oslash","infinity","plusminus","lessequal","greaterequal","yen","mu","partialdiff","summation","product","pi","integral","ordfeminine","ordmasculine","Omega","ae","oslash","questiondown","exclamdown","logicalnot","radical","florin","approxequal","Delta","guillemotleft","guillemotright","ellipsis","nonbreakingspace","Agrave","Atilde","Otilde","OE","oe","endash","emdash","quotedblleft","quotedblright","quoteleft","quoteright","divide","lozenge","ydieresis","Ydieresis","fraction","currency","guilsinglleft","guilsinglright","fi","fl","daggerdbl","periodcentered","quotesinglbase","quotedblbase","perthousand","Acircumflex","Ecircumflex","Aacute","Edieresis","Egrave","Iacute","Icircumflex","Idieresis","Igrave","Oacute","Ocircumflex","apple","Ograve","Uacute","Ucircumflex","Ugrave","dotlessi","circumflex","tilde","macron","breve","dotaccent","ring","cedilla","hungarumlaut","ogonek","caron","Lslash","lslash","Scaron","scaron","Zcaron","zcaron","brokenbar","Eth","eth","Yacute","yacute","Thorn","thorn","minus","multiply","onesuperior","twosuperior","threesuperior","onehalf","onequarter","threequarters","franc","Gbreve","gbreve","Idotaccent","Scedilla","scedilla","Cacute","cacute","Ccaron","ccaron","dcroat"];d.prototype.charToGlyphIndex=function(a){var b=a.charCodeAt(0),c=this.font.glyphs;if(!c)return null;for(var d=0;d<c.length;d+=1)for(var e=c.get(d),f=0;f<e.unicodes.length;f+=1)if(e.unicodes[f]===b)return d},e.prototype.charToGlyphIndex=function(a){return this.cmap.glyphIndexMap[a.charCodeAt(0)]||0},f.prototype.charToGlyphIndex=function(a){var b=a.charCodeAt(0),c=this.encoding[b];return this.charset.indexOf(c)},g.prototype.nameToGlyphIndex=function(a){return this.names.indexOf(a)},g.prototype.glyphIndexToName=function(a){return this.names[a]},c.cffStandardStrings=i,c.cffStandardEncoding=j,c.cffExpertEncoding=k,c.standardNames=l,c.DefaultEncoding=d,c.CmapEncoding=e,c.CffEncoding=f,c.GlyphNames=g,c.addGlyphNames=h},{}],7:[function(a,b,c){"use strict";function d(a){a=a||{},this.names={fontFamily:{en:a.familyName||" "},fontSubfamily:{en:a.styleName||" "},designer:{en:a.designer||" "},designerURL:{en:a.designerURL||" "},manufacturer:{en:a.manufacturer||" "},manufacturerURL:{en:a.manufacturerURL||" "},license:{en:a.license||" "},licenseURL:{en:a.licenseURL||" "},version:{en:a.version||"Version 0.1"},description:{en:a.description||" "},copyright:{en:a.copyright||" "},trademark:{en:a.trademark||" "}},this.unitsPerEm=a.unitsPerEm||1e3,this.ascender=a.ascender,this.descender=a.descender,this.supported=!0,this.glyphs=new h.GlyphSet(this,a.glyphs||[]),this.encoding=new g.DefaultEncoding(this),this.tables={}}var e=a("./path"),f=a("./tables/sfnt"),g=a("./encoding"),h=a("./glyphset");d.prototype.hasChar=function(a){return null!==this.encoding.charToGlyphIndex(a)},d.prototype.charToGlyphIndex=function(a){return this.encoding.charToGlyphIndex(a)},d.prototype.charToGlyph=function(a){var b=this.charToGlyphIndex(a),c=this.glyphs.get(b);return c||(c=this.glyphs.get(0)),c},d.prototype.stringToGlyphs=function(a){for(var b=[],c=0;c<a.length;c+=1){var d=a[c];b.push(this.charToGlyph(d))}return b},d.prototype.nameToGlyphIndex=function(a){return this.glyphNames.nameToGlyphIndex(a)},d.prototype.nameToGlyph=function(a){var b=this.nametoGlyphIndex(a),c=this.glyphs.get(b);return c||(c=this.glyphs.get(0)),c},d.prototype.glyphIndexToName=function(a){return this.glyphNames.glyphIndexToName?this.glyphNames.glyphIndexToName(a):""},d.prototype.getKerningValue=function(a,b){a=a.index||a,b=b.index||b;var c=this.getGposKerningValue;return c?c(a,b):this.kerningPairs[a+","+b]||0},d.prototype.forEachGlyph=function(a,b,c,d,e,f){b=void 0!==b?b:0,c=void 0!==c?c:0,d=void 0!==d?d:72,e=e||{};for(var g=void 0===e.kerning||e.kerning,h=1/this.unitsPerEm*d,i=this.stringToGlyphs(a),j=0;j<i.length;j+=1){var k=i[j];if(f(k,b,c,d,e),k.advanceWidth&&(b+=k.advanceWidth*h),g&&j<i.length-1){b+=this.getKerningValue(k,i[j+1])*h}}},d.prototype.getPath=function(a,b,c,d,f){var g=new e.Path;return this.forEachGlyph(a,b,c,d,f,function(a,b,c,d){var e=a.getPath(b,c,d);g.extend(e)}),g},d.prototype.draw=function(a,b,c,d,e,f){this.getPath(b,c,d,e,f).draw(a)},d.prototype.drawPoints=function(a,b,c,d,e,f){this.forEachGlyph(b,c,d,e,f,function(b,c,d,e){b.drawPoints(a,c,d,e)})},d.prototype.drawMetrics=function(a,b,c,d,e,f){this.forEachGlyph(b,c,d,e,f,function(b,c,d,e){b.drawMetrics(a,c,d,e)})},d.prototype.getEnglishName=function(a){var b=this.names[a];if(b)return b.en},d.prototype.validate=function(){function a(a,b){a||c.push(b)}function b(b){var c=d.getEnglishName(b);a(c&&c.trim().length>0,"No English "+b+" specified.")}var c=[],d=this;b("fontFamily"),b("weightName"),b("manufacturer"),b("copyright"),b("version"),a(this.unitsPerEm>0,"No unitsPerEm specified.")},d.prototype.toTables=function(){return f.fontToTable(this)},d.prototype.toBuffer=function(){for(var a=this.toTables(),b=a.encode(),c=new ArrayBuffer(b.length),d=new Uint8Array(c),e=0;e<b.length;e++)d[e]=b[e];return c},d.prototype.download=function(){var a=this.getEnglishName("fontFamily"),b=this.getEnglishName("fontSubfamily"),c=a.replace(/\s/g,"")+"-"+b+".otf",d=this.toBuffer();window.requestFileSystem=window.requestFileSystem||window.webkitRequestFileSystem,window.requestFileSystem(window.TEMPORARY,d.byteLength,function(a){a.root.getFile(c,{create:!0},function(a){a.createWriter(function(b){var c=new DataView(d),e=new Blob([c],{type:"font/opentype"});b.write(e),b.addEventListener("writeend",function(){location.href=a.toURL()},!1)})})},function(a){throw a})},c.Font=d},{"./encoding":6,"./glyphset":9,"./path":12,"./tables/sfnt":29}],8:[function(a,b,c){"use strict";function d(a,b){var c=b||{commands:[]};return{configurable:!0,get:function(){return"function"==typeof c&&(c=c()),c},set:function(a){c=a}}}function e(a){this.bindConstructorValues(a)}var f=a("./check"),g=a("./draw"),h=a("./path");e.prototype.bindConstructorValues=function(a){this.index=a.index||0,this.name=a.name||null,this.unicode=a.unicode||void 0,this.unicodes=a.unicodes||void 0!==a.unicode?[a.unicode]:[],a.xMin&&(this.xMin=a.xMin),a.yMin&&(this.yMin=a.yMin),a.xMax&&(this.xMax=a.xMax),a.yMax&&(this.yMax=a.yMax),a.advanceWidth&&(this.advanceWidth=a.advanceWidth),Object.defineProperty(this,"path",d(this,a.path))},e.prototype.addUnicode=function(a){0===this.unicodes.length&&(this.unicode=a),this.unicodes.push(a)},e.prototype.getPath=function(a,b,c){a=void 0!==a?a:0,b=void 0!==b?b:0,c=void 0!==c?c:72;for(var d=1/this.path.unitsPerEm*c,e=new h.Path,f=this.path.commands,g=0;g<f.length;g+=1){var i=f[g];"M"===i.type?e.moveTo(a+i.x*d,b+-i.y*d):"L"===i.type?e.lineTo(a+i.x*d,b+-i.y*d):"Q"===i.type?e.quadraticCurveTo(a+i.x1*d,b+-i.y1*d,a+i.x*d,b+-i.y*d):"C"===i.type?e.curveTo(a+i.x1*d,b+-i.y1*d,a+i.x2*d,b+-i.y2*d,a+i.x*d,b+-i.y*d):"Z"===i.type&&e.closePath()}return e},e.prototype.getContours=function(){if(void 0===this.points)return[];for(var a=[],b=[],c=0;c<this.points.length;c+=1){var d=this.points[c];b.push(d),d.lastPointOfContour&&(a.push(b),b=[])}return f.argument(0===b.length,"There are still points left in the current contour."),a},e.prototype.getMetrics=function(){for(var a=this.path.commands,b=[],c=[],d=0;d<a.length;d+=1){var e=a[d];"Z"!==e.type&&(b.push(e.x),c.push(e.y)),"Q"!==e.type&&"C"!==e.type||(b.push(e.x1),c.push(e.y1)),"C"===e.type&&(b.push(e.x2),c.push(e.y2))}var f={xMin:Math.min.apply(null,b),yMin:Math.min.apply(null,c),xMax:Math.max.apply(null,b),yMax:Math.max.apply(null,c),leftSideBearing:0};return isFinite(f.xMin)||(f.xMin=0),isFinite(f.xMax)||(f.xMax=this.advanceWidth),isFinite(f.yMin)||(f.yMin=0),isFinite(f.yMax)||(f.yMax=0),f.rightSideBearing=this.advanceWidth-f.leftSideBearing-(f.xMax-f.xMin),f},e.prototype.draw=function(a,b,c,d){this.getPath(b,c,d).draw(a)},e.prototype.drawPoints=function(a,b,c,d){function e(b,c,d,e){var f=2*Math.PI;a.beginPath();for(var g=0;g<b.length;g+=1)a.moveTo(c+b[g].x*e,d+b[g].y*e),a.arc(c+b[g].x*e,d+b[g].y*e,2,0,f,!1);a.closePath(),a.fill()}b=void 0!==b?b:0,c=void 0!==c?c:0,d=void 0!==d?d:24;for(var f=1/this.path.unitsPerEm*d,g=[],h=[],i=this.path,j=0;j<i.commands.length;j+=1){var k=i.commands[j];void 0!==k.x&&g.push({x:k.x,y:-k.y}),void 0!==k.x1&&h.push({x:k.x1,y:-k.y1}),void 0!==k.x2&&h.push({x:k.x2,y:-k.y2})}a.fillStyle="blue",e(g,b,c,f),a.fillStyle="red",e(h,b,c,f)},e.prototype.drawMetrics=function(a,b,c,d){var e;b=void 0!==b?b:0,c=void 0!==c?c:0,d=void 0!==d?d:24,e=1/this.path.unitsPerEm*d,a.lineWidth=1,a.strokeStyle="black",g.line(a,b,-1e4,b,1e4),g.line(a,-1e4,c,1e4,c);var f=this.xMin||0,h=this.yMin||0,i=this.xMax||0,j=this.yMax||0,k=this.advanceWidth||0;a.strokeStyle="blue",g.line(a,b+f*e,-1e4,b+f*e,1e4),g.line(a,b+i*e,-1e4,b+i*e,1e4),g.line(a,-1e4,c+-h*e,1e4,c+-h*e),g.line(a,-1e4,c+-j*e,1e4,c+-j*e),a.strokeStyle="green",g.line(a,b+k*e,-1e4,b+k*e,1e4)},c.Glyph=e},{"./check":4,"./draw":5,"./path":12}],9:[function(a,b,c){"use strict";function d(a,b){if(this.font=a,this.glyphs={},Array.isArray(b))for(var c=0;c<b.length;c++)this.glyphs[c]=b[c];this.length=b&&b.length||0}function e(a,b){return new h.Glyph({index:b,font:a})}function f(a,b,c,d,e,f){return function(){var g=new h.Glyph({index:b,font:a});return g.path=function(){c(g,d,e);var b=f(a.glyphs,g);return b.unitsPerEm=a.unitsPerEm,b},g}}function g(a,b,c,d){return function(){var e=new h.Glyph({index:b,font:a});return e.path=function(){var b=c(a,e,d);return b.unitsPerEm=a.unitsPerEm,b},e}}var h=a("./glyph");d.prototype.get=function(a){return"function"==typeof this.glyphs[a]&&(this.glyphs[a]=this.glyphs[a]()),this.glyphs[a]},d.prototype.push=function(a,b){this.glyphs[a]=b,this.length++},c.GlyphSet=d,c.glyphLoader=e,c.ttfGlyphLoader=f,c.cffGlyphLoader=g},{"./glyph":8}],10:[function(a,b,c){"use strict";function d(a){for(var b=new ArrayBuffer(a.length),c=new Uint8Array(b),d=0;d<a.length;d+=1)c[d]=a[d];return b}function e(b,c){a("fs").readFile(b,function(a,b){if(a)return c(a.message);c(null,d(b))})}function f(a,b){var c=new XMLHttpRequest;c.open("get",a,!0),c.responseType="arraybuffer",c.onload=function(){return 200!==c.status?b("Font could not be loaded: "+c.statusText):b(null,c.response)},c.send()}function g(a){var b,c,d,e,f,g,h,i,l,n,D=new k.Font,E=new DataView(a,0),F=m.getFixed(E,0);if(1===F)D.outlinesFormat="truetype";else{if("OTTO"!==(F=m.getTag(E,0)))throw new Error("Unsupported OpenType version "+F);D.outlinesFormat="cff"}for(var G=m.getUShort(E,4),H=12,I=0;I<G;I+=1){var J=m.getTag(E,H),K=m.getULong(E,H+8);switch(J){case"cmap":D.tables.cmap=o.parse(E,K),D.encoding=new j.CmapEncoding(D.tables.cmap);break;case"fvar":e=K;break;case"head":D.tables.head=t.parse(E,K),D.unitsPerEm=D.tables.head.unitsPerEm,b=D.tables.head.indexToLocFormat;break;case"hhea":D.tables.hhea=u.parse(E,K),D.ascender=D.tables.hhea.ascender,D.descender=D.tables.hhea.descender,D.numberOfHMetrics=D.tables.hhea.numberOfHMetrics;break;case"hmtx":h=K;break;case"ltag":c=x.parse(E,K);break;case"maxp":D.tables.maxp=z.parse(E,K),D.numGlyphs=D.tables.maxp.numGlyphs;break;case"name":n=K;break;case"OS/2":D.tables.os2=B.parse(E,K);break;case"post":D.tables.post=C.parse(E,K),D.glyphNames=new j.GlyphNames(D.tables.post);break;case"glyf":f=K;break;case"loca":l=K;break;case"CFF ":d=K;break;case"kern":i=K;break;case"GPOS":g=K}H+=16}if(D.tables.name=A.parse(E,n,c),D.names=D.tables.name,f&&l){var L=0===b,M=y.parse(E,l,D.numGlyphs,L);D.glyphs=r.parse(E,f,M,D)}else{if(!d)throw new Error("Font doesn't contain TrueType or CFF outlines.");p.parse(E,d,D)}return v.parse(E,h,D.numberOfHMetrics,D.numGlyphs,D.glyphs),j.addGlyphNames(D),D.kerningPairs=i?w.parse(E,i):{},g&&s.parse(E,g,D),e&&(D.tables.fvar=q.parse(E,e,D.names)),D}function h(a,b){("undefined"==typeof window?e:f)(a,function(a,c){return a?b(a):b(null,g(c))})}function i(b){return g(d(a("fs").readFileSync(b)))}var j=a("./encoding"),k=a("./font"),l=a("./glyph"),m=a("./parse"),n=a("./path"),o=a("./tables/cmap"),p=a("./tables/cff"),q=a("./tables/fvar"),r=a("./tables/glyf"),s=a("./tables/gpos"),t=a("./tables/head"),u=a("./tables/hhea"),v=a("./tables/hmtx"),w=a("./tables/kern"),x=a("./tables/ltag"),y=a("./tables/loca"),z=a("./tables/maxp"),A=a("./tables/name"),B=a("./tables/os2"),C=a("./tables/post");c._parse=m,c.Font=k.Font,c.Glyph=l.Glyph,c.Path=n.Path,c.parse=g,c.load=h,c.loadSync=i},{"./encoding":6,"./font":7,"./glyph":8,"./parse":11,"./path":12,"./tables/cff":14,"./tables/cmap":15,"./tables/fvar":16,"./tables/glyf":17,"./tables/gpos":18,"./tables/head":19,"./tables/hhea":20,"./tables/hmtx":21,"./tables/kern":22,"./tables/loca":23,"./tables/ltag":24,"./tables/maxp":25,"./tables/name":26,"./tables/os2":27,"./tables/post":28,fs:1}],11:[function(a,b,c){"use strict";function d(a,b){this.data=a,this.offset=b,this.relativeOffset=0}c.getByte=function(a,b){return a.getUint8(b)},c.getCard8=c.getByte,c.getUShort=function(a,b){return a.getUint16(b,!1)},c.getCard16=c.getUShort,c.getShort=function(a,b){return a.getInt16(b,!1)},c.getULong=function(a,b){return a.getUint32(b,!1)},c.getFixed=function(a,b){return a.getInt16(b,!1)+a.getUint16(b+2,!1)/65535},c.getTag=function(a,b){for(var c="",d=b;d<b+4;d+=1)c+=String.fromCharCode(a.getInt8(d));return c},c.getOffset=function(a,b,c){
for(var d=0,e=0;e<c;e+=1)d<<=8,d+=a.getUint8(b+e);return d},c.getBytes=function(a,b,c){for(var d=[],e=b;e<c;e+=1)d.push(a.getUint8(e));return d},c.bytesToString=function(a){for(var b="",c=0;c<a.length;c+=1)b+=String.fromCharCode(a[c]);return b};var e={byte:1,uShort:2,short:2,uLong:4,fixed:4,longDateTime:8,tag:4};d.prototype.parseByte=function(){var a=this.data.getUint8(this.offset+this.relativeOffset);return this.relativeOffset+=1,a},d.prototype.parseChar=function(){var a=this.data.getInt8(this.offset+this.relativeOffset);return this.relativeOffset+=1,a},d.prototype.parseCard8=d.prototype.parseByte,d.prototype.parseUShort=function(){var a=this.data.getUint16(this.offset+this.relativeOffset);return this.relativeOffset+=2,a},d.prototype.parseCard16=d.prototype.parseUShort,d.prototype.parseSID=d.prototype.parseUShort,d.prototype.parseOffset16=d.prototype.parseUShort,d.prototype.parseShort=function(){var a=this.data.getInt16(this.offset+this.relativeOffset);return this.relativeOffset+=2,a},d.prototype.parseF2Dot14=function(){var a=this.data.getInt16(this.offset+this.relativeOffset)/16384;return this.relativeOffset+=2,a},d.prototype.parseULong=function(){var a=c.getULong(this.data,this.offset+this.relativeOffset);return this.relativeOffset+=4,a},d.prototype.parseFixed=function(){var a=c.getFixed(this.data,this.offset+this.relativeOffset);return this.relativeOffset+=4,a},d.prototype.parseOffset16List=d.prototype.parseUShortList=function(a){for(var b=new Array(a),d=this.data,e=this.offset+this.relativeOffset,f=0;f<a;f++)b[f]=c.getUShort(d,e),e+=2;return this.relativeOffset+=2*a,b},d.prototype.parseString=function(a){var b=this.data,c=this.offset+this.relativeOffset,d="";this.relativeOffset+=a;for(var e=0;e<a;e++)d+=String.fromCharCode(b.getUint8(c+e));return d},d.prototype.parseTag=function(){return this.parseString(4)},d.prototype.parseLongDateTime=function(){var a=c.getULong(this.data,this.offset+this.relativeOffset+4);return this.relativeOffset+=8,a},d.prototype.parseFixed=function(){var a=c.getULong(this.data,this.offset+this.relativeOffset);return this.relativeOffset+=4,a/65536},d.prototype.parseVersion=function(){var a=c.getUShort(this.data,this.offset+this.relativeOffset),b=c.getUShort(this.data,this.offset+this.relativeOffset+2);return this.relativeOffset+=4,a+b/4096/10},d.prototype.skip=function(a,b){void 0===b&&(b=1),this.relativeOffset+=e[a]*b},c.Parser=d},{}],12:[function(a,b,c){"use strict";function d(){this.commands=[],this.fill="black",this.stroke=null,this.strokeWidth=1}d.prototype.moveTo=function(a,b){this.commands.push({type:"M",x:a,y:b})},d.prototype.lineTo=function(a,b){this.commands.push({type:"L",x:a,y:b})},d.prototype.curveTo=d.prototype.bezierCurveTo=function(a,b,c,d,e,f){this.commands.push({type:"C",x1:a,y1:b,x2:c,y2:d,x:e,y:f})},d.prototype.quadTo=d.prototype.quadraticCurveTo=function(a,b,c,d){this.commands.push({type:"Q",x1:a,y1:b,x:c,y:d})},d.prototype.close=d.prototype.closePath=function(){this.commands.push({type:"Z"})},d.prototype.extend=function(a){a.commands&&(a=a.commands),Array.prototype.push.apply(this.commands,a)},d.prototype.draw=function(a){a.beginPath();for(var b=0;b<this.commands.length;b+=1){var c=this.commands[b];"M"===c.type?a.moveTo(c.x,c.y):"L"===c.type?a.lineTo(c.x,c.y):"C"===c.type?a.bezierCurveTo(c.x1,c.y1,c.x2,c.y2,c.x,c.y):"Q"===c.type?a.quadraticCurveTo(c.x1,c.y1,c.x,c.y):"Z"===c.type&&a.closePath()}this.fill&&(a.fillStyle=this.fill,a.fill()),this.stroke&&(a.strokeStyle=this.stroke,a.lineWidth=this.strokeWidth,a.stroke())},d.prototype.toPathData=function(a){function b(b){return Math.round(b)===b?""+Math.round(b):b.toFixed(a)}function c(){for(var a="",c=0;c<arguments.length;c+=1){var d=arguments[c];d>=0&&c>0&&(a+=" "),a+=b(d)}return a}a=void 0!==a?a:2;for(var d="",e=0;e<this.commands.length;e+=1){var f=this.commands[e];"M"===f.type?d+="M"+c(f.x,f.y):"L"===f.type?d+="L"+c(f.x,f.y):"C"===f.type?d+="C"+c(f.x1,f.y1,f.x2,f.y2,f.x,f.y):"Q"===f.type?d+="Q"+c(f.x1,f.y1,f.x,f.y):"Z"===f.type&&(d+="Z")}return d},d.prototype.toSVG=function(a){var b='<path d="';return b+=this.toPathData(a),b+='"',this.fill&"black"!==this.fill&&(b+=null===this.fill?' fill="none"':' fill="'+this.fill+'"'),this.stroke&&(b+=' stroke="'+this.stroke+'" stroke-width="'+this.strokeWidth+'"'),b+="/>"},c.Path=d},{}],13:[function(a,b,c){"use strict";function d(a,b,c){var d;for(d=0;d<b.length;d+=1){var e=b[d];this[e.name]=e.value}if(this.tableName=a,this.fields=b,c){var f=Object.keys(c);for(d=0;d<f.length;d+=1){var g=f[d],h=c[g];void 0!==this[g]&&(this[g]=h)}}}var e=a("./check"),f=a("./types").encode,g=a("./types").sizeOf;d.prototype.sizeOf=function(){for(var a=0,b=0;b<this.fields.length;b+=1){var c=this.fields[b],d=this[c.name];if(void 0===d&&(d=c.value),"function"==typeof d.sizeOf)a+=d.sizeOf();else{var f=g[c.type];e.assert("function"==typeof f,"Could not find sizeOf function for field"+c.name),a+=f(d)}}return a},d.prototype.encode=function(){return f.TABLE(this)},c.Table=d},{"./check":4,"./types":30}],14:[function(a,b,c){"use strict";function d(a,b){if(a===b)return!0;if(Array.isArray(a)&&Array.isArray(b)){if(a.length!==b.length)return!1;for(var c=0;c<a.length;c+=1)if(!d(a[c],b[c]))return!1;return!0}return!1}function e(a,b,c){var d,e,f,g=[],h=[],i=J.getCard16(a,b);if(0!==i){var j=J.getByte(a,b+2);e=b+(i+1)*j+2;var k=b+3;for(d=0;d<i+1;d+=1)g.push(J.getOffset(a,k,j)),k+=j;f=e+g[i]}else f=b+2;for(d=0;d<g.length-1;d+=1){var l=J.getBytes(a,e+g[d],e+g[d+1]);c&&(l=c(l)),h.push(l)}return{objects:h,startOffset:b,endOffset:f}}function f(a){for(var b="",c=15,d=["0","1","2","3","4","5","6","7","8","9",".","E","E-",null,"-"];;){var e=a.parseByte(),f=e>>4,g=15&e;if(f===c)break;if(b+=d[f],g===c)break;b+=d[g]}return parseFloat(b)}function g(a,b){var c,d,e,g;if(28===b)return c=a.parseByte(),d=a.parseByte(),c<<8|d;if(29===b)return c=a.parseByte(),d=a.parseByte(),e=a.parseByte(),g=a.parseByte(),c<<24|d<<16|e<<8|g;if(30===b)return f(a);if(b>=32&&b<=246)return b-139;if(b>=247&&b<=250)return c=a.parseByte(),256*(b-247)+c+108;if(b>=251&&b<=254)return c=a.parseByte(),256*-(b-251)-c-108;throw new Error("Invalid b0 "+b)}function h(a){for(var b={},c=0;c<a.length;c+=1){var d,e=a[c][0],f=a[c][1];if(d=1===f.length?f[0]:f,b.hasOwnProperty(e))throw new Error("Object "+b+" already has key "+e);b[e]=d}return b}function i(a,b,c){b=void 0!==b?b:0;var d=new J.Parser(a,b),e=[],f=[];for(c=void 0!==c?c:a.length;d.relativeOffset<c;){var i=d.parseByte();i<=21?(12===i&&(i=1200+d.parseByte()),e.push([i,f]),f=[]):f.push(g(d,i))}return h(e)}function j(a,b){return b=b<=390?H.cffStandardStrings[b]:a[b-391]}function k(a,b,c){for(var d={},e=0;e<b.length;e+=1){var f=b[e],g=a[f.op];void 0===g&&(g=void 0!==f.value?f.value:null),"SID"===f.type&&(g=j(c,g)),d[f.name]=g}return d}function l(a,b){var c={};return c.formatMajor=J.getCard8(a,b),c.formatMinor=J.getCard8(a,b+1),c.size=J.getCard8(a,b+2),c.offsetSize=J.getCard8(a,b+3),c.startOffset=b,c.endOffset=b+4,c}function m(a,b){return k(i(a,0,a.byteLength),M,b)}function n(a,b,c,d){return k(i(a,b,c),N,d)}function o(a,b,c,d){var e,f,g,h=new J.Parser(a,b);c-=1;var i=[".notdef"],k=h.parseCard8();if(0===k)for(e=0;e<c;e+=1)f=h.parseSID(),i.push(j(d,f));else if(1===k)for(;i.length<=c;)for(f=h.parseSID(),g=h.parseCard8(),e=0;e<=g;e+=1)i.push(j(d,f)),f+=1;else{if(2!==k)throw new Error("Unknown charset format "+k);for(;i.length<=c;)for(f=h.parseSID(),g=h.parseCard16(),e=0;e<=g;e+=1)i.push(j(d,f)),f+=1}return i}function p(a,b,c){var d,e,f={},g=new J.Parser(a,b),h=g.parseCard8();if(0===h){var i=g.parseCard8();for(d=0;d<i;d+=1)e=g.parseCard8(),f[e]=d}else{if(1!==h)throw new Error("Unknown encoding format "+h);var j=g.parseCard8();for(e=1,d=0;d<j;d+=1)for(var k=g.parseCard8(),l=g.parseCard8(),m=k;m<=k+l;m+=1)f[m]=e,e+=1}return new H.CffEncoding(f,c)}function q(a,b,c){function d(a,b){p&&k.closePath(),k.moveTo(a,b),p=!0}function e(){var b;b=l.length%2!=0,b&&!n&&(o=l.shift()+a.nominalWidthX),m+=l.length>>1,l.length=0,n=!0}function f(c){for(var s,t,u,v,w,x,y,z,A,B,C,D,E=0;E<c.length;){var F=c[E];switch(E+=1,F){case 1:e();break;case 3:e();break;case 4:l.length>1&&!n&&(o=l.shift()+a.nominalWidthX,n=!0),r+=l.pop(),d(q,r);break;case 5:for(;l.length>0;)q+=l.shift(),r+=l.shift(),k.lineTo(q,r);break;case 6:for(;l.length>0&&(q+=l.shift(),k.lineTo(q,r),0!==l.length);)r+=l.shift(),k.lineTo(q,r);break;case 7:for(;l.length>0&&(r+=l.shift(),k.lineTo(q,r),0!==l.length);)q+=l.shift(),k.lineTo(q,r);break;case 8:for(;l.length>0;)g=q+l.shift(),h=r+l.shift(),i=g+l.shift(),j=h+l.shift(),q=i+l.shift(),r=j+l.shift(),k.curveTo(g,h,i,j,q,r);break;case 10:w=l.pop()+a.subrsBias,x=a.subrs[w],x&&f(x);break;case 11:return;case 12:switch(F=c[E],E+=1,F){case 35:g=q+l.shift(),h=r+l.shift(),i=g+l.shift(),j=h+l.shift(),y=i+l.shift(),z=j+l.shift(),A=y+l.shift(),B=z+l.shift(),C=A+l.shift(),D=B+l.shift(),q=C+l.shift(),r=D+l.shift(),l.shift(),k.curveTo(g,h,i,j,y,z),k.curveTo(A,B,C,D,q,r);break;case 34:g=q+l.shift(),h=r,i=g+l.shift(),j=h+l.shift(),y=i+l.shift(),z=j,A=y+l.shift(),B=j,C=A+l.shift(),D=r,q=C+l.shift(),k.curveTo(g,h,i,j,y,z),k.curveTo(A,B,C,D,q,r);break;case 36:g=q+l.shift(),h=r+l.shift(),i=g+l.shift(),j=h+l.shift(),y=i+l.shift(),z=j,A=y+l.shift(),B=j,C=A+l.shift(),D=B+l.shift(),q=C+l.shift(),k.curveTo(g,h,i,j,y,z),k.curveTo(A,B,C,D,q,r);break;case 37:g=q+l.shift(),h=r+l.shift(),i=g+l.shift(),j=h+l.shift(),y=i+l.shift(),z=j+l.shift(),A=y+l.shift(),B=z+l.shift(),C=A+l.shift(),D=B+l.shift(),Math.abs(C-q)>Math.abs(D-r)?q=C+l.shift():r=D+l.shift(),k.curveTo(g,h,i,j,y,z),k.curveTo(A,B,C,D,q,r);break;default:console.log("Glyph "+b.index+": unknown operator 1200"+F),l.length=0}break;case 14:l.length>0&&!n&&(o=l.shift()+a.nominalWidthX,n=!0),p&&(k.closePath(),p=!1);break;case 18:e();break;case 19:case 20:e(),E+=m+7>>3;break;case 21:l.length>2&&!n&&(o=l.shift()+a.nominalWidthX,n=!0),r+=l.pop(),q+=l.pop(),d(q,r);break;case 22:l.length>1&&!n&&(o=l.shift()+a.nominalWidthX,n=!0),q+=l.pop(),d(q,r);break;case 23:e();break;case 24:for(;l.length>2;)g=q+l.shift(),h=r+l.shift(),i=g+l.shift(),j=h+l.shift(),q=i+l.shift(),r=j+l.shift(),k.curveTo(g,h,i,j,q,r);q+=l.shift(),r+=l.shift(),k.lineTo(q,r);break;case 25:for(;l.length>6;)q+=l.shift(),r+=l.shift(),k.lineTo(q,r);g=q+l.shift(),h=r+l.shift(),i=g+l.shift(),j=h+l.shift(),q=i+l.shift(),r=j+l.shift(),k.curveTo(g,h,i,j,q,r);break;case 26:for(l.length%2&&(q+=l.shift());l.length>0;)g=q,h=r+l.shift(),i=g+l.shift(),j=h+l.shift(),q=i,r=j+l.shift(),k.curveTo(g,h,i,j,q,r);break;case 27:for(l.length%2&&(r+=l.shift());l.length>0;)g=q+l.shift(),h=r,i=g+l.shift(),j=h+l.shift(),q=i+l.shift(),r=j,k.curveTo(g,h,i,j,q,r);break;case 28:s=c[E],t=c[E+1],l.push((s<<24|t<<16)>>16),E+=2;break;case 29:w=l.pop()+a.gsubrsBias,x=a.gsubrs[w],x&&f(x);break;case 30:for(;l.length>0&&(g=q,h=r+l.shift(),i=g+l.shift(),j=h+l.shift(),q=i+l.shift(),r=j+(1===l.length?l.shift():0),k.curveTo(g,h,i,j,q,r),0!==l.length);)g=q+l.shift(),h=r,i=g+l.shift(),j=h+l.shift(),r=j+l.shift(),q=i+(1===l.length?l.shift():0),k.curveTo(g,h,i,j,q,r);break;case 31:for(;l.length>0&&(g=q+l.shift(),h=r,i=g+l.shift(),j=h+l.shift(),r=j+l.shift(),q=i+(1===l.length?l.shift():0),k.curveTo(g,h,i,j,q,r),0!==l.length);)g=q,h=r+l.shift(),i=g+l.shift(),j=h+l.shift(),q=i+l.shift(),r=j+(1===l.length?l.shift():0),k.curveTo(g,h,i,j,q,r);break;default:F<32?console.log("Glyph "+b.index+": unknown operator "+F):F<247?l.push(F-139):F<251?(s=c[E],E+=1,l.push(256*(F-247)+s+108)):F<255?(s=c[E],E+=1,l.push(256*-(F-251)-s-108)):(s=c[E],t=c[E+1],u=c[E+2],v=c[E+3],E+=4,l.push((s<<24|t<<16|u<<8|v)/65536))}}}var g,h,i,j,k=new K.Path,l=[],m=0,n=!1,o=a.defaultWidthX,p=!1,q=0,r=0;return f(c),b.advanceWidth=o,k}function r(a){return a.length<1240?107:a.length<33900?1131:32768}function s(a,b,c){c.tables.cff={};var d=l(a,b),f=e(a,d.endOffset,J.bytesToString),g=e(a,f.endOffset),h=e(a,g.endOffset,J.bytesToString),i=e(a,h.endOffset);c.gsubrs=i.objects,c.gsubrsBias=r(c.gsubrs);var j=new DataView(new Uint8Array(g.objects[0]).buffer),k=m(j,h.objects);c.tables.cff.topDict=k;var s=b+k.private[1],t=n(a,s,k.private[0],h.objects);if(c.defaultWidthX=t.defaultWidthX,c.nominalWidthX=t.nominalWidthX,0!==t.subrs){var u=s+t.subrs,v=e(a,u);c.subrs=v.objects,c.subrsBias=r(c.subrs)}else c.subrs=[],c.subrsBias=0;var w=e(a,b+k.charStrings);c.nGlyphs=w.objects.length;var x=o(a,b+k.charset,c.nGlyphs,h.objects);0===k.encoding?c.cffEncoding=new H.CffEncoding(H.cffStandardEncoding,x):1===k.encoding?c.cffEncoding=new H.CffEncoding(H.cffExpertEncoding,x):c.cffEncoding=p(a,b+k.encoding,x),c.encoding=c.encoding||c.cffEncoding,c.glyphs=new I.GlyphSet(c);for(var y=0;y<c.nGlyphs;y+=1){var z=w.objects[y];c.glyphs.push(y,I.cffGlyphLoader(c,y,q,z))}}function t(a,b){var c,d=H.cffStandardStrings.indexOf(a);return d>=0&&(c=d),d=b.indexOf(a),d>=0?c=d+H.cffStandardStrings.length:(c=H.cffStandardStrings.length+b.length,b.push(a)),c}function u(){return new L.Table("Header",[{name:"major",type:"Card8",value:1},{name:"minor",type:"Card8",value:0},{name:"hdrSize",type:"Card8",value:4},{name:"major",type:"Card8",value:1}])}function v(a){var b=new L.Table("Name INDEX",[{name:"names",type:"INDEX",value:[]}]);b.names=[];for(var c=0;c<a.length;c+=1)b.names.push({name:"name_"+c,type:"NAME",value:a[c]});return b}function w(a,b,c){for(var e={},f=0;f<a.length;f+=1){var g=a[f],h=b[g.name];void 0===h||d(h,g.value)||("SID"===g.type&&(h=t(h,c)),e[g.op]={name:g.name,type:g.type,value:h})}return e}function x(a,b){var c=new L.Table("Top DICT",[{name:"dict",type:"DICT",value:{}}]);return c.dict=w(M,a,b),c}function y(a){var b=new L.Table("Top DICT INDEX",[{name:"topDicts",type:"INDEX",value:[]}]);return b.topDicts=[{name:"topDict_0",type:"TABLE",value:a}],b}function z(a){var b=new L.Table("String INDEX",[{name:"strings",type:"INDEX",value:[]}]);b.strings=[];for(var c=0;c<a.length;c+=1)b.strings.push({name:"string_"+c,type:"STRING",value:a[c]});return b}function A(){return new L.Table("Global Subr INDEX",[{name:"subrs",type:"INDEX",value:[]}])}function B(a,b){for(var c=new L.Table("Charsets",[{name:"format",type:"Card8",value:0}]),d=0;d<a.length;d+=1){var e=a[d],f=t(e,b);c.fields.push({name:"glyph_"+d,type:"SID",value:f})}return c}function C(a){var b=[],c=a.path;b.push({name:"width",type:"NUMBER",value:a.advanceWidth});for(var d=0,e=0,f=0;f<c.commands.length;f+=1){var g,h,i=c.commands[f];if("Q"===i.type){var j=1/3,k=2/3;i={type:"C",x:i.x,y:i.y,x1:j*d+k*i.x1,y1:j*e+k*i.y1,x2:j*i.x+k*i.x1,y2:j*i.y+k*i.y1}}if("M"===i.type)g=Math.round(i.x-d),h=Math.round(i.y-e),b.push({name:"dx",type:"NUMBER",value:g}),b.push({name:"dy",type:"NUMBER",value:h}),b.push({name:"rmoveto",type:"OP",value:21}),d=Math.round(i.x),e=Math.round(i.y);else if("L"===i.type)g=Math.round(i.x-d),h=Math.round(i.y-e),b.push({name:"dx",type:"NUMBER",value:g}),b.push({name:"dy",type:"NUMBER",value:h}),b.push({name:"rlineto",type:"OP",value:5}),d=Math.round(i.x),e=Math.round(i.y);else if("C"===i.type){var l=Math.round(i.x1-d),m=Math.round(i.y1-e),n=Math.round(i.x2-i.x1),o=Math.round(i.y2-i.y1);g=Math.round(i.x-i.x2),h=Math.round(i.y-i.y2),b.push({name:"dx1",type:"NUMBER",value:l}),b.push({name:"dy1",type:"NUMBER",value:m}),b.push({name:"dx2",type:"NUMBER",value:n}),b.push({name:"dy2",type:"NUMBER",value:o}),b.push({name:"dx",type:"NUMBER",value:g}),b.push({name:"dy",type:"NUMBER",value:h}),b.push({name:"rrcurveto",type:"OP",value:8}),d=Math.round(i.x),e=Math.round(i.y)}}return b.push({name:"endchar",type:"OP",value:14}),b}function D(a){for(var b=new L.Table("CharStrings INDEX",[{name:"charStrings",type:"INDEX",value:[]}]),c=0;c<a.length;c+=1){var d=a.get(c),e=C(d);b.charStrings.push({name:d.name,type:"CHARSTRING",value:e})}return b}function E(a,b){var c=new L.Table("Private DICT",[{name:"dict",type:"DICT",value:{}}]);return c.dict=w(N,a,b),c}function F(a){var b=new L.Table("Private DICT INDEX",[{name:"privateDicts",type:"INDEX",value:[]}]);return b.privateDicts=[{name:"privateDict_0",type:"TABLE",value:a}],b}function G(a,b){for(var c,d=new L.Table("CFF ",[{name:"header",type:"TABLE"},{name:"nameIndex",type:"TABLE"},{name:"topDictIndex",type:"TABLE"},{name:"stringIndex",type:"TABLE"},{name:"globalSubrIndex",type:"TABLE"},{name:"charsets",type:"TABLE"},{name:"charStringsIndex",type:"TABLE"},{name:"privateDictIndex",type:"TABLE"}]),e=1/b.unitsPerEm,f={version:b.version,fullName:b.fullName,familyName:b.familyName,weight:b.weightName,fontMatrix:[e,0,0,e,0,0],charset:999,encoding:0,charStrings:999,private:[0,999]},g={},h=[],i=1;i<a.length;i+=1)c=a.get(i),h.push(c.name);var j=[];d.header=u(),d.nameIndex=v([b.postScriptName]);var k=x(f,j);d.topDictIndex=y(k),d.globalSubrIndex=A(),d.charsets=B(h,j),d.charStringsIndex=D(a);var l=E(g,j);d.privateDictIndex=F(l),d.stringIndex=z(j);var m=d.header.sizeOf()+d.nameIndex.sizeOf()+d.topDictIndex.sizeOf()+d.stringIndex.sizeOf()+d.globalSubrIndex.sizeOf();return f.charset=m,f.encoding=0,f.charStrings=f.charset+d.charsets.sizeOf(),f.private[1]=f.charStrings+d.charStringsIndex.sizeOf(),k=x(f,j),d.topDictIndex=y(k),d}var H=a("../encoding"),I=a("../glyphset"),J=a("../parse"),K=a("../path"),L=a("../table"),M=[{name:"version",op:0,type:"SID"},{name:"notice",op:1,type:"SID"},{name:"copyright",op:1200,type:"SID"},{name:"fullName",op:2,type:"SID"},{name:"familyName",op:3,type:"SID"},{name:"weight",op:4,type:"SID"},{name:"isFixedPitch",op:1201,type:"number",value:0},{name:"italicAngle",op:1202,type:"number",value:0},{name:"underlinePosition",op:1203,type:"number",value:-100},{name:"underlineThickness",op:1204,type:"number",value:50},{name:"paintType",op:1205,type:"number",value:0},{name:"charstringType",op:1206,type:"number",value:2},{name:"fontMatrix",op:1207,type:["real","real","real","real","real","real"],value:[.001,0,0,.001,0,0]},{name:"uniqueId",op:13,type:"number"},{name:"fontBBox",op:5,type:["number","number","number","number"],value:[0,0,0,0]},{name:"strokeWidth",op:1208,type:"number",value:0},{name:"xuid",op:14,type:[],value:null},{name:"charset",op:15,type:"offset",value:0},{name:"encoding",op:16,type:"offset",value:0},{name:"charStrings",op:17,type:"offset",value:0},{name:"private",op:18,type:["number","offset"],value:[0,0]}],N=[{name:"subrs",op:19,type:"offset",value:0},{name:"defaultWidthX",op:20,type:"number",value:0},{name:"nominalWidthX",op:21,type:"number",value:0}];c.parse=s,c.make=G},{"../encoding":6,"../glyphset":9,"../parse":11,"../path":12,"../table":13}],15:[function(a,b,c){"use strict";function d(a,b){var c,d={};d.version=i.getUShort(a,b),h.argument(0===d.version,"cmap table version should be 0."),d.numTables=i.getUShort(a,b+2);var e=-1;for(c=0;c<d.numTables;c+=1){var f=i.getUShort(a,b+4+8*c),g=i.getUShort(a,b+4+8*c+2);if(3===f&&(1===g||0===g)){e=i.getULong(a,b+4+8*c+4);break}}if(e===-1)return null;var j=new i.Parser(a,b+e);d.format=j.parseUShort(),h.argument(4===d.format,"Only format 4 cmap tables are supported."),d.length=j.parseUShort(),d.language=j.parseUShort();var k;d.segCount=k=j.parseUShort()>>1,j.skip("uShort",3),d.glyphIndexMap={};var l=new i.Parser(a,b+e+14),m=new i.Parser(a,b+e+16+2*k),n=new i.Parser(a,b+e+16+4*k),o=new i.Parser(a,b+e+16+6*k),p=b+e+16+8*k;for(c=0;c<k-1;c+=1)for(var q,r=l.parseUShort(),s=m.parseUShort(),t=n.parseShort(),u=o.parseUShort(),v=s;v<=r;v+=1)0!==u?(p=o.offset+o.relativeOffset-2,p+=u,p+=2*(v-s),0!==(q=i.getUShort(a,p))&&(q=q+t&65535)):q=v+t&65535,d.glyphIndexMap[v]=q;return d}function e(a,b,c){a.segments.push({end:b,start:b,delta:-(b-c),offset:0})}function f(a){a.segments.push({end:65535,start:65535,delta:1,offset:0})}function g(a){var b,c=new j.Table("cmap",[{name:"version",type:"USHORT",value:0},{name:"numTables",type:"USHORT",value:1},{name:"platformID",type:"USHORT",value:3},{name:"encodingID",type:"USHORT",value:1},{name:"offset",type:"ULONG",value:12},{name:"format",type:"USHORT",value:4},{name:"length",type:"USHORT",value:0},{name:"language",type:"USHORT",value:0},{name:"segCountX2",type:"USHORT",value:0},{name:"searchRange",type:"USHORT",value:0},{name:"entrySelector",type:"USHORT",value:0},{name:"rangeShift",type:"USHORT",value:0}]);for(c.segments=[],b=0;b<a.length;b+=1){for(var d=a.get(b),g=0;g<d.unicodes.length;g+=1)e(c,d.unicodes[g],b);c.segments=c.segments.sort(function(a,b){return a.start-b.start})}f(c);var h;h=c.segments.length,c.segCountX2=2*h,c.searchRange=2*Math.pow(2,Math.floor(Math.log(h)/Math.log(2))),c.entrySelector=Math.log(c.searchRange/2)/Math.log(2),c.rangeShift=c.segCountX2-c.searchRange;var i=[],k=[],l=[],m=[],n=[];for(b=0;b<h;b+=1){var o=c.segments[b];i=i.concat({name:"end_"+b,type:"USHORT",value:o.end}),k=k.concat({name:"start_"+b,type:"USHORT",value:o.start}),l=l.concat({name:"idDelta_"+b,type:"SHORT",value:o.delta}),m=m.concat({name:"idRangeOffset_"+b,type:"USHORT",value:o.offset}),void 0!==o.glyphId&&(n=n.concat({name:"glyph_"+b,type:"USHORT",value:o.glyphId}))}return c.fields=c.fields.concat(i),c.fields.push({name:"reservedPad",type:"USHORT",value:0}),c.fields=c.fields.concat(k),c.fields=c.fields.concat(l),c.fields=c.fields.concat(m),c.fields=c.fields.concat(n),c.length=14+2*i.length+2+2*k.length+2*l.length+2*m.length+2*n.length,c}var h=a("../check"),i=a("../parse"),j=a("../table");c.parse=d,c.make=g},{"../check":4,"../parse":11,"../table":13}],16:[function(a,b,c){"use strict";function d(a,b){var c=JSON.stringify(a),d=256;for(var e in b){var f=parseInt(e);if(f&&!(f<256)){if(JSON.stringify(b[e])===c)return f;d<=f&&(d=f+1)}}return b[d]=a,d}function e(a,b){var c=d(a.name,b);return new m.Table("fvarAxis",[{name:"tag",type:"TAG",value:a.tag},{name:"minValue",type:"FIXED",value:a.minValue<<16},{name:"defaultValue",type:"FIXED",value:a.defaultValue<<16},{name:"maxValue",type:"FIXED",value:a.maxValue<<16},{name:"flags",type:"USHORT",value:0},{name:"nameID",type:"USHORT",value:c}])}function f(a,b,c){var d={},e=new l.Parser(a,b);return d.tag=e.parseTag(),d.minValue=e.parseFixed(),d.defaultValue=e.parseFixed(),d.maxValue=e.parseFixed(),e.skip("uShort",1),d.name=c[e.parseUShort()]||{},d}function g(a,b,c){for(var e=d(a.name,c),f=[{name:"nameID",type:"USHORT",value:e},{name:"flags",type:"USHORT",value:0}],g=0;g<b.length;++g){var h=b[g].tag;f.push({name:"axis "+h,type:"FIXED",value:a.coordinates[h]<<16})}return new m.Table("fvarInstance",f)}function h(a,b,c,d){var e={},f=new l.Parser(a,b);e.name=d[f.parseUShort()]||{},f.skip("uShort",1),e.coordinates={};for(var g=0;g<c.length;++g)e.coordinates[c[g].tag]=f.parseFixed();return e}function i(a,b){var c=new m.Table("fvar",[{name:"version",type:"ULONG",value:65536},{name:"offsetToData",type:"USHORT",value:0},{name:"countSizePairs",type:"USHORT",value:2},{name:"axisCount",type:"USHORT",value:a.axes.length},{name:"axisSize",type:"USHORT",value:20},{name:"instanceCount",type:"USHORT",value:a.instances.length},{name:"instanceSize",type:"USHORT",value:4+4*a.axes.length}]);c.offsetToData=c.sizeOf();for(var d=0;d<a.axes.length;d++)c.fields.push({name:"axis "+d,type:"TABLE",value:e(a.axes[d],b)});for(var f=0;f<a.instances.length;f++)c.fields.push({name:"instance "+f,type:"TABLE",value:g(a.instances[f],a.axes,b)});return c}function j(a,b,c){var d=new l.Parser(a,b),e=d.parseULong();k.argument(65536===e,"Unsupported fvar table version.");var g=d.parseOffset16();d.skip("uShort",1);for(var i=d.parseUShort(),j=d.parseUShort(),m=d.parseUShort(),n=d.parseUShort(),o=[],p=0;p<i;p++)o.push(f(a,b+g+p*j,c));for(var q=[],r=b+g+i*j,s=0;s<m;s++)q.push(h(a,r+s*n,o,c));return{axes:o,instances:q}}var k=a("../check"),l=a("../parse"),m=a("../table");c.make=i,c.parse=j},{"../check":4,"../parse":11,"../table":13}],17:[function(a,b,c){"use strict";function d(a,b,c,d,e){var f;return(b&d)>0?(f=a.parseByte(),0==(b&e)&&(f=-f),f=c+f):f=(b&e)>0?c:c+a.parseShort(),f}function e(a,b,c){var e=new m.Parser(b,c);a.numberOfContours=e.parseShort(),a.xMin=e.parseShort(),a.yMin=e.parseShort(),a.xMax=e.parseShort(),a.yMax=e.parseShort();var f,g;if(a.numberOfContours>0){var h,i=a.endPointIndices=[];for(h=0;h<a.numberOfContours;h+=1)i.push(e.parseUShort());for(a.instructionLength=e.parseUShort(),a.instructions=[],h=0;h<a.instructionLength;h+=1)a.instructions.push(e.parseByte());var j=i[i.length-1]+1;for(f=[],h=0;h<j;h+=1)if(g=e.parseByte(),f.push(g),(8&g)>0)for(var l=e.parseByte(),n=0;n<l;n+=1)f.push(g),h+=1;if(k.argument(f.length===j,"Bad flags."),i.length>0){var o,p=[];if(j>0){for(h=0;h<j;h+=1)g=f[h],o={},o.onCurve=!!(1&g),o.lastPointOfContour=i.indexOf(h)>=0,p.push(o);var q=0;for(h=0;h<j;h+=1)g=f[h],o=p[h],o.x=d(e,g,q,2,16),q=o.x;var r=0;for(h=0;h<j;h+=1)g=f[h],o=p[h],o.y=d(e,g,r,4,32),r=o.y}a.points=p}else a.points=[]}else if(0===a.numberOfContours)a.points=[];else{a.isComposite=!0,a.points=[],a.components=[];for(var s=!0;s;){f=e.parseUShort();var t={glyphIndex:e.parseUShort(),xScale:1,scale01:0,scale10:0,yScale:1,dx:0,dy:0};(1&f)>0?(t.dx=e.parseShort(),t.dy=e.parseShort()):(t.dx=e.parseChar(),t.dy=e.parseChar()),(8&f)>0?t.xScale=t.yScale=e.parseF2Dot14():(64&f)>0?(t.xScale=e.parseF2Dot14(),t.yScale=e.parseF2Dot14()):(128&f)>0&&(t.xScale=e.parseF2Dot14(),t.scale01=e.parseF2Dot14(),t.scale10=e.parseF2Dot14(),t.yScale=e.parseF2Dot14()),a.components.push(t),s=!!(32&f)}}}function f(a,b){for(var c=[],d=0;d<a.length;d+=1){var e=a[d],f={x:b.xScale*e.x+b.scale01*e.y+b.dx,y:b.scale10*e.x+b.yScale*e.y+b.dy,onCurve:e.onCurve,lastPointOfContour:e.lastPointOfContour};c.push(f)}return c}function g(a){for(var b=[],c=[],d=0;d<a.length;d+=1){var e=a[d];c.push(e),e.lastPointOfContour&&(b.push(c),c=[])}return k.argument(0===c.length,"There are still points left in the current contour."),b}function h(a){var b=new n.Path;if(!a)return b;for(var c=g(a),d=0;d<c.length;d+=1){var e,f,h=c[d],i=h[0],j=h[h.length-1];i.onCurve?(e=null,f=!0):(i=j.onCurve?j:{x:(i.x+j.x)/2,y:(i.y+j.y)/2},e=i,f=!1),b.moveTo(i.x,i.y);for(var k=f?1:0;k<h.length;k+=1){var l=h[k],m=0===k?i:h[k-1];if(m.onCurve&&l.onCurve)b.lineTo(l.x,l.y);else if(m.onCurve&&!l.onCurve)e=l;else if(m.onCurve||l.onCurve){if(m.onCurve||!l.onCurve)throw new Error("Invalid state.");b.quadraticCurveTo(e.x,e.y,l.x,l.y),e=null}else{var o={x:(m.x+l.x)/2,y:(m.y+l.y)/2};b.quadraticCurveTo(m.x,m.y,o.x,o.y),e=l}}i!==j&&(e?b.quadraticCurveTo(e.x,e.y,i.x,i.y):b.lineTo(i.x,i.y))}return b.closePath(),b}function i(a,b){if(b.isComposite)for(var c=0;c<b.components.length;c+=1){var d=b.components[c],e=a.get(d.glyphIndex);if(e.getPath(),e.points){var g=f(e.points,d);b.points=b.points.concat(g)}}return h(b.points)}function j(a,b,c,d){var f,g=new l.GlyphSet(d);for(f=0;f<c.length-1;f+=1){var h=c[f];h!==c[f+1]?g.push(f,l.ttfGlyphLoader(d,f,e,a,b+h,i)):g.push(f,l.glyphLoader(d,f))}return g}var k=a("../check"),l=a("../glyphset"),m=a("../parse"),n=a("../path");c.parse=j},{"../check":4,"../glyphset":9,"../parse":11,"../path":12}],18:[function(a,b,c){"use strict";function d(a,b){for(var c=new k.Parser(a,b),d=c.parseUShort(),e=[],f=0;f<d;f++)e[c.parseTag()]={offset:c.parseUShort()};return e}function e(a,b){var c=new k.Parser(a,b),d=c.parseUShort(),e=c.parseUShort();if(1===d)return c.parseUShortList(e);if(2===d){for(var f=[];e--;)for(var g=c.parseUShort(),h=c.parseUShort(),i=c.parseUShort(),j=g;j<=h;j++)f[i++]=j;return f}}function f(a,b){var c=new k.Parser(a,b),d=c.parseUShort();if(1===d){var e=c.parseUShort(),f=c.parseUShort(),g=c.parseUShortList(f);return function(a){return g[a-e]||0}}if(2===d){for(var h=c.parseUShort(),i=[],j=[],l=[],m=0;m<h;m++)i[m]=c.parseUShort(),j[m]=c.parseUShort(),l[m]=c.parseUShort();return function(a){for(var b=0,c=i.length-1;b<c;){var d=b+c+1>>1;a<i[d]?c=d-1:b=d}return i[b]<=a&&a<=j[b]?l[b]||0:0}}}function g(a,b){var c,d=new k.Parser(a,b),g=d.parseUShort(),h=d.parseUShort(),i=e(a,b+h),j=d.parseUShort(),l=d.parseUShort();if(4===j&&0===l){var m={};if(1===g){for(var n=d.parseUShort(),o=[],p=d.parseOffset16List(n),q=0;q<n;q++){var r=p[q],s=m[r];if(!s){s={},d.relativeOffset=r;for(var t=d.parseUShort();t--;){var u=d.parseUShort();j&&(c=d.parseShort()),l&&d.parseShort(),s[u]=c}}o[i[q]]=s}return function(a,b){var c=o[a];if(c)return c[b]}}if(2===g){for(var v=d.parseUShort(),w=d.parseUShort(),x=d.parseUShort(),y=d.parseUShort(),z=f(a,b+v),A=f(a,b+w),B=[],C=0;C<x;C++)for(var D=B[C]=[],E=0;E<y;E++)j&&(c=d.parseShort()),l&&d.parseShort(),D[E]=c;var F={};for(C=0;C<i.length;C++)F[i[C]]=1;return function(a,b){if(F[a]){var c=z(a),d=A(b),e=B[c];return e?e[d]:void 0}}}}}function h(a,b){var c=new k.Parser(a,b),d=c.parseUShort(),e=c.parseUShort(),f=16&e,h=c.parseUShort(),i=c.parseOffset16List(h),j={lookupType:d,lookupFlag:e,markFilteringSet:f?c.parseUShort():-1};if(2===d){for(var l=[],m=0;m<h;m++)l.push(g(a,b+i[m]));j.getKerningValue=function(a,b){for(var c=l.length;c--;){var d=l[c](a,b);if(void 0!==d)return d}return 0}}return j}function i(a,b,c){var e=new k.Parser(a,b),f=e.parseFixed();j.argument(1===f,"Unsupported GPOS table version."),d(a,b+e.parseUShort()),d(a,b+e.parseUShort());var g=e.parseUShort();e.relativeOffset=g;for(var i=e.parseUShort(),l=e.parseOffset16List(i),m=b+g,n=0;n<i;n++){var o=h(a,m+l[n]);2!==o.lookupType||c.getGposKerningValue||(c.getGposKerningValue=o.getKerningValue)}}var j=a("../check"),k=a("../parse");c.parse=i},{"../check":4,"../parse":11}],19:[function(a,b,c){"use strict";function d(a,b){var c={},d=new g.Parser(a,b);return c.version=d.parseVersion(),c.fontRevision=Math.round(1e3*d.parseFixed())/1e3,c.checkSumAdjustment=d.parseULong(),c.magicNumber=d.parseULong(),f.argument(1594834165===c.magicNumber,"Font header has wrong magic number."),c.flags=d.parseUShort(),c.unitsPerEm=d.parseUShort(),c.created=d.parseLongDateTime(),c.modified=d.parseLongDateTime(),c.xMin=d.parseShort(),c.yMin=d.parseShort(),c.xMax=d.parseShort(),c.yMax=d.parseShort(),c.macStyle=d.parseUShort(),c.lowestRecPPEM=d.parseUShort(),c.fontDirectionHint=d.parseShort(),c.indexToLocFormat=d.parseShort(),c.glyphDataFormat=d.parseShort(),c}function e(a){return new h.Table("head",[{name:"version",type:"FIXED",value:65536},{name:"fontRevision",type:"FIXED",value:65536},{name:"checkSumAdjustment",type:"ULONG",value:0},{name:"magicNumber",type:"ULONG",value:1594834165},{name:"flags",type:"USHORT",value:0},{name:"unitsPerEm",type:"USHORT",value:1e3},{name:"created",type:"LONGDATETIME",value:0},{name:"modified",type:"LONGDATETIME",value:0},{name:"xMin",type:"SHORT",value:0},{name:"yMin",type:"SHORT",value:0},{name:"xMax",type:"SHORT",value:0},{name:"yMax",type:"SHORT",value:0},{name:"macStyle",type:"USHORT",value:0},{name:"lowestRecPPEM",type:"USHORT",value:0},{name:"fontDirectionHint",type:"SHORT",value:2},{name:"indexToLocFormat",type:"SHORT",value:0},{name:"glyphDataFormat",type:"SHORT",value:0}],a)}var f=a("../check"),g=a("../parse"),h=a("../table");c.parse=d,c.make=e},{"../check":4,"../parse":11,"../table":13}],20:[function(a,b,c){"use strict";function d(a,b){var c={},d=new f.Parser(a,b);return c.version=d.parseVersion(),c.ascender=d.parseShort(),c.descender=d.parseShort(),c.lineGap=d.parseShort(),c.advanceWidthMax=d.parseUShort(),c.minLeftSideBearing=d.parseShort(),c.minRightSideBearing=d.parseShort(),c.xMaxExtent=d.parseShort(),c.caretSlopeRise=d.parseShort(),c.caretSlopeRun=d.parseShort(),c.caretOffset=d.parseShort(),d.relativeOffset+=8,c.metricDataFormat=d.parseShort(),c.numberOfHMetrics=d.parseUShort(),c}function e(a){return new g.Table("hhea",[{name:"version",type:"FIXED",value:65536},{name:"ascender",type:"FWORD",value:0},{name:"descender",type:"FWORD",value:0},{name:"lineGap",type:"FWORD",value:0},{name:"advanceWidthMax",type:"UFWORD",value:0},{name:"minLeftSideBearing",type:"FWORD",value:0},{name:"minRightSideBearing",type:"FWORD",value:0},{name:"xMaxExtent",type:"FWORD",value:0},{name:"caretSlopeRise",type:"SHORT",value:1},{name:"caretSlopeRun",type:"SHORT",value:0},{name:"caretOffset",type:"SHORT",value:0},{name:"reserved1",type:"SHORT",value:0},{name:"reserved2",type:"SHORT",value:0},{name:"reserved3",type:"SHORT",value:0},{name:"reserved4",type:"SHORT",value:0},{name:"metricDataFormat",type:"SHORT",value:0},{name:"numberOfHMetrics",type:"USHORT",value:0}],a)}var f=a("../parse"),g=a("../table");c.parse=d,c.make=e},{"../parse":11,"../table":13}],21:[function(a,b,c){"use strict";function d(a,b,c,d,e){
for(var g,h,i=new f.Parser(a,b),j=0;j<d;j+=1){j<c&&(g=i.parseUShort(),h=i.parseShort());var k=e.get(j);k.advanceWidth=g,k.leftSideBearing=h}}function e(a){for(var b=new g.Table("hmtx",[]),c=0;c<a.length;c+=1){var d=a.get(c),e=d.advanceWidth||0,f=d.leftSideBearing||0;b.fields.push({name:"advanceWidth_"+c,type:"USHORT",value:e}),b.fields.push({name:"leftSideBearing_"+c,type:"SHORT",value:f})}return b}var f=a("../parse"),g=a("../table");c.parse=d,c.make=e},{"../parse":11,"../table":13}],22:[function(a,b,c){"use strict";function d(a,b){var c={},d=new f.Parser(a,b),g=d.parseUShort();e.argument(0===g,"Unsupported kern table version."),d.skip("uShort",1);var h=d.parseUShort();e.argument(0===h,"Unsupported kern sub-table version."),d.skip("uShort",2);var i=d.parseUShort();d.skip("uShort",3);for(var j=0;j<i;j+=1){var k=d.parseUShort(),l=d.parseUShort(),m=d.parseShort();c[k+","+l]=m}return c}var e=a("../check"),f=a("../parse");c.parse=d},{"../check":4,"../parse":11}],23:[function(a,b,c){"use strict";function d(a,b,c,d){for(var f=new e.Parser(a,b),g=d?f.parseUShort:f.parseULong,h=[],i=0;i<c+1;i+=1){var j=g.call(f);d&&(j*=2),h.push(j)}return h}var e=a("../parse");c.parse=d},{"../parse":11}],24:[function(a,b,c){"use strict";function d(a){for(var b=new h.Table("ltag",[{name:"version",type:"ULONG",value:1},{name:"flags",type:"ULONG",value:0},{name:"numTags",type:"ULONG",value:a.length}]),c="",d=12+4*a.length,e=0;e<a.length;++e){var f=c.indexOf(a[e]);f<0&&(f=c.length,c+=a[e]),b.fields.push({name:"offset "+e,type:"USHORT",value:d+f}),b.fields.push({name:"length "+e,type:"USHORT",value:a[e].length})}return b.fields.push({name:"stringPool",type:"CHARARRAY",value:c}),b}function e(a,b){var c=new g.Parser(a,b),d=c.parseULong();f.argument(1===d,"Unsupported ltag table version."),c.skip("uLong",1);for(var e=c.parseULong(),h=[],i=0;i<e;i++){for(var j="",k=b+c.parseUShort(),l=c.parseUShort(),m=k;m<k+l;++m)j+=String.fromCharCode(a.getInt8(m));h.push(j)}return h}var f=a("../check"),g=a("../parse"),h=a("../table");c.make=d,c.parse=e},{"../check":4,"../parse":11,"../table":13}],25:[function(a,b,c){"use strict";function d(a,b){var c={},d=new f.Parser(a,b);return c.version=d.parseVersion(),c.numGlyphs=d.parseUShort(),1===c.version&&(c.maxPoints=d.parseUShort(),c.maxContours=d.parseUShort(),c.maxCompositePoints=d.parseUShort(),c.maxCompositeContours=d.parseUShort(),c.maxZones=d.parseUShort(),c.maxTwilightPoints=d.parseUShort(),c.maxStorage=d.parseUShort(),c.maxFunctionDefs=d.parseUShort(),c.maxInstructionDefs=d.parseUShort(),c.maxStackElements=d.parseUShort(),c.maxSizeOfInstructions=d.parseUShort(),c.maxComponentElements=d.parseUShort(),c.maxComponentDepth=d.parseUShort()),c}function e(a){return new g.Table("maxp",[{name:"version",type:"FIXED",value:20480},{name:"numGlyphs",type:"USHORT",value:a}])}var f=a("../parse"),g=a("../table");c.parse=d,c.make=e},{"../parse":11,"../table":13}],26:[function(a,b,c){"use strict";function d(a,b,c){switch(a){case 0:if(65535===b)return"und";if(c)return c[b];break;case 1:return r[b];case 3:return t[b]}}function e(a,b,c){switch(a){case 0:return u;case 1:return w[c]||v[b];case 3:if(1===b||10===b)return u}}function f(a,b,c){for(var f={},g=new o.Parser(a,b),h=g.parseUShort(),i=g.parseUShort(),j=g.offset+g.parseUShort(),k=0;k<i;k++){var l=g.parseUShort(),n=g.parseUShort(),p=g.parseUShort(),r=g.parseUShort(),s=q[r]||r,t=g.parseUShort(),v=g.parseUShort(),w=d(l,p,c),x=e(l,n,p);if(void 0!==x&&void 0!==w){var y;if(y=x===u?m.UTF16(a,j+v,t):m.MACSTRING(a,j+v,t,x)){var z=f[s];void 0===z&&(z=f[s]={}),z[w]=y}}}return 1===h&&g.parseUShort(),f}function g(a){var b={};for(var c in a)b[a[c]]=parseInt(c);return b}function h(a,b,c,d,e,f){return new p.Table("NameRecord",[{name:"platformID",type:"USHORT",value:a},{name:"encodingID",type:"USHORT",value:b},{name:"languageID",type:"USHORT",value:c},{name:"nameID",type:"USHORT",value:d},{name:"length",type:"USHORT",value:e},{name:"offset",type:"USHORT",value:f}])}function i(a,b){var c=a.length,d=b.length-c+1;a:for(var e=0;e<d;e++)for(;e<d;e++){for(var f=0;f<c;f++)if(b[e+f]!==a[f])continue a;return e}return-1}function j(a,b){var c=i(a,b);if(c<0){c=b.length;for(var d=0,e=a.length;d<e;++d)b.push(a[d])}return c}function k(a,b){var c,d=[],f={},i=g(q);for(var k in a){var l=i[k];void 0===l&&(l=k),c=parseInt(l),f[c]=a[k],d.push(c)}for(var m=g(r),o=g(t),u=[],v=[],w=0;w<d.length;w++){c=d[w];var x=f[c];for(var y in x){var z=x[y],A=1,B=m[y],C=s[B],D=e(A,C,B),E=n.MACSTRING(z,D);void 0===E&&(A=0,B=b.indexOf(y),B<0&&(B=b.length,b.push(y)),C=4,E=n.UTF16(z));var F=j(E,v);u.push(h(A,C,B,c,E.length,F));var G=o[y];if(void 0!==G){var H=n.UTF16(z),I=j(H,v);u.push(h(3,1,G,c,H.length,I))}}}u.sort(function(a,b){return a.platformID-b.platformID||a.encodingID-b.encodingID||a.languageID-b.languageID||a.nameID-b.nameID});for(var J=new p.Table("name",[{name:"format",type:"USHORT",value:0},{name:"count",type:"USHORT",value:u.length},{name:"stringOffset",type:"USHORT",value:6+12*u.length}]),K=0;K<u.length;K++)J.fields.push({name:"record_"+K,type:"TABLE",value:u[K]});return J.fields.push({name:"strings",type:"LITERAL",value:v}),J}var l=a("../types"),m=l.decode,n=l.encode,o=a("../parse"),p=a("../table"),q=["copyright","fontFamily","fontSubfamily","uniqueID","fullName","version","postScriptName","trademark","manufacturer","designer","description","manufacturerURL","designerURL","licence","licenceURL","reserved","preferredFamily","preferredSubfamily","compatibleFullName","sampleText","postScriptFindFontName","wwsFamily","wwsSubfamily"],r={0:"en",1:"fr",2:"de",3:"it",4:"nl",5:"sv",6:"es",7:"da",8:"pt",9:"no",10:"he",11:"ja",12:"ar",13:"fi",14:"el",15:"is",16:"mt",17:"tr",18:"hr",19:"zh-Hant",20:"ur",21:"hi",22:"th",23:"ko",24:"lt",25:"pl",26:"hu",27:"es",28:"lv",29:"se",30:"fo",31:"fa",32:"ru",33:"zh",34:"nl-BE",35:"ga",36:"sq",37:"ro",38:"cz",39:"sk",40:"si",41:"yi",42:"sr",43:"mk",44:"bg",45:"uk",46:"be",47:"uz",48:"kk",49:"az-Cyrl",50:"az-Arab",51:"hy",52:"ka",53:"mo",54:"ky",55:"tg",56:"tk",57:"mn-CN",58:"mn",59:"ps",60:"ks",61:"ku",62:"sd",63:"bo",64:"ne",65:"sa",66:"mr",67:"bn",68:"as",69:"gu",70:"pa",71:"or",72:"ml",73:"kn",74:"ta",75:"te",76:"si",77:"my",78:"km",79:"lo",80:"vi",81:"id",82:"tl",83:"ms",84:"ms-Arab",85:"am",86:"ti",87:"om",88:"so",89:"sw",90:"rw",91:"rn",92:"ny",93:"mg",94:"eo",128:"cy",129:"eu",130:"ca",131:"la",132:"qu",133:"gn",134:"ay",135:"tt",136:"ug",137:"dz",138:"jv",139:"su",140:"gl",141:"af",142:"br",143:"iu",144:"gd",145:"gv",146:"ga",147:"to",148:"el-polyton",149:"kl",150:"az",151:"nn"},s={0:0,1:0,2:0,3:0,4:0,5:0,6:0,7:0,8:0,9:0,10:5,11:1,12:4,13:0,14:6,15:0,16:0,17:0,18:0,19:2,20:4,21:9,22:21,23:3,24:29,25:29,26:29,27:29,28:29,29:0,30:0,31:4,32:7,33:25,34:0,35:0,36:0,37:0,38:29,39:29,40:0,41:5,42:7,43:7,44:7,45:7,46:7,47:7,48:7,49:7,50:4,51:24,52:23,53:7,54:7,55:7,56:7,57:27,58:7,59:4,60:4,61:4,62:4,63:26,64:9,65:9,66:9,67:13,68:13,69:11,70:10,71:12,72:17,73:16,74:14,75:15,76:18,77:19,78:20,79:22,80:30,81:0,82:0,83:0,84:4,85:28,86:28,87:28,88:0,89:0,90:0,91:0,92:0,93:0,94:0,128:0,129:0,130:0,131:0,132:0,133:0,134:0,135:7,136:4,137:26,138:0,139:0,140:0,141:0,142:0,143:28,144:0,145:0,146:0,147:0,148:6,149:0,150:0,151:0},t={1078:"af",1052:"sq",1156:"gsw",1118:"am",5121:"ar-DZ",15361:"ar-BH",3073:"ar",2049:"ar-IQ",11265:"ar-JO",13313:"ar-KW",12289:"ar-LB",4097:"ar-LY",6145:"ary",8193:"ar-OM",16385:"ar-QA",1025:"ar-SA",10241:"ar-SY",7169:"aeb",14337:"ar-AE",9217:"ar-YE",1067:"hy",1101:"as",2092:"az-Cyrl",1068:"az",1133:"ba",1069:"eu",1059:"be",2117:"bn",1093:"bn-IN",8218:"bs-Cyrl",5146:"bs",1150:"br",1026:"bg",1027:"ca",3076:"zh-HK",5124:"zh-MO",2052:"zh",4100:"zh-SG",1028:"zh-TW",1155:"co",1050:"hr",4122:"hr-BA",1029:"cs",1030:"da",1164:"prs",1125:"dv",2067:"nl-BE",1043:"nl",3081:"en-AU",10249:"en-BZ",4105:"en-CA",9225:"en-029",16393:"en-IN",6153:"en-IE",8201:"en-JM",17417:"en-MY",5129:"en-NZ",13321:"en-PH",18441:"en-SG",7177:"en-ZA",11273:"en-TT",2057:"en-GB",1033:"en",12297:"en-ZW",1061:"et",1080:"fo",1124:"fil",1035:"fi",2060:"fr-BE",3084:"fr-CA",1036:"fr",5132:"fr-LU",6156:"fr-MC",4108:"fr-CH",1122:"fy",1110:"gl",1079:"ka",3079:"de-AT",1031:"de",5127:"de-LI",4103:"de-LU",2055:"de-CH",1032:"el",1135:"kl",1095:"gu",1128:"ha",1037:"he",1081:"hi",1038:"hu",1039:"is",1136:"ig",1057:"id",1117:"iu",2141:"iu-Latn",2108:"ga",1076:"xh",1077:"zu",1040:"it",2064:"it-CH",1041:"ja",1099:"kn",1087:"kk",1107:"km",1158:"quc",1159:"rw",1089:"sw",1111:"kok",1042:"ko",1088:"ky",1108:"lo",1062:"lv",1063:"lt",2094:"dsb",1134:"lb",1071:"mk",2110:"ms-BN",1086:"ms",1100:"ml",1082:"mt",1153:"mi",1146:"arn",1102:"mr",1148:"moh",1104:"mn",2128:"mn-CN",1121:"ne",1044:"nb",2068:"nn",1154:"oc",1096:"or",1123:"ps",1045:"pl",1046:"pt",2070:"pt-PT",1094:"pa",1131:"qu-BO",2155:"qu-EC",3179:"qu",1048:"ro",1047:"rm",1049:"ru",9275:"smn",4155:"smj-NO",5179:"smj",3131:"se-FI",1083:"se",2107:"se-SE",8251:"sms",6203:"sma-NO",7227:"sms",1103:"sa",7194:"sr-Cyrl-BA",3098:"sr",6170:"sr-Latn-BA",2074:"sr-Latn",1132:"nso",1074:"tn",1115:"si",1051:"sk",1060:"sl",11274:"es-AR",16394:"es-BO",13322:"es-CL",9226:"es-CO",5130:"es-CR",7178:"es-DO",12298:"es-EC",17418:"es-SV",4106:"es-GT",18442:"es-HN",2058:"es-MX",19466:"es-NI",6154:"es-PA",15370:"es-PY",10250:"es-PE",20490:"es-PR",3082:"es",1034:"es",21514:"es-US",14346:"es-UY",8202:"es-VE",2077:"sv-FI",1053:"sv",1114:"syr",1064:"tg",2143:"tzm",1097:"ta",1092:"tt",1098:"te",1054:"th",1105:"bo",1055:"tr",1090:"tk",1152:"ug",1058:"uk",1070:"hsb",1056:"ur",2115:"uz-Cyrl",1091:"uz",1066:"vi",1106:"cy",1160:"wo",1157:"sah",1144:"ii",1130:"yo"},u="utf-16",v={0:"macintosh",1:"x-mac-japanese",2:"x-mac-chinesetrad",3:"x-mac-korean",6:"x-mac-greek",7:"x-mac-cyrillic",9:"x-mac-devanagai",10:"x-mac-gurmukhi",11:"x-mac-gujarati",12:"x-mac-oriya",13:"x-mac-bengali",14:"x-mac-tamil",15:"x-mac-telugu",16:"x-mac-kannada",17:"x-mac-malayalam",18:"x-mac-sinhalese",19:"x-mac-burmese",20:"x-mac-khmer",21:"x-mac-thai",22:"x-mac-lao",23:"x-mac-georgian",24:"x-mac-armenian",25:"x-mac-chinesesimp",26:"x-mac-tibetan",27:"x-mac-mongolian",28:"x-mac-ethiopic",29:"x-mac-ce",30:"x-mac-vietnamese",31:"x-mac-extarabic"},w={15:"x-mac-icelandic",17:"x-mac-turkish",18:"x-mac-croatian",24:"x-mac-ce",25:"x-mac-ce",26:"x-mac-ce",27:"x-mac-ce",28:"x-mac-ce",30:"x-mac-icelandic",37:"x-mac-romanian",38:"x-mac-ce",39:"x-mac-ce",40:"x-mac-ce",143:"x-mac-inuit",146:"x-mac-gaelic"};c.parse=f,c.make=k},{"../parse":11,"../table":13,"../types":30}],27:[function(a,b,c){"use strict";function d(a){for(var b=0;b<i.length;b+=1){var c=i[b];if(a>=c.begin&&a<c.end)return b}return-1}function e(a,b){var c={},d=new g.Parser(a,b);c.version=d.parseUShort(),c.xAvgCharWidth=d.parseShort(),c.usWeightClass=d.parseUShort(),c.usWidthClass=d.parseUShort(),c.fsType=d.parseUShort(),c.ySubscriptXSize=d.parseShort(),c.ySubscriptYSize=d.parseShort(),c.ySubscriptXOffset=d.parseShort(),c.ySubscriptYOffset=d.parseShort(),c.ySuperscriptXSize=d.parseShort(),c.ySuperscriptYSize=d.parseShort(),c.ySuperscriptXOffset=d.parseShort(),c.ySuperscriptYOffset=d.parseShort(),c.yStrikeoutSize=d.parseShort(),c.yStrikeoutPosition=d.parseShort(),c.sFamilyClass=d.parseShort(),c.panose=[];for(var e=0;e<10;e++)c.panose[e]=d.parseByte();return c.ulUnicodeRange1=d.parseULong(),c.ulUnicodeRange2=d.parseULong(),c.ulUnicodeRange3=d.parseULong(),c.ulUnicodeRange4=d.parseULong(),c.achVendID=String.fromCharCode(d.parseByte(),d.parseByte(),d.parseByte(),d.parseByte()),c.fsSelection=d.parseUShort(),c.usFirstCharIndex=d.parseUShort(),c.usLastCharIndex=d.parseUShort(),c.sTypoAscender=d.parseShort(),c.sTypoDescender=d.parseShort(),c.sTypoLineGap=d.parseShort(),c.usWinAscent=d.parseUShort(),c.usWinDescent=d.parseUShort(),c.version>=1&&(c.ulCodePageRange1=d.parseULong(),c.ulCodePageRange2=d.parseULong()),c.version>=2&&(c.sxHeight=d.parseShort(),c.sCapHeight=d.parseShort(),c.usDefaultChar=d.parseUShort(),c.usBreakChar=d.parseUShort(),c.usMaxContent=d.parseUShort()),c}function f(a){return new h.Table("OS/2",[{name:"version",type:"USHORT",value:3},{name:"xAvgCharWidth",type:"SHORT",value:0},{name:"usWeightClass",type:"USHORT",value:0},{name:"usWidthClass",type:"USHORT",value:0},{name:"fsType",type:"USHORT",value:0},{name:"ySubscriptXSize",type:"SHORT",value:650},{name:"ySubscriptYSize",type:"SHORT",value:699},{name:"ySubscriptXOffset",type:"SHORT",value:0},{name:"ySubscriptYOffset",type:"SHORT",value:140},{name:"ySuperscriptXSize",type:"SHORT",value:650},{name:"ySuperscriptYSize",type:"SHORT",value:699},{name:"ySuperscriptXOffset",type:"SHORT",value:0},{name:"ySuperscriptYOffset",type:"SHORT",value:479},{name:"yStrikeoutSize",type:"SHORT",value:49},{name:"yStrikeoutPosition",type:"SHORT",value:258},{name:"sFamilyClass",type:"SHORT",value:0},{name:"bFamilyType",type:"BYTE",value:0},{name:"bSerifStyle",type:"BYTE",value:0},{name:"bWeight",type:"BYTE",value:0},{name:"bProportion",type:"BYTE",value:0},{name:"bContrast",type:"BYTE",value:0},{name:"bStrokeVariation",type:"BYTE",value:0},{name:"bArmStyle",type:"BYTE",value:0},{name:"bLetterform",type:"BYTE",value:0},{name:"bMidline",type:"BYTE",value:0},{name:"bXHeight",type:"BYTE",value:0},{name:"ulUnicodeRange1",type:"ULONG",value:0},{name:"ulUnicodeRange2",type:"ULONG",value:0},{name:"ulUnicodeRange3",type:"ULONG",value:0},{name:"ulUnicodeRange4",type:"ULONG",value:0},{name:"achVendID",type:"CHARARRAY",value:"XXXX"},{name:"fsSelection",type:"USHORT",value:0},{name:"usFirstCharIndex",type:"USHORT",value:0},{name:"usLastCharIndex",type:"USHORT",value:0},{name:"sTypoAscender",type:"SHORT",value:0},{name:"sTypoDescender",type:"SHORT",value:0},{name:"sTypoLineGap",type:"SHORT",value:0},{name:"usWinAscent",type:"USHORT",value:0},{name:"usWinDescent",type:"USHORT",value:0},{name:"ulCodePageRange1",type:"ULONG",value:0},{name:"ulCodePageRange2",type:"ULONG",value:0},{name:"sxHeight",type:"SHORT",value:0},{name:"sCapHeight",type:"SHORT",value:0},{name:"usDefaultChar",type:"USHORT",value:0},{name:"usBreakChar",type:"USHORT",value:0},{name:"usMaxContext",type:"USHORT",value:0}],a)}var g=a("../parse"),h=a("../table"),i=[{begin:0,end:127},{begin:128,end:255},{begin:256,end:383},{begin:384,end:591},{begin:592,end:687},{begin:688,end:767},{begin:768,end:879},{begin:880,end:1023},{begin:11392,end:11519},{begin:1024,end:1279},{begin:1328,end:1423},{begin:1424,end:1535},{begin:42240,end:42559},{begin:1536,end:1791},{begin:1984,end:2047},{begin:2304,end:2431},{begin:2432,end:2559},{begin:2560,end:2687},{begin:2688,end:2815},{begin:2816,end:2943},{begin:2944,end:3071},{begin:3072,end:3199},{begin:3200,end:3327},{begin:3328,end:3455},{begin:3584,end:3711},{begin:3712,end:3839},{begin:4256,end:4351},{begin:6912,end:7039},{begin:4352,end:4607},{begin:7680,end:7935},{begin:7936,end:8191},{begin:8192,end:8303},{begin:8304,end:8351},{begin:8352,end:8399},{begin:8400,end:8447},{begin:8448,end:8527},{begin:8528,end:8591},{begin:8592,end:8703},{begin:8704,end:8959},{begin:8960,end:9215},{begin:9216,end:9279},{begin:9280,end:9311},{begin:9312,end:9471},{begin:9472,end:9599},{begin:9600,end:9631},{begin:9632,end:9727},{begin:9728,end:9983},{begin:9984,end:10175},{begin:12288,end:12351},{begin:12352,end:12447},{begin:12448,end:12543},{begin:12544,end:12591},{begin:12592,end:12687},{begin:43072,end:43135},{begin:12800,end:13055},{begin:13056,end:13311},{begin:44032,end:55215},{begin:55296,end:57343},{begin:67840,end:67871},{begin:19968,end:40959},{begin:57344,end:63743},{begin:12736,end:12783},{begin:64256,end:64335},{begin:64336,end:65023},{begin:65056,end:65071},{begin:65040,end:65055},{begin:65104,end:65135},{begin:65136,end:65279},{begin:65280,end:65519},{begin:65520,end:65535},{begin:3840,end:4095},{begin:1792,end:1871},{begin:1920,end:1983},{begin:3456,end:3583},{begin:4096,end:4255},{begin:4608,end:4991},{begin:5024,end:5119},{begin:5120,end:5759},{begin:5760,end:5791},{begin:5792,end:5887},{begin:6016,end:6143},{begin:6144,end:6319},{begin:10240,end:10495},{begin:40960,end:42127},{begin:5888,end:5919},{begin:66304,end:66351},{begin:66352,end:66383},{begin:66560,end:66639},{begin:118784,end:119039},{begin:119808,end:120831},{begin:1044480,end:1048573},{begin:65024,end:65039},{begin:917504,end:917631},{begin:6400,end:6479},{begin:6480,end:6527},{begin:6528,end:6623},{begin:6656,end:6687},{begin:11264,end:11359},{begin:11568,end:11647},{begin:19904,end:19967},{begin:43008,end:43055},{begin:65536,end:65663},{begin:65856,end:65935},{begin:66432,end:66463},{begin:66464,end:66527},{begin:66640,end:66687},{begin:66688,end:66735},{begin:67584,end:67647},{begin:68096,end:68191},{begin:119552,end:119647},{begin:73728,end:74751},{begin:119648,end:119679},{begin:7040,end:7103},{begin:7168,end:7247},{begin:7248,end:7295},{begin:43136,end:43231},{begin:43264,end:43311},{begin:43312,end:43359},{begin:43520,end:43615},{begin:65936,end:65999},{begin:66e3,end:66047},{begin:66208,end:66271},{begin:127024,end:127135}];c.unicodeRanges=i,c.getUnicodeRange=d,c.parse=e,c.make=f},{"../parse":11,"../table":13}],28:[function(a,b,c){"use strict";function d(a,b){var c,d={},e=new g.Parser(a,b);switch(d.version=e.parseVersion(),d.italicAngle=e.parseFixed(),d.underlinePosition=e.parseShort(),d.underlineThickness=e.parseShort(),d.isFixedPitch=e.parseULong(),d.minMemType42=e.parseULong(),d.maxMemType42=e.parseULong(),d.minMemType1=e.parseULong(),d.maxMemType1=e.parseULong(),d.version){case 1:d.names=f.standardNames.slice();break;case 2:for(d.numberOfGlyphs=e.parseUShort(),d.glyphNameIndex=new Array(d.numberOfGlyphs),c=0;c<d.numberOfGlyphs;c++)d.glyphNameIndex[c]=e.parseUShort();for(d.names=[],c=0;c<d.numberOfGlyphs;c++)if(d.glyphNameIndex[c]>=f.standardNames.length){var h=e.parseChar();d.names.push(e.parseString(h))}break;case 2.5:for(d.numberOfGlyphs=e.parseUShort(),d.offset=new Array(d.numberOfGlyphs),c=0;c<d.numberOfGlyphs;c++)d.offset[c]=e.parseChar()}return d}function e(){return new h.Table("post",[{name:"version",type:"FIXED",value:196608},{name:"italicAngle",type:"FIXED",value:0},{name:"underlinePosition",type:"FWORD",value:0},{name:"underlineThickness",type:"FWORD",value:0},{name:"isFixedPitch",type:"ULONG",value:0},{name:"minMemType42",type:"ULONG",value:0},{name:"maxMemType42",type:"ULONG",value:0},{name:"minMemType1",type:"ULONG",value:0},{name:"maxMemType1",type:"ULONG",value:0}])}var f=a("../encoding"),g=a("../parse"),h=a("../table");c.parse=d,c.make=e},{"../encoding":6,"../parse":11,"../table":13}],29:[function(a,b,c){"use strict";function d(a){return Math.log(a)/Math.log(2)|0}function e(a){for(;a.length%4!=0;)a.push(0);for(var b=0,c=0;c<a.length;c+=4)b+=(a[c]<<24)+(a[c+1]<<16)+(a[c+2]<<8)+a[c+3];return b%=Math.pow(2,32)}function f(a,b,c,d){return new l.Table("Table Record",[{name:"tag",type:"TAG",value:void 0!==a?a:""},{name:"checkSum",type:"ULONG",value:void 0!==b?b:0},{name:"offset",type:"ULONG",value:void 0!==c?c:0},{name:"length",type:"ULONG",value:void 0!==d?d:0}])}function g(a){var b=new l.Table("sfnt",[{name:"version",type:"TAG",value:"OTTO"},{name:"numTables",type:"USHORT",value:0},{name:"searchRange",type:"USHORT",value:0},{name:"entrySelector",type:"USHORT",value:0},{name:"rangeShift",type:"USHORT",value:0}]);b.tables=a,b.numTables=a.length;var c=Math.pow(2,d(b.numTables));b.searchRange=16*c,b.entrySelector=d(c),b.rangeShift=16*b.numTables-b.searchRange;for(var g=[],h=[],i=b.sizeOf()+f().sizeOf()*b.numTables;i%4!=0;)i+=1,h.push({name:"padding",type:"BYTE",value:0});for(var j=0;j<a.length;j+=1){var m=a[j];k.argument(4===m.tableName.length,"Table name"+m.tableName+" is invalid.");var n=m.sizeOf(),o=f(m.tableName,e(m.encode()),i,n);for(g.push({name:o.tag+" Table Record",type:"TABLE",value:o}),h.push({name:m.tableName+" table",type:"TABLE",value:m}),i+=n,k.argument(!isNaN(i),"Something went wrong calculating the offset.");i%4!=0;)i+=1,h.push({name:"padding",type:"BYTE",value:0})}return g.sort(function(a,b){return a.value.tag>b.value.tag?1:-1}),b.fields=b.fields.concat(g),b.fields=b.fields.concat(h),b}function h(a,b,c){for(var d=0;d<b.length;d+=1){var e=a.charToGlyphIndex(b[d]);if(e>0){return a.glyphs.get(e).getMetrics()}}return c}function i(a){for(var b=0,c=0;c<a.length;c+=1)b+=a[c];return b/a.length}function j(a){for(var b,c=[],d=[],f=[],j=[],k=[],l=[],w=[],x=0,y=0,z=0,A=0,B=0,C=0;C<a.glyphs.length;C+=1){var D=a.glyphs.get(C),E=0|D.unicode;(b>E||null===b)&&(b=E),x<E&&(x=E);var F=u.getUnicodeRange(E);if(F<32)y|=1<<F;else if(F<64)z|=1<<F-32;else if(F<96)A|=1<<F-64;else{if(!(F<123))throw new Error("Unicode ranges bits > 123 are reserved for internal usage");B|=1<<F-96}if(".notdef"!==D.name){var G=D.getMetrics();c.push(G.xMin),d.push(G.yMin),f.push(G.xMax),j.push(G.yMax),l.push(G.leftSideBearing),w.push(G.rightSideBearing),k.push(D.advanceWidth)}}var H={xMin:Math.min.apply(null,c),yMin:Math.min.apply(null,d),xMax:Math.max.apply(null,f),yMax:Math.max.apply(null,j),advanceWidthMax:Math.max.apply(null,k),advanceWidthAvg:i(k),minLeftSideBearing:Math.min.apply(null,l),maxLeftSideBearing:Math.max.apply(null,l),minRightSideBearing:Math.min.apply(null,w)};H.ascender=void 0!==a.ascender?a.ascender:H.yMax,H.descender=void 0!==a.descender?a.descender:H.yMin;var I=o.make({unitsPerEm:a.unitsPerEm,xMin:H.xMin,yMin:H.yMin,xMax:H.xMax,yMax:H.yMax}),J=p.make({ascender:H.ascender,descender:H.descender,advanceWidthMax:H.advanceWidthMax,minLeftSideBearing:H.minLeftSideBearing,minRightSideBearing:H.minRightSideBearing,xMaxExtent:H.maxLeftSideBearing+(H.xMax-H.xMin),numberOfHMetrics:a.glyphs.length}),K=s.make(a.glyphs.length),L=u.make({xAvgCharWidth:Math.round(H.advanceWidthAvg),usWeightClass:500,usWidthClass:5,usFirstCharIndex:b,usLastCharIndex:x,ulUnicodeRange1:y,ulUnicodeRange2:z,ulUnicodeRange3:A,ulUnicodeRange4:B,sTypoAscender:H.ascender,sTypoDescender:H.descender,sTypoLineGap:0,usWinAscent:H.ascender,usWinDescent:-H.descender,sxHeight:h(a,"xyvw",{yMax:0}).yMax,sCapHeight:h(a,"HIKLEFJMNTZBDPRAGOQSUVWXY",H).yMax,usBreakChar:a.hasChar(" ")?32:0}),M=q.make(a.glyphs),N=m.make(a.glyphs),O=a.getEnglishName("fontFamily"),P=a.getEnglishName("fontSubfamily"),Q=O+" "+P,R=a.getEnglishName("postScriptName");R||(R=O.replace(/\s/g,"")+"-"+P);var S={};for(var T in a.names)S[T]=a.names[T];S.uniqueID||(S.uniqueID={en:a.getEnglishName("manufacturer")+":"+Q}),S.postScriptName||(S.postScriptName={en:R}),S.preferredFamily||(S.preferredFamily=a.names.fontFamily),S.preferredSubfamily||(S.preferredSubfamily=a.names.fontSubfamily);var U=[],V=t.make(S,U),W=U.length>0?r.make(U):void 0,X=v.make(),Y=n.make(a.glyphs,{version:a.getEnglishName("version"),fullName:Q,familyName:O,weightName:P,postScriptName:R,unitsPerEm:a.unitsPerEm}),Z=[I,J,K,L,V,N,X,Y,M];W&&Z.push(W);var $=g(Z),_=$.encode(),aa=e(_),ba=$.fields,ca=!1;for(C=0;C<ba.length;C+=1)if("head table"===ba[C].name){ba[C].value.checkSumAdjustment=2981146554-aa,ca=!0;break}if(!ca)throw new Error("Could not find head table with checkSum to adjust.");return $}var k=a("../check"),l=a("../table"),m=a("./cmap"),n=a("./cff"),o=a("./head"),p=a("./hhea"),q=a("./hmtx"),r=a("./ltag"),s=a("./maxp"),t=a("./name"),u=a("./os2"),v=a("./post");c.computeCheckSum=e,c.make=g,c.fontToTable=j},{"../check":4,"../table":13,"./cff":14,"./cmap":15,"./head":19,"./hhea":20,"./hmtx":21,"./ltag":24,"./maxp":25,"./name":26,"./os2":27,"./post":28}],30:[function(a,b,c){"use strict";function d(a){return function(){return a}}var e=a("./check"),f=32768,g=2147483648,h={},i={},j={};i.BYTE=function(a){return e.argument(a>=0&&a<=255,"Byte value should be between 0 and 255."),[a]},j.BYTE=d(1),i.CHAR=function(a){return[a.charCodeAt(0)]},j.CHAR=d(1),i.CHARARRAY=function(a){for(var b=[],c=0;c<a.length;c+=1)b.push(a.charCodeAt(c));return b},j.CHARARRAY=function(a){return a.length},i.USHORT=function(a){return[a>>8&255,255&a]},j.USHORT=d(2),i.SHORT=function(a){return a>=f&&(a=-(2*f-a)),[a>>8&255,255&a]},j.SHORT=d(2),i.UINT24=function(a){return[a>>16&255,a>>8&255,255&a]},j.UINT24=d(3),i.ULONG=function(a){return[a>>24&255,a>>16&255,a>>8&255,255&a]},j.ULONG=d(4),i.LONG=function(a){return a>=g&&(a=-(2*g-a)),[a>>24&255,a>>16&255,a>>8&255,255&a]},j.LONG=d(4),i.FIXED=i.ULONG,j.FIXED=j.ULONG,i.FWORD=i.SHORT,j.FWORD=j.SHORT,i.UFWORD=i.USHORT,j.UFWORD=j.USHORT,i.LONGDATETIME=function(){return[0,0,0,0,0,0,0,0]},j.LONGDATETIME=d(8),i.TAG=function(a){return e.argument(4===a.length,"Tag should be exactly 4 ASCII characters."),[a.charCodeAt(0),a.charCodeAt(1),a.charCodeAt(2),a.charCodeAt(3)]},j.TAG=d(4),i.Card8=i.BYTE,j.Card8=j.BYTE,i.Card16=i.USHORT,j.Card16=j.USHORT,i.OffSize=i.BYTE,j.OffSize=j.BYTE,i.SID=i.USHORT,j.SID=j.USHORT,i.NUMBER=function(a){return a>=-107&&a<=107?[a+139]:a>=108&&a<=1131?(a-=108,[247+(a>>8),255&a]):a>=-1131&&a<=-108?(a=-a-108,[251+(a>>8),255&a]):a>=-32768&&a<=32767?i.NUMBER16(a):i.NUMBER32(a)},j.NUMBER=function(a){return i.NUMBER(a).length},i.NUMBER16=function(a){return[28,a>>8&255,255&a]},j.NUMBER16=d(3),i.NUMBER32=function(a){return[29,a>>24&255,a>>16&255,a>>8&255,255&a]},j.NUMBER32=d(5),i.REAL=function(a){var b=a.toString(),c=/\.(\d*?)(?:9{5,20}|0{5,20})\d{0,2}(?:e(.+)|$)/.exec(b);if(c){var d=parseFloat("1e"+((c[2]?+c[2]:0)+c[1].length));b=(Math.round(a*d)/d).toString()}var e,f,g="";for(e=0,f=b.length;e<f;e+=1){var h=b[e];g+="e"===h?"-"===b[++e]?"c":"b":"."===h?"a":"-"===h?"e":h}g+=1&g.length?"f":"ff";var i=[30];for(e=0,f=g.length;e<f;e+=2)i.push(parseInt(g.substr(e,2),16));return i},j.REAL=function(a){return i.REAL(a).length},i.NAME=i.CHARARRAY,j.NAME=j.CHARARRAY,i.STRING=i.CHARARRAY,j.STRING=j.CHARARRAY,h.UTF16=function(a,b,c){for(var d=[],e=c/2,f=0;f<e;f++,b+=2)d[f]=a.getUint16(b);return String.fromCharCode.apply(null,d)},i.UTF16=function(a){for(var b=[],c=0;c<a.length;c+=1){var d=a.charCodeAt(c);b.push(d>>8&255),b.push(255&d)}return b},j.UTF16=function(a){return 2*a.length};var k={"x-mac-croatian":"ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•¶ß®Š™´¨≠ŽØ∞±≤≥∆µ∂∑∏š∫ªºΩžø¿¡¬√ƒ≈ƫȅ ÀÃÕŒœĐ—“”‘’÷◊©⁄€‹›Æ»–·‚„‰ÂćÁčÈÍÎÏÌÓÔđÒÚÛÙıˆ˜¯πË˚¸Êæˇ","x-mac-cyrillic":"АБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯ†°Ґ£§•¶І®©™Ђђ≠Ѓѓ∞±≤≥іµґЈЄєЇїЉљЊњјЅ¬√ƒ≈∆«»… ЋћЌќѕ–—“”‘’÷„ЎўЏџ№Ёёяабвгдежзийклмнопрстуфхцчшщъыьэю","x-mac-gaelic":"ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•¶ß®©™´¨≠ÆØḂ±≤≥ḃĊċḊḋḞḟĠġṀæøṁṖṗɼƒſṠ«»… ÀÃÕŒœ–—“”‘’ṡẛÿŸṪ€‹›Ŷŷṫ·Ỳỳ⁊ÂÊÁËÈÍÎÏÌÓÔ♣ÒÚÛÙıÝýŴŵẄẅẀẁẂẃ","x-mac-greek":"Ĺ²É³ÖÜ΅àâä΄¨çéèê룙î‰ôö¦€ùûü†ΓΔΘΛΞΠß®©ΣΪ§≠°·Α±≤≥¥ΒΕΖΗΙΚΜΦΫΨΩάΝ¬ΟΡ≈Τ«»… ΥΧΆΈœ–―“”‘’÷ΉΊΌΎέήίόΏύαβψδεφγηιξκλμνοπώρστθωςχυζϊϋΐΰ","x-mac-icelandic":"ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûüݰ¢£§•¶ß®©™´¨≠ÆØ∞±≤≥¥µ∂∑∏π∫ªºΩæø¿¡¬√ƒ≈∆«»… ÀÃÕŒœ–—“”‘’÷◊ÿŸ⁄€ÐðÞþý·‚„‰ÂÊÁËÈÍÎÏÌÓÔÒÚÛÙıˆ˜¯˘˙˚¸˝˛ˇ","x-mac-inuit":"ᐃᐄᐅᐆᐊᐋᐱᐲᐳᐴᐸᐹᑉᑎᑏᑐᑑᑕᑖᑦᑭᑮᑯᑰᑲᑳᒃᒋᒌᒍᒎᒐᒑ°ᒡᒥᒦ•¶ᒧ®©™ᒨᒪᒫᒻᓂᓃᓄᓅᓇᓈᓐᓯᓰᓱᓲᓴᓵᔅᓕᓖᓗᓘᓚᓛᓪᔨᔩᔪᔫᔭ… ᔮᔾᕕᕖᕗ–—“”‘’ᕘᕙᕚᕝᕆᕇᕈᕉᕋᕌᕐᕿᖀᖁᖂᖃᖄᖅᖏᖐᖑᖒᖓᖔᖕᙱᙲᙳᙴᙵᙶᖖᖠᖡᖢᖣᖤᖥᖦᕼŁł","x-mac-ce":"ÄĀāÉĄÖÜáąČäčĆć鏟ĎíďĒēĖóėôöõúĚěü†°Ę£§•¶ß®©™ę¨≠ģĮįĪ≤≥īĶ∂∑łĻļĽľĹĺŅņѬ√ńŇ∆«»… ňŐÕőŌ–—“”‘’÷◊ōŔŕŘ‹›řŖŗŠ‚„šŚśÁŤťÍŽžŪÓÔūŮÚůŰűŲųÝýķŻŁżĢˇ",macintosh:"ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•¶ß®©™´¨≠ÆØ∞±≤≥¥µ∂∑∏π∫ªºΩæø¿¡¬√ƒ≈∆«»… ÀÃÕŒœ–—“”‘’÷◊ÿŸ⁄€‹›fifl‡·‚„‰ÂÊÁËÈÍÎÏÌÓÔÒÚÛÙıˆ˜¯˘˙˚¸˝˛ˇ","x-mac-romanian":"ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•¶ß®©™´¨≠ĂȘ∞±≤≥¥µ∂∑∏π∫ªºΩăș¿¡¬√ƒ≈∆«»… ÀÃÕŒœ–—“”‘’÷◊ÿŸ⁄€‹›Țț‡·‚„‰ÂÊÁËÈÍÎÏÌÓÔÒÚÛÙıˆ˜¯˘˙˚¸˝˛ˇ","x-mac-turkish":"ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•¶ß®©™´¨≠ÆØ∞±≤≥¥µ∂∑∏π∫ªºΩæø¿¡¬√ƒ≈∆«»… ÀÃÕŒœ–—“”‘’÷◊ÿŸĞğİıŞş‡·‚„‰ÂÊÁËÈÍÎÏÌÓÔÒÚÛÙˆ˜¯˘˙˚¸˝˛ˇ"};h.MACSTRING=function(a,b,c,d){var e=k[d];if(void 0!==e){for(var f="",g=0;g<c;g++){var h=a.getUint8(b+g);f+=h<=127?String.fromCharCode(h):e[127&h]}return f}};var l,m="function"==typeof WeakMap&&new WeakMap,n=function(a){if(!l){l={};for(var b in k)l[b]=new String(b)}var c=l[a];if(void 0!==c){if(m){var d=m.get(c);if(void 0!==d)return d}var e=k[a];if(void 0!==e){for(var f={},g=0;g<e.length;g++)f[e.charCodeAt(g)]=g+128;return m&&m.set(c,f),f}}};i.MACSTRING=function(a,b){var c=n(b);if(void 0!==c){for(var d=[],e=0;e<a.length;e++){var f=a.charCodeAt(e);if(f>=128&&void 0===(f=c[f]))return;d.push(f)}return d}},j.MACSTRING=function(a,b){var c=i.MACSTRING(a,b);return void 0!==c?c.length:0},i.INDEX=function(a){var b,c=1,d=[c],e=[],f=0;for(b=0;b<a.length;b+=1){var g=i.OBJECT(a[b]);Array.prototype.push.apply(e,g),f+=g.length,c+=g.length,d.push(c)}if(0===e.length)return[0,0];var h=[],j=1+Math.floor(Math.log(f)/Math.log(2))/8|0,k=[void 0,i.BYTE,i.USHORT,i.UINT24,i.ULONG][j];for(b=0;b<d.length;b+=1){var l=k(d[b]);Array.prototype.push.apply(h,l)}return Array.prototype.concat(i.Card16(a.length),i.OffSize(j),h,e)},j.INDEX=function(a){return i.INDEX(a).length},i.DICT=function(a){for(var b=[],c=Object.keys(a),d=c.length,e=0;e<d;e+=1){var f=parseInt(c[e],0),g=a[f];b=b.concat(i.OPERAND(g.value,g.type)),b=b.concat(i.OPERATOR(f))}return b},j.DICT=function(a){return i.DICT(a).length},i.OPERATOR=function(a){return a<1200?[a]:[12,a-1200]},i.OPERAND=function(a,b){var c=[];if(Array.isArray(b))for(var d=0;d<b.length;d+=1)e.argument(a.length===b.length,"Not enough arguments given for type"+b),c=c.concat(i.OPERAND(a[d],b[d]));else if("SID"===b)c=c.concat(i.NUMBER(a));else if("offset"===b)c=c.concat(i.NUMBER32(a));else if("number"===b)c=c.concat(i.NUMBER(a));else{if("real"!==b)throw new Error("Unknown operand type "+b);c=c.concat(i.REAL(a))}return c},i.OP=i.BYTE,j.OP=j.BYTE;var o="function"==typeof WeakMap&&new WeakMap;i.CHARSTRING=function(a){if(o){var b=o.get(a);if(void 0!==b)return b}for(var c=[],d=a.length,e=0;e<d;e+=1){var f=a[e];c=c.concat(i[f.type](f.value))}return o&&o.set(a,c),c},j.CHARSTRING=function(a){return i.CHARSTRING(a).length},i.OBJECT=function(a){var b=i[a.type];return e.argument(void 0!==b,"No encoding function for type "+a.type),b(a.value)},j.OBJECT=function(a){var b=j[a.type];return e.argument(void 0!==b,"No sizeOf function for type "+a.type),b(a.value)},i.TABLE=function(a){for(var b=[],c=a.fields.length,d=0;d<c;d+=1){var f=a.fields[d],g=i[f.type];e.argument(void 0!==g,"No encoding function for field type "+f.type);var h=a[f.name];void 0===h&&(h=f.value);var j=g(h);b=b.concat(j)}return b},j.TABLE=function(a){for(var b=0,c=a.fields.length,d=0;d<c;d+=1){var f=a.fields[d],g=j[f.type];e.argument(void 0!==g,"No sizeOf function for field type "+f.type);var h=a[f.name];void 0===h&&(h=f.value),b+=g(h)}return b},i.LITERAL=function(a){return a},j.LITERAL=function(a){return a.length},c.decode=h,c.encode=i,c.sizeOf=j},{"./check":4}],31:[function(a,b,c){function d(){throw new Error("setTimeout has not been defined")}function e(){throw new Error("clearTimeout has not been defined")}function f(a){if(l===setTimeout)return setTimeout(a,0);if((l===d||!l)&&setTimeout)return l=setTimeout,setTimeout(a,0);try{return l(a,0)}catch(b){try{return l.call(null,a,0)}catch(b){return l.call(this,a,0)}}}function g(a){if(m===clearTimeout)return clearTimeout(a);if((m===e||!m)&&clearTimeout)return m=clearTimeout,clearTimeout(a);try{return m(a)}catch(b){try{return m.call(null,a)}catch(b){return m.call(this,a)}}}function h(){q&&o&&(q=!1,o.length?p=o.concat(p):r=-1,p.length&&i())}function i(){if(!q){var a=f(h);q=!0;for(var b=p.length;b;){for(o=p,p=[];++r<b;)o&&o[r].run();r=-1,b=p.length}o=null,q=!1,g(a)}}function j(a,b){this.fun=a,this.array=b}function k(){}var l,m,n=b.exports={};!function(){try{l="function"==typeof setTimeout?setTimeout:d}catch(a){l=d}try{m="function"==typeof clearTimeout?clearTimeout:e}catch(a){m=e}}();var o,p=[],q=!1,r=-1;n.nextTick=function(a){var b=new Array(arguments.length-1);if(arguments.length>1)for(var c=1;c<arguments.length;c++)b[c-1]=arguments[c];p.push(new j(a,b)),1!==p.length||q||f(i)},j.prototype.run=function(){this.fun.apply(null,this.array)},n.title="browser",n.browser=!0,n.env={},n.argv=[],n.version="",n.versions={},n.on=k,n.addListener=k,n.once=k,n.off=k,n.removeListener=k,n.removeAllListeners=k,n.emit=k,n.binding=function(a){throw new Error("process.binding is not supported")},n.cwd=function(){return"/"},n.chdir=function(a){throw new Error("process.chdir is not supported")},n.umask=function(){return 0}},{}],32:[function(a,b,c){!function(a){"use strict";function b(a){if("string"!=typeof a&&(a=String(a)),/[^a-z0-9\-#$%&'*+.\^_`|~]/i.test(a))throw new TypeError("Invalid character in header field name");return a.toLowerCase()}function c(a){return"string"!=typeof a&&(a=String(a)),a}function d(a){
var b={next:function(){var b=a.shift();return{done:void 0===b,value:b}}};return r.iterable&&(b[Symbol.iterator]=function(){return b}),b}function e(a){this.map={},a instanceof e?a.forEach(function(a,b){this.append(b,a)},this):Array.isArray(a)?a.forEach(function(a){this.append(a[0],a[1])},this):a&&Object.getOwnPropertyNames(a).forEach(function(b){this.append(b,a[b])},this)}function f(a){if(a.bodyUsed)return Promise.reject(new TypeError("Already read"));a.bodyUsed=!0}function g(a){return new Promise(function(b,c){a.onload=function(){b(a.result)},a.onerror=function(){c(a.error)}})}function h(a){var b=new FileReader,c=g(b);return b.readAsArrayBuffer(a),c}function i(a){var b=new FileReader,c=g(b);return b.readAsText(a),c}function j(a){for(var b=new Uint8Array(a),c=new Array(b.length),d=0;d<b.length;d++)c[d]=String.fromCharCode(b[d]);return c.join("")}function k(a){if(a.slice)return a.slice(0);var b=new Uint8Array(a.byteLength);return b.set(new Uint8Array(a)),b.buffer}function l(){return this.bodyUsed=!1,this._initBody=function(a){if(this._bodyInit=a,a)if("string"==typeof a)this._bodyText=a;else if(r.blob&&Blob.prototype.isPrototypeOf(a))this._bodyBlob=a;else if(r.formData&&FormData.prototype.isPrototypeOf(a))this._bodyFormData=a;else if(r.searchParams&&URLSearchParams.prototype.isPrototypeOf(a))this._bodyText=a.toString();else if(r.arrayBuffer&&r.blob&&t(a))this._bodyArrayBuffer=k(a.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer]);else{if(!r.arrayBuffer||!ArrayBuffer.prototype.isPrototypeOf(a)&&!u(a))throw new Error("unsupported BodyInit type");this._bodyArrayBuffer=k(a)}else this._bodyText="";this.headers.get("content-type")||("string"==typeof a?this.headers.set("content-type","text/plain;charset=UTF-8"):this._bodyBlob&&this._bodyBlob.type?this.headers.set("content-type",this._bodyBlob.type):r.searchParams&&URLSearchParams.prototype.isPrototypeOf(a)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},r.blob&&(this.blob=function(){var a=f(this);if(a)return a;if(this._bodyBlob)return Promise.resolve(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(new Blob([this._bodyArrayBuffer]));if(this._bodyFormData)throw new Error("could not read FormData body as blob");return Promise.resolve(new Blob([this._bodyText]))},this.arrayBuffer=function(){return this._bodyArrayBuffer?f(this)||Promise.resolve(this._bodyArrayBuffer):this.blob().then(h)}),this.text=function(){var a=f(this);if(a)return a;if(this._bodyBlob)return i(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(j(this._bodyArrayBuffer));if(this._bodyFormData)throw new Error("could not read FormData body as text");return Promise.resolve(this._bodyText)},r.formData&&(this.formData=function(){return this.text().then(o)}),this.json=function(){return this.text().then(JSON.parse)},this}function m(a){var b=a.toUpperCase();return v.indexOf(b)>-1?b:a}function n(a,b){b=b||{};var c=b.body;if(a instanceof n){if(a.bodyUsed)throw new TypeError("Already read");this.url=a.url,this.credentials=a.credentials,b.headers||(this.headers=new e(a.headers)),this.method=a.method,this.mode=a.mode,c||null==a._bodyInit||(c=a._bodyInit,a.bodyUsed=!0)}else this.url=String(a);if(this.credentials=b.credentials||this.credentials||"omit",!b.headers&&this.headers||(this.headers=new e(b.headers)),this.method=m(b.method||this.method||"GET"),this.mode=b.mode||this.mode||null,this.referrer=null,("GET"===this.method||"HEAD"===this.method)&&c)throw new TypeError("Body not allowed for GET or HEAD requests");this._initBody(c)}function o(a){var b=new FormData;return a.trim().split("&").forEach(function(a){if(a){var c=a.split("="),d=c.shift().replace(/\+/g," "),e=c.join("=").replace(/\+/g," ");b.append(decodeURIComponent(d),decodeURIComponent(e))}}),b}function p(a){var b=new e;return a.split(/\r?\n/).forEach(function(a){var c=a.split(":"),d=c.shift().trim();if(d){var e=c.join(":").trim();b.append(d,e)}}),b}function q(a,b){b||(b={}),this.type="default",this.status="status"in b?b.status:200,this.ok=this.status>=200&&this.status<300,this.statusText="statusText"in b?b.statusText:"OK",this.headers=new e(b.headers),this.url=b.url||"",this._initBody(a)}if(!a.fetch){var r={searchParams:"URLSearchParams"in a,iterable:"Symbol"in a&&"iterator"in Symbol,blob:"FileReader"in a&&"Blob"in a&&function(){try{return new Blob,!0}catch(a){return!1}}(),formData:"FormData"in a,arrayBuffer:"ArrayBuffer"in a};if(r.arrayBuffer)var s=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],t=function(a){return a&&DataView.prototype.isPrototypeOf(a)},u=ArrayBuffer.isView||function(a){return a&&s.indexOf(Object.prototype.toString.call(a))>-1};e.prototype.append=function(a,d){a=b(a),d=c(d);var e=this.map[a];this.map[a]=e?e+","+d:d},e.prototype.delete=function(a){delete this.map[b(a)]},e.prototype.get=function(a){return a=b(a),this.has(a)?this.map[a]:null},e.prototype.has=function(a){return this.map.hasOwnProperty(b(a))},e.prototype.set=function(a,d){this.map[b(a)]=c(d)},e.prototype.forEach=function(a,b){for(var c in this.map)this.map.hasOwnProperty(c)&&a.call(b,this.map[c],c,this)},e.prototype.keys=function(){var a=[];return this.forEach(function(b,c){a.push(c)}),d(a)},e.prototype.values=function(){var a=[];return this.forEach(function(b){a.push(b)}),d(a)},e.prototype.entries=function(){var a=[];return this.forEach(function(b,c){a.push([c,b])}),d(a)},r.iterable&&(e.prototype[Symbol.iterator]=e.prototype.entries);var v=["DELETE","GET","HEAD","OPTIONS","POST","PUT"];n.prototype.clone=function(){return new n(this,{body:this._bodyInit})},l.call(n.prototype),l.call(q.prototype),q.prototype.clone=function(){return new q(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new e(this.headers),url:this.url})},q.error=function(){var a=new q(null,{status:0,statusText:""});return a.type="error",a};var w=[301,302,303,307,308];q.redirect=function(a,b){if(w.indexOf(b)===-1)throw new RangeError("Invalid status code");return new q(null,{status:b,headers:{location:a}})},a.Headers=e,a.Request=n,a.Response=q,a.fetch=function(a,b){return new Promise(function(c,d){var e=new n(a,b),f=new XMLHttpRequest;f.onload=function(){var a={status:f.status,statusText:f.statusText,headers:p(f.getAllResponseHeaders()||"")};a.url="responseURL"in f?f.responseURL:a.headers.get("X-Request-URL"),c(new q("response"in f?f.response:f.responseText,a))},f.onerror=function(){d(new TypeError("Network request failed"))},f.ontimeout=function(){d(new TypeError("Network request failed"))},f.open(e.method,e.url,!0),"include"===e.credentials&&(f.withCredentials=!0),"responseType"in f&&r.blob&&(f.responseType="blob"),e.headers.forEach(function(a,b){f.setRequestHeader(b,a)}),f.send(void 0===e._bodyInit?null:e._bodyInit)})},a.fetch.polyfill=!0}}("undefined"!=typeof self?self:this)},{}],33:[function(a,b,c){"use strict";var d=a("./core/core");a("./color/p5.Color"),a("./core/p5.Element"),a("./typography/p5.Font"),a("./core/p5.Graphics"),a("./core/p5.Renderer2D"),a("./image/p5.Image"),a("./math/p5.Vector"),a("./io/p5.TableRow"),a("./io/p5.Table"),a("./io/p5.XML"),a("./color/creating_reading"),a("./color/setting"),a("./core/constants"),a("./utilities/conversion"),a("./utilities/array_functions"),a("./utilities/string_functions"),a("./core/environment"),a("./image/image"),a("./image/loading_displaying"),a("./image/pixels"),a("./io/files"),a("./events/keyboard"),a("./events/acceleration"),a("./events/mouse"),a("./utilities/time_date"),a("./events/touch"),a("./math/math"),a("./math/calculation"),a("./math/random"),a("./math/noise"),a("./math/trigonometry"),a("./core/rendering"),a("./core/2d_primitives"),a("./core/attributes"),a("./core/curves"),a("./core/vertex"),a("./core/structure"),a("./core/transform"),a("./typography/attributes"),a("./typography/loading_displaying"),a("./webgl/p5.RendererGL"),a("./webgl/p5.Geometry"),a("./webgl/p5.RendererGL.Retained"),a("./webgl/p5.RendererGL.Immediate"),a("./webgl/primitives"),a("./webgl/loading"),a("./webgl/p5.Matrix"),a("./webgl/material"),a("./webgl/light"),a("./webgl/shader"),a("./webgl/camera"),a("./webgl/interaction");var e=function(){window.PHANTOMJS||window.mocha||(window.setup&&"function"==typeof window.setup||window.draw&&"function"==typeof window.draw)&&!d.instance&&new d};"complete"===document.readyState?e():window.addEventListener("load",e,!1),b.exports=d},{"./color/creating_reading":35,"./color/p5.Color":36,"./color/setting":37,"./core/2d_primitives":38,"./core/attributes":39,"./core/constants":41,"./core/core":42,"./core/curves":43,"./core/environment":44,"./core/p5.Element":46,"./core/p5.Graphics":47,"./core/p5.Renderer2D":49,"./core/rendering":50,"./core/structure":52,"./core/transform":53,"./core/vertex":54,"./events/acceleration":55,"./events/keyboard":56,"./events/mouse":57,"./events/touch":58,"./image/image":60,"./image/loading_displaying":61,"./image/p5.Image":62,"./image/pixels":63,"./io/files":64,"./io/p5.Table":65,"./io/p5.TableRow":66,"./io/p5.XML":67,"./math/calculation":68,"./math/math":69,"./math/noise":70,"./math/p5.Vector":71,"./math/random":73,"./math/trigonometry":74,"./typography/attributes":75,"./typography/loading_displaying":76,"./typography/p5.Font":77,"./utilities/array_functions":78,"./utilities/conversion":79,"./utilities/string_functions":80,"./utilities/time_date":81,"./webgl/camera":82,"./webgl/interaction":83,"./webgl/light":84,"./webgl/loading":85,"./webgl/material":86,"./webgl/p5.Geometry":87,"./webgl/p5.Matrix":88,"./webgl/p5.RendererGL":91,"./webgl/p5.RendererGL.Immediate":89,"./webgl/p5.RendererGL.Retained":90,"./webgl/primitives":92,"./webgl/shader":93}],34:[function(a,b,c){"use strict";var d=a("../core/core");d.ColorConversion={},d.ColorConversion._hsbaToHSLA=function(a){var b=a[0],c=a[1],d=a[2],e=(2-c)*d/2;return 0!==e&&(1===e?c=0:e<.5?c/=2-c:c=c*d/(2-2*e)),[b,c,e,a[3]]},d.ColorConversion._hsbaToRGBA=function(a){var b=6*a[0],c=a[1],d=a[2],e=[];if(0===c)e=[d,d,d,a[3]];else{var f,g,h,i=Math.floor(b),j=d*(1-c),k=d*(1-c*(b-i)),l=d*(1-c*(1+i-b));1===i?(f=k,g=d,h=j):2===i?(f=j,g=d,h=l):3===i?(f=j,g=k,h=d):4===i?(f=l,g=j,h=d):5===i?(f=d,g=j,h=k):(f=d,g=l,h=j),e=[f,g,h,a[3]]}return e},d.ColorConversion._hslaToHSBA=function(a){var b,c=a[0],d=a[1],e=a[2];return b=e<.5?(1+d)*e:e+d-e*d,d=2*(b-e)/b,[c,d,b,a[3]]},d.ColorConversion._hslaToRGBA=function(a){var b=6*a[0],c=a[1],d=a[2],e=[];if(0===c)e=[d,d,d,a[3]];else{var f;f=d<.5?(1+c)*d:d+c-d*c;var g=2*d-f,h=function(a,b,c){return a<0?a+=6:a>=6&&(a-=6),a<1?b+(c-b)*a:a<3?c:a<4?b+(c-b)*(4-a):b};e=[h(b+2,g,f),h(b,g,f),h(b-2,g,f),a[3]]}return e},d.ColorConversion._rgbaToHSBA=function(a){var b,c,d=a[0],e=a[1],f=a[2],g=Math.max(d,e,f),h=g-Math.min(d,e,f);return 0===h?(b=0,c=0):(c=h/g,d===g?b=(e-f)/h:e===g?b=2+(f-d)/h:f===g&&(b=4+(d-e)/h),b<0?b+=6:b>=6&&(b-=6)),[b/6,c,g,a[3]]},d.ColorConversion._rgbaToHSLA=function(a){var b,c,d=a[0],e=a[1],f=a[2],g=Math.max(d,e,f),h=Math.min(d,e,f),i=g+h,j=g-h;return 0===j?(b=0,c=0):(c=i<1?j/i:j/(2-i),d===g?b=(e-f)/j:e===g?b=2+(f-d)/j:f===g&&(b=4+(d-e)/j),b<0?b+=6:b>=6&&(b-=6)),[b/6,c,i/2,a[3]]},b.exports=d.ColorConversion},{"../core/core":42}],35:[function(a,b,c){"use strict";var d=a("../core/core"),e=a("../core/constants");a("./p5.Color"),d.prototype.alpha=function(a){if(a instanceof d.Color||a instanceof Array)return this.color(a)._getAlpha();throw new Error("Needs p5.Color or pixel array as argument.")},d.prototype.blue=function(a){if(a instanceof d.Color||a instanceof Array)return this.color(a)._getBlue();throw new Error("Needs p5.Color or pixel array as argument.")},d.prototype.brightness=function(a){if(a instanceof d.Color||a instanceof Array)return this.color(a)._getBrightness();throw new Error("Needs p5.Color or pixel array as argument.")},d.prototype.color=function(){return arguments[0]instanceof d.Color?arguments[0]:arguments[0]instanceof Array?this instanceof d.Renderer?new d.Color(this,arguments[0]):new d.Color(this._renderer,arguments[0]):this instanceof d.Renderer?new d.Color(this,arguments):new d.Color(this._renderer,arguments)},d.prototype.green=function(a){if(a instanceof d.Color||a instanceof Array)return this.color(a)._getGreen();throw new Error("Needs p5.Color or pixel array as argument.")},d.prototype.hue=function(a){if(a instanceof d.Color||a instanceof Array)return this.color(a)._getHue();throw new Error("Needs p5.Color or pixel array as argument.")},d.prototype.lerpColor=function(a,b,c){var d,f,g,h,i,j,k=this._renderer._colorMode,l=this._renderer._colorMaxes;if(k===e.RGB)i=a.levels.map(function(a){return a/255}),j=b.levels.map(function(a){return a/255});else if(k===e.HSB)a._getBrightness(),b._getBrightness(),i=a.hsba,j=b.hsba;else{if(k!==e.HSL)throw new Error(k+"cannot be used for interpolation.");a._getLightness(),b._getLightness(),i=a.hsla,j=b.hsla}return c=Math.max(Math.min(c,1),0),d=this.lerp(i[0],j[0],c),f=this.lerp(i[1],j[1],c),g=this.lerp(i[2],j[2],c),h=this.lerp(i[3],j[3],c),d*=l[k][0],f*=l[k][1],g*=l[k][2],h*=l[k][3],this.color(d,f,g,h)},d.prototype.lightness=function(a){if(a instanceof d.Color||a instanceof Array)return this.color(a)._getLightness();throw new Error("Needs p5.Color or pixel array as argument.")},d.prototype.red=function(a){if(a instanceof d.Color||a instanceof Array)return this.color(a)._getRed();throw new Error("Needs p5.Color or pixel array as argument.")},d.prototype.saturation=function(a){if(a instanceof d.Color||a instanceof Array)return this.color(a)._getSaturation();throw new Error("Needs p5.Color or pixel array as argument.")},b.exports=d},{"../core/constants":41,"../core/core":42,"./p5.Color":36}],36:[function(a,b,c){var d=a("../core/core"),e=a("../core/constants"),f=a("./color_conversion");d.Color=function(a,b){if(this.mode=a._colorMode,this.maxes=a._colorMaxes,this.mode!==e.RGB&&this.mode!==e.HSL&&this.mode!==e.HSB)throw new Error(this.mode+" is an invalid colorMode.");return this._array=d.Color._parseInputs.apply(a,b),this.levels=this._array.map(function(a){return Math.round(255*a)}),this},d.Color.prototype.toString=function(){var a=this.levels,b=this._array[3];return"rgba("+a[0]+","+a[1]+","+a[2]+","+b+")"},d.Color.prototype._getAlpha=function(){return this._array[3]*this.maxes[this.mode][3]},d.Color.prototype._getBlue=function(){return this._array[2]*this.maxes[e.RGB][2]},d.Color.prototype._getBrightness=function(){return this.hsba||(this.hsba=f._rgbaToHSBA(this._array)),this.hsba[2]*this.maxes[e.HSB][2]},d.Color.prototype._getGreen=function(){return this._array[1]*this.maxes[e.RGB][1]},d.Color.prototype._getHue=function(){return this.mode===e.HSB?(this.hsba||(this.hsba=f._rgbaToHSBA(this._array)),this.hsba[0]*this.maxes[e.HSB][0]):(this.hsla||(this.hsla=f._rgbaToHSLA(this._array)),this.hsla[0]*this.maxes[e.HSL][0])},d.Color.prototype._getLightness=function(){return this.hsla||(this.hsla=f._rgbaToHSLA(this._array)),this.hsla[2]*this.maxes[e.HSL][2]},d.Color.prototype._getRed=function(){return this._array[0]*this.maxes[e.RGB][0]},d.Color.prototype._getSaturation=function(){return this.mode===e.HSB?(this.hsba||(this.hsba=f._rgbaToHSBA(this._array)),this.hsba[1]*this.maxes[e.HSB][1]):(this.hsla||(this.hsla=f._rgbaToHSLA(this._array)),this.hsla[1]*this.maxes[e.HSL][1])};var g={aliceblue:"#f0f8ff",antiquewhite:"#faebd7",aqua:"#00ffff",aquamarine:"#7fffd4",azure:"#f0ffff",beige:"#f5f5dc",bisque:"#ffe4c4",black:"#000000",blanchedalmond:"#ffebcd",blue:"#0000ff",blueviolet:"#8a2be2",brown:"#a52a2a",burlywood:"#deb887",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",cornflowerblue:"#6495ed",cornsilk:"#fff8dc",crimson:"#dc143c",cyan:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkgray:"#a9a9a9",darkgreen:"#006400",darkgrey:"#a9a9a9",darkkhaki:"#bdb76b",darkmagenta:"#8b008b",darkolivegreen:"#556b2f",darkorange:"#ff8c00",darkorchid:"#9932cc",darkred:"#8b0000",darksalmon:"#e9967a",darkseagreen:"#8fbc8f",darkslateblue:"#483d8b",darkslategray:"#2f4f4f",darkslategrey:"#2f4f4f",darkturquoise:"#00ced1",darkviolet:"#9400d3",deeppink:"#ff1493",deepskyblue:"#00bfff",dimgray:"#696969",dimgrey:"#696969",dodgerblue:"#1e90ff",firebrick:"#b22222",floralwhite:"#fffaf0",forestgreen:"#228b22",fuchsia:"#ff00ff",gainsboro:"#dcdcdc",ghostwhite:"#f8f8ff",gold:"#ffd700",goldenrod:"#daa520",gray:"#808080",green:"#008000",greenyellow:"#adff2f",grey:"#808080",honeydew:"#f0fff0",hotpink:"#ff69b4",indianred:"#cd5c5c",indigo:"#4b0082",ivory:"#fffff0",khaki:"#f0e68c",lavender:"#e6e6fa",lavenderblush:"#fff0f5",lawngreen:"#7cfc00",lemonchiffon:"#fffacd",lightblue:"#add8e6",lightcoral:"#f08080",lightcyan:"#e0ffff",lightgoldenrodyellow:"#fafad2",lightgray:"#d3d3d3",lightgreen:"#90ee90",lightgrey:"#d3d3d3",lightpink:"#ffb6c1",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",lightskyblue:"#87cefa",lightslategray:"#778899",lightslategrey:"#778899",lightsteelblue:"#b0c4de",lightyellow:"#ffffe0",lime:"#00ff00",limegreen:"#32cd32",linen:"#faf0e6",magenta:"#ff00ff",maroon:"#800000",mediumaquamarine:"#66cdaa",mediumblue:"#0000cd",mediumorchid:"#ba55d3",mediumpurple:"#9370db",mediumseagreen:"#3cb371",mediumslateblue:"#7b68ee",mediumspringgreen:"#00fa9a",mediumturquoise:"#48d1cc",mediumvioletred:"#c71585",midnightblue:"#191970",mintcream:"#f5fffa",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",navajowhite:"#ffdead",navy:"#000080",oldlace:"#fdf5e6",olive:"#808000",olivedrab:"#6b8e23",orange:"#ffa500",orangered:"#ff4500",orchid:"#da70d6",palegoldenrod:"#eee8aa",palegreen:"#98fb98",paleturquoise:"#afeeee",palevioletred:"#db7093",papayawhip:"#ffefd5",peachpuff:"#ffdab9",peru:"#cd853f",pink:"#ffc0cb",plum:"#dda0dd",powderblue:"#b0e0e6",purple:"#800080",red:"#ff0000",rosybrown:"#bc8f8f",royalblue:"#4169e1",saddlebrown:"#8b4513",salmon:"#fa8072",sandybrown:"#f4a460",seagreen:"#2e8b57",seashell:"#fff5ee",sienna:"#a0522d",silver:"#c0c0c0",skyblue:"#87ceeb",slateblue:"#6a5acd",slategray:"#708090",slategrey:"#708090",snow:"#fffafa",springgreen:"#00ff7f",steelblue:"#4682b4",tan:"#d2b48c",teal:"#008080",thistle:"#d8bfd8",tomato:"#ff6347",turquoise:"#40e0d0",violet:"#ee82ee",wheat:"#f5deb3",white:"#ffffff",whitesmoke:"#f5f5f5",yellow:"#ffff00",yellowgreen:"#9acd32"},h=/\s*/,i=/(\d{1,3})/,j=/((?:\d+(?:\.\d+)?)|(?:\.\d+))/,k=new RegExp(j.source+"%"),l={HEX3:/^#([a-f0-9])([a-f0-9])([a-f0-9])$/i,HEX6:/^#([a-f0-9]{2})([a-f0-9]{2})([a-f0-9]{2})$/i,RGB:new RegExp(["^rgb\\(",i.source,",",i.source,",",i.source,"\\)$"].join(h.source),"i"),RGB_PERCENT:new RegExp(["^rgb\\(",k.source,",",k.source,",",k.source,"\\)$"].join(h.source),"i"),RGBA:new RegExp(["^rgba\\(",i.source,",",i.source,",",i.source,",",j.source,"\\)$"].join(h.source),"i"),RGBA_PERCENT:new RegExp(["^rgba\\(",k.source,",",k.source,",",k.source,",",j.source,"\\)$"].join(h.source),"i"),HSL:new RegExp(["^hsl\\(",i.source,",",k.source,",",k.source,"\\)$"].join(h.source),"i"),HSLA:new RegExp(["^hsla\\(",i.source,",",k.source,",",k.source,",",j.source,"\\)$"].join(h.source),"i"),HSB:new RegExp(["^hsb\\(",i.source,",",k.source,",",k.source,"\\)$"].join(h.source),"i"),HSBA:new RegExp(["^hsba\\(",i.source,",",k.source,",",k.source,",",j.source,"\\)$"].join(h.source),"i")};d.Color._parseInputs=function(){var a=arguments.length,b=this._colorMode,c=this._colorMaxes,h=[];if(a>=3)return h[0]=arguments[0]/c[b][0],h[1]=arguments[1]/c[b][1],h[2]=arguments[2]/c[b][2],"number"==typeof arguments[3]?h[3]=arguments[3]/c[b][3]:h[3]=1,h=h.map(function(a){return Math.max(Math.min(a,1),0)}),b===e.HSL?f._hslaToRGBA(h):b===e.HSB?f._hsbaToRGBA(h):h;if(1===a&&"string"==typeof arguments[0]){var i=arguments[0].trim().toLowerCase();if(g[i])return d.Color._parseInputs.apply(this,[g[i]]);if(l.HEX3.test(i))return h=l.HEX3.exec(i).slice(1).map(function(a){return parseInt(a+a,16)/255}),h[3]=1,h;if(l.HEX6.test(i))return h=l.HEX6.exec(i).slice(1).map(function(a){return parseInt(a,16)/255}),h[3]=1,h;if(l.RGB.test(i))return h=l.RGB.exec(i).slice(1).map(function(a){return a/255}),h[3]=1,h;if(l.RGB_PERCENT.test(i))return h=l.RGB_PERCENT.exec(i).slice(1).map(function(a){return parseFloat(a)/100}),h[3]=1,h;if(l.RGBA.test(i))return h=l.RGBA.exec(i).slice(1).map(function(a,b){return 3===b?parseFloat(a):a/255});if(l.RGBA_PERCENT.test(i))return h=l.RGBA_PERCENT.exec(i).slice(1).map(function(a,b){return 3===b?parseFloat(a):parseFloat(a)/100});if(l.HSL.test(i)?(h=l.HSL.exec(i).slice(1).map(function(a,b){return 0===b?parseInt(a,10)/360:parseInt(a,10)/100}),h[3]=1):l.HSLA.test(i)&&(h=l.HSLA.exec(i).slice(1).map(function(a,b){return 0===b?parseInt(a,10)/360:3===b?parseFloat(a):parseInt(a,10)/100})),h=h.map(function(a){return Math.max(Math.min(a,1),0)}),h.length)return f._hslaToRGBA(h);if(l.HSB.test(i)?(h=l.HSB.exec(i).slice(1).map(function(a,b){return 0===b?parseInt(a,10)/360:parseInt(a,10)/100}),h[3]=1):l.HSBA.test(i)&&(h=l.HSBA.exec(i).slice(1).map(function(a,b){return 0===b?parseInt(a,10)/360:3===b?parseFloat(a):parseInt(a,10)/100})),h=h.map(function(a){return Math.max(Math.min(a,1),0)}),h.length)return f._hsbaToRGBA(h);h=[1,1,1,1]}else{if(1!==a&&2!==a||"number"!=typeof arguments[0])throw new Error(arguments+"is not a valid color representation.");h[0]=arguments[0]/c[b][2],h[1]=arguments[0]/c[b][2],h[2]=arguments[0]/c[b][2],"number"==typeof arguments[1]?h[3]=arguments[1]/c[b][3]:h[3]=1,h=h.map(function(a){return Math.max(Math.min(a,1),0)})}return h},b.exports=d.Color},{"../core/constants":41,"../core/core":42,"./color_conversion":34}],37:[function(a,b,c){"use strict";var d=a("../core/core"),e=a("../core/constants");a("./p5.Color"),d.prototype.background=function(){return arguments[0]instanceof d.Image?this.image(arguments[0],0,0,this.width,this.height):this._renderer.background.apply(this._renderer,arguments),this},d.prototype.clear=function(){return this._renderer.clear(),this},d.prototype.colorMode=function(){if(arguments[0]===e.RGB||arguments[0]===e.HSB||arguments[0]===e.HSL){this._renderer._colorMode=arguments[0];var a=this._renderer._colorMaxes[this._renderer._colorMode];2===arguments.length?(a[0]=arguments[1],a[1]=arguments[1],a[2]=arguments[1],a[3]=arguments[1]):4===arguments.length?(a[0]=arguments[1],a[1]=arguments[2],a[2]=arguments[3]):5===arguments.length&&(a[0]=arguments[1],a[1]=arguments[2],a[2]=arguments[3],a[3]=arguments[4])}return this},d.prototype.fill=function(){return this._renderer._setProperty("_fillSet",!0),this._renderer._setProperty("_doFill",!0),this._renderer.fill.apply(this._renderer,arguments),this},d.prototype.noFill=function(){return this._renderer._setProperty("_doFill",!1),this},d.prototype.noStroke=function(){return this._renderer._setProperty("_doStroke",!1),this},d.prototype.stroke=function(){return this._renderer._setProperty("_strokeSet",!0),this._renderer._setProperty("_doStroke",!0),this._renderer.stroke.apply(this._renderer,arguments),this},b.exports=d},{"../core/constants":41,"../core/core":42,"./p5.Color":36}],38:[function(a,b,c){"use strict";var d=a("./core"),e=a("./constants"),f=a("./canvas");a("./error_helpers"),d.prototype.arc=function(a,b,c,d,f,g,h){for(var i=new Array(arguments.length),j=0;j<i.length;++j)i[j]=arguments[j];if(!this._renderer._doStroke&&!this._renderer._doFill)return this;for(this._angleMode===e.DEGREES&&(f=this.radians(f),g=this.radians(g));f<0;)f+=e.TWO_PI;for(;g<0;)g+=e.TWO_PI;return f%=e.TWO_PI,g%=e.TWO_PI,g===f&&(g+=e.TWO_PI),f=f<=e.HALF_PI?Math.atan(c/d*Math.tan(f)):f>e.HALF_PI&&f<=3*e.HALF_PI?Math.atan(c/d*Math.tan(f))+e.PI:Math.atan(c/d*Math.tan(f))+e.TWO_PI,g=g<=e.HALF_PI?Math.atan(c/d*Math.tan(g)):g>e.HALF_PI&&g<=3*e.HALF_PI?Math.atan(c/d*Math.tan(g))+e.PI:Math.atan(c/d*Math.tan(g))+e.TWO_PI,f>g&&(g+=e.TWO_PI),c=Math.abs(c),d=Math.abs(d),this._renderer.arc(a,b,c,d,f,g,h),this},d.prototype.ellipse=function(){for(var a=new Array(arguments.length),b=0;b<a.length;++b)a[b]=arguments[b];if(3===a.length&&a.push(a[2]),a[2]<0&&(a[2]=Math.abs(a[2])),a[3]<0&&(a[3]=Math.abs(a[3])),!this._renderer._doStroke&&!this._renderer._doFill)return this;var c=f.modeAdjust(a[0],a[1],a[2],a[3],this._renderer._ellipseMode);return a[0]=c.x,a[1]=c.y,a[2]=c.w,a[3]=c.h,this._renderer.ellipse(a),this},d.prototype.line=function(){if(!this._renderer._doStroke)return this;for(var a=new Array(arguments.length),b=0;b<a.length;++b)a[b]=arguments[b];return this._renderer.isP3D?this._renderer.line(a[0],a[1],a[2],a[3],a[4],a[5]):this._renderer.line(a[0],a[1],a[2],a[3]),this},d.prototype.point=function(){if(!this._renderer._doStroke)return this;for(var a=new Array(arguments.length),b=0;b<a.length;++b)a[b]=arguments[b];return this._renderer.isP3D?this._renderer.point(a[0],a[1],a[2]):this._renderer.point(a[0],a[1]),this},d.prototype.quad=function(){if(!this._renderer._doStroke&&!this._renderer._doFill)return this;for(var a=new Array(arguments.length),b=0;b<a.length;++b)a[b]=arguments[b];return this._renderer.isP3D?this._renderer.quad(a[0],a[1],a[2],a[3],a[4],a[5],a[6],a[7],a[8],a[9],a[10],a[11]):this._renderer.quad(a[0],a[1],a[2],a[3],a[4],a[5],a[6],a[7]),this},d.prototype.rect=function(){for(var a=new Array(arguments.length),b=0;b<a.length;++b)a[b]=arguments[b];if(this._renderer._doStroke||this._renderer._doFill){var c=f.modeAdjust(a[0],a[1],a[2],a[3],this._renderer._rectMode);return a[0]=c.x,a[1]=c.y,a[2]=c.w,a[3]=c.h,this._renderer.rect(a),this}},d.prototype.triangle=function(){if(!this._renderer._doStroke&&!this._renderer._doFill)return this;for(var a=new Array(arguments.length),b=0;b<a.length;++b)a[b]=arguments[b];return this._renderer.triangle(a),this},b.exports=d},{"./canvas":40,"./constants":41,"./core":42,"./error_helpers":45}],39:[function(a,b,c){"use strict";var d=a("./core"),e=a("./constants");d.prototype.ellipseMode=function(a){return a!==e.CORNER&&a!==e.CORNERS&&a!==e.RADIUS&&a!==e.CENTER||(this._renderer._ellipseMode=a),this},d.prototype.noSmooth=function(){return this._renderer.noSmooth(),this},d.prototype.rectMode=function(a){return a!==e.CORNER&&a!==e.CORNERS&&a!==e.RADIUS&&a!==e.CENTER||(this._renderer._rectMode=a),this},d.prototype.smooth=function(){return this._renderer.smooth(),this},d.prototype.strokeCap=function(a){return a!==e.ROUND&&a!==e.SQUARE&&a!==e.PROJECT||this._renderer.strokeCap(a),this},d.prototype.strokeJoin=function(a){return a!==e.ROUND&&a!==e.BEVEL&&a!==e.MITER||this._renderer.strokeJoin(a),this},d.prototype.strokeWeight=function(a){return this._renderer.strokeWeight(a),this},b.exports=d},{"./constants":41,"./core":42}],40:[function(a,b,c){var d=a("./constants");b.exports={modeAdjust:function(a,b,c,e,f){return f===d.CORNER?{x:a,y:b,w:c,h:e}:f===d.CORNERS?{x:a,y:b,w:c-a,h:e-b}:f===d.RADIUS?{x:a-c,y:b-e,w:2*c,h:2*e}:f===d.CENTER?{x:a-.5*c,y:b-.5*e,w:c,h:e}:void 0},arcModeAdjust:function(a,b,c,e,f){return f===d.CORNER?{x:a+.5*c,y:b+.5*e,w:c,h:e}:f===d.CORNERS?{x:a,y:b,w:c+a,h:e+b}:f===d.RADIUS?{x:a,y:b,w:2*c,h:2*e}:f===d.CENTER?{x:a,y:b,w:c,h:e}:void 0}}},{"./constants":41}],41:[function(a,b,c){var d=Math.PI;b.exports={P2D:"p2d",WEBGL:"webgl",ARROW:"default",CROSS:"crosshair",HAND:"pointer",MOVE:"move",TEXT:"text",WAIT:"wait",HALF_PI:d/2,PI:d,QUARTER_PI:d/4,TAU:2*d,TWO_PI:2*d,DEGREES:"degrees",RADIANS:"radians",CORNER:"corner",CORNERS:"corners",RADIUS:"radius",RIGHT:"right",LEFT:"left",CENTER:"center",TOP:"top",BOTTOM:"bottom",BASELINE:"alphabetic",POINTS:0,LINES:1,LINE_STRIP:3,LINE_LOOP:2,TRIANGLES:4,TRIANGLE_FAN:6,TRIANGLE_STRIP:5,QUADS:"quads",QUAD_STRIP:"quad_strip",CLOSE:"close",OPEN:"open",CHORD:"chord",PIE:"pie",PROJECT:"square",SQUARE:"butt",ROUND:"round",BEVEL:"bevel",MITER:"miter",RGB:"rgb",HSB:"hsb",HSL:"hsl",AUTO:"auto",ALT:18,BACKSPACE:8,CONTROL:17,DELETE:46,DOWN_ARROW:40,ENTER:13,ESCAPE:27,LEFT_ARROW:37,OPTION:18,RETURN:13,RIGHT_ARROW:39,SHIFT:16,TAB:9,UP_ARROW:38,BLEND:"source-over",ADD:"lighter",DARKEST:"darken",LIGHTEST:"lighten",DIFFERENCE:"difference",EXCLUSION:"exclusion",MULTIPLY:"multiply",SCREEN:"screen",REPLACE:"copy",OVERLAY:"overlay",HARD_LIGHT:"hard-light",SOFT_LIGHT:"soft-light",DODGE:"color-dodge",BURN:"color-burn",THRESHOLD:"threshold",GRAY:"gray",OPAQUE:"opaque",INVERT:"invert",POSTERIZE:"posterize",DILATE:"dilate",ERODE:"erode",BLUR:"blur",NORMAL:"normal",ITALIC:"italic",BOLD:"bold",_DEFAULT_TEXT_FILL:"#000000",_DEFAULT_LEADMULT:1.25,_CTX_MIDDLE:"middle",LINEAR:"linear",QUADRATIC:"quadratic",BEZIER:"bezier",CURVE:"curve",_DEFAULT_STROKE:"#000000",_DEFAULT_FILL:"#FFFFFF"}},{}],42:[function(a,b,c){"use strict";a("./shim");var d=a("./constants"),e=function(a,b,c){2===arguments.length&&"boolean"==typeof b&&(c=b,b=void 0),this._setupDone=!1,this._pixelDensity=Math.ceil(window.devicePixelRatio)||1,this._userNode=b,this._curElement=null,this._elements=[],this._requestAnimId=0,this._preloadCount=0,this._isGlobal=!1,this._loop=!0,this._styles=[],this._defaultCanvasSize={width:100,height:100},this._events={mousemove:null,mousedown:null,mouseup:null,dragend:null,dragover:null,click:null,mouseover:null,mouseout:null,keydown:null,keyup:null,keypress:null,touchstart:null,touchmove:null,touchend:null,resize:null,blur:null},this._events.wheel=null,this._loadingScreenId="p5_loading",window.DeviceOrientationEvent&&(this._events.deviceorientation=null),window.DeviceMotionEvent&&!window._isNodeWebkit&&(this._events.devicemotion=null),this._start=function(){this._userNode&&"string"==typeof this._userNode&&(this._userNode=document.getElementById(this._userNode));var a=this.preload||window.preload;if(a){var b=document.getElementById(this._loadingScreenId);if(!b){b=document.createElement("div"),b.innerHTML="Loading...",b.style.position="absolute",b.id=this._loadingScreenId;(this._userNode||document.body).appendChild(b)}for(var c in this._preloadMethods){this._preloadMethods[c]=this._preloadMethods[c]||e;var d=this._preloadMethods[c];d!==e.prototype&&d!==e||(d=this._isGlobal?window:this),this._registeredPreloadMethods[c]=d[c],d[c]=this._wrapPreload(d,c)}a(),this._runIfPreloadsAreDone()}else this._setup(),this._runFrames(),this._draw()}.bind(this),this._runIfPreloadsAreDone=function(){var a=this._isGlobal?window:this;if(0===a._preloadCount){var b=document.getElementById(a._loadingScreenId);b&&b.parentNode.removeChild(b),a._setup(),a._runFrames(),a._draw()}},this._decrementPreload=function(){var a=this._isGlobal?window:this;a._setProperty("_preloadCount",a._preloadCount-1),a._runIfPreloadsAreDone()},this._wrapPreload=function(a,b){return function(){this._incrementPreload();for(var c=new Array(arguments.length),d=0;d<c.length;++d)c[d]=arguments[d];return c.push(this._decrementPreload.bind(this)),this._registeredPreloadMethods[b].apply(a,c)}.bind(this)},this._incrementPreload=function(){var a=this._isGlobal?window:this;a._setProperty("_preloadCount",a._preloadCount+1)},this._setup=function(){this.createCanvas(this._defaultCanvasSize.width,this._defaultCanvasSize.height,"p2d",!0);var a=this._isGlobal?window:this;if("function"==typeof a.preload)for(var b in this._preloadMethods)a[b]=this._preloadMethods[b][b],a[b]&&this&&(a[b]=a[b].bind(this));"function"==typeof a.setup&&a.setup();for(var c=document.getElementsByTagName("canvas"),d=0;d<c.length;d++){var e=c[d];"true"===e.dataset.hidden&&(e.style.visibility="",delete e.dataset.hidden)}this._setupDone=!0}.bind(this),this._draw=function(){var a=window.performance.now(),b=a-this._lastFrameTime,c=1e3/this._targetFrameRate;(!this._loop||b>=c-5)&&(this._setProperty("frameCount",this.frameCount+1),this.redraw(),this._updateMouseCoords(),this._frameRate=1e3/(a-this._lastFrameTime),this._lastFrameTime=a),this._loop&&(this._requestAnimId=window.requestAnimationFrame(this._draw))}.bind(this),this._runFrames=function(){this._updateInterval&&clearInterval(this._updateInterval)}.bind(this),this._setProperty=function(a,b){this[a]=b,this._isGlobal&&(window[a]=b)}.bind(this),this.remove=function(){if(this._curElement){this._loop=!1,this._requestAnimId&&window.cancelAnimationFrame(this._requestAnimId);for(var a in this._events)window.removeEventListener(a,this._events[a]);for(var b=0;b<this._elements.length;b++){var c=this._elements[b]
;c.elt.parentNode&&c.elt.parentNode.removeChild(c.elt);for(var d in c._events)c.elt.removeEventListener(d,c._events[d])}var f=this;if(this._registeredMethods.remove.forEach(function(a){void 0!==a&&a.call(f)}),this._isGlobal){for(var g in e.prototype)try{delete window[g]}catch(a){window[g]=void 0}for(var h in this)if(this.hasOwnProperty(h))try{delete window[h]}catch(a){window[h]=void 0}}}}.bind(this),this._registeredMethods.init.forEach(function(a){void 0!==a&&a.call(this)},this);var d=this._createFriendlyGlobalFunctionBinder();if(a)a(this);else{this._isGlobal=!0,e.instance=this;for(var f in e.prototype)if("function"==typeof e.prototype[f]){var g=f.substring(2);this._events.hasOwnProperty(g)||(Math.hasOwnProperty(f)&&Math[f]===e.prototype[f]?d(f,e.prototype[f]):d(f,e.prototype[f].bind(this)))}else d(f,e.prototype[f]);for(var h in this)this.hasOwnProperty(h)&&d(h,this[h])}for(var i in this._events){var j=this["_on"+i];if(j){var k=j.bind(this);window.addEventListener(i,k,{passive:!1}),this._events[i]=k}}var l=function(){this._setProperty("focused",!0)}.bind(this),m=function(){this._setProperty("focused",!1)}.bind(this);window.addEventListener("focus",l),window.addEventListener("blur",m),this.registerMethod("remove",function(){window.removeEventListener("focus",l),window.removeEventListener("blur",m)}),c?this._start():"complete"===document.readyState?this._start():window.addEventListener("load",this._start.bind(this),!1)};e.instance=null,e.disableFriendlyErrors=!1;for(var f in d)e.prototype[f]=d[f];e.prototype._preloadMethods={loadJSON:e.prototype,loadImage:e.prototype,loadStrings:e.prototype,loadXML:e.prototype,loadShape:e.prototype,loadTable:e.prototype,loadFont:e.prototype,loadModel:e.prototype},e.prototype._registeredMethods={init:[],pre:[],post:[],remove:[]},e.prototype._registeredPreloadMethods={},e.prototype.registerPreloadMethod=function(a,b){e.prototype._preloadMethods.hasOwnProperty(a)||(e.prototype._preloadMethods[a]=b)},e.prototype.registerMethod=function(a,b){e.prototype._registeredMethods.hasOwnProperty(a)||(e.prototype._registeredMethods[a]=[]),e.prototype._registeredMethods[a].push(b)},e.prototype._createFriendlyGlobalFunctionBinder=function(a){a=a||{};var b=a.globalObject||window,c=a.log||console.log.bind(console),d={print:!0};return function(a,f){if(e.disableFriendlyErrors,1)b[a]=f;else try{if(a in b&&!(a in d))throw new Error('global "'+a+'" already exists');Object.defineProperty(b,a,{configurable:!0,enumerable:!0,get:function(){return f},set:function(d){Object.defineProperty(b,a,{configurable:!0,enumerable:!0,value:d,writable:!0}),c('You just changed the value of "'+a+"\", which was a p5 function. This could cause problems later if you're not careful.")}})}catch(d){c('p5 had problems creating the global function "'+a+'", possibly because your code is already using that name as a variable. You may want to rename your variable to something else.'),b[a]=f}}},b.exports=e},{"./constants":41,"./shim":51}],43:[function(a,b,c){"use strict";var d=a("./core");a("./error_helpers");var e=20,f=20;d.prototype.bezier=function(){for(var a=new Array(arguments.length),b=0;b<a.length;++b)a[b]=arguments[b];return this._renderer._doStroke||this._renderer._doFill?(this._renderer.isP3D?(a.push(e),this._renderer.bezier(a)):this._renderer.bezier(a[0],a[1],a[2],a[3],a[4],a[5],a[6],a[7]),this):this},d.prototype.bezierDetail=function(a){return e=a,this},d.prototype.bezierPoint=function(a,b,c,d,e){var f=1-e;return Math.pow(f,3)*a+3*Math.pow(f,2)*e*b+3*f*Math.pow(e,2)*c+Math.pow(e,3)*d},d.prototype.bezierTangent=function(a,b,c,d,e){var f=1-e;return 3*d*Math.pow(e,2)-3*c*Math.pow(e,2)+6*c*f*e-6*b*f*e+3*b*Math.pow(f,2)-3*a*Math.pow(f,2)},d.prototype.curve=function(){for(var a=new Array(arguments.length),b=0;b<a.length;++b)a[b]=arguments[b];return this._renderer._doStroke?(this._renderer.isP3D?(a.push(f),this._renderer.curve(a)):this._renderer.curve(a[0],a[1],a[2],a[3],a[4],a[5],a[6],a[7]),this):this},d.prototype.curveDetail=function(a){return f=a,this},d.prototype.curveTightness=function(a){this._renderer._curveTightness=a},d.prototype.curvePoint=function(a,b,c,d,e){var f=e*e*e,g=e*e;return a*(-.5*f+g-.5*e)+b*(1.5*f-2.5*g+1)+c*(-1.5*f+2*g+.5*e)+d*(.5*f-.5*g)},d.prototype.curveTangent=function(a,b,c,d,e){var f=e*e;return a*(-3*f/2+2*e-.5)+b*(9*f/2-5*e)+c*(-9*f/2+4*e+.5)+d*(3*f/2-e)},b.exports=d},{"./core":42,"./error_helpers":45}],44:[function(a,b,c){"use strict";function d(){return window.innerWidth||document.documentElement&&document.documentElement.clientWidth||document.body&&document.body.clientWidth||0}function e(){return window.innerHeight||document.documentElement&&document.documentElement.clientHeight||document.body&&document.body.clientHeight||0}function f(a){if(!(document.fullscreenEnabled||document.webkitFullscreenEnabled||document.mozFullScreenEnabled||document.msFullscreenEnabled))throw new Error("Fullscreen not enabled in this browser.");a.requestFullscreen?a.requestFullscreen():a.mozRequestFullScreen?a.mozRequestFullScreen():a.webkitRequestFullscreen?a.webkitRequestFullscreen():a.msRequestFullscreen&&a.msRequestFullscreen()}function g(){document.exitFullscreen?document.exitFullscreen():document.mozCancelFullScreen?document.mozCancelFullScreen():document.webkitExitFullscreen?document.webkitExitFullscreen():document.msExitFullscreen&&document.msExitFullscreen()}var h=a("./core"),i=a("./constants"),j=[i.ARROW,i.CROSS,i.HAND,i.MOVE,i.TEXT,i.WAIT];h.prototype._frameRate=0,h.prototype._lastFrameTime=window.performance.now(),h.prototype._targetFrameRate=60;var k=window.print;window.console&&console.log?h.prototype.print=function(a){try{if(0===arguments.length)k();else if(arguments.length>1)console.log.apply(console,arguments);else{var b=JSON.parse(JSON.stringify(a));console.log(b)}}catch(b){console.log(a)}}:h.prototype.print=function(){},h.prototype.frameCount=0,h.prototype.focused=document.hasFocus(),h.prototype.cursor=function(a,b,c){var d="auto",e=this._curElement.elt;if(j.indexOf(a)>-1)d=a;else if("string"==typeof a){var f="";b&&c&&"number"==typeof b&&"number"==typeof c&&(f=b+" "+c),d="http://"===a.substring(0,7)||"https://"===a.substring(0,8)?"url("+a+") "+f+", auto":/\.(cur|jpg|jpeg|gif|png|CUR|JPG|JPEG|GIF|PNG)$/.test(a)?"url("+a+") "+f+", auto":a}e.style.cursor=d},h.prototype.frameRate=function(a){return"number"!=typeof a||a<=0?this._frameRate:(this._setProperty("_targetFrameRate",a),this._runFrames(),this)},h.prototype.getFrameRate=function(){return this.frameRate()},h.prototype.setFrameRate=function(a){return this.frameRate(a)},h.prototype.noCursor=function(){this._curElement.elt.style.cursor="none"},h.prototype.displayWidth=screen.width,h.prototype.displayHeight=screen.height,h.prototype.windowWidth=d(),h.prototype.windowHeight=e(),h.prototype._onresize=function(a){this._setProperty("windowWidth",d()),this._setProperty("windowHeight",e());var b,c=this._isGlobal?window:this;"function"==typeof c.windowResized&&(void 0===(b=c.windowResized(a))||b||a.preventDefault())},h.prototype.width=0,h.prototype.height=0,h.prototype.fullscreen=function(a){if(void 0===a)return document.fullscreenElement||document.webkitFullscreenElement||document.mozFullScreenElement||document.msFullscreenElement;a?f(document.documentElement):g()},h.prototype.pixelDensity=function(a){if("number"!=typeof a)return this._pixelDensity;this._pixelDensity=a,this.resizeCanvas(this.width,this.height,!0)},h.prototype.displayDensity=function(){return window.devicePixelRatio},h.prototype.getURL=function(){return location.href},h.prototype.getURLPath=function(){return location.pathname.split("/").filter(function(a){return""!==a})},h.prototype.getURLParams=function(){for(var a,b=/[?&]([^&=]+)(?:[&=])([^&=]+)/gim,c={};null!=(a=b.exec(location.search));)a.index===b.lastIndex&&b.lastIndex++,c[a[1]]=a[2];return c},b.exports=h},{"./constants":41,"./core":42}],45:[function(a,b,c){"use strict";function d(a,b,c){i&&(e(),i=!1),"undefined"===n(c)?c="#B40033":"number"===n(c)&&(c=o[c])}function e(){console.log("%c _ \n /\\| |/\\ \n \\ ` ' / \n / , . \\ \n \\/|_|\\/ \n\n%c> p5.js says: Welcome! This is your friendly debugger. To turn me off switch to using “p5.min.js”.","background-color:transparent;color:#ED225D;","background-color:#ED225D;color:white;")}function f(){var b={},c=function(a){return Object.getOwnPropertyNames(a).filter(function(a){return"_"!==a[0]&&(!(a in b)&&(b[a]=!0,!0))}).map(function(b){var c;return c="function"==typeof a[b]?"function":b===b.toUpperCase()?"constant":"variable",{name:b,type:c}})};q=[].concat(c(h.prototype),c(a("./constants"))),q.sort(function(a,b){return b.name.length-a.name.length})}function g(a,b){b||(b=console.log.bind(console)),q||f(),q.some(function(c){if(a.message&&null!==a.message.match("\\W?"+c.name+"\\W"))return b("%cDid you just try to use p5.js's "+c.name+("function"===c.type?"() ":" ")+c.type+"? If so, you may want to move it into your sketch's setup() function.\n\nFor more details, see: "+r,"color: #B40033"),!0})}for(var h=a("./core"),i=!1,j={},k=j.toString,l=["Boolean","Number","String","Function","Array","Date","RegExp","Object","Error"],m=0;m<l.length;m++)j["[object "+l[m]+"]"]=l[m].toLowerCase();var n=function(a){return null==a?a+"":"object"==typeof a||"function"==typeof a?j[k.call(a)]||"object":typeof a},o=["#2D7BB6","#EE9900","#4DB200","#C83C00"],p={0:{fileType:"image",method:"loadImage",message:" hosting the image online,"},1:{fileType:"XML file",method:"loadXML"},2:{fileType:"table file",method:"loadTable"},3:{fileType:"text file",method:"loadStrings"},4:{fileType:"font",method:"loadFont",message:" hosting the font online,"}};h._friendlyFileLoadError=function(a,b){var c=p[a];d("It looks like there was a problem loading your "+c.fileType+". Try checking if the file path%c ["+b+"] %cis correct,"+(c.message||"")+" or running a local server.",c.method,3)};var q=null,r="https://github.com/processing/p5.js/wiki/Frequently-Asked-Questions#why-cant-i-assign-variables-using-p5-functions-and-variables-before-setup";h.prototype._helpForMisusedAtTopLevelCode=g,"complete"!==document.readyState&&(window.addEventListener("error",g,!1),window.addEventListener("load",function(){window.removeEventListener("error",g,!1)})),b.exports=h},{"./constants":41,"./core":42}],46:[function(a,b,c){function d(a,b,c){var d=b.bind(c);c.elt.addEventListener(a,d,!1),c._events[a]=d}var e=a("./core");e.Element=function(a,b){this.elt=a,this._pInst=b,this._events={},this.width=this.elt.offsetWidth,this.height=this.elt.offsetHeight},e.Element.prototype.parent=function(a){return 0===arguments.length?this.elt.parentNode:("string"==typeof a?("#"===a[0]&&(a=a.substring(1)),a=document.getElementById(a)):a instanceof e.Element&&(a=a.elt),a.appendChild(this.elt),this)},e.Element.prototype.id=function(a){return 0===arguments.length?this.elt.id:(this.elt.id=a,this.width=this.elt.offsetWidth,this.height=this.elt.offsetHeight,this)},e.Element.prototype.class=function(a){return 0===arguments.length?this.elt.className:(this.elt.className=a,this)},e.Element.prototype.mousePressed=function(a){return d("mousedown",a,this),window.PointerEvent||d("touchstart",a,this),this},e.Element.prototype.mouseWheel=function(a){return d("wheel",a,this),this},e.Element.prototype.mouseReleased=function(a){return d("mouseup",a,this),window.PointerEvent||d("touchend",a,this),this},e.Element.prototype.mouseClicked=function(a){return d("click",a,this),this},e.Element.prototype.mouseMoved=function(a){return d("mousemove",a,this),window.PointerEvent||d("touchmove",a,this),this},e.Element.prototype.mouseOver=function(a){return d("mouseover",a,this),this},e.Element.prototype.changed=function(a){return d("change",a,this),this},e.Element.prototype.input=function(a){return d("input",a,this),this},e.Element.prototype.mouseOut=function(a){return d("mouseout",a,this),this},e.Element.prototype.touchStarted=function(a){return d("touchstart",a,this),window.PointerEvent||d("mousedown",a,this),this},e.Element.prototype.touchMoved=function(a){return d("touchmove",a,this),window.PointerEvent||d("mousemove",a,this),this},e.Element.prototype.touchEnded=function(a){return d("touchend",a,this),window.PointerEvent||d("mouseup",a,this),this},e.Element.prototype.dragOver=function(a){return d("dragover",a,this),this},e.Element.prototype.dragLeave=function(a){return d("dragleave",a,this),this},e.Element.prototype.drop=function(a,b){function c(b){var c=new e.File(b);return function(b){c.data=b.target.result,a(c)}}return window.File&&window.FileReader&&window.FileList&&window.Blob?(d("dragover",function(a){a.stopPropagation(),a.preventDefault()},this),d("dragleave",function(a){a.stopPropagation(),a.preventDefault()},this),arguments.length>1&&d("drop",b,this),d("drop",function(a){a.stopPropagation(),a.preventDefault();for(var b=a.dataTransfer.files,d=0;d<b.length;d++){var e=b[d],f=new FileReader;f.onload=c(e),e.type.indexOf("text")>-1?f.readAsText(e):f.readAsDataURL(e)}},this)):console.log("The File APIs are not fully supported in this browser."),this},e.Element.prototype._setProperty=function(a,b){this[a]=b},b.exports=e.Element},{"./core":42}],47:[function(a,b,c){var d=a("./core"),e=a("./constants");d.Graphics=function(a,b,c,f){var g=c||e.P2D,h=document.createElement("canvas");(this._userNode||document.body).appendChild(h),d.Element.call(this,h,f,!1),this._styles=[],this.width=a,this.height=b,this._pixelDensity=f._pixelDensity,g===e.WEBGL?this._renderer=new d.RendererGL(h,this,!1):this._renderer=new d.Renderer2D(h,this,!1),this._renderer.resize(a,b),this._renderer._applyDefaults(),f._elements.push(this);for(var i in d.prototype)this[i]||("function"==typeof d.prototype[i]?this[i]=d.prototype[i].bind(this):this[i]=d.prototype[i]);return this},d.Graphics.prototype=Object.create(d.Element.prototype),d.Graphics.prototype.remove=function(){this.elt.parentNode&&this.elt.parentNode.removeChild(this.elt);for(var a in this._events)this.elt.removeEventListener(a,this._events[a])},b.exports=d.Graphics},{"./constants":41,"./core":42}],48:[function(a,b,c){function d(a){var b=0,c=0;if(a.offsetParent)do{b+=a.offsetLeft,c+=a.offsetTop}while(a=a.offsetParent);else b+=a.offsetLeft,c+=a.offsetTop;return[b,c]}var e=a("./core"),f=a("../core/constants");e.Renderer=function(a,b,c){e.Element.call(this,a,b),this.canvas=a,this._pInst=b,c?(this._isMainCanvas=!0,this._pInst._setProperty("_curElement",this),this._pInst._setProperty("canvas",this.canvas),this._pInst._setProperty("width",this.width),this._pInst._setProperty("height",this.height)):(this.canvas.style.display="none",this._styles=[]),this._textSize=12,this._textLeading=15,this._textFont="sans-serif",this._textStyle=f.NORMAL,this._textAscent=null,this._textDescent=null,this._rectMode=f.CORNER,this._ellipseMode=f.CENTER,this._curveTightness=0,this._imageMode=f.CORNER,this._tint=null,this._doStroke=!0,this._doFill=!0,this._strokeSet=!1,this._fillSet=!1,this._colorMode=f.RGB,this._colorMaxes={rgb:[255,255,255,255],hsb:[360,100,100,1],hsl:[360,100,100,1]}},e.Renderer.prototype=Object.create(e.Element.prototype),e.Renderer.prototype.resize=function(a,b){this.width=a,this.height=b,this.elt.width=a*this._pInst._pixelDensity,this.elt.height=b*this._pInst._pixelDensity,this.elt.style.width=a+"px",this.elt.style.height=b+"px",this._isMainCanvas&&(this._pInst._setProperty("width",this.width),this._pInst._setProperty("height",this.height))},e.Renderer.prototype.textLeading=function(a){return arguments.length&&arguments[0]?(this._setProperty("_textLeading",a),this):this._textLeading},e.Renderer.prototype.textSize=function(a){return arguments.length&&arguments[0]?(this._setProperty("_textSize",a),this._setProperty("_textLeading",a*f._DEFAULT_LEADMULT),this._applyTextProperties()):this._textSize},e.Renderer.prototype.textStyle=function(a){return arguments.length&&arguments[0]?(a!==f.NORMAL&&a!==f.ITALIC&&a!==f.BOLD||this._setProperty("_textStyle",a),this._applyTextProperties()):this._textStyle},e.Renderer.prototype.textAscent=function(){return null===this._textAscent&&this._updateTextMetrics(),this._textAscent},e.Renderer.prototype.textDescent=function(){return null===this._textDescent&&this._updateTextMetrics(),this._textDescent},e.Renderer.prototype._applyDefaults=function(){return this},e.Renderer.prototype._isOpenType=function(a){return"object"==typeof(a=a||this._textFont)&&a.font&&a.font.supported},e.Renderer.prototype._updateTextMetrics=function(){if(this._isOpenType())return this._setProperty("_textAscent",this._textFont._textAscent()),this._setProperty("_textDescent",this._textFont._textDescent()),this;var a=document.createElement("span");a.style.fontFamily=this._textFont,a.style.fontSize=this._textSize+"px",a.innerHTML="ABCjgq|";var b=document.createElement("div");b.style.display="inline-block",b.style.width="1px",b.style.height="0px";var c=document.createElement("div");c.appendChild(a),c.appendChild(b),c.style.height="0px",c.style.overflow="hidden",document.body.appendChild(c),b.style.verticalAlign="baseline";var e=d(b),f=d(a),g=e[1]-f[1];b.style.verticalAlign="bottom",e=d(b),f=d(a);var h=e[1]-f[1],i=h-g;return document.body.removeChild(c),this._setProperty("_textAscent",g),this._setProperty("_textDescent",i),this},b.exports=e.Renderer},{"../core/constants":41,"./core":42}],49:[function(a,b,c){var d=a("./core"),e=a("./canvas"),f=a("./constants"),g=a("../image/filters");a("./p5.Renderer");var h="rgba(0,0,0,0)";d.Renderer2D=function(a,b,c){return d.Renderer.call(this,a,b,c),this.drawingContext=this.canvas.getContext("2d"),this._pInst._setProperty("drawingContext",this.drawingContext),this},d.Renderer2D.prototype=Object.create(d.Renderer.prototype),d.Renderer2D.prototype._applyDefaults=function(){this.drawingContext.fillStyle=f._DEFAULT_FILL,this.drawingContext.strokeStyle=f._DEFAULT_STROKE,this.drawingContext.lineCap=f.ROUND,this.drawingContext.font="normal 12px sans-serif"},d.Renderer2D.prototype.resize=function(a,b){d.Renderer.prototype.resize.call(this,a,b),this.drawingContext.scale(this._pInst._pixelDensity,this._pInst._pixelDensity)},d.Renderer2D.prototype.background=function(){if(this.drawingContext.save(),this.drawingContext.setTransform(1,0,0,1,0,0),this.drawingContext.scale(this._pInst._pixelDensity,this._pInst._pixelDensity),arguments[0]instanceof d.Image)this._pInst.image(arguments[0],0,0,this.width,this.height);else{var a=this.drawingContext.fillStyle,b=this._pInst.color.apply(this,arguments),c=b.toString();this.drawingContext.fillStyle=c,this.drawingContext.fillRect(0,0,this.width,this.height),this.drawingContext.fillStyle=a}this.drawingContext.restore()},d.Renderer2D.prototype.clear=function(){this.drawingContext.clearRect(0,0,this.width,this.height)},d.Renderer2D.prototype.fill=function(){var a=this.drawingContext,b=this._pInst.color.apply(this,arguments);a.fillStyle=b.toString()},d.Renderer2D.prototype.stroke=function(){var a=this.drawingContext,b=this._pInst.color.apply(this,arguments);a.strokeStyle=b.toString()},d.Renderer2D.prototype.image=function(a,b,c,e,f,g,h,i,j){var k;try{this._tint&&(d.MediaElement&&a instanceof d.MediaElement&&a.loadPixels(),a.canvas&&(k=this._getTintedImageCanvas(a))),k||(k=a.canvas||a.elt),this.drawingContext.drawImage(k,b,c,e,f,g,h,i,j)}catch(a){if("NS_ERROR_NOT_AVAILABLE"!==a.name)throw a}},d.Renderer2D.prototype._getTintedImageCanvas=function(a){if(!a.canvas)return a;var b=g._toPixels(a.canvas),c=document.createElement("canvas");c.width=a.canvas.width,c.height=a.canvas.height;for(var d=c.getContext("2d"),e=d.createImageData(a.canvas.width,a.canvas.height),f=e.data,h=0;h<b.length;h+=4){var i=b[h],j=b[h+1],k=b[h+2],l=b[h+3];f[h]=i*this._tint[0]/255,f[h+1]=j*this._tint[1]/255,f[h+2]=k*this._tint[2]/255,f[h+3]=l*this._tint[3]/255}return d.putImageData(e,0,0),c},d.Renderer2D.prototype.blendMode=function(a){this.drawingContext.globalCompositeOperation=a},d.Renderer2D.prototype.blend=function(){var a=this.drawingContext.globalCompositeOperation,b=arguments[arguments.length-1],c=Array.prototype.slice.call(arguments,0,arguments.length-1);this.drawingContext.globalCompositeOperation=b,this._pInst?this._pInst.copy.apply(this._pInst,c):this.copy.apply(this,c),this.drawingContext.globalCompositeOperation=a},d.Renderer2D.prototype.copy=function(){var a,b,c,e,f,g,h,i,j;if(9===arguments.length)a=arguments[0],b=arguments[1],c=arguments[2],e=arguments[3],f=arguments[4],g=arguments[5],h=arguments[6],i=arguments[7],j=arguments[8];else{if(8!==arguments.length)throw new Error("Signature not supported");a=this._pInst,b=arguments[0],c=arguments[1],e=arguments[2],f=arguments[3],g=arguments[4],h=arguments[5],i=arguments[6],j=arguments[7]}d.Renderer2D._copyHelper(a,b,c,e,f,g,h,i,j)},d.Renderer2D._copyHelper=function(a,b,c,d,e,f,g,h,i){a.loadPixels();var j=a.canvas.width/a.width;this.drawingContext.drawImage(a.canvas,j*b,j*c,j*d,j*e,f,g,h,i)},d.Renderer2D.prototype.get=function(a,b,c,e){if(void 0===a&&void 0===b&&void 0===c&&void 0===e?(a=0,b=0,c=this.width,e=this.height):void 0===c&&void 0===e&&(c=1,e=1),a+c<0||b+e<0||a>this.width||b>this.height)return[0,0,0,255];var f=this._pInst||this;f.loadPixels();var g=f._pixelDensity;a=Math.floor(a),b=Math.floor(b),c=Math.floor(c),e=Math.floor(e);var h=a*g,i=b*g;if(1===c&&1===e){var j=this.drawingContext.getImageData(h,i,1,1).data;return[j[0],j[1],j[2],j[3]]}var k=Math.min(c,f.width),l=Math.min(e,f.height),m=k*g,n=l*g,o=new d.Image(k,l);return o.canvas.getContext("2d").drawImage(this.canvas,h,i,m,n,0,0,k,l),o},d.Renderer2D.prototype.loadPixels=function(){var a=this._pixelDensity||this._pInst._pixelDensity,b=this.width*a,c=this.height*a,d=this.drawingContext.getImageData(0,0,b,c);this._pInst?(this._pInst._setProperty("imageData",d),this._pInst._setProperty("pixels",d.data)):(this._setProperty("imageData",d),this._setProperty("pixels",d.data))},d.Renderer2D.prototype.set=function(a,b,c){if(a=Math.floor(a),b=Math.floor(b),c instanceof d.Image)this.drawingContext.save(),this.drawingContext.setTransform(1,0,0,1,0,0),this.drawingContext.scale(this._pInst._pixelDensity,this._pInst._pixelDensity),this.drawingContext.drawImage(c.canvas,a,b),this.loadPixels.call(this._pInst),this.drawingContext.restore();else{var e=this._pInst||this,f=0,g=0,h=0,i=0,j=4*(b*e._pixelDensity*(this.width*e._pixelDensity)+a*e._pixelDensity);if(e.imageData||e.loadPixels.call(e),"number"==typeof c)j<e.pixels.length&&(f=c,g=c,h=c,i=255);else if(c instanceof Array){if(c.length<4)throw new Error("pixel array must be of the form [R, G, B, A]");j<e.pixels.length&&(f=c[0],g=c[1],h=c[2],i=c[3])}else c instanceof d.Color&&j<e.pixels.length&&(f=c.levels[0],g=c.levels[1],h=c.levels[2],i=c.levels[3]);for(var k=0;k<e._pixelDensity;k++)for(var l=0;l<e._pixelDensity;l++)j=4*((b*e._pixelDensity+l)*this.width*e._pixelDensity+(a*e._pixelDensity+k)),e.pixels[j]=f,e.pixels[j+1]=g,e.pixels[j+2]=h,e.pixels[j+3]=i}},d.Renderer2D.prototype.updatePixels=function(a,b,c,d){var e=this._pixelDensity||this._pInst._pixelDensity;void 0===a&&void 0===b&&void 0===c&&void 0===d&&(a=0,b=0,c=this.width,d=this.height),c*=e,d*=e,this._pInst?this.drawingContext.putImageData(this._pInst.imageData,a,b,0,0,c,d):this.drawingContext.putImageData(this.imageData,a,b,0,0,c,d)},d.Renderer2D.prototype._acuteArcToBezier=function(a,b){var c=b/2,d=Math.cos(c),e=Math.sin(c),f=1/Math.tan(c),g=a+c,h=Math.cos(g),i=Math.sin(g),j=(4-d)/3,k=e+(d-j)*f;return{ax:Math.cos(a),ay:Math.sin(a),bx:j*h+k*i,by:j*i-k*h,cx:j*h-k*i,cy:j*i+k*h,dx:Math.cos(a+b),dy:Math.sin(a+b)}},d.Renderer2D.prototype.arc=function(a,b,c,d,g,h,i){for(var j=this.drawingContext,k=e.arcModeAdjust(a,b,c,d,this._ellipseMode),l=k.w/2,m=k.h/2,n=1e-5,o=0,p=[];h-g>n;)o=Math.min(h-g,f.HALF_PI),p.push(this._acuteArcToBezier(g,o)),g+=o;return this._doFill&&(j.beginPath(),p.forEach(function(a,b){0===b&&j.moveTo(k.x+a.ax*l,k.y+a.ay*m),j.bezierCurveTo(k.x+a.bx*l,k.y+a.by*m,k.x+a.cx*l,k.y+a.cy*m,k.x+a.dx*l,k.y+a.dy*m)}),i!==f.PIE&&null!=i||j.lineTo(k.x,k.y),j.closePath(),j.fill()),this._doStroke&&(j.beginPath(),p.forEach(function(a,b){0===b&&j.moveTo(k.x+a.ax*l,k.y+a.ay*m),j.bezierCurveTo(k.x+a.bx*l,k.y+a.by*m,k.x+a.cx*l,k.y+a.cy*m,k.x+a.dx*l,k.y+a.dy*m)}),i===f.PIE?(j.lineTo(k.x,k.y),j.closePath()):i===f.CHORD&&j.closePath(),j.stroke()),this},d.Renderer2D.prototype.ellipse=function(a){var b=this.drawingContext,c=this._doFill,d=this._doStroke,e=a[0],f=a[1],g=a[2],i=a[3];if(c&&!d){if(b.fillStyle===h)return this}else if(!c&&d&&b.strokeStyle===h)return this;var j=.5522847498,k=g/2*j,l=i/2*j,m=e+g,n=f+i,o=e+g/2,p=f+i/2;b.beginPath(),b.moveTo(e,p),b.bezierCurveTo(e,p-l,o-k,f,o,f),b.bezierCurveTo(o+k,f,m,p-l,m,p),b.bezierCurveTo(m,p+l,o+k,n,o,n),b.bezierCurveTo(o-k,n,e,p+l,e,p),b.closePath(),c&&b.fill(),d&&b.stroke()},d.Renderer2D.prototype.line=function(a,b,c,d){var e=this.drawingContext;return this._doStroke?e.strokeStyle===h?this:(e.lineWidth%2==1&&e.translate(.5,.5),e.beginPath(),e.moveTo(a,b),e.lineTo(c,d),e.stroke(),e.lineWidth%2==1&&e.translate(-.5,-.5),this):this},d.Renderer2D.prototype.point=function(a,b){var c=this.drawingContext,d=c.strokeStyle,e=c.fillStyle;return this._doStroke?c.strokeStyle===h?this:(a=Math.round(a),b=Math.round(b),c.fillStyle=d,c.lineWidth>1?(c.beginPath(),c.arc(a,b,c.lineWidth/2,0,f.TWO_PI,!1),c.fill()):c.fillRect(a,b,1,1),void(c.fillStyle=e)):this},d.Renderer2D.prototype.quad=function(a,b,c,d,e,f,g,i){var j=this.drawingContext,k=this._doFill,l=this._doStroke;if(k&&!l){if(j.fillStyle===h)return this}else if(!k&&l&&j.strokeStyle===h)return this;return j.beginPath(),j.moveTo(a,b),j.lineTo(c,d),j.lineTo(e,f),j.lineTo(g,i),j.closePath(),k&&j.fill(),l&&j.stroke(),this},d.Renderer2D.prototype.rect=function(a){var b=a[0],c=a[1],d=a[2],e=a[3],f=a[4],g=a[5],i=a[6],j=a[7],k=this.drawingContext,l=this._doFill,m=this._doStroke;if(l&&!m){if(k.fillStyle===h)return this}else if(!l&&m&&k.strokeStyle===h)return this;if(this._doStroke&&k.lineWidth%2==1&&k.translate(.5,.5),k.beginPath(),void 0===f)k.rect(b,c,d,e);else{void 0===g&&(g=f),void 0===i&&(i=g),void 0===j&&(j=i);var n=d/2,o=e/2;d<2*f&&(f=n),e<2*f&&(f=o),d<2*g&&(g=n),e<2*g&&(g=o),d<2*i&&(i=n),e<2*i&&(i=o),d<2*j&&(j=n),e<2*j&&(j=o),k.beginPath(),k.moveTo(b+f,c),k.arcTo(b+d,c,b+d,c+e,g),k.arcTo(b+d,c+e,b,c+e,i),k.arcTo(b,c+e,b,c,j),k.arcTo(b,c,b+d,c,f),k.closePath()}return this._doFill&&k.fill(),this._doStroke&&k.stroke(),this._doStroke&&k.lineWidth%2==1&&k.translate(-.5,-.5),this},d.Renderer2D.prototype.triangle=function(a){var b=this.drawingContext,c=this._doFill,d=this._doStroke,e=a[0],f=a[1],g=a[2],i=a[3],j=a[4],k=a[5];if(c&&!d){if(b.fillStyle===h)return this}else if(!c&&d&&b.strokeStyle===h)return this;b.beginPath(),b.moveTo(e,f),b.lineTo(g,i),b.lineTo(j,k),b.closePath(),c&&b.fill(),d&&b.stroke()},d.Renderer2D.prototype.endShape=function(a,b,c,d,e,g,h){if(0===b.length)return this;if(!this._doStroke&&!this._doFill)return this;var i,j=a===f.CLOSE;j&&!g&&b.push(b[0]);var k,l,m=b.length;if(!c||h!==f.POLYGON&&null!==h)if(!d||h!==f.POLYGON&&null!==h)if(!e||h!==f.POLYGON&&null!==h)if(h===f.POINTS)for(k=0;k<m;k++)i=b[k],this._doStroke&&this._pInst.stroke(i[6]),this._pInst.point(i[0],i[1]);else if(h===f.LINES)for(k=0;k+1<m;k+=2)i=b[k],this._doStroke&&this._pInst.stroke(b[k+1][6]),this._pInst.line(i[0],i[1],b[k+1][0],b[k+1][1]);else if(h===f.TRIANGLES)for(k=0;k+2<m;k+=3)i=b[k],this.drawingContext.beginPath(),this.drawingContext.moveTo(i[0],i[1]),this.drawingContext.lineTo(b[k+1][0],b[k+1][1]),this.drawingContext.lineTo(b[k+2][0],b[k+2][1]),this.drawingContext.lineTo(i[0],i[1]),this._doFill&&(this._pInst.fill(b[k+2][5]),this.drawingContext.fill()),this._doStroke&&(this._pInst.stroke(b[k+2][6]),this.drawingContext.stroke()),this.drawingContext.closePath();else if(h===f.TRIANGLE_STRIP)for(k=0;k+1<m;k++)i=b[k],this.drawingContext.beginPath(),this.drawingContext.moveTo(b[k+1][0],b[k+1][1]),this.drawingContext.lineTo(i[0],i[1]),this._doStroke&&this._pInst.stroke(b[k+1][6]),this._doFill&&this._pInst.fill(b[k+1][5]),k+2<m&&(this.drawingContext.lineTo(b[k+2][0],b[k+2][1]),this._doStroke&&this._pInst.stroke(b[k+2][6]),this._doFill&&this._pInst.fill(b[k+2][5])),this._doFillStrokeClose();else if(h===f.TRIANGLE_FAN){if(m>2)for(this.drawingContext.beginPath(),this.drawingContext.moveTo(b[0][0],b[0][1]),this.drawingContext.lineTo(b[1][0],b[1][1]),this.drawingContext.lineTo(b[2][0],b[2][1]),this._doFill&&this._pInst.fill(b[2][5]),this._doStroke&&this._pInst.stroke(b[2][6]),this._doFillStrokeClose(),k=3;k<m;k++)i=b[k],this.drawingContext.beginPath(),this.drawingContext.moveTo(b[0][0],b[0][1]),this.drawingContext.lineTo(b[k-1][0],b[k-1][1]),this.drawingContext.lineTo(i[0],i[1]),this._doFill&&this._pInst.fill(i[5]),this._doStroke&&this._pInst.stroke(i[6]),this._doFillStrokeClose()}else if(h===f.QUADS)for(k=0;k+3<m;k+=4){for(i=b[k],this.drawingContext.beginPath(),this.drawingContext.moveTo(i[0],i[1]),l=1;l<4;l++)this.drawingContext.lineTo(b[k+l][0],b[k+l][1]);this.drawingContext.lineTo(i[0],i[1]),this._doFill&&this._pInst.fill(b[k+3][5]),this._doStroke&&this._pInst.stroke(b[k+3][6]),this._doFillStrokeClose()}else if(h===f.QUAD_STRIP){if(m>3)for(k=0;k+1<m;k+=2)i=b[k],this.drawingContext.beginPath(),k+3<m?(this.drawingContext.moveTo(b[k+2][0],b[k+2][1]),this.drawingContext.lineTo(i[0],i[1]),this.drawingContext.lineTo(b[k+1][0],b[k+1][1]),this.drawingContext.lineTo(b[k+3][0],b[k+3][1]),this._doFill&&this._pInst.fill(b[k+3][5]),this._doStroke&&this._pInst.stroke(b[k+3][6])):(this.drawingContext.moveTo(i[0],i[1]),this.drawingContext.lineTo(b[k+1][0],b[k+1][1])),this._doFillStrokeClose()}else{for(this.drawingContext.beginPath(),this.drawingContext.moveTo(b[0][0],b[0][1]),k=1;k<m;k++)i=b[k],i.isVert&&(i.moveTo?this.drawingContext.moveTo(i[0],i[1]):this.drawingContext.lineTo(i[0],i[1]));this._doFillStrokeClose()}else{for(this.drawingContext.beginPath(),k=0;k<m;k++)b[k].isVert?b[k].moveTo?this.drawingContext.moveTo([0],b[k][1]):this.drawingContext.lineTo(b[k][0],b[k][1]):this.drawingContext.quadraticCurveTo(b[k][0],b[k][1],b[k][2],b[k][3]);this._doFillStrokeClose()}else{for(this.drawingContext.beginPath(),k=0;k<m;k++)b[k].isVert?b[k].moveTo?this.drawingContext.moveTo(b[k][0],b[k][1]):this.drawingContext.lineTo(b[k][0],b[k][1]):this.drawingContext.bezierCurveTo(b[k][0],b[k][1],b[k][2],b[k][3],b[k][4],b[k][5]);this._doFillStrokeClose()}else if(m>3){var n=[],o=1-this._curveTightness;for(this.drawingContext.beginPath(),this.drawingContext.moveTo(b[1][0],b[1][1]),k=1;k+2<m;k++)i=b[k],n[0]=[i[0],i[1]],n[1]=[i[0]+(o*b[k+1][0]-o*b[k-1][0])/6,i[1]+(o*b[k+1][1]-o*b[k-1][1])/6],n[2]=[b[k+1][0]+(o*b[k][0]-o*b[k+2][0])/6,b[k+1][1]+(o*b[k][1]-o*b[k+2][1])/6],n[3]=[b[k+1][0],b[k+1][1]],this.drawingContext.bezierCurveTo(n[1][0],n[1][1],n[2][0],n[2][1],n[3][0],n[3][1]);j&&this.drawingContext.lineTo(b[k+1][0],b[k+1][1]),this._doFillStrokeClose()}return c=!1,d=!1,e=!1,g=!1,j&&b.pop(),this},d.Renderer2D.prototype.noSmooth=function(){return"imageSmoothingEnabled"in this.drawingContext?this.drawingContext.imageSmoothingEnabled=!1:"mozImageSmoothingEnabled"in this.drawingContext?this.drawingContext.mozImageSmoothingEnabled=!1:"webkitImageSmoothingEnabled"in this.drawingContext?this.drawingContext.webkitImageSmoothingEnabled=!1:"msImageSmoothingEnabled"in this.drawingContext&&(this.drawingContext.msImageSmoothingEnabled=!1),this},d.Renderer2D.prototype.smooth=function(){return"imageSmoothingEnabled"in this.drawingContext?this.drawingContext.imageSmoothingEnabled=!0:"mozImageSmoothingEnabled"in this.drawingContext?this.drawingContext.mozImageSmoothingEnabled=!0:"webkitImageSmoothingEnabled"in this.drawingContext?this.drawingContext.webkitImageSmoothingEnabled=!0:"msImageSmoothingEnabled"in this.drawingContext&&(this.drawingContext.msImageSmoothingEnabled=!0),this},d.Renderer2D.prototype.strokeCap=function(a){return a!==f.ROUND&&a!==f.SQUARE&&a!==f.PROJECT||(this.drawingContext.lineCap=a),this},d.Renderer2D.prototype.strokeJoin=function(a){return a!==f.ROUND&&a!==f.BEVEL&&a!==f.MITER||(this.drawingContext.lineJoin=a),this},d.Renderer2D.prototype.strokeWeight=function(a){
return this.drawingContext.lineWidth=void 0===a||0===a?1e-4:a,this},d.Renderer2D.prototype._getFill=function(){return this.drawingContext.fillStyle},d.Renderer2D.prototype._getStroke=function(){return this.drawingContext.strokeStyle},d.Renderer2D.prototype.bezier=function(a,b,c,d,e,f,g,h){return this._pInst.beginShape(),this._pInst.vertex(a,b),this._pInst.bezierVertex(c,d,e,f,g,h),this._pInst.endShape(),this},d.Renderer2D.prototype.curve=function(a,b,c,d,e,f,g,h){return this._pInst.beginShape(),this._pInst.curveVertex(a,b),this._pInst.curveVertex(c,d),this._pInst.curveVertex(e,f),this._pInst.curveVertex(g,h),this._pInst.endShape(),this},d.Renderer2D.prototype._doFillStrokeClose=function(){this._doFill&&this.drawingContext.fill(),this._doStroke&&this.drawingContext.stroke(),this.drawingContext.closePath()},d.Renderer2D.prototype.applyMatrix=function(a,b,c,d,e,f){this.drawingContext.transform(a,b,c,d,e,f)},d.Renderer2D.prototype.resetMatrix=function(){return this.drawingContext.setTransform(1,0,0,1,0,0),this.drawingContext.scale(this._pInst._pixelDensity,this._pInst._pixelDensity),this},d.Renderer2D.prototype.rotate=function(a){this.drawingContext.rotate(a)},d.Renderer2D.prototype.scale=function(a,b){return this.drawingContext.scale(a,b),this},d.Renderer2D.prototype.shearX=function(a){return this._pInst._angleMode===f.DEGREES&&(a=this._pInst.degrees(a)),this.drawingContext.transform(1,0,this._pInst.tan(a),1,0,0),this},d.Renderer2D.prototype.shearY=function(a){return this._pInst._angleMode===f.DEGREES&&(a=this._pInst.degrees(a)),this.drawingContext.transform(1,this._pInst.tan(a),0,1,0,0),this},d.Renderer2D.prototype.translate=function(a,b){return this.drawingContext.translate(a,b),this},d.Renderer2D.prototype.text=function(a,b,c,d,e){var g,h,i,j,k,l,m,n,o,p,q=this._pInst,r=Number.MAX_VALUE;if(this._doFill||this._doStroke){if("string"!=typeof a&&(a=a.toString()),a=a.replace(/(\t)/g," "),g=a.split("\n"),void 0!==d){for(o=0,i=0;i<g.length;i++)for(k="",n=g[i].split(" "),h=0;h<n.length;h++)l=k+n[h]+" ",m=this.textWidth(l),m>d?(k=n[h]+" ",o+=q.textLeading()):k=l;switch(this._rectMode===f.CENTER&&(b-=d/2,c-=e/2),this.drawingContext.textAlign){case f.CENTER:b+=d/2;break;case f.RIGHT:b+=d}if(void 0!==e){switch(this.drawingContext.textBaseline){case f.BOTTOM:c+=e-o;break;case f._CTX_MIDDLE:c+=(e-o)/2;break;case f.BASELINE:p=!0,this.drawingContext.textBaseline=f.TOP}r=c+e-q.textAscent()}for(i=0;i<g.length;i++){for(k="",n=g[i].split(" "),h=0;h<n.length;h++)l=k+n[h]+" ",m=this.textWidth(l),m>d&&k.length>0?(this._renderText(q,k,b,c,r),k=n[h]+" ",c+=q.textLeading()):k=l;this._renderText(q,k,b,c,r),c+=q.textLeading()}}else{var s=0,t=q.textAlign().vertical;for(t===f.CENTER?s=(g.length-1)*q.textLeading()/2:t===f.BOTTOM&&(s=(g.length-1)*q.textLeading()),j=0;j<g.length;j++)this._renderText(q,g[j],b,c-s,r),c+=q.textLeading()}return p&&(this.drawingContext.textBaseline=f.BASELINE),q}},d.Renderer2D.prototype._renderText=function(a,b,c,d,e){if(!(d>=e))return a.push(),this._isOpenType()?this._textFont._renderPath(b,c,d,{renderer:this}):(this._doStroke&&this._strokeSet&&this.drawingContext.strokeText(b,c,d),this._doFill&&(this.drawingContext.fillStyle=this._fillSet?this.drawingContext.fillStyle:f._DEFAULT_TEXT_FILL,this.drawingContext.fillText(b,c,d))),a.pop(),a},d.Renderer2D.prototype.textWidth=function(a){return this._isOpenType()?this._textFont._textWidth(a,this._textSize):this.drawingContext.measureText(a).width},d.Renderer2D.prototype.textAlign=function(a,b){if(arguments.length)return a!==f.LEFT&&a!==f.RIGHT&&a!==f.CENTER||(this.drawingContext.textAlign=a),b!==f.TOP&&b!==f.BOTTOM&&b!==f.CENTER&&b!==f.BASELINE||(b===f.CENTER?this.drawingContext.textBaseline=f._CTX_MIDDLE:this.drawingContext.textBaseline=b),this._pInst;var c=this.drawingContext.textBaseline;return c===f._CTX_MIDDLE&&(c=f.CENTER),{horizontal:this.drawingContext.textAlign,vertical:c}},d.Renderer2D.prototype._applyTextProperties=function(){var a,b=this._pInst;return this._setProperty("_textAscent",null),this._setProperty("_textDescent",null),a=this._textFont,this._isOpenType()&&(a=this._textFont.font.familyName,this._setProperty("_textStyle",this._textFont.font.styleName)),this.drawingContext.font=this._textStyle+" "+this._textSize+"px "+a,b},d.Renderer2D.prototype.push=function(){this.drawingContext.save()},d.Renderer2D.prototype.pop=function(){this.drawingContext.restore()},b.exports=d.Renderer2D},{"../image/filters":59,"./canvas":40,"./constants":41,"./core":42,"./p5.Renderer":48}],50:[function(a,b,c){var d=a("./core"),e=a("./constants");a("./p5.Graphics"),a("./p5.Renderer2D"),a("../webgl/p5.RendererGL");var f="defaultCanvas0";d.prototype.createCanvas=function(a,b,c){var g,h,i=c||e.P2D;if(arguments[3]&&(g="boolean"==typeof arguments[3]&&arguments[3]),i===e.WEBGL)h=document.getElementById(f),h&&h.parentNode.removeChild(h),h=document.createElement("canvas"),h.id=f;else if(g){h=document.createElement("canvas");for(var j=0;document.getElementById("defaultCanvas"+j);)j++;f="defaultCanvas"+j,h.id=f}else h=this.canvas;return this._setupDone||(h.dataset.hidden=!0,h.style.visibility="hidden"),this._userNode?this._userNode.appendChild(h):document.body.appendChild(h),i===e.WEBGL?(this._setProperty("_renderer",new d.RendererGL(h,this,!0)),this._isdefaultGraphics=!0):this._isdefaultGraphics||(this._setProperty("_renderer",new d.Renderer2D(h,this,!0)),this._isdefaultGraphics=!0),this._renderer.resize(a,b),this._renderer._applyDefaults(),g&&this._elements.push(this._renderer),this._renderer},d.prototype.resizeCanvas=function(a,b,c){if(this._renderer){var d={};for(var e in this.drawingContext){var f=this.drawingContext[e];"object"!=typeof f&&"function"!=typeof f&&(d[e]=f)}this._renderer.resize(a,b);for(var g in d)this.drawingContext[g]=d[g];c||this.redraw()}},d.prototype.noCanvas=function(){this.canvas&&this.canvas.parentNode.removeChild(this.canvas)},d.prototype.createGraphics=function(a,b,c){return new d.Graphics(a,b,c,this)},d.prototype.blendMode=function(a){if(a!==e.BLEND&&a!==e.DARKEST&&a!==e.LIGHTEST&&a!==e.DIFFERENCE&&a!==e.MULTIPLY&&a!==e.EXCLUSION&&a!==e.SCREEN&&a!==e.REPLACE&&a!==e.OVERLAY&&a!==e.HARD_LIGHT&&a!==e.SOFT_LIGHT&&a!==e.DODGE&&a!==e.BURN&&a!==e.ADD&&a!==e.NORMAL)throw new Error("Mode "+a+" not recognized.");this._renderer.blendMode(a)},b.exports=d},{"../webgl/p5.RendererGL":91,"./constants":41,"./core":42,"./p5.Graphics":47,"./p5.Renderer2D":49}],51:[function(a,b,c){window.requestAnimationFrame=function(){return window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame||function(a,b){window.setTimeout(a,1e3/60)}}(),window.performance=window.performance||{},window.performance.now=function(){var a=Date.now();return window.performance.now||window.performance.mozNow||window.performance.msNow||window.performance.oNow||window.performance.webkitNow||function(){return Date.now()-a}}(),function(){"use strict";"undefined"==typeof Uint8ClampedArray||Uint8ClampedArray.prototype.slice||Object.defineProperty(Uint8ClampedArray.prototype,"slice",{value:Array.prototype.slice,writable:!0,configurable:!0,enumerable:!1})}()},{}],52:[function(a,b,c){"use strict";var d=a("./core");d.prototype.exit=function(){throw"exit() not implemented, see remove()"},d.prototype.noLoop=function(){this._loop=!1},d.prototype.loop=function(){this._loop=!0,this._draw()},d.prototype.push=function(){this._renderer.push(),this._styles.push({_doStroke:this._renderer._doStroke,_strokeSet:this._renderer._strokeSet,_doFill:this._renderer._doFill,_fillSet:this._renderer._fillSet,_tint:this._renderer._tint,_imageMode:this._renderer._imageMode,_rectMode:this._renderer._rectMode,_ellipseMode:this._renderer._ellipseMode,_colorMode:this._renderer._colorMode,_textFont:this._renderer._textFont,_textLeading:this._renderer._textLeading,_textSize:this._renderer._textSize,_textStyle:this._renderer._textStyle})},d.prototype.pop=function(){this._renderer.pop();var a=this._styles.pop();for(var b in a)this._renderer[b]=a[b]},d.prototype.pushStyle=function(){throw new Error("pushStyle() not used, see push()")},d.prototype.popStyle=function(){throw new Error("popStyle() not used, see pop()")},d.prototype.redraw=function(){this.resetMatrix(),this._renderer.isP3D&&this._renderer._update();var a=1;if(1===arguments.length)try{parseInt(arguments[0])>1&&(a=parseInt(arguments[0]))}catch(a){}var b=this.setup||window.setup,c=this.draw||window.draw;if("function"==typeof c){void 0===b&&this.scale(this._pixelDensity,this._pixelDensity);for(var d=this,e=function(a){a.call(d)},f=0;f<a;f++)this._registeredMethods.pre.forEach(e),c(),this._registeredMethods.post.forEach(e)}},d.prototype.size=function(){var a="size() is not a valid p5 function, to set the size of the ";throw a+="drawing canvas, please use createCanvas() instead"},b.exports=d},{"./core":42}],53:[function(a,b,c){"use strict";var d=a("./core"),e=a("./constants");d.prototype.applyMatrix=function(a,b,c,d,e,f){return this._renderer.applyMatrix(a,b,c,d,e,f),this},d.prototype.popMatrix=function(){throw new Error("popMatrix() not used, see pop()")},d.prototype.printMatrix=function(){throw new Error("printMatrix() not implemented")},d.prototype.pushMatrix=function(){throw new Error("pushMatrix() not used, see push()")},d.prototype.resetMatrix=function(){return this._renderer.resetMatrix(),this},d.prototype.rotate=function(){for(var a,b=new Array(arguments.length),c=0;c<b.length;++c)b[c]=arguments[c];return this._angleMode===e.DEGREES?a=this.radians(b[0]):this._angleMode===e.RADIANS&&(a=b[0]),b.length>1?this._renderer.rotate(a,b[1]):this._renderer.rotate(a),this},d.prototype.rotateX=function(a){if(!this._renderer.isP3D)throw"not supported in p2d. Please use webgl mode";return this._renderer.rotateX(a),this},d.prototype.rotateY=function(a){if(!this._renderer.isP3D)throw"not supported in p2d. Please use webgl mode";return this._renderer.rotateY(a),this},d.prototype.rotateZ=function(a){if(!this._renderer.isP3D)throw"not supported in p2d. Please use webgl mode";return this._renderer.rotateZ(a),this},d.prototype.scale=function(){for(var a,b,c,e=new Array(arguments.length),f=0;f<e.length;f++)e[f]=arguments[f];return e[0]instanceof d.Vector?(a=e[0].x,b=e[0].y,c=e[0].z):e[0]instanceof Array?(a=e[0][0],b=e[0][1],c=e[0][2]||1):1===e.length?a=b=c=e[0]:(a=e[0],b=e[1],c=e[2]||1),this._renderer.isP3D?this._renderer.scale.call(this._renderer,a,b,c):this._renderer.scale.call(this._renderer,a,b),this},d.prototype.shearX=function(a){return this._angleMode===e.DEGREES&&(a=this.radians(a)),this._renderer.shearX(a),this},d.prototype.shearY=function(a){return this._angleMode===e.DEGREES&&(a=this.radians(a)),this._renderer.shearY(a),this},d.prototype.translate=function(a,b,c){return this._renderer.isP3D?this._renderer.translate(a,b,c):this._renderer.translate(a,b),this},b.exports=d},{"./constants":41,"./core":42}],54:[function(a,b,c){"use strict";var d=a("./core"),e=a("./constants"),f=null,g=[],h=[],i=!1,j=!1,k=!1,l=!1,m=!0;d.prototype.beginContour=function(){return h=[],l=!0,this},d.prototype.beginShape=function(a){return f=a===e.POINTS||a===e.LINES||a===e.TRIANGLES||a===e.TRIANGLE_FAN||a===e.TRIANGLE_STRIP||a===e.QUADS||a===e.QUAD_STRIP?a:null,this._renderer.isP3D?this._renderer.beginShape(a):(g=[],h=[]),this},d.prototype.bezierVertex=function(a,b,c,d,e,f){if(0===g.length)throw"vertex() must be used once before calling bezierVertex()";i=!0;for(var j=[],k=0;k<arguments.length;k++)j[k]=arguments[k];return j.isVert=!1,l?h.push(j):g.push(j),this},d.prototype.curveVertex=function(a,b){return j=!0,this.vertex(a,b),this},d.prototype.endContour=function(){var a=h[0].slice();a.isVert=h[0].isVert,a.moveTo=!1,h.push(a),m&&(g.push(g[0]),m=!1);for(var b=0;b<h.length;b++)g.push(h[b]);return this},d.prototype.endShape=function(a){if(this._renderer.isP3D)this._renderer.endShape(a,j,i,k,l,f);else{if(0===g.length)return this;if(!this._renderer._doStroke&&!this._renderer._doFill)return this;var b=a===e.CLOSE;b&&!l&&g.push(g[0]),this._renderer.endShape(a,g,j,i,k,l,f),j=!1,i=!1,k=!1,l=!1,m=!0,b&&g.pop()}return this},d.prototype.quadraticVertex=function(a,b,c,d){if(this._contourInited){var f={};return f.x=a,f.y=b,f.x3=c,f.y3=d,f.type=e.QUADRATIC,this._contourVertices.push(f),this}if(!(g.length>0))throw"vertex() must be used once before calling quadraticVertex()";k=!0;for(var i=[],j=0;j<arguments.length;j++)i[j]=arguments[j];return i.isVert=!1,l?h.push(i):g.push(i),this},d.prototype.vertex=function(a,b,c){if(this._renderer.isP3D)this._renderer.vertex(a,b,c);else{var d=[];d.isVert=!0,d[0]=a,d[1]=b,d[2]=0,d[3]=0,d[4]=0,d[5]=this._renderer._getFill(),d[6]=this._renderer._getStroke(),c&&(d.moveTo=c),l?(0===h.length&&(d.moveTo=!0),h.push(d)):g.push(d)}return this},b.exports=d},{"./constants":41,"./core":42}],55:[function(a,b,c){"use strict";var d=a("../core/core");d.prototype.deviceOrientation=void 0,d.prototype.accelerationX=0,d.prototype.accelerationY=0,d.prototype.accelerationZ=0,d.prototype.pAccelerationX=0,d.prototype.pAccelerationY=0,d.prototype.pAccelerationZ=0,d.prototype._updatePAccelerations=function(){this._setProperty("pAccelerationX",this.accelerationX),this._setProperty("pAccelerationY",this.accelerationY),this._setProperty("pAccelerationZ",this.accelerationZ)},d.prototype.rotationX=0,d.prototype.rotationY=0,d.prototype.rotationZ=0,d.prototype.pRotationX=0,d.prototype.pRotationY=0,d.prototype.pRotationZ=0;var e,f,g,h=0,i=0,j=0,k="clockwise",l="clockwise",m="clockwise";d.prototype._updatePRotations=function(){this._setProperty("pRotationX",this.rotationX),this._setProperty("pRotationY",this.rotationY),this._setProperty("pRotationZ",this.rotationZ)},d.prototype.turnAxis=void 0;var n=.5,o=30;d.prototype.setMoveThreshold=function(a){"number"==typeof a&&(n=a)},d.prototype.setShakeThreshold=function(a){"number"==typeof a&&(o=a)},d.prototype._ondeviceorientation=function(a){this._updatePRotations(),this._setProperty("rotationX",a.beta),this._setProperty("rotationY",a.gamma),this._setProperty("rotationZ",a.alpha),this._handleMotion()},d.prototype._ondevicemotion=function(a){this._updatePAccelerations(),this._setProperty("accelerationX",2*a.acceleration.x),this._setProperty("accelerationY",2*a.acceleration.y),this._setProperty("accelerationZ",2*a.acceleration.z),this._handleMotion()},d.prototype._handleMotion=function(){90===window.orientation||window.orientation===-90?this._setProperty("deviceOrientation","landscape"):0===window.orientation?this._setProperty("deviceOrientation","portrait"):void 0===window.orientation&&this._setProperty("deviceOrientation","undefined");var a=this.deviceMoved||window.deviceMoved;"function"==typeof a&&(Math.abs(this.accelerationX-this.pAccelerationX)>n||Math.abs(this.accelerationY-this.pAccelerationY)>n||Math.abs(this.accelerationZ-this.pAccelerationZ)>n)&&a();var b=this.deviceTurned||window.deviceTurned;if("function"==typeof b){var c=this.rotationX+180,d=this.pRotationX+180,p=h+180;c-d>0&&c-d<270||c-d<-270?k="clockwise":(c-d<0||c-d>270)&&(k="counter-clockwise"),k!==e&&(p=c),Math.abs(c-p)>90&&Math.abs(c-p)<270&&(p=c,this._setProperty("turnAxis","X"),b()),e=k,h=p-180;var q=this.rotationY+180,r=this.pRotationY+180,s=i+180;q-r>0&&q-r<270||q-r<-270?l="clockwise":(q-r<0||q-this.pRotationY>270)&&(l="counter-clockwise"),l!==f&&(s=q),Math.abs(q-s)>90&&Math.abs(q-s)<270&&(s=q,this._setProperty("turnAxis","Y"),b()),f=l,i=s-180,this.rotationZ-this.pRotationZ>0&&this.rotationZ-this.pRotationZ<270||this.rotationZ-this.pRotationZ<-270?m="clockwise":(this.rotationZ-this.pRotationZ<0||this.rotationZ-this.pRotationZ>270)&&(m="counter-clockwise"),m!==g&&(j=this.rotationZ),Math.abs(this.rotationZ-j)>90&&Math.abs(this.rotationZ-j)<270&&(j=this.rotationZ,this._setProperty("turnAxis","Z"),b()),g=m,this._setProperty("turnAxis",void 0)}var t=this.deviceShaken||window.deviceShaken;if("function"==typeof t){var u,v;null!==this.pAccelerationX&&(u=Math.abs(this.accelerationX-this.pAccelerationX),v=Math.abs(this.accelerationY-this.pAccelerationY)),u+v>o&&t()}},b.exports=d},{"../core/core":42}],56:[function(a,b,c){"use strict";function d(){for(var a in f)if(f.hasOwnProperty(a)&&f[a]===!0)return!0;return!1}var e=a("../core/core"),f={};e.prototype.isKeyPressed=!1,e.prototype.keyIsPressed=!1,e.prototype.key="",e.prototype.keyCode=0,e.prototype._onkeydown=function(a){if(!f[a.which]){this._setProperty("isKeyPressed",!0),this._setProperty("keyIsPressed",!0),this._setProperty("keyCode",a.which),f[a.which]=!0;var b=String.fromCharCode(a.which);b||(b=a.which),this._setProperty("key",b);var c=this.keyPressed||window.keyPressed;if("function"==typeof c&&!a.charCode){c(a)===!1&&a.preventDefault()}}},e.prototype._onkeyup=function(a){var b=this.keyReleased||window.keyReleased;f[a.which]=!1,d()||(this._setProperty("isKeyPressed",!1),this._setProperty("keyIsPressed",!1)),this._setProperty("_lastKeyCodeTyped",null);var c=String.fromCharCode(a.which);if(c||(c=a.which),this._setProperty("key",c),this._setProperty("keyCode",a.which),"function"==typeof b){b(a)===!1&&a.preventDefault()}},e.prototype._onkeypress=function(a){if(a.which!==this._lastKeyCodeTyped){this._setProperty("keyCode",a.which),this._setProperty("_lastKeyCodeTyped",a.which),this._setProperty("key",String.fromCharCode(a.which));var b=this.keyTyped||window.keyTyped;if("function"==typeof b){b(a)===!1&&a.preventDefault()}}},e.prototype._onblur=function(a){f={}},e.prototype.keyIsDown=function(a){return f[a]},b.exports=e},{"../core/core":42}],57:[function(a,b,c){"use strict";function d(a,b,c,d){d&&!d.clientX&&(d.touches?d=d.touches[0]:d.changedTouches&&(d=d.changedTouches[0]));var e=a.getBoundingClientRect(),f=a.scrollWidth/b,g=a.scrollHeight/c;return{x:(d.clientX-e.left)/f,y:(d.clientY-e.top)/g,winX:d.clientX,winY:d.clientY,id:d.identifier}}var e=a("../core/core"),f=a("../core/constants");e.prototype._hasMouseInteracted=!1,e.prototype.mouseX=0,e.prototype.mouseY=0,e.prototype.pmouseX=0,e.prototype.pmouseY=0,e.prototype.winMouseX=0,e.prototype.winMouseY=0,e.prototype.pwinMouseX=0,e.prototype.pwinMouseY=0,e.prototype.mouseButton=0,e.prototype.mouseIsPressed=!1,e.prototype.isMousePressed=!1,e.prototype._updateNextMouseCoords=function(a){if(null!==this._curElement&&(!a.touches||a.touches.length>0)){var b=d(this._curElement.elt,this.width,this.height,a);this._setProperty("mouseX",b.x),this._setProperty("mouseY",b.y),this._setProperty("winMouseX",b.winX),this._setProperty("winMouseY",b.winY)}this._hasMouseInteracted||(this._updateMouseCoords(),this._setProperty("_hasMouseInteracted",!0))},e.prototype._updateMouseCoords=function(){this._setProperty("pmouseX",this.mouseX),this._setProperty("pmouseY",this.mouseY),this._setProperty("pwinMouseX",this.winMouseX),this._setProperty("pwinMouseY",this.winMouseY)},e.prototype._setMouseButton=function(a){1===a.button?this._setProperty("mouseButton",f.CENTER):2===a.button?this._setProperty("mouseButton",f.RIGHT):this._setProperty("mouseButton",f.LEFT)},e.prototype._onmousemove=function(a){var b=this._isGlobal?window:this;this._updateNextMouseCoords(a),this.isMousePressed?"function"==typeof b.mouseDragged?b.mouseDragged(a)===!1&&a.preventDefault():window.PointerEvent||"function"!=typeof b.touchMoved||b.touchMoved(a)===!1&&a.preventDefault():"function"==typeof b.mouseMoved&&b.mouseMoved(a)===!1&&a.preventDefault()},e.prototype._onmousedown=function(a){var b=this._isGlobal?window:this;this._setProperty("isMousePressed",!0),this._setProperty("mouseIsPressed",!0),this._setMouseButton(a),this._updateNextMouseCoords(a),"function"==typeof b.mousePressed?b.mousePressed(a)===!1&&a.preventDefault():window.PointerEvent||"function"!=typeof b.touchStarted||b.touchStarted(a)===!1&&a.preventDefault()},e.prototype._onmouseup=function(a){var b=this._isGlobal?window:this;this._setProperty("isMousePressed",!1),this._setProperty("mouseIsPressed",!1),"function"==typeof b.mouseReleased?b.mouseReleased(a)===!1&&a.preventDefault():window.PointerEvent||"function"!=typeof b.touchEnded||b.touchEnded(a)===!1&&a.preventDefault()},e.prototype._ondragend=e.prototype._onmouseup,e.prototype._ondragover=e.prototype._onmousemove,e.prototype._onclick=function(a){var b=this._isGlobal?window:this;if("function"==typeof b.mouseClicked){b.mouseClicked(a)===!1&&a.preventDefault()}},e.prototype._onwheel=function(a){var b=this._isGlobal?window:this;if("function"==typeof b.mouseWheel){a.delta=a.deltaY;b.mouseWheel(a)===!1&&a.preventDefault()}},b.exports=e},{"../core/constants":41,"../core/core":42}],58:[function(a,b,c){"use strict";function d(a,b,c,d,e){e=e||0;var f=a.getBoundingClientRect(),g=a.scrollWidth/b,h=a.scrollHeight/c,i=d.touches[e]||d.changedTouches[e];return{x:(i.clientX-f.left)/g,y:(i.clientY-f.top)/h,winX:i.clientX,winY:i.clientY,id:i.identifier}}var e=a("../core/core");e.prototype.touches=[],e.prototype._updateTouchCoords=function(a){if(null!==this._curElement){for(var b=[],c=0;c<a.touches.length;c++)b[c]=d(this._curElement.elt,this.width,this.height,a,c);this._setProperty("touches",b)}},e.prototype._ontouchstart=function(a){var b=this._isGlobal?window:this;this._updateTouchCoords(a),this._updateNextMouseCoords(a),"function"==typeof b.touchStarted?b.touchStarted(a)===!1&&a.preventDefault():window.PointerEvent||"function"!=typeof b.mousePressed||b.mousePressed(a)===!1&&a.preventDefault()},e.prototype._ontouchmove=function(a){var b=this._isGlobal?window:this;this._updateTouchCoords(a),this._updateNextMouseCoords(a),"function"==typeof b.touchMoved?b.touchMoved(a)===!1&&a.preventDefault():window.PointerEvent||"function"!=typeof b.mouseDragged||b.mouseDragged(a)===!1&&a.preventDefault()},e.prototype._ontouchend=function(a){this._updateTouchCoords(a),this._updateNextMouseCoords(a),0===this.touches.length&&this._setProperty("touchIsDown",!1);var b=this._isGlobal?window:this;"function"==typeof b.touchEnded?b.touchEnded(a)===!1&&a.preventDefault():window.PointerEvent||"function"!=typeof b.mouseReleased||b.mouseReleased(a)===!1&&a.preventDefault()},b.exports=e},{"../core/core":42}],59:[function(a,b,c){"use strict";function d(a){var b=3.5*a|0;if(b=b<1?1:b<248?b:248,g!==b){g=b,h=1+g<<1,i=new Int32Array(h),j=new Array(h);for(var c=0;c<h;c++)j[c]=new Int32Array(256);for(var d,e,f,k,l=1,m=b-1;l<b;l++){i[b+l]=i[m]=e=m*m,f=j[b+l],k=j[m--];for(var n=0;n<256;n++)f[n]=k[n]=e*n}d=i[b]=b*b,f=j[b];for(var o=0;o<256;o++)f[o]=d*o}}function e(a,b){for(var c=f._toPixels(a),e=a.width,k=a.height,l=e*k,m=new Int32Array(l),n=0;n<l;n++)m[n]=f._getARGB(c,n);var o,p,q,r,s,t,u,v,w,x,y=new Int32Array(l),z=new Int32Array(l),A=new Int32Array(l),B=new Int32Array(l),C=0;d(b);var D,E,F,G;for(E=0;E<k;E++){for(D=0;D<e;D++){if(r=q=p=s=o=0,(t=D-g)<0)x=-t,t=0;else{if(t>=e)break;x=0}for(F=x;F<h&&!(t>=e);F++){var H=m[t+C];G=j[F],s+=G[(H&-16777216)>>>24],p+=G[(16711680&H)>>16],q+=G[(65280&H)>>8],r+=G[255&H],o+=i[F],t++}u=C+D,y[u]=s/o,z[u]=p/o,A[u]=q/o,B[u]=r/o}C+=e}for(C=0,v=-g,w=v*e,E=0;E<k;E++){for(D=0;D<e;D++){if(r=q=p=s=o=0,v<0)x=u=-v,t=D;else{if(v>=k)break;x=0,u=v,t=D+w}for(F=x;F<h&&!(u>=k);F++)G=j[F],s+=G[y[t]],p+=G[z[t]],q+=G[A[t]],r+=G[B[t]],o+=i[F],u++,t+=e;m[D+C]=s/o<<24|p/o<<16|q/o<<8|r/o}C+=e,w+=e,v++}f._setPixels(c,m)}var f={};f._toPixels=function(a){return a instanceof ImageData?a.data:a.getContext("2d").getImageData(0,0,a.width,a.height).data},f._getARGB=function(a,b){var c=4*b;return a[c+3]<<24&4278190080|a[c]<<16&16711680|a[c+1]<<8&65280|255&a[c+2]},f._setPixels=function(a,b){for(var c=0,d=0,e=a.length;d<e;d++)c=4*d,a[c+0]=(16711680&b[d])>>>16,a[c+1]=(65280&b[d])>>>8,a[c+2]=255&b[d],a[c+3]=(4278190080&b[d])>>>24},f._toImageData=function(a){return a instanceof ImageData?a:a.getContext("2d").getImageData(0,0,a.width,a.height)},f._createImageData=function(a,b){return f._tmpCanvas=document.createElement("canvas"),f._tmpCtx=f._tmpCanvas.getContext("2d"),this._tmpCtx.createImageData(a,b)},f.apply=function(a,b,c){var d=a.getContext("2d"),e=d.getImageData(0,0,a.width,a.height),f=b(e,c);f instanceof ImageData?d.putImageData(f,0,0,0,0,a.width,a.height):d.putImageData(e,0,0,0,0,a.width,a.height)},f.threshold=function(a,b){var c=f._toPixels(a);void 0===b&&(b=.5);for(var d=Math.floor(255*b),e=0;e<c.length;e+=4){var g,h=c[e],i=c[e+1],j=c[e+2],k=.2126*h+.7152*i+.0722*j;g=k>=d?255:0,c[e]=c[e+1]=c[e+2]=g}},f.gray=function(a){for(var b=f._toPixels(a),c=0;c<b.length;c+=4){var d=b[c],e=b[c+1],g=b[c+2],h=.2126*d+.7152*e+.0722*g;b[c]=b[c+1]=b[c+2]=h}},f.opaque=function(a){for(var b=f._toPixels(a),c=0;c<b.length;c+=4)b[c+3]=255;return b},f.invert=function(a){for(var b=f._toPixels(a),c=0;c<b.length;c+=4)b[c]=255-b[c],b[c+1]=255-b[c+1],b[c+2]=255-b[c+2]},f.posterize=function(a,b){var c=f._toPixels(a);if(b<2||b>255)throw new Error("Level must be greater than 2 and less than 255 for posterize");for(var d=b-1,e=0;e<c.length;e+=4){var g=c[e],h=c[e+1],i=c[e+2];c[e]=255*(g*b>>8)/d,c[e+1]=255*(h*b>>8)/d,c[e+2]=255*(i*b>>8)/d}},f.dilate=function(a){for(var b,c,d,e,g,h,i,j,k,l,m,n,o,p,q,r,s,t=f._toPixels(a),u=0,v=t.length?t.length/4:0,w=new Int32Array(v);u<v;)for(b=u,c=u+a.width;u<c;)d=e=f._getARGB(t,u),i=u-1,h=u+1,j=u-a.width,k=u+a.width,i<b&&(i=u),h>=c&&(h=u),j<0&&(j=0),k>=v&&(k=u),n=f._getARGB(t,j),m=f._getARGB(t,i),o=f._getARGB(t,k),l=f._getARGB(t,h),g=77*(d>>16&255)+151*(d>>8&255)+28*(255&d),q=77*(m>>16&255)+151*(m>>8&255)+28*(255&m),p=77*(l>>16&255)+151*(l>>8&255)+28*(255&l),r=77*(n>>16&255)+151*(n>>8&255)+28*(255&n),s=77*(o>>16&255)+151*(o>>8&255)+28*(255&o),q>g&&(e=m,g=q),p>g&&(e=l,g=p),r>g&&(e=n,g=r),s>g&&(e=o,g=s),w[u++]=e;f._setPixels(t,w)},f.erode=function(a){for(var b,c,d,e,g,h,i,j,k,l,m,n,o,p,q,r,s,t=f._toPixels(a),u=0,v=t.length?t.length/4:0,w=new Int32Array(v);u<v;)for(b=u,c=u+a.width;u<c;)d=e=f._getARGB(t,u),i=u-1,h=u+1,j=u-a.width,k=u+a.width,i<b&&(i=u),h>=c&&(h=u),j<0&&(j=0),k>=v&&(k=u),n=f._getARGB(t,j),m=f._getARGB(t,i),o=f._getARGB(t,k),l=f._getARGB(t,h),g=77*(d>>16&255)+151*(d>>8&255)+28*(255&d),q=77*(m>>16&255)+151*(m>>8&255)+28*(255&m),p=77*(l>>16&255)+151*(l>>8&255)+28*(255&l),r=77*(n>>16&255)+151*(n>>8&255)+28*(255&n),s=77*(o>>16&255)+151*(o>>8&255)+28*(255&o),q<g&&(e=m,g=q),p<g&&(e=l,g=p),r<g&&(e=n,g=r),s<g&&(e=o,g=s),w[u++]=e;f._setPixels(t,w)};var g,h,i,j;f.blur=function(a,b){e(a,b)},b.exports=f},{}],60:[function(a,b,c){"use strict";var d=a("../core/core"),e=[];d.prototype.createImage=function(a,b){return new d.Image(a,b)},d.prototype.saveCanvas=function(){var a,b,c;if(3===arguments.length?(a=arguments[0],b=arguments[1],c=arguments[2]):2===arguments.length?"object"==typeof arguments[0]?(a=arguments[0],b=arguments[1]):(b=arguments[0],c=arguments[1]):1===arguments.length&&("object"==typeof arguments[0]?a=arguments[0]:b=arguments[0]),a instanceof d.Element&&(a=a.elt),a instanceof HTMLCanvasElement||(a=null),c||""===(c=d.prototype._checkFileExtension(b,c)[1])&&(c="png"),a||this._curElement&&this._curElement.elt&&(a=this._curElement.elt),d.prototype._isSafari()){var e="Hello, Safari user!\n";e+="Now capturing a screenshot...\n",e+="To save this image,\n",e+="go to File --> Save As.\n",alert(e),window.location.href=a.toDataURL()}else{var f;if(void 0===c)c="png",f="image/png";else switch(c){case"png":f="image/png";break;case"jpeg":f="image/jpeg";break;case"jpg":f="image/jpeg";break;default:f="image/png"}var g=a.toDataURL(f);g=g.replace(f,"image/octet-stream"),d.prototype.downloadFile(g,b,c)}},d.prototype.saveFrames=function(a,b,c,f,g){var h=c||3;h=d.prototype.constrain(h,0,15),h*=1e3;var i=f||15;i=d.prototype.constrain(i,0,22);var j=0,k=d.prototype._makeFrame,l=this._curElement.elt,m=setInterval(function(){k(a+j,b,l),j++},1e3/i);setTimeout(function(){if(clearInterval(m),g)g(e);else for(var a=0;a<e.length;a++){var b=e[a];d.prototype.downloadFile(b.imageData,b.filename,b.ext)}e=[]},h+.01)},d.prototype._makeFrame=function(a,b,c){var d;d=this?this._curElement.elt:c;var f;if(b)switch(b.toLowerCase()){case"png":f="image/png";break;case"jpeg":f="image/jpeg";break;case"jpg":f="image/jpeg";break;default:f="image/png"}else b="png",f="image/png";var g=d.toDataURL(f);g=g.replace(f,"image/octet-stream");var h={};h.imageData=g,h.filename=a,h.ext=b,e.push(h)},b.exports=d},{"../core/core":42}],61:[function(a,b,c){"use strict";function d(a,b){return a>0&&a<b?a:b}var e=a("../core/core"),f=a("./filters"),g=a("../core/canvas"),h=a("../core/constants");a("../core/error_helpers"),e.prototype.loadImage=function(a,b,c){var d=new Image,f=new e.Image(1,1,this),g=e._getDecrementPreload.apply(this,arguments);return d.onload=function(){f.width=f.canvas.width=d.width,f.height=f.canvas.height=d.height,f.drawingContext.drawImage(d,0,0),"function"==typeof b&&b(f),g&&b!==g&&g()},d.onerror=function(a){e._friendlyFileLoadError(0,d.src),"function"==typeof c&&c!==g&&c(a)},0!==a.indexOf("data:image/")&&(d.crossOrigin="Anonymous"),d.src=a,f},e.prototype.image=function(a,b,c,e,f,h,i,j,k){var l=a.width,m=a.height;a.elt&&a.elt.videoWidth&&!a.canvas&&(l=a.elt.videoWidth,m=a.elt.videoHeight);var n=b,o=c,p=e||l,q=f||m,r=h||0,s=i||0,t=j||l,u=k||m;t=d(t,l),u=d(u,m);var v=1;a.elt&&!a.canvas&&a.elt.style.width&&(v=a.elt.videoWidth&&!e?a.elt.videoWidth:a.elt.width,v/=parseInt(a.elt.style.width,10)),r*=v,s*=v,u*=v,t*=v;var w=g.modeAdjust(n,o,p,q,this._renderer._imageMode);this._renderer.image(a,r,s,t,u,w.x,w.y,w.w,w.h)},e.prototype.tint=function(){var a=this.color.apply(this,arguments);this._renderer._tint=a.levels},e.prototype.noTint=function(){this._renderer._tint=null},e.prototype._getTintedImageCanvas=function(a){if(!a.canvas)return a;var b=f._toPixels(a.canvas),c=document.createElement("canvas");c.width=a.canvas.width,c.height=a.canvas.height;for(var d=c.getContext("2d"),e=d.createImageData(a.canvas.width,a.canvas.height),g=e.data,h=0;h<b.length;h+=4){var i=b[h],j=b[h+1],k=b[h+2],l=b[h+3];g[h]=i*this._renderer._tint[0]/255,g[h+1]=j*this._renderer._tint[1]/255,g[h+2]=k*this._renderer._tint[2]/255,g[h+3]=l*this._renderer._tint[3]/255}return d.putImageData(e,0,0),c},e.prototype.imageMode=function(a){a!==h.CORNER&&a!==h.CORNERS&&a!==h.CENTER||(this._renderer._imageMode=a)},b.exports=e},{"../core/canvas":40,"../core/constants":41,"../core/core":42,"../core/error_helpers":45,"./filters":59}],62:[function(a,b,c){"use strict";var d=a("../core/core"),e=a("./filters");d.Image=function(a,b){this.width=a,this.height=b,this.canvas=document.createElement("canvas"),this.canvas.width=this.width,this.canvas.height=this.height,this.drawingContext=this.canvas.getContext("2d"),this._pixelDensity=1,this.isTexture=!1,this.pixels=[]},d.Image.prototype._setProperty=function(a,b){this[a]=b},d.Image.prototype.loadPixels=function(){d.Renderer2D.prototype.loadPixels.call(this)},d.Image.prototype.updatePixels=function(a,b,c,e){d.Renderer2D.prototype.updatePixels.call(this,a,b,c,e)},d.Image.prototype.get=function(a,b,c,e){return d.Renderer2D.prototype.get.call(this,a,b,c,e)},d.Image.prototype.set=function(a,b,c){d.Renderer2D.prototype.set.call(this,a,b,c)},d.Image.prototype.resize=function(a,b){0===a&&0===b?(a=this.canvas.width,b=this.canvas.height):0===a?a=this.canvas.width*b/this.canvas.height:0===b&&(b=this.canvas.height*a/this.canvas.width),a=Math.floor(a),b=Math.floor(b);var c=document.createElement("canvas");c.width=a,c.height=b,c.getContext("2d").drawImage(this.canvas,0,0,this.canvas.width,this.canvas.height,0,0,c.width,c.height),this.canvas.width=this.width=a,this.canvas.height=this.height=b,this.drawingContext.drawImage(c,0,0,a,b,0,0,a,b),this.pixels.length>0&&this.loadPixels()},d.Image.prototype.copy=function(){d.prototype.copy.apply(this,arguments)},d.Image.prototype.mask=function(a){void 0===a&&(a=this);var b=this.drawingContext.globalCompositeOperation,c=1;a instanceof d.Renderer&&(c=a._pInst._pixelDensity);var e=[a,0,0,c*a.width,c*a.height,0,0,this.width,this.height];this.drawingContext.globalCompositeOperation="destination-in",d.Image.prototype.copy.apply(this,e),this.drawingContext.globalCompositeOperation=b},d.Image.prototype.filter=function(a,b){e.apply(this.canvas,e[a.toLowerCase()],b)},d.Image.prototype.blend=function(){
d.prototype.blend.apply(this,arguments)},d.Image.prototype.save=function(a,b){var c;if(b)switch(b.toLowerCase()){case"png":c="image/png";break;case"jpeg":c="image/jpeg";break;case"jpg":c="image/jpeg";break;default:c="image/png"}else b="png",c="image/png";var e=this.canvas.toDataURL(c);e=e.replace(c,"image/octet-stream"),d.prototype.downloadFile(e,a,b)},b.exports=d.Image},{"../core/core":42,"./filters":59}],63:[function(a,b,c){"use strict";var d=a("../core/core"),e=a("./filters");a("../color/p5.Color"),d.prototype.pixels=[],d.prototype.blend=function(){this._renderer?this._renderer.blend.apply(this._renderer,arguments):d.Renderer2D.prototype.blend.apply(this,arguments)},d.prototype.copy=function(){d.Renderer2D._copyHelper.apply(this,arguments)},d.prototype.filter=function(a,b){void 0!==this.canvas?e.apply(this.canvas,e[a.toLowerCase()],b):e.apply(this.elt,e[a.toLowerCase()],b)},d.prototype.get=function(a,b,c,d){return this._renderer.get(a,b,c,d)},d.prototype.loadPixels=function(){this._renderer.loadPixels()},d.prototype.set=function(a,b,c){this._renderer.set(a,b,c)},d.prototype.updatePixels=function(a,b,c,d){0!==this.pixels.length&&this._renderer.updatePixels(a,b,c,d)},b.exports=d},{"../color/p5.Color":36,"../core/core":42,"./filters":59}],64:[function(a,b,c){"use strict";function d(a,b){var c={};if(void 0===(b=b||[]))for(var d=0;d<a.length;d++)b[d.toString()]=d;for(var e=0;e<b.length;e++){var f=b[e],g=a[e];c[f]=g}return c}function e(a){return a.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}function f(a,b){b&&b!==!0&&"true"!==b||(b=""),a||(a="untitled");var c="";return a&&a.indexOf(".")>-1&&(c=a.split(".").pop()),b&&c!==b&&(c=b,a=a+"."+c),[a,c]}function g(a){document.body.removeChild(a.target)}var h=a("../core/core"),i=a("opentype.js");a("whatwg-fetch"),a("es6-promise").polyfill();var j=a("fetch-jsonp");a("../core/error_helpers"),h._getDecrementPreload=function(){var a=arguments[arguments.length-1];return(window.preload||this&&this.preload)&&"function"==typeof a?a:null},h.prototype.loadFont=function(a,b,c){var d=new h.Font(this),e=h._getDecrementPreload.apply(this,arguments);return i.load(a,function(f,g){if(f)return void 0!==c&&c!==e?c(f):(h._friendlyFileLoadError(4,a),void console.error(f,a));d.font=g,void 0!==b&&b(d),e&&b!==e&&e();var i,j,k=["ttf","otf","woff","woff2"],l=a.split("\\").pop().split("/").pop(),m=l.lastIndexOf("."),n=m<1?null:l.substr(m+1);k.indexOf(n)>-1&&(i=l.substr(0,m),j=document.createElement("style"),j.appendChild(document.createTextNode("\n@font-face {\nfont-family: "+i+";\nsrc: url("+a+");\n}\n")),document.head.appendChild(j))}),d},h.prototype.loadJSON=function(){for(var a,b,c,d=arguments[0],e=h._getDecrementPreload.apply(this,arguments),f={},g="json",i=1;i<arguments.length;i++){var j=arguments[i];"string"==typeof j?"jsonp"!==j&&"json"!==j||(g=j):"function"==typeof j&&j!==e?a?b=j:a=j:"object"==typeof j&&j.hasOwnProperty("jsonpCallback")&&(g="jsonp",c=j)}return h.prototype.httpDo(d,"GET",c,g,function(b){for(var c in b)f[c]=b[c];void 0!==a&&a(b),e&&a!==e&&e()},b),f},h.prototype.loadStrings=function(){for(var a,b,c=[],d=h._getDecrementPreload.apply(this,arguments),e=1;e<arguments.length;e++){var f=arguments[e];"function"==typeof f&&f!==d&&(void 0===a?a=f:b=f)}return h.prototype.httpDo(arguments[0],"GET","text",function(b){var e=b.match(/[^\r\n]+/g);for(var f in e)c[f]=e[f];void 0!==a&&a(c),d&&a!==d&&d()},b),c},h.prototype.loadTable=function(a){for(var b=null,c=null,e=[],f=!1,g=",",i=!1,j=h._getDecrementPreload.apply(this,arguments),k=1;k<arguments.length;k++)if("function"==typeof arguments[k]&&arguments[k]!==j)b?c=arguments[k]:b=arguments[k];else if("string"==typeof arguments[k])if(e.push(arguments[k]),"header"===arguments[k]&&(f=!0),"csv"===arguments[k]){if(i)throw new Error("Cannot set multiple separator types.");g=",",i=!0}else if("tsv"===arguments[k]){if(i)throw new Error("Cannot set multiple separator types.");g="\t",i=!0}var l=new h.Table;return h.prototype.httpDo(a,"GET","text",function(a){for(var c,e={},i=0,m=1,n=2,o=4,p='"',q="\r",r="\n",s=[],t=0,u=null,v=function(){e.currentState=i,e.token=""},w=function(){u.push(e.token),v()},x=function(){e.escaped=!1,u=[],v()},y=function(){e.currentState=o,s.push(u),u=null};;){if(null==(c=a[t++])){if(e.escaped)throw new Error("Unclosed quote in file.");if(u){w(),y();break}}if(null===u&&x(),e.currentState===i){if(c===p){e.escaped=!0,e.currentState=m;continue}e.currentState=m}e.currentState===m&&e.escaped?c===p?a[t]===p?(e.token+=p,t++):(e.escaped=!1,e.currentState=n):e.token+=c:c===q?(a[t]===r&&t++,w(),y()):c===r?(w(),y()):c===g?w():e.currentState===m&&(e.token+=c)}if(f)l.columns=s.shift();else for(k=0;k<s[0].length;k++)l.columns[k]="null";var z;for(k=0;k<s.length;k++)(1!==s[k].length||"undefined"!==s[k][0]&&""!==s[k][0])&&(z=new h.TableRow,z.arr=s[k],z.obj=d(s[k],l.columns),l.addRow(z));null!==b&&b(l),j&&b!==j&&j()},function(b){if(h._friendlyFileLoadError(2,a),!c)throw b;c(b)}),l},h.prototype.parseXML=function(a){var b,c=new h.XML;if(a.children.length){for(b=0;b<a.children.length;b++){var d=parseXML(a.children[b]);c.addChild(d)}c.setName(a.nodeName),c._setCont(a.textContent),c._setAttributes(a);for(var e=0;e<c.children.length;e++)c.children[e].parent=c;return c}return c.setName(a.nodeName),c._setCont(a.textContent),c._setAttributes(a),c},h.prototype.loadXML=function(){for(var a,b,c={},d=h._getDecrementPreload.apply(this,arguments),e=1;e<arguments.length;e++){var f=arguments[e];"function"==typeof f&&f!==d&&(void 0===a?a=f:b=f)}return h.prototype.httpDo(arguments[0],"GET","xml",function(b){for(var e in b)c[e]=b[e];void 0!==a&&a(c),d&&a!==d&&d()},b),c},h.prototype.httpGet=function(){var a=Array.prototype.slice.call(arguments);a.splice(1,0,"GET"),h.prototype.httpDo.apply(this,a)},h.prototype.httpPost=function(){var a=Array.prototype.slice.call(arguments);a.splice(1,0,"POST"),h.prototype.httpDo.apply(this,a)},h.prototype.httpDo=function(){for(var a,b,c,d="",e={},f=0,g="text/plain",h=arguments.length-1;h>0&&"function"==typeof arguments[h];h--)f++;if(2==arguments.length-f&&"string"==typeof arguments[0]&&"object"==typeof arguments[1])c=new Request(arguments[0],arguments[1]),a=arguments[2],b=arguments[3],""===d&&(d=c.url.indexOf("json")!==-1?"json":c.url.indexOf("xml")!==-1?"xml":"text");else{for(var i,k=arguments[0],l="GET",m=1;m<arguments.length;m++){var n=arguments[m];if("string"==typeof n)"GET"===n||"POST"===n||"PUT"===n||"DELETE"===n?l=n:"json"===n||"jsonp"===n||"xml"===n||"text"===n?d=n:i=n;else if("object"==typeof n)if(n.hasOwnProperty("jsonpCallback"))for(var o in n)e[o]=n[o];else i=JSON.stringify(n),g="application/json";else"function"==typeof n&&(a?b=n:a=n)}""===d&&(d=k.indexOf("json")!==-1?"json":k.indexOf("xml")!==-1?"xml":"text"),c=new Request(k,{method:l,mode:"cors",body:i,headers:new Headers({"Content-Type":g})})}"jsonp"===d?j(arguments[0],e).then(function(a){if(a.ok)return a.json();throw a}).then(function(b){a(b)}).catch(function(a){if(!b)throw a;b(a)}):fetch(c).then(function(a){if(a.ok)return"json"===d?a.json():a.text();throw a}).then(function(b){if("xml"===d){b=(new DOMParser).parseFromString(b,"text/xml"),b=parseXML(b.documentElement)}a(b)}).catch(function(a,c){if(!b)throw a;b(a)})},window.URL=window.URL||window.webkitURL,h.prototype._pWriters=[],h.prototype.createWriter=function(a,b){var c;for(var d in h.prototype._pWriters)if(h.prototype._pWriters[d].name===a)return c=new h.PrintWriter(a+window.millis(),b),h.prototype._pWriters.push(c),c;return c=new h.PrintWriter(a,b),h.prototype._pWriters.push(c),c},h.PrintWriter=function(a,b){var c=this;this.name=a,this.content="",this.write=function(a){this.content+=a},this.print=function(a){this.content+=a+"\n"},this.flush=function(){this.content=""},this.close=function(){var d=[];d.push(this.content),h.prototype.writeFile(d,a,b);for(var e in h.prototype._pWriters)h.prototype._pWriters[e].name===this.name&&h.prototype._pWriters.splice(e,1);c.flush(),c={}}},h.prototype.save=function(a,b,c){var d=arguments,e=this._curElement.elt;if(0===d.length)return void h.prototype.saveCanvas(e);if(d[0]instanceof h.Renderer||d[0]instanceof h.Graphics)return void h.prototype.saveCanvas(d[0].elt,d[1],d[2]);if(1===d.length&&"string"==typeof d[0])h.prototype.saveCanvas(e,d[0]);else{switch(f(d[1],d[2])[1]){case"json":return void h.prototype.saveJSON(d[0],d[1],d[2]);case"txt":return void h.prototype.saveStrings(d[0],d[1],d[2]);default:d[0]instanceof Array?h.prototype.saveStrings(d[0],d[1],d[2]):d[0]instanceof h.Table?h.prototype.saveTable(d[0],d[1],d[2],d[3]):d[0]instanceof h.Image?h.prototype.saveCanvas(d[0].canvas,d[1]):d[0]instanceof h.SoundFile&&h.prototype.saveSound(d[0],d[1],d[2],d[3])}}},h.prototype.saveJSON=function(a,b,c){var d;d=c?JSON.stringify(a):JSON.stringify(a,void 0,2),this.saveStrings(d.split("\n"),b,"json")},h.prototype.saveJSONObject=h.prototype.saveJSON,h.prototype.saveJSONArray=h.prototype.saveJSON,h.prototype.saveStrings=function(a,b,c){for(var d=c||"txt",e=this.createWriter(b,d),f=0;f<a.length;f++)a.length,e.print(a[f]);e.close(),e.flush()},h.prototype.saveTable=function(a,b,c){var d;d=void 0===c?b.substring(b.lastIndexOf(".")+1,b.length):c;var f=this.createWriter(b,d),g=a.columns,h=",";if("tsv"===d&&(h="\t"),"html"!==d){if("0"!==g[0]){for(var i=0;i<g.length;i++)i<g.length-1?f.write(g[i]+h):f.write(g[i]);f.write("\n")}for(var j=0;j<a.rows.length;j++){var k;for(k=0;k<a.rows[j].arr.length;k++)k<a.rows[j].arr.length-1?f.write(a.rows[j].arr[k]+h):(a.rows.length,f.write(a.rows[j].arr[k]));f.write("\n")}}else{f.print("<html>"),f.print("<head>");var l=' <meta http-equiv="content-type" content';if(l+='="text/html;charset=utf-8" />',f.print(l),f.print("</head>"),f.print("<body>"),f.print(" <table>"),"0"!==g[0]){f.print(" <tr>");for(var m=0;m<g.length;m++){var n=e(g[m]);f.print(" <td>"+n),f.print(" </td>")}f.print(" </tr>")}for(var o=0;o<a.rows.length;o++){f.print(" <tr>");for(var p=0;p<a.columns.length;p++){var q=a.rows[o].getString(p),r=e(q);f.print(" <td>"+r),f.print(" </td>")}f.print(" </tr>")}f.print(" </table>"),f.print("</body>"),f.print("</html>")}f.close(),f.flush()},h.prototype.writeFile=function(a,b,c){var d="application/octet-stream";h.prototype._isSafari()&&(d="text/plain");var e=new Blob(a,{type:d}),f=window.URL.createObjectURL(e);h.prototype.downloadFile(f,b,c)},h.prototype.downloadFile=function(a,b,c){var d=f(b,c),e=d[0],i=d[1],j=document.createElement("a");if(j.href=a,j.download=e,j.onclick=function(a){g(a),a.stopPropagation()},j.style.display="none",document.body.appendChild(j),h.prototype._isSafari()){var k="Hello, Safari user! To download this file...\n";k+="1. Go to File --> Save As.\n",k+='2. Choose "Page Source" as the Format.\n',k+='3. Name it with this extension: ."'+i+'"',alert(k)}j.click(),a=null},h.prototype._checkFileExtension=f,h.prototype._isSafari=function(){return Object.prototype.toString.call(window.HTMLElement).indexOf("Constructor")>0},b.exports=h},{"../core/core":42,"../core/error_helpers":45,"es6-promise":2,"fetch-jsonp":3,"opentype.js":10,"whatwg-fetch":32}],65:[function(a,b,c){"use strict";var d=a("../core/core");d.Table=function(a){this.columns=[],this.rows=[]},d.Table.prototype.addRow=function(a){var b=a||new d.TableRow;if(void 0===b.arr||void 0===b.obj)throw"invalid TableRow: "+b;return b.table=this,this.rows.push(b),b},d.Table.prototype.removeRow=function(a){this.rows[a].table=null;var b=this.rows.splice(a+1,this.rows.length);this.rows.pop(),this.rows=this.rows.concat(b)},d.Table.prototype.getRow=function(a){return this.rows[a]},d.Table.prototype.getRows=function(){return this.rows},d.Table.prototype.findRow=function(a,b){if("string"==typeof b){for(var c=0;c<this.rows.length;c++)if(this.rows[c].obj[b]===a)return this.rows[c]}else for(var d=0;d<this.rows.length;d++)if(this.rows[d].arr[b]===a)return this.rows[d];return null},d.Table.prototype.findRows=function(a,b){var c=[];if("string"==typeof b)for(var d=0;d<this.rows.length;d++)this.rows[d].obj[b]===a&&c.push(this.rows[d]);else for(var e=0;e<this.rows.length;e++)this.rows[e].arr[b]===a&&c.push(this.rows[e]);return c},d.Table.prototype.matchRow=function(a,b){if("number"==typeof b){for(var c=0;c<this.rows.length;c++)if(this.rows[c].arr[b].match(a))return this.rows[c]}else for(var d=0;d<this.rows.length;d++)if(this.rows[d].obj[b].match(a))return this.rows[d];return null},d.Table.prototype.matchRows=function(a,b){var c=[];if("number"==typeof b)for(var d=0;d<this.rows.length;d++)this.rows[d].arr[b].match(a)&&c.push(this.rows[d]);else for(var e=0;e<this.rows.length;e++)this.rows[e].obj[b].match(a)&&c.push(this.rows[e]);return c},d.Table.prototype.getColumn=function(a){var b=[];if("string"==typeof a)for(var c=0;c<this.rows.length;c++)b.push(this.rows[c].obj[a]);else for(var d=0;d<this.rows.length;d++)b.push(this.rows[d].arr[a]);return b},d.Table.prototype.clearRows=function(){delete this.rows,this.rows=[]},d.Table.prototype.addColumn=function(a){var b=a||null;this.columns.push(b)},d.Table.prototype.getColumnCount=function(){return this.columns.length},d.Table.prototype.getRowCount=function(){return this.rows.length},d.Table.prototype.removeTokens=function(a,b){for(var c=function(a){return a.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&")},d=[],e=0;e<a.length;e++)d.push(c(a.charAt(e)));var f=new RegExp(d.join("|"),"g");if(void 0===b)for(var g=0;g<this.columns.length;g++)for(var h=0;h<this.rows.length;h++){var i=this.rows[h].arr[g];i=i.replace(f,""),this.rows[h].arr[g]=i,this.rows[h].obj[this.columns[g]]=i}else if("string"==typeof b)for(var j=0;j<this.rows.length;j++){var k=this.rows[j].obj[b];k=k.replace(f,""),this.rows[j].obj[b]=k;var l=this.columns.indexOf(b);this.rows[j].arr[l]=k}else for(var m=0;m<this.rows.length;m++){var n=this.rows[m].arr[b];n=n.replace(f,""),this.rows[m].arr[b]=n,this.rows[m].obj[this.columns[b]]=n}},d.Table.prototype.trim=function(a){var b=new RegExp(" ","g");if(void 0===a)for(var c=0;c<this.columns.length;c++)for(var d=0;d<this.rows.length;d++){var e=this.rows[d].arr[c];e=e.replace(b,""),this.rows[d].arr[c]=e,this.rows[d].obj[this.columns[c]]=e}else if("string"==typeof a)for(var f=0;f<this.rows.length;f++){var g=this.rows[f].obj[a];g=g.replace(b,""),this.rows[f].obj[a]=g;var h=this.columns.indexOf(a);this.rows[f].arr[h]=g}else for(var i=0;i<this.rows.length;i++){var j=this.rows[i].arr[a];j=j.replace(b,""),this.rows[i].arr[a]=j,this.rows[i].obj[this.columns[a]]=j}},d.Table.prototype.removeColumn=function(a){var b,c;"string"==typeof a?(b=a,c=this.columns.indexOf(a),console.log("string")):(c=a,b=this.columns[a]);var d=this.columns.splice(c+1,this.columns.length);this.columns.pop(),this.columns=this.columns.concat(d);for(var e=0;e<this.rows.length;e++){var f=this.rows[e].arr,g=f.splice(c+1,f.length);f.pop(),this.rows[e].arr=f.concat(g),delete this.rows[e].obj[b]}},d.Table.prototype.set=function(a,b,c){this.rows[a].set(b,c)},d.Table.prototype.setNum=function(a,b,c){this.rows[a].setNum(b,c)},d.Table.prototype.setString=function(a,b,c){this.rows[a].setString(b,c)},d.Table.prototype.get=function(a,b){return this.rows[a].get(b)},d.Table.prototype.getNum=function(a,b){return this.rows[a].getNum(b)},d.Table.prototype.getString=function(a,b){return this.rows[a].getString(b)},d.Table.prototype.getObject=function(a){for(var b,c,d={},e=0;e<this.rows.length;e++)if(b=this.rows[e].obj,"string"==typeof a){if(!(this.columns.indexOf(a)>=0))throw'This table has no column named "'+a+'"';c=b[a],d[c]=b}else d[e]=this.rows[e].obj;return d},d.Table.prototype.getArray=function(){for(var a=[],b=0;b<this.rows.length;b++)a.push(this.rows[b].arr);return a},b.exports=d.Table},{"../core/core":42}],66:[function(a,b,c){"use strict";var d=a("../core/core");d.TableRow=function(a,b){var c=[],d={};a&&(b=b||",",c=a.split(b));for(var e=0;e<c.length;e++){var f=e,g=c[e];d[f]=g}this.arr=c,this.obj=d,this.table=null},d.TableRow.prototype.set=function(a,b){if("string"==typeof a){var c=this.table.columns.indexOf(a);if(!(c>=0))throw'This table has no column named "'+a+'"';this.obj[a]=b,this.arr[c]=b}else{if(!(a<this.table.columns.length))throw"Column #"+a+" is out of the range of this table";this.arr[a]=b;var d=this.table.columns[a];this.obj[d]=b}},d.TableRow.prototype.setNum=function(a,b){var c=parseFloat(b,10);this.set(a,c)},d.TableRow.prototype.setString=function(a,b){var c=b.toString();this.set(a,c)},d.TableRow.prototype.get=function(a){return"string"==typeof a?this.obj[a]:this.arr[a]},d.TableRow.prototype.getNum=function(a){var b;if(b="string"==typeof a?parseFloat(this.obj[a],10):parseFloat(this.arr[a],10),"NaN"===b.toString())throw"Error: "+this.obj[a]+" is NaN (Not a Number)";return b},d.TableRow.prototype.getString=function(a){return"string"==typeof a?this.obj[a].toString():this.arr[a].toString()},b.exports=d.TableRow},{"../core/core":42}],67:[function(a,b,c){"use strict";var d=a("../core/core");d.XML=function(){this.name=null,this.attributes={},this.children=[],this.parent=null,this.content=null},d.XML.prototype.getParent=function(){return this.parent},d.XML.prototype.getName=function(){return this.name},d.XML.prototype.setName=function(a){this.name=a},d.XML.prototype.hasChildren=function(){return this.children.length>0},d.XML.prototype.listChildren=function(){return this.children.map(function(a){return a.name})},d.XML.prototype.getChildren=function(a){return a?this.children.filter(function(b){return b.name===a}):this.children},d.XML.prototype.getChild=function(a){return"string"==typeof a?this.children.find(function(b){return b.name===a}):this.children[a]},d.XML.prototype.addChild=function(a){a instanceof d.XML&&this.children.push(a)},d.XML.prototype.removeChild=function(a){var b=-1;if("string"==typeof a){for(var c=0;c<this.children.length;c++)if(this.children[c].name===a){b=c;break}}else b=a;b!==-1&&this.children.splice(b,1)},d.XML.prototype.getAttributeCount=function(){return Object.keys(this.attributes).length},d.XML.prototype.listAttributes=function(){return Object.keys(this.attributes)},d.XML.prototype.hasAttribute=function(a){return!!this.attributes[a]},d.XML.prototype.getNum=function(a,b){return Number(this.attributes[a])||b||0},d.XML.prototype.getString=function(a,b){return String(this.attributes[a])||b||null},d.XML.prototype.setAttribute=function(a,b){this.attributes[a]&&(this.attributes[a]=b)},d.XML.prototype.getContent=function(a){return this.content||a||null},d.XML.prototype.setContent=function(a){this.children.length||(this.content=a)},d.XML.prototype._setCont=function(a){var b;b=a,b=b.replace(/\s\s+/g,","),this.content=b},d.XML.prototype._setAttributes=function(a){var b,c={};for(b=0;b<a.attributes.length;b++)c[a.attributes[b].nodeName]=a.attributes[b].nodeValue;this.attributes=c},b.exports=d.XML},{"../core/core":42}],68:[function(a,b,c){"use strict";function d(a,b,c){if("function"==typeof Math.hypot)return Math.hypot.apply(null,arguments);for(var d=arguments.length,e=[],f=0,g=0;g<d;g++){var h=arguments[g];if((h=+h)===1/0||h===-(1/0))return 1/0;h=Math.abs(h),h>f&&(f=h),e[g]=h}0===f&&(f=1);for(var i=0,j=0,k=0;k<d;k++){var l=e[k]/f,m=l*l-j,n=i+m;j=n-i-m,i=n}return Math.sqrt(i)*f}var e=a("../core/core");e.prototype.abs=Math.abs,e.prototype.ceil=Math.ceil,e.prototype.constrain=function(a,b,c){return Math.max(Math.min(a,c),b)},e.prototype.dist=function(a,b,c,e,f,g){return 4===arguments.length?d(c-a,e-b):6===arguments.length?d(e-a,f-b,g-c):void 0},e.prototype.exp=Math.exp,e.prototype.floor=Math.floor,e.prototype.lerp=function(a,b,c){return c*(b-a)+a},e.prototype.log=Math.log,e.prototype.mag=function(a,b){return d(a,b)},e.prototype.map=function(a,b,c,d,e){return(a-b)/(c-b)*(e-d)+d},e.prototype.max=function(){return arguments[0]instanceof Array?Math.max.apply(null,arguments[0]):Math.max.apply(null,arguments)},e.prototype.min=function(){return arguments[0]instanceof Array?Math.min.apply(null,arguments[0]):Math.min.apply(null,arguments)},e.prototype.norm=function(a,b,c){return this.map(a,b,c,0,1)},e.prototype.pow=Math.pow,e.prototype.round=Math.round,e.prototype.sq=function(a){return a*a},e.prototype.sqrt=Math.sqrt,b.exports=e},{"../core/core":42}],69:[function(a,b,c){"use strict";var d=a("../core/core");d.prototype.createVector=function(a,b,c){return this instanceof d?new d.Vector(this,arguments):new d.Vector(a,b,c)},b.exports=d},{"../core/core":42}],70:[function(a,b,c){"use strict";var d,e=a("../core/core"),f=4,g=1<<f,h=8,i=1<<h,j=4095,k=4,l=.5,m=function(a){return.5*(1-Math.cos(a*Math.PI))};e.prototype.noise=function(a,b,c){if(b=b||0,c=c||0,null==d){d=new Array(j+1);for(var e=0;e<j+1;e++)d[e]=Math.random()}a<0&&(a=-a),b<0&&(b=-b),c<0&&(c=-c);for(var n,o,p,q,r,s=Math.floor(a),t=Math.floor(b),u=Math.floor(c),v=a-s,w=b-t,x=c-u,y=0,z=.5,A=0;A<k;A++){var B=s+(t<<f)+(u<<h);n=m(v),o=m(w),p=d[B&j],p+=n*(d[B+1&j]-p),q=d[B+g&j],q+=n*(d[B+g+1&j]-q),p+=o*(q-p),B+=i,q=d[B&j],q+=n*(d[B+1&j]-q),r=d[B+g&j],r+=n*(d[B+g+1&j]-r),q+=o*(r-q),p+=m(x)*(q-p),y+=p*z,z*=l,s<<=1,v*=2,t<<=1,w*=2,u<<=1,x*=2,v>=1&&(s++,v--),w>=1&&(t++,w--),x>=1&&(u++,x--)}return y},e.prototype.noiseDetail=function(a,b){a>0&&(k=a),b>0&&(l=b)},e.prototype.noiseSeed=function(a){var b=function(){var a,b,c=4294967296,d=1664525,e=1013904223;return{setSeed:function(d){b=a=(null==d?Math.random()*c:d)>>>0},getSeed:function(){return a},rand:function(){return(b=(d*b+e)%c)/c}}}();b.setSeed(a),d=new Array(j+1);for(var c=0;c<j+1;c++)d[c]=b.rand()},b.exports=e},{"../core/core":42}],71:[function(a,b,c){"use strict";var d=a("../core/core"),e=a("./polargeometry"),f=a("../core/constants");d.Vector=function(){var a,b,c;arguments[0]instanceof d?(this.p5=arguments[0],a=arguments[1][0]||0,b=arguments[1][1]||0,c=arguments[1][2]||0):(a=arguments[0]||0,b=arguments[1]||0,c=arguments[2]||0),this.x=a,this.y=b,this.z=c},d.Vector.prototype.toString=function(){return"p5.Vector Object : ["+this.x+", "+this.y+", "+this.z+"]"},d.Vector.prototype.set=function(a,b,c){return a instanceof d.Vector?(this.x=a.x||0,this.y=a.y||0,this.z=a.z||0,this):a instanceof Array?(this.x=a[0]||0,this.y=a[1]||0,this.z=a[2]||0,this):(this.x=a||0,this.y=b||0,this.z=c||0,this)},d.Vector.prototype.copy=function(){return this.p5?new d.Vector(this.p5,[this.x,this.y,this.z]):new d.Vector(this.x,this.y,this.z)},d.Vector.prototype.add=function(a,b,c){return a instanceof d.Vector?(this.x+=a.x||0,this.y+=a.y||0,this.z+=a.z||0,this):a instanceof Array?(this.x+=a[0]||0,this.y+=a[1]||0,this.z+=a[2]||0,this):(this.x+=a||0,this.y+=b||0,this.z+=c||0,this)},d.Vector.prototype.sub=function(a,b,c){return a instanceof d.Vector?(this.x-=a.x||0,this.y-=a.y||0,this.z-=a.z||0,this):a instanceof Array?(this.x-=a[0]||0,this.y-=a[1]||0,this.z-=a[2]||0,this):(this.x-=a||0,this.y-=b||0,this.z-=c||0,this)},d.Vector.prototype.mult=function(a){return this.x*=a||0,this.y*=a||0,this.z*=a||0,this},d.Vector.prototype.div=function(a){return this.x/=a,this.y/=a,this.z/=a,this},d.Vector.prototype.mag=function(){return Math.sqrt(this.magSq())},d.Vector.prototype.magSq=function(){var a=this.x,b=this.y,c=this.z;return a*a+b*b+c*c},d.Vector.prototype.dot=function(a,b,c){return a instanceof d.Vector?this.dot(a.x,a.y,a.z):this.x*(a||0)+this.y*(b||0)+this.z*(c||0)},d.Vector.prototype.cross=function(a){var b=this.y*a.z-this.z*a.y,c=this.z*a.x-this.x*a.z,e=this.x*a.y-this.y*a.x;return this.p5?new d.Vector(this.p5,[b,c,e]):new d.Vector(b,c,e)},d.Vector.prototype.dist=function(a){return a.copy().sub(this).mag()},d.Vector.prototype.normalize=function(){return 0===this.mag()?this:this.div(this.mag())},d.Vector.prototype.limit=function(a){var b=this.magSq();return b>a*a&&(this.div(Math.sqrt(b)),this.mult(a)),this},d.Vector.prototype.setMag=function(a){return this.normalize().mult(a)},d.Vector.prototype.heading=function(){var a=Math.atan2(this.y,this.x);return this.p5?this.p5._angleMode===f.RADIANS?a:e.radiansToDegrees(a):a},d.Vector.prototype.rotate=function(a){var b=this.heading()+a;this.p5&&this.p5._angleMode===f.DEGREES&&(b=e.degreesToRadians(b));var c=this.mag();return this.x=Math.cos(b)*c,this.y=Math.sin(b)*c,this},d.Vector.prototype.lerp=function(a,b,c,e){return a instanceof d.Vector?this.lerp(a.x,a.y,a.z,b):(this.x+=(a-this.x)*e||0,this.y+=(b-this.y)*e||0,this.z+=(c-this.z)*e||0,this)},d.Vector.prototype.array=function(){return[this.x||0,this.y||0,this.z||0]},d.Vector.prototype.equals=function(a,b,c){var e,f,g;return a instanceof d.Vector?(e=a.x||0,f=a.y||0,g=a.z||0):a instanceof Array?(e=a[0]||0,f=a[1]||0,g=a[2]||0):(e=a||0,f=b||0,g=c||0),this.x===e&&this.y===f&&this.z===g},d.Vector.fromAngle=function(a){return this.p5&&this.p5._angleMode===f.DEGREES&&(a=e.degreesToRadians(a)),this.p5?new d.Vector(this.p5,[Math.cos(a),Math.sin(a),0]):new d.Vector(Math.cos(a),Math.sin(a),0)},d.Vector.random2D=function(){var a;return a=this.p5?this.p5._angleMode===f.DEGREES?this.p5.random(360):this.p5.random(f.TWO_PI):Math.random()*Math.PI*2,this.fromAngle(a)},d.Vector.random3D=function(){var a,b;this.p5?(a=this.p5.random(0,f.TWO_PI),b=this.p5.random(-1,1)):(a=Math.random()*Math.PI*2,b=2*Math.random()-1);var c=Math.sqrt(1-b*b)*Math.cos(a),e=Math.sqrt(1-b*b)*Math.sin(a);return this.p5?new d.Vector(this.p5,[c,e,b]):new d.Vector(c,e,b)},d.Vector.add=function(a,b,c){return c?c.set(a):c=a.copy(),c.add(b),c},d.Vector.sub=function(a,b,c){return c?c.set(a):c=a.copy(),c.sub(b),c},d.Vector.mult=function(a,b,c){return c?c.set(a):c=a.copy(),c.mult(b),c},d.Vector.div=function(a,b,c){return c?c.set(a):c=a.copy(),c.div(b),c},d.Vector.dot=function(a,b){return a.dot(b)},d.Vector.cross=function(a,b){return a.cross(b)},d.Vector.dist=function(a,b){return a.dist(b)},d.Vector.lerp=function(a,b,c,d){return d?d.set(a):d=a.copy(),d.lerp(b,c),d},d.Vector.angleBetween=function(a,b){var c=Math.acos(a.dot(b)/(a.mag()*b.mag()));return this.p5&&this.p5._angleMode===f.DEGREES&&(c=e.radiansToDegrees(c)),c},d.Vector.mag=function(a){var b=a.x,c=a.y,d=a.z,e=b*b+c*c+d*d;return Math.sqrt(e)},b.exports=d.Vector},{"../core/constants":41,"../core/core":42,"./polargeometry":72}],72:[function(a,b,c){b.exports={degreesToRadians:function(a){return 2*Math.PI*a/360},radiansToDegrees:function(a){return 360*a/(2*Math.PI)}}},{}],73:[function(a,b,c){"use strict";var d=a("../core/core"),e=!1,f=!1,g=0,h=function(){var a,b,c=4294967296,d=1664525,e=1013904223;return{setSeed:function(d){b=a=(null==d?Math.random()*c:d)>>>0},getSeed:function(){return a},rand:function(){return(b=(d*b+e)%c)/c}}}();d.prototype.randomSeed=function(a){h.setSeed(a),e=!0,f=!1},d.prototype.random=function(a,b){var c;if(c=e?h.rand():Math.random(),void 0===a)return c;if(void 0===b)return a instanceof Array?a[Math.floor(c*a.length)]:c*a;if(a>b){var d=a;a=b,b=d}return c*(b-a)+a},d.prototype.randomGaussian=function(a,b){var c,d,e,h;if(f)c=g,f=!1;else{do{d=this.random(2)-1,e=this.random(2)-1,h=d*d+e*e}while(h>=1);h=Math.sqrt(-2*Math.log(h)/h),c=d*h,g=e*h,f=!0}var i=a||0;return c*(b||1)+i},b.exports=d},{"../core/core":42}],74:[function(a,b,c){"use strict";var d=a("../core/core"),e=a("./polargeometry"),f=a("../core/constants");d.prototype._angleMode=f.RADIANS,d.prototype.acos=function(a){return this._angleMode===f.RADIANS?Math.acos(a):e.radiansToDegrees(Math.acos(a))},d.prototype.asin=function(a){return this._angleMode===f.RADIANS?Math.asin(a):e.radiansToDegrees(Math.asin(a))},d.prototype.atan=function(a){return this._angleMode===f.RADIANS?Math.atan(a):e.radiansToDegrees(Math.atan(a))},d.prototype.atan2=function(a,b){return this._angleMode===f.RADIANS?Math.atan2(a,b):e.radiansToDegrees(Math.atan2(a,b))},d.prototype.cos=function(a){return this._angleMode===f.RADIANS?Math.cos(a):Math.cos(this.radians(a))},d.prototype.sin=function(a){return this._angleMode===f.RADIANS?Math.sin(a):Math.sin(this.radians(a))},d.prototype.tan=function(a){return this._angleMode===f.RADIANS?Math.tan(a):Math.tan(this.radians(a))},d.prototype.degrees=function(a){return e.radiansToDegrees(a)},d.prototype.radians=function(a){return e.degreesToRadians(a)},d.prototype.angleMode=function(a){a!==f.DEGREES&&a!==f.RADIANS||(this._angleMode=a)},b.exports=d},{"../core/constants":41,"../core/core":42,"./polargeometry":72}],75:[function(a,b,c){"use strict";var d=a("../core/core");d.prototype.textAlign=function(a,b){return this._renderer.textAlign.apply(this._renderer,arguments)},d.prototype.textLeading=function(a){return this._renderer.textLeading.apply(this._renderer,arguments)},d.prototype.textSize=function(a){return this._renderer.textSize.apply(this._renderer,arguments)},d.prototype.textStyle=function(a){return this._renderer.textStyle.apply(this._renderer,arguments)},d.prototype.textWidth=function(a){return 0===a.length?0:this._renderer.textWidth.apply(this._renderer,arguments)},d.prototype.textAscent=function(){return this._renderer.textAscent()},d.prototype.textDescent=function(){return this._renderer.textDescent()},d.prototype._updateTextMetrics=function(){return this._renderer._updateTextMetrics()},b.exports=d},{"../core/core":42}],76:[function(a,b,c){"use strict";var d=a("../core/core"),e=a("../core/constants");a("../core/error_helpers"),d.prototype.text=function(a,b,c,d,e){return this._renderer._doFill||this._renderer._doStroke?this._renderer.text.apply(this._renderer,arguments):this},d.prototype.textFont=function(a,b){if(arguments.length){if(!a)throw Error("null font passed to textFont");return this._renderer._setProperty("_textFont",a),b&&(this._renderer._setProperty("_textSize",b),this._renderer._setProperty("_textLeading",b*e._DEFAULT_LEADMULT)),this._renderer._applyTextProperties()}return this._renderer._textFont},b.exports=d},{"../core/constants":41,"../core/core":42,"../core/error_helpers":45}],77:[function(a,b,c){"use strict";function d(a,b){for(var c=h(b,{sampleFactor:.1,simplifyThreshold:0}),d=n(a,0,1),f=d/(d*c.sampleFactor),g=[],i=0;i<d;i+=f)g.push(n(a,i));return c.simplifyThreshold&&e(g,c.simplifyThreshold),g}function e(a,b){b=void 0===b?0:b;for(var c=0,d=a.length-1;a.length>3&&d>=0;--d)j(i(a,d-1),i(a,d),i(a,d+1),b)&&(a.splice(d%a.length,1),c++);return c}function f(a){for(var b,c=[],d=0;d<a.length;d++)"M"===a[d].type&&(b&&c.push(b),b=[]),b.push(g(a[d]));return c.push(b),c}function g(a){var b=[a.type];return"M"===a.type||"L"===a.type?b.push(a.x,a.y):"C"===a.type?b.push(a.x1,a.y1,a.x2,a.y2,a.x,a.y):"Q"===a.type&&b.push(a.x1,a.y1,a.x,a.y),b}function h(a,b){if("object"!=typeof a)a=b;else for(var c in b)void 0===a[c]&&(a[c]=b[c]);return a}function i(a,b){var c=a.length;return a[b<0?b%c+c:b%c]}function j(a,b,c,d){if(!d)return 0===k(a,b,c);void 0===j.tmpPoint1&&(j.tmpPoint1=[],j.tmpPoint2=[]);var e=j.tmpPoint1,f=j.tmpPoint2;e.x=b.x-a.x,e.y=b.y-a.y,f.x=c.x-b.x,f.y=c.y-b.y;var g=e.x*f.x+e.y*f.y,h=Math.sqrt(e.x*e.x+e.y*e.y),i=Math.sqrt(f.x*f.x+f.y*f.y);return Math.acos(g/(h*i))<d}function k(a,b,c){return(b[0]-a[0])*(c[1]-a[1])-(c[0]-a[0])*(b[1]-a[1])}function l(a,b,c,d,e,f,g,h,i){var j=1-i,k=Math.pow(j,3),l=Math.pow(j,2),m=i*i,n=m*i,o=k*a+3*l*i*c+3*j*i*i*e+n*g,p=k*b+3*l*i*d+3*j*i*i*f+n*h,q=a+2*i*(c-a)+m*(e-2*c+a),r=b+2*i*(d-b)+m*(f-2*d+b),s=c+2*i*(e-c)+m*(g-2*e+c),t=d+2*i*(f-d)+m*(h-2*f+d),u=j*a+i*c,v=j*b+i*d,w=j*e+i*g,x=j*f+i*h,y=90-180*Math.atan2(q-s,r-t)/Math.PI;return(q>s||r<t)&&(y+=180),{x:o,y:p,m:{x:q,y:r},n:{x:s,y:t},start:{x:u,y:v},end:{x:w,y:x},alpha:y}}function m(a,b,c,d,e,f,g,h,i){return null==i?u(a,b,c,d,e,f,g,h):l(a,b,c,d,e,f,g,h,v(a,b,c,d,e,f,g,h,i))}function n(a,b,c){a=p(a);for(var d,e,f,g,h,i="",j={},k=0,n=0,o=a.length;n<o;n++){if(f=a[n],"M"===f[0])d=+f[1],e=+f[2];else{if(g=m(d,e,f[1],f[2],f[3],f[4],f[5],f[6]),k+g>b&&!c)return h=m(d,e,f[1],f[2],f[3],f[4],f[5],f[6],b-k),{x:h.x,y:h.y,alpha:h.alpha};k+=g,d=+f[5],e=+f[6]}i+=f.shift()+f}return j.end=i,h=c?k:l(d,e,f[0],f[1],f[2],f[3],f[4],f[5],1),h.alpha&&(h={x:h.x,y:h.y,alpha:h.alpha}),h}function o(a){var b=[],c=0,d=0,e=0,f=0,g=0;"M"===a[0][0]&&(c=+a[0][1],d=+a[0][2],e=c,f=d,g++,b[0]=["M",c,d]);for(var h,i,j,k=3===a.length&&"M"===a[0][0]&&"R"===a[1][0].toUpperCase()&&"Z"===a[2][0].toUpperCase(),l=g,m=a.length;l<m;l++){if(b.push(i=[]),j=a[l],
j[0]!==String.prototype.toUpperCase.call(j[0]))switch(i[0]=String.prototype.toUpperCase.call(j[0]),i[0]){case"A":i[1]=j[1],i[2]=j[2],i[3]=j[3],i[4]=j[4],i[5]=j[5],i[6]=+(j[6]+c),i[7]=+(j[7]+d);break;case"V":i[1]=+j[1]+d;break;case"H":i[1]=+j[1]+c;break;case"R":h=[c,d].concat(j.slice(1));for(var n=2,o=h.length;n<o;n++)h[n]=+h[n]+c,h[++n]=+h[n]+d;b.pop(),b=b.concat(r(h,k));break;case"M":e=+j[1]+c,f=+j[2]+d;break;default:for(n=1,o=j.length;n<o;n++)i[n]=+j[n]+(n%2?c:d)}else if("R"===j[0])h=[c,d].concat(j.slice(1)),b.pop(),b=b.concat(r(h,k)),i=["R"].concat(j.slice(-2));else for(var p=0,q=j.length;p<q;p++)i[p]=j[p];switch(i[0]){case"Z":c=e,d=f;break;case"H":c=i[1];break;case"V":d=i[1];break;case"M":e=i[i.length-2],f=i[i.length-1];break;default:c=i[i.length-2],d=i[i.length-1]}}return b}function p(a,b){for(var c=o(a),d=b&&o(b),e={x:0,y:0,bx:0,by:0,X:0,Y:0,qx:null,qy:null},f={x:0,y:0,bx:0,by:0,X:0,Y:0,qx:null,qy:null},g=(function(a,b,c){var d,e,f={T:1,Q:1};if(!a)return["C",b.x,b.y,b.x,b.y,b.x,b.y];switch(a[0]in f||(b.qx=b.qy=null),a[0]){case"M":b.X=a[1],b.Y=a[2];break;case"A":a=["C"].concat(q.apply(0,[b.x,b.y].concat(a.slice(1))));break;case"S":"C"===c||"S"===c?(d=2*b.x-b.bx,e=2*b.y-b.by):(d=b.x,e=b.y),a=["C",d,e].concat(a.slice(1));break;case"T":"Q"===c||"T"===c?(b.qx=2*b.x-b.qx,b.qy=2*b.y-b.qy):(b.qx=b.x,b.qy=b.y),a=["C"].concat(t(b.x,b.y,b.qx,b.qy,a[1],a[2]));break;case"Q":b.qx=a[1],b.qy=a[2],a=["C"].concat(t(b.x,b.y,a[1],a[2],a[3],a[4]));break;case"L":a=["C"].concat(s(b.x,b.y,a[1],a[2]));break;case"H":a=["C"].concat(s(b.x,b.y,a[1],b.y));break;case"V":a=["C"].concat(s(b.x,b.y,b.x,a[1]));break;case"Z":a=["C"].concat(s(b.x,b.y,b.X,b.Y))}return a}),h=function(a,b){if(a[b].length>7){a[b].shift();for(var e=a[b];e.length;)j[b]="A",d&&(k[b]="A"),a.splice(b++,0,["C"].concat(e.splice(0,6)));a.splice(b,1),p=Math.max(c.length,d&&d.length||0)}},i=function(a,b,e,f,g){a&&b&&"M"===a[g][0]&&"M"!==b[g][0]&&(b.splice(g,0,["M",f.x,f.y]),e.bx=0,e.by=0,e.x=a[g][1],e.y=a[g][2],p=Math.max(c.length,d&&d.length||0))},j=[],k=[],l="",m="",n=0,p=Math.max(c.length,d&&d.length||0);n<p;n++){c[n]&&(l=c[n][0]),"C"!==l&&(j[n]=l,n&&(m=j[n-1])),c[n]=g(c[n],e,m),"A"!==j[n]&&"C"===l&&(j[n]="C"),h(c,n),d&&(d[n]&&(l=d[n][0]),"C"!==l&&(k[n]=l,n&&(m=k[n-1])),d[n]=g(d[n],f,m),"A"!==k[n]&&"C"===l&&(k[n]="C"),h(d,n)),i(c,d,e,f,n),i(d,c,f,e,n);var r=c[n],u=d&&d[n],v=r.length,w=d&&u.length;e.x=r[v-2],e.y=r[v-1],e.bx=parseFloat(r[v-4])||e.x,e.by=parseFloat(r[v-3])||e.y,f.bx=d&&(parseFloat(u[w-4])||f.x),f.by=d&&(parseFloat(u[w-3])||f.y),f.x=d&&u[w-2],f.y=d&&u[w-1]}return d?[c,d]:c}function q(a,b,c,d,e,f,g,h,i,j){var k,l,m,n,o,p=Math.PI,r=120*p/180,s=p/180*(+e||0),t=[],u=function(a,b,c){return{x:a*Math.cos(c)-b*Math.sin(c),y:a*Math.sin(c)+b*Math.cos(c)}};if(j)k=j[0],l=j[1],m=j[2],n=j[3];else{o=u(a,b,-s),a=o.x,b=o.y,o=u(h,i,-s),h=o.x,i=o.y;var v=(a-h)/2,w=(b-i)/2,x=v*v/(c*c)+w*w/(d*d);x>1&&(x=Math.sqrt(x),c*=x,d*=x);var y=c*c,z=d*d,A=(f===g?-1:1)*Math.sqrt(Math.abs((y*z-y*w*w-z*v*v)/(y*w*w+z*v*v)));m=A*c*w/d+(a+h)/2,n=A*-d*v/c+(b+i)/2,k=Math.asin(((b-n)/d).toFixed(9)),l=Math.asin(((i-n)/d).toFixed(9)),k=a<m?p-k:k,l=h<m?p-l:l,k<0&&(k=2*p+k),l<0&&(l=2*p+l),g&&k>l&&(k-=2*p),!g&&l>k&&(l-=2*p)}var B=l-k;if(Math.abs(B)>r){var C=l,D=h,E=i;l=k+r*(g&&l>k?1:-1),h=m+c*Math.cos(l),i=n+d*Math.sin(l),t=q(h,i,c,d,e,0,g,D,E,[l,C,m,n])}B=l-k;var F=Math.cos(k),G=Math.sin(k),H=Math.cos(l),I=Math.sin(l),J=Math.tan(B/4),K=4/3*c*J,L=4/3*d*J,M=[a,b],N=[a+K*G,b-L*F],O=[h+K*I,i-L*H],P=[h,i];if(N[0]=2*M[0]-N[0],N[1]=2*M[1]-N[1],j)return[N,O,P].concat(t);t=[N,O,P].concat(t).join().split(",");for(var Q=[],R=0,S=t.length;R<S;R++)Q[R]=R%2?u(t[R-1],t[R],s).y:u(t[R],t[R+1],s).x;return Q}function r(a,b){for(var c=[],d=0,e=a.length;e-2*!b>d;d+=2){var f=[{x:+a[d-2],y:+a[d-1]},{x:+a[d],y:+a[d+1]},{x:+a[d+2],y:+a[d+3]},{x:+a[d+4],y:+a[d+5]}];b?d?e-4===d?f[3]={x:+a[0],y:+a[1]}:e-2===d&&(f[2]={x:+a[0],y:+a[1]},f[3]={x:+a[2],y:+a[3]}):f[0]={x:+a[e-2],y:+a[e-1]}:e-4===d?f[3]=f[2]:d||(f[0]={x:+a[d],y:+a[d+1]}),c.push(["C",(-f[0].x+6*f[1].x+f[2].x)/6,(-f[0].y+6*f[1].y+f[2].y)/6,(f[1].x+6*f[2].x-f[3].x)/6,(f[1].y+6*f[2].y-f[3].y)/6,f[2].x,f[2].y])}return c}function s(a,b,c,d){return[a,b,c,d,c,d]}function t(a,b,c,d,e,f){var g=1/3,h=2/3;return[g*a+h*c,g*b+h*d,g*e+h*c,g*f+h*d,e,f]}function u(a,b,c,d,e,f,g,h,i){null==i&&(i=1),i=i>1?1:i<0?0:i;for(var j=i/2,k=12,l=[-.1252,.1252,-.3678,.3678,-.5873,.5873,-.7699,.7699,-.9041,.9041,-.9816,.9816],m=0,n=[.2491,.2491,.2335,.2335,.2032,.2032,.1601,.1601,.1069,.1069,.0472,.0472],o=0;o<k;o++){var p=j*l[o]+j,q=w(p,a,c,e,g),r=w(p,b,d,f,h),s=q*q+r*r;m+=n[o]*Math.sqrt(s)}return j*m}function v(a,b,c,d,e,f,g,h,i){if(!(i<0||u(a,b,c,d,e,f,g,h)<i)){var j,k=1,l=k/2,m=k-l,n=.01;for(j=u(a,b,c,d,e,f,g,h,m);Math.abs(j-i)>n;)l/=2,m+=(j<i?1:-1)*l,j=u(a,b,c,d,e,f,g,h,m);return m}}function w(a,b,c,d,e){return a*(a*(-3*b+9*c-9*d+3*e)+6*b-12*c+6*d)-3*b+3*c}function x(){for(var a=new Array(arguments.length),b=0;b<a.length;++b)a[b]=arguments[b];b=a.length;for(var c="";b--;)c+=a[b]===Object(a[b])?JSON.stringify(a[b]):a[b];return c}var y=a("../core/core"),z=a("../core/constants");y.Font=function(a){this.parent=a,this.cache={},this.font=void 0},y.Font.prototype.list=function(){throw"not yet implemented"},y.Font.prototype.textBounds=function(a,b,c,d,e){b=void 0!==b?b:0,c=void 0!==c?c:0,d=d||this.parent._renderer._textSize;var f=e&&e.renderer&&e.renderer._pInst||this.parent,g=f._renderer.drawingContext,h=g.textAlign||z.LEFT,i=g.textBaseline||z.BASELINE,j=this.cache[x("textBounds",a,b,c,d,h,i)];if(!j){var k,l,m,n,o=[],p=[],q=this,r=this._scale(d);this.font.forEachGlyph(a,b,c,d,e,function(a,b,c,e){o.push(b),p.push(c);var f=a.getMetrics();"space"!==a.name&&32!==a.unicode?(o.push(b+f.xMax*r),p.push(c+-f.yMin*r),p.push(c+-f.yMax*r)):o.push(b+q.font.charToGlyph(" ").advanceWidth*q._scale(d))}),k=Math.min.apply(null,o),l=Math.min.apply(null,p),m=Math.max.apply(null,o),n=Math.max.apply(null,p),j={x:k,y:l,h:n-l,w:m-k,advance:k-b};var s=j.w+j.advance,t=this._handleAlignment(f,g,a,j.x,j.y,s);j.x=t.x,j.y=t.y,this.cache[x("textBounds",a,b,c,d,h,i)]=j}return j},y.Font.prototype.textToPoints=function(a,b,c,e,g){var h=0,i=[],j=this._getGlyphs(a);e=e||this.parent._renderer._textSize;for(var k=0;k<j.length;k++){if("space"!==j[k].name)for(var l=j[k].getPath(b,c,e),m=f(l.commands),n=0;n<m.length;n++)for(var o=d(m[n],g),p=0;p<o.length;p++)o[p].x+=h,i.push(o[p]);h+=j[k].advanceWidth*this._scale(e)}return i},y.Font.prototype._getGlyphs=function(a){return this.font.stringToGlyphs(a)},y.Font.prototype._getPath=function(a,b,c,d){var e=d&&d.renderer&&d.renderer._pInst||this.parent,f=e._renderer.drawingContext,g=this._handleAlignment(e,f,a,b,c);return this.font.getPath(a,g.x,g.y,e._renderer._textSize,d)},y.Font.prototype._getPathData=function(a,b,c,d){var e=3;return"string"==typeof a&&arguments.length>2?a=this._getPath(a,b,c,d):"object"==typeof b&&(d=b),d&&"number"==typeof d.decimals&&(e=d.decimals),a.toPathData(e)},y.Font.prototype._getSVG=function(a,b,c,d){var e=3;return"string"==typeof a&&arguments.length>2?a=this._getPath(a,b,c,d):"object"==typeof b&&(d=b),d&&("number"==typeof d.decimals&&(e=d.decimals),"number"==typeof d.strokeWidth&&(a.strokeWidth=d.strokeWidth),void 0!==d.fill&&(a.fill=d.fill),void 0!==d.stroke&&(a.stroke=d.stroke)),a.toSVG(e)},y.Font.prototype._renderPath=function(a,b,c,d){var e,f=d&&d.renderer||this.parent._renderer,g=f.drawingContext;e="object"==typeof a&&a.commands?a.commands:this._getPath(a,b,c,d).commands,g.beginPath();for(var h=0;h<e.length;h+=1){var i=e[h];"M"===i.type?g.moveTo(i.x,i.y):"L"===i.type?g.lineTo(i.x,i.y):"C"===i.type?g.bezierCurveTo(i.x1,i.y1,i.x2,i.y2,i.x,i.y):"Q"===i.type?g.quadraticCurveTo(i.x1,i.y1,i.x,i.y):"Z"===i.type&&g.closePath()}return f._doStroke&&f._strokeSet&&g.stroke(),f._doFill&&(g.fillStyle=f._fillSet?g.fillStyle:z._DEFAULT_TEXT_FILL,g.fill()),this},y.Font.prototype._textWidth=function(a,b){if(" "===a)return this.font.charToGlyph(" ").advanceWidth*this._scale(b);var c=this.textBounds(a,0,0,b);return c.w+c.advance},y.Font.prototype._textAscent=function(a){return this.font.ascender*this._scale(a)},y.Font.prototype._textDescent=function(a){return-this.font.descender*this._scale(a)},y.Font.prototype._scale=function(a){return 1/this.font.unitsPerEm*(a||this.parent._renderer._textSize)},y.Font.prototype._handleAlignment=function(a,b,c,d,e,f){var g=a._renderer._textSize,h=this._textAscent(g),i=this._textDescent(g);return f=void 0!==f?f:this._textWidth(c,g),b.textAlign===z.CENTER?d-=f/2:b.textAlign===z.RIGHT&&(d-=f),b.textBaseline===z.TOP?e+=h:b.textBaseline===z._CTX_MIDDLE?e+=h/2:b.textBaseline===z.BOTTOM&&(e-=i),{x:d,y:e}},b.exports=y.Font},{"../core/constants":41,"../core/core":42}],78:[function(a,b,c){"use strict";var d=a("../core/core");d.prototype.append=function(a,b){return a.push(b),a},d.prototype.arrayCopy=function(a,b,c,d,e){var f,g;void 0!==e?(g=Math.min(e,a.length),f=d,a=a.slice(b,g+b)):(void 0!==c?(g=c,g=Math.min(g,a.length)):g=a.length,f=0,c=b,a=a.slice(0,g)),Array.prototype.splice.apply(c,[f,g].concat(a))},d.prototype.concat=function(a,b){return a.concat(b)},d.prototype.reverse=function(a){return a.reverse()},d.prototype.shorten=function(a){return a.pop(),a},d.prototype.shuffle=function(a,b){var c=ArrayBuffer&&ArrayBuffer.isView&&ArrayBuffer.isView(a);a=b||c?a:a.slice();for(var d,e,f=a.length;f>1;)d=Math.random()*f|0,e=a[--f],a[f]=a[d],a[d]=e;return a},d.prototype.sort=function(a,b){var c=b?a.slice(0,Math.min(b,a.length)):a,d=b?a.slice(Math.min(b,a.length)):[];return c="string"==typeof c[0]?c.sort():c.sort(function(a,b){return a-b}),c.concat(d)},d.prototype.splice=function(a,b,c){return Array.prototype.splice.apply(a,[c,0].concat(b)),a},d.prototype.subset=function(a,b,c){return void 0!==c?a.slice(b,b+c):a.slice(b,a.length)},b.exports=d},{"../core/core":42}],79:[function(a,b,c){"use strict";var d=a("../core/core");d.prototype.float=function(a){return a instanceof Array?a.map(parseFloat):parseFloat(a)},d.prototype.int=function(a,b){return b=b||10,"string"==typeof a?parseInt(a,b):"number"==typeof a?0|a:"boolean"==typeof a?a?1:0:a instanceof Array?a.map(function(a){return d.prototype.int(a,b)}):void 0},d.prototype.str=function(a){return a instanceof Array?a.map(d.prototype.str):String(a)},d.prototype.boolean=function(a){return"number"==typeof a?0!==a:"string"==typeof a?"true"===a.toLowerCase():"boolean"==typeof a?a:a instanceof Array?a.map(d.prototype.boolean):void 0},d.prototype.byte=function(a){var b=d.prototype.int(a,10);return"number"==typeof b?(b+128)%256-128:b instanceof Array?b.map(d.prototype.byte):void 0},d.prototype.char=function(a){return"number"!=typeof a||isNaN(a)?a instanceof Array?a.map(d.prototype.char):"string"==typeof a?d.prototype.char(parseInt(a,10)):void 0:String.fromCharCode(a)},d.prototype.unchar=function(a){return"string"==typeof a&&1===a.length?a.charCodeAt(0):a instanceof Array?a.map(d.prototype.unchar):void 0},d.prototype.hex=function(a,b){if(b=void 0===b||null===b?b=8:b,a instanceof Array)return a.map(function(a){return d.prototype.hex(a,b)});if("number"==typeof a){a<0&&(a=4294967295+a+1);for(var c=Number(a).toString(16).toUpperCase();c.length<b;)c="0"+c;return c.length>=b&&(c=c.substring(c.length-b,c.length)),c}},d.prototype.unhex=function(a){return a instanceof Array?a.map(d.prototype.unhex):parseInt("0x"+a,16)},b.exports=d},{"../core/core":42}],80:[function(a,b,c){"use strict";function d(){var a=arguments[0],b=a<0,c=b?a.toString().substring(1):a.toString(),d=c.indexOf("."),e=d!==-1?c.substring(0,d):c,f=d!==-1?c.substring(d+1):"",g=b?"-":"";if(3===arguments.length){var h="";(d!==-1||arguments[2]-f.length>0)&&(h="."),f.length>arguments[2]&&(f=f.substring(0,arguments[2]));for(var i=0;i<arguments[1]-e.length;i++)g+="0";g+=e,g+=h,g+=f;for(var j=0;j<arguments[2]-f.length;j++)g+="0";return g}for(var k=0;k<Math.max(arguments[1]-e.length,0);k++)g+="0";return g+=c}function e(){var a=arguments[0].toString(),b=a.indexOf("."),c=b!==-1?a.substring(b):"",d=b!==-1?a.substring(0,b):a;if(d=d.toString().replace(/\B(?=(\d{3})+(?!\d))/g,","),0===arguments[1])c="";else if(void 0!==arguments[1])if(arguments[1]>c.length){c+=b===-1?".":"";for(var e=arguments[1]-c.length+1,f=0;f<e;f++)c+="0"}else c=c.substring(0,arguments[1]+1);return d+c}function f(){return parseFloat(arguments[0])>0?"+"+arguments[0].toString():arguments[0].toString()}function g(){return parseFloat(arguments[0])>0?" "+arguments[0].toString():arguments[0].toString()}var h=a("../core/core");h.prototype.join=function(a,b){return a.join(b)},h.prototype.match=function(a,b){return a.match(b)},h.prototype.matchAll=function(a,b){for(var c=new RegExp(b,"g"),d=c.exec(a),e=[];null!==d;)e.push(d),d=c.exec(a);return e},h.prototype.nf=function(){if(arguments[0]instanceof Array){var a=arguments[1],b=arguments[2];return arguments[0].map(function(c){return d(c,a,b)})}return"[object Arguments]"===Object.prototype.toString.call(arguments[0])?3===arguments[0].length?this.nf(arguments[0][0],arguments[0][1],arguments[0][2]):2===arguments[0].length?this.nf(arguments[0][0],arguments[0][1]):this.nf(arguments[0][0]):d.apply(this,arguments)},h.prototype.nfc=function(){if(arguments[0]instanceof Array){var a=arguments[1];return arguments[0].map(function(b){return e(b,a)})}return e.apply(this,arguments)},h.prototype.nfp=function(){var a=this.nf.apply(this,arguments);return a instanceof Array?a.map(f):f(a)},h.prototype.nfs=function(){var a=this.nf.apply(this,arguments);return a instanceof Array?a.map(g):g(a)},h.prototype.split=function(a,b){return a.split(b)},h.prototype.splitTokens=function(){var a,b,c,d;return d=arguments[1],arguments.length>1?(c=/\]/g.exec(d),b=/\[/g.exec(d),b&&c?(d=d.slice(0,c.index)+d.slice(c.index+1),b=/\[/g.exec(d),d=d.slice(0,b.index)+d.slice(b.index+1),a=new RegExp("[\\["+d+"\\]]","g")):c?(d=d.slice(0,c.index)+d.slice(c.index+1),a=new RegExp("["+d+"\\]]","g")):b?(d=d.slice(0,b.index)+d.slice(b.index+1),a=new RegExp("["+d+"\\[]","g")):a=new RegExp("["+d+"]","g")):a=/\s/g,arguments[0].split(a).filter(function(a){return a})},h.prototype.trim=function(a){return a instanceof Array?a.map(this.trim):a.trim()},b.exports=h},{"../core/core":42}],81:[function(a,b,c){"use strict";var d=a("../core/core");d.prototype.day=function(){return(new Date).getDate()},d.prototype.hour=function(){return(new Date).getHours()},d.prototype.minute=function(){return(new Date).getMinutes()},d.prototype.millis=function(){return window.performance.now()},d.prototype.month=function(){return(new Date).getMonth()+1},d.prototype.second=function(){return(new Date).getSeconds()},d.prototype.year=function(){return(new Date).getFullYear()},b.exports=d},{"../core/core":42}],82:[function(a,b,c){"use strict";var d=a("../core/core");d.prototype.camera=function(a,b,c){this._renderer.translate(-a,-b,-c)},d.prototype.perspective=function(a,b,c,e){a=a||60/180*this.PI,b=b||this.width/this.height,c=c||this.height/2/this.tan(a/2)*.1,e=e||this.height/2/this.tan(a/2)*10,this._renderer.uPMatrix=d.Matrix.identity(),this._renderer.uPMatrix.perspective(a,b,c,e),this._renderer._curCamera="custom"},d.prototype.ortho=function(a,b,c,e,f,g){a=a||-this.width/2,b=b||this.width/2,c=c||-this.height/2,e=e||this.height/2,f=f||0,g=g||Math.max(this.width,this.height),this._renderer.uPMatrix=d.Matrix.identity(),this._renderer.uPMatrix.ortho(a,b,c,e,f,g),this._renderer._curCamera="custom"},b.exports=d},{"../core/core":42}],83:[function(a,b,c){"use strict";var d=a("../core/core");d.prototype.orbitControl=function(){return this.mouseIsPressed&&(this.rotateY((this.mouseX-this.width/2)/(this.width/2)),this.rotateX((this.mouseY-this.height/2)/(this.width/2))),this},b.exports=d},{"../core/core":42}],84:[function(a,b,c){"use strict";var d=a("../core/core");d.prototype.ambientLight=function(a,b,c,d){var e=this._renderer.GL,f=this._renderer._getShader("lightVert","lightTextureFrag");e.useProgram(f),f.uAmbientColor=e.getUniformLocation(f,"uAmbientColor["+this._renderer.ambientLightCount+"]");var g=this._renderer._pInst.color.apply(this._renderer._pInst,arguments),h=g._array;return e.uniform3f(f.uAmbientColor,h[0],h[1],h[2]),f.uMaterialColor=e.getUniformLocation(f,"uMaterialColor"),e.uniform4f(f.uMaterialColor,1,1,1,1),this._renderer.ambientLightCount++,f.uAmbientLightCount=e.getUniformLocation(f,"uAmbientLightCount"),e.uniform1i(f.uAmbientLightCount,this._renderer.ambientLightCount),this},d.prototype.directionalLight=function(a,b,c,d,e,f,g){var h=this._renderer.GL,i=this._renderer._getShader("lightVert","lightTextureFrag");h.useProgram(i),i.uDirectionalColor=h.getUniformLocation(i,"uDirectionalColor["+this._renderer.directionalLightCount+"]");var j=this._renderer._pInst.color.apply(this._renderer._pInst,[a,b,c]),k=j._array;h.uniform3f(i.uDirectionalColor,k[0],k[1],k[2]);for(var l,m,n,o=new Array(arguments.length),p=0;p<o.length;++p)o[p]=arguments[p];if("number"==typeof o[o.length-1])l=o[o.length-3],m=o[o.length-2],n=o[o.length-1];else try{l=o[o.length-1].x,m=o[o.length-1].y,n=o[o.length-1].z}catch(a){throw a}return i.uLightingDirection=h.getUniformLocation(i,"uLightingDirection["+this._renderer.directionalLightCount+"]"),h.uniform3f(i.uLightingDirection,l,m,n),i.uMaterialColor=h.getUniformLocation(i,"uMaterialColor"),h.uniform4f(i.uMaterialColor,1,1,1,1),this._renderer.directionalLightCount++,i.uDirectionalLightCount=h.getUniformLocation(i,"uDirectionalLightCount"),h.uniform1i(i.uDirectionalLightCount,this._renderer.directionalLightCount),this},d.prototype.pointLight=function(a,b,c,d,e,f,g){var h=this._renderer.GL,i=this._renderer._getShader("lightVert","lightTextureFrag");h.useProgram(i),i.uPointLightColor=h.getUniformLocation(i,"uPointLightColor["+this._renderer.pointLightCount+"]");var j=this._renderer._pInst.color.apply(this._renderer._pInst,[a,b,c]),k=j._array;h.uniform3f(i.uPointLightColor,k[0],k[1],k[2]);for(var l,m,n,o=new Array(arguments.length),p=0;p<o.length;++p)o[p]=arguments[p];if("number"==typeof o[o.length-1])l=o[o.length-3],m=o[o.length-2],n=o[o.length-1];else try{l=o[o.length-1].x,m=o[o.length-1].y,n=o[o.length-1].z}catch(a){throw a}return i.uPointLightLocation=h.getUniformLocation(i,"uPointLightLocation["+this._renderer.pointLightCount+"]"),h.uniform3f(i.uPointLightLocation,l,m,n),i.uMaterialColor=h.getUniformLocation(i,"uMaterialColor"),h.uniform4f(i.uMaterialColor,1,1,1,1),this._renderer.pointLightCount++,i.uPointLightCount=h.getUniformLocation(i,"uPointLightCount"),h.uniform1i(i.uPointLightCount,this._renderer.pointLightCount),this},b.exports=d},{"../core/core":42}],85:[function(a,b,c){"use strict";function d(a,b){for(var c={v:[],vt:[],vn:[]},d={},f=0;f<b.length;++f){var g=b[f].trim().split(/\b\s+/);if(g.length>0)if("v"===g[0]||"vn"===g[0]){var h=new e.Vector(parseFloat(g[1]),parseFloat(g[2]),parseFloat(g[3]));c[g[0]].push(h)}else if("vt"===g[0]){var i=[parseFloat(g[1]),parseFloat(g[2])];c[g[0]].push(i)}else if("f"===g[0])for(var j=3;j<g.length;++j){for(var k=[],l=[1,j-1,j],m=0;m<l.length;++m){var n=g[l[m]],o=0;if(void 0!==d[n])o=d[n];else{for(var p=n.split("/"),q=0;q<p.length;q++)p[q]=parseInt(p[q])-1;o=d[n]=a.vertices.length,a.vertices.push(c.v[p[0]].copy()),c.vt[p[1]]?a.uvs.push(c.vt[p[1]].slice()):a.uvs.push([0,0]),c.vn[p[2]]&&a.vertexNormals.push(c.vn[p[2]].copy())}k.push(o)}a.faces.push(k)}}return 0===a.vertexNormals.length&&a.computeNormals(),a}var e=a("../core/core");a("./p5.Geometry"),e.prototype.loadModel=function(){var a,b,c,f=arguments[0];"boolean"==typeof arguments[1]?(a=arguments[1],b=arguments[2],c=arguments[3]):(a=!1,b=arguments[1],c=arguments[2]);var g=new e.Geometry;return g.gid=f+"|"+a,this.loadStrings(f,function(c){d(g,c),a&&g.normalize(),"function"==typeof b&&b(g)}.bind(this),c),g},e.prototype.model=function(a){a.vertices.length>0&&(this._renderer.geometryInHash(a.gid)||this._renderer.createBuffers(a.gid,a),this._renderer.drawBuffers(a.gid))},b.exports=e},{"../core/core":42,"./p5.Geometry":87}],86:[function(a,b,c){"use strict";var d=a("../core/core");d.prototype.normalMaterial=function(){return this._renderer._getShader("normalVert","normalFrag"),this},d.prototype.texture=function(){for(var a=new Array(arguments.length),b=0;b<a.length;++b)a[b]=arguments[b];var c=this._renderer.GL;this._renderer.drawMode="texture";var e=this._renderer._getShader("lightVert","lightTextureFrag");c.useProgram(e);var f;if(a[0].isTexture)a[0]instanceof d.Graphics||void 0!==d.MediaElement&&a[0]instanceof d.MediaElement?f=a[0].elt:a[0]instanceof d.Image&&(f=a[0].canvas),this._renderer._bind.call(this,a[0].tex,f);else{if(a[0]instanceof d.Image)f=a[0].canvas;else if(void 0!==d.MediaElement&&a[0]instanceof d.MediaElement){if(!a[0].loadedmetadata)return;f=a[0].elt}else a[0]instanceof d.Graphics&&(f=a[0].elt);var g=c.createTexture();a[0]._setProperty("tex",g),a[0]._setProperty("isTexture",!0),this._renderer._bind.call(this,g,f)}return c.activeTexture(c.TEXTURE0),c.bindTexture(c.TEXTURE_2D,a[0].tex),c.uniform1i(c.getUniformLocation(e,"isTexture"),!0),c.uniform1i(c.getUniformLocation(e,"uSampler"),0),this},d.RendererGL.prototype._bind=function(a,b){var c=this._renderer.GL;c.bindTexture(c.TEXTURE_2D,a),c.pixelStorei(c.UNPACK_FLIP_Y_WEBGL,!0),c.texImage2D(c.TEXTURE_2D,0,c.RGBA,c.RGBA,c.UNSIGNED_BYTE,b),c.pixelStorei(c.UNPACK_FLIP_Y_WEBGL,!0),c.texParameteri(c.TEXTURE_2D,c.TEXTURE_MAG_FILTER,c.LINEAR),c.texParameteri(c.TEXTURE_2D,c.TEXTURE_MIN_FILTER,c.LINEAR),c.texParameteri(c.TEXTURE_2D,c.TEXTURE_WRAP_S,c.CLAMP_TO_EDGE),c.texParameteri(c.TEXTURE_2D,c.TEXTURE_WRAP_T,c.CLAMP_TO_EDGE),c.bindTexture(c.TEXTURE_2D,null)},d.prototype.ambientMaterial=function(a,b,c,d){var e=this._renderer.GL,f=this._renderer._getShader("lightVert","lightTextureFrag");e.useProgram(f),f.uMaterialColor=e.getUniformLocation(f,"uMaterialColor");var g=this._renderer._applyColorBlend.apply(this._renderer,arguments);return e.uniform4f(f.uMaterialColor,g[0],g[1],g[2],g[3]),f.uSpecular=e.getUniformLocation(f,"uSpecular"),e.uniform1i(f.uSpecular,!1),e.uniform1i(e.getUniformLocation(f,"isTexture"),!1),this},d.prototype.specularMaterial=function(a,b,c,d){var e=this._renderer.GL,f=this._renderer._getShader("lightVert","lightTextureFrag");e.useProgram(f),e.uniform1i(e.getUniformLocation(f,"isTexture"),!1),f.uMaterialColor=e.getUniformLocation(f,"uMaterialColor");var g=this._renderer._applyColorBlend.apply(this._renderer,arguments);return e.uniform4f(f.uMaterialColor,g[0],g[1],g[2],g[3]),f.uSpecular=e.getUniformLocation(f,"uSpecular"),e.uniform1i(f.uSpecular,!0),this},d.RendererGL.prototype._applyColorBlend=function(a,b,c,d){var e=this.GL,f=this._pInst.color.apply(this._pInst,arguments),g=f._array;return g[g.length-1]<1?(e.depthMask(!1),e.enable(e.BLEND),e.blendEquation(e.FUNC_ADD),e.blendFunc(e.SRC_ALPHA,e.ONE_MINUS_SRC_ALPHA)):(e.depthMask(!0),e.disable(e.BLEND)),g},b.exports=d},{"../core/core":42}],87:[function(a,b,c){"use strict";var d=a("../core/core");d.Geometry=function(a,b,c){return this.vertices=[],this.vertexNormals=[],this.faces=[],this.uvs=[],this.detailX=void 0!==a?a:1,this.detailY=void 0!==b?b:1,c instanceof Function&&c.call(this),this},d.Geometry.prototype.computeFaces=function(){for(var a,b,c,d,e=this.detailX+1,f=0;f<this.detailY;f++)for(var g=0;g<this.detailX;g++)a=f*e+g,b=f*e+g+1,c=(f+1)*e+g+1,d=(f+1)*e+g,this.faces.push([a,b,d]),this.faces.push([d,b,c]);return this},d.Geometry.prototype._getFaceNormal=function(a,b){var c=this.faces[a],e=this.vertices[c[b%3]],f=this.vertices[c[(b+1)%3]],g=this.vertices[c[(b+2)%3]],h=d.Vector.cross(d.Vector.sub(f,e),d.Vector.sub(g,e)),i=d.Vector.mag(h)/(d.Vector.mag(d.Vector.sub(f,e))*d.Vector.mag(d.Vector.sub(g,e)));return h=h.normalize(),h.mult(Math.asin(i))},d.Geometry.prototype.computeNormals=function(){for(var a=0;a<this.vertices.length;a++){for(var b=new d.Vector,c=0;c<this.faces.length;c++)this.faces[c][0]!==a&&this.faces[c][1]!==a&&this.faces[c][2]!==a||(b=b.add(this._getFaceNormal(c,a)));b=b.normalize(),this.vertexNormals.push(b)}return this},d.Geometry.prototype.averageNormals=function(){for(var a=0;a<=this.detailY;a++){var b=this.detailX+1,c=d.Vector.add(this.vertexNormals[a*b],this.vertexNormals[a*b+this.detailX]);c=d.Vector.div(c,2),this.vertexNormals[a*b]=c,this.vertexNormals[a*b+this.detailX]=c}return this},d.Geometry.prototype.averagePoleNormals=function(){for(var a=new d.Vector(0,0,0),b=0;b<this.detailX;b++)a.add(this.vertexNormals[b]);for(a=d.Vector.div(a,this.detailX),b=0;b<this.detailX;b++)this.vertexNormals[b]=a;for(a=new d.Vector(0,0,0),b=this.vertices.length-1;b>this.vertices.length-1-this.detailX;b--)a.add(this.vertexNormals[b]);for(a=d.Vector.div(a,this.detailX),b=this.vertices.length-1;b>this.vertices.length-1-this.detailX;b--)this.vertexNormals[b]=a;return this},d.Geometry.prototype.normalize=function(){if(this.vertices.length>0){for(var a=this.vertices[0].copy(),b=this.vertices[0].copy(),c=0;c<this.vertices.length;c++)a.x=Math.max(a.x,this.vertices[c].x),b.x=Math.min(b.x,this.vertices[c].x),a.y=Math.max(a.y,this.vertices[c].y),b.y=Math.min(b.y,this.vertices[c].y),a.z=Math.max(a.z,this.vertices[c].z),b.z=Math.min(b.z,this.vertices[c].z);var e=d.Vector.lerp(a,b,.5),f=d.Vector.sub(a,b),g=Math.max(Math.max(f.x,f.y),f.z),h=200/g;for(c=0;c<this.vertices.length;c++)this.vertices[c].sub(e),this.vertices[c].mult(h)}return this},b.exports=d.Geometry},{"../core/core":42}],88:[function(a,b,c){"use strict";var d=a("../core/core"),e=a("../math/polargeometry"),f=a("../core/constants"),g="undefined"!=typeof Float32Array?Float32Array:Array;d.Matrix=function(){for(var a=new Array(arguments.length),b=0;b<a.length;++b)a[b]=arguments[b];return a[0]instanceof d?(this.p5=a[0],"mat3"===a[1]?this.mat3=a[2]||new g([1,0,0,0,1,0,0,0,1]):this.mat4=a[1]||new g([1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1])):"mat3"===a[0]?this.mat3=a[1]||new g([1,0,0,0,1,0,0,0,1]):this.mat4=a[0]||new g([1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]),this},d.Matrix.prototype.set=function(a){return a instanceof d.Matrix?(this.mat4=a.mat4,this):a instanceof g?(this.mat4=a,this):this},d.Matrix.prototype.get=function(){return new d.Matrix(this.mat4)},d.Matrix.prototype.copy=function(){var a=new d.Matrix;return a.mat4[0]=this.mat4[0],a.mat4[1]=this.mat4[1],a.mat4[2]=this.mat4[2],a.mat4[3]=this.mat4[3],a.mat4[4]=this.mat4[4],a.mat4[5]=this.mat4[5],a.mat4[6]=this.mat4[6],a.mat4[7]=this.mat4[7],a.mat4[8]=this.mat4[8],a.mat4[9]=this.mat4[9],a.mat4[10]=this.mat4[10],a.mat4[11]=this.mat4[11],a.mat4[12]=this.mat4[12],a.mat4[13]=this.mat4[13],a.mat4[14]=this.mat4[14],a.mat4[15]=this.mat4[15],a},d.Matrix.identity=function(){return new d.Matrix},d.Matrix.prototype.transpose=function(a){var b,c,e,f,h,i;return a instanceof d.Matrix?(b=a.mat4[1],c=a.mat4[2],e=a.mat4[3],f=a.mat4[6],h=a.mat4[7],i=a.mat4[11],this.mat4[0]=a.mat4[0],this.mat4[1]=a.mat4[4],this.mat4[2]=a.mat4[8],this.mat4[3]=a.mat4[12],this.mat4[4]=b,this.mat4[5]=a.mat4[5],this.mat4[6]=a.mat4[9],this.mat4[7]=a.mat4[13],this.mat4[8]=c,this.mat4[9]=f,this.mat4[10]=a.mat4[10],this.mat4[11]=a.mat4[14],this.mat4[12]=e,this.mat4[13]=h,this.mat4[14]=i,this.mat4[15]=a.mat4[15]):a instanceof g&&(b=a[1],c=a[2],e=a[3],f=a[6],h=a[7],i=a[11],this.mat4[0]=a[0],this.mat4[1]=a[4],this.mat4[2]=a[8],this.mat4[3]=a[12],this.mat4[4]=b,this.mat4[5]=a[5],this.mat4[6]=a[9],this.mat4[7]=a[13],this.mat4[8]=c,this.mat4[9]=f,this.mat4[10]=a[10],this.mat4[11]=a[14],this.mat4[12]=e,this.mat4[13]=h,this.mat4[14]=i,this.mat4[15]=a[15]),this},d.Matrix.prototype.invert=function(a){var b,c,e,f,h,i,j,k,l,m,n,o,p,q,r,s;a instanceof d.Matrix?(b=a.mat4[0],c=a.mat4[1],e=a.mat4[2],f=a.mat4[3],h=a.mat4[4],i=a.mat4[5],j=a.mat4[6],k=a.mat4[7],l=a.mat4[8],m=a.mat4[9],n=a.mat4[10],o=a.mat4[11],p=a.mat4[12],q=a.mat4[13],r=a.mat4[14],s=a.mat4[15]):a instanceof g&&(b=a[0],c=a[1],e=a[2],f=a[3],h=a[4],i=a[5],j=a[6],k=a[7],l=a[8],m=a[9],n=a[10],o=a[11],p=a[12],q=a[13],r=a[14],s=a[15]);var t=b*i-c*h,u=b*j-e*h,v=b*k-f*h,w=c*j-e*i,x=c*k-f*i,y=e*k-f*j,z=l*q-m*p,A=l*r-n*p,B=l*s-o*p,C=m*r-n*q,D=m*s-o*q,E=n*s-o*r,F=t*E-u*D+v*C+w*B-x*A+y*z;return F?(F=1/F,this.mat4[0]=(i*E-j*D+k*C)*F,this.mat4[1]=(e*D-c*E-f*C)*F,this.mat4[2]=(q*y-r*x+s*w)*F,this.mat4[3]=(n*x-m*y-o*w)*F,this.mat4[4]=(j*B-h*E-k*A)*F,this.mat4[5]=(b*E-e*B+f*A)*F,this.mat4[6]=(r*v-p*y-s*u)*F,this.mat4[7]=(l*y-n*v+o*u)*F,this.mat4[8]=(h*D-i*B+k*z)*F,this.mat4[9]=(c*B-b*D-f*z)*F,this.mat4[10]=(p*x-q*v+s*t)*F,this.mat4[11]=(m*v-l*x-o*t)*F,this.mat4[12]=(i*A-h*C-j*z)*F,this.mat4[13]=(b*C-c*A+e*z)*F,this.mat4[14]=(q*u-p*w-r*t)*F,this.mat4[15]=(l*w-m*u+n*t)*F,this):null},d.Matrix.prototype.invert3x3=function(){var a=this.mat3[0],b=this.mat3[1],c=this.mat3[2],d=this.mat3[3],e=this.mat3[4],f=this.mat3[5],g=this.mat3[6],h=this.mat3[7],i=this.mat3[8],j=i*e-f*h,k=-i*d+f*g,l=h*d-e*g,m=a*j+b*k+c*l;return m?(m=1/m,this.mat3[0]=j*m,this.mat3[1]=(-i*b+c*h)*m,this.mat3[2]=(f*b-c*e)*m,this.mat3[3]=k*m,this.mat3[4]=(i*a-c*g)*m,this.mat3[5]=(-f*a+c*d)*m,this.mat3[6]=l*m,this.mat3[7]=(-h*a+b*g)*m,this.mat3[8]=(e*a-b*d)*m,this):null},d.Matrix.prototype.transpose3x3=function(a){var b=a[1],c=a[2],d=a[5];return this.mat3[1]=a[3],this.mat3[2]=a[6],this.mat3[3]=b,this.mat3[5]=a[7],this.mat3[6]=c,this.mat3[7]=d,this},d.Matrix.prototype.inverseTranspose=function(a){return void 0===this.mat3?console.error("sorry, this function only works with mat3"):(this.mat3[0]=a.mat4[0],this.mat3[1]=a.mat4[1],this.mat3[2]=a.mat4[2],this.mat3[3]=a.mat4[4],this.mat3[4]=a.mat4[5],this.mat3[5]=a.mat4[6],this.mat3[6]=a.mat4[8],this.mat3[7]=a.mat4[9],this.mat3[8]=a.mat4[10]),this.invert3x3().transpose3x3(this.mat3),this},d.Matrix.prototype.determinant=function(){var a=this.mat4[0]*this.mat4[5]-this.mat4[1]*this.mat4[4],b=this.mat4[0]*this.mat4[6]-this.mat4[2]*this.mat4[4],c=this.mat4[0]*this.mat4[7]-this.mat4[3]*this.mat4[4],d=this.mat4[1]*this.mat4[6]-this.mat4[2]*this.mat4[5],e=this.mat4[1]*this.mat4[7]-this.mat4[3]*this.mat4[5],f=this.mat4[2]*this.mat4[7]-this.mat4[3]*this.mat4[6],g=this.mat4[8]*this.mat4[13]-this.mat4[9]*this.mat4[12],h=this.mat4[8]*this.mat4[14]-this.mat4[10]*this.mat4[12],i=this.mat4[8]*this.mat4[15]-this.mat4[11]*this.mat4[12],j=this.mat4[9]*this.mat4[14]-this.mat4[10]*this.mat4[13],k=this.mat4[9]*this.mat4[15]-this.mat4[11]*this.mat4[13];return a*(this.mat4[10]*this.mat4[15]-this.mat4[11]*this.mat4[14])-b*k+c*j+d*i-e*h+f*g},d.Matrix.prototype.mult=function(a){var b=new g(16),c=new g(16);a instanceof d.Matrix?c=a.mat4:a instanceof g&&(c=a);var e=this.mat4[0],f=this.mat4[1],h=this.mat4[2],i=this.mat4[3];return b[0]=e*c[0]+f*c[4]+h*c[8]+i*c[12],b[1]=e*c[1]+f*c[5]+h*c[9]+i*c[13],b[2]=e*c[2]+f*c[6]+h*c[10]+i*c[14],b[3]=e*c[3]+f*c[7]+h*c[11]+i*c[15],e=this.mat4[4],f=this.mat4[5],h=this.mat4[6],i=this.mat4[7],b[4]=e*c[0]+f*c[4]+h*c[8]+i*c[12],b[5]=e*c[1]+f*c[5]+h*c[9]+i*c[13],b[6]=e*c[2]+f*c[6]+h*c[10]+i*c[14],b[7]=e*c[3]+f*c[7]+h*c[11]+i*c[15],e=this.mat4[8],f=this.mat4[9],h=this.mat4[10],i=this.mat4[11],b[8]=e*c[0]+f*c[4]+h*c[8]+i*c[12],b[9]=e*c[1]+f*c[5]+h*c[9]+i*c[13],b[10]=e*c[2]+f*c[6]+h*c[10]+i*c[14],b[11]=e*c[3]+f*c[7]+h*c[11]+i*c[15],e=this.mat4[12],f=this.mat4[13],h=this.mat4[14],i=this.mat4[15],b[12]=e*c[0]+f*c[4]+h*c[8]+i*c[12],b[13]=e*c[1]+f*c[5]+h*c[9]+i*c[13],b[14]=e*c[2]+f*c[6]+h*c[10]+i*c[14],b[15]=e*c[3]+f*c[7]+h*c[11]+i*c[15],this.mat4=b,this},d.Matrix.prototype.scale=function(){for(var a,b,c,e=new Array(arguments.length),f=0;f<e.length;++f)e[f]=arguments[f];e[0]instanceof d.Vector?(a=e[0].x,b=e[0].y,c=e[0].z):e[0]instanceof Array&&(a=e[0][0],b=e[0][1],c=e[0][2]);var h=new g(16);return h[0]=this.mat4[0]*a,h[1]=this.mat4[1]*a,h[2]=this.mat4[2]*a,h[3]=this.mat4[3]*a,h[4]=this.mat4[4]*b,h[5]=this.mat4[5]*b,h[6]=this.mat4[6]*b,h[7]=this.mat4[7]*b,h[8]=this.mat4[8]*c,h[9]=this.mat4[9]*c,h[10]=this.mat4[10]*c,h[11]=this.mat4[11]*c,h[12]=this.mat4[12],h[13]=this.mat4[13],h[14]=this.mat4[14],h[15]=this.mat4[15],this.mat4=h,this},d.Matrix.prototype.rotate=function(a,b){var c,g,h,i,j;this.p5?this.p5._angleMode===f.DEGREES&&(i=e.degreesToRadians(a)):i=a,b instanceof d.Vector?(c=b.x,g=b.y,h=b.z):b instanceof Array&&(c=b[0],g=b[1],h=b[2]),j=Math.sqrt(c*c+g*g+h*h),c*=1/j,g*=1/j,h*=1/j
;var k=this.mat4[0],l=this.mat4[1],m=this.mat4[2],n=this.mat4[3],o=this.mat4[4],p=this.mat4[5],q=this.mat4[6],r=this.mat4[7],s=this.mat4[8],t=this.mat4[9],u=this.mat4[10],v=this.mat4[11],w=Math.sin(i),x=Math.cos(i),y=1-x,z=c*c*y+x,A=g*c*y+h*w,B=h*c*y-g*w,C=c*g*y-h*w,D=g*g*y+x,E=h*g*y+c*w,F=c*h*y+g*w,G=g*h*y-c*w,H=h*h*y+x;return this.mat4[0]=k*z+o*A+s*B,this.mat4[1]=l*z+p*A+t*B,this.mat4[2]=m*z+q*A+u*B,this.mat4[3]=n*z+r*A+v*B,this.mat4[4]=k*C+o*D+s*E,this.mat4[5]=l*C+p*D+t*E,this.mat4[6]=m*C+q*D+u*E,this.mat4[7]=n*C+r*D+v*E,this.mat4[8]=k*F+o*G+s*H,this.mat4[9]=l*F+p*G+t*H,this.mat4[10]=m*F+q*G+u*H,this.mat4[11]=n*F+r*G+v*H,this},d.Matrix.prototype.translate=function(a){var b=a[0],c=a[1],d=a[2]||0;this.mat4[12]=this.mat4[0]*b+this.mat4[4]*c+this.mat4[8]*d+this.mat4[12],this.mat4[13]=this.mat4[1]*b+this.mat4[5]*c+this.mat4[9]*d+this.mat4[13],this.mat4[14]=this.mat4[2]*b+this.mat4[6]*c+this.mat4[10]*d+this.mat4[14],this.mat4[15]=this.mat4[3]*b+this.mat4[7]*c+this.mat4[11]*d+this.mat4[15]},d.Matrix.prototype.rotateX=function(a){this.rotate(a,[1,0,0])},d.Matrix.prototype.rotateY=function(a){this.rotate(a,[0,1,0])},d.Matrix.prototype.rotateZ=function(a){this.rotate(a,[0,0,1])},d.Matrix.prototype.perspective=function(a,b,c,d){var e=1/Math.tan(a/2),f=1/(c-d);return this.mat4[0]=e/b,this.mat4[1]=0,this.mat4[2]=0,this.mat4[3]=0,this.mat4[4]=0,this.mat4[5]=e,this.mat4[6]=0,this.mat4[7]=0,this.mat4[8]=0,this.mat4[9]=0,this.mat4[10]=(d+c)*f,this.mat4[11]=-1,this.mat4[12]=0,this.mat4[13]=0,this.mat4[14]=2*d*c*f,this.mat4[15]=0,this},d.Matrix.prototype.ortho=function(a,b,c,d,e,f){var g=1/(a-b),h=1/(c-d),i=1/(e-f);return this.mat4[0]=-2*g,this.mat4[1]=0,this.mat4[2]=0,this.mat4[3]=0,this.mat4[4]=0,this.mat4[5]=-2*h,this.mat4[6]=0,this.mat4[7]=0,this.mat4[8]=0,this.mat4[9]=0,this.mat4[10]=2*i,this.mat4[11]=0,this.mat4[12]=(a+b)*g,this.mat4[13]=(d+c)*h,this.mat4[14]=(f+e)*i,this.mat4[15]=1,this},b.exports=d.Matrix},{"../core/constants":41,"../core/core":42,"../math/polargeometry":72}],89:[function(a,b,c){"use strict";var d=a("../core/core"),e=a("../core/constants");d.RendererGL.prototype.beginShape=function(a){return this.immediateMode.shapeMode=void 0!==a?a:e.LINE_STRIP,void 0===this.immediateMode.vertexPositions?(this.immediateMode.vertexPositions=[],this.immediateMode.vertexColors=[],this.immediateMode.vertexBuffer=this.GL.createBuffer(),this.immediateMode.colorBuffer=this.GL.createBuffer()):(this.immediateMode.vertexPositions.length=0,this.immediateMode.vertexColors.length=0),this.isImmediateDrawing=!0,this},d.RendererGL.prototype.vertex=function(a,b,c){this.immediateMode.vertexPositions.push(a,b,c);var d=this.curFillColor||[.5,.5,.5,1];return this.immediateMode.vertexColors.push(d[0],d[1],d[2],d[3]),this},d.RendererGL.prototype.endShape=function(a,b,c,d,f,g){var h=this.GL;if(this._bindImmediateBuffers(this.immediateMode.vertexPositions,this.immediateMode.vertexColors),a)if("fill"===this.drawMode||"texture"===this.drawMode)switch(this.immediateMode.shapeMode){case e.LINE_STRIP:this.immediateMode.shapeMode=e.TRIANGLE_FAN;break;case e.LINES:this.immediateMode.shapeMode=e.TRIANGLE_FAN;break;case e.TRIANGLES:this.immediateMode.shapeMode=e.TRIANGLE_FAN}else switch(this.immediateMode.shapeMode){case e.LINE_STRIP:this.immediateMode.shapeMode=e.LINE_LOOP;break;case e.LINES:this.immediateMode.shapeMode=e.LINE_LOOP}if(this.immediateMode.shapeMode===e.QUADS||this.immediateMode.shapeMode===e.QUAD_STRIP)throw new Error("sorry, "+this.immediateMode.shapeMode+" not yet implemented in webgl mode.");return h.enable(h.BLEND),h.drawArrays(this.immediateMode.shapeMode,0,this.immediateMode.vertexPositions.length/3),this.immediateMode.vertexPositions.length=0,this.immediateMode.vertexColors.length=0,this.isImmediateDrawing=!1,this},d.RendererGL.prototype._bindImmediateBuffers=function(a,b){this._setDefaultCamera();var c=this.GL,d=this._getCurShaderId(),e=this.mHash[d];return e.vertexPositionAttribute=c.getAttribLocation(e,"aPosition"),c.enableVertexAttribArray(e.vertexPositionAttribute),c.bindBuffer(c.ARRAY_BUFFER,this.immediateMode.vertexBuffer),c.bufferData(c.ARRAY_BUFFER,new Float32Array(a),c.DYNAMIC_DRAW),c.vertexAttribPointer(e.vertexPositionAttribute,3,c.FLOAT,!1,0,0),e.vertexColorAttribute=c.getAttribLocation(e,"aVertexColor"),c.enableVertexAttribArray(e.vertexColorAttribute),c.bindBuffer(c.ARRAY_BUFFER,this.immediateMode.colorBuffer),c.bufferData(c.ARRAY_BUFFER,new Float32Array(b),c.DYNAMIC_DRAW),c.vertexAttribPointer(e.vertexColorAttribute,4,c.FLOAT,!1,0,0),this._setMatrixUniforms(d),this},d.RendererGL.prototype._getColorVertexShader=function(){var a,b=this.GL,c="immediateVert|vertexColorFrag";return this.materialInHash(c)?a=this.mHash[c]:(a=this._initShaders("immediateVert","vertexColorFrag",!0),this.mHash[c]=a,a.vertexColorAttribute=b.getAttribLocation(a,"aVertexColor"),b.enableVertexAttribArray(a.vertexColorAttribute)),a},b.exports=d.RendererGL},{"../core/constants":41,"../core/core":42}],90:[function(a,b,c){"use strict";function d(a){return a.length>0?a.reduce(function(a,b){return a.concat(b)}):[]}function e(a){return d(a.map(function(a){return[a.x,a.y,a.z]}))}var f=a("../core/core"),g=0;f.RendererGL.prototype._initBufferDefaults=function(a){if(++g>1e3){var b=Object.keys(this.gHash)[0];delete this.gHash[b],g--}var c=this.GL;this.gHash[a]={},this.gHash[a].vertexBuffer=c.createBuffer(),this.gHash[a].normalBuffer=c.createBuffer(),this.gHash[a].uvBuffer=c.createBuffer(),this.gHash[a].indexBuffer=c.createBuffer()},f.RendererGL.prototype.createBuffers=function(a,b){var c=this.GL;this._setDefaultCamera(),this._initBufferDefaults(a);var f=this.mHash[this._getCurShaderId()];this.gHash[a].numberOfItems=3*b.faces.length,c.bindBuffer(c.ARRAY_BUFFER,this.gHash[a].vertexBuffer),c.bufferData(c.ARRAY_BUFFER,new Float32Array(e(b.vertices)),c.STATIC_DRAW),f.vertexPositionAttribute=c.getAttribLocation(f,"aPosition"),c.enableVertexAttribArray(f.vertexPositionAttribute),c.vertexAttribPointer(f.vertexPositionAttribute,3,c.FLOAT,!1,0,0),c.bindBuffer(c.ARRAY_BUFFER,this.gHash[a].normalBuffer),c.bufferData(c.ARRAY_BUFFER,new Float32Array(e(b.vertexNormals)),c.STATIC_DRAW),f.vertexNormalAttribute=c.getAttribLocation(f,"aNormal"),c.enableVertexAttribArray(f.vertexNormalAttribute),c.vertexAttribPointer(f.vertexNormalAttribute,3,c.FLOAT,!1,0,0),c.bindBuffer(c.ARRAY_BUFFER,this.gHash[a].uvBuffer),c.bufferData(c.ARRAY_BUFFER,new Float32Array(d(b.uvs)),c.STATIC_DRAW),f.textureCoordAttribute=c.getAttribLocation(f,"aTexCoord"),c.enableVertexAttribArray(f.textureCoordAttribute),c.vertexAttribPointer(f.textureCoordAttribute,2,c.FLOAT,!1,0,0),c.bindBuffer(c.ELEMENT_ARRAY_BUFFER,this.gHash[a].indexBuffer),c.bufferData(c.ELEMENT_ARRAY_BUFFER,new Uint16Array(d(b.faces)),c.STATIC_DRAW)},f.RendererGL.prototype.drawBuffers=function(a){this._setDefaultCamera();var b=this.GL,c=this._getCurShaderId(),d=this.mHash[c];return b.bindBuffer(b.ARRAY_BUFFER,this.gHash[a].vertexBuffer),b.vertexAttribPointer(d.vertexPositionAttribute,3,b.FLOAT,!1,0,0),b.bindBuffer(b.ARRAY_BUFFER,this.gHash[a].normalBuffer),b.vertexAttribPointer(d.vertexNormalAttribute,3,b.FLOAT,!1,0,0),b.bindBuffer(b.ARRAY_BUFFER,this.gHash[a].uvBuffer),b.vertexAttribPointer(d.textureCoordAttribute,2,b.FLOAT,!1,0,0),b.bindBuffer(b.ELEMENT_ARRAY_BUFFER,this.gHash[a].indexBuffer),this._setMatrixUniforms(c),b.drawElements(b.TRIANGLES,this.gHash[a].numberOfItems,b.UNSIGNED_SHORT,0),this},b.exports=f.RendererGL},{"../core/core":42}],91:[function(a,b,c){"use strict";var d=a("../core/core"),e=a("./shader");a("../core/p5.Renderer"),a("./p5.Matrix");var f=[],g={alpha:!0,depth:!0,stencil:!0,antialias:!1,premultipliedAlpha:!1,preserveDrawingBuffer:!1};d.RendererGL=function(a,b,c){return d.Renderer.call(this,a,b,c),this._initContext(),this.isP3D=!0,this.GL=this.drawingContext,this.ambientLightCount=0,this.directionalLightCount=0,this.pointLightCount=0,this._curCamera=null,this.uMVMatrix=new d.Matrix,this.uPMatrix=new d.Matrix,this.uNMatrix=new d.Matrix("mat3"),this.gHash={},this.mHash={},this.isImmediateDrawing=!1,this.immediateMode={},this.curFillColor=[.5,.5,.5,1],this.curStrokeColor=[.5,.5,.5,1],this.pointSize=5,this},d.RendererGL.prototype=Object.create(d.Renderer.prototype),d.RendererGL.prototype._initContext=function(){try{if(this.drawingContext=this.canvas.getContext("webgl",g)||this.canvas.getContext("experimental-webgl",g),null===this.drawingContext)throw new Error("Error creating webgl context");console.log("p5.RendererGL: enabled webgl context");var a=this.drawingContext;a.enable(a.DEPTH_TEST),a.depthFunc(a.LEQUAL),a.viewport(0,0,a.drawingBufferWidth,a.drawingBufferHeight)}catch(a){throw new Error(a)}},d.RendererGL.prototype._setDefaultCamera=function(){if(null===this._curCamera){var a=this.width,b=this.height;this.uPMatrix=d.Matrix.identity();var c=this.height/2/Math.tan(30*Math.PI/180);this.uPMatrix.perspective(60/180*Math.PI,a/b,.1*c,10*c),this._curCamera="default"}},d.RendererGL.prototype._update=function(){this.uMVMatrix=d.Matrix.identity(),this.translate(0,0,-(this.height/2)/Math.tan(30*Math.PI/180)),this.ambientLightCount=0,this.directionalLightCount=0,this.pointLightCount=0},d.RendererGL.prototype.background=function(){var a=this.GL,b=this._pInst.color.apply(this._pInst,arguments),c=b.levels[0]/255,d=b.levels[1]/255,e=b.levels[2]/255,f=b.levels[3]/255;a.clearColor(c,d,e,f),a.clear(a.COLOR_BUFFER_BIT|a.DEPTH_BUFFER_BIT)},d.RendererGL.prototype._initShaders=function(a,b,c){var d=this.GL,f=d.createShader(d.VERTEX_SHADER);if(d.shaderSource(f,e[a]),d.compileShader(f),!d.getShaderParameter(f,d.COMPILE_STATUS))return alert("Yikes! An error occurred compiling the shaders:"+d.getShaderInfoLog(f)),null;var g=d.createShader(d.FRAGMENT_SHADER);if(d.shaderSource(g,e[b]),d.compileShader(g),!d.getShaderParameter(g,d.COMPILE_STATUS))return alert("Darn! An error occurred compiling the shaders:"+d.getShaderInfoLog(g)),null;var h=d.createProgram();return d.attachShader(h,f),d.attachShader(h,g),d.linkProgram(h),d.getProgramParameter(h,d.LINK_STATUS)||alert("Snap! Error linking shader program"),this._getLocation(h,c),h},d.RendererGL.prototype._getLocation=function(a,b){var c=this.GL;c.useProgram(a),a.uPMatrixUniform=c.getUniformLocation(a,"uProjectionMatrix"),a.uMVMatrixUniform=c.getUniformLocation(a,"uModelViewMatrix"),void 0===b&&(a.uNMatrixUniform=c.getUniformLocation(a,"uNormalMatrix"),a.samplerUniform=c.getUniformLocation(a,"uSampler"))},d.RendererGL.prototype._setUniform1f=function(a,b,c){var d=this.GL,e=this.mHash[a];return d.useProgram(e),e[b]=d.getUniformLocation(e,b),d.uniform1f(e[b],c),this},d.RendererGL.prototype._setMatrixUniforms=function(a){var b=this.GL,c=this.mHash[a];b.useProgram(c),b.uniformMatrix4fv(c.uPMatrixUniform,!1,this.uPMatrix.mat4),b.uniformMatrix4fv(c.uMVMatrixUniform,!1,this.uMVMatrix.mat4),this.uNMatrix.inverseTranspose(this.uMVMatrix),b.uniformMatrix3fv(c.uNMatrixUniform,!1,this.uNMatrix.mat3)},d.RendererGL.prototype._getShader=function(a,b,c){var d=a+"|"+b;if(!this.materialInHash(d)){var e=this._initShaders(a,b,c);this.mHash[d]=e}return this.curShaderId=d,this.mHash[this.curShaderId]},d.RendererGL.prototype._getCurShaderId=function(){var a,b;return"fill"!==this.drawMode&&void 0===this.curShaderId?(a="normalVert|normalFrag",b=this._initShaders("normalVert","normalFrag"),this.mHash[a]=b,this.curShaderId=a):this.isImmediateDrawing&&"fill"===this.drawMode&&(a="immediateVert|vertexColorFrag",b=this._initShaders("immediateVert","vertexColorFrag"),this.mHash[a]=b,this.curShaderId=a),this.curShaderId},d.RendererGL.prototype.fill=function(a,b,c,d){var e,f=this.GL,g=this._applyColorBlend.apply(this,arguments);return this.curFillColor=g,this.drawMode="fill",this.isImmediateDrawing?(e=this._getShader("immediateVert","vertexColorFrag"),f.useProgram(e)):(e=this._getShader("normalVert","basicFrag"),f.useProgram(e),e.uMaterialColor=f.getUniformLocation(e,"uMaterialColor"),f.uniform4f(e.uMaterialColor,g[0],g[1],g[2],g[3])),this},d.RendererGL.prototype.stroke=function(a,b,c,d){var e=this._pInst.color.apply(this._pInst,arguments),f=e._array;return this.curStrokeColor=f,this.drawMode="stroke",this},d.RendererGL.prototype._strokeCheck=function(){if("stroke"===this.drawMode)throw new Error("stroke for shapes in 3D not yet implemented, use fill for now :(")},d.RendererGL.prototype.strokeWeight=function(a){return this.pointSize=a,this},d.RendererGL.prototype.geometryInHash=function(a){return void 0!==this.gHash[a]},d.RendererGL.prototype.materialInHash=function(a){return void 0!==this.mHash[a]},d.RendererGL.prototype.resize=function(a,b){var c=this.GL;d.Renderer.prototype.resize.call(this,a,b),c.viewport(0,0,c.drawingBufferWidth,c.drawingBufferHeight),"default"===this._curCamera&&(this._curCamera=null,this._setDefaultCamera())},d.RendererGL.prototype.clear=function(){var a=this.GL;a.clearColor(arguments[0],arguments[1],arguments[2],arguments[3]),a.clear(a.COLOR_BUFFER_BIT|a.DEPTH_BUFFER_BIT)},d.RendererGL.prototype.translate=function(a,b,c){return this.uMVMatrix.translate([a,-b,c]),this},d.RendererGL.prototype.scale=function(a,b,c){return this.uMVMatrix.scale([a,b,c]),this},d.RendererGL.prototype.rotate=function(a,b){return this.uMVMatrix.rotate(a,b),this},d.RendererGL.prototype.rotateX=function(a){return this.rotate(a,[1,0,0]),this},d.RendererGL.prototype.rotateY=function(a){return this.rotate(a,[0,1,0]),this},d.RendererGL.prototype.rotateZ=function(a){return this.rotate(a,[0,0,1]),this},d.RendererGL.prototype.push=function(){f.push(this.uMVMatrix.copy())},d.RendererGL.prototype.pop=function(){if(0===f.length)throw new Error("Invalid popMatrix!");this.uMVMatrix=f.pop()},d.RendererGL.prototype.resetMatrix=function(){return this.uMVMatrix=d.Matrix.identity(),this.translate(0,0,-800),this},d.RendererGL.prototype._applyTextProperties=function(){console.error("text commands not yet implemented in webgl")},b.exports=d.RendererGL},{"../core/core":42,"../core/p5.Renderer":48,"./p5.Matrix":88,"./shader":93}],92:[function(a,b,c){"use strict";var d=a("../core/core");a("./p5.Geometry"),d.prototype.plane=function(){for(var a=new Array(arguments.length),b=0;b<a.length;++b)a[b]=arguments[b];var c=a[0]||50,e=a[1]||c,f="number"==typeof a[2]?a[2]:1,g="number"==typeof a[3]?a[3]:1,h="plane|"+c+"|"+e+"|"+f+"|"+g;if(!this._renderer.geometryInHash(h)){var i=function(){for(var a,b,f,g=0;g<=this.detailY;g++){b=g/this.detailY;for(var h=0;h<=this.detailX;h++)a=h/this.detailX,f=new d.Vector(c*a-c/2,e*b-e/2,0),this.vertices.push(f),this.uvs.push([a,b])}},j=new d.Geometry(f,g,i);j.computeFaces().computeNormals(),this._renderer.createBuffers(h,j)}this._renderer.drawBuffers(h)},d.prototype.box=function(){for(var a=new Array(arguments.length),b=0;b<a.length;++b)a[b]=arguments[b];var c=a[0]||50,e=a[1]||c,f=a[2]||c,g="number"==typeof a[3]?a[3]:4,h="number"==typeof a[4]?a[4]:4,i="box|"+c+"|"+e+"|"+f+"|"+g+"|"+h;if(!this._renderer.geometryInHash(i)){var j=function(){for(var a=[[0,4,2,6],[1,3,5,7],[0,1,4,5],[2,6,3,7],[0,2,1,3],[4,5,6,7]],b=0,g=0;g<a.length;g++){for(var h=a[g],i=4*g,j=0;j<4;j++){var k=h[j],l=new d.Vector((2*(1&k)-1)*c/2,((2&k)-1)*e/2,((4&k)/2-1)*f/2);this.vertices.push(l),this.uvs.push([1&j,(2&j)/2]),b++}this.faces.push([i,i+1,i+2]),this.faces.push([i+2,i+1,i+3])}},k=new d.Geometry(g,h,j);k.computeNormals(),this._renderer.createBuffers(i,k)}return this._renderer.drawBuffers(i),this},d.prototype.sphere=function(){for(var a=new Array(arguments.length),b=0;b<a.length;++b)a[b]=arguments[b];var c=a[0]||50,e="number"==typeof a[1]?a[1]:24,f="number"==typeof a[2]?a[2]:16,g="sphere|"+c+"|"+e+"|"+f;if(!this._renderer.geometryInHash(g)){var h=function(){for(var a,b,e,f=0;f<=this.detailY;f++){b=f/this.detailY;for(var g=0;g<=this.detailX;g++){a=g/this.detailX;var h=2*Math.PI*a,i=Math.PI*b-Math.PI/2;e=new d.Vector(c*Math.cos(i)*Math.sin(h),c*Math.sin(i),c*Math.cos(i)*Math.cos(h)),this.vertices.push(e),this.uvs.push([a,b])}}},i=new d.Geometry(e,f,h);i.computeFaces().computeNormals().averageNormals().averagePoleNormals(),this._renderer.createBuffers(g,i)}return this._renderer.drawBuffers(g),this};var e=function(a,b,c,e,f,g,h){e=e<3?3:e,f=f<1?1:f,g=void 0===g||g,h=void 0===h||h;var i,j,k=(g?2:0)+(h?2:0),l=e+1,m=Math.atan2(a-b,c),n=g?-2:0,o=f+(h?2:0);for(i=n;i<=o;++i){var p,q=i/f,r=c*q;for(i<0?(r=0,q=1,p=a):i>f?(r=c,q=1,p=b):p=a+i/f*(b-a),i!==-2&&i!==f+2||(p=0,q=0),r-=c/2,j=0;j<l;++j)this.vertices.push(new d.Vector(Math.sin(j*Math.PI*2/e)*p,r,Math.cos(j*Math.PI*2/e)*p)),this.vertexNormals.push(new d.Vector(i<0||i>f?0:Math.sin(j*Math.PI*2/e)*Math.cos(m),i<0?-1:i>f?1:Math.sin(m),i<0||i>f?0:Math.cos(j*Math.PI*2/e)*Math.cos(m))),this.uvs.push([j/e,q])}for(i=0;i<f+k;++i)for(j=0;j<e;++j)this.faces.push([l*(i+0)+0+j,l*(i+0)+1+j,l*(i+1)+1+j]),this.faces.push([l*(i+0)+0+j,l*(i+1)+1+j,l*(i+1)+0+j])};d.prototype.cylinder=function(){for(var a=new Array(arguments.length),b=0;b<a.length;++b)a[b]=arguments[b];var c=a[0]||50,f=a[1]||c,g="number"==typeof a[2]?a[2]:24,h="number"==typeof a[3]?a[3]:16,i="cylinder|"+c+"|"+f+"|"+g+"|"+h;if(!this._renderer.geometryInHash(i)){var j=new d.Geometry(g,h);e.call(j,c,c,f,g,h,!0,!0),j.computeNormals(),this._renderer.createBuffers(i,j)}return this._renderer.drawBuffers(i),this},d.prototype.cone=function(){for(var a=new Array(arguments.length),b=0;b<a.length;++b)a[b]=arguments[b];var c=a[0]||50,f=a[1]||c,g="number"==typeof a[2]?a[2]:24,h="number"==typeof a[3]?a[3]:16,i="cone|"+c+"|"+f+"|"+g+"|"+h;if(!this._renderer.geometryInHash(i)){var j=new d.Geometry(g,h);e.call(j,c,0,f,g,h,!0,!0),j.computeNormals(),this._renderer.createBuffers(i,j)}return this._renderer.drawBuffers(i),this},d.prototype.ellipsoid=function(){for(var a=new Array(arguments.length),b=0;b<a.length;++b)a[b]=arguments[b];var c="number"==typeof a[3]?a[3]:24,e="number"==typeof a[4]?a[4]:24,f=a[0]||50,g=a[1]||f,h=a[2]||f,i="ellipsoid|"+f+"|"+g+"|"+h+"|"+c+"|"+e;if(!this._renderer.geometryInHash(i)){var j=function(){for(var a,b,c,e=0;e<=this.detailY;e++){b=e/this.detailY;for(var i=0;i<=this.detailX;i++){a=i/this.detailX;var j=2*Math.PI*a,k=Math.PI*b-Math.PI/2;c=new d.Vector(f*Math.cos(k)*Math.sin(j),g*Math.sin(k),h*Math.cos(k)*Math.cos(j)),this.vertices.push(c),this.uvs.push([a,b])}}},k=new d.Geometry(c,e,j);k.computeFaces().computeNormals(),this._renderer.createBuffers(i,k)}return this._renderer.drawBuffers(i),this},d.prototype.torus=function(){for(var a=new Array(arguments.length),b=0;b<a.length;++b)a[b]=arguments[b];var c="number"==typeof a[2]?a[2]:24,e="number"==typeof a[3]?a[3]:16,f=a[0]||50,g=a[1]||10,h="torus|"+f+"|"+g+"|"+c+"|"+e;if(!this._renderer.geometryInHash(h)){var i=function(){for(var a,b,c,e=0;e<=this.detailY;e++){b=e/this.detailY;for(var h=0;h<=this.detailX;h++){a=h/this.detailX;var i=2*Math.PI*a,j=2*Math.PI*b;c=new d.Vector((f+g*Math.cos(j))*Math.cos(i),(f+g*Math.cos(j))*Math.sin(i),g*Math.sin(j)),this.vertices.push(c),this.uvs.push([a,b])}}},j=new d.Geometry(c,e,i);j.computeFaces().computeNormals().averageNormals(),this._renderer.createBuffers(h,j)}return this._renderer.drawBuffers(h),this},d.RendererGL.prototype.point=function(a,b,c){return console.log("point not yet implemented in webgl"),this},d.RendererGL.prototype.triangle=function(a){var b=a[0],c=a[1],e=a[2],f=a[3],g=a[4],h=a[5],i="tri|"+b+"|"+c+"|"+e+"|"+f+"|"+g+"|"+h;if(!this.geometryInHash(i)){var j=function(){var a=[];a.push(new d.Vector(b,c,0)),a.push(new d.Vector(e,f,0)),a.push(new d.Vector(g,h,0)),this.vertices=a,this.faces=[[0,1,2]],this.uvs=[[0,0],[0,1],[1,1]]},k=new d.Geometry(1,1,j);k.computeNormals(),this.createBuffers(i,k)}return this.drawBuffers(i),this},d.RendererGL.prototype.ellipse=function(a){var b=a[0],c=a[1],e=a[2],f=a[3],g=a[4]||24,h=a[5]||16,i="ellipse|"+a[0]+"|"+a[1]+"|"+a[2]+"|"+a[3];if(!this.geometryInHash(i)){var j=function(){for(var a,g,h,i=b+.5*e,j=c+.5*f,k=0;k<=this.detailY;k++){g=k/this.detailY;for(var l=0;l<=this.detailX;l++){a=l/this.detailX;var m=2*Math.PI*a;if(0===g)h=new d.Vector(i,j,0);else{var n=i+.5*e*Math.cos(m),o=j+.5*f*Math.sin(m);h=new d.Vector(n,o,0)}this.vertices.push(h),this.uvs.push([a,g])}}},k=new d.Geometry(g,h,j);k.computeFaces().computeNormals(),this.createBuffers(i,k)}return this.drawBuffers(i),this},d.RendererGL.prototype.rect=function(a){var b="rect|"+a[0]+"|"+a[1]+"|"+a[2]+"|"+a[3],c=a[0],e=a[1],f=a[2],g=a[3],h=a[4]||24,i=a[5]||16;if(!this.geometryInHash(b)){var j=function(){for(var a,b,h,i=0;i<=this.detailY;i++){b=i/this.detailY;for(var j=0;j<=this.detailX;j++)a=j/this.detailX,h=new d.Vector(c+f*a,e+g*b,0),this.vertices.push(h),this.uvs.push([a,b])}},k=new d.Geometry(h,i,j);k.computeFaces().computeNormals(),this.createBuffers(b,k)}return this.drawBuffers(b),this},d.RendererGL.prototype.quad=function(){for(var a=new Array(arguments.length),b=0;b<a.length;++b)a[b]=arguments[b];var c=a[0],e=a[1],f=a[2],g=a[3],h=a[4],i=a[5],j=a[6],k=a[7],l="quad|"+c+"|"+e+"|"+f+"|"+g+"|"+h+"|"+i+"|"+j+"|"+k;if(!this.geometryInHash(l)){var m=function(){this.vertices.push(new d.Vector(c,e,0)),this.vertices.push(new d.Vector(f,g,0)),this.vertices.push(new d.Vector(h,i,0)),this.vertices.push(new d.Vector(j,k,0)),this.uvs.push([0,0],[1,0],[1,1],[0,1])},n=new d.Geometry(2,2,m);n.computeNormals(),n.faces=[[0,1,2],[2,3,0]],this.createBuffers(l,n)}return this.drawBuffers(l),this},d.RendererGL.prototype.bezier=function(a){var b=a[12]||20;this.beginShape();for(var c=[0,0,0,0],d=[0,0,0],e=0;e<=b;e++)c[0]=Math.pow(1-e/b,3),c[1]=e/b*3*Math.pow(1-e/b,2),c[2]=3*Math.pow(e/b,2)*(1-e/b),c[3]=Math.pow(e/b,3),d[0]=a[0]*c[0]+a[3]*c[1]+a[6]*c[2]+a[9]*c[3],d[1]=a[1]*c[0]+a[4]*c[1]+a[7]*c[2]+a[10]*c[3],d[2]=a[2]*c[0]+a[5]*c[1]+a[8]*c[2]+a[11]*c[3],this.vertex(d[0],d[1],d[2]);return this.endShape(),this},d.RendererGL.prototype.curve=function(a){var b=a[12];this.beginShape();for(var c=[0,0,0,0],d=[0,0,0],e=0;e<=b;e++)c[0]=.5*Math.pow(e/b,3),c[1]=.5*Math.pow(e/b,2),c[2]=e/b*.5,c[3]=.5,d[0]=c[0]*(-a[0]+3*a[3]-3*a[6]+a[9])+c[1]*(2*a[0]-5*a[3]+4*a[6]-a[9])+c[2]*(-a[0]+a[6])+c[3]*(2*a[3]),d[1]=c[0]*(-a[1]+3*a[4]-3*a[7]+a[10])+c[1]*(2*a[1]-5*a[4]+4*a[7]-a[10])+c[2]*(-a[1]+a[7])+c[3]*(2*a[4]),d[2]=c[0]*(-a[2]+3*a[5]-3*a[8]+a[11])+c[1]*(2*a[2]-5*a[5]+4*a[8]-a[11])+c[2]*(-a[2]+a[8])+c[3]*(2*a[5]),this.vertex(d[0],d[1],d[2]);return this.endShape(),this},b.exports=d},{"../core/core":42,"./p5.Geometry":87}],93:[function(a,b,c){b.exports={immediateVert:"attribute vec3 aPosition;\nattribute vec4 aVertexColor;\n\nuniform mat4 uModelViewMatrix;\nuniform mat4 uProjectionMatrix;\nuniform float uResolution;\nuniform float uPointSize;\n\nvarying vec4 vColor;\nvoid main(void) {\n vec4 positionVec4 = vec4(aPosition * vec3(1.0, -1.0, 1.0), 1.0);\n gl_Position = uProjectionMatrix * uModelViewMatrix * positionVec4;\n vColor = aVertexColor;\n gl_PointSize = uPointSize;\n}\n",vertexColorVert:"attribute vec3 aPosition;\nattribute vec4 aVertexColor;\n\nuniform mat4 uModelViewMatrix;\nuniform mat4 uProjectionMatrix;\n\nvarying vec4 vColor;\n\nvoid main(void) {\n vec4 positionVec4 = vec4(aPosition * vec3(1.0, -1.0, 1.0), 1.0);\n gl_Position = uProjectionMatrix * uModelViewMatrix * positionVec4;\n vColor = aVertexColor;\n}\n",vertexColorFrag:"precision mediump float;\nvarying vec4 vColor;\nvoid main(void) {\n gl_FragColor = vColor;\n}",normalVert:"attribute vec3 aPosition;\nattribute vec3 aNormal;\nattribute vec2 aTexCoord;\n\nuniform mat4 uModelViewMatrix;\nuniform mat4 uProjectionMatrix;\nuniform mat3 uNormalMatrix;\n\nvarying vec3 vVertexNormal;\nvarying highp vec2 vVertTexCoord;\n\nvoid main(void) {\n vec4 positionVec4 = vec4(aPosition * vec3(1.0, -1.0, 1.0), 1.0);\n gl_Position = uProjectionMatrix * uModelViewMatrix * positionVec4;\n vVertexNormal = vec3( uNormalMatrix * aNormal );\n vVertTexCoord = aTexCoord;\n}\n",normalFrag:"precision mediump float;\nvarying vec3 vVertexNormal;\nvoid main(void) {\n gl_FragColor = vec4(vVertexNormal, 1.0);\n}",basicFrag:"precision mediump float;\nvarying vec3 vVertexNormal;\nuniform vec4 uMaterialColor;\nvoid main(void) {\n gl_FragColor = uMaterialColor;\n}",lightVert:"attribute vec3 aPosition;\nattribute vec3 aNormal;\nattribute vec2 aTexCoord;\n\nuniform mat4 uModelViewMatrix;\nuniform mat4 uProjectionMatrix;\nuniform mat3 uNormalMatrix;\nuniform int uAmbientLightCount;\nuniform int uDirectionalLightCount;\nuniform int uPointLightCount;\n\nuniform vec3 uAmbientColor[8];\nuniform vec3 uLightingDirection[8];\nuniform vec3 uDirectionalColor[8];\nuniform vec3 uPointLightLocation[8];\nuniform vec3 uPointLightColor[8];\nuniform bool uSpecular;\n\nvarying vec3 vVertexNormal;\nvarying vec2 vVertTexCoord;\nvarying vec3 vLightWeighting;\n\nvec3 ambientLightFactor = vec3(0.0, 0.0, 0.0);\nvec3 directionalLightFactor = vec3(0.0, 0.0, 0.0);\nvec3 pointLightFactor = vec3(0.0, 0.0, 0.0);\nvec3 pointLightFactor2 = vec3(0.0, 0.0, 0.0);\n\nvoid main(void){\n\n vec4 positionVec4 = vec4(aPosition, 1.0);\n gl_Position = uProjectionMatrix * uModelViewMatrix * positionVec4;\n\n vec3 vertexNormal = vec3( uNormalMatrix * aNormal );\n vVertexNormal = vertexNormal;\n vVertTexCoord = aTexCoord;\n\n vec4 mvPosition = uModelViewMatrix * vec4(aPosition, 1.0);\n vec3 eyeDirection = normalize(-mvPosition.xyz);\n\n float shininess = 32.0;\n float specularFactor = 2.0;\n float diffuseFactor = 0.3;\n\n for(int i = 0; i < 8; i++){\n if(uAmbientLightCount == i) break;\n ambientLightFactor += uAmbientColor[i];\n }\n\n for(int j = 0; j < 8; j++){\n if(uDirectionalLightCount == j) break;\n vec3 dir = uLightingDirection[j];\n float directionalLightWeighting = max(dot(vertexNormal, dir), 0.0);\n directionalLightFactor += uDirectionalColor[j] * directionalLightWeighting;\n }\n\n for(int k = 0; k < 8; k++){\n if(uPointLightCount == k) break;\n vec3 loc = uPointLightLocation[k];\n vec3 lightDirection = normalize(loc - mvPosition.xyz);\n\n float directionalLightWeighting = max(dot(vertexNormal, lightDirection), 0.0);\n pointLightFactor += uPointLightColor[k] * directionalLightWeighting;\n\n //factor2 for specular\n vec3 reflectionDirection = reflect(-lightDirection, vertexNormal);\n float specularLightWeighting = pow(max(dot(reflectionDirection, eyeDirection), 0.0), shininess);\n\n pointLightFactor2 += uPointLightColor[k] * (specularFactor * specularLightWeighting\n + directionalLightWeighting * diffuseFactor);\n }\n\n if(!uSpecular){\n vLightWeighting = ambientLightFactor + directionalLightFactor + pointLightFactor;\n }else{\n vLightWeighting = ambientLightFactor + directionalLightFactor + pointLightFactor2;\n }\n\n}\n",lightTextureFrag:"precision mediump float;\n\nuniform vec4 uMaterialColor;\nuniform sampler2D uSampler;\nuniform bool isTexture;\n\nvarying vec3 vLightWeighting;\nvarying highp vec2 vVertTexCoord;\n\nvoid main(void) {\n if(!isTexture){\n gl_FragColor = vec4(vec3(uMaterialColor.rgb * vLightWeighting), uMaterialColor.a);\n }else{\n vec4 textureColor = texture2D(uSampler, vVertTexCoord);\n if(vLightWeighting == vec3(0., 0., 0.)){\n gl_FragColor = textureColor;\n }else{\n gl_FragColor = vec4(vec3(textureColor.rgb * vLightWeighting), textureColor.a);\n }\n }\n}"}},{}]},{},[33])(33)});
|
const mongoose = require('mongoose')
module.exports = (settings) => {
mongoose.connect(settings.db,
err => {
if (err) {
console.log(err)
return
}
console.log('Mongo up and running ...')
})
}
|
import Vue from 'vue'
import Vuex from 'vuex'
import service from '@/utils/service'
import formatTime from '@/utils/formatTime'
Vue.use(Vuex)
export function createStore () {
return new Vuex.Store({
strict: process.env.NODE_ENV !== 'production', // 严格模式,只能用action来修改state
state: {
// 存储当前用户的数据
currentUser: window.localStorage.getItem('cuser') ? JSON.parse(window.localStorage.getItem('cuser')) : {},
// 朋友圈首页的数据
wecircleDataList: [],
// 关闭评论和点赞面板标志位
closeCLPanelFlag: true,
// 私信列表搜索
keyword: '',
wecirclePage: 0
},
mutations: {
/*
* 设置当前用户mutations
*/
currentUser (state, user) {
state.currentUser = user
// 将当前用户数据储存在localStorage里
window.localStorage.setItem('cuser', JSON.stringify(user))
},
/*
* 朋友圈数据列表mutations
*/
wecircleDataList (state, list) {
if (list.first) {
state.wecircleDataList = []
} else {
state.wecircleDataList = state.wecircleDataList.concat(list)
}
},
wecirclePage (state, page) {
state.wecirclePage = page
},
/*
* 添加评论mutations
*/
addComment (state, obj) {
var list = state.wecircleDataList
for (var i = 0; i < list.length; i++) {
if (list[i].id === obj.pid) {
list[i].comments.push({
content: obj.content,
user: obj.user
})
}
}
},
/*
* 添加点赞mutations
*/
addLike (state, obj) {
var list = state.wecircleDataList
// 在wecircleDataList里找到当前点赞的那个post,然后修改lists字段
for (var i = 0; i < list.length; i++) {
if (list[i].id === obj.pid) {
list[i].isLike = true
list[i].likes.push({
user: obj.user
})
}
}
},
/*
* 取消点赞mutations
*/
removeLike (state, obj) {
var list = state.wecircleDataList
for (var i = 0; i < list.length; i++) {
if (list[i].id === obj.pid) {
list[i].isLike = false
var array = []
for (var j = 0; j < list[i].likes.length; j++) {
if (list[i].likes[j].user._id !== obj.user._id) {
array.push(list[i].likes[j])
}
}
list[i].likes = array
}
}
},
/*
* 关闭评论点赞面板mutations
*/
closeCLPanel (state, obj) {
state.closeCLPanelFlag = obj
},
/*
* 设置搜索关键字mutations
*/
setKeyword (state, str) {
state.keyword = str
}
},
actions: {
setUser (context, user) {
// 增加action
context.commit('currentUser', user)
},
setWecircleDataList (context, list) {
context.commit('wecircleDataList', list)
},
setWecircleDataListSSR (context) {
return service.getNoHeader('post/getcirclepost', {
pageStart: 0
}).then((resp) => {
let array = []
resp.data.forEach(item => {
array.push({
id: item._id, // post的id
avatar: item.user.avatar, // 头像url
nickname: item.user.nickname, // 昵称
content: item.content, // 内容
piclist: item.picList, // 图片内容
comments: item.comments, // 评论数据
time: formatTime(new Date(item.create).getTime() / 1000), // 将后台返回的GMT时间转变成本地时间
isLike: item.isLike, // 是否本人已经点赞
likes: item.likes, // 点赞的数据
user: item.user// 发表者的数据
})
})
context.commit('wecircleDataList', array)
context.commit('wecirclePage', 0)
})
},
addComment (context, obj) {
context.commit('addComment', obj)
},
addLike (context, obj) {
context.commit('addLike', obj)
},
removeLike (context, obj) {
context.commit('removeLike', obj)
},
setKeyword (context, str) {
context.commit('setKeyword', str)
},
closeCLPanel (context, obj) {
context.commit('closeCLPanel', obj)
},
setWecirclePage (context, obj) {
context.commit('wecirclePage', obj)
}
}
})
}
|
"use strict";
var _interopRequireDefault = require("@babel/runtime/helpers/builtin/interopRequireDefault");
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;
var _react = _interopRequireDefault(require("react"));
var _createSvgIcon = _interopRequireDefault(require("./utils/createSvgIcon"));
var _default = (0, _createSvgIcon.default)(_react.default.createElement(_react.default.Fragment, null, _react.default.createElement("path", {
fill: "none",
d: "M0 0h24v24H0V0z"
}), _react.default.createElement("circle", {
cx: "11",
cy: "8",
r: "2",
opacity: ".3"
}), _react.default.createElement("path", {
d: "M5 18h4.99L9 17l.93-.94C7.55 16.33 5.2 17.37 5 18z",
opacity: ".3"
}), _react.default.createElement("path", {
d: "M11 12c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm0-6c1.1 0 2 .9 2 2s-.9 2-2 2-2-.9-2-2 .9-2 2-2zM10 18H5c.2-.63 2.55-1.67 4.93-1.94h.03l.46-.45L12 14.06c-.39-.04-.68-.06-1-.06-2.67 0-8 1.34-8 4v2h9l-2-2zM20.6 12.5l-5.13 5.17-2.07-2.08L12 17l3.47 3.5L22 13.91z"
})), 'HowToRegTwoTone');
exports.default = _default;
|
import React from "react";
import { map } from "ramda";
import PostListItem from "./components/PostListItem";
import Container from "components/Layout/Container";
const renderPosts = map(post => (
<PostListItem item={post} key={post.node.id} />
));
const PostList = ({ posts }) => {
return <Container>{renderPosts(posts)}</Container>;
};
export default PostList;
|
import {createConfig} from '../../scripts/create.rollup.config'
import pakg from './package.json'
export default createConfig(pakg,'BrickDesign')
|
var struct__nvpnode =
[
[ "name", "struct__nvpnode.html#a3780d85aec87b4e9de181c501c1c3bc9", null ],
[ "next", "struct__nvpnode.html#aac5711b7fd606ab939629d6846aeaf10", null ],
[ "val", "struct__nvpnode.html#a4dc4ac517d07d1f0fd1216c98de32c3d", null ]
];
|
(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["error/401~error/404~error/500"],{"9a79":function(t,e,n){"use strict";n("b833")},b833:function(t,e,n){},c619:function(t,e,n){},f5c0:function(t,e,n){"use strict";var r=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"error-page"},[n("div",{staticClass:"content-con"},[n("img",{attrs:{src:t.src,alt:"404"}}),n("div",{staticClass:"text-con"},[n("h4",[t._v(t._s(t.code))]),n("h5",[t._v(t._s(t.desc))])]),n("back-btn-group",{staticClass:"back-btn-group"})],1)])},c=[],o=(n("c619"),function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",[n("el-button",{attrs:{size:"large",type:"text"},on:{click:t.backHome}},[t._v("返回首页")]),n("el-button",{attrs:{size:"large",type:"text"}},[t._v("返回上一页("+t._s(t.second)+"s)")])],1)}),s=[],a=(n("ac1f"),n("5319"),{name:"backBtnGroup",data:function(){return{second:5,timer:null}},methods:{backHome:function(){this.$router.replace({name:this.$config.homeName})},backPrev:function(){this.$router.go(-1)}},mounted:function(){var t=this;this.timer=setInterval((function(){0===t.second?t.backPrev():t.second--}),1e3)},beforeDestroy:function(){clearInterval(this.timer)}}),i=a,u=(n("9a79"),n("2877")),l=Object(u["a"])(i,o,s,!1,null,null,null),b=l.exports,f={name:"error_content",components:{backBtnGroup:b},props:{code:String,desc:String,src:String}},p=f,d=Object(u["a"])(p,r,c,!1,null,null,null);e["a"]=d.exports}}]);
|
search_result['71']=["topic_000000000000001A_methods--.html","ErrorController Methods",""];
|
import React from 'react';
import {Card, Grid, CardMedia, CardContent, Typography, Button} from '@material-ui/core/';
import makeStyles from '@material-ui/core/styles/makeStyles';
import {StarIcon} from '../../public/svg-icons';
const useStyle = makeStyles(theme => ({
display: {
width: "100%",
height: "100%",
[theme.breakpoints.up('md')]: {
minHeight: 200,
},
[theme.breakpoints.up('sm')]: {
maxWidth: 565,
minHeight: 150,
},
[theme.breakpoints.down("xs")]: {
maxHeight: 430,
minHeight: 200,
}
},
card: {
width: "100%",
[theme.breakpoints.down("xs")]: {
marginRight: 3,
marginLeft: 0,
},
},
inner: {
minHeight: 200,
display: "flex",
flexDirection: "column",
padding: 5,
[theme.breakpoints.up('md')]: {
padding: 10,
paddingBottom: 20,
}
},
pullDown: {
marginTop: "auto",
[theme.breakpoints.up('md')]: {
marginTop: 10,
},
[theme.breakpoints.down('xs')]: {
marginTop: 15,
}
},
span: {
backgroundColor: "#f8f5a7",
margin: 3,
marginLeft: 0,
fontSize: '0.9rem',
padding: 3,
borderRadius: 1,
[theme.breakpoints.down('sm')]: {
fontSize: '0.85rem',
}
},
discount: {
color: "red",
fontSize: "1.2rem",
[theme.breakpoints.down('sm')]: {
fontSize: '1.05rem',
}
},
slashedPrice: {
color: "gray",
textDecoration: "line-through",
},
price: {
color: "#236a0d",
fontSize: "1.5rem",
[theme.breakpoints.down('md')]: {
fontSize: '1.4rem',
},
[theme.breakpoints.down('sm')]: {
fontSize: '1.3rem',
},
[theme.breakpoints.down('xs')]: {
fontSize: '1.2rem',
}
},
title: {
fontSize: '1.5rem',
color: '#0a4f4f',
margin: 0,
[theme.breakpoints.down('md')]: {
fontSize: '1.4rem',
},
[theme.breakpoints.down('sm')]: {
fontSize: '1.3rem',
},
[theme.breakpoints.down('xs')]: {
fontSize: '1.2rem',
}
},
location: {
fontSize: '1.2rem',
[theme.breakpoints.down('md')]: {
fontSize: '1.1rem',
},
[theme.breakpoints.down('xs')]: {
fontSize: '1rem',
}
},
details: {
margin: 0,
fontSize: '1rem',
[theme.breakpoints.down('md')]: {
fontSize: '0.98rem',
},
[theme.breakpoints.down('xs')]: {
fontSize: '0.95rem',
}
},
size: {
backgroundColor: 'black',
color: 'white',
padding: 4,
fontSize: '0.9rem'
},
rating: {
margin: 0,
fontSize: '1.2rem',
[theme.breakpoints.down('md')]: {
fontSize: '1.1rem',
},
[theme.breakpoints.down('xs')]: {
fontSize: '1rem',
}
},
pax: {
margin: 0,
padding: 3,
borderRadius: 1,
backgroundColor: '#dbf3f3',
[theme.breakpoints.down('sm')]: {
fontSize: '0.95rem',
}
},
status: {
color: "white",
padding: 2,
margin: '2px 0px 2px 0px',
borderRadius: 1,
},
icon: {
height: 20,
[theme.breakpoints.down('sm')]: {
height: 18,
},
}
}));
const PropertyContainerTest = (props) => {
const expandable = React.useState(false);
const classes = useStyle();
const amenities = (props.amenities)
?props.amenities.map((item, index) => <span className={classes.span} key={index}> {item} </span>)
:"";
const button = () => {
switch (props.type) {
case "CONFIRM":
return {
color: "secondary",
text: "CONFIRM",
};
case "VIEW":
return {
color: "primary",
text: "VIEW BOOKING",
};
case "BOOK":
default: return {
color: "primary",
style: {
backgroundColor: '#0a4f4f'
},
text: "BOOK",
}
}
}
const status = () => {
switch (props.status) {
case "Unpaid":
return {
text: "Unpaid",
style: {
backgroundColor: 'maroon',
}
}
case "Done":
return {
text: "Done",
style: {
backgroundColor: 'gray',
}
}
case "Paid":
default:
return {
text: "Paid",
style: {
backgroundColor: '#1c6506'
}
}
}
}
return (
<React.Fragment>
<Card className={classes.card} elevation={4}>
<Grid item xs={12} container justify="center" style={{height: '100%'}}>
<Grid item xs={12} sm={4} container justify="center">
<img src={props.imgSrc} className={classes.display} />
</Grid>
<Grid item xs={12} sm={8} className={classes.inner}>
<Grid container item direction="row" xs={12}>
<Grid item xs={8}>
<h5 className={classes.title}>
{props.title}
</h5>
<div>
<h3 style={{margin: 0}} className={classes.location}>
{props.location ?props.location :""}
</h3>
{props.details ?<p className={classes.details}> <i> {props.details} </i> </p> :""}
<Typography>
{amenities}
</Typography>
{props.size
?<p style={{margin: "5px 0px 5px 0px"}}>
<span className={classes.size}>
Room size: {props.size}
</span>
</p>
:""
}
</div>
</Grid>
<Grid item container alignItems="flex-end" direction="column" xs={4}>
{props.rating
?<Grid item container alignItems="center" justify="flex-end" style={{color: '#fdc806'}}>
<p className={classes.rating}> {props.rating} </p>
<StarIcon className={classes.icon} />
</Grid>
:""
}
{props.price.discount
?<React.Fragment>
<Typography>
<span className={classes.slashedPrice}> P{props.price.oPrice} </span>
</Typography>
<Typography>
<span className={classes.discount}> {`${props.price.discount*100}%`} off! </span>
</Typography>
</React.Fragment>
:""
}
<Typography>
<span className={classes.price}> P{props.price.price} </span>
</Typography>
{props.pax
?<p className={classes.pax}>
{props.pax} person{props.pax > 1 && 's'}
</p>
:""
}
{props.moredetails ?props.moredetails :""}
{props.status
?<p sytle={{margin: 0}}>
<span style={{...status().style}} className={classes.status}>
{status().text}
</span>
</p>
:""
}
</Grid>
</Grid>
<Grid item className={classes.pullDown}>
<Button
fullWidth
variant="contained"
onClick={props.handleBook}
color={button().color}
disabled={props.disabled}
style={button().style, {backgroundColor: props.disabled && 'gray', cursor: props.disabled && 'not-allowed'}}
>
{button().text}
</Button>
</Grid>
</Grid>
</Grid>
</Card>
</React.Fragment>
);
}
export default PropertyContainerTest;
|
(function (translator) {
translator.translations["fr"] = {
// javascript alerts or messages
"testneteditionactivated": "ÉDITION TESTNET ACTIVÉE",
"paperlabelbitcoinaddress": "Adresse Dash:",
"paperlabelprivatekey": "Clé Privée:",
"paperlabelencryptedkey": "Encrypted Private Key (Password required)", //TODO: please translate
"bulkgeneratingaddresses": "Création de l'adresse... ",
"brainalertpassphrasetooshort": "Le mot de passe que vous avez entré est trop court.\n\n",
"brainalertpassphrasewarning": "Attention: Choisir un mot de passe solide est important pour vous protéger des attaques bruteforce visant à trouver votre mot de passe et voler vos Dash.",
"brainalertpassphrasedoesnotmatch": "Le mot de passe ne correspond pas au mot de passe de vérification.",
"detailalertnotvalidprivatekey": "Le texte que vous avez entré n'est pas une Clé Privée valide",
"detailconfirmsha256": "Le texte que vous avez entré n'est pas une Clé Privée valide!\n\nVoulez-vous utiliser le texte comme un mot de passe et créer une Clé Privée à partir d'un hash SHA256 de ce mot de passe?\n\nAttention: Choisir un mot de passe solide est important pour vous protéger des attaques bruteforce visant à trouver votre mot de passe et voler vos Dash.",
"bip38alertincorrectpassphrase": "Incorrect passphrase for this encrypted private key.", //TODO: please translate
"bip38alertpassphraserequired": "Mot de passe a inventé pour crypter en BIP38",
"vanityinvalidinputcouldnotcombinekeys": "Entrée non valide. Impossible de combiner les clés.",
"vanityalertinvalidinputpublickeysmatch": "Entrée non valide. La clé publique des deux entrées est identique. Vous devez entrer deux clés différentes.",
"vanityalertinvalidinputcannotmultiple": "Entrée non valide. Il n'est pas possible de multiplier deux clés publiques. Sélectionner 'Ajouter' pour ajouter deux clés publiques pour obtenir une adresse Dash.",
"vanityprivatekeyonlyavailable": "Seulement disponible si vos combinez deux clés privées",
"vanityalertinvalidinputprivatekeysmatch": "Entrée non valide. La clé Privée des deux entrées est identique. Vous devez entrer deux clés différentes.",
// header and menu html
"tagline": "Générateur De Porte-Monnaie Dash Javascript Hors-Ligne",
"generatelabelbitcoinaddress": "Création de l'adresse Dash...",
"generatelabelmovemouse": "BOUGEZ votre souris pour ajouter de l'entropie...",
"generatelabelkeypress": "OU veuillez taper des caractères aléatoires dans le rectangle blanc suivant",
"singlewallet": "Porte-Monnaie Simple",
"paperwallet": "Porte-Monnaie Papier",
"bulkwallet": "Porte-Monnaie En Vrac",
"brainwallet": "Porte-Monnaie Cerveau",
"vanitywallet": "Porte-Monnaie Vanité",
"splitwallet": "Split Wallet", //TODO: please translate
"detailwallet": "Détails du Porte-Monnaie",
// footer html
"footerlabeldonations": "Dons:",
"footerlabeltranslatedby": "Traduction: 1Gy7NYSJNUYqUdXTBow5d7bCUEJkUFDFSq",
"footerlabelpgp": "PGP",
"footerlabelversion": "Historique De Version",
"footerlabelgithub": "Dépôt GitHub",
"footerlabelgithubzip": "zip",
"footerlabelsig": "sig",
"footerlabelcopyright1": "Copyright bitaddress.org, The Dash Developers.",
"footerlabelcopyright2": "Les droits d'auteurs JavaScript sont inclus dans le code source.",
"footerlabelnowarranty": "Aucune garantie.",
// status html
"statuslabelcryptogood": "✔ Good!", //TODO: please translate
"statuslabelcryptogood1": "Your browser can generate cryptographically random keys using window.crypto.getRandomValues", //TODO: please translate
"statusokcryptogood": "OK", //TODO: please translate
"statuslabelcryptobad": "× Oh no!", //TODO: please translate
"statuslabelcryptobad1": "Your browser does NOT support window.crypto.getRandomValues. You should use a more modern browser with this generator to increase the security of the keys generated.",
"statusokcryptobad": "OK", //TODO: please translate
"statuslabelunittestsgood": "✔ Good!", //TODO: please translate
"statuslabelunittestsgood1": "All synchronous unit tests passed.", //TODO: please translate
"statusokunittestsgood": "OK", //TODO: please translate
"statuslabelunittestsbad": "× Oh no!", //TODO: please translate
"statuslabelunittestsbad1": "Some synchronous unit tests DID NOT pass. You should find another browser to use with this generator.", //TODO: please translate
"statusokunittestsbad": "OK", //TODO: please translate
"statuslabelprotocolgood": "✔ Good!", //TODO: please translate
"statuslabelprotocolgood1": "You are running this generator from your local computer. <br />Tip: Double check you are offline by trying ", //TODO: please translate
"statusokprotocolgood": "OK", //TODO: please translate
"statuslabelprotocolbad": "⚠ Think twice!", //TODO: please translate
"statuslabelprotocolbad1": "You appear to be running this generator online from a live website. For valuable wallets it is recommended to", //TODO: please translate
"statuslabelprotocolbad2": "download", //TODO: please translate
"statuslabelprotocolbad3": "the zip file from GitHub and run this generator offline as a local html file.", //TODO: please translate
"statusokprotocolbad": "OK", //TODO: please translate
"statuslabelkeypool1": "This is a log of all the Dash Addresses and Private Keys you generated during your current session. Reloading the page will create a new session.", //TODO: please translate
"statuskeypoolrefresh": "Refresh", //TODO: please translate
"statusokkeypool": "OK", //TODO: please translate
// single wallet html
"newaddress": "Générer Une Nouvelle Adresse",
"singleprint": "Imprimer",
"singlelabelbitcoinaddress": "Adresse Dash:",
"singlelabelprivatekey": "Clé Privée (Format d'importation de porte-monnaie):",
"singletip1": "Un porte-monnaie Dash est aussi simple qu'une paire d'adresses Dash dont une correspond à l'adresse privée Dash. Ce porte-monnaie affiché a été généré pour vous dans votre propre navigateur internet et est donc affiché ci-dessus.",
"singletip2": "Pour garder en sécurité ce porte-monnaie, vous devez l'imprimer ou, alternativement, enregistrer l'adresse de réception Dash et la clé privée. Il est important de créer une copie de sauvegarde de la clé privée et de la stocker à un endroit sûr. Ce site n'a aucune base prédéterminée ou de sauvegarde de votre clé privée. Si vous êtes initiés à PGP, vous pouvez télécharger la version toute-en-1 de la page HTML et ainsi vérifier que vous avez une version authentique issue de l'auteur du site en comparant l'encryptage SHA1 de votre page HTML sauvegardée avec l'encryptage SHA1 disponible sur l'historique certifiée indiquée en bas de ce site. Si vous quittez ou rafraichissez ce site ou que vous appuyez sur \"générer une nouvelle adresse\" ... alors une nouvelle clé privée sera générée et la précédente clé privée affichée ne pourra plus être retrouvée. Votre clé privée Dash doit être gardée secrète. Celui qui connaît la clé privée aura la possibilité de vider tous les Dash accumulés et associés à l'adresse de réception. Si vous imprimez le porte-monnaie, pensez à le mettre à l'abri de l'eau dans un sac étanche. Traitez le porte-monnaie papier comme de l'argent en espèces et billets.",
"singletip3": "Pour ajouter des fonds à votre porte-monnaie, indiquez d'envoyer les Dash à votre adresse de réception.",
"singletip4": "Vérifier le contenu de votre porte-monnaie en consultant explorer.dash.org/address et en y tapant votre adresse de réception Dash.",
"singletip5": "Pour dépenser vos Dash, en y important votre clé privée dans un porte-monnaie P2P. Gardez à l'esprit que quand vous importez votre clé privée dans le programme P2P Dash et que vous dépensez vos fonds, votre clé privée sera intégrée avec d'autres clés privées dans le porte-monnaie P2P. Quand vous effectuez une transaction, le changement sera envoyé sur une autre adresse Dash privée à l'intérieur du porte-monnaie P2P. Vous DEVEZ, alors, faire une sauvegarde du porte-monnaie P2P et le garder en sécurité car l'ensemble des Dash restant y sera stocké. Satoshi a averti qu'il ne faudrait jamais supprimer un porte-monnaie.",
"singleshare": "PARTAGER",
"singlesecret": "SECRET",
// paper wallet html
"paperlabelhideart": "Enlever l'image ?",
"paperlabeladdressesperpage": "Adresses par page:",
"paperlabeladdressestogenerate": "Nombre d'adresses à créer:",
"papergenerate": "Générer",
"paperprint": "Imprimer",
"paperlabelBIPpassphrase": "mot de passe:",
"paperlabelencrypt": "Cryptage en BIP38 ?", //TODO: please translate
// bulk wallet html
"bulklabelstartindex": "Commencer à l'index:",
"bulklabelrowstogenerate": "Colonnes à générer:",
"bulklabelcompressed": "Compressed addresses?", //TODO: please translate
"bulkgenerate": "Générer",
"bulkprint": "Imprimer",
"bulklabelcsv": "Valeurs Séparées Par Des Virgules (CSV):",
"bulklabelformat": "Index,Adresse,Clé Privée (WIF)",
"bulklabelq1": "Pourquoi utiliserais-je un Porte-monnaie en vrac pour accepter les Dash sur mon site web?",
"bulka1": "L'approche traditionnelle pour accepter des Dash sur votre site web requière l'installation du logiciel Dash officiel (\"dashd\"). Plusieurs hébergeurs ne supportent pas l'installation du logiciel Dash. De plus, faire fonctionner le logiciel Dash sur votre serveur web signifie que vos clés privées sont hébergées sur le serveur et pourraient donc être volées si votre serveur web était compromis. En utilisant un Porte-monnaie en vrac, vous pouvez publiquer seulement les adresses Dash sur votre serveur et non les clés privées. Vous n'avez alors pas à vous inquiéter du risque de vous faire voler votre porte-monnaie si votre serveur était compromis.",
"bulklabelq2": "Comment utiliser le Porte-monnaie en vrac pour utiliser le Dash sur mon site web?",
"bulklabela2li1": "Utilisez le Porte-monnaie en vrac pour pré-générer une large quantité d'adresses Dash (10,000+). Copiez collez les données séparées par des virgules (CSV) dans un fichier texte sécurisé dans votre ordinateur. Sauvegardez ce fichier dans un endroit sécurisé.",
"bulklabela2li2": "Importez les adresses Dash dans une base de donnée sur votre serveur web. (N'ajoutez pas le porte-monnaie ou les clés privées sur votre serveur web, sinon vous courrez le risque de vous faire voler si votre serveur est compromis. Ajoutez seulement les adresses Dash qui seront visibles à vos visiteurs.)",
"bulklabela2li3": "Ajoutez une option dans votre panier en ligne pour que vos clients puissent vous payer en Dash. Quand un client choisi de vous payer en Dash, vous pouvez afficher une des adresses de votre base de donnée comme \"adresse de paiment\" pour votre client et sauvegarder cette adresse avec sa commande.",
"bulklabela2li4": "Vous avez maintenant besoin d'être avisé quand le paiement est reçu. Cherchez \"Dash payment notification\" sur Google et inscrivez-vous à un service de notification de paiement Dash. Il y a plusieurs services qui vous avertiront via des services Web, API, SMS, Email, etc. Une fois que vous avez reçu la notification, qui devrait être programmée automatiquement, vous pouvez traiter la commande de votre client. Pour vérifier manuellement si un paiement est arrivé, vous pouvez utiliser Block Explorer. Remplacez ADRESSE par l'adresse Dash que vous souhaitez vérifier. La confirmation de la transaction pourrait prendre de 10 à 60 minutes pour être confirmée.<br />http://explorer.dash.org/address/address/ADRESSE<br /><br />Les transactions non confirmées peuvent être visualisées ici: https://bchain.info/Dash/ or http://insight.dash.siampm.com/ <br />Vous devriez voir la transaction à l'intérieur de 30 secondes.",
"bulklabela2li5": "Les Dash vos s'accumuler de façon sécuritaire dans la chaîne de blocs. Utilisez le porte-monnaie original que vous avez généré à l'étape 1 pour les dépenser.",
// brain wallet html
"brainlabelenterpassphrase": "Entrez votre mot de passe: ",
"brainlabelshow": "Afficher?",
"brainprint": "Imprimer",
"brainlabelconfirm": "Confirmer le mot de passe: ",
"brainview": "Visualiser",
"brainalgorithm": "Algorithme: SHA256(mot de passe)",
"brainlabelbitcoinaddress": "Adresse Dash:",
"brainlabelprivatekey": "Clé Privée (Format d'importation de porte-monnaie):",
// vanity wallet html
"vanitylabelstep1": "Étape 1 - Générer votre \"Étape 1 Paire De Clés\"",
"vanitynewkeypair": "Générer",
"vanitylabelstep1publickey": "Étape 1 Clé Publique:",
"vanitylabelstep1pubnotes": "Copiez celle-ci dans la case Votre-Clé-Publique du site de Vanity Pool.",
"vanitylabelstep1privatekey": "Step 1 Clé Privée:",
"vanitylabelstep1privnotes": "Copiez la cette Clé Privée dans un fichier texte. Idéalement, sauvegardez la dans un fichier encrypté. Vous en aurez besoin pour récupérer la Clé Privée lors que Vanity Pool aura trouvé votre préfixe.",
"vanitylabelstep2calculateyourvanitywallet": "Étape 2 - Calculer votre Porte-monnaie Vanité",
"vanitylabelenteryourpart": "Entrez votre Clé Privée (générée à l'étape 1 plus haut et précédemment sauvegardée):",
"vanitylabelenteryourpoolpart": "Entrez la Clé Privée (provenant de Vanity Pool):",
"vanitylabelnote1": "[NOTE: cette case peut accepter une clé publique ou un clé privée]",
"vanitylabelnote2": "[NOTE: cette case peut accepter une clé publique ou un clé privée]",
"vanitylabelradioadd": "Ajouter",
"vanitylabelradiomultiply": "Multiplier",
"vanitycalc": "Calculer Le Porte-monnaie Vanité",
"vanitylabelbitcoinaddress": "Adresse Dash Vanité:",
"vanitylabelnotesbitcoinaddress": "Ci-haut est votre nouvelle adresse qui devrait inclure le préfix requis.",
"vanitylabelpublickeyhex": "Clé Public Vanité (HEX):",
"vanitylabelnotespublickeyhex": "Celle-ci est la Clé Publique dans le format hexadécimal. ",
"vanitylabelprivatekey": "Clé Privée Vanité (WIF):",
"vanitylabelnotesprivatekey": "Celle-ci est la Clé Privée pour accéder à votre porte-monnaie. ",
// detail wallet html
"detaillabelenterprivatekey": "Entrez la Clé Privée",
"detailkeyformats": "Key Formats: WIF, WIFC, HEX, B64, B6, MINI, BIP38",
"detailview": "Voir les détails",
"detailprint": "Imprimer",
"detaillabelnote1": "Votre Clé Privée Dash est un nombre secret que vous êtes le seul à connaître. Il peut être encodé sous la forme d'un nombre sous différents formats. Ci-bas, nous affichons l'adresse Dash et la Clé Publique qui corresponds à la Clé Privée ainsi que la Clé Privée dans les formats d'encodage les plus populaires (WIF, WIFC, HEX, B64).",
"detaillabelnote2": "Dash v0.6+ conserve les clés publiques dans un format compressé. Le logiciel supporte maintenant aussi l'importation et l'exportation de clés privées avec importprivkey/dumpprivkey. Le format de la clé privée exportée est déterminé selon la version du porte-monnaie Dash.",
"detaillabelbitcoinaddress": "Adresse Dash:",
"detaillabelbitcoinaddresscomp": "Adresse Dash (compressée):",
"detaillabelpublickey": "Clé Publique (130 caractères [0-9A-F]):",
"detaillabelpublickeycomp": "Clé Publique (compressée, 66 caractères [0-9A-F]):",
"detaillabelprivwif": "Clé Privée WIF<br />51 caractères base58, débute avec un a",
"detaillabelprivwifcomp": "Clé Privée WIF<br />compressée, 52 caractères base58, débute avec un a",
"detaillabelprivhex": "Clé Privée Format Hexadecimal (64 caractères [0-9A-F]):",
"detaillabelprivb64": "Clé Privée Base64 (44 caractères):",
"detaillabelprivmini": "Clé Privée Format Mini (22, 26 ou 30 caractères, débute avec un 'S'):",
"detaillabelpassphrase": "BIP38 Passphrase", //TODO: please translate
"detailbip38decryptbutton": "Decrypt BIP38", //TODO: please translate
"detailbip38encryptbutton": "Encrypt BIP38", //TODO: please translate
"detaillabelq1": "How do I make a wallet using dice? What is B6?", //TODO: please translate
"detaila1": "An important part of creating a Dash wallet is ensuring the random numbers used to create the wallet are truly random. Physical randomness is better than computer generated pseudo-randomness. The easiest way to generate physical randomness is with dice. To create a Dash private key you only need one six sided die which you roll 99 times. Stopping each time to record the value of the die. When recording the values follow these rules: 1=1, 2=2, 3=3, 4=4, 5=5, 6=0. By doing this you are recording the big random number, your private key, in B6 or base 6 format. You can then enter the 99 character base 6 private key into the text field above and click View Details. You will then see the Dash address associated with your private key. You should also make note of your private key in WIF format since it is more widely used." //TODO: please translate
};
})(ninja.translator);
|
import _inheritsLoose from "@babel/runtime/helpers/inheritsLoose";
import Ext_field_trigger_Trigger from './Ext/field/trigger/Trigger.js';
import ElementParser from './common/ElementParser.js';
var EWCTrigger = /*#__PURE__*/function (_Ext_field_trigger_Tr) {
_inheritsLoose(EWCTrigger, _Ext_field_trigger_Tr);
function EWCTrigger() {
var _this;
_this = _Ext_field_trigger_Tr.call(this, [], []) || this;
_this.xtype = 'trigger';
return _this;
}
return EWCTrigger;
}(Ext_field_trigger_Trigger);
export { EWCTrigger as default };
try {
if (window.customElements.get('ext-trigger') == undefined) {
window.customElements.define('ext-trigger', ElementParser.withParsedCallback(EWCTrigger));
}
} catch (e) {
if (window.customElements.get('ext-trigger') == undefined) {
window.customElements.define('ext-trigger', EWCTrigger);
}
}
|
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
// MODULES //
var isFunction = require( '@stdlib/assert/is-function' );
var isCollection = require( '@stdlib/assert/is-collection' );
var PINF = require( '@stdlib/constants/math/float64-pinf' );
var validate = require( './validate.js' );
var limit = require( './limit.js' );
// MAIN //
/**
* Returns a function for testing whether all elements in a collection pass a test implemented by a predicate function.
*
* ## Notes
*
* - If a predicate function calls the provided callback with a truthy error argument, the function suspends execution and immediately calls the `done` callback for subsequent error handling.
* - This function does **not** guarantee that execution is asynchronous. To do so, wrap the `done` callback in a function which either executes at the end of the current stack (e.g., `nextTick`) or during a subsequent turn of the event loop (e.g., `setImmediate`, `setTimeout`).
*
*
* @param {Options} [options] - function options
* @param {*} [options.thisArg] - execution context
* @param {PositiveInteger} [options.limit] - maximum number of pending invocations at any one time
* @param {boolean} [options.series=false] - boolean indicating whether to wait for a previous invocation to complete before invoking a provided function for the next element in a collection
* @param {Function} predicate - predicate function to invoke for each element in a collection
* @throws {TypeError} options argument must be an object
* @throws {TypeError} must provide valid options
* @throws {TypeError} last argument must be a function
* @returns {Function} function which invokes the predicate function once for each element in a collection
*
* @example
* var readFile = require( '@stdlib/fs/read-file' );
*
* function predicate( file, next ) {
* var opts = {
* 'encoding': 'utf8'
* };
* readFile( file, opts, onFile );
*
* function onFile( error ) {
* if ( error ) {
* return next( null, false );
* }
* next( null, true );
* }
* }
*
* var opts = {
* 'series': true
* };
*
* // Create an `everyByAsync` function which invokes the predicate function for each collection element sequentially:
* var everyByAsync = factory( opts, predicate );
*
* // Create a collection over which to iterate:
* var files = [
* './beep.js',
* './boop.js'
* ];
*
* // Define a callback which handles results:
* function done( error, bool ) {
* if ( error ) {
* throw error;
* }
* if ( bool ) {
* console.log( 'Successfully read all files.' );
* } else {
* console.log( 'Was unable to read all files.' );
* }
* }
*
* // Try to read each element in `files`:
* everyByAsync( files, done );
*/
function factory( options, predicate ) {
var opts;
var err;
var f;
opts = {};
if ( arguments.length > 1 ) {
err = validate( opts, options );
if ( err ) {
throw err;
}
f = predicate;
} else {
f = options;
}
if ( !isFunction( f ) ) {
throw new TypeError( 'invalid argument. Last argument must be a function. Value: `'+f+'`.' );
}
if ( opts.series ) {
opts.limit = 1;
} else if ( !opts.limit ) {
opts.limit = PINF;
}
return everyByAsync;
/**
* Invokes a predicate function for each element in a collection.
*
* @private
* @param {Collection} collection - input collection
* @param {Callback} done - function to invoke upon completion
* @throws {TypeError} first argument must be a collection
* @throws {TypeError} last argument must be a function
* @returns {void}
*/
function everyByAsync( collection, done ) {
if ( !isCollection( collection ) ) {
throw new TypeError( 'invalid argument. First argument must be a collection. Value: `'+collection+'.`' );
}
if ( !isFunction( done ) ) {
throw new TypeError( 'invalid argument. Last argument must be a function. Value: `'+done+'`.' );
}
return limit( collection, opts, f, clbk );
/**
* Callback invoked upon completion.
*
* @private
* @param {*} [error] - error
* @param {boolean} bool - test result
* @returns {void}
*/
function clbk( error, bool ) {
if ( error ) {
return done( error, false );
}
done( null, bool );
}
}
}
// EXPORTS //
module.exports = factory;
|
'use strict';
var path = require('path');
var assert = require('yeoman-assert');
var helpers = require('yeoman-generator').test;
var rootTmp = path.join(__dirname, '.tmp');
var gulpTasksPath = path.join(rootTmp, 'gulp/tasks');
var endOfLine = require('os').EOL;
describe('angular 1.x', function () {
before(function (done) {
helpers.run(path.join(__dirname, '../generators/app'))
.inDir(rootTmp)
.withPrompts({
framework: 'Angular 1.x',
reactPlugin: ''
})
.on('end', done);
});
it('adds the file references to Karma', function () {
var angularReferences = endOfLine.concat(' \'node_modules/angular/angular.min.js\',', endOfLine, ' \'node_modules/angular-mocks/angular-mocks.js\',');
assert.fileContent(path.join(rootTmp, 'karma.conf.js'), angularReferences);
});
it('creates template scripts', function() {
assert.file([
path.join(rootTmp, 'src/app.js'),
path.join(rootTmp, 'src/app.config.js')
]);
});
});
|
import { css } from 'styled-components';
const variables = css`
:root {
--dark-navy: #020c1b;
--navy: #0a192f;
--light-navy: #112240;
--lightest-navy: #q2340;
--navy-shadow: rgba(2, 12, 27, 0.7);
--dark-slate: #495670;
--slate: #8892b0;
--light-slate: #a8b2d1;
--lightest-slate: #ccd6f6;
--white: #e6f1ff;
--green: #64ffda;
--green-tint: rgba(100, 255, 218, 0.1);
--pink: #f57dff;
--blue: #57cbff;
--font-sans: 'Calibre', 'Inter', 'San Francisco', 'SF Pro Text', -apple-system, system-ui,
sans-serif;
--font-mono: 'SF Mono', 'Fira Code', 'Fira Mono', 'Roboto Mono', monospace;
--fz-xxs: 12px;
--fz-xs: 13px;
--fz-sm: 14px;
--fz-md: 16px;
--fz-lg: 18px;
--fz-xl: 20px;
--fz-xxl: 22px;
--fz-heading: 32px;
--border-radius: 4px;
--nav-height: 100px;
--nav-scroll-height: 70px;
--tab-height: 42px;
--tab-width: 120px;
--easing: cubic-bezier(0.645, 0.045, 0.355, 1);
--transition: all 0.25s cubic-bezier(0.645, 0.045, 0.355, 1);
--hamburger-width: 30px;
--ham-before: top 0.1s ease-in 0.25s, opacity 0.1s ease-in;
--ham-before-active: top 0.1s ease-out, opacity 0.1s ease-out 0.12s;
--ham-after: bottom 0.1s ease-in 0.25s, transform 0.22s cubic-bezier(0.55, 0.055, 0.675, 0.19);
--ham-after-active: bottom 0.1s ease-out,
transform 0.22s cubic-bezier(0.215, 0.61, 0.355, 1) 0.12s;
}
`;
export default variables;
|
import React, { Component } from 'react';
import PropTypes from 'prop-types';
import copyToClipboard from 'copy-to-clipboard';
import { shortenAddress, checksumAddress } from '../../../helpers/utils/util';
import Tooltip from '../../ui/tooltip';
class SelectedAccount extends Component {
state = {
copied: false,
};
static contextTypes = {
t: PropTypes.func,
};
static propTypes = {
selectedIdentity: PropTypes.object.isRequired,
};
componentDidMount() {
this.copyTimeout = null;
}
componentWillUnmount() {
if (this.copyTimeout) {
clearTimeout(this.copyTimeout);
this.copyTimeout = null;
}
}
render() {
const { t } = this.context;
const { selectedIdentity } = this.props;
const checksummedAddress = checksumAddress(selectedIdentity.address);
return (
<div className="selected-account">
<Tooltip
wrapperClassName="selected-account__tooltip-wrapper"
position="bottom"
title={
this.state.copied ? t('copiedExclamation') : t('copyToClipboard')
}
>
<button
className="selected-account__clickable"
onClick={() => {
this.setState({ copied: true });
this.copyTimeout = setTimeout(
() => this.setState({ copied: false }),
3000,
);
copyToClipboard(checksummedAddress);
}}
>
<div className="selected-account__name">
{selectedIdentity.name}
</div>
<div className="selected-account__address">
{shortenAddress(checksummedAddress)}
</div>
</button>
</Tooltip>
</div>
);
}
}
export default SelectedAccount;
|
import React, {useState} from "react";
import { Container,
Row,
Col,
Button,
FormGroup,
Input,
Form,
Modal } from "reactstrap";
import Footer from './Footer';
import SubNav from './Subnav';
import useForm from './UseForm'
import validate from './CreateProductValidateRules';
function CreateProduct() {
const [modal, setModal] = useState(false);
const postToDB = async () => {
const response = await fetch(`https://pet-shop-final-project.herokuapp.com/create_product`, {
method: "POST",
headers: {
'Accept': 'application/json, text/plain, */*',
'Content-Type': 'application/json',
'Authorization': `Token ${localStorage.getItem("token")}`
},
body: JSON.stringify(inputs)
})
const jsonData = await response.json()
if (jsonData.success) {
toggleModal()
}
else alert ("fail")
};
const {inputs, errors, handleInputChange, handleSubmit} = useForm(postToDB, validate);
const toggleModal = () => {
setModal(!modal);
};
return (
<>
<SubNav/>
<div className="page-header">
<div className="filter" />
<Container className="mt-5" style={{zIndex:1}}>
<Col><h1 className="text-white">Create Post</h1></Col>
<Form onSubmit={handleSubmit}>
<div className="row">
<div className="col-sm-7 col-md-7">
<Row>
<Col>
<FormGroup className={`form ${errors.name && 'has-danger'}`} >
<h6 className="text-white">
Product Name <span className="icon-danger">*</span>
</h6>
<div className="border-input input-group">
<Input
name="name"
onChange={handleInputChange}
value={inputs.name || ""}
placeholder="enter Product Name..."
type="text"
className="border-input form-control"
/>
</div>
{errors.name && (
<p className="help text-danger font-weight-bold">{errors.name}</p>
)}
</FormGroup>
</Col>
<Col>
<FormGroup className={`form ${errors.price && 'has-danger'}`} >
<h6 className="text-white">
Price <span className="icon-danger">*</span>
</h6>
<div className="border-input input-group">
<Input
name="price"
onChange={handleInputChange}
value={inputs.price || ""}
placeholder="enter price..."
type="number"
className="border-input form-control"
/>
<div className="input-group-append">
<span className="input-group-text">
<i className="fa fa-dollar" />
</span>
</div>
</div>
{errors.price && (
<p className="help text-danger font-weight-bold">{errors.price}</p>
)}
</FormGroup>
</Col>
</Row>
<Row>
<Col>
<FormGroup className={`form ${errors.category && 'has-danger'}`}>
<h6 for="exampleSelect1" className="text-white">Category <span className="icon-danger"> *</span></h6>
<Input
name="category"
onChange={handleInputChange}
value={inputs.category || ""}
type="select"
id="exampleSelect1"
>
<option value ="">Select</option>
<option>Foods</option>
<option>Toys</option>
<option>Walk-Ropes</option>
<option>Utensils</option>
<option>Training</option>
<option>Beds-Mattresses-Cat-Trees</option>
<option>Cages-Bags-Fences</option>
<option>Cosmetics</option>
<option>Costumes</option>
<option>Grooming-Tools</option>
<option>Heath-Cares-Cat-Sands</option>
<option>Walk-Your-Pet</option>
<option>Grooming-Services</option>
<option>Pet-Hotels</option>
<option>Matchmaking-Services</option>
<option>Training-For-Pet</option>
<option>Carrer-Courses</option>
<option>Puppies</option>
<option>Kittens</option>
</Input>
{errors.category && (
<p className="help text-danger font-weight-bold">{errors.category}</p>
)}
</FormGroup>
</Col>
<Col>
<FormGroup className={`form ${errors.pet_size && 'has-danger'}`} >
<h6 for="exampleSelect2" className="text-white">Pet Size <span className="icon-danger"> *</span></h6>
<Input
name="pet_size"
onChange={handleInputChange}
value={inputs.pet_size || ""}
type="select"
id="exampleSelect2">
<option value ="">Select</option>
<option>XS</option>
<option>S</option>
<option>M</option>
<option>L</option>
<option>XL</option>
<option>All</option>
</Input>
{errors.pet_size && (
<p className="help text-danger font-weight-bold">{errors.pet_size}</p>
)}
</FormGroup>
</Col>
</Row>
<div className="form-group mt-1 mb-5">
<h6 className="text-white">Description</h6>
<textarea
name="description"
onChange={handleInputChange}
value={inputs.description || ""}
maxLength={250}
placeholder="enter the description ..."
rows={8}
className="textarea-limited form-control"
defaultValue={""}
/>
</div>
</div>
<div className="col-sm-5 col-md-5">
<h6 className="text-white">Product Image</h6>
<div className="fileinput text-center mb-2">
<img
style={{width:"200px"}}
src="https://camo.githubusercontent.com/d1b266fad8e2d9abd4a033a02a68f98e5ca53509/68747470733a2f2f6d61726b6574696e676465636f6e746575646f2e636f6d2f77702d636f6e74656e742f75706c6f6164732f323031372f30362f7468756d626e61696c2e706e67"
alt="..."
/>
<Input
name="imageUrl"
onChange={handleInputChange}
value={inputs.imageUrl || ""}
placeholder="enter the image url here..."
type="text"
className="border-input form-control"
/>
<div className="thumbnail">
</div>
</div>
</div>
</div>
<Row>
<Button
type="submit"
className="btn-round btn btn-info btn-block"
>
Save & Publish
</Button>
<Modal isOpen={modal} toggle={() => toggleModal()}>
<div className="modal-header">
<button
aria-label="Close"
className="close"
type="button"
onClick={toggleModal}
>
<span aria-hidden={true}>×</span>
</button>
<h5
className="modal-title text-center"
id="exampleModalLabel"
>
Modal title
</h5>
</div>
<div className="modal-body">
Your product has successfully uploaded
</div>
<div className="modal-footer">
<div className="left-side">
<Button
className="btn-link"
color="default"
type="button"
onClick={() => toggleModal()}
>
Push more products
</Button>
</div>
<div className="divider" />
</div>
</Modal>
</Row>
</Form>
</Container>
</div>
<Footer />
</>
);
}
export default CreateProduct;
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.