@things-factory/reference-app 6.0.25 → 6.0.28

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (923) hide show
  1. package/attachments/311f5a1f-9a28-4f45-b335-11f8bbb12317.png +0 -0
  2. package/attachments/4bff6789-9d9a-4b61-acfd-75e419eb9bf3.png +0 -0
  3. package/attachments/5f4b08bc-7574-461d-a54f-bd0462c3bd37.jpeg +0 -0
  4. package/attachments/8c562e28-85e9-4cff-a055-5a08a4e57b88.jpeg +0 -0
  5. package/attachments/a2f74466-cc49-47fb-8c2b-7b0cf23a644d.jpeg +0 -0
  6. package/attachments/da8aaec2-ad03-4eec-adfb-8a9812c8330a.jpeg +0 -0
  7. package/client/pages/data-entry/data-entry-generator-popup.js +1 -1
  8. package/client/pages/data-set/data-set-list-page.js +13 -0
  9. package/config.development.js +7 -32
  10. package/config.production.js +55 -0
  11. package/db.sqlite +0 -0
  12. package/dist-client/033a8a362e39e81521c5.png +0 -0
  13. package/dist-client/04d0a0b4f98288ff2746.png +0 -0
  14. package/dist-client/0567329dce1421547133.png +0 -0
  15. package/dist-client/08bbd147bbaa98b332db.png +0 -0
  16. package/dist-client/0aed78d02c1b6c64de60.png +0 -0
  17. package/dist-client/1212.js +1 -0
  18. package/dist-client/1442.js +1 -0
  19. package/dist-client/1550.js +1 -0
  20. package/dist-client/1593.js +1 -0
  21. package/dist-client/1689.js +1 -0
  22. package/dist-client/1733.js +1 -0
  23. package/dist-client/1766.js +1 -0
  24. package/dist-client/190b9d948ce6d6a87e94.png +0 -0
  25. package/dist-client/1c0dbf70fa46fc25deb8.png +0 -0
  26. package/dist-client/1c555219c119d1c496df.png +0 -0
  27. package/dist-client/1f4e2dcff0657747fad0.png +0 -0
  28. package/dist-client/2098.js +1 -0
  29. package/dist-client/2142.js +1 -0
  30. package/dist-client/2265.js +1 -0
  31. package/dist-client/22cf3c62ad9582d39c28.png +0 -0
  32. package/dist-client/23bb06ca921d23b125ba.png +0 -0
  33. package/dist-client/2418.js +1 -0
  34. package/dist-client/2568.js +1 -0
  35. package/dist-client/258.js +1 -0
  36. package/dist-client/27c4af6600f89bc8aa4c.png +0 -0
  37. package/dist-client/2878.js +1 -0
  38. package/dist-client/2883.js +1 -0
  39. package/dist-client/2990.js +1 -0
  40. package/dist-client/2d144601a82af822ac30.png +0 -0
  41. package/dist-client/3098662927a30fdb8a4d.png +0 -0
  42. package/dist-client/3127ee8dd683ba59bd7b.png +0 -0
  43. package/dist-client/337c5d211682e431be6c.png +0 -0
  44. package/dist-client/3513.js +1 -0
  45. package/dist-client/3557.js +1 -0
  46. package/dist-client/3565.js +1 -0
  47. package/dist-client/3594.js +1 -0
  48. package/dist-client/3734.js +2 -0
  49. package/dist-client/3734.js.LICENSE.txt +11 -0
  50. package/dist-client/3746.js +1 -0
  51. package/dist-client/383.js +2 -0
  52. package/dist-client/383.js.LICENSE.txt +9 -0
  53. package/dist-client/3872.js +1 -0
  54. package/dist-client/3910.js +1 -0
  55. package/dist-client/3955.js +1 -0
  56. package/dist-client/4083.js +1 -0
  57. package/dist-client/411cbf41ec0faa4535ff.png +0 -0
  58. package/dist-client/4141.js +2 -0
  59. package/dist-client/4141.js.LICENSE.txt +11 -0
  60. package/dist-client/4162710af8eacb02b3d0.png +0 -0
  61. package/dist-client/4184cd4ea6a8d7349e21.png +0 -0
  62. package/dist-client/427c4cb716f8c30bbd1e.png +0 -0
  63. package/dist-client/4327.js +1 -0
  64. package/dist-client/4365cff2c5809bcf52d9.png +0 -0
  65. package/dist-client/4447.js +1 -0
  66. package/dist-client/4511.js +2 -0
  67. package/dist-client/4511.js.LICENSE.txt +345 -0
  68. package/dist-client/4516.js +1 -0
  69. package/dist-client/4575.js +1 -0
  70. package/dist-client/4820.js +1 -0
  71. package/dist-client/4e16d62bc1e459fc5b25.png +0 -0
  72. package/dist-client/5085.js +2 -0
  73. package/dist-client/5085.js.LICENSE.txt +11 -0
  74. package/dist-client/526ad807daa9d0c4a816.png +0 -0
  75. package/dist-client/5407.js +1 -0
  76. package/dist-client/5562.js +1 -0
  77. package/dist-client/556db371e2df3f29cea0.png +0 -0
  78. package/dist-client/55772bbc827ad7017d35.png +0 -0
  79. package/dist-client/5665.js +1 -0
  80. package/dist-client/5671.js +1 -0
  81. package/dist-client/574.js +2 -0
  82. package/dist-client/574.js.LICENSE.txt +11 -0
  83. package/dist-client/5761.js +1 -0
  84. package/dist-client/5824.js +1 -0
  85. package/dist-client/5873.js +1 -0
  86. package/dist-client/591.js +1 -0
  87. package/dist-client/5beb3d1071d94d67b73b.png +0 -0
  88. package/dist-client/5c45b501555a5bcaf6bd.png +0 -0
  89. package/dist-client/5e63fb5c3d72a5c3854d.png +0 -0
  90. package/dist-client/6067.js +1 -0
  91. package/dist-client/6100.js +1 -0
  92. package/dist-client/6163.js +1 -0
  93. package/dist-client/6204.js +1 -0
  94. package/dist-client/6264682326a8907cc922.png +0 -0
  95. package/dist-client/6283.js +1 -0
  96. package/dist-client/6331.js +1 -0
  97. package/dist-client/64224c44c766e71e3253.png +0 -0
  98. package/dist-client/6466.js +1 -0
  99. package/dist-client/6671.js +1 -0
  100. package/dist-client/6791e5773eac3f253e24.png +0 -0
  101. package/dist-client/689d645de355b5bf70e9.png +0 -0
  102. package/dist-client/68fa02818b287fa99811.png +0 -0
  103. package/dist-client/6955.js +2 -0
  104. package/dist-client/6955.js.LICENSE.txt +649 -0
  105. package/dist-client/6fbc47ded1e56a97b6a9.png +0 -0
  106. package/dist-client/70ef12050d5c2bc1d18b.png +0 -0
  107. package/dist-client/7263.js +1 -0
  108. package/dist-client/73d122c80f6803d982ae.png +0 -0
  109. package/dist-client/7462.js +1 -0
  110. package/dist-client/7471.js +2 -0
  111. package/dist-client/7471.js.LICENSE.txt +20 -0
  112. package/dist-client/7528.js +2 -0
  113. package/dist-client/7528.js.LICENSE.txt +29 -0
  114. package/dist-client/7566.js +1 -0
  115. package/dist-client/7627.js +1 -0
  116. package/dist-client/763.js +2 -0
  117. package/dist-client/763.js.LICENSE.txt +11 -0
  118. package/dist-client/77407838ded3346a802e.png +0 -0
  119. package/dist-client/7793.js +1 -0
  120. package/dist-client/7809.js +1 -0
  121. package/dist-client/7862.js +1 -0
  122. package/dist-client/7953.js +1 -0
  123. package/dist-client/7a8893ef51203b1d41ba.png +0 -0
  124. package/dist-client/7bcfa66864686ddce32a.png +0 -0
  125. package/dist-client/7ca1e30e518e350cff5a.png +0 -0
  126. package/dist-client/7d9596c5140e7290967f.png +0 -0
  127. package/dist-client/8085.js +1 -0
  128. package/dist-client/8184.js +1 -0
  129. package/dist-client/8299.js +1 -0
  130. package/dist-client/8317.js +1 -0
  131. package/dist-client/8645.js +1 -0
  132. package/dist-client/8653.js +1 -0
  133. package/dist-client/8654.js +1 -0
  134. package/dist-client/8695.js +1 -0
  135. package/dist-client/8733.js +2 -0
  136. package/dist-client/8733.js.LICENSE.txt +3 -0
  137. package/dist-client/8752.js +1 -0
  138. package/dist-client/8795.js +1 -0
  139. package/dist-client/8818.js +1 -0
  140. package/dist-client/8848.js +2 -0
  141. package/dist-client/8848.js.LICENSE.txt +11 -0
  142. package/dist-client/8852.js +1 -0
  143. package/dist-client/8957.js +1 -0
  144. package/dist-client/8cf3afd5f21703b894da.png +0 -0
  145. package/dist-client/8f04bd1494e66102676e.png +0 -0
  146. package/dist-client/8f778f433221cc09f419.png +0 -0
  147. package/dist-client/9041.js +1 -0
  148. package/dist-client/9092.js +1 -0
  149. package/dist-client/9193.js +2 -0
  150. package/dist-client/9193.js.LICENSE.txt +8 -0
  151. package/dist-client/9251.js +1 -0
  152. package/dist-client/9288819b91c1e64a752d.png +0 -0
  153. package/dist-client/9313.js +2 -0
  154. package/dist-client/9313.js.LICENSE.txt +6 -0
  155. package/dist-client/9454482d54ddf8bb8f60.png +0 -0
  156. package/dist-client/9550.js +1 -0
  157. package/dist-client/960ff955855910a0f418.png +0 -0
  158. package/dist-client/9659.js +1 -0
  159. package/dist-client/9726.js +1 -0
  160. package/dist-client/9864.js +1 -0
  161. package/dist-client/9a6591477d12befc59d2.png +0 -0
  162. package/dist-client/9bac8829b2e3a98d04f5.png +0 -0
  163. package/dist-client/9d136a4324aad2667a79.png +0 -0
  164. package/dist-client/9d14a3b8c05bd19fde84.png +0 -0
  165. package/dist-client/aa152d1b3d3fd105c1e6.png +0 -0
  166. package/dist-client/assets/data-report.jpg +0 -0
  167. package/dist-client/assets/data-samples.jpg +0 -0
  168. package/dist-client/assets/diagram.jpg +0 -0
  169. package/dist-client/assets/editorjs-demo.css +415 -0
  170. package/dist-client/assets/favicon.ico +0 -0
  171. package/dist-client/assets/glue-table-indices.png +0 -0
  172. package/dist-client/assets/helps/index.md +1 -0
  173. package/dist-client/assets/images/add-user-1.png +0 -0
  174. package/dist-client/assets/images/add-user-2.png +0 -0
  175. package/dist-client/assets/images/add-user-3.png +0 -0
  176. package/dist-client/assets/images/add-user-4.png +0 -0
  177. package/dist-client/assets/images/background-animation.json +1 -0
  178. package/dist-client/assets/images/bg-auth-ui.png +0 -0
  179. package/dist-client/assets/images/bg-blue.png +0 -0
  180. package/dist-client/assets/images/bg-green.png +0 -0
  181. package/dist-client/assets/images/bg-input-select.png +0 -0
  182. package/dist-client/assets/images/bg-rail.png +0 -0
  183. package/dist-client/assets/images/create-policy-1.png +0 -0
  184. package/dist-client/assets/images/create-policy-2.png +0 -0
  185. package/dist-client/assets/images/create-policy-3.png +0 -0
  186. package/dist-client/assets/images/create-s3-bucket-1.png +0 -0
  187. package/dist-client/assets/images/create-s3-bucket-2.png +0 -0
  188. package/dist-client/assets/images/forklift.png +0 -0
  189. package/dist-client/assets/images/hatiolab-logo.png +0 -0
  190. package/dist-client/assets/images/home.png +0 -0
  191. package/dist-client/assets/images/icon-activate.png +0 -0
  192. package/dist-client/assets/images/icon-backinfo.png +0 -0
  193. package/dist-client/assets/images/icon-brand.png +0 -0
  194. package/dist-client/assets/images/icon-close.png +0 -0
  195. package/dist-client/assets/images/icon-congratulations.png +0 -0
  196. package/dist-client/assets/images/icon-domain.png +0 -0
  197. package/dist-client/assets/images/icon-editor-gradient-direction.png +0 -0
  198. package/dist-client/assets/images/icon-mobile-brand.png +0 -0
  199. package/dist-client/assets/images/icon-nametag.png +0 -0
  200. package/dist-client/assets/images/icon-profile.png +0 -0
  201. package/dist-client/assets/images/icon-properties-label.png +0 -0
  202. package/dist-client/assets/images/icon-properties-line-type.png +0 -0
  203. package/dist-client/assets/images/icon-properties-table.png +0 -0
  204. package/dist-client/assets/images/icon-resource-select.png +0 -0
  205. package/dist-client/assets/images/icon-result.png +0 -0
  206. package/dist-client/assets/images/icon-setting.png +0 -0
  207. package/dist-client/assets/images/invitation.png +0 -0
  208. package/dist-client/assets/images/person.png +0 -0
  209. package/dist-client/assets/images/profile.png +0 -0
  210. package/dist-client/assets/images/spinner.png +0 -0
  211. package/dist-client/assets/manifest/apple-1024.png +0 -0
  212. package/dist-client/assets/manifest/apple-120.png +0 -0
  213. package/dist-client/assets/manifest/apple-152.png +0 -0
  214. package/dist-client/assets/manifest/apple-167.png +0 -0
  215. package/dist-client/assets/manifest/apple-180.png +0 -0
  216. package/dist-client/assets/manifest/apple-touch-icon.png +0 -0
  217. package/dist-client/assets/manifest/badge-128x128.png +0 -0
  218. package/dist-client/assets/manifest/chrome-splashscreen-icon-384x384.png +0 -0
  219. package/dist-client/assets/manifest/chrome-touch-icon-192x192.png +0 -0
  220. package/dist-client/assets/manifest/icon-128x128.png +0 -0
  221. package/dist-client/assets/manifest/icon-192x192.png +0 -0
  222. package/dist-client/assets/manifest/icon-512x512.png +0 -0
  223. package/dist-client/assets/manifest/icon-72x72.png +0 -0
  224. package/dist-client/assets/manifest/icon-96x96.png +0 -0
  225. package/dist-client/assets/manifest/image-metaog.png +0 -0
  226. package/dist-client/assets/manifest/maskable_icon.png +0 -0
  227. package/dist-client/assets/manifest/ms-icon-144x144.png +0 -0
  228. package/dist-client/assets/manifest/ms-touch-icon-144x144-precomposed.png +0 -0
  229. package/dist-client/assets/manifest.json +27 -0
  230. package/dist-client/auth/activate.js +2 -0
  231. package/dist-client/auth/activate.js.LICENSE.txt +162 -0
  232. package/dist-client/auth/checkin.js +2 -0
  233. package/dist-client/auth/checkin.js.LICENSE.txt +83 -0
  234. package/dist-client/auth/forgot-password.js +2 -0
  235. package/dist-client/auth/forgot-password.js.LICENSE.txt +122 -0
  236. package/dist-client/auth/reset-password.js +2 -0
  237. package/dist-client/auth/reset-password.js.LICENSE.txt +122 -0
  238. package/dist-client/auth/result.js +2 -0
  239. package/dist-client/auth/result.js.LICENSE.txt +93 -0
  240. package/dist-client/auth/signin.js +2 -0
  241. package/dist-client/auth/signin.js.LICENSE.txt +122 -0
  242. package/dist-client/auth/signup.js +2 -0
  243. package/dist-client/auth/signup.js.LICENSE.txt +122 -0
  244. package/dist-client/auth/unlock-user.js +2 -0
  245. package/dist-client/auth/unlock-user.js.LICENSE.txt +122 -0
  246. package/dist-client/b62c2497caa3978e4cdc.png +0 -0
  247. package/dist-client/b640388996621bd3040e.png +0 -0
  248. package/dist-client/bac71281339c69e63421.png +0 -0
  249. package/dist-client/bb346e05d6b711d2ed8d.png +0 -0
  250. package/dist-client/c077fa0074e73452db46.png +0 -0
  251. package/dist-client/c62cd64b1413e4d1e652.png +0 -0
  252. package/dist-client/c81c6f2c0e82b3796b6e.png +0 -0
  253. package/dist-client/c9269a93bb18ae06affd.png +0 -0
  254. package/dist-client/ccd36ed4e050b84e523c.png +0 -0
  255. package/dist-client/cf23c1dc8743cf26dc75.png +0 -0
  256. package/dist-client/d39c2ce57a8c38e27e56.png +0 -0
  257. package/dist-client/d40282055a8309c96c4c.png +0 -0
  258. package/dist-client/d74f294abfe31d14964e.png +0 -0
  259. package/dist-client/d9b6b3243cd4bf2e63a8.png +0 -0
  260. package/dist-client/daacdd8ee024ac5b0379.png +0 -0
  261. package/dist-client/de7b6dfdbf9dfde49467.png +0 -0
  262. package/dist-client/e3466c7d8a49da978517.png +0 -0
  263. package/dist-client/e3efea6b1e596f2ceda3.png +0 -0
  264. package/dist-client/e433275c03dc4c240f48.png +0 -0
  265. package/dist-client/e6b1f9447b8d520a2f21.png +0 -0
  266. package/dist-client/e8af6dc62316e5759a73.png +0 -0
  267. package/dist-client/e8f855ba4a7793d0e0a4.png +0 -0
  268. package/dist-client/ed4ff0096ff238659d69.png +0 -0
  269. package/dist-client/f157b0233d3f083166e3.png +0 -0
  270. package/dist-client/f7183d9fb4a53537e50b.png +0 -0
  271. package/dist-client/fa33c0372723348a71c5.png +0 -0
  272. package/dist-client/fcdcd3b1851ab73ff6a0.png +0 -0
  273. package/dist-client/fd251baa5700266586a0.png +0 -0
  274. package/dist-client/fe12850d008bc2190ee7.png +0 -0
  275. package/dist-client/fffbf4ec108e494462bb.png +0 -0
  276. package/dist-client/headless-scene-components.js +2 -0
  277. package/dist-client/headless-scene-components.js.LICENSE.txt +688 -0
  278. package/dist-client/helps/about/components.md +3 -0
  279. package/dist-client/helps/about/framework/redirection.md +45 -0
  280. package/dist-client/helps/about/framework/typegraphql.md +74 -0
  281. package/dist-client/helps/about/framework.md +10 -0
  282. package/dist-client/helps/about/modules.md +7 -0
  283. package/dist-client/helps/about/things-factory.en.md +255 -0
  284. package/dist-client/helps/about/things-factory.ko.md +258 -0
  285. package/dist-client/helps/auth/appliance.en.md +22 -0
  286. package/dist-client/helps/auth/appliance.ko.md +40 -0
  287. package/dist-client/helps/auth/application.en.md +33 -0
  288. package/dist-client/helps/auth/images/app-binding.png +0 -0
  289. package/dist-client/helps/auth/images/appliance-generate-key.png +0 -0
  290. package/dist-client/helps/auth/images/appliance-sandbox-auth-1.png +0 -0
  291. package/dist-client/helps/auth/images/appliance-sandbox-auth-2.png +0 -0
  292. package/dist-client/helps/auth/images/appliance-sandbox-auth-3.png +0 -0
  293. package/dist-client/helps/auth/images/application-hub.png +0 -0
  294. package/dist-client/helps/auth/images/authorization-postman.png +0 -0
  295. package/dist-client/helps/auth/images/create-button2.png +0 -0
  296. package/dist-client/helps/auth/images/create-role.png +0 -0
  297. package/dist-client/helps/auth/images/flowchart-appliance-registration.jpg +0 -0
  298. package/dist-client/helps/auth/images/flowchart-role-management.jpg +0 -0
  299. package/dist-client/helps/auth/images/flowchart-user-account.jpg +0 -0
  300. package/dist-client/helps/auth/images/invite-user.png +0 -0
  301. package/dist-client/helps/auth/images/owner-transfer-confirm.png +0 -0
  302. package/dist-client/helps/auth/images/owner-transfer.png +0 -0
  303. package/dist-client/helps/auth/images/postman.png +0 -0
  304. package/dist-client/helps/auth/images/register-appliance-new.png +0 -0
  305. package/dist-client/helps/auth/images/register-appliance.png +0 -0
  306. package/dist-client/helps/auth/images/register-application.png +0 -0
  307. package/dist-client/helps/auth/images/registered-role.png +0 -0
  308. package/dist-client/helps/auth/images/role-list.png +0 -0
  309. package/dist-client/helps/auth/images/role-privilage.png +0 -0
  310. package/dist-client/helps/auth/images/role-privileges.png +0 -0
  311. package/dist-client/helps/auth/images/save-button2.png +0 -0
  312. package/dist-client/helps/auth/images/save-button3.png +0 -0
  313. package/dist-client/helps/auth/images/transfer-owner.png +0 -0
  314. package/dist-client/helps/auth/images/update-roles.png +0 -0
  315. package/dist-client/helps/auth/images/user-delete.png +0 -0
  316. package/dist-client/helps/auth/images/user-error.png +0 -0
  317. package/dist-client/helps/auth/images/user-invite.png +0 -0
  318. package/dist-client/helps/auth/images/user-roles.png +0 -0
  319. package/dist-client/helps/auth/roles.en.md +59 -0
  320. package/dist-client/helps/auth/roles.ko.md +42 -0
  321. package/dist-client/helps/auth/users.en.md +33 -0
  322. package/dist-client/helps/auth/users.ko.md +54 -0
  323. package/dist-client/helps/board-modeller/accessor.ko.md +4 -0
  324. package/dist-client/helps/board-modeller/accessor.md +4 -0
  325. package/dist-client/helps/board-modeller/accessor.zh.md +4 -0
  326. package/dist-client/helps/board-modeller/data-binding.ko.md +100 -0
  327. package/dist-client/helps/board-modeller/data-binding.md +100 -0
  328. package/dist-client/helps/board-modeller/data-binding.zh.md +89 -0
  329. package/dist-client/helps/board-modeller/data-spread.ko.md +57 -0
  330. package/dist-client/helps/board-modeller/data-spread.md +57 -0
  331. package/dist-client/helps/board-modeller/data-spread.zh.md +55 -0
  332. package/dist-client/helps/board-modeller/effects/animation.ko.md +46 -0
  333. package/dist-client/helps/board-modeller/effects/animation.md +47 -0
  334. package/dist-client/helps/board-modeller/effects/animation.zh.md +47 -0
  335. package/dist-client/helps/board-modeller/effects/hover-event.ko.md +55 -0
  336. package/dist-client/helps/board-modeller/effects/hover-event.md +57 -0
  337. package/dist-client/helps/board-modeller/effects/hover-event.zh.md +55 -0
  338. package/dist-client/helps/board-modeller/effects/retention.ko.md +4 -0
  339. package/dist-client/helps/board-modeller/effects/retention.md +4 -0
  340. package/dist-client/helps/board-modeller/effects/retention.zh.md +4 -0
  341. package/dist-client/helps/board-modeller/effects/shadow.ko.md +18 -0
  342. package/dist-client/helps/board-modeller/effects/shadow.md +21 -0
  343. package/dist-client/helps/board-modeller/effects/shadow.zh.md +19 -0
  344. package/dist-client/helps/board-modeller/effects/tap-event.ko.md +86 -0
  345. package/dist-client/helps/board-modeller/effects/tap-event.md +74 -0
  346. package/dist-client/helps/board-modeller/effects/tap-event.zh.md +74 -0
  347. package/dist-client/helps/board-modeller/images/animation-01.gif +0 -0
  348. package/dist-client/helps/board-modeller/images/animation-02.gif +0 -0
  349. package/dist-client/helps/board-modeller/images/animation-03.gif +0 -0
  350. package/dist-client/helps/board-modeller/images/animation-04.gif +0 -0
  351. package/dist-client/helps/board-modeller/images/animation-05.gif +0 -0
  352. package/dist-client/helps/board-modeller/images/animation-06.gif +0 -0
  353. package/dist-client/helps/board-modeller/images/animation-07.gif +0 -0
  354. package/dist-client/helps/board-modeller/images/animation-08.gif +0 -0
  355. package/dist-client/helps/board-modeller/images/animation-09.gif +0 -0
  356. package/dist-client/helps/board-modeller/images/animation-10.gif +0 -0
  357. package/dist-client/helps/board-modeller/images/common-property-text-align-horizontal.png +0 -0
  358. package/dist-client/helps/board-modeller/images/common-property-text-align-vertical.png +0 -0
  359. package/dist-client/helps/board-modeller/images/common-property-text-margin.png +0 -0
  360. package/dist-client/helps/board-modeller/images/component-3D.png +0 -0
  361. package/dist-client/helps/board-modeller/images/component-arrow.png +0 -0
  362. package/dist-client/helps/board-modeller/images/component-chart-gauge.png +0 -0
  363. package/dist-client/helps/board-modeller/images/component-container.png +0 -0
  364. package/dist-client/helps/board-modeller/images/component-datasource.png +0 -0
  365. package/dist-client/helps/board-modeller/images/component-etc.png +0 -0
  366. package/dist-client/helps/board-modeller/images/component-form.png +0 -0
  367. package/dist-client/helps/board-modeller/images/component-gauge.png +0 -0
  368. package/dist-client/helps/board-modeller/images/component-image.png +0 -0
  369. package/dist-client/helps/board-modeller/images/component-iot.png +0 -0
  370. package/dist-client/helps/board-modeller/images/component-line.png +0 -0
  371. package/dist-client/helps/board-modeller/images/component-shape.png +0 -0
  372. package/dist-client/helps/board-modeller/images/component-table.png +0 -0
  373. package/dist-client/helps/board-modeller/images/component-text-media.png +0 -0
  374. package/dist-client/helps/board-modeller/images/component-toolbar.png +0 -0
  375. package/dist-client/helps/board-modeller/images/component-warehouse.png +0 -0
  376. package/dist-client/helps/board-modeller/images/control-toolbar-02.png +0 -0
  377. package/dist-client/helps/board-modeller/images/control-toolbar-03.png +0 -0
  378. package/dist-client/helps/board-modeller/images/control-toolbar-04.png +0 -0
  379. package/dist-client/helps/board-modeller/images/control-toolbar-05.png +0 -0
  380. package/dist-client/helps/board-modeller/images/control-toolbar-06.png +0 -0
  381. package/dist-client/helps/board-modeller/images/control-toolbar-07.png +0 -0
  382. package/dist-client/helps/board-modeller/images/control-toolbar-08.png +0 -0
  383. package/dist-client/helps/board-modeller/images/control-toolbar-09.png +0 -0
  384. package/dist-client/helps/board-modeller/images/control-toolbar-10.png +0 -0
  385. package/dist-client/helps/board-modeller/images/control-toolbar-11.png +0 -0
  386. package/dist-client/helps/board-modeller/images/control-toolbar-12.png +0 -0
  387. package/dist-client/helps/board-modeller/images/control-toolbar-13.png +0 -0
  388. package/dist-client/helps/board-modeller/images/control-toolbar-14.png +0 -0
  389. package/dist-client/helps/board-modeller/images/control-toolbar-15.png +0 -0
  390. package/dist-client/helps/board-modeller/images/control-toolbar-16.png +0 -0
  391. package/dist-client/helps/board-modeller/images/control-toolbar-17.png +0 -0
  392. package/dist-client/helps/board-modeller/images/control-toolbar-18.png +0 -0
  393. package/dist-client/helps/board-modeller/images/control-toolbar-19.png +0 -0
  394. package/dist-client/helps/board-modeller/images/control-toolbar-20.png +0 -0
  395. package/dist-client/helps/board-modeller/images/control-toolbar-21.png +0 -0
  396. package/dist-client/helps/board-modeller/images/control-toolbar-22.png +0 -0
  397. package/dist-client/helps/board-modeller/images/control-toolbar-23.png +0 -0
  398. package/dist-client/helps/board-modeller/images/control-toolbar-24.png +0 -0
  399. package/dist-client/helps/board-modeller/images/control-toolbar-25.png +0 -0
  400. package/dist-client/helps/board-modeller/images/control-toolbar-26.png +0 -0
  401. package/dist-client/helps/board-modeller/images/control-toolbar-27.png +0 -0
  402. package/dist-client/helps/board-modeller/images/control-toolbar-28.png +0 -0
  403. package/dist-client/helps/board-modeller/images/control-toolbar-29.png +0 -0
  404. package/dist-client/helps/board-modeller/images/control-toolbar-30.png +0 -0
  405. package/dist-client/helps/board-modeller/images/control-toolbar-31.png +0 -0
  406. package/dist-client/helps/board-modeller/images/control-toolbar-32.png +0 -0
  407. package/dist-client/helps/board-modeller/images/control-toolbar.png +0 -0
  408. package/dist-client/helps/board-modeller/images/effect-property.png +0 -0
  409. package/dist-client/helps/board-modeller/images/hover-01.png +0 -0
  410. package/dist-client/helps/board-modeller/images/join-type-bevel.png +0 -0
  411. package/dist-client/helps/board-modeller/images/join-type-miter.png +0 -0
  412. package/dist-client/helps/board-modeller/images/join-type-round.png +0 -0
  413. package/dist-client/helps/board-modeller/images/modeler-layout-01.png +0 -0
  414. package/dist-client/helps/board-modeller/images/property-window.png +0 -0
  415. package/dist-client/helps/board-modeller/images/shadow-02.png +0 -0
  416. package/dist-client/helps/board-modeller/images/shadow-03.png +0 -0
  417. package/dist-client/helps/board-modeller/images/shadow-04.png +0 -0
  418. package/dist-client/helps/board-modeller/images/shadow-05.png +0 -0
  419. package/dist-client/helps/board-modeller/images/shape-property.png +0 -0
  420. package/dist-client/helps/board-modeller/images/specific-property.png +0 -0
  421. package/dist-client/helps/board-modeller/images/style-property.png +0 -0
  422. package/dist-client/helps/board-modeller/images/target-property.png +0 -0
  423. package/dist-client/helps/board-modeller/images/variable-property.png +0 -0
  424. package/dist-client/helps/board-modeller/initial-data.ko.md +8 -0
  425. package/dist-client/helps/board-modeller/initial-data.md +8 -0
  426. package/dist-client/helps/board-modeller/initial-data.zh.md +8 -0
  427. package/dist-client/helps/board-modeller/modeller.ko.md +244 -0
  428. package/dist-client/helps/board-modeller/modeller.md +206 -0
  429. package/dist-client/helps/board-modeller/modeller.zh.md +241 -0
  430. package/dist-client/helps/board-modeller/shapes/3dish.ko.md +17 -0
  431. package/dist-client/helps/board-modeller/shapes/3dish.md +17 -0
  432. package/dist-client/helps/board-modeller/shapes/3dish.zh.md +17 -0
  433. package/dist-client/helps/board-modeller/shapes/print-option.ko.md +26 -0
  434. package/dist-client/helps/board-modeller/shapes/print-option.md +26 -0
  435. package/dist-client/helps/board-modeller/shapes/print-option.zh.md +26 -0
  436. package/dist-client/helps/board-modeller/shapes/shapes.ko.md +19 -0
  437. package/dist-client/helps/board-modeller/shapes/shapes.md +21 -0
  438. package/dist-client/helps/board-modeller/shapes/shapes.zh.md +19 -0
  439. package/dist-client/helps/board-modeller/shapes/size.ko.md +8 -0
  440. package/dist-client/helps/board-modeller/shapes/size.md +8 -0
  441. package/dist-client/helps/board-modeller/shapes/size.zh.md +8 -0
  442. package/dist-client/helps/board-modeller/shapes/text-box.ko.md +16 -0
  443. package/dist-client/helps/board-modeller/shapes/text-box.md +16 -0
  444. package/dist-client/helps/board-modeller/shapes/text-box.zh.md +16 -0
  445. package/dist-client/helps/board-modeller/shapes/viewer-option.ko.md +9 -0
  446. package/dist-client/helps/board-modeller/shapes/viewer-option.md +9 -0
  447. package/dist-client/helps/board-modeller/shapes/viewer-option.zh.md +9 -0
  448. package/dist-client/helps/board-modeller/styles/fill-style.ko.md +18 -0
  449. package/dist-client/helps/board-modeller/styles/fill-style.md +18 -0
  450. package/dist-client/helps/board-modeller/styles/fill-style.zh.md +18 -0
  451. package/dist-client/helps/board-modeller/styles/line-style.ko.md +19 -0
  452. package/dist-client/helps/board-modeller/styles/line-style.md +23 -0
  453. package/dist-client/helps/board-modeller/styles/line-style.zh.md +19 -0
  454. package/dist-client/helps/board-modeller/styles/opacity.ko.md +3 -0
  455. package/dist-client/helps/board-modeller/styles/opacity.md +3 -0
  456. package/dist-client/helps/board-modeller/styles/opacity.zh.md +3 -0
  457. package/dist-client/helps/board-modeller/styles/text-style.ko.md +8 -0
  458. package/dist-client/helps/board-modeller/styles/text-style.md +8 -0
  459. package/dist-client/helps/board-modeller/styles/text-style.zh.md +8 -0
  460. package/dist-client/helps/components/oops-progress.md +73 -0
  461. package/dist-client/helps/contact/contact.md +160 -0
  462. package/dist-client/helps/dataset/data-archive.md +9 -0
  463. package/dist-client/helps/dataset/data-entry-list.md +2 -0
  464. package/dist-client/helps/dataset/data-key-set.md +10 -0
  465. package/dist-client/helps/dataset/data-ooc.md +11 -0
  466. package/dist-client/helps/dataset/data-report-list.md +4 -0
  467. package/dist-client/helps/dataset/data-sample-search.md +2 -0
  468. package/dist-client/helps/dataset/data-sample.md +11 -0
  469. package/dist-client/helps/dataset/data-sensor.md +13 -0
  470. package/dist-client/helps/dataset/data-set.md +28 -0
  471. package/dist-client/helps/dataset/ui/data-item-list.md +19 -0
  472. package/dist-client/helps/dataset/ui/data-key-item-list.md +2 -0
  473. package/dist-client/helps/index.md +1 -0
  474. package/dist-client/helps/integration/concept/connection.md +27 -0
  475. package/dist-client/helps/integration/concept/data-accessor.ko.md +11 -0
  476. package/dist-client/helps/integration/concept/data-accessor.md +11 -0
  477. package/dist-client/helps/integration/concept/data-accessor.zh.md +11 -0
  478. package/dist-client/helps/integration/concept/pending-queue.md +32 -0
  479. package/dist-client/helps/integration/concept/scenario-context.md +83 -0
  480. package/dist-client/helps/integration/concept/scenario-engine.md +10 -0
  481. package/dist-client/helps/integration/concept/scenario.md +4 -0
  482. package/dist-client/helps/integration/concept/task.md +25 -0
  483. package/dist-client/helps/integration/connector/mqtt-connector.md +17 -0
  484. package/dist-client/helps/integration/connector/mssql-connector.md +38 -0
  485. package/dist-client/helps/integration/connector/oracle-connector.md +66 -0
  486. package/dist-client/helps/integration/connector/postgresql-connector.md +34 -0
  487. package/dist-client/helps/integration/connector/sqlite-connector.md +17 -0
  488. package/dist-client/helps/integration/index.md +37 -0
  489. package/dist-client/helps/integration/task/book-up-scenario.md +24 -0
  490. package/dist-client/helps/integration/task/end.md +3 -0
  491. package/dist-client/helps/integration/task/floating-point.md +34 -0
  492. package/dist-client/helps/integration/task/goto.md +8 -0
  493. package/dist-client/helps/integration/task/graphql-mutate.md +44 -0
  494. package/dist-client/helps/integration/task/graphql-query.md +44 -0
  495. package/dist-client/helps/integration/task/local-graphql-mutate.md +44 -0
  496. package/dist-client/helps/integration/task/local-graphql-query.md +44 -0
  497. package/dist-client/helps/integration/task/log.md +14 -0
  498. package/dist-client/helps/integration/task/mqtt-publish.md +10 -0
  499. package/dist-client/helps/integration/task/mqtt-subscribe.md +15 -0
  500. package/dist-client/helps/integration/task/pick-pending-scenario.md +13 -0
  501. package/dist-client/helps/integration/task/publish.md +16 -0
  502. package/dist-client/helps/integration/task/script.md +39 -0
  503. package/dist-client/helps/integration/task/sleep.md +8 -0
  504. package/dist-client/helps/integration/task/throw.md +12 -0
  505. package/dist-client/helps/integration/task/variables.md +37 -0
  506. package/dist-client/helps/integration/ui/connection.md +16 -0
  507. package/dist-client/helps/integration/ui/crontab-editor.md +9 -0
  508. package/dist-client/helps/integration/ui/integration-monitor.md +29 -0
  509. package/dist-client/helps/integration/ui/scenario-detail.md +35 -0
  510. package/dist-client/helps/integration/ui/scenario.md +35 -0
  511. package/dist-client/helps/module/api.md +117 -0
  512. package/dist-client/helps/module/dashboard.md +27 -0
  513. package/dist-client/helps/module/help.md +40 -0
  514. package/dist-client/helps/module/lite-menu.md +112 -0
  515. package/dist-client/helps/module/notification-images/config-app-1.png +0 -0
  516. package/dist-client/helps/module/notification-images/config-app-2.png +0 -0
  517. package/dist-client/helps/module/notification-images/config-server-key.png +0 -0
  518. package/dist-client/helps/module/notification-images/config-service-account.png +0 -0
  519. package/dist-client/helps/module/notification-images/config-vapidkey-1.png +0 -0
  520. package/dist-client/helps/module/notification-images/config-vapidkey-2-get-public-key.png +0 -0
  521. package/dist-client/helps/module/notification-images/config-vapidkey-3-get-private-key.png +0 -0
  522. package/dist-client/helps/module/notification-images/element-notification-badge.png +0 -0
  523. package/dist-client/helps/module/notification-images/element-notification-list.png +0 -0
  524. package/dist-client/helps/module/notification-images/element-notification-setting-let.png +0 -0
  525. package/dist-client/helps/module/notification-images/push-test-on-chrome-1.png +0 -0
  526. package/dist-client/helps/module/notification-images/push-test-on-chrome-2.png +0 -0
  527. package/dist-client/helps/module/notification-images/push-test-on-firebase-1.png +0 -0
  528. package/dist-client/helps/module/notification-images/push-test-on-firebase-2.png +0 -0
  529. package/dist-client/helps/module/notification-images/push-test-on-firebase-3.png +0 -0
  530. package/dist-client/helps/module/notification-images/push-test-on-firebase-4.png +0 -0
  531. package/dist-client/helps/module/notification.md +161 -0
  532. package/dist-client/helps/oauth2-client/code-verifier.md +5 -0
  533. package/dist-client/helps/oauth2-client/credentials.md +160 -0
  534. package/dist-client/helps/oauth2-client/grant-type.md +33 -0
  535. package/dist-client/helps/organization/department.md +160 -0
  536. package/dist-client/helps/organization/employee.md +160 -0
  537. package/dist-client/helps/scene/component/analog-clock.ko.md +6 -0
  538. package/dist-client/helps/scene/component/analog-clock.md +8 -0
  539. package/dist-client/helps/scene/component/analog-clock.zh.md +6 -0
  540. package/dist-client/helps/scene/component/arrow.ko.md +9 -0
  541. package/dist-client/helps/scene/component/arrow.md +9 -0
  542. package/dist-client/helps/scene/component/arrow.zh.md +9 -0
  543. package/dist-client/helps/scene/component/audio.ko.md +1 -0
  544. package/dist-client/helps/scene/component/audio.md +1 -0
  545. package/dist-client/helps/scene/component/audio.zh.md +1 -0
  546. package/dist-client/helps/scene/component/both-arrow.ko.md +9 -0
  547. package/dist-client/helps/scene/component/both-arrow.md +9 -0
  548. package/dist-client/helps/scene/component/both-arrow.zh.md +9 -0
  549. package/dist-client/helps/scene/component/chartjs.ko.md +332 -0
  550. package/dist-client/helps/scene/component/chartjs.md +333 -0
  551. package/dist-client/helps/scene/component/chartjs.zh.md +331 -0
  552. package/dist-client/helps/scene/component/color-image.ko.md +9 -0
  553. package/dist-client/helps/scene/component/color-image.md +9 -0
  554. package/dist-client/helps/scene/component/color-image.zh.md +9 -0
  555. package/dist-client/helps/scene/component/container.ko.md +7 -0
  556. package/dist-client/helps/scene/component/container.md +9 -0
  557. package/dist-client/helps/scene/component/container.zh.md +8 -0
  558. package/dist-client/helps/scene/component/donut.ko.md +14 -0
  559. package/dist-client/helps/scene/component/donut.md +17 -0
  560. package/dist-client/helps/scene/component/donut.zh.md +18 -0
  561. package/dist-client/helps/scene/component/dotted-line.ko.md +7 -0
  562. package/dist-client/helps/scene/component/dotted-line.md +9 -0
  563. package/dist-client/helps/scene/component/dotted-line.zh.md +7 -0
  564. package/dist-client/helps/scene/component/ellipse.ko.md +11 -0
  565. package/dist-client/helps/scene/component/ellipse.md +11 -0
  566. package/dist-client/helps/scene/component/ellipse.zh.md +10 -0
  567. package/dist-client/helps/scene/component/gauge-circle.ko.md +168 -0
  568. package/dist-client/helps/scene/component/gauge-circle.md +167 -0
  569. package/dist-client/helps/scene/component/gauge-circle.zh.md +164 -0
  570. package/dist-client/helps/scene/component/gauge-horizon.ko.md +145 -0
  571. package/dist-client/helps/scene/component/gauge-horizon.md +145 -0
  572. package/dist-client/helps/scene/component/gauge-horizon.zh.md +145 -0
  573. package/dist-client/helps/scene/component/gauge-vertical.ko.md +12 -0
  574. package/dist-client/helps/scene/component/gauge-vertical.md +9 -0
  575. package/dist-client/helps/scene/component/gauge-vertical.zh.md +10 -0
  576. package/dist-client/helps/scene/component/gif-view.ko.md +10 -0
  577. package/dist-client/helps/scene/component/gif-view.md +10 -0
  578. package/dist-client/helps/scene/component/gif-view.zh.md +10 -0
  579. package/dist-client/helps/scene/component/global-ref.ko.md +1 -0
  580. package/dist-client/helps/scene/component/global-ref.md +1 -0
  581. package/dist-client/helps/scene/component/global-ref.zh.md +1 -0
  582. package/dist-client/helps/scene/component/gray-image.ko.md +9 -0
  583. package/dist-client/helps/scene/component/gray-image.md +9 -0
  584. package/dist-client/helps/scene/component/gray-image.zh.md +8 -0
  585. package/dist-client/helps/scene/component/indoor-map.ko.md +65 -0
  586. package/dist-client/helps/scene/component/indoor-map.md +65 -0
  587. package/dist-client/helps/scene/component/indoor-map.zh.md +65 -0
  588. package/dist-client/helps/scene/component/info-window.ko.md +1 -0
  589. package/dist-client/helps/scene/component/info-window.md +1 -0
  590. package/dist-client/helps/scene/component/info-window.zh.md +1 -0
  591. package/dist-client/helps/scene/component/input.ko.md +59 -0
  592. package/dist-client/helps/scene/component/input.md +59 -0
  593. package/dist-client/helps/scene/component/input.zh.md +58 -0
  594. package/dist-client/helps/scene/component/line.ko.md +9 -0
  595. package/dist-client/helps/scene/component/line.md +9 -0
  596. package/dist-client/helps/scene/component/line.zh.md +7 -0
  597. package/dist-client/helps/scene/component/local-ref.ko.md +1 -0
  598. package/dist-client/helps/scene/component/local-ref.md +1 -0
  599. package/dist-client/helps/scene/component/local-ref.zh.md +1 -0
  600. package/dist-client/helps/scene/component/marker.ko.md +15 -0
  601. package/dist-client/helps/scene/component/marker.md +15 -0
  602. package/dist-client/helps/scene/component/marker.zh.md +15 -0
  603. package/dist-client/helps/scene/component/news-ticker.ko.md +27 -0
  604. package/dist-client/helps/scene/component/news-ticker.md +27 -0
  605. package/dist-client/helps/scene/component/news-ticker.zh.md +27 -0
  606. package/dist-client/helps/scene/component/polygon.ko.md +9 -0
  607. package/dist-client/helps/scene/component/polygon.md +9 -0
  608. package/dist-client/helps/scene/component/polygon.zh.md +9 -0
  609. package/dist-client/helps/scene/component/polyline.ko.md +10 -0
  610. package/dist-client/helps/scene/component/polyline.md +10 -0
  611. package/dist-client/helps/scene/component/polyline.zh.md +10 -0
  612. package/dist-client/helps/scene/component/popup.ko.md +27 -0
  613. package/dist-client/helps/scene/component/popup.md +27 -0
  614. package/dist-client/helps/scene/component/progress-circle.ko.md +41 -0
  615. package/dist-client/helps/scene/component/progress-circle.md +42 -0
  616. package/dist-client/helps/scene/component/progress-circle.zh.md +39 -0
  617. package/dist-client/helps/scene/component/progress-horizontal.ko.md +37 -0
  618. package/dist-client/helps/scene/component/progress-horizontal.md +31 -0
  619. package/dist-client/helps/scene/component/progress-horizontal.zh.md +31 -0
  620. package/dist-client/helps/scene/component/progress-vertical.ko.md +23 -0
  621. package/dist-client/helps/scene/component/progress-vertical.md +24 -0
  622. package/dist-client/helps/scene/component/progress-vertical.zh.md +23 -0
  623. package/dist-client/helps/scene/component/rack.ko.md +17 -0
  624. package/dist-client/helps/scene/component/rack.md +15 -0
  625. package/dist-client/helps/scene/component/rack.zh.md +16 -0
  626. package/dist-client/helps/scene/component/random.ko.md +12 -0
  627. package/dist-client/helps/scene/component/random.md +11 -0
  628. package/dist-client/helps/scene/component/random.zh.md +11 -0
  629. package/dist-client/helps/scene/component/rect.ko.md +17 -0
  630. package/dist-client/helps/scene/component/rect.md +16 -0
  631. package/dist-client/helps/scene/component/rect.zh.md +16 -0
  632. package/dist-client/helps/scene/component/simple-switch.ko.md +20 -0
  633. package/dist-client/helps/scene/component/simple-switch.md +19 -0
  634. package/dist-client/helps/scene/component/simple-switch.zh.md +19 -0
  635. package/dist-client/helps/scene/component/star.ko.md +19 -0
  636. package/dist-client/helps/scene/component/star.md +19 -0
  637. package/dist-client/helps/scene/component/star.zh.md +19 -0
  638. package/dist-client/helps/scene/component/tab-container.ko.md +58 -0
  639. package/dist-client/helps/scene/component/tab-container.md +57 -0
  640. package/dist-client/helps/scene/component/tab-container.zh.md +59 -0
  641. package/dist-client/helps/scene/component/tab.ko.md +14 -0
  642. package/dist-client/helps/scene/component/tab.md +13 -0
  643. package/dist-client/helps/scene/component/tab.zh.md +13 -0
  644. package/dist-client/helps/scene/component/text-clock.ko.md +25 -0
  645. package/dist-client/helps/scene/component/text-clock.md +22 -0
  646. package/dist-client/helps/scene/component/text-clock.zh.md +22 -0
  647. package/dist-client/helps/scene/component/text.ko.md +9 -0
  648. package/dist-client/helps/scene/component/text.md +9 -0
  649. package/dist-client/helps/scene/component/text.zh.md +9 -0
  650. package/dist-client/helps/scene/component/top-rounded-ractangle.ko.md +15 -0
  651. package/dist-client/helps/scene/component/top-rounded-ractangle.md +15 -0
  652. package/dist-client/helps/scene/component/top-rounded-ractangle.zh.md +15 -0
  653. package/dist-client/helps/scene/component/triangle.ko.md +9 -0
  654. package/dist-client/helps/scene/component/triangle.md +9 -0
  655. package/dist-client/helps/scene/component/triangle.zh.md +9 -0
  656. package/dist-client/helps/scene/images/both-arrow-01.png +0 -0
  657. package/dist-client/helps/scene/images/button-evnet-mapping-01.png +0 -0
  658. package/dist-client/helps/scene/images/button-evnet-mapping-02.png +0 -0
  659. package/dist-client/helps/scene/images/button-evnet-mapping-03.png +0 -0
  660. package/dist-client/helps/scene/images/chart-bar-01.png +0 -0
  661. package/dist-client/helps/scene/images/chart-bar-02.png +0 -0
  662. package/dist-client/helps/scene/images/chart-bar-03.png +0 -0
  663. package/dist-client/helps/scene/images/chart-bar-08.png +0 -0
  664. package/dist-client/helps/scene/images/chart-bar-12.png +0 -0
  665. package/dist-client/helps/scene/images/chart-data-01.png +0 -0
  666. package/dist-client/helps/scene/images/chart-data-04.png +0 -0
  667. package/dist-client/helps/scene/images/chart-doughnut-01.png +0 -0
  668. package/dist-client/helps/scene/images/chart-horizontal-bar-01.png +0 -0
  669. package/dist-client/helps/scene/images/chart-line-01.png +0 -0
  670. package/dist-client/helps/scene/images/chart-mix-01.png +0 -0
  671. package/dist-client/helps/scene/images/chart-mix-02.png +0 -0
  672. package/dist-client/helps/scene/images/chart-pie-01.png +0 -0
  673. package/dist-client/helps/scene/images/chart-polar-01.png +0 -0
  674. package/dist-client/helps/scene/images/chart-radar-01.png +0 -0
  675. package/dist-client/helps/scene/images/clock-analog-01.png +0 -0
  676. package/dist-client/helps/scene/images/clock-text-01.png +0 -0
  677. package/dist-client/helps/scene/images/clock-text-02.png +0 -0
  678. package/dist-client/helps/scene/images/clock-text-03.png +0 -0
  679. package/dist-client/helps/scene/images/clock-text-04.png +0 -0
  680. package/dist-client/helps/scene/images/container-01.png +0 -0
  681. package/dist-client/helps/scene/images/container-03.png +0 -0
  682. package/dist-client/helps/scene/images/container-04.png +0 -0
  683. package/dist-client/helps/scene/images/dash-01.png +0 -0
  684. package/dist-client/helps/scene/images/donut-01.png +0 -0
  685. package/dist-client/helps/scene/images/donut-02.png +0 -0
  686. package/dist-client/helps/scene/images/ellipse-01.png +0 -0
  687. package/dist-client/helps/scene/images/gauge-circle-01.png +0 -0
  688. package/dist-client/helps/scene/images/gauge-circle-02.png +0 -0
  689. package/dist-client/helps/scene/images/gauge-circle-03.png +0 -0
  690. package/dist-client/helps/scene/images/gauge-circle-04.png +0 -0
  691. package/dist-client/helps/scene/images/gauge-circle-05.png +0 -0
  692. package/dist-client/helps/scene/images/gauge-circle-06.png +0 -0
  693. package/dist-client/helps/scene/images/gauge-circle-07.png +0 -0
  694. package/dist-client/helps/scene/images/gauge-circle-08.png +0 -0
  695. package/dist-client/helps/scene/images/gauge-circle-09.png +0 -0
  696. package/dist-client/helps/scene/images/gauge-circle-10.png +0 -0
  697. package/dist-client/helps/scene/images/gauge-circle-11.png +0 -0
  698. package/dist-client/helps/scene/images/gauge-circle-12.png +0 -0
  699. package/dist-client/helps/scene/images/gauge-circle-13.png +0 -0
  700. package/dist-client/helps/scene/images/gauge-circle-14.png +0 -0
  701. package/dist-client/helps/scene/images/gauge-circle-15.png +0 -0
  702. package/dist-client/helps/scene/images/gauge-circle-16.png +0 -0
  703. package/dist-client/helps/scene/images/gauge-circle-17.png +0 -0
  704. package/dist-client/helps/scene/images/gauge-circle-18.png +0 -0
  705. package/dist-client/helps/scene/images/gauge-circle-19.png +0 -0
  706. package/dist-client/helps/scene/images/gauge-circle-20.png +0 -0
  707. package/dist-client/helps/scene/images/gauge-circle-21.png +0 -0
  708. package/dist-client/helps/scene/images/gauge-horizontal-01.png +0 -0
  709. package/dist-client/helps/scene/images/gauge-vertical-01.png +0 -0
  710. package/dist-client/helps/scene/images/gauge-vertical-02.png +0 -0
  711. package/dist-client/helps/scene/images/gauge-vertical-03.png +0 -0
  712. package/dist-client/helps/scene/images/gauge-vertical-04.png +0 -0
  713. package/dist-client/helps/scene/images/gauge-vertical-05.png +0 -0
  714. package/dist-client/helps/scene/images/gauge-vertical-06.png +0 -0
  715. package/dist-client/helps/scene/images/gauge-vertical-07.png +0 -0
  716. package/dist-client/helps/scene/images/gauge-vertical-08.png +0 -0
  717. package/dist-client/helps/scene/images/gauge-vertical-09.png +0 -0
  718. package/dist-client/helps/scene/images/gauge-vertical-10.png +0 -0
  719. package/dist-client/helps/scene/images/gauge-vertical-11.png +0 -0
  720. package/dist-client/helps/scene/images/gauge-vertical-12.png +0 -0
  721. package/dist-client/helps/scene/images/gauge-vertical-13.png +0 -0
  722. package/dist-client/helps/scene/images/gauge-vertical-14.png +0 -0
  723. package/dist-client/helps/scene/images/gauge-vertical-15.png +0 -0
  724. package/dist-client/helps/scene/images/gauge-vertical-16.png +0 -0
  725. package/dist-client/helps/scene/images/gauge-vertical-17.png +0 -0
  726. package/dist-client/helps/scene/images/gauge-vertical-18.png +0 -0
  727. package/dist-client/helps/scene/images/half-round-rect-01.png +0 -0
  728. package/dist-client/helps/scene/images/half-round-rect-02.png +0 -0
  729. package/dist-client/helps/scene/images/indoor-button-finish-01.gif +0 -0
  730. package/dist-client/helps/scene/images/indoor-create-01.png +0 -0
  731. package/dist-client/helps/scene/images/indoor-create-02.png +0 -0
  732. package/dist-client/helps/scene/images/indoor-create-03.png +0 -0
  733. package/dist-client/helps/scene/images/indoor-setting-01.png +0 -0
  734. package/dist-client/helps/scene/images/line-01.png +0 -0
  735. package/dist-client/helps/scene/images/marker-01.png +0 -0
  736. package/dist-client/helps/scene/images/marker-02.png +0 -0
  737. package/dist-client/helps/scene/images/media-01.png +0 -0
  738. package/dist-client/helps/scene/images/media-02.png +0 -0
  739. package/dist-client/helps/scene/images/news_ticker_1.png +0 -0
  740. package/dist-client/helps/scene/images/news_ticker_2.png +0 -0
  741. package/dist-client/helps/scene/images/news_ticker_3.png +0 -0
  742. package/dist-client/helps/scene/images/news_ticker_video_1.gif +0 -0
  743. package/dist-client/helps/scene/images/news_ticker_video_2.gif +0 -0
  744. package/dist-client/helps/scene/images/polygon-01.png +0 -0
  745. package/dist-client/helps/scene/images/polyline-01.png +0 -0
  746. package/dist-client/helps/scene/images/progress-circle-01.png +0 -0
  747. package/dist-client/helps/scene/images/progress-circle-02.png +0 -0
  748. package/dist-client/helps/scene/images/progress-circle-03.png +0 -0
  749. package/dist-client/helps/scene/images/progress-circle-04.png +0 -0
  750. package/dist-client/helps/scene/images/progress-circle-05.png +0 -0
  751. package/dist-client/helps/scene/images/progress-horizontal-01.png +0 -0
  752. package/dist-client/helps/scene/images/progress-horizontal-02.png +0 -0
  753. package/dist-client/helps/scene/images/progress-horizontal-03.png +0 -0
  754. package/dist-client/helps/scene/images/progress-horizontal-04.png +0 -0
  755. package/dist-client/helps/scene/images/progress-vertical-01.png +0 -0
  756. package/dist-client/helps/scene/images/progress-vertical-02.png +0 -0
  757. package/dist-client/helps/scene/images/progress-vertical-03.png +0 -0
  758. package/dist-client/helps/scene/images/rect-01.png +0 -0
  759. package/dist-client/helps/scene/images/rect-02.png +0 -0
  760. package/dist-client/helps/scene/images/single-arrow-01.png +0 -0
  761. package/dist-client/helps/scene/images/star-01.png +0 -0
  762. package/dist-client/helps/scene/images/star-02.png +0 -0
  763. package/dist-client/helps/scene/images/star-03.png +0 -0
  764. package/dist-client/helps/scene/images/tab-button-finish-01.gif +0 -0
  765. package/dist-client/helps/scene/images/tab-container-03.png +0 -0
  766. package/dist-client/helps/scene/images/tab-container-create-01.png +0 -0
  767. package/dist-client/helps/scene/images/tab-container-create-02.png +0 -0
  768. package/dist-client/helps/scene/images/tab-container-create-03.png +0 -0
  769. package/dist-client/helps/scene/images/tab-container-setting-01.png +0 -0
  770. package/dist-client/helps/scene/images/text-01.png +0 -0
  771. package/dist-client/helps/scene/images/triangle-01.png +0 -0
  772. package/dist-client/helps/setting/images/confirm-button.PNG +0 -0
  773. package/dist-client/helps/setting/images/delete-button.png +0 -0
  774. package/dist-client/helps/setting/images/error-setting.png +0 -0
  775. package/dist-client/helps/setting/images/export-button.png +0 -0
  776. package/dist-client/helps/setting/images/flowchart-setting-management.jpg +0 -0
  777. package/dist-client/helps/setting/images/partner-setting.png +0 -0
  778. package/dist-client/helps/setting/images/partners-list.PNG +0 -0
  779. package/dist-client/helps/setting/images/save-button.png +0 -0
  780. package/dist-client/helps/setting/images/select-button.PNG +0 -0
  781. package/dist-client/helps/setting/images/setting-board.png +0 -0
  782. package/dist-client/helps/setting/images/upload-button.png +0 -0
  783. package/dist-client/helps/setting/partner-setting.en.md +19 -0
  784. package/dist-client/helps/setting/settings.en.md +26 -0
  785. package/dist-client/helps/setting/settings.ko.md +4 -0
  786. package/dist-client/index.html +40 -0
  787. package/dist-client/main.js +2 -0
  788. package/dist-client/main.js.LICENSE.txt +53 -0
  789. package/dist-client/modules.js +2 -0
  790. package/dist-client/modules.js.LICENSE.txt +3 -0
  791. package/dist-client/node_modules/@hatiolab/things-scene/babel.config.js +1 -0
  792. package/dist-client/node_modules/@hatiolab/things-scene/package.json +89 -0
  793. package/dist-client/node_modules/@hatiolab/things-scene/rollup.config.js +1 -0
  794. package/dist-client/node_modules/@hatiolab/things-scene/things-board.js +1 -0
  795. package/dist-client/node_modules/@hatiolab/things-scene/things-scene-ie.js +2 -0
  796. package/dist-client/node_modules/@hatiolab/things-scene/things-scene-ie.js.LICENSE.txt +3 -0
  797. package/dist-client/node_modules/@hatiolab/things-scene/things-scene-min.js +2 -0
  798. package/dist-client/node_modules/@hatiolab/things-scene/things-scene-min.js.LICENSE.txt +3 -0
  799. package/dist-client/node_modules/@hatiolab/things-scene/tsconfig.json +9 -0
  800. package/dist-client/node_modules/@webcomponents/webcomponentsjs/CHANGELOG.md +71 -0
  801. package/dist-client/node_modules/@webcomponents/webcomponentsjs/LICENSE.md +19 -0
  802. package/dist-client/node_modules/@webcomponents/webcomponentsjs/README.md +259 -0
  803. package/dist-client/node_modules/@webcomponents/webcomponentsjs/custom-elements-es5-adapter.js +2 -0
  804. package/dist-client/node_modules/@webcomponents/webcomponentsjs/custom-elements-es5-adapter.js.LICENSE.txt +9 -0
  805. package/dist-client/node_modules/@webcomponents/webcomponentsjs/package.json +51 -0
  806. package/dist-client/node_modules/@webcomponents/webcomponentsjs/webcomponents-bundle.d.ts +175 -0
  807. package/dist-client/node_modules/@webcomponents/webcomponentsjs/webcomponents-bundle.js +2 -0
  808. package/dist-client/node_modules/@webcomponents/webcomponentsjs/webcomponents-bundle.js.LICENSE.txt +9 -0
  809. package/dist-client/node_modules/@webcomponents/webcomponentsjs/webcomponents-bundle.js.map +1 -0
  810. package/dist-client/node_modules/@webcomponents/webcomponentsjs/webcomponents-loader.js +2 -0
  811. package/dist-client/node_modules/@webcomponents/webcomponentsjs/webcomponents-loader.js.LICENSE.txt +9 -0
  812. package/dist-client/node_modules/web-animations-js/web-animations-next.min.js +1 -0
  813. package/dist-client/node_modules/web-animations-js/web-animations-next.min.js.map +1 -0
  814. package/dist-client/oauth2/oauth2-decision-error-page.js +2 -0
  815. package/dist-client/oauth2/oauth2-decision-error-page.js.LICENSE.txt +70 -0
  816. package/dist-client/oauth2/oauth2-decision-page.js +2 -0
  817. package/dist-client/oauth2/oauth2-decision-page.js.LICENSE.txt +104 -0
  818. package/dist-client/openapi/unstable/scenario.yaml +240 -0
  819. package/dist-client/openapi/unstable.yaml +41 -0
  820. package/dist-client/profile.js +1 -0
  821. package/dist-client/public/home.js +2 -0
  822. package/dist-client/public/home.js.LICENSE.txt +81 -0
  823. package/dist-client/scene-player.js +2 -0
  824. package/dist-client/scene-player.js.LICENSE.txt +822 -0
  825. package/dist-client/scene-viewer.js +2 -0
  826. package/dist-client/scene-viewer.js.LICENSE.txt +822 -0
  827. package/dist-client/service-worker.js +2 -0
  828. package/dist-client/service-worker.js.LICENSE.txt +6 -0
  829. package/dist-client/theme.css +17 -0
  830. package/dist-client/translations/en.json +1242 -0
  831. package/dist-client/translations/ko.json +1245 -0
  832. package/dist-client/translations/ms.json +1210 -0
  833. package/dist-client/translations/zh.json +1192 -0
  834. package/dist-client/views/auth-page.html +96 -0
  835. package/dist-client/views/dependencies-view-graphviz.html +75 -0
  836. package/dist-client/views/dependencies-view.html +139 -0
  837. package/dist-client/views/internal-board-full-feature-view.html +61 -0
  838. package/dist-client/views/internal-board-service-view.html +65 -0
  839. package/dist-client/views/internal-label-command-view.html +300 -0
  840. package/dist-client/views/oauth2-page.html +90 -0
  841. package/dist-client/views/public/home.html +87 -0
  842. package/dist-client/views/public/html-editor-editorjs.html +269 -0
  843. package/dist-client/views/public/html-editor-jodit.html +31 -0
  844. package/dist-client/views/public/html-editor-tui.html +54 -0
  845. package/dist-client/views/scenario-view.html +64 -0
  846. package/dist-client/views/template.html +21 -0
  847. package/dist-server/tsconfig.tsbuildinfo +1 -1
  848. package/logs/.08636eb59927f12972f6774f5947c8507b3564c2-audit.json +24 -49
  849. package/logs/.18d091b2bdb152ebed6b3b89b64872d0259f255d-audit.json +20 -0
  850. package/logs/.5e5d741d8b7784a2fbad65eedc0fd46946aaf6f2-audit.json +12 -32
  851. package/logs/application-2022-04-25-13.log +3 -0
  852. package/logs/application-2022-04-25-17.log +9 -0
  853. package/logs/application-2022-04-26-10.log +28 -0
  854. package/logs/application-2022-04-26-11.log +13 -0
  855. package/logs/application-2022-04-26-13.log +9 -0
  856. package/logs/application-2023-01-17-09.log +7 -0
  857. package/logs/application-2023-01-17-18.log +2 -0
  858. package/logs/application-2023-01-19-00.log +3 -0
  859. package/logs/application-2023-01-19-01.log +3 -0
  860. package/logs/application-2023-01-19-08.log +3 -0
  861. package/logs/application-2023-01-19-09.log +1 -0
  862. package/logs/application-2023-01-19-10.log +1 -0
  863. package/logs/application-2023-01-19-17.log +1 -0
  864. package/logs/connections-2022-04-18-20.log +0 -0
  865. package/logs/connections-2022-04-25-13.log +0 -0
  866. package/logs/connections-2022-04-25-17.log +0 -0
  867. package/logs/connections-2022-04-26-10.log +0 -0
  868. package/logs/connections-2022-04-26-11.log +0 -0
  869. package/logs/connections-2022-04-26-13.log +0 -0
  870. package/logs/connections-2023-01-17-09.log +0 -0
  871. package/logs/connections-2023-01-19-00.log +0 -0
  872. package/logs/connections-2023-01-19-01.log +0 -0
  873. package/logs/connections-2023-01-19-08.log +0 -0
  874. package/logs/system/.277b657c3d28ef3f7f13e894f05f9a5b78225124-audit.json +15 -0
  875. package/logs/system/.48785e489f583edb47e5bfd3d5cf6ac2a7e0bf3a-audit.json +15 -0
  876. package/logs/system/.4f2031dfc4e0de16454872a65d0a8b59646970f7-audit.json +15 -0
  877. package/logs/system/.6da447827b9a5ea2ccd1f5f28a0b784317582531-audit.json +20 -0
  878. package/logs/system/.8d440e4a6e875d88d938061d3d3037e6b0d7dc58-audit.json +15 -0
  879. package/logs/system/.b295089be805f3597aa7380952ce4f2670ac8e21-audit.json +20 -0
  880. package/logs/system/scenario-MAIN-2022-03-04-16.log +190 -0
  881. package/logs/system/scenario-PUBLISH-2022-03-16-13.log +8 -0
  882. package/logs/system/scenario-PUBLISH-2023-01-19-08.log +36 -0
  883. package/logs/system/scenario-SCALER-TEST-2022-02-25-11.log +14 -0
  884. package/logs/system/scenario-SCHEDULE-TESt-2022-03-02-12.log +66 -0
  885. package/logs/system/scenario-SCHEDULE-TESt-2022-03-02-13.log +1396 -0
  886. package/logs/system/scenario-pubsub-2-2022-04-11-23.log +12 -0
  887. package/logs/system/scenario-pubsub-2-2022-04-12-14.log +12 -0
  888. package/logs/system/scenario-pubsub-2022-04-11-23.log +277 -0
  889. package/package.json +34 -34
  890. package/attachments/03e21709-60c1-4796-bb0b-9920148ce2c6.png +0 -0
  891. package/attachments/1c5f7b4e-45f7-47dc-94e2-6d4aa04c331d.png +0 -0
  892. package/attachments/5c7f2330-a93d-4c48-bcca-6b2a10974386.png +0 -0
  893. package/attachments/97e18c62-6e73-4407-a062-276cd25de43a.png +0 -0
  894. package/attachments/9c6e1599-a4e2-483e-833d-c67e336b27e5.png +0 -0
  895. package/attachments/9d1d12ea-0140-46cc-8eba-b1ab475bfd98.png +0 -0
  896. package/attachments/a727d8fa-5afe-47b3-9b29-97a1f26637f3.png +0 -0
  897. package/attachments/b713c6b6-15e3-4c80-a288-b0e8eba5e091.png +0 -0
  898. package/attachments/c7b6e18b-fd21-49c5-8a38-9b2455957c2a.png +0 -0
  899. package/attachments/dabc0a7e-bb5b-46a3-b73c-d310c95f0832.png +0 -0
  900. package/attachments/f099313a-c616-4753-b2d7-33db2ac29b3b.png +0 -0
  901. package/attachments/f90a4af7-5555-4078-8960-2c978363ac42.png +0 -0
  902. package/logs/application-2023-03-19-07.log +0 -11
  903. package/logs/application-2023-03-19-08.log +0 -4
  904. package/logs/application-2023-03-19-10.log +0 -5
  905. package/logs/application-2023-03-19-11.log +0 -10
  906. package/logs/application-2023-03-19-12.log +0 -5
  907. package/logs/application-2023-03-19-16.log +0 -3
  908. package/logs/application-2023-03-19-19.log +0 -1
  909. package/logs/application-2023-03-19-20.log +0 -2
  910. package/logs/application-2023-03-19-21.log +0 -1
  911. package/logs/application-2023-03-21-03.log +0 -15
  912. package/logs/application-2023-03-21-04.log +0 -15
  913. package/logs/application-2023-03-21-12.log +0 -3
  914. package/logs/application-2023-03-21-13.log +0 -3
  915. /package/{attachments/92a49294-725c-445c-8fe3-98d328d6d0a5.png → dist-client/assets/images/image-api.png} +0 -0
  916. /package/{logs/connections-2023-03-13-10.log → dist-client/helps/scene/component/image-view.md} +0 -0
  917. /package/{logs/connections-2023-03-13-11.log → dist-client/theme.js} +0 -0
  918. /package/logs/{connections-2023-03-19-07.log → connections-2022-04-12-14.log} +0 -0
  919. /package/logs/{connections-2023-03-19-10.log → connections-2022-04-12-16.log} +0 -0
  920. /package/logs/{connections-2023-03-19-11.log → connections-2022-04-14-13.log} +0 -0
  921. /package/logs/{connections-2023-03-19-12.log → connections-2022-04-14-17.log} +0 -0
  922. /package/logs/{connections-2023-03-21-03.log → connections-2022-04-15-08.log} +0 -0
  923. /package/logs/{connections-2023-03-21-04.log → connections-2022-04-18-10.log} +0 -0
@@ -0,0 +1,2 @@
1
+ /*! For license information please see 6955.js.LICENSE.txt */
2
+ (self.webpackChunk_things_factory_reference_app=self.webpackChunk_things_factory_reference_app||[]).push([[6955],{80427:(t,e,r)=>{"use strict";function n(t,e){(function(t){return"string"==typeof t&&-1!==t.indexOf(".")&&1===parseFloat(t)})(t)&&(t="100%");var r=function(t){return"string"==typeof t&&-1!==t.indexOf("%")}(t);return t=360===e?t:Math.min(e,Math.max(0,parseFloat(t))),r&&(t=parseInt(String(t*e),10)/100),Math.abs(t-e)<1e-6?1:t=360===e?(t<0?t%e+e:t%e)/parseFloat(String(e)):t%e/parseFloat(String(e))}function i(t){return Math.min(1,Math.max(0,t))}function a(t){return t=parseFloat(t),(isNaN(t)||t<0||t>1)&&(t=1),t}function o(t){return t<=1?"".concat(100*Number(t),"%"):t}function s(t){return 1===t.length?"0"+t:String(t)}function l(t,e,r){t=n(t,255),e=n(e,255),r=n(r,255);var i=Math.max(t,e,r),a=Math.min(t,e,r),o=0,s=0,l=(i+a)/2;if(i===a)s=0,o=0;else{var u=i-a;switch(s=l>.5?u/(2-i-a):u/(i+a),i){case t:o=(e-r)/u+(e<r?6:0);break;case e:o=(r-t)/u+2;break;case r:o=(t-e)/u+4}o/=6}return{h:o,s,l}}function u(t,e,r){return r<0&&(r+=1),r>1&&(r-=1),r<1/6?t+6*r*(e-t):r<.5?e:r<2/3?t+(e-t)*(2/3-r)*6:t}function c(t,e,r){t=n(t,255),e=n(e,255),r=n(r,255);var i=Math.max(t,e,r),a=Math.min(t,e,r),o=0,s=i,l=i-a,u=0===i?0:l/i;if(i===a)o=0;else{switch(i){case t:o=(e-r)/l+(e<r?6:0);break;case e:o=(r-t)/l+2;break;case r:o=(t-e)/l+4}o/=6}return{h:o,s:u,v:s}}function d(t,e,r,n){var i=[s(Math.round(t).toString(16)),s(Math.round(e).toString(16)),s(Math.round(r).toString(16))];return n&&i[0].startsWith(i[0].charAt(1))&&i[1].startsWith(i[1].charAt(1))&&i[2].startsWith(i[2].charAt(1))?i[0].charAt(0)+i[1].charAt(0)+i[2].charAt(0):i.join("")}function h(t){return f(t)/255}function f(t){return parseInt(t,16)}r.d(e,{C:()=>E});var p={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",goldenrod:"#daa520",gold:"#ffd700",gray:"#808080",green:"#008000",greenyellow:"#adff2f",grey:"#808080",honeydew:"#f0fff0",hotpink:"#ff69b4",indianred:"#cd5c5c",indigo:"#4b0082",ivory:"#fffff0",khaki:"#f0e68c",lavenderblush:"#fff0f5",lavender:"#e6e6fa",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",rebeccapurple:"#663399",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"};var g="(?:".concat("[-\\+]?\\d*\\.\\d+%?",")|(?:").concat("[-\\+]?\\d+%?",")"),v="[\\s|\\(]+(".concat(g,")[,|\\s]+(").concat(g,")[,|\\s]+(").concat(g,")\\s*\\)?"),m="[\\s|\\(]+(".concat(g,")[,|\\s]+(").concat(g,")[,|\\s]+(").concat(g,")[,|\\s]+(").concat(g,")\\s*\\)?"),y={CSS_UNIT:new RegExp(g),rgb:new RegExp("rgb"+v),rgba:new RegExp("rgba"+m),hsl:new RegExp("hsl"+v),hsla:new RegExp("hsla"+m),hsv:new RegExp("hsv"+v),hsva:new RegExp("hsva"+m),hex3:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex6:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,hex4:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex8:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/};function b(t){return Boolean(y.CSS_UNIT.exec(String(t)))}var E=function(){function t(e,r){var i;if(void 0===e&&(e=""),void 0===r&&(r={}),e instanceof t)return e;"number"==typeof e&&(e=function(t){return{r:t>>16,g:(65280&t)>>8,b:255&t}}(e)),this.originalInput=e;var s=function(t){var e,r,i,s={r:0,g:0,b:0},l=1,c=null,d=null,g=null,v=!1,m=!1;return"string"==typeof t&&(t=function(t){if(0===(t=t.trim().toLowerCase()).length)return!1;var e=!1;if(p[t])t=p[t],e=!0;else if("transparent"===t)return{r:0,g:0,b:0,a:0,format:"name"};var r=y.rgb.exec(t);return r?{r:r[1],g:r[2],b:r[3]}:(r=y.rgba.exec(t))?{r:r[1],g:r[2],b:r[3],a:r[4]}:(r=y.hsl.exec(t))?{h:r[1],s:r[2],l:r[3]}:(r=y.hsla.exec(t))?{h:r[1],s:r[2],l:r[3],a:r[4]}:(r=y.hsv.exec(t))?{h:r[1],s:r[2],v:r[3]}:(r=y.hsva.exec(t))?{h:r[1],s:r[2],v:r[3],a:r[4]}:(r=y.hex8.exec(t))?{r:f(r[1]),g:f(r[2]),b:f(r[3]),a:h(r[4]),format:e?"name":"hex8"}:(r=y.hex6.exec(t))?{r:f(r[1]),g:f(r[2]),b:f(r[3]),format:e?"name":"hex"}:(r=y.hex4.exec(t))?{r:f(r[1]+r[1]),g:f(r[2]+r[2]),b:f(r[3]+r[3]),a:h(r[4]+r[4]),format:e?"name":"hex8"}:!!(r=y.hex3.exec(t))&&{r:f(r[1]+r[1]),g:f(r[2]+r[2]),b:f(r[3]+r[3]),format:e?"name":"hex"}}(t)),"object"==typeof t&&(b(t.r)&&b(t.g)&&b(t.b)?(e=t.r,r=t.g,i=t.b,s={r:255*n(e,255),g:255*n(r,255),b:255*n(i,255)},v=!0,m="%"===String(t.r).substr(-1)?"prgb":"rgb"):b(t.h)&&b(t.s)&&b(t.v)?(c=o(t.s),d=o(t.v),s=function(t,e,r){t=6*n(t,360),e=n(e,100),r=n(r,100);var i=Math.floor(t),a=t-i,o=r*(1-e),s=r*(1-a*e),l=r*(1-(1-a)*e),u=i%6;return{r:255*[r,s,o,o,l,r][u],g:255*[l,r,r,s,o,o][u],b:255*[o,o,l,r,r,s][u]}}(t.h,c,d),v=!0,m="hsv"):b(t.h)&&b(t.s)&&b(t.l)&&(c=o(t.s),g=o(t.l),s=function(t,e,r){var i,a,o;if(t=n(t,360),e=n(e,100),r=n(r,100),0===e)a=r,o=r,i=r;else{var s=r<.5?r*(1+e):r+e-r*e,l=2*r-s;i=u(l,s,t+1/3),a=u(l,s,t),o=u(l,s,t-1/3)}return{r:255*i,g:255*a,b:255*o}}(t.h,c,g),v=!0,m="hsl"),Object.prototype.hasOwnProperty.call(t,"a")&&(l=t.a)),l=a(l),{ok:v,format:t.format||m,r:Math.min(255,Math.max(s.r,0)),g:Math.min(255,Math.max(s.g,0)),b:Math.min(255,Math.max(s.b,0)),a:l}}(e);this.originalInput=e,this.r=s.r,this.g=s.g,this.b=s.b,this.a=s.a,this.roundA=Math.round(100*this.a)/100,this.format=null!==(i=r.format)&&void 0!==i?i:s.format,this.gradientType=r.gradientType,this.r<1&&(this.r=Math.round(this.r)),this.g<1&&(this.g=Math.round(this.g)),this.b<1&&(this.b=Math.round(this.b)),this.isValid=s.ok}return t.prototype.isDark=function(){return this.getBrightness()<128},t.prototype.isLight=function(){return!this.isDark()},t.prototype.getBrightness=function(){var t=this.toRgb();return(299*t.r+587*t.g+114*t.b)/1e3},t.prototype.getLuminance=function(){var t=this.toRgb(),e=t.r/255,r=t.g/255,n=t.b/255;return.2126*(e<=.03928?e/12.92:Math.pow((e+.055)/1.055,2.4))+.7152*(r<=.03928?r/12.92:Math.pow((r+.055)/1.055,2.4))+.0722*(n<=.03928?n/12.92:Math.pow((n+.055)/1.055,2.4))},t.prototype.getAlpha=function(){return this.a},t.prototype.setAlpha=function(t){return this.a=a(t),this.roundA=Math.round(100*this.a)/100,this},t.prototype.isMonochrome=function(){return 0===this.toHsl().s},t.prototype.toHsv=function(){var t=c(this.r,this.g,this.b);return{h:360*t.h,s:t.s,v:t.v,a:this.a}},t.prototype.toHsvString=function(){var t=c(this.r,this.g,this.b),e=Math.round(360*t.h),r=Math.round(100*t.s),n=Math.round(100*t.v);return 1===this.a?"hsv(".concat(e,", ").concat(r,"%, ").concat(n,"%)"):"hsva(".concat(e,", ").concat(r,"%, ").concat(n,"%, ").concat(this.roundA,")")},t.prototype.toHsl=function(){var t=l(this.r,this.g,this.b);return{h:360*t.h,s:t.s,l:t.l,a:this.a}},t.prototype.toHslString=function(){var t=l(this.r,this.g,this.b),e=Math.round(360*t.h),r=Math.round(100*t.s),n=Math.round(100*t.l);return 1===this.a?"hsl(".concat(e,", ").concat(r,"%, ").concat(n,"%)"):"hsla(".concat(e,", ").concat(r,"%, ").concat(n,"%, ").concat(this.roundA,")")},t.prototype.toHex=function(t){return void 0===t&&(t=!1),d(this.r,this.g,this.b,t)},t.prototype.toHexString=function(t){return void 0===t&&(t=!1),"#"+this.toHex(t)},t.prototype.toHex8=function(t){return void 0===t&&(t=!1),function(t,e,r,n,i){var a,o=[s(Math.round(t).toString(16)),s(Math.round(e).toString(16)),s(Math.round(r).toString(16)),s((a=n,Math.round(255*parseFloat(a)).toString(16)))];return i&&o[0].startsWith(o[0].charAt(1))&&o[1].startsWith(o[1].charAt(1))&&o[2].startsWith(o[2].charAt(1))&&o[3].startsWith(o[3].charAt(1))?o[0].charAt(0)+o[1].charAt(0)+o[2].charAt(0)+o[3].charAt(0):o.join("")}(this.r,this.g,this.b,this.a,t)},t.prototype.toHex8String=function(t){return void 0===t&&(t=!1),"#"+this.toHex8(t)},t.prototype.toRgb=function(){return{r:Math.round(this.r),g:Math.round(this.g),b:Math.round(this.b),a:this.a}},t.prototype.toRgbString=function(){var t=Math.round(this.r),e=Math.round(this.g),r=Math.round(this.b);return 1===this.a?"rgb(".concat(t,", ").concat(e,", ").concat(r,")"):"rgba(".concat(t,", ").concat(e,", ").concat(r,", ").concat(this.roundA,")")},t.prototype.toPercentageRgb=function(){var t=function(t){return"".concat(Math.round(100*n(t,255)),"%")};return{r:t(this.r),g:t(this.g),b:t(this.b),a:this.a}},t.prototype.toPercentageRgbString=function(){var t=function(t){return Math.round(100*n(t,255))};return 1===this.a?"rgb(".concat(t(this.r),"%, ").concat(t(this.g),"%, ").concat(t(this.b),"%)"):"rgba(".concat(t(this.r),"%, ").concat(t(this.g),"%, ").concat(t(this.b),"%, ").concat(this.roundA,")")},t.prototype.toName=function(){if(0===this.a)return"transparent";if(this.a<1)return!1;for(var t="#"+d(this.r,this.g,this.b,!1),e=0,r=Object.entries(p);e<r.length;e++){var n=r[e],i=n[0];if(t===n[1])return i}return!1},t.prototype.toString=function(t){var e=Boolean(t);t=null!=t?t:this.format;var r=!1,n=this.a<1&&this.a>=0;return e||!n||!t.startsWith("hex")&&"name"!==t?("rgb"===t&&(r=this.toRgbString()),"prgb"===t&&(r=this.toPercentageRgbString()),"hex"!==t&&"hex6"!==t||(r=this.toHexString()),"hex3"===t&&(r=this.toHexString(!0)),"hex4"===t&&(r=this.toHex8String(!0)),"hex8"===t&&(r=this.toHex8String()),"name"===t&&(r=this.toName()),"hsl"===t&&(r=this.toHslString()),"hsv"===t&&(r=this.toHsvString()),r||this.toHexString()):"name"===t&&0===this.a?this.toName():this.toRgbString()},t.prototype.toNumber=function(){return(Math.round(this.r)<<16)+(Math.round(this.g)<<8)+Math.round(this.b)},t.prototype.clone=function(){return new t(this.toString())},t.prototype.lighten=function(e){void 0===e&&(e=10);var r=this.toHsl();return r.l+=e/100,r.l=i(r.l),new t(r)},t.prototype.brighten=function(e){void 0===e&&(e=10);var r=this.toRgb();return r.r=Math.max(0,Math.min(255,r.r-Math.round(-e/100*255))),r.g=Math.max(0,Math.min(255,r.g-Math.round(-e/100*255))),r.b=Math.max(0,Math.min(255,r.b-Math.round(-e/100*255))),new t(r)},t.prototype.darken=function(e){void 0===e&&(e=10);var r=this.toHsl();return r.l-=e/100,r.l=i(r.l),new t(r)},t.prototype.tint=function(t){return void 0===t&&(t=10),this.mix("white",t)},t.prototype.shade=function(t){return void 0===t&&(t=10),this.mix("black",t)},t.prototype.desaturate=function(e){void 0===e&&(e=10);var r=this.toHsl();return r.s-=e/100,r.s=i(r.s),new t(r)},t.prototype.saturate=function(e){void 0===e&&(e=10);var r=this.toHsl();return r.s+=e/100,r.s=i(r.s),new t(r)},t.prototype.greyscale=function(){return this.desaturate(100)},t.prototype.spin=function(e){var r=this.toHsl(),n=(r.h+e)%360;return r.h=n<0?360+n:n,new t(r)},t.prototype.mix=function(e,r){void 0===r&&(r=50);var n=this.toRgb(),i=new t(e).toRgb(),a=r/100;return new t({r:(i.r-n.r)*a+n.r,g:(i.g-n.g)*a+n.g,b:(i.b-n.b)*a+n.b,a:(i.a-n.a)*a+n.a})},t.prototype.analogous=function(e,r){void 0===e&&(e=6),void 0===r&&(r=30);var n=this.toHsl(),i=360/r,a=[this];for(n.h=(n.h-(i*e>>1)+720)%360;--e;)n.h=(n.h+i)%360,a.push(new t(n));return a},t.prototype.complement=function(){var e=this.toHsl();return e.h=(e.h+180)%360,new t(e)},t.prototype.monochromatic=function(e){void 0===e&&(e=6);for(var r=this.toHsv(),n=r.h,i=r.s,a=r.v,o=[],s=1/e;e--;)o.push(new t({h:n,s:i,v:a})),a=(a+s)%1;return o},t.prototype.splitcomplement=function(){var e=this.toHsl(),r=e.h;return[this,new t({h:(r+72)%360,s:e.s,l:e.l}),new t({h:(r+216)%360,s:e.s,l:e.l})]},t.prototype.onBackground=function(e){var r=this.toRgb(),n=new t(e).toRgb();return new t({r:n.r+(r.r-n.r)*r.a,g:n.g+(r.g-n.g)*r.a,b:n.b+(r.b-n.b)*r.a})},t.prototype.triad=function(){return this.polyad(3)},t.prototype.tetrad=function(){return this.polyad(4)},t.prototype.polyad=function(e){for(var r=this.toHsl(),n=r.h,i=[this],a=360/e,o=1;o<e;o++)i.push(new t({h:(n+o*a)%360,s:r.s,l:r.l}));return i},t.prototype.equals=function(e){return this.toRgbString()===new t(e).toRgbString()},t}()},80403:(t,e,r)=>{"use strict";r.d(e,{JL:()=>s.J}),r(75314);var n,i,a,o,s=r(94575),l=(r(46570),r(46743),r(35254),r(171)),u=(r(12313),r(68784),r(94430)),c=r(56765),d=r(64312),h=r(27805),f=r(16682);function p(t,e){return e||(e=t.slice(0)),Object.freeze(Object.defineProperties(t,{raw:{value:Object.freeze(e)}}))}function g(t,e,r,n,i,a,o){try{var s=t[a](o),l=s.value}catch(t){return void r(t)}s.done?e(l):Promise.resolve(l).then(n,i)}function v(t){return function(){var e=this,r=arguments;return new Promise((function(n,i){var a=t.apply(e,r);function o(t){g(a,n,i,o,s,"next",t)}function s(t){g(a,n,i,o,s,"throw",t)}o(void 0)}))}}function m(){return m=v((function*(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=yield h.Lp.query({query:(0,f.ZP)(n||(n=p(["\n {\n boards(",") {\n items {\n id\n name\n description\n thumbnail\n createdAt\n updatedAt\n }\n total\n }\n }\n "])),(0,h.fH)(t))});return e.data})),m.apply(this,arguments)}function y(){return(y=v((function*(t){return t.model=JSON.stringify(t.model),(yield h.Lp.mutate({mutation:(0,f.ZP)(i||(i=p(["\n mutation CreateBoard($board: NewBoard!) {\n createBoard(board: $board) {\n id\n name\n description\n model\n createdAt\n updatedAt\n }\n }\n "]))),variables:{board:t}})).data}))).apply(this,arguments)}function b(t,e){return e||(e=t.slice(0)),Object.freeze(Object.defineProperties(t,{raw:{value:Object.freeze(e)}}))}function E(t,e,r,n,i,a,o){try{var s=t[a](o),l=s.value}catch(t){return void r(t)}s.done?e(l):Promise.resolve(l).then(n,i)}function x(t){return function(){var e=this,r=arguments;return new Promise((function(n,i){var a=t.apply(e,r);function o(t){E(a,n,i,o,s,"next",t)}function s(t){E(a,n,i,o,s,"throw",t)}o(void 0)}))}}function S(){return S=x((function*(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=yield h.Lp.query({query:(0,f.ZP)(a||(a=b(["\n {\n favoriteBoards(",") {\n items {\n id\n name\n description\n thumbnail\n createdAt\n updatedAt\n }\n total\n }\n }\n "])),(0,h.fH)(t))});return e.data})),S.apply(this,arguments)}function T(t,e){return e||(e=t.slice(0)),Object.freeze(Object.defineProperties(t,{raw:{value:Object.freeze(e)}}))}function w(t,e,r,n,i,a,o){try{var s=t[a](o),l=s.value}catch(t){return void r(t)}s.done?e(l):Promise.resolve(l).then(n,i)}function _(t){return function(){var e=this,r=arguments;return new Promise((function(n,i){var a=t.apply(e,r);function o(t){w(a,n,i,o,s,"next",t)}function s(t){w(a,n,i,o,s,"throw",t)}o(void 0)}))}}function A(){return(A=_((function*(){return(yield h.Lp.query({query:(0,f.ZP)(o||(o=T(["\n {\n groups {\n items {\n id\n name\n description\n createdAt\n updatedAt\n }\n total\n }\n }\n "])))})).data}))).apply(this,arguments)}var k,C,D,L,R,I,O=r(51266);function M(t,e,r,n,i,a,o){try{var s=t[a](o),l=s.value}catch(t){return void r(t)}s.done?e(l):Promise.resolve(l).then(n,i)}function P(t){return function(){var e=this,r=arguments;return new Promise((function(n,i){var a=t.apply(e,r);function o(t){M(a,n,i,o,s,"next",t)}function s(t){M(a,n,i,o,s,"throw",t)}o(void 0)}))}}function F(t,e){return e||(e=t.slice(0)),Object.freeze(Object.defineProperties(t,{raw:{value:Object.freeze(e)}}))}var N=class extends u.oi{constructor(){super(...arguments),this.creatable=!1,this.mode="CARD",this.groups=[],this.favorites=[],this._showSpinner=!1}render(){var t=this.mode||"CARD";return(0,u.dy)(k||(k=F(["\n <ox-grist .config="," .mode="," auto-fetch .fetchHandler=",'>\n <div slot="headroom" id="headroom">\n <div id="filters">\n <mwc-icon>search</mwc-icon>\n <input type="text" />\n\n <select\n @change=','\n >\n <option value="">*</option>\n ','\n </select>\n </div>\n\n <div id="modes">\n <mwc-icon @click='," ?active=",">grid_on</mwc-icon>\n <mwc-icon @click="," ?active=",">format_list_bulleted</mwc-icon>\n <mwc-icon @click="," ?active=",">apps</mwc-icon>\n </div>\n\n ","\n </div>\n </ox-grist>\n\n <oops-spinner ?show=","></oops-spinner>\n "])),this.config,t,this.fetchHandler.bind(this),(t=>{this.groupId=t.currentTarget.value,this.requestUpdate()}),this.groups.map((t=>(0,u.dy)(C||(C=F([" <option value="," ?selected=",">","</option> "])),t.id,t.id===this.groupId,t.description))),(()=>this.mode="GRID"),"GRID"==t,(()=>this.mode="LIST"),"LIST"==t,(()=>this.mode="CARD"),"CARD"==t,this.creatable?(0,u.dy)(D||(D=F(['\n <div id="add">\n <button><mwc-icon @click=',">add</mwc-icon></button>\n </div>\n "])),(()=>this.onCreateBoard())):void 0,this._showSpinner)}fetchHandler(t){var e=this;return P((function*(){var{page:r,limit:n,sorters:i=[]}=t;e._showSpinner=!0;var{items:a,total:o}=yield e.getBoards({page:r,limit:n,sorters:i});return e._showSpinner=!1,{total:o,records:a}}))()}get gristConfig(){return{list:{thumbnail:function(t,e){return(0,u.dy)(L||(L=F([" <img src=",' style="width: 100%; height: 100%;" /> '])),t.thumbnail)},fields:["name","description"],details:["updatedAt"]},columns:[{type:"gutter",gutterName:"dirty"},{type:"gutter",gutterName:"sequence"},{type:"gutter",gutterName:"button",icon:"star_border",handlers:{click:(t,e,r,n,i)=>{}}},{type:"gutter",gutterName:"button",icon:"drive_file_rename_outline",handlers:{click:(t,e,r,n,i)=>{}}},{type:"string",name:"id",hidden:!0},{type:"string",name:"name",header:"name",record:{editable:!0,align:"left"},width:200,sortable:!0},{type:"string",name:"description",header:"description",record:{editable:!0,align:"left"},width:200,handlers:{dblclick:(t,e,r,n,i)=>{alert("".concat(r.name," ").concat(n[r.name],", row : ").concat(i))}}},{type:"boolean",name:"active",header:"active",record:{editable:!0},sortable:!0,width:60},{type:"datetime",name:"updatedAt",header:"updated at",record:{editable:!0},sortable:!0,width:180},{type:"datetime",name:"createdAt",header:"created at",record:{editable:!0},sortable:!0,width:180}],rows:{selectable:{multiple:!0},handlers:{},classifier:function(t,e){}},sorters:[{name:"name",desc:!1}],pagination:{pages:[20,30,50,100,200]}}}refresh(){var t=this;return P((function*(){t.groups=(yield function(){return A.apply(this,arguments)}()).groups.items,t.groups&&(yield t.refreshBoards())}))()}getBoards(){var t=arguments,e=this;return P((function*(){var{page:r=1,limit:n=30,sorters:i=[]}=t.length>0&&void 0!==t[0]?t[0]:{};if(e.groupId&&"favor"==e.groupId)return yield e.getFavoriteBoards({page:r,limit:n});var a={filters:e.groupId?[{name:"groupId",operator:"eq",value:e.groupId}]:[],sortings:i,pagination:{page:r,limit:n}};return(yield function(){return m.apply(this,arguments)}(a)).boards}))()}getFavoriteBoards(){var t=arguments;return P((function*(){var{page:e=1,limit:r=30}=t.length>0&&void 0!==t[0]?t[0]:{},n={pagination:{page:e,limit:r}};return(yield function(){return S.apply(this,arguments)}(n)).favoriteBoards}))()}refreshBoards(){var t=this;return P((function*(){t.groups?t.grist.fetch():yield t.refresh()}))()}onCreateBoard(){var t=this;return P((function*(){var e=(0,u.dy)(R||(R=F(["\n <board-creation-popup\n .defaultGroup=","\n .groups=","\n @create-board=","\n ></board-creation-popup>\n "])),t.groupId,t.groups,function(){var e=P((function*(e){try{var{name:r,description:n,groupId:i}=e.detail,a={name:r,description:n,groupId:i,model:{width:1200,height:800}},{createBoard:o}=yield function(t){return y.apply(this,arguments)}(a);t.notify("info","new board created")}catch(e){O.error(e),t.notify("error",e,e)}}));return function(t){return e.apply(this,arguments)}}());d.WP.open({template:e,parent:t.renderRoot}),requestAnimationFrame((()=>{dispatchEvent(new Event("resize"))}))}))()}notify(t,e,r){document.dispatchEvent(new CustomEvent("notify",{detail:{level:t,message:e,ex:r}}))}};N.styles=(0,u.iv)(I||(I=F(["\n :host {\n display: flex;\n\n width: 100%;\n\n --grid-record-emphasized-background-color: red;\n --grid-record-emphasized-color: yellow;\n }\n\n ox-grist {\n flex: 1;\n overflow-y: auto;\n\n --grid-record-emphasized-background-color: red;\n --grid-record-emphasized-color: yellow;\n }\n\n #headroom {\n display: flex;\n flex-direction: row;\n align-items: center;\n padding: var(--padding-default) var(--padding-wide);\n border-top: 2px solid rgba(0, 0, 0, 0.2);\n background-color: var(--theme-white-color);\n box-shadow: var(--box-shadow);\n }\n\n #filters {\n flex: 1;\n --mdc-icon-size: 20px;\n }\n #mode {\n width: 100px;\n }\n #add {\n width: 50px;\n text-align: right;\n }\n\n #modes > * {\n padding: var(--padding-narrow);\n font-size: 1em;\n opacity: 0.5;\n color: var(--primary-text-color);\n cursor: pointer;\n }\n\n #modes > mwc-icon[active] {\n border-radius: 9px;\n background-color: rgba(var(--primary-color-rgb), 0.05);\n opacity: 1;\n color: var(--secondary-text-color);\n cursor: default;\n }\n #modes > mwc-icon:hover {\n opacity: 1;\n color: var(--secondary-text-color);\n }\n\n #add button {\n background-color: var(--status-success-color);\n border: 0;\n border-radius: 50%;\n padding: 5px;\n width: 36px;\n height: 36px;\n cursor: pointer;\n }\n #add button:hover {\n background-color: var(--focus-background-color);\n box-shadow: var(--box-shadow);\n }\n #add button mwc-icon {\n font-size: 2em;\n color: var(--theme-white-color);\n }\n\n #filters {\n position: relative;\n }\n #filters [type='text'] {\n background-color: transparent;\n border: 0;\n border-bottom: var(--border-dark-color);\n padding: var(--padding-narrow) var(--padding-narrow) 7px 25px;\n font-size: var(--fontsize-large);\n }\n #filters [type='text']:focus {\n outline: none;\n }\n #filters mwc-icon {\n position: absolute;\n top: 3px;\n color: var(--secondary-color);\n }\n #filters * {\n margin-right: var(--margin-default);\n }\n\n oops-spinner {\n display: none;\n position: absolute;\n left: 50%;\n top: 50%;\n transform: translate(-50%, -50%);\n }\n\n oops-spinner[show] {\n display: block;\n }\n\n @media only screen and (max-width: 460px) {\n #modes {\n display: none;\n }\n }\n "]))),(0,l.gn)([(0,c.Cb)({type:Boolean})],N.prototype,"creatable",void 0),(0,l.gn)([(0,c.Cb)({type:Object})],N.prototype,"config",void 0),(0,l.gn)([(0,c.Cb)({type:Object})],N.prototype,"data",void 0),(0,l.gn)([(0,c.Cb)({type:String})],N.prototype,"mode",void 0),(0,l.gn)([(0,c.Cb)({type:String})],N.prototype,"groupId",void 0),(0,l.gn)([(0,c.Cb)({type:Array})],N.prototype,"groups",void 0),(0,l.gn)([(0,c.Cb)({type:Array})],N.prototype,"favorites",void 0),(0,l.gn)([(0,c.SB)()],N.prototype,"_showSpinner",void 0),(0,l.gn)([(0,c.IO)("ox-grist")],N.prototype,"grist",void 0),N=(0,l.gn)([(0,c.Mo)("ox-board-list")],N)},46743:(t,e,r)=>{"use strict";var n,i,a=r(171),o=(r(61713),r(77198),r(94430)),s=r(56765);function l(t,e){return e||(e=t.slice(0)),Object.freeze(Object.defineProperties(t,{raw:{value:Object.freeze(e)}}))}var u,c,d=class extends o.oi{render(){return(0,o.dy)(n||(n=l([' <div id="target"></div> '])))}connectedCallback(){super.connectedCallback(),window.addEventListener("resize",(()=>{requestAnimationFrame((()=>{this._scene&&(this._scene.resize(),this.offsetWidth&&this._scene.fit())}))}))}disconnectedCallback(){super.disconnectedCallback(),this._releaseRef()}updated(t){t.has("sceneId")&&this._onSceneIdChanged()}_releaseRef(){this._scene&&(this._scene.target=null,this._scene.release&&this._scene.release(),delete this._scene)}_onSceneIdChanged(){this.provider&&(this._releaseRef(),this.sceneId&&this.provider.get(this.sceneId,!0).then((t=>{this._scene=t,this._scene.target=this._targetEl,this._scene.target.offsetWidth&&this._scene.fit()}),(t=>{})))}};function h(t,e,r,n,i,a,o){try{var s=t[a](o),l=s.value}catch(t){return void r(t)}s.done?e(l):Promise.resolve(l).then(n,i)}function f(t,e){return e||(e=t.slice(0)),Object.freeze(Object.defineProperties(t,{raw:{value:Object.freeze(e)}}))}d.styles=[(0,o.iv)(i||(i=l(["\n :host {\n position: relative;\n }\n\n #target {\n display: block;\n width: 100%;\n height: 100%;\n outline: 0;\n }\n "])))],(0,a.gn)([(0,s.Cb)({type:String})],d.prototype,"sceneId",void 0),(0,a.gn)([(0,s.Cb)({type:Object})],d.prototype,"provider",void 0),(0,a.gn)([(0,s.SB)()],d.prototype,"_scene",void 0),(0,a.gn)([(0,s.IO)("#target")],d.prototype,"_targetEl",void 0),d=(0,a.gn)([(0,s.Mo)("ox-board-wrapper")],d);var p,g,v=class extends o.oi{constructor(){super(...arguments),this.rows=1,this.columns=1}render(){return(0,o.dy)(u||(u=f([' <slot id="slot" select="[page]"></slot> '])))}connectedCallback(){var t,e=()=>super.connectedCallback,r=this;return(t=function*(){var t;yield e().call(r),r._slotObserver=new MutationObserver((t=>{var e=r.columns||1,n=r.rows||1;r.style["grid-template-columns"]="repeat(".concat(e,", 1fr)"),r.style["grid-template-rows"]="repeat(".concat(n,", 1fr)")})),yield r.updateComplete;var n=r.columns||1,i=r.rows||1;r.style["grid-template-columns"]="repeat(".concat(n,", 1fr)"),r.style["grid-template-rows"]="repeat(".concat(i,", 1fr)"),null===(t=r._slotObserver)||void 0===t||t.observe(r._slot,{childList:!0})},function(){var e=this,r=arguments;return new Promise((function(n,i){var a=t.apply(e,r);function o(t){h(a,n,i,o,s,"next",t)}function s(t){h(a,n,i,o,s,"throw",t)}o(void 0)}))})()}disconnectedCallback(){var t;super.disconnectedCallback(),null===(t=this._slotObserver)||void 0===t||t.disconnect(),delete this._slotObserver}start(){}stop(){}next(){}previous(){}};function m(t,e,r,n,i,a,o){try{var s=t[a](o),l=s.value}catch(t){return void r(t)}s.done?e(l):Promise.resolve(l).then(n,i)}function y(t,e){return e||(e=t.slice(0)),Object.freeze(Object.defineProperties(t,{raw:{value:Object.freeze(e)}}))}v.styles=[(0,o.iv)(c||(c=f(["\n :host {\n width: 100%;\n height: 100%;\n position: relative;\n\n display: grid;\n grid-gap: 0px;\n grid-auto-flow: dense;\n }\n "])))],(0,a.gn)([(0,s.Cb)({type:Number})],v.prototype,"rows",void 0),(0,a.gn)([(0,s.Cb)({type:Number})],v.prototype,"columns",void 0),(0,a.gn)([(0,s.SB)()],v.prototype,"_slotObserver",void 0),(0,a.gn)([(0,s.IO)("#slot")],v.prototype,"_slot",void 0),v=(0,a.gn)([(0,s.Mo)("ox-board-player-grid")],v);var b=class extends o.oi{constructor(){super(...arguments),this.axis="y",this.rows=1,this.columns=1,this._rotation=0,this._theta=0,this._radius=0,this._panelCount=0,this._panelSize=0,this._isHorizontal=!0}render(){return(0,o.dy)(p||(p=y(['\n <slot id="slot" select="[page]"></slot>\n\n <div id="carousel"></div>\n '])))}connectedCallback(){var t,e=()=>super.connectedCallback,r=this;return(t=function*(){var t;yield e().call(r),r._boundResize=r.build.bind(r),window.addEventListener("resize",r._boundResize),r._slotObserver=new MutationObserver((t=>{r.build()})),yield r.updateComplete,null===(t=r._slotObserver)||void 0===t||t.observe(r._slot,{childList:!0}),r.build()},function(){var e=this,r=arguments;return new Promise((function(n,i){var a=t.apply(e,r);function o(t){m(a,n,i,o,s,"next",t)}function s(t){m(a,n,i,o,s,"throw",t)}o(void 0)}))})()}disconnectedCallback(){var t;super.disconnectedCallback(),null===(t=this._slotObserver)||void 0===t||t.disconnect(),delete this._slotObserver,this._boundResize&&(window.removeEventListener("resize",this._boundResize),delete this._boundResize)}firstUpdated(){this._rotation=0}updated(t){t.has("axis")&&this._onAxisChanged()}build(){for(var t=Array.from(this.querySelectorAll("[page]")),e=Array.from(this._carousel.querySelectorAll("ox-board-player-grid")).pop(),r=this.rows||1,n=this.columns||1,i=e?e.querySelectorAll("[page]").length:0,a=t.shift();a;)i++%(r*n)||((e=document.createElement("ox-board-player-grid")).rows=r,e.columns=n,this._carousel.appendChild(e)),null==e||e.appendChild(a),a=t.shift();this.start()}start(){var t=this._carousel.querySelectorAll("ox-board-player-grid");this._isHorizontal="y"===this.axis,this._panelCount=t.length,this._panelSize=this._carousel[this._isHorizontal?"offsetWidth":"offsetHeight"]||640,this._rotateFn=this._isHorizontal?"rotateY":"rotateX",this._theta=360/(this._panelCount||1),this._radius=Math.round(this._panelSize/2/Math.tan(Math.PI/(this._panelCount<2?2:this._panelCount)));for(var e=0;e<this._panelCount;e++){var r=t[e],n=this._theta*e;r.style.opacity="1",r.style.backgroundColor="white",r.style.transform=this._rotateFn+"("+n+"deg) translateZ("+this._radius+"px)"}this._rotation=Math.round(this._rotation/this._theta)*this._theta,this._transform()}stop(){this._carousel.innerHTML=""}_onAxisChanged(){this.start()}_transform(){this._carousel.style.transform="translateZ(-"+this._radius+"px) "+this._rotateFn+"("+this._rotation+"deg)",this.dispatchEvent(new CustomEvent("transform",{bubbles:!0,composed:!0}))}previous(){this._rotation+=this._theta,this._transform()}next(){this._rotation-=this._theta,this._transform()}};b.styles=[(0,o.iv)(g||(g=y(["\n :host {\n display: block;\n width: 100%;\n height: 100%;\n position: relative;\n margin: 0 auto 0px;\n -webkit-perspective: 1200px;\n -moz-perspective: 1200px;\n -o-perspective: 1200px;\n perspective: 1200px;\n }\n\n #carousel {\n width: 100%;\n height: 100%;\n margin: 0px auto 0px;\n\n position: absolute;\n -webkit-transform-style: preserve-3d;\n -moz-transform-style: preserve-3d;\n -o-transform-style: preserve-3d;\n transform-style: preserve-3d;\n -webkit-transition: -webkit-transform 1.5s;\n -moz-transition: -moz-transform 1.5s;\n -o-transition: -o-transform 1.5s;\n transition: transform 1.5s;\n }\n\n #carousel > * {\n position: absolute;\n width: 100%;\n height: 100%;\n font-weight: bold;\n -webkit-transition: opacity 1.5s, -webkit-transform 1.5s;\n -moz-transition: opacity 1.5s, -moz-transform 1.5s;\n -o-transition: opacity 1.5s, -o-transform 1.5s;\n transition: opacity 1.5s, transform 1.5s;\n\n -webkit-backface-visibility: hidden;\n -moz-backface-visibility: hidden;\n -o-backface-visibility: hidden;\n backface-visibility: hidden;\n }\n "])))],(0,a.gn)([(0,s.Cb)({type:String})],b.prototype,"axis",void 0),(0,a.gn)([(0,s.Cb)({type:Number})],b.prototype,"rows",void 0),(0,a.gn)([(0,s.Cb)({type:Number})],b.prototype,"columns",void 0),(0,a.gn)([(0,s.SB)()],b.prototype,"_slotObserver",void 0),(0,a.gn)([(0,s.SB)()],b.prototype,"_boundResize",void 0),(0,a.gn)([(0,s.SB)()],b.prototype,"_rotation",void 0),(0,a.gn)([(0,s.SB)()],b.prototype,"_theta",void 0),(0,a.gn)([(0,s.SB)()],b.prototype,"_radius",void 0),(0,a.gn)([(0,s.SB)()],b.prototype,"_rotateFn",void 0),(0,a.gn)([(0,s.SB)()],b.prototype,"_panelCount",void 0),(0,a.gn)([(0,s.SB)()],b.prototype,"_panelSize",void 0),(0,a.gn)([(0,s.SB)()],b.prototype,"_isHorizontal",void 0),(0,a.gn)([(0,s.IO)("#slot")],b.prototype,"_slot",void 0),(0,a.gn)([(0,s.IO)("#carousel")],b.prototype,"_carousel",void 0),b=(0,a.gn)([(0,s.Mo)("ox-board-player-carousel")],b);var E,x,S,T,w,_,A,k,C,D=r(36179),L=(0,o.iv)(E||(x=["\n :host {\n display: flex;\n position: relative;\n flex-direction: column;\n width: 100%;\n height: 100%;\n overflow: hidden;\n justify-content: center;\n align-items: center;\n }\n\n ::slotted(*) {\n border: none;\n }\n\n ::slotted > * {\n flex: 1;\n }\n\n board-wrapper {\n width: 100%;\n height: 100%;\n position: relative;\n }\n\n board-wrapper[front] {\n background: black;\n }\n\n board-wrapper[back] {\n background: black;\n }\n\n #control {\n position: absolute;\n bottom: 1vh;\n width: 100vw;\n max-width: 435px;\n display: grid;\n grid-template-columns: 42px 42px 1fr;\n color: white;\n justify-content: center;\n align-items: center;\n grid-auto-flow: dense;\n padding: 5px;\n box-sizing: border-box;\n grid-template-rows: 12px 60px 12px;\n }\n\n #control[hidden] {\n display: none;\n }\n\n #control > div > * {\n cursor: pointer;\n user-select: none;\n }\n\n #joystick {\n position: relative;\n box-sizing: border-box;\n border: 2px solid tomato;\n background-color: #c34827;\n box-shadow: 0 0 5px #000;\n width: 100%;\n height: 100%;\n grid-column: 1 / span 2;\n border-radius: 50%;\n z-index: 2;\n grid-row: 1 / span 3;\n }\n\n #joystick mwc-icon {\n position: absolute;\n display: block;\n width: 20px;\n height: 20px;\n font-size: 25px;\n line-height: 0.7;\n }\n\n mwc-icon#up {\n left: 29px;\n }\n\n mwc-icon#left {\n top: 32px;\n left: -2px;\n }\n\n mwc-icon#play,\n mwc-icon#pause {\n left: 20px;\n top: 20px;\n width: 40px;\n height: 40px;\n border: 1px solid rgba(0, 0, 0, 0.15);\n border-radius: 50%;\n background-color: rgba(0, 0, 0, 0.15);\n font-size: 45px;\n line-height: 0.9;\n }\n\n mwc-icon#right {\n top: 31px;\n left: 60px;\n }\n\n mwc-icon#down {\n left: 29px;\n top: 63px;\n }\n\n mwc-icon#pause {\n text-indent: -2px;\n }\n\n #setting-container {\n grid-column: 2 / span 2;\n grid-row: 2;\n gap: 0 10px;\n border-radius: 12px;\n background: rgba(0, 0, 0, 0.7);\n height: 100%;\n box-shadow: rgb(0, 0, 0) 0px 0px 5px;\n display: grid;\n grid-template-columns: 1fr 60px;\n align-items: center;\n padding-left: 60px;\n padding-right: 5px;\n }\n\n #setting {\n display: grid;\n grid-template-columns: 1fr 1fr;\n grid-gap: 0 10px;\n }\n\n #setting mwc-icon {\n font-size: 22px;\n color: rgba(255, 174, 53, 0.8);\n }\n\n #setting input {\n width: 50px;\n margin-right: 5px;\n font-size: 14px;\n background-color: transparent;\n border: none;\n border-bottom: 1px solid #fff;\n color: #fff;\n text-align: right;\n }\n\n #setting select {\n border: none;\n font-size: 14px;\n }\n\n #setting input:focus {\n outline: none;\n }\n\n #schedule-container {\n display: flex;\n align-items: center;\n justify-content: space-between;\n }\n\n #grid-setting-container {\n display: flex;\n align-items: center;\n justify-content: space-between;\n }\n\n #etc {\n display: grid;\n grid-template-columns: 1fr 1fr;\n align-items: center;\n justify-items: center;\n }\n\n #etc mwc-icon {\n font-size: 30px;\n }\n\n #control [hidden] {\n display: none;\n }\n\n @media screen and (max-width: 460px) {\n #setting {\n grid-template-columns: 1fr;\n grid-template-rows: 1fr 1fr;\n }\n }\n"],S||(S=x.slice(0)),E=Object.freeze(Object.defineProperties(x,{raw:{value:Object.freeze(S)}}))));function R(t,e,r,n,i,a,o){try{var s=t[a](o),l=s.value}catch(t){return void r(t)}s.done?e(l):Promise.resolve(l).then(n,i)}function I(t){return function(){var e=this,r=arguments;return new Promise((function(n,i){var a=t.apply(e,r);function o(t){R(a,n,i,o,s,"next",t)}function s(t){R(a,n,i,o,s,"throw",t)}o(void 0)}))}}function O(t,e){return e||(e=t.slice(0)),Object.freeze(Object.defineProperties(t,{raw:{value:Object.freeze(e)}}))}var M=class extends o.oi{constructor(){super(...arguments),this.boards=[],this.playtime=30,this.columns=1,this.rows=1,this.started=!1,this.playing=!1,this._fullscreened=!1}render(){return(0,o.dy)(T||(T=O(["\n <slot @mousemove="," @transform=",' tabindex="-1">\n ','\n </slot>\n\n <div id="control" @mouseover=',' hidden>\n <div id="joystick">\n <mwc-icon id="up" @click=','>keyboard_arrow_up</mwc-icon>\n <mwc-icon id="left" @click=','>keyboard_arrow_left</mwc-icon>\n <mwc-icon id="play" @click='," ?hidden=",'>play_arrow</mwc-icon>\n <mwc-icon id="pause" @click='," ?hidden=",'>pause</mwc-icon>\n <mwc-icon id="right" @click=','>keyboard_arrow_right</mwc-icon>\n <mwc-icon id="down" @click=','>keyboard_arrow_down</mwc-icon>\n </div>\n\n <div id="setting-container">\n <div id="setting">\n <label id="schedule-container">\n <mwc-icon id="schedule">schedule</mwc-icon>\n <input\n .value=',"\n @change=",'\n />\n sec.\n </label>\n <div id="grid-setting-container">\n <mwc-icon id="view_module">view_module</mwc-icon>\n <select\n .value=',"\n @change=","\n >\n ","\n </select>\n x\n <select\n .value=","\n @change=","\n >\n ",'\n </select>\n </div>\n </div>\n\n <div id="etc">\n <mwc-icon id="fullscreen" @click='," ?hidden=",'\n >fullscreen</mwc-icon\n >\n <mwc-icon id="fullscreen-exit" @click='," ?hidden=",'\n >fullscreen_exit</mwc-icon\n >\n <mwc-icon id="close" @click=',">close</mwc-icon>\n </div>\n </div>\n </div>\n "])),(()=>this.onMousemove()),(()=>this.onTransform()),this.started?(0,o.dy)(w||(w=O(['\n <ox-board-player-carousel axis="y" .rows='," .columns="," player>\n ","\n </ox-board-player-carousel>\n "])),this.rows,this.columns,this.boards.map((t=>(0,o.dy)(_||(_=O([" <ox-board-wrapper page .sceneId="," .provider=","> </ox-board-wrapper> "])),t.id,this.provider)))):(0,o.dy)(A||(A=O([""]))),(()=>this.onMouseoverControl()),(()=>this.moveUp()),(()=>this.moveLeft()),(()=>this.play()),this.playing,(()=>this.pause()),!this.playing,(()=>this.moveRight()),(()=>this.moveDown()),this.playtime,(t=>this.playtime=Number(t.target.value)),this.rows,(t=>this.rows=Number(t.target.value)),[1,2,3,4,5].map((t=>(0,o.dy)(k||(k=O([" <option>","</option> "])),t))),this.columns,(t=>this.columns=Number(t.target.value)),[1,2,3,4,5].map((t=>(0,o.dy)(C||(C=O([" <option>","</option> "])),t))),(()=>this.onTapFullscreen()),this._fullscreened,(()=>this.onTapFullscreen()),!this._fullscreened,(()=>this.onTapClose()))}firstUpdated(){(0,D.Xb)(this),this.addEventListener("swipe",(t=>{var e=t.detail.directions;e.left?this.moveRight():e.right?this.moveLeft():e.top?this.moveDown():e.bottom&&this.moveUp()})),this.setAttribute("tabindex","0"),this.addEventListener("keydown",(t=>{switch(t.key){case"Right":case"ArrowRight":t.stopPropagation(),this.moveRight();break;case"Left":case"ArrowLeft":t.stopPropagation(),this.moveLeft();break;case"Up":case"ArrowUp":t.stopPropagation(),this.moveUp();break;case"Down":case"ArrowDown":t.stopPropagation(),this.moveDown()}})),this.focus()}updated(t){t.has("boards")||t.has("columns")||t.has("rows")?this.boards&&this.boards.length>0?this.restart():this.stop():t.has("playtime")&&this.playing&&this._resetTransformTimer()}_resetFadeTimer(t){var e=this;return I((function*(){if(e._controlAnimation||(e._controlAnimation=e._control.animate([{opacity:1,easing:"ease-in"},{opacity:0}],{delay:1e3,duration:2e3})),e._control.hidden=!1,e._controlAnimation.cancel(),!t)try{e._controlAnimation.play(),yield e._controlAnimation.finished,e._control.hidden=!0}catch(t){}}))()}_resetTransformTimer(){clearTimeout(this._transferTimer),this.playing=!0,this._currentPlayer&&(this._transferTimer=setTimeout((()=>{this._transferTimer&&this._currentPlayer.next()}),1e3*this.playtime))}onMousemove(){this._resetFadeTimer()}onMouseoverControl(){this._resetFadeTimer(!0)}onTapFullscreen(){(0,D.LK)(this,(()=>{this._fullscreened=!0,this.focus()}),(()=>{this._fullscreened=!1,this.focus()}))}onTransform(){requestAnimationFrame((()=>this.started&&this.playing&&this._resetTransformTimer()))}play(){this._resetTransformTimer()}pause(){clearTimeout(this._transferTimer),this.playing=!1}moveLeft(){this._currentPlayer.axis="y",this._currentPlayer.previous()}moveRight(){this._currentPlayer.axis="y",this._currentPlayer.next()}moveUp(){this._currentPlayer.axis="x",this._currentPlayer.next()}moveDown(){this._currentPlayer.axis="x",this._currentPlayer.previous()}onTapClose(){this._fullscreened&&(0,D.HA)(),window.history.back()}restart(){var t=this;return I((function*(){yield t.stop(),yield t.start()}))()}start(){var t=this;return I((function*(){t.boards&&0!=t.boards.length&&(t.started=!0,t.playing=!0,yield t.updateComplete,t._currentPlayer=t.renderRoot.querySelector(':not([style*="display: none"])[player]'),t._resetTransformTimer(),t._resetFadeTimer(),t.focus())}))()}stop(){var t=this;return I((function*(){clearTimeout(t._transferTimer),t._currentPlayer&&t._currentPlayer.stop(),t.started=!1,yield t.updateComplete}))()}};M.styles=L,(0,a.gn)([(0,s.Cb)({type:Array})],M.prototype,"boards",void 0),(0,a.gn)([(0,s.Cb)({type:Number})],M.prototype,"playtime",void 0),(0,a.gn)([(0,s.Cb)({type:Number})],M.prototype,"columns",void 0),(0,a.gn)([(0,s.Cb)({type:Number})],M.prototype,"rows",void 0),(0,a.gn)([(0,s.Cb)({type:Boolean})],M.prototype,"started",void 0),(0,a.gn)([(0,s.Cb)({type:Boolean})],M.prototype,"playing",void 0),(0,a.gn)([(0,s.Cb)({type:Object})],M.prototype,"provider",void 0),(0,a.gn)([(0,s.SB)()],M.prototype,"_controlAnimation",void 0),(0,a.gn)([(0,s.SB)()],M.prototype,"_transferTimer",void 0),(0,a.gn)([(0,s.SB)()],M.prototype,"_currentPlayer",void 0),(0,a.gn)([(0,s.SB)()],M.prototype,"_fullscreened",void 0),(0,a.gn)([(0,s.IO)("#control")],M.prototype,"_control",void 0),M=(0,a.gn)([(0,s.Mo)("ox-board-player")],M)},52864:(t,e,r)=>{"use strict";r(72583),r(757);var n=r(171),i=(r(84558),r(27820),r(94430)),a=r(56765),o=r(21095),s=r(51266);const l={id:"data-binder",beforeUpdate:function(t){t.data&&(t.data.rawData||(t.data.rawData=[]),t.data.rawData=function(t,e){if(!t)return null;if("string"==typeof t)try{t=JSON.parse(t)}catch(t){return s.warn("invalid chart data format",t),null}if(!(t instanceof Array))return t instanceof Object?t:null;if(0===t.length)return null;t[0].hasOwnProperty("__field1")&&(t=function(t){if(!t||0===t.length)return null;var e={},r=[];for(var n in t[0])e[n]=t[0][n];for(var i=1;i<t.length;i++){var a={},o=t[i];for(var s in e){var l=e[s],u=o[s];a[l]=u}r.push(a)}return r}(t));var r=e.data.labelDataKey,n=[];for(var i in e.data.datasets)n.push(e.data.datasets[Number(i)].dataKey);var a=[],o=[],l={seriesData:a,labelData:o};for(var u in t){var c=t[Number(u)];for(var d in o.push(c[r]),n)n[d]&&(a[d]||(a[d]=[]),isNaN(c[n[d]])&&(c[n[d]]=NaN),a[d].push(c[n[d]]))}return l}(t.data.rawData,t)||{seriesData:[],labelData:[]},t.data.rawData.seriesData,function(t){var e=t.data.rawData.labelData;t.config.data.labels=e||[]}(t),function(t){if(t.data.rawData){var e=t.data.rawData.seriesData;for(var r in e&&0!==e.length||(e=[null]),t.data.datasets)t.data.datasets[Number(r)].data=e[r]||[]}}(t))}};var u,c=r(80427);function d(t){if(t){var e,r,n,i=(t.data||{}).datasets||[],a=t.options||{},o=a.scales||{},s=a.legend||{},l=!1===a.tooltip?void 0:a.tooltips=a.tooltips||{},u=a.multiAxis,c=[!1,!1],d=Number(a.defaultFontSize),S=a.defaultFontFamily,T=a.defaultFontColor,w=a.theme;for(var _ in function(t,e){switch(t){case"horizontalBar":e.scales||(e.scales={});break;case"radar":case"polarArea":e.defaultFontColor&&(e.scale.ticks.fontColor=e.defaultFontColor,e.scale.pointLabels?e.scale.pointLabels.fontColor=e.defaultFontColor:e.scale.pointLabels={fontColor:e.defaultFontColor}),e.scale.ticks.backdropColor=e.fillStyle?e.fillStyle:"#00ff0000";break;case"line":case"bar":if(e.scales||(e.scales={}),e.scales.yAxes||(e.scales.yAxes=[]),1===e.scales.yAxes.length){var r=e.scales.yAxes;r.push({position:"right",id:"right",display:e.multiAxis||!1,gridLines:{display:r[0]&&r[0].gridLines&&r[0].gridLines.display||!1},ticks:{beginAtZero:!1,callback:function(t,e,r){var n=t;return"number"==typeof n&&(n=n.toLocaleString()),n}}})}break;case"pie":case"doughnut":break;default:e.scale||(e.scale={})}}(t.type,a),i){var A=i[_];if(a.stacked&&!A.stack&&(A.stack="A"),"bar"==t.type){var k=o.xAxes&&o.xAxes[0].categorySpacing||0,C=o.xAxes&&o.xAxes[0].barSpacing||0;A.categoryPercentage=1-k||1,A.barPercentage=1-C||.8}else if("horizontalBar"==t.type){var D=o.yAxes&&o.yAxes[0].categorySpacing||0,L=o.yAxes&&o.yAxes[0].barSpacing||0;A.categoryPercentage=1-D||1,A.barPercentage=1-L||.8}E(A,t),u||"right"==A.yAxisID&&(A.yAxisID="left")}delete a.stacked;var R=i.filter((t=>"left"==t.yAxisID)),I=i.filter((t=>"right"==t.yAxisID));switch(R.forEach((t=>{R.filter((e=>t.stack==e.stack)).length>1&&(c[0]=!0)})),I.forEach((t=>{I.filter((e=>t.stack==e.stack)).length>1&&(c[1]=!0)})),n=c[0]||c[1],t.type){case"line":case"bar":case"horizontalBar":for(var O in e=o.xAxes||[],r=o.yAxes||[],"horizontalBar"==t.type&&(e=o.yAxes||[],r=o.xAxes||[]),e){var M=e[O];h(M,n),g(M,{fontSize:d,fontFamily:S}),v(M),m(M),p(M),y(M,w,T),x(M.ticks),M.gridLines.display=a.xGridLine}for(var P in r){var F=r[P];1==P&&f(F,u),h(F,c[P]),g(F,{fontSize:d,fontFamily:S}),v(F),p(F),y(F,w,T),x(F.ticks),0==P&&(F.gridLines.display=a.yGridLine),1==P&&(F.gridLines.display=a.y2ndGridLine)}break;case"pie":case"doughnut":break;default:g(a.scale||{},{fontSize:d,fontFamily:S})}!function(t,e){var{fontFamily:r,fontSize:n}=e;t.labels=t.labels?t.labels:{},t.labels.fontSize=n,r&&(t.labels.fontFamily=r)}(s,{fontSize:d,fontFamily:S}),s.labels&&(s.labels.boxWidth=15),function(t,e,r){var n=b(e);t.labels=t.labels?t.labels:{},t.labels.fontColor=r||n.clone().setAlpha(.5).toString()}(s,w,T),a.tooltip&&function(t,e){var{fontSize:r,fontFamily:n}=e;t.titleFontSize=t.bodyFontSize=t.footerFontSize=r,n&&(t.titleFontFamily=t.bodyFontFamily=t.footerFontFamily=n)}(l,{fontSize:d,fontFamily:S}),a.tooltip&&function(t){t.callbacks=t.callbacks||{},t.intersect=!1,t.mode="index",t.callbacks.label=function(t,e){var r,n,i,a,o,s,l=null===(n=null===(r=e.datasets)||void 0===r?void 0:r[t.datasetIndex||0].data)||void 0===n?void 0:n[t.index||0],u=(null===(i=e.datasets)||void 0===i?void 0:i[t.datasetIndex||0].label)||(null===(a=e.labels)||void 0===a?void 0:a[t.index||0]),c=Number(l);isNaN(c)||(l=c);var d=(null===(o=e.datasets)||void 0===o?void 0:o[t.datasetIndex||0].valuePrefix)||"",h=(null===(s=e.datasets)||void 0===s?void 0:s[t.datasetIndex||0].valueSuffix)||"";return"".concat(u,": ").concat(d+(null==l?void 0:l.toLocaleString())+h)}}(l)}}function h(t,e){t.stacked=e}function f(t,e){t.display=e}function p(t){t.scaleLabel||(t.scaleLabel={}),t.scaleLabel.labelString=t.axisTitle,t.scaleLabel.display=!!t.axisTitle}function g(t,e){var{fontSize:r,fontFamily:n}=e;t.ticks=t.ticks?t.ticks:{},t.ticks.fontSize=r,n&&(t.ticks.fontFamily=n),t.pointLabels={fontSize:r,fontFamily:n}}function v(t){t.ticks=t.ticks?t.ticks:{};var e=t.ticks.autoMin,r=t.ticks.autoMax;!0===e&&delete t.ticks.min,!0===r&&delete t.ticks.max}function m(t){t.ticks=t.ticks?t.ticks:{}}function y(t,e,r){var n=b(e);t.gridLines=t.gridLines?t.gridLines:{},t.gridLines&&(t.gridLines.zeroLineColor=n.clone().setAlpha(.5).toString(),t.gridLines.color=n.clone().setAlpha(.1).toString()),t.ticks=t.ticks?t.ticks:{},t.ticks.fontColor=r||n.clone().setAlpha(.5).toString()}function b(t){var e;return e="light"===t?"#fff":"#000",new c.C(e)}function E(t,e){var r=t.type||e.type,n="".concat(r," ").concat(t.yAxisID," ").concat(t.stack||t.dataKey),i=t.color?t.color:t.backgroundColor;switch(r){case"bar":case"horizontalBar":default:t.borderColor=t.backgroundColor=i;break;case"line":case"radar":i=t.color?t.color:t.borderColor,t.pointBackgroundColor=t.pointBorderColor=t.borderColor=t.backgroundColor=i,t.pointBorderWidth=.5*t.borderWidth,t.pointHoverRadius=t.pointRadius,null==t.fill&&(t.fill=!1)}t.stack=n}function x(t){t&&(t.callback=function(t,e,r){var n;if(n=Number.isNaN(Number(t))?t:Number(t).toLocaleString())return n})}function S(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function T(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?S(Object(r),!0).forEach((function(e){w(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):S(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function w(t,e,r){return(e=function(t){var e=function(t,e){if("object"!=typeof t||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==typeof e?e:String(e)}(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}o.Chart.plugins.register(l);var _=class extends i.oi{firstUpdated(){this.initChart()}render(){return(0,i.dy)(u||(t=[" <canvas></canvas> "],e||(e=t.slice(0)),u=Object.freeze(Object.defineProperties(t,{raw:{value:Object.freeze(e)}}))));var t,e}updated(t){(t.has("width")||t.has("height"))&&this.updateChartSize(),t.has("options")&&this.updateChartConfig(),t.has("data")&&(this._chart.data.rawData=this.data,this._chart.update())}initChart(){var{data:t,options:e,type:r}=this.options;e.maintainAspectRatio=!1,this.attachPluginOptions(e),d(this.options),this._chart=new o.Chart(this._canvas,{type:r,data:t,options:e}),this.updateChartSize(),this._initialized=!0}updateChartSize(){var t=Math.floor(this.width),e=Math.floor(this.height);this._canvas.style.width="".concat(t,"px"),this._canvas.style.height="".concat(e,"px");var r=()=>{0==this._canvas.offsetWidth||0==this._canvas.offsetHeight?requestAnimationFrame(r):this._chart.resize()};requestAnimationFrame(r)}updateChartConfig(){if(this._chart){var{data:t,options:e,type:r}=this.options;e.maintainAspectRatio=!1,this.attachPluginOptions(e),d(this.options),this._chart.type=r,this._chart.data=t,this._chart.options=e,this._chart.data.rawData=this.data,this._chart.update()}}attachPluginOptions(t){t.plugins||(t.plugins={}),this.attachDatalabelPluginOptions(t.plugins)}attachDatalabelPluginOptions(t){t.datalabels=T(T({},t.datalabels),{},{display:function(t){return!!t.dataset.displayValue},anchor:function(t){return t.dataset.dataLabelAnchor||"center"},color:function(t){return t.dataset.defaultFontColor||"#000"},font:function(t){return{size:t.dataset.defaultFontSize}},clamp:!0,formatter:function(t,e){var r=e.dataset.valuePrefix||"",n=e.dataset.valueSuffix||"";return null==t?t:r+String(t).toLocaleString()+n}})}};(0,n.gn)([(0,a.Cb)({type:Number})],_.prototype,"width",void 0),(0,n.gn)([(0,a.Cb)({type:Number})],_.prototype,"height",void 0),(0,n.gn)([(0,a.Cb)({type:Object})],_.prototype,"options",void 0),(0,n.gn)([(0,a.Cb)({type:Object})],_.prototype,"data",void 0),(0,n.gn)([(0,a.IO)("canvas")],_.prototype,"_canvas",void 0),_=(0,n.gn)([(0,a.Mo)("ox-chart")],_);var A=r(54207),k=r.n(A),C=r(83305);function D(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function L(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?D(Object(r),!0).forEach((function(e){R(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):D(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function R(t,e,r){return(e=function(t){var e=function(t,e){if("object"!=typeof t||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==typeof e?e:String(e)}(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}var I={mutable:!1,resizable:!0,rotatable:!0,properties:[{type:"chartjs",label:"",name:"chart"}],"value-property":"data",help:"scene/component/chartjs"};class O extends C.HTMLOverlayElement{constructor(){super(...arguments),this._isChartChanged=!1,this._isDataChanged=!1}get nature(){return I}get hasTextProperty(){return!1}get tagName(){return"ox-chart"}isShadowable(){return!1}createElement(){super.createElement();var{width:t,height:e}=this.bounds,r=this.element,n=this.data;r.width=t,r.height=e,this._setChartConfig(r),r.data=n}setElementProperties(t){this.set("lineWidth",0);var{chart:e}=this.state,{width:r,height:n}=this.bounds,i=this.data;try{t.width=r,t.height=n,e&&this._isChartChanged&&(this._setChartConfig(t),this._isChartChanged=!1),this._isDataChanged&&(t.data=i,this._isDataChanged=!1)}catch(t){(0,C.error)(t)}}_setChartConfig(t){var{chart:e,fontSize:r=12,fontFamily:n,fontColor:i,shadow:a}=this.state,{left:o=0,top:s=0,blurSize:l=0,color:u="transparent"}=a||{},c={defaultFontSize:r,defaultFontFamily:n,defaultFontColor:i},d={shadowOffsetX:o,shadowOffsetY:s,shadowBlur:l,shadowColor:u},h=k()(e);h.options=L(L(L({},h.options),c),{},{tooltips:!1}),h.data.datasets=h.data.datasets.map((t=>L(L({},t),d))),t.options=h}onchange(t,e){this._isChartChanged=!1,("chart"in t||"fontSize"in t||"fontFamily"in t||"fontColor"in t||"shadow"in t)&&(this._isChartChanged=!0),super.onchange(t,e)}onchangeData(t){this._isDataChanged=!0}}C.Component.register("chartjs",O)},80351:(t,e,r)=>{"use strict";var n=r(83305),i={mutable:!1,resizable:!0,rotatable:!0,properties:[{type:"number",label:"hour-width",name:"hourWidth",property:"hourWidth"},{type:"number",label:"minute-width",name:"minuteWidth",property:"minuteWidth"},{type:"number",label:"second-width",name:"secondWidth",property:"secondWidth"},{type:"checkbox",label:"needle-round",name:"needleRound",property:"needleRound"},{type:"checkbox",label:"show-second",name:"showSecond",property:"showSecond"},{type:"checkbox",label:"show-number",name:"showNumber",property:"showNumber"},{type:"number",label:"inner-circle-size",name:"innerCircleSize",property:"innerCircleSize"},{type:"color",label:"inner-circle-color",name:"innerCircleColor",property:"innerCircleColor"}],help:"scene/component/analog-clock"};function a(t,e,r,n,i){t.beginPath(),t.lineWidth=n,t.lineCap=i?"round":"square",t.moveTo(0,0),t.rotate(e),t.lineTo(0,-r),t.stroke(),t.rotate(-e)}class o extends n.Ellipse{is3dish(){return!1}_draw(t){var e,r,{cx:n,cy:i,rx:o,ry:s,fillStyle:l,strokeStyle:u,fontColor:c="#000",lineWidth:d,hourWidth:h,minuteWidth:f,secondWidth:p,needleRound:g=!1,showSecond:v=!0,showNumber:m=!0,innerCircleSize:y=5,innerCircleColor:b="#000"}=this.state;if(t.beginPath(),t.ellipse(n,i,Math.abs(o),Math.abs(s),0,0,2*Math.PI),t.fillStyle=l,t.strokeStyle=u,t.lineWidth=d||.1*o,this.drawFill(t),this.drawStroke(t),t.beginPath(),t.translate(n,i),t.scale(1,s/o),m)for(t.font=.15*o+"px arial",t.textBaseline="middle",t.textAlign="center",t.fillStyle=c,r=1;r<13;r++)e=r*Math.PI/6,t.rotate(e),t.translate(0,.85*-o),t.rotate(-e),t.fillText(r.toString(),0,0),t.rotate(e),t.translate(0,.85*o),t.rotate(-e);var E=new Date,x=E.getHours(),S=E.getMinutes(),T=E.getSeconds();a(t,x=(x%=12)*Math.PI/6+S*Math.PI/360+T*Math.PI/21600,.55*o,h||.07*o,g),a(t,S=S*Math.PI/30+T*Math.PI/1800,.8*o,f||.07*o,g),v&&a(t,T=T*Math.PI/30,.9*o,p||.02*o,g),t.beginPath(),y&&(t.ellipse(0,0,y,y,0,0,2*Math.PI),t.fillStyle=b,t.fill()),t.beginPath(),t.scale(1,o/s),t.translate(-n,-i);var w=setTimeout((function(t){t.invalidate(),clearTimeout(w)}),1e3,this)}get nature(){return i}}n.Component.register("clock-analog",o);var s=r(19231),l={name:"ko",weekdays:"일요일_월요일_화요일_수요일_목요일_금요일_토요일".split("_"),weekdaysShort:"일_월_화_수_목_금_토".split("_"),weekdaysMin:"일_월_화_수_목_금_토".split("_"),months:"1월_2월_3월_4월_5월_6월_7월_8월_9월_10월_11월_12월".split("_"),monthsShort:"1월_2월_3월_4월_5월_6월_7월_8월_9월_10월_11월_12월".split("_"),ordinal:function(t){return t},formats:{LT:"A h:mm",LTS:"A h:mm:ss",L:"YYYY.MM.DD.",LL:"YYYY년 MMMM D일",LLL:"YYYY년 MMMM D일 A h:mm",LLLL:"YYYY년 MMMM D일 dddd A h:mm",l:"YYYY.MM.DD.",ll:"YYYY년 MMMM D일",lll:"YYYY년 MMMM D일 A h:mm",llll:"YYYY년 MMMM D일 dddd A h:mm"},meridiem:function(t){return t<12?"오전":"오후"},relativeTime:{future:"%s 후",past:"%s 전",s:"몇 초",m:"1분",mm:"%d분",h:"한 시간",hh:"%d시간",d:"하루",dd:"%d일",M:"한 달",MM:"%d달",y:"일 년",yy:"%d년"}};s.Z.locale(l,null,!0);var u={name:"zh-cn",weekdays:"星期日_星期一_星期二_星期三_星期四_星期五_星期六".split("_"),weekdaysShort:"周日_周一_周二_周三_周四_周五_周六".split("_"),weekdaysMin:"日_一_二_三_四_五_六".split("_"),months:"一月_二月_三月_四月_五月_六月_七月_八月_九月_十月_十一月_十二月".split("_"),monthsShort:"1月_2月_3月_4月_5月_6月_7月_8月_9月_10月_11月_12月".split("_"),ordinal:function(t,e){return"W"===e?t+"周":t+"日"},weekStart:1,yearStart:4,formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"YYYY/MM/DD",LL:"YYYY年M月D日",LLL:"YYYY年M月D日Ah点mm分",LLLL:"YYYY年M月D日ddddAh点mm分",l:"YYYY/M/D",ll:"YYYY年M月D日",lll:"YYYY年M月D日 HH:mm",llll:"YYYY年M月D日dddd HH:mm"},relativeTime:{future:"%s内",past:"%s前",s:"几秒",m:"1 分钟",mm:"%d 分钟",h:"1 小时",hh:"%d 小时",d:"1 天",dd:"%d 天",M:"1 个月",MM:"%d 个月",y:"1 年",yy:"%d 年"},meridiem:function(t,e){var r=100*t+e;return r<600?"凌晨":r<900?"早上":r<1100?"上午":r<1300?"中午":r<1800?"下午":"晚上"}};s.Z.locale(u,null,!0);var c={name:"ja",weekdays:"日曜日_月曜日_火曜日_水曜日_木曜日_金曜日_土曜日".split("_"),weekdaysShort:"日_月_火_水_木_金_土".split("_"),weekdaysMin:"日_月_火_水_木_金_土".split("_"),months:"1月_2月_3月_4月_5月_6月_7月_8月_9月_10月_11月_12月".split("_"),monthsShort:"1月_2月_3月_4月_5月_6月_7月_8月_9月_10月_11月_12月".split("_"),ordinal:function(t){return t+"日"},formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"YYYY/MM/DD",LL:"YYYY年M月D日",LLL:"YYYY年M月D日 HH:mm",LLLL:"YYYY年M月D日 dddd HH:mm",l:"YYYY/MM/DD",ll:"YYYY年M月D日",lll:"YYYY年M月D日 HH:mm",llll:"YYYY年M月D日(ddd) HH:mm"},meridiem:function(t){return t<12?"午前":"午後"},relativeTime:{future:"%s後",past:"%s前",s:"数秒",m:"1分",mm:"%d分",h:"1時間",hh:"%d時間",d:"1日",dd:"%d日",M:"1ヶ月",MM:"%dヶ月",y:"1年",yy:"%d年"}};s.Z.locale(c,null,!0);var d=r(42872),h=/[+-]\d\d(?::?\d\d)?/g,f=/([+-]|\d\d)/g;s.Z.extend((function(t,e,r){var n=e.prototype;r.utc=function(t){var r={date:t,utc:!0,args:arguments};return new e(r)},n.utc=function(t){var e=r(this.toDate(),{locale:this.$L,utc:!0});return t?e.add(this.utcOffset(),d.KX):e},n.local=function(){return r(this.toDate(),{locale:this.$L,utc:!1})};var i=n.parse;n.parse=function(t){t.utc&&(this.$u=!0),this.$utils().u(t.$offset)||(this.$offset=t.$offset),i.call(this,t)};var a=n.init;n.init=function(){if(this.$u){var t=this.$d;this.$y=t.getUTCFullYear(),this.$M=t.getUTCMonth(),this.$D=t.getUTCDate(),this.$W=t.getUTCDay(),this.$H=t.getUTCHours(),this.$m=t.getUTCMinutes(),this.$s=t.getUTCSeconds(),this.$ms=t.getUTCMilliseconds()}else a.call(this)};var o=n.utcOffset;n.utcOffset=function(t,e){var r=this.$utils().u;if(r(t))return this.$u?0:r(this.$offset)?o.call(this):this.$offset;if("string"==typeof t&&(t=function(t){void 0===t&&(t="");var e=t.match(h);if(!e)return null;var r=(""+e[0]).match(f)||["-",0,0],n=r[0],i=60*+r[1]+ +r[2];return 0===i?0:"+"===n?i:-i}(t),null===t))return this;var n=Math.abs(t)<=16?60*t:t,i=this;if(e)return i.$offset=n,i.$u=0===t,i;if(0!==t){var a=this.$u?this.toDate().getTimezoneOffset():-1*this.utcOffset();(i=this.local().add(n+a,d.KX)).$offset=n,i.$x.$localOffset=a}else i=this.utc();return i};var s=n.format;n.format=function(t){var e=t||(this.$u?"YYYY-MM-DDTHH:mm:ss[Z]":"");return s.call(this,e)},n.valueOf=function(){var t=this.$utils().u(this.$offset)?0:this.$offset+(this.$x.$localOffset||this.$d.getTimezoneOffset());return this.$d.valueOf()-t*d.WN},n.isUTC=function(){return!!this.$u},n.toISOString=function(){return this.toDate().toISOString()},n.toString=function(){return this.toDate().toUTCString()};var l=n.toDate;n.toDate=function(t){return"s"===t&&this.$offset?r(this.format("YYYY-MM-DD HH:mm:ss:SSS")).toDate():l.call(this)};var u=n.diff;n.diff=function(t,e,n){if(t&&this.$u===t.$u)return u.call(this,t,e,n);var i=this.local(),a=r(t).local();return u.call(i,a,e,n)}}));var p={mutable:!1,resizable:!0,rotatable:!0,properties:[{type:"string",label:"time-format",name:"timeFormat"},{type:"checkbox",label:"is-local-time",name:"localTime"},{type:"number",label:"utc",name:"utc"},{type:"select",label:"week-language",name:"weekLanguage",property:{options:[{display:"English",value:"en"},{display:"Korean",value:"ko"},{display:"Chinese",value:"zh-cn"},{display:"Japanese",value:"ja"}]}}],help:"scene/component/clock-text"};class g extends n.Text{is3dish(){return!1}get nature(){return p}render(t){super.render(t),this._raf=requestAnimationFrame((()=>{setTimeout((()=>{this._timer()}),1e3)}))}_timer(){this.set("data",this._getTimeStamp())}_getTimeStamp(){var t=(0,s.Z)(),e=this.get("utc"),r=this.get("timeFormat")||"YYYY-MM-DD HH:mm:ss",n=this.get("weekLanguage");return this.get("weekLanguage")||(n="en"),this.get("localTime")?t.local().locale(n).format(r):t.utc().utcOffset(Number(e)).locale(n).format(r)}dispose(){super.dispose(),void 0!==this._raf&&cancelAnimationFrame(this._raf)}}n.Component.register("clock-text",g)},32471:(t,e,r)=>{"use strict";var n=r(85194),i=r(83305),a=r(51266),o={mutable:!1,resizable:!0,rotatable:!0,properties:[{type:"select",label:"method",name:"method",property:{options:[{display:"GET",value:"GET"},{display:"POST",value:"POST"}]}},{type:"string",label:"action",name:"action"},{type:"number",label:"period",name:"period"},{type:"string",label:"name",name:"name"},{type:"string",label:"authorization",name:"authorization"},{type:"select",label:"format",name:"format",property:{options:[{display:"JSON",value:"JSON"},{display:"XML",value:"XML"},{display:"TEXT",value:"TEXT"}]}},{type:"select",label:"content-type",name:"contentType",property:{options:[{display:"JSON",value:"application/json"},{display:"FORM",value:"application/x-www-form-urlencoded"},{display:"TEXT",value:"text/plain"}]}},{type:"checkbox",label:"with-credentials",name:"withCredentials"},{type:"checkbox",label:"submit-on-load",name:"submitOnLoad"},{type:"checkbox",label:"debug",name:"debug"}],"value-property":"action"};class s extends i.HTMLOverlayContainer{dispose(){super.dispose(),this._stopRepeater()}setElementProperties(t){var{action:e="",method:r="POST",name:n="",contentType:i=""}=this.state;t.action=e,t.method=r,t.contentType=i,t.name=n}get action(){return this.state.action}set action(t){this.setState("action",t),this._startRepeater()}get period(){return 1e3*this.state.period}set period(t){this.setState("period",t),this._startRepeater()}_startRepeater(){this._stopRepeater(),this.app.isViewMode&&this.period&&(this._repeatInterval=setInterval(this._submit.bind(this),this.period))}_stopRepeater(){this._repeatInterval&&clearInterval(this._repeatInterval)}_onload(t){var e,r=null===(e=t.target)||void 0===e?void 0:e.response;try{switch(this.get("format")){case"JSON":r=JSON.parse(r);break;case"XML":r=(0,n.xml2js)(r,{compact:!0})}this.state.debug&&a.log("[FORM-RESULT]",r),this.setState("data",r)}catch(t){a.error(t)}}oncreate_element(t){this.app.isViewMode&&(t.onsubmit=e=>{e.preventDefault();var r=t.action,n=new XMLHttpRequest,i=[].filter.call(t.elements,(function(t){return"radio"!=t.type&&"checkbox"!=t.type||t.checked})).filter((function(t){return!!t.name})).filter((function(t){return!t.disabled})).map((function(t){return encodeURIComponent(t.name)+"="+encodeURIComponent(t.value)})).join("&");return n.onloadend=this._onload.bind(this),"get"==t.method?n.open(t.method,r+"?"+i):n.open(t.method,r),t.contentType&&n.setRequestHeader("Content-Type",t.contentType),this.get("authorization")&&n.setRequestHeader("Authorization",this.get("authorization")),this.get("withCredentials")&&(n.withCredentials=!0),"get"==t.method?n.send():n.send(i),!1},this.getState("submitOnLoad")&&setTimeout(this._submit.bind(this),100),this._startRepeater())}_submit(){this.element.dispatchEvent(new Event("submit",{cancelable:!0}))}get nature(){return o}}i.Component.register("form",s);var l={mutable:!1,resizable:!0,rotatable:!0,properties:[{type:"string",label:"legend",name:"legend"}]};class u extends i.HTMLOverlayContainer{setElementProperties(t){var{legend:e=""}=this.state;e?this.legendElement.textContent=e:(this._legendElement&&this.element.removeChild(this._legendElement),delete this._legendElement)}reposition(){super.reposition(),this.element.style.padding="revert"}get legendElement(){if(!this._legendElement){var t=document.createElement("legend");t.style.position="absolute",t.style.top="0",t.style.transform="translateY(-50%)",t.style.backgroundColor="inherit",this.element.appendChild(t),this._legendElement=t}return this._legendElement}get nature(){return l}}i.Component.register("fieldset",u);var c={mutable:!1,resizable:!0,rotatable:!0,properties:[{type:"string",label:"value",name:"value"},{type:"number",label:"size",name:"size"},{type:"string",label:"name",name:"name"},{type:"checkbox",label:"submit-on-change",name:"submitOnChange"},{type:"checkbox",label:"copy-value-to-data",name:"copyValueToData"},{type:"string",label:"text-field",name:"textField"},{type:"string",label:"value-field",name:"valueField"},{type:"options",label:"options",name:"options",editor:{fullwidth:!0}}],"value-property":"value"};class d extends i.HTMLOverlayElement{get nature(){return c}buildOptions(){var t,{options:e=[],textField:r,valueField:n,value:i}=this.state;e instanceof Array||(e=[]),this.element.textContent="",e.map&&e.map(((e,i)=>{var a,o;return a=r?"(index)"==r?i:e&&e[r]||String.fromCharCode(160):e&&(e.text||e),o=n?"(index)"==n?i:e&&e[n]:e&&(e.value||e),void 0===t&&(t=o),o==this.value&&(t=this.value),{text:a,value:o}})).forEach((t=>{var e=document.createElement("option");e.value="string"==typeof t.value?t.value:JSON.stringify(t.value),e.text=t.text,this.element.appendChild(e)})),void 0!==t&&this.value!==t&&(this.value=JSON.stringify(t));var a=this.element;a.value!=this.value&&(a.value=this.value,a.dispatchEvent(new Event("change")))}createElement(){super.createElement(),this.buildOptions();var t=this.element;t.value=this.get("value")||"",t.onchange=e=>{this.set("value",t.value)}}setElementProperties(t){var{size:e,name:r}=this.state;t.size=e,t.name=r}onchange(t,e){super.onchange(t,e);var r=this.element;if("value"in t&&r){if(r.value=t.value,r.dispatchEvent(new CustomEvent("change",{detail:t.value})),this.get("copyValueToData"))try{this.data=JSON.parse(t.value)}catch(e){this.data=t.value}this.get("submitOnChange")&&r.form&&r.form.dispatchEvent(new Event("submit",{cancelable:!0}))}"options"in t&&this.buildOptions()}get options(){return this.getState("options")}set options(t){this.setState("options",t)}}i.Component.register("select",d);var h={mutable:!1,resizable:!0,rotatable:!0,properties:[{type:"string",label:"name",name:"name"},{type:"string",label:"value",name:"text"},{type:"string",label:"placeholder",name:"placeholder"},{type:"checkbox",label:"readonly",name:"readonly"},{type:"checkbox",label:"disabled",name:"disabled"},{type:"number",label:"max-length",name:"maxlength"}],"value-property":"text"};class f extends i.HTMLOverlayElement{get nature(){return h}get tagName(){return"textarea"}createElement(){super.createElement();var t=this.element;t.style.resize="none",t.onchange=e=>{this.value=t.value}}setElementProperties(t){var{name:e="",placeholder:r="",disabled:n,readonly:a,maxlength:o}=this.state;try{t.name=e,t.placeholder=r,t.disabled=n,t.readOnly=a,t.maxLength=void 0===o?524288:o,t.value=this.value}catch(t){(0,i.error)(t)}this.data=this.value}}i.Component.register("textarea",f);var p={mutable:!1,resizable:!0,rotatable:!0,properties:[{type:"string",label:"value",name:"text"}],"value-property":"text"};class g extends i.HTMLOverlayElement{get tagName(){return"button"}get nature(){return p}setElementProperties(t){this.element.textContent=this.value}}i.Component.register("button",g);var v={mutable:!1,resizable:!0,rotatable:!0,properties:[{type:"string",label:"name",name:"name"},{type:"string",label:"value",name:"text"},{type:"string",label:"placeholder",name:"placeholder"},{type:"checkbox",label:"readonly",name:"readonly"},{type:"checkbox",label:"disabled",name:"disabled"},{type:"number",label:"max-length",name:"maxlength"},{type:"checkbox",label:"submit-on-change",name:"submitOnChange"},{type:"string",label:"next-input",name:"nextInput"},{type:"checkbox",label:"autofocus",name:"autofocus"},{type:"checkbox",label:"alltime-focus",name:"alltimeFocus"},{type:"number",label:"alltime-focus-pending",name:"alltimeFocusPending",placeholder:"milli-seconds"},{type:"checkbox",label:"hide-keyboard",name:"hideKeyboard"}],"value-property":"text",help:"scene/component/input"};class m extends i.HTMLOverlayElement{get nature(){return v}get tagName(){return"input"}get inputType(){return this.get("type").substr(6)}select(){this.element.select()}createElement(){if(super.createElement(),this.element.onchange=t=>{this.onInputChange(t)},this.app.isViewMode){var{alltimeFocus:t,hideKeyboard:e,alltimeFocusPending:r,autofocus:n}=this.state;this.element.onkeydown=t=>{this.onInputKeydown(t)},t&&this.element.addEventListener("focusout",(t=>{setTimeout((()=>{this.select()}),r&&0!=r?r:1e3)})),e&&this.element.addEventListener("focusin",(t=>{this.element.setAttribute("readonly",""),this.select(),requestAnimationFrame((()=>{this.element.removeAttribute("readonly")}))})),n&&requestAnimationFrame((()=>{this.select()}))}}setElementProperties(t){var{name:e="",placeholder:r="",disabled:n,readonly:a,maxlength:o,autofocus:s}=this.state;try{t.type=this.inputType,t.name=e,t.placeholder=r,t.disabled=n,t.readOnly=a,t.maxLength=void 0===o?524288:o,t.value=this.value,s&&t.setAttribute("autofocus","")}catch(t){(0,i.error)(t)}}onchange(t,e){super.onchange(t,e);var r=this.element,n=this.nature["value-property"];if(n&&n in t&&r){var{submitOnChange:i}=this.state,a=t[n];r.value=a,this.data=t[n],i&&r.form&&r.form.dispatchEvent(new Event("submit",{cancelable:!0}))}}getInputValue(){return this.element.value}onInputChange(t){var{englishOnly:e,selectAfterChange:r}=this.state,n=this.getInputValue();this.value=e?null==n?void 0:n.replace(/[^\x00-\x7F]/g,""):n,r&&requestAnimationFrame((()=>{this.select()}))}onInputKeydown(t){if("Enter"===t.key&&!t.isComposing){t.preventDefault(),this.element.dispatchEvent(new CustomEvent("change"));var{nextInput:e}=this.state;e&&setTimeout((()=>{var t=this.root.findById(e);t&&t.select&&t.select()}),100)}var{englishOnly:r}=this.state,n=this.element;if(r&&!t.metaKey&&!t.ctrlKey&&!t.altKey&&/^Key/.test(t.code)){t.stopPropagation(),t.preventDefault();var i=t.shiftKey?t.code.charAt(3):t.code.charAt(3).toLowerCase(),a=n.value,o=n.selectionStart||0,s=n.selectionEnd||o;n.value=[a.substring(0,o),i,a.substring(s)].join(""),n.setSelectionRange(o+1,o+1)}}}["input-password","input-email","input-search","input-time","input-datetime-local","input-month","input-week"].forEach((t=>i.Component.register(t,m)));var y={mutable:!1,resizable:!0,rotatable:!0,properties:[{type:"string",label:"value",name:"value"},{type:"number",label:"size",name:"size"},{type:"string",label:"name",name:"name"},{type:"checkbox",label:"checked",name:"checked"}],"value-property":"value"};i.Component.register("input-radio",class extends m{get nature(){return y}get tagName(){return"input"}get inputType(){return"radio"}createElement(){if(this.element=document.createElement("label"),this.element){var t=document.createElement("input");this.element.appendChild(t);var e=document.createElement("p");e.style.display="inline",e.innerHTML=this.get("text"),this.element.appendChild(e),this.setElementProperties(this.element),this.parent.isHTMLElement&&this.parent.isHTMLElement()?this.parent.element.appendChild(this.element):this.root.rootModel.overlay.appendChild(this.element),i.Component.reposition(this),this.oncreate_element&&this.oncreate_element(this.element)}}setElementProperties(t){var e=this.element.querySelector("text"),r=this.element.querySelector("input"),{text:n,checked:i,value:a}=this.state;e&&(e.textContent=n),r&&(r.checked=i,r.value=a),super.setElementProperties(r)}postrender(t){this.changeText(t)}changeText(t){this.text&&this.hasTextProperty&&this.element.querySelector("p")&&(this.element.querySelector("p").innerText=this.text)}});var b={mutable:!1,resizable:!0,rotatable:!0,properties:[{type:"string",label:"value",name:"value"},{type:"number",label:"size",name:"size"},{type:"string",label:"name",name:"name"},{type:"checkbox",label:"checked",name:"checked"},{type:"checkbox",label:"submit-on-change",name:"submitOnChange"}],"value-property":"value"};i.Component.register("input-checkbox",class extends m{get nature(){return b}get tagName(){return"input"}get inputType(){return"checkbox"}get hasTextProperty(){return!0}createElement(){if(this.element=document.createElement("label"),this.element){var t=document.createElement("input");this.element.appendChild(t);var e=document.createTextNode(this.get("text"));this.element.appendChild(e),this.setElementProperties(this.element),this.parent.isHTMLElement&&this.parent.isHTMLElement()?this.parent.element.appendChild(this.element):this.root.rootModel.overlay.appendChild(this.element),i.Component.reposition(this),this.oncreate_element&&this.oncreate_element(this.element)}}setElementProperties(t){var e=this.element.querySelector("text"),r=this.element.querySelector("input"),{text:n,checked:i,value:a}=this.state;e&&(e.textContent=n),r&&(r.checked=i,r.value=a),super.setElementProperties(r)}});var E={mutable:!1,resizable:!0,rotatable:!0,properties:[{type:"string",label:"src",name:"src"}],"value-property":"src"};class x extends i.HTMLOverlayElement{get src(){return this.getState("src")}set src(t){this.setState("src",t)}setElementProperties(t){var{src:e=""}=this.state;t.src!=e&&(t.src=e)}get nature(){return E}}i.Component.register("iframe",x);var S={mutable:!1,resizable:!0,rotatable:!0,properties:[{type:"string",label:"src",name:"src"}],"value-property":"src"};class T extends i.HTMLOverlayElement{setElementProperties(t){var{src:e=""}=this.state;t.src!=e&&(t.src=e)}get src(){return this.get("src")}set src(t){this.set("src",t)}get nature(){return S}}i.Component.register("img",T);var w=r(88711),_=r.n(w);function A(t,e,r,n,i,a,o){try{var s=t[a](o),l=s.value}catch(t){return void r(t)}s.done?e(l):Promise.resolve(l).then(n,i)}var k={mutable:!1,resizable:!0,rotatable:!0,properties:[{type:"string",label:"src",name:"src"},{type:"checkbox",label:"started",name:"started"},{type:"checkbox",label:"controls",name:"controls"}],"value-property":"src"};class C extends i.HTMLOverlayElement{oncreate_element(t){var e,r=this;return(e=function*(){var{src:e,started:n}=r.state;t.addEventListener("canplay",(()=>{r.started&&t.play()})),r.onchangesrc(e),r.onchangestarted(n)},function(){var t=this,r=arguments;return new Promise((function(n,i){var a=e.apply(t,r);function o(t){A(a,n,i,o,s,"next",t)}function s(t){A(a,n,i,o,s,"throw",t)}o(void 0)}))})()}dispose(){this.reset(),super.dispose()}reset(){this._hlsSupporter&&this._hlsSupporter.destroy(),delete this._hlsSupporter}onchange(t,e){super.onchange(t,e),"src"in t&&this.onchangesrc(t.src),"started"in t&&this.onchangestarted(t.started)}setElementProperties(t){var{controls:e}=this.state;e?t.setAttribute("controls",""):t.removeAttribute("controls")}onchangestarted(t){var e=this.element;t?4==e.readyState&&e.play():e.pause()}onchangesrc(t){this.reset();var e=this.element;e&&(e.src=t,t.endsWith(".m3u8")&&_().isSupported()&&(this._hlsSupporter=new(_()),this._hlsSupporter.loadSource(t),this._hlsSupporter.attachMedia(e),this._hlsSupporter.on(_().Events.MANIFEST_PARSED,(()=>{this.started&&e.play()}))))}get src(){return this.getState("src")}set src(t){this.setState("src",t)}get started(){return this.getState("started")}set started(t){this.setState("started",t)}get nature(){return k}}i.Component.register("video",C);var D={mutable:!1,resizable:!0,rotatable:!0,properties:[{type:"string",label:"src",name:"src"},{type:"string",label:"mime-type",name:"mimetype"}],"value-property":"src"};class L extends i.HTMLOverlayElement{get src(){return this.getState("src")}set src(t){this.setState("src",t)}setElementProperties(t){var{src:e="",mimetype:r=""}=this.state;t.src!=e&&(t.src=e),t.type!=r&&(t.type=r)}get nature(){return D}}i.Component.register("embed",L);var R={mutable:!1,resizable:!0,rotatable:!0,properties:[{type:"string",label:"href",name:"href",property:"href"},{type:"select",label:"target",name:"target",property:{options:[{display:"self",value:"_self"},{display:"blank",value:"_blank"},{display:"parent",value:"_parent"},{display:"top",value:"_top"}]}}],"value-property":"href"};class I extends i.HTMLOverlayContainer{get tagName(){return"a"}get href(){return this.get("href")}set href(t){this.set("href",t)}setElementProperties(t){var{href:e="",target:r}=this.state;t.href!=e&&(t.href=e),t.target=r,0==this.components.length&&(this.element.textContent=this.text||e)}get nature(){return R}}i.Component.register("link",I);var O={mutable:!1,resizable:!0,rotatable:!0};class M extends i.HTMLOverlayContainer{setElementProperties(t){t.textContent=this.text}get tagName(){return"div"}get nature(){return O}}i.Component.register("div",M);var P={mutable:!1,resizable:!0,rotatable:!0,properties:[{type:"string",label:"name",name:"name"},{type:"string",label:"value",name:"text"},{type:"string",label:"placeholder",name:"placeholder"},{type:"checkbox",label:"readonly",name:"readonly"},{type:"checkbox",label:"disabled",name:"disabled"},{type:"number",label:"max-length",name:"maxlength"},{type:"checkbox",label:"submit-on-change",name:"submitOnChange"},{type:"string",label:"next-input",name:"nextInput"},{type:"checkbox",label:"autofocus",name:"autofocus"},{type:"checkbox",label:"alltime-focus",name:"alltimeFocus"},{type:"number",label:"alltime-focus-pending",name:"alltimeFocusPending",placeholder:"milli-seconds"},{type:"checkbox",label:"hide-keyboard",name:"hideKeyboard"},{type:"checkbox",label:"english-only",name:"englishOnly"},{type:"checkbox",label:"select-after-change",name:"selectAfterChange"}],"value-property":"text",help:"scene/component/input"};class F extends m{get nature(){return P}}["input-text"].forEach((t=>i.Component.register(t,F)));var N={mutable:!1,resizable:!0,rotatable:!0,properties:[{type:"string",label:"name",name:"name"},{type:"number",label:"value",name:"text"},{type:"number",label:"min",name:"min"},{type:"number",label:"max",name:"max"},{type:"number",label:"step",name:"step"},{type:"string",label:"placeholder",name:"placeholder"},{type:"checkbox",label:"readonly",name:"readonly"},{type:"checkbox",label:"disabled",name:"disabled"},{type:"string",label:"next-input",name:"nextInput"},{type:"checkbox",label:"autofocus",name:"autofocus"},{type:"checkbox",label:"alltime-focus",name:"alltimeFocus"},{type:"number",label:"alltime-focus-pending",name:"alltimeFocusPending",placeholder:"milli-seconds"},{type:"checkbox",label:"submit-on-change",name:"submitOnChange"},{type:"checkbox",label:"hide-keyboard",name:"hideKeyboard"},{type:"checkbox",label:"select-after-change",name:"selectAfterChange"}],"value-property":"text"};class B extends m{get nature(){return N}setElementProperties(t){super.setElementProperties(t);var{min:e=0,max:r=100,step:n=1}=this.state;t.min=e,t.max=r,t.step=n}getInputValue(){return this.element.valueAsNumber}get text(){return this.getState("text")}set text(t){this.setState("text",t)}}i.Component.register("input-number",B),i.Component.register("input-range",B);var U={mutable:!1,resizable:!0,rotatable:!0,properties:[{type:"string",label:"name",name:"name"},{type:"date",label:"value",name:"text"},{type:"date",label:"min",name:"min"},{type:"date",label:"max",name:"max"},{type:"checkbox",label:"submit-on-change",name:"submitOnChange"}],"value-property":"text"};i.Component.register("input-date",class extends m{get nature(){return U}setElementProperties(t){super.setElementProperties(t);var{min:e,max:r}=this.state;t.min=e,t.max=r}});var j={mutable:!1,resizable:!0,rotatable:!0,properties:[{type:"string",label:"name",name:"name"},{type:"string",label:"value",name:"text"},{type:"checkbox",label:"multiple",name:"multiple"}],"value-property":"text"};i.Component.register("input-file",class extends m{get nature(){return j}setElementProperties(t){super.setElementProperties(t),t.multiple=!!this.state.multiple}});var H=r(93681),G={mutable:!1,resizable:!0,rotatable:!0,properties:[{type:"string",label:"name",name:"name"},{type:"color",label:"value",name:"text",property:{withoutAlpha:!0,valueType:"hex"}},{type:"checkbox",label:"submit-on-change",name:"submitOnChange"}],"value-property":"text"};i.Component.register("input-color",class extends m{get nature(){return G}setElementProperties(t){this.value=(0,H.HA)(this.value||"#000000",{}).toHexString(!1),super.setElementProperties(t)}});var z={mutable:!1,resizable:!0,rotatable:!0,properties:[{type:"string",label:"name",name:"name"},{type:"string",label:"value",name:"text"}],"value-property":"text"};class V extends m{get nature(){return z}setElementProperties(t){super.setElementProperties(t)}}i.Component.register("input-button",V),i.Component.register("input-submit",V),i.Component.register("input-reset",V);var W={mutable:!1,resizable:!0,rotatable:!0,properties:[{type:"checkbox",label:"submit-on-change",name:"submitOnChange"},{type:"checkbox",label:"copy-value-to-data",name:"copyValueToData"}],"value-property":"value"};class K extends i.HTMLOverlayContainer{get nature(){return W}get tagName(){return"div"}containable(t){return"input-radio"==t.model.type}setElementProperties(t){}oncreate_element(t){t.onchange=()=>{this.changeChecked()},requestAnimationFrame((()=>{var{id:e}=this.state;Array.prototype.slice.call(t.querySelectorAll('input[type="radio"]')).forEach((t=>t.setAttribute("name",e)))}))}onchange(t,e){super.onchange(t,e);var r=this.element;if("value"in t&&r){if(this.updateChecked(),this.get("copyValueToData"))try{this.data=JSON.parse(t.value)}catch(e){this.data=t.value}this.get("submitOnChange")&&"FORM"==r.parentElement.tagName&&r.parentElement.dispatchEvent(new Event("submit",{cancelable:!0}))}}changeChecked(){var{id:t}=this.state,e=this.element.querySelector('input[name="'.concat(t,'"]:checked'));e&&this.set("value",e.value)}updateChecked(){var{id:t,value:e}=this.state,r=this.element.querySelector('input[name="'.concat(t,'"][value="').concat(e,'"]:not(:checked)'));r&&(r.checked=!0)}}i.Component.register("radio-group",K);var Y={mutable:!1,resizable:!0,rotatable:!0,properties:[{type:"textarea",label:"template",name:"template"},{type:"string",label:"apply-to",name:"applyTo"}]},q={type:"pattern",fitPattern:!0,image:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEAAAABACAMAAACdt4HsAAAAMFBMVEUAAAAdHR0AAAAAAAAAAAAREREODg4AAAATExMAAAAAAAAAAAAAAAAAAAAWFhYAAABtUS6TAAAAD3RSTlMArnboZDwVtVUHmMTU9CygGbkuAAABBklEQVR42u3Vy47DMAgFUMbE78f9/7+dqpVKFNUzwKqLnD0RvjGYbrdvF8tK9JBWieTRAO6tdQYyeWS8DfIYeONEdmlCLE+GOClkV3ASyC7gpPn+ouiODAdOeJkjHMAZF2OCE1eHK0BfkLXho5yU8XVsjKWKj7E1iya/44kvpcdLJa3LOdg3zIIr2fg7qEd4umYQXpJqiPZyVbQwsMXJtoq889CwkUknMT6ai5QOfBRcb4oY1fMmiBnV1TFk+YDooST6T30UM7a4h5hoS4r/wjnEusleLeiusPFKFwhXCx0GXHUjZBmrDJNRfQ2IYthDYv/grwmrqG1AtV0ShKuF+ONQ6Hb7Hr9EkkNRgwrYbAAAAABJRU5ErkJggg=="};class X extends i.HTMLOverlayContainer{createElement(){super.createElement();var t=this.element;t.value=this.get("value")||"",t.onchange=e=>{this.set("value",t.value)}}dispose(){super.dispose(),this.targets&&this.targets.forEach((t=>t.shadowRoot.innerHTML="<slot></slot>")),delete this.targets}setElementProperties(t){t.innerHTML=this.state.template}reposition(){super.reposition();var t=this.targets||[],e=this.rootModel&&Array.prototype.slice.call(this.rootModel.overlay.querySelectorAll(this.state.applyTo));e&&e.forEach((e=>{try{!e.shadowRoot&&e.attachShadow({mode:"open"}),e.shadowRoot.innerHTML=this.state.template}catch(t){(0,i.error)(t)}var r=t.indexOf(e);r>=0&&t.splice(r,1)})),t.forEach((t=>t.shadowRoot.innerHTML="<slot></slot>")),this.targets=e}get tagName(){return"template"}get fillStyle(){return q}get nature(){return Y}}i.Component.register("template",X)},85391:(t,e,r)=>{"use strict";var n=r(83305),i=[{type:"string",label:"value",name:"value",property:"value"},{type:"number",label:"start-value",name:"startValue",observe:function(t){this.parentNode.querySelector("[name=colorStops]").property.min=t},property:"startValue"},{type:"number",label:"end-value",name:"endValue",observe:function(t){this.parentNode.querySelector("[name=colorStops]").property.max=t},property:"endValue"},{type:"number",label:"step",name:"step",property:"step"},{type:"number",label:"step-text-size",name:"stepTextSize",property:"stepTextSize"},{type:"number",label:"sub-step",name:"subStep",property:"subStep"},{type:"number",label:"step-needle-size",name:"stepNeedleSize",property:"stepNeedleSize"},{type:"color",label:"step-fill-style",name:"stepFillStyle",property:"stepFillStyle"},{type:"solid-color-stops",label:"color-stops",name:"colorStops",property:{min:0,max:100}},{type:"legend",label:"",name:"toggleOption",property:{label:"Toggle Option"}},{type:"checkbox",label:"show-start-value",name:"showStartValue",property:"showStartValue"},{type:"checkbox",label:"show-end-value",name:"showEndValue",property:"showEndValue"},{type:"checkbox",label:"show-step-line",name:"showStepLine",property:"showStepLine"},{type:"checkbox",label:"show-step-text",name:"showStepText",property:"showStepText"},{type:"checkbox",label:"show-sub-step",name:"showSubStep",property:"showSubStep"},{type:"checkbox",label:"anim-from-base",name:"animFromBase"}],a={mutable:!1,resizable:!0,rotatable:!0,properties:[...i,{type:"number",label:"start-angle",name:"startAngle",property:"startAngle"},{type:"number",label:"end-angle",name:"endAngle",property:"endAngle"},{type:"color",label:"text-fill-style",name:"textFillStyle",property:"textFillStyle"},{type:"color",label:"needle-fill-style",name:"needleFillStyle",property:"needleFillStyle"},{type:"color",label:"inner-circle-fill-style",name:"innerCircleFillStyle",property:"innerCircleFillStyle"},{type:"checkbox",label:"in-text",name:"inText",property:"inText"}],help:"scene/component/gauge-circle"};function o(t,e,r,n){t.rotate(e),t.translate(0,-r),t.fillRect(0,.14*-r,n,.175*r),t.translate(0,r),t.rotate(-e)}function s(t,e,r,n){t.rotate(e),t.translate(0,-r),t.fillRect(0,.04*-r,n,.075*r),t.translate(0,r),t.rotate(-e)}function l(t,e,r,n){t.rotate(r),t.translate(0,.83*-n),t.rotate(-r),t.fillText(e,0,0),t.rotate(r),t.translate(0,.83*n),t.rotate(-r)}class u extends((0,n.ValueHolder)(n.Donut)){_draw(t){var{lineWidth:e=20,startValue:r,endValue:n,step:i,subStep:a,startAngle:u=0,endAngle:c=180,fontColor:d="black",showStepText:h=!0,showStartValue:f=!0,showEndValue:p=!0,showStepLine:g=!0,showSubStep:v=!0,inText:m=!0,colorStops:y,fillStyle:b,textFillStyle:E="black",needleFillStyle:x="black",innerCircleFillStyle:S="gray",stepNeedleSize:T=2,stepFillStyle:w,stepTextSize:_,cx:A,cy:k,rx:C,ry:D,ratio:L,animFromBase:R=!1}=this.state;r=Number(r),this.animOnValueChange(this.value,R,r);var I=.0174533/Math.PI,O=C/100*L,M=D/100*L,P=(c-u)/180,F=n-r;if(u=u*I-.5,c=c*I-.5,t.translate(A,k),t.beginPath(),t.ellipse(0,0,Math.abs(C),Math.abs(D),0,u*Math.PI,c*Math.PI),this.drawStroke(t),t.ellipse(0,0,Math.abs(O),Math.abs(M),0,c*Math.PI,u*Math.PI,!0),t.closePath(),y){var N=0,B=0;t.moveTo(0,0),y.forEach((function(e,n,i){t.beginPath();var a=Math.max(Math.min(e.position-r,F),0),o=B||Math.PI*(u+P*N/F);if(B=n===i.length-1?Math.PI*(u+P):Math.PI*(u+P*a/F),N>F||N>a)return!1;t.ellipse(0,0,Math.abs(C),Math.abs(D),0,o,B),t.ellipse(0,0,Math.abs(O),Math.abs(M),0,B,o,!0),t.fillStyle=e.color,t.fill(),N=a}))}t.scale(1,D/C),t.beginPath();var U=this.animValue;U=Math.max(Math.min(U,n),r);var j=Math.PI*(P*(U-r)/F+u-.5);if(function(t,e,r){t.rotate(r),t.beginPath(),t.moveTo(.035*e,0),t.lineTo(0,.8*e),t.lineTo(.035*-e,0),t.lineTo(.015*-e,.2*-e),t.lineTo(.015*e,.2*-e),t.rotate(-r)}(t,C,j),t.fillStyle=x,t.fill(),t.beginPath(),t.ellipse(0,0,Math.abs(C)/15,Math.abs(C)/15,0,0,2*Math.PI),t.fillStyle=S,t.fill(),t.fillStyle=w,g){var H=F/i;o(t,Math.PI*(u+.5),.8*C,T);for(var G=1;G<H;G++){var z=Math.PI*(P/H*G+u+.5);o(t,z,.8*C,T)}o(t,Math.PI*(c+.5),.8*C,T)}if(v)for(var V=F,W=1;W<=V;W++)if(W%i!=0&&W%a==0){var K=Math.PI*(P/V*W+u+.5);s(t,K,.8*C,T)}t.fillStyle=E,t.font=C*_/50+"px arial",t.textBaseline="middle",t.textAlign="center";var Y=m?.8:1.35;if(f&&l(t,r,Math.PI*(u+.5),C*Y),p&&l(t,n,Math.PI*(c+.5),C*Y),h)for(var q=F/i,X=1;X<q;X++){var $=r+i*X,Q=Math.PI*(P/q*X+u+.5);l(t,$,Q,C*Y)}t.scale(1,C/D),t.translate(-A,-k)}contains(t,e){var{cx:r,cy:n,rx:i,ry:a}=this.state,o=(t-r)/(2*i-.5),s=(e-n)/(2*a-.5);return o*o+s*s<.25}_post_draw(t){this.drawText(t)}get nature(){return a}}n.Component.register("gauge-circle",u);var c={mutable:!1,resizable:!0,rotatable:!0,properties:[...i,{type:"color",label:"text-fill-style",name:"textFillStyle",property:"textFillStyle"},{type:"color",label:"needle-fill-style",name:"needleFillStyle",property:"needleFillStyle"},{type:"number",label:"needle-size",name:"needleSize",property:"needleSize"}],help:"scene/component/gauge-vertical"};class d extends((0,n.ValueHolder)((0,n.RectPath)(n.Shape))){_draw(t){var{startValue:e,endValue:r,step:n,subStep:i,colorStops:a,needleFillStyle:o,stepFillStyle:s,textFillStyle:l,needleSize:u,stepNeedleSize:c,stepTextSize:d,showStepText:h=!0,showStartValue:f=!0,showEndValue:p=!0,showStepLine:g=!0,showSubStep:v=!0,width:m,height:y,top:b,left:E,animFromBase:x=!1}=this.state;e=Number(e),this.animOnValueChange(this.value,x,e);var S=r-e;if(t.translate(E,b),t.beginPath(),t.rect(0,0,m,y),this.drawFill(t),this.drawStroke(t),t.closePath(),a){var T=0;a.forEach((function(r,n,i){t.beginPath();var a,o=Math.max(Math.min(r.position-e,S),0),s=y*T/S;if(a=n===i.length-1||s+y*o/S?y-s:y-y*o/S,T>S||T>o)return!1;t.rect(0,y-s,m,-a),t.fillStyle=r.color,t.fill(),T=o}))}t.beginPath();var w=this.animValue;w=Math.max(Math.min(w,r),e);var _=y-(w-e)/S*y;if(u*=4,t.moveTo(1.05*m,_),t.lineTo(1.05*m+u,_+u/2),t.lineTo(1.05*m+u,_-u/2),t.fillStyle=o,t.fill(),t.closePath(),t.fillStyle=s,g){var A=S/n;t.fillRect(0,y,.06*y,c);for(var k=1;k<A;k++){var C=y/A*k;t.fillRect(0,C,.06*y,c)}t.fillRect(0,0,.06*y,c)}if(v){var D=S;t.fillRect(0,0,.027*y,c);for(var L=1;L<=D;L++)if(L%n!=0&&L%i==0){var R=y/D*L;t.fillRect(0,R,.027*y,c)}}var I=y*d/150;if(t.fillStyle=l,t.font=I+"px arial",t.textBaseline="middle",t.textAlign="center",f&&t.fillText(e,-I,y),p&&t.fillText(r,-I,0),h)for(var O=S/n,M=1;M<O;M++){var P=e+Number(n)*M,F=y-y/O*M;t.fillText(P,-I,F)}t.translate(-E,-b)}_post_draw(t){this.drawText(t)}get nature(){return c}}n.Component.register("gauge-vertical",d);var h={mutable:!1,resizable:!0,rotatable:!0,properties:[...i,{type:"color",label:"text-fill-style",name:"textFillStyle",property:"textFillStyle"},{type:"color",label:"needle-fill-style",name:"needleFillStyle",property:"needleFillStyle"},{type:"number",label:"needle-size",name:"needleSize",property:"needleSize"}],help:"scene/component/gauge-horizon"};class f extends((0,n.ValueHolder)((0,n.RectPath)(n.Shape))){_draw(t){var{startValue:e,endValue:r,step:n,subStep:i,colorStops:a,needleFillStyle:o,stepFillStyle:s,textFillStyle:l,needleSize:u,stepNeedleSize:c,stepTextSize:d,showStepText:h=!0,showStartValue:f=!0,showEndValue:p=!0,showStepLine:g=!0,showSubStep:v=!0,width:m,height:y,top:b,left:E,animFromBase:x=!1}=this.state;e=Number(e),this.animOnValueChange(this.value,x,e);var S=r-e;if(t.translate(E,b),t.beginPath(),t.rect(0,0,m,y),this.drawFill(t),this.drawStroke(t),t.closePath(),a){var T=0;a.forEach((function(r,n,i){t.beginPath();var a,o=Math.max(Math.min(r.position-e,S),0),s=m*T/S;if(a=n==i.length-1||s+m*o/S?m-s:m*o/S,T>S||T>o)return!1;t.rect(s,0,a,y),t.fillStyle=r.color,t.fill(),T=o}))}if(t.fillStyle=s,g){var w=S/n,_=.06*m;t.fillRect(0,y-_,c,_);for(var A=1;A<w;A++){var k=m/w*A;t.fillRect(k,y-_,c,_)}t.fillRect(m,y-_,c,_)}if(v){var C=S,D=.027*m;t.fillRect(0,y-D,c,D);for(var L=1;L<=C;L++)if(L%n!=0&&L%i==0){var R=m/C*L;t.fillRect(R,y-D,c,D)}}var I=m*d/150;if(t.fillStyle=l,t.font=I+"px arial",t.textBaseline="middle",t.textAlign="center",f&&t.fillText(e,0,y+.75*I),p&&t.fillText(r,m,y+.75*I),h)for(var O=S/n,M=1;M<O;M++){var P=e+n*M,F=m/O*M;t.fillText(P,F,y+.75*I)}t.beginPath();var N=this.animValue,B=((N=Math.max(Math.min(N,r),e))-e)/S*m;u*=4,t.moveTo(B,y+1.4*I),t.lineTo(B+u/2,y+u+1.4*I),t.lineTo(B-u/2,y+u+1.4*I),t.fillStyle=o,t.fill(),t.closePath(),t.translate(-E,-b)}_post_draw(t){this.drawText(t)}get nature(){return h}}n.Component.register("gauge-horizon",f)},50311:(t,e,r)=>{"use strict";var n=r(83305),i={ondragmove:function(t,e,r){var{left:n,width:i,height:o}=r.bounds,s=(r.transcoordP2S(t.x,t.y).x-n)/(i/2)*100;s=a(s,i,o),r.set({round:s})}};function a(t,e,r){var n=e>r?r/e*100:100;return t>=n?t=n:t<=0&&(t=0),t}class o extends n.Rect{is3dish(){return!1}_draw(t){var{top:e,left:r,width:n,height:i}=this.bounds,o=this.state.round;if(t.beginPath(),(o=a(o,n,i))>0){var s=o/100*(n/2);t.moveTo(r+s,e),t.lineTo(r+n-s,e),t.quadraticCurveTo(r+n,e,r+n,e+s),t.lineTo(r+n,e+i),t.lineTo(r,e+i),t.lineTo(r,e+s),t.quadraticCurveTo(r,e,r+s,e)}else t.rect(r,e,n,i);this.drawFill(t),this.drawStroke(t)}get controls(){var{top:t,left:e,width:r,height:n}=this.bounds,o=this.state.round;return[{x:e+r/2*((o=null==o?0:a(o,r,n))/100),y:t,handler:i}]}}n.Component.register("half-roundrect",o)},9175:(t,e,r)=>{"use strict";var n=r(83305),i={mutable:!1,resizable:!0,rotatable:!0,properties:[{type:"action",label:"remove",name:"remove",property:{icon:"remove_circle",action:function(t){var e=t.parent;e.removeComponent(t),e.set("activeIndex",0)}}}]};class a extends n.Container{get hasTextProperty(){return!1}get showMoveHandle(){return!1}get mutable(){return!1}get resizable(){return!1}get rotatable(){return!1}get nature(){return i}}function o(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function s(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?o(Object(r),!0).forEach((function(e){l(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):o(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function l(t,e,r){return(e=function(t){var e=function(t,e){if("object"!=typeof t||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==typeof e?e:String(e)}(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}n.Component.register("floor",a);var u=25,c={mutable:!1,resizable:!0,rotatable:!0,properties:[{type:"action",label:"add-floor",name:"addFloor",property:{icon:"add_circle",action:t=>{t.addFloor()}}},{type:"number",label:"active index",name:"activeIndex"}],"value-property":"activeIndex",help:"scene/component/indoor-map"};class d extends n.Container{constructor(){super(...arguments),this._focused=!1}get nature(){return c}get layout(){return n.CardLayout}get layoutConfig(){return this.get("layoutConfig")}set layoutConfig(t){this.set("layoutConfig",t)}get activeFloor(){return this.components[this.get("layoutConfig").activeIndex]}get activeIndex(){return this.get("activeIndex")}set activeIndex(t){this.set("activeIndex",Number(t))}ready(){super.ready(),0==this.components.length&&this.addFloor()}postrender(t){if(!this.app.isViewMode&&this._focused){for(var{left:e,top:r,width:n,fillStyle:i}=this.state,a=0;a<this.components.length;a++){t.beginPath(),t.rect(e-u,r+25*a,u,25);var o=255-20*(a+1)%255;t.fillStyle=(s=o,l=o,1,"rgba(".concat(o,", ").concat(s,", ").concat(l,", ").concat(1,")")),t.fill(),t.closePath()}t.beginPath(),t.moveTo(e,r),t.lineTo(e-u,r),t.lineTo(e-u,r+25*this.components.length),t.lineTo(e,r+25*this.components.length),t.strokeStyle="#ccc",t.stroke(),t.closePath()}var s,l;super.postrender(t)}contains(t,e){var r=super.contains(t,e);if(this.app.isViewMode)return r;var{left:n,top:i,width:a}=this.bounds;return r=r||t<Math.max(n-u,n)&&t>Math.min(n-u,n)&&e<Math.max(i+25*this.size(),i)&&e>Math.min(i+25*this.size(),i),this._focused=!!r,this.invalidate(),r}onchange(t){"activeIndex"in t&&(this.layoutConfig=s(s({},this.layoutConfig),{},{activeIndex:t.activeIndex}))}onmouseup(t){var e=this.__down_point;if(delete this.__down_point,e&&e.x==t.offsetX&&e.y==t.offsetY){var r=this.transcoordC2S(t.offsetX,t.offsetY),{left:n,top:i}=this.state,a=r.x-n,o=r.y-i;a>0||(o/=25,o=Math.floor(o),this.layoutConfig||(this.layoutConfig={}),o>=this.components.length||this.set("activeIndex",o))}}onmousedown(t){this.__down_point={x:t.offsetX,y:t.offsetY}}addFloor(){var t=(255-20*(this.components.length+1)%255).toString(16),e=n.Model.compile({type:"floor",fillStyle:"#".concat(t).concat(t).concat(t),top:0,left:0,width:100,height:100});this.addComponent(e),this.set("activeIndex",this.components.length-1)}}n.Component.register("indoor-map",d);var h={mutable:!1,resizable:!0,rotatable:!0,properties:[{type:"number",label:"depth",name:"depth",property:"depth"},{type:"number",label:"shelves",name:"shelves",property:"shelves"},{type:"string",label:"location-pattern",name:"locPattern",placeholder:"{z}{s}-{u}-{sh}",property:"locPattern"},{type:"string",label:"zone",name:"zone",property:"zone"},{type:"string",label:"section",name:"section",property:"section"},{type:"string",label:"unit",name:"unit",property:"unit"},{type:"string",label:"shelf-pattern",name:"shelfPattern",placeholder:"#",property:"shelfPattern"}],help:"scene/component/rack"};class f extends((0,n.RectPath)(n.Component)){is3dish(){return!0}draw(t){var{left:e,top:r,width:n,height:i,strokeStyle:a,lineWidth:o,fillStyle:s,alpha:l=1}=this.state;t.beginPath(),t.rect(e,r,n,i),t.strokeStyle=a,t.lineWidth=o,t.globalAlpha=.4*l,t.stroke(),t.beginPath(),t.rect(e+.15*n,r+.15*i,.7*n,.7*i),t.fillStyle=s,t.globalAlpha=.5*l,t.fill(),t.beginPath(),t.moveTo(e,r),t.lineTo(e+n,r+i),t.moveTo(e,r+i),t.lineTo(e+n,r),t.strokeStyle=a,t.lineWidth=o,t.globalAlpha=.4*l,t.stroke()}get nature(){return h}get hasTextProperty(){return!1}}n.Component.register("rack",f)},25551:(t,e,r)=>{"use strict";var n,i,a,o=r(171),s=r(94430),l=r(56765);function u(t,e){return e||(e=t.slice(0)),Object.freeze(Object.defineProperties(t,{raw:{value:Object.freeze(e)}}))}var c,d,h,f=class extends s.oi{constructor(){super(...arguments),this.isReverse=!1,this.duration=3e4,this.textData=""}get currentAnimation(){return this._anim}set currentAnimation(t){this._anim=t}get textLines(){return this.textData.split("\n")}render(){return(0,s.dy)(n||(n=u(['\n <div class="ticker-wrap">\n <div class="ticker">',"</div>\n </div>\n "])),this.textLines.map((t=>(0,s.dy)(i||(i=u([' <div class="ticker__item">',"</div> "])),t))))}updated(t){(t.has("textData")||t.has("duration")||t.has("isReverse")||t.has("isTextOverflowed"))&&(this.style.setProperty("--ox-news-ticker-wrapper-padding-left",this.isTextOverflowed?"100%":"0"),this.style.setProperty("--ox-news-ticker-container-padding-right",this.isTextOverflowed?"100%":"0"),this.startAnimation())}startAnimation(){this.stopAnimation(),this.isTextOverflowed&&(this.currentAnimation=this.animationTargetEl.animate([{transform:"translate3d(0, 0, 0)",visibility:"hidden"},{transform:"translate3d(-100%, 0, 0)",visibility:"visible"}],{duration:this.duration,iterations:1/0,direction:this.isReverse?"reverse":"normal"}))}stopAnimation(){this.currentAnimation&&this.currentAnimation.cancel()}};function p(t,e){return e||(e=t.slice(0)),Object.freeze(Object.defineProperties(t,{raw:{value:Object.freeze(e)}}))}f.styles=[(0,s.iv)(a||(a=u(["\n :host * {\n box-sizing: border-box;\n }\n\n :host .ticker-wrap {\n position: absolute;\n bottom: 0;\n width: 100%;\n overflow: hidden;\n height: 100%;\n background-color: rgba(#000, 0.9);\n padding-left: var(--ox-news-ticker-wrapper-padding-left);\n box-sizing: content-box;\n font-family: var(--ox-news-ticker-font-family);\n }\n\n :host .ticker-wrap .ticker {\n display: inline-block;\n min-width: 100%;\n text-align: var(--ox-news-ticker-text-align);\n height: 4rem;\n line-height: 4rem;\n white-space: nowrap;\n padding-right: var(--ox-news-ticker-container-padding-right);\n box-sizing: content-box;\n }\n\n :host .ticker-wrap .ticker__item {\n display: inline-block;\n font-size: var(--ox-news-ticker-font-size);\n color: var(--ox-news-ticker-font-color);\n }\n\n :host body {\n padding-bottom: 5rem;\n }\n :host h1,\n :host h2,\n :host p {\n padding: 0 5%;\n }\n "])))],(0,o.gn)([(0,l.Cb)({type:Boolean})],f.prototype,"isReverse",void 0),(0,o.gn)([(0,l.Cb)({type:Boolean})],f.prototype,"isTextOverflowed",void 0),(0,o.gn)([(0,l.Cb)({type:Number})],f.prototype,"duration",void 0),(0,o.gn)([(0,l.Cb)({type:String})],f.prototype,"textData",void 0),(0,o.gn)([(0,l.IO)(".ticker-wrap .ticker")],f.prototype,"animationTargetEl",void 0),f=(0,o.gn)([(0,l.Mo)("ox-news-ticker-horizontal")],f),r(72866);var g,v,m,y="cubic-bezier(1, 0, 0.5, 0)",b=class extends s.oi{constructor(){super(...arguments),this.isReverse=!1,this.duration=3e4,this.textData=""}get currentAnimation(){return this._anim}set currentAnimation(t){this._anim=t}get textLines(){return this.textData.split("\n")}render(){return(0,s.dy)(c||(c=p(['\n <div id="news_ticker">\n <ul>\n ',"\n </ul>\n </div>\n "])),this.textLines.map((t=>(0,s.dy)(d||(d=p([' <li><a href="#">',"</a></li> "])),t))))}updated(t){(t.has("textData")||t.has("duration")||t.has("isReverse"))&&this.startAnimation()}startAnimation(){this.stopAnimation();var t=this.createAnimationFrames();this.currentAnimation=this.animationTargetEl.animate(t,{duration:this.textLines.length*this.duration,iterations:1/0,direction:this.isReverse?"reverse":"normal"})}stopAnimation(){this.currentAnimation&&this.currentAnimation.cancel()}createAnimationFrames(){var t=this.textLines.length,e=this.textLines.map(((e,r)=>({transform:"translateY(".concat(-r/t*100,"%)"),offset:1/t*r,easing:y})));return e.push({transform:"translateY(0)",offset:1,easing:y}),e}};function E(t,e){return e||(e=t.slice(0)),Object.freeze(Object.defineProperties(t,{raw:{value:Object.freeze(e)}}))}b.styles=[(0,s.iv)(h||(h=p(["\n :host {\n display: block;\n overflow: hidden;\n height: 100%;\n width: 100%;\n box-sizing: border-box;\n }\n\n ul {\n margin: 0;\n padding: 0;\n list-style: none;\n white-space: nowrap;\n }\n\n #news_ticker {\n width: 100%;\n height: 100%;\n overflow: hidden;\n position: relative;\n }\n\n li {\n display: flex;\n height: 100%;\n align-items: center;\n overflow: hidden;\n text-align: var(--ox-news-ticker-text-align, left);\n }\n\n #news_ticker a {\n width: 100%;\n line-height: normal;\n color: var(--ox-news-ticker-font-color, black);\n text-decoration: none;\n font-size: var(--ox-news-ticker-font-size, 13px);\n }\n "])))],(0,o.gn)([(0,l.Cb)({type:Boolean})],b.prototype,"isReverse",void 0),(0,o.gn)([(0,l.Cb)({type:Number})],b.prototype,"duration",void 0),(0,o.gn)([(0,l.Cb)({type:String})],b.prototype,"textData",void 0),(0,o.gn)([(0,l.IO)("#news_ticker > ul")],b.prototype,"animationTargetEl",void 0),b=(0,o.gn)([(0,l.Mo)("ox-news-ticker-vertical")],b);var x=class extends s.oi{constructor(){super(...arguments),this.textData="",this.fontFamily="",this.fontColor="",this.fontSize="",this.textAlign="",this.isReverse=!1,this.isTextOverflowed=!1,this.duration=3e4}render(){return(0,s.dy)(g||(g=E(["\n ","\n "])),"vertical"==this.direction?(0,s.dy)(v||(v=E(["\n <ox-news-ticker-vertical\n .duration=","\n .isReverse=","\n .isTextOverflowed=","\n .textData=","\n ></ox-news-ticker-vertical>\n "])),this.duration,this.isReverse,this.isTextOverflowed,this.textData):(0,s.dy)(m||(m=E(["\n <ox-news-ticker-horizontal\n .duration=","\n .isReverse=","\n .isTextOverflowed=","\n .textData=","\n ></ox-news-ticker-horizontal>\n "])),this.duration,this.isReverse,this.isTextOverflowed,this.textData))}updated(){this.style.setProperty("--ox-news-ticker-font-family",this.fontFamily),this.style.setProperty("--ox-news-ticker-font-size",this.fontSize),this.style.setProperty("--ox-news-ticker-font-color",this.fontColor),this.style.setProperty("--ox-news-ticker-text-align",this.textAlign)}};(0,o.gn)([(0,l.Cb)({type:String})],x.prototype,"textData",void 0),(0,o.gn)([(0,l.Cb)({type:String})],x.prototype,"fontFamily",void 0),(0,o.gn)([(0,l.Cb)({type:String})],x.prototype,"fontColor",void 0),(0,o.gn)([(0,l.Cb)({type:String})],x.prototype,"fontSize",void 0),(0,o.gn)([(0,l.Cb)({type:String})],x.prototype,"textAlign",void 0),(0,o.gn)([(0,l.Cb)({type:Boolean})],x.prototype,"isReverse",void 0),(0,o.gn)([(0,l.Cb)({type:Boolean})],x.prototype,"isTextOverflowed",void 0),(0,o.gn)([(0,l.Cb)({type:String})],x.prototype,"direction",void 0),(0,o.gn)([(0,l.Cb)({type:Number})],x.prototype,"duration",void 0),x=(0,o.gn)([(0,l.Mo)("ox-news-ticker")],x);var S=r(83305),T={mutable:!1,resizable:!0,rotatable:!0,properties:[{type:"select",label:"direction",name:"direction",property:{options:[{display:"horizontal",value:"horizontal"},{display:"vertical",value:"vertical"}]}},{type:"checkbox",label:"reverse",name:"reverse"},{type:"number",label:"duration",name:"duration",placeholder:"seconds"}],help:"scene/component/news-ticker"};class w extends S.HTMLOverlayElement{get nature(){return T}get hasTextProperty(){return!0}get tagName(){return"ox-news-ticker"}createElement(){super.createElement(),this.setState("text","#{data}"),this.element.style.overflow="hidden"}setElementProperties(t){try{var{direction:e="horizontal",reverse:r,textAlign:n,fontColor:i="black",fontSize:a=13,font:o,duration:s=30}=this.state,l=this.text,u=r,c=this.isTextOverflowed,d=t;d.direction=e,d.duration=1e3*s,d.fontColor=i,d.fontFamily=o,d.fontSize="".concat(a,"px"),d.textAlign=n,d.isReverse=u,d.isTextOverflowed=c,d.textData=l}catch(t){(0,S.error)(t)}}get isTextOverflowed(){var{width:t}=this.bounds,e=document.createElement("span");e.style.font=this.font,e.style.position="fixed",e.style.left="-100%",e.style.visibility="none",e.textContent=this.text,document.body.appendChild(e);var r=t<e.getBoundingClientRect().width;return document.body.removeChild(e),r}}S.Component.register("news-ticker",w)},56852:(t,e,r)=>{"use strict";var n=r(83305),i={mutable:!1,resizable:!0,rotatable:!0,properties:[{type:"string",label:"value",name:"value"},{type:"number",label:"start-angle",name:"startAngle"},{type:"number",label:"end-angle",name:"endAngle"},{type:"color",label:"blank-stroke-style",name:"blankStrokeStyle"},{type:"checkbox",label:"packman-style",name:"packmanStyle"},{type:"checkbox",label:"anim-from-base",name:"animFromBase"}],help:"scene/component/progress-circle"};class a extends((0,n.ValueHolder)(n.Ellipse)){_draw(t){var{startAngle:e=0,endAngle:r=360,lineWidth:n=20,blankStrokeStyle:i,cx:a,cy:o,rx:s,ry:l,packmanStyle:u=!1,animFromBase:c=!1}=this.state;this.animOnValueChange(this.value,c,0);var d=.0174533/Math.PI;t.beginPath(),this.drawStroke(t);var h=(e-90)*d*Math.PI,f=(r-90)*d*Math.PI;t.strokeStyle=i,t.ellipse(a,o,Math.abs(s),Math.abs(l),0,h,f),t.lineWidth=n,t.stroke();var p=Math.min(Math.max(this.animValue/100,0),100);t.beginPath(),u?(t.ellipse(a,o,Math.abs(s),Math.abs(l),0,h,h+(f-h)*p),t.lineTo(a,o)):t.ellipse(a,o,Math.abs(s),Math.abs(l),0,h,f),this.drawFill(t),t.closePath(),t.beginPath(),t.ellipse(a,o,Math.abs(s),Math.abs(l),0,h,h+(f-h)*p),this.drawStroke(t)}_post_draw(t){this.drawText(t)}get nature(){return i}}n.Component.register("progress-circle",a);var o={mutable:!1,resizable:!0,rotatable:!0,properties:[{type:"string",label:"value",name:"value",property:"value"},{type:"color",label:"background-color",name:"backgroundColor",property:"backgroundColor"},{type:"checkbox",label:"anim-from-base",name:"animFromBase"}],help:"scene/component/progress-vertical"};class s extends((0,n.ValueHolder)((0,n.RectPath)(n.Shape))){_draw(t){var{top:e,left:r,height:n,width:i,backgroundColor:a="transparent",animFromBase:o=!1}=this.state;this.animOnValueChange(this.value,o,0),t.beginPath(),t.rect(r,e,i,n),t.fillStyle=a,t.fill(),t.beginPath();var s=n-n*Math.max(Math.min(this.animValue,100),0)/100;s=Math.max(Math.min(s,n),0),t.rect(r,e+s,i,n-s),this.drawFill(t),t.closePath(),t.beginPath(),t.rect(r,e,i,n)}_post_draw(t){this.drawStroke(t),this.drawText(t)}get nature(){return o}}n.Component.register("progress-vertical",s);var l={mutable:!1,resizable:!0,rotatable:!0,properties:[{type:"string",label:"value",name:"value",property:"value"},{type:"color",label:"background-color",name:"backgroundColor",property:"backgroundColor"},{type:"checkbox",label:"reverse",name:"reverse",property:"reverse"},{type:"checkbox",label:"anim-from-base",name:"animFromBase"}],help:"scene/component/progress-horizontal"};class u extends((0,n.ValueHolder)((0,n.RectPath)(n.Shape))){_draw(t){var{top:e,left:r,height:n,width:i,backgroundColor:a="transparent",reverse:o,animFromBase:s=!1}=this.state;this.animOnValueChange(this.value,s,0),t.beginPath(),t.rect(r,e,i,n),t.fillStyle=a,t.fill(),t.beginPath();var l=i-i*Math.max(Math.min(this.animValue,100),0)/100;l=Math.max(Math.min(l,i),0),o?t.rect(r,e,i-l,n):t.rect(r+l,e,i-l,n),this.drawFill(t),t.closePath(),t.beginPath(),t.rect(r,e,i,n)}_post_draw(t){this.drawStroke(t),this.drawText(t)}get nature(){return l}}n.Component.register("progress-horizontal",u)},99358:(t,e,r)=>{"use strict";var n=r(83305),i={mutable:!1,resizable:!0,rotatable:!0,properties:[{type:"select",label:"format",name:"format",property:{options:["bool,character,floating,integer,letter,natural,string","paragraph,sentence,syllable,word","age,birthday,cf,cpf,first,gender,last,name,prefix,ssn,suffix","android_id,apple_token,bb_pin,wp7_anid,wp8_anid2,avatar,color","company,domain,email,fbid,google_analytics,hashtag,ip,ipv6,klout,profession,tld,twitter,url","address,altitude,areacode,city,coordinates,country,depth,geohash,latitude,longitude,phone,postal,province,state,street,zip","ampm,date,hammertime,hour,millisecond,minute,month,second,timestamp,timezone,weekday,year","cc,cc_type,currency,currency_pair,dollar,euro,exp,exp_month,exp_year","coin,d4,d6,d8,d10,d12,d20,d30,d100,guid,hash"].join(",").split(",").map((t=>({display:t,value:t})))}},{type:"number",label:"count",name:"count",placeholder:"1"},{type:"number",label:"period",name:"period",placeholder:"milli-seconds"}],help:"scene/component/random"};class a extends((0,n.RectPath)(n.Shape)){static get image(){return a._image||(a._image=new Image,a._image.src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAMgAAADICAMAAACahl6sAAAAtFBMVEUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABSe1G2AAAAO3RSTlMAA/sG7vXcIvjy4tLm14YJzWlkbhK6pX8aDwyqSTPJxZtEQBbAOyqRjHlNciYe6a51WrWWUjcun7JfVn5FXzIAAAjjSURBVHja7NrXdtpAGATgkUQTvdn0DjbV2In7vP975SLIlrIFLevEcKLvWseAhWbn3wWJRCKRSCQSiUQikUgkEolEIpFI/C/ajX0plSrtGztcskHP5YG7v8GlmswZ5q4cXCDnvco/XV/eJ6nUMpR4wWXprO4oV8cFaS99qqSauBTbsUuNMi7D0556fgcXoD/nUfc4d85DgTHcVXDWJHl7icHVFPJWLXO+q2J7maaBd5ynmxeXRqo4R9q8zWUKmRwFE5wdXd4WywMPgDcoFxl1hfOizVt/4yHgNXxGDHBGKo0M1QpZhGWjH7mHs9FsafO22kRUp8oQd4vzsLtNU6fYFiO6yJAxzsHxvF1DtI7EWRvfbvHKY+aQmZ9Vm+/PedwjcOyWpBx8Iy9ev/U9yHg+Py3xfbqNPGO5gtwVP7htfJdmK8WYbiF3q9hNWSxHxbRf6tWbsGCdt6IW5Fr8cIMPjwUGcuMtbNn32+OJVGbgBwLNPSNeF7Bgkbcmu3BjBqY4aJf4p9Gjg7/AWY9oqgq5qnBBp0SJTK2Cr7Yu8AQzyMzEEbFHubtWE1+pe82T3ENmIwztfSqlf2bxZWYFnqZYgahS5EEDB0NquL0BvkalylOVdZmV6uK3KY+Y9x3A3k+eri+WNPFT/uBRpTcPtp4o41/Xn7LZRb2Xpk56iqjpx/W5IApuGEfxvgM7PyhK3Xc/t+R8argNB5+chivOVC+Mx1/uYKFN0VUkV3cj6gwnCEzCV26DF3AZl3v9jJPVKBg7iPD21Mrcvj89P70vMwzZCw9/LFcTGFLf+FchQrwRjS2CNSpFM9UHD6eYC09dE4KdT0Ojz+VRUBzOqz7V8psuzAmLyBsk7qmkn4K9PKOG9fbvLGvlqZQqt2FqxKi8A4muTyOl4K88MCLTxwevkaZSbnwDM714Q8aYRuo4KDBs30XYtkSN1ylMrBg1hdQ7A0bHbhP9DyJmJeoMTUaWAaOakNrSxEqyD0EOxTjK+hSYjizym+9CrkMD6eC/8Xx0I7jOI1KtGeJ5Y1gOcl0auMXBNUN+QsIp8ZjcsZFFHpAVSGUZnxu88M5lyFbXLPT2T4hhE+dsps/4ejhYMqQAqRljGa0d6IglYgOpMuMbBM+VH2c7L8N4SvUKBJo3OYSMk2Fsc3myNwzGCLm7VRNas1y07Uk8njA1ekVt9RED4bj0bTb+sDt0IKiUGFtBkax1XbUwGFkGUMu6DGnZjfVvimBtKcueoas+lK71X4IN4yt6H+c9UXtIOT6NFR4cyD0zYhW5zluetGk3j3cstOApCoN40TEKXbeo0oDfUW7OPFjUaoFbh9RU+CLWswCcbW1EI0v1M1xwNI+nuRqkhhTk8vkcDbk7zRvcWKwiIncK5UJh70WXc+5CMw2Zy1eULdResC/VTFPCXyCqQRsrwHwwMDznbVEqV3PwqTumlaKjaPP2JkETuKPCsO8E19SKtDRVtHlr1ThDRn5c60/Xm55Pay1Vm7f1YNSV7fVUbd5S3jGKQHtzZZu30zDrgfZGX3t0JRy1LfiPvGrbvP2B4iv/kaW6zVvItQ338uytofBMC2PDPmvP/9XenSglDwMBAN4eQG25tYUiVgoIDodcgmDe/73+cQYtNW2SbTpY5s/3AM7ASHazu902II1LsptkOTOq28HOa+okkymkGubww6sjSgnn1Mw/NUkEWQdkZ/PXaLV5I4hs3jKHw3yz+QCb0OotiFk6BOkJaHQ2n7XVptm4YkvkwZEP6/LZfJlqteFDQOUOOT3CZFQJg9U8rlybdYFuCn7wBtDukV1KtjXj19VvwJflusxutfGdpK9EJ+DwTZJsPElvyHaQtQTT4PYz+XXACCqbr2twaVFmtNq4PEg0wdQBuUaW0EW/W05oqn3I1aS0O0QdkG8n9hVOSlSI7eqSJ44jl/fys/k3H2hzRquN40WyMq8vQYRH3/2Yh8yearXxhMzBGD4v2wwBKfmsGfgxfvKmDclMVB2QzyVxR+YhM8OHgZ1cD9wFQUPBs86MhdgTrt4iEdpDEBVQGWGiJjUIJJUoaU7uzwC/i30D7mWI7ROEQJOYQNqAMK0mdMl/voyUY2QNjPJQJUJsA8S1RQIx2BfZyZNsm8Zws30HmGx+kD5GMo1abTilEGJ6W0QdEGHNb0TAiWq1YegdAyJPNUQdEMM3+bnR+CLETgleud37/hgetg4YkZ+0GVKtNjTLfZ3fd7wytg4YwWbzreT5FBfbJZI3kXusxNpTJ7R3GWACciVHoOCyeXMPMdrgKzvBjm7KewEc+kC1Yg+KLMexa+OeXEkAFHw23/wZJ17WS/Fa34xcyTtk4VKx6HG9+Wy/ft/jdOMqH0R+i8+Q92eRs0ryWpBNIJpOj4i8u239vtV5fJPedIWvzTvwo0YkNT+N83EYblEDAvhsnmbn1qMvtTWIhDZn5B6vTZh6ANHwuITqAWJGAeKmj8rm+UMtryQ7cwERxmPjFchuLVrv65Vz7TIvSsxWG55vipbEJybJ6FGwML8HGR3mrHoDIodqnvlsw6RbbVJ6tvBTQ91jnpMxU/ofUE6op5z7GlD6z7mtKYCQbrVJamOeqH1Z5TTPB37+Wx83Folj7jZYDCyCUoFkd9S5Im3yTAhiy8yobhKELiSr0h0zeeHKOv/CO12hNUqIqLKAZCVEdoLQ2G9arVkFvSibry/yENkU/s5wK7VKaYZqtcmT36nkCCwM8ECa/NZsfGGErvgd4M/5azvTmM+0eKtEjZODv4m/6IVc7tp3kb2Sylv8V1QcT55O0pVmEHOwf7XaiqTC3G439eGHMbd+t9qKhblP2+xUzoGQygrmUDiNdo2ks4+DwaqW1GoroJRVdzf5boP9ivAVYvcm12JnkUS39yaTkfie0aK/8Kcn+GaDLRSe9hkI3ehvAf/KEsCNmHzoN/l6hgRdVqnCKe4LMxL4czv9znVb0nZwd+D2hC75UpjSSY5XFr2AWW+WhdxuAQoO2fmtrUkI0Z3XQr3wI5uHSvemDl1FURRFURRFURRFURRF+a/9A+ihoIIrt6BYAAAAAElFTkSuQmCC"),a._image}ready(){super.ready(),n.ScriptLoader.load(["https://chancejs.com/chance.min.js"]).then((()=>{this.app&&this.app.isViewMode&&this._initRandom()}),n.error)}dispose(){super.dispose(),this._stopRepeater()}random(){var{format:t,count:e=1}=this.state;t&&e&&(this.data=chance.n(chance[t],e))}_initRandom(){this._stopRepeater(),this._startRepeater()}_startRepeater(){var{period:t}=this.state;t=Number(t);var e=!0;t&&(this.repeatTimer=setInterval((()=>{e&&this.repeatTimer&&requestAnimationFrame((()=>{e=!0,this.random()})),e=!1}),t)),this.random()}_stopRepeater(){this.repeatTimer&&clearTimeout(this.repeatTimer),delete this.repeatTimer}_draw(t){var{left:e,top:r,width:n,height:i}=this.bounds;t.beginPath(),this.drawImage(t,a.image,e,r,n,i)}ondblclick(t){this.random()}get hasTextProperty(){return!1}get controls(){return[]}get nature(){return i}}n.Component.register("random",a)},30396:(t,e,r)=>{"use strict";var n,i,a=r(171),o=r(94430),s=r(56765);function l(t,e){return e||(e=t.slice(0)),Object.freeze(Object.defineProperties(t,{raw:{value:Object.freeze(e)}}))}var u=class extends o.oi{constructor(){super(...arguments),this.round=!1,this.value=!1}render(){return(0,o.dy)(n||(n=l(['\n <label>\n <input type="checkbox" .checked='," />\n <span ?round=","></span>\n </label>\n "])),this.value,this.round)}firstUpdated(){this.renderRoot.addEventListener("change",(t=>{var e;this.value=null===(e=t.target)||void 0===e?void 0:e.checked,this.dispatchEvent(new CustomEvent("value-change",{detail:this.value}))}))}};u.styles=(0,o.iv)(i||(i=l(["\n /* The switch - the box around the slider */\n label {\n position: relative;\n display: inline-block;\n width: 100%;\n height: 100%;\n }\n\n /* Hide default HTML checkbox */\n label input {\n opacity: 0;\n width: 0;\n height: 0;\n }\n\n /* The slider */\n span {\n position: absolute;\n cursor: pointer;\n width: var(--ox-simple-switch-fullwidth);\n height: var(--ox-simple-switch-fullheight);\n top: calc(0 - var(--ox-simple-switch-thumbnail-size));\n left: 0;\n background-color: var(--ox-simple-switch-off-color, #ccc);\n -webkit-transition: 0.4s;\n transition: 0.4s;\n }\n\n span:before {\n position: absolute;\n content: '';\n height: calc(var(--ox-simple-switch-thumbnail-size) - 8px);\n width: calc(var(--ox-simple-switch-thumbnail-size) - 8px);\n left: 4px;\n top: 4px;\n background-color: var(--ox-simple-switch-thumbnail-color, white);\n -webkit-transition: 0.4s;\n transition: 0.4s;\n }\n\n input:checked + span {\n background-color: var(--ox-simple-switch-on-color, #2196f3);\n }\n\n input:checked + span:before {\n -webkit-transform: translateX(calc(var(--ox-simple-switch-fullwidth) - var(--ox-simple-switch-thumbnail-size)))\n translateY(calc(var(--ox-simple-switch-fullheight) - var(--ox-simple-switch-thumbnail-size)));\n -ms-transform: translateX(calc(var(--ox-simple-switch-fullwidth) - var(--ox-simple-switch-thumbnail-size)))\n translateY(calc(var(--ox-simple-switch-fullheight) - var(--ox-simple-switch-thumbnail-size)));\n transform: translateX(calc(var(--ox-simple-switch-fullwidth) - var(--ox-simple-switch-thumbnail-size)))\n translateY(calc(var(--ox-simple-switch-fullheight) - var(--ox-simple-switch-thumbnail-size)));\n }\n\n /* Rounded sliders */\n span[round] {\n border-radius: calc(var(--ox-simple-switch-thumbnail-size) / 2);\n }\n\n span[round]:before {\n border-radius: calc((var(--ox-simple-switch-thumbnail-size) - 8px) / 2);\n }\n "]))),(0,a.gn)([(0,s.Cb)({type:Boolean})],u.prototype,"round",void 0),(0,a.gn)([(0,s.Cb)({type:Boolean})],u.prototype,"value",void 0),u=(0,a.gn)([(0,s.Mo)("ox-simple-switch")],u);var c=r(83305),d={mutable:!1,resizable:!0,rotatable:!0,properties:[{type:"checkbox",label:"round",name:"round"},{type:"checkbox",label:"on/off",name:"data"},{type:"color",label:"on-color",name:"onColor"},{type:"color",label:"off-color",name:"offColor"},{type:"color",label:"thumbnail-color",name:"thumbnailColor"}],"value-property":"data",help:"scene/component/simple-switch"};class h extends c.HTMLOverlayElement{get nature(){return d}oncreate_element(t){t.addEventListener("value-change",(t=>{var e=t.detail;this.setState({data:e})}))}dispose(){super.dispose()}setElementProperties(t){var{round:e,data:r,onColor:n,offColor:i,thumbnailColor:a}=this.state;t.round=e,t.value="true"==String(r),n&&t.style.setProperty("--ox-simple-switch-on-color",n),i&&t.style.setProperty("--ox-simple-switch-off-color",i),a&&t.style.setProperty("--ox-simple-switch-thumbnail-color",a)}reposition(){super.reposition();var t=this.element;if(t){var{height:e,width:r}=this.bounds;t.style.setProperty("--ox-simple-switch-fullwidth","".concat(r,"px")),t.style.setProperty("--ox-simple-switch-fullheight","".concat(e,"px")),t.style.setProperty("--ox-simple-switch-thumbnail-size","".concat(Math.min(e,r),"px"))}}get tagName(){return"ox-simple-switch"}}c.Component.register("simple-switch",h)},78108:(t,e,r)=>{"use strict";var n=r(83305),i={mutable:!1,resizable:!0,rotatable:!0,properties:[{type:"action",label:"remove",name:"remove",property:{icon:"remove_circle",action:function(t){var e=t.parent;e.removeComponent(t),e.set("activeIndex",0)}}}]};class a extends n.Container{get hasTextProperty(){return!1}get showMoveHandle(){return!1}get mutable(){return!1}get resizable(){return!1}get rotatable(){return!1}get nature(){return i}}function o(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function s(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?o(Object(r),!0).forEach((function(e){l(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):o(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function l(t,e,r){return(e=function(t){var e=function(t,e){if("object"!=typeof t||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==typeof e?e:String(e)}(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}n.Component.register("tab-card",a);var u=25,c={mutable:!1,resizable:!0,rotatable:!0,properties:[{type:"action",label:"add-card",name:"addCard",property:{icon:"add_circle",action:t=>{t.addCard()}}},{type:"number",label:"active index",name:"activeIndex"}],"value-property":"activeIndex",help:"scene/component/tab-container"};class d extends n.Container{constructor(){super(...arguments),this._focused=!1}get nature(){return c}get layout(){return n.CardLayout}get layoutConfig(){return this.get("layoutConfig")}set layoutConfig(t){this.set("layoutConfig",t)}get activeCard(){return this.components[this.get("layoutConfig").activeIndex]}get activeIndex(){return this.get("activeIndex")}set activeIndex(t){this.set("activeIndex",Number(t))}ready(){super.ready(),0==this.components.length&&this.addCard()}postrender(t){if(!this.app.isViewMode&&this._focused){for(var{left:e,top:r,width:n,fillStyle:i}=this.state,a=0;a<this.components.length;a++){t.beginPath(),t.rect(e-u,r+25*a,u,25);var o=255-20*(a+1)%255;t.fillStyle=(s=o,l=o,1,"rgba(".concat(o,", ").concat(s,", ").concat(l,", ").concat(1,")")),t.fill(),t.closePath()}t.beginPath(),t.moveTo(e,r),t.lineTo(e-u,r),t.lineTo(e-u,r+25*this.components.length),t.lineTo(e,r+25*this.components.length),t.strokeStyle="#ccc",t.stroke(),t.closePath()}var s,l;super.postrender(t)}contains(t,e){var r=super.contains(t,e);if(this.app.isViewMode)return r;var{left:n,top:i,width:a}=this.bounds;return r=r||t<Math.max(n-u,n)&&t>Math.min(n-u,n)&&e<Math.max(i+25*this.size(),i)&&e>Math.min(i+25*this.size(),i),this._focused=!!r,this.invalidate(),r}onchange(t){"activeIndex"in t&&(this.layoutConfig=s(s({},this.layoutConfig),{},{activeIndex:t.activeIndex}))}onmouseup(t){var e=this.__down_point;if(delete this.__down_point,e&&e.x==t.offsetX&&e.y==t.offsetY){var r=this.transcoordC2S(t.offsetX,t.offsetY),{left:n,top:i}=this.state,a=r.x-n,o=r.y-i;a>0||(o/=25,o=Math.floor(o),this.layoutConfig||(this.layoutConfig={}),o>=this.components.length||this.set("activeIndex",o))}}onmousedown(t){this.__down_point={x:t.offsetX,y:t.offsetY}}addCard(){var t=(255-20*(this.components.length+1)%255).toString(16),e=n.Model.compile({type:"tab-card",fillStyle:"#".concat(t).concat(t).concat(t),top:0,left:0,width:100,height:100});this.addComponent(e),this.set("activeIndex",this.components.length-1)}}n.Component.register("tab-container",d);var h={mutable:!1,resizable:!0,rotatable:!0,properties:[{type:"id-input",label:"tab-reference",name:"reference",property:{component:t=>["tab-container","indoor-map"].includes(t.model.type)}},{type:"number",label:"tab-active-index",name:"activeIndex",property:{min:0,step:1}},{type:"color",label:"active-fill-style",name:"activeFillStyle",property:"activeFillStyle"},{type:"color",label:"active-font-color",name:"activeFontColor",property:"activeFontColor"},{type:"color",label:"active-line-color",name:"activeLineColor",property:"activeLineColor"},{type:"number",label:"active-line-width",name:"activeLineWidth",property:"activeLineWidth"}]};class f extends n.Container{get layout(){var{width:t,height:e}=this.state;return t>=e?n.LinearHorizontalLayout:n.LinearVerticalLayout}get nature(){return h}get focusible(){return!1}get reference(){var{reference:t}=this.state;return t?(this._reference||(this._reference=this.root.findById(t),this._reference&&this._reference.on("change",this.onRefChanged,this)),this._reference):null}get labelHeight(){var t=this.reference.components.length,{height:e}=this.state;return t>0&&e/t||e}get activeIndex(){return this.get("activeIndex")}set reference(t){this.reference&&this.reference.off("change",this.onRefChanged,this),this._reference=null,this.model.reference=t}set activeIndex(t){this.set("activeIndex",t),this.reference&&(this.reference.activeIndex=t)}render(t){if(super.render(t),this.reference)this.size()!==this.reference.size()&&this.rebuildTabButtons();else for(var e=this.components.length-1;e>=0;e--){var r=this.components[e];this.removeComponent(r)}}postrender(t){super.postrender(t);var{left:e,top:r,width:n,fillStyle:i}=this.state;t.beginPath(),t.rect(e+n,r,25,25),t.fillStyle=(235,235,1,"rgba(".concat(235,", ").concat(235,", ").concat(235,", ").concat(1,")")),t.fill(),t.closePath()}contains(t,e){if(!this.app.isEditMode)return super.contains(t,e);if(super.contains(t,e))return!0;var{left:r,top:n,width:i}=this.bounds,a=r+i;return t<Math.max(a+25,a)&&t>Math.min(a+25,a)&&e<Math.max(n+25,n)&&e>Math.min(n+25,n)}dispose(){this.reference&&this.reference.off("change",this.onRefChanged,this),super.dispose()}rebuildTabButtons(){for(var{tabIndex:t=0,left:e,top:r,width:i,height:a,fillStyle:o,activeFillStyle:s,activeLineColor:l,activeLineWidth:u,strokeStyle:c,fontColor:d,activeFontColor:h,fontFamily:f,fontSize:p,lineHeight:g,italic:v,bold:m,lineWidth:y=0}=this.state,b=[],E=this.reference.components,x=(this.labelHeight,this.components.length-1);x>=0;x--)this.removeComponent(this.components[x]);for(var S=0;S<E.length;S++)if("tab-card"==E[S].model.type){var T=E[S].text||"";b.push(n.Model.compile({type:"tab-button",index:S,text:T||String(S+1),fillStyle:o||"transparent",activeFillStyle:s,activeLineColor:l,activeLineWidth:u,fontColor:d,activeFontColor:h||d,fontFamily:f,fontSize:p,lineHeight:g,italic:v,bold:m,strokeStyle:c,lineWidth:y,left:0,top:0,width:i,height:a}))}this.add(b),this.reflow(),this.activeIndex=this.state.activeIndex||0}setTabButtonsStyle(t){var e=this.components;for(var r in e)e[r].set(t)}onRefChanged(t,e,r){}onchange(t,e){t.hasOwnProperty("reference")&&(this.reference=t.reference,this.invalidate()),this.setTabButtonsStyle(t)}}n.Component.register("tab",f);class p extends((0,n.RectPath)(n.Component)){get index(){return this.model.index}get activated(){return this.parent.activeIndex===this.index}removed(t){this.dispose()}prerender(t){super.prerender(t);var{fillStyle:e,activeFillStyle:r,activeLineColor:n,activeLineWidth:i,fontColor:a,activeFontColor:o}=this.state;this.hasOwnProperty("_fillStyle")||(this._fillStyle=e),this.hasOwnProperty("_fontColor")||(this._fontColor=a),this.activated?(this.model.fillStyle=r,this.model.fontColor=o,this.model.strokeStyle=n,this.model.lineWidth=i):(this.model.fillStyle=this._fillStyle,this.model.fontColor=this._fontColor,this.model.strokeStyle=this._strokeStyle,this.model.lineWidth=this._lineWidth)}render(t){var{left:e=0,top:r=0,width:n,height:i}=this.bounds;t.beginPath(),t.rect(e,r,n,i),this.drawFill(t),this.drawStroke(t)}postrender(t){super.postrender(t),this.model.fillStyle=this._fillStyle,this.model.fontColor=this._fontColor,this.model.strokeStyle=this._strokeStyle,this.model.lineWidth=this._lineWidth,delete this._fillStyle,delete this._fontColor,delete this._strokeStyle,delete this._lineWidth}onclick(t){this.parent.activeIndex=this.index,this.parent.invalidate()}onchange(t){t.hasOwnProperty("fillStyle")&&(this._fillStyle=t.fillStyle),t.hasOwnProperty("fontColor")&&(this._fontColor=t.fontColor),t.hasOwnProperty("strokeStyle")&&(this._fontColor=t.fontColor),t.hasOwnProperty("lineWidth")&&(this._fontColor=t.fontColor),t.hasOwnProperty("text")&&this.parent.reference.getAt(this.index).set("text",t.text),this.invalidate()}}n.Component.register("tab-button",p)},47103:(t,e,r)=>{"use strict";var n=r(51266),i=r(24104),a=r(87040),o="function"==typeof Symbol&&"function"==typeof Symbol.for?Symbol.for("nodejs.util.inspect.custom"):null;e.Buffer=u,e.SlowBuffer=function(t){return+t!=t&&(t=0),u.alloc(+t)},e.INSPECT_MAX_BYTES=50;var s=2147483647;function l(t){if(t>s)throw new RangeError('The value "'+t+'" is invalid for option "size"');var e=new Uint8Array(t);return Object.setPrototypeOf(e,u.prototype),e}function u(t,e,r){if("number"==typeof t){if("string"==typeof e)throw new TypeError('The "string" argument must be of type string. Received type number');return h(t)}return c(t,e,r)}function c(t,e,r){if("string"==typeof t)return function(t,e){if("string"==typeof e&&""!==e||(e="utf8"),!u.isEncoding(e))throw new TypeError("Unknown encoding: "+e);var r=0|v(t,e),n=l(r),i=n.write(t,e);return i!==r&&(n=n.slice(0,i)),n}(t,e);if(ArrayBuffer.isView(t))return function(t){if(G(t,Uint8Array)){var e=new Uint8Array(t);return p(e.buffer,e.byteOffset,e.byteLength)}return f(t)}(t);if(null==t)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof t);if(G(t,ArrayBuffer)||t&&G(t.buffer,ArrayBuffer))return p(t,e,r);if("undefined"!=typeof SharedArrayBuffer&&(G(t,SharedArrayBuffer)||t&&G(t.buffer,SharedArrayBuffer)))return p(t,e,r);if("number"==typeof t)throw new TypeError('The "value" argument must not be of type number. Received type number');var n=t.valueOf&&t.valueOf();if(null!=n&&n!==t)return u.from(n,e,r);var i=function(t){if(u.isBuffer(t)){var e=0|g(t.length),r=l(e);return 0===r.length||t.copy(r,0,0,e),r}return void 0!==t.length?"number"!=typeof t.length||z(t.length)?l(0):f(t):"Buffer"===t.type&&Array.isArray(t.data)?f(t.data):void 0}(t);if(i)return i;if("undefined"!=typeof Symbol&&null!=Symbol.toPrimitive&&"function"==typeof t[Symbol.toPrimitive])return u.from(t[Symbol.toPrimitive]("string"),e,r);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof t)}function d(t){if("number"!=typeof t)throw new TypeError('"size" argument must be of type number');if(t<0)throw new RangeError('The value "'+t+'" is invalid for option "size"')}function h(t){return d(t),l(t<0?0:0|g(t))}function f(t){for(var e=t.length<0?0:0|g(t.length),r=l(e),n=0;n<e;n+=1)r[n]=255&t[n];return r}function p(t,e,r){if(e<0||t.byteLength<e)throw new RangeError('"offset" is outside of buffer bounds');if(t.byteLength<e+(r||0))throw new RangeError('"length" is outside of buffer bounds');var n;return n=void 0===e&&void 0===r?new Uint8Array(t):void 0===r?new Uint8Array(t,e):new Uint8Array(t,e,r),Object.setPrototypeOf(n,u.prototype),n}function g(t){if(t>=s)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+s.toString(16)+" bytes");return 0|t}function v(t,e){if(u.isBuffer(t))return t.length;if(ArrayBuffer.isView(t)||G(t,ArrayBuffer))return t.byteLength;if("string"!=typeof t)throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof t);var r=t.length,n=arguments.length>2&&!0===arguments[2];if(!n&&0===r)return 0;for(var i=!1;;)switch(e){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":return U(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return j(t).length;default:if(i)return n?-1:U(t).length;e=(""+e).toLowerCase(),i=!0}}function m(t,e,r){var n=!1;if((void 0===e||e<0)&&(e=0),e>this.length)return"";if((void 0===r||r>this.length)&&(r=this.length),r<=0)return"";if((r>>>=0)<=(e>>>=0))return"";for(t||(t="utf8");;)switch(t){case"hex":return R(this,e,r);case"utf8":case"utf-8":return k(this,e,r);case"ascii":return D(this,e,r);case"latin1":case"binary":return L(this,e,r);case"base64":return A(this,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return I(this,e,r);default:if(n)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),n=!0}}function y(t,e,r){var n=t[e];t[e]=t[r],t[r]=n}function b(t,e,r,n,i){if(0===t.length)return-1;if("string"==typeof r?(n=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),z(r=+r)&&(r=i?0:t.length-1),r<0&&(r=t.length+r),r>=t.length){if(i)return-1;r=t.length-1}else if(r<0){if(!i)return-1;r=0}if("string"==typeof e&&(e=u.from(e,n)),u.isBuffer(e))return 0===e.length?-1:E(t,e,r,n,i);if("number"==typeof e)return e&=255,"function"==typeof Uint8Array.prototype.indexOf?i?Uint8Array.prototype.indexOf.call(t,e,r):Uint8Array.prototype.lastIndexOf.call(t,e,r):E(t,[e],r,n,i);throw new TypeError("val must be string, number or Buffer")}function E(t,e,r,n,i){var a,o=1,s=t.length,l=e.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(t.length<2||e.length<2)return-1;o=2,s/=2,l/=2,r/=2}function u(t,e){return 1===o?t[e]:t.readUInt16BE(e*o)}if(i){var c=-1;for(a=r;a<s;a++)if(u(t,a)===u(e,-1===c?0:a-c)){if(-1===c&&(c=a),a-c+1===l)return c*o}else-1!==c&&(a-=a-c),c=-1}else for(r+l>s&&(r=s-l),a=r;a>=0;a--){for(var d=!0,h=0;h<l;h++)if(u(t,a+h)!==u(e,h)){d=!1;break}if(d)return a}return-1}function x(t,e,r,n){r=Number(r)||0;var i=t.length-r;n?(n=Number(n))>i&&(n=i):n=i;var a=e.length;n>a/2&&(n=a/2);for(var o=0;o<n;++o){var s=parseInt(e.substr(2*o,2),16);if(z(s))return o;t[r+o]=s}return o}function S(t,e,r,n){return H(U(e,t.length-r),t,r,n)}function T(t,e,r,n){return H(function(t){for(var e=[],r=0;r<t.length;++r)e.push(255&t.charCodeAt(r));return e}(e),t,r,n)}function w(t,e,r,n){return H(j(e),t,r,n)}function _(t,e,r,n){return H(function(t,e){for(var r,n,i,a=[],o=0;o<t.length&&!((e-=2)<0);++o)n=(r=t.charCodeAt(o))>>8,i=r%256,a.push(i),a.push(n);return a}(e,t.length-r),t,r,n)}function A(t,e,r){return 0===e&&r===t.length?i.fromByteArray(t):i.fromByteArray(t.slice(e,r))}function k(t,e,r){r=Math.min(t.length,r);for(var n=[],i=e;i<r;){var a,o,s,l,u=t[i],c=null,d=u>239?4:u>223?3:u>191?2:1;if(i+d<=r)switch(d){case 1:u<128&&(c=u);break;case 2:128==(192&(a=t[i+1]))&&(l=(31&u)<<6|63&a)>127&&(c=l);break;case 3:a=t[i+1],o=t[i+2],128==(192&a)&&128==(192&o)&&(l=(15&u)<<12|(63&a)<<6|63&o)>2047&&(l<55296||l>57343)&&(c=l);break;case 4:a=t[i+1],o=t[i+2],s=t[i+3],128==(192&a)&&128==(192&o)&&128==(192&s)&&(l=(15&u)<<18|(63&a)<<12|(63&o)<<6|63&s)>65535&&l<1114112&&(c=l)}null===c?(c=65533,d=1):c>65535&&(c-=65536,n.push(c>>>10&1023|55296),c=56320|1023&c),n.push(c),i+=d}return function(t){var e=t.length;if(e<=C)return String.fromCharCode.apply(String,t);for(var r="",n=0;n<e;)r+=String.fromCharCode.apply(String,t.slice(n,n+=C));return r}(n)}e.kMaxLength=s,u.TYPED_ARRAY_SUPPORT=function(){try{var t=new Uint8Array(1),e={foo:function(){return 42}};return Object.setPrototypeOf(e,Uint8Array.prototype),Object.setPrototypeOf(t,e),42===t.foo()}catch(t){return!1}}(),u.TYPED_ARRAY_SUPPORT||void 0===n||"function"!=typeof n.error||n.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support."),Object.defineProperty(u.prototype,"parent",{enumerable:!0,get:function(){if(u.isBuffer(this))return this.buffer}}),Object.defineProperty(u.prototype,"offset",{enumerable:!0,get:function(){if(u.isBuffer(this))return this.byteOffset}}),u.poolSize=8192,u.from=function(t,e,r){return c(t,e,r)},Object.setPrototypeOf(u.prototype,Uint8Array.prototype),Object.setPrototypeOf(u,Uint8Array),u.alloc=function(t,e,r){return function(t,e,r){return d(t),t<=0?l(t):void 0!==e?"string"==typeof r?l(t).fill(e,r):l(t).fill(e):l(t)}(t,e,r)},u.allocUnsafe=function(t){return h(t)},u.allocUnsafeSlow=function(t){return h(t)},u.isBuffer=function(t){return null!=t&&!0===t._isBuffer&&t!==u.prototype},u.compare=function(t,e){if(G(t,Uint8Array)&&(t=u.from(t,t.offset,t.byteLength)),G(e,Uint8Array)&&(e=u.from(e,e.offset,e.byteLength)),!u.isBuffer(t)||!u.isBuffer(e))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(t===e)return 0;for(var r=t.length,n=e.length,i=0,a=Math.min(r,n);i<a;++i)if(t[i]!==e[i]){r=t[i],n=e[i];break}return r<n?-1:n<r?1:0},u.isEncoding=function(t){switch(String(t).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},u.concat=function(t,e){if(!Array.isArray(t))throw new TypeError('"list" argument must be an Array of Buffers');if(0===t.length)return u.alloc(0);var r;if(void 0===e)for(e=0,r=0;r<t.length;++r)e+=t[r].length;var n=u.allocUnsafe(e),i=0;for(r=0;r<t.length;++r){var a=t[r];if(G(a,Uint8Array))i+a.length>n.length?u.from(a).copy(n,i):Uint8Array.prototype.set.call(n,a,i);else{if(!u.isBuffer(a))throw new TypeError('"list" argument must be an Array of Buffers');a.copy(n,i)}i+=a.length}return n},u.byteLength=v,u.prototype._isBuffer=!0,u.prototype.swap16=function(){var t=this.length;if(t%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var e=0;e<t;e+=2)y(this,e,e+1);return this},u.prototype.swap32=function(){var t=this.length;if(t%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var e=0;e<t;e+=4)y(this,e,e+3),y(this,e+1,e+2);return this},u.prototype.swap64=function(){var t=this.length;if(t%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var e=0;e<t;e+=8)y(this,e,e+7),y(this,e+1,e+6),y(this,e+2,e+5),y(this,e+3,e+4);return this},u.prototype.toString=function(){var t=this.length;return 0===t?"":0===arguments.length?k(this,0,t):m.apply(this,arguments)},u.prototype.toLocaleString=u.prototype.toString,u.prototype.equals=function(t){if(!u.isBuffer(t))throw new TypeError("Argument must be a Buffer");return this===t||0===u.compare(this,t)},u.prototype.inspect=function(){var t="",r=e.INSPECT_MAX_BYTES;return t=this.toString("hex",0,r).replace(/(.{2})/g,"$1 ").trim(),this.length>r&&(t+=" ... "),"<Buffer "+t+">"},o&&(u.prototype[o]=u.prototype.inspect),u.prototype.compare=function(t,e,r,n,i){if(G(t,Uint8Array)&&(t=u.from(t,t.offset,t.byteLength)),!u.isBuffer(t))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof t);if(void 0===e&&(e=0),void 0===r&&(r=t?t.length:0),void 0===n&&(n=0),void 0===i&&(i=this.length),e<0||r>t.length||n<0||i>this.length)throw new RangeError("out of range index");if(n>=i&&e>=r)return 0;if(n>=i)return-1;if(e>=r)return 1;if(this===t)return 0;for(var a=(i>>>=0)-(n>>>=0),o=(r>>>=0)-(e>>>=0),s=Math.min(a,o),l=this.slice(n,i),c=t.slice(e,r),d=0;d<s;++d)if(l[d]!==c[d]){a=l[d],o=c[d];break}return a<o?-1:o<a?1:0},u.prototype.includes=function(t,e,r){return-1!==this.indexOf(t,e,r)},u.prototype.indexOf=function(t,e,r){return b(this,t,e,r,!0)},u.prototype.lastIndexOf=function(t,e,r){return b(this,t,e,r,!1)},u.prototype.write=function(t,e,r,n){if(void 0===e)n="utf8",r=this.length,e=0;else if(void 0===r&&"string"==typeof e)n=e,r=this.length,e=0;else{if(!isFinite(e))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");e>>>=0,isFinite(r)?(r>>>=0,void 0===n&&(n="utf8")):(n=r,r=void 0)}var i=this.length-e;if((void 0===r||r>i)&&(r=i),t.length>0&&(r<0||e<0)||e>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");for(var a=!1;;)switch(n){case"hex":return x(this,t,e,r);case"utf8":case"utf-8":return S(this,t,e,r);case"ascii":case"latin1":case"binary":return T(this,t,e,r);case"base64":return w(this,t,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return _(this,t,e,r);default:if(a)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),a=!0}},u.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var C=4096;function D(t,e,r){var n="";r=Math.min(t.length,r);for(var i=e;i<r;++i)n+=String.fromCharCode(127&t[i]);return n}function L(t,e,r){var n="";r=Math.min(t.length,r);for(var i=e;i<r;++i)n+=String.fromCharCode(t[i]);return n}function R(t,e,r){var n=t.length;(!e||e<0)&&(e=0),(!r||r<0||r>n)&&(r=n);for(var i="",a=e;a<r;++a)i+=V[t[a]];return i}function I(t,e,r){for(var n=t.slice(e,r),i="",a=0;a<n.length-1;a+=2)i+=String.fromCharCode(n[a]+256*n[a+1]);return i}function O(t,e,r){if(t%1!=0||t<0)throw new RangeError("offset is not uint");if(t+e>r)throw new RangeError("Trying to access beyond buffer length")}function M(t,e,r,n,i,a){if(!u.isBuffer(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(e>i||e<a)throw new RangeError('"value" argument is out of bounds');if(r+n>t.length)throw new RangeError("Index out of range")}function P(t,e,r,n,i,a){if(r+n>t.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function F(t,e,r,n,i){return e=+e,r>>>=0,i||P(t,0,r,4),a.write(t,e,r,n,23,4),r+4}function N(t,e,r,n,i){return e=+e,r>>>=0,i||P(t,0,r,8),a.write(t,e,r,n,52,8),r+8}u.prototype.slice=function(t,e){var r=this.length;(t=~~t)<0?(t+=r)<0&&(t=0):t>r&&(t=r),(e=void 0===e?r:~~e)<0?(e+=r)<0&&(e=0):e>r&&(e=r),e<t&&(e=t);var n=this.subarray(t,e);return Object.setPrototypeOf(n,u.prototype),n},u.prototype.readUintLE=u.prototype.readUIntLE=function(t,e,r){t>>>=0,e>>>=0,r||O(t,e,this.length);for(var n=this[t],i=1,a=0;++a<e&&(i*=256);)n+=this[t+a]*i;return n},u.prototype.readUintBE=u.prototype.readUIntBE=function(t,e,r){t>>>=0,e>>>=0,r||O(t,e,this.length);for(var n=this[t+--e],i=1;e>0&&(i*=256);)n+=this[t+--e]*i;return n},u.prototype.readUint8=u.prototype.readUInt8=function(t,e){return t>>>=0,e||O(t,1,this.length),this[t]},u.prototype.readUint16LE=u.prototype.readUInt16LE=function(t,e){return t>>>=0,e||O(t,2,this.length),this[t]|this[t+1]<<8},u.prototype.readUint16BE=u.prototype.readUInt16BE=function(t,e){return t>>>=0,e||O(t,2,this.length),this[t]<<8|this[t+1]},u.prototype.readUint32LE=u.prototype.readUInt32LE=function(t,e){return t>>>=0,e||O(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+16777216*this[t+3]},u.prototype.readUint32BE=u.prototype.readUInt32BE=function(t,e){return t>>>=0,e||O(t,4,this.length),16777216*this[t]+(this[t+1]<<16|this[t+2]<<8|this[t+3])},u.prototype.readIntLE=function(t,e,r){t>>>=0,e>>>=0,r||O(t,e,this.length);for(var n=this[t],i=1,a=0;++a<e&&(i*=256);)n+=this[t+a]*i;return n>=(i*=128)&&(n-=Math.pow(2,8*e)),n},u.prototype.readIntBE=function(t,e,r){t>>>=0,e>>>=0,r||O(t,e,this.length);for(var n=e,i=1,a=this[t+--n];n>0&&(i*=256);)a+=this[t+--n]*i;return a>=(i*=128)&&(a-=Math.pow(2,8*e)),a},u.prototype.readInt8=function(t,e){return t>>>=0,e||O(t,1,this.length),128&this[t]?-1*(255-this[t]+1):this[t]},u.prototype.readInt16LE=function(t,e){t>>>=0,e||O(t,2,this.length);var r=this[t]|this[t+1]<<8;return 32768&r?4294901760|r:r},u.prototype.readInt16BE=function(t,e){t>>>=0,e||O(t,2,this.length);var r=this[t+1]|this[t]<<8;return 32768&r?4294901760|r:r},u.prototype.readInt32LE=function(t,e){return t>>>=0,e||O(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},u.prototype.readInt32BE=function(t,e){return t>>>=0,e||O(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},u.prototype.readFloatLE=function(t,e){return t>>>=0,e||O(t,4,this.length),a.read(this,t,!0,23,4)},u.prototype.readFloatBE=function(t,e){return t>>>=0,e||O(t,4,this.length),a.read(this,t,!1,23,4)},u.prototype.readDoubleLE=function(t,e){return t>>>=0,e||O(t,8,this.length),a.read(this,t,!0,52,8)},u.prototype.readDoubleBE=function(t,e){return t>>>=0,e||O(t,8,this.length),a.read(this,t,!1,52,8)},u.prototype.writeUintLE=u.prototype.writeUIntLE=function(t,e,r,n){t=+t,e>>>=0,r>>>=0,n||M(this,t,e,r,Math.pow(2,8*r)-1,0);var i=1,a=0;for(this[e]=255&t;++a<r&&(i*=256);)this[e+a]=t/i&255;return e+r},u.prototype.writeUintBE=u.prototype.writeUIntBE=function(t,e,r,n){t=+t,e>>>=0,r>>>=0,n||M(this,t,e,r,Math.pow(2,8*r)-1,0);var i=r-1,a=1;for(this[e+i]=255&t;--i>=0&&(a*=256);)this[e+i]=t/a&255;return e+r},u.prototype.writeUint8=u.prototype.writeUInt8=function(t,e,r){return t=+t,e>>>=0,r||M(this,t,e,1,255,0),this[e]=255&t,e+1},u.prototype.writeUint16LE=u.prototype.writeUInt16LE=function(t,e,r){return t=+t,e>>>=0,r||M(this,t,e,2,65535,0),this[e]=255&t,this[e+1]=t>>>8,e+2},u.prototype.writeUint16BE=u.prototype.writeUInt16BE=function(t,e,r){return t=+t,e>>>=0,r||M(this,t,e,2,65535,0),this[e]=t>>>8,this[e+1]=255&t,e+2},u.prototype.writeUint32LE=u.prototype.writeUInt32LE=function(t,e,r){return t=+t,e>>>=0,r||M(this,t,e,4,4294967295,0),this[e+3]=t>>>24,this[e+2]=t>>>16,this[e+1]=t>>>8,this[e]=255&t,e+4},u.prototype.writeUint32BE=u.prototype.writeUInt32BE=function(t,e,r){return t=+t,e>>>=0,r||M(this,t,e,4,4294967295,0),this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t,e+4},u.prototype.writeIntLE=function(t,e,r,n){if(t=+t,e>>>=0,!n){var i=Math.pow(2,8*r-1);M(this,t,e,r,i-1,-i)}var a=0,o=1,s=0;for(this[e]=255&t;++a<r&&(o*=256);)t<0&&0===s&&0!==this[e+a-1]&&(s=1),this[e+a]=(t/o>>0)-s&255;return e+r},u.prototype.writeIntBE=function(t,e,r,n){if(t=+t,e>>>=0,!n){var i=Math.pow(2,8*r-1);M(this,t,e,r,i-1,-i)}var a=r-1,o=1,s=0;for(this[e+a]=255&t;--a>=0&&(o*=256);)t<0&&0===s&&0!==this[e+a+1]&&(s=1),this[e+a]=(t/o>>0)-s&255;return e+r},u.prototype.writeInt8=function(t,e,r){return t=+t,e>>>=0,r||M(this,t,e,1,127,-128),t<0&&(t=255+t+1),this[e]=255&t,e+1},u.prototype.writeInt16LE=function(t,e,r){return t=+t,e>>>=0,r||M(this,t,e,2,32767,-32768),this[e]=255&t,this[e+1]=t>>>8,e+2},u.prototype.writeInt16BE=function(t,e,r){return t=+t,e>>>=0,r||M(this,t,e,2,32767,-32768),this[e]=t>>>8,this[e+1]=255&t,e+2},u.prototype.writeInt32LE=function(t,e,r){return t=+t,e>>>=0,r||M(this,t,e,4,2147483647,-2147483648),this[e]=255&t,this[e+1]=t>>>8,this[e+2]=t>>>16,this[e+3]=t>>>24,e+4},u.prototype.writeInt32BE=function(t,e,r){return t=+t,e>>>=0,r||M(this,t,e,4,2147483647,-2147483648),t<0&&(t=4294967295+t+1),this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t,e+4},u.prototype.writeFloatLE=function(t,e,r){return F(this,t,e,!0,r)},u.prototype.writeFloatBE=function(t,e,r){return F(this,t,e,!1,r)},u.prototype.writeDoubleLE=function(t,e,r){return N(this,t,e,!0,r)},u.prototype.writeDoubleBE=function(t,e,r){return N(this,t,e,!1,r)},u.prototype.copy=function(t,e,r,n){if(!u.isBuffer(t))throw new TypeError("argument should be a Buffer");if(r||(r=0),n||0===n||(n=this.length),e>=t.length&&(e=t.length),e||(e=0),n>0&&n<r&&(n=r),n===r)return 0;if(0===t.length||0===this.length)return 0;if(e<0)throw new RangeError("targetStart out of bounds");if(r<0||r>=this.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),t.length-e<n-r&&(n=t.length-e+r);var i=n-r;return this===t&&"function"==typeof Uint8Array.prototype.copyWithin?this.copyWithin(e,r,n):Uint8Array.prototype.set.call(t,this.subarray(r,n),e),i},u.prototype.fill=function(t,e,r,n){if("string"==typeof t){if("string"==typeof e?(n=e,e=0,r=this.length):"string"==typeof r&&(n=r,r=this.length),void 0!==n&&"string"!=typeof n)throw new TypeError("encoding must be a string");if("string"==typeof n&&!u.isEncoding(n))throw new TypeError("Unknown encoding: "+n);if(1===t.length){var i=t.charCodeAt(0);("utf8"===n&&i<128||"latin1"===n)&&(t=i)}}else"number"==typeof t?t&=255:"boolean"==typeof t&&(t=Number(t));if(e<0||this.length<e||this.length<r)throw new RangeError("Out of range index");if(r<=e)return this;var a;if(e>>>=0,r=void 0===r?this.length:r>>>0,t||(t=0),"number"==typeof t)for(a=e;a<r;++a)this[a]=t;else{var o=u.isBuffer(t)?t:u.from(t,n),s=o.length;if(0===s)throw new TypeError('The value "'+t+'" is invalid for argument "value"');for(a=0;a<r-e;++a)this[a+e]=o[a%s]}return this};var B=/[^+/0-9A-Za-z-_]/g;function U(t,e){var r;e=e||1/0;for(var n=t.length,i=null,a=[],o=0;o<n;++o){if((r=t.charCodeAt(o))>55295&&r<57344){if(!i){if(r>56319){(e-=3)>-1&&a.push(239,191,189);continue}if(o+1===n){(e-=3)>-1&&a.push(239,191,189);continue}i=r;continue}if(r<56320){(e-=3)>-1&&a.push(239,191,189),i=r;continue}r=65536+(i-55296<<10|r-56320)}else i&&(e-=3)>-1&&a.push(239,191,189);if(i=null,r<128){if((e-=1)<0)break;a.push(r)}else if(r<2048){if((e-=2)<0)break;a.push(r>>6|192,63&r|128)}else if(r<65536){if((e-=3)<0)break;a.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error("Invalid code point");if((e-=4)<0)break;a.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return a}function j(t){return i.toByteArray(function(t){if((t=(t=t.split("=")[0]).trim().replace(B,"")).length<2)return"";for(;t.length%4!=0;)t+="=";return t}(t))}function H(t,e,r,n){for(var i=0;i<n&&!(i+r>=e.length||i>=t.length);++i)e[i+r]=t[i];return i}function G(t,e){return t instanceof e||null!=t&&null!=t.constructor&&null!=t.constructor.name&&t.constructor.name===e.name}function z(t){return t!=t}var V=function(){for(var t="0123456789abcdef",e=new Array(256),r=0;r<16;++r)for(var n=16*r,i=0;i<16;++i)e[n+i]=t[r]+t[i];return e}()},21095:function(t,e,r){var n=r(51266);t.exports=function(t){"use strict";t=t&&t.hasOwnProperty("default")?t.default:t;var e={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]},r=function(t,e){return t(e={exports:{}},e.exports),e.exports}((function(t){var r={};for(var n in e)e.hasOwnProperty(n)&&(r[e[n]]=n);var i=t.exports={rgb:{channels:3,labels:"rgb"},hsl:{channels:3,labels:"hsl"},hsv:{channels:3,labels:"hsv"},hwb:{channels:3,labels:"hwb"},cmyk:{channels:4,labels:"cmyk"},xyz:{channels:3,labels:"xyz"},lab:{channels:3,labels:"lab"},lch:{channels:3,labels:"lch"},hex:{channels:1,labels:["hex"]},keyword:{channels:1,labels:["keyword"]},ansi16:{channels:1,labels:["ansi16"]},ansi256:{channels:1,labels:["ansi256"]},hcg:{channels:3,labels:["h","c","g"]},apple:{channels:3,labels:["r16","g16","b16"]},gray:{channels:1,labels:["gray"]}};for(var a in i)if(i.hasOwnProperty(a)){if(!("channels"in i[a]))throw new Error("missing channels property: "+a);if(!("labels"in i[a]))throw new Error("missing channel labels property: "+a);if(i[a].labels.length!==i[a].channels)throw new Error("channel and label counts mismatch: "+a);var o=i[a].channels,s=i[a].labels;delete i[a].channels,delete i[a].labels,Object.defineProperty(i[a],"channels",{value:o}),Object.defineProperty(i[a],"labels",{value:s})}i.rgb.hsl=function(t){var e,r,n=t[0]/255,i=t[1]/255,a=t[2]/255,o=Math.min(n,i,a),s=Math.max(n,i,a),l=s-o;return s===o?e=0:n===s?e=(i-a)/l:i===s?e=2+(a-n)/l:a===s&&(e=4+(n-i)/l),(e=Math.min(60*e,360))<0&&(e+=360),r=(o+s)/2,[e,100*(s===o?0:r<=.5?l/(s+o):l/(2-s-o)),100*r]},i.rgb.hsv=function(t){var e,r,n,i,a,o=t[0]/255,s=t[1]/255,l=t[2]/255,u=Math.max(o,s,l),c=u-Math.min(o,s,l),d=function(t){return(u-t)/6/c+.5};return 0===c?i=a=0:(a=c/u,e=d(o),r=d(s),n=d(l),o===u?i=n-r:s===u?i=1/3+e-n:l===u&&(i=2/3+r-e),i<0?i+=1:i>1&&(i-=1)),[360*i,100*a,100*u]},i.rgb.hwb=function(t){var e=t[0],r=t[1],n=t[2];return[i.rgb.hsl(t)[0],1/255*Math.min(e,Math.min(r,n))*100,100*(n=1-1/255*Math.max(e,Math.max(r,n)))]},i.rgb.cmyk=function(t){var e,r=t[0]/255,n=t[1]/255,i=t[2]/255;return[100*((1-r-(e=Math.min(1-r,1-n,1-i)))/(1-e)||0),100*((1-n-e)/(1-e)||0),100*((1-i-e)/(1-e)||0),100*e]},i.rgb.keyword=function(t){var n=r[t];if(n)return n;var i,a,o,s=1/0;for(var l in e)if(e.hasOwnProperty(l)){var u=(a=t,o=e[l],Math.pow(a[0]-o[0],2)+Math.pow(a[1]-o[1],2)+Math.pow(a[2]-o[2],2));u<s&&(s=u,i=l)}return i},i.keyword.rgb=function(t){return e[t]},i.rgb.xyz=function(t){var e=t[0]/255,r=t[1]/255,n=t[2]/255;return[100*(.4124*(e=e>.04045?Math.pow((e+.055)/1.055,2.4):e/12.92)+.3576*(r=r>.04045?Math.pow((r+.055)/1.055,2.4):r/12.92)+.1805*(n=n>.04045?Math.pow((n+.055)/1.055,2.4):n/12.92)),100*(.2126*e+.7152*r+.0722*n),100*(.0193*e+.1192*r+.9505*n)]},i.rgb.lab=function(t){var e=i.rgb.xyz(t),r=e[0],n=e[1],a=e[2];return n/=100,a/=108.883,r=(r/=95.047)>.008856?Math.pow(r,1/3):7.787*r+16/116,[116*(n=n>.008856?Math.pow(n,1/3):7.787*n+16/116)-16,500*(r-n),200*(n-(a=a>.008856?Math.pow(a,1/3):7.787*a+16/116))]},i.hsl.rgb=function(t){var e,r,n,i,a,o=t[0]/360,s=t[1]/100,l=t[2]/100;if(0===s)return[a=255*l,a,a];e=2*l-(r=l<.5?l*(1+s):l+s-l*s),i=[0,0,0];for(var u=0;u<3;u++)(n=o+1/3*-(u-1))<0&&n++,n>1&&n--,a=6*n<1?e+6*(r-e)*n:2*n<1?r:3*n<2?e+(r-e)*(2/3-n)*6:e,i[u]=255*a;return i},i.hsl.hsv=function(t){var e=t[0],r=t[1]/100,n=t[2]/100,i=r,a=Math.max(n,.01);return r*=(n*=2)<=1?n:2-n,i*=a<=1?a:2-a,[e,100*(0===n?2*i/(a+i):2*r/(n+r)),(n+r)/2*100]},i.hsv.rgb=function(t){var e=t[0]/60,r=t[1]/100,n=t[2]/100,i=Math.floor(e)%6,a=e-Math.floor(e),o=255*n*(1-r),s=255*n*(1-r*a),l=255*n*(1-r*(1-a));switch(n*=255,i){case 0:return[n,l,o];case 1:return[s,n,o];case 2:return[o,n,l];case 3:return[o,s,n];case 4:return[l,o,n];case 5:return[n,o,s]}},i.hsv.hsl=function(t){var e,r,n,i=t[0],a=t[1]/100,o=t[2]/100,s=Math.max(o,.01);return n=(2-a)*o,r=a*s,[i,100*(r=(r/=(e=(2-a)*s)<=1?e:2-e)||0),100*(n/=2)]},i.hwb.rgb=function(t){var e,r,n,i,a,o,s,l=t[0]/360,u=t[1]/100,c=t[2]/100,d=u+c;switch(d>1&&(u/=d,c/=d),n=6*l-(e=Math.floor(6*l)),0!=(1&e)&&(n=1-n),i=u+n*((r=1-c)-u),e){default:case 6:case 0:a=r,o=i,s=u;break;case 1:a=i,o=r,s=u;break;case 2:a=u,o=r,s=i;break;case 3:a=u,o=i,s=r;break;case 4:a=i,o=u,s=r;break;case 5:a=r,o=u,s=i}return[255*a,255*o,255*s]},i.cmyk.rgb=function(t){var e=t[0]/100,r=t[1]/100,n=t[2]/100,i=t[3]/100;return[255*(1-Math.min(1,e*(1-i)+i)),255*(1-Math.min(1,r*(1-i)+i)),255*(1-Math.min(1,n*(1-i)+i))]},i.xyz.rgb=function(t){var e,r,n,i=t[0]/100,a=t[1]/100,o=t[2]/100;return r=-.9689*i+1.8758*a+.0415*o,n=.0557*i+-.204*a+1.057*o,e=(e=3.2406*i+-1.5372*a+-.4986*o)>.0031308?1.055*Math.pow(e,1/2.4)-.055:12.92*e,r=r>.0031308?1.055*Math.pow(r,1/2.4)-.055:12.92*r,n=n>.0031308?1.055*Math.pow(n,1/2.4)-.055:12.92*n,[255*(e=Math.min(Math.max(0,e),1)),255*(r=Math.min(Math.max(0,r),1)),255*(n=Math.min(Math.max(0,n),1))]},i.xyz.lab=function(t){var e=t[0],r=t[1],n=t[2];return r/=100,n/=108.883,e=(e/=95.047)>.008856?Math.pow(e,1/3):7.787*e+16/116,[116*(r=r>.008856?Math.pow(r,1/3):7.787*r+16/116)-16,500*(e-r),200*(r-(n=n>.008856?Math.pow(n,1/3):7.787*n+16/116))]},i.lab.xyz=function(t){var e,r,n,i=t[0];e=t[1]/500+(r=(i+16)/116),n=r-t[2]/200;var a=Math.pow(r,3),o=Math.pow(e,3),s=Math.pow(n,3);return r=a>.008856?a:(r-16/116)/7.787,e=o>.008856?o:(e-16/116)/7.787,n=s>.008856?s:(n-16/116)/7.787,[e*=95.047,r*=100,n*=108.883]},i.lab.lch=function(t){var e,r=t[0],n=t[1],i=t[2];return(e=360*Math.atan2(i,n)/2/Math.PI)<0&&(e+=360),[r,Math.sqrt(n*n+i*i),e]},i.lch.lab=function(t){var e,r=t[0],n=t[1];return e=t[2]/360*2*Math.PI,[r,n*Math.cos(e),n*Math.sin(e)]},i.rgb.ansi16=function(t){var e=t[0],r=t[1],n=t[2],a=1 in arguments?arguments[1]:i.rgb.hsv(t)[2];if(0===(a=Math.round(a/50)))return 30;var o=30+(Math.round(n/255)<<2|Math.round(r/255)<<1|Math.round(e/255));return 2===a&&(o+=60),o},i.hsv.ansi16=function(t){return i.rgb.ansi16(i.hsv.rgb(t),t[2])},i.rgb.ansi256=function(t){var e=t[0],r=t[1],n=t[2];return e===r&&r===n?e<8?16:e>248?231:Math.round((e-8)/247*24)+232:16+36*Math.round(e/255*5)+6*Math.round(r/255*5)+Math.round(n/255*5)},i.ansi16.rgb=function(t){var e=t%10;if(0===e||7===e)return t>50&&(e+=3.5),[e=e/10.5*255,e,e];var r=.5*(1+~~(t>50));return[(1&e)*r*255,(e>>1&1)*r*255,(e>>2&1)*r*255]},i.ansi256.rgb=function(t){if(t>=232){var e=10*(t-232)+8;return[e,e,e]}var r;return t-=16,[Math.floor(t/36)/5*255,Math.floor((r=t%36)/6)/5*255,r%6/5*255]},i.rgb.hex=function(t){var e=(((255&Math.round(t[0]))<<16)+((255&Math.round(t[1]))<<8)+(255&Math.round(t[2]))).toString(16).toUpperCase();return"000000".substring(e.length)+e},i.hex.rgb=function(t){var e=t.toString(16).match(/[a-f0-9]{6}|[a-f0-9]{3}/i);if(!e)return[0,0,0];var r=e[0];3===e[0].length&&(r=r.split("").map((function(t){return t+t})).join(""));var n=parseInt(r,16);return[n>>16&255,n>>8&255,255&n]},i.rgb.hcg=function(t){var e,r=t[0]/255,n=t[1]/255,i=t[2]/255,a=Math.max(Math.max(r,n),i),o=Math.min(Math.min(r,n),i),s=a-o;return e=s<=0?0:a===r?(n-i)/s%6:a===n?2+(i-r)/s:4+(r-n)/s+4,e/=6,[360*(e%=1),100*s,100*(s<1?o/(1-s):0)]},i.hsl.hcg=function(t){var e,r=t[1]/100,n=t[2]/100,i=0;return(e=n<.5?2*r*n:2*r*(1-n))<1&&(i=(n-.5*e)/(1-e)),[t[0],100*e,100*i]},i.hsv.hcg=function(t){var e=t[1]/100,r=t[2]/100,n=e*r,i=0;return n<1&&(i=(r-n)/(1-n)),[t[0],100*n,100*i]},i.hcg.rgb=function(t){var e=t[0]/360,r=t[1]/100,n=t[2]/100;if(0===r)return[255*n,255*n,255*n];var i,a=[0,0,0],o=e%1*6,s=o%1,l=1-s;switch(Math.floor(o)){case 0:a[0]=1,a[1]=s,a[2]=0;break;case 1:a[0]=l,a[1]=1,a[2]=0;break;case 2:a[0]=0,a[1]=1,a[2]=s;break;case 3:a[0]=0,a[1]=l,a[2]=1;break;case 4:a[0]=s,a[1]=0,a[2]=1;break;default:a[0]=1,a[1]=0,a[2]=l}return i=(1-r)*n,[255*(r*a[0]+i),255*(r*a[1]+i),255*(r*a[2]+i)]},i.hcg.hsv=function(t){var e=t[1]/100,r=e+t[2]/100*(1-e),n=0;return r>0&&(n=e/r),[t[0],100*n,100*r]},i.hcg.hsl=function(t){var e=t[1]/100,r=t[2]/100*(1-e)+.5*e,n=0;return r>0&&r<.5?n=e/(2*r):r>=.5&&r<1&&(n=e/(2*(1-r))),[t[0],100*n,100*r]},i.hcg.hwb=function(t){var e=t[1]/100,r=e+t[2]/100*(1-e);return[t[0],100*(r-e),100*(1-r)]},i.hwb.hcg=function(t){var e=t[1]/100,r=1-t[2]/100,n=r-e,i=0;return n<1&&(i=(r-n)/(1-n)),[t[0],100*n,100*i]},i.apple.rgb=function(t){return[t[0]/65535*255,t[1]/65535*255,t[2]/65535*255]},i.rgb.apple=function(t){return[t[0]/255*65535,t[1]/255*65535,t[2]/255*65535]},i.gray.rgb=function(t){return[t[0]/100*255,t[0]/100*255,t[0]/100*255]},i.gray.hsl=i.gray.hsv=function(t){return[0,0,t[0]]},i.gray.hwb=function(t){return[0,100,t[0]]},i.gray.cmyk=function(t){return[0,0,0,t[0]]},i.gray.lab=function(t){return[t[0],0,0]},i.gray.hex=function(t){var e=255&Math.round(t[0]/100*255),r=((e<<16)+(e<<8)+e).toString(16).toUpperCase();return"000000".substring(r.length)+r},i.rgb.gray=function(t){return[(t[0]+t[1]+t[2])/3/255*100]}}));function i(t){var e=function(){for(var t={},e=Object.keys(r),n=e.length,i=0;i<n;i++)t[e[i]]={distance:-1,parent:null};return t}(),n=[t];for(e[t].distance=0;n.length;)for(var i=n.pop(),a=Object.keys(r[i]),o=a.length,s=0;s<o;s++){var l=a[s],u=e[l];-1===u.distance&&(u.distance=e[i].distance+1,u.parent=i,n.unshift(l))}return e}function a(t,e){return function(r){return e(t(r))}}function o(t,e){for(var n=[e[t].parent,t],i=r[e[t].parent][t],o=e[t].parent;e[o].parent;)n.unshift(e[o].parent),i=a(r[e[o].parent][o],i),o=e[o].parent;return i.conversion=n,i}r.rgb,r.hsl,r.hsv,r.hwb,r.cmyk,r.xyz,r.lab,r.lch,r.hex,r.keyword,r.ansi16,r.ansi256,r.hcg,r.apple,r.gray;var s={};Object.keys(r).forEach((function(t){s[t]={},Object.defineProperty(s[t],"channels",{value:r[t].channels}),Object.defineProperty(s[t],"labels",{value:r[t].labels});var e=function(t){for(var e=i(t),r={},n=Object.keys(e),a=n.length,s=0;s<a;s++){var l=n[s];null!==e[l].parent&&(r[l]=o(l,e))}return r}(t);Object.keys(e).forEach((function(r){var n=e[r];s[t][r]=function(t){var e=function(e){if(null==e)return e;arguments.length>1&&(e=Array.prototype.slice.call(arguments));var r=t(e);if("object"==typeof r)for(var n=r.length,i=0;i<n;i++)r[i]=Math.round(r[i]);return r};return"conversion"in t&&(e.conversion=t.conversion),e}(n),s[t][r].raw=function(t){var e=function(e){return null==e?e:(arguments.length>1&&(e=Array.prototype.slice.call(arguments)),t(e))};return"conversion"in t&&(e.conversion=t.conversion),e}(n)}))}));var l=s,u={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]},c={getRgba:d,getHsla:h,getRgb:function(t){var e=d(t);return e&&e.slice(0,3)},getHsl:function(t){var e=h(t);return e&&e.slice(0,3)},getHwb:f,getAlpha:function(t){var e=d(t);return e||(e=h(t))||(e=f(t))?e[3]:void 0},hexString:function(t,e){return e=void 0!==e&&3===t.length?e:t[3],"#"+y(t[0])+y(t[1])+y(t[2])+(e>=0&&e<1?y(Math.round(255*e)):"")},rgbString:function(t,e){return e<1||t[3]&&t[3]<1?p(t,e):"rgb("+t[0]+", "+t[1]+", "+t[2]+")"},rgbaString:p,percentString:function(t,e){return e<1||t[3]&&t[3]<1?g(t,e):"rgb("+Math.round(t[0]/255*100)+"%, "+Math.round(t[1]/255*100)+"%, "+Math.round(t[2]/255*100)+"%)"},percentaString:g,hslString:function(t,e){return e<1||t[3]&&t[3]<1?v(t,e):"hsl("+t[0]+", "+t[1]+"%, "+t[2]+"%)"},hslaString:v,hwbString:function(t,e){return void 0===e&&(e=void 0!==t[3]?t[3]:1),"hwb("+t[0]+", "+t[1]+"%, "+t[2]+"%"+(void 0!==e&&1!==e?", "+e:"")+")"},keyword:function(t){return b[t.slice(0,3)]}};function d(t){if(t){var e=[0,0,0],r=1,n=t.match(/^#([a-fA-F0-9]{3,4})$/i),i="";if(n){i=(n=n[1])[3];for(var a=0;a<e.length;a++)e[a]=parseInt(n[a]+n[a],16);i&&(r=Math.round(parseInt(i+i,16)/255*100)/100)}else if(n=t.match(/^#([a-fA-F0-9]{6}([a-fA-F0-9]{2})?)$/i)){for(i=n[2],n=n[1],a=0;a<e.length;a++)e[a]=parseInt(n.slice(2*a,2*a+2),16);i&&(r=Math.round(parseInt(i,16)/255*100)/100)}else if(n=t.match(/^rgba?\(\s*([+-]?\d+)\s*,\s*([+-]?\d+)\s*,\s*([+-]?\d+)\s*(?:,\s*([+-]?[\d\.]+)\s*)?\)$/i)){for(a=0;a<e.length;a++)e[a]=parseInt(n[a+1]);r=parseFloat(n[4])}else if(n=t.match(/^rgba?\(\s*([+-]?[\d\.]+)\%\s*,\s*([+-]?[\d\.]+)\%\s*,\s*([+-]?[\d\.]+)\%\s*(?:,\s*([+-]?[\d\.]+)\s*)?\)$/i)){for(a=0;a<e.length;a++)e[a]=Math.round(2.55*parseFloat(n[a+1]));r=parseFloat(n[4])}else if(n=t.match(/(\w+)/)){if("transparent"==n[1])return[0,0,0,0];if(!(e=u[n[1]]))return}for(a=0;a<e.length;a++)e[a]=m(e[a],0,255);return r=r||0==r?m(r,0,1):1,e[3]=r,e}}function h(t){if(t){var e=t.match(/^hsla?\(\s*([+-]?\d+)(?:deg)?\s*,\s*([+-]?[\d\.]+)%\s*,\s*([+-]?[\d\.]+)%\s*(?:,\s*([+-]?[\d\.]+)\s*)?\)/);if(e){var r=parseFloat(e[4]);return[m(parseInt(e[1]),0,360),m(parseFloat(e[2]),0,100),m(parseFloat(e[3]),0,100),m(isNaN(r)?1:r,0,1)]}}}function f(t){if(t){var e=t.match(/^hwb\(\s*([+-]?\d+)(?:deg)?\s*,\s*([+-]?[\d\.]+)%\s*,\s*([+-]?[\d\.]+)%\s*(?:,\s*([+-]?[\d\.]+)\s*)?\)/);if(e){var r=parseFloat(e[4]);return[m(parseInt(e[1]),0,360),m(parseFloat(e[2]),0,100),m(parseFloat(e[3]),0,100),m(isNaN(r)?1:r,0,1)]}}}function p(t,e){return void 0===e&&(e=void 0!==t[3]?t[3]:1),"rgba("+t[0]+", "+t[1]+", "+t[2]+", "+e+")"}function g(t,e){return"rgba("+Math.round(t[0]/255*100)+"%, "+Math.round(t[1]/255*100)+"%, "+Math.round(t[2]/255*100)+"%, "+(e||t[3]||1)+")"}function v(t,e){return void 0===e&&(e=void 0!==t[3]?t[3]:1),"hsla("+t[0]+", "+t[1]+"%, "+t[2]+"%, "+e+")"}function m(t,e,r){return Math.min(Math.max(e,t),r)}function y(t){var e=t.toString(16).toUpperCase();return e.length<2?"0"+e:e}var b={};for(var E in u)b[u[E]]=E;var x=function(t){return t instanceof x?t:this instanceof x?(this.valid=!1,this.values={rgb:[0,0,0],hsl:[0,0,0],hsv:[0,0,0],hwb:[0,0,0],cmyk:[0,0,0,0],alpha:1},void("string"==typeof t?(e=c.getRgba(t))?this.setValues("rgb",e):(e=c.getHsla(t))?this.setValues("hsl",e):(e=c.getHwb(t))&&this.setValues("hwb",e):"object"==typeof t&&(void 0!==(e=t).r||void 0!==e.red?this.setValues("rgb",e):void 0!==e.l||void 0!==e.lightness?this.setValues("hsl",e):void 0!==e.v||void 0!==e.value?this.setValues("hsv",e):void 0!==e.w||void 0!==e.whiteness?this.setValues("hwb",e):void 0===e.c&&void 0===e.cyan||this.setValues("cmyk",e)))):new x(t);var e};x.prototype={isValid:function(){return this.valid},rgb:function(){return this.setSpace("rgb",arguments)},hsl:function(){return this.setSpace("hsl",arguments)},hsv:function(){return this.setSpace("hsv",arguments)},hwb:function(){return this.setSpace("hwb",arguments)},cmyk:function(){return this.setSpace("cmyk",arguments)},rgbArray:function(){return this.values.rgb},hslArray:function(){return this.values.hsl},hsvArray:function(){return this.values.hsv},hwbArray:function(){var t=this.values;return 1!==t.alpha?t.hwb.concat([t.alpha]):t.hwb},cmykArray:function(){return this.values.cmyk},rgbaArray:function(){var t=this.values;return t.rgb.concat([t.alpha])},hslaArray:function(){var t=this.values;return t.hsl.concat([t.alpha])},alpha:function(t){return void 0===t?this.values.alpha:(this.setValues("alpha",t),this)},red:function(t){return this.setChannel("rgb",0,t)},green:function(t){return this.setChannel("rgb",1,t)},blue:function(t){return this.setChannel("rgb",2,t)},hue:function(t){return t&&(t=(t%=360)<0?360+t:t),this.setChannel("hsl",0,t)},saturation:function(t){return this.setChannel("hsl",1,t)},lightness:function(t){return this.setChannel("hsl",2,t)},saturationv:function(t){return this.setChannel("hsv",1,t)},whiteness:function(t){return this.setChannel("hwb",1,t)},blackness:function(t){return this.setChannel("hwb",2,t)},value:function(t){return this.setChannel("hsv",2,t)},cyan:function(t){return this.setChannel("cmyk",0,t)},magenta:function(t){return this.setChannel("cmyk",1,t)},yellow:function(t){return this.setChannel("cmyk",2,t)},black:function(t){return this.setChannel("cmyk",3,t)},hexString:function(){return c.hexString(this.values.rgb)},rgbString:function(){return c.rgbString(this.values.rgb,this.values.alpha)},rgbaString:function(){return c.rgbaString(this.values.rgb,this.values.alpha)},percentString:function(){return c.percentString(this.values.rgb,this.values.alpha)},hslString:function(){return c.hslString(this.values.hsl,this.values.alpha)},hslaString:function(){return c.hslaString(this.values.hsl,this.values.alpha)},hwbString:function(){return c.hwbString(this.values.hwb,this.values.alpha)},keyword:function(){return c.keyword(this.values.rgb,this.values.alpha)},rgbNumber:function(){var t=this.values.rgb;return t[0]<<16|t[1]<<8|t[2]},luminosity:function(){for(var t=this.values.rgb,e=[],r=0;r<t.length;r++){var n=t[r]/255;e[r]=n<=.03928?n/12.92:Math.pow((n+.055)/1.055,2.4)}return.2126*e[0]+.7152*e[1]+.0722*e[2]},contrast:function(t){var e=this.luminosity(),r=t.luminosity();return e>r?(e+.05)/(r+.05):(r+.05)/(e+.05)},level:function(t){var e=this.contrast(t);return e>=7.1?"AAA":e>=4.5?"AA":""},dark:function(){var t=this.values.rgb;return(299*t[0]+587*t[1]+114*t[2])/1e3<128},light:function(){return!this.dark()},negate:function(){for(var t=[],e=0;e<3;e++)t[e]=255-this.values.rgb[e];return this.setValues("rgb",t),this},lighten:function(t){var e=this.values.hsl;return e[2]+=e[2]*t,this.setValues("hsl",e),this},darken:function(t){var e=this.values.hsl;return e[2]-=e[2]*t,this.setValues("hsl",e),this},saturate:function(t){var e=this.values.hsl;return e[1]+=e[1]*t,this.setValues("hsl",e),this},desaturate:function(t){var e=this.values.hsl;return e[1]-=e[1]*t,this.setValues("hsl",e),this},whiten:function(t){var e=this.values.hwb;return e[1]+=e[1]*t,this.setValues("hwb",e),this},blacken:function(t){var e=this.values.hwb;return e[2]+=e[2]*t,this.setValues("hwb",e),this},greyscale:function(){var t=this.values.rgb,e=.3*t[0]+.59*t[1]+.11*t[2];return this.setValues("rgb",[e,e,e]),this},clearer:function(t){var e=this.values.alpha;return this.setValues("alpha",e-e*t),this},opaquer:function(t){var e=this.values.alpha;return this.setValues("alpha",e+e*t),this},rotate:function(t){var e=this.values.hsl,r=(e[0]+t)%360;return e[0]=r<0?360+r:r,this.setValues("hsl",e),this},mix:function(t,e){var r=this,n=t,i=void 0===e?.5:e,a=2*i-1,o=r.alpha()-n.alpha(),s=((a*o==-1?a:(a+o)/(1+a*o))+1)/2,l=1-s;return this.rgb(s*r.red()+l*n.red(),s*r.green()+l*n.green(),s*r.blue()+l*n.blue()).alpha(r.alpha()*i+n.alpha()*(1-i))},toJSON:function(){return this.rgb()},clone:function(){var t,e,r=new x,i=this.values,a=r.values;for(var o in i)i.hasOwnProperty(o)&&(t=i[o],"[object Array]"===(e={}.toString.call(t))?a[o]=t.slice(0):"[object Number]"===e?a[o]=t:n.error("unexpected color value:",t));return r}},x.prototype.spaces={rgb:["red","green","blue"],hsl:["hue","saturation","lightness"],hsv:["hue","saturation","value"],hwb:["hue","whiteness","blackness"],cmyk:["cyan","magenta","yellow","black"]},x.prototype.maxes={rgb:[255,255,255],hsl:[360,100,100],hsv:[360,100,100],hwb:[360,100,100],cmyk:[100,100,100,100]},x.prototype.getValues=function(t){for(var e=this.values,r={},n=0;n<t.length;n++)r[t.charAt(n)]=e[t][n];return 1!==e.alpha&&(r.a=e.alpha),r},x.prototype.setValues=function(t,e){var r,n,i=this.values,a=this.spaces,o=this.maxes,s=1;if(this.valid=!0,"alpha"===t)s=e;else if(e.length)i[t]=e.slice(0,t.length),s=e[t.length];else if(void 0!==e[t.charAt(0)]){for(r=0;r<t.length;r++)i[t][r]=e[t.charAt(r)];s=e.a}else if(void 0!==e[a[t][0]]){var u=a[t];for(r=0;r<t.length;r++)i[t][r]=e[u[r]];s=e.alpha}if(i.alpha=Math.max(0,Math.min(1,void 0===s?i.alpha:s)),"alpha"===t)return!1;for(r=0;r<t.length;r++)n=Math.max(0,Math.min(o[t][r],i[t][r])),i[t][r]=Math.round(n);for(var c in a)c!==t&&(i[c]=l[t][c](i[t]));return!0},x.prototype.setSpace=function(t,e){var r=e[0];return void 0===r?this.getValues(t):("number"==typeof r&&(r=Array.prototype.slice.call(e)),this.setValues(t,r),this)},x.prototype.setChannel=function(t,e,r){var n=this.values[t];return void 0===r?n[e]:(r===n[e]||(n[e]=r,this.setValues(t,n)),this)},"undefined"!=typeof window&&(window.Color=x);var S=x;function T(t){return-1===["__proto__","prototype","constructor"].indexOf(t)}var w,_={noop:function(){},uid:(w=0,function(){return w++}),isNullOrUndef:function(t){return null==t},isArray:function(t){if(Array.isArray&&Array.isArray(t))return!0;var e=Object.prototype.toString.call(t);return"[object"===e.substr(0,7)&&"Array]"===e.substr(-6)},isObject:function(t){return null!==t&&"[object Object]"===Object.prototype.toString.call(t)},isFinite:function(t){return("number"==typeof t||t instanceof Number)&&isFinite(t)},valueOrDefault:function(t,e){return void 0===t?e:t},valueAtIndexOrDefault:function(t,e,r){return _.valueOrDefault(_.isArray(t)?t[e]:t,r)},callback:function(t,e,r){if(t&&"function"==typeof t.call)return t.apply(r,e)},each:function(t,e,r,n){var i,a,o;if(_.isArray(t))if(a=t.length,n)for(i=a-1;i>=0;i--)e.call(r,t[i],i);else for(i=0;i<a;i++)e.call(r,t[i],i);else if(_.isObject(t))for(a=(o=Object.keys(t)).length,i=0;i<a;i++)e.call(r,t[o[i]],o[i])},arrayEquals:function(t,e){var r,n,i,a;if(!t||!e||t.length!==e.length)return!1;for(r=0,n=t.length;r<n;++r)if(i=t[r],a=e[r],i instanceof Array&&a instanceof Array){if(!_.arrayEquals(i,a))return!1}else if(i!==a)return!1;return!0},clone:function(t){if(_.isArray(t))return t.map(_.clone);if(_.isObject(t)){for(var e=Object.create(t),r=Object.keys(t),n=r.length,i=0;i<n;++i)e[r[i]]=_.clone(t[r[i]]);return e}return t},_merger:function(t,e,r,n){if(T(t)){var i=e[t],a=r[t];_.isObject(i)&&_.isObject(a)?_.merge(i,a,n):e[t]=_.clone(a)}},_mergerIf:function(t,e,r){if(T(t)){var n=e[t],i=r[t];_.isObject(n)&&_.isObject(i)?_.mergeIf(n,i):e.hasOwnProperty(t)||(e[t]=_.clone(i))}},merge:function(t,e,r){var n,i,a,o,s,l=_.isArray(e)?e:[e],u=l.length;if(!_.isObject(t))return t;for(n=(r=r||{}).merger||_._merger,i=0;i<u;++i)if(e=l[i],_.isObject(e))for(s=0,o=(a=Object.keys(e)).length;s<o;++s)n(a[s],t,e,r);return t},mergeIf:function(t,e){return _.merge(t,e,{merger:_._mergerIf})},extend:Object.assign||function(t){return _.merge(t,[].slice.call(arguments,1),{merger:function(t,e,r){e[t]=r[t]}})},inherits:function(t){var e=this,r=t&&t.hasOwnProperty("constructor")?t.constructor:function(){return e.apply(this,arguments)},n=function(){this.constructor=r};return n.prototype=e.prototype,r.prototype=new n,r.extend=_.inherits,t&&_.extend(r.prototype,t),r.__super__=e.prototype,r},_deprecated:function(t,e,r,i){void 0!==e&&n.warn(t+': "'+r+'" is deprecated. Please use "'+i+'" instead')}},A=_;_.callCallback=_.callback,_.indexOf=function(t,e,r){return Array.prototype.indexOf.call(t,e,r)},_.getValueOrDefault=_.valueOrDefault,_.getValueAtIndexOrDefault=_.valueAtIndexOrDefault;var k={linear:function(t){return t},easeInQuad:function(t){return t*t},easeOutQuad:function(t){return-t*(t-2)},easeInOutQuad:function(t){return(t/=.5)<1?.5*t*t:-.5*(--t*(t-2)-1)},easeInCubic:function(t){return t*t*t},easeOutCubic:function(t){return(t-=1)*t*t+1},easeInOutCubic:function(t){return(t/=.5)<1?.5*t*t*t:.5*((t-=2)*t*t+2)},easeInQuart:function(t){return t*t*t*t},easeOutQuart:function(t){return-((t-=1)*t*t*t-1)},easeInOutQuart:function(t){return(t/=.5)<1?.5*t*t*t*t:-.5*((t-=2)*t*t*t-2)},easeInQuint:function(t){return t*t*t*t*t},easeOutQuint:function(t){return(t-=1)*t*t*t*t+1},easeInOutQuint:function(t){return(t/=.5)<1?.5*t*t*t*t*t:.5*((t-=2)*t*t*t*t+2)},easeInSine:function(t){return 1-Math.cos(t*(Math.PI/2))},easeOutSine:function(t){return Math.sin(t*(Math.PI/2))},easeInOutSine:function(t){return-.5*(Math.cos(Math.PI*t)-1)},easeInExpo:function(t){return 0===t?0:Math.pow(2,10*(t-1))},easeOutExpo:function(t){return 1===t?1:1-Math.pow(2,-10*t)},easeInOutExpo:function(t){return 0===t?0:1===t?1:(t/=.5)<1?.5*Math.pow(2,10*(t-1)):.5*(2-Math.pow(2,-10*--t))},easeInCirc:function(t){return t>=1?t:-(Math.sqrt(1-t*t)-1)},easeOutCirc:function(t){return Math.sqrt(1-(t-=1)*t)},easeInOutCirc:function(t){return(t/=.5)<1?-.5*(Math.sqrt(1-t*t)-1):.5*(Math.sqrt(1-(t-=2)*t)+1)},easeInElastic:function(t){var e=1.70158,r=0,n=1;return 0===t?0:1===t?1:(r||(r=.3),n<1?(n=1,e=r/4):e=r/(2*Math.PI)*Math.asin(1/n),-n*Math.pow(2,10*(t-=1))*Math.sin((t-e)*(2*Math.PI)/r))},easeOutElastic:function(t){var e=1.70158,r=0,n=1;return 0===t?0:1===t?1:(r||(r=.3),n<1?(n=1,e=r/4):e=r/(2*Math.PI)*Math.asin(1/n),n*Math.pow(2,-10*t)*Math.sin((t-e)*(2*Math.PI)/r)+1)},easeInOutElastic:function(t){var e=1.70158,r=0,n=1;return 0===t?0:2==(t/=.5)?1:(r||(r=.45),n<1?(n=1,e=r/4):e=r/(2*Math.PI)*Math.asin(1/n),t<1?n*Math.pow(2,10*(t-=1))*Math.sin((t-e)*(2*Math.PI)/r)*-.5:n*Math.pow(2,-10*(t-=1))*Math.sin((t-e)*(2*Math.PI)/r)*.5+1)},easeInBack:function(t){var e=1.70158;return t*t*((e+1)*t-e)},easeOutBack:function(t){var e=1.70158;return(t-=1)*t*((e+1)*t+e)+1},easeInOutBack:function(t){var e=1.70158;return(t/=.5)<1?t*t*((1+(e*=1.525))*t-e)*.5:.5*((t-=2)*t*((1+(e*=1.525))*t+e)+2)},easeInBounce:function(t){return 1-k.easeOutBounce(1-t)},easeOutBounce:function(t){return t<1/2.75?7.5625*t*t:t<2/2.75?7.5625*(t-=1.5/2.75)*t+.75:t<2.5/2.75?7.5625*(t-=2.25/2.75)*t+.9375:7.5625*(t-=2.625/2.75)*t+.984375},easeInOutBounce:function(t){return t<.5?.5*k.easeInBounce(2*t):.5*k.easeOutBounce(2*t-1)+.5}},C={effects:k};A.easingEffects=k;var D=Math.PI,L=D/180,R=2*D,I=D/2,O=D/4,M=2*D/3,P={clear:function(t){t.ctx.clearRect(0,0,t.width,t.height)},roundedRect:function(t,e,r,n,i,a){if(a){var o=Math.min(a,i/2,n/2),s=e+o,l=r+o,u=e+n-o,c=r+i-o;t.moveTo(e,l),s<u&&l<c?(t.arc(s,l,o,-D,-I),t.arc(u,l,o,-I,0),t.arc(u,c,o,0,I),t.arc(s,c,o,I,D)):s<u?(t.moveTo(s,r),t.arc(u,l,o,-I,I),t.arc(s,l,o,I,D+I)):l<c?(t.arc(s,l,o,-D,0),t.arc(s,c,o,0,D)):t.arc(s,l,o,-D,D),t.closePath(),t.moveTo(e,r)}else t.rect(e,r,n,i)},drawPoint:function(t,e,r,n,i,a){var o,s,l,u,c,d=(a||0)*L;if(e&&"object"==typeof e&&("[object HTMLImageElement]"===(o=e.toString())||"[object HTMLCanvasElement]"===o))return t.save(),t.translate(n,i),t.rotate(d),t.drawImage(e,-e.width/2,-e.height/2,e.width,e.height),void t.restore();if(!(isNaN(r)||r<=0)){switch(t.beginPath(),e){default:t.arc(n,i,r,0,R),t.closePath();break;case"triangle":t.moveTo(n+Math.sin(d)*r,i-Math.cos(d)*r),d+=M,t.lineTo(n+Math.sin(d)*r,i-Math.cos(d)*r),d+=M,t.lineTo(n+Math.sin(d)*r,i-Math.cos(d)*r),t.closePath();break;case"rectRounded":u=r-(c=.516*r),s=Math.cos(d+O)*u,l=Math.sin(d+O)*u,t.arc(n-s,i-l,c,d-D,d-I),t.arc(n+l,i-s,c,d-I,d),t.arc(n+s,i+l,c,d,d+I),t.arc(n-l,i+s,c,d+I,d+D),t.closePath();break;case"rect":if(!a){u=Math.SQRT1_2*r,t.rect(n-u,i-u,2*u,2*u);break}d+=O;case"rectRot":s=Math.cos(d)*r,l=Math.sin(d)*r,t.moveTo(n-s,i-l),t.lineTo(n+l,i-s),t.lineTo(n+s,i+l),t.lineTo(n-l,i+s),t.closePath();break;case"crossRot":d+=O;case"cross":s=Math.cos(d)*r,l=Math.sin(d)*r,t.moveTo(n-s,i-l),t.lineTo(n+s,i+l),t.moveTo(n+l,i-s),t.lineTo(n-l,i+s);break;case"star":s=Math.cos(d)*r,l=Math.sin(d)*r,t.moveTo(n-s,i-l),t.lineTo(n+s,i+l),t.moveTo(n+l,i-s),t.lineTo(n-l,i+s),d+=O,s=Math.cos(d)*r,l=Math.sin(d)*r,t.moveTo(n-s,i-l),t.lineTo(n+s,i+l),t.moveTo(n+l,i-s),t.lineTo(n-l,i+s);break;case"line":s=Math.cos(d)*r,l=Math.sin(d)*r,t.moveTo(n-s,i-l),t.lineTo(n+s,i+l);break;case"dash":t.moveTo(n,i),t.lineTo(n+Math.cos(d)*r,i+Math.sin(d)*r)}t.fill(),t.stroke()}},_isPointInArea:function(t,e){var r=1e-6;return t.x>e.left-r&&t.x<e.right+r&&t.y>e.top-r&&t.y<e.bottom+r},clipArea:function(t,e){t.save(),t.beginPath(),t.rect(e.left,e.top,e.right-e.left,e.bottom-e.top),t.clip()},unclipArea:function(t){t.restore()},lineTo:function(t,e,r,n){var i=r.steppedLine;if(i){if("middle"===i){var a=(e.x+r.x)/2;t.lineTo(a,n?r.y:e.y),t.lineTo(a,n?e.y:r.y)}else"after"===i&&!n||"after"!==i&&n?t.lineTo(e.x,r.y):t.lineTo(r.x,e.y);t.lineTo(r.x,r.y)}else r.tension?t.bezierCurveTo(n?e.controlPointPreviousX:e.controlPointNextX,n?e.controlPointPreviousY:e.controlPointNextY,n?r.controlPointNextX:r.controlPointPreviousX,n?r.controlPointNextY:r.controlPointPreviousY,r.x,r.y):t.lineTo(r.x,r.y)}},F=P;A.clear=P.clear,A.drawRoundedRectangle=function(t){t.beginPath(),P.roundedRect.apply(P,arguments)};var N={_set:function(t,e){return A.merge(this[t]||(this[t]={}),e)}};N._set("global",{defaultColor:"rgba(0,0,0,0.1)",defaultFontColor:"#666",defaultFontFamily:"'Helvetica Neue', 'Helvetica', 'Arial', sans-serif",defaultFontSize:12,defaultFontStyle:"normal",defaultLineHeight:1.2,showLines:!0});var B=N,U=A.valueOrDefault;var j={toLineHeight:function(t,e){var r=(""+t).match(/^(normal|(\d+(?:\.\d+)?)(px|em|%)?)$/);if(!r||"normal"===r[1])return 1.2*e;switch(t=+r[2],r[3]){case"px":return t;case"%":t/=100}return e*t},toPadding:function(t){var e,r,n,i;return A.isObject(t)?(e=+t.top||0,r=+t.right||0,n=+t.bottom||0,i=+t.left||0):e=r=n=i=+t||0,{top:e,right:r,bottom:n,left:i,height:e+n,width:i+r}},_parseFont:function(t){var e=B.global,r=U(t.fontSize,e.defaultFontSize),n={family:U(t.fontFamily,e.defaultFontFamily),lineHeight:A.options.toLineHeight(U(t.lineHeight,e.defaultLineHeight),r),size:r,style:U(t.fontStyle,e.defaultFontStyle),weight:null,string:""};return n.string=function(t){return!t||A.isNullOrUndef(t.size)||A.isNullOrUndef(t.family)?null:(t.style?t.style+" ":"")+(t.weight?t.weight+" ":"")+t.size+"px "+t.family}(n),n},resolve:function(t,e,r,n){var i,a,o,s=!0;for(i=0,a=t.length;i<a;++i)if(void 0!==(o=t[i])&&(void 0!==e&&"function"==typeof o&&(o=o(e),s=!1),void 0!==r&&A.isArray(o)&&(o=o[r],s=!1),void 0!==o))return n&&!s&&(n.cacheable=!1),o}},H={_factorize:function(t){var e,r=[],n=Math.sqrt(t);for(e=1;e<n;e++)t%e==0&&(r.push(e),r.push(t/e));return n===(0|n)&&r.push(n),r.sort((function(t,e){return t-e})).pop(),r},log10:Math.log10||function(t){var e=Math.log(t)*Math.LOG10E,r=Math.round(e);return t===Math.pow(10,r)?r:e}},G=H;A.log10=H.log10;var z=A,V=C,W=F,K=j,Y=G,q={getRtlAdapter:function(t,e,r){return t?function(t,e){return{x:function(r){return t+t+e-r},setWidth:function(t){e=t},textAlign:function(t){return"center"===t?t:"right"===t?"left":"right"},xPlus:function(t,e){return t-e},leftForLtr:function(t,e){return t-e}}}(e,r):{x:function(t){return t},setWidth:function(t){},textAlign:function(t){return t},xPlus:function(t,e){return t+e},leftForLtr:function(t,e){return t}}},overrideTextDirection:function(t,e){var r,n;"ltr"!==e&&"rtl"!==e||(n=[(r=t.canvas.style).getPropertyValue("direction"),r.getPropertyPriority("direction")],r.setProperty("direction",e,"important"),t.prevTextDirection=n)},restoreTextDirection:function(t){var e=t.prevTextDirection;void 0!==e&&(delete t.prevTextDirection,t.canvas.style.setProperty("direction",e[0],e[1]))}};z.easing=V,z.canvas=W,z.options=K,z.math=Y,z.rtl=q;var X=function(t){z.extend(this,t),this.initialize.apply(this,arguments)};z.extend(X.prototype,{_type:void 0,initialize:function(){this.hidden=!1},pivot:function(){var t=this;return t._view||(t._view=z.extend({},t._model)),t._start={},t},transition:function(t){var e=this,r=e._model,n=e._start,i=e._view;return r&&1!==t?(i||(i=e._view={}),n||(n=e._start={}),function(t,e,r,n){var i,a,o,s,l,u,c,d,h,f=Object.keys(r);for(i=0,a=f.length;i<a;++i)if(u=r[o=f[i]],e.hasOwnProperty(o)||(e[o]=u),(s=e[o])!==u&&"_"!==o[0]){if(t.hasOwnProperty(o)||(t[o]=s),(c=typeof u)==typeof(l=t[o]))if("string"===c){if((d=S(l)).valid&&(h=S(u)).valid){e[o]=h.mix(d,n).rgbString();continue}}else if(z.isFinite(l)&&z.isFinite(u)){e[o]=l+(u-l)*n;continue}e[o]=u}}(n,i,r,t),e):(e._view=z.extend({},r),e._start=null,e)},tooltipPosition:function(){return{x:this._model.x,y:this._model.y}},hasValue:function(){return z.isNumber(this._model.x)&&z.isNumber(this._model.y)}}),X.extend=z.inherits;var $=X,Q=$.extend({chart:null,currentStep:0,numSteps:60,easing:"",render:null,onAnimationProgress:null,onAnimationComplete:null}),J=Q;Object.defineProperty(Q.prototype,"animationObject",{get:function(){return this}}),Object.defineProperty(Q.prototype,"chartInstance",{get:function(){return this.chart},set:function(t){this.chart=t}}),B._set("global",{animation:{duration:1e3,easing:"easeOutQuart",onProgress:z.noop,onComplete:z.noop}});var Z={animations:[],request:null,addAnimation:function(t,e,r,n){var i,a,o=this.animations;for(e.chart=t,e.startTime=Date.now(),e.duration=r,n||(t.animating=!0),i=0,a=o.length;i<a;++i)if(o[i].chart===t)return void(o[i]=e);o.push(e),1===o.length&&this.requestAnimationFrame()},cancelAnimation:function(t){var e=z.findIndex(this.animations,(function(e){return e.chart===t}));-1!==e&&(this.animations.splice(e,1),t.animating=!1)},requestAnimationFrame:function(){var t=this;null===t.request&&(t.request=z.requestAnimFrame.call(window,(function(){t.request=null,t.startDigest()})))},startDigest:function(){var t=this;t.advance(),t.animations.length>0&&t.requestAnimationFrame()},advance:function(){for(var t,e,r,n,i=this.animations,a=0;a<i.length;)e=(t=i[a]).chart,r=t.numSteps,n=Math.floor((Date.now()-t.startTime)/t.duration*r)+1,t.currentStep=Math.min(n,r),z.callback(t.render,[e,t],e),z.callback(t.onAnimationProgress,[t],e),t.currentStep>=r?(z.callback(t.onAnimationComplete,[t],e),e.animating=!1,i.splice(a,1)):++a}},tt=z.options.resolve,et=["push","pop","shift","splice","unshift"];function rt(t,e){var r=t._chartjs;if(r){var n=r.listeners,i=n.indexOf(e);-1!==i&&n.splice(i,1),n.length>0||(et.forEach((function(e){delete t[e]})),delete t._chartjs)}}var nt=function(t,e){this.initialize(t,e)};z.extend(nt.prototype,{datasetElementType:null,dataElementType:null,_datasetElementOptions:["backgroundColor","borderCapStyle","borderColor","borderDash","borderDashOffset","borderJoinStyle","borderWidth"],_dataElementOptions:["backgroundColor","borderColor","borderWidth","pointStyle"],initialize:function(t,e){var r=this;r.chart=t,r.index=e,r.linkScales(),r.addElements(),r._type=r.getMeta().type},updateIndex:function(t){this.index=t},linkScales:function(){var t=this,e=t.getMeta(),r=t.chart,n=r.scales,i=t.getDataset(),a=r.options.scales;null!==e.xAxisID&&e.xAxisID in n&&!i.xAxisID||(e.xAxisID=i.xAxisID||a.xAxes[0].id),null!==e.yAxisID&&e.yAxisID in n&&!i.yAxisID||(e.yAxisID=i.yAxisID||a.yAxes[0].id)},getDataset:function(){return this.chart.data.datasets[this.index]},getMeta:function(){return this.chart.getDatasetMeta(this.index)},getScaleForId:function(t){return this.chart.scales[t]},_getValueScaleId:function(){return this.getMeta().yAxisID},_getIndexScaleId:function(){return this.getMeta().xAxisID},_getValueScale:function(){return this.getScaleForId(this._getValueScaleId())},_getIndexScale:function(){return this.getScaleForId(this._getIndexScaleId())},reset:function(){this._update(!0)},destroy:function(){this._data&&rt(this._data,this)},createMetaDataset:function(){var t=this,e=t.datasetElementType;return e&&new e({_chart:t.chart,_datasetIndex:t.index})},createMetaData:function(t){var e=this,r=e.dataElementType;return r&&new r({_chart:e.chart,_datasetIndex:e.index,_index:t})},addElements:function(){var t,e,r=this,n=r.getMeta(),i=r.getDataset().data||[],a=n.data;for(t=0,e=i.length;t<e;++t)a[t]=a[t]||r.createMetaData(t);n.dataset=n.dataset||r.createMetaDataset()},addElementAndReset:function(t){var e=this.createMetaData(t);this.getMeta().data.splice(t,0,e),this.updateElement(e,t,!0)},buildOrUpdateElements:function(){var t,e,r=this,n=r.getDataset(),i=n.data||(n.data=[]);r._data!==i&&(r._data&&rt(r._data,r),i&&Object.isExtensible(i)&&(e=r,(t=i)._chartjs?t._chartjs.listeners.push(e):(Object.defineProperty(t,"_chartjs",{configurable:!0,enumerable:!1,value:{listeners:[e]}}),et.forEach((function(e){var r="onData"+e.charAt(0).toUpperCase()+e.slice(1),n=t[e];Object.defineProperty(t,e,{configurable:!0,enumerable:!1,value:function(){var e=Array.prototype.slice.call(arguments),i=n.apply(this,e);return z.each(t._chartjs.listeners,(function(t){"function"==typeof t[r]&&t[r].apply(t,e)})),i}})})))),r._data=i),r.resyncElements()},_configure:function(){var t=this;t._config=z.merge(Object.create(null),[t.chart.options.datasets[t._type],t.getDataset()],{merger:function(t,e,r){"_meta"!==t&&"data"!==t&&z._merger(t,e,r)}})},_update:function(t){var e=this;e._configure(),e._cachedDataOpts=null,e.update(t)},update:z.noop,transition:function(t){for(var e=this.getMeta(),r=e.data||[],n=r.length,i=0;i<n;++i)r[i].transition(t);e.dataset&&e.dataset.transition(t)},draw:function(){var t=this.getMeta(),e=t.data||[],r=e.length,n=0;for(t.dataset&&t.dataset.draw();n<r;++n)e[n].draw()},getStyle:function(t){var e,r=this,n=r.getMeta(),i=n.dataset;return r._configure(),i&&void 0===t?e=r._resolveDatasetElementOptions(i||{}):(t=t||0,e=r._resolveDataElementOptions(n.data[t]||{},t)),!1!==e.fill&&null!==e.fill||(e.backgroundColor=e.borderColor),e},_resolveDatasetElementOptions:function(t,e){var r,n,i,a,o=this,s=o.chart,l=o._config,u=t.custom||{},c=s.options.elements[o.datasetElementType.prototype._type]||{},d=o._datasetElementOptions,h={},f={chart:s,dataset:o.getDataset(),datasetIndex:o.index,hover:e};for(r=0,n=d.length;r<n;++r)i=d[r],a=e?"hover"+i.charAt(0).toUpperCase()+i.slice(1):i,h[i]=tt([u[a],l[a],c[a]],f);return h},_resolveDataElementOptions:function(t,e){var r=this,n=t&&t.custom,i=r._cachedDataOpts;if(i&&!n)return i;var a,o,s,l,u=r.chart,c=r._config,d=u.options.elements[r.dataElementType.prototype._type]||{},h=r._dataElementOptions,f={},p={chart:u,dataIndex:e,dataset:r.getDataset(),datasetIndex:r.index},g={cacheable:!n};if(n=n||{},z.isArray(h))for(o=0,s=h.length;o<s;++o)f[l=h[o]]=tt([n[l],c[l],d[l]],p,e,g);else for(o=0,s=(a=Object.keys(h)).length;o<s;++o)f[l=a[o]]=tt([n[l],c[h[l]],c[l],d[l]],p,e,g);return g.cacheable&&(r._cachedDataOpts=Object.freeze(f)),f},removeHoverStyle:function(t){z.merge(t._model,t.$previousStyle||{}),delete t.$previousStyle},setHoverStyle:function(t){var e=this.chart.data.datasets[t._datasetIndex],r=t._index,n=t.custom||{},i=t._model,a=z.getHoverColor;t.$previousStyle={backgroundColor:i.backgroundColor,borderColor:i.borderColor,borderWidth:i.borderWidth},i.backgroundColor=tt([n.hoverBackgroundColor,e.hoverBackgroundColor,a(i.backgroundColor)],void 0,r),i.borderColor=tt([n.hoverBorderColor,e.hoverBorderColor,a(i.borderColor)],void 0,r),i.borderWidth=tt([n.hoverBorderWidth,e.hoverBorderWidth,i.borderWidth],void 0,r)},_removeDatasetHoverStyle:function(){var t=this.getMeta().dataset;t&&this.removeHoverStyle(t)},_setDatasetHoverStyle:function(){var t,e,r,n,i,a,o=this.getMeta().dataset,s={};if(o){for(a=o._model,i=this._resolveDatasetElementOptions(o,!0),t=0,e=(n=Object.keys(i)).length;t<e;++t)s[r=n[t]]=a[r],a[r]=i[r];o.$previousStyle=s}},resyncElements:function(){var t=this,e=t.getMeta(),r=t.getDataset().data,n=e.data.length,i=r.length;i<n?e.data.splice(i,n-i):i>n&&t.insertElements(n,i-n)},insertElements:function(t,e){for(var r=0;r<e;++r)this.addElementAndReset(t+r)},onDataPush:function(){var t=arguments.length;this.insertElements(this.getDataset().data.length-t,t)},onDataPop:function(){this.getMeta().data.pop()},onDataShift:function(){this.getMeta().data.shift()},onDataSplice:function(t,e){this.getMeta().data.splice(t,e),this.insertElements(t,arguments.length-2)},onDataUnshift:function(){this.insertElements(0,arguments.length)}}),nt.extend=z.inherits;var it=nt,at=2*Math.PI;function ot(t,e){var r=e.startAngle,n=e.endAngle,i=e.pixelMargin,a=i/e.outerRadius,o=e.x,s=e.y;t.beginPath(),t.arc(o,s,e.outerRadius,r-a,n+a),e.innerRadius>i?(a=i/e.innerRadius,t.arc(o,s,e.innerRadius-i,n+a,r-a,!0)):t.arc(o,s,i,n+Math.PI/2,r-Math.PI/2),t.closePath(),t.clip()}function st(t,e,r){var n="inner"===e.borderAlign;n?(t.lineWidth=2*e.borderWidth,t.lineJoin="round"):(t.lineWidth=e.borderWidth,t.lineJoin="bevel"),r.fullCircles&&function(t,e,r,n){var i,a=r.endAngle;for(n&&(r.endAngle=r.startAngle+at,ot(t,r),r.endAngle=a,r.endAngle===r.startAngle&&r.fullCircles&&(r.endAngle+=at,r.fullCircles--)),t.beginPath(),t.arc(r.x,r.y,r.innerRadius,r.startAngle+at,r.startAngle,!0),i=0;i<r.fullCircles;++i)t.stroke();for(t.beginPath(),t.arc(r.x,r.y,e.outerRadius,r.startAngle,r.startAngle+at),i=0;i<r.fullCircles;++i)t.stroke()}(t,e,r,n),n&&ot(t,r),t.beginPath(),t.arc(r.x,r.y,e.outerRadius,r.startAngle,r.endAngle),t.arc(r.x,r.y,r.innerRadius,r.endAngle,r.startAngle,!0),t.closePath(),t.stroke()}B._set("global",{elements:{arc:{backgroundColor:B.global.defaultColor,borderColor:"#fff",borderWidth:2,borderAlign:"center"}}});var lt=$.extend({_type:"arc",inLabelRange:function(t){var e=this._view;return!!e&&Math.pow(t-e.x,2)<Math.pow(e.radius+e.hoverRadius,2)},inRange:function(t,e){var r=this._view;if(r){for(var n=z.getAngleFromPoint(r,{x:t,y:e}),i=n.angle,a=n.distance,o=r.startAngle,s=r.endAngle;s<o;)s+=at;for(;i>s;)i-=at;for(;i<o;)i+=at;var l=i>=o&&i<=s,u=a>=r.innerRadius&&a<=r.outerRadius;return l&&u}return!1},getCenterPoint:function(){var t=this._view,e=(t.startAngle+t.endAngle)/2,r=(t.innerRadius+t.outerRadius)/2;return{x:t.x+Math.cos(e)*r,y:t.y+Math.sin(e)*r}},getArea:function(){var t=this._view;return Math.PI*((t.endAngle-t.startAngle)/(2*Math.PI))*(Math.pow(t.outerRadius,2)-Math.pow(t.innerRadius,2))},tooltipPosition:function(){var t=this._view,e=t.startAngle+(t.endAngle-t.startAngle)/2,r=(t.outerRadius-t.innerRadius)/2+t.innerRadius;return{x:t.x+Math.cos(e)*r,y:t.y+Math.sin(e)*r}},draw:function(){var t,e=this._chart.ctx,r=this._view,n="inner"===r.borderAlign?.33:0,i={x:r.x,y:r.y,innerRadius:r.innerRadius,outerRadius:Math.max(r.outerRadius-n,0),pixelMargin:n,startAngle:r.startAngle,endAngle:r.endAngle,fullCircles:Math.floor(r.circumference/at)};if(e.save(),e.fillStyle=r.backgroundColor,e.strokeStyle=r.borderColor,i.fullCircles){for(i.endAngle=i.startAngle+at,e.beginPath(),e.arc(i.x,i.y,i.outerRadius,i.startAngle,i.endAngle),e.arc(i.x,i.y,i.innerRadius,i.endAngle,i.startAngle,!0),e.closePath(),t=0;t<i.fullCircles;++t)e.fill();i.endAngle=i.startAngle+r.circumference%at}e.beginPath(),e.arc(i.x,i.y,i.outerRadius,i.startAngle,i.endAngle),e.arc(i.x,i.y,i.innerRadius,i.endAngle,i.startAngle,!0),e.closePath(),e.fill(),r.borderWidth&&st(e,r,i),e.restore()}}),ut=z.valueOrDefault,ct=B.global.defaultColor;B._set("global",{elements:{line:{tension:.4,backgroundColor:ct,borderWidth:3,borderColor:ct,borderCapStyle:"butt",borderDash:[],borderDashOffset:0,borderJoinStyle:"miter",capBezierPoints:!0,fill:!0}}});var dt=$.extend({_type:"line",draw:function(){var t,e,r,n=this,i=n._view,a=n._chart.ctx,o=i.spanGaps,s=n._children.slice(),l=B.global,u=l.elements.line,c=-1,d=n._loop;if(s.length){if(n._loop){for(t=0;t<s.length;++t)if(e=z.previousItem(s,t),!s[t]._view.skip&&e._view.skip){s=s.slice(t).concat(s.slice(0,t)),d=o;break}d&&s.push(s[0])}for(a.save(),a.lineCap=i.borderCapStyle||u.borderCapStyle,a.setLineDash&&a.setLineDash(i.borderDash||u.borderDash),a.lineDashOffset=ut(i.borderDashOffset,u.borderDashOffset),a.lineJoin=i.borderJoinStyle||u.borderJoinStyle,a.lineWidth=ut(i.borderWidth,u.borderWidth),a.strokeStyle=i.borderColor||l.defaultColor,a.beginPath(),(r=s[0]._view).skip||(a.moveTo(r.x,r.y),c=0),t=1;t<s.length;++t)r=s[t]._view,e=-1===c?z.previousItem(s,t):s[c],r.skip||(c!==t-1&&!o||-1===c?a.moveTo(r.x,r.y):z.canvas.lineTo(a,e._view,r),c=t);d&&a.closePath(),a.stroke(),a.restore()}}}),ht=z.valueOrDefault,ft=B.global.defaultColor;function pt(t){var e=this._view;return!!e&&Math.abs(t-e.x)<e.radius+e.hitRadius}B._set("global",{elements:{point:{radius:3,pointStyle:"circle",backgroundColor:ft,borderColor:ft,borderWidth:1,hitRadius:1,hoverRadius:4,hoverBorderWidth:1}}});var gt=$.extend({_type:"point",inRange:function(t,e){var r=this._view;return!!r&&Math.pow(t-r.x,2)+Math.pow(e-r.y,2)<Math.pow(r.hitRadius+r.radius,2)},inLabelRange:pt,inXRange:pt,inYRange:function(t){var e=this._view;return!!e&&Math.abs(t-e.y)<e.radius+e.hitRadius},getCenterPoint:function(){var t=this._view;return{x:t.x,y:t.y}},getArea:function(){return Math.PI*Math.pow(this._view.radius,2)},tooltipPosition:function(){var t=this._view;return{x:t.x,y:t.y,padding:t.radius+t.borderWidth}},draw:function(t){var e=this._view,r=this._chart.ctx,n=e.pointStyle,i=e.rotation,a=e.radius,o=e.x,s=e.y,l=B.global,u=l.defaultColor;e.skip||(void 0===t||z.canvas._isPointInArea(e,t))&&(r.strokeStyle=e.borderColor||u,r.lineWidth=ht(e.borderWidth,l.elements.point.borderWidth),r.fillStyle=e.backgroundColor||u,z.canvas.drawPoint(r,n,a,o,s,i))}}),vt=B.global.defaultColor;function mt(t){return t&&void 0!==t.width}function yt(t){var e,r,n,i,a;return mt(t)?(a=t.width/2,e=t.x-a,r=t.x+a,n=Math.min(t.y,t.base),i=Math.max(t.y,t.base)):(a=t.height/2,e=Math.min(t.x,t.base),r=Math.max(t.x,t.base),n=t.y-a,i=t.y+a),{left:e,top:n,right:r,bottom:i}}function bt(t,e,r){return t===e?r:t===r?e:t}function Et(t,e,r){var n,i,a,o,s=t.borderWidth,l=function(t){var e=t.borderSkipped,r={};return e?(t.horizontal?t.base>t.x&&(e=bt(e,"left","right")):t.base<t.y&&(e=bt(e,"bottom","top")),r[e]=!0,r):r}(t);return z.isObject(s)?(n=+s.top||0,i=+s.right||0,a=+s.bottom||0,o=+s.left||0):n=i=a=o=+s||0,{t:l.top||n<0?0:n>r?r:n,r:l.right||i<0?0:i>e?e:i,b:l.bottom||a<0?0:a>r?r:a,l:l.left||o<0?0:o>e?e:o}}function xt(t,e,r){var n=null===e,i=null===r,a=!(!t||n&&i)&&yt(t);return a&&(n||e>=a.left&&e<=a.right)&&(i||r>=a.top&&r<=a.bottom)}B._set("global",{elements:{rectangle:{backgroundColor:vt,borderColor:vt,borderSkipped:"bottom",borderWidth:0}}});var St=$.extend({_type:"rectangle",draw:function(){var t=this._chart.ctx,e=this._view,r=function(t){var e=yt(t),r=e.right-e.left,n=e.bottom-e.top,i=Et(t,r/2,n/2);return{outer:{x:e.left,y:e.top,w:r,h:n},inner:{x:e.left+i.l,y:e.top+i.t,w:r-i.l-i.r,h:n-i.t-i.b}}}(e),n=r.outer,i=r.inner;t.fillStyle=e.backgroundColor,t.fillRect(n.x,n.y,n.w,n.h),n.w===i.w&&n.h===i.h||(t.save(),t.beginPath(),t.rect(n.x,n.y,n.w,n.h),t.clip(),t.fillStyle=e.borderColor,t.rect(i.x,i.y,i.w,i.h),t.fill("evenodd"),t.restore())},height:function(){var t=this._view;return t.base-t.y},inRange:function(t,e){return xt(this._view,t,e)},inLabelRange:function(t,e){var r=this._view;return mt(r)?xt(r,t,null):xt(r,null,e)},inXRange:function(t){return xt(this._view,t,null)},inYRange:function(t){return xt(this._view,null,t)},getCenterPoint:function(){var t,e,r=this._view;return mt(r)?(t=r.x,e=(r.y+r.base)/2):(t=(r.x+r.base)/2,e=r.y),{x:t,y:e}},getArea:function(){var t=this._view;return mt(t)?t.width*Math.abs(t.y-t.base):t.height*Math.abs(t.x-t.base)},tooltipPosition:function(){var t=this._view;return{x:t.x,y:t.y}}}),Tt={},wt=lt,_t=dt,At=gt,kt=St;Tt.Arc=wt,Tt.Line=_t,Tt.Point=At,Tt.Rectangle=kt;var Ct=z._deprecated,Dt=z.valueOrDefault;function Lt(t,e,r){var n,i,a=r.barThickness,o=e.stackCount,s=e.pixels[t],l=z.isNullOrUndef(a)?function(t,e){var r,n,i,a,o=t._length;for(i=1,a=e.length;i<a;++i)o=Math.min(o,Math.abs(e[i]-e[i-1]));for(i=0,a=t.getTicks().length;i<a;++i)n=t.getPixelForTick(i),o=i>0?Math.min(o,Math.abs(n-r)):o,r=n;return o}(e.scale,e.pixels):-1;return z.isNullOrUndef(a)?(n=l*r.categoryPercentage,i=r.barPercentage):(n=a*o,i=1),{chunk:n/o,ratio:i,start:s-n/2}}B._set("bar",{hover:{mode:"label"},scales:{xAxes:[{type:"category",offset:!0,gridLines:{offsetGridLines:!0}}],yAxes:[{type:"linear"}]}}),B._set("global",{datasets:{bar:{categoryPercentage:.8,barPercentage:.9}}});var Rt=it.extend({dataElementType:Tt.Rectangle,_dataElementOptions:["backgroundColor","borderColor","borderSkipped","borderWidth","barPercentage","barThickness","categoryPercentage","maxBarThickness","minBarLength"],initialize:function(){var t,e,r=this;it.prototype.initialize.apply(r,arguments),(t=r.getMeta()).stack=r.getDataset().stack,t.bar=!0,e=r._getIndexScale().options,Ct("bar chart",e.barPercentage,"scales.[x/y]Axes.barPercentage","dataset.barPercentage"),Ct("bar chart",e.barThickness,"scales.[x/y]Axes.barThickness","dataset.barThickness"),Ct("bar chart",e.categoryPercentage,"scales.[x/y]Axes.categoryPercentage","dataset.categoryPercentage"),Ct("bar chart",r._getValueScale().options.minBarLength,"scales.[x/y]Axes.minBarLength","dataset.minBarLength"),Ct("bar chart",e.maxBarThickness,"scales.[x/y]Axes.maxBarThickness","dataset.maxBarThickness")},update:function(t){var e,r,n=this,i=n.getMeta().data;for(n._ruler=n.getRuler(),e=0,r=i.length;e<r;++e)n.updateElement(i[e],e,t)},updateElement:function(t,e,r){var n=this,i=n.getMeta(),a=n.getDataset(),o=n._resolveDataElementOptions(t,e);t._xScale=n.getScaleForId(i.xAxisID),t._yScale=n.getScaleForId(i.yAxisID),t._datasetIndex=n.index,t._index=e,t._model={backgroundColor:o.backgroundColor,borderColor:o.borderColor,borderSkipped:o.borderSkipped,borderWidth:o.borderWidth,datasetLabel:a.label,label:n.chart.data.labels[e]},z.isArray(a.data[e])&&(t._model.borderSkipped=null),n._updateElementGeometry(t,e,r,o),t.pivot()},_updateElementGeometry:function(t,e,r,n){var i=this,a=t._model,o=i._getValueScale(),s=o.getBasePixel(),l=o.isHorizontal(),u=i._ruler||i.getRuler(),c=i.calculateBarValuePixels(i.index,e,n),d=i.calculateBarIndexPixels(i.index,e,u,n);a.horizontal=l,a.base=r?s:c.base,a.x=l?r?s:c.head:d.center,a.y=l?d.center:r?s:c.head,a.height=l?d.size:void 0,a.width=l?void 0:d.size},_getStacks:function(t){var e,r,n=this._getIndexScale(),i=n._getMatchingVisibleMetas(this._type),a=n.options.stacked,o=i.length,s=[];for(e=0;e<o&&(r=i[e],(!1===a||-1===s.indexOf(r.stack)||void 0===a&&void 0===r.stack)&&s.push(r.stack),r.index!==t);++e);return s},getStackCount:function(){return this._getStacks().length},getStackIndex:function(t,e){var r=this._getStacks(t),n=void 0!==e?r.indexOf(e):-1;return-1===n?r.length-1:n},getRuler:function(){var t,e,r=this,n=r._getIndexScale(),i=[];for(t=0,e=r.getMeta().data.length;t<e;++t)i.push(n.getPixelForValue(null,t,r.index));return{pixels:i,start:n._startPixel,end:n._endPixel,stackCount:r.getStackCount(),scale:n}},calculateBarValuePixels:function(t,e,r){var n,i,a,o,s,l,u,c=this,d=c.chart,h=c._getValueScale(),f=h.isHorizontal(),p=d.data.datasets,g=h._getMatchingVisibleMetas(c._type),v=h._parseValue(p[t].data[e]),m=r.minBarLength,y=h.options.stacked,b=c.getMeta().stack,E=void 0===v.start?0:v.max>=0&&v.min>=0?v.min:v.max,x=void 0===v.start?v.end:v.max>=0&&v.min>=0?v.max-v.min:v.min-v.max,S=g.length;if(y||void 0===y&&void 0!==b)for(n=0;n<S&&(i=g[n]).index!==t;++n)i.stack===b&&(a=void 0===(u=h._parseValue(p[i.index].data[e])).start?u.end:u.min>=0&&u.max>=0?u.max:u.min,(v.min<0&&a<0||v.max>=0&&a>0)&&(E+=a));return o=h.getPixelForValue(E),l=(s=h.getPixelForValue(E+x))-o,void 0!==m&&Math.abs(l)<m&&(l=m,s=x>=0&&!f||x<0&&f?o-m:o+m),{size:l,base:o,head:s,center:s+l/2}},calculateBarIndexPixels:function(t,e,r,n){var i="flex"===n.barThickness?function(t,e,r){var n,i=e.pixels,a=i[t],o=t>0?i[t-1]:null,s=t<i.length-1?i[t+1]:null,l=r.categoryPercentage;return null===o&&(o=a-(null===s?e.end-e.start:s-a)),null===s&&(s=a+a-o),n=a-(a-Math.min(o,s))/2*l,{chunk:Math.abs(s-o)/2*l/e.stackCount,ratio:r.barPercentage,start:n}}(e,r,n):Lt(e,r,n),a=this.getStackIndex(t,this.getMeta().stack),o=i.start+i.chunk*a+i.chunk/2,s=Math.min(Dt(n.maxBarThickness,1/0),i.chunk*i.ratio);return{base:o-s/2,head:o+s/2,center:o,size:s}},draw:function(){var t=this,e=t.chart,r=t._getValueScale(),n=t.getMeta().data,i=t.getDataset(),a=n.length,o=0;for(z.canvas.clipArea(e.ctx,e.chartArea);o<a;++o){var s=r._parseValue(i.data[o]);isNaN(s.min)||isNaN(s.max)||n[o].draw()}z.canvas.unclipArea(e.ctx)},_resolveDataElementOptions:function(){var t=this,e=z.extend({},it.prototype._resolveDataElementOptions.apply(t,arguments)),r=t._getIndexScale().options,n=t._getValueScale().options;return e.barPercentage=Dt(r.barPercentage,e.barPercentage),e.barThickness=Dt(r.barThickness,e.barThickness),e.categoryPercentage=Dt(r.categoryPercentage,e.categoryPercentage),e.maxBarThickness=Dt(r.maxBarThickness,e.maxBarThickness),e.minBarLength=Dt(n.minBarLength,e.minBarLength),e}}),It=z.valueOrDefault,Ot=z.options.resolve;B._set("bubble",{hover:{mode:"single"},scales:{xAxes:[{type:"linear",position:"bottom",id:"x-axis-0"}],yAxes:[{type:"linear",position:"left",id:"y-axis-0"}]},tooltips:{callbacks:{title:function(){return""},label:function(t,e){var r=e.datasets[t.datasetIndex].label||"",n=e.datasets[t.datasetIndex].data[t.index];return r+": ("+t.xLabel+", "+t.yLabel+", "+n.r+")"}}}});var Mt=it.extend({dataElementType:Tt.Point,_dataElementOptions:["backgroundColor","borderColor","borderWidth","hoverBackgroundColor","hoverBorderColor","hoverBorderWidth","hoverRadius","hitRadius","pointStyle","rotation"],update:function(t){var e=this,r=e.getMeta().data;z.each(r,(function(r,n){e.updateElement(r,n,t)}))},updateElement:function(t,e,r){var n=this,i=n.getMeta(),a=t.custom||{},o=n.getScaleForId(i.xAxisID),s=n.getScaleForId(i.yAxisID),l=n._resolveDataElementOptions(t,e),u=n.getDataset().data[e],c=n.index,d=r?o.getPixelForDecimal(.5):o.getPixelForValue("object"==typeof u?u:NaN,e,c),h=r?s.getBasePixel():s.getPixelForValue(u,e,c);t._xScale=o,t._yScale=s,t._options=l,t._datasetIndex=c,t._index=e,t._model={backgroundColor:l.backgroundColor,borderColor:l.borderColor,borderWidth:l.borderWidth,hitRadius:l.hitRadius,pointStyle:l.pointStyle,rotation:l.rotation,radius:r?0:l.radius,skip:a.skip||isNaN(d)||isNaN(h),x:d,y:h},t.pivot()},setHoverStyle:function(t){var e=t._model,r=t._options,n=z.getHoverColor;t.$previousStyle={backgroundColor:e.backgroundColor,borderColor:e.borderColor,borderWidth:e.borderWidth,radius:e.radius},e.backgroundColor=It(r.hoverBackgroundColor,n(r.backgroundColor)),e.borderColor=It(r.hoverBorderColor,n(r.borderColor)),e.borderWidth=It(r.hoverBorderWidth,r.borderWidth),e.radius=r.radius+r.hoverRadius},_resolveDataElementOptions:function(t,e){var r=this,n=r.chart,i=r.getDataset(),a=t.custom||{},o=i.data[e]||{},s=it.prototype._resolveDataElementOptions.apply(r,arguments),l={chart:n,dataIndex:e,dataset:i,datasetIndex:r.index};return r._cachedDataOpts===s&&(s=z.extend({},s)),s.radius=Ot([a.radius,o.r,r._config.radius,n.options.elements.point.radius],l,e),s}}),Pt=z.valueOrDefault,Ft=Math.PI,Nt=2*Ft,Bt=Ft/2;B._set("doughnut",{animation:{animateRotate:!0,animateScale:!1},hover:{mode:"single"},legendCallback:function(t){var e,r,n,i=document.createElement("ul"),a=t.data,o=a.datasets,s=a.labels;if(i.setAttribute("class",t.id+"-legend"),o.length)for(e=0,r=o[0].data.length;e<r;++e)(n=i.appendChild(document.createElement("li"))).appendChild(document.createElement("span")).style.backgroundColor=o[0].backgroundColor[e],s[e]&&n.appendChild(document.createTextNode(s[e]));return i.outerHTML},legend:{labels:{generateLabels:function(t){var e=t.data;return e.labels.length&&e.datasets.length?e.labels.map((function(r,n){var i=t.getDatasetMeta(0),a=i.controller.getStyle(n);return{text:r,fillStyle:a.backgroundColor,strokeStyle:a.borderColor,lineWidth:a.borderWidth,hidden:isNaN(e.datasets[0].data[n])||i.data[n].hidden,index:n}})):[]}},onClick:function(t,e){var r,n,i,a=e.index,o=this.chart;for(r=0,n=(o.data.datasets||[]).length;r<n;++r)(i=o.getDatasetMeta(r)).data[a]&&(i.data[a].hidden=!i.data[a].hidden);o.update()}},cutoutPercentage:50,rotation:-Bt,circumference:Nt,tooltips:{callbacks:{title:function(){return""},label:function(t,e){var r=e.labels[t.index],n=": "+e.datasets[t.datasetIndex].data[t.index];return z.isArray(r)?(r=r.slice())[0]+=n:r+=n,r}}}});var Ut=it.extend({dataElementType:Tt.Arc,linkScales:z.noop,_dataElementOptions:["backgroundColor","borderColor","borderWidth","borderAlign","hoverBackgroundColor","hoverBorderColor","hoverBorderWidth"],getRingIndex:function(t){for(var e=0,r=0;r<t;++r)this.chart.isDatasetVisible(r)&&++e;return e},update:function(t){var e,r,n,i,a=this,o=a.chart,s=o.chartArea,l=o.options,u=1,c=1,d=0,h=0,f=a.getMeta(),p=f.data,g=l.cutoutPercentage/100||0,v=l.circumference,m=a._getRingWeight(a.index);if(v<Nt){var y=l.rotation%Nt,b=(y+=y>=Ft?-Nt:y<-Ft?Nt:0)+v,E=Math.cos(y),x=Math.sin(y),S=Math.cos(b),T=Math.sin(b),w=y<=0&&b>=0||b>=Nt,_=y<=Bt&&b>=Bt||b>=Nt+Bt,A=y<=-Bt&&b>=-Bt||b>=Ft+Bt,k=y===-Ft||b>=Ft?-1:Math.min(E,E*g,S,S*g),C=A?-1:Math.min(x,x*g,T,T*g),D=w?1:Math.max(E,E*g,S,S*g),L=_?1:Math.max(x,x*g,T,T*g);u=(D-k)/2,c=(L-C)/2,d=-(D+k)/2,h=-(L+C)/2}for(n=0,i=p.length;n<i;++n)p[n]._options=a._resolveDataElementOptions(p[n],n);for(o.borderWidth=a.getMaxBorderWidth(),e=(s.right-s.left-o.borderWidth)/u,r=(s.bottom-s.top-o.borderWidth)/c,o.outerRadius=Math.max(Math.min(e,r)/2,0),o.innerRadius=Math.max(o.outerRadius*g,0),o.radiusLength=(o.outerRadius-o.innerRadius)/(a._getVisibleDatasetWeightTotal()||1),o.offsetX=d*o.outerRadius,o.offsetY=h*o.outerRadius,f.total=a.calculateTotal(),a.outerRadius=o.outerRadius-o.radiusLength*a._getRingWeightOffset(a.index),a.innerRadius=Math.max(a.outerRadius-o.radiusLength*m,0),n=0,i=p.length;n<i;++n)a.updateElement(p[n],n,t)},updateElement:function(t,e,r){var n=this,i=n.chart,a=i.chartArea,o=i.options,s=o.animation,l=(a.left+a.right)/2,u=(a.top+a.bottom)/2,c=o.rotation,d=o.rotation,h=n.getDataset(),f=r&&s.animateRotate||t.hidden?0:n.calculateCircumference(h.data[e])*(o.circumference/Nt),p=r&&s.animateScale?0:n.innerRadius,g=r&&s.animateScale?0:n.outerRadius,v=t._options||{};z.extend(t,{_datasetIndex:n.index,_index:e,_model:{backgroundColor:v.backgroundColor,borderColor:v.borderColor,borderWidth:v.borderWidth,borderAlign:v.borderAlign,x:l+i.offsetX,y:u+i.offsetY,startAngle:c,endAngle:d,circumference:f,outerRadius:g,innerRadius:p,label:z.valueAtIndexOrDefault(h.label,e,i.data.labels[e])}});var m=t._model;r&&s.animateRotate||(m.startAngle=0===e?o.rotation:n.getMeta().data[e-1]._model.endAngle,m.endAngle=m.startAngle+m.circumference),t.pivot()},calculateTotal:function(){var t,e=this.getDataset(),r=this.getMeta(),n=0;return z.each(r.data,(function(r,i){t=e.data[i],isNaN(t)||r.hidden||(n+=Math.abs(t))})),n},calculateCircumference:function(t){var e=this.getMeta().total;return e>0&&!isNaN(t)?Nt*(Math.abs(t)/e):0},getMaxBorderWidth:function(t){var e,r,n,i,a,o,s,l,u=0,c=this.chart;if(!t)for(e=0,r=c.data.datasets.length;e<r;++e)if(c.isDatasetVisible(e)){t=(n=c.getDatasetMeta(e)).data,e!==this.index&&(a=n.controller);break}if(!t)return 0;for(e=0,r=t.length;e<r;++e)i=t[e],a?(a._configure(),o=a._resolveDataElementOptions(i,e)):o=i._options,"inner"!==o.borderAlign&&(s=o.borderWidth,u=(l=o.hoverBorderWidth)>(u=s>u?s:u)?l:u);return u},setHoverStyle:function(t){var e=t._model,r=t._options,n=z.getHoverColor;t.$previousStyle={backgroundColor:e.backgroundColor,borderColor:e.borderColor,borderWidth:e.borderWidth},e.backgroundColor=Pt(r.hoverBackgroundColor,n(r.backgroundColor)),e.borderColor=Pt(r.hoverBorderColor,n(r.borderColor)),e.borderWidth=Pt(r.hoverBorderWidth,r.borderWidth)},_getRingWeightOffset:function(t){for(var e=0,r=0;r<t;++r)this.chart.isDatasetVisible(r)&&(e+=this._getRingWeight(r));return e},_getRingWeight:function(t){return Math.max(Pt(this.chart.data.datasets[t].weight,1),0)},_getVisibleDatasetWeightTotal:function(){return this._getRingWeightOffset(this.chart.data.datasets.length)}});B._set("horizontalBar",{hover:{mode:"index",axis:"y"},scales:{xAxes:[{type:"linear",position:"bottom"}],yAxes:[{type:"category",position:"left",offset:!0,gridLines:{offsetGridLines:!0}}]},elements:{rectangle:{borderSkipped:"left"}},tooltips:{mode:"index",axis:"y"}}),B._set("global",{datasets:{horizontalBar:{categoryPercentage:.8,barPercentage:.9}}});var jt=Rt.extend({_getValueScaleId:function(){return this.getMeta().xAxisID},_getIndexScaleId:function(){return this.getMeta().yAxisID}}),Ht=z.valueOrDefault,Gt=z.options.resolve,zt=z.canvas._isPointInArea;function Vt(t,e){var r=t&&t.options.ticks||{},n=r.reverse,i=void 0===r.min?e:0,a=void 0===r.max?e:0;return{start:n?a:i,end:n?i:a}}function Wt(t,e,r){var n=r/2,i=Vt(t,n),a=Vt(e,n);return{top:a.end,right:i.end,bottom:a.start,left:i.start}}function Kt(t){var e,r,n,i;return z.isObject(t)?(e=t.top,r=t.right,n=t.bottom,i=t.left):e=r=n=i=t,{top:e,right:r,bottom:n,left:i}}B._set("line",{showLines:!0,spanGaps:!1,hover:{mode:"label"},scales:{xAxes:[{type:"category",id:"x-axis-0"}],yAxes:[{type:"linear",id:"y-axis-0"}]}});var Yt=it.extend({datasetElementType:Tt.Line,dataElementType:Tt.Point,_datasetElementOptions:["backgroundColor","borderCapStyle","borderColor","borderDash","borderDashOffset","borderJoinStyle","borderWidth","cubicInterpolationMode","fill"],_dataElementOptions:{backgroundColor:"pointBackgroundColor",borderColor:"pointBorderColor",borderWidth:"pointBorderWidth",hitRadius:"pointHitRadius",hoverBackgroundColor:"pointHoverBackgroundColor",hoverBorderColor:"pointHoverBorderColor",hoverBorderWidth:"pointHoverBorderWidth",hoverRadius:"pointHoverRadius",pointStyle:"pointStyle",radius:"pointRadius",rotation:"pointRotation"},update:function(t){var e,r,n=this,i=n.getMeta(),a=i.dataset,o=i.data||[],s=n.chart.options,l=n._config,u=n._showLine=Ht(l.showLine,s.showLines);for(n._xScale=n.getScaleForId(i.xAxisID),n._yScale=n.getScaleForId(i.yAxisID),u&&(void 0!==l.tension&&void 0===l.lineTension&&(l.lineTension=l.tension),a._scale=n._yScale,a._datasetIndex=n.index,a._children=o,a._model=n._resolveDatasetElementOptions(a),a.pivot()),e=0,r=o.length;e<r;++e)n.updateElement(o[e],e,t);for(u&&0!==a._model.tension&&n.updateBezierControlPoints(),e=0,r=o.length;e<r;++e)o[e].pivot()},updateElement:function(t,e,r){var n,i,a=this,o=a.getMeta(),s=t.custom||{},l=a.getDataset(),u=a.index,c=l.data[e],d=a._xScale,h=a._yScale,f=o.dataset._model,p=a._resolveDataElementOptions(t,e);n=d.getPixelForValue("object"==typeof c?c:NaN,e,u),i=r?h.getBasePixel():a.calculatePointY(c,e,u),t._xScale=d,t._yScale=h,t._options=p,t._datasetIndex=u,t._index=e,t._model={x:n,y:i,skip:s.skip||isNaN(n)||isNaN(i),radius:p.radius,pointStyle:p.pointStyle,rotation:p.rotation,backgroundColor:p.backgroundColor,borderColor:p.borderColor,borderWidth:p.borderWidth,tension:Ht(s.tension,f?f.tension:0),steppedLine:!!f&&f.steppedLine,hitRadius:p.hitRadius}},_resolveDatasetElementOptions:function(t){var e=this,r=e._config,n=t.custom||{},i=e.chart.options,a=i.elements.line,o=it.prototype._resolveDatasetElementOptions.apply(e,arguments);return o.spanGaps=Ht(r.spanGaps,i.spanGaps),o.tension=Ht(r.lineTension,a.tension),o.steppedLine=Gt([n.steppedLine,r.steppedLine,a.stepped]),o.clip=Kt(Ht(r.clip,Wt(e._xScale,e._yScale,o.borderWidth))),o},calculatePointY:function(t,e,r){var n,i,a,o,s,l,u,c=this.chart,d=this._yScale,h=0,f=0;if(d.options.stacked){for(s=+d.getRightValue(t),u=(l=c._getSortedVisibleDatasetMetas()).length,n=0;n<u&&(a=l[n]).index!==r;++n)i=c.data.datasets[a.index],"line"===a.type&&a.yAxisID===d.id&&((o=+d.getRightValue(i.data[e]))<0?f+=o||0:h+=o||0);return s<0?d.getPixelForValue(f+s):d.getPixelForValue(h+s)}return d.getPixelForValue(t)},updateBezierControlPoints:function(){var t,e,r,n,i=this.chart,a=this.getMeta(),o=a.dataset._model,s=i.chartArea,l=a.data||[];function u(t,e,r){return Math.max(Math.min(t,r),e)}if(o.spanGaps&&(l=l.filter((function(t){return!t._model.skip}))),"monotone"===o.cubicInterpolationMode)z.splineCurveMonotone(l);else for(t=0,e=l.length;t<e;++t)r=l[t]._model,n=z.splineCurve(z.previousItem(l,t)._model,r,z.nextItem(l,t)._model,o.tension),r.controlPointPreviousX=n.previous.x,r.controlPointPreviousY=n.previous.y,r.controlPointNextX=n.next.x,r.controlPointNextY=n.next.y;if(i.options.elements.line.capBezierPoints)for(t=0,e=l.length;t<e;++t)r=l[t]._model,zt(r,s)&&(t>0&&zt(l[t-1]._model,s)&&(r.controlPointPreviousX=u(r.controlPointPreviousX,s.left,s.right),r.controlPointPreviousY=u(r.controlPointPreviousY,s.top,s.bottom)),t<l.length-1&&zt(l[t+1]._model,s)&&(r.controlPointNextX=u(r.controlPointNextX,s.left,s.right),r.controlPointNextY=u(r.controlPointNextY,s.top,s.bottom)))},draw:function(){var t,e=this,r=e.chart,n=e.getMeta(),i=n.data||[],a=r.chartArea,o=r.canvas,s=0,l=i.length;for(e._showLine&&(t=n.dataset._model.clip,z.canvas.clipArea(r.ctx,{left:!1===t.left?0:a.left-t.left,right:!1===t.right?o.width:a.right+t.right,top:!1===t.top?0:a.top-t.top,bottom:!1===t.bottom?o.height:a.bottom+t.bottom}),n.dataset.draw(),z.canvas.unclipArea(r.ctx));s<l;++s)i[s].draw(a)},setHoverStyle:function(t){var e=t._model,r=t._options,n=z.getHoverColor;t.$previousStyle={backgroundColor:e.backgroundColor,borderColor:e.borderColor,borderWidth:e.borderWidth,radius:e.radius},e.backgroundColor=Ht(r.hoverBackgroundColor,n(r.backgroundColor)),e.borderColor=Ht(r.hoverBorderColor,n(r.borderColor)),e.borderWidth=Ht(r.hoverBorderWidth,r.borderWidth),e.radius=Ht(r.hoverRadius,r.radius)}}),qt=z.options.resolve;B._set("polarArea",{scale:{type:"radialLinear",angleLines:{display:!1},gridLines:{circular:!0},pointLabels:{display:!1},ticks:{beginAtZero:!0}},animation:{animateRotate:!0,animateScale:!0},startAngle:-.5*Math.PI,legendCallback:function(t){var e,r,n,i=document.createElement("ul"),a=t.data,o=a.datasets,s=a.labels;if(i.setAttribute("class",t.id+"-legend"),o.length)for(e=0,r=o[0].data.length;e<r;++e)(n=i.appendChild(document.createElement("li"))).appendChild(document.createElement("span")).style.backgroundColor=o[0].backgroundColor[e],s[e]&&n.appendChild(document.createTextNode(s[e]));return i.outerHTML},legend:{labels:{generateLabels:function(t){var e=t.data;return e.labels.length&&e.datasets.length?e.labels.map((function(r,n){var i=t.getDatasetMeta(0),a=i.controller.getStyle(n);return{text:r,fillStyle:a.backgroundColor,strokeStyle:a.borderColor,lineWidth:a.borderWidth,hidden:isNaN(e.datasets[0].data[n])||i.data[n].hidden,index:n}})):[]}},onClick:function(t,e){var r,n,i,a=e.index,o=this.chart;for(r=0,n=(o.data.datasets||[]).length;r<n;++r)(i=o.getDatasetMeta(r)).data[a].hidden=!i.data[a].hidden;o.update()}},tooltips:{callbacks:{title:function(){return""},label:function(t,e){return e.labels[t.index]+": "+t.yLabel}}}});var Xt=it.extend({dataElementType:Tt.Arc,linkScales:z.noop,_dataElementOptions:["backgroundColor","borderColor","borderWidth","borderAlign","hoverBackgroundColor","hoverBorderColor","hoverBorderWidth"],_getIndexScaleId:function(){return this.chart.scale.id},_getValueScaleId:function(){return this.chart.scale.id},update:function(t){var e,r,n,i=this,a=i.getDataset(),o=i.getMeta(),s=i.chart.options.startAngle||0,l=i._starts=[],u=i._angles=[],c=o.data;for(i._updateRadius(),o.count=i.countVisibleElements(),e=0,r=a.data.length;e<r;e++)l[e]=s,n=i._computeAngle(e),u[e]=n,s+=n;for(e=0,r=c.length;e<r;++e)c[e]._options=i._resolveDataElementOptions(c[e],e),i.updateElement(c[e],e,t)},_updateRadius:function(){var t=this,e=t.chart,r=e.chartArea,n=e.options,i=Math.min(r.right-r.left,r.bottom-r.top);e.outerRadius=Math.max(i/2,0),e.innerRadius=Math.max(n.cutoutPercentage?e.outerRadius/100*n.cutoutPercentage:1,0),e.radiusLength=(e.outerRadius-e.innerRadius)/e.getVisibleDatasetCount(),t.outerRadius=e.outerRadius-e.radiusLength*t.index,t.innerRadius=t.outerRadius-e.radiusLength},updateElement:function(t,e,r){var n=this,i=n.chart,a=n.getDataset(),o=i.options,s=o.animation,l=i.scale,u=i.data.labels,c=l.xCenter,d=l.yCenter,h=o.startAngle,f=t.hidden?0:l.getDistanceFromCenterForValue(a.data[e]),p=n._starts[e],g=p+(t.hidden?0:n._angles[e]),v=s.animateScale?0:l.getDistanceFromCenterForValue(a.data[e]),m=t._options||{};z.extend(t,{_datasetIndex:n.index,_index:e,_scale:l,_model:{backgroundColor:m.backgroundColor,borderColor:m.borderColor,borderWidth:m.borderWidth,borderAlign:m.borderAlign,x:c,y:d,innerRadius:0,outerRadius:r?v:f,startAngle:r&&s.animateRotate?h:p,endAngle:r&&s.animateRotate?h:g,label:z.valueAtIndexOrDefault(u,e,u[e])}}),t.pivot()},countVisibleElements:function(){var t=this.getDataset(),e=this.getMeta(),r=0;return z.each(e.data,(function(e,n){isNaN(t.data[n])||e.hidden||r++})),r},setHoverStyle:function(t){var e=t._model,r=t._options,n=z.getHoverColor,i=z.valueOrDefault;t.$previousStyle={backgroundColor:e.backgroundColor,borderColor:e.borderColor,borderWidth:e.borderWidth},e.backgroundColor=i(r.hoverBackgroundColor,n(r.backgroundColor)),e.borderColor=i(r.hoverBorderColor,n(r.borderColor)),e.borderWidth=i(r.hoverBorderWidth,r.borderWidth)},_computeAngle:function(t){var e=this,r=this.getMeta().count,n=e.getDataset(),i=e.getMeta();if(isNaN(n.data[t])||i.data[t].hidden)return 0;var a={chart:e.chart,dataIndex:t,dataset:n,datasetIndex:e.index};return qt([e.chart.options.elements.arc.angle,2*Math.PI/r],a,t)}});B._set("pie",z.clone(B.doughnut)),B._set("pie",{cutoutPercentage:0});var $t=Ut,Qt=z.valueOrDefault;B._set("radar",{spanGaps:!1,scale:{type:"radialLinear"},elements:{line:{fill:"start",tension:0}}});var Jt=it.extend({datasetElementType:Tt.Line,dataElementType:Tt.Point,linkScales:z.noop,_datasetElementOptions:["backgroundColor","borderWidth","borderColor","borderCapStyle","borderDash","borderDashOffset","borderJoinStyle","fill"],_dataElementOptions:{backgroundColor:"pointBackgroundColor",borderColor:"pointBorderColor",borderWidth:"pointBorderWidth",hitRadius:"pointHitRadius",hoverBackgroundColor:"pointHoverBackgroundColor",hoverBorderColor:"pointHoverBorderColor",hoverBorderWidth:"pointHoverBorderWidth",hoverRadius:"pointHoverRadius",pointStyle:"pointStyle",radius:"pointRadius",rotation:"pointRotation"},_getIndexScaleId:function(){return this.chart.scale.id},_getValueScaleId:function(){return this.chart.scale.id},update:function(t){var e,r,n=this,i=n.getMeta(),a=i.dataset,o=i.data||[],s=n.chart.scale,l=n._config;for(void 0!==l.tension&&void 0===l.lineTension&&(l.lineTension=l.tension),a._scale=s,a._datasetIndex=n.index,a._children=o,a._loop=!0,a._model=n._resolveDatasetElementOptions(a),a.pivot(),e=0,r=o.length;e<r;++e)n.updateElement(o[e],e,t);for(n.updateBezierControlPoints(),e=0,r=o.length;e<r;++e)o[e].pivot()},updateElement:function(t,e,r){var n=this,i=t.custom||{},a=n.getDataset(),o=n.chart.scale,s=o.getPointPositionForValue(e,a.data[e]),l=n._resolveDataElementOptions(t,e),u=n.getMeta().dataset._model,c=r?o.xCenter:s.x,d=r?o.yCenter:s.y;t._scale=o,t._options=l,t._datasetIndex=n.index,t._index=e,t._model={x:c,y:d,skip:i.skip||isNaN(c)||isNaN(d),radius:l.radius,pointStyle:l.pointStyle,rotation:l.rotation,backgroundColor:l.backgroundColor,borderColor:l.borderColor,borderWidth:l.borderWidth,tension:Qt(i.tension,u?u.tension:0),hitRadius:l.hitRadius}},_resolveDatasetElementOptions:function(){var t=this,e=t._config,r=t.chart.options,n=it.prototype._resolveDatasetElementOptions.apply(t,arguments);return n.spanGaps=Qt(e.spanGaps,r.spanGaps),n.tension=Qt(e.lineTension,r.elements.line.tension),n},updateBezierControlPoints:function(){var t,e,r,n,i=this.getMeta(),a=this.chart.chartArea,o=i.data||[];function s(t,e,r){return Math.max(Math.min(t,r),e)}for(i.dataset._model.spanGaps&&(o=o.filter((function(t){return!t._model.skip}))),t=0,e=o.length;t<e;++t)r=o[t]._model,n=z.splineCurve(z.previousItem(o,t,!0)._model,r,z.nextItem(o,t,!0)._model,r.tension),r.controlPointPreviousX=s(n.previous.x,a.left,a.right),r.controlPointPreviousY=s(n.previous.y,a.top,a.bottom),r.controlPointNextX=s(n.next.x,a.left,a.right),r.controlPointNextY=s(n.next.y,a.top,a.bottom)},setHoverStyle:function(t){var e=t._model,r=t._options,n=z.getHoverColor;t.$previousStyle={backgroundColor:e.backgroundColor,borderColor:e.borderColor,borderWidth:e.borderWidth,radius:e.radius},e.backgroundColor=Qt(r.hoverBackgroundColor,n(r.backgroundColor)),e.borderColor=Qt(r.hoverBorderColor,n(r.borderColor)),e.borderWidth=Qt(r.hoverBorderWidth,r.borderWidth),e.radius=Qt(r.hoverRadius,r.radius)}});B._set("scatter",{hover:{mode:"single"},scales:{xAxes:[{id:"x-axis-1",type:"linear",position:"bottom"}],yAxes:[{id:"y-axis-1",type:"linear",position:"left"}]},tooltips:{callbacks:{title:function(){return""},label:function(t){return"("+t.xLabel+", "+t.yLabel+")"}}}}),B._set("global",{datasets:{scatter:{showLine:!1}}});var Zt={bar:Rt,bubble:Mt,doughnut:Ut,horizontalBar:jt,line:Yt,polarArea:Xt,pie:$t,radar:Jt,scatter:Yt};function te(t,e){return t.native?{x:t.x,y:t.y}:z.getRelativePosition(t,e)}function ee(t,e){var r,n,i,a,o,s,l=t._getSortedVisibleDatasetMetas();for(n=0,a=l.length;n<a;++n)for(i=0,o=(r=l[n].data).length;i<o;++i)(s=r[i])._view.skip||e(s)}function re(t,e){var r=[];return ee(t,(function(t){t.inRange(e.x,e.y)&&r.push(t)})),r}function ne(t,e,r,n){var i=Number.POSITIVE_INFINITY,a=[];return ee(t,(function(t){if(!r||t.inRange(e.x,e.y)){var o=t.getCenterPoint(),s=n(e,o);s<i?(a=[t],i=s):s===i&&a.push(t)}})),a}function ie(t){var e=-1!==t.indexOf("x"),r=-1!==t.indexOf("y");return function(t,n){var i=e?Math.abs(t.x-n.x):0,a=r?Math.abs(t.y-n.y):0;return Math.sqrt(Math.pow(i,2)+Math.pow(a,2))}}function ae(t,e,r){var n=te(e,t);r.axis=r.axis||"x";var i=ie(r.axis),a=r.intersect?re(t,n):ne(t,n,!1,i),o=[];return a.length?(t._getSortedVisibleDatasetMetas().forEach((function(t){var e=t.data[a[0]._index];e&&!e._view.skip&&o.push(e)})),o):[]}var oe={modes:{single:function(t,e){var r=te(e,t),n=[];return ee(t,(function(t){if(t.inRange(r.x,r.y))return n.push(t),n})),n.slice(0,1)},label:ae,index:ae,dataset:function(t,e,r){var n=te(e,t);r.axis=r.axis||"xy";var i=ie(r.axis),a=r.intersect?re(t,n):ne(t,n,!1,i);return a.length>0&&(a=t.getDatasetMeta(a[0]._datasetIndex).data),a},"x-axis":function(t,e){return ae(t,e,{intersect:!1})},point:function(t,e){return re(t,te(e,t))},nearest:function(t,e,r){var n=te(e,t);r.axis=r.axis||"xy";var i=ie(r.axis);return ne(t,n,r.intersect,i)},x:function(t,e,r){var n=te(e,t),i=[],a=!1;return ee(t,(function(t){t.inXRange(n.x)&&i.push(t),t.inRange(n.x,n.y)&&(a=!0)})),r.intersect&&!a&&(i=[]),i},y:function(t,e,r){var n=te(e,t),i=[],a=!1;return ee(t,(function(t){t.inYRange(n.y)&&i.push(t),t.inRange(n.x,n.y)&&(a=!0)})),r.intersect&&!a&&(i=[]),i}}},se=z.extend;function le(t,e){return z.where(t,(function(t){return t.pos===e}))}function ue(t,e){return t.sort((function(t,r){var n=e?r:t,i=e?t:r;return n.weight===i.weight?n.index-i.index:n.weight-i.weight}))}function ce(t,e,r,n){return Math.max(t[r],e[r])+Math.max(t[n],e[n])}function de(t,e,r){var n,i,a=r.box,o=t.maxPadding;if(r.size&&(t[r.pos]-=r.size),r.size=r.horizontal?a.height:a.width,t[r.pos]+=r.size,a.getPadding){var s=a.getPadding();o.top=Math.max(o.top,s.top),o.left=Math.max(o.left,s.left),o.bottom=Math.max(o.bottom,s.bottom),o.right=Math.max(o.right,s.right)}if(n=e.outerWidth-ce(o,t,"left","right"),i=e.outerHeight-ce(o,t,"top","bottom"),n!==t.w||i!==t.h){t.w=n,t.h=i;var l=r.horizontal?[n,t.w]:[i,t.h];return!(l[0]===l[1]||isNaN(l[0])&&isNaN(l[1]))}}function he(t,e){var r,n=e.maxPadding;return r={left:0,top:0,right:0,bottom:0},(t?["left","right"]:["top","bottom"]).forEach((function(t){r[t]=Math.max(e[t],n[t])})),r}function fe(t,e,r){var n,i,a,o,s,l,u=[];for(n=0,i=t.length;n<i;++n)(o=(a=t[n]).box).update(a.width||e.w,a.height||e.h,he(a.horizontal,e)),de(e,r,a)&&(l=!0,u.length&&(s=!0)),o.fullWidth||u.push(a);return s&&fe(u,e,r)||l}function pe(t,e,r){var n,i,a,o,s=r.padding,l=e.x,u=e.y;for(n=0,i=t.length;n<i;++n)o=(a=t[n]).box,a.horizontal?(o.left=o.fullWidth?s.left:e.left,o.right=o.fullWidth?r.outerWidth-s.right:e.left+e.w,o.top=u,o.bottom=u+o.height,o.width=o.right-o.left,u=o.bottom):(o.left=l,o.right=l+o.width,o.top=e.top,o.bottom=e.top+e.h,o.height=o.bottom-o.top,l=o.right);e.x=l,e.y=u}B._set("global",{layout:{padding:{top:0,right:0,bottom:0,left:0}}});var ge,ve={defaults:{},addBox:function(t,e){t.boxes||(t.boxes=[]),e.fullWidth=e.fullWidth||!1,e.position=e.position||"top",e.weight=e.weight||0,e._layers=e._layers||function(){return[{z:0,draw:function(){e.draw.apply(e,arguments)}}]},t.boxes.push(e)},removeBox:function(t,e){var r=t.boxes?t.boxes.indexOf(e):-1;-1!==r&&t.boxes.splice(r,1)},configure:function(t,e,r){for(var n,i=["fullWidth","position","weight"],a=i.length,o=0;o<a;++o)n=i[o],r.hasOwnProperty(n)&&(e[n]=r[n])},update:function(t,e,r){if(t){var n=t.options.layout||{},i=z.options.toPadding(n.padding),a=e-i.width,o=r-i.height,s=function(t){var e=function(t){var e,r,n,i=[];for(e=0,r=(t||[]).length;e<r;++e)n=t[e],i.push({index:e,box:n,pos:n.position,horizontal:n.isHorizontal(),weight:n.weight});return i}(t),r=ue(le(e,"left"),!0),n=ue(le(e,"right")),i=ue(le(e,"top"),!0),a=ue(le(e,"bottom"));return{leftAndTop:r.concat(i),rightAndBottom:n.concat(a),chartArea:le(e,"chartArea"),vertical:r.concat(n),horizontal:i.concat(a)}}(t.boxes),l=s.vertical,u=s.horizontal,c=Object.freeze({outerWidth:e,outerHeight:r,padding:i,availableWidth:a,vBoxMaxWidth:a/2/l.length,hBoxMaxHeight:o/2}),d=se({maxPadding:se({},i),w:a,h:o,x:i.left,y:i.top},i);(function(t,e){var r,n,i;for(r=0,n=t.length;r<n;++r)(i=t[r]).width=i.horizontal?i.box.fullWidth&&e.availableWidth:e.vBoxMaxWidth,i.height=i.horizontal&&e.hBoxMaxHeight})(l.concat(u),c),fe(l,d,c),fe(u,d,c)&&fe(l,d,c),function(t){var e=t.maxPadding;function r(r){var n=Math.max(e[r]-t[r],0);return t[r]+=n,n}t.y+=r("top"),t.x+=r("left"),r("right"),r("bottom")}(d),pe(s.leftAndTop,d,c),d.x+=d.w,d.y+=d.h,pe(s.rightAndBottom,d,c),t.chartArea={left:d.left,top:d.top,right:d.left+d.w,bottom:d.top+d.h},z.each(s.chartArea,(function(e){var r=e.box;se(r,t.chartArea),r.update(d.w,d.h)}))}}},me=(ge=Object.freeze({__proto__:null,default:"/*\r\n * DOM element rendering detection\r\n * https://davidwalsh.name/detect-node-insertion\r\n */\r\n@keyframes chartjs-render-animation {\r\n\tfrom { opacity: 0.99; }\r\n\tto { opacity: 1; }\r\n}\r\n\r\n.chartjs-render-monitor {\r\n\tanimation: chartjs-render-animation 0.001s;\r\n}\r\n\r\n/*\r\n * DOM element resizing detection\r\n * https://github.com/marcj/css-element-queries\r\n */\r\n.chartjs-size-monitor,\r\n.chartjs-size-monitor-expand,\r\n.chartjs-size-monitor-shrink {\r\n\tposition: absolute;\r\n\tdirection: ltr;\r\n\tleft: 0;\r\n\ttop: 0;\r\n\tright: 0;\r\n\tbottom: 0;\r\n\toverflow: hidden;\r\n\tpointer-events: none;\r\n\tvisibility: hidden;\r\n\tz-index: -1;\r\n}\r\n\r\n.chartjs-size-monitor-expand > div {\r\n\tposition: absolute;\r\n\twidth: 1000000px;\r\n\theight: 1000000px;\r\n\tleft: 0;\r\n\ttop: 0;\r\n}\r\n\r\n.chartjs-size-monitor-shrink > div {\r\n\tposition: absolute;\r\n\twidth: 200%;\r\n\theight: 200%;\r\n\tleft: 0;\r\n\ttop: 0;\r\n}\r\n"}))&&ge.default||ge,ye="$chartjs",be="chartjs-",Ee=be+"size-monitor",xe=be+"render-monitor",Se=be+"render-animation",Te=["animationstart","webkitAnimationStart"],we={touchstart:"mousedown",touchmove:"mousemove",touchend:"mouseup",pointerenter:"mouseenter",pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointerleave:"mouseout",pointerout:"mouseout"};function _e(t,e){var r=z.getStyle(t,e),n=r&&r.match(/^(\d+)(\.\d+)?px$/);return n?Number(n[1]):void 0}var Ae=!!function(){var t=!1;try{var e=Object.defineProperty({},"passive",{get:function(){t=!0}});window.addEventListener("e",null,e)}catch(t){}return t}()&&{passive:!0};function ke(t,e,r){t.addEventListener(e,r,Ae)}function Ce(t,e,r){t.removeEventListener(e,r,Ae)}function De(t,e,r,n,i){return{type:t,chart:e,native:i||null,x:void 0!==r?r:null,y:void 0!==n?n:null}}function Le(t){var e=document.createElement("div");return e.className=t||"",e}function Re(t,e,r){var n,i,a,o,s=t[ye]||(t[ye]={}),l=s.resizer=function(t){var e=1e6,r=Le(Ee),n=Le(Ee+"-expand"),i=Le(Ee+"-shrink");n.appendChild(Le()),i.appendChild(Le()),r.appendChild(n),r.appendChild(i),r._reset=function(){n.scrollLeft=e,n.scrollTop=e,i.scrollLeft=e,i.scrollTop=e};var a=function(){r._reset(),t()};return ke(n,"scroll",a.bind(n,"expand")),ke(i,"scroll",a.bind(i,"shrink")),r}((n=function(){if(s.resizer){var n=r.options.maintainAspectRatio&&t.parentNode,i=n?n.clientWidth:0;e(De("resize",r)),n&&n.clientWidth<i&&r.canvas&&e(De("resize",r))}},a=!1,o=[],function(){o=Array.prototype.slice.call(arguments),i=i||this,a||(a=!0,z.requestAnimFrame.call(window,(function(){a=!1,n.apply(i,o)})))}));!function(t,e){var r=t[ye]||(t[ye]={}),n=r.renderProxy=function(t){t.animationName===Se&&e()};z.each(Te,(function(e){ke(t,e,n)})),r.reflow=!!t.offsetParent,t.classList.add(xe)}(t,(function(){if(s.resizer){var e=t.parentNode;e&&e!==l.parentNode&&e.insertBefore(l,e.firstChild),l._reset()}}))}function Ie(t){var e=t[ye]||{},r=e.resizer;delete e.resizer,function(t){var e=t[ye]||{},r=e.renderProxy;r&&(z.each(Te,(function(e){Ce(t,e,r)})),delete e.renderProxy),t.classList.remove(xe)}(t),r&&r.parentNode&&r.parentNode.removeChild(r)}var Oe={disableCSSInjection:!1,_enabled:"undefined"!=typeof window&&"undefined"!=typeof document,_ensureLoaded:function(t){if(!this.disableCSSInjection){var e=t.getRootNode?t.getRootNode():document;!function(t,e){var r=t[ye]||(t[ye]={});if(!r.containsStyles){r.containsStyles=!0,e="/* Chart.js */\n"+e;var n=document.createElement("style");n.setAttribute("type","text/css"),n.appendChild(document.createTextNode(e)),t.appendChild(n)}}(e.host?e:document.head,me)}},acquireContext:function(t,e){"string"==typeof t?t=document.getElementById(t):t.length&&(t=t[0]),t&&t.canvas&&(t=t.canvas);var r=t&&t.getContext&&t.getContext("2d");return r&&r.canvas===t?(this._ensureLoaded(t),function(t,e){var r=t.style,n=t.getAttribute("height"),i=t.getAttribute("width");if(t[ye]={initial:{height:n,width:i,style:{display:r.display,height:r.height,width:r.width}}},r.display=r.display||"block",null===i||""===i){var a=_e(t,"width");void 0!==a&&(t.width=a)}if(null===n||""===n)if(""===t.style.height)t.height=t.width/(e.options.aspectRatio||2);else{var o=_e(t,"height");void 0!==a&&(t.height=o)}}(t,e),r):null},releaseContext:function(t){var e=t.canvas;if(e[ye]){var r=e[ye].initial;["height","width"].forEach((function(t){var n=r[t];z.isNullOrUndef(n)?e.removeAttribute(t):e.setAttribute(t,n)})),z.each(r.style||{},(function(t,r){e.style[r]=t})),e.width=e.width,delete e[ye]}},addEventListener:function(t,e,r){var n=t.canvas;if("resize"!==e){var i=r[ye]||(r[ye]={});ke(n,e,(i.proxies||(i.proxies={}))[t.id+"_"+e]=function(e){r(function(t,e){var r=we[t.type]||t.type,n=z.getRelativePosition(t,e);return De(r,e,n.x,n.y,t)}(e,t))})}else Re(n,r,t)},removeEventListener:function(t,e,r){var n=t.canvas;if("resize"!==e){var i=((r[ye]||{}).proxies||{})[t.id+"_"+e];i&&Ce(n,e,i)}else Ie(n)}};z.addEvent=ke,z.removeEvent=Ce;var Me=Oe._enabled?Oe:{acquireContext:function(t){return t&&t.canvas&&(t=t.canvas),t&&t.getContext("2d")||null}},Pe=z.extend({initialize:function(){},acquireContext:function(){},releaseContext:function(){},addEventListener:function(){},removeEventListener:function(){}},Me);B._set("global",{plugins:{}});var Fe={_plugins:[],_cacheId:0,register:function(t){var e=this._plugins;[].concat(t).forEach((function(t){-1===e.indexOf(t)&&e.push(t)})),this._cacheId++},unregister:function(t){var e=this._plugins;[].concat(t).forEach((function(t){var r=e.indexOf(t);-1!==r&&e.splice(r,1)})),this._cacheId++},clear:function(){this._plugins=[],this._cacheId++},count:function(){return this._plugins.length},getAll:function(){return this._plugins},notify:function(t,e,r){var n,i,a,o,s,l=this.descriptors(t),u=l.length;for(n=0;n<u;++n)if("function"==typeof(s=(a=(i=l[n]).plugin)[e])&&((o=[t].concat(r||[])).push(i.options),!1===s.apply(a,o)))return!1;return!0},descriptors:function(t){var e=t.$plugins||(t.$plugins={});if(e.id===this._cacheId)return e.descriptors;var r=[],n=[],i=t&&t.config||{},a=i.options&&i.options.plugins||{};return this._plugins.concat(i.plugins||[]).forEach((function(t){if(-1===r.indexOf(t)){var e=t.id,i=a[e];!1!==i&&(!0===i&&(i=z.clone(B.global.plugins[e])),r.push(t),n.push({plugin:t,options:i||{}}))}})),e.descriptors=n,e.id=this._cacheId,n},_invalidate:function(t){delete t.$plugins}},Ne={constructors:{},defaults:{},registerScaleType:function(t,e,r){this.constructors[t]=e,this.defaults[t]=z.clone(r)},getScaleConstructor:function(t){return this.constructors.hasOwnProperty(t)?this.constructors[t]:void 0},getScaleDefaults:function(t){return this.defaults.hasOwnProperty(t)?z.merge(Object.create(null),[B.scale,this.defaults[t]]):{}},updateScaleDefaults:function(t,e){var r=this;r.defaults.hasOwnProperty(t)&&(r.defaults[t]=z.extend(r.defaults[t],e))},addScalesToLayout:function(t){z.each(t.scales,(function(e){e.fullWidth=e.options.fullWidth,e.position=e.options.position,e.weight=e.options.weight,ve.addBox(t,e)}))}},Be=z.valueOrDefault,Ue=z.rtl.getRtlAdapter;B._set("global",{tooltips:{enabled:!0,custom:null,mode:"nearest",position:"average",intersect:!0,backgroundColor:"rgba(0,0,0,0.8)",titleFontStyle:"bold",titleSpacing:2,titleMarginBottom:6,titleFontColor:"#fff",titleAlign:"left",bodySpacing:2,bodyFontColor:"#fff",bodyAlign:"left",footerFontStyle:"bold",footerSpacing:2,footerMarginTop:6,footerFontColor:"#fff",footerAlign:"left",yPadding:6,xPadding:6,caretPadding:2,caretSize:5,cornerRadius:6,multiKeyBackground:"#fff",displayColors:!0,borderColor:"rgba(0,0,0,0)",borderWidth:0,callbacks:{beforeTitle:z.noop,title:function(t,e){var r="",n=e.labels,i=n?n.length:0;if(t.length>0){var a=t[0];a.label?r=a.label:a.xLabel?r=a.xLabel:i>0&&a.index<i&&(r=n[a.index])}return r},afterTitle:z.noop,beforeBody:z.noop,beforeLabel:z.noop,label:function(t,e){var r=e.datasets[t.datasetIndex].label||"";return r&&(r+=": "),z.isNullOrUndef(t.value)?r+=t.yLabel:r+=t.value,r},labelColor:function(t,e){var r=e.getDatasetMeta(t.datasetIndex).data[t.index]._view;return{borderColor:r.borderColor,backgroundColor:r.backgroundColor}},labelTextColor:function(){return this._options.bodyFontColor},afterLabel:z.noop,afterBody:z.noop,beforeFooter:z.noop,footer:z.noop,afterFooter:z.noop}}});var je={average:function(t){if(!t.length)return!1;var e,r,n=0,i=0,a=0;for(e=0,r=t.length;e<r;++e){var o=t[e];if(o&&o.hasValue()){var s=o.tooltipPosition();n+=s.x,i+=s.y,++a}}return{x:n/a,y:i/a}},nearest:function(t,e){var r,n,i,a=e.x,o=e.y,s=Number.POSITIVE_INFINITY;for(r=0,n=t.length;r<n;++r){var l=t[r];if(l&&l.hasValue()){var u=l.getCenterPoint(),c=z.distanceBetweenPoints(e,u);c<s&&(s=c,i=l)}}if(i){var d=i.tooltipPosition();a=d.x,o=d.y}return{x:a,y:o}}};function He(t,e){return e&&(z.isArray(e)?Array.prototype.push.apply(t,e):t.push(e)),t}function Ge(t){return("string"==typeof t||t instanceof String)&&t.indexOf("\n")>-1?t.split("\n"):t}function ze(t){var e=B.global;return{xPadding:t.xPadding,yPadding:t.yPadding,xAlign:t.xAlign,yAlign:t.yAlign,rtl:t.rtl,textDirection:t.textDirection,bodyFontColor:t.bodyFontColor,_bodyFontFamily:Be(t.bodyFontFamily,e.defaultFontFamily),_bodyFontStyle:Be(t.bodyFontStyle,e.defaultFontStyle),_bodyAlign:t.bodyAlign,bodyFontSize:Be(t.bodyFontSize,e.defaultFontSize),bodySpacing:t.bodySpacing,titleFontColor:t.titleFontColor,_titleFontFamily:Be(t.titleFontFamily,e.defaultFontFamily),_titleFontStyle:Be(t.titleFontStyle,e.defaultFontStyle),titleFontSize:Be(t.titleFontSize,e.defaultFontSize),_titleAlign:t.titleAlign,titleSpacing:t.titleSpacing,titleMarginBottom:t.titleMarginBottom,footerFontColor:t.footerFontColor,_footerFontFamily:Be(t.footerFontFamily,e.defaultFontFamily),_footerFontStyle:Be(t.footerFontStyle,e.defaultFontStyle),footerFontSize:Be(t.footerFontSize,e.defaultFontSize),_footerAlign:t.footerAlign,footerSpacing:t.footerSpacing,footerMarginTop:t.footerMarginTop,caretSize:t.caretSize,cornerRadius:t.cornerRadius,backgroundColor:t.backgroundColor,opacity:0,legendColorBackground:t.multiKeyBackground,displayColors:t.displayColors,borderColor:t.borderColor,borderWidth:t.borderWidth}}function Ve(t,e){return"center"===e?t.x+t.width/2:"right"===e?t.x+t.width-t.xPadding:t.x+t.xPadding}function We(t){return He([],Ge(t))}var Ke=$.extend({initialize:function(){this._model=ze(this._options),this._lastActive=[]},getTitle:function(){var t=this,e=t._options.callbacks,r=e.beforeTitle.apply(t,arguments),n=e.title.apply(t,arguments),i=e.afterTitle.apply(t,arguments),a=[];return a=He(a,Ge(r)),a=He(a,Ge(n)),He(a,Ge(i))},getBeforeBody:function(){return We(this._options.callbacks.beforeBody.apply(this,arguments))},getBody:function(t,e){var r=this,n=r._options.callbacks,i=[];return z.each(t,(function(t){var a={before:[],lines:[],after:[]};He(a.before,Ge(n.beforeLabel.call(r,t,e))),He(a.lines,n.label.call(r,t,e)),He(a.after,Ge(n.afterLabel.call(r,t,e))),i.push(a)})),i},getAfterBody:function(){return We(this._options.callbacks.afterBody.apply(this,arguments))},getFooter:function(){var t=this,e=t._options.callbacks,r=e.beforeFooter.apply(t,arguments),n=e.footer.apply(t,arguments),i=e.afterFooter.apply(t,arguments),a=[];return a=He(a,Ge(r)),a=He(a,Ge(n)),He(a,Ge(i))},update:function(t){var e,r,n,i,a,o,s,l,u,c,d=this,h=d._options,f=d._model,p=d._model=ze(h),g=d._active,v=d._data,m={xAlign:f.xAlign,yAlign:f.yAlign},y={x:f.x,y:f.y},b={width:f.width,height:f.height},E={x:f.caretX,y:f.caretY};if(g.length){p.opacity=1;var x=[],S=[];E=je[h.position].call(d,g,d._eventPosition);var T=[];for(e=0,r=g.length;e<r;++e)T.push((n=g[e],i=void 0,a=void 0,o=void 0,s=void 0,l=void 0,u=void 0,c=void 0,i=n._xScale,a=n._yScale||n._scale,o=n._index,s=n._datasetIndex,l=n._chart.getDatasetMeta(s).controller,u=l._getIndexScale(),c=l._getValueScale(),{xLabel:i?i.getLabelForIndex(o,s):"",yLabel:a?a.getLabelForIndex(o,s):"",label:u?""+u.getLabelForIndex(o,s):"",value:c?""+c.getLabelForIndex(o,s):"",index:o,datasetIndex:s,x:n._model.x,y:n._model.y}));h.filter&&(T=T.filter((function(t){return h.filter(t,v)}))),h.itemSort&&(T=T.sort((function(t,e){return h.itemSort(t,e,v)}))),z.each(T,(function(t){x.push(h.callbacks.labelColor.call(d,t,d._chart)),S.push(h.callbacks.labelTextColor.call(d,t,d._chart))})),p.title=d.getTitle(T,v),p.beforeBody=d.getBeforeBody(T,v),p.body=d.getBody(T,v),p.afterBody=d.getAfterBody(T,v),p.footer=d.getFooter(T,v),p.x=E.x,p.y=E.y,p.caretPadding=h.caretPadding,p.labelColors=x,p.labelTextColors=S,p.dataPoints=T,y=function(t,e,r,n){var i=t.x,a=t.y,o=t.caretSize,s=t.caretPadding,l=t.cornerRadius,u=r.xAlign,c=r.yAlign,d=o+s,h=l+s;return"right"===u?i-=e.width:"center"===u&&((i-=e.width/2)+e.width>n.width&&(i=n.width-e.width),i<0&&(i=0)),"top"===c?a+=d:a-="bottom"===c?e.height+d:e.height/2,"center"===c?"left"===u?i+=d:"right"===u&&(i-=d):"left"===u?i-=h:"right"===u&&(i+=h),{x:i,y:a}}(p,b=function(t,e){var r=t._chart.ctx,n=2*e.yPadding,i=0,a=e.body,o=a.reduce((function(t,e){return t+e.before.length+e.lines.length+e.after.length}),0);o+=e.beforeBody.length+e.afterBody.length;var s=e.title.length,l=e.footer.length,u=e.titleFontSize,c=e.bodyFontSize,d=e.footerFontSize;n+=s*u,n+=s?(s-1)*e.titleSpacing:0,n+=s?e.titleMarginBottom:0,n+=o*c,n+=o?(o-1)*e.bodySpacing:0,n+=l?e.footerMarginTop:0,n+=l*d,n+=l?(l-1)*e.footerSpacing:0;var h=0,f=function(t){i=Math.max(i,r.measureText(t).width+h)};return r.font=z.fontString(u,e._titleFontStyle,e._titleFontFamily),z.each(e.title,f),r.font=z.fontString(c,e._bodyFontStyle,e._bodyFontFamily),z.each(e.beforeBody.concat(e.afterBody),f),h=e.displayColors?c+2:0,z.each(a,(function(t){z.each(t.before,f),z.each(t.lines,f),z.each(t.after,f)})),h=0,r.font=z.fontString(d,e._footerFontStyle,e._footerFontFamily),z.each(e.footer,f),{width:i+=2*e.xPadding,height:n}}(this,p),m=function(t,e){var r,n,i,a,o,s=t._model,l=t._chart,u=t._chart.chartArea,c="center",d="center";s.y<e.height?d="top":s.y>l.height-e.height&&(d="bottom");var h=(u.left+u.right)/2,f=(u.top+u.bottom)/2;"center"===d?(r=function(t){return t<=h},n=function(t){return t>h}):(r=function(t){return t<=e.width/2},n=function(t){return t>=l.width-e.width/2}),i=function(t){return t+e.width+s.caretSize+s.caretPadding>l.width},a=function(t){return t-e.width-s.caretSize-s.caretPadding<0},o=function(t){return t<=f?"top":"bottom"},r(s.x)?(c="left",i(s.x)&&(c="center",d=o(s.y))):n(s.x)&&(c="right",a(s.x)&&(c="center",d=o(s.y)));var p=t._options;return{xAlign:p.xAlign?p.xAlign:c,yAlign:p.yAlign?p.yAlign:d}}(this,b),d._chart)}else p.opacity=0;return p.xAlign=m.xAlign,p.yAlign=m.yAlign,p.x=y.x,p.y=y.y,p.width=b.width,p.height=b.height,p.caretX=E.x,p.caretY=E.y,d._model=p,t&&h.custom&&h.custom.call(d,p),d},drawCaret:function(t,e){var r=this._chart.ctx,n=this._view,i=this.getCaretPosition(t,e,n);r.lineTo(i.x1,i.y1),r.lineTo(i.x2,i.y2),r.lineTo(i.x3,i.y3)},getCaretPosition:function(t,e,r){var n,i,a,o,s,l,u=r.caretSize,c=r.cornerRadius,d=r.xAlign,h=r.yAlign,f=t.x,p=t.y,g=e.width,v=e.height;if("center"===h)s=p+v/2,"left"===d?(i=(n=f)-u,a=n,o=s+u,l=s-u):(i=(n=f+g)+u,a=n,o=s-u,l=s+u);else if("left"===d?(n=(i=f+c+u)-u,a=i+u):"right"===d?(n=(i=f+g-c-u)-u,a=i+u):(n=(i=r.caretX)-u,a=i+u),"top"===h)s=(o=p)-u,l=o;else{s=(o=p+v)+u,l=o;var m=a;a=n,n=m}return{x1:n,x2:i,x3:a,y1:o,y2:s,y3:l}},drawTitle:function(t,e,r){var n,i,a,o=e.title,s=o.length;if(s){var l=Ue(e.rtl,e.x,e.width);for(t.x=Ve(e,e._titleAlign),r.textAlign=l.textAlign(e._titleAlign),r.textBaseline="middle",n=e.titleFontSize,i=e.titleSpacing,r.fillStyle=e.titleFontColor,r.font=z.fontString(n,e._titleFontStyle,e._titleFontFamily),a=0;a<s;++a)r.fillText(o[a],l.x(t.x),t.y+n/2),t.y+=n+i,a+1===s&&(t.y+=e.titleMarginBottom-i)}},drawBody:function(t,e,r){var n,i,a,o,s,l,u,c,d=e.bodyFontSize,h=e.bodySpacing,f=e._bodyAlign,p=e.body,g=e.displayColors,v=0,m=g?Ve(e,"left"):0,y=Ue(e.rtl,e.x,e.width),b=function(e){r.fillText(e,y.x(t.x+v),t.y+d/2),t.y+=d+h},E=y.textAlign(f);for(r.textAlign=f,r.textBaseline="middle",r.font=z.fontString(d,e._bodyFontStyle,e._bodyFontFamily),t.x=Ve(e,E),r.fillStyle=e.bodyFontColor,z.each(e.beforeBody,b),v=g&&"right"!==E?"center"===f?d/2+1:d+2:0,s=0,u=p.length;s<u;++s){for(n=p[s],i=e.labelTextColors[s],a=e.labelColors[s],r.fillStyle=i,z.each(n.before,b),l=0,c=(o=n.lines).length;l<c;++l){if(g){var x=y.x(m);r.fillStyle=e.legendColorBackground,r.fillRect(y.leftForLtr(x,d),t.y,d,d),r.lineWidth=1,r.strokeStyle=a.borderColor,r.strokeRect(y.leftForLtr(x,d),t.y,d,d),r.fillStyle=a.backgroundColor,r.fillRect(y.leftForLtr(y.xPlus(x,1),d-2),t.y+1,d-2,d-2),r.fillStyle=i}b(o[l])}z.each(n.after,b)}v=0,z.each(e.afterBody,b),t.y-=h},drawFooter:function(t,e,r){var n,i,a=e.footer,o=a.length;if(o){var s=Ue(e.rtl,e.x,e.width);for(t.x=Ve(e,e._footerAlign),t.y+=e.footerMarginTop,r.textAlign=s.textAlign(e._footerAlign),r.textBaseline="middle",n=e.footerFontSize,r.fillStyle=e.footerFontColor,r.font=z.fontString(n,e._footerFontStyle,e._footerFontFamily),i=0;i<o;++i)r.fillText(a[i],s.x(t.x),t.y+n/2),t.y+=n+e.footerSpacing}},drawBackground:function(t,e,r,n){r.fillStyle=e.backgroundColor,r.strokeStyle=e.borderColor,r.lineWidth=e.borderWidth;var i=e.xAlign,a=e.yAlign,o=t.x,s=t.y,l=n.width,u=n.height,c=e.cornerRadius;r.beginPath(),r.moveTo(o+c,s),"top"===a&&this.drawCaret(t,n),r.lineTo(o+l-c,s),r.quadraticCurveTo(o+l,s,o+l,s+c),"center"===a&&"right"===i&&this.drawCaret(t,n),r.lineTo(o+l,s+u-c),r.quadraticCurveTo(o+l,s+u,o+l-c,s+u),"bottom"===a&&this.drawCaret(t,n),r.lineTo(o+c,s+u),r.quadraticCurveTo(o,s+u,o,s+u-c),"center"===a&&"left"===i&&this.drawCaret(t,n),r.lineTo(o,s+c),r.quadraticCurveTo(o,s,o+c,s),r.closePath(),r.fill(),e.borderWidth>0&&r.stroke()},draw:function(){var t=this._chart.ctx,e=this._view;if(0!==e.opacity){var r={width:e.width,height:e.height},n={x:e.x,y:e.y},i=Math.abs(e.opacity<.001)?0:e.opacity,a=e.title.length||e.beforeBody.length||e.body.length||e.afterBody.length||e.footer.length;this._options.enabled&&a&&(t.save(),t.globalAlpha=i,this.drawBackground(n,e,t,r),n.y+=e.yPadding,z.rtl.overrideTextDirection(t,e.textDirection),this.drawTitle(n,e,t),this.drawBody(n,e,t),this.drawFooter(n,e,t),z.rtl.restoreTextDirection(t,e.textDirection),t.restore())}},handleEvent:function(t){var e,r=this,n=r._options;return r._lastActive=r._lastActive||[],"mouseout"===t.type?r._active=[]:(r._active=r._chart.getElementsAtEventForMode(t,n.mode,n),n.reverse&&r._active.reverse()),(e=!z.arrayEquals(r._active,r._lastActive))&&(r._lastActive=r._active,(n.enabled||n.custom)&&(r._eventPosition={x:t.x,y:t.y},r.update(!0),r.pivot())),e}}),Ye=je,qe=Ke;qe.positioners=Ye;var Xe=z.valueOrDefault;function $e(){return z.merge(Object.create(null),[].slice.call(arguments),{merger:function(t,e,r,n){if("xAxes"===t||"yAxes"===t){var i,a,o,s=r[t].length;for(e[t]||(e[t]=[]),i=0;i<s;++i)o=r[t][i],a=Xe(o.type,"xAxes"===t?"category":"linear"),i>=e[t].length&&e[t].push({}),!e[t][i].type||o.type&&o.type!==e[t][i].type?z.merge(e[t][i],[Ne.getScaleDefaults(a),o]):z.merge(e[t][i],o)}else z._merger(t,e,r,n)}})}function Qe(){return z.merge(Object.create(null),[].slice.call(arguments),{merger:function(t,e,r,n){var i=e[t]||Object.create(null),a=r[t];"scales"===t?e[t]=$e(i,a):"scale"===t?e[t]=z.merge(i,[Ne.getScaleDefaults(a.type),a]):z._merger(t,e,r,n)}})}function Je(t){var e=t.options;z.each(t.scales,(function(e){ve.removeBox(t,e)})),e=Qe(B.global,B[t.config.type],e),t.options=t.config.options=e,t.ensureScalesHaveIDs(),t.buildOrUpdateScales(),t.tooltip._options=e.tooltips,t.tooltip.initialize()}function Ze(t,e,r){var n,i=function(t){return t.id===n};do{n=e+r++}while(z.findIndex(t,i)>=0);return n}function tr(t){return"top"===t||"bottom"===t}function er(t,e){return function(r,n){return r[t]===n[t]?r[e]-n[e]:r[t]-n[t]}}B._set("global",{elements:{},events:["mousemove","mouseout","click","touchstart","touchmove"],hover:{onHover:null,mode:"nearest",intersect:!0,animationDuration:400},onClick:null,maintainAspectRatio:!0,responsive:!0,responsiveAnimationDuration:0});var rr=function(t,e){return this.construct(t,e),this};z.extend(rr.prototype,{construct:function(t,e){var r=this;e=function(t){var e=(t=t||Object.create(null)).data=t.data||{};return e.datasets=e.datasets||[],e.labels=e.labels||[],t.options=Qe(B.global,B[t.type],t.options||{}),t}(e);var i=Pe.acquireContext(t,e),a=i&&i.canvas,o=a&&a.height,s=a&&a.width;r.id=z.uid(),r.ctx=i,r.canvas=a,r.config=e,r.width=s,r.height=o,r.aspectRatio=o?s/o:null,r.options=e.options,r._bufferedRender=!1,r._layers=[],r.chart=r,r.controller=r,rr.instances[r.id]=r,Object.defineProperty(r,"data",{get:function(){return r.config.data},set:function(t){r.config.data=t}}),i&&a?(r.initialize(),r.update()):n.error("Failed to create chart: can't acquire context from the given item")},initialize:function(){var t=this;return Fe.notify(t,"beforeInit"),z.retinaScale(t,t.options.devicePixelRatio),t.bindEvents(),t.options.responsive&&t.resize(!0),t.initToolTip(),Fe.notify(t,"afterInit"),t},clear:function(){return z.canvas.clear(this),this},stop:function(){return Z.cancelAnimation(this),this},resize:function(t){var e=this,r=e.options,n=e.canvas,i=r.maintainAspectRatio&&e.aspectRatio||null,a=Math.max(0,Math.floor(z.getMaximumWidth(n))),o=Math.max(0,Math.floor(i?a/i:z.getMaximumHeight(n)));if((e.width!==a||e.height!==o)&&(n.width=e.width=a,n.height=e.height=o,n.style.width=a+"px",n.style.height=o+"px",z.retinaScale(e,r.devicePixelRatio),!t)){var s={width:a,height:o};Fe.notify(e,"resize",[s]),r.onResize&&r.onResize(e,s),e.stop(),e.update({duration:r.responsiveAnimationDuration})}},ensureScalesHaveIDs:function(){var t=this.options,e=t.scales||{},r=t.scale;z.each(e.xAxes,(function(t,r){t.id||(t.id=Ze(e.xAxes,"x-axis-",r))})),z.each(e.yAxes,(function(t,r){t.id||(t.id=Ze(e.yAxes,"y-axis-",r))})),r&&(r.id=r.id||"scale")},buildOrUpdateScales:function(){var t=this,e=t.options,r=t.scales||{},n=[],i=Object.keys(r).reduce((function(t,e){return t[e]=!1,t}),{});e.scales&&(n=n.concat((e.scales.xAxes||[]).map((function(t){return{options:t,dtype:"category",dposition:"bottom"}})),(e.scales.yAxes||[]).map((function(t){return{options:t,dtype:"linear",dposition:"left"}})))),e.scale&&n.push({options:e.scale,dtype:"radialLinear",isDefault:!0,dposition:"chartArea"}),z.each(n,(function(e){var n=e.options,a=n.id,o=Xe(n.type,e.dtype);tr(n.position)!==tr(e.dposition)&&(n.position=e.dposition),i[a]=!0;var s=null;if(a in r&&r[a].type===o)(s=r[a]).options=n,s.ctx=t.ctx,s.chart=t;else{var l=Ne.getScaleConstructor(o);if(!l)return;s=new l({id:a,type:o,options:n,ctx:t.ctx,chart:t}),r[s.id]=s}s.mergeTicksOptions(),e.isDefault&&(t.scale=s)})),z.each(i,(function(t,e){t||delete r[e]})),t.scales=r,Ne.addScalesToLayout(this)},buildOrUpdateControllers:function(){var t,e,r=this,n=[],i=r.data.datasets;for(t=0,e=i.length;t<e;t++){var a=i[t],o=r.getDatasetMeta(t),s=a.type||r.config.type;if(o.type&&o.type!==s&&(r.destroyDatasetMeta(t),o=r.getDatasetMeta(t)),o.type=s,o.order=a.order||0,o.index=t,o.controller)o.controller.updateIndex(t),o.controller.linkScales();else{var l=Zt[o.type];if(void 0===l)throw new Error('"'+o.type+'" is not a chart type.');o.controller=new l(r,t),n.push(o.controller)}}return n},resetElements:function(){var t=this;z.each(t.data.datasets,(function(e,r){t.getDatasetMeta(r).controller.reset()}),t)},reset:function(){this.resetElements(),this.tooltip.initialize()},update:function(t){var e,r,n=this;if(t&&"object"==typeof t||(t={duration:t,lazy:arguments[1]}),Je(n),Fe._invalidate(n),!1!==Fe.notify(n,"beforeUpdate")){n.tooltip._data=n.data;var i=n.buildOrUpdateControllers();for(e=0,r=n.data.datasets.length;e<r;e++)n.getDatasetMeta(e).controller.buildOrUpdateElements();n.updateLayout(),n.options.animation&&n.options.animation.duration&&z.each(i,(function(t){t.reset()})),n.updateDatasets(),n.tooltip.initialize(),n.lastActive=[],Fe.notify(n,"afterUpdate"),n._layers.sort(er("z","_idx")),n._bufferedRender?n._bufferedRequest={duration:t.duration,easing:t.easing,lazy:t.lazy}:n.render(t)}},updateLayout:function(){var t=this;!1!==Fe.notify(t,"beforeLayout")&&(ve.update(this,this.width,this.height),t._layers=[],z.each(t.boxes,(function(e){e._configure&&e._configure(),t._layers.push.apply(t._layers,e._layers())}),t),t._layers.forEach((function(t,e){t._idx=e})),Fe.notify(t,"afterScaleUpdate"),Fe.notify(t,"afterLayout"))},updateDatasets:function(){var t=this;if(!1!==Fe.notify(t,"beforeDatasetsUpdate")){for(var e=0,r=t.data.datasets.length;e<r;++e)t.updateDataset(e);Fe.notify(t,"afterDatasetsUpdate")}},updateDataset:function(t){var e=this,r=e.getDatasetMeta(t),n={meta:r,index:t};!1!==Fe.notify(e,"beforeDatasetUpdate",[n])&&(r.controller._update(),Fe.notify(e,"afterDatasetUpdate",[n]))},render:function(t){var e=this;t&&"object"==typeof t||(t={duration:t,lazy:arguments[1]});var r=e.options.animation,n=Xe(t.duration,r&&r.duration),i=t.lazy;if(!1!==Fe.notify(e,"beforeRender")){var a=function(t){Fe.notify(e,"afterRender"),z.callback(r&&r.onComplete,[t],e)};if(r&&n){var o=new J({numSteps:n/16.66,easing:t.easing||r.easing,render:function(t,e){var r=z.easing.effects[e.easing],n=e.currentStep,i=n/e.numSteps;t.draw(r(i),i,n)},onAnimationProgress:r.onProgress,onAnimationComplete:a});Z.addAnimation(e,o,n,i)}else e.draw(),a(new J({numSteps:0,chart:e}));return e}},draw:function(t){var e,r,n=this;if(n.clear(),z.isNullOrUndef(t)&&(t=1),n.transition(t),!(n.width<=0||n.height<=0)&&!1!==Fe.notify(n,"beforeDraw",[t])){for(r=n._layers,e=0;e<r.length&&r[e].z<=0;++e)r[e].draw(n.chartArea);for(n.drawDatasets(t);e<r.length;++e)r[e].draw(n.chartArea);n._drawTooltip(t),Fe.notify(n,"afterDraw",[t])}},transition:function(t){for(var e=this,r=0,n=(e.data.datasets||[]).length;r<n;++r)e.isDatasetVisible(r)&&e.getDatasetMeta(r).controller.transition(t);e.tooltip.transition(t)},_getSortedDatasetMetas:function(t){var e,r,n=this,i=[];for(e=0,r=(n.data.datasets||[]).length;e<r;++e)t&&!n.isDatasetVisible(e)||i.push(n.getDatasetMeta(e));return i.sort(er("order","index")),i},_getSortedVisibleDatasetMetas:function(){return this._getSortedDatasetMetas(!0)},drawDatasets:function(t){var e,r,n=this;if(!1!==Fe.notify(n,"beforeDatasetsDraw",[t])){for(r=(e=n._getSortedVisibleDatasetMetas()).length-1;r>=0;--r)n.drawDataset(e[r],t);Fe.notify(n,"afterDatasetsDraw",[t])}},drawDataset:function(t,e){var r={meta:t,index:t.index,easingValue:e};!1!==Fe.notify(this,"beforeDatasetDraw",[r])&&(t.controller.draw(e),Fe.notify(this,"afterDatasetDraw",[r]))},_drawTooltip:function(t){var e=this,r=e.tooltip,n={tooltip:r,easingValue:t};!1!==Fe.notify(e,"beforeTooltipDraw",[n])&&(r.draw(),Fe.notify(e,"afterTooltipDraw",[n]))},getElementAtEvent:function(t){return oe.modes.single(this,t)},getElementsAtEvent:function(t){return oe.modes.label(this,t,{intersect:!0})},getElementsAtXAxis:function(t){return oe.modes["x-axis"](this,t,{intersect:!0})},getElementsAtEventForMode:function(t,e,r){var n=oe.modes[e];return"function"==typeof n?n(this,t,r):[]},getDatasetAtEvent:function(t){return oe.modes.dataset(this,t,{intersect:!0})},getDatasetMeta:function(t){var e=this,r=e.data.datasets[t];r._meta||(r._meta={});var n=r._meta[e.id];return n||(n=r._meta[e.id]={type:null,data:[],dataset:null,controller:null,hidden:null,xAxisID:null,yAxisID:null,order:r.order||0,index:t}),n},getVisibleDatasetCount:function(){for(var t=0,e=0,r=this.data.datasets.length;e<r;++e)this.isDatasetVisible(e)&&t++;return t},isDatasetVisible:function(t){var e=this.getDatasetMeta(t);return"boolean"==typeof e.hidden?!e.hidden:!this.data.datasets[t].hidden},generateLegend:function(){return this.options.legendCallback(this)},destroyDatasetMeta:function(t){var e=this.id,r=this.data.datasets[t],n=r._meta&&r._meta[e];n&&(n.controller.destroy(),delete r._meta[e])},destroy:function(){var t,e,r=this,n=r.canvas;for(r.stop(),t=0,e=r.data.datasets.length;t<e;++t)r.destroyDatasetMeta(t);n&&(r.unbindEvents(),z.canvas.clear(r),Pe.releaseContext(r.ctx),r.canvas=null,r.ctx=null),Fe.notify(r,"destroy"),delete rr.instances[r.id]},toBase64Image:function(){return this.canvas.toDataURL.apply(this.canvas,arguments)},initToolTip:function(){var t=this;t.tooltip=new qe({_chart:t,_chartInstance:t,_data:t.data,_options:t.options.tooltips},t)},bindEvents:function(){var t=this,e=t._listeners={},r=function(){t.eventHandler.apply(t,arguments)};z.each(t.options.events,(function(n){Pe.addEventListener(t,n,r),e[n]=r})),t.options.responsive&&(r=function(){t.resize()},Pe.addEventListener(t,"resize",r),e.resize=r)},unbindEvents:function(){var t=this,e=t._listeners;e&&(delete t._listeners,z.each(e,(function(e,r){Pe.removeEventListener(t,r,e)})))},updateHoverStyle:function(t,e,r){var n,i,a,o=r?"set":"remove";for(i=0,a=t.length;i<a;++i)(n=t[i])&&this.getDatasetMeta(n._datasetIndex).controller[o+"HoverStyle"](n);"dataset"===e&&this.getDatasetMeta(t[0]._datasetIndex).controller["_"+o+"DatasetHoverStyle"]()},eventHandler:function(t){var e=this,r=e.tooltip;if(!1!==Fe.notify(e,"beforeEvent",[t])){e._bufferedRender=!0,e._bufferedRequest=null;var n=e.handleEvent(t);r&&(n=r._start?r.handleEvent(t):n|r.handleEvent(t)),Fe.notify(e,"afterEvent",[t]);var i=e._bufferedRequest;return i?e.render(i):n&&!e.animating&&(e.stop(),e.render({duration:e.options.hover.animationDuration,lazy:!0})),e._bufferedRender=!1,e._bufferedRequest=null,e}},handleEvent:function(t){var e,r=this,n=r.options||{},i=n.hover;return r.lastActive=r.lastActive||[],"mouseout"===t.type?r.active=[]:r.active=r.getElementsAtEventForMode(t,i.mode,i),z.callback(n.onHover||n.hover.onHover,[t.native,r.active],r),"mouseup"!==t.type&&"click"!==t.type||n.onClick&&n.onClick.call(r,t.native,r.active),r.lastActive.length&&r.updateHoverStyle(r.lastActive,i.mode,!1),r.active.length&&i.mode&&r.updateHoverStyle(r.active,i.mode,!0),e=!z.arrayEquals(r.active,r.lastActive),r.lastActive=r.active,e}}),rr.instances={};var nr=rr;rr.Controller=rr,rr.types={},z.configMerge=Qe,z.scaleMerge=$e;function ir(){throw new Error("This method is not implemented: either no adapter can be found or an incomplete integration was provided.")}function ar(t){this.options=t||{}}z.extend(ar.prototype,{formats:ir,parse:ir,format:ir,add:ir,diff:ir,startOf:ir,endOf:ir,_create:function(t){return t}}),ar.override=function(t){z.extend(ar.prototype,t)};var or={_date:ar},sr={formatters:{values:function(t){return z.isArray(t)?t:""+t},linear:function(t,e,r){var n=r.length>3?r[2]-r[1]:r[1]-r[0];Math.abs(n)>1&&t!==Math.floor(t)&&(n=t-Math.floor(t));var i=z.log10(Math.abs(n)),a="";if(0!==t)if(Math.max(Math.abs(r[0]),Math.abs(r[r.length-1]))<1e-4){var o=z.log10(Math.abs(t)),s=Math.floor(o)-Math.floor(i);s=Math.max(Math.min(s,20),0),a=t.toExponential(s)}else{var l=-1*Math.floor(i);l=Math.max(Math.min(l,20),0),a=t.toFixed(l)}else a="0";return a},logarithmic:function(t,e,r){var n=t/Math.pow(10,Math.floor(z.log10(t)));return 0===t?"0":1===n||2===n||5===n||0===e||e===r.length-1?t.toExponential():""}}},lr=z.isArray,ur=z.isNullOrUndef,cr=z.valueOrDefault,dr=z.valueAtIndexOrDefault;function hr(t,e,r){var n,i=t.getTicks().length,a=Math.min(e,i-1),o=t.getPixelForTick(a),s=t._startPixel,l=t._endPixel,u=1e-6;if(!(r&&(n=1===i?Math.max(o-s,l-o):0===e?(t.getPixelForTick(1)-o)/2:(o-t.getPixelForTick(a-1))/2,(o+=a<e?n:-n)<s-u||o>l+u)))return o}function fr(t,e,r,n){var i,a,o,s,l,u,c,d,h,f,p,g,v,m=r.length,y=[],b=[],E=[],x=0,S=0;for(i=0;i<m;++i){if(s=r[i].label,l=r[i].major?e.major:e.minor,t.font=u=l.string,c=n[u]=n[u]||{data:{},gc:[]},d=l.lineHeight,h=f=0,ur(s)||lr(s)){if(lr(s))for(a=0,o=s.length;a<o;++a)p=s[a],ur(p)||lr(p)||(h=z.measureText(t,c.data,c.gc,h,p),f+=d)}else h=z.measureText(t,c.data,c.gc,h,s),f=d;y.push(h),b.push(f),E.push(d/2),x=Math.max(h,x),S=Math.max(f,S)}function T(t){return{width:y[t]||0,height:b[t]||0,offset:E[t]||0}}return function(t,e){z.each(t,(function(t){var r,n=t.gc,i=n.length/2;if(i>e){for(r=0;r<i;++r)delete t.data[n[r]];n.splice(0,i)}}))}(n,m),g=y.indexOf(x),v=b.indexOf(S),{first:T(0),last:T(m-1),widest:T(g),highest:T(v)}}function pr(t){return t.drawTicks?t.tickMarkLength:0}function gr(t){var e,r;return t.display?(e=z.options._parseFont(t),r=z.options.toPadding(t.padding),e.lineHeight+r.height):0}function vr(t,e){return z.extend(z.options._parseFont({fontFamily:cr(e.fontFamily,t.fontFamily),fontSize:cr(e.fontSize,t.fontSize),fontStyle:cr(e.fontStyle,t.fontStyle),lineHeight:cr(e.lineHeight,t.lineHeight)}),{color:z.options.resolve([e.fontColor,t.fontColor,B.global.defaultFontColor])})}function mr(t){var e=vr(t,t.minor);return{minor:e,major:t.major.enabled?vr(t,t.major):e}}function yr(t){var e,r,n,i=[];for(r=0,n=t.length;r<n;++r)void 0!==(e=t[r])._index&&i.push(e);return i}function br(t,e,r,n){var i,a,o,s,l=cr(r,0),u=Math.min(cr(n,t.length),t.length),c=0;for(e=Math.ceil(e),n&&(e=(i=n-r)/Math.floor(i/e)),s=l;s<0;)c++,s=Math.round(l+c*e);for(a=Math.max(l,0);a<u;a++)o=t[a],a===s?(o._index=a,c++,s=Math.round(l+c*e)):delete o.label}B._set("scale",{display:!0,position:"left",offset:!1,gridLines:{display:!0,color:"rgba(0,0,0,0.1)",lineWidth:1,drawBorder:!0,drawOnChartArea:!0,drawTicks:!0,tickMarkLength:10,zeroLineWidth:1,zeroLineColor:"rgba(0,0,0,0.25)",zeroLineBorderDash:[],zeroLineBorderDashOffset:0,offsetGridLines:!1,borderDash:[],borderDashOffset:0},scaleLabel:{display:!1,labelString:"",padding:{top:4,bottom:4}},ticks:{beginAtZero:!1,minRotation:0,maxRotation:50,mirror:!1,padding:0,reverse:!1,display:!0,autoSkip:!0,autoSkipPadding:0,labelOffset:0,callback:sr.formatters.values,minor:{},major:{}}});var Er=$.extend({zeroLineIndex:0,getPadding:function(){var t=this;return{left:t.paddingLeft||0,top:t.paddingTop||0,right:t.paddingRight||0,bottom:t.paddingBottom||0}},getTicks:function(){return this._ticks},_getLabels:function(){var t=this.chart.data;return this.options.labels||(this.isHorizontal()?t.xLabels:t.yLabels)||t.labels||[]},mergeTicksOptions:function(){},beforeUpdate:function(){z.callback(this.options.beforeUpdate,[this])},update:function(t,e,r){var n,i,a,o,s,l=this,u=l.options.ticks,c=u.sampleSize;if(l.beforeUpdate(),l.maxWidth=t,l.maxHeight=e,l.margins=z.extend({left:0,right:0,top:0,bottom:0},r),l._ticks=null,l.ticks=null,l._labelSizes=null,l._maxLabelLines=0,l.longestLabelWidth=0,l.longestTextCache=l.longestTextCache||{},l._gridLineItems=null,l._labelItems=null,l.beforeSetDimensions(),l.setDimensions(),l.afterSetDimensions(),l.beforeDataLimits(),l.determineDataLimits(),l.afterDataLimits(),l.beforeBuildTicks(),o=l.buildTicks()||[],(!(o=l.afterBuildTicks(o)||o)||!o.length)&&l.ticks)for(o=[],n=0,i=l.ticks.length;n<i;++n)o.push({value:l.ticks[n],major:!1});return l._ticks=o,s=c<o.length,a=l._convertTicksToLabels(s?function(t,e){for(var r=[],n=t.length/e,i=0,a=t.length;i<a;i+=n)r.push(t[Math.floor(i)]);return r}(o,c):o),l._configure(),l.beforeCalculateTickRotation(),l.calculateTickRotation(),l.afterCalculateTickRotation(),l.beforeFit(),l.fit(),l.afterFit(),l._ticksToDraw=u.display&&(u.autoSkip||"auto"===u.source)?l._autoSkip(o):o,s&&(a=l._convertTicksToLabels(l._ticksToDraw)),l.ticks=a,l.afterUpdate(),l.minSize},_configure:function(){var t,e,r=this,n=r.options.ticks.reverse;r.isHorizontal()?(t=r.left,e=r.right):(t=r.top,e=r.bottom,n=!n),r._startPixel=t,r._endPixel=e,r._reversePixels=n,r._length=e-t},afterUpdate:function(){z.callback(this.options.afterUpdate,[this])},beforeSetDimensions:function(){z.callback(this.options.beforeSetDimensions,[this])},setDimensions:function(){var t=this;t.isHorizontal()?(t.width=t.maxWidth,t.left=0,t.right=t.width):(t.height=t.maxHeight,t.top=0,t.bottom=t.height),t.paddingLeft=0,t.paddingTop=0,t.paddingRight=0,t.paddingBottom=0},afterSetDimensions:function(){z.callback(this.options.afterSetDimensions,[this])},beforeDataLimits:function(){z.callback(this.options.beforeDataLimits,[this])},determineDataLimits:z.noop,afterDataLimits:function(){z.callback(this.options.afterDataLimits,[this])},beforeBuildTicks:function(){z.callback(this.options.beforeBuildTicks,[this])},buildTicks:z.noop,afterBuildTicks:function(t){var e=this;return lr(t)&&t.length?z.callback(e.options.afterBuildTicks,[e,t]):(e.ticks=z.callback(e.options.afterBuildTicks,[e,e.ticks])||e.ticks,t)},beforeTickToLabelConversion:function(){z.callback(this.options.beforeTickToLabelConversion,[this])},convertTicksToLabels:function(){var t=this,e=t.options.ticks;t.ticks=t.ticks.map(e.userCallback||e.callback,this)},afterTickToLabelConversion:function(){z.callback(this.options.afterTickToLabelConversion,[this])},beforeCalculateTickRotation:function(){z.callback(this.options.beforeCalculateTickRotation,[this])},calculateTickRotation:function(){var t,e,r,n,i,a,o,s=this,l=s.options,u=l.ticks,c=s.getTicks().length,d=u.minRotation||0,h=u.maxRotation,f=d;!s._isVisible()||!u.display||d>=h||c<=1||!s.isHorizontal()?s.labelRotation=d:(e=(t=s._getLabelSizes()).widest.width,r=t.highest.height-t.highest.offset,n=Math.min(s.maxWidth,s.chart.width-e),e+6>(i=l.offset?s.maxWidth/c:n/(c-1))&&(i=n/(c-(l.offset?.5:1)),a=s.maxHeight-pr(l.gridLines)-u.padding-gr(l.scaleLabel),o=Math.sqrt(e*e+r*r),f=z.toDegrees(Math.min(Math.asin(Math.min((t.highest.height+6)/i,1)),Math.asin(Math.min(a/o,1))-Math.asin(r/o))),f=Math.max(d,Math.min(h,f))),s.labelRotation=f)},afterCalculateTickRotation:function(){z.callback(this.options.afterCalculateTickRotation,[this])},beforeFit:function(){z.callback(this.options.beforeFit,[this])},fit:function(){var t=this,e=t.minSize={width:0,height:0},r=t.chart,n=t.options,i=n.ticks,a=n.scaleLabel,o=n.gridLines,s=t._isVisible(),l="bottom"===n.position,u=t.isHorizontal();if(u?e.width=t.maxWidth:s&&(e.width=pr(o)+gr(a)),u?s&&(e.height=pr(o)+gr(a)):e.height=t.maxHeight,i.display&&s){var c=mr(i),d=t._getLabelSizes(),h=d.first,f=d.last,p=d.widest,g=d.highest,v=.4*c.minor.lineHeight,m=i.padding;if(u){var y=0!==t.labelRotation,b=z.toRadians(t.labelRotation),E=Math.cos(b),x=Math.sin(b),S=x*p.width+E*(g.height-(y?g.offset:0))+(y?0:v);e.height=Math.min(t.maxHeight,e.height+S+m);var T,w,_=t.getPixelForTick(0)-t.left,A=t.right-t.getPixelForTick(t.getTicks().length-1);y?(T=l?E*h.width+x*h.offset:x*(h.height-h.offset),w=l?x*(f.height-f.offset):E*f.width+x*f.offset):(T=h.width/2,w=f.width/2),t.paddingLeft=Math.max((T-_)*t.width/(t.width-_),0)+3,t.paddingRight=Math.max((w-A)*t.width/(t.width-A),0)+3}else{var k=i.mirror?0:p.width+m+v;e.width=Math.min(t.maxWidth,e.width+k),t.paddingTop=h.height/2,t.paddingBottom=f.height/2}}t.handleMargins(),u?(t.width=t._length=r.width-t.margins.left-t.margins.right,t.height=e.height):(t.width=e.width,t.height=t._length=r.height-t.margins.top-t.margins.bottom)},handleMargins:function(){var t=this;t.margins&&(t.margins.left=Math.max(t.paddingLeft,t.margins.left),t.margins.top=Math.max(t.paddingTop,t.margins.top),t.margins.right=Math.max(t.paddingRight,t.margins.right),t.margins.bottom=Math.max(t.paddingBottom,t.margins.bottom))},afterFit:function(){z.callback(this.options.afterFit,[this])},isHorizontal:function(){var t=this.options.position;return"top"===t||"bottom"===t},isFullWidth:function(){return this.options.fullWidth},getRightValue:function(t){if(ur(t))return NaN;if(("number"==typeof t||t instanceof Number)&&!isFinite(t))return NaN;if(t)if(this.isHorizontal()){if(void 0!==t.x)return this.getRightValue(t.x)}else if(void 0!==t.y)return this.getRightValue(t.y);return t},_convertTicksToLabels:function(t){var e,r,n,i=this;for(i.ticks=t.map((function(t){return t.value})),i.beforeTickToLabelConversion(),e=i.convertTicksToLabels(t)||i.ticks,i.afterTickToLabelConversion(),r=0,n=t.length;r<n;++r)t[r].label=e[r];return e},_getLabelSizes:function(){var t=this,e=t._labelSizes;return e||(t._labelSizes=e=fr(t.ctx,mr(t.options.ticks),t.getTicks(),t.longestTextCache),t.longestLabelWidth=e.widest.width),e},_parseValue:function(t){var e,r,n,i;return lr(t)?(e=+this.getRightValue(t[0]),r=+this.getRightValue(t[1]),n=Math.min(e,r),i=Math.max(e,r)):(e=void 0,r=t=+this.getRightValue(t),n=t,i=t),{min:n,max:i,start:e,end:r}},_getScaleLabel:function(t){var e=this._parseValue(t);return void 0!==e.start?"["+e.start+", "+e.end+"]":+this.getRightValue(t)},getLabelForIndex:z.noop,getPixelForValue:z.noop,getValueForPixel:z.noop,getPixelForTick:function(t){var e=this,r=e.options.offset,n=e._ticks.length,i=1/Math.max(n-(r?0:1),1);return t<0||t>n-1?null:e.getPixelForDecimal(t*i+(r?i/2:0))},getPixelForDecimal:function(t){var e=this;return e._reversePixels&&(t=1-t),e._startPixel+t*e._length},getDecimalForPixel:function(t){var e=(t-this._startPixel)/this._length;return this._reversePixels?1-e:e},getBasePixel:function(){return this.getPixelForValue(this.getBaseValue())},getBaseValue:function(){var t=this,e=t.min,r=t.max;return t.beginAtZero?0:e<0&&r<0?r:e>0&&r>0?e:0},_autoSkip:function(t){var e,r,n,i,a=this,o=a.options.ticks,s=a._length,l=o.maxTicksLimit||s/a._tickSize()+1,u=o.major.enabled?function(t){var e,r,n=[];for(e=0,r=t.length;e<r;e++)t[e].major&&n.push(e);return n}(t):[],c=u.length,d=u[0],h=u[c-1];if(c>l)return function(t,e,r){var n,i,a=0,o=e[0];for(r=Math.ceil(r),n=0;n<t.length;n++)i=t[n],n===o?(i._index=n,o=e[++a*r]):delete i.label}(t,u,c/l),yr(t);if(n=function(t,e,r,n){var i,a,o,s,l=function(t){var e,r,n=t.length;if(n<2)return!1;for(r=t[0],e=1;e<n;++e)if(t[e]-t[e-1]!==r)return!1;return r}(t),u=(e.length-1)/n;if(!l)return Math.max(u,1);for(o=0,s=(i=z.math._factorize(l)).length-1;o<s;o++)if((a=i[o])>u)return a;return Math.max(u,1)}(u,t,0,l),c>0){for(e=0,r=c-1;e<r;e++)br(t,n,u[e],u[e+1]);return i=c>1?(h-d)/(c-1):null,br(t,n,z.isNullOrUndef(i)?0:d-i,d),br(t,n,h,z.isNullOrUndef(i)?t.length:h+i),yr(t)}return br(t,n),yr(t)},_tickSize:function(){var t=this,e=t.options.ticks,r=z.toRadians(t.labelRotation),n=Math.abs(Math.cos(r)),i=Math.abs(Math.sin(r)),a=t._getLabelSizes(),o=e.autoSkipPadding||0,s=a?a.widest.width+o:0,l=a?a.highest.height+o:0;return t.isHorizontal()?l*n>s*i?s/n:l/i:l*i<s*n?l/n:s/i},_isVisible:function(){var t,e,r,n=this,i=n.chart,a=n.options.display;if("auto"!==a)return!!a;for(t=0,e=i.data.datasets.length;t<e;++t)if(i.isDatasetVisible(t)&&((r=i.getDatasetMeta(t)).xAxisID===n.id||r.yAxisID===n.id))return!0;return!1},_computeGridLineItems:function(t){var e,r,n,i,a,o,s,l,u,c,d,h,f,p,g,v,m,y=this,b=y.chart,E=y.options,x=E.gridLines,S=E.position,T=x.offsetGridLines,w=y.isHorizontal(),_=y._ticksToDraw,A=_.length+(T?1:0),k=pr(x),C=[],D=x.drawBorder?dr(x.lineWidth,0,0):0,L=D/2,R=z._alignPixel,I=function(t){return R(b,t,D)};for("top"===S?(e=I(y.bottom),s=y.bottom-k,u=e-L,d=I(t.top)+L,f=t.bottom):"bottom"===S?(e=I(y.top),d=t.top,f=I(t.bottom)-L,s=e+L,u=y.top+k):"left"===S?(e=I(y.right),o=y.right-k,l=e-L,c=I(t.left)+L,h=t.right):(e=I(y.left),c=t.left,h=I(t.right)-L,o=e+L,l=y.left+k),r=0;r<A;++r)n=_[r]||{},ur(n.label)&&r<_.length||(r===y.zeroLineIndex&&E.offset===T?(p=x.zeroLineWidth,g=x.zeroLineColor,v=x.zeroLineBorderDash||[],m=x.zeroLineBorderDashOffset||0):(p=dr(x.lineWidth,r,1),g=dr(x.color,r,"rgba(0,0,0,0.1)"),v=x.borderDash||[],m=x.borderDashOffset||0),void 0!==(i=hr(y,n._index||r,T))&&(a=R(b,i,p),w?o=l=c=h=a:s=u=d=f=a,C.push({tx1:o,ty1:s,tx2:l,ty2:u,x1:c,y1:d,x2:h,y2:f,width:p,color:g,borderDash:v,borderDashOffset:m})));return C.ticksLength=A,C.borderValue=e,C},_computeLabelItems:function(){var t,e,r,n,i,a,o,s,l,u,c,d,h=this,f=h.options,p=f.ticks,g=f.position,v=p.mirror,m=h.isHorizontal(),y=h._ticksToDraw,b=mr(p),E=p.padding,x=pr(f.gridLines),S=-z.toRadians(h.labelRotation),T=[];for("top"===g?(a=h.bottom-x-E,o=S?"left":"center"):"bottom"===g?(a=h.top+x+E,o=S?"right":"center"):"left"===g?(i=h.right-(v?0:x)-E,o=v?"left":"right"):(i=h.left+(v?0:x)+E,o=v?"right":"left"),t=0,e=y.length;t<e;++t)n=(r=y[t]).label,ur(n)||(s=h.getPixelForTick(r._index||t)+p.labelOffset,u=(l=r.major?b.major:b.minor).lineHeight,c=lr(n)?n.length:1,m?(i=s,d="top"===g?((S?1:.5)-c)*u:(S?0:.5)*u):(a=s,d=(1-c)*u/2),T.push({x:i,y:a,rotation:S,label:n,font:l,textOffset:d,textAlign:o}));return T},_drawGrid:function(t){var e=this,r=e.options.gridLines;if(r.display){var n,i,a,o,s,l=e.ctx,u=e.chart,c=z._alignPixel,d=r.drawBorder?dr(r.lineWidth,0,0):0,h=e._gridLineItems||(e._gridLineItems=e._computeGridLineItems(t));for(a=0,o=h.length;a<o;++a)n=(s=h[a]).width,i=s.color,n&&i&&(l.save(),l.lineWidth=n,l.strokeStyle=i,l.setLineDash&&(l.setLineDash(s.borderDash),l.lineDashOffset=s.borderDashOffset),l.beginPath(),r.drawTicks&&(l.moveTo(s.tx1,s.ty1),l.lineTo(s.tx2,s.ty2)),r.drawOnChartArea&&(l.moveTo(s.x1,s.y1),l.lineTo(s.x2,s.y2)),l.stroke(),l.restore());if(d){var f,p,g,v,m=d,y=dr(r.lineWidth,h.ticksLength-1,1),b=h.borderValue;e.isHorizontal()?(f=c(u,e.left,m)-m/2,p=c(u,e.right,y)+y/2,g=v=b):(g=c(u,e.top,m)-m/2,v=c(u,e.bottom,y)+y/2,f=p=b),l.lineWidth=d,l.strokeStyle=dr(r.color,0),l.beginPath(),l.moveTo(f,g),l.lineTo(p,v),l.stroke()}}},_drawLabels:function(){var t=this;if(t.options.ticks.display){var e,r,n,i,a,o,s,l,u=t.ctx,c=t._labelItems||(t._labelItems=t._computeLabelItems());for(e=0,n=c.length;e<n;++e){if(o=(a=c[e]).font,u.save(),u.translate(a.x,a.y),u.rotate(a.rotation),u.font=o.string,u.fillStyle=o.color,u.textBaseline="middle",u.textAlign=a.textAlign,s=a.label,l=a.textOffset,lr(s))for(r=0,i=s.length;r<i;++r)u.fillText(""+s[r],0,l),l+=o.lineHeight;else u.fillText(s,0,l);u.restore()}}},_drawTitle:function(){var t=this,e=t.ctx,r=t.options,n=r.scaleLabel;if(n.display){var i,a,o=cr(n.fontColor,B.global.defaultFontColor),s=z.options._parseFont(n),l=z.options.toPadding(n.padding),u=s.lineHeight/2,c=r.position,d=0;if(t.isHorizontal())i=t.left+t.width/2,a="bottom"===c?t.bottom-u-l.bottom:t.top+u+l.top;else{var h="left"===c;i=h?t.left+u+l.top:t.right-u-l.top,a=t.top+t.height/2,d=h?-.5*Math.PI:.5*Math.PI}e.save(),e.translate(i,a),e.rotate(d),e.textAlign="center",e.textBaseline="middle",e.fillStyle=o,e.font=s.string,e.fillText(n.labelString,0,0),e.restore()}},draw:function(t){var e=this;e._isVisible()&&(e._drawGrid(t),e._drawTitle(),e._drawLabels())},_layers:function(){var t=this,e=t.options,r=e.ticks&&e.ticks.z||0,n=e.gridLines&&e.gridLines.z||0;return t._isVisible()&&r!==n&&t.draw===t._draw?[{z:n,draw:function(){t._drawGrid.apply(t,arguments),t._drawTitle.apply(t,arguments)}},{z:r,draw:function(){t._drawLabels.apply(t,arguments)}}]:[{z:r,draw:function(){t.draw.apply(t,arguments)}}]},_getMatchingVisibleMetas:function(t){var e=this,r=e.isHorizontal();return e.chart._getSortedVisibleDatasetMetas().filter((function(n){return(!t||n.type===t)&&(r?n.xAxisID===e.id:n.yAxisID===e.id)}))}});Er.prototype._draw=Er.prototype.draw;var xr=Er,Sr=z.isNullOrUndef,Tr=xr.extend({determineDataLimits:function(){var t,e=this,r=e._getLabels(),n=e.options.ticks,i=n.min,a=n.max,o=0,s=r.length-1;void 0!==i&&(t=r.indexOf(i))>=0&&(o=t),void 0!==a&&(t=r.indexOf(a))>=0&&(s=t),e.minIndex=o,e.maxIndex=s,e.min=r[o],e.max=r[s]},buildTicks:function(){var t=this,e=t._getLabels(),r=t.minIndex,n=t.maxIndex;t.ticks=0===r&&n===e.length-1?e:e.slice(r,n+1)},getLabelForIndex:function(t,e){var r=this,n=r.chart;return n.getDatasetMeta(e).controller._getValueScaleId()===r.id?r.getRightValue(n.data.datasets[e].data[t]):r._getLabels()[t]},_configure:function(){var t=this,e=t.options.offset,r=t.ticks;xr.prototype._configure.call(t),t.isHorizontal()||(t._reversePixels=!t._reversePixels),r&&(t._startValue=t.minIndex-(e?.5:0),t._valueRange=Math.max(r.length-(e?0:1),1))},getPixelForValue:function(t,e,r){var n,i,a,o=this;return Sr(e)||Sr(r)||(t=o.chart.data.datasets[r].data[e]),Sr(t)||(n=o.isHorizontal()?t.x:t.y),(void 0!==n||void 0!==t&&isNaN(e))&&(i=o._getLabels(),t=z.valueOrDefault(n,t),e=-1!==(a=i.indexOf(t))?a:e,isNaN(e)&&(e=t)),o.getPixelForDecimal((e-o._startValue)/o._valueRange)},getPixelForTick:function(t){var e=this.ticks;return t<0||t>e.length-1?null:this.getPixelForValue(e[t],t+this.minIndex)},getValueForPixel:function(t){var e=this,r=Math.round(e._startValue+e.getDecimalForPixel(t)*e._valueRange);return Math.min(Math.max(r,0),e.ticks.length-1)},getBasePixel:function(){return this.bottom}}),wr={position:"bottom"};Tr._defaults=wr;var _r=z.noop,Ar=z.isNullOrUndef;var kr=xr.extend({getRightValue:function(t){return"string"==typeof t?+t:xr.prototype.getRightValue.call(this,t)},handleTickRangeOptions:function(){var t=this,e=t.options.ticks;if(e.beginAtZero){var r=z.sign(t.min),n=z.sign(t.max);r<0&&n<0?t.max=0:r>0&&n>0&&(t.min=0)}var i=void 0!==e.min||void 0!==e.suggestedMin,a=void 0!==e.max||void 0!==e.suggestedMax;void 0!==e.min?t.min=e.min:void 0!==e.suggestedMin&&(null===t.min?t.min=e.suggestedMin:t.min=Math.min(t.min,e.suggestedMin)),void 0!==e.max?t.max=e.max:void 0!==e.suggestedMax&&(null===t.max?t.max=e.suggestedMax:t.max=Math.max(t.max,e.suggestedMax)),i!==a&&t.min>=t.max&&(i?t.max=t.min+1:t.min=t.max-1),t.min===t.max&&(t.max++,e.beginAtZero||t.min--)},getTickLimit:function(){var t,e=this,r=e.options.ticks,n=r.stepSize,i=r.maxTicksLimit;return n?t=Math.ceil(e.max/n)-Math.floor(e.min/n)+1:(t=e._computeTickLimit(),i=i||11),i&&(t=Math.min(i,t)),t},_computeTickLimit:function(){return Number.POSITIVE_INFINITY},handleDirectionalChanges:_r,buildTicks:function(){var t=this,e=t.options.ticks,r=t.getTickLimit(),n={maxTicks:r=Math.max(2,r),min:e.min,max:e.max,precision:e.precision,stepSize:z.valueOrDefault(e.fixedStepSize,e.stepSize)},i=t.ticks=function(t,e){var r,n,i,a,o=[],s=t.stepSize,l=s||1,u=t.maxTicks-1,c=t.min,d=t.max,h=t.precision,f=e.min,p=e.max,g=z.niceNum((p-f)/u/l)*l;if(g<1e-14&&Ar(c)&&Ar(d))return[f,p];(a=Math.ceil(p/g)-Math.floor(f/g))>u&&(g=z.niceNum(a*g/u/l)*l),s||Ar(h)?r=Math.pow(10,z._decimalPlaces(g)):(r=Math.pow(10,h),g=Math.ceil(g*r)/r),n=Math.floor(f/g)*g,i=Math.ceil(p/g)*g,s&&(!Ar(c)&&z.almostWhole(c/g,g/1e3)&&(n=c),!Ar(d)&&z.almostWhole(d/g,g/1e3)&&(i=d)),a=(i-n)/g,a=z.almostEquals(a,Math.round(a),g/1e3)?Math.round(a):Math.ceil(a),n=Math.round(n*r)/r,i=Math.round(i*r)/r,o.push(Ar(c)?n:c);for(var v=1;v<a;++v)o.push(Math.round((n+v*g)*r)/r);return o.push(Ar(d)?i:d),o}(n,t);t.handleDirectionalChanges(),t.max=z.max(i),t.min=z.min(i),e.reverse?(i.reverse(),t.start=t.max,t.end=t.min):(t.start=t.min,t.end=t.max)},convertTicksToLabels:function(){var t=this;t.ticksAsNumbers=t.ticks.slice(),t.zeroLineIndex=t.ticks.indexOf(0),xr.prototype.convertTicksToLabels.call(t)},_configure:function(){var t,e=this,r=e.getTicks(),n=e.min,i=e.max;xr.prototype._configure.call(e),e.options.offset&&r.length&&(n-=t=(i-n)/Math.max(r.length-1,1)/2,i+=t),e._startValue=n,e._endValue=i,e._valueRange=i-n}}),Cr={position:"left",ticks:{callback:sr.formatters.linear}};function Dr(t,e,r,n){var i,a,o=t.options,s=function(t,e,r){var n=[r.type,void 0===e&&void 0===r.stack?r.index:"",r.stack].join(".");return void 0===t[n]&&(t[n]={pos:[],neg:[]}),t[n]}(e,o.stacked,r),l=s.pos,u=s.neg,c=n.length;for(i=0;i<c;++i)a=t._parseValue(n[i]),isNaN(a.min)||isNaN(a.max)||r.data[i].hidden||(l[i]=l[i]||0,u[i]=u[i]||0,o.relativePoints?l[i]=100:a.min<0||a.max<0?u[i]+=a.min:l[i]+=a.max)}function Lr(t,e,r){var n,i,a=r.length;for(n=0;n<a;++n)i=t._parseValue(r[n]),isNaN(i.min)||isNaN(i.max)||e.data[n].hidden||(t.min=Math.min(t.min,i.min),t.max=Math.max(t.max,i.max))}var Rr=kr.extend({determineDataLimits:function(){var t,e,r,n,i=this,a=i.options,o=i.chart.data.datasets,s=i._getMatchingVisibleMetas(),l=a.stacked,u={},c=s.length;if(i.min=Number.POSITIVE_INFINITY,i.max=Number.NEGATIVE_INFINITY,void 0===l)for(t=0;!l&&t<c;++t)l=void 0!==(e=s[t]).stack;for(t=0;t<c;++t)r=o[(e=s[t]).index].data,l?Dr(i,u,e,r):Lr(i,e,r);z.each(u,(function(t){n=t.pos.concat(t.neg),i.min=Math.min(i.min,z.min(n)),i.max=Math.max(i.max,z.max(n))})),i.min=z.isFinite(i.min)&&!isNaN(i.min)?i.min:0,i.max=z.isFinite(i.max)&&!isNaN(i.max)?i.max:1,i.handleTickRangeOptions()},_computeTickLimit:function(){var t,e=this;return e.isHorizontal()?Math.ceil(e.width/40):(t=z.options._parseFont(e.options.ticks),Math.ceil(e.height/t.lineHeight))},handleDirectionalChanges:function(){this.isHorizontal()||this.ticks.reverse()},getLabelForIndex:function(t,e){return this._getScaleLabel(this.chart.data.datasets[e].data[t])},getPixelForValue:function(t){var e=this;return e.getPixelForDecimal((+e.getRightValue(t)-e._startValue)/e._valueRange)},getValueForPixel:function(t){return this._startValue+this.getDecimalForPixel(t)*this._valueRange},getPixelForTick:function(t){var e=this.ticksAsNumbers;return t<0||t>e.length-1?null:this.getPixelForValue(e[t])}}),Ir=Cr;Rr._defaults=Ir;var Or=z.valueOrDefault,Mr=z.math.log10;var Pr={position:"left",ticks:{callback:sr.formatters.logarithmic}};function Fr(t,e){return z.isFinite(t)&&t>=0?t:e}var Nr=xr.extend({determineDataLimits:function(){var t,e,r,n,i,a,o=this,s=o.options,l=o.chart,u=l.data.datasets,c=o.isHorizontal();function d(t){return c?t.xAxisID===o.id:t.yAxisID===o.id}o.min=Number.POSITIVE_INFINITY,o.max=Number.NEGATIVE_INFINITY,o.minNotZero=Number.POSITIVE_INFINITY;var h=s.stacked;if(void 0===h)for(t=0;t<u.length;t++)if(e=l.getDatasetMeta(t),l.isDatasetVisible(t)&&d(e)&&void 0!==e.stack){h=!0;break}if(s.stacked||h){var f={};for(t=0;t<u.length;t++){var p=[(e=l.getDatasetMeta(t)).type,void 0===s.stacked&&void 0===e.stack?t:"",e.stack].join(".");if(l.isDatasetVisible(t)&&d(e))for(void 0===f[p]&&(f[p]=[]),i=0,a=(n=u[t].data).length;i<a;i++){var g=f[p];r=o._parseValue(n[i]),isNaN(r.min)||isNaN(r.max)||e.data[i].hidden||r.min<0||r.max<0||(g[i]=g[i]||0,g[i]+=r.max)}}z.each(f,(function(t){if(t.length>0){var e=z.min(t),r=z.max(t);o.min=Math.min(o.min,e),o.max=Math.max(o.max,r)}}))}else for(t=0;t<u.length;t++)if(e=l.getDatasetMeta(t),l.isDatasetVisible(t)&&d(e))for(i=0,a=(n=u[t].data).length;i<a;i++)r=o._parseValue(n[i]),isNaN(r.min)||isNaN(r.max)||e.data[i].hidden||r.min<0||r.max<0||(o.min=Math.min(r.min,o.min),o.max=Math.max(r.max,o.max),0!==r.min&&(o.minNotZero=Math.min(r.min,o.minNotZero)));o.min=z.isFinite(o.min)?o.min:null,o.max=z.isFinite(o.max)?o.max:null,o.minNotZero=z.isFinite(o.minNotZero)?o.minNotZero:null,this.handleTickRangeOptions()},handleTickRangeOptions:function(){var t=this,e=t.options.ticks;t.min=Fr(e.min,t.min),t.max=Fr(e.max,t.max),t.min===t.max&&(0!==t.min&&null!==t.min?(t.min=Math.pow(10,Math.floor(Mr(t.min))-1),t.max=Math.pow(10,Math.floor(Mr(t.max))+1)):(t.min=1,t.max=10)),null===t.min&&(t.min=Math.pow(10,Math.floor(Mr(t.max))-1)),null===t.max&&(t.max=0!==t.min?Math.pow(10,Math.floor(Mr(t.min))+1):10),null===t.minNotZero&&(t.min>0?t.minNotZero=t.min:t.max<1?t.minNotZero=Math.pow(10,Math.floor(Mr(t.max))):t.minNotZero=1)},buildTicks:function(){var t=this,e=t.options.ticks,r=!t.isHorizontal(),n={min:Fr(e.min),max:Fr(e.max)},i=t.ticks=function(t,e){var r,n,i=[],a=Or(t.min,Math.pow(10,Math.floor(Mr(e.min)))),o=Math.floor(Mr(e.max)),s=Math.ceil(e.max/Math.pow(10,o));0===a?(r=Math.floor(Mr(e.minNotZero)),n=Math.floor(e.minNotZero/Math.pow(10,r)),i.push(a),a=n*Math.pow(10,r)):(r=Math.floor(Mr(a)),n=Math.floor(a/Math.pow(10,r)));var l=r<0?Math.pow(10,Math.abs(r)):1;do{i.push(a),10==++n&&(n=1,l=++r>=0?1:l),a=Math.round(n*Math.pow(10,r)*l)/l}while(r<o||r===o&&n<s);var u=Or(t.max,a);return i.push(u),i}(n,t);t.max=z.max(i),t.min=z.min(i),e.reverse?(r=!r,t.start=t.max,t.end=t.min):(t.start=t.min,t.end=t.max),r&&i.reverse()},convertTicksToLabels:function(){this.tickValues=this.ticks.slice(),xr.prototype.convertTicksToLabels.call(this)},getLabelForIndex:function(t,e){return this._getScaleLabel(this.chart.data.datasets[e].data[t])},getPixelForTick:function(t){var e=this.tickValues;return t<0||t>e.length-1?null:this.getPixelForValue(e[t])},_getFirstTickValue:function(t){var e=Math.floor(Mr(t));return Math.floor(t/Math.pow(10,e))*Math.pow(10,e)},_configure:function(){var t=this,e=t.min,r=0;xr.prototype._configure.call(t),0===e&&(e=t._getFirstTickValue(t.minNotZero),r=Or(t.options.ticks.fontSize,B.global.defaultFontSize)/t._length),t._startValue=Mr(e),t._valueOffset=r,t._valueRange=(Mr(t.max)-Mr(e))/(1-r)},getPixelForValue:function(t){var e=this,r=0;return(t=+e.getRightValue(t))>e.min&&t>0&&(r=(Mr(t)-e._startValue)/e._valueRange+e._valueOffset),e.getPixelForDecimal(r)},getValueForPixel:function(t){var e=this,r=e.getDecimalForPixel(t);return 0===r&&0===e.min?0:Math.pow(10,e._startValue+(r-e._valueOffset)*e._valueRange)}}),Br=Pr;Nr._defaults=Br;var Ur=z.valueOrDefault,jr=z.valueAtIndexOrDefault,Hr=z.options.resolve,Gr={display:!0,animate:!0,position:"chartArea",angleLines:{display:!0,color:"rgba(0,0,0,0.1)",lineWidth:1,borderDash:[],borderDashOffset:0},gridLines:{circular:!1},ticks:{showLabelBackdrop:!0,backdropColor:"rgba(255,255,255,0.75)",backdropPaddingY:2,backdropPaddingX:2,callback:sr.formatters.linear},pointLabels:{display:!0,fontSize:10,callback:function(t){return t}}};function zr(t){var e=t.ticks;return e.display&&t.display?Ur(e.fontSize,B.global.defaultFontSize)+2*e.backdropPaddingY:0}function Vr(t,e,r,n,i){return t===n||t===i?{start:e-r/2,end:e+r/2}:t<n||t>i?{start:e-r,end:e}:{start:e,end:e+r}}function Wr(t){return 0===t||180===t?"center":t<180?"left":"right"}function Kr(t,e,r,n){var i,a,o=r.y+n/2;if(z.isArray(e))for(i=0,a=e.length;i<a;++i)t.fillText(e[i],r.x,o),o+=n;else t.fillText(e,r.x,o)}function Yr(t,e,r){90===t||270===t?r.y-=e.h/2:(t>270||t<90)&&(r.y-=e.h)}function qr(t){return z.isNumber(t)?t:0}var Xr=kr.extend({setDimensions:function(){var t=this;t.width=t.maxWidth,t.height=t.maxHeight,t.paddingTop=zr(t.options)/2,t.xCenter=Math.floor(t.width/2),t.yCenter=Math.floor((t.height-t.paddingTop)/2),t.drawingArea=Math.min(t.height-t.paddingTop,t.width)/2},determineDataLimits:function(){var t=this,e=t.chart,r=Number.POSITIVE_INFINITY,n=Number.NEGATIVE_INFINITY;z.each(e.data.datasets,(function(i,a){if(e.isDatasetVisible(a)){var o=e.getDatasetMeta(a);z.each(i.data,(function(e,i){var a=+t.getRightValue(e);isNaN(a)||o.data[i].hidden||(r=Math.min(a,r),n=Math.max(a,n))}))}})),t.min=r===Number.POSITIVE_INFINITY?0:r,t.max=n===Number.NEGATIVE_INFINITY?0:n,t.handleTickRangeOptions()},_computeTickLimit:function(){return Math.ceil(this.drawingArea/zr(this.options))},convertTicksToLabels:function(){var t=this;kr.prototype.convertTicksToLabels.call(t),t.pointLabels=t.chart.data.labels.map((function(){var e=z.callback(t.options.pointLabels.callback,arguments,t);return e||0===e?e:""}))},getLabelForIndex:function(t,e){return+this.getRightValue(this.chart.data.datasets[e].data[t])},fit:function(){var t=this,e=t.options;e.display&&e.pointLabels.display?function(t){var e,r,n,i=z.options._parseFont(t.options.pointLabels),a={l:0,r:t.width,t:0,b:t.height-t.paddingTop},o={};t.ctx.font=i.string,t._pointLabelSizes=[];var s,l,u,c=t.chart.data.labels.length;for(e=0;e<c;e++){n=t.getPointPosition(e,t.drawingArea+5),s=t.ctx,l=i.lineHeight,u=t.pointLabels[e],r=z.isArray(u)?{w:z.longestText(s,s.font,u),h:u.length*l}:{w:s.measureText(u).width,h:l},t._pointLabelSizes[e]=r;var d=t.getIndexAngle(e),h=z.toDegrees(d)%360,f=Vr(h,n.x,r.w,0,180),p=Vr(h,n.y,r.h,90,270);f.start<a.l&&(a.l=f.start,o.l=d),f.end>a.r&&(a.r=f.end,o.r=d),p.start<a.t&&(a.t=p.start,o.t=d),p.end>a.b&&(a.b=p.end,o.b=d)}t.setReductions(t.drawingArea,a,o)}(t):t.setCenterPoint(0,0,0,0)},setReductions:function(t,e,r){var n=this,i=e.l/Math.sin(r.l),a=Math.max(e.r-n.width,0)/Math.sin(r.r),o=-e.t/Math.cos(r.t),s=-Math.max(e.b-(n.height-n.paddingTop),0)/Math.cos(r.b);i=qr(i),a=qr(a),o=qr(o),s=qr(s),n.drawingArea=Math.min(Math.floor(t-(i+a)/2),Math.floor(t-(o+s)/2)),n.setCenterPoint(i,a,o,s)},setCenterPoint:function(t,e,r,n){var i=this,a=i.width-e-i.drawingArea,o=t+i.drawingArea,s=r+i.drawingArea,l=i.height-i.paddingTop-n-i.drawingArea;i.xCenter=Math.floor((o+a)/2+i.left),i.yCenter=Math.floor((s+l)/2+i.top+i.paddingTop)},getIndexAngle:function(t){var e=this.chart,r=(t*(360/e.data.labels.length)+((e.options||{}).startAngle||0))%360;return(r<0?r+360:r)*Math.PI*2/360},getDistanceFromCenterForValue:function(t){var e=this;if(z.isNullOrUndef(t))return NaN;var r=e.drawingArea/(e.max-e.min);return e.options.ticks.reverse?(e.max-t)*r:(t-e.min)*r},getPointPosition:function(t,e){var r=this,n=r.getIndexAngle(t)-Math.PI/2;return{x:Math.cos(n)*e+r.xCenter,y:Math.sin(n)*e+r.yCenter}},getPointPositionForValue:function(t,e){return this.getPointPosition(t,this.getDistanceFromCenterForValue(e))},getBasePosition:function(t){var e=this,r=e.min,n=e.max;return e.getPointPositionForValue(t||0,e.beginAtZero?0:r<0&&n<0?n:r>0&&n>0?r:0)},_drawGrid:function(){var t,e,r,n=this,i=n.ctx,a=n.options,o=a.gridLines,s=a.angleLines,l=Ur(s.lineWidth,o.lineWidth),u=Ur(s.color,o.color);if(a.pointLabels.display&&function(t){var e=t.ctx,r=t.options,n=r.pointLabels,i=zr(r),a=t.getDistanceFromCenterForValue(r.ticks.reverse?t.min:t.max),o=z.options._parseFont(n);e.save(),e.font=o.string,e.textBaseline="middle";for(var s=t.chart.data.labels.length-1;s>=0;s--){var l=0===s?i/2:0,u=t.getPointPosition(s,a+l+5),c=jr(n.fontColor,s,B.global.defaultFontColor);e.fillStyle=c;var d=t.getIndexAngle(s),h=z.toDegrees(d);e.textAlign=Wr(h),Yr(h,t._pointLabelSizes[s],u),Kr(e,t.pointLabels[s],u,o.lineHeight)}e.restore()}(n),o.display&&z.each(n.ticks,(function(t,r){0!==r&&(e=n.getDistanceFromCenterForValue(n.ticksAsNumbers[r]),function(t,e,r,n){var i,a=t.ctx,o=e.circular,s=t.chart.data.labels.length,l=jr(e.color,n-1),u=jr(e.lineWidth,n-1);if((o||s)&&l&&u){if(a.save(),a.strokeStyle=l,a.lineWidth=u,a.setLineDash&&(a.setLineDash(e.borderDash||[]),a.lineDashOffset=e.borderDashOffset||0),a.beginPath(),o)a.arc(t.xCenter,t.yCenter,r,0,2*Math.PI);else{i=t.getPointPosition(0,r),a.moveTo(i.x,i.y);for(var c=1;c<s;c++)i=t.getPointPosition(c,r),a.lineTo(i.x,i.y)}a.closePath(),a.stroke(),a.restore()}}(n,o,e,r))})),s.display&&l&&u){for(i.save(),i.lineWidth=l,i.strokeStyle=u,i.setLineDash&&(i.setLineDash(Hr([s.borderDash,o.borderDash,[]])),i.lineDashOffset=Hr([s.borderDashOffset,o.borderDashOffset,0])),t=n.chart.data.labels.length-1;t>=0;t--)e=n.getDistanceFromCenterForValue(a.ticks.reverse?n.min:n.max),r=n.getPointPosition(t,e),i.beginPath(),i.moveTo(n.xCenter,n.yCenter),i.lineTo(r.x,r.y),i.stroke();i.restore()}},_drawLabels:function(){var t=this,e=t.ctx,r=t.options.ticks;if(r.display){var n,i,a=t.getIndexAngle(0),o=z.options._parseFont(r),s=Ur(r.fontColor,B.global.defaultFontColor);e.save(),e.font=o.string,e.translate(t.xCenter,t.yCenter),e.rotate(a),e.textAlign="center",e.textBaseline="middle",z.each(t.ticks,(function(a,l){(0!==l||r.reverse)&&(n=t.getDistanceFromCenterForValue(t.ticksAsNumbers[l]),r.showLabelBackdrop&&(i=e.measureText(a).width,e.fillStyle=r.backdropColor,e.fillRect(-i/2-r.backdropPaddingX,-n-o.size/2-r.backdropPaddingY,i+2*r.backdropPaddingX,o.size+2*r.backdropPaddingY)),e.fillStyle=s,e.fillText(a,0,-n))})),e.restore()}},_drawTitle:z.noop}),$r=Gr;Xr._defaults=$r;var Qr=z._deprecated,Jr=z.options.resolve,Zr=z.valueOrDefault,tn=Number.MIN_SAFE_INTEGER||-9007199254740991,en=Number.MAX_SAFE_INTEGER||9007199254740991,rn={millisecond:{common:!0,size:1,steps:1e3},second:{common:!0,size:1e3,steps:60},minute:{common:!0,size:6e4,steps:60},hour:{common:!0,size:36e5,steps:24},day:{common:!0,size:864e5,steps:30},week:{common:!1,size:6048e5,steps:4},month:{common:!0,size:2628e6,steps:12},quarter:{common:!1,size:7884e6,steps:4},year:{common:!0,size:3154e7}},nn=Object.keys(rn);function an(t,e){return t-e}function on(t){return z.valueOrDefault(t.time.min,t.ticks.min)}function sn(t){return z.valueOrDefault(t.time.max,t.ticks.max)}function ln(t,e,r,n){var i=function(t,e,r){for(var n,i,a,o=0,s=t.length-1;o>=0&&o<=s;){if(i=t[(n=o+s>>1)-1]||null,a=t[n],!i)return{lo:null,hi:a};if(a[e]<r)o=n+1;else{if(!(i[e]>r))return{lo:i,hi:a};s=n-1}}return{lo:a,hi:null}}(t,e,r),a=i.lo?i.hi?i.lo:t[t.length-2]:t[0],o=i.lo?i.hi?i.hi:t[t.length-1]:t[1],s=o[e]-a[e],l=s?(r-a[e])/s:0,u=(o[n]-a[n])*l;return a[n]+u}function un(t,e){var r=t._adapter,n=t.options.time,i=n.parser,a=i||n.format,o=e;return"function"==typeof i&&(o=i(o)),z.isFinite(o)||(o="string"==typeof a?r.parse(o,a):r.parse(o)),null!==o?+o:(i||"function"!=typeof a||(o=a(e),z.isFinite(o)||(o=r.parse(o))),o)}function cn(t,e){if(z.isNullOrUndef(e))return null;var r=t.options.time,n=un(t,t.getRightValue(e));return null===n||r.round&&(n=+t._adapter.startOf(n,r.round)),n}function dn(t,e,r,n){var i,a,o,s=nn.length;for(i=nn.indexOf(t);i<s-1;++i)if(o=(a=rn[nn[i]]).steps?a.steps:en,a.common&&Math.ceil((r-e)/(o*a.size))<=n)return nn[i];return nn[s-1]}function hn(t,e,r){var n,i,a=[],o={},s=e.length;for(n=0;n<s;++n)o[i=e[n]]=n,a.push({value:i,major:!1});return 0!==s&&r?function(t,e,r,n){var i,a,o=t._adapter,s=+o.startOf(e[0].value,n),l=e[e.length-1].value;for(i=s;i<=l;i=+o.add(i,1,n))(a=r[i])>=0&&(e[a].major=!0);return e}(t,a,o,r):a}var fn=xr.extend({initialize:function(){this.mergeTicksOptions(),xr.prototype.initialize.call(this)},update:function(){var t=this,e=t.options,r=e.time||(e.time={}),n=t._adapter=new or._date(e.adapters.date);return Qr("time scale",r.format,"time.format","time.parser"),Qr("time scale",r.min,"time.min","ticks.min"),Qr("time scale",r.max,"time.max","ticks.max"),z.mergeIf(r.displayFormats,n.formats()),xr.prototype.update.apply(t,arguments)},getRightValue:function(t){return t&&void 0!==t.t&&(t=t.t),xr.prototype.getRightValue.call(this,t)},determineDataLimits:function(){var t,e,r,n,i,a,o,s=this,l=s.chart,u=s._adapter,c=s.options,d=c.time.unit||"day",h=en,f=tn,p=[],g=[],v=[],m=s._getLabels();for(t=0,r=m.length;t<r;++t)v.push(cn(s,m[t]));for(t=0,r=(l.data.datasets||[]).length;t<r;++t)if(l.isDatasetVisible(t))if(i=l.data.datasets[t].data,z.isObject(i[0]))for(g[t]=[],e=0,n=i.length;e<n;++e)a=cn(s,i[e]),p.push(a),g[t][e]=a;else g[t]=v.slice(0),o||(p=p.concat(v),o=!0);else g[t]=[];v.length&&(h=Math.min(h,v[0]),f=Math.max(f,v[v.length-1])),p.length&&(p=r>1?function(t){var e,r,n,i={},a=[];for(e=0,r=t.length;e<r;++e)i[n=t[e]]||(i[n]=!0,a.push(n));return a}(p).sort(an):p.sort(an),h=Math.min(h,p[0]),f=Math.max(f,p[p.length-1])),h=cn(s,on(c))||h,f=cn(s,sn(c))||f,h=h===en?+u.startOf(Date.now(),d):h,f=f===tn?+u.endOf(Date.now(),d)+1:f,s.min=Math.min(h,f),s.max=Math.max(h+1,f),s._table=[],s._timestamps={data:p,datasets:g,labels:v}},buildTicks:function(){var t,e,r,n=this,i=n.min,a=n.max,o=n.options,s=o.ticks,l=o.time,u=n._timestamps,c=[],d=n.getLabelCapacity(i),h=s.source,f=o.distribution;for(u="data"===h||"auto"===h&&"series"===f?u.data:"labels"===h?u.labels:function(t,e,r,n){var i,a=t._adapter,o=t.options,s=o.time,l=s.unit||dn(s.minUnit,e,r,n),u=Jr([s.stepSize,s.unitStepSize,1]),c="week"===l&&s.isoWeekday,d=e,h=[];if(c&&(d=+a.startOf(d,"isoWeek",c)),d=+a.startOf(d,c?"day":l),a.diff(r,e,l)>1e5*u)throw e+" and "+r+" are too far apart with stepSize of "+u+" "+l;for(i=d;i<r;i=+a.add(i,u,l))h.push(i);return i!==r&&"ticks"!==o.bounds||h.push(i),h}(n,i,a,d),"ticks"===o.bounds&&u.length&&(i=u[0],a=u[u.length-1]),i=cn(n,on(o))||i,a=cn(n,sn(o))||a,t=0,e=u.length;t<e;++t)(r=u[t])>=i&&r<=a&&c.push(r);return n.min=i,n.max=a,n._unit=l.unit||(s.autoSkip?dn(l.minUnit,n.min,n.max,d):function(t,e,r,n,i){var a,o;for(a=nn.length-1;a>=nn.indexOf(r);a--)if(o=nn[a],rn[o].common&&t._adapter.diff(i,n,o)>=e-1)return o;return nn[r?nn.indexOf(r):0]}(n,c.length,l.minUnit,n.min,n.max)),n._majorUnit=s.major.enabled&&"year"!==n._unit?function(t){for(var e=nn.indexOf(t)+1,r=nn.length;e<r;++e)if(rn[nn[e]].common)return nn[e]}(n._unit):void 0,n._table=function(t,e,r,n){if("linear"===n||!t.length)return[{time:e,pos:0},{time:r,pos:1}];var i,a,o,s,l,u=[],c=[e];for(i=0,a=t.length;i<a;++i)(s=t[i])>e&&s<r&&c.push(s);for(c.push(r),i=0,a=c.length;i<a;++i)l=c[i+1],o=c[i-1],s=c[i],void 0!==o&&void 0!==l&&Math.round((l+o)/2)===s||u.push({time:s,pos:i/(a-1)});return u}(n._timestamps.data,i,a,f),n._offsets=function(t,e,r,n,i){var a,o,s=0,l=0;return i.offset&&e.length&&(a=ln(t,"time",e[0],"pos"),s=1===e.length?1-a:(ln(t,"time",e[1],"pos")-a)/2,o=ln(t,"time",e[e.length-1],"pos"),l=1===e.length?o:(o-ln(t,"time",e[e.length-2],"pos"))/2),{start:s,end:l,factor:1/(s+1+l)}}(n._table,c,0,0,o),s.reverse&&c.reverse(),hn(n,c,n._majorUnit)},getLabelForIndex:function(t,e){var r=this,n=r._adapter,i=r.chart.data,a=r.options.time,o=i.labels&&t<i.labels.length?i.labels[t]:"",s=i.datasets[e].data[t];return z.isObject(s)&&(o=r.getRightValue(s)),a.tooltipFormat?n.format(un(r,o),a.tooltipFormat):"string"==typeof o?o:n.format(un(r,o),a.displayFormats.datetime)},tickFormatFunction:function(t,e,r,n){var i=this,a=i._adapter,o=i.options,s=o.time.displayFormats,l=s[i._unit],u=i._majorUnit,c=s[u],d=r[e],h=o.ticks,f=u&&c&&d&&d.major,p=a.format(t,n||(f?c:l)),g=f?h.major:h.minor,v=Jr([g.callback,g.userCallback,h.callback,h.userCallback]);return v?v(p,e,r):p},convertTicksToLabels:function(t){var e,r,n=[];for(e=0,r=t.length;e<r;++e)n.push(this.tickFormatFunction(t[e].value,e,t));return n},getPixelForOffset:function(t){var e=this,r=e._offsets,n=ln(e._table,"time",t,"pos");return e.getPixelForDecimal((r.start+n)*r.factor)},getPixelForValue:function(t,e,r){var n=this,i=null;if(void 0!==e&&void 0!==r&&(i=n._timestamps.datasets[r][e]),null===i&&(i=cn(n,t)),null!==i)return n.getPixelForOffset(i)},getPixelForTick:function(t){var e=this.getTicks();return t>=0&&t<e.length?this.getPixelForOffset(e[t].value):null},getValueForPixel:function(t){var e=this,r=e._offsets,n=e.getDecimalForPixel(t)/r.factor-r.end,i=ln(e._table,"pos",n,"time");return e._adapter._create(i)},_getLabelSize:function(t){var e=this,r=e.options.ticks,n=e.ctx.measureText(t).width,i=z.toRadians(e.isHorizontal()?r.maxRotation:r.minRotation),a=Math.cos(i),o=Math.sin(i),s=Zr(r.fontSize,B.global.defaultFontSize);return{w:n*a+s*o,h:n*o+s*a}},getLabelWidth:function(t){return this._getLabelSize(t).w},getLabelCapacity:function(t){var e=this,r=e.options.time,n=r.displayFormats,i=n[r.unit]||n.millisecond,a=e.tickFormatFunction(t,0,hn(e,[t],e._majorUnit),i),o=e._getLabelSize(a),s=Math.floor(e.isHorizontal()?e.width/o.w:e.height/o.h);return e.options.offset&&s--,s>0?s:1}}),pn={position:"bottom",distribution:"linear",bounds:"data",adapters:{},time:{parser:!1,unit:!1,round:!1,displayFormat:!1,isoWeekday:!1,minUnit:"millisecond",displayFormats:{}},ticks:{autoSkip:!1,source:"auto",major:{enabled:!1}}};fn._defaults=pn;var gn={category:Tr,linear:Rr,logarithmic:Nr,radialLinear:Xr,time:fn},vn={datetime:"MMM D, YYYY, h:mm:ss a",millisecond:"h:mm:ss.SSS a",second:"h:mm:ss a",minute:"h:mm a",hour:"hA",day:"MMM D",week:"ll",month:"MMM YYYY",quarter:"[Q]Q - YYYY",year:"YYYY"};or._date.override("function"==typeof t?{_id:"moment",formats:function(){return vn},parse:function(e,r){return"string"==typeof e&&"string"==typeof r?e=t(e,r):e instanceof t||(e=t(e)),e.isValid()?e.valueOf():null},format:function(e,r){return t(e).format(r)},add:function(e,r,n){return t(e).add(r,n).valueOf()},diff:function(e,r,n){return t(e).diff(t(r),n)},startOf:function(e,r,n){return e=t(e),"isoWeek"===r?e.isoWeekday(n).valueOf():e.startOf(r).valueOf()},endOf:function(e,r){return t(e).endOf(r).valueOf()},_create:function(e){return t(e)}}:{}),B._set("global",{plugins:{filler:{propagate:!0}}});var mn={dataset:function(t){var e=t.fill,r=t.chart,n=r.getDatasetMeta(e),i=n&&r.isDatasetVisible(e)&&n.dataset._children||[],a=i.length||0;return a?function(t,e){return e<a&&i[e]._view||null}:null},boundary:function(t){var e=t.boundary,r=e?e.x:null,n=e?e.y:null;return z.isArray(e)?function(t,r){return e[r]}:function(t){return{x:null===r?t.x:r,y:null===n?t.y:n}}}};function yn(t,e,r){var n,i=t._model||{},a=i.fill;if(void 0===a&&(a=!!i.backgroundColor),!1===a||null===a)return!1;if(!0===a)return"origin";if(n=parseFloat(a,10),isFinite(n)&&Math.floor(n)===n)return"-"!==a[0]&&"+"!==a[0]||(n=e+n),!(n===e||n<0||n>=r)&&n;switch(a){case"bottom":return"start";case"top":return"end";case"zero":return"origin";case"origin":case"start":case"end":return a;default:return!1}}function bn(t){return(t.el._scale||{}).getPointPositionForValue?function(t){var e,r,n,i,a,o=t.el._scale,s=o.options,l=o.chart.data.labels.length,u=t.fill,c=[];if(!l)return null;for(e=s.ticks.reverse?o.max:o.min,r=s.ticks.reverse?o.min:o.max,n=o.getPointPositionForValue(0,e),i=0;i<l;++i)a="start"===u||"end"===u?o.getPointPositionForValue(i,"start"===u?e:r):o.getBasePosition(i),s.gridLines.circular&&(a.cx=n.x,a.cy=n.y,a.angle=o.getIndexAngle(i)-Math.PI/2),c.push(a);return c}(t):function(t){var e,r=t.el._model||{},n=t.el._scale||{},i=t.fill,a=null;if(isFinite(i))return null;if("start"===i?a=void 0===r.scaleBottom?n.bottom:r.scaleBottom:"end"===i?a=void 0===r.scaleTop?n.top:r.scaleTop:void 0!==r.scaleZero?a=r.scaleZero:n.getBasePixel&&(a=n.getBasePixel()),null!=a){if(void 0!==a.x&&void 0!==a.y)return a;if(z.isFinite(a))return{x:(e=n.isHorizontal())?a:null,y:e?null:a}}return null}(t)}function En(t,e,r){var n,i=t[e].fill,a=[e];if(!r)return i;for(;!1!==i&&-1===a.indexOf(i);){if(!isFinite(i))return i;if(!(n=t[i]))return!1;if(n.visible)return i;a.push(i),i=n.fill}return!1}function xn(t){var e=t.fill,r="dataset";return!1===e?null:(isFinite(e)||(r="boundary"),mn[r](t))}function Sn(t){return t&&!t.skip}function Tn(t,e,r,n,i){var a,o,s,l;if(n&&i){for(t.moveTo(e[0].x,e[0].y),a=1;a<n;++a)z.canvas.lineTo(t,e[a-1],e[a]);if(void 0===r[0].angle)for(t.lineTo(r[i-1].x,r[i-1].y),a=i-1;a>0;--a)z.canvas.lineTo(t,r[a],r[a-1],!0);else for(o=r[0].cx,s=r[0].cy,l=Math.sqrt(Math.pow(r[0].x-o,2)+Math.pow(r[0].y-s,2)),a=i-1;a>0;--a)t.arc(o,s,l,r[a].angle,r[a-1].angle,!0)}}function wn(t,e,r,n,i,a){var o,s,l,u,c,d,h,f,p=e.length,g=n.spanGaps,v=[],m=[],y=0,b=0;for(t.beginPath(),o=0,s=p;o<s;++o)c=r(u=e[l=o%p]._view,l,n),d=Sn(u),h=Sn(c),a&&void 0===f&&d&&(s=p+(f=o+1)),d&&h?(y=v.push(u),b=m.push(c)):y&&b&&(g?(d&&v.push(u),h&&m.push(c)):(Tn(t,v,m,y,b),y=b=0,v=[],m=[]));Tn(t,v,m,y,b),t.closePath(),t.fillStyle=i,t.fill()}var _n={id:"filler",afterDatasetsUpdate:function(t,e){var r,n,i,a,o=(t.data.datasets||[]).length,s=e.propagate,l=[];for(n=0;n<o;++n)a=null,(i=(r=t.getDatasetMeta(n)).dataset)&&i._model&&i instanceof Tt.Line&&(a={visible:t.isDatasetVisible(n),fill:yn(i,n,o),chart:t,el:i}),r.$filler=a,l.push(a);for(n=0;n<o;++n)(a=l[n])&&(a.fill=En(l,n,s),a.boundary=bn(a),a.mapper=xn(a))},beforeDatasetsDraw:function(t){var e,r,n,i,a,o,s,l=t._getSortedVisibleDatasetMetas(),u=t.ctx;for(r=l.length-1;r>=0;--r)(e=l[r].$filler)&&e.visible&&(i=(n=e.el)._view,a=n._children||[],o=e.mapper,s=i.backgroundColor||B.global.defaultColor,o&&s&&a.length&&(z.canvas.clipArea(u,t.chartArea),wn(u,a,o,i,s,n._loop),z.canvas.unclipArea(u)))}},An=z.rtl.getRtlAdapter,kn=z.noop,Cn=z.valueOrDefault;function Dn(t,e){return t.usePointStyle&&t.boxWidth>e?e:t.boxWidth}B._set("global",{legend:{display:!0,position:"top",align:"center",fullWidth:!0,reverse:!1,weight:1e3,onClick:function(t,e){var r=e.datasetIndex,n=this.chart,i=n.getDatasetMeta(r);i.hidden=null===i.hidden?!n.data.datasets[r].hidden:null,n.update()},onHover:null,onLeave:null,labels:{boxWidth:40,padding:10,generateLabels:function(t){var e=t.data.datasets,r=t.options.legend||{},n=r.labels&&r.labels.usePointStyle;return t._getSortedDatasetMetas().map((function(r){var i=r.controller.getStyle(n?0:void 0);return{text:e[r.index].label,fillStyle:i.backgroundColor,hidden:!t.isDatasetVisible(r.index),lineCap:i.borderCapStyle,lineDash:i.borderDash,lineDashOffset:i.borderDashOffset,lineJoin:i.borderJoinStyle,lineWidth:i.borderWidth,strokeStyle:i.borderColor,pointStyle:i.pointStyle,rotation:i.rotation,datasetIndex:r.index}}),this)}}},legendCallback:function(t){var e,r,n,i=document.createElement("ul"),a=t.data.datasets;for(i.setAttribute("class",t.id+"-legend"),e=0,r=a.length;e<r;e++)(n=i.appendChild(document.createElement("li"))).appendChild(document.createElement("span")).style.backgroundColor=a[e].backgroundColor,a[e].label&&n.appendChild(document.createTextNode(a[e].label));return i.outerHTML}});var Ln=$.extend({initialize:function(t){var e=this;z.extend(e,t),e.legendHitBoxes=[],e._hoveredItem=null,e.doughnutMode=!1},beforeUpdate:kn,update:function(t,e,r){var n=this;return n.beforeUpdate(),n.maxWidth=t,n.maxHeight=e,n.margins=r,n.beforeSetDimensions(),n.setDimensions(),n.afterSetDimensions(),n.beforeBuildLabels(),n.buildLabels(),n.afterBuildLabels(),n.beforeFit(),n.fit(),n.afterFit(),n.afterUpdate(),n.minSize},afterUpdate:kn,beforeSetDimensions:kn,setDimensions:function(){var t=this;t.isHorizontal()?(t.width=t.maxWidth,t.left=0,t.right=t.width):(t.height=t.maxHeight,t.top=0,t.bottom=t.height),t.paddingLeft=0,t.paddingTop=0,t.paddingRight=0,t.paddingBottom=0,t.minSize={width:0,height:0}},afterSetDimensions:kn,beforeBuildLabels:kn,buildLabels:function(){var t=this,e=t.options.labels||{},r=z.callback(e.generateLabels,[t.chart],t)||[];e.filter&&(r=r.filter((function(r){return e.filter(r,t.chart.data)}))),t.options.reverse&&r.reverse(),t.legendItems=r},afterBuildLabels:kn,beforeFit:kn,fit:function(){var t=this,e=t.options,r=e.labels,n=e.display,i=t.ctx,a=z.options._parseFont(r),o=a.size,s=t.legendHitBoxes=[],l=t.minSize,u=t.isHorizontal();if(u?(l.width=t.maxWidth,l.height=n?10:0):(l.width=n?10:0,l.height=t.maxHeight),n){if(i.font=a.string,u){var c=t.lineWidths=[0],d=0;i.textAlign="left",i.textBaseline="middle",z.each(t.legendItems,(function(t,e){var n=Dn(r,o)+o/2+i.measureText(t.text).width;(0===e||c[c.length-1]+n+2*r.padding>l.width)&&(d+=o+r.padding,c[c.length-(e>0?0:1)]=0),s[e]={left:0,top:0,width:n,height:o},c[c.length-1]+=n+r.padding})),l.height+=d}else{var h=r.padding,f=t.columnWidths=[],p=t.columnHeights=[],g=r.padding,v=0,m=0;z.each(t.legendItems,(function(t,e){var n=Dn(r,o)+o/2+i.measureText(t.text).width;e>0&&m+o+2*h>l.height&&(g+=v+r.padding,f.push(v),p.push(m),v=0,m=0),v=Math.max(v,n),m+=o+h,s[e]={left:0,top:0,width:n,height:o}})),g+=v,f.push(v),p.push(m),l.width+=g}t.width=l.width,t.height=l.height}else t.width=l.width=t.height=l.height=0},afterFit:kn,isHorizontal:function(){return"top"===this.options.position||"bottom"===this.options.position},draw:function(){var t=this,e=t.options,r=e.labels,n=B.global,i=n.defaultColor,a=n.elements.line,o=t.height,s=t.columnHeights,l=t.width,u=t.lineWidths;if(e.display){var c,d=An(e.rtl,t.left,t.minSize.width),h=t.ctx,f=Cn(r.fontColor,n.defaultFontColor),p=z.options._parseFont(r),g=p.size;h.textAlign=d.textAlign("left"),h.textBaseline="middle",h.lineWidth=.5,h.strokeStyle=f,h.fillStyle=f,h.font=p.string;var v=Dn(r,g),m=t.legendHitBoxes,y=function(t,n){switch(e.align){case"start":return r.padding;case"end":return t-n;default:return(t-n+r.padding)/2}},b=t.isHorizontal();c=b?{x:t.left+y(l,u[0]),y:t.top+r.padding,line:0}:{x:t.left+r.padding,y:t.top+y(o,s[0]),line:0},z.rtl.overrideTextDirection(t.ctx,e.textDirection);var E=g+r.padding;z.each(t.legendItems,(function(e,n){var f=h.measureText(e.text).width,p=v+g/2+f,x=c.x,S=c.y;d.setWidth(t.minSize.width),b?n>0&&x+p+r.padding>t.left+t.minSize.width&&(S=c.y+=E,c.line++,x=c.x=t.left+y(l,u[c.line])):n>0&&S+E>t.top+t.minSize.height&&(x=c.x=x+t.columnWidths[c.line]+r.padding,c.line++,S=c.y=t.top+y(o,s[c.line]));var T=d.x(x);(function(t,e,n){if(!(isNaN(v)||v<=0)){h.save();var o=Cn(n.lineWidth,a.borderWidth);if(h.fillStyle=Cn(n.fillStyle,i),h.lineCap=Cn(n.lineCap,a.borderCapStyle),h.lineDashOffset=Cn(n.lineDashOffset,a.borderDashOffset),h.lineJoin=Cn(n.lineJoin,a.borderJoinStyle),h.lineWidth=o,h.strokeStyle=Cn(n.strokeStyle,i),h.setLineDash&&h.setLineDash(Cn(n.lineDash,a.borderDash)),r&&r.usePointStyle){var s=v*Math.SQRT2/2,l=d.xPlus(t,v/2),u=e+g/2;z.canvas.drawPoint(h,n.pointStyle,s,l,u,n.rotation)}else h.fillRect(d.leftForLtr(t,v),e,v,g),0!==o&&h.strokeRect(d.leftForLtr(t,v),e,v,g);h.restore()}})(T,S,e),m[n].left=d.leftForLtr(T,m[n].width),m[n].top=S,function(t,e,r,n){var i=g/2,a=d.xPlus(t,v+i),o=e+i;h.fillText(r.text,a,o),r.hidden&&(h.beginPath(),h.lineWidth=2,h.moveTo(a,o),h.lineTo(d.xPlus(a,n),o),h.stroke())}(T,S,e,f),b?c.x+=p+r.padding:c.y+=E})),z.rtl.restoreTextDirection(t.ctx,e.textDirection)}},_getLegendItemAt:function(t,e){var r,n,i,a=this;if(t>=a.left&&t<=a.right&&e>=a.top&&e<=a.bottom)for(i=a.legendHitBoxes,r=0;r<i.length;++r)if(t>=(n=i[r]).left&&t<=n.left+n.width&&e>=n.top&&e<=n.top+n.height)return a.legendItems[r];return null},handleEvent:function(t){var e,r=this,n=r.options,i="mouseup"===t.type?"click":t.type;if("mousemove"===i){if(!n.onHover&&!n.onLeave)return}else{if("click"!==i)return;if(!n.onClick)return}e=r._getLegendItemAt(t.x,t.y),"click"===i?e&&n.onClick&&n.onClick.call(r,t.native,e):(n.onLeave&&e!==r._hoveredItem&&(r._hoveredItem&&n.onLeave.call(r,t.native,r._hoveredItem),r._hoveredItem=e),n.onHover&&e&&n.onHover.call(r,t.native,e))}});function Rn(t,e){var r=new Ln({ctx:t.ctx,options:e,chart:t});ve.configure(t,r,e),ve.addBox(t,r),t.legend=r}var In={id:"legend",_element:Ln,beforeInit:function(t){var e=t.options.legend;e&&Rn(t,e)},beforeUpdate:function(t){var e=t.options.legend,r=t.legend;e?(z.mergeIf(e,B.global.legend),r?(ve.configure(t,r,e),r.options=e):Rn(t,e)):r&&(ve.removeBox(t,r),delete t.legend)},afterEvent:function(t,e){var r=t.legend;r&&r.handleEvent(e)}},On=z.noop;B._set("global",{title:{display:!1,fontStyle:"bold",fullWidth:!0,padding:10,position:"top",text:"",weight:2e3}});var Mn=$.extend({initialize:function(t){z.extend(this,t),this.legendHitBoxes=[]},beforeUpdate:On,update:function(t,e,r){var n=this;return n.beforeUpdate(),n.maxWidth=t,n.maxHeight=e,n.margins=r,n.beforeSetDimensions(),n.setDimensions(),n.afterSetDimensions(),n.beforeBuildLabels(),n.buildLabels(),n.afterBuildLabels(),n.beforeFit(),n.fit(),n.afterFit(),n.afterUpdate(),n.minSize},afterUpdate:On,beforeSetDimensions:On,setDimensions:function(){var t=this;t.isHorizontal()?(t.width=t.maxWidth,t.left=0,t.right=t.width):(t.height=t.maxHeight,t.top=0,t.bottom=t.height),t.paddingLeft=0,t.paddingTop=0,t.paddingRight=0,t.paddingBottom=0,t.minSize={width:0,height:0}},afterSetDimensions:On,beforeBuildLabels:On,buildLabels:On,afterBuildLabels:On,beforeFit:On,fit:function(){var t,e=this,r=e.options,n=e.minSize={},i=e.isHorizontal();r.display?(t=(z.isArray(r.text)?r.text.length:1)*z.options._parseFont(r).lineHeight+2*r.padding,e.width=n.width=i?e.maxWidth:t,e.height=n.height=i?t:e.maxHeight):e.width=n.width=e.height=n.height=0},afterFit:On,isHorizontal:function(){var t=this.options.position;return"top"===t||"bottom"===t},draw:function(){var t=this,e=t.ctx,r=t.options;if(r.display){var n,i,a,o=z.options._parseFont(r),s=o.lineHeight,l=s/2+r.padding,u=0,c=t.top,d=t.left,h=t.bottom,f=t.right;e.fillStyle=z.valueOrDefault(r.fontColor,B.global.defaultFontColor),e.font=o.string,t.isHorizontal()?(i=d+(f-d)/2,a=c+l,n=f-d):(i="left"===r.position?d+l:f-l,a=c+(h-c)/2,n=h-c,u=Math.PI*("left"===r.position?-.5:.5)),e.save(),e.translate(i,a),e.rotate(u),e.textAlign="center",e.textBaseline="middle";var p=r.text;if(z.isArray(p))for(var g=0,v=0;v<p.length;++v)e.fillText(p[v],0,g,n),g+=s;else e.fillText(p,0,0,n);e.restore()}}});function Pn(t,e){var r=new Mn({ctx:t.ctx,options:e,chart:t});ve.configure(t,r,e),ve.addBox(t,r),t.titleBlock=r}var Fn={},Nn=_n,Bn=In,Un={id:"title",_element:Mn,beforeInit:function(t){var e=t.options.title;e&&Pn(t,e)},beforeUpdate:function(t){var e=t.options.title,r=t.titleBlock;e?(z.mergeIf(e,B.global.title),r?(ve.configure(t,r,e),r.options=e):Pn(t,e)):r&&(ve.removeBox(t,r),delete t.titleBlock)}};for(var jn in Fn.filler=Nn,Fn.legend=Bn,Fn.title=Un,nr.helpers=z,function(){function t(t,e,r){var n;return"string"==typeof t?(n=parseInt(t,10),-1!==t.indexOf("%")&&(n=n/100*e.parentNode[r])):n=t,n}function e(t){return null!=t&&"none"!==t}function r(r,n,i){var a=document.defaultView,o=z._getParentNode(r),s=a.getComputedStyle(r)[n],l=a.getComputedStyle(o)[n],u=e(s),c=e(l),d=Number.POSITIVE_INFINITY;return u||c?Math.min(u?t(s,r,i):d,c?t(l,o,i):d):"none"}z.where=function(t,e){if(z.isArray(t)&&Array.prototype.filter)return t.filter(e);var r=[];return z.each(t,(function(t){e(t)&&r.push(t)})),r},z.findIndex=Array.prototype.findIndex?function(t,e,r){return t.findIndex(e,r)}:function(t,e,r){r=void 0===r?t:r;for(var n=0,i=t.length;n<i;++n)if(e.call(r,t[n],n,t))return n;return-1},z.findNextWhere=function(t,e,r){z.isNullOrUndef(r)&&(r=-1);for(var n=r+1;n<t.length;n++){var i=t[n];if(e(i))return i}},z.findPreviousWhere=function(t,e,r){z.isNullOrUndef(r)&&(r=t.length);for(var n=r-1;n>=0;n--){var i=t[n];if(e(i))return i}},z.isNumber=function(t){return!isNaN(parseFloat(t))&&isFinite(t)},z.almostEquals=function(t,e,r){return Math.abs(t-e)<r},z.almostWhole=function(t,e){var r=Math.round(t);return r-e<=t&&r+e>=t},z.max=function(t){return t.reduce((function(t,e){return isNaN(e)?t:Math.max(t,e)}),Number.NEGATIVE_INFINITY)},z.min=function(t){return t.reduce((function(t,e){return isNaN(e)?t:Math.min(t,e)}),Number.POSITIVE_INFINITY)},z.sign=Math.sign?function(t){return Math.sign(t)}:function(t){return 0==(t=+t)||isNaN(t)?t:t>0?1:-1},z.toRadians=function(t){return t*(Math.PI/180)},z.toDegrees=function(t){return t*(180/Math.PI)},z._decimalPlaces=function(t){if(z.isFinite(t)){for(var e=1,r=0;Math.round(t*e)/e!==t;)e*=10,r++;return r}},z.getAngleFromPoint=function(t,e){var r=e.x-t.x,n=e.y-t.y,i=Math.sqrt(r*r+n*n),a=Math.atan2(n,r);return a<-.5*Math.PI&&(a+=2*Math.PI),{angle:a,distance:i}},z.distanceBetweenPoints=function(t,e){return Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2))},z.aliasPixel=function(t){return t%2==0?0:.5},z._alignPixel=function(t,e,r){var n=t.currentDevicePixelRatio,i=r/2;return Math.round((e-i)*n)/n+i},z.splineCurve=function(t,e,r,n){var i=t.skip?e:t,a=e,o=r.skip?e:r,s=Math.sqrt(Math.pow(a.x-i.x,2)+Math.pow(a.y-i.y,2)),l=Math.sqrt(Math.pow(o.x-a.x,2)+Math.pow(o.y-a.y,2)),u=s/(s+l),c=l/(s+l),d=n*(u=isNaN(u)?0:u),h=n*(c=isNaN(c)?0:c);return{previous:{x:a.x-d*(o.x-i.x),y:a.y-d*(o.y-i.y)},next:{x:a.x+h*(o.x-i.x),y:a.y+h*(o.y-i.y)}}},z.EPSILON=Number.EPSILON||1e-14,z.splineCurveMonotone=function(t){var e,r,n,i,a,o,s,l,u,c=(t||[]).map((function(t){return{model:t._model,deltaK:0,mK:0}})),d=c.length;for(e=0;e<d;++e)if(!(n=c[e]).model.skip){if(r=e>0?c[e-1]:null,(i=e<d-1?c[e+1]:null)&&!i.model.skip){var h=i.model.x-n.model.x;n.deltaK=0!==h?(i.model.y-n.model.y)/h:0}!r||r.model.skip?n.mK=n.deltaK:!i||i.model.skip?n.mK=r.deltaK:this.sign(r.deltaK)!==this.sign(n.deltaK)?n.mK=0:n.mK=(r.deltaK+n.deltaK)/2}for(e=0;e<d-1;++e)n=c[e],i=c[e+1],n.model.skip||i.model.skip||(z.almostEquals(n.deltaK,0,this.EPSILON)?n.mK=i.mK=0:(a=n.mK/n.deltaK,o=i.mK/n.deltaK,(l=Math.pow(a,2)+Math.pow(o,2))<=9||(s=3/Math.sqrt(l),n.mK=a*s*n.deltaK,i.mK=o*s*n.deltaK)));for(e=0;e<d;++e)(n=c[e]).model.skip||(r=e>0?c[e-1]:null,i=e<d-1?c[e+1]:null,r&&!r.model.skip&&(u=(n.model.x-r.model.x)/3,n.model.controlPointPreviousX=n.model.x-u,n.model.controlPointPreviousY=n.model.y-u*n.mK),i&&!i.model.skip&&(u=(i.model.x-n.model.x)/3,n.model.controlPointNextX=n.model.x+u,n.model.controlPointNextY=n.model.y+u*n.mK))},z.nextItem=function(t,e,r){return r?e>=t.length-1?t[0]:t[e+1]:e>=t.length-1?t[t.length-1]:t[e+1]},z.previousItem=function(t,e,r){return r?e<=0?t[t.length-1]:t[e-1]:e<=0?t[0]:t[e-1]},z.niceNum=function(t,e){var r=Math.floor(z.log10(t)),n=t/Math.pow(10,r);return(e?n<1.5?1:n<3?2:n<7?5:10:n<=1?1:n<=2?2:n<=5?5:10)*Math.pow(10,r)},z.requestAnimFrame="undefined"==typeof window?function(t){t()}:window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame||function(t){return window.setTimeout(t,1e3/60)},z.getRelativePosition=function(t,e){var r,n,i=t.originalEvent||t,a=t.target||t.srcElement,o=a.getBoundingClientRect(),s=i.touches;s&&s.length>0?(r=s[0].clientX,n=s[0].clientY):(r=i.clientX,n=i.clientY);var l=parseFloat(z.getStyle(a,"padding-left")),u=parseFloat(z.getStyle(a,"padding-top")),c=parseFloat(z.getStyle(a,"padding-right")),d=parseFloat(z.getStyle(a,"padding-bottom")),h=o.right-o.left-l-c,f=o.bottom-o.top-u-d;return{x:r=Math.round((r-o.left-l)/h*a.width/e.currentDevicePixelRatio),y:n=Math.round((n-o.top-u)/f*a.height/e.currentDevicePixelRatio)}},z.getConstraintWidth=function(t){return r(t,"max-width","clientWidth")},z.getConstraintHeight=function(t){return r(t,"max-height","clientHeight")},z._calculatePadding=function(t,e,r){return(e=z.getStyle(t,e)).indexOf("%")>-1?r*parseInt(e,10)/100:parseInt(e,10)},z._getParentNode=function(t){var e=t.parentNode;return e&&"[object ShadowRoot]"===e.toString()&&(e=e.host),e},z.getMaximumWidth=function(t){var e=z._getParentNode(t);if(!e)return t.clientWidth;var r=e.clientWidth,n=r-z._calculatePadding(e,"padding-left",r)-z._calculatePadding(e,"padding-right",r),i=z.getConstraintWidth(t);return isNaN(i)?n:Math.min(n,i)},z.getMaximumHeight=function(t){var e=z._getParentNode(t);if(!e)return t.clientHeight;var r=e.clientHeight,n=r-z._calculatePadding(e,"padding-top",r)-z._calculatePadding(e,"padding-bottom",r),i=z.getConstraintHeight(t);return isNaN(i)?n:Math.min(n,i)},z.getStyle=function(t,e){return t.currentStyle?t.currentStyle[e]:document.defaultView.getComputedStyle(t,null).getPropertyValue(e)},z.retinaScale=function(t,e){var r=t.currentDevicePixelRatio=e||"undefined"!=typeof window&&window.devicePixelRatio||1;if(1!==r){var n=t.canvas,i=t.height,a=t.width;n.height=i*r,n.width=a*r,t.ctx.scale(r,r),n.style.height||n.style.width||(n.style.height=i+"px",n.style.width=a+"px")}},z.fontString=function(t,e,r){return e+" "+t+"px "+r},z.longestText=function(t,e,r,n){var i=(n=n||{}).data=n.data||{},a=n.garbageCollect=n.garbageCollect||[];n.font!==e&&(i=n.data={},a=n.garbageCollect=[],n.font=e),t.font=e;var o,s,l,u,c,d=0,h=r.length;for(o=0;o<h;o++)if(null!=(u=r[o])&&!0!==z.isArray(u))d=z.measureText(t,i,a,d,u);else if(z.isArray(u))for(s=0,l=u.length;s<l;s++)null==(c=u[s])||z.isArray(c)||(d=z.measureText(t,i,a,d,c));var f=a.length/2;if(f>r.length){for(o=0;o<f;o++)delete i[a[o]];a.splice(0,f)}return d},z.measureText=function(t,e,r,n,i){var a=e[i];return a||(a=e[i]=t.measureText(i).width,r.push(i)),a>n&&(n=a),n},z.numberOfLabelLines=function(t){var e=1;return z.each(t,(function(t){z.isArray(t)&&t.length>e&&(e=t.length)})),e},z.color=S?function(t){return t instanceof CanvasGradient&&(t=B.global.defaultColor),S(t)}:function(t){return n.error("Color.js not found!"),t},z.getHoverColor=function(t){return t instanceof CanvasPattern||t instanceof CanvasGradient?t:z.color(t).saturate(.5).darken(.1).rgbString()}}(),nr._adapters=or,nr.Animation=J,nr.animationService=Z,nr.controllers=Zt,nr.DatasetController=it,nr.defaults=B,nr.Element=$,nr.elements=Tt,nr.Interaction=oe,nr.layouts=ve,nr.platform=Pe,nr.plugins=Fe,nr.Scale=xr,nr.scaleService=Ne,nr.Ticks=sr,nr.Tooltip=qe,nr.helpers.each(gn,(function(t,e){nr.scaleService.registerScaleType(e,t,t._defaults)})),Fn)Fn.hasOwnProperty(jn)&&nr.plugins.register(Fn[jn]);nr.platform.initialize();var Hn=nr;return"undefined"!=typeof window&&(window.Chart=nr),nr.Chart=nr,nr.Legend=Fn.legend._element,nr.Title=Fn.title._element,nr.pluginService=nr.plugins,nr.PluginBase=nr.Element.extend({}),nr.canvasHelpers=nr.helpers.canvas,nr.layoutService=nr.layouts,nr.LinearScaleBase=kr,nr.helpers.each(["Bar","Bubble","Doughnut","Line","PolarArea","Radar","Scatter"],(function(t){nr[t]=function(e,r){return new nr(e,nr.helpers.merge(r||{},{type:t.charAt(0).toLowerCase()+t.slice(1)}))}})),Hn}(function(){try{return r(68945)}catch(t){}}())},84558:function(t,e,r){t.exports=function(t){"use strict";var e=(t=t&&t.hasOwnProperty("default")?t.default:t).helpers,r=function(){if("undefined"!=typeof window){if(window.devicePixelRatio)return window.devicePixelRatio;var t=window.screen;if(t)return(t.deviceXDPI||1)/(t.logicalXDPI||1)}return 1}(),n={toTextLines:function(t){var r,n=[];for(t=[].concat(t);t.length;)"string"==typeof(r=t.pop())?n.unshift.apply(n,r.split("\n")):Array.isArray(r)?t.push.apply(t,r):e.isNullOrUndef(t)||n.unshift(""+r);return n},toFontString:function(t){return!t||e.isNullOrUndef(t.size)||e.isNullOrUndef(t.family)?null:(t.style?t.style+" ":"")+(t.weight?t.weight+" ":"")+t.size+"px "+t.family},textSize:function(t,e,r){var n,i=[].concat(e),a=i.length,o=t.font,s=0;for(t.font=r.string,n=0;n<a;++n)s=Math.max(t.measureText(i[n]).width,s);return t.font=o,{height:a*r.lineHeight,width:s}},parseFont:function(r){var i=t.defaults.global,a=e.valueOrDefault(r.size,i.defaultFontSize),o={family:e.valueOrDefault(r.family,i.defaultFontFamily),lineHeight:e.options.toLineHeight(r.lineHeight,a),size:a,style:e.valueOrDefault(r.style,i.defaultFontStyle),weight:e.valueOrDefault(r.weight,null),string:""};return o.string=n.toFontString(o),o},bound:function(t,e,r){return Math.max(t,Math.min(e,r))},arrayDiff:function(t,e){var r,n,i,a,o=t.slice(),s=[];for(r=0,i=e.length;r<i;++r)a=e[r],-1===(n=o.indexOf(a))?s.push([a,1]):o.splice(n,1);for(r=0,i=o.length;r<i;++r)s.push([o[r],-1]);return s},rasterize:function(t){return Math.round(t*r)/r}};function i(t,e){var r=e.x,n=e.y;if(null===r)return{x:0,y:-1};if(null===n)return{x:1,y:0};var i=t.x-r,a=t.y-n,o=Math.sqrt(i*i+a*a);return{x:o?i/o:0,y:o?a/o:-1}}function a(t,e,r){var n=0;return t<r.left?n|=1:t>r.right&&(n|=2),e<r.top?n|=8:e>r.bottom&&(n|=4),n}function o(t,e){var r,n,i=e.anchor,o=t;return e.clamp&&(o=function(t,e){for(var r,n,i,o=t.x0,s=t.y0,l=t.x1,u=t.y1,c=a(o,s,e),d=a(l,u,e);c|d&&!(c&d);)8&(r=c||d)?(n=o+(l-o)*(e.top-s)/(u-s),i=e.top):4&r?(n=o+(l-o)*(e.bottom-s)/(u-s),i=e.bottom):2&r?(i=s+(u-s)*(e.right-o)/(l-o),n=e.right):1&r&&(i=s+(u-s)*(e.left-o)/(l-o),n=e.left),r===c?c=a(o=n,s=i,e):d=a(l=n,u=i,e);return{x0:o,x1:l,y0:s,y1:u}}(o,e.area)),"start"===i?(r=o.x0,n=o.y0):"end"===i?(r=o.x1,n=o.y1):(r=(o.x0+o.x1)/2,n=(o.y0+o.y1)/2),function(t,e,r,n,i){switch(i){case"center":r=n=0;break;case"bottom":r=0,n=1;break;case"right":r=1,n=0;break;case"left":r=-1,n=0;break;case"top":r=0,n=-1;break;case"start":r=-r,n=-n;break;case"end":break;default:i*=Math.PI/180,r=Math.cos(i),n=Math.sin(i)}return{x:t,y:e,vx:r,vy:n}}(r,n,t.vx,t.vy,e.align)}var s={arc:function(t,e){var r=(t.startAngle+t.endAngle)/2,n=Math.cos(r),i=Math.sin(r),a=t.innerRadius,s=t.outerRadius;return o({x0:t.x+n*a,y0:t.y+i*a,x1:t.x+n*s,y1:t.y+i*s,vx:n,vy:i},e)},point:function(t,e){var r=i(t,e.origin),n=r.x*t.radius,a=r.y*t.radius;return o({x0:t.x-n,y0:t.y-a,x1:t.x+n,y1:t.y+a,vx:r.x,vy:r.y},e)},rect:function(t,e){var r=i(t,e.origin),n=t.x,a=t.y,s=0,l=0;return t.horizontal?(n=Math.min(t.x,t.base),s=Math.abs(t.base-t.x)):(a=Math.min(t.y,t.base),l=Math.abs(t.base-t.y)),o({x0:n,y0:a+l,x1:n+s,y1:a,vx:r.x,vy:r.y},e)},fallback:function(t,e){var r=i(t,e.origin);return o({x0:t.x,y0:t.y,x1:t.x,y1:t.y,vx:r.x,vy:r.y},e)}},l=t.helpers,u=n.rasterize;function c(t){var e=t._model.horizontal,r=t._scale||e&&t._xScale||t._yScale;if(!r)return null;if(void 0!==r.xCenter&&void 0!==r.yCenter)return{x:r.xCenter,y:r.yCenter};var n=r.getBasePixel();return e?{x:n,y:null}:{x:null,y:n}}function d(t,e,r){var n=t.shadowBlur,i=r.stroked,a=u(r.x),o=u(r.y),s=u(r.w);i&&t.strokeText(e,a,o,s),r.filled&&(n&&i&&(t.shadowBlur=0),t.fillText(e,a,o,s),n&&i&&(t.shadowBlur=n))}var h=function(t,e,r,n){var i=this;i._config=t,i._index=n,i._model=null,i._rects=null,i._ctx=e,i._el=r};l.extend(h.prototype,{_modelize:function(e,r,i,a){var o,u=this,d=u._index,h=l.options.resolve,f=n.parseFont(h([i.font,{}],a,d)),p=h([i.color,t.defaults.global.defaultFontColor],a,d);return{align:h([i.align,"center"],a,d),anchor:h([i.anchor,"center"],a,d),area:a.chart.chartArea,backgroundColor:h([i.backgroundColor,null],a,d),borderColor:h([i.borderColor,null],a,d),borderRadius:h([i.borderRadius,0],a,d),borderWidth:h([i.borderWidth,0],a,d),clamp:h([i.clamp,!1],a,d),clip:h([i.clip,!1],a,d),color:p,display:e,font:f,lines:r,offset:h([i.offset,0],a,d),opacity:h([i.opacity,1],a,d),origin:c(u._el),padding:l.options.toPadding(h([i.padding,0],a,d)),positioner:(o=u._el,o instanceof t.elements.Arc?s.arc:o instanceof t.elements.Point?s.point:o instanceof t.elements.Rectangle?s.rect:s.fallback),rotation:h([i.rotation,0],a,d)*(Math.PI/180),size:n.textSize(u._ctx,r,f),textAlign:h([i.textAlign,"start"],a,d),textShadowBlur:h([i.textShadowBlur,0],a,d),textShadowColor:h([i.textShadowColor,p],a,d),textStrokeColor:h([i.textStrokeColor,p],a,d),textStrokeWidth:h([i.textStrokeWidth,0],a,d)}},update:function(t){var e,r,i,a=this,o=null,s=null,u=a._index,c=a._config,d=l.options.resolve([c.display,!0],t,u);d&&(e=t.dataset.data[u],r=l.valueOrDefault(l.callback(c.formatter,[e,t]),e),(i=l.isNullOrUndef(r)?[]:n.toTextLines(r)).length&&(s=function(t){var e=t.borderWidth||0,r=t.padding,n=t.size.height,i=t.size.width,a=-i/2,o=-n/2;return{frame:{x:a-r.left-e,y:o-r.top-e,w:i+r.width+2*e,h:n+r.height+2*e},text:{x:a,y:o,w:i,h:n}}}(o=a._modelize(d,i,c,t)))),a._model=o,a._rects=s},geometry:function(){return this._rects?this._rects.frame:{}},rotation:function(){return this._model?this._model.rotation:0},visible:function(){return this._model&&this._model.opacity},model:function(){return this._model},draw:function(t,e){var r,i=t.ctx,a=this._model,o=this._rects;this.visible()&&(i.save(),a.clip&&(r=a.area,i.beginPath(),i.rect(r.left,r.top,r.right-r.left,r.bottom-r.top),i.clip()),i.globalAlpha=n.bound(0,a.opacity,1),i.translate(u(e.x),u(e.y)),i.rotate(a.rotation),function(t,e,r){var n=r.backgroundColor,i=r.borderColor,a=r.borderWidth;(n||i&&a)&&(t.beginPath(),l.canvas.roundedRect(t,u(e.x)+a/2,u(e.y)+a/2,u(e.w)-a,u(e.h)-a,r.borderRadius),t.closePath(),n&&(t.fillStyle=n,t.fill()),i&&a&&(t.strokeStyle=i,t.lineWidth=a,t.lineJoin="miter",t.stroke()))}(i,o.frame,a),function(t,e,r,n){var i,a=n.textAlign,o=n.color,s=!!o,l=n.font,u=e.length,c=n.textStrokeColor,h=n.textStrokeWidth,f=c&&h;if(u&&(s||f))for(r=function(t,e,r){var n=r.lineHeight,i=t.w,a=t.x;return"center"===e?a+=i/2:"end"!==e&&"right"!==e||(a+=i),{h:n,w:i,x:a,y:t.y+n/2}}(r,a,l),t.font=l.string,t.textAlign=a,t.textBaseline="middle",t.shadowBlur=n.textShadowBlur,t.shadowColor=n.textShadowColor,s&&(t.fillStyle=o),f&&(t.lineJoin="round",t.lineWidth=h,t.strokeStyle=c),i=0,u=e.length;i<u;++i)d(t,e[i],{stroked:f,filled:s,w:r.w,x:r.x,y:r.y+r.h*i})}(i,a.lines,o.text,a),i.restore())}});var f=t.helpers,p=Number.MIN_SAFE_INTEGER||-9007199254740991,g=Number.MAX_SAFE_INTEGER||9007199254740991;function v(t,e,r){var n=Math.cos(r),i=Math.sin(r),a=e.x,o=e.y;return{x:a+n*(t.x-a)-i*(t.y-o),y:o+i*(t.x-a)+n*(t.y-o)}}function m(t,e){var r,n,i,a,o,s=g,l=p,u=e.origin;for(r=0;r<t.length;++r)i=(n=t[r]).x-u.x,a=n.y-u.y,o=e.vx*i+e.vy*a,s=Math.min(s,o),l=Math.max(l,o);return{min:s,max:l}}function y(t,e){var r=e.x-t.x,n=e.y-t.y,i=Math.sqrt(r*r+n*n);return{vx:(e.x-t.x)/i,vy:(e.y-t.y)/i,origin:t,ln:i}}var b=function(){this._rotation=0,this._rect={x:0,y:0,w:0,h:0}};function E(t,e,r){var n=e.positioner(t,e),i=n.vx,a=n.vy;if(!i&&!a)return{x:n.x,y:n.y};var o=r.w,s=r.h,l=e.rotation,u=Math.abs(o/2*Math.cos(l))+Math.abs(s/2*Math.sin(l)),c=Math.abs(o/2*Math.sin(l))+Math.abs(s/2*Math.cos(l)),d=1/Math.max(Math.abs(i),Math.abs(a));return u*=i*d,c*=a*d,u+=e.offset*i,c+=e.offset*a,{x:n.x+u,y:n.y+c}}f.extend(b.prototype,{center:function(){var t=this._rect;return{x:t.x+t.w/2,y:t.y+t.h/2}},update:function(t,e,r){this._rotation=r,this._rect={x:e.x+t.x,y:e.y+t.y,w:e.w,h:e.h}},contains:function(t){var e=this,r=e._rect;return!((t=v(t,e.center(),-e._rotation)).x<r.x-1||t.y<r.y-1||t.x>r.x+r.w+2||t.y>r.y+r.h+2)},intersects:function(t){var e,r,n,i=this._points(),a=t._points(),o=[y(i[0],i[1]),y(i[0],i[3])];for(this._rotation!==t._rotation&&o.push(y(a[0],a[1]),y(a[0],a[3])),e=0;e<o.length;++e)if(r=m(i,o[e]),n=m(a,o[e]),r.max<n.min||n.max<r.min)return!1;return!0},_points:function(){var t=this,e=t._rect,r=t._rotation,n=t.center();return[v({x:e.x,y:e.y},n,r),v({x:e.x+e.w,y:e.y},n,r),v({x:e.x+e.w,y:e.y+e.h},n,r),v({x:e.x,y:e.y+e.h},n,r)]}});var x={prepare:function(t){var e,r,n,i,a,o=[];for(e=0,n=t.length;e<n;++e)for(r=0,i=t[e].length;r<i;++r)a=t[e][r],o.push(a),a.$layout={_box:new b,_hidable:!1,_visible:!0,_set:e,_idx:r};return o.sort((function(t,e){var r=t.$layout,n=e.$layout;return r._idx===n._idx?n._set-r._set:n._idx-r._idx})),this.update(o),o},update:function(t){var e,r,n,i,a,o=!1;for(e=0,r=t.length;e<r;++e)i=(n=t[e]).model(),(a=n.$layout)._hidable=i&&"auto"===i.display,a._visible=n.visible(),o|=a._hidable;o&&function(t){var e,r,n,i,a,o;for(e=0,r=t.length;e<r;++e)(i=(n=t[e]).$layout)._visible&&(a=n.geometry(),o=E(n._el._model,n.model(),a),i._box.update(o,a,n.rotation()));(function(t,e){var r,n,i,a;for(r=t.length-1;r>=0;--r)for(i=t[r].$layout,n=r-1;n>=0&&i._visible;--n)(a=t[n].$layout)._visible&&i._box.intersects(a._box)&&e(i,a)})(t,(function(t,e){var r=t._hidable,n=e._hidable;r&&n||n?e._visible=!1:r&&(t._visible=!1)}))}(t)},lookup:function(t,e){var r,n;for(r=t.length-1;r>=0;--r)if((n=t[r].$layout)&&n._visible&&n._box.contains(e))return t[r];return null},draw:function(t,e){var r,n,i,a,o,s;for(r=0,n=e.length;r<n;++r)(a=(i=e[r]).$layout)._visible&&(o=i.geometry(),s=E(i._el._view,i.model(),o),a._box.update(s,o,i.rotation()),i.draw(t,s))}},S=t.helpers,T={align:"center",anchor:"center",backgroundColor:null,borderColor:null,borderRadius:0,borderWidth:0,clamp:!1,clip:!1,color:void 0,display:!0,font:{family:void 0,lineHeight:1.2,size:void 0,style:void 0,weight:null},formatter:function(t){if(S.isNullOrUndef(t))return null;var e,r,n,i=t;if(S.isObject(t))if(S.isNullOrUndef(t.label))if(S.isNullOrUndef(t.r))for(i="",n=0,r=(e=Object.keys(t)).length;n<r;++n)i+=(0!==n?", ":"")+e[n]+": "+t[e[n]];else i=t.r;else i=t.label;return""+i},labels:void 0,listeners:{},offset:4,opacity:1,padding:{top:4,right:4,bottom:4,left:4},rotation:0,textAlign:"start",textStrokeColor:void 0,textStrokeWidth:0,textShadowBlur:0,textShadowColor:void 0},w=t.helpers,_="$datalabels",A="$default";function k(t,e,r){if(e){var n,i=r.$context,a=r.$groups;e[a._set]&&(n=e[a._set][a._key])&&!0===w.callback(n,[i])&&(t[_]._dirty=!0,r.update(i))}}function C(t,e){var r,n,i=t[_],a=i._listeners;if(a.enter||a.leave){if("mousemove"===e.type)n=x.lookup(i._labels,e);else if("mouseout"!==e.type)return;r=i._hovered,i._hovered=n,function(t,e,r,n){var i,a;(r||n)&&(r?n?r!==n&&(a=i=!0):a=!0:i=!0,a&&k(t,e.leave,r),i&&k(t,e.enter,n))}(t,a,r,n)}}t.defaults.global.plugins.datalabels=T;var D={id:"datalabels",beforeInit:function(t){t[_]={_actives:[]}},beforeUpdate:function(t){var e=t[_];e._listened=!1,e._listeners={},e._datasets=[],e._labels=[]},afterDatasetUpdate:function(t,e,r){var n,i,a,o,s,l,u,c,d=e.index,f=t[_],p=f._datasets[d]=[],g=t.isDatasetVisible(d),v=t.data.datasets[d],m=function(t,e){var r,n,i=t.datalabels,a={},o=[];return!1===i?null:(!0===i&&(i={}),e=w.merge({},[e,i]),r=e.labels||{},n=Object.keys(r),delete e.labels,n.length?n.forEach((function(t){r[t]&&o.push(w.merge({},[e,r[t],{_key:t}]))})):o.push(e),a=o.reduce((function(t,e){return w.each(e.listeners||{},(function(r,n){t[n]=t[n]||{},t[n][e._key||A]=r})),delete e.listeners,t}),{}),{labels:o,listeners:a})}(v,r),y=e.meta.data||[],b=t.ctx;for(b.save(),n=0,a=y.length;n<a;++n)if((u=y[n])[_]=[],g&&u&&!u.hidden&&!u._model.skip)for(i=0,o=m.labels.length;i<o;++i)l=(s=m.labels[i])._key,(c=new h(s,b,u,n)).$groups={_set:d,_key:l||A},c.$context={active:!1,chart:t,dataIndex:n,dataset:v,datasetIndex:d},c.update(c.$context),u[_].push(c),p.push(c);b.restore(),w.merge(f._listeners,m.listeners,{merger:function(t,r,n){r[t]=r[t]||{},r[t][e.index]=n[t],f._listened=!0}})},afterUpdate:function(t,e){t[_]._labels=x.prepare(t[_]._datasets,e)},afterDatasetsDraw:function(t){x.draw(t,t[_]._labels)},beforeEvent:function(t,e){if(t[_]._listened)switch(e.type){case"mousemove":case"mouseout":C(t,e);break;case"click":!function(t,e){var r=t[_],n=r._listeners.click,i=n&&x.lookup(r._labels,e);i&&k(t,n,i)}(t,e)}},afterEvent:function(e){var r,i,a,o,s,l,u,c=e[_],d=c._actives,h=c._actives=e.lastActive||[],f=n.arrayDiff(d,h);for(r=0,i=f.length;r<i;++r)if((s=f[r])[1])for(a=0,o=(u=s[0][_]||[]).length;a<o;++a)(l=u[a]).$context.active=1===s[1],l.update(l.$context);(c._dirty||f.length)&&(x.update(c._labels),function(e){if(!e.animating){for(var r=t.animationService.animations,n=0,i=r.length;n<i;++n)if(r[n].chart===e)return;e.render({duration:1,lazy:!0})}}(e)),delete c._dirty}};return t.plugins.register(D),D}(r(21095))},27820:function(t,e,r){t.exports=function(t){"use strict";var e=(t=t&&t.hasOwnProperty("default")?t.default:t).helpers,r=e.options||{},n=e.extend(r,{resolve:r.resolve||function(t,r,n){var i,a,o;for(i=0,a=t.length;i<a;++i)if(void 0!==(o=t[i])&&(void 0!==r&&"function"==typeof o&&(o=o(r)),void 0!==n&&e.isArray(o)&&(o=o[n]),void 0!==o))return o}}),i=t.helpers,a=n.resolve,o=1e6;function s(t){return-1!==t.indexOf("Color")}var l={styleKeys:["shadowOffsetX","shadowOffsetY","shadowBlur","shadowColor","bevelWidth","bevelHighlightColor","bevelShadowColor","innerGlowWidth","innerGlowColor","outerGlowWidth","outerGlowColor","backgroundOverlayColor","backgroundOverlayMode"],lineStyleKeys:["shadowOffsetX","shadowOffsetY","shadowBlur","shadowColor","outerGlowWidth","outerGlowColor"],pointStyleKeys:["pointShadowOffsetX","pointShadowOffsetY","pointShadowBlur","pointShadowColor","pointBevelWidth","pointBevelHighlightColor","pointBevelShadowColor","pointInnerGlowWidth","pointInnerGlowColor","pointOuterGlowWidth","pointOuterGlowColor","pointBackgroundOverlayColor","pointBackgroundOverlayMode"],hoverStyleKeys:["hoverShadowOffsetX","hoverShadowOffsetY","hoverShadowBlur","hoverShadowColor","hoverBevelWidth","hoverBevelHighlightColor","hoverBevelShadowColor","hoverInnerGlowWidth","hoverInnerGlowColor","hoverOuterGlowWidth","hoverOuterGlowColor","hoverBackgroundOverlayColor","hoverBackgroundOverlayMode"],pointHoverStyleKeys:["pointHoverShadowOffsetX","pointHoverShadowOffsetY","pointHoverShadowBlur","pointHoverShadowColor","pointHoverBevelWidth","pointHoverBevelHighlightColor","pointHoverBevelShadowColor","pointHoverInnerGlowWidth","pointHoverInnerGlowColor","pointHoverOuterGlowWidth","pointHoverOuterGlowColor","pointHoverBackgroundOverlayColor","pointHoverBackgroundOverlayMode"],drawBackground:function(t,e){var r=t.borderWidth;t.borderWidth=0,e(),t.borderWidth=r},drawBorder:function(t,e){var r=t.backgroundColor;t.borderWidth&&(t.backgroundColor="rgba(0, 0, 0, 0)",e(),t.backgroundColor=r)},drawShadow:function(t,e,r,n){var i=t.ctx,a=t.currentDevicePixelRatio;i.save(),i.shadowOffsetX=(e.shadowOffsetX+o)*a,i.shadowOffsetY=e.shadowOffsetY*a,i.shadowBlur=e.shadowBlur*a,i.shadowColor=e.shadowColor,n&&(i.globalCompositeOperation="destination-over"),i.translate(-o,0),r(),i.restore()},setPath:function(t,e){t.save(),t.beginPath(),t.clip(),e(),t.restore()},drawBevel:function(t,e,r){var n,i,a=t.ctx,s=t.currentDevicePixelRatio,l=5*s/6,u=e.bevelWidth*l,c=e.borderWidth,d=e.parsedBorderWidth;u&&(n=this.opaque(e.borderColor)?d?{top:u+d.top*s,left:u+d.left*s,bottom:u+d.bottom*s,right:u+d.right*s}:{top:i=u+(c>0?c:0)*s/2,left:i,bottom:i,right:i}:{top:u,left:u,bottom:u,right:u},a.save(),this.setPath(a,r),a.clip(),a.translate(-o,0),this.setPath(a,r),a.rect(0,0,t.width,t.height),a.fillStyle="black",a.shadowOffsetX=o*s-n.right,a.shadowOffsetY=-n.bottom,a.shadowBlur=u,a.shadowColor=e.bevelShadowColor,navigator&&navigator.userAgent.match("Windows.+Firefox")||(a.globalCompositeOperation="source-atop"),a.fill("evenodd"),a.shadowOffsetX=o*s+n.left,a.shadowOffsetY=n.top,a.shadowColor=e.bevelHighlightColor,a.fill("evenodd"),a.restore())},drawGlow:function(t,e,r,n){var i=t.ctx,a=n?e.outerGlowWidth:e.innerGlowWidth,s=e.borderWidth,l=t.currentDevicePixelRatio;a&&(i.save(),this.setPath(i,r),n&&i.rect(0,0,t.width,t.height),i.clip("evenodd"),i.translate(-o,0),this.setPath(i,r),n||i.rect(0,0,t.width,t.height),i.lineWidth=s,i.strokeStyle="black",i.fillStyle="black",i.shadowOffsetX=o*l,i.shadowBlur=a*l,i.shadowColor=n?e.outerGlowColor:e.innerGlowColor,i.fill("evenodd"),s&&i.stroke(),i.restore())},drawInnerGlow:function(t,e,r){this.drawGlow(t,e,r)},drawOuterGlow:function(t,e,r){this.drawGlow(t,e,r,!0)},drawBackgroundOverlay:function(t,e,r){var n=t.ctx,i=e.backgroundOverlayColor;i&&(n.save(),this.setPath(n,r),n.fillStyle=i,n.globalCompositeOperation=e.backgroundOverlayMode,n.fill(),n.restore())},opaque:function(t){return i.color(t).alpha()>0},getHoverColor:function(t){return void 0!==t?i.getHoverColor(t):t},mergeStyle:function(t,e){if(void 0!==t&&void 0!==e)return this.styleKeys.forEach((function(r){t[r]=e[r]})),t},setHoverStyle:function(t,e){var r,n,i=this.styleKeys,a=this.hoverStyleKeys;if(void 0!==t&&void 0!==e){for(r=0,n=i.length;r<n;++r)t[i[r]]=e[a[r]];return t}},saveStyle:function(t){var e=t._model,r=t.$previousStyle;r&&this.mergeStyle(r,e)},resolveStyle:function(t,e,r,n){var i,o,l,u,c=this,d=t.chart,h=d.data.datasets[t.index],f=e.custom||{},p=c.styleKeys,g=c.hoverStyleKeys,v={},m={chart:d,dataIndex:r,dataset:h,datasetIndex:e._datasetIndex};for(i=0,o=p.length;i<o;++i)v[l=p[i]]=u=a([f[l],h[l],n[l]],m,r),v[l=g[i]]=a([f[l],h[l],n[l],s(l)?c.getHoverColor(u):u],m,r);return v},resolveLineStyle:function(t,e,r){var n,i,o,s=t.chart,l=s.data.datasets[t.index],u=e.custom||{},c=this.lineStyleKeys,d={},h={chart:s,dataset:l,datasetIndex:e._datasetIndex};for(n=0,i=c.length;n<i;++n)d[o=c[n]]=a([u[o],l[o],r[o]],h);return d},resolvePointStyle:function(t,e,r,n){var i,o,l,u,c=this,d=t.chart,h=d.data.datasets[t.index],f=e.custom||{},p=c.styleKeys,g=c.hoverStyleKeys,v=c.pointStyleKeys,m=c.pointHoverStyleKeys,y={},b={chart:d,dataIndex:r,dataset:h,datasetIndex:e._datasetIndex};for(i=0,o=p.length;i<o;++i)y[l=p[i]]=u=a([f[l],h[v[i]],h[l],n[l]],b,r),y[l=g[i]]=a([f[l],h[m[i]],n[l],s(l)?c.getHoverColor(u):u],b,r);return y}},u=t.helpers;function c(t,e){if(void 0===e)return t;var r=u.color(t);return r.alpha(e*r.alpha()).rgbaString()}var d=t.Tooltip,h=d.extend({initialize:function(){var t=this;d.prototype.initialize.apply(t,arguments),l.mergeStyle(t._model,t._options)},update:function(){var t=this;return d.prototype.update.apply(t,arguments),l.mergeStyle(t._model,t._options),t},drawBackground:function(t,e,r,n,i){var a=this,o=arguments,s=a._chart,h=u.extend({},e,{bevelHighlightColor:c(e.bevelHighlightColor,i),bevelShadowColor:c(e.bevelShadowColor,i),innerGlowColor:c(e.innerGlowColor,i),outerGlowColor:c(e.outerGlowColor,i)}),f=function(){d.prototype.drawBackground.apply(a,o)};l.drawShadow(s,e,f),l.opaque(e.backgroundColor)&&(l.drawBackground(e,f),l.drawBevel(s,h,f)),l.drawInnerGlow(s,h,f),l.drawOuterGlow(s,h,f),l.drawBorder(e,f)}}),f=t.elements.Rectangle,p=f.extend({draw:function(){var t=this,e=arguments,r=t._chart,n=t._view,i=function(){f.prototype.draw.apply(t,e)},a=function(){t.setPath()};l.drawShadow(r,n,i,!0),l.opaque(n.backgroundColor)&&(l.drawBackground(n,i),l.drawBackgroundOverlay(r,n,a),l.drawBevel(r,n,a)),l.drawInnerGlow(r,n,a),l.drawOuterGlow(r,n,a),l.drawBorder(n,i)},setPath:function(){var t,e,r,n,i=this._chart.ctx,a=this._view;void 0!==a.width?(t=a.x-a.width/2,r=a.width,e=Math.min(a.y,a.base),n=Math.abs(a.y-a.base)):(t=Math.min(a.x,a.base),r=Math.abs(a.x-a.base),e=a.y-a.height/2,n=a.height),i.rect(t,e,r,n)}}),g=t.helpers.extend;function v(t,e,r){return t===e?r:t===r?e:t}function m(t){var e,r,n,i,a,o,s=t.borderWidth,l=function(t){var e=t.borderSkipped,r={};return e?(t.horizontal?t.base>t.x&&(e=v(e,"left","right")):t.base<t.y&&(e=v(e,"bottom","top")),r[e]=!0,r):r}(t);return void 0!==t.width?(e=t.width/2,r=Math.abs(t.y-t.base)/2):(e=Math.abs(t.x-t.base)/2,r=t.height/2),null!==s&&"[object Object]"===Object.prototype.toString.call(s)?(n=+s.top||0,i=+s.right||0,a=+s.bottom||0,o=+s.left||0):n=i=a=o=+s||0,{top:l.top||n<0?0:n>r?r:n,right:l.right||i<0?0:i>e?e:i,bottom:l.bottom||a<0?0:a>r?r:a,left:l.left||o<0?0:o>e?e:o}}var y=t.controllers.bar,b=y.extend({dataElementType:p,updateElement:function(t,e){var r=this,n=l.resolveStyle(r,t,e,r.chart.options.elements.rectangle),i={};Object.defineProperty(t,"_model",{configurable:!0,get:function(){return i},set:function(t){g(i,t,n)}}),y.prototype.updateElement.apply(r,arguments),delete t._model,t._model=g(i,{parsedBorderWidth:m(i)}),t._styleOptions=n},setHoverStyle:function(t){var e=this;y.prototype.setHoverStyle.apply(e,arguments),l.saveStyle(t),l.setHoverStyle(t._model,t._styleOptions)},removeHoverStyle:function(t){var e=this;t.$previousStyle||l.mergeStyle(t._model,t._styleOptions),y.prototype.removeHoverStyle.apply(e,arguments)}}),E=t.helpers.canvas._isPointInArea||function(t,e){var r=1e-6;return t.x>e.left-r&&t.x<e.right+r&&t.y>e.top-r&&t.y<e.bottom+r},x=t.elements.Point,S=x.extend({draw:function(t){var e=this,r=arguments,n=e._chart,i=e._view,a=function(){x.prototype.draw.apply(e,r)};i.skip||void 0!==t&&!E(i,t)||(l.drawShadow(n,i,a,!0),l.opaque(i.backgroundColor)&&(l.drawBackground(i,a),l.drawBackgroundOverlay(n,i,a),l.drawBevel(n,i,a)),l.drawInnerGlow(n,i,a),l.drawOuterGlow(n,i,a),l.drawBorder(i,a))}}),T=t.helpers.extend,w=t.controllers.bubble,_=w.extend({dataElementType:S,updateElement:function(t,e){var r=this,n=l.resolveStyle(r,t,e,r.chart.options.elements.point),i={};Object.defineProperty(t,"_model",{configurable:!0,get:function(){return i},set:function(t){T(i,t,n)}}),w.prototype.updateElement.apply(r,arguments),delete t._model,t._model=i,t._styleOptions=n},setHoverStyle:function(t){var e=this;w.prototype.setHoverStyle.apply(e,arguments),l.saveStyle(t),l.setHoverStyle(t._model,t._styleOptions)},removeHoverStyle:function(t){var e=this;t.$previousStyle||l.mergeStyle(t._model,t._styleOptions),w.prototype.removeHoverStyle.apply(e,arguments)}}),A=t.helpers,k=t.elements.Arc,C=k.extend({draw:function(){var t=this,e=arguments,r=t._chart,n=t._view,i=function(){k.prototype.draw.apply(t,e)};l.drawShadow(r,n,i,!0),l.opaque(n.backgroundColor)&&(l.drawBackground(n,i),l.drawBackgroundOverlay(r,n,i),l.drawBevel(r,"inner"===n.borderAlign?A.extend({},n,{borderWidth:2*n.borderWidth}):n,i)),l.drawInnerGlow(r,n,i),l.drawOuterGlow(r,n,i),l.drawBorder(n,i)}}),D=t.defaults,L=t.helpers.extend,R=n.resolve;D.doughnut.legend.labels.generateLabels=D.pie.legend.labels.generateLabels=function(t){var e=t.data;return e.labels.length&&e.datasets.length?e.labels.map((function(r,n){var i=t.getDatasetMeta(0),a=e.datasets[0],o=i.data[n]||{},s=o.custom||{},u=t.options.elements.arc,c=R([s.backgroundColor,a.backgroundColor,u.backgroundColor],void 0,n),d=R([s.borderColor,a.borderColor,u.borderColor],void 0,n),h=R([s.borderWidth,a.borderWidth,u.borderWidth],void 0,n);return L({text:r,fillStyle:c,strokeStyle:d,lineWidth:h,hidden:isNaN(a.data[n])||i.data[n].hidden,index:n},l.resolveStyle(i.controller,o,n,u))})):[]};var I=t.controllers.doughnut,O=I.extend({dataElementType:C,updateElement:function(t,e){var r=this,n=l.resolveStyle(r,t,e,r.chart.options.elements.arc),i={};Object.defineProperty(t,"_model",{configurable:!0,get:function(){return i},set:function(t){L(i,t,n)}}),I.prototype.updateElement.apply(r,arguments),delete t._model,t._model=i,t._styleOptions=n},setHoverStyle:function(t){var e=this;I.prototype.setHoverStyle.apply(e,arguments),l.saveStyle(t),l.setHoverStyle(t._model,t._styleOptions)},removeHoverStyle:function(t){var e=this;t.$previousStyle||l.mergeStyle(t._model,t._styleOptions),I.prototype.removeHoverStyle.apply(e,arguments)}}),M=b.extend({_getValueScaleId:function(){return this.getMeta().xAxisID},_getIndexScaleId:function(){return this.getMeta().yAxisID},getValueScaleId:function(){return this.getMeta().xAxisID},getIndexScaleId:function(){return this.getMeta().yAxisID}}),P=t.elements.Line,F=P.extend({draw:function(){var t=this,e=arguments,r=t._chart,n=t._view,i=function(){P.prototype.draw.apply(t,e)};l.drawShadow(r,n,i),l.drawShadow(r,{shadowOffsetX:0,shadowOffsetY:0,shadowBlur:n.outerGlowWidth,shadowColor:n.outerGlowColor},i),l.drawBorder(n,i)}}),N=t.helpers.extend,B=t.controllers.line,U=B.extend({datasetElementType:F,dataElementType:S,update:function(){var t=this,e=t.getMeta().dataset,r=l.resolveLineStyle(t,e,t.chart.options.elements.line),n={};Object.defineProperty(e,"_model",{configurable:!0,get:function(){return n},set:function(t){N(n,t,r)}}),B.prototype.update.apply(t,arguments),delete e._model,e._model=n,e._styleOptions=r},updateElement:function(t,e){var r=this,n=l.resolvePointStyle(r,t,e,r.chart.options.elements.point);B.prototype.updateElement.apply(r,arguments),N(t._model,n),t._styleOptions=n},setHoverStyle:function(t){var e=this;B.prototype.setHoverStyle.apply(e,arguments),l.saveStyle(t),l.setHoverStyle(t._model,t._styleOptions)},removeHoverStyle:function(t){var e=this;t.$previousStyle||l.mergeStyle(t._model,t._styleOptions),B.prototype.removeHoverStyle.apply(e,arguments)}}),j=t.helpers.extend,H=n.resolve;t.defaults.polarArea.legend.labels.generateLabels=function(t){var e=t.data;return e.labels.length&&e.datasets.length?e.labels.map((function(r,n){var i=t.getDatasetMeta(0),a=e.datasets[0],o=i.data[n]||{},s=o.custom||{},u=t.options.elements.arc,c=H([s.backgroundColor,a.backgroundColor,u.backgroundColor],void 0,n),d=H([s.borderColor,a.borderColor,u.borderColor],void 0,n),h=H([s.borderWidth,a.borderWidth,u.borderWidth],void 0,n);return j({text:r,fillStyle:c,strokeStyle:d,lineWidth:h,hidden:isNaN(a.data[n])||i.data[n].hidden,index:n},l.resolveStyle(i.controller,o,n,u))})):[]};var G=t.controllers.polarArea,z=G.extend({dataElementType:C,updateElement:function(t,e){var r=this,n=l.resolveStyle(r,t,e,r.chart.options.elements.arc),i={};Object.defineProperty(t,"_model",{configurable:!0,get:function(){return i},set:function(t){j(i,t,n)}}),G.prototype.updateElement.apply(r,arguments),delete t._model,t._model=i,t._styleOptions=n},setHoverStyle:function(t){var e=this;G.prototype.setHoverStyle.apply(e,arguments),l.saveStyle(t),l.setHoverStyle(t._model,t._styleOptions)},removeHoverStyle:function(t){var e=this;t.$previousStyle||l.mergeStyle(t._model,t._styleOptions),G.prototype.removeHoverStyle.apply(e,arguments)}}),V=t.helpers.extend,W=t.controllers.radar,K=W.extend({datasetElementType:F,dataElementType:S,update:function(){var t=this,e=t.getMeta().dataset,r=l.resolveLineStyle(t,e,t.chart.options.elements.line),n={};Object.defineProperty(e,"_model",{configurable:!0,get:function(){return n},set:function(t){V(n,t,r)}}),W.prototype.update.apply(t,arguments),delete e._model,e._model=n,e._styleOptions=r},updateElement:function(t,e){var r=this,n=l.resolvePointStyle(r,t,e,r.chart.options.elements.point);W.prototype.updateElement.apply(r,arguments),V(t._model,n),t._styleOptions=n},setHoverStyle:function(t){var e=this;W.prototype.setHoverStyle.apply(e,arguments),l.saveStyle(t),l.setHoverStyle(t._model,t._styleOptions)},removeHoverStyle:function(t){var e=this;t.$previousStyle||l.mergeStyle(t._model,t._styleOptions),W.prototype.removeHoverStyle.apply(e,arguments)}}),Y=t.defaults,q=t.helpers,X=t.layouts||t.layoutService,$=q.valueOrDefault||q.getValueOrDefault,Q=q.valueAtIndexOrDefault||q.getValueAtIndexOrDefault,J=q.mergeIf||function(t,e){return q.configMerge.call(this,e,t)},Z=q.extend;function tt(t,e,r){var n=t.ctx;l.drawShadow(t,e,r,!0),l.opaque(n.fillStyle)&&(n.save(),n.strokeStyle="rgba(0, 0, 0, 0)",r(),l.drawBackgroundOverlay(t,e,r),l.drawBevel(t,e,r),n.restore()),l.drawInnerGlow(t,e,r),l.drawOuterGlow(t,e,r),n.fillStyle="rgba(0, 0, 0, 0)",r(),n.restore()}Y.global.legend.labels.generateLabels=function(t){var e=t.data,r=t.options.legend||{},n=r.labels&&r.labels.usePointStyle;return q.isArray(e.datasets)?e.datasets.map((function(e,r){var i,a,o=t.getDatasetMeta(r),s=o.controller,u=t.options.elements;return n?(i=o.data[0]||{},a=l.resolvePointStyle(s,i,r,u.point)):o.dataset?(i=o.dataset,a=l.resolveLineStyle(s,i,u.line)):(i=o.data[0]||{},a=l.resolveStyle(s,i,r,o.bar?u.rectangle:u.point)),Z({text:e.label,fillStyle:Q(e.backgroundColor,0),hidden:!t.isDatasetVisible(r),lineCap:e.borderCapStyle,lineDash:e.borderDash,lineDashOffset:e.borderDashOffset,lineJoin:e.borderJoinStyle,lineWidth:e.borderWidth,strokeStyle:e.borderColor,pointStyle:e.pointStyle,datasetIndex:r},a)}),this):[]};var et=t.Legend.extend({draw:function(){var e,r=this,n=r.chart,i=Y.global,a=q.each,o=q.canvas.drawPoint,s=r.ctx;q.each=function(t,r){a(t,(function(t){var n,a,o=Object.keys(t);for(e={},n=0,a=o.length;n<a;n++)e[o[n]]=t[o[n]];e.borderColor=$(t.strokeStyle,i.defaultColor),e.borderWidth=$(t.lineWidth,i.elements.line.borderWidth),r.apply(null,arguments)}))},q.canvas.drawPoint=function(){var t=arguments;tt(n,e,(function(){o.apply(null,t)}))},s.strokeRect=function(){},s.fillRect=function(t,r,i,a){tt(n,e,(function(){s.beginPath(),s.rect(t,r,i,a),s.fill(),0!==e.borderWidth&&s.stroke()}))},t.Legend.prototype.draw.apply(r,arguments),q.each=a,q.canvas.drawPoint=o,delete s.fillRect,delete s.strokeRect}});function rt(t,e){var r=new et({ctx:t.ctx,options:e,chart:t});X.configure(t,r,e),X.addBox(t,r),t.legend=r}var nt={id:"legend",_element:et,beforeInit:function(t){var e=t.options.legend;e&&rt(t,e)},beforeUpdate:function(t){var e=t.options.legend,r=t.legend;e?(J(e,Y.global.legend),r?(X.configure(t,r,e),r.options=e):rt(t,e)):r&&(X.removeBox(t,r),delete t.legend)},afterEvent:function(t,e){var r=t.legend;r&&r.handleEvent(e)}},it=t.helpers,at=t.layouts||t.layoutService,ot=t.plugins,st={bar:b,bubble:_,doughnut:O,horizontalBar:M,line:U,polarArea:z,pie:O,radar:K,scatter:U};function lt(){var t=this,e=[];return it.each(t.data.datasets,(function(r,n){var i=t.getDatasetMeta(n),a=r.type||t.config.type;if(i.type&&i.type!==a&&(t.destroyDatasetMeta(n),i=t.getDatasetMeta(n)),i.type=a,i.controller)i.controller.updateIndex(n),i.controller.linkScales();else{var o=st[i.type];if(void 0===o)throw new Error('"'+i.type+'" is not a chart type.');i.controller=new o(t,n),e.push(i.controller)}}),t),e}function ut(){var t=this;t.tooltip=new h({_chart:t,_chartInstance:t,_data:t.data,_options:t.options.tooltips},t)}var ct=ot.descriptors;ot.descriptors=function(t){var e=t._style;if(e){var r=t.$plugins||t._plugins||(t.$plugins=t._plugins={});if(r.id===this._cacheId)return r.descriptors;var n,i=this._plugins;this._plugins=i.map((function(t){return"legend"===t.id?nt:t}))}return n=ct.apply(this,arguments),e&&(this._plugins=i),n};var dt={id:"style",beforeInit:function(t){t._style={},t.buildOrUpdateControllers=lt,t.initToolTip=ut,t.legend&&(at.removeBox(t,t.legend),delete t.legend),delete t.$plugins,delete t._plugins,ot.descriptors(t)}};return t.plugins.register(dt),dt}(r(21095))},74435:(t,e,r)=>{var n=r(76599),i=r(92756),a=TypeError;t.exports=function(t){if(n(t))return t;throw a(i(t)+" is not a function")}},63409:(t,e,r)=>{var n=r(60898),i=r(92756),a=TypeError;t.exports=function(t){if(n(t))return t;throw a(i(t)+" is not a constructor")}},75517:(t,e,r)=>{var n=r(76599),i=String,a=TypeError;t.exports=function(t){if("object"==typeof t||n(t))return t;throw a("Can't set "+i(t)+" as a prototype")}},4634:(t,e,r)=>{var n=r(90026),i=r(79692),a=r(56973).f,o=n("unscopables"),s=Array.prototype;null==s[o]&&a(s,o,{configurable:!0,value:i(null)}),t.exports=function(t){s[o][t]=!0}},83829:(t,e,r)=>{"use strict";var n=r(68214).charAt;t.exports=function(t,e,r){return e+(r?n(t,e).length:1)}},96345:(t,e,r)=>{var n=r(29407),i=TypeError;t.exports=function(t,e){if(n(e,t))return t;throw i("Incorrect invocation")}},45511:(t,e,r)=>{var n=r(91043),i=String,a=TypeError;t.exports=function(t){if(n(t))return t;throw a(i(t)+" is not an object")}},4651:t=>{t.exports="undefined"!=typeof ArrayBuffer&&"undefined"!=typeof DataView},46144:(t,e,r)=>{var n=r(38898);t.exports=n((function(){if("function"==typeof ArrayBuffer){var t=new ArrayBuffer(8);Object.isExtensible(t)&&Object.defineProperty(t,"a",{value:8})}}))},7353:(t,e,r)=>{"use strict";var n,i,a,o=r(4651),s=r(60909),l=r(80800),u=r(76599),c=r(91043),d=r(48613),h=r(2796),f=r(92756),p=r(19382),g=r(78993),v=r(56973).f,m=r(29407),y=r(21052),b=r(16907),E=r(90026),x=r(49386),S=r(44495),T=S.enforce,w=S.get,_=l.Int8Array,A=_&&_.prototype,k=l.Uint8ClampedArray,C=k&&k.prototype,D=_&&y(_),L=A&&y(A),R=Object.prototype,I=l.TypeError,O=E("toStringTag"),M=x("TYPED_ARRAY_TAG"),P="TypedArrayConstructor",F=o&&!!b&&"Opera"!==h(l.opera),N=!1,B={Int8Array:1,Uint8Array:1,Uint8ClampedArray:1,Int16Array:2,Uint16Array:2,Int32Array:4,Uint32Array:4,Float32Array:4,Float64Array:8},U={BigInt64Array:8,BigUint64Array:8},j=function(t){var e=y(t);if(c(e)){var r=w(e);return r&&d(r,P)?r[P]:j(e)}},H=function(t){if(!c(t))return!1;var e=h(t);return d(B,e)||d(U,e)};for(n in B)(a=(i=l[n])&&i.prototype)?T(a)[P]=i:F=!1;for(n in U)(a=(i=l[n])&&i.prototype)&&(T(a)[P]=i);if((!F||!u(D)||D===Function.prototype)&&(D=function(){throw I("Incorrect invocation")},F))for(n in B)l[n]&&b(l[n],D);if((!F||!L||L===R)&&(L=D.prototype,F))for(n in B)l[n]&&b(l[n].prototype,L);if(F&&y(C)!==L&&b(C,L),s&&!d(L,O))for(n in N=!0,v(L,O,{get:function(){return c(this)?this[M]:void 0}}),B)l[n]&&p(l[n],M,n);t.exports={NATIVE_ARRAY_BUFFER_VIEWS:F,TYPED_ARRAY_TAG:N&&M,aTypedArray:function(t){if(H(t))return t;throw I("Target is not a typed array")},aTypedArrayConstructor:function(t){if(u(t)&&(!b||m(D,t)))return t;throw I(f(t)+" is not a typed array constructor")},exportTypedArrayMethod:function(t,e,r,n){if(s){if(r)for(var i in B){var a=l[i];if(a&&d(a.prototype,t))try{delete a.prototype[t]}catch(r){try{a.prototype[t]=e}catch(t){}}}L[t]&&!r||g(L,t,r?e:F&&A[t]||e,n)}},exportTypedArrayStaticMethod:function(t,e,r){var n,i;if(s){if(b){if(r)for(n in B)if((i=l[n])&&d(i,t))try{delete i[t]}catch(t){}if(D[t]&&!r)return;try{return g(D,t,r?e:F&&D[t]||e)}catch(t){}}for(n in B)!(i=l[n])||i[t]&&!r||g(i,t,e)}},getTypedArrayConstructor:j,isView:function(t){if(!c(t))return!1;var e=h(t);return"DataView"===e||d(B,e)||d(U,e)},isTypedArray:H,TypedArray:D,TypedArrayPrototype:L}},56704:(t,e,r)=>{"use strict";var n=r(80800),i=r(47497),a=r(60909),o=r(4651),s=r(2656),l=r(19382),u=r(10325),c=r(38898),d=r(96345),h=r(59802),f=r(43310),p=r(94841),g=r(20509),v=r(21052),m=r(16907),y=r(2107).f,b=r(56973).f,E=r(64230),x=r(28022),S=r(24198),T=r(44495),w=s.PROPER,_=s.CONFIGURABLE,A=T.get,k=T.set,C="ArrayBuffer",D="DataView",L="prototype",R="Wrong index",I=n[C],O=I,M=O&&O[L],P=n[D],F=P&&P[L],N=Object.prototype,B=n.Array,U=n.RangeError,j=i(E),H=i([].reverse),G=g.pack,z=g.unpack,V=function(t){return[255&t]},W=function(t){return[255&t,t>>8&255]},K=function(t){return[255&t,t>>8&255,t>>16&255,t>>24&255]},Y=function(t){return t[3]<<24|t[2]<<16|t[1]<<8|t[0]},q=function(t){return G(t,23,4)},X=function(t){return G(t,52,8)},$=function(t,e){b(t[L],e,{get:function(){return A(this)[e]}})},Q=function(t,e,r,n){var i=p(r),a=A(t);if(i+e>a.byteLength)throw U(R);var o=A(a.buffer).bytes,s=i+a.byteOffset,l=x(o,s,s+e);return n?l:H(l)},J=function(t,e,r,n,i,a){var o=p(r),s=A(t);if(o+e>s.byteLength)throw U(R);for(var l=A(s.buffer).bytes,u=o+s.byteOffset,c=n(+i),d=0;d<e;d++)l[u+d]=c[a?d:e-d-1]};if(o){var Z=w&&I.name!==C;if(c((function(){I(1)}))&&c((function(){new I(-1)}))&&!c((function(){return new I,new I(1.5),new I(NaN),1!=I.length||Z&&!_})))Z&&_&&l(I,"name",C);else{(O=function(t){return d(this,M),new I(p(t))})[L]=M;for(var tt,et=y(I),rt=0;et.length>rt;)(tt=et[rt++])in O||l(O,tt,I[tt]);M.constructor=O}m&&v(F)!==N&&m(F,N);var nt=new P(new O(2)),it=i(F.setInt8);nt.setInt8(0,2147483648),nt.setInt8(1,2147483649),!nt.getInt8(0)&&nt.getInt8(1)||u(F,{setInt8:function(t,e){it(this,t,e<<24>>24)},setUint8:function(t,e){it(this,t,e<<24>>24)}},{unsafe:!0})}else M=(O=function(t){d(this,M);var e=p(t);k(this,{bytes:j(B(e),0),byteLength:e}),a||(this.byteLength=e)})[L],F=(P=function(t,e,r){d(this,F),d(t,M);var n=A(t).byteLength,i=h(e);if(i<0||i>n)throw U("Wrong offset");if(i+(r=void 0===r?n-i:f(r))>n)throw U("Wrong length");k(this,{buffer:t,byteLength:r,byteOffset:i}),a||(this.buffer=t,this.byteLength=r,this.byteOffset=i)})[L],a&&($(O,"byteLength"),$(P,"buffer"),$(P,"byteLength"),$(P,"byteOffset")),u(F,{getInt8:function(t){return Q(this,1,t)[0]<<24>>24},getUint8:function(t){return Q(this,1,t)[0]},getInt16:function(t){var e=Q(this,2,t,arguments.length>1?arguments[1]:void 0);return(e[1]<<8|e[0])<<16>>16},getUint16:function(t){var e=Q(this,2,t,arguments.length>1?arguments[1]:void 0);return e[1]<<8|e[0]},getInt32:function(t){return Y(Q(this,4,t,arguments.length>1?arguments[1]:void 0))},getUint32:function(t){return Y(Q(this,4,t,arguments.length>1?arguments[1]:void 0))>>>0},getFloat32:function(t){return z(Q(this,4,t,arguments.length>1?arguments[1]:void 0),23)},getFloat64:function(t){return z(Q(this,8,t,arguments.length>1?arguments[1]:void 0),52)},setInt8:function(t,e){J(this,1,t,V,e)},setUint8:function(t,e){J(this,1,t,V,e)},setInt16:function(t,e){J(this,2,t,W,e,arguments.length>2?arguments[2]:void 0)},setUint16:function(t,e){J(this,2,t,W,e,arguments.length>2?arguments[2]:void 0)},setInt32:function(t,e){J(this,4,t,K,e,arguments.length>2?arguments[2]:void 0)},setUint32:function(t,e){J(this,4,t,K,e,arguments.length>2?arguments[2]:void 0)},setFloat32:function(t,e){J(this,4,t,q,e,arguments.length>2?arguments[2]:void 0)},setFloat64:function(t,e){J(this,8,t,X,e,arguments.length>2?arguments[2]:void 0)}});S(O,C),S(P,D),t.exports={ArrayBuffer:O,DataView:P}},31482:(t,e,r)=>{"use strict";var n=r(46640),i=r(39211),a=r(19720),o=r(34982),s=Math.min;t.exports=[].copyWithin||function(t,e){var r=n(this),l=a(r),u=i(t,l),c=i(e,l),d=arguments.length>2?arguments[2]:void 0,h=s((void 0===d?l:i(d,l))-c,l-u),f=1;for(c<u&&u<c+h&&(f=-1,c+=h-1,u+=h-1);h-- >0;)c in r?r[u]=r[c]:o(r,u),u+=f,c+=f;return r}},64230:(t,e,r)=>{"use strict";var n=r(46640),i=r(39211),a=r(19720);t.exports=function(t){for(var e=n(this),r=a(e),o=arguments.length,s=i(o>1?arguments[1]:void 0,r),l=o>2?arguments[2]:void 0,u=void 0===l?r:i(l,r);u>s;)e[s++]=t;return e}},824:(t,e,r)=>{"use strict";var n=r(54292).forEach,i=r(36919)("forEach");t.exports=i?[].forEach:function(t){return n(this,t,arguments.length>1?arguments[1]:void 0)}},43305:(t,e,r)=>{var n=r(19720);t.exports=function(t,e){for(var r=0,i=n(e),a=new t(i);i>r;)a[r]=e[r++];return a}},72353:(t,e,r)=>{"use strict";var n=r(66365),i=r(98004),a=r(46640),o=r(77655),s=r(53658),l=r(60898),u=r(19720),c=r(23500),d=r(38816),h=r(33706),f=Array;t.exports=function(t){var e=a(t),r=l(this),p=arguments.length,g=p>1?arguments[1]:void 0,v=void 0!==g;v&&(g=n(g,p>2?arguments[2]:void 0));var m,y,b,E,x,S,T=h(e),w=0;if(!T||this===f&&s(T))for(m=u(e),y=r?new this(m):f(m);m>w;w++)S=v?g(e[w],w):e[w],c(y,w,S);else for(x=(E=d(e,T)).next,y=r?new this:[];!(b=i(x,E)).done;w++)S=v?o(E,g,[b.value,w],!0):b.value,c(y,w,S);return y.length=w,y}},67830:(t,e,r)=>{var n=r(46603),i=r(39211),a=r(19720),o=function(t){return function(e,r,o){var s,l=n(e),u=a(l),c=i(o,u);if(t&&r!=r){for(;u>c;)if((s=l[c++])!=s)return!0}else for(;u>c;c++)if((t||c in l)&&l[c]===r)return t||c||0;return!t&&-1}};t.exports={includes:o(!0),indexOf:o(!1)}},86060:(t,e,r)=>{var n=r(66365),i=r(34783),a=r(46640),o=r(19720),s=function(t){var e=1==t;return function(r,s,l){for(var u,c=a(r),d=i(c),h=n(s,l),f=o(d);f-- >0;)if(h(u=d[f],f,c))switch(t){case 0:return u;case 1:return f}return e?-1:void 0}};t.exports={findLast:s(0),findLastIndex:s(1)}},54292:(t,e,r)=>{var n=r(66365),i=r(47497),a=r(34783),o=r(46640),s=r(19720),l=r(17983),u=i([].push),c=function(t){var e=1==t,r=2==t,i=3==t,c=4==t,d=6==t,h=7==t,f=5==t||d;return function(p,g,v,m){for(var y,b,E=o(p),x=a(E),S=n(g,v),T=s(x),w=0,_=m||l,A=e?_(p,T):r||h?_(p,0):void 0;T>w;w++)if((f||w in x)&&(b=S(y=x[w],w,E),t))if(e)A[w]=b;else if(b)switch(t){case 3:return!0;case 5:return y;case 6:return w;case 2:u(A,y)}else switch(t){case 4:return!1;case 7:u(A,y)}return d?-1:i||c?c:A}};t.exports={forEach:c(0),map:c(1),filter:c(2),some:c(3),every:c(4),find:c(5),findIndex:c(6),filterReject:c(7)}},3931:(t,e,r)=>{"use strict";var n=r(49356),i=r(46603),a=r(59802),o=r(19720),s=r(36919),l=Math.min,u=[].lastIndexOf,c=!!u&&1/[1].lastIndexOf(1,-0)<0,d=s("lastIndexOf"),h=c||!d;t.exports=h?function(t){if(c)return n(u,this,arguments)||0;var e=i(this),r=o(e),s=r-1;for(arguments.length>1&&(s=l(s,a(arguments[1]))),s<0&&(s=r+s);s>=0;s--)if(s in e&&e[s]===t)return s||0;return-1}:u},31785:(t,e,r)=>{var n=r(38898),i=r(90026),a=r(87903),o=i("species");t.exports=function(t){return a>=51||!n((function(){var e=[];return(e.constructor={})[o]=function(){return{foo:1}},1!==e[t](Boolean).foo}))}},36919:(t,e,r)=>{"use strict";var n=r(38898);t.exports=function(t,e){var r=[][t];return!!r&&n((function(){r.call(null,e||function(){return 1},1)}))}},63741:(t,e,r)=>{var n=r(74435),i=r(46640),a=r(34783),o=r(19720),s=TypeError,l=function(t){return function(e,r,l,u){n(r);var c=i(e),d=a(c),h=o(c),f=t?h-1:0,p=t?-1:1;if(l<2)for(;;){if(f in d){u=d[f],f+=p;break}if(f+=p,t?f<0:h<=f)throw s("Reduce of empty array with no initial value")}for(;t?f>=0:h>f;f+=p)f in d&&(u=r(u,d[f],f,c));return u}};t.exports={left:l(!1),right:l(!0)}},20587:(t,e,r)=>{"use strict";var n=r(60909),i=r(38283),a=TypeError,o=Object.getOwnPropertyDescriptor,s=n&&!function(){if(void 0!==this)return!0;try{Object.defineProperty([],"length",{writable:!1}).length=1}catch(t){return t instanceof TypeError}}();t.exports=s?function(t,e){if(i(t)&&!o(t,"length").writable)throw a("Cannot set read only .length");return t.length=e}:function(t,e){return t.length=e}},28022:(t,e,r)=>{var n=r(39211),i=r(19720),a=r(23500),o=Array,s=Math.max;t.exports=function(t,e,r){for(var l=i(t),u=n(e,l),c=n(void 0===r?l:r,l),d=o(s(c-u,0)),h=0;u<c;u++,h++)a(d,h,t[u]);return d.length=h,d}},87097:(t,e,r)=>{var n=r(47497);t.exports=n([].slice)},34027:(t,e,r)=>{var n=r(28022),i=Math.floor,a=function(t,e){var r=t.length,l=i(r/2);return r<8?o(t,e):s(t,a(n(t,0,l),e),a(n(t,l),e),e)},o=function(t,e){for(var r,n,i=t.length,a=1;a<i;){for(n=a,r=t[a];n&&e(t[n-1],r)>0;)t[n]=t[--n];n!==a++&&(t[n]=r)}return t},s=function(t,e,r,n){for(var i=e.length,a=r.length,o=0,s=0;o<i||s<a;)t[o+s]=o<i&&s<a?n(e[o],r[s])<=0?e[o++]:r[s++]:o<i?e[o++]:r[s++];return t};t.exports=a},42678:(t,e,r)=>{var n=r(38283),i=r(60898),a=r(91043),o=r(90026)("species"),s=Array;t.exports=function(t){var e;return n(t)&&(e=t.constructor,(i(e)&&(e===s||n(e.prototype))||a(e)&&null===(e=e[o]))&&(e=void 0)),void 0===e?s:e}},17983:(t,e,r)=>{var n=r(42678);t.exports=function(t,e){return new(n(t))(0===e?0:e)}},77003:t=>{for(var e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",r={},n=0;n<66;n++)r[e.charAt(n)]=n;t.exports={itoc:e,ctoi:r}},77655:(t,e,r)=>{var n=r(45511),i=r(15772);t.exports=function(t,e,r,a){try{return a?e(n(r)[0],r[1]):e(r)}catch(e){i(t,"throw",e)}}},82257:(t,e,r)=>{var n=r(90026)("iterator"),i=!1;try{var a=0,o={next:function(){return{done:!!a++}},return:function(){i=!0}};o[n]=function(){return this},Array.from(o,(function(){throw 2}))}catch(t){}t.exports=function(t,e){if(!e&&!i)return!1;var r=!1;try{var a={};a[n]=function(){return{next:function(){return{done:r=!0}}}},t(a)}catch(t){}return r}},54518:(t,e,r)=>{var n=r(47497),i=n({}.toString),a=n("".slice);t.exports=function(t){return a(i(t),8,-1)}},2796:(t,e,r)=>{var n=r(23026),i=r(76599),a=r(54518),o=r(90026)("toStringTag"),s=Object,l="Arguments"==a(function(){return arguments}());t.exports=n?a:function(t){var e,r,n;return void 0===t?"Undefined":null===t?"Null":"string"==typeof(r=function(t,e){try{return t[e]}catch(t){}}(e=s(t),o))?r:l?a(e):"Object"==(n=a(e))&&i(e.callee)?"Arguments":n}},46633:(t,e,r)=>{"use strict";var n=r(56973).f,i=r(79692),a=r(10325),o=r(66365),s=r(96345),l=r(98522),u=r(72842),c=r(85011),d=r(70788),h=r(72538),f=r(60909),p=r(82194).fastKey,g=r(44495),v=g.set,m=g.getterFor;t.exports={getConstructor:function(t,e,r,c){var d=t((function(t,n){s(t,h),v(t,{type:e,index:i(null),first:void 0,last:void 0,size:0}),f||(t.size=0),l(n)||u(n,t[c],{that:t,AS_ENTRIES:r})})),h=d.prototype,g=m(e),y=function(t,e,r){var n,i,a=g(t),o=b(t,e);return o?o.value=r:(a.last=o={index:i=p(e,!0),key:e,value:r,previous:n=a.last,next:void 0,removed:!1},a.first||(a.first=o),n&&(n.next=o),f?a.size++:t.size++,"F"!==i&&(a.index[i]=o)),t},b=function(t,e){var r,n=g(t),i=p(e);if("F"!==i)return n.index[i];for(r=n.first;r;r=r.next)if(r.key==e)return r};return a(h,{clear:function(){for(var t=g(this),e=t.index,r=t.first;r;)r.removed=!0,r.previous&&(r.previous=r.previous.next=void 0),delete e[r.index],r=r.next;t.first=t.last=void 0,f?t.size=0:this.size=0},delete:function(t){var e=this,r=g(e),n=b(e,t);if(n){var i=n.next,a=n.previous;delete r.index[n.index],n.removed=!0,a&&(a.next=i),i&&(i.previous=a),r.first==n&&(r.first=i),r.last==n&&(r.last=a),f?r.size--:e.size--}return!!n},forEach:function(t){for(var e,r=g(this),n=o(t,arguments.length>1?arguments[1]:void 0);e=e?e.next:r.first;)for(n(e.value,e.key,this);e&&e.removed;)e=e.previous},has:function(t){return!!b(this,t)}}),a(h,r?{get:function(t){var e=b(this,t);return e&&e.value},set:function(t,e){return y(this,0===t?0:t,e)}}:{add:function(t){return y(this,t=0===t?0:t,t)}}),f&&n(h,"size",{get:function(){return g(this).size}}),d},setStrong:function(t,e,r){var n=e+" Iterator",i=m(e),a=m(n);c(t,e,(function(t,e){v(this,{type:n,target:t,state:i(t),kind:e,last:void 0})}),(function(){for(var t=a(this),e=t.kind,r=t.last;r&&r.removed;)r=r.previous;return t.target&&(t.last=r=r?r.next:t.state.first)?d("keys"==e?r.key:"values"==e?r.value:[r.key,r.value],!1):(t.target=void 0,d(void 0,!0))}),r?"entries":"values",!r,!0),h(e)}}},76538:(t,e,r)=>{"use strict";var n=r(47497),i=r(10325),a=r(82194).getWeakData,o=r(96345),s=r(45511),l=r(98522),u=r(91043),c=r(72842),d=r(54292),h=r(48613),f=r(44495),p=f.set,g=f.getterFor,v=d.find,m=d.findIndex,y=n([].splice),b=0,E=function(t){return t.frozen||(t.frozen=new x)},x=function(){this.entries=[]},S=function(t,e){return v(t.entries,(function(t){return t[0]===e}))};x.prototype={get:function(t){var e=S(this,t);if(e)return e[1]},has:function(t){return!!S(this,t)},set:function(t,e){var r=S(this,t);r?r[1]=e:this.entries.push([t,e])},delete:function(t){var e=m(this.entries,(function(e){return e[0]===t}));return~e&&y(this.entries,e,1),!!~e}},t.exports={getConstructor:function(t,e,r,n){var d=t((function(t,i){o(t,f),p(t,{type:e,id:b++,frozen:void 0}),l(i)||c(i,t[n],{that:t,AS_ENTRIES:r})})),f=d.prototype,v=g(e),m=function(t,e,r){var n=v(t),i=a(s(e),!0);return!0===i?E(n).set(e,r):i[n.id]=r,t};return i(f,{delete:function(t){var e=v(this);if(!u(t))return!1;var r=a(t);return!0===r?E(e).delete(t):r&&h(r,e.id)&&delete r[e.id]},has:function(t){var e=v(this);if(!u(t))return!1;var r=a(t);return!0===r?E(e).has(t):r&&h(r,e.id)}}),i(f,r?{get:function(t){var e=v(this);if(u(t)){var r=a(t);return!0===r?E(e).get(t):r?r[e.id]:void 0}},set:function(t,e){return m(this,t,e)}}:{add:function(t){return m(this,t,!0)}}),d}}},39216:(t,e,r)=>{"use strict";var n=r(98646),i=r(80800),a=r(47497),o=r(28046),s=r(78993),l=r(82194),u=r(72842),c=r(96345),d=r(76599),h=r(98522),f=r(91043),p=r(38898),g=r(82257),v=r(24198),m=r(38754);t.exports=function(t,e,r){var y=-1!==t.indexOf("Map"),b=-1!==t.indexOf("Weak"),E=y?"set":"add",x=i[t],S=x&&x.prototype,T=x,w={},_=function(t){var e=a(S[t]);s(S,t,"add"==t?function(t){return e(this,0===t?0:t),this}:"delete"==t?function(t){return!(b&&!f(t))&&e(this,0===t?0:t)}:"get"==t?function(t){return b&&!f(t)?void 0:e(this,0===t?0:t)}:"has"==t?function(t){return!(b&&!f(t))&&e(this,0===t?0:t)}:function(t,r){return e(this,0===t?0:t,r),this})};if(o(t,!d(x)||!(b||S.forEach&&!p((function(){(new x).entries().next()})))))T=r.getConstructor(e,t,y,E),l.enable();else if(o(t,!0)){var A=new T,k=A[E](b?{}:-0,1)!=A,C=p((function(){A.has(1)})),D=g((function(t){new x(t)})),L=!b&&p((function(){for(var t=new x,e=5;e--;)t[E](e,e);return!t.has(-0)}));D||((T=e((function(t,e){c(t,S);var r=m(new x,t,T);return h(e)||u(e,r[E],{that:r,AS_ENTRIES:y}),r}))).prototype=S,S.constructor=T),(C||L)&&(_("delete"),_("has"),y&&_("get")),(L||k)&&_(E),b&&S.clear&&delete S.clear}return w[t]=T,n({global:!0,constructor:!0,forced:T!=x},w),v(T,t),b||r.setStrong(T,t,y),T}},34327:(t,e,r)=>{var n=r(48613),i=r(48872),a=r(63276),o=r(56973);t.exports=function(t,e,r){for(var s=i(e),l=o.f,u=a.f,c=0;c<s.length;c++){var d=s[c];n(t,d)||r&&n(r,d)||l(t,d,u(e,d))}}},35899:(t,e,r)=>{var n=r(90026)("match");t.exports=function(t){var e=/./;try{"/./"[t](e)}catch(r){try{return e[n]=!1,"/./"[t](e)}catch(t){}}return!1}},36760:(t,e,r)=>{var n=r(38898);t.exports=!n((function(){function t(){}return t.prototype.constructor=null,Object.getPrototypeOf(new t)!==t.prototype}))},13242:(t,e,r)=>{var n=r(47497),i=r(58401),a=r(82518),o=/"/g,s=n("".replace);t.exports=function(t,e,r,n){var l=a(i(t)),u="<"+e;return""!==r&&(u+=" "+r+'="'+s(a(n),o,"&quot;")+'"'),u+">"+l+"</"+e+">"}},70788:t=>{t.exports=function(t,e){return{value:t,done:e}}},19382:(t,e,r)=>{var n=r(60909),i=r(56973),a=r(95398);t.exports=n?function(t,e,r){return i.f(t,e,a(1,r))}:function(t,e,r){return t[e]=r,t}},95398:t=>{t.exports=function(t,e){return{enumerable:!(1&t),configurable:!(2&t),writable:!(4&t),value:e}}},23500:(t,e,r)=>{"use strict";var n=r(77369),i=r(56973),a=r(95398);t.exports=function(t,e,r){var o=n(e);o in t?i.f(t,o,a(0,r)):t[o]=r}},244:(t,e,r)=>{"use strict";var n=r(47497),i=r(38898),a=r(1274).start,o=RangeError,s=isFinite,l=Math.abs,u=Date.prototype,c=u.toISOString,d=n(u.getTime),h=n(u.getUTCDate),f=n(u.getUTCFullYear),p=n(u.getUTCHours),g=n(u.getUTCMilliseconds),v=n(u.getUTCMinutes),m=n(u.getUTCMonth),y=n(u.getUTCSeconds);t.exports=i((function(){return"0385-07-25T07:06:39.999Z"!=c.call(new Date(-50000000000001))}))||!i((function(){c.call(new Date(NaN))}))?function(){if(!s(d(this)))throw o("Invalid time value");var t=this,e=f(t),r=g(t),n=e<0?"-":e>9999?"+":"";return n+a(l(e),n?6:4,0)+"-"+a(m(t)+1,2,0)+"-"+a(h(t),2,0)+"T"+a(p(t),2,0)+":"+a(v(t),2,0)+":"+a(y(t),2,0)+"."+a(r,3,0)+"Z"}:c},43427:(t,e,r)=>{"use strict";var n=r(45511),i=r(50083),a=TypeError;t.exports=function(t){if(n(this),"string"===t||"default"===t)t="string";else if("number"!==t)throw a("Incorrect hint");return i(this,t)}},10159:(t,e,r)=>{var n=r(99645),i=r(56973);t.exports=function(t,e,r){return r.get&&n(r.get,e,{getter:!0}),r.set&&n(r.set,e,{setter:!0}),i.f(t,e,r)}},78993:(t,e,r)=>{var n=r(76599),i=r(56973),a=r(99645),o=r(16577);t.exports=function(t,e,r,s){s||(s={});var l=s.enumerable,u=void 0!==s.name?s.name:e;if(n(r)&&a(r,u,s),s.global)l?t[e]=r:o(e,r);else{try{s.unsafe?t[e]&&(l=!0):delete t[e]}catch(t){}l?t[e]=r:i.f(t,e,{value:r,enumerable:!1,configurable:!s.nonConfigurable,writable:!s.nonWritable})}return t}},10325:(t,e,r)=>{var n=r(78993);t.exports=function(t,e,r){for(var i in e)n(t,i,e[i],r);return t}},16577:(t,e,r)=>{var n=r(80800),i=Object.defineProperty;t.exports=function(t,e){try{i(n,t,{value:e,configurable:!0,writable:!0})}catch(r){n[t]=e}return e}},34982:(t,e,r)=>{"use strict";var n=r(92756),i=TypeError;t.exports=function(t,e){if(!delete t[e])throw i("Cannot delete property "+n(e)+" of "+n(t))}},60909:(t,e,r)=>{var n=r(38898);t.exports=!n((function(){return 7!=Object.defineProperty({},1,{get:function(){return 7}})[1]}))},99929:t=>{var e="object"==typeof document&&document.all,r=void 0===e&&void 0!==e;t.exports={all:e,IS_HTMLDDA:r}},64764:(t,e,r)=>{var n=r(80800),i=r(91043),a=n.document,o=i(a)&&i(a.createElement);t.exports=function(t){return o?a.createElement(t):{}}},31621:t=>{var e=TypeError;t.exports=function(t){if(t>9007199254740991)throw e("Maximum allowed index exceeded");return t}},86940:t=>{t.exports={IndexSizeError:{s:"INDEX_SIZE_ERR",c:1,m:1},DOMStringSizeError:{s:"DOMSTRING_SIZE_ERR",c:2,m:0},HierarchyRequestError:{s:"HIERARCHY_REQUEST_ERR",c:3,m:1},WrongDocumentError:{s:"WRONG_DOCUMENT_ERR",c:4,m:1},InvalidCharacterError:{s:"INVALID_CHARACTER_ERR",c:5,m:1},NoDataAllowedError:{s:"NO_DATA_ALLOWED_ERR",c:6,m:0},NoModificationAllowedError:{s:"NO_MODIFICATION_ALLOWED_ERR",c:7,m:1},NotFoundError:{s:"NOT_FOUND_ERR",c:8,m:1},NotSupportedError:{s:"NOT_SUPPORTED_ERR",c:9,m:1},InUseAttributeError:{s:"INUSE_ATTRIBUTE_ERR",c:10,m:1},InvalidStateError:{s:"INVALID_STATE_ERR",c:11,m:1},SyntaxError:{s:"SYNTAX_ERR",c:12,m:1},InvalidModificationError:{s:"INVALID_MODIFICATION_ERR",c:13,m:1},NamespaceError:{s:"NAMESPACE_ERR",c:14,m:1},InvalidAccessError:{s:"INVALID_ACCESS_ERR",c:15,m:1},ValidationError:{s:"VALIDATION_ERR",c:16,m:0},TypeMismatchError:{s:"TYPE_MISMATCH_ERR",c:17,m:1},SecurityError:{s:"SECURITY_ERR",c:18,m:1},NetworkError:{s:"NETWORK_ERR",c:19,m:1},AbortError:{s:"ABORT_ERR",c:20,m:1},URLMismatchError:{s:"URL_MISMATCH_ERR",c:21,m:1},QuotaExceededError:{s:"QUOTA_EXCEEDED_ERR",c:22,m:1},TimeoutError:{s:"TIMEOUT_ERR",c:23,m:1},InvalidNodeTypeError:{s:"INVALID_NODE_TYPE_ERR",c:24,m:1},DataCloneError:{s:"DATA_CLONE_ERR",c:25,m:1}}},40742:t=>{t.exports={CSSRuleList:0,CSSStyleDeclaration:0,CSSValueList:0,ClientRectList:0,DOMRectList:0,DOMStringList:0,DOMTokenList:1,DataTransferItemList:0,FileList:0,HTMLAllCollection:0,HTMLCollection:0,HTMLFormElement:0,HTMLSelectElement:0,MediaList:0,MimeTypeArray:0,NamedNodeMap:0,NodeList:1,PaintRequestList:0,Plugin:0,PluginArray:0,SVGLengthList:0,SVGNumberList:0,SVGPathSegList:0,SVGPointList:0,SVGStringList:0,SVGTransformList:0,SourceBufferList:0,StyleSheetList:0,TextTrackCueList:0,TextTrackList:0,TouchList:0}},77395:(t,e,r)=>{var n=r(64764)("span").classList,i=n&&n.constructor&&n.constructor.prototype;t.exports=i===Object.prototype?void 0:i},38964:(t,e,r)=>{var n=r(97670).match(/firefox\/(\d+)/i);t.exports=!!n&&+n[1]},59826:(t,e,r)=>{var n=r(26803),i=r(29040);t.exports=!n&&!i&&"object"==typeof window&&"object"==typeof document},38875:t=>{t.exports="function"==typeof Bun&&Bun&&"string"==typeof Bun.version},26803:t=>{t.exports="object"==typeof Deno&&Deno&&"object"==typeof Deno.version},29423:(t,e,r)=>{var n=r(97670);t.exports=/MSIE|Trident/.test(n)},71595:(t,e,r)=>{var n=r(97670);t.exports=/ipad|iphone|ipod/i.test(n)&&"undefined"!=typeof Pebble},99364:(t,e,r)=>{var n=r(97670);t.exports=/(?:ipad|iphone|ipod).*applewebkit/i.test(n)},29040:(t,e,r)=>{var n=r(6591),i=r(54518);t.exports=void 0!==n&&"process"==i(n)},99411:(t,e,r)=>{var n=r(97670);t.exports=/web0s(?!.*chrome)/i.test(n)},97670:t=>{t.exports="undefined"!=typeof navigator&&String(navigator.userAgent)||""},87903:(t,e,r)=>{var n,i,a=r(80800),o=r(97670),s=a.process,l=a.Deno,u=s&&s.versions||l&&l.version,c=u&&u.v8;c&&(i=(n=c.split("."))[0]>0&&n[0]<4?1:+(n[0]+n[1])),!i&&o&&(!(n=o.match(/Edge\/(\d+)/))||n[1]>=74)&&(n=o.match(/Chrome\/(\d+)/))&&(i=+n[1]),t.exports=i},69870:(t,e,r)=>{var n=r(97670).match(/AppleWebKit\/(\d+)\./);t.exports=!!n&&+n[1]},1836:t=>{t.exports=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"]},86179:(t,e,r)=>{var n=r(47497),i=Error,a=n("".replace),o=String(i("zxcasd").stack),s=/\n\s*at [^:]*:[^\n]*/,l=s.test(o);t.exports=function(t,e){if(l&&"string"==typeof t&&!i.prepareStackTrace)for(;e--;)t=a(t,s,"");return t}},76835:(t,e,r)=>{var n=r(19382),i=r(86179),a=r(67610),o=Error.captureStackTrace;t.exports=function(t,e,r,s){a&&(o?o(t,e):n(t,"stack",i(r,s)))}},67610:(t,e,r)=>{var n=r(38898),i=r(95398);t.exports=!n((function(){var t=Error("a");return!("stack"in t)||(Object.defineProperty(t,"stack",i(1,7)),7!==t.stack)}))},50668:(t,e,r)=>{"use strict";var n=r(60909),i=r(38898),a=r(45511),o=r(79692),s=r(24506),l=Error.prototype.toString,u=i((function(){if(n){var t=o(Object.defineProperty({},"name",{get:function(){return this===t}}));if("true"!==l.call(t))return!0}return"2: 1"!==l.call({message:1,name:2})||"Error"!==l.call({})}));t.exports=u?function(){var t=a(this),e=s(t.name,"Error"),r=s(t.message);return e?r?e+": "+r:e:r}:l},98646:(t,e,r)=>{var n=r(80800),i=r(63276).f,a=r(19382),o=r(78993),s=r(16577),l=r(34327),u=r(28046);t.exports=function(t,e){var r,c,d,h,f,p=t.target,g=t.global,v=t.stat;if(r=g?n:v?n[p]||s(p,{}):(n[p]||{}).prototype)for(c in e){if(h=e[c],d=t.dontCallGetSet?(f=i(r,c))&&f.value:r[c],!u(g?c:p+(v?".":"#")+c,t.forced)&&void 0!==d){if(typeof h==typeof d)continue;l(h,d)}(t.sham||d&&d.sham)&&a(h,"sham",!0),o(r,c,h,t)}}},38898:t=>{t.exports=function(t){try{return!!t()}catch(t){return!0}}},36633:(t,e,r)=>{"use strict";r(39707);var n=r(22536),i=r(78993),a=r(64226),o=r(38898),s=r(90026),l=r(19382),u=s("species"),c=RegExp.prototype;t.exports=function(t,e,r,d){var h=s(t),f=!o((function(){var e={};return e[h]=function(){return 7},7!=""[t](e)})),p=f&&!o((function(){var e=!1,r=/a/;return"split"===t&&((r={}).constructor={},r.constructor[u]=function(){return r},r.flags="",r[h]=/./[h]),r.exec=function(){return e=!0,null},r[h](""),!e}));if(!f||!p||r){var g=n(/./[h]),v=e(h,""[t],(function(t,e,r,i,o){var s=n(t),l=e.exec;return l===a||l===c.exec?f&&!o?{done:!0,value:g(e,r,i)}:{done:!0,value:s(r,e,i)}:{done:!1}}));i(String.prototype,t,v[0]),i(c,h,v[1])}d&&l(c[h],"sham",!0)}},35131:(t,e,r)=>{"use strict";var n=r(38283),i=r(19720),a=r(31621),o=r(66365),s=function(t,e,r,l,u,c,d,h){for(var f,p,g=u,v=0,m=!!d&&o(d,h);v<l;)v in r&&(f=m?m(r[v],v,e):r[v],c>0&&n(f)?(p=i(f),g=s(t,e,f,p,g,c-1)-1):(a(g+1),t[g]=f),g++),v++;return g};t.exports=s},29025:(t,e,r)=>{var n=r(38898);t.exports=!n((function(){return Object.isExtensible(Object.preventExtensions({}))}))},49356:(t,e,r)=>{var n=r(73985),i=Function.prototype,a=i.apply,o=i.call;t.exports="object"==typeof Reflect&&Reflect.apply||(n?o.bind(a):function(){return o.apply(a,arguments)})},66365:(t,e,r)=>{var n=r(22536),i=r(74435),a=r(73985),o=n(n.bind);t.exports=function(t,e){return i(t),void 0===e?t:a?o(t,e):function(){return t.apply(e,arguments)}}},73985:(t,e,r)=>{var n=r(38898);t.exports=!n((function(){var t=function(){}.bind();return"function"!=typeof t||t.hasOwnProperty("prototype")}))},31754:(t,e,r)=>{"use strict";var n=r(47497),i=r(74435),a=r(91043),o=r(48613),s=r(87097),l=r(73985),u=Function,c=n([].concat),d=n([].join),h={},f=function(t,e,r){if(!o(h,e)){for(var n=[],i=0;i<e;i++)n[i]="a["+i+"]";h[e]=u("C,a","return new C("+d(n,",")+")")}return h[e](t,r)};t.exports=l?u.bind:function(t){var e=i(this),r=e.prototype,n=s(arguments,1),o=function(){var r=c(n,s(arguments));return this instanceof o?f(e,r.length,r):e.apply(t,r)};return a(r)&&(o.prototype=r),o}},98004:(t,e,r)=>{var n=r(73985),i=Function.prototype.call;t.exports=n?i.bind(i):function(){return i.apply(i,arguments)}},2656:(t,e,r)=>{var n=r(60909),i=r(48613),a=Function.prototype,o=n&&Object.getOwnPropertyDescriptor,s=i(a,"name"),l=s&&"something"===function(){}.name,u=s&&(!n||n&&o(a,"name").configurable);t.exports={EXISTS:s,PROPER:l,CONFIGURABLE:u}},22536:(t,e,r)=>{var n=r(54518),i=r(47497);t.exports=function(t){if("Function"===n(t))return i(t)}},47497:(t,e,r)=>{var n=r(73985),i=Function.prototype,a=i.call,o=n&&i.bind.bind(a,a);t.exports=n?o:function(t){return function(){return a.apply(t,arguments)}}},14817:(t,e,r)=>{var n=r(80800),i=r(76599),a=function(t){return i(t)?t:void 0};t.exports=function(t,e){return arguments.length<2?a(n[t]):n[t]&&n[t][e]}},33706:(t,e,r)=>{var n=r(2796),i=r(74287),a=r(98522),o=r(42536),s=r(90026)("iterator");t.exports=function(t){if(!a(t))return i(t,s)||i(t,"@@iterator")||o[n(t)]}},38816:(t,e,r)=>{var n=r(98004),i=r(74435),a=r(45511),o=r(92756),s=r(33706),l=TypeError;t.exports=function(t,e){var r=arguments.length<2?s(t):e;if(i(r))return a(n(r,t));throw l(o(t)+" is not iterable")}},74287:(t,e,r)=>{var n=r(74435),i=r(98522);t.exports=function(t,e){var r=t[e];return i(r)?void 0:n(r)}},74979:(t,e,r)=>{var n=r(47497),i=r(46640),a=Math.floor,o=n("".charAt),s=n("".replace),l=n("".slice),u=/\$([$&'`]|\d{1,2}|<[^>]*>)/g,c=/\$([$&'`]|\d{1,2})/g;t.exports=function(t,e,r,n,d,h){var f=r+t.length,p=n.length,g=c;return void 0!==d&&(d=i(d),g=u),s(h,g,(function(i,s){var u;switch(o(s,0)){case"$":return"$";case"&":return t;case"`":return l(e,0,r);case"'":return l(e,f);case"<":u=d[l(s,1,-1)];break;default:var c=+s;if(0===c)return i;if(c>p){var h=a(c/10);return 0===h?i:h<=p?void 0===n[h-1]?o(s,1):n[h-1]+o(s,1):i}u=n[c-1]}return void 0===u?"":u}))}},80800:(t,e,r)=>{var n=function(t){return t&&t.Math==Math&&t};t.exports=n("object"==typeof globalThis&&globalThis)||n("object"==typeof window&&window)||n("object"==typeof self&&self)||n("object"==typeof r.g&&r.g)||function(){return this}()||Function("return this")()},48613:(t,e,r)=>{var n=r(47497),i=r(46640),a=n({}.hasOwnProperty);t.exports=Object.hasOwn||function(t,e){return a(i(t),e)}},20555:t=>{t.exports={}},34066:(t,e,r)=>{var n=r(51266);t.exports=function(t,e){try{1==arguments.length?n.error(t):n.error(t,e)}catch(t){}}},47876:(t,e,r)=>{var n=r(14817);t.exports=n("document","documentElement")},5393:(t,e,r)=>{var n=r(60909),i=r(38898),a=r(64764);t.exports=!n&&!i((function(){return 7!=Object.defineProperty(a("div"),"a",{get:function(){return 7}}).a}))},20509:t=>{var e=Array,r=Math.abs,n=Math.pow,i=Math.floor,a=Math.log,o=Math.LN2;t.exports={pack:function(t,s,l){var u,c,d,h=e(l),f=8*l-s-1,p=(1<<f)-1,g=p>>1,v=23===s?n(2,-24)-n(2,-77):0,m=t<0||0===t&&1/t<0?1:0,y=0;for((t=r(t))!=t||t===1/0?(c=t!=t?1:0,u=p):(u=i(a(t)/o),t*(d=n(2,-u))<1&&(u--,d*=2),(t+=u+g>=1?v/d:v*n(2,1-g))*d>=2&&(u++,d/=2),u+g>=p?(c=0,u=p):u+g>=1?(c=(t*d-1)*n(2,s),u+=g):(c=t*n(2,g-1)*n(2,s),u=0));s>=8;)h[y++]=255&c,c/=256,s-=8;for(u=u<<s|c,f+=s;f>0;)h[y++]=255&u,u/=256,f-=8;return h[--y]|=128*m,h},unpack:function(t,e){var r,i=t.length,a=8*i-e-1,o=(1<<a)-1,s=o>>1,l=a-7,u=i-1,c=t[u--],d=127&c;for(c>>=7;l>0;)d=256*d+t[u--],l-=8;for(r=d&(1<<-l)-1,d>>=-l,l+=e;l>0;)r=256*r+t[u--],l-=8;if(0===d)d=1-s;else{if(d===o)return r?NaN:c?-1/0:1/0;r+=n(2,e),d-=s}return(c?-1:1)*r*n(2,d-e)}}},34783:(t,e,r)=>{var n=r(47497),i=r(38898),a=r(54518),o=Object,s=n("".split);t.exports=i((function(){return!o("z").propertyIsEnumerable(0)}))?function(t){return"String"==a(t)?s(t,""):o(t)}:o},38754:(t,e,r)=>{var n=r(76599),i=r(91043),a=r(16907);t.exports=function(t,e,r){var o,s;return a&&n(o=e.constructor)&&o!==r&&i(s=o.prototype)&&s!==r.prototype&&a(t,s),t}},90735:(t,e,r)=>{var n=r(47497),i=r(76599),a=r(73414),o=n(Function.toString);i(a.inspectSource)||(a.inspectSource=function(t){return o(t)}),t.exports=a.inspectSource},22429:(t,e,r)=>{var n=r(91043),i=r(19382);t.exports=function(t,e){n(e)&&"cause"in e&&i(t,"cause",e.cause)}},82194:(t,e,r)=>{var n=r(98646),i=r(47497),a=r(20555),o=r(91043),s=r(48613),l=r(56973).f,u=r(2107),c=r(9677),d=r(58410),h=r(49386),f=r(29025),p=!1,g=h("meta"),v=0,m=function(t){l(t,g,{value:{objectID:"O"+v++,weakData:{}}})},y=t.exports={enable:function(){y.enable=function(){},p=!0;var t=u.f,e=i([].splice),r={};r[g]=1,t(r).length&&(u.f=function(r){for(var n=t(r),i=0,a=n.length;i<a;i++)if(n[i]===g){e(n,i,1);break}return n},n({target:"Object",stat:!0,forced:!0},{getOwnPropertyNames:c.f}))},fastKey:function(t,e){if(!o(t))return"symbol"==typeof t?t:("string"==typeof t?"S":"P")+t;if(!s(t,g)){if(!d(t))return"F";if(!e)return"E";m(t)}return t[g].objectID},getWeakData:function(t,e){if(!s(t,g)){if(!d(t))return!0;if(!e)return!1;m(t)}return t[g].weakData},onFreeze:function(t){return f&&p&&d(t)&&!s(t,g)&&m(t),t}};a[g]=!0},44495:(t,e,r)=>{var n,i,a,o=r(13282),s=r(80800),l=r(91043),u=r(19382),c=r(48613),d=r(73414),h=r(91544),f=r(20555),p="Object already initialized",g=s.TypeError,v=s.WeakMap;if(o||d.state){var m=d.state||(d.state=new v);m.get=m.get,m.has=m.has,m.set=m.set,n=function(t,e){if(m.has(t))throw g(p);return e.facade=t,m.set(t,e),e},i=function(t){return m.get(t)||{}},a=function(t){return m.has(t)}}else{var y=h("state");f[y]=!0,n=function(t,e){if(c(t,y))throw g(p);return e.facade=t,u(t,y,e),e},i=function(t){return c(t,y)?t[y]:{}},a=function(t){return c(t,y)}}t.exports={set:n,get:i,has:a,enforce:function(t){return a(t)?i(t):n(t,{})},getterFor:function(t){return function(e){var r;if(!l(e)||(r=i(e)).type!==t)throw g("Incompatible receiver, "+t+" required");return r}}}},53658:(t,e,r)=>{var n=r(90026),i=r(42536),a=n("iterator"),o=Array.prototype;t.exports=function(t){return void 0!==t&&(i.Array===t||o[a]===t)}},38283:(t,e,r)=>{var n=r(54518);t.exports=Array.isArray||function(t){return"Array"==n(t)}},31095:(t,e,r)=>{var n=r(2796);t.exports=function(t){var e=n(t);return"BigInt64Array"==e||"BigUint64Array"==e}},76599:(t,e,r)=>{var n=r(99929),i=n.all;t.exports=n.IS_HTMLDDA?function(t){return"function"==typeof t||t===i}:function(t){return"function"==typeof t}},60898:(t,e,r)=>{var n=r(47497),i=r(38898),a=r(76599),o=r(2796),s=r(14817),l=r(90735),u=function(){},c=[],d=s("Reflect","construct"),h=/^\s*(?:class|function)\b/,f=n(h.exec),p=!h.exec(u),g=function(t){if(!a(t))return!1;try{return d(u,c,t),!0}catch(t){return!1}},v=function(t){if(!a(t))return!1;switch(o(t)){case"AsyncFunction":case"GeneratorFunction":case"AsyncGeneratorFunction":return!1}try{return p||!!f(h,l(t))}catch(t){return!0}};v.sham=!0,t.exports=!d||i((function(){var t;return g(g.call)||!g(Object)||!g((function(){t=!0}))||t}))?v:g},26810:(t,e,r)=>{var n=r(48613);t.exports=function(t){return void 0!==t&&(n(t,"value")||n(t,"writable"))}},28046:(t,e,r)=>{var n=r(38898),i=r(76599),a=/#|\.prototype\./,o=function(t,e){var r=l[s(t)];return r==c||r!=u&&(i(e)?n(e):!!e)},s=o.normalize=function(t){return String(t).replace(a,".").toLowerCase()},l=o.data={},u=o.NATIVE="N",c=o.POLYFILL="P";t.exports=o},46514:(t,e,r)=>{var n=r(91043),i=Math.floor;t.exports=Number.isInteger||function(t){return!n(t)&&isFinite(t)&&i(t)===t}},98522:t=>{t.exports=function(t){return null==t}},91043:(t,e,r)=>{var n=r(76599),i=r(99929),a=i.all;t.exports=i.IS_HTMLDDA?function(t){return"object"==typeof t?null!==t:n(t)||t===a}:function(t){return"object"==typeof t?null!==t:n(t)}},20781:t=>{t.exports=!1},18609:(t,e,r)=>{var n=r(91043),i=r(54518),a=r(90026)("match");t.exports=function(t){var e;return n(t)&&(void 0!==(e=t[a])?!!e:"RegExp"==i(t))}},29611:(t,e,r)=>{var n=r(14817),i=r(76599),a=r(29407),o=r(22674),s=Object;t.exports=o?function(t){return"symbol"==typeof t}:function(t){var e=n("Symbol");return i(e)&&a(e.prototype,s(t))}},72842:(t,e,r)=>{var n=r(66365),i=r(98004),a=r(45511),o=r(92756),s=r(53658),l=r(19720),u=r(29407),c=r(38816),d=r(33706),h=r(15772),f=TypeError,p=function(t,e){this.stopped=t,this.result=e},g=p.prototype;t.exports=function(t,e,r){var v,m,y,b,E,x,S,T=r&&r.that,w=!(!r||!r.AS_ENTRIES),_=!(!r||!r.IS_RECORD),A=!(!r||!r.IS_ITERATOR),k=!(!r||!r.INTERRUPTED),C=n(e,T),D=function(t){return v&&h(v,"normal",t),new p(!0,t)},L=function(t){return w?(a(t),k?C(t[0],t[1],D):C(t[0],t[1])):k?C(t,D):C(t)};if(_)v=t.iterator;else if(A)v=t;else{if(!(m=d(t)))throw f(o(t)+" is not iterable");if(s(m)){for(y=0,b=l(t);b>y;y++)if((E=L(t[y]))&&u(g,E))return E;return new p(!1)}v=c(t,m)}for(x=_?t.next:v.next;!(S=i(x,v)).done;){try{E=L(S.value)}catch(t){h(v,"throw",t)}if("object"==typeof E&&E&&u(g,E))return E}return new p(!1)}},15772:(t,e,r)=>{var n=r(98004),i=r(45511),a=r(74287);t.exports=function(t,e,r){var o,s;i(t);try{if(!(o=a(t,"return"))){if("throw"===e)throw r;return r}o=n(o,t)}catch(t){s=!0,o=t}if("throw"===e)throw r;if(s)throw o;return i(o),r}},48298:(t,e,r)=>{"use strict";var n=r(75592).IteratorPrototype,i=r(79692),a=r(95398),o=r(24198),s=r(42536),l=function(){return this};t.exports=function(t,e,r,u){var c=e+" Iterator";return t.prototype=i(n,{next:a(+!u,r)}),o(t,c,!1,!0),s[c]=l,t}},85011:(t,e,r)=>{"use strict";var n=r(98646),i=r(98004),a=r(20781),o=r(2656),s=r(76599),l=r(48298),u=r(21052),c=r(16907),d=r(24198),h=r(19382),f=r(78993),p=r(90026),g=r(42536),v=r(75592),m=o.PROPER,y=o.CONFIGURABLE,b=v.IteratorPrototype,E=v.BUGGY_SAFARI_ITERATORS,x=p("iterator"),S="keys",T="values",w="entries",_=function(){return this};t.exports=function(t,e,r,o,p,v,A){l(r,e,o);var k,C,D,L=function(t){if(t===p&&P)return P;if(!E&&t in O)return O[t];switch(t){case S:case T:case w:return function(){return new r(this,t)}}return function(){return new r(this)}},R=e+" Iterator",I=!1,O=t.prototype,M=O[x]||O["@@iterator"]||p&&O[p],P=!E&&M||L(p),F="Array"==e&&O.entries||M;if(F&&(k=u(F.call(new t)))!==Object.prototype&&k.next&&(a||u(k)===b||(c?c(k,b):s(k[x])||f(k,x,_)),d(k,R,!0,!0),a&&(g[R]=_)),m&&p==T&&M&&M.name!==T&&(!a&&y?h(O,"name",T):(I=!0,P=function(){return i(M,this)})),p)if(C={values:L(T),keys:v?P:L(S),entries:L(w)},A)for(D in C)(E||I||!(D in O))&&f(O,D,C[D]);else n({target:e,proto:!0,forced:E||I},C);return a&&!A||O[x]===P||f(O,x,P,{name:p}),g[e]=P,C}},75592:(t,e,r)=>{"use strict";var n,i,a,o=r(38898),s=r(76599),l=r(91043),u=r(79692),c=r(21052),d=r(78993),h=r(90026),f=r(20781),p=h("iterator"),g=!1;[].keys&&("next"in(a=[].keys())?(i=c(c(a)))!==Object.prototype&&(n=i):g=!0),!l(n)||o((function(){var t={};return n[p].call(t)!==t}))?n={}:f&&(n=u(n)),s(n[p])||d(n,p,(function(){return this})),t.exports={IteratorPrototype:n,BUGGY_SAFARI_ITERATORS:g}},42536:t=>{t.exports={}},19720:(t,e,r)=>{var n=r(43310);t.exports=function(t){return n(t.length)}},99645:(t,e,r)=>{var n=r(47497),i=r(38898),a=r(76599),o=r(48613),s=r(60909),l=r(2656).CONFIGURABLE,u=r(90735),c=r(44495),d=c.enforce,h=c.get,f=String,p=Object.defineProperty,g=n("".slice),v=n("".replace),m=n([].join),y=s&&!i((function(){return 8!==p((function(){}),"length",{value:8}).length})),b=String(String).split("String"),E=t.exports=function(t,e,r){"Symbol("===g(f(e),0,7)&&(e="["+v(f(e),/^Symbol\(([^)]*)\)/,"$1")+"]"),r&&r.getter&&(e="get "+e),r&&r.setter&&(e="set "+e),(!o(t,"name")||l&&t.name!==e)&&(s?p(t,"name",{value:e,configurable:!0}):t.name=e),y&&r&&o(r,"arity")&&t.length!==r.arity&&p(t,"length",{value:r.arity});try{r&&o(r,"constructor")&&r.constructor?s&&p(t,"prototype",{writable:!1}):t.prototype&&(t.prototype=void 0)}catch(t){}var n=d(t);return o(n,"source")||(n.source=m(b,"string"==typeof e?e:"")),t};Function.prototype.toString=E((function(){return a(this)&&h(this).source||u(this)}),"toString")},29760:(t,e,r)=>{var n=r(47497),i=Map.prototype;t.exports={Map,set:n(i.set),get:n(i.get),has:n(i.has),remove:n(i.delete),proto:i}},31698:t=>{var e=Math.expm1,r=Math.exp;t.exports=!e||e(10)>22025.465794806718||e(10)<22025.465794806718||-2e-17!=e(-2e-17)?function(t){var e=+t;return 0==e?e:e>-1e-6&&e<1e-6?e+e*e/2:r(e)-1}:e},16001:(t,e,r)=>{var n=r(14489),i=Math.abs,a=Math.pow,o=a(2,-52),s=a(2,-23),l=a(2,127)*(2-s),u=a(2,-126);t.exports=Math.fround||function(t){var e,r,a=+t,c=i(a),d=n(a);return c<u?d*function(t){return t+1/o-1/o}(c/u/s)*u*s:(r=(e=(1+s/o)*c)-(e-c))>l||r!=r?d*(1/0):d*r}},86018:t=>{var e=Math.log,r=Math.LOG10E;t.exports=Math.log10||function(t){return e(t)*r}},80840:t=>{var e=Math.log;t.exports=Math.log1p||function(t){var r=+t;return r>-1e-8&&r<1e-8?r-r*r/2:e(1+r)}},14489:t=>{t.exports=Math.sign||function(t){var e=+t;return 0==e||e!=e?e:e<0?-1:1}},16612:t=>{var e=Math.ceil,r=Math.floor;t.exports=Math.trunc||function(t){var n=+t;return(n>0?r:e)(n)}},89332:(t,e,r)=>{var n,i,a,o,s,l=r(80800),u=r(66365),c=r(63276).f,d=r(55767).set,h=r(98409),f=r(99364),p=r(71595),g=r(99411),v=r(29040),m=l.MutationObserver||l.WebKitMutationObserver,y=l.document,b=l.process,E=l.Promise,x=c(l,"queueMicrotask"),S=x&&x.value;if(!S){var T=new h,w=function(){var t,e;for(v&&(t=b.domain)&&t.exit();e=T.get();)try{e()}catch(t){throw T.head&&n(),t}t&&t.enter()};f||v||g||!m||!y?!p&&E&&E.resolve?((o=E.resolve(void 0)).constructor=E,s=u(o.then,o),n=function(){s(w)}):v?n=function(){b.nextTick(w)}:(d=u(d,l),n=function(){d(w)}):(i=!0,a=y.createTextNode(""),new m(w).observe(a,{characterData:!0}),n=function(){a.data=i=!i}),S=function(t){T.head||n(),T.add(t)}}t.exports=S},97845:(t,e,r)=>{"use strict";var n=r(74435),i=TypeError,a=function(t){var e,r;this.promise=new t((function(t,n){if(void 0!==e||void 0!==r)throw i("Bad Promise constructor");e=t,r=n})),this.resolve=n(e),this.reject=n(r)};t.exports.f=function(t){return new a(t)}},24506:(t,e,r)=>{var n=r(82518);t.exports=function(t,e){return void 0===t?arguments.length<2?"":e:n(t)}},36131:(t,e,r)=>{var n=r(18609),i=TypeError;t.exports=function(t){if(n(t))throw i("The method doesn't accept regular expressions");return t}},61066:(t,e,r)=>{var n=r(80800).isFinite;t.exports=Number.isFinite||function(t){return"number"==typeof t&&n(t)}},50219:(t,e,r)=>{var n=r(80800),i=r(38898),a=r(47497),o=r(82518),s=r(93444).trim,l=r(62326),u=a("".charAt),c=n.parseFloat,d=n.Symbol,h=d&&d.iterator,f=1/c(l+"-0")!=-1/0||h&&!i((function(){c(Object(h))}));t.exports=f?function(t){var e=s(o(t)),r=c(e);return 0===r&&"-"==u(e,0)?-0:r}:c},52585:(t,e,r)=>{var n=r(80800),i=r(38898),a=r(47497),o=r(82518),s=r(93444).trim,l=r(62326),u=n.parseInt,c=n.Symbol,d=c&&c.iterator,h=/^[+-]?0x/i,f=a(h.exec),p=8!==u(l+"08")||22!==u(l+"0x16")||d&&!i((function(){u(Object(d))}));t.exports=p?function(t,e){var r=s(o(t));return u(r,e>>>0||(f(h,r)?16:10))}:u},7738:(t,e,r)=>{"use strict";var n=r(60909),i=r(47497),a=r(98004),o=r(38898),s=r(73555),l=r(52610),u=r(68858),c=r(46640),d=r(34783),h=Object.assign,f=Object.defineProperty,p=i([].concat);t.exports=!h||o((function(){if(n&&1!==h({b:1},h(f({},"a",{enumerable:!0,get:function(){f(this,"b",{value:3,enumerable:!1})}}),{b:2})).b)return!0;var t={},e={},r=Symbol(),i="abcdefghijklmnopqrst";return t[r]=7,i.split("").forEach((function(t){e[t]=t})),7!=h({},t)[r]||s(h({},e)).join("")!=i}))?function(t,e){for(var r=c(t),i=arguments.length,o=1,h=l.f,f=u.f;i>o;)for(var g,v=d(arguments[o++]),m=h?p(s(v),h(v)):s(v),y=m.length,b=0;y>b;)g=m[b++],n&&!a(f,v,g)||(r[g]=v[g]);return r}:h},79692:(t,e,r)=>{var n,i=r(45511),a=r(83110),o=r(1836),s=r(20555),l=r(47876),u=r(64764),c=r(91544),d="prototype",h="script",f=c("IE_PROTO"),p=function(){},g=function(t){return"<"+h+">"+t+"</"+h+">"},v=function(t){t.write(g("")),t.close();var e=t.parentWindow.Object;return t=null,e},m=function(){try{n=new ActiveXObject("htmlfile")}catch(t){}var t,e,r;m="undefined"!=typeof document?document.domain&&n?v(n):(e=u("iframe"),r="java"+h+":",e.style.display="none",l.appendChild(e),e.src=String(r),(t=e.contentWindow.document).open(),t.write(g("document.F=Object")),t.close(),t.F):v(n);for(var i=o.length;i--;)delete m[d][o[i]];return m()};s[f]=!0,t.exports=Object.create||function(t,e){var r;return null!==t?(p[d]=i(t),r=new p,p[d]=null,r[f]=t):r=m(),void 0===e?r:a.f(r,e)}},83110:(t,e,r)=>{var n=r(60909),i=r(82089),a=r(56973),o=r(45511),s=r(46603),l=r(73555);e.f=n&&!i?Object.defineProperties:function(t,e){o(t);for(var r,n=s(e),i=l(e),u=i.length,c=0;u>c;)a.f(t,r=i[c++],n[r]);return t}},56973:(t,e,r)=>{var n=r(60909),i=r(5393),a=r(82089),o=r(45511),s=r(77369),l=TypeError,u=Object.defineProperty,c=Object.getOwnPropertyDescriptor,d="enumerable",h="configurable",f="writable";e.f=n?a?function(t,e,r){if(o(t),e=s(e),o(r),"function"==typeof t&&"prototype"===e&&"value"in r&&f in r&&!r[f]){var n=c(t,e);n&&n[f]&&(t[e]=r.value,r={configurable:h in r?r[h]:n[h],enumerable:d in r?r[d]:n[d],writable:!1})}return u(t,e,r)}:u:function(t,e,r){if(o(t),e=s(e),o(r),i)try{return u(t,e,r)}catch(t){}if("get"in r||"set"in r)throw l("Accessors not supported");return"value"in r&&(t[e]=r.value),t}},63276:(t,e,r)=>{var n=r(60909),i=r(98004),a=r(68858),o=r(95398),s=r(46603),l=r(77369),u=r(48613),c=r(5393),d=Object.getOwnPropertyDescriptor;e.f=n?d:function(t,e){if(t=s(t),e=l(e),c)try{return d(t,e)}catch(t){}if(u(t,e))return o(!i(a.f,t,e),t[e])}},9677:(t,e,r)=>{var n=r(54518),i=r(46603),a=r(2107).f,o=r(28022),s="object"==typeof window&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[];t.exports.f=function(t){return s&&"Window"==n(t)?function(t){try{return a(t)}catch(t){return o(s)}}(t):a(i(t))}},2107:(t,e,r)=>{var n=r(27967),i=r(1836).concat("length","prototype");e.f=Object.getOwnPropertyNames||function(t){return n(t,i)}},52610:(t,e)=>{e.f=Object.getOwnPropertySymbols},21052:(t,e,r)=>{var n=r(48613),i=r(76599),a=r(46640),o=r(91544),s=r(36760),l=o("IE_PROTO"),u=Object,c=u.prototype;t.exports=s?u.getPrototypeOf:function(t){var e=a(t);if(n(e,l))return e[l];var r=e.constructor;return i(r)&&e instanceof r?r.prototype:e instanceof u?c:null}},58410:(t,e,r)=>{var n=r(38898),i=r(91043),a=r(54518),o=r(46144),s=Object.isExtensible,l=n((function(){s(1)}));t.exports=l||o?function(t){return!!i(t)&&(!o||"ArrayBuffer"!=a(t))&&(!s||s(t))}:s},29407:(t,e,r)=>{var n=r(47497);t.exports=n({}.isPrototypeOf)},27967:(t,e,r)=>{var n=r(47497),i=r(48613),a=r(46603),o=r(67830).indexOf,s=r(20555),l=n([].push);t.exports=function(t,e){var r,n=a(t),u=0,c=[];for(r in n)!i(s,r)&&i(n,r)&&l(c,r);for(;e.length>u;)i(n,r=e[u++])&&(~o(c,r)||l(c,r));return c}},73555:(t,e,r)=>{var n=r(27967),i=r(1836);t.exports=Object.keys||function(t){return n(t,i)}},68858:(t,e)=>{"use strict";var r={}.propertyIsEnumerable,n=Object.getOwnPropertyDescriptor,i=n&&!r.call({1:2},1);e.f=i?function(t){var e=n(this,t);return!!e&&e.enumerable}:r},41191:(t,e,r)=>{"use strict";var n=r(20781),i=r(80800),a=r(38898),o=r(69870);t.exports=n||!a((function(){if(!(o&&o<535)){var t=Math.random();__defineSetter__.call(null,t,(function(){})),delete i[t]}}))},16907:(t,e,r)=>{var n=r(47497),i=r(45511),a=r(75517);t.exports=Object.setPrototypeOf||("__proto__"in{}?function(){var t,e=!1,r={};try{(t=n(Object.getOwnPropertyDescriptor(Object.prototype,"__proto__").set))(r,[]),e=r instanceof Array}catch(t){}return function(r,n){return i(r),a(n),e?t(r,n):r.__proto__=n,r}}():void 0)},23102:(t,e,r)=>{var n=r(60909),i=r(47497),a=r(73555),o=r(46603),s=i(r(68858).f),l=i([].push),u=function(t){return function(e){for(var r,i=o(e),u=a(i),c=u.length,d=0,h=[];c>d;)r=u[d++],n&&!s(i,r)||l(h,t?[r,i[r]]:i[r]);return h}};t.exports={entries:u(!0),values:u(!1)}},64542:(t,e,r)=>{"use strict";var n=r(23026),i=r(2796);t.exports=n?{}.toString:function(){return"[object "+i(this)+"]"}},50083:(t,e,r)=>{var n=r(98004),i=r(76599),a=r(91043),o=TypeError;t.exports=function(t,e){var r,s;if("string"===e&&i(r=t.toString)&&!a(s=n(r,t)))return s;if(i(r=t.valueOf)&&!a(s=n(r,t)))return s;if("string"!==e&&i(r=t.toString)&&!a(s=n(r,t)))return s;throw o("Can't convert object to primitive value")}},48872:(t,e,r)=>{var n=r(14817),i=r(47497),a=r(2107),o=r(52610),s=r(45511),l=i([].concat);t.exports=n("Reflect","ownKeys")||function(t){var e=a.f(s(t)),r=o.f;return r?l(e,r(t)):e}},44871:(t,e,r)=>{var n=r(80800);t.exports=n},25291:t=>{t.exports=function(t){try{return{error:!1,value:t()}}catch(t){return{error:!0,value:t}}}},90204:(t,e,r)=>{var n=r(80800),i=r(42670),a=r(76599),o=r(28046),s=r(90735),l=r(90026),u=r(59826),c=r(26803),d=r(20781),h=r(87903),f=i&&i.prototype,p=l("species"),g=!1,v=a(n.PromiseRejectionEvent),m=o("Promise",(function(){var t=s(i),e=t!==String(i);if(!e&&66===h)return!0;if(d&&(!f.catch||!f.finally))return!0;if(!h||h<51||!/native code/.test(t)){var r=new i((function(t){t(1)})),n=function(t){t((function(){}),(function(){}))};if((r.constructor={})[p]=n,!(g=r.then((function(){}))instanceof n))return!0}return!e&&(u||c)&&!v}));t.exports={CONSTRUCTOR:m,REJECTION_EVENT:v,SUBCLASSING:g}},42670:(t,e,r)=>{var n=r(80800);t.exports=n.Promise},75856:(t,e,r)=>{var n=r(45511),i=r(91043),a=r(97845);t.exports=function(t,e){if(n(t),i(e)&&e.constructor===t)return e;var r=a.f(t);return(0,r.resolve)(e),r.promise}},30703:(t,e,r)=>{var n=r(42670),i=r(82257),a=r(90204).CONSTRUCTOR;t.exports=a||!i((function(t){n.all(t).then(void 0,(function(){}))}))},56668:(t,e,r)=>{var n=r(56973).f;t.exports=function(t,e,r){r in t||n(t,r,{configurable:!0,get:function(){return e[r]},set:function(t){e[r]=t}})}},98409:t=>{var e=function(){this.head=null,this.tail=null};e.prototype={add:function(t){var e={item:t,next:null},r=this.tail;r?r.next=e:this.head=e,this.tail=e},get:function(){var t=this.head;if(t)return null===(this.head=t.next)&&(this.tail=null),t.item}},t.exports=e},18692:(t,e,r)=>{var n=r(98004),i=r(45511),a=r(76599),o=r(54518),s=r(64226),l=TypeError;t.exports=function(t,e){var r=t.exec;if(a(r)){var u=n(r,t,e);return null!==u&&i(u),u}if("RegExp"===o(t))return n(s,t,e);throw l("RegExp#exec called on incompatible receiver")}},64226:(t,e,r)=>{"use strict";var n,i,a=r(98004),o=r(47497),s=r(82518),l=r(14704),u=r(4622),c=r(29829),d=r(79692),h=r(44495).get,f=r(61523),p=r(10158),g=c("native-string-replace",String.prototype.replace),v=RegExp.prototype.exec,m=v,y=o("".charAt),b=o("".indexOf),E=o("".replace),x=o("".slice),S=(i=/b*/g,a(v,n=/a/,"a"),a(v,i,"a"),0!==n.lastIndex||0!==i.lastIndex),T=u.BROKEN_CARET,w=void 0!==/()??/.exec("")[1];(S||w||T||f||p)&&(m=function(t){var e,r,n,i,o,u,c,f=this,p=h(f),_=s(t),A=p.raw;if(A)return A.lastIndex=f.lastIndex,e=a(m,A,_),f.lastIndex=A.lastIndex,e;var k=p.groups,C=T&&f.sticky,D=a(l,f),L=f.source,R=0,I=_;if(C&&(D=E(D,"y",""),-1===b(D,"g")&&(D+="g"),I=x(_,f.lastIndex),f.lastIndex>0&&(!f.multiline||f.multiline&&"\n"!==y(_,f.lastIndex-1))&&(L="(?: "+L+")",I=" "+I,R++),r=new RegExp("^(?:"+L+")",D)),w&&(r=new RegExp("^"+L+"$(?!\\s)",D)),S&&(n=f.lastIndex),i=a(v,C?r:f,I),C?i?(i.input=x(i.input,R),i[0]=x(i[0],R),i.index=f.lastIndex,f.lastIndex+=i[0].length):f.lastIndex=0:S&&i&&(f.lastIndex=f.global?i.index+i[0].length:n),w&&i&&i.length>1&&a(g,i[0],r,(function(){for(o=1;o<arguments.length-2;o++)void 0===arguments[o]&&(i[o]=void 0)})),i&&k)for(i.groups=u=d(null),o=0;o<k.length;o++)u[(c=k[o])[0]]=i[c[1]];return i}),t.exports=m},14704:(t,e,r)=>{"use strict";var n=r(45511);t.exports=function(){var t=n(this),e="";return t.hasIndices&&(e+="d"),t.global&&(e+="g"),t.ignoreCase&&(e+="i"),t.multiline&&(e+="m"),t.dotAll&&(e+="s"),t.unicode&&(e+="u"),t.unicodeSets&&(e+="v"),t.sticky&&(e+="y"),e}},17328:(t,e,r)=>{var n=r(98004),i=r(48613),a=r(29407),o=r(14704),s=RegExp.prototype;t.exports=function(t){var e=t.flags;return void 0!==e||"flags"in s||i(t,"flags")||!a(s,t)?e:n(o,t)}},4622:(t,e,r)=>{var n=r(38898),i=r(80800).RegExp,a=n((function(){var t=i("a","y");return t.lastIndex=2,null!=t.exec("abcd")})),o=a||n((function(){return!i("a","y").sticky})),s=a||n((function(){var t=i("^r","gy");return t.lastIndex=2,null!=t.exec("str")}));t.exports={BROKEN_CARET:s,MISSED_STICKY:o,UNSUPPORTED_Y:a}},61523:(t,e,r)=>{var n=r(38898),i=r(80800).RegExp;t.exports=n((function(){var t=i(".","s");return!(t.dotAll&&t.exec("\n")&&"s"===t.flags)}))},10158:(t,e,r)=>{var n=r(38898),i=r(80800).RegExp;t.exports=n((function(){var t=i("(?<a>b)","g");return"b"!==t.exec("b").groups.a||"bc"!=="b".replace(t,"$<a>c")}))},58401:(t,e,r)=>{var n=r(98522),i=TypeError;t.exports=function(t){if(n(t))throw i("Can't call method on "+t);return t}},20824:t=>{t.exports=Object.is||function(t,e){return t===e?0!==t||1/t==1/e:t!=t&&e!=e}},97739:(t,e,r)=>{"use strict";var n,i=r(80800),a=r(49356),o=r(76599),s=r(38875),l=r(97670),u=r(87097),c=r(67539),d=i.Function,h=/MSIE .\./.test(l)||s&&((n=i.Bun.version.split(".")).length<3||0==n[0]&&(n[1]<3||3==n[1]&&0==n[2]));t.exports=function(t,e){var r=e?2:1;return h?function(n,i){var s=c(arguments.length,1)>r,l=o(n)?n:d(n),h=s?u(arguments,r):[],f=s?function(){a(l,this,h)}:l;return e?t(f,i):t(f)}:t}},49146:(t,e,r)=>{var n=r(47497),i=Set.prototype;t.exports={Set,add:n(i.add),has:n(i.has),remove:n(i.delete),proto:i,$has:i.has,$keys:i.keys}},72538:(t,e,r)=>{"use strict";var n=r(14817),i=r(56973),a=r(90026),o=r(60909),s=a("species");t.exports=function(t){var e=n(t),r=i.f;o&&e&&!e[s]&&r(e,s,{configurable:!0,get:function(){return this}})}},24198:(t,e,r)=>{var n=r(56973).f,i=r(48613),a=r(90026)("toStringTag");t.exports=function(t,e,r){t&&!r&&(t=t.prototype),t&&!i(t,a)&&n(t,a,{configurable:!0,value:e})}},91544:(t,e,r)=>{var n=r(29829),i=r(49386),a=n("keys");t.exports=function(t){return a[t]||(a[t]=i(t))}},73414:(t,e,r)=>{var n=r(80800),i=r(16577),a="__core-js_shared__",o=n[a]||i(a,{});t.exports=o},29829:(t,e,r)=>{var n=r(20781),i=r(73414);(t.exports=function(t,e){return i[t]||(i[t]=void 0!==e?e:{})})("versions",[]).push({version:"3.27.2",mode:n?"pure":"global",copyright:"© 2014-2023 Denis Pushkarev (zloirock.ru)",license:"https://github.com/zloirock/core-js/blob/v3.27.2/LICENSE",source:"https://github.com/zloirock/core-js"})},73370:(t,e,r)=>{var n=r(45511),i=r(63409),a=r(98522),o=r(90026)("species");t.exports=function(t,e){var r,s=n(t).constructor;return void 0===s||a(r=n(s)[o])?e:i(r)}},31373:(t,e,r)=>{var n=r(38898);t.exports=function(t){return n((function(){var e=""[t]('"');return e!==e.toLowerCase()||e.split('"').length>3}))}},68214:(t,e,r)=>{var n=r(47497),i=r(59802),a=r(82518),o=r(58401),s=n("".charAt),l=n("".charCodeAt),u=n("".slice),c=function(t){return function(e,r){var n,c,d=a(o(e)),h=i(r),f=d.length;return h<0||h>=f?t?"":void 0:(n=l(d,h))<55296||n>56319||h+1===f||(c=l(d,h+1))<56320||c>57343?t?s(d,h):n:t?u(d,h,h+2):c-56320+(n-55296<<10)+65536}};t.exports={codeAt:c(!1),charAt:c(!0)}},40796:(t,e,r)=>{var n=r(97670);t.exports=/Version\/10(?:\.\d+){1,2}(?: [\w./]+)?(?: Mobile\/\w+)? Safari\//.test(n)},1274:(t,e,r)=>{var n=r(47497),i=r(43310),a=r(82518),o=r(81968),s=r(58401),l=n(o),u=n("".slice),c=Math.ceil,d=function(t){return function(e,r,n){var o,d,h=a(s(e)),f=i(r),p=h.length,g=void 0===n?" ":a(n);return f<=p||""==g?h:((d=l(g,c((o=f-p)/g.length))).length>o&&(d=u(d,0,o)),t?h+d:d+h)}};t.exports={start:d(!1),end:d(!0)}},30629:(t,e,r)=>{var n=r(47497),i=2147483647,a=/[^\0-\u007E]/,o=/[.\u3002\uFF0E\uFF61]/g,s="Overflow: input needs wider integers to process",l=RangeError,u=n(o.exec),c=Math.floor,d=String.fromCharCode,h=n("".charCodeAt),f=n([].join),p=n([].push),g=n("".replace),v=n("".split),m=n("".toLowerCase),y=function(t){return t+22+75*(t<26)},b=function(t,e,r){var n=0;for(t=r?c(t/700):t>>1,t+=c(t/e);t>455;)t=c(t/35),n+=36;return c(n+36*t/(t+38))},E=function(t){var e=[];t=function(t){for(var e=[],r=0,n=t.length;r<n;){var i=h(t,r++);if(i>=55296&&i<=56319&&r<n){var a=h(t,r++);56320==(64512&a)?p(e,((1023&i)<<10)+(1023&a)+65536):(p(e,i),r--)}else p(e,i)}return e}(t);var r,n,a=t.length,o=128,u=0,g=72;for(r=0;r<t.length;r++)(n=t[r])<128&&p(e,d(n));var v=e.length,m=v;for(v&&p(e,"-");m<a;){var E=i;for(r=0;r<t.length;r++)(n=t[r])>=o&&n<E&&(E=n);var x=m+1;if(E-o>c((i-u)/x))throw l(s);for(u+=(E-o)*x,o=E,r=0;r<t.length;r++){if((n=t[r])<o&&++u>i)throw l(s);if(n==o){for(var S=u,T=36;;){var w=T<=g?1:T>=g+26?26:T-g;if(S<w)break;var _=S-w,A=36-w;p(e,d(y(w+_%A))),S=c(_/A),T+=36}p(e,d(y(S))),g=b(u,x,m==v),u=0,m++}}u++,o++}return f(e,"")};t.exports=function(t){var e,r,n=[],i=v(g(m(t),o,"."),".");for(e=0;e<i.length;e++)r=i[e],p(n,u(a,r)?"xn--"+E(r):r);return f(n,".")}},81968:(t,e,r)=>{"use strict";var n=r(59802),i=r(82518),a=r(58401),o=RangeError;t.exports=function(t){var e=i(a(this)),r="",s=n(t);if(s<0||s==1/0)throw o("Wrong number of repetitions");for(;s>0;(s>>>=1)&&(e+=e))1&s&&(r+=e);return r}},84886:(t,e,r)=>{"use strict";var n=r(93444).end,i=r(85536);t.exports=i("trimEnd")?function(){return n(this)}:"".trimEnd},85536:(t,e,r)=>{var n=r(2656).PROPER,i=r(38898),a=r(62326);t.exports=function(t){return i((function(){return!!a[t]()||"​…᠎"!=="​…᠎"[t]()||n&&a[t].name!==t}))}},30397:(t,e,r)=>{"use strict";var n=r(93444).start,i=r(85536);t.exports=i("trimStart")?function(){return n(this)}:"".trimStart},93444:(t,e,r)=>{var n=r(47497),i=r(58401),a=r(82518),o=r(62326),s=n("".replace),l="["+o+"]",u=RegExp("^"+l+l+"*"),c=RegExp(l+l+"*$"),d=function(t){return function(e){var r=a(i(e));return 1&t&&(r=s(r,u,"")),2&t&&(r=s(r,c,"")),r}};t.exports={start:d(1),end:d(2),trim:d(3)}},88322:(t,e,r)=>{var n=r(87903),i=r(38898);t.exports=!!Object.getOwnPropertySymbols&&!i((function(){var t=Symbol();return!String(t)||!(Object(t)instanceof Symbol)||!Symbol.sham&&n&&n<41}))},42008:(t,e,r)=>{var n=r(98004),i=r(14817),a=r(90026),o=r(78993);t.exports=function(){var t=i("Symbol"),e=t&&t.prototype,r=e&&e.valueOf,s=a("toPrimitive");e&&!e[s]&&o(e,s,(function(t){return n(r,this)}),{arity:1})}},85732:(t,e,r)=>{var n=r(88322);t.exports=n&&!!Symbol.for&&!!Symbol.keyFor},55767:(t,e,r)=>{var n,i,a,o,s=r(80800),l=r(49356),u=r(66365),c=r(76599),d=r(48613),h=r(38898),f=r(47876),p=r(87097),g=r(64764),v=r(67539),m=r(99364),y=r(29040),b=s.setImmediate,E=s.clearImmediate,x=s.process,S=s.Dispatch,T=s.Function,w=s.MessageChannel,_=s.String,A=0,k={},C="onreadystatechange";h((function(){n=s.location}));var D=function(t){if(d(k,t)){var e=k[t];delete k[t],e()}},L=function(t){return function(){D(t)}},R=function(t){D(t.data)},I=function(t){s.postMessage(_(t),n.protocol+"//"+n.host)};b&&E||(b=function(t){v(arguments.length,1);var e=c(t)?t:T(t),r=p(arguments,1);return k[++A]=function(){l(e,void 0,r)},i(A),A},E=function(t){delete k[t]},y?i=function(t){x.nextTick(L(t))}:S&&S.now?i=function(t){S.now(L(t))}:w&&!m?(o=(a=new w).port2,a.port1.onmessage=R,i=u(o.postMessage,o)):s.addEventListener&&c(s.postMessage)&&!s.importScripts&&n&&"file:"!==n.protocol&&!h(I)?(i=I,s.addEventListener("message",R,!1)):i=C in g("script")?function(t){f.appendChild(g("script"))[C]=function(){f.removeChild(this),D(t)}}:function(t){setTimeout(L(t),0)}),t.exports={set:b,clear:E}},91090:(t,e,r)=>{var n=r(47497);t.exports=n(1..valueOf)},39211:(t,e,r)=>{var n=r(59802),i=Math.max,a=Math.min;t.exports=function(t,e){var r=n(t);return r<0?i(r+e,0):a(r,e)}},99750:(t,e,r)=>{var n=r(61736),i=TypeError;t.exports=function(t){var e=n(t,"number");if("number"==typeof e)throw i("Can't convert number to bigint");return BigInt(e)}},94841:(t,e,r)=>{var n=r(59802),i=r(43310),a=RangeError;t.exports=function(t){if(void 0===t)return 0;var e=n(t),r=i(e);if(e!==r)throw a("Wrong length or index");return r}},46603:(t,e,r)=>{var n=r(34783),i=r(58401);t.exports=function(t){return n(i(t))}},59802:(t,e,r)=>{var n=r(16612);t.exports=function(t){var e=+t;return e!=e||0===e?0:n(e)}},43310:(t,e,r)=>{var n=r(59802),i=Math.min;t.exports=function(t){return t>0?i(n(t),9007199254740991):0}},46640:(t,e,r)=>{var n=r(58401),i=Object;t.exports=function(t){return i(n(t))}},15009:(t,e,r)=>{var n=r(35767),i=RangeError;t.exports=function(t,e){var r=n(t);if(r%e)throw i("Wrong offset");return r}},35767:(t,e,r)=>{var n=r(59802),i=RangeError;t.exports=function(t){var e=n(t);if(e<0)throw i("The argument can't be less than 0");return e}},61736:(t,e,r)=>{var n=r(98004),i=r(91043),a=r(29611),o=r(74287),s=r(50083),l=r(90026),u=TypeError,c=l("toPrimitive");t.exports=function(t,e){if(!i(t)||a(t))return t;var r,l=o(t,c);if(l){if(void 0===e&&(e="default"),r=n(l,t,e),!i(r)||a(r))return r;throw u("Can't convert object to primitive value")}return void 0===e&&(e="number"),s(t,e)}},77369:(t,e,r)=>{var n=r(61736),i=r(29611);t.exports=function(t){var e=n(t,"string");return i(e)?e:e+""}},23026:(t,e,r)=>{var n={};n[r(90026)("toStringTag")]="z",t.exports="[object z]"===String(n)},82518:(t,e,r)=>{var n=r(2796),i=String;t.exports=function(t){if("Symbol"===n(t))throw TypeError("Cannot convert a Symbol value to a string");return i(t)}},15946:(t,e,r)=>{var n=r(29040);t.exports=function(t){try{if(n)return Function('return require("'+t+'")')()}catch(t){}}},92756:t=>{var e=String;t.exports=function(t){try{return e(t)}catch(t){return"Object"}}},52087:(t,e,r)=>{"use strict";var n=r(98646),i=r(80800),a=r(98004),o=r(60909),s=r(43489),l=r(7353),u=r(56704),c=r(96345),d=r(95398),h=r(19382),f=r(46514),p=r(43310),g=r(94841),v=r(15009),m=r(77369),y=r(48613),b=r(2796),E=r(91043),x=r(29611),S=r(79692),T=r(29407),w=r(16907),_=r(2107).f,A=r(15159),k=r(54292).forEach,C=r(72538),D=r(56973),L=r(63276),R=r(44495),I=r(38754),O=R.get,M=R.set,P=R.enforce,F=D.f,N=L.f,B=Math.round,U=i.RangeError,j=u.ArrayBuffer,H=j.prototype,G=u.DataView,z=l.NATIVE_ARRAY_BUFFER_VIEWS,V=l.TYPED_ARRAY_TAG,W=l.TypedArray,K=l.TypedArrayPrototype,Y=l.aTypedArrayConstructor,q=l.isTypedArray,X="BYTES_PER_ELEMENT",$="Wrong length",Q=function(t,e){Y(t);for(var r=0,n=e.length,i=new t(n);n>r;)i[r]=e[r++];return i},J=function(t,e){F(t,e,{get:function(){return O(this)[e]}})},Z=function(t){var e;return T(H,t)||"ArrayBuffer"==(e=b(t))||"SharedArrayBuffer"==e},tt=function(t,e){return q(t)&&!x(e)&&e in t&&f(+e)&&e>=0},et=function(t,e){return e=m(e),tt(t,e)?d(2,t[e]):N(t,e)},rt=function(t,e,r){return e=m(e),!(tt(t,e)&&E(r)&&y(r,"value"))||y(r,"get")||y(r,"set")||r.configurable||y(r,"writable")&&!r.writable||y(r,"enumerable")&&!r.enumerable?F(t,e,r):(t[e]=r.value,t)};o?(z||(L.f=et,D.f=rt,J(K,"buffer"),J(K,"byteOffset"),J(K,"byteLength"),J(K,"length")),n({target:"Object",stat:!0,forced:!z},{getOwnPropertyDescriptor:et,defineProperty:rt}),t.exports=function(t,e,r){var o=t.match(/\d+$/)[0]/8,l=t+(r?"Clamped":"")+"Array",u="get"+t,d="set"+t,f=i[l],m=f,y=m&&m.prototype,b={},x=function(t,e){F(t,e,{get:function(){return function(t,e){var r=O(t);return r.view[u](e*o+r.byteOffset,!0)}(this,e)},set:function(t){return function(t,e,n){var i=O(t);r&&(n=(n=B(n))<0?0:n>255?255:255&n),i.view[d](e*o+i.byteOffset,n,!0)}(this,e,t)},enumerable:!0})};z?s&&(m=e((function(t,e,r,n){return c(t,y),I(E(e)?Z(e)?void 0!==n?new f(e,v(r,o),n):void 0!==r?new f(e,v(r,o)):new f(e):q(e)?Q(m,e):a(A,m,e):new f(g(e)),t,m)})),w&&w(m,W),k(_(f),(function(t){t in m||h(m,t,f[t])})),m.prototype=y):(m=e((function(t,e,r,n){c(t,y);var i,s,l,u=0,d=0;if(E(e)){if(!Z(e))return q(e)?Q(m,e):a(A,m,e);i=e,d=v(r,o);var h=e.byteLength;if(void 0===n){if(h%o)throw U($);if((s=h-d)<0)throw U($)}else if((s=p(n)*o)+d>h)throw U($);l=s/o}else l=g(e),i=new j(s=l*o);for(M(t,{buffer:i,byteOffset:d,byteLength:s,length:l,view:new G(i)});u<l;)x(t,u++)})),w&&w(m,W),y=m.prototype=S(K)),y.constructor!==m&&h(y,"constructor",m),P(y).TypedArrayConstructor=m,V&&h(y,V,l);var T=m!=f;b[l]=m,n({global:!0,constructor:!0,forced:T,sham:!z},b),X in m||h(m,X,o),X in y||h(y,X,o),C(l)}):t.exports=function(){}},43489:(t,e,r)=>{var n=r(80800),i=r(38898),a=r(82257),o=r(7353).NATIVE_ARRAY_BUFFER_VIEWS,s=n.ArrayBuffer,l=n.Int8Array;t.exports=!o||!i((function(){l(1)}))||!i((function(){new l(-1)}))||!a((function(t){new l,new l(null),new l(1.5),new l(t)}),!0)||i((function(){return 1!==new l(new s(2),1,void 0).length}))},23445:(t,e,r)=>{var n=r(43305),i=r(50056);t.exports=function(t,e){return n(i(t),e)}},15159:(t,e,r)=>{var n=r(66365),i=r(98004),a=r(63409),o=r(46640),s=r(19720),l=r(38816),u=r(33706),c=r(53658),d=r(31095),h=r(7353).aTypedArrayConstructor,f=r(99750);t.exports=function(t){var e,r,p,g,v,m,y,b,E=a(this),x=o(t),S=arguments.length,T=S>1?arguments[1]:void 0,w=void 0!==T,_=u(x);if(_&&!c(_))for(b=(y=l(x,_)).next,x=[];!(m=i(b,y)).done;)x.push(m.value);for(w&&S>2&&(T=n(T,arguments[2])),r=s(x),p=new(h(E))(r),g=d(p),e=0;r>e;e++)v=w?T(x[e],e):x[e],p[e]=g?f(v):+v;return p}},50056:(t,e,r)=>{var n=r(7353),i=r(73370),a=n.aTypedArrayConstructor,o=n.getTypedArrayConstructor;t.exports=function(t){return a(i(t,o(t)))}},49386:(t,e,r)=>{var n=r(47497),i=0,a=Math.random(),o=n(1..toString);t.exports=function(t){return"Symbol("+(void 0===t?"":t)+")_"+o(++i+a,36)}},1380:(t,e,r)=>{var n=r(38898),i=r(90026),a=r(20781),o=i("iterator");t.exports=!n((function(){var t=new URL("b?a=1&b=2&c=3","http://a"),e=t.searchParams,r="";return t.pathname="c%20d",e.forEach((function(t,n){e.delete("b"),r+=n+t})),a&&!t.toJSON||!e.sort||"http://a/c%20d?a=1&c=3"!==t.href||"3"!==e.get("c")||"a=1"!==String(new URLSearchParams("?a=1"))||!e[o]||"a"!==new URL("https://a@b").username||"b"!==new URLSearchParams(new URLSearchParams("a=b")).get("a")||"xn--e1aybc"!==new URL("http://тест").host||"#%D0%B1"!==new URL("http://a#б").hash||"a1c3"!==r||"x"!==new URL("http://x",void 0).host}))},22674:(t,e,r)=>{var n=r(88322);t.exports=n&&!Symbol.sham&&"symbol"==typeof Symbol.iterator},82089:(t,e,r)=>{var n=r(60909),i=r(38898);t.exports=n&&i((function(){return 42!=Object.defineProperty((function(){}),"prototype",{value:42,writable:!1}).prototype}))},67539:t=>{var e=TypeError;t.exports=function(t,r){if(t<r)throw e("Not enough arguments");return t}},13282:(t,e,r)=>{var n=r(80800),i=r(76599),a=n.WeakMap;t.exports=i(a)&&/native code/.test(String(a))},53833:(t,e,r)=>{var n=r(44871),i=r(48613),a=r(35223),o=r(56973).f;t.exports=function(t){var e=n.Symbol||(n.Symbol={});i(e,t)||o(e,t,{value:a.f(t)})}},35223:(t,e,r)=>{var n=r(90026);e.f=n},90026:(t,e,r)=>{var n=r(80800),i=r(29829),a=r(48613),o=r(49386),s=r(88322),l=r(22674),u=n.Symbol,c=i("wks"),d=l?u.for||u:u&&u.withoutSetter||o;t.exports=function(t){return a(c,t)||(c[t]=s&&a(u,t)?u[t]:d("Symbol."+t)),c[t]}},62326:t=>{t.exports="\t\n\v\f\r                 \u2028\u2029\ufeff"},91817:(t,e,r)=>{"use strict";var n=r(14817),i=r(48613),a=r(19382),o=r(29407),s=r(16907),l=r(34327),u=r(56668),c=r(38754),d=r(24506),h=r(22429),f=r(76835),p=r(60909),g=r(20781);t.exports=function(t,e,r,v){var m="stackTraceLimit",y=v?2:1,b=t.split("."),E=b[b.length-1],x=n.apply(null,b);if(x){var S=x.prototype;if(!g&&i(S,"cause")&&delete S.cause,!r)return x;var T=n("Error"),w=e((function(t,e){var r=d(v?e:t,void 0),n=v?new x(t):new x;return void 0!==r&&a(n,"message",r),f(n,w,n.stack,2),this&&o(S,this)&&c(n,this,w),arguments.length>y&&h(n,arguments[y]),n}));if(w.prototype=S,"Error"!==E?s?s(w,T):l(w,T,{name:!0}):p&&m in x&&(u(w,x,m),u(w,x,"prepareStackTrace")),l(w,x),!g)try{S.name!==E&&a(S,"name",E),S.constructor=w}catch(t){}return w}}},72989:(t,e,r)=>{var n=r(98646),i=r(14817),a=r(49356),o=r(38898),s=r(91817),l="AggregateError",u=i(l),c=!o((function(){return 1!==u([1]).errors[0]}))&&o((function(){return 7!==u([1],l,{cause:7}).cause}));n({global:!0,constructor:!0,arity:2,forced:c},{AggregateError:s(l,(function(t){return function(e,r){return a(t,this,arguments)}}),c,!0)})},97322:(t,e,r)=>{"use strict";var n=r(98646),i=r(29407),a=r(21052),o=r(16907),s=r(34327),l=r(79692),u=r(19382),c=r(95398),d=r(22429),h=r(76835),f=r(72842),p=r(24506),g=r(90026)("toStringTag"),v=Error,m=[].push,y=function(t,e){var r,n=i(b,this);o?r=o(v(),n?a(this):b):(r=n?this:l(b),u(r,g,"Error")),void 0!==e&&u(r,"message",p(e)),h(r,y,r.stack,1),arguments.length>2&&d(r,arguments[2]);var s=[];return f(t,m,{that:s}),u(r,"errors",s),r};o?o(y,v):s(y,v,{name:!0});var b=y.prototype=l(v.prototype,{constructor:c(1,y),message:c(1,""),name:c(1,"AggregateError")});n({global:!0,constructor:!0,arity:2},{AggregateError:y})},20387:(t,e,r)=>{r(97322)},61045:(t,e,r)=>{"use strict";var n=r(98646),i=r(80800),a=r(56704),o=r(72538),s="ArrayBuffer",l=a[s];n({global:!0,constructor:!0,forced:i[s]!==l},{ArrayBuffer:l}),o(s)},95276:(t,e,r)=>{var n=r(98646),i=r(7353);n({target:"ArrayBuffer",stat:!0,forced:!i.NATIVE_ARRAY_BUFFER_VIEWS},{isView:i.isView})},92412:(t,e,r)=>{"use strict";var n=r(98646),i=r(22536),a=r(38898),o=r(56704),s=r(45511),l=r(39211),u=r(43310),c=r(73370),d=o.ArrayBuffer,h=o.DataView,f=h.prototype,p=i(d.prototype.slice),g=i(f.getUint8),v=i(f.setUint8);n({target:"ArrayBuffer",proto:!0,unsafe:!0,forced:a((function(){return!new d(2).slice(1,void 0).byteLength}))},{slice:function(t,e){if(p&&void 0===e)return p(s(this),t);for(var r=s(this).byteLength,n=l(t,r),i=l(void 0===e?r:e,r),a=new(c(this,d))(u(i-n)),o=new h(this),f=new h(a),m=0;n<i;)v(f,m++,g(o,n++));return a}})},66991:(t,e,r)=>{"use strict";var n=r(98646),i=r(46640),a=r(19720),o=r(59802),s=r(4634);n({target:"Array",proto:!0},{at:function(t){var e=i(this),r=a(e),n=o(t),s=n>=0?n:r+n;return s<0||s>=r?void 0:e[s]}}),s("at")},10837:(t,e,r)=>{"use strict";var n=r(98646),i=r(38898),a=r(38283),o=r(91043),s=r(46640),l=r(19720),u=r(31621),c=r(23500),d=r(17983),h=r(31785),f=r(90026),p=r(87903),g=f("isConcatSpreadable"),v=p>=51||!i((function(){var t=[];return t[g]=!1,t.concat()[0]!==t})),m=function(t){if(!o(t))return!1;var e=t[g];return void 0!==e?!!e:a(t)};n({target:"Array",proto:!0,arity:1,forced:!v||!h("concat")},{concat:function(t){var e,r,n,i,a,o=s(this),h=d(o,0),f=0;for(e=-1,n=arguments.length;e<n;e++)if(m(a=-1===e?o:arguments[e]))for(i=l(a),u(f+i),r=0;r<i;r++,f++)r in a&&c(h,f,a[r]);else u(f+1),c(h,f++,a);return h.length=f,h}})},22464:(t,e,r)=>{var n=r(98646),i=r(31482),a=r(4634);n({target:"Array",proto:!0},{copyWithin:i}),a("copyWithin")},93485:(t,e,r)=>{"use strict";var n=r(98646),i=r(54292).every;n({target:"Array",proto:!0,forced:!r(36919)("every")},{every:function(t){return i(this,t,arguments.length>1?arguments[1]:void 0)}})},63137:(t,e,r)=>{var n=r(98646),i=r(64230),a=r(4634);n({target:"Array",proto:!0},{fill:i}),a("fill")},40879:(t,e,r)=>{"use strict";var n=r(98646),i=r(54292).filter;n({target:"Array",proto:!0,forced:!r(31785)("filter")},{filter:function(t){return i(this,t,arguments.length>1?arguments[1]:void 0)}})},72116:(t,e,r)=>{"use strict";var n=r(98646),i=r(54292).findIndex,a=r(4634),o="findIndex",s=!0;o in[]&&Array(1)[o]((function(){s=!1})),n({target:"Array",proto:!0,forced:s},{findIndex:function(t){return i(this,t,arguments.length>1?arguments[1]:void 0)}}),a(o)},98531:(t,e,r)=>{"use strict";var n=r(98646),i=r(86060).findLastIndex,a=r(4634);n({target:"Array",proto:!0},{findLastIndex:function(t){return i(this,t,arguments.length>1?arguments[1]:void 0)}}),a("findLastIndex")},32860:(t,e,r)=>{"use strict";var n=r(98646),i=r(86060).findLast,a=r(4634);n({target:"Array",proto:!0},{findLast:function(t){return i(this,t,arguments.length>1?arguments[1]:void 0)}}),a("findLast")},58810:(t,e,r)=>{"use strict";var n=r(98646),i=r(54292).find,a=r(4634),o="find",s=!0;o in[]&&Array(1)[o]((function(){s=!1})),n({target:"Array",proto:!0,forced:s},{find:function(t){return i(this,t,arguments.length>1?arguments[1]:void 0)}}),a(o)},14605:(t,e,r)=>{"use strict";var n=r(98646),i=r(35131),a=r(74435),o=r(46640),s=r(19720),l=r(17983);n({target:"Array",proto:!0},{flatMap:function(t){var e,r=o(this),n=s(r);return a(t),(e=l(r,0)).length=i(e,r,r,n,0,1,t,arguments.length>1?arguments[1]:void 0),e}})},79841:(t,e,r)=>{"use strict";var n=r(98646),i=r(35131),a=r(46640),o=r(19720),s=r(59802),l=r(17983);n({target:"Array",proto:!0},{flat:function(){var t=arguments.length?arguments[0]:void 0,e=a(this),r=o(e),n=l(e,0);return n.length=i(n,e,e,r,0,void 0===t?1:s(t)),n}})},86767:(t,e,r)=>{"use strict";var n=r(98646),i=r(824);n({target:"Array",proto:!0,forced:[].forEach!=i},{forEach:i})},50192:(t,e,r)=>{var n=r(98646),i=r(72353);n({target:"Array",stat:!0,forced:!r(82257)((function(t){Array.from(t)}))},{from:i})},79943:(t,e,r)=>{"use strict";var n=r(98646),i=r(67830).includes,a=r(38898),o=r(4634);n({target:"Array",proto:!0,forced:a((function(){return!Array(1).includes()}))},{includes:function(t){return i(this,t,arguments.length>1?arguments[1]:void 0)}}),o("includes")},84992:(t,e,r)=>{"use strict";var n=r(98646),i=r(22536),a=r(67830).indexOf,o=r(36919),s=i([].indexOf),l=!!s&&1/s([1],1,-0)<0;n({target:"Array",proto:!0,forced:l||!o("indexOf")},{indexOf:function(t){var e=arguments.length>1?arguments[1]:void 0;return l?s(this,t,e)||0:a(this,t,e)}})},67622:(t,e,r)=>{r(98646)({target:"Array",stat:!0},{isArray:r(38283)})},2357:(t,e,r)=>{"use strict";var n=r(46603),i=r(4634),a=r(42536),o=r(44495),s=r(56973).f,l=r(85011),u=r(70788),c=r(20781),d=r(60909),h="Array Iterator",f=o.set,p=o.getterFor(h);t.exports=l(Array,"Array",(function(t,e){f(this,{type:h,target:n(t),index:0,kind:e})}),(function(){var t=p(this),e=t.target,r=t.kind,n=t.index++;return!e||n>=e.length?(t.target=void 0,u(void 0,!0)):u("keys"==r?n:"values"==r?e[n]:[n,e[n]],!1)}),"values");var g=a.Arguments=a.Array;if(i("keys"),i("values"),i("entries"),!c&&d&&"values"!==g.name)try{s(g,"name",{value:"values"})}catch(t){}},28117:(t,e,r)=>{"use strict";var n=r(98646),i=r(47497),a=r(34783),o=r(46603),s=r(36919),l=i([].join);n({target:"Array",proto:!0,forced:a!=Object||!s("join",",")},{join:function(t){return l(o(this),void 0===t?",":t)}})},34784:(t,e,r)=>{var n=r(98646),i=r(3931);n({target:"Array",proto:!0,forced:i!==[].lastIndexOf},{lastIndexOf:i})},69550:(t,e,r)=>{"use strict";var n=r(98646),i=r(54292).map;n({target:"Array",proto:!0,forced:!r(31785)("map")},{map:function(t){return i(this,t,arguments.length>1?arguments[1]:void 0)}})},8654:(t,e,r)=>{"use strict";var n=r(98646),i=r(38898),a=r(60898),o=r(23500),s=Array;n({target:"Array",stat:!0,forced:i((function(){function t(){}return!(s.of.call(t)instanceof t)}))},{of:function(){for(var t=0,e=arguments.length,r=new(a(this)?this:s)(e);e>t;)o(r,t,arguments[t++]);return r.length=e,r}})},72922:(t,e,r)=>{"use strict";var n=r(98646),i=r(46640),a=r(19720),o=r(20587),s=r(31621);n({target:"Array",proto:!0,arity:1,forced:r(38898)((function(){return 4294967297!==[].push.call({length:4294967296},1)}))||!function(){try{Object.defineProperty([],"length",{writable:!1}).push()}catch(t){return t instanceof TypeError}}()},{push:function(t){var e=i(this),r=a(e),n=arguments.length;s(r+n);for(var l=0;l<n;l++)e[r]=arguments[l],r++;return o(e,r),r}})},30320:(t,e,r)=>{"use strict";var n=r(98646),i=r(63741).right,a=r(36919),o=r(87903);n({target:"Array",proto:!0,forced:!r(29040)&&o>79&&o<83||!a("reduceRight")},{reduceRight:function(t){return i(this,t,arguments.length,arguments.length>1?arguments[1]:void 0)}})},48:(t,e,r)=>{"use strict";var n=r(98646),i=r(63741).left,a=r(36919),o=r(87903);n({target:"Array",proto:!0,forced:!r(29040)&&o>79&&o<83||!a("reduce")},{reduce:function(t){var e=arguments.length;return i(this,t,e,e>1?arguments[1]:void 0)}})},86619:(t,e,r)=>{"use strict";var n=r(98646),i=r(47497),a=r(38283),o=i([].reverse),s=[1,2];n({target:"Array",proto:!0,forced:String(s)===String(s.reverse())},{reverse:function(){return a(this)&&(this.length=this.length),o(this)}})},13474:(t,e,r)=>{"use strict";var n=r(98646),i=r(38283),a=r(60898),o=r(91043),s=r(39211),l=r(19720),u=r(46603),c=r(23500),d=r(90026),h=r(31785),f=r(87097),p=h("slice"),g=d("species"),v=Array,m=Math.max;n({target:"Array",proto:!0,forced:!p},{slice:function(t,e){var r,n,d,h=u(this),p=l(h),y=s(t,p),b=s(void 0===e?p:e,p);if(i(h)&&(r=h.constructor,(a(r)&&(r===v||i(r.prototype))||o(r)&&null===(r=r[g]))&&(r=void 0),r===v||void 0===r))return f(h,y,b);for(n=new(void 0===r?v:r)(m(b-y,0)),d=0;y<b;y++,d++)y in h&&c(n,d,h[y]);return n.length=d,n}})},66287:(t,e,r)=>{"use strict";var n=r(98646),i=r(54292).some;n({target:"Array",proto:!0,forced:!r(36919)("some")},{some:function(t){return i(this,t,arguments.length>1?arguments[1]:void 0)}})},90565:(t,e,r)=>{"use strict";var n=r(98646),i=r(47497),a=r(74435),o=r(46640),s=r(19720),l=r(34982),u=r(82518),c=r(38898),d=r(34027),h=r(36919),f=r(38964),p=r(29423),g=r(87903),v=r(69870),m=[],y=i(m.sort),b=i(m.push),E=c((function(){m.sort(void 0)})),x=c((function(){m.sort(null)})),S=h("sort"),T=!c((function(){if(g)return g<70;if(!(f&&f>3)){if(p)return!0;if(v)return v<603;var t,e,r,n,i="";for(t=65;t<76;t++){switch(e=String.fromCharCode(t),t){case 66:case 69:case 70:case 72:r=3;break;case 68:case 71:r=4;break;default:r=2}for(n=0;n<47;n++)m.push({k:e+n,v:r})}for(m.sort((function(t,e){return e.v-t.v})),n=0;n<m.length;n++)e=m[n].k.charAt(0),i.charAt(i.length-1)!==e&&(i+=e);return"DGBEFHACIJK"!==i}}));n({target:"Array",proto:!0,forced:E||!x||!S||!T},{sort:function(t){void 0!==t&&a(t);var e=o(this);if(T)return void 0===t?y(e):y(e,t);var r,n,i=[],c=s(e);for(n=0;n<c;n++)n in e&&b(i,e[n]);for(d(i,function(t){return function(e,r){return void 0===r?-1:void 0===e?1:void 0!==t?+t(e,r)||0:u(e)>u(r)?1:-1}}(t)),r=s(i),n=0;n<r;)e[n]=i[n++];for(;n<c;)l(e,n++);return e}})},90573:(t,e,r)=>{r(72538)("Array")},87125:(t,e,r)=>{"use strict";var n=r(98646),i=r(46640),a=r(39211),o=r(59802),s=r(19720),l=r(20587),u=r(31621),c=r(17983),d=r(23500),h=r(34982),f=r(31785)("splice"),p=Math.max,g=Math.min;n({target:"Array",proto:!0,forced:!f},{splice:function(t,e){var r,n,f,v,m,y,b=i(this),E=s(b),x=a(t,E),S=arguments.length;for(0===S?r=n=0:1===S?(r=0,n=E-x):(r=S-2,n=g(p(o(e),0),E-x)),u(E+r-n),f=c(b,n),v=0;v<n;v++)(m=x+v)in b&&d(f,v,b[m]);if(f.length=n,r<n){for(v=x;v<E-n;v++)y=v+r,(m=v+n)in b?b[y]=b[m]:h(b,y);for(v=E;v>E-n+r;v--)h(b,v-1)}else if(r>n)for(v=E-n;v>x;v--)y=v+r-1,(m=v+n-1)in b?b[y]=b[m]:h(b,y);for(v=0;v<r;v++)b[v+x]=arguments[v+2];return l(b,E-n+r),f}})},22510:(t,e,r)=>{r(4634)("flatMap")},17802:(t,e,r)=>{r(4634)("flat")},29388:(t,e,r)=>{"use strict";var n=r(98646),i=r(46640),a=r(19720),o=r(20587),s=r(34982),l=r(31621);n({target:"Array",proto:!0,arity:1,forced:1!==[].unshift(0)||!function(){try{Object.defineProperty([],"length",{writable:!1}).unshift()}catch(t){return t instanceof TypeError}}()},{unshift:function(t){var e=i(this),r=a(e),n=arguments.length;if(n){l(r+n);for(var u=r;u--;){var c=u+n;u in e?e[c]=e[u]:s(e,c)}for(var d=0;d<n;d++)e[d]=arguments[d]}return o(e,r+n)}})},56532:(t,e,r)=>{var n=r(98646),i=r(56704);n({global:!0,constructor:!0,forced:!r(4651)},{DataView:i.DataView})},54195:(t,e,r)=>{r(56532)},64592:(t,e,r)=>{"use strict";var n=r(98646),i=r(47497),a=r(38898)((function(){return 120!==new Date(16e11).getYear()})),o=i(Date.prototype.getFullYear);n({target:"Date",proto:!0,forced:a},{getYear:function(){return o(this)-1900}})},39381:(t,e,r)=>{var n=r(98646),i=r(47497),a=Date,o=i(a.prototype.getTime);n({target:"Date",stat:!0},{now:function(){return o(new a)}})},20283:(t,e,r)=>{"use strict";var n=r(98646),i=r(47497),a=r(59802),o=Date.prototype,s=i(o.getTime),l=i(o.setFullYear);n({target:"Date",proto:!0},{setYear:function(t){s(this);var e=a(t);return l(this,0<=e&&e<=99?e+1900:e)}})},73556:(t,e,r)=>{r(98646)({target:"Date",proto:!0},{toGMTString:Date.prototype.toUTCString})},66773:(t,e,r)=>{var n=r(98646),i=r(244);n({target:"Date",proto:!0,forced:Date.prototype.toISOString!==i},{toISOString:i})},88616:(t,e,r)=>{"use strict";var n=r(98646),i=r(38898),a=r(46640),o=r(61736);n({target:"Date",proto:!0,arity:1,forced:i((function(){return null!==new Date(NaN).toJSON()||1!==Date.prototype.toJSON.call({toISOString:function(){return 1}})}))},{toJSON:function(t){var e=a(this),r=o(e,"number");return"number"!=typeof r||isFinite(r)?e.toISOString():null}})},71525:(t,e,r)=>{var n=r(48613),i=r(78993),a=r(43427),o=r(90026)("toPrimitive"),s=Date.prototype;n(s,o)||i(s,o,a)},52171:(t,e,r)=>{var n=r(47497),i=r(78993),a=Date.prototype,o="Invalid Date",s="toString",l=n(a[s]),u=n(a.getTime);String(new Date(NaN))!=o&&i(a,s,(function(){var t=u(this);return t==t?l(this):o}))},92156:(t,e,r)=>{var n=r(98646),i=r(80800),a=r(49356),o=r(91817),s="WebAssembly",l=i[s],u=7!==Error("e",{cause:7}).cause,c=function(t,e){var r={};r[t]=o(t,e,u),n({global:!0,constructor:!0,arity:1,forced:u},r)},d=function(t,e){if(l&&l[t]){var r={};r[t]=o(s+"."+t,e,u),n({target:s,stat:!0,constructor:!0,arity:1,forced:u},r)}};c("Error",(function(t){return function(e){return a(t,this,arguments)}})),c("EvalError",(function(t){return function(e){return a(t,this,arguments)}})),c("RangeError",(function(t){return function(e){return a(t,this,arguments)}})),c("ReferenceError",(function(t){return function(e){return a(t,this,arguments)}})),c("SyntaxError",(function(t){return function(e){return a(t,this,arguments)}})),c("TypeError",(function(t){return function(e){return a(t,this,arguments)}})),c("URIError",(function(t){return function(e){return a(t,this,arguments)}})),d("CompileError",(function(t){return function(e){return a(t,this,arguments)}})),d("LinkError",(function(t){return function(e){return a(t,this,arguments)}})),d("RuntimeError",(function(t){return function(e){return a(t,this,arguments)}}))},99189:(t,e,r)=>{var n=r(78993),i=r(50668),a=Error.prototype;a.toString!==i&&n(a,"toString",i)},80003:(t,e,r)=>{"use strict";var n=r(98646),i=r(47497),a=r(82518),o=i("".charAt),s=i("".charCodeAt),l=i(/./.exec),u=i(1..toString),c=i("".toUpperCase),d=/[\w*+\-./@]/,h=function(t,e){for(var r=u(t,16);r.length<e;)r="0"+r;return r};n({global:!0},{escape:function(t){for(var e,r,n=a(t),i="",u=n.length,f=0;f<u;)e=o(n,f++),l(d,e)?i+=e:i+=(r=s(e,0))<256?"%"+h(r,2):"%u"+c(h(r,4));return i}})},63008:(t,e,r)=>{var n=r(98646),i=r(31754);n({target:"Function",proto:!0,forced:Function.bind!==i},{bind:i})},82617:(t,e,r)=>{"use strict";var n=r(76599),i=r(91043),a=r(56973),o=r(21052),s=r(90026),l=r(99645),u=s("hasInstance"),c=Function.prototype;u in c||a.f(c,u,{value:l((function(t){if(!n(this)||!i(t))return!1;var e=this.prototype;if(!i(e))return t instanceof this;for(;t=o(t);)if(e===t)return!0;return!1}),u)})},26232:(t,e,r)=>{var n=r(60909),i=r(2656).EXISTS,a=r(47497),o=r(56973).f,s=Function.prototype,l=a(s.toString),u=/function\b(?:\s|\/\*[\S\s]*?\*\/|\/\/[^\n\r]*[\n\r]+)*([^\s(/]*)/,c=a(u.exec);n&&!i&&o(s,"name",{configurable:!0,get:function(){try{return c(u,l(this))[1]}catch(t){return""}}})},35196:(t,e,r)=>{var n=r(98646),i=r(80800);n({global:!0,forced:i.globalThis!==i},{globalThis:i})},82833:(t,e,r)=>{var n=r(98646),i=r(14817),a=r(49356),o=r(98004),s=r(47497),l=r(38898),u=r(38283),c=r(76599),d=r(91043),h=r(29611),f=r(87097),p=r(88322),g=i("JSON","stringify"),v=s(/./.exec),m=s("".charAt),y=s("".charCodeAt),b=s("".replace),E=s(1..toString),x=/[\uD800-\uDFFF]/g,S=/^[\uD800-\uDBFF]$/,T=/^[\uDC00-\uDFFF]$/,w=!p||l((function(){var t=i("Symbol")();return"[null]"!=g([t])||"{}"!=g({a:t})||"{}"!=g(Object(t))})),_=l((function(){return'"\\udf06\\ud834"'!==g("\udf06\ud834")||'"\\udead"'!==g("\udead")})),A=function(t,e){var r=f(arguments),n=e;if((d(e)||void 0!==t)&&!h(t))return u(e)||(e=function(t,e){if(c(n)&&(e=o(n,this,t,e)),!h(e))return e}),r[1]=e,a(g,null,r)},k=function(t,e,r){var n=m(r,e-1),i=m(r,e+1);return v(S,t)&&!v(T,i)||v(T,t)&&!v(S,n)?"\\u"+E(y(t,0),16):t};g&&n({target:"JSON",stat:!0,arity:3,forced:w||_},{stringify:function(t,e,r){var n=f(arguments),i=a(w?A:g,null,n);return _&&"string"==typeof i?b(i,x,k):i}})},52768:(t,e,r)=>{var n=r(80800);r(24198)(n.JSON,"JSON",!0)},12678:(t,e,r)=>{"use strict";r(39216)("Map",(function(t){return function(){return t(this,arguments.length?arguments[0]:void 0)}}),r(46633))},22247:(t,e,r)=>{r(12678)},97754:(t,e,r)=>{var n=r(98646),i=r(80840),a=Math.acosh,o=Math.log,s=Math.sqrt,l=Math.LN2;n({target:"Math",stat:!0,forced:!a||710!=Math.floor(a(Number.MAX_VALUE))||a(1/0)!=1/0},{acosh:function(t){var e=+t;return e<1?NaN:e>94906265.62425156?o(e)+l:i(e-1+s(e-1)*s(e+1))}})},74382:(t,e,r)=>{var n=r(98646),i=Math.asinh,a=Math.log,o=Math.sqrt;n({target:"Math",stat:!0,forced:!(i&&1/i(0)>0)},{asinh:function t(e){var r=+e;return isFinite(r)&&0!=r?r<0?-t(-r):a(r+o(r*r+1)):r}})},20850:(t,e,r)=>{var n=r(98646),i=Math.atanh,a=Math.log;n({target:"Math",stat:!0,forced:!(i&&1/i(-0)<0)},{atanh:function(t){var e=+t;return 0==e?e:a((1+e)/(1-e))/2}})},25066:(t,e,r)=>{var n=r(98646),i=r(14489),a=Math.abs,o=Math.pow;n({target:"Math",stat:!0},{cbrt:function(t){var e=+t;return i(e)*o(a(e),1/3)}})},7499:(t,e,r)=>{var n=r(98646),i=Math.floor,a=Math.log,o=Math.LOG2E;n({target:"Math",stat:!0},{clz32:function(t){var e=t>>>0;return e?31-i(a(e+.5)*o):32}})},85435:(t,e,r)=>{var n=r(98646),i=r(31698),a=Math.cosh,o=Math.abs,s=Math.E;n({target:"Math",stat:!0,forced:!a||a(710)===1/0},{cosh:function(t){var e=i(o(t)-1)+1;return(e+1/(e*s*s))*(s/2)}})},11306:(t,e,r)=>{var n=r(98646),i=r(31698);n({target:"Math",stat:!0,forced:i!=Math.expm1},{expm1:i})},16163:(t,e,r)=>{r(98646)({target:"Math",stat:!0},{fround:r(16001)})},52365:(t,e,r)=>{var n=r(98646),i=Math.hypot,a=Math.abs,o=Math.sqrt;n({target:"Math",stat:!0,arity:2,forced:!!i&&i(1/0,NaN)!==1/0},{hypot:function(t,e){for(var r,n,i=0,s=0,l=arguments.length,u=0;s<l;)u<(r=a(arguments[s++]))?(i=i*(n=u/r)*n+1,u=r):i+=r>0?(n=r/u)*n:r;return u===1/0?1/0:u*o(i)}})},28345:(t,e,r)=>{var n=r(98646),i=r(38898),a=Math.imul;n({target:"Math",stat:!0,forced:i((function(){return-5!=a(4294967295,5)||2!=a.length}))},{imul:function(t,e){var r=65535,n=+t,i=+e,a=r&n,o=r&i;return 0|a*o+((r&n>>>16)*o+a*(r&i>>>16)<<16>>>0)}})},6617:(t,e,r)=>{r(98646)({target:"Math",stat:!0},{log10:r(86018)})},2183:(t,e,r)=>{r(98646)({target:"Math",stat:!0},{log1p:r(80840)})},70183:(t,e,r)=>{var n=r(98646),i=Math.log,a=Math.LN2;n({target:"Math",stat:!0},{log2:function(t){return i(t)/a}})},91235:(t,e,r)=>{r(98646)({target:"Math",stat:!0},{sign:r(14489)})},65153:(t,e,r)=>{var n=r(98646),i=r(38898),a=r(31698),o=Math.abs,s=Math.exp,l=Math.E;n({target:"Math",stat:!0,forced:i((function(){return-2e-17!=Math.sinh(-2e-17)}))},{sinh:function(t){var e=+t;return o(e)<1?(a(e)-a(-e))/2:(s(e-1)-s(-e-1))*(l/2)}})},8882:(t,e,r)=>{var n=r(98646),i=r(31698),a=Math.exp;n({target:"Math",stat:!0},{tanh:function(t){var e=+t,r=i(e),n=i(-e);return r==1/0?1:n==1/0?-1:(r-n)/(a(e)+a(-e))}})},71646:(t,e,r)=>{r(24198)(Math,"Math",!0)},96983:(t,e,r)=>{r(98646)({target:"Math",stat:!0},{trunc:r(16612)})},28402:(t,e,r)=>{"use strict";var n=r(98646),i=r(20781),a=r(60909),o=r(80800),s=r(44871),l=r(47497),u=r(28046),c=r(48613),d=r(38754),h=r(29407),f=r(29611),p=r(61736),g=r(38898),v=r(2107).f,m=r(63276).f,y=r(56973).f,b=r(91090),E=r(93444).trim,x="Number",S=o[x],T=s[x],w=S.prototype,_=o.TypeError,A=l("".slice),k=l("".charCodeAt),C=function(t){var e=p(t,"number");return"bigint"==typeof e?e:D(e)},D=function(t){var e,r,n,i,a,o,s,l,u=p(t,"number");if(f(u))throw _("Cannot convert a Symbol value to a number");if("string"==typeof u&&u.length>2)if(u=E(u),43===(e=k(u,0))||45===e){if(88===(r=k(u,2))||120===r)return NaN}else if(48===e){switch(k(u,1)){case 66:case 98:n=2,i=49;break;case 79:case 111:n=8,i=55;break;default:return+u}for(o=(a=A(u,2)).length,s=0;s<o;s++)if((l=k(a,s))<48||l>i)return NaN;return parseInt(a,n)}return+u},L=u(x,!S(" 0o1")||!S("0b1")||S("+0x1")),R=function(t){return h(w,t)&&g((function(){b(t)}))},I=function(t){var e=arguments.length<1?0:S(C(t));return R(this)?d(Object(e),this,I):e};I.prototype=w,L&&!i&&(w.constructor=I),n({global:!0,constructor:!0,wrap:!0,forced:L},{Number:I});var O=function(t,e){for(var r,n=a?v(e):"MAX_VALUE,MIN_VALUE,NaN,NEGATIVE_INFINITY,POSITIVE_INFINITY,EPSILON,MAX_SAFE_INTEGER,MIN_SAFE_INTEGER,isFinite,isInteger,isNaN,isSafeInteger,parseFloat,parseInt,fromString,range".split(","),i=0;n.length>i;i++)c(e,r=n[i])&&!c(t,r)&&y(t,r,m(e,r))};i&&T&&O(s[x],T),(L||i)&&O(s[x],S)},99037:(t,e,r)=>{r(98646)({target:"Number",stat:!0,nonConfigurable:!0,nonWritable:!0},{EPSILON:Math.pow(2,-52)})},85277:(t,e,r)=>{r(98646)({target:"Number",stat:!0},{isFinite:r(61066)})},46146:(t,e,r)=>{r(98646)({target:"Number",stat:!0},{isInteger:r(46514)})},77272:(t,e,r)=>{r(98646)({target:"Number",stat:!0},{isNaN:function(t){return t!=t}})},93047:(t,e,r)=>{var n=r(98646),i=r(46514),a=Math.abs;n({target:"Number",stat:!0},{isSafeInteger:function(t){return i(t)&&a(t)<=9007199254740991}})},38361:(t,e,r)=>{r(98646)({target:"Number",stat:!0,nonConfigurable:!0,nonWritable:!0},{MAX_SAFE_INTEGER:9007199254740991})},90362:(t,e,r)=>{r(98646)({target:"Number",stat:!0,nonConfigurable:!0,nonWritable:!0},{MIN_SAFE_INTEGER:-9007199254740991})},36768:(t,e,r)=>{var n=r(98646),i=r(50219);n({target:"Number",stat:!0,forced:Number.parseFloat!=i},{parseFloat:i})},81674:(t,e,r)=>{var n=r(98646),i=r(52585);n({target:"Number",stat:!0,forced:Number.parseInt!=i},{parseInt:i})},82002:(t,e,r)=>{"use strict";var n=r(98646),i=r(47497),a=r(59802),o=r(91090),s=r(81968),l=r(86018),u=r(38898),c=RangeError,d=String,h=isFinite,f=Math.abs,p=Math.floor,g=Math.pow,v=Math.round,m=i(1..toExponential),y=i(s),b=i("".slice),E="-6.9000e-11"===m(-69e-12,4)&&"1.25e+0"===m(1.255,2)&&"1.235e+4"===m(12345,3)&&"3e+1"===m(25,0);n({target:"Number",proto:!0,forced:!E||!(u((function(){m(1,1/0)}))&&u((function(){m(1,-1/0)})))||!!u((function(){m(1/0,1/0),m(NaN,1/0)}))},{toExponential:function(t){var e=o(this);if(void 0===t)return m(e);var r=a(t);if(!h(e))return String(e);if(r<0||r>20)throw c("Incorrect fraction digits");if(E)return m(e,r);var n="",i="",s=0,u="",x="";if(e<0&&(n="-",e=-e),0===e)s=0,i=y("0",r+1);else{var S=l(e);s=p(S);var T=0,w=g(10,s-r);2*e>=(2*(T=v(e/w))+1)*w&&(T+=1),T>=g(10,r+1)&&(T/=10,s+=1),i=d(T)}return 0!==r&&(i=b(i,0,1)+"."+b(i,1)),0===s?(u="+",x="0"):(u=s>0?"+":"-",x=d(f(s))),n+(i+"e")+u+x}})},37591:(t,e,r)=>{"use strict";var n=r(98646),i=r(47497),a=r(59802),o=r(91090),s=r(81968),l=r(38898),u=RangeError,c=String,d=Math.floor,h=i(s),f=i("".slice),p=i(1..toFixed),g=function(t,e,r){return 0===e?r:e%2==1?g(t,e-1,r*t):g(t*t,e/2,r)},v=function(t,e,r){for(var n=-1,i=r;++n<6;)i+=e*t[n],t[n]=i%1e7,i=d(i/1e7)},m=function(t,e){for(var r=6,n=0;--r>=0;)n+=t[r],t[r]=d(n/e),n=n%e*1e7},y=function(t){for(var e=6,r="";--e>=0;)if(""!==r||0===e||0!==t[e]){var n=c(t[e]);r=""===r?n:r+h("0",7-n.length)+n}return r};n({target:"Number",proto:!0,forced:l((function(){return"0.000"!==p(8e-5,3)||"1"!==p(.9,0)||"1.25"!==p(1.255,2)||"1000000000000000128"!==p(0xde0b6b3a7640080,0)}))||!l((function(){p({})}))},{toFixed:function(t){var e,r,n,i,s=o(this),l=a(t),d=[0,0,0,0,0,0],p="",b="0";if(l<0||l>20)throw u("Incorrect fraction digits");if(s!=s)return"NaN";if(s<=-1e21||s>=1e21)return c(s);if(s<0&&(p="-",s=-s),s>1e-21)if(r=(e=function(t){for(var e=0,r=t;r>=4096;)e+=12,r/=4096;for(;r>=2;)e+=1,r/=2;return e}(s*g(2,69,1))-69)<0?s*g(2,-e,1):s/g(2,e,1),r*=4503599627370496,(e=52-e)>0){for(v(d,0,r),n=l;n>=7;)v(d,1e7,0),n-=7;for(v(d,g(10,n,1),0),n=e-1;n>=23;)m(d,1<<23),n-=23;m(d,1<<n),v(d,1,1),m(d,2),b=y(d)}else v(d,0,r),v(d,1<<-e,0),b=y(d)+h("0",l);return l>0?p+((i=b.length)<=l?"0."+h("0",l-i)+b:f(b,0,i-l)+"."+f(b,i-l)):p+b}})},53713:(t,e,r)=>{"use strict";var n=r(98646),i=r(47497),a=r(38898),o=r(91090),s=i(1..toPrecision);n({target:"Number",proto:!0,forced:a((function(){return"1"!==s(1,void 0)}))||!a((function(){s({})}))},{toPrecision:function(t){return void 0===t?s(o(this)):s(o(this),t)}})},47189:(t,e,r)=>{var n=r(98646),i=r(7738);n({target:"Object",stat:!0,arity:2,forced:Object.assign!==i},{assign:i})},21508:(t,e,r)=>{r(98646)({target:"Object",stat:!0,sham:!r(60909)},{create:r(79692)})},94914:(t,e,r)=>{"use strict";var n=r(98646),i=r(60909),a=r(41191),o=r(74435),s=r(46640),l=r(56973);i&&n({target:"Object",proto:!0,forced:a},{__defineGetter__:function(t,e){l.f(s(this),t,{get:o(e),enumerable:!0,configurable:!0})}})},33306:(t,e,r)=>{var n=r(98646),i=r(60909),a=r(83110).f;n({target:"Object",stat:!0,forced:Object.defineProperties!==a,sham:!i},{defineProperties:a})},93319:(t,e,r)=>{var n=r(98646),i=r(60909),a=r(56973).f;n({target:"Object",stat:!0,forced:Object.defineProperty!==a,sham:!i},{defineProperty:a})},85365:(t,e,r)=>{"use strict";var n=r(98646),i=r(60909),a=r(41191),o=r(74435),s=r(46640),l=r(56973);i&&n({target:"Object",proto:!0,forced:a},{__defineSetter__:function(t,e){l.f(s(this),t,{set:o(e),enumerable:!0,configurable:!0})}})},70223:(t,e,r)=>{var n=r(98646),i=r(23102).entries;n({target:"Object",stat:!0},{entries:function(t){return i(t)}})},52777:(t,e,r)=>{var n=r(98646),i=r(29025),a=r(38898),o=r(91043),s=r(82194).onFreeze,l=Object.freeze;n({target:"Object",stat:!0,forced:a((function(){l(1)})),sham:!i},{freeze:function(t){return l&&o(t)?l(s(t)):t}})},42194:(t,e,r)=>{var n=r(98646),i=r(72842),a=r(23500);n({target:"Object",stat:!0},{fromEntries:function(t){var e={};return i(t,(function(t,r){a(e,t,r)}),{AS_ENTRIES:!0}),e}})},90461:(t,e,r)=>{var n=r(98646),i=r(38898),a=r(46603),o=r(63276).f,s=r(60909);n({target:"Object",stat:!0,forced:!s||i((function(){o(1)})),sham:!s},{getOwnPropertyDescriptor:function(t,e){return o(a(t),e)}})},12418:(t,e,r)=>{var n=r(98646),i=r(60909),a=r(48872),o=r(46603),s=r(63276),l=r(23500);n({target:"Object",stat:!0,sham:!i},{getOwnPropertyDescriptors:function(t){for(var e,r,n=o(t),i=s.f,u=a(n),c={},d=0;u.length>d;)void 0!==(r=i(n,e=u[d++]))&&l(c,e,r);return c}})},40440:(t,e,r)=>{var n=r(98646),i=r(38898),a=r(9677).f;n({target:"Object",stat:!0,forced:i((function(){return!Object.getOwnPropertyNames(1)}))},{getOwnPropertyNames:a})},99822:(t,e,r)=>{var n=r(98646),i=r(88322),a=r(38898),o=r(52610),s=r(46640);n({target:"Object",stat:!0,forced:!i||a((function(){o.f(1)}))},{getOwnPropertySymbols:function(t){var e=o.f;return e?e(s(t)):[]}})},57017:(t,e,r)=>{var n=r(98646),i=r(38898),a=r(46640),o=r(21052),s=r(36760);n({target:"Object",stat:!0,forced:i((function(){o(1)})),sham:!s},{getPrototypeOf:function(t){return o(a(t))}})},35048:(t,e,r)=>{r(98646)({target:"Object",stat:!0},{hasOwn:r(48613)})},65578:(t,e,r)=>{var n=r(98646),i=r(58410);n({target:"Object",stat:!0,forced:Object.isExtensible!==i},{isExtensible:i})},1466:(t,e,r)=>{var n=r(98646),i=r(38898),a=r(91043),o=r(54518),s=r(46144),l=Object.isFrozen;n({target:"Object",stat:!0,forced:s||i((function(){l(1)}))},{isFrozen:function(t){return!a(t)||!(!s||"ArrayBuffer"!=o(t))||!!l&&l(t)}})},87647:(t,e,r)=>{var n=r(98646),i=r(38898),a=r(91043),o=r(54518),s=r(46144),l=Object.isSealed;n({target:"Object",stat:!0,forced:s||i((function(){l(1)}))},{isSealed:function(t){return!a(t)||!(!s||"ArrayBuffer"!=o(t))||!!l&&l(t)}})},68270:(t,e,r)=>{r(98646)({target:"Object",stat:!0},{is:r(20824)})},5622:(t,e,r)=>{var n=r(98646),i=r(46640),a=r(73555);n({target:"Object",stat:!0,forced:r(38898)((function(){a(1)}))},{keys:function(t){return a(i(t))}})},53258:(t,e,r)=>{"use strict";var n=r(98646),i=r(60909),a=r(41191),o=r(46640),s=r(77369),l=r(21052),u=r(63276).f;i&&n({target:"Object",proto:!0,forced:a},{__lookupGetter__:function(t){var e,r=o(this),n=s(t);do{if(e=u(r,n))return e.get}while(r=l(r))}})},24938:(t,e,r)=>{"use strict";var n=r(98646),i=r(60909),a=r(41191),o=r(46640),s=r(77369),l=r(21052),u=r(63276).f;i&&n({target:"Object",proto:!0,forced:a},{__lookupSetter__:function(t){var e,r=o(this),n=s(t);do{if(e=u(r,n))return e.set}while(r=l(r))}})},87302:(t,e,r)=>{var n=r(98646),i=r(91043),a=r(82194).onFreeze,o=r(29025),s=r(38898),l=Object.preventExtensions;n({target:"Object",stat:!0,forced:s((function(){l(1)})),sham:!o},{preventExtensions:function(t){return l&&i(t)?l(a(t)):t}})},98924:(t,e,r)=>{"use strict";var n=r(60909),i=r(10159),a=r(91043),o=r(46640),s=r(58401),l=Object.getPrototypeOf,u=Object.setPrototypeOf,c=Object.prototype,d="__proto__";if(n&&l&&u&&!(d in c))try{i(c,d,{configurable:!0,get:function(){return l(o(this))},set:function(t){var e=s(this);(a(t)||null===t)&&a(e)&&u(e,t)}})}catch(t){}},55992:(t,e,r)=>{var n=r(98646),i=r(91043),a=r(82194).onFreeze,o=r(29025),s=r(38898),l=Object.seal;n({target:"Object",stat:!0,forced:s((function(){l(1)})),sham:!o},{seal:function(t){return l&&i(t)?l(a(t)):t}})},40890:(t,e,r)=>{r(98646)({target:"Object",stat:!0},{setPrototypeOf:r(16907)})},51151:(t,e,r)=>{var n=r(23026),i=r(78993),a=r(64542);n||i(Object.prototype,"toString",a,{unsafe:!0})},68570:(t,e,r)=>{var n=r(98646),i=r(23102).values;n({target:"Object",stat:!0},{values:function(t){return i(t)}})},40247:(t,e,r)=>{var n=r(98646),i=r(50219);n({global:!0,forced:parseFloat!=i},{parseFloat:i})},52833:(t,e,r)=>{var n=r(98646),i=r(52585);n({global:!0,forced:parseInt!=i},{parseInt:i})},50521:(t,e,r)=>{"use strict";var n=r(98646),i=r(98004),a=r(74435),o=r(97845),s=r(25291),l=r(72842);n({target:"Promise",stat:!0,forced:r(30703)},{allSettled:function(t){var e=this,r=o.f(e),n=r.resolve,u=r.reject,c=s((function(){var r=a(e.resolve),o=[],s=0,u=1;l(t,(function(t){var a=s++,l=!1;u++,i(r,e,t).then((function(t){l||(l=!0,o[a]={status:"fulfilled",value:t},--u||n(o))}),(function(t){l||(l=!0,o[a]={status:"rejected",reason:t},--u||n(o))}))})),--u||n(o)}));return c.error&&u(c.value),r.promise}})},27802:(t,e,r)=>{"use strict";var n=r(98646),i=r(98004),a=r(74435),o=r(97845),s=r(25291),l=r(72842);n({target:"Promise",stat:!0,forced:r(30703)},{all:function(t){var e=this,r=o.f(e),n=r.resolve,u=r.reject,c=s((function(){var r=a(e.resolve),o=[],s=0,c=1;l(t,(function(t){var a=s++,l=!1;c++,i(r,e,t).then((function(t){l||(l=!0,o[a]=t,--c||n(o))}),u)})),--c||n(o)}));return c.error&&u(c.value),r.promise}})},35413:(t,e,r)=>{"use strict";var n=r(98646),i=r(98004),a=r(74435),o=r(14817),s=r(97845),l=r(25291),u=r(72842),c=r(30703),d="No one promise resolved";n({target:"Promise",stat:!0,forced:c},{any:function(t){var e=this,r=o("AggregateError"),n=s.f(e),c=n.resolve,h=n.reject,f=l((function(){var n=a(e.resolve),o=[],s=0,l=1,f=!1;u(t,(function(t){var a=s++,u=!1;l++,i(n,e,t).then((function(t){u||f||(f=!0,c(t))}),(function(t){u||f||(u=!0,o[a]=t,--l||h(new r(o,d)))}))})),--l||h(new r(o,d))}));return f.error&&h(f.value),n.promise}})},25537:(t,e,r)=>{"use strict";var n=r(98646),i=r(20781),a=r(90204).CONSTRUCTOR,o=r(42670),s=r(14817),l=r(76599),u=r(78993),c=o&&o.prototype;if(n({target:"Promise",proto:!0,forced:a,real:!0},{catch:function(t){return this.then(void 0,t)}}),!i&&l(o)){var d=s("Promise").prototype.catch;c.catch!==d&&u(c,"catch",d,{unsafe:!0})}},86936:(t,e,r)=>{"use strict";var n,i,a,o=r(98646),s=r(20781),l=r(29040),u=r(80800),c=r(98004),d=r(78993),h=r(16907),f=r(24198),p=r(72538),g=r(74435),v=r(76599),m=r(91043),y=r(96345),b=r(73370),E=r(55767).set,x=r(89332),S=r(34066),T=r(25291),w=r(98409),_=r(44495),A=r(42670),k=r(90204),C=r(97845),D="Promise",L=k.CONSTRUCTOR,R=k.REJECTION_EVENT,I=k.SUBCLASSING,O=_.getterFor(D),M=_.set,P=A&&A.prototype,F=A,N=P,B=u.TypeError,U=u.document,j=u.process,H=C.f,G=H,z=!!(U&&U.createEvent&&u.dispatchEvent),V="unhandledrejection",W=function(t){var e;return!(!m(t)||!v(e=t.then))&&e},K=function(t,e){var r,n,i,a=e.value,o=1==e.state,s=o?t.ok:t.fail,l=t.resolve,u=t.reject,d=t.domain;try{s?(o||(2===e.rejection&&Q(e),e.rejection=1),!0===s?r=a:(d&&d.enter(),r=s(a),d&&(d.exit(),i=!0)),r===t.promise?u(B("Promise-chain cycle")):(n=W(r))?c(n,r,l,u):l(r)):u(a)}catch(t){d&&!i&&d.exit(),u(t)}},Y=function(t,e){t.notified||(t.notified=!0,x((function(){for(var r,n=t.reactions;r=n.get();)K(r,t);t.notified=!1,e&&!t.rejection&&X(t)})))},q=function(t,e,r){var n,i;z?((n=U.createEvent("Event")).promise=e,n.reason=r,n.initEvent(t,!1,!0),u.dispatchEvent(n)):n={promise:e,reason:r},!R&&(i=u["on"+t])?i(n):t===V&&S("Unhandled promise rejection",r)},X=function(t){c(E,u,(function(){var e,r=t.facade,n=t.value;if($(t)&&(e=T((function(){l?j.emit("unhandledRejection",n,r):q(V,r,n)})),t.rejection=l||$(t)?2:1,e.error))throw e.value}))},$=function(t){return 1!==t.rejection&&!t.parent},Q=function(t){c(E,u,(function(){var e=t.facade;l?j.emit("rejectionHandled",e):q("rejectionhandled",e,t.value)}))},J=function(t,e,r){return function(n){t(e,n,r)}},Z=function(t,e,r){t.done||(t.done=!0,r&&(t=r),t.value=e,t.state=2,Y(t,!0))},tt=function(t,e,r){if(!t.done){t.done=!0,r&&(t=r);try{if(t.facade===e)throw B("Promise can't be resolved itself");var n=W(e);n?x((function(){var r={done:!1};try{c(n,e,J(tt,r,t),J(Z,r,t))}catch(e){Z(r,e,t)}})):(t.value=e,t.state=1,Y(t,!1))}catch(e){Z({done:!1},e,t)}}};if(L&&(N=(F=function(t){y(this,N),g(t),c(n,this);var e=O(this);try{t(J(tt,e),J(Z,e))}catch(t){Z(e,t)}}).prototype,(n=function(t){M(this,{type:D,done:!1,notified:!1,parent:!1,reactions:new w,rejection:!1,state:0,value:void 0})}).prototype=d(N,"then",(function(t,e){var r=O(this),n=H(b(this,F));return r.parent=!0,n.ok=!v(t)||t,n.fail=v(e)&&e,n.domain=l?j.domain:void 0,0==r.state?r.reactions.add(n):x((function(){K(n,r)})),n.promise})),i=function(){var t=new n,e=O(t);this.promise=t,this.resolve=J(tt,e),this.reject=J(Z,e)},C.f=H=function(t){return t===F||void 0===t?new i(t):G(t)},!s&&v(A)&&P!==Object.prototype)){a=P.then,I||d(P,"then",(function(t,e){var r=this;return new F((function(t,e){c(a,r,t,e)})).then(t,e)}),{unsafe:!0});try{delete P.constructor}catch(t){}h&&h(P,N)}o({global:!0,constructor:!0,wrap:!0,forced:L},{Promise:F}),f(F,D,!1,!0),p(D)},39134:(t,e,r)=>{"use strict";var n=r(98646),i=r(20781),a=r(42670),o=r(38898),s=r(14817),l=r(76599),u=r(73370),c=r(75856),d=r(78993),h=a&&a.prototype;if(n({target:"Promise",proto:!0,real:!0,forced:!!a&&o((function(){h.finally.call({then:function(){}},(function(){}))}))},{finally:function(t){var e=u(this,s("Promise")),r=l(t);return this.then(r?function(r){return c(e,t()).then((function(){return r}))}:t,r?function(r){return c(e,t()).then((function(){throw r}))}:t)}}),!i&&l(a)){var f=s("Promise").prototype.finally;h.finally!==f&&d(h,"finally",f,{unsafe:!0})}},9317:(t,e,r)=>{r(86936),r(27802),r(25537),r(54683),r(18762),r(59159)},54683:(t,e,r)=>{"use strict";var n=r(98646),i=r(98004),a=r(74435),o=r(97845),s=r(25291),l=r(72842);n({target:"Promise",stat:!0,forced:r(30703)},{race:function(t){var e=this,r=o.f(e),n=r.reject,u=s((function(){var o=a(e.resolve);l(t,(function(t){i(o,e,t).then(r.resolve,n)}))}));return u.error&&n(u.value),r.promise}})},18762:(t,e,r)=>{"use strict";var n=r(98646),i=r(98004),a=r(97845);n({target:"Promise",stat:!0,forced:r(90204).CONSTRUCTOR},{reject:function(t){var e=a.f(this);return i(e.reject,void 0,t),e.promise}})},59159:(t,e,r)=>{"use strict";var n=r(98646),i=r(14817),a=r(20781),o=r(42670),s=r(90204).CONSTRUCTOR,l=r(75856),u=i("Promise"),c=a&&!s;n({target:"Promise",stat:!0,forced:a||s},{resolve:function(t){return l(c&&this===u?o:this,t)}})},49898:(t,e,r)=>{var n=r(98646),i=r(49356),a=r(74435),o=r(45511);n({target:"Reflect",stat:!0,forced:!r(38898)((function(){Reflect.apply((function(){}))}))},{apply:function(t,e,r){return i(a(t),e,o(r))}})},78222:(t,e,r)=>{var n=r(98646),i=r(14817),a=r(49356),o=r(31754),s=r(63409),l=r(45511),u=r(91043),c=r(79692),d=r(38898),h=i("Reflect","construct"),f=Object.prototype,p=[].push,g=d((function(){function t(){}return!(h((function(){}),[],t)instanceof t)})),v=!d((function(){h((function(){}))})),m=g||v;n({target:"Reflect",stat:!0,forced:m,sham:m},{construct:function(t,e){s(t),l(e);var r=arguments.length<3?t:s(arguments[2]);if(v&&!g)return h(t,e,r);if(t==r){switch(e.length){case 0:return new t;case 1:return new t(e[0]);case 2:return new t(e[0],e[1]);case 3:return new t(e[0],e[1],e[2]);case 4:return new t(e[0],e[1],e[2],e[3])}var n=[null];return a(p,n,e),new(a(o,t,n))}var i=r.prototype,d=c(u(i)?i:f),m=a(t,d,e);return u(m)?m:d}})},47433:(t,e,r)=>{var n=r(98646),i=r(60909),a=r(45511),o=r(77369),s=r(56973);n({target:"Reflect",stat:!0,forced:r(38898)((function(){Reflect.defineProperty(s.f({},1,{value:1}),1,{value:2})})),sham:!i},{defineProperty:function(t,e,r){a(t);var n=o(e);a(r);try{return s.f(t,n,r),!0}catch(t){return!1}}})},15602:(t,e,r)=>{var n=r(98646),i=r(45511),a=r(63276).f;n({target:"Reflect",stat:!0},{deleteProperty:function(t,e){var r=a(i(t),e);return!(r&&!r.configurable)&&delete t[e]}})},91761:(t,e,r)=>{var n=r(98646),i=r(60909),a=r(45511),o=r(63276);n({target:"Reflect",stat:!0,sham:!i},{getOwnPropertyDescriptor:function(t,e){return o.f(a(t),e)}})},14767:(t,e,r)=>{var n=r(98646),i=r(45511),a=r(21052);n({target:"Reflect",stat:!0,sham:!r(36760)},{getPrototypeOf:function(t){return a(i(t))}})},71502:(t,e,r)=>{var n=r(98646),i=r(98004),a=r(91043),o=r(45511),s=r(26810),l=r(63276),u=r(21052);n({target:"Reflect",stat:!0},{get:function t(e,r){var n,c,d=arguments.length<3?e:arguments[2];return o(e)===d?e[r]:(n=l.f(e,r))?s(n)?n.value:void 0===n.get?void 0:i(n.get,d):a(c=u(e))?t(c,r,d):void 0}})},96895:(t,e,r)=>{r(98646)({target:"Reflect",stat:!0},{has:function(t,e){return e in t}})},36103:(t,e,r)=>{var n=r(98646),i=r(45511),a=r(58410);n({target:"Reflect",stat:!0},{isExtensible:function(t){return i(t),a(t)}})},82012:(t,e,r)=>{r(98646)({target:"Reflect",stat:!0},{ownKeys:r(48872)})},2300:(t,e,r)=>{var n=r(98646),i=r(14817),a=r(45511);n({target:"Reflect",stat:!0,sham:!r(29025)},{preventExtensions:function(t){a(t);try{var e=i("Object","preventExtensions");return e&&e(t),!0}catch(t){return!1}}})},1754:(t,e,r)=>{var n=r(98646),i=r(45511),a=r(75517),o=r(16907);o&&n({target:"Reflect",stat:!0},{setPrototypeOf:function(t,e){i(t),a(e);try{return o(t,e),!0}catch(t){return!1}}})},18139:(t,e,r)=>{var n=r(98646),i=r(98004),a=r(45511),o=r(91043),s=r(26810),l=r(38898),u=r(56973),c=r(63276),d=r(21052),h=r(95398);n({target:"Reflect",stat:!0,forced:l((function(){var t=function(){},e=u.f(new t,"a",{configurable:!0});return!1!==Reflect.set(t.prototype,"a",1,e)}))},{set:function t(e,r,n){var l,f,p,g=arguments.length<4?e:arguments[3],v=c.f(a(e),r);if(!v){if(o(f=d(e)))return t(f,r,n,g);v=h(0)}if(s(v)){if(!1===v.writable||!o(g))return!1;if(l=c.f(g,r)){if(l.get||l.set||!1===l.writable)return!1;l.value=n,u.f(g,r,l)}else u.f(g,r,h(0,n))}else{if(void 0===(p=v.set))return!1;i(p,g,n)}return!0}})},15107:(t,e,r)=>{var n=r(98646),i=r(80800),a=r(24198);n({global:!0},{Reflect:{}}),a(i.Reflect,"Reflect",!0)},61821:(t,e,r)=>{var n=r(60909),i=r(80800),a=r(47497),o=r(28046),s=r(38754),l=r(19382),u=r(2107).f,c=r(29407),d=r(18609),h=r(82518),f=r(17328),p=r(4622),g=r(56668),v=r(78993),m=r(38898),y=r(48613),b=r(44495).enforce,E=r(72538),x=r(90026),S=r(61523),T=r(10158),w=x("match"),_=i.RegExp,A=_.prototype,k=i.SyntaxError,C=a(A.exec),D=a("".charAt),L=a("".replace),R=a("".indexOf),I=a("".slice),O=/^\?<[^\s\d!#%&*+<=>@^][^\s!#%&*+<=>@^]*>/,M=/a/g,P=/a/g,F=new _(M)!==M,N=p.MISSED_STICKY,B=p.UNSUPPORTED_Y;if(o("RegExp",n&&(!F||N||S||T||m((function(){return P[w]=!1,_(M)!=M||_(P)==P||"/a/i"!=_(M,"i")}))))){for(var U=function(t,e){var r,n,i,a,o,u,p=c(A,this),g=d(t),v=void 0===e,m=[],E=t;if(!p&&g&&v&&t.constructor===U)return t;if((g||c(A,t))&&(t=t.source,v&&(e=f(E))),t=void 0===t?"":h(t),e=void 0===e?"":h(e),E=t,S&&"dotAll"in M&&(n=!!e&&R(e,"s")>-1)&&(e=L(e,/s/g,"")),r=e,N&&"sticky"in M&&(i=!!e&&R(e,"y")>-1)&&B&&(e=L(e,/y/g,"")),T&&(a=function(t){for(var e,r=t.length,n=0,i="",a=[],o={},s=!1,l=!1,u=0,c="";n<=r;n++){if("\\"===(e=D(t,n)))e+=D(t,++n);else if("]"===e)s=!1;else if(!s)switch(!0){case"["===e:s=!0;break;case"("===e:C(O,I(t,n+1))&&(n+=2,l=!0),i+=e,u++;continue;case">"===e&&l:if(""===c||y(o,c))throw new k("Invalid capture group name");o[c]=!0,a[a.length]=[c,u],l=!1,c="";continue}l?c+=e:i+=e}return[i,a]}(t),t=a[0],m=a[1]),o=s(_(t,e),p?this:A,U),(n||i||m.length)&&(u=b(o),n&&(u.dotAll=!0,u.raw=U(function(t){for(var e,r=t.length,n=0,i="",a=!1;n<=r;n++)"\\"!==(e=D(t,n))?a||"."!==e?("["===e?a=!0:"]"===e&&(a=!1),i+=e):i+="[\\s\\S]":i+=e+D(t,++n);return i}(t),r)),i&&(u.sticky=!0),m.length&&(u.groups=m)),t!==E)try{l(o,"source",""===E?"(?:)":E)}catch(t){}return o},j=u(_),H=0;j.length>H;)g(U,_,j[H++]);A.constructor=U,U.prototype=A,v(i,"RegExp",U,{constructor:!0})}E("RegExp")},77933:(t,e,r)=>{var n=r(60909),i=r(61523),a=r(54518),o=r(10159),s=r(44495).get,l=RegExp.prototype,u=TypeError;n&&i&&o(l,"dotAll",{configurable:!0,get:function(){if(this!==l){if("RegExp"===a(this))return!!s(this).dotAll;throw u("Incompatible receiver, RegExp required")}}})},39707:(t,e,r)=>{"use strict";var n=r(98646),i=r(64226);n({target:"RegExp",proto:!0,forced:/./.exec!==i},{exec:i})},97111:(t,e,r)=>{var n=r(80800),i=r(60909),a=r(10159),o=r(14704),s=r(38898),l=n.RegExp,u=l.prototype;i&&s((function(){var t=!0;try{l(".","d")}catch(e){t=!1}var e={},r="",n=t?"dgimsy":"gimsy",i=function(t,n){Object.defineProperty(e,t,{get:function(){return r+=n,!0}})},a={dotAll:"s",global:"g",ignoreCase:"i",multiline:"m",sticky:"y"};for(var o in t&&(a.hasIndices="d"),a)i(o,a[o]);return Object.getOwnPropertyDescriptor(u,"flags").get.call(e)!==n||r!==n}))&&a(u,"flags",{configurable:!0,get:o})},42001:(t,e,r)=>{var n=r(60909),i=r(4622).MISSED_STICKY,a=r(54518),o=r(10159),s=r(44495).get,l=RegExp.prototype,u=TypeError;n&&i&&o(l,"sticky",{configurable:!0,get:function(){if(this!==l){if("RegExp"===a(this))return!!s(this).sticky;throw u("Incompatible receiver, RegExp required")}}})},81939:(t,e,r)=>{"use strict";r(39707);var n,i,a=r(98646),o=r(98004),s=r(76599),l=r(45511),u=r(82518),c=(n=!1,(i=/[ac]/).exec=function(){return n=!0,/./.exec.apply(this,arguments)},!0===i.test("abc")&&n),d=/./.test;a({target:"RegExp",proto:!0,forced:!c},{test:function(t){var e=l(this),r=u(t),n=e.exec;if(!s(n))return o(d,e,r);var i=o(n,e,r);return null!==i&&(l(i),!0)}})},18977:(t,e,r)=>{"use strict";var n=r(2656).PROPER,i=r(78993),a=r(45511),o=r(82518),s=r(38898),l=r(17328),u="toString",c=RegExp.prototype[u],d=s((function(){return"/a/b"!=c.call({source:"a",flags:"b"})})),h=n&&c.name!=u;(d||h)&&i(RegExp.prototype,u,(function(){var t=a(this);return"/"+o(t.source)+"/"+o(l(t))}),{unsafe:!0})},78929:(t,e,r)=>{"use strict";r(39216)("Set",(function(t){return function(){return t(this,arguments.length?arguments[0]:void 0)}}),r(46633))},955:(t,e,r)=>{r(78929)},13196:(t,e,r)=>{"use strict";var n=r(98646),i=r(13242);n({target:"String",proto:!0,forced:r(31373)("anchor")},{anchor:function(t){return i(this,"a","name",t)}})},66325:(t,e,r)=>{"use strict";var n=r(98646),i=r(47497),a=r(58401),o=r(59802),s=r(82518),l=r(38898),u=i("".charAt);n({target:"String",proto:!0,forced:l((function(){return"\ud842"!=="𠮷".at(-2)}))},{at:function(t){var e=s(a(this)),r=e.length,n=o(t),i=n>=0?n:r+n;return i<0||i>=r?void 0:u(e,i)}})},36316:(t,e,r)=>{"use strict";var n=r(98646),i=r(13242);n({target:"String",proto:!0,forced:r(31373)("big")},{big:function(){return i(this,"big","","")}})},94815:(t,e,r)=>{"use strict";var n=r(98646),i=r(13242);n({target:"String",proto:!0,forced:r(31373)("blink")},{blink:function(){return i(this,"blink","","")}})},67228:(t,e,r)=>{"use strict";var n=r(98646),i=r(13242);n({target:"String",proto:!0,forced:r(31373)("bold")},{bold:function(){return i(this,"b","","")}})},9275:(t,e,r)=>{"use strict";var n=r(98646),i=r(68214).codeAt;n({target:"String",proto:!0},{codePointAt:function(t){return i(this,t)}})},65081:(t,e,r)=>{"use strict";var n,i=r(98646),a=r(22536),o=r(63276).f,s=r(43310),l=r(82518),u=r(36131),c=r(58401),d=r(35899),h=r(20781),f=a("".endsWith),p=a("".slice),g=Math.min,v=d("endsWith");i({target:"String",proto:!0,forced:!(!h&&!v&&(n=o(String.prototype,"endsWith"),n&&!n.writable)||v)},{endsWith:function(t){var e=l(c(this));u(t);var r=arguments.length>1?arguments[1]:void 0,n=e.length,i=void 0===r?n:g(s(r),n),a=l(t);return f?f(e,a,i):p(e,i-a.length,i)===a}})},64083:(t,e,r)=>{"use strict";var n=r(98646),i=r(13242);n({target:"String",proto:!0,forced:r(31373)("fixed")},{fixed:function(){return i(this,"tt","","")}})},53856:(t,e,r)=>{"use strict";var n=r(98646),i=r(13242);n({target:"String",proto:!0,forced:r(31373)("fontcolor")},{fontcolor:function(t){return i(this,"font","color",t)}})},84144:(t,e,r)=>{"use strict";var n=r(98646),i=r(13242);n({target:"String",proto:!0,forced:r(31373)("fontsize")},{fontsize:function(t){return i(this,"font","size",t)}})},37140:(t,e,r)=>{var n=r(98646),i=r(47497),a=r(39211),o=RangeError,s=String.fromCharCode,l=String.fromCodePoint,u=i([].join);n({target:"String",stat:!0,arity:1,forced:!!l&&1!=l.length},{fromCodePoint:function(t){for(var e,r=[],n=arguments.length,i=0;n>i;){if(e=+arguments[i++],a(e,1114111)!==e)throw o(e+" is not a valid code point");r[i]=e<65536?s(e):s(55296+((e-=65536)>>10),e%1024+56320)}return u(r,"")}})},2439:(t,e,r)=>{"use strict";var n=r(98646),i=r(47497),a=r(36131),o=r(58401),s=r(82518),l=r(35899),u=i("".indexOf);n({target:"String",proto:!0,forced:!l("includes")},{includes:function(t){return!!~u(s(o(this)),s(a(t)),arguments.length>1?arguments[1]:void 0)}})},48873:(t,e,r)=>{"use strict";var n=r(98646),i=r(13242);n({target:"String",proto:!0,forced:r(31373)("italics")},{italics:function(){return i(this,"i","","")}})},71794:(t,e,r)=>{"use strict";var n=r(68214).charAt,i=r(82518),a=r(44495),o=r(85011),s=r(70788),l="String Iterator",u=a.set,c=a.getterFor(l);o(String,"String",(function(t){u(this,{type:l,string:i(t),index:0})}),(function(){var t,e=c(this),r=e.string,i=e.index;return i>=r.length?s(void 0,!0):(t=n(r,i),e.index+=t.length,s(t,!1))}))},55882:(t,e,r)=>{"use strict";var n=r(98646),i=r(13242);n({target:"String",proto:!0,forced:r(31373)("link")},{link:function(t){return i(this,"a","href",t)}})},69596:(t,e,r)=>{"use strict";var n=r(98646),i=r(98004),a=r(22536),o=r(48298),s=r(70788),l=r(58401),u=r(43310),c=r(82518),d=r(45511),h=r(98522),f=r(54518),p=r(18609),g=r(17328),v=r(74287),m=r(78993),y=r(38898),b=r(90026),E=r(73370),x=r(83829),S=r(18692),T=r(44495),w=r(20781),_=b("matchAll"),A="RegExp String",k=A+" Iterator",C=T.set,D=T.getterFor(k),L=RegExp.prototype,R=TypeError,I=a("".indexOf),O=a("".matchAll),M=!!O&&!y((function(){O("a",/./)})),P=o((function(t,e,r,n){C(this,{type:k,regexp:t,string:e,global:r,unicode:n,done:!1})}),A,(function(){var t=D(this);if(t.done)return s(void 0,!0);var e=t.regexp,r=t.string,n=S(e,r);return null===n?(t.done=!0,s(void 0,!0)):t.global?(""===c(n[0])&&(e.lastIndex=x(r,u(e.lastIndex),t.unicode)),s(n,!1)):(t.done=!0,s(n,!1))})),F=function(t){var e,r,n,i=d(this),a=c(t),o=E(i,RegExp),s=c(g(i));return e=new o(o===RegExp?i.source:i,s),r=!!~I(s,"g"),n=!!~I(s,"u"),e.lastIndex=u(i.lastIndex),new P(e,a,r,n)};n({target:"String",proto:!0,forced:M},{matchAll:function(t){var e,r,n,a,o=l(this);if(h(t)){if(M)return O(o,t)}else{if(p(t)&&(e=c(l(g(t))),!~I(e,"g")))throw R("`.matchAll` does not allow non-global regexes");if(M)return O(o,t);if(void 0===(n=v(t,_))&&w&&"RegExp"==f(t)&&(n=F),n)return i(n,t,o)}return r=c(o),a=new RegExp(t,"g"),w?i(F,a,r):a[_](r)}}),w||_ in L||m(L,_,F)},35087:(t,e,r)=>{"use strict";var n=r(98004),i=r(36633),a=r(45511),o=r(98522),s=r(43310),l=r(82518),u=r(58401),c=r(74287),d=r(83829),h=r(18692);i("match",(function(t,e,r){return[function(e){var r=u(this),i=o(e)?void 0:c(e,t);return i?n(i,e,r):new RegExp(e)[t](l(r))},function(t){var n=a(this),i=l(t),o=r(e,n,i);if(o.done)return o.value;if(!n.global)return h(n,i);var u=n.unicode;n.lastIndex=0;for(var c,f=[],p=0;null!==(c=h(n,i));){var g=l(c[0]);f[p]=g,""===g&&(n.lastIndex=d(i,s(n.lastIndex),u)),p++}return 0===p?null:f}]}))},51326:(t,e,r)=>{"use strict";var n=r(98646),i=r(1274).end;n({target:"String",proto:!0,forced:r(40796)},{padEnd:function(t){return i(this,t,arguments.length>1?arguments[1]:void 0)}})},34476:(t,e,r)=>{"use strict";var n=r(98646),i=r(1274).start;n({target:"String",proto:!0,forced:r(40796)},{padStart:function(t){return i(this,t,arguments.length>1?arguments[1]:void 0)}})},567:(t,e,r)=>{var n=r(98646),i=r(47497),a=r(46603),o=r(46640),s=r(82518),l=r(19720),u=i([].push),c=i([].join);n({target:"String",stat:!0},{raw:function(t){var e=a(o(t).raw),r=l(e);if(!r)return"";for(var n=arguments.length,i=[],d=0;;){if(u(i,s(e[d++])),d===r)return c(i,"");d<n&&u(i,s(arguments[d]))}}})},62754:(t,e,r)=>{r(98646)({target:"String",proto:!0},{repeat:r(81968)})},82303:(t,e,r)=>{"use strict";var n=r(98646),i=r(98004),a=r(47497),o=r(58401),s=r(76599),l=r(98522),u=r(18609),c=r(82518),d=r(74287),h=r(17328),f=r(74979),p=r(90026),g=r(20781),v=p("replace"),m=TypeError,y=a("".indexOf),b=a("".replace),E=a("".slice),x=Math.max,S=function(t,e,r){return r>t.length?-1:""===e?r:y(t,e,r)};n({target:"String",proto:!0},{replaceAll:function(t,e){var r,n,a,p,T,w,_,A,k,C=o(this),D=0,L=0,R="";if(!l(t)){if((r=u(t))&&(n=c(o(h(t))),!~y(n,"g")))throw m("`.replaceAll` does not allow non-global regexes");if(a=d(t,v))return i(a,t,C,e);if(g&&r)return b(c(C),t,e)}for(p=c(C),T=c(t),(w=s(e))||(e=c(e)),_=T.length,A=x(1,_),D=S(p,T,0);-1!==D;)k=w?c(e(T,D,p)):f(T,p,D,[],void 0,e),R+=E(p,L,D)+k,L=D+_,D=S(p,T,D+A);return L<p.length&&(R+=E(p,L)),R}})},67071:(t,e,r)=>{"use strict";var n=r(49356),i=r(98004),a=r(47497),o=r(36633),s=r(38898),l=r(45511),u=r(76599),c=r(98522),d=r(59802),h=r(43310),f=r(82518),p=r(58401),g=r(83829),v=r(74287),m=r(74979),y=r(18692),b=r(90026)("replace"),E=Math.max,x=Math.min,S=a([].concat),T=a([].push),w=a("".indexOf),_=a("".slice),A="$0"==="a".replace(/./,"$0"),k=!!/./[b]&&""===/./[b]("a","$0");o("replace",(function(t,e,r){var a=k?"$":"$0";return[function(t,r){var n=p(this),a=c(t)?void 0:v(t,b);return a?i(a,t,n,r):i(e,f(n),t,r)},function(t,i){var o=l(this),s=f(t);if("string"==typeof i&&-1===w(i,a)&&-1===w(i,"$<")){var c=r(e,o,s,i);if(c.done)return c.value}var p=u(i);p||(i=f(i));var v=o.global;if(v){var b=o.unicode;o.lastIndex=0}for(var A=[];;){var k=y(o,s);if(null===k)break;if(T(A,k),!v)break;""===f(k[0])&&(o.lastIndex=g(s,h(o.lastIndex),b))}for(var C,D="",L=0,R=0;R<A.length;R++){for(var I=f((k=A[R])[0]),O=E(x(d(k.index),s.length),0),M=[],P=1;P<k.length;P++)T(M,void 0===(C=k[P])?C:String(C));var F=k.groups;if(p){var N=S([I],M,O,s);void 0!==F&&T(N,F);var B=f(n(i,void 0,N))}else B=m(I,s,O,M,F,i);O>=L&&(D+=_(s,L,O)+B,L=O+I.length)}return D+_(s,L)}]}),!!s((function(){var t=/./;return t.exec=function(){var t=[];return t.groups={a:"7"},t},"7"!=="".replace(t,"$<a>")}))||!A||k)},70637:(t,e,r)=>{"use strict";var n=r(98004),i=r(36633),a=r(45511),o=r(98522),s=r(58401),l=r(20824),u=r(82518),c=r(74287),d=r(18692);i("search",(function(t,e,r){return[function(e){var r=s(this),i=o(e)?void 0:c(e,t);return i?n(i,e,r):new RegExp(e)[t](u(r))},function(t){var n=a(this),i=u(t),o=r(e,n,i);if(o.done)return o.value;var s=n.lastIndex;l(s,0)||(n.lastIndex=0);var c=d(n,i);return l(n.lastIndex,s)||(n.lastIndex=s),null===c?-1:c.index}]}))},38843:(t,e,r)=>{"use strict";var n=r(98646),i=r(13242);n({target:"String",proto:!0,forced:r(31373)("small")},{small:function(){return i(this,"small","","")}})},99102:(t,e,r)=>{"use strict";var n=r(49356),i=r(98004),a=r(47497),o=r(36633),s=r(45511),l=r(98522),u=r(18609),c=r(58401),d=r(73370),h=r(83829),f=r(43310),p=r(82518),g=r(74287),v=r(28022),m=r(18692),y=r(64226),b=r(4622),E=r(38898),x=b.UNSUPPORTED_Y,S=4294967295,T=Math.min,w=[].push,_=a(/./.exec),A=a(w),k=a("".slice);o("split",(function(t,e,r){var a;return a="c"=="abbc".split(/(b)*/)[1]||4!="test".split(/(?:)/,-1).length||2!="ab".split(/(?:ab)*/).length||4!=".".split(/(.?)(.?)/).length||".".split(/()()/).length>1||"".split(/.?/).length?function(t,r){var a=p(c(this)),o=void 0===r?S:r>>>0;if(0===o)return[];if(void 0===t)return[a];if(!u(t))return i(e,a,t,o);for(var s,l,d,h=[],f=(t.ignoreCase?"i":"")+(t.multiline?"m":"")+(t.unicode?"u":"")+(t.sticky?"y":""),g=0,m=new RegExp(t.source,f+"g");(s=i(y,m,a))&&!((l=m.lastIndex)>g&&(A(h,k(a,g,s.index)),s.length>1&&s.index<a.length&&n(w,h,v(s,1)),d=s[0].length,g=l,h.length>=o));)m.lastIndex===s.index&&m.lastIndex++;return g===a.length?!d&&_(m,"")||A(h,""):A(h,k(a,g)),h.length>o?v(h,0,o):h}:"0".split(void 0,0).length?function(t,r){return void 0===t&&0===r?[]:i(e,this,t,r)}:e,[function(e,r){var n=c(this),o=l(e)?void 0:g(e,t);return o?i(o,e,n,r):i(a,p(n),e,r)},function(t,n){var i=s(this),o=p(t),l=r(a,i,o,n,a!==e);if(l.done)return l.value;var u=d(i,RegExp),c=i.unicode,g=(i.ignoreCase?"i":"")+(i.multiline?"m":"")+(i.unicode?"u":"")+(x?"g":"y"),v=new u(x?"^(?:"+i.source+")":i,g),y=void 0===n?S:n>>>0;if(0===y)return[];if(0===o.length)return null===m(v,o)?[o]:[];for(var b=0,E=0,w=[];E<o.length;){v.lastIndex=x?0:E;var _,C=m(v,x?k(o,E):o);if(null===C||(_=T(f(v.lastIndex+(x?E:0)),o.length))===b)E=h(o,E,c);else{if(A(w,k(o,b,E)),w.length===y)return w;for(var D=1;D<=C.length-1;D++)if(A(w,C[D]),w.length===y)return w;E=b=_}}return A(w,k(o,b)),w}]}),!!E((function(){var t=/(?:)/,e=t.exec;t.exec=function(){return e.apply(this,arguments)};var r="ab".split(t);return 2!==r.length||"a"!==r[0]||"b"!==r[1]})),x)},66168:(t,e,r)=>{"use strict";var n,i=r(98646),a=r(22536),o=r(63276).f,s=r(43310),l=r(82518),u=r(36131),c=r(58401),d=r(35899),h=r(20781),f=a("".startsWith),p=a("".slice),g=Math.min,v=d("startsWith");i({target:"String",proto:!0,forced:!(!h&&!v&&(n=o(String.prototype,"startsWith"),n&&!n.writable)||v)},{startsWith:function(t){var e=l(c(this));u(t);var r=s(g(arguments.length>1?arguments[1]:void 0,e.length)),n=l(t);return f?f(e,n,r):p(e,r,r+n.length)===n}})},67828:(t,e,r)=>{"use strict";var n=r(98646),i=r(13242);n({target:"String",proto:!0,forced:r(31373)("strike")},{strike:function(){return i(this,"strike","","")}})},48130:(t,e,r)=>{"use strict";var n=r(98646),i=r(13242);n({target:"String",proto:!0,forced:r(31373)("sub")},{sub:function(){return i(this,"sub","","")}})},6369:(t,e,r)=>{"use strict";var n=r(98646),i=r(47497),a=r(58401),o=r(59802),s=r(82518),l=i("".slice),u=Math.max,c=Math.min;n({target:"String",proto:!0,forced:!"".substr||"b"!=="ab".substr(-1)},{substr:function(t,e){var r,n,i=s(a(this)),d=i.length,h=o(t);return h===1/0&&(h=0),h<0&&(h=u(d+h,0)),(r=void 0===e?d:o(e))<=0||r===1/0||h>=(n=c(h+r,d))?"":l(i,h,n)}})},41444:(t,e,r)=>{"use strict";var n=r(98646),i=r(13242);n({target:"String",proto:!0,forced:r(31373)("sup")},{sup:function(){return i(this,"sup","","")}})},81428:(t,e,r)=>{r(74389);var n=r(98646),i=r(84886);n({target:"String",proto:!0,name:"trimEnd",forced:"".trimEnd!==i},{trimEnd:i})},83449:(t,e,r)=>{var n=r(98646),i=r(30397);n({target:"String",proto:!0,name:"trimStart",forced:"".trimLeft!==i},{trimLeft:i})},74389:(t,e,r)=>{var n=r(98646),i=r(84886);n({target:"String",proto:!0,name:"trimEnd",forced:"".trimRight!==i},{trimRight:i})},40588:(t,e,r)=>{r(83449);var n=r(98646),i=r(30397);n({target:"String",proto:!0,name:"trimStart",forced:"".trimStart!==i},{trimStart:i})},92886:(t,e,r)=>{"use strict";var n=r(98646),i=r(93444).trim;n({target:"String",proto:!0,forced:r(85536)("trim")},{trim:function(){return i(this)}})},79384:(t,e,r)=>{r(53833)("asyncIterator")},7764:(t,e,r)=>{"use strict";var n=r(98646),i=r(80800),a=r(98004),o=r(47497),s=r(20781),l=r(60909),u=r(88322),c=r(38898),d=r(48613),h=r(29407),f=r(45511),p=r(46603),g=r(77369),v=r(82518),m=r(95398),y=r(79692),b=r(73555),E=r(2107),x=r(9677),S=r(52610),T=r(63276),w=r(56973),_=r(83110),A=r(68858),k=r(78993),C=r(29829),D=r(91544),L=r(20555),R=r(49386),I=r(90026),O=r(35223),M=r(53833),P=r(42008),F=r(24198),N=r(44495),B=r(54292).forEach,U=D("hidden"),j="Symbol",H="prototype",G=N.set,z=N.getterFor(j),V=Object[H],W=i.Symbol,K=W&&W[H],Y=i.TypeError,q=i.QObject,X=T.f,$=w.f,Q=x.f,J=A.f,Z=o([].push),tt=C("symbols"),et=C("op-symbols"),rt=C("wks"),nt=!q||!q[H]||!q[H].findChild,it=l&&c((function(){return 7!=y($({},"a",{get:function(){return $(this,"a",{value:7}).a}})).a}))?function(t,e,r){var n=X(V,e);n&&delete V[e],$(t,e,r),n&&t!==V&&$(V,e,n)}:$,at=function(t,e){var r=tt[t]=y(K);return G(r,{type:j,tag:t,description:e}),l||(r.description=e),r},ot=function(t,e,r){t===V&&ot(et,e,r),f(t);var n=g(e);return f(r),d(tt,n)?(r.enumerable?(d(t,U)&&t[U][n]&&(t[U][n]=!1),r=y(r,{enumerable:m(0,!1)})):(d(t,U)||$(t,U,m(1,{})),t[U][n]=!0),it(t,n,r)):$(t,n,r)},st=function(t,e){f(t);var r=p(e),n=b(r).concat(dt(r));return B(n,(function(e){l&&!a(lt,r,e)||ot(t,e,r[e])})),t},lt=function(t){var e=g(t),r=a(J,this,e);return!(this===V&&d(tt,e)&&!d(et,e))&&(!(r||!d(this,e)||!d(tt,e)||d(this,U)&&this[U][e])||r)},ut=function(t,e){var r=p(t),n=g(e);if(r!==V||!d(tt,n)||d(et,n)){var i=X(r,n);return!i||!d(tt,n)||d(r,U)&&r[U][n]||(i.enumerable=!0),i}},ct=function(t){var e=Q(p(t)),r=[];return B(e,(function(t){d(tt,t)||d(L,t)||Z(r,t)})),r},dt=function(t){var e=t===V,r=Q(e?et:p(t)),n=[];return B(r,(function(t){!d(tt,t)||e&&!d(V,t)||Z(n,tt[t])})),n};u||(k(K=(W=function(){if(h(K,this))throw Y("Symbol is not a constructor");var t=arguments.length&&void 0!==arguments[0]?v(arguments[0]):void 0,e=R(t),r=function(t){this===V&&a(r,et,t),d(this,U)&&d(this[U],e)&&(this[U][e]=!1),it(this,e,m(1,t))};return l&&nt&&it(V,e,{configurable:!0,set:r}),at(e,t)})[H],"toString",(function(){return z(this).tag})),k(W,"withoutSetter",(function(t){return at(R(t),t)})),A.f=lt,w.f=ot,_.f=st,T.f=ut,E.f=x.f=ct,S.f=dt,O.f=function(t){return at(I(t),t)},l&&($(K,"description",{configurable:!0,get:function(){return z(this).description}}),s||k(V,"propertyIsEnumerable",lt,{unsafe:!0}))),n({global:!0,constructor:!0,wrap:!0,forced:!u,sham:!u},{Symbol:W}),B(b(rt),(function(t){M(t)})),n({target:j,stat:!0,forced:!u},{useSetter:function(){nt=!0},useSimple:function(){nt=!1}}),n({target:"Object",stat:!0,forced:!u,sham:!l},{create:function(t,e){return void 0===e?y(t):st(y(t),e)},defineProperty:ot,defineProperties:st,getOwnPropertyDescriptor:ut}),n({target:"Object",stat:!0,forced:!u},{getOwnPropertyNames:ct}),P(),F(W,j),L[U]=!0},94199:(t,e,r)=>{"use strict";var n=r(98646),i=r(60909),a=r(80800),o=r(47497),s=r(48613),l=r(76599),u=r(29407),c=r(82518),d=r(56973).f,h=r(34327),f=a.Symbol,p=f&&f.prototype;if(i&&l(f)&&(!("description"in p)||void 0!==f().description)){var g={},v=function(){var t=arguments.length<1||void 0===arguments[0]?void 0:c(arguments[0]),e=u(p,this)?new f(t):void 0===t?f():f(t);return""===t&&(g[e]=!0),e};h(v,f),v.prototype=p,p.constructor=v;var m="Symbol(test)"==String(f("test")),y=o(p.valueOf),b=o(p.toString),E=/^Symbol\((.*)\)[^)]+$/,x=o("".replace),S=o("".slice);d(p,"description",{configurable:!0,get:function(){var t=y(this);if(s(g,t))return"";var e=b(t),r=m?S(e,7,-1):x(e,E,"$1");return""===r?void 0:r}}),n({global:!0,constructor:!0,forced:!0},{Symbol:v})}},89013:(t,e,r)=>{var n=r(98646),i=r(14817),a=r(48613),o=r(82518),s=r(29829),l=r(85732),u=s("string-to-symbol-registry"),c=s("symbol-to-string-registry");n({target:"Symbol",stat:!0,forced:!l},{for:function(t){var e=o(t);if(a(u,e))return u[e];var r=i("Symbol")(e);return u[e]=r,c[r]=e,r}})},99357:(t,e,r)=>{r(53833)("hasInstance")},65323:(t,e,r)=>{r(53833)("isConcatSpreadable")},78459:(t,e,r)=>{r(53833)("iterator")},39496:(t,e,r)=>{r(7764),r(89013),r(98171),r(82833),r(99822)},98171:(t,e,r)=>{var n=r(98646),i=r(48613),a=r(29611),o=r(92756),s=r(29829),l=r(85732),u=s("symbol-to-string-registry");n({target:"Symbol",stat:!0,forced:!l},{keyFor:function(t){if(!a(t))throw TypeError(o(t)+" is not a symbol");if(i(u,t))return u[t]}})},28349:(t,e,r)=>{r(53833)("matchAll")},78154:(t,e,r)=>{r(53833)("match")},38856:(t,e,r)=>{r(53833)("replace")},65749:(t,e,r)=>{r(53833)("search")},9707:(t,e,r)=>{r(53833)("species")},32137:(t,e,r)=>{r(53833)("split")},94682:(t,e,r)=>{var n=r(53833),i=r(42008);n("toPrimitive"),i()},44225:(t,e,r)=>{var n=r(14817),i=r(53833),a=r(24198);i("toStringTag"),a(n("Symbol"),"Symbol")},47527:(t,e,r)=>{r(53833)("unscopables")},43839:(t,e,r)=>{"use strict";var n=r(7353),i=r(19720),a=r(59802),o=n.aTypedArray;(0,n.exportTypedArrayMethod)("at",(function(t){var e=o(this),r=i(e),n=a(t),s=n>=0?n:r+n;return s<0||s>=r?void 0:e[s]}))},7782:(t,e,r)=>{"use strict";var n=r(47497),i=r(7353),a=n(r(31482)),o=i.aTypedArray;(0,i.exportTypedArrayMethod)("copyWithin",(function(t,e){return a(o(this),t,e,arguments.length>2?arguments[2]:void 0)}))},28009:(t,e,r)=>{"use strict";var n=r(7353),i=r(54292).every,a=n.aTypedArray;(0,n.exportTypedArrayMethod)("every",(function(t){return i(a(this),t,arguments.length>1?arguments[1]:void 0)}))},56757:(t,e,r)=>{"use strict";var n=r(7353),i=r(64230),a=r(99750),o=r(2796),s=r(98004),l=r(47497),u=r(38898),c=n.aTypedArray,d=n.exportTypedArrayMethod,h=l("".slice);d("fill",(function(t){var e=arguments.length;c(this);var r="Big"===h(o(this),0,3)?a(t):+t;return s(i,this,r,e>1?arguments[1]:void 0,e>2?arguments[2]:void 0)}),u((function(){var t=0;return new Int8Array(2).fill({valueOf:function(){return t++}}),1!==t})))},52110:(t,e,r)=>{"use strict";var n=r(7353),i=r(54292).filter,a=r(23445),o=n.aTypedArray;(0,n.exportTypedArrayMethod)("filter",(function(t){var e=i(o(this),t,arguments.length>1?arguments[1]:void 0);return a(this,e)}))},42220:(t,e,r)=>{"use strict";var n=r(7353),i=r(54292).findIndex,a=n.aTypedArray;(0,n.exportTypedArrayMethod)("findIndex",(function(t){return i(a(this),t,arguments.length>1?arguments[1]:void 0)}))},14740:(t,e,r)=>{"use strict";var n=r(7353),i=r(86060).findLastIndex,a=n.aTypedArray;(0,n.exportTypedArrayMethod)("findLastIndex",(function(t){return i(a(this),t,arguments.length>1?arguments[1]:void 0)}))},54363:(t,e,r)=>{"use strict";var n=r(7353),i=r(86060).findLast,a=n.aTypedArray;(0,n.exportTypedArrayMethod)("findLast",(function(t){return i(a(this),t,arguments.length>1?arguments[1]:void 0)}))},75721:(t,e,r)=>{"use strict";var n=r(7353),i=r(54292).find,a=n.aTypedArray;(0,n.exportTypedArrayMethod)("find",(function(t){return i(a(this),t,arguments.length>1?arguments[1]:void 0)}))},47247:(t,e,r)=>{r(52087)("Float32",(function(t){return function(e,r,n){return t(this,e,r,n)}}))},6173:(t,e,r)=>{r(52087)("Float64",(function(t){return function(e,r,n){return t(this,e,r,n)}}))},83543:(t,e,r)=>{"use strict";var n=r(7353),i=r(54292).forEach,a=n.aTypedArray;(0,n.exportTypedArrayMethod)("forEach",(function(t){i(a(this),t,arguments.length>1?arguments[1]:void 0)}))},18037:(t,e,r)=>{"use strict";var n=r(43489);(0,r(7353).exportTypedArrayStaticMethod)("from",r(15159),n)},33030:(t,e,r)=>{"use strict";var n=r(7353),i=r(67830).includes,a=n.aTypedArray;(0,n.exportTypedArrayMethod)("includes",(function(t){return i(a(this),t,arguments.length>1?arguments[1]:void 0)}))},32127:(t,e,r)=>{"use strict";var n=r(7353),i=r(67830).indexOf,a=n.aTypedArray;(0,n.exportTypedArrayMethod)("indexOf",(function(t){return i(a(this),t,arguments.length>1?arguments[1]:void 0)}))},57268:(t,e,r)=>{r(52087)("Int16",(function(t){return function(e,r,n){return t(this,e,r,n)}}))},47422:(t,e,r)=>{r(52087)("Int32",(function(t){return function(e,r,n){return t(this,e,r,n)}}))},63815:(t,e,r)=>{r(52087)("Int8",(function(t){return function(e,r,n){return t(this,e,r,n)}}))},13125:(t,e,r)=>{"use strict";var n=r(80800),i=r(38898),a=r(47497),o=r(7353),s=r(2357),l=r(90026)("iterator"),u=n.Uint8Array,c=a(s.values),d=a(s.keys),h=a(s.entries),f=o.aTypedArray,p=o.exportTypedArrayMethod,g=u&&u.prototype,v=!i((function(){g[l].call([1])})),m=!!g&&g.values&&g[l]===g.values&&"values"===g.values.name,y=function(){return c(f(this))};p("entries",(function(){return h(f(this))}),v),p("keys",(function(){return d(f(this))}),v),p("values",y,v||!m,{name:"values"}),p(l,y,v||!m,{name:"values"})},29096:(t,e,r)=>{"use strict";var n=r(7353),i=r(47497),a=n.aTypedArray,o=n.exportTypedArrayMethod,s=i([].join);o("join",(function(t){return s(a(this),t)}))},91662:(t,e,r)=>{"use strict";var n=r(7353),i=r(49356),a=r(3931),o=n.aTypedArray;(0,n.exportTypedArrayMethod)("lastIndexOf",(function(t){var e=arguments.length;return i(a,o(this),e>1?[t,arguments[1]]:[t])}))},72576:(t,e,r)=>{"use strict";var n=r(7353),i=r(54292).map,a=r(50056),o=n.aTypedArray;(0,n.exportTypedArrayMethod)("map",(function(t){return i(o(this),t,arguments.length>1?arguments[1]:void 0,(function(t,e){return new(a(t))(e)}))}))},97534:(t,e,r)=>{"use strict";var n=r(7353),i=r(43489),a=n.aTypedArrayConstructor;(0,n.exportTypedArrayStaticMethod)("of",(function(){for(var t=0,e=arguments.length,r=new(a(this))(e);e>t;)r[t]=arguments[t++];return r}),i)},20402:(t,e,r)=>{"use strict";var n=r(7353),i=r(63741).right,a=n.aTypedArray;(0,n.exportTypedArrayMethod)("reduceRight",(function(t){var e=arguments.length;return i(a(this),t,e,e>1?arguments[1]:void 0)}))},77435:(t,e,r)=>{"use strict";var n=r(7353),i=r(63741).left,a=n.aTypedArray;(0,n.exportTypedArrayMethod)("reduce",(function(t){var e=arguments.length;return i(a(this),t,e,e>1?arguments[1]:void 0)}))},14656:(t,e,r)=>{"use strict";var n=r(7353),i=n.aTypedArray,a=n.exportTypedArrayMethod,o=Math.floor;a("reverse",(function(){for(var t,e=this,r=i(e).length,n=o(r/2),a=0;a<n;)t=e[a],e[a++]=e[--r],e[r]=t;return e}))},89344:(t,e,r)=>{"use strict";var n=r(80800),i=r(98004),a=r(7353),o=r(19720),s=r(15009),l=r(46640),u=r(38898),c=n.RangeError,d=n.Int8Array,h=d&&d.prototype,f=h&&h.set,p=a.aTypedArray,g=a.exportTypedArrayMethod,v=!u((function(){var t=new Uint8ClampedArray(2);return i(f,t,{length:1,0:3},1),3!==t[1]})),m=v&&a.NATIVE_ARRAY_BUFFER_VIEWS&&u((function(){var t=new d(2);return t.set(1),t.set("2",1),0!==t[0]||2!==t[1]}));g("set",(function(t){p(this);var e=s(arguments.length>1?arguments[1]:void 0,1),r=l(t);if(v)return i(f,this,r,e);var n=this.length,a=o(r),u=0;if(a+e>n)throw c("Wrong length");for(;u<a;)this[e+u]=r[u++]}),!v||m)},44852:(t,e,r)=>{"use strict";var n=r(7353),i=r(50056),a=r(38898),o=r(87097),s=n.aTypedArray;(0,n.exportTypedArrayMethod)("slice",(function(t,e){for(var r=o(s(this),t,e),n=i(this),a=0,l=r.length,u=new n(l);l>a;)u[a]=r[a++];return u}),a((function(){new Int8Array(1).slice()})))},1217:(t,e,r)=>{"use strict";var n=r(7353),i=r(54292).some,a=n.aTypedArray;(0,n.exportTypedArrayMethod)("some",(function(t){return i(a(this),t,arguments.length>1?arguments[1]:void 0)}))},2555:(t,e,r)=>{"use strict";var n=r(80800),i=r(22536),a=r(38898),o=r(74435),s=r(34027),l=r(7353),u=r(38964),c=r(29423),d=r(87903),h=r(69870),f=l.aTypedArray,p=l.exportTypedArrayMethod,g=n.Uint16Array,v=g&&i(g.prototype.sort),m=!(!v||a((function(){v(new g(2),null)}))&&a((function(){v(new g(2),{})}))),y=!!v&&!a((function(){if(d)return d<74;if(u)return u<67;if(c)return!0;if(h)return h<602;var t,e,r=new g(516),n=Array(516);for(t=0;t<516;t++)e=t%4,r[t]=515-t,n[t]=t-2*e+3;for(v(r,(function(t,e){return(t/4|0)-(e/4|0)})),t=0;t<516;t++)if(r[t]!==n[t])return!0}));p("sort",(function(t){return void 0!==t&&o(t),y?v(this,t):s(f(this),function(t){return function(e,r){return void 0!==t?+t(e,r)||0:r!=r?-1:e!=e?1:0===e&&0===r?1/e>0&&1/r<0?1:-1:e>r}}(t))}),!y||m)},3903:(t,e,r)=>{"use strict";var n=r(7353),i=r(43310),a=r(39211),o=r(50056),s=n.aTypedArray;(0,n.exportTypedArrayMethod)("subarray",(function(t,e){var r=s(this),n=r.length,l=a(t,n);return new(o(r))(r.buffer,r.byteOffset+l*r.BYTES_PER_ELEMENT,i((void 0===e?n:a(e,n))-l))}))},96294:(t,e,r)=>{"use strict";var n=r(80800),i=r(49356),a=r(7353),o=r(38898),s=r(87097),l=n.Int8Array,u=a.aTypedArray,c=a.exportTypedArrayMethod,d=[].toLocaleString,h=!!l&&o((function(){d.call(new l(1))}));c("toLocaleString",(function(){return i(d,h?s(u(this)):u(this),s(arguments))}),o((function(){return[1,2].toLocaleString()!=new l([1,2]).toLocaleString()}))||!o((function(){l.prototype.toLocaleString.call([1,2])})))},25903:(t,e,r)=>{"use strict";var n=r(7353).exportTypedArrayMethod,i=r(38898),a=r(80800),o=r(47497),s=a.Uint8Array,l=s&&s.prototype||{},u=[].toString,c=o([].join);i((function(){u.call({})}))&&(u=function(){return c(this)});var d=l.toString!=u;n("toString",u,d)},86657:(t,e,r)=>{r(52087)("Uint16",(function(t){return function(e,r,n){return t(this,e,r,n)}}))},22459:(t,e,r)=>{r(52087)("Uint32",(function(t){return function(e,r,n){return t(this,e,r,n)}}))},20764:(t,e,r)=>{r(52087)("Uint8",(function(t){return function(e,r,n){return t(this,e,r,n)}}))},42759:(t,e,r)=>{r(52087)("Uint8",(function(t){return function(e,r,n){return t(this,e,r,n)}}),!0)},6269:(t,e,r)=>{"use strict";var n=r(98646),i=r(47497),a=r(82518),o=String.fromCharCode,s=i("".charAt),l=i(/./.exec),u=i("".slice),c=/^[\da-f]{2}$/i,d=/^[\da-f]{4}$/i;n({global:!0},{unescape:function(t){for(var e,r,n=a(t),i="",h=n.length,f=0;f<h;){if("%"===(e=s(n,f++)))if("u"===s(n,f)){if(r=u(n,f+1,f+5),l(d,r)){i+=o(parseInt(r,16)),f+=5;continue}}else if(r=u(n,f,f+2),l(c,r)){i+=o(parseInt(r,16)),f+=2;continue}i+=e}return i}})},56897:(t,e,r)=>{"use strict";var n,i=r(29025),a=r(80800),o=r(47497),s=r(10325),l=r(82194),u=r(39216),c=r(76538),d=r(91043),h=r(44495).enforce,f=r(38898),p=r(13282),g=Object,v=Array.isArray,m=g.isExtensible,y=g.isFrozen,b=g.isSealed,E=g.freeze,x=g.seal,S={},T={},w=!a.ActiveXObject&&"ActiveXObject"in a,_=function(t){return function(){return t(this,arguments.length?arguments[0]:void 0)}},A=u("WeakMap",_,c),k=A.prototype,C=o(k.set);if(p)if(w){n=c.getConstructor(_,"WeakMap",!0),l.enable();var D=o(k.delete),L=o(k.has),R=o(k.get);s(k,{delete:function(t){if(d(t)&&!m(t)){var e=h(this);return e.frozen||(e.frozen=new n),D(this,t)||e.frozen.delete(t)}return D(this,t)},has:function(t){if(d(t)&&!m(t)){var e=h(this);return e.frozen||(e.frozen=new n),L(this,t)||e.frozen.has(t)}return L(this,t)},get:function(t){if(d(t)&&!m(t)){var e=h(this);return e.frozen||(e.frozen=new n),L(this,t)?R(this,t):e.frozen.get(t)}return R(this,t)},set:function(t,e){if(d(t)&&!m(t)){var r=h(this);r.frozen||(r.frozen=new n),L(this,t)?C(this,t,e):r.frozen.set(t,e)}else C(this,t,e);return this}})}else i&&f((function(){var t=E([]);return C(new A,t,1),!y(t)}))&&s(k,{set:function(t,e){var r;return v(t)&&(y(t)?r=S:b(t)&&(r=T)),C(this,t,e),r==S&&E(t),r==T&&x(t),this}})},31962:(t,e,r)=>{r(56897)},29418:(t,e,r)=>{"use strict";r(39216)("WeakSet",(function(t){return function(){return t(this,arguments.length?arguments[0]:void 0)}}),r(76538))},65854:(t,e,r)=>{r(29418)},79642:(t,e,r)=>{var n=r(98646),i=r(80800),a=r(14817),o=r(47497),s=r(98004),l=r(38898),u=r(82518),c=r(48613),d=r(67539),h=r(77003).ctoi,f=/[^\d+/a-z]/i,p=/[\t\n\f\r ]+/g,g=/[=]+$/,v=a("atob"),m=String.fromCharCode,y=o("".charAt),b=o("".replace),E=o(f.exec),x=l((function(){return""!==v(" ")})),S=!l((function(){v("a")})),T=!x&&!S&&!l((function(){v()})),w=!x&&!S&&1!==v.length;n({global:!0,bind:!0,enumerable:!0,forced:x||S||T||w},{atob:function(t){if(d(arguments.length,1),T||w)return s(v,i,t);var e,r,n=b(u(t),p,""),o="",l=0,x=0;if(n.length%4==0&&(n=b(n,g,"")),n.length%4==1||E(f,n))throw new(a("DOMException"))("The string is not correctly encoded","InvalidCharacterError");for(;e=y(n,l++);)c(h,e)&&(r=x%4?64*r+h[e]:h[e],x++%4&&(o+=m(255&r>>(-2*x&6))));return o}})},13568:(t,e,r)=>{var n=r(98646),i=r(80800),a=r(14817),o=r(47497),s=r(98004),l=r(38898),u=r(82518),c=r(67539),d=r(77003).itoc,h=a("btoa"),f=o("".charAt),p=o("".charCodeAt),g=!!h&&!l((function(){h()})),v=!!h&&l((function(){return"bnVsbA=="!==h(null)})),m=!!h&&1!==h.length;n({global:!0,bind:!0,enumerable:!0,forced:g||v||m},{btoa:function(t){if(c(arguments.length,1),g||v||m)return s(h,i,u(t));for(var e,r,n=u(t),o="",l=0,y=d;f(n,l)||(y="=",l%1);){if((r=p(n,l+=3/4))>255)throw new(a("DOMException"))("The string contains characters outside of the Latin1 range","InvalidCharacterError");o+=f(y,63&(e=e<<8|r)>>8-l%1*8)}return o}})},54449:(t,e,r)=>{var n=r(98646),i=r(80800),a=r(55767).clear;n({global:!0,bind:!0,enumerable:!0,forced:i.clearImmediate!==a},{clearImmediate:a})},74243:(t,e,r)=>{var n=r(80800),i=r(40742),a=r(77395),o=r(824),s=r(19382),l=function(t){if(t&&t.forEach!==o)try{s(t,"forEach",o)}catch(e){t.forEach=o}};for(var u in i)i[u]&&l(n[u]&&n[u].prototype);l(a)},41582:(t,e,r)=>{var n=r(80800),i=r(40742),a=r(77395),o=r(2357),s=r(19382),l=r(90026),u=l("iterator"),c=l("toStringTag"),d=o.values,h=function(t,e){if(t){if(t[u]!==d)try{s(t,u,d)}catch(e){t[u]=d}if(t[c]||s(t,c,e),i[e])for(var r in o)if(t[r]!==o[r])try{s(t,r,o[r])}catch(e){t[r]=o[r]}}};for(var f in i)h(n[f]&&n[f].prototype,f);h(a,"DOMTokenList")},43619:(t,e,r)=>{"use strict";var n=r(98646),i=r(15946),a=r(14817),o=r(38898),s=r(79692),l=r(95398),u=r(56973).f,c=r(78993),d=r(10159),h=r(48613),f=r(96345),p=r(45511),g=r(50668),v=r(24506),m=r(86940),y=r(86179),b=r(44495),E=r(60909),x=r(20781),S="DOMException",T="DATA_CLONE_ERR",w=a("Error"),_=a(S)||function(){try{(new(a("MessageChannel")||i("worker_threads").MessageChannel)).port1.postMessage(new WeakMap)}catch(t){if(t.name==T&&25==t.code)return t.constructor}}(),A=_&&_.prototype,k=w.prototype,C=b.set,D=b.getterFor(S),L="stack"in w(S),R=function(t){return h(m,t)&&m[t].m?m[t].c:0},I=function(){f(this,O);var t=arguments.length,e=v(t<1?void 0:arguments[0]),r=v(t<2?void 0:arguments[1],"Error"),n=R(r);if(C(this,{type:S,name:r,message:e,code:n}),E||(this.name=r,this.message=e,this.code=n),L){var i=w(e);i.name=S,u(this,"stack",l(1,y(i.stack,1)))}},O=I.prototype=s(k),M=function(t){return{enumerable:!0,configurable:!0,get:t}},P=function(t){return M((function(){return D(this)[t]}))};E&&(d(O,"code",P("code")),d(O,"message",P("message")),d(O,"name",P("name"))),u(O,"constructor",l(1,I));var F=o((function(){return!(new _ instanceof w)})),N=F||o((function(){return k.toString!==g||"2: 1"!==String(new _(1,2))})),B=F||o((function(){return 25!==new _(1,"DataCloneError").code})),U=F||25!==_[T]||25!==A[T],j=x?N||B||U:F;n({global:!0,constructor:!0,forced:j},{DOMException:j?I:_});var H=a(S),G=H.prototype;for(var z in N&&(x||_===H)&&c(G,"toString",g),B&&E&&_===H&&d(G,"code",M((function(){return R(p(this).name)}))),m)if(h(m,z)){var V=m[z],W=V.s,K=l(6,V.c);h(H,W)||u(H,W,K),h(G,W)||u(G,W,K)}},58319:(t,e,r)=>{"use strict";var n=r(98646),i=r(80800),a=r(14817),o=r(95398),s=r(56973).f,l=r(48613),u=r(96345),c=r(38754),d=r(24506),h=r(86940),f=r(86179),p=r(60909),g=r(20781),v="DOMException",m=a("Error"),y=a(v),b=function(){u(this,E);var t=arguments.length,e=d(t<1?void 0:arguments[0]),r=d(t<2?void 0:arguments[1],"Error"),n=new y(e,r),i=m(e);return i.name=v,s(n,"stack",o(1,f(i.stack,1))),c(n,this,b),n},E=b.prototype=y.prototype,x="stack"in m(v),S="stack"in new y(1,2),T=y&&p&&Object.getOwnPropertyDescriptor(i,v),w=!(!T||T.writable&&T.configurable),_=x&&!w&&!S;n({global:!0,constructor:!0,forced:g||_},{DOMException:_?b:y});var A=a(v),k=A.prototype;if(k.constructor!==A)for(var C in g||s(k,"constructor",o(1,A)),h)if(l(h,C)){var D=h[C],L=D.s;l(A,L)||s(A,L,o(6,D.c))}},71228:(t,e,r)=>{var n=r(14817),i="DOMException";r(24198)(n(i),i)},85287:(t,e,r)=>{r(54449),r(59067)},83898:(t,e,r)=>{var n=r(98646),i=r(80800),a=r(89332),o=r(74435),s=r(67539),l=r(29040),u=i.process;n({global:!0,enumerable:!0,dontCallGetSet:!0},{queueMicrotask:function(t){s(arguments.length,1),o(t);var e=l&&u.domain;a(e?e.bind(t):t)}})},70454:(t,e,r)=>{"use strict";var n=r(98646),i=r(80800),a=r(10159),o=r(60909),s=TypeError,l=Object.defineProperty,u=i.self!==i;try{if(o){var c=Object.getOwnPropertyDescriptor(i,"self");!u&&c&&c.get&&c.enumerable||a(i,"self",{get:function(){return i},set:function(t){if(this!==i)throw s("Illegal invocation");l(i,"self",{value:t,writable:!0,configurable:!0,enumerable:!0})},configurable:!0,enumerable:!0})}else n({global:!0,simple:!0,forced:u},{self:i})}catch(t){}},59067:(t,e,r)=>{var n=r(98646),i=r(80800),a=r(55767).set,o=r(97739),s=i.setImmediate?o(a,!1):a;n({global:!0,bind:!0,enumerable:!0,forced:i.setImmediate!==s},{setImmediate:s})},63547:(t,e,r)=>{var n=r(98646),i=r(80800),a=r(97739)(i.setInterval,!0);n({global:!0,bind:!0,forced:i.setInterval!==a},{setInterval:a})},83972:(t,e,r)=>{var n=r(98646),i=r(80800),a=r(97739)(i.setTimeout,!0);n({global:!0,bind:!0,forced:i.setTimeout!==a},{setTimeout:a})},37124:(t,e,r)=>{var n,i=r(20781),a=r(98646),o=r(80800),s=r(14817),l=r(47497),u=r(38898),c=r(49386),d=r(76599),h=r(60898),f=r(98522),p=r(91043),g=r(29611),v=r(72842),m=r(45511),y=r(2796),b=r(48613),E=r(23500),x=r(19382),S=r(19720),T=r(67539),w=r(17328),_=r(29760),A=r(49146),k=r(67610),C=r(87903),D=r(59826),L=r(26803),R=r(29040),I=o.Object,O=o.Array,M=o.Date,P=o.Error,F=o.EvalError,N=o.RangeError,B=o.ReferenceError,U=o.SyntaxError,j=o.TypeError,H=o.URIError,G=o.PerformanceMark,z=o.WebAssembly,V=z&&z.CompileError||P,W=z&&z.LinkError||P,K=z&&z.RuntimeError||P,Y=s("DOMException"),q=_.Map,X=_.has,$=_.get,Q=_.set,J=A.Set,Z=A.add,tt=s("Object","keys"),et=l([].push),rt=l((!0).valueOf),nt=l(1..valueOf),it=l("".valueOf),at=l(M.prototype.getTime),ot=c("structuredClone"),st="DataCloneError",lt="Transferring",ut=function(t){return!u((function(){var e=new o.Set([7]),r=t(e),n=t(I(7));return r==e||!r.has(7)||"object"!=typeof n||7!=n}))&&t},ct=function(t,e){return!u((function(){var r=new e,n=t({a:r,b:r});return!(n&&n.a===n.b&&n.a instanceof e&&n.a.stack===r.stack)}))},dt=o.structuredClone,ht=i||!ct(dt,P)||!ct(dt,Y)||(n=dt,!!u((function(){var t=n(new o.AggregateError([1],ot,{cause:3}));return"AggregateError"!=t.name||1!=t.errors[0]||t.message!=ot||3!=t.cause}))),ft=!dt&&ut((function(t){return new G(ot,{detail:t}).detail})),pt=ut(dt)||ft,gt=function(t){throw new Y("Uncloneable type: "+t,st)},vt=function(t,e){throw new Y((e||"Cloning")+" of "+t+" cannot be properly polyfilled in this engine",st)},mt=function(t,e){if(g(t)&&gt("Symbol"),!p(t))return t;if(e){if(X(e,t))return $(e,t)}else e=new q;var r,n,i,a,l,u,c,h,f,v,m=y(t),T=!1;switch(m){case"Array":i=O(S(t)),T=!0;break;case"Object":i={},T=!0;break;case"Map":i=new q,T=!0;break;case"Set":i=new J,T=!0;break;case"RegExp":i=new RegExp(t.source,w(t));break;case"Error":switch(n=t.name){case"AggregateError":i=s("AggregateError")([]);break;case"EvalError":i=F();break;case"RangeError":i=N();break;case"ReferenceError":i=B();break;case"SyntaxError":i=U();break;case"TypeError":i=j();break;case"URIError":i=H();break;case"CompileError":i=V();break;case"LinkError":i=W();break;case"RuntimeError":i=K();break;default:i=P()}T=!0;break;case"DOMException":i=new Y(t.message,t.name),T=!0;break;case"DataView":case"Int8Array":case"Uint8Array":case"Uint8ClampedArray":case"Int16Array":case"Uint16Array":case"Int32Array":case"Uint32Array":case"Float32Array":case"Float64Array":case"BigInt64Array":case"BigUint64Array":r=o[m],p(r)||vt(m),i=new r(mt(t.buffer,e),t.byteOffset,"DataView"===m?t.byteLength:t.length);break;case"DOMQuad":try{i=new DOMQuad(mt(t.p1,e),mt(t.p2,e),mt(t.p3,e),mt(t.p4,e))}catch(e){pt?i=pt(t):vt(m)}break;case"FileList":if(a=function(){var t;try{t=new o.DataTransfer}catch(e){try{t=new o.ClipboardEvent("").clipboardData}catch(t){}}return t&&t.items&&t.files?t:null}()){for(l=0,u=S(t);l<u;l++)a.items.add(mt(t[l],e));i=a.files}else pt?i=pt(t):vt(m);break;case"ImageData":try{i=new ImageData(mt(t.data,e),t.width,t.height,{colorSpace:t.colorSpace})}catch(e){pt?i=pt(t):vt(m)}break;default:if(pt)i=pt(t);else switch(m){case"BigInt":i=I(t.valueOf());break;case"Boolean":i=I(rt(t));break;case"Number":i=I(nt(t));break;case"String":i=I(it(t));break;case"Date":i=new M(at(t));break;case"ArrayBuffer":(r=o.DataView)||"function"==typeof t.slice||vt(m);try{if("function"==typeof t.slice)i=t.slice(0);else for(u=t.byteLength,i=new ArrayBuffer(u),f=new r(t),v=new r(i),l=0;l<u;l++)v.setUint8(l,f.getUint8(l))}catch(t){throw new Y("ArrayBuffer is detached",st)}break;case"SharedArrayBuffer":i=t;break;case"Blob":try{i=t.slice(0,t.size,t.type)}catch(t){vt(m)}break;case"DOMPoint":case"DOMPointReadOnly":r=o[m];try{i=r.fromPoint?r.fromPoint(t):new r(t.x,t.y,t.z,t.w)}catch(t){vt(m)}break;case"DOMRect":case"DOMRectReadOnly":r=o[m];try{i=r.fromRect?r.fromRect(t):new r(t.x,t.y,t.width,t.height)}catch(t){vt(m)}break;case"DOMMatrix":case"DOMMatrixReadOnly":r=o[m];try{i=r.fromMatrix?r.fromMatrix(t):new r(t)}catch(t){vt(m)}break;case"AudioData":case"VideoFrame":d(t.clone)||vt(m);try{i=t.clone()}catch(t){gt(m)}break;case"File":try{i=new File([t],t.name,t)}catch(t){vt(m)}break;case"CropTarget":case"CryptoKey":case"FileSystemDirectoryHandle":case"FileSystemFileHandle":case"FileSystemHandle":case"GPUCompilationInfo":case"GPUCompilationMessage":case"ImageBitmap":case"RTCCertificate":case"WebAssembly.Module":vt(m);default:gt(m)}}if(Q(e,t,i),T)switch(m){case"Array":case"Object":for(c=tt(t),l=0,u=S(c);l<u;l++)h=c[l],E(i,h,mt(t[h],e));break;case"Map":t.forEach((function(t,r){Q(i,mt(r,e),mt(t,e))}));break;case"Set":t.forEach((function(t){Z(i,mt(t,e))}));break;case"Error":x(i,"message",mt(t.message,e)),b(t,"cause")&&x(i,"cause",mt(t.cause,e)),"AggregateError"==n&&(i.errors=mt(t.errors,e));case"DOMException":k&&x(i,"stack",mt(t.stack,e))}return i},yt=dt&&!u((function(){if(L&&C>92||R&&C>94||D&&C>97)return!1;var t=new ArrayBuffer(8),e=dt(t,{transfer:[t]});return 0!=t.byteLength||8!=e.byteLength})),bt=function(t,e){if(!p(t))throw j("Transfer option cannot be converted to a sequence");var r=[];v(t,(function(t){et(r,m(t))}));var n,i,a,s,l,u,c=0,f=S(r);if(yt)for(s=dt(r,{transfer:r});c<f;)Q(e,r[c],s[c++]);else for(;c<f;){if(n=r[c++],X(e,n))throw new Y("Duplicate transferable",st);switch(i=y(n)){case"ImageBitmap":a=o.OffscreenCanvas,h(a)||vt(i,lt);try{(u=new a(n.width,n.height)).getContext("bitmaprenderer").transferFromImageBitmap(n),l=u.transferToImageBitmap()}catch(t){}break;case"AudioData":case"VideoFrame":d(n.clone)&&d(n.close)||vt(i,lt);try{l=n.clone(),n.close()}catch(t){}break;case"ArrayBuffer":case"MediaSourceHandle":case"MessagePort":case"OffscreenCanvas":case"ReadableStream":case"TransformStream":case"WritableStream":vt(i,lt)}if(void 0===l)throw new Y("This object cannot be transferred: "+i,st);Q(e,n,l)}};a({global:!0,enumerable:!0,sham:!yt,forced:ht},{structuredClone:function(t){var e,r=T(arguments.length,1)>1&&!f(arguments[1])?m(arguments[1]):void 0,n=r?r.transfer:void 0;return void 0!==n&&(e=new q,bt(n,e)),mt(t,e)}})},41144:(t,e,r)=>{r(63547),r(83972)},69213:(t,e,r)=>{"use strict";r(2357);var n=r(98646),i=r(80800),a=r(98004),o=r(47497),s=r(60909),l=r(1380),u=r(78993),c=r(10325),d=r(24198),h=r(48298),f=r(44495),p=r(96345),g=r(76599),v=r(48613),m=r(66365),y=r(2796),b=r(45511),E=r(91043),x=r(82518),S=r(79692),T=r(95398),w=r(38816),_=r(33706),A=r(67539),k=r(90026),C=r(34027),D=k("iterator"),L="URLSearchParams",R=L+"Iterator",I=f.set,O=f.getterFor(L),M=f.getterFor(R),P=Object.getOwnPropertyDescriptor,F=function(t){if(!s)return i[t];var e=P(i,t);return e&&e.value},N=F("fetch"),B=F("Request"),U=F("Headers"),j=B&&B.prototype,H=U&&U.prototype,G=i.RegExp,z=i.TypeError,V=i.decodeURIComponent,W=i.encodeURIComponent,K=o("".charAt),Y=o([].join),q=o([].push),X=o("".replace),$=o([].shift),Q=o([].splice),J=o("".split),Z=o("".slice),tt=/\+/g,et=Array(4),rt=function(t){return et[t-1]||(et[t-1]=G("((?:%[\\da-f]{2}){"+t+"})","gi"))},nt=function(t){try{return V(t)}catch(e){return t}},it=function(t){var e=X(t,tt," "),r=4;try{return V(e)}catch(t){for(;r;)e=X(e,rt(r--),nt);return e}},at=/[!'()~]|%20/g,ot={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+"},st=function(t){return ot[t]},lt=function(t){return X(W(t),at,st)},ut=h((function(t,e){I(this,{type:R,iterator:w(O(t).entries),kind:e})}),"Iterator",(function(){var t=M(this),e=t.kind,r=t.iterator.next(),n=r.value;return r.done||(r.value="keys"===e?n.key:"values"===e?n.value:[n.key,n.value]),r}),!0),ct=function(t){this.entries=[],this.url=null,void 0!==t&&(E(t)?this.parseObject(t):this.parseQuery("string"==typeof t?"?"===K(t,0)?Z(t,1):t:x(t)))};ct.prototype={type:L,bindURL:function(t){this.url=t,this.update()},parseObject:function(t){var e,r,n,i,o,s,l,u=_(t);if(u)for(r=(e=w(t,u)).next;!(n=a(r,e)).done;){if(o=(i=w(b(n.value))).next,(s=a(o,i)).done||(l=a(o,i)).done||!a(o,i).done)throw z("Expected sequence with length 2");q(this.entries,{key:x(s.value),value:x(l.value)})}else for(var c in t)v(t,c)&&q(this.entries,{key:c,value:x(t[c])})},parseQuery:function(t){if(t)for(var e,r,n=J(t,"&"),i=0;i<n.length;)(e=n[i++]).length&&(r=J(e,"="),q(this.entries,{key:it($(r)),value:it(Y(r,"="))}))},serialize:function(){for(var t,e=this.entries,r=[],n=0;n<e.length;)t=e[n++],q(r,lt(t.key)+"="+lt(t.value));return Y(r,"&")},update:function(){this.entries.length=0,this.parseQuery(this.url.query)},updateURL:function(){this.url&&this.url.update()}};var dt=function(){p(this,ht);var t=arguments.length>0?arguments[0]:void 0;I(this,new ct(t))},ht=dt.prototype;if(c(ht,{append:function(t,e){A(arguments.length,2);var r=O(this);q(r.entries,{key:x(t),value:x(e)}),r.updateURL()},delete:function(t){A(arguments.length,1);for(var e=O(this),r=e.entries,n=x(t),i=0;i<r.length;)r[i].key===n?Q(r,i,1):i++;e.updateURL()},get:function(t){A(arguments.length,1);for(var e=O(this).entries,r=x(t),n=0;n<e.length;n++)if(e[n].key===r)return e[n].value;return null},getAll:function(t){A(arguments.length,1);for(var e=O(this).entries,r=x(t),n=[],i=0;i<e.length;i++)e[i].key===r&&q(n,e[i].value);return n},has:function(t){A(arguments.length,1);for(var e=O(this).entries,r=x(t),n=0;n<e.length;)if(e[n++].key===r)return!0;return!1},set:function(t,e){A(arguments.length,1);for(var r,n=O(this),i=n.entries,a=!1,o=x(t),s=x(e),l=0;l<i.length;l++)(r=i[l]).key===o&&(a?Q(i,l--,1):(a=!0,r.value=s));a||q(i,{key:o,value:s}),n.updateURL()},sort:function(){var t=O(this);C(t.entries,(function(t,e){return t.key>e.key?1:-1})),t.updateURL()},forEach:function(t){for(var e,r=O(this).entries,n=m(t,arguments.length>1?arguments[1]:void 0),i=0;i<r.length;)n((e=r[i++]).value,e.key,this)},keys:function(){return new ut(this,"keys")},values:function(){return new ut(this,"values")},entries:function(){return new ut(this,"entries")}},{enumerable:!0}),u(ht,D,ht.entries,{name:"entries"}),u(ht,"toString",(function(){return O(this).serialize()}),{enumerable:!0}),d(dt,L),n({global:!0,constructor:!0,forced:!l},{URLSearchParams:dt}),!l&&g(U)){var ft=o(H.has),pt=o(H.set),gt=function(t){if(E(t)){var e,r=t.body;if(y(r)===L)return e=t.headers?new U(t.headers):new U,ft(e,"content-type")||pt(e,"content-type","application/x-www-form-urlencoded;charset=UTF-8"),S(t,{body:T(0,x(r)),headers:T(0,e)})}return t};if(g(N)&&n({global:!0,enumerable:!0,dontCallGetSet:!0,forced:!0},{fetch:function(t){return N(t,arguments.length>1?gt(arguments[1]):{})}}),g(B)){var vt=function(t){return p(this,j),new B(t,arguments.length>1?gt(arguments[1]):{})};j.constructor=vt,vt.prototype=j,n({global:!0,constructor:!0,dontCallGetSet:!0,forced:!0},{Request:vt})}}t.exports={URLSearchParams:dt,getState:O}},88328:(t,e,r)=>{r(69213)},95728:(t,e,r)=>{"use strict";r(71794);var n,i=r(98646),a=r(60909),o=r(1380),s=r(80800),l=r(66365),u=r(47497),c=r(78993),d=r(10159),h=r(96345),f=r(48613),p=r(7738),g=r(72353),v=r(28022),m=r(68214).codeAt,y=r(30629),b=r(82518),E=r(24198),x=r(67539),S=r(69213),T=r(44495),w=T.set,_=T.getterFor("URL"),A=S.URLSearchParams,k=S.getState,C=s.URL,D=s.TypeError,L=s.parseInt,R=Math.floor,I=Math.pow,O=u("".charAt),M=u(/./.exec),P=u([].join),F=u(1..toString),N=u([].pop),B=u([].push),U=u("".replace),j=u([].shift),H=u("".split),G=u("".slice),z=u("".toLowerCase),V=u([].unshift),W="Invalid scheme",K="Invalid host",Y="Invalid port",q=/[a-z]/i,X=/[\d+-.a-z]/i,$=/\d/,Q=/^0x/i,J=/^[0-7]+$/,Z=/^\d+$/,tt=/^[\da-f]+$/i,et=/[\0\t\n\r #%/:<>?@[\\\]^|]/,rt=/[\0\t\n\r #/:<>?@[\\\]^|]/,nt=/^[\u0000-\u0020]+|[\u0000-\u0020]+$/g,it=/[\t\n\r]/g,at=function(t){var e,r,n,i;if("number"==typeof t){for(e=[],r=0;r<4;r++)V(e,t%256),t=R(t/256);return P(e,".")}if("object"==typeof t){for(e="",n=function(t){for(var e=null,r=1,n=null,i=0,a=0;a<8;a++)0!==t[a]?(i>r&&(e=n,r=i),n=null,i=0):(null===n&&(n=a),++i);return i>r&&(e=n,r=i),e}(t),r=0;r<8;r++)i&&0===t[r]||(i&&(i=!1),n===r?(e+=r?":":"::",i=!0):(e+=F(t[r],16),r<7&&(e+=":")));return"["+e+"]"}return t},ot={},st=p({},ot,{" ":1,'"':1,"<":1,">":1,"`":1}),lt=p({},st,{"#":1,"?":1,"{":1,"}":1}),ut=p({},lt,{"/":1,":":1,";":1,"=":1,"@":1,"[":1,"\\":1,"]":1,"^":1,"|":1}),ct=function(t,e){var r=m(t,0);return r>32&&r<127&&!f(e,t)?t:encodeURIComponent(t)},dt={ftp:21,file:null,http:80,https:443,ws:80,wss:443},ht=function(t,e){var r;return 2==t.length&&M(q,O(t,0))&&(":"==(r=O(t,1))||!e&&"|"==r)},ft=function(t){var e;return t.length>1&&ht(G(t,0,2))&&(2==t.length||"/"===(e=O(t,2))||"\\"===e||"?"===e||"#"===e)},pt=function(t){return"."===t||"%2e"===z(t)},gt={},vt={},mt={},yt={},bt={},Et={},xt={},St={},Tt={},wt={},_t={},At={},kt={},Ct={},Dt={},Lt={},Rt={},It={},Ot={},Mt={},Pt={},Ft=function(t,e,r){var n,i,a,o=b(t);if(e){if(i=this.parse(o))throw D(i);this.searchParams=null}else{if(void 0!==r&&(n=new Ft(r,!0)),i=this.parse(o,null,n))throw D(i);(a=k(new A)).bindURL(this),this.searchParams=a}};Ft.prototype={type:"URL",parse:function(t,e,r){var i,a,o,s,l,u=this,c=e||gt,d=0,h="",p=!1,m=!1,y=!1;for(t=b(t),e||(u.scheme="",u.username="",u.password="",u.host=null,u.port=null,u.path=[],u.query=null,u.fragment=null,u.cannotBeABaseURL=!1,t=U(t,nt,"")),t=U(t,it,""),i=g(t);d<=i.length;){switch(a=i[d],c){case gt:if(!a||!M(q,a)){if(e)return W;c=mt;continue}h+=z(a),c=vt;break;case vt:if(a&&(M(X,a)||"+"==a||"-"==a||"."==a))h+=z(a);else{if(":"!=a){if(e)return W;h="",c=mt,d=0;continue}if(e&&(u.isSpecial()!=f(dt,h)||"file"==h&&(u.includesCredentials()||null!==u.port)||"file"==u.scheme&&!u.host))return;if(u.scheme=h,e)return void(u.isSpecial()&&dt[u.scheme]==u.port&&(u.port=null));h="","file"==u.scheme?c=Ct:u.isSpecial()&&r&&r.scheme==u.scheme?c=yt:u.isSpecial()?c=St:"/"==i[d+1]?(c=bt,d++):(u.cannotBeABaseURL=!0,B(u.path,""),c=Ot)}break;case mt:if(!r||r.cannotBeABaseURL&&"#"!=a)return W;if(r.cannotBeABaseURL&&"#"==a){u.scheme=r.scheme,u.path=v(r.path),u.query=r.query,u.fragment="",u.cannotBeABaseURL=!0,c=Pt;break}c="file"==r.scheme?Ct:Et;continue;case yt:if("/"!=a||"/"!=i[d+1]){c=Et;continue}c=Tt,d++;break;case bt:if("/"==a){c=wt;break}c=It;continue;case Et:if(u.scheme=r.scheme,a==n)u.username=r.username,u.password=r.password,u.host=r.host,u.port=r.port,u.path=v(r.path),u.query=r.query;else if("/"==a||"\\"==a&&u.isSpecial())c=xt;else if("?"==a)u.username=r.username,u.password=r.password,u.host=r.host,u.port=r.port,u.path=v(r.path),u.query="",c=Mt;else{if("#"!=a){u.username=r.username,u.password=r.password,u.host=r.host,u.port=r.port,u.path=v(r.path),u.path.length--,c=It;continue}u.username=r.username,u.password=r.password,u.host=r.host,u.port=r.port,u.path=v(r.path),u.query=r.query,u.fragment="",c=Pt}break;case xt:if(!u.isSpecial()||"/"!=a&&"\\"!=a){if("/"!=a){u.username=r.username,u.password=r.password,u.host=r.host,u.port=r.port,c=It;continue}c=wt}else c=Tt;break;case St:if(c=Tt,"/"!=a||"/"!=O(h,d+1))continue;d++;break;case Tt:if("/"!=a&&"\\"!=a){c=wt;continue}break;case wt:if("@"==a){p&&(h="%40"+h),p=!0,o=g(h);for(var E=0;E<o.length;E++){var x=o[E];if(":"!=x||y){var S=ct(x,ut);y?u.password+=S:u.username+=S}else y=!0}h=""}else if(a==n||"/"==a||"?"==a||"#"==a||"\\"==a&&u.isSpecial()){if(p&&""==h)return"Invalid authority";d-=g(h).length+1,h="",c=_t}else h+=a;break;case _t:case At:if(e&&"file"==u.scheme){c=Lt;continue}if(":"!=a||m){if(a==n||"/"==a||"?"==a||"#"==a||"\\"==a&&u.isSpecial()){if(u.isSpecial()&&""==h)return K;if(e&&""==h&&(u.includesCredentials()||null!==u.port))return;if(s=u.parseHost(h))return s;if(h="",c=Rt,e)return;continue}"["==a?m=!0:"]"==a&&(m=!1),h+=a}else{if(""==h)return K;if(s=u.parseHost(h))return s;if(h="",c=kt,e==At)return}break;case kt:if(!M($,a)){if(a==n||"/"==a||"?"==a||"#"==a||"\\"==a&&u.isSpecial()||e){if(""!=h){var T=L(h,10);if(T>65535)return Y;u.port=u.isSpecial()&&T===dt[u.scheme]?null:T,h=""}if(e)return;c=Rt;continue}return Y}h+=a;break;case Ct:if(u.scheme="file","/"==a||"\\"==a)c=Dt;else{if(!r||"file"!=r.scheme){c=It;continue}if(a==n)u.host=r.host,u.path=v(r.path),u.query=r.query;else if("?"==a)u.host=r.host,u.path=v(r.path),u.query="",c=Mt;else{if("#"!=a){ft(P(v(i,d),""))||(u.host=r.host,u.path=v(r.path),u.shortenPath()),c=It;continue}u.host=r.host,u.path=v(r.path),u.query=r.query,u.fragment="",c=Pt}}break;case Dt:if("/"==a||"\\"==a){c=Lt;break}r&&"file"==r.scheme&&!ft(P(v(i,d),""))&&(ht(r.path[0],!0)?B(u.path,r.path[0]):u.host=r.host),c=It;continue;case Lt:if(a==n||"/"==a||"\\"==a||"?"==a||"#"==a){if(!e&&ht(h))c=It;else if(""==h){if(u.host="",e)return;c=Rt}else{if(s=u.parseHost(h))return s;if("localhost"==u.host&&(u.host=""),e)return;h="",c=Rt}continue}h+=a;break;case Rt:if(u.isSpecial()){if(c=It,"/"!=a&&"\\"!=a)continue}else if(e||"?"!=a)if(e||"#"!=a){if(a!=n&&(c=It,"/"!=a))continue}else u.fragment="",c=Pt;else u.query="",c=Mt;break;case It:if(a==n||"/"==a||"\\"==a&&u.isSpecial()||!e&&("?"==a||"#"==a)){if(".."===(l=z(l=h))||"%2e."===l||".%2e"===l||"%2e%2e"===l?(u.shortenPath(),"/"==a||"\\"==a&&u.isSpecial()||B(u.path,"")):pt(h)?"/"==a||"\\"==a&&u.isSpecial()||B(u.path,""):("file"==u.scheme&&!u.path.length&&ht(h)&&(u.host&&(u.host=""),h=O(h,0)+":"),B(u.path,h)),h="","file"==u.scheme&&(a==n||"?"==a||"#"==a))for(;u.path.length>1&&""===u.path[0];)j(u.path);"?"==a?(u.query="",c=Mt):"#"==a&&(u.fragment="",c=Pt)}else h+=ct(a,lt);break;case Ot:"?"==a?(u.query="",c=Mt):"#"==a?(u.fragment="",c=Pt):a!=n&&(u.path[0]+=ct(a,ot));break;case Mt:e||"#"!=a?a!=n&&("'"==a&&u.isSpecial()?u.query+="%27":u.query+="#"==a?"%23":ct(a,ot)):(u.fragment="",c=Pt);break;case Pt:a!=n&&(u.fragment+=ct(a,st))}d++}},parseHost:function(t){var e,r,n;if("["==O(t,0)){if("]"!=O(t,t.length-1))return K;if(e=function(t){var e,r,n,i,a,o,s,l=[0,0,0,0,0,0,0,0],u=0,c=null,d=0,h=function(){return O(t,d)};if(":"==h()){if(":"!=O(t,1))return;d+=2,c=++u}for(;h();){if(8==u)return;if(":"!=h()){for(e=r=0;r<4&&M(tt,h());)e=16*e+L(h(),16),d++,r++;if("."==h()){if(0==r)return;if(d-=r,u>6)return;for(n=0;h();){if(i=null,n>0){if(!("."==h()&&n<4))return;d++}if(!M($,h()))return;for(;M($,h());){if(a=L(h(),10),null===i)i=a;else{if(0==i)return;i=10*i+a}if(i>255)return;d++}l[u]=256*l[u]+i,2!=++n&&4!=n||u++}if(4!=n)return;break}if(":"==h()){if(d++,!h())return}else if(h())return;l[u++]=e}else{if(null!==c)return;d++,c=++u}}if(null!==c)for(o=u-c,u=7;0!=u&&o>0;)s=l[u],l[u--]=l[c+o-1],l[c+--o]=s;else if(8!=u)return;return l}(G(t,1,-1)),!e)return K;this.host=e}else if(this.isSpecial()){if(t=y(t),M(et,t))return K;if(e=function(t){var e,r,n,i,a,o,s,l=H(t,".");if(l.length&&""==l[l.length-1]&&l.length--,(e=l.length)>4)return t;for(r=[],n=0;n<e;n++){if(""==(i=l[n]))return t;if(a=10,i.length>1&&"0"==O(i,0)&&(a=M(Q,i)?16:8,i=G(i,8==a?1:2)),""===i)o=0;else{if(!M(10==a?Z:8==a?J:tt,i))return t;o=L(i,a)}B(r,o)}for(n=0;n<e;n++)if(o=r[n],n==e-1){if(o>=I(256,5-e))return null}else if(o>255)return null;for(s=N(r),n=0;n<r.length;n++)s+=r[n]*I(256,3-n);return s}(t),null===e)return K;this.host=e}else{if(M(rt,t))return K;for(e="",r=g(t),n=0;n<r.length;n++)e+=ct(r[n],ot);this.host=e}},cannotHaveUsernamePasswordPort:function(){return!this.host||this.cannotBeABaseURL||"file"==this.scheme},includesCredentials:function(){return""!=this.username||""!=this.password},isSpecial:function(){return f(dt,this.scheme)},shortenPath:function(){var t=this.path,e=t.length;!e||"file"==this.scheme&&1==e&&ht(t[0],!0)||t.length--},serialize:function(){var t=this,e=t.scheme,r=t.username,n=t.password,i=t.host,a=t.port,o=t.path,s=t.query,l=t.fragment,u=e+":";return null!==i?(u+="//",t.includesCredentials()&&(u+=r+(n?":"+n:"")+"@"),u+=at(i),null!==a&&(u+=":"+a)):"file"==e&&(u+="//"),u+=t.cannotBeABaseURL?o[0]:o.length?"/"+P(o,"/"):"",null!==s&&(u+="?"+s),null!==l&&(u+="#"+l),u},setHref:function(t){var e=this.parse(t);if(e)throw D(e);this.searchParams.update()},getOrigin:function(){var t=this.scheme,e=this.port;if("blob"==t)try{return new Nt(t.path[0]).origin}catch(t){return"null"}return"file"!=t&&this.isSpecial()?t+"://"+at(this.host)+(null!==e?":"+e:""):"null"},getProtocol:function(){return this.scheme+":"},setProtocol:function(t){this.parse(b(t)+":",gt)},getUsername:function(){return this.username},setUsername:function(t){var e=g(b(t));if(!this.cannotHaveUsernamePasswordPort()){this.username="";for(var r=0;r<e.length;r++)this.username+=ct(e[r],ut)}},getPassword:function(){return this.password},setPassword:function(t){var e=g(b(t));if(!this.cannotHaveUsernamePasswordPort()){this.password="";for(var r=0;r<e.length;r++)this.password+=ct(e[r],ut)}},getHost:function(){var t=this.host,e=this.port;return null===t?"":null===e?at(t):at(t)+":"+e},setHost:function(t){this.cannotBeABaseURL||this.parse(t,_t)},getHostname:function(){var t=this.host;return null===t?"":at(t)},setHostname:function(t){this.cannotBeABaseURL||this.parse(t,At)},getPort:function(){var t=this.port;return null===t?"":b(t)},setPort:function(t){this.cannotHaveUsernamePasswordPort()||(""==(t=b(t))?this.port=null:this.parse(t,kt))},getPathname:function(){var t=this.path;return this.cannotBeABaseURL?t[0]:t.length?"/"+P(t,"/"):""},setPathname:function(t){this.cannotBeABaseURL||(this.path=[],this.parse(t,Rt))},getSearch:function(){var t=this.query;return t?"?"+t:""},setSearch:function(t){""==(t=b(t))?this.query=null:("?"==O(t,0)&&(t=G(t,1)),this.query="",this.parse(t,Mt)),this.searchParams.update()},getSearchParams:function(){return this.searchParams.facade},getHash:function(){var t=this.fragment;return t?"#"+t:""},setHash:function(t){""!=(t=b(t))?("#"==O(t,0)&&(t=G(t,1)),this.fragment="",this.parse(t,Pt)):this.fragment=null},update:function(){this.query=this.searchParams.serialize()||null}};var Nt=function(t){var e=h(this,Bt),r=x(arguments.length,1)>1?arguments[1]:void 0,n=w(e,new Ft(t,!1,r));a||(e.href=n.serialize(),e.origin=n.getOrigin(),e.protocol=n.getProtocol(),e.username=n.getUsername(),e.password=n.getPassword(),e.host=n.getHost(),e.hostname=n.getHostname(),e.port=n.getPort(),e.pathname=n.getPathname(),e.search=n.getSearch(),e.searchParams=n.getSearchParams(),e.hash=n.getHash())},Bt=Nt.prototype,Ut=function(t,e){return{get:function(){return _(this)[t]()},set:e&&function(t){return _(this)[e](t)},configurable:!0,enumerable:!0}};if(a&&(d(Bt,"href",Ut("serialize","setHref")),d(Bt,"origin",Ut("getOrigin")),d(Bt,"protocol",Ut("getProtocol","setProtocol")),d(Bt,"username",Ut("getUsername","setUsername")),d(Bt,"password",Ut("getPassword","setPassword")),d(Bt,"host",Ut("getHost","setHost")),d(Bt,"hostname",Ut("getHostname","setHostname")),d(Bt,"port",Ut("getPort","setPort")),d(Bt,"pathname",Ut("getPathname","setPathname")),d(Bt,"search",Ut("getSearch","setSearch")),d(Bt,"searchParams",Ut("getSearchParams")),d(Bt,"hash",Ut("getHash","setHash"))),c(Bt,"toJSON",(function(){return _(this).serialize()}),{enumerable:!0}),c(Bt,"toString",(function(){return _(this).serialize()}),{enumerable:!0}),C){var jt=C.createObjectURL,Ht=C.revokeObjectURL;jt&&c(Nt,"createObjectURL",l(jt,C)),Ht&&c(Nt,"revokeObjectURL",l(Ht,C))}E(Nt,"URL"),i({global:!0,constructor:!0,forced:!o,sham:!a},{URL:Nt})},49227:(t,e,r)=>{r(95728)},75676:(t,e,r)=>{"use strict";var n=r(98646),i=r(98004);n({target:"URL",proto:!0,enumerable:!0},{toJSON:function(){return i(URL.prototype.toString,this)}})},72583:(t,e,r)=>{r(39496),r(94199),r(79384),r(99357),r(65323),r(78459),r(78154),r(28349),r(38856),r(65749),r(9707),r(32137),r(94682),r(44225),r(47527),r(92156),r(99189),r(20387),r(72989),r(66991),r(10837),r(22464),r(93485),r(63137),r(40879),r(58810),r(72116),r(32860),r(98531),r(79841),r(14605),r(86767),r(50192),r(79943),r(84992),r(67622),r(2357),r(28117),r(34784),r(69550),r(8654),r(72922),r(48),r(30320),r(86619),r(13474),r(66287),r(90565),r(90573),r(87125),r(17802),r(22510),r(29388),r(61045),r(95276),r(92412),r(54195),r(64592),r(39381),r(20283),r(73556),r(66773),r(88616),r(71525),r(52171),r(80003),r(63008),r(82617),r(26232),r(35196),r(82833),r(52768),r(22247),r(97754),r(74382),r(20850),r(25066),r(7499),r(85435),r(11306),r(16163),r(52365),r(28345),r(6617),r(2183),r(70183),r(91235),r(65153),r(8882),r(71646),r(96983),r(28402),r(99037),r(85277),r(46146),r(77272),r(93047),r(38361),r(90362),r(36768),r(81674),r(82002),r(37591),r(53713),r(47189),r(21508),r(94914),r(33306),r(93319),r(85365),r(70223),r(52777),r(42194),r(90461),r(12418),r(40440),r(57017),r(35048),r(68270),r(65578),r(1466),r(87647),r(5622),r(53258),r(24938),r(87302),r(98924),r(55992),r(40890),r(51151),r(68570),r(40247),r(52833),r(9317),r(50521),r(35413),r(39134),r(49898),r(78222),r(47433),r(15602),r(71502),r(91761),r(14767),r(96895),r(36103),r(82012),r(2300),r(18139),r(1754),r(15107),r(61821),r(77933),r(39707),r(97111),r(42001),r(81939),r(18977),r(955),r(66325),r(9275),r(65081),r(37140),r(2439),r(71794),r(35087),r(69596),r(51326),r(34476),r(567),r(62754),r(67071),r(82303),r(70637),r(99102),r(66168),r(6369),r(92886),r(81428),r(40588),r(13196),r(36316),r(94815),r(67228),r(64083),r(53856),r(84144),r(48873),r(55882),r(38843),r(67828),r(48130),r(41444),r(47247),r(6173),r(63815),r(57268),r(47422),r(20764),r(42759),r(86657),r(22459),r(43839),r(7782),r(28009),r(56757),r(52110),r(75721),r(42220),r(54363),r(14740),r(83543),r(18037),r(33030),r(32127),r(13125),r(29096),r(91662),r(72576),r(97534),r(77435),r(20402),r(14656),r(89344),r(44852),r(1217),r(2555),r(3903),r(96294),r(25903),r(6269),r(31962),r(65854),r(79642),r(13568),r(74243),r(41582),r(43619),r(58319),r(71228),r(85287),r(83898),r(70454),r(37124),r(41144),r(49227),r(75676),r(88328),r(44871)},42872:(t,e,r)=>{"use strict";r.d(e,{B8:()=>s,D:()=>h,H:()=>d,Hu:()=>m,IK:()=>E,KX:()=>c,M:()=>p,MS:()=>l,Q:()=>g,S:()=>u,W:()=>f,WN:()=>i,Y:()=>v,nD:()=>o,qn:()=>x,r0:()=>y,uT:()=>n,wj:()=>b,zI:()=>a});var n=1e3,i=60*n,a=3600*n,o=86400*n,s=604800*n,l="millisecond",u="second",c="minute",d="hour",h="day",f="week",p="month",g="quarter",v="year",m="date",y="YYYY-MM-DDTHH:mm:ssZ",b="Invalid Date",E=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,x=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g},19231:(t,e,r)=>{"use strict";r.d(e,{Z:()=>g});var n=r(42872);const i={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(t){var e=["th","st","nd","rd"],r=t%100;return"["+t+(e[(r-20)%10]||e[r]||e[0])+"]"}};var a=function(t,e,r){var n=String(t);return!n||n.length>=e?t:""+Array(e+1-n.length).join(r)+t};const o={s:a,z:function(t){var e=-t.utcOffset(),r=Math.abs(e),n=Math.floor(r/60),i=r%60;return(e<=0?"+":"-")+a(n,2,"0")+":"+a(i,2,"0")},m:function t(e,r){if(e.date()<r.date())return-t(r,e);var i=12*(r.year()-e.year())+(r.month()-e.month()),a=e.clone().add(i,n.M),o=r-a<0,s=e.clone().add(i+(o?-1:1),n.M);return+(-(i+(r-a)/(o?a-s:s-a))||0)},a:function(t){return t<0?Math.ceil(t)||0:Math.floor(t)},p:function(t){return{M:n.M,y:n.Y,w:n.W,d:n.D,D:n.Hu,h:n.H,m:n.KX,s:n.S,ms:n.MS,Q:n.Q}[t]||String(t||"").toLowerCase().replace(/s$/,"")},u:function(t){return void 0===t}};var s="en",l={};l[s]=i;var u=function(t){return t instanceof f},c=function t(e,r,n){var i;if(!e)return s;if("string"==typeof e){var a=e.toLowerCase();l[a]&&(i=a),r&&(l[a]=r,i=a);var o=e.split("-");if(!i&&o.length>1)return t(o[0])}else{var u=e.name;l[u]=e,i=u}return!n&&i&&(s=i),i||!n&&s},d=function(t,e){if(u(t))return t.clone();var r="object"==typeof e?e:{};return r.date=t,r.args=arguments,new f(r)},h=o;h.l=c,h.i=u,h.w=function(t,e){return d(t,{locale:e.$L,utc:e.$u,x:e.$x,$offset:e.$offset})};var f=function(){function t(t){this.$L=c(t.locale,null,!0),this.parse(t)}var e=t.prototype;return e.parse=function(t){this.$d=function(t){var e=t.date,r=t.utc;if(null===e)return new Date(NaN);if(h.u(e))return new Date;if(e instanceof Date)return new Date(e);if("string"==typeof e&&!/Z$/i.test(e)){var i=e.match(n.IK);if(i){var a=i[2]-1||0,o=(i[7]||"0").substring(0,3);return r?new Date(Date.UTC(i[1],a,i[3]||1,i[4]||0,i[5]||0,i[6]||0,o)):new Date(i[1],a,i[3]||1,i[4]||0,i[5]||0,i[6]||0,o)}}return new Date(e)}(t),this.$x=t.x||{},this.init()},e.init=function(){var t=this.$d;this.$y=t.getFullYear(),this.$M=t.getMonth(),this.$D=t.getDate(),this.$W=t.getDay(),this.$H=t.getHours(),this.$m=t.getMinutes(),this.$s=t.getSeconds(),this.$ms=t.getMilliseconds()},e.$utils=function(){return h},e.isValid=function(){return!(this.$d.toString()===n.wj)},e.isSame=function(t,e){var r=d(t);return this.startOf(e)<=r&&r<=this.endOf(e)},e.isAfter=function(t,e){return d(t)<this.startOf(e)},e.isBefore=function(t,e){return this.endOf(e)<d(t)},e.$g=function(t,e,r){return h.u(t)?this[e]:this.set(r,t)},e.unix=function(){return Math.floor(this.valueOf()/1e3)},e.valueOf=function(){return this.$d.getTime()},e.startOf=function(t,e){var r=this,i=!!h.u(e)||e,a=h.p(t),o=function(t,e){var a=h.w(r.$u?Date.UTC(r.$y,e,t):new Date(r.$y,e,t),r);return i?a:a.endOf(n.D)},s=function(t,e){return h.w(r.toDate()[t].apply(r.toDate("s"),(i?[0,0,0,0]:[23,59,59,999]).slice(e)),r)},l=this.$W,u=this.$M,c=this.$D,d="set"+(this.$u?"UTC":"");switch(a){case n.Y:return i?o(1,0):o(31,11);case n.M:return i?o(1,u):o(0,u+1);case n.W:var f=this.$locale().weekStart||0,p=(l<f?l+7:l)-f;return o(i?c-p:c+(6-p),u);case n.D:case n.Hu:return s(d+"Hours",0);case n.H:return s(d+"Minutes",1);case n.KX:return s(d+"Seconds",2);case n.S:return s(d+"Milliseconds",3);default:return this.clone()}},e.endOf=function(t){return this.startOf(t,!1)},e.$set=function(t,e){var r,i=h.p(t),a="set"+(this.$u?"UTC":""),o=(r={},r[n.D]=a+"Date",r[n.Hu]=a+"Date",r[n.M]=a+"Month",r[n.Y]=a+"FullYear",r[n.H]=a+"Hours",r[n.KX]=a+"Minutes",r[n.S]=a+"Seconds",r[n.MS]=a+"Milliseconds",r)[i],s=i===n.D?this.$D+(e-this.$W):e;if(i===n.M||i===n.Y){var l=this.clone().set(n.Hu,1);l.$d[o](s),l.init(),this.$d=l.set(n.Hu,Math.min(this.$D,l.daysInMonth())).$d}else o&&this.$d[o](s);return this.init(),this},e.set=function(t,e){return this.clone().$set(t,e)},e.get=function(t){return this[h.p(t)]()},e.add=function(t,e){var r,i=this;t=Number(t);var a=h.p(e),o=function(e){var r=d(i);return h.w(r.date(r.date()+Math.round(e*t)),i)};if(a===n.M)return this.set(n.M,this.$M+t);if(a===n.Y)return this.set(n.Y,this.$y+t);if(a===n.D)return o(1);if(a===n.W)return o(7);var s=(r={},r[n.KX]=n.WN,r[n.H]=n.zI,r[n.S]=n.uT,r)[a]||1,l=this.$d.getTime()+t*s;return h.w(l,this)},e.subtract=function(t,e){return this.add(-1*t,e)},e.format=function(t){var e=this,r=this.$locale();if(!this.isValid())return r.invalidDate||n.wj;var i=t||n.r0,a=h.z(this),o=this.$H,s=this.$m,l=this.$M,u=r.weekdays,c=r.months,d=function(t,r,n,a){return t&&(t[r]||t(e,i))||n[r].slice(0,a)},f=function(t){return h.s(o%12||12,t,"0")},p=r.meridiem||function(t,e,r){var n=t<12?"AM":"PM";return r?n.toLowerCase():n},g={YY:String(this.$y).slice(-2),YYYY:this.$y,M:l+1,MM:h.s(l+1,2,"0"),MMM:d(r.monthsShort,l,c,3),MMMM:d(c,l),D:this.$D,DD:h.s(this.$D,2,"0"),d:String(this.$W),dd:d(r.weekdaysMin,this.$W,u,2),ddd:d(r.weekdaysShort,this.$W,u,3),dddd:u[this.$W],H:String(o),HH:h.s(o,2,"0"),h:f(1),hh:f(2),a:p(o,s,!0),A:p(o,s,!1),m:String(s),mm:h.s(s,2,"0"),s:String(this.$s),ss:h.s(this.$s,2,"0"),SSS:h.s(this.$ms,3,"0"),Z:a};return i.replace(n.qn,(function(t,e){return e||g[t]||a.replace(":","")}))},e.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},e.diff=function(t,e,r){var i,a=h.p(e),o=d(t),s=(o.utcOffset()-this.utcOffset())*n.WN,l=this-o,u=h.m(this,o);return u=(i={},i[n.Y]=u/12,i[n.M]=u,i[n.Q]=u/3,i[n.W]=(l-s)/n.B8,i[n.D]=(l-s)/n.nD,i[n.H]=l/n.zI,i[n.KX]=l/n.WN,i[n.S]=l/n.uT,i)[a]||l,r?u:h.a(u)},e.daysInMonth=function(){return this.endOf(n.M).$D},e.$locale=function(){return l[this.$L]},e.locale=function(t,e){if(!t)return this.$L;var r=this.clone(),n=c(t,e,!0);return n&&(r.$L=n),r},e.clone=function(){return h.w(this.$d,this)},e.toDate=function(){return new Date(this.valueOf())},e.toJSON=function(){return this.isValid()?this.toISOString():null},e.toISOString=function(){return this.$d.toISOString()},e.toString=function(){return this.$d.toUTCString()},t}(),p=f.prototype;d.prototype=p,[["$ms",n.MS],["$s",n.S],["$m",n.KX],["$H",n.H],["$W",n.D],["$M",n.M],["$y",n.Y],["$D",n.Hu]].forEach((function(t){p[t[1]]=function(e){return this.$g(e,t[0],t[1])}})),d.extend=function(t,e){return t.$i||(t(e,f,d),t.$i=!0),d},d.locale=c,d.isDayjs=u,d.unix=function(t){return d(1e3*t)},d.en=l[s],d.Ls=l,d.p={};const g=d},15842:(t,e,r)=>{"use strict";var n,i=r(51266),a="object"==typeof Reflect?Reflect:null,o=a&&"function"==typeof a.apply?a.apply:function(t,e,r){return Function.prototype.apply.call(t,e,r)};n=a&&"function"==typeof a.ownKeys?a.ownKeys:Object.getOwnPropertySymbols?function(t){return Object.getOwnPropertyNames(t).concat(Object.getOwnPropertySymbols(t))}:function(t){return Object.getOwnPropertyNames(t)};var s=Number.isNaN||function(t){return t!=t};function l(){l.init.call(this)}t.exports=l,t.exports.once=function(t,e){return new Promise((function(r,n){function i(r){t.removeListener(e,a),n(r)}function a(){"function"==typeof t.removeListener&&t.removeListener("error",i),r([].slice.call(arguments))}y(t,e,a,{once:!0}),"error"!==e&&function(t,e,r){"function"==typeof t.on&&y(t,"error",e,{once:!0})}(t,i)}))},l.EventEmitter=l,l.prototype._events=void 0,l.prototype._eventsCount=0,l.prototype._maxListeners=void 0;var u=10;function c(t){if("function"!=typeof t)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof t)}function d(t){return void 0===t._maxListeners?l.defaultMaxListeners:t._maxListeners}function h(t,e,r,n){var a,o,s,l;if(c(r),void 0===(o=t._events)?(o=t._events=Object.create(null),t._eventsCount=0):(void 0!==o.newListener&&(t.emit("newListener",e,r.listener?r.listener:r),o=t._events),s=o[e]),void 0===s)s=o[e]=r,++t._eventsCount;else if("function"==typeof s?s=o[e]=n?[r,s]:[s,r]:n?s.unshift(r):s.push(r),(a=d(t))>0&&s.length>a&&!s.warned){s.warned=!0;var u=new Error("Possible EventEmitter memory leak detected. "+s.length+" "+String(e)+" listeners added. Use emitter.setMaxListeners() to increase limit");u.name="MaxListenersExceededWarning",u.emitter=t,u.type=e,u.count=s.length,l=u,i&&i.warn&&i.warn(l)}return t}function f(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,0===arguments.length?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function p(t,e,r){var n={fired:!1,wrapFn:void 0,target:t,type:e,listener:r},i=f.bind(n);return i.listener=r,n.wrapFn=i,i}function g(t,e,r){var n=t._events;if(void 0===n)return[];var i=n[e];return void 0===i?[]:"function"==typeof i?r?[i.listener||i]:[i]:r?function(t){for(var e=new Array(t.length),r=0;r<e.length;++r)e[r]=t[r].listener||t[r];return e}(i):m(i,i.length)}function v(t){var e=this._events;if(void 0!==e){var r=e[t];if("function"==typeof r)return 1;if(void 0!==r)return r.length}return 0}function m(t,e){for(var r=new Array(e),n=0;n<e;++n)r[n]=t[n];return r}function y(t,e,r,n){if("function"==typeof t.on)n.once?t.once(e,r):t.on(e,r);else{if("function"!=typeof t.addEventListener)throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof t);t.addEventListener(e,(function i(a){n.once&&t.removeEventListener(e,i),r(a)}))}}Object.defineProperty(l,"defaultMaxListeners",{enumerable:!0,get:function(){return u},set:function(t){if("number"!=typeof t||t<0||s(t))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+t+".");u=t}}),l.init=function(){void 0!==this._events&&this._events!==Object.getPrototypeOf(this)._events||(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},l.prototype.setMaxListeners=function(t){if("number"!=typeof t||t<0||s(t))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+t+".");return this._maxListeners=t,this},l.prototype.getMaxListeners=function(){return d(this)},l.prototype.emit=function(t){for(var e=[],r=1;r<arguments.length;r++)e.push(arguments[r]);var n="error"===t,i=this._events;if(void 0!==i)n=n&&void 0===i.error;else if(!n)return!1;if(n){var a;if(e.length>0&&(a=e[0]),a instanceof Error)throw a;var s=new Error("Unhandled error."+(a?" ("+a.message+")":""));throw s.context=a,s}var l=i[t];if(void 0===l)return!1;if("function"==typeof l)o(l,this,e);else{var u=l.length,c=m(l,u);for(r=0;r<u;++r)o(c[r],this,e)}return!0},l.prototype.addListener=function(t,e){return h(this,t,e,!1)},l.prototype.on=l.prototype.addListener,l.prototype.prependListener=function(t,e){return h(this,t,e,!0)},l.prototype.once=function(t,e){return c(e),this.on(t,p(this,t,e)),this},l.prototype.prependOnceListener=function(t,e){return c(e),this.prependListener(t,p(this,t,e)),this},l.prototype.removeListener=function(t,e){var r,n,i,a,o;if(c(e),void 0===(n=this._events))return this;if(void 0===(r=n[t]))return this;if(r===e||r.listener===e)0==--this._eventsCount?this._events=Object.create(null):(delete n[t],n.removeListener&&this.emit("removeListener",t,r.listener||e));else if("function"!=typeof r){for(i=-1,a=r.length-1;a>=0;a--)if(r[a]===e||r[a].listener===e){o=r[a].listener,i=a;break}if(i<0)return this;0===i?r.shift():function(t,e){for(;e+1<t.length;e++)t[e]=t[e+1];t.pop()}(r,i),1===r.length&&(n[t]=r[0]),void 0!==n.removeListener&&this.emit("removeListener",t,o||e)}return this},l.prototype.off=l.prototype.removeListener,l.prototype.removeAllListeners=function(t){var e,r,n;if(void 0===(r=this._events))return this;if(void 0===r.removeListener)return 0===arguments.length?(this._events=Object.create(null),this._eventsCount=0):void 0!==r[t]&&(0==--this._eventsCount?this._events=Object.create(null):delete r[t]),this;if(0===arguments.length){var i,a=Object.keys(r);for(n=0;n<a.length;++n)"removeListener"!==(i=a[n])&&this.removeAllListeners(i);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if("function"==typeof(e=r[t]))this.removeListener(t,e);else if(void 0!==e)for(n=e.length-1;n>=0;n--)this.removeListener(t,e[n]);return this},l.prototype.listeners=function(t){return g(this,t,!0)},l.prototype.rawListeners=function(t){return g(this,t,!1)},l.listenerCount=function(t,e){return"function"==typeof t.listenerCount?t.listenerCount(e):v.call(t,e)},l.prototype.listenerCount=v,l.prototype.eventNames=function(){return this._eventsCount>0?n(this._events):[]}},87133:t=>{"use strict";var e={};function r(t,r,n){n||(n=Error);var i=function(t){var e,n;function i(e,n,i){return t.call(this,function(t,e,n){return"string"==typeof r?r:r(t,e,n)}(e,n,i))||this}return n=t,(e=i).prototype=Object.create(n.prototype),e.prototype.constructor=e,e.__proto__=n,i}(n);i.prototype.name=n.name,i.prototype.code=t,e[t]=i}function n(t,e){if(Array.isArray(t)){var r=t.length;return t=t.map((function(t){return String(t)})),r>2?"one of ".concat(e," ").concat(t.slice(0,r-1).join(", "),", or ")+t[r-1]:2===r?"one of ".concat(e," ").concat(t[0]," or ").concat(t[1]):"of ".concat(e," ").concat(t[0])}return"of ".concat(e," ").concat(String(t))}r("ERR_INVALID_OPT_VALUE",(function(t,e){return'The value "'+e+'" is invalid for option "'+t+'"'}),TypeError),r("ERR_INVALID_ARG_TYPE",(function(t,e,r){var i,a,o,s,l;if("string"==typeof e&&(a="not ",e.substr(0,a.length)===a)?(i="must not be",e=e.replace(/^not /,"")):i="must be",function(t,e,r){return(void 0===r||r>t.length)&&(r=t.length),t.substring(r-e.length,r)===e}(t," argument"))o="The ".concat(t," ").concat(i," ").concat(n(e,"type"));else{var u=("number"!=typeof l&&(l=0),l+".".length>(s=t).length||-1===s.indexOf(".",l)?"argument":"property");o='The "'.concat(t,'" ').concat(u," ").concat(i," ").concat(n(e,"type"))}return o+". Received type ".concat(typeof r)}),TypeError),r("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF"),r("ERR_METHOD_NOT_IMPLEMENTED",(function(t){return"The "+t+" method is not implemented"})),r("ERR_STREAM_PREMATURE_CLOSE","Premature close"),r("ERR_STREAM_DESTROYED",(function(t){return"Cannot call "+t+" after a stream was destroyed"})),r("ERR_MULTIPLE_CALLBACK","Callback called multiple times"),r("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable"),r("ERR_STREAM_WRITE_AFTER_END","write after end"),r("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError),r("ERR_UNKNOWN_ENCODING",(function(t){return"Unknown encoding: "+t}),TypeError),r("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event"),t.exports.q=e},88608:(t,e,r)=>{"use strict";var n=r(6591),i=Object.keys||function(t){var e=[];for(var r in t)e.push(r);return e};t.exports=c;var a=r(55324),o=r(30799);r(23128)(c,a);for(var s=i(o.prototype),l=0;l<s.length;l++){var u=s[l];c.prototype[u]||(c.prototype[u]=o.prototype[u])}function c(t){if(!(this instanceof c))return new c(t);a.call(this,t),o.call(this,t),this.allowHalfOpen=!0,t&&(!1===t.readable&&(this.readable=!1),!1===t.writable&&(this.writable=!1),!1===t.allowHalfOpen&&(this.allowHalfOpen=!1,this.once("end",d)))}function d(){this._writableState.ended||n.nextTick(h,this)}function h(t){t.end()}Object.defineProperty(c.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),Object.defineProperty(c.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}}),Object.defineProperty(c.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}}),Object.defineProperty(c.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._readableState&&void 0!==this._writableState&&this._readableState.destroyed&&this._writableState.destroyed},set:function(t){void 0!==this._readableState&&void 0!==this._writableState&&(this._readableState.destroyed=t,this._writableState.destroyed=t)}})},64584:(t,e,r)=>{"use strict";t.exports=i;var n=r(25430);function i(t){if(!(this instanceof i))return new i(t);n.call(this,t)}r(23128)(i,n),i.prototype._transform=function(t,e,r){r(null,t)}},55324:(t,e,r)=>{"use strict";var n,i=r(6591);t.exports=_,_.ReadableState=w,r(15842).EventEmitter;var a,o=function(t,e){return t.listeners(e).length},s=r(30619),l=r(47103).Buffer,u=r.g.Uint8Array||function(){},c=r(66602);a=c&&c.debuglog?c.debuglog("stream"):function(){};var d,h,f,p=r(43882),g=r(63984),v=r(60291).getHighWaterMark,m=r(87133).q,y=m.ERR_INVALID_ARG_TYPE,b=m.ERR_STREAM_PUSH_AFTER_EOF,E=m.ERR_METHOD_NOT_IMPLEMENTED,x=m.ERR_STREAM_UNSHIFT_AFTER_END_EVENT;r(23128)(_,s);var S=g.errorOrDestroy,T=["error","close","destroy","pause","resume"];function w(t,e,i){n=n||r(88608),t=t||{},"boolean"!=typeof i&&(i=e instanceof n),this.objectMode=!!t.objectMode,i&&(this.objectMode=this.objectMode||!!t.readableObjectMode),this.highWaterMark=v(this,t,"readableHighWaterMark",i),this.buffer=new p,this.length=0,this.pipes=null,this.pipesCount=0,this.flowing=null,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.resumeScheduled=!1,this.paused=!0,this.emitClose=!1!==t.emitClose,this.autoDestroy=!!t.autoDestroy,this.destroyed=!1,this.defaultEncoding=t.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,t.encoding&&(d||(d=r(80956).s),this.decoder=new d(t.encoding),this.encoding=t.encoding)}function _(t){if(n=n||r(88608),!(this instanceof _))return new _(t);var e=this instanceof n;this._readableState=new w(t,this,e),this.readable=!0,t&&("function"==typeof t.read&&(this._read=t.read),"function"==typeof t.destroy&&(this._destroy=t.destroy)),s.call(this)}function A(t,e,r,n,i){a("readableAddChunk",e);var o,s=t._readableState;if(null===e)s.reading=!1,function(t,e){if(a("onEofChunk"),!e.ended){if(e.decoder){var r=e.decoder.end();r&&r.length&&(e.buffer.push(r),e.length+=e.objectMode?1:r.length)}e.ended=!0,e.sync?L(t):(e.needReadable=!1,e.emittedReadable||(e.emittedReadable=!0,R(t)))}}(t,s);else if(i||(o=function(t,e){var r,n;return n=e,l.isBuffer(n)||n instanceof u||"string"==typeof e||void 0===e||t.objectMode||(r=new y("chunk",["string","Buffer","Uint8Array"],e)),r}(s,e)),o)S(t,o);else if(s.objectMode||e&&e.length>0)if("string"==typeof e||s.objectMode||Object.getPrototypeOf(e)===l.prototype||(e=function(t){return l.from(t)}(e)),n)s.endEmitted?S(t,new x):k(t,s,e,!0);else if(s.ended)S(t,new b);else{if(s.destroyed)return!1;s.reading=!1,s.decoder&&!r?(e=s.decoder.write(e),s.objectMode||0!==e.length?k(t,s,e,!1):I(t,s)):k(t,s,e,!1)}else n||(s.reading=!1,I(t,s));return!s.ended&&(s.length<s.highWaterMark||0===s.length)}function k(t,e,r,n){e.flowing&&0===e.length&&!e.sync?(e.awaitDrain=0,t.emit("data",r)):(e.length+=e.objectMode?1:r.length,n?e.buffer.unshift(r):e.buffer.push(r),e.needReadable&&L(t)),I(t,e)}Object.defineProperty(_.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._readableState&&this._readableState.destroyed},set:function(t){this._readableState&&(this._readableState.destroyed=t)}}),_.prototype.destroy=g.destroy,_.prototype._undestroy=g.undestroy,_.prototype._destroy=function(t,e){e(t)},_.prototype.push=function(t,e){var r,n=this._readableState;return n.objectMode?r=!0:"string"==typeof t&&((e=e||n.defaultEncoding)!==n.encoding&&(t=l.from(t,e),e=""),r=!0),A(this,t,e,!1,r)},_.prototype.unshift=function(t){return A(this,t,null,!0,!1)},_.prototype.isPaused=function(){return!1===this._readableState.flowing},_.prototype.setEncoding=function(t){d||(d=r(80956).s);var e=new d(t);this._readableState.decoder=e,this._readableState.encoding=this._readableState.decoder.encoding;for(var n=this._readableState.buffer.head,i="";null!==n;)i+=e.write(n.data),n=n.next;return this._readableState.buffer.clear(),""!==i&&this._readableState.buffer.push(i),this._readableState.length=i.length,this};var C=1073741824;function D(t,e){return t<=0||0===e.length&&e.ended?0:e.objectMode?1:t!=t?e.flowing&&e.length?e.buffer.head.data.length:e.length:(t>e.highWaterMark&&(e.highWaterMark=function(t){return t>=C?t=C:(t--,t|=t>>>1,t|=t>>>2,t|=t>>>4,t|=t>>>8,t|=t>>>16,t++),t}(t)),t<=e.length?t:e.ended?e.length:(e.needReadable=!0,0))}function L(t){var e=t._readableState;a("emitReadable",e.needReadable,e.emittedReadable),e.needReadable=!1,e.emittedReadable||(a("emitReadable",e.flowing),e.emittedReadable=!0,i.nextTick(R,t))}function R(t){var e=t._readableState;a("emitReadable_",e.destroyed,e.length,e.ended),e.destroyed||!e.length&&!e.ended||(t.emit("readable"),e.emittedReadable=!1),e.needReadable=!e.flowing&&!e.ended&&e.length<=e.highWaterMark,N(t)}function I(t,e){e.readingMore||(e.readingMore=!0,i.nextTick(O,t,e))}function O(t,e){for(;!e.reading&&!e.ended&&(e.length<e.highWaterMark||e.flowing&&0===e.length);){var r=e.length;if(a("maybeReadMore read 0"),t.read(0),r===e.length)break}e.readingMore=!1}function M(t){var e=t._readableState;e.readableListening=t.listenerCount("readable")>0,e.resumeScheduled&&!e.paused?e.flowing=!0:t.listenerCount("data")>0&&t.resume()}function P(t){a("readable nexttick read 0"),t.read(0)}function F(t,e){a("resume",e.reading),e.reading||t.read(0),e.resumeScheduled=!1,t.emit("resume"),N(t),e.flowing&&!e.reading&&t.read(0)}function N(t){var e=t._readableState;for(a("flow",e.flowing);e.flowing&&null!==t.read(););}function B(t,e){return 0===e.length?null:(e.objectMode?r=e.buffer.shift():!t||t>=e.length?(r=e.decoder?e.buffer.join(""):1===e.buffer.length?e.buffer.first():e.buffer.concat(e.length),e.buffer.clear()):r=e.buffer.consume(t,e.decoder),r);var r}function U(t){var e=t._readableState;a("endReadable",e.endEmitted),e.endEmitted||(e.ended=!0,i.nextTick(j,e,t))}function j(t,e){if(a("endReadableNT",t.endEmitted,t.length),!t.endEmitted&&0===t.length&&(t.endEmitted=!0,e.readable=!1,e.emit("end"),t.autoDestroy)){var r=e._writableState;(!r||r.autoDestroy&&r.finished)&&e.destroy()}}function H(t,e){for(var r=0,n=t.length;r<n;r++)if(t[r]===e)return r;return-1}_.prototype.read=function(t){a("read",t),t=parseInt(t,10);var e=this._readableState,r=t;if(0!==t&&(e.emittedReadable=!1),0===t&&e.needReadable&&((0!==e.highWaterMark?e.length>=e.highWaterMark:e.length>0)||e.ended))return a("read: emitReadable",e.length,e.ended),0===e.length&&e.ended?U(this):L(this),null;if(0===(t=D(t,e))&&e.ended)return 0===e.length&&U(this),null;var n,i=e.needReadable;return a("need readable",i),(0===e.length||e.length-t<e.highWaterMark)&&a("length less than watermark",i=!0),e.ended||e.reading?a("reading or ended",i=!1):i&&(a("do read"),e.reading=!0,e.sync=!0,0===e.length&&(e.needReadable=!0),this._read(e.highWaterMark),e.sync=!1,e.reading||(t=D(r,e))),null===(n=t>0?B(t,e):null)?(e.needReadable=e.length<=e.highWaterMark,t=0):(e.length-=t,e.awaitDrain=0),0===e.length&&(e.ended||(e.needReadable=!0),r!==t&&e.ended&&U(this)),null!==n&&this.emit("data",n),n},_.prototype._read=function(t){S(this,new E("_read()"))},_.prototype.pipe=function(t,e){var r=this,n=this._readableState;switch(n.pipesCount){case 0:n.pipes=t;break;case 1:n.pipes=[n.pipes,t];break;default:n.pipes.push(t)}n.pipesCount+=1,a("pipe count=%d opts=%j",n.pipesCount,e);var s=e&&!1===e.end||t===i.stdout||t===i.stderr?g:l;function l(){a("onend"),t.end()}n.endEmitted?i.nextTick(s):r.once("end",s),t.on("unpipe",(function e(i,o){a("onunpipe"),i===r&&o&&!1===o.hasUnpiped&&(o.hasUnpiped=!0,a("cleanup"),t.removeListener("close",f),t.removeListener("finish",p),t.removeListener("drain",u),t.removeListener("error",h),t.removeListener("unpipe",e),r.removeListener("end",l),r.removeListener("end",g),r.removeListener("data",d),c=!0,!n.awaitDrain||t._writableState&&!t._writableState.needDrain||u())}));var u=function(t){return function(){var e=t._readableState;a("pipeOnDrain",e.awaitDrain),e.awaitDrain&&e.awaitDrain--,0===e.awaitDrain&&o(t,"data")&&(e.flowing=!0,N(t))}}(r);t.on("drain",u);var c=!1;function d(e){a("ondata");var i=t.write(e);a("dest.write",i),!1===i&&((1===n.pipesCount&&n.pipes===t||n.pipesCount>1&&-1!==H(n.pipes,t))&&!c&&(a("false write response, pause",n.awaitDrain),n.awaitDrain++),r.pause())}function h(e){a("onerror",e),g(),t.removeListener("error",h),0===o(t,"error")&&S(t,e)}function f(){t.removeListener("finish",p),g()}function p(){a("onfinish"),t.removeListener("close",f),g()}function g(){a("unpipe"),r.unpipe(t)}return r.on("data",d),function(t,e,r){if("function"==typeof t.prependListener)return t.prependListener(e,r);t._events&&t._events[e]?Array.isArray(t._events[e])?t._events[e].unshift(r):t._events[e]=[r,t._events[e]]:t.on(e,r)}(t,"error",h),t.once("close",f),t.once("finish",p),t.emit("pipe",r),n.flowing||(a("pipe resume"),r.resume()),t},_.prototype.unpipe=function(t){var e=this._readableState,r={hasUnpiped:!1};if(0===e.pipesCount)return this;if(1===e.pipesCount)return t&&t!==e.pipes||(t||(t=e.pipes),e.pipes=null,e.pipesCount=0,e.flowing=!1,t&&t.emit("unpipe",this,r)),this;if(!t){var n=e.pipes,i=e.pipesCount;e.pipes=null,e.pipesCount=0,e.flowing=!1;for(var a=0;a<i;a++)n[a].emit("unpipe",this,{hasUnpiped:!1});return this}var o=H(e.pipes,t);return-1===o||(e.pipes.splice(o,1),e.pipesCount-=1,1===e.pipesCount&&(e.pipes=e.pipes[0]),t.emit("unpipe",this,r)),this},_.prototype.on=function(t,e){var r=s.prototype.on.call(this,t,e),n=this._readableState;return"data"===t?(n.readableListening=this.listenerCount("readable")>0,!1!==n.flowing&&this.resume()):"readable"===t&&(n.endEmitted||n.readableListening||(n.readableListening=n.needReadable=!0,n.flowing=!1,n.emittedReadable=!1,a("on readable",n.length,n.reading),n.length?L(this):n.reading||i.nextTick(P,this))),r},_.prototype.addListener=_.prototype.on,_.prototype.removeListener=function(t,e){var r=s.prototype.removeListener.call(this,t,e);return"readable"===t&&i.nextTick(M,this),r},_.prototype.removeAllListeners=function(t){var e=s.prototype.removeAllListeners.apply(this,arguments);return"readable"!==t&&void 0!==t||i.nextTick(M,this),e},_.prototype.resume=function(){var t=this._readableState;return t.flowing||(a("resume"),t.flowing=!t.readableListening,function(t,e){e.resumeScheduled||(e.resumeScheduled=!0,i.nextTick(F,t,e))}(this,t)),t.paused=!1,this},_.prototype.pause=function(){return a("call pause flowing=%j",this._readableState.flowing),!1!==this._readableState.flowing&&(a("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState.paused=!0,this},_.prototype.wrap=function(t){var e=this,r=this._readableState,n=!1;for(var i in t.on("end",(function(){if(a("wrapped end"),r.decoder&&!r.ended){var t=r.decoder.end();t&&t.length&&e.push(t)}e.push(null)})),t.on("data",(function(i){a("wrapped data"),r.decoder&&(i=r.decoder.write(i)),r.objectMode&&null==i||(r.objectMode||i&&i.length)&&(e.push(i)||(n=!0,t.pause()))})),t)void 0===this[i]&&"function"==typeof t[i]&&(this[i]=function(e){return function(){return t[e].apply(t,arguments)}}(i));for(var o=0;o<T.length;o++)t.on(T[o],this.emit.bind(this,T[o]));return this._read=function(e){a("wrapped _read",e),n&&(n=!1,t.resume())},this},"function"==typeof Symbol&&(_.prototype[Symbol.asyncIterator]=function(){return void 0===h&&(h=r(51707)),h(this)}),Object.defineProperty(_.prototype,"readableHighWaterMark",{enumerable:!1,get:function(){return this._readableState.highWaterMark}}),Object.defineProperty(_.prototype,"readableBuffer",{enumerable:!1,get:function(){return this._readableState&&this._readableState.buffer}}),Object.defineProperty(_.prototype,"readableFlowing",{enumerable:!1,get:function(){return this._readableState.flowing},set:function(t){this._readableState&&(this._readableState.flowing=t)}}),_._fromList=B,Object.defineProperty(_.prototype,"readableLength",{enumerable:!1,get:function(){return this._readableState.length}}),"function"==typeof Symbol&&(_.from=function(t,e){return void 0===f&&(f=r(33479)),f(_,t,e)})},25430:(t,e,r)=>{"use strict";t.exports=c;var n=r(87133).q,i=n.ERR_METHOD_NOT_IMPLEMENTED,a=n.ERR_MULTIPLE_CALLBACK,o=n.ERR_TRANSFORM_ALREADY_TRANSFORMING,s=n.ERR_TRANSFORM_WITH_LENGTH_0,l=r(88608);function u(t,e){var r=this._transformState;r.transforming=!1;var n=r.writecb;if(null===n)return this.emit("error",new a);r.writechunk=null,r.writecb=null,null!=e&&this.push(e),n(t);var i=this._readableState;i.reading=!1,(i.needReadable||i.length<i.highWaterMark)&&this._read(i.highWaterMark)}function c(t){if(!(this instanceof c))return new c(t);l.call(this,t),this._transformState={afterTransform:u.bind(this),needTransform:!1,transforming:!1,writecb:null,writechunk:null,writeencoding:null},this._readableState.needReadable=!0,this._readableState.sync=!1,t&&("function"==typeof t.transform&&(this._transform=t.transform),"function"==typeof t.flush&&(this._flush=t.flush)),this.on("prefinish",d)}function d(){var t=this;"function"!=typeof this._flush||this._readableState.destroyed?h(this,null,null):this._flush((function(e,r){h(t,e,r)}))}function h(t,e,r){if(e)return t.emit("error",e);if(null!=r&&t.push(r),t._writableState.length)throw new s;if(t._transformState.transforming)throw new o;return t.push(null)}r(23128)(c,l),c.prototype.push=function(t,e){return this._transformState.needTransform=!1,l.prototype.push.call(this,t,e)},c.prototype._transform=function(t,e,r){r(new i("_transform()"))},c.prototype._write=function(t,e,r){var n=this._transformState;if(n.writecb=r,n.writechunk=t,n.writeencoding=e,!n.transforming){var i=this._readableState;(n.needTransform||i.needReadable||i.length<i.highWaterMark)&&this._read(i.highWaterMark)}},c.prototype._read=function(t){var e=this._transformState;null===e.writechunk||e.transforming?e.needTransform=!0:(e.transforming=!0,this._transform(e.writechunk,e.writeencoding,e.afterTransform))},c.prototype._destroy=function(t,e){l.prototype._destroy.call(this,t,(function(t){e(t)}))}},30799:(t,e,r)=>{"use strict";var n,i=r(6591);function a(t){var e=this;this.next=null,this.entry=null,this.finish=function(){!function(t,e,r){var n=t.entry;for(t.entry=null;n;){var i=n.callback;e.pendingcb--,i(undefined),n=n.next}e.corkedRequestsFree.next=t}(e,t)}}t.exports=_,_.WritableState=w;var o,s={deprecate:r(14655)},l=r(30619),u=r(47103).Buffer,c=r.g.Uint8Array||function(){},d=r(63984),h=r(60291).getHighWaterMark,f=r(87133).q,p=f.ERR_INVALID_ARG_TYPE,g=f.ERR_METHOD_NOT_IMPLEMENTED,v=f.ERR_MULTIPLE_CALLBACK,m=f.ERR_STREAM_CANNOT_PIPE,y=f.ERR_STREAM_DESTROYED,b=f.ERR_STREAM_NULL_VALUES,E=f.ERR_STREAM_WRITE_AFTER_END,x=f.ERR_UNKNOWN_ENCODING,S=d.errorOrDestroy;function T(){}function w(t,e,o){n=n||r(88608),t=t||{},"boolean"!=typeof o&&(o=e instanceof n),this.objectMode=!!t.objectMode,o&&(this.objectMode=this.objectMode||!!t.writableObjectMode),this.highWaterMark=h(this,t,"writableHighWaterMark",o),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var s=!1===t.decodeStrings;this.decodeStrings=!s,this.defaultEncoding=t.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(t){!function(t,e){var r=t._writableState,n=r.sync,a=r.writecb;if("function"!=typeof a)throw new v;if(function(t){t.writing=!1,t.writecb=null,t.length-=t.writelen,t.writelen=0}(r),e)!function(t,e,r,n,a){--e.pendingcb,r?(i.nextTick(a,n),i.nextTick(R,t,e),t._writableState.errorEmitted=!0,S(t,n)):(a(n),t._writableState.errorEmitted=!0,S(t,n),R(t,e))}(t,r,n,e,a);else{var o=D(r)||t.destroyed;o||r.corked||r.bufferProcessing||!r.bufferedRequest||C(t,r),n?i.nextTick(k,t,r,o,a):k(t,r,o,a)}}(e,t)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.emitClose=!1!==t.emitClose,this.autoDestroy=!!t.autoDestroy,this.bufferedRequestCount=0,this.corkedRequestsFree=new a(this)}function _(t){var e=this instanceof(n=n||r(88608));if(!e&&!o.call(_,this))return new _(t);this._writableState=new w(t,this,e),this.writable=!0,t&&("function"==typeof t.write&&(this._write=t.write),"function"==typeof t.writev&&(this._writev=t.writev),"function"==typeof t.destroy&&(this._destroy=t.destroy),"function"==typeof t.final&&(this._final=t.final)),l.call(this)}function A(t,e,r,n,i,a,o){e.writelen=n,e.writecb=o,e.writing=!0,e.sync=!0,e.destroyed?e.onwrite(new y("write")):r?t._writev(i,e.onwrite):t._write(i,a,e.onwrite),e.sync=!1}function k(t,e,r,n){r||function(t,e){0===e.length&&e.needDrain&&(e.needDrain=!1,t.emit("drain"))}(t,e),e.pendingcb--,n(),R(t,e)}function C(t,e){e.bufferProcessing=!0;var r=e.bufferedRequest;if(t._writev&&r&&r.next){var n=e.bufferedRequestCount,i=new Array(n),o=e.corkedRequestsFree;o.entry=r;for(var s=0,l=!0;r;)i[s]=r,r.isBuf||(l=!1),r=r.next,s+=1;i.allBuffers=l,A(t,e,!0,e.length,i,"",o.finish),e.pendingcb++,e.lastBufferedRequest=null,o.next?(e.corkedRequestsFree=o.next,o.next=null):e.corkedRequestsFree=new a(e),e.bufferedRequestCount=0}else{for(;r;){var u=r.chunk,c=r.encoding,d=r.callback;if(A(t,e,!1,e.objectMode?1:u.length,u,c,d),r=r.next,e.bufferedRequestCount--,e.writing)break}null===r&&(e.lastBufferedRequest=null)}e.bufferedRequest=r,e.bufferProcessing=!1}function D(t){return t.ending&&0===t.length&&null===t.bufferedRequest&&!t.finished&&!t.writing}function L(t,e){t._final((function(r){e.pendingcb--,r&&S(t,r),e.prefinished=!0,t.emit("prefinish"),R(t,e)}))}function R(t,e){var r=D(e);if(r&&(function(t,e){e.prefinished||e.finalCalled||("function"!=typeof t._final||e.destroyed?(e.prefinished=!0,t.emit("prefinish")):(e.pendingcb++,e.finalCalled=!0,i.nextTick(L,t,e)))}(t,e),0===e.pendingcb&&(e.finished=!0,t.emit("finish"),e.autoDestroy))){var n=t._readableState;(!n||n.autoDestroy&&n.endEmitted)&&t.destroy()}return r}r(23128)(_,l),w.prototype.getBuffer=function(){for(var t=this.bufferedRequest,e=[];t;)e.push(t),t=t.next;return e},function(){try{Object.defineProperty(w.prototype,"buffer",{get:s.deprecate((function(){return this.getBuffer()}),"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch(t){}}(),"function"==typeof Symbol&&Symbol.hasInstance&&"function"==typeof Function.prototype[Symbol.hasInstance]?(o=Function.prototype[Symbol.hasInstance],Object.defineProperty(_,Symbol.hasInstance,{value:function(t){return!!o.call(this,t)||this===_&&t&&t._writableState instanceof w}})):o=function(t){return t instanceof this},_.prototype.pipe=function(){S(this,new m)},_.prototype.write=function(t,e,r){var n,a=this._writableState,o=!1,s=!a.objectMode&&(n=t,u.isBuffer(n)||n instanceof c);return s&&!u.isBuffer(t)&&(t=function(t){return u.from(t)}(t)),"function"==typeof e&&(r=e,e=null),s?e="buffer":e||(e=a.defaultEncoding),"function"!=typeof r&&(r=T),a.ending?function(t,e){var r=new E;S(t,r),i.nextTick(e,r)}(this,r):(s||function(t,e,r,n){var a;return null===r?a=new b:"string"==typeof r||e.objectMode||(a=new p("chunk",["string","Buffer"],r)),!a||(S(t,a),i.nextTick(n,a),!1)}(this,a,t,r))&&(a.pendingcb++,o=function(t,e,r,n,i,a){if(!r){var o=function(t,e,r){return t.objectMode||!1===t.decodeStrings||"string"!=typeof e||(e=u.from(e,r)),e}(e,n,i);n!==o&&(r=!0,i="buffer",n=o)}var s=e.objectMode?1:n.length;e.length+=s;var l=e.length<e.highWaterMark;if(l||(e.needDrain=!0),e.writing||e.corked){var c=e.lastBufferedRequest;e.lastBufferedRequest={chunk:n,encoding:i,isBuf:r,callback:a,next:null},c?c.next=e.lastBufferedRequest:e.bufferedRequest=e.lastBufferedRequest,e.bufferedRequestCount+=1}else A(t,e,!1,s,n,i,a);return l}(this,a,s,t,e,r)),o},_.prototype.cork=function(){this._writableState.corked++},_.prototype.uncork=function(){var t=this._writableState;t.corked&&(t.corked--,t.writing||t.corked||t.bufferProcessing||!t.bufferedRequest||C(this,t))},_.prototype.setDefaultEncoding=function(t){if("string"==typeof t&&(t=t.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((t+"").toLowerCase())>-1))throw new x(t);return this._writableState.defaultEncoding=t,this},Object.defineProperty(_.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}}),Object.defineProperty(_.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),_.prototype._write=function(t,e,r){r(new g("_write()"))},_.prototype._writev=null,_.prototype.end=function(t,e,r){var n=this._writableState;return"function"==typeof t?(r=t,t=null,e=null):"function"==typeof e&&(r=e,e=null),null!=t&&this.write(t,e),n.corked&&(n.corked=1,this.uncork()),n.ending||function(t,e,r){e.ending=!0,R(t,e),r&&(e.finished?i.nextTick(r):t.once("finish",r)),e.ended=!0,t.writable=!1}(this,n,r),this},Object.defineProperty(_.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}}),Object.defineProperty(_.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._writableState&&this._writableState.destroyed},set:function(t){this._writableState&&(this._writableState.destroyed=t)}}),_.prototype.destroy=d.destroy,_.prototype._undestroy=d.undestroy,_.prototype._destroy=function(t,e){e(t)}},51707:(t,e,r)=>{"use strict";var n,i=r(6591);function a(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}var o=r(7586),s=Symbol("lastResolve"),l=Symbol("lastReject"),u=Symbol("error"),c=Symbol("ended"),d=Symbol("lastPromise"),h=Symbol("handlePromise"),f=Symbol("stream");function p(t,e){return{value:t,done:e}}function g(t){var e=t[s];if(null!==e){var r=t[f].read();null!==r&&(t[d]=null,t[s]=null,t[l]=null,e(p(r,!1)))}}function v(t){i.nextTick(g,t)}var m=Object.getPrototypeOf((function(){})),y=Object.setPrototypeOf((a(n={get stream(){return this[f]},next:function(){var t=this,e=this[u];if(null!==e)return Promise.reject(e);if(this[c])return Promise.resolve(p(void 0,!0));if(this[f].destroyed)return new Promise((function(e,r){i.nextTick((function(){t[u]?r(t[u]):e(p(void 0,!0))}))}));var r,n=this[d];if(n)r=new Promise(function(t,e){return function(r,n){t.then((function(){e[c]?r(p(void 0,!0)):e[h](r,n)}),n)}}(n,this));else{var a=this[f].read();if(null!==a)return Promise.resolve(p(a,!1));r=new Promise(this[h])}return this[d]=r,r}},Symbol.asyncIterator,(function(){return this})),a(n,"return",(function(){var t=this;return new Promise((function(e,r){t[f].destroy(null,(function(t){t?r(t):e(p(void 0,!0))}))}))})),n),m);t.exports=function(t){var e,r=Object.create(y,(a(e={},f,{value:t,writable:!0}),a(e,s,{value:null,writable:!0}),a(e,l,{value:null,writable:!0}),a(e,u,{value:null,writable:!0}),a(e,c,{value:t._readableState.endEmitted,writable:!0}),a(e,h,{value:function(t,e){var n=r[f].read();n?(r[d]=null,r[s]=null,r[l]=null,t(p(n,!1))):(r[s]=t,r[l]=e)},writable:!0}),e));return r[d]=null,o(t,(function(t){if(t&&"ERR_STREAM_PREMATURE_CLOSE"!==t.code){var e=r[l];return null!==e&&(r[d]=null,r[s]=null,r[l]=null,e(t)),void(r[u]=t)}var n=r[s];null!==n&&(r[d]=null,r[s]=null,r[l]=null,n(p(void 0,!0))),r[c]=!0})),t.on("readable",v.bind(null,r)),r}},43882:(t,e,r)=>{"use strict";function n(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function i(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function a(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}var o=r(47103).Buffer,s=r(74854).inspect,l=s&&s.custom||"inspect";t.exports=function(){function t(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.head=null,this.tail=null,this.length=0}var e,r;return e=t,r=[{key:"push",value:function(t){var e={data:t,next:null};this.length>0?this.tail.next=e:this.head=e,this.tail=e,++this.length}},{key:"unshift",value:function(t){var e={data:t,next:this.head};0===this.length&&(this.tail=e),this.head=e,++this.length}},{key:"shift",value:function(){if(0!==this.length){var t=this.head.data;return 1===this.length?this.head=this.tail=null:this.head=this.head.next,--this.length,t}}},{key:"clear",value:function(){this.head=this.tail=null,this.length=0}},{key:"join",value:function(t){if(0===this.length)return"";for(var e=this.head,r=""+e.data;e=e.next;)r+=t+e.data;return r}},{key:"concat",value:function(t){if(0===this.length)return o.alloc(0);for(var e,r,n,i=o.allocUnsafe(t>>>0),a=this.head,s=0;a;)e=a.data,r=i,n=s,o.prototype.copy.call(e,r,n),s+=a.data.length,a=a.next;return i}},{key:"consume",value:function(t,e){var r;return t<this.head.data.length?(r=this.head.data.slice(0,t),this.head.data=this.head.data.slice(t)):r=t===this.head.data.length?this.shift():e?this._getString(t):this._getBuffer(t),r}},{key:"first",value:function(){return this.head.data}},{key:"_getString",value:function(t){var e=this.head,r=1,n=e.data;for(t-=n.length;e=e.next;){var i=e.data,a=t>i.length?i.length:t;if(a===i.length?n+=i:n+=i.slice(0,t),0==(t-=a)){a===i.length?(++r,e.next?this.head=e.next:this.head=this.tail=null):(this.head=e,e.data=i.slice(a));break}++r}return this.length-=r,n}},{key:"_getBuffer",value:function(t){var e=o.allocUnsafe(t),r=this.head,n=1;for(r.data.copy(e),t-=r.data.length;r=r.next;){var i=r.data,a=t>i.length?i.length:t;if(i.copy(e,e.length-t,0,a),0==(t-=a)){a===i.length?(++n,r.next?this.head=r.next:this.head=this.tail=null):(this.head=r,r.data=i.slice(a));break}++n}return this.length-=n,e}},{key:l,value:function(t,e){return s(this,function(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?n(Object(r),!0).forEach((function(e){i(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):n(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}({},e,{depth:0,customInspect:!1}))}}],r&&a(e.prototype,r),t}()},63984:(t,e,r)=>{"use strict";var n=r(6591);function i(t,e){o(t,e),a(t)}function a(t){t._writableState&&!t._writableState.emitClose||t._readableState&&!t._readableState.emitClose||t.emit("close")}function o(t,e){t.emit("error",e)}t.exports={destroy:function(t,e){var r=this,s=this._readableState&&this._readableState.destroyed,l=this._writableState&&this._writableState.destroyed;return s||l?(e?e(t):t&&(this._writableState?this._writableState.errorEmitted||(this._writableState.errorEmitted=!0,n.nextTick(o,this,t)):n.nextTick(o,this,t)),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(t||null,(function(t){!e&&t?r._writableState?r._writableState.errorEmitted?n.nextTick(a,r):(r._writableState.errorEmitted=!0,n.nextTick(i,r,t)):n.nextTick(i,r,t):e?(n.nextTick(a,r),e(t)):n.nextTick(a,r)})),this)},undestroy:function(){this._readableState&&(this._readableState.destroyed=!1,this._readableState.reading=!1,this._readableState.ended=!1,this._readableState.endEmitted=!1),this._writableState&&(this._writableState.destroyed=!1,this._writableState.ended=!1,this._writableState.ending=!1,this._writableState.finalCalled=!1,this._writableState.prefinished=!1,this._writableState.finished=!1,this._writableState.errorEmitted=!1)},errorOrDestroy:function(t,e){var r=t._readableState,n=t._writableState;r&&r.autoDestroy||n&&n.autoDestroy?t.destroy(e):t.emit("error",e)}}},7586:(t,e,r)=>{"use strict";var n=r(87133).q.ERR_STREAM_PREMATURE_CLOSE;function i(){}t.exports=function t(e,r,a){if("function"==typeof r)return t(e,null,r);r||(r={}),a=function(t){var e=!1;return function(){if(!e){e=!0;for(var r=arguments.length,n=new Array(r),i=0;i<r;i++)n[i]=arguments[i];t.apply(this,n)}}}(a||i);var o=r.readable||!1!==r.readable&&e.readable,s=r.writable||!1!==r.writable&&e.writable,l=function(){e.writable||c()},u=e._writableState&&e._writableState.finished,c=function(){s=!1,u=!0,o||a.call(e)},d=e._readableState&&e._readableState.endEmitted,h=function(){o=!1,d=!0,s||a.call(e)},f=function(t){a.call(e,t)},p=function(){var t;return o&&!d?(e._readableState&&e._readableState.ended||(t=new n),a.call(e,t)):s&&!u?(e._writableState&&e._writableState.ended||(t=new n),a.call(e,t)):void 0},g=function(){e.req.on("finish",c)};return function(t){return t.setHeader&&"function"==typeof t.abort}(e)?(e.on("complete",c),e.on("abort",p),e.req?g():e.on("request",g)):s&&!e._writableState&&(e.on("end",l),e.on("close",l)),e.on("end",h),e.on("finish",c),!1!==r.error&&e.on("error",f),e.on("close",p),function(){e.removeListener("complete",c),e.removeListener("abort",p),e.removeListener("request",g),e.req&&e.req.removeListener("finish",c),e.removeListener("end",l),e.removeListener("close",l),e.removeListener("finish",c),e.removeListener("end",h),e.removeListener("error",f),e.removeListener("close",p)}}},33479:t=>{t.exports=function(){throw new Error("Readable.from is not available in the browser")}},76590:(t,e,r)=>{"use strict";var n,i=r(87133).q,a=i.ERR_MISSING_ARGS,o=i.ERR_STREAM_DESTROYED;function s(t){if(t)throw t}function l(t,e,i,a){a=function(t){var e=!1;return function(){e||(e=!0,t.apply(void 0,arguments))}}(a);var s=!1;t.on("close",(function(){s=!0})),void 0===n&&(n=r(7586)),n(t,{readable:e,writable:i},(function(t){if(t)return a(t);s=!0,a()}));var l=!1;return function(e){if(!s&&!l)return l=!0,function(t){return t.setHeader&&"function"==typeof t.abort}(t)?t.abort():"function"==typeof t.destroy?t.destroy():void a(e||new o("pipe"))}}function u(t){t()}function c(t,e){return t.pipe(e)}function d(t){return t.length?"function"!=typeof t[t.length-1]?s:t.pop():s}t.exports=function(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];var n,i=d(e);if(Array.isArray(e[0])&&(e=e[0]),e.length<2)throw new a("streams");var o=e.map((function(t,r){var a=r<e.length-1;return l(t,a,r>0,(function(t){n||(n=t),t&&o.forEach(u),a||(o.forEach(u),i(n))}))}));return e.reduce(c)}},60291:(t,e,r)=>{"use strict";var n=r(87133).q.ERR_INVALID_OPT_VALUE;t.exports={getHighWaterMark:function(t,e,r,i){var a=function(t,e,r){return null!=t.highWaterMark?t.highWaterMark:e?t[r]:null}(e,i,r);if(null!=a){if(!isFinite(a)||Math.floor(a)!==a||a<0)throw new n(i?r:"highWaterMark",a);return Math.floor(a)}return t.objectMode?16:16384}}},30619:(t,e,r)=>{t.exports=r(15842).EventEmitter},757:t=>{var e=function(t){"use strict";var e,r=Object.prototype,n=r.hasOwnProperty,i=Object.defineProperty||function(t,e,r){t[e]=r.value},a="function"==typeof Symbol?Symbol:{},o=a.iterator||"@@iterator",s=a.asyncIterator||"@@asyncIterator",l=a.toStringTag||"@@toStringTag";function u(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{u({},"")}catch(t){u=function(t,e,r){return t[e]=r}}function c(t,e,r,n){var a=e&&e.prototype instanceof v?e:v,o=Object.create(a.prototype),s=new D(n||[]);return i(o,"_invoke",{value:_(t,r,s)}),o}function d(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}t.wrap=c;var h="suspendedStart",f="executing",p="completed",g={};function v(){}function m(){}function y(){}var b={};u(b,o,(function(){return this}));var E=Object.getPrototypeOf,x=E&&E(E(L([])));x&&x!==r&&n.call(x,o)&&(b=x);var S=y.prototype=v.prototype=Object.create(b);function T(t){["next","throw","return"].forEach((function(e){u(t,e,(function(t){return this._invoke(e,t)}))}))}function w(t,e){function r(i,a,o,s){var l=d(t[i],t,a);if("throw"!==l.type){var u=l.arg,c=u.value;return c&&"object"==typeof c&&n.call(c,"__await")?e.resolve(c.__await).then((function(t){r("next",t,o,s)}),(function(t){r("throw",t,o,s)})):e.resolve(c).then((function(t){u.value=t,o(u)}),(function(t){return r("throw",t,o,s)}))}s(l.arg)}var a;i(this,"_invoke",{value:function(t,n){function i(){return new e((function(e,i){r(t,n,e,i)}))}return a=a?a.then(i,i):i()}})}function _(t,e,r){var n=h;return function(i,a){if(n===f)throw new Error("Generator is already running");if(n===p){if("throw"===i)throw a;return R()}for(r.method=i,r.arg=a;;){var o=r.delegate;if(o){var s=A(o,r);if(s){if(s===g)continue;return s}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if(n===h)throw n=p,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n=f;var l=d(t,e,r);if("normal"===l.type){if(n=r.done?p:"suspendedYield",l.arg===g)continue;return{value:l.arg,done:r.done}}"throw"===l.type&&(n=p,r.method="throw",r.arg=l.arg)}}}function A(t,r){var n=r.method,i=t.iterator[n];if(i===e)return r.delegate=null,"throw"===n&&t.iterator.return&&(r.method="return",r.arg=e,A(t,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),g;var a=d(i,t.iterator,r.arg);if("throw"===a.type)return r.method="throw",r.arg=a.arg,r.delegate=null,g;var o=a.arg;return o?o.done?(r[t.resultName]=o.value,r.next=t.nextLoc,"return"!==r.method&&(r.method="next",r.arg=e),r.delegate=null,g):o:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,g)}function k(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function C(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function D(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(k,this),this.reset(!0)}function L(t){if(t){var r=t[o];if(r)return r.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var i=-1,a=function r(){for(;++i<t.length;)if(n.call(t,i))return r.value=t[i],r.done=!1,r;return r.value=e,r.done=!0,r};return a.next=a}}return{next:R}}function R(){return{value:e,done:!0}}return m.prototype=y,i(S,"constructor",{value:y,configurable:!0}),i(y,"constructor",{value:m,configurable:!0}),m.displayName=u(y,l,"GeneratorFunction"),t.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===m||"GeneratorFunction"===(e.displayName||e.name))},t.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,y):(t.__proto__=y,u(t,l,"GeneratorFunction")),t.prototype=Object.create(S),t},t.awrap=function(t){return{__await:t}},T(w.prototype),u(w.prototype,s,(function(){return this})),t.AsyncIterator=w,t.async=function(e,r,n,i,a){void 0===a&&(a=Promise);var o=new w(c(e,r,n,i),a);return t.isGeneratorFunction(r)?o:o.next().then((function(t){return t.done?t.value:o.next()}))},T(S),u(S,l,"Generator"),u(S,o,(function(){return this})),u(S,"toString",(function(){return"[object Generator]"})),t.keys=function(t){var e=Object(t),r=[];for(var n in e)r.push(n);return r.reverse(),function t(){for(;r.length;){var n=r.pop();if(n in e)return t.value=n,t.done=!1,t}return t.done=!0,t}},t.values=L,D.prototype={constructor:D,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=e,this.done=!1,this.delegate=null,this.method="next",this.arg=e,this.tryEntries.forEach(C),!t)for(var r in this)"t"===r.charAt(0)&&n.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=e)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var r=this;function i(n,i){return s.type="throw",s.arg=t,r.next=n,i&&(r.method="next",r.arg=e),!!i}for(var a=this.tryEntries.length-1;a>=0;--a){var o=this.tryEntries[a],s=o.completion;if("root"===o.tryLoc)return i("end");if(o.tryLoc<=this.prev){var l=n.call(o,"catchLoc"),u=n.call(o,"finallyLoc");if(l&&u){if(this.prev<o.catchLoc)return i(o.catchLoc,!0);if(this.prev<o.finallyLoc)return i(o.finallyLoc)}else if(l){if(this.prev<o.catchLoc)return i(o.catchLoc,!0)}else{if(!u)throw new Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return i(o.finallyLoc)}}}},abrupt:function(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var i=this.tryEntries[r];if(i.tryLoc<=this.prev&&n.call(i,"finallyLoc")&&this.prev<i.finallyLoc){var a=i;break}}a&&("break"===t||"continue"===t)&&a.tryLoc<=e&&e<=a.finallyLoc&&(a=null);var o=a?a.completion:{};return o.type=t,o.arg=e,a?(this.method="next",this.next=a.finallyLoc,g):this.complete(o)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),g},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),C(r),g}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var i=n.arg;C(r)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(t,r,n){return this.delegate={iterator:L(t),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=e),g}},t}(t.exports);try{regeneratorRuntime=e}catch(t){"object"==typeof globalThis?globalThis.regeneratorRuntime=e:Function("r","regeneratorRuntime = r")(e)}},13369:(t,e,r)=>{var n=r(78655).lW;!function(t){t.parser=function(t,e){return new a(t,e)},t.SAXParser=a,t.SAXStream=s,t.createStream=function(t,e){return new s(t,e)},t.MAX_BUFFER_LENGTH=65536;var e,i=["comment","sgmlDecl","textNode","tagName","doctype","procInstName","procInstBody","entity","attribName","attribValue","cdata","script"];function a(e,r){if(!(this instanceof a))return new a(e,r);var n=this;!function(t){for(var e=0,r=i.length;e<r;e++)t[i[e]]=""}(n),n.q=n.c="",n.bufferCheckPosition=t.MAX_BUFFER_LENGTH,n.opt=r||{},n.opt.lowercase=n.opt.lowercase||n.opt.lowercasetags,n.looseCase=n.opt.lowercase?"toLowerCase":"toUpperCase",n.tags=[],n.closed=n.closedRoot=n.sawRoot=!1,n.tag=n.error=null,n.strict=!!e,n.noscript=!(!e&&!n.opt.noscript),n.state=T.BEGIN,n.strictEntities=n.opt.strictEntities,n.ENTITIES=n.strictEntities?Object.create(t.XML_ENTITIES):Object.create(t.ENTITIES),n.attribList=[],n.opt.xmlns&&(n.ns=Object.create(c)),n.trackPosition=!1!==n.opt.position,n.trackPosition&&(n.position=n.line=n.column=0),_(n,"onready")}t.EVENTS=["text","processinginstruction","sgmldeclaration","doctype","comment","opentagstart","attribute","opentag","closetag","opencdata","cdata","closecdata","error","end","ready","script","opennamespace","closenamespace"],Object.create||(Object.create=function(t){function e(){}return e.prototype=t,new e}),Object.keys||(Object.keys=function(t){var e=[];for(var r in t)t.hasOwnProperty(r)&&e.push(r);return e}),a.prototype={end:function(){L(this)},write:function(e){var r=this;if(this.error)throw this.error;if(r.closed)return D(r,"Cannot write after close. Assign an onready handler.");if(null===e)return L(r);"object"==typeof e&&(e=e.toString());for(var n=0,a="";a=U(e,n++),r.c=a,a;)switch(r.trackPosition&&(r.position++,"\n"===a?(r.line++,r.column=0):r.column++),r.state){case T.BEGIN:if(r.state=T.BEGIN_WHITESPACE,"\ufeff"===a)continue;B(r,a);continue;case T.BEGIN_WHITESPACE:B(r,a);continue;case T.TEXT:if(r.sawRoot&&!r.closedRoot){for(var o=n-1;a&&"<"!==a&&"&"!==a;)(a=U(e,n++))&&r.trackPosition&&(r.position++,"\n"===a?(r.line++,r.column=0):r.column++);r.textNode+=e.substring(o,n-1)}"<"!==a||r.sawRoot&&r.closedRoot&&!r.strict?(g(a)||r.sawRoot&&!r.closedRoot||R(r,"Text data outside of root node."),"&"===a?r.state=T.TEXT_ENTITY:r.textNode+=a):(r.state=T.OPEN_WAKA,r.startTagPosition=r.position);continue;case T.SCRIPT:"<"===a?r.state=T.SCRIPT_ENDING:r.script+=a;continue;case T.SCRIPT_ENDING:"/"===a?r.state=T.CLOSE_TAG:(r.script+="<"+a,r.state=T.SCRIPT);continue;case T.OPEN_WAKA:if("!"===a)r.state=T.SGML_DECL,r.sgmlDecl="";else if(g(a));else if(y(d,a))r.state=T.OPEN_TAG,r.tagName=a;else if("/"===a)r.state=T.CLOSE_TAG,r.tagName="";else if("?"===a)r.state=T.PROC_INST,r.procInstName=r.procInstBody="";else{if(R(r,"Unencoded <"),r.startTagPosition+1<r.position){var s=r.position-r.startTagPosition;a=new Array(s).join(" ")+a}r.textNode+="<"+a,r.state=T.TEXT}continue;case T.SGML_DECL:"[CDATA["===(r.sgmlDecl+a).toUpperCase()?(A(r,"onopencdata"),r.state=T.CDATA,r.sgmlDecl="",r.cdata=""):r.sgmlDecl+a==="--"?(r.state=T.COMMENT,r.comment="",r.sgmlDecl=""):"DOCTYPE"===(r.sgmlDecl+a).toUpperCase()?(r.state=T.DOCTYPE,(r.doctype||r.sawRoot)&&R(r,"Inappropriately located doctype declaration"),r.doctype="",r.sgmlDecl=""):">"===a?(A(r,"onsgmldeclaration",r.sgmlDecl),r.sgmlDecl="",r.state=T.TEXT):v(a)?(r.state=T.SGML_DECL_QUOTED,r.sgmlDecl+=a):r.sgmlDecl+=a;continue;case T.SGML_DECL_QUOTED:a===r.q&&(r.state=T.SGML_DECL,r.q=""),r.sgmlDecl+=a;continue;case T.DOCTYPE:">"===a?(r.state=T.TEXT,A(r,"ondoctype",r.doctype),r.doctype=!0):(r.doctype+=a,"["===a?r.state=T.DOCTYPE_DTD:v(a)&&(r.state=T.DOCTYPE_QUOTED,r.q=a));continue;case T.DOCTYPE_QUOTED:r.doctype+=a,a===r.q&&(r.q="",r.state=T.DOCTYPE);continue;case T.DOCTYPE_DTD:r.doctype+=a,"]"===a?r.state=T.DOCTYPE:v(a)&&(r.state=T.DOCTYPE_DTD_QUOTED,r.q=a);continue;case T.DOCTYPE_DTD_QUOTED:r.doctype+=a,a===r.q&&(r.state=T.DOCTYPE_DTD,r.q="");continue;case T.COMMENT:"-"===a?r.state=T.COMMENT_ENDING:r.comment+=a;continue;case T.COMMENT_ENDING:"-"===a?(r.state=T.COMMENT_ENDED,r.comment=C(r.opt,r.comment),r.comment&&A(r,"oncomment",r.comment),r.comment=""):(r.comment+="-"+a,r.state=T.COMMENT);continue;case T.COMMENT_ENDED:">"!==a?(R(r,"Malformed comment"),r.comment+="--"+a,r.state=T.COMMENT):r.state=T.TEXT;continue;case T.CDATA:"]"===a?r.state=T.CDATA_ENDING:r.cdata+=a;continue;case T.CDATA_ENDING:"]"===a?r.state=T.CDATA_ENDING_2:(r.cdata+="]"+a,r.state=T.CDATA);continue;case T.CDATA_ENDING_2:">"===a?(r.cdata&&A(r,"oncdata",r.cdata),A(r,"onclosecdata"),r.cdata="",r.state=T.TEXT):"]"===a?r.cdata+="]":(r.cdata+="]]"+a,r.state=T.CDATA);continue;case T.PROC_INST:"?"===a?r.state=T.PROC_INST_ENDING:g(a)?r.state=T.PROC_INST_BODY:r.procInstName+=a;continue;case T.PROC_INST_BODY:if(!r.procInstBody&&g(a))continue;"?"===a?r.state=T.PROC_INST_ENDING:r.procInstBody+=a;continue;case T.PROC_INST_ENDING:">"===a?(A(r,"onprocessinginstruction",{name:r.procInstName,body:r.procInstBody}),r.procInstName=r.procInstBody="",r.state=T.TEXT):(r.procInstBody+="?"+a,r.state=T.PROC_INST_BODY);continue;case T.OPEN_TAG:y(h,a)?r.tagName+=a:(I(r),">"===a?P(r):"/"===a?r.state=T.OPEN_TAG_SLASH:(g(a)||R(r,"Invalid character in tag name"),r.state=T.ATTRIB));continue;case T.OPEN_TAG_SLASH:">"===a?(P(r,!0),F(r)):(R(r,"Forward-slash in opening tag not followed by >"),r.state=T.ATTRIB);continue;case T.ATTRIB:if(g(a))continue;">"===a?P(r):"/"===a?r.state=T.OPEN_TAG_SLASH:y(d,a)?(r.attribName=a,r.attribValue="",r.state=T.ATTRIB_NAME):R(r,"Invalid attribute name");continue;case T.ATTRIB_NAME:"="===a?r.state=T.ATTRIB_VALUE:">"===a?(R(r,"Attribute without value"),r.attribValue=r.attribName,M(r),P(r)):g(a)?r.state=T.ATTRIB_NAME_SAW_WHITE:y(h,a)?r.attribName+=a:R(r,"Invalid attribute name");continue;case T.ATTRIB_NAME_SAW_WHITE:if("="===a)r.state=T.ATTRIB_VALUE;else{if(g(a))continue;R(r,"Attribute without value"),r.tag.attributes[r.attribName]="",r.attribValue="",A(r,"onattribute",{name:r.attribName,value:""}),r.attribName="",">"===a?P(r):y(d,a)?(r.attribName=a,r.state=T.ATTRIB_NAME):(R(r,"Invalid attribute name"),r.state=T.ATTRIB)}continue;case T.ATTRIB_VALUE:if(g(a))continue;v(a)?(r.q=a,r.state=T.ATTRIB_VALUE_QUOTED):(R(r,"Unquoted attribute value"),r.state=T.ATTRIB_VALUE_UNQUOTED,r.attribValue=a);continue;case T.ATTRIB_VALUE_QUOTED:if(a!==r.q){"&"===a?r.state=T.ATTRIB_VALUE_ENTITY_Q:r.attribValue+=a;continue}M(r),r.q="",r.state=T.ATTRIB_VALUE_CLOSED;continue;case T.ATTRIB_VALUE_CLOSED:g(a)?r.state=T.ATTRIB:">"===a?P(r):"/"===a?r.state=T.OPEN_TAG_SLASH:y(d,a)?(R(r,"No whitespace between attributes"),r.attribName=a,r.attribValue="",r.state=T.ATTRIB_NAME):R(r,"Invalid attribute name");continue;case T.ATTRIB_VALUE_UNQUOTED:if(!m(a)){"&"===a?r.state=T.ATTRIB_VALUE_ENTITY_U:r.attribValue+=a;continue}M(r),">"===a?P(r):r.state=T.ATTRIB;continue;case T.CLOSE_TAG:if(r.tagName)">"===a?F(r):y(h,a)?r.tagName+=a:r.script?(r.script+="</"+r.tagName,r.tagName="",r.state=T.SCRIPT):(g(a)||R(r,"Invalid tagname in closing tag"),r.state=T.CLOSE_TAG_SAW_WHITE);else{if(g(a))continue;b(d,a)?r.script?(r.script+="</"+a,r.state=T.SCRIPT):R(r,"Invalid tagname in closing tag."):r.tagName=a}continue;case T.CLOSE_TAG_SAW_WHITE:if(g(a))continue;">"===a?F(r):R(r,"Invalid characters in closing tag");continue;case T.TEXT_ENTITY:case T.ATTRIB_VALUE_ENTITY_Q:case T.ATTRIB_VALUE_ENTITY_U:var l,u;switch(r.state){case T.TEXT_ENTITY:l=T.TEXT,u="textNode";break;case T.ATTRIB_VALUE_ENTITY_Q:l=T.ATTRIB_VALUE_QUOTED,u="attribValue";break;case T.ATTRIB_VALUE_ENTITY_U:l=T.ATTRIB_VALUE_UNQUOTED,u="attribValue"}";"===a?(r[u]+=N(r),r.entity="",r.state=l):y(r.entity.length?p:f,a)?r.entity+=a:(R(r,"Invalid character in entity name"),r[u]+="&"+r.entity+a,r.entity="",r.state=l);continue;default:throw new Error(r,"Unknown state: "+r.state)}return r.position>=r.bufferCheckPosition&&function(e){for(var r=Math.max(t.MAX_BUFFER_LENGTH,10),n=0,a=0,o=i.length;a<o;a++){var s=e[i[a]].length;if(s>r)switch(i[a]){case"textNode":k(e);break;case"cdata":A(e,"oncdata",e.cdata),e.cdata="";break;case"script":A(e,"onscript",e.script),e.script="";break;default:D(e,"Max buffer length exceeded: "+i[a])}n=Math.max(n,s)}var l=t.MAX_BUFFER_LENGTH-n;e.bufferCheckPosition=l+e.position}(r),r},resume:function(){return this.error=null,this},close:function(){return this.write(null)},flush:function(){var t;k(t=this),""!==t.cdata&&(A(t,"oncdata",t.cdata),t.cdata=""),""!==t.script&&(A(t,"onscript",t.script),t.script="")}};try{e=r(77794).Stream}catch(t){e=function(){}}var o=t.EVENTS.filter((function(t){return"error"!==t&&"end"!==t}));function s(t,r){if(!(this instanceof s))return new s(t,r);e.apply(this),this._parser=new a(t,r),this.writable=!0,this.readable=!0;var n=this;this._parser.onend=function(){n.emit("end")},this._parser.onerror=function(t){n.emit("error",t),n._parser.error=null},this._decoder=null,o.forEach((function(t){Object.defineProperty(n,"on"+t,{get:function(){return n._parser["on"+t]},set:function(e){if(!e)return n.removeAllListeners(t),n._parser["on"+t]=e,e;n.on(t,e)},enumerable:!0,configurable:!1})}))}s.prototype=Object.create(e.prototype,{constructor:{value:s}}),s.prototype.write=function(t){if("function"==typeof n&&"function"==typeof n.isBuffer&&n.isBuffer(t)){if(!this._decoder){var e=r(80956).s;this._decoder=new e("utf8")}t=this._decoder.write(t)}return this._parser.write(t.toString()),this.emit("data",t),!0},s.prototype.end=function(t){return t&&t.length&&this.write(t),this._parser.end(),!0},s.prototype.on=function(t,r){var n=this;return n._parser["on"+t]||-1===o.indexOf(t)||(n._parser["on"+t]=function(){var e=1===arguments.length?[arguments[0]]:Array.apply(null,arguments);e.splice(0,0,t),n.emit.apply(n,e)}),e.prototype.on.call(n,t,r)};var l="http://www.w3.org/XML/1998/namespace",u="http://www.w3.org/2000/xmlns/",c={xml:l,xmlns:u},d=/[:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]/,h=/[:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\u00B7\u0300-\u036F\u203F-\u2040.\d-]/,f=/[#:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]/,p=/[#:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\u00B7\u0300-\u036F\u203F-\u2040.\d-]/;function g(t){return" "===t||"\n"===t||"\r"===t||"\t"===t}function v(t){return'"'===t||"'"===t}function m(t){return">"===t||g(t)}function y(t,e){return t.test(e)}function b(t,e){return!y(t,e)}var E,x,S,T=0;for(var w in t.STATE={BEGIN:T++,BEGIN_WHITESPACE:T++,TEXT:T++,TEXT_ENTITY:T++,OPEN_WAKA:T++,SGML_DECL:T++,SGML_DECL_QUOTED:T++,DOCTYPE:T++,DOCTYPE_QUOTED:T++,DOCTYPE_DTD:T++,DOCTYPE_DTD_QUOTED:T++,COMMENT_STARTING:T++,COMMENT:T++,COMMENT_ENDING:T++,COMMENT_ENDED:T++,CDATA:T++,CDATA_ENDING:T++,CDATA_ENDING_2:T++,PROC_INST:T++,PROC_INST_BODY:T++,PROC_INST_ENDING:T++,OPEN_TAG:T++,OPEN_TAG_SLASH:T++,ATTRIB:T++,ATTRIB_NAME:T++,ATTRIB_NAME_SAW_WHITE:T++,ATTRIB_VALUE:T++,ATTRIB_VALUE_QUOTED:T++,ATTRIB_VALUE_CLOSED:T++,ATTRIB_VALUE_UNQUOTED:T++,ATTRIB_VALUE_ENTITY_Q:T++,ATTRIB_VALUE_ENTITY_U:T++,CLOSE_TAG:T++,CLOSE_TAG_SAW_WHITE:T++,SCRIPT:T++,SCRIPT_ENDING:T++},t.XML_ENTITIES={amp:"&",gt:">",lt:"<",quot:'"',apos:"'"},t.ENTITIES={amp:"&",gt:">",lt:"<",quot:'"',apos:"'",AElig:198,Aacute:193,Acirc:194,Agrave:192,Aring:197,Atilde:195,Auml:196,Ccedil:199,ETH:208,Eacute:201,Ecirc:202,Egrave:200,Euml:203,Iacute:205,Icirc:206,Igrave:204,Iuml:207,Ntilde:209,Oacute:211,Ocirc:212,Ograve:210,Oslash:216,Otilde:213,Ouml:214,THORN:222,Uacute:218,Ucirc:219,Ugrave:217,Uuml:220,Yacute:221,aacute:225,acirc:226,aelig:230,agrave:224,aring:229,atilde:227,auml:228,ccedil:231,eacute:233,ecirc:234,egrave:232,eth:240,euml:235,iacute:237,icirc:238,igrave:236,iuml:239,ntilde:241,oacute:243,ocirc:244,ograve:242,oslash:248,otilde:245,ouml:246,szlig:223,thorn:254,uacute:250,ucirc:251,ugrave:249,uuml:252,yacute:253,yuml:255,copy:169,reg:174,nbsp:160,iexcl:161,cent:162,pound:163,curren:164,yen:165,brvbar:166,sect:167,uml:168,ordf:170,laquo:171,not:172,shy:173,macr:175,deg:176,plusmn:177,sup1:185,sup2:178,sup3:179,acute:180,micro:181,para:182,middot:183,cedil:184,ordm:186,raquo:187,frac14:188,frac12:189,frac34:190,iquest:191,times:215,divide:247,OElig:338,oelig:339,Scaron:352,scaron:353,Yuml:376,fnof:402,circ:710,tilde:732,Alpha:913,Beta:914,Gamma:915,Delta:916,Epsilon:917,Zeta:918,Eta:919,Theta:920,Iota:921,Kappa:922,Lambda:923,Mu:924,Nu:925,Xi:926,Omicron:927,Pi:928,Rho:929,Sigma:931,Tau:932,Upsilon:933,Phi:934,Chi:935,Psi:936,Omega:937,alpha:945,beta:946,gamma:947,delta:948,epsilon:949,zeta:950,eta:951,theta:952,iota:953,kappa:954,lambda:955,mu:956,nu:957,xi:958,omicron:959,pi:960,rho:961,sigmaf:962,sigma:963,tau:964,upsilon:965,phi:966,chi:967,psi:968,omega:969,thetasym:977,upsih:978,piv:982,ensp:8194,emsp:8195,thinsp:8201,zwnj:8204,zwj:8205,lrm:8206,rlm:8207,ndash:8211,mdash:8212,lsquo:8216,rsquo:8217,sbquo:8218,ldquo:8220,rdquo:8221,bdquo:8222,dagger:8224,Dagger:8225,bull:8226,hellip:8230,permil:8240,prime:8242,Prime:8243,lsaquo:8249,rsaquo:8250,oline:8254,frasl:8260,euro:8364,image:8465,weierp:8472,real:8476,trade:8482,alefsym:8501,larr:8592,uarr:8593,rarr:8594,darr:8595,harr:8596,crarr:8629,lArr:8656,uArr:8657,rArr:8658,dArr:8659,hArr:8660,forall:8704,part:8706,exist:8707,empty:8709,nabla:8711,isin:8712,notin:8713,ni:8715,prod:8719,sum:8721,minus:8722,lowast:8727,radic:8730,prop:8733,infin:8734,ang:8736,and:8743,or:8744,cap:8745,cup:8746,int:8747,there4:8756,sim:8764,cong:8773,asymp:8776,ne:8800,equiv:8801,le:8804,ge:8805,sub:8834,sup:8835,nsub:8836,sube:8838,supe:8839,oplus:8853,otimes:8855,perp:8869,sdot:8901,lceil:8968,rceil:8969,lfloor:8970,rfloor:8971,lang:9001,rang:9002,loz:9674,spades:9824,clubs:9827,hearts:9829,diams:9830},Object.keys(t.ENTITIES).forEach((function(e){var r=t.ENTITIES[e],n="number"==typeof r?String.fromCharCode(r):r;t.ENTITIES[e]=n})),t.STATE)t.STATE[t.STATE[w]]=w;function _(t,e,r){t[e]&&t[e](r)}function A(t,e,r){t.textNode&&k(t),_(t,e,r)}function k(t){t.textNode=C(t.opt,t.textNode),t.textNode&&_(t,"ontext",t.textNode),t.textNode=""}function C(t,e){return t.trim&&(e=e.trim()),t.normalize&&(e=e.replace(/\s+/g," ")),e}function D(t,e){return k(t),t.trackPosition&&(e+="\nLine: "+t.line+"\nColumn: "+t.column+"\nChar: "+t.c),e=new Error(e),t.error=e,_(t,"onerror",e),t}function L(t){return t.sawRoot&&!t.closedRoot&&R(t,"Unclosed root tag"),t.state!==T.BEGIN&&t.state!==T.BEGIN_WHITESPACE&&t.state!==T.TEXT&&D(t,"Unexpected end"),k(t),t.c="",t.closed=!0,_(t,"onend"),a.call(t,t.strict,t.opt),t}function R(t,e){if("object"!=typeof t||!(t instanceof a))throw new Error("bad call to strictFail");t.strict&&D(t,e)}function I(t){t.strict||(t.tagName=t.tagName[t.looseCase]());var e=t.tags[t.tags.length-1]||t,r=t.tag={name:t.tagName,attributes:{}};t.opt.xmlns&&(r.ns=e.ns),t.attribList.length=0,A(t,"onopentagstart",r)}function O(t,e){var r=t.indexOf(":")<0?["",t]:t.split(":"),n=r[0],i=r[1];return e&&"xmlns"===t&&(n="xmlns",i=""),{prefix:n,local:i}}function M(t){if(t.strict||(t.attribName=t.attribName[t.looseCase]()),-1!==t.attribList.indexOf(t.attribName)||t.tag.attributes.hasOwnProperty(t.attribName))t.attribName=t.attribValue="";else{if(t.opt.xmlns){var e=O(t.attribName,!0),r=e.prefix,n=e.local;if("xmlns"===r)if("xml"===n&&t.attribValue!==l)R(t,"xml: prefix must be bound to "+l+"\nActual: "+t.attribValue);else if("xmlns"===n&&t.attribValue!==u)R(t,"xmlns: prefix must be bound to "+u+"\nActual: "+t.attribValue);else{var i=t.tag,a=t.tags[t.tags.length-1]||t;i.ns===a.ns&&(i.ns=Object.create(a.ns)),i.ns[n]=t.attribValue}t.attribList.push([t.attribName,t.attribValue])}else t.tag.attributes[t.attribName]=t.attribValue,A(t,"onattribute",{name:t.attribName,value:t.attribValue});t.attribName=t.attribValue=""}}function P(t,e){if(t.opt.xmlns){var r=t.tag,n=O(t.tagName);r.prefix=n.prefix,r.local=n.local,r.uri=r.ns[n.prefix]||"",r.prefix&&!r.uri&&(R(t,"Unbound namespace prefix: "+JSON.stringify(t.tagName)),r.uri=n.prefix);var i=t.tags[t.tags.length-1]||t;r.ns&&i.ns!==r.ns&&Object.keys(r.ns).forEach((function(e){A(t,"onopennamespace",{prefix:e,uri:r.ns[e]})}));for(var a=0,o=t.attribList.length;a<o;a++){var s=t.attribList[a],l=s[0],u=s[1],c=O(l,!0),d=c.prefix,h=c.local,f=""===d?"":r.ns[d]||"",p={name:l,value:u,prefix:d,local:h,uri:f};d&&"xmlns"!==d&&!f&&(R(t,"Unbound namespace prefix: "+JSON.stringify(d)),p.uri=d),t.tag.attributes[l]=p,A(t,"onattribute",p)}t.attribList.length=0}t.tag.isSelfClosing=!!e,t.sawRoot=!0,t.tags.push(t.tag),A(t,"onopentag",t.tag),e||(t.noscript||"script"!==t.tagName.toLowerCase()?t.state=T.TEXT:t.state=T.SCRIPT,t.tag=null,t.tagName=""),t.attribName=t.attribValue="",t.attribList.length=0}function F(t){if(!t.tagName)return R(t,"Weird empty close tag."),t.textNode+="</>",void(t.state=T.TEXT);if(t.script){if("script"!==t.tagName)return t.script+="</"+t.tagName+">",t.tagName="",void(t.state=T.SCRIPT);A(t,"onscript",t.script),t.script=""}var e=t.tags.length,r=t.tagName;t.strict||(r=r[t.looseCase]());for(var n=r;e--&&t.tags[e].name!==n;)R(t,"Unexpected close tag");if(e<0)return R(t,"Unmatched closing tag: "+t.tagName),t.textNode+="</"+t.tagName+">",void(t.state=T.TEXT);t.tagName=r;for(var i=t.tags.length;i-- >e;){var a=t.tag=t.tags.pop();t.tagName=t.tag.name,A(t,"onclosetag",t.tagName);var o={};for(var s in a.ns)o[s]=a.ns[s];var l=t.tags[t.tags.length-1]||t;t.opt.xmlns&&a.ns!==l.ns&&Object.keys(a.ns).forEach((function(e){var r=a.ns[e];A(t,"onclosenamespace",{prefix:e,uri:r})}))}0===e&&(t.closedRoot=!0),t.tagName=t.attribValue=t.attribName="",t.attribList.length=0,t.state=T.TEXT}function N(t){var e,r=t.entity,n=r.toLowerCase(),i="";return t.ENTITIES[r]?t.ENTITIES[r]:t.ENTITIES[n]?t.ENTITIES[n]:("#"===(r=n).charAt(0)&&("x"===r.charAt(1)?(r=r.slice(2),i=(e=parseInt(r,16)).toString(16)):(r=r.slice(1),i=(e=parseInt(r,10)).toString(10))),r=r.replace(/^0+/,""),isNaN(e)||i.toLowerCase()!==r?(R(t,"Invalid character entity"),"&"+t.entity+";"):String.fromCodePoint(e))}function B(t,e){"<"===e?(t.state=T.OPEN_WAKA,t.startTagPosition=t.position):g(e)||(R(t,"Non-whitespace before first tag."),t.textNode=e,t.state=T.TEXT)}function U(t,e){var r="";return e<t.length&&(r=t.charAt(e)),r}T=t.STATE,String.fromCodePoint||(E=String.fromCharCode,x=Math.floor,S=function(){var t,e,r=16384,n=[],i=-1,a=arguments.length;if(!a)return"";for(var o="";++i<a;){var s=Number(arguments[i]);if(!isFinite(s)||s<0||s>1114111||x(s)!==s)throw RangeError("Invalid code point: "+s);s<=65535?n.push(s):(t=55296+((s-=65536)>>10),e=s%1024+56320,n.push(t,e)),(i+1===a||n.length>r)&&(o+=E.apply(null,n),n.length=0)}return o},Object.defineProperty?Object.defineProperty(String,"fromCodePoint",{value:S,configurable:!0,writable:!0}):String.fromCodePoint=S)}(e)},77794:(t,e,r)=>{t.exports=i;var n=r(15842).EventEmitter;function i(){n.call(this)}r(23128)(i,n),i.Readable=r(55324),i.Writable=r(30799),i.Duplex=r(88608),i.Transform=r(25430),i.PassThrough=r(64584),i.finished=r(7586),i.pipeline=r(76590),i.Stream=i,i.prototype.pipe=function(t,e){var r=this;function i(e){t.writable&&!1===t.write(e)&&r.pause&&r.pause()}function a(){r.readable&&r.resume&&r.resume()}r.on("data",i),t.on("drain",a),t._isStdio||e&&!1===e.end||(r.on("end",s),r.on("close",l));var o=!1;function s(){o||(o=!0,t.end())}function l(){o||(o=!0,"function"==typeof t.destroy&&t.destroy())}function u(t){if(c(),0===n.listenerCount(this,"error"))throw t}function c(){r.removeListener("data",i),t.removeListener("drain",a),r.removeListener("end",s),r.removeListener("close",l),r.removeListener("error",u),t.removeListener("error",u),r.removeListener("end",c),r.removeListener("close",c),t.removeListener("close",c)}return r.on("error",u),t.on("error",u),r.on("end",c),r.on("close",c),t.on("close",c),t.emit("pipe",r),t}},80956:(t,e,r)=>{var n=r(47103).Buffer,i=n.isEncoding||function(t){switch(t&&t.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}},a=e.s=function(t){switch(this.encoding=(t||"utf8").toLowerCase().replace(/[-_]/,""),function(t){if(t&&!i(t))throw new Error("Unknown encoding: "+t)}(t),this.encoding){case"utf8":this.surrogateSize=3;break;case"ucs2":case"utf16le":this.surrogateSize=2,this.detectIncompleteChar=s;break;case"base64":this.surrogateSize=3,this.detectIncompleteChar=l;break;default:return void(this.write=o)}this.charBuffer=new n(6),this.charReceived=0,this.charLength=0};function o(t){return t.toString(this.encoding)}function s(t){this.charReceived=t.length%2,this.charLength=this.charReceived?2:0}function l(t){this.charReceived=t.length%3,this.charLength=this.charReceived?3:0}a.prototype.write=function(t){for(var e="";this.charLength;){var r=t.length>=this.charLength-this.charReceived?this.charLength-this.charReceived:t.length;if(t.copy(this.charBuffer,this.charReceived,0,r),this.charReceived+=r,this.charReceived<this.charLength)return"";if(t=t.slice(r,t.length),!((n=(e=this.charBuffer.slice(0,this.charLength).toString(this.encoding)).charCodeAt(e.length-1))>=55296&&n<=56319)){if(this.charReceived=this.charLength=0,0===t.length)return e;break}this.charLength+=this.surrogateSize,e=""}this.detectIncompleteChar(t);var n,i=t.length;if(this.charLength&&(t.copy(this.charBuffer,0,t.length-this.charReceived,i),i-=this.charReceived),i=(e+=t.toString(this.encoding,0,i)).length-1,(n=e.charCodeAt(i))>=55296&&n<=56319){var a=this.surrogateSize;return this.charLength+=a,this.charReceived+=a,this.charBuffer.copy(this.charBuffer,a,0,a),t.copy(this.charBuffer,0,0,a),e.substring(0,i)}return e},a.prototype.detectIncompleteChar=function(t){for(var e=t.length>=3?3:t.length;e>0;e--){var r=t[t.length-e];if(1==e&&r>>5==6){this.charLength=2;break}if(e<=2&&r>>4==14){this.charLength=3;break}if(e<=3&&r>>3==30){this.charLength=4;break}}this.charReceived=e},a.prototype.end=function(t){var e="";if(t&&t.length&&(e=this.write(t)),this.charReceived){var r=this.charReceived,n=this.charBuffer,i=this.encoding;e+=n.slice(0,r).toString(i)}return e}},14655:(t,e,r)=>{var n=r(51266);function i(t){try{if(!r.g.localStorage)return!1}catch(t){return!1}var e=r.g.localStorage[t];return null!=e&&"true"===String(e).toLowerCase()}t.exports=function(t,e){if(i("noDeprecation"))return t;var r=!1;return function(){if(!r){if(i("throwDeprecation"))throw new Error(e);i("traceDeprecation")?n.trace(e):n.warn(e),r=!0}return t.apply(this,arguments)}}},72866:(t,e,r)=>{var n,i,a=r(51266);i={},function(t,e){function r(){this._delay=0,this._endDelay=0,this._fill="none",this._iterationStart=0,this._iterations=1,this._duration=0,this._playbackRate=1,this._direction="normal",this._easing="linear",this._easingFunction=h}function n(){return t.isDeprecated("Invalid timing inputs","2016-03-02","TypeError exceptions will be thrown instead.",!0)}function i(e,n,i){var a=new r;return n&&(a.fill="both",a.duration="auto"),"number"!=typeof e||isNaN(e)?void 0!==e&&Object.getOwnPropertyNames(e).forEach((function(r){if("auto"!=e[r]){if(("number"==typeof a[r]||"duration"==r)&&("number"!=typeof e[r]||isNaN(e[r])))return;if("fill"==r&&-1==c.indexOf(e[r]))return;if("direction"==r&&-1==d.indexOf(e[r]))return;if("playbackRate"==r&&1!==e[r]&&t.isDeprecated("AnimationEffectTiming.playbackRate","2014-11-28","Use Animation.playbackRate instead."))return;a[r]=e[r]}})):a.duration=e,a}function a(t,e,r,n){return t<0||t>1||r<0||r>1?h:function(i){function a(t,e,r){return 3*t*(1-r)*(1-r)*r+3*e*(1-r)*r*r+r*r*r}if(i<=0){var o=0;return t>0?o=e/t:!e&&r>0&&(o=n/r),o*i}if(i>=1){var s=0;return r<1?s=(n-1)/(r-1):1==r&&t<1&&(s=(e-1)/(t-1)),1+s*(i-1)}for(var l=0,u=1;l<u;){var c=(l+u)/2,d=a(t,r,c);if(Math.abs(i-d)<1e-5)return a(e,n,c);d<i?l=c:u=c}return a(e,n,c)}}function o(t,e){return function(r){if(r>=1)return 1;var n=1/t;return(r+=e*n)-r%n}}function s(t){m||(m=document.createElement("div").style),m.animationTimingFunction="",m.animationTimingFunction=t;var e=m.animationTimingFunction;if(""==e&&n())throw new TypeError(t+" is not a valid value for easing");return e}function l(t){if("linear"==t)return h;var e=b.exec(t);if(e)return a.apply(this,e.slice(1).map(Number));var r=E.exec(t);if(r)return o(Number(r[1]),g);var n=x.exec(t);return n?o(Number(n[1]),{start:f,middle:p,end:g}[n[2]]):v[t]||h}function u(t,e,r){if(null==e)return S;var n=r.delay+t+r.endDelay;return e<Math.min(r.delay,n)?T:e>=Math.min(r.delay+t,n)?w:_}var c="backwards|forwards|both|none".split("|"),d="reverse|alternate|alternate-reverse".split("|"),h=function(t){return t};r.prototype={_setMember:function(e,r){this["_"+e]=r,this._effect&&(this._effect._timingInput[e]=r,this._effect._timing=t.normalizeTimingInput(this._effect._timingInput),this._effect.activeDuration=t.calculateActiveDuration(this._effect._timing),this._effect._animation&&this._effect._animation._rebuildUnderlyingAnimation())},get playbackRate(){return this._playbackRate},set delay(t){this._setMember("delay",t)},get delay(){return this._delay},set endDelay(t){this._setMember("endDelay",t)},get endDelay(){return this._endDelay},set fill(t){this._setMember("fill",t)},get fill(){return this._fill},set iterationStart(t){if((isNaN(t)||t<0)&&n())throw new TypeError("iterationStart must be a non-negative number, received: "+t);this._setMember("iterationStart",t)},get iterationStart(){return this._iterationStart},set duration(t){if("auto"!=t&&(isNaN(t)||t<0)&&n())throw new TypeError("duration must be non-negative or auto, received: "+t);this._setMember("duration",t)},get duration(){return this._duration},set direction(t){this._setMember("direction",t)},get direction(){return this._direction},set easing(t){this._easingFunction=l(s(t)),this._setMember("easing",t)},get easing(){return this._easing},set iterations(t){if((isNaN(t)||t<0)&&n())throw new TypeError("iterations must be non-negative, received: "+t);this._setMember("iterations",t)},get iterations(){return this._iterations}};var f=1,p=.5,g=0,v={ease:a(.25,.1,.25,1),"ease-in":a(.42,0,1,1),"ease-out":a(0,0,.58,1),"ease-in-out":a(.42,0,.58,1),"step-start":o(1,f),"step-middle":o(1,p),"step-end":o(1,g)},m=null,y="\\s*(-?\\d+\\.?\\d*|-?\\.\\d+)\\s*",b=new RegExp("cubic-bezier\\("+y+","+y+","+y+","+y+"\\)"),E=/steps\(\s*(\d+)\s*\)/,x=/steps\(\s*(\d+)\s*,\s*(start|middle|end)\s*\)/,S=0,T=1,w=2,_=3;t.cloneTimingInput=function(t){if("number"==typeof t)return t;var e={};for(var r in t)e[r]=t[r];return e},t.makeTiming=i,t.numericTimingToObject=function(t){return"number"==typeof t&&(t=isNaN(t)?{duration:0}:{duration:t}),t},t.normalizeTimingInput=function(e,r){return i(e=t.numericTimingToObject(e),r)},t.calculateActiveDuration=function(t){return Math.abs(function(t){return 0===t.duration||0===t.iterations?0:t.duration*t.iterations}(t)/t.playbackRate)},t.calculateIterationProgress=function(t,e,r){var n=u(t,e,r),i=function(t,e,r,n,i){switch(n){case T:return"backwards"==e||"both"==e?0:null;case _:return r-i;case w:return"forwards"==e||"both"==e?t:null;case S:return null}}(t,r.fill,e,n,r.delay);if(null===i)return null;var a=function(t,e,r,n,i){var a=i;return 0===t?e!==T&&(a+=r):a+=n/t,a}(r.duration,n,r.iterations,i,r.iterationStart),o=function(t,e,r,n,i,a){var o=t===1/0?e%1:t%1;return 0!==o||r!==w||0===n||0===i&&0!==a||(o=1),o}(a,r.iterationStart,n,r.iterations,i,r.duration),s=function(t,e,r,n){return t===w&&e===1/0?1/0:1===r?Math.floor(n)-1:Math.floor(n)}(n,r.iterations,o,a),l=function(t,e,r){var n=t;if("normal"!==t&&"reverse"!==t){var i=e;"alternate-reverse"===t&&(i+=1),n="normal",i!==1/0&&i%2!=0&&(n="reverse")}return"normal"===n?r:1-r}(r.direction,s,o);return r._easingFunction(l)},t.calculatePhase=u,t.normalizeEasing=s,t.parseEasingFunction=l}(n={}),function(t,e){function r(t,e){return t in l&&l[t][e]||e}function n(t,e,n){if(!function(t){return"display"===t||0===t.lastIndexOf("animation",0)||0===t.lastIndexOf("transition",0)}(t)){var i=a[t];if(i)for(var s in o.style[t]=e,i){var l=i[s],u=o.style[l];n[l]=r(l,u)}else n[t]=r(t,e)}}function i(t){var e=[];for(var r in t)if(!(r in["easing","offset","composite"])){var n=t[r];Array.isArray(n)||(n=[n]);for(var i,a=n.length,o=0;o<a;o++)(i={}).offset="offset"in t?t.offset:1==a?1:o/(a-1),"easing"in t&&(i.easing=t.easing),"composite"in t&&(i.composite=t.composite),i[r]=n[o],e.push(i)}return e.sort((function(t,e){return t.offset-e.offset})),e}var a={background:["backgroundImage","backgroundPosition","backgroundSize","backgroundRepeat","backgroundAttachment","backgroundOrigin","backgroundClip","backgroundColor"],border:["borderTopColor","borderTopStyle","borderTopWidth","borderRightColor","borderRightStyle","borderRightWidth","borderBottomColor","borderBottomStyle","borderBottomWidth","borderLeftColor","borderLeftStyle","borderLeftWidth"],borderBottom:["borderBottomWidth","borderBottomStyle","borderBottomColor"],borderColor:["borderTopColor","borderRightColor","borderBottomColor","borderLeftColor"],borderLeft:["borderLeftWidth","borderLeftStyle","borderLeftColor"],borderRadius:["borderTopLeftRadius","borderTopRightRadius","borderBottomRightRadius","borderBottomLeftRadius"],borderRight:["borderRightWidth","borderRightStyle","borderRightColor"],borderTop:["borderTopWidth","borderTopStyle","borderTopColor"],borderWidth:["borderTopWidth","borderRightWidth","borderBottomWidth","borderLeftWidth"],flex:["flexGrow","flexShrink","flexBasis"],font:["fontFamily","fontSize","fontStyle","fontVariant","fontWeight","lineHeight"],margin:["marginTop","marginRight","marginBottom","marginLeft"],outline:["outlineColor","outlineStyle","outlineWidth"],padding:["paddingTop","paddingRight","paddingBottom","paddingLeft"]},o=document.createElementNS("http://www.w3.org/1999/xhtml","div"),s={thin:"1px",medium:"3px",thick:"5px"},l={borderBottomWidth:s,borderLeftWidth:s,borderRightWidth:s,borderTopWidth:s,fontSize:{"xx-small":"60%","x-small":"75%",small:"89%",medium:"100%",large:"120%","x-large":"150%","xx-large":"200%"},fontWeight:{normal:"400",bold:"700"},outlineWidth:s,textShadow:{none:"0px 0px 0px transparent"},boxShadow:{none:"0px 0px 0px 0px transparent"}};t.convertToArrayForm=i,t.normalizeKeyframes=function(e){if(null==e)return[];window.Symbol&&Symbol.iterator&&Array.prototype.from&&e[Symbol.iterator]&&(e=Array.from(e)),Array.isArray(e)||(e=i(e));for(var r=e.map((function(e){var r={};for(var i in e){var a=e[i];if("offset"==i){if(null!=a){if(a=Number(a),!isFinite(a))throw new TypeError("Keyframe offsets must be numbers.");if(a<0||a>1)throw new TypeError("Keyframe offsets must be between 0 and 1.")}}else if("composite"==i){if("add"==a||"accumulate"==a)throw{type:DOMException.NOT_SUPPORTED_ERR,name:"NotSupportedError",message:"add compositing is not supported"};if("replace"!=a)throw new TypeError("Invalid composite mode "+a+".")}else a="easing"==i?t.normalizeEasing(a):""+a;n(i,a,r)}return null==r.offset&&(r.offset=null),null==r.easing&&(r.easing="linear"),r})),a=!0,o=-1/0,s=0;s<r.length;s++){var l=r[s].offset;if(null!=l){if(l<o)throw new TypeError("Keyframes are not loosely sorted by offset. Sort or specify offsets.");o=l}else a=!1}return r=r.filter((function(t){return t.offset>=0&&t.offset<=1})),a||function(){var t=r.length;null==r[t-1].offset&&(r[t-1].offset=1),t>1&&null==r[0].offset&&(r[0].offset=0);for(var e=0,n=r[0].offset,i=1;i<t;i++){var a=r[i].offset;if(null!=a){for(var o=1;o<i-e;o++)r[e+o].offset=n+(a-n)*o/(i-e);e=i,n=a}}}(),r}}(n),function(t){var e={};t.isDeprecated=function(t,r,n,i){var o=i?"are":"is",s=new Date,l=new Date(r);return l.setMonth(l.getMonth()+3),!(s<l&&(t in e||a.warn("Web Animations: "+t+" "+o+" deprecated and will stop working on "+l.toDateString()+". "+n),e[t]=!0,1))},t.deprecated=function(e,r,n,i){var a=i?"are":"is";if(t.isDeprecated(e,r,n,i))throw new Error(e+" "+a+" no longer supported. "+n)}}(n),function(){if(document.documentElement.animate){var t=document.documentElement.animate([],0),e=!0;if(t&&(e=!1,"play|currentTime|pause|reverse|playbackRate|cancel|finish|startTime|playState".split("|").forEach((function(r){void 0===t[r]&&(e=!0)}))),!e)return}!function(t,e,r){e.convertEffectInput=function(r){var n=function(t){for(var e={},r=0;r<t.length;r++)for(var n in t[r])if("offset"!=n&&"easing"!=n&&"composite"!=n){var i={offset:t[r].offset,easing:t[r].easing,value:t[r][n]};e[n]=e[n]||[],e[n].push(i)}for(var a in e){var o=e[a];if(0!=o[0].offset||1!=o[o.length-1].offset)throw{type:DOMException.NOT_SUPPORTED_ERR,name:"NotSupportedError",message:"Partial keyframes are not supported"}}return e}(t.normalizeKeyframes(r)),i=function(r){var n=[];for(var i in r)for(var a=r[i],o=0;o<a.length-1;o++){var s=o,l=o+1,u=a[s].offset,c=a[l].offset,d=u,h=c;0==o&&(d=-1/0,0==c&&(l=s)),o==a.length-2&&(h=1/0,1==u&&(s=l)),n.push({applyFrom:d,applyTo:h,startOffset:a[s].offset,endOffset:a[l].offset,easingFunction:t.parseEasingFunction(a[s].easing),property:i,interpolation:e.propertyInterpolation(i,a[s].value,a[l].value)})}return n.sort((function(t,e){return t.startOffset-e.startOffset})),n}(n);return function(t,r){if(null!=r)i.filter((function(t){return r>=t.applyFrom&&r<t.applyTo})).forEach((function(n){var i=r-n.startOffset,a=n.endOffset-n.startOffset,o=0==a?0:n.easingFunction(i/a);e.apply(t,n.property,n.interpolation(o))}));else for(var a in n)"offset"!=a&&"easing"!=a&&"composite"!=a&&e.clear(t,a)}}}(n,i),function(t,e,r){function n(t){return t.replace(/-(.)/g,(function(t,e){return e.toUpperCase()}))}function i(t,e,r){a[r]=a[r]||[],a[r].push([t,e])}var a={};e.addPropertiesHandler=function(t,e,r){for(var a=0;a<r.length;a++)i(t,e,n(r[a]))};var o={backgroundColor:"transparent",backgroundPosition:"0% 0%",borderBottomColor:"currentColor",borderBottomLeftRadius:"0px",borderBottomRightRadius:"0px",borderBottomWidth:"3px",borderLeftColor:"currentColor",borderLeftWidth:"3px",borderRightColor:"currentColor",borderRightWidth:"3px",borderSpacing:"2px",borderTopColor:"currentColor",borderTopLeftRadius:"0px",borderTopRightRadius:"0px",borderTopWidth:"3px",bottom:"auto",clip:"rect(0px, 0px, 0px, 0px)",color:"black",fontSize:"100%",fontWeight:"400",height:"auto",left:"auto",letterSpacing:"normal",lineHeight:"120%",marginBottom:"0px",marginLeft:"0px",marginRight:"0px",marginTop:"0px",maxHeight:"none",maxWidth:"none",minHeight:"0px",minWidth:"0px",opacity:"1.0",outlineColor:"invert",outlineOffset:"0px",outlineWidth:"3px",paddingBottom:"0px",paddingLeft:"0px",paddingRight:"0px",paddingTop:"0px",right:"auto",strokeDasharray:"none",strokeDashoffset:"0px",textIndent:"0px",textShadow:"0px 0px 0px transparent",top:"auto",transform:"",verticalAlign:"0px",visibility:"visible",width:"auto",wordSpacing:"normal",zIndex:"auto"};e.propertyInterpolation=function(r,i,s){var l=r;/-/.test(r)&&!t.isDeprecated("Hyphenated property names","2016-03-22","Use camelCase instead.",!0)&&(l=n(r)),"initial"!=i&&"initial"!=s||("initial"==i&&(i=o[l]),"initial"==s&&(s=o[l]));for(var u=i==s?[]:a[l],c=0;u&&c<u.length;c++){var d=u[c][0](i),h=u[c][0](s);if(void 0!==d&&void 0!==h){var f=u[c][1](d,h);if(f){var p=e.Interpolation.apply(null,f);return function(t){return 0==t?i:1==t?s:p(t)}}}}return e.Interpolation(!1,!0,(function(t){return t?s:i}))}}(n,i),function(t,e,r){e.KeyframeEffect=function(r,n,i,a){var o,s=function(e){var r=t.calculateActiveDuration(e),n=function(n){return t.calculateIterationProgress(r,n,e)};return n._totalDuration=e.delay+r+e.endDelay,n}(t.normalizeTimingInput(i)),l=e.convertEffectInput(n),u=function(){l(r,o)};return u._update=function(t){return null!==(o=s(t))},u._clear=function(){l(r,null)},u._hasSameTarget=function(t){return r===t},u._target=r,u._totalDuration=s._totalDuration,u._id=a,u}}(n,i),function(t,e){function r(t,e,r){r.enumerable=!0,r.configurable=!0,Object.defineProperty(t,e,r)}function n(t){this._element=t,this._surrogateStyle=document.createElementNS("http://www.w3.org/1999/xhtml","div").style,this._style=t.style,this._length=0,this._isAnimatedProperty={},this._updateSvgTransformAttr=function(t,e){return!(!e.namespaceURI||-1==e.namespaceURI.indexOf("/svg"))&&(a in t||(t[a]=/Trident|MSIE|IEMobile|Edge|Android 4/i.test(t.navigator.userAgent)),t[a])}(window,t),this._savedTransformAttr=null;for(var e=0;e<this._style.length;e++){var r=this._style[e];this._surrogateStyle[r]=this._style[r]}this._updateIndices()}function i(t){if(!t._webAnimationsPatchedStyle){var e=new n(t);try{r(t,"style",{get:function(){return e}})}catch(e){t.style._set=function(e,r){t.style[e]=r},t.style._clear=function(e){t.style[e]=""}}t._webAnimationsPatchedStyle=t.style}}var a="_webAnimationsUpdateSvgTransformAttr",o={cssText:1,length:1,parentRule:1},s={getPropertyCSSValue:1,getPropertyPriority:1,getPropertyValue:1,item:1,removeProperty:1,setProperty:1},l={removeProperty:1,setProperty:1};for(var u in n.prototype={get cssText(){return this._surrogateStyle.cssText},set cssText(t){for(var e={},r=0;r<this._surrogateStyle.length;r++)e[this._surrogateStyle[r]]=!0;for(this._surrogateStyle.cssText=t,this._updateIndices(),r=0;r<this._surrogateStyle.length;r++)e[this._surrogateStyle[r]]=!0;for(var n in e)this._isAnimatedProperty[n]||this._style.setProperty(n,this._surrogateStyle.getPropertyValue(n))},get length(){return this._surrogateStyle.length},get parentRule(){return this._style.parentRule},_updateIndices:function(){for(;this._length<this._surrogateStyle.length;)Object.defineProperty(this,this._length,{configurable:!0,enumerable:!1,get:function(t){return function(){return this._surrogateStyle[t]}}(this._length)}),this._length++;for(;this._length>this._surrogateStyle.length;)this._length--,Object.defineProperty(this,this._length,{configurable:!0,enumerable:!1,value:void 0})},_set:function(e,r){this._style[e]=r,this._isAnimatedProperty[e]=!0,this._updateSvgTransformAttr&&"transform"==t.unprefixedPropertyName(e)&&(null==this._savedTransformAttr&&(this._savedTransformAttr=this._element.getAttribute("transform")),this._element.setAttribute("transform",t.transformToSvgMatrix(r)))},_clear:function(e){this._style[e]=this._surrogateStyle[e],this._updateSvgTransformAttr&&"transform"==t.unprefixedPropertyName(e)&&(this._savedTransformAttr?this._element.setAttribute("transform",this._savedTransformAttr):this._element.removeAttribute("transform"),this._savedTransformAttr=null),delete this._isAnimatedProperty[e]}},s)n.prototype[u]=function(t,e){return function(){var r=this._surrogateStyle[t].apply(this._surrogateStyle,arguments);return e&&(this._isAnimatedProperty[arguments[0]]||this._style[t].apply(this._style,arguments),this._updateIndices()),r}}(u,u in l);for(var c in document.documentElement.style)c in o||c in s||function(t){r(n.prototype,t,{get:function(){return this._surrogateStyle[t]},set:function(e){this._surrogateStyle[t]=e,this._updateIndices(),this._isAnimatedProperty[t]||(this._style[t]=e)}})}(c);t.apply=function(e,r,n){i(e),e.style._set(t.propertyName(r),n)},t.clear=function(e,r){e._webAnimationsPatchedStyle&&e.style._clear(t.propertyName(r))}}(i),function(t){window.Element.prototype.animate=function(e,r){var n="";return r&&r.id&&(n=r.id),t.timeline._play(t.KeyframeEffect(this,e,r,n))}}(i),function(t,e){function r(t,e,n){if("number"==typeof t&&"number"==typeof e)return t*(1-n)+e*n;if("boolean"==typeof t&&"boolean"==typeof e)return n<.5?t:e;if(t.length==e.length){for(var i=[],a=0;a<t.length;a++)i.push(r(t[a],e[a],n));return i}throw"Mismatched interpolation arguments "+t+":"+e}t.Interpolation=function(t,e,n){return function(i){return n(r(t,e,i))}}}(i),function(t,e){var r=function(){function t(t,e){for(var r=[[0,0,0,0],[0,0,0,0],[0,0,0,0],[0,0,0,0]],n=0;n<4;n++)for(var i=0;i<4;i++)for(var a=0;a<4;a++)r[n][i]+=e[n][a]*t[a][i];return r}return function(e,r,n,i,a){for(var o=[[1,0,0,0],[0,1,0,0],[0,0,1,0],[0,0,0,1]],s=0;s<4;s++)o[s][3]=a[s];for(s=0;s<3;s++)for(var l=0;l<3;l++)o[3][s]+=e[l]*o[l][s];var u=i[0],c=i[1],d=i[2],h=i[3],f=[[1,0,0,0],[0,1,0,0],[0,0,1,0],[0,0,0,1]];f[0][0]=1-2*(c*c+d*d),f[0][1]=2*(u*c-d*h),f[0][2]=2*(u*d+c*h),f[1][0]=2*(u*c+d*h),f[1][1]=1-2*(u*u+d*d),f[1][2]=2*(c*d-u*h),f[2][0]=2*(u*d-c*h),f[2][1]=2*(c*d+u*h),f[2][2]=1-2*(u*u+c*c),o=t(o,f);var p=[[1,0,0,0],[0,1,0,0],[0,0,1,0],[0,0,0,1]];for(n[2]&&(p[2][1]=n[2],o=t(o,p)),n[1]&&(p[2][1]=0,p[2][0]=n[0],o=t(o,p)),n[0]&&(p[2][0]=0,p[1][0]=n[0],o=t(o,p)),s=0;s<3;s++)for(l=0;l<3;l++)o[s][l]*=r[s];return function(t){return 0==t[0][2]&&0==t[0][3]&&0==t[1][2]&&0==t[1][3]&&0==t[2][0]&&0==t[2][1]&&1==t[2][2]&&0==t[2][3]&&0==t[3][2]&&1==t[3][3]}(o)?[o[0][0],o[0][1],o[1][0],o[1][1],o[3][0],o[3][1]]:o[0].concat(o[1],o[2],o[3])}}();t.composeMatrix=r,t.quat=function(e,r,n){var i=t.dot(e,r);i=function(t,e,r){return Math.max(Math.min(t,1),-1)}(i);var a=[];if(1===i)a=e;else for(var o=Math.acos(i),s=1*Math.sin(n*o)/Math.sqrt(1-i*i),l=0;l<4;l++)a.push(e[l]*(Math.cos(n*o)-i*s)+r[l]*s);return a}}(i),function(t,e,r){t.sequenceNumber=0;var n=function(t,e,r){this.target=t,this.currentTime=e,this.timelineTime=r,this.type="finish",this.bubbles=!1,this.cancelable=!1,this.currentTarget=t,this.defaultPrevented=!1,this.eventPhase=Event.AT_TARGET,this.timeStamp=Date.now()};e.Animation=function(e){this.id="",e&&e._id&&(this.id=e._id),this._sequenceNumber=t.sequenceNumber++,this._currentTime=0,this._startTime=null,this._paused=!1,this._playbackRate=1,this._inTimeline=!0,this._finishedFlag=!0,this.onfinish=null,this._finishHandlers=[],this._effect=e,this._inEffect=this._effect._update(0),this._idle=!0,this._currentTimePending=!1},e.Animation.prototype={_ensureAlive:function(){this.playbackRate<0&&0===this.currentTime?this._inEffect=this._effect._update(-1):this._inEffect=this._effect._update(this.currentTime),this._inTimeline||!this._inEffect&&this._finishedFlag||(this._inTimeline=!0,e.timeline._animations.push(this))},_tickCurrentTime:function(t,e){t!=this._currentTime&&(this._currentTime=t,this._isFinished&&!e&&(this._currentTime=this._playbackRate>0?this._totalDuration:0),this._ensureAlive())},get currentTime(){return this._idle||this._currentTimePending?null:this._currentTime},set currentTime(t){t=+t,isNaN(t)||(e.restart(),this._paused||null==this._startTime||(this._startTime=this._timeline.currentTime-t/this._playbackRate),this._currentTimePending=!1,this._currentTime!=t&&(this._idle&&(this._idle=!1,this._paused=!0),this._tickCurrentTime(t,!0),e.applyDirtiedAnimation(this)))},get startTime(){return this._startTime},set startTime(t){t=+t,isNaN(t)||this._paused||this._idle||(this._startTime=t,this._tickCurrentTime((this._timeline.currentTime-this._startTime)*this.playbackRate),e.applyDirtiedAnimation(this))},get playbackRate(){return this._playbackRate},set playbackRate(t){if(t!=this._playbackRate){var r=this.currentTime;this._playbackRate=t,this._startTime=null,"paused"!=this.playState&&"idle"!=this.playState&&(this._finishedFlag=!1,this._idle=!1,this._ensureAlive(),e.applyDirtiedAnimation(this)),null!=r&&(this.currentTime=r)}},get _isFinished(){return!this._idle&&(this._playbackRate>0&&this._currentTime>=this._totalDuration||this._playbackRate<0&&this._currentTime<=0)},get _totalDuration(){return this._effect._totalDuration},get playState(){return this._idle?"idle":null==this._startTime&&!this._paused&&0!=this.playbackRate||this._currentTimePending?"pending":this._paused?"paused":this._isFinished?"finished":"running"},_rewind:function(){if(this._playbackRate>=0)this._currentTime=0;else{if(!(this._totalDuration<1/0))throw new DOMException("Unable to rewind negative playback rate animation with infinite duration","InvalidStateError");this._currentTime=this._totalDuration}},play:function(){this._paused=!1,(this._isFinished||this._idle)&&(this._rewind(),this._startTime=null),this._finishedFlag=!1,this._idle=!1,this._ensureAlive(),e.applyDirtiedAnimation(this)},pause:function(){this._isFinished||this._paused||this._idle?this._idle&&(this._rewind(),this._idle=!1):this._currentTimePending=!0,this._startTime=null,this._paused=!0},finish:function(){this._idle||(this.currentTime=this._playbackRate>0?this._totalDuration:0,this._startTime=this._totalDuration-this.currentTime,this._currentTimePending=!1,e.applyDirtiedAnimation(this))},cancel:function(){this._inEffect&&(this._inEffect=!1,this._idle=!0,this._paused=!1,this._finishedFlag=!0,this._currentTime=0,this._startTime=null,this._effect._update(null),e.applyDirtiedAnimation(this))},reverse:function(){this.playbackRate*=-1,this.play()},addEventListener:function(t,e){"function"==typeof e&&"finish"==t&&this._finishHandlers.push(e)},removeEventListener:function(t,e){if("finish"==t){var r=this._finishHandlers.indexOf(e);r>=0&&this._finishHandlers.splice(r,1)}},_fireEvents:function(t){if(this._isFinished){if(!this._finishedFlag){var e=new n(this,this._currentTime,t),r=this._finishHandlers.concat(this.onfinish?[this.onfinish]:[]);setTimeout((function(){r.forEach((function(t){t.call(e.target,e)}))}),0),this._finishedFlag=!0}}else this._finishedFlag=!1},_tick:function(t,e){this._idle||this._paused||(null==this._startTime?e&&(this.startTime=t-this._currentTime/this.playbackRate):this._isFinished||this._tickCurrentTime((t-this._startTime)*this.playbackRate)),e&&(this._currentTimePending=!1,this._fireEvents(t))},get _needsTick(){return this.playState in{pending:1,running:1}||!this._finishedFlag},_targetAnimations:function(){var t=this._effect._target;return t._activeAnimations||(t._activeAnimations=[]),t._activeAnimations},_markTarget:function(){var t=this._targetAnimations();-1===t.indexOf(this)&&t.push(this)},_unmarkTarget:function(){var t=this._targetAnimations(),e=t.indexOf(this);-1!==e&&t.splice(e,1)}}}(n,i),function(t,e,r){function n(t){var e=u;u=[],t<g.currentTime&&(t=g.currentTime),g._animations.sort(i),g._animations=s(t,!0,g._animations)[0],e.forEach((function(e){e[1](t)})),o()}function i(t,e){return t._sequenceNumber-e._sequenceNumber}function a(){this._animations=[],this.currentTime=window.performance&&performance.now?performance.now():0}function o(){f.forEach((function(t){t()})),f.length=0}function s(t,r,n){p=!0,h=!1,e.timeline.currentTime=t,d=!1;var i=[],a=[],o=[],s=[];return n.forEach((function(e){e._tick(t,r),e._inEffect?(a.push(e._effect),e._markTarget()):(i.push(e._effect),e._unmarkTarget()),e._needsTick&&(d=!0);var n=e._inEffect||e._needsTick;e._inTimeline=n,n?o.push(e):s.push(e)})),f.push.apply(f,i),f.push.apply(f,a),d&&requestAnimationFrame((function(){})),p=!1,[o,s]}var l=window.requestAnimationFrame,u=[],c=0;window.requestAnimationFrame=function(t){var e=c++;return 0==u.length&&l(n),u.push([e,t]),e},window.cancelAnimationFrame=function(t){u.forEach((function(e){e[0]==t&&(e[1]=function(){})}))},a.prototype={_play:function(r){r._timing=t.normalizeTimingInput(r.timing);var n=new e.Animation(r);return n._idle=!1,n._timeline=this,this._animations.push(n),e.restart(),e.applyDirtiedAnimation(n),n}};var d=!1,h=!1;e.restart=function(){return d||(d=!0,requestAnimationFrame((function(){})),h=!0),h},e.applyDirtiedAnimation=function(t){if(!p){t._markTarget();var r=t._targetAnimations();r.sort(i),s(e.timeline.currentTime,!1,r.slice())[1].forEach((function(t){var e=g._animations.indexOf(t);-1!==e&&g._animations.splice(e,1)})),o()}};var f=[],p=!1,g=new a;e.timeline=g}(n,i),function(t,e){function r(t,e){for(var r=0,n=0;n<t.length;n++)r+=t[n]*e[n];return r}function n(t,e){return[t[0]*e[0]+t[4]*e[1]+t[8]*e[2]+t[12]*e[3],t[1]*e[0]+t[5]*e[1]+t[9]*e[2]+t[13]*e[3],t[2]*e[0]+t[6]*e[1]+t[10]*e[2]+t[14]*e[3],t[3]*e[0]+t[7]*e[1]+t[11]*e[2]+t[15]*e[3],t[0]*e[4]+t[4]*e[5]+t[8]*e[6]+t[12]*e[7],t[1]*e[4]+t[5]*e[5]+t[9]*e[6]+t[13]*e[7],t[2]*e[4]+t[6]*e[5]+t[10]*e[6]+t[14]*e[7],t[3]*e[4]+t[7]*e[5]+t[11]*e[6]+t[15]*e[7],t[0]*e[8]+t[4]*e[9]+t[8]*e[10]+t[12]*e[11],t[1]*e[8]+t[5]*e[9]+t[9]*e[10]+t[13]*e[11],t[2]*e[8]+t[6]*e[9]+t[10]*e[10]+t[14]*e[11],t[3]*e[8]+t[7]*e[9]+t[11]*e[10]+t[15]*e[11],t[0]*e[12]+t[4]*e[13]+t[8]*e[14]+t[12]*e[15],t[1]*e[12]+t[5]*e[13]+t[9]*e[14]+t[13]*e[15],t[2]*e[12]+t[6]*e[13]+t[10]*e[14]+t[14]*e[15],t[3]*e[12]+t[7]*e[13]+t[11]*e[14]+t[15]*e[15]]}function i(t){var e=t.rad||0;return((t.deg||0)/360+(t.grad||0)/400+(t.turn||0))*(2*Math.PI)+e}function a(t){switch(t.t){case"rotatex":var e=i(t.d[0]);return[1,0,0,0,0,Math.cos(e),Math.sin(e),0,0,-Math.sin(e),Math.cos(e),0,0,0,0,1];case"rotatey":return e=i(t.d[0]),[Math.cos(e),0,-Math.sin(e),0,0,1,0,0,Math.sin(e),0,Math.cos(e),0,0,0,0,1];case"rotate":case"rotatez":return e=i(t.d[0]),[Math.cos(e),Math.sin(e),0,0,-Math.sin(e),Math.cos(e),0,0,0,0,1,0,0,0,0,1];case"rotate3d":var r=t.d[0],n=t.d[1],a=t.d[2],o=(e=i(t.d[3]),r*r+n*n+a*a);if(0===o)r=1,n=0,a=0;else if(1!==o){var s=Math.sqrt(o);r/=s,n/=s,a/=s}var l=Math.sin(e/2),u=l*Math.cos(e/2),c=l*l;return[1-2*(n*n+a*a)*c,2*(r*n*c+a*u),2*(r*a*c-n*u),0,2*(r*n*c-a*u),1-2*(r*r+a*a)*c,2*(n*a*c+r*u),0,2*(r*a*c+n*u),2*(n*a*c-r*u),1-2*(r*r+n*n)*c,0,0,0,0,1];case"scale":return[t.d[0],0,0,0,0,t.d[1],0,0,0,0,1,0,0,0,0,1];case"scalex":return[t.d[0],0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];case"scaley":return[1,0,0,0,0,t.d[0],0,0,0,0,1,0,0,0,0,1];case"scalez":return[1,0,0,0,0,1,0,0,0,0,t.d[0],0,0,0,0,1];case"scale3d":return[t.d[0],0,0,0,0,t.d[1],0,0,0,0,t.d[2],0,0,0,0,1];case"skew":var d=i(t.d[0]),h=i(t.d[1]);return[1,Math.tan(h),0,0,Math.tan(d),1,0,0,0,0,1,0,0,0,0,1];case"skewx":return e=i(t.d[0]),[1,0,0,0,Math.tan(e),1,0,0,0,0,1,0,0,0,0,1];case"skewy":return e=i(t.d[0]),[1,Math.tan(e),0,0,0,1,0,0,0,0,1,0,0,0,0,1];case"translate":return[1,0,0,0,0,1,0,0,0,0,1,0,r=t.d[0].px||0,n=t.d[1].px||0,0,1];case"translatex":return[1,0,0,0,0,1,0,0,0,0,1,0,r=t.d[0].px||0,0,0,1];case"translatey":return[1,0,0,0,0,1,0,0,0,0,1,0,0,n=t.d[0].px||0,0,1];case"translatez":return[1,0,0,0,0,1,0,0,0,0,1,0,0,0,a=t.d[0].px||0,1];case"translate3d":return[1,0,0,0,0,1,0,0,0,0,1,0,r=t.d[0].px||0,n=t.d[1].px||0,a=t.d[2].px||0,1];case"perspective":return[1,0,0,0,0,1,0,0,0,0,1,t.d[0].px?-1/t.d[0].px:0,0,0,0,1];case"matrix":return[t.d[0],t.d[1],0,0,t.d[2],t.d[3],0,0,0,0,1,0,t.d[4],t.d[5],0,1];case"matrix3d":return t.d}}function o(t){return 0===t.length?[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]:t.map(a).reduce(n)}var s=function(){function t(t){return t[0][0]*t[1][1]*t[2][2]+t[1][0]*t[2][1]*t[0][2]+t[2][0]*t[0][1]*t[1][2]-t[0][2]*t[1][1]*t[2][0]-t[1][2]*t[2][1]*t[0][0]-t[2][2]*t[0][1]*t[1][0]}function e(t){var e=n(t);return[t[0]/e,t[1]/e,t[2]/e]}function n(t){return Math.sqrt(t[0]*t[0]+t[1]*t[1]+t[2]*t[2])}function i(t,e,r,n){return[r*t[0]+n*e[0],r*t[1]+n*e[1],r*t[2]+n*e[2]]}return function(a){var o=[a.slice(0,4),a.slice(4,8),a.slice(8,12),a.slice(12,16)];if(1!==o[3][3])return null;for(var s=[],l=0;l<4;l++)s.push(o[l].slice());for(l=0;l<3;l++)s[l][3]=0;if(0===t(s))return null;var u,c=[];o[0][3]||o[1][3]||o[2][3]?(c.push(o[0][3]),c.push(o[1][3]),c.push(o[2][3]),c.push(o[3][3]),u=function(t,e){for(var r=[],n=0;n<4;n++){for(var i=0,a=0;a<4;a++)i+=t[a]*e[a][n];r.push(i)}return r}(c,function(t){return[[t[0][0],t[1][0],t[2][0],t[3][0]],[t[0][1],t[1][1],t[2][1],t[3][1]],[t[0][2],t[1][2],t[2][2],t[3][2]],[t[0][3],t[1][3],t[2][3],t[3][3]]]}(function(e){for(var r=1/t(e),n=e[0][0],i=e[0][1],a=e[0][2],o=e[1][0],s=e[1][1],l=e[1][2],u=e[2][0],c=e[2][1],d=e[2][2],h=[[(s*d-l*c)*r,(a*c-i*d)*r,(i*l-a*s)*r,0],[(l*u-o*d)*r,(n*d-a*u)*r,(a*o-n*l)*r,0],[(o*c-s*u)*r,(u*i-n*c)*r,(n*s-i*o)*r,0]],f=[],p=0;p<3;p++){for(var g=0,v=0;v<3;v++)g+=e[3][v]*h[v][p];f.push(g)}return f.push(1),h.push(f),h}(s)))):u=[0,0,0,1];var d=o[3].slice(0,3),h=[];h.push(o[0].slice(0,3));var f=[];f.push(n(h[0])),h[0]=e(h[0]);var p=[];h.push(o[1].slice(0,3)),p.push(r(h[0],h[1])),h[1]=i(h[1],h[0],1,-p[0]),f.push(n(h[1])),h[1]=e(h[1]),p[0]/=f[1],h.push(o[2].slice(0,3)),p.push(r(h[0],h[2])),h[2]=i(h[2],h[0],1,-p[1]),p.push(r(h[1],h[2])),h[2]=i(h[2],h[1],1,-p[2]),f.push(n(h[2])),h[2]=e(h[2]),p[1]/=f[2],p[2]/=f[2];var g=function(t,e){return[t[1]*e[2]-t[2]*e[1],t[2]*e[0]-t[0]*e[2],t[0]*e[1]-t[1]*e[0]]}(h[1],h[2]);if(r(h[0],g)<0)for(l=0;l<3;l++)f[l]*=-1,h[l][0]*=-1,h[l][1]*=-1,h[l][2]*=-1;var v,m,y=h[0][0]+h[1][1]+h[2][2]+1;return y>1e-4?(v=.5/Math.sqrt(y),m=[(h[2][1]-h[1][2])*v,(h[0][2]-h[2][0])*v,(h[1][0]-h[0][1])*v,.25/v]):h[0][0]>h[1][1]&&h[0][0]>h[2][2]?m=[.25*(v=2*Math.sqrt(1+h[0][0]-h[1][1]-h[2][2])),(h[0][1]+h[1][0])/v,(h[0][2]+h[2][0])/v,(h[2][1]-h[1][2])/v]:h[1][1]>h[2][2]?(v=2*Math.sqrt(1+h[1][1]-h[0][0]-h[2][2]),m=[(h[0][1]+h[1][0])/v,.25*v,(h[1][2]+h[2][1])/v,(h[0][2]-h[2][0])/v]):(v=2*Math.sqrt(1+h[2][2]-h[0][0]-h[1][1]),m=[(h[0][2]+h[2][0])/v,(h[1][2]+h[2][1])/v,.25*v,(h[1][0]-h[0][1])/v]),[d,f,p,m,u]}}();t.dot=r,t.makeMatrixDecomposition=function(t){return[s(o(t))]},t.transformListToMatrix=o}(i),function(t){function e(t,e){var r=t.exec(e);if(r)return[r=t.ignoreCase?r[0].toLowerCase():r[0],e.substr(r.length)]}function r(t,e){var r=t(e=e.replace(/^\s*/,""));if(r)return[r[0],r[1].replace(/^\s*/,"")]}function n(t,e,r,n,i){for(var a=[],o=[],s=[],l=function(t,e){for(var r=t,n=e;r&&n;)r>n?r%=n:n%=r;return t*e/(r+n)}(n.length,i.length),u=0;u<l;u++){var c=e(n[u%n.length],i[u%i.length]);if(!c)return;a.push(c[0]),o.push(c[1]),s.push(c[2])}return[a,o,function(e){var n=e.map((function(t,e){return s[e](t)})).join(r);return t?t(n):n}]}t.consumeToken=e,t.consumeTrimmed=r,t.consumeRepeated=function(t,n,i){t=r.bind(null,t);for(var a=[];;){var o=t(i);if(!o)return[a,i];if(a.push(o[0]),!(o=e(n,i=o[1]))||""==o[1])return[a,i];i=o[1]}},t.consumeParenthesised=function(t,e){for(var r=0,n=0;n<e.length&&(!/\s|,/.test(e[n])||0!=r);n++)if("("==e[n])r++;else if(")"==e[n]&&(0==--r&&n++,r<=0))break;var i=t(e.substr(0,n));return null==i?void 0:[i,e.substr(n)]},t.ignore=function(t){return function(e){var r=t(e);return r&&(r[0]=void 0),r}},t.optional=function(t,e){return function(r){return t(r)||[e,r]}},t.consumeList=function(e,r){for(var n=[],i=0;i<e.length;i++){var a=t.consumeTrimmed(e[i],r);if(!a||""==a[0])return;void 0!==a[0]&&n.push(a[0]),r=a[1]}if(""==r)return n},t.mergeNestedRepeated=n.bind(null,null),t.mergeWrappedNestedRepeated=n,t.mergeList=function(t,e,r){for(var n=[],i=[],a=[],o=0,s=0;s<r.length;s++)if("function"==typeof r[s]){var l=r[s](t[o],e[o++]);n.push(l[0]),i.push(l[1]),a.push(l[2])}else!function(t){n.push(!1),i.push(!1),a.push((function(){return r[t]}))}(s);return[n,i,function(t){for(var e="",r=0;r<t.length;r++)e+=a[r](t[r]);return e}]}}(i),function(t){function e(e){var r={inset:!1,lengths:[],color:null},n=t.consumeRepeated((function(e){var n=t.consumeToken(/^inset/i,e);return n?(r.inset=!0,n):(n=t.consumeLengthOrPercent(e))?(r.lengths.push(n[0]),n):(n=t.consumeColor(e))?(r.color=n[0],n):void 0}),/^/,e);if(n&&n[0].length)return[r,n[1]]}var r=function(e,r,n,i){function a(t){return{inset:t,color:[0,0,0,0],lengths:[{px:0},{px:0},{px:0},{px:0}]}}for(var o=[],s=[],l=0;l<n.length||l<i.length;l++){var u=n[l]||a(i[l].inset),c=i[l]||a(n[l].inset);o.push(u),s.push(c)}return t.mergeNestedRepeated(e,r,o,s)}.bind(null,(function(e,r){for(;e.lengths.length<Math.max(e.lengths.length,r.lengths.length);)e.lengths.push({px:0});for(;r.lengths.length<Math.max(e.lengths.length,r.lengths.length);)r.lengths.push({px:0});if(e.inset==r.inset&&!!e.color==!!r.color){for(var n,i=[],a=[[],0],o=[[],0],s=0;s<e.lengths.length;s++){var l=t.mergeDimensions(e.lengths[s],r.lengths[s],2==s);a[0].push(l[0]),o[0].push(l[1]),i.push(l[2])}if(e.color&&r.color){var u=t.mergeColors(e.color,r.color);a[1]=u[0],o[1]=u[1],n=u[2]}return[a,o,function(t){for(var r=e.inset?"inset ":" ",a=0;a<i.length;a++)r+=i[a](t[0][a])+" ";return n&&(r+=n(t[1])),r}]}}),", ");t.addPropertiesHandler((function(r){var n=t.consumeRepeated(e,/^,/,r);if(n&&""==n[1])return n[0]}),r,["box-shadow","text-shadow"])}(i),function(t,e){function r(t){return t.toFixed(3).replace(/0+$/,"").replace(/\.$/,"")}function n(t,e,r){return Math.min(e,Math.max(t,r))}function i(t){if(/^\s*[-+]?(\d*\.)?\d+\s*$/.test(t))return Number(t)}function a(t,e){return function(i,a){return[i,a,function(i){return r(n(t,e,i))}]}}function o(t){var e=t.trim().split(/\s*[\s,]\s*/);if(0!==e.length){for(var r=[],n=0;n<e.length;n++){var a=i(e[n]);if(void 0===a)return;r.push(a)}return r}}t.clamp=n,t.addPropertiesHandler(o,(function(t,e){if(t.length==e.length)return[t,e,function(t){return t.map(r).join(" ")}]}),["stroke-dasharray"]),t.addPropertiesHandler(i,a(0,1/0),["border-image-width","line-height"]),t.addPropertiesHandler(i,a(0,1),["opacity","shape-image-threshold"]),t.addPropertiesHandler(i,(function(t,e){if(0!=t)return a(0,1/0)(t,e)}),["flex-grow","flex-shrink"]),t.addPropertiesHandler(i,(function(t,e){return[t,e,function(t){return Math.round(n(1,1/0,t))}]}),["orphans","widows"]),t.addPropertiesHandler(i,(function(t,e){return[t,e,Math.round]}),["z-index"]),t.parseNumber=i,t.parseNumberList=o,t.mergeNumbers=function(t,e){return[t,e,r]},t.numberToString=r}(i),function(t,e){t.addPropertiesHandler(String,(function(t,e){if("visible"==t||"visible"==e)return[0,1,function(r){return r<=0?t:r>=1?e:"visible"}]}),["visibility"])}(i),function(t,e){function r(t){t=t.trim(),a.fillStyle="#000",a.fillStyle=t;var e=a.fillStyle;if(a.fillStyle="#fff",a.fillStyle=t,e==a.fillStyle){a.fillRect(0,0,1,1);var r=a.getImageData(0,0,1,1).data;a.clearRect(0,0,1,1);var n=r[3]/255;return[r[0]*n,r[1]*n,r[2]*n,n]}}function n(e,r){return[e,r,function(e){function r(t){return Math.max(0,Math.min(255,t))}if(e[3])for(var n=0;n<3;n++)e[n]=Math.round(r(e[n]/e[3]));return e[3]=t.numberToString(t.clamp(0,1,e[3])),"rgba("+e.join(",")+")"}]}var i=document.createElementNS("http://www.w3.org/1999/xhtml","canvas");i.width=i.height=1;var a=i.getContext("2d");t.addPropertiesHandler(r,n,["background-color","border-bottom-color","border-left-color","border-right-color","border-top-color","color","fill","flood-color","lighting-color","outline-color","stop-color","stroke","text-decoration-color"]),t.consumeColor=t.consumeParenthesised.bind(null,r),t.mergeColors=n}(i),function(t,e){function r(t){function e(){var e=o.exec(t);a=e?e[0]:void 0}function r(){if("("!==a)return function(){var t=Number(a);return e(),t}();e();var t=i();return")"!==a?NaN:(e(),t)}function n(){for(var t=r();"*"===a||"/"===a;){var n=a;e();var i=r();"*"===n?t*=i:t/=i}return t}function i(){for(var t=n();"+"===a||"-"===a;){var r=a;e();var i=n();"+"===r?t+=i:t-=i}return t}var a,o=/([\+\-\w\.]+|[\(\)\*\/])/g;return e(),i()}function n(t,e){if("0"==(e=e.trim().toLowerCase())&&"px".search(t)>=0)return{px:0};if(/^[^(]*$|^calc/.test(e)){e=e.replace(/calc\(/g,"(");var n={};e=e.replace(t,(function(t){return n[t]=null,"U"+t}));for(var i="U("+t.source+")",a=e.replace(/[-+]?(\d*\.)?\d+([Ee][-+]?\d+)?/g,"N").replace(new RegExp("N"+i,"g"),"D").replace(/\s[+-]\s/g,"O").replace(/\s/g,""),o=[/N\*(D)/g,/(N|D)[*\/]N/g,/(N|D)O\1/g,/\((N|D)\)/g],s=0;s<o.length;)o[s].test(a)?(a=a.replace(o[s],"$1"),s=0):s++;if("D"==a){for(var l in n){var u=r(e.replace(new RegExp("U"+l,"g"),"").replace(new RegExp(i,"g"),"*0"));if(!isFinite(u))return;n[l]=u}return n}}}function i(t,e){return a(t,e,!0)}function a(e,r,n){var i,a=[];for(i in e)a.push(i);for(i in r)a.indexOf(i)<0&&a.push(i);return e=a.map((function(t){return e[t]||0})),r=a.map((function(t){return r[t]||0})),[e,r,function(e){var r=e.map((function(r,i){return 1==e.length&&n&&(r=Math.max(r,0)),t.numberToString(r)+a[i]})).join(" + ");return e.length>1?"calc("+r+")":r}]}var o="px|em|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc",s=n.bind(null,new RegExp(o,"g")),l=n.bind(null,new RegExp(o+"|%","g")),u=n.bind(null,/deg|rad|grad|turn/g);t.parseLength=s,t.parseLengthOrPercent=l,t.consumeLengthOrPercent=t.consumeParenthesised.bind(null,l),t.parseAngle=u,t.mergeDimensions=a;var c=t.consumeParenthesised.bind(null,s),d=t.consumeRepeated.bind(void 0,c,/^/),h=t.consumeRepeated.bind(void 0,d,/^,/);t.consumeSizePairList=h;var f=t.mergeNestedRepeated.bind(void 0,i," "),p=t.mergeNestedRepeated.bind(void 0,f,",");t.mergeNonNegativeSizePair=f,t.addPropertiesHandler((function(t){var e=h(t);if(e&&""==e[1])return e[0]}),p,["background-size"]),t.addPropertiesHandler(l,i,["border-bottom-width","border-image-width","border-left-width","border-right-width","border-top-width","flex-basis","font-size","height","line-height","max-height","max-width","outline-width","width"]),t.addPropertiesHandler(l,a,["border-bottom-left-radius","border-bottom-right-radius","border-top-left-radius","border-top-right-radius","bottom","left","letter-spacing","margin-bottom","margin-left","margin-right","margin-top","min-height","min-width","outline-offset","padding-bottom","padding-left","padding-right","padding-top","perspective","right","shape-margin","stroke-dashoffset","text-indent","top","vertical-align","word-spacing"])}(i),function(t,e){function r(e){return t.consumeLengthOrPercent(e)||t.consumeToken(/^auto/,e)}function n(e){var n=t.consumeList([t.ignore(t.consumeToken.bind(null,/^rect/)),t.ignore(t.consumeToken.bind(null,/^\(/)),t.consumeRepeated.bind(null,r,/^,/),t.ignore(t.consumeToken.bind(null,/^\)/))],e);if(n&&4==n[0].length)return n[0]}var i=t.mergeWrappedNestedRepeated.bind(null,(function(t){return"rect("+t+")"}),(function(e,r){return"auto"==e||"auto"==r?[!0,!1,function(n){var i=n?e:r;if("auto"==i)return"auto";var a=t.mergeDimensions(i,i);return a[2](a[0])}]:t.mergeDimensions(e,r)}),", ");t.parseBox=n,t.mergeBoxes=i,t.addPropertiesHandler(n,i,["clip"])}(i),function(t,e){function r(t){return function(e){var r=0;return t.map((function(t){return t===u?e[r++]:t}))}}function n(t){return t}function i(e){if("none"==(e=e.toLowerCase().trim()))return[];for(var r,n=/\s*(\w+)\(([^)]*)\)/g,i=[],a=0;r=n.exec(e);){if(r.index!=a)return;a=r.index+r[0].length;var o=r[1],s=h[o];if(!s)return;var l=r[2].split(","),u=s[0];if(u.length<l.length)return;for(var f=[],p=0;p<u.length;p++){var g,v=l[p],m=u[p];if(void 0===(g=v?{A:function(e){return"0"==e.trim()?d:t.parseAngle(e)},N:t.parseNumber,T:t.parseLengthOrPercent,L:t.parseLength}[m.toUpperCase()](v):{a:d,n:f[0],t:c}[m]))return;f.push(g)}if(i.push({t:o,d:f}),n.lastIndex==e.length)return i}}function a(t){return t.toFixed(6).replace(".000000","")}function o(e,r){if(e.decompositionPair!==r){e.decompositionPair=r;var n=t.makeMatrixDecomposition(e)}if(r.decompositionPair!==e){r.decompositionPair=e;var i=t.makeMatrixDecomposition(r)}return null==n[0]||null==i[0]?[[!1],[!0],function(t){return t?r[0].d:e[0].d}]:(n[0].push(0),i[0].push(1),[n,i,function(e){var r=t.quat(n[0][3],i[0][3],e[5]);return t.composeMatrix(e[0],e[1],e[2],r,e[4]).map(a).join(",")}])}function s(t){return t.replace(/[xy]/,"")}function l(t){return t.replace(/(x|y|z|3d)?$/,"3d")}var u=null,c={px:0},d={deg:0},h={matrix:["NNNNNN",[u,u,0,0,u,u,0,0,0,0,1,0,u,u,0,1],n],matrix3d:["NNNNNNNNNNNNNNNN",n],rotate:["A"],rotatex:["A"],rotatey:["A"],rotatez:["A"],rotate3d:["NNNA"],perspective:["L"],scale:["Nn",r([u,u,1]),n],scalex:["N",r([u,1,1]),r([u,1])],scaley:["N",r([1,u,1]),r([1,u])],scalez:["N",r([1,1,u])],scale3d:["NNN",n],skew:["Aa",null,n],skewx:["A",null,r([u,d])],skewy:["A",null,r([d,u])],translate:["Tt",r([u,u,c]),n],translatex:["T",r([u,c,c]),r([u,c])],translatey:["T",r([c,u,c]),r([c,u])],translatez:["L",r([c,c,u])],translate3d:["TTL",n]};t.addPropertiesHandler(i,(function(e,r){var n=t.makeMatrixDecomposition&&!0,i=!1;if(!e.length||!r.length){e.length||(i=!0,e=r,r=[]);for(var a=0;a<e.length;a++){var u=e[a].t,c=e[a].d,d="scale"==u.substr(0,5)?1:0;r.push({t:u,d:c.map((function(t){if("number"==typeof t)return d;var e={};for(var r in t)e[r]=d;return e}))})}}var f=function(t,e){return"perspective"==t&&"perspective"==e||("matrix"==t||"matrix3d"==t)&&("matrix"==e||"matrix3d"==e)},p=[],g=[],v=[];if(e.length!=r.length){if(!n)return;p=[(T=o(e,r))[0]],g=[T[1]],v=[["matrix",[T[2]]]]}else for(a=0;a<e.length;a++){var m=e[a].t,y=r[a].t,b=e[a].d,E=r[a].d,x=h[m],S=h[y];if(f(m,y)){if(!n)return;var T=o([e[a]],[r[a]]);p.push(T[0]),g.push(T[1]),v.push(["matrix",[T[2]]])}else{if(m==y)u=m;else if(x[2]&&S[2]&&s(m)==s(y))u=s(m),b=x[2](b),E=S[2](E);else{if(!x[1]||!S[1]||l(m)!=l(y)){if(!n)return;p=[(T=o(e,r))[0]],g=[T[1]],v=[["matrix",[T[2]]]];break}u=l(m),b=x[1](b),E=S[1](E)}for(var w=[],_=[],A=[],k=0;k<b.length;k++)T=("number"==typeof b[k]?t.mergeNumbers:t.mergeDimensions)(b[k],E[k]),w[k]=T[0],_[k]=T[1],A.push(T[2]);p.push(w),g.push(_),v.push([u,A])}}if(i){var C=p;p=g,g=C}return[p,g,function(t){return t.map((function(t,e){var r=t.map((function(t,r){return v[e][1][r](t)})).join(",");return"matrix"==v[e][0]&&16==r.split(",").length&&(v[e][0]="matrix3d"),v[e][0]+"("+r+")"})).join(" ")}]}),["transform"]),t.transformToSvgMatrix=function(e){var r=t.transformListToMatrix(i(e));return"matrix("+a(r[0])+" "+a(r[1])+" "+a(r[4])+" "+a(r[5])+" "+a(r[12])+" "+a(r[13])+")"}}(i),function(t){function e(e){return e=100*Math.round(e/100),400===(e=t.clamp(100,900,e))?"normal":700===e?"bold":String(e)}t.addPropertiesHandler((function(t){var e=Number(t);if(!(isNaN(e)||e<100||e>900||e%100!=0))return e}),(function(t,r){return[t,r,e]}),["font-weight"])}(i),function(t){function e(t){var e={};for(var r in t)e[r]=-t[r];return e}function r(e){return t.consumeToken(/^(left|center|right|top|bottom)\b/i,e)||t.consumeLengthOrPercent(e)}function n(e,n){var i=t.consumeRepeated(r,/^/,n);if(i&&""==i[1]){var o=i[0];if(o[0]=o[0]||"center",o[1]=o[1]||"center",3==e&&(o[2]=o[2]||{px:0}),o.length==e){if(/top|bottom/.test(o[0])||/left|right/.test(o[1])){var s=o[0];o[0]=o[1],o[1]=s}if(/left|right|center|Object/.test(o[0])&&/top|bottom|center|Object/.test(o[1]))return o.map((function(t){return"object"==typeof t?t:a[t]}))}}}function i(n){var i=t.consumeRepeated(r,/^/,n);if(i){for(var o=i[0],s=[{"%":50},{"%":50}],l=0,u=!1,c=0;c<o.length;c++){var d=o[c];"string"==typeof d?(u=/bottom|right/.test(d),s[l={left:0,right:0,center:l,top:1,bottom:1}[d]]=a[d],"center"==d&&l++):(u&&((d=e(d))["%"]=(d["%"]||0)+100),s[l]=d,l++,u=!1)}return[s,i[1]]}}var a={left:{"%":0},center:{"%":50},right:{"%":100},top:{"%":0},bottom:{"%":100}},o=t.mergeNestedRepeated.bind(null,t.mergeDimensions," ");t.addPropertiesHandler(n.bind(null,3),o,["transform-origin"]),t.addPropertiesHandler(n.bind(null,2),o,["perspective-origin"]),t.consumePosition=i,t.mergeOffsetList=o;var s=t.mergeNestedRepeated.bind(null,o,", ");t.addPropertiesHandler((function(e){var r=t.consumeRepeated(i,/^,/,e);if(r&&""==r[1])return r[0]}),s,["background-position","object-position"])}(i),function(t){var e=t.consumeParenthesised.bind(null,t.parseLengthOrPercent),r=t.consumeRepeated.bind(void 0,e,/^/),n=t.mergeNestedRepeated.bind(void 0,t.mergeDimensions," "),i=t.mergeNestedRepeated.bind(void 0,n,",");t.addPropertiesHandler((function(n){var i=t.consumeToken(/^circle/,n);if(i&&i[0])return["circle"].concat(t.consumeList([t.ignore(t.consumeToken.bind(void 0,/^\(/)),e,t.ignore(t.consumeToken.bind(void 0,/^at/)),t.consumePosition,t.ignore(t.consumeToken.bind(void 0,/^\)/))],i[1]));var a=t.consumeToken(/^ellipse/,n);if(a&&a[0])return["ellipse"].concat(t.consumeList([t.ignore(t.consumeToken.bind(void 0,/^\(/)),r,t.ignore(t.consumeToken.bind(void 0,/^at/)),t.consumePosition,t.ignore(t.consumeToken.bind(void 0,/^\)/))],a[1]));var o=t.consumeToken(/^polygon/,n);return o&&o[0]?["polygon"].concat(t.consumeList([t.ignore(t.consumeToken.bind(void 0,/^\(/)),t.optional(t.consumeToken.bind(void 0,/^nonzero\s*,|^evenodd\s*,/),"nonzero,"),t.consumeSizePairList,t.ignore(t.consumeToken.bind(void 0,/^\)/))],o[1])):void 0}),(function(e,r){if(e[0]===r[0])return"circle"==e[0]?t.mergeList(e.slice(1),r.slice(1),["circle(",t.mergeDimensions," at ",t.mergeOffsetList,")"]):"ellipse"==e[0]?t.mergeList(e.slice(1),r.slice(1),["ellipse(",t.mergeNonNegativeSizePair," at ",t.mergeOffsetList,")"]):"polygon"==e[0]&&e[1]==r[1]?t.mergeList(e.slice(2),r.slice(2),["polygon(",e[1],i,")"]):void 0}),["shape-outside"])}(i),function(t,e){function r(t,e){e.concat([t]).forEach((function(e){e in document.documentElement.style&&(n[t]=e),i[e]=t}))}var n={},i={};r("transform",["webkitTransform","msTransform"]),r("transformOrigin",["webkitTransformOrigin"]),r("perspective",["webkitPerspective"]),r("perspectiveOrigin",["webkitPerspectiveOrigin"]),t.propertyName=function(t){return n[t]||t},t.unprefixedPropertyName=function(t){return i[t]||t}}(i)}(),function(){if(void 0===document.createElement("div").animate([]).oncancel){if(window.performance&&performance.now)var t=function(){return performance.now()};else t=function(){return Date.now()};var e=function(t,e,r){this.target=t,this.currentTime=e,this.timelineTime=r,this.type="cancel",this.bubbles=!1,this.cancelable=!1,this.currentTarget=t,this.defaultPrevented=!1,this.eventPhase=Event.AT_TARGET,this.timeStamp=Date.now()},r=window.Element.prototype.animate;window.Element.prototype.animate=function(n,i){var a=r.call(this,n,i);a._cancelHandlers=[],a.oncancel=null;var o=a.cancel;a.cancel=function(){o.call(this);var r=new e(this,null,t()),n=this._cancelHandlers.concat(this.oncancel?[this.oncancel]:[]);setTimeout((function(){n.forEach((function(t){t.call(r.target,r)}))}),0)};var s=a.addEventListener;a.addEventListener=function(t,e){"function"==typeof e&&"cancel"==t?this._cancelHandlers.push(e):s.call(this,t,e)};var l=a.removeEventListener;return a.removeEventListener=function(t,e){if("cancel"==t){var r=this._cancelHandlers.indexOf(e);r>=0&&this._cancelHandlers.splice(r,1)}else l.call(this,t,e)},a}}}(),function(t){var e=document.documentElement,r=null,n=!1;try{var i="0"==getComputedStyle(e).getPropertyValue("opacity")?"1":"0";(r=e.animate({opacity:[i,i]},{duration:1})).currentTime=0,n=getComputedStyle(e).getPropertyValue("opacity")==i}catch(t){}finally{r&&r.cancel()}if(!n){var a=window.Element.prototype.animate;window.Element.prototype.animate=function(e,r){return window.Symbol&&Symbol.iterator&&Array.prototype.from&&e[Symbol.iterator]&&(e=Array.from(e)),Array.isArray(e)||null===e||(e=t.convertToArrayForm(e)),a.call(this,e,r)}}}(n)},7948:t=>{t.exports={isArray:function(t){return Array.isArray?Array.isArray(t):"[object Array]"===Object.prototype.toString.call(t)}}},85194:(t,e,r)=>{var n=r(9735),i=r(84340),a=r(33072),o=r(25860);t.exports={xml2js:n,xml2json:i,js2xml:a,json2xml:o}},33072:(t,e,r)=>{var n,i,a=r(77223),o=r(7948).isArray;function s(t,e,r){return(!r&&t.spaces?"\n":"")+Array(e+1).join(t.spaces)}function l(t,e,r){if(e.ignoreAttributes)return"";"attributesFn"in e&&(t=e.attributesFn(t,i,n));var a,o,l,u,c=[];for(a in t)t.hasOwnProperty(a)&&null!==t[a]&&void 0!==t[a]&&(u=e.noQuotesForNativeAttributes&&"string"!=typeof t[a]?"":'"',o=(o=""+t[a]).replace(/"/g,"&quot;"),l="attributeNameFn"in e?e.attributeNameFn(a,o,i,n):a,c.push(e.spaces&&e.indentAttributes?s(e,r+1,!1):" "),c.push(l+"="+u+("attributeValueFn"in e?e.attributeValueFn(o,a,i,n):o)+u));return t&&Object.keys(t).length&&e.spaces&&e.indentAttributes&&c.push(s(e,r,!1)),c.join("")}function u(t,e,r){return n=t,i="xml",e.ignoreDeclaration?"":"<?xml"+l(t[e.attributesKey],e,r)+"?>"}function c(t,e,r){if(e.ignoreInstruction)return"";var a;for(a in t)if(t.hasOwnProperty(a))break;var o="instructionNameFn"in e?e.instructionNameFn(a,t[a],i,n):a;if("object"==typeof t[a])return n=t,i=o,"<?"+o+l(t[a][e.attributesKey],e,r)+"?>";var s=t[a]?t[a]:"";return"instructionFn"in e&&(s=e.instructionFn(s,a,i,n)),"<?"+o+(s?" "+s:"")+"?>"}function d(t,e){return e.ignoreComment?"":"\x3c!--"+("commentFn"in e?e.commentFn(t,i,n):t)+"--\x3e"}function h(t,e){return e.ignoreCdata?"":"<![CDATA["+("cdataFn"in e?e.cdataFn(t,i,n):t.replace("]]>","]]]]><![CDATA[>"))+"]]>"}function f(t,e){return e.ignoreDoctype?"":"<!DOCTYPE "+("doctypeFn"in e?e.doctypeFn(t,i,n):t)+">"}function p(t,e){return e.ignoreText?"":(t=(t=(t=""+t).replace(/&amp;/g,"&")).replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;"),"textFn"in e?e.textFn(t,i,n):t)}function g(t,e,r,a){return t.reduce((function(t,o){var u=s(e,r,a&&!t);switch(o.type){case"element":return t+u+function(t,e,r){n=t,i=t.name;var a=[],o="elementNameFn"in e?e.elementNameFn(t.name,t):t.name;a.push("<"+o),t[e.attributesKey]&&a.push(l(t[e.attributesKey],e,r));var s=t[e.elementsKey]&&t[e.elementsKey].length||t[e.attributesKey]&&"preserve"===t[e.attributesKey]["xml:space"];return s||(s="fullTagEmptyElementFn"in e?e.fullTagEmptyElementFn(t.name,t):e.fullTagEmptyElement),s?(a.push(">"),t[e.elementsKey]&&t[e.elementsKey].length&&(a.push(g(t[e.elementsKey],e,r+1)),n=t,i=t.name),a.push(e.spaces&&function(t,e){var r;if(t.elements&&t.elements.length)for(r=0;r<t.elements.length;++r)switch(t.elements[r][e.typeKey]){case"text":if(e.indentText)return!0;break;case"cdata":if(e.indentCdata)return!0;break;case"instruction":if(e.indentInstruction)return!0;break;default:return!0}return!1}(t,e)?"\n"+Array(r+1).join(e.spaces):""),a.push("</"+o+">")):a.push("/>"),a.join("")}(o,e,r);case"comment":return t+u+d(o[e.commentKey],e);case"doctype":return t+u+f(o[e.doctypeKey],e);case"cdata":return t+(e.indentCdata?u:"")+h(o[e.cdataKey],e);case"text":return t+(e.indentText?u:"")+p(o[e.textKey],e);case"instruction":var v={};return v[o[e.nameKey]]=o[e.attributesKey]?o:o[e.instructionKey],t+(e.indentInstruction?u:"")+c(v,e,r)}}),"")}function v(t,e,r){var n;for(n in t)if(t.hasOwnProperty(n))switch(n){case e.parentKey:case e.attributesKey:break;case e.textKey:if(e.indentText||r)return!0;break;case e.cdataKey:if(e.indentCdata||r)return!0;break;case e.instructionKey:if(e.indentInstruction||r)return!0;break;case e.doctypeKey:case e.commentKey:default:return!0}return!1}function m(t,e,r,a,o){n=t,i=e;var u="elementNameFn"in r?r.elementNameFn(e,t):e;if(null==t||""===t)return"fullTagEmptyElementFn"in r&&r.fullTagEmptyElementFn(e,t)||r.fullTagEmptyElement?"<"+u+"></"+u+">":"<"+u+"/>";var c=[];if(e){if(c.push("<"+u),"object"!=typeof t)return c.push(">"+p(t,r)+"</"+u+">"),c.join("");t[r.attributesKey]&&c.push(l(t[r.attributesKey],r,a));var d=v(t,r,!0)||t[r.attributesKey]&&"preserve"===t[r.attributesKey]["xml:space"];if(d||(d="fullTagEmptyElementFn"in r?r.fullTagEmptyElementFn(e,t):r.fullTagEmptyElement),!d)return c.push("/>"),c.join("");c.push(">")}return c.push(y(t,r,a+1,!1)),n=t,i=e,e&&c.push((o?s(r,a,!1):"")+"</"+u+">"),c.join("")}function y(t,e,r,n){var i,a,l,g=[];for(a in t)if(t.hasOwnProperty(a))for(l=o(t[a])?t[a]:[t[a]],i=0;i<l.length;++i){switch(a){case e.declarationKey:g.push(u(l[i],e,r));break;case e.instructionKey:g.push((e.indentInstruction?s(e,r,n):"")+c(l[i],e,r));break;case e.attributesKey:case e.parentKey:break;case e.textKey:g.push((e.indentText?s(e,r,n):"")+p(l[i],e));break;case e.cdataKey:g.push((e.indentCdata?s(e,r,n):"")+h(l[i],e));break;case e.doctypeKey:g.push(s(e,r,n)+f(l[i],e));break;case e.commentKey:g.push(s(e,r,n)+d(l[i],e));break;default:g.push(s(e,r,n)+m(l[i],a,e,r,v(l[i],e)))}n=n&&!g.length}return g.join("")}t.exports=function(t,e){e=function(t){var e=a.copyOptions(t);return a.ensureFlagExists("ignoreDeclaration",e),a.ensureFlagExists("ignoreInstruction",e),a.ensureFlagExists("ignoreAttributes",e),a.ensureFlagExists("ignoreText",e),a.ensureFlagExists("ignoreComment",e),a.ensureFlagExists("ignoreCdata",e),a.ensureFlagExists("ignoreDoctype",e),a.ensureFlagExists("compact",e),a.ensureFlagExists("indentText",e),a.ensureFlagExists("indentCdata",e),a.ensureFlagExists("indentAttributes",e),a.ensureFlagExists("indentInstruction",e),a.ensureFlagExists("fullTagEmptyElement",e),a.ensureFlagExists("noQuotesForNativeAttributes",e),a.ensureSpacesExists(e),"number"==typeof e.spaces&&(e.spaces=Array(e.spaces+1).join(" ")),a.ensureKeyExists("declaration",e),a.ensureKeyExists("instruction",e),a.ensureKeyExists("attributes",e),a.ensureKeyExists("text",e),a.ensureKeyExists("comment",e),a.ensureKeyExists("cdata",e),a.ensureKeyExists("doctype",e),a.ensureKeyExists("type",e),a.ensureKeyExists("name",e),a.ensureKeyExists("elements",e),a.checkFnExists("doctype",e),a.checkFnExists("instruction",e),a.checkFnExists("cdata",e),a.checkFnExists("comment",e),a.checkFnExists("text",e),a.checkFnExists("instructionName",e),a.checkFnExists("elementName",e),a.checkFnExists("attributeName",e),a.checkFnExists("attributeValue",e),a.checkFnExists("attributes",e),a.checkFnExists("fullTagEmptyElement",e),e}(e);var r=[];return n=t,i="_root_",e.compact?r.push(y(t,e,0,!0)):(t[e.declarationKey]&&r.push(u(t[e.declarationKey],e,0)),t[e.elementsKey]&&t[e.elementsKey].length&&r.push(g(t[e.elementsKey],e,0,!r.length))),r.join("")}},25860:(t,e,r)=>{var n=r(78655).lW,i=r(33072);t.exports=function(t,e){t instanceof n&&(t=t.toString());var r=null;if("string"==typeof t)try{r=JSON.parse(t)}catch(t){throw new Error("The JSON structure is invalid")}else r=t;return i(r,e)}},77223:(t,e,r)=>{var n=r(7948).isArray;t.exports={copyOptions:function(t){var e,r={};for(e in t)t.hasOwnProperty(e)&&(r[e]=t[e]);return r},ensureFlagExists:function(t,e){t in e&&"boolean"==typeof e[t]||(e[t]=!1)},ensureSpacesExists:function(t){(!("spaces"in t)||"number"!=typeof t.spaces&&"string"!=typeof t.spaces)&&(t.spaces=0)},ensureAlwaysArrayExists:function(t){"alwaysArray"in t&&("boolean"==typeof t.alwaysArray||n(t.alwaysArray))||(t.alwaysArray=!1)},ensureKeyExists:function(t,e){t+"Key"in e&&"string"==typeof e[t+"Key"]||(e[t+"Key"]=e.compact?"_"+t:t)},checkFnExists:function(t,e){return t+"Fn"in e}}},9735:(t,e,r)=>{var n,i,a=r(13369),o=r(77223),s=r(7948).isArray;function l(t){var e=Number(t);if(!isNaN(e))return e;var r=t.toLowerCase();return"true"===r||"false"!==r&&t}function u(t,e){var r;if(n.compact){if(!i[n[t+"Key"]]&&(s(n.alwaysArray)?-1!==n.alwaysArray.indexOf(n[t+"Key"]):n.alwaysArray)&&(i[n[t+"Key"]]=[]),i[n[t+"Key"]]&&!s(i[n[t+"Key"]])&&(i[n[t+"Key"]]=[i[n[t+"Key"]]]),t+"Fn"in n&&"string"==typeof e&&(e=n[t+"Fn"](e,i)),"instruction"===t&&("instructionFn"in n||"instructionNameFn"in n))for(r in e)if(e.hasOwnProperty(r))if("instructionFn"in n)e[r]=n.instructionFn(e[r],r,i);else{var a=e[r];delete e[r],e[n.instructionNameFn(r,a,i)]=a}s(i[n[t+"Key"]])?i[n[t+"Key"]].push(e):i[n[t+"Key"]]=e}else{i[n.elementsKey]||(i[n.elementsKey]=[]);var o={};if(o[n.typeKey]=t,"instruction"===t){for(r in e)if(e.hasOwnProperty(r))break;o[n.nameKey]="instructionNameFn"in n?n.instructionNameFn(r,e,i):r,n.instructionHasAttributes?(o[n.attributesKey]=e[r][n.attributesKey],"instructionFn"in n&&(o[n.attributesKey]=n.instructionFn(o[n.attributesKey],r,i))):("instructionFn"in n&&(e[r]=n.instructionFn(e[r],r,i)),o[n.instructionKey]=e[r])}else t+"Fn"in n&&(e=n[t+"Fn"](e,i)),o[n[t+"Key"]]=e;n.addParent&&(o[n.parentKey]=i),i[n.elementsKey].push(o)}}function c(t){var e;if("attributesFn"in n&&t&&(t=n.attributesFn(t,i)),(n.trim||"attributeValueFn"in n||"attributeNameFn"in n||n.nativeTypeAttributes)&&t)for(e in t)if(t.hasOwnProperty(e)&&(n.trim&&(t[e]=t[e].trim()),n.nativeTypeAttributes&&(t[e]=l(t[e])),"attributeValueFn"in n&&(t[e]=n.attributeValueFn(t[e],e,i)),"attributeNameFn"in n)){var r=t[e];delete t[e],t[n.attributeNameFn(e,t[e],i)]=r}return t}function d(t){var e={};if(t.body&&("xml"===t.name.toLowerCase()||n.instructionHasAttributes)){for(var r,a=/([\w:-]+)\s*=\s*(?:"([^"]*)"|'([^']*)'|(\w+))\s*/g;null!==(r=a.exec(t.body));)e[r[1]]=r[2]||r[3]||r[4];e=c(e)}if("xml"===t.name.toLowerCase()){if(n.ignoreDeclaration)return;i[n.declarationKey]={},Object.keys(e).length&&(i[n.declarationKey][n.attributesKey]=e),n.addParent&&(i[n.declarationKey][n.parentKey]=i)}else{if(n.ignoreInstruction)return;n.trim&&(t.body=t.body.trim());var o={};n.instructionHasAttributes&&Object.keys(e).length?(o[t.name]={},o[t.name][n.attributesKey]=e):o[t.name]=t.body,u("instruction",o)}}function h(t,e){var r;if("object"==typeof t&&(e=t.attributes,t=t.name),e=c(e),"elementNameFn"in n&&(t=n.elementNameFn(t,i)),n.compact){var a;if(r={},!n.ignoreAttributes&&e&&Object.keys(e).length)for(a in r[n.attributesKey]={},e)e.hasOwnProperty(a)&&(r[n.attributesKey][a]=e[a]);!(t in i)&&(s(n.alwaysArray)?-1!==n.alwaysArray.indexOf(t):n.alwaysArray)&&(i[t]=[]),i[t]&&!s(i[t])&&(i[t]=[i[t]]),s(i[t])?i[t].push(r):i[t]=r}else i[n.elementsKey]||(i[n.elementsKey]=[]),(r={})[n.typeKey]="element",r[n.nameKey]=t,!n.ignoreAttributes&&e&&Object.keys(e).length&&(r[n.attributesKey]=e),n.alwaysChildren&&(r[n.elementsKey]=[]),i[n.elementsKey].push(r);r[n.parentKey]=i,i=r}function f(t){n.ignoreText||(t.trim()||n.captureSpacesBetweenElements)&&(n.trim&&(t=t.trim()),n.nativeType&&(t=l(t)),n.sanitize&&(t=t.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;")),u("text",t))}function p(t){n.ignoreComment||(n.trim&&(t=t.trim()),u("comment",t))}function g(t){var e=i[n.parentKey];n.addParent||delete i[n.parentKey],i=e}function v(t){n.ignoreCdata||(n.trim&&(t=t.trim()),u("cdata",t))}function m(t){n.ignoreDoctype||(t=t.replace(/^ /,""),n.trim&&(t=t.trim()),u("doctype",t))}function y(t){t.note=t}t.exports=function(t,e){var r=a.parser(!0,{}),s={};if(i=s,n=function(t){return n=o.copyOptions(t),o.ensureFlagExists("ignoreDeclaration",n),o.ensureFlagExists("ignoreInstruction",n),o.ensureFlagExists("ignoreAttributes",n),o.ensureFlagExists("ignoreText",n),o.ensureFlagExists("ignoreComment",n),o.ensureFlagExists("ignoreCdata",n),o.ensureFlagExists("ignoreDoctype",n),o.ensureFlagExists("compact",n),o.ensureFlagExists("alwaysChildren",n),o.ensureFlagExists("addParent",n),o.ensureFlagExists("trim",n),o.ensureFlagExists("nativeType",n),o.ensureFlagExists("nativeTypeAttributes",n),o.ensureFlagExists("sanitize",n),o.ensureFlagExists("instructionHasAttributes",n),o.ensureFlagExists("captureSpacesBetweenElements",n),o.ensureAlwaysArrayExists(n),o.ensureKeyExists("declaration",n),o.ensureKeyExists("instruction",n),o.ensureKeyExists("attributes",n),o.ensureKeyExists("text",n),o.ensureKeyExists("comment",n),o.ensureKeyExists("cdata",n),o.ensureKeyExists("doctype",n),o.ensureKeyExists("type",n),o.ensureKeyExists("name",n),o.ensureKeyExists("elements",n),o.ensureKeyExists("parent",n),o.checkFnExists("doctype",n),o.checkFnExists("instruction",n),o.checkFnExists("cdata",n),o.checkFnExists("comment",n),o.checkFnExists("text",n),o.checkFnExists("instructionName",n),o.checkFnExists("elementName",n),o.checkFnExists("attributeName",n),o.checkFnExists("attributeValue",n),o.checkFnExists("attributes",n),n}(e),r.opt={strictEntities:!0},r.onopentag=h,r.ontext=f,r.oncomment=p,r.onclosetag=g,r.onerror=y,r.oncdata=v,r.ondoctype=m,r.onprocessinginstruction=d,r.write(t).close(),s[n.elementsKey]){var l=s[n.elementsKey];delete s[n.elementsKey],s[n.elementsKey]=l,delete s.text}return s}},84340:(t,e,r)=>{var n=r(77223),i=r(9735);t.exports=function(t,e){var r,a,o;return r=function(t){var e=n.copyOptions(t);return n.ensureSpacesExists(e),e}(e),a=i(t,r),o="compact"in r&&r.compact?"_parent":"parent",("addParent"in r&&r.addParent?JSON.stringify(a,(function(t,e){return t===o?"_":e}),r.spaces):JSON.stringify(a,null,r.spaces)).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}},88711:function(t,e,r){var n,i=r(51266);"undefined"!=typeof window&&(n=()=>(()=>{var t={"./src/config.ts":(t,e,r)=>{"use strict";r.r(e),r.d(e,{enableStreamingMode:()=>_,hlsDefaultConfig:()=>T,mergeConfig:()=>w});var n=r("./src/controller/abr-controller.ts"),i=r("./src/controller/audio-stream-controller.ts"),a=r("./src/controller/audio-track-controller.ts"),o=r("./src/controller/subtitle-stream-controller.ts"),s=r("./src/controller/subtitle-track-controller.ts"),l=r("./src/controller/buffer-controller.ts"),u=r("./src/controller/timeline-controller.ts"),c=r("./src/controller/cap-level-controller.ts"),d=r("./src/controller/fps-controller.ts"),h=r("./src/controller/eme-controller.ts"),f=r("./src/controller/cmcd-controller.ts"),p=r("./src/utils/xhr-loader.ts"),g=r("./src/utils/fetch-loader.ts"),v=r("./src/utils/cues.ts"),m=r("./src/utils/mediakeys-helper.ts"),y=r("./src/utils/logger.ts");function b(){return b=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(t[n]=r[n])}return t},b.apply(this,arguments)}function E(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function x(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?E(Object(r),!0).forEach((function(e){S(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):E(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function S(t,e,r){return(e=function(t){var e=function(t,e){if("object"!=typeof t||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==typeof e?e:String(e)}(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}var T=x(x({autoStartLoad:!0,startPosition:-1,defaultAudioCodec:void 0,debug:!1,capLevelOnFPSDrop:!1,capLevelToPlayerSize:!1,ignoreDevicePixelRatio:!1,initialLiveManifestSize:1,maxBufferLength:30,backBufferLength:1/0,maxBufferSize:6e7,maxBufferHole:.1,highBufferWatchdogPeriod:2,nudgeOffset:.1,nudgeMaxRetry:3,maxFragLookUpTolerance:.25,liveSyncDurationCount:3,liveMaxLatencyDurationCount:1/0,liveSyncDuration:void 0,liveMaxLatencyDuration:void 0,maxLiveSyncPlaybackRate:1,liveDurationInfinity:!1,liveBackBufferLength:null,maxMaxBufferLength:600,enableWorker:!0,enableSoftwareAES:!0,manifestLoadingTimeOut:1e4,manifestLoadingMaxRetry:1,manifestLoadingRetryDelay:1e3,manifestLoadingMaxRetryTimeout:64e3,startLevel:void 0,levelLoadingTimeOut:1e4,levelLoadingMaxRetry:4,levelLoadingRetryDelay:1e3,levelLoadingMaxRetryTimeout:64e3,fragLoadingTimeOut:2e4,fragLoadingMaxRetry:6,fragLoadingRetryDelay:1e3,fragLoadingMaxRetryTimeout:64e3,startFragPrefetch:!1,fpsDroppedMonitoringPeriod:5e3,fpsDroppedMonitoringThreshold:.2,appendErrorMaxRetry:3,loader:p.default,fLoader:void 0,pLoader:void 0,xhrSetup:void 0,licenseXhrSetup:void 0,licenseResponseCallback:void 0,abrController:n.default,bufferController:l.default,capLevelController:c.default,fpsController:d.default,stretchShortVideoTrack:!1,maxAudioFramesDrift:1,forceKeyFrameOnDiscontinuity:!0,abrEwmaFastLive:3,abrEwmaSlowLive:9,abrEwmaFastVoD:3,abrEwmaSlowVoD:9,abrEwmaDefaultEstimate:5e5,abrBandWidthFactor:.95,abrBandWidthUpFactor:.7,abrMaxWithRealBitrate:!1,maxStarvationDelay:4,maxLoadingDelay:4,minAutoBitrate:0,emeEnabled:!1,widevineLicenseUrl:void 0,drmSystems:{},drmSystemOptions:{},requestMediaKeySystemAccessFunc:m.requestMediaKeySystemAccess,testBandwidth:!0,progressive:!1,lowLatencyMode:!0,cmcd:void 0,enableDateRangeMetadataCues:!0,enableEmsgMetadataCues:!0,enableID3MetadataCues:!0},{cueHandler:v.default,enableWebVTT:!0,enableIMSC1:!0,enableCEA708Captions:!0,captionsTextTrack1Label:"English",captionsTextTrack1LanguageCode:"en",captionsTextTrack2Label:"Spanish",captionsTextTrack2LanguageCode:"es",captionsTextTrack3Label:"Unknown CC",captionsTextTrack3LanguageCode:"",captionsTextTrack4Label:"Unknown CC",captionsTextTrack4LanguageCode:"",renderTextTracksNatively:!0}),{},{subtitleStreamController:o.SubtitleStreamController,subtitleTrackController:s.default,timelineController:u.TimelineController,audioStreamController:i.default,audioTrackController:a.default,emeController:h.default,cmcdController:f.default});function w(t,e){if((e.liveSyncDurationCount||e.liveMaxLatencyDurationCount)&&(e.liveSyncDuration||e.liveMaxLatencyDuration))throw new Error("Illegal hls.js config: don't mix up liveSyncDurationCount/liveMaxLatencyDurationCount and liveSyncDuration/liveMaxLatencyDuration");if(void 0!==e.liveMaxLatencyDurationCount&&(void 0===e.liveSyncDurationCount||e.liveMaxLatencyDurationCount<=e.liveSyncDurationCount))throw new Error('Illegal hls.js config: "liveMaxLatencyDurationCount" must be greater than "liveSyncDurationCount"');if(void 0!==e.liveMaxLatencyDuration&&(void 0===e.liveSyncDuration||e.liveMaxLatencyDuration<=e.liveSyncDuration))throw new Error('Illegal hls.js config: "liveMaxLatencyDuration" must be greater than "liveSyncDuration"');return b({},t,e)}function _(t){var e=t.loader;e!==g.default&&e!==p.default?(y.logger.log("[config]: Custom loader detected, cannot enable progressive streaming"),t.progressive=!1):(0,g.fetchSupported)()&&(t.loader=g.default,t.progressive=!0,t.enableSoftwareAES=!0,y.logger.log("[config]: Progressive streaming enabled, using FetchLoader"))}},"./src/controller/abr-controller.ts":(t,e,r)=>{"use strict";r.r(e),r.d(e,{default:()=>c});var n=r("./src/polyfills/number.ts"),i=r("./src/utils/ewma-bandwidth-estimator.ts"),a=r("./src/events.ts"),o=r("./src/errors.ts"),s=r("./src/types/loader.ts"),l=r("./src/utils/logger.ts");function u(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,(void 0,"symbol"==typeof(i=function(t,e){if("object"!=typeof t||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(n.key))?i:String(i)),n)}var i}const c=function(){function t(t){this.hls=void 0,this.lastLoadedFragLevel=0,this._nextAutoLevel=-1,this.timer=void 0,this.onCheck=this._abandonRulesCheck.bind(this),this.fragCurrent=null,this.partCurrent=null,this.bitrateTestDelay=0,this.bwEstimator=void 0,this.hls=t;var e=t.config;this.bwEstimator=new i.default(e.abrEwmaSlowVoD,e.abrEwmaFastVoD,e.abrEwmaDefaultEstimate),this.registerListeners()}var e,r,c=t.prototype;return c.registerListeners=function(){var t=this.hls;t.on(a.Events.FRAG_LOADING,this.onFragLoading,this),t.on(a.Events.FRAG_LOADED,this.onFragLoaded,this),t.on(a.Events.FRAG_BUFFERED,this.onFragBuffered,this),t.on(a.Events.LEVEL_LOADED,this.onLevelLoaded,this),t.on(a.Events.ERROR,this.onError,this)},c.unregisterListeners=function(){var t=this.hls;t.off(a.Events.FRAG_LOADING,this.onFragLoading,this),t.off(a.Events.FRAG_LOADED,this.onFragLoaded,this),t.off(a.Events.FRAG_BUFFERED,this.onFragBuffered,this),t.off(a.Events.LEVEL_LOADED,this.onLevelLoaded,this),t.off(a.Events.ERROR,this.onError,this)},c.destroy=function(){this.unregisterListeners(),this.clearTimer(),this.hls=this.onCheck=null,this.fragCurrent=this.partCurrent=null},c.onFragLoading=function(t,e){var r,n=e.frag;n.type===s.PlaylistLevelType.MAIN&&(this.timer||(this.fragCurrent=n,this.partCurrent=null!=(r=e.part)?r:null,this.timer=self.setInterval(this.onCheck,100)))},c.onLevelLoaded=function(t,e){var r=this.hls.config;e.details.live?this.bwEstimator.update(r.abrEwmaSlowLive,r.abrEwmaFastLive):this.bwEstimator.update(r.abrEwmaSlowVoD,r.abrEwmaFastVoD)},c._abandonRulesCheck=function(){var t=this.fragCurrent,e=this.partCurrent,r=this.hls,i=r.autoLevelEnabled,o=r.media;if(t&&o){var s=e?e.stats:t.stats,u=e?e.duration:t.duration;if(s.aborted||s.loaded&&s.loaded===s.total||0===t.level)return this.clearTimer(),void(this._nextAutoLevel=-1);if(i&&!o.paused&&o.playbackRate&&o.readyState){var c=r.mainForwardBufferInfo;if(null!==c){var d=performance.now()-s.loading.start,h=Math.abs(o.playbackRate);if(!(d<=500*u/h)){var f=s.loaded&&s.loading.first,p=this.bwEstimator.getEstimate(),g=r.levels,v=r.minAutoLevel,m=g[t.level],y=s.total||Math.max(s.loaded,Math.round(u*m.maxBitrate/8)),b=f?1e3*s.loaded/d:0,E=b?(y-s.loaded)/b:8*y/p,x=c.len/h;if(!(E<=x)){var S,T=Number.POSITIVE_INFINITY;for(S=t.level-1;S>v;S--){var w=g[S].maxBitrate;if((T=b?u*w/(6.4*b):u*w/p)<x)break}T>=E||(l.logger.warn("Fragment "+t.sn+(e?" part "+e.index:"")+" of level "+t.level+" is loading too slowly and will cause an underbuffer; aborting and switching to level "+S+"\n Current BW estimate: "+((0,n.isFiniteNumber)(p)?(p/1024).toFixed(3):"Unknown")+" Kb/s\n Estimated load time for current fragment: "+E.toFixed(3)+" s\n Estimated load time for the next fragment: "+T.toFixed(3)+" s\n Time to underbuffer: "+x.toFixed(3)+" s"),r.nextLoadLevel=S,f&&this.bwEstimator.sample(d,s.loaded),this.clearTimer(),(t.loader||t.keyLoader)&&(this.fragCurrent=this.partCurrent=null,t.abortRequests()),r.trigger(a.Events.FRAG_LOAD_EMERGENCY_ABORTED,{frag:t,part:e,stats:s}))}}}}}},c.onFragLoaded=function(t,e){var r=e.frag,i=e.part;if(r.type===s.PlaylistLevelType.MAIN&&(0,n.isFiniteNumber)(r.sn)){var o=i?i.stats:r.stats,l=i?i.duration:r.duration;if(this.clearTimer(),this.lastLoadedFragLevel=r.level,this._nextAutoLevel=-1,this.hls.config.abrMaxWithRealBitrate){var u=this.hls.levels[r.level],c=(u.loaded?u.loaded.bytes:0)+o.loaded,d=(u.loaded?u.loaded.duration:0)+l;u.loaded={bytes:c,duration:d},u.realBitrate=Math.round(8*c/d)}if(r.bitrateTest){var h={stats:o,frag:r,part:i,id:r.type};this.onFragBuffered(a.Events.FRAG_BUFFERED,h)}}},c.onFragBuffered=function(t,e){var r=e.frag,n=e.part,i=n?n.stats:r.stats;if(!i.aborted&&r.type===s.PlaylistLevelType.MAIN&&"initSegment"!==r.sn){var a=i.parsing.end-i.loading.start;this.bwEstimator.sample(a,i.loaded),i.bwEstimate=this.bwEstimator.getEstimate(),r.bitrateTest?this.bitrateTestDelay=a/1e3:this.bitrateTestDelay=0}},c.onError=function(t,e){var r;if((null===(r=e.frag)||void 0===r?void 0:r.type)===s.PlaylistLevelType.MAIN){if(e.type===o.ErrorTypes.KEY_SYSTEM_ERROR)return void this.clearTimer();switch(e.details){case o.ErrorDetails.FRAG_LOAD_ERROR:case o.ErrorDetails.FRAG_LOAD_TIMEOUT:case o.ErrorDetails.KEY_LOAD_ERROR:case o.ErrorDetails.KEY_LOAD_TIMEOUT:this.clearTimer()}}},c.clearTimer=function(){self.clearInterval(this.timer),this.timer=void 0},c.getNextABRAutoLevel=function(){var t=this.fragCurrent,e=this.partCurrent,r=this.hls,n=r.maxAutoLevel,i=r.config,a=r.minAutoLevel,o=r.media,s=e?e.duration:t?t.duration:0,u=o&&0!==o.playbackRate?Math.abs(o.playbackRate):1,c=this.bwEstimator?this.bwEstimator.getEstimate():i.abrEwmaDefaultEstimate,d=r.mainForwardBufferInfo,h=(d?d.len:0)/u,f=this.findBestLevel(c,a,n,h,i.abrBandWidthFactor,i.abrBandWidthUpFactor);if(f>=0)return f;l.logger.trace((h?"rebuffering expected":"buffer is empty")+", finding optimal quality level");var p=s?Math.min(s,i.maxStarvationDelay):i.maxStarvationDelay,g=i.abrBandWidthFactor,v=i.abrBandWidthUpFactor;if(!h){var m=this.bitrateTestDelay;m&&(p=(s?Math.min(s,i.maxLoadingDelay):i.maxLoadingDelay)-m,l.logger.trace("bitrate test took "+Math.round(1e3*m)+"ms, set first fragment max fetchDuration to "+Math.round(1e3*p)+" ms"),g=v=1)}return f=this.findBestLevel(c,a,n,h+p,g,v),Math.max(f,0)},c.findBestLevel=function(t,e,r,i,a,o){for(var s,u=this.fragCurrent,c=this.partCurrent,d=this.lastLoadedFragLevel,h=this.hls.levels,f=h[d],p=!(null==f||null===(s=f.details)||void 0===s||!s.live),g=null==f?void 0:f.codecSet,v=c?c.duration:u?u.duration:0,m=r;m>=e;m--){var y=h[m];if(y&&(!g||y.codecSet===g)){var b,E=y.details,x=(c?null==E?void 0:E.partTarget:null==E?void 0:E.averagetargetduration)||v;b=m<=d?a*t:o*t;var S=h[m].maxBitrate,T=S*x/b;if(l.logger.trace("level/adjustedbw/bitrate/avgDuration/maxFetchDuration/fetchDuration: "+m+"/"+Math.round(b)+"/"+S+"/"+x+"/"+i+"/"+T),b>S&&(0===T||!(0,n.isFiniteNumber)(T)||p&&!this.bitrateTestDelay||T<i))return m}}return-1},e=t,(r=[{key:"nextAutoLevel",get:function(){var t=this._nextAutoLevel,e=this.bwEstimator;if(-1!==t&&!e.canEstimate())return t;var r=this.getNextABRAutoLevel();return-1!==t&&this.hls.levels[r].loadError?t:(-1!==t&&(r=Math.min(t,r)),r)},set:function(t){this._nextAutoLevel=t}}])&&u(e.prototype,r),Object.defineProperty(e,"prototype",{writable:!1}),t}()},"./src/controller/audio-stream-controller.ts":(t,e,r)=>{"use strict";r.r(e),r.d(e,{default:()=>E});var n=r("./src/polyfills/number.ts"),a=r("./src/controller/base-stream-controller.ts"),o=r("./src/events.ts"),s=r("./src/utils/buffer-helper.ts"),l=r("./src/controller/fragment-tracker.ts"),u=r("./src/types/level.ts"),c=r("./src/types/loader.ts"),d=r("./src/loader/fragment.ts"),h=r("./src/demux/chunk-cache.ts"),f=r("./src/demux/transmuxer-interface.ts"),p=r("./src/types/transmuxer.ts"),g=r("./src/controller/fragment-finders.ts"),v=r("./src/utils/discontinuities.ts"),m=r("./src/errors.ts");function y(){return y=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(t[n]=r[n])}return t},y.apply(this,arguments)}function b(t,e){return b=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},b(t,e)}const E=function(t){var e,r;function E(e,r,n){var i;return(i=t.call(this,e,r,n,"[audio-stream-controller]")||this).videoBuffer=null,i.videoTrackCC=-1,i.waitingVideoCC=-1,i.audioSwitch=!1,i.trackId=-1,i.waitingData=null,i.mainDetails=null,i.bufferFlushed=!1,i.cachedTrackLoadedData=null,i._registerListeners(),i}r=t,(e=E).prototype=Object.create(r.prototype),e.prototype.constructor=e,b(e,r);var x=E.prototype;return x.onHandlerDestroying=function(){this._unregisterListeners(),this.mainDetails=null},x._registerListeners=function(){var t=this.hls;t.on(o.Events.MEDIA_ATTACHED,this.onMediaAttached,this),t.on(o.Events.MEDIA_DETACHING,this.onMediaDetaching,this),t.on(o.Events.MANIFEST_LOADING,this.onManifestLoading,this),t.on(o.Events.LEVEL_LOADED,this.onLevelLoaded,this),t.on(o.Events.AUDIO_TRACKS_UPDATED,this.onAudioTracksUpdated,this),t.on(o.Events.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),t.on(o.Events.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),t.on(o.Events.ERROR,this.onError,this),t.on(o.Events.BUFFER_RESET,this.onBufferReset,this),t.on(o.Events.BUFFER_CREATED,this.onBufferCreated,this),t.on(o.Events.BUFFER_FLUSHED,this.onBufferFlushed,this),t.on(o.Events.INIT_PTS_FOUND,this.onInitPtsFound,this),t.on(o.Events.FRAG_BUFFERED,this.onFragBuffered,this)},x._unregisterListeners=function(){var t=this.hls;t.off(o.Events.MEDIA_ATTACHED,this.onMediaAttached,this),t.off(o.Events.MEDIA_DETACHING,this.onMediaDetaching,this),t.off(o.Events.MANIFEST_LOADING,this.onManifestLoading,this),t.off(o.Events.LEVEL_LOADED,this.onLevelLoaded,this),t.off(o.Events.AUDIO_TRACKS_UPDATED,this.onAudioTracksUpdated,this),t.off(o.Events.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),t.off(o.Events.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),t.off(o.Events.ERROR,this.onError,this),t.off(o.Events.BUFFER_RESET,this.onBufferReset,this),t.off(o.Events.BUFFER_CREATED,this.onBufferCreated,this),t.off(o.Events.BUFFER_FLUSHED,this.onBufferFlushed,this),t.off(o.Events.INIT_PTS_FOUND,this.onInitPtsFound,this),t.off(o.Events.FRAG_BUFFERED,this.onFragBuffered,this)},x.onInitPtsFound=function(t,e){var r=e.frag,n=e.id,i=e.initPTS;if("main"===n){var o=r.cc;this.initPTS[r.cc]=i,this.log("InitPTS for cc: "+o+" found from main: "+i),this.videoTrackCC=o,this.state===a.State.WAITING_INIT_PTS&&this.tick()}},x.startLoad=function(t){if(!this.levels)return this.startPosition=t,void(this.state=a.State.STOPPED);var e=this.lastCurrentTime;this.stopLoad(),this.setInterval(100),this.fragLoadError=0,e>0&&-1===t?(this.log("Override startPosition with lastCurrentTime @"+e.toFixed(3)),t=e,this.state=a.State.IDLE):(this.loadedmetadata=!1,this.state=a.State.WAITING_TRACK),this.nextLoadPosition=this.startPosition=this.lastCurrentTime=t,this.tick()},x.doTick=function(){switch(this.state){case a.State.IDLE:this.doTickIdle();break;case a.State.WAITING_TRACK:var e,r=this.levels,n=this.trackId,i=null==r||null===(e=r[n])||void 0===e?void 0:e.details;if(i){if(this.waitForCdnTuneIn(i))break;this.state=a.State.WAITING_INIT_PTS}break;case a.State.FRAG_LOADING_WAITING_RETRY:var o,l=performance.now(),u=this.retryDate;(!u||l>=u||null!==(o=this.media)&&void 0!==o&&o.seeking)&&(this.log("RetryDate reached, switch back to IDLE state"),this.resetStartWhenNotLoaded(this.trackId),this.state=a.State.IDLE);break;case a.State.WAITING_INIT_PTS:var c=this.waitingData;if(c){var d=c.frag,h=c.part,f=c.cache,p=c.complete;if(void 0!==this.initPTS[d.cc]){this.waitingData=null,this.waitingVideoCC=-1,this.state=a.State.FRAG_LOADING;var v={frag:d,part:h,payload:f.flush(),networkDetails:null};this._handleFragmentLoadProgress(v),p&&t.prototype._handleFragmentLoadComplete.call(this,v)}else if(this.videoTrackCC!==this.waitingVideoCC)this.log("Waiting fragment cc ("+d.cc+") cancelled because video is at cc "+this.videoTrackCC),this.clearWaitingFragment();else{var m=this.getLoadPosition(),y=s.BufferHelper.bufferInfo(this.mediaBuffer,m,this.config.maxBufferHole);(0,g.fragmentWithinToleranceTest)(y.end,this.config.maxFragLookUpTolerance,d)<0&&(this.log("Waiting fragment cc ("+d.cc+") @ "+d.start+" cancelled because another fragment at "+y.end+" is needed"),this.clearWaitingFragment())}}else this.state=a.State.IDLE}this.onTickEnd()},x.clearWaitingFragment=function(){var t=this.waitingData;t&&(this.fragmentTracker.removeFragment(t.frag),this.waitingData=null,this.waitingVideoCC=-1,this.state=a.State.IDLE)},x.resetLoadingState=function(){this.clearWaitingFragment(),t.prototype.resetLoadingState.call(this)},x.onTickEnd=function(){var t=this.media;t&&t.readyState&&(this.lastCurrentTime=t.currentTime)},x.doTickIdle=function(){var t=this.hls,e=this.levels,r=this.media,n=this.trackId,i=t.config;if(e&&e[n]&&(r||!this.startFragRequested&&i.startFragPrefetch)){var s=e[n].details;if(!s||s.live&&this.levelLastLoaded!==n||this.waitForCdnTuneIn(s))this.state=a.State.WAITING_TRACK;else{var l=this.mediaBuffer?this.mediaBuffer:this.media;this.bufferFlushed&&l&&(this.bufferFlushed=!1,this.afterBufferFlushed(l,d.ElementaryStreamTypes.AUDIO,c.PlaylistLevelType.AUDIO));var u=this.getFwdBufferInfo(l,c.PlaylistLevelType.AUDIO);if(null!==u){var h=this.audioSwitch;if(!h&&this._streamEnded(u,s))return t.trigger(o.Events.BUFFER_EOS,{type:"audio"}),void(this.state=a.State.ENDED);var f=this.getFwdBufferInfo(this.videoBuffer?this.videoBuffer:this.media,c.PlaylistLevelType.MAIN);if(!(u.len>=this.getMaxBufferLength(null==f?void 0:f.len))||h){var p=s.fragments[0].start,g=u.end;if(h&&r){var v=this.getLoadPosition();g=v,s.PTSKnown&&v<p&&(u.end>p||u.nextStart)&&(this.log("Alt audio track ahead of main track, seek to start of alt audio track"),r.currentTime=p+.05)}if(!(f&&g>f.end+s.targetduration)&&(f&&f.len||!u.len)){var m=this.getNextFragment(g,s);m?this.loadFragment(m,s,g):this.bufferFlushed=!0}}}}}},x.getMaxBufferLength=function(e){var r=t.prototype.getMaxBufferLength.call(this);return e?Math.max(r,e):r},x.onMediaDetaching=function(){this.videoBuffer=null,t.prototype.onMediaDetaching.call(this)},x.onAudioTracksUpdated=function(t,e){var r=e.audioTracks;this.resetTransmuxer(),this.levels=r.map((function(t){return new u.Level(t)}))},x.onAudioTrackSwitching=function(t,e){var r=!!e.url;this.trackId=e.id;var n=this.fragCurrent;n&&n.abortRequests(),this.fragCurrent=null,this.clearWaitingFragment(),r?this.setInterval(100):this.resetTransmuxer(),r?(this.audioSwitch=!0,this.state=a.State.IDLE):this.state=a.State.STOPPED,this.tick()},x.onManifestLoading=function(){this.mainDetails=null,this.fragmentTracker.removeAllFragments(),this.startPosition=this.lastCurrentTime=0,this.bufferFlushed=!1},x.onLevelLoaded=function(t,e){this.mainDetails=e.details,null!==this.cachedTrackLoadedData&&(this.hls.trigger(o.Events.AUDIO_TRACK_LOADED,this.cachedTrackLoadedData),this.cachedTrackLoadedData=null)},x.onAudioTrackLoaded=function(t,e){var r;if(null!=this.mainDetails){var n=this.levels,i=e.details,o=e.id;if(n){this.log("Track "+o+" loaded ["+i.startSN+","+i.endSN+"],duration:"+i.totalduration);var s=n[o],l=0;if(i.live||null!==(r=s.details)&&void 0!==r&&r.live){var u=this.mainDetails;if(i.fragments[0]||(i.deltaUpdateFailed=!0),i.deltaUpdateFailed||!u)return;!s.details&&i.hasProgramDateTime&&u.hasProgramDateTime?((0,v.alignMediaPlaylistByPDT)(i,u),l=i.fragments[0].start):l=this.alignPlaylists(i,s.details)}s.details=i,this.levelLastLoaded=o,this.startFragRequested||!this.mainDetails&&i.live||this.setStartPosition(s.details,l),this.state!==a.State.WAITING_TRACK||this.waitForCdnTuneIn(i)||(this.state=a.State.IDLE),this.tick()}else this.warn("Audio tracks were reset while loading level "+o)}else this.cachedTrackLoadedData=e},x._handleFragmentLoadProgress=function(t){var e,r=t.frag,n=t.part,o=t.payload,s=this.config,l=this.trackId,u=this.levels;if(u){var d=u[l];i.assert(d,"Audio track is defined on fragment load progress");var g=d.details;i.assert(g,"Audio track details are defined on fragment load progress");var v=s.defaultAudioCodec||d.audioCodec||"mp4a.40.2",m=this.transmuxer;m||(m=this.transmuxer=new f.default(this.hls,c.PlaylistLevelType.AUDIO,this._handleTransmuxComplete.bind(this),this._handleTransmuxerFlush.bind(this)));var y=this.initPTS[r.cc],b=null===(e=r.initSegment)||void 0===e?void 0:e.data;if(void 0!==y){var E=n?n.index:-1,x=-1!==E,S=new p.ChunkMetadata(r.level,r.sn,r.stats.chunkCount,o.byteLength,E,x);m.push(o,b,v,"",r,n,g.totalduration,!1,S,y)}else this.log("Unknown video PTS for cc "+r.cc+", waiting for video PTS before demuxing audio frag "+r.sn+" of ["+g.startSN+" ,"+g.endSN+"],track "+l),(this.waitingData=this.waitingData||{frag:r,part:n,cache:new h.default,complete:!1}).cache.push(new Uint8Array(o)),this.waitingVideoCC=this.videoTrackCC,this.state=a.State.WAITING_INIT_PTS}else this.warn("Audio tracks were reset while fragment load was in progress. Fragment "+r.sn+" of level "+r.level+" will not be buffered")},x._handleFragmentLoadComplete=function(e){this.waitingData?this.waitingData.complete=!0:t.prototype._handleFragmentLoadComplete.call(this,e)},x.onBufferReset=function(){this.mediaBuffer=this.videoBuffer=null,this.loadedmetadata=!1},x.onBufferCreated=function(t,e){var r=e.tracks.audio;r&&(this.mediaBuffer=r.buffer||null),e.tracks.video&&(this.videoBuffer=e.tracks.video.buffer||null)},x.onFragBuffered=function(t,e){var r,n=e.frag,i=e.part;n.type===c.PlaylistLevelType.AUDIO?this.fragContextChanged(n)?this.warn("Fragment "+n.sn+(i?" p: "+i.index:"")+" of level "+n.level+" finished buffering, but was aborted. state: "+this.state+", audioSwitch: "+this.audioSwitch):("initSegment"!==n.sn&&(this.fragPrevious=n,this.audioSwitch&&(this.audioSwitch=!1,this.hls.trigger(o.Events.AUDIO_TRACK_SWITCHED,{id:this.trackId}))),this.fragBufferedComplete(n,i)):this.loadedmetadata||n.type!==c.PlaylistLevelType.MAIN||null!==(r=this.videoBuffer||this.media)&&void 0!==r&&r.buffered.length&&(this.loadedmetadata=!0)},x.onError=function(e,r){if(r.type!==m.ErrorTypes.KEY_SYSTEM_ERROR)switch(r.details){case m.ErrorDetails.FRAG_LOAD_ERROR:case m.ErrorDetails.FRAG_LOAD_TIMEOUT:case m.ErrorDetails.FRAG_PARSING_ERROR:case m.ErrorDetails.KEY_LOAD_ERROR:case m.ErrorDetails.KEY_LOAD_TIMEOUT:this.onFragmentOrKeyLoadError(c.PlaylistLevelType.AUDIO,r);break;case m.ErrorDetails.AUDIO_TRACK_LOAD_ERROR:case m.ErrorDetails.AUDIO_TRACK_LOAD_TIMEOUT:this.state!==a.State.ERROR&&this.state!==a.State.STOPPED&&(this.state=r.fatal?a.State.ERROR:a.State.IDLE,this.warn(r.details+" while loading frag, switching to "+this.state+" state"));break;case m.ErrorDetails.BUFFER_FULL_ERROR:if("audio"===r.parent&&(this.state===a.State.PARSING||this.state===a.State.PARSED)){var n=!0,i=this.getFwdBufferInfo(this.mediaBuffer,c.PlaylistLevelType.AUDIO);i&&i.len>.5&&(n=!this.reduceMaxBufferLength(i.len)),n&&(this.warn("Buffer full error also media.currentTime is not buffered, flush audio buffer"),this.fragCurrent=null,t.prototype.flushMainBuffer.call(this,0,Number.POSITIVE_INFINITY,"audio")),this.resetLoadingState()}}else this.onFragmentOrKeyLoadError(c.PlaylistLevelType.AUDIO,r)},x.onBufferFlushed=function(t,e){e.type===d.ElementaryStreamTypes.AUDIO&&(this.bufferFlushed=!0,this.state===a.State.ENDED&&(this.state=a.State.IDLE))},x._handleTransmuxComplete=function(t){var e,r="audio",n=this.hls,i=t.remuxResult,s=t.chunkMeta,l=this.getCurrentContext(s);if(!l)return this.warn("The loading context changed while buffering fragment "+s.sn+" of level "+s.level+". This chunk will not be buffered."),void this.resetStartWhenNotLoaded(s.level);var u=l.frag,c=l.part,h=l.level.details,f=i.audio,p=i.text,g=i.id3,v=i.initSegment;if(!this.fragContextChanged(u)&&h){if(this.state=a.State.PARSING,this.audioSwitch&&f&&this.completeAudioSwitch(),null!=v&&v.tracks&&(this._bufferInitSegment(v.tracks,u,s),n.trigger(o.Events.FRAG_PARSING_INIT_SEGMENT,{frag:u,id:r,tracks:v.tracks})),f){var m=f.startPTS,b=f.endPTS,E=f.startDTS,x=f.endDTS;c&&(c.elementaryStreams[d.ElementaryStreamTypes.AUDIO]={startPTS:m,endPTS:b,startDTS:E,endDTS:x}),u.setElementaryStreamInfo(d.ElementaryStreamTypes.AUDIO,m,b,E,x),this.bufferFragmentData(f,u,c,s)}if(null!=g&&null!==(e=g.samples)&&void 0!==e&&e.length){var S=y({id:r,frag:u,details:h},g);n.trigger(o.Events.FRAG_PARSING_METADATA,S)}if(p){var T=y({id:r,frag:u,details:h},p);n.trigger(o.Events.FRAG_PARSING_USERDATA,T)}}},x._bufferInitSegment=function(t,e,r){if(this.state===a.State.PARSING){t.video&&delete t.video;var n=t.audio;if(n){n.levelCodec=n.codec,n.id="audio",this.log("Init audio buffer, container:"+n.container+", codecs[parsed]=["+n.codec+"]"),this.hls.trigger(o.Events.BUFFER_CODECS,t);var i=n.initSegment;if(null!=i&&i.byteLength){var s={type:"audio",frag:e,part:null,chunkMeta:r,parent:e.type,data:i};this.hls.trigger(o.Events.BUFFER_APPENDING,s)}this.tick()}}},x.loadFragment=function(e,r,i){var o=this.fragmentTracker.getState(e);this.fragCurrent=e,(this.audioSwitch||o===l.FragmentState.NOT_LOADED||o===l.FragmentState.PARTIAL)&&("initSegment"===e.sn?this._loadInitSegment(e,r):r.live&&!(0,n.isFiniteNumber)(this.initPTS[e.cc])?(this.log("Waiting for video PTS in continuity counter "+e.cc+" of live stream before loading audio fragment "+e.sn+" of level "+this.trackId),this.state=a.State.WAITING_INIT_PTS):(this.startFragRequested=!0,t.prototype.loadFragment.call(this,e,r,i)))},x.completeAudioSwitch=function(){var e=this.hls,r=this.media,n=this.trackId;r&&(this.log("Switching audio track : flushing all audio"),t.prototype.flushMainBuffer.call(this,0,Number.POSITIVE_INFINITY,"audio")),this.audioSwitch=!1,e.trigger(o.Events.AUDIO_TRACK_SWITCHED,{id:n})},E}(a.default)},"./src/controller/audio-track-controller.ts":(t,e,r)=>{"use strict";r.r(e),r.d(e,{default:()=>c});var n=r("./src/events.ts"),a=r("./src/errors.ts"),o=r("./src/controller/base-playlist-controller.ts"),s=r("./src/types/loader.ts");function l(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,(void 0,"symbol"==typeof(i=function(t,e){if("object"!=typeof t||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(n.key))?i:String(i)),n)}var i}function u(t,e){return u=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},u(t,e)}const c=function(t){var e,r;function o(e){var r;return(r=t.call(this,e,"[audio-track-controller]")||this).tracks=[],r.groupId=null,r.tracksInGroup=[],r.trackId=-1,r.trackName="",r.selectDefaultTrack=!0,r.registerListeners(),r}r=t,(e=o).prototype=Object.create(r.prototype),e.prototype.constructor=e,u(e,r);var c,d,h=o.prototype;return h.registerListeners=function(){var t=this.hls;t.on(n.Events.MANIFEST_LOADING,this.onManifestLoading,this),t.on(n.Events.MANIFEST_PARSED,this.onManifestParsed,this),t.on(n.Events.LEVEL_LOADING,this.onLevelLoading,this),t.on(n.Events.LEVEL_SWITCHING,this.onLevelSwitching,this),t.on(n.Events.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),t.on(n.Events.ERROR,this.onError,this)},h.unregisterListeners=function(){var t=this.hls;t.off(n.Events.MANIFEST_LOADING,this.onManifestLoading,this),t.off(n.Events.MANIFEST_PARSED,this.onManifestParsed,this),t.off(n.Events.LEVEL_LOADING,this.onLevelLoading,this),t.off(n.Events.LEVEL_SWITCHING,this.onLevelSwitching,this),t.off(n.Events.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),t.off(n.Events.ERROR,this.onError,this)},h.destroy=function(){this.unregisterListeners(),this.tracks.length=0,this.tracksInGroup.length=0,t.prototype.destroy.call(this)},h.onManifestLoading=function(){this.tracks=[],this.groupId=null,this.tracksInGroup=[],this.trackId=-1,this.trackName="",this.selectDefaultTrack=!0},h.onManifestParsed=function(t,e){this.tracks=e.audioTracks||[]},h.onAudioTrackLoaded=function(t,e){var r=e.id,n=e.details,i=this.tracksInGroup[r];if(i){var a=i.details;i.details=e.details,this.log("audioTrack "+r+" loaded ["+n.startSN+"-"+n.endSN+"]"),r===this.trackId&&(this.retryCount=0,this.playlistLoaded(r,e,a))}else this.warn("Invalid audio track id "+r)},h.onLevelLoading=function(t,e){this.switchLevel(e.level)},h.onLevelSwitching=function(t,e){this.switchLevel(e.level)},h.switchLevel=function(t){var e=this.hls.levels[t];if(null!=e&&e.audioGroupIds){var r=e.audioGroupIds[e.urlId];if(this.groupId!==r){this.groupId=r;var i=this.tracks.filter((function(t){return!r||t.groupId===r}));this.selectDefaultTrack&&!i.some((function(t){return t.default}))&&(this.selectDefaultTrack=!1),this.tracksInGroup=i;var a={audioTracks:i};this.log("Updating audio tracks, "+i.length+' track(s) found in "'+r+'" group-id'),this.hls.trigger(n.Events.AUDIO_TRACKS_UPDATED,a),this.selectInitialTrack()}}},h.onError=function(e,r){t.prototype.onError.call(this,e,r),!r.fatal&&r.context&&r.context.type===s.PlaylistContextType.AUDIO_TRACK&&r.context.id===this.trackId&&r.context.groupId===this.groupId&&this.retryLoadingOrFail(r)},h.setAudioTrack=function(t){var e=this.tracksInGroup;if(t<0||t>=e.length)this.warn("Invalid id passed to audio-track controller");else{this.clearTimer();var r=e[this.trackId];this.log("Now switching to audio-track index "+t);var i=e[t],a=i.id,o=i.groupId,s=void 0===o?"":o,l=i.name,u=i.type,c=i.url;if(this.trackId=t,this.trackName=l,this.selectDefaultTrack=!1,this.hls.trigger(n.Events.AUDIO_TRACK_SWITCHING,{id:a,groupId:s,name:l,type:u,url:c}),!i.details||i.details.live){var d=this.switchParams(i.url,null==r?void 0:r.details);this.loadPlaylist(d)}}},h.selectInitialTrack=function(){var t=this.tracksInGroup;i.assert(t.length,"Initial audio track should be selected when tracks are known");var e=this.trackName,r=this.findTrackId(e)||this.findTrackId();-1!==r?this.setAudioTrack(r):(this.warn("No track found for running audio group-ID: "+this.groupId),this.hls.trigger(n.Events.ERROR,{type:a.ErrorTypes.MEDIA_ERROR,details:a.ErrorDetails.AUDIO_TRACK_LOAD_ERROR,fatal:!0}))},h.findTrackId=function(t){for(var e=this.tracksInGroup,r=0;r<e.length;r++){var n=e[r];if((!this.selectDefaultTrack||n.default)&&(!t||t===n.name))return n.id}return-1},h.loadPlaylist=function(e){t.prototype.loadPlaylist.call(this);var r=this.tracksInGroup[this.trackId];if(this.shouldLoadTrack(r)){var i=r.id,a=r.groupId,o=r.url;if(e)try{o=e.addDirectives(o)}catch(t){this.warn("Could not construct new URL with HLS Delivery Directives: "+t)}this.log("loading audio-track playlist for id: "+i),this.clearTimer(),this.hls.trigger(n.Events.AUDIO_TRACK_LOADING,{url:o,id:i,groupId:a,deliveryDirectives:e||null})}},c=o,(d=[{key:"audioTracks",get:function(){return this.tracksInGroup}},{key:"audioTrack",get:function(){return this.trackId},set:function(t){this.selectDefaultTrack=!1,this.setAudioTrack(t)}}])&&l(c.prototype,d),Object.defineProperty(c,"prototype",{writable:!1}),o}(o.default)},"./src/controller/base-playlist-controller.ts":(t,e,r)=>{"use strict";r.r(e),r.d(e,{default:()=>s});var n=r("./src/types/level.ts"),i=r("./src/controller/level-helper.ts"),a=r("./src/utils/logger.ts"),o=r("./src/errors.ts"),s=function(){function t(t,e){this.hls=void 0,this.timer=-1,this.requestScheduled=-1,this.canLoad=!1,this.retryCount=0,this.log=void 0,this.warn=void 0,this.log=a.logger.log.bind(a.logger,e+":"),this.warn=a.logger.warn.bind(a.logger,e+":"),this.hls=t}var e=t.prototype;return e.destroy=function(){this.clearTimer(),this.hls=this.log=this.warn=null},e.onError=function(t,e){!e.fatal||e.type!==o.ErrorTypes.NETWORK_ERROR&&e.type!==o.ErrorTypes.KEY_SYSTEM_ERROR||this.stopLoad()},e.clearTimer=function(){clearTimeout(this.timer),this.timer=-1},e.startLoad=function(){this.canLoad=!0,this.retryCount=0,this.requestScheduled=-1,this.loadPlaylist()},e.stopLoad=function(){this.canLoad=!1,this.clearTimer()},e.switchParams=function(t,e){var r=null==e?void 0:e.renditionReports;if(r)for(var i=0;i<r.length;i++){var o=r[i],s=void 0;try{s=new self.URL(o.URI,e.url).href}catch(t){a.logger.warn("Could not construct new URL for Rendition Report: "+t),s=o.URI||""}if(s===t.slice(-s.length)){var l=parseInt(o["LAST-MSN"])||(null==e?void 0:e.lastPartSn),u=parseInt(o["LAST-PART"])||(null==e?void 0:e.lastPartIndex);if(this.hls.config.lowLatencyMode){var c=Math.min(e.age-e.partTarget,e.targetduration);u>=0&&c>e.partTarget&&(u+=1)}return new n.HlsUrlParameters(l,u>=0?u:void 0,n.HlsSkip.No)}}},e.loadPlaylist=function(t){-1===this.requestScheduled&&(this.requestScheduled=self.performance.now())},e.shouldLoadTrack=function(t){return this.canLoad&&t&&!!t.url&&(!t.details||t.details.live)},e.playlistLoaded=function(t,e,r){var n=this,a=e.details,o=e.stats,s=self.performance.now(),l=o.loading.first?Math.max(0,s-o.loading.first):0;if(a.advancedDateTime=Date.now()-l,a.live||null!=r&&r.live){if(a.reloaded(r),r&&this.log("live playlist "+t+" "+(a.advanced?"REFRESHED "+a.lastPartSn+"-"+a.lastPartIndex:"MISSED")),r&&a.fragments.length>0&&(0,i.mergeDetails)(r,a),!this.canLoad||!a.live)return;var u,c=void 0,d=void 0;if(a.canBlockReload&&a.endSN&&a.advanced){var h=this.hls.config.lowLatencyMode,f=a.lastPartSn,p=a.endSN,g=a.lastPartIndex,v=f===p;-1!==g?(c=v?p+1:f,d=v?h?0:g:g+1):c=p+1;var m=a.age,y=m+a.ageHeader,b=Math.min(y-a.partTarget,1.5*a.targetduration);if(b>0){if(r&&b>r.tuneInGoal)this.warn("CDN Tune-in goal increased from: "+r.tuneInGoal+" to: "+b+" with playlist age: "+a.age),b=0;else{var E=Math.floor(b/a.targetduration);c+=E,void 0!==d&&(d+=Math.round(b%a.targetduration/a.partTarget)),this.log("CDN Tune-in age: "+a.ageHeader+"s last advanced "+m.toFixed(2)+"s goal: "+b+" skip sn "+E+" to part "+d)}a.tuneInGoal=b}if(u=this.getDeliveryDirectives(a,e.deliveryDirectives,c,d),h||!v)return void this.loadPlaylist(u)}else u=this.getDeliveryDirectives(a,e.deliveryDirectives,c,d);var x=this.hls.mainForwardBufferInfo,S=x?x.end-x.len:0,T=1e3*(a.edge-S),w=(0,i.computeReloadInterval)(a,T);a.updated?s>this.requestScheduled+w&&(this.requestScheduled=o.loading.start):this.requestScheduled=-1,void 0!==c&&a.canBlockReload?this.requestScheduled=o.loading.first+w-(1e3*a.partTarget||1e3):this.requestScheduled=(-1===this.requestScheduled?s:this.requestScheduled)+w;var _=this.requestScheduled-s;_=Math.max(0,_),this.log("reload live playlist "+t+" in "+Math.round(_)+" ms"),this.timer=self.setTimeout((function(){return n.loadPlaylist(u)}),_)}else this.clearTimer()},e.getDeliveryDirectives=function(t,e,r,i){var a=(0,n.getSkipValue)(t,r);return null!=e&&e.skip&&t.deltaUpdateFailed&&(r=e.msn,i=e.part,a=n.HlsSkip.No),new n.HlsUrlParameters(r,i,a)},e.retryLoadingOrFail=function(t){var e,r=this,n=this.hls.config,i=this.retryCount<n.levelLoadingMaxRetry;if(i)if(this.requestScheduled=-1,this.retryCount++,t.details.indexOf("LoadTimeOut")>-1&&null!==(e=t.context)&&void 0!==e&&e.deliveryDirectives)this.warn("retry playlist loading #"+this.retryCount+' after "'+t.details+'"'),this.loadPlaylist();else{var a=Math.min(Math.pow(2,this.retryCount)*n.levelLoadingRetryDelay,n.levelLoadingMaxRetryTimeout);this.timer=self.setTimeout((function(){return r.loadPlaylist()}),a),this.warn("retry playlist loading #"+this.retryCount+" in "+a+' ms after "'+t.details+'"')}else this.warn('cannot recover from error "'+t.details+'"'),this.clearTimer(),t.fatal=!0;return i},t}()},"./src/controller/base-stream-controller.ts":(t,e,r)=>{"use strict";r.r(e),r.d(e,{State:()=>S,default:()=>T});var n=r("./src/polyfills/number.ts"),a=r("./src/task-loop.ts"),o=r("./src/controller/fragment-tracker.ts"),s=r("./src/utils/buffer-helper.ts"),l=r("./src/utils/logger.ts"),u=r("./src/events.ts"),c=r("./src/errors.ts"),d=r("./src/types/transmuxer.ts"),h=r("./src/utils/mp4-tools.ts"),f=r("./src/utils/discontinuities.ts"),p=r("./src/controller/fragment-finders.ts"),g=r("./src/controller/level-helper.ts"),v=r("./src/loader/fragment-loader.ts"),m=r("./src/crypt/decrypter.ts"),y=r("./src/utils/time-ranges.ts"),b=r("./src/types/loader.ts");function E(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,(void 0,"symbol"==typeof(i=function(t,e){if("object"!=typeof t||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(n.key))?i:String(i)),n)}var i}function x(t,e){return x=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},x(t,e)}var S={STOPPED:"STOPPED",IDLE:"IDLE",KEY_LOADING:"KEY_LOADING",FRAG_LOADING:"FRAG_LOADING",FRAG_LOADING_WAITING_RETRY:"FRAG_LOADING_WAITING_RETRY",WAITING_TRACK:"WAITING_TRACK",PARSING:"PARSING",PARSED:"PARSED",ENDED:"ENDED",ERROR:"ERROR",WAITING_INIT_PTS:"WAITING_INIT_PTS",WAITING_LEVEL:"WAITING_LEVEL"},T=function(t){var e,r;function a(e,r,n,i){var a;return(a=t.call(this)||this).hls=void 0,a.fragPrevious=null,a.fragCurrent=null,a.fragmentTracker=void 0,a.transmuxer=null,a._state=S.STOPPED,a.media=null,a.mediaBuffer=null,a.config=void 0,a.bitrateTest=!1,a.lastCurrentTime=0,a.nextLoadPosition=0,a.startPosition=0,a.loadedmetadata=!1,a.fragLoadError=0,a.retryDate=0,a.levels=null,a.fragmentLoader=void 0,a.keyLoader=void 0,a.levelLastLoaded=null,a.startFragRequested=!1,a.decrypter=void 0,a.initPTS=[],a.onvseeking=null,a.onvended=null,a.logPrefix="",a.log=void 0,a.warn=void 0,a.logPrefix=i,a.log=l.logger.log.bind(l.logger,i+":"),a.warn=l.logger.warn.bind(l.logger,i+":"),a.hls=e,a.fragmentLoader=new v.default(e.config),a.keyLoader=n,a.fragmentTracker=r,a.config=e.config,a.decrypter=new m.default(e.config),e.on(u.Events.LEVEL_SWITCHING,a.onLevelSwitching,function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(a)),a}r=t,(e=a).prototype=Object.create(r.prototype),e.prototype.constructor=e,x(e,r);var T,w,_=a.prototype;return _.doTick=function(){this.onTickEnd()},_.onTickEnd=function(){},_.startLoad=function(t){},_.stopLoad=function(){this.fragmentLoader.abort(),this.keyLoader.abort();var t=this.fragCurrent;t&&(t.abortRequests(),this.fragmentTracker.removeFragment(t)),this.resetTransmuxer(),this.fragCurrent=null,this.fragPrevious=null,this.clearInterval(),this.clearNextTick(),this.state=S.STOPPED},_._streamEnded=function(t,e){if(e.live||t.nextStart||!t.end||!this.media)return!1;var r=e.partList;if(null!=r&&r.length){var n=r[r.length-1];return s.BufferHelper.isBuffered(this.media,n.start+n.duration/2)}var i=e.fragments[e.fragments.length-1].type;return this.fragmentTracker.isEndListAppended(i)},_.getLevelDetails=function(){var t;if(this.levels&&null!==this.levelLastLoaded)return null===(t=this.levels[this.levelLastLoaded])||void 0===t?void 0:t.details},_.onMediaAttached=function(t,e){var r=this.media=this.mediaBuffer=e.media;this.onvseeking=this.onMediaSeeking.bind(this),this.onvended=this.onMediaEnded.bind(this),r.addEventListener("seeking",this.onvseeking),r.addEventListener("ended",this.onvended);var n=this.config;this.levels&&n.autoStartLoad&&this.state===S.STOPPED&&this.startLoad(n.startPosition)},_.onMediaDetaching=function(){var t=this.media;null!=t&&t.ended&&(this.log("MSE detaching and video ended, reset startPosition"),this.startPosition=this.lastCurrentTime=0),t&&this.onvseeking&&this.onvended&&(t.removeEventListener("seeking",this.onvseeking),t.removeEventListener("ended",this.onvended),this.onvseeking=this.onvended=null),this.keyLoader&&this.keyLoader.detach(),this.media=this.mediaBuffer=null,this.loadedmetadata=!1,this.fragmentTracker.removeAllFragments(),this.stopLoad()},_.onMediaSeeking=function(){var t=this.config,e=this.fragCurrent,r=this.media,i=this.mediaBuffer,a=this.state,o=r?r.currentTime:0,l=s.BufferHelper.bufferInfo(i||r,o,t.maxBufferHole);if(this.log("media seeking to "+((0,n.isFiniteNumber)(o)?o.toFixed(3):o)+", state: "+a),this.state===S.ENDED)this.resetLoadingState();else if(e){var u=t.maxFragLookUpTolerance,c=e.start-u,d=e.start+e.duration+u;if(!l.len||d<l.start||c>l.end){var h=o>d;(o<c||h)&&(h&&e.loader&&(this.log("seeking outside of buffer while fragment load in progress, cancel fragment load"),e.abortRequests()),this.resetLoadingState())}}r&&(this.lastCurrentTime=o),this.loadedmetadata||l.len||(this.nextLoadPosition=this.startPosition=o),this.tickImmediate()},_.onMediaEnded=function(){this.startPosition=this.lastCurrentTime=0},_.onLevelSwitching=function(t,e){this.fragLoadError=0},_.onHandlerDestroying=function(){this.stopLoad(),t.prototype.onHandlerDestroying.call(this)},_.onHandlerDestroyed=function(){this.state=S.STOPPED,this.hls.off(u.Events.LEVEL_SWITCHING,this.onLevelSwitching,this),this.fragmentLoader&&this.fragmentLoader.destroy(),this.keyLoader&&this.keyLoader.destroy(),this.decrypter&&this.decrypter.destroy(),this.hls=this.log=this.warn=this.decrypter=this.keyLoader=this.fragmentLoader=this.fragmentTracker=null,t.prototype.onHandlerDestroyed.call(this)},_.loadFragment=function(t,e,r){this._loadFragForPlayback(t,e,r)},_._loadFragForPlayback=function(t,e,r){var n=this;this._doFragLoad(t,e,r,(function(e){if(n.fragContextChanged(t))return n.warn("Fragment "+t.sn+(e.part?" p: "+e.part.index:"")+" of level "+t.level+" was dropped during download."),void n.fragmentTracker.removeFragment(t);t.stats.chunkCount++,n._handleFragmentLoadProgress(e)})).then((function(e){if(e){n.fragLoadError=0;var r=n.state;n.fragContextChanged(t)?(r===S.FRAG_LOADING||!n.fragCurrent&&r===S.PARSING)&&(n.fragmentTracker.removeFragment(t),n.state=S.IDLE):("payload"in e&&(n.log("Loaded fragment "+t.sn+" of level "+t.level),n.hls.trigger(u.Events.FRAG_LOADED,e)),n._handleFragmentLoadComplete(e))}})).catch((function(e){n.state!==S.STOPPED&&n.state!==S.ERROR&&(n.warn(e),n.resetFragmentLoading(t))}))},_.flushMainBuffer=function(t,e,r){if(void 0===r&&(r=null),t-e){var n={startOffset:t,endOffset:e,type:r};this.fragLoadError=0,this.hls.trigger(u.Events.BUFFER_FLUSHING,n)}},_._loadInitSegment=function(t,e){var r=this;this._doFragLoad(t,e).then((function(e){if(!e||r.fragContextChanged(t)||!r.levels)throw new Error("init load aborted");return e})).then((function(e){var n=r.hls,i=e.payload,a=t.decryptdata;if(i&&i.byteLength>0&&a&&a.key&&a.iv&&"AES-128"===a.method){var o=self.performance.now();return r.decrypter.decrypt(new Uint8Array(i),a.key.buffer,a.iv.buffer).then((function(r){var i=self.performance.now();return n.trigger(u.Events.FRAG_DECRYPTED,{frag:t,payload:r,stats:{tstart:o,tdecrypt:i}}),e.payload=r,e}))}return e})).then((function(e){var n=r.fragCurrent,a=r.hls,o=r.levels;if(!o)throw new Error("init load aborted, missing levels");var s=o[t.level].details;i.assert(s,"Level details are defined when init segment is loaded");var l=t.stats;r.state=S.IDLE,r.fragLoadError=0,t.data=new Uint8Array(e.payload),l.parsing.start=l.buffering.start=self.performance.now(),l.parsing.end=l.buffering.end=self.performance.now(),e.frag===n&&a.trigger(u.Events.FRAG_BUFFERED,{stats:l,frag:n,part:null,id:t.type}),r.tick()})).catch((function(e){r.state!==S.STOPPED&&r.state!==S.ERROR&&(r.warn(e),r.resetFragmentLoading(t))}))},_.fragContextChanged=function(t){var e=this.fragCurrent;return!t||!e||t.level!==e.level||t.sn!==e.sn||t.urlId!==e.urlId},_.fragBufferedComplete=function(t,e){var r,n,i=this.mediaBuffer?this.mediaBuffer:this.media;this.log("Buffered "+t.type+" sn: "+t.sn+(e?" part: "+e.index:"")+" of "+("[stream-controller]"===this.logPrefix?"level":"track")+" "+t.level+" "+(i?y.default.toString(s.BufferHelper.getBuffered(i)):"(detached)")),this.state=S.IDLE,i&&(!this.loadedmetadata&&t.type==b.PlaylistLevelType.MAIN&&i.buffered.length&&(null===(r=this.fragCurrent)||void 0===r?void 0:r.sn)===(null===(n=this.fragPrevious)||void 0===n?void 0:n.sn)&&(this.loadedmetadata=!0,this.seekToStartPos()),this.tick())},_.seekToStartPos=function(){},_._handleFragmentLoadComplete=function(t){var e=this.transmuxer;if(e){var r=t.frag,n=t.part,i=t.partsLoaded,a=!i||0===i.length||i.some((function(t){return!t})),o=new d.ChunkMetadata(r.level,r.sn,r.stats.chunkCount+1,0,n?n.index:-1,!a);e.flush(o)}},_._handleFragmentLoadProgress=function(t){},_._doFragLoad=function(t,e,r,i){var a,o=this;if(void 0===r&&(r=null),!this.levels)throw new Error("frag load aborted, missing levels");var s=null;if(!t.encrypted||null!==(a=t.decryptdata)&&void 0!==a&&a.key?!t.encrypted&&e.encryptedFragments.length&&this.keyLoader.loadClear(t,e.encryptedFragments):(this.log("Loading key for "+t.sn+" of ["+e.startSN+"-"+e.endSN+"], "+("[stream-controller]"===this.logPrefix?"level":"track")+" "+t.level),this.state=S.KEY_LOADING,this.fragCurrent=t,s=this.keyLoader.load(t).then((function(t){if(!o.fragContextChanged(t.frag))return o.hls.trigger(u.Events.KEY_LOADED,t),t})),this.hls.trigger(u.Events.KEY_LOADING,{frag:t}),this.throwIfFragContextChanged("KEY_LOADING")),r=Math.max(t.start,r||0),this.config.lowLatencyMode&&e){var l=e.partList;if(l&&i){r>t.end&&e.fragmentHint&&(t=e.fragmentHint);var c=this.getNextPart(l,t,r);if(c>-1){var d=l[c];return this.log("Loading part sn: "+t.sn+" p: "+d.index+" cc: "+t.cc+" of playlist ["+e.startSN+"-"+e.endSN+"] parts [0-"+c+"-"+(l.length-1)+"] "+("[stream-controller]"===this.logPrefix?"level":"track")+": "+t.level+", target: "+parseFloat(r.toFixed(3))),this.nextLoadPosition=d.start+d.duration,this.state=S.FRAG_LOADING,this.hls.trigger(u.Events.FRAG_LOADING,{frag:t,part:l[c],targetBufferTime:r}),this.throwIfFragContextChanged("FRAG_LOADING parts"),s?s.then((function(e){return!e||o.fragContextChanged(e.frag)?null:o.doFragPartsLoad(t,l,c,i)})).catch((function(t){return o.handleFragLoadError(t)})):this.doFragPartsLoad(t,l,c,i).catch((function(t){return o.handleFragLoadError(t)}))}if(!t.url||this.loadedEndOfParts(l,r))return Promise.resolve(null)}}this.log("Loading fragment "+t.sn+" cc: "+t.cc+" "+(e?"of ["+e.startSN+"-"+e.endSN+"] ":"")+("[stream-controller]"===this.logPrefix?"level":"track")+": "+t.level+", target: "+parseFloat(r.toFixed(3))),(0,n.isFiniteNumber)(t.sn)&&!this.bitrateTest&&(this.nextLoadPosition=t.start+t.duration),this.state=S.FRAG_LOADING,this.hls.trigger(u.Events.FRAG_LOADING,{frag:t,targetBufferTime:r}),this.throwIfFragContextChanged("FRAG_LOADING");var h=this.config.progressive;return h&&s?s.then((function(e){return!e||o.fragContextChanged(null==e?void 0:e.frag)?null:o.fragmentLoader.load(t,i)})).catch((function(t){return o.handleFragLoadError(t)})):Promise.all([this.fragmentLoader.load(t,h?i:void 0),s]).then((function(t){var e=t[0];return!h&&e&&i&&i(e),e})).catch((function(t){return o.handleFragLoadError(t)}))},_.throwIfFragContextChanged=function(t){if(null===this.fragCurrent)throw new Error("frag load aborted, context changed in "+t)},_.doFragPartsLoad=function(t,e,r,n){var i=this;return new Promise((function(a,o){var s=[];!function r(l){var c=e[l];i.fragmentLoader.loadPart(t,c,n).then((function(n){s[c.index]=n;var o=n.part;i.hls.trigger(u.Events.FRAG_LOADED,n);var d=e[l+1];if(!d||d.fragment!==t)return a({frag:t,part:o,partsLoaded:s});r(l+1)})).catch(o)}(r)}))},_.handleFragLoadError=function(t){if("data"in t){var e=t.data;t.data&&e.details===c.ErrorDetails.INTERNAL_ABORTED?this.handleFragLoadAborted(e.frag,e.part):this.hls.trigger(u.Events.ERROR,e)}else this.hls.trigger(u.Events.ERROR,{type:c.ErrorTypes.OTHER_ERROR,details:c.ErrorDetails.INTERNAL_EXCEPTION,err:t,fatal:!0});return null},_._handleTransmuxerFlush=function(t){var e=this.getCurrentContext(t);if(e&&this.state===S.PARSING){var r=e.frag,n=e.part,i=e.level,a=self.performance.now();r.stats.parsing.end=a,n&&(n.stats.parsing.end=a),this.updateLevelTiming(r,n,i,t.partial)}else this.fragCurrent||this.state===S.STOPPED||this.state===S.ERROR||(this.state=S.IDLE)},_.getCurrentContext=function(t){var e=this.levels,r=t.level,n=t.sn,i=t.part;if(!e||!e[r])return this.warn("Levels object was unset while buffering fragment "+n+" of level "+r+". The current chunk will not be buffered."),null;var a=e[r],o=i>-1?(0,g.getPartWith)(a,n,i):null,s=o?o.fragment:(0,g.getFragmentWithSN)(a,n,this.fragCurrent);return s?{frag:s,part:o,level:a}:null},_.bufferFragmentData=function(t,e,r,n){if(t&&this.state===S.PARSING){var i=t.data1,a=t.data2,o=i;if(i&&a&&(o=(0,h.appendUint8Array)(i,a)),o&&o.length){var s={type:t.type,frag:e,part:r,chunkMeta:n,parent:e.type,data:o};this.hls.trigger(u.Events.BUFFER_APPENDING,s),t.dropped&&t.independent&&!r&&this.flushBufferGap(e)}}},_.flushBufferGap=function(t){var e=this.media;if(e)if(s.BufferHelper.isBuffered(e,e.currentTime)){var r=e.currentTime,n=s.BufferHelper.bufferInfo(e,r,0),i=t.duration,a=Math.min(2*this.config.maxFragLookUpTolerance,.25*i),o=Math.max(Math.min(t.start-a,n.end-a),r+a);t.start-o>a&&this.flushMainBuffer(o,t.start)}else this.flushMainBuffer(0,t.start)},_.getFwdBufferInfo=function(t,e){var r=this.config,i=this.getLoadPosition();if(!(0,n.isFiniteNumber)(i))return null;var a=s.BufferHelper.bufferInfo(t,i,r.maxBufferHole);if(0===a.len&&void 0!==a.nextStart){var o=this.fragmentTracker.getBufferedFrag(i,e);if(o&&a.nextStart<o.end)return s.BufferHelper.bufferInfo(t,i,Math.max(a.nextStart,r.maxBufferHole))}return a},_.getMaxBufferLength=function(t){var e,r=this.config;return e=t?Math.max(8*r.maxBufferSize/t,r.maxBufferLength):r.maxBufferLength,Math.min(e,r.maxMaxBufferLength)},_.reduceMaxBufferLength=function(t){var e=this.config,r=t||e.maxBufferLength;return e.maxMaxBufferLength>=r&&(e.maxMaxBufferLength/=2,this.warn("Reduce max buffer length to "+e.maxMaxBufferLength+"s"),!0)},_.getNextFragment=function(t,e){var r=e.fragments,n=r.length;if(!n)return null;var i,a=this.config,o=r[0].start;if(e.live){var s=a.initialLiveManifestSize;if(n<s)return this.warn("Not enough fragments to start playback (have: "+n+", need: "+s+")"),null;e.PTSKnown||this.startFragRequested||-1!==this.startPosition||(i=this.getInitialLiveFragment(e,r),this.startPosition=i?this.hls.liveSyncPosition||i.start:t)}else t<=o&&(i=r[0]);if(!i){var l=a.lowLatencyMode?e.partEnd:e.fragmentEnd;i=this.getFragmentAtPosition(t,l,e)}return this.mapToInitFragWhenRequired(i)},_.mapToInitFragWhenRequired=function(t){return null==t||!t.initSegment||null!=t&&t.initSegment.data||this.bitrateTest?t:t.initSegment},_.getNextPart=function(t,e,r){for(var n=-1,i=!1,a=!0,o=0,s=t.length;o<s;o++){var l=t[o];if(a=a&&!l.independent,n>-1&&r<l.start)break;var u=l.loaded;u?n=-1:(i||l.independent||a)&&l.fragment===e&&(n=o),i=u}return n},_.loadedEndOfParts=function(t,e){var r=t[t.length-1];return r&&e>r.start&&r.loaded},_.getInitialLiveFragment=function(t,e){var r=this.fragPrevious,n=null;if(r){if(t.hasProgramDateTime&&(this.log("Live playlist, switching playlist, load frag with same PDT: "+r.programDateTime),n=(0,p.findFragmentByPDT)(e,r.endProgramDateTime,this.config.maxFragLookUpTolerance)),!n){var i=r.sn+1;if(i>=t.startSN&&i<=t.endSN){var a=e[i-t.startSN];r.cc===a.cc&&(n=a,this.log("Live playlist, switching playlist, load frag with next SN: "+n.sn))}n||(n=(0,p.findFragWithCC)(e,r.cc))&&this.log("Live playlist, switching playlist, load frag with same CC: "+n.sn)}}else{var o=this.hls.liveSyncPosition;null!==o&&(n=this.getFragmentAtPosition(o,this.bitrateTest?t.fragmentEnd:t.edge,t))}return n},_.getFragmentAtPosition=function(t,e,r){var n,i=this.config,a=this.fragPrevious,s=r.fragments,l=r.endSN,u=r.fragmentHint,c=i.maxFragLookUpTolerance,d=!!(i.lowLatencyMode&&r.partList&&u);if(d&&u&&!this.bitrateTest&&(s=s.concat(u),l=u.sn),t<e){var h=t>e-c?0:c;n=(0,p.findFragmentByPTS)(a,s,t,h)}else n=s[s.length-1];if(n){var f=n.sn-r.startSN;if(this.fragmentTracker.getState(n)===o.FragmentState.OK&&(a=n),a&&n.sn===a.sn&&!d&&a&&n.level===a.level){var g=s[f+1];n.sn<l&&this.fragmentTracker.getState(g)!==o.FragmentState.OK?(this.log("SN "+n.sn+" just loaded, load next one: "+g.sn),n=g):n=null}}return n},_.synchronizeToLiveEdge=function(t){var e=this.config,r=this.media;if(r){var n=this.hls.liveSyncPosition,i=r.currentTime,a=t.fragments[0].start,o=t.edge,s=i>=a-e.maxFragLookUpTolerance&&i<=o;if(null!==n&&r.duration>n&&(i<n||!s)){var l=void 0!==e.liveMaxLatencyDuration?e.liveMaxLatencyDuration:e.liveMaxLatencyDurationCount*t.targetduration;(!s&&r.readyState<4||i<o-l)&&(this.loadedmetadata||(this.nextLoadPosition=n),r.readyState&&(this.warn("Playback: "+i.toFixed(3)+" is located too far from the end of live sliding playlist: "+o+", reset currentTime to : "+n.toFixed(3)),r.currentTime=n))}}},_.alignPlaylists=function(t,e){var r=this.levels,i=this.levelLastLoaded,a=this.fragPrevious,o=null!==i?r[i]:null,s=t.fragments.length;if(!s)return this.warn("No fragments in live playlist"),0;var l=t.fragments[0].start,u=!e,c=t.alignedSliding&&(0,n.isFiniteNumber)(l);if(u||!c&&!l){(0,f.alignStream)(a,o,t);var d=t.fragments[0].start;return this.log("Live playlist sliding: "+d.toFixed(2)+" start-sn: "+(e?e.startSN:"na")+"->"+t.startSN+" prev-sn: "+(a?a.sn:"na")+" fragments: "+s),d}return l},_.waitForCdnTuneIn=function(t){return t.live&&t.canBlockReload&&t.partTarget&&t.tuneInGoal>Math.max(t.partHoldBack,3*t.partTarget)},_.setStartPosition=function(t,e){var r=this.startPosition;if(r<e&&(r=-1),-1===r||-1===this.lastCurrentTime){var i=t.startTimeOffset;(0,n.isFiniteNumber)(i)?(r=e+i,i<0&&(r+=t.totalduration),r=Math.min(Math.max(e,r),e+t.totalduration),this.log("Start time offset "+i+" found in playlist, adjust startPosition to "+r),this.startPosition=r):t.live?r=this.hls.liveSyncPosition||e:this.startPosition=r=0,this.lastCurrentTime=r}this.nextLoadPosition=r},_.getLoadPosition=function(){var t=this.media,e=0;return this.loadedmetadata&&t?e=t.currentTime:this.nextLoadPosition&&(e=this.nextLoadPosition),e},_.handleFragLoadAborted=function(t,e){this.transmuxer&&"initSegment"!==t.sn&&t.stats.aborted&&(this.warn("Fragment "+t.sn+(e?" part"+e.index:"")+" of level "+t.level+" was aborted"),this.resetFragmentLoading(t))},_.resetFragmentLoading=function(t){this.fragCurrent&&(this.fragContextChanged(t)||this.state===S.FRAG_LOADING_WAITING_RETRY)||(this.state=S.IDLE)},_.onFragmentOrKeyLoadError=function(t,e){if(e.fatal)return this.stopLoad(),void(this.state=S.ERROR);var r=this.config;if(e.chunkMeta){var n=this.getCurrentContext(e.chunkMeta);n&&(e.frag=n.frag,e.levelRetry=!0,this.fragLoadError=r.fragLoadingMaxRetry)}var a=e.frag;if(a&&a.type===t){var o=this.fragCurrent;if(i.assert(o&&a.sn===o.sn&&a.level===o.level&&a.urlId===o.urlId,"Frag load error must match current frag to retry"),this.fragLoadError+1<=r.fragLoadingMaxRetry){this.loadedmetadata||(this.startFragRequested=!1,this.nextLoadPosition=this.startPosition);var s=Math.min(Math.pow(2,this.fragLoadError)*r.fragLoadingRetryDelay,r.fragLoadingMaxRetryTimeout);this.warn("Fragment "+a.sn+" of "+t+" "+a.level+" failed to load, retrying in "+s+"ms"),this.retryDate=self.performance.now()+s,this.fragLoadError++,this.state=S.FRAG_LOADING_WAITING_RETRY}else e.levelRetry?(t===b.PlaylistLevelType.AUDIO&&(this.fragCurrent=null),this.fragLoadError=0,this.state=S.IDLE):(l.logger.error(e.details+" reaches max retry, redispatch as fatal ..."),e.fatal=!0,this.hls.stopLoad(),this.state=S.ERROR)}},_.afterBufferFlushed=function(t,e,r){if(t){var n=s.BufferHelper.getBuffered(t);this.fragmentTracker.detectEvictedFragments(e,n,r),this.state===S.ENDED&&this.resetLoadingState()}},_.resetLoadingState=function(){this.log("Reset loading state"),this.fragCurrent=null,this.fragPrevious=null,this.state=S.IDLE},_.resetStartWhenNotLoaded=function(t){if(!this.loadedmetadata){this.startFragRequested=!1;var e=this.levels?this.levels[t].details:null;null!=e&&e.live?(this.startPosition=-1,this.setStartPosition(e,0),this.resetLoadingState()):this.nextLoadPosition=this.startPosition}},_.updateLevelTiming=function(t,e,r,n){var a=this,o=r.details;i.assert(!!o,"level.details must be defined"),Object.keys(t.elementaryStreams).reduce((function(e,i){var s=t.elementaryStreams[i];if(s){var l=s.endPTS-s.startPTS;if(l<=0)return a.warn("Could not parse fragment "+t.sn+" "+i+" duration reliably ("+l+")"),e||!1;var c=n?0:(0,g.updateFragPTSDTS)(o,t,s.startPTS,s.endPTS,s.startDTS,s.endDTS);return a.hls.trigger(u.Events.LEVEL_PTS_UPDATED,{details:o,level:r,drift:c,type:i,frag:t,start:s.startPTS,end:s.endPTS}),!0}return e}),!1)||(this.warn("Found no media in fragment "+t.sn+" of level "+r.id+" resetting transmuxer to fallback to playlist timing"),this.resetTransmuxer()),this.state=S.PARSED,this.hls.trigger(u.Events.FRAG_PARSED,{frag:t,part:e})},_.resetTransmuxer=function(){this.transmuxer&&(this.transmuxer.destroy(),this.transmuxer=null)},T=a,(w=[{key:"state",get:function(){return this._state},set:function(t){var e=this._state;e!==t&&(this._state=t,this.log(e+"->"+t))}}])&&E(T.prototype,w),Object.defineProperty(T,"prototype",{writable:!1}),a}(a.default)},"./src/controller/buffer-controller.ts":(t,e,r)=>{"use strict";r.r(e),r.d(e,{default:()=>p});var n=r("./src/polyfills/number.ts"),a=r("./src/events.ts"),o=r("./src/utils/logger.ts"),s=r("./src/errors.ts"),l=r("./src/utils/buffer-helper.ts"),u=r("./src/utils/mediasource-helper.ts"),c=r("./src/loader/fragment.ts"),d=r("./src/controller/buffer-operation-queue.ts"),h=(0,u.getMediaSource)(),f=/([ha]vc.)(?:\.[^.,]+)+/,p=function(){function t(t){var e=this;this.details=null,this._objectUrl=null,this.operationQueue=void 0,this.listeners=void 0,this.hls=void 0,this.bufferCodecEventsExpected=0,this._bufferCodecEventsTotal=0,this.media=null,this.mediaSource=null,this.lastMpegAudioChunk=null,this.appendError=0,this.tracks={},this.pendingTracks={},this.sourceBuffer=void 0,this._onMediaSourceOpen=function(){var t=e.hls,r=e.media,n=e.mediaSource;o.logger.log("[buffer-controller]: Media source opened"),r&&(e.updateMediaElementDuration(),t.trigger(a.Events.MEDIA_ATTACHED,{media:r})),n&&n.removeEventListener("sourceopen",e._onMediaSourceOpen),e.checkPendingTracks()},this._onMediaSourceClose=function(){o.logger.log("[buffer-controller]: Media source closed")},this._onMediaSourceEnded=function(){o.logger.log("[buffer-controller]: Media source ended")},this.hls=t,this._initSourceBuffer(),this.registerListeners()}var e=t.prototype;return e.hasSourceTypes=function(){return this.getSourceBufferTypes().length>0||Object.keys(this.pendingTracks).length>0},e.destroy=function(){this.unregisterListeners(),this.details=null,this.lastMpegAudioChunk=null},e.registerListeners=function(){var t=this.hls;t.on(a.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),t.on(a.Events.MEDIA_DETACHING,this.onMediaDetaching,this),t.on(a.Events.MANIFEST_PARSED,this.onManifestParsed,this),t.on(a.Events.BUFFER_RESET,this.onBufferReset,this),t.on(a.Events.BUFFER_APPENDING,this.onBufferAppending,this),t.on(a.Events.BUFFER_CODECS,this.onBufferCodecs,this),t.on(a.Events.BUFFER_EOS,this.onBufferEos,this),t.on(a.Events.BUFFER_FLUSHING,this.onBufferFlushing,this),t.on(a.Events.LEVEL_UPDATED,this.onLevelUpdated,this),t.on(a.Events.FRAG_PARSED,this.onFragParsed,this),t.on(a.Events.FRAG_CHANGED,this.onFragChanged,this)},e.unregisterListeners=function(){var t=this.hls;t.off(a.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),t.off(a.Events.MEDIA_DETACHING,this.onMediaDetaching,this),t.off(a.Events.MANIFEST_PARSED,this.onManifestParsed,this),t.off(a.Events.BUFFER_RESET,this.onBufferReset,this),t.off(a.Events.BUFFER_APPENDING,this.onBufferAppending,this),t.off(a.Events.BUFFER_CODECS,this.onBufferCodecs,this),t.off(a.Events.BUFFER_EOS,this.onBufferEos,this),t.off(a.Events.BUFFER_FLUSHING,this.onBufferFlushing,this),t.off(a.Events.LEVEL_UPDATED,this.onLevelUpdated,this),t.off(a.Events.FRAG_PARSED,this.onFragParsed,this),t.off(a.Events.FRAG_CHANGED,this.onFragChanged,this)},e._initSourceBuffer=function(){this.sourceBuffer={},this.operationQueue=new d.default(this.sourceBuffer),this.listeners={audio:[],video:[],audiovideo:[]},this.lastMpegAudioChunk=null},e.onManifestParsed=function(t,e){var r=2;(e.audio&&!e.video||!e.altAudio)&&(r=1),this.bufferCodecEventsExpected=this._bufferCodecEventsTotal=r,this.details=null,o.logger.log(this.bufferCodecEventsExpected+" bufferCodec event(s) expected")},e.onMediaAttaching=function(t,e){var r=this.media=e.media;if(r&&h){var n=this.mediaSource=new h;n.addEventListener("sourceopen",this._onMediaSourceOpen),n.addEventListener("sourceended",this._onMediaSourceEnded),n.addEventListener("sourceclose",this._onMediaSourceClose),r.src=self.URL.createObjectURL(n),this._objectUrl=r.src}},e.onMediaDetaching=function(){var t=this.media,e=this.mediaSource,r=this._objectUrl;if(e){if(o.logger.log("[buffer-controller]: media source detaching"),"open"===e.readyState)try{e.endOfStream()}catch(t){o.logger.warn("[buffer-controller]: onMediaDetaching: "+t.message+" while calling endOfStream")}this.onBufferReset(),e.removeEventListener("sourceopen",this._onMediaSourceOpen),e.removeEventListener("sourceended",this._onMediaSourceEnded),e.removeEventListener("sourceclose",this._onMediaSourceClose),t&&(r&&self.URL.revokeObjectURL(r),t.src===r?(t.removeAttribute("src"),t.load()):o.logger.warn("[buffer-controller]: media.src was changed by a third party - skip cleanup")),this.mediaSource=null,this.media=null,this._objectUrl=null,this.bufferCodecEventsExpected=this._bufferCodecEventsTotal,this.pendingTracks={},this.tracks={}}this.hls.trigger(a.Events.MEDIA_DETACHED,void 0)},e.onBufferReset=function(){var t=this;this.getSourceBufferTypes().forEach((function(e){var r=t.sourceBuffer[e];try{r&&(t.removeBufferListeners(e),t.mediaSource&&t.mediaSource.removeSourceBuffer(r),t.sourceBuffer[e]=void 0)}catch(t){o.logger.warn("[buffer-controller]: Failed to reset the "+e+" buffer",t)}})),this._initSourceBuffer()},e.onBufferCodecs=function(t,e){var r=this,n=this.getSourceBufferTypes().length;Object.keys(e).forEach((function(t){if(n){var i=r.tracks[t];if(i&&"function"==typeof i.buffer.changeType){var a=e[t],s=a.id,l=a.codec,u=a.levelCodec,c=a.container,d=a.metadata,h=(i.levelCodec||i.codec).replace(f,"$1"),p=(u||l).replace(f,"$1");if(h!==p){var g=c+";codecs="+(u||l);r.appendChangeType(t,g),o.logger.log("[buffer-controller]: switching codec "+h+" to "+p),r.tracks[t]={buffer:i.buffer,codec:l,container:c,levelCodec:u,metadata:d,id:s}}}}else r.pendingTracks[t]=e[t]})),n||(this.bufferCodecEventsExpected=Math.max(this.bufferCodecEventsExpected-1,0),this.mediaSource&&"open"===this.mediaSource.readyState&&this.checkPendingTracks())},e.appendChangeType=function(t,e){var r=this,n=this.operationQueue,i={execute:function(){var i=r.sourceBuffer[t];i&&(o.logger.log("[buffer-controller]: changing "+t+" sourceBuffer type to "+e),i.changeType(e)),n.shiftAndExecuteNext(t)},onStart:function(){},onComplete:function(){},onError:function(e){o.logger.warn("[buffer-controller]: Failed to change "+t+" SourceBuffer type",e)}};n.append(i,t)},e.onBufferAppending=function(t,e){var r=this,n=this.hls,i=this.operationQueue,u=this.tracks,c=e.data,d=e.type,h=e.frag,f=e.part,p=e.chunkMeta,g=p.buffering[d],v=self.performance.now();g.start=v;var m=h.stats.buffering,y=f?f.stats.buffering:null;0===m.start&&(m.start=v),y&&0===y.start&&(y.start=v);var b=u.audio,E=!1;"audio"===d&&"audio/mpeg"===(null==b?void 0:b.container)&&(E=!this.lastMpegAudioChunk||1===p.id||this.lastMpegAudioChunk.sn!==p.sn,this.lastMpegAudioChunk=p);var x=h.start,S={execute:function(){if(g.executeStart=self.performance.now(),E){var t=r.sourceBuffer[d];if(t){var e=x-t.timestampOffset;Math.abs(e)>=.1&&(o.logger.log("[buffer-controller]: Updating audio SourceBuffer timestampOffset to "+x+" (delta: "+e+") sn: "+h.sn+")"),t.timestampOffset=x)}}r.appendExecutor(c,d)},onStart:function(){},onComplete:function(){var t=self.performance.now();g.executeEnd=g.end=t,0===m.first&&(m.first=t),y&&0===y.first&&(y.first=t);var e=r.sourceBuffer,n={};for(var i in e)n[i]=l.BufferHelper.getBuffered(e[i]);r.appendError=0,r.hls.trigger(a.Events.BUFFER_APPENDED,{type:d,frag:h,part:f,chunkMeta:p,parent:h.type,timeRanges:n})},onError:function(t){o.logger.error("[buffer-controller]: Error encountered while trying to append to the "+d+" SourceBuffer",t);var e={type:s.ErrorTypes.MEDIA_ERROR,parent:h.type,details:s.ErrorDetails.BUFFER_APPEND_ERROR,err:t,fatal:!1};t.code===DOMException.QUOTA_EXCEEDED_ERR?e.details=s.ErrorDetails.BUFFER_FULL_ERROR:(r.appendError++,e.details=s.ErrorDetails.BUFFER_APPEND_ERROR,r.appendError>n.config.appendErrorMaxRetry&&(o.logger.error("[buffer-controller]: Failed "+n.config.appendErrorMaxRetry+" times to append segment in sourceBuffer"),e.fatal=!0,n.stopLoad())),n.trigger(a.Events.ERROR,e)}};i.append(S,d)},e.onBufferFlushing=function(t,e){var r=this,n=this.operationQueue,i=function(t){return{execute:r.removeExecutor.bind(r,t,e.startOffset,e.endOffset),onStart:function(){},onComplete:function(){r.hls.trigger(a.Events.BUFFER_FLUSHED,{type:t})},onError:function(e){o.logger.warn("[buffer-controller]: Failed to remove from "+t+" SourceBuffer",e)}}};e.type?n.append(i(e.type),e.type):this.getSourceBufferTypes().forEach((function(t){n.append(i(t),t)}))},e.onFragParsed=function(t,e){var r=this,n=e.frag,i=e.part,s=[],l=i?i.elementaryStreams:n.elementaryStreams;l[c.ElementaryStreamTypes.AUDIOVIDEO]?s.push("audiovideo"):(l[c.ElementaryStreamTypes.AUDIO]&&s.push("audio"),l[c.ElementaryStreamTypes.VIDEO]&&s.push("video")),0===s.length&&o.logger.warn("Fragments must have at least one ElementaryStreamType set. type: "+n.type+" level: "+n.level+" sn: "+n.sn),this.blockBuffers((function(){var t=self.performance.now();n.stats.buffering.end=t,i&&(i.stats.buffering.end=t);var e=i?i.stats:n.stats;r.hls.trigger(a.Events.FRAG_BUFFERED,{frag:n,part:i,stats:e,id:n.type})}),s)},e.onFragChanged=function(t,e){this.flushBackBuffer()},e.onBufferEos=function(t,e){var r=this;this.getSourceBufferTypes().reduce((function(t,n){var i=r.sourceBuffer[n];return!i||e.type&&e.type!==n||(i.ending=!0,i.ended||(i.ended=!0,o.logger.log("[buffer-controller]: "+n+" sourceBuffer now EOS"))),t&&!(i&&!i.ended)}),!0)&&(o.logger.log("[buffer-controller]: Queueing mediaSource.endOfStream()"),this.blockBuffers((function(){r.getSourceBufferTypes().forEach((function(t){var e=r.sourceBuffer[t];e&&(e.ending=!1)}));var t=r.mediaSource;t&&"open"===t.readyState?(o.logger.log("[buffer-controller]: Calling mediaSource.endOfStream()"),t.endOfStream()):t&&o.logger.info("[buffer-controller]: Could not call mediaSource.endOfStream(). mediaSource.readyState: "+t.readyState)})))},e.onLevelUpdated=function(t,e){var r=e.details;r.fragments.length&&(this.details=r,this.getSourceBufferTypes().length?this.blockBuffers(this.updateMediaElementDuration.bind(this)):this.updateMediaElementDuration())},e.flushBackBuffer=function(){var t=this.hls,e=this.details,r=this.media,i=this.sourceBuffer;if(r&&null!==e){var s=this.getSourceBufferTypes();if(s.length){var u=e.live&&null!==t.config.liveBackBufferLength?t.config.liveBackBufferLength:t.config.backBufferLength;if((0,n.isFiniteNumber)(u)&&!(u<0)){var c=r.currentTime,d=e.levelTargetDuration,h=Math.max(u,d),f=Math.floor(c/d)*d-h;s.forEach((function(r){var n=i[r];if(n){var s=l.BufferHelper.getBuffered(n);if(s.length>0&&f>s.start(0)){if(t.trigger(a.Events.BACK_BUFFER_REACHED,{bufferEnd:f}),e.live)t.trigger(a.Events.LIVE_BACK_BUFFER_REACHED,{bufferEnd:f});else if(n.ended&&s.end(s.length-1)-c<2*d)return void o.logger.info("[buffer-controller]: Cannot flush "+r+" back buffer while SourceBuffer is in ended state");t.trigger(a.Events.BUFFER_FLUSHING,{startOffset:0,endOffset:f,type:r})}}}))}}}},e.updateMediaElementDuration=function(){if(this.details&&this.media&&this.mediaSource&&"open"===this.mediaSource.readyState){var t=this.details,e=this.hls,r=this.media,i=this.mediaSource,a=t.fragments[0].start+t.totalduration,s=r.duration,l=(0,n.isFiniteNumber)(i.duration)?i.duration:0;t.live&&e.config.liveDurationInfinity?(o.logger.log("[buffer-controller]: Media Source duration is set to Infinity"),i.duration=1/0,this.updateSeekableRange(t)):(a>l&&a>s||!(0,n.isFiniteNumber)(s))&&(o.logger.log("[buffer-controller]: Updating Media Source duration to "+a.toFixed(3)),i.duration=a)}},e.updateSeekableRange=function(t){var e=this.mediaSource,r=t.fragments;if(r.length&&t.live&&null!=e&&e.setLiveSeekableRange){var n=Math.max(0,r[0].start),i=Math.max(n,n+t.totalduration);e.setLiveSeekableRange(n,i)}},e.checkPendingTracks=function(){var t=this.bufferCodecEventsExpected,e=this.operationQueue,r=this.pendingTracks,n=Object.keys(r).length;if(n&&!t||2===n){this.createSourceBuffers(r),this.pendingTracks={};var i=this.getSourceBufferTypes();if(0===i.length)return void this.hls.trigger(a.Events.ERROR,{type:s.ErrorTypes.MEDIA_ERROR,details:s.ErrorDetails.BUFFER_INCOMPATIBLE_CODECS_ERROR,fatal:!0,reason:"could not create source buffer for media codec(s)"});i.forEach((function(t){e.executeNext(t)}))}},e.createSourceBuffers=function(t){var e=this.sourceBuffer,r=this.mediaSource;if(!r)throw Error("createSourceBuffers called when mediaSource was null");var n=0;for(var i in t)if(!e[i]){var l=t[i];if(!l)throw Error("source buffer exists for track "+i+", however track does not");var u=l.levelCodec||l.codec,c=l.container+";codecs="+u;o.logger.log("[buffer-controller]: creating sourceBuffer("+c+")");try{var d=e[i]=r.addSourceBuffer(c),h=i;this.addBufferListener(h,"updatestart",this._onSBUpdateStart),this.addBufferListener(h,"updateend",this._onSBUpdateEnd),this.addBufferListener(h,"error",this._onSBUpdateError),this.tracks[i]={buffer:d,codec:u,container:l.container,levelCodec:l.levelCodec,metadata:l.metadata,id:l.id},n++}catch(t){o.logger.error("[buffer-controller]: error while trying to add sourceBuffer: "+t.message),this.hls.trigger(a.Events.ERROR,{type:s.ErrorTypes.MEDIA_ERROR,details:s.ErrorDetails.BUFFER_ADD_CODEC_ERROR,fatal:!1,error:t,mimeType:c})}}n&&this.hls.trigger(a.Events.BUFFER_CREATED,{tracks:this.tracks})},e._onSBUpdateStart=function(t){this.operationQueue.current(t).onStart()},e._onSBUpdateEnd=function(t){var e=this.operationQueue;e.current(t).onComplete(),e.shiftAndExecuteNext(t)},e._onSBUpdateError=function(t,e){o.logger.error("[buffer-controller]: "+t+" SourceBuffer error",e),this.hls.trigger(a.Events.ERROR,{type:s.ErrorTypes.MEDIA_ERROR,details:s.ErrorDetails.BUFFER_APPENDING_ERROR,fatal:!1});var r=this.operationQueue.current(t);r&&r.onError(e)},e.removeExecutor=function(t,e,r){var a=this.media,s=this.mediaSource,l=this.operationQueue,u=this.sourceBuffer[t];if(!a||!s||!u)return o.logger.warn("[buffer-controller]: Attempting to remove from the "+t+" SourceBuffer, but it does not exist"),void l.shiftAndExecuteNext(t);var c=(0,n.isFiniteNumber)(a.duration)?a.duration:1/0,d=(0,n.isFiniteNumber)(s.duration)?s.duration:1/0,h=Math.max(0,e),f=Math.min(r,c,d);f>h&&!u.ending?(u.ended=!1,o.logger.log("[buffer-controller]: Removing ["+h+","+f+"] from the "+t+" SourceBuffer"),i.assert(!u.updating,t+" sourceBuffer must not be updating"),u.remove(h,f)):l.shiftAndExecuteNext(t)},e.appendExecutor=function(t,e){var r=this.operationQueue,n=this.sourceBuffer[e];if(!n)return o.logger.warn("[buffer-controller]: Attempting to append to the "+e+" SourceBuffer, but it does not exist"),void r.shiftAndExecuteNext(e);n.ended=!1,i.assert(!n.updating,e+" sourceBuffer must not be updating"),n.appendBuffer(t)},e.blockBuffers=function(t,e){var r=this;if(void 0===e&&(e=this.getSourceBufferTypes()),!e.length)return o.logger.log("[buffer-controller]: Blocking operation requested, but no SourceBuffers exist"),void Promise.resolve().then(t);var n=this.operationQueue,i=e.map((function(t){return n.appendBlocker(t)}));Promise.all(i).then((function(){t(),e.forEach((function(t){var e=r.sourceBuffer[t];e&&e.updating||n.shiftAndExecuteNext(t)}))}))},e.getSourceBufferTypes=function(){return Object.keys(this.sourceBuffer)},e.addBufferListener=function(t,e,r){var n=this.sourceBuffer[t];if(n){var i=r.bind(this,t);this.listeners[t].push({event:e,listener:i}),n.addEventListener(e,i)}},e.removeBufferListeners=function(t){var e=this.sourceBuffer[t];e&&this.listeners[t].forEach((function(t){e.removeEventListener(t.event,t.listener)}))},t}()},"./src/controller/buffer-operation-queue.ts":(t,e,r)=>{"use strict";r.r(e),r.d(e,{default:()=>i});var n=r("./src/utils/logger.ts"),i=function(){function t(t){this.buffers=void 0,this.queues={video:[],audio:[],audiovideo:[]},this.buffers=t}var e=t.prototype;return e.append=function(t,e){var r=this.queues[e];r.push(t),1===r.length&&this.buffers[e]&&this.executeNext(e)},e.insertAbort=function(t,e){this.queues[e].unshift(t),this.executeNext(e)},e.appendBlocker=function(t){var e,r=new Promise((function(t){e=t})),n={execute:e,onStart:function(){},onComplete:function(){},onError:function(){}};return this.append(n,t),r},e.executeNext=function(t){var e=this.buffers,r=this.queues,i=e[t],a=r[t];if(a.length){var o=a[0];try{o.execute()}catch(e){n.logger.warn("[buffer-operation-queue]: Unhandled exception executing the current operation"),o.onError(e),i&&i.updating||(a.shift(),this.executeNext(t))}}},e.shiftAndExecuteNext=function(t){this.queues[t].shift(),this.executeNext(t)},e.current=function(t){return this.queues[t][0]},t}()},"./src/controller/cap-level-controller.ts":(t,e,r)=>{"use strict";r.r(e),r.d(e,{default:()=>a});var n=r("./src/events.ts");function i(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,(void 0,"symbol"==typeof(i=function(t,e){if("object"!=typeof t||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(n.key))?i:String(i)),n)}var i}const a=function(){function t(t){this.autoLevelCapping=void 0,this.firstLevel=void 0,this.media=void 0,this.restrictedLevels=void 0,this.timer=void 0,this.hls=void 0,this.streamController=void 0,this.clientRect=void 0,this.hls=t,this.autoLevelCapping=Number.POSITIVE_INFINITY,this.firstLevel=-1,this.media=null,this.restrictedLevels=[],this.timer=void 0,this.clientRect=null,this.registerListeners()}var e,r,a=t.prototype;return a.setStreamController=function(t){this.streamController=t},a.destroy=function(){this.unregisterListener(),this.hls.config.capLevelToPlayerSize&&this.stopCapping(),this.media=null,this.clientRect=null,this.hls=this.streamController=null},a.registerListeners=function(){var t=this.hls;t.on(n.Events.FPS_DROP_LEVEL_CAPPING,this.onFpsDropLevelCapping,this),t.on(n.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),t.on(n.Events.MANIFEST_PARSED,this.onManifestParsed,this),t.on(n.Events.BUFFER_CODECS,this.onBufferCodecs,this),t.on(n.Events.MEDIA_DETACHING,this.onMediaDetaching,this)},a.unregisterListener=function(){var t=this.hls;t.off(n.Events.FPS_DROP_LEVEL_CAPPING,this.onFpsDropLevelCapping,this),t.off(n.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),t.off(n.Events.MANIFEST_PARSED,this.onManifestParsed,this),t.off(n.Events.BUFFER_CODECS,this.onBufferCodecs,this),t.off(n.Events.MEDIA_DETACHING,this.onMediaDetaching,this)},a.onFpsDropLevelCapping=function(e,r){t.isLevelAllowed(r.droppedLevel,this.restrictedLevels)&&this.restrictedLevels.push(r.droppedLevel)},a.onMediaAttaching=function(t,e){this.media=e.media instanceof HTMLVideoElement?e.media:null,this.clientRect=null},a.onManifestParsed=function(t,e){var r=this.hls;this.restrictedLevels=[],this.firstLevel=e.firstLevel,r.config.capLevelToPlayerSize&&e.video&&this.startCapping()},a.onBufferCodecs=function(t,e){this.hls.config.capLevelToPlayerSize&&e.video&&this.startCapping()},a.onMediaDetaching=function(){this.stopCapping()},a.detectPlayerSize=function(){if(this.media&&this.mediaHeight>0&&this.mediaWidth>0){var t=this.hls.levels;if(t.length){var e=this.hls;e.autoLevelCapping=this.getMaxLevel(t.length-1),e.autoLevelCapping>this.autoLevelCapping&&this.streamController&&this.streamController.nextLevelSwitch(),this.autoLevelCapping=e.autoLevelCapping}}},a.getMaxLevel=function(e){var r=this,n=this.hls.levels;if(!n.length)return-1;var i=n.filter((function(n,i){return t.isLevelAllowed(i,r.restrictedLevels)&&i<=e}));return this.clientRect=null,t.getMaxLevelByMediaSize(i,this.mediaWidth,this.mediaHeight)},a.startCapping=function(){this.timer||(this.autoLevelCapping=Number.POSITIVE_INFINITY,this.hls.firstLevel=this.getMaxLevel(this.firstLevel),self.clearInterval(this.timer),this.timer=self.setInterval(this.detectPlayerSize.bind(this),1e3),this.detectPlayerSize())},a.stopCapping=function(){this.restrictedLevels=[],this.firstLevel=-1,this.autoLevelCapping=Number.POSITIVE_INFINITY,this.timer&&(self.clearInterval(this.timer),this.timer=void 0)},a.getDimensions=function(){if(this.clientRect)return this.clientRect;var t=this.media,e={width:0,height:0};if(t){var r=t.getBoundingClientRect();e.width=r.width,e.height=r.height,e.width||e.height||(e.width=r.right-r.left||t.width||0,e.height=r.bottom-r.top||t.height||0)}return this.clientRect=e,e},t.isLevelAllowed=function(t,e){return void 0===e&&(e=[]),-1===e.indexOf(t)},t.getMaxLevelByMediaSize=function(t,e,r){if(!t||!t.length)return-1;for(var n,i,a=t.length-1,o=0;o<t.length;o+=1){var s=t[o];if((s.width>=e||s.height>=r)&&(n=s,!(i=t[o+1])||n.width!==i.width||n.height!==i.height)){a=o;break}}return a},e=t,(r=[{key:"mediaWidth",get:function(){return this.getDimensions().width*this.contentScaleFactor}},{key:"mediaHeight",get:function(){return this.getDimensions().height*this.contentScaleFactor}},{key:"contentScaleFactor",get:function(){var t=1;if(!this.hls.config.ignoreDevicePixelRatio)try{t=self.devicePixelRatio}catch(t){}return t}}])&&i(e.prototype,r),Object.defineProperty(e,"prototype",{writable:!1}),t}()},"./src/controller/cmcd-controller.ts":(t,e,r)=>{"use strict";r.r(e),r.d(e,{default:()=>h});var n=r("./src/events.ts"),i=r("./src/types/cmcd.ts"),a=r("./src/utils/buffer-helper.ts"),o=r("./src/utils/logger.ts");function s(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,(void 0,"symbol"==typeof(i=function(t,e){if("object"!=typeof t||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(n.key))?i:String(i)),n)}var i}function l(t,e,r){return e&&s(t.prototype,e),r&&s(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function u(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(r)return(r=r.call(t)).next.bind(r);if(Array.isArray(t)||(r=function(t,e){if(t){if("string"==typeof t)return c(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?c(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0;return function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function c(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function d(){return d=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(t[n]=r[n])}return t},d.apply(this,arguments)}var h=function(){function t(e){var r=this;this.hls=void 0,this.config=void 0,this.media=void 0,this.sid=void 0,this.cid=void 0,this.useHeaders=!1,this.initialized=!1,this.starved=!1,this.buffering=!0,this.audioBuffer=void 0,this.videoBuffer=void 0,this.onWaiting=function(){r.initialized&&(r.starved=!0),r.buffering=!0},this.onPlaying=function(){r.initialized||(r.initialized=!0),r.buffering=!1},this.applyPlaylistData=function(t){try{r.apply(t,{ot:i.CMCDObjectType.MANIFEST,su:!r.initialized})}catch(t){o.logger.warn("Could not generate manifest CMCD data.",t)}},this.applyFragmentData=function(t){try{var e=t.frag,n=r.hls.levels[e.level],a=r.getObjectType(e),s={d:1e3*e.duration,ot:a};a!==i.CMCDObjectType.VIDEO&&a!==i.CMCDObjectType.AUDIO&&a!=i.CMCDObjectType.MUXED||(s.br=n.bitrate/1e3,s.tb=r.getTopBandwidth(a)/1e3,s.bl=r.getBufferLength(a)),r.apply(t,s)}catch(t){o.logger.warn("Could not generate segment CMCD data.",t)}},this.hls=e;var n=this.config=e.config,a=n.cmcd;null!=a&&(n.pLoader=this.createPlaylistLoader(),n.fLoader=this.createFragmentLoader(),this.sid=a.sessionId||t.uuid(),this.cid=a.contentId,this.useHeaders=!0===a.useHeaders,this.registerListeners())}var e=t.prototype;return e.registerListeners=function(){var t=this.hls;t.on(n.Events.MEDIA_ATTACHED,this.onMediaAttached,this),t.on(n.Events.MEDIA_DETACHED,this.onMediaDetached,this),t.on(n.Events.BUFFER_CREATED,this.onBufferCreated,this)},e.unregisterListeners=function(){var t=this.hls;t.off(n.Events.MEDIA_ATTACHED,this.onMediaAttached,this),t.off(n.Events.MEDIA_DETACHED,this.onMediaDetached,this),t.off(n.Events.BUFFER_CREATED,this.onBufferCreated,this),this.onMediaDetached()},e.destroy=function(){this.unregisterListeners(),this.hls=this.config=this.audioBuffer=this.videoBuffer=null},e.onMediaAttached=function(t,e){this.media=e.media,this.media.addEventListener("waiting",this.onWaiting),this.media.addEventListener("playing",this.onPlaying)},e.onMediaDetached=function(){this.media&&(this.media.removeEventListener("waiting",this.onWaiting),this.media.removeEventListener("playing",this.onPlaying),this.media=null)},e.onBufferCreated=function(t,e){var r,n;this.audioBuffer=null===(r=e.tracks.audio)||void 0===r?void 0:r.buffer,this.videoBuffer=null===(n=e.tracks.video)||void 0===n?void 0:n.buffer},e.createData=function(){var t;return{v:i.CMCDVersion,sf:i.CMCDStreamingFormat.HLS,sid:this.sid,cid:this.cid,pr:null===(t=this.media)||void 0===t?void 0:t.playbackRate,mtp:this.hls.bandwidthEstimate/1e3}},e.apply=function(e,r){void 0===r&&(r={}),d(r,this.createData());var n=r.ot===i.CMCDObjectType.INIT||r.ot===i.CMCDObjectType.VIDEO||r.ot===i.CMCDObjectType.MUXED;if(this.starved&&n&&(r.bs=!0,r.su=!0,this.starved=!1),null==r.su&&(r.su=this.buffering),this.useHeaders){var a=t.toHeaders(r);if(!Object.keys(a).length)return;e.headers||(e.headers={}),d(e.headers,a)}else{var o=t.toQuery(r);if(!o)return;e.url=t.appendQueryToUri(e.url,o)}},e.getObjectType=function(t){var e=t.type;return"subtitle"===e?i.CMCDObjectType.TIMED_TEXT:"initSegment"===t.sn?i.CMCDObjectType.INIT:"audio"===e?i.CMCDObjectType.AUDIO:"main"===e?this.hls.audioTracks.length?i.CMCDObjectType.VIDEO:i.CMCDObjectType.MUXED:void 0},e.getTopBandwidth=function(t){var e,r=0,n=this.hls;if(t===i.CMCDObjectType.AUDIO)e=n.audioTracks;else{var a=n.maxAutoLevel,o=a>-1?a+1:n.levels.length;e=n.levels.slice(0,o)}for(var s,l=u(e);!(s=l()).done;){var c=s.value;c.bitrate>r&&(r=c.bitrate)}return r>0?r:NaN},e.getBufferLength=function(t){var e=this.hls.media,r=t===i.CMCDObjectType.AUDIO?this.audioBuffer:this.videoBuffer;return r&&e?1e3*a.BufferHelper.bufferInfo(r,e.currentTime,this.config.maxBufferHole).len:NaN},e.createPlaylistLoader=function(){var t=this.config.pLoader,e=this.applyPlaylistData,r=t||this.config.loader;return function(){function t(t){this.loader=void 0,this.loader=new r(t)}var n=t.prototype;return n.destroy=function(){this.loader.destroy()},n.abort=function(){this.loader.abort()},n.load=function(t,r,n){e(t),this.loader.load(t,r,n)},l(t,[{key:"stats",get:function(){return this.loader.stats}},{key:"context",get:function(){return this.loader.context}}]),t}()},e.createFragmentLoader=function(){var t=this.config.fLoader,e=this.applyFragmentData,r=t||this.config.loader;return function(){function t(t){this.loader=void 0,this.loader=new r(t)}var n=t.prototype;return n.destroy=function(){this.loader.destroy()},n.abort=function(){this.loader.abort()},n.load=function(t,r,n){e(t),this.loader.load(t,r,n)},l(t,[{key:"stats",get:function(){return this.loader.stats}},{key:"context",get:function(){return this.loader.context}}]),t}()},t.uuid=function(){var t=URL.createObjectURL(new Blob),e=t.toString();return URL.revokeObjectURL(t),e.slice(e.lastIndexOf("/")+1)},t.serialize=function(t){for(var e,r=[],n=function(t){return!Number.isNaN(t)&&null!=t&&""!==t&&!1!==t},i=function(t){return Math.round(t)},a=function(t){return 100*i(t/100)},o={br:i,d:i,bl:a,dl:a,mtp:a,nor:function(t){return encodeURIComponent(t)},rtp:a,tb:i},s=u(Object.keys(t||{}).sort());!(e=s()).done;){var l=e.value,c=t[l];if(n(c)&&!("v"===l&&1===c||"pr"==l&&1===c)){var d=o[l];d&&(c=d(c));var h,f=typeof c;h="ot"===l||"sf"===l||"st"===l?l+"="+c:"boolean"===f?l:"number"===f?l+"="+c:l+"="+JSON.stringify(c),r.push(h)}}return r.join(",")},t.toHeaders=function(e){for(var r={},n=["Object","Request","Session","Status"],i=[{},{},{},{}],a={br:0,d:0,ot:0,tb:0,bl:1,dl:1,mtp:1,nor:1,nrr:1,su:1,cid:2,pr:2,sf:2,sid:2,st:2,v:2,bs:3,rtp:3},o=0,s=Object.keys(e);o<s.length;o++){var l=s[o];i[null!=a[l]?a[l]:1][l]=e[l]}for(var u=0;u<i.length;u++){var c=t.serialize(i[u]);c&&(r["CMCD-"+n[u]]=c)}return r},t.toQuery=function(e){return"CMCD="+encodeURIComponent(t.serialize(e))},t.appendQueryToUri=function(t,e){if(!e)return t;var r=t.includes("?")?"&":"?";return""+t+r+e},t}()},"./src/controller/eme-controller.ts":(t,e,r)=>{"use strict";r.r(e),r.d(e,{default:()=>T});var n=r("./src/events.ts"),a=r("./src/errors.ts"),o=r("./src/utils/logger.ts"),s=r("./src/utils/mediakeys-helper.ts"),l=r("./src/utils/keysystem-util.ts"),u=r("./src/utils/numeric-encoding-utils.ts"),c=r("./src/loader/level-key.ts"),d=r("./src/utils/hex.ts"),h=r("./src/utils/mp4-tools.ts"),f=r("./node_modules/eventemitter3/index.js"),p=r.n(f);function g(t){var e="function"==typeof Map?new Map:void 0;return g=function(t){if(null===t||(r=t,-1===Function.toString.call(r).indexOf("[native code]")))return t;var r;if("function"!=typeof t)throw new TypeError("Super expression must either be null or a function");if(void 0!==e){if(e.has(t))return e.get(t);e.set(t,n)}function n(){return v(t,arguments,b(this).constructor)}return n.prototype=Object.create(t.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),y(n,t)},g(t)}function v(t,e,r){return v=m()?Reflect.construct.bind():function(t,e,r){var n=[null];n.push.apply(n,e);var i=new(Function.bind.apply(t,n));return r&&y(i,r.prototype),i},v.apply(null,arguments)}function m(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}function y(t,e){return y=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},y(t,e)}function b(t){return b=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},b(t)}var E="[eme]",x=function(){function t(e){this.hls=void 0,this.config=void 0,this.media=null,this.keyFormatPromise=null,this.keySystemAccessPromises={},this._requestLicenseFailureCount=0,this.mediaKeySessions=[],this.keyIdToKeySessionPromise={},this.setMediaKeysQueue=t.CDMCleanupPromise?[t.CDMCleanupPromise]:[],this.onMediaEncrypted=this._onMediaEncrypted.bind(this),this.onWaitingForKey=this._onWaitingForKey.bind(this),this.debug=o.logger.debug.bind(o.logger,E),this.log=o.logger.log.bind(o.logger,E),this.warn=o.logger.warn.bind(o.logger,E),this.error=o.logger.error.bind(o.logger,E),this.hls=e,this.config=e.config,this.registerListeners()}var e=t.prototype;return e.destroy=function(){this.unregisterListeners(),this.onMediaDetached(),this.hls=this.onMediaEncrypted=this.onWaitingForKey=this.keyIdToKeySessionPromise=null},e.registerListeners=function(){this.hls.on(n.Events.MEDIA_ATTACHED,this.onMediaAttached,this),this.hls.on(n.Events.MEDIA_DETACHED,this.onMediaDetached,this),this.hls.on(n.Events.MANIFEST_LOADED,this.onManifestLoaded,this)},e.unregisterListeners=function(){this.hls.off(n.Events.MEDIA_ATTACHED,this.onMediaAttached,this),this.hls.off(n.Events.MEDIA_DETACHED,this.onMediaDetached,this),this.hls.off(n.Events.MANIFEST_LOADED,this.onManifestLoaded,this)},e.getLicenseServerUrl=function(t){var e=this.config,r=e.drmSystems,n=e.widevineLicenseUrl,i=r[t];if(i)return i.licenseUrl;if(t===s.KeySystems.WIDEVINE&&n)return n;throw new Error('no license server URL configured for key-system "'+t+'"')},e.getServerCertificateUrl=function(t){var e=this.config.drmSystems[t];if(e)return e.serverCertificateUrl;this.log('No Server Certificate in config.drmSystems["'+t+'"]')},e.attemptKeySystemAccess=function(t){var e=this,r=this.hls.levels,n=function(t,e,r){return!!t&&r.indexOf(t)===e},i=r.map((function(t){return t.audioCodec})).filter(n),o=r.map((function(t){return t.videoCodec})).filter(n);return i.length+o.length===0&&o.push("avc1.42e01e"),new Promise((function(r,n){!function t(s){var l=s.shift();e.getMediaKeysPromise(l,i,o).then((function(t){return r({keySystem:l,mediaKeys:t})})).catch((function(e){s.length?t(s):n(e instanceof S?e:new S({type:a.ErrorTypes.KEY_SYSTEM_ERROR,details:a.ErrorDetails.KEY_SYSTEM_NO_ACCESS,error:e,fatal:!0},e.message))}))}(t)}))},e.requestMediaKeySystemAccess=function(t,e){var r=this.config.requestMediaKeySystemAccessFunc;if("function"!=typeof r){var n="Configured requestMediaKeySystemAccess is not a function "+r;return null===s.requestMediaKeySystemAccess&&"http:"===self.location.protocol&&(n="navigator.requestMediaKeySystemAccess is not available over insecure protocol "+location.protocol),Promise.reject(new Error(n))}return r(t,e)},e.getMediaKeysPromise=function(t,e,r){var n=this,i=(0,s.getSupportedMediaKeySystemConfigurations)(t,e,r,this.config.drmSystemOptions),a=this.keySystemAccessPromises[t],o=null==a?void 0:a.keySystemAccess;if(!o){this.log('Requesting encrypted media "'+t+'" key-system access with config: '+JSON.stringify(i)),o=this.requestMediaKeySystemAccess(t,i);var l=this.keySystemAccessPromises[t]={keySystemAccess:o};return o.catch((function(e){n.log('Failed to obtain access to key-system "'+t+'": '+e)})),o.then((function(e){n.log('Access for key-system "'+e.keySystem+'" obtained');var r=n.fetchServerCertificate(t);return n.log('Create media-keys for "'+t+'"'),l.mediaKeys=e.createMediaKeys().then((function(e){return n.log('Media-keys created for "'+t+'"'),r.then((function(r){return r?n.setMediaKeysServerCertificate(e,t,r):e}))})),l.mediaKeys.catch((function(e){n.error('Failed to create media-keys for "'+t+'"}: '+e)})),l.mediaKeys}))}return o.then((function(){return a.mediaKeys}))},e.createMediaKeySessionContext=function(t){var e=t.decryptdata,r=t.keySystem,n=t.mediaKeys;i.assert(!!n,"mediaKeys is defined"),this.log('Creating key-system session "'+r+'" keyId: '+d.default.hexDump(e.keyId||[]));var a=n.createSession(),o={decryptdata:e,keySystem:r,mediaKeys:n,mediaKeysSession:a,keyStatus:"status-pending"};return this.mediaKeySessions.push(o),o},e.renewKeySession=function(t){var e=t.decryptdata;if(e.pssh){var r=this.createMediaKeySessionContext(t),n=this.getKeyIdString(e);this.keyIdToKeySessionPromise[n]=this.generateRequestWithPreferredKeySession(r,"cenc",e.pssh,"expired")}else this.warn("Could not renew expired session. Missing pssh initData.");this.removeSession(t)},e.getKeyIdString=function(t){if(!t)throw new Error("Could not read keyId of undefined decryptdata");if(null===t.keyId)throw new Error("keyId is null");return d.default.hexDump(t.keyId)},e.updateKeySession=function(t,e){var r,n=t.mediaKeysSession;return this.log('Updating key-session "'+n.sessionId+'" for keyID '+d.default.hexDump((null===(r=t.decryptdata)||void 0===r?void 0:r.keyId)||[])+"\n } (data length: "+(e?e.byteLength:e)+")"),n.update(e)},e.selectKeySystemFormat=function(t){var e=Object.keys(t.levelkeys||{});return this.keyFormatPromise||(this.log("Selecting key-system from fragment (sn: "+t.sn+" "+t.type+": "+t.level+") key formats "+e.join(", ")),this.keyFormatPromise=this.getKeyFormatPromise(e)),this.keyFormatPromise},e.getKeyFormatPromise=function(t){var e=this;return new Promise((function(r,n){var i=(0,s.getKeySystemsForConfig)(e.config),a=t.map(s.keySystemFormatToKeySystemDomain).filter((function(t){return!!t&&-1!==i.indexOf(t)}));return e.getKeySystemSelectionPromise(a).then((function(t){var e=t.keySystem,i=(0,s.keySystemDomainToKeySystemFormat)(e);i?r(i):n(new Error('Unable to find format for key-system "'+e+'"'))})).catch(n)}))},e.loadKey=function(t){var e=this,r=t.keyInfo.decryptdata,n=this.getKeyIdString(r),i="(keyId: "+n+' format: "'+r.keyFormat+'" method: '+r.method+" uri: "+r.uri+")";this.log("Starting session for key "+i);var a=this.keyIdToKeySessionPromise[n];return a||(a=this.keyIdToKeySessionPromise[n]=this.getKeySystemForKeyPromise(r).then((function(n){var a=n.keySystem,o=n.mediaKeys;return e.throwIfDestroyed(),e.log("Handle encrypted media sn: "+t.frag.sn+" "+t.frag.type+": "+t.frag.level+" using key "+i),e.attemptSetMediaKeys(a,o).then((function(){e.throwIfDestroyed();var t=e.createMediaKeySessionContext({keySystem:a,mediaKeys:o,decryptdata:r});return e.generateRequestWithPreferredKeySession(t,"cenc",r.pssh,"playlist-key")}))}))).catch((function(t){return e.handleError(t)})),a},e.throwIfDestroyed=function(t){if(void 0===t&&(t="Invalid state"),!this.hls)throw new Error("invalid state")},e.handleError=function(t){this.hls&&(this.error(t.message),t instanceof S?this.hls.trigger(n.Events.ERROR,t.data):this.hls.trigger(n.Events.ERROR,{type:a.ErrorTypes.KEY_SYSTEM_ERROR,details:a.ErrorDetails.KEY_SYSTEM_NO_KEYS,error:t,fatal:!0}))},e.getKeySystemForKeyPromise=function(t){var e=this.getKeyIdString(t),r=this.keyIdToKeySessionPromise[e];if(!r){var n=(0,s.keySystemFormatToKeySystemDomain)(t.keyFormat),i=n?[n]:(0,s.getKeySystemsForConfig)(this.config);return this.attemptKeySystemAccess(i)}return r},e.getKeySystemSelectionPromise=function(t){if(t.length||(t=(0,s.getKeySystemsForConfig)(this.config)),0===t.length)throw new S({type:a.ErrorTypes.KEY_SYSTEM_ERROR,details:a.ErrorDetails.KEY_SYSTEM_NO_CONFIGURED_LICENSE,fatal:!0},"Missing key-system license configuration options "+JSON.stringify({drmSystems:this.config.drmSystems}));return this.attemptKeySystemAccess(t)},e._onMediaEncrypted=function(t){var e=this,r=t.initDataType,n=t.initData;if(this.debug('"'+t.type+'" event: init data type: "'+r+'"'),null!==n){var i,a;if("sinf"===r&&this.config.drmSystems[s.KeySystems.FAIRPLAY]){var o=(0,h.bin2str)(new Uint8Array(n));try{var l=(0,u.base64Decode)(JSON.parse(o).sinf),f=(0,h.parseSinf)(new Uint8Array(l));if(!f)return;i=f.subarray(8,24),a=s.KeySystems.FAIRPLAY}catch(t){return void this.warn('Failed to parse sinf "encrypted" event message initData')}}else{var p=(0,h.parsePssh)(n);if(null===p)return;0===p.version&&p.systemId===s.KeySystemIds.WIDEVINE&&p.data&&(i=p.data.subarray(8,24)),a=(0,s.keySystemIdToKeySystemDomain)(p.systemId)}if(a&&i){for(var g=d.default.hexDump(i),v=this.keyIdToKeySessionPromise,m=this.mediaKeySessions,y=v[g],b=function(t){var a=m[t],o=a.decryptdata;if(o.pssh||!o.keyId)return"continue";var s=d.default.hexDump(o.keyId);return g===s||-1!==o.uri.replace(/-/g,"").indexOf(g)?(y=v[s],delete v[s],o.pssh=new Uint8Array(n),o.keyId=i,y=v[g]=y.then((function(){return e.generateRequestWithPreferredKeySession(a,r,n,"encrypted-event-key-match")})),"break"):void 0},E=0;E<m.length;E++){var x=b(E);if("continue"!==x&&"break"===x)break}y||(y=v[g]=this.getKeySystemSelectionPromise([a]).then((function(t){var a,o=t.keySystem,l=t.mediaKeys;e.throwIfDestroyed();var u=new c.LevelKey("ISO-23001-7",g,null!=(a=(0,s.keySystemDomainToKeySystemFormat)(o))?a:"");return u.pssh=new Uint8Array(n),u.keyId=i,e.attemptSetMediaKeys(o,l).then((function(){e.throwIfDestroyed();var t=e.createMediaKeySessionContext({decryptdata:u,keySystem:o,mediaKeys:l});return e.generateRequestWithPreferredKeySession(t,r,n,"encrypted-event-no-match")}))}))),y.catch((function(t){return e.handleError(t)}))}}},e._onWaitingForKey=function(t){this.log('"'+t.type+'" event')},e.attemptSetMediaKeys=function(t,e){var r=this,n=this.setMediaKeysQueue.slice();this.log('Setting media-keys for "'+t+'"');var i=Promise.all(n).then((function(){if(!r.media)throw new Error("Attempted to set mediaKeys without media element attached");return r.media.setMediaKeys(e)}));return this.setMediaKeysQueue.push(i),i.then((function(){r.log('Media-keys set for "'+t+'"'),n.push(i),r.setMediaKeysQueue=r.setMediaKeysQueue.filter((function(t){return-1===n.indexOf(t)}))}))},e.generateRequestWithPreferredKeySession=function(t,e,r,n){var i,o,u=this,c=null===(i=this.config.drmSystems)||void 0===i||null===(o=i[t.keySystem])||void 0===o?void 0:o.generateRequest;if(c)try{var d=c.call(this.hls,e,r,t);if(!d)throw new Error("Invalid response from configured generateRequest filter");e=d.initDataType,r=t.decryptdata.pssh=d.initData?new Uint8Array(d.initData):null}catch(t){var h;if(this.warn(t.message),null!==(h=this.hls)&&void 0!==h&&h.config.debug)throw t}if(null===r)return this.log('Skipping key-session request for "'+n+'" (no initData)'),Promise.resolve(t);var f=this.getKeyIdString(t.decryptdata);this.log('Generating key-session request for "'+n+'": '+f+" (init data type: "+e+" length: "+(r?r.byteLength:null)+")");var g=new(p());t.mediaKeysSession.onmessage=function(e){var r=t.mediaKeysSession;if(r){var n=e.messageType,i=e.message;u.log('"'+n+'" message event for session "'+r.sessionId+'" message size: '+i.byteLength),"license-request"===n||"license-renewal"===n?u.renewLicense(t,i).catch((function(t){u.handleError(t),g.emit("error",t)})):"license-release"===n?t.keySystem===s.KeySystems.FAIRPLAY&&(u.updateKeySession(t,(0,l.strToUtf8array)("acknowledged")),u.removeSession(t)):u.warn('unhandled media key message type "'+n+'"')}else g.emit("error",new Error("invalid state"))},t.mediaKeysSession.onkeystatuseschange=function(e){if(t.mediaKeysSession){u.onKeyStatusChange(t);var r=t.keyStatus;g.emit("keyStatus",r),"expired"===r&&(u.warn(t.keySystem+" expired for key "+f),u.renewKeySession(t))}else g.emit("error",new Error("invalid state"))};var v=new Promise((function(t,e){g.on("error",e),g.on("keyStatus",(function(r){r.startsWith("usable")?t():"output-restricted"===r?e(new S({type:a.ErrorTypes.KEY_SYSTEM_ERROR,details:a.ErrorDetails.KEY_SYSTEM_STATUS_OUTPUT_RESTRICTED,fatal:!1},"HDCP level output restricted")):"internal-error"===r?e(new S({type:a.ErrorTypes.KEY_SYSTEM_ERROR,details:a.ErrorDetails.KEY_SYSTEM_STATUS_INTERNAL_ERROR,fatal:!0},'key status changed to "'+r+'"')):"expired"===r?e(new Error("key expired while generating request")):u.warn('unhandled key status change "'+r+'"')}))}));return t.mediaKeysSession.generateRequest(e,r).then((function(){var e;u.log('Request generated for key-session "'+(null===(e=t.mediaKeysSession)||void 0===e?void 0:e.sessionId)+'" keyId: '+f)})).catch((function(t){throw new S({type:a.ErrorTypes.KEY_SYSTEM_ERROR,details:a.ErrorDetails.KEY_SYSTEM_NO_SESSION,error:t,fatal:!1},"Error generating key-session request: "+t)})).then((function(){return v})).catch((function(e){throw g.removeAllListeners(),u.removeSession(t),e})).then((function(){return g.removeAllListeners(),t}))},e.onKeyStatusChange=function(t){var e=this;t.mediaKeysSession.keyStatuses.forEach((function(r,n){e.log('key status change "'+r+'" for keyStatuses keyId: '+d.default.hexDump("buffer"in n?new Uint8Array(n.buffer,n.byteOffset,n.byteLength):new Uint8Array(n))+" session keyId: "+d.default.hexDump(new Uint8Array(t.decryptdata.keyId||[]))+" uri: "+t.decryptdata.uri),t.keyStatus=r}))},e.fetchServerCertificate=function(t){var e=this;return new Promise((function(r,n){var i=e.getServerCertificateUrl(t);if(!i)return r();e.log('Fetching serverCertificate for "'+t+'"');var o=new XMLHttpRequest;o.open("GET",i,!0),o.responseType="arraybuffer",o.onreadystatechange=function(){o.readyState===XMLHttpRequest.DONE&&(200===o.status?r(o.response):n(new S({type:a.ErrorTypes.KEY_SYSTEM_ERROR,details:a.ErrorDetails.KEY_SYSTEM_SERVER_CERTIFICATE_REQUEST_FAILED,fatal:!0,networkDetails:o},'"'+t+'" certificate request XHR failed ('+i+"). Status: "+o.status+" ("+o.statusText+")")))},o.send()}))},e.setMediaKeysServerCertificate=function(t,e,r){var n=this;return new Promise((function(i,o){t.setServerCertificate(r).then((function(a){n.log("setServerCertificate "+(a?"success":"not supported by CDM")+" ("+(null==r?void 0:r.byteLength)+') on "'+e+'"'),i(t)})).catch((function(t){o(new S({type:a.ErrorTypes.KEY_SYSTEM_ERROR,details:a.ErrorDetails.KEY_SYSTEM_SERVER_CERTIFICATE_UPDATE_FAILED,error:t,fatal:!0},t.message))}))}))},e.renewLicense=function(t,e){var r=this;return this.requestLicense(t,new Uint8Array(e)).then((function(e){return r.updateKeySession(t,new Uint8Array(e)).catch((function(t){throw new S({type:a.ErrorTypes.KEY_SYSTEM_ERROR,details:a.ErrorDetails.KEY_SYSTEM_SESSION_UPDATE_FAILED,error:t,fatal:!0},t.message)}))}))},e.setupLicenseXHR=function(t,e,r,n){var i=this,a=this.config.licenseXhrSetup;return a?Promise.resolve().then((function(){if(!r.decryptdata)throw new Error("Key removed");return a.call(i.hls,t,e,r,n)})).catch((function(o){if(!r.decryptdata)throw o;return t.open("POST",e,!0),a.call(i.hls,t,e,r,n)})).then((function(r){return t.readyState||t.open("POST",e,!0),{xhr:t,licenseChallenge:r||n}})):(t.open("POST",e,!0),Promise.resolve({xhr:t,licenseChallenge:n}))},e.requestLicense=function(t,e){var r=this;return new Promise((function(n,i){var o=r.getLicenseServerUrl(t.keySystem);r.log("Sending license request to URL: "+o);var s=new XMLHttpRequest;s.responseType="arraybuffer",s.onreadystatechange=function(){if(!r.hls||!t.mediaKeysSession)return i(new Error("invalid state"));if(4===s.readyState)if(200===s.status){r._requestLicenseFailureCount=0;var l=s.response;r.log("License received "+(l instanceof ArrayBuffer?l.byteLength:l));var u=r.config.licenseResponseCallback;if(u)try{l=u.call(r.hls,s,o,t)}catch(t){r.error(t)}n(l)}else if(r._requestLicenseFailureCount++,r._requestLicenseFailureCount>3||s.status>=400&&s.status<500)i(new S({type:a.ErrorTypes.KEY_SYSTEM_ERROR,details:a.ErrorDetails.KEY_SYSTEM_LICENSE_REQUEST_FAILED,fatal:!0,networkDetails:s},"License Request XHR failed ("+o+"). Status: "+s.status+" ("+s.statusText+")"));else{var c=3-r._requestLicenseFailureCount+1;r.warn("Retrying license request, "+c+" attempts left"),r.requestLicense(t,e).then(n,i)}},t.licenseXhr&&t.licenseXhr.readyState!==XMLHttpRequest.DONE&&t.licenseXhr.abort(),t.licenseXhr=s,r.setupLicenseXHR(s,o,t,e).then((function(t){var e=t.xhr,r=t.licenseChallenge;e.send(r)}))}))},e.onMediaAttached=function(t,e){if(this.config.emeEnabled){var r=e.media;this.media=r,r.addEventListener("encrypted",this.onMediaEncrypted),r.addEventListener("waitingforkey",this.onWaitingForKey)}},e.onMediaDetached=function(){var e=this,r=this.media,n=this.mediaKeySessions;r&&(r.removeEventListener("encrypted",this.onMediaEncrypted),r.removeEventListener("waitingforkey",this.onWaitingForKey),this.media=null),this._requestLicenseFailureCount=0,this.setMediaKeysQueue=[],this.mediaKeySessions=[],this.keyIdToKeySessionPromise={},c.LevelKey.clearKeyUriToKeyIdMap();var i=n.length;t.CDMCleanupPromise=Promise.all(n.map((function(t){return e.removeSession(t)})).concat(null==r?void 0:r.setMediaKeys(null).catch((function(t){e.log("Could not clear media keys: "+t+". media.src: "+(null==r?void 0:r.src))})))).then((function(){i&&(e.log("finished closing key sessions and clearing media keys"),n.length=0)})).catch((function(t){e.log("Could not close sessions and clear media keys: "+t+". media.src: "+(null==r?void 0:r.src))}))},e.onManifestLoaded=function(t,e){var r=e.sessionKeys;if(r&&this.config.emeEnabled&&!this.keyFormatPromise){var n=r.reduce((function(t,e){return-1===t.indexOf(e.keyFormat)&&t.push(e.keyFormat),t}),[]);this.log("Selecting key-system from session-keys "+n.join(", ")),this.keyFormatPromise=this.getKeyFormatPromise(n)}},e.removeSession=function(t){var e=this,r=t.mediaKeysSession,n=t.licenseXhr;if(r){this.log("Remove licenses and keys and close session "+r.sessionId),r.onmessage=null,r.onkeystatuseschange=null,n&&n.readyState!==XMLHttpRequest.DONE&&n.abort(),t.mediaKeysSession=t.decryptdata=t.licenseXhr=void 0;var i=this.mediaKeySessions.indexOf(t);return i>-1&&this.mediaKeySessions.splice(i,1),r.remove().catch((function(t){e.log("Could not remove session: "+t)})).then((function(){return r.close()})).catch((function(t){e.log("Could not close session: "+t)}))}},t}();x.CDMCleanupPromise=void 0;var S=function(t){var e,r;function n(e,r){var n;return(n=t.call(this,r)||this).data=void 0,n.data=e,e.err=e.error,n}return r=t,(e=n).prototype=Object.create(r.prototype),e.prototype.constructor=e,y(e,r),n}(g(Error));const T=x},"./src/controller/fps-controller.ts":(t,e,r)=>{"use strict";r.r(e),r.d(e,{default:()=>a});var n=r("./src/events.ts"),i=r("./src/utils/logger.ts");const a=function(){function t(t){this.hls=void 0,this.isVideoPlaybackQualityAvailable=!1,this.timer=void 0,this.media=null,this.lastTime=void 0,this.lastDroppedFrames=0,this.lastDecodedFrames=0,this.streamController=void 0,this.hls=t,this.registerListeners()}var e=t.prototype;return e.setStreamController=function(t){this.streamController=t},e.registerListeners=function(){this.hls.on(n.Events.MEDIA_ATTACHING,this.onMediaAttaching,this)},e.unregisterListeners=function(){this.hls.off(n.Events.MEDIA_ATTACHING,this.onMediaAttaching)},e.destroy=function(){this.timer&&clearInterval(this.timer),this.unregisterListeners(),this.isVideoPlaybackQualityAvailable=!1,this.media=null},e.onMediaAttaching=function(t,e){var r=this.hls.config;if(r.capLevelOnFPSDrop){var n=e.media instanceof self.HTMLVideoElement?e.media:null;this.media=n,n&&"function"==typeof n.getVideoPlaybackQuality&&(this.isVideoPlaybackQualityAvailable=!0),self.clearInterval(this.timer),this.timer=self.setInterval(this.checkFPSInterval.bind(this),r.fpsDroppedMonitoringPeriod)}},e.checkFPS=function(t,e,r){var a=performance.now();if(e){if(this.lastTime){var o=a-this.lastTime,s=r-this.lastDroppedFrames,l=e-this.lastDecodedFrames,u=1e3*s/o,c=this.hls;if(c.trigger(n.Events.FPS_DROP,{currentDropped:s,currentDecoded:l,totalDroppedFrames:r}),u>0&&s>c.config.fpsDroppedMonitoringThreshold*l){var d=c.currentLevel;i.logger.warn("drop FPS ratio greater than max allowed value for currentLevel: "+d),d>0&&(-1===c.autoLevelCapping||c.autoLevelCapping>=d)&&(d-=1,c.trigger(n.Events.FPS_DROP_LEVEL_CAPPING,{level:d,droppedLevel:c.currentLevel}),c.autoLevelCapping=d,this.streamController.nextLevelSwitch())}}this.lastTime=a,this.lastDroppedFrames=r,this.lastDecodedFrames=e}},e.checkFPSInterval=function(){var t=this.media;if(t)if(this.isVideoPlaybackQualityAvailable){var e=t.getVideoPlaybackQuality();this.checkFPS(t,e.totalVideoFrames,e.droppedVideoFrames)}else this.checkFPS(t,t.webkitDecodedFrameCount,t.webkitDroppedFrameCount)},t}()},"./src/controller/fragment-finders.ts":(t,e,r)=>{"use strict";r.r(e),r.d(e,{findFragWithCC:()=>u,findFragmentByPDT:()=>a,findFragmentByPTS:()=>o,fragmentWithinToleranceTest:()=>s,pdtWithinToleranceTest:()=>l});var n=r("./src/polyfills/number.ts"),i=r("./src/utils/binary-search.ts");function a(t,e,r){if(null===e||!Array.isArray(t)||!t.length||!(0,n.isFiniteNumber)(e))return null;if(e<(t[0].programDateTime||0))return null;if(e>=(t[t.length-1].endProgramDateTime||0))return null;r=r||0;for(var i=0;i<t.length;++i){var a=t[i];if(l(e,r,a))return a}return null}function o(t,e,r,n){void 0===r&&(r=0),void 0===n&&(n=0);var a=null;if(t?a=e[t.sn-e[0].sn+1]||null:0===r&&0===e[0].start&&(a=e[0]),a&&0===s(r,n,a))return a;var o=i.default.search(e,s.bind(null,r,n));return!o||o===t&&a?a:o}function s(t,e,r){if(void 0===t&&(t=0),void 0===e&&(e=0),r.start<=t&&r.start+r.duration>t)return 0;var n=Math.min(e,r.duration+(r.deltaPTS?r.deltaPTS:0));return r.start+r.duration-n<=t?1:r.start-n>t&&r.start?-1:0}function l(t,e,r){var n=1e3*Math.min(e,r.duration+(r.deltaPTS?r.deltaPTS:0));return(r.endProgramDateTime||0)-n>t}function u(t,e){return i.default.search(t,(function(t){return t.cc<e?1:t.cc>e?-1:0}))}},"./src/controller/fragment-tracker.ts":(t,e,r)=>{"use strict";r.r(e),r.d(e,{FragmentState:()=>n,FragmentTracker:()=>o});var n,i=r("./src/events.ts"),a=r("./src/types/loader.ts");!function(t){t.NOT_LOADED="NOT_LOADED",t.APPENDING="APPENDING",t.PARTIAL="PARTIAL",t.OK="OK"}(n||(n={}));var o=function(){function t(t){this.activeFragment=null,this.activeParts=null,this.endListFragments=Object.create(null),this.fragments=Object.create(null),this.timeRanges=Object.create(null),this.bufferPadding=.2,this.hls=void 0,this.hls=t,this._registerListeners()}var e=t.prototype;return e._registerListeners=function(){var t=this.hls;t.on(i.Events.BUFFER_APPENDED,this.onBufferAppended,this),t.on(i.Events.FRAG_BUFFERED,this.onFragBuffered,this),t.on(i.Events.FRAG_LOADED,this.onFragLoaded,this)},e._unregisterListeners=function(){var t=this.hls;t.off(i.Events.BUFFER_APPENDED,this.onBufferAppended,this),t.off(i.Events.FRAG_BUFFERED,this.onFragBuffered,this),t.off(i.Events.FRAG_LOADED,this.onFragLoaded,this)},e.destroy=function(){this._unregisterListeners(),this.fragments=this.endListFragments=this.timeRanges=this.activeFragment=this.activeParts=null},e.getAppendedFrag=function(t,e){if(e===a.PlaylistLevelType.MAIN){var r=this.activeFragment,n=this.activeParts;if(!r)return null;if(n)for(var i=n.length;i--;){var o=n[i],s=o?o.end:r.appendedPTS;if(o.start<=t&&void 0!==s&&t<=s)return i>9&&(this.activeParts=n.slice(i-9)),o}else if(r.start<=t&&void 0!==r.appendedPTS&&t<=r.appendedPTS)return r}return this.getBufferedFrag(t,e)},e.getBufferedFrag=function(t,e){for(var r=this.fragments,n=Object.keys(r),i=n.length;i--;){var a=r[n[i]];if((null==a?void 0:a.body.type)===e&&a.buffered){var o=a.body;if(o.start<=t&&t<=o.end)return o}}return null},e.detectEvictedFragments=function(t,e,r){var n=this;this.timeRanges&&(this.timeRanges[t]=e),Object.keys(this.fragments).forEach((function(i){var a=n.fragments[i];if(a)if(a.buffered||a.loaded){var o=a.range[t];o&&o.time.some((function(t){var r=!n.isTimeBuffered(t.startPTS,t.endPTS,e);return r&&n.removeFragment(a.body),r}))}else a.body.type===r&&n.removeFragment(a.body)}))},e.detectPartialFragments=function(t){var e=this,r=this.timeRanges,n=t.frag,i=t.part;if(r&&"initSegment"!==n.sn){var a=l(n),o=this.fragments[a];o&&(Object.keys(r).forEach((function(t){var a=n.elementaryStreams[t];if(a){var s=r[t],l=null!==i||!0===a.partial;o.range[t]=e.getBufferedTimes(n,i,l,s)}})),o.loaded=null,Object.keys(o.range).length?(o.buffered=!0,o.body.endList&&(this.endListFragments[o.body.type]=o)):this.removeFragment(o.body))}},e.fragBuffered=function(t){var e=l(t),r=this.fragments[e];r&&(r.loaded=null,r.buffered=!0)},e.getBufferedTimes=function(t,e,r,n){for(var i={time:[],partial:r},a=e?e.start:t.start,o=e?e.end:t.end,s=t.minEndPTS||o,l=t.maxStartPTS||a,u=0;u<n.length;u++){var c=n.start(u)-this.bufferPadding,d=n.end(u)+this.bufferPadding;if(l>=c&&s<=d){i.time.push({startPTS:Math.max(a,n.start(u)),endPTS:Math.min(o,n.end(u))});break}if(a<d&&o>c)i.partial=!0,i.time.push({startPTS:Math.max(a,n.start(u)),endPTS:Math.min(o,n.end(u))});else if(o<=c)break}return i},e.getPartialFragment=function(t){var e,r,n,i=null,a=0,o=this.bufferPadding,l=this.fragments;return Object.keys(l).forEach((function(u){var c=l[u];c&&s(c)&&(r=c.body.start-o,n=c.body.end+o,t>=r&&t<=n&&(e=Math.min(t-r,n-t),a<=e&&(i=c.body,a=e)))})),i},e.isEndListAppended=function(t){var e=this.endListFragments[t];return void 0!==e&&(e.buffered||s(e))},e.getState=function(t){var e=l(t),r=this.fragments[e];return r?r.buffered?s(r)?n.PARTIAL:n.OK:n.APPENDING:n.NOT_LOADED},e.isTimeBuffered=function(t,e,r){for(var n,i,a=0;a<r.length;a++){if(n=r.start(a)-this.bufferPadding,i=r.end(a)+this.bufferPadding,t>=n&&e<=i)return!0;if(e<=n)return!1}return!1},e.onFragLoaded=function(t,e){var r=e.frag,n=e.part;if("initSegment"!==r.sn&&!r.bitrateTest&&!n){var i=l(r);this.fragments[i]={body:r,loaded:e,buffered:!1,range:Object.create(null)}}},e.onBufferAppended=function(t,e){var r=this,n=e.frag,i=e.part,o=e.timeRanges;if(n.type===a.PlaylistLevelType.MAIN)if(this.activeFragment!==n&&(this.activeFragment=n,n.appendedPTS=void 0),i){var s=this.activeParts;s||(this.activeParts=s=[]),s.push(i)}else this.activeParts=null;this.timeRanges=o,Object.keys(o).forEach((function(t){var e=o[t];if(r.detectEvictedFragments(t,e),!i&&n.type===a.PlaylistLevelType.MAIN){var s=n.elementaryStreams[t];if(!s)return;for(var l=0;l<e.length;l++){var u=e.end(l);u<=s.endPTS&&u>s.startPTS?n.appendedPTS=Math.max(u,n.appendedPTS||0):n.appendedPTS=s.endPTS}}}))},e.onFragBuffered=function(t,e){this.detectPartialFragments(e)},e.hasFragment=function(t){var e=l(t);return!!this.fragments[e]},e.removeFragmentsInRange=function(t,e,r){var n=this;Object.keys(this.fragments).forEach((function(i){var a=n.fragments[i];if(a&&a.buffered){var o=a.body;o.type===r&&o.start<e&&o.end>t&&n.removeFragment(o)}}))},e.removeFragment=function(t){var e=l(t);t.stats.loaded=0,t.clearElementaryStreamInfo(),t.appendedPTS=void 0,delete this.fragments[e],t.endList&&delete this.endListFragments[t.type]},e.removeAllFragments=function(){this.fragments=Object.create(null),this.endListFragments=Object.create(null),this.activeFragment=null,this.activeParts=null},t}();function s(t){var e,r;return t.buffered&&((null===(e=t.range.video)||void 0===e?void 0:e.partial)||(null===(r=t.range.audio)||void 0===r?void 0:r.partial))}function l(t){return t.type+"_"+t.level+"_"+t.urlId+"_"+t.sn}},"./src/controller/gap-controller.ts":(t,e,r)=>{"use strict";r.r(e),r.d(e,{MAX_START_GAP_JUMP:()=>l,SKIP_BUFFER_HOLE_STEP_SECONDS:()=>u,SKIP_BUFFER_RANGE_START:()=>c,STALL_MINIMUM_DURATION_MS:()=>s,default:()=>d});var n=r("./src/utils/buffer-helper.ts"),i=r("./src/errors.ts"),a=r("./src/events.ts"),o=r("./src/utils/logger.ts"),s=250,l=2,u=.1,c=.05,d=function(){function t(t,e,r,n){this.config=void 0,this.media=null,this.fragmentTracker=void 0,this.hls=void 0,this.nudgeRetry=0,this.stallReported=!1,this.stalled=null,this.moved=!1,this.seeking=!1,this.config=t,this.media=e,this.fragmentTracker=r,this.hls=n}var e=t.prototype;return e.destroy=function(){this.media=null,this.hls=this.fragmentTracker=null},e.poll=function(t,e){var r=this.config,i=this.media,a=this.stalled;if(null!==i){var u=i.currentTime,c=i.seeking,d=this.seeking&&!c,h=!this.seeking&&c;if(this.seeking=c,u===t){if((h||d)&&(this.stalled=null),!(i.paused&&!c||i.ended||0===i.playbackRate)&&n.BufferHelper.getBuffered(i).length){var f=n.BufferHelper.bufferInfo(i,u,0),p=f.len>0,g=f.nextStart||0;if(p||g){if(c){var v=f.len>l,m=!g||e&&e.start<=u||g-u>l&&!this.fragmentTracker.getPartialFragment(u);if(v||m)return;this.moved=!1}if(!this.moved&&null!==this.stalled){var y,b=Math.max(g,f.start||0)-u,E=this.hls.levels?this.hls.levels[this.hls.currentLevel]:null,x=(null==E||null===(y=E.details)||void 0===y?void 0:y.live)?2*E.details.targetduration:l;if(b>0&&b<=x)return void this._trySkipBufferHole(null)}var S=self.performance.now();if(null!==a){var T=S-a;if(c||!(T>=s)||(this._reportStall(f),this.media)){var w=n.BufferHelper.bufferInfo(i,u,r.maxBufferHole);this._tryFixBufferStall(w,T)}}else this.stalled=S}}}else if(this.moved=!0,null!==a){if(this.stallReported){var _=self.performance.now()-a;o.logger.warn("playback not stuck anymore @"+u+", after "+Math.round(_)+"ms"),this.stallReported=!1}this.stalled=null,this.nudgeRetry=0}}},e._tryFixBufferStall=function(t,e){var r=this.config,n=this.fragmentTracker,i=this.media;if(null!==i){var a=i.currentTime,s=n.getPartialFragment(a);if(s&&(this._trySkipBufferHole(s)||!this.media))return;t.len>r.maxBufferHole&&e>1e3*r.highBufferWatchdogPeriod&&(o.logger.warn("Trying to nudge playhead over buffer-hole"),this.stalled=null,this._tryNudgeBuffer())}},e._reportStall=function(t){var e=this.hls,r=this.media;!this.stallReported&&r&&(this.stallReported=!0,o.logger.warn("Playback stalling at @"+r.currentTime+" due to low buffer ("+JSON.stringify(t)+")"),e.trigger(a.Events.ERROR,{type:i.ErrorTypes.MEDIA_ERROR,details:i.ErrorDetails.BUFFER_STALLED_ERROR,fatal:!1,buffer:t.len}))},e._trySkipBufferHole=function(t){var e=this.config,r=this.hls,s=this.media;if(null===s)return 0;for(var l=s.currentTime,d=0,h=n.BufferHelper.getBuffered(s),f=0;f<h.length;f++){var p=h.start(f);if(l+e.maxBufferHole>=d&&l<p){var g=Math.max(p+c,s.currentTime+u);return o.logger.warn("skipping hole, adjusting currentTime from "+l+" to "+g),this.moved=!0,this.stalled=null,s.currentTime=g,t&&r.trigger(a.Events.ERROR,{type:i.ErrorTypes.MEDIA_ERROR,details:i.ErrorDetails.BUFFER_SEEK_OVER_HOLE,fatal:!1,reason:"fragment loaded with buffer holes, seeking from "+l+" to "+g,frag:t}),g}d=h.end(f)}return 0},e._tryNudgeBuffer=function(){var t=this.config,e=this.hls,r=this.media,n=this.nudgeRetry;if(null!==r){var s=r.currentTime;if(this.nudgeRetry++,n<t.nudgeMaxRetry){var l=s+(n+1)*t.nudgeOffset;o.logger.warn("Nudging 'currentTime' from "+s+" to "+l),r.currentTime=l,e.trigger(a.Events.ERROR,{type:i.ErrorTypes.MEDIA_ERROR,details:i.ErrorDetails.BUFFER_NUDGE_ON_STALL,fatal:!1})}else o.logger.error("Playhead still not moving while enough data buffered @"+s+" after "+t.nudgeMaxRetry+" nudges"),e.trigger(a.Events.ERROR,{type:i.ErrorTypes.MEDIA_ERROR,details:i.ErrorDetails.BUFFER_STALLED_ERROR,fatal:!0})}},t}()},"./src/controller/id3-track-controller.ts":(t,e,r)=>{"use strict";r.r(e),r.d(e,{default:()=>h});var n=r("./src/polyfills/number.ts"),i=r("./src/events.ts"),a=r("./src/utils/texttrack-utils.ts"),o=r("./src/demux/id3.ts"),s=r("./src/loader/date-range.ts"),l=r("./src/types/demuxer.ts");function u(){return self.WebKitDataCue||self.VTTCue||self.TextTrackCue}var c=function(){var t=u();try{new t(0,Number.POSITIVE_INFINITY,"")}catch(t){return Number.MAX_VALUE}return Number.POSITIVE_INFINITY}();function d(t,e){return t.getTime()/1e3-e}const h=function(){function t(t){this.hls=void 0,this.id3Track=null,this.media=null,this.dateRangeCuesAppended={},this.hls=t,this._registerListeners()}var e=t.prototype;return e.destroy=function(){this._unregisterListeners(),this.id3Track=null,this.media=null,this.dateRangeCuesAppended={},this.hls=null},e._registerListeners=function(){var t=this.hls;t.on(i.Events.MEDIA_ATTACHED,this.onMediaAttached,this),t.on(i.Events.MEDIA_DETACHING,this.onMediaDetaching,this),t.on(i.Events.MANIFEST_LOADING,this.onManifestLoading,this),t.on(i.Events.FRAG_PARSING_METADATA,this.onFragParsingMetadata,this),t.on(i.Events.BUFFER_FLUSHING,this.onBufferFlushing,this),t.on(i.Events.LEVEL_UPDATED,this.onLevelUpdated,this)},e._unregisterListeners=function(){var t=this.hls;t.off(i.Events.MEDIA_ATTACHED,this.onMediaAttached,this),t.off(i.Events.MEDIA_DETACHING,this.onMediaDetaching,this),t.off(i.Events.MANIFEST_LOADING,this.onManifestLoading,this),t.off(i.Events.FRAG_PARSING_METADATA,this.onFragParsingMetadata,this),t.off(i.Events.BUFFER_FLUSHING,this.onBufferFlushing,this),t.off(i.Events.LEVEL_UPDATED,this.onLevelUpdated,this)},e.onMediaAttached=function(t,e){this.media=e.media},e.onMediaDetaching=function(){this.id3Track&&((0,a.clearCurrentCues)(this.id3Track),this.id3Track=null,this.media=null,this.dateRangeCuesAppended={})},e.onManifestLoading=function(){this.dateRangeCuesAppended={}},e.createTrack=function(t){var e=this.getID3Track(t.textTracks);return e.mode="hidden",e},e.getID3Track=function(t){if(this.media){for(var e=0;e<t.length;e++){var r=t[e];if("metadata"===r.kind&&"id3"===r.label)return(0,a.sendAddTrackEvent)(r,this.media),r}return this.media.addTextTrack("metadata","id3")}},e.onFragParsingMetadata=function(t,e){if(this.media){var r=this.hls.config,n=r.enableEmsgMetadataCues,i=r.enableID3MetadataCues;if(n||i){var a=e.samples;this.id3Track||(this.id3Track=this.createTrack(this.media));for(var s=u(),d=0;d<a.length;d++){var h=a[d].type;if((h!==l.MetadataSchema.emsg||n)&&i){var f=o.getID3Frames(a[d].data);if(f){var p=a[d].pts,g=p+a[d].duration;g>c&&(g=c),g-p<=0&&(g=p+.25);for(var v=0;v<f.length;v++){var m=f[v];if(!o.isTimeStampFrame(m)){this.updateId3CueEnds(p);var y=new s(p,g,"");y.value=m,h&&(y.type=h),this.id3Track.addCue(y)}}}}}}}},e.updateId3CueEnds=function(t){var e,r=null===(e=this.id3Track)||void 0===e?void 0:e.cues;if(r)for(var n=r.length;n--;){var i=r[n];i.startTime<t&&i.endTime===c&&(i.endTime=t)}},e.onBufferFlushing=function(t,e){var r=e.startOffset,n=e.endOffset,i=e.type,o=this.id3Track,s=this.hls;if(s){var u,c=s.config,d=c.enableEmsgMetadataCues,h=c.enableID3MetadataCues;o&&(d||h)&&(u="audio"===i?function(t){return t.type===l.MetadataSchema.audioId3&&h}:"video"===i?function(t){return t.type===l.MetadataSchema.emsg&&d}:function(t){return t.type===l.MetadataSchema.audioId3&&h||t.type===l.MetadataSchema.emsg&&d},(0,a.removeCuesInRange)(o,r,n,u))}},e.onLevelUpdated=function(t,e){var r=this,i=e.details;if(this.media&&i.hasProgramDateTime&&this.hls.config.enableDateRangeMetadataCues){var a=this.dateRangeCuesAppended,o=this.id3Track,h=i.dateRanges,f=Object.keys(h);if(o)for(var p=Object.keys(a).filter((function(t){return!f.includes(t)})),g=function(t){var e=p[t];Object.keys(a[e].cues).forEach((function(t){o.removeCue(a[e].cues[t])})),delete a[e]},v=p.length;v--;)g(v);var m=i.fragments[i.fragments.length-1];if(0!==f.length&&(0,n.isFiniteNumber)(null==m?void 0:m.programDateTime)){this.id3Track||(this.id3Track=this.createTrack(this.media));for(var y=m.programDateTime/1e3-m.start,b=u(),E=function(t){var e=f[t],n=h[e],i=a[e],o=(null==i?void 0:i.cues)||{},u=(null==i?void 0:i.durationKnown)||!1,p=d(n.startDate,y),g=c,v=n.endDate;if(v)g=d(v,y),u=!0;else if(n.endOnNext&&!u){var m=f.reduce((function(t,e){var r=h[e];return r.class===n.class&&r.id!==e&&r.startDate>n.startDate&&t.push(r),t}),[]).sort((function(t,e){return t.startDate.getTime()-e.startDate.getTime()}))[0];m&&(g=d(m.startDate,y),u=!0)}for(var E,x=Object.keys(n.attr),S=0;S<x.length;S++){var T=x[S];if(T!==s.DateRangeAttribute.ID&&T!==s.DateRangeAttribute.CLASS&&T!==s.DateRangeAttribute.START_DATE&&T!==s.DateRangeAttribute.DURATION&&T!==s.DateRangeAttribute.END_DATE&&T!==s.DateRangeAttribute.END_ON_NEXT){var w=o[T];if(w)u&&!i.durationKnown&&(w.endTime=g);else{var _=n.attr[T];w=new b(p,g,""),T!==s.DateRangeAttribute.SCTE35_OUT&&T!==s.DateRangeAttribute.SCTE35_IN||(E=_,_=Uint8Array.from(E.replace(/^0x/,"").replace(/([\da-fA-F]{2}) ?/g,"0x$1 ").replace(/ +$/,"").split(" ")).buffer),w.value={key:T,data:_},w.type=l.MetadataSchema.dateRange,r.id3Track.addCue(w),o[T]=w}}}a[e]={cues:o,dateRange:n,durationKnown:u}},x=0;x<f.length;x++)E(x)}}},t}()},"./src/controller/latency-controller.ts":(t,e,r)=>{"use strict";r.r(e),r.d(e,{default:()=>s});var n=r("./src/errors.ts"),i=r("./src/events.ts"),a=r("./src/utils/logger.ts");function o(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,(void 0,"symbol"==typeof(i=function(t,e){if("object"!=typeof t||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(n.key))?i:String(i)),n)}var i}var s=function(){function t(t){var e=this;this.hls=void 0,this.config=void 0,this.media=null,this.levelDetails=null,this.currentTime=0,this.stallCount=0,this._latency=null,this.timeupdateHandler=function(){return e.timeupdate()},this.hls=t,this.config=t.config,this.registerListeners()}var e,r,s=t.prototype;return s.destroy=function(){this.unregisterListeners(),this.onMediaDetaching(),this.levelDetails=null,this.hls=this.timeupdateHandler=null},s.registerListeners=function(){this.hls.on(i.Events.MEDIA_ATTACHED,this.onMediaAttached,this),this.hls.on(i.Events.MEDIA_DETACHING,this.onMediaDetaching,this),this.hls.on(i.Events.MANIFEST_LOADING,this.onManifestLoading,this),this.hls.on(i.Events.LEVEL_UPDATED,this.onLevelUpdated,this),this.hls.on(i.Events.ERROR,this.onError,this)},s.unregisterListeners=function(){this.hls.off(i.Events.MEDIA_ATTACHED,this.onMediaAttached),this.hls.off(i.Events.MEDIA_DETACHING,this.onMediaDetaching),this.hls.off(i.Events.MANIFEST_LOADING,this.onManifestLoading),this.hls.off(i.Events.LEVEL_UPDATED,this.onLevelUpdated),this.hls.off(i.Events.ERROR,this.onError)},s.onMediaAttached=function(t,e){this.media=e.media,this.media.addEventListener("timeupdate",this.timeupdateHandler)},s.onMediaDetaching=function(){this.media&&(this.media.removeEventListener("timeupdate",this.timeupdateHandler),this.media=null)},s.onManifestLoading=function(){this.levelDetails=null,this._latency=null,this.stallCount=0},s.onLevelUpdated=function(t,e){var r=e.details;this.levelDetails=r,r.advanced&&this.timeupdate(),!r.live&&this.media&&this.media.removeEventListener("timeupdate",this.timeupdateHandler)},s.onError=function(t,e){e.details===n.ErrorDetails.BUFFER_STALLED_ERROR&&(this.stallCount++,a.logger.warn("[playback-rate-controller]: Stall detected, adjusting target latency"))},s.timeupdate=function(){var t=this.media,e=this.levelDetails;if(t&&e){this.currentTime=t.currentTime;var r=this.computeLatency();if(null!==r){this._latency=r;var n=this.config,i=n.lowLatencyMode,a=n.maxLiveSyncPlaybackRate;if(i&&1!==a){var o=this.targetLatency;if(null!==o){var s=r-o,l=s<Math.min(this.maxLatency,o+e.targetduration);if(e.live&&l&&s>.05&&this.forwardBufferLength>1){var u=Math.min(2,Math.max(1,a)),c=Math.round(2/(1+Math.exp(-.75*s-this.edgeStalled))*20)/20;t.playbackRate=Math.min(u,Math.max(1,c))}else 1!==t.playbackRate&&0!==t.playbackRate&&(t.playbackRate=1)}}}}},s.estimateLiveEdge=function(){var t=this.levelDetails;return null===t?null:t.edge+t.age},s.computeLatency=function(){var t=this.estimateLiveEdge();return null===t?null:t-this.currentTime},e=t,(r=[{key:"latency",get:function(){return this._latency||0}},{key:"maxLatency",get:function(){var t=this.config,e=this.levelDetails;return void 0!==t.liveMaxLatencyDuration?t.liveMaxLatencyDuration:e?t.liveMaxLatencyDurationCount*e.targetduration:0}},{key:"targetLatency",get:function(){var t=this.levelDetails;if(null===t)return null;var e=t.holdBack,r=t.partHoldBack,n=t.targetduration,i=this.config,a=i.liveSyncDuration,o=i.liveSyncDurationCount,s=i.lowLatencyMode,l=this.hls.userConfig,u=s&&r||e;(l.liveSyncDuration||l.liveSyncDurationCount||0===u)&&(u=void 0!==a?a:o*n);var c=n;return u+Math.min(1*this.stallCount,c)}},{key:"liveSyncPosition",get:function(){var t=this.estimateLiveEdge(),e=this.targetLatency,r=this.levelDetails;if(null===t||null===e||null===r)return null;var n=r.edge,i=t-e-this.edgeStalled,a=n-r.totalduration,o=n-(this.config.lowLatencyMode&&r.partTarget||r.targetduration);return Math.min(Math.max(a,i),o)}},{key:"drift",get:function(){var t=this.levelDetails;return null===t?1:t.drift}},{key:"edgeStalled",get:function(){var t=this.levelDetails;if(null===t)return 0;var e=3*(this.config.lowLatencyMode&&t.partTarget||t.targetduration);return Math.max(t.age-e,0)}},{key:"forwardBufferLength",get:function(){var t=this.media,e=this.levelDetails;if(!t||!e)return 0;var r=t.buffered.length;return(r?t.buffered.end(r-1):e.edge)-this.currentTime}}])&&o(e.prototype,r),Object.defineProperty(e,"prototype",{writable:!1}),t}()},"./src/controller/level-controller.ts":(t,e,r)=>{"use strict";r.r(e),r.d(e,{default:()=>p});var n=r("./src/types/level.ts"),i=r("./src/events.ts"),a=r("./src/errors.ts"),o=r("./src/utils/codecs.ts"),s=r("./src/controller/level-helper.ts"),l=r("./src/controller/base-playlist-controller.ts"),u=r("./src/types/loader.ts");function c(){return c=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(t[n]=r[n])}return t},c.apply(this,arguments)}function d(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,(void 0,"symbol"==typeof(i=function(t,e){if("object"!=typeof t||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(n.key))?i:String(i)),n)}var i}function h(t,e){return h=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},h(t,e)}var f=/chrome|firefox/.test(navigator.userAgent.toLowerCase()),p=function(t){var e,r;function l(e){var r;return(r=t.call(this,e,"[level-controller]")||this)._levels=[],r._firstLevel=-1,r._startLevel=void 0,r.currentLevelIndex=-1,r.manualLevelIndex=-1,r.onParsedComplete=void 0,r._registerListeners(),r}r=t,(e=l).prototype=Object.create(r.prototype),e.prototype.constructor=e,h(e,r);var p,g,v=l.prototype;return v._registerListeners=function(){var t=this.hls;t.on(i.Events.MANIFEST_LOADED,this.onManifestLoaded,this),t.on(i.Events.LEVEL_LOADED,this.onLevelLoaded,this),t.on(i.Events.AUDIO_TRACK_SWITCHED,this.onAudioTrackSwitched,this),t.on(i.Events.FRAG_LOADED,this.onFragLoaded,this),t.on(i.Events.ERROR,this.onError,this)},v._unregisterListeners=function(){var t=this.hls;t.off(i.Events.MANIFEST_LOADED,this.onManifestLoaded,this),t.off(i.Events.LEVEL_LOADED,this.onLevelLoaded,this),t.off(i.Events.AUDIO_TRACK_SWITCHED,this.onAudioTrackSwitched,this),t.off(i.Events.FRAG_LOADED,this.onFragLoaded,this),t.off(i.Events.ERROR,this.onError,this)},v.destroy=function(){this._unregisterListeners(),this.manualLevelIndex=-1,this._levels.length=0,t.prototype.destroy.call(this)},v.startLoad=function(){this._levels.forEach((function(t){t.loadError=0})),t.prototype.startLoad.call(this)},v.onManifestLoaded=function(t,e){var r,l,u=[],c=[],d=[],h={},p=!1,g=!1,v=!1;if(e.levels.forEach((function(t){var e=t.attrs;p=p||!(!t.width||!t.height),g=g||!!t.videoCodec,v=v||!!t.audioCodec,f&&t.audioCodec&&-1!==t.audioCodec.indexOf("mp4a.40.34")&&(t.audioCodec=void 0);var r=t.bitrate+"-"+t.attrs.RESOLUTION+"-"+t.attrs.CODECS;(l=h[r])?l.url.push(t.url):(l=new n.Level(t),h[r]=l,u.push(l)),e&&(e.AUDIO&&(0,s.addGroupId)(l,"audio",e.AUDIO),e.SUBTITLES&&(0,s.addGroupId)(l,"text",e.SUBTITLES))})),(p||g)&&v&&(u=u.filter((function(t){var e=t.videoCodec,r=t.width,n=t.height;return!!e||!(!r||!n)}))),u=u.filter((function(t){var e=t.audioCodec,r=t.videoCodec;return(!e||(0,o.isCodecSupportedInMp4)(e,"audio"))&&(!r||(0,o.isCodecSupportedInMp4)(r,"video"))})),e.audioTracks&&(c=e.audioTracks.filter((function(t){return!t.audioCodec||(0,o.isCodecSupportedInMp4)(t.audioCodec,"audio")})),(0,s.assignTrackIdsByGroup)(c)),e.subtitles&&(d=e.subtitles,(0,s.assignTrackIdsByGroup)(d)),u.length>0){r=u[0].bitrate,u.sort((function(t,e){return t.attrs["HDCP-LEVEL"]!==e.attrs["HDCP-LEVEL"]?(t.attrs["HDCP-LEVEL"]||"")>(e.attrs["HDCP-LEVEL"]||"")?1:-1:t.bitrate!==e.bitrate?t.bitrate-e.bitrate:t.attrs.SCORE!==e.attrs.SCORE?t.attrs.decimalFloatingPoint("SCORE")-e.attrs.decimalFloatingPoint("SCORE"):p&&t.height!==e.height?t.height-e.height:0})),this._levels=u;for(var m=0;m<u.length;m++)if(u[m].bitrate===r){this._firstLevel=m,this.log("manifest loaded, "+u.length+" level(s) found, first bitrate: "+r);break}var y=v&&!g,b={levels:u,audioTracks:c,subtitleTracks:d,sessionData:e.sessionData,sessionKeys:e.sessionKeys,firstLevel:this._firstLevel,stats:e.stats,audio:v,video:g,altAudio:!y&&c.some((function(t){return!!t.url}))};this.hls.trigger(i.Events.MANIFEST_PARSED,b),(this.hls.config.autoStartLoad||this.hls.forceStartLoad)&&this.hls.startLoad(this.hls.config.startPosition)}else this.hls.trigger(i.Events.ERROR,{type:a.ErrorTypes.MEDIA_ERROR,details:a.ErrorDetails.MANIFEST_INCOMPATIBLE_CODECS_ERROR,fatal:!0,url:e.url,reason:"no level with compatible codecs found in manifest"})},v.onError=function(e,r){var i,o;if(t.prototype.onError.call(this,e,r),!r.fatal){var s=r.context,l=this._levels[this.currentLevelIndex];if(s&&(s.type===u.PlaylistContextType.AUDIO_TRACK&&l.audioGroupIds&&s.groupId===l.audioGroupIds[l.urlId]||s.type===u.PlaylistContextType.SUBTITLE_TRACK&&l.textGroupIds&&s.groupId===l.textGroupIds[l.urlId]))this.redundantFailover(this.currentLevelIndex);else{var c,d=!1,h=!0;switch(r.details){case a.ErrorDetails.FRAG_LOAD_ERROR:case a.ErrorDetails.FRAG_LOAD_TIMEOUT:case a.ErrorDetails.KEY_LOAD_ERROR:case a.ErrorDetails.KEY_LOAD_TIMEOUT:if(r.frag){var f=r.frag.type===u.PlaylistLevelType.MAIN?r.frag.level:this.currentLevelIndex,p=this._levels[f];p?(p.fragmentError++,p.fragmentError>this.hls.config.fragLoadingMaxRetry&&(c=f)):c=f}break;case a.ErrorDetails.KEY_SYSTEM_STATUS_OUTPUT_RESTRICTED:var g=l.attrs["HDCP-LEVEL"];g&&(this.hls.maxHdcpLevel=n.HdcpLevels[n.HdcpLevels.indexOf(g)-1],this.warn('Restricting playback to HDCP-LEVEL of "'+this.hls.maxHdcpLevel+'" or lower'));case a.ErrorDetails.FRAG_PARSING_ERROR:case a.ErrorDetails.KEY_SYSTEM_NO_SESSION:c=(null===(i=r.frag)||void 0===i?void 0:i.type)===u.PlaylistLevelType.MAIN?r.frag.level:this.currentLevelIndex,r.levelRetry=!1;break;case a.ErrorDetails.LEVEL_LOAD_ERROR:case a.ErrorDetails.LEVEL_LOAD_TIMEOUT:s&&(s.deliveryDirectives&&(h=!1),c=s.level),d=!0;break;case a.ErrorDetails.REMUX_ALLOC_ERROR:c=null!=(o=r.level)?o:this.currentLevelIndex,d=!0}void 0!==c&&this.recoverLevel(r,c,d,h)}}},v.recoverLevel=function(t,e,r,n){var i=t.details,a=this._levels[e];if(a.loadError++,r){if(!this.retryLoadingOrFail(t))return void(this.currentLevelIndex=-1);t.levelRetry=!0}if(n){var o=a.url.length;if(o>1&&a.loadError<o)t.levelRetry=!0,this.redundantFailover(e);else if(-1===this.manualLevelIndex){for(var s=-1,l=this._levels,u=l.length;u--;){var c=(u+this.currentLevelIndex)%l.length;if(c!==this.currentLevelIndex&&0===l[c].loadError){s=c;break}}s>-1&&this.currentLevelIndex!==s?(this.warn(i+": switch to "+s),t.levelRetry=!0,this.hls.nextAutoLevel=s):!1===t.levelRetry&&(t.fatal=!0)}}},v.redundantFailover=function(t){var e=this._levels[t],r=e.url.length;if(r>1){var n=(e.urlId+1)%r;this.warn("Switching to redundant URL-id "+n),this._levels.forEach((function(t){t.urlId=n})),this.level=t}},v.onFragLoaded=function(t,e){var r=e.frag;if(void 0!==r&&r.type===u.PlaylistLevelType.MAIN){var n=this._levels[r.level];void 0!==n&&(n.fragmentError=0,n.loadError=0)}},v.onLevelLoaded=function(t,e){var r,n,i=e.level,a=e.details,o=this._levels[i];if(!o)return this.warn("Invalid level index "+i),void(null!==(n=e.deliveryDirectives)&&void 0!==n&&n.skip&&(a.deltaUpdateFailed=!0));i===this.currentLevelIndex?(0===o.fragmentError&&(o.loadError=0,this.retryCount=0),this.playlistLoaded(i,e,o.details)):null!==(r=e.deliveryDirectives)&&void 0!==r&&r.skip&&(a.deltaUpdateFailed=!0)},v.onAudioTrackSwitched=function(t,e){var r=this.hls.levels[this.currentLevelIndex];if(r&&r.audioGroupIds){for(var n=-1,i=this.hls.audioTracks[e.id].groupId,a=0;a<r.audioGroupIds.length;a++)if(r.audioGroupIds[a]===i){n=a;break}n!==r.urlId&&(r.urlId=n,this.startLoad())}},v.loadPlaylist=function(e){t.prototype.loadPlaylist.call(this);var r=this.currentLevelIndex,n=this._levels[r];if(this.canLoad&&n&&n.url.length>0){var a=n.urlId,o=n.url[a];if(e)try{o=e.addDirectives(o)}catch(t){this.warn("Could not construct new URL with HLS Delivery Directives: "+t)}this.log("Attempt loading level index "+r+(e?" at sn "+e.msn+" part "+e.part:"")+" with URL-id "+a+" "+o),this.clearTimer(),this.hls.trigger(i.Events.LEVEL_LOADING,{url:o,level:r,id:a,deliveryDirectives:e||null})}},v.removeLevel=function(t,e){var r=function(t,r){return r!==e},n=this._levels.filter((function(n,i){return i!==t||n.url.length>1&&void 0!==e&&(n.url=n.url.filter(r),n.audioGroupIds&&(n.audioGroupIds=n.audioGroupIds.filter(r)),n.textGroupIds&&(n.textGroupIds=n.textGroupIds.filter(r)),n.urlId=0,!0)})).map((function(t,e){var r=t.details;return null!=r&&r.fragments&&r.fragments.forEach((function(t){t.level=e})),t}));this._levels=n,this.hls.trigger(i.Events.LEVELS_UPDATED,{levels:n})},p=l,(g=[{key:"levels",get:function(){return 0===this._levels.length?null:this._levels}},{key:"level",get:function(){return this.currentLevelIndex},set:function(t){var e,r=this._levels;if(0!==r.length&&(this.currentLevelIndex!==t||null===(e=r[t])||void 0===e||!e.details)){if(t<0||t>=r.length){var n=t<0;if(this.hls.trigger(i.Events.ERROR,{type:a.ErrorTypes.OTHER_ERROR,details:a.ErrorDetails.LEVEL_SWITCH_ERROR,level:t,fatal:n,reason:"invalid level idx"}),n)return;t=Math.min(t,r.length-1)}this.clearTimer();var o=this.currentLevelIndex,s=r[o],l=r[t];this.log("switching to level "+t+" from "+o),this.currentLevelIndex=t;var u=c({},l,{level:t,maxBitrate:l.maxBitrate,uri:l.uri,urlId:l.urlId});delete u._urlId,this.hls.trigger(i.Events.LEVEL_SWITCHING,u);var d=l.details;if(!d||d.live){var h=this.switchParams(l.uri,null==s?void 0:s.details);this.loadPlaylist(h)}}}},{key:"manualLevel",get:function(){return this.manualLevelIndex},set:function(t){this.manualLevelIndex=t,void 0===this._startLevel&&(this._startLevel=t),-1!==t&&(this.level=t)}},{key:"firstLevel",get:function(){return this._firstLevel},set:function(t){this._firstLevel=t}},{key:"startLevel",get:function(){if(void 0===this._startLevel){var t=this.hls.config.startLevel;return void 0!==t?t:this._firstLevel}return this._startLevel},set:function(t){this._startLevel=t}},{key:"nextLoadLevel",get:function(){return-1!==this.manualLevelIndex?this.manualLevelIndex:this.hls.nextAutoLevel},set:function(t){this.level=t,-1===this.manualLevelIndex&&(this.hls.nextAutoLevel=t)}}])&&d(p.prototype,g),Object.defineProperty(p,"prototype",{writable:!1}),l}(l.default)},"./src/controller/level-helper.ts":(t,e,r)=>{"use strict";r.r(e),r.d(e,{addGroupId:()=>s,addSliding:()=>v,adjustSliding:()=>g,assignTrackIdsByGroup:()=>l,computeReloadInterval:()=>m,getFragmentWithSN:()=>y,getPartWith:()=>b,mapFragmentIntersection:()=>p,mapPartIntersection:()=>f,mergeDetails:()=>h,updateFragPTSDTS:()=>d,updatePTS:()=>u});var n=r("./src/polyfills/number.ts"),i=r("./src/utils/logger.ts"),a=r("./src/loader/date-range.ts");function o(){return o=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(t[n]=r[n])}return t},o.apply(this,arguments)}function s(t,e,r){switch(e){case"audio":t.audioGroupIds||(t.audioGroupIds=[]),t.audioGroupIds.push(r);break;case"text":t.textGroupIds||(t.textGroupIds=[]),t.textGroupIds.push(r)}}function l(t){var e={};t.forEach((function(t){var r=t.groupId||"";t.id=e[r]=e[r]||0,e[r]++}))}function u(t,e,r){c(t[e],t[r])}function c(t,e){var r=e.startPTS;if((0,n.isFiniteNumber)(r)){var i,a=0;e.sn>t.sn?(a=r-t.start,i=t):(a=t.start-r,i=e),i.duration!==a&&(i.duration=a)}else e.sn>t.sn?t.cc===e.cc&&t.minEndPTS?e.start=t.start+(t.minEndPTS-t.start):e.start=t.start+t.duration:e.start=Math.max(t.start-e.duration,0)}function d(t,e,r,a,o,s){a-r<=0&&(i.logger.warn("Fragment should have a positive duration",e),a=r+e.duration,s=o+e.duration);var l=r,u=a,d=e.startPTS,h=e.endPTS;if((0,n.isFiniteNumber)(d)){var f=Math.abs(d-r);(0,n.isFiniteNumber)(e.deltaPTS)?e.deltaPTS=Math.max(f,e.deltaPTS):e.deltaPTS=f,l=Math.max(r,d),r=Math.min(r,d),o=Math.min(o,e.startDTS),u=Math.min(a,h),a=Math.max(a,h),s=Math.max(s,e.endDTS)}e.duration=a-r;var p=r-e.start;e.start=e.startPTS=r,e.maxStartPTS=l,e.startDTS=o,e.endPTS=a,e.minEndPTS=u,e.endDTS=s;var g,v=e.sn;if(!t||v<t.startSN||v>t.endSN)return 0;var m=v-t.startSN,y=t.fragments;for(y[m]=e,g=m;g>0;g--)c(y[g],y[g-1]);for(g=m;g<y.length-1;g++)c(y[g],y[g+1]);return t.fragmentHint&&c(y[y.length-1],t.fragmentHint),t.PTSKnown=t.alignedSliding=!0,p}function h(t,e){for(var r=null,s=t.fragments,l=s.length-1;l>=0;l--){var u=s[l].initSegment;if(u){r=u;break}}t.fragmentHint&&delete t.fragmentHint.endPTS;var c,h,v,m,y,b=0;if(p(t,e,(function(t,i){t.relurl&&(b=t.cc-i.cc),(0,n.isFiniteNumber)(t.startPTS)&&(0,n.isFiniteNumber)(t.endPTS)&&(i.start=i.startPTS=t.startPTS,i.startDTS=t.startDTS,i.appendedPTS=t.appendedPTS,i.maxStartPTS=t.maxStartPTS,i.endPTS=t.endPTS,i.endDTS=t.endDTS,i.minEndPTS=t.minEndPTS,i.duration=t.endPTS-t.startPTS,i.duration&&(c=i),e.PTSKnown=e.alignedSliding=!0),i.elementaryStreams=t.elementaryStreams,i.loader=t.loader,i.stats=t.stats,i.urlId=t.urlId,t.initSegment&&(i.initSegment=t.initSegment,r=t.initSegment)})),r&&(e.fragmentHint?e.fragments.concat(e.fragmentHint):e.fragments).forEach((function(t){var e;t.initSegment&&t.initSegment.relurl!==(null===(e=r)||void 0===e?void 0:e.relurl)||(t.initSegment=r)})),e.skippedSegments)if(e.deltaUpdateFailed=e.fragments.some((function(t){return!t})),e.deltaUpdateFailed){i.logger.warn("[level-helper] Previous playlist missing segments skipped in delta playlist");for(var E=e.skippedSegments;E--;)e.fragments.shift();e.startSN=e.fragments[0].sn,e.startCC=e.fragments[0].cc}else e.canSkipDateRanges&&(e.dateRanges=(h=t.dateRanges,v=e.dateRanges,m=e.recentlyRemovedDateranges,y=o({},h),m&&m.forEach((function(t){delete y[t]})),Object.keys(v).forEach((function(t){var e=new a.DateRange(v[t].attr,y[t]);e.isValid?y[t]=e:i.logger.warn('Ignoring invalid Playlist Delta Update DATERANGE tag: "'+JSON.stringify(v[t].attr)+'"')})),y));var x=e.fragments;if(b){i.logger.warn("discontinuity sliding from playlist, take drift into account");for(var S=0;S<x.length;S++)x[S].cc+=b}e.skippedSegments&&(e.startCC=e.fragments[0].cc),f(t.partList,e.partList,(function(t,e){e.elementaryStreams=t.elementaryStreams,e.stats=t.stats})),c?d(e,c,c.startPTS,c.endPTS,c.startDTS,c.endDTS):g(t,e),x.length&&(e.totalduration=e.edge-x[0].start),e.driftStartTime=t.driftStartTime,e.driftStart=t.driftStart;var T=e.advancedDateTime;if(e.advanced&&T){var w=e.edge;e.driftStart||(e.driftStartTime=T,e.driftStart=w),e.driftEndTime=T,e.driftEnd=w}else e.driftEndTime=t.driftEndTime,e.driftEnd=t.driftEnd,e.advancedDateTime=t.advancedDateTime}function f(t,e,r){if(t&&e)for(var n=0,i=0,a=t.length;i<=a;i++){var o=t[i],s=e[i+n];o&&s&&o.index===s.index&&o.fragment.sn===s.fragment.sn?r(o,s):n--}}function p(t,e,r){for(var n=e.skippedSegments,i=Math.max(t.startSN,e.startSN)-e.startSN,a=(t.fragmentHint?1:0)+(n?e.endSN:Math.min(t.endSN,e.endSN))-e.startSN,o=e.startSN-t.startSN,s=e.fragmentHint?e.fragments.concat(e.fragmentHint):e.fragments,l=t.fragmentHint?t.fragments.concat(t.fragmentHint):t.fragments,u=i;u<=a;u++){var c=l[o+u],d=s[u];n&&!d&&u<n&&(d=e.fragments[u]=c),c&&d&&r(c,d)}}function g(t,e){var r=e.startSN+e.skippedSegments-t.startSN,n=t.fragments;r<0||r>=n.length||v(e,n[r].start)}function v(t,e){if(e){for(var r=t.fragments,n=t.skippedSegments;n<r.length;n++)r[n].start+=e;t.fragmentHint&&(t.fragmentHint.start+=e)}}function m(t,e){void 0===e&&(e=1/0);var r=1e3*t.targetduration;if(t.updated){var n=t.fragments;if(n.length&&4*r>e){var i=1e3*n[n.length-1].duration;i<r&&(r=i)}}else r/=2;return Math.round(r)}function y(t,e,r){if(!t||!t.details)return null;var n=t.details,i=n.fragments[e-n.startSN];return i||((i=n.fragmentHint)&&i.sn===e?i:e<n.startSN&&r&&r.sn===e?r:null)}function b(t,e,r){if(!t||!t.details)return null;var n=t.details.partList;if(n)for(var i=n.length;i--;){var a=n[i];if(a.index===r&&a.fragment.sn===e)return a}return null}},"./src/controller/stream-controller.ts":(t,e,r)=>{"use strict";r.r(e),r.d(e,{default:()=>m});var n=r("./src/polyfills/number.ts"),i=r("./src/controller/base-stream-controller.ts"),a=r("./src/is-supported.ts"),o=r("./src/events.ts"),s=r("./src/utils/buffer-helper.ts"),l=r("./src/controller/fragment-tracker.ts"),u=r("./src/types/loader.ts"),c=r("./src/loader/fragment.ts"),d=r("./src/demux/transmuxer-interface.ts"),h=r("./src/types/transmuxer.ts"),f=r("./src/controller/gap-controller.ts"),p=r("./src/errors.ts");function g(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,(void 0,"symbol"==typeof(i=function(t,e){if("object"!=typeof t||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(n.key))?i:String(i)),n)}var i}function v(t,e){return v=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},v(t,e)}var m=function(t){var e,r;function m(e,r,n){var i;return(i=t.call(this,e,r,n,"[stream-controller]")||this).audioCodecSwap=!1,i.gapController=null,i.level=-1,i._forceStartLoad=!1,i.altAudio=!1,i.audioOnly=!1,i.fragPlaying=null,i.onvplaying=null,i.onvseeked=null,i.fragLastKbps=0,i.couldBacktrack=!1,i.backtrackFragment=null,i.audioCodecSwitch=!1,i.videoBuffer=null,i._registerListeners(),i}r=t,(e=m).prototype=Object.create(r.prototype),e.prototype.constructor=e,v(e,r);var y,b,E=m.prototype;return E._registerListeners=function(){var t=this.hls;t.on(o.Events.MEDIA_ATTACHED,this.onMediaAttached,this),t.on(o.Events.MEDIA_DETACHING,this.onMediaDetaching,this),t.on(o.Events.MANIFEST_LOADING,this.onManifestLoading,this),t.on(o.Events.MANIFEST_PARSED,this.onManifestParsed,this),t.on(o.Events.LEVEL_LOADING,this.onLevelLoading,this),t.on(o.Events.LEVEL_LOADED,this.onLevelLoaded,this),t.on(o.Events.FRAG_LOAD_EMERGENCY_ABORTED,this.onFragLoadEmergencyAborted,this),t.on(o.Events.ERROR,this.onError,this),t.on(o.Events.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),t.on(o.Events.AUDIO_TRACK_SWITCHED,this.onAudioTrackSwitched,this),t.on(o.Events.BUFFER_CREATED,this.onBufferCreated,this),t.on(o.Events.BUFFER_FLUSHED,this.onBufferFlushed,this),t.on(o.Events.LEVELS_UPDATED,this.onLevelsUpdated,this),t.on(o.Events.FRAG_BUFFERED,this.onFragBuffered,this)},E._unregisterListeners=function(){var t=this.hls;t.off(o.Events.MEDIA_ATTACHED,this.onMediaAttached,this),t.off(o.Events.MEDIA_DETACHING,this.onMediaDetaching,this),t.off(o.Events.MANIFEST_LOADING,this.onManifestLoading,this),t.off(o.Events.MANIFEST_PARSED,this.onManifestParsed,this),t.off(o.Events.LEVEL_LOADED,this.onLevelLoaded,this),t.off(o.Events.FRAG_LOAD_EMERGENCY_ABORTED,this.onFragLoadEmergencyAborted,this),t.off(o.Events.ERROR,this.onError,this),t.off(o.Events.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),t.off(o.Events.AUDIO_TRACK_SWITCHED,this.onAudioTrackSwitched,this),t.off(o.Events.BUFFER_CREATED,this.onBufferCreated,this),t.off(o.Events.BUFFER_FLUSHED,this.onBufferFlushed,this),t.off(o.Events.LEVELS_UPDATED,this.onLevelsUpdated,this),t.off(o.Events.FRAG_BUFFERED,this.onFragBuffered,this)},E.onHandlerDestroying=function(){this._unregisterListeners(),this.onMediaDetaching()},E.startLoad=function(t){if(this.levels){var e=this.lastCurrentTime,r=this.hls;if(this.stopLoad(),this.setInterval(100),this.level=-1,this.fragLoadError=0,!this.startFragRequested){var n=r.startLevel;-1===n&&(r.config.testBandwidth&&this.levels.length>1?(n=0,this.bitrateTest=!0):n=r.nextAutoLevel),this.level=r.nextLoadLevel=n,this.loadedmetadata=!1}e>0&&-1===t&&(this.log("Override startPosition with lastCurrentTime @"+e.toFixed(3)),t=e),this.state=i.State.IDLE,this.nextLoadPosition=this.startPosition=this.lastCurrentTime=t,this.tick()}else this._forceStartLoad=!0,this.state=i.State.STOPPED},E.stopLoad=function(){this._forceStartLoad=!1,t.prototype.stopLoad.call(this)},E.doTick=function(){switch(this.state){case i.State.IDLE:this.doTickIdle();break;case i.State.WAITING_LEVEL:var t,e=this.levels,r=this.level,n=null==e||null===(t=e[r])||void 0===t?void 0:t.details;if(n&&(!n.live||this.levelLastLoaded===this.level)){if(this.waitForCdnTuneIn(n))break;this.state=i.State.IDLE;break}break;case i.State.FRAG_LOADING_WAITING_RETRY:var a,o=self.performance.now(),s=this.retryDate;(!s||o>=s||null!==(a=this.media)&&void 0!==a&&a.seeking)&&(this.log("retryDate reached, switch back to IDLE state"),this.resetStartWhenNotLoaded(this.level),this.state=i.State.IDLE)}this.onTickEnd()},E.onTickEnd=function(){t.prototype.onTickEnd.call(this),this.checkBuffer(),this.checkFragmentChanged()},E.doTickIdle=function(){var t=this.hls,e=this.levelLastLoaded,r=this.levels,n=this.media,a=t.config,s=t.nextLoadLevel;if(null!==e&&(n||!this.startFragRequested&&a.startFragPrefetch)&&(!this.altAudio||!this.audioOnly)&&r&&r[s]){var d=r[s],h=this.getMainFwdBufferInfo();if(null!==h){var f=this.getLevelDetails();if(f&&this._streamEnded(h,f)){var p={};return this.altAudio&&(p.type="video"),this.hls.trigger(o.Events.BUFFER_EOS,p),void(this.state=i.State.ENDED)}this.level=t.nextLoadLevel=s;var g=d.details;if(!g||this.state===i.State.WAITING_LEVEL||g.live&&this.levelLastLoaded!==s)return this.level=s,void(this.state=i.State.WAITING_LEVEL);if(!(h.len>=this.getMaxBufferLength(d.maxBitrate))){this.backtrackFragment&&this.backtrackFragment.start>h.end&&(this.backtrackFragment=null);var v=this.backtrackFragment?this.backtrackFragment.start:h.end,m=this.getNextFragment(v,g);if(this.couldBacktrack&&!this.fragPrevious&&m&&"initSegment"!==m.sn&&this.fragmentTracker.getState(m)!==l.FragmentState.OK){var y,b=(null!=(y=this.backtrackFragment)?y:m).sn-g.startSN,E=g.fragments[b-1];E&&m.cc===E.cc&&(m=E,this.fragmentTracker.removeFragment(E))}else this.backtrackFragment&&h.len&&(this.backtrackFragment=null);if(m&&this.fragmentTracker.getState(m)===l.FragmentState.OK&&this.nextLoadPosition>v){var x=this.audioOnly&&!this.altAudio?c.ElementaryStreamTypes.AUDIO:c.ElementaryStreamTypes.VIDEO,S=(x===c.ElementaryStreamTypes.VIDEO?this.videoBuffer:this.mediaBuffer)||this.media;S&&this.afterBufferFlushed(S,x,u.PlaylistLevelType.MAIN),m=this.getNextFragment(this.nextLoadPosition,g)}m&&(!m.initSegment||m.initSegment.data||this.bitrateTest||(m=m.initSegment),this.loadFragment(m,g,v))}}}},E.loadFragment=function(e,r,n){var i,a=this.fragmentTracker.getState(e);this.fragCurrent=e,a===l.FragmentState.NOT_LOADED?"initSegment"===e.sn?this._loadInitSegment(e,r):this.bitrateTest?(this.log("Fragment "+e.sn+" of level "+e.level+" is being downloaded to test bitrate and will not be buffered"),this._loadBitrateTestFrag(e,r)):(this.startFragRequested=!0,t.prototype.loadFragment.call(this,e,r,n)):a===l.FragmentState.APPENDING?this.reduceMaxBufferLength(e.duration)&&this.fragmentTracker.removeFragment(e):0===(null===(i=this.media)||void 0===i?void 0:i.buffered.length)&&this.fragmentTracker.removeAllFragments()},E.getAppendedFrag=function(t){var e=this.fragmentTracker.getAppendedFrag(t,u.PlaylistLevelType.MAIN);return e&&"fragment"in e?e.fragment:e},E.getBufferedFrag=function(t){return this.fragmentTracker.getBufferedFrag(t,u.PlaylistLevelType.MAIN)},E.followingBufferedFrag=function(t){return t?this.getBufferedFrag(t.end+.5):null},E.immediateLevelSwitch=function(){this.abortCurrentFrag(),this.flushMainBuffer(0,Number.POSITIVE_INFINITY)},E.nextLevelSwitch=function(){var t=this.levels,e=this.media;if(null!=e&&e.readyState){var r,n=this.getAppendedFrag(e.currentTime);if(n&&n.start>1&&this.flushMainBuffer(0,n.start-1),!e.paused&&t){var i=t[this.hls.nextLoadLevel],a=this.fragLastKbps;r=a&&this.fragCurrent?this.fragCurrent.duration*i.maxBitrate/(1e3*a)+1:0}else r=0;var o=this.getBufferedFrag(e.currentTime+r);if(o){var s=this.followingBufferedFrag(o);if(s){this.abortCurrentFrag();var l=s.maxStartPTS?s.maxStartPTS:s.start,u=s.duration,c=Math.max(o.end,l+Math.min(Math.max(u-this.config.maxFragLookUpTolerance,.5*u),.75*u));this.flushMainBuffer(c,Number.POSITIVE_INFINITY)}}}},E.abortCurrentFrag=function(){var t=this.fragCurrent;switch(this.fragCurrent=null,this.backtrackFragment=null,t&&t.abortRequests(),this.state){case i.State.KEY_LOADING:case i.State.FRAG_LOADING:case i.State.FRAG_LOADING_WAITING_RETRY:case i.State.PARSING:case i.State.PARSED:this.state=i.State.IDLE}this.nextLoadPosition=this.getLoadPosition()},E.flushMainBuffer=function(e,r){t.prototype.flushMainBuffer.call(this,e,r,this.altAudio?"video":null)},E.onMediaAttached=function(e,r){t.prototype.onMediaAttached.call(this,e,r);var n=r.media;this.onvplaying=this.onMediaPlaying.bind(this),this.onvseeked=this.onMediaSeeked.bind(this),n.addEventListener("playing",this.onvplaying),n.addEventListener("seeked",this.onvseeked),this.gapController=new f.default(this.config,n,this.fragmentTracker,this.hls)},E.onMediaDetaching=function(){var e=this.media;e&&this.onvplaying&&this.onvseeked&&(e.removeEventListener("playing",this.onvplaying),e.removeEventListener("seeked",this.onvseeked),this.onvplaying=this.onvseeked=null,this.videoBuffer=null),this.fragPlaying=null,this.gapController&&(this.gapController.destroy(),this.gapController=null),t.prototype.onMediaDetaching.call(this)},E.onMediaPlaying=function(){this.tick()},E.onMediaSeeked=function(){var t=this.media,e=t?t.currentTime:null;(0,n.isFiniteNumber)(e)&&this.log("Media seeked to "+e.toFixed(3)),this.tick()},E.onManifestLoading=function(){this.log("Trigger BUFFER_RESET"),this.hls.trigger(o.Events.BUFFER_RESET,void 0),this.fragmentTracker.removeAllFragments(),this.couldBacktrack=!1,this.startPosition=this.lastCurrentTime=0,this.fragPlaying=null,this.backtrackFragment=null},E.onManifestParsed=function(t,e){var r,n=!1,i=!1;e.levels.forEach((function(t){(r=t.audioCodec)&&(-1!==r.indexOf("mp4a.40.2")&&(n=!0),-1!==r.indexOf("mp4a.40.5")&&(i=!0))})),this.audioCodecSwitch=n&&i&&!(0,a.changeTypeSupported)(),this.audioCodecSwitch&&this.log("Both AAC/HE-AAC audio found in levels; declaring level codec as HE-AAC"),this.levels=e.levels,this.startFragRequested=!1},E.onLevelLoading=function(t,e){var r=this.levels;if(r&&this.state===i.State.IDLE){var n=r[e.level];(!n.details||n.details.live&&this.levelLastLoaded!==e.level||this.waitForCdnTuneIn(n.details))&&(this.state=i.State.WAITING_LEVEL)}},E.onLevelLoaded=function(t,e){var r,n=this.levels,a=e.level,s=e.details,l=s.totalduration;if(n){this.log("Level "+a+" loaded ["+s.startSN+","+s.endSN+"], cc ["+s.startCC+", "+s.endCC+"] duration:"+l);var u=this.fragCurrent;!u||this.state!==i.State.FRAG_LOADING&&this.state!==i.State.FRAG_LOADING_WAITING_RETRY||u.level!==e.level&&u.loader&&(this.state=i.State.IDLE,this.backtrackFragment=null,u.abortRequests());var c=n[a],d=0;if(s.live||null!==(r=c.details)&&void 0!==r&&r.live){if(s.fragments[0]||(s.deltaUpdateFailed=!0),s.deltaUpdateFailed)return;d=this.alignPlaylists(s,c.details)}if(c.details=s,this.levelLastLoaded=a,this.hls.trigger(o.Events.LEVEL_UPDATED,{details:s,level:a}),this.state===i.State.WAITING_LEVEL){if(this.waitForCdnTuneIn(s))return;this.state=i.State.IDLE}this.startFragRequested?s.live&&this.synchronizeToLiveEdge(s):this.setStartPosition(s,d),this.tick()}else this.warn("Levels were reset while loading level "+a)},E._handleFragmentLoadProgress=function(t){var e,r=t.frag,n=t.part,i=t.payload,a=this.levels;if(a){var o=a[r.level],s=o.details;if(s){var l=o.videoCodec,c=s.PTSKnown||!s.live,f=null===(e=r.initSegment)||void 0===e?void 0:e.data,p=this._getAudioCodec(o),g=this.transmuxer=this.transmuxer||new d.default(this.hls,u.PlaylistLevelType.MAIN,this._handleTransmuxComplete.bind(this),this._handleTransmuxerFlush.bind(this)),v=n?n.index:-1,m=-1!==v,y=new h.ChunkMetadata(r.level,r.sn,r.stats.chunkCount,i.byteLength,v,m),b=this.initPTS[r.cc];g.push(i,f,p,l,r,n,s.totalduration,c,y,b)}else this.warn("Dropping fragment "+r.sn+" of level "+r.level+" after level details were reset")}else this.warn("Levels were reset while fragment load was in progress. Fragment "+r.sn+" of level "+r.level+" will not be buffered")},E.onAudioTrackSwitching=function(t,e){var r=this.altAudio,n=!!e.url,i=e.id;if(!n){if(this.mediaBuffer!==this.media){this.log("Switching on main audio, use media.buffered to schedule main fragment loading"),this.mediaBuffer=this.media;var a=this.fragCurrent;a&&(this.log("Switching to main audio track, cancel main fragment load"),a.abortRequests()),this.resetTransmuxer(),this.resetLoadingState()}else this.audioOnly&&this.resetTransmuxer();var s=this.hls;r&&s.trigger(o.Events.BUFFER_FLUSHING,{startOffset:0,endOffset:Number.POSITIVE_INFINITY,type:"audio"}),s.trigger(o.Events.AUDIO_TRACK_SWITCHED,{id:i})}},E.onAudioTrackSwitched=function(t,e){var r=e.id,n=!!this.hls.audioTracks[r].url;if(n){var i=this.videoBuffer;i&&this.mediaBuffer!==i&&(this.log("Switching on alternate audio, use video.buffered to schedule main fragment loading"),this.mediaBuffer=i)}this.altAudio=n,this.tick()},E.onBufferCreated=function(t,e){var r,n,i=e.tracks,a=!1;for(var o in i){var s=i[o];if("main"===s.id){if(n=o,r=s,"video"===o){var l=i[o];l&&(this.videoBuffer=l.buffer)}}else a=!0}a&&r?(this.log("Alternate track found, use "+n+".buffered to schedule main fragment loading"),this.mediaBuffer=r.buffer):this.mediaBuffer=this.media},E.onFragBuffered=function(t,e){var r=e.frag,n=e.part;if(!r||r.type===u.PlaylistLevelType.MAIN){if(this.fragContextChanged(r))return this.warn("Fragment "+r.sn+(n?" p: "+n.index:"")+" of level "+r.level+" finished buffering, but was aborted. state: "+this.state),void(this.state===i.State.PARSED&&(this.state=i.State.IDLE));var a=n?n.stats:r.stats;this.fragLastKbps=Math.round(8*a.total/(a.buffering.end-a.loading.first)),"initSegment"!==r.sn&&(this.fragPrevious=r),this.fragBufferedComplete(r,n)}},E.onError=function(t,e){if(e.type!==p.ErrorTypes.KEY_SYSTEM_ERROR)switch(e.details){case p.ErrorDetails.FRAG_LOAD_ERROR:case p.ErrorDetails.FRAG_LOAD_TIMEOUT:case p.ErrorDetails.FRAG_PARSING_ERROR:case p.ErrorDetails.KEY_LOAD_ERROR:case p.ErrorDetails.KEY_LOAD_TIMEOUT:this.onFragmentOrKeyLoadError(u.PlaylistLevelType.MAIN,e);break;case p.ErrorDetails.LEVEL_LOAD_ERROR:case p.ErrorDetails.LEVEL_LOAD_TIMEOUT:this.state!==i.State.ERROR&&(e.fatal?(this.warn(""+e.details),this.state=i.State.ERROR):e.levelRetry||this.state!==i.State.WAITING_LEVEL||(this.state=i.State.IDLE));break;case p.ErrorDetails.BUFFER_FULL_ERROR:if("main"===e.parent&&(this.state===i.State.PARSING||this.state===i.State.PARSED)){var r=!0,n=this.getFwdBufferInfo(this.media,u.PlaylistLevelType.MAIN);n&&n.len>.5&&(r=!this.reduceMaxBufferLength(n.len)),r&&(this.warn("buffer full error also media.currentTime is not buffered, flush main"),this.immediateLevelSwitch()),this.resetLoadingState()}}else this.onFragmentOrKeyLoadError(u.PlaylistLevelType.MAIN,e)},E.checkBuffer=function(){var t=this.media,e=this.gapController;if(t&&e&&t.readyState){if(this.loadedmetadata||!s.BufferHelper.getBuffered(t).length){var r=this.state!==i.State.IDLE?this.fragCurrent:null;e.poll(this.lastCurrentTime,r)}this.lastCurrentTime=t.currentTime}},E.onFragLoadEmergencyAborted=function(){this.state=i.State.IDLE,this.loadedmetadata||(this.startFragRequested=!1,this.nextLoadPosition=this.startPosition),this.tickImmediate()},E.onBufferFlushed=function(t,e){var r=e.type;if(r!==c.ElementaryStreamTypes.AUDIO||this.audioOnly&&!this.altAudio){var n=(r===c.ElementaryStreamTypes.VIDEO?this.videoBuffer:this.mediaBuffer)||this.media;this.afterBufferFlushed(n,r,u.PlaylistLevelType.MAIN)}},E.onLevelsUpdated=function(t,e){this.levels=e.levels},E.swapAudioCodec=function(){this.audioCodecSwap=!this.audioCodecSwap},E.seekToStartPos=function(){var t=this.media;if(t){var e=t.currentTime,r=this.startPosition;if(r>=0&&e<r){if(t.seeking)return void this.log("could not seek to "+r+", already seeking at "+e);var n=s.BufferHelper.getBuffered(t),i=(n.length?n.start(0):0)-r;i>0&&(i<this.config.maxBufferHole||i<this.config.maxFragLookUpTolerance)&&(this.log("adjusting start position by "+i+" to match buffer start"),r+=i,this.startPosition=r),this.log("seek to target start position "+r+" from current time "+e),t.currentTime=r}}},E._getAudioCodec=function(t){var e=this.config.defaultAudioCodec||t.audioCodec;return this.audioCodecSwap&&e&&(this.log("Swapping audio codec"),e=-1!==e.indexOf("mp4a.40.5")?"mp4a.40.2":"mp4a.40.5"),e},E._loadBitrateTestFrag=function(t,e){var r=this;t.bitrateTest=!0,this._doFragLoad(t,e).then((function(e){var n=r.hls;if(e&&!n.nextLoadLevel&&!r.fragContextChanged(t)){r.fragLoadError=0,r.state=i.State.IDLE,r.startFragRequested=!1,r.bitrateTest=!1;var a=t.stats;a.parsing.start=a.parsing.end=a.buffering.start=a.buffering.end=self.performance.now(),n.trigger(o.Events.FRAG_LOADED,e),t.bitrateTest=!1}}))},E._handleTransmuxComplete=function(t){var e,r="main",a=this.hls,s=t.remuxResult,l=t.chunkMeta,u=this.getCurrentContext(l);if(!u)return this.warn("The loading context changed while buffering fragment "+l.sn+" of level "+l.level+". This chunk will not be buffered."),void this.resetStartWhenNotLoaded(l.level);var d=u.frag,h=u.part,f=u.level,p=s.video,g=s.text,v=s.id3,m=s.initSegment,y=f.details,b=this.altAudio?void 0:s.audio;if(!this.fragContextChanged(d)){if(this.state=i.State.PARSING,m){m.tracks&&(this._bufferInitSegment(f,m.tracks,d,l),a.trigger(o.Events.FRAG_PARSING_INIT_SEGMENT,{frag:d,id:r,tracks:m.tracks}));var E=m.initPTS,x=m.timescale;(0,n.isFiniteNumber)(E)&&(this.initPTS[d.cc]=E,a.trigger(o.Events.INIT_PTS_FOUND,{frag:d,id:r,initPTS:E,timescale:x}))}if(p&&!1!==s.independent){if(y){var S=p.startPTS,T=p.endPTS,w=p.startDTS,_=p.endDTS;if(h)h.elementaryStreams[p.type]={startPTS:S,endPTS:T,startDTS:w,endDTS:_};else if(p.firstKeyFrame&&p.independent&&1===l.id&&(this.couldBacktrack=!0),p.dropped&&p.independent){var A=this.getMainFwdBufferInfo();if((A?A.end:this.getLoadPosition())+this.config.maxBufferHole<(p.firstKeyFramePTS?p.firstKeyFramePTS:S)-this.config.maxBufferHole)return void this.backtrack(d);d.setElementaryStreamInfo(p.type,d.start,T,d.start,_,!0)}d.setElementaryStreamInfo(p.type,S,T,w,_),this.backtrackFragment&&(this.backtrackFragment=d),this.bufferFragmentData(p,d,h,l)}}else if(!1===s.independent)return void this.backtrack(d);if(b){var k=b.startPTS,C=b.endPTS,D=b.startDTS,L=b.endDTS;h&&(h.elementaryStreams[c.ElementaryStreamTypes.AUDIO]={startPTS:k,endPTS:C,startDTS:D,endDTS:L}),d.setElementaryStreamInfo(c.ElementaryStreamTypes.AUDIO,k,C,D,L),this.bufferFragmentData(b,d,h,l)}if(y&&null!=v&&null!==(e=v.samples)&&void 0!==e&&e.length){var R={id:r,frag:d,details:y,samples:v.samples};a.trigger(o.Events.FRAG_PARSING_METADATA,R)}if(y&&g){var I={id:r,frag:d,details:y,samples:g.samples};a.trigger(o.Events.FRAG_PARSING_USERDATA,I)}}},E._bufferInitSegment=function(t,e,r,n){var a=this;if(this.state===i.State.PARSING){this.audioOnly=!!e.audio&&!e.video,this.altAudio&&!this.audioOnly&&delete e.audio;var s=e.audio,l=e.video,u=e.audiovideo;if(s){var c=t.audioCodec,d=navigator.userAgent.toLowerCase();this.audioCodecSwitch&&(c&&(c=-1!==c.indexOf("mp4a.40.5")?"mp4a.40.2":"mp4a.40.5"),1!==s.metadata.channelCount&&-1===d.indexOf("firefox")&&(c="mp4a.40.5")),-1!==d.indexOf("android")&&"audio/mpeg"!==s.container&&(c="mp4a.40.2",this.log("Android: force audio codec to "+c)),t.audioCodec&&t.audioCodec!==c&&this.log('Swapping manifest audio codec "'+t.audioCodec+'" for "'+c+'"'),s.levelCodec=c,s.id="main",this.log("Init audio buffer, container:"+s.container+", codecs[selected/level/parsed]=["+(c||"")+"/"+(t.audioCodec||"")+"/"+s.codec+"]")}l&&(l.levelCodec=t.videoCodec,l.id="main",this.log("Init video buffer, container:"+l.container+", codecs[level/parsed]=["+(t.videoCodec||"")+"/"+l.codec+"]")),u&&this.log("Init audiovideo buffer, container:"+u.container+", codecs[level/parsed]=["+(t.attrs.CODECS||"")+"/"+u.codec+"]"),this.hls.trigger(o.Events.BUFFER_CODECS,e),Object.keys(e).forEach((function(t){var i=e[t].initSegment;null!=i&&i.byteLength&&a.hls.trigger(o.Events.BUFFER_APPENDING,{type:t,data:i,frag:r,part:null,chunkMeta:n,parent:r.type})})),this.tick()}},E.getMainFwdBufferInfo=function(){return this.getFwdBufferInfo(this.mediaBuffer?this.mediaBuffer:this.media,u.PlaylistLevelType.MAIN)},E.backtrack=function(t){this.couldBacktrack=!0,this.backtrackFragment=t,this.resetTransmuxer(),this.flushBufferGap(t),this.fragmentTracker.removeFragment(t),this.fragPrevious=null,this.nextLoadPosition=t.start,this.state=i.State.IDLE},E.checkFragmentChanged=function(){var t=this.media,e=null;if(t&&t.readyState>1&&!1===t.seeking){var r=t.currentTime;if(s.BufferHelper.isBuffered(t,r)?e=this.getAppendedFrag(r):s.BufferHelper.isBuffered(t,r+.1)&&(e=this.getAppendedFrag(r+.1)),e){this.backtrackFragment=null;var n=this.fragPlaying,i=e.level;n&&e.sn===n.sn&&n.level===i&&e.urlId===n.urlId||(this.fragPlaying=e,this.hls.trigger(o.Events.FRAG_CHANGED,{frag:e}),n&&n.level===i||this.hls.trigger(o.Events.LEVEL_SWITCHED,{level:i}))}}},y=m,(b=[{key:"nextLevel",get:function(){var t=this.nextBufferedFrag;return t?t.level:-1}},{key:"currentFrag",get:function(){var t=this.media;return t?this.fragPlaying||this.getAppendedFrag(t.currentTime):null}},{key:"currentProgramDateTime",get:function(){var t=this.media;if(t){var e=t.currentTime,r=this.currentFrag;if(r&&(0,n.isFiniteNumber)(e)&&(0,n.isFiniteNumber)(r.programDateTime)){var i=r.programDateTime+1e3*(e-r.start);return new Date(i)}}return null}},{key:"currentLevel",get:function(){var t=this.currentFrag;return t?t.level:-1}},{key:"nextBufferedFrag",get:function(){var t=this.currentFrag;return t?this.followingBufferedFrag(t):null}},{key:"forceStartLoad",get:function(){return this._forceStartLoad}}])&&g(y.prototype,b),Object.defineProperty(y,"prototype",{writable:!1}),m}(i.default)},"./src/controller/subtitle-stream-controller.ts":(t,e,r)=>{"use strict";r.r(e),r.d(e,{SubtitleStreamController:()=>g});var n=r("./src/events.ts"),a=r("./src/utils/buffer-helper.ts"),o=r("./src/controller/fragment-finders.ts"),s=r("./src/utils/discontinuities.ts"),l=r("./src/controller/level-helper.ts"),u=r("./src/controller/fragment-tracker.ts"),c=r("./src/controller/base-stream-controller.ts"),d=r("./src/types/loader.ts"),h=r("./src/types/level.ts");function f(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,(void 0,"symbol"==typeof(i=function(t,e){if("object"!=typeof t||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(n.key))?i:String(i)),n)}var i}function p(t,e){return p=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},p(t,e)}var g=function(t){var e,r;function g(e,r,n){var i;return(i=t.call(this,e,r,n,"[subtitle-stream-controller]")||this).levels=[],i.currentTrackId=-1,i.tracksBuffered=[],i.mainDetails=null,i._registerListeners(),i}r=t,(e=g).prototype=Object.create(r.prototype),e.prototype.constructor=e,p(e,r);var m,y,b=g.prototype;return b.onHandlerDestroying=function(){this._unregisterListeners(),this.mainDetails=null},b._registerListeners=function(){var t=this.hls;t.on(n.Events.MEDIA_ATTACHED,this.onMediaAttached,this),t.on(n.Events.MEDIA_DETACHING,this.onMediaDetaching,this),t.on(n.Events.MANIFEST_LOADING,this.onManifestLoading,this),t.on(n.Events.LEVEL_LOADED,this.onLevelLoaded,this),t.on(n.Events.ERROR,this.onError,this),t.on(n.Events.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),t.on(n.Events.SUBTITLE_TRACK_SWITCH,this.onSubtitleTrackSwitch,this),t.on(n.Events.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),t.on(n.Events.SUBTITLE_FRAG_PROCESSED,this.onSubtitleFragProcessed,this),t.on(n.Events.BUFFER_FLUSHING,this.onBufferFlushing,this),t.on(n.Events.FRAG_BUFFERED,this.onFragBuffered,this)},b._unregisterListeners=function(){var t=this.hls;t.off(n.Events.MEDIA_ATTACHED,this.onMediaAttached,this),t.off(n.Events.MEDIA_DETACHING,this.onMediaDetaching,this),t.off(n.Events.MANIFEST_LOADING,this.onManifestLoading,this),t.off(n.Events.LEVEL_LOADED,this.onLevelLoaded,this),t.off(n.Events.ERROR,this.onError,this),t.off(n.Events.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),t.off(n.Events.SUBTITLE_TRACK_SWITCH,this.onSubtitleTrackSwitch,this),t.off(n.Events.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),t.off(n.Events.SUBTITLE_FRAG_PROCESSED,this.onSubtitleFragProcessed,this),t.off(n.Events.BUFFER_FLUSHING,this.onBufferFlushing,this),t.off(n.Events.FRAG_BUFFERED,this.onFragBuffered,this)},b.startLoad=function(t){this.stopLoad(),this.state=c.State.IDLE,this.setInterval(500),this.nextLoadPosition=this.startPosition=this.lastCurrentTime=t,this.tick()},b.onManifestLoading=function(){this.mainDetails=null,this.fragmentTracker.removeAllFragments()},b.onLevelLoaded=function(t,e){this.mainDetails=e.details},b.onSubtitleFragProcessed=function(t,e){var r=e.frag,n=e.success;if(this.fragPrevious=r,this.state=c.State.IDLE,n){var i=this.tracksBuffered[this.currentTrackId];if(i){for(var a,o=r.start,s=0;s<i.length;s++)if(o>=i[s].start&&o<=i[s].end){a=i[s];break}var l=r.start+r.duration;a?a.end=l:(a={start:o,end:l},i.push(a)),this.fragmentTracker.fragBuffered(r)}}},b.onBufferFlushing=function(t,e){var r=e.startOffset,n=e.endOffset;if(0===r&&n!==Number.POSITIVE_INFINITY){var i=this.currentTrackId,a=this.levels;if(!a.length||!a[i]||!a[i].details)return;var o=n-a[i].details.targetduration;if(o<=0)return;e.endOffsetSubtitles=Math.max(0,o),this.tracksBuffered.forEach((function(t){for(var e=0;e<t.length;)if(t[e].end<=o)t.shift();else{if(!(t[e].start<o))break;t[e].start=o,e++}})),this.fragmentTracker.removeFragmentsInRange(r,o,d.PlaylistLevelType.SUBTITLE)}},b.onFragBuffered=function(t,e){var r;this.loadedmetadata||e.frag.type!==d.PlaylistLevelType.MAIN||null!==(r=this.media)&&void 0!==r&&r.buffered.length&&(this.loadedmetadata=!0)},b.onError=function(t,e){var r=e.frag;r&&r.type===d.PlaylistLevelType.SUBTITLE&&(this.fragCurrent&&this.fragCurrent.abortRequests(),this.state=c.State.IDLE)},b.onSubtitleTracksUpdated=function(t,e){var r=this,n=e.subtitleTracks;this.tracksBuffered=[],this.levels=n.map((function(t){return new h.Level(t)})),this.fragmentTracker.removeAllFragments(),this.fragPrevious=null,this.levels.forEach((function(t){r.tracksBuffered[t.id]=[]})),this.mediaBuffer=null},b.onSubtitleTrackSwitch=function(t,e){if(this.currentTrackId=e.id,this.levels.length&&-1!==this.currentTrackId){var r=this.levels[this.currentTrackId];null!=r&&r.details?this.mediaBuffer=this.mediaBufferTimeRanges:this.mediaBuffer=null,r&&this.setInterval(500)}else this.clearInterval()},b.onSubtitleTrackLoaded=function(t,e){var r,n=e.details,i=e.id,a=this.currentTrackId,u=this.levels;if(u.length){var d=u[a];if(!(i>=u.length||i!==a)&&d){this.mediaBuffer=this.mediaBufferTimeRanges;var h=0;if(n.live||null!==(r=d.details)&&void 0!==r&&r.live){var f=this.mainDetails;if(n.deltaUpdateFailed||!f)return;var p=f.fragments[0];d.details?0===(h=this.alignPlaylists(n,d.details))&&p&&(h=p.start,(0,l.addSliding)(n,h)):n.hasProgramDateTime&&f.hasProgramDateTime?((0,s.alignMediaPlaylistByPDT)(n,f),h=n.fragments[0].start):p&&(h=p.start,(0,l.addSliding)(n,h))}d.details=n,this.levelLastLoaded=i,this.startFragRequested||!this.mainDetails&&n.live||this.setStartPosition(d.details,h),this.tick(),n.live&&!this.fragCurrent&&this.media&&this.state===c.State.IDLE&&((0,o.findFragmentByPTS)(null,n.fragments,this.media.currentTime,0)||(this.warn("Subtitle playlist not aligned with playback"),d.details=void 0))}}},b._handleFragmentLoadComplete=function(t){var e=this,r=t.frag,i=t.payload,a=r.decryptdata,o=this.hls;if(!this.fragContextChanged(r)&&i&&i.byteLength>0&&a&&a.key&&a.iv&&"AES-128"===a.method){var s=performance.now();this.decrypter.decrypt(new Uint8Array(i),a.key.buffer,a.iv.buffer).then((function(t){var e=performance.now();o.trigger(n.Events.FRAG_DECRYPTED,{frag:r,payload:t,stats:{tstart:s,tdecrypt:e}})})).catch((function(t){e.warn(t.name+": "+t.message),e.state=c.State.IDLE}))}},b.doTick=function(){if(this.media){if(this.state===c.State.IDLE){var t=this.currentTrackId,e=this.levels;if(!e.length||!e[t]||!e[t].details)return;var r=e[t].details,n=r.targetduration,s=this.config,l=this.getLoadPosition(),h=a.BufferHelper.bufferedInfo(this.tracksBuffered[this.currentTrackId]||[],l-n,s.maxBufferHole),f=h.end,p=h.len,g=this.getFwdBufferInfo(this.media,d.PlaylistLevelType.MAIN);if(p>this.getMaxBufferLength(null==g?void 0:g.len)+n)return;i.assert(r,"Subtitle track details are defined on idle subtitle stream controller tick");var v=r.fragments,m=v.length,y=r.edge,b=null,E=this.fragPrevious;if(f<y){var x=s.maxFragLookUpTolerance;!(b=(0,o.findFragmentByPTS)(E,v,Math.max(v[0].start,f),x))&&E&&E.start<v[0].start&&(b=v[0])}else b=v[m-1];if(!b)return;b=this.mapToInitFragWhenRequired(b),this.fragmentTracker.getState(b)===u.FragmentState.NOT_LOADED&&this.loadFragment(b,r,f)}}else this.state=c.State.IDLE},b.getMaxBufferLength=function(e){var r=t.prototype.getMaxBufferLength.call(this);return e?Math.max(r,e):r},b.loadFragment=function(e,r,n){this.fragCurrent=e,"initSegment"===e.sn?this._loadInitSegment(e,r):(this.startFragRequested=!0,t.prototype.loadFragment.call(this,e,r,n))},m=g,(y=[{key:"mediaBufferTimeRanges",get:function(){return new v(this.tracksBuffered[this.currentTrackId]||[])}}])&&f(m.prototype,y),Object.defineProperty(m,"prototype",{writable:!1}),g}(c.default),v=function(t){this.buffered=void 0;var e=function(e,r,n){if((r>>>=0)>n-1)throw new DOMException("Failed to execute '"+e+"' on 'TimeRanges': The index provided ("+r+") is greater than the maximum bound ("+n+")");return t[r][e]};this.buffered={get length(){return t.length},end:function(r){return e("end",r,t.length)},start:function(r){return e("start",r,t.length)}}}},"./src/controller/subtitle-track-controller.ts":(t,e,r)=>{"use strict";r.r(e),r.d(e,{default:()=>c});var n=r("./src/events.ts"),i=r("./src/utils/texttrack-utils.ts"),a=r("./src/controller/base-playlist-controller.ts"),o=r("./src/types/loader.ts");function s(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,(void 0,"symbol"==typeof(i=function(t,e){if("object"!=typeof t||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(n.key))?i:String(i)),n)}var i}function l(t,e){return l=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},l(t,e)}function u(t){for(var e=[],r=0;r<t.length;r++){var n=t[r];"subtitles"===n.kind&&n.label&&e.push(t[r])}return e}const c=function(t){var e,r;function a(e){var r;return(r=t.call(this,e,"[subtitle-track-controller]")||this).media=null,r.tracks=[],r.groupId=null,r.tracksInGroup=[],r.trackId=-1,r.selectDefaultTrack=!0,r.queuedDefaultTrack=-1,r.trackChangeListener=function(){return r.onTextTracksChanged()},r.asyncPollTrackChange=function(){return r.pollTrackChange(0)},r.useTextTrackPolling=!1,r.subtitlePollingInterval=-1,r._subtitleDisplay=!0,r.registerListeners(),r}r=t,(e=a).prototype=Object.create(r.prototype),e.prototype.constructor=e,l(e,r);var c,d,h=a.prototype;return h.destroy=function(){this.unregisterListeners(),this.tracks.length=0,this.tracksInGroup.length=0,this.trackChangeListener=this.asyncPollTrackChange=null,t.prototype.destroy.call(this)},h.registerListeners=function(){var t=this.hls;t.on(n.Events.MEDIA_ATTACHED,this.onMediaAttached,this),t.on(n.Events.MEDIA_DETACHING,this.onMediaDetaching,this),t.on(n.Events.MANIFEST_LOADING,this.onManifestLoading,this),t.on(n.Events.MANIFEST_PARSED,this.onManifestParsed,this),t.on(n.Events.LEVEL_LOADING,this.onLevelLoading,this),t.on(n.Events.LEVEL_SWITCHING,this.onLevelSwitching,this),t.on(n.Events.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),t.on(n.Events.ERROR,this.onError,this)},h.unregisterListeners=function(){var t=this.hls;t.off(n.Events.MEDIA_ATTACHED,this.onMediaAttached,this),t.off(n.Events.MEDIA_DETACHING,this.onMediaDetaching,this),t.off(n.Events.MANIFEST_LOADING,this.onManifestLoading,this),t.off(n.Events.MANIFEST_PARSED,this.onManifestParsed,this),t.off(n.Events.LEVEL_LOADING,this.onLevelLoading,this),t.off(n.Events.LEVEL_SWITCHING,this.onLevelSwitching,this),t.off(n.Events.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),t.off(n.Events.ERROR,this.onError,this)},h.onMediaAttached=function(t,e){this.media=e.media,this.media&&(this.queuedDefaultTrack>-1&&(this.subtitleTrack=this.queuedDefaultTrack,this.queuedDefaultTrack=-1),this.useTextTrackPolling=!(this.media.textTracks&&"onchange"in this.media.textTracks),this.useTextTrackPolling?this.pollTrackChange(500):this.media.textTracks.addEventListener("change",this.asyncPollTrackChange))},h.pollTrackChange=function(t){self.clearInterval(this.subtitlePollingInterval),this.subtitlePollingInterval=self.setInterval(this.trackChangeListener,t)},h.onMediaDetaching=function(){this.media&&(self.clearInterval(this.subtitlePollingInterval),this.useTextTrackPolling||this.media.textTracks.removeEventListener("change",this.asyncPollTrackChange),this.trackId>-1&&(this.queuedDefaultTrack=this.trackId),u(this.media.textTracks).forEach((function(t){(0,i.clearCurrentCues)(t)})),this.subtitleTrack=-1,this.media=null)},h.onManifestLoading=function(){this.tracks=[],this.groupId=null,this.tracksInGroup=[],this.trackId=-1,this.selectDefaultTrack=!0},h.onManifestParsed=function(t,e){this.tracks=e.subtitleTracks},h.onSubtitleTrackLoaded=function(t,e){var r=e.id,n=e.details,i=this.trackId,a=this.tracksInGroup[i];if(a){var o=a.details;a.details=e.details,this.log("subtitle track "+r+" loaded ["+n.startSN+"-"+n.endSN+"]"),r===this.trackId&&(this.retryCount=0,this.playlistLoaded(r,e,o))}else this.warn("Invalid subtitle track id "+r)},h.onLevelLoading=function(t,e){this.switchLevel(e.level)},h.onLevelSwitching=function(t,e){this.switchLevel(e.level)},h.switchLevel=function(t){var e=this.hls.levels[t];if(null!=e&&e.textGroupIds){var r=e.textGroupIds[e.urlId];if(this.groupId!==r){var i=this.tracksInGroup?this.tracksInGroup[this.trackId]:void 0,a=this.tracks.filter((function(t){return!r||t.groupId===r}));this.tracksInGroup=a;var o=this.findTrackId(null==i?void 0:i.name)||this.findTrackId();this.groupId=r;var s={subtitleTracks:a};this.log("Updating subtitle tracks, "+a.length+' track(s) found in "'+r+'" group-id'),this.hls.trigger(n.Events.SUBTITLE_TRACKS_UPDATED,s),-1!==o&&this.setSubtitleTrack(o,i)}}},h.findTrackId=function(t){for(var e=this.tracksInGroup,r=0;r<e.length;r++){var n=e[r];if((!this.selectDefaultTrack||n.default)&&(!t||t===n.name))return n.id}return-1},h.onError=function(e,r){t.prototype.onError.call(this,e,r),!r.fatal&&r.context&&r.context.type===o.PlaylistContextType.SUBTITLE_TRACK&&r.context.id===this.trackId&&r.context.groupId===this.groupId&&this.retryLoadingOrFail(r)},h.loadPlaylist=function(e){t.prototype.loadPlaylist.call(this);var r=this.tracksInGroup[this.trackId];if(this.shouldLoadTrack(r)){var i=r.id,a=r.groupId,o=r.url;if(e)try{o=e.addDirectives(o)}catch(t){this.warn("Could not construct new URL with HLS Delivery Directives: "+t)}this.log("Loading subtitle playlist for id "+i),this.hls.trigger(n.Events.SUBTITLE_TRACK_LOADING,{url:o,id:i,groupId:a,deliveryDirectives:e||null})}},h.toggleTrackModes=function(t){var e=this,r=this.media,n=this.trackId;if(r){var i=u(r.textTracks),a=i.filter((function(t){return t.groupId===e.groupId}));if(-1===t)[].slice.call(i).forEach((function(t){t.mode="disabled"}));else{var o=a[n];o&&(o.mode="disabled")}var s=a[t];s&&(s.mode=this.subtitleDisplay?"showing":"hidden")}},h.setSubtitleTrack=function(t,e){var r,i=this.tracksInGroup;if(this.media){if(this.trackId!==t&&this.toggleTrackModes(t),!(this.trackId===t&&(-1===t||null!==(r=i[t])&&void 0!==r&&r.details)||t<-1||t>=i.length)){this.clearTimer();var a=i[t];if(this.log("Switching to subtitle track "+t),this.trackId=t,a){var o=a.id,s=a.groupId,l=void 0===s?"":s,u=a.name,c=a.type,d=a.url;this.hls.trigger(n.Events.SUBTITLE_TRACK_SWITCH,{id:o,groupId:l,name:u,type:c,url:d});var h=this.switchParams(a.url,null==e?void 0:e.details);this.loadPlaylist(h)}else this.hls.trigger(n.Events.SUBTITLE_TRACK_SWITCH,{id:t})}}else this.queuedDefaultTrack=t},h.onTextTracksChanged=function(){if(this.useTextTrackPolling||self.clearInterval(this.subtitlePollingInterval),this.media&&this.hls.config.renderTextTracksNatively){for(var t=-1,e=u(this.media.textTracks),r=0;r<e.length;r++)if("hidden"===e[r].mode)t=r;else if("showing"===e[r].mode){t=r;break}this.subtitleTrack!==t&&(this.subtitleTrack=t)}},c=a,(d=[{key:"subtitleDisplay",get:function(){return this._subtitleDisplay},set:function(t){this._subtitleDisplay=t,this.trackId>-1&&this.toggleTrackModes(this.trackId)}},{key:"subtitleTracks",get:function(){return this.tracksInGroup}},{key:"subtitleTrack",get:function(){return this.trackId},set:function(t){this.selectDefaultTrack=!1;var e=this.tracksInGroup?this.tracksInGroup[this.trackId]:void 0;this.setSubtitleTrack(t,e)}}])&&s(c.prototype,d),Object.defineProperty(c,"prototype",{writable:!1}),a}(a.default)},"./src/controller/timeline-controller.ts":(t,e,r)=>{"use strict";r.r(e),r.d(e,{TimelineController:()=>f});var n=r("./src/polyfills/number.ts"),i=r("./src/events.ts"),a=r("./src/utils/cea-608-parser.ts"),o=r("./src/utils/output-filter.ts"),s=r("./src/utils/webvtt-parser.ts"),l=r("./src/utils/texttrack-utils.ts"),u=r("./src/utils/imsc1-ttml-parser.ts"),c=r("./src/utils/mp4-tools.ts"),d=r("./src/types/loader.ts"),h=r("./src/utils/logger.ts"),f=function(){function t(t){if(this.hls=void 0,this.media=null,this.config=void 0,this.enabled=!0,this.Cues=void 0,this.textTracks=[],this.tracks=[],this.initPTS=[],this.timescale=[],this.unparsedVttFrags=[],this.captionsTracks={},this.nonNativeCaptionsTracks={},this.cea608Parser1=void 0,this.cea608Parser2=void 0,this.lastSn=-1,this.lastPartIndex=-1,this.prevCC=-1,this.vttCCs={ccOffset:0,presentationOffset:0,0:{start:0,prevCC:-1,new:!0}},this.captionsProperties=void 0,this.hls=t,this.config=t.config,this.Cues=t.config.cueHandler,this.captionsProperties={textTrack1:{label:this.config.captionsTextTrack1Label,languageCode:this.config.captionsTextTrack1LanguageCode},textTrack2:{label:this.config.captionsTextTrack2Label,languageCode:this.config.captionsTextTrack2LanguageCode},textTrack3:{label:this.config.captionsTextTrack3Label,languageCode:this.config.captionsTextTrack3LanguageCode},textTrack4:{label:this.config.captionsTextTrack4Label,languageCode:this.config.captionsTextTrack4LanguageCode}},this.config.enableCEA708Captions){var e=new o.default(this,"textTrack1"),r=new o.default(this,"textTrack2"),n=new o.default(this,"textTrack3"),s=new o.default(this,"textTrack4");this.cea608Parser1=new a.default(1,e,r),this.cea608Parser2=new a.default(3,n,s)}t.on(i.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),t.on(i.Events.MEDIA_DETACHING,this.onMediaDetaching,this),t.on(i.Events.MANIFEST_LOADING,this.onManifestLoading,this),t.on(i.Events.MANIFEST_LOADED,this.onManifestLoaded,this),t.on(i.Events.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),t.on(i.Events.FRAG_LOADING,this.onFragLoading,this),t.on(i.Events.FRAG_LOADED,this.onFragLoaded,this),t.on(i.Events.FRAG_PARSING_USERDATA,this.onFragParsingUserdata,this),t.on(i.Events.FRAG_DECRYPTED,this.onFragDecrypted,this),t.on(i.Events.INIT_PTS_FOUND,this.onInitPtsFound,this),t.on(i.Events.SUBTITLE_TRACKS_CLEARED,this.onSubtitleTracksCleared,this),t.on(i.Events.BUFFER_FLUSHING,this.onBufferFlushing,this)}var e=t.prototype;return e.destroy=function(){var t=this.hls;t.off(i.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),t.off(i.Events.MEDIA_DETACHING,this.onMediaDetaching,this),t.off(i.Events.MANIFEST_LOADING,this.onManifestLoading,this),t.off(i.Events.MANIFEST_LOADED,this.onManifestLoaded,this),t.off(i.Events.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),t.off(i.Events.FRAG_LOADING,this.onFragLoading,this),t.off(i.Events.FRAG_LOADED,this.onFragLoaded,this),t.off(i.Events.FRAG_PARSING_USERDATA,this.onFragParsingUserdata,this),t.off(i.Events.FRAG_DECRYPTED,this.onFragDecrypted,this),t.off(i.Events.INIT_PTS_FOUND,this.onInitPtsFound,this),t.off(i.Events.SUBTITLE_TRACKS_CLEARED,this.onSubtitleTracksCleared,this),t.off(i.Events.BUFFER_FLUSHING,this.onBufferFlushing,this),this.hls=this.config=this.cea608Parser1=this.cea608Parser2=null},e.addCues=function(t,e,r,n,a){for(var o,s,l,u,c=!1,d=a.length;d--;){var h=a[d],f=(o=h[0],s=h[1],l=e,u=r,Math.min(s,u)-Math.max(o,l));if(f>=0&&(h[0]=Math.min(h[0],e),h[1]=Math.max(h[1],r),c=!0,f/(r-e)>.5))return}if(c||a.push([e,r]),this.config.renderTextTracksNatively){var p=this.captionsTracks[t];this.Cues.newCue(p,e,r,n)}else{var g=this.Cues.newCue(null,e,r,n);this.hls.trigger(i.Events.CUES_PARSED,{type:"captions",cues:g,track:t})}},e.onInitPtsFound=function(t,e){var r=this,n=e.frag,a=e.id,o=e.initPTS,s=e.timescale,l=this.unparsedVttFrags;"main"===a&&(this.initPTS[n.cc]=o,this.timescale[n.cc]=s),l.length&&(this.unparsedVttFrags=[],l.forEach((function(t){r.onFragLoaded(i.Events.FRAG_LOADED,t)})))},e.getExistingTrack=function(t){var e=this.media;if(e)for(var r=0;r<e.textTracks.length;r++){var n=e.textTracks[r];if(n[t])return n}return null},e.createCaptionsTrack=function(t){this.config.renderTextTracksNatively?this.createNativeTrack(t):this.createNonNativeTrack(t)},e.createNativeTrack=function(t){if(!this.captionsTracks[t]){var e=this.captionsProperties,r=this.captionsTracks,n=this.media,i=e[t],a=i.label,o=i.languageCode,s=this.getExistingTrack(t);if(s)r[t]=s,(0,l.clearCurrentCues)(r[t]),(0,l.sendAddTrackEvent)(r[t],n);else{var u=this.createTextTrack("captions",a,o);u&&(u[t]=!0,r[t]=u)}}},e.createNonNativeTrack=function(t){if(!this.nonNativeCaptionsTracks[t]){var e=this.captionsProperties[t];if(e){var r={_id:t,label:e.label,kind:"captions",default:!!e.media&&!!e.media.default,closedCaptions:e.media};this.nonNativeCaptionsTracks[t]=r,this.hls.trigger(i.Events.NON_NATIVE_TEXT_TRACKS_FOUND,{tracks:[r]})}}},e.createTextTrack=function(t,e,r){var n=this.media;if(n)return n.addTextTrack(t,e,r)},e.onMediaAttaching=function(t,e){this.media=e.media,this._cleanTracks()},e.onMediaDetaching=function(){var t=this.captionsTracks;Object.keys(t).forEach((function(e){(0,l.clearCurrentCues)(t[e]),delete t[e]})),this.nonNativeCaptionsTracks={}},e.onManifestLoading=function(){this.lastSn=-1,this.lastPartIndex=-1,this.prevCC=-1,this.vttCCs={ccOffset:0,presentationOffset:0,0:{start:0,prevCC:-1,new:!0}},this._cleanTracks(),this.tracks=[],this.captionsTracks={},this.nonNativeCaptionsTracks={},this.textTracks=[],this.unparsedVttFrags=this.unparsedVttFrags||[],this.initPTS=[],this.timescale=[],this.cea608Parser1&&this.cea608Parser2&&(this.cea608Parser1.reset(),this.cea608Parser2.reset())},e._cleanTracks=function(){var t=this.media;if(t){var e=t.textTracks;if(e)for(var r=0;r<e.length;r++)(0,l.clearCurrentCues)(e[r])}},e.onSubtitleTracksUpdated=function(t,e){var r=this;this.textTracks=[];var n=e.subtitleTracks||[],a=n.some((function(t){return t.textCodec===u.IMSC1_CODEC}));if(this.config.enableWebVTT||a&&this.config.enableIMSC1){var o=this.tracks&&n&&this.tracks.length===n.length;if(this.tracks=n||[],this.config.renderTextTracksNatively){var s=this.media?this.media.textTracks:[];this.tracks.forEach((function(t,e){var n;if(e<s.length){for(var i=null,a=0;a<s.length;a++)if(p(s[a],t)){i=s[a];break}i&&(n=i)}if(n)(0,l.clearCurrentCues)(n);else{var o=r._captionsOrSubtitlesFromCharacteristics(t);(n=r.createTextTrack(o,t.name,t.lang))&&(n.mode="disabled")}n&&(n.groupId=t.groupId,r.textTracks.push(n))}))}else if(!o&&this.tracks&&this.tracks.length){var c=this.tracks.map((function(t){return{label:t.name,kind:t.type.toLowerCase(),default:t.default,subtitleTrack:t}}));this.hls.trigger(i.Events.NON_NATIVE_TEXT_TRACKS_FOUND,{tracks:c})}}},e._captionsOrSubtitlesFromCharacteristics=function(t){var e;if(null!==(e=t.attrs)&&void 0!==e&&e.CHARACTERISTICS){var r=/transcribes-spoken-dialog/gi.test(t.attrs.CHARACTERISTICS),n=/describes-music-and-sound/gi.test(t.attrs.CHARACTERISTICS);if(r&&n)return"captions"}return"subtitles"},e.onManifestLoaded=function(t,e){var r=this;this.config.enableCEA708Captions&&e.captions&&e.captions.forEach((function(t){var e=/(?:CC|SERVICE)([1-4])/.exec(t.instreamId);if(e){var n="textTrack"+e[1],i=r.captionsProperties[n];i&&(i.label=t.name,t.lang&&(i.languageCode=t.lang),i.media=t)}}))},e.closedCaptionsForLevel=function(t){var e=this.hls.levels[t.level];return null==e?void 0:e.attrs["CLOSED-CAPTIONS"]},e.onFragLoading=function(t,e){var r=this.cea608Parser1,n=this.cea608Parser2,i=this.lastSn,a=this.lastPartIndex;if(this.enabled&&r&&n&&e.frag.type===d.PlaylistLevelType.MAIN){var o,s,l=e.frag.sn,u=null!=(o=null==e||null===(s=e.part)||void 0===s?void 0:s.index)?o:-1;l===i+1||l===i&&u===a+1||(r.reset(),n.reset()),this.lastSn=l,this.lastPartIndex=u}},e.onFragLoaded=function(t,e){var r=e.frag,a=e.payload,o=this.initPTS,s=this.unparsedVttFrags;if(r.type===d.PlaylistLevelType.SUBTITLE)if(a.byteLength){if(!(0,n.isFiniteNumber)(o[r.cc]))return s.push(e),void(o.length&&this.hls.trigger(i.Events.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:r,error:new Error("Missing initial subtitle PTS")}));var l=r.decryptdata,c="stats"in e;if(null==l||!l.encrypted||c){var h=this.tracks[r.level],f=this.vttCCs;f[r.cc]||(f[r.cc]={start:r.start,prevCC:this.prevCC,new:!0},this.prevCC=r.cc),h&&h.textCodec===u.IMSC1_CODEC?this._parseIMSC1(r,a):this._parseVTTs(r,a,f)}}else this.hls.trigger(i.Events.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:r,error:new Error("Empty subtitle payload")})},e._parseIMSC1=function(t,e){var r=this,n=this.hls;(0,u.parseIMSC1)(e,this.initPTS[t.cc],this.timescale[t.cc],(function(e){r._appendCues(e,t.level),n.trigger(i.Events.SUBTITLE_FRAG_PROCESSED,{success:!0,frag:t})}),(function(e){h.logger.log("Failed to parse IMSC1: "+e),n.trigger(i.Events.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:t,error:e})}))},e._parseVTTs=function(t,e,r){var n,a=this,o=this.hls,l=null!==(n=t.initSegment)&&void 0!==n&&n.data?(0,c.appendUint8Array)(t.initSegment.data,new Uint8Array(e)):e;(0,s.parseWebVTT)(l,this.initPTS[t.cc],this.timescale[t.cc],r,t.cc,t.start,(function(e){a._appendCues(e,t.level),o.trigger(i.Events.SUBTITLE_FRAG_PROCESSED,{success:!0,frag:t})}),(function(r){a._fallbackToIMSC1(t,e),h.logger.log("Failed to parse VTT cue: "+r),o.trigger(i.Events.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:t,error:r})}))},e._fallbackToIMSC1=function(t,e){var r=this,n=this.tracks[t.level];n.textCodec||(0,u.parseIMSC1)(e,this.initPTS[t.cc],this.timescale[t.cc],(function(){n.textCodec=u.IMSC1_CODEC,r._parseIMSC1(t,e)}),(function(){n.textCodec="wvtt"}))},e._appendCues=function(t,e){var r=this.hls;if(this.config.renderTextTracksNatively){var n=this.textTracks[e];if(!n||"disabled"===n.mode)return;t.forEach((function(t){return(0,l.addCueToTrack)(n,t)}))}else{var a=this.tracks[e];if(!a)return;var o=a.default?"default":"subtitles"+e;r.trigger(i.Events.CUES_PARSED,{type:"subtitles",cues:t,track:o})}},e.onFragDecrypted=function(t,e){var r=e.frag;if(r.type===d.PlaylistLevelType.SUBTITLE){if(!(0,n.isFiniteNumber)(this.initPTS[r.cc]))return void this.unparsedVttFrags.push(e);this.onFragLoaded(i.Events.FRAG_LOADED,e)}},e.onSubtitleTracksCleared=function(){this.tracks=[],this.captionsTracks={}},e.onFragParsingUserdata=function(t,e){var r=this.cea608Parser1,n=this.cea608Parser2;if(this.enabled&&r&&n){var i=e.frag,a=e.samples;if(i.type!==d.PlaylistLevelType.MAIN||"NONE"!==this.closedCaptionsForLevel(i))for(var o=0;o<a.length;o++){var s=a[o].bytes;if(s){var l=this.extractCea608Data(s);r.addData(a[o].pts,l[0]),n.addData(a[o].pts,l[1])}}}},e.onBufferFlushing=function(t,e){var r=e.startOffset,n=e.endOffset,i=e.endOffsetSubtitles,a=e.type,o=this.media;if(o&&!(o.currentTime<n)){if(!a||"video"===a){var s=this.captionsTracks;Object.keys(s).forEach((function(t){return(0,l.removeCuesInRange)(s[t],r,n)}))}if(this.config.renderTextTracksNatively&&0===r&&void 0!==i){var u=this.textTracks;Object.keys(u).forEach((function(t){return(0,l.removeCuesInRange)(u[t],r,i)}))}}},e.extractCea608Data=function(t){for(var e=[[],[]],r=31&t[0],n=2,i=0;i<r;i++){var a=t[n++],o=127&t[n++],s=127&t[n++];if((0!==o||0!==s)&&0!=(4&a)){var l=3&a;0!==l&&1!==l||(e[l].push(o),e[l].push(s))}}return e},t}();function p(t,e){return t&&t.label===e.name&&!(t.textTrack1||t.textTrack2)}},"./src/crypt/aes-crypto.ts":(t,e,r)=>{"use strict";r.r(e),r.d(e,{default:()=>n});var n=function(){function t(t,e){this.subtle=void 0,this.aesIV=void 0,this.subtle=t,this.aesIV=e}return t.prototype.decrypt=function(t,e){return this.subtle.decrypt({name:"AES-CBC",iv:this.aesIV},e,t)},t}()},"./src/crypt/aes-decryptor.ts":(t,e,r)=>{"use strict";r.r(e),r.d(e,{default:()=>a,removePadding:()=>i});var n=r("./src/utils/typed-array.ts");function i(t){var e=t.byteLength,r=e&&new DataView(t.buffer).getUint8(e-1);return r?(0,n.sliceUint8)(t,0,e-r):t}var a=function(){function t(){this.rcon=[0,1,2,4,8,16,32,64,128,27,54],this.subMix=[new Uint32Array(256),new Uint32Array(256),new Uint32Array(256),new Uint32Array(256)],this.invSubMix=[new Uint32Array(256),new Uint32Array(256),new Uint32Array(256),new Uint32Array(256)],this.sBox=new Uint32Array(256),this.invSBox=new Uint32Array(256),this.key=new Uint32Array(0),this.ksRows=0,this.keySize=0,this.keySchedule=void 0,this.invKeySchedule=void 0,this.initTable()}var e=t.prototype;return e.uint8ArrayToUint32Array_=function(t){for(var e=new DataView(t),r=new Uint32Array(4),n=0;n<4;n++)r[n]=e.getUint32(4*n);return r},e.initTable=function(){var t=this.sBox,e=this.invSBox,r=this.subMix,n=r[0],i=r[1],a=r[2],o=r[3],s=this.invSubMix,l=s[0],u=s[1],c=s[2],d=s[3],h=new Uint32Array(256),f=0,p=0,g=0;for(g=0;g<256;g++)h[g]=g<128?g<<1:g<<1^283;for(g=0;g<256;g++){var v=p^p<<1^p<<2^p<<3^p<<4;v=v>>>8^255&v^99,t[f]=v,e[v]=f;var m=h[f],y=h[m],b=h[y],E=257*h[v]^16843008*v;n[f]=E<<24|E>>>8,i[f]=E<<16|E>>>16,a[f]=E<<8|E>>>24,o[f]=E,E=16843009*b^65537*y^257*m^16843008*f,l[v]=E<<24|E>>>8,u[v]=E<<16|E>>>16,c[v]=E<<8|E>>>24,d[v]=E,f?(f=m^h[h[h[b^m]]],p^=h[h[p]]):f=p=1}},e.expandKey=function(t){for(var e=this.uint8ArrayToUint32Array_(t),r=!0,n=0;n<e.length&&r;)r=e[n]===this.key[n],n++;if(!r){this.key=e;var i=this.keySize=e.length;if(4!==i&&6!==i&&8!==i)throw new Error("Invalid aes key size="+i);var a,o,s,l,u=this.ksRows=4*(i+6+1),c=this.keySchedule=new Uint32Array(u),d=this.invKeySchedule=new Uint32Array(u),h=this.sBox,f=this.rcon,p=this.invSubMix,g=p[0],v=p[1],m=p[2],y=p[3];for(a=0;a<u;a++)a<i?s=c[a]=e[a]:(l=s,a%i==0?(l=h[(l=l<<8|l>>>24)>>>24]<<24|h[l>>>16&255]<<16|h[l>>>8&255]<<8|h[255&l],l^=f[a/i|0]<<24):i>6&&a%i==4&&(l=h[l>>>24]<<24|h[l>>>16&255]<<16|h[l>>>8&255]<<8|h[255&l]),c[a]=s=(c[a-i]^l)>>>0);for(o=0;o<u;o++)a=u-o,l=3&o?c[a]:c[a-4],d[o]=o<4||a<=4?l:g[h[l>>>24]]^v[h[l>>>16&255]]^m[h[l>>>8&255]]^y[h[255&l]],d[o]=d[o]>>>0}},e.networkToHostOrderSwap=function(t){return t<<24|(65280&t)<<8|(16711680&t)>>8|t>>>24},e.decrypt=function(t,e,r){for(var n,i,a,o,s,l,u,c,d,h,f,p,g,v,m=this.keySize+6,y=this.invKeySchedule,b=this.invSBox,E=this.invSubMix,x=E[0],S=E[1],T=E[2],w=E[3],_=this.uint8ArrayToUint32Array_(r),A=_[0],k=_[1],C=_[2],D=_[3],L=new Int32Array(t),R=new Int32Array(L.length),I=this.networkToHostOrderSwap;e<L.length;){for(d=I(L[e]),h=I(L[e+1]),f=I(L[e+2]),p=I(L[e+3]),s=d^y[0],l=p^y[1],u=f^y[2],c=h^y[3],g=4,v=1;v<m;v++)n=x[s>>>24]^S[l>>16&255]^T[u>>8&255]^w[255&c]^y[g],i=x[l>>>24]^S[u>>16&255]^T[c>>8&255]^w[255&s]^y[g+1],a=x[u>>>24]^S[c>>16&255]^T[s>>8&255]^w[255&l]^y[g+2],o=x[c>>>24]^S[s>>16&255]^T[l>>8&255]^w[255&u]^y[g+3],s=n,l=i,u=a,c=o,g+=4;n=b[s>>>24]<<24^b[l>>16&255]<<16^b[u>>8&255]<<8^b[255&c]^y[g],i=b[l>>>24]<<24^b[u>>16&255]<<16^b[c>>8&255]<<8^b[255&s]^y[g+1],a=b[u>>>24]<<24^b[c>>16&255]<<16^b[s>>8&255]<<8^b[255&l]^y[g+2],o=b[c>>>24]<<24^b[s>>16&255]<<16^b[l>>8&255]<<8^b[255&u]^y[g+3],R[e]=I(n^A),R[e+1]=I(o^k),R[e+2]=I(a^C),R[e+3]=I(i^D),A=d,k=h,C=f,D=p,e+=4}return R.buffer},t}()},"./src/crypt/decrypter.ts":(t,e,r)=>{"use strict";r.r(e),r.d(e,{default:()=>u});var n=r("./src/crypt/aes-crypto.ts"),i=r("./src/crypt/fast-aes-key.ts"),a=r("./src/crypt/aes-decryptor.ts"),o=r("./src/utils/logger.ts"),s=r("./src/utils/mp4-tools.ts"),l=r("./src/utils/typed-array.ts"),u=function(){function t(t,e){var r=(void 0===e?{}:e).removePKCS7Padding,n=void 0===r||r;if(this.logEnabled=!0,this.removePKCS7Padding=void 0,this.subtle=null,this.softwareDecrypter=null,this.key=null,this.fastAesKey=null,this.remainderData=null,this.currentIV=null,this.currentResult=null,this.useSoftware=void 0,this.useSoftware=t.enableSoftwareAES,this.removePKCS7Padding=n,n)try{var i=self.crypto;i&&(this.subtle=i.subtle||i.webkitSubtle)}catch(t){}null===this.subtle&&(this.useSoftware=!0)}var e=t.prototype;return e.destroy=function(){this.subtle=null,this.softwareDecrypter=null,this.key=null,this.fastAesKey=null,this.remainderData=null,this.currentIV=null,this.currentResult=null},e.isSync=function(){return this.useSoftware},e.flush=function(){var t=this.currentResult,e=this.remainderData;if(!t||e)return o.logger.error("[softwareDecrypt] "+(e?"overflow bytes: "+e.byteLength:"no result")),this.reset(),null;var r=new Uint8Array(t);return this.reset(),this.removePKCS7Padding?(0,a.removePadding)(r):r},e.reset=function(){this.currentResult=null,this.currentIV=null,this.remainderData=null,this.softwareDecrypter&&(this.softwareDecrypter=null)},e.decrypt=function(t,e,r){var n=this;return this.useSoftware?new Promise((function(i,a){n.softwareDecrypt(new Uint8Array(t),e,r);var o=n.flush();o?i(o.buffer):a(new Error("[softwareDecrypt] Failed to decrypt data"))})):this.webCryptoDecrypt(new Uint8Array(t),e,r)},e.softwareDecrypt=function(t,e,r){var n=this.currentIV,i=this.currentResult,o=this.remainderData;this.logOnce("JS AES decrypt"),o&&(t=(0,s.appendUint8Array)(o,t),this.remainderData=null);var u=this.getValidChunk(t);if(!u.length)return null;n&&(r=n);var c=this.softwareDecrypter;c||(c=this.softwareDecrypter=new a.default),c.expandKey(e);var d=i;return this.currentResult=c.decrypt(u.buffer,0,r),this.currentIV=(0,l.sliceUint8)(u,-16).buffer,d||null},e.webCryptoDecrypt=function(t,e,r){var a=this,s=this.subtle;return this.key===e&&this.fastAesKey||(this.key=e,this.fastAesKey=new i.default(s,e)),this.fastAesKey.expandKey().then((function(e){return s?(a.logOnce("WebCrypto AES decrypt"),new n.default(s,new Uint8Array(r)).decrypt(t.buffer,e)):Promise.reject(new Error("web crypto not initialized"))})).catch((function(n){return o.logger.warn("[decrypter]: WebCrypto Error, disable WebCrypto API, "+n.name+": "+n.message),a.onWebCryptoError(t,e,r)}))},e.onWebCryptoError=function(t,e,r){this.useSoftware=!0,this.logEnabled=!0,this.softwareDecrypt(t,e,r);var n=this.flush();if(n)return n.buffer;throw new Error("WebCrypto and softwareDecrypt: failed to decrypt data")},e.getValidChunk=function(t){var e=t,r=t.length-t.length%16;return r!==t.length&&(e=(0,l.sliceUint8)(t,0,r),this.remainderData=(0,l.sliceUint8)(t,r)),e},e.logOnce=function(t){this.logEnabled&&(o.logger.log("[decrypter]: "+t),this.logEnabled=!1)},t}()},"./src/crypt/fast-aes-key.ts":(t,e,r)=>{"use strict";r.r(e),r.d(e,{default:()=>n});var n=function(){function t(t,e){this.subtle=void 0,this.key=void 0,this.subtle=t,this.key=e}return t.prototype.expandKey=function(){return this.subtle.importKey("raw",this.key,{name:"AES-CBC"},!1,["encrypt","decrypt"])},t}()},"./src/demux/aacdemuxer.ts":(t,e,r)=>{"use strict";r.r(e),r.d(e,{default:()=>l});var n=r("./src/demux/base-audio-demuxer.ts"),i=r("./src/demux/adts.ts"),a=r("./src/utils/logger.ts"),o=r("./src/demux/id3.ts");function s(t,e){return s=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},s(t,e)}const l=function(t){var e,r;function n(e,r){var n;return(n=t.call(this)||this).observer=void 0,n.config=void 0,n.observer=e,n.config=r,n}r=t,(e=n).prototype=Object.create(r.prototype),e.prototype.constructor=e,s(e,r);var l=n.prototype;return l.resetInitSegment=function(e,r,n,i){t.prototype.resetInitSegment.call(this,e,r,n,i),this._audioTrack={container:"audio/adts",type:"audio",id:2,pid:-1,sequenceNumber:0,segmentCodec:"aac",samples:[],manifestCodec:r,duration:i,inputTimeScale:9e4,dropped:0}},n.probe=function(t){if(!t)return!1;for(var e=(o.getID3Data(t,0)||[]).length,r=t.length;e<r;e++)if(i.probe(t,e))return a.logger.log("ADTS sync word found !"),!0;return!1},l.canParse=function(t,e){return i.canParse(t,e)},l.appendFrame=function(t,e,r){i.initTrackConfig(t,this.observer,e,r,t.manifestCodec);var n=i.appendFrame(t,e,r,this.basePTS,this.frameIndex);if(n&&0===n.missing)return n},n}(n.default)},"./src/demux/adts.ts":(t,e,r)=>{"use strict";r.r(e),r.d(e,{appendFrame:()=>m,canGetFrameLength:()=>c,canParse:()=>h,getAudioConfig:()=>o,getFrameDuration:()=>g,getFullFrameLength:()=>u,getHeaderLength:()=>l,initTrackConfig:()=>p,isHeader:()=>d,isHeaderPattern:()=>s,parseFrameHeader:()=>v,probe:()=>f});var n=r("./src/utils/logger.ts"),i=r("./src/errors.ts"),a=r("./src/events.ts");function o(t,e,r,o){var s,l,u,c,d=navigator.userAgent.toLowerCase(),h=o,f=[96e3,88200,64e3,48e3,44100,32e3,24e3,22050,16e3,12e3,11025,8e3,7350];s=1+((192&e[r+2])>>>6);var p=(60&e[r+2])>>>2;if(!(p>f.length-1))return u=(1&e[r+2])<<2,u|=(192&e[r+3])>>>6,n.logger.log("manifest codec:"+o+", ADTS type:"+s+", samplingIndex:"+p),/firefox/i.test(d)?p>=6?(s=5,c=new Array(4),l=p-3):(s=2,c=new Array(2),l=p):-1!==d.indexOf("android")?(s=2,c=new Array(2),l=p):(s=5,c=new Array(4),o&&(-1!==o.indexOf("mp4a.40.29")||-1!==o.indexOf("mp4a.40.5"))||!o&&p>=6?l=p-3:((o&&-1!==o.indexOf("mp4a.40.2")&&(p>=6&&1===u||/vivaldi/i.test(d))||!o&&1===u)&&(s=2,c=new Array(2)),l=p)),c[0]=s<<3,c[0]|=(14&p)>>1,c[1]|=(1&p)<<7,c[1]|=u<<3,5===s&&(c[1]|=(14&l)>>1,c[2]=(1&l)<<7,c[2]|=8,c[3]=0),{config:c,samplerate:f[p],channelCount:u,codec:"mp4a.40."+s,manifestCodec:h};t.trigger(a.Events.ERROR,{type:i.ErrorTypes.MEDIA_ERROR,details:i.ErrorDetails.FRAG_PARSING_ERROR,fatal:!0,reason:"invalid ADTS sampling index:"+p})}function s(t,e){return 255===t[e]&&240==(246&t[e+1])}function l(t,e){return 1&t[e+1]?7:9}function u(t,e){return(3&t[e+3])<<11|t[e+4]<<3|(224&t[e+5])>>>5}function c(t,e){return e+5<t.length}function d(t,e){return e+1<t.length&&s(t,e)}function h(t,e){return c(t,e)&&s(t,e)&&u(t,e)<=t.length-e}function f(t,e){if(d(t,e)){var r=l(t,e);if(e+r>=t.length)return!1;var n=u(t,e);if(n<=r)return!1;var i=e+n;return i===t.length||d(t,i)}return!1}function p(t,e,r,i,a){if(!t.samplerate){var s=o(e,r,i,a);if(!s)return;t.config=s.config,t.samplerate=s.samplerate,t.channelCount=s.channelCount,t.codec=s.codec,t.manifestCodec=s.manifestCodec,n.logger.log("parsed codec:"+t.codec+", rate:"+s.samplerate+", channels:"+s.channelCount)}}function g(t){return 9216e4/t}function v(t,e){var r=l(t,e);if(e+r<=t.length){var n=u(t,e)-r;if(n>0)return{headerLength:r,frameLength:n}}}function m(t,e,r,n,i){var a,o=n+i*g(t.samplerate),s=v(e,r);if(s){var l=s.frameLength,u=s.headerLength,c=u+l,d=Math.max(0,r+c-e.length);d?(a=new Uint8Array(c-u)).set(e.subarray(r+u,e.length),0):a=e.subarray(r+u,r+c);var h={unit:a,pts:o};return d||t.samples.push(h),{sample:h,length:c,missing:d}}var f=e.length-r;return(a=new Uint8Array(f)).set(e.subarray(r,e.length),0),{sample:{unit:a,pts:o},length:f,missing:-1}}},"./src/demux/base-audio-demuxer.ts":(t,e,r)=>{"use strict";r.r(e),r.d(e,{default:()=>d,initPTSFn:()=>c});var n=r("./src/polyfills/number.ts"),i=r("./src/demux/id3.ts"),a=r("./src/types/demuxer.ts"),o=r("./src/demux/dummy-demuxed-track.ts"),s=r("./src/utils/mp4-tools.ts"),l=r("./src/utils/typed-array.ts"),u=function(){function t(){this._audioTrack=void 0,this._id3Track=void 0,this.frameIndex=0,this.cachedData=null,this.basePTS=null,this.initPTS=null,this.lastPTS=null}var e=t.prototype;return e.resetInitSegment=function(t,e,r,n){this._id3Track={type:"id3",id:3,pid:-1,inputTimeScale:9e4,sequenceNumber:0,samples:[],dropped:0}},e.resetTimeStamp=function(t){this.initPTS=t,this.resetContiguity()},e.resetContiguity=function(){this.basePTS=null,this.lastPTS=null,this.frameIndex=0},e.canParse=function(t,e){return!1},e.appendFrame=function(t,e,r){},e.demux=function(t,e){this.cachedData&&(t=(0,s.appendUint8Array)(this.cachedData,t),this.cachedData=null);var r,u=i.getID3Data(t,0),d=u?u.length:0,h=this._audioTrack,f=this._id3Track,p=u?i.getTimeStamp(u):void 0,g=t.length;for((null===this.basePTS||0===this.frameIndex&&(0,n.isFiniteNumber)(p))&&(this.basePTS=c(p,e,this.initPTS),this.lastPTS=this.basePTS),null===this.lastPTS&&(this.lastPTS=this.basePTS),u&&u.length>0&&f.samples.push({pts:this.lastPTS,dts:this.lastPTS,data:u,type:a.MetadataSchema.audioId3,duration:Number.POSITIVE_INFINITY});d<g;){if(this.canParse(t,d)){var v=this.appendFrame(h,t,d);v?(this.frameIndex++,this.lastPTS=v.sample.pts,r=d+=v.length):d=g}else i.canParse(t,d)?(u=i.getID3Data(t,d),f.samples.push({pts:this.lastPTS,dts:this.lastPTS,data:u,type:a.MetadataSchema.audioId3,duration:Number.POSITIVE_INFINITY}),r=d+=u.length):d++;if(d===g&&r!==g){var m=(0,l.sliceUint8)(t,r);this.cachedData?this.cachedData=(0,s.appendUint8Array)(this.cachedData,m):this.cachedData=m}}return{audioTrack:h,videoTrack:(0,o.dummyTrack)(),id3Track:f,textTrack:(0,o.dummyTrack)()}},e.demuxSampleAes=function(t,e,r){return Promise.reject(new Error("["+this+"] This demuxer does not support Sample-AES decryption"))},e.flush=function(t){var e=this.cachedData;return e&&(this.cachedData=null,this.demux(e,0)),{audioTrack:this._audioTrack,videoTrack:(0,o.dummyTrack)(),id3Track:this._id3Track,textTrack:(0,o.dummyTrack)()}},e.destroy=function(){},t}(),c=function(t,e,r){return(0,n.isFiniteNumber)(t)?90*t:9e4*e+(r||0)};const d=u},"./src/demux/chunk-cache.ts":(t,e,r)=>{"use strict";r.r(e),r.d(e,{default:()=>n});var n=function(){function t(){this.chunks=[],this.dataLength=0}var e=t.prototype;return e.push=function(t){this.chunks.push(t),this.dataLength+=t.length},e.flush=function(){var t,e=this.chunks,r=this.dataLength;return e.length?(t=1===e.length?e[0]:function(t,e){for(var r=new Uint8Array(e),n=0,i=0;i<t.length;i++){var a=t[i];r.set(a,n),n+=a.length}return r}(e,r),this.reset(),t):new Uint8Array(0)},e.reset=function(){this.chunks.length=0,this.dataLength=0},t}()},"./src/demux/dummy-demuxed-track.ts":(t,e,r)=>{"use strict";function n(t,e){return void 0===t&&(t=""),void 0===e&&(e=9e4),{type:t,id:-1,pid:-1,inputTimeScale:e,sequenceNumber:-1,samples:[],dropped:0}}r.r(e),r.d(e,{dummyTrack:()=>n})},"./src/demux/exp-golomb.ts":(t,e,r)=>{"use strict";r.r(e),r.d(e,{default:()=>i});var n=r("./src/utils/logger.ts");const i=function(){function t(t){this.data=void 0,this.bytesAvailable=void 0,this.word=void 0,this.bitsAvailable=void 0,this.data=t,this.bytesAvailable=t.byteLength,this.word=0,this.bitsAvailable=0}var e=t.prototype;return e.loadWord=function(){var t=this.data,e=this.bytesAvailable,r=t.byteLength-e,n=new Uint8Array(4),i=Math.min(4,e);if(0===i)throw new Error("no bytes available");n.set(t.subarray(r,r+i)),this.word=new DataView(n.buffer).getUint32(0),this.bitsAvailable=8*i,this.bytesAvailable-=i},e.skipBits=function(t){var e;t=Math.min(t,8*this.bytesAvailable+this.bitsAvailable),this.bitsAvailable>t?(this.word<<=t,this.bitsAvailable-=t):(t-=this.bitsAvailable,t-=(e=t>>3)<<3,this.bytesAvailable-=e,this.loadWord(),this.word<<=t,this.bitsAvailable-=t)},e.readBits=function(t){var e=Math.min(this.bitsAvailable,t),r=this.word>>>32-e;if(t>32&&n.logger.error("Cannot read more than 32 bits at a time"),this.bitsAvailable-=e,this.bitsAvailable>0)this.word<<=e;else{if(!(this.bytesAvailable>0))throw new Error("no bits available");this.loadWord()}return(e=t-e)>0&&this.bitsAvailable?r<<e|this.readBits(e):r},e.skipLZ=function(){var t;for(t=0;t<this.bitsAvailable;++t)if(0!=(this.word&2147483648>>>t))return this.word<<=t,this.bitsAvailable-=t,t;return this.loadWord(),t+this.skipLZ()},e.skipUEG=function(){this.skipBits(1+this.skipLZ())},e.skipEG=function(){this.skipBits(1+this.skipLZ())},e.readUEG=function(){var t=this.skipLZ();return this.readBits(t+1)-1},e.readEG=function(){var t=this.readUEG();return 1&t?1+t>>>1:-1*(t>>>1)},e.readBoolean=function(){return 1===this.readBits(1)},e.readUByte=function(){return this.readBits(8)},e.readUShort=function(){return this.readBits(16)},e.readUInt=function(){return this.readBits(32)},e.skipScalingList=function(t){for(var e=8,r=8,n=0;n<t;n++)0!==r&&(r=(e+this.readEG()+256)%256),e=0===r?e:r},e.readSPS=function(){var t,e,r,n=0,i=0,a=0,o=0,s=this.readUByte.bind(this),l=this.readBits.bind(this),u=this.readUEG.bind(this),c=this.readBoolean.bind(this),d=this.skipBits.bind(this),h=this.skipEG.bind(this),f=this.skipUEG.bind(this),p=this.skipScalingList.bind(this);s();var g=s();if(l(5),d(3),s(),f(),100===g||110===g||122===g||244===g||44===g||83===g||86===g||118===g||128===g){var v=u();if(3===v&&d(1),f(),f(),d(1),c())for(e=3!==v?8:12,r=0;r<e;r++)c()&&p(r<6?16:64)}f();var m=u();if(0===m)u();else if(1===m)for(d(1),h(),h(),t=u(),r=0;r<t;r++)h();f(),d(1);var y=u(),b=u(),E=l(1);0===E&&d(1),d(1),c()&&(n=u(),i=u(),a=u(),o=u());var x=[1,1];if(c()&&c())switch(s()){case 1:x=[1,1];break;case 2:x=[12,11];break;case 3:x=[10,11];break;case 4:x=[16,11];break;case 5:x=[40,33];break;case 6:x=[24,11];break;case 7:x=[20,11];break;case 8:x=[32,11];break;case 9:x=[80,33];break;case 10:x=[18,11];break;case 11:x=[15,11];break;case 12:x=[64,33];break;case 13:x=[160,99];break;case 14:x=[4,3];break;case 15:x=[3,2];break;case 16:x=[2,1];break;case 255:x=[s()<<8|s(),s()<<8|s()]}return{width:Math.ceil(16*(y+1)-2*n-2*i),height:(2-E)*(b+1)*16-(E?2:4)*(a+o),pixelRatio:x}},e.readSliceType=function(){return this.readUByte(),this.readUEG(),this.readUEG()},t}()},"./src/demux/id3.ts":(t,e,r)=>{"use strict";r.r(e),r.d(e,{canParse:()=>l,decodeFrame:()=>f,getID3Data:()=>o,getID3Frames:()=>h,getTimeStamp:()=>u,isFooter:()=>a,isHeader:()=>i,isTimeStampFrame:()=>c,testables:()=>b,utf8ArrayToStr:()=>y});var n,i=function(t,e){return e+10<=t.length&&73===t[e]&&68===t[e+1]&&51===t[e+2]&&t[e+3]<255&&t[e+4]<255&&t[e+6]<128&&t[e+7]<128&&t[e+8]<128&&t[e+9]<128},a=function(t,e){return e+10<=t.length&&51===t[e]&&68===t[e+1]&&73===t[e+2]&&t[e+3]<255&&t[e+4]<255&&t[e+6]<128&&t[e+7]<128&&t[e+8]<128&&t[e+9]<128},o=function(t,e){for(var r=e,n=0;i(t,e);)n+=10,n+=s(t,e+6),a(t,e+10)&&(n+=10),e+=n;if(n>0)return t.subarray(r,r+n)},s=function(t,e){var r=0;return r=(127&t[e])<<21,r|=(127&t[e+1])<<14,(r|=(127&t[e+2])<<7)|127&t[e+3]},l=function(t,e){return i(t,e)&&s(t,e+6)+10<=t.length-e},u=function(t){for(var e=h(t),r=0;r<e.length;r++){var n=e[r];if(c(n))return m(n)}},c=function(t){return t&&"PRIV"===t.key&&"com.apple.streaming.transportStreamTimestamp"===t.info},d=function(t){var e=String.fromCharCode(t[0],t[1],t[2],t[3]),r=s(t,4);return{type:e,size:r,data:t.subarray(10,10+r)}},h=function(t){for(var e=0,r=[];i(t,e);){for(var n=s(t,e+6),o=(e+=10)+n;e+8<o;){var l=d(t.subarray(e)),u=f(l);u&&r.push(u),e+=l.size+10}a(t,e)&&(e+=10)}return r},f=function(t){return"PRIV"===t.type?p(t):"W"===t.type[0]?v(t):g(t)},p=function(t){if(!(t.size<2)){var e=y(t.data,!0),r=new Uint8Array(t.data.subarray(e.length+1));return{key:t.type,info:e,data:r.buffer}}},g=function(t){if(!(t.size<2)){if("TXXX"===t.type){var e=1,r=y(t.data.subarray(e),!0);e+=r.length+1;var n=y(t.data.subarray(e));return{key:t.type,info:r,data:n}}var i=y(t.data.subarray(1));return{key:t.type,data:i}}},v=function(t){if("WXXX"===t.type){if(t.size<2)return;var e=1,r=y(t.data.subarray(e),!0);e+=r.length+1;var n=y(t.data.subarray(e));return{key:t.type,info:r,data:n}}var i=y(t.data);return{key:t.type,data:i}},m=function(t){if(8===t.data.byteLength){var e=new Uint8Array(t.data),r=1&e[3],n=(e[4]<<23)+(e[5]<<15)+(e[6]<<7)+e[7];return n/=45,r&&(n+=47721858.84),Math.round(n)}},y=function(t,e){void 0===e&&(e=!1);var r=E();if(r){var n=r.decode(t);if(e){var i=n.indexOf("\0");return-1!==i?n.substring(0,i):n}return n.replace(/\0/g,"")}for(var a,o,s,l=t.length,u="",c=0;c<l;){if(0===(a=t[c++])&&e)return u;if(0!==a&&3!==a)switch(a>>4){case 0:case 1:case 2:case 3:case 4:case 5:case 6:case 7:u+=String.fromCharCode(a);break;case 12:case 13:o=t[c++],u+=String.fromCharCode((31&a)<<6|63&o);break;case 14:o=t[c++],s=t[c++],u+=String.fromCharCode((15&a)<<12|(63&o)<<6|(63&s)<<0)}}return u},b={decodeTextFrame:g};function E(){return n||void 0===self.TextDecoder||(n=new self.TextDecoder("utf-8")),n}},"./src/demux/mp3demuxer.ts":(t,e,r)=>{"use strict";r.r(e),r.d(e,{default:()=>u});var n=r("./src/demux/base-audio-demuxer.ts"),i=r("./src/demux/id3.ts"),a=r("./src/utils/logger.ts"),o=r("./src/demux/mpegaudio.ts");function s(t,e){return s=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},s(t,e)}var l=function(t){var e,r;function n(){return t.apply(this,arguments)||this}r=t,(e=n).prototype=Object.create(r.prototype),e.prototype.constructor=e,s(e,r);var l=n.prototype;return l.resetInitSegment=function(e,r,n,i){t.prototype.resetInitSegment.call(this,e,r,n,i),this._audioTrack={container:"audio/mpeg",type:"audio",id:2,pid:-1,sequenceNumber:0,segmentCodec:"mp3",samples:[],manifestCodec:r,duration:i,inputTimeScale:9e4,dropped:0}},n.probe=function(t){if(!t)return!1;for(var e=(i.getID3Data(t,0)||[]).length,r=t.length;e<r;e++)if(o.probe(t,e))return a.logger.log("MPEG Audio sync word found !"),!0;return!1},l.canParse=function(t,e){return o.canParse(t,e)},l.appendFrame=function(t,e,r){if(null!==this.basePTS)return o.appendFrame(t,e,r,this.basePTS,this.frameIndex)},n}(n.default);const u=l},"./src/demux/mp4demuxer.ts":(t,e,r)=>{"use strict";r.r(e),r.d(e,{default:()=>l});var n=r("./src/polyfills/number.ts"),i=r("./src/types/demuxer.ts"),a=r("./src/utils/mp4-tools.ts"),o=r("./src/demux/dummy-demuxed-track.ts"),s=/\/emsg[-/]ID3/i;const l=function(){function t(t,e){this.remainderData=null,this.timeOffset=0,this.config=void 0,this.videoTrack=void 0,this.audioTrack=void 0,this.id3Track=void 0,this.txtTrack=void 0,this.config=e}var e=t.prototype;return e.resetTimeStamp=function(){},e.resetInitSegment=function(t,e,r,n){var i=this.videoTrack=(0,o.dummyTrack)("video",1),s=this.audioTrack=(0,o.dummyTrack)("audio",1),l=this.txtTrack=(0,o.dummyTrack)("text",1);if(this.id3Track=(0,o.dummyTrack)("id3",1),this.timeOffset=0,t&&t.byteLength){var u=(0,a.parseInitSegment)(t);if(u.video){var c=u.video,d=c.id,h=c.timescale,f=c.codec;i.id=d,i.timescale=l.timescale=h,i.codec=f}if(u.audio){var p=u.audio,g=p.id,v=p.timescale,m=p.codec;s.id=g,s.timescale=v,s.codec=m}l.id=a.RemuxerTrackIdConfig.text,i.sampleDuration=0,i.duration=s.duration=n}},e.resetContiguity=function(){},t.probe=function(t){return t=t.length>16384?t.subarray(0,16384):t,(0,a.findBox)(t,["moof"]).length>0},e.demux=function(t,e){this.timeOffset=e;var r=t,n=this.videoTrack,i=this.txtTrack;if(this.config.progressive){this.remainderData&&(r=(0,a.appendUint8Array)(this.remainderData,t));var o=(0,a.segmentValidRange)(r);this.remainderData=o.remainder,n.samples=o.valid||new Uint8Array}else n.samples=r;var s=this.extractID3Track(n,e);return i.samples=(0,a.parseSamples)(e,n),{videoTrack:n,audioTrack:this.audioTrack,id3Track:s,textTrack:this.txtTrack}},e.flush=function(){var t=this.timeOffset,e=this.videoTrack,r=this.txtTrack;e.samples=this.remainderData||new Uint8Array,this.remainderData=null;var n=this.extractID3Track(e,this.timeOffset);return r.samples=(0,a.parseSamples)(t,e),{videoTrack:e,audioTrack:(0,o.dummyTrack)(),id3Track:n,textTrack:(0,o.dummyTrack)()}},e.extractID3Track=function(t,e){var r=this.id3Track;if(t.samples.length){var o=(0,a.findBox)(t.samples,["emsg"]);o&&o.forEach((function(t){var o=(0,a.parseEmsg)(t);if(s.test(o.schemeIdUri)){var l=(0,n.isFiniteNumber)(o.presentationTime)?o.presentationTime/o.timeScale:e+o.presentationTimeDelta/o.timeScale,u=4294967295===o.eventDuration?Number.POSITIVE_INFINITY:o.eventDuration/o.timeScale;u<=.001&&(u=Number.POSITIVE_INFINITY);var c=o.payload;r.samples.push({data:c,len:c.byteLength,dts:l,pts:l,type:i.MetadataSchema.emsg,duration:u})}}))}return r},e.demuxSampleAes=function(t,e,r){return Promise.reject(new Error("The MP4 demuxer does not support SAMPLE-AES decryption"))},e.destroy=function(){},t}()},"./src/demux/mpegaudio.ts":(t,e,r)=>{"use strict";r.r(e),r.d(e,{appendFrame:()=>l,canParse:()=>h,isHeader:()=>d,isHeaderPattern:()=>c,parseHeader:()=>u,probe:()=>f});var n=null,i=[32,64,96,128,160,192,224,256,288,320,352,384,416,448,32,48,56,64,80,96,112,128,160,192,224,256,320,384,32,40,48,56,64,80,96,112,128,160,192,224,256,320,32,48,56,64,80,96,112,128,144,160,176,192,224,256,8,16,24,32,40,48,56,64,80,96,112,128,144,160],a=[44100,48e3,32e3,22050,24e3,16e3,11025,12e3,8e3],o=[[0,72,144,12],[0,0,0,0],[0,72,144,12],[0,144,144,12]],s=[0,1,1,4];function l(t,e,r,n,i){if(!(r+24>e.length)){var a=u(e,r);if(a&&r+a.frameLength<=e.length){var o=n+i*(9e4*a.samplesPerFrame/a.sampleRate),s={unit:e.subarray(r,r+a.frameLength),pts:o,dts:o};return t.config=[],t.channelCount=a.channelCount,t.samplerate=a.sampleRate,t.samples.push(s),{sample:s,length:a.frameLength,missing:0}}}}function u(t,e){var r=t[e+1]>>3&3,l=t[e+1]>>1&3,u=t[e+2]>>4&15,c=t[e+2]>>2&3;if(1!==r&&0!==u&&15!==u&&3!==c){var d=t[e+2]>>1&1,h=t[e+3]>>6,f=1e3*i[14*(3===r?3-l:3===l?3:4)+u-1],p=a[3*(3===r?0:2===r?1:2)+c],g=3===h?1:2,v=o[r][l],m=s[l],y=8*v*m,b=Math.floor(v*f/p+d)*m;if(null===n){var E=(navigator.userAgent||"").match(/Chrome\/(\d+)/i);n=E?parseInt(E[1]):0}return!!n&&n<=87&&2===l&&f>=224e3&&0===h&&(t[e+3]=128|t[e+3]),{sampleRate:p,channelCount:g,frameLength:b,samplesPerFrame:y}}}function c(t,e){return 255===t[e]&&224==(224&t[e+1])&&0!=(6&t[e+1])}function d(t,e){return e+1<t.length&&c(t,e)}function h(t,e){return c(t,e)&&4<=t.length-e}function f(t,e){if(e+1<t.length&&c(t,e)){var r=u(t,e),n=4;null!=r&&r.frameLength&&(n=r.frameLength);var i=e+n;return i===t.length||d(t,i)}return!1}},"./src/demux/sample-aes.ts":(t,e,r)=>{"use strict";r.r(e),r.d(e,{default:()=>a});var n=r("./src/crypt/decrypter.ts"),i=r("./src/utils/mp4-tools.ts");const a=function(){function t(t,e,r){this.keyData=void 0,this.decrypter=void 0,this.keyData=r,this.decrypter=new n.default(e,{removePKCS7Padding:!1})}var e=t.prototype;return e.decryptBuffer=function(t){return this.decrypter.decrypt(t,this.keyData.key.buffer,this.keyData.iv.buffer)},e.decryptAacSample=function(t,e,r){var n=this,i=t[e].unit;if(!(i.length<=16)){var a=i.subarray(16,i.length-i.length%16),o=a.buffer.slice(a.byteOffset,a.byteOffset+a.length);this.decryptBuffer(o).then((function(a){var o=new Uint8Array(a);i.set(o,16),n.decrypter.isSync()||n.decryptAacSamples(t,e+1,r)}))}},e.decryptAacSamples=function(t,e,r){for(;;e++){if(e>=t.length)return void r();if(!(t[e].unit.length<32||(this.decryptAacSample(t,e,r),this.decrypter.isSync())))return}},e.getAvcEncryptedData=function(t){for(var e=16*Math.floor((t.length-48)/160)+16,r=new Int8Array(e),n=0,i=32;i<t.length-16;i+=160,n+=16)r.set(t.subarray(i,i+16),n);return r},e.getAvcDecryptedUnit=function(t,e){for(var r=new Uint8Array(e),n=0,i=32;i<t.length-16;i+=160,n+=16)t.set(r.subarray(n,n+16),i);return t},e.decryptAvcSample=function(t,e,r,n,a){var o=this,s=(0,i.discardEPB)(a.data),l=this.getAvcEncryptedData(s);this.decryptBuffer(l.buffer).then((function(i){a.data=o.getAvcDecryptedUnit(s,i),o.decrypter.isSync()||o.decryptAvcSamples(t,e,r+1,n)}))},e.decryptAvcSamples=function(t,e,r,n){if(t instanceof Uint8Array)throw new Error("Cannot decrypt samples of type Uint8Array");for(;;e++,r=0){if(e>=t.length)return void n();for(var i=t[e].units;!(r>=i.length);r++){var a=i[r];if(!(a.data.length<=48||1!==a.type&&5!==a.type||(this.decryptAvcSample(t,e,r,n,a),this.decrypter.isSync())))return}}},t}()},"./src/demux/transmuxer-interface.ts":(t,e,r)=>{"use strict";r.r(e),r.d(e,{default:()=>d});var n=r("./src/demux/webworkify-webpack.js"),i=r("./src/events.ts"),a=r("./src/demux/transmuxer.ts"),o=r("./src/utils/logger.ts"),s=r("./src/errors.ts"),l=r("./src/utils/mediasource-helper.ts"),u=r("./node_modules/eventemitter3/index.js"),c=(0,l.getMediaSource)()||{isTypeSupported:function(){return!1}},d=function(){function t(t,e,r,l){var d=this;this.hls=void 0,this.id=void 0,this.observer=void 0,this.frag=null,this.part=null,this.useWorker=void 0,this.worker=void 0,this.onwmsg=void 0,this.transmuxer=null,this.onTransmuxComplete=void 0,this.onFlush=void 0;var h=t.config;this.hls=t,this.id=e,this.useWorker=!!h.enableWorker,this.onTransmuxComplete=r,this.onFlush=l;var f=function(t,e){(e=e||{}).frag=d.frag,e.id=d.id,d.hls.trigger(t,e)};this.observer=new u.EventEmitter,this.observer.on(i.Events.FRAG_DECRYPTED,f),this.observer.on(i.Events.ERROR,f);var p={mp4:c.isTypeSupported("video/mp4"),mpeg:c.isTypeSupported("audio/mpeg"),mp3:c.isTypeSupported('audio/mp4; codecs="mp3"')},g=navigator.vendor;if(this.useWorker&&"undefined"!=typeof Worker){var v;o.logger.log("demuxing in webworker");try{v=this.worker=(0,n.default)("./src/demux/transmuxer-worker.ts"),this.onwmsg=this.onWorkerMessage.bind(this),v.addEventListener("message",this.onwmsg),v.onerror=function(t){d.useWorker=!1,o.logger.warn("Exception in webworker, fallback to inline"),d.hls.trigger(i.Events.ERROR,{type:s.ErrorTypes.OTHER_ERROR,details:s.ErrorDetails.INTERNAL_EXCEPTION,fatal:!1,event:"demuxerWorker",error:new Error(t.message+" ("+t.filename+":"+t.lineno+")")})},v.postMessage({cmd:"init",typeSupported:p,vendor:g,id:e,config:JSON.stringify(h)})}catch(t){o.logger.warn("Error in worker:",t),o.logger.error("Error while initializing DemuxerWorker, fallback to inline"),v&&self.URL.revokeObjectURL(v.objectURL),this.transmuxer=new a.default(this.observer,p,h,g,e),this.worker=null}}else this.transmuxer=new a.default(this.observer,p,h,g,e)}var e=t.prototype;return e.destroy=function(){var t=this.worker;if(t)t.removeEventListener("message",this.onwmsg),t.terminate(),this.worker=null,this.onwmsg=void 0;else{var e=this.transmuxer;e&&(e.destroy(),this.transmuxer=null)}var r=this.observer;r&&r.removeAllListeners(),this.frag=null,this.observer=null,this.hls=null},e.push=function(t,e,r,n,i,s,l,u,c,d){var h,f,p=this;c.transmuxing.start=self.performance.now();var g=this.transmuxer,v=this.worker,m=s?s.start:i.start,y=i.decryptdata,b=this.frag,E=!(b&&i.cc===b.cc),x=!(b&&c.level===b.level),S=b?c.sn-b.sn:-1,T=this.part?c.part-this.part.index:-1,w=0===S&&c.id>1&&c.id===(null==b?void 0:b.stats.chunkCount),_=!x&&(1===S||0===S&&(1===T||w&&T<=0)),A=self.performance.now();(x||S||0===i.stats.parsing.start)&&(i.stats.parsing.start=A),!s||!T&&_||(s.stats.parsing.start=A);var k=!(b&&(null===(h=i.initSegment)||void 0===h?void 0:h.url)===(null===(f=b.initSegment)||void 0===f?void 0:f.url)),C=new a.TransmuxState(E,_,u,x,m,k);if(!_||E||k){o.logger.log("[transmuxer-interface, "+i.type+"]: Starting new transmux session for sn: "+c.sn+" p: "+c.part+" level: "+c.level+" id: "+c.id+"\n discontinuity: "+E+"\n trackSwitch: "+x+"\n contiguous: "+_+"\n accurateTimeOffset: "+u+"\n timeOffset: "+m+"\n initSegmentChange: "+k);var D=new a.TransmuxConfig(r,n,e,l,d);this.configureTransmuxer(D)}if(this.frag=i,this.part=s,v)v.postMessage({cmd:"demux",data:t,decryptdata:y,chunkMeta:c,state:C},t instanceof ArrayBuffer?[t]:[]);else if(g){var L=g.push(t,y,c,C);(0,a.isPromise)(L)?(g.async=!0,L.then((function(t){p.handleTransmuxComplete(t)})).catch((function(t){p.transmuxerError(t,c,"transmuxer-interface push error")}))):(g.async=!1,this.handleTransmuxComplete(L))}},e.flush=function(t){var e=this;t.transmuxing.start=self.performance.now();var r=this.transmuxer,n=this.worker;if(n)n.postMessage({cmd:"flush",chunkMeta:t});else if(r){var i=r.flush(t);(0,a.isPromise)(i)||r.async?((0,a.isPromise)(i)||(i=Promise.resolve(i)),i.then((function(r){e.handleFlushResult(r,t)})).catch((function(r){e.transmuxerError(r,t,"transmuxer-interface flush error")}))):this.handleFlushResult(i,t)}},e.transmuxerError=function(t,e,r){this.hls&&this.hls.trigger(i.Events.ERROR,{type:s.ErrorTypes.MEDIA_ERROR,details:s.ErrorDetails.FRAG_PARSING_ERROR,chunkMeta:e,fatal:!1,error:t,err:t,reason:r})},e.handleFlushResult=function(t,e){var r=this;t.forEach((function(t){r.handleTransmuxComplete(t)})),this.onFlush(e)},e.onWorkerMessage=function(t){var e=t.data,r=this.hls;switch(e.event){case"init":self.URL.revokeObjectURL(this.worker.objectURL);break;case"transmuxComplete":this.handleTransmuxComplete(e.data);break;case"flush":this.onFlush(e.data);break;case"workerLog":o.logger[e.data.logType]&&o.logger[e.data.logType](e.data.message);break;default:e.data=e.data||{},e.data.frag=this.frag,e.data.id=this.id,r.trigger(e.event,e.data)}},e.configureTransmuxer=function(t){var e=this.worker,r=this.transmuxer;e?e.postMessage({cmd:"configure",config:t}):r&&r.configure(t)},e.handleTransmuxComplete=function(t){t.chunkMeta.transmuxing.end=self.performance.now(),this.onTransmuxComplete(t)},t}()},"./src/demux/transmuxer-worker.ts":(t,e,r)=>{"use strict";r.r(e),r.d(e,{default:()=>l});var n=r("./src/demux/transmuxer.ts"),i=r("./src/events.ts"),a=r("./src/utils/logger.ts"),o=r("./node_modules/eventemitter3/index.js"),s=r("./src/errors.ts");function l(t){var e=new o.EventEmitter,r=function(e,r){t.postMessage({event:e,data:r})};e.on(i.Events.FRAG_DECRYPTED,r),e.on(i.Events.ERROR,r),t.addEventListener("message",(function(o){var l=o.data;switch(l.cmd){case"init":var c=JSON.parse(l.config);t.transmuxer=new n.default(e,l.typeSupported,c,l.vendor,l.id),(0,a.enableLogs)(c.debug,l.id),function(){var t=function(t){a.logger[t]=function(e){r("workerLog",{logType:t,message:e})}};for(var e in a.logger)t(e)}(),r("init",null);break;case"configure":t.transmuxer.configure(l.config);break;case"demux":var h=t.transmuxer.push(l.data,l.decryptdata,l.chunkMeta,l.state);(0,n.isPromise)(h)?(t.transmuxer.async=!0,h.then((function(e){u(t,e)})).catch((function(t){r(i.Events.ERROR,{type:s.ErrorTypes.MEDIA_ERROR,details:s.ErrorDetails.FRAG_PARSING_ERROR,chunkMeta:l.chunkMeta,fatal:!1,error:t,err:t,reason:"transmuxer-worker push error"})}))):(t.transmuxer.async=!1,u(t,h));break;case"flush":var f=l.chunkMeta,p=t.transmuxer.flush(f);(0,n.isPromise)(p)||t.transmuxer.async?((0,n.isPromise)(p)||(p=Promise.resolve(p)),p.then((function(e){d(t,e,f)})).catch((function(t){r(i.Events.ERROR,{type:s.ErrorTypes.MEDIA_ERROR,details:s.ErrorDetails.FRAG_PARSING_ERROR,chunkMeta:l.chunkMeta,fatal:!1,error:t,err:t,reason:"transmuxer-worker flush error"})}))):d(t,p,f)}}))}function u(t,e){if(!((r=e.remuxResult).audio||r.video||r.text||r.id3||r.initSegment))return!1;var r,n=[],i=e.remuxResult,a=i.audio,o=i.video;return a&&c(n,a),o&&c(n,o),t.postMessage({event:"transmuxComplete",data:e},n),!0}function c(t,e){e.data1&&t.push(e.data1.buffer),e.data2&&t.push(e.data2.buffer)}function d(t,e,r){e.reduce((function(e,r){return u(t,r)||e}),!1)||t.postMessage({event:"transmuxComplete",data:e[0]}),t.postMessage({event:"flush",data:r})}},"./src/demux/transmuxer.ts":(t,e,r)=>{"use strict";r.r(e),r.d(e,{TransmuxConfig:()=>y,TransmuxState:()=>b,default:()=>g,isPromise:()=>m});var n,i=r("./src/events.ts"),a=r("./src/errors.ts"),o=r("./src/crypt/decrypter.ts"),s=r("./src/demux/aacdemuxer.ts"),l=r("./src/demux/mp4demuxer.ts"),u=r("./src/demux/tsdemuxer.ts"),c=r("./src/demux/mp3demuxer.ts"),d=r("./src/remux/mp4-remuxer.ts"),h=r("./src/remux/passthrough-remuxer.ts"),f=r("./src/utils/logger.ts");try{n=self.performance.now.bind(self.performance)}catch(t){f.logger.debug("Unable to use Performance API on this environment"),n=self.Date.now}var p=[{demux:l.default,remux:h.default},{demux:u.default,remux:d.default},{demux:s.default,remux:d.default},{demux:c.default,remux:d.default}],g=function(){function t(t,e,r,n,i){this.async=!1,this.observer=void 0,this.typeSupported=void 0,this.config=void 0,this.vendor=void 0,this.id=void 0,this.demuxer=void 0,this.remuxer=void 0,this.decrypter=void 0,this.probe=void 0,this.decryptionPromise=null,this.transmuxConfig=void 0,this.currentTransmuxState=void 0,this.observer=t,this.typeSupported=e,this.config=r,this.vendor=n,this.id=i}var e=t.prototype;return e.configure=function(t){this.transmuxConfig=t,this.decrypter&&this.decrypter.reset()},e.push=function(t,e,r,i){var a=this,o=r.transmuxing;o.executeStart=n();var s=new Uint8Array(t),l=this.currentTransmuxState,u=this.transmuxConfig;i&&(this.currentTransmuxState=i);var c=i||l,d=c.contiguous,h=c.discontinuity,f=c.trackSwitch,p=c.accurateTimeOffset,g=c.timeOffset,m=c.initSegmentChange,y=u.audioCodec,b=u.videoCodec,E=u.defaultInitPts,x=u.duration,S=u.initSegmentData,T=function(t,e){var r=null;return t.byteLength>0&&null!=e&&null!=e.key&&null!==e.iv&&null!=e.method&&(r=e),r}(s,e);if(T&&"AES-128"===T.method){var w=this.getDecrypter();if(!w.isSync())return this.decryptionPromise=w.webCryptoDecrypt(s,T.key.buffer,T.iv.buffer).then((function(t){var e=a.push(t,null,r);return a.decryptionPromise=null,e})),this.decryptionPromise;var _=w.softwareDecrypt(s,T.key.buffer,T.iv.buffer);if(!_)return o.executeEnd=n(),v(r);s=new Uint8Array(_)}var A=this.needsProbing(h,f);A&&this.configureTransmuxer(s),(h||f||m||A)&&this.resetInitSegment(S,y,b,x,e),(h||m||A)&&this.resetInitialTimestamp(E),d||this.resetContiguity();var k=this.transmux(s,T,g,p,r),C=this.currentTransmuxState;return C.contiguous=!0,C.discontinuity=!1,C.trackSwitch=!1,o.executeEnd=n(),k},e.flush=function(t){var e=this,r=t.transmuxing;r.executeStart=n();var o=this.decrypter,s=this.currentTransmuxState,l=this.decryptionPromise;if(l)return l.then((function(){return e.flush(t)}));var u=[],c=s.timeOffset;if(o){var d=o.flush();d&&u.push(this.push(d,null,t))}var h=this.demuxer,f=this.remuxer;if(!h||!f)return this.observer.emit(i.Events.ERROR,i.Events.ERROR,{type:a.ErrorTypes.MEDIA_ERROR,details:a.ErrorDetails.FRAG_PARSING_ERROR,fatal:!0,reason:"no demux matching with content found"}),r.executeEnd=n(),[v(t)];var p=h.flush(c);return m(p)?p.then((function(r){return e.flushRemux(u,r,t),u})):(this.flushRemux(u,p,t),u)},e.flushRemux=function(t,e,r){var i=e.audioTrack,a=e.videoTrack,o=e.id3Track,s=e.textTrack,l=this.currentTransmuxState,u=l.accurateTimeOffset,c=l.timeOffset;f.logger.log("[transmuxer.ts]: Flushed fragment "+r.sn+(r.part>-1?" p: "+r.part:"")+" of level "+r.level);var d=this.remuxer.remux(i,a,o,s,c,u,!0,this.id);t.push({remuxResult:d,chunkMeta:r}),r.transmuxing.executeEnd=n()},e.resetInitialTimestamp=function(t){var e=this.demuxer,r=this.remuxer;e&&r&&(e.resetTimeStamp(t),r.resetTimeStamp(t))},e.resetContiguity=function(){var t=this.demuxer,e=this.remuxer;t&&e&&(t.resetContiguity(),e.resetNextTimestamp())},e.resetInitSegment=function(t,e,r,n,i){var a=this.demuxer,o=this.remuxer;a&&o&&(a.resetInitSegment(t,e,r,n),o.resetInitSegment(t,e,r,i))},e.destroy=function(){this.demuxer&&(this.demuxer.destroy(),this.demuxer=void 0),this.remuxer&&(this.remuxer.destroy(),this.remuxer=void 0)},e.transmux=function(t,e,r,n,i){return e&&"SAMPLE-AES"===e.method?this.transmuxSampleAes(t,e,r,n,i):this.transmuxUnencrypted(t,r,n,i)},e.transmuxUnencrypted=function(t,e,r,n){var i=this.demuxer.demux(t,e,!1,!this.config.progressive),a=i.audioTrack,o=i.videoTrack,s=i.id3Track,l=i.textTrack;return{remuxResult:this.remuxer.remux(a,o,s,l,e,r,!1,this.id),chunkMeta:n}},e.transmuxSampleAes=function(t,e,r,n,i){var a=this;return this.demuxer.demuxSampleAes(t,e,r).then((function(t){return{remuxResult:a.remuxer.remux(t.audioTrack,t.videoTrack,t.id3Track,t.textTrack,r,n,!1,a.id),chunkMeta:i}}))},e.configureTransmuxer=function(t){for(var e,r=this.config,n=this.observer,i=this.typeSupported,a=this.vendor,o=0,s=p.length;o<s;o++)if(p[o].demux.probe(t)){e=p[o];break}e||(f.logger.warn("Failed to find demuxer by probing frag, treating as mp4 passthrough"),e={demux:l.default,remux:h.default});var u=this.demuxer,c=this.remuxer,d=e.remux,g=e.demux;c&&c instanceof d||(this.remuxer=new d(n,r,i,a)),u&&u instanceof g||(this.demuxer=new g(n,r,i),this.probe=g.probe)},e.needsProbing=function(t,e){return!this.demuxer||!this.remuxer||t||e},e.getDecrypter=function(){var t=this.decrypter;return t||(t=this.decrypter=new o.default(this.config)),t},t}(),v=function(t){return{remuxResult:{},chunkMeta:t}};function m(t){return"then"in t&&t.then instanceof Function}var y=function(t,e,r,n,i){this.audioCodec=void 0,this.videoCodec=void 0,this.initSegmentData=void 0,this.duration=void 0,this.defaultInitPts=void 0,this.audioCodec=t,this.videoCodec=e,this.initSegmentData=r,this.duration=n,this.defaultInitPts=i},b=function(t,e,r,n,i,a){this.discontinuity=void 0,this.contiguous=void 0,this.accurateTimeOffset=void 0,this.trackSwitch=void 0,this.timeOffset=void 0,this.initSegmentChange=void 0,this.discontinuity=t,this.contiguous=e,this.accurateTimeOffset=r,this.trackSwitch=n,this.timeOffset=i,this.initSegmentChange=a}},"./src/demux/tsdemuxer.ts":(t,e,r)=>{"use strict";r.r(e),r.d(e,{default:()=>b});var n=r("./src/demux/adts.ts"),i=r("./src/demux/mpegaudio.ts"),a=r("./src/demux/exp-golomb.ts"),o=r("./src/demux/sample-aes.ts"),s=r("./src/events.ts"),l=r("./src/utils/mp4-tools.ts"),u=r("./src/utils/logger.ts"),c=r("./src/errors.ts"),d=r("./src/types/demuxer.ts");function h(){return h=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(t[n]=r[n])}return t},h.apply(this,arguments)}var f=188;function p(t,e,r,n){return{key:t,frame:!1,pts:e,dts:r,units:[],debug:n,length:0}}function g(t,e){return(31&t[e+10])<<8|t[e+11]}function v(t,e,r,n){var i={audio:-1,avc:-1,id3:-1,segmentCodec:"aac"},a=e+3+((15&t[e+1])<<8|t[e+2])-4;for(e+=12+((15&t[e+10])<<8|t[e+11]);e<a;){var o=(31&t[e+1])<<8|t[e+2];switch(t[e]){case 207:if(!n){u.logger.log("ADTS AAC with AES-128-CBC frame encryption found in unencrypted stream");break}case 15:-1===i.audio&&(i.audio=o);break;case 21:-1===i.id3&&(i.id3=o);break;case 219:if(!n){u.logger.log("H.264 with AES-128-CBC slice encryption found in unencrypted stream");break}case 27:-1===i.avc&&(i.avc=o);break;case 3:case 4:!0!==r.mpeg&&!0!==r.mp3?u.logger.log("MPEG audio found, not supported in this browser"):-1===i.audio&&(i.audio=o,i.segmentCodec="mp3");break;case 36:u.logger.warn("Unsupported HEVC stream type found")}e+=5+((15&t[e+3])<<8|t[e+4])}return i}function m(t){var e,r,n,i,a,o=0,s=t.data;if(!t||0===t.size)return null;for(;s[0].length<19&&s.length>1;){var l=new Uint8Array(s[0].length+s[1].length);l.set(s[0]),l.set(s[1],s[0].length),s[0]=l,s.splice(1,1)}if(1===((e=s[0])[0]<<16)+(e[1]<<8)+e[2]){if((r=(e[4]<<8)+e[5])&&r>t.size-6)return null;var c=e[7];192&c&&(i=536870912*(14&e[9])+4194304*(255&e[10])+16384*(254&e[11])+128*(255&e[12])+(254&e[13])/2,64&c?i-(a=536870912*(14&e[14])+4194304*(255&e[15])+16384*(254&e[16])+128*(255&e[17])+(254&e[18])/2)>54e5&&(u.logger.warn(Math.round((i-a)/9e4)+"s delta between PTS and DTS, align them"),i=a):a=i);var d=(n=e[8])+9;if(t.size<=d)return null;t.size-=d;for(var h=new Uint8Array(t.size),f=0,p=s.length;f<p;f++){var g=(e=s[f]).byteLength;if(d){if(d>g){d-=g;continue}e=e.subarray(d),g-=d,d=0}h.set(e,o),o+=g}return r&&(r-=n+3),{data:h,pts:i,dts:a,len:r}}return null}function y(t,e){if(t.units.length&&t.frame){if(void 0===t.pts){var r=e.samples,n=r.length;if(!n)return void e.dropped++;var i=r[n-1];t.pts=i.pts,t.dts=i.dts}e.samples.push(t)}t.debug.length&&u.logger.log(t.pts+"/"+t.dts+":"+t.debug)}const b=function(){function t(t,e,r){this.observer=void 0,this.config=void 0,this.typeSupported=void 0,this.sampleAes=null,this.pmtParsed=!1,this.audioCodec=void 0,this.videoCodec=void 0,this._duration=0,this._pmtId=-1,this._avcTrack=void 0,this._audioTrack=void 0,this._id3Track=void 0,this._txtTrack=void 0,this.aacOverFlow=null,this.avcSample=null,this.remainderData=null,this.observer=t,this.config=e,this.typeSupported=r}t.probe=function(e){var r=t.syncOffset(e);return r>0&&u.logger.warn("MPEG2-TS detected but first sync word found @ offset "+r),-1!==r},t.syncOffset=function(t){for(var e=Math.min(940,t.length-376)+1,r=0;r<e;){if(71===t[r]&&71===t[r+f])return r;r++}return-1},t.createTrack=function(t,e){return{container:"video"===t||"audio"===t?"video/mp2t":void 0,type:t,id:l.RemuxerTrackIdConfig[t],pid:-1,inputTimeScale:9e4,sequenceNumber:0,samples:[],dropped:0,duration:"audio"===t?e:void 0}};var e=t.prototype;return e.resetInitSegment=function(e,r,n,i){this.pmtParsed=!1,this._pmtId=-1,this._avcTrack=t.createTrack("video"),this._audioTrack=t.createTrack("audio",i),this._id3Track=t.createTrack("id3"),this._txtTrack=t.createTrack("text"),this._audioTrack.segmentCodec="aac",this.aacOverFlow=null,this.avcSample=null,this.remainderData=null,this.audioCodec=r,this.videoCodec=n,this._duration=i},e.resetTimeStamp=function(){},e.resetContiguity=function(){var t=this._audioTrack,e=this._avcTrack,r=this._id3Track;t&&(t.pesData=null),e&&(e.pesData=null),r&&(r.pesData=null),this.aacOverFlow=null,this.avcSample=null,this.remainderData=null},e.demux=function(e,r,n,i){var a;void 0===n&&(n=!1),void 0===i&&(i=!1),n||(this.sampleAes=null);var o=this._avcTrack,d=this._audioTrack,h=this._id3Track,p=this._txtTrack,y=o.pid,b=o.pesData,E=d.pid,x=h.pid,S=d.pesData,T=h.pesData,w=null,_=this.pmtParsed,A=this._pmtId,k=e.length;if(this.remainderData&&(k=(e=(0,l.appendUint8Array)(this.remainderData,e)).length,this.remainderData=null),k<f&&!i)return this.remainderData=e,{audioTrack:d,videoTrack:o,id3Track:h,textTrack:p};var C=Math.max(0,t.syncOffset(e));(k-=(k-C)%f)<e.byteLength&&!i&&(this.remainderData=new Uint8Array(e.buffer,k,e.buffer.byteLength-k));for(var D=0,L=C;L<k;L+=f)if(71===e[L]){var R=!!(64&e[L+1]),I=((31&e[L+1])<<8)+e[L+2],O=void 0;if((48&e[L+3])>>4>1){if((O=L+5+e[L+4])===L+f)continue}else O=L+4;switch(I){case y:R&&(b&&(a=m(b))&&this.parseAVCPES(o,p,a,!1),b={data:[],size:0}),b&&(b.data.push(e.subarray(O,L+f)),b.size+=L+f-O);break;case E:if(R){if(S&&(a=m(S)))switch(d.segmentCodec){case"aac":this.parseAACPES(d,a);break;case"mp3":this.parseMPEGPES(d,a)}S={data:[],size:0}}S&&(S.data.push(e.subarray(O,L+f)),S.size+=L+f-O);break;case x:R&&(T&&(a=m(T))&&this.parseID3PES(h,a),T={data:[],size:0}),T&&(T.data.push(e.subarray(O,L+f)),T.size+=L+f-O);break;case 0:R&&(O+=e[O]+1),A=this._pmtId=g(e,O);break;case A:R&&(O+=e[O]+1);var M=v(e,O,this.typeSupported,n);(y=M.avc)>0&&(o.pid=y),(E=M.audio)>0&&(d.pid=E,d.segmentCodec=M.segmentCodec),(x=M.id3)>0&&(h.pid=x),null===w||_||(u.logger.log("unknown PID '"+w+"' in TS found"),w=null,L=C-188),_=this.pmtParsed=!0;break;case 17:case 8191:break;default:w=I}}else D++;D>0&&this.observer.emit(s.Events.ERROR,s.Events.ERROR,{type:c.ErrorTypes.MEDIA_ERROR,details:c.ErrorDetails.FRAG_PARSING_ERROR,fatal:!1,reason:"Found "+D+" TS packet/s that do not start with 0x47"}),o.pesData=b,d.pesData=S,h.pesData=T;var P={audioTrack:d,videoTrack:o,id3Track:h,textTrack:p};return i&&this.extractRemainingSamples(P),P},e.flush=function(){var t,e=this.remainderData;return this.remainderData=null,t=e?this.demux(e,-1,!1,!0):{videoTrack:this._avcTrack,audioTrack:this._audioTrack,id3Track:this._id3Track,textTrack:this._txtTrack},this.extractRemainingSamples(t),this.sampleAes?this.decrypt(t,this.sampleAes):t},e.extractRemainingSamples=function(t){var e,r=t.audioTrack,n=t.videoTrack,i=t.id3Track,a=t.textTrack,o=n.pesData,s=r.pesData,l=i.pesData;if(o&&(e=m(o))?(this.parseAVCPES(n,a,e,!0),n.pesData=null):n.pesData=o,s&&(e=m(s))){switch(r.segmentCodec){case"aac":this.parseAACPES(r,e);break;case"mp3":this.parseMPEGPES(r,e)}r.pesData=null}else null!=s&&s.size&&u.logger.log("last AAC PES packet truncated,might overlap between fragments"),r.pesData=s;l&&(e=m(l))?(this.parseID3PES(i,e),i.pesData=null):i.pesData=l},e.demuxSampleAes=function(t,e,r){var n=this.demux(t,r,!0,!this.config.progressive),i=this.sampleAes=new o.default(this.observer,this.config,e);return this.decrypt(n,i)},e.decrypt=function(t,e){return new Promise((function(r){var n=t.audioTrack,i=t.videoTrack;n.samples&&"aac"===n.segmentCodec?e.decryptAacSamples(n.samples,0,(function(){i.samples?e.decryptAvcSamples(i.samples,0,0,(function(){r(t)})):r(t)})):i.samples&&e.decryptAvcSamples(i.samples,0,0,(function(){r(t)}))}))},e.destroy=function(){this._duration=0},e.parseAVCPES=function(t,e,r,n){var i,o=this,s=this.parseAVCNALu(t,r.data),u=this.avcSample,c=!1;r.data=null,u&&s.length&&!t.audFound&&(y(u,t),u=this.avcSample=p(!1,r.pts,r.dts,"")),s.forEach((function(n){switch(n.type){case 1:i=!0,u||(u=o.avcSample=p(!0,r.pts,r.dts,"")),u.frame=!0;var s=n.data;if(c&&s.length>4){var d=new a.default(s).readSliceType();2!==d&&4!==d&&7!==d&&9!==d||(u.key=!0)}break;case 5:i=!0,u||(u=o.avcSample=p(!0,r.pts,r.dts,"")),u.key=!0,u.frame=!0;break;case 6:i=!0,(0,l.parseSEIMessageFromNALu)(n.data,1,r.pts,e.samples);break;case 7:if(i=!0,c=!0,!t.sps){var h=new a.default(n.data).readSPS();t.width=h.width,t.height=h.height,t.pixelRatio=h.pixelRatio,t.sps=[n.data],t.duration=o._duration;for(var f=n.data.subarray(1,4),g="avc1.",v=0;v<3;v++){var m=f[v].toString(16);m.length<2&&(m="0"+m),g+=m}t.codec=g}break;case 8:i=!0,t.pps||(t.pps=[n.data]);break;case 9:i=!1,t.audFound=!0,u&&y(u,t),u=o.avcSample=p(!1,r.pts,r.dts,"");break;case 12:i=!0;break;default:i=!1,u&&(u.debug+="unknown NAL "+n.type+" ")}u&&i&&u.units.push(n)})),n&&u&&(y(u,t),this.avcSample=null)},e.getLastNalUnit=function(t){var e,r,n=this.avcSample;if(n&&0!==n.units.length||(n=t[t.length-1]),null!==(e=n)&&void 0!==e&&e.units){var i=n.units;r=i[i.length-1]}return r},e.parseAVCNALu=function(t,e){var r,n,i=e.byteLength,a=t.naluState||0,o=a,s=[],l=0,u=-1,c=0;for(-1===a&&(u=0,c=31&e[0],a=0,l=1);l<i;)if(r=e[l++],a)if(1!==a)if(r)if(1===r){if(u>=0){var d={data:e.subarray(u,l-a-1),type:c};s.push(d)}else{var h=this.getLastNalUnit(t.samples);if(h&&(o&&l<=4-o&&h.state&&(h.data=h.data.subarray(0,h.data.byteLength-o)),(n=l-a-1)>0)){var f=new Uint8Array(h.data.byteLength+n);f.set(h.data,0),f.set(e.subarray(0,n),h.data.byteLength),h.data=f,h.state=0}}l<i?(u=l,c=31&e[l],a=0):a=-1}else a=0;else a=3;else a=r?0:2;else a=r?0:1;if(u>=0&&a>=0){var p={data:e.subarray(u,i),type:c,state:a};s.push(p)}if(0===s.length){var g=this.getLastNalUnit(t.samples);if(g){var v=new Uint8Array(g.data.byteLength+e.byteLength);v.set(g.data,0),v.set(e,g.data.byteLength),g.data=v}}return t.naluState=a,s},e.parseAACPES=function(t,e){var r,i,a,o,l,d=0,h=this.aacOverFlow,f=e.data;if(h){this.aacOverFlow=null;var p=h.missing,g=h.sample.unit.byteLength;if(-1===p){var v=new Uint8Array(g+f.byteLength);v.set(h.sample.unit,0),v.set(f,g),f=v}else{var m=g-p;h.sample.unit.set(f.subarray(0,p),m),t.samples.push(h.sample),d=h.missing}}for(r=d,i=f.length;r<i-1&&!n.isHeader(f,r);r++);if(r===d||(r<i-1?(a="AAC PES did not start with ADTS header,offset:"+r,o=!1):(a="no ADTS header found in AAC PES",o=!0),u.logger.warn("parsing error:"+a),this.observer.emit(s.Events.ERROR,s.Events.ERROR,{type:c.ErrorTypes.MEDIA_ERROR,details:c.ErrorDetails.FRAG_PARSING_ERROR,fatal:o,reason:a}),!o)){if(n.initTrackConfig(t,this.observer,f,r,this.audioCodec),void 0!==e.pts)l=e.pts;else{if(!h)return void u.logger.warn("[tsdemuxer]: AAC PES unknown PTS");var y=n.getFrameDuration(t.samplerate);l=h.sample.pts+y}for(var b,E=0;r<i;){if(r+=(b=n.appendFrame(t,f,r,l,E)).length,b.missing){this.aacOverFlow=b;break}for(E++;r<i-1&&!n.isHeader(f,r);r++);}}},e.parseMPEGPES=function(t,e){var r=e.data,n=r.length,a=0,o=0,s=e.pts;if(void 0!==s)for(;o<n;)if(i.isHeader(r,o)){var l=i.appendFrame(t,r,o,s,a);if(!l)break;o+=l.length,a++}else o++;else u.logger.warn("[tsdemuxer]: MPEG PES unknown PTS")},e.parseID3PES=function(t,e){if(void 0!==e.pts){var r=h({},e,{type:this._avcTrack?d.MetadataSchema.emsg:d.MetadataSchema.audioId3,duration:Number.POSITIVE_INFINITY});t.samples.push(r)}else u.logger.warn("[tsdemuxer]: ID3 PES unknown PTS")},t}()},"./src/demux/webworkify-webpack.js":(t,e,r)=>{"use strict";r.r(e),r.d(e,{default:()=>c});var n=function(){var t=ENTRY_MODULE,e={},r=function r(n){var i=e[n];if(void 0!==i)return i.exports;var a=e[n]={exports:{}};return t[n].call(a.exports,a,a.exports,r),a.exports};r.m=t,r.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return r.d(e,{a:e}),e},r.d=function(t,e){for(var n in e)r.o(e,n)&&!r.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},r.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},r.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};var n=r(ENTRY_MODULE);return n.default||n}.toString().split("ENTRY_MODULE"),i="[\\.|\\-|\\+|\\w|/|@]+",a="\\(\\s*(/\\*.*?\\*/)?\\s*.*?("+i+").*?\\)";function o(t){return(t+"").replace(/[.?*+^$[\]\\(){}|-]/g,"\\$&")}function s(t,e,n){var s={};s[n]=[];var l=e.toString().replace(/^"[^"]+"/,"function"),u=l.match(/^function\s?\w*\(\w+,\s*\w+,\s*(\w+)\)/)||l.match(/^\(\w+,\s*\w+,\s*(\w+)\)\s?\=\s?\>/);if(!u)return s;for(var c,d=u[1],h=new RegExp("(\\\\n|\\W)"+o(d)+a,"g");c=h.exec(l);)"dll-reference"!==c[3]&&s[n].push(c[3]);for(h=new RegExp("\\("+o(d)+'\\("(dll-reference\\s('+i+'))"\\)\\)'+a,"g");c=h.exec(l);)t[c[2]]||(s[n].push(c[1]),t[c[2]]=r(c[1]).m),s[c[2]]=s[c[2]]||[],s[c[2]].push(c[4]);for(var f,p=Object.keys(s),g=0;g<p.length;g++)for(var v=0;v<s[p[g]].length;v++)f=s[p[g]][v],isNaN(1*f)||(s[p[g]][v]=1*s[p[g]][v]);return s}function l(t){return Object.keys(t).reduce((function(e,r){return e||t[r].length>0}),!1)}function u(t,e,r,i){var a=t[i].map((function(t){return'"'+t+'": '+e[i][t].toString().replace(/^"[^"]+"/,"function")})).join(",");return n[0]+"{"+a+"}"+n[1]+'"'+r+'"'+n[2]}function c(t,e){e=e||{};var n={main:r.m},i=e.all?{main:Object.keys(n.main)}:function(t,e){for(var r={main:[e]},n={main:[]},i={main:{}};l(r);)for(var a=Object.keys(r),o=0;o<a.length;o++){var u=a[o],c=r[u].pop();if(i[u]=i[u]||{},!i[u][c]&&t[u][c]){i[u][c]=!0,n[u]=n[u]||[],n[u].push(c);for(var d=s(t,t[u][c],u),h=Object.keys(d),f=0;f<h.length;f++)r[h[f]]=r[h[f]]||[],r[h[f]]=r[h[f]].concat(d[h[f]])}}return n}(n,t),a="";Object.keys(i).filter((function(t){return"main"!==t})).forEach((function(t){for(var e=0;i[t][e];)e++;i[t].push(e),n[t][e]="(function(module, exports, __webpack_require__) { module.exports = __webpack_require__; })",a=a+"var "+t+" = ("+u(i,n,e,modules)+")();\n"})),a=a+"new (("+u(i,n,t,"main")+")())(self);";var o=new window.Blob([a],{type:"text/javascript"}),c=(window.URL||window.webkitURL||window.mozURL||window.msURL).createObjectURL(o),d=new window.Worker(c);return d.objectURL=c,d}},"./src/errors.ts":(t,e,r)=>{"use strict";var n,i;r.r(e),r.d(e,{ErrorDetails:()=>i,ErrorTypes:()=>n}),function(t){t.NETWORK_ERROR="networkError",t.MEDIA_ERROR="mediaError",t.KEY_SYSTEM_ERROR="keySystemError",t.MUX_ERROR="muxError",t.OTHER_ERROR="otherError"}(n||(n={})),function(t){t.KEY_SYSTEM_NO_KEYS="keySystemNoKeys",t.KEY_SYSTEM_NO_ACCESS="keySystemNoAccess",t.KEY_SYSTEM_NO_SESSION="keySystemNoSession",t.KEY_SYSTEM_NO_CONFIGURED_LICENSE="keySystemNoConfiguredLicense",t.KEY_SYSTEM_LICENSE_REQUEST_FAILED="keySystemLicenseRequestFailed",t.KEY_SYSTEM_SERVER_CERTIFICATE_REQUEST_FAILED="keySystemServerCertificateRequestFailed",t.KEY_SYSTEM_SERVER_CERTIFICATE_UPDATE_FAILED="keySystemServerCertificateUpdateFailed",t.KEY_SYSTEM_SESSION_UPDATE_FAILED="keySystemSessionUpdateFailed",t.KEY_SYSTEM_STATUS_OUTPUT_RESTRICTED="keySystemStatusOutputRestricted",t.KEY_SYSTEM_STATUS_INTERNAL_ERROR="keySystemStatusInternalError",t.MANIFEST_LOAD_ERROR="manifestLoadError",t.MANIFEST_LOAD_TIMEOUT="manifestLoadTimeOut",t.MANIFEST_PARSING_ERROR="manifestParsingError",t.MANIFEST_INCOMPATIBLE_CODECS_ERROR="manifestIncompatibleCodecsError",t.LEVEL_EMPTY_ERROR="levelEmptyError",t.LEVEL_LOAD_ERROR="levelLoadError",t.LEVEL_LOAD_TIMEOUT="levelLoadTimeOut",t.LEVEL_SWITCH_ERROR="levelSwitchError",t.AUDIO_TRACK_LOAD_ERROR="audioTrackLoadError",t.AUDIO_TRACK_LOAD_TIMEOUT="audioTrackLoadTimeOut",t.SUBTITLE_LOAD_ERROR="subtitleTrackLoadError",t.SUBTITLE_TRACK_LOAD_TIMEOUT="subtitleTrackLoadTimeOut",t.FRAG_LOAD_ERROR="fragLoadError",t.FRAG_LOAD_TIMEOUT="fragLoadTimeOut",t.FRAG_DECRYPT_ERROR="fragDecryptError",t.FRAG_PARSING_ERROR="fragParsingError",t.REMUX_ALLOC_ERROR="remuxAllocError",t.KEY_LOAD_ERROR="keyLoadError",t.KEY_LOAD_TIMEOUT="keyLoadTimeOut",t.BUFFER_ADD_CODEC_ERROR="bufferAddCodecError",t.BUFFER_INCOMPATIBLE_CODECS_ERROR="bufferIncompatibleCodecsError",t.BUFFER_APPEND_ERROR="bufferAppendError",t.BUFFER_APPENDING_ERROR="bufferAppendingError",t.BUFFER_STALLED_ERROR="bufferStalledError",t.BUFFER_FULL_ERROR="bufferFullError",t.BUFFER_SEEK_OVER_HOLE="bufferSeekOverHole",t.BUFFER_NUDGE_ON_STALL="bufferNudgeOnStall",t.INTERNAL_EXCEPTION="internalException",t.INTERNAL_ABORTED="aborted",t.UNKNOWN="unknown"}(i||(i={}))},"./src/events.ts":(t,e,r)=>{"use strict";var n;r.r(e),r.d(e,{Events:()=>n}),function(t){t.MEDIA_ATTACHING="hlsMediaAttaching",t.MEDIA_ATTACHED="hlsMediaAttached",t.MEDIA_DETACHING="hlsMediaDetaching",t.MEDIA_DETACHED="hlsMediaDetached",t.BUFFER_RESET="hlsBufferReset",t.BUFFER_CODECS="hlsBufferCodecs",t.BUFFER_CREATED="hlsBufferCreated",t.BUFFER_APPENDING="hlsBufferAppending",t.BUFFER_APPENDED="hlsBufferAppended",t.BUFFER_EOS="hlsBufferEos",t.BUFFER_FLUSHING="hlsBufferFlushing",t.BUFFER_FLUSHED="hlsBufferFlushed",t.MANIFEST_LOADING="hlsManifestLoading",t.MANIFEST_LOADED="hlsManifestLoaded",t.MANIFEST_PARSED="hlsManifestParsed",t.LEVEL_SWITCHING="hlsLevelSwitching",t.LEVEL_SWITCHED="hlsLevelSwitched",t.LEVEL_LOADING="hlsLevelLoading",t.LEVEL_LOADED="hlsLevelLoaded",t.LEVEL_UPDATED="hlsLevelUpdated",t.LEVEL_PTS_UPDATED="hlsLevelPtsUpdated",t.LEVELS_UPDATED="hlsLevelsUpdated",t.AUDIO_TRACKS_UPDATED="hlsAudioTracksUpdated",t.AUDIO_TRACK_SWITCHING="hlsAudioTrackSwitching",t.AUDIO_TRACK_SWITCHED="hlsAudioTrackSwitched",t.AUDIO_TRACK_LOADING="hlsAudioTrackLoading",t.AUDIO_TRACK_LOADED="hlsAudioTrackLoaded",t.SUBTITLE_TRACKS_UPDATED="hlsSubtitleTracksUpdated",t.SUBTITLE_TRACKS_CLEARED="hlsSubtitleTracksCleared",t.SUBTITLE_TRACK_SWITCH="hlsSubtitleTrackSwitch",t.SUBTITLE_TRACK_LOADING="hlsSubtitleTrackLoading",t.SUBTITLE_TRACK_LOADED="hlsSubtitleTrackLoaded",t.SUBTITLE_FRAG_PROCESSED="hlsSubtitleFragProcessed",t.CUES_PARSED="hlsCuesParsed",t.NON_NATIVE_TEXT_TRACKS_FOUND="hlsNonNativeTextTracksFound",t.INIT_PTS_FOUND="hlsInitPtsFound",t.FRAG_LOADING="hlsFragLoading",t.FRAG_LOAD_EMERGENCY_ABORTED="hlsFragLoadEmergencyAborted",t.FRAG_LOADED="hlsFragLoaded",t.FRAG_DECRYPTED="hlsFragDecrypted",t.FRAG_PARSING_INIT_SEGMENT="hlsFragParsingInitSegment",t.FRAG_PARSING_USERDATA="hlsFragParsingUserdata",t.FRAG_PARSING_METADATA="hlsFragParsingMetadata",t.FRAG_PARSED="hlsFragParsed",t.FRAG_BUFFERED="hlsFragBuffered",t.FRAG_CHANGED="hlsFragChanged",t.FPS_DROP="hlsFpsDrop",t.FPS_DROP_LEVEL_CAPPING="hlsFpsDropLevelCapping",t.ERROR="hlsError",t.DESTROYING="hlsDestroying",t.KEY_LOADING="hlsKeyLoading",t.KEY_LOADED="hlsKeyLoaded",t.LIVE_BACK_BUFFER_REACHED="hlsLiveBackBufferReached",t.BACK_BUFFER_REACHED="hlsBackBufferReached"}(n||(n={}))},"./src/hls.ts":(t,e,r)=>{"use strict";r.r(e),r.d(e,{default:()=>b});var n=r("./node_modules/url-toolkit/src/url-toolkit.js"),i=r("./src/loader/playlist-loader.ts"),a=r("./src/controller/id3-track-controller.ts"),o=r("./src/controller/latency-controller.ts"),s=r("./src/controller/level-controller.ts"),l=r("./src/controller/fragment-tracker.ts"),u=r("./src/loader/key-loader.ts"),c=r("./src/controller/stream-controller.ts"),d=r("./src/is-supported.ts"),h=r("./src/utils/logger.ts"),f=r("./src/config.ts"),p=r("./node_modules/eventemitter3/index.js"),g=r("./src/events.ts"),v=r("./src/errors.ts"),m=r("./src/types/level.ts");function y(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,(void 0,"symbol"==typeof(i=function(t,e){if("object"!=typeof t||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(n.key))?i:String(i)),n)}var i}var b=function(){function t(e){void 0===e&&(e={}),this.config=void 0,this.userConfig=void 0,this.coreComponents=void 0,this.networkControllers=void 0,this._emitter=new p.EventEmitter,this._autoLevelCapping=void 0,this._maxHdcpLevel=null,this.abrController=void 0,this.bufferController=void 0,this.capLevelController=void 0,this.latencyController=void 0,this.levelController=void 0,this.streamController=void 0,this.audioTrackController=void 0,this.subtitleTrackController=void 0,this.emeController=void 0,this.cmcdController=void 0,this._media=null,this.url=null;var r=this.config=(0,f.mergeConfig)(t.DefaultConfig,e);this.userConfig=e,(0,h.enableLogs)(r.debug,"Hls instance"),this._autoLevelCapping=-1,r.progressive&&(0,f.enableStreamingMode)(r);var n=r.abrController,d=r.bufferController,g=r.capLevelController,v=r.fpsController,m=this.abrController=new n(this),y=this.bufferController=new d(this),b=this.capLevelController=new g(this),E=new v(this),x=new i.default(this),S=new a.default(this),T=this.levelController=new s.default(this),w=new l.FragmentTracker(this),_=new u.default(this.config),A=this.streamController=new c.default(this,w,_);b.setStreamController(A),E.setStreamController(A);var k=[x,T,A];this.networkControllers=k;var C=[m,y,b,E,S,w];this.audioTrackController=this.createController(r.audioTrackController,k);var D=r.audioStreamController;D&&k.push(new D(this,w,_)),this.subtitleTrackController=this.createController(r.subtitleTrackController,k);var L=r.subtitleStreamController;L&&k.push(new L(this,w,_)),this.createController(r.timelineController,C),_.emeController=this.emeController=this.createController(r.emeController,C),this.cmcdController=this.createController(r.cmcdController,C),this.latencyController=this.createController(o.default,C),this.coreComponents=C}t.isSupported=function(){return(0,d.isSupported)()};var e,r,b,E=t.prototype;return E.createController=function(t,e){if(t){var r=new t(this);return e&&e.push(r),r}return null},E.on=function(t,e,r){void 0===r&&(r=this),this._emitter.on(t,e,r)},E.once=function(t,e,r){void 0===r&&(r=this),this._emitter.once(t,e,r)},E.removeAllListeners=function(t){this._emitter.removeAllListeners(t)},E.off=function(t,e,r,n){void 0===r&&(r=this),this._emitter.off(t,e,r,n)},E.listeners=function(t){return this._emitter.listeners(t)},E.emit=function(t,e,r){return this._emitter.emit(t,e,r)},E.trigger=function(t,e){if(this.config.debug)return this.emit(t,t,e);try{return this.emit(t,t,e)}catch(e){h.logger.error("An internal error happened while handling event "+t+'. Error message: "'+e.message+'". Here is a stacktrace:',e),this.trigger(g.Events.ERROR,{type:v.ErrorTypes.OTHER_ERROR,details:v.ErrorDetails.INTERNAL_EXCEPTION,fatal:!1,event:t,error:e})}return!1},E.listenerCount=function(t){return this._emitter.listenerCount(t)},E.destroy=function(){h.logger.log("destroy"),this.trigger(g.Events.DESTROYING,void 0),this.detachMedia(),this.removeAllListeners(),this._autoLevelCapping=-1,this.url=null,this.networkControllers.forEach((function(t){return t.destroy()})),this.networkControllers.length=0,this.coreComponents.forEach((function(t){return t.destroy()})),this.coreComponents.length=0},E.attachMedia=function(t){h.logger.log("attachMedia"),this._media=t,this.trigger(g.Events.MEDIA_ATTACHING,{media:t})},E.detachMedia=function(){h.logger.log("detachMedia"),this.trigger(g.Events.MEDIA_DETACHING,void 0),this._media=null},E.loadSource=function(t){this.stopLoad();var e=this.media,r=this.url,i=this.url=n.buildAbsoluteURL(self.location.href,t,{alwaysNormalize:!0});h.logger.log("loadSource:"+i),e&&r&&r!==i&&this.bufferController.hasSourceTypes()&&(this.detachMedia(),this.attachMedia(e)),this.trigger(g.Events.MANIFEST_LOADING,{url:t})},E.startLoad=function(t){void 0===t&&(t=-1),h.logger.log("startLoad("+t+")"),this.networkControllers.forEach((function(e){e.startLoad(t)}))},E.stopLoad=function(){h.logger.log("stopLoad"),this.networkControllers.forEach((function(t){t.stopLoad()}))},E.swapAudioCodec=function(){h.logger.log("swapAudioCodec"),this.streamController.swapAudioCodec()},E.recoverMediaError=function(){h.logger.log("recoverMediaError");var t=this._media;this.detachMedia(),t&&this.attachMedia(t)},E.removeLevel=function(t,e){void 0===e&&(e=0),this.levelController.removeLevel(t,e)},e=t,b=[{key:"version",get:function(){return"1.3.1"}},{key:"Events",get:function(){return g.Events}},{key:"ErrorTypes",get:function(){return v.ErrorTypes}},{key:"ErrorDetails",get:function(){return v.ErrorDetails}},{key:"DefaultConfig",get:function(){return t.defaultConfig?t.defaultConfig:f.hlsDefaultConfig},set:function(e){t.defaultConfig=e}}],(r=[{key:"levels",get:function(){return this.levelController.levels||[]}},{key:"currentLevel",get:function(){return this.streamController.currentLevel},set:function(t){h.logger.log("set currentLevel:"+t),this.loadLevel=t,this.abrController.clearTimer(),this.streamController.immediateLevelSwitch()}},{key:"nextLevel",get:function(){return this.streamController.nextLevel},set:function(t){h.logger.log("set nextLevel:"+t),this.levelController.manualLevel=t,this.streamController.nextLevelSwitch()}},{key:"loadLevel",get:function(){return this.levelController.level},set:function(t){h.logger.log("set loadLevel:"+t),this.levelController.manualLevel=t}},{key:"nextLoadLevel",get:function(){return this.levelController.nextLoadLevel},set:function(t){this.levelController.nextLoadLevel=t}},{key:"firstLevel",get:function(){return Math.max(this.levelController.firstLevel,this.minAutoLevel)},set:function(t){h.logger.log("set firstLevel:"+t),this.levelController.firstLevel=t}},{key:"startLevel",get:function(){return this.levelController.startLevel},set:function(t){h.logger.log("set startLevel:"+t),-1!==t&&(t=Math.max(t,this.minAutoLevel)),this.levelController.startLevel=t}},{key:"capLevelToPlayerSize",get:function(){return this.config.capLevelToPlayerSize},set:function(t){var e=!!t;e!==this.config.capLevelToPlayerSize&&(e?this.capLevelController.startCapping():(this.capLevelController.stopCapping(),this.autoLevelCapping=-1,this.streamController.nextLevelSwitch()),this.config.capLevelToPlayerSize=e)}},{key:"autoLevelCapping",get:function(){return this._autoLevelCapping},set:function(t){this._autoLevelCapping!==t&&(h.logger.log("set autoLevelCapping:"+t),this._autoLevelCapping=t)}},{key:"bandwidthEstimate",get:function(){var t=this.abrController.bwEstimator;return t?t.getEstimate():NaN}},{key:"maxHdcpLevel",get:function(){return this._maxHdcpLevel},set:function(t){m.HdcpLevels.indexOf(t)>-1&&(this._maxHdcpLevel=t)}},{key:"autoLevelEnabled",get:function(){return-1===this.levelController.manualLevel}},{key:"manualLevel",get:function(){return this.levelController.manualLevel}},{key:"minAutoLevel",get:function(){var t=this.levels,e=this.config.minAutoBitrate;if(!t)return 0;for(var r=t.length,n=0;n<r;n++)if(t[n].maxBitrate>=e)return n;return 0}},{key:"maxAutoLevel",get:function(){var t,e=this.levels,r=this.autoLevelCapping,n=this.maxHdcpLevel;if(t=-1===r&&e&&e.length?e.length-1:r,n)for(var i=t;i--;){var a=e[i].attrs["HDCP-LEVEL"];if(a&&a<=n)return i}return t}},{key:"nextAutoLevel",get:function(){return Math.min(Math.max(this.abrController.nextAutoLevel,this.minAutoLevel),this.maxAutoLevel)},set:function(t){this.abrController.nextAutoLevel=Math.max(this.minAutoLevel,t)}},{key:"playingDate",get:function(){return this.streamController.currentProgramDateTime}},{key:"mainForwardBufferInfo",get:function(){return this.streamController.getMainFwdBufferInfo()}},{key:"audioTracks",get:function(){var t=this.audioTrackController;return t?t.audioTracks:[]}},{key:"audioTrack",get:function(){var t=this.audioTrackController;return t?t.audioTrack:-1},set:function(t){var e=this.audioTrackController;e&&(e.audioTrack=t)}},{key:"subtitleTracks",get:function(){var t=this.subtitleTrackController;return t?t.subtitleTracks:[]}},{key:"subtitleTrack",get:function(){var t=this.subtitleTrackController;return t?t.subtitleTrack:-1},set:function(t){var e=this.subtitleTrackController;e&&(e.subtitleTrack=t)}},{key:"media",get:function(){return this._media}},{key:"subtitleDisplay",get:function(){var t=this.subtitleTrackController;return!!t&&t.subtitleDisplay},set:function(t){var e=this.subtitleTrackController;e&&(e.subtitleDisplay=t)}},{key:"lowLatencyMode",get:function(){return this.config.lowLatencyMode},set:function(t){this.config.lowLatencyMode=t}},{key:"liveSyncPosition",get:function(){return this.latencyController.liveSyncPosition}},{key:"latency",get:function(){return this.latencyController.latency}},{key:"maxLatency",get:function(){return this.latencyController.maxLatency}},{key:"targetLatency",get:function(){return this.latencyController.targetLatency}},{key:"drift",get:function(){return this.latencyController.drift}},{key:"forceStartLoad",get:function(){return this.streamController.forceStartLoad}}])&&y(e.prototype,r),b&&y(e,b),Object.defineProperty(e,"prototype",{writable:!1}),t}();b.defaultConfig=void 0},"./src/is-supported.ts":(t,e,r)=>{"use strict";r.r(e),r.d(e,{changeTypeSupported:()=>o,isSupported:()=>a});var n=r("./src/utils/mediasource-helper.ts");function i(){return self.SourceBuffer||self.WebKitSourceBuffer}function a(){var t=(0,n.getMediaSource)();if(!t)return!1;var e=i(),r=t&&"function"==typeof t.isTypeSupported&&t.isTypeSupported('video/mp4; codecs="avc1.42E01E,mp4a.40.2"'),a=!e||e.prototype&&"function"==typeof e.prototype.appendBuffer&&"function"==typeof e.prototype.remove;return!!r&&!!a}function o(){var t,e=i();return"function"==typeof(null==e||null===(t=e.prototype)||void 0===t?void 0:t.changeType)}},"./src/loader/date-range.ts":(t,e,r)=>{"use strict";r.r(e),r.d(e,{DateRange:()=>u,DateRangeAttribute:()=>n});var n,i=r("./src/polyfills/number.ts"),a=r("./src/utils/attr-list.ts"),o=r("./src/utils/logger.ts");function s(){return s=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(t[n]=r[n])}return t},s.apply(this,arguments)}function l(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,(void 0,"symbol"==typeof(i=function(t,e){if("object"!=typeof t||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(n.key))?i:String(i)),n)}var i}!function(t){t.ID="ID",t.CLASS="CLASS",t.START_DATE="START-DATE",t.DURATION="DURATION",t.END_DATE="END-DATE",t.END_ON_NEXT="END-ON-NEXT",t.PLANNED_DURATION="PLANNED-DURATION",t.SCTE35_OUT="SCTE35-OUT",t.SCTE35_IN="SCTE35-IN"}(n||(n={}));var u=function(){function t(t,e){if(this.attr=void 0,this._startDate=void 0,this._endDate=void 0,this._badValueForSameId=void 0,e){var r=e.attr;for(var l in r)if(Object.prototype.hasOwnProperty.call(t,l)&&t[l]!==r[l]){o.logger.warn('DATERANGE tag attribute: "'+l+'" does not match for tags with ID: "'+t.ID+'"'),this._badValueForSameId=l;break}t=s(new a.AttrList({}),r,t)}if(this.attr=t,this._startDate=new Date(t[n.START_DATE]),n.END_DATE in this.attr){var u=new Date(this.attr[n.END_DATE]);(0,i.isFiniteNumber)(u.getTime())&&(this._endDate=u)}}var e,r;return e=t,(r=[{key:"id",get:function(){return this.attr.ID}},{key:"class",get:function(){return this.attr.CLASS}},{key:"startDate",get:function(){return this._startDate}},{key:"endDate",get:function(){if(this._endDate)return this._endDate;var t=this.duration;return null!==t?new Date(this._startDate.getTime()+1e3*t):null}},{key:"duration",get:function(){if(n.DURATION in this.attr){var t=this.attr.decimalFloatingPoint(n.DURATION);if((0,i.isFiniteNumber)(t))return t}else if(this._endDate)return(this._endDate.getTime()-this._startDate.getTime())/1e3;return null}},{key:"plannedDuration",get:function(){return n.PLANNED_DURATION in this.attr?this.attr.decimalFloatingPoint(n.PLANNED_DURATION):null}},{key:"endOnNext",get:function(){return this.attr.bool(n.END_ON_NEXT)}},{key:"isValid",get:function(){return!!this.id&&!this._badValueForSameId&&(0,i.isFiniteNumber)(this.startDate.getTime())&&(null===this.duration||this.duration>=0)&&(!this.endOnNext||!!this.class)}}])&&l(e.prototype,r),Object.defineProperty(e,"prototype",{writable:!1}),t}()},"./src/loader/fragment-loader.ts":(t,e,r)=>{"use strict";r.r(e),r.d(e,{LoadError:()=>f,default:()=>d});var n=r("./src/polyfills/number.ts"),i=r("./src/errors.ts");function a(t){var e="function"==typeof Map?new Map:void 0;return a=function(t){if(null===t||(r=t,-1===Function.toString.call(r).indexOf("[native code]")))return t;var r;if("function"!=typeof t)throw new TypeError("Super expression must either be null or a function");if(void 0!==e){if(e.has(t))return e.get(t);e.set(t,n)}function n(){return o(t,arguments,u(this).constructor)}return n.prototype=Object.create(t.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),l(n,t)},a(t)}function o(t,e,r){return o=s()?Reflect.construct.bind():function(t,e,r){var n=[null];n.push.apply(n,e);var i=new(Function.bind.apply(t,n));return r&&l(i,r.prototype),i},o.apply(null,arguments)}function s(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}function l(t,e){return l=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},l(t,e)}function u(t){return u=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},u(t)}var c=Math.pow(2,17),d=function(){function t(t){this.config=void 0,this.loader=null,this.partLoadTimeout=-1,this.config=t}var e=t.prototype;return e.destroy=function(){this.loader&&(this.loader.destroy(),this.loader=null)},e.abort=function(){this.loader&&this.loader.abort()},e.load=function(t,e){var r=this,n=t.url;if(!n)return Promise.reject(new f({type:i.ErrorTypes.NETWORK_ERROR,details:i.ErrorDetails.FRAG_LOAD_ERROR,fatal:!1,frag:t,networkDetails:null},"Fragment does not have a "+(n?"part list":"url")));this.abort();var a=this.config,o=a.fLoader,s=a.loader;return new Promise((function(n,l){r.loader&&r.loader.destroy();var u=r.loader=t.loader=o?new o(a):new s(a),d=h(t),p={timeout:a.fragLoadingTimeOut,maxRetry:0,retryDelay:0,maxRetryDelay:a.fragLoadingMaxRetryTimeout,highWaterMark:"initSegment"===t.sn?1/0:c};t.stats=u.stats,u.load(d,p,{onSuccess:function(e,i,a,o){r.resetLoader(t,u);var s=e.data;a.resetIV&&t.decryptdata&&(t.decryptdata.iv=new Uint8Array(s.slice(0,16)),s=s.slice(16)),n({frag:t,part:null,payload:s,networkDetails:o})},onError:function(e,n,a){r.resetLoader(t,u),l(new f({type:i.ErrorTypes.NETWORK_ERROR,details:i.ErrorDetails.FRAG_LOAD_ERROR,fatal:!1,frag:t,response:e,networkDetails:a}))},onAbort:function(e,n,a){r.resetLoader(t,u),l(new f({type:i.ErrorTypes.NETWORK_ERROR,details:i.ErrorDetails.INTERNAL_ABORTED,fatal:!1,frag:t,networkDetails:a}))},onTimeout:function(e,n,a){r.resetLoader(t,u),l(new f({type:i.ErrorTypes.NETWORK_ERROR,details:i.ErrorDetails.FRAG_LOAD_TIMEOUT,fatal:!1,frag:t,networkDetails:a}))},onProgress:function(r,n,i,a){e&&e({frag:t,part:null,payload:i,networkDetails:a})}})}))},e.loadPart=function(t,e,r){var n=this;this.abort();var a=this.config,o=a.fLoader,s=a.loader;return new Promise((function(l,u){n.loader&&n.loader.destroy();var d=n.loader=t.loader=o?new o(a):new s(a),p=h(t,e),g={timeout:a.fragLoadingTimeOut,maxRetry:0,retryDelay:0,maxRetryDelay:a.fragLoadingMaxRetryTimeout,highWaterMark:c};e.stats=d.stats,d.load(p,g,{onSuccess:function(i,a,o,s){n.resetLoader(t,d),n.updateStatsFromPart(t,e);var u={frag:t,part:e,payload:i.data,networkDetails:s};r(u),l(u)},onError:function(r,a,o){n.resetLoader(t,d),u(new f({type:i.ErrorTypes.NETWORK_ERROR,details:i.ErrorDetails.FRAG_LOAD_ERROR,fatal:!1,frag:t,part:e,response:r,networkDetails:o}))},onAbort:function(r,a,o){t.stats.aborted=e.stats.aborted,n.resetLoader(t,d),u(new f({type:i.ErrorTypes.NETWORK_ERROR,details:i.ErrorDetails.INTERNAL_ABORTED,fatal:!1,frag:t,part:e,networkDetails:o}))},onTimeout:function(r,a,o){n.resetLoader(t,d),u(new f({type:i.ErrorTypes.NETWORK_ERROR,details:i.ErrorDetails.FRAG_LOAD_TIMEOUT,fatal:!1,frag:t,part:e,networkDetails:o}))}})}))},e.updateStatsFromPart=function(t,e){var r=t.stats,n=e.stats,i=n.total;if(r.loaded+=n.loaded,i){var a=Math.round(t.duration/e.duration),o=Math.min(Math.round(r.loaded/i),a),s=(a-o)*Math.round(r.loaded/o);r.total=r.loaded+s}else r.total=Math.max(r.loaded,r.total);var l=r.loading,u=n.loading;l.start?l.first+=u.first-u.start:(l.start=u.start,l.first=u.first),l.end=u.end},e.resetLoader=function(t,e){t.loader=null,this.loader===e&&(self.clearTimeout(this.partLoadTimeout),this.loader=null),e.destroy()},t}();function h(t,e){void 0===e&&(e=null);var r=e||t,i={frag:t,part:e,responseType:"arraybuffer",url:r.url,headers:{},rangeStart:0,rangeEnd:0},a=r.byteRangeStartOffset,o=r.byteRangeEndOffset;if((0,n.isFiniteNumber)(a)&&(0,n.isFiniteNumber)(o)){var s,l=a,u=o;if("initSegment"===t.sn&&"AES-128"===(null===(s=t.decryptdata)||void 0===s?void 0:s.method)){var c=o-a;c%16&&(u=o+(16-c%16)),0!==a&&(i.resetIV=!0,l=a-16)}i.rangeStart=l,i.rangeEnd=u}return i}var f=function(t){var e,r;function n(e){for(var r,n=arguments.length,i=new Array(n>1?n-1:0),a=1;a<n;a++)i[a-1]=arguments[a];return(r=t.call.apply(t,[this].concat(i))||this).data=void 0,r.data=e,r}return r=t,(e=n).prototype=Object.create(r.prototype),e.prototype.constructor=e,l(e,r),n}(a(Error))},"./src/loader/fragment.ts":(t,e,r)=>{"use strict";r.r(e),r.d(e,{BaseSegment:()=>d,ElementaryStreamTypes:()=>n,Fragment:()=>h,Part:()=>f});var n,i=r("./src/polyfills/number.ts"),a=r("./node_modules/url-toolkit/src/url-toolkit.js"),o=r("./src/loader/load-stats.ts");function s(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,l(t,e)}function l(t,e){return l=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},l(t,e)}function u(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,(void 0,"symbol"==typeof(i=function(t,e){if("object"!=typeof t||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(n.key))?i:String(i)),n)}var i}function c(t,e,r){return e&&u(t.prototype,e),r&&u(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}!function(t){t.AUDIO="audio",t.VIDEO="video",t.AUDIOVIDEO="audiovideo"}(n||(n={}));var d=function(){function t(t){var e;this._byteRange=null,this._url=null,this.baseurl=void 0,this.relurl=void 0,this.elementaryStreams=((e={})[n.AUDIO]=null,e[n.VIDEO]=null,e[n.AUDIOVIDEO]=null,e),this.baseurl=t}return t.prototype.setByteRange=function(t,e){var r=t.split("@",2),n=[];1===r.length?n[0]=e?e.byteRangeEndOffset:0:n[0]=parseInt(r[1]),n[1]=parseInt(r[0])+n[0],this._byteRange=n},c(t,[{key:"byteRange",get:function(){return this._byteRange?this._byteRange:[]}},{key:"byteRangeStartOffset",get:function(){return this.byteRange[0]}},{key:"byteRangeEndOffset",get:function(){return this.byteRange[1]}},{key:"url",get:function(){return!this._url&&this.baseurl&&this.relurl&&(this._url=(0,a.buildAbsoluteURL)(this.baseurl,this.relurl,{alwaysNormalize:!0})),this._url||""},set:function(t){this._url=t}}]),t}(),h=function(t){function e(e,r){var n;return(n=t.call(this,r)||this)._decryptdata=null,n.rawProgramDateTime=null,n.programDateTime=null,n.tagList=[],n.duration=0,n.sn=0,n.levelkeys=void 0,n.type=void 0,n.loader=null,n.keyLoader=null,n.level=-1,n.cc=0,n.startPTS=void 0,n.endPTS=void 0,n.appendedPTS=void 0,n.startDTS=void 0,n.endDTS=void 0,n.start=0,n.deltaPTS=void 0,n.maxStartPTS=void 0,n.minEndPTS=void 0,n.stats=new o.LoadStats,n.urlId=0,n.data=void 0,n.bitrateTest=!1,n.title=null,n.initSegment=null,n.endList=void 0,n.type=e,n}s(e,t);var r=e.prototype;return r.setKeyFormat=function(t){if(this.levelkeys){var e=this.levelkeys[t];e&&!this._decryptdata&&(this._decryptdata=e.getDecryptData(this.sn))}},r.abortRequests=function(){var t,e;null===(t=this.loader)||void 0===t||t.abort(),null===(e=this.keyLoader)||void 0===e||e.abort()},r.setElementaryStreamInfo=function(t,e,r,n,i,a){void 0===a&&(a=!1);var o=this.elementaryStreams,s=o[t];s?(s.startPTS=Math.min(s.startPTS,e),s.endPTS=Math.max(s.endPTS,r),s.startDTS=Math.min(s.startDTS,n),s.endDTS=Math.max(s.endDTS,i)):o[t]={startPTS:e,endPTS:r,startDTS:n,endDTS:i,partial:a}},r.clearElementaryStreamInfo=function(){var t=this.elementaryStreams;t[n.AUDIO]=null,t[n.VIDEO]=null,t[n.AUDIOVIDEO]=null},c(e,[{key:"decryptdata",get:function(){if(!this.levelkeys&&!this._decryptdata)return null;if(!this._decryptdata&&this.levelkeys&&!this.levelkeys.NONE){var t=this.levelkeys.identity;if(t)this._decryptdata=t.getDecryptData(this.sn);else{var e=Object.keys(this.levelkeys);if(1===e.length)return this._decryptdata=this.levelkeys[e[0]].getDecryptData(this.sn)}}return this._decryptdata}},{key:"end",get:function(){return this.start+this.duration}},{key:"endProgramDateTime",get:function(){if(null===this.programDateTime)return null;if(!(0,i.isFiniteNumber)(this.programDateTime))return null;var t=(0,i.isFiniteNumber)(this.duration)?this.duration:0;return this.programDateTime+1e3*t}},{key:"encrypted",get:function(){var t;if(null!==(t=this._decryptdata)&&void 0!==t&&t.encrypted)return!0;if(this.levelkeys){var e=Object.keys(this.levelkeys),r=e.length;if(r>1||1===r&&this.levelkeys[e[0]].encrypted)return!0}return!1}}]),e}(d),f=function(t){function e(e,r,n,i,a){var s;(s=t.call(this,n)||this).fragOffset=0,s.duration=0,s.gap=!1,s.independent=!1,s.relurl=void 0,s.fragment=void 0,s.index=void 0,s.stats=new o.LoadStats,s.duration=e.decimalFloatingPoint("DURATION"),s.gap=e.bool("GAP"),s.independent=e.bool("INDEPENDENT"),s.relurl=e.enumeratedString("URI"),s.fragment=r,s.index=i;var l=e.enumeratedString("BYTERANGE");return l&&s.setByteRange(l,a),a&&(s.fragOffset=a.fragOffset+a.duration),s}return s(e,t),c(e,[{key:"start",get:function(){return this.fragment.start+this.fragOffset}},{key:"end",get:function(){return this.start+this.duration}},{key:"loaded",get:function(){var t=this.elementaryStreams;return!!(t.audio||t.video||t.audiovideo)}}]),e}(d)},"./src/loader/key-loader.ts":(t,e,r)=>{"use strict";r.r(e),r.d(e,{default:()=>a});var n=r("./src/errors.ts"),i=r("./src/loader/fragment-loader.ts"),a=function(){function t(t){this.config=void 0,this.keyUriToKeyInfo={},this.emeController=null,this.config=t}var e=t.prototype;return e.abort=function(){for(var t in this.keyUriToKeyInfo){var e=this.keyUriToKeyInfo[t].loader;e&&e.abort()}},e.detach=function(){for(var t in this.keyUriToKeyInfo){var e=this.keyUriToKeyInfo[t];(e.mediaKeySessionContext||e.decryptdata.isCommonEncryption)&&delete this.keyUriToKeyInfo[t]}},e.destroy=function(){for(var t in this.detach(),this.keyUriToKeyInfo){var e=this.keyUriToKeyInfo[t].loader;e&&e.destroy()}this.keyUriToKeyInfo={}},e.createKeyLoadError=function(t,e,r,a){return void 0===e&&(e=n.ErrorDetails.KEY_LOAD_ERROR),new i.LoadError({type:n.ErrorTypes.NETWORK_ERROR,details:e,fatal:!1,frag:t,networkDetails:r})},e.loadClear=function(t,e){var r=this;if(this.emeController&&this.config.emeEnabled)for(var n=t.sn,i=t.cc,a=function(t){var a=e[t];if(i<=a.cc&&("initSegment"===n||n<a.sn))return r.emeController.selectKeySystemFormat(a).then((function(t){a.setKeyFormat(t)})),"break"},o=0;o<e.length&&"break"!==a(o);o++);},e.load=function(t){var e=this;return!t.decryptdata&&t.encrypted&&this.emeController?this.emeController.selectKeySystemFormat(t).then((function(r){return e.loadInternal(t,r)})):this.loadInternal(t)},e.loadInternal=function(t,e){var r,i;e&&t.setKeyFormat(e);var a=t.decryptdata;if(!a){var o=e?"Expected frag.decryptdata to be defined after setting format "+e:"Missing decryption data on fragment in onKeyLoading";return Promise.reject(this.createKeyLoadError(t,n.ErrorDetails.KEY_LOAD_ERROR,null,o))}var s=a.uri;if(!s)return Promise.reject(this.createKeyLoadError(t,n.ErrorDetails.KEY_LOAD_ERROR,null,'Invalid key URI: "'+s+'"'));var l,u=this.keyUriToKeyInfo[s];if(null!==(r=u)&&void 0!==r&&r.decryptdata.key)return a.key=u.decryptdata.key,Promise.resolve({frag:t,keyInfo:u});if(null!==(i=u)&&void 0!==i&&i.keyLoadPromise)switch(null===(l=u.mediaKeySessionContext)||void 0===l?void 0:l.keyStatus){case void 0:case"status-pending":case"usable":case"usable-in-future":return u.keyLoadPromise}switch(u=this.keyUriToKeyInfo[s]={decryptdata:a,keyLoadPromise:null,loader:null,mediaKeySessionContext:null},a.method){case"ISO-23001-7":case"SAMPLE-AES":case"SAMPLE-AES-CENC":case"SAMPLE-AES-CTR":return"identity"===a.keyFormat?this.loadKeyHTTP(u,t):this.loadKeyEME(u,t);case"AES-128":return this.loadKeyHTTP(u,t);default:return Promise.reject(this.createKeyLoadError(t,n.ErrorDetails.KEY_LOAD_ERROR,null,'Key supplied with unsupported METHOD: "'+a.method+'"'))}},e.loadKeyEME=function(t,e){var r={frag:e,keyInfo:t};if(this.emeController&&this.config.emeEnabled){var n=this.emeController.loadKey(r);if(n)return(t.keyLoadPromise=n.then((function(e){return t.mediaKeySessionContext=e,r}))).catch((function(e){throw t.keyLoadPromise=null,e}))}return Promise.resolve(r)},e.loadKeyHTTP=function(t,e){var r=this,i=this.config,a=new(0,i.loader)(i);return e.keyLoader=t.loader=a,t.keyLoadPromise=new Promise((function(o,s){var l={keyInfo:t,frag:e,responseType:"arraybuffer",url:t.decryptdata.uri},u={timeout:i.fragLoadingTimeOut,maxRetry:0,retryDelay:i.fragLoadingRetryDelay,maxRetryDelay:i.fragLoadingMaxRetryTimeout,highWaterMark:0},c={onSuccess:function(t,e,i,a){var l=i.frag,u=i.keyInfo,c=i.url;if(!l.decryptdata||u!==r.keyUriToKeyInfo[c])return s(r.createKeyLoadError(l,n.ErrorDetails.KEY_LOAD_ERROR,a,"after key load, decryptdata unset or changed"));u.decryptdata.key=l.decryptdata.key=new Uint8Array(t.data),l.keyLoader=null,u.loader=null,o({frag:l,keyInfo:u})},onError:function(t,i,a){r.resetLoader(i),s(r.createKeyLoadError(e,n.ErrorDetails.KEY_LOAD_ERROR,a))},onTimeout:function(t,i,a){r.resetLoader(i),s(r.createKeyLoadError(e,n.ErrorDetails.KEY_LOAD_TIMEOUT,a))},onAbort:function(t,i,a){r.resetLoader(i),s(r.createKeyLoadError(e,n.ErrorDetails.INTERNAL_ABORTED,a))}};a.load(l,u,c)}))},e.resetLoader=function(t){var e=t.frag,r=t.keyInfo,n=t.url,i=r.loader;e.keyLoader===i&&(e.keyLoader=null,r.loader=null),delete this.keyUriToKeyInfo[n],i&&i.destroy()},t}()},"./src/loader/level-details.ts":(t,e,r)=>{"use strict";r.r(e),r.d(e,{LevelDetails:()=>a});var n=r("./src/polyfills/number.ts");function i(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,(void 0,"symbol"==typeof(i=function(t,e){if("object"!=typeof t||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(n.key))?i:String(i)),n)}var i}var a=function(){function t(t){this.PTSKnown=!1,this.alignedSliding=!1,this.averagetargetduration=void 0,this.endCC=0,this.endSN=0,this.fragments=void 0,this.fragmentHint=void 0,this.partList=null,this.dateRanges=void 0,this.live=!0,this.ageHeader=0,this.advancedDateTime=void 0,this.updated=!0,this.advanced=!0,this.availabilityDelay=void 0,this.misses=0,this.startCC=0,this.startSN=0,this.startTimeOffset=null,this.targetduration=0,this.totalduration=0,this.type=null,this.url=void 0,this.m3u8="",this.version=null,this.canBlockReload=!1,this.canSkipUntil=0,this.canSkipDateRanges=!1,this.skippedSegments=0,this.recentlyRemovedDateranges=void 0,this.partHoldBack=0,this.holdBack=0,this.partTarget=0,this.preloadHint=void 0,this.renditionReports=void 0,this.tuneInGoal=0,this.deltaUpdateFailed=void 0,this.driftStartTime=0,this.driftEndTime=0,this.driftStart=0,this.driftEnd=0,this.encryptedFragments=void 0,this.fragments=[],this.encryptedFragments=[],this.dateRanges={},this.url=t}var e,r;return t.prototype.reloaded=function(t){if(!t)return this.advanced=!0,void(this.updated=!0);var e=this.lastPartSn-t.lastPartSn,r=this.lastPartIndex-t.lastPartIndex;this.updated=this.endSN!==t.endSN||!!r||!!e,this.advanced=this.endSN>t.endSN||e>0||0===e&&r>0,this.updated||this.advanced?this.misses=Math.floor(.6*t.misses):this.misses=t.misses+1,this.availabilityDelay=t.availabilityDelay},e=t,(r=[{key:"hasProgramDateTime",get:function(){return!!this.fragments.length&&(0,n.isFiniteNumber)(this.fragments[this.fragments.length-1].programDateTime)}},{key:"levelTargetDuration",get:function(){return this.averagetargetduration||this.targetduration||10}},{key:"drift",get:function(){var t=this.driftEndTime-this.driftStartTime;return t>0?1e3*(this.driftEnd-this.driftStart)/t:1}},{key:"edge",get:function(){return this.partEnd||this.fragmentEnd}},{key:"partEnd",get:function(){var t;return null!==(t=this.partList)&&void 0!==t&&t.length?this.partList[this.partList.length-1].end:this.fragmentEnd}},{key:"fragmentEnd",get:function(){var t;return null!==(t=this.fragments)&&void 0!==t&&t.length?this.fragments[this.fragments.length-1].end:0}},{key:"age",get:function(){return this.advancedDateTime?Math.max(Date.now()-this.advancedDateTime,0)/1e3:0}},{key:"lastPartIndex",get:function(){var t;return null!==(t=this.partList)&&void 0!==t&&t.length?this.partList[this.partList.length-1].index:-1}},{key:"lastPartSn",get:function(){var t;return null!==(t=this.partList)&&void 0!==t&&t.length?this.partList[this.partList.length-1].fragment.sn:this.endSN}}])&&i(e.prototype,r),Object.defineProperty(e,"prototype",{writable:!1}),t}()},"./src/loader/level-key.ts":(t,e,r)=>{"use strict";r.r(e),r.d(e,{LevelKey:()=>u});var n=r("./src/utils/keysystem-util.ts"),i=r("./src/utils/mediakeys-helper.ts"),a=r("./src/utils/mp4-tools.ts"),o=r("./src/utils/logger.ts"),s=r("./src/utils/numeric-encoding-utils.ts"),l={},u=function(){function t(t,e,r,n,i){void 0===n&&(n=[1]),void 0===i&&(i=null),this.uri=void 0,this.method=void 0,this.keyFormat=void 0,this.keyFormatVersions=void 0,this.encrypted=void 0,this.isCommonEncryption=void 0,this.iv=null,this.key=null,this.keyId=null,this.pssh=null,this.method=t,this.uri=e,this.keyFormat=r,this.keyFormatVersions=n,this.iv=i,this.encrypted=!!t&&"NONE"!==t,this.isCommonEncryption=this.encrypted&&"AES-128"!==t}t.clearKeyUriToKeyIdMap=function(){l={}};var e=t.prototype;return e.isSupported=function(){if(this.method){if("AES-128"===this.method||"NONE"===this.method)return!0;switch(this.keyFormat){case"identity":return"SAMPLE-AES"===this.method;case i.KeySystemFormats.FAIRPLAY:case i.KeySystemFormats.WIDEVINE:case i.KeySystemFormats.PLAYREADY:case i.KeySystemFormats.CLEARKEY:return-1!==["ISO-23001-7","SAMPLE-AES","SAMPLE-AES-CENC","SAMPLE-AES-CTR"].indexOf(this.method)}}return!1},e.getDecryptData=function(e){if(!this.encrypted||!this.uri)return null;if("AES-128"===this.method&&this.uri&&!this.iv){"number"!=typeof e&&("AES-128"!==this.method||this.iv||o.logger.warn('missing IV for initialization segment with method="'+this.method+'" - compliance issue'),e=0);var r=function(t){for(var e=new Uint8Array(16),r=12;r<16;r++)e[r]=t>>8*(15-r)&255;return e}(e);return new t(this.method,this.uri,"identity",this.keyFormatVersions,r)}var u=(0,n.convertDataUriToArrayBytes)(this.uri);if(u)switch(this.keyFormat){case i.KeySystemFormats.WIDEVINE:this.pssh=u,u.length>=22&&(this.keyId=u.subarray(u.length-22,u.length-6));break;case i.KeySystemFormats.PLAYREADY:var c=new Uint8Array([154,4,240,121,152,64,66,134,171,146,230,91,224,136,95,149]);this.pssh=(0,a.mp4pssh)(c,null,u);var d=new Uint16Array(u.buffer,u.byteOffset,u.byteLength/2),h=String.fromCharCode.apply(null,Array.from(d)),f=h.substring(h.indexOf("<"),h.length),p=(new DOMParser).parseFromString(f,"text/xml").getElementsByTagName("KID")[0];if(p){var g=p.childNodes[0]?p.childNodes[0].nodeValue:p.getAttribute("VALUE");if(g){var v=(0,s.base64Decode)(g).subarray(0,16);(0,n.changeEndianness)(v),this.keyId=v}}break;default:var m=u.subarray(0,16);if(16!==m.length){var y=new Uint8Array(16);y.set(m,16-m.length),m=y}this.keyId=m}if(!this.keyId||16!==this.keyId.byteLength){var b=l[this.uri];if(!b){var E=Object.keys(l).length%Number.MAX_SAFE_INTEGER;b=new Uint8Array(16),new DataView(b.buffer,12,4).setUint32(0,E),l[this.uri]=b}this.keyId=b}return this},t}()},"./src/loader/load-stats.ts":(t,e,r)=>{"use strict";r.r(e),r.d(e,{LoadStats:()=>n});var n=function(){this.aborted=!1,this.loaded=0,this.retry=0,this.total=0,this.chunkCount=0,this.bwEstimate=0,this.loading={start:0,first:0,end:0},this.parsing={start:0,end:0},this.buffering={start:0,first:0,end:0}}},"./src/loader/m3u8-parser.ts":(t,e,r)=>{"use strict";r.r(e),r.d(e,{default:()=>m});var n=r("./src/polyfills/number.ts"),i=r("./node_modules/url-toolkit/src/url-toolkit.js"),a=r("./src/loader/date-range.ts"),o=r("./src/loader/fragment.ts"),s=r("./src/loader/level-details.ts"),l=r("./src/loader/level-key.ts"),u=r("./src/utils/attr-list.ts"),c=r("./src/utils/logger.ts"),d=r("./src/utils/codecs.ts");function h(){return h=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(t[n]=r[n])}return t},h.apply(this,arguments)}var f=/#EXT-X-STREAM-INF:([^\r\n]*)(?:[\r\n](?:#[^\r\n]*)?)*([^\r\n]+)|#EXT-X-SESSION-DATA:([^\r\n]*)[\r\n]+|#EXT-X-SESSION-KEY:([^\n\r]*)[\r\n]+/g,p=/#EXT-X-MEDIA:(.*)/g,g=new RegExp([/#EXTINF:\s*(\d*(?:\.\d+)?)(?:,(.*)\s+)?/.source,/(?!#) *(\S[\S ]*)/.source,/#EXT-X-BYTERANGE:*(.+)/.source,/#EXT-X-PROGRAM-DATE-TIME:(.+)/.source,/#.*/.source].join("|"),"g"),v=new RegExp([/#(EXTM3U)/.source,/#EXT-X-(DATERANGE|KEY|MAP|PART|PART-INF|PLAYLIST-TYPE|PRELOAD-HINT|RENDITION-REPORT|SERVER-CONTROL|SKIP|START):(.+)/.source,/#EXT-X-(BITRATE|DISCONTINUITY-SEQUENCE|MEDIA-SEQUENCE|TARGETDURATION|VERSION): *(\d+)/.source,/#EXT-X-(DISCONTINUITY|ENDLIST|GAP)/.source,/(#)([^:]*):(.*)/.source,/(#)(.*)(?:.*)\r?\n?/.source].join("|")),m=function(){function t(){}return t.findGroup=function(t,e){for(var r=0;r<t.length;r++){var n=t[r];if(n.id===e)return n}},t.convertAVC1ToAVCOTI=function(t){var e=t.split(".");if(e.length>2){var r=e.shift()+".";return(r+=parseInt(e.shift()).toString(16))+("000"+parseInt(e.shift()).toString(16)).slice(-4)}return t},t.resolve=function(t,e){return(0,i.buildAbsoluteURL)(e,t,{alwaysNormalize:!0})},t.parseMasterPlaylist=function(e,r){var n,i=[],a=[],o={},s=[],l=!1;for(f.lastIndex=0;null!=(n=f.exec(e));)if(n[1]){var d,h=new u.AttrList(n[1]),p={attrs:h,bitrate:h.decimalInteger("AVERAGE-BANDWIDTH")||h.decimalInteger("BANDWIDTH"),name:h.NAME,url:t.resolve(n[2],r)},g=h.decimalResolution("RESOLUTION");g&&(p.width=g.width,p.height=g.height),b((h.CODECS||"").split(/[ ,]+/).filter((function(t){return t})),p),p.videoCodec&&-1!==p.videoCodec.indexOf("avc1")&&(p.videoCodec=t.convertAVC1ToAVCOTI(p.videoCodec)),null!==(d=p.unknownCodecs)&&void 0!==d&&d.length||a.push(p),i.push(p)}else if(n[3]){var v=new u.AttrList(n[3]);v["DATA-ID"]&&(l=!0,o[v["DATA-ID"]]=v)}else if(n[4]){var m=n[4],E=y(m,r);E.encrypted&&E.isSupported()?s.push(E):c.logger.warn('[Keys] Ignoring invalid EXT-X-SESSION-KEY tag: "'+m+'"')}return{levels:a.length>0&&a.length<i.length?a:i,sessionData:l?o:null,sessionKeys:s.length?s:null}},t.parseMasterPlaylistMedia=function(e,r,n,i){var a;void 0===i&&(i=[]);var o=[],s=0;for(p.lastIndex=0;null!==(a=p.exec(e));){var l=new u.AttrList(a[1]);if(l.TYPE===n){var c={attrs:l,bitrate:0,id:s++,groupId:l["GROUP-ID"],instreamId:l["INSTREAM-ID"],name:l.NAME||l.LANGUAGE||"",type:n,default:l.bool("DEFAULT"),autoselect:l.bool("AUTOSELECT"),forced:l.bool("FORCED"),lang:l.LANGUAGE,url:l.URI?t.resolve(l.URI,r):""};if(i.length){var d=t.findGroup(i,c.groupId)||i[0];E(c,d,"audioCodec"),E(c,d,"textCodec")}o.push(c)}}return o},t.parseLevelPlaylist=function(t,e,r,i,l){var d,f,p,m=new s.LevelDetails(e),b=m.fragments,E=null,T=0,w=0,_=0,A=0,k=null,C=new o.Fragment(i,e),D=-1,L=!1;for(g.lastIndex=0,m.m3u8=t;null!==(d=g.exec(t));){L&&(L=!1,(C=new o.Fragment(i,e)).start=_,C.sn=T,C.cc=A,C.level=r,E&&(C.initSegment=E,C.rawProgramDateTime=E.rawProgramDateTime,E.rawProgramDateTime=null));var R=d[1];if(R){C.duration=parseFloat(R);var I=(" "+d[2]).slice(1);C.title=I||null,C.tagList.push(I?["INF",R,I]:["INF",R])}else if(d[3]){if((0,n.isFiniteNumber)(C.duration)){if(C.start=_,p){C.levelkeys=p;var O=m.encryptedFragments;!C.levelkeys||!Object.keys(C.levelkeys).some((function(t){return C.levelkeys[t].isCommonEncryption}))||O.length&&O[O.length-1].levelkeys===p||O.push(C)}C.sn=T,C.level=r,C.cc=A,C.urlId=l,b.push(C),C.relurl=(" "+d[3]).slice(1),x(C,k),k=C,_+=C.duration,T++,w=0,L=!0}}else if(d[4]){var M=(" "+d[4]).slice(1);k?C.setByteRange(M,k):C.setByteRange(M)}else if(d[5])C.rawProgramDateTime=(" "+d[5]).slice(1),C.tagList.push(["PROGRAM-DATE-TIME",C.rawProgramDateTime]),-1===D&&(D=b.length);else{if(!(d=d[0].match(v))){c.logger.warn("No matches on slow regex match for level playlist!");continue}for(f=1;f<d.length&&void 0===d[f];f++);var P=(" "+d[f]).slice(1),F=(" "+d[f+1]).slice(1),N=d[f+2]?(" "+d[f+2]).slice(1):"";switch(P){case"PLAYLIST-TYPE":m.type=F.toUpperCase();break;case"MEDIA-SEQUENCE":T=m.startSN=parseInt(F);break;case"SKIP":var B=new u.AttrList(F),U=B.decimalInteger("SKIPPED-SEGMENTS");if((0,n.isFiniteNumber)(U)){m.skippedSegments=U;for(var j=U;j--;)b.unshift(null);T+=U}var H=B.enumeratedString("RECENTLY-REMOVED-DATERANGES");H&&(m.recentlyRemovedDateranges=H.split("\t"));break;case"TARGETDURATION":m.targetduration=parseFloat(F);break;case"VERSION":m.version=parseInt(F);break;case"EXTM3U":break;case"ENDLIST":m.live=!1;break;case"#":(F||N)&&C.tagList.push(N?[F,N]:[F]);break;case"DISCONTINUITY":A++,C.tagList.push(["DIS"]);break;case"GAP":C.tagList.push([P]);break;case"BITRATE":C.tagList.push([P,F]);break;case"DATERANGE":var G=new u.AttrList(F),z=new a.DateRange(G,m.dateRanges[G.ID]);z.isValid||m.skippedSegments?m.dateRanges[z.id]=z:c.logger.warn('Ignoring invalid DATERANGE tag: "'+F+'"'),C.tagList.push(["EXT-X-DATERANGE",F]);break;case"DISCONTINUITY-SEQUENCE":A=parseInt(F);break;case"KEY":var V=y(F,e);if(V.isSupported()){if("NONE"===V.method){p=void 0;break}p||(p={}),p[V.keyFormat]&&(p=h({},p)),p[V.keyFormat]=V}else c.logger.warn('[Keys] Ignoring invalid EXT-X-KEY tag: "'+F+'"');break;case"START":var W=new u.AttrList(F).decimalFloatingPoint("TIME-OFFSET");(0,n.isFiniteNumber)(W)&&(m.startTimeOffset=W);break;case"MAP":var K=new u.AttrList(F);if(C.duration){var Y=new o.Fragment(i,e);S(Y,K,r,p),E=Y,C.initSegment=E,E.rawProgramDateTime&&!C.rawProgramDateTime&&(C.rawProgramDateTime=E.rawProgramDateTime)}else S(C,K,r,p),E=C,L=!0;break;case"SERVER-CONTROL":var q=new u.AttrList(F);m.canBlockReload=q.bool("CAN-BLOCK-RELOAD"),m.canSkipUntil=q.optionalFloat("CAN-SKIP-UNTIL",0),m.canSkipDateRanges=m.canSkipUntil>0&&q.bool("CAN-SKIP-DATERANGES"),m.partHoldBack=q.optionalFloat("PART-HOLD-BACK",0),m.holdBack=q.optionalFloat("HOLD-BACK",0);break;case"PART-INF":var X=new u.AttrList(F);m.partTarget=X.decimalFloatingPoint("PART-TARGET");break;case"PART":var $=m.partList;$||($=m.partList=[]);var Q=w>0?$[$.length-1]:void 0,J=w++,Z=new o.Part(new u.AttrList(F),C,e,J,Q);$.push(Z),C.duration+=Z.duration;break;case"PRELOAD-HINT":var tt=new u.AttrList(F);m.preloadHint=tt;break;case"RENDITION-REPORT":var et=new u.AttrList(F);m.renditionReports=m.renditionReports||[],m.renditionReports.push(et);break;default:c.logger.warn("line parsed but not handled: "+d)}}}k&&!k.relurl?(b.pop(),_-=k.duration,m.partList&&(m.fragmentHint=k)):m.partList&&(x(C,k),C.cc=A,m.fragmentHint=C);var rt=b.length,nt=b[0],it=b[rt-1];if((_+=m.skippedSegments*m.targetduration)>0&&rt&&it){m.averagetargetduration=_/rt;var at=it.sn;m.endSN="initSegment"!==at?at:0,m.live||(it.endList=!0),nt&&(m.startCC=nt.cc)}else m.endSN=0,m.startCC=0;return m.fragmentHint&&(_+=m.fragmentHint.duration),m.totalduration=_,m.endCC=A,D>0&&function(t,e){for(var r=t[e],n=e;n--;){var i=t[n];if(!i)return;i.programDateTime=r.programDateTime-1e3*i.duration,r=i}}(b,D),m},t}();function y(t,e){var r,n,i=new u.AttrList(t),a=null!=(r=i.enumeratedString("METHOD"))?r:"",o=i.URI,s=i.hexadecimalInteger("IV"),d=i.enumeratedString("KEYFORMATVERSIONS"),h=null!=(n=i.enumeratedString("KEYFORMAT"))?n:"identity";o&&i.IV&&!s&&c.logger.error("Invalid IV: "+i.IV);var f=o?m.resolve(o,e):"",p=(d||"1").split("/").map(Number).filter(Number.isFinite);return new l.LevelKey(a,f,h,p,s)}function b(t,e){["video","audio","text"].forEach((function(r){var n=t.filter((function(t){return(0,d.isCodecType)(t,r)}));if(n.length){var i=n.filter((function(t){return 0===t.lastIndexOf("avc1",0)||0===t.lastIndexOf("mp4a",0)}));e[r+"Codec"]=i.length>0?i[0]:n[0],t=t.filter((function(t){return-1===n.indexOf(t)}))}})),e.unknownCodecs=t}function E(t,e,r){var n=e[r];n&&(t[r]=n)}function x(t,e){t.rawProgramDateTime?t.programDateTime=Date.parse(t.rawProgramDateTime):null!=e&&e.programDateTime&&(t.programDateTime=e.endProgramDateTime),(0,n.isFiniteNumber)(t.programDateTime)||(t.programDateTime=null,t.rawProgramDateTime=null)}function S(t,e,r,n){t.relurl=e.URI,e.BYTERANGE&&t.setByteRange(e.BYTERANGE),t.level=r,t.sn="initSegment",n&&(t.levelkeys=n),t.initSegment=null}},"./src/loader/playlist-loader.ts":(t,e,r)=>{"use strict";r.r(e),r.d(e,{default:()=>d});var n=r("./src/polyfills/number.ts"),i=r("./src/events.ts"),a=r("./src/errors.ts"),o=r("./src/utils/logger.ts"),s=r("./src/loader/m3u8-parser.ts"),l=r("./src/types/loader.ts"),u=r("./src/utils/attr-list.ts");function c(t,e){var r=t.url;return void 0!==r&&0!==r.indexOf("data:")||(r=e.url),r}const d=function(){function t(t){this.hls=void 0,this.loaders=Object.create(null),this.hls=t,this.registerListeners()}var e=t.prototype;return e.startLoad=function(t){},e.stopLoad=function(){this.destroyInternalLoaders()},e.registerListeners=function(){var t=this.hls;t.on(i.Events.MANIFEST_LOADING,this.onManifestLoading,this),t.on(i.Events.LEVEL_LOADING,this.onLevelLoading,this),t.on(i.Events.AUDIO_TRACK_LOADING,this.onAudioTrackLoading,this),t.on(i.Events.SUBTITLE_TRACK_LOADING,this.onSubtitleTrackLoading,this)},e.unregisterListeners=function(){var t=this.hls;t.off(i.Events.MANIFEST_LOADING,this.onManifestLoading,this),t.off(i.Events.LEVEL_LOADING,this.onLevelLoading,this),t.off(i.Events.AUDIO_TRACK_LOADING,this.onAudioTrackLoading,this),t.off(i.Events.SUBTITLE_TRACK_LOADING,this.onSubtitleTrackLoading,this)},e.createInternalLoader=function(t){var e=this.hls.config,r=e.pLoader,n=e.loader,i=new(r||n)(e);return t.loader=i,this.loaders[t.type]=i,i},e.getInternalLoader=function(t){return this.loaders[t.type]},e.resetInternalLoader=function(t){this.loaders[t]&&delete this.loaders[t]},e.destroyInternalLoaders=function(){for(var t in this.loaders){var e=this.loaders[t];e&&e.destroy(),this.resetInternalLoader(t)}},e.destroy=function(){this.unregisterListeners(),this.destroyInternalLoaders()},e.onManifestLoading=function(t,e){var r=e.url;this.load({id:null,groupId:null,level:0,responseType:"text",type:l.PlaylistContextType.MANIFEST,url:r,deliveryDirectives:null})},e.onLevelLoading=function(t,e){var r=e.id,n=e.level,i=e.url,a=e.deliveryDirectives;this.load({id:r,groupId:null,level:n,responseType:"text",type:l.PlaylistContextType.LEVEL,url:i,deliveryDirectives:a})},e.onAudioTrackLoading=function(t,e){var r=e.id,n=e.groupId,i=e.url,a=e.deliveryDirectives;this.load({id:r,groupId:n,level:null,responseType:"text",type:l.PlaylistContextType.AUDIO_TRACK,url:i,deliveryDirectives:a})},e.onSubtitleTrackLoading=function(t,e){var r=e.id,n=e.groupId,i=e.url,a=e.deliveryDirectives;this.load({id:r,groupId:n,level:null,responseType:"text",type:l.PlaylistContextType.SUBTITLE_TRACK,url:i,deliveryDirectives:a})},e.load=function(t){var e,r,n,i,a,s,u=this.hls.config,c=this.getInternalLoader(t);if(c){var d=c.context;if(d&&d.url===t.url)return void o.logger.trace("[playlist-loader]: playlist request ongoing");o.logger.log("[playlist-loader]: aborting previous loader for type: "+t.type),c.abort()}switch(t.type){case l.PlaylistContextType.MANIFEST:r=u.manifestLoadingMaxRetry,n=u.manifestLoadingTimeOut,i=u.manifestLoadingRetryDelay,a=u.manifestLoadingMaxRetryTimeout;break;case l.PlaylistContextType.LEVEL:case l.PlaylistContextType.AUDIO_TRACK:case l.PlaylistContextType.SUBTITLE_TRACK:r=0,n=u.levelLoadingTimeOut;break;default:r=u.levelLoadingMaxRetry,n=u.levelLoadingTimeOut,i=u.levelLoadingRetryDelay,a=u.levelLoadingMaxRetryTimeout}if(c=this.createInternalLoader(t),null!==(e=t.deliveryDirectives)&&void 0!==e&&e.part&&(t.type===l.PlaylistContextType.LEVEL&&null!==t.level?s=this.hls.levels[t.level].details:t.type===l.PlaylistContextType.AUDIO_TRACK&&null!==t.id?s=this.hls.audioTracks[t.id].details:t.type===l.PlaylistContextType.SUBTITLE_TRACK&&null!==t.id&&(s=this.hls.subtitleTracks[t.id].details),s)){var h=s.partTarget,f=s.targetduration;h&&f&&(n=Math.min(1e3*Math.max(3*h,.8*f),n))}var p={timeout:n,maxRetry:r,retryDelay:i,maxRetryDelay:a,highWaterMark:0},g={onSuccess:this.loadsuccess.bind(this),onError:this.loaderror.bind(this),onTimeout:this.loadtimeout.bind(this)};c.load(t,p,g)},e.loadsuccess=function(t,e,r,n){void 0===n&&(n=null),this.resetInternalLoader(r.type);var i=t.data;0===i.indexOf("#EXTM3U")?(e.parsing.start=performance.now(),i.indexOf("#EXTINF:")>0||i.indexOf("#EXT-X-TARGETDURATION:")>0?this.handleTrackOrLevelPlaylist(t,e,r,n):this.handleMasterPlaylist(t,e,r,n)):this.handleManifestParsingError(t,r,"no EXTM3U delimiter",n)},e.loaderror=function(t,e,r){void 0===r&&(r=null),this.handleNetworkError(e,r,!1,t)},e.loadtimeout=function(t,e,r){void 0===r&&(r=null),this.handleNetworkError(e,r,!0)},e.handleMasterPlaylist=function(t,e,r,n){var a=this.hls,l=t.data,d=c(t,r),h=s.default.parseMasterPlaylist(l,d),f=h.levels,p=h.sessionData,g=h.sessionKeys;if(f.length){var v=f.map((function(t){return{id:t.attrs.AUDIO,audioCodec:t.audioCodec}})),m=f.map((function(t){return{id:t.attrs.SUBTITLES,textCodec:t.textCodec}})),y=s.default.parseMasterPlaylistMedia(l,d,"AUDIO",v),b=s.default.parseMasterPlaylistMedia(l,d,"SUBTITLES",m),E=s.default.parseMasterPlaylistMedia(l,d,"CLOSED-CAPTIONS");y.length&&(y.some((function(t){return!t.url}))||!f[0].audioCodec||f[0].attrs.AUDIO||(o.logger.log("[playlist-loader]: audio codec signaled in quality level, but no embedded audio track signaled, create one"),y.unshift({type:"main",name:"main",default:!1,autoselect:!1,forced:!1,id:-1,attrs:new u.AttrList({}),bitrate:0,url:""}))),a.trigger(i.Events.MANIFEST_LOADED,{levels:f,audioTracks:y,subtitles:b,captions:E,url:d,stats:e,networkDetails:n,sessionData:p,sessionKeys:g})}else this.handleManifestParsingError(t,r,"no level found in manifest",n)},e.handleTrackOrLevelPlaylist=function(t,e,r,o){var d=this.hls,h=r.id,f=r.level,p=r.type,g=c(t,r),v=(0,n.isFiniteNumber)(h)?h:0,m=(0,n.isFiniteNumber)(f)?f:v,y=function(t){switch(t.type){case l.PlaylistContextType.AUDIO_TRACK:return l.PlaylistLevelType.AUDIO;case l.PlaylistContextType.SUBTITLE_TRACK:return l.PlaylistLevelType.SUBTITLE;default:return l.PlaylistLevelType.MAIN}}(r),b=s.default.parseLevelPlaylist(t.data,g,m,y,v);if(b.fragments.length){if(p===l.PlaylistContextType.MANIFEST){var E={attrs:new u.AttrList({}),bitrate:0,details:b,name:"",url:g};d.trigger(i.Events.MANIFEST_LOADED,{levels:[E],audioTracks:[],url:g,stats:e,networkDetails:o,sessionData:null,sessionKeys:null})}e.parsing.end=performance.now(),r.levelDetails=b,this.handlePlaylistLoaded(t,e,r,o)}else d.trigger(i.Events.ERROR,{type:a.ErrorTypes.NETWORK_ERROR,details:a.ErrorDetails.LEVEL_EMPTY_ERROR,fatal:!1,url:g,reason:"no fragments found in level",level:"number"==typeof r.level?r.level:void 0})},e.handleManifestParsingError=function(t,e,r,n){this.hls.trigger(i.Events.ERROR,{type:a.ErrorTypes.NETWORK_ERROR,details:a.ErrorDetails.MANIFEST_PARSING_ERROR,fatal:e.type===l.PlaylistContextType.MANIFEST,url:t.url,reason:r,response:t,context:e,networkDetails:n})},e.handleNetworkError=function(t,e,r,n){void 0===r&&(r=!1),o.logger.warn("[playlist-loader]: A network "+(r?"timeout":"error")+" occurred while loading "+t.type+" level: "+t.level+" id: "+t.id+' group-id: "'+t.groupId+'"');var s=a.ErrorDetails.UNKNOWN,u=!1,c=this.getInternalLoader(t);switch(t.type){case l.PlaylistContextType.MANIFEST:s=r?a.ErrorDetails.MANIFEST_LOAD_TIMEOUT:a.ErrorDetails.MANIFEST_LOAD_ERROR,u=!0;break;case l.PlaylistContextType.LEVEL:s=r?a.ErrorDetails.LEVEL_LOAD_TIMEOUT:a.ErrorDetails.LEVEL_LOAD_ERROR,u=!1;break;case l.PlaylistContextType.AUDIO_TRACK:s=r?a.ErrorDetails.AUDIO_TRACK_LOAD_TIMEOUT:a.ErrorDetails.AUDIO_TRACK_LOAD_ERROR,u=!1;break;case l.PlaylistContextType.SUBTITLE_TRACK:s=r?a.ErrorDetails.SUBTITLE_TRACK_LOAD_TIMEOUT:a.ErrorDetails.SUBTITLE_LOAD_ERROR,u=!1}c&&this.resetInternalLoader(t.type);var d={type:a.ErrorTypes.NETWORK_ERROR,details:s,fatal:u,url:t.url,loader:c,context:t,networkDetails:e};n&&(d.response=n),this.hls.trigger(i.Events.ERROR,d)},e.handlePlaylistLoaded=function(t,e,r,n){var a=r.type,o=r.level,s=r.id,u=r.groupId,c=r.loader,d=r.levelDetails,h=r.deliveryDirectives;if(null!=d&&d.targetduration){if(c)switch(d.live&&(c.getCacheAge&&(d.ageHeader=c.getCacheAge()||0),c.getCacheAge&&!isNaN(d.ageHeader)||(d.ageHeader=0)),a){case l.PlaylistContextType.MANIFEST:case l.PlaylistContextType.LEVEL:this.hls.trigger(i.Events.LEVEL_LOADED,{details:d,level:o||0,id:s||0,stats:e,networkDetails:n,deliveryDirectives:h});break;case l.PlaylistContextType.AUDIO_TRACK:this.hls.trigger(i.Events.AUDIO_TRACK_LOADED,{details:d,id:s||0,groupId:u||"",stats:e,networkDetails:n,deliveryDirectives:h});break;case l.PlaylistContextType.SUBTITLE_TRACK:this.hls.trigger(i.Events.SUBTITLE_TRACK_LOADED,{details:d,id:s||0,groupId:u||"",stats:e,networkDetails:n,deliveryDirectives:h})}}else this.handleManifestParsingError(t,r,"invalid target duration",n)},t}()},"./src/polyfills/number.ts":(t,e,r)=>{"use strict";r.r(e),r.d(e,{MAX_SAFE_INTEGER:()=>i,isFiniteNumber:()=>n});var n=Number.isFinite||function(t){return"number"==typeof t&&isFinite(t)},i=Number.MAX_SAFE_INTEGER||9007199254740991},"./src/remux/aac-helper.ts":(t,e,r)=>{"use strict";r.r(e),r.d(e,{default:()=>n});const n=function(){function t(){}return t.getSilentFrame=function(t,e){if("mp4a.40.2"===t){if(1===e)return new Uint8Array([0,200,0,128,35,128]);if(2===e)return new Uint8Array([33,0,73,144,2,25,0,35,128]);if(3===e)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,142]);if(4===e)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,128,44,128,8,2,56]);if(5===e)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,130,48,4,153,0,33,144,2,56]);if(6===e)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,130,48,4,153,0,33,144,2,0,178,0,32,8,224])}else{if(1===e)return new Uint8Array([1,64,34,128,163,78,230,128,186,8,0,0,0,28,6,241,193,10,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,94]);if(2===e)return new Uint8Array([1,64,34,128,163,94,230,128,186,8,0,0,0,0,149,0,6,241,161,10,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,94]);if(3===e)return new Uint8Array([1,64,34,128,163,94,230,128,186,8,0,0,0,0,149,0,6,241,161,10,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,94])}},t}()},"./src/remux/mp4-generator.ts":(t,e,r)=>{"use strict";r.r(e),r.d(e,{default:()=>a});var n=Math.pow(2,32)-1,i=function(){function t(){}return t.init=function(){var e;for(e in t.types={avc1:[],avcC:[],btrt:[],dinf:[],dref:[],esds:[],ftyp:[],hdlr:[],mdat:[],mdhd:[],mdia:[],mfhd:[],minf:[],moof:[],moov:[],mp4a:[],".mp3":[],mvex:[],mvhd:[],pasp:[],sdtp:[],stbl:[],stco:[],stsc:[],stsd:[],stsz:[],stts:[],tfdt:[],tfhd:[],traf:[],trak:[],trun:[],trex:[],tkhd:[],vmhd:[],smhd:[]},t.types)t.types.hasOwnProperty(e)&&(t.types[e]=[e.charCodeAt(0),e.charCodeAt(1),e.charCodeAt(2),e.charCodeAt(3)]);var r=new Uint8Array([0,0,0,0,0,0,0,0,118,105,100,101,0,0,0,0,0,0,0,0,0,0,0,0,86,105,100,101,111,72,97,110,100,108,101,114,0]),n=new Uint8Array([0,0,0,0,0,0,0,0,115,111,117,110,0,0,0,0,0,0,0,0,0,0,0,0,83,111,117,110,100,72,97,110,100,108,101,114,0]);t.HDLR_TYPES={video:r,audio:n};var i=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,12,117,114,108,32,0,0,0,1]),a=new Uint8Array([0,0,0,0,0,0,0,0]);t.STTS=t.STSC=t.STCO=a,t.STSZ=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0]),t.VMHD=new Uint8Array([0,0,0,1,0,0,0,0,0,0,0,0]),t.SMHD=new Uint8Array([0,0,0,0,0,0,0,0]),t.STSD=new Uint8Array([0,0,0,0,0,0,0,1]);var o=new Uint8Array([105,115,111,109]),s=new Uint8Array([97,118,99,49]),l=new Uint8Array([0,0,0,1]);t.FTYP=t.box(t.types.ftyp,o,l,o,s),t.DINF=t.box(t.types.dinf,t.box(t.types.dref,i))},t.box=function(t){for(var e=8,r=arguments.length,n=new Array(r>1?r-1:0),i=1;i<r;i++)n[i-1]=arguments[i];for(var a=n.length,o=a;a--;)e+=n[a].byteLength;var s=new Uint8Array(e);for(s[0]=e>>24&255,s[1]=e>>16&255,s[2]=e>>8&255,s[3]=255&e,s.set(t,4),a=0,e=8;a<o;a++)s.set(n[a],e),e+=n[a].byteLength;return s},t.hdlr=function(e){return t.box(t.types.hdlr,t.HDLR_TYPES[e])},t.mdat=function(e){return t.box(t.types.mdat,e)},t.mdhd=function(e,r){r*=e;var i=Math.floor(r/(n+1)),a=Math.floor(r%(n+1));return t.box(t.types.mdhd,new Uint8Array([1,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,3,e>>24&255,e>>16&255,e>>8&255,255&e,i>>24,i>>16&255,i>>8&255,255&i,a>>24,a>>16&255,a>>8&255,255&a,85,196,0,0]))},t.mdia=function(e){return t.box(t.types.mdia,t.mdhd(e.timescale,e.duration),t.hdlr(e.type),t.minf(e))},t.mfhd=function(e){return t.box(t.types.mfhd,new Uint8Array([0,0,0,0,e>>24,e>>16&255,e>>8&255,255&e]))},t.minf=function(e){return"audio"===e.type?t.box(t.types.minf,t.box(t.types.smhd,t.SMHD),t.DINF,t.stbl(e)):t.box(t.types.minf,t.box(t.types.vmhd,t.VMHD),t.DINF,t.stbl(e))},t.moof=function(e,r,n){return t.box(t.types.moof,t.mfhd(e),t.traf(n,r))},t.moov=function(e){for(var r=e.length,n=[];r--;)n[r]=t.trak(e[r]);return t.box.apply(null,[t.types.moov,t.mvhd(e[0].timescale,e[0].duration)].concat(n).concat(t.mvex(e)))},t.mvex=function(e){for(var r=e.length,n=[];r--;)n[r]=t.trex(e[r]);return t.box.apply(null,[t.types.mvex].concat(n))},t.mvhd=function(e,r){r*=e;var i=Math.floor(r/(n+1)),a=Math.floor(r%(n+1)),o=new Uint8Array([1,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,3,e>>24&255,e>>16&255,e>>8&255,255&e,i>>24,i>>16&255,i>>8&255,255&i,a>>24,a>>16&255,a>>8&255,255&a,0,1,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,64,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,255]);return t.box(t.types.mvhd,o)},t.sdtp=function(e){var r,n,i=e.samples||[],a=new Uint8Array(4+i.length);for(r=0;r<i.length;r++)n=i[r].flags,a[r+4]=n.dependsOn<<4|n.isDependedOn<<2|n.hasRedundancy;return t.box(t.types.sdtp,a)},t.stbl=function(e){return t.box(t.types.stbl,t.stsd(e),t.box(t.types.stts,t.STTS),t.box(t.types.stsc,t.STSC),t.box(t.types.stsz,t.STSZ),t.box(t.types.stco,t.STCO))},t.avc1=function(e){var r,n,i,a=[],o=[];for(r=0;r<e.sps.length;r++)i=(n=e.sps[r]).byteLength,a.push(i>>>8&255),a.push(255&i),a=a.concat(Array.prototype.slice.call(n));for(r=0;r<e.pps.length;r++)i=(n=e.pps[r]).byteLength,o.push(i>>>8&255),o.push(255&i),o=o.concat(Array.prototype.slice.call(n));var s=t.box(t.types.avcC,new Uint8Array([1,a[3],a[4],a[5],255,224|e.sps.length].concat(a).concat([e.pps.length]).concat(o))),l=e.width,u=e.height,c=e.pixelRatio[0],d=e.pixelRatio[1];return t.box(t.types.avc1,new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,l>>8&255,255&l,u>>8&255,255&u,0,72,0,0,0,72,0,0,0,0,0,0,0,1,18,100,97,105,108,121,109,111,116,105,111,110,47,104,108,115,46,106,115,0,0,0,0,0,0,0,0,0,0,0,0,0,0,24,17,17]),s,t.box(t.types.btrt,new Uint8Array([0,28,156,128,0,45,198,192,0,45,198,192])),t.box(t.types.pasp,new Uint8Array([c>>24,c>>16&255,c>>8&255,255&c,d>>24,d>>16&255,d>>8&255,255&d])))},t.esds=function(t){var e=t.config.length;return new Uint8Array([0,0,0,0,3,23+e,0,1,0,4,15+e,64,21,0,0,0,0,0,0,0,0,0,0,0,5].concat([e]).concat(t.config).concat([6,1,2]))},t.mp4a=function(e){var r=e.samplerate;return t.box(t.types.mp4a,new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,e.channelCount,0,16,0,0,0,0,r>>8&255,255&r,0,0]),t.box(t.types.esds,t.esds(e)))},t.mp3=function(e){var r=e.samplerate;return t.box(t.types[".mp3"],new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,e.channelCount,0,16,0,0,0,0,r>>8&255,255&r,0,0]))},t.stsd=function(e){return"audio"===e.type?"mp3"===e.segmentCodec&&"mp3"===e.codec?t.box(t.types.stsd,t.STSD,t.mp3(e)):t.box(t.types.stsd,t.STSD,t.mp4a(e)):t.box(t.types.stsd,t.STSD,t.avc1(e))},t.tkhd=function(e){var r=e.id,i=e.duration*e.timescale,a=e.width,o=e.height,s=Math.floor(i/(n+1)),l=Math.floor(i%(n+1));return t.box(t.types.tkhd,new Uint8Array([1,0,0,7,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,3,r>>24&255,r>>16&255,r>>8&255,255&r,0,0,0,0,s>>24,s>>16&255,s>>8&255,255&s,l>>24,l>>16&255,l>>8&255,255&l,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,64,0,0,0,a>>8&255,255&a,0,0,o>>8&255,255&o,0,0]))},t.traf=function(e,r){var i=t.sdtp(e),a=e.id,o=Math.floor(r/(n+1)),s=Math.floor(r%(n+1));return t.box(t.types.traf,t.box(t.types.tfhd,new Uint8Array([0,0,0,0,a>>24,a>>16&255,a>>8&255,255&a])),t.box(t.types.tfdt,new Uint8Array([1,0,0,0,o>>24,o>>16&255,o>>8&255,255&o,s>>24,s>>16&255,s>>8&255,255&s])),t.trun(e,i.length+16+20+8+16+8+8),i)},t.trak=function(e){return e.duration=e.duration||4294967295,t.box(t.types.trak,t.tkhd(e),t.mdia(e))},t.trex=function(e){var r=e.id;return t.box(t.types.trex,new Uint8Array([0,0,0,0,r>>24,r>>16&255,r>>8&255,255&r,0,0,0,1,0,0,0,0,0,0,0,0,0,1,0,1]))},t.trun=function(e,r){var n,i,a,o,s,l,u=e.samples||[],c=u.length,d=12+16*c,h=new Uint8Array(d);for(r+=8+d,h.set(["video"===e.type?1:0,0,15,1,c>>>24&255,c>>>16&255,c>>>8&255,255&c,r>>>24&255,r>>>16&255,r>>>8&255,255&r],0),n=0;n<c;n++)a=(i=u[n]).duration,o=i.size,s=i.flags,l=i.cts,h.set([a>>>24&255,a>>>16&255,a>>>8&255,255&a,o>>>24&255,o>>>16&255,o>>>8&255,255&o,s.isLeading<<2|s.dependsOn,s.isDependedOn<<6|s.hasRedundancy<<4|s.paddingValue<<1|s.isNonSync,61440&s.degradPrio,15&s.degradPrio,l>>>24&255,l>>>16&255,l>>>8&255,255&l],12+16*n);return t.box(t.types.trun,h)},t.initSegment=function(e){t.types||t.init();var r=t.moov(e),n=new Uint8Array(t.FTYP.byteLength+r.byteLength);return n.set(t.FTYP),n.set(r,t.FTYP.byteLength),n},t}();i.types=void 0,i.HDLR_TYPES=void 0,i.STTS=void 0,i.STSC=void 0,i.STCO=void 0,i.STSZ=void 0,i.VMHD=void 0,i.SMHD=void 0,i.STSD=void 0,i.FTYP=void 0,i.DINF=void 0;const a=i},"./src/remux/mp4-remuxer.ts":(t,e,r)=>{"use strict";r.r(e),r.d(e,{default:()=>g,flushTextTrackMetadataCueSamples:()=>m,flushTextTrackUserdataCueSamples:()=>y,normalizePts:()=>v});var n=r("./src/polyfills/number.ts"),a=r("./src/remux/aac-helper.ts"),o=r("./src/remux/mp4-generator.ts"),s=r("./src/events.ts"),l=r("./src/errors.ts"),u=r("./src/utils/logger.ts"),c=r("./src/types/loader.ts"),d=r("./src/utils/timescale-conversion.ts");function h(){return h=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(t[n]=r[n])}return t},h.apply(this,arguments)}var f=null,p=null,g=function(){function t(t,e,r,n){if(void 0===n&&(n=""),this.observer=void 0,this.config=void 0,this.typeSupported=void 0,this.ISGenerated=!1,this._initPTS=void 0,this._initDTS=void 0,this.nextAvcDts=null,this.nextAudioPts=null,this.videoSampleDuration=null,this.isAudioContiguous=!1,this.isVideoContiguous=!1,this.observer=t,this.config=e,this.typeSupported=r,this.ISGenerated=!1,null===f){var i=(navigator.userAgent||"").match(/Chrome\/(\d+)/i);f=i?parseInt(i[1]):0}if(null===p){var a=navigator.userAgent.match(/Safari\/(\d+)/i);p=a?parseInt(a[1]):0}}var e=t.prototype;return e.destroy=function(){},e.resetTimeStamp=function(t){u.logger.log("[mp4-remuxer]: initPTS & initDTS reset"),this._initPTS=this._initDTS=t},e.resetNextTimestamp=function(){u.logger.log("[mp4-remuxer]: reset next timestamp"),this.isVideoContiguous=!1,this.isAudioContiguous=!1},e.resetInitSegment=function(){u.logger.log("[mp4-remuxer]: ISGenerated flag reset"),this.ISGenerated=!1},e.getVideoStartPts=function(t){var e=!1,r=t.reduce((function(t,r){var n=r.pts-t;return n<-4294967296?(e=!0,v(t,r.pts)):n>0?t:r.pts}),t[0].pts);return e&&u.logger.debug("PTS rollover detected"),r},e.remux=function(t,e,r,n,i,a,o,s){var l,d,h,f,p,g,b=i,E=i,x=t.pid>-1,S=e.pid>-1,T=e.samples.length,w=t.samples.length>0,_=o&&T>0||T>1;if((!x||w)&&(!S||_)||this.ISGenerated||o){this.ISGenerated||(h=this.generateIS(t,e,i));var A,k=this.isVideoContiguous,C=-1;if(_&&(C=function(t){for(var e=0;e<t.length;e++)if(t[e].key)return e;return-1}(e.samples),!k&&this.config.forceKeyFrameOnDiscontinuity))if(g=!0,C>0){u.logger.warn("[mp4-remuxer]: Dropped "+C+" out of "+T+" video samples due to a missing keyframe");var D=this.getVideoStartPts(e.samples);e.samples=e.samples.slice(C),e.dropped+=C,A=E+=(e.samples[0].pts-D)/e.inputTimeScale}else-1===C&&(u.logger.warn("[mp4-remuxer]: No keyframe found out of "+T+" video samples"),g=!1);if(this.ISGenerated){if(w&&_){var L=this.getVideoStartPts(e.samples),R=(v(t.samples[0].pts,L)-L)/e.inputTimeScale;b+=Math.max(0,R),E+=Math.max(0,-R)}if(w){if(t.samplerate||(u.logger.warn("[mp4-remuxer]: regenerate InitSegment as audio detected"),h=this.generateIS(t,e,i)),d=this.remuxAudio(t,b,this.isAudioContiguous,a,S||_||s===c.PlaylistLevelType.AUDIO?E:void 0),_){var I=d?d.endPTS-d.startPTS:0;e.inputTimeScale||(u.logger.warn("[mp4-remuxer]: regenerate InitSegment as video detected"),h=this.generateIS(t,e,i)),l=this.remuxVideo(e,E,k,I)}}else _&&(l=this.remuxVideo(e,E,k,0));l&&(l.firstKeyFrame=C,l.independent=-1!==C,l.firstKeyFramePTS=A)}}return this.ISGenerated&&(r.samples.length&&(p=m(r,i,this._initPTS,this._initDTS)),n.samples.length&&(f=y(n,i,this._initPTS))),{audio:d,video:l,initSegment:h,independent:g,text:f,id3:p}},e.generateIS=function(t,e,r){var i,a,s,l=t.samples,u=e.samples,c=this.typeSupported,d={},h=!(0,n.isFiniteNumber)(this._initPTS),f="audio/mp4";if(h&&(i=a=1/0),t.config&&l.length&&(t.timescale=t.samplerate,"mp3"===t.segmentCodec&&(c.mpeg?(f="audio/mpeg",t.codec=""):c.mp3&&(t.codec="mp3")),d.audio={id:"audio",container:f,codec:t.codec,initSegment:"mp3"===t.segmentCodec&&c.mpeg?new Uint8Array(0):o.default.initSegment([t]),metadata:{channelCount:t.channelCount}},h&&(s=t.inputTimeScale,i=a=l[0].pts-Math.round(s*r))),e.sps&&e.pps&&u.length&&(e.timescale=e.inputTimeScale,d.video={id:"main",container:"video/mp4",codec:e.codec,initSegment:o.default.initSegment([e]),metadata:{width:e.width,height:e.height}},h)){s=e.inputTimeScale;var p=this.getVideoStartPts(u),g=Math.round(s*r);a=Math.min(a,v(u[0].dts,p)-g),i=Math.min(i,p-g)}if(Object.keys(d).length)return this.ISGenerated=!0,h&&(this._initPTS=i,this._initDTS=a),{tracks:d,initPTS:i,timescale:s}},e.remuxVideo=function(t,e,r,n){var a,c,g=t.inputTimeScale,m=t.samples,y=[],E=m.length,x=this._initPTS,S=this.nextAvcDts,T=8,w=this.videoSampleDuration,_=Number.POSITIVE_INFINITY,A=Number.NEGATIVE_INFINITY,k=!1;r&&null!==S||(S=e*g-(m[0].pts-v(m[0].dts,m[0].pts)));for(var C=0;C<E;C++){var D=m[C];D.pts=v(D.pts-x,S),D.dts=v(D.dts-x,S),D.dts<m[C>0?C-1:C].dts&&(k=!0)}k&&m.sort((function(t,e){var r=t.dts-e.dts,n=t.pts-e.pts;return r||n})),a=m[0].dts;var L=m[m.length-1].dts-a,R=L?Math.round(L/(E-1)):w||t.inputTimeScale/30;if(r){var I=a-S,O=I>R,M=I<-1;if((O||M)&&(O?u.logger.warn("AVC: "+(0,d.toMsFromMpegTsClock)(I,!0)+" ms ("+I+"dts) hole between fragments detected, filling it"):u.logger.warn("AVC: "+(0,d.toMsFromMpegTsClock)(-I,!0)+" ms ("+I+"dts) overlapping between fragments detected"),!M||S>m[0].pts)){a=S;var P=m[0].pts-I;m[0].dts=a,m[0].pts=P,u.logger.log("Video: First PTS/DTS adjusted: "+(0,d.toMsFromMpegTsClock)(P,!0)+"/"+(0,d.toMsFromMpegTsClock)(a,!0)+", delta: "+(0,d.toMsFromMpegTsClock)(I,!0)+" ms")}}a=Math.max(0,a);for(var F=0,N=0,B=0;B<E;B++){for(var U=m[B],j=U.units,H=j.length,G=0,z=0;z<H;z++)G+=j[z].data.length;N+=G,F+=H,U.length=G,U.dts=Math.max(U.dts,a),_=Math.min(U.pts,_),A=Math.max(U.pts,A)}c=m[E-1].dts;var V,W=N+4*F+8;try{V=new Uint8Array(W)}catch(t){return void this.observer.emit(s.Events.ERROR,s.Events.ERROR,{type:l.ErrorTypes.MUX_ERROR,details:l.ErrorDetails.REMUX_ALLOC_ERROR,fatal:!1,bytes:W,reason:"fail allocating video mdat "+W})}var K=new DataView(V.buffer);K.setUint32(0,W),V.set(o.default.types.mdat,4);for(var Y=!1,q=Number.POSITIVE_INFINITY,X=Number.POSITIVE_INFINITY,$=Number.NEGATIVE_INFINITY,Q=Number.NEGATIVE_INFINITY,J=0;J<E;J++){for(var Z=m[J],tt=Z.units,et=0,rt=0,nt=tt.length;rt<nt;rt++){var it=tt[rt],at=it.data,ot=it.data.byteLength;K.setUint32(T,ot),T+=4,V.set(at,T),T+=ot,et+=4+ot}var st=void 0;if(J<E-1)w=m[J+1].dts-Z.dts,st=m[J+1].pts-Z.pts;else{var lt=this.config,ut=J>0?Z.dts-m[J-1].dts:R;if(st=J>0?Z.pts-m[J-1].pts:R,lt.stretchShortVideoTrack&&null!==this.nextAudioPts){var ct=Math.floor(lt.maxBufferHole*g),dt=(n?_+n*g:this.nextAudioPts)-Z.pts;dt>ct?((w=dt-ut)<0?w=ut:Y=!0,u.logger.log("[mp4-remuxer]: It is approximately "+dt/90+" ms to the next segment; using duration "+w/90+" ms for the last video frame.")):w=ut}else w=ut}var ht=Math.round(Z.pts-Z.dts);q=Math.min(q,w),$=Math.max($,w),X=Math.min(X,st),Q=Math.max(Q,st),y.push(new b(Z.key,w,et,ht))}if(y.length)if(f){if(f<70){var ft=y[0].flags;ft.dependsOn=2,ft.isNonSync=0}}else if(p&&Q-X<$-q&&R/$<.025&&0===y[0].cts){u.logger.warn("Found irregular gaps in sample duration. Using PTS instead of DTS to determine MP4 sample duration.");for(var pt=a,gt=0,vt=y.length;gt<vt;gt++){var mt=pt+y[gt].duration,yt=pt+y[gt].cts;if(gt<vt-1){var bt=mt+y[gt+1].cts;y[gt].duration=bt-yt}else y[gt].duration=gt?y[gt-1].duration:R;y[gt].cts=0,pt=mt}}i.assert(null!==w,"mp4SampleDuration must be computed"),w=Y||!w?R:w,this.nextAvcDts=S=c+w,this.videoSampleDuration=w,this.isVideoContiguous=!0;var Et={data1:o.default.moof(t.sequenceNumber++,a,h({},t,{samples:y})),data2:V,startPTS:_/g,endPTS:(A+w)/g,startDTS:a/g,endDTS:S/g,type:"video",hasAudio:!1,hasVideo:!0,nb:y.length,dropped:t.dropped};return t.samples=[],t.dropped=0,i.assert(V.length,"MDAT length must not be zero"),Et},e.remuxAudio=function(t,e,r,n,c){var d=t.inputTimeScale,f=d/(t.samplerate?t.samplerate:d),p="aac"===t.segmentCodec?1024:1152,g=p*f,m=this._initPTS,y="mp3"===t.segmentCodec&&this.typeSupported.mpeg,E=[],x=void 0!==c,S=t.samples,T=y?0:8,w=this.nextAudioPts||-1,_=e*d;if(this.isAudioContiguous=r=r||S.length&&w>0&&(n&&Math.abs(_-w)<9e3||Math.abs(v(S[0].pts-m,_)-w)<20*g),S.forEach((function(t){t.pts=v(t.pts-m,_)})),!r||w<0){if(S=S.filter((function(t){return t.pts>=0})),!S.length)return;w=0===c?0:n&&!x?Math.max(0,_):S[0].pts}if("aac"===t.segmentCodec)for(var A=this.config.maxAudioFramesDrift,k=0,C=w;k<S.length;k++){var D=S[k],L=D.pts,R=L-C,I=Math.abs(1e3*R/d);if(R<=-A*g&&x)0===k&&(u.logger.warn("Audio frame @ "+(L/d).toFixed(3)+"s overlaps nextAudioPts by "+Math.round(1e3*R/d)+" ms."),this.nextAudioPts=w=C=L);else if(R>=A*g&&I<1e4&&x){var O=Math.round(R/g);(C=L-O*g)<0&&(O--,C+=g),0===k&&(this.nextAudioPts=w=C),u.logger.warn("[mp4-remuxer]: Injecting "+O+" audio frame @ "+(C/d).toFixed(3)+"s due to "+Math.round(1e3*R/d)+" ms gap.");for(var M=0;M<O;M++){var P=Math.max(C,0),F=a.default.getSilentFrame(t.manifestCodec||t.codec,t.channelCount);F||(u.logger.log("[mp4-remuxer]: Unable to get silent frame for given audio codec; duplicating last frame instead."),F=D.unit.subarray()),S.splice(k,0,{unit:F,pts:P}),C+=g,k++}}D.pts=C,C+=g}for(var N,B=null,U=null,j=0,H=S.length;H--;)j+=S[H].unit.byteLength;for(var G=0,z=S.length;G<z;G++){var V=S[G],W=V.unit,K=V.pts;if(null!==U)E[G-1].duration=Math.round((K-U)/f);else{if(r&&"aac"===t.segmentCodec&&(K=w),B=K,!(j>0))return;j+=T;try{N=new Uint8Array(j)}catch(t){return void this.observer.emit(s.Events.ERROR,s.Events.ERROR,{type:l.ErrorTypes.MUX_ERROR,details:l.ErrorDetails.REMUX_ALLOC_ERROR,fatal:!1,bytes:j,reason:"fail allocating audio mdat "+j})}y||(new DataView(N.buffer).setUint32(0,j),N.set(o.default.types.mdat,4))}N.set(W,T);var Y=W.byteLength;T+=Y,E.push(new b(!0,p,Y,0)),U=K}var q=E.length;if(q){var X=E[E.length-1];this.nextAudioPts=w=U+f*X.duration;var $=y?new Uint8Array(0):o.default.moof(t.sequenceNumber++,B/f,h({},t,{samples:E}));t.samples=[];var Q=B/d,J=w/d,Z={data1:$,data2:N,startPTS:Q,endPTS:J,startDTS:Q,endDTS:J,type:"audio",hasAudio:!0,hasVideo:!1,nb:q};return this.isAudioContiguous=!0,i.assert(N.length,"MDAT length must not be zero"),Z}},e.remuxEmptyAudio=function(t,e,r,n){var i=t.inputTimeScale,o=i/(t.samplerate?t.samplerate:i),s=this.nextAudioPts,l=(null!==s?s:n.startDTS*i)+this._initDTS,c=n.endDTS*i+this._initDTS,d=1024*o,h=Math.ceil((c-l)/d),f=a.default.getSilentFrame(t.manifestCodec||t.codec,t.channelCount);if(u.logger.warn("[mp4-remuxer]: remux empty Audio"),f){for(var p=[],g=0;g<h;g++){var v=l+g*d;p.push({unit:f,pts:v,dts:v})}return t.samples=p,this.remuxAudio(t,e,r,!1)}u.logger.trace("[mp4-remuxer]: Unable to remuxEmptyAudio since we were unable to get a silent frame for given audio codec")},t}();function v(t,e){var r;if(null===e)return t;for(r=e<t?-8589934592:8589934592;Math.abs(t-e)>4294967296;)t+=r;return t}function m(t,e,r,n){var i=t.samples.length;if(i){for(var a=t.inputTimeScale,o=0;o<i;o++){var s=t.samples[o];s.pts=v(s.pts-r,e*a)/a,s.dts=v(s.dts-n,e*a)/a}var l=t.samples;return t.samples=[],{samples:l}}}function y(t,e,r){var n=t.samples.length;if(n){for(var i=t.inputTimeScale,a=0;a<n;a++){var o=t.samples[a];o.pts=v(o.pts-r,e*i)/i}t.samples.sort((function(t,e){return t.pts-e.pts}));var s=t.samples;return t.samples=[],{samples:s}}}var b=function(t,e,r,n){this.size=void 0,this.duration=void 0,this.cts=void 0,this.flags=void 0,this.duration=e,this.size=r,this.cts=n,this.flags=new E(t)},E=function(t){this.isLeading=0,this.isDependedOn=0,this.hasRedundancy=0,this.degradPrio=0,this.dependsOn=1,this.isNonSync=1,this.dependsOn=t?2:1,this.isNonSync=t?0:1}},"./src/remux/passthrough-remuxer.ts":(t,e,r)=>{"use strict";r.r(e),r.d(e,{default:()=>u});var n=r("./src/polyfills/number.ts"),i=r("./src/remux/mp4-remuxer.ts"),a=r("./src/utils/mp4-tools.ts"),o=r("./src/loader/fragment.ts"),s=r("./src/utils/logger.ts");function l(t,e){var r=null==t?void 0:t.codec;return r&&r.length>4?r:"hvc1"===r||"hev1"===r?"hvc1.1.c.L120.90":"av01"===r?"av01.0.04M.08":"avc1"===r||e===o.ElementaryStreamTypes.VIDEO?"avc1.42e01e":"mp4a.40.5"}const u=function(){function t(){this.emitInitSegment=!1,this.audioCodec=void 0,this.videoCodec=void 0,this.initData=void 0,this.initPTS=void 0,this.initTracks=void 0,this.lastEndTime=null}var e=t.prototype;return e.destroy=function(){},e.resetTimeStamp=function(t){this.initPTS=t,this.lastEndTime=null},e.resetNextTimestamp=function(){this.lastEndTime=null},e.resetInitSegment=function(t,e,r,n){this.audioCodec=e,this.videoCodec=r,this.generateInitSegment((0,a.patchEncyptionData)(t,n)),this.emitInitSegment=!0},e.generateInitSegment=function(t){var e=this.audioCodec,r=this.videoCodec;if(!t||!t.byteLength)return this.initTracks=void 0,void(this.initData=void 0);var n=this.initData=(0,a.parseInitSegment)(t);e||(e=l(n.audio,o.ElementaryStreamTypes.AUDIO)),r||(r=l(n.video,o.ElementaryStreamTypes.VIDEO));var i={};n.audio&&n.video?i.audiovideo={container:"video/mp4",codec:e+","+r,initSegment:t,id:"main"}:n.audio?i.audio={container:"audio/mp4",codec:e,initSegment:t,id:"audio"}:n.video?i.video={container:"video/mp4",codec:r,initSegment:t,id:"main"}:s.logger.warn("[passthrough-remuxer.ts]: initSegment does not contain moov or trak boxes."),this.initTracks=i},e.remux=function(t,e,r,o,l){var u,c=this.initPTS,d=this.lastEndTime,h={audio:void 0,video:void 0,text:o,id3:r,initSegment:void 0};(0,n.isFiniteNumber)(d)||(d=this.lastEndTime=l||0);var f=e.samples;if(!f||!f.length)return h;var p={initPTS:void 0,timescale:1},g=this.initData;if(g&&g.length||(this.generateInitSegment(f),g=this.initData),!g||!g.length)return s.logger.warn("[passthrough-remuxer.ts]: Failed to generate initSegment."),h;this.emitInitSegment&&(p.tracks=this.initTracks,this.emitInitSegment=!1);var v=(0,a.getStartDTS)(g,f);(0,n.isFiniteNumber)(c)||(this.initPTS=p.initPTS=c=v-l);var m=(0,a.getDuration)(f,g),y=t?v-c:d,b=y+m;(0,a.offsetStartDTS)(g,f,c),m>0?this.lastEndTime=b:(s.logger.warn("Duration parsed from mp4 should be greater than zero"),this.resetNextTimestamp());var E=!!g.audio,x=!!g.video,S="";E&&(S+="audio"),x&&(S+="video");var T={data1:f,startPTS:y,startDTS:y,endPTS:b,endDTS:b,type:S,hasAudio:E,hasVideo:x,nb:1,dropped:0};h.audio="audio"===T.type?T:void 0,h.video="audio"!==T.type?T:void 0,h.initSegment=p;var w=null!=(u=this.initPTS)?u:0;return h.id3=(0,i.flushTextTrackMetadataCueSamples)(r,l,w,w),o.samples.length&&(h.text=(0,i.flushTextTrackUserdataCueSamples)(o,l,w)),h},t}()},"./src/task-loop.ts":(t,e,r)=>{"use strict";r.r(e),r.d(e,{default:()=>n});var n=function(){function t(){this._boundTick=void 0,this._tickTimer=null,this._tickInterval=null,this._tickCallCount=0,this._boundTick=this.tick.bind(this)}var e=t.prototype;return e.destroy=function(){this.onHandlerDestroying(),this.onHandlerDestroyed()},e.onHandlerDestroying=function(){this.clearNextTick(),this.clearInterval()},e.onHandlerDestroyed=function(){},e.hasInterval=function(){return!!this._tickInterval},e.hasNextTick=function(){return!!this._tickTimer},e.setInterval=function(t){return!this._tickInterval&&(this._tickInterval=self.setInterval(this._boundTick,t),!0)},e.clearInterval=function(){return!!this._tickInterval&&(self.clearInterval(this._tickInterval),this._tickInterval=null,!0)},e.clearNextTick=function(){return!!this._tickTimer&&(self.clearTimeout(this._tickTimer),this._tickTimer=null,!0)},e.tick=function(){this._tickCallCount++,1===this._tickCallCount&&(this.doTick(),this._tickCallCount>1&&this.tickImmediate(),this._tickCallCount=0)},e.tickImmediate=function(){this.clearNextTick(),this._tickTimer=self.setTimeout(this._boundTick,0)},e.doTick=function(){},t}()},"./src/types/cmcd.ts":(t,e,r)=>{"use strict";r.r(e),r.d(e,{CMCDObjectType:()=>n,CMCDStreamType:()=>a,CMCDStreamingFormat:()=>i,CMCDVersion:()=>o});var n,i,a,o=1;!function(t){t.MANIFEST="m",t.AUDIO="a",t.VIDEO="v",t.MUXED="av",t.INIT="i",t.CAPTION="c",t.TIMED_TEXT="tt",t.KEY="k",t.OTHER="o"}(n||(n={})),function(t){t.DASH="d",t.HLS="h",t.SMOOTH="s",t.OTHER="o"}(i||(i={})),function(t){t.VOD="v",t.LIVE="l"}(a||(a={}))},"./src/types/demuxer.ts":(t,e,r)=>{"use strict";var n;r.r(e),r.d(e,{MetadataSchema:()=>n}),function(t){t.audioId3="org.id3",t.dateRange="com.apple.quicktime.HLS",t.emsg="https://aomedia.org/emsg/ID3"}(n||(n={}))},"./src/types/level.ts":(t,e,r)=>{"use strict";function n(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,(void 0,"symbol"==typeof(i=function(t,e){if("object"!=typeof t||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(n.key))?i:String(i)),n)}var i}r.r(e),r.d(e,{HdcpLevels:()=>a,HlsSkip:()=>i,HlsUrlParameters:()=>s,Level:()=>l,getSkipValue:()=>o});var i,a=["NONE","TYPE-0","TYPE-1","TYPE-2",null];function o(t,e){var r=t.canSkipUntil,n=t.canSkipDateRanges,a=t.endSN;return r&&(void 0!==e?e-a:0)<r?n?i.v2:i.Yes:i.No}!function(t){t.No="",t.Yes="YES",t.v2="v2"}(i||(i={}));var s=function(){function t(t,e,r){this.msn=void 0,this.part=void 0,this.skip=void 0,this.msn=t,this.part=e,this.skip=r}return t.prototype.addDirectives=function(t){var e=new self.URL(t);return void 0!==this.msn&&e.searchParams.set("_HLS_msn",this.msn.toString()),void 0!==this.part&&e.searchParams.set("_HLS_part",this.part.toString()),this.skip&&e.searchParams.set("_HLS_skip",this.skip),e.href},t}(),l=function(){function t(t){this.attrs=void 0,this.audioCodec=void 0,this.bitrate=void 0,this.codecSet=void 0,this.height=void 0,this.id=void 0,this.name=void 0,this.videoCodec=void 0,this.width=void 0,this.unknownCodecs=void 0,this.audioGroupIds=void 0,this.details=void 0,this.fragmentError=0,this.loadError=0,this.loaded=void 0,this.realBitrate=0,this.textGroupIds=void 0,this.url=void 0,this._urlId=0,this.url=[t.url],this.attrs=t.attrs,this.bitrate=t.bitrate,t.details&&(this.details=t.details),this.id=t.id||0,this.name=t.name,this.width=t.width||0,this.height=t.height||0,this.audioCodec=t.audioCodec,this.videoCodec=t.videoCodec,this.unknownCodecs=t.unknownCodecs,this.codecSet=[t.videoCodec,t.audioCodec].filter((function(t){return t})).join(",").replace(/\.[^.,]+/g,"")}var e,r;return e=t,(r=[{key:"maxBitrate",get:function(){return Math.max(this.realBitrate,this.bitrate)}},{key:"uri",get:function(){return this.url[this._urlId]||""}},{key:"urlId",get:function(){return this._urlId},set:function(t){var e=t%this.url.length;this._urlId!==e&&(this.details=void 0,this._urlId=e)}}])&&n(e.prototype,r),Object.defineProperty(e,"prototype",{writable:!1}),t}()},"./src/types/loader.ts":(t,e,r)=>{"use strict";var n,i;r.r(e),r.d(e,{PlaylistContextType:()=>n,PlaylistLevelType:()=>i}),function(t){t.MANIFEST="manifest",t.LEVEL="level",t.AUDIO_TRACK="audioTrack",t.SUBTITLE_TRACK="subtitleTrack"}(n||(n={})),function(t){t.MAIN="main",t.AUDIO="audio",t.SUBTITLE="subtitle"}(i||(i={}))},"./src/types/transmuxer.ts":(t,e,r)=>{"use strict";r.r(e),r.d(e,{ChunkMetadata:()=>n});var n=function(t,e,r,n,i,a){void 0===n&&(n=0),void 0===i&&(i=-1),void 0===a&&(a=!1),this.level=void 0,this.sn=void 0,this.part=void 0,this.id=void 0,this.size=void 0,this.partial=void 0,this.transmuxing={start:0,executeStart:0,executeEnd:0,end:0},this.buffering={audio:{start:0,executeStart:0,executeEnd:0,end:0},video:{start:0,executeStart:0,executeEnd:0,end:0},audiovideo:{start:0,executeStart:0,executeEnd:0,end:0}},this.level=t,this.sn=e,this.id=r,this.size=n,this.part=i,this.partial=a}},"./src/utils/attr-list.ts":(t,e,r)=>{"use strict";r.r(e),r.d(e,{AttrList:()=>a});var n=/^(\d+)x(\d+)$/,i=/\s*(.+?)\s*=((?:\".*?\")|.*?)(?:,|$)/g,a=function(){function t(e){for(var r in"string"==typeof e&&(e=t.parseAttrList(e)),e)e.hasOwnProperty(r)&&(this[r]=e[r])}var e=t.prototype;return e.decimalInteger=function(t){var e=parseInt(this[t],10);return e>Number.MAX_SAFE_INTEGER?1/0:e},e.hexadecimalInteger=function(t){if(this[t]){var e=(this[t]||"0x").slice(2);e=(1&e.length?"0":"")+e;for(var r=new Uint8Array(e.length/2),n=0;n<e.length/2;n++)r[n]=parseInt(e.slice(2*n,2*n+2),16);return r}return null},e.hexadecimalIntegerAsNumber=function(t){var e=parseInt(this[t],16);return e>Number.MAX_SAFE_INTEGER?1/0:e},e.decimalFloatingPoint=function(t){return parseFloat(this[t])},e.optionalFloat=function(t,e){var r=this[t];return r?parseFloat(r):e},e.enumeratedString=function(t){return this[t]},e.bool=function(t){return"YES"===this[t]},e.decimalResolution=function(t){var e=n.exec(this[t]);if(null!==e)return{width:parseInt(e[1],10),height:parseInt(e[2],10)}},t.parseAttrList=function(t){var e,r={};for(i.lastIndex=0;null!==(e=i.exec(t));){var n=e[2];0===n.indexOf('"')&&n.lastIndexOf('"')===n.length-1&&(n=n.slice(1,-1)),r[e[1]]=n}return r},t}()},"./src/utils/binary-search.ts":(t,e,r)=>{"use strict";r.r(e),r.d(e,{default:()=>n});const n={search:function(t,e){for(var r=0,n=t.length-1,i=null,a=null;r<=n;){var o=e(a=t[i=(r+n)/2|0]);if(o>0)r=i+1;else{if(!(o<0))return a;n=i-1}}return null}}},"./src/utils/buffer-helper.ts":(t,e,r)=>{"use strict";r.r(e),r.d(e,{BufferHelper:()=>a});var n=r("./src/utils/logger.ts"),i={length:0,start:function(){return 0},end:function(){return 0}},a=function(){function t(){}return t.isBuffered=function(e,r){try{if(e)for(var n=t.getBuffered(e),i=0;i<n.length;i++)if(r>=n.start(i)&&r<=n.end(i))return!0}catch(t){}return!1},t.bufferInfo=function(e,r,n){try{if(e){var i,a=t.getBuffered(e),o=[];for(i=0;i<a.length;i++)o.push({start:a.start(i),end:a.end(i)});return this.bufferedInfo(o,r,n)}}catch(t){}return{len:0,start:r,end:r,nextStart:void 0}},t.bufferedInfo=function(t,e,r){e=Math.max(0,e),t.sort((function(t,e){return t.start-e.start||e.end-t.end}));var n=[];if(r)for(var i=0;i<t.length;i++){var a=n.length;if(a){var o=n[a-1].end;t[i].start-o<r?t[i].end>o&&(n[a-1].end=t[i].end):n.push(t[i])}else n.push(t[i])}else n=t;for(var s,l=0,u=e,c=e,d=0;d<n.length;d++){var h=n[d].start,f=n[d].end;if(e+r>=h&&e<f)u=h,l=(c=f)-e;else if(e+r<h){s=h;break}}return{len:l,start:u||0,end:c||0,nextStart:s}},t.getBuffered=function(t){try{return t.buffered}catch(t){return n.logger.log("failed to get media.buffered",t),i}},t}()},"./src/utils/cea-608-parser.ts":(t,e,r)=>{"use strict";r.r(e),r.d(e,{CaptionScreen:()=>b,Row:()=>y,default:()=>T});var n,i=r("./src/utils/logger.ts"),a={42:225,92:233,94:237,95:243,96:250,123:231,124:247,125:209,126:241,127:9608,128:174,129:176,130:189,131:191,132:8482,133:162,134:163,135:9834,136:224,137:32,138:232,139:226,140:234,141:238,142:244,143:251,144:193,145:201,146:211,147:218,148:220,149:252,150:8216,151:161,152:42,153:8217,154:9473,155:169,156:8480,157:8226,158:8220,159:8221,160:192,161:194,162:199,163:200,164:202,165:203,166:235,167:206,168:207,169:239,170:212,171:217,172:249,173:219,174:171,175:187,176:195,177:227,178:205,179:204,180:236,181:210,182:242,183:213,184:245,185:123,186:125,187:92,188:94,189:95,190:124,191:8764,192:196,193:228,194:214,195:246,196:223,197:165,198:164,199:9475,200:197,201:229,202:216,203:248,204:9487,205:9491,206:9495,207:9499},o=function(t){var e=t;return a.hasOwnProperty(t)&&(e=a[t]),String.fromCharCode(e)},s=15,l=100,u={17:1,18:3,21:5,22:7,23:9,16:11,19:12,20:14},c={17:2,18:4,21:6,22:8,23:10,19:13,20:15},d={25:1,26:3,29:5,30:7,31:9,24:11,27:12,28:14},h={25:2,26:4,29:6,30:8,31:10,27:13,28:15},f=["white","green","blue","cyan","red","yellow","magenta","black","transparent"];!function(t){t[t.ERROR=0]="ERROR",t[t.TEXT=1]="TEXT",t[t.WARNING=2]="WARNING",t[t.INFO=2]="INFO",t[t.DEBUG=3]="DEBUG",t[t.DATA=3]="DATA"}(n||(n={}));var p=function(){function t(){this.time=null,this.verboseLevel=n.ERROR}return t.prototype.log=function(t,e){if(this.verboseLevel>=t){var r="function"==typeof e?e():e;i.logger.log(this.time+" ["+t+"] "+r)}},t}(),g=function(t){for(var e=[],r=0;r<t.length;r++)e.push(t[r].toString(16));return e},v=function(){function t(t,e,r,n,i){this.foreground=void 0,this.underline=void 0,this.italics=void 0,this.background=void 0,this.flash=void 0,this.foreground=t||"white",this.underline=e||!1,this.italics=r||!1,this.background=n||"black",this.flash=i||!1}var e=t.prototype;return e.reset=function(){this.foreground="white",this.underline=!1,this.italics=!1,this.background="black",this.flash=!1},e.setStyles=function(t){for(var e=["foreground","underline","italics","background","flash"],r=0;r<e.length;r++){var n=e[r];t.hasOwnProperty(n)&&(this[n]=t[n])}},e.isDefault=function(){return"white"===this.foreground&&!this.underline&&!this.italics&&"black"===this.background&&!this.flash},e.equals=function(t){return this.foreground===t.foreground&&this.underline===t.underline&&this.italics===t.italics&&this.background===t.background&&this.flash===t.flash},e.copy=function(t){this.foreground=t.foreground,this.underline=t.underline,this.italics=t.italics,this.background=t.background,this.flash=t.flash},e.toString=function(){return"color="+this.foreground+", underline="+this.underline+", italics="+this.italics+", background="+this.background+", flash="+this.flash},t}(),m=function(){function t(t,e,r,n,i,a){this.uchar=void 0,this.penState=void 0,this.uchar=t||" ",this.penState=new v(e,r,n,i,a)}var e=t.prototype;return e.reset=function(){this.uchar=" ",this.penState.reset()},e.setChar=function(t,e){this.uchar=t,this.penState.copy(e)},e.setPenState=function(t){this.penState.copy(t)},e.equals=function(t){return this.uchar===t.uchar&&this.penState.equals(t.penState)},e.copy=function(t){this.uchar=t.uchar,this.penState.copy(t.penState)},e.isEmpty=function(){return" "===this.uchar&&this.penState.isDefault()},t}(),y=function(){function t(t){this.chars=void 0,this.pos=void 0,this.currPenState=void 0,this.cueStartTime=void 0,this.logger=void 0,this.chars=[];for(var e=0;e<l;e++)this.chars.push(new m);this.logger=t,this.pos=0,this.currPenState=new v}var e=t.prototype;return e.equals=function(t){for(var e=!0,r=0;r<l;r++)if(!this.chars[r].equals(t.chars[r])){e=!1;break}return e},e.copy=function(t){for(var e=0;e<l;e++)this.chars[e].copy(t.chars[e])},e.isEmpty=function(){for(var t=!0,e=0;e<l;e++)if(!this.chars[e].isEmpty()){t=!1;break}return t},e.setCursor=function(t){this.pos!==t&&(this.pos=t),this.pos<0?(this.logger.log(n.DEBUG,"Negative cursor position "+this.pos),this.pos=0):this.pos>l&&(this.logger.log(n.DEBUG,"Too large cursor position "+this.pos),this.pos=l)},e.moveCursor=function(t){var e=this.pos+t;if(t>1)for(var r=this.pos+1;r<e+1;r++)this.chars[r].setPenState(this.currPenState);this.setCursor(e)},e.backSpace=function(){this.moveCursor(-1),this.chars[this.pos].setChar(" ",this.currPenState)},e.insertChar=function(t){var e=this;t>=144&&this.backSpace();var r=o(t);this.pos>=l?this.logger.log(n.ERROR,(function(){return"Cannot insert "+t.toString(16)+" ("+r+") at position "+e.pos+". Skipping it!"})):(this.chars[this.pos].setChar(r,this.currPenState),this.moveCursor(1))},e.clearFromPos=function(t){var e;for(e=t;e<l;e++)this.chars[e].reset()},e.clear=function(){this.clearFromPos(0),this.pos=0,this.currPenState.reset()},e.clearToEndOfRow=function(){this.clearFromPos(this.pos)},e.getTextString=function(){for(var t=[],e=!0,r=0;r<l;r++){var n=this.chars[r].uchar;" "!==n&&(e=!1),t.push(n)}return e?"":t.join("")},e.setPenStyles=function(t){this.currPenState.setStyles(t),this.chars[this.pos].setPenState(this.currPenState)},t}(),b=function(){function t(t){this.rows=void 0,this.currRow=void 0,this.nrRollUpRows=void 0,this.lastOutputScreen=void 0,this.logger=void 0,this.rows=[];for(var e=0;e<s;e++)this.rows.push(new y(t));this.logger=t,this.currRow=14,this.nrRollUpRows=null,this.lastOutputScreen=null,this.reset()}var e=t.prototype;return e.reset=function(){for(var t=0;t<s;t++)this.rows[t].clear();this.currRow=14},e.equals=function(t){for(var e=!0,r=0;r<s;r++)if(!this.rows[r].equals(t.rows[r])){e=!1;break}return e},e.copy=function(t){for(var e=0;e<s;e++)this.rows[e].copy(t.rows[e])},e.isEmpty=function(){for(var t=!0,e=0;e<s;e++)if(!this.rows[e].isEmpty()){t=!1;break}return t},e.backSpace=function(){this.rows[this.currRow].backSpace()},e.clearToEndOfRow=function(){this.rows[this.currRow].clearToEndOfRow()},e.insertChar=function(t){this.rows[this.currRow].insertChar(t)},e.setPen=function(t){this.rows[this.currRow].setPenStyles(t)},e.moveCursor=function(t){this.rows[this.currRow].moveCursor(t)},e.setCursor=function(t){this.logger.log(n.INFO,"setCursor: "+t),this.rows[this.currRow].setCursor(t)},e.setPAC=function(t){this.logger.log(n.INFO,(function(){return"pacData = "+JSON.stringify(t)}));var e=t.row-1;if(this.nrRollUpRows&&e<this.nrRollUpRows-1&&(e=this.nrRollUpRows-1),this.nrRollUpRows&&this.currRow!==e){for(var r=0;r<s;r++)this.rows[r].clear();var i=this.currRow+1-this.nrRollUpRows,a=this.lastOutputScreen;if(a){var o=a.rows[i].cueStartTime,l=this.logger.time;if(o&&null!==l&&o<l)for(var u=0;u<this.nrRollUpRows;u++)this.rows[e-this.nrRollUpRows+u+1].copy(a.rows[i+u])}}this.currRow=e;var c=this.rows[this.currRow];if(null!==t.indent){var d=t.indent,h=Math.max(d-1,0);c.setCursor(t.indent),t.color=c.chars[h].penState.foreground}var f={foreground:t.color,underline:t.underline,italics:t.italics,background:"black",flash:!1};this.setPen(f)},e.setBkgData=function(t){this.logger.log(n.INFO,(function(){return"bkgData = "+JSON.stringify(t)})),this.backSpace(),this.setPen(t),this.insertChar(32)},e.setRollUpRows=function(t){this.nrRollUpRows=t},e.rollUp=function(){var t=this;if(null!==this.nrRollUpRows){this.logger.log(n.TEXT,(function(){return t.getDisplayText()}));var e=this.currRow+1-this.nrRollUpRows,r=this.rows.splice(e,1)[0];r.clear(),this.rows.splice(this.currRow,0,r),this.logger.log(n.INFO,"Rolling up")}else this.logger.log(n.DEBUG,"roll_up but nrRollUpRows not set yet")},e.getDisplayText=function(t){t=t||!1;for(var e=[],r="",n=-1,i=0;i<s;i++){var a=this.rows[i].getTextString();a&&(n=i+1,t?e.push("Row "+n+": '"+a+"'"):e.push(a.trim()))}return e.length>0&&(r=t?"["+e.join(" | ")+"]":e.join("\n")),r},e.getTextAndFormat=function(){return this.rows},t}(),E=function(){function t(t,e,r){this.chNr=void 0,this.outputFilter=void 0,this.mode=void 0,this.verbose=void 0,this.displayedMemory=void 0,this.nonDisplayedMemory=void 0,this.lastOutputScreen=void 0,this.currRollUpRow=void 0,this.writeScreen=void 0,this.cueStartTime=void 0,this.logger=void 0,this.chNr=t,this.outputFilter=e,this.mode=null,this.verbose=0,this.displayedMemory=new b(r),this.nonDisplayedMemory=new b(r),this.lastOutputScreen=new b(r),this.currRollUpRow=this.displayedMemory.rows[14],this.writeScreen=this.displayedMemory,this.mode=null,this.cueStartTime=null,this.logger=r}var e=t.prototype;return e.reset=function(){this.mode=null,this.displayedMemory.reset(),this.nonDisplayedMemory.reset(),this.lastOutputScreen.reset(),this.outputFilter.reset(),this.currRollUpRow=this.displayedMemory.rows[14],this.writeScreen=this.displayedMemory,this.mode=null,this.cueStartTime=null},e.getHandler=function(){return this.outputFilter},e.setHandler=function(t){this.outputFilter=t},e.setPAC=function(t){this.writeScreen.setPAC(t)},e.setBkgData=function(t){this.writeScreen.setBkgData(t)},e.setMode=function(t){t!==this.mode&&(this.mode=t,this.logger.log(n.INFO,(function(){return"MODE="+t})),"MODE_POP-ON"===this.mode?this.writeScreen=this.nonDisplayedMemory:(this.writeScreen=this.displayedMemory,this.writeScreen.reset()),"MODE_ROLL-UP"!==this.mode&&(this.displayedMemory.nrRollUpRows=null,this.nonDisplayedMemory.nrRollUpRows=null),this.mode=t)},e.insertChars=function(t){for(var e=this,r=0;r<t.length;r++)this.writeScreen.insertChar(t[r]);var i=this.writeScreen===this.displayedMemory?"DISP":"NON_DISP";this.logger.log(n.INFO,(function(){return i+": "+e.writeScreen.getDisplayText(!0)})),"MODE_PAINT-ON"!==this.mode&&"MODE_ROLL-UP"!==this.mode||(this.logger.log(n.TEXT,(function(){return"DISPLAYED: "+e.displayedMemory.getDisplayText(!0)})),this.outputDataUpdate())},e.ccRCL=function(){this.logger.log(n.INFO,"RCL - Resume Caption Loading"),this.setMode("MODE_POP-ON")},e.ccBS=function(){this.logger.log(n.INFO,"BS - BackSpace"),"MODE_TEXT"!==this.mode&&(this.writeScreen.backSpace(),this.writeScreen===this.displayedMemory&&this.outputDataUpdate())},e.ccAOF=function(){},e.ccAON=function(){},e.ccDER=function(){this.logger.log(n.INFO,"DER- Delete to End of Row"),this.writeScreen.clearToEndOfRow(),this.outputDataUpdate()},e.ccRU=function(t){this.logger.log(n.INFO,"RU("+t+") - Roll Up"),this.writeScreen=this.displayedMemory,this.setMode("MODE_ROLL-UP"),this.writeScreen.setRollUpRows(t)},e.ccFON=function(){this.logger.log(n.INFO,"FON - Flash On"),this.writeScreen.setPen({flash:!0})},e.ccRDC=function(){this.logger.log(n.INFO,"RDC - Resume Direct Captioning"),this.setMode("MODE_PAINT-ON")},e.ccTR=function(){this.logger.log(n.INFO,"TR"),this.setMode("MODE_TEXT")},e.ccRTD=function(){this.logger.log(n.INFO,"RTD"),this.setMode("MODE_TEXT")},e.ccEDM=function(){this.logger.log(n.INFO,"EDM - Erase Displayed Memory"),this.displayedMemory.reset(),this.outputDataUpdate(!0)},e.ccCR=function(){this.logger.log(n.INFO,"CR - Carriage Return"),this.writeScreen.rollUp(),this.outputDataUpdate(!0)},e.ccENM=function(){this.logger.log(n.INFO,"ENM - Erase Non-displayed Memory"),this.nonDisplayedMemory.reset()},e.ccEOC=function(){var t=this;if(this.logger.log(n.INFO,"EOC - End Of Caption"),"MODE_POP-ON"===this.mode){var e=this.displayedMemory;this.displayedMemory=this.nonDisplayedMemory,this.nonDisplayedMemory=e,this.writeScreen=this.nonDisplayedMemory,this.logger.log(n.TEXT,(function(){return"DISP: "+t.displayedMemory.getDisplayText()}))}this.outputDataUpdate(!0)},e.ccTO=function(t){this.logger.log(n.INFO,"TO("+t+") - Tab Offset"),this.writeScreen.moveCursor(t)},e.ccMIDROW=function(t){var e={flash:!1};if(e.underline=t%2==1,e.italics=t>=46,e.italics)e.foreground="white";else{var r=Math.floor(t/2)-16;e.foreground=["white","green","blue","cyan","red","yellow","magenta"][r]}this.logger.log(n.INFO,"MIDROW: "+JSON.stringify(e)),this.writeScreen.setPen(e)},e.outputDataUpdate=function(t){void 0===t&&(t=!1);var e=this.logger.time;null!==e&&this.outputFilter&&(null!==this.cueStartTime||this.displayedMemory.isEmpty()?this.displayedMemory.equals(this.lastOutputScreen)||(this.outputFilter.newCue(this.cueStartTime,e,this.lastOutputScreen),t&&this.outputFilter.dispatchCue&&this.outputFilter.dispatchCue(),this.cueStartTime=this.displayedMemory.isEmpty()?null:e):this.cueStartTime=e,this.lastOutputScreen.copy(this.displayedMemory))},e.cueSplitAtTime=function(t){this.outputFilter&&(this.displayedMemory.isEmpty()||(this.outputFilter.newCue&&this.outputFilter.newCue(this.cueStartTime,t,this.displayedMemory),this.cueStartTime=t))},t}();function x(t,e,r){r.a=t,r.b=e}function S(t,e,r){return r.a===t&&r.b===e}const T=function(){function t(t,e,r){this.channels=void 0,this.currentChannel=0,this.cmdHistory=void 0,this.logger=void 0;var n=new p;this.channels=[null,new E(t,e,n),new E(t+1,r,n)],this.cmdHistory={a:null,b:null},this.logger=n}var e=t.prototype;return e.getHandler=function(t){return this.channels[t].getHandler()},e.setHandler=function(t,e){this.channels[t].setHandler(e)},e.addData=function(t,e){var r,i,a,o=!1;this.logger.time=t;for(var s=0;s<e.length;s+=2)if(i=127&e[s],a=127&e[s+1],0!==i||0!==a){if(this.logger.log(n.DATA,"["+g([e[s],e[s+1]])+"] -> ("+g([i,a])+")"),(r=this.parseCmd(i,a))||(r=this.parseMidrow(i,a)),r||(r=this.parsePAC(i,a)),r||(r=this.parseBackgroundAttributes(i,a)),!r&&(o=this.parseChars(i,a))){var l=this.currentChannel;l&&l>0?this.channels[l].insertChars(o):this.logger.log(n.WARNING,"No channel found yet. TEXT-MODE?")}r||o||this.logger.log(n.WARNING,"Couldn't parse cleaned data "+g([i,a])+" orig: "+g([e[s],e[s+1]]))}},e.parseCmd=function(t,e){var r=this.cmdHistory;if(!((20===t||28===t||21===t||29===t)&&e>=32&&e<=47||(23===t||31===t)&&e>=33&&e<=35))return!1;if(S(t,e,r))return x(null,null,r),this.logger.log(n.DEBUG,"Repeated command ("+g([t,e])+") is dropped"),!0;var i=20===t||21===t||23===t?1:2,a=this.channels[i];return 20===t||21===t||28===t||29===t?32===e?a.ccRCL():33===e?a.ccBS():34===e?a.ccAOF():35===e?a.ccAON():36===e?a.ccDER():37===e?a.ccRU(2):38===e?a.ccRU(3):39===e?a.ccRU(4):40===e?a.ccFON():41===e?a.ccRDC():42===e?a.ccTR():43===e?a.ccRTD():44===e?a.ccEDM():45===e?a.ccCR():46===e?a.ccENM():47===e&&a.ccEOC():a.ccTO(e-32),x(t,e,r),this.currentChannel=i,!0},e.parseMidrow=function(t,e){var r=0;if((17===t||25===t)&&e>=32&&e<=47){if((r=17===t?1:2)!==this.currentChannel)return this.logger.log(n.ERROR,"Mismatch channel in midrow parsing"),!1;var i=this.channels[r];return!!i&&(i.ccMIDROW(e),this.logger.log(n.DEBUG,"MIDROW ("+g([t,e])+")"),!0)}return!1},e.parsePAC=function(t,e){var r,n=this.cmdHistory;if(!((t>=17&&t<=23||t>=25&&t<=31)&&e>=64&&e<=127||(16===t||24===t)&&e>=64&&e<=95))return!1;if(S(t,e,n))return x(null,null,n),!0;var i=t<=23?1:2;r=e>=64&&e<=95?1===i?u[t]:d[t]:1===i?c[t]:h[t];var a=this.channels[i];return!!a&&(a.setPAC(this.interpretPAC(r,e)),x(t,e,n),this.currentChannel=i,!0)},e.interpretPAC=function(t,e){var r,n={color:null,italics:!1,indent:null,underline:!1,row:t};return r=e>95?e-96:e-64,n.underline=1==(1&r),r<=13?n.color=["white","green","blue","cyan","red","yellow","magenta","white"][Math.floor(r/2)]:r<=15?(n.italics=!0,n.color="white"):n.indent=4*Math.floor((r-16)/2),n},e.parseChars=function(t,e){var r,i,a=null,s=null;if(t>=25?(r=2,s=t-8):(r=1,s=t),s>=17&&s<=19?(i=17===s?e+80:18===s?e+112:e+144,this.logger.log(n.INFO,"Special char '"+o(i)+"' in channel "+r),a=[i]):t>=32&&t<=127&&(a=0===e?[t]:[t,e]),a){var l=g(a);this.logger.log(n.DEBUG,"Char codes = "+l.join(",")),x(t,e,this.cmdHistory)}return a},e.parseBackgroundAttributes=function(t,e){var r;if(!((16===t||24===t)&&e>=32&&e<=47||(23===t||31===t)&&e>=45&&e<=47))return!1;var n={};16===t||24===t?(r=Math.floor((e-32)/2),n.background=f[r],e%2==1&&(n.background=n.background+"_semi")):45===e?n.background="transparent":(n.foreground="black",47===e&&(n.underline=!0));var i=t<=23?1:2;return this.channels[i].setBkgData(n),x(t,e,this.cmdHistory),!0},e.reset=function(){for(var t=0;t<Object.keys(this.channels).length;t++){var e=this.channels[t];e&&e.reset()}this.cmdHistory={a:null,b:null}},e.cueSplitAtTime=function(t){for(var e=0;e<this.channels.length;e++){var r=this.channels[e];r&&r.cueSplitAtTime(t)}},t}()},"./src/utils/codecs.ts":(t,e,r)=>{"use strict";r.r(e),r.d(e,{isCodecSupportedInMp4:()=>a,isCodecType:()=>i});var n={audio:{a3ds:!0,"ac-3":!0,"ac-4":!0,alac:!0,alaw:!0,dra1:!0,"dts+":!0,"dts-":!0,dtsc:!0,dtse:!0,dtsh:!0,"ec-3":!0,enca:!0,g719:!0,g726:!0,m4ae:!0,mha1:!0,mha2:!0,mhm1:!0,mhm2:!0,mlpa:!0,mp4a:!0,"raw ":!0,Opus:!0,opus:!0,samr:!0,sawb:!0,sawp:!0,sevc:!0,sqcp:!0,ssmv:!0,twos:!0,ulaw:!0},video:{avc1:!0,avc2:!0,avc3:!0,avc4:!0,avcp:!0,av01:!0,drac:!0,dva1:!0,dvav:!0,dvh1:!0,dvhe:!0,encv:!0,hev1:!0,hvc1:!0,mjp2:!0,mp4v:!0,mvc1:!0,mvc2:!0,mvc3:!0,mvc4:!0,resv:!0,rv60:!0,s263:!0,svc1:!0,svc2:!0,"vc-1":!0,vp08:!0,vp09:!0},text:{stpp:!0,wvtt:!0}};function i(t,e){var r=n[e];return!!r&&!0===r[t.slice(0,4)]}function a(t,e){return MediaSource.isTypeSupported((e||"video")+'/mp4;codecs="'+t+'"')}},"./src/utils/cues.ts":(t,e,r)=>{"use strict";r.r(e),r.d(e,{default:()=>s});var n=r("./src/utils/vttparser.ts"),i=r("./src/utils/webvtt-parser.ts"),a=r("./src/utils/texttrack-utils.ts"),o=/\s/;const s={newCue:function(t,e,r,s){for(var l,u,c,d,h,f=[],p=self.VTTCue||self.TextTrackCue,g=0;g<s.rows.length;g++)if(c=!0,d=0,h="",!(l=s.rows[g]).isEmpty()){for(var v=0;v<l.chars.length;v++)o.test(l.chars[v].uchar)&&c?d++:(h+=l.chars[v].uchar,c=!1);l.cueStartTime=e,e===r&&(r+=1e-4),d>=16?d--:d++;var m=(0,n.fixLineBreaks)(h.trim()),y=(0,i.generateCueId)(e,r,m);t&&t.cues&&t.cues.getCueById(y)||((u=new p(e,r,m)).id=y,u.line=g+1,u.align="left",u.position=10+Math.min(80,10*Math.floor(8*d/32)),f.push(u))}return t&&f.length&&(f.sort((function(t,e){return"auto"===t.line||"auto"===e.line?0:t.line>8&&e.line>8?e.line-t.line:t.line-e.line})),f.forEach((function(e){return(0,a.addCueToTrack)(t,e)}))),f}}},"./src/utils/discontinuities.ts":(t,e,r)=>{"use strict";r.r(e),r.d(e,{adjustSlidingStart:()=>c,alignMediaPlaylistByPDT:()=>f,alignPDT:()=>h,alignStream:()=>d,findDiscontinuousReferenceFrag:()=>l,findFirstFragWithCC:()=>o,shouldAlignOnDiscontinuities:()=>s});var n=r("./src/polyfills/number.ts"),i=r("./src/utils/logger.ts"),a=r("./src/controller/level-helper.ts");function o(t,e){for(var r=null,n=0,i=t.length;n<i;n++){var a=t[n];if(a&&a.cc===e){r=a;break}}return r}function s(t,e,r){return!(!e.details||!(r.endCC>r.startCC||t&&t.cc<r.startCC))}function l(t,e,r){void 0===r&&(r=0);var n=t.fragments,a=e.fragments;if(a.length&&n.length){var s=o(n,a[0].cc);if(s&&(!s||s.startPTS))return s;i.logger.log("No frag in previous level to align on")}else i.logger.log("No fragments to align")}function u(t,e){if(t){var r=t.start+e;t.start=t.startPTS=r,t.endPTS=r+t.duration}}function c(t,e){for(var r=e.fragments,n=0,i=r.length;n<i;n++)u(r[n],t);e.fragmentHint&&u(e.fragmentHint,t),e.alignedSliding=!0}function d(t,e,r){e&&(function(t,e,r){if(s(t,r,e)){var a=l(r.details,e);a&&(0,n.isFiniteNumber)(a.start)&&(i.logger.log("Adjusting PTS using last level due to CC increase within current level "+e.url),c(a.start,e))}}(t,r,e),!r.alignedSliding&&e.details&&h(r,e.details),r.alignedSliding||!e.details||r.skippedSegments||(0,a.adjustSliding)(e.details,r))}function h(t,e){if(e.fragments.length&&t.hasProgramDateTime&&e.hasProgramDateTime){var r=e.fragments[0].programDateTime,a=t.fragments[0].programDateTime,o=(a-r)/1e3+e.fragments[0].start;o&&(0,n.isFiniteNumber)(o)&&(i.logger.log("Adjusting PTS using programDateTime delta "+(a-r)+"ms, sliding:"+o.toFixed(3)+" "+t.url+" "),c(o,t))}}function f(t,e){if(t.hasProgramDateTime&&e.hasProgramDateTime){var r=t.fragments,n=e.fragments;if(r.length&&n.length){var i=n[Math.round(n.length/2)-1],a=o(r,i.cc)||r[Math.round(r.length/2)-1],s=i.programDateTime,l=a.programDateTime;null!==s&&null!==l&&c((l-s)/1e3-(a.start-i.start),t)}}}},"./src/utils/ewma-bandwidth-estimator.ts":(t,e,r)=>{"use strict";r.r(e),r.d(e,{default:()=>i});var n=r("./src/utils/ewma.ts");const i=function(){function t(t,e,r){this.defaultEstimate_=void 0,this.minWeight_=void 0,this.minDelayMs_=void 0,this.slow_=void 0,this.fast_=void 0,this.defaultEstimate_=r,this.minWeight_=.001,this.minDelayMs_=50,this.slow_=new n.default(t),this.fast_=new n.default(e)}var e=t.prototype;return e.update=function(t,e){var r=this.slow_,i=this.fast_;this.slow_.halfLife!==t&&(this.slow_=new n.default(t,r.getEstimate(),r.getTotalWeight())),this.fast_.halfLife!==e&&(this.fast_=new n.default(e,i.getEstimate(),i.getTotalWeight()))},e.sample=function(t,e){var r=(t=Math.max(t,this.minDelayMs_))/1e3,n=8*e/r;this.fast_.sample(r,n),this.slow_.sample(r,n)},e.canEstimate=function(){var t=this.fast_;return t&&t.getTotalWeight()>=this.minWeight_},e.getEstimate=function(){return this.canEstimate()?Math.min(this.fast_.getEstimate(),this.slow_.getEstimate()):this.defaultEstimate_},e.destroy=function(){},t}()},"./src/utils/ewma.ts":(t,e,r)=>{"use strict";r.r(e),r.d(e,{default:()=>n});const n=function(){function t(t,e,r){void 0===e&&(e=0),void 0===r&&(r=0),this.halfLife=void 0,this.alpha_=void 0,this.estimate_=void 0,this.totalWeight_=void 0,this.halfLife=t,this.alpha_=t?Math.exp(Math.log(.5)/t):0,this.estimate_=e,this.totalWeight_=r}var e=t.prototype;return e.sample=function(t,e){var r=Math.pow(this.alpha_,t);this.estimate_=e*(1-r)+r*this.estimate_,this.totalWeight_+=t},e.getTotalWeight=function(){return this.totalWeight_},e.getEstimate=function(){if(this.alpha_){var t=1-Math.pow(this.alpha_,this.totalWeight_);if(t)return this.estimate_/t}return this.estimate_},t}()},"./src/utils/fetch-loader.ts":(t,e,r)=>{"use strict";r.r(e),r.d(e,{default:()=>v,fetchSupported:()=>h});var n=r("./src/polyfills/number.ts"),i=r("./src/loader/load-stats.ts"),a=r("./src/demux/chunk-cache.ts");function o(t){var e="function"==typeof Map?new Map:void 0;return o=function(t){if(null===t||(r=t,-1===Function.toString.call(r).indexOf("[native code]")))return t;var r;if("function"!=typeof t)throw new TypeError("Super expression must either be null or a function");if(void 0!==e){if(e.has(t))return e.get(t);e.set(t,n)}function n(){return s(t,arguments,c(this).constructor)}return n.prototype=Object.create(t.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),u(n,t)},o(t)}function s(t,e,r){return s=l()?Reflect.construct.bind():function(t,e,r){var n=[null];n.push.apply(n,e);var i=new(Function.bind.apply(t,n));return r&&u(i,r.prototype),i},s.apply(null,arguments)}function l(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}function u(t,e){return u=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},u(t,e)}function c(t){return c=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},c(t)}function d(){return d=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(t[n]=r[n])}return t},d.apply(this,arguments)}function h(){if(self.fetch&&self.AbortController&&self.ReadableStream&&self.Request)try{return new self.ReadableStream({}),!0}catch(t){}return!1}var f=function(){function t(t){this.fetchSetup=void 0,this.requestTimeout=void 0,this.request=void 0,this.response=void 0,this.controller=void 0,this.context=void 0,this.config=null,this.callbacks=null,this.stats=void 0,this.loader=null,this.fetchSetup=t.fetchSetup||p,this.controller=new self.AbortController,this.stats=new i.LoadStats}var e=t.prototype;return e.destroy=function(){this.loader=this.callbacks=null,this.abortInternal()},e.abortInternal=function(){var t=this.response;t&&t.ok||(this.stats.aborted=!0,this.controller.abort())},e.abort=function(){var t;this.abortInternal(),null!==(t=this.callbacks)&&void 0!==t&&t.onAbort&&this.callbacks.onAbort(this.stats,this.context,this.response)},e.load=function(t,e,r){var i=this,a=this.stats;if(a.loading.start)throw new Error("Loader can only be used once.");a.loading.start=self.performance.now();var o=function(t,e){var r={method:"GET",mode:"cors",credentials:"same-origin",signal:e,headers:new self.Headers(d({},t.headers))};return t.rangeEnd&&r.headers.set("Range","bytes="+t.rangeStart+"-"+String(t.rangeEnd-1)),r}(t,this.controller.signal),s=r.onProgress,l="arraybuffer"===t.responseType,u=l?"byteLength":"length";this.context=t,this.config=e,this.callbacks=r,this.request=this.fetchSetup(t,o),self.clearTimeout(this.requestTimeout),this.requestTimeout=self.setTimeout((function(){i.abortInternal(),r.onTimeout(a,t,i.response)}),e.timeout),self.fetch(this.request).then((function(r){if(i.response=i.loader=r,!r.ok){var o=r.status,u=r.statusText;throw new g(u||"fetch, bad network response",o,r)}return a.loading.first=Math.max(self.performance.now(),a.loading.start),a.total=parseInt(r.headers.get("Content-Length")||"0"),s&&(0,n.isFiniteNumber)(e.highWaterMark)?i.loadProgressively(r,a,t,e.highWaterMark,s):l?r.arrayBuffer():r.text()})).then((function(o){var l=i.response;self.clearTimeout(i.requestTimeout),a.loading.end=Math.max(self.performance.now(),a.loading.first);var c=o[u];c&&(a.loaded=a.total=c);var d={url:l.url,data:o};s&&!(0,n.isFiniteNumber)(e.highWaterMark)&&s(a,t,o,l),r.onSuccess(d,a,t,l)})).catch((function(e){if(self.clearTimeout(i.requestTimeout),!a.aborted){var n=e&&e.code||0,o=e?e.message:null;r.onError({code:n,text:o},t,e?e.details:null)}}))},e.getCacheAge=function(){var t=null;if(this.response){var e=this.response.headers.get("age");t=e?parseFloat(e):null}return t},e.loadProgressively=function(t,e,r,n,i){void 0===n&&(n=0);var o=new a.default,s=t.body.getReader();return function a(){return s.read().then((function(s){if(s.done)return o.dataLength&&i(e,r,o.flush(),t),Promise.resolve(new ArrayBuffer(0));var l=s.value,u=l.length;return e.loaded+=u,u<n||o.dataLength?(o.push(l),o.dataLength>=n&&i(e,r,o.flush(),t)):i(e,r,l,t),a()})).catch((function(){return Promise.reject()}))}()},t}();function p(t,e){return new self.Request(t.url,e)}var g=function(t){var e,r;function n(e,r,n){var i;return(i=t.call(this,e)||this).code=void 0,i.details=void 0,i.code=r,i.details=n,i}return r=t,(e=n).prototype=Object.create(r.prototype),e.prototype.constructor=e,u(e,r),n}(o(Error));const v=f},"./src/utils/hex.ts":(t,e,r)=>{"use strict";r.r(e),r.d(e,{default:()=>n});const n={hexDump:function(t){for(var e="",r=0;r<t.length;r++){var n=t[r].toString(16);n.length<2&&(n="0"+n),e+=n}return e}}},"./src/utils/imsc1-ttml-parser.ts":(t,e,r)=>{"use strict";r.r(e),r.d(e,{IMSC1_CODEC:()=>c,parseIMSC1:()=>p});var n=r("./src/utils/mp4-tools.ts"),i=r("./src/utils/vttparser.ts"),a=r("./src/utils/vttcue.ts"),o=r("./src/demux/id3.ts"),s=r("./src/utils/timescale-conversion.ts"),l=r("./src/utils/webvtt-parser.ts");function u(){return u=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(t[n]=r[n])}return t},u.apply(this,arguments)}var c="stpp.ttml.im1t",d=/^(\d{2,}):(\d{2}):(\d{2}):(\d{2})\.?(\d+)?$/,h=/^(\d*(?:\.\d*)?)(h|m|s|ms|f|t)$/,f={left:"start",center:"center",right:"end",start:"start",end:"end"};function p(t,e,r,i,c){var d=(0,n.findBox)(new Uint8Array(t),["mdat"]);if(0!==d.length){var h=d.map((function(t){return(0,o.utf8ArrayToStr)(t)})),p=(0,s.toTimescaleFromScale)(e,1,r);try{h.forEach((function(t){return i(function(t,e){var r=(new DOMParser).parseFromString(t,"text/xml").getElementsByTagName("tt")[0];if(!r)throw new Error("Invalid ttml");var n={frameRate:30,subFrameRate:1,frameRateMultiplier:0,tickRate:0},i=Object.keys(n).reduce((function(t,e){return t[e]=r.getAttribute("ttp:"+e)||n[e],t}),{}),o="preserve"!==r.getAttribute("xml:space"),s=v(g(r,"styling","style")),c=v(g(r,"layout","region")),d=g(r,"body","[begin]");return[].map.call(d,(function(t){var r=m(t,o);if(!r||!t.hasAttribute("begin"))return null;var n=E(t.getAttribute("begin"),i),d=E(t.getAttribute("dur"),i),h=E(t.getAttribute("end"),i);if(null===n)throw b(t);if(null===h){if(null===d)throw b(t);h=n+d}var p=new a.default(n-e,h-e,r);p.id=(0,l.generateCueId)(p.startTime,p.endTime,p.text);var g=function(t,e,r){var n="http://www.w3.org/ns/ttml#styling",i=null,a=null!=t&&t.hasAttribute("style")?t.getAttribute("style"):null;return a&&r.hasOwnProperty(a)&&(i=r[a]),["displayAlign","textAlign","color","backgroundColor","fontSize","fontFamily"].reduce((function(r,a){var o=y(e,n,a)||y(t,n,a)||y(i,n,a);return o&&(r[a]=o),r}),{})}(c[t.getAttribute("region")],s[t.getAttribute("style")],s),v=g.textAlign;if(v){var x=f[v];x&&(p.lineAlign=x),p.align=v}return u(p,g),p})).filter((function(t){return null!==t}))}(t,p))}))}catch(t){c(t)}}else c(new Error("Could not parse IMSC1 mdat"))}function g(t,e,r){var n=t.getElementsByTagName(e)[0];return n?[].slice.call(n.querySelectorAll(r)):[]}function v(t){return t.reduce((function(t,e){var r=e.getAttribute("xml:id");return r&&(t[r]=e),t}),{})}function m(t,e){return[].slice.call(t.childNodes).reduce((function(t,r,n){var i;return"br"===r.nodeName&&n?t+"\n":null!==(i=r.childNodes)&&void 0!==i&&i.length?m(r,e):e?t+r.textContent.trim().replace(/\s+/g," "):t+r.textContent}),"")}function y(t,e,r){return t&&t.hasAttributeNS(e,r)?t.getAttributeNS(e,r):null}function b(t){return new Error("Could not parse ttml timestamp "+t)}function E(t,e){if(!t)return null;var r=(0,i.parseTimeStamp)(t);return null===r&&(d.test(t)?r=function(t,e){var r=d.exec(t),n=(0|r[4])+(0|r[5])/e.subFrameRate;return 3600*(0|r[1])+60*(0|r[2])+(0|r[3])+n/e.frameRate}(t,e):h.test(t)&&(r=function(t,e){var r=h.exec(t),n=Number(r[1]);switch(r[2]){case"h":return 3600*n;case"m":return 60*n;case"ms":return 1e3*n;case"f":return n/e.frameRate;case"t":return n/e.tickRate}return n}(t,e))),r}},"./src/utils/keysystem-util.ts":(t,e,r)=>{"use strict";r.r(e),r.d(e,{changeEndianness:()=>i,convertDataUriToArrayBytes:()=>a,strToUtf8array:()=>o});var n=r("./src/utils/numeric-encoding-utils.ts");function i(t){var e=function(t,e,r){var n=t[e];t[e]=t[r],t[r]=n};e(t,0,3),e(t,1,2),e(t,4,5),e(t,6,7)}function a(t){var e,r,i=t.split(":"),a=null;if("data"===i[0]&&2===i.length){var s=i[1].split(";"),l=s[s.length-1].split(",");if(2===l.length){var u="base64"===l[0],c=l[1];u?(s.splice(-1,1),a=(0,n.base64Decode)(c)):(e=o(c).subarray(0,16),(r=new Uint8Array(16)).set(e,16-e.length),a=r)}}return a}function o(t){return Uint8Array.from(unescape(encodeURIComponent(t)),(function(t){return t.charCodeAt(0)}))}},"./src/utils/logger.ts":(t,e,r)=>{"use strict";r.r(e),r.d(e,{enableLogs:()=>s,logger:()=>l});var n=function(){},i={trace:n,debug:n,log:n,warn:n,info:n,error:n},a=i;function o(t){var e=self.console[t];return e?e.bind(self.console,"["+t+"] >"):n}function s(t,e){if(self.console&&!0===t||"object"==typeof t){!function(t){for(var e=arguments.length,r=new Array(e>1?e-1:0),n=1;n<e;n++)r[n-1]=arguments[n];r.forEach((function(e){a[e]=t[e]?t[e].bind(t):o(e)}))}(t,"debug","log","info","warn","error");try{a.log('Debug logs enabled for "'+e+'"')}catch(t){a=i}}else a=i}var l=i},"./src/utils/mediakeys-helper.ts":(t,e,r)=>{"use strict";var n,i,a;function o(t){switch(t){case i.FAIRPLAY:return n.FAIRPLAY;case i.PLAYREADY:return n.PLAYREADY;case i.WIDEVINE:return n.WIDEVINE;case i.CLEARKEY:return n.CLEARKEY}}function s(t){if(t===a.WIDEVINE)return n.WIDEVINE}function l(t){switch(t){case n.FAIRPLAY:return i.FAIRPLAY;case n.PLAYREADY:return i.PLAYREADY;case n.WIDEVINE:return i.WIDEVINE;case n.CLEARKEY:return i.CLEARKEY}}function u(t){var e=t.drmSystems,r=t.widevineLicenseUrl,i=e?[n.FAIRPLAY,n.WIDEVINE,n.PLAYREADY,n.CLEARKEY].filter((function(t){return!!e[t]})):[];return!i[n.WIDEVINE]&&r&&i.push(n.WIDEVINE),i}r.r(e),r.d(e,{KeySystemFormats:()=>i,KeySystemIds:()=>a,KeySystems:()=>n,getKeySystemsForConfig:()=>u,getSupportedMediaKeySystemConfigurations:()=>d,keySystemDomainToKeySystemFormat:()=>l,keySystemFormatToKeySystemDomain:()=>o,keySystemIdToKeySystemDomain:()=>s,requestMediaKeySystemAccess:()=>c}),function(t){t.CLEARKEY="org.w3.clearkey",t.FAIRPLAY="com.apple.fps",t.PLAYREADY="com.microsoft.playready",t.WIDEVINE="com.widevine.alpha"}(n||(n={})),function(t){t.CLEARKEY="org.w3.clearkey",t.FAIRPLAY="com.apple.streamingkeydelivery",t.PLAYREADY="com.microsoft.playready",t.WIDEVINE="urn:uuid:edef8ba9-79d6-4ace-a3c8-27dcd51d21ed"}(i||(i={})),function(t){t.WIDEVINE="edef8ba979d64acea3c827dcd51d21ed"}(a||(a={}));var c="undefined"!=typeof self&&self.navigator&&self.navigator.requestMediaKeySystemAccess?self.navigator.requestMediaKeySystemAccess.bind(self.navigator):null;function d(t,e,r,i){var a;switch(t){case n.FAIRPLAY:a=["cenc","sinf"];break;case n.WIDEVINE:case n.PLAYREADY:a=["cenc"];break;case n.CLEARKEY:a=["cenc","keyids"];break;default:throw new Error("Unknown key-system: "+t)}return function(t,e,r,n){return[{initDataTypes:t,persistentState:n.persistentState||"not-allowed",distinctiveIdentifier:n.distinctiveIdentifier||"not-allowed",sessionTypes:n.sessionTypes||[n.sessionType||"temporary"],audioCapabilities:e.map((function(t){return{contentType:'audio/mp4; codecs="'+t+'"',robustness:n.audioRobustness||"",encryptionScheme:n.audioEncryptionScheme||null}})),videoCapabilities:r.map((function(t){return{contentType:'video/mp4; codecs="'+t+'"',robustness:n.videoRobustness||"",encryptionScheme:n.videoEncryptionScheme||null}}))}]}(a,e,r,i)}},"./src/utils/mediasource-helper.ts":(t,e,r)=>{"use strict";function n(){return self.MediaSource||self.WebKitMediaSource}r.r(e),r.d(e,{getMediaSource:()=>n})},"./src/utils/mp4-tools.ts":(t,e,r)=>{"use strict";r.r(e),r.d(e,{RemuxerTrackIdConfig:()=>d,appendUint8Array:()=>k,bin2str:()=>h,computeRawDurationFromSamples:()=>w,discardEPB:()=>R,findBox:()=>m,getDuration:()=>T,getStartDTS:()=>S,mp4Box:()=>O,mp4pssh:()=>M,offsetStartDTS:()=>_,parseEmsg:()=>I,parseInitSegment:()=>b,parsePssh:()=>P,parseSEIMessageFromNALu:()=>L,parseSamples:()=>C,parseSegmentIndex:()=>y,parseSinf:()=>x,patchEncyptionData:()=>E,readSint32:()=>g,readUint16:()=>f,readUint32:()=>p,segmentValidRange:()=>A,writeUint32:()=>v});var n=r("./src/loader/fragment.ts"),a=r("./src/utils/typed-array.ts"),o=r("./src/demux/id3.ts"),s=r("./src/utils/logger.ts"),l=r("./src/utils/hex.ts"),u=Math.pow(2,32)-1,c=[].push,d={video:1,audio:2,id3:3,text:4};function h(t){return String.fromCharCode.apply(null,t)}function f(t,e){var r=t[e]<<8|t[e+1];return r<0?65536+r:r}function p(t,e){var r=g(t,e);return r<0?4294967296+r:r}function g(t,e){return t[e]<<24|t[e+1]<<16|t[e+2]<<8|t[e+3]}function v(t,e,r){t[e]=r>>24,t[e+1]=r>>16&255,t[e+2]=r>>8&255,t[e+3]=255&r}function m(t,e){var r=[];if(!e.length)return r;for(var n=t.byteLength,i=0;i<n;){var a=p(t,i),o=a>1?i+a:n;if(h(t.subarray(i+4,i+8))===e[0])if(1===e.length)r.push(t.subarray(i+8,o));else{var s=m(t.subarray(i+8,o),e.slice(1));s.length&&c.apply(r,s)}i=o}return r}function y(t){var e=[],r=t[0],n=8,a=p(t,n);n+=4,n+=0===r?8:16,n+=2;var o=t.length+0,s=f(t,n);n+=2;for(var l=0;l<s;l++){var u=n,c=p(t,u);u+=4;var d=2147483647&c;if(1==(2147483648&c)>>>31)return i.warn("SIDX has hierarchical references (not supported)"),null;var h=p(t,u);u+=4,e.push({referenceSize:d,subsegmentDuration:h,info:{duration:h/a,start:o,end:o+d-1}}),o+=d,n=u+=4}return{earliestPresentationTime:0,timescale:a,version:r,referencesCount:s,references:e}}function b(t){for(var e=[],r=m(t,["moov","trak"]),i=0;i<r.length;i++){var a=r[i],o=m(a,["tkhd"])[0];if(o){var s=o[0],l=0===s?12:20,u=p(o,l),c=m(a,["mdia","mdhd"])[0];if(c){var d=p(c,l=0===(s=c[0])?12:20),f=m(a,["mdia","hdlr"])[0];if(f){var g=h(f.subarray(8,12)),v={soun:n.ElementaryStreamTypes.AUDIO,vide:n.ElementaryStreamTypes.VIDEO}[g];if(v){var y=m(a,["mdia","minf","stbl","stsd"])[0],b=void 0;y&&(b=h(y.subarray(12,16))),e[u]={timescale:d,type:v},e[v]={timescale:d,id:u,codec:b}}}}}}return m(t,["moov","mvex","trex"]).forEach((function(t){var r=p(t,4),n=e[r];n&&(n.default={duration:p(t,12),flags:p(t,20)})})),e}function E(t,e){if(!t||!e)return t;var r=e.keyId;return r&&e.isCommonEncryption&&m(t,["moov","trak"]).forEach((function(t){var e=m(t,["mdia","minf","stbl","stsd"])[0].subarray(8),n=m(e,["enca"]),i=n.length>0;i||(n=m(e,["encv"])),n.forEach((function(t){m(i?t.subarray(28):t.subarray(78),["sinf"]).forEach((function(t){var e=x(t);if(e){var n=e.subarray(8,24);n.some((function(t){return 0!==t}))||(s.logger.log("[eme] Patching keyId in 'enc"+(i?"a":"v")+">sinf>>tenc' box: "+l.default.hexDump(n)+" -> "+l.default.hexDump(r)),e.set(r,8))}}))}))})),t}function x(t){var e=m(t,["schm"])[0];if(e){var r=h(e.subarray(4,8));if("cbcs"===r||"cenc"===r)return m(t,["schi","tenc"])[0]}return s.logger.error("[eme] missing 'schm' box"),null}function S(t,e){return m(e,["moof","traf"]).reduce((function(e,r){var n=m(r,["tfdt"])[0],i=n[0],a=m(r,["tfhd"]).reduce((function(e,r){var a=p(r,4),o=t[a];if(o){var s=p(n,4);1===i&&(s*=Math.pow(2,32),s+=p(n,8));var l=s/(o.timescale||9e4);if(isFinite(l)&&(null===e||l<e))return l}return e}),null);return null!==a&&isFinite(a)&&(null===e||a<e)?a:e}),null)||0}function T(t,e){for(var r=0,i=0,a=0,o=m(t,["moof","traf"]),s=0;s<o.length;s++){var l=o[s],u=m(l,["tfhd"])[0],c=e[p(u,4)];if(c){var d=c.default,h=p(u,0)|(null==d?void 0:d.flags),f=null==d?void 0:d.duration;8&h&&(f=p(u,2&h?12:8));for(var g=c.timescale||9e4,v=m(l,["trun"]),b=0;b<v.length;b++)!(r=w(v[b]))&&f&&(r=f*p(v[b],4)),c.type===n.ElementaryStreamTypes.VIDEO?i+=r/g:c.type===n.ElementaryStreamTypes.AUDIO&&(a+=r/g)}}if(0===i&&0===a){for(var E=0,x=m(t,["sidx"]),S=0;S<x.length;S++){var T=y(x[S]);null!=T&&T.references&&(E+=T.references.reduce((function(t,e){return t+e.info.duration||0}),0))}return E}return i||a}function w(t){var e=p(t,0),r=8;1&e&&(r+=4),4&e&&(r+=4);for(var n=0,i=p(t,4),a=0;a<i;a++)256&e&&(n+=p(t,r),r+=4),512&e&&(r+=4),1024&e&&(r+=4),2048&e&&(r+=4);return n}function _(t,e,r){m(e,["moof","traf"]).forEach((function(e){m(e,["tfhd"]).forEach((function(n){var i=p(n,4),a=t[i];if(a){var o=a.timescale||9e4;m(e,["tfdt"]).forEach((function(t){var e=t[0],n=p(t,4);if(0===e)n-=r*o,v(t,4,n=Math.max(n,0));else{n*=Math.pow(2,32),n+=p(t,8),n-=r*o,n=Math.max(n,0);var i=Math.floor(n/(u+1)),a=Math.floor(n%(u+1));v(t,4,i),v(t,8,a)}}))}}))}))}function A(t){var e={valid:null,remainder:null},r=m(t,["moof"]);if(!r)return e;if(r.length<2)return e.remainder=t,e;var n=r[r.length-1];return e.valid=(0,a.sliceUint8)(t,0,n.byteOffset-8),e.remainder=(0,a.sliceUint8)(t,n.byteOffset-8),e}function k(t,e){var r=new Uint8Array(t.length+e.length);return r.set(t),r.set(e,t.length),r}function C(t,e){var r=[],i=e.samples,a=e.timescale,o=e.id,s=!1;return m(i,["moof"]).map((function(l){var u=l.byteOffset-8;m(l,["traf"]).map((function(l){var c=m(l,["tfdt"]).map((function(t){var e=t[0],r=p(t,4);return 1===e&&(r*=Math.pow(2,32),r+=p(t,8)),r/a}))[0];return void 0!==c&&(t=c),m(l,["tfhd"]).map((function(c){var d=p(c,4),h=16777215&p(c,0),f=0,v=0!=(16&h),y=0,b=0!=(32&h),E=8;d===o&&(0!=(1&h)&&(E+=8),0!=(2&h)&&(E+=4),0!=(8&h)&&(f=p(c,E),E+=4),v&&(y=p(c,E),E+=4),b&&(E+=4),"video"===e.type&&(s=function(t){if(!t)return!1;var e=t.indexOf("."),r=e<0?t:t.substring(0,e);return"hvc1"===r||"hev1"===r||"dvh1"===r||"dvhe"===r}(e.codec)),m(l,["trun"]).map((function(o){var l=o[0],c=16777215&p(o,0),d=0!=(1&c),h=0,v=0!=(4&c),m=0!=(256&c),b=0,E=0!=(512&c),x=0,S=0!=(1024&c),T=0!=(2048&c),w=0,_=p(o,4),A=8;d&&(h=p(o,A),A+=4),v&&(A+=4);for(var k=h+u,C=0;C<_;C++){if(m?(b=p(o,A),A+=4):b=f,E?(x=p(o,A),A+=4):x=y,S&&(A+=4),T&&(w=0===l?p(o,A):g(o,A),A+=4),e.type===n.ElementaryStreamTypes.VIDEO)for(var R=0;R<x;){var I=p(i,k);D(s,i[k+=4])&&L(i.subarray(k,k+I),s?2:1,t+w/a,r),k+=I,R+=I+4}t+=b/a}})))}))}))})),r}function D(t,e){if(t){var r=e>>1&63;return 39===r||40===r}return 6==(31&e)}function L(t,e,r,n){var i=R(t),a=0;a+=e;for(var s=0,l=0,u=!1,c=0;a<i.length;){s=0;do{if(a>=i.length)break;s+=c=i[a++]}while(255===c);l=0;do{if(a>=i.length)break;l+=c=i[a++]}while(255===c);var d=i.length-a;if(!u&&4===s&&a<i.length){if(u=!0,181===i[a++]){var h=f(i,a);if(a+=2,49===h){var g=p(i,a);if(a+=4,1195456820===g){var v=i[a++];if(3===v){var m=i[a++],y=64&m,b=y?2+3*(31&m):0,E=new Uint8Array(b);if(y){E[0]=m;for(var x=1;x<b;x++)E[x]=i[a++]}n.push({type:v,payloadType:s,pts:r,bytes:E})}}}}}else if(5===s&&l<d){if(u=!0,l>16){for(var S=[],T=0;T<16;T++){var w=i[a++].toString(16);S.push(1==w.length?"0"+w:w),3!==T&&5!==T&&7!==T&&9!==T||S.push("-")}for(var _=l-16,A=new Uint8Array(_),k=0;k<_;k++)A[k]=i[a++];n.push({payloadType:s,pts:r,uuid:S.join(""),userData:(0,o.utf8ArrayToStr)(A),userDataBytes:A})}}else if(l<d)a+=l;else if(l>d)break}}function R(t){for(var e=t.byteLength,r=[],n=1;n<e-2;)0===t[n]&&0===t[n+1]&&3===t[n+2]?(r.push(n+2),n+=2):n++;if(0===r.length)return t;var i=e-r.length,a=new Uint8Array(i),o=0;for(n=0;n<i;o++,n++)o===r[0]&&(o++,r.shift()),a[n]=t[o];return a}function I(t){var e=t[0],r="",n="",a=0,o=0,s=0,l=0,u=0,c=0;if(0===e){for(;"\0"!==h(t.subarray(c,c+1));)r+=h(t.subarray(c,c+1)),c+=1;for(r+=h(t.subarray(c,c+1)),c+=1;"\0"!==h(t.subarray(c,c+1));)n+=h(t.subarray(c,c+1)),c+=1;n+=h(t.subarray(c,c+1)),c+=1,a=p(t,12),o=p(t,16),l=p(t,20),u=p(t,24),c=28}else if(1===e){a=p(t,c+=4);var d=p(t,c+=4),f=p(t,c+=4);for(c+=4,s=Math.pow(2,32)*d+f,Number.isSafeInteger(s)||(s=Number.MAX_SAFE_INTEGER,i.warn("Presentation time exceeds safe integer limit and wrapped to max safe integer in parsing emsg box")),l=p(t,c),u=p(t,c+=4),c+=4;"\0"!==h(t.subarray(c,c+1));)r+=h(t.subarray(c,c+1)),c+=1;for(r+=h(t.subarray(c,c+1)),c+=1;"\0"!==h(t.subarray(c,c+1));)n+=h(t.subarray(c,c+1)),c+=1;n+=h(t.subarray(c,c+1)),c+=1}return{schemeIdUri:r,value:n,timeScale:a,presentationTime:s,presentationTimeDelta:o,eventDuration:l,id:u,payload:t.subarray(c,t.byteLength)}}function O(t){for(var e=arguments.length,r=new Array(e>1?e-1:0),n=1;n<e;n++)r[n-1]=arguments[n];for(var i=r.length,a=8,o=i;o--;)a+=r[o].byteLength;var s=new Uint8Array(a);for(s[0]=a>>24&255,s[1]=a>>16&255,s[2]=a>>8&255,s[3]=255&a,s.set(t,4),o=0,a=8;o<i;o++)s.set(r[o],a),a+=r[o].byteLength;return s}function M(t,e,r){if(16!==t.byteLength)throw new RangeError("Invalid system id");var n,i,a;if(e){n=1,i=new Uint8Array(16*e.length);for(var o=0;o<e.length;o++){var s=e[o];if(16!==s.byteLength)throw new RangeError("Invalid key");i.set(s,16*o)}}else n=0,i=new Uint8Array;n>0?(a=new Uint8Array(4),e.length>0&&new DataView(a.buffer).setUint32(0,e.length,!1)):a=new Uint8Array;var l=new Uint8Array(4);return r&&r.byteLength>0&&new DataView(l.buffer).setUint32(0,r.byteLength,!1),O([112,115,115,104],new Uint8Array([n,0,0,0]),t,a,i,l,r||new Uint8Array)}function P(t){if(!(t instanceof ArrayBuffer)||t.byteLength<32)return null;var e={version:0,systemId:"",kids:null,data:null},r=new DataView(t),n=r.getUint32(0);if(t.byteLength!==n&&n>44)return null;if(1886614376!==r.getUint32(4))return null;if(e.version=r.getUint32(8)>>>24,e.version>1)return null;e.systemId=l.default.hexDump(new Uint8Array(t,12,16));var i=r.getUint32(28);if(0===e.version){if(n-32<i)return null;e.data=new Uint8Array(t,32,i)}else if(1===e.version){e.kids=[];for(var a=0;a<i;a++)e.kids.push(new Uint8Array(t,32+16*a,16))}return e}},"./src/utils/numeric-encoding-utils.ts":(t,e,r)=>{"use strict";function n(t){return t.replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"")}function i(t){return btoa(t)}function a(t){return atob(t)}function o(t){return btoa(String.fromCharCode.apply(String,t))}function s(t){return n(o(t))}function l(t){return Uint8Array.from(atob(t),(function(t){return t.charCodeAt(0)}))}r.r(e),r.d(e,{base64Decode:()=>l,base64DecodeToStr:()=>a,base64Encode:()=>o,base64ToBase64Url:()=>n,base64UrlEncode:()=>s,strToBase64Encode:()=>i})},"./src/utils/output-filter.ts":(t,e,r)=>{"use strict";r.r(e),r.d(e,{default:()=>n});var n=function(){function t(t,e){this.timelineController=void 0,this.cueRanges=[],this.trackName=void 0,this.startTime=null,this.endTime=null,this.screen=null,this.timelineController=t,this.trackName=e}var e=t.prototype;return e.dispatchCue=function(){null!==this.startTime&&(this.timelineController.addCues(this.trackName,this.startTime,this.endTime,this.screen,this.cueRanges),this.startTime=null)},e.newCue=function(t,e,r){(null===this.startTime||this.startTime>t)&&(this.startTime=t),this.endTime=e,this.screen=r,this.timelineController.createCaptionsTrack(this.trackName)},e.reset=function(){this.cueRanges=[],this.startTime=null},t}()},"./src/utils/texttrack-utils.ts":(t,e,r)=>{"use strict";r.r(e),r.d(e,{addCueToTrack:()=>a,clearCurrentCues:()=>o,getCuesInRange:()=>l,removeCuesInRange:()=>s,sendAddTrackEvent:()=>i});var n=r("./src/utils/logger.ts");function i(t,e){var r;try{r=new Event("addtrack")}catch(t){(r=document.createEvent("Event")).initEvent("addtrack",!1,!1)}r.track=t,e.dispatchEvent(r)}function a(t,e){var r=t.mode;if("disabled"===r&&(t.mode="hidden"),t.cues&&!t.cues.getCueById(e.id))try{if(t.addCue(e),!t.cues.getCueById(e.id))throw new Error("addCue is failed for: "+e)}catch(r){n.logger.debug("[texttrack-utils]: "+r);var i=new self.TextTrackCue(e.startTime,e.endTime,e.text);i.id=e.id,t.addCue(i)}"disabled"===r&&(t.mode=r)}function o(t){var e=t.mode;if("disabled"===e&&(t.mode="hidden"),t.cues)for(var r=t.cues.length;r--;)t.removeCue(t.cues[r]);"disabled"===e&&(t.mode=e)}function s(t,e,r,n){var i=t.mode;if("disabled"===i&&(t.mode="hidden"),t.cues&&t.cues.length>0)for(var a=l(t.cues,e,r),o=0;o<a.length;o++)n&&!n(a[o])||t.removeCue(a[o]);"disabled"===i&&(t.mode=i)}function l(t,e,r){var n=[],i=function(t,e){if(e<t[0].startTime)return 0;var r=t.length-1;if(e>t[r].endTime)return-1;for(var n=0,i=r;n<=i;){var a=Math.floor((i+n)/2);if(e<t[a].startTime)i=a-1;else{if(!(e>t[a].startTime&&n<r))return a;n=a+1}}return t[n].startTime-e<e-t[i].startTime?n:i}(t,e);if(i>-1)for(var a=i,o=t.length;a<o;a++){var s=t[a];if(s.startTime>=e&&s.endTime<=r)n.push(s);else if(s.startTime>r)return n}return n}},"./src/utils/time-ranges.ts":(t,e,r)=>{"use strict";r.r(e),r.d(e,{default:()=>n});const n={toString:function(t){for(var e="",r=t.length,n=0;n<r;n++)e+="["+t.start(n).toFixed(3)+","+t.end(n).toFixed(3)+"]";return e}}},"./src/utils/timescale-conversion.ts":(t,e,r)=>{"use strict";function n(t,e,r,n){void 0===r&&(r=1),void 0===n&&(n=!1);var i=t*e*r;return n?Math.round(i):i}function i(t,e,r,i){return void 0===r&&(r=1),void 0===i&&(i=!1),n(t,e,1/r,i)}function a(t,e){return void 0===e&&(e=!1),n(t,1e3,1/9e4,e)}function o(t,e){return void 0===e&&(e=1),n(t,9e4,1/e)}r.r(e),r.d(e,{toMpegTsClockFromTimescale:()=>o,toMsFromMpegTsClock:()=>a,toTimescaleFromBase:()=>n,toTimescaleFromScale:()=>i})},"./src/utils/typed-array.ts":(t,e,r)=>{"use strict";function n(t,e,r){return Uint8Array.prototype.slice?t.slice(e,r):new Uint8Array(Array.prototype.slice.call(t,e,r))}r.r(e),r.d(e,{sliceUint8:()=>n})},"./src/utils/vttcue.ts":(t,e,r)=>{"use strict";r.r(e),r.d(e,{default:()=>n});const n=function(){if("undefined"!=typeof self&&self.VTTCue)return self.VTTCue;var t=["","lr","rl"],e=["start","middle","end","left","right"];function r(t,e){if("string"!=typeof e)return!1;if(!Array.isArray(t))return!1;var r=e.toLowerCase();return!!~t.indexOf(r)&&r}function n(t){return r(e,t)}function i(t){for(var e=arguments.length,r=new Array(e>1?e-1:0),n=1;n<e;n++)r[n-1]=arguments[n];for(var i=1;i<arguments.length;i++){var a=arguments[i];for(var o in a)t[o]=a[o]}return t}function a(e,a,o){var s=this,l={enumerable:!0};s.hasBeenReset=!1;var u="",c=!1,d=e,h=a,f=o,p=null,g="",v=!0,m="auto",y="start",b=50,E="middle",x=50,S="middle";Object.defineProperty(s,"id",i({},l,{get:function(){return u},set:function(t){u=""+t}})),Object.defineProperty(s,"pauseOnExit",i({},l,{get:function(){return c},set:function(t){c=!!t}})),Object.defineProperty(s,"startTime",i({},l,{get:function(){return d},set:function(t){if("number"!=typeof t)throw new TypeError("Start time must be set to a number.");d=t,this.hasBeenReset=!0}})),Object.defineProperty(s,"endTime",i({},l,{get:function(){return h},set:function(t){if("number"!=typeof t)throw new TypeError("End time must be set to a number.");h=t,this.hasBeenReset=!0}})),Object.defineProperty(s,"text",i({},l,{get:function(){return f},set:function(t){f=""+t,this.hasBeenReset=!0}})),Object.defineProperty(s,"region",i({},l,{get:function(){return p},set:function(t){p=t,this.hasBeenReset=!0}})),Object.defineProperty(s,"vertical",i({},l,{get:function(){return g},set:function(e){var n=function(e){return r(t,e)}(e);if(!1===n)throw new SyntaxError("An invalid or illegal string was specified.");g=n,this.hasBeenReset=!0}})),Object.defineProperty(s,"snapToLines",i({},l,{get:function(){return v},set:function(t){v=!!t,this.hasBeenReset=!0}})),Object.defineProperty(s,"line",i({},l,{get:function(){return m},set:function(t){if("number"!=typeof t&&"auto"!==t)throw new SyntaxError("An invalid number or illegal string was specified.");m=t,this.hasBeenReset=!0}})),Object.defineProperty(s,"lineAlign",i({},l,{get:function(){return y},set:function(t){var e=n(t);if(!e)throw new SyntaxError("An invalid or illegal string was specified.");y=e,this.hasBeenReset=!0}})),Object.defineProperty(s,"position",i({},l,{get:function(){return b},set:function(t){if(t<0||t>100)throw new Error("Position must be between 0 and 100.");b=t,this.hasBeenReset=!0}})),Object.defineProperty(s,"positionAlign",i({},l,{get:function(){return E},set:function(t){var e=n(t);if(!e)throw new SyntaxError("An invalid or illegal string was specified.");E=e,this.hasBeenReset=!0}})),Object.defineProperty(s,"size",i({},l,{get:function(){return x},set:function(t){if(t<0||t>100)throw new Error("Size must be between 0 and 100.");x=t,this.hasBeenReset=!0}})),Object.defineProperty(s,"align",i({},l,{get:function(){return S},set:function(t){var e=n(t);if(!e)throw new SyntaxError("An invalid or illegal string was specified.");S=e,this.hasBeenReset=!0}})),s.displayState=void 0}return a.prototype.getCueAsHTML=function(){return self.WebVTT.convertCueToDOMTree(self,this.text)},a}()},"./src/utils/vttparser.ts":(t,e,r)=>{"use strict";r.r(e),r.d(e,{VTTParser:()=>h,fixLineBreaks:()=>d,parseTimeStamp:()=>a});var n=r("./src/utils/vttcue.ts"),i=function(){function t(){}return t.prototype.decode=function(t,e){if(!t)return"";if("string"!=typeof t)throw new Error("Error - expected string data.");return decodeURIComponent(encodeURIComponent(t))},t}();function a(t){function e(t,e,r,n){return 3600*(0|t)+60*(0|e)+(0|r)+parseFloat(n||0)}var r=t.match(/^(?:(\d+):)?(\d{2}):(\d{2})(\.\d+)?/);return r?parseFloat(r[2])>59?e(r[2],r[3],0,r[4]):e(r[1],r[2],r[3],r[4]):null}var o=function(){function t(){this.values=Object.create(null)}var e=t.prototype;return e.set=function(t,e){this.get(t)||""===e||(this.values[t]=e)},e.get=function(t,e,r){return r?this.has(t)?this.values[t]:e[r]:this.has(t)?this.values[t]:e},e.has=function(t){return t in this.values},e.alt=function(t,e,r){for(var n=0;n<r.length;++n)if(e===r[n]){this.set(t,e);break}},e.integer=function(t,e){/^-?\d+$/.test(e)&&this.set(t,parseInt(e,10))},e.percent=function(t,e){if(/^([\d]{1,3})(\.[\d]*)?%$/.test(e)){var r=parseFloat(e);if(r>=0&&r<=100)return this.set(t,r),!0}return!1},t}();function s(t,e,r,n){var i=n?t.split(n):[t];for(var a in i)if("string"==typeof i[a]){var o=i[a].split(r);2===o.length&&e(o[0],o[1])}}var l=new n.default(0,0,""),u="middle"===l.align?"middle":"center";function c(t,e,r){var n=t;function i(){var e=a(t);if(null===e)throw new Error("Malformed timestamp: "+n);return t=t.replace(/^[^\sa-zA-Z-]+/,""),e}function c(){t=t.replace(/^\s+/,"")}if(c(),e.startTime=i(),c(),"--\x3e"!==t.slice(0,3))throw new Error("Malformed time stamp (time stamps must be separated by '--\x3e'): "+n);t=t.slice(3),c(),e.endTime=i(),c(),function(t,e){var n=new o;s(t,(function(t,e){var i;switch(t){case"region":for(var a=r.length-1;a>=0;a--)if(r[a].id===e){n.set(t,r[a].region);break}break;case"vertical":n.alt(t,e,["rl","lr"]);break;case"line":i=e.split(","),n.integer(t,i[0]),n.percent(t,i[0])&&n.set("snapToLines",!1),n.alt(t,i[0],["auto"]),2===i.length&&n.alt("lineAlign",i[1],["start",u,"end"]);break;case"position":i=e.split(","),n.percent(t,i[0]),2===i.length&&n.alt("positionAlign",i[1],["start",u,"end","line-left","line-right","auto"]);break;case"size":n.percent(t,e);break;case"align":n.alt(t,e,["start",u,"end","left","right"])}}),/:/,/\s/),e.region=n.get("region",null),e.vertical=n.get("vertical","");var i=n.get("line","auto");"auto"===i&&-1===l.line&&(i=-1),e.line=i,e.lineAlign=n.get("lineAlign","start"),e.snapToLines=n.get("snapToLines",!0),e.size=n.get("size",100),e.align=n.get("align",u);var a=n.get("position","auto");"auto"===a&&50===l.position&&(a="start"===e.align||"left"===e.align?0:"end"===e.align||"right"===e.align?100:50),e.position=a}(t,e)}function d(t){return t.replace(/<br(?: \/)?>/gi,"\n")}var h=function(){function t(){this.state="INITIAL",this.buffer="",this.decoder=new i,this.regionList=[],this.cue=null,this.oncue=void 0,this.onparsingerror=void 0,this.onflush=void 0}var e=t.prototype;return e.parse=function(t){var e=this;function r(){var t=e.buffer,r=0;for(t=d(t);r<t.length&&"\r"!==t[r]&&"\n"!==t[r];)++r;var n=t.slice(0,r);return"\r"===t[r]&&++r,"\n"===t[r]&&++r,e.buffer=t.slice(r),n}t&&(e.buffer+=e.decoder.decode(t,{stream:!0}));try{var i="";if("INITIAL"===e.state){if(!/\r\n|\n/.test(e.buffer))return this;var a=(i=r()).match(/^()?WEBVTT([ \t].*)?$/);if(!a||!a[0])throw new Error("Malformed WebVTT signature.");e.state="HEADER"}for(var o=!1;e.buffer;){if(!/\r\n|\n/.test(e.buffer))return this;switch(o?o=!1:i=r(),e.state){case"HEADER":/:/.test(i)?s(i,(function(t,e){}),/:/):i||(e.state="ID");continue;case"NOTE":i||(e.state="ID");continue;case"ID":if(/^NOTE($|[ \t])/.test(i)){e.state="NOTE";break}if(!i)continue;if(e.cue=new n.default(0,0,""),e.state="CUE",-1===i.indexOf("--\x3e")){e.cue.id=i;continue}case"CUE":if(!e.cue){e.state="BADCUE";continue}try{c(i,e.cue,e.regionList)}catch(t){e.cue=null,e.state="BADCUE";continue}e.state="CUETEXT";continue;case"CUETEXT":var l=-1!==i.indexOf("--\x3e");if(!i||l&&(o=!0)){e.oncue&&e.cue&&e.oncue(e.cue),e.cue=null,e.state="ID";continue}if(null===e.cue)continue;e.cue.text&&(e.cue.text+="\n"),e.cue.text+=i;continue;case"BADCUE":i||(e.state="ID")}}}catch(t){"CUETEXT"===e.state&&e.cue&&e.oncue&&e.oncue(e.cue),e.cue=null,e.state="INITIAL"===e.state?"BADWEBVTT":"BADCUE"}return this},e.flush=function(){var t=this;try{if((t.cue||"HEADER"===t.state)&&(t.buffer+="\n\n",t.parse()),"INITIAL"===t.state||"BADWEBVTT"===t.state)throw new Error("Malformed WebVTT signature.")}catch(e){t.onparsingerror&&t.onparsingerror(e)}return t.onflush&&t.onflush(),this},t}()},"./src/utils/webvtt-parser.ts":(t,e,r)=>{"use strict";r.r(e),r.d(e,{generateCueId:()=>d,parseWebVTT:()=>h});var n=r("./src/polyfills/number.ts"),i=r("./src/utils/vttparser.ts"),a=r("./src/demux/id3.ts"),o=r("./src/utils/timescale-conversion.ts"),s=r("./src/remux/mp4-remuxer.ts"),l=/\r\n|\n\r|\n|\r/g,u=function(t,e,r){return void 0===r&&(r=0),t.slice(r,r+e.length)===e},c=function(t){for(var e=5381,r=t.length;r;)e=33*e^t.charCodeAt(--r);return(e>>>0).toString()};function d(t,e,r){return c(t.toString())+c(e.toString())+c(r)}function h(t,e,r,c,h,f,p,g){var v,m=new i.VTTParser,y=(0,a.utf8ArrayToStr)(new Uint8Array(t)).trim().replace(l,"\n").split("\n"),b=[],E=(0,o.toMpegTsClockFromTimescale)(e,r),x="00:00.000",S=0,T=0,w=!0;m.oncue=function(t){var e=c[h],r=c.ccOffset,n=(S-E)/9e4;null!=e&&e.new&&(void 0!==T?r=c.ccOffset=e.start:function(t,e,r){var n=t[e],i=t[n.prevCC];if(!i||!i.new&&n.new)return t.ccOffset=t.presentationOffset=n.start,void(n.new=!1);for(;null!==(a=i)&&void 0!==a&&a.new;){var a;t.ccOffset+=n.start-i.start,n.new=!1,i=t[(n=i).prevCC]}t.presentationOffset=r}(c,h,n)),n&&(r=n-c.presentationOffset);var i=t.endTime-t.startTime,a=(0,s.normalizePts)(9e4*(t.startTime+r-T),9e4*f)/9e4;t.startTime=Math.max(a,0),t.endTime=Math.max(a+i,0);var o=t.text.trim();t.text=decodeURIComponent(encodeURIComponent(o)),t.id||(t.id=d(t.startTime,t.endTime,o)),t.endTime>0&&b.push(t)},m.onparsingerror=function(t){v=t},m.onflush=function(){v?g(v):p(b)},y.forEach((function(t){if(w){if(u(t,"X-TIMESTAMP-MAP=")){w=!1,t.slice(16).split(",").forEach((function(t){u(t,"LOCAL:")?x=t.slice(6):u(t,"MPEGTS:")&&(S=parseInt(t.slice(7)))}));try{T=function(t){var e=parseInt(t.slice(-3)),r=parseInt(t.slice(-6,-4)),i=parseInt(t.slice(-9,-7)),a=t.length>9?parseInt(t.substring(0,t.indexOf(":"))):0;if(!((0,n.isFiniteNumber)(e)&&(0,n.isFiniteNumber)(r)&&(0,n.isFiniteNumber)(i)&&(0,n.isFiniteNumber)(a)))throw Error("Malformed X-TIMESTAMP-MAP: Local:"+t);return e+=1e3*r,(e+=6e4*i)+36e5*a}(x)/1e3}catch(t){v=t}return}""===t&&(w=!1)}m.parse(t+"\n")})),m.flush()}},"./src/utils/xhr-loader.ts":(t,e,r)=>{"use strict";r.r(e),r.d(e,{default:()=>o});var n=r("./src/utils/logger.ts"),i=r("./src/loader/load-stats.ts"),a=/^age:\s*[\d.]+\s*$/m;const o=function(){function t(t){this.xhrSetup=void 0,this.requestTimeout=void 0,this.retryTimeout=void 0,this.retryDelay=void 0,this.config=null,this.callbacks=null,this.context=void 0,this.loader=null,this.stats=void 0,this.xhrSetup=t?t.xhrSetup:null,this.stats=new i.LoadStats,this.retryDelay=0}var e=t.prototype;return e.destroy=function(){this.callbacks=null,this.abortInternal(),this.loader=null,this.config=null},e.abortInternal=function(){var t=this.loader;self.clearTimeout(this.requestTimeout),self.clearTimeout(this.retryTimeout),t&&(t.onreadystatechange=null,t.onprogress=null,4!==t.readyState&&(this.stats.aborted=!0,t.abort()))},e.abort=function(){var t;this.abortInternal(),null!==(t=this.callbacks)&&void 0!==t&&t.onAbort&&this.callbacks.onAbort(this.stats,this.context,this.loader)},e.load=function(t,e,r){if(this.stats.loading.start)throw new Error("Loader can only be used once.");this.stats.loading.start=self.performance.now(),this.context=t,this.config=e,this.callbacks=r,this.retryDelay=e.retryDelay,this.loadInternal()},e.loadInternal=function(){var t=this.config,e=this.context;if(t){var r=this.loader=new self.XMLHttpRequest,n=this.stats;n.loading.first=0,n.loaded=0;var i=this.xhrSetup;try{if(i)try{i(r,e.url)}catch(t){r.open("GET",e.url,!0),i(r,e.url)}r.readyState||r.open("GET",e.url,!0);var a=this.context.headers;if(a)for(var o in a)r.setRequestHeader(o,a[o])}catch(t){return void this.callbacks.onError({code:r.status,text:t.message},e,r)}e.rangeEnd&&r.setRequestHeader("Range","bytes="+e.rangeStart+"-"+(e.rangeEnd-1)),r.onreadystatechange=this.readystatechange.bind(this),r.onprogress=this.loadprogress.bind(this),r.responseType=e.responseType,self.clearTimeout(this.requestTimeout),this.requestTimeout=self.setTimeout(this.loadtimeout.bind(this),t.timeout),r.send()}},e.readystatechange=function(){var t=this.context,e=this.loader,r=this.stats;if(t&&e){var i=e.readyState,a=this.config;if(!r.aborted&&i>=2)if(self.clearTimeout(this.requestTimeout),0===r.loading.first&&(r.loading.first=Math.max(self.performance.now(),r.loading.start)),4===i){e.onreadystatechange=null,e.onprogress=null;var o=e.status,s="arraybuffer"===e.responseType;if(o>=200&&o<300&&(s&&e.response||null!==e.responseText)){var l,u;if(r.loading.end=Math.max(self.performance.now(),r.loading.first),u=s?(l=e.response).byteLength:(l=e.responseText).length,r.loaded=r.total=u,!this.callbacks)return;var c=this.callbacks.onProgress;if(c&&c(r,t,l,e),!this.callbacks)return;var d={url:e.responseURL,data:l};this.callbacks.onSuccess(d,r,t,e)}else r.retry>=a.maxRetry||o>=400&&o<499?(n.logger.error(o+" while loading "+t.url),this.callbacks.onError({code:o,text:e.statusText},t,e)):(n.logger.warn(o+" while loading "+t.url+", retrying in "+this.retryDelay+"..."),this.abortInternal(),this.loader=null,self.clearTimeout(this.retryTimeout),this.retryTimeout=self.setTimeout(this.loadInternal.bind(this),this.retryDelay),this.retryDelay=Math.min(2*this.retryDelay,a.maxRetryDelay),r.retry++)}else self.clearTimeout(this.requestTimeout),this.requestTimeout=self.setTimeout(this.loadtimeout.bind(this),a.timeout)}},e.loadtimeout=function(){n.logger.warn("timeout while loading "+this.context.url);var t=this.callbacks;t&&(this.abortInternal(),t.onTimeout(this.stats,this.context,this.loader))},e.loadprogress=function(t){var e=this.stats;e.loaded=t.loaded,t.lengthComputable&&(e.total=t.total)},e.getCacheAge=function(){var t=null;if(this.loader&&a.test(this.loader.getAllResponseHeaders())){var e=this.loader.getResponseHeader("age");t=e?parseFloat(e):null}return t},t}()},"./node_modules/eventemitter3/index.js":t=>{"use strict";var e=Object.prototype.hasOwnProperty,r="~";function n(){}function i(t,e,r){this.fn=t,this.context=e,this.once=r||!1}function a(t,e,n,a,o){if("function"!=typeof n)throw new TypeError("The listener must be a function");var s=new i(n,a||t,o),l=r?r+e:e;return t._events[l]?t._events[l].fn?t._events[l]=[t._events[l],s]:t._events[l].push(s):(t._events[l]=s,t._eventsCount++),t}function o(t,e){0==--t._eventsCount?t._events=new n:delete t._events[e]}function s(){this._events=new n,this._eventsCount=0}Object.create&&(n.prototype=Object.create(null),(new n).__proto__||(r=!1)),s.prototype.eventNames=function(){var t,n,i=[];if(0===this._eventsCount)return i;for(n in t=this._events)e.call(t,n)&&i.push(r?n.slice(1):n);return Object.getOwnPropertySymbols?i.concat(Object.getOwnPropertySymbols(t)):i},s.prototype.listeners=function(t){var e=r?r+t:t,n=this._events[e];if(!n)return[];if(n.fn)return[n.fn];for(var i=0,a=n.length,o=new Array(a);i<a;i++)o[i]=n[i].fn;return o},s.prototype.listenerCount=function(t){var e=r?r+t:t,n=this._events[e];return n?n.fn?1:n.length:0},s.prototype.emit=function(t,e,n,i,a,o){var s=r?r+t:t;if(!this._events[s])return!1;var l,u,c=this._events[s],d=arguments.length;if(c.fn){switch(c.once&&this.removeListener(t,c.fn,void 0,!0),d){case 1:return c.fn.call(c.context),!0;case 2:return c.fn.call(c.context,e),!0;case 3:return c.fn.call(c.context,e,n),!0;case 4:return c.fn.call(c.context,e,n,i),!0;case 5:return c.fn.call(c.context,e,n,i,a),!0;case 6:return c.fn.call(c.context,e,n,i,a,o),!0}for(u=1,l=new Array(d-1);u<d;u++)l[u-1]=arguments[u];c.fn.apply(c.context,l)}else{var h,f=c.length;for(u=0;u<f;u++)switch(c[u].once&&this.removeListener(t,c[u].fn,void 0,!0),d){case 1:c[u].fn.call(c[u].context);break;case 2:c[u].fn.call(c[u].context,e);break;case 3:c[u].fn.call(c[u].context,e,n);break;case 4:c[u].fn.call(c[u].context,e,n,i);break;default:if(!l)for(h=1,l=new Array(d-1);h<d;h++)l[h-1]=arguments[h];c[u].fn.apply(c[u].context,l)}}return!0},s.prototype.on=function(t,e,r){return a(this,t,e,r,!1)},s.prototype.once=function(t,e,r){return a(this,t,e,r,!0)},s.prototype.removeListener=function(t,e,n,i){var a=r?r+t:t;if(!this._events[a])return this;if(!e)return o(this,a),this;var s=this._events[a];if(s.fn)s.fn!==e||i&&!s.once||n&&s.context!==n||o(this,a);else{for(var l=0,u=[],c=s.length;l<c;l++)(s[l].fn!==e||i&&!s[l].once||n&&s[l].context!==n)&&u.push(s[l]);u.length?this._events[a]=1===u.length?u[0]:u:o(this,a)}return this},s.prototype.removeAllListeners=function(t){var e;return t?(e=r?r+t:t,this._events[e]&&o(this,e)):(this._events=new n,this._eventsCount=0),this},s.prototype.off=s.prototype.removeListener,s.prototype.addListener=s.prototype.on,s.prefixed=r,s.EventEmitter=s,t.exports=s},"./node_modules/url-toolkit/src/url-toolkit.js":function(t){var e,r,n,i,a;e=/^(?=((?:[a-zA-Z0-9+\-.]+:)?))\1(?=((?:\/\/[^\/?#]*)?))\2(?=((?:(?:[^?#\/]*\/)*[^;?#\/]*)?))\3((?:;[^?#]*)?)(\?[^#]*)?(#[^]*)?$/,r=/^(?=([^\/?#]*))\1([^]*)$/,n=/(?:\/|^)\.(?=\/)/g,i=/(?:\/|^)\.\.\/(?!\.\.\/)[^\/]*(?=\/)/g,a={buildAbsoluteURL:function(t,e,n){if(n=n||{},t=t.trim(),!(e=e.trim())){if(!n.alwaysNormalize)return t;var i=a.parseURL(t);if(!i)throw new Error("Error trying to parse base URL.");return i.path=a.normalizePath(i.path),a.buildURLFromParts(i)}var o=a.parseURL(e);if(!o)throw new Error("Error trying to parse relative URL.");if(o.scheme)return n.alwaysNormalize?(o.path=a.normalizePath(o.path),a.buildURLFromParts(o)):e;var s=a.parseURL(t);if(!s)throw new Error("Error trying to parse base URL.");if(!s.netLoc&&s.path&&"/"!==s.path[0]){var l=r.exec(s.path);s.netLoc=l[1],s.path=l[2]}s.netLoc&&!s.path&&(s.path="/");var u={scheme:s.scheme,netLoc:o.netLoc,path:null,params:o.params,query:o.query,fragment:o.fragment};if(!o.netLoc&&(u.netLoc=s.netLoc,"/"!==o.path[0]))if(o.path){var c=s.path,d=c.substring(0,c.lastIndexOf("/")+1)+o.path;u.path=a.normalizePath(d)}else u.path=s.path,o.params||(u.params=s.params,o.query||(u.query=s.query));return null===u.path&&(u.path=n.alwaysNormalize?a.normalizePath(o.path):o.path),a.buildURLFromParts(u)},parseURL:function(t){var r=e.exec(t);return r?{scheme:r[1]||"",netLoc:r[2]||"",path:r[3]||"",params:r[4]||"",query:r[5]||"",fragment:r[6]||""}:null},normalizePath:function(t){for(t=t.split("").reverse().join("").replace(n,"");t.length!==(t=t.replace(i,"")).length;);return t.split("").reverse().join("")},buildURLFromParts:function(t){return t.scheme+t.netLoc+t.path+t.params+t.query+t.fragment}},t.exports=a}},e={};function r(n){var i=e[n];if(void 0!==i)return i.exports;var a=e[n]={exports:{}};return t[n].call(a.exports,a,a.exports,r),a.exports}r.m=t,r.n=t=>{var e=t&&t.__esModule?()=>t.default:()=>t;return r.d(e,{a:e}),e},r.d=(t,e)=>{for(var n in e)r.o(e,n)&&!r.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},r.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};var n=r("./src/hls.ts");return n.default})(),t.exports=n())}}]);