bonnetid-ui 0.0.5

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 (336) hide show
  1. package/README.md +21 -0
  2. package/dist/App.d.ts +3 -0
  3. package/dist/app/assets/browser-BPq4aN9G.js +1 -0
  4. package/dist/app/assets/chakra-petch-latin-500-normal-BR1ody1F.woff2 +0 -0
  5. package/dist/app/assets/chakra-petch-latin-500-normal-CnUQnZ4D.woff +0 -0
  6. package/dist/app/assets/chakra-petch-latin-600-normal-DQKfcdKo.woff +0 -0
  7. package/dist/app/assets/chakra-petch-latin-600-normal-DVQm9bgb.woff2 +0 -0
  8. package/dist/app/assets/chakra-petch-latin-700-normal-CnDBPjkL.woff2 +0 -0
  9. package/dist/app/assets/chakra-petch-latin-700-normal-D1s_c2du.woff +0 -0
  10. package/dist/app/assets/chakra-petch-latin-ext-500-normal-BCHeNDEx.woff +0 -0
  11. package/dist/app/assets/chakra-petch-latin-ext-500-normal-gA6791b0.woff2 +0 -0
  12. package/dist/app/assets/chakra-petch-latin-ext-600-normal-CdGvbdDU.woff2 +0 -0
  13. package/dist/app/assets/chakra-petch-latin-ext-600-normal-nL80L4xU.woff +0 -0
  14. package/dist/app/assets/chakra-petch-latin-ext-700-normal-BeviJPUl.woff +0 -0
  15. package/dist/app/assets/chakra-petch-latin-ext-700-normal-DAkvJhej.woff2 +0 -0
  16. package/dist/app/assets/chakra-petch-thai-500-normal-CJG_V2_m.woff +0 -0
  17. package/dist/app/assets/chakra-petch-thai-500-normal-DeexCGiz.woff2 +0 -0
  18. package/dist/app/assets/chakra-petch-thai-600-normal-BiM5MXH8.woff +0 -0
  19. package/dist/app/assets/chakra-petch-thai-600-normal-C620THcd.woff2 +0 -0
  20. package/dist/app/assets/chakra-petch-thai-700-normal-B7WL5pBr.woff2 +0 -0
  21. package/dist/app/assets/chakra-petch-thai-700-normal-vZLZ_5L8.woff +0 -0
  22. package/dist/app/assets/chakra-petch-vietnamese-500-normal-BVzUBLGs.woff +0 -0
  23. package/dist/app/assets/chakra-petch-vietnamese-600-normal-Pvj4qcw_.woff +0 -0
  24. package/dist/app/assets/chakra-petch-vietnamese-700-normal-gQuUA8Wu.woff +0 -0
  25. package/dist/app/assets/dm-sans-latin-300-normal-5PdLhTtq.woff2 +0 -0
  26. package/dist/app/assets/dm-sans-latin-300-normal-BIEPdU4K.woff +0 -0
  27. package/dist/app/assets/dm-sans-latin-400-normal-CN_gcpH5.woff +0 -0
  28. package/dist/app/assets/dm-sans-latin-400-normal-DwcD7z81.woff2 +0 -0
  29. package/dist/app/assets/dm-sans-latin-500-normal-BOEmR4rO.woff2 +0 -0
  30. package/dist/app/assets/dm-sans-latin-500-normal-CuLX8J35.woff +0 -0
  31. package/dist/app/assets/dm-sans-latin-600-normal-BY-DBcpC.woff2 +0 -0
  32. package/dist/app/assets/dm-sans-latin-600-normal-nt2wwSEB.woff +0 -0
  33. package/dist/app/assets/dm-sans-latin-700-normal-CHsHpBXM.woff +0 -0
  34. package/dist/app/assets/dm-sans-latin-700-normal-COgqbzv4.woff2 +0 -0
  35. package/dist/app/assets/dm-sans-latin-800-normal-BcCK7MqR.woff +0 -0
  36. package/dist/app/assets/dm-sans-latin-800-normal-DeXLON5z.woff2 +0 -0
  37. package/dist/app/assets/dm-sans-latin-ext-300-normal-BzE0zO3N.woff2 +0 -0
  38. package/dist/app/assets/dm-sans-latin-ext-300-normal-CihYRU4l.woff +0 -0
  39. package/dist/app/assets/dm-sans-latin-ext-400-normal-B_g-cTf1.woff2 +0 -0
  40. package/dist/app/assets/dm-sans-latin-ext-400-normal-Cd6-YbfH.woff +0 -0
  41. package/dist/app/assets/dm-sans-latin-ext-500-normal-BxxUzzM_.woff +0 -0
  42. package/dist/app/assets/dm-sans-latin-ext-500-normal-kP1Zl0kM.woff2 +0 -0
  43. package/dist/app/assets/dm-sans-latin-ext-600-normal-BnzuacV6.woff +0 -0
  44. package/dist/app/assets/dm-sans-latin-ext-600-normal-D6JAL3sq.woff2 +0 -0
  45. package/dist/app/assets/dm-sans-latin-ext-700-normal-B_UDu85C.woff +0 -0
  46. package/dist/app/assets/dm-sans-latin-ext-700-normal-DaM0Z2aq.woff2 +0 -0
  47. package/dist/app/assets/dm-sans-latin-ext-800-normal-BSPv4UXu.woff2 +0 -0
  48. package/dist/app/assets/dm-sans-latin-ext-800-normal-CQdRGYXx.woff +0 -0
  49. package/dist/app/assets/html2canvas.esm-CBrSDip1.js +22 -0
  50. package/dist/app/assets/index-BK9CpLtb.js +360 -0
  51. package/dist/app/assets/index-qLhYbFtH.css +1 -0
  52. package/dist/app/assets/index.es-BowDWdhy.js +18 -0
  53. package/dist/app/assets/montserrat-cyrillic-300-normal-0sPxshp4.woff +0 -0
  54. package/dist/app/assets/montserrat-cyrillic-300-normal-DK9HGdYA.woff2 +0 -0
  55. package/dist/app/assets/montserrat-cyrillic-400-normal-BNZrkLa0.woff2 +0 -0
  56. package/dist/app/assets/montserrat-cyrillic-400-normal-DBr-NfXb.woff +0 -0
  57. package/dist/app/assets/montserrat-cyrillic-500-normal-5hOf_6V8.woff +0 -0
  58. package/dist/app/assets/montserrat-cyrillic-500-normal-CEcnig0T.woff2 +0 -0
  59. package/dist/app/assets/montserrat-cyrillic-600-normal-BDeOmj0F.woff +0 -0
  60. package/dist/app/assets/montserrat-cyrillic-600-normal-CFBuNk4A.woff2 +0 -0
  61. package/dist/app/assets/montserrat-cyrillic-700-normal-DO8I1zZZ.woff2 +0 -0
  62. package/dist/app/assets/montserrat-cyrillic-700-normal-DSUBOH1D.woff +0 -0
  63. package/dist/app/assets/montserrat-cyrillic-ext-300-normal-Ctr4ZZfs.woff +0 -0
  64. package/dist/app/assets/montserrat-cyrillic-ext-300-normal-DChc9K-m.woff2 +0 -0
  65. package/dist/app/assets/montserrat-cyrillic-ext-400-normal-C8cdMEH1.woff2 +0 -0
  66. package/dist/app/assets/montserrat-cyrillic-ext-400-normal-DRPPeomZ.woff +0 -0
  67. package/dist/app/assets/montserrat-cyrillic-ext-500-normal-B-4z8kjO.woff2 +0 -0
  68. package/dist/app/assets/montserrat-cyrillic-ext-500-normal-DOzfAZ45.woff +0 -0
  69. package/dist/app/assets/montserrat-cyrillic-ext-600-normal-DBK1zJ_f.woff2 +0 -0
  70. package/dist/app/assets/montserrat-cyrillic-ext-600-normal-wReYPmz2.woff +0 -0
  71. package/dist/app/assets/montserrat-cyrillic-ext-700-normal-D-Mk2xRJ.woff +0 -0
  72. package/dist/app/assets/montserrat-cyrillic-ext-700-normal-D3s9QaN5.woff2 +0 -0
  73. package/dist/app/assets/montserrat-latin-300-normal-DnktnXA7.woff +0 -0
  74. package/dist/app/assets/montserrat-latin-300-normal-nZUFlRvk.woff2 +0 -0
  75. package/dist/app/assets/montserrat-latin-400-normal-CIMKXMQI.woff2 +0 -0
  76. package/dist/app/assets/montserrat-latin-400-normal-c9plhWJ-.woff +0 -0
  77. package/dist/app/assets/montserrat-latin-500-normal-BO--OZiJ.woff2 +0 -0
  78. package/dist/app/assets/montserrat-latin-500-normal-D2tJUN_M.woff +0 -0
  79. package/dist/app/assets/montserrat-latin-600-normal-BIqsilEx.woff +0 -0
  80. package/dist/app/assets/montserrat-latin-600-normal-CjtsKS3e.woff2 +0 -0
  81. package/dist/app/assets/montserrat-latin-700-normal-BYRy5CoC.woff2 +0 -0
  82. package/dist/app/assets/montserrat-latin-700-normal-CdCxnP3F.woff +0 -0
  83. package/dist/app/assets/montserrat-latin-ext-300-normal-NKpoVfN0.woff +0 -0
  84. package/dist/app/assets/montserrat-latin-ext-300-normal-UC_9RREF.woff2 +0 -0
  85. package/dist/app/assets/montserrat-latin-ext-400-normal-Cd0_BKvP.woff2 +0 -0
  86. package/dist/app/assets/montserrat-latin-ext-400-normal-DTispvgz.woff +0 -0
  87. package/dist/app/assets/montserrat-latin-ext-500-normal-B3sO5DY5.woff +0 -0
  88. package/dist/app/assets/montserrat-latin-ext-500-normal-Dl9DnvF-.woff2 +0 -0
  89. package/dist/app/assets/montserrat-latin-ext-600-normal-Cdwl3Fm3.woff2 +0 -0
  90. package/dist/app/assets/montserrat-latin-ext-600-normal-TBwi8riD.woff +0 -0
  91. package/dist/app/assets/montserrat-latin-ext-700-normal-DTfQ8iG5.woff2 +0 -0
  92. package/dist/app/assets/montserrat-latin-ext-700-normal-DexoegUD.woff +0 -0
  93. package/dist/app/assets/montserrat-vietnamese-300-normal-QSCr16Ih.woff +0 -0
  94. package/dist/app/assets/montserrat-vietnamese-300-normal-dyDOfQEI.woff2 +0 -0
  95. package/dist/app/assets/montserrat-vietnamese-400-normal-CgEMIOQI.woff2 +0 -0
  96. package/dist/app/assets/montserrat-vietnamese-400-normal-CxETBKkY.woff +0 -0
  97. package/dist/app/assets/montserrat-vietnamese-500-normal-Bs8uzZ4q.woff2 +0 -0
  98. package/dist/app/assets/montserrat-vietnamese-500-normal-Cu11HB8x.woff +0 -0
  99. package/dist/app/assets/montserrat-vietnamese-600-normal-ByPVM7OU.woff +0 -0
  100. package/dist/app/assets/montserrat-vietnamese-600-normal-DPiqdaMz.woff2 +0 -0
  101. package/dist/app/assets/montserrat-vietnamese-700-normal-D8RPk-a5.woff2 +0 -0
  102. package/dist/app/assets/montserrat-vietnamese-700-normal-fdUDkXo_.woff +0 -0
  103. package/dist/app/assets/onest-cyrillic-100-normal-BzaRAqqs.woff +0 -0
  104. package/dist/app/assets/onest-cyrillic-100-normal-PXfF0wcm.woff2 +0 -0
  105. package/dist/app/assets/onest-cyrillic-400-normal-BxvCLB5P.woff +0 -0
  106. package/dist/app/assets/onest-cyrillic-400-normal-DH8vlB-A.woff2 +0 -0
  107. package/dist/app/assets/onest-cyrillic-700-normal-CwpXuTGk.woff2 +0 -0
  108. package/dist/app/assets/onest-cyrillic-700-normal-DOtXtm0s.woff +0 -0
  109. package/dist/app/assets/onest-latin-100-normal-4wr9CQWr.woff +0 -0
  110. package/dist/app/assets/onest-latin-100-normal-DLXL-llt.woff2 +0 -0
  111. package/dist/app/assets/onest-latin-400-normal-BAzPRZHg.woff +0 -0
  112. package/dist/app/assets/onest-latin-400-normal-bladozIj.woff2 +0 -0
  113. package/dist/app/assets/onest-latin-700-normal-B6UpoX6M.woff +0 -0
  114. package/dist/app/assets/onest-latin-700-normal-D8xhDbGo.woff2 +0 -0
  115. package/dist/app/assets/onest-latin-ext-100-normal-B3N32yGm.woff +0 -0
  116. package/dist/app/assets/onest-latin-ext-100-normal-WCPo8XPV.woff2 +0 -0
  117. package/dist/app/assets/onest-latin-ext-400-normal--mQR5RlC.woff2 +0 -0
  118. package/dist/app/assets/onest-latin-ext-400-normal-BbXTNVXw.woff +0 -0
  119. package/dist/app/assets/onest-latin-ext-700-normal-D_U7BJTl.woff2 +0 -0
  120. package/dist/app/assets/onest-latin-ext-700-normal-L8x1Byc4.woff +0 -0
  121. package/dist/app/assets/purify.es-CQJ0hv7W.js +2 -0
  122. package/dist/app/assets/ubuntu-cyrillic-400-normal-BfpxJ5Mw.woff +0 -0
  123. package/dist/app/assets/ubuntu-cyrillic-400-normal-D-o4fIzO.woff2 +0 -0
  124. package/dist/app/assets/ubuntu-cyrillic-ext-400-normal-C-34Juxs.woff +0 -0
  125. package/dist/app/assets/ubuntu-cyrillic-ext-400-normal-CVGbIIzP.woff2 +0 -0
  126. package/dist/app/assets/ubuntu-greek-400-normal-B86YUbWL.woff +0 -0
  127. package/dist/app/assets/ubuntu-greek-400-normal-DR4BMUC4.woff2 +0 -0
  128. package/dist/app/assets/ubuntu-greek-ext-400-normal-CMWpe1v5.woff2 +0 -0
  129. package/dist/app/assets/ubuntu-greek-ext-400-normal-Cksm0_CD.woff +0 -0
  130. package/dist/app/assets/ubuntu-latin-400-normal-5Llmrjj6.woff2 +0 -0
  131. package/dist/app/assets/ubuntu-latin-400-normal-CB0YmOUt.woff +0 -0
  132. package/dist/app/assets/ubuntu-latin-ext-400-normal-BmiHIjmy.woff2 +0 -0
  133. package/dist/app/assets/ubuntu-latin-ext-400-normal-VrasUMOh.woff +0 -0
  134. package/dist/app/img/IRN-logo.png +0 -0
  135. package/dist/app/img/dark/bg_ph1.png +0 -0
  136. package/dist/app/img/dark/bg_ph2.jpg +0 -0
  137. package/dist/app/img/dark/bg_ph3.png +0 -0
  138. package/dist/app/img/dark/masjid_ph1.png +0 -0
  139. package/dist/app/img/dark/masjid_ph3.png +0 -0
  140. package/dist/app/img/dark/ph1_dark.jpg +0 -0
  141. package/dist/app/img/dark/ph3_dark.jpg +0 -0
  142. package/dist/app/img/instruction.jpg +0 -0
  143. package/dist/app/img/light/bg_ph1.png +0 -0
  144. package/dist/app/img/light/bg_ph2.jpg +0 -0
  145. package/dist/app/img/light/bg_ph3.png +0 -0
  146. package/dist/app/img/light/masjid_ph1.png +0 -0
  147. package/dist/app/img/light/masjid_ph3.png +0 -0
  148. package/dist/app/img/light/ph1_light.png +0 -0
  149. package/dist/app/img/light/ph3_light.jpg +0 -0
  150. package/dist/app/img/masjid-select.png +0 -0
  151. package/dist/app/img/masjid_ph2.png +0 -0
  152. package/dist/app/img/quran img.png +0 -0
  153. package/dist/app/img/ud/bg1.png +0 -0
  154. package/dist/app/img/ud/bg2.png +0 -0
  155. package/dist/app/img/ud/bg3.png +0 -0
  156. package/dist/app/index.html +14 -0
  157. package/dist/app/manifest.webmanifest +1 -0
  158. package/dist/app/media/AD 1.png +0 -0
  159. package/dist/app/media/AD 2.jpg +0 -0
  160. package/dist/app/media/AD 3.jpg +0 -0
  161. package/dist/app/media/Mosque demo 1.mp4 +0 -0
  162. package/dist/app/media/Mosque demo 2.mp4 +0 -0
  163. package/dist/app/registerSW.js +1 -0
  164. package/dist/app/sw.js +1 -0
  165. package/dist/app/workbox-e3490c72.js +1 -0
  166. package/dist/components/lobby1/AnnouncementBar.d.ts +2 -0
  167. package/dist/components/lobby1/Carousel.d.ts +9 -0
  168. package/dist/components/lobby1/SmallPrayerTable.d.ts +13 -0
  169. package/dist/components/lobby2/ClockAndPrayersLeft.d.ts +12 -0
  170. package/dist/components/lobby2/PrayerBoxes.d.ts +14 -0
  171. package/dist/components/lobby3/Countdown.d.ts +9 -0
  172. package/dist/components/lobby3/LobbyTimetable.d.ts +9 -0
  173. package/dist/components/miscellaneous/ButtonSpin.d.ts +2 -0
  174. package/dist/components/miscellaneous/DownloadModal.d.ts +8 -0
  175. package/dist/components/miscellaneous/ErrorFallback.d.ts +3 -0
  176. package/dist/components/miscellaneous/FullscreenToggleButton.d.ts +6 -0
  177. package/dist/components/miscellaneous/Spin.d.ts +4 -0
  178. package/dist/components/miscellaneous/Toast.d.ts +2 -0
  179. package/dist/components/miscellanious/ButtonSpin.d.ts +2 -0
  180. package/dist/components/miscellanious/DownloadModal.d.ts +8 -0
  181. package/dist/components/miscellanious/FullscreenToggleButton.d.ts +6 -0
  182. package/dist/components/miscellanious/Spin.d.ts +4 -0
  183. package/dist/components/miscellanious/Toast.d.ts +2 -0
  184. package/dist/components/ph1/Instruction.d.ts +1 -0
  185. package/dist/components/ph1/MasjidLogo.d.ts +9 -0
  186. package/dist/components/ph1/MasjidPrayerClock.d.ts +8 -0
  187. package/dist/components/ph1/PrayerClockPH1.d.ts +5 -0
  188. package/dist/components/ph1/TimeTablePH1.d.ts +12 -0
  189. package/dist/components/ph2/PrayerTimeBox.d.ts +15 -0
  190. package/dist/components/ph3/CountdownText.d.ts +6 -0
  191. package/dist/components/ph3/CountdownVisual.d.ts +6 -0
  192. package/dist/components/ph3/DateInfo.d.ts +7 -0
  193. package/dist/components/ph3/DigitalClock.d.ts +5 -0
  194. package/dist/components/ph3/TimeTable.d.ts +9 -0
  195. package/dist/components/ud/CreatePrayerTimetableCard.d.ts +10 -0
  196. package/dist/components/ud/DateSelect.d.ts +10 -0
  197. package/dist/components/ud/DateSelector.d.ts +4 -0
  198. package/dist/components/ud/EventCard.d.ts +10 -0
  199. package/dist/components/ud/Header.d.ts +4 -0
  200. package/dist/components/ud/HijriCalendar.d.ts +9 -0
  201. package/dist/components/ud/ListEvents.d.ts +8 -0
  202. package/dist/components/ud/MasjidSelect.d.ts +4 -0
  203. package/dist/components/ud/PrayerTable.d.ts +9 -0
  204. package/dist/components/ud/PrayerTableTab.d.ts +9 -0
  205. package/dist/components/ud/PrayerTimetable.d.ts +4 -0
  206. package/dist/components/ud/Time.d.ts +6 -0
  207. package/dist/config/language-config.d.ts +3 -0
  208. package/dist/context/ThemeContext.d.ts +20 -0
  209. package/dist/context/UDContext.d.ts +52 -0
  210. package/dist/context/UDContextPreview.d.ts +43 -0
  211. package/dist/context/UDProviderWrapper.d.ts +2 -0
  212. package/dist/database-services/HijriServices.d.ts +11 -0
  213. package/dist/database-services/LocationServices.d.ts +16 -0
  214. package/dist/database-services/MasjidService.d.ts +6 -0
  215. package/dist/database-services/PrayerTimesService.d.ts +9 -0
  216. package/dist/database-services/logService.d.ts +1 -0
  217. package/dist/helpers/convertImgUrlToBase64.d.ts +1 -0
  218. package/dist/helpers/hexToRgba.d.ts +1 -0
  219. package/dist/hooks/useColorScheme.d.ts +16 -0
  220. package/dist/hooks/useEvents.d.ts +6 -0
  221. package/dist/hooks/useFetchAdhanAudio.d.ts +13 -0
  222. package/dist/hooks/useFetchUDTheme.d.ts +4 -0
  223. package/dist/hooks/useHijriMonthNames.d.ts +7 -0
  224. package/dist/hooks/useIqamahCheck.d.ts +12 -0
  225. package/dist/hooks/useLobbyConfig.d.ts +4 -0
  226. package/dist/hooks/useLocations.d.ts +5 -0
  227. package/dist/hooks/useMasjidInfo.d.ts +10 -0
  228. package/dist/hooks/useMosqueAnnouncement.d.ts +4 -0
  229. package/dist/hooks/useMosqueLanguage.d.ts +4 -0
  230. package/dist/hooks/useMosqueMedia.d.ts +10 -0
  231. package/dist/hooks/useMosquesForLocation.d.ts +11 -0
  232. package/dist/hooks/usePrayerTimes.d.ts +6 -0
  233. package/dist/hooks/usePrayerTimesRange.d.ts +15 -0
  234. package/dist/hooks/usePrayerTimesUD.d.ts +17 -0
  235. package/dist/hooks/usePrayerhallConfig.d.ts +4 -0
  236. package/dist/hooks/useUDLayoutConfig.d.ts +5 -0
  237. package/dist/i18n.d.ts +2 -0
  238. package/dist/index.d.ts +39 -0
  239. package/dist/layout-components/lobby1/AnnouncementPart.d.ts +10 -0
  240. package/dist/layout-components/lobby1/CarouselPart.d.ts +6 -0
  241. package/dist/layout-components/lobby1/ClockAndTime.d.ts +9 -0
  242. package/dist/layout-components/lobby1/TablePart.d.ts +15 -0
  243. package/dist/layout-components/lobby2/CarouselAndTime.d.ts +7 -0
  244. package/dist/layout-components/lobby2/PrayerPart.d.ts +17 -0
  245. package/dist/layout-components/lobby3/TimePart.d.ts +15 -0
  246. package/dist/layout-components/ph1/ClockPart.d.ts +6 -0
  247. package/dist/layout-components/ph1/TimeTablePart.d.ts +15 -0
  248. package/dist/layout-components/ph2/ClockAndPrayers.d.ts +9 -0
  249. package/dist/layout-components/ph2/CountdownBox.d.ts +8 -0
  250. package/dist/layout-components/ph2/ExtraInfo.d.ts +11 -0
  251. package/dist/layout-components/ph2/TimeAndDate.d.ts +5 -0
  252. package/dist/layout-components/ph3/DigitalClockPart.d.ts +8 -0
  253. package/dist/layout-components/ph3/MasjidInfo.d.ts +5 -0
  254. package/dist/layout-components/ph3/TimeTable.d.ts +14 -0
  255. package/dist/lib/browser-VarZHYP5.js +13 -0
  256. package/dist/lib/html2canvas.esm-d2sM-0Wm.js +4870 -0
  257. package/dist/lib/img/IRN-logo.png +0 -0
  258. package/dist/lib/img/dark/bg_ph1.png +0 -0
  259. package/dist/lib/img/dark/bg_ph2.jpg +0 -0
  260. package/dist/lib/img/dark/bg_ph3.png +0 -0
  261. package/dist/lib/img/dark/masjid_ph1.png +0 -0
  262. package/dist/lib/img/dark/masjid_ph3.png +0 -0
  263. package/dist/lib/img/dark/ph1_dark.jpg +0 -0
  264. package/dist/lib/img/dark/ph3_dark.jpg +0 -0
  265. package/dist/lib/img/instruction.jpg +0 -0
  266. package/dist/lib/img/light/bg_ph1.png +0 -0
  267. package/dist/lib/img/light/bg_ph2.jpg +0 -0
  268. package/dist/lib/img/light/bg_ph3.png +0 -0
  269. package/dist/lib/img/light/masjid_ph1.png +0 -0
  270. package/dist/lib/img/light/masjid_ph3.png +0 -0
  271. package/dist/lib/img/light/ph1_light.png +0 -0
  272. package/dist/lib/img/light/ph3_light.jpg +0 -0
  273. package/dist/lib/img/masjid-select.png +0 -0
  274. package/dist/lib/img/masjid_ph2.png +0 -0
  275. package/dist/lib/img/quran img.png +0 -0
  276. package/dist/lib/img/ud/bg1.png +0 -0
  277. package/dist/lib/img/ud/bg2.png +0 -0
  278. package/dist/lib/img/ud/bg3.png +0 -0
  279. package/dist/lib/index-2Y4JRc3S.js +28122 -0
  280. package/dist/lib/index.css +1 -0
  281. package/dist/lib/index.es-Cb_BrjEy.js +5605 -0
  282. package/dist/lib/media/AD 1.png +0 -0
  283. package/dist/lib/media/AD 2.jpg +0 -0
  284. package/dist/lib/media/AD 3.jpg +0 -0
  285. package/dist/lib/media/Mosque demo 1.mp4 +0 -0
  286. package/dist/lib/media/Mosque demo 2.mp4 +0 -0
  287. package/dist/lib/my-ui-library.es.js +41 -0
  288. package/dist/lib/my-ui-library.umd.js +407 -0
  289. package/dist/lib/purify.es-DHbHSKL1.js +528 -0
  290. package/dist/main.d.ts +19 -0
  291. package/dist/pages/IqamahScreen.d.ts +2 -0
  292. package/dist/pages/Lobby1.d.ts +2 -0
  293. package/dist/pages/Lobby2.d.ts +2 -0
  294. package/dist/pages/Lobby3.d.ts +2 -0
  295. package/dist/pages/NotFound.d.ts +2 -0
  296. package/dist/pages/PH1.d.ts +2 -0
  297. package/dist/pages/PH2.d.ts +2 -0
  298. package/dist/pages/PH3.d.ts +2 -0
  299. package/dist/pages/ud/DownloadTimetable.d.ts +2 -0
  300. package/dist/pages/ud/Events.d.ts +2 -0
  301. package/dist/pages/ud/UD1.d.ts +2 -0
  302. package/dist/pages/ud/UD2.d.ts +2 -0
  303. package/dist/pages/ud/UD3.d.ts +2 -0
  304. package/dist/pages/ud/ViewTimetable.d.ts +2 -0
  305. package/dist/renderer/lobby/LobbyLayoutRenderer.d.ts +26 -0
  306. package/dist/renderer/lobby/LobbyRenderer.d.ts +2 -0
  307. package/dist/renderer/prayer-hall/PrayerHallLayoutRenderer.d.ts +33 -0
  308. package/dist/renderer/prayer-hall/PrayerHallRenderer.d.ts +2 -0
  309. package/dist/renderer/user-display/UDLayoutRenderer.d.ts +23 -0
  310. package/dist/renderer/user-display/UDRenderer.d.ts +2 -0
  311. package/dist/routes/AppRoutes.d.ts +2 -0
  312. package/dist/supabase.d.ts +1 -0
  313. package/dist/types/types.d.ts +45 -0
  314. package/dist/utils/CustomInput.d.ts +3 -0
  315. package/dist/utils/clockThemes.d.ts +27 -0
  316. package/dist/utils/countdown.d.ts +3 -0
  317. package/dist/utils/formatDate.d.ts +1 -0
  318. package/dist/utils/formatHijriDate.d.ts +9 -0
  319. package/dist/utils/formatHijriDay.d.ts +9 -0
  320. package/dist/utils/getThemeByTime.d.ts +2 -0
  321. package/dist/utils/idb/announcementDB.d.ts +2 -0
  322. package/dist/utils/idb/colorSchemeDB.d.ts +2 -0
  323. package/dist/utils/idb/hijriDatesDB.d.ts +2 -0
  324. package/dist/utils/idb/layoutConfigDB.d.ts +2 -0
  325. package/dist/utils/idb/locationDB.d.ts +8 -0
  326. package/dist/utils/idb/masjidInfoDB.d.ts +2 -0
  327. package/dist/utils/idb/mosqueMediaDB.d.ts +2 -0
  328. package/dist/utils/idb/mosquesByLocationDB.d.ts +8 -0
  329. package/dist/utils/idb/prayerRangeDB.d.ts +5 -0
  330. package/dist/utils/idb/prayerTimesDB.d.ts +6 -0
  331. package/dist/utils/idb/siteLanguageDB.d.ts +2 -0
  332. package/dist/utils/idb/udPrayerTimesDB.d.ts +17 -0
  333. package/dist/utils/timeToHours.d.ts +1 -0
  334. package/dist/utils/toMinutes.d.ts +2 -0
  335. package/dist/utils/toSimplePrayerTimes.d.ts +2 -0
  336. package/package.json +87 -0
@@ -0,0 +1,360 @@
1
+ function Z8(e,t){for(var n=0;n<t.length;n++){const r=t[n];if(typeof r!="string"&&!Array.isArray(r)){for(const a in r)if(a!=="default"&&!(a in e)){const i=Object.getOwnPropertyDescriptor(r,a);i&&Object.defineProperty(e,a,i.get?i:{enumerable:!0,get:()=>r[a]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const a of document.querySelectorAll('link[rel="modulepreload"]'))r(a);new MutationObserver(a=>{for(const i of a)if(i.type==="childList")for(const s of i.addedNodes)s.tagName==="LINK"&&s.rel==="modulepreload"&&r(s)}).observe(document,{childList:!0,subtree:!0});function n(a){const i={};return a.integrity&&(i.integrity=a.integrity),a.referrerPolicy&&(i.referrerPolicy=a.referrerPolicy),a.crossOrigin==="use-credentials"?i.credentials="include":a.crossOrigin==="anonymous"?i.credentials="omit":i.credentials="same-origin",i}function r(a){if(a.ep)return;a.ep=!0;const i=n(a);fetch(a.href,i)}})();var ni=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Xm(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function eC(e){if(e.__esModule)return e;var t=e.default;if(typeof t=="function"){var n=function r(){return this instanceof r?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)};n.prototype=t.prototype}else n={};return Object.defineProperty(n,"__esModule",{value:!0}),Object.keys(e).forEach(function(r){var a=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(n,r,a.get?a:{enumerable:!0,get:function(){return e[r]}})}),n}var B3={exports:{}},Qm={};/**
2
+ * @license React
3
+ * react-jsx-runtime.production.js
4
+ *
5
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
6
+ *
7
+ * This source code is licensed under the MIT license found in the
8
+ * LICENSE file in the root directory of this source tree.
9
+ */var tC=Symbol.for("react.transitional.element"),nC=Symbol.for("react.fragment");function $3(e,t,n){var r=null;if(n!==void 0&&(r=""+n),t.key!==void 0&&(r=""+t.key),"key"in t){n={};for(var a in t)a!=="key"&&(n[a]=t[a])}else n=t;return t=n.ref,{$$typeof:tC,type:e,key:r,ref:t!==void 0?t:null,props:n}}Qm.Fragment=nC;Qm.jsx=$3;Qm.jsxs=$3;B3.exports=Qm;var b=B3.exports,U3={exports:{}},St={};/**
10
+ * @license React
11
+ * react.production.js
12
+ *
13
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
14
+ *
15
+ * This source code is licensed under the MIT license found in the
16
+ * LICENSE file in the root directory of this source tree.
17
+ */var yy=Symbol.for("react.transitional.element"),rC=Symbol.for("react.portal"),aC=Symbol.for("react.fragment"),iC=Symbol.for("react.strict_mode"),sC=Symbol.for("react.profiler"),oC=Symbol.for("react.consumer"),lC=Symbol.for("react.context"),uC=Symbol.for("react.forward_ref"),cC=Symbol.for("react.suspense"),fC=Symbol.for("react.memo"),z3=Symbol.for("react.lazy"),dC=Symbol.for("react.activity"),jb=Symbol.iterator;function hC(e){return e===null||typeof e!="object"?null:(e=jb&&e[jb]||e["@@iterator"],typeof e=="function"?e:null)}var q3={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},H3=Object.assign,V3={};function gc(e,t,n){this.props=e,this.context=t,this.refs=V3,this.updater=n||q3}gc.prototype.isReactComponent={};gc.prototype.setState=function(e,t){if(typeof e!="object"&&typeof e!="function"&&e!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,e,t,"setState")};gc.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function Y3(){}Y3.prototype=gc.prototype;function by(e,t,n){this.props=e,this.context=t,this.refs=V3,this.updater=n||q3}var wy=by.prototype=new Y3;wy.constructor=by;H3(wy,gc.prototype);wy.isPureReactComponent=!0;var Tb=Array.isArray;function u2(){}var Nn={H:null,A:null,T:null,S:null},G3=Object.prototype.hasOwnProperty;function xy(e,t,n){var r=n.ref;return{$$typeof:yy,type:e,key:t,ref:r!==void 0?r:null,props:n}}function pC(e,t){return xy(e.type,t,e.props)}function Sy(e){return typeof e=="object"&&e!==null&&e.$$typeof===yy}function mC(e){var t={"=":"=0",":":"=2"};return"$"+e.replace(/[=:]/g,function(n){return t[n]})}var Ob=/\/+/g;function z0(e,t){return typeof e=="object"&&e!==null&&e.key!=null?mC(""+e.key):t.toString(36)}function gC(e){switch(e.status){case"fulfilled":return e.value;case"rejected":throw e.reason;default:switch(typeof e.status=="string"?e.then(u2,u2):(e.status="pending",e.then(function(t){e.status==="pending"&&(e.status="fulfilled",e.value=t)},function(t){e.status==="pending"&&(e.status="rejected",e.reason=t)})),e.status){case"fulfilled":return e.value;case"rejected":throw e.reason}}throw e}function mu(e,t,n,r,a){var i=typeof e;(i==="undefined"||i==="boolean")&&(e=null);var s=!1;if(e===null)s=!0;else switch(i){case"bigint":case"string":case"number":s=!0;break;case"object":switch(e.$$typeof){case yy:case rC:s=!0;break;case z3:return s=e._init,mu(s(e._payload),t,n,r,a)}}if(s)return a=a(e),s=r===""?"."+z0(e,0):r,Tb(a)?(n="",s!=null&&(n=s.replace(Ob,"$&/")+"/"),mu(a,t,n,"",function(u){return u})):a!=null&&(Sy(a)&&(a=pC(a,n+(a.key==null||e&&e.key===a.key?"":(""+a.key).replace(Ob,"$&/")+"/")+s)),t.push(a)),1;s=0;var o=r===""?".":r+":";if(Tb(e))for(var l=0;l<e.length;l++)r=e[l],i=o+z0(r,l),s+=mu(r,t,n,i,a);else if(l=hC(e),typeof l=="function")for(e=l.call(e),l=0;!(r=e.next()).done;)r=r.value,i=o+z0(r,l++),s+=mu(r,t,n,i,a);else if(i==="object"){if(typeof e.then=="function")return mu(gC(e),t,n,r,a);throw t=String(e),Error("Objects are not valid as a React child (found: "+(t==="[object Object]"?"object with keys {"+Object.keys(e).join(", ")+"}":t)+"). If you meant to render a collection of children, use an array instead.")}return s}function Mh(e,t,n){if(e==null)return e;var r=[],a=0;return mu(e,r,"","",function(i){return t.call(n,i,a++)}),r}function vC(e){if(e._status===-1){var t=e._result;t=t(),t.then(function(n){(e._status===0||e._status===-1)&&(e._status=1,e._result=n)},function(n){(e._status===0||e._status===-1)&&(e._status=2,e._result=n)}),e._status===-1&&(e._status=0,e._result=t)}if(e._status===1)return e._result.default;throw e._result}var Db=typeof reportError=="function"?reportError:function(e){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var t=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof e=="object"&&e!==null&&typeof e.message=="string"?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",e);return}console.error(e)},yC={map:Mh,forEach:function(e,t,n){Mh(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return Mh(e,function(){t++}),t},toArray:function(e){return Mh(e,function(t){return t})||[]},only:function(e){if(!Sy(e))throw Error("React.Children.only expected to receive a single React element child.");return e}};St.Activity=dC;St.Children=yC;St.Component=gc;St.Fragment=aC;St.Profiler=sC;St.PureComponent=by;St.StrictMode=iC;St.Suspense=cC;St.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=Nn;St.__COMPILER_RUNTIME={__proto__:null,c:function(e){return Nn.H.useMemoCache(e)}};St.cache=function(e){return function(){return e.apply(null,arguments)}};St.cacheSignal=function(){return null};St.cloneElement=function(e,t,n){if(e==null)throw Error("The argument must be a React element, but you passed "+e+".");var r=H3({},e.props),a=e.key;if(t!=null)for(i in t.key!==void 0&&(a=""+t.key),t)!G3.call(t,i)||i==="key"||i==="__self"||i==="__source"||i==="ref"&&t.ref===void 0||(r[i]=t[i]);var i=arguments.length-2;if(i===1)r.children=n;else if(1<i){for(var s=Array(i),o=0;o<i;o++)s[o]=arguments[o+2];r.children=s}return xy(e.type,a,r)};St.createContext=function(e){return e={$$typeof:lC,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null},e.Provider=e,e.Consumer={$$typeof:oC,_context:e},e};St.createElement=function(e,t,n){var r,a={},i=null;if(t!=null)for(r in t.key!==void 0&&(i=""+t.key),t)G3.call(t,r)&&r!=="key"&&r!=="__self"&&r!=="__source"&&(a[r]=t[r]);var s=arguments.length-2;if(s===1)a.children=n;else if(1<s){for(var o=Array(s),l=0;l<s;l++)o[l]=arguments[l+2];a.children=o}if(e&&e.defaultProps)for(r in s=e.defaultProps,s)a[r]===void 0&&(a[r]=s[r]);return xy(e,i,a)};St.createRef=function(){return{current:null}};St.forwardRef=function(e){return{$$typeof:uC,render:e}};St.isValidElement=Sy;St.lazy=function(e){return{$$typeof:z3,_payload:{_status:-1,_result:e},_init:vC}};St.memo=function(e,t){return{$$typeof:fC,type:e,compare:t===void 0?null:t}};St.startTransition=function(e){var t=Nn.T,n={};Nn.T=n;try{var r=e(),a=Nn.S;a!==null&&a(n,r),typeof r=="object"&&r!==null&&typeof r.then=="function"&&r.then(u2,Db)}catch(i){Db(i)}finally{t!==null&&n.types!==null&&(t.types=n.types),Nn.T=t}};St.unstable_useCacheRefresh=function(){return Nn.H.useCacheRefresh()};St.use=function(e){return Nn.H.use(e)};St.useActionState=function(e,t,n){return Nn.H.useActionState(e,t,n)};St.useCallback=function(e,t){return Nn.H.useCallback(e,t)};St.useContext=function(e){return Nn.H.useContext(e)};St.useDebugValue=function(){};St.useDeferredValue=function(e,t){return Nn.H.useDeferredValue(e,t)};St.useEffect=function(e,t){return Nn.H.useEffect(e,t)};St.useEffectEvent=function(e){return Nn.H.useEffectEvent(e)};St.useId=function(){return Nn.H.useId()};St.useImperativeHandle=function(e,t,n){return Nn.H.useImperativeHandle(e,t,n)};St.useInsertionEffect=function(e,t){return Nn.H.useInsertionEffect(e,t)};St.useLayoutEffect=function(e,t){return Nn.H.useLayoutEffect(e,t)};St.useMemo=function(e,t){return Nn.H.useMemo(e,t)};St.useOptimistic=function(e,t){return Nn.H.useOptimistic(e,t)};St.useReducer=function(e,t,n){return Nn.H.useReducer(e,t,n)};St.useRef=function(e){return Nn.H.useRef(e)};St.useState=function(e){return Nn.H.useState(e)};St.useSyncExternalStore=function(e,t,n){return Nn.H.useSyncExternalStore(e,t,n)};St.useTransition=function(){return Nn.H.useTransition()};St.version="19.2.0";U3.exports=St;var C=U3.exports;const Lt=Xm(C),Rb=Z8({__proto__:null,default:Lt},[C]);var W3={exports:{}},Zm={},J3={exports:{}},K3={};/**
18
+ * @license React
19
+ * scheduler.production.js
20
+ *
21
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
22
+ *
23
+ * This source code is licensed under the MIT license found in the
24
+ * LICENSE file in the root directory of this source tree.
25
+ */(function(e){function t(G,ne){var Q=G.length;G.push(ne);e:for(;0<Q;){var ie=Q-1>>>1,J=G[ie];if(0<a(J,ne))G[ie]=ne,G[Q]=J,Q=ie;else break e}}function n(G){return G.length===0?null:G[0]}function r(G){if(G.length===0)return null;var ne=G[0],Q=G.pop();if(Q!==ne){G[0]=Q;e:for(var ie=0,J=G.length,le=J>>>1;ie<le;){var L=2*(ie+1)-1,z=G[L],W=L+1,te=G[W];if(0>a(z,Q))W<J&&0>a(te,z)?(G[ie]=te,G[W]=Q,ie=W):(G[ie]=z,G[L]=Q,ie=L);else if(W<J&&0>a(te,Q))G[ie]=te,G[W]=Q,ie=W;else break e}}return ne}function a(G,ne){var Q=G.sortIndex-ne.sortIndex;return Q!==0?Q:G.id-ne.id}if(e.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var i=performance;e.unstable_now=function(){return i.now()}}else{var s=Date,o=s.now();e.unstable_now=function(){return s.now()-o}}var l=[],u=[],c=1,f=null,p=3,d=!1,v=!1,S=!1,x=!1,g=typeof setTimeout=="function"?setTimeout:null,y=typeof clearTimeout=="function"?clearTimeout:null,_=typeof setImmediate<"u"?setImmediate:null;function E(G){for(var ne=n(u);ne!==null;){if(ne.callback===null)r(u);else if(ne.startTime<=G)r(u),ne.sortIndex=ne.expirationTime,t(l,ne);else break;ne=n(u)}}function D(G){if(S=!1,E(G),!v)if(n(l)!==null)v=!0,R||(R=!0,P());else{var ne=n(u);ne!==null&&se(D,ne.startTime-G)}}var R=!1,O=-1,j=5,$=-1;function V(){return x?!0:!(e.unstable_now()-$<j)}function T(){if(x=!1,R){var G=e.unstable_now();$=G;var ne=!0;try{e:{v=!1,S&&(S=!1,y(O),O=-1),d=!0;var Q=p;try{t:{for(E(G),f=n(l);f!==null&&!(f.expirationTime>G&&V());){var ie=f.callback;if(typeof ie=="function"){f.callback=null,p=f.priorityLevel;var J=ie(f.expirationTime<=G);if(G=e.unstable_now(),typeof J=="function"){f.callback=J,E(G),ne=!0;break t}f===n(l)&&r(l),E(G)}else r(l);f=n(l)}if(f!==null)ne=!0;else{var le=n(u);le!==null&&se(D,le.startTime-G),ne=!1}}break e}finally{f=null,p=Q,d=!1}ne=void 0}}finally{ne?P():R=!1}}}var P;if(typeof _=="function")P=function(){_(T)};else if(typeof MessageChannel<"u"){var q=new MessageChannel,Y=q.port2;q.port1.onmessage=T,P=function(){Y.postMessage(null)}}else P=function(){g(T,0)};function se(G,ne){O=g(function(){G(e.unstable_now())},ne)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(G){G.callback=null},e.unstable_forceFrameRate=function(G){0>G||125<G?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):j=0<G?Math.floor(1e3/G):5},e.unstable_getCurrentPriorityLevel=function(){return p},e.unstable_next=function(G){switch(p){case 1:case 2:case 3:var ne=3;break;default:ne=p}var Q=p;p=ne;try{return G()}finally{p=Q}},e.unstable_requestPaint=function(){x=!0},e.unstable_runWithPriority=function(G,ne){switch(G){case 1:case 2:case 3:case 4:case 5:break;default:G=3}var Q=p;p=G;try{return ne()}finally{p=Q}},e.unstable_scheduleCallback=function(G,ne,Q){var ie=e.unstable_now();switch(typeof Q=="object"&&Q!==null?(Q=Q.delay,Q=typeof Q=="number"&&0<Q?ie+Q:ie):Q=ie,G){case 1:var J=-1;break;case 2:J=250;break;case 5:J=1073741823;break;case 4:J=1e4;break;default:J=5e3}return J=Q+J,G={id:c++,callback:ne,priorityLevel:G,startTime:Q,expirationTime:J,sortIndex:-1},Q>ie?(G.sortIndex=Q,t(u,G),n(l)===null&&G===n(u)&&(S?(y(O),O=-1):S=!0,se(D,Q-ie))):(G.sortIndex=J,t(l,G),v||d||(v=!0,R||(R=!0,P()))),G},e.unstable_shouldYield=V,e.unstable_wrapCallback=function(G){var ne=p;return function(){var Q=p;p=ne;try{return G.apply(this,arguments)}finally{p=Q}}}})(K3);J3.exports=K3;var bC=J3.exports,X3={exports:{}},Vr={};/**
26
+ * @license React
27
+ * react-dom.production.js
28
+ *
29
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
30
+ *
31
+ * This source code is licensed under the MIT license found in the
32
+ * LICENSE file in the root directory of this source tree.
33
+ */var wC=C;function Q3(e){var t="https://react.dev/errors/"+e;if(1<arguments.length){t+="?args[]="+encodeURIComponent(arguments[1]);for(var n=2;n<arguments.length;n++)t+="&args[]="+encodeURIComponent(arguments[n])}return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function Qs(){}var qr={d:{f:Qs,r:function(){throw Error(Q3(522))},D:Qs,C:Qs,L:Qs,m:Qs,X:Qs,S:Qs,M:Qs},p:0,findDOMNode:null},xC=Symbol.for("react.portal");function SC(e,t,n){var r=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:xC,key:r==null?null:""+r,children:e,containerInfo:t,implementation:n}}var jf=wC.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function eg(e,t){if(e==="font")return"";if(typeof t=="string")return t==="use-credentials"?t:""}Vr.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=qr;Vr.createPortal=function(e,t){var n=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!t||t.nodeType!==1&&t.nodeType!==9&&t.nodeType!==11)throw Error(Q3(299));return SC(e,t,null,n)};Vr.flushSync=function(e){var t=jf.T,n=qr.p;try{if(jf.T=null,qr.p=2,e)return e()}finally{jf.T=t,qr.p=n,qr.d.f()}};Vr.preconnect=function(e,t){typeof e=="string"&&(t?(t=t.crossOrigin,t=typeof t=="string"?t==="use-credentials"?t:"":void 0):t=null,qr.d.C(e,t))};Vr.prefetchDNS=function(e){typeof e=="string"&&qr.d.D(e)};Vr.preinit=function(e,t){if(typeof e=="string"&&t&&typeof t.as=="string"){var n=t.as,r=eg(n,t.crossOrigin),a=typeof t.integrity=="string"?t.integrity:void 0,i=typeof t.fetchPriority=="string"?t.fetchPriority:void 0;n==="style"?qr.d.S(e,typeof t.precedence=="string"?t.precedence:void 0,{crossOrigin:r,integrity:a,fetchPriority:i}):n==="script"&&qr.d.X(e,{crossOrigin:r,integrity:a,fetchPriority:i,nonce:typeof t.nonce=="string"?t.nonce:void 0})}};Vr.preinitModule=function(e,t){if(typeof e=="string")if(typeof t=="object"&&t!==null){if(t.as==null||t.as==="script"){var n=eg(t.as,t.crossOrigin);qr.d.M(e,{crossOrigin:n,integrity:typeof t.integrity=="string"?t.integrity:void 0,nonce:typeof t.nonce=="string"?t.nonce:void 0})}}else t==null&&qr.d.M(e)};Vr.preload=function(e,t){if(typeof e=="string"&&typeof t=="object"&&t!==null&&typeof t.as=="string"){var n=t.as,r=eg(n,t.crossOrigin);qr.d.L(e,n,{crossOrigin:r,integrity:typeof t.integrity=="string"?t.integrity:void 0,nonce:typeof t.nonce=="string"?t.nonce:void 0,type:typeof t.type=="string"?t.type:void 0,fetchPriority:typeof t.fetchPriority=="string"?t.fetchPriority:void 0,referrerPolicy:typeof t.referrerPolicy=="string"?t.referrerPolicy:void 0,imageSrcSet:typeof t.imageSrcSet=="string"?t.imageSrcSet:void 0,imageSizes:typeof t.imageSizes=="string"?t.imageSizes:void 0,media:typeof t.media=="string"?t.media:void 0})}};Vr.preloadModule=function(e,t){if(typeof e=="string")if(t){var n=eg(t.as,t.crossOrigin);qr.d.m(e,{as:typeof t.as=="string"&&t.as!=="script"?t.as:void 0,crossOrigin:n,integrity:typeof t.integrity=="string"?t.integrity:void 0})}else qr.d.m(e)};Vr.requestFormReset=function(e){qr.d.r(e)};Vr.unstable_batchedUpdates=function(e,t){return e(t)};Vr.useFormState=function(e,t,n){return jf.H.useFormState(e,t,n)};Vr.useFormStatus=function(){return jf.H.useHostTransitionStatus()};Vr.version="19.2.0";function Z3(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(Z3)}catch(e){console.error(e)}}Z3(),X3.exports=Vr;var _y=X3.exports;/**
34
+ * @license React
35
+ * react-dom-client.production.js
36
+ *
37
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
38
+ *
39
+ * This source code is licensed under the MIT license found in the
40
+ * LICENSE file in the root directory of this source tree.
41
+ */var sr=bC,eS=C,_C=_y;function Ee(e){var t="https://react.dev/errors/"+e;if(1<arguments.length){t+="?args[]="+encodeURIComponent(arguments[1]);for(var n=2;n<arguments.length;n++)t+="&args[]="+encodeURIComponent(arguments[n])}return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function tS(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function Ad(e){var t=e,n=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,t.flags&4098&&(n=t.return),e=t.return;while(e)}return t.tag===3?n:null}function nS(e){if(e.tag===13){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function rS(e){if(e.tag===31){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function Mb(e){if(Ad(e)!==e)throw Error(Ee(188))}function AC(e){var t=e.alternate;if(!t){if(t=Ad(e),t===null)throw Error(Ee(188));return t!==e?null:e}for(var n=e,r=t;;){var a=n.return;if(a===null)break;var i=a.alternate;if(i===null){if(r=a.return,r!==null){n=r;continue}break}if(a.child===i.child){for(i=a.child;i;){if(i===n)return Mb(a),e;if(i===r)return Mb(a),t;i=i.sibling}throw Error(Ee(188))}if(n.return!==r.return)n=a,r=i;else{for(var s=!1,o=a.child;o;){if(o===n){s=!0,n=a,r=i;break}if(o===r){s=!0,r=a,n=i;break}o=o.sibling}if(!s){for(o=i.child;o;){if(o===n){s=!0,n=i,r=a;break}if(o===r){s=!0,r=i,n=a;break}o=o.sibling}if(!s)throw Error(Ee(189))}}if(n.alternate!==r)throw Error(Ee(190))}if(n.tag!==3)throw Error(Ee(188));return n.stateNode.current===n?e:t}function aS(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e;for(e=e.child;e!==null;){if(t=aS(e),t!==null)return t;e=e.sibling}return null}var En=Object.assign,NC=Symbol.for("react.element"),kh=Symbol.for("react.transitional.element"),xf=Symbol.for("react.portal"),Su=Symbol.for("react.fragment"),iS=Symbol.for("react.strict_mode"),c2=Symbol.for("react.profiler"),sS=Symbol.for("react.consumer"),ps=Symbol.for("react.context"),Ay=Symbol.for("react.forward_ref"),f2=Symbol.for("react.suspense"),d2=Symbol.for("react.suspense_list"),Ny=Symbol.for("react.memo"),ao=Symbol.for("react.lazy"),h2=Symbol.for("react.activity"),EC=Symbol.for("react.memo_cache_sentinel"),kb=Symbol.iterator;function rf(e){return e===null||typeof e!="object"?null:(e=kb&&e[kb]||e["@@iterator"],typeof e=="function"?e:null)}var CC=Symbol.for("react.client.reference");function p2(e){if(e==null)return null;if(typeof e=="function")return e.$$typeof===CC?null:e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case Su:return"Fragment";case c2:return"Profiler";case iS:return"StrictMode";case f2:return"Suspense";case d2:return"SuspenseList";case h2:return"Activity"}if(typeof e=="object")switch(e.$$typeof){case xf:return"Portal";case ps:return e.displayName||"Context";case sS:return(e._context.displayName||"Context")+".Consumer";case Ay:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case Ny:return t=e.displayName||null,t!==null?t:p2(e.type)||"Memo";case ao:t=e._payload,e=e._init;try{return p2(e(t))}catch{}}return null}var Sf=Array.isArray,dt=eS.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,Zt=_C.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,ul={pending:!1,data:null,method:null,action:null},m2=[],_u=-1;function zi(e){return{current:e}}function gr(e){0>_u||(e.current=m2[_u],m2[_u]=null,_u--)}function xn(e,t){_u++,m2[_u]=e.current,e.current=t}var Fi=zi(null),Jf=zi(null),So=zi(null),Gp=zi(null);function Wp(e,t){switch(xn(So,t),xn(Jf,e),xn(Fi,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?Uw(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=Uw(t),e=E6(t,e);else switch(e){case"svg":e=1;break;case"math":e=2;break;default:e=0}}gr(Fi),xn(Fi,e)}function tc(){gr(Fi),gr(Jf),gr(So)}function g2(e){e.memoizedState!==null&&xn(Gp,e);var t=Fi.current,n=E6(t,e.type);t!==n&&(xn(Jf,e),xn(Fi,n))}function Jp(e){Jf.current===e&&(gr(Fi),gr(Jf)),Gp.current===e&&(gr(Gp),sd._currentValue=ul)}var q0,Pb;function el(e){if(q0===void 0)try{throw Error()}catch(n){var t=n.stack.trim().match(/\n( *(at )?)/);q0=t&&t[1]||"",Pb=-1<n.stack.indexOf(`
42
+ at`)?" (<anonymous>)":-1<n.stack.indexOf("@")?"@unknown:0:0":""}return`
43
+ `+q0+e+Pb}var H0=!1;function V0(e,t){if(!e||H0)return"";H0=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var r={DetermineComponentFrameRoot:function(){try{if(t){var f=function(){throw Error()};if(Object.defineProperty(f.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(f,[])}catch(d){var p=d}Reflect.construct(e,[],f)}else{try{f.call()}catch(d){p=d}e.call(f.prototype)}}else{try{throw Error()}catch(d){p=d}(f=e())&&typeof f.catch=="function"&&f.catch(function(){})}}catch(d){if(d&&p&&typeof d.stack=="string")return[d.stack,p.stack]}return[null,null]}};r.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var a=Object.getOwnPropertyDescriptor(r.DetermineComponentFrameRoot,"name");a&&a.configurable&&Object.defineProperty(r.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var i=r.DetermineComponentFrameRoot(),s=i[0],o=i[1];if(s&&o){var l=s.split(`
44
+ `),u=o.split(`
45
+ `);for(a=r=0;r<l.length&&!l[r].includes("DetermineComponentFrameRoot");)r++;for(;a<u.length&&!u[a].includes("DetermineComponentFrameRoot");)a++;if(r===l.length||a===u.length)for(r=l.length-1,a=u.length-1;1<=r&&0<=a&&l[r]!==u[a];)a--;for(;1<=r&&0<=a;r--,a--)if(l[r]!==u[a]){if(r!==1||a!==1)do if(r--,a--,0>a||l[r]!==u[a]){var c=`
46
+ `+l[r].replace(" at new "," at ");return e.displayName&&c.includes("<anonymous>")&&(c=c.replace("<anonymous>",e.displayName)),c}while(1<=r&&0<=a);break}}}finally{H0=!1,Error.prepareStackTrace=n}return(n=e?e.displayName||e.name:"")?el(n):""}function LC(e,t){switch(e.tag){case 26:case 27:case 5:return el(e.type);case 16:return el("Lazy");case 13:return e.child!==t&&t!==null?el("Suspense Fallback"):el("Suspense");case 19:return el("SuspenseList");case 0:case 15:return V0(e.type,!1);case 11:return V0(e.type.render,!1);case 1:return V0(e.type,!0);case 31:return el("Activity");default:return""}}function Ib(e){try{var t="",n=null;do t+=LC(e,n),n=e,e=e.return;while(e);return t}catch(r){return`
47
+ Error generating stack: `+r.message+`
48
+ `+r.stack}}var v2=Object.prototype.hasOwnProperty,Ey=sr.unstable_scheduleCallback,Y0=sr.unstable_cancelCallback,jC=sr.unstable_shouldYield,TC=sr.unstable_requestPaint,Ca=sr.unstable_now,OC=sr.unstable_getCurrentPriorityLevel,oS=sr.unstable_ImmediatePriority,lS=sr.unstable_UserBlockingPriority,Kp=sr.unstable_NormalPriority,DC=sr.unstable_LowPriority,uS=sr.unstable_IdlePriority,RC=sr.log,MC=sr.unstable_setDisableYieldValue,Nd=null,La=null;function go(e){if(typeof RC=="function"&&MC(e),La&&typeof La.setStrictMode=="function")try{La.setStrictMode(Nd,e)}catch{}}var ja=Math.clz32?Math.clz32:IC,kC=Math.log,PC=Math.LN2;function IC(e){return e>>>=0,e===0?32:31-(kC(e)/PC|0)|0}var Ph=256,Ih=262144,Fh=4194304;function tl(e){var t=e&42;if(t!==0)return t;switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return e&261888;case 262144:case 524288:case 1048576:case 2097152:return e&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return e&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return e}}function tg(e,t,n){var r=e.pendingLanes;if(r===0)return 0;var a=0,i=e.suspendedLanes,s=e.pingedLanes;e=e.warmLanes;var o=r&134217727;return o!==0?(r=o&~i,r!==0?a=tl(r):(s&=o,s!==0?a=tl(s):n||(n=o&~e,n!==0&&(a=tl(n))))):(o=r&~i,o!==0?a=tl(o):s!==0?a=tl(s):n||(n=r&~e,n!==0&&(a=tl(n)))),a===0?0:t!==0&&t!==a&&!(t&i)&&(i=a&-a,n=t&-t,i>=n||i===32&&(n&4194048)!==0)?t:a}function Ed(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function FC(e,t){switch(e){case 1:case 2:case 4:case 8:case 64:return t+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return t+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function cS(){var e=Fh;return Fh<<=1,!(Fh&62914560)&&(Fh=4194304),e}function G0(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function Cd(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function BC(e,t,n,r,a,i){var s=e.pendingLanes;e.pendingLanes=n,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=n,e.entangledLanes&=n,e.errorRecoveryDisabledLanes&=n,e.shellSuspendCounter=0;var o=e.entanglements,l=e.expirationTimes,u=e.hiddenUpdates;for(n=s&~n;0<n;){var c=31-ja(n),f=1<<c;o[c]=0,l[c]=-1;var p=u[c];if(p!==null)for(u[c]=null,c=0;c<p.length;c++){var d=p[c];d!==null&&(d.lane&=-536870913)}n&=~f}r!==0&&fS(e,r,0),i!==0&&a===0&&e.tag!==0&&(e.suspendedLanes|=i&~(s&~t))}function fS(e,t,n){e.pendingLanes|=t,e.suspendedLanes&=~t;var r=31-ja(t);e.entangledLanes|=t,e.entanglements[r]=e.entanglements[r]|1073741824|n&261930}function dS(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var r=31-ja(n),a=1<<r;a&t|e[r]&t&&(e[r]|=t),n&=~a}}function hS(e,t){var n=t&-t;return n=n&42?1:Cy(n),n&(e.suspendedLanes|t)?0:n}function Cy(e){switch(e){case 2:e=1;break;case 8:e=4;break;case 32:e=16;break;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:e=128;break;case 268435456:e=134217728;break;default:e=0}return e}function Ly(e){return e&=-e,2<e?8<e?e&134217727?32:268435456:8:2}function pS(){var e=Zt.p;return e!==0?e:(e=window.event,e===void 0?32:I6(e.type))}function Fb(e,t){var n=Zt.p;try{return Zt.p=e,t()}finally{Zt.p=n}}var Fo=Math.random().toString(36).slice(2),_r="__reactFiber$"+Fo,la="__reactProps$"+Fo,vc="__reactContainer$"+Fo,y2="__reactEvents$"+Fo,$C="__reactListeners$"+Fo,UC="__reactHandles$"+Fo,Bb="__reactResources$"+Fo,Ld="__reactMarker$"+Fo;function jy(e){delete e[_r],delete e[la],delete e[y2],delete e[$C],delete e[UC]}function Au(e){var t=e[_r];if(t)return t;for(var n=e.parentNode;n;){if(t=n[vc]||n[_r]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=Yw(e);e!==null;){if(n=e[_r])return n;e=Yw(e)}return t}e=n,n=e.parentNode}return null}function yc(e){if(e=e[_r]||e[vc]){var t=e.tag;if(t===5||t===6||t===13||t===31||t===26||t===27||t===3)return e}return null}function _f(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(Ee(33))}function ku(e){var t=e[Bb];return t||(t=e[Bb]={hoistableStyles:new Map,hoistableScripts:new Map}),t}function mr(e){e[Ld]=!0}var mS=new Set,gS={};function Nl(e,t){nc(e,t),nc(e+"Capture",t)}function nc(e,t){for(gS[e]=t,e=0;e<t.length;e++)mS.add(t[e])}var zC=RegExp("^[:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD][:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*$"),$b={},Ub={};function qC(e){return v2.call(Ub,e)?!0:v2.call($b,e)?!1:zC.test(e)?Ub[e]=!0:($b[e]=!0,!1)}function yp(e,t,n){if(qC(t))if(n===null)e.removeAttribute(t);else{switch(typeof n){case"undefined":case"function":case"symbol":e.removeAttribute(t);return;case"boolean":var r=t.toLowerCase().slice(0,5);if(r!=="data-"&&r!=="aria-"){e.removeAttribute(t);return}}e.setAttribute(t,""+n)}}function Bh(e,t,n){if(n===null)e.removeAttribute(t);else{switch(typeof n){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(t);return}e.setAttribute(t,""+n)}}function rs(e,t,n,r){if(r===null)e.removeAttribute(n);else{switch(typeof r){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(n);return}e.setAttributeNS(t,n,""+r)}}function Wa(e){switch(typeof e){case"bigint":case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function vS(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function HC(e,t,n){var r=Object.getOwnPropertyDescriptor(e.constructor.prototype,t);if(!e.hasOwnProperty(t)&&typeof r<"u"&&typeof r.get=="function"&&typeof r.set=="function"){var a=r.get,i=r.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return a.call(this)},set:function(s){n=""+s,i.call(this,s)}}),Object.defineProperty(e,t,{enumerable:r.enumerable}),{getValue:function(){return n},setValue:function(s){n=""+s},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function b2(e){if(!e._valueTracker){var t=vS(e)?"checked":"value";e._valueTracker=HC(e,t,""+e[t])}}function yS(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r="";return e&&(r=vS(e)?e.checked?"true":"false":e.value),e=r,e!==n?(t.setValue(e),!0):!1}function Xp(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}var VC=/[\n"\\]/g;function Xa(e){return e.replace(VC,function(t){return"\\"+t.charCodeAt(0).toString(16)+" "})}function w2(e,t,n,r,a,i,s,o){e.name="",s!=null&&typeof s!="function"&&typeof s!="symbol"&&typeof s!="boolean"?e.type=s:e.removeAttribute("type"),t!=null?s==="number"?(t===0&&e.value===""||e.value!=t)&&(e.value=""+Wa(t)):e.value!==""+Wa(t)&&(e.value=""+Wa(t)):s!=="submit"&&s!=="reset"||e.removeAttribute("value"),t!=null?x2(e,s,Wa(t)):n!=null?x2(e,s,Wa(n)):r!=null&&e.removeAttribute("value"),a==null&&i!=null&&(e.defaultChecked=!!i),a!=null&&(e.checked=a&&typeof a!="function"&&typeof a!="symbol"),o!=null&&typeof o!="function"&&typeof o!="symbol"&&typeof o!="boolean"?e.name=""+Wa(o):e.removeAttribute("name")}function bS(e,t,n,r,a,i,s,o){if(i!=null&&typeof i!="function"&&typeof i!="symbol"&&typeof i!="boolean"&&(e.type=i),t!=null||n!=null){if(!(i!=="submit"&&i!=="reset"||t!=null)){b2(e);return}n=n!=null?""+Wa(n):"",t=t!=null?""+Wa(t):n,o||t===e.value||(e.value=t),e.defaultValue=t}r=r??a,r=typeof r!="function"&&typeof r!="symbol"&&!!r,e.checked=o?e.checked:!!r,e.defaultChecked=!!r,s!=null&&typeof s!="function"&&typeof s!="symbol"&&typeof s!="boolean"&&(e.name=s),b2(e)}function x2(e,t,n){t==="number"&&Xp(e.ownerDocument)===e||e.defaultValue===""+n||(e.defaultValue=""+n)}function Pu(e,t,n,r){if(e=e.options,t){t={};for(var a=0;a<n.length;a++)t["$"+n[a]]=!0;for(n=0;n<e.length;n++)a=t.hasOwnProperty("$"+e[n].value),e[n].selected!==a&&(e[n].selected=a),a&&r&&(e[n].defaultSelected=!0)}else{for(n=""+Wa(n),t=null,a=0;a<e.length;a++){if(e[a].value===n){e[a].selected=!0,r&&(e[a].defaultSelected=!0);return}t!==null||e[a].disabled||(t=e[a])}t!==null&&(t.selected=!0)}}function wS(e,t,n){if(t!=null&&(t=""+Wa(t),t!==e.value&&(e.value=t),n==null)){e.defaultValue!==t&&(e.defaultValue=t);return}e.defaultValue=n!=null?""+Wa(n):""}function xS(e,t,n,r){if(t==null){if(r!=null){if(n!=null)throw Error(Ee(92));if(Sf(r)){if(1<r.length)throw Error(Ee(93));r=r[0]}n=r}n==null&&(n=""),t=n}n=Wa(t),e.defaultValue=n,r=e.textContent,r===n&&r!==""&&r!==null&&(e.value=r),b2(e)}function rc(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var YC=new Set("animationIterationCount aspectRatio borderImageOutset borderImageSlice borderImageWidth boxFlex boxFlexGroup boxOrdinalGroup columnCount columns flex flexGrow flexPositive flexShrink flexNegative flexOrder gridArea gridRow gridRowEnd gridRowSpan gridRowStart gridColumn gridColumnEnd gridColumnSpan gridColumnStart fontWeight lineClamp lineHeight opacity order orphans scale tabSize widows zIndex zoom fillOpacity floodOpacity stopOpacity strokeDasharray strokeDashoffset strokeMiterlimit strokeOpacity strokeWidth MozAnimationIterationCount MozBoxFlex MozBoxFlexGroup MozLineClamp msAnimationIterationCount msFlex msZoom msFlexGrow msFlexNegative msFlexOrder msFlexPositive msFlexShrink msGridColumn msGridColumnSpan msGridRow msGridRowSpan WebkitAnimationIterationCount WebkitBoxFlex WebKitBoxFlexGroup WebkitBoxOrdinalGroup WebkitColumnCount WebkitColumns WebkitFlex WebkitFlexGrow WebkitFlexPositive WebkitFlexShrink WebkitLineClamp".split(" "));function zb(e,t,n){var r=t.indexOf("--")===0;n==null||typeof n=="boolean"||n===""?r?e.setProperty(t,""):t==="float"?e.cssFloat="":e[t]="":r?e.setProperty(t,n):typeof n!="number"||n===0||YC.has(t)?t==="float"?e.cssFloat=n:e[t]=(""+n).trim():e[t]=n+"px"}function SS(e,t,n){if(t!=null&&typeof t!="object")throw Error(Ee(62));if(e=e.style,n!=null){for(var r in n)!n.hasOwnProperty(r)||t!=null&&t.hasOwnProperty(r)||(r.indexOf("--")===0?e.setProperty(r,""):r==="float"?e.cssFloat="":e[r]="");for(var a in t)r=t[a],t.hasOwnProperty(a)&&n[a]!==r&&zb(e,a,r)}else for(var i in t)t.hasOwnProperty(i)&&zb(e,i,t[i])}function Ty(e){if(e.indexOf("-")===-1)return!1;switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var GC=new Map([["acceptCharset","accept-charset"],["htmlFor","for"],["httpEquiv","http-equiv"],["crossOrigin","crossorigin"],["accentHeight","accent-height"],["alignmentBaseline","alignment-baseline"],["arabicForm","arabic-form"],["baselineShift","baseline-shift"],["capHeight","cap-height"],["clipPath","clip-path"],["clipRule","clip-rule"],["colorInterpolation","color-interpolation"],["colorInterpolationFilters","color-interpolation-filters"],["colorProfile","color-profile"],["colorRendering","color-rendering"],["dominantBaseline","dominant-baseline"],["enableBackground","enable-background"],["fillOpacity","fill-opacity"],["fillRule","fill-rule"],["floodColor","flood-color"],["floodOpacity","flood-opacity"],["fontFamily","font-family"],["fontSize","font-size"],["fontSizeAdjust","font-size-adjust"],["fontStretch","font-stretch"],["fontStyle","font-style"],["fontVariant","font-variant"],["fontWeight","font-weight"],["glyphName","glyph-name"],["glyphOrientationHorizontal","glyph-orientation-horizontal"],["glyphOrientationVertical","glyph-orientation-vertical"],["horizAdvX","horiz-adv-x"],["horizOriginX","horiz-origin-x"],["imageRendering","image-rendering"],["letterSpacing","letter-spacing"],["lightingColor","lighting-color"],["markerEnd","marker-end"],["markerMid","marker-mid"],["markerStart","marker-start"],["overlinePosition","overline-position"],["overlineThickness","overline-thickness"],["paintOrder","paint-order"],["panose-1","panose-1"],["pointerEvents","pointer-events"],["renderingIntent","rendering-intent"],["shapeRendering","shape-rendering"],["stopColor","stop-color"],["stopOpacity","stop-opacity"],["strikethroughPosition","strikethrough-position"],["strikethroughThickness","strikethrough-thickness"],["strokeDasharray","stroke-dasharray"],["strokeDashoffset","stroke-dashoffset"],["strokeLinecap","stroke-linecap"],["strokeLinejoin","stroke-linejoin"],["strokeMiterlimit","stroke-miterlimit"],["strokeOpacity","stroke-opacity"],["strokeWidth","stroke-width"],["textAnchor","text-anchor"],["textDecoration","text-decoration"],["textRendering","text-rendering"],["transformOrigin","transform-origin"],["underlinePosition","underline-position"],["underlineThickness","underline-thickness"],["unicodeBidi","unicode-bidi"],["unicodeRange","unicode-range"],["unitsPerEm","units-per-em"],["vAlphabetic","v-alphabetic"],["vHanging","v-hanging"],["vIdeographic","v-ideographic"],["vMathematical","v-mathematical"],["vectorEffect","vector-effect"],["vertAdvY","vert-adv-y"],["vertOriginX","vert-origin-x"],["vertOriginY","vert-origin-y"],["wordSpacing","word-spacing"],["writingMode","writing-mode"],["xmlnsXlink","xmlns:xlink"],["xHeight","x-height"]]),WC=/^[\u0000-\u001F ]*j[\r\n\t]*a[\r\n\t]*v[\r\n\t]*a[\r\n\t]*s[\r\n\t]*c[\r\n\t]*r[\r\n\t]*i[\r\n\t]*p[\r\n\t]*t[\r\n\t]*:/i;function bp(e){return WC.test(""+e)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":e}function ms(){}var S2=null;function Oy(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Nu=null,Iu=null;function qb(e){var t=yc(e);if(t&&(e=t.stateNode)){var n=e[la]||null;e:switch(e=t.stateNode,t.type){case"input":if(w2(e,n.value,n.defaultValue,n.defaultValue,n.checked,n.defaultChecked,n.type,n.name),t=n.name,n.type==="radio"&&t!=null){for(n=e;n.parentNode;)n=n.parentNode;for(n=n.querySelectorAll('input[name="'+Xa(""+t)+'"][type="radio"]'),t=0;t<n.length;t++){var r=n[t];if(r!==e&&r.form===e.form){var a=r[la]||null;if(!a)throw Error(Ee(90));w2(r,a.value,a.defaultValue,a.defaultValue,a.checked,a.defaultChecked,a.type,a.name)}}for(t=0;t<n.length;t++)r=n[t],r.form===e.form&&yS(r)}break e;case"textarea":wS(e,n.value,n.defaultValue);break e;case"select":t=n.value,t!=null&&Pu(e,!!n.multiple,t,!1)}}}var W0=!1;function _S(e,t,n){if(W0)return e(t,n);W0=!0;try{var r=e(t);return r}finally{if(W0=!1,(Nu!==null||Iu!==null)&&(hg(),Nu&&(t=Nu,e=Iu,Iu=Nu=null,qb(t),e)))for(t=0;t<e.length;t++)qb(e[t])}}function Kf(e,t){var n=e.stateNode;if(n===null)return null;var r=n[la]||null;if(r===null)return null;n=r[t];e:switch(t){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(r=!r.disabled)||(e=e.type,r=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!r;break e;default:e=!1}if(e)return null;if(n&&typeof n!="function")throw Error(Ee(231,t,typeof n));return n}var _s=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),_2=!1;if(_s)try{var af={};Object.defineProperty(af,"passive",{get:function(){_2=!0}}),window.addEventListener("test",af,af),window.removeEventListener("test",af,af)}catch{_2=!1}var vo=null,Dy=null,wp=null;function AS(){if(wp)return wp;var e,t=Dy,n=t.length,r,a="value"in vo?vo.value:vo.textContent,i=a.length;for(e=0;e<n&&t[e]===a[e];e++);var s=n-e;for(r=1;r<=s&&t[n-r]===a[i-r];r++);return wp=a.slice(e,1<r?1-r:void 0)}function xp(e){var t=e.keyCode;return"charCode"in e?(e=e.charCode,e===0&&t===13&&(e=13)):e=t,e===10&&(e=13),32<=e||e===13?e:0}function $h(){return!0}function Hb(){return!1}function ca(e){function t(n,r,a,i,s){this._reactName=n,this._targetInst=a,this.type=r,this.nativeEvent=i,this.target=s,this.currentTarget=null;for(var o in e)e.hasOwnProperty(o)&&(n=e[o],this[o]=n?n(i):i[o]);return this.isDefaultPrevented=(i.defaultPrevented!=null?i.defaultPrevented:i.returnValue===!1)?$h:Hb,this.isPropagationStopped=Hb,this}return En(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var n=this.nativeEvent;n&&(n.preventDefault?n.preventDefault():typeof n.returnValue!="unknown"&&(n.returnValue=!1),this.isDefaultPrevented=$h)},stopPropagation:function(){var n=this.nativeEvent;n&&(n.stopPropagation?n.stopPropagation():typeof n.cancelBubble!="unknown"&&(n.cancelBubble=!0),this.isPropagationStopped=$h)},persist:function(){},isPersistent:$h}),t}var El={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},ng=ca(El),jd=En({},El,{view:0,detail:0}),JC=ca(jd),J0,K0,sf,rg=En({},jd,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Ry,button:0,buttons:0,relatedTarget:function(e){return e.relatedTarget===void 0?e.fromElement===e.srcElement?e.toElement:e.fromElement:e.relatedTarget},movementX:function(e){return"movementX"in e?e.movementX:(e!==sf&&(sf&&e.type==="mousemove"?(J0=e.screenX-sf.screenX,K0=e.screenY-sf.screenY):K0=J0=0,sf=e),J0)},movementY:function(e){return"movementY"in e?e.movementY:K0}}),Vb=ca(rg),KC=En({},rg,{dataTransfer:0}),XC=ca(KC),QC=En({},jd,{relatedTarget:0}),X0=ca(QC),ZC=En({},El,{animationName:0,elapsedTime:0,pseudoElement:0}),eL=ca(ZC),tL=En({},El,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),nL=ca(tL),rL=En({},El,{data:0}),Yb=ca(rL),aL={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},iL={8:"Backspace",9:"Tab",12:"Clear",13:"Enter",16:"Shift",17:"Control",18:"Alt",19:"Pause",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",45:"Insert",46:"Delete",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"NumLock",145:"ScrollLock",224:"Meta"},sL={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function oL(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=sL[e])?!!t[e]:!1}function Ry(){return oL}var lL=En({},jd,{key:function(e){if(e.key){var t=aL[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=xp(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?iL[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Ry,charCode:function(e){return e.type==="keypress"?xp(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?xp(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),uL=ca(lL),cL=En({},rg,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Gb=ca(cL),fL=En({},jd,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Ry}),dL=ca(fL),hL=En({},El,{propertyName:0,elapsedTime:0,pseudoElement:0}),pL=ca(hL),mL=En({},rg,{deltaX:function(e){return"deltaX"in e?e.deltaX:"wheelDeltaX"in e?-e.wheelDeltaX:0},deltaY:function(e){return"deltaY"in e?e.deltaY:"wheelDeltaY"in e?-e.wheelDeltaY:"wheelDelta"in e?-e.wheelDelta:0},deltaZ:0,deltaMode:0}),gL=ca(mL),vL=En({},El,{newState:0,oldState:0}),yL=ca(vL),bL=[9,13,27,32],My=_s&&"CompositionEvent"in window,Tf=null;_s&&"documentMode"in document&&(Tf=document.documentMode);var wL=_s&&"TextEvent"in window&&!Tf,NS=_s&&(!My||Tf&&8<Tf&&11>=Tf),Wb=" ",Jb=!1;function ES(e,t){switch(e){case"keyup":return bL.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function CS(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Eu=!1;function xL(e,t){switch(e){case"compositionend":return CS(t);case"keypress":return t.which!==32?null:(Jb=!0,Wb);case"textInput":return e=t.data,e===Wb&&Jb?null:e;default:return null}}function SL(e,t){if(Eu)return e==="compositionend"||!My&&ES(e,t)?(e=AS(),wp=Dy=vo=null,Eu=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1<t.char.length)return t.char;if(t.which)return String.fromCharCode(t.which)}return null;case"compositionend":return NS&&t.locale!=="ko"?null:t.data;default:return null}}var _L={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function Kb(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!_L[e.type]:t==="textarea"}function LS(e,t,n,r){Nu?Iu?Iu.push(r):Iu=[r]:Nu=r,t=mm(t,"onChange"),0<t.length&&(n=new ng("onChange","change",null,n,r),e.push({event:n,listeners:t}))}var Of=null,Xf=null;function AL(e){_6(e,0)}function ag(e){var t=_f(e);if(yS(t))return e}function Xb(e,t){if(e==="change")return t}var jS=!1;if(_s){var Q0;if(_s){var Z0="oninput"in document;if(!Z0){var Qb=document.createElement("div");Qb.setAttribute("oninput","return;"),Z0=typeof Qb.oninput=="function"}Q0=Z0}else Q0=!1;jS=Q0&&(!document.documentMode||9<document.documentMode)}function Zb(){Of&&(Of.detachEvent("onpropertychange",TS),Xf=Of=null)}function TS(e){if(e.propertyName==="value"&&ag(Xf)){var t=[];LS(t,Xf,e,Oy(e)),_S(AL,t)}}function NL(e,t,n){e==="focusin"?(Zb(),Of=t,Xf=n,Of.attachEvent("onpropertychange",TS)):e==="focusout"&&Zb()}function EL(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return ag(Xf)}function CL(e,t){if(e==="click")return ag(t)}function LL(e,t){if(e==="input"||e==="change")return ag(t)}function jL(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var Da=typeof Object.is=="function"?Object.is:jL;function Qf(e,t){if(Da(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;var n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(r=0;r<n.length;r++){var a=n[r];if(!v2.call(t,a)||!Da(e[a],t[a]))return!1}return!0}function ew(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function tw(e,t){var n=ew(e);e=0;for(var r;n;){if(n.nodeType===3){if(r=e+n.textContent.length,e<=t&&r>=t)return{node:n,offset:t-e};e=r}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=ew(n)}}function OS(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?OS(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function DS(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=Xp(e.document);t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href=="string"}catch{n=!1}if(n)e=t.contentWindow;else break;t=Xp(e.document)}return t}function ky(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||t==="textarea"||e.contentEditable==="true")}var TL=_s&&"documentMode"in document&&11>=document.documentMode,Cu=null,A2=null,Df=null,N2=!1;function nw(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;N2||Cu==null||Cu!==Xp(r)||(r=Cu,"selectionStart"in r&&ky(r)?r={start:r.selectionStart,end:r.selectionEnd}:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection(),r={anchorNode:r.anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset}),Df&&Qf(Df,r)||(Df=r,r=mm(A2,"onSelect"),0<r.length&&(t=new ng("onSelect","select",null,t,n),e.push({event:t,listeners:r}),t.target=Cu)))}function Qo(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n["Webkit"+e]="webkit"+t,n["Moz"+e]="moz"+t,n}var Lu={animationend:Qo("Animation","AnimationEnd"),animationiteration:Qo("Animation","AnimationIteration"),animationstart:Qo("Animation","AnimationStart"),transitionrun:Qo("Transition","TransitionRun"),transitionstart:Qo("Transition","TransitionStart"),transitioncancel:Qo("Transition","TransitionCancel"),transitionend:Qo("Transition","TransitionEnd")},e1={},RS={};_s&&(RS=document.createElement("div").style,"AnimationEvent"in window||(delete Lu.animationend.animation,delete Lu.animationiteration.animation,delete Lu.animationstart.animation),"TransitionEvent"in window||delete Lu.transitionend.transition);function Cl(e){if(e1[e])return e1[e];if(!Lu[e])return e;var t=Lu[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in RS)return e1[e]=t[n];return e}var MS=Cl("animationend"),kS=Cl("animationiteration"),PS=Cl("animationstart"),OL=Cl("transitionrun"),DL=Cl("transitionstart"),RL=Cl("transitioncancel"),IS=Cl("transitionend"),FS=new Map,E2="abort auxClick beforeToggle cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");E2.push("scrollEnd");function bi(e,t){FS.set(e,t),Nl(t,[e])}var Qp=typeof reportError=="function"?reportError:function(e){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var t=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof e=="object"&&e!==null&&typeof e.message=="string"?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",e);return}console.error(e)},Ya=[],ju=0,Py=0;function ig(){for(var e=ju,t=Py=ju=0;t<e;){var n=Ya[t];Ya[t++]=null;var r=Ya[t];Ya[t++]=null;var a=Ya[t];Ya[t++]=null;var i=Ya[t];if(Ya[t++]=null,r!==null&&a!==null){var s=r.pending;s===null?a.next=a:(a.next=s.next,s.next=a),r.pending=a}i!==0&&BS(n,a,i)}}function sg(e,t,n,r){Ya[ju++]=e,Ya[ju++]=t,Ya[ju++]=n,Ya[ju++]=r,Py|=r,e.lanes|=r,e=e.alternate,e!==null&&(e.lanes|=r)}function Iy(e,t,n,r){return sg(e,t,n,r),Zp(e)}function Ll(e,t){return sg(e,null,null,t),Zp(e)}function BS(e,t,n){e.lanes|=n;var r=e.alternate;r!==null&&(r.lanes|=n);for(var a=!1,i=e.return;i!==null;)i.childLanes|=n,r=i.alternate,r!==null&&(r.childLanes|=n),i.tag===22&&(e=i.stateNode,e===null||e._visibility&1||(a=!0)),e=i,i=i.return;return e.tag===3?(i=e.stateNode,a&&t!==null&&(a=31-ja(n),e=i.hiddenUpdates,r=e[a],r===null?e[a]=[t]:r.push(t),t.lane=n|536870912),i):null}function Zp(e){if(50<Uf)throw Uf=0,G2=null,Error(Ee(185));for(var t=e.return;t!==null;)e=t,t=e.return;return e.tag===3?e.stateNode:null}var Tu={};function ML(e,t,n,r){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Aa(e,t,n,r){return new ML(e,t,n,r)}function Fy(e){return e=e.prototype,!(!e||!e.isReactComponent)}function ys(e,t){var n=e.alternate;return n===null?(n=Aa(e.tag,t,e.key,e.mode),n.elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=e.flags&65011712,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n.refCleanup=e.refCleanup,n}function $S(e,t){e.flags&=65011714;var n=e.alternate;return n===null?(e.childLanes=0,e.lanes=t,e.child=null,e.subtreeFlags=0,e.memoizedProps=null,e.memoizedState=null,e.updateQueue=null,e.dependencies=null,e.stateNode=null):(e.childLanes=n.childLanes,e.lanes=n.lanes,e.child=n.child,e.subtreeFlags=0,e.deletions=null,e.memoizedProps=n.memoizedProps,e.memoizedState=n.memoizedState,e.updateQueue=n.updateQueue,e.type=n.type,t=n.dependencies,e.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext}),e}function Sp(e,t,n,r,a,i){var s=0;if(r=e,typeof e=="function")Fy(e)&&(s=1);else if(typeof e=="string")s=Bj(e,n,Fi.current)?26:e==="html"||e==="head"||e==="body"?27:5;else e:switch(e){case h2:return e=Aa(31,n,t,a),e.elementType=h2,e.lanes=i,e;case Su:return cl(n.children,a,i,t);case iS:s=8,a|=24;break;case c2:return e=Aa(12,n,t,a|2),e.elementType=c2,e.lanes=i,e;case f2:return e=Aa(13,n,t,a),e.elementType=f2,e.lanes=i,e;case d2:return e=Aa(19,n,t,a),e.elementType=d2,e.lanes=i,e;default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case ps:s=10;break e;case sS:s=9;break e;case Ay:s=11;break e;case Ny:s=14;break e;case ao:s=16,r=null;break e}s=29,n=Error(Ee(130,e===null?"null":typeof e,"")),r=null}return t=Aa(s,n,t,a),t.elementType=e,t.type=r,t.lanes=i,t}function cl(e,t,n,r){return e=Aa(7,e,r,t),e.lanes=n,e}function t1(e,t,n){return e=Aa(6,e,null,t),e.lanes=n,e}function US(e){var t=Aa(18,null,null,0);return t.stateNode=e,t}function n1(e,t,n){return t=Aa(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var rw=new WeakMap;function Qa(e,t){if(typeof e=="object"&&e!==null){var n=rw.get(e);return n!==void 0?n:(t={value:e,source:t,stack:Ib(t)},rw.set(e,t),t)}return{value:e,source:t,stack:Ib(t)}}var Ou=[],Du=0,em=null,Zf=0,Ja=[],Ka=0,Oo=null,Ri=1,Mi="";function ds(e,t){Ou[Du++]=Zf,Ou[Du++]=em,em=e,Zf=t}function zS(e,t,n){Ja[Ka++]=Ri,Ja[Ka++]=Mi,Ja[Ka++]=Oo,Oo=e;var r=Ri;e=Mi;var a=32-ja(r)-1;r&=~(1<<a),n+=1;var i=32-ja(t)+a;if(30<i){var s=a-a%5;i=(r&(1<<s)-1).toString(32),r>>=s,a-=s,Ri=1<<32-ja(t)+a|n<<a|r,Mi=i+e}else Ri=1<<i|n<<a|r,Mi=e}function By(e){e.return!==null&&(ds(e,1),zS(e,1,0))}function $y(e){for(;e===em;)em=Ou[--Du],Ou[Du]=null,Zf=Ou[--Du],Ou[Du]=null;for(;e===Oo;)Oo=Ja[--Ka],Ja[Ka]=null,Mi=Ja[--Ka],Ja[Ka]=null,Ri=Ja[--Ka],Ja[Ka]=null}function qS(e,t){Ja[Ka++]=Ri,Ja[Ka++]=Mi,Ja[Ka++]=Oo,Ri=t.id,Mi=t.overflow,Oo=e}var Ar=null,_n=null,Bt=!1,_o=null,Za=!1,C2=Error(Ee(519));function Do(e){var t=Error(Ee(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw ed(Qa(t,e)),C2}function aw(e){var t=e.stateNode,n=e.type,r=e.memoizedProps;switch(t[_r]=e,t[la]=r,n){case"dialog":Ot("cancel",t),Ot("close",t);break;case"iframe":case"object":case"embed":Ot("load",t);break;case"video":case"audio":for(n=0;n<ad.length;n++)Ot(ad[n],t);break;case"source":Ot("error",t);break;case"img":case"image":case"link":Ot("error",t),Ot("load",t);break;case"details":Ot("toggle",t);break;case"input":Ot("invalid",t),bS(t,r.value,r.defaultValue,r.checked,r.defaultChecked,r.type,r.name,!0);break;case"select":Ot("invalid",t);break;case"textarea":Ot("invalid",t),xS(t,r.value,r.defaultValue,r.children)}n=r.children,typeof n!="string"&&typeof n!="number"&&typeof n!="bigint"||t.textContent===""+n||r.suppressHydrationWarning===!0||N6(t.textContent,n)?(r.popover!=null&&(Ot("beforetoggle",t),Ot("toggle",t)),r.onScroll!=null&&Ot("scroll",t),r.onScrollEnd!=null&&Ot("scrollend",t),r.onClick!=null&&(t.onclick=ms),t=!0):t=!1,t||Do(e,!0)}function iw(e){for(Ar=e.return;Ar;)switch(Ar.tag){case 5:case 31:case 13:Za=!1;return;case 27:case 3:Za=!0;return;default:Ar=Ar.return}}function nu(e){if(e!==Ar)return!1;if(!Bt)return iw(e),Bt=!0,!1;var t=e.tag,n;if((n=t!==3&&t!==27)&&((n=t===5)&&(n=e.type,n=!(n!=="form"&&n!=="button")||Q2(e.type,e.memoizedProps)),n=!n),n&&_n&&Do(e),iw(e),t===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(Ee(317));_n=Vw(e)}else if(t===31){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(Ee(317));_n=Vw(e)}else t===27?(t=_n,Bo(e.type)?(e=nv,nv=null,_n=e):_n=t):_n=Ar?ti(e.stateNode.nextSibling):null;return!0}function bl(){_n=Ar=null,Bt=!1}function r1(){var e=_o;return e!==null&&(aa===null?aa=e:aa.push.apply(aa,e),_o=null),e}function ed(e){_o===null?_o=[e]:_o.push(e)}var L2=zi(null),jl=null,gs=null;function lo(e,t,n){xn(L2,t._currentValue),t._currentValue=n}function bs(e){e._currentValue=L2.current,gr(L2)}function j2(e,t,n){for(;e!==null;){var r=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,r!==null&&(r.childLanes|=t)):r!==null&&(r.childLanes&t)!==t&&(r.childLanes|=t),e===n)break;e=e.return}}function T2(e,t,n,r){var a=e.child;for(a!==null&&(a.return=e);a!==null;){var i=a.dependencies;if(i!==null){var s=a.child;i=i.firstContext;e:for(;i!==null;){var o=i;i=a;for(var l=0;l<t.length;l++)if(o.context===t[l]){i.lanes|=n,o=i.alternate,o!==null&&(o.lanes|=n),j2(i.return,n,e),r||(s=null);break e}i=o.next}}else if(a.tag===18){if(s=a.return,s===null)throw Error(Ee(341));s.lanes|=n,i=s.alternate,i!==null&&(i.lanes|=n),j2(s,n,e),s=null}else s=a.child;if(s!==null)s.return=a;else for(s=a;s!==null;){if(s===e){s=null;break}if(a=s.sibling,a!==null){a.return=s.return,s=a;break}s=s.return}a=s}}function bc(e,t,n,r){e=null;for(var a=t,i=!1;a!==null;){if(!i){if(a.flags&524288)i=!0;else if(a.flags&262144)break}if(a.tag===10){var s=a.alternate;if(s===null)throw Error(Ee(387));if(s=s.memoizedProps,s!==null){var o=a.type;Da(a.pendingProps.value,s.value)||(e!==null?e.push(o):e=[o])}}else if(a===Gp.current){if(s=a.alternate,s===null)throw Error(Ee(387));s.memoizedState.memoizedState!==a.memoizedState.memoizedState&&(e!==null?e.push(sd):e=[sd])}a=a.return}e!==null&&T2(t,e,n,r),t.flags|=262144}function tm(e){for(e=e.firstContext;e!==null;){if(!Da(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function wl(e){jl=e,gs=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function Nr(e){return HS(jl,e)}function Uh(e,t){return jl===null&&wl(e),HS(e,t)}function HS(e,t){var n=t._currentValue;if(t={context:t,memoizedValue:n,next:null},gs===null){if(e===null)throw Error(Ee(308));gs=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else gs=gs.next=t;return n}var kL=typeof AbortController<"u"?AbortController:function(){var e=[],t=this.signal={aborted:!1,addEventListener:function(n,r){e.push(r)}};this.abort=function(){t.aborted=!0,e.forEach(function(n){return n()})}},PL=sr.unstable_scheduleCallback,IL=sr.unstable_NormalPriority,er={$$typeof:ps,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function Uy(){return{controller:new kL,data:new Map,refCount:0}}function Td(e){e.refCount--,e.refCount===0&&PL(IL,function(){e.controller.abort()})}var Rf=null,O2=0,ac=0,Fu=null;function FL(e,t){if(Rf===null){var n=Rf=[];O2=0,ac=d5(),Fu={status:"pending",value:void 0,then:function(r){n.push(r)}}}return O2++,t.then(sw,sw),t}function sw(){if(--O2===0&&Rf!==null){Fu!==null&&(Fu.status="fulfilled");var e=Rf;Rf=null,ac=0,Fu=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function BL(e,t){var n=[],r={status:"pending",value:null,reason:null,then:function(a){n.push(a)}};return e.then(function(){r.status="fulfilled",r.value=t;for(var a=0;a<n.length;a++)(0,n[a])(t)},function(a){for(r.status="rejected",r.reason=a,a=0;a<n.length;a++)(0,n[a])(void 0)}),r}var ow=dt.S;dt.S=function(e,t){a6=Ca(),typeof t=="object"&&t!==null&&typeof t.then=="function"&&FL(e,t),ow!==null&&ow(e,t)};var fl=zi(null);function zy(){var e=fl.current;return e!==null?e:dn.pooledCache}function _p(e,t){t===null?xn(fl,fl.current):xn(fl,t.pool)}function VS(){var e=zy();return e===null?null:{parent:er._currentValue,pool:e}}var wc=Error(Ee(460)),qy=Error(Ee(474)),og=Error(Ee(542)),nm={then:function(){}};function lw(e){return e=e.status,e==="fulfilled"||e==="rejected"}function YS(e,t,n){switch(n=e[n],n===void 0?e.push(t):n!==t&&(t.then(ms,ms),t=n),t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,cw(e),e;default:if(typeof t.status=="string")t.then(ms,ms);else{if(e=dn,e!==null&&100<e.shellSuspendCounter)throw Error(Ee(482));e=t,e.status="pending",e.then(function(r){if(t.status==="pending"){var a=t;a.status="fulfilled",a.value=r}},function(r){if(t.status==="pending"){var a=t;a.status="rejected",a.reason=r}})}switch(t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,cw(e),e}throw dl=t,wc}}function nl(e){try{var t=e._init;return t(e._payload)}catch(n){throw n!==null&&typeof n=="object"&&typeof n.then=="function"?(dl=n,wc):n}}var dl=null;function uw(){if(dl===null)throw Error(Ee(459));var e=dl;return dl=null,e}function cw(e){if(e===wc||e===og)throw Error(Ee(483))}var Bu=null,td=0;function zh(e){var t=td;return td+=1,Bu===null&&(Bu=[]),YS(Bu,e,t)}function of(e,t){t=t.props.ref,e.ref=t!==void 0?t:null}function qh(e,t){throw t.$$typeof===NC?Error(Ee(525)):(e=Object.prototype.toString.call(t),Error(Ee(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e)))}function GS(e){function t(g,y){if(e){var _=g.deletions;_===null?(g.deletions=[y],g.flags|=16):_.push(y)}}function n(g,y){if(!e)return null;for(;y!==null;)t(g,y),y=y.sibling;return null}function r(g){for(var y=new Map;g!==null;)g.key!==null?y.set(g.key,g):y.set(g.index,g),g=g.sibling;return y}function a(g,y){return g=ys(g,y),g.index=0,g.sibling=null,g}function i(g,y,_){return g.index=_,e?(_=g.alternate,_!==null?(_=_.index,_<y?(g.flags|=67108866,y):_):(g.flags|=67108866,y)):(g.flags|=1048576,y)}function s(g){return e&&g.alternate===null&&(g.flags|=67108866),g}function o(g,y,_,E){return y===null||y.tag!==6?(y=t1(_,g.mode,E),y.return=g,y):(y=a(y,_),y.return=g,y)}function l(g,y,_,E){var D=_.type;return D===Su?c(g,y,_.props.children,E,_.key):y!==null&&(y.elementType===D||typeof D=="object"&&D!==null&&D.$$typeof===ao&&nl(D)===y.type)?(y=a(y,_.props),of(y,_),y.return=g,y):(y=Sp(_.type,_.key,_.props,null,g.mode,E),of(y,_),y.return=g,y)}function u(g,y,_,E){return y===null||y.tag!==4||y.stateNode.containerInfo!==_.containerInfo||y.stateNode.implementation!==_.implementation?(y=n1(_,g.mode,E),y.return=g,y):(y=a(y,_.children||[]),y.return=g,y)}function c(g,y,_,E,D){return y===null||y.tag!==7?(y=cl(_,g.mode,E,D),y.return=g,y):(y=a(y,_),y.return=g,y)}function f(g,y,_){if(typeof y=="string"&&y!==""||typeof y=="number"||typeof y=="bigint")return y=t1(""+y,g.mode,_),y.return=g,y;if(typeof y=="object"&&y!==null){switch(y.$$typeof){case kh:return _=Sp(y.type,y.key,y.props,null,g.mode,_),of(_,y),_.return=g,_;case xf:return y=n1(y,g.mode,_),y.return=g,y;case ao:return y=nl(y),f(g,y,_)}if(Sf(y)||rf(y))return y=cl(y,g.mode,_,null),y.return=g,y;if(typeof y.then=="function")return f(g,zh(y),_);if(y.$$typeof===ps)return f(g,Uh(g,y),_);qh(g,y)}return null}function p(g,y,_,E){var D=y!==null?y.key:null;if(typeof _=="string"&&_!==""||typeof _=="number"||typeof _=="bigint")return D!==null?null:o(g,y,""+_,E);if(typeof _=="object"&&_!==null){switch(_.$$typeof){case kh:return _.key===D?l(g,y,_,E):null;case xf:return _.key===D?u(g,y,_,E):null;case ao:return _=nl(_),p(g,y,_,E)}if(Sf(_)||rf(_))return D!==null?null:c(g,y,_,E,null);if(typeof _.then=="function")return p(g,y,zh(_),E);if(_.$$typeof===ps)return p(g,y,Uh(g,_),E);qh(g,_)}return null}function d(g,y,_,E,D){if(typeof E=="string"&&E!==""||typeof E=="number"||typeof E=="bigint")return g=g.get(_)||null,o(y,g,""+E,D);if(typeof E=="object"&&E!==null){switch(E.$$typeof){case kh:return g=g.get(E.key===null?_:E.key)||null,l(y,g,E,D);case xf:return g=g.get(E.key===null?_:E.key)||null,u(y,g,E,D);case ao:return E=nl(E),d(g,y,_,E,D)}if(Sf(E)||rf(E))return g=g.get(_)||null,c(y,g,E,D,null);if(typeof E.then=="function")return d(g,y,_,zh(E),D);if(E.$$typeof===ps)return d(g,y,_,Uh(y,E),D);qh(y,E)}return null}function v(g,y,_,E){for(var D=null,R=null,O=y,j=y=0,$=null;O!==null&&j<_.length;j++){O.index>j?($=O,O=null):$=O.sibling;var V=p(g,O,_[j],E);if(V===null){O===null&&(O=$);break}e&&O&&V.alternate===null&&t(g,O),y=i(V,y,j),R===null?D=V:R.sibling=V,R=V,O=$}if(j===_.length)return n(g,O),Bt&&ds(g,j),D;if(O===null){for(;j<_.length;j++)O=f(g,_[j],E),O!==null&&(y=i(O,y,j),R===null?D=O:R.sibling=O,R=O);return Bt&&ds(g,j),D}for(O=r(O);j<_.length;j++)$=d(O,g,j,_[j],E),$!==null&&(e&&$.alternate!==null&&O.delete($.key===null?j:$.key),y=i($,y,j),R===null?D=$:R.sibling=$,R=$);return e&&O.forEach(function(T){return t(g,T)}),Bt&&ds(g,j),D}function S(g,y,_,E){if(_==null)throw Error(Ee(151));for(var D=null,R=null,O=y,j=y=0,$=null,V=_.next();O!==null&&!V.done;j++,V=_.next()){O.index>j?($=O,O=null):$=O.sibling;var T=p(g,O,V.value,E);if(T===null){O===null&&(O=$);break}e&&O&&T.alternate===null&&t(g,O),y=i(T,y,j),R===null?D=T:R.sibling=T,R=T,O=$}if(V.done)return n(g,O),Bt&&ds(g,j),D;if(O===null){for(;!V.done;j++,V=_.next())V=f(g,V.value,E),V!==null&&(y=i(V,y,j),R===null?D=V:R.sibling=V,R=V);return Bt&&ds(g,j),D}for(O=r(O);!V.done;j++,V=_.next())V=d(O,g,j,V.value,E),V!==null&&(e&&V.alternate!==null&&O.delete(V.key===null?j:V.key),y=i(V,y,j),R===null?D=V:R.sibling=V,R=V);return e&&O.forEach(function(P){return t(g,P)}),Bt&&ds(g,j),D}function x(g,y,_,E){if(typeof _=="object"&&_!==null&&_.type===Su&&_.key===null&&(_=_.props.children),typeof _=="object"&&_!==null){switch(_.$$typeof){case kh:e:{for(var D=_.key;y!==null;){if(y.key===D){if(D=_.type,D===Su){if(y.tag===7){n(g,y.sibling),E=a(y,_.props.children),E.return=g,g=E;break e}}else if(y.elementType===D||typeof D=="object"&&D!==null&&D.$$typeof===ao&&nl(D)===y.type){n(g,y.sibling),E=a(y,_.props),of(E,_),E.return=g,g=E;break e}n(g,y);break}else t(g,y);y=y.sibling}_.type===Su?(E=cl(_.props.children,g.mode,E,_.key),E.return=g,g=E):(E=Sp(_.type,_.key,_.props,null,g.mode,E),of(E,_),E.return=g,g=E)}return s(g);case xf:e:{for(D=_.key;y!==null;){if(y.key===D)if(y.tag===4&&y.stateNode.containerInfo===_.containerInfo&&y.stateNode.implementation===_.implementation){n(g,y.sibling),E=a(y,_.children||[]),E.return=g,g=E;break e}else{n(g,y);break}else t(g,y);y=y.sibling}E=n1(_,g.mode,E),E.return=g,g=E}return s(g);case ao:return _=nl(_),x(g,y,_,E)}if(Sf(_))return v(g,y,_,E);if(rf(_)){if(D=rf(_),typeof D!="function")throw Error(Ee(150));return _=D.call(_),S(g,y,_,E)}if(typeof _.then=="function")return x(g,y,zh(_),E);if(_.$$typeof===ps)return x(g,y,Uh(g,_),E);qh(g,_)}return typeof _=="string"&&_!==""||typeof _=="number"||typeof _=="bigint"?(_=""+_,y!==null&&y.tag===6?(n(g,y.sibling),E=a(y,_),E.return=g,g=E):(n(g,y),E=t1(_,g.mode,E),E.return=g,g=E),s(g)):n(g,y)}return function(g,y,_,E){try{td=0;var D=x(g,y,_,E);return Bu=null,D}catch(O){if(O===wc||O===og)throw O;var R=Aa(29,O,null,g.mode);return R.lanes=E,R.return=g,R}finally{}}}var xl=GS(!0),WS=GS(!1),io=!1;function Hy(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function D2(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,callbacks:null})}function Ao(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function No(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,Qt&2){var a=r.pending;return a===null?t.next=t:(t.next=a.next,a.next=t),r.pending=t,t=Zp(e),BS(e,null,n),t}return sg(e,r,t,n),Zp(e)}function Mf(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,(n&4194048)!==0)){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,dS(e,n)}}function a1(e,t){var n=e.updateQueue,r=e.alternate;if(r!==null&&(r=r.updateQueue,n===r)){var a=null,i=null;if(n=n.firstBaseUpdate,n!==null){do{var s={lane:n.lane,tag:n.tag,payload:n.payload,callback:null,next:null};i===null?a=i=s:i=i.next=s,n=n.next}while(n!==null);i===null?a=i=t:i=i.next=t}else a=i=t;n={baseState:r.baseState,firstBaseUpdate:a,lastBaseUpdate:i,shared:r.shared,callbacks:r.callbacks},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}var R2=!1;function kf(){if(R2){var e=Fu;if(e!==null)throw e}}function Pf(e,t,n,r){R2=!1;var a=e.updateQueue;io=!1;var i=a.firstBaseUpdate,s=a.lastBaseUpdate,o=a.shared.pending;if(o!==null){a.shared.pending=null;var l=o,u=l.next;l.next=null,s===null?i=u:s.next=u,s=l;var c=e.alternate;c!==null&&(c=c.updateQueue,o=c.lastBaseUpdate,o!==s&&(o===null?c.firstBaseUpdate=u:o.next=u,c.lastBaseUpdate=l))}if(i!==null){var f=a.baseState;s=0,c=u=l=null,o=i;do{var p=o.lane&-536870913,d=p!==o.lane;if(d?(kt&p)===p:(r&p)===p){p!==0&&p===ac&&(R2=!0),c!==null&&(c=c.next={lane:0,tag:o.tag,payload:o.payload,callback:null,next:null});e:{var v=e,S=o;p=t;var x=n;switch(S.tag){case 1:if(v=S.payload,typeof v=="function"){f=v.call(x,f,p);break e}f=v;break e;case 3:v.flags=v.flags&-65537|128;case 0:if(v=S.payload,p=typeof v=="function"?v.call(x,f,p):v,p==null)break e;f=En({},f,p);break e;case 2:io=!0}}p=o.callback,p!==null&&(e.flags|=64,d&&(e.flags|=8192),d=a.callbacks,d===null?a.callbacks=[p]:d.push(p))}else d={lane:p,tag:o.tag,payload:o.payload,callback:o.callback,next:null},c===null?(u=c=d,l=f):c=c.next=d,s|=p;if(o=o.next,o===null){if(o=a.shared.pending,o===null)break;d=o,o=d.next,d.next=null,a.lastBaseUpdate=d,a.shared.pending=null}}while(!0);c===null&&(l=f),a.baseState=l,a.firstBaseUpdate=u,a.lastBaseUpdate=c,i===null&&(a.shared.lanes=0),Mo|=s,e.lanes=s,e.memoizedState=f}}function JS(e,t){if(typeof e!="function")throw Error(Ee(191,e));e.call(t)}function KS(e,t){var n=e.callbacks;if(n!==null)for(e.callbacks=null,e=0;e<n.length;e++)JS(n[e],t)}var ic=zi(null),rm=zi(0);function fw(e,t){e=Cs,xn(rm,e),xn(ic,t),Cs=e|t.baseLanes}function M2(){xn(rm,Cs),xn(ic,ic.current)}function Vy(){Cs=rm.current,gr(ic),gr(rm)}var Ra=zi(null),ei=null;function uo(e){var t=e.alternate;xn(Yn,Yn.current&1),xn(Ra,e),ei===null&&(t===null||ic.current!==null||t.memoizedState!==null)&&(ei=e)}function k2(e){xn(Yn,Yn.current),xn(Ra,e),ei===null&&(ei=e)}function XS(e){e.tag===22?(xn(Yn,Yn.current),xn(Ra,e),ei===null&&(ei=e)):co()}function co(){xn(Yn,Yn.current),xn(Ra,Ra.current)}function _a(e){gr(Ra),ei===e&&(ei=null),gr(Yn)}var Yn=zi(0);function am(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||ev(n)||tv(n)))return t}else if(t.tag===19&&(t.memoizedProps.revealOrder==="forwards"||t.memoizedProps.revealOrder==="backwards"||t.memoizedProps.revealOrder==="unstable_legacy-backwards"||t.memoizedProps.revealOrder==="together")){if(t.flags&128)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var As=0,Nt=null,un=null,Qn=null,im=!1,$u=!1,Sl=!1,sm=0,nd=0,Uu=null,$L=0;function kn(){throw Error(Ee(321))}function Yy(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!Da(e[n],t[n]))return!1;return!0}function Gy(e,t,n,r,a,i){return As=i,Nt=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,dt.H=e===null||e.memoizedState===null?L_:a5,Sl=!1,i=n(r,a),Sl=!1,$u&&(i=ZS(t,n,r,a)),QS(e),i}function QS(e){dt.H=rd;var t=un!==null&&un.next!==null;if(As=0,Qn=un=Nt=null,im=!1,nd=0,Uu=null,t)throw Error(Ee(300));e===null||nr||(e=e.dependencies,e!==null&&tm(e)&&(nr=!0))}function ZS(e,t,n,r){Nt=e;var a=0;do{if($u&&(Uu=null),nd=0,$u=!1,25<=a)throw Error(Ee(301));if(a+=1,Qn=un=null,e.updateQueue!=null){var i=e.updateQueue;i.lastEffect=null,i.events=null,i.stores=null,i.memoCache!=null&&(i.memoCache.index=0)}dt.H=j_,i=t(n,r)}while($u);return i}function UL(){var e=dt.H,t=e.useState()[0];return t=typeof t.then=="function"?Od(t):t,e=e.useState()[0],(un!==null?un.memoizedState:null)!==e&&(Nt.flags|=1024),t}function Wy(){var e=sm!==0;return sm=0,e}function Jy(e,t,n){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~n}function Ky(e){if(im){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}im=!1}As=0,Qn=un=Nt=null,$u=!1,nd=sm=0,Uu=null}function zr(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Qn===null?Nt.memoizedState=Qn=e:Qn=Qn.next=e,Qn}function Gn(){if(un===null){var e=Nt.alternate;e=e!==null?e.memoizedState:null}else e=un.next;var t=Qn===null?Nt.memoizedState:Qn.next;if(t!==null)Qn=t,un=e;else{if(e===null)throw Nt.alternate===null?Error(Ee(467)):Error(Ee(310));un=e,e={memoizedState:un.memoizedState,baseState:un.baseState,baseQueue:un.baseQueue,queue:un.queue,next:null},Qn===null?Nt.memoizedState=Qn=e:Qn=Qn.next=e}return Qn}function lg(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function Od(e){var t=nd;return nd+=1,Uu===null&&(Uu=[]),e=YS(Uu,e,t),t=Nt,(Qn===null?t.memoizedState:Qn.next)===null&&(t=t.alternate,dt.H=t===null||t.memoizedState===null?L_:a5),e}function ug(e){if(e!==null&&typeof e=="object"){if(typeof e.then=="function")return Od(e);if(e.$$typeof===ps)return Nr(e)}throw Error(Ee(438,String(e)))}function Xy(e){var t=null,n=Nt.updateQueue;if(n!==null&&(t=n.memoCache),t==null){var r=Nt.alternate;r!==null&&(r=r.updateQueue,r!==null&&(r=r.memoCache,r!=null&&(t={data:r.data.map(function(a){return a.slice()}),index:0})))}if(t==null&&(t={data:[],index:0}),n===null&&(n=lg(),Nt.updateQueue=n),n.memoCache=t,n=t.data[t.index],n===void 0)for(n=t.data[t.index]=Array(e),r=0;r<e;r++)n[r]=EC;return t.index++,n}function Ns(e,t){return typeof t=="function"?t(e):t}function Ap(e){var t=Gn();return Qy(t,un,e)}function Qy(e,t,n){var r=e.queue;if(r===null)throw Error(Ee(311));r.lastRenderedReducer=n;var a=e.baseQueue,i=r.pending;if(i!==null){if(a!==null){var s=a.next;a.next=i.next,i.next=s}t.baseQueue=a=i,r.pending=null}if(i=e.baseState,a===null)e.memoizedState=i;else{t=a.next;var o=s=null,l=null,u=t,c=!1;do{var f=u.lane&-536870913;if(f!==u.lane?(kt&f)===f:(As&f)===f){var p=u.revertLane;if(p===0)l!==null&&(l=l.next={lane:0,revertLane:0,gesture:null,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null}),f===ac&&(c=!0);else if((As&p)===p){u=u.next,p===ac&&(c=!0);continue}else f={lane:0,revertLane:u.revertLane,gesture:null,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null},l===null?(o=l=f,s=i):l=l.next=f,Nt.lanes|=p,Mo|=p;f=u.action,Sl&&n(i,f),i=u.hasEagerState?u.eagerState:n(i,f)}else p={lane:f,revertLane:u.revertLane,gesture:u.gesture,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null},l===null?(o=l=p,s=i):l=l.next=p,Nt.lanes|=f,Mo|=f;u=u.next}while(u!==null&&u!==t);if(l===null?s=i:l.next=o,!Da(i,e.memoizedState)&&(nr=!0,c&&(n=Fu,n!==null)))throw n;e.memoizedState=i,e.baseState=s,e.baseQueue=l,r.lastRenderedState=i}return a===null&&(r.lanes=0),[e.memoizedState,r.dispatch]}function i1(e){var t=Gn(),n=t.queue;if(n===null)throw Error(Ee(311));n.lastRenderedReducer=e;var r=n.dispatch,a=n.pending,i=t.memoizedState;if(a!==null){n.pending=null;var s=a=a.next;do i=e(i,s.action),s=s.next;while(s!==a);Da(i,t.memoizedState)||(nr=!0),t.memoizedState=i,t.baseQueue===null&&(t.baseState=i),n.lastRenderedState=i}return[i,r]}function e_(e,t,n){var r=Nt,a=Gn(),i=Bt;if(i){if(n===void 0)throw Error(Ee(407));n=n()}else n=t();var s=!Da((un||a).memoizedState,n);if(s&&(a.memoizedState=n,nr=!0),a=a.queue,Zy(r_.bind(null,r,a,e),[e]),a.getSnapshot!==t||s||Qn!==null&&Qn.memoizedState.tag&1){if(r.flags|=2048,sc(9,{destroy:void 0},n_.bind(null,r,a,n,t),null),dn===null)throw Error(Ee(349));i||As&127||t_(r,t,n)}return n}function t_(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=Nt.updateQueue,t===null?(t=lg(),Nt.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function n_(e,t,n,r){t.value=n,t.getSnapshot=r,a_(t)&&i_(e)}function r_(e,t,n){return n(function(){a_(t)&&i_(e)})}function a_(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!Da(e,n)}catch{return!0}}function i_(e){var t=Ll(e,2);t!==null&&oa(t,e,2)}function P2(e){var t=zr();if(typeof e=="function"){var n=e;if(e=n(),Sl){go(!0);try{n()}finally{go(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ns,lastRenderedState:e},t}function s_(e,t,n,r){return e.baseState=n,Qy(e,un,typeof r=="function"?r:Ns)}function zL(e,t,n,r,a){if(fg(e))throw Error(Ee(485));if(e=t.action,e!==null){var i={payload:a,action:e,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(s){i.listeners.push(s)}};dt.T!==null?n(!0):i.isTransition=!1,r(i),n=t.pending,n===null?(i.next=t.pending=i,o_(t,i)):(i.next=n.next,t.pending=n.next=i)}}function o_(e,t){var n=t.action,r=t.payload,a=e.state;if(t.isTransition){var i=dt.T,s={};dt.T=s;try{var o=n(a,r),l=dt.S;l!==null&&l(s,o),dw(e,t,o)}catch(u){I2(e,t,u)}finally{i!==null&&s.types!==null&&(i.types=s.types),dt.T=i}}else try{i=n(a,r),dw(e,t,i)}catch(u){I2(e,t,u)}}function dw(e,t,n){n!==null&&typeof n=="object"&&typeof n.then=="function"?n.then(function(r){hw(e,t,r)},function(r){return I2(e,t,r)}):hw(e,t,n)}function hw(e,t,n){t.status="fulfilled",t.value=n,l_(t),e.state=n,t=e.pending,t!==null&&(n=t.next,n===t?e.pending=null:(n=n.next,t.next=n,o_(e,n)))}function I2(e,t,n){var r=e.pending;if(e.pending=null,r!==null){r=r.next;do t.status="rejected",t.reason=n,l_(t),t=t.next;while(t!==r)}e.action=null}function l_(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function u_(e,t){return t}function pw(e,t){if(Bt){var n=dn.formState;if(n!==null){e:{var r=Nt;if(Bt){if(_n){t:{for(var a=_n,i=Za;a.nodeType!==8;){if(!i){a=null;break t}if(a=ti(a.nextSibling),a===null){a=null;break t}}i=a.data,a=i==="F!"||i==="F"?a:null}if(a){_n=ti(a.nextSibling),r=a.data==="F!";break e}}Do(r)}r=!1}r&&(t=n[0])}}return n=zr(),n.memoizedState=n.baseState=t,r={pending:null,lanes:0,dispatch:null,lastRenderedReducer:u_,lastRenderedState:t},n.queue=r,n=N_.bind(null,Nt,r),r.dispatch=n,r=P2(!1),i=r5.bind(null,Nt,!1,r.queue),r=zr(),a={state:t,dispatch:null,action:e,pending:null},r.queue=a,n=zL.bind(null,Nt,a,i,n),a.dispatch=n,r.memoizedState=e,[t,n,!1]}function mw(e){var t=Gn();return c_(t,un,e)}function c_(e,t,n){if(t=Qy(e,t,u_)[0],e=Ap(Ns)[0],typeof t=="object"&&t!==null&&typeof t.then=="function")try{var r=Od(t)}catch(s){throw s===wc?og:s}else r=t;t=Gn();var a=t.queue,i=a.dispatch;return n!==t.memoizedState&&(Nt.flags|=2048,sc(9,{destroy:void 0},qL.bind(null,a,n),null)),[r,i,e]}function qL(e,t){e.action=t}function gw(e){var t=Gn(),n=un;if(n!==null)return c_(t,n,e);Gn(),t=t.memoizedState,n=Gn();var r=n.queue.dispatch;return n.memoizedState=e,[t,r,!1]}function sc(e,t,n,r){return e={tag:e,create:n,deps:r,inst:t,next:null},t=Nt.updateQueue,t===null&&(t=lg(),Nt.updateQueue=t),n=t.lastEffect,n===null?t.lastEffect=e.next=e:(r=n.next,n.next=e,e.next=r,t.lastEffect=e),e}function f_(){return Gn().memoizedState}function Np(e,t,n,r){var a=zr();Nt.flags|=e,a.memoizedState=sc(1|t,{destroy:void 0},n,r===void 0?null:r)}function cg(e,t,n,r){var a=Gn();r=r===void 0?null:r;var i=a.memoizedState.inst;un!==null&&r!==null&&Yy(r,un.memoizedState.deps)?a.memoizedState=sc(t,i,n,r):(Nt.flags|=e,a.memoizedState=sc(1|t,i,n,r))}function vw(e,t){Np(8390656,8,e,t)}function Zy(e,t){cg(2048,8,e,t)}function HL(e){Nt.flags|=4;var t=Nt.updateQueue;if(t===null)t=lg(),Nt.updateQueue=t,t.events=[e];else{var n=t.events;n===null?t.events=[e]:n.push(e)}}function d_(e){var t=Gn().memoizedState;return HL({ref:t,nextImpl:e}),function(){if(Qt&2)throw Error(Ee(440));return t.impl.apply(void 0,arguments)}}function h_(e,t){return cg(4,2,e,t)}function p_(e,t){return cg(4,4,e,t)}function m_(e,t){if(typeof t=="function"){e=e();var n=t(e);return function(){typeof n=="function"?n():t(null)}}if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function g_(e,t,n){n=n!=null?n.concat([e]):null,cg(4,4,m_.bind(null,t,e),n)}function e5(){}function v_(e,t){var n=Gn();t=t===void 0?null:t;var r=n.memoizedState;return t!==null&&Yy(t,r[1])?r[0]:(n.memoizedState=[e,t],e)}function y_(e,t){var n=Gn();t=t===void 0?null:t;var r=n.memoizedState;if(t!==null&&Yy(t,r[1]))return r[0];if(r=e(),Sl){go(!0);try{e()}finally{go(!1)}}return n.memoizedState=[r,t],r}function t5(e,t,n){return n===void 0||As&1073741824&&!(kt&261930)?e.memoizedState=t:(e.memoizedState=n,e=s6(),Nt.lanes|=e,Mo|=e,n)}function b_(e,t,n,r){return Da(n,t)?n:ic.current!==null?(e=t5(e,n,r),Da(e,t)||(nr=!0),e):!(As&42)||As&1073741824&&!(kt&261930)?(nr=!0,e.memoizedState=n):(e=s6(),Nt.lanes|=e,Mo|=e,t)}function w_(e,t,n,r,a){var i=Zt.p;Zt.p=i!==0&&8>i?i:8;var s=dt.T,o={};dt.T=o,r5(e,!1,t,n);try{var l=a(),u=dt.S;if(u!==null&&u(o,l),l!==null&&typeof l=="object"&&typeof l.then=="function"){var c=BL(l,r);If(e,t,c,Ta(e))}else If(e,t,r,Ta(e))}catch(f){If(e,t,{then:function(){},status:"rejected",reason:f},Ta())}finally{Zt.p=i,s!==null&&o.types!==null&&(s.types=o.types),dt.T=s}}function VL(){}function F2(e,t,n,r){if(e.tag!==5)throw Error(Ee(476));var a=x_(e).queue;w_(e,a,t,ul,n===null?VL:function(){return S_(e),n(r)})}function x_(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:ul,baseState:ul,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ns,lastRenderedState:ul},next:null};var n={};return t.next={memoizedState:n,baseState:n,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ns,lastRenderedState:n},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function S_(e){var t=x_(e);t.next===null&&(t=e.alternate.memoizedState),If(e,t.next.queue,{},Ta())}function n5(){return Nr(sd)}function __(){return Gn().memoizedState}function A_(){return Gn().memoizedState}function YL(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var n=Ta();e=Ao(n);var r=No(t,e,n);r!==null&&(oa(r,t,n),Mf(r,t,n)),t={cache:Uy()},e.payload=t;return}t=t.return}}function GL(e,t,n){var r=Ta();n={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null},fg(e)?E_(t,n):(n=Iy(e,t,n,r),n!==null&&(oa(n,e,r),C_(n,t,r)))}function N_(e,t,n){var r=Ta();If(e,t,n,r)}function If(e,t,n,r){var a={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null};if(fg(e))E_(t,a);else{var i=e.alternate;if(e.lanes===0&&(i===null||i.lanes===0)&&(i=t.lastRenderedReducer,i!==null))try{var s=t.lastRenderedState,o=i(s,n);if(a.hasEagerState=!0,a.eagerState=o,Da(o,s))return sg(e,t,a,0),dn===null&&ig(),!1}catch{}finally{}if(n=Iy(e,t,a,r),n!==null)return oa(n,e,r),C_(n,t,r),!0}return!1}function r5(e,t,n,r){if(r={lane:2,revertLane:d5(),gesture:null,action:r,hasEagerState:!1,eagerState:null,next:null},fg(e)){if(t)throw Error(Ee(479))}else t=Iy(e,n,r,2),t!==null&&oa(t,e,2)}function fg(e){var t=e.alternate;return e===Nt||t!==null&&t===Nt}function E_(e,t){$u=im=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function C_(e,t,n){if(n&4194048){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,dS(e,n)}}var rd={readContext:Nr,use:ug,useCallback:kn,useContext:kn,useEffect:kn,useImperativeHandle:kn,useLayoutEffect:kn,useInsertionEffect:kn,useMemo:kn,useReducer:kn,useRef:kn,useState:kn,useDebugValue:kn,useDeferredValue:kn,useTransition:kn,useSyncExternalStore:kn,useId:kn,useHostTransitionStatus:kn,useFormState:kn,useActionState:kn,useOptimistic:kn,useMemoCache:kn,useCacheRefresh:kn};rd.useEffectEvent=kn;var L_={readContext:Nr,use:ug,useCallback:function(e,t){return zr().memoizedState=[e,t===void 0?null:t],e},useContext:Nr,useEffect:vw,useImperativeHandle:function(e,t,n){n=n!=null?n.concat([e]):null,Np(4194308,4,m_.bind(null,t,e),n)},useLayoutEffect:function(e,t){return Np(4194308,4,e,t)},useInsertionEffect:function(e,t){Np(4,2,e,t)},useMemo:function(e,t){var n=zr();t=t===void 0?null:t;var r=e();if(Sl){go(!0);try{e()}finally{go(!1)}}return n.memoizedState=[r,t],r},useReducer:function(e,t,n){var r=zr();if(n!==void 0){var a=n(t);if(Sl){go(!0);try{n(t)}finally{go(!1)}}}else a=t;return r.memoizedState=r.baseState=a,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:a},r.queue=e,e=e.dispatch=GL.bind(null,Nt,e),[r.memoizedState,e]},useRef:function(e){var t=zr();return e={current:e},t.memoizedState=e},useState:function(e){e=P2(e);var t=e.queue,n=N_.bind(null,Nt,t);return t.dispatch=n,[e.memoizedState,n]},useDebugValue:e5,useDeferredValue:function(e,t){var n=zr();return t5(n,e,t)},useTransition:function(){var e=P2(!1);return e=w_.bind(null,Nt,e.queue,!0,!1),zr().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,n){var r=Nt,a=zr();if(Bt){if(n===void 0)throw Error(Ee(407));n=n()}else{if(n=t(),dn===null)throw Error(Ee(349));kt&127||t_(r,t,n)}a.memoizedState=n;var i={value:n,getSnapshot:t};return a.queue=i,vw(r_.bind(null,r,i,e),[e]),r.flags|=2048,sc(9,{destroy:void 0},n_.bind(null,r,i,n,t),null),n},useId:function(){var e=zr(),t=dn.identifierPrefix;if(Bt){var n=Mi,r=Ri;n=(r&~(1<<32-ja(r)-1)).toString(32)+n,t="_"+t+"R_"+n,n=sm++,0<n&&(t+="H"+n.toString(32)),t+="_"}else n=$L++,t="_"+t+"r_"+n.toString(32)+"_";return e.memoizedState=t},useHostTransitionStatus:n5,useFormState:pw,useActionState:pw,useOptimistic:function(e){var t=zr();t.memoizedState=t.baseState=e;var n={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=n,t=r5.bind(null,Nt,!0,n),n.dispatch=t,[e,t]},useMemoCache:Xy,useCacheRefresh:function(){return zr().memoizedState=YL.bind(null,Nt)},useEffectEvent:function(e){var t=zr(),n={impl:e};return t.memoizedState=n,function(){if(Qt&2)throw Error(Ee(440));return n.impl.apply(void 0,arguments)}}},a5={readContext:Nr,use:ug,useCallback:v_,useContext:Nr,useEffect:Zy,useImperativeHandle:g_,useInsertionEffect:h_,useLayoutEffect:p_,useMemo:y_,useReducer:Ap,useRef:f_,useState:function(){return Ap(Ns)},useDebugValue:e5,useDeferredValue:function(e,t){var n=Gn();return b_(n,un.memoizedState,e,t)},useTransition:function(){var e=Ap(Ns)[0],t=Gn().memoizedState;return[typeof e=="boolean"?e:Od(e),t]},useSyncExternalStore:e_,useId:__,useHostTransitionStatus:n5,useFormState:mw,useActionState:mw,useOptimistic:function(e,t){var n=Gn();return s_(n,un,e,t)},useMemoCache:Xy,useCacheRefresh:A_};a5.useEffectEvent=d_;var j_={readContext:Nr,use:ug,useCallback:v_,useContext:Nr,useEffect:Zy,useImperativeHandle:g_,useInsertionEffect:h_,useLayoutEffect:p_,useMemo:y_,useReducer:i1,useRef:f_,useState:function(){return i1(Ns)},useDebugValue:e5,useDeferredValue:function(e,t){var n=Gn();return un===null?t5(n,e,t):b_(n,un.memoizedState,e,t)},useTransition:function(){var e=i1(Ns)[0],t=Gn().memoizedState;return[typeof e=="boolean"?e:Od(e),t]},useSyncExternalStore:e_,useId:__,useHostTransitionStatus:n5,useFormState:gw,useActionState:gw,useOptimistic:function(e,t){var n=Gn();return un!==null?s_(n,un,e,t):(n.baseState=e,[e,n.queue.dispatch])},useMemoCache:Xy,useCacheRefresh:A_};j_.useEffectEvent=d_;function s1(e,t,n,r){t=e.memoizedState,n=n(r,t),n=n==null?t:En({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var B2={enqueueSetState:function(e,t,n){e=e._reactInternals;var r=Ta(),a=Ao(r);a.payload=t,n!=null&&(a.callback=n),t=No(e,a,r),t!==null&&(oa(t,e,r),Mf(t,e,r))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var r=Ta(),a=Ao(r);a.tag=1,a.payload=t,n!=null&&(a.callback=n),t=No(e,a,r),t!==null&&(oa(t,e,r),Mf(t,e,r))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=Ta(),r=Ao(n);r.tag=2,t!=null&&(r.callback=t),t=No(e,r,n),t!==null&&(oa(t,e,n),Mf(t,e,n))}};function yw(e,t,n,r,a,i,s){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(r,i,s):t.prototype&&t.prototype.isPureReactComponent?!Qf(n,r)||!Qf(a,i):!0}function bw(e,t,n,r){e=t.state,typeof t.componentWillReceiveProps=="function"&&t.componentWillReceiveProps(n,r),typeof t.UNSAFE_componentWillReceiveProps=="function"&&t.UNSAFE_componentWillReceiveProps(n,r),t.state!==e&&B2.enqueueReplaceState(t,t.state,null)}function _l(e,t){var n=t;if("ref"in t){n={};for(var r in t)r!=="ref"&&(n[r]=t[r])}if(e=e.defaultProps){n===t&&(n=En({},n));for(var a in e)n[a]===void 0&&(n[a]=e[a])}return n}function T_(e){Qp(e)}function O_(e){console.error(e)}function D_(e){Qp(e)}function om(e,t){try{var n=e.onUncaughtError;n(t.value,{componentStack:t.stack})}catch(r){setTimeout(function(){throw r})}}function ww(e,t,n){try{var r=e.onCaughtError;r(n.value,{componentStack:n.stack,errorBoundary:t.tag===1?t.stateNode:null})}catch(a){setTimeout(function(){throw a})}}function $2(e,t,n){return n=Ao(n),n.tag=3,n.payload={element:null},n.callback=function(){om(e,t)},n}function R_(e){return e=Ao(e),e.tag=3,e}function M_(e,t,n,r){var a=n.type.getDerivedStateFromError;if(typeof a=="function"){var i=r.value;e.payload=function(){return a(i)},e.callback=function(){ww(t,n,r)}}var s=n.stateNode;s!==null&&typeof s.componentDidCatch=="function"&&(e.callback=function(){ww(t,n,r),typeof a!="function"&&(Eo===null?Eo=new Set([this]):Eo.add(this));var o=r.stack;this.componentDidCatch(r.value,{componentStack:o!==null?o:""})})}function WL(e,t,n,r,a){if(n.flags|=32768,r!==null&&typeof r=="object"&&typeof r.then=="function"){if(t=n.alternate,t!==null&&bc(t,n,a,!0),n=Ra.current,n!==null){switch(n.tag){case 31:case 13:return ei===null?dm():n.alternate===null&&In===0&&(In=3),n.flags&=-257,n.flags|=65536,n.lanes=a,r===nm?n.flags|=16384:(t=n.updateQueue,t===null?n.updateQueue=new Set([r]):t.add(r),v1(e,r,a)),!1;case 22:return n.flags|=65536,r===nm?n.flags|=16384:(t=n.updateQueue,t===null?(t={transitions:null,markerInstances:null,retryQueue:new Set([r])},n.updateQueue=t):(n=t.retryQueue,n===null?t.retryQueue=new Set([r]):n.add(r)),v1(e,r,a)),!1}throw Error(Ee(435,n.tag))}return v1(e,r,a),dm(),!1}if(Bt)return t=Ra.current,t!==null?(!(t.flags&65536)&&(t.flags|=256),t.flags|=65536,t.lanes=a,r!==C2&&(e=Error(Ee(422),{cause:r}),ed(Qa(e,n)))):(r!==C2&&(t=Error(Ee(423),{cause:r}),ed(Qa(t,n))),e=e.current.alternate,e.flags|=65536,a&=-a,e.lanes|=a,r=Qa(r,n),a=$2(e.stateNode,r,a),a1(e,a),In!==4&&(In=2)),!1;var i=Error(Ee(520),{cause:r});if(i=Qa(i,n),$f===null?$f=[i]:$f.push(i),In!==4&&(In=2),t===null)return!0;r=Qa(r,n),n=t;do{switch(n.tag){case 3:return n.flags|=65536,e=a&-a,n.lanes|=e,e=$2(n.stateNode,r,e),a1(n,e),!1;case 1:if(t=n.type,i=n.stateNode,(n.flags&128)===0&&(typeof t.getDerivedStateFromError=="function"||i!==null&&typeof i.componentDidCatch=="function"&&(Eo===null||!Eo.has(i))))return n.flags|=65536,a&=-a,n.lanes|=a,a=R_(a),M_(a,e,n,r),a1(n,a),!1}n=n.return}while(n!==null);return!1}var i5=Error(Ee(461)),nr=!1;function xr(e,t,n,r){t.child=e===null?WS(t,null,n,r):xl(t,e.child,n,r)}function xw(e,t,n,r,a){n=n.render;var i=t.ref;if("ref"in r){var s={};for(var o in r)o!=="ref"&&(s[o]=r[o])}else s=r;return wl(t),r=Gy(e,t,n,s,i,a),o=Wy(),e!==null&&!nr?(Jy(e,t,a),Es(e,t,a)):(Bt&&o&&By(t),t.flags|=1,xr(e,t,r,a),t.child)}function Sw(e,t,n,r,a){if(e===null){var i=n.type;return typeof i=="function"&&!Fy(i)&&i.defaultProps===void 0&&n.compare===null?(t.tag=15,t.type=i,k_(e,t,i,r,a)):(e=Sp(n.type,null,r,t,t.mode,a),e.ref=t.ref,e.return=t,t.child=e)}if(i=e.child,!s5(e,a)){var s=i.memoizedProps;if(n=n.compare,n=n!==null?n:Qf,n(s,r)&&e.ref===t.ref)return Es(e,t,a)}return t.flags|=1,e=ys(i,r),e.ref=t.ref,e.return=t,t.child=e}function k_(e,t,n,r,a){if(e!==null){var i=e.memoizedProps;if(Qf(i,r)&&e.ref===t.ref)if(nr=!1,t.pendingProps=r=i,s5(e,a))e.flags&131072&&(nr=!0);else return t.lanes=e.lanes,Es(e,t,a)}return U2(e,t,n,r,a)}function P_(e,t,n,r){var a=r.children,i=e!==null?e.memoizedState:null;if(e===null&&t.stateNode===null&&(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),r.mode==="hidden"){if(t.flags&128){if(i=i!==null?i.baseLanes|n:n,e!==null){for(r=t.child=e.child,a=0;r!==null;)a=a|r.lanes|r.childLanes,r=r.sibling;r=a&~i}else r=0,t.child=null;return _w(e,t,i,n,r)}if(n&536870912)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&_p(t,i!==null?i.cachePool:null),i!==null?fw(t,i):M2(),XS(t);else return r=t.lanes=536870912,_w(e,t,i!==null?i.baseLanes|n:n,n,r)}else i!==null?(_p(t,i.cachePool),fw(t,i),co(),t.memoizedState=null):(e!==null&&_p(t,null),M2(),co());return xr(e,t,a,n),t.child}function Af(e,t){return e!==null&&e.tag===22||t.stateNode!==null||(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),t.sibling}function _w(e,t,n,r,a){var i=zy();return i=i===null?null:{parent:er._currentValue,pool:i},t.memoizedState={baseLanes:n,cachePool:i},e!==null&&_p(t,null),M2(),XS(t),e!==null&&bc(e,t,r,!0),t.childLanes=a,null}function Ep(e,t){return t=lm({mode:t.mode,children:t.children},e.mode),t.ref=e.ref,e.child=t,t.return=e,t}function Aw(e,t,n){return xl(t,e.child,null,n),e=Ep(t,t.pendingProps),e.flags|=2,_a(t),t.memoizedState=null,e}function JL(e,t,n){var r=t.pendingProps,a=(t.flags&128)!==0;if(t.flags&=-129,e===null){if(Bt){if(r.mode==="hidden")return e=Ep(t,r),t.lanes=536870912,Af(null,e);if(k2(t),(e=_n)?(e=L6(e,Za),e=e!==null&&e.data==="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:Oo!==null?{id:Ri,overflow:Mi}:null,retryLane:536870912,hydrationErrors:null},n=US(e),n.return=t,t.child=n,Ar=t,_n=null)):e=null,e===null)throw Do(t);return t.lanes=536870912,null}return Ep(t,r)}var i=e.memoizedState;if(i!==null){var s=i.dehydrated;if(k2(t),a)if(t.flags&256)t.flags&=-257,t=Aw(e,t,n);else if(t.memoizedState!==null)t.child=e.child,t.flags|=128,t=null;else throw Error(Ee(558));else if(nr||bc(e,t,n,!1),a=(n&e.childLanes)!==0,nr||a){if(r=dn,r!==null&&(s=hS(r,n),s!==0&&s!==i.retryLane))throw i.retryLane=s,Ll(e,s),oa(r,e,s),i5;dm(),t=Aw(e,t,n)}else e=i.treeContext,_n=ti(s.nextSibling),Ar=t,Bt=!0,_o=null,Za=!1,e!==null&&qS(t,e),t=Ep(t,r),t.flags|=4096;return t}return e=ys(e.child,{mode:r.mode,children:r.children}),e.ref=t.ref,t.child=e,e.return=t,e}function Cp(e,t){var n=t.ref;if(n===null)e!==null&&e.ref!==null&&(t.flags|=4194816);else{if(typeof n!="function"&&typeof n!="object")throw Error(Ee(284));(e===null||e.ref!==n)&&(t.flags|=4194816)}}function U2(e,t,n,r,a){return wl(t),n=Gy(e,t,n,r,void 0,a),r=Wy(),e!==null&&!nr?(Jy(e,t,a),Es(e,t,a)):(Bt&&r&&By(t),t.flags|=1,xr(e,t,n,a),t.child)}function Nw(e,t,n,r,a,i){return wl(t),t.updateQueue=null,n=ZS(t,r,n,a),QS(e),r=Wy(),e!==null&&!nr?(Jy(e,t,i),Es(e,t,i)):(Bt&&r&&By(t),t.flags|=1,xr(e,t,n,i),t.child)}function Ew(e,t,n,r,a){if(wl(t),t.stateNode===null){var i=Tu,s=n.contextType;typeof s=="object"&&s!==null&&(i=Nr(s)),i=new n(r,i),t.memoizedState=i.state!==null&&i.state!==void 0?i.state:null,i.updater=B2,t.stateNode=i,i._reactInternals=t,i=t.stateNode,i.props=r,i.state=t.memoizedState,i.refs={},Hy(t),s=n.contextType,i.context=typeof s=="object"&&s!==null?Nr(s):Tu,i.state=t.memoizedState,s=n.getDerivedStateFromProps,typeof s=="function"&&(s1(t,n,s,r),i.state=t.memoizedState),typeof n.getDerivedStateFromProps=="function"||typeof i.getSnapshotBeforeUpdate=="function"||typeof i.UNSAFE_componentWillMount!="function"&&typeof i.componentWillMount!="function"||(s=i.state,typeof i.componentWillMount=="function"&&i.componentWillMount(),typeof i.UNSAFE_componentWillMount=="function"&&i.UNSAFE_componentWillMount(),s!==i.state&&B2.enqueueReplaceState(i,i.state,null),Pf(t,r,i,a),kf(),i.state=t.memoizedState),typeof i.componentDidMount=="function"&&(t.flags|=4194308),r=!0}else if(e===null){i=t.stateNode;var o=t.memoizedProps,l=_l(n,o);i.props=l;var u=i.context,c=n.contextType;s=Tu,typeof c=="object"&&c!==null&&(s=Nr(c));var f=n.getDerivedStateFromProps;c=typeof f=="function"||typeof i.getSnapshotBeforeUpdate=="function",o=t.pendingProps!==o,c||typeof i.UNSAFE_componentWillReceiveProps!="function"&&typeof i.componentWillReceiveProps!="function"||(o||u!==s)&&bw(t,i,r,s),io=!1;var p=t.memoizedState;i.state=p,Pf(t,r,i,a),kf(),u=t.memoizedState,o||p!==u||io?(typeof f=="function"&&(s1(t,n,f,r),u=t.memoizedState),(l=io||yw(t,n,l,r,p,u,s))?(c||typeof i.UNSAFE_componentWillMount!="function"&&typeof i.componentWillMount!="function"||(typeof i.componentWillMount=="function"&&i.componentWillMount(),typeof i.UNSAFE_componentWillMount=="function"&&i.UNSAFE_componentWillMount()),typeof i.componentDidMount=="function"&&(t.flags|=4194308)):(typeof i.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=r,t.memoizedState=u),i.props=r,i.state=u,i.context=s,r=l):(typeof i.componentDidMount=="function"&&(t.flags|=4194308),r=!1)}else{i=t.stateNode,D2(e,t),s=t.memoizedProps,c=_l(n,s),i.props=c,f=t.pendingProps,p=i.context,u=n.contextType,l=Tu,typeof u=="object"&&u!==null&&(l=Nr(u)),o=n.getDerivedStateFromProps,(u=typeof o=="function"||typeof i.getSnapshotBeforeUpdate=="function")||typeof i.UNSAFE_componentWillReceiveProps!="function"&&typeof i.componentWillReceiveProps!="function"||(s!==f||p!==l)&&bw(t,i,r,l),io=!1,p=t.memoizedState,i.state=p,Pf(t,r,i,a),kf();var d=t.memoizedState;s!==f||p!==d||io||e!==null&&e.dependencies!==null&&tm(e.dependencies)?(typeof o=="function"&&(s1(t,n,o,r),d=t.memoizedState),(c=io||yw(t,n,c,r,p,d,l)||e!==null&&e.dependencies!==null&&tm(e.dependencies))?(u||typeof i.UNSAFE_componentWillUpdate!="function"&&typeof i.componentWillUpdate!="function"||(typeof i.componentWillUpdate=="function"&&i.componentWillUpdate(r,d,l),typeof i.UNSAFE_componentWillUpdate=="function"&&i.UNSAFE_componentWillUpdate(r,d,l)),typeof i.componentDidUpdate=="function"&&(t.flags|=4),typeof i.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof i.componentDidUpdate!="function"||s===e.memoizedProps&&p===e.memoizedState||(t.flags|=4),typeof i.getSnapshotBeforeUpdate!="function"||s===e.memoizedProps&&p===e.memoizedState||(t.flags|=1024),t.memoizedProps=r,t.memoizedState=d),i.props=r,i.state=d,i.context=l,r=c):(typeof i.componentDidUpdate!="function"||s===e.memoizedProps&&p===e.memoizedState||(t.flags|=4),typeof i.getSnapshotBeforeUpdate!="function"||s===e.memoizedProps&&p===e.memoizedState||(t.flags|=1024),r=!1)}return i=r,Cp(e,t),r=(t.flags&128)!==0,i||r?(i=t.stateNode,n=r&&typeof n.getDerivedStateFromError!="function"?null:i.render(),t.flags|=1,e!==null&&r?(t.child=xl(t,e.child,null,a),t.child=xl(t,null,n,a)):xr(e,t,n,a),t.memoizedState=i.state,e=t.child):e=Es(e,t,a),e}function Cw(e,t,n,r){return bl(),t.flags|=256,xr(e,t,n,r),t.child}var o1={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function l1(e){return{baseLanes:e,cachePool:VS()}}function u1(e,t,n){return e=e!==null?e.childLanes&~n:0,t&&(e|=Na),e}function I_(e,t,n){var r=t.pendingProps,a=!1,i=(t.flags&128)!==0,s;if((s=i)||(s=e!==null&&e.memoizedState===null?!1:(Yn.current&2)!==0),s&&(a=!0,t.flags&=-129),s=(t.flags&32)!==0,t.flags&=-33,e===null){if(Bt){if(a?uo(t):co(),(e=_n)?(e=L6(e,Za),e=e!==null&&e.data!=="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:Oo!==null?{id:Ri,overflow:Mi}:null,retryLane:536870912,hydrationErrors:null},n=US(e),n.return=t,t.child=n,Ar=t,_n=null)):e=null,e===null)throw Do(t);return tv(e)?t.lanes=32:t.lanes=536870912,null}var o=r.children;return r=r.fallback,a?(co(),a=t.mode,o=lm({mode:"hidden",children:o},a),r=cl(r,a,n,null),o.return=t,r.return=t,o.sibling=r,t.child=o,r=t.child,r.memoizedState=l1(n),r.childLanes=u1(e,s,n),t.memoizedState=o1,Af(null,r)):(uo(t),z2(t,o))}var l=e.memoizedState;if(l!==null&&(o=l.dehydrated,o!==null)){if(i)t.flags&256?(uo(t),t.flags&=-257,t=c1(e,t,n)):t.memoizedState!==null?(co(),t.child=e.child,t.flags|=128,t=null):(co(),o=r.fallback,a=t.mode,r=lm({mode:"visible",children:r.children},a),o=cl(o,a,n,null),o.flags|=2,r.return=t,o.return=t,r.sibling=o,t.child=r,xl(t,e.child,null,n),r=t.child,r.memoizedState=l1(n),r.childLanes=u1(e,s,n),t.memoizedState=o1,t=Af(null,r));else if(uo(t),tv(o)){if(s=o.nextSibling&&o.nextSibling.dataset,s)var u=s.dgst;s=u,r=Error(Ee(419)),r.stack="",r.digest=s,ed({value:r,source:null,stack:null}),t=c1(e,t,n)}else if(nr||bc(e,t,n,!1),s=(n&e.childLanes)!==0,nr||s){if(s=dn,s!==null&&(r=hS(s,n),r!==0&&r!==l.retryLane))throw l.retryLane=r,Ll(e,r),oa(s,e,r),i5;ev(o)||dm(),t=c1(e,t,n)}else ev(o)?(t.flags|=192,t.child=e.child,t=null):(e=l.treeContext,_n=ti(o.nextSibling),Ar=t,Bt=!0,_o=null,Za=!1,e!==null&&qS(t,e),t=z2(t,r.children),t.flags|=4096);return t}return a?(co(),o=r.fallback,a=t.mode,l=e.child,u=l.sibling,r=ys(l,{mode:"hidden",children:r.children}),r.subtreeFlags=l.subtreeFlags&65011712,u!==null?o=ys(u,o):(o=cl(o,a,n,null),o.flags|=2),o.return=t,r.return=t,r.sibling=o,t.child=r,Af(null,r),r=t.child,o=e.child.memoizedState,o===null?o=l1(n):(a=o.cachePool,a!==null?(l=er._currentValue,a=a.parent!==l?{parent:l,pool:l}:a):a=VS(),o={baseLanes:o.baseLanes|n,cachePool:a}),r.memoizedState=o,r.childLanes=u1(e,s,n),t.memoizedState=o1,Af(e.child,r)):(uo(t),n=e.child,e=n.sibling,n=ys(n,{mode:"visible",children:r.children}),n.return=t,n.sibling=null,e!==null&&(s=t.deletions,s===null?(t.deletions=[e],t.flags|=16):s.push(e)),t.child=n,t.memoizedState=null,n)}function z2(e,t){return t=lm({mode:"visible",children:t},e.mode),t.return=e,e.child=t}function lm(e,t){return e=Aa(22,e,null,t),e.lanes=0,e}function c1(e,t,n){return xl(t,e.child,null,n),e=z2(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function Lw(e,t,n){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),j2(e.return,t,n)}function f1(e,t,n,r,a,i){var s=e.memoizedState;s===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:r,tail:n,tailMode:a,treeForkCount:i}:(s.isBackwards=t,s.rendering=null,s.renderingStartTime=0,s.last=r,s.tail=n,s.tailMode=a,s.treeForkCount=i)}function F_(e,t,n){var r=t.pendingProps,a=r.revealOrder,i=r.tail;r=r.children;var s=Yn.current,o=(s&2)!==0;if(o?(s=s&1|2,t.flags|=128):s&=1,xn(Yn,s),xr(e,t,r,n),r=Bt?Zf:0,!o&&e!==null&&e.flags&128)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&Lw(e,n,t);else if(e.tag===19)Lw(e,n,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break e;for(;e.sibling===null;){if(e.return===null||e.return===t)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}switch(a){case"forwards":for(n=t.child,a=null;n!==null;)e=n.alternate,e!==null&&am(e)===null&&(a=n),n=n.sibling;n=a,n===null?(a=t.child,t.child=null):(a=n.sibling,n.sibling=null),f1(t,!1,a,n,i,r);break;case"backwards":case"unstable_legacy-backwards":for(n=null,a=t.child,t.child=null;a!==null;){if(e=a.alternate,e!==null&&am(e)===null){t.child=a;break}e=a.sibling,a.sibling=n,n=a,a=e}f1(t,!0,n,null,i,r);break;case"together":f1(t,!1,null,null,void 0,r);break;default:t.memoizedState=null}return t.child}function Es(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),Mo|=t.lanes,!(n&t.childLanes))if(e!==null){if(bc(e,t,n,!1),(n&t.childLanes)===0)return null}else return null;if(e!==null&&t.child!==e.child)throw Error(Ee(153));if(t.child!==null){for(e=t.child,n=ys(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=ys(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function s5(e,t){return e.lanes&t?!0:(e=e.dependencies,!!(e!==null&&tm(e)))}function KL(e,t,n){switch(t.tag){case 3:Wp(t,t.stateNode.containerInfo),lo(t,er,e.memoizedState.cache),bl();break;case 27:case 5:g2(t);break;case 4:Wp(t,t.stateNode.containerInfo);break;case 10:lo(t,t.type,t.memoizedProps.value);break;case 31:if(t.memoizedState!==null)return t.flags|=128,k2(t),null;break;case 13:var r=t.memoizedState;if(r!==null)return r.dehydrated!==null?(uo(t),t.flags|=128,null):n&t.child.childLanes?I_(e,t,n):(uo(t),e=Es(e,t,n),e!==null?e.sibling:null);uo(t);break;case 19:var a=(e.flags&128)!==0;if(r=(n&t.childLanes)!==0,r||(bc(e,t,n,!1),r=(n&t.childLanes)!==0),a){if(r)return F_(e,t,n);t.flags|=128}if(a=t.memoizedState,a!==null&&(a.rendering=null,a.tail=null,a.lastEffect=null),xn(Yn,Yn.current),r)break;return null;case 22:return t.lanes=0,P_(e,t,n,t.pendingProps);case 24:lo(t,er,e.memoizedState.cache)}return Es(e,t,n)}function B_(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps)nr=!0;else{if(!s5(e,n)&&!(t.flags&128))return nr=!1,KL(e,t,n);nr=!!(e.flags&131072)}else nr=!1,Bt&&t.flags&1048576&&zS(t,Zf,t.index);switch(t.lanes=0,t.tag){case 16:e:{var r=t.pendingProps;if(e=nl(t.elementType),t.type=e,typeof e=="function")Fy(e)?(r=_l(e,r),t.tag=1,t=Ew(null,t,e,r,n)):(t.tag=0,t=U2(null,t,e,r,n));else{if(e!=null){var a=e.$$typeof;if(a===Ay){t.tag=11,t=xw(null,t,e,r,n);break e}else if(a===Ny){t.tag=14,t=Sw(null,t,e,r,n);break e}}throw t=p2(e)||e,Error(Ee(306,t,""))}}return t;case 0:return U2(e,t,t.type,t.pendingProps,n);case 1:return r=t.type,a=_l(r,t.pendingProps),Ew(e,t,r,a,n);case 3:e:{if(Wp(t,t.stateNode.containerInfo),e===null)throw Error(Ee(387));r=t.pendingProps;var i=t.memoizedState;a=i.element,D2(e,t),Pf(t,r,null,n);var s=t.memoizedState;if(r=s.cache,lo(t,er,r),r!==i.cache&&T2(t,[er],n,!0),kf(),r=s.element,i.isDehydrated)if(i={element:r,isDehydrated:!1,cache:s.cache},t.updateQueue.baseState=i,t.memoizedState=i,t.flags&256){t=Cw(e,t,r,n);break e}else if(r!==a){a=Qa(Error(Ee(424)),t),ed(a),t=Cw(e,t,r,n);break e}else{switch(e=t.stateNode.containerInfo,e.nodeType){case 9:e=e.body;break;default:e=e.nodeName==="HTML"?e.ownerDocument.body:e}for(_n=ti(e.firstChild),Ar=t,Bt=!0,_o=null,Za=!0,n=WS(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling}else{if(bl(),r===a){t=Es(e,t,n);break e}xr(e,t,r,n)}t=t.child}return t;case 26:return Cp(e,t),e===null?(n=Ww(t.type,null,t.pendingProps,null))?t.memoizedState=n:Bt||(n=t.type,e=t.pendingProps,r=gm(So.current).createElement(n),r[_r]=t,r[la]=e,Er(r,n,e),mr(r),t.stateNode=r):t.memoizedState=Ww(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return g2(t),e===null&&Bt&&(r=t.stateNode=j6(t.type,t.pendingProps,So.current),Ar=t,Za=!0,a=_n,Bo(t.type)?(nv=a,_n=ti(r.firstChild)):_n=a),xr(e,t,t.pendingProps.children,n),Cp(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&Bt&&((a=r=_n)&&(r=Ej(r,t.type,t.pendingProps,Za),r!==null?(t.stateNode=r,Ar=t,_n=ti(r.firstChild),Za=!1,a=!0):a=!1),a||Do(t)),g2(t),a=t.type,i=t.pendingProps,s=e!==null?e.memoizedProps:null,r=i.children,Q2(a,i)?r=null:s!==null&&Q2(a,s)&&(t.flags|=32),t.memoizedState!==null&&(a=Gy(e,t,UL,null,null,n),sd._currentValue=a),Cp(e,t),xr(e,t,r,n),t.child;case 6:return e===null&&Bt&&((e=n=_n)&&(n=Cj(n,t.pendingProps,Za),n!==null?(t.stateNode=n,Ar=t,_n=null,e=!0):e=!1),e||Do(t)),null;case 13:return I_(e,t,n);case 4:return Wp(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=xl(t,null,r,n):xr(e,t,r,n),t.child;case 11:return xw(e,t,t.type,t.pendingProps,n);case 7:return xr(e,t,t.pendingProps,n),t.child;case 8:return xr(e,t,t.pendingProps.children,n),t.child;case 12:return xr(e,t,t.pendingProps.children,n),t.child;case 10:return r=t.pendingProps,lo(t,t.type,r.value),xr(e,t,r.children,n),t.child;case 9:return a=t.type._context,r=t.pendingProps.children,wl(t),a=Nr(a),r=r(a),t.flags|=1,xr(e,t,r,n),t.child;case 14:return Sw(e,t,t.type,t.pendingProps,n);case 15:return k_(e,t,t.type,t.pendingProps,n);case 19:return F_(e,t,n);case 31:return JL(e,t,n);case 22:return P_(e,t,n,t.pendingProps);case 24:return wl(t),r=Nr(er),e===null?(a=zy(),a===null&&(a=dn,i=Uy(),a.pooledCache=i,i.refCount++,i!==null&&(a.pooledCacheLanes|=n),a=i),t.memoizedState={parent:r,cache:a},Hy(t),lo(t,er,a)):(e.lanes&n&&(D2(e,t),Pf(t,null,null,n),kf()),a=e.memoizedState,i=t.memoizedState,a.parent!==r?(a={parent:r,cache:r},t.memoizedState=a,t.lanes===0&&(t.memoizedState=t.updateQueue.baseState=a),lo(t,er,r)):(r=i.cache,lo(t,er,r),r!==a.cache&&T2(t,[er],n,!0))),xr(e,t,t.pendingProps.children,n),t.child;case 29:throw t.pendingProps}throw Error(Ee(156,t.tag))}function as(e){e.flags|=4}function d1(e,t,n,r,a){if((t=(e.mode&32)!==0)&&(t=!1),t){if(e.flags|=16777216,(a&335544128)===a)if(e.stateNode.complete)e.flags|=8192;else if(u6())e.flags|=8192;else throw dl=nm,qy}else e.flags&=-16777217}function jw(e,t){if(t.type!=="stylesheet"||t.state.loading&4)e.flags&=-16777217;else if(e.flags|=16777216,!D6(t))if(u6())e.flags|=8192;else throw dl=nm,qy}function Hh(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag!==22?cS():536870912,e.lanes|=t,oc|=t)}function lf(e,t){if(!Bt)switch(e.tailMode){case"hidden":t=e.tail;for(var n=null;t!==null;)t.alternate!==null&&(n=t),t=t.sibling;n===null?e.tail=null:n.sibling=null;break;case"collapsed":n=e.tail;for(var r=null;n!==null;)n.alternate!==null&&(r=n),n=n.sibling;r===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:r.sibling=null}}function Sn(e){var t=e.alternate!==null&&e.alternate.child===e.child,n=0,r=0;if(t)for(var a=e.child;a!==null;)n|=a.lanes|a.childLanes,r|=a.subtreeFlags&65011712,r|=a.flags&65011712,a.return=e,a=a.sibling;else for(a=e.child;a!==null;)n|=a.lanes|a.childLanes,r|=a.subtreeFlags,r|=a.flags,a.return=e,a=a.sibling;return e.subtreeFlags|=r,e.childLanes=n,t}function XL(e,t,n){var r=t.pendingProps;switch($y(t),t.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Sn(t),null;case 1:return Sn(t),null;case 3:return n=t.stateNode,r=null,e!==null&&(r=e.memoizedState.cache),t.memoizedState.cache!==r&&(t.flags|=2048),bs(er),tc(),n.pendingContext&&(n.context=n.pendingContext,n.pendingContext=null),(e===null||e.child===null)&&(nu(t)?as(t):e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,r1())),Sn(t),null;case 26:var a=t.type,i=t.memoizedState;return e===null?(as(t),i!==null?(Sn(t),jw(t,i)):(Sn(t),d1(t,a,null,r,n))):i?i!==e.memoizedState?(as(t),Sn(t),jw(t,i)):(Sn(t),t.flags&=-16777217):(e=e.memoizedProps,e!==r&&as(t),Sn(t),d1(t,a,e,r,n)),null;case 27:if(Jp(t),n=So.current,a=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==r&&as(t);else{if(!r){if(t.stateNode===null)throw Error(Ee(166));return Sn(t),null}e=Fi.current,nu(t)?aw(t):(e=j6(a,r,n),t.stateNode=e,as(t))}return Sn(t),null;case 5:if(Jp(t),a=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==r&&as(t);else{if(!r){if(t.stateNode===null)throw Error(Ee(166));return Sn(t),null}if(i=Fi.current,nu(t))aw(t);else{var s=gm(So.current);switch(i){case 1:i=s.createElementNS("http://www.w3.org/2000/svg",a);break;case 2:i=s.createElementNS("http://www.w3.org/1998/Math/MathML",a);break;default:switch(a){case"svg":i=s.createElementNS("http://www.w3.org/2000/svg",a);break;case"math":i=s.createElementNS("http://www.w3.org/1998/Math/MathML",a);break;case"script":i=s.createElement("div"),i.innerHTML="<script><\/script>",i=i.removeChild(i.firstChild);break;case"select":i=typeof r.is=="string"?s.createElement("select",{is:r.is}):s.createElement("select"),r.multiple?i.multiple=!0:r.size&&(i.size=r.size);break;default:i=typeof r.is=="string"?s.createElement(a,{is:r.is}):s.createElement(a)}}i[_r]=t,i[la]=r;e:for(s=t.child;s!==null;){if(s.tag===5||s.tag===6)i.appendChild(s.stateNode);else if(s.tag!==4&&s.tag!==27&&s.child!==null){s.child.return=s,s=s.child;continue}if(s===t)break e;for(;s.sibling===null;){if(s.return===null||s.return===t)break e;s=s.return}s.sibling.return=s.return,s=s.sibling}t.stateNode=i;e:switch(Er(i,a,r),a){case"button":case"input":case"select":case"textarea":r=!!r.autoFocus;break e;case"img":r=!0;break e;default:r=!1}r&&as(t)}}return Sn(t),d1(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,n),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==r&&as(t);else{if(typeof r!="string"&&t.stateNode===null)throw Error(Ee(166));if(e=So.current,nu(t)){if(e=t.stateNode,n=t.memoizedProps,r=null,a=Ar,a!==null)switch(a.tag){case 27:case 5:r=a.memoizedProps}e[_r]=t,e=!!(e.nodeValue===n||r!==null&&r.suppressHydrationWarning===!0||N6(e.nodeValue,n)),e||Do(t,!0)}else e=gm(e).createTextNode(r),e[_r]=t,t.stateNode=e}return Sn(t),null;case 31:if(n=t.memoizedState,e===null||e.memoizedState!==null){if(r=nu(t),n!==null){if(e===null){if(!r)throw Error(Ee(318));if(e=t.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(Ee(557));e[_r]=t}else bl(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;Sn(t),e=!1}else n=r1(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=n),e=!0;if(!e)return t.flags&256?(_a(t),t):(_a(t),null);if(t.flags&128)throw Error(Ee(558))}return Sn(t),null;case 13:if(r=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(a=nu(t),r!==null&&r.dehydrated!==null){if(e===null){if(!a)throw Error(Ee(318));if(a=t.memoizedState,a=a!==null?a.dehydrated:null,!a)throw Error(Ee(317));a[_r]=t}else bl(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;Sn(t),a=!1}else a=r1(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=a),a=!0;if(!a)return t.flags&256?(_a(t),t):(_a(t),null)}return _a(t),t.flags&128?(t.lanes=n,t):(n=r!==null,e=e!==null&&e.memoizedState!==null,n&&(r=t.child,a=null,r.alternate!==null&&r.alternate.memoizedState!==null&&r.alternate.memoizedState.cachePool!==null&&(a=r.alternate.memoizedState.cachePool.pool),i=null,r.memoizedState!==null&&r.memoizedState.cachePool!==null&&(i=r.memoizedState.cachePool.pool),i!==a&&(r.flags|=2048)),n!==e&&n&&(t.child.flags|=8192),Hh(t,t.updateQueue),Sn(t),null);case 4:return tc(),e===null&&h5(t.stateNode.containerInfo),Sn(t),null;case 10:return bs(t.type),Sn(t),null;case 19:if(gr(Yn),r=t.memoizedState,r===null)return Sn(t),null;if(a=(t.flags&128)!==0,i=r.rendering,i===null)if(a)lf(r,!1);else{if(In!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(i=am(e),i!==null){for(t.flags|=128,lf(r,!1),e=i.updateQueue,t.updateQueue=e,Hh(t,e),t.subtreeFlags=0,e=n,n=t.child;n!==null;)$S(n,e),n=n.sibling;return xn(Yn,Yn.current&1|2),Bt&&ds(t,r.treeForkCount),t.child}e=e.sibling}r.tail!==null&&Ca()>cm&&(t.flags|=128,a=!0,lf(r,!1),t.lanes=4194304)}else{if(!a)if(e=am(i),e!==null){if(t.flags|=128,a=!0,e=e.updateQueue,t.updateQueue=e,Hh(t,e),lf(r,!0),r.tail===null&&r.tailMode==="hidden"&&!i.alternate&&!Bt)return Sn(t),null}else 2*Ca()-r.renderingStartTime>cm&&n!==536870912&&(t.flags|=128,a=!0,lf(r,!1),t.lanes=4194304);r.isBackwards?(i.sibling=t.child,t.child=i):(e=r.last,e!==null?e.sibling=i:t.child=i,r.last=i)}return r.tail!==null?(e=r.tail,r.rendering=e,r.tail=e.sibling,r.renderingStartTime=Ca(),e.sibling=null,n=Yn.current,xn(Yn,a?n&1|2:n&1),Bt&&ds(t,r.treeForkCount),e):(Sn(t),null);case 22:case 23:return _a(t),Vy(),r=t.memoizedState!==null,e!==null?e.memoizedState!==null!==r&&(t.flags|=8192):r&&(t.flags|=8192),r?n&536870912&&!(t.flags&128)&&(Sn(t),t.subtreeFlags&6&&(t.flags|=8192)):Sn(t),n=t.updateQueue,n!==null&&Hh(t,n.retryQueue),n=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(n=e.memoizedState.cachePool.pool),r=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(r=t.memoizedState.cachePool.pool),r!==n&&(t.flags|=2048),e!==null&&gr(fl),null;case 24:return n=null,e!==null&&(n=e.memoizedState.cache),t.memoizedState.cache!==n&&(t.flags|=2048),bs(er),Sn(t),null;case 25:return null;case 30:return null}throw Error(Ee(156,t.tag))}function QL(e,t){switch($y(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return bs(er),tc(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return Jp(t),null;case 31:if(t.memoizedState!==null){if(_a(t),t.alternate===null)throw Error(Ee(340));bl()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(_a(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(Ee(340));bl()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return gr(Yn),null;case 4:return tc(),null;case 10:return bs(t.type),null;case 22:case 23:return _a(t),Vy(),e!==null&&gr(fl),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return bs(er),null;case 25:return null;default:return null}}function $_(e,t){switch($y(t),t.tag){case 3:bs(er),tc();break;case 26:case 27:case 5:Jp(t);break;case 4:tc();break;case 31:t.memoizedState!==null&&_a(t);break;case 13:_a(t);break;case 19:gr(Yn);break;case 10:bs(t.type);break;case 22:case 23:_a(t),Vy(),e!==null&&gr(fl);break;case 24:bs(er)}}function Dd(e,t){try{var n=t.updateQueue,r=n!==null?n.lastEffect:null;if(r!==null){var a=r.next;n=a;do{if((n.tag&e)===e){r=void 0;var i=n.create,s=n.inst;r=i(),s.destroy=r}n=n.next}while(n!==a)}}catch(o){an(t,t.return,o)}}function Ro(e,t,n){try{var r=t.updateQueue,a=r!==null?r.lastEffect:null;if(a!==null){var i=a.next;r=i;do{if((r.tag&e)===e){var s=r.inst,o=s.destroy;if(o!==void 0){s.destroy=void 0,a=t;var l=n,u=o;try{u()}catch(c){an(a,l,c)}}}r=r.next}while(r!==i)}}catch(c){an(t,t.return,c)}}function U_(e){var t=e.updateQueue;if(t!==null){var n=e.stateNode;try{KS(t,n)}catch(r){an(e,e.return,r)}}}function z_(e,t,n){n.props=_l(e.type,e.memoizedProps),n.state=e.memoizedState;try{n.componentWillUnmount()}catch(r){an(e,t,r)}}function Ff(e,t){try{var n=e.ref;if(n!==null){switch(e.tag){case 26:case 27:case 5:var r=e.stateNode;break;case 30:r=e.stateNode;break;default:r=e.stateNode}typeof n=="function"?e.refCleanup=n(r):n.current=r}}catch(a){an(e,t,a)}}function ki(e,t){var n=e.ref,r=e.refCleanup;if(n!==null)if(typeof r=="function")try{r()}catch(a){an(e,t,a)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof n=="function")try{n(null)}catch(a){an(e,t,a)}else n.current=null}function q_(e){var t=e.type,n=e.memoizedProps,r=e.stateNode;try{e:switch(t){case"button":case"input":case"select":case"textarea":n.autoFocus&&r.focus();break e;case"img":n.src?r.src=n.src:n.srcSet&&(r.srcset=n.srcSet)}}catch(a){an(e,e.return,a)}}function h1(e,t,n){try{var r=e.stateNode;wj(r,e.type,n,t),r[la]=t}catch(a){an(e,e.return,a)}}function H_(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&Bo(e.type)||e.tag===4}function p1(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||H_(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.tag===27&&Bo(e.type)||e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function q2(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?(n.nodeType===9?n.body:n.nodeName==="HTML"?n.ownerDocument.body:n).insertBefore(e,t):(t=n.nodeType===9?n.body:n.nodeName==="HTML"?n.ownerDocument.body:n,t.appendChild(e),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=ms));else if(r!==4&&(r===27&&Bo(e.type)&&(n=e.stateNode,t=null),e=e.child,e!==null))for(q2(e,t,n),e=e.sibling;e!==null;)q2(e,t,n),e=e.sibling}function um(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(r!==4&&(r===27&&Bo(e.type)&&(n=e.stateNode),e=e.child,e!==null))for(um(e,t,n),e=e.sibling;e!==null;)um(e,t,n),e=e.sibling}function V_(e){var t=e.stateNode,n=e.memoizedProps;try{for(var r=e.type,a=t.attributes;a.length;)t.removeAttributeNode(a[0]);Er(t,r,n),t[_r]=e,t[la]=n}catch(i){an(e,e.return,i)}}var hs=!1,Zn=!1,m1=!1,Tw=typeof WeakSet=="function"?WeakSet:Set,hr=null;function ZL(e,t){if(e=e.containerInfo,K2=wm,e=DS(e),ky(e)){if("selectionStart"in e)var n={start:e.selectionStart,end:e.selectionEnd};else e:{n=(n=e.ownerDocument)&&n.defaultView||window;var r=n.getSelection&&n.getSelection();if(r&&r.rangeCount!==0){n=r.anchorNode;var a=r.anchorOffset,i=r.focusNode;r=r.focusOffset;try{n.nodeType,i.nodeType}catch{n=null;break e}var s=0,o=-1,l=-1,u=0,c=0,f=e,p=null;t:for(;;){for(var d;f!==n||a!==0&&f.nodeType!==3||(o=s+a),f!==i||r!==0&&f.nodeType!==3||(l=s+r),f.nodeType===3&&(s+=f.nodeValue.length),(d=f.firstChild)!==null;)p=f,f=d;for(;;){if(f===e)break t;if(p===n&&++u===a&&(o=s),p===i&&++c===r&&(l=s),(d=f.nextSibling)!==null)break;f=p,p=f.parentNode}f=d}n=o===-1||l===-1?null:{start:o,end:l}}else n=null}n=n||{start:0,end:0}}else n=null;for(X2={focusedElem:e,selectionRange:n},wm=!1,hr=t;hr!==null;)if(t=hr,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,hr=e;else for(;hr!==null;){switch(t=hr,i=t.alternate,e=t.flags,t.tag){case 0:if(e&4&&(e=t.updateQueue,e=e!==null?e.events:null,e!==null))for(n=0;n<e.length;n++)a=e[n],a.ref.impl=a.nextImpl;break;case 11:case 15:break;case 1:if(e&1024&&i!==null){e=void 0,n=t,a=i.memoizedProps,i=i.memoizedState,r=n.stateNode;try{var v=_l(n.type,a);e=r.getSnapshotBeforeUpdate(v,i),r.__reactInternalSnapshotBeforeUpdate=e}catch(S){an(n,n.return,S)}}break;case 3:if(e&1024){if(e=t.stateNode.containerInfo,n=e.nodeType,n===9)Z2(e);else if(n===1)switch(e.nodeName){case"HEAD":case"HTML":case"BODY":Z2(e);break;default:e.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if(e&1024)throw Error(Ee(163))}if(e=t.sibling,e!==null){e.return=t.return,hr=e;break}hr=t.return}}function Y_(e,t,n){var r=n.flags;switch(n.tag){case 0:case 11:case 15:ss(e,n),r&4&&Dd(5,n);break;case 1:if(ss(e,n),r&4)if(e=n.stateNode,t===null)try{e.componentDidMount()}catch(s){an(n,n.return,s)}else{var a=_l(n.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(a,t,e.__reactInternalSnapshotBeforeUpdate)}catch(s){an(n,n.return,s)}}r&64&&U_(n),r&512&&Ff(n,n.return);break;case 3:if(ss(e,n),r&64&&(e=n.updateQueue,e!==null)){if(t=null,n.child!==null)switch(n.child.tag){case 27:case 5:t=n.child.stateNode;break;case 1:t=n.child.stateNode}try{KS(e,t)}catch(s){an(n,n.return,s)}}break;case 27:t===null&&r&4&&V_(n);case 26:case 5:ss(e,n),t===null&&r&4&&q_(n),r&512&&Ff(n,n.return);break;case 12:ss(e,n);break;case 31:ss(e,n),r&4&&J_(e,n);break;case 13:ss(e,n),r&4&&K_(e,n),r&64&&(e=n.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(n=lj.bind(null,n),Lj(e,n))));break;case 22:if(r=n.memoizedState!==null||hs,!r){t=t!==null&&t.memoizedState!==null||Zn,a=hs;var i=Zn;hs=r,(Zn=t)&&!i?us(e,n,(n.subtreeFlags&8772)!==0):ss(e,n),hs=a,Zn=i}break;case 30:break;default:ss(e,n)}}function G_(e){var t=e.alternate;t!==null&&(e.alternate=null,G_(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&jy(t)),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}var Tn=null,ra=!1;function is(e,t,n){for(n=n.child;n!==null;)W_(e,t,n),n=n.sibling}function W_(e,t,n){if(La&&typeof La.onCommitFiberUnmount=="function")try{La.onCommitFiberUnmount(Nd,n)}catch{}switch(n.tag){case 26:Zn||ki(n,t),is(e,t,n),n.memoizedState?n.memoizedState.count--:n.stateNode&&(n=n.stateNode,n.parentNode.removeChild(n));break;case 27:Zn||ki(n,t);var r=Tn,a=ra;Bo(n.type)&&(Tn=n.stateNode,ra=!1),is(e,t,n),zf(n.stateNode),Tn=r,ra=a;break;case 5:Zn||ki(n,t);case 6:if(r=Tn,a=ra,Tn=null,is(e,t,n),Tn=r,ra=a,Tn!==null)if(ra)try{(Tn.nodeType===9?Tn.body:Tn.nodeName==="HTML"?Tn.ownerDocument.body:Tn).removeChild(n.stateNode)}catch(i){an(n,t,i)}else try{Tn.removeChild(n.stateNode)}catch(i){an(n,t,i)}break;case 18:Tn!==null&&(ra?(e=Tn,qw(e.nodeType===9?e.body:e.nodeName==="HTML"?e.ownerDocument.body:e,n.stateNode),fc(e)):qw(Tn,n.stateNode));break;case 4:r=Tn,a=ra,Tn=n.stateNode.containerInfo,ra=!0,is(e,t,n),Tn=r,ra=a;break;case 0:case 11:case 14:case 15:Ro(2,n,t),Zn||Ro(4,n,t),is(e,t,n);break;case 1:Zn||(ki(n,t),r=n.stateNode,typeof r.componentWillUnmount=="function"&&z_(n,t,r)),is(e,t,n);break;case 21:is(e,t,n);break;case 22:Zn=(r=Zn)||n.memoizedState!==null,is(e,t,n),Zn=r;break;default:is(e,t,n)}}function J_(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{fc(e)}catch(n){an(t,t.return,n)}}}function K_(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{fc(e)}catch(n){an(t,t.return,n)}}function ej(e){switch(e.tag){case 31:case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new Tw),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new Tw),t;default:throw Error(Ee(435,e.tag))}}function Vh(e,t){var n=ej(e);t.forEach(function(r){if(!n.has(r)){n.add(r);var a=uj.bind(null,e,r);r.then(a,a)}})}function ea(e,t){var n=t.deletions;if(n!==null)for(var r=0;r<n.length;r++){var a=n[r],i=e,s=t,o=s;e:for(;o!==null;){switch(o.tag){case 27:if(Bo(o.type)){Tn=o.stateNode,ra=!1;break e}break;case 5:Tn=o.stateNode,ra=!1;break e;case 3:case 4:Tn=o.stateNode.containerInfo,ra=!0;break e}o=o.return}if(Tn===null)throw Error(Ee(160));W_(i,s,a),Tn=null,ra=!1,i=a.alternate,i!==null&&(i.return=null),a.return=null}if(t.subtreeFlags&13886)for(t=t.child;t!==null;)X_(t,e),t=t.sibling}var vi=null;function X_(e,t){var n=e.alternate,r=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:ea(t,e),ta(e),r&4&&(Ro(3,e,e.return),Dd(3,e),Ro(5,e,e.return));break;case 1:ea(t,e),ta(e),r&512&&(Zn||n===null||ki(n,n.return)),r&64&&hs&&(e=e.updateQueue,e!==null&&(r=e.callbacks,r!==null&&(n=e.shared.hiddenCallbacks,e.shared.hiddenCallbacks=n===null?r:n.concat(r))));break;case 26:var a=vi;if(ea(t,e),ta(e),r&512&&(Zn||n===null||ki(n,n.return)),r&4){var i=n!==null?n.memoizedState:null;if(r=e.memoizedState,n===null)if(r===null)if(e.stateNode===null){e:{r=e.type,n=e.memoizedProps,a=a.ownerDocument||a;t:switch(r){case"title":i=a.getElementsByTagName("title")[0],(!i||i[Ld]||i[_r]||i.namespaceURI==="http://www.w3.org/2000/svg"||i.hasAttribute("itemprop"))&&(i=a.createElement(r),a.head.insertBefore(i,a.querySelector("head > title"))),Er(i,r,n),i[_r]=e,mr(i),r=i;break e;case"link":var s=Kw("link","href",a).get(r+(n.href||""));if(s){for(var o=0;o<s.length;o++)if(i=s[o],i.getAttribute("href")===(n.href==null||n.href===""?null:n.href)&&i.getAttribute("rel")===(n.rel==null?null:n.rel)&&i.getAttribute("title")===(n.title==null?null:n.title)&&i.getAttribute("crossorigin")===(n.crossOrigin==null?null:n.crossOrigin)){s.splice(o,1);break t}}i=a.createElement(r),Er(i,r,n),a.head.appendChild(i);break;case"meta":if(s=Kw("meta","content",a).get(r+(n.content||""))){for(o=0;o<s.length;o++)if(i=s[o],i.getAttribute("content")===(n.content==null?null:""+n.content)&&i.getAttribute("name")===(n.name==null?null:n.name)&&i.getAttribute("property")===(n.property==null?null:n.property)&&i.getAttribute("http-equiv")===(n.httpEquiv==null?null:n.httpEquiv)&&i.getAttribute("charset")===(n.charSet==null?null:n.charSet)){s.splice(o,1);break t}}i=a.createElement(r),Er(i,r,n),a.head.appendChild(i);break;default:throw Error(Ee(468,r))}i[_r]=e,mr(i),r=i}e.stateNode=r}else Xw(a,e.type,e.stateNode);else e.stateNode=Jw(a,r,e.memoizedProps);else i!==r?(i===null?n.stateNode!==null&&(n=n.stateNode,n.parentNode.removeChild(n)):i.count--,r===null?Xw(a,e.type,e.stateNode):Jw(a,r,e.memoizedProps)):r===null&&e.stateNode!==null&&h1(e,e.memoizedProps,n.memoizedProps)}break;case 27:ea(t,e),ta(e),r&512&&(Zn||n===null||ki(n,n.return)),n!==null&&r&4&&h1(e,e.memoizedProps,n.memoizedProps);break;case 5:if(ea(t,e),ta(e),r&512&&(Zn||n===null||ki(n,n.return)),e.flags&32){a=e.stateNode;try{rc(a,"")}catch(v){an(e,e.return,v)}}r&4&&e.stateNode!=null&&(a=e.memoizedProps,h1(e,a,n!==null?n.memoizedProps:a)),r&1024&&(m1=!0);break;case 6:if(ea(t,e),ta(e),r&4){if(e.stateNode===null)throw Error(Ee(162));r=e.memoizedProps,n=e.stateNode;try{n.nodeValue=r}catch(v){an(e,e.return,v)}}break;case 3:if(Tp=null,a=vi,vi=vm(t.containerInfo),ea(t,e),vi=a,ta(e),r&4&&n!==null&&n.memoizedState.isDehydrated)try{fc(t.containerInfo)}catch(v){an(e,e.return,v)}m1&&(m1=!1,Q_(e));break;case 4:r=vi,vi=vm(e.stateNode.containerInfo),ea(t,e),ta(e),vi=r;break;case 12:ea(t,e),ta(e);break;case 31:ea(t,e),ta(e),r&4&&(r=e.updateQueue,r!==null&&(e.updateQueue=null,Vh(e,r)));break;case 13:ea(t,e),ta(e),e.child.flags&8192&&e.memoizedState!==null!=(n!==null&&n.memoizedState!==null)&&(dg=Ca()),r&4&&(r=e.updateQueue,r!==null&&(e.updateQueue=null,Vh(e,r)));break;case 22:a=e.memoizedState!==null;var l=n!==null&&n.memoizedState!==null,u=hs,c=Zn;if(hs=u||a,Zn=c||l,ea(t,e),Zn=c,hs=u,ta(e),r&8192)e:for(t=e.stateNode,t._visibility=a?t._visibility&-2:t._visibility|1,a&&(n===null||l||hs||Zn||rl(e)),n=null,t=e;;){if(t.tag===5||t.tag===26){if(n===null){l=n=t;try{if(i=l.stateNode,a)s=i.style,typeof s.setProperty=="function"?s.setProperty("display","none","important"):s.display="none";else{o=l.stateNode;var f=l.memoizedProps.style,p=f!=null&&f.hasOwnProperty("display")?f.display:null;o.style.display=p==null||typeof p=="boolean"?"":(""+p).trim()}}catch(v){an(l,l.return,v)}}}else if(t.tag===6){if(n===null){l=t;try{l.stateNode.nodeValue=a?"":l.memoizedProps}catch(v){an(l,l.return,v)}}}else if(t.tag===18){if(n===null){l=t;try{var d=l.stateNode;a?Hw(d,!0):Hw(l.stateNode,!1)}catch(v){an(l,l.return,v)}}}else if((t.tag!==22&&t.tag!==23||t.memoizedState===null||t===e)&&t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break e;for(;t.sibling===null;){if(t.return===null||t.return===e)break e;n===t&&(n=null),t=t.return}n===t&&(n=null),t.sibling.return=t.return,t=t.sibling}r&4&&(r=e.updateQueue,r!==null&&(n=r.retryQueue,n!==null&&(r.retryQueue=null,Vh(e,n))));break;case 19:ea(t,e),ta(e),r&4&&(r=e.updateQueue,r!==null&&(e.updateQueue=null,Vh(e,r)));break;case 30:break;case 21:break;default:ea(t,e),ta(e)}}function ta(e){var t=e.flags;if(t&2){try{for(var n,r=e.return;r!==null;){if(H_(r)){n=r;break}r=r.return}if(n==null)throw Error(Ee(160));switch(n.tag){case 27:var a=n.stateNode,i=p1(e);um(e,i,a);break;case 5:var s=n.stateNode;n.flags&32&&(rc(s,""),n.flags&=-33);var o=p1(e);um(e,o,s);break;case 3:case 4:var l=n.stateNode.containerInfo,u=p1(e);q2(e,u,l);break;default:throw Error(Ee(161))}}catch(c){an(e,e.return,c)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function Q_(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;Q_(t),t.tag===5&&t.flags&1024&&t.stateNode.reset(),e=e.sibling}}function ss(e,t){if(t.subtreeFlags&8772)for(t=t.child;t!==null;)Y_(e,t.alternate,t),t=t.sibling}function rl(e){for(e=e.child;e!==null;){var t=e;switch(t.tag){case 0:case 11:case 14:case 15:Ro(4,t,t.return),rl(t);break;case 1:ki(t,t.return);var n=t.stateNode;typeof n.componentWillUnmount=="function"&&z_(t,t.return,n),rl(t);break;case 27:zf(t.stateNode);case 26:case 5:ki(t,t.return),rl(t);break;case 22:t.memoizedState===null&&rl(t);break;case 30:rl(t);break;default:rl(t)}e=e.sibling}}function us(e,t,n){for(n=n&&(t.subtreeFlags&8772)!==0,t=t.child;t!==null;){var r=t.alternate,a=e,i=t,s=i.flags;switch(i.tag){case 0:case 11:case 15:us(a,i,n),Dd(4,i);break;case 1:if(us(a,i,n),r=i,a=r.stateNode,typeof a.componentDidMount=="function")try{a.componentDidMount()}catch(u){an(r,r.return,u)}if(r=i,a=r.updateQueue,a!==null){var o=r.stateNode;try{var l=a.shared.hiddenCallbacks;if(l!==null)for(a.shared.hiddenCallbacks=null,a=0;a<l.length;a++)JS(l[a],o)}catch(u){an(r,r.return,u)}}n&&s&64&&U_(i),Ff(i,i.return);break;case 27:V_(i);case 26:case 5:us(a,i,n),n&&r===null&&s&4&&q_(i),Ff(i,i.return);break;case 12:us(a,i,n);break;case 31:us(a,i,n),n&&s&4&&J_(a,i);break;case 13:us(a,i,n),n&&s&4&&K_(a,i);break;case 22:i.memoizedState===null&&us(a,i,n),Ff(i,i.return);break;case 30:break;default:us(a,i,n)}t=t.sibling}}function o5(e,t){var n=null;e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(n=e.memoizedState.cachePool.pool),e=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(e=t.memoizedState.cachePool.pool),e!==n&&(e!=null&&e.refCount++,n!=null&&Td(n))}function l5(e,t){e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&Td(e))}function hi(e,t,n,r){if(t.subtreeFlags&10256)for(t=t.child;t!==null;)Z_(e,t,n,r),t=t.sibling}function Z_(e,t,n,r){var a=t.flags;switch(t.tag){case 0:case 11:case 15:hi(e,t,n,r),a&2048&&Dd(9,t);break;case 1:hi(e,t,n,r);break;case 3:hi(e,t,n,r),a&2048&&(e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&Td(e)));break;case 12:if(a&2048){hi(e,t,n,r),e=t.stateNode;try{var i=t.memoizedProps,s=i.id,o=i.onPostCommit;typeof o=="function"&&o(s,t.alternate===null?"mount":"update",e.passiveEffectDuration,-0)}catch(l){an(t,t.return,l)}}else hi(e,t,n,r);break;case 31:hi(e,t,n,r);break;case 13:hi(e,t,n,r);break;case 23:break;case 22:i=t.stateNode,s=t.alternate,t.memoizedState!==null?i._visibility&2?hi(e,t,n,r):Bf(e,t):i._visibility&2?hi(e,t,n,r):(i._visibility|=2,gu(e,t,n,r,(t.subtreeFlags&10256)!==0||!1)),a&2048&&o5(s,t);break;case 24:hi(e,t,n,r),a&2048&&l5(t.alternate,t);break;default:hi(e,t,n,r)}}function gu(e,t,n,r,a){for(a=a&&((t.subtreeFlags&10256)!==0||!1),t=t.child;t!==null;){var i=e,s=t,o=n,l=r,u=s.flags;switch(s.tag){case 0:case 11:case 15:gu(i,s,o,l,a),Dd(8,s);break;case 23:break;case 22:var c=s.stateNode;s.memoizedState!==null?c._visibility&2?gu(i,s,o,l,a):Bf(i,s):(c._visibility|=2,gu(i,s,o,l,a)),a&&u&2048&&o5(s.alternate,s);break;case 24:gu(i,s,o,l,a),a&&u&2048&&l5(s.alternate,s);break;default:gu(i,s,o,l,a)}t=t.sibling}}function Bf(e,t){if(t.subtreeFlags&10256)for(t=t.child;t!==null;){var n=e,r=t,a=r.flags;switch(r.tag){case 22:Bf(n,r),a&2048&&o5(r.alternate,r);break;case 24:Bf(n,r),a&2048&&l5(r.alternate,r);break;default:Bf(n,r)}t=t.sibling}}var Nf=8192;function ru(e,t,n){if(e.subtreeFlags&Nf)for(e=e.child;e!==null;)e6(e,t,n),e=e.sibling}function e6(e,t,n){switch(e.tag){case 26:ru(e,t,n),e.flags&Nf&&e.memoizedState!==null&&$j(n,vi,e.memoizedState,e.memoizedProps);break;case 5:ru(e,t,n);break;case 3:case 4:var r=vi;vi=vm(e.stateNode.containerInfo),ru(e,t,n),vi=r;break;case 22:e.memoizedState===null&&(r=e.alternate,r!==null&&r.memoizedState!==null?(r=Nf,Nf=16777216,ru(e,t,n),Nf=r):ru(e,t,n));break;default:ru(e,t,n)}}function t6(e){var t=e.alternate;if(t!==null&&(e=t.child,e!==null)){t.child=null;do t=e.sibling,e.sibling=null,e=t;while(e!==null)}}function uf(e){var t=e.deletions;if(e.flags&16){if(t!==null)for(var n=0;n<t.length;n++){var r=t[n];hr=r,r6(r,e)}t6(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)n6(e),e=e.sibling}function n6(e){switch(e.tag){case 0:case 11:case 15:uf(e),e.flags&2048&&Ro(9,e,e.return);break;case 3:uf(e);break;case 12:uf(e);break;case 22:var t=e.stateNode;e.memoizedState!==null&&t._visibility&2&&(e.return===null||e.return.tag!==13)?(t._visibility&=-3,Lp(e)):uf(e);break;default:uf(e)}}function Lp(e){var t=e.deletions;if(e.flags&16){if(t!==null)for(var n=0;n<t.length;n++){var r=t[n];hr=r,r6(r,e)}t6(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:Ro(8,t,t.return),Lp(t);break;case 22:n=t.stateNode,n._visibility&2&&(n._visibility&=-3,Lp(t));break;default:Lp(t)}e=e.sibling}}function r6(e,t){for(;hr!==null;){var n=hr;switch(n.tag){case 0:case 11:case 15:Ro(8,n,t);break;case 23:case 22:if(n.memoizedState!==null&&n.memoizedState.cachePool!==null){var r=n.memoizedState.cachePool.pool;r!=null&&r.refCount++}break;case 24:Td(n.memoizedState.cache)}if(r=n.child,r!==null)r.return=n,hr=r;else e:for(n=e;hr!==null;){r=hr;var a=r.sibling,i=r.return;if(G_(r),r===n){hr=null;break e}if(a!==null){a.return=i,hr=a;break e}hr=i}}}var tj={getCacheForType:function(e){var t=Nr(er),n=t.data.get(e);return n===void 0&&(n=e(),t.data.set(e,n)),n},cacheSignal:function(){return Nr(er).controller.signal}},nj=typeof WeakMap=="function"?WeakMap:Map,Qt=0,dn=null,Dt=null,kt=0,rn=0,xa=null,yo=!1,xc=!1,u5=!1,Cs=0,In=0,Mo=0,hl=0,c5=0,Na=0,oc=0,$f=null,aa=null,H2=!1,dg=0,a6=0,cm=1/0,fm=null,Eo=null,ir=0,Co=null,lc=null,ws=0,V2=0,Y2=null,i6=null,Uf=0,G2=null;function Ta(){return Qt&2&&kt!==0?kt&-kt:dt.T!==null?d5():pS()}function s6(){if(Na===0)if(!(kt&536870912)||Bt){var e=Ih;Ih<<=1,!(Ih&3932160)&&(Ih=262144),Na=e}else Na=536870912;return e=Ra.current,e!==null&&(e.flags|=32),Na}function oa(e,t,n){(e===dn&&(rn===2||rn===9)||e.cancelPendingCommit!==null)&&(uc(e,0),bo(e,kt,Na,!1)),Cd(e,n),(!(Qt&2)||e!==dn)&&(e===dn&&(!(Qt&2)&&(hl|=n),In===4&&bo(e,kt,Na,!1)),qi(e))}function o6(e,t,n){if(Qt&6)throw Error(Ee(327));var r=!n&&(t&127)===0&&(t&e.expiredLanes)===0||Ed(e,t),a=r?ij(e,t):g1(e,t,!0),i=r;do{if(a===0){xc&&!r&&bo(e,t,0,!1);break}else{if(n=e.current.alternate,i&&!rj(n)){a=g1(e,t,!1),i=!1;continue}if(a===2){if(i=t,e.errorRecoveryDisabledLanes&i)var s=0;else s=e.pendingLanes&-536870913,s=s!==0?s:s&536870912?536870912:0;if(s!==0){t=s;e:{var o=e;a=$f;var l=o.current.memoizedState.isDehydrated;if(l&&(uc(o,s).flags|=256),s=g1(o,s,!1),s!==2){if(u5&&!l){o.errorRecoveryDisabledLanes|=i,hl|=i,a=4;break e}i=aa,aa=a,i!==null&&(aa===null?aa=i:aa.push.apply(aa,i))}a=s}if(i=!1,a!==2)continue}}if(a===1){uc(e,0),bo(e,t,0,!0);break}e:{switch(r=e,i=a,i){case 0:case 1:throw Error(Ee(345));case 4:if((t&4194048)!==t)break;case 6:bo(r,t,Na,!yo);break e;case 2:aa=null;break;case 3:case 5:break;default:throw Error(Ee(329))}if((t&62914560)===t&&(a=dg+300-Ca(),10<a)){if(bo(r,t,Na,!yo),tg(r,0,!0)!==0)break e;ws=t,r.timeoutHandle=C6(Ow.bind(null,r,n,aa,fm,H2,t,Na,hl,oc,yo,i,"Throttled",-0,0),a);break e}Ow(r,n,aa,fm,H2,t,Na,hl,oc,yo,i,null,-0,0)}}break}while(!0);qi(e)}function Ow(e,t,n,r,a,i,s,o,l,u,c,f,p,d){if(e.timeoutHandle=-1,f=t.subtreeFlags,f&8192||(f&16785408)===16785408){f={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:ms},e6(t,i,f);var v=(i&62914560)===i?dg-Ca():(i&4194048)===i?a6-Ca():0;if(v=Uj(f,v),v!==null){ws=i,e.cancelPendingCommit=v(Rw.bind(null,e,t,i,n,r,a,s,o,l,c,f,null,p,d)),bo(e,i,s,!u);return}}Rw(e,t,i,n,r,a,s,o,l)}function rj(e){for(var t=e;;){var n=t.tag;if((n===0||n===11||n===15)&&t.flags&16384&&(n=t.updateQueue,n!==null&&(n=n.stores,n!==null)))for(var r=0;r<n.length;r++){var a=n[r],i=a.getSnapshot;a=a.value;try{if(!Da(i(),a))return!1}catch{return!1}}if(n=t.child,t.subtreeFlags&16384&&n!==null)n.return=t,t=n;else{if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return!0;t=t.return}t.sibling.return=t.return,t=t.sibling}}return!0}function bo(e,t,n,r){t&=~c5,t&=~hl,e.suspendedLanes|=t,e.pingedLanes&=~t,r&&(e.warmLanes|=t),r=e.expirationTimes;for(var a=t;0<a;){var i=31-ja(a),s=1<<i;r[i]=-1,a&=~s}n!==0&&fS(e,n,t)}function hg(){return Qt&6?!0:(Rd(0),!1)}function f5(){if(Dt!==null){if(rn===0)var e=Dt.return;else e=Dt,gs=jl=null,Ky(e),Bu=null,td=0,e=Dt;for(;e!==null;)$_(e.alternate,e),e=e.return;Dt=null}}function uc(e,t){var n=e.timeoutHandle;n!==-1&&(e.timeoutHandle=-1,_j(n)),n=e.cancelPendingCommit,n!==null&&(e.cancelPendingCommit=null,n()),ws=0,f5(),dn=e,Dt=n=ys(e.current,null),kt=t,rn=0,xa=null,yo=!1,xc=Ed(e,t),u5=!1,oc=Na=c5=hl=Mo=In=0,aa=$f=null,H2=!1,t&8&&(t|=t&32);var r=e.entangledLanes;if(r!==0)for(e=e.entanglements,r&=t;0<r;){var a=31-ja(r),i=1<<a;t|=e[a],r&=~i}return Cs=t,ig(),n}function l6(e,t){Nt=null,dt.H=rd,t===wc||t===og?(t=uw(),rn=3):t===qy?(t=uw(),rn=4):rn=t===i5?8:t!==null&&typeof t=="object"&&typeof t.then=="function"?6:1,xa=t,Dt===null&&(In=1,om(e,Qa(t,e.current)))}function u6(){var e=Ra.current;return e===null?!0:(kt&4194048)===kt?ei===null:(kt&62914560)===kt||kt&536870912?e===ei:!1}function c6(){var e=dt.H;return dt.H=rd,e===null?rd:e}function f6(){var e=dt.A;return dt.A=tj,e}function dm(){In=4,yo||(kt&4194048)!==kt&&Ra.current!==null||(xc=!0),!(Mo&134217727)&&!(hl&134217727)||dn===null||bo(dn,kt,Na,!1)}function g1(e,t,n){var r=Qt;Qt|=2;var a=c6(),i=f6();(dn!==e||kt!==t)&&(fm=null,uc(e,t)),t=!1;var s=In;e:do try{if(rn!==0&&Dt!==null){var o=Dt,l=xa;switch(rn){case 8:f5(),s=6;break e;case 3:case 2:case 9:case 6:Ra.current===null&&(t=!0);var u=rn;if(rn=0,xa=null,Ru(e,o,l,u),n&&xc){s=0;break e}break;default:u=rn,rn=0,xa=null,Ru(e,o,l,u)}}aj(),s=In;break}catch(c){l6(e,c)}while(!0);return t&&e.shellSuspendCounter++,gs=jl=null,Qt=r,dt.H=a,dt.A=i,Dt===null&&(dn=null,kt=0,ig()),s}function aj(){for(;Dt!==null;)d6(Dt)}function ij(e,t){var n=Qt;Qt|=2;var r=c6(),a=f6();dn!==e||kt!==t?(fm=null,cm=Ca()+500,uc(e,t)):xc=Ed(e,t);e:do try{if(rn!==0&&Dt!==null){t=Dt;var i=xa;t:switch(rn){case 1:rn=0,xa=null,Ru(e,t,i,1);break;case 2:case 9:if(lw(i)){rn=0,xa=null,Dw(t);break}t=function(){rn!==2&&rn!==9||dn!==e||(rn=7),qi(e)},i.then(t,t);break e;case 3:rn=7;break e;case 4:rn=5;break e;case 7:lw(i)?(rn=0,xa=null,Dw(t)):(rn=0,xa=null,Ru(e,t,i,7));break;case 5:var s=null;switch(Dt.tag){case 26:s=Dt.memoizedState;case 5:case 27:var o=Dt;if(s?D6(s):o.stateNode.complete){rn=0,xa=null;var l=o.sibling;if(l!==null)Dt=l;else{var u=o.return;u!==null?(Dt=u,pg(u)):Dt=null}break t}}rn=0,xa=null,Ru(e,t,i,5);break;case 6:rn=0,xa=null,Ru(e,t,i,6);break;case 8:f5(),In=6;break e;default:throw Error(Ee(462))}}sj();break}catch(c){l6(e,c)}while(!0);return gs=jl=null,dt.H=r,dt.A=a,Qt=n,Dt!==null?0:(dn=null,kt=0,ig(),In)}function sj(){for(;Dt!==null&&!jC();)d6(Dt)}function d6(e){var t=B_(e.alternate,e,Cs);e.memoizedProps=e.pendingProps,t===null?pg(e):Dt=t}function Dw(e){var t=e,n=t.alternate;switch(t.tag){case 15:case 0:t=Nw(n,t,t.pendingProps,t.type,void 0,kt);break;case 11:t=Nw(n,t,t.pendingProps,t.type.render,t.ref,kt);break;case 5:Ky(t);default:$_(n,t),t=Dt=$S(t,Cs),t=B_(n,t,Cs)}e.memoizedProps=e.pendingProps,t===null?pg(e):Dt=t}function Ru(e,t,n,r){gs=jl=null,Ky(t),Bu=null,td=0;var a=t.return;try{if(WL(e,a,t,n,kt)){In=1,om(e,Qa(n,e.current)),Dt=null;return}}catch(i){if(a!==null)throw Dt=a,i;In=1,om(e,Qa(n,e.current)),Dt=null;return}t.flags&32768?(Bt||r===1?e=!0:xc||kt&536870912?e=!1:(yo=e=!0,(r===2||r===9||r===3||r===6)&&(r=Ra.current,r!==null&&r.tag===13&&(r.flags|=16384))),h6(t,e)):pg(t)}function pg(e){var t=e;do{if(t.flags&32768){h6(t,yo);return}e=t.return;var n=XL(t.alternate,t,Cs);if(n!==null){Dt=n;return}if(t=t.sibling,t!==null){Dt=t;return}Dt=t=e}while(t!==null);In===0&&(In=5)}function h6(e,t){do{var n=QL(e.alternate,e);if(n!==null){n.flags&=32767,Dt=n;return}if(n=e.return,n!==null&&(n.flags|=32768,n.subtreeFlags=0,n.deletions=null),!t&&(e=e.sibling,e!==null)){Dt=e;return}Dt=e=n}while(e!==null);In=6,Dt=null}function Rw(e,t,n,r,a,i,s,o,l){e.cancelPendingCommit=null;do mg();while(ir!==0);if(Qt&6)throw Error(Ee(327));if(t!==null){if(t===e.current)throw Error(Ee(177));if(i=t.lanes|t.childLanes,i|=Py,BC(e,n,i,s,o,l),e===dn&&(Dt=dn=null,kt=0),lc=t,Co=e,ws=n,V2=i,Y2=a,i6=r,t.subtreeFlags&10256||t.flags&10256?(e.callbackNode=null,e.callbackPriority=0,cj(Kp,function(){return y6(),null})):(e.callbackNode=null,e.callbackPriority=0),r=(t.flags&13878)!==0,t.subtreeFlags&13878||r){r=dt.T,dt.T=null,a=Zt.p,Zt.p=2,s=Qt,Qt|=4;try{ZL(e,t,n)}finally{Qt=s,Zt.p=a,dt.T=r}}ir=1,p6(),m6(),g6()}}function p6(){if(ir===1){ir=0;var e=Co,t=lc,n=(t.flags&13878)!==0;if(t.subtreeFlags&13878||n){n=dt.T,dt.T=null;var r=Zt.p;Zt.p=2;var a=Qt;Qt|=4;try{X_(t,e);var i=X2,s=DS(e.containerInfo),o=i.focusedElem,l=i.selectionRange;if(s!==o&&o&&o.ownerDocument&&OS(o.ownerDocument.documentElement,o)){if(l!==null&&ky(o)){var u=l.start,c=l.end;if(c===void 0&&(c=u),"selectionStart"in o)o.selectionStart=u,o.selectionEnd=Math.min(c,o.value.length);else{var f=o.ownerDocument||document,p=f&&f.defaultView||window;if(p.getSelection){var d=p.getSelection(),v=o.textContent.length,S=Math.min(l.start,v),x=l.end===void 0?S:Math.min(l.end,v);!d.extend&&S>x&&(s=x,x=S,S=s);var g=tw(o,S),y=tw(o,x);if(g&&y&&(d.rangeCount!==1||d.anchorNode!==g.node||d.anchorOffset!==g.offset||d.focusNode!==y.node||d.focusOffset!==y.offset)){var _=f.createRange();_.setStart(g.node,g.offset),d.removeAllRanges(),S>x?(d.addRange(_),d.extend(y.node,y.offset)):(_.setEnd(y.node,y.offset),d.addRange(_))}}}}for(f=[],d=o;d=d.parentNode;)d.nodeType===1&&f.push({element:d,left:d.scrollLeft,top:d.scrollTop});for(typeof o.focus=="function"&&o.focus(),o=0;o<f.length;o++){var E=f[o];E.element.scrollLeft=E.left,E.element.scrollTop=E.top}}wm=!!K2,X2=K2=null}finally{Qt=a,Zt.p=r,dt.T=n}}e.current=t,ir=2}}function m6(){if(ir===2){ir=0;var e=Co,t=lc,n=(t.flags&8772)!==0;if(t.subtreeFlags&8772||n){n=dt.T,dt.T=null;var r=Zt.p;Zt.p=2;var a=Qt;Qt|=4;try{Y_(e,t.alternate,t)}finally{Qt=a,Zt.p=r,dt.T=n}}ir=3}}function g6(){if(ir===4||ir===3){ir=0,TC();var e=Co,t=lc,n=ws,r=i6;t.subtreeFlags&10256||t.flags&10256?ir=5:(ir=0,lc=Co=null,v6(e,e.pendingLanes));var a=e.pendingLanes;if(a===0&&(Eo=null),Ly(n),t=t.stateNode,La&&typeof La.onCommitFiberRoot=="function")try{La.onCommitFiberRoot(Nd,t,void 0,(t.current.flags&128)===128)}catch{}if(r!==null){t=dt.T,a=Zt.p,Zt.p=2,dt.T=null;try{for(var i=e.onRecoverableError,s=0;s<r.length;s++){var o=r[s];i(o.value,{componentStack:o.stack})}}finally{dt.T=t,Zt.p=a}}ws&3&&mg(),qi(e),a=e.pendingLanes,n&261930&&a&42?e===G2?Uf++:(Uf=0,G2=e):Uf=0,Rd(0)}}function v6(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,Td(t)))}function mg(){return p6(),m6(),g6(),y6()}function y6(){if(ir!==5)return!1;var e=Co,t=V2;V2=0;var n=Ly(ws),r=dt.T,a=Zt.p;try{Zt.p=32>n?32:n,dt.T=null,n=Y2,Y2=null;var i=Co,s=ws;if(ir=0,lc=Co=null,ws=0,Qt&6)throw Error(Ee(331));var o=Qt;if(Qt|=4,n6(i.current),Z_(i,i.current,s,n),Qt=o,Rd(0,!1),La&&typeof La.onPostCommitFiberRoot=="function")try{La.onPostCommitFiberRoot(Nd,i)}catch{}return!0}finally{Zt.p=a,dt.T=r,v6(e,t)}}function Mw(e,t,n){t=Qa(n,t),t=$2(e.stateNode,t,2),e=No(e,t,2),e!==null&&(Cd(e,2),qi(e))}function an(e,t,n){if(e.tag===3)Mw(e,e,n);else for(;t!==null;){if(t.tag===3){Mw(t,e,n);break}else if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof r.componentDidCatch=="function"&&(Eo===null||!Eo.has(r))){e=Qa(n,e),n=R_(2),r=No(t,n,2),r!==null&&(M_(n,r,t,e),Cd(r,2),qi(r));break}}t=t.return}}function v1(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new nj;var a=new Set;r.set(t,a)}else a=r.get(t),a===void 0&&(a=new Set,r.set(t,a));a.has(n)||(u5=!0,a.add(n),e=oj.bind(null,e,t,n),t.then(e,e))}function oj(e,t,n){var r=e.pingCache;r!==null&&r.delete(t),e.pingedLanes|=e.suspendedLanes&n,e.warmLanes&=~n,dn===e&&(kt&n)===n&&(In===4||In===3&&(kt&62914560)===kt&&300>Ca()-dg?!(Qt&2)&&uc(e,0):c5|=n,oc===kt&&(oc=0)),qi(e)}function b6(e,t){t===0&&(t=cS()),e=Ll(e,t),e!==null&&(Cd(e,t),qi(e))}function lj(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),b6(e,n)}function uj(e,t){var n=0;switch(e.tag){case 31:case 13:var r=e.stateNode,a=e.memoizedState;a!==null&&(n=a.retryLane);break;case 19:r=e.stateNode;break;case 22:r=e.stateNode._retryCache;break;default:throw Error(Ee(314))}r!==null&&r.delete(t),b6(e,n)}function cj(e,t){return Ey(e,t)}var hm=null,vu=null,W2=!1,pm=!1,y1=!1,wo=0;function qi(e){e!==vu&&e.next===null&&(vu===null?hm=vu=e:vu=vu.next=e),pm=!0,W2||(W2=!0,dj())}function Rd(e,t){if(!y1&&pm){y1=!0;do for(var n=!1,r=hm;r!==null;){if(e!==0){var a=r.pendingLanes;if(a===0)var i=0;else{var s=r.suspendedLanes,o=r.pingedLanes;i=(1<<31-ja(42|e)+1)-1,i&=a&~(s&~o),i=i&201326741?i&201326741|1:i?i|2:0}i!==0&&(n=!0,kw(r,i))}else i=kt,i=tg(r,r===dn?i:0,r.cancelPendingCommit!==null||r.timeoutHandle!==-1),!(i&3)||Ed(r,i)||(n=!0,kw(r,i));r=r.next}while(n);y1=!1}}function fj(){w6()}function w6(){pm=W2=!1;var e=0;wo!==0&&Sj()&&(e=wo);for(var t=Ca(),n=null,r=hm;r!==null;){var a=r.next,i=x6(r,t);i===0?(r.next=null,n===null?hm=a:n.next=a,a===null&&(vu=n)):(n=r,(e!==0||i&3)&&(pm=!0)),r=a}ir!==0&&ir!==5||Rd(e),wo!==0&&(wo=0)}function x6(e,t){for(var n=e.suspendedLanes,r=e.pingedLanes,a=e.expirationTimes,i=e.pendingLanes&-62914561;0<i;){var s=31-ja(i),o=1<<s,l=a[s];l===-1?(!(o&n)||o&r)&&(a[s]=FC(o,t)):l<=t&&(e.expiredLanes|=o),i&=~o}if(t=dn,n=kt,n=tg(e,e===t?n:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),r=e.callbackNode,n===0||e===t&&(rn===2||rn===9)||e.cancelPendingCommit!==null)return r!==null&&r!==null&&Y0(r),e.callbackNode=null,e.callbackPriority=0;if(!(n&3)||Ed(e,n)){if(t=n&-n,t===e.callbackPriority)return t;switch(r!==null&&Y0(r),Ly(n)){case 2:case 8:n=lS;break;case 32:n=Kp;break;case 268435456:n=uS;break;default:n=Kp}return r=S6.bind(null,e),n=Ey(n,r),e.callbackPriority=t,e.callbackNode=n,t}return r!==null&&r!==null&&Y0(r),e.callbackPriority=2,e.callbackNode=null,2}function S6(e,t){if(ir!==0&&ir!==5)return e.callbackNode=null,e.callbackPriority=0,null;var n=e.callbackNode;if(mg()&&e.callbackNode!==n)return null;var r=kt;return r=tg(e,e===dn?r:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),r===0?null:(o6(e,r,t),x6(e,Ca()),e.callbackNode!=null&&e.callbackNode===n?S6.bind(null,e):null)}function kw(e,t){if(mg())return null;o6(e,t,!0)}function dj(){Aj(function(){Qt&6?Ey(oS,fj):w6()})}function d5(){if(wo===0){var e=ac;e===0&&(e=Ph,Ph<<=1,!(Ph&261888)&&(Ph=256)),wo=e}return wo}function Pw(e){return e==null||typeof e=="symbol"||typeof e=="boolean"?null:typeof e=="function"?e:bp(""+e)}function Iw(e,t){var n=t.ownerDocument.createElement("input");return n.name=t.name,n.value=t.value,e.id&&n.setAttribute("form",e.id),t.parentNode.insertBefore(n,t),e=new FormData(e),n.parentNode.removeChild(n),e}function hj(e,t,n,r,a){if(t==="submit"&&n&&n.stateNode===a){var i=Pw((a[la]||null).action),s=r.submitter;s&&(t=(t=s[la]||null)?Pw(t.formAction):s.getAttribute("formAction"),t!==null&&(i=t,s=null));var o=new ng("action","action",null,r,a);e.push({event:o,listeners:[{instance:null,listener:function(){if(r.defaultPrevented){if(wo!==0){var l=s?Iw(a,s):new FormData(a);F2(n,{pending:!0,data:l,method:a.method,action:i},null,l)}}else typeof i=="function"&&(o.preventDefault(),l=s?Iw(a,s):new FormData(a),F2(n,{pending:!0,data:l,method:a.method,action:i},i,l))},currentTarget:a}]})}}for(var b1=0;b1<E2.length;b1++){var w1=E2[b1],pj=w1.toLowerCase(),mj=w1[0].toUpperCase()+w1.slice(1);bi(pj,"on"+mj)}bi(MS,"onAnimationEnd");bi(kS,"onAnimationIteration");bi(PS,"onAnimationStart");bi("dblclick","onDoubleClick");bi("focusin","onFocus");bi("focusout","onBlur");bi(OL,"onTransitionRun");bi(DL,"onTransitionStart");bi(RL,"onTransitionCancel");bi(IS,"onTransitionEnd");nc("onMouseEnter",["mouseout","mouseover"]);nc("onMouseLeave",["mouseout","mouseover"]);nc("onPointerEnter",["pointerout","pointerover"]);nc("onPointerLeave",["pointerout","pointerover"]);Nl("onChange","change click focusin focusout input keydown keyup selectionchange".split(" "));Nl("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" "));Nl("onBeforeInput",["compositionend","keypress","textInput","paste"]);Nl("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" "));Nl("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" "));Nl("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var ad="abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange resize seeked seeking stalled suspend timeupdate volumechange waiting".split(" "),gj=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(ad));function _6(e,t){t=(t&4)!==0;for(var n=0;n<e.length;n++){var r=e[n],a=r.event;r=r.listeners;e:{var i=void 0;if(t)for(var s=r.length-1;0<=s;s--){var o=r[s],l=o.instance,u=o.currentTarget;if(o=o.listener,l!==i&&a.isPropagationStopped())break e;i=o,a.currentTarget=u;try{i(a)}catch(c){Qp(c)}a.currentTarget=null,i=l}else for(s=0;s<r.length;s++){if(o=r[s],l=o.instance,u=o.currentTarget,o=o.listener,l!==i&&a.isPropagationStopped())break e;i=o,a.currentTarget=u;try{i(a)}catch(c){Qp(c)}a.currentTarget=null,i=l}}}}function Ot(e,t){var n=t[y2];n===void 0&&(n=t[y2]=new Set);var r=e+"__bubble";n.has(r)||(A6(t,e,2,!1),n.add(r))}function x1(e,t,n){var r=0;t&&(r|=4),A6(n,e,r,t)}var Yh="_reactListening"+Math.random().toString(36).slice(2);function h5(e){if(!e[Yh]){e[Yh]=!0,mS.forEach(function(n){n!=="selectionchange"&&(gj.has(n)||x1(n,!1,e),x1(n,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[Yh]||(t[Yh]=!0,x1("selectionchange",!1,t))}}function A6(e,t,n,r){switch(I6(t)){case 2:var a=Hj;break;case 8:a=Vj;break;default:a=v5}n=a.bind(null,t,n,e),a=void 0,!_2||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(a=!0),r?a!==void 0?e.addEventListener(t,n,{capture:!0,passive:a}):e.addEventListener(t,n,!0):a!==void 0?e.addEventListener(t,n,{passive:a}):e.addEventListener(t,n,!1)}function S1(e,t,n,r,a){var i=r;if(!(t&1)&&!(t&2)&&r!==null)e:for(;;){if(r===null)return;var s=r.tag;if(s===3||s===4){var o=r.stateNode.containerInfo;if(o===a)break;if(s===4)for(s=r.return;s!==null;){var l=s.tag;if((l===3||l===4)&&s.stateNode.containerInfo===a)return;s=s.return}for(;o!==null;){if(s=Au(o),s===null)return;if(l=s.tag,l===5||l===6||l===26||l===27){r=i=s;continue e}o=o.parentNode}}r=r.return}_S(function(){var u=i,c=Oy(n),f=[];e:{var p=FS.get(e);if(p!==void 0){var d=ng,v=e;switch(e){case"keypress":if(xp(n)===0)break e;case"keydown":case"keyup":d=uL;break;case"focusin":v="focus",d=X0;break;case"focusout":v="blur",d=X0;break;case"beforeblur":case"afterblur":d=X0;break;case"click":if(n.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":d=Vb;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":d=XC;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":d=dL;break;case MS:case kS:case PS:d=eL;break;case IS:d=pL;break;case"scroll":case"scrollend":d=JC;break;case"wheel":d=gL;break;case"copy":case"cut":case"paste":d=nL;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":d=Gb;break;case"toggle":case"beforetoggle":d=yL}var S=(t&4)!==0,x=!S&&(e==="scroll"||e==="scrollend"),g=S?p!==null?p+"Capture":null:p;S=[];for(var y=u,_;y!==null;){var E=y;if(_=E.stateNode,E=E.tag,E!==5&&E!==26&&E!==27||_===null||g===null||(E=Kf(y,g),E!=null&&S.push(id(y,E,_))),x)break;y=y.return}0<S.length&&(p=new d(p,v,null,n,c),f.push({event:p,listeners:S}))}}if(!(t&7)){e:{if(p=e==="mouseover"||e==="pointerover",d=e==="mouseout"||e==="pointerout",p&&n!==S2&&(v=n.relatedTarget||n.fromElement)&&(Au(v)||v[vc]))break e;if((d||p)&&(p=c.window===c?c:(p=c.ownerDocument)?p.defaultView||p.parentWindow:window,d?(v=n.relatedTarget||n.toElement,d=u,v=v?Au(v):null,v!==null&&(x=Ad(v),S=v.tag,v!==x||S!==5&&S!==27&&S!==6)&&(v=null)):(d=null,v=u),d!==v)){if(S=Vb,E="onMouseLeave",g="onMouseEnter",y="mouse",(e==="pointerout"||e==="pointerover")&&(S=Gb,E="onPointerLeave",g="onPointerEnter",y="pointer"),x=d==null?p:_f(d),_=v==null?p:_f(v),p=new S(E,y+"leave",d,n,c),p.target=x,p.relatedTarget=_,E=null,Au(c)===u&&(S=new S(g,y+"enter",v,n,c),S.target=_,S.relatedTarget=x,E=S),x=E,d&&v)t:{for(S=vj,g=d,y=v,_=0,E=g;E;E=S(E))_++;E=0;for(var D=y;D;D=S(D))E++;for(;0<_-E;)g=S(g),_--;for(;0<E-_;)y=S(y),E--;for(;_--;){if(g===y||y!==null&&g===y.alternate){S=g;break t}g=S(g),y=S(y)}S=null}else S=null;d!==null&&Fw(f,p,d,S,!1),v!==null&&x!==null&&Fw(f,x,v,S,!0)}}e:{if(p=u?_f(u):window,d=p.nodeName&&p.nodeName.toLowerCase(),d==="select"||d==="input"&&p.type==="file")var R=Xb;else if(Kb(p))if(jS)R=LL;else{R=EL;var O=NL}else d=p.nodeName,!d||d.toLowerCase()!=="input"||p.type!=="checkbox"&&p.type!=="radio"?u&&Ty(u.elementType)&&(R=Xb):R=CL;if(R&&(R=R(e,u))){LS(f,R,n,c);break e}O&&O(e,p,u),e==="focusout"&&u&&p.type==="number"&&u.memoizedProps.value!=null&&x2(p,"number",p.value)}switch(O=u?_f(u):window,e){case"focusin":(Kb(O)||O.contentEditable==="true")&&(Cu=O,A2=u,Df=null);break;case"focusout":Df=A2=Cu=null;break;case"mousedown":N2=!0;break;case"contextmenu":case"mouseup":case"dragend":N2=!1,nw(f,n,c);break;case"selectionchange":if(TL)break;case"keydown":case"keyup":nw(f,n,c)}var j;if(My)e:{switch(e){case"compositionstart":var $="onCompositionStart";break e;case"compositionend":$="onCompositionEnd";break e;case"compositionupdate":$="onCompositionUpdate";break e}$=void 0}else Eu?ES(e,n)&&($="onCompositionEnd"):e==="keydown"&&n.keyCode===229&&($="onCompositionStart");$&&(NS&&n.locale!=="ko"&&(Eu||$!=="onCompositionStart"?$==="onCompositionEnd"&&Eu&&(j=AS()):(vo=c,Dy="value"in vo?vo.value:vo.textContent,Eu=!0)),O=mm(u,$),0<O.length&&($=new Yb($,e,null,n,c),f.push({event:$,listeners:O}),j?$.data=j:(j=CS(n),j!==null&&($.data=j)))),(j=wL?xL(e,n):SL(e,n))&&($=mm(u,"onBeforeInput"),0<$.length&&(O=new Yb("onBeforeInput","beforeinput",null,n,c),f.push({event:O,listeners:$}),O.data=j)),hj(f,e,u,n,c)}_6(f,t)})}function id(e,t,n){return{instance:e,listener:t,currentTarget:n}}function mm(e,t){for(var n=t+"Capture",r=[];e!==null;){var a=e,i=a.stateNode;if(a=a.tag,a!==5&&a!==26&&a!==27||i===null||(a=Kf(e,n),a!=null&&r.unshift(id(e,a,i)),a=Kf(e,t),a!=null&&r.push(id(e,a,i))),e.tag===3)return r;e=e.return}return[]}function vj(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function Fw(e,t,n,r,a){for(var i=t._reactName,s=[];n!==null&&n!==r;){var o=n,l=o.alternate,u=o.stateNode;if(o=o.tag,l!==null&&l===r)break;o!==5&&o!==26&&o!==27||u===null||(l=u,a?(u=Kf(n,i),u!=null&&s.unshift(id(n,u,l))):a||(u=Kf(n,i),u!=null&&s.push(id(n,u,l)))),n=n.return}s.length!==0&&e.push({event:t,listeners:s})}var yj=/\r\n?/g,bj=/\u0000|\uFFFD/g;function Bw(e){return(typeof e=="string"?e:""+e).replace(yj,`
49
+ `).replace(bj,"")}function N6(e,t){return t=Bw(t),Bw(e)===t}function ln(e,t,n,r,a,i){switch(n){case"children":typeof r=="string"?t==="body"||t==="textarea"&&r===""||rc(e,r):(typeof r=="number"||typeof r=="bigint")&&t!=="body"&&rc(e,""+r);break;case"className":Bh(e,"class",r);break;case"tabIndex":Bh(e,"tabindex",r);break;case"dir":case"role":case"viewBox":case"width":case"height":Bh(e,n,r);break;case"style":SS(e,r,i);break;case"data":if(t!=="object"){Bh(e,"data",r);break}case"src":case"href":if(r===""&&(t!=="a"||n!=="href")){e.removeAttribute(n);break}if(r==null||typeof r=="function"||typeof r=="symbol"||typeof r=="boolean"){e.removeAttribute(n);break}r=bp(""+r),e.setAttribute(n,r);break;case"action":case"formAction":if(typeof r=="function"){e.setAttribute(n,"javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')");break}else typeof i=="function"&&(n==="formAction"?(t!=="input"&&ln(e,t,"name",a.name,a,null),ln(e,t,"formEncType",a.formEncType,a,null),ln(e,t,"formMethod",a.formMethod,a,null),ln(e,t,"formTarget",a.formTarget,a,null)):(ln(e,t,"encType",a.encType,a,null),ln(e,t,"method",a.method,a,null),ln(e,t,"target",a.target,a,null)));if(r==null||typeof r=="symbol"||typeof r=="boolean"){e.removeAttribute(n);break}r=bp(""+r),e.setAttribute(n,r);break;case"onClick":r!=null&&(e.onclick=ms);break;case"onScroll":r!=null&&Ot("scroll",e);break;case"onScrollEnd":r!=null&&Ot("scrollend",e);break;case"dangerouslySetInnerHTML":if(r!=null){if(typeof r!="object"||!("__html"in r))throw Error(Ee(61));if(n=r.__html,n!=null){if(a.children!=null)throw Error(Ee(60));e.innerHTML=n}}break;case"multiple":e.multiple=r&&typeof r!="function"&&typeof r!="symbol";break;case"muted":e.muted=r&&typeof r!="function"&&typeof r!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(r==null||typeof r=="function"||typeof r=="boolean"||typeof r=="symbol"){e.removeAttribute("xlink:href");break}n=bp(""+r),e.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",n);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":r!=null&&typeof r!="function"&&typeof r!="symbol"?e.setAttribute(n,""+r):e.removeAttribute(n);break;case"inert":case"allowFullScreen":case"async":case"autoPlay":case"controls":case"default":case"defer":case"disabled":case"disablePictureInPicture":case"disableRemotePlayback":case"formNoValidate":case"hidden":case"loop":case"noModule":case"noValidate":case"open":case"playsInline":case"readOnly":case"required":case"reversed":case"scoped":case"seamless":case"itemScope":r&&typeof r!="function"&&typeof r!="symbol"?e.setAttribute(n,""):e.removeAttribute(n);break;case"capture":case"download":r===!0?e.setAttribute(n,""):r!==!1&&r!=null&&typeof r!="function"&&typeof r!="symbol"?e.setAttribute(n,r):e.removeAttribute(n);break;case"cols":case"rows":case"size":case"span":r!=null&&typeof r!="function"&&typeof r!="symbol"&&!isNaN(r)&&1<=r?e.setAttribute(n,r):e.removeAttribute(n);break;case"rowSpan":case"start":r==null||typeof r=="function"||typeof r=="symbol"||isNaN(r)?e.removeAttribute(n):e.setAttribute(n,r);break;case"popover":Ot("beforetoggle",e),Ot("toggle",e),yp(e,"popover",r);break;case"xlinkActuate":rs(e,"http://www.w3.org/1999/xlink","xlink:actuate",r);break;case"xlinkArcrole":rs(e,"http://www.w3.org/1999/xlink","xlink:arcrole",r);break;case"xlinkRole":rs(e,"http://www.w3.org/1999/xlink","xlink:role",r);break;case"xlinkShow":rs(e,"http://www.w3.org/1999/xlink","xlink:show",r);break;case"xlinkTitle":rs(e,"http://www.w3.org/1999/xlink","xlink:title",r);break;case"xlinkType":rs(e,"http://www.w3.org/1999/xlink","xlink:type",r);break;case"xmlBase":rs(e,"http://www.w3.org/XML/1998/namespace","xml:base",r);break;case"xmlLang":rs(e,"http://www.w3.org/XML/1998/namespace","xml:lang",r);break;case"xmlSpace":rs(e,"http://www.w3.org/XML/1998/namespace","xml:space",r);break;case"is":yp(e,"is",r);break;case"innerText":case"textContent":break;default:(!(2<n.length)||n[0]!=="o"&&n[0]!=="O"||n[1]!=="n"&&n[1]!=="N")&&(n=GC.get(n)||n,yp(e,n,r))}}function J2(e,t,n,r,a,i){switch(n){case"style":SS(e,r,i);break;case"dangerouslySetInnerHTML":if(r!=null){if(typeof r!="object"||!("__html"in r))throw Error(Ee(61));if(n=r.__html,n!=null){if(a.children!=null)throw Error(Ee(60));e.innerHTML=n}}break;case"children":typeof r=="string"?rc(e,r):(typeof r=="number"||typeof r=="bigint")&&rc(e,""+r);break;case"onScroll":r!=null&&Ot("scroll",e);break;case"onScrollEnd":r!=null&&Ot("scrollend",e);break;case"onClick":r!=null&&(e.onclick=ms);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!gS.hasOwnProperty(n))e:{if(n[0]==="o"&&n[1]==="n"&&(a=n.endsWith("Capture"),t=n.slice(2,a?n.length-7:void 0),i=e[la]||null,i=i!=null?i[n]:null,typeof i=="function"&&e.removeEventListener(t,i,a),typeof r=="function")){typeof i!="function"&&i!==null&&(n in e?e[n]=null:e.hasAttribute(n)&&e.removeAttribute(n)),e.addEventListener(t,r,a);break e}n in e?e[n]=r:r===!0?e.setAttribute(n,""):yp(e,n,r)}}}function Er(e,t,n){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":Ot("error",e),Ot("load",e);var r=!1,a=!1,i;for(i in n)if(n.hasOwnProperty(i)){var s=n[i];if(s!=null)switch(i){case"src":r=!0;break;case"srcSet":a=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(Ee(137,t));default:ln(e,t,i,s,n,null)}}a&&ln(e,t,"srcSet",n.srcSet,n,null),r&&ln(e,t,"src",n.src,n,null);return;case"input":Ot("invalid",e);var o=i=s=a=null,l=null,u=null;for(r in n)if(n.hasOwnProperty(r)){var c=n[r];if(c!=null)switch(r){case"name":a=c;break;case"type":s=c;break;case"checked":l=c;break;case"defaultChecked":u=c;break;case"value":i=c;break;case"defaultValue":o=c;break;case"children":case"dangerouslySetInnerHTML":if(c!=null)throw Error(Ee(137,t));break;default:ln(e,t,r,c,n,null)}}bS(e,i,o,l,u,s,a,!1);return;case"select":Ot("invalid",e),r=s=i=null;for(a in n)if(n.hasOwnProperty(a)&&(o=n[a],o!=null))switch(a){case"value":i=o;break;case"defaultValue":s=o;break;case"multiple":r=o;default:ln(e,t,a,o,n,null)}t=i,n=s,e.multiple=!!r,t!=null?Pu(e,!!r,t,!1):n!=null&&Pu(e,!!r,n,!0);return;case"textarea":Ot("invalid",e),i=a=r=null;for(s in n)if(n.hasOwnProperty(s)&&(o=n[s],o!=null))switch(s){case"value":r=o;break;case"defaultValue":a=o;break;case"children":i=o;break;case"dangerouslySetInnerHTML":if(o!=null)throw Error(Ee(91));break;default:ln(e,t,s,o,n,null)}xS(e,r,a,i);return;case"option":for(l in n)if(n.hasOwnProperty(l)&&(r=n[l],r!=null))switch(l){case"selected":e.selected=r&&typeof r!="function"&&typeof r!="symbol";break;default:ln(e,t,l,r,n,null)}return;case"dialog":Ot("beforetoggle",e),Ot("toggle",e),Ot("cancel",e),Ot("close",e);break;case"iframe":case"object":Ot("load",e);break;case"video":case"audio":for(r=0;r<ad.length;r++)Ot(ad[r],e);break;case"image":Ot("error",e),Ot("load",e);break;case"details":Ot("toggle",e);break;case"embed":case"source":case"link":Ot("error",e),Ot("load",e);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(u in n)if(n.hasOwnProperty(u)&&(r=n[u],r!=null))switch(u){case"children":case"dangerouslySetInnerHTML":throw Error(Ee(137,t));default:ln(e,t,u,r,n,null)}return;default:if(Ty(t)){for(c in n)n.hasOwnProperty(c)&&(r=n[c],r!==void 0&&J2(e,t,c,r,n,void 0));return}}for(o in n)n.hasOwnProperty(o)&&(r=n[o],r!=null&&ln(e,t,o,r,n,null))}function wj(e,t,n,r){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var a=null,i=null,s=null,o=null,l=null,u=null,c=null;for(d in n){var f=n[d];if(n.hasOwnProperty(d)&&f!=null)switch(d){case"checked":break;case"value":break;case"defaultValue":l=f;default:r.hasOwnProperty(d)||ln(e,t,d,null,r,f)}}for(var p in r){var d=r[p];if(f=n[p],r.hasOwnProperty(p)&&(d!=null||f!=null))switch(p){case"type":i=d;break;case"name":a=d;break;case"checked":u=d;break;case"defaultChecked":c=d;break;case"value":s=d;break;case"defaultValue":o=d;break;case"children":case"dangerouslySetInnerHTML":if(d!=null)throw Error(Ee(137,t));break;default:d!==f&&ln(e,t,p,d,r,f)}}w2(e,s,o,l,u,c,i,a);return;case"select":d=s=o=p=null;for(i in n)if(l=n[i],n.hasOwnProperty(i)&&l!=null)switch(i){case"value":break;case"multiple":d=l;default:r.hasOwnProperty(i)||ln(e,t,i,null,r,l)}for(a in r)if(i=r[a],l=n[a],r.hasOwnProperty(a)&&(i!=null||l!=null))switch(a){case"value":p=i;break;case"defaultValue":o=i;break;case"multiple":s=i;default:i!==l&&ln(e,t,a,i,r,l)}t=o,n=s,r=d,p!=null?Pu(e,!!n,p,!1):!!r!=!!n&&(t!=null?Pu(e,!!n,t,!0):Pu(e,!!n,n?[]:"",!1));return;case"textarea":d=p=null;for(o in n)if(a=n[o],n.hasOwnProperty(o)&&a!=null&&!r.hasOwnProperty(o))switch(o){case"value":break;case"children":break;default:ln(e,t,o,null,r,a)}for(s in r)if(a=r[s],i=n[s],r.hasOwnProperty(s)&&(a!=null||i!=null))switch(s){case"value":p=a;break;case"defaultValue":d=a;break;case"children":break;case"dangerouslySetInnerHTML":if(a!=null)throw Error(Ee(91));break;default:a!==i&&ln(e,t,s,a,r,i)}wS(e,p,d);return;case"option":for(var v in n)if(p=n[v],n.hasOwnProperty(v)&&p!=null&&!r.hasOwnProperty(v))switch(v){case"selected":e.selected=!1;break;default:ln(e,t,v,null,r,p)}for(l in r)if(p=r[l],d=n[l],r.hasOwnProperty(l)&&p!==d&&(p!=null||d!=null))switch(l){case"selected":e.selected=p&&typeof p!="function"&&typeof p!="symbol";break;default:ln(e,t,l,p,r,d)}return;case"img":case"link":case"area":case"base":case"br":case"col":case"embed":case"hr":case"keygen":case"meta":case"param":case"source":case"track":case"wbr":case"menuitem":for(var S in n)p=n[S],n.hasOwnProperty(S)&&p!=null&&!r.hasOwnProperty(S)&&ln(e,t,S,null,r,p);for(u in r)if(p=r[u],d=n[u],r.hasOwnProperty(u)&&p!==d&&(p!=null||d!=null))switch(u){case"children":case"dangerouslySetInnerHTML":if(p!=null)throw Error(Ee(137,t));break;default:ln(e,t,u,p,r,d)}return;default:if(Ty(t)){for(var x in n)p=n[x],n.hasOwnProperty(x)&&p!==void 0&&!r.hasOwnProperty(x)&&J2(e,t,x,void 0,r,p);for(c in r)p=r[c],d=n[c],!r.hasOwnProperty(c)||p===d||p===void 0&&d===void 0||J2(e,t,c,p,r,d);return}}for(var g in n)p=n[g],n.hasOwnProperty(g)&&p!=null&&!r.hasOwnProperty(g)&&ln(e,t,g,null,r,p);for(f in r)p=r[f],d=n[f],!r.hasOwnProperty(f)||p===d||p==null&&d==null||ln(e,t,f,p,r,d)}function $w(e){switch(e){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function xj(){if(typeof performance.getEntriesByType=="function"){for(var e=0,t=0,n=performance.getEntriesByType("resource"),r=0;r<n.length;r++){var a=n[r],i=a.transferSize,s=a.initiatorType,o=a.duration;if(i&&o&&$w(s)){for(s=0,o=a.responseEnd,r+=1;r<n.length;r++){var l=n[r],u=l.startTime;if(u>o)break;var c=l.transferSize,f=l.initiatorType;c&&$w(f)&&(l=l.responseEnd,s+=c*(l<o?1:(o-u)/(l-u)))}if(--r,t+=8*(i+s)/(a.duration/1e3),e++,10<e)break}}if(0<e)return t/e/1e6}return navigator.connection&&(e=navigator.connection.downlink,typeof e=="number")?e:5}var K2=null,X2=null;function gm(e){return e.nodeType===9?e:e.ownerDocument}function Uw(e){switch(e){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function E6(e,t){if(e===0)switch(t){case"svg":return 1;case"math":return 2;default:return 0}return e===1&&t==="foreignObject"?0:e}function Q2(e,t){return e==="textarea"||e==="noscript"||typeof t.children=="string"||typeof t.children=="number"||typeof t.children=="bigint"||typeof t.dangerouslySetInnerHTML=="object"&&t.dangerouslySetInnerHTML!==null&&t.dangerouslySetInnerHTML.__html!=null}var _1=null;function Sj(){var e=window.event;return e&&e.type==="popstate"?e===_1?!1:(_1=e,!0):(_1=null,!1)}var C6=typeof setTimeout=="function"?setTimeout:void 0,_j=typeof clearTimeout=="function"?clearTimeout:void 0,zw=typeof Promise=="function"?Promise:void 0,Aj=typeof queueMicrotask=="function"?queueMicrotask:typeof zw<"u"?function(e){return zw.resolve(null).then(e).catch(Nj)}:C6;function Nj(e){setTimeout(function(){throw e})}function Bo(e){return e==="head"}function qw(e,t){var n=t,r=0;do{var a=n.nextSibling;if(e.removeChild(n),a&&a.nodeType===8)if(n=a.data,n==="/$"||n==="/&"){if(r===0){e.removeChild(a),fc(t);return}r--}else if(n==="$"||n==="$?"||n==="$~"||n==="$!"||n==="&")r++;else if(n==="html")zf(e.ownerDocument.documentElement);else if(n==="head"){n=e.ownerDocument.head,zf(n);for(var i=n.firstChild;i;){var s=i.nextSibling,o=i.nodeName;i[Ld]||o==="SCRIPT"||o==="STYLE"||o==="LINK"&&i.rel.toLowerCase()==="stylesheet"||n.removeChild(i),i=s}}else n==="body"&&zf(e.ownerDocument.body);n=a}while(n);fc(t)}function Hw(e,t){var n=e;e=0;do{var r=n.nextSibling;if(n.nodeType===1?t?(n._stashedDisplay=n.style.display,n.style.display="none"):(n.style.display=n._stashedDisplay||"",n.getAttribute("style")===""&&n.removeAttribute("style")):n.nodeType===3&&(t?(n._stashedText=n.nodeValue,n.nodeValue=""):n.nodeValue=n._stashedText||""),r&&r.nodeType===8)if(n=r.data,n==="/$"){if(e===0)break;e--}else n!=="$"&&n!=="$?"&&n!=="$~"&&n!=="$!"||e++;n=r}while(n)}function Z2(e){var t=e.firstChild;for(t&&t.nodeType===10&&(t=t.nextSibling);t;){var n=t;switch(t=t.nextSibling,n.nodeName){case"HTML":case"HEAD":case"BODY":Z2(n),jy(n);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(n.rel.toLowerCase()==="stylesheet")continue}e.removeChild(n)}}function Ej(e,t,n,r){for(;e.nodeType===1;){var a=n;if(e.nodeName.toLowerCase()!==t.toLowerCase()){if(!r&&(e.nodeName!=="INPUT"||e.type!=="hidden"))break}else if(r){if(!e[Ld])switch(t){case"meta":if(!e.hasAttribute("itemprop"))break;return e;case"link":if(i=e.getAttribute("rel"),i==="stylesheet"&&e.hasAttribute("data-precedence"))break;if(i!==a.rel||e.getAttribute("href")!==(a.href==null||a.href===""?null:a.href)||e.getAttribute("crossorigin")!==(a.crossOrigin==null?null:a.crossOrigin)||e.getAttribute("title")!==(a.title==null?null:a.title))break;return e;case"style":if(e.hasAttribute("data-precedence"))break;return e;case"script":if(i=e.getAttribute("src"),(i!==(a.src==null?null:a.src)||e.getAttribute("type")!==(a.type==null?null:a.type)||e.getAttribute("crossorigin")!==(a.crossOrigin==null?null:a.crossOrigin))&&i&&e.hasAttribute("async")&&!e.hasAttribute("itemprop"))break;return e;default:return e}}else if(t==="input"&&e.type==="hidden"){var i=a.name==null?null:""+a.name;if(a.type==="hidden"&&e.getAttribute("name")===i)return e}else return e;if(e=ti(e.nextSibling),e===null)break}return null}function Cj(e,t,n){if(t==="")return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!n||(e=ti(e.nextSibling),e===null))return null;return e}function L6(e,t){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!t||(e=ti(e.nextSibling),e===null))return null;return e}function ev(e){return e.data==="$?"||e.data==="$~"}function tv(e){return e.data==="$!"||e.data==="$?"&&e.ownerDocument.readyState!=="loading"}function Lj(e,t){var n=e.ownerDocument;if(e.data==="$~")e._reactRetry=t;else if(e.data!=="$?"||n.readyState!=="loading")t();else{var r=function(){t(),n.removeEventListener("DOMContentLoaded",r)};n.addEventListener("DOMContentLoaded",r),e._reactRetry=r}}function ti(e){for(;e!=null;e=e.nextSibling){var t=e.nodeType;if(t===1||t===3)break;if(t===8){if(t=e.data,t==="$"||t==="$!"||t==="$?"||t==="$~"||t==="&"||t==="F!"||t==="F")break;if(t==="/$"||t==="/&")return null}}return e}var nv=null;function Vw(e){e=e.nextSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="/$"||n==="/&"){if(t===0)return ti(e.nextSibling);t--}else n!=="$"&&n!=="$!"&&n!=="$?"&&n!=="$~"&&n!=="&"||t++}e=e.nextSibling}return null}function Yw(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="$"||n==="$!"||n==="$?"||n==="$~"||n==="&"){if(t===0)return e;t--}else n!=="/$"&&n!=="/&"||t++}e=e.previousSibling}return null}function j6(e,t,n){switch(t=gm(n),e){case"html":if(e=t.documentElement,!e)throw Error(Ee(452));return e;case"head":if(e=t.head,!e)throw Error(Ee(453));return e;case"body":if(e=t.body,!e)throw Error(Ee(454));return e;default:throw Error(Ee(451))}}function zf(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);jy(e)}var ri=new Map,Gw=new Set;function vm(e){return typeof e.getRootNode=="function"?e.getRootNode():e.nodeType===9?e:e.ownerDocument}var Ds=Zt.d;Zt.d={f:jj,r:Tj,D:Oj,C:Dj,L:Rj,m:Mj,X:Pj,S:kj,M:Ij};function jj(){var e=Ds.f(),t=hg();return e||t}function Tj(e){var t=yc(e);t!==null&&t.tag===5&&t.type==="form"?S_(t):Ds.r(e)}var Sc=typeof document>"u"?null:document;function T6(e,t,n){var r=Sc;if(r&&typeof t=="string"&&t){var a=Xa(t);a='link[rel="'+e+'"][href="'+a+'"]',typeof n=="string"&&(a+='[crossorigin="'+n+'"]'),Gw.has(a)||(Gw.add(a),e={rel:e,crossOrigin:n,href:t},r.querySelector(a)===null&&(t=r.createElement("link"),Er(t,"link",e),mr(t),r.head.appendChild(t)))}}function Oj(e){Ds.D(e),T6("dns-prefetch",e,null)}function Dj(e,t){Ds.C(e,t),T6("preconnect",e,t)}function Rj(e,t,n){Ds.L(e,t,n);var r=Sc;if(r&&e&&t){var a='link[rel="preload"][as="'+Xa(t)+'"]';t==="image"&&n&&n.imageSrcSet?(a+='[imagesrcset="'+Xa(n.imageSrcSet)+'"]',typeof n.imageSizes=="string"&&(a+='[imagesizes="'+Xa(n.imageSizes)+'"]')):a+='[href="'+Xa(e)+'"]';var i=a;switch(t){case"style":i=cc(e);break;case"script":i=_c(e)}ri.has(i)||(e=En({rel:"preload",href:t==="image"&&n&&n.imageSrcSet?void 0:e,as:t},n),ri.set(i,e),r.querySelector(a)!==null||t==="style"&&r.querySelector(Md(i))||t==="script"&&r.querySelector(kd(i))||(t=r.createElement("link"),Er(t,"link",e),mr(t),r.head.appendChild(t)))}}function Mj(e,t){Ds.m(e,t);var n=Sc;if(n&&e){var r=t&&typeof t.as=="string"?t.as:"script",a='link[rel="modulepreload"][as="'+Xa(r)+'"][href="'+Xa(e)+'"]',i=a;switch(r){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":i=_c(e)}if(!ri.has(i)&&(e=En({rel:"modulepreload",href:e},t),ri.set(i,e),n.querySelector(a)===null)){switch(r){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(n.querySelector(kd(i)))return}r=n.createElement("link"),Er(r,"link",e),mr(r),n.head.appendChild(r)}}}function kj(e,t,n){Ds.S(e,t,n);var r=Sc;if(r&&e){var a=ku(r).hoistableStyles,i=cc(e);t=t||"default";var s=a.get(i);if(!s){var o={loading:0,preload:null};if(s=r.querySelector(Md(i)))o.loading=5;else{e=En({rel:"stylesheet",href:e,"data-precedence":t},n),(n=ri.get(i))&&p5(e,n);var l=s=r.createElement("link");mr(l),Er(l,"link",e),l._p=new Promise(function(u,c){l.onload=u,l.onerror=c}),l.addEventListener("load",function(){o.loading|=1}),l.addEventListener("error",function(){o.loading|=2}),o.loading|=4,jp(s,t,r)}s={type:"stylesheet",instance:s,count:1,state:o},a.set(i,s)}}}function Pj(e,t){Ds.X(e,t);var n=Sc;if(n&&e){var r=ku(n).hoistableScripts,a=_c(e),i=r.get(a);i||(i=n.querySelector(kd(a)),i||(e=En({src:e,async:!0},t),(t=ri.get(a))&&m5(e,t),i=n.createElement("script"),mr(i),Er(i,"link",e),n.head.appendChild(i)),i={type:"script",instance:i,count:1,state:null},r.set(a,i))}}function Ij(e,t){Ds.M(e,t);var n=Sc;if(n&&e){var r=ku(n).hoistableScripts,a=_c(e),i=r.get(a);i||(i=n.querySelector(kd(a)),i||(e=En({src:e,async:!0,type:"module"},t),(t=ri.get(a))&&m5(e,t),i=n.createElement("script"),mr(i),Er(i,"link",e),n.head.appendChild(i)),i={type:"script",instance:i,count:1,state:null},r.set(a,i))}}function Ww(e,t,n,r){var a=(a=So.current)?vm(a):null;if(!a)throw Error(Ee(446));switch(e){case"meta":case"title":return null;case"style":return typeof n.precedence=="string"&&typeof n.href=="string"?(t=cc(n.href),n=ku(a).hoistableStyles,r=n.get(t),r||(r={type:"style",instance:null,count:0,state:null},n.set(t,r)),r):{type:"void",instance:null,count:0,state:null};case"link":if(n.rel==="stylesheet"&&typeof n.href=="string"&&typeof n.precedence=="string"){e=cc(n.href);var i=ku(a).hoistableStyles,s=i.get(e);if(s||(a=a.ownerDocument||a,s={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},i.set(e,s),(i=a.querySelector(Md(e)))&&!i._p&&(s.instance=i,s.state.loading=5),ri.has(e)||(n={rel:"preload",as:"style",href:n.href,crossOrigin:n.crossOrigin,integrity:n.integrity,media:n.media,hrefLang:n.hrefLang,referrerPolicy:n.referrerPolicy},ri.set(e,n),i||Fj(a,e,n,s.state))),t&&r===null)throw Error(Ee(528,""));return s}if(t&&r!==null)throw Error(Ee(529,""));return null;case"script":return t=n.async,n=n.src,typeof n=="string"&&t&&typeof t!="function"&&typeof t!="symbol"?(t=_c(n),n=ku(a).hoistableScripts,r=n.get(t),r||(r={type:"script",instance:null,count:0,state:null},n.set(t,r)),r):{type:"void",instance:null,count:0,state:null};default:throw Error(Ee(444,e))}}function cc(e){return'href="'+Xa(e)+'"'}function Md(e){return'link[rel="stylesheet"]['+e+"]"}function O6(e){return En({},e,{"data-precedence":e.precedence,precedence:null})}function Fj(e,t,n,r){e.querySelector('link[rel="preload"][as="style"]['+t+"]")?r.loading=1:(t=e.createElement("link"),r.preload=t,t.addEventListener("load",function(){return r.loading|=1}),t.addEventListener("error",function(){return r.loading|=2}),Er(t,"link",n),mr(t),e.head.appendChild(t))}function _c(e){return'[src="'+Xa(e)+'"]'}function kd(e){return"script[async]"+e}function Jw(e,t,n){if(t.count++,t.instance===null)switch(t.type){case"style":var r=e.querySelector('style[data-href~="'+Xa(n.href)+'"]');if(r)return t.instance=r,mr(r),r;var a=En({},n,{"data-href":n.href,"data-precedence":n.precedence,href:null,precedence:null});return r=(e.ownerDocument||e).createElement("style"),mr(r),Er(r,"style",a),jp(r,n.precedence,e),t.instance=r;case"stylesheet":a=cc(n.href);var i=e.querySelector(Md(a));if(i)return t.state.loading|=4,t.instance=i,mr(i),i;r=O6(n),(a=ri.get(a))&&p5(r,a),i=(e.ownerDocument||e).createElement("link"),mr(i);var s=i;return s._p=new Promise(function(o,l){s.onload=o,s.onerror=l}),Er(i,"link",r),t.state.loading|=4,jp(i,n.precedence,e),t.instance=i;case"script":return i=_c(n.src),(a=e.querySelector(kd(i)))?(t.instance=a,mr(a),a):(r=n,(a=ri.get(i))&&(r=En({},n),m5(r,a)),e=e.ownerDocument||e,a=e.createElement("script"),mr(a),Er(a,"link",r),e.head.appendChild(a),t.instance=a);case"void":return null;default:throw Error(Ee(443,t.type))}else t.type==="stylesheet"&&!(t.state.loading&4)&&(r=t.instance,t.state.loading|=4,jp(r,n.precedence,e));return t.instance}function jp(e,t,n){for(var r=n.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),a=r.length?r[r.length-1]:null,i=a,s=0;s<r.length;s++){var o=r[s];if(o.dataset.precedence===t)i=o;else if(i!==a)break}i?i.parentNode.insertBefore(e,i.nextSibling):(t=n.nodeType===9?n.head:n,t.insertBefore(e,t.firstChild))}function p5(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.title==null&&(e.title=t.title)}function m5(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.integrity==null&&(e.integrity=t.integrity)}var Tp=null;function Kw(e,t,n){if(Tp===null){var r=new Map,a=Tp=new Map;a.set(n,r)}else a=Tp,r=a.get(n),r||(r=new Map,a.set(n,r));if(r.has(e))return r;for(r.set(e,null),n=n.getElementsByTagName(e),a=0;a<n.length;a++){var i=n[a];if(!(i[Ld]||i[_r]||e==="link"&&i.getAttribute("rel")==="stylesheet")&&i.namespaceURI!=="http://www.w3.org/2000/svg"){var s=i.getAttribute(t)||"";s=e+s;var o=r.get(s);o?o.push(i):r.set(s,[i])}}return r}function Xw(e,t,n){e=e.ownerDocument||e,e.head.insertBefore(n,t==="title"?e.querySelector("head > title"):null)}function Bj(e,t,n){if(n===1||t.itemProp!=null)return!1;switch(e){case"meta":case"title":return!0;case"style":if(typeof t.precedence!="string"||typeof t.href!="string"||t.href==="")break;return!0;case"link":if(typeof t.rel!="string"||typeof t.href!="string"||t.href===""||t.onLoad||t.onError)break;switch(t.rel){case"stylesheet":return e=t.disabled,typeof t.precedence=="string"&&e==null;default:return!0}case"script":if(t.async&&typeof t.async!="function"&&typeof t.async!="symbol"&&!t.onLoad&&!t.onError&&t.src&&typeof t.src=="string")return!0}return!1}function D6(e){return!(e.type==="stylesheet"&&!(e.state.loading&3))}function $j(e,t,n,r){if(n.type==="stylesheet"&&(typeof r.media!="string"||matchMedia(r.media).matches!==!1)&&!(n.state.loading&4)){if(n.instance===null){var a=cc(r.href),i=t.querySelector(Md(a));if(i){t=i._p,t!==null&&typeof t=="object"&&typeof t.then=="function"&&(e.count++,e=ym.bind(e),t.then(e,e)),n.state.loading|=4,n.instance=i,mr(i);return}i=t.ownerDocument||t,r=O6(r),(a=ri.get(a))&&p5(r,a),i=i.createElement("link"),mr(i);var s=i;s._p=new Promise(function(o,l){s.onload=o,s.onerror=l}),Er(i,"link",r),n.instance=i}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(n,t),(t=n.state.preload)&&!(n.state.loading&3)&&(e.count++,n=ym.bind(e),t.addEventListener("load",n),t.addEventListener("error",n))}}var A1=0;function Uj(e,t){return e.stylesheets&&e.count===0&&Op(e,e.stylesheets),0<e.count||0<e.imgCount?function(n){var r=setTimeout(function(){if(e.stylesheets&&Op(e,e.stylesheets),e.unsuspend){var i=e.unsuspend;e.unsuspend=null,i()}},6e4+t);0<e.imgBytes&&A1===0&&(A1=62500*xj());var a=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&Op(e,e.stylesheets),e.unsuspend)){var i=e.unsuspend;e.unsuspend=null,i()}},(e.imgBytes>A1?50:800)+t);return e.unsuspend=n,function(){e.unsuspend=null,clearTimeout(r),clearTimeout(a)}}:null}function ym(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)Op(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var bm=null;function Op(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,bm=new Map,t.forEach(zj,e),bm=null,ym.call(e))}function zj(e,t){if(!(t.state.loading&4)){var n=bm.get(e);if(n)var r=n.get(null);else{n=new Map,bm.set(e,n);for(var a=e.querySelectorAll("link[data-precedence],style[data-precedence]"),i=0;i<a.length;i++){var s=a[i];(s.nodeName==="LINK"||s.getAttribute("media")!=="not all")&&(n.set(s.dataset.precedence,s),r=s)}r&&n.set(null,r)}a=t.instance,s=a.getAttribute("data-precedence"),i=n.get(s)||r,i===r&&n.set(null,a),n.set(s,a),this.count++,r=ym.bind(this),a.addEventListener("load",r),a.addEventListener("error",r),i?i.parentNode.insertBefore(a,i.nextSibling):(e=e.nodeType===9?e.head:e,e.insertBefore(a,e.firstChild)),t.state.loading|=4}}var sd={$$typeof:ps,Provider:null,Consumer:null,_currentValue:ul,_currentValue2:ul,_threadCount:0};function qj(e,t,n,r,a,i,s,o,l){this.tag=1,this.containerInfo=e,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=G0(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=G0(0),this.hiddenUpdates=G0(null),this.identifierPrefix=r,this.onUncaughtError=a,this.onCaughtError=i,this.onRecoverableError=s,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=l,this.incompleteTransitions=new Map}function R6(e,t,n,r,a,i,s,o,l,u,c,f){return e=new qj(e,t,n,s,l,u,c,f,o),t=1,i===!0&&(t|=24),i=Aa(3,null,null,t),e.current=i,i.stateNode=e,t=Uy(),t.refCount++,e.pooledCache=t,t.refCount++,i.memoizedState={element:r,isDehydrated:n,cache:t},Hy(i),e}function M6(e){return e?(e=Tu,e):Tu}function k6(e,t,n,r,a,i){a=M6(a),r.context===null?r.context=a:r.pendingContext=a,r=Ao(t),r.payload={element:n},i=i===void 0?null:i,i!==null&&(r.callback=i),n=No(e,r,t),n!==null&&(oa(n,e,t),Mf(n,e,t))}function Qw(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function g5(e,t){Qw(e,t),(e=e.alternate)&&Qw(e,t)}function P6(e){if(e.tag===13||e.tag===31){var t=Ll(e,67108864);t!==null&&oa(t,e,67108864),g5(e,67108864)}}function Zw(e){if(e.tag===13||e.tag===31){var t=Ta();t=Cy(t);var n=Ll(e,t);n!==null&&oa(n,e,t),g5(e,t)}}var wm=!0;function Hj(e,t,n,r){var a=dt.T;dt.T=null;var i=Zt.p;try{Zt.p=2,v5(e,t,n,r)}finally{Zt.p=i,dt.T=a}}function Vj(e,t,n,r){var a=dt.T;dt.T=null;var i=Zt.p;try{Zt.p=8,v5(e,t,n,r)}finally{Zt.p=i,dt.T=a}}function v5(e,t,n,r){if(wm){var a=rv(r);if(a===null)S1(e,t,r,xm,n),ex(e,r);else if(Gj(a,e,t,n,r))r.stopPropagation();else if(ex(e,r),t&4&&-1<Yj.indexOf(e)){for(;a!==null;){var i=yc(a);if(i!==null)switch(i.tag){case 3:if(i=i.stateNode,i.current.memoizedState.isDehydrated){var s=tl(i.pendingLanes);if(s!==0){var o=i;for(o.pendingLanes|=2,o.entangledLanes|=2;s;){var l=1<<31-ja(s);o.entanglements[1]|=l,s&=~l}qi(i),!(Qt&6)&&(cm=Ca()+500,Rd(0))}}break;case 31:case 13:o=Ll(i,2),o!==null&&oa(o,i,2),hg(),g5(i,2)}if(i=rv(r),i===null&&S1(e,t,r,xm,n),i===a)break;a=i}a!==null&&r.stopPropagation()}else S1(e,t,r,null,n)}}function rv(e){return e=Oy(e),y5(e)}var xm=null;function y5(e){if(xm=null,e=Au(e),e!==null){var t=Ad(e);if(t===null)e=null;else{var n=t.tag;if(n===13){if(e=nS(t),e!==null)return e;e=null}else if(n===31){if(e=rS(t),e!==null)return e;e=null}else if(n===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null)}}return xm=e,null}function I6(e){switch(e){case"beforetoggle":case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"toggle":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 2;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 8;case"message":switch(OC()){case oS:return 2;case lS:return 8;case Kp:case DC:return 32;case uS:return 268435456;default:return 32}default:return 32}}var av=!1,Lo=null,jo=null,To=null,od=new Map,ld=new Map,fo=[],Yj="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset".split(" ");function ex(e,t){switch(e){case"focusin":case"focusout":Lo=null;break;case"dragenter":case"dragleave":jo=null;break;case"mouseover":case"mouseout":To=null;break;case"pointerover":case"pointerout":od.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":ld.delete(t.pointerId)}}function cf(e,t,n,r,a,i){return e===null||e.nativeEvent!==i?(e={blockedOn:t,domEventName:n,eventSystemFlags:r,nativeEvent:i,targetContainers:[a]},t!==null&&(t=yc(t),t!==null&&P6(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,a!==null&&t.indexOf(a)===-1&&t.push(a),e)}function Gj(e,t,n,r,a){switch(t){case"focusin":return Lo=cf(Lo,e,t,n,r,a),!0;case"dragenter":return jo=cf(jo,e,t,n,r,a),!0;case"mouseover":return To=cf(To,e,t,n,r,a),!0;case"pointerover":var i=a.pointerId;return od.set(i,cf(od.get(i)||null,e,t,n,r,a)),!0;case"gotpointercapture":return i=a.pointerId,ld.set(i,cf(ld.get(i)||null,e,t,n,r,a)),!0}return!1}function F6(e){var t=Au(e.target);if(t!==null){var n=Ad(t);if(n!==null){if(t=n.tag,t===13){if(t=nS(n),t!==null){e.blockedOn=t,Fb(e.priority,function(){Zw(n)});return}}else if(t===31){if(t=rS(n),t!==null){e.blockedOn=t,Fb(e.priority,function(){Zw(n)});return}}else if(t===3&&n.stateNode.current.memoizedState.isDehydrated){e.blockedOn=n.tag===3?n.stateNode.containerInfo:null;return}}}e.blockedOn=null}function Dp(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=rv(e.nativeEvent);if(n===null){n=e.nativeEvent;var r=new n.constructor(n.type,n);S2=r,n.target.dispatchEvent(r),S2=null}else return t=yc(n),t!==null&&P6(t),e.blockedOn=n,!1;t.shift()}return!0}function tx(e,t,n){Dp(e)&&n.delete(t)}function Wj(){av=!1,Lo!==null&&Dp(Lo)&&(Lo=null),jo!==null&&Dp(jo)&&(jo=null),To!==null&&Dp(To)&&(To=null),od.forEach(tx),ld.forEach(tx)}function Gh(e,t){e.blockedOn===t&&(e.blockedOn=null,av||(av=!0,sr.unstable_scheduleCallback(sr.unstable_NormalPriority,Wj)))}var Wh=null;function nx(e){Wh!==e&&(Wh=e,sr.unstable_scheduleCallback(sr.unstable_NormalPriority,function(){Wh===e&&(Wh=null);for(var t=0;t<e.length;t+=3){var n=e[t],r=e[t+1],a=e[t+2];if(typeof r!="function"){if(y5(r||n)===null)continue;break}var i=yc(n);i!==null&&(e.splice(t,3),t-=3,F2(i,{pending:!0,data:a,method:n.method,action:r},r,a))}}))}function fc(e){function t(l){return Gh(l,e)}Lo!==null&&Gh(Lo,e),jo!==null&&Gh(jo,e),To!==null&&Gh(To,e),od.forEach(t),ld.forEach(t);for(var n=0;n<fo.length;n++){var r=fo[n];r.blockedOn===e&&(r.blockedOn=null)}for(;0<fo.length&&(n=fo[0],n.blockedOn===null);)F6(n),n.blockedOn===null&&fo.shift();if(n=(e.ownerDocument||e).$$reactFormReplay,n!=null)for(r=0;r<n.length;r+=3){var a=n[r],i=n[r+1],s=a[la]||null;if(typeof i=="function")s||nx(n);else if(s){var o=null;if(i&&i.hasAttribute("formAction")){if(a=i,s=i[la]||null)o=s.formAction;else if(y5(a)!==null)continue}else o=s.action;typeof o=="function"?n[r+1]=o:(n.splice(r,3),r-=3),nx(n)}}}function B6(){function e(i){i.canIntercept&&i.info==="react-transition"&&i.intercept({handler:function(){return new Promise(function(s){return a=s})},focusReset:"manual",scroll:"manual"})}function t(){a!==null&&(a(),a=null),r||setTimeout(n,20)}function n(){if(!r&&!navigation.transition){var i=navigation.currentEntry;i&&i.url!=null&&navigation.navigate(i.url,{state:i.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var r=!1,a=null;return navigation.addEventListener("navigate",e),navigation.addEventListener("navigatesuccess",t),navigation.addEventListener("navigateerror",t),setTimeout(n,100),function(){r=!0,navigation.removeEventListener("navigate",e),navigation.removeEventListener("navigatesuccess",t),navigation.removeEventListener("navigateerror",t),a!==null&&(a(),a=null)}}}function b5(e){this._internalRoot=e}gg.prototype.render=b5.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(Ee(409));var n=t.current,r=Ta();k6(n,r,e,t,null,null)};gg.prototype.unmount=b5.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;k6(e.current,2,null,e,null,null),hg(),t[vc]=null}};function gg(e){this._internalRoot=e}gg.prototype.unstable_scheduleHydration=function(e){if(e){var t=pS();e={blockedOn:null,target:e,priority:t};for(var n=0;n<fo.length&&t!==0&&t<fo[n].priority;n++);fo.splice(n,0,e),n===0&&F6(e)}};var rx=eS.version;if(rx!=="19.2.0")throw Error(Ee(527,rx,"19.2.0"));Zt.findDOMNode=function(e){var t=e._reactInternals;if(t===void 0)throw typeof e.render=="function"?Error(Ee(188)):(e=Object.keys(e).join(","),Error(Ee(268,e)));return e=AC(t),e=e!==null?aS(e):null,e=e===null?null:e.stateNode,e};var Jj={bundleType:0,version:"19.2.0",rendererPackageName:"react-dom",currentDispatcherRef:dt,reconcilerVersion:"19.2.0"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Jh=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Jh.isDisabled&&Jh.supportsFiber)try{Nd=Jh.inject(Jj),La=Jh}catch{}}Zm.createRoot=function(e,t){if(!tS(e))throw Error(Ee(299));var n=!1,r="",a=T_,i=O_,s=D_;return t!=null&&(t.unstable_strictMode===!0&&(n=!0),t.identifierPrefix!==void 0&&(r=t.identifierPrefix),t.onUncaughtError!==void 0&&(a=t.onUncaughtError),t.onCaughtError!==void 0&&(i=t.onCaughtError),t.onRecoverableError!==void 0&&(s=t.onRecoverableError)),t=R6(e,1,!1,null,null,n,r,null,a,i,s,B6),e[vc]=t.current,h5(e),new b5(t)};Zm.hydrateRoot=function(e,t,n){if(!tS(e))throw Error(Ee(299));var r=!1,a="",i=T_,s=O_,o=D_,l=null;return n!=null&&(n.unstable_strictMode===!0&&(r=!0),n.identifierPrefix!==void 0&&(a=n.identifierPrefix),n.onUncaughtError!==void 0&&(i=n.onUncaughtError),n.onCaughtError!==void 0&&(s=n.onCaughtError),n.onRecoverableError!==void 0&&(o=n.onRecoverableError),n.formState!==void 0&&(l=n.formState)),t=R6(e,1,!0,t,n??null,r,a,l,i,s,o,B6),t.context=M6(null),n=t.current,r=Ta(),r=Cy(r),a=Ao(r),a.callback=null,No(n,a,r),n=r,t.current.lanes=n,Cd(t,n),qi(t),e[vc]=t.current,h5(e),new gg(t)};Zm.version="19.2.0";function $6(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE($6)}catch(e){console.error(e)}}$6(),W3.exports=Zm;var Kj=W3.exports;/**
50
+ * react-router v7.9.3
51
+ *
52
+ * Copyright (c) Remix Software Inc.
53
+ *
54
+ * This source code is licensed under the MIT license found in the
55
+ * LICENSE.md file in the root directory of this source tree.
56
+ *
57
+ * @license MIT
58
+ */var U6=e=>{throw TypeError(e)},Xj=(e,t,n)=>t.has(e)||U6("Cannot "+n),N1=(e,t,n)=>(Xj(e,t,"read from private field"),n?n.call(e):t.get(e)),Qj=(e,t,n)=>t.has(e)?U6("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),ax="popstate";function Zj(e={}){function t(r,a){let{pathname:i,search:s,hash:o}=r.location;return ud("",{pathname:i,search:s,hash:o},a.state&&a.state.usr||null,a.state&&a.state.key||"default")}function n(r,a){return typeof a=="string"?a:ko(a)}return tT(t,n,null,e)}function At(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function Fn(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function eT(){return Math.random().toString(36).substring(2,10)}function ix(e,t){return{usr:e.state,key:e.key,idx:t}}function ud(e,t,n=null,r){return{pathname:typeof e=="string"?e:e.pathname,search:"",hash:"",...typeof t=="string"?Rs(t):t,state:n,key:t&&t.key||r||eT()}}function ko({pathname:e="/",search:t="",hash:n=""}){return t&&t!=="?"&&(e+=t.charAt(0)==="?"?t:"?"+t),n&&n!=="#"&&(e+=n.charAt(0)==="#"?n:"#"+n),e}function Rs(e){let t={};if(e){let n=e.indexOf("#");n>=0&&(t.hash=e.substring(n),e=e.substring(0,n));let r=e.indexOf("?");r>=0&&(t.search=e.substring(r),e=e.substring(0,r)),e&&(t.pathname=e)}return t}function tT(e,t,n,r={}){let{window:a=document.defaultView,v5Compat:i=!1}=r,s=a.history,o="POP",l=null,u=c();u==null&&(u=0,s.replaceState({...s.state,idx:u},""));function c(){return(s.state||{idx:null}).idx}function f(){o="POP";let x=c(),g=x==null?null:x-u;u=x,l&&l({action:o,location:S.location,delta:g})}function p(x,g){o="PUSH";let y=ud(S.location,x,g);u=c()+1;let _=ix(y,u),E=S.createHref(y);try{s.pushState(_,"",E)}catch(D){if(D instanceof DOMException&&D.name==="DataCloneError")throw D;a.location.assign(E)}i&&l&&l({action:o,location:S.location,delta:1})}function d(x,g){o="REPLACE";let y=ud(S.location,x,g);u=c();let _=ix(y,u),E=S.createHref(y);s.replaceState(_,"",E),i&&l&&l({action:o,location:S.location,delta:0})}function v(x){return z6(x)}let S={get action(){return o},get location(){return e(a,s)},listen(x){if(l)throw new Error("A history only accepts one active listener");return a.addEventListener(ax,f),l=x,()=>{a.removeEventListener(ax,f),l=null}},createHref(x){return t(a,x)},createURL:v,encodeLocation(x){let g=v(x);return{pathname:g.pathname,search:g.search,hash:g.hash}},push:p,replace:d,go(x){return s.go(x)}};return S}function z6(e,t=!1){let n="http://localhost";typeof window<"u"&&(n=window.location.origin!=="null"?window.location.origin:window.location.href),At(n,"No window.location.(origin|href) available to create URL");let r=typeof e=="string"?e:ko(e);return r=r.replace(/ $/,"%20"),!t&&r.startsWith("//")&&(r=n+r),new URL(r,n)}var Ef,sx=class{constructor(e){if(Qj(this,Ef,new Map),e)for(let[t,n]of e)this.set(t,n)}get(e){if(N1(this,Ef).has(e))return N1(this,Ef).get(e);if(e.defaultValue!==void 0)return e.defaultValue;throw new Error("No value found for context")}set(e,t){N1(this,Ef).set(e,t)}};Ef=new WeakMap;var nT=new Set(["lazy","caseSensitive","path","id","index","children"]);function rT(e){return nT.has(e)}var aT=new Set(["lazy","caseSensitive","path","id","index","middleware","children"]);function iT(e){return aT.has(e)}function sT(e){return e.index===!0}function cd(e,t,n=[],r={},a=!1){return e.map((i,s)=>{let o=[...n,String(s)],l=typeof i.id=="string"?i.id:o.join("-");if(At(i.index!==!0||!i.children,"Cannot specify children on an index route"),At(a||!r[l],`Found a route id collision on id "${l}". Route id's must be globally unique within Data Router usages`),sT(i)){let u={...i,...t(i),id:l};return r[l]=u,u}else{let u={...i,...t(i),id:l,children:void 0};return r[l]=u,i.children&&(u.children=cd(i.children,t,o,r,a)),u}})}function ho(e,t,n="/"){return Rp(e,t,n,!1)}function Rp(e,t,n,r){let a=typeof t=="string"?Rs(t):t,i=ai(a.pathname||"/",n);if(i==null)return null;let s=q6(e);lT(s);let o=null;for(let l=0;o==null&&l<s.length;++l){let u=bT(i);o=vT(s[l],u,r)}return o}function oT(e,t){let{route:n,pathname:r,params:a}=e;return{id:n.id,pathname:r,params:a,data:t[n.id],loaderData:t[n.id],handle:n.handle}}function q6(e,t=[],n=[],r="",a=!1){let i=(s,o,l=a,u)=>{let c={relativePath:u===void 0?s.path||"":u,caseSensitive:s.caseSensitive===!0,childrenIndex:o,route:s};if(c.relativePath.startsWith("/")){if(!c.relativePath.startsWith(r)&&l)return;At(c.relativePath.startsWith(r),`Absolute route path "${c.relativePath}" nested under path "${r}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),c.relativePath=c.relativePath.slice(r.length)}let f=Bi([r,c.relativePath]),p=n.concat(c);s.children&&s.children.length>0&&(At(s.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${f}".`),q6(s.children,t,p,f,l)),!(s.path==null&&!s.index)&&t.push({path:f,score:mT(f,s.index),routesMeta:p})};return e.forEach((s,o)=>{var l;if(s.path===""||!((l=s.path)!=null&&l.includes("?")))i(s,o);else for(let u of H6(s.path))i(s,o,!0,u)}),t}function H6(e){let t=e.split("/");if(t.length===0)return[];let[n,...r]=t,a=n.endsWith("?"),i=n.replace(/\?$/,"");if(r.length===0)return a?[i,""]:[i];let s=H6(r.join("/")),o=[];return o.push(...s.map(l=>l===""?i:[i,l].join("/"))),a&&o.push(...s),o.map(l=>e.startsWith("/")&&l===""?"/":l)}function lT(e){e.sort((t,n)=>t.score!==n.score?n.score-t.score:gT(t.routesMeta.map(r=>r.childrenIndex),n.routesMeta.map(r=>r.childrenIndex)))}var uT=/^:[\w-]+$/,cT=3,fT=2,dT=1,hT=10,pT=-2,ox=e=>e==="*";function mT(e,t){let n=e.split("/"),r=n.length;return n.some(ox)&&(r+=pT),t&&(r+=fT),n.filter(a=>!ox(a)).reduce((a,i)=>a+(uT.test(i)?cT:i===""?dT:hT),r)}function gT(e,t){return e.length===t.length&&e.slice(0,-1).every((r,a)=>r===t[a])?e[e.length-1]-t[t.length-1]:0}function vT(e,t,n=!1){let{routesMeta:r}=e,a={},i="/",s=[];for(let o=0;o<r.length;++o){let l=r[o],u=o===r.length-1,c=i==="/"?t:t.slice(i.length)||"/",f=Sm({path:l.relativePath,caseSensitive:l.caseSensitive,end:u},c),p=l.route;if(!f&&u&&n&&!r[r.length-1].route.index&&(f=Sm({path:l.relativePath,caseSensitive:l.caseSensitive,end:!1},c)),!f)return null;Object.assign(a,f.params),s.push({params:a,pathname:Bi([i,f.pathname]),pathnameBase:_T(Bi([i,f.pathnameBase])),route:p}),f.pathnameBase!=="/"&&(i=Bi([i,f.pathnameBase]))}return s}function Sm(e,t){typeof e=="string"&&(e={path:e,caseSensitive:!1,end:!0});let[n,r]=yT(e.path,e.caseSensitive,e.end),a=t.match(n);if(!a)return null;let i=a[0],s=i.replace(/(.)\/+$/,"$1"),o=a.slice(1);return{params:r.reduce((u,{paramName:c,isOptional:f},p)=>{if(c==="*"){let v=o[p]||"";s=i.slice(0,i.length-v.length).replace(/(.)\/+$/,"$1")}const d=o[p];return f&&!d?u[c]=void 0:u[c]=(d||"").replace(/%2F/g,"/"),u},{}),pathname:i,pathnameBase:s,pattern:e}}function yT(e,t=!1,n=!0){Fn(e==="*"||!e.endsWith("*")||e.endsWith("/*"),`Route path "${e}" will be treated as if it were "${e.replace(/\*$/,"/*")}" because the \`*\` character must always follow a \`/\` in the pattern. To get rid of this warning, please change the route path to "${e.replace(/\*$/,"/*")}".`);let r=[],a="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(s,o,l)=>(r.push({paramName:o,isOptional:l!=null}),l?"/?([^\\/]+)?":"/([^\\/]+)")).replace(/\/([\w-]+)\?(\/|$)/g,"(/$1)?$2");return e.endsWith("*")?(r.push({paramName:"*"}),a+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):n?a+="\\/*$":e!==""&&e!=="/"&&(a+="(?:(?=\\/|$))"),[new RegExp(a,t?void 0:"i"),r]}function bT(e){try{return e.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return Fn(!1,`The URL path "${e}" could not be decoded because it is a malformed URL segment. This is probably due to a bad percent encoding (${t}).`),e}}function ai(e,t){if(t==="/")return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let n=t.endsWith("/")?t.length-1:t.length,r=e.charAt(n);return r&&r!=="/"?null:e.slice(n)||"/"}function wT({basename:e,pathname:t}){return t==="/"?e:Bi([e,t])}function xT(e,t="/"){let{pathname:n,search:r="",hash:a=""}=typeof e=="string"?Rs(e):e;return{pathname:n?n.startsWith("/")?n:ST(n,t):t,search:AT(r),hash:NT(a)}}function ST(e,t){let n=t.replace(/\/+$/,"").split("/");return e.split("/").forEach(a=>{a===".."?n.length>1&&n.pop():a!=="."&&n.push(a)}),n.length>1?n.join("/"):"/"}function E1(e,t,n,r){return`Cannot include a '${e}' character in a manually specified \`to.${t}\` field [${JSON.stringify(r)}]. Please separate it out to the \`to.${n}\` field. Alternatively you may provide the full path as a string in <Link to="..."> and the router will parse it for you.`}function V6(e){return e.filter((t,n)=>n===0||t.route.path&&t.route.path.length>0)}function vg(e){let t=V6(e);return t.map((n,r)=>r===t.length-1?n.pathname:n.pathnameBase)}function yg(e,t,n,r=!1){let a;typeof e=="string"?a=Rs(e):(a={...e},At(!a.pathname||!a.pathname.includes("?"),E1("?","pathname","search",a)),At(!a.pathname||!a.pathname.includes("#"),E1("#","pathname","hash",a)),At(!a.search||!a.search.includes("#"),E1("#","search","hash",a)));let i=e===""||a.pathname==="",s=i?"/":a.pathname,o;if(s==null)o=n;else{let f=t.length-1;if(!r&&s.startsWith("..")){let p=s.split("/");for(;p[0]==="..";)p.shift(),f-=1;a.pathname=p.join("/")}o=f>=0?t[f]:"/"}let l=xT(a,o),u=s&&s!=="/"&&s.endsWith("/"),c=(i||s===".")&&n.endsWith("/");return!l.pathname.endsWith("/")&&(u||c)&&(l.pathname+="/"),l}var Bi=e=>e.join("/").replace(/\/\/+/g,"/"),_T=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),AT=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,NT=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e,_m=class{constructor(e,t,n,r=!1){this.status=e,this.statusText=t||"",this.internal=r,n instanceof Error?(this.data=n.toString(),this.error=n):this.data=n}};function fd(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}var Y6=["POST","PUT","PATCH","DELETE"],ET=new Set(Y6),CT=["GET",...Y6],LT=new Set(CT),jT=new Set([301,302,303,307,308]),TT=new Set([307,308]),C1={state:"idle",location:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},OT={state:"idle",data:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},ff={state:"unblocked",proceed:void 0,reset:void 0,location:void 0},DT=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,w5=e=>DT.test(e),RT=e=>({hasErrorBoundary:!!e.hasErrorBoundary}),G6="remix-router-transitions",W6=Symbol("ResetLoaderData");function MT(e){const t=e.window?e.window:typeof window<"u"?window:void 0,n=typeof t<"u"&&typeof t.document<"u"&&typeof t.document.createElement<"u";At(e.routes.length>0,"You must provide a non-empty routes array to createRouter");let r=e.hydrationRouteProperties||[],a=e.mapRouteProperties||RT,i={},s=cd(e.routes,a,void 0,i),o,l=e.basename||"/";l.startsWith("/")||(l=`/${l}`);let u=e.dataStrategy||BT,c={...e.future},f=null,p=new Set,d=null,v=null,S=null,x=e.hydrationData!=null,g=ho(s,e.history.location,l),y=!1,_=null,E;if(g==null&&!e.patchRoutesOnNavigation){let re=Ga(404,{pathname:e.history.location.pathname}),{matches:ae,route:be}=Kh(s);E=!0,g=ae,_={[be.id]:re}}else if(g&&!e.hydrationData&&Ft(g,s,e.history.location.pathname).active&&(g=null),g)if(g.some(re=>re.route.lazy))E=!1;else if(!g.some(re=>x5(re.route)))E=!0;else{let re=e.hydrationData?e.hydrationData.loaderData:null,ae=e.hydrationData?e.hydrationData.errors:null;if(ae){let be=g.findIndex(De=>ae[De.route.id]!==void 0);E=g.slice(0,be+1).every(De=>!sv(De.route,re,ae))}else E=g.every(be=>!sv(be.route,re,ae))}else{E=!1,g=[];let re=Ft(null,s,e.history.location.pathname);re.active&&re.matches&&(y=!0,g=re.matches)}let D,R={historyAction:e.history.action,location:e.history.location,matches:g,initialized:E,navigation:C1,restoreScrollPosition:e.hydrationData!=null?!1:null,preventScrollReset:!1,revalidation:"idle",loaderData:e.hydrationData&&e.hydrationData.loaderData||{},actionData:e.hydrationData&&e.hydrationData.actionData||null,errors:e.hydrationData&&e.hydrationData.errors||_,fetchers:new Map,blockers:new Map},O="POP",j=!1,$,V=!1,T=new Map,P=null,q=!1,Y=!1,se=new Set,G=new Map,ne=0,Q=-1,ie=new Map,J=new Set,le=new Map,L=new Map,z=new Set,W=new Map,te,B=null;function ee(){if(f=e.history.listen(({action:re,location:ae,delta:be})=>{if(te){te(),te=void 0;return}Fn(W.size===0||be!=null,"You are trying to use a blocker on a POP navigation to a location that was not created by @remix-run/router. This will fail silently in production. This can happen if you are navigating outside the router via `window.history.pushState`/`window.location.hash` instead of using router navigation APIs. This can also happen if you are using createHashRouter and the user manually changes the URL.");let De=Ai({currentLocation:R.location,nextLocation:ae,historyAction:re});if(De&&be!=null){let ke=new Promise($e=>{te=$e});e.history.go(be*-1),It(De,{state:"blocked",location:ae,proceed(){It(De,{state:"proceeding",proceed:void 0,reset:void 0,location:ae}),ke.then(()=>e.history.go(be))},reset(){let $e=new Map(R.blockers);$e.set(De,ff),Se({blockers:$e})}});return}return Me(re,ae)}),n){e7(t,T);let re=()=>t7(t,T);t.addEventListener("pagehide",re),P=()=>t.removeEventListener("pagehide",re)}return R.initialized||Me("POP",R.location,{initialHydration:!0}),D}function fe(){f&&f(),P&&P(),p.clear(),$&&$.abort(),R.fetchers.forEach((re,ae)=>Et(ae)),R.blockers.forEach((re,ae)=>pa(ae))}function me(re){return p.add(re),()=>p.delete(re)}function Se(re,ae={}){re.matches&&(re.matches=re.matches.map(ke=>{let $e=i[ke.route.id],Ue=ke.route;return Ue.element!==$e.element||Ue.errorElement!==$e.errorElement||Ue.hydrateFallbackElement!==$e.hydrateFallbackElement?{...ke,route:$e}:ke})),R={...R,...re};let be=[],De=[];R.fetchers.forEach((ke,$e)=>{ke.state==="idle"&&(z.has($e)?be.push($e):De.push($e))}),z.forEach(ke=>{!R.fetchers.has(ke)&&!G.has(ke)&&be.push(ke)}),[...p].forEach(ke=>ke(R,{deletedFetchers:be,viewTransitionOpts:ae.viewTransitionOpts,flushSync:ae.flushSync===!0})),be.forEach(ke=>Et(ke)),De.forEach(ke=>R.fetchers.delete(ke))}function we(re,ae,{flushSync:be}={}){var et,Je;let De=R.actionData!=null&&R.navigation.formMethod!=null&&ia(R.navigation.formMethod)&&R.navigation.state==="loading"&&((et=re.state)==null?void 0:et._isRedirect)!==!0,ke;ae.actionData?Object.keys(ae.actionData).length>0?ke=ae.actionData:ke=null:De?ke=R.actionData:ke=null;let $e=ae.loaderData?vx(R.loaderData,ae.loaderData,ae.matches||[],ae.errors):R.loaderData,Ue=R.blockers;Ue.size>0&&(Ue=new Map(Ue),Ue.forEach((at,Tt)=>Ue.set(Tt,ff)));let Ve=q?!1:pt(re,ae.matches||R.matches),Ze=j===!0||R.navigation.formMethod!=null&&ia(R.navigation.formMethod)&&((Je=re.state)==null?void 0:Je._isRedirect)!==!0;o&&(s=o,o=void 0),q||O==="POP"||(O==="PUSH"?e.history.push(re,re.state):O==="REPLACE"&&e.history.replace(re,re.state));let tt;if(O==="POP"){let at=T.get(R.location.pathname);at&&at.has(re.pathname)?tt={currentLocation:R.location,nextLocation:re}:T.has(re.pathname)&&(tt={currentLocation:re,nextLocation:R.location})}else if(V){let at=T.get(R.location.pathname);at?at.add(re.pathname):(at=new Set([re.pathname]),T.set(R.location.pathname,at)),tt={currentLocation:R.location,nextLocation:re}}Se({...ae,actionData:ke,loaderData:$e,historyAction:O,location:re,initialized:!0,navigation:C1,revalidation:"idle",restoreScrollPosition:Ve,preventScrollReset:Ze,blockers:Ue},{viewTransitionOpts:tt,flushSync:be===!0}),O="POP",j=!1,V=!1,q=!1,Y=!1,B==null||B.resolve(),B=null}async function je(re,ae){if(typeof re=="number"){e.history.go(re);return}let be=iv(R.location,R.matches,l,re,ae==null?void 0:ae.fromRouteId,ae==null?void 0:ae.relative),{path:De,submission:ke,error:$e}=lx(!1,be,ae),Ue=R.location,Ve=ud(R.location,De,ae&&ae.state);Ve={...Ve,...e.history.encodeLocation(Ve)};let Ze=ae&&ae.replace!=null?ae.replace:void 0,tt="PUSH";Ze===!0?tt="REPLACE":Ze===!1||ke!=null&&ia(ke.formMethod)&&ke.formAction===R.location.pathname+R.location.search&&(tt="REPLACE");let et=ae&&"preventScrollReset"in ae?ae.preventScrollReset===!0:void 0,Je=(ae&&ae.flushSync)===!0,at=Ai({currentLocation:Ue,nextLocation:Ve,historyAction:tt});if(at){It(at,{state:"blocked",location:Ve,proceed(){It(at,{state:"proceeding",proceed:void 0,reset:void 0,location:Ve}),je(re,ae)},reset(){let Tt=new Map(R.blockers);Tt.set(at,ff),Se({blockers:Tt})}});return}await Me(tt,Ve,{submission:ke,pendingError:$e,preventScrollReset:et,replace:ae&&ae.replace,enableViewTransition:ae&&ae.viewTransition,flushSync:Je})}function Ae(){B||(B=n7()),gt(),Se({revalidation:"loading"});let re=B.promise;return R.navigation.state==="submitting"?re:R.navigation.state==="idle"?(Me(R.historyAction,R.location,{startUninterruptedRevalidation:!0}),re):(Me(O||R.historyAction,R.navigation.location,{overrideNavigation:R.navigation,enableViewTransition:V===!0}),re)}async function Me(re,ae,be){$&&$.abort(),$=null,O=re,q=(be&&be.startUninterruptedRevalidation)===!0,Ln(R.location,R.matches),j=(be&&be.preventScrollReset)===!0,V=(be&&be.enableViewTransition)===!0;let De=o||s,ke=be&&be.overrideNavigation,$e=be!=null&&be.initialHydration&&R.matches&&R.matches.length>0&&!y?R.matches:ho(De,ae,l),Ue=(be&&be.flushSync)===!0;if($e&&R.initialized&&!Y&&GT(R.location,ae)&&!(be&&be.submission&&ia(be.submission.formMethod))){we(ae,{matches:$e},{flushSync:Ue});return}let Ve=Ft($e,De,ae.pathname);if(Ve.active&&Ve.matches&&($e=Ve.matches),!$e){let{error:gn,notFoundMatches:Gt,route:qt}=mn(ae.pathname);we(ae,{matches:Gt,loaderData:{},errors:{[qt.id]:gn}},{flushSync:Ue});return}$=new AbortController;let Ze=yu(e.history,ae,$.signal,be&&be.submission),tt=e.getContext?await e.getContext():new sx,et;if(be&&be.pendingError)et=[po($e).route.id,{type:"error",error:be.pendingError}];else if(be&&be.submission&&ia(be.submission.formMethod)){let gn=await pe(Ze,ae,be.submission,$e,tt,Ve.active,be&&be.initialHydration===!0,{replace:be.replace,flushSync:Ue});if(gn.shortCircuited)return;if(gn.pendingActionResult){let[Gt,qt]=gn.pendingActionResult;if(Sa(qt)&&fd(qt.error)&&qt.error.status===404){$=null,we(ae,{matches:gn.matches,loaderData:{},errors:{[Gt]:qt.error}});return}}$e=gn.matches||$e,et=gn.pendingActionResult,ke=L1(ae,be.submission),Ue=!1,Ve.active=!1,Ze=yu(e.history,Ze.url,Ze.signal)}let{shortCircuited:Je,matches:at,loaderData:Tt,errors:Yt}=await X(Ze,ae,$e,tt,Ve.active,ke,be&&be.submission,be&&be.fetcherSubmission,be&&be.replace,be&&be.initialHydration===!0,Ue,et);Je||($=null,we(ae,{matches:at||$e,...yx(et),loaderData:Tt,errors:Yt}))}async function pe(re,ae,be,De,ke,$e,Ue,Ve={}){gt();let Ze=QT(ae,be);if(Se({navigation:Ze},{flushSync:Ve.flushSync===!0}),$e){let Je=await Pa(De,ae.pathname,re.signal);if(Je.type==="aborted")return{shortCircuited:!0};if(Je.type==="error"){if(Je.partialMatches.length===0){let{matches:Tt,route:Yt}=Kh(s);return{matches:Tt,pendingActionResult:[Yt.id,{type:"error",error:Je.error}]}}let at=po(Je.partialMatches).route.id;return{matches:Je.partialMatches,pendingActionResult:[at,{type:"error",error:Je.error}]}}else if(Je.matches)De=Je.matches;else{let{notFoundMatches:at,error:Tt,route:Yt}=mn(ae.pathname);return{matches:at,pendingActionResult:[Yt.id,{type:"error",error:Tt}]}}}let tt,et=Mp(De,ae);if(!et.route.action&&!et.route.lazy)tt={type:"error",error:Ga(405,{method:re.method,pathname:ae.pathname,routeId:et.route.id})};else{let Je=zu(a,i,re,De,et,Ue?[]:r,ke),at=await Qe(re,Je,ke,null);if(tt=at[et.route.id],!tt){for(let Tt of De)if(at[Tt.route.id]){tt=at[Tt.route.id];break}}if(re.signal.aborted)return{shortCircuited:!0}}if(ll(tt)){let Je;return Ve&&Ve.replace!=null?Je=Ve.replace:Je=px(tt.response.headers.get("Location"),new URL(re.url),l)===R.location.pathname+R.location.search,await Fe(re,tt,!0,{submission:be,replace:Je}),{shortCircuited:!0}}if(Sa(tt)){let Je=po(De,et.route.id);return(Ve&&Ve.replace)!==!0&&(O="PUSH"),{matches:De,pendingActionResult:[Je.route.id,tt,et.route.id]}}return{matches:De,pendingActionResult:[et.route.id,tt]}}async function X(re,ae,be,De,ke,$e,Ue,Ve,Ze,tt,et,Je){let at=$e||L1(ae,Ue),Tt=Ue||Ve||wx(at),Yt=!q&&!tt;if(ke){if(Yt){let Wn=Ge(Je);Se({navigation:at,...Wn!==void 0?{actionData:Wn}:{}},{flushSync:et})}let jt=await Pa(be,ae.pathname,re.signal);if(jt.type==="aborted")return{shortCircuited:!0};if(jt.type==="error"){if(jt.partialMatches.length===0){let{matches:si,route:oi}=Kh(s);return{matches:si,loaderData:{},errors:{[oi.id]:jt.error}}}let Wn=po(jt.partialMatches).route.id;return{matches:jt.partialMatches,loaderData:{},errors:{[Wn]:jt.error}}}else if(jt.matches)be=jt.matches;else{let{error:Wn,notFoundMatches:si,route:oi}=mn(ae.pathname);return{matches:si,loaderData:{},errors:{[oi.id]:Wn}}}}let gn=o||s,{dsMatches:Gt,revalidatingFetchers:qt}=ux(re,De,a,i,e.history,R,be,Tt,ae,tt?[]:r,tt===!0,Y,se,z,le,J,gn,l,e.patchRoutesOnNavigation!=null,Je);if(Q=++ne,!e.dataStrategy&&!Gt.some(jt=>jt.shouldLoad)&&!Gt.some(jt=>jt.route.middleware&&jt.route.middleware.length>0)&&qt.length===0){let jt=Yr();return we(ae,{matches:be,loaderData:{},errors:Je&&Sa(Je[1])?{[Je[0]]:Je[1].error}:null,...yx(Je),...jt?{fetchers:new Map(R.fetchers)}:{}},{flushSync:et}),{shortCircuited:!0}}if(Yt){let jt={};if(!ke){jt.navigation=at;let Wn=Ge(Je);Wn!==void 0&&(jt.actionData=Wn)}qt.length>0&&(jt.fetchers=Pe(qt)),Se(jt,{flushSync:et})}qt.forEach(jt=>{hn(jt.key),jt.controller&&G.set(jt.key,jt.controller)});let Gr=()=>qt.forEach(jt=>hn(jt.key));$&&$.signal.addEventListener("abort",Gr);let{loaderResults:Fa,fetcherResults:Pr}=await ht(Gt,qt,re,De);if(re.signal.aborted)return{shortCircuited:!0};$&&$.signal.removeEventListener("abort",Gr),qt.forEach(jt=>G.delete(jt.key));let Ir=Xh(Fa);if(Ir)return await Fe(re,Ir.result,!0,{replace:Ze}),{shortCircuited:!0};if(Ir=Xh(Pr),Ir)return J.add(Ir.key),await Fe(re,Ir.result,!0,{replace:Ze}),{shortCircuited:!0};let{loaderData:Uo,errors:Yi}=gx(R,be,Fa,Je,qt,Pr);tt&&R.errors&&(Yi={...R.errors,...Yi});let Wr=Yr(),Gi=en(Q),Ps=Wr||Gi||qt.length>0;return{matches:be,loaderData:Uo,errors:Yi,...Ps?{fetchers:new Map(R.fetchers)}:{}}}function Ge(re){if(re&&!Sa(re[1]))return{[re[0]]:re[1].data};if(R.actionData)return Object.keys(R.actionData).length===0?null:R.actionData}function Pe(re){return re.forEach(ae=>{let be=R.fetchers.get(ae.key),De=df(void 0,be?be.data:void 0);R.fetchers.set(ae.key,De)}),new Map(R.fetchers)}async function Te(re,ae,be,De){hn(re);let ke=(De&&De.flushSync)===!0,$e=o||s,Ue=iv(R.location,R.matches,l,be,ae,De==null?void 0:De.relative),Ve=ho($e,Ue,l),Ze=Ft(Ve,$e,Ue);if(Ze.active&&Ze.matches&&(Ve=Ze.matches),!Ve){wt(re,ae,Ga(404,{pathname:Ue}),{flushSync:ke});return}let{path:tt,submission:et,error:Je}=lx(!0,Ue,De);if(Je){wt(re,ae,Je,{flushSync:ke});return}let at=e.getContext?await e.getContext():new sx,Tt=(De&&De.preventScrollReset)===!0;if(et&&ia(et.formMethod)){await Ie(re,ae,tt,Ve,at,Ze.active,ke,Tt,et);return}le.set(re,{routeId:ae,path:tt}),await qe(re,ae,tt,Ve,at,Ze.active,ke,Tt,et)}async function Ie(re,ae,be,De,ke,$e,Ue,Ve,Ze){gt(),le.delete(re);let tt=R.fetchers.get(re);ft(re,ZT(Ze,tt),{flushSync:Ue});let et=new AbortController,Je=yu(e.history,be,et.signal,Ze);if($e){let vn=await Pa(De,new URL(Je.url).pathname,Je.signal,re);if(vn.type==="aborted")return;if(vn.type==="error"){wt(re,ae,vn.error,{flushSync:Ue});return}else if(vn.matches)De=vn.matches;else{wt(re,ae,Ga(404,{pathname:be}),{flushSync:Ue});return}}let at=Mp(De,be);if(!at.route.action&&!at.route.lazy){let vn=Ga(405,{method:Ze.formMethod,pathname:be,routeId:ae});wt(re,ae,vn,{flushSync:Ue});return}G.set(re,et);let Tt=ne,Yt=zu(a,i,Je,De,at,r,ke),Gt=(await Qe(Je,Yt,ke,re))[at.route.id];if(Je.signal.aborted){G.get(re)===et&&G.delete(re);return}if(z.has(re)){if(ll(Gt)||Sa(Gt)){ft(re,cs(void 0));return}}else{if(ll(Gt))if(G.delete(re),Q>Tt){ft(re,cs(void 0));return}else return J.add(re),ft(re,df(Ze)),Fe(Je,Gt,!1,{fetcherSubmission:Ze,preventScrollReset:Ve});if(Sa(Gt)){wt(re,ae,Gt.error);return}}let qt=R.navigation.location||R.location,Gr=yu(e.history,qt,et.signal),Fa=o||s,Pr=R.navigation.state!=="idle"?ho(Fa,R.navigation.location,l):R.matches;At(Pr,"Didn't find any matches after fetcher action");let Ir=++ne;ie.set(re,Ir);let Uo=df(Ze,Gt.data);R.fetchers.set(re,Uo);let{dsMatches:Yi,revalidatingFetchers:Wr}=ux(Gr,ke,a,i,e.history,R,Pr,Ze,qt,r,!1,Y,se,z,le,J,Fa,l,e.patchRoutesOnNavigation!=null,[at.route.id,Gt]);Wr.filter(vn=>vn.key!==re).forEach(vn=>{let Is=vn.key,jn=R.fetchers.get(Is),Rl=df(void 0,jn?jn.data:void 0);R.fetchers.set(Is,Rl),hn(Is),vn.controller&&G.set(Is,vn.controller)}),Se({fetchers:new Map(R.fetchers)});let Gi=()=>Wr.forEach(vn=>hn(vn.key));et.signal.addEventListener("abort",Gi);let{loaderResults:Ps,fetcherResults:jt}=await ht(Yi,Wr,Gr,ke);if(et.signal.aborted)return;if(et.signal.removeEventListener("abort",Gi),ie.delete(re),G.delete(re),Wr.forEach(vn=>G.delete(vn.key)),R.fetchers.has(re)){let vn=cs(Gt.data);R.fetchers.set(re,vn)}let Wn=Xh(Ps);if(Wn)return Fe(Gr,Wn.result,!1,{preventScrollReset:Ve});if(Wn=Xh(jt),Wn)return J.add(Wn.key),Fe(Gr,Wn.result,!1,{preventScrollReset:Ve});let{loaderData:si,errors:oi}=gx(R,Pr,Ps,void 0,Wr,jt);en(Ir),R.navigation.state==="loading"&&Ir>Q?(At(O,"Expected pending action"),$&&$.abort(),we(R.navigation.location,{matches:Pr,loaderData:si,errors:oi,fetchers:new Map(R.fetchers)})):(Se({errors:oi,loaderData:vx(R.loaderData,si,Pr,oi),fetchers:new Map(R.fetchers)}),Y=!1)}async function qe(re,ae,be,De,ke,$e,Ue,Ve,Ze){let tt=R.fetchers.get(re);ft(re,df(Ze,tt?tt.data:void 0),{flushSync:Ue});let et=new AbortController,Je=yu(e.history,be,et.signal);if($e){let qt=await Pa(De,new URL(Je.url).pathname,Je.signal,re);if(qt.type==="aborted")return;if(qt.type==="error"){wt(re,ae,qt.error,{flushSync:Ue});return}else if(qt.matches)De=qt.matches;else{wt(re,ae,Ga(404,{pathname:be}),{flushSync:Ue});return}}let at=Mp(De,be);G.set(re,et);let Tt=ne,Yt=zu(a,i,Je,De,at,r,ke),Gt=(await Qe(Je,Yt,ke,re))[at.route.id];if(G.get(re)===et&&G.delete(re),!Je.signal.aborted){if(z.has(re)){ft(re,cs(void 0));return}if(ll(Gt))if(Q>Tt){ft(re,cs(void 0));return}else{J.add(re),await Fe(Je,Gt,!1,{preventScrollReset:Ve});return}if(Sa(Gt)){wt(re,ae,Gt.error);return}ft(re,cs(Gt.data))}}async function Fe(re,ae,be,{submission:De,fetcherSubmission:ke,preventScrollReset:$e,replace:Ue}={}){ae.response.headers.has("X-Remix-Revalidate")&&(Y=!0);let Ve=ae.response.headers.get("Location");At(Ve,"Expected a Location header on the redirect Response"),Ve=px(Ve,new URL(re.url),l);let Ze=ud(R.location,Ve,{_isRedirect:!0});if(n){let Yt=!1;if(ae.response.headers.has("X-Remix-Reload-Document"))Yt=!0;else if(w5(Ve)){const gn=z6(Ve,!0);Yt=gn.origin!==t.location.origin||ai(gn.pathname,l)==null}if(Yt){Ue?t.location.replace(Ve):t.location.assign(Ve);return}}$=null;let tt=Ue===!0||ae.response.headers.has("X-Remix-Replace")?"REPLACE":"PUSH",{formMethod:et,formAction:Je,formEncType:at}=R.navigation;!De&&!ke&&et&&Je&&at&&(De=wx(R.navigation));let Tt=De||ke;if(TT.has(ae.response.status)&&Tt&&ia(Tt.formMethod))await Me(tt,Ze,{submission:{...Tt,formAction:Ve},preventScrollReset:$e||j,enableViewTransition:be?V:void 0});else{let Yt=L1(Ze,De);await Me(tt,Ze,{overrideNavigation:Yt,fetcherSubmission:ke,preventScrollReset:$e||j,enableViewTransition:be?V:void 0})}}async function Qe(re,ae,be,De){let ke,$e={};try{ke=await UT(u,re,ae,De,be,!1)}catch(Ue){return ae.filter(Ve=>Ve.shouldLoad).forEach(Ve=>{$e[Ve.route.id]={type:"error",error:Ue}}),$e}if(re.signal.aborted)return $e;for(let[Ue,Ve]of Object.entries(ke))if(KT(Ve)){let Ze=Ve.result;$e[Ue]={type:"redirect",response:VT(Ze,re,Ue,ae,l)}}else $e[Ue]=await HT(Ve);return $e}async function ht(re,ae,be,De){let ke=Qe(be,re,De,null),$e=Promise.all(ae.map(async Ze=>{if(Ze.matches&&Ze.match&&Ze.request&&Ze.controller){let et=(await Qe(Ze.request,Ze.matches,De,Ze.key))[Ze.match.route.id];return{[Ze.key]:et}}else return Promise.resolve({[Ze.key]:{type:"error",error:Ga(404,{pathname:Ze.path})}})})),Ue=await ke,Ve=(await $e).reduce((Ze,tt)=>Object.assign(Ze,tt),{});return{loaderResults:Ue,fetcherResults:Ve}}function gt(){Y=!0,le.forEach((re,ae)=>{G.has(ae)&&se.add(ae),hn(ae)})}function ft(re,ae,be={}){R.fetchers.set(re,ae),Se({fetchers:new Map(R.fetchers)},{flushSync:(be&&be.flushSync)===!0})}function wt(re,ae,be,De={}){let ke=po(R.matches,ae);Et(re),Se({errors:{[ke.route.id]:be},fetchers:new Map(R.fetchers)},{flushSync:(De&&De.flushSync)===!0})}function Vt(re){return L.set(re,(L.get(re)||0)+1),z.has(re)&&z.delete(re),R.fetchers.get(re)||OT}function ut(re,ae){hn(re,ae==null?void 0:ae.reason),ft(re,cs(null))}function Et(re){let ae=R.fetchers.get(re);G.has(re)&&!(ae&&ae.state==="loading"&&ie.has(re))&&hn(re),le.delete(re),ie.delete(re),J.delete(re),z.delete(re),se.delete(re),R.fetchers.delete(re)}function He(re){let ae=(L.get(re)||0)-1;ae<=0?(L.delete(re),z.add(re)):L.set(re,ae),Se({fetchers:new Map(R.fetchers)})}function hn(re,ae){let be=G.get(re);be&&(be.abort(ae),G.delete(re))}function Pt(re){for(let ae of re){let be=Vt(ae),De=cs(be.data);R.fetchers.set(ae,De)}}function Yr(){let re=[],ae=!1;for(let be of J){let De=R.fetchers.get(be);At(De,`Expected fetcher: ${be}`),De.state==="loading"&&(J.delete(be),re.push(be),ae=!0)}return Pt(re),ae}function en(re){let ae=[];for(let[be,De]of ie)if(De<re){let ke=R.fetchers.get(be);At(ke,`Expected fetcher: ${be}`),ke.state==="loading"&&(hn(be),ie.delete(be),ae.push(be))}return Pt(ae),ae.length>0}function pn(re,ae){let be=R.blockers.get(re)||ff;return W.get(re)!==ae&&W.set(re,ae),be}function pa(re){R.blockers.delete(re),W.delete(re)}function It(re,ae){let be=R.blockers.get(re)||ff;At(be.state==="unblocked"&&ae.state==="blocked"||be.state==="blocked"&&ae.state==="blocked"||be.state==="blocked"&&ae.state==="proceeding"||be.state==="blocked"&&ae.state==="unblocked"||be.state==="proceeding"&&ae.state==="unblocked",`Invalid blocker state transition: ${be.state} -> ${ae.state}`);let De=new Map(R.blockers);De.set(re,ae),Se({blockers:De})}function Ai({currentLocation:re,nextLocation:ae,historyAction:be}){if(W.size===0)return;W.size>1&&Fn(!1,"A router only supports one blocker at a time");let De=Array.from(W.entries()),[ke,$e]=De[De.length-1],Ue=R.blockers.get(ke);if(!(Ue&&Ue.state==="proceeding")&&$e({currentLocation:re,nextLocation:ae,historyAction:be}))return ke}function mn(re){let ae=Ga(404,{pathname:re}),be=o||s,{matches:De,route:ke}=Kh(be);return{notFoundMatches:De,route:ke,error:ae}}function ma(re,ae,be){if(d=re,S=ae,v=be||null,!x&&R.navigation===C1){x=!0;let De=pt(R.location,R.matches);De!=null&&Se({restoreScrollPosition:De})}return()=>{d=null,S=null,v=null}}function ka(re,ae){return v&&v(re,ae.map(De=>oT(De,R.loaderData)))||re.key}function Ln(re,ae){if(d&&S){let be=ka(re,ae);d[be]=S()}}function pt(re,ae){if(d){let be=ka(re,ae),De=d[be];if(typeof De=="number")return De}return null}function Ft(re,ae,be){if(e.patchRoutesOnNavigation)if(re){if(Object.keys(re[0].params).length>0)return{active:!0,matches:Rp(ae,be,l,!0)}}else return{active:!0,matches:Rp(ae,be,l,!0)||[]};return{active:!1,matches:null}}async function Pa(re,ae,be,De){if(!e.patchRoutesOnNavigation)return{type:"success",matches:re};let ke=re;for(;;){let $e=o==null,Ue=o||s,Ve=i;try{await e.patchRoutesOnNavigation({signal:be,path:ae,matches:ke,fetcherKey:De,patch:(et,Je)=>{be.aborted||cx(et,Je,Ue,Ve,a,!1)}})}catch(et){return{type:"error",error:et,partialMatches:ke}}finally{$e&&!be.aborted&&(s=[...s])}if(be.aborted)return{type:"aborted"};let Ze=ho(Ue,ae,l);if(Ze)return{type:"success",matches:Ze};let tt=Rp(Ue,ae,l,!0);if(!tt||ke.length===tt.length&&ke.every((et,Je)=>et.route.id===tt[Je].route.id))return{type:"success",matches:null};ke=tt}}function rr(re){i={},o=cd(re,a,void 0,i)}function Ia(re,ae,be=!1){let De=o==null;cx(re,ae,o||s,i,a,be),De&&(s=[...s],Se({}))}return D={get basename(){return l},get future(){return c},get state(){return R},get routes(){return s},get window(){return t},initialize:ee,subscribe:me,enableScrollRestoration:ma,navigate:je,fetch:Te,revalidate:Ae,createHref:re=>e.history.createHref(re),encodeLocation:re=>e.history.encodeLocation(re),getFetcher:Vt,resetFetcher:ut,deleteFetcher:He,dispose:fe,getBlocker:pn,deleteBlocker:pa,patchRoutes:Ia,_internalFetchControllers:G,_internalSetRoutes:rr,_internalSetStateDoNotUseOrYouWillBreakYourApp(re){Se(re)}},D}function kT(e){return e!=null&&("formData"in e&&e.formData!=null||"body"in e&&e.body!==void 0)}function iv(e,t,n,r,a,i){let s,o;if(a){s=[];for(let u of t)if(s.push(u),u.route.id===a){o=u;break}}else s=t,o=t[t.length-1];let l=yg(r||".",vg(s),ai(e.pathname,n)||e.pathname,i==="path");if(r==null&&(l.search=e.search,l.hash=e.hash),(r==null||r===""||r===".")&&o){let u=S5(l.search);if(o.route.index&&!u)l.search=l.search?l.search.replace(/^\?/,"?index&"):"?index";else if(!o.route.index&&u){let c=new URLSearchParams(l.search),f=c.getAll("index");c.delete("index"),f.filter(d=>d).forEach(d=>c.append("index",d));let p=c.toString();l.search=p?`?${p}`:""}}return n!=="/"&&(l.pathname=wT({basename:n,pathname:l.pathname})),ko(l)}function lx(e,t,n){if(!n||!kT(n))return{path:t};if(n.formMethod&&!XT(n.formMethod))return{path:t,error:Ga(405,{method:n.formMethod})};let r=()=>({path:t,error:Ga(400,{type:"invalid-body"})}),i=(n.formMethod||"get").toUpperCase(),s=eA(t);if(n.body!==void 0){if(n.formEncType==="text/plain"){if(!ia(i))return r();let f=typeof n.body=="string"?n.body:n.body instanceof FormData||n.body instanceof URLSearchParams?Array.from(n.body.entries()).reduce((p,[d,v])=>`${p}${d}=${v}
59
+ `,""):String(n.body);return{path:t,submission:{formMethod:i,formAction:s,formEncType:n.formEncType,formData:void 0,json:void 0,text:f}}}else if(n.formEncType==="application/json"){if(!ia(i))return r();try{let f=typeof n.body=="string"?JSON.parse(n.body):n.body;return{path:t,submission:{formMethod:i,formAction:s,formEncType:n.formEncType,formData:void 0,json:f,text:void 0}}}catch{return r()}}}At(typeof FormData=="function","FormData is not available in this environment");let o,l;if(n.formData)o=lv(n.formData),l=n.formData;else if(n.body instanceof FormData)o=lv(n.body),l=n.body;else if(n.body instanceof URLSearchParams)o=n.body,l=mx(o);else if(n.body==null)o=new URLSearchParams,l=new FormData;else try{o=new URLSearchParams(n.body),l=mx(o)}catch{return r()}let u={formMethod:i,formAction:s,formEncType:n&&n.formEncType||"application/x-www-form-urlencoded",formData:l,json:void 0,text:void 0};if(ia(u.formMethod))return{path:t,submission:u};let c=Rs(t);return e&&c.search&&S5(c.search)&&o.append("index",""),c.search=`?${o}`,{path:ko(c),submission:u}}function ux(e,t,n,r,a,i,s,o,l,u,c,f,p,d,v,S,x,g,y,_){var q;let E=_?Sa(_[1])?_[1].error:_[1].data:void 0,D=a.createURL(i.location),R=a.createURL(l),O;if(c&&i.errors){let Y=Object.keys(i.errors)[0];O=s.findIndex(se=>se.route.id===Y)}else if(_&&Sa(_[1])){let Y=_[0];O=s.findIndex(se=>se.route.id===Y)-1}let j=_?_[1].statusCode:void 0,$=j&&j>=400,V={currentUrl:D,currentParams:((q=i.matches[0])==null?void 0:q.params)||{},nextUrl:R,nextParams:s[0].params,...o,actionResult:E,actionStatus:j},T=s.map((Y,se)=>{let{route:G}=Y,ne=null;if(O!=null&&se>O?ne=!1:G.lazy?ne=!0:x5(G)?c?ne=sv(G,i.loaderData,i.errors):PT(i.loaderData,i.matches[se],Y)&&(ne=!0):ne=!1,ne!==null)return ov(n,r,e,Y,u,t,ne);let Q=$?!1:f||D.pathname+D.search===R.pathname+R.search||D.search!==R.search||IT(i.matches[se],Y),ie={...V,defaultShouldRevalidate:Q},J=Am(Y,ie);return ov(n,r,e,Y,u,t,J,ie)}),P=[];return v.forEach((Y,se)=>{if(c||!s.some(z=>z.route.id===Y.routeId)||d.has(se))return;let G=i.fetchers.get(se),ne=G&&G.state!=="idle"&&G.data===void 0,Q=ho(x,Y.path,g);if(!Q){if(y&&ne)return;P.push({key:se,routeId:Y.routeId,path:Y.path,matches:null,match:null,request:null,controller:null});return}if(S.has(se))return;let ie=Mp(Q,Y.path),J=new AbortController,le=yu(a,Y.path,J.signal),L=null;if(p.has(se))p.delete(se),L=zu(n,r,le,Q,ie,u,t);else if(ne)f&&(L=zu(n,r,le,Q,ie,u,t));else{let z={...V,defaultShouldRevalidate:$?!1:f};Am(ie,z)&&(L=zu(n,r,le,Q,ie,u,t,z))}L&&P.push({key:se,routeId:Y.routeId,path:Y.path,matches:L,match:ie,request:le,controller:J})}),{dsMatches:T,revalidatingFetchers:P}}function x5(e){return e.loader!=null||e.middleware!=null&&e.middleware.length>0}function sv(e,t,n){if(e.lazy)return!0;if(!x5(e))return!1;let r=t!=null&&e.id in t,a=n!=null&&n[e.id]!==void 0;return!r&&a?!1:typeof e.loader=="function"&&e.loader.hydrate===!0?!0:!r&&!a}function PT(e,t,n){let r=!t||n.route.id!==t.route.id,a=!e.hasOwnProperty(n.route.id);return r||a}function IT(e,t){let n=e.route.path;return e.pathname!==t.pathname||n!=null&&n.endsWith("*")&&e.params["*"]!==t.params["*"]}function Am(e,t){if(e.route.shouldRevalidate){let n=e.route.shouldRevalidate(t);if(typeof n=="boolean")return n}return t.defaultShouldRevalidate}function cx(e,t,n,r,a,i){let s;if(e){let u=r[e];At(u,`No route found to patch children into: routeId = ${e}`),u.children||(u.children=[]),s=u.children}else s=n;let o=[],l=[];if(t.forEach(u=>{let c=s.find(f=>J6(u,f));c?l.push({existingRoute:c,newRoute:u}):o.push(u)}),o.length>0){let u=cd(o,a,[e||"_","patch",String((s==null?void 0:s.length)||"0")],r);s.push(...u)}if(i&&l.length>0)for(let u=0;u<l.length;u++){let{existingRoute:c,newRoute:f}=l[u],p=c,[d]=cd([f],a,[],{},!0);Object.assign(p,{element:d.element?d.element:p.element,errorElement:d.errorElement?d.errorElement:p.errorElement,hydrateFallbackElement:d.hydrateFallbackElement?d.hydrateFallbackElement:p.hydrateFallbackElement})}}function J6(e,t){return"id"in e&&"id"in t&&e.id===t.id?!0:e.index===t.index&&e.path===t.path&&e.caseSensitive===t.caseSensitive?(!e.children||e.children.length===0)&&(!t.children||t.children.length===0)?!0:e.children.every((n,r)=>{var a;return(a=t.children)==null?void 0:a.some(i=>J6(n,i))}):!1}var fx=new WeakMap,K6=({key:e,route:t,manifest:n,mapRouteProperties:r})=>{let a=n[t.id];if(At(a,"No route found in manifest"),!a.lazy||typeof a.lazy!="object")return;let i=a.lazy[e];if(!i)return;let s=fx.get(a);s||(s={},fx.set(a,s));let o=s[e];if(o)return o;let l=(async()=>{let u=rT(e),f=a[e]!==void 0&&e!=="hasErrorBoundary";if(u)Fn(!u,"Route property "+e+" is not a supported lazy route property. This property will be ignored."),s[e]=Promise.resolve();else if(f)Fn(!1,`Route "${a.id}" has a static property "${e}" defined. The lazy property will be ignored.`);else{let p=await i();p!=null&&(Object.assign(a,{[e]:p}),Object.assign(a,r(a)))}typeof a.lazy=="object"&&(a.lazy[e]=void 0,Object.values(a.lazy).every(p=>p===void 0)&&(a.lazy=void 0))})();return s[e]=l,l},dx=new WeakMap;function FT(e,t,n,r,a){let i=n[e.id];if(At(i,"No route found in manifest"),!e.lazy)return{lazyRoutePromise:void 0,lazyHandlerPromise:void 0};if(typeof e.lazy=="function"){let c=dx.get(i);if(c)return{lazyRoutePromise:c,lazyHandlerPromise:c};let f=(async()=>{At(typeof e.lazy=="function","No lazy route function found");let p=await e.lazy(),d={};for(let v in p){let S=p[v];if(S===void 0)continue;let x=iT(v),y=i[v]!==void 0&&v!=="hasErrorBoundary";x?Fn(!x,"Route property "+v+" is not a supported property to be returned from a lazy route function. This property will be ignored."):y?Fn(!y,`Route "${i.id}" has a static property "${v}" defined but its lazy function is also returning a value for this property. The lazy route property "${v}" will be ignored.`):d[v]=S}Object.assign(i,d),Object.assign(i,{...r(i),lazy:void 0})})();return dx.set(i,f),f.catch(()=>{}),{lazyRoutePromise:f,lazyHandlerPromise:f}}let s=Object.keys(e.lazy),o=[],l;for(let c of s){if(a&&a.includes(c))continue;let f=K6({key:c,route:e,manifest:n,mapRouteProperties:r});f&&(o.push(f),c===t&&(l=f))}let u=o.length>0?Promise.all(o).then(()=>{}):void 0;return u==null||u.catch(()=>{}),l==null||l.catch(()=>{}),{lazyRoutePromise:u,lazyHandlerPromise:l}}async function hx(e){let t=e.matches.filter(a=>a.shouldLoad),n={};return(await Promise.all(t.map(a=>a.resolve()))).forEach((a,i)=>{n[t[i].route.id]=a}),n}async function BT(e){return e.matches.some(t=>t.route.middleware)?X6(e,()=>hx(e)):hx(e)}function X6(e,t){return $T(e,t,r=>r,WT,n);function n(r,a,i){if(i)return Promise.resolve(Object.assign(i.value,{[a]:{type:"error",result:r}}));{let{matches:s}=e,o=Math.min(Math.max(s.findIndex(u=>u.route.id===a),0),Math.max(s.findIndex(u=>u.unstable_shouldCallHandler()),0)),l=po(s,s[o].route.id).route.id;return Promise.resolve({[l]:{type:"error",result:r}})}}}async function $T(e,t,n,r,a){let{matches:i,request:s,params:o,context:l}=e,u=i.flatMap(f=>f.route.middleware?f.route.middleware.map(p=>[f.route.id,p]):[]);return await Q6({request:s,params:o,context:l},u,t,n,r,a)}async function Q6(e,t,n,r,a,i,s=0){let{request:o}=e;if(o.signal.aborted)throw o.signal.reason??new Error(`Request aborted: ${o.method} ${o.url}`);let l=t[s];if(!l)return await n();let[u,c]=l,f,p=async()=>{if(f)throw new Error("You may only call `next()` once per middleware");try{return f={value:await Q6(e,t,n,r,a,i,s+1)},f.value}catch(d){return f={value:await i(d,u,f)},f.value}};try{let d=await c(e,p),v=d!=null?r(d):void 0;return a(v)?v:f?v??f.value:(f={value:await p()},f.value)}catch(d){return await i(d,u,f)}}function Z6(e,t,n,r,a){let i=K6({key:"middleware",route:r.route,manifest:t,mapRouteProperties:e}),s=FT(r.route,ia(n.method)?"action":"loader",t,e,a);return{middleware:i,route:s.lazyRoutePromise,handler:s.lazyHandlerPromise}}function ov(e,t,n,r,a,i,s,o=null){let l=!1,u=Z6(e,t,n,r,a);return{...r,_lazyPromises:u,shouldLoad:s,unstable_shouldRevalidateArgs:o,unstable_shouldCallHandler(c){return l=!0,o?typeof c=="boolean"?Am(r,{...o,defaultShouldRevalidate:c}):Am(r,o):s},resolve(c){let{lazy:f,loader:p,middleware:d}=r.route,v=l||s||c&&!ia(n.method)&&(f||p),S=d&&d.length>0&&!p&&!f;return v&&!S?zT({request:n,match:r,lazyHandlerPromise:u==null?void 0:u.handler,lazyRoutePromise:u==null?void 0:u.route,handlerOverride:c,scopedContext:i}):Promise.resolve({type:"data",result:void 0})}}}function zu(e,t,n,r,a,i,s,o=null){return r.map(l=>l.route.id!==a.route.id?{...l,shouldLoad:!1,unstable_shouldRevalidateArgs:o,unstable_shouldCallHandler:()=>!1,_lazyPromises:Z6(e,t,n,l,i),resolve:()=>Promise.resolve({type:"data",result:void 0})}:ov(e,t,n,l,i,s,!0,o))}async function UT(e,t,n,r,a,i){n.some(u=>{var c;return(c=u._lazyPromises)==null?void 0:c.middleware})&&await Promise.all(n.map(u=>{var c;return(c=u._lazyPromises)==null?void 0:c.middleware}));let s={request:t,params:n[0].params,context:a,matches:n},l=await e({...s,fetcherKey:r,runClientMiddleware:u=>{let c=s;return X6(c,()=>u({...c,fetcherKey:r,runClientMiddleware:()=>{throw new Error("Cannot call `runClientMiddleware()` from within an `runClientMiddleware` handler")}}))}});try{await Promise.all(n.flatMap(u=>{var c,f;return[(c=u._lazyPromises)==null?void 0:c.handler,(f=u._lazyPromises)==null?void 0:f.route]}))}catch{}return l}async function zT({request:e,match:t,lazyHandlerPromise:n,lazyRoutePromise:r,handlerOverride:a,scopedContext:i}){let s,o,l=ia(e.method),u=l?"action":"loader",c=f=>{let p,d=new Promise((x,g)=>p=g);o=()=>p(),e.signal.addEventListener("abort",o);let v=x=>typeof f!="function"?Promise.reject(new Error(`You cannot call the handler for a route which defines a boolean "${u}" [routeId: ${t.route.id}]`)):f({request:e,params:t.params,context:i},...x!==void 0?[x]:[]),S=(async()=>{try{return{type:"data",result:await(a?a(g=>v(g)):v())}}catch(x){return{type:"error",result:x}}})();return Promise.race([S,d])};try{let f=l?t.route.action:t.route.loader;if(n||r)if(f){let p,[d]=await Promise.all([c(f).catch(v=>{p=v}),n,r]);if(p!==void 0)throw p;s=d}else{await n;let p=l?t.route.action:t.route.loader;if(p)[s]=await Promise.all([c(p),r]);else if(u==="action"){let d=new URL(e.url),v=d.pathname+d.search;throw Ga(405,{method:e.method,pathname:v,routeId:t.route.id})}else return{type:"data",result:void 0}}else if(f)s=await c(f);else{let p=new URL(e.url),d=p.pathname+p.search;throw Ga(404,{pathname:d})}}catch(f){return{type:"error",result:f}}finally{o&&e.signal.removeEventListener("abort",o)}return s}async function qT(e){let t=e.headers.get("Content-Type");return t&&/\bapplication\/json\b/.test(t)?e.body==null?null:e.json():e.text()}async function HT(e){var r,a,i,s,o,l;let{result:t,type:n}=e;if(tA(t)){let u;try{u=await qT(t)}catch(c){return{type:"error",error:c}}return n==="error"?{type:"error",error:new _m(t.status,t.statusText,u),statusCode:t.status,headers:t.headers}:{type:"data",data:u,statusCode:t.status,headers:t.headers}}return n==="error"?bx(t)?t.data instanceof Error?{type:"error",error:t.data,statusCode:(r=t.init)==null?void 0:r.status,headers:(a=t.init)!=null&&a.headers?new Headers(t.init.headers):void 0}:{type:"error",error:new _m(((i=t.init)==null?void 0:i.status)||500,void 0,t.data),statusCode:fd(t)?t.status:void 0,headers:(s=t.init)!=null&&s.headers?new Headers(t.init.headers):void 0}:{type:"error",error:t,statusCode:fd(t)?t.status:void 0}:bx(t)?{type:"data",data:t.data,statusCode:(o=t.init)==null?void 0:o.status,headers:(l=t.init)!=null&&l.headers?new Headers(t.init.headers):void 0}:{type:"data",data:t}}function VT(e,t,n,r,a){let i=e.headers.get("Location");if(At(i,"Redirects returned/thrown from loaders/actions must have a Location header"),!w5(i)){let s=r.slice(0,r.findIndex(o=>o.route.id===n)+1);i=iv(new URL(t.url),s,a,i),e.headers.set("Location",i)}return e}function px(e,t,n){if(w5(e)){let r=e,a=r.startsWith("//")?new URL(t.protocol+r):new URL(r),i=ai(a.pathname,n)!=null;if(a.origin===t.origin&&i)return a.pathname+a.search+a.hash}return e}function yu(e,t,n,r){let a=e.createURL(eA(t)).toString(),i={signal:n};if(r&&ia(r.formMethod)){let{formMethod:s,formEncType:o}=r;i.method=s.toUpperCase(),o==="application/json"?(i.headers=new Headers({"Content-Type":o}),i.body=JSON.stringify(r.json)):o==="text/plain"?i.body=r.text:o==="application/x-www-form-urlencoded"&&r.formData?i.body=lv(r.formData):i.body=r.formData}return new Request(a,i)}function lv(e){let t=new URLSearchParams;for(let[n,r]of e.entries())t.append(n,typeof r=="string"?r:r.name);return t}function mx(e){let t=new FormData;for(let[n,r]of e.entries())t.append(n,r);return t}function YT(e,t,n,r=!1,a=!1){let i={},s=null,o,l=!1,u={},c=n&&Sa(n[1])?n[1].error:void 0;return e.forEach(f=>{if(!(f.route.id in t))return;let p=f.route.id,d=t[p];if(At(!ll(d),"Cannot handle redirect results in processLoaderData"),Sa(d)){let v=d.error;if(c!==void 0&&(v=c,c=void 0),s=s||{},a)s[p]=v;else{let S=po(e,p);s[S.route.id]==null&&(s[S.route.id]=v)}r||(i[p]=W6),l||(l=!0,o=fd(d.error)?d.error.status:500),d.headers&&(u[p]=d.headers)}else i[p]=d.data,d.statusCode&&d.statusCode!==200&&!l&&(o=d.statusCode),d.headers&&(u[p]=d.headers)}),c!==void 0&&n&&(s={[n[0]]:c},n[2]&&(i[n[2]]=void 0)),{loaderData:i,errors:s,statusCode:o||200,loaderHeaders:u}}function gx(e,t,n,r,a,i){let{loaderData:s,errors:o}=YT(t,n,r);return a.filter(l=>!l.matches||l.matches.some(u=>u.shouldLoad)).forEach(l=>{let{key:u,match:c,controller:f}=l;if(f&&f.signal.aborted)return;let p=i[u];if(At(p,"Did not find corresponding fetcher result"),Sa(p)){let d=po(e.matches,c==null?void 0:c.route.id);o&&o[d.route.id]||(o={...o,[d.route.id]:p.error}),e.fetchers.delete(u)}else if(ll(p))At(!1,"Unhandled fetcher revalidation redirect");else{let d=cs(p.data);e.fetchers.set(u,d)}}),{loaderData:s,errors:o}}function vx(e,t,n,r){let a=Object.entries(t).filter(([,i])=>i!==W6).reduce((i,[s,o])=>(i[s]=o,i),{});for(let i of n){let s=i.route.id;if(!t.hasOwnProperty(s)&&e.hasOwnProperty(s)&&i.route.loader&&(a[s]=e[s]),r&&r.hasOwnProperty(s))break}return a}function yx(e){return e?Sa(e[1])?{actionData:{}}:{actionData:{[e[0]]:e[1].data}}:{}}function po(e,t){return(t?e.slice(0,e.findIndex(r=>r.route.id===t)+1):[...e]).reverse().find(r=>r.route.hasErrorBoundary===!0)||e[0]}function Kh(e){let t=e.length===1?e[0]:e.find(n=>n.index||!n.path||n.path==="/")||{id:"__shim-error-route__"};return{matches:[{params:{},pathname:"",pathnameBase:"",route:t}],route:t}}function Ga(e,{pathname:t,routeId:n,method:r,type:a,message:i}={}){let s="Unknown Server Error",o="Unknown @remix-run/router error";return e===400?(s="Bad Request",r&&t&&n?o=`You made a ${r} request to "${t}" but did not provide a \`loader\` for route "${n}", so there is no way to handle the request.`:a==="invalid-body"&&(o="Unable to encode submission body")):e===403?(s="Forbidden",o=`Route "${n}" does not match URL "${t}"`):e===404?(s="Not Found",o=`No route matches URL "${t}"`):e===405&&(s="Method Not Allowed",r&&t&&n?o=`You made a ${r.toUpperCase()} request to "${t}" but did not provide an \`action\` for route "${n}", so there is no way to handle the request.`:r&&(o=`Invalid request method "${r.toUpperCase()}"`)),new _m(e||500,s,new Error(o),!0)}function Xh(e){let t=Object.entries(e);for(let n=t.length-1;n>=0;n--){let[r,a]=t[n];if(ll(a))return{key:r,result:a}}}function eA(e){let t=typeof e=="string"?Rs(e):e;return ko({...t,hash:""})}function GT(e,t){return e.pathname!==t.pathname||e.search!==t.search?!1:e.hash===""?t.hash!=="":e.hash===t.hash?!0:t.hash!==""}function WT(e){return e!=null&&typeof e=="object"&&Object.entries(e).every(([t,n])=>typeof t=="string"&&JT(n))}function JT(e){return e!=null&&typeof e=="object"&&"type"in e&&"result"in e&&(e.type==="data"||e.type==="error")}function KT(e){return tA(e.result)&&jT.has(e.result.status)}function Sa(e){return e.type==="error"}function ll(e){return(e&&e.type)==="redirect"}function bx(e){return typeof e=="object"&&e!=null&&"type"in e&&"data"in e&&"init"in e&&e.type==="DataWithResponseInit"}function tA(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.headers=="object"&&typeof e.body<"u"}function XT(e){return LT.has(e.toUpperCase())}function ia(e){return ET.has(e.toUpperCase())}function S5(e){return new URLSearchParams(e).getAll("index").some(t=>t==="")}function Mp(e,t){let n=typeof t=="string"?Rs(t).search:t.search;if(e[e.length-1].route.index&&S5(n||""))return e[e.length-1];let r=V6(e);return r[r.length-1]}function wx(e){let{formMethod:t,formAction:n,formEncType:r,text:a,formData:i,json:s}=e;if(!(!t||!n||!r)){if(a!=null)return{formMethod:t,formAction:n,formEncType:r,formData:void 0,json:void 0,text:a};if(i!=null)return{formMethod:t,formAction:n,formEncType:r,formData:i,json:void 0,text:void 0};if(s!==void 0)return{formMethod:t,formAction:n,formEncType:r,formData:void 0,json:s,text:void 0}}}function L1(e,t){return t?{state:"loading",location:e,formMethod:t.formMethod,formAction:t.formAction,formEncType:t.formEncType,formData:t.formData,json:t.json,text:t.text}:{state:"loading",location:e,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0}}function QT(e,t){return{state:"submitting",location:e,formMethod:t.formMethod,formAction:t.formAction,formEncType:t.formEncType,formData:t.formData,json:t.json,text:t.text}}function df(e,t){return e?{state:"loading",formMethod:e.formMethod,formAction:e.formAction,formEncType:e.formEncType,formData:e.formData,json:e.json,text:e.text,data:t}:{state:"loading",formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0,data:t}}function ZT(e,t){return{state:"submitting",formMethod:e.formMethod,formAction:e.formAction,formEncType:e.formEncType,formData:e.formData,json:e.json,text:e.text,data:t?t.data:void 0}}function cs(e){return{state:"idle",formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0,data:e}}function e7(e,t){try{let n=e.sessionStorage.getItem(G6);if(n){let r=JSON.parse(n);for(let[a,i]of Object.entries(r||{}))i&&Array.isArray(i)&&t.set(a,new Set(i||[]))}}catch{}}function t7(e,t){if(t.size>0){let n={};for(let[r,a]of t)n[r]=[...a];try{e.sessionStorage.setItem(G6,JSON.stringify(n))}catch(r){Fn(!1,`Failed to save applied view transitions in sessionStorage (${r}).`)}}}function n7(){let e,t,n=new Promise((r,a)=>{e=async i=>{r(i);try{await n}catch{}},t=async i=>{a(i);try{await n}catch{}}});return{promise:n,resolve:e,reject:t}}var Tl=C.createContext(null);Tl.displayName="DataRouter";var Pd=C.createContext(null);Pd.displayName="DataRouterState";C.createContext(!1);var _5=C.createContext({isTransitioning:!1});_5.displayName="ViewTransition";var nA=C.createContext(new Map);nA.displayName="Fetchers";var r7=C.createContext(null);r7.displayName="Await";var wi=C.createContext(null);wi.displayName="Navigation";var Id=C.createContext(null);Id.displayName="Location";var ii=C.createContext({outlet:null,matches:[],isDataRoute:!1});ii.displayName="Route";var A5=C.createContext(null);A5.displayName="RouteError";function a7(e,{relative:t}={}){At(Ac(),"useHref() may be used only in the context of a <Router> component.");let{basename:n,navigator:r}=C.useContext(wi),{hash:a,pathname:i,search:s}=Fd(e,{relative:t}),o=i;return n!=="/"&&(o=i==="/"?n:Bi([n,i])),r.createHref({pathname:o,search:s,hash:a})}function Ac(){return C.useContext(Id)!=null}function xi(){return At(Ac(),"useLocation() may be used only in the context of a <Router> component."),C.useContext(Id).location}var rA="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function aA(e){C.useContext(wi).static||C.useLayoutEffect(e)}function fa(){let{isDataRoute:e}=C.useContext(ii);return e?b7():i7()}function i7(){At(Ac(),"useNavigate() may be used only in the context of a <Router> component.");let e=C.useContext(Tl),{basename:t,navigator:n}=C.useContext(wi),{matches:r}=C.useContext(ii),{pathname:a}=xi(),i=JSON.stringify(vg(r)),s=C.useRef(!1);return aA(()=>{s.current=!0}),C.useCallback((l,u={})=>{if(Fn(s.current,rA),!s.current)return;if(typeof l=="number"){n.go(l);return}let c=yg(l,JSON.parse(i),a,u.relative==="path");e==null&&t!=="/"&&(c.pathname=c.pathname==="/"?t:Bi([t,c.pathname])),(u.replace?n.replace:n.push)(c,u.state,u)},[t,n,i,a,e])}var s7=C.createContext(null);function o7(e){let t=C.useContext(ii).outlet;return C.useMemo(()=>t&&C.createElement(s7.Provider,{value:e},t),[t,e])}function Cn(){let{matches:e}=C.useContext(ii),t=e[e.length-1];return t?t.params:{}}function Fd(e,{relative:t}={}){let{matches:n}=C.useContext(ii),{pathname:r}=xi(),a=JSON.stringify(vg(n));return C.useMemo(()=>yg(e,JSON.parse(a),r,t==="path"),[e,a,r,t])}function l7(e,t){return iA(e,t)}function iA(e,t,n,r,a){var y;At(Ac(),"useRoutes() may be used only in the context of a <Router> component.");let{navigator:i}=C.useContext(wi),{matches:s}=C.useContext(ii),o=s[s.length-1],l=o?o.params:{},u=o?o.pathname:"/",c=o?o.pathnameBase:"/",f=o&&o.route;{let _=f&&f.path||"";sA(u,!f||_.endsWith("*")||_.endsWith("*?"),`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${u}" (under <Route path="${_}">) but the parent route path has no trailing "*". This means if you navigate deeper, the parent won't match anymore and therefore the child routes will never render.
60
+
61
+ Please change the parent <Route path="${_}"> to <Route path="${_==="/"?"*":`${_}/*`}">.`)}let p=xi(),d;if(t){let _=typeof t=="string"?Rs(t):t;At(c==="/"||((y=_.pathname)==null?void 0:y.startsWith(c)),`When overriding the location using \`<Routes location>\` or \`useRoutes(routes, location)\`, the location pathname must begin with the portion of the URL pathname that was matched by all parent routes. The current pathname base is "${c}" but pathname "${_.pathname}" was given in the \`location\` prop.`),d=_}else d=p;let v=d.pathname||"/",S=v;if(c!=="/"){let _=c.replace(/^\//,"").split("/");S="/"+v.replace(/^\//,"").split("/").slice(_.length).join("/")}let x=ho(e,{pathname:S});Fn(f||x!=null,`No routes matched location "${d.pathname}${d.search}${d.hash}" `),Fn(x==null||x[x.length-1].route.element!==void 0||x[x.length-1].route.Component!==void 0||x[x.length-1].route.lazy!==void 0,`Matched leaf route at location "${d.pathname}${d.search}${d.hash}" does not have an element or Component. This means it will render an <Outlet /> with a null value by default resulting in an "empty" page.`);let g=h7(x&&x.map(_=>Object.assign({},_,{params:Object.assign({},l,_.params),pathname:Bi([c,i.encodeLocation?i.encodeLocation(_.pathname.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:_.pathname]),pathnameBase:_.pathnameBase==="/"?c:Bi([c,i.encodeLocation?i.encodeLocation(_.pathnameBase.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:_.pathnameBase])})),s,n,r,a);return t&&g?C.createElement(Id.Provider,{value:{location:{pathname:"/",search:"",hash:"",state:null,key:"default",...d},navigationType:"POP"}},g):g}function u7(){let e=y7(),t=fd(e)?`${e.status} ${e.statusText}`:e instanceof Error?e.message:JSON.stringify(e),n=e instanceof Error?e.stack:null,r="rgba(200,200,200, 0.5)",a={padding:"0.5rem",backgroundColor:r},i={padding:"2px 4px",backgroundColor:r},s=null;return console.error("Error handled by React Router default ErrorBoundary:",e),s=C.createElement(C.Fragment,null,C.createElement("p",null,"💿 Hey developer 👋"),C.createElement("p",null,"You can provide a way better UX than this when your app throws errors by providing your own ",C.createElement("code",{style:i},"ErrorBoundary")," or"," ",C.createElement("code",{style:i},"errorElement")," prop on your route.")),C.createElement(C.Fragment,null,C.createElement("h2",null,"Unexpected Application Error!"),C.createElement("h3",{style:{fontStyle:"italic"}},t),n?C.createElement("pre",{style:a},n):null,s)}var c7=C.createElement(u7,null),f7=class extends C.Component{constructor(e){super(e),this.state={location:e.location,revalidation:e.revalidation,error:e.error}}static getDerivedStateFromError(e){return{error:e}}static getDerivedStateFromProps(e,t){return t.location!==e.location||t.revalidation!=="idle"&&e.revalidation==="idle"?{error:e.error,location:e.location,revalidation:e.revalidation}:{error:e.error!==void 0?e.error:t.error,location:t.location,revalidation:e.revalidation||t.revalidation}}componentDidCatch(e,t){this.props.unstable_onError?this.props.unstable_onError(e,t):console.error("React Router caught the following error during render",e)}render(){return this.state.error!==void 0?C.createElement(ii.Provider,{value:this.props.routeContext},C.createElement(A5.Provider,{value:this.state.error,children:this.props.component})):this.props.children}};function d7({routeContext:e,match:t,children:n}){let r=C.useContext(Tl);return r&&r.static&&r.staticContext&&(t.route.errorElement||t.route.ErrorBoundary)&&(r.staticContext._deepestRenderedBoundaryId=t.route.id),C.createElement(ii.Provider,{value:e},n)}function h7(e,t=[],n=null,r=null,a=null){if(e==null){if(!n)return null;if(n.errors)e=n.matches;else if(t.length===0&&!n.initialized&&n.matches.length>0)e=n.matches;else return null}let i=e,s=n==null?void 0:n.errors;if(s!=null){let u=i.findIndex(c=>c.route.id&&(s==null?void 0:s[c.route.id])!==void 0);At(u>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(s).join(",")}`),i=i.slice(0,Math.min(i.length,u+1))}let o=!1,l=-1;if(n)for(let u=0;u<i.length;u++){let c=i[u];if((c.route.HydrateFallback||c.route.hydrateFallbackElement)&&(l=u),c.route.id){let{loaderData:f,errors:p}=n,d=c.route.loader&&!f.hasOwnProperty(c.route.id)&&(!p||p[c.route.id]===void 0);if(c.route.lazy||d){o=!0,l>=0?i=i.slice(0,l+1):i=[i[0]];break}}}return i.reduceRight((u,c,f)=>{let p,d=!1,v=null,S=null;n&&(p=s&&c.route.id?s[c.route.id]:void 0,v=c.route.errorElement||c7,o&&(l<0&&f===0?(sA("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),d=!0,S=null):l===f&&(d=!0,S=c.route.hydrateFallbackElement||null)));let x=t.concat(i.slice(0,f+1)),g=()=>{let y;return p?y=v:d?y=S:c.route.Component?y=C.createElement(c.route.Component,null):c.route.element?y=c.route.element:y=u,C.createElement(d7,{match:c,routeContext:{outlet:u,matches:x,isDataRoute:n!=null},children:y})};return n&&(c.route.ErrorBoundary||c.route.errorElement||f===0)?C.createElement(f7,{location:n.location,revalidation:n.revalidation,component:v,error:p,children:g(),routeContext:{outlet:null,matches:x,isDataRoute:!0},unstable_onError:r}):g()},null)}function N5(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function p7(e){let t=C.useContext(Tl);return At(t,N5(e)),t}function m7(e){let t=C.useContext(Pd);return At(t,N5(e)),t}function g7(e){let t=C.useContext(ii);return At(t,N5(e)),t}function E5(e){let t=g7(e),n=t.matches[t.matches.length-1];return At(n.route.id,`${e} can only be used on routes that contain a unique "id"`),n.route.id}function v7(){return E5("useRouteId")}function y7(){var r;let e=C.useContext(A5),t=m7("useRouteError"),n=E5("useRouteError");return e!==void 0?e:(r=t.errors)==null?void 0:r[n]}function b7(){let{router:e}=p7("useNavigate"),t=E5("useNavigate"),n=C.useRef(!1);return aA(()=>{n.current=!0}),C.useCallback(async(a,i={})=>{Fn(n.current,rA),n.current&&(typeof a=="number"?e.navigate(a):await e.navigate(a,{fromRouteId:t,...i}))},[e,t])}var xx={};function sA(e,t,n){!t&&!xx[e]&&(xx[e]=!0,Fn(!1,n))}var Sx={};function _x(e,t){!e&&!Sx[t]&&(Sx[t]=!0,console.warn(t))}function w7(e){let t={hasErrorBoundary:e.hasErrorBoundary||e.ErrorBoundary!=null||e.errorElement!=null};return e.Component&&(e.element&&Fn(!1,"You should not include both `Component` and `element` on your route - `Component` will be used."),Object.assign(t,{element:C.createElement(e.Component),Component:void 0})),e.HydrateFallback&&(e.hydrateFallbackElement&&Fn(!1,"You should not include both `HydrateFallback` and `hydrateFallbackElement` on your route - `HydrateFallback` will be used."),Object.assign(t,{hydrateFallbackElement:C.createElement(e.HydrateFallback),HydrateFallback:void 0})),e.ErrorBoundary&&(e.errorElement&&Fn(!1,"You should not include both `ErrorBoundary` and `errorElement` on your route - `ErrorBoundary` will be used."),Object.assign(t,{errorElement:C.createElement(e.ErrorBoundary),ErrorBoundary:void 0})),t}var x7=["HydrateFallback","hydrateFallbackElement"],S7=class{constructor(){this.status="pending",this.promise=new Promise((t,n)=>{this.resolve=r=>{this.status==="pending"&&(this.status="resolved",t(r))},this.reject=r=>{this.status==="pending"&&(this.status="rejected",n(r))}})}};function _7({router:e,flushSync:t,unstable_onError:n}){let[r,a]=C.useState(e.state),[i,s]=C.useState(),[o,l]=C.useState({isTransitioning:!1}),[u,c]=C.useState(),[f,p]=C.useState(),[d,v]=C.useState(),S=C.useRef(new Map),x=C.useCallback(D=>{a(R=>(D.errors&&n&&Object.entries(D.errors).forEach(([O,j])=>{var $;(($=R.errors)==null?void 0:$[O])!==j&&n(j)}),D))},[n]),g=C.useCallback((D,{deletedFetchers:R,flushSync:O,viewTransitionOpts:j})=>{D.fetchers.forEach((V,T)=>{V.data!==void 0&&S.current.set(T,V.data)}),R.forEach(V=>S.current.delete(V)),_x(O===!1||t!=null,'You provided the `flushSync` option to a router update, but you are not using the `<RouterProvider>` from `react-router/dom` so `ReactDOM.flushSync()` is unavailable. Please update your app to `import { RouterProvider } from "react-router/dom"` and ensure you have `react-dom` installed as a dependency to use the `flushSync` option.');let $=e.window!=null&&e.window.document!=null&&typeof e.window.document.startViewTransition=="function";if(_x(j==null||$,"You provided the `viewTransition` option to a router update, but you do not appear to be running in a DOM environment as `window.startViewTransition` is not available."),!j||!$){t&&O?t(()=>x(D)):C.startTransition(()=>x(D));return}if(t&&O){t(()=>{f&&(u&&u.resolve(),f.skipTransition()),l({isTransitioning:!0,flushSync:!0,currentLocation:j.currentLocation,nextLocation:j.nextLocation})});let V=e.window.document.startViewTransition(()=>{t(()=>x(D))});V.finished.finally(()=>{t(()=>{c(void 0),p(void 0),s(void 0),l({isTransitioning:!1})})}),t(()=>p(V));return}f?(u&&u.resolve(),f.skipTransition(),v({state:D,currentLocation:j.currentLocation,nextLocation:j.nextLocation})):(s(D),l({isTransitioning:!0,flushSync:!1,currentLocation:j.currentLocation,nextLocation:j.nextLocation}))},[e.window,t,f,u,x]);C.useLayoutEffect(()=>e.subscribe(g),[e,g]),C.useEffect(()=>{o.isTransitioning&&!o.flushSync&&c(new S7)},[o]),C.useEffect(()=>{if(u&&i&&e.window){let D=i,R=u.promise,O=e.window.document.startViewTransition(async()=>{C.startTransition(()=>x(D)),await R});O.finished.finally(()=>{c(void 0),p(void 0),s(void 0),l({isTransitioning:!1})}),p(O)}},[i,u,e.window,x]),C.useEffect(()=>{u&&i&&r.location.key===i.location.key&&u.resolve()},[u,f,r.location,i]),C.useEffect(()=>{!o.isTransitioning&&d&&(s(d.state),l({isTransitioning:!0,flushSync:!1,currentLocation:d.currentLocation,nextLocation:d.nextLocation}),v(void 0))},[o.isTransitioning,d]);let y=C.useMemo(()=>({createHref:e.createHref,encodeLocation:e.encodeLocation,go:D=>e.navigate(D),push:(D,R,O)=>e.navigate(D,{state:R,preventScrollReset:O==null?void 0:O.preventScrollReset}),replace:(D,R,O)=>e.navigate(D,{replace:!0,state:R,preventScrollReset:O==null?void 0:O.preventScrollReset})}),[e]),_=e.basename||"/",E=C.useMemo(()=>({router:e,navigator:y,static:!1,basename:_,unstable_onError:n}),[e,y,_,n]);return C.createElement(C.Fragment,null,C.createElement(Tl.Provider,{value:E},C.createElement(Pd.Provider,{value:r},C.createElement(nA.Provider,{value:S.current},C.createElement(_5.Provider,{value:o},C.createElement(C7,{basename:_,location:r.location,navigationType:r.historyAction,navigator:y},C.createElement(A7,{routes:e.routes,future:e.future,state:r,unstable_onError:n})))))),null)}var A7=C.memo(N7);function N7({routes:e,future:t,state:n,unstable_onError:r}){return iA(e,void 0,n,r,t)}function Qh({to:e,replace:t,state:n,relative:r}){At(Ac(),"<Navigate> may be used only in the context of a <Router> component.");let{static:a}=C.useContext(wi);Fn(!a,"<Navigate> must not be used on the initial render in a <StaticRouter>. This is a no-op, but you should modify your code so the <Navigate> is only ever rendered in response to some user interaction or state change.");let{matches:i}=C.useContext(ii),{pathname:s}=xi(),o=fa(),l=yg(e,vg(i),s,r==="path"),u=JSON.stringify(l);return C.useEffect(()=>{o(JSON.parse(u),{replace:t,state:n,relative:r})},[o,u,r,t,n]),null}function E7(e){return o7(e.context)}function Ur(e){At(!1,"A <Route> is only ever to be used as the child of <Routes> element, never rendered directly. Please wrap your <Route> in a <Routes>.")}function C7({basename:e="/",children:t=null,location:n,navigationType:r="POP",navigator:a,static:i=!1}){At(!Ac(),"You cannot render a <Router> inside another <Router>. You should never have more than one in your app.");let s=e.replace(/^\/*/,"/"),o=C.useMemo(()=>({basename:s,navigator:a,static:i,future:{}}),[s,a,i]);typeof n=="string"&&(n=Rs(n));let{pathname:l="/",search:u="",hash:c="",state:f=null,key:p="default"}=n,d=C.useMemo(()=>{let v=ai(l,s);return v==null?null:{location:{pathname:v,search:u,hash:c,state:f,key:p},navigationType:r}},[s,l,u,c,f,p,r]);return Fn(d!=null,`<Router basename="${s}"> is not able to match the URL "${l}${u}${c}" because it does not start with the basename, so the <Router> won't render anything.`),d==null?null:C.createElement(wi.Provider,{value:o},C.createElement(Id.Provider,{children:t,value:d}))}function L7({children:e,location:t}){return l7(uv(e),t)}function uv(e,t=[]){let n=[];return C.Children.forEach(e,(r,a)=>{if(!C.isValidElement(r))return;let i=[...t,a];if(r.type===C.Fragment){n.push.apply(n,uv(r.props.children,i));return}At(r.type===Ur,`[${typeof r.type=="string"?r.type:r.type.name}] is not a <Route> component. All component children of <Routes> must be a <Route> or <React.Fragment>`),At(!r.props.index||!r.props.children,"An index route cannot have child routes.");let s={id:r.props.id||i.join("-"),caseSensitive:r.props.caseSensitive,element:r.props.element,Component:r.props.Component,index:r.props.index,path:r.props.path,middleware:r.props.middleware,loader:r.props.loader,action:r.props.action,hydrateFallbackElement:r.props.hydrateFallbackElement,HydrateFallback:r.props.HydrateFallback,errorElement:r.props.errorElement,ErrorBoundary:r.props.ErrorBoundary,hasErrorBoundary:r.props.hasErrorBoundary===!0||r.props.ErrorBoundary!=null||r.props.errorElement!=null,shouldRevalidate:r.props.shouldRevalidate,handle:r.props.handle,lazy:r.props.lazy};r.props.children&&(s.children=uv(r.props.children,i)),n.push(s)}),n}var kp="get",Pp="application/x-www-form-urlencoded";function bg(e){return e!=null&&typeof e.tagName=="string"}function j7(e){return bg(e)&&e.tagName.toLowerCase()==="button"}function T7(e){return bg(e)&&e.tagName.toLowerCase()==="form"}function O7(e){return bg(e)&&e.tagName.toLowerCase()==="input"}function D7(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function R7(e,t){return e.button===0&&(!t||t==="_self")&&!D7(e)}function cv(e=""){return new URLSearchParams(typeof e=="string"||Array.isArray(e)||e instanceof URLSearchParams?e:Object.keys(e).reduce((t,n)=>{let r=e[n];return t.concat(Array.isArray(r)?r.map(a=>[n,a]):[[n,r]])},[]))}function M7(e,t){let n=cv(e);return t&&t.forEach((r,a)=>{n.has(a)||t.getAll(a).forEach(i=>{n.append(a,i)})}),n}var Zh=null;function k7(){if(Zh===null)try{new FormData(document.createElement("form"),0),Zh=!1}catch{Zh=!0}return Zh}var P7=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function j1(e){return e!=null&&!P7.has(e)?(Fn(!1,`"${e}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${Pp}"`),null):e}function I7(e,t){let n,r,a,i,s;if(T7(e)){let o=e.getAttribute("action");r=o?ai(o,t):null,n=e.getAttribute("method")||kp,a=j1(e.getAttribute("enctype"))||Pp,i=new FormData(e)}else if(j7(e)||O7(e)&&(e.type==="submit"||e.type==="image")){let o=e.form;if(o==null)throw new Error('Cannot submit a <button> or <input type="submit"> without a <form>');let l=e.getAttribute("formaction")||o.getAttribute("action");if(r=l?ai(l,t):null,n=e.getAttribute("formmethod")||o.getAttribute("method")||kp,a=j1(e.getAttribute("formenctype"))||j1(o.getAttribute("enctype"))||Pp,i=new FormData(o,e),!k7()){let{name:u,type:c,value:f}=e;if(c==="image"){let p=u?`${u}.`:"";i.append(`${p}x`,"0"),i.append(`${p}y`,"0")}else u&&i.append(u,f)}}else{if(bg(e))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');n=kp,r=null,a=Pp,s=e}return i&&a==="text/plain"&&(s=i,i=void 0),{action:r,method:n.toLowerCase(),encType:a,formData:i,body:s}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");function C5(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function F7(e,t,n){let r=typeof e=="string"?new URL(e,typeof window>"u"?"server://singlefetch/":window.location.origin):e;return r.pathname==="/"?r.pathname=`_root.${n}`:t&&ai(r.pathname,t)==="/"?r.pathname=`${t.replace(/\/$/,"")}/_root.${n}`:r.pathname=`${r.pathname.replace(/\/$/,"")}.${n}`,r}async function B7(e,t){if(e.id in t)return t[e.id];try{let n=await import(e.module);return t[e.id]=n,n}catch(n){return console.error(`Error loading route module \`${e.module}\`, reloading page...`),console.error(n),window.__reactRouterContext&&window.__reactRouterContext.isSpaMode,window.location.reload(),new Promise(()=>{})}}function $7(e){return e==null?!1:e.href==null?e.rel==="preload"&&typeof e.imageSrcSet=="string"&&typeof e.imageSizes=="string":typeof e.rel=="string"&&typeof e.href=="string"}async function U7(e,t,n){let r=await Promise.all(e.map(async a=>{let i=t.routes[a.route.id];if(i){let s=await B7(i,n);return s.links?s.links():[]}return[]}));return V7(r.flat(1).filter($7).filter(a=>a.rel==="stylesheet"||a.rel==="preload").map(a=>a.rel==="stylesheet"?{...a,rel:"prefetch",as:"style"}:{...a,rel:"prefetch"}))}function Ax(e,t,n,r,a,i){let s=(l,u)=>n[u]?l.route.id!==n[u].route.id:!0,o=(l,u)=>{var c;return n[u].pathname!==l.pathname||((c=n[u].route.path)==null?void 0:c.endsWith("*"))&&n[u].params["*"]!==l.params["*"]};return i==="assets"?t.filter((l,u)=>s(l,u)||o(l,u)):i==="data"?t.filter((l,u)=>{var f;let c=r.routes[l.route.id];if(!c||!c.hasLoader)return!1;if(s(l,u)||o(l,u))return!0;if(l.route.shouldRevalidate){let p=l.route.shouldRevalidate({currentUrl:new URL(a.pathname+a.search+a.hash,window.origin),currentParams:((f=n[0])==null?void 0:f.params)||{},nextUrl:new URL(e,window.origin),nextParams:l.params,defaultShouldRevalidate:!0});if(typeof p=="boolean")return p}return!0}):[]}function z7(e,t,{includeHydrateFallback:n}={}){return q7(e.map(r=>{let a=t.routes[r.route.id];if(!a)return[];let i=[a.module];return a.clientActionModule&&(i=i.concat(a.clientActionModule)),a.clientLoaderModule&&(i=i.concat(a.clientLoaderModule)),n&&a.hydrateFallbackModule&&(i=i.concat(a.hydrateFallbackModule)),a.imports&&(i=i.concat(a.imports)),i}).flat(1))}function q7(e){return[...new Set(e)]}function H7(e){let t={},n=Object.keys(e).sort();for(let r of n)t[r]=e[r];return t}function V7(e,t){let n=new Set;return new Set(t),e.reduce((r,a)=>{let i=JSON.stringify(H7(a));return n.has(i)||(n.add(i),r.push({key:i,link:a})),r},[])}function oA(){let e=C.useContext(Tl);return C5(e,"You must render this element inside a <DataRouterContext.Provider> element"),e}function Y7(){let e=C.useContext(Pd);return C5(e,"You must render this element inside a <DataRouterStateContext.Provider> element"),e}var L5=C.createContext(void 0);L5.displayName="FrameworkContext";function lA(){let e=C.useContext(L5);return C5(e,"You must render this element inside a <HydratedRouter> element"),e}function G7(e,t){let n=C.useContext(L5),[r,a]=C.useState(!1),[i,s]=C.useState(!1),{onFocus:o,onBlur:l,onMouseEnter:u,onMouseLeave:c,onTouchStart:f}=t,p=C.useRef(null);C.useEffect(()=>{if(e==="render"&&s(!0),e==="viewport"){let S=g=>{g.forEach(y=>{s(y.isIntersecting)})},x=new IntersectionObserver(S,{threshold:.5});return p.current&&x.observe(p.current),()=>{x.disconnect()}}},[e]),C.useEffect(()=>{if(r){let S=setTimeout(()=>{s(!0)},100);return()=>{clearTimeout(S)}}},[r]);let d=()=>{a(!0)},v=()=>{a(!1),s(!1)};return n?e!=="intent"?[i,p,{}]:[i,p,{onFocus:hf(o,d),onBlur:hf(l,v),onMouseEnter:hf(u,d),onMouseLeave:hf(c,v),onTouchStart:hf(f,d)}]:[!1,p,{}]}function hf(e,t){return n=>{e&&e(n),n.defaultPrevented||t(n)}}function W7({page:e,...t}){let{router:n}=oA(),r=C.useMemo(()=>ho(n.routes,e,n.basename),[n.routes,e,n.basename]);return r?C.createElement(K7,{page:e,matches:r,...t}):null}function J7(e){let{manifest:t,routeModules:n}=lA(),[r,a]=C.useState([]);return C.useEffect(()=>{let i=!1;return U7(e,t,n).then(s=>{i||a(s)}),()=>{i=!0}},[e,t,n]),r}function K7({page:e,matches:t,...n}){let r=xi(),{manifest:a,routeModules:i}=lA(),{basename:s}=oA(),{loaderData:o,matches:l}=Y7(),u=C.useMemo(()=>Ax(e,t,l,a,r,"data"),[e,t,l,a,r]),c=C.useMemo(()=>Ax(e,t,l,a,r,"assets"),[e,t,l,a,r]),f=C.useMemo(()=>{if(e===r.pathname+r.search+r.hash)return[];let v=new Set,S=!1;if(t.forEach(g=>{var _;let y=a.routes[g.route.id];!y||!y.hasLoader||(!u.some(E=>E.route.id===g.route.id)&&g.route.id in o&&((_=i[g.route.id])!=null&&_.shouldRevalidate)||y.hasClientLoader?S=!0:v.add(g.route.id))}),v.size===0)return[];let x=F7(e,s,"data");return S&&v.size>0&&x.searchParams.set("_routes",t.filter(g=>v.has(g.route.id)).map(g=>g.route.id).join(",")),[x.pathname+x.search]},[s,o,r,a,u,t,e,i]),p=C.useMemo(()=>z7(c,a),[c,a]),d=J7(c);return C.createElement(C.Fragment,null,f.map(v=>C.createElement("link",{key:v,rel:"prefetch",as:"fetch",href:v,...n})),p.map(v=>C.createElement("link",{key:v,rel:"modulepreload",href:v,...n})),d.map(({key:v,link:S})=>C.createElement("link",{key:v,nonce:n.nonce,...S})))}function X7(...e){return t=>{e.forEach(n=>{typeof n=="function"?n(t):n!=null&&(n.current=t)})}}var uA=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";try{uA&&(window.__reactRouterVersion="7.9.3")}catch{}function Q7(e,t){return MT({basename:t==null?void 0:t.basename,getContext:t==null?void 0:t.getContext,future:t==null?void 0:t.future,history:Zj({window:t==null?void 0:t.window}),hydrationData:Z7(),routes:e,mapRouteProperties:w7,hydrationRouteProperties:x7,dataStrategy:t==null?void 0:t.dataStrategy,patchRoutesOnNavigation:t==null?void 0:t.patchRoutesOnNavigation,window:t==null?void 0:t.window}).initialize()}function Z7(){let e=window==null?void 0:window.__staticRouterHydrationData;return e&&e.errors&&(e={...e,errors:eO(e.errors)}),e}function eO(e){if(!e)return null;let t=Object.entries(e),n={};for(let[r,a]of t)if(a&&a.__type==="RouteErrorResponse")n[r]=new _m(a.status,a.statusText,a.data,a.internal===!0);else if(a&&a.__type==="Error"){if(a.__subType){let i=window[a.__subType];if(typeof i=="function")try{let s=new i(a.message);s.stack="",n[r]=s}catch{}}if(n[r]==null){let i=new Error(a.message);i.stack="",n[r]=i}}else n[r]=a;return n}var cA=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,wg=C.forwardRef(function({onClick:t,discover:n="render",prefetch:r="none",relative:a,reloadDocument:i,replace:s,state:o,target:l,to:u,preventScrollReset:c,viewTransition:f,...p},d){let{basename:v}=C.useContext(wi),S=typeof u=="string"&&cA.test(u),x,g=!1;if(typeof u=="string"&&S&&(x=u,uA))try{let $=new URL(window.location.href),V=u.startsWith("//")?new URL($.protocol+u):new URL(u),T=ai(V.pathname,v);V.origin===$.origin&&T!=null?u=T+V.search+V.hash:g=!0}catch{Fn(!1,`<Link to="${u}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}let y=a7(u,{relative:a}),[_,E,D]=G7(r,p),R=aO(u,{replace:s,state:o,target:l,preventScrollReset:c,relative:a,viewTransition:f});function O($){t&&t($),$.defaultPrevented||R($)}let j=C.createElement("a",{...p,...D,href:x||y,onClick:g||i?t:O,ref:X7(d,E),target:l,"data-discover":!S&&n==="render"?"true":void 0});return _&&!S?C.createElement(C.Fragment,null,j,C.createElement(W7,{page:y})):j});wg.displayName="Link";var tO=C.forwardRef(function({"aria-current":t="page",caseSensitive:n=!1,className:r="",end:a=!1,style:i,to:s,viewTransition:o,children:l,...u},c){let f=Fd(s,{relative:u.relative}),p=xi(),d=C.useContext(Pd),{navigator:v,basename:S}=C.useContext(wi),x=d!=null&&cO(f)&&o===!0,g=v.encodeLocation?v.encodeLocation(f).pathname:f.pathname,y=p.pathname,_=d&&d.navigation&&d.navigation.location?d.navigation.location.pathname:null;n||(y=y.toLowerCase(),_=_?_.toLowerCase():null,g=g.toLowerCase()),_&&S&&(_=ai(_,S)||_);const E=g!=="/"&&g.endsWith("/")?g.length-1:g.length;let D=y===g||!a&&y.startsWith(g)&&y.charAt(E)==="/",R=_!=null&&(_===g||!a&&_.startsWith(g)&&_.charAt(g.length)==="/"),O={isActive:D,isPending:R,isTransitioning:x},j=D?t:void 0,$;typeof r=="function"?$=r(O):$=[r,D?"active":null,R?"pending":null,x?"transitioning":null].filter(Boolean).join(" ");let V=typeof i=="function"?i(O):i;return C.createElement(wg,{...u,"aria-current":j,className:$,ref:c,style:V,to:s,viewTransition:o},typeof l=="function"?l(O):l)});tO.displayName="NavLink";var nO=C.forwardRef(({discover:e="render",fetcherKey:t,navigate:n,reloadDocument:r,replace:a,state:i,method:s=kp,action:o,onSubmit:l,relative:u,preventScrollReset:c,viewTransition:f,...p},d)=>{let v=lO(),S=uO(o,{relative:u}),x=s.toLowerCase()==="get"?"get":"post",g=typeof o=="string"&&cA.test(o),y=_=>{if(l&&l(_),_.defaultPrevented)return;_.preventDefault();let E=_.nativeEvent.submitter,D=(E==null?void 0:E.getAttribute("formmethod"))||s;v(E||_.currentTarget,{fetcherKey:t,method:D,navigate:n,replace:a,state:i,relative:u,preventScrollReset:c,viewTransition:f})};return C.createElement("form",{ref:d,method:x,action:S,onSubmit:r?l:y,...p,"data-discover":!g&&e==="render"?"true":void 0})});nO.displayName="Form";function rO(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function fA(e){let t=C.useContext(Tl);return At(t,rO(e)),t}function aO(e,{target:t,replace:n,state:r,preventScrollReset:a,relative:i,viewTransition:s}={}){let o=fa(),l=xi(),u=Fd(e,{relative:i});return C.useCallback(c=>{if(R7(c,t)){c.preventDefault();let f=n!==void 0?n:ko(l)===ko(u);o(e,{replace:f,state:r,preventScrollReset:a,relative:i,viewTransition:s})}},[l,o,u,n,r,t,e,a,i,s])}function iO(e){Fn(typeof URLSearchParams<"u","You cannot use the `useSearchParams` hook in a browser that does not support the URLSearchParams API. If you need to support Internet Explorer 11, we recommend you load a polyfill such as https://github.com/ungap/url-search-params.");let t=C.useRef(cv(e)),n=C.useRef(!1),r=xi(),a=C.useMemo(()=>M7(r.search,n.current?null:t.current),[r.search]),i=fa(),s=C.useCallback((o,l)=>{const u=cv(typeof o=="function"?o(new URLSearchParams(a)):o);n.current=!0,i("?"+u,l)},[i,a]);return[a,s]}var sO=0,oO=()=>`__${String(++sO)}__`;function lO(){let{router:e}=fA("useSubmit"),{basename:t}=C.useContext(wi),n=v7();return C.useCallback(async(r,a={})=>{let{action:i,method:s,encType:o,formData:l,body:u}=I7(r,t);if(a.navigate===!1){let c=a.fetcherKey||oO();await e.fetch(c,n,a.action||i,{preventScrollReset:a.preventScrollReset,formData:l,body:u,formMethod:a.method||s,formEncType:a.encType||o,flushSync:a.flushSync})}else await e.navigate(a.action||i,{preventScrollReset:a.preventScrollReset,formData:l,body:u,formMethod:a.method||s,formEncType:a.encType||o,replace:a.replace,state:a.state,fromRouteId:n,flushSync:a.flushSync,viewTransition:a.viewTransition})},[e,t,n])}function uO(e,{relative:t}={}){let{basename:n}=C.useContext(wi),r=C.useContext(ii);At(r,"useFormAction must be used inside a RouteContext");let[a]=r.matches.slice(-1),i={...Fd(e||".",{relative:t})},s=xi();if(e==null){i.search=s.search;let o=new URLSearchParams(i.search),l=o.getAll("index");if(l.some(c=>c==="")){o.delete("index"),l.filter(f=>f).forEach(f=>o.append("index",f));let c=o.toString();i.search=c?`?${c}`:""}}return(!e||e===".")&&a.route.index&&(i.search=i.search?i.search.replace(/^\?/,"?index&"):"?index"),n!=="/"&&(i.pathname=i.pathname==="/"?n:Bi([n,i.pathname])),ko(i)}function cO(e,{relative:t}={}){let n=C.useContext(_5);At(n!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:r}=fA("useViewTransitionState"),a=Fd(e,{relative:t});if(!n.isTransitioning)return!1;let i=ai(n.currentLocation.pathname,r)||n.currentLocation.pathname,s=ai(n.nextLocation.pathname,r)||n.nextLocation.pathname;return Sm(a.pathname,s)!=null||Sm(a.pathname,i)!=null}function fO(e){return C.createElement(_7,{flushSync:_y.flushSync,...e})}const dO=(e,t,n,r)=>{var i,s,o,l;const a=[n,{code:t,...r||{}}];if((s=(i=e==null?void 0:e.services)==null?void 0:i.logger)!=null&&s.forward)return e.services.logger.forward(a,"warn","react-i18next::",!0);pl(a[0])&&(a[0]=`react-i18next:: ${a[0]}`),(l=(o=e==null?void 0:e.services)==null?void 0:o.logger)!=null&&l.warn?e.services.logger.warn(...a):console!=null&&console.warn&&console.warn(...a)},Nx={},fv=(e,t,n,r)=>{pl(n)&&Nx[n]||(pl(n)&&(Nx[n]=new Date),dO(e,t,n,r))},dA=(e,t)=>()=>{if(e.isInitialized)t();else{const n=()=>{setTimeout(()=>{e.off("initialized",n)},0),t()};e.on("initialized",n)}},dv=(e,t,n)=>{e.loadNamespaces(t,dA(e,n))},Ex=(e,t,n,r)=>{if(pl(n)&&(n=[n]),e.options.preload&&e.options.preload.indexOf(t)>-1)return dv(e,n,r);n.forEach(a=>{e.options.ns.indexOf(a)<0&&e.options.ns.push(a)}),e.loadLanguages(t,dA(e,r))},hO=(e,t,n={})=>!t.languages||!t.languages.length?(fv(t,"NO_LANGUAGES","i18n.languages were undefined or empty",{languages:t.languages}),!0):t.hasLoadedNamespace(e,{lng:n.lng,precheck:(r,a)=>{var i;if(((i=n.bindI18n)==null?void 0:i.indexOf("languageChanging"))>-1&&r.services.backendConnector.backend&&r.isLanguageChangingTo&&!a(r.isLanguageChangingTo,e))return!1}}),pl=e=>typeof e=="string",pO=e=>typeof e=="object"&&e!==null,mO=/&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34|nbsp|#160|copy|#169|reg|#174|hellip|#8230|#x2F|#47);/g,gO={"&amp;":"&","&#38;":"&","&lt;":"<","&#60;":"<","&gt;":">","&#62;":">","&apos;":"'","&#39;":"'","&quot;":'"',"&#34;":'"',"&nbsp;":" ","&#160;":" ","&copy;":"©","&#169;":"©","&reg;":"®","&#174;":"®","&hellip;":"…","&#8230;":"…","&#x2F;":"/","&#47;":"/"},vO=e=>gO[e],yO=e=>e.replace(mO,vO);let hv={bindI18n:"languageChanged",bindI18nStore:"",transEmptyNodeValue:"",transSupportBasicHtmlNodes:!0,transWrapTextNodes:"",transKeepBasicHtmlNodesFor:["br","strong","i","p"],useSuspense:!0,unescape:yO};const bO=(e={})=>{hv={...hv,...e}},wO=()=>hv;let hA;const xO=e=>{hA=e},SO=()=>hA,_O={type:"3rdParty",init(e){bO(e.options.react),xO(e)}},AO=C.createContext();class NO{constructor(){this.usedNamespaces={}}addUsedNamespaces(t){t.forEach(n=>{this.usedNamespaces[n]||(this.usedNamespaces[n]=!0)})}getUsedNamespaces(){return Object.keys(this.usedNamespaces)}}const EO=(e,t)=>{const n=C.useRef();return C.useEffect(()=>{n.current=e},[e,t]),n.current},pA=(e,t,n,r)=>e.getFixedT(t,n,r),CO=(e,t,n,r)=>C.useCallback(pA(e,t,n,r),[e,t,n,r]),Dn=(e,t={})=>{var E,D,R,O;const{i18n:n}=t,{i18n:r,defaultNS:a}=C.useContext(AO)||{},i=n||r||SO();if(i&&!i.reportNamespaces&&(i.reportNamespaces=new NO),!i){fv(i,"NO_I18NEXT_INSTANCE","useTranslation: You will need to pass in an i18next instance by using initReactI18next");const j=(V,T)=>pl(T)?T:pO(T)&&pl(T.defaultValue)?T.defaultValue:Array.isArray(V)?V[V.length-1]:V,$=[j,{},!1];return $.t=j,$.i18n={},$.ready=!1,$}(E=i.options.react)!=null&&E.wait&&fv(i,"DEPRECATED_OPTION","useTranslation: It seems you are still using the old wait option, you may migrate to the new useSuspense behaviour.");const s={...wO(),...i.options.react,...t},{useSuspense:o,keyPrefix:l}=s;let u=a||((D=i.options)==null?void 0:D.defaultNS);u=pl(u)?[u]:u||["translation"],(O=(R=i.reportNamespaces).addUsedNamespaces)==null||O.call(R,u);const c=(i.isInitialized||i.initializedStoreOnce)&&u.every(j=>hO(j,i,s)),f=CO(i,t.lng||null,s.nsMode==="fallback"?u:u[0],l),p=()=>f,d=()=>pA(i,t.lng||null,s.nsMode==="fallback"?u:u[0],l),[v,S]=C.useState(p);let x=u.join();t.lng&&(x=`${t.lng}${x}`);const g=EO(x),y=C.useRef(!0);C.useEffect(()=>{const{bindI18n:j,bindI18nStore:$}=s;y.current=!0,!c&&!o&&(t.lng?Ex(i,t.lng,u,()=>{y.current&&S(d)}):dv(i,u,()=>{y.current&&S(d)})),c&&g&&g!==x&&y.current&&S(d);const V=()=>{y.current&&S(d)};return j&&(i==null||i.on(j,V)),$&&(i==null||i.store.on($,V)),()=>{y.current=!1,i&&(j==null||j.split(" ").forEach(T=>i.off(T,V))),$&&i&&$.split(" ").forEach(T=>i.store.off(T,V))}},[i,x]),C.useEffect(()=>{y.current&&c&&S(p)},[i,l,c]);const _=[v,i,c];if(_.t=v,_.i18n=i,_.ready=c,c||!c&&!o)return _;throw new Promise(j=>{t.lng?Ex(i,t.lng,u,()=>j()):dv(i,u,()=>j())})};function mA(e,t){if(!e)return`rgba(255,255,255,${t})`;let n=e.replace("#","");if(n.length===3&&(n=n.split("").map(s=>s+s).join("")),n.length!==6)return`rgba(255,255,255,${t})`;const r=parseInt(n.substring(0,2),16),a=parseInt(n.substring(2,4),16),i=parseInt(n.substring(4,6),16);return`rgba(${r},${a},${i},${t})`}const gA=C.createContext({darkMode:!1,setDarkMode:()=>{}}),LO=({children:e})=>{const[t,n]=C.useState(!1);return C.useEffect(()=>{t?document.documentElement.classList.add("dark"):document.documentElement.classList.remove("dark")},[t]),b.jsx(gA.Provider,{value:{darkMode:t,setDarkMode:n},children:e})},or=()=>C.useContext(gA),jO="modulepreload",TO=function(e){return"/"+e},Cx={},Ls=function(t,n,r){let a=Promise.resolve();if(n&&n.length>0){document.getElementsByTagName("link");const s=document.querySelector("meta[property=csp-nonce]"),o=(s==null?void 0:s.nonce)||(s==null?void 0:s.getAttribute("nonce"));a=Promise.allSettled(n.map(l=>{if(l=TO(l),l in Cx)return;Cx[l]=!0;const u=l.endsWith(".css"),c=u?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${l}"]${c}`))return;const f=document.createElement("link");if(f.rel=u?"stylesheet":jO,u||(f.as="script"),f.crossOrigin="",f.href=l,o&&f.setAttribute("nonce",o),document.head.appendChild(f),u)return new Promise((p,d)=>{f.addEventListener("load",p),f.addEventListener("error",()=>d(new Error(`Unable to preload CSS for ${l}`)))})}))}function i(s){const o=new Event("vite:preloadError",{cancelable:!0});if(o.payload=s,window.dispatchEvent(o),!o.defaultPrevented)throw s}return a.then(s=>{for(const o of s||[])o.status==="rejected"&&i(o.reason);return t().catch(i)})},OO=e=>{let t;return e?t=e:typeof fetch>"u"?t=(...n)=>Ls(async()=>{const{default:r}=await Promise.resolve().then(()=>Nc);return{default:r}},[]).then(({default:r})=>r(...n)):t=fetch,(...n)=>t(...n)};class j5 extends Error{constructor(t,n="FunctionsError",r){super(t),this.name=n,this.context=r}}class DO extends j5{constructor(t){super("Failed to send a request to the Edge Function","FunctionsFetchError",t)}}class RO extends j5{constructor(t){super("Relay Error invoking the Edge Function","FunctionsRelayError",t)}}class MO extends j5{constructor(t){super("Edge Function returned a non-2xx status code","FunctionsHttpError",t)}}var pv;(function(e){e.Any="any",e.ApNortheast1="ap-northeast-1",e.ApNortheast2="ap-northeast-2",e.ApSouth1="ap-south-1",e.ApSoutheast1="ap-southeast-1",e.ApSoutheast2="ap-southeast-2",e.CaCentral1="ca-central-1",e.EuCentral1="eu-central-1",e.EuWest1="eu-west-1",e.EuWest2="eu-west-2",e.EuWest3="eu-west-3",e.SaEast1="sa-east-1",e.UsEast1="us-east-1",e.UsWest1="us-west-1",e.UsWest2="us-west-2"})(pv||(pv={}));var kO=function(e,t,n,r){function a(i){return i instanceof n?i:new n(function(s){s(i)})}return new(n||(n=Promise))(function(i,s){function o(c){try{u(r.next(c))}catch(f){s(f)}}function l(c){try{u(r.throw(c))}catch(f){s(f)}}function u(c){c.done?i(c.value):a(c.value).then(o,l)}u((r=r.apply(e,t||[])).next())})};class PO{constructor(t,{headers:n={},customFetch:r,region:a=pv.Any}={}){this.url=t,this.headers=n,this.region=a,this.fetch=OO(r)}setAuth(t){this.headers.Authorization=`Bearer ${t}`}invoke(t,n={}){var r;return kO(this,void 0,void 0,function*(){try{const{headers:a,method:i,body:s}=n;let o={},{region:l}=n;l||(l=this.region),l&&l!=="any"&&(o["x-region"]=l);let u;s&&(a&&!Object.prototype.hasOwnProperty.call(a,"Content-Type")||!a)&&(typeof Blob<"u"&&s instanceof Blob||s instanceof ArrayBuffer?(o["Content-Type"]="application/octet-stream",u=s):typeof s=="string"?(o["Content-Type"]="text/plain",u=s):typeof FormData<"u"&&s instanceof FormData?u=s:(o["Content-Type"]="application/json",u=JSON.stringify(s)));const c=yield this.fetch(`${this.url}/${t}`,{method:i||"POST",headers:Object.assign(Object.assign(Object.assign({},o),this.headers),a),body:u}).catch(v=>{throw new DO(v)}),f=c.headers.get("x-relay-error");if(f&&f==="true")throw new RO(c);if(!c.ok)throw new MO(c);let p=((r=c.headers.get("Content-Type"))!==null&&r!==void 0?r:"text/plain").split(";")[0].trim(),d;return p==="application/json"?d=yield c.json():p==="application/octet-stream"?d=yield c.blob():p==="text/event-stream"?d=c:p==="multipart/form-data"?d=yield c.formData():d=yield c.text(),{data:d,error:null}}catch(a){return{data:null,error:a}}})}}var sa={},T5={},xg={},Bd={},Sg={},_g={},IO=function(){if(typeof self<"u")return self;if(typeof window<"u")return window;if(typeof global<"u")return global;throw new Error("unable to locate global object")},dc=IO();const FO=dc.fetch,vA=dc.fetch.bind(dc),yA=dc.Headers,BO=dc.Request,$O=dc.Response,Nc=Object.freeze(Object.defineProperty({__proto__:null,Headers:yA,Request:BO,Response:$O,default:vA,fetch:FO},Symbol.toStringTag,{value:"Module"})),UO=eC(Nc);var Ag={};Object.defineProperty(Ag,"__esModule",{value:!0});let zO=class extends Error{constructor(t){super(t.message),this.name="PostgrestError",this.details=t.details,this.hint=t.hint,this.code=t.code}};Ag.default=zO;var bA=ni&&ni.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(_g,"__esModule",{value:!0});const qO=bA(UO),HO=bA(Ag);let VO=class{constructor(t){this.shouldThrowOnError=!1,this.method=t.method,this.url=t.url,this.headers=t.headers,this.schema=t.schema,this.body=t.body,this.shouldThrowOnError=t.shouldThrowOnError,this.signal=t.signal,this.isMaybeSingle=t.isMaybeSingle,t.fetch?this.fetch=t.fetch:typeof fetch>"u"?this.fetch=qO.default:this.fetch=fetch}throwOnError(){return this.shouldThrowOnError=!0,this}setHeader(t,n){return this.headers=Object.assign({},this.headers),this.headers[t]=n,this}then(t,n){this.schema===void 0||(["GET","HEAD"].includes(this.method)?this.headers["Accept-Profile"]=this.schema:this.headers["Content-Profile"]=this.schema),this.method!=="GET"&&this.method!=="HEAD"&&(this.headers["Content-Type"]="application/json");const r=this.fetch;let a=r(this.url.toString(),{method:this.method,headers:this.headers,body:JSON.stringify(this.body),signal:this.signal}).then(async i=>{var s,o,l;let u=null,c=null,f=null,p=i.status,d=i.statusText;if(i.ok){if(this.method!=="HEAD"){const g=await i.text();g===""||(this.headers.Accept==="text/csv"||this.headers.Accept&&this.headers.Accept.includes("application/vnd.pgrst.plan+text")?c=g:c=JSON.parse(g))}const S=(s=this.headers.Prefer)===null||s===void 0?void 0:s.match(/count=(exact|planned|estimated)/),x=(o=i.headers.get("content-range"))===null||o===void 0?void 0:o.split("/");S&&x&&x.length>1&&(f=parseInt(x[1])),this.isMaybeSingle&&this.method==="GET"&&Array.isArray(c)&&(c.length>1?(u={code:"PGRST116",details:`Results contain ${c.length} rows, application/vnd.pgrst.object+json requires 1 row`,hint:null,message:"JSON object requested, multiple (or no) rows returned"},c=null,f=null,p=406,d="Not Acceptable"):c.length===1?c=c[0]:c=null)}else{const S=await i.text();try{u=JSON.parse(S),Array.isArray(u)&&i.status===404&&(c=[],u=null,p=200,d="OK")}catch{i.status===404&&S===""?(p=204,d="No Content"):u={message:S}}if(u&&this.isMaybeSingle&&(!((l=u==null?void 0:u.details)===null||l===void 0)&&l.includes("0 rows"))&&(u=null,p=200,d="OK"),u&&this.shouldThrowOnError)throw new HO.default(u)}return{error:u,data:c,count:f,status:p,statusText:d}});return this.shouldThrowOnError||(a=a.catch(i=>{var s,o,l;return{error:{message:`${(s=i==null?void 0:i.name)!==null&&s!==void 0?s:"FetchError"}: ${i==null?void 0:i.message}`,details:`${(o=i==null?void 0:i.stack)!==null&&o!==void 0?o:""}`,hint:"",code:`${(l=i==null?void 0:i.code)!==null&&l!==void 0?l:""}`},data:null,count:null,status:0,statusText:""}})),a.then(t,n)}returns(){return this}overrideTypes(){return this}};_g.default=VO;var YO=ni&&ni.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Sg,"__esModule",{value:!0});const GO=YO(_g);let WO=class extends GO.default{select(t){let n=!1;const r=(t??"*").split("").map(a=>/\s/.test(a)&&!n?"":(a==='"'&&(n=!n),a)).join("");return this.url.searchParams.set("select",r),this.headers.Prefer&&(this.headers.Prefer+=","),this.headers.Prefer+="return=representation",this}order(t,{ascending:n=!0,nullsFirst:r,foreignTable:a,referencedTable:i=a}={}){const s=i?`${i}.order`:"order",o=this.url.searchParams.get(s);return this.url.searchParams.set(s,`${o?`${o},`:""}${t}.${n?"asc":"desc"}${r===void 0?"":r?".nullsfirst":".nullslast"}`),this}limit(t,{foreignTable:n,referencedTable:r=n}={}){const a=typeof r>"u"?"limit":`${r}.limit`;return this.url.searchParams.set(a,`${t}`),this}range(t,n,{foreignTable:r,referencedTable:a=r}={}){const i=typeof a>"u"?"offset":`${a}.offset`,s=typeof a>"u"?"limit":`${a}.limit`;return this.url.searchParams.set(i,`${t}`),this.url.searchParams.set(s,`${n-t+1}`),this}abortSignal(t){return this.signal=t,this}single(){return this.headers.Accept="application/vnd.pgrst.object+json",this}maybeSingle(){return this.method==="GET"?this.headers.Accept="application/json":this.headers.Accept="application/vnd.pgrst.object+json",this.isMaybeSingle=!0,this}csv(){return this.headers.Accept="text/csv",this}geojson(){return this.headers.Accept="application/geo+json",this}explain({analyze:t=!1,verbose:n=!1,settings:r=!1,buffers:a=!1,wal:i=!1,format:s="text"}={}){var o;const l=[t?"analyze":null,n?"verbose":null,r?"settings":null,a?"buffers":null,i?"wal":null].filter(Boolean).join("|"),u=(o=this.headers.Accept)!==null&&o!==void 0?o:"application/json";return this.headers.Accept=`application/vnd.pgrst.plan+${s}; for="${u}"; options=${l};`,s==="json"?this:this}rollback(){var t;return((t=this.headers.Prefer)!==null&&t!==void 0?t:"").trim().length>0?this.headers.Prefer+=",tx=rollback":this.headers.Prefer="tx=rollback",this}returns(){return this}};Sg.default=WO;var JO=ni&&ni.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Bd,"__esModule",{value:!0});const KO=JO(Sg);let XO=class extends KO.default{eq(t,n){return this.url.searchParams.append(t,`eq.${n}`),this}neq(t,n){return this.url.searchParams.append(t,`neq.${n}`),this}gt(t,n){return this.url.searchParams.append(t,`gt.${n}`),this}gte(t,n){return this.url.searchParams.append(t,`gte.${n}`),this}lt(t,n){return this.url.searchParams.append(t,`lt.${n}`),this}lte(t,n){return this.url.searchParams.append(t,`lte.${n}`),this}like(t,n){return this.url.searchParams.append(t,`like.${n}`),this}likeAllOf(t,n){return this.url.searchParams.append(t,`like(all).{${n.join(",")}}`),this}likeAnyOf(t,n){return this.url.searchParams.append(t,`like(any).{${n.join(",")}}`),this}ilike(t,n){return this.url.searchParams.append(t,`ilike.${n}`),this}ilikeAllOf(t,n){return this.url.searchParams.append(t,`ilike(all).{${n.join(",")}}`),this}ilikeAnyOf(t,n){return this.url.searchParams.append(t,`ilike(any).{${n.join(",")}}`),this}is(t,n){return this.url.searchParams.append(t,`is.${n}`),this}in(t,n){const r=Array.from(new Set(n)).map(a=>typeof a=="string"&&new RegExp("[,()]").test(a)?`"${a}"`:`${a}`).join(",");return this.url.searchParams.append(t,`in.(${r})`),this}contains(t,n){return typeof n=="string"?this.url.searchParams.append(t,`cs.${n}`):Array.isArray(n)?this.url.searchParams.append(t,`cs.{${n.join(",")}}`):this.url.searchParams.append(t,`cs.${JSON.stringify(n)}`),this}containedBy(t,n){return typeof n=="string"?this.url.searchParams.append(t,`cd.${n}`):Array.isArray(n)?this.url.searchParams.append(t,`cd.{${n.join(",")}}`):this.url.searchParams.append(t,`cd.${JSON.stringify(n)}`),this}rangeGt(t,n){return this.url.searchParams.append(t,`sr.${n}`),this}rangeGte(t,n){return this.url.searchParams.append(t,`nxl.${n}`),this}rangeLt(t,n){return this.url.searchParams.append(t,`sl.${n}`),this}rangeLte(t,n){return this.url.searchParams.append(t,`nxr.${n}`),this}rangeAdjacent(t,n){return this.url.searchParams.append(t,`adj.${n}`),this}overlaps(t,n){return typeof n=="string"?this.url.searchParams.append(t,`ov.${n}`):this.url.searchParams.append(t,`ov.{${n.join(",")}}`),this}textSearch(t,n,{config:r,type:a}={}){let i="";a==="plain"?i="pl":a==="phrase"?i="ph":a==="websearch"&&(i="w");const s=r===void 0?"":`(${r})`;return this.url.searchParams.append(t,`${i}fts${s}.${n}`),this}match(t){return Object.entries(t).forEach(([n,r])=>{this.url.searchParams.append(n,`eq.${r}`)}),this}not(t,n,r){return this.url.searchParams.append(t,`not.${n}.${r}`),this}or(t,{foreignTable:n,referencedTable:r=n}={}){const a=r?`${r}.or`:"or";return this.url.searchParams.append(a,`(${t})`),this}filter(t,n,r){return this.url.searchParams.append(t,`${n}.${r}`),this}};Bd.default=XO;var QO=ni&&ni.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(xg,"__esModule",{value:!0});const pf=QO(Bd);let ZO=class{constructor(t,{headers:n={},schema:r,fetch:a}){this.url=t,this.headers=n,this.schema=r,this.fetch=a}select(t,{head:n=!1,count:r}={}){const a=n?"HEAD":"GET";let i=!1;const s=(t??"*").split("").map(o=>/\s/.test(o)&&!i?"":(o==='"'&&(i=!i),o)).join("");return this.url.searchParams.set("select",s),r&&(this.headers.Prefer=`count=${r}`),new pf.default({method:a,url:this.url,headers:this.headers,schema:this.schema,fetch:this.fetch,allowEmpty:!1})}insert(t,{count:n,defaultToNull:r=!0}={}){const a="POST",i=[];if(this.headers.Prefer&&i.push(this.headers.Prefer),n&&i.push(`count=${n}`),r||i.push("missing=default"),this.headers.Prefer=i.join(","),Array.isArray(t)){const s=t.reduce((o,l)=>o.concat(Object.keys(l)),[]);if(s.length>0){const o=[...new Set(s)].map(l=>`"${l}"`);this.url.searchParams.set("columns",o.join(","))}}return new pf.default({method:a,url:this.url,headers:this.headers,schema:this.schema,body:t,fetch:this.fetch,allowEmpty:!1})}upsert(t,{onConflict:n,ignoreDuplicates:r=!1,count:a,defaultToNull:i=!0}={}){const s="POST",o=[`resolution=${r?"ignore":"merge"}-duplicates`];if(n!==void 0&&this.url.searchParams.set("on_conflict",n),this.headers.Prefer&&o.push(this.headers.Prefer),a&&o.push(`count=${a}`),i||o.push("missing=default"),this.headers.Prefer=o.join(","),Array.isArray(t)){const l=t.reduce((u,c)=>u.concat(Object.keys(c)),[]);if(l.length>0){const u=[...new Set(l)].map(c=>`"${c}"`);this.url.searchParams.set("columns",u.join(","))}}return new pf.default({method:s,url:this.url,headers:this.headers,schema:this.schema,body:t,fetch:this.fetch,allowEmpty:!1})}update(t,{count:n}={}){const r="PATCH",a=[];return this.headers.Prefer&&a.push(this.headers.Prefer),n&&a.push(`count=${n}`),this.headers.Prefer=a.join(","),new pf.default({method:r,url:this.url,headers:this.headers,schema:this.schema,body:t,fetch:this.fetch,allowEmpty:!1})}delete({count:t}={}){const n="DELETE",r=[];return t&&r.push(`count=${t}`),this.headers.Prefer&&r.unshift(this.headers.Prefer),this.headers.Prefer=r.join(","),new pf.default({method:n,url:this.url,headers:this.headers,schema:this.schema,fetch:this.fetch,allowEmpty:!1})}};xg.default=ZO;var Ng={},Eg={};Object.defineProperty(Eg,"__esModule",{value:!0});Eg.version=void 0;Eg.version="0.0.0-automated";Object.defineProperty(Ng,"__esModule",{value:!0});Ng.DEFAULT_HEADERS=void 0;const eD=Eg;Ng.DEFAULT_HEADERS={"X-Client-Info":`postgrest-js/${eD.version}`};var wA=ni&&ni.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(T5,"__esModule",{value:!0});const tD=wA(xg),nD=wA(Bd),rD=Ng;let aD=class xA{constructor(t,{headers:n={},schema:r,fetch:a}={}){this.url=t,this.headers=Object.assign(Object.assign({},rD.DEFAULT_HEADERS),n),this.schemaName=r,this.fetch=a}from(t){const n=new URL(`${this.url}/${t}`);return new tD.default(n,{headers:Object.assign({},this.headers),schema:this.schemaName,fetch:this.fetch})}schema(t){return new xA(this.url,{headers:this.headers,schema:t,fetch:this.fetch})}rpc(t,n={},{head:r=!1,get:a=!1,count:i}={}){let s;const o=new URL(`${this.url}/rpc/${t}`);let l;r||a?(s=r?"HEAD":"GET",Object.entries(n).filter(([c,f])=>f!==void 0).map(([c,f])=>[c,Array.isArray(f)?`{${f.join(",")}}`:`${f}`]).forEach(([c,f])=>{o.searchParams.append(c,f)})):(s="POST",l=n);const u=Object.assign({},this.headers);return i&&(u.Prefer=`count=${i}`),new nD.default({method:s,url:o,headers:u,schema:this.schemaName,body:l,fetch:this.fetch,allowEmpty:!1})}};T5.default=aD;var Ec=ni&&ni.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(sa,"__esModule",{value:!0});sa.PostgrestError=sa.PostgrestBuilder=sa.PostgrestTransformBuilder=sa.PostgrestFilterBuilder=sa.PostgrestQueryBuilder=sa.PostgrestClient=void 0;const SA=Ec(T5);sa.PostgrestClient=SA.default;const _A=Ec(xg);sa.PostgrestQueryBuilder=_A.default;const AA=Ec(Bd);sa.PostgrestFilterBuilder=AA.default;const NA=Ec(Sg);sa.PostgrestTransformBuilder=NA.default;const EA=Ec(_g);sa.PostgrestBuilder=EA.default;const CA=Ec(Ag);sa.PostgrestError=CA.default;var iD=sa.default={PostgrestClient:SA.default,PostgrestQueryBuilder:_A.default,PostgrestFilterBuilder:AA.default,PostgrestTransformBuilder:NA.default,PostgrestBuilder:EA.default,PostgrestError:CA.default};const{PostgrestClient:sD,PostgrestQueryBuilder:OV,PostgrestFilterBuilder:DV,PostgrestTransformBuilder:RV,PostgrestBuilder:MV,PostgrestError:kV}=iD,oD="2.11.2",lD={"X-Client-Info":`realtime-js/${oD}`},uD="1.0.0",LA=1e4,cD=1e3;var qu;(function(e){e[e.connecting=0]="connecting",e[e.open=1]="open",e[e.closing=2]="closing",e[e.closed=3]="closed"})(qu||(qu={}));var wa;(function(e){e.closed="closed",e.errored="errored",e.joined="joined",e.joining="joining",e.leaving="leaving"})(wa||(wa={}));var yi;(function(e){e.close="phx_close",e.error="phx_error",e.join="phx_join",e.reply="phx_reply",e.leave="phx_leave",e.access_token="access_token"})(yi||(yi={}));var mv;(function(e){e.websocket="websocket"})(mv||(mv={}));var sl;(function(e){e.Connecting="connecting",e.Open="open",e.Closing="closing",e.Closed="closed"})(sl||(sl={}));class fD{constructor(){this.HEADER_LENGTH=1}decode(t,n){return t.constructor===ArrayBuffer?n(this._binaryDecode(t)):n(typeof t=="string"?JSON.parse(t):{})}_binaryDecode(t){const n=new DataView(t),r=new TextDecoder;return this._decodeBroadcast(t,n,r)}_decodeBroadcast(t,n,r){const a=n.getUint8(1),i=n.getUint8(2);let s=this.HEADER_LENGTH+2;const o=r.decode(t.slice(s,s+a));s=s+a;const l=r.decode(t.slice(s,s+i));s=s+i;const u=JSON.parse(r.decode(t.slice(s,t.byteLength)));return{ref:null,topic:o,event:l,payload:u}}}class jA{constructor(t,n){this.callback=t,this.timerCalc=n,this.timer=void 0,this.tries=0,this.callback=t,this.timerCalc=n}reset(){this.tries=0,clearTimeout(this.timer)}scheduleTimeout(){clearTimeout(this.timer),this.timer=setTimeout(()=>{this.tries=this.tries+1,this.callback()},this.timerCalc(this.tries+1))}}var wn;(function(e){e.abstime="abstime",e.bool="bool",e.date="date",e.daterange="daterange",e.float4="float4",e.float8="float8",e.int2="int2",e.int4="int4",e.int4range="int4range",e.int8="int8",e.int8range="int8range",e.json="json",e.jsonb="jsonb",e.money="money",e.numeric="numeric",e.oid="oid",e.reltime="reltime",e.text="text",e.time="time",e.timestamp="timestamp",e.timestamptz="timestamptz",e.timetz="timetz",e.tsrange="tsrange",e.tstzrange="tstzrange"})(wn||(wn={}));const Lx=(e,t,n={})=>{var r;const a=(r=n.skipTypes)!==null&&r!==void 0?r:[];return Object.keys(t).reduce((i,s)=>(i[s]=dD(s,e,t,a),i),{})},dD=(e,t,n,r)=>{const a=t.find(o=>o.name===e),i=a==null?void 0:a.type,s=n[e];return i&&!r.includes(i)?TA(i,s):gv(s)},TA=(e,t)=>{if(e.charAt(0)==="_"){const n=e.slice(1,e.length);return gD(t,n)}switch(e){case wn.bool:return hD(t);case wn.float4:case wn.float8:case wn.int2:case wn.int4:case wn.int8:case wn.numeric:case wn.oid:return pD(t);case wn.json:case wn.jsonb:return mD(t);case wn.timestamp:return vD(t);case wn.abstime:case wn.date:case wn.daterange:case wn.int4range:case wn.int8range:case wn.money:case wn.reltime:case wn.text:case wn.time:case wn.timestamptz:case wn.timetz:case wn.tsrange:case wn.tstzrange:return gv(t);default:return gv(t)}},gv=e=>e,hD=e=>{switch(e){case"t":return!0;case"f":return!1;default:return e}},pD=e=>{if(typeof e=="string"){const t=parseFloat(e);if(!Number.isNaN(t))return t}return e},mD=e=>{if(typeof e=="string")try{return JSON.parse(e)}catch(t){return console.log(`JSON parse error: ${t}`),e}return e},gD=(e,t)=>{if(typeof e!="string")return e;const n=e.length-1,r=e[n];if(e[0]==="{"&&r==="}"){let i;const s=e.slice(1,n);try{i=JSON.parse("["+s+"]")}catch{i=s?s.split(","):[]}return i.map(o=>TA(t,o))}return e},vD=e=>typeof e=="string"?e.replace(" ","T"):e,OA=e=>{let t=e;return t=t.replace(/^ws/i,"http"),t=t.replace(/(\/socket\/websocket|\/socket|\/websocket)\/?$/i,""),t.replace(/\/+$/,"")};class T1{constructor(t,n,r={},a=LA){this.channel=t,this.event=n,this.payload=r,this.timeout=a,this.sent=!1,this.timeoutTimer=void 0,this.ref="",this.receivedResp=null,this.recHooks=[],this.refEvent=null}resend(t){this.timeout=t,this._cancelRefEvent(),this.ref="",this.refEvent=null,this.receivedResp=null,this.sent=!1,this.send()}send(){this._hasReceived("timeout")||(this.startTimeout(),this.sent=!0,this.channel.socket.push({topic:this.channel.topic,event:this.event,payload:this.payload,ref:this.ref,join_ref:this.channel._joinRef()}))}updatePayload(t){this.payload=Object.assign(Object.assign({},this.payload),t)}receive(t,n){var r;return this._hasReceived(t)&&n((r=this.receivedResp)===null||r===void 0?void 0:r.response),this.recHooks.push({status:t,callback:n}),this}startTimeout(){if(this.timeoutTimer)return;this.ref=this.channel.socket._makeRef(),this.refEvent=this.channel._replyEventName(this.ref);const t=n=>{this._cancelRefEvent(),this._cancelTimeout(),this.receivedResp=n,this._matchReceive(n)};this.channel._on(this.refEvent,{},t),this.timeoutTimer=setTimeout(()=>{this.trigger("timeout",{})},this.timeout)}trigger(t,n){this.refEvent&&this.channel._trigger(this.refEvent,{status:t,response:n})}destroy(){this._cancelRefEvent(),this._cancelTimeout()}_cancelRefEvent(){this.refEvent&&this.channel._off(this.refEvent,{})}_cancelTimeout(){clearTimeout(this.timeoutTimer),this.timeoutTimer=void 0}_matchReceive({status:t,response:n}){this.recHooks.filter(r=>r.status===t).forEach(r=>r.callback(n))}_hasReceived(t){return this.receivedResp&&this.receivedResp.status===t}}var jx;(function(e){e.SYNC="sync",e.JOIN="join",e.LEAVE="leave"})(jx||(jx={}));class qf{constructor(t,n){this.channel=t,this.state={},this.pendingDiffs=[],this.joinRef=null,this.caller={onJoin:()=>{},onLeave:()=>{},onSync:()=>{}};const r=(n==null?void 0:n.events)||{state:"presence_state",diff:"presence_diff"};this.channel._on(r.state,{},a=>{const{onJoin:i,onLeave:s,onSync:o}=this.caller;this.joinRef=this.channel._joinRef(),this.state=qf.syncState(this.state,a,i,s),this.pendingDiffs.forEach(l=>{this.state=qf.syncDiff(this.state,l,i,s)}),this.pendingDiffs=[],o()}),this.channel._on(r.diff,{},a=>{const{onJoin:i,onLeave:s,onSync:o}=this.caller;this.inPendingSyncState()?this.pendingDiffs.push(a):(this.state=qf.syncDiff(this.state,a,i,s),o())}),this.onJoin((a,i,s)=>{this.channel._trigger("presence",{event:"join",key:a,currentPresences:i,newPresences:s})}),this.onLeave((a,i,s)=>{this.channel._trigger("presence",{event:"leave",key:a,currentPresences:i,leftPresences:s})}),this.onSync(()=>{this.channel._trigger("presence",{event:"sync"})})}static syncState(t,n,r,a){const i=this.cloneDeep(t),s=this.transformState(n),o={},l={};return this.map(i,(u,c)=>{s[u]||(l[u]=c)}),this.map(s,(u,c)=>{const f=i[u];if(f){const p=c.map(x=>x.presence_ref),d=f.map(x=>x.presence_ref),v=c.filter(x=>d.indexOf(x.presence_ref)<0),S=f.filter(x=>p.indexOf(x.presence_ref)<0);v.length>0&&(o[u]=v),S.length>0&&(l[u]=S)}else o[u]=c}),this.syncDiff(i,{joins:o,leaves:l},r,a)}static syncDiff(t,n,r,a){const{joins:i,leaves:s}={joins:this.transformState(n.joins),leaves:this.transformState(n.leaves)};return r||(r=()=>{}),a||(a=()=>{}),this.map(i,(o,l)=>{var u;const c=(u=t[o])!==null&&u!==void 0?u:[];if(t[o]=this.cloneDeep(l),c.length>0){const f=t[o].map(d=>d.presence_ref),p=c.filter(d=>f.indexOf(d.presence_ref)<0);t[o].unshift(...p)}r(o,c,l)}),this.map(s,(o,l)=>{let u=t[o];if(!u)return;const c=l.map(f=>f.presence_ref);u=u.filter(f=>c.indexOf(f.presence_ref)<0),t[o]=u,a(o,u,l),u.length===0&&delete t[o]}),t}static map(t,n){return Object.getOwnPropertyNames(t).map(r=>n(r,t[r]))}static transformState(t){return t=this.cloneDeep(t),Object.getOwnPropertyNames(t).reduce((n,r)=>{const a=t[r];return"metas"in a?n[r]=a.metas.map(i=>(i.presence_ref=i.phx_ref,delete i.phx_ref,delete i.phx_ref_prev,i)):n[r]=a,n},{})}static cloneDeep(t){return JSON.parse(JSON.stringify(t))}onJoin(t){this.caller.onJoin=t}onLeave(t){this.caller.onLeave=t}onSync(t){this.caller.onSync=t}inPendingSyncState(){return!this.joinRef||this.joinRef!==this.channel._joinRef()}}var Tx;(function(e){e.ALL="*",e.INSERT="INSERT",e.UPDATE="UPDATE",e.DELETE="DELETE"})(Tx||(Tx={}));var Ox;(function(e){e.BROADCAST="broadcast",e.PRESENCE="presence",e.POSTGRES_CHANGES="postgres_changes",e.SYSTEM="system"})(Ox||(Ox={}));var fs;(function(e){e.SUBSCRIBED="SUBSCRIBED",e.TIMED_OUT="TIMED_OUT",e.CLOSED="CLOSED",e.CHANNEL_ERROR="CHANNEL_ERROR"})(fs||(fs={}));class O5{constructor(t,n={config:{}},r){this.topic=t,this.params=n,this.socket=r,this.bindings={},this.state=wa.closed,this.joinedOnce=!1,this.pushBuffer=[],this.subTopic=t.replace(/^realtime:/i,""),this.params.config=Object.assign({broadcast:{ack:!1,self:!1},presence:{key:""},private:!1},n.config),this.timeout=this.socket.timeout,this.joinPush=new T1(this,yi.join,this.params,this.timeout),this.rejoinTimer=new jA(()=>this._rejoinUntilConnected(),this.socket.reconnectAfterMs),this.joinPush.receive("ok",()=>{this.state=wa.joined,this.rejoinTimer.reset(),this.pushBuffer.forEach(a=>a.send()),this.pushBuffer=[]}),this._onClose(()=>{this.rejoinTimer.reset(),this.socket.log("channel",`close ${this.topic} ${this._joinRef()}`),this.state=wa.closed,this.socket._remove(this)}),this._onError(a=>{this._isLeaving()||this._isClosed()||(this.socket.log("channel",`error ${this.topic}`,a),this.state=wa.errored,this.rejoinTimer.scheduleTimeout())}),this.joinPush.receive("timeout",()=>{this._isJoining()&&(this.socket.log("channel",`timeout ${this.topic}`,this.joinPush.timeout),this.state=wa.errored,this.rejoinTimer.scheduleTimeout())}),this._on(yi.reply,{},(a,i)=>{this._trigger(this._replyEventName(i),a)}),this.presence=new qf(this),this.broadcastEndpointURL=OA(this.socket.endPoint)+"/api/broadcast",this.private=this.params.config.private||!1}subscribe(t,n=this.timeout){var r,a;if(this.socket.isConnected()||this.socket.connect(),this.joinedOnce)throw"tried to subscribe multiple times. 'subscribe' can only be called a single time per channel instance";{const{config:{broadcast:i,presence:s,private:o}}=this.params;this._onError(c=>t==null?void 0:t(fs.CHANNEL_ERROR,c)),this._onClose(()=>t==null?void 0:t(fs.CLOSED));const l={},u={broadcast:i,presence:s,postgres_changes:(a=(r=this.bindings.postgres_changes)===null||r===void 0?void 0:r.map(c=>c.filter))!==null&&a!==void 0?a:[],private:o};this.socket.accessTokenValue&&(l.access_token=this.socket.accessTokenValue),this.updateJoinPayload(Object.assign({config:u},l)),this.joinedOnce=!0,this._rejoin(n),this.joinPush.receive("ok",async({postgres_changes:c})=>{var f;if(this.socket.setAuth(),c===void 0){t==null||t(fs.SUBSCRIBED);return}else{const p=this.bindings.postgres_changes,d=(f=p==null?void 0:p.length)!==null&&f!==void 0?f:0,v=[];for(let S=0;S<d;S++){const x=p[S],{filter:{event:g,schema:y,table:_,filter:E}}=x,D=c&&c[S];if(D&&D.event===g&&D.schema===y&&D.table===_&&D.filter===E)v.push(Object.assign(Object.assign({},x),{id:D.id}));else{this.unsubscribe(),t==null||t(fs.CHANNEL_ERROR,new Error("mismatch between server and client bindings for postgres changes"));return}}this.bindings.postgres_changes=v,t&&t(fs.SUBSCRIBED);return}}).receive("error",c=>{t==null||t(fs.CHANNEL_ERROR,new Error(JSON.stringify(Object.values(c).join(", ")||"error")))}).receive("timeout",()=>{t==null||t(fs.TIMED_OUT)})}return this}presenceState(){return this.presence.state}async track(t,n={}){return await this.send({type:"presence",event:"track",payload:t},n.timeout||this.timeout)}async untrack(t={}){return await this.send({type:"presence",event:"untrack"},t)}on(t,n,r){return this._on(t,n,r)}async send(t,n={}){var r,a;if(!this._canPush()&&t.type==="broadcast"){const{event:i,payload:s}=t,l={method:"POST",headers:{Authorization:this.socket.accessTokenValue?`Bearer ${this.socket.accessTokenValue}`:"",apikey:this.socket.apiKey?this.socket.apiKey:"","Content-Type":"application/json"},body:JSON.stringify({messages:[{topic:this.subTopic,event:i,payload:s,private:this.private}]})};try{const u=await this._fetchWithTimeout(this.broadcastEndpointURL,l,(r=n.timeout)!==null&&r!==void 0?r:this.timeout);return await((a=u.body)===null||a===void 0?void 0:a.cancel()),u.ok?"ok":"error"}catch(u){return u.name==="AbortError"?"timed out":"error"}}else return new Promise(i=>{var s,o,l;const u=this._push(t.type,t,n.timeout||this.timeout);t.type==="broadcast"&&!(!((l=(o=(s=this.params)===null||s===void 0?void 0:s.config)===null||o===void 0?void 0:o.broadcast)===null||l===void 0)&&l.ack)&&i("ok"),u.receive("ok",()=>i("ok")),u.receive("error",()=>i("error")),u.receive("timeout",()=>i("timed out"))})}updateJoinPayload(t){this.joinPush.updatePayload(t)}unsubscribe(t=this.timeout){this.state=wa.leaving;const n=()=>{this.socket.log("channel",`leave ${this.topic}`),this._trigger(yi.close,"leave",this._joinRef())};return this.rejoinTimer.reset(),this.joinPush.destroy(),new Promise(r=>{const a=new T1(this,yi.leave,{},t);a.receive("ok",()=>{n(),r("ok")}).receive("timeout",()=>{n(),r("timed out")}).receive("error",()=>{r("error")}),a.send(),this._canPush()||a.trigger("ok",{})})}async _fetchWithTimeout(t,n,r){const a=new AbortController,i=setTimeout(()=>a.abort(),r),s=await this.socket.fetch(t,Object.assign(Object.assign({},n),{signal:a.signal}));return clearTimeout(i),s}_push(t,n,r=this.timeout){if(!this.joinedOnce)throw`tried to push '${t}' to '${this.topic}' before joining. Use channel.subscribe() before pushing events`;let a=new T1(this,t,n,r);return this._canPush()?a.send():(a.startTimeout(),this.pushBuffer.push(a)),a}_onMessage(t,n,r){return n}_isMember(t){return this.topic===t}_joinRef(){return this.joinPush.ref}_trigger(t,n,r){var a,i;const s=t.toLocaleLowerCase(),{close:o,error:l,leave:u,join:c}=yi;if(r&&[o,l,u,c].indexOf(s)>=0&&r!==this._joinRef())return;let p=this._onMessage(s,n,r);if(n&&!p)throw"channel onMessage callbacks must return the payload, modified or unmodified";["insert","update","delete"].includes(s)?(a=this.bindings.postgres_changes)===null||a===void 0||a.filter(d=>{var v,S,x;return((v=d.filter)===null||v===void 0?void 0:v.event)==="*"||((x=(S=d.filter)===null||S===void 0?void 0:S.event)===null||x===void 0?void 0:x.toLocaleLowerCase())===s}).map(d=>d.callback(p,r)):(i=this.bindings[s])===null||i===void 0||i.filter(d=>{var v,S,x,g,y,_;if(["broadcast","presence","postgres_changes"].includes(s))if("id"in d){const E=d.id,D=(v=d.filter)===null||v===void 0?void 0:v.event;return E&&((S=n.ids)===null||S===void 0?void 0:S.includes(E))&&(D==="*"||(D==null?void 0:D.toLocaleLowerCase())===((x=n.data)===null||x===void 0?void 0:x.type.toLocaleLowerCase()))}else{const E=(y=(g=d==null?void 0:d.filter)===null||g===void 0?void 0:g.event)===null||y===void 0?void 0:y.toLocaleLowerCase();return E==="*"||E===((_=n==null?void 0:n.event)===null||_===void 0?void 0:_.toLocaleLowerCase())}else return d.type.toLocaleLowerCase()===s}).map(d=>{if(typeof p=="object"&&"ids"in p){const v=p.data,{schema:S,table:x,commit_timestamp:g,type:y,errors:_}=v;p=Object.assign(Object.assign({},{schema:S,table:x,commit_timestamp:g,eventType:y,new:{},old:{},errors:_}),this._getPayloadRecords(v))}d.callback(p,r)})}_isClosed(){return this.state===wa.closed}_isJoined(){return this.state===wa.joined}_isJoining(){return this.state===wa.joining}_isLeaving(){return this.state===wa.leaving}_replyEventName(t){return`chan_reply_${t}`}_on(t,n,r){const a=t.toLocaleLowerCase(),i={type:a,filter:n,callback:r};return this.bindings[a]?this.bindings[a].push(i):this.bindings[a]=[i],this}_off(t,n){const r=t.toLocaleLowerCase();return this.bindings[r]=this.bindings[r].filter(a=>{var i;return!(((i=a.type)===null||i===void 0?void 0:i.toLocaleLowerCase())===r&&O5.isEqual(a.filter,n))}),this}static isEqual(t,n){if(Object.keys(t).length!==Object.keys(n).length)return!1;for(const r in t)if(t[r]!==n[r])return!1;return!0}_rejoinUntilConnected(){this.rejoinTimer.scheduleTimeout(),this.socket.isConnected()&&this._rejoin()}_onClose(t){this._on(yi.close,{},t)}_onError(t){this._on(yi.error,{},n=>t(n))}_canPush(){return this.socket.isConnected()&&this._isJoined()}_rejoin(t=this.timeout){this._isLeaving()||(this.socket._leaveOpenTopic(this.topic),this.state=wa.joining,this.joinPush.resend(t))}_getPayloadRecords(t){const n={new:{},old:{}};return(t.type==="INSERT"||t.type==="UPDATE")&&(n.new=Lx(t.columns,t.record)),(t.type==="UPDATE"||t.type==="DELETE")&&(n.old=Lx(t.columns,t.old_record)),n}}const yD=()=>{},bD=typeof WebSocket<"u",wD=`
62
+ addEventListener("message", (e) => {
63
+ if (e.data.event === "start") {
64
+ setInterval(() => postMessage({ event: "keepAlive" }), e.data.interval);
65
+ }
66
+ });`;class xD{constructor(t,n){var r;this.accessTokenValue=null,this.apiKey=null,this.channels=[],this.endPoint="",this.httpEndpoint="",this.headers=lD,this.params={},this.timeout=LA,this.heartbeatIntervalMs=3e4,this.heartbeatTimer=void 0,this.pendingHeartbeatRef=null,this.ref=0,this.logger=yD,this.conn=null,this.sendBuffer=[],this.serializer=new fD,this.stateChangeCallbacks={open:[],close:[],error:[],message:[]},this.accessToken=null,this._resolveFetch=i=>{let s;return i?s=i:typeof fetch>"u"?s=(...o)=>Ls(async()=>{const{default:l}=await Promise.resolve().then(()=>Nc);return{default:l}},void 0).then(({default:l})=>l(...o)):s=fetch,(...o)=>s(...o)},this.endPoint=`${t}/${mv.websocket}`,this.httpEndpoint=OA(t),n!=null&&n.transport?this.transport=n.transport:this.transport=null,n!=null&&n.params&&(this.params=n.params),n!=null&&n.headers&&(this.headers=Object.assign(Object.assign({},this.headers),n.headers)),n!=null&&n.timeout&&(this.timeout=n.timeout),n!=null&&n.logger&&(this.logger=n.logger),n!=null&&n.heartbeatIntervalMs&&(this.heartbeatIntervalMs=n.heartbeatIntervalMs);const a=(r=n==null?void 0:n.params)===null||r===void 0?void 0:r.apikey;if(a&&(this.accessTokenValue=a,this.apiKey=a),this.reconnectAfterMs=n!=null&&n.reconnectAfterMs?n.reconnectAfterMs:i=>[1e3,2e3,5e3,1e4][i-1]||1e4,this.encode=n!=null&&n.encode?n.encode:(i,s)=>s(JSON.stringify(i)),this.decode=n!=null&&n.decode?n.decode:this.serializer.decode.bind(this.serializer),this.reconnectTimer=new jA(async()=>{this.disconnect(),this.connect()},this.reconnectAfterMs),this.fetch=this._resolveFetch(n==null?void 0:n.fetch),n!=null&&n.worker){if(typeof window<"u"&&!window.Worker)throw new Error("Web Worker is not supported");this.worker=(n==null?void 0:n.worker)||!1,this.workerUrl=n==null?void 0:n.workerUrl}this.accessToken=(n==null?void 0:n.accessToken)||null}connect(){if(!this.conn){if(this.transport){this.conn=new this.transport(this.endpointURL(),void 0,{headers:this.headers});return}if(bD){this.conn=new WebSocket(this.endpointURL()),this.setupConnection();return}this.conn=new SD(this.endpointURL(),void 0,{close:()=>{this.conn=null}}),Ls(async()=>{const{default:t}=await import("./browser-BPq4aN9G.js").then(n=>n.b);return{default:t}},[]).then(({default:t})=>{this.conn=new t(this.endpointURL(),void 0,{headers:this.headers}),this.setupConnection()})}}endpointURL(){return this._appendParams(this.endPoint,Object.assign({},this.params,{vsn:uD}))}disconnect(t,n){this.conn&&(this.conn.onclose=function(){},t?this.conn.close(t,n??""):this.conn.close(),this.conn=null,this.heartbeatTimer&&clearInterval(this.heartbeatTimer),this.reconnectTimer.reset())}getChannels(){return this.channels}async removeChannel(t){const n=await t.unsubscribe();return this.channels.length===0&&this.disconnect(),n}async removeAllChannels(){const t=await Promise.all(this.channels.map(n=>n.unsubscribe()));return this.disconnect(),t}log(t,n,r){this.logger(t,n,r)}connectionState(){switch(this.conn&&this.conn.readyState){case qu.connecting:return sl.Connecting;case qu.open:return sl.Open;case qu.closing:return sl.Closing;default:return sl.Closed}}isConnected(){return this.connectionState()===sl.Open}channel(t,n={config:{}}){const r=new O5(`realtime:${t}`,n,this);return this.channels.push(r),r}push(t){const{topic:n,event:r,payload:a,ref:i}=t,s=()=>{this.encode(t,o=>{var l;(l=this.conn)===null||l===void 0||l.send(o)})};this.log("push",`${n} ${r} (${i})`,a),this.isConnected()?s():this.sendBuffer.push(s)}async setAuth(t=null){let n=t||this.accessToken&&await this.accessToken()||this.accessTokenValue;if(n){let r=null;try{r=JSON.parse(atob(n.split(".")[1]))}catch{}if(r&&r.exp&&!(Math.floor(Date.now()/1e3)-r.exp<0))return this.log("auth",`InvalidJWTToken: Invalid value for JWT claim "exp" with value ${r.exp}`),Promise.reject(`InvalidJWTToken: Invalid value for JWT claim "exp" with value ${r.exp}`);this.accessTokenValue=n,this.channels.forEach(a=>{n&&a.updateJoinPayload({access_token:n}),a.joinedOnce&&a._isJoined()&&a._push(yi.access_token,{access_token:n})})}}async sendHeartbeat(){var t;if(this.isConnected()){if(this.pendingHeartbeatRef){this.pendingHeartbeatRef=null,this.log("transport","heartbeat timeout. Attempting to re-establish connection"),(t=this.conn)===null||t===void 0||t.close(cD,"hearbeat timeout");return}this.pendingHeartbeatRef=this._makeRef(),this.push({topic:"phoenix",event:"heartbeat",payload:{},ref:this.pendingHeartbeatRef}),this.setAuth()}}flushSendBuffer(){this.isConnected()&&this.sendBuffer.length>0&&(this.sendBuffer.forEach(t=>t()),this.sendBuffer=[])}_makeRef(){let t=this.ref+1;return t===this.ref?this.ref=0:this.ref=t,this.ref.toString()}_leaveOpenTopic(t){let n=this.channels.find(r=>r.topic===t&&(r._isJoined()||r._isJoining()));n&&(this.log("transport",`leaving duplicate topic "${t}"`),n.unsubscribe())}_remove(t){this.channels=this.channels.filter(n=>n._joinRef()!==t._joinRef())}setupConnection(){this.conn&&(this.conn.binaryType="arraybuffer",this.conn.onopen=()=>this._onConnOpen(),this.conn.onerror=t=>this._onConnError(t),this.conn.onmessage=t=>this._onConnMessage(t),this.conn.onclose=t=>this._onConnClose(t))}_onConnMessage(t){this.decode(t.data,n=>{let{topic:r,event:a,payload:i,ref:s}=n;s&&s===this.pendingHeartbeatRef&&(this.pendingHeartbeatRef=null),this.log("receive",`${i.status||""} ${r} ${a} ${s&&"("+s+")"||""}`,i),this.channels.filter(o=>o._isMember(r)).forEach(o=>o._trigger(a,i,s)),this.stateChangeCallbacks.message.forEach(o=>o(n))})}async _onConnOpen(){if(this.log("transport",`connected to ${this.endpointURL()}`),this.flushSendBuffer(),this.reconnectTimer.reset(),!this.worker)this.heartbeatTimer&&clearInterval(this.heartbeatTimer),this.heartbeatTimer=setInterval(()=>this.sendHeartbeat(),this.heartbeatIntervalMs);else{this.workerUrl?this.log("worker",`starting worker for from ${this.workerUrl}`):this.log("worker","starting default worker");const t=this._workerObjectUrl(this.workerUrl);this.workerRef=new Worker(t),this.workerRef.onerror=n=>{this.log("worker","worker error",n.message),this.workerRef.terminate()},this.workerRef.onmessage=n=>{n.data.event==="keepAlive"&&this.sendHeartbeat()},this.workerRef.postMessage({event:"start",interval:this.heartbeatIntervalMs})}this.stateChangeCallbacks.open.forEach(t=>t())}_onConnClose(t){this.log("transport","close",t),this._triggerChanError(),this.heartbeatTimer&&clearInterval(this.heartbeatTimer),this.reconnectTimer.scheduleTimeout(),this.stateChangeCallbacks.close.forEach(n=>n(t))}_onConnError(t){this.log("transport",t.message),this._triggerChanError(),this.stateChangeCallbacks.error.forEach(n=>n(t))}_triggerChanError(){this.channels.forEach(t=>t._trigger(yi.error))}_appendParams(t,n){if(Object.keys(n).length===0)return t;const r=t.match(/\?/)?"&":"?",a=new URLSearchParams(n);return`${t}${r}${a}`}_workerObjectUrl(t){let n;if(t)n=t;else{const r=new Blob([wD],{type:"application/javascript"});n=URL.createObjectURL(r)}return n}}class SD{constructor(t,n,r){this.binaryType="arraybuffer",this.onclose=()=>{},this.onerror=()=>{},this.onmessage=()=>{},this.onopen=()=>{},this.readyState=qu.connecting,this.send=()=>{},this.url=null,this.url=t,this.close=r.close}}class D5 extends Error{constructor(t){super(t),this.__isStorageError=!0,this.name="StorageError"}}function dr(e){return typeof e=="object"&&e!==null&&"__isStorageError"in e}class _D extends D5{constructor(t,n){super(t),this.name="StorageApiError",this.status=n}toJSON(){return{name:this.name,message:this.message,status:this.status}}}class vv extends D5{constructor(t,n){super(t),this.name="StorageUnknownError",this.originalError=n}}var AD=function(e,t,n,r){function a(i){return i instanceof n?i:new n(function(s){s(i)})}return new(n||(n=Promise))(function(i,s){function o(c){try{u(r.next(c))}catch(f){s(f)}}function l(c){try{u(r.throw(c))}catch(f){s(f)}}function u(c){c.done?i(c.value):a(c.value).then(o,l)}u((r=r.apply(e,t||[])).next())})};const DA=e=>{let t;return e?t=e:typeof fetch>"u"?t=(...n)=>Ls(async()=>{const{default:r}=await Promise.resolve().then(()=>Nc);return{default:r}},void 0).then(({default:r})=>r(...n)):t=fetch,(...n)=>t(...n)},ND=()=>AD(void 0,void 0,void 0,function*(){return typeof Response>"u"?(yield Ls(()=>Promise.resolve().then(()=>Nc),void 0)).Response:Response}),yv=e=>{if(Array.isArray(e))return e.map(n=>yv(n));if(typeof e=="function"||e!==Object(e))return e;const t={};return Object.entries(e).forEach(([n,r])=>{const a=n.replace(/([-_][a-z])/gi,i=>i.toUpperCase().replace(/[-_]/g,""));t[a]=yv(r)}),t};var Ol=function(e,t,n,r){function a(i){return i instanceof n?i:new n(function(s){s(i)})}return new(n||(n=Promise))(function(i,s){function o(c){try{u(r.next(c))}catch(f){s(f)}}function l(c){try{u(r.throw(c))}catch(f){s(f)}}function u(c){c.done?i(c.value):a(c.value).then(o,l)}u((r=r.apply(e,t||[])).next())})};const O1=e=>e.msg||e.message||e.error_description||e.error||JSON.stringify(e),ED=(e,t,n)=>Ol(void 0,void 0,void 0,function*(){const r=yield ND();e instanceof r&&!(n!=null&&n.noResolveJson)?e.json().then(a=>{t(new _D(O1(a),e.status||500))}).catch(a=>{t(new vv(O1(a),a))}):t(new vv(O1(e),e))}),CD=(e,t,n,r)=>{const a={method:e,headers:(t==null?void 0:t.headers)||{}};return e==="GET"?a:(a.headers=Object.assign({"Content-Type":"application/json"},t==null?void 0:t.headers),r&&(a.body=JSON.stringify(r)),Object.assign(Object.assign({},a),n))};function $d(e,t,n,r,a,i){return Ol(this,void 0,void 0,function*(){return new Promise((s,o)=>{e(n,CD(t,r,a,i)).then(l=>{if(!l.ok)throw l;return r!=null&&r.noResolveJson?l:l.json()}).then(l=>s(l)).catch(l=>ED(l,o,r))})})}function Nm(e,t,n,r){return Ol(this,void 0,void 0,function*(){return $d(e,"GET",t,n,r)})}function so(e,t,n,r,a){return Ol(this,void 0,void 0,function*(){return $d(e,"POST",t,r,a,n)})}function LD(e,t,n,r,a){return Ol(this,void 0,void 0,function*(){return $d(e,"PUT",t,r,a,n)})}function jD(e,t,n,r){return Ol(this,void 0,void 0,function*(){return $d(e,"HEAD",t,Object.assign(Object.assign({},n),{noResolveJson:!0}),r)})}function RA(e,t,n,r,a){return Ol(this,void 0,void 0,function*(){return $d(e,"DELETE",t,r,a,n)})}var na=function(e,t,n,r){function a(i){return i instanceof n?i:new n(function(s){s(i)})}return new(n||(n=Promise))(function(i,s){function o(c){try{u(r.next(c))}catch(f){s(f)}}function l(c){try{u(r.throw(c))}catch(f){s(f)}}function u(c){c.done?i(c.value):a(c.value).then(o,l)}u((r=r.apply(e,t||[])).next())})};const TD={limit:100,offset:0,sortBy:{column:"name",order:"asc"}},Dx={cacheControl:"3600",contentType:"text/plain;charset=UTF-8",upsert:!1};class OD{constructor(t,n={},r,a){this.url=t,this.headers=n,this.bucketId=r,this.fetch=DA(a)}uploadOrUpdate(t,n,r,a){return na(this,void 0,void 0,function*(){try{let i;const s=Object.assign(Object.assign({},Dx),a);let o=Object.assign(Object.assign({},this.headers),t==="POST"&&{"x-upsert":String(s.upsert)});const l=s.metadata;typeof Blob<"u"&&r instanceof Blob?(i=new FormData,i.append("cacheControl",s.cacheControl),l&&i.append("metadata",this.encodeMetadata(l)),i.append("",r)):typeof FormData<"u"&&r instanceof FormData?(i=r,i.append("cacheControl",s.cacheControl),l&&i.append("metadata",this.encodeMetadata(l))):(i=r,o["cache-control"]=`max-age=${s.cacheControl}`,o["content-type"]=s.contentType,l&&(o["x-metadata"]=this.toBase64(this.encodeMetadata(l)))),a!=null&&a.headers&&(o=Object.assign(Object.assign({},o),a.headers));const u=this._removeEmptyFolders(n),c=this._getFinalPath(u),f=yield this.fetch(`${this.url}/object/${c}`,Object.assign({method:t,body:i,headers:o},s!=null&&s.duplex?{duplex:s.duplex}:{})),p=yield f.json();return f.ok?{data:{path:u,id:p.Id,fullPath:p.Key},error:null}:{data:null,error:p}}catch(i){if(dr(i))return{data:null,error:i};throw i}})}upload(t,n,r){return na(this,void 0,void 0,function*(){return this.uploadOrUpdate("POST",t,n,r)})}uploadToSignedUrl(t,n,r,a){return na(this,void 0,void 0,function*(){const i=this._removeEmptyFolders(t),s=this._getFinalPath(i),o=new URL(this.url+`/object/upload/sign/${s}`);o.searchParams.set("token",n);try{let l;const u=Object.assign({upsert:Dx.upsert},a),c=Object.assign(Object.assign({},this.headers),{"x-upsert":String(u.upsert)});typeof Blob<"u"&&r instanceof Blob?(l=new FormData,l.append("cacheControl",u.cacheControl),l.append("",r)):typeof FormData<"u"&&r instanceof FormData?(l=r,l.append("cacheControl",u.cacheControl)):(l=r,c["cache-control"]=`max-age=${u.cacheControl}`,c["content-type"]=u.contentType);const f=yield this.fetch(o.toString(),{method:"PUT",body:l,headers:c}),p=yield f.json();return f.ok?{data:{path:i,fullPath:p.Key},error:null}:{data:null,error:p}}catch(l){if(dr(l))return{data:null,error:l};throw l}})}createSignedUploadUrl(t,n){return na(this,void 0,void 0,function*(){try{let r=this._getFinalPath(t);const a=Object.assign({},this.headers);n!=null&&n.upsert&&(a["x-upsert"]="true");const i=yield so(this.fetch,`${this.url}/object/upload/sign/${r}`,{},{headers:a}),s=new URL(this.url+i.url),o=s.searchParams.get("token");if(!o)throw new D5("No token returned by API");return{data:{signedUrl:s.toString(),path:t,token:o},error:null}}catch(r){if(dr(r))return{data:null,error:r};throw r}})}update(t,n,r){return na(this,void 0,void 0,function*(){return this.uploadOrUpdate("PUT",t,n,r)})}move(t,n,r){return na(this,void 0,void 0,function*(){try{return{data:yield so(this.fetch,`${this.url}/object/move`,{bucketId:this.bucketId,sourceKey:t,destinationKey:n,destinationBucket:r==null?void 0:r.destinationBucket},{headers:this.headers}),error:null}}catch(a){if(dr(a))return{data:null,error:a};throw a}})}copy(t,n,r){return na(this,void 0,void 0,function*(){try{return{data:{path:(yield so(this.fetch,`${this.url}/object/copy`,{bucketId:this.bucketId,sourceKey:t,destinationKey:n,destinationBucket:r==null?void 0:r.destinationBucket},{headers:this.headers})).Key},error:null}}catch(a){if(dr(a))return{data:null,error:a};throw a}})}createSignedUrl(t,n,r){return na(this,void 0,void 0,function*(){try{let a=this._getFinalPath(t),i=yield so(this.fetch,`${this.url}/object/sign/${a}`,Object.assign({expiresIn:n},r!=null&&r.transform?{transform:r.transform}:{}),{headers:this.headers});const s=r!=null&&r.download?`&download=${r.download===!0?"":r.download}`:"";return i={signedUrl:encodeURI(`${this.url}${i.signedURL}${s}`)},{data:i,error:null}}catch(a){if(dr(a))return{data:null,error:a};throw a}})}createSignedUrls(t,n,r){return na(this,void 0,void 0,function*(){try{const a=yield so(this.fetch,`${this.url}/object/sign/${this.bucketId}`,{expiresIn:n,paths:t},{headers:this.headers}),i=r!=null&&r.download?`&download=${r.download===!0?"":r.download}`:"";return{data:a.map(s=>Object.assign(Object.assign({},s),{signedUrl:s.signedURL?encodeURI(`${this.url}${s.signedURL}${i}`):null})),error:null}}catch(a){if(dr(a))return{data:null,error:a};throw a}})}download(t,n){return na(this,void 0,void 0,function*(){const a=typeof(n==null?void 0:n.transform)<"u"?"render/image/authenticated":"object",i=this.transformOptsToQueryString((n==null?void 0:n.transform)||{}),s=i?`?${i}`:"";try{const o=this._getFinalPath(t);return{data:yield(yield Nm(this.fetch,`${this.url}/${a}/${o}${s}`,{headers:this.headers,noResolveJson:!0})).blob(),error:null}}catch(o){if(dr(o))return{data:null,error:o};throw o}})}info(t){return na(this,void 0,void 0,function*(){const n=this._getFinalPath(t);try{const r=yield Nm(this.fetch,`${this.url}/object/info/${n}`,{headers:this.headers});return{data:yv(r),error:null}}catch(r){if(dr(r))return{data:null,error:r};throw r}})}exists(t){return na(this,void 0,void 0,function*(){const n=this._getFinalPath(t);try{return yield jD(this.fetch,`${this.url}/object/${n}`,{headers:this.headers}),{data:!0,error:null}}catch(r){if(dr(r)&&r instanceof vv){const a=r.originalError;if([400,404].includes(a==null?void 0:a.status))return{data:!1,error:r}}throw r}})}getPublicUrl(t,n){const r=this._getFinalPath(t),a=[],i=n!=null&&n.download?`download=${n.download===!0?"":n.download}`:"";i!==""&&a.push(i);const o=typeof(n==null?void 0:n.transform)<"u"?"render/image":"object",l=this.transformOptsToQueryString((n==null?void 0:n.transform)||{});l!==""&&a.push(l);let u=a.join("&");return u!==""&&(u=`?${u}`),{data:{publicUrl:encodeURI(`${this.url}/${o}/public/${r}${u}`)}}}remove(t){return na(this,void 0,void 0,function*(){try{return{data:yield RA(this.fetch,`${this.url}/object/${this.bucketId}`,{prefixes:t},{headers:this.headers}),error:null}}catch(n){if(dr(n))return{data:null,error:n};throw n}})}list(t,n,r){return na(this,void 0,void 0,function*(){try{const a=Object.assign(Object.assign(Object.assign({},TD),n),{prefix:t||""});return{data:yield so(this.fetch,`${this.url}/object/list/${this.bucketId}`,a,{headers:this.headers},r),error:null}}catch(a){if(dr(a))return{data:null,error:a};throw a}})}encodeMetadata(t){return JSON.stringify(t)}toBase64(t){return typeof Buffer<"u"?Buffer.from(t).toString("base64"):btoa(t)}_getFinalPath(t){return`${this.bucketId}/${t}`}_removeEmptyFolders(t){return t.replace(/^\/|\/$/g,"").replace(/\/+/g,"/")}transformOptsToQueryString(t){const n=[];return t.width&&n.push(`width=${t.width}`),t.height&&n.push(`height=${t.height}`),t.resize&&n.push(`resize=${t.resize}`),t.format&&n.push(`format=${t.format}`),t.quality&&n.push(`quality=${t.quality}`),n.join("&")}}const DD="2.7.1",RD={"X-Client-Info":`storage-js/${DD}`};var au=function(e,t,n,r){function a(i){return i instanceof n?i:new n(function(s){s(i)})}return new(n||(n=Promise))(function(i,s){function o(c){try{u(r.next(c))}catch(f){s(f)}}function l(c){try{u(r.throw(c))}catch(f){s(f)}}function u(c){c.done?i(c.value):a(c.value).then(o,l)}u((r=r.apply(e,t||[])).next())})};class MD{constructor(t,n={},r){this.url=t,this.headers=Object.assign(Object.assign({},RD),n),this.fetch=DA(r)}listBuckets(){return au(this,void 0,void 0,function*(){try{return{data:yield Nm(this.fetch,`${this.url}/bucket`,{headers:this.headers}),error:null}}catch(t){if(dr(t))return{data:null,error:t};throw t}})}getBucket(t){return au(this,void 0,void 0,function*(){try{return{data:yield Nm(this.fetch,`${this.url}/bucket/${t}`,{headers:this.headers}),error:null}}catch(n){if(dr(n))return{data:null,error:n};throw n}})}createBucket(t,n={public:!1}){return au(this,void 0,void 0,function*(){try{return{data:yield so(this.fetch,`${this.url}/bucket`,{id:t,name:t,public:n.public,file_size_limit:n.fileSizeLimit,allowed_mime_types:n.allowedMimeTypes},{headers:this.headers}),error:null}}catch(r){if(dr(r))return{data:null,error:r};throw r}})}updateBucket(t,n){return au(this,void 0,void 0,function*(){try{return{data:yield LD(this.fetch,`${this.url}/bucket/${t}`,{id:t,name:t,public:n.public,file_size_limit:n.fileSizeLimit,allowed_mime_types:n.allowedMimeTypes},{headers:this.headers}),error:null}}catch(r){if(dr(r))return{data:null,error:r};throw r}})}emptyBucket(t){return au(this,void 0,void 0,function*(){try{return{data:yield so(this.fetch,`${this.url}/bucket/${t}/empty`,{},{headers:this.headers}),error:null}}catch(n){if(dr(n))return{data:null,error:n};throw n}})}deleteBucket(t){return au(this,void 0,void 0,function*(){try{return{data:yield RA(this.fetch,`${this.url}/bucket/${t}`,{},{headers:this.headers}),error:null}}catch(n){if(dr(n))return{data:null,error:n};throw n}})}}class kD extends MD{constructor(t,n={},r){super(t,n,r)}from(t){return new OD(this.url,this.headers,t,this.fetch)}}const PD="2.49.4";let Cf="";typeof Deno<"u"?Cf="deno":typeof document<"u"?Cf="web":typeof navigator<"u"&&navigator.product==="ReactNative"?Cf="react-native":Cf="node";const ID={"X-Client-Info":`supabase-js-${Cf}/${PD}`},FD={headers:ID},BD={schema:"public"},$D={autoRefreshToken:!0,persistSession:!0,detectSessionInUrl:!0,flowType:"implicit"},UD={};var zD=function(e,t,n,r){function a(i){return i instanceof n?i:new n(function(s){s(i)})}return new(n||(n=Promise))(function(i,s){function o(c){try{u(r.next(c))}catch(f){s(f)}}function l(c){try{u(r.throw(c))}catch(f){s(f)}}function u(c){c.done?i(c.value):a(c.value).then(o,l)}u((r=r.apply(e,t||[])).next())})};const qD=e=>{let t;return e?t=e:typeof fetch>"u"?t=vA:t=fetch,(...n)=>t(...n)},HD=()=>typeof Headers>"u"?yA:Headers,VD=(e,t,n)=>{const r=qD(n),a=HD();return(i,s)=>zD(void 0,void 0,void 0,function*(){var o;const l=(o=yield t())!==null&&o!==void 0?o:e;let u=new a(s==null?void 0:s.headers);return u.has("apikey")||u.set("apikey",e),u.has("Authorization")||u.set("Authorization",`Bearer ${l}`),r(i,Object.assign(Object.assign({},s),{headers:u}))})};var YD=function(e,t,n,r){function a(i){return i instanceof n?i:new n(function(s){s(i)})}return new(n||(n=Promise))(function(i,s){function o(c){try{u(r.next(c))}catch(f){s(f)}}function l(c){try{u(r.throw(c))}catch(f){s(f)}}function u(c){c.done?i(c.value):a(c.value).then(o,l)}u((r=r.apply(e,t||[])).next())})};function GD(e){return e.replace(/\/$/,"")}function WD(e,t){const{db:n,auth:r,realtime:a,global:i}=e,{db:s,auth:o,realtime:l,global:u}=t,c={db:Object.assign(Object.assign({},s),n),auth:Object.assign(Object.assign({},o),r),realtime:Object.assign(Object.assign({},l),a),global:Object.assign(Object.assign({},u),i),accessToken:()=>YD(this,void 0,void 0,function*(){return""})};return e.accessToken?c.accessToken=e.accessToken:delete c.accessToken,c}const MA="2.69.1",bu=30*1e3,bv=3,D1=bv*bu,JD="http://localhost:9999",KD="supabase.auth.token",XD={"X-Client-Info":`gotrue-js/${MA}`},wv="X-Supabase-Api-Version",kA={"2024-01-01":{timestamp:Date.parse("2024-01-01T00:00:00.0Z"),name:"2024-01-01"}},QD=/^([a-z0-9_-]{4})*($|[a-z0-9_-]{3}$|[a-z0-9_-]{2}$)$/i,ZD=6e5;class R5 extends Error{constructor(t,n,r){super(t),this.__isAuthError=!0,this.name="AuthError",this.status=n,this.code=r}}function Ct(e){return typeof e=="object"&&e!==null&&"__isAuthError"in e}class eR extends R5{constructor(t,n,r){super(t,n,r),this.name="AuthApiError",this.status=n,this.code=r}}function tR(e){return Ct(e)&&e.name==="AuthApiError"}class PA extends R5{constructor(t,n){super(t),this.name="AuthUnknownError",this.originalError=n}}class $o extends R5{constructor(t,n,r,a){super(t,r,a),this.name=n,this.status=r}}class no extends $o{constructor(){super("Auth session missing!","AuthSessionMissingError",400,void 0)}}function nR(e){return Ct(e)&&e.name==="AuthSessionMissingError"}class R1 extends $o{constructor(){super("Auth session or user missing","AuthInvalidTokenResponseError",500,void 0)}}class ep extends $o{constructor(t){super(t,"AuthInvalidCredentialsError",400,void 0)}}class tp extends $o{constructor(t,n=null){super(t,"AuthImplicitGrantRedirectError",500,void 0),this.details=null,this.details=n}toJSON(){return{name:this.name,message:this.message,status:this.status,details:this.details}}}function rR(e){return Ct(e)&&e.name==="AuthImplicitGrantRedirectError"}class Rx extends $o{constructor(t,n=null){super(t,"AuthPKCEGrantCodeExchangeError",500,void 0),this.details=null,this.details=n}toJSON(){return{name:this.name,message:this.message,status:this.status,details:this.details}}}class xv extends $o{constructor(t,n){super(t,"AuthRetryableFetchError",n,void 0)}}function M1(e){return Ct(e)&&e.name==="AuthRetryableFetchError"}class Mx extends $o{constructor(t,n,r){super(t,"AuthWeakPasswordError",n,"weak_password"),this.reasons=r}}class Hf extends $o{constructor(t){super(t,"AuthInvalidJwtError",400,"invalid_jwt")}}const kx="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_".split(""),Px=`
67
+ \r=`.split(""),aR=(()=>{const e=new Array(128);for(let t=0;t<e.length;t+=1)e[t]=-1;for(let t=0;t<Px.length;t+=1)e[Px[t].charCodeAt(0)]=-2;for(let t=0;t<kx.length;t+=1)e[kx[t].charCodeAt(0)]=t;return e})();function IA(e,t,n){const r=aR[e];if(r>-1)for(t.queue=t.queue<<6|r,t.queuedBits+=6;t.queuedBits>=8;)n(t.queue>>t.queuedBits-8&255),t.queuedBits-=8;else{if(r===-2)return;throw new Error(`Invalid Base64-URL character "${String.fromCharCode(e)}"`)}}function Ix(e){const t=[],n=s=>{t.push(String.fromCodePoint(s))},r={utf8seq:0,codepoint:0},a={queue:0,queuedBits:0},i=s=>{oR(s,r,n)};for(let s=0;s<e.length;s+=1)IA(e.charCodeAt(s),a,i);return t.join("")}function iR(e,t){if(e<=127){t(e);return}else if(e<=2047){t(192|e>>6),t(128|e&63);return}else if(e<=65535){t(224|e>>12),t(128|e>>6&63),t(128|e&63);return}else if(e<=1114111){t(240|e>>18),t(128|e>>12&63),t(128|e>>6&63),t(128|e&63);return}throw new Error(`Unrecognized Unicode codepoint: ${e.toString(16)}`)}function sR(e,t){for(let n=0;n<e.length;n+=1){let r=e.charCodeAt(n);if(r>55295&&r<=56319){const a=(r-55296)*1024&65535;r=(e.charCodeAt(n+1)-56320&65535|a)+65536,n+=1}iR(r,t)}}function oR(e,t,n){if(t.utf8seq===0){if(e<=127){n(e);return}for(let r=1;r<6;r+=1)if(!(e>>7-r&1)){t.utf8seq=r;break}if(t.utf8seq===2)t.codepoint=e&31;else if(t.utf8seq===3)t.codepoint=e&15;else if(t.utf8seq===4)t.codepoint=e&7;else throw new Error("Invalid UTF-8 sequence");t.utf8seq-=1}else if(t.utf8seq>0){if(e<=127)throw new Error("Invalid UTF-8 sequence");t.codepoint=t.codepoint<<6|e&63,t.utf8seq-=1,t.utf8seq===0&&n(t.codepoint)}}function lR(e){const t=[],n={queue:0,queuedBits:0},r=a=>{t.push(a)};for(let a=0;a<e.length;a+=1)IA(e.charCodeAt(a),n,r);return new Uint8Array(t)}function uR(e){const t=[];return sR(e,n=>t.push(n)),new Uint8Array(t)}function cR(e){return Math.round(Date.now()/1e3)+e}function fR(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(e){const t=Math.random()*16|0;return(e=="x"?t:t&3|8).toString(16)})}const ji=()=>typeof window<"u"&&typeof document<"u",Zo={tested:!1,writable:!1},Vf=()=>{if(!ji())return!1;try{if(typeof globalThis.localStorage!="object")return!1}catch{return!1}if(Zo.tested)return Zo.writable;const e=`lswt-${Math.random()}${Math.random()}`;try{globalThis.localStorage.setItem(e,e),globalThis.localStorage.removeItem(e),Zo.tested=!0,Zo.writable=!0}catch{Zo.tested=!0,Zo.writable=!1}return Zo.writable};function dR(e){const t={},n=new URL(e);if(n.hash&&n.hash[0]==="#")try{new URLSearchParams(n.hash.substring(1)).forEach((a,i)=>{t[i]=a})}catch{}return n.searchParams.forEach((r,a)=>{t[a]=r}),t}const FA=e=>{let t;return e?t=e:typeof fetch>"u"?t=(...n)=>Ls(async()=>{const{default:r}=await Promise.resolve().then(()=>Nc);return{default:r}},void 0).then(({default:r})=>r(...n)):t=fetch,(...n)=>t(...n)},hR=e=>typeof e=="object"&&e!==null&&"status"in e&&"ok"in e&&"json"in e&&typeof e.json=="function",BA=async(e,t,n)=>{await e.setItem(t,JSON.stringify(n))},np=async(e,t)=>{const n=await e.getItem(t);if(!n)return null;try{return JSON.parse(n)}catch{return n}},rp=async(e,t)=>{await e.removeItem(t)};class Cg{constructor(){this.promise=new Cg.promiseConstructor((t,n)=>{this.resolve=t,this.reject=n})}}Cg.promiseConstructor=Promise;function k1(e){const t=e.split(".");if(t.length!==3)throw new Hf("Invalid JWT structure");for(let r=0;r<t.length;r++)if(!QD.test(t[r]))throw new Hf("JWT not in base64url format");return{header:JSON.parse(Ix(t[0])),payload:JSON.parse(Ix(t[1])),signature:lR(t[2]),raw:{header:t[0],payload:t[1]}}}async function pR(e){return await new Promise(t=>{setTimeout(()=>t(null),e)})}function mR(e,t){return new Promise((r,a)=>{(async()=>{for(let i=0;i<1/0;i++)try{const s=await e(i);if(!t(i,null,s)){r(s);return}}catch(s){if(!t(i,s)){a(s);return}}})()})}function gR(e){return("0"+e.toString(16)).substr(-2)}function vR(){const t=new Uint32Array(56);if(typeof crypto>"u"){const n="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-._~",r=n.length;let a="";for(let i=0;i<56;i++)a+=n.charAt(Math.floor(Math.random()*r));return a}return crypto.getRandomValues(t),Array.from(t,gR).join("")}async function yR(e){const n=new TextEncoder().encode(e),r=await crypto.subtle.digest("SHA-256",n),a=new Uint8Array(r);return Array.from(a).map(i=>String.fromCharCode(i)).join("")}async function bR(e){if(!(typeof crypto<"u"&&typeof crypto.subtle<"u"&&typeof TextEncoder<"u"))return console.warn("WebCrypto API is not supported. Code challenge method will default to use plain instead of sha256."),e;const n=await yR(e);return btoa(n).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"")}async function iu(e,t,n=!1){const r=vR();let a=r;n&&(a+="/PASSWORD_RECOVERY"),await BA(e,`${t}-code-verifier`,a);const i=await bR(r);return[i,r===i?"plain":"s256"]}const wR=/^2[0-9]{3}-(0[1-9]|1[0-2])-(0[1-9]|1[0-9]|2[0-9]|3[0-1])$/i;function xR(e){const t=e.headers.get(wv);if(!t||!t.match(wR))return null;try{return new Date(`${t}T00:00:00.0Z`)}catch{return null}}function SR(e){if(!e)throw new Error("Missing exp claim");const t=Math.floor(Date.now()/1e3);if(e<=t)throw new Error("JWT has expired")}function _R(e){switch(e){case"RS256":return{name:"RSASSA-PKCS1-v1_5",hash:{name:"SHA-256"}};case"ES256":return{name:"ECDSA",namedCurve:"P-256",hash:{name:"SHA-256"}};default:throw new Error("Invalid alg claim")}}var AR=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var a=0,r=Object.getOwnPropertySymbols(e);a<r.length;a++)t.indexOf(r[a])<0&&Object.prototype.propertyIsEnumerable.call(e,r[a])&&(n[r[a]]=e[r[a]]);return n};const al=e=>e.msg||e.message||e.error_description||e.error||JSON.stringify(e),NR=[502,503,504];async function Fx(e){var t;if(!hR(e))throw new xv(al(e),0);if(NR.includes(e.status))throw new xv(al(e),e.status);let n;try{n=await e.json()}catch(i){throw new PA(al(i),i)}let r;const a=xR(e);if(a&&a.getTime()>=kA["2024-01-01"].timestamp&&typeof n=="object"&&n&&typeof n.code=="string"?r=n.code:typeof n=="object"&&n&&typeof n.error_code=="string"&&(r=n.error_code),r){if(r==="weak_password")throw new Mx(al(n),e.status,((t=n.weak_password)===null||t===void 0?void 0:t.reasons)||[]);if(r==="session_not_found")throw new no}else if(typeof n=="object"&&n&&typeof n.weak_password=="object"&&n.weak_password&&Array.isArray(n.weak_password.reasons)&&n.weak_password.reasons.length&&n.weak_password.reasons.reduce((i,s)=>i&&typeof s=="string",!0))throw new Mx(al(n),e.status,n.weak_password.reasons);throw new eR(al(n),e.status||500,r)}const ER=(e,t,n,r)=>{const a={method:e,headers:(t==null?void 0:t.headers)||{}};return e==="GET"?a:(a.headers=Object.assign({"Content-Type":"application/json;charset=UTF-8"},t==null?void 0:t.headers),a.body=JSON.stringify(r),Object.assign(Object.assign({},a),n))};async function Mt(e,t,n,r){var a;const i=Object.assign({},r==null?void 0:r.headers);i[wv]||(i[wv]=kA["2024-01-01"].name),r!=null&&r.jwt&&(i.Authorization=`Bearer ${r.jwt}`);const s=(a=r==null?void 0:r.query)!==null&&a!==void 0?a:{};r!=null&&r.redirectTo&&(s.redirect_to=r.redirectTo);const o=Object.keys(s).length?"?"+new URLSearchParams(s).toString():"",l=await CR(e,t,n+o,{headers:i,noResolveJson:r==null?void 0:r.noResolveJson},{},r==null?void 0:r.body);return r!=null&&r.xform?r==null?void 0:r.xform(l):{data:Object.assign({},l),error:null}}async function CR(e,t,n,r,a,i){const s=ER(t,r,a,i);let o;try{o=await e(n,Object.assign({},s))}catch(l){throw console.error(l),new xv(al(l),0)}if(o.ok||await Fx(o),r!=null&&r.noResolveJson)return o;try{return await o.json()}catch(l){await Fx(l)}}function ro(e){var t;let n=null;OR(e)&&(n=Object.assign({},e),e.expires_at||(n.expires_at=cR(e.expires_in)));const r=(t=e.user)!==null&&t!==void 0?t:e;return{data:{session:n,user:r},error:null}}function Bx(e){const t=ro(e);return!t.error&&e.weak_password&&typeof e.weak_password=="object"&&Array.isArray(e.weak_password.reasons)&&e.weak_password.reasons.length&&e.weak_password.message&&typeof e.weak_password.message=="string"&&e.weak_password.reasons.reduce((n,r)=>n&&typeof r=="string",!0)&&(t.data.weak_password=e.weak_password),t}function mo(e){var t;return{data:{user:(t=e.user)!==null&&t!==void 0?t:e},error:null}}function LR(e){return{data:e,error:null}}function jR(e){const{action_link:t,email_otp:n,hashed_token:r,redirect_to:a,verification_type:i}=e,s=AR(e,["action_link","email_otp","hashed_token","redirect_to","verification_type"]),o={action_link:t,email_otp:n,hashed_token:r,redirect_to:a,verification_type:i},l=Object.assign({},s);return{data:{properties:o,user:l},error:null}}function TR(e){return e}function OR(e){return e.access_token&&e.refresh_token&&e.expires_in}var DR=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var a=0,r=Object.getOwnPropertySymbols(e);a<r.length;a++)t.indexOf(r[a])<0&&Object.prototype.propertyIsEnumerable.call(e,r[a])&&(n[r[a]]=e[r[a]]);return n};class RR{constructor({url:t="",headers:n={},fetch:r}){this.url=t,this.headers=n,this.fetch=FA(r),this.mfa={listFactors:this._listFactors.bind(this),deleteFactor:this._deleteFactor.bind(this)}}async signOut(t,n="global"){try{return await Mt(this.fetch,"POST",`${this.url}/logout?scope=${n}`,{headers:this.headers,jwt:t,noResolveJson:!0}),{data:null,error:null}}catch(r){if(Ct(r))return{data:null,error:r};throw r}}async inviteUserByEmail(t,n={}){try{return await Mt(this.fetch,"POST",`${this.url}/invite`,{body:{email:t,data:n.data},headers:this.headers,redirectTo:n.redirectTo,xform:mo})}catch(r){if(Ct(r))return{data:{user:null},error:r};throw r}}async generateLink(t){try{const{options:n}=t,r=DR(t,["options"]),a=Object.assign(Object.assign({},r),n);return"newEmail"in r&&(a.new_email=r==null?void 0:r.newEmail,delete a.newEmail),await Mt(this.fetch,"POST",`${this.url}/admin/generate_link`,{body:a,headers:this.headers,xform:jR,redirectTo:n==null?void 0:n.redirectTo})}catch(n){if(Ct(n))return{data:{properties:null,user:null},error:n};throw n}}async createUser(t){try{return await Mt(this.fetch,"POST",`${this.url}/admin/users`,{body:t,headers:this.headers,xform:mo})}catch(n){if(Ct(n))return{data:{user:null},error:n};throw n}}async listUsers(t){var n,r,a,i,s,o,l;try{const u={nextPage:null,lastPage:0,total:0},c=await Mt(this.fetch,"GET",`${this.url}/admin/users`,{headers:this.headers,noResolveJson:!0,query:{page:(r=(n=t==null?void 0:t.page)===null||n===void 0?void 0:n.toString())!==null&&r!==void 0?r:"",per_page:(i=(a=t==null?void 0:t.perPage)===null||a===void 0?void 0:a.toString())!==null&&i!==void 0?i:""},xform:TR});if(c.error)throw c.error;const f=await c.json(),p=(s=c.headers.get("x-total-count"))!==null&&s!==void 0?s:0,d=(l=(o=c.headers.get("link"))===null||o===void 0?void 0:o.split(","))!==null&&l!==void 0?l:[];return d.length>0&&(d.forEach(v=>{const S=parseInt(v.split(";")[0].split("=")[1].substring(0,1)),x=JSON.parse(v.split(";")[1].split("=")[1]);u[`${x}Page`]=S}),u.total=parseInt(p)),{data:Object.assign(Object.assign({},f),u),error:null}}catch(u){if(Ct(u))return{data:{users:[]},error:u};throw u}}async getUserById(t){try{return await Mt(this.fetch,"GET",`${this.url}/admin/users/${t}`,{headers:this.headers,xform:mo})}catch(n){if(Ct(n))return{data:{user:null},error:n};throw n}}async updateUserById(t,n){try{return await Mt(this.fetch,"PUT",`${this.url}/admin/users/${t}`,{body:n,headers:this.headers,xform:mo})}catch(r){if(Ct(r))return{data:{user:null},error:r};throw r}}async deleteUser(t,n=!1){try{return await Mt(this.fetch,"DELETE",`${this.url}/admin/users/${t}`,{headers:this.headers,body:{should_soft_delete:n},xform:mo})}catch(r){if(Ct(r))return{data:{user:null},error:r};throw r}}async _listFactors(t){try{const{data:n,error:r}=await Mt(this.fetch,"GET",`${this.url}/admin/users/${t.userId}/factors`,{headers:this.headers,xform:a=>({data:{factors:a},error:null})});return{data:n,error:r}}catch(n){if(Ct(n))return{data:null,error:n};throw n}}async _deleteFactor(t){try{return{data:await Mt(this.fetch,"DELETE",`${this.url}/admin/users/${t.userId}/factors/${t.id}`,{headers:this.headers}),error:null}}catch(n){if(Ct(n))return{data:null,error:n};throw n}}}const MR={getItem:e=>Vf()?globalThis.localStorage.getItem(e):null,setItem:(e,t)=>{Vf()&&globalThis.localStorage.setItem(e,t)},removeItem:e=>{Vf()&&globalThis.localStorage.removeItem(e)}};function $x(e={}){return{getItem:t=>e[t]||null,setItem:(t,n)=>{e[t]=n},removeItem:t=>{delete e[t]}}}function kR(){if(typeof globalThis!="object")try{Object.defineProperty(Object.prototype,"__magic__",{get:function(){return this},configurable:!0}),__magic__.globalThis=__magic__,delete Object.prototype.__magic__}catch{typeof self<"u"&&(self.globalThis=self)}}const su={debug:!!(globalThis&&Vf()&&globalThis.localStorage&&globalThis.localStorage.getItem("supabase.gotrue-js.locks.debug")==="true")};class $A extends Error{constructor(t){super(t),this.isAcquireTimeout=!0}}class PR extends $A{}async function IR(e,t,n){su.debug&&console.log("@supabase/gotrue-js: navigatorLock: acquire lock",e,t);const r=new globalThis.AbortController;return t>0&&setTimeout(()=>{r.abort(),su.debug&&console.log("@supabase/gotrue-js: navigatorLock acquire timed out",e)},t),await Promise.resolve().then(()=>globalThis.navigator.locks.request(e,t===0?{mode:"exclusive",ifAvailable:!0}:{mode:"exclusive",signal:r.signal},async a=>{if(a){su.debug&&console.log("@supabase/gotrue-js: navigatorLock: acquired",e,a.name);try{return await n()}finally{su.debug&&console.log("@supabase/gotrue-js: navigatorLock: released",e,a.name)}}else{if(t===0)throw su.debug&&console.log("@supabase/gotrue-js: navigatorLock: not immediately available",e),new PR(`Acquiring an exclusive Navigator LockManager lock "${e}" immediately failed`);if(su.debug)try{const i=await globalThis.navigator.locks.query();console.log("@supabase/gotrue-js: Navigator LockManager state",JSON.stringify(i,null," "))}catch(i){console.warn("@supabase/gotrue-js: Error when querying Navigator LockManager state",i)}return console.warn("@supabase/gotrue-js: Navigator LockManager returned a null lock when using #request without ifAvailable set to true, it appears this browser is not following the LockManager spec https://developer.mozilla.org/en-US/docs/Web/API/LockManager/request"),await n()}}))}kR();const FR={url:JD,storageKey:KD,autoRefreshToken:!0,persistSession:!0,detectSessionInUrl:!0,headers:XD,flowType:"implicit",debug:!1,hasCustomAuthorizationHeader:!1};async function Ux(e,t,n){return await n()}class dd{constructor(t){var n,r;this.memoryStorage=null,this.stateChangeEmitters=new Map,this.autoRefreshTicker=null,this.visibilityChangedCallback=null,this.refreshingDeferred=null,this.initializePromise=null,this.detectSessionInUrl=!0,this.hasCustomAuthorizationHeader=!1,this.suppressGetSessionWarning=!1,this.lockAcquired=!1,this.pendingInLock=[],this.broadcastChannel=null,this.logger=console.log,this.instanceID=dd.nextInstanceID,dd.nextInstanceID+=1,this.instanceID>0&&ji()&&console.warn("Multiple GoTrueClient instances detected in the same browser context. It is not an error, but this should be avoided as it may produce undefined behavior when used concurrently under the same storage key.");const a=Object.assign(Object.assign({},FR),t);if(this.logDebugMessages=!!a.debug,typeof a.debug=="function"&&(this.logger=a.debug),this.persistSession=a.persistSession,this.storageKey=a.storageKey,this.autoRefreshToken=a.autoRefreshToken,this.admin=new RR({url:a.url,headers:a.headers,fetch:a.fetch}),this.url=a.url,this.headers=a.headers,this.fetch=FA(a.fetch),this.lock=a.lock||Ux,this.detectSessionInUrl=a.detectSessionInUrl,this.flowType=a.flowType,this.hasCustomAuthorizationHeader=a.hasCustomAuthorizationHeader,a.lock?this.lock=a.lock:ji()&&(!((n=globalThis==null?void 0:globalThis.navigator)===null||n===void 0)&&n.locks)?this.lock=IR:this.lock=Ux,this.jwks={keys:[]},this.jwks_cached_at=Number.MIN_SAFE_INTEGER,this.mfa={verify:this._verify.bind(this),enroll:this._enroll.bind(this),unenroll:this._unenroll.bind(this),challenge:this._challenge.bind(this),listFactors:this._listFactors.bind(this),challengeAndVerify:this._challengeAndVerify.bind(this),getAuthenticatorAssuranceLevel:this._getAuthenticatorAssuranceLevel.bind(this)},this.persistSession?a.storage?this.storage=a.storage:Vf()?this.storage=MR:(this.memoryStorage={},this.storage=$x(this.memoryStorage)):(this.memoryStorage={},this.storage=$x(this.memoryStorage)),ji()&&globalThis.BroadcastChannel&&this.persistSession&&this.storageKey){try{this.broadcastChannel=new globalThis.BroadcastChannel(this.storageKey)}catch(i){console.error("Failed to create a new BroadcastChannel, multi-tab state changes will not be available",i)}(r=this.broadcastChannel)===null||r===void 0||r.addEventListener("message",async i=>{this._debug("received broadcast notification from other tab or client",i),await this._notifyAllSubscribers(i.data.event,i.data.session,!1)})}this.initialize()}_debug(...t){return this.logDebugMessages&&this.logger(`GoTrueClient@${this.instanceID} (${MA}) ${new Date().toISOString()}`,...t),this}async initialize(){return this.initializePromise?await this.initializePromise:(this.initializePromise=(async()=>await this._acquireLock(-1,async()=>await this._initialize()))(),await this.initializePromise)}async _initialize(){var t;try{const n=dR(window.location.href);let r="none";if(this._isImplicitGrantCallback(n)?r="implicit":await this._isPKCECallback(n)&&(r="pkce"),ji()&&this.detectSessionInUrl&&r!=="none"){const{data:a,error:i}=await this._getSessionFromURL(n,r);if(i){if(this._debug("#_initialize()","error detecting session from URL",i),rR(i)){const l=(t=i.details)===null||t===void 0?void 0:t.code;if(l==="identity_already_exists"||l==="identity_not_found"||l==="single_identity_not_deletable")return{error:i}}return await this._removeSession(),{error:i}}const{session:s,redirectType:o}=a;return this._debug("#_initialize()","detected session in URL",s,"redirect type",o),await this._saveSession(s),setTimeout(async()=>{o==="recovery"?await this._notifyAllSubscribers("PASSWORD_RECOVERY",s):await this._notifyAllSubscribers("SIGNED_IN",s)},0),{error:null}}return await this._recoverAndRefresh(),{error:null}}catch(n){return Ct(n)?{error:n}:{error:new PA("Unexpected error during initialization",n)}}finally{await this._handleVisibilityChange(),this._debug("#_initialize()","end")}}async signInAnonymously(t){var n,r,a;try{const i=await Mt(this.fetch,"POST",`${this.url}/signup`,{headers:this.headers,body:{data:(r=(n=t==null?void 0:t.options)===null||n===void 0?void 0:n.data)!==null&&r!==void 0?r:{},gotrue_meta_security:{captcha_token:(a=t==null?void 0:t.options)===null||a===void 0?void 0:a.captchaToken}},xform:ro}),{data:s,error:o}=i;if(o||!s)return{data:{user:null,session:null},error:o};const l=s.session,u=s.user;return s.session&&(await this._saveSession(s.session),await this._notifyAllSubscribers("SIGNED_IN",l)),{data:{user:u,session:l},error:null}}catch(i){if(Ct(i))return{data:{user:null,session:null},error:i};throw i}}async signUp(t){var n,r,a;try{let i;if("email"in t){const{email:c,password:f,options:p}=t;let d=null,v=null;this.flowType==="pkce"&&([d,v]=await iu(this.storage,this.storageKey)),i=await Mt(this.fetch,"POST",`${this.url}/signup`,{headers:this.headers,redirectTo:p==null?void 0:p.emailRedirectTo,body:{email:c,password:f,data:(n=p==null?void 0:p.data)!==null&&n!==void 0?n:{},gotrue_meta_security:{captcha_token:p==null?void 0:p.captchaToken},code_challenge:d,code_challenge_method:v},xform:ro})}else if("phone"in t){const{phone:c,password:f,options:p}=t;i=await Mt(this.fetch,"POST",`${this.url}/signup`,{headers:this.headers,body:{phone:c,password:f,data:(r=p==null?void 0:p.data)!==null&&r!==void 0?r:{},channel:(a=p==null?void 0:p.channel)!==null&&a!==void 0?a:"sms",gotrue_meta_security:{captcha_token:p==null?void 0:p.captchaToken}},xform:ro})}else throw new ep("You must provide either an email or phone number and a password");const{data:s,error:o}=i;if(o||!s)return{data:{user:null,session:null},error:o};const l=s.session,u=s.user;return s.session&&(await this._saveSession(s.session),await this._notifyAllSubscribers("SIGNED_IN",l)),{data:{user:u,session:l},error:null}}catch(i){if(Ct(i))return{data:{user:null,session:null},error:i};throw i}}async signInWithPassword(t){try{let n;if("email"in t){const{email:i,password:s,options:o}=t;n=await Mt(this.fetch,"POST",`${this.url}/token?grant_type=password`,{headers:this.headers,body:{email:i,password:s,gotrue_meta_security:{captcha_token:o==null?void 0:o.captchaToken}},xform:Bx})}else if("phone"in t){const{phone:i,password:s,options:o}=t;n=await Mt(this.fetch,"POST",`${this.url}/token?grant_type=password`,{headers:this.headers,body:{phone:i,password:s,gotrue_meta_security:{captcha_token:o==null?void 0:o.captchaToken}},xform:Bx})}else throw new ep("You must provide either an email or phone number and a password");const{data:r,error:a}=n;return a?{data:{user:null,session:null},error:a}:!r||!r.session||!r.user?{data:{user:null,session:null},error:new R1}:(r.session&&(await this._saveSession(r.session),await this._notifyAllSubscribers("SIGNED_IN",r.session)),{data:Object.assign({user:r.user,session:r.session},r.weak_password?{weakPassword:r.weak_password}:null),error:a})}catch(n){if(Ct(n))return{data:{user:null,session:null},error:n};throw n}}async signInWithOAuth(t){var n,r,a,i;return await this._handleProviderSignIn(t.provider,{redirectTo:(n=t.options)===null||n===void 0?void 0:n.redirectTo,scopes:(r=t.options)===null||r===void 0?void 0:r.scopes,queryParams:(a=t.options)===null||a===void 0?void 0:a.queryParams,skipBrowserRedirect:(i=t.options)===null||i===void 0?void 0:i.skipBrowserRedirect})}async exchangeCodeForSession(t){return await this.initializePromise,this._acquireLock(-1,async()=>this._exchangeCodeForSession(t))}async _exchangeCodeForSession(t){const n=await np(this.storage,`${this.storageKey}-code-verifier`),[r,a]=(n??"").split("/");try{const{data:i,error:s}=await Mt(this.fetch,"POST",`${this.url}/token?grant_type=pkce`,{headers:this.headers,body:{auth_code:t,code_verifier:r},xform:ro});if(await rp(this.storage,`${this.storageKey}-code-verifier`),s)throw s;return!i||!i.session||!i.user?{data:{user:null,session:null,redirectType:null},error:new R1}:(i.session&&(await this._saveSession(i.session),await this._notifyAllSubscribers("SIGNED_IN",i.session)),{data:Object.assign(Object.assign({},i),{redirectType:a??null}),error:s})}catch(i){if(Ct(i))return{data:{user:null,session:null,redirectType:null},error:i};throw i}}async signInWithIdToken(t){try{const{options:n,provider:r,token:a,access_token:i,nonce:s}=t,o=await Mt(this.fetch,"POST",`${this.url}/token?grant_type=id_token`,{headers:this.headers,body:{provider:r,id_token:a,access_token:i,nonce:s,gotrue_meta_security:{captcha_token:n==null?void 0:n.captchaToken}},xform:ro}),{data:l,error:u}=o;return u?{data:{user:null,session:null},error:u}:!l||!l.session||!l.user?{data:{user:null,session:null},error:new R1}:(l.session&&(await this._saveSession(l.session),await this._notifyAllSubscribers("SIGNED_IN",l.session)),{data:l,error:u})}catch(n){if(Ct(n))return{data:{user:null,session:null},error:n};throw n}}async signInWithOtp(t){var n,r,a,i,s;try{if("email"in t){const{email:o,options:l}=t;let u=null,c=null;this.flowType==="pkce"&&([u,c]=await iu(this.storage,this.storageKey));const{error:f}=await Mt(this.fetch,"POST",`${this.url}/otp`,{headers:this.headers,body:{email:o,data:(n=l==null?void 0:l.data)!==null&&n!==void 0?n:{},create_user:(r=l==null?void 0:l.shouldCreateUser)!==null&&r!==void 0?r:!0,gotrue_meta_security:{captcha_token:l==null?void 0:l.captchaToken},code_challenge:u,code_challenge_method:c},redirectTo:l==null?void 0:l.emailRedirectTo});return{data:{user:null,session:null},error:f}}if("phone"in t){const{phone:o,options:l}=t,{data:u,error:c}=await Mt(this.fetch,"POST",`${this.url}/otp`,{headers:this.headers,body:{phone:o,data:(a=l==null?void 0:l.data)!==null&&a!==void 0?a:{},create_user:(i=l==null?void 0:l.shouldCreateUser)!==null&&i!==void 0?i:!0,gotrue_meta_security:{captcha_token:l==null?void 0:l.captchaToken},channel:(s=l==null?void 0:l.channel)!==null&&s!==void 0?s:"sms"}});return{data:{user:null,session:null,messageId:u==null?void 0:u.message_id},error:c}}throw new ep("You must provide either an email or phone number.")}catch(o){if(Ct(o))return{data:{user:null,session:null},error:o};throw o}}async verifyOtp(t){var n,r;try{let a,i;"options"in t&&(a=(n=t.options)===null||n===void 0?void 0:n.redirectTo,i=(r=t.options)===null||r===void 0?void 0:r.captchaToken);const{data:s,error:o}=await Mt(this.fetch,"POST",`${this.url}/verify`,{headers:this.headers,body:Object.assign(Object.assign({},t),{gotrue_meta_security:{captcha_token:i}}),redirectTo:a,xform:ro});if(o)throw o;if(!s)throw new Error("An error occurred on token verification.");const l=s.session,u=s.user;return l!=null&&l.access_token&&(await this._saveSession(l),await this._notifyAllSubscribers(t.type=="recovery"?"PASSWORD_RECOVERY":"SIGNED_IN",l)),{data:{user:u,session:l},error:null}}catch(a){if(Ct(a))return{data:{user:null,session:null},error:a};throw a}}async signInWithSSO(t){var n,r,a;try{let i=null,s=null;return this.flowType==="pkce"&&([i,s]=await iu(this.storage,this.storageKey)),await Mt(this.fetch,"POST",`${this.url}/sso`,{body:Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},"providerId"in t?{provider_id:t.providerId}:null),"domain"in t?{domain:t.domain}:null),{redirect_to:(r=(n=t.options)===null||n===void 0?void 0:n.redirectTo)!==null&&r!==void 0?r:void 0}),!((a=t==null?void 0:t.options)===null||a===void 0)&&a.captchaToken?{gotrue_meta_security:{captcha_token:t.options.captchaToken}}:null),{skip_http_redirect:!0,code_challenge:i,code_challenge_method:s}),headers:this.headers,xform:LR})}catch(i){if(Ct(i))return{data:null,error:i};throw i}}async reauthenticate(){return await this.initializePromise,await this._acquireLock(-1,async()=>await this._reauthenticate())}async _reauthenticate(){try{return await this._useSession(async t=>{const{data:{session:n},error:r}=t;if(r)throw r;if(!n)throw new no;const{error:a}=await Mt(this.fetch,"GET",`${this.url}/reauthenticate`,{headers:this.headers,jwt:n.access_token});return{data:{user:null,session:null},error:a}})}catch(t){if(Ct(t))return{data:{user:null,session:null},error:t};throw t}}async resend(t){try{const n=`${this.url}/resend`;if("email"in t){const{email:r,type:a,options:i}=t,{error:s}=await Mt(this.fetch,"POST",n,{headers:this.headers,body:{email:r,type:a,gotrue_meta_security:{captcha_token:i==null?void 0:i.captchaToken}},redirectTo:i==null?void 0:i.emailRedirectTo});return{data:{user:null,session:null},error:s}}else if("phone"in t){const{phone:r,type:a,options:i}=t,{data:s,error:o}=await Mt(this.fetch,"POST",n,{headers:this.headers,body:{phone:r,type:a,gotrue_meta_security:{captcha_token:i==null?void 0:i.captchaToken}}});return{data:{user:null,session:null,messageId:s==null?void 0:s.message_id},error:o}}throw new ep("You must provide either an email or phone number and a type")}catch(n){if(Ct(n))return{data:{user:null,session:null},error:n};throw n}}async getSession(){return await this.initializePromise,await this._acquireLock(-1,async()=>this._useSession(async n=>n))}async _acquireLock(t,n){this._debug("#_acquireLock","begin",t);try{if(this.lockAcquired){const r=this.pendingInLock.length?this.pendingInLock[this.pendingInLock.length-1]:Promise.resolve(),a=(async()=>(await r,await n()))();return this.pendingInLock.push((async()=>{try{await a}catch{}})()),a}return await this.lock(`lock:${this.storageKey}`,t,async()=>{this._debug("#_acquireLock","lock acquired for storage key",this.storageKey);try{this.lockAcquired=!0;const r=n();for(this.pendingInLock.push((async()=>{try{await r}catch{}})()),await r;this.pendingInLock.length;){const a=[...this.pendingInLock];await Promise.all(a),this.pendingInLock.splice(0,a.length)}return await r}finally{this._debug("#_acquireLock","lock released for storage key",this.storageKey),this.lockAcquired=!1}})}finally{this._debug("#_acquireLock","end")}}async _useSession(t){this._debug("#_useSession","begin");try{const n=await this.__loadSession();return await t(n)}finally{this._debug("#_useSession","end")}}async __loadSession(){this._debug("#__loadSession()","begin"),this.lockAcquired||this._debug("#__loadSession()","used outside of an acquired lock!",new Error().stack);try{let t=null;const n=await np(this.storage,this.storageKey);if(this._debug("#getSession()","session from storage",n),n!==null&&(this._isValidSession(n)?t=n:(this._debug("#getSession()","session from storage is not valid"),await this._removeSession())),!t)return{data:{session:null},error:null};const r=t.expires_at?t.expires_at*1e3-Date.now()<D1:!1;if(this._debug("#__loadSession()",`session has${r?"":" not"} expired`,"expires_at",t.expires_at),!r){if(this.storage.isServer){let s=this.suppressGetSessionWarning;t=new Proxy(t,{get:(l,u,c)=>(!s&&u==="user"&&(console.warn("Using the user object as returned from supabase.auth.getSession() or from some supabase.auth.onAuthStateChange() events could be insecure! This value comes directly from the storage medium (usually cookies on the server) and may not be authentic. Use supabase.auth.getUser() instead which authenticates the data by contacting the Supabase Auth server."),s=!0,this.suppressGetSessionWarning=!0),Reflect.get(l,u,c))})}return{data:{session:t},error:null}}const{session:a,error:i}=await this._callRefreshToken(t.refresh_token);return i?{data:{session:null},error:i}:{data:{session:a},error:null}}finally{this._debug("#__loadSession()","end")}}async getUser(t){return t?await this._getUser(t):(await this.initializePromise,await this._acquireLock(-1,async()=>await this._getUser()))}async _getUser(t){try{return t?await Mt(this.fetch,"GET",`${this.url}/user`,{headers:this.headers,jwt:t,xform:mo}):await this._useSession(async n=>{var r,a,i;const{data:s,error:o}=n;if(o)throw o;return!(!((r=s.session)===null||r===void 0)&&r.access_token)&&!this.hasCustomAuthorizationHeader?{data:{user:null},error:new no}:await Mt(this.fetch,"GET",`${this.url}/user`,{headers:this.headers,jwt:(i=(a=s.session)===null||a===void 0?void 0:a.access_token)!==null&&i!==void 0?i:void 0,xform:mo})})}catch(n){if(Ct(n))return nR(n)&&(await this._removeSession(),await rp(this.storage,`${this.storageKey}-code-verifier`)),{data:{user:null},error:n};throw n}}async updateUser(t,n={}){return await this.initializePromise,await this._acquireLock(-1,async()=>await this._updateUser(t,n))}async _updateUser(t,n={}){try{return await this._useSession(async r=>{const{data:a,error:i}=r;if(i)throw i;if(!a.session)throw new no;const s=a.session;let o=null,l=null;this.flowType==="pkce"&&t.email!=null&&([o,l]=await iu(this.storage,this.storageKey));const{data:u,error:c}=await Mt(this.fetch,"PUT",`${this.url}/user`,{headers:this.headers,redirectTo:n==null?void 0:n.emailRedirectTo,body:Object.assign(Object.assign({},t),{code_challenge:o,code_challenge_method:l}),jwt:s.access_token,xform:mo});if(c)throw c;return s.user=u.user,await this._saveSession(s),await this._notifyAllSubscribers("USER_UPDATED",s),{data:{user:s.user},error:null}})}catch(r){if(Ct(r))return{data:{user:null},error:r};throw r}}async setSession(t){return await this.initializePromise,await this._acquireLock(-1,async()=>await this._setSession(t))}async _setSession(t){try{if(!t.access_token||!t.refresh_token)throw new no;const n=Date.now()/1e3;let r=n,a=!0,i=null;const{payload:s}=k1(t.access_token);if(s.exp&&(r=s.exp,a=r<=n),a){const{session:o,error:l}=await this._callRefreshToken(t.refresh_token);if(l)return{data:{user:null,session:null},error:l};if(!o)return{data:{user:null,session:null},error:null};i=o}else{const{data:o,error:l}=await this._getUser(t.access_token);if(l)throw l;i={access_token:t.access_token,refresh_token:t.refresh_token,user:o.user,token_type:"bearer",expires_in:r-n,expires_at:r},await this._saveSession(i),await this._notifyAllSubscribers("SIGNED_IN",i)}return{data:{user:i.user,session:i},error:null}}catch(n){if(Ct(n))return{data:{session:null,user:null},error:n};throw n}}async refreshSession(t){return await this.initializePromise,await this._acquireLock(-1,async()=>await this._refreshSession(t))}async _refreshSession(t){try{return await this._useSession(async n=>{var r;if(!t){const{data:s,error:o}=n;if(o)throw o;t=(r=s.session)!==null&&r!==void 0?r:void 0}if(!(t!=null&&t.refresh_token))throw new no;const{session:a,error:i}=await this._callRefreshToken(t.refresh_token);return i?{data:{user:null,session:null},error:i}:a?{data:{user:a.user,session:a},error:null}:{data:{user:null,session:null},error:null}})}catch(n){if(Ct(n))return{data:{user:null,session:null},error:n};throw n}}async _getSessionFromURL(t,n){try{if(!ji())throw new tp("No browser detected.");if(t.error||t.error_description||t.error_code)throw new tp(t.error_description||"Error in URL with unspecified error_description",{error:t.error||"unspecified_error",code:t.error_code||"unspecified_code"});switch(n){case"implicit":if(this.flowType==="pkce")throw new Rx("Not a valid PKCE flow url.");break;case"pkce":if(this.flowType==="implicit")throw new tp("Not a valid implicit grant flow url.");break;default:}if(n==="pkce"){if(this._debug("#_initialize()","begin","is PKCE flow",!0),!t.code)throw new Rx("No code detected.");const{data:y,error:_}=await this._exchangeCodeForSession(t.code);if(_)throw _;const E=new URL(window.location.href);return E.searchParams.delete("code"),window.history.replaceState(window.history.state,"",E.toString()),{data:{session:y.session,redirectType:null},error:null}}const{provider_token:r,provider_refresh_token:a,access_token:i,refresh_token:s,expires_in:o,expires_at:l,token_type:u}=t;if(!i||!o||!s||!u)throw new tp("No session defined in URL");const c=Math.round(Date.now()/1e3),f=parseInt(o);let p=c+f;l&&(p=parseInt(l));const d=p-c;d*1e3<=bu&&console.warn(`@supabase/gotrue-js: Session as retrieved from URL expires in ${d}s, should have been closer to ${f}s`);const v=p-f;c-v>=120?console.warn("@supabase/gotrue-js: Session as retrieved from URL was issued over 120s ago, URL could be stale",v,p,c):c-v<0&&console.warn("@supabase/gotrue-js: Session as retrieved from URL was issued in the future? Check the device clock for skew",v,p,c);const{data:S,error:x}=await this._getUser(i);if(x)throw x;const g={provider_token:r,provider_refresh_token:a,access_token:i,expires_in:f,expires_at:p,refresh_token:s,token_type:u,user:S.user};return window.location.hash="",this._debug("#_getSessionFromURL()","clearing window.location.hash"),{data:{session:g,redirectType:t.type},error:null}}catch(r){if(Ct(r))return{data:{session:null,redirectType:null},error:r};throw r}}_isImplicitGrantCallback(t){return!!(t.access_token||t.error_description)}async _isPKCECallback(t){const n=await np(this.storage,`${this.storageKey}-code-verifier`);return!!(t.code&&n)}async signOut(t={scope:"global"}){return await this.initializePromise,await this._acquireLock(-1,async()=>await this._signOut(t))}async _signOut({scope:t}={scope:"global"}){return await this._useSession(async n=>{var r;const{data:a,error:i}=n;if(i)return{error:i};const s=(r=a.session)===null||r===void 0?void 0:r.access_token;if(s){const{error:o}=await this.admin.signOut(s,t);if(o&&!(tR(o)&&(o.status===404||o.status===401||o.status===403)))return{error:o}}return t!=="others"&&(await this._removeSession(),await rp(this.storage,`${this.storageKey}-code-verifier`)),{error:null}})}onAuthStateChange(t){const n=fR(),r={id:n,callback:t,unsubscribe:()=>{this._debug("#unsubscribe()","state change callback with id removed",n),this.stateChangeEmitters.delete(n)}};return this._debug("#onAuthStateChange()","registered callback with id",n),this.stateChangeEmitters.set(n,r),(async()=>(await this.initializePromise,await this._acquireLock(-1,async()=>{this._emitInitialSession(n)})))(),{data:{subscription:r}}}async _emitInitialSession(t){return await this._useSession(async n=>{var r,a;try{const{data:{session:i},error:s}=n;if(s)throw s;await((r=this.stateChangeEmitters.get(t))===null||r===void 0?void 0:r.callback("INITIAL_SESSION",i)),this._debug("INITIAL_SESSION","callback id",t,"session",i)}catch(i){await((a=this.stateChangeEmitters.get(t))===null||a===void 0?void 0:a.callback("INITIAL_SESSION",null)),this._debug("INITIAL_SESSION","callback id",t,"error",i),console.error(i)}})}async resetPasswordForEmail(t,n={}){let r=null,a=null;this.flowType==="pkce"&&([r,a]=await iu(this.storage,this.storageKey,!0));try{return await Mt(this.fetch,"POST",`${this.url}/recover`,{body:{email:t,code_challenge:r,code_challenge_method:a,gotrue_meta_security:{captcha_token:n.captchaToken}},headers:this.headers,redirectTo:n.redirectTo})}catch(i){if(Ct(i))return{data:null,error:i};throw i}}async getUserIdentities(){var t;try{const{data:n,error:r}=await this.getUser();if(r)throw r;return{data:{identities:(t=n.user.identities)!==null&&t!==void 0?t:[]},error:null}}catch(n){if(Ct(n))return{data:null,error:n};throw n}}async linkIdentity(t){var n;try{const{data:r,error:a}=await this._useSession(async i=>{var s,o,l,u,c;const{data:f,error:p}=i;if(p)throw p;const d=await this._getUrlForProvider(`${this.url}/user/identities/authorize`,t.provider,{redirectTo:(s=t.options)===null||s===void 0?void 0:s.redirectTo,scopes:(o=t.options)===null||o===void 0?void 0:o.scopes,queryParams:(l=t.options)===null||l===void 0?void 0:l.queryParams,skipBrowserRedirect:!0});return await Mt(this.fetch,"GET",d,{headers:this.headers,jwt:(c=(u=f.session)===null||u===void 0?void 0:u.access_token)!==null&&c!==void 0?c:void 0})});if(a)throw a;return ji()&&!(!((n=t.options)===null||n===void 0)&&n.skipBrowserRedirect)&&window.location.assign(r==null?void 0:r.url),{data:{provider:t.provider,url:r==null?void 0:r.url},error:null}}catch(r){if(Ct(r))return{data:{provider:t.provider,url:null},error:r};throw r}}async unlinkIdentity(t){try{return await this._useSession(async n=>{var r,a;const{data:i,error:s}=n;if(s)throw s;return await Mt(this.fetch,"DELETE",`${this.url}/user/identities/${t.identity_id}`,{headers:this.headers,jwt:(a=(r=i.session)===null||r===void 0?void 0:r.access_token)!==null&&a!==void 0?a:void 0})})}catch(n){if(Ct(n))return{data:null,error:n};throw n}}async _refreshAccessToken(t){const n=`#_refreshAccessToken(${t.substring(0,5)}...)`;this._debug(n,"begin");try{const r=Date.now();return await mR(async a=>(a>0&&await pR(200*Math.pow(2,a-1)),this._debug(n,"refreshing attempt",a),await Mt(this.fetch,"POST",`${this.url}/token?grant_type=refresh_token`,{body:{refresh_token:t},headers:this.headers,xform:ro})),(a,i)=>{const s=200*Math.pow(2,a);return i&&M1(i)&&Date.now()+s-r<bu})}catch(r){if(this._debug(n,"error",r),Ct(r))return{data:{session:null,user:null},error:r};throw r}finally{this._debug(n,"end")}}_isValidSession(t){return typeof t=="object"&&t!==null&&"access_token"in t&&"refresh_token"in t&&"expires_at"in t}async _handleProviderSignIn(t,n){const r=await this._getUrlForProvider(`${this.url}/authorize`,t,{redirectTo:n.redirectTo,scopes:n.scopes,queryParams:n.queryParams});return this._debug("#_handleProviderSignIn()","provider",t,"options",n,"url",r),ji()&&!n.skipBrowserRedirect&&window.location.assign(r),{data:{provider:t,url:r},error:null}}async _recoverAndRefresh(){var t;const n="#_recoverAndRefresh()";this._debug(n,"begin");try{const r=await np(this.storage,this.storageKey);if(this._debug(n,"session from storage",r),!this._isValidSession(r)){this._debug(n,"session is not valid"),r!==null&&await this._removeSession();return}const a=((t=r.expires_at)!==null&&t!==void 0?t:1/0)*1e3-Date.now()<D1;if(this._debug(n,`session has${a?"":" not"} expired with margin of ${D1}s`),a){if(this.autoRefreshToken&&r.refresh_token){const{error:i}=await this._callRefreshToken(r.refresh_token);i&&(console.error(i),M1(i)||(this._debug(n,"refresh failed with a non-retryable error, removing the session",i),await this._removeSession()))}}else await this._notifyAllSubscribers("SIGNED_IN",r)}catch(r){this._debug(n,"error",r),console.error(r);return}finally{this._debug(n,"end")}}async _callRefreshToken(t){var n,r;if(!t)throw new no;if(this.refreshingDeferred)return this.refreshingDeferred.promise;const a=`#_callRefreshToken(${t.substring(0,5)}...)`;this._debug(a,"begin");try{this.refreshingDeferred=new Cg;const{data:i,error:s}=await this._refreshAccessToken(t);if(s)throw s;if(!i.session)throw new no;await this._saveSession(i.session),await this._notifyAllSubscribers("TOKEN_REFRESHED",i.session);const o={session:i.session,error:null};return this.refreshingDeferred.resolve(o),o}catch(i){if(this._debug(a,"error",i),Ct(i)){const s={session:null,error:i};return M1(i)||await this._removeSession(),(n=this.refreshingDeferred)===null||n===void 0||n.resolve(s),s}throw(r=this.refreshingDeferred)===null||r===void 0||r.reject(i),i}finally{this.refreshingDeferred=null,this._debug(a,"end")}}async _notifyAllSubscribers(t,n,r=!0){const a=`#_notifyAllSubscribers(${t})`;this._debug(a,"begin",n,`broadcast = ${r}`);try{this.broadcastChannel&&r&&this.broadcastChannel.postMessage({event:t,session:n});const i=[],s=Array.from(this.stateChangeEmitters.values()).map(async o=>{try{await o.callback(t,n)}catch(l){i.push(l)}});if(await Promise.all(s),i.length>0){for(let o=0;o<i.length;o+=1)console.error(i[o]);throw i[0]}}finally{this._debug(a,"end")}}async _saveSession(t){this._debug("#_saveSession()",t),this.suppressGetSessionWarning=!0,await BA(this.storage,this.storageKey,t)}async _removeSession(){this._debug("#_removeSession()"),await rp(this.storage,this.storageKey),await this._notifyAllSubscribers("SIGNED_OUT",null)}_removeVisibilityChangedCallback(){this._debug("#_removeVisibilityChangedCallback()");const t=this.visibilityChangedCallback;this.visibilityChangedCallback=null;try{t&&ji()&&(window!=null&&window.removeEventListener)&&window.removeEventListener("visibilitychange",t)}catch(n){console.error("removing visibilitychange callback failed",n)}}async _startAutoRefresh(){await this._stopAutoRefresh(),this._debug("#_startAutoRefresh()");const t=setInterval(()=>this._autoRefreshTokenTick(),bu);this.autoRefreshTicker=t,t&&typeof t=="object"&&typeof t.unref=="function"?t.unref():typeof Deno<"u"&&typeof Deno.unrefTimer=="function"&&Deno.unrefTimer(t),setTimeout(async()=>{await this.initializePromise,await this._autoRefreshTokenTick()},0)}async _stopAutoRefresh(){this._debug("#_stopAutoRefresh()");const t=this.autoRefreshTicker;this.autoRefreshTicker=null,t&&clearInterval(t)}async startAutoRefresh(){this._removeVisibilityChangedCallback(),await this._startAutoRefresh()}async stopAutoRefresh(){this._removeVisibilityChangedCallback(),await this._stopAutoRefresh()}async _autoRefreshTokenTick(){this._debug("#_autoRefreshTokenTick()","begin");try{await this._acquireLock(0,async()=>{try{const t=Date.now();try{return await this._useSession(async n=>{const{data:{session:r}}=n;if(!r||!r.refresh_token||!r.expires_at){this._debug("#_autoRefreshTokenTick()","no session");return}const a=Math.floor((r.expires_at*1e3-t)/bu);this._debug("#_autoRefreshTokenTick()",`access token expires in ${a} ticks, a tick lasts ${bu}ms, refresh threshold is ${bv} ticks`),a<=bv&&await this._callRefreshToken(r.refresh_token)})}catch(n){console.error("Auto refresh tick failed with error. This is likely a transient error.",n)}}finally{this._debug("#_autoRefreshTokenTick()","end")}})}catch(t){if(t.isAcquireTimeout||t instanceof $A)this._debug("auto refresh token tick lock not available");else throw t}}async _handleVisibilityChange(){if(this._debug("#_handleVisibilityChange()"),!ji()||!(window!=null&&window.addEventListener))return this.autoRefreshToken&&this.startAutoRefresh(),!1;try{this.visibilityChangedCallback=async()=>await this._onVisibilityChanged(!1),window==null||window.addEventListener("visibilitychange",this.visibilityChangedCallback),await this._onVisibilityChanged(!0)}catch(t){console.error("_handleVisibilityChange",t)}}async _onVisibilityChanged(t){const n=`#_onVisibilityChanged(${t})`;this._debug(n,"visibilityState",document.visibilityState),document.visibilityState==="visible"?(this.autoRefreshToken&&this._startAutoRefresh(),t||(await this.initializePromise,await this._acquireLock(-1,async()=>{if(document.visibilityState!=="visible"){this._debug(n,"acquired the lock to recover the session, but the browser visibilityState is no longer visible, aborting");return}await this._recoverAndRefresh()}))):document.visibilityState==="hidden"&&this.autoRefreshToken&&this._stopAutoRefresh()}async _getUrlForProvider(t,n,r){const a=[`provider=${encodeURIComponent(n)}`];if(r!=null&&r.redirectTo&&a.push(`redirect_to=${encodeURIComponent(r.redirectTo)}`),r!=null&&r.scopes&&a.push(`scopes=${encodeURIComponent(r.scopes)}`),this.flowType==="pkce"){const[i,s]=await iu(this.storage,this.storageKey),o=new URLSearchParams({code_challenge:`${encodeURIComponent(i)}`,code_challenge_method:`${encodeURIComponent(s)}`});a.push(o.toString())}if(r!=null&&r.queryParams){const i=new URLSearchParams(r.queryParams);a.push(i.toString())}return r!=null&&r.skipBrowserRedirect&&a.push(`skip_http_redirect=${r.skipBrowserRedirect}`),`${t}?${a.join("&")}`}async _unenroll(t){try{return await this._useSession(async n=>{var r;const{data:a,error:i}=n;return i?{data:null,error:i}:await Mt(this.fetch,"DELETE",`${this.url}/factors/${t.factorId}`,{headers:this.headers,jwt:(r=a==null?void 0:a.session)===null||r===void 0?void 0:r.access_token})})}catch(n){if(Ct(n))return{data:null,error:n};throw n}}async _enroll(t){try{return await this._useSession(async n=>{var r,a;const{data:i,error:s}=n;if(s)return{data:null,error:s};const o=Object.assign({friendly_name:t.friendlyName,factor_type:t.factorType},t.factorType==="phone"?{phone:t.phone}:{issuer:t.issuer}),{data:l,error:u}=await Mt(this.fetch,"POST",`${this.url}/factors`,{body:o,headers:this.headers,jwt:(r=i==null?void 0:i.session)===null||r===void 0?void 0:r.access_token});return u?{data:null,error:u}:(t.factorType==="totp"&&(!((a=l==null?void 0:l.totp)===null||a===void 0)&&a.qr_code)&&(l.totp.qr_code=`data:image/svg+xml;utf-8,${l.totp.qr_code}`),{data:l,error:null})})}catch(n){if(Ct(n))return{data:null,error:n};throw n}}async _verify(t){return this._acquireLock(-1,async()=>{try{return await this._useSession(async n=>{var r;const{data:a,error:i}=n;if(i)return{data:null,error:i};const{data:s,error:o}=await Mt(this.fetch,"POST",`${this.url}/factors/${t.factorId}/verify`,{body:{code:t.code,challenge_id:t.challengeId},headers:this.headers,jwt:(r=a==null?void 0:a.session)===null||r===void 0?void 0:r.access_token});return o?{data:null,error:o}:(await this._saveSession(Object.assign({expires_at:Math.round(Date.now()/1e3)+s.expires_in},s)),await this._notifyAllSubscribers("MFA_CHALLENGE_VERIFIED",s),{data:s,error:o})})}catch(n){if(Ct(n))return{data:null,error:n};throw n}})}async _challenge(t){return this._acquireLock(-1,async()=>{try{return await this._useSession(async n=>{var r;const{data:a,error:i}=n;return i?{data:null,error:i}:await Mt(this.fetch,"POST",`${this.url}/factors/${t.factorId}/challenge`,{body:{channel:t.channel},headers:this.headers,jwt:(r=a==null?void 0:a.session)===null||r===void 0?void 0:r.access_token})})}catch(n){if(Ct(n))return{data:null,error:n};throw n}})}async _challengeAndVerify(t){const{data:n,error:r}=await this._challenge({factorId:t.factorId});return r?{data:null,error:r}:await this._verify({factorId:t.factorId,challengeId:n.id,code:t.code})}async _listFactors(){const{data:{user:t},error:n}=await this.getUser();if(n)return{data:null,error:n};const r=(t==null?void 0:t.factors)||[],a=r.filter(s=>s.factor_type==="totp"&&s.status==="verified"),i=r.filter(s=>s.factor_type==="phone"&&s.status==="verified");return{data:{all:r,totp:a,phone:i},error:null}}async _getAuthenticatorAssuranceLevel(){return this._acquireLock(-1,async()=>await this._useSession(async t=>{var n,r;const{data:{session:a},error:i}=t;if(i)return{data:null,error:i};if(!a)return{data:{currentLevel:null,nextLevel:null,currentAuthenticationMethods:[]},error:null};const{payload:s}=k1(a.access_token);let o=null;s.aal&&(o=s.aal);let l=o;((r=(n=a.user.factors)===null||n===void 0?void 0:n.filter(f=>f.status==="verified"))!==null&&r!==void 0?r:[]).length>0&&(l="aal2");const c=s.amr||[];return{data:{currentLevel:o,nextLevel:l,currentAuthenticationMethods:c},error:null}}))}async fetchJwk(t,n={keys:[]}){let r=n.keys.find(s=>s.kid===t);if(r||(r=this.jwks.keys.find(s=>s.kid===t),r&&this.jwks_cached_at+ZD>Date.now()))return r;const{data:a,error:i}=await Mt(this.fetch,"GET",`${this.url}/.well-known/jwks.json`,{headers:this.headers});if(i)throw i;if(!a.keys||a.keys.length===0)throw new Hf("JWKS is empty");if(this.jwks=a,this.jwks_cached_at=Date.now(),r=a.keys.find(s=>s.kid===t),!r)throw new Hf("No matching signing key found in JWKS");return r}async getClaims(t,n={keys:[]}){try{let r=t;if(!r){const{data:d,error:v}=await this.getSession();if(v||!d.session)return{data:null,error:v};r=d.session.access_token}const{header:a,payload:i,signature:s,raw:{header:o,payload:l}}=k1(r);if(SR(i.exp),!a.kid||a.alg==="HS256"||!("crypto"in globalThis&&"subtle"in globalThis.crypto)){const{error:d}=await this.getUser(r);if(d)throw d;return{data:{claims:i,header:a,signature:s},error:null}}const u=_R(a.alg),c=await this.fetchJwk(a.kid,n),f=await crypto.subtle.importKey("jwk",c,u,!0,["verify"]);if(!await crypto.subtle.verify(u,f,s,uR(`${o}.${l}`)))throw new Hf("Invalid JWT signature");return{data:{claims:i,header:a,signature:s},error:null}}catch(r){if(Ct(r))return{data:null,error:r};throw r}}}dd.nextInstanceID=0;const BR=dd;class $R extends BR{constructor(t){super(t)}}var UR=function(e,t,n,r){function a(i){return i instanceof n?i:new n(function(s){s(i)})}return new(n||(n=Promise))(function(i,s){function o(c){try{u(r.next(c))}catch(f){s(f)}}function l(c){try{u(r.throw(c))}catch(f){s(f)}}function u(c){c.done?i(c.value):a(c.value).then(o,l)}u((r=r.apply(e,t||[])).next())})};class zR{constructor(t,n,r){var a,i,s;if(this.supabaseUrl=t,this.supabaseKey=n,!t)throw new Error("supabaseUrl is required.");if(!n)throw new Error("supabaseKey is required.");const o=GD(t);this.realtimeUrl=`${o}/realtime/v1`.replace(/^http/i,"ws"),this.authUrl=`${o}/auth/v1`,this.storageUrl=`${o}/storage/v1`,this.functionsUrl=`${o}/functions/v1`;const l=`sb-${new URL(this.authUrl).hostname.split(".")[0]}-auth-token`,u={db:BD,realtime:UD,auth:Object.assign(Object.assign({},$D),{storageKey:l}),global:FD},c=WD(r??{},u);this.storageKey=(a=c.auth.storageKey)!==null&&a!==void 0?a:"",this.headers=(i=c.global.headers)!==null&&i!==void 0?i:{},c.accessToken?(this.accessToken=c.accessToken,this.auth=new Proxy({},{get:(f,p)=>{throw new Error(`@supabase/supabase-js: Supabase Client is configured with the accessToken option, accessing supabase.auth.${String(p)} is not possible`)}})):this.auth=this._initSupabaseAuthClient((s=c.auth)!==null&&s!==void 0?s:{},this.headers,c.global.fetch),this.fetch=VD(n,this._getAccessToken.bind(this),c.global.fetch),this.realtime=this._initRealtimeClient(Object.assign({headers:this.headers,accessToken:this._getAccessToken.bind(this)},c.realtime)),this.rest=new sD(`${o}/rest/v1`,{headers:this.headers,schema:c.db.schema,fetch:this.fetch}),c.accessToken||this._listenForAuthEvents()}get functions(){return new PO(this.functionsUrl,{headers:this.headers,customFetch:this.fetch})}get storage(){return new kD(this.storageUrl,this.headers,this.fetch)}from(t){return this.rest.from(t)}schema(t){return this.rest.schema(t)}rpc(t,n={},r={}){return this.rest.rpc(t,n,r)}channel(t,n={config:{}}){return this.realtime.channel(t,n)}getChannels(){return this.realtime.getChannels()}removeChannel(t){return this.realtime.removeChannel(t)}removeAllChannels(){return this.realtime.removeAllChannels()}_getAccessToken(){var t,n;return UR(this,void 0,void 0,function*(){if(this.accessToken)return yield this.accessToken();const{data:r}=yield this.auth.getSession();return(n=(t=r.session)===null||t===void 0?void 0:t.access_token)!==null&&n!==void 0?n:null})}_initSupabaseAuthClient({autoRefreshToken:t,persistSession:n,detectSessionInUrl:r,storage:a,storageKey:i,flowType:s,lock:o,debug:l},u,c){const f={Authorization:`Bearer ${this.supabaseKey}`,apikey:`${this.supabaseKey}`};return new $R({url:this.authUrl,headers:Object.assign(Object.assign({},f),u),storageKey:i,autoRefreshToken:t,persistSession:n,detectSessionInUrl:r,storage:a,flowType:s,lock:o,debug:l,fetch:c,hasCustomAuthorizationHeader:"Authorization"in this.headers})}_initRealtimeClient(t){return new xD(this.realtimeUrl,Object.assign(Object.assign({},t),{params:Object.assign({apikey:this.supabaseKey},t==null?void 0:t.params)}))}_listenForAuthEvents(){return this.auth.onAuthStateChange((n,r)=>{this._handleTokenChanged(n,"CLIENT",r==null?void 0:r.access_token)})}_handleTokenChanged(t,n,r){(t==="TOKEN_REFRESHED"||t==="SIGNED_IN")&&this.changedAccessToken!==r?this.changedAccessToken=r:t==="SIGNED_OUT"&&(this.realtime.setAuth(),n=="STORAGE"&&this.auth.signOut(),this.changedAccessToken=void 0)}}const qR=(e,t,n)=>new zR(e,t,n),HR="https://yhbphdjhoxovcxfoimdx.supabase.co",VR="eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZSIsInJlZiI6InloYnBoZGpob3hvdmN4Zm9pbWR4Iiwicm9sZSI6ImFub24iLCJpYXQiOjE3Njc2NTkwMDUsImV4cCI6MjA4MzIzNTAwNX0.kf2JdL8_xep-8XFp8uRvOh4d6ZoBKRF8-uhtjncrxAM",Ke=qR(HR,VR),mt=e=>typeof e=="string",mf=()=>{let e,t;const n=new Promise((r,a)=>{e=r,t=a});return n.resolve=e,n.reject=t,n},zx=e=>e==null?"":""+e,YR=(e,t,n)=>{e.forEach(r=>{t[r]&&(n[r]=t[r])})},GR=/###/g,qx=e=>e&&e.indexOf("###")>-1?e.replace(GR,"."):e,Hx=e=>!e||mt(e),Yf=(e,t,n)=>{const r=mt(t)?t.split("."):t;let a=0;for(;a<r.length-1;){if(Hx(e))return{};const i=qx(r[a]);!e[i]&&n&&(e[i]=new n),Object.prototype.hasOwnProperty.call(e,i)?e=e[i]:e={},++a}return Hx(e)?{}:{obj:e,k:qx(r[a])}},Vx=(e,t,n)=>{const{obj:r,k:a}=Yf(e,t,Object);if(r!==void 0||t.length===1){r[a]=n;return}let i=t[t.length-1],s=t.slice(0,t.length-1),o=Yf(e,s,Object);for(;o.obj===void 0&&s.length;)i=`${s[s.length-1]}.${i}`,s=s.slice(0,s.length-1),o=Yf(e,s,Object),o!=null&&o.obj&&typeof o.obj[`${o.k}.${i}`]<"u"&&(o.obj=void 0);o.obj[`${o.k}.${i}`]=n},WR=(e,t,n,r)=>{const{obj:a,k:i}=Yf(e,t,Object);a[i]=a[i]||[],a[i].push(n)},Em=(e,t)=>{const{obj:n,k:r}=Yf(e,t);if(n&&Object.prototype.hasOwnProperty.call(n,r))return n[r]},JR=(e,t,n)=>{const r=Em(e,n);return r!==void 0?r:Em(t,n)},UA=(e,t,n)=>{for(const r in t)r!=="__proto__"&&r!=="constructor"&&(r in e?mt(e[r])||e[r]instanceof String||mt(t[r])||t[r]instanceof String?n&&(e[r]=t[r]):UA(e[r],t[r],n):e[r]=t[r]);return e},ou=e=>e.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&");var KR={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;","/":"&#x2F;"};const XR=e=>mt(e)?e.replace(/[&<>"'\/]/g,t=>KR[t]):e;class QR{constructor(t){this.capacity=t,this.regExpMap=new Map,this.regExpQueue=[]}getRegExp(t){const n=this.regExpMap.get(t);if(n!==void 0)return n;const r=new RegExp(t);return this.regExpQueue.length===this.capacity&&this.regExpMap.delete(this.regExpQueue.shift()),this.regExpMap.set(t,r),this.regExpQueue.push(t),r}}const ZR=[" ",",","?","!",";"],eM=new QR(20),tM=(e,t,n)=>{t=t||"",n=n||"";const r=ZR.filter(s=>t.indexOf(s)<0&&n.indexOf(s)<0);if(r.length===0)return!0;const a=eM.getRegExp(`(${r.map(s=>s==="?"?"\\?":s).join("|")})`);let i=!a.test(e);if(!i){const s=e.indexOf(n);s>0&&!a.test(e.substring(0,s))&&(i=!0)}return i},Sv=(e,t,n=".")=>{if(!e)return;if(e[t])return Object.prototype.hasOwnProperty.call(e,t)?e[t]:void 0;const r=t.split(n);let a=e;for(let i=0;i<r.length;){if(!a||typeof a!="object")return;let s,o="";for(let l=i;l<r.length;++l)if(l!==i&&(o+=n),o+=r[l],s=a[o],s!==void 0){if(["string","number","boolean"].indexOf(typeof s)>-1&&l<r.length-1)continue;i+=l-i+1;break}a=s}return a},hd=e=>e==null?void 0:e.replace("_","-"),nM={type:"logger",log(e){this.output("log",e)},warn(e){this.output("warn",e)},error(e){this.output("error",e)},output(e,t){var n,r;(r=(n=console==null?void 0:console[e])==null?void 0:n.apply)==null||r.call(n,console,t)}};class Cm{constructor(t,n={}){this.init(t,n)}init(t,n={}){this.prefix=n.prefix||"i18next:",this.logger=t||nM,this.options=n,this.debug=n.debug}log(...t){return this.forward(t,"log","",!0)}warn(...t){return this.forward(t,"warn","",!0)}error(...t){return this.forward(t,"error","")}deprecate(...t){return this.forward(t,"warn","WARNING DEPRECATED: ",!0)}forward(t,n,r,a){return a&&!this.debug?null:(mt(t[0])&&(t[0]=`${r}${this.prefix} ${t[0]}`),this.logger[n](t))}create(t){return new Cm(this.logger,{prefix:`${this.prefix}:${t}:`,...this.options})}clone(t){return t=t||this.options,t.prefix=t.prefix||this.prefix,new Cm(this.logger,t)}}var Pi=new Cm;class Lg{constructor(){this.observers={}}on(t,n){return t.split(" ").forEach(r=>{this.observers[r]||(this.observers[r]=new Map);const a=this.observers[r].get(n)||0;this.observers[r].set(n,a+1)}),this}off(t,n){if(this.observers[t]){if(!n){delete this.observers[t];return}this.observers[t].delete(n)}}emit(t,...n){this.observers[t]&&Array.from(this.observers[t].entries()).forEach(([a,i])=>{for(let s=0;s<i;s++)a(...n)}),this.observers["*"]&&Array.from(this.observers["*"].entries()).forEach(([a,i])=>{for(let s=0;s<i;s++)a.apply(a,[t,...n])})}}class Yx extends Lg{constructor(t,n={ns:["translation"],defaultNS:"translation"}){super(),this.data=t||{},this.options=n,this.options.keySeparator===void 0&&(this.options.keySeparator="."),this.options.ignoreJSONStructure===void 0&&(this.options.ignoreJSONStructure=!0)}addNamespaces(t){this.options.ns.indexOf(t)<0&&this.options.ns.push(t)}removeNamespaces(t){const n=this.options.ns.indexOf(t);n>-1&&this.options.ns.splice(n,1)}getResource(t,n,r,a={}){var u,c;const i=a.keySeparator!==void 0?a.keySeparator:this.options.keySeparator,s=a.ignoreJSONStructure!==void 0?a.ignoreJSONStructure:this.options.ignoreJSONStructure;let o;t.indexOf(".")>-1?o=t.split("."):(o=[t,n],r&&(Array.isArray(r)?o.push(...r):mt(r)&&i?o.push(...r.split(i)):o.push(r)));const l=Em(this.data,o);return!l&&!n&&!r&&t.indexOf(".")>-1&&(t=o[0],n=o[1],r=o.slice(2).join(".")),l||!s||!mt(r)?l:Sv((c=(u=this.data)==null?void 0:u[t])==null?void 0:c[n],r,i)}addResource(t,n,r,a,i={silent:!1}){const s=i.keySeparator!==void 0?i.keySeparator:this.options.keySeparator;let o=[t,n];r&&(o=o.concat(s?r.split(s):r)),t.indexOf(".")>-1&&(o=t.split("."),a=n,n=o[1]),this.addNamespaces(n),Vx(this.data,o,a),i.silent||this.emit("added",t,n,r,a)}addResources(t,n,r,a={silent:!1}){for(const i in r)(mt(r[i])||Array.isArray(r[i]))&&this.addResource(t,n,i,r[i],{silent:!0});a.silent||this.emit("added",t,n,r)}addResourceBundle(t,n,r,a,i,s={silent:!1,skipCopy:!1}){let o=[t,n];t.indexOf(".")>-1&&(o=t.split("."),a=r,r=n,n=o[1]),this.addNamespaces(n);let l=Em(this.data,o)||{};s.skipCopy||(r=JSON.parse(JSON.stringify(r))),a?UA(l,r,i):l={...l,...r},Vx(this.data,o,l),s.silent||this.emit("added",t,n,r)}removeResourceBundle(t,n){this.hasResourceBundle(t,n)&&delete this.data[t][n],this.removeNamespaces(n),this.emit("removed",t,n)}hasResourceBundle(t,n){return this.getResource(t,n)!==void 0}getResourceBundle(t,n){return n||(n=this.options.defaultNS),this.getResource(t,n)}getDataByLanguage(t){return this.data[t]}hasLanguageSomeTranslations(t){const n=this.getDataByLanguage(t);return!!(n&&Object.keys(n)||[]).find(a=>n[a]&&Object.keys(n[a]).length>0)}toJSON(){return this.data}}var zA={processors:{},addPostProcessor(e){this.processors[e.name]=e},handle(e,t,n,r,a){return e.forEach(i=>{var s;t=((s=this.processors[i])==null?void 0:s.process(t,n,r,a))??t}),t}};const Gx={},Wx=e=>!mt(e)&&typeof e!="boolean"&&typeof e!="number";class Lm extends Lg{constructor(t,n={}){super(),YR(["resourceStore","languageUtils","pluralResolver","interpolator","backendConnector","i18nFormat","utils"],t,this),this.options=n,this.options.keySeparator===void 0&&(this.options.keySeparator="."),this.logger=Pi.create("translator")}changeLanguage(t){t&&(this.language=t)}exists(t,n={interpolation:{}}){const r={...n};if(t==null)return!1;const a=this.resolve(t,r);return(a==null?void 0:a.res)!==void 0}extractFromKey(t,n){let r=n.nsSeparator!==void 0?n.nsSeparator:this.options.nsSeparator;r===void 0&&(r=":");const a=n.keySeparator!==void 0?n.keySeparator:this.options.keySeparator;let i=n.ns||this.options.defaultNS||[];const s=r&&t.indexOf(r)>-1,o=!this.options.userDefinedKeySeparator&&!n.keySeparator&&!this.options.userDefinedNsSeparator&&!n.nsSeparator&&!tM(t,r,a);if(s&&!o){const l=t.match(this.interpolator.nestingRegexp);if(l&&l.length>0)return{key:t,namespaces:mt(i)?[i]:i};const u=t.split(r);(r!==a||r===a&&this.options.ns.indexOf(u[0])>-1)&&(i=u.shift()),t=u.join(a)}return{key:t,namespaces:mt(i)?[i]:i}}translate(t,n,r){let a=typeof n=="object"?{...n}:n;if(typeof a!="object"&&this.options.overloadTranslationOptionHandler&&(a=this.options.overloadTranslationOptionHandler(arguments)),typeof options=="object"&&(a={...a}),a||(a={}),t==null)return"";Array.isArray(t)||(t=[String(t)]);const i=a.returnDetails!==void 0?a.returnDetails:this.options.returnDetails,s=a.keySeparator!==void 0?a.keySeparator:this.options.keySeparator,{key:o,namespaces:l}=this.extractFromKey(t[t.length-1],a),u=l[l.length-1];let c=a.nsSeparator!==void 0?a.nsSeparator:this.options.nsSeparator;c===void 0&&(c=":");const f=a.lng||this.language,p=a.appendNamespaceToCIMode||this.options.appendNamespaceToCIMode;if((f==null?void 0:f.toLowerCase())==="cimode")return p?i?{res:`${u}${c}${o}`,usedKey:o,exactUsedKey:o,usedLng:f,usedNS:u,usedParams:this.getUsedParamsDetails(a)}:`${u}${c}${o}`:i?{res:o,usedKey:o,exactUsedKey:o,usedLng:f,usedNS:u,usedParams:this.getUsedParamsDetails(a)}:o;const d=this.resolve(t,a);let v=d==null?void 0:d.res;const S=(d==null?void 0:d.usedKey)||o,x=(d==null?void 0:d.exactUsedKey)||o,g=["[object Number]","[object Function]","[object RegExp]"],y=a.joinArrays!==void 0?a.joinArrays:this.options.joinArrays,_=!this.i18nFormat||this.i18nFormat.handleAsObject,E=a.count!==void 0&&!mt(a.count),D=Lm.hasDefaultValue(a),R=E?this.pluralResolver.getSuffix(f,a.count,a):"",O=a.ordinal&&E?this.pluralResolver.getSuffix(f,a.count,{ordinal:!1}):"",j=E&&!a.ordinal&&a.count===0,$=j&&a[`defaultValue${this.options.pluralSeparator}zero`]||a[`defaultValue${R}`]||a[`defaultValue${O}`]||a.defaultValue;let V=v;_&&!v&&D&&(V=$);const T=Wx(V),P=Object.prototype.toString.apply(V);if(_&&V&&T&&g.indexOf(P)<0&&!(mt(y)&&Array.isArray(V))){if(!a.returnObjects&&!this.options.returnObjects){this.options.returnedObjectHandler||this.logger.warn("accessing an object - but returnObjects options is not enabled!");const q=this.options.returnedObjectHandler?this.options.returnedObjectHandler(S,V,{...a,ns:l}):`key '${o} (${this.language})' returned an object instead of string.`;return i?(d.res=q,d.usedParams=this.getUsedParamsDetails(a),d):q}if(s){const q=Array.isArray(V),Y=q?[]:{},se=q?x:S;for(const G in V)if(Object.prototype.hasOwnProperty.call(V,G)){const ne=`${se}${s}${G}`;D&&!v?Y[G]=this.translate(ne,{...a,defaultValue:Wx($)?$[G]:void 0,joinArrays:!1,ns:l}):Y[G]=this.translate(ne,{...a,joinArrays:!1,ns:l}),Y[G]===ne&&(Y[G]=V[G])}v=Y}}else if(_&&mt(y)&&Array.isArray(v))v=v.join(y),v&&(v=this.extendTranslation(v,t,a,r));else{let q=!1,Y=!1;!this.isValidLookup(v)&&D&&(q=!0,v=$),this.isValidLookup(v)||(Y=!0,v=o);const G=(a.missingKeyNoValueFallbackToKey||this.options.missingKeyNoValueFallbackToKey)&&Y?void 0:v,ne=D&&$!==v&&this.options.updateMissing;if(Y||q||ne){if(this.logger.log(ne?"updateKey":"missingKey",f,u,o,ne?$:v),s){const le=this.resolve(o,{...a,keySeparator:!1});le&&le.res&&this.logger.warn("Seems the loaded translations were in flat JSON format instead of nested. Either set keySeparator: false on init or make sure your translations are published in nested format.")}let Q=[];const ie=this.languageUtils.getFallbackCodes(this.options.fallbackLng,a.lng||this.language);if(this.options.saveMissingTo==="fallback"&&ie&&ie[0])for(let le=0;le<ie.length;le++)Q.push(ie[le]);else this.options.saveMissingTo==="all"?Q=this.languageUtils.toResolveHierarchy(a.lng||this.language):Q.push(a.lng||this.language);const J=(le,L,z)=>{var te;const W=D&&z!==v?z:G;this.options.missingKeyHandler?this.options.missingKeyHandler(le,u,L,W,ne,a):(te=this.backendConnector)!=null&&te.saveMissing&&this.backendConnector.saveMissing(le,u,L,W,ne,a),this.emit("missingKey",le,u,L,v)};this.options.saveMissing&&(this.options.saveMissingPlurals&&E?Q.forEach(le=>{const L=this.pluralResolver.getSuffixes(le,a);j&&a[`defaultValue${this.options.pluralSeparator}zero`]&&L.indexOf(`${this.options.pluralSeparator}zero`)<0&&L.push(`${this.options.pluralSeparator}zero`),L.forEach(z=>{J([le],o+z,a[`defaultValue${z}`]||$)})}):J(Q,o,$))}v=this.extendTranslation(v,t,a,d,r),Y&&v===o&&this.options.appendNamespaceToMissingKey&&(v=`${u}${c}${o}`),(Y||q)&&this.options.parseMissingKeyHandler&&(v=this.options.parseMissingKeyHandler(this.options.appendNamespaceToMissingKey?`${u}${c}${o}`:o,q?v:void 0,a))}return i?(d.res=v,d.usedParams=this.getUsedParamsDetails(a),d):v}extendTranslation(t,n,r,a,i){var l,u;if((l=this.i18nFormat)!=null&&l.parse)t=this.i18nFormat.parse(t,{...this.options.interpolation.defaultVariables,...r},r.lng||this.language||a.usedLng,a.usedNS,a.usedKey,{resolved:a});else if(!r.skipInterpolation){r.interpolation&&this.interpolator.init({...r,interpolation:{...this.options.interpolation,...r.interpolation}});const c=mt(t)&&(((u=r==null?void 0:r.interpolation)==null?void 0:u.skipOnVariables)!==void 0?r.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables);let f;if(c){const d=t.match(this.interpolator.nestingRegexp);f=d&&d.length}let p=r.replace&&!mt(r.replace)?r.replace:r;if(this.options.interpolation.defaultVariables&&(p={...this.options.interpolation.defaultVariables,...p}),t=this.interpolator.interpolate(t,p,r.lng||this.language||a.usedLng,r),c){const d=t.match(this.interpolator.nestingRegexp),v=d&&d.length;f<v&&(r.nest=!1)}!r.lng&&a&&a.res&&(r.lng=this.language||a.usedLng),r.nest!==!1&&(t=this.interpolator.nest(t,(...d)=>(i==null?void 0:i[0])===d[0]&&!r.context?(this.logger.warn(`It seems you are nesting recursively key: ${d[0]} in key: ${n[0]}`),null):this.translate(...d,n),r)),r.interpolation&&this.interpolator.reset()}const s=r.postProcess||this.options.postProcess,o=mt(s)?[s]:s;return t!=null&&(o!=null&&o.length)&&r.applyPostProcessor!==!1&&(t=zA.handle(o,t,n,this.options&&this.options.postProcessPassResolved?{i18nResolved:{...a,usedParams:this.getUsedParamsDetails(r)},...r}:r,this)),t}resolve(t,n={}){let r,a,i,s,o;return mt(t)&&(t=[t]),t.forEach(l=>{if(this.isValidLookup(r))return;const u=this.extractFromKey(l,n),c=u.key;a=c;let f=u.namespaces;this.options.fallbackNS&&(f=f.concat(this.options.fallbackNS));const p=n.count!==void 0&&!mt(n.count),d=p&&!n.ordinal&&n.count===0,v=n.context!==void 0&&(mt(n.context)||typeof n.context=="number")&&n.context!=="",S=n.lngs?n.lngs:this.languageUtils.toResolveHierarchy(n.lng||this.language,n.fallbackLng);f.forEach(x=>{var g,y;this.isValidLookup(r)||(o=x,!Gx[`${S[0]}-${x}`]&&((g=this.utils)!=null&&g.hasLoadedNamespace)&&!((y=this.utils)!=null&&y.hasLoadedNamespace(o))&&(Gx[`${S[0]}-${x}`]=!0,this.logger.warn(`key "${a}" for languages "${S.join(", ")}" won't get resolved as namespace "${o}" was not yet loaded`,"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!")),S.forEach(_=>{var R;if(this.isValidLookup(r))return;s=_;const E=[c];if((R=this.i18nFormat)!=null&&R.addLookupKeys)this.i18nFormat.addLookupKeys(E,c,_,x,n);else{let O;p&&(O=this.pluralResolver.getSuffix(_,n.count,n));const j=`${this.options.pluralSeparator}zero`,$=`${this.options.pluralSeparator}ordinal${this.options.pluralSeparator}`;if(p&&(E.push(c+O),n.ordinal&&O.indexOf($)===0&&E.push(c+O.replace($,this.options.pluralSeparator)),d&&E.push(c+j)),v){const V=`${c}${this.options.contextSeparator}${n.context}`;E.push(V),p&&(E.push(V+O),n.ordinal&&O.indexOf($)===0&&E.push(V+O.replace($,this.options.pluralSeparator)),d&&E.push(V+j))}}let D;for(;D=E.pop();)this.isValidLookup(r)||(i=D,r=this.getResource(_,x,D,n))}))})}),{res:r,usedKey:a,exactUsedKey:i,usedLng:s,usedNS:o}}isValidLookup(t){return t!==void 0&&!(!this.options.returnNull&&t===null)&&!(!this.options.returnEmptyString&&t==="")}getResource(t,n,r,a={}){var i;return(i=this.i18nFormat)!=null&&i.getResource?this.i18nFormat.getResource(t,n,r,a):this.resourceStore.getResource(t,n,r,a)}getUsedParamsDetails(t={}){const n=["defaultValue","ordinal","context","replace","lng","lngs","fallbackLng","ns","keySeparator","nsSeparator","returnObjects","returnDetails","joinArrays","postProcess","interpolation"],r=t.replace&&!mt(t.replace);let a=r?t.replace:t;if(r&&typeof t.count<"u"&&(a.count=t.count),this.options.interpolation.defaultVariables&&(a={...this.options.interpolation.defaultVariables,...a}),!r){a={...a};for(const i of n)delete a[i]}return a}static hasDefaultValue(t){const n="defaultValue";for(const r in t)if(Object.prototype.hasOwnProperty.call(t,r)&&n===r.substring(0,n.length)&&t[r]!==void 0)return!0;return!1}}class Jx{constructor(t){this.options=t,this.supportedLngs=this.options.supportedLngs||!1,this.logger=Pi.create("languageUtils")}getScriptPartFromCode(t){if(t=hd(t),!t||t.indexOf("-")<0)return null;const n=t.split("-");return n.length===2||(n.pop(),n[n.length-1].toLowerCase()==="x")?null:this.formatLanguageCode(n.join("-"))}getLanguagePartFromCode(t){if(t=hd(t),!t||t.indexOf("-")<0)return t;const n=t.split("-");return this.formatLanguageCode(n[0])}formatLanguageCode(t){if(mt(t)&&t.indexOf("-")>-1){let n;try{n=Intl.getCanonicalLocales(t)[0]}catch{}return n&&this.options.lowerCaseLng&&(n=n.toLowerCase()),n||(this.options.lowerCaseLng?t.toLowerCase():t)}return this.options.cleanCode||this.options.lowerCaseLng?t.toLowerCase():t}isSupportedCode(t){return(this.options.load==="languageOnly"||this.options.nonExplicitSupportedLngs)&&(t=this.getLanguagePartFromCode(t)),!this.supportedLngs||!this.supportedLngs.length||this.supportedLngs.indexOf(t)>-1}getBestMatchFromCodes(t){if(!t)return null;let n;return t.forEach(r=>{if(n)return;const a=this.formatLanguageCode(r);(!this.options.supportedLngs||this.isSupportedCode(a))&&(n=a)}),!n&&this.options.supportedLngs&&t.forEach(r=>{if(n)return;const a=this.getScriptPartFromCode(r);if(this.isSupportedCode(a))return n=a;const i=this.getLanguagePartFromCode(r);if(this.isSupportedCode(i))return n=i;n=this.options.supportedLngs.find(s=>{if(s===i)return s;if(!(s.indexOf("-")<0&&i.indexOf("-")<0)&&(s.indexOf("-")>0&&i.indexOf("-")<0&&s.substring(0,s.indexOf("-"))===i||s.indexOf(i)===0&&i.length>1))return s})}),n||(n=this.getFallbackCodes(this.options.fallbackLng)[0]),n}getFallbackCodes(t,n){if(!t)return[];if(typeof t=="function"&&(t=t(n)),mt(t)&&(t=[t]),Array.isArray(t))return t;if(!n)return t.default||[];let r=t[n];return r||(r=t[this.getScriptPartFromCode(n)]),r||(r=t[this.formatLanguageCode(n)]),r||(r=t[this.getLanguagePartFromCode(n)]),r||(r=t.default),r||[]}toResolveHierarchy(t,n){const r=this.getFallbackCodes((n===!1?[]:n)||this.options.fallbackLng||[],t),a=[],i=s=>{s&&(this.isSupportedCode(s)?a.push(s):this.logger.warn(`rejecting language code not found in supportedLngs: ${s}`))};return mt(t)&&(t.indexOf("-")>-1||t.indexOf("_")>-1)?(this.options.load!=="languageOnly"&&i(this.formatLanguageCode(t)),this.options.load!=="languageOnly"&&this.options.load!=="currentOnly"&&i(this.getScriptPartFromCode(t)),this.options.load!=="currentOnly"&&i(this.getLanguagePartFromCode(t))):mt(t)&&i(this.formatLanguageCode(t)),r.forEach(s=>{a.indexOf(s)<0&&i(this.formatLanguageCode(s))}),a}}const Kx={zero:0,one:1,two:2,few:3,many:4,other:5},Xx={select:e=>e===1?"one":"other",resolvedOptions:()=>({pluralCategories:["one","other"]})};class rM{constructor(t,n={}){this.languageUtils=t,this.options=n,this.logger=Pi.create("pluralResolver"),this.pluralRulesCache={}}addRule(t,n){this.rules[t]=n}clearCache(){this.pluralRulesCache={}}getRule(t,n={}){const r=hd(t==="dev"?"en":t),a=n.ordinal?"ordinal":"cardinal",i=JSON.stringify({cleanedCode:r,type:a});if(i in this.pluralRulesCache)return this.pluralRulesCache[i];let s;try{s=new Intl.PluralRules(r,{type:a})}catch{if(!Intl)return this.logger.error("No Intl support, please use an Intl polyfill!"),Xx;if(!t.match(/-|_/))return Xx;const l=this.languageUtils.getLanguagePartFromCode(t);s=this.getRule(l,n)}return this.pluralRulesCache[i]=s,s}needsPlural(t,n={}){let r=this.getRule(t,n);return r||(r=this.getRule("dev",n)),(r==null?void 0:r.resolvedOptions().pluralCategories.length)>1}getPluralFormsOfKey(t,n,r={}){return this.getSuffixes(t,r).map(a=>`${n}${a}`)}getSuffixes(t,n={}){let r=this.getRule(t,n);return r||(r=this.getRule("dev",n)),r?r.resolvedOptions().pluralCategories.sort((a,i)=>Kx[a]-Kx[i]).map(a=>`${this.options.prepend}${n.ordinal?`ordinal${this.options.prepend}`:""}${a}`):[]}getSuffix(t,n,r={}){const a=this.getRule(t,r);return a?`${this.options.prepend}${r.ordinal?`ordinal${this.options.prepend}`:""}${a.select(n)}`:(this.logger.warn(`no plural rule found for: ${t}`),this.getSuffix("dev",n,r))}}const Qx=(e,t,n,r=".",a=!0)=>{let i=JR(e,t,n);return!i&&a&&mt(n)&&(i=Sv(e,n,r),i===void 0&&(i=Sv(t,n,r))),i},P1=e=>e.replace(/\$/g,"$$$$");class aM{constructor(t={}){var n;this.logger=Pi.create("interpolator"),this.options=t,this.format=((n=t==null?void 0:t.interpolation)==null?void 0:n.format)||(r=>r),this.init(t)}init(t={}){t.interpolation||(t.interpolation={escapeValue:!0});const{escape:n,escapeValue:r,useRawValueToEscape:a,prefix:i,prefixEscaped:s,suffix:o,suffixEscaped:l,formatSeparator:u,unescapeSuffix:c,unescapePrefix:f,nestingPrefix:p,nestingPrefixEscaped:d,nestingSuffix:v,nestingSuffixEscaped:S,nestingOptionsSeparator:x,maxReplaces:g,alwaysFormat:y}=t.interpolation;this.escape=n!==void 0?n:XR,this.escapeValue=r!==void 0?r:!0,this.useRawValueToEscape=a!==void 0?a:!1,this.prefix=i?ou(i):s||"{{",this.suffix=o?ou(o):l||"}}",this.formatSeparator=u||",",this.unescapePrefix=c?"":f||"-",this.unescapeSuffix=this.unescapePrefix?"":c||"",this.nestingPrefix=p?ou(p):d||ou("$t("),this.nestingSuffix=v?ou(v):S||ou(")"),this.nestingOptionsSeparator=x||",",this.maxReplaces=g||1e3,this.alwaysFormat=y!==void 0?y:!1,this.resetRegExp()}reset(){this.options&&this.init(this.options)}resetRegExp(){const t=(n,r)=>(n==null?void 0:n.source)===r?(n.lastIndex=0,n):new RegExp(r,"g");this.regexp=t(this.regexp,`${this.prefix}(.+?)${this.suffix}`),this.regexpUnescape=t(this.regexpUnescape,`${this.prefix}${this.unescapePrefix}(.+?)${this.unescapeSuffix}${this.suffix}`),this.nestingRegexp=t(this.nestingRegexp,`${this.nestingPrefix}(.+?)${this.nestingSuffix}`)}interpolate(t,n,r,a){var d;let i,s,o;const l=this.options&&this.options.interpolation&&this.options.interpolation.defaultVariables||{},u=v=>{if(v.indexOf(this.formatSeparator)<0){const y=Qx(n,l,v,this.options.keySeparator,this.options.ignoreJSONStructure);return this.alwaysFormat?this.format(y,void 0,r,{...a,...n,interpolationkey:v}):y}const S=v.split(this.formatSeparator),x=S.shift().trim(),g=S.join(this.formatSeparator).trim();return this.format(Qx(n,l,x,this.options.keySeparator,this.options.ignoreJSONStructure),g,r,{...a,...n,interpolationkey:x})};this.resetRegExp();const c=(a==null?void 0:a.missingInterpolationHandler)||this.options.missingInterpolationHandler,f=((d=a==null?void 0:a.interpolation)==null?void 0:d.skipOnVariables)!==void 0?a.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables;return[{regex:this.regexpUnescape,safeValue:v=>P1(v)},{regex:this.regexp,safeValue:v=>this.escapeValue?P1(this.escape(v)):P1(v)}].forEach(v=>{for(o=0;i=v.regex.exec(t);){const S=i[1].trim();if(s=u(S),s===void 0)if(typeof c=="function"){const g=c(t,i,a);s=mt(g)?g:""}else if(a&&Object.prototype.hasOwnProperty.call(a,S))s="";else if(f){s=i[0];continue}else this.logger.warn(`missed to pass in variable ${S} for interpolating ${t}`),s="";else!mt(s)&&!this.useRawValueToEscape&&(s=zx(s));const x=v.safeValue(s);if(t=t.replace(i[0],x),f?(v.regex.lastIndex+=s.length,v.regex.lastIndex-=i[0].length):v.regex.lastIndex=0,o++,o>=this.maxReplaces)break}}),t}nest(t,n,r={}){let a,i,s;const o=(l,u)=>{const c=this.nestingOptionsSeparator;if(l.indexOf(c)<0)return l;const f=l.split(new RegExp(`${c}[ ]*{`));let p=`{${f[1]}`;l=f[0],p=this.interpolate(p,s);const d=p.match(/'/g),v=p.match(/"/g);(((d==null?void 0:d.length)??0)%2===0&&!v||v.length%2!==0)&&(p=p.replace(/'/g,'"'));try{s=JSON.parse(p),u&&(s={...u,...s})}catch(S){return this.logger.warn(`failed parsing options string in nesting for key ${l}`,S),`${l}${c}${p}`}return s.defaultValue&&s.defaultValue.indexOf(this.prefix)>-1&&delete s.defaultValue,l};for(;a=this.nestingRegexp.exec(t);){let l=[];s={...r},s=s.replace&&!mt(s.replace)?s.replace:s,s.applyPostProcessor=!1,delete s.defaultValue;const u=/{.*}/.test(a[1])?a[1].lastIndexOf("}")+1:a[1].indexOf(this.formatSeparator);if(u!==-1&&(l=a[1].slice(u).split(this.formatSeparator).map(c=>c.trim()).filter(Boolean),a[1]=a[1].slice(0,u)),i=n(o.call(this,a[1].trim(),s),s),i&&a[0]===t&&!mt(i))return i;mt(i)||(i=zx(i)),i||(this.logger.warn(`missed to resolve ${a[1]} for nesting ${t}`),i=""),l.length&&(i=l.reduce((c,f)=>this.format(c,f,r.lng,{...r,interpolationkey:a[1].trim()}),i.trim())),t=t.replace(a[0],i),this.regexp.lastIndex=0}return t}}const iM=e=>{let t=e.toLowerCase().trim();const n={};if(e.indexOf("(")>-1){const r=e.split("(");t=r[0].toLowerCase().trim();const a=r[1].substring(0,r[1].length-1);t==="currency"&&a.indexOf(":")<0?n.currency||(n.currency=a.trim()):t==="relativetime"&&a.indexOf(":")<0?n.range||(n.range=a.trim()):a.split(";").forEach(s=>{if(s){const[o,...l]=s.split(":"),u=l.join(":").trim().replace(/^'+|'+$/g,""),c=o.trim();n[c]||(n[c]=u),u==="false"&&(n[c]=!1),u==="true"&&(n[c]=!0),isNaN(u)||(n[c]=parseInt(u,10))}})}return{formatName:t,formatOptions:n}},Zx=e=>{const t={};return(n,r,a)=>{let i=a;a&&a.interpolationkey&&a.formatParams&&a.formatParams[a.interpolationkey]&&a[a.interpolationkey]&&(i={...i,[a.interpolationkey]:void 0});const s=r+JSON.stringify(i);let o=t[s];return o||(o=e(hd(r),a),t[s]=o),o(n)}},sM=e=>(t,n,r)=>e(hd(n),r)(t);class oM{constructor(t={}){this.logger=Pi.create("formatter"),this.options=t,this.init(t)}init(t,n={interpolation:{}}){this.formatSeparator=n.interpolation.formatSeparator||",";const r=n.cacheInBuiltFormats?Zx:sM;this.formats={number:r((a,i)=>{const s=new Intl.NumberFormat(a,{...i});return o=>s.format(o)}),currency:r((a,i)=>{const s=new Intl.NumberFormat(a,{...i,style:"currency"});return o=>s.format(o)}),datetime:r((a,i)=>{const s=new Intl.DateTimeFormat(a,{...i});return o=>s.format(o)}),relativetime:r((a,i)=>{const s=new Intl.RelativeTimeFormat(a,{...i});return o=>s.format(o,i.range||"day")}),list:r((a,i)=>{const s=new Intl.ListFormat(a,{...i});return o=>s.format(o)})}}add(t,n){this.formats[t.toLowerCase().trim()]=n}addCached(t,n){this.formats[t.toLowerCase().trim()]=Zx(n)}format(t,n,r,a={}){const i=n.split(this.formatSeparator);if(i.length>1&&i[0].indexOf("(")>1&&i[0].indexOf(")")<0&&i.find(o=>o.indexOf(")")>-1)){const o=i.findIndex(l=>l.indexOf(")")>-1);i[0]=[i[0],...i.splice(1,o)].join(this.formatSeparator)}return i.reduce((o,l)=>{var f;const{formatName:u,formatOptions:c}=iM(l);if(this.formats[u]){let p=o;try{const d=((f=a==null?void 0:a.formatParams)==null?void 0:f[a.interpolationkey])||{},v=d.locale||d.lng||a.locale||a.lng||r;p=this.formats[u](o,v,{...c,...a,...d})}catch(d){this.logger.warn(d)}return p}else this.logger.warn(`there was no format function for ${u}`);return o},t)}}const lM=(e,t)=>{e.pending[t]!==void 0&&(delete e.pending[t],e.pendingCount--)};class uM extends Lg{constructor(t,n,r,a={}){var i,s;super(),this.backend=t,this.store=n,this.services=r,this.languageUtils=r.languageUtils,this.options=a,this.logger=Pi.create("backendConnector"),this.waitingReads=[],this.maxParallelReads=a.maxParallelReads||10,this.readingCalls=0,this.maxRetries=a.maxRetries>=0?a.maxRetries:5,this.retryTimeout=a.retryTimeout>=1?a.retryTimeout:350,this.state={},this.queue=[],(s=(i=this.backend)==null?void 0:i.init)==null||s.call(i,r,a.backend,a)}queueLoad(t,n,r,a){const i={},s={},o={},l={};return t.forEach(u=>{let c=!0;n.forEach(f=>{const p=`${u}|${f}`;!r.reload&&this.store.hasResourceBundle(u,f)?this.state[p]=2:this.state[p]<0||(this.state[p]===1?s[p]===void 0&&(s[p]=!0):(this.state[p]=1,c=!1,s[p]===void 0&&(s[p]=!0),i[p]===void 0&&(i[p]=!0),l[f]===void 0&&(l[f]=!0)))}),c||(o[u]=!0)}),(Object.keys(i).length||Object.keys(s).length)&&this.queue.push({pending:s,pendingCount:Object.keys(s).length,loaded:{},errors:[],callback:a}),{toLoad:Object.keys(i),pending:Object.keys(s),toLoadLanguages:Object.keys(o),toLoadNamespaces:Object.keys(l)}}loaded(t,n,r){const a=t.split("|"),i=a[0],s=a[1];n&&this.emit("failedLoading",i,s,n),!n&&r&&this.store.addResourceBundle(i,s,r,void 0,void 0,{skipCopy:!0}),this.state[t]=n?-1:2,n&&r&&(this.state[t]=0);const o={};this.queue.forEach(l=>{WR(l.loaded,[i],s),lM(l,t),n&&l.errors.push(n),l.pendingCount===0&&!l.done&&(Object.keys(l.loaded).forEach(u=>{o[u]||(o[u]={});const c=l.loaded[u];c.length&&c.forEach(f=>{o[u][f]===void 0&&(o[u][f]=!0)})}),l.done=!0,l.errors.length?l.callback(l.errors):l.callback())}),this.emit("loaded",o),this.queue=this.queue.filter(l=>!l.done)}read(t,n,r,a=0,i=this.retryTimeout,s){if(!t.length)return s(null,{});if(this.readingCalls>=this.maxParallelReads){this.waitingReads.push({lng:t,ns:n,fcName:r,tried:a,wait:i,callback:s});return}this.readingCalls++;const o=(u,c)=>{if(this.readingCalls--,this.waitingReads.length>0){const f=this.waitingReads.shift();this.read(f.lng,f.ns,f.fcName,f.tried,f.wait,f.callback)}if(u&&c&&a<this.maxRetries){setTimeout(()=>{this.read.call(this,t,n,r,a+1,i*2,s)},i);return}s(u,c)},l=this.backend[r].bind(this.backend);if(l.length===2){try{const u=l(t,n);u&&typeof u.then=="function"?u.then(c=>o(null,c)).catch(o):o(null,u)}catch(u){o(u)}return}return l(t,n,o)}prepareLoading(t,n,r={},a){if(!this.backend)return this.logger.warn("No backend was added via i18next.use. Will not load resources."),a&&a();mt(t)&&(t=this.languageUtils.toResolveHierarchy(t)),mt(n)&&(n=[n]);const i=this.queueLoad(t,n,r,a);if(!i.toLoad.length)return i.pending.length||a(),null;i.toLoad.forEach(s=>{this.loadOne(s)})}load(t,n,r){this.prepareLoading(t,n,{},r)}reload(t,n,r){this.prepareLoading(t,n,{reload:!0},r)}loadOne(t,n=""){const r=t.split("|"),a=r[0],i=r[1];this.read(a,i,"read",void 0,void 0,(s,o)=>{s&&this.logger.warn(`${n}loading namespace ${i} for language ${a} failed`,s),!s&&o&&this.logger.log(`${n}loaded namespace ${i} for language ${a}`,o),this.loaded(t,s,o)})}saveMissing(t,n,r,a,i,s={},o=()=>{}){var l,u,c,f,p;if((u=(l=this.services)==null?void 0:l.utils)!=null&&u.hasLoadedNamespace&&!((f=(c=this.services)==null?void 0:c.utils)!=null&&f.hasLoadedNamespace(n))){this.logger.warn(`did not save key "${r}" as the namespace "${n}" was not yet loaded`,"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!");return}if(!(r==null||r==="")){if((p=this.backend)!=null&&p.create){const d={...s,isUpdate:i},v=this.backend.create.bind(this.backend);if(v.length<6)try{let S;v.length===5?S=v(t,n,r,a,d):S=v(t,n,r,a),S&&typeof S.then=="function"?S.then(x=>o(null,x)).catch(o):o(null,S)}catch(S){o(S)}else v(t,n,r,a,o,d)}!t||!t[0]||this.store.addResource(t[0],n,r,a)}}}const e4=()=>({debug:!1,initAsync:!0,ns:["translation"],defaultNS:["translation"],fallbackLng:["dev"],fallbackNS:!1,supportedLngs:!1,nonExplicitSupportedLngs:!1,load:"all",preload:!1,simplifyPluralSuffix:!0,keySeparator:".",nsSeparator:":",pluralSeparator:"_",contextSeparator:"_",partialBundledLanguages:!1,saveMissing:!1,updateMissing:!1,saveMissingTo:"fallback",saveMissingPlurals:!0,missingKeyHandler:!1,missingInterpolationHandler:!1,postProcess:!1,postProcessPassResolved:!1,returnNull:!1,returnEmptyString:!0,returnObjects:!1,joinArrays:!1,returnedObjectHandler:!1,parseMissingKeyHandler:!1,appendNamespaceToMissingKey:!1,appendNamespaceToCIMode:!1,overloadTranslationOptionHandler:e=>{let t={};if(typeof e[1]=="object"&&(t=e[1]),mt(e[1])&&(t.defaultValue=e[1]),mt(e[2])&&(t.tDescription=e[2]),typeof e[2]=="object"||typeof e[3]=="object"){const n=e[3]||e[2];Object.keys(n).forEach(r=>{t[r]=n[r]})}return t},interpolation:{escapeValue:!0,format:e=>e,prefix:"{{",suffix:"}}",formatSeparator:",",unescapePrefix:"-",nestingPrefix:"$t(",nestingSuffix:")",nestingOptionsSeparator:",",maxReplaces:1e3,skipOnVariables:!0},cacheInBuiltFormats:!0}),t4=e=>{var t,n;return mt(e.ns)&&(e.ns=[e.ns]),mt(e.fallbackLng)&&(e.fallbackLng=[e.fallbackLng]),mt(e.fallbackNS)&&(e.fallbackNS=[e.fallbackNS]),((n=(t=e.supportedLngs)==null?void 0:t.indexOf)==null?void 0:n.call(t,"cimode"))<0&&(e.supportedLngs=e.supportedLngs.concat(["cimode"])),typeof e.initImmediate=="boolean"&&(e.initAsync=e.initImmediate),e},ap=()=>{},cM=e=>{Object.getOwnPropertyNames(Object.getPrototypeOf(e)).forEach(n=>{typeof e[n]=="function"&&(e[n]=e[n].bind(e))})};class pd extends Lg{constructor(t={},n){if(super(),this.options=t4(t),this.services={},this.logger=Pi,this.modules={external:[]},cM(this),n&&!this.isInitialized&&!t.isClone){if(!this.options.initAsync)return this.init(t,n),this;setTimeout(()=>{this.init(t,n)},0)}}init(t={},n){this.isInitializing=!0,typeof t=="function"&&(n=t,t={}),t.defaultNS==null&&t.ns&&(mt(t.ns)?t.defaultNS=t.ns:t.ns.indexOf("translation")<0&&(t.defaultNS=t.ns[0]));const r=e4();this.options={...r,...this.options,...t4(t)},this.options.interpolation={...r.interpolation,...this.options.interpolation},t.keySeparator!==void 0&&(this.options.userDefinedKeySeparator=t.keySeparator),t.nsSeparator!==void 0&&(this.options.userDefinedNsSeparator=t.nsSeparator);const a=u=>u?typeof u=="function"?new u:u:null;if(!this.options.isClone){this.modules.logger?Pi.init(a(this.modules.logger),this.options):Pi.init(null,this.options);let u;this.modules.formatter?u=this.modules.formatter:u=oM;const c=new Jx(this.options);this.store=new Yx(this.options.resources,this.options);const f=this.services;f.logger=Pi,f.resourceStore=this.store,f.languageUtils=c,f.pluralResolver=new rM(c,{prepend:this.options.pluralSeparator,simplifyPluralSuffix:this.options.simplifyPluralSuffix}),u&&(!this.options.interpolation.format||this.options.interpolation.format===r.interpolation.format)&&(f.formatter=a(u),f.formatter.init(f,this.options),this.options.interpolation.format=f.formatter.format.bind(f.formatter)),f.interpolator=new aM(this.options),f.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},f.backendConnector=new uM(a(this.modules.backend),f.resourceStore,f,this.options),f.backendConnector.on("*",(p,...d)=>{this.emit(p,...d)}),this.modules.languageDetector&&(f.languageDetector=a(this.modules.languageDetector),f.languageDetector.init&&f.languageDetector.init(f,this.options.detection,this.options)),this.modules.i18nFormat&&(f.i18nFormat=a(this.modules.i18nFormat),f.i18nFormat.init&&f.i18nFormat.init(this)),this.translator=new Lm(this.services,this.options),this.translator.on("*",(p,...d)=>{this.emit(p,...d)}),this.modules.external.forEach(p=>{p.init&&p.init(this)})}if(this.format=this.options.interpolation.format,n||(n=ap),this.options.fallbackLng&&!this.services.languageDetector&&!this.options.lng){const u=this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);u.length>0&&u[0]!=="dev"&&(this.options.lng=u[0])}!this.services.languageDetector&&!this.options.lng&&this.logger.warn("init: no languageDetector is used and no lng is defined"),["getResource","hasResourceBundle","getResourceBundle","getDataByLanguage"].forEach(u=>{this[u]=(...c)=>this.store[u](...c)}),["addResource","addResources","addResourceBundle","removeResourceBundle"].forEach(u=>{this[u]=(...c)=>(this.store[u](...c),this)});const o=mf(),l=()=>{const u=(c,f)=>{this.isInitializing=!1,this.isInitialized&&!this.initializedStoreOnce&&this.logger.warn("init: i18next is already initialized. You should call init just once!"),this.isInitialized=!0,this.options.isClone||this.logger.log("initialized",this.options),this.emit("initialized",this.options),o.resolve(f),n(c,f)};if(this.languages&&!this.isInitialized)return u(null,this.t.bind(this));this.changeLanguage(this.options.lng,u)};return this.options.resources||!this.options.initAsync?l():setTimeout(l,0),o}loadResources(t,n=ap){var i,s;let r=n;const a=mt(t)?t:this.language;if(typeof t=="function"&&(r=t),!this.options.resources||this.options.partialBundledLanguages){if((a==null?void 0:a.toLowerCase())==="cimode"&&(!this.options.preload||this.options.preload.length===0))return r();const o=[],l=u=>{if(!u||u==="cimode")return;this.services.languageUtils.toResolveHierarchy(u).forEach(f=>{f!=="cimode"&&o.indexOf(f)<0&&o.push(f)})};a?l(a):this.services.languageUtils.getFallbackCodes(this.options.fallbackLng).forEach(c=>l(c)),(s=(i=this.options.preload)==null?void 0:i.forEach)==null||s.call(i,u=>l(u)),this.services.backendConnector.load(o,this.options.ns,u=>{!u&&!this.resolvedLanguage&&this.language&&this.setResolvedLanguage(this.language),r(u)})}else r(null)}reloadResources(t,n,r){const a=mf();return typeof t=="function"&&(r=t,t=void 0),typeof n=="function"&&(r=n,n=void 0),t||(t=this.languages),n||(n=this.options.ns),r||(r=ap),this.services.backendConnector.reload(t,n,i=>{a.resolve(),r(i)}),a}use(t){if(!t)throw new Error("You are passing an undefined module! Please check the object you are passing to i18next.use()");if(!t.type)throw new Error("You are passing a wrong module! Please check the object you are passing to i18next.use()");return t.type==="backend"&&(this.modules.backend=t),(t.type==="logger"||t.log&&t.warn&&t.error)&&(this.modules.logger=t),t.type==="languageDetector"&&(this.modules.languageDetector=t),t.type==="i18nFormat"&&(this.modules.i18nFormat=t),t.type==="postProcessor"&&zA.addPostProcessor(t),t.type==="formatter"&&(this.modules.formatter=t),t.type==="3rdParty"&&this.modules.external.push(t),this}setResolvedLanguage(t){if(!(!t||!this.languages)&&!(["cimode","dev"].indexOf(t)>-1)){for(let n=0;n<this.languages.length;n++){const r=this.languages[n];if(!(["cimode","dev"].indexOf(r)>-1)&&this.store.hasLanguageSomeTranslations(r)){this.resolvedLanguage=r;break}}!this.resolvedLanguage&&this.languages.indexOf(t)<0&&this.store.hasLanguageSomeTranslations(t)&&(this.resolvedLanguage=t,this.languages.unshift(t))}}changeLanguage(t,n){this.isLanguageChangingTo=t;const r=mf();this.emit("languageChanging",t);const a=o=>{this.language=o,this.languages=this.services.languageUtils.toResolveHierarchy(o),this.resolvedLanguage=void 0,this.setResolvedLanguage(o)},i=(o,l)=>{l?this.isLanguageChangingTo===t&&(a(l),this.translator.changeLanguage(l),this.isLanguageChangingTo=void 0,this.emit("languageChanged",l),this.logger.log("languageChanged",l)):this.isLanguageChangingTo=void 0,r.resolve((...u)=>this.t(...u)),n&&n(o,(...u)=>this.t(...u))},s=o=>{var c,f;!t&&!o&&this.services.languageDetector&&(o=[]);const l=mt(o)?o:o&&o[0],u=this.store.hasLanguageSomeTranslations(l)?l:this.services.languageUtils.getBestMatchFromCodes(mt(o)?[o]:o);u&&(this.language||a(u),this.translator.language||this.translator.changeLanguage(u),(f=(c=this.services.languageDetector)==null?void 0:c.cacheUserLanguage)==null||f.call(c,u)),this.loadResources(u,p=>{i(p,u)})};return!t&&this.services.languageDetector&&!this.services.languageDetector.async?s(this.services.languageDetector.detect()):!t&&this.services.languageDetector&&this.services.languageDetector.async?this.services.languageDetector.detect.length===0?this.services.languageDetector.detect().then(s):this.services.languageDetector.detect(s):s(t),r}getFixedT(t,n,r){const a=(i,s,...o)=>{let l;typeof s!="object"?l=this.options.overloadTranslationOptionHandler([i,s].concat(o)):l={...s},l.lng=l.lng||a.lng,l.lngs=l.lngs||a.lngs,l.ns=l.ns||a.ns,l.keyPrefix!==""&&(l.keyPrefix=l.keyPrefix||r||a.keyPrefix);const u=this.options.keySeparator||".";let c;return l.keyPrefix&&Array.isArray(i)?c=i.map(f=>`${l.keyPrefix}${u}${f}`):c=l.keyPrefix?`${l.keyPrefix}${u}${i}`:i,this.t(c,l)};return mt(t)?a.lng=t:a.lngs=t,a.ns=n,a.keyPrefix=r,a}t(...t){var n;return(n=this.translator)==null?void 0:n.translate(...t)}exists(...t){var n;return(n=this.translator)==null?void 0:n.exists(...t)}setDefaultNamespace(t){this.options.defaultNS=t}hasLoadedNamespace(t,n={}){if(!this.isInitialized)return this.logger.warn("hasLoadedNamespace: i18next was not initialized",this.languages),!1;if(!this.languages||!this.languages.length)return this.logger.warn("hasLoadedNamespace: i18n.languages were undefined or empty",this.languages),!1;const r=n.lng||this.resolvedLanguage||this.languages[0],a=this.options?this.options.fallbackLng:!1,i=this.languages[this.languages.length-1];if(r.toLowerCase()==="cimode")return!0;const s=(o,l)=>{const u=this.services.backendConnector.state[`${o}|${l}`];return u===-1||u===0||u===2};if(n.precheck){const o=n.precheck(this,s);if(o!==void 0)return o}return!!(this.hasResourceBundle(r,t)||!this.services.backendConnector.backend||this.options.resources&&!this.options.partialBundledLanguages||s(r,t)&&(!a||s(i,t)))}loadNamespaces(t,n){const r=mf();return this.options.ns?(mt(t)&&(t=[t]),t.forEach(a=>{this.options.ns.indexOf(a)<0&&this.options.ns.push(a)}),this.loadResources(a=>{r.resolve(),n&&n(a)}),r):(n&&n(),Promise.resolve())}loadLanguages(t,n){const r=mf();mt(t)&&(t=[t]);const a=this.options.preload||[],i=t.filter(s=>a.indexOf(s)<0&&this.services.languageUtils.isSupportedCode(s));return i.length?(this.options.preload=a.concat(i),this.loadResources(s=>{r.resolve(),n&&n(s)}),r):(n&&n(),Promise.resolve())}dir(t){var a,i;if(t||(t=this.resolvedLanguage||(((a=this.languages)==null?void 0:a.length)>0?this.languages[0]:this.language)),!t)return"rtl";if(Intl.Locale){const s=new Intl.Locale(t);if(s&&s.getTextInfo){const o=s.getTextInfo();if(o&&o.direction)return o.direction}}const n=["ar","shu","sqr","ssh","xaa","yhd","yud","aao","abh","abv","acm","acq","acw","acx","acy","adf","ads","aeb","aec","afb","ajp","apc","apd","arb","arq","ars","ary","arz","auz","avl","ayh","ayl","ayn","ayp","bbz","pga","he","iw","ps","pbt","pbu","pst","prp","prd","ug","ur","ydd","yds","yih","ji","yi","hbo","men","xmn","fa","jpr","peo","pes","prs","dv","sam","ckb"],r=((i=this.services)==null?void 0:i.languageUtils)||new Jx(e4());return t.toLowerCase().indexOf("-latn")>1?"ltr":n.indexOf(r.getLanguagePartFromCode(t))>-1||t.toLowerCase().indexOf("-arab")>1?"rtl":"ltr"}static createInstance(t={},n){return new pd(t,n)}cloneInstance(t={},n=ap){const r=t.forkResourceStore;r&&delete t.forkResourceStore;const a={...this.options,...t,isClone:!0},i=new pd(a);if((t.debug!==void 0||t.prefix!==void 0)&&(i.logger=i.logger.clone(t)),["store","services","language"].forEach(o=>{i[o]=this[o]}),i.services={...this.services},i.services.utils={hasLoadedNamespace:i.hasLoadedNamespace.bind(i)},r){const o=Object.keys(this.store.data).reduce((l,u)=>(l[u]={...this.store.data[u]},l[u]=Object.keys(l[u]).reduce((c,f)=>(c[f]={...l[u][f]},c),l[u]),l),{});i.store=new Yx(o,a),i.services.resourceStore=i.store}return i.translator=new Lm(i.services,a),i.translator.on("*",(o,...l)=>{i.emit(o,...l)}),i.init(a,n),i.translator.options=a,i.translator.backendConnector.services.utils={hasLoadedNamespace:i.hasLoadedNamespace.bind(i)},i}toJSON(){return{options:this.options,store:this.store,language:this.language,languages:this.languages,resolvedLanguage:this.resolvedLanguage}}}const Cr=pd.createInstance();Cr.createInstance=pd.createInstance;Cr.createInstance;Cr.dir;Cr.init;Cr.loadResources;Cr.reloadResources;Cr.use;Cr.changeLanguage;Cr.getFixedT;Cr.t;Cr.exists;Cr.setDefaultNamespace;Cr.hasLoadedNamespace;Cr.loadNamespaces;Cr.loadLanguages;const fM="Prayer",dM="Salah",hM="Adhan",pM="Jamaat",mM="Iqamah",gM="Tomorrow",vM="Tmrw",yM="Sunrise",bM="Fajr",wM="Dhuhr",xM="Asr",SM="Maghrib",_M="Isha",AM="Jumuah",NM="Eid",EM="In",CM="Select",LM="Language",jM="English",TM="Norwegian",OM="Arabic",DM="Method",RM="North",MM="South",kM="Settings",PM="Daily",IM="Weekly",FM="Monthly",BM="Custom",$M="From",UM="To",zM="Cancel",qM="Contact",HM="Sun",VM="Mon",YM="Tue",GM="Wed",WM="Thu",JM="Fri",KM="Sat",XM="Today",QM="Date",ZM="January",ek="February",tk="March",nk="April",rk="May",ak="June",ik="July",sk="August",ok="September",lk="October",uk="November",ck="December",fk={PRAYER:fM,SALAH:dM,ADHAN:hM,JAMAAT:pM,IQAMAH:mM,TOMORROW:gM,TMRW:vM,SUNRISE:yM,FAJR:bM,DHUHR:wM,ASR:xM,MAGHRIB:SM,ISHA:_M,"FAJR END TIME":"Fajr End Time","FAJR END":"Fajr End",JUMUAH:AM,EID:NM,IN:EM,"SELECT MASJID":"Select Masjid",SELECT:CM,LANGUAGE:LM,ENGLISH:jM,NORWEGIAN:TM,ARABIC:OM,"ASR METHOD":"Asr Method","PRAYER METHOD":"Prayer Method","IRN DEFAULT":"IRN default",METHOD:DM,"1X METHOD":"1x method","2X METHOD":"2x method","50% METHOD":"50% method",NORTH:RM,SOUTH:MM,"EVENTS & CALENDAR":"Events & Calendar","SEE ALL":"See All","LOOK OUT FOR IMPORTANT DATES AND EVENTS":"Look Out for Important Dates and Events","CREATE YOUR PRAYER TIMETABLE":"Create Your Prayer Timetable","VIEW AND DOWNLOAD YOUR CUSTOM PRAYER TIMETABLE":"View and Download Your Custom Prayer Timetable","VIEW FULL CALENDAR":"View Full Calendar","HIJRI CALENDAR":"Hijri Calendar",SETTINGS:kM,DAILY:PM,WEEKLY:IM,MONTHLY:FM,CUSTOM:BM,FROM:$M,TO:UM,"PRAYER TIMETABLE":"Prayer Timetable","DOWNLOAD TIMETABLE":"Download Timetable","DOWNLOAD (CSV/PDF)":"Download (Csv/Pdf)","SAVE AS CSV":"Save as Csv","SAVE AS PDF":"Save as Pdf",CANCEL:zM,CONTACT:qM,SUN:HM,MON:VM,TUE:YM,WED:GM,THU:WM,FRI:JM,SAT:KM,TODAY:XM,DATE:QM,JANUARY:ZM,FEBRUARY:ek,MARCH:tk,APRIL:nk,MAY:rk,JUNE:ak,JULY:ik,AUGUST:sk,SEPTEMBER:ok,OCTOBER:lk,NOVEMBER:uk,DECEMBER:ck},dk="Bønn",hk="Salah",pk="Adhan",mk="Jamaat",gk="Iqamah",vk="I Morgen",yk="I Mrgn",bk="Soloppgang",wk="Fajr",xk="Dhuhr",Sk="Asr",_k="Maghrib",Ak="Isha",Nk="Jummah",Ek="Eid",Ck="i",Lk="Velg",jk="Språk",Tk="Engelsk",Ok="Norsk",Dk="Arabisk",Rk="metode",Mk="Nord",kk="Sør",Pk="Innstillinger",Ik="Daglig",Fk="Ukentlig",Bk="Månedlig",$k="Tilpasset",Uk="Fra",zk="Til",qk="Avbryt",Hk="Kontakt",Vk="Søn",Yk="Man",Gk="Tir",Wk="Ons",Jk="Tor",Kk="Fre",Xk="Lør",Qk="I Dag",Zk="Dato",e9="Januar",t9="Februar",n9="Mars",r9="April",a9="Mai",i9="Juni",s9="Juli",o9="August",l9="September",u9="Oktober",c9="November",f9="Desember",d9={PRAYER:dk,SALAH:hk,ADHAN:pk,JAMAAT:mk,IQAMAH:gk,TOMORROW:vk,TMRW:yk,SUNRISE:bk,FAJR:wk,DHUHR:xk,ASR:Sk,MAGHRIB:_k,ISHA:Ak,"FAJR END TIME":"Fajr Sluttidspunkt","FAJR END":"Fajr Slutt",JUMMAH:Nk,EID:Ek,IN:Ck,"SELECT MASJID":"Velg Masjid",SELECT:Lk,LANGUAGE:jk,ENGLISH:Tk,NORWEGIAN:Ok,ARABIC:Dk,"ASR METHOD":"Asr-metode","PRAYER METHOD":"Bønnemetode","IRN DEFAULT":"IRN standard",METHOD:Rk,"1X METHOD":"1x metode","2X METHOD":"2x metode","50% METHOD":"50% metode",NORTH:Mk,SOUTH:kk,"EVENTS & CALENDAR":"Arrangementer & Kalender","SEE ALL":"Se Alle","LOOK OUT FOR IMPORTANT DATES AND EVENTS":"Følg Med På Viktige Datoer Og Hendelser","CREATE YOUR PRAYER TIMETABLE":"Lag Din Bønnetidtabell","VIEW AND DOWNLOAD YOUR CUSTOM PRAYER TIMETABLE":"Vis Og Last Ned Din Egendefinerte Bønnetidtabell","VIEW FULL CALENDAR":"Se Full Kalender","HIJRI CALENDAR":"Hijri-kalender",SETTINGS:Pk,DAILY:Ik,WEEKLY:Fk,MONTHLY:Bk,CUSTOM:$k,FROM:Uk,TO:zk,"PRAYER TIMETABLE":"Bønnetidtabell","DOWNLOAD TIMETABLE":"Last Ned Tidtabell","DOWNLOAD (CSV/PDF)":"Last Ned (Csv/Pdf)","SAVE AS CSV":"Lagre Som Csv","SAVE AS PDF":"Lagre Som Pdf",CANCEL:qk,CONTACT:Hk,SUN:Vk,MON:Yk,TUE:Gk,WED:Wk,THU:Jk,FRI:Kk,SAT:Xk,TODAY:Qk,DATE:Zk,JANUARY:e9,FEBRUARY:t9,MARCH:n9,APRIL:r9,MAY:a9,JUNE:i9,JULY:s9,AUGUST:o9,SEPTEMBER:l9,OCTOBER:u9,NOVEMBER:c9,DECEMBER:f9},h9="الصلاة",p9="الصلاة",m9="الأذان",g9="الجماعة",v9="الإقامة",y9="غدًا",b9="غدًا",w9="شروق الشمس",x9="الفجر",S9="الظهر",_9="العصر",A9="المغرب",N9="العشاء",E9="جمعة",C9="العيد",L9="في",j9="اختر",T9="اللغة",O9="الإنجليزية",D9="النرويجية",R9="العربية",M9="الطريقة",k9="الشمالية",P9="الجنوبية",I9="الإعدادات",F9="يومي",B9="أسبوعي",$9="شهري",U9="مخصص",z9="من",q9="إلى",H9="إلغاء",V9="اتصال",Y9="أحد",G9="إثنين",W9="ثلاثاء",J9="أربعاء",K9="خميس",X9="جمعة",Q9="سبت",Z9="اليوم",eP="التاريخ",tP="January",nP="February",rP="March",aP="April",iP="May",sP="June",oP="July",lP="August",uP="September",cP="October",fP="November",dP="December",hP={PRAYER:h9,SALAH:p9,ADHAN:m9,JAMAAT:g9,IQAMAH:v9,TOMORROW:y9,TMRW:b9,SUNRISE:w9,FAJR:x9,DHUHR:S9,ASR:_9,MAGHRIB:A9,ISHA:N9,"FAJR END TIME":"نهاية وقت الفجر","FAJR END":"نهاية الفجر",JUMUAH:E9,EID:C9,IN:L9,"SELECT MASJID":"اختر المسجد",SELECT:j9,LANGUAGE:T9,ENGLISH:O9,NORWEGIAN:D9,ARABIC:R9,"ASR METHOD":"طريقة العصر","PRAYER METHOD":"طريقة الصلاة","IRN DEFAULT":"الإعداد الافتراضي ل IRN",METHOD:M9,"1X METHOD":"طريقة 1 x","2X METHOD":"طريقة 2 x","50% METHOD":"طريقة 50 %",NORTH:k9,SOUTH:P9,"EVENTS & CALENDAR":"الأحداث والتقويم","SEE ALL":"عرض الكل","LOOK OUT FOR IMPORTANT DATES AND EVENTS":"ترقب التواريخ الهامة والأحداث","CREATE YOUR PRAYER TIMETABLE":"أنشئ جدول صلواتك","VIEW AND DOWNLOAD YOUR CUSTOM PRAYER TIMETABLE":"عرض وتحميل جدول صلاتك المخصص","VIEW FULL CALENDAR":"عرض التقويم الكامل","HIJRI CALENDAR":"التقويم الهجري",SETTINGS:I9,DAILY:F9,WEEKLY:B9,MONTHLY:$9,CUSTOM:U9,FROM:z9,TO:q9,"PRAYER TIMETABLE":"جدول الصلاة","DOWNLOAD TIMETABLE":"تحميل الجدول","DOWNLOAD (CSV/PDF)":"تحميل (CSV/PDF)","SAVE AS CSV":"حفظ كـ CSV","SAVE AS PDF":"حفظ كـ PDF",CANCEL:H9,CONTACT:V9,SUN:Y9,MON:G9,TUE:W9,WED:J9,THU:K9,FRI:X9,SAT:Q9,TODAY:Z9,DATE:eP,JANUARY:tP,FEBRUARY:nP,MARCH:rP,APRIL:aP,MAY:iP,JUNE:sP,JULY:oP,AUGUST:lP,SEPTEMBER:uP,OCTOBER:cP,NOVEMBER:fP,DECEMBER:dP};Cr.use(_O).init({resources:{en:{translation:fk},no:{translation:d9},ar:{translation:hP}},lng:"en",fallbackLng:"en",interpolation:{escapeValue:!1}});const _v=(e,t)=>t.some(n=>e instanceof n);let n4,r4;function pP(){return n4||(n4=[IDBDatabase,IDBObjectStore,IDBIndex,IDBCursor,IDBTransaction])}function mP(){return r4||(r4=[IDBCursor.prototype.advance,IDBCursor.prototype.continue,IDBCursor.prototype.continuePrimaryKey])}const Av=new WeakMap,I1=new WeakMap,jg=new WeakMap;function gP(e){const t=new Promise((n,r)=>{const a=()=>{e.removeEventListener("success",i),e.removeEventListener("error",s)},i=()=>{n(ml(e.result)),a()},s=()=>{r(e.error),a()};e.addEventListener("success",i),e.addEventListener("error",s)});return jg.set(t,e),t}function vP(e){if(Av.has(e))return;const t=new Promise((n,r)=>{const a=()=>{e.removeEventListener("complete",i),e.removeEventListener("error",s),e.removeEventListener("abort",s)},i=()=>{n(),a()},s=()=>{r(e.error||new DOMException("AbortError","AbortError")),a()};e.addEventListener("complete",i),e.addEventListener("error",s),e.addEventListener("abort",s)});Av.set(e,t)}let Nv={get(e,t,n){if(e instanceof IDBTransaction){if(t==="done")return Av.get(e);if(t==="store")return n.objectStoreNames[1]?void 0:n.objectStore(n.objectStoreNames[0])}return ml(e[t])},set(e,t,n){return e[t]=n,!0},has(e,t){return e instanceof IDBTransaction&&(t==="done"||t==="store")?!0:t in e}};function qA(e){Nv=e(Nv)}function yP(e){return mP().includes(e)?function(...t){return e.apply(Ev(this),t),ml(this.request)}:function(...t){return ml(e.apply(Ev(this),t))}}function bP(e){return typeof e=="function"?yP(e):(e instanceof IDBTransaction&&vP(e),_v(e,pP())?new Proxy(e,Nv):e)}function ml(e){if(e instanceof IDBRequest)return gP(e);if(I1.has(e))return I1.get(e);const t=bP(e);return t!==e&&(I1.set(e,t),jg.set(t,e)),t}const Ev=e=>jg.get(e);function $n(e,t,{blocked:n,upgrade:r,blocking:a,terminated:i}={}){const s=indexedDB.open(e,t),o=ml(s);return r&&s.addEventListener("upgradeneeded",l=>{r(ml(s.result),l.oldVersion,l.newVersion,ml(s.transaction),l)}),n&&s.addEventListener("blocked",l=>n(l.oldVersion,l.newVersion,l)),o.then(l=>{i&&l.addEventListener("close",()=>i()),a&&l.addEventListener("versionchange",u=>a(u.oldVersion,u.newVersion,u))}).catch(()=>{}),o}const wP=["get","getKey","getAll","getAllKeys","count"],xP=["put","add","delete","clear"],F1=new Map;function a4(e,t){if(!(e instanceof IDBDatabase&&!(t in e)&&typeof t=="string"))return;if(F1.get(t))return F1.get(t);const n=t.replace(/FromIndex$/,""),r=t!==n,a=xP.includes(n);if(!(n in(r?IDBIndex:IDBObjectStore).prototype)||!(a||wP.includes(n)))return;const i=async function(s,...o){const l=this.transaction(s,a?"readwrite":"readonly");let u=l.store;return r&&(u=u.index(o.shift())),(await Promise.all([u[n](...o),a&&l.done]))[0]};return F1.set(t,i),i}qA(e=>({...e,get:(t,n,r)=>a4(t,n)||e.get(t,n,r),has:(t,n)=>!!a4(t,n)||e.has(t,n)}));const SP=["continue","continuePrimaryKey","advance"],i4={},Cv=new WeakMap,HA=new WeakMap,_P={get(e,t){if(!SP.includes(t))return e[t];let n=i4[t];return n||(n=i4[t]=function(...r){Cv.set(this,HA.get(this)[t](...r))}),n}};async function*AP(...e){let t=this;if(t instanceof IDBCursor||(t=await t.openCursor(...e)),!t)return;t=t;const n=new Proxy(t,_P);for(HA.set(n,t),jg.set(n,Ev(t));t;)yield n,t=await(Cv.get(n)||t.continue()),Cv.delete(n)}function s4(e,t){return t===Symbol.asyncIterator&&_v(e,[IDBIndex,IDBObjectStore,IDBCursor])||t==="iterate"&&_v(e,[IDBIndex,IDBObjectStore])}qA(e=>({...e,get(t,n,r){return s4(t,n)?AP:e.get(t,n,r)},has(t,n){return s4(t,n)||e.has(t,n)}}));const VA="site-language-db",Hu="mosqueLanguage";async function o4(e,t){await(await $n(VA,1,{upgrade(r){r.objectStoreNames.contains(Hu)||r.createObjectStore(Hu)}})).put(Hu,t,e)}async function l4(e){return(await $n(VA,1,{upgrade(n){n.objectStoreNames.contains(Hu)||n.createObjectStore(Hu)}})).get(Hu,e)}const Lv=e=>({1:"no",2:"en",3:"ar"})[e]||"en";function Ms(e){const[t,n]=C.useState("en"),[r,a]=C.useState(!0),i=async s=>{n(s),Cr.changeLanguage(s)};return C.useEffect(()=>{if(!e){i("en"),a(!1);return}let s=null;return(async()=>{if(a(!0),!navigator.onLine){const l=await l4(e);if(l){await i(l),a(!1);return}}try{const{data:l}=await Ke.from("mosque_t").select("language").eq("organisasjonsnummer",e).single(),u=(l==null?void 0:l.language)||2,c=Lv(u);await o4(e,c),await i(c)}catch(l){const u=await l4(e);u&&await i(u),console.error("Error fetching mosque language:",l)}finally{a(!1)}})(),s=Ke.channel(`mosque_language_changes:${e}`).on("postgres_changes",{event:"*",schema:"public",table:"mosque_t",filter:`organisasjonsnummer=eq.${e}`},async l=>{var c;const u=(c=l.new)==null?void 0:c.language;u&&(await o4(e,u),await i(u))}).subscribe(),()=>{s==null||s.unsubscribe()}},[e]),{language:t,loading:r}}var YA={color:void 0,size:void 0,className:void 0,style:void 0,attr:void 0},u4=Lt.createContext&&Lt.createContext(YA),NP=["attr","size","title"];function EP(e,t){if(e==null)return{};var n=CP(e,t),r,a;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)r=i[a],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function CP(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}function jm(){return jm=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},jm.apply(this,arguments)}function c4(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function Tm(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?c4(Object(n),!0).forEach(function(r){LP(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):c4(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function LP(e,t,n){return t=jP(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function jP(e){var t=TP(e,"string");return typeof t=="symbol"?t:t+""}function TP(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function GA(e){return e&&e.map((t,n)=>Lt.createElement(t.tag,Tm({key:n},t.attr),GA(t.child)))}function lr(e){return t=>Lt.createElement(OP,jm({attr:Tm({},e.attr)},t),GA(e.child))}function OP(e){var t=n=>{var{attr:r,size:a,title:i}=e,s=EP(e,NP),o=a||n.size||"1em",l;return n.className&&(l=n.className),e.className&&(l=(l?l+" ":"")+e.className),Lt.createElement("svg",jm({stroke:"currentColor",fill:"currentColor",strokeWidth:"0"},n.attr,r,s,{className:l,style:Tm(Tm({color:e.color||n.color},n.style),e.style),height:o,width:o,xmlns:"http://www.w3.org/2000/svg"}),i&&Lt.createElement("title",null,i),e.children)};return u4!==void 0?Lt.createElement(u4.Consumer,null,n=>t(n)):t(YA)}function Ud(e){return lr({attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M256 32l-64 80h32v64h64v-64h32l-64-80zm-9 187v80h18v-80h-18zm-63.992 53.602l-16.631 6.886 15.309 36.955 16.628-6.886-15.306-36.955zm145.984 0l-15.306 36.955 16.628 6.886 15.309-36.955-16.63-6.886zM77.795 284.068l-12.727 12.727 56.569 56.568 12.726-12.726-56.568-56.569zm356.41 0l-56.568 56.569 12.726 12.726 56.569-56.568-12.727-12.727zM256 337.994a118.919 118.919 0 0 0-59.5 15.95c-34.215 19.754-56.177 55.048-59.129 94.056H374.63c-2.952-39.008-24.914-74.302-59.129-94.057a118.919 118.919 0 0 0-59.5-15.949zM66.488 387.377l-6.886 16.63 36.955 15.307 6.886-16.628-36.955-15.309zm379.024 0l-36.955 15.309 6.886 16.628 36.955-15.306-6.886-16.631zM24 466v18h464v-18H24z"},child:[]}]})(e)}const f4=e=>{const[t,n]=e.split(":").map(Number);return t*60+n};function DP({prayerTimes:e,extraInfo:t,prayerTimesColor:n,extraInfoColor:r,isDefault:a}){const{org_nr:i}=Cn(),{t:s}=Dn(),o=new Date,l=o.getHours()*60+o.getMinutes(),u=e.findIndex(d=>f4(d.adhan)>l),{language:c}=Ms(i||void 0),{darkMode:f}=or(),p=c==="ar";return b.jsx("div",{className:"font-chakra ",style:{color:f?"#F2E7D5":n.text},children:b.jsxs("div",{className:"backdrop-blur-md rounded-4xl p- shadow-sm min-w-[340px] dark:bg-gradient-to-r dark:from-[#1C1B1BBF] dark:to-[#13121299]",style:{backgroundColor:f?"":a?mA(n.bg,.75):n.bg},dir:p?"rtl":"ltr",children:[b.jsxs("div",{className:"table w-full border-b-2 border-[#00000026] dark:border-[#F2E7D530] p-6",children:[b.jsx("div",{className:"table-header-group w-full text-md md:text-lg 2xl:text-2xl font-bold",style:{color:f?"#F2E7D5":a?"#53452E":n.text},children:b.jsxs("div",{className:"table-row",children:[b.jsx("div",{className:`table-cell py-4 pl-2 ${p?"text-right":"text-left"} border-b-2 border-[#00000026] dark:border-[#F2E7D530]`,children:s("SALAH")}),!p&&b.jsx("div",{className:"table-cell py-2 text-right border-b-2 border-[#00000026] dark:border-[#F2E7D530]"}),b.jsx("div",{className:"table-cell py-2 text-center border-b-2 border-[#00000026] dark:border-[#F2E7D530]",children:s("ADHAN")}),b.jsx("div",{className:"table-cell py-2 text-center border-b-2 border-[#00000026] dark:border-[#F2E7D530]",children:s("IQAMAH")}),b.jsx("div",{className:"table-cell py-2 text-center border-b-2 border-[#00000026] dark:border-[#F2E7D530]",children:s("TOMORROW")})]})}),b.jsx("div",{className:"table-row-group w-full text-md md:text-lg 2xl:text-2xl",children:e.map((d,v)=>{const S=f4(d.adhan),x=v===u,y=S<l&&!x?"opacity-40 dark:text-[#F2E7D5]":"",_={backgroundColor:f?"#54462E":a?"#CFB78F":r.bg,color:a?"":r.text,borderBlockColor:f?"#F2E7DF":a?"#53452E":r.text};return b.jsxs("div",{className:"table-row overflow-hidden text-lg md:text-xl lg:text-3xl",children:[b.jsx("div",{className:`table-cell py-2 pl-2 ${p?"text-right":"text-left"} font-bold ${x?p?"border-r-2 border-y-2 rounded-r-xl":"border-l-2 border-y-2 rounded-l-xl":""}`,style:x?_:{},children:d.name==="Fajr end"?b.jsx(Ud,{color:"orange",size:28}):s(d.name.toUpperCase())}),!p&&b.jsx("div",{className:`table-cell py-2 text-right ${x&&"border-y-2"}`,style:x?_:{},children:d.arabic?s(d.arabic.toUpperCase()):""}),b.jsx("div",{className:`table-cell py-2 text-center font-bold ${y} ${x&&"border-y-2"}`,style:x?_:{},children:d.adhan}),b.jsx("div",{className:`table-cell py-2 text-center font-semibold ${y} ${x?p?"border-l-2 border-y-2 rounded-l-xl":"border-r-2 border-y-2 rounded-r-xl":""}`,style:x?_:{},children:d.iqamah}),b.jsx("div",{className:"table-cell py-2 text-center font-semibold",children:d.tomorrow})]},v)})})]}),b.jsx("div",{className:"px-8 py-6 font-semibold rounded-b-4xl text-lg md:text-xl 2xl:text-3xl",style:{color:f?"#F2E7D5":r.text,backgroundColor:f?"#54462E":a?"#CFB78F":r.bg},children:b.jsx("div",{className:p?"w-[55%]":"",children:t.filter(d=>d.label==="Eid"?Array.isArray(d.time)&&d.time.some(v=>v&&v.trim()!==""):!0).map((d,v)=>b.jsxs("div",{className:"flex justify-between py-2",children:[b.jsx("div",{className:"w-2/5",children:s(d==null?void 0:d.label.toUpperCase())}),Array.isArray(d.time)?(p?[2,1,0]:[0,1,2]).map(S=>b.jsx("div",{className:"w-1/4 md:w-1/5 text-center ",children:d.time[S]},S)):b.jsxs(b.Fragment,{children:[b.jsx("div",{className:"w-1/5 text-center ",children:d.time}),b.jsx("div",{className:"w-1/5"}),b.jsx("div",{className:"w-1/5"})]})]},v))})})]})})}const WA="masjid-info-db",Om="masjid_info";async function d4(e){return await(await $n(WA,1,{upgrade(n){n.createObjectStore(Om)}})).get(Om,e)}async function RP(e,t){await(await $n(WA,1,{upgrade(r){r.createObjectStore(Om)}})).put(Om,t,e)}function JA(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e)){var a=e.length;for(t=0;t<a;t++)e[t]&&(n=JA(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function gl(){for(var e,t,n=0,r="",a=arguments.length;n<a;n++)(e=arguments[n])&&(t=JA(e))&&(r&&(r+=" "),r+=t);return r}function MP(e){if(typeof document>"u")return;let t=document.head||document.getElementsByTagName("head")[0],n=document.createElement("style");n.type="text/css",t.firstChild?t.insertBefore(n,t.firstChild):t.appendChild(n),n.styleSheet?n.styleSheet.cssText=e:n.appendChild(document.createTextNode(e))}MP(`:root{--toastify-color-light: #fff;--toastify-color-dark: #121212;--toastify-color-info: #3498db;--toastify-color-success: #07bc0c;--toastify-color-warning: #f1c40f;--toastify-color-error: hsl(6, 78%, 57%);--toastify-color-transparent: rgba(255, 255, 255, .7);--toastify-icon-color-info: var(--toastify-color-info);--toastify-icon-color-success: var(--toastify-color-success);--toastify-icon-color-warning: var(--toastify-color-warning);--toastify-icon-color-error: var(--toastify-color-error);--toastify-container-width: fit-content;--toastify-toast-width: 320px;--toastify-toast-offset: 16px;--toastify-toast-top: max(var(--toastify-toast-offset), env(safe-area-inset-top));--toastify-toast-right: max(var(--toastify-toast-offset), env(safe-area-inset-right));--toastify-toast-left: max(var(--toastify-toast-offset), env(safe-area-inset-left));--toastify-toast-bottom: max(var(--toastify-toast-offset), env(safe-area-inset-bottom));--toastify-toast-background: #fff;--toastify-toast-padding: 14px;--toastify-toast-min-height: 64px;--toastify-toast-max-height: 800px;--toastify-toast-bd-radius: 6px;--toastify-toast-shadow: 0px 4px 12px rgba(0, 0, 0, .1);--toastify-font-family: sans-serif;--toastify-z-index: 9999;--toastify-text-color-light: #757575;--toastify-text-color-dark: #fff;--toastify-text-color-info: #fff;--toastify-text-color-success: #fff;--toastify-text-color-warning: #fff;--toastify-text-color-error: #fff;--toastify-spinner-color: #616161;--toastify-spinner-color-empty-area: #e0e0e0;--toastify-color-progress-light: linear-gradient(to right, #4cd964, #5ac8fa, #007aff, #34aadc, #5856d6, #ff2d55);--toastify-color-progress-dark: #bb86fc;--toastify-color-progress-info: var(--toastify-color-info);--toastify-color-progress-success: var(--toastify-color-success);--toastify-color-progress-warning: var(--toastify-color-warning);--toastify-color-progress-error: var(--toastify-color-error);--toastify-color-progress-bgo: .2}.Toastify__toast-container{z-index:var(--toastify-z-index);-webkit-transform:translate3d(0,0,var(--toastify-z-index));position:fixed;width:var(--toastify-container-width);box-sizing:border-box;color:#fff;display:flex;flex-direction:column}.Toastify__toast-container--top-left{top:var(--toastify-toast-top);left:var(--toastify-toast-left)}.Toastify__toast-container--top-center{top:var(--toastify-toast-top);left:50%;transform:translate(-50%);align-items:center}.Toastify__toast-container--top-right{top:var(--toastify-toast-top);right:var(--toastify-toast-right);align-items:end}.Toastify__toast-container--bottom-left{bottom:var(--toastify-toast-bottom);left:var(--toastify-toast-left)}.Toastify__toast-container--bottom-center{bottom:var(--toastify-toast-bottom);left:50%;transform:translate(-50%);align-items:center}.Toastify__toast-container--bottom-right{bottom:var(--toastify-toast-bottom);right:var(--toastify-toast-right);align-items:end}.Toastify__toast{--y: 0;position:relative;touch-action:none;width:var(--toastify-toast-width);min-height:var(--toastify-toast-min-height);box-sizing:border-box;margin-bottom:1rem;padding:var(--toastify-toast-padding);border-radius:var(--toastify-toast-bd-radius);box-shadow:var(--toastify-toast-shadow);max-height:var(--toastify-toast-max-height);font-family:var(--toastify-font-family);z-index:0;display:flex;flex:1 auto;align-items:center;word-break:break-word}@media only screen and (max-width: 480px){.Toastify__toast-container{width:100vw;left:env(safe-area-inset-left);margin:0}.Toastify__toast-container--top-left,.Toastify__toast-container--top-center,.Toastify__toast-container--top-right{top:env(safe-area-inset-top);transform:translate(0)}.Toastify__toast-container--bottom-left,.Toastify__toast-container--bottom-center,.Toastify__toast-container--bottom-right{bottom:env(safe-area-inset-bottom);transform:translate(0)}.Toastify__toast-container--rtl{right:env(safe-area-inset-right);left:initial}.Toastify__toast{--toastify-toast-width: 100%;margin-bottom:0;border-radius:0}}.Toastify__toast-container[data-stacked=true]{width:var(--toastify-toast-width)}.Toastify__toast--stacked{position:absolute;width:100%;transform:translate3d(0,var(--y),0) scale(var(--s));transition:transform .3s}.Toastify__toast--stacked[data-collapsed] .Toastify__toast-body,.Toastify__toast--stacked[data-collapsed] .Toastify__close-button{transition:opacity .1s}.Toastify__toast--stacked[data-collapsed=false]{overflow:visible}.Toastify__toast--stacked[data-collapsed=true]:not(:last-child)>*{opacity:0}.Toastify__toast--stacked:after{content:"";position:absolute;left:0;right:0;height:calc(var(--g) * 1px);bottom:100%}.Toastify__toast--stacked[data-pos=top]{top:0}.Toastify__toast--stacked[data-pos=bot]{bottom:0}.Toastify__toast--stacked[data-pos=bot].Toastify__toast--stacked:before{transform-origin:top}.Toastify__toast--stacked[data-pos=top].Toastify__toast--stacked:before{transform-origin:bottom}.Toastify__toast--stacked:before{content:"";position:absolute;left:0;right:0;bottom:0;height:100%;transform:scaleY(3);z-index:-1}.Toastify__toast--rtl{direction:rtl}.Toastify__toast--close-on-click{cursor:pointer}.Toastify__toast-icon{margin-inline-end:10px;width:22px;flex-shrink:0;display:flex}.Toastify--animate{animation-fill-mode:both;animation-duration:.5s}.Toastify--animate-icon{animation-fill-mode:both;animation-duration:.3s}.Toastify__toast-theme--dark{background:var(--toastify-color-dark);color:var(--toastify-text-color-dark)}.Toastify__toast-theme--light,.Toastify__toast-theme--colored.Toastify__toast--default{background:var(--toastify-color-light);color:var(--toastify-text-color-light)}.Toastify__toast-theme--colored.Toastify__toast--info{color:var(--toastify-text-color-info);background:var(--toastify-color-info)}.Toastify__toast-theme--colored.Toastify__toast--success{color:var(--toastify-text-color-success);background:var(--toastify-color-success)}.Toastify__toast-theme--colored.Toastify__toast--warning{color:var(--toastify-text-color-warning);background:var(--toastify-color-warning)}.Toastify__toast-theme--colored.Toastify__toast--error{color:var(--toastify-text-color-error);background:var(--toastify-color-error)}.Toastify__progress-bar-theme--light{background:var(--toastify-color-progress-light)}.Toastify__progress-bar-theme--dark{background:var(--toastify-color-progress-dark)}.Toastify__progress-bar--info{background:var(--toastify-color-progress-info)}.Toastify__progress-bar--success{background:var(--toastify-color-progress-success)}.Toastify__progress-bar--warning{background:var(--toastify-color-progress-warning)}.Toastify__progress-bar--error{background:var(--toastify-color-progress-error)}.Toastify__progress-bar-theme--colored.Toastify__progress-bar--info,.Toastify__progress-bar-theme--colored.Toastify__progress-bar--success,.Toastify__progress-bar-theme--colored.Toastify__progress-bar--warning,.Toastify__progress-bar-theme--colored.Toastify__progress-bar--error{background:var(--toastify-color-transparent)}.Toastify__close-button{color:#fff;position:absolute;top:6px;right:6px;background:transparent;outline:none;border:none;padding:0;cursor:pointer;opacity:.7;transition:.3s ease;z-index:1}.Toastify__toast--rtl .Toastify__close-button{left:6px;right:unset}.Toastify__close-button--light{color:#000;opacity:.3}.Toastify__close-button>svg{fill:currentColor;height:16px;width:14px}.Toastify__close-button:hover,.Toastify__close-button:focus{opacity:1}@keyframes Toastify__trackProgress{0%{transform:scaleX(1)}to{transform:scaleX(0)}}.Toastify__progress-bar{position:absolute;bottom:0;left:0;width:100%;height:100%;z-index:1;opacity:.7;transform-origin:left}.Toastify__progress-bar--animated{animation:Toastify__trackProgress linear 1 forwards}.Toastify__progress-bar--controlled{transition:transform .2s}.Toastify__progress-bar--rtl{right:0;left:initial;transform-origin:right;border-bottom-left-radius:initial}.Toastify__progress-bar--wrp{position:absolute;overflow:hidden;bottom:0;left:0;width:100%;height:5px;border-bottom-left-radius:var(--toastify-toast-bd-radius);border-bottom-right-radius:var(--toastify-toast-bd-radius)}.Toastify__progress-bar--wrp[data-hidden=true]{opacity:0}.Toastify__progress-bar--bg{opacity:var(--toastify-color-progress-bgo);width:100%;height:100%}.Toastify__spinner{width:20px;height:20px;box-sizing:border-box;border:2px solid;border-radius:100%;border-color:var(--toastify-spinner-color-empty-area);border-right-color:var(--toastify-spinner-color);animation:Toastify__spin .65s linear infinite}@keyframes Toastify__bounceInRight{0%,60%,75%,90%,to{animation-timing-function:cubic-bezier(.215,.61,.355,1)}0%{opacity:0;transform:translate3d(3000px,0,0)}60%{opacity:1;transform:translate3d(-25px,0,0)}75%{transform:translate3d(10px,0,0)}90%{transform:translate3d(-5px,0,0)}to{transform:none}}@keyframes Toastify__bounceOutRight{20%{opacity:1;transform:translate3d(-20px,var(--y),0)}to{opacity:0;transform:translate3d(2000px,var(--y),0)}}@keyframes Toastify__bounceInLeft{0%,60%,75%,90%,to{animation-timing-function:cubic-bezier(.215,.61,.355,1)}0%{opacity:0;transform:translate3d(-3000px,0,0)}60%{opacity:1;transform:translate3d(25px,0,0)}75%{transform:translate3d(-10px,0,0)}90%{transform:translate3d(5px,0,0)}to{transform:none}}@keyframes Toastify__bounceOutLeft{20%{opacity:1;transform:translate3d(20px,var(--y),0)}to{opacity:0;transform:translate3d(-2000px,var(--y),0)}}@keyframes Toastify__bounceInUp{0%,60%,75%,90%,to{animation-timing-function:cubic-bezier(.215,.61,.355,1)}0%{opacity:0;transform:translate3d(0,3000px,0)}60%{opacity:1;transform:translate3d(0,-20px,0)}75%{transform:translate3d(0,10px,0)}90%{transform:translate3d(0,-5px,0)}to{transform:translateZ(0)}}@keyframes Toastify__bounceOutUp{20%{transform:translate3d(0,calc(var(--y) - 10px),0)}40%,45%{opacity:1;transform:translate3d(0,calc(var(--y) + 20px),0)}to{opacity:0;transform:translate3d(0,-2000px,0)}}@keyframes Toastify__bounceInDown{0%,60%,75%,90%,to{animation-timing-function:cubic-bezier(.215,.61,.355,1)}0%{opacity:0;transform:translate3d(0,-3000px,0)}60%{opacity:1;transform:translate3d(0,25px,0)}75%{transform:translate3d(0,-10px,0)}90%{transform:translate3d(0,5px,0)}to{transform:none}}@keyframes Toastify__bounceOutDown{20%{transform:translate3d(0,calc(var(--y) - 10px),0)}40%,45%{opacity:1;transform:translate3d(0,calc(var(--y) + 20px),0)}to{opacity:0;transform:translate3d(0,2000px,0)}}.Toastify__bounce-enter--top-left,.Toastify__bounce-enter--bottom-left{animation-name:Toastify__bounceInLeft}.Toastify__bounce-enter--top-right,.Toastify__bounce-enter--bottom-right{animation-name:Toastify__bounceInRight}.Toastify__bounce-enter--top-center{animation-name:Toastify__bounceInDown}.Toastify__bounce-enter--bottom-center{animation-name:Toastify__bounceInUp}.Toastify__bounce-exit--top-left,.Toastify__bounce-exit--bottom-left{animation-name:Toastify__bounceOutLeft}.Toastify__bounce-exit--top-right,.Toastify__bounce-exit--bottom-right{animation-name:Toastify__bounceOutRight}.Toastify__bounce-exit--top-center{animation-name:Toastify__bounceOutUp}.Toastify__bounce-exit--bottom-center{animation-name:Toastify__bounceOutDown}@keyframes Toastify__zoomIn{0%{opacity:0;transform:scale3d(.3,.3,.3)}50%{opacity:1}}@keyframes Toastify__zoomOut{0%{opacity:1}50%{opacity:0;transform:translate3d(0,var(--y),0) scale3d(.3,.3,.3)}to{opacity:0}}.Toastify__zoom-enter{animation-name:Toastify__zoomIn}.Toastify__zoom-exit{animation-name:Toastify__zoomOut}@keyframes Toastify__flipIn{0%{transform:perspective(400px) rotateX(90deg);animation-timing-function:ease-in;opacity:0}40%{transform:perspective(400px) rotateX(-20deg);animation-timing-function:ease-in}60%{transform:perspective(400px) rotateX(10deg);opacity:1}80%{transform:perspective(400px) rotateX(-5deg)}to{transform:perspective(400px)}}@keyframes Toastify__flipOut{0%{transform:translate3d(0,var(--y),0) perspective(400px)}30%{transform:translate3d(0,var(--y),0) perspective(400px) rotateX(-20deg);opacity:1}to{transform:translate3d(0,var(--y),0) perspective(400px) rotateX(90deg);opacity:0}}.Toastify__flip-enter{animation-name:Toastify__flipIn}.Toastify__flip-exit{animation-name:Toastify__flipOut}@keyframes Toastify__slideInRight{0%{transform:translate3d(110%,0,0);visibility:visible}to{transform:translate3d(0,var(--y),0)}}@keyframes Toastify__slideInLeft{0%{transform:translate3d(-110%,0,0);visibility:visible}to{transform:translate3d(0,var(--y),0)}}@keyframes Toastify__slideInUp{0%{transform:translate3d(0,110%,0);visibility:visible}to{transform:translate3d(0,var(--y),0)}}@keyframes Toastify__slideInDown{0%{transform:translate3d(0,-110%,0);visibility:visible}to{transform:translate3d(0,var(--y),0)}}@keyframes Toastify__slideOutRight{0%{transform:translate3d(0,var(--y),0)}to{visibility:hidden;transform:translate3d(110%,var(--y),0)}}@keyframes Toastify__slideOutLeft{0%{transform:translate3d(0,var(--y),0)}to{visibility:hidden;transform:translate3d(-110%,var(--y),0)}}@keyframes Toastify__slideOutDown{0%{transform:translate3d(0,var(--y),0)}to{visibility:hidden;transform:translate3d(0,500px,0)}}@keyframes Toastify__slideOutUp{0%{transform:translate3d(0,var(--y),0)}to{visibility:hidden;transform:translate3d(0,-500px,0)}}.Toastify__slide-enter--top-left,.Toastify__slide-enter--bottom-left{animation-name:Toastify__slideInLeft}.Toastify__slide-enter--top-right,.Toastify__slide-enter--bottom-right{animation-name:Toastify__slideInRight}.Toastify__slide-enter--top-center{animation-name:Toastify__slideInDown}.Toastify__slide-enter--bottom-center{animation-name:Toastify__slideInUp}.Toastify__slide-exit--top-left,.Toastify__slide-exit--bottom-left{animation-name:Toastify__slideOutLeft;animation-timing-function:ease-in;animation-duration:.3s}.Toastify__slide-exit--top-right,.Toastify__slide-exit--bottom-right{animation-name:Toastify__slideOutRight;animation-timing-function:ease-in;animation-duration:.3s}.Toastify__slide-exit--top-center{animation-name:Toastify__slideOutUp;animation-timing-function:ease-in;animation-duration:.3s}.Toastify__slide-exit--bottom-center{animation-name:Toastify__slideOutDown;animation-timing-function:ease-in;animation-duration:.3s}@keyframes Toastify__spin{0%{transform:rotate(0)}to{transform:rotate(360deg)}}
68
+ `);var zd=e=>typeof e=="number"&&!isNaN(e),Al=e=>typeof e=="string",js=e=>typeof e=="function",kP=e=>Al(e)||zd(e),jv=e=>Al(e)||js(e)?e:null,PP=(e,t)=>e===!1||zd(e)&&e>0?e:t,Tv=e=>C.isValidElement(e)||Al(e)||js(e)||zd(e);function IP(e,t,n=300){let{scrollHeight:r,style:a}=e;requestAnimationFrame(()=>{a.minHeight="initial",a.height=r+"px",a.transition=`all ${n}ms`,requestAnimationFrame(()=>{a.height="0",a.padding="0",a.margin="0",setTimeout(t,n)})})}function FP({enter:e,exit:t,appendPosition:n=!1,collapse:r=!0,collapseDuration:a=300}){return function({children:i,position:s,preventExitTransition:o,done:l,nodeRef:u,isIn:c,playToast:f}){let p=n?`${e}--${s}`:e,d=n?`${t}--${s}`:t,v=C.useRef(0);return C.useLayoutEffect(()=>{let S=u.current,x=p.split(" "),g=y=>{y.target===u.current&&(f(),S.removeEventListener("animationend",g),S.removeEventListener("animationcancel",g),v.current===0&&y.type!=="animationcancel"&&S.classList.remove(...x))};S.classList.add(...x),S.addEventListener("animationend",g),S.addEventListener("animationcancel",g)},[]),C.useEffect(()=>{let S=u.current,x=()=>{S.removeEventListener("animationend",x),r?IP(S,l,a):l()};c||(o?x():(v.current=1,S.className+=` ${d}`,S.addEventListener("animationend",x)))},[c]),Lt.createElement(Lt.Fragment,null,i)}}function h4(e,t){return{content:KA(e.content,e.props),containerId:e.props.containerId,id:e.props.toastId,theme:e.props.theme,type:e.props.type,data:e.props.data||{},isLoading:e.props.isLoading,icon:e.props.icon,reason:e.removalReason,status:t}}function KA(e,t,n=!1){return C.isValidElement(e)&&!Al(e.type)?C.cloneElement(e,{closeToast:t.closeToast,toastProps:t,data:t.data,isPaused:n}):js(e)?e({closeToast:t.closeToast,toastProps:t,data:t.data,isPaused:n}):e}function BP({closeToast:e,theme:t,ariaLabel:n="close"}){return Lt.createElement("button",{className:`Toastify__close-button Toastify__close-button--${t}`,type:"button",onClick:r=>{r.stopPropagation(),e(!0)},"aria-label":n},Lt.createElement("svg",{"aria-hidden":"true",viewBox:"0 0 14 16"},Lt.createElement("path",{fillRule:"evenodd",d:"M7.71 8.23l3.75 3.75-1.48 1.48-3.75-3.75-3.75 3.75L1 11.98l3.75-3.75L1 4.48 2.48 3l3.75 3.75L9.98 3l1.48 1.48-3.75 3.75z"})))}function $P({delay:e,isRunning:t,closeToast:n,type:r="default",hide:a,className:i,controlledProgress:s,progress:o,rtl:l,isIn:u,theme:c}){let f=a||s&&o===0,p={animationDuration:`${e}ms`,animationPlayState:t?"running":"paused"};s&&(p.transform=`scaleX(${o})`);let d=gl("Toastify__progress-bar",s?"Toastify__progress-bar--controlled":"Toastify__progress-bar--animated",`Toastify__progress-bar-theme--${c}`,`Toastify__progress-bar--${r}`,{"Toastify__progress-bar--rtl":l}),v=js(i)?i({rtl:l,type:r,defaultClassName:d}):gl(d,i),S={[s&&o>=1?"onTransitionEnd":"onAnimationEnd"]:s&&o<1?null:()=>{u&&n()}};return Lt.createElement("div",{className:"Toastify__progress-bar--wrp","data-hidden":f},Lt.createElement("div",{className:`Toastify__progress-bar--bg Toastify__progress-bar-theme--${c} Toastify__progress-bar--${r}`}),Lt.createElement("div",{role:"progressbar","aria-hidden":f?"true":"false","aria-label":"notification timer",className:v,style:p,...S}))}var UP=1,XA=()=>`${UP++}`;function zP(e,t,n){let r=1,a=0,i=[],s=[],o=t,l=new Map,u=new Set,c=y=>(u.add(y),()=>u.delete(y)),f=()=>{s=Array.from(l.values()),u.forEach(y=>y())},p=({containerId:y,toastId:_,updateId:E})=>{let D=y?y!==e:e!==1,R=l.has(_)&&E==null;return D||R},d=(y,_)=>{l.forEach(E=>{var D;(_==null||_===E.props.toastId)&&((D=E.toggle)==null||D.call(E,y))})},v=y=>{var _,E;(E=(_=y.props)==null?void 0:_.onClose)==null||E.call(_,y.removalReason),y.isActive=!1},S=y=>{if(y==null)l.forEach(v);else{let _=l.get(y);_&&v(_)}f()},x=()=>{a-=i.length,i=[]},g=y=>{var _,E;let{toastId:D,updateId:R}=y.props,O=R==null;y.staleId&&l.delete(y.staleId),y.isActive=!0,l.set(D,y),f(),n(h4(y,O?"added":"updated")),O&&((E=(_=y.props).onOpen)==null||E.call(_))};return{id:e,props:o,observe:c,toggle:d,removeToast:S,toasts:l,clearQueue:x,buildToast:(y,_)=>{if(p(_))return;let{toastId:E,updateId:D,data:R,staleId:O,delay:j}=_,$=D==null;$&&a++;let V={...o,style:o.toastStyle,key:r++,...Object.fromEntries(Object.entries(_).filter(([P,q])=>q!=null)),toastId:E,updateId:D,data:R,isIn:!1,className:jv(_.className||o.toastClassName),progressClassName:jv(_.progressClassName||o.progressClassName),autoClose:_.isLoading?!1:PP(_.autoClose,o.autoClose),closeToast(P){l.get(E).removalReason=P,S(E)},deleteToast(){let P=l.get(E);if(P!=null){if(n(h4(P,"removed")),l.delete(E),a--,a<0&&(a=0),i.length>0){g(i.shift());return}f()}}};V.closeButton=o.closeButton,_.closeButton===!1||Tv(_.closeButton)?V.closeButton=_.closeButton:_.closeButton===!0&&(V.closeButton=Tv(o.closeButton)?o.closeButton:!0);let T={content:y,props:V,staleId:O};o.limit&&o.limit>0&&a>o.limit&&$?i.push(T):zd(j)?setTimeout(()=>{g(T)},j):g(T)},setProps(y){o=y},setToggle:(y,_)=>{let E=l.get(y);E&&(E.toggle=_)},isToastActive:y=>{var _;return(_=l.get(y))==null?void 0:_.isActive},getSnapshot:()=>s}}var Hr=new Map,md=[],Ov=new Set,qP=e=>Ov.forEach(t=>t(e)),QA=()=>Hr.size>0;function HP(){md.forEach(e=>eN(e.content,e.options)),md=[]}var VP=(e,{containerId:t})=>{var n;return(n=Hr.get(t||1))==null?void 0:n.toasts.get(e)};function ZA(e,t){var n;if(t)return!!((n=Hr.get(t))!=null&&n.isToastActive(e));let r=!1;return Hr.forEach(a=>{a.isToastActive(e)&&(r=!0)}),r}function YP(e){if(!QA()){md=md.filter(t=>e!=null&&t.options.toastId!==e);return}if(e==null||kP(e))Hr.forEach(t=>{t.removeToast(e)});else if(e&&("containerId"in e||"id"in e)){let t=Hr.get(e.containerId);t?t.removeToast(e.id):Hr.forEach(n=>{n.removeToast(e.id)})}}var GP=(e={})=>{Hr.forEach(t=>{t.props.limit&&(!e.containerId||t.id===e.containerId)&&t.clearQueue()})};function eN(e,t){Tv(e)&&(QA()||md.push({content:e,options:t}),Hr.forEach(n=>{n.buildToast(e,t)}))}function WP(e){var t;(t=Hr.get(e.containerId||1))==null||t.setToggle(e.id,e.fn)}function tN(e,t){Hr.forEach(n=>{(t==null||!(t!=null&&t.containerId)||(t==null?void 0:t.containerId)===n.id)&&n.toggle(e,t==null?void 0:t.id)})}function JP(e){let t=e.containerId||1;return{subscribe(n){let r=zP(t,e,qP);Hr.set(t,r);let a=r.observe(n);return HP(),()=>{a(),Hr.delete(t)}},setProps(n){var r;(r=Hr.get(t))==null||r.setProps(n)},getSnapshot(){var n;return(n=Hr.get(t))==null?void 0:n.getSnapshot()}}}function KP(e){return Ov.add(e),()=>{Ov.delete(e)}}function XP(e){return e&&(Al(e.toastId)||zd(e.toastId))?e.toastId:XA()}function qd(e,t){return eN(e,t),t.toastId}function Tg(e,t){return{...t,type:t&&t.type||e,toastId:XP(t)}}function Og(e){return(t,n)=>qd(t,Tg(e,n))}function Xt(e,t){return qd(e,Tg("default",t))}Xt.loading=(e,t)=>qd(e,Tg("default",{isLoading:!0,autoClose:!1,closeOnClick:!1,closeButton:!1,draggable:!1,...t}));function QP(e,{pending:t,error:n,success:r},a){let i;t&&(i=Al(t)?Xt.loading(t,a):Xt.loading(t.render,{...a,...t}));let s={isLoading:null,autoClose:null,closeOnClick:null,closeButton:null,draggable:null},o=(u,c,f)=>{if(c==null){Xt.dismiss(i);return}let p={type:u,...s,...a,data:f},d=Al(c)?{render:c}:c;return i?Xt.update(i,{...p,...d}):Xt(d.render,{...p,...d}),f},l=js(e)?e():e;return l.then(u=>o("success",r,u)).catch(u=>o("error",n,u)),l}Xt.promise=QP;Xt.success=Og("success");Xt.info=Og("info");Xt.error=Og("error");Xt.warning=Og("warning");Xt.warn=Xt.warning;Xt.dark=(e,t)=>qd(e,Tg("default",{theme:"dark",...t}));function ZP(e){YP(e)}Xt.dismiss=ZP;Xt.clearWaitingQueue=GP;Xt.isActive=ZA;Xt.update=(e,t={})=>{let n=VP(e,t);if(n){let{props:r,content:a}=n,i={delay:100,...r,...t,toastId:t.toastId||e,updateId:XA()};i.toastId!==e&&(i.staleId=e);let s=i.render||a;delete i.render,qd(s,i)}};Xt.done=e=>{Xt.update(e,{progress:1})};Xt.onChange=KP;Xt.play=e=>tN(!0,e);Xt.pause=e=>tN(!1,e);function eI(e){var t;let{subscribe:n,getSnapshot:r,setProps:a}=C.useRef(JP(e)).current;a(e);let i=(t=C.useSyncExternalStore(n,r,r))==null?void 0:t.slice();function s(o){if(!i)return[];let l=new Map;return e.newestOnTop&&i.reverse(),i.forEach(u=>{let{position:c}=u.props;l.has(c)||l.set(c,[]),l.get(c).push(u)}),Array.from(l,u=>o(u[0],u[1]))}return{getToastToRender:s,isToastActive:ZA,count:i==null?void 0:i.length}}function tI(e){let[t,n]=C.useState(!1),[r,a]=C.useState(!1),i=C.useRef(null),s=C.useRef({start:0,delta:0,removalDistance:0,canCloseOnClick:!0,canDrag:!1,didMove:!1}).current,{autoClose:o,pauseOnHover:l,closeToast:u,onClick:c,closeOnClick:f}=e;WP({id:e.toastId,containerId:e.containerId,fn:n}),C.useEffect(()=>{if(e.pauseOnFocusLoss)return p(),()=>{d()}},[e.pauseOnFocusLoss]);function p(){document.hasFocus()||g(),window.addEventListener("focus",x),window.addEventListener("blur",g)}function d(){window.removeEventListener("focus",x),window.removeEventListener("blur",g)}function v(O){if(e.draggable===!0||e.draggable===O.pointerType){y();let j=i.current;s.canCloseOnClick=!0,s.canDrag=!0,j.style.transition="none",e.draggableDirection==="x"?(s.start=O.clientX,s.removalDistance=j.offsetWidth*(e.draggablePercent/100)):(s.start=O.clientY,s.removalDistance=j.offsetHeight*(e.draggablePercent===80?e.draggablePercent*1.5:e.draggablePercent)/100)}}function S(O){let{top:j,bottom:$,left:V,right:T}=i.current.getBoundingClientRect();O.nativeEvent.type!=="touchend"&&e.pauseOnHover&&O.clientX>=V&&O.clientX<=T&&O.clientY>=j&&O.clientY<=$?g():x()}function x(){n(!0)}function g(){n(!1)}function y(){s.didMove=!1,document.addEventListener("pointermove",E),document.addEventListener("pointerup",D)}function _(){document.removeEventListener("pointermove",E),document.removeEventListener("pointerup",D)}function E(O){let j=i.current;if(s.canDrag&&j){s.didMove=!0,t&&g(),e.draggableDirection==="x"?s.delta=O.clientX-s.start:s.delta=O.clientY-s.start,s.start!==O.clientX&&(s.canCloseOnClick=!1);let $=e.draggableDirection==="x"?`${s.delta}px, var(--y)`:`0, calc(${s.delta}px + var(--y))`;j.style.transform=`translate3d(${$},0)`,j.style.opacity=`${1-Math.abs(s.delta/s.removalDistance)}`}}function D(){_();let O=i.current;if(s.canDrag&&s.didMove&&O){if(s.canDrag=!1,Math.abs(s.delta)>s.removalDistance){a(!0),e.closeToast(!0),e.collapseAll();return}O.style.transition="transform 0.2s, opacity 0.2s",O.style.removeProperty("transform"),O.style.removeProperty("opacity")}}let R={onPointerDown:v,onPointerUp:S};return o&&l&&(R.onMouseEnter=g,e.stacked||(R.onMouseLeave=x)),f&&(R.onClick=O=>{c&&c(O),s.canCloseOnClick&&u(!0)}),{playToast:x,pauseToast:g,isRunning:t,preventExitTransition:r,toastRef:i,eventHandlers:R}}var nI=typeof window<"u"?C.useLayoutEffect:C.useEffect,Dg=({theme:e,type:t,isLoading:n,...r})=>Lt.createElement("svg",{viewBox:"0 0 24 24",width:"100%",height:"100%",fill:e==="colored"?"currentColor":`var(--toastify-icon-color-${t})`,...r});function rI(e){return Lt.createElement(Dg,{...e},Lt.createElement("path",{d:"M23.32 17.191L15.438 2.184C14.728.833 13.416 0 11.996 0c-1.42 0-2.733.833-3.443 2.184L.533 17.448a4.744 4.744 0 000 4.368C1.243 23.167 2.555 24 3.975 24h16.05C22.22 24 24 22.044 24 19.632c0-.904-.251-1.746-.68-2.44zm-9.622 1.46c0 1.033-.724 1.823-1.698 1.823s-1.698-.79-1.698-1.822v-.043c0-1.028.724-1.822 1.698-1.822s1.698.79 1.698 1.822v.043zm.039-12.285l-.84 8.06c-.057.581-.408.943-.897.943-.49 0-.84-.367-.896-.942l-.84-8.065c-.057-.624.25-1.095.779-1.095h1.91c.528.005.84.476.784 1.1z"}))}function aI(e){return Lt.createElement(Dg,{...e},Lt.createElement("path",{d:"M12 0a12 12 0 1012 12A12.013 12.013 0 0012 0zm.25 5a1.5 1.5 0 11-1.5 1.5 1.5 1.5 0 011.5-1.5zm2.25 13.5h-4a1 1 0 010-2h.75a.25.25 0 00.25-.25v-4.5a.25.25 0 00-.25-.25h-.75a1 1 0 010-2h1a2 2 0 012 2v4.75a.25.25 0 00.25.25h.75a1 1 0 110 2z"}))}function iI(e){return Lt.createElement(Dg,{...e},Lt.createElement("path",{d:"M12 0a12 12 0 1012 12A12.014 12.014 0 0012 0zm6.927 8.2l-6.845 9.289a1.011 1.011 0 01-1.43.188l-4.888-3.908a1 1 0 111.25-1.562l4.076 3.261 6.227-8.451a1 1 0 111.61 1.183z"}))}function sI(e){return Lt.createElement(Dg,{...e},Lt.createElement("path",{d:"M11.983 0a12.206 12.206 0 00-8.51 3.653A11.8 11.8 0 000 12.207 11.779 11.779 0 0011.8 24h.214A12.111 12.111 0 0024 11.791 11.766 11.766 0 0011.983 0zM10.5 16.542a1.476 1.476 0 011.449-1.53h.027a1.527 1.527 0 011.523 1.47 1.475 1.475 0 01-1.449 1.53h-.027a1.529 1.529 0 01-1.523-1.47zM11 12.5v-6a1 1 0 012 0v6a1 1 0 11-2 0z"}))}function oI(){return Lt.createElement("div",{className:"Toastify__spinner"})}var Dv={info:aI,warning:rI,success:iI,error:sI,spinner:oI},lI=e=>e in Dv;function uI({theme:e,type:t,isLoading:n,icon:r}){let a=null,i={theme:e,type:t};return r===!1||(js(r)?a=r({...i,isLoading:n}):C.isValidElement(r)?a=C.cloneElement(r,i):n?a=Dv.spinner():lI(t)&&(a=Dv[t](i))),a}var cI=e=>{let{isRunning:t,preventExitTransition:n,toastRef:r,eventHandlers:a,playToast:i}=tI(e),{closeButton:s,children:o,autoClose:l,onClick:u,type:c,hideProgressBar:f,closeToast:p,transition:d,position:v,className:S,style:x,progressClassName:g,updateId:y,role:_,progress:E,rtl:D,toastId:R,deleteToast:O,isIn:j,isLoading:$,closeOnClick:V,theme:T,ariaLabel:P}=e,q=gl("Toastify__toast",`Toastify__toast-theme--${T}`,`Toastify__toast--${c}`,{"Toastify__toast--rtl":D},{"Toastify__toast--close-on-click":V}),Y=js(S)?S({rtl:D,position:v,type:c,defaultClassName:q}):gl(q,S),se=uI(e),G=!!E||!l,ne={closeToast:p,type:c,theme:T},Q=null;return s===!1||(js(s)?Q=s(ne):C.isValidElement(s)?Q=C.cloneElement(s,ne):Q=BP(ne)),Lt.createElement(d,{isIn:j,done:O,position:v,preventExitTransition:n,nodeRef:r,playToast:i},Lt.createElement("div",{id:R,tabIndex:0,onClick:u,"data-in":j,className:Y,...a,style:x,ref:r,...j&&{role:_,"aria-label":P}},se!=null&&Lt.createElement("div",{className:gl("Toastify__toast-icon",{"Toastify--animate-icon Toastify__zoom-enter":!$})},se),KA(o,e,!t),Q,!e.customProgressBar&&Lt.createElement($P,{...y&&!G?{key:`p-${y}`}:{},rtl:D,theme:T,delay:l,isRunning:t,isIn:j,closeToast:p,hide:f,type:c,className:g,controlledProgress:G,progress:E||0})))},fI=(e,t=!1)=>({enter:`Toastify--animate Toastify__${e}-enter`,exit:`Toastify--animate Toastify__${e}-exit`,appendPosition:t}),dI=FP(fI("bounce",!0)),hI={position:"top-right",transition:dI,autoClose:5e3,closeButton:!0,pauseOnHover:!0,pauseOnFocusLoss:!0,draggable:"touch",draggablePercent:80,draggableDirection:"x",role:"alert",theme:"light","aria-label":"Notifications Alt+T",hotKeys:e=>e.altKey&&e.code==="KeyT"};function pI(e){let t={...hI,...e},n=e.stacked,[r,a]=C.useState(!0),i=C.useRef(null),{getToastToRender:s,isToastActive:o,count:l}=eI(t),{className:u,style:c,rtl:f,containerId:p,hotKeys:d}=t;function v(x){let g=gl("Toastify__toast-container",`Toastify__toast-container--${x}`,{"Toastify__toast-container--rtl":f});return js(u)?u({position:x,rtl:f,defaultClassName:g}):gl(g,jv(u))}function S(){n&&(a(!0),Xt.play())}return nI(()=>{var x;if(n){let g=i.current.querySelectorAll('[data-in="true"]'),y=12,_=(x=t.position)==null?void 0:x.includes("top"),E=0,D=0;Array.from(g).reverse().forEach((R,O)=>{let j=R;j.classList.add("Toastify__toast--stacked"),O>0&&(j.dataset.collapsed=`${r}`),j.dataset.pos||(j.dataset.pos=_?"top":"bot");let $=E*(r?.2:1)+(r?0:y*O);j.style.setProperty("--y",`${_?$:$*-1}px`),j.style.setProperty("--g",`${y}`),j.style.setProperty("--s",`${1-(r?D:0)}`),E+=j.offsetHeight,D+=.025})}},[r,l,n]),C.useEffect(()=>{function x(g){var y;let _=i.current;d(g)&&((y=_.querySelector('[tabIndex="0"]'))==null||y.focus(),a(!1),Xt.pause()),g.key==="Escape"&&(document.activeElement===_||_!=null&&_.contains(document.activeElement))&&(a(!0),Xt.play())}return document.addEventListener("keydown",x),()=>{document.removeEventListener("keydown",x)}},[d]),Lt.createElement("section",{ref:i,className:"Toastify",id:p,onMouseEnter:()=>{n&&(a(!1),Xt.pause())},onMouseLeave:S,"aria-live":"polite","aria-atomic":"false","aria-relevant":"additions text","aria-label":t["aria-label"]},s((x,g)=>{let y=g.length?{...c}:{...c,pointerEvents:"none"};return Lt.createElement("div",{tabIndex:-1,className:v(x),"data-stacked":n,style:y,key:`c-${x}`},g.map(({content:_,props:E})=>Lt.createElement(cI,{...E,stacked:n,collapseAll:S,isIn:o(E.toastId,E.containerId),key:`t-${E.key}`},_)))}))}const Ht=(e,t)=>{switch(console.log("showToast called with:",e,t),e){case"success":Xt.success(t,{position:"bottom-left",autoClose:5e3});break;case"warning":Xt.warn(t,{position:"bottom-left",autoClose:5e3});break;case"error":Xt.error(t,{position:"bottom-left",autoClose:5e3});break;default:Xt.info(t,{position:"bottom-left",autoClose:5e3})}},nN=async e=>{try{const{data:t,error:n}=await Ke.from("mosque_t").select("*").eq("organisasjonsnummer",e).single();if(n||!t)throw new Error("Mosque not found");return t}catch(t){return console.log("Error fetching mosque data: ",t),null}},mI=async e=>{try{const{data:t,error:n}=await Ke.from("location_postnumber").select("post_no").eq("location_iso",e);if(n)return console.error(`Error fetching post ids in location ${e}:`,n.message),Ht("error",n.message),null;if(!t||t.length===0)return[];const r=t.map(c=>c.post_no),{data:a,error:i}=await Ke.from("mosque_t").select("organisasjonsnummer, reg_navn, org_name2, post_no, reg_postnummer").order("org_name2");if(i)return console.error("Error fetching mosques:",i.message),Ht("error",i.message),null;const s=a.filter(c=>r.includes(c.reg_postnummer||c.post_no)),o=a.filter(c=>!r.includes(c.reg_postnummer||c.post_no)),l=s.map(c=>({id:c.organisasjonsnummer,name:c.reg_navn||c.org_name2})),u=o.map(c=>({id:c.organisasjonsnummer,name:c.reg_navn||c.org_name2}));return[...l,{name:"Other Masjids",id:"",isDisabled:!0},...u]}catch(t){return console.error("Some error occurred while fetching mosques in a location:",t.message),Ht("error",t.message),null}},gI=async e=>{try{const{data:t,error:n}=await Ke.from("mosque_t").select("org_name2, reg_navn").eq("organisasjonsnummer",e).single();if(n)throw n;return{value:e,label:t.org_name2||t.reg_navn}}catch(t){console.log(t)}};function Hd(e){const[t,n]=C.useState(""),[r,a]=C.useState(""),[i,s]=C.useState(""),[o,l]=C.useState(""),[u,c]=C.useState(""),[f,p]=C.useState(""),[d,v]=C.useState(""),[S,x]=C.useState(!0);return C.useEffect(()=>{if(!e){x(!1);return}x(!0);const g=async()=>{if(!navigator.onLine){const _=await d4(e);if(_){n(_.org_name2||_.reg_navn||""),a(_.logo||""),s(_.reg_adresse||_.address||""),l(_.post_name||""),c(_.contact_phone||_.reg_mobil||""),p(_.contact_email||""),v(_.org_info||""),x(!1);return}}try{const _=await nN(e);if(!_)n(""),a(""),c(""),p("");else{if(n(_.org_name2||_.reg_navn||""),s(_.reg_adresse||_.address||""),c(_.reg_mobil||_.contact_phone||""),p(_.reg_epostadresse||_.contact_email||""),v(_.org_info||""),_.logo)a(_.logo);else{const{data:R,error:O}=await Ke.from("mosque_t").select("logo").eq("organisasjonsnummer",982842840).single();if(O)throw Error(O.message);a(R.logo)}const{data:E,error:D}=await Ke.from("location_postnumber").select("post_name").eq("post_no",_.reg_postnummer||_.post_no).single();if(D){console.error("Error fetching post info:",D),Ht("error",`Error fetching post info: ${D.message}`);return}else l(E.post_name);await RP(e,{..._,postData:E})}}catch{const E=await d4(e);E?(n(E.org_name2||""),a(E.logo||""),s(E.reg_adresse||E.address||""),l(E.post_name||""),c(E.reg_mobil||E.contact_phone||""),p(E.contact_email||""),v(E.org_info||"")):(n(""),a(""),s(""),l(""),c(""),p(""),v(""))}finally{x(!1)}};g();const y=Ke.channel("masjid_info_changes").on("postgres_changes",{event:"*",schema:"public",table:"mosque_t",filter:`organisasjonsnummer=eq.${e}`},()=>{g()}).subscribe();return()=>{Ke.removeChannel(y)}},[e]),{masjidName:t,masjidLogo:r,masjidAddress:i,masjidPostName:o,masjidContact:u,masjidEmail:f,masjidInfo:d,loading:S}}function Hi({hijriDayObj:e,language:t="en",t:n,hijriMonthNames:r}){if(!e)return console.warn("formatHijriDate: hijriDayObj is null",{language:t,t:n}),"";const{hijri_date_day:a,hijri_date_month:i,hijri_date_year:s}=e;let o="";return o=r[i-1]||"",t==="ar"?`${s}-${o}-${a}`:`${a}-${o}-${s}`}const rN="hijri-date-db",Dm="hijri_dates";async function xs(e){return await(await $n(rN,1,{upgrade(n){n.createObjectStore(Dm)}})).get(Dm,e)}async function Rg(e,t){await(await $n(rN,1,{upgrade(r){r.createObjectStore(Dm)}})).put(Dm,t,e)}async function Mg(e,t){try{const{data:n,error:r}=await Ke.from("hijri_dates").select("gregorian_date, hijri_date_day, hijri_date_month, hijri_date_year").gte("gregorian_date",e).lte("gregorian_date",t);if(r)throw new Error(r.message);const a=new Map;return(n||[]).forEach(i=>{a.set(i.gregorian_date,{hijri_date_day:i.hijri_date_day,hijri_date_month:i.hijri_date_month,hijri_date_year:i.hijri_date_year})}),a}catch(n){return console.error("Error fetching all Hijri dates:",n),Ht("error","Failed to load Hijri dates"),new Map}}const vI=async e=>{try{const t=new Date,n=t.toLocaleDateString("en-CA"),r=new Date(t);r.setFullYear(r.getFullYear()+1),r.setDate(r.getDate()-1);const a=r.toLocaleDateString("en-CA",{timeZone:"Europe/Oslo"}),i={en:"special_date_en",no:"special_date_no",ar:"special_date_ar"},s=i[e]??i.en,{data:o,error:l}=await Ke.from("hijri_dates").select(`${s}, gregorian_date`).gte("gregorian_date",n).lte("gregorian_date",a).not(s,"is",null);if(l)throw l;return o.map(u=>({date:u.gregorian_date,description:u[s],formatted:new Date(u.gregorian_date).toLocaleDateString("en-US",{month:"long",day:"numeric",timeZone:"Europe/Oslo"})})).sort((u,c)=>new Date(u.date).getTime()-new Date(c.date).getTime())}catch(t){return Ht("error",t.message||"Failed to load special dates"),[]}},aN=async()=>{try{const{data:e,error:t}=await Ke.from("hijri_month").select("name_long").order("hijri_date_month");if(t)throw t;return e?e.map(n=>n.name_long):[]}catch(e){return console.error(e),Ht("error",`Error fetching hijri month names: ${e}`),[]}};let ip=null,lu=null;function kg(){const[e,t]=C.useState(()=>ip||[]);return C.useEffect(()=>{if(ip){t(ip);return}if(lu){lu.then(n=>{t(n)});return}lu=aN(),lu.then(n=>{ip=n,t(n),lu=null}).catch(n=>{console.error("Error fetching Hijri month names:",n),lu=null})},[]),e}const iN=({date:e,color:t,isLobby:n})=>{const{i18n:r,t:a}=Dn(),i=r.language||"en",{darkMode:s}=or(),o=kg(),[l,u]=C.useState(()=>new Date(e).toLocaleDateString(i==="no"?"nb-NO":"en-IN",{year:"numeric",month:"long",day:"numeric"}));C.useEffect(()=>{const p=new Date(e);u(p.toLocaleDateString(i==="no"?"nb-NO":"en-IN",{year:"numeric",month:"long",day:"numeric"}))},[e,i]);const[c,f]=C.useState(null);return C.useEffect(()=>{(async()=>{if(e){if(!navigator.onLine){const d=await xs(e);if(d){f(d);return}}try{const{data:d,error:v}=await Ke.from("hijri_dates").select("hijri_date_day, hijri_date_month, hijri_date_year").eq("gregorian_date",e).maybeSingle();if(v){console.error("Error fetching hijri date:",v),Ht("error",`Error fetching hijri date: ${v.message}`);return}if(!d){console.warn(`No hijri date found for gregorian date: ${e}`);const S=await xs(e);S&&f(S);return}f(d),await Rg(e,d)}catch(d){const v=await xs(e);v&&f(v),console.error(d)}}})()},[e]),b.jsxs("div",{className:`mt- text-base font-bold ${n?"sm:text-xl lg:text-2xl":"sm:mt-4 sm:text-2xl lg:text-3xl text-center"}`,style:{color:s?"#DDF4E7":t},children:[c&&o.length>0?Hi({hijriDayObj:c,language:i,t:a,hijriMonthNames:o}):" ",n?" | ":b.jsx("br",{}),l]})},Vd=({nr:e,textColor:t,orgNr:n,isLobby:r,date:a,isDefault:i})=>{const{org_nr:s}=Cn(),{darkMode:o}=or(),{masjidName:l,masjidLogo:u,masjidInfo:c,loading:f}=Hd(s||n),p=o?e===1?"#F2E7D5":e===2?"#F5C45E":"#DDF4E7":i&&e===2?"#F5C45E":t;return f?b.jsx("div",{children:b.jsx("h1",{className:"text-base sm:text-lg md:text-xl",children:"Logo"})}):b.jsxs("div",{className:`flex mt-2 flex-row gap-x-4 items-center ${e===3?"font-DM":"font-montserrat"}`,style:{color:p},children:[b.jsx("img",{src:u!=null&&u.startsWith("http")?u:u?`data:image/png;base64,${u}`:"/default-logo.png",alt:"logo",className:"block h-12 sm:h-14 2xl:h-16 w-auto max-w-[50%] sm:max-w-[40%]"}),b.jsxs("div",{className:"flex flex-col 2xl:gap-2",children:[b.jsx("h2",{className:"font-bold text-lg md:text-xl lg:text-3xl",children:l}),!r&&b.jsx("h4",{className:"text-xl font-medium",style:{color:o?e===1?"#F2E7D5":e===2?"#F5C45E":"#DDF4E7":i?e===1?"#0D0E0E":"":t},children:c}),e===3&&r&&b.jsx(iN,{date:a,color:p,isLobby:!0})]})]})},M5=()=>b.jsxs("div",{className:"flex flex-col justify-center items-center gap-10",children:[b.jsx("h2",{className:"text-5xl font-bold text-red-600 text-center",children:"Please switch off your mobile phones"}),b.jsx("img",{src:"/img/instruction.jpg",alt:"",className:"h-120"})]});function k5(e){const[t,n]=C.useState(null),[r,a]=C.useState(null);return C.useEffect(()=>{if(!e||e.length===0)return;let i=null;const s=120,o=()=>{const l=new Date,u=l.getHours()*3600+l.getMinutes()*60+l.getSeconds();console.log("useIqamahCheck - Checking time:",l.toISOString());let c=null,f=1/0;for(const p of e){if(!(p!=null&&p.iqamah)||!(p!=null&&p.name))continue;const[d,v]=p.iqamah.split(":").map(Number);if(isNaN(d)||isNaN(v))continue;const x=d*3600+v*60-u;if(x>=0&&x<f)f=x,c=p;else if(x>=-120&&x<0){n(s-Math.abs(x)),a({iqamah:p.iqamah,name:p.name}),console.log("useIqamahCheck - Iqamah found:",p,"Duration:",s-Math.abs(x));return}}c&&(console.log("Scheduling iqamah for:",c,"in",f,"seconds"),i=setTimeout(()=>{n(s),a({iqamah:c.iqamah,name:c.name}),console.log("useIqamahCheck - Iqamah triggered:",c),i=setTimeout(()=>{n(null),a(null),console.log("useIqamahCheck - Iqamah window ended, rescheduling"),o()},s*1e3)},f*1e3))};return o(),()=>{i&&clearTimeout(i)}},[e]),{iqamahDuration:t,currentPrayer:r}}const yI=({prayerTimes:e,extraInfo:t,textColor:n="#53452E",prayerTimesColor:r,extraInfoColor:a,isDefault:i})=>{const[s,o]=C.useState(null),{org_nr:l}=Cn(),{iqamahDuration:u,currentPrayer:c}=k5(e);C.useEffect(()=>{const p=setInterval(()=>{o(()=>{const d=new Date,v=d.getHours()*3600+d.getMinutes()*60+d.getSeconds();let S=1/0;for(const x of e){const g=x==null?void 0:x.iqamah;if(!g)continue;const[y,_]=g.split(":").map(Number);if(Number.isNaN(y)||Number.isNaN(_))continue;const D=y*3600+_*60-v;D>0&&D<S&&(S=D)}return S===1/0?null:S})},1e3);return()=>clearInterval(p)},[e]);const f=s!==null&&s<=60&&s>0;return C.useEffect(()=>{if(u&&c&&l){const p=new URLSearchParams({name:c.name,iqamah:c.iqamah??"",duration:String(u)});window.location.href=`/${l}/masjid/iqamah?${p.toString()}`}},[u,c,l]),b.jsxs("div",{className:"flex flex-col h-full w-full px-6 py-8",children:[b.jsx("div",{className:"flex items-center gap-x-3 mb-6",children:b.jsx(Vd,{nr:1,textColor:n,isDefault:i})}),b.jsx("div",{className:"flex-1 min-h-0 flex flex-col justify-center",children:f?b.jsx(M5,{}):b.jsx(DP,{prayerTimes:e,extraInfo:t,prayerTimesColor:r,extraInfoColor:a,isDefault:i})})]})};function B1(e){if(!e||typeof e!="string"||!e.includes(":"))return null;const[t,n]=e.split(":").map(Number),r=new Date;return r.setHours(t,n,0,0),r}function $1(e){const t=Math.ceil(e/1e3),n=Math.floor(t/3600),r=Math.floor(t%3600/60),a=t%60;return{hours:n,minutes:r,seconds:a}}function Pg(e){var r;const t=new Date;for(let a=0;a<e.length;a++){if(e[a].name==="SUNRISE")continue;const i=e[a],s=B1(i.adhan),o=B1(i.iqamah);if(s&&t<s){const{hours:l,minutes:u,seconds:c}=$1(s.getTime()-t.getTime());return{label:`${i.name.charAt(0).toUpperCase()+i.name.slice(1).toLowerCase()} Adhan`,hours:l,minutes:u,seconds:c}}if(o&&s&&t>=s&&t<o){const{hours:l,minutes:u,seconds:c}=$1(o.getTime()-t.getTime());return{label:`${i.name.charAt(0).toUpperCase()+i.name.slice(1).toLowerCase()} Iqamah`,hours:l,minutes:u,seconds:c}}}const n=B1((r=e[0])==null?void 0:r.adhan);if(n){n.setDate(n.getDate()+1);const{hours:a,minutes:i,seconds:s}=$1(n.getTime()-t.getTime());return{label:"Fajr Adhan",hours:a,minutes:i,seconds:s}}return{label:"",hours:0,minutes:0,seconds:0}}function Ig(e){const t={};for(const n of e){const r=n.name.toLowerCase();["fajr","fajr end","dhuhr","asr","maghrib","isha"].includes(r)&&(t[r]=n.adhan)}return t}const bI={1:{light:{day:"#ECDCC3",dayOpacity:1,night:"#A5A6A5",nightOpacity:1,border:"#A08963",bg:"#DBDBDB",text:"#706D54",centerOuter:"#DBDBDB",centerMid:"#A08963",center:"#6D9886",handStart:"#6D9886",handEnd:"#A08963",shadow:"#000000",shadowOpacity:1},dark:{day:"#ECDCC3",dayOpacity:.75,night:"#4A4A49",nightOpacity:1,border:"#A08963",bg:"#1E1E1E",text:"#F2E7D5",centerOuter:"#1E1E1E",centerMid:"#DBDBDB",center:"#6D9886",handStart:"#6D9886",handEnd:"#F2E7D5",shadow:"#DBDBDB",shadowOpacity:1}},2:{light:{day:"#E78B48",dayOpacity:.5,night:"#102E50",nightOpacity:.5,border:"#BE3D2A",bg:"#F5C45E",text:"#102E50",centerOuter:"#F5C45E",centerMid:"#BE3D2A",center:"#E78B48",shadow:"#BE3D2A",shadowOpacity:.5},dark:{day:"#E78B48",dayOpacity:.5,night:"#03070C",nightOpacity:.5,border:"#BE3D2A",bg:"#102E50",text:"#F5C45E",centerOuter:"#102E50",centerMid:"#F5C45E",center:"#E78B48",shadow:"#F5C45E",shadowOpacity:.2}}},uu=e=>{if(typeof e!="string"||!e.includes(":"))return 0;const[t,n]=e.split(":").map(Number);return t+n/60};function os(e){return(e%24*15+180)%360}function oo(e,t,n,r){const a=(r-90)*Math.PI/180;return{x:e+n*Math.cos(a),y:t+n*Math.sin(a)}}function p4(e,t,n,r,a){r=r%360,a=a%360,a<=r&&(a+=360);const i=oo(e,t,n,a),s=oo(e,t,n,r),o=a-r<=180?"0":"1";return["M",i.x,i.y,"A",n,n,0,o,0,s.x,s.y,"L",e,t,"Z"].join(" ")}function wI(e,t,n){const r=Math.floor(t*60),i=e.map((s,o)=>({p:s,i:o})).filter(s=>s.p.name!==n).map(s=>s.i).find(s=>Math.floor(e[s].time*60)>r);return e.map((s,o)=>{if(s.name===n)return"none";const l=Math.floor(s.time*60);return o===i?"next":l<r?"past":"future"})}const Fg=({width:e,height:t,prayerTimes:n,theme:r})=>{const{t:a}=Dn(),{darkMode:i}=or(),s=i?"dark":"light",o=bI[r][s],[l,u]=C.useState(()=>{const x=new Date;return x.getHours()+x.getMinutes()/60+x.getSeconds()/3600});C.useEffect(()=>{const x=setInterval(()=>{const g=new Date;u(g.getHours()+g.getMinutes()/60+g.getSeconds()/3600)},1e3);return()=>clearInterval(x)},[]);const c={fajr:uu(n.fajr),sunrise:uu(n["fajr end"]),dhuhr:uu(n.dhuhr),asr:uu(n.asr),maghrib:uu(n.maghrib),isha:uu(n.isha)},f=[{startLabel:"Dhuhr",endLabel:"",start:c.dhuhr,end:c.asr-.01,color:"#B7CD8E",textPosition:["start","end"],textColor:"#ffffff"},{startLabel:"1X ",endLabel:null,start:c.asr,end:c.asr+20/60,color:"#FFDF77",textPosition:["start","end"],textColor:"#ffffff"},{startLabel:"50%",endLabel:null,start:c.asr+20/60,end:c.asr+40/60,color:"E1B936",textPosition:["start","end"],textColor:"#ffffff"},{startLabel:"2X",endLabel:"Asr end",start:c.asr+40/60,end:c.maghrib-10/60,color:"#B38F17",textPosition:["start","end"],textColor:"#ffffff"},{startLabel:null,endLabel:null,start:c.maghrib-20/60,end:c.maghrib-1/60,color:"#C53434",textPosition:["start","end"],textColor:"#ffffff"},{startLabel:"Maghrib",endLabel:"Dusk",start:c.maghrib,end:c.isha-1/60,color:"#D8702B",textPosition:["start","end"],textColor:"#ffffff"},{startLabel:"Isha",endLabel:null,start:c.isha,end:23.9833,color:"#254465",textPosition:["start","end"],textColor:"#ffffff"},{startLabel:"Thahajjud",endLabel:"Thahajjud end",start:0,end:c.fajr,color:"#232E3A",textPosition:["start","end"],textColor:"#ffffff"},{startLabel:"Fajr",endLabel:"Fajr end",start:c.fajr,end:c.sunrise-1/60,color:"#D8702B",textPosition:["start","end"],textColor:"#ffffff"},{startLabel:null,endLabel:null,start:c.sunrise,end:c.sunrise+20/60,color:"#C53434",textPosition:["start","end"],textColor:"#ffffff"},{startLabel:"Dhuha",endLabel:"Dhuha end",start:c.sunrise+20/60,end:c.dhuhr-20/60,color:"#E8C85E",textPosition:["start","end"],textColor:"#ffffff"},{startLabel:null,endLabel:null,start:c.dhuhr-20/60,end:c.dhuhr,color:"#C53434",textPosition:["start","end"],textColor:"#ffffff"}],p=[{name:"FAJR",time:c.fajr},{name:a("SUNRISE"),time:c.sunrise},{name:"DHUHR",time:c.dhuhr},{name:"ASR",time:c.asr},{name:"MAGHRIB",time:c.maghrib},{name:"ISHA",time:c.isha}],d=wI(p,l,a("SUNRISE")),v=180,S=os(l);return b.jsxs("svg",{width:e||"100%",height:t||"100%",viewBox:"0 0 400 400",className:`rounded-full shadow-lg font-chakra font-light text-${o.text}`,children:[b.jsx("defs",{children:b.jsx("filter",{id:"inner-shadow",x:"-10%",y:"-10%",width:"120%",height:"120%",children:b.jsx("feGaussianBlur",{stdDeviation:"7"})})}),b.jsx("circle",{cx:200,cy:200,r:200,fill:o.border}),b.jsx("circle",{cx:200,cy:200,r:190,fill:o.bg}),b.jsx("path",{d:`
69
+ M 200,200
70
+ m -190,0
71
+ a 190,190 0 1,0 380,0
72
+ a 190,190 0 1,0 -380,0
73
+ M 200,200
74
+ m -183,0
75
+ a 183,183 0 1,1 366,0
76
+ a 183,183 0 1,1 -366,0
77
+ Z
78
+ `,fill:o.shadow,opacity:o.shadowOpacity,filter:"url(#inner-shadow)"}),f.map((x,g)=>{const R=os(x.start);let O=os(x.end);O<=R&&(O+=360);const j=O-R<=180?"0":"1",$=se=>(se-90)*(Math.PI/180),V={x:200+190*Math.cos($(R)),y:200+190*Math.sin($(R))},T={x:200+190*Math.cos($(O)),y:200+190*Math.sin($(O))},P={x:200+172*Math.cos($(O)),y:200+172*Math.sin($(O))},q={x:200+172*Math.cos($(R)),y:200+172*Math.sin($(R))},Y=[`M ${V.x} ${V.y}`,`A 190 190 0 ${j} 1 ${T.x} ${T.y}`,`L ${P.x} ${P.y}`,`A 172 172 0 ${j} 0 ${q.x} ${q.y}`,"Z"].join(" ");return b.jsxs("g",{children:[b.jsx("path",{id:`arcPath-${g}`,d:Y,fill:x.color,opacity:x.startLabel||x.endLabel?.5:1}),b.jsx("path",{id:`textArc-${g}`,d:`M ${V.x} ${V.y} A 190 190 0 ${j} 1 ${T.x} ${T.y}`,fill:"none",stroke:"none"}),x.startLabel&&b.jsx("text",{fontSize:10,dx:1,dy:10,fill:"#ffffff",children:b.jsx("textPath",{href:`#textArc-${g}`,startOffset:"0%",textAnchor:"start",dominantBaseline:"middle",children:x.startLabel})})]},`seg-${g}`)}),b.jsx("path",{d:p4(200,200,135,os(c.sunrise),os(c.maghrib)),fill:o.day,opacity:o.dayOpacity}),b.jsx("path",{d:p4(200,200,135,os(c.maghrib),os(c.sunrise+24)),fill:o.night,opacity:o.nightOpacity}),Array.from({length:24},(x,g)=>{if(g===0||g===6||g===12||g===18)return null;const y=os(g),_=v-30,E=oo(200,200,_,y);return b.jsx("text",{x:E.x,y:E.y+8,fontSize:18,fill:o.text,textAnchor:"middle",children:g},g)}),r===1&&b.jsx("defs",{children:b.jsxs("linearGradient",{id:"clockHandGradient",x1:"0%",y1:"0%",x2:"100%",y2:"0%",children:[b.jsx("stop",{offset:"0%",stopColor:o.handStart}),b.jsx("stop",{offset:"100%",stopColor:o.handEnd})]})}),b.jsxs("g",{children:[b.jsx("circle",{cx:200,cy:200,r:22,fill:o.centerOuter}),b.jsx("circle",{cx:200,cy:200,r:14,fill:o.centerMid}),b.jsx("line",{x1:200,y1:200,x2:oo(200,200,120,S).x,y2:oo(200,200,120,S).y,stroke:r===1?"url(#clockHandGradient)":o.centerMid,strokeWidth:14,strokeLinecap:"round"}),b.jsx("circle",{cx:200,cy:200,r:6,fill:o.center})]}),p.map((x,g)=>{if(x.name===a("SUNRISE"))return null;const y=os(x.time),_=70,E=oo(200,200,_,y),D=_+30,R=v-50,O=oo(200,200,D,y),j=oo(200,200,R,y),$=d[g],V=o.text,T=$==="past"?.5:1,P=$==="next"?"bold":"normal";let q=y;return x.name==="FAJR"?q+=90:q+=-90,b.jsxs(Lt.Fragment,{children:[b.jsx("line",{x1:O.x,y1:O.y,x2:j.x,y2:j.y,stroke:"#0000004D",strokeWidth:1}),b.jsx("text",{x:E.x,y:E.y,textAnchor:"middle",dominantBaseline:"middle",fontSize:x.name===a("SUNRISE")?10:18,fontWeight:P,fill:V,opacity:T,transform:`rotate(${q} ${E.x} ${E.y})`,children:x.name})]},x.name)}),b.jsx("text",{x:"200",y:"60",textAnchor:"middle",fontSize:40,fill:o.text,fontWeight:"",children:"12"}),b.jsx("text",{x:"200",y:"368",textAnchor:"middle",fontSize:40,fill:o.text,fontWeight:"",children:"0"}),b.jsx("text",{x:"42",y:"210",textAnchor:"middle",fontSize:40,fill:o.text,fontWeight:"",children:"6"}),b.jsx("text",{x:"352",y:"210",textAnchor:"middle",fontSize:40,fill:o.text,fontWeight:"",children:"18"})]})},xI=({prayerTimes:e,date:t})=>{const{i18n:n,t:r}=Dn(),a=n.language||"en",i=kg(),[s,o]=C.useState(()=>new Date().toLocaleTimeString([],{hour:"2-digit",minute:"2-digit",second:"2-digit",hour12:!1})),[l,u]=C.useState(()=>new Date(t).toLocaleDateString(a==="no"?"nb-NO":"en-IN",{year:"numeric",month:"long",day:"numeric"})),[c,f]=C.useState({label:"",hours:0,minutes:0,seconds:0});C.useEffect(()=>{const S=setInterval(()=>{o(new Date().toLocaleTimeString([],{hour:"2-digit",minute:"2-digit",second:"2-digit",hour12:!1}))},1e3);return()=>clearInterval(S)},[]),C.useEffect(()=>{const S=new Date(t);u(S.toLocaleDateString(a==="no"?"nb-NO":"en-IN",{year:"numeric",month:"long",day:"numeric"}))},[t,a]),C.useEffect(()=>{if(!e.length)return;function S(){f(Pg(e))}S();const x=setInterval(S,1e3);return()=>clearInterval(x)},[e]);const p=Ig(e),[d,v]=C.useState(null);return C.useEffect(()=>{(async()=>{if(t){if(!navigator.onLine){const x=await xs(t);if(x){v(x);return}}try{const{data:x,error:g}=await Ke.from("hijri_dates").select("hijri_date_day, hijri_date_month, hijri_date_year").eq("gregorian_date",t).single();if(g)throw new Error(g.message);if(!x)throw new Error("No corresponding hijri day found!");v(x),await Rg(t,x)}catch(x){const g=await xs(t);g&&v(g),console.log(x)}}})()},[t]),b.jsxs("div",{className:"font-chakra w-full h-full flex flex-col justify-center items-center text-center gap-4 p-4 dark:text-[#F2E7D5]",children:[b.jsxs("div",{className:"",children:[b.jsx("h2",{className:"font-bold text-2xl md:text-3xl lg:text-5xl mb-2",children:s}),b.jsxs("h4",{className:"font-semibold text-lg md:text-xl lg:text-2xl",children:[d&&i.length>0?Hi({hijriDayObj:d,language:a,t:r,hijriMonthNames:i}):" "," | ",l]})]}),b.jsx("div",{className:"w-full",children:b.jsx(Fg,{prayerTimes:p,theme:1})}),c&&c.label&&b.jsxs("div",{children:[b.jsxs("h2",{className:"font-semibold text-lg md:text-xl lg:text-2xl mb-1",children:[c.label," In"]}),b.jsx("h4",{className:"font-bold text-2xl md:text-3xl lg:text-5xl",children:`${String(c.hours).padStart(2,"0")}:${String(c.minutes).padStart(2,"0")}:${String(c.seconds).padStart(2,"0")}`})]})]})},SI=({date:e,textColor:t})=>{const{i18n:n,t:r}=Dn(),a=n.language||"en",{darkMode:i}=or(),s=kg(),[o,l]=C.useState(()=>new Date().toLocaleTimeString([],{hour:"2-digit",minute:"2-digit",second:"2-digit",hour12:!1})),[u,c]=C.useState(()=>new Date(e).toLocaleDateString(a==="no"?"nb-NO":"en-IN",{year:"numeric",month:"long",day:"numeric"}));C.useEffect(()=>{const d=setInterval(()=>{l(new Date().toLocaleTimeString([],{hour:"2-digit",minute:"2-digit",second:"2-digit",hour12:!1}))},1e3);return()=>clearInterval(d)},[]),C.useEffect(()=>{const d=new Date(e);c(d.toLocaleDateString(a==="no"?"nb-NO":"en-IN",{year:"numeric",month:"long",day:"numeric"}))},[e,a]);const[f,p]=C.useState(null);return C.useEffect(()=>{(async()=>{if(e){if(!navigator.onLine){const v=await xs(e);if(v){p(v);return}}try{const{data:v,error:S}=await Ke.from("hijri_dates").select("hijri_date_day, hijri_date_month, hijri_date_year").eq("gregorian_date",e).single();if(S)throw new Error(S.message);if(!v)throw new Error("No corresponding hijri day found!");p(v),await Rg(e,v)}catch(v){const S=await xs(e);S&&p(S),console.log(v)}}})()},[e]),b.jsxs("div",{className:"flex flex-col items-end font-montserrat pr-6",style:{color:i?"#F5C45E":t},children:[b.jsx("h2",{className:"font-bold text-lg md:text-xl lg:text-3xl",children:o}),b.jsxs("h4",{className:"font-semibold text-sm md:text-base lg:text-xl text-right",children:[f&&s.length>0?Hi({hijriDayObj:f,language:a,t:r,hijriMonthNames:s}):"-"," | ",u]})]})},sN=({name:e,arabic:t,adhan:n,iqamah:r,tomorrow:a,isNext:i,isPast:s,isSmall:o=!1,color:l,bg:u,isDefault:c,isPreview:f})=>{const{t:p}=Dn(),{darkMode:d}=or(),{org_nr:v}=Cn(),{language:S}=Ms(v||void 0),x=S==="ar";return b.jsxs("div",{className:`
79
+ w-${o?f?"w-40":"w-52":"w-55"} flex flex-col mx-auto
80
+ py-1 rounded-lg shadow-md text-center transition
81
+ ${i?"dark:border-4 dark:border-[#CE5C36]":""}
82
+ `,style:{backgroundColor:d?"#102E50":c?i?"#F5C45E":"#E78B48":u,color:d?"#F5C45E":l},children:[b.jsxs("div",{className:`flex justify-between font-montserrat font-semibold border-b-2 ${o?f?"px-0.5 py-1.5":"py-1.5 lg:text-2xl px-3":"py-2 text-2xl px-3"}`,children:[b.jsx("h2",{children:e}),b.jsx("h4",{className:"font-bold",children:t})]}),b.jsxs("div",{className:`flex flex-col px-3 font-montserrat font-medium ${o?"py-3 gap-2 lg:text-xl":"py-1.5 gap-1.5 text-lg lg:text-xl"}`,style:{direction:x?"rtl":"ltr"},children:[b.jsxs("div",{className:`flex justify-between ${s?"opacity-40":""}`,children:[b.jsx("h2",{children:p("ADHAN")}),b.jsx("h4",{className:"font-bold",children:n})]}),b.jsxs("div",{className:`flex justify-between ${s?"opacity-40":""}`,children:[b.jsx("h2",{children:p("IQAMAH")}),b.jsx("h4",{className:"font-bold",children:r})]}),b.jsxs("div",{className:"flex justify-between",children:[b.jsx("h2",{children:p("TOMORROW")}),b.jsx("h4",{className:"font-bold",children:a})]})]})]})},Zs=270,m4=400,g4=180*Math.PI/180,_I=0*Math.PI/180,AI=Array.from({length:5},(e,t)=>g4+(_I-g4)*t/4),v4=e=>{const[t,n]=e.split(":").map(Number);return t*60+n},NI=({prayerTimes:e,prayerTimesColor:t,isDefault:n})=>{const{org_nr:r}=Cn(),{iqamahDuration:a,currentPrayer:i}=k5(e),[s,o]=C.useState(null),l=new Date,u=l.getHours()*60+l.getMinutes(),c=e.findIndex(d=>v4(d.adhan)>u)-1,f=Ig(e);C.useEffect(()=>{if(a&&i&&r){const d=new URLSearchParams({name:i.name,iqamah:i.iqamah??"",duration:String(a)});window.location.href=`/${r}/masjid/iqamah?${d.toString()}`}},[a,i,r]),C.useEffect(()=>{const d=setInterval(()=>{const v=new Date,S=v.getHours()*3600+v.getMinutes()*60+v.getSeconds();let x=1/0;for(const g of e){const y=g==null?void 0:g.iqamah;if(!y)continue;const[_,E]=y.split(":").map(Number);if(Number.isNaN(_)||Number.isNaN(E))continue;const R=_*3600+E*60-S;R>0&&R<x&&(x=R)}o(x===1/0?null:x)},1e3);return()=>clearInterval(d)},[e]);const p=s!==null&&s<=60&&s>0;return b.jsx("div",{className:"flex flex-col items-center text-[#102E50] dark:text-[#F5C45E]",children:p?b.jsx("div",{className:"flex items-center justify-center",style:{width:2*Zs,height:2*Zs,minHeight:2*Zs},children:b.jsx(M5,{})}):b.jsxs("div",{className:"relative flex items-center",style:{width:2*Zs,height:2*Zs,minHeight:2*Zs},children:[b.jsx("div",{className:"absolute left-1/2 top-1/2 rounded-full w-100 h-100 flex items-center justify-center bg-white",style:{transform:"translate(-50%, -80%)",zIndex:10},children:b.jsx(Fg,{prayerTimes:f,theme:1})}),e.filter(d=>d.name!=="Fajr end").map((d,v)=>{const S=AI[v],x=Zs+m4*Math.cos(S),g=Zs+m4*Math.sin(S),y=v4(d.adhan),_=v===c,E=y<u;return b.jsx("div",{className:"absolute",style:{left:x,top:g,transform:"translate(-55%, -160%)",width:200,zIndex:20},children:b.jsx(sN,{name:d.name,arabic:d.arabic,adhan:d.adhan,iqamah:d.iqamah,tomorrow:d.tomorrow,isNext:_,isPast:E,color:t.text,bg:t.bg,isDefault:n})},v)})]})})},oN=({extraInfo:e,extraInfoColor:t,isLobby:n,isDefault:r,isPreview:a})=>{const{t:i}=Dn(),{darkMode:s}=or(),{org_nr:o}=Cn(),{language:l}=Ms(o||void 0),u=l==="ar",c=(f,p)=>{const d=Array.isArray(f.time)&&f.time.length>1,v=Array.isArray(f.time)?f.time:[f.time];return n&&d?b.jsxs("div",{className:"py-1 flex flex-col",children:[b.jsxs("div",{className:"flex justify-between gap-4",children:[b.jsxs("h4",{children:[i(f.label.toUpperCase())," :"]}),b.jsx("h4",{className:"font-bold",children:v[0]})]}),v.slice(1).map((S,x)=>b.jsx("div",{className:"flex justify-end",children:b.jsx("h4",{className:"font-bold",children:S})},x))]},p):b.jsxs("div",{className:"flex justify-between gap-6 py-1",children:[b.jsxs("h4",{className:"text-start w-32 font-semibold",children:[i(f.label.toUpperCase())," :"]}),b.jsxs("div",{className:"font-bold flex justify-between gap-6",children:[b.jsx("h4",{children:v[0]||""}),b.jsx("h4",{children:v[1]||""}),b.jsx("h4",{children:v[2]||""})]})]},p)};return b.jsx("div",{className:"w- flex flex-col gap-4",children:b.jsx("div",{className:`
83
+ ${n?a?"w-40 py-4 px-0.5":"w-52 py-4 text-base md:text-lg lg:text-xl":"min-w-70 max-w-110 min-h-20 flex justify-center"}
84
+ flex flex-col mx-auto py-1 px-4 rounded-lg shadow-md text-center transition
85
+ font-montserrat font-medium text-lg md:text-xl lg:text-2xl
86
+ `,style:{color:s?"#F5C45E":t.text,backgroundColor:s?"#03182D":r?"#DBDBDB":t.bg,direction:u?"rtl":"ltr"},children:e.filter(f=>f.label==="Eid"?Array.isArray(f.time)&&f.time.some(p=>p&&p.trim()!==""):!0).map((f,p)=>c(f,p))})})},EI=({prayerTimes:e,extraInfoColor:t})=>{const{t:n}=Dn(),[r,a]=C.useState({label:"",hours:0,minutes:0,seconds:0}),{darkMode:i}=or();return C.useEffect(()=>{if(!e.length)return;function s(){a(Pg(e))}s();const o=setInterval(s,1e3);return()=>clearInterval(o)},[e]),b.jsx("div",{className:`\r
87
+ w-75 h-30 flex flex-col mx-auto\r
88
+ p-2 px-6 rounded-lg shadow-md text-center transition\r
89
+ font-montserrat justify-center\r
90
+ `,style:{color:i?"#F5C45E":t.text,backgroundColor:i?"#03182D":t.bg},children:r&&r.label&&b.jsxs("div",{className:"",children:[b.jsxs("h2",{className:"font-semibold mb-2 text-base md:text-lg lg:text-2xl",children:[n(r.label)," In"]}),b.jsx("h4",{className:"font-bold text-xl md:text-2xl lg:text-4xl",children:`${String(r.hours).padStart(2,"0")}:${String(r.minutes).padStart(2,"0")}:${String(r.seconds).padStart(2,"0")}`})]})})},CI=({prayerTimes:e,color:t})=>{const[n,r]=C.useState({label:"",hours:0,minutes:0,seconds:0}),[a,i]=C.useState(0),{darkMode:s}=or();if(C.useEffect(()=>{if(!(e!=null&&e.length))return;function v(){var D,R,O;const x=Pg(e);r(x);const g=new Date,y=g.getHours()*60+g.getMinutes();let _=-1,E=0;for(let j=0;j<e.length;j++){const $=e[j],V=Number((D=$.iqamah)==null?void 0:D.split(":")[0])*60+Number((R=$.iqamah)==null?void 0:R.split(":")[1]),T=Number($.adhan.split(":")[0])*60+Number($.adhan.split(":")[1]);V?y>=V&&(_=j,E=V):y>=T&&(_=j,E=T)}if(_>=0){let j=0,$=-1;for(let V=_+1;V<e.length;V++){const T=e[V];if(T.adhan&&T.name!=="SUNRISE"){j=Number(T.adhan.split(":")[0])*60+Number(T.adhan.split(":")[1]),$=V;break}}if($===-1&&((O=e[0])!=null&&O.adhan)&&(j=Number(e[0].adhan.split(":")[0])*60+Number(e[0].adhan.split(":")[1])+24*60),j>0){const V=j-E,T=y-E,P=Math.max(0,Math.min(100,T/V*100));i(P)}}else i(0)}v();const S=setInterval(v,1e3);return()=>clearInterval(S)},[e]),!n.label)return null;const o=s?"#0C221F":"#67C090",l="#FFFFFF",u=500,c=280,f=220,p=40,d=40;return b.jsxs("div",{className:"flex flex-col items-center justify-center w-full text-white text-center font-ubuntu p-10",style:{color:s?"#DDF4E7":t},children:[b.jsxs("div",{className:"relative flex items-center justify-center",children:[b.jsxs("svg",{width:u,height:c,viewBox:`0 0 ${u} ${c}`,className:"absolute",style:{display:"block"},children:[b.jsx("path",{d:`M ${d} ${c-d} A ${f} ${f} 0 0 1 ${u-d} ${c-d}`,stroke:s?"#67C090":t,strokeWidth:p+2,fill:"none",strokeLinecap:"butt"}),b.jsx("path",{d:`M ${d} ${c-d} A ${f} ${f} 0 0 1 ${u-d} ${c-d}`,stroke:l,strokeWidth:p,fill:"none",strokeLinecap:"butt"}),b.jsx("path",{d:`M ${d} ${c-d} A ${f} ${f} 0 0 1 ${u-d} ${c-d}`,stroke:o,strokeWidth:p,fill:"none",strokeDasharray:Math.PI*f,strokeDashoffset:Math.PI*f-a/100*Math.PI*f,strokeLinecap:"butt",style:{transition:"stroke-dashoffset 1s linear"}})]}),b.jsx("div",{className:"mt-14 flex flex-col items-center z-10",children:b.jsxs("span",{className:"text-4xl font-bold",children:[n.label.includes("iqamah")?n.label:n.label.split(" ")[0],b.jsx("br",{})," in"]})})]}),b.jsx("div",{className:" text-6xl font-bold",children:`${String(n.hours).padStart(2,"0")}:${String(n.minutes).padStart(2,"0")}:${String(n.seconds).padStart(2,"0")}`})]})},cu=e=>e.toString().padStart(2,"0"),lN=({isLobby:e=!1,color:t="#0c1844"})=>{const{darkMode:n}=or(),[r,a]=C.useState(()=>{const i=new Date;return{hours:cu(i.getHours()),minutes:cu(i.getMinutes()),seconds:cu(i.getSeconds())}});return C.useEffect(()=>{const i=setInterval(()=>{const s=new Date;a({hours:cu(s.getHours()),minutes:cu(s.getMinutes()),seconds:cu(s.getSeconds())})},1e3);return()=>clearInterval(i)},[]),b.jsx("div",{className:`flex flex-col justify-center font-ubuntu ${e?"py-4 sm:py-6 2xl:py-8":""} w-full`,style:{color:n?"#DDF4E7":t},children:b.jsx("div",{className:"flex justify-center",children:b.jsxs("span",{className:`${e?"text-4xl sm:text-6xl lg:text-7xl":"text-5xl sm:text-7xl lg:text-[120px]"} font-extrabold leading-none`,children:[r.hours,":",r.minutes,":",r.seconds]})})})},LI=({prayerTimes:e,date:t,textColor:n,org_nr:r})=>b.jsxs("div",{className:"h-full flex flex-col px-4",children:[b.jsx(Vd,{nr:3,textColor:n,orgNr:r}),b.jsx("div",{className:"flex-1 flex items-center justify-center",children:b.jsxs("div",{className:"flex flex-col h-full justify-between py-10",children:[b.jsx(iN,{date:t,color:n}),b.jsx(lN,{color:n}),b.jsx(CI,{prayerTimes:e,color:n})]})})]}),uN=e=>{if(!e)return 1/0;const[t,n]=e.split(":").map(Number);return t*60+n};function jI(e){const t=new Date,n=t.getHours()*60+t.getMinutes();return e.findIndex(r=>r.adhan&&uN(r.adhan)>n)}const cN=({prayerTimes:e,extraInfo:t,prayerTimesColor:n,extraInfoColor:r,isLobby:a,isDefault:i})=>{const{org_nr:s}=Cn(),{iqamahDuration:o,currentPrayer:l}=k5(e),[u,c]=C.useState(null),{language:f}=Ms(s||void 0),p=f==="ar",{darkMode:d}=or(),{t:v}=Dn(),S=jI(e),x=new Date,g=x.getHours()*60+x.getMinutes();C.useEffect(()=>{if(o&&l&&s){const E=new URLSearchParams({name:l.name,iqamah:l.iqamah??"",duration:String(o)});window.location.href=`/${s}/masjid/iqamah?${E.toString()}`}},[o,l,s]),C.useEffect(()=>{const E=setInterval(()=>{const D=new Date,R=D.getHours()*3600+D.getMinutes()*60+D.getSeconds();let O=1/0;for(const j of e){const $=j==null?void 0:j.iqamah;if(!$)continue;const[V,T]=$.split(":").map(Number);if(Number.isNaN(V)||Number.isNaN(T))continue;const q=V*3600+T*60-R;q>0&&q<O&&(O=q)}c(O===1/0?null:O)},1e3);return()=>clearInterval(E)},[e]);const y=u!==null&&u<=60&&u>0,_=d?"#3F5551":n.bg;return b.jsx("div",{className:"font-ubuntu h-full w-full",children:y?b.jsx(M5,{}):b.jsx("div",{className:`w-full h-full ${a?"":"border-l-3"}`,style:{borderColor:d?"#0C221F":n.text,direction:p?"rtl":"ltr"},children:b.jsxs("table",{className:"w-full h-full min-h-0 text-center",children:[!a&&b.jsx("thead",{style:{color:d?"#DDF4E7":n.text},children:b.jsxs("tr",{className:"border-b-2",style:{borderColor:d?"#DDF4E7":n.text},children:[b.jsx("th",{className:`${a?"py-3":"py-4"} ${p?"text-right pr-6":"text-left pl-6"} text-2xl font-light`,style:{backgroundColor:d?"#3F5551":n.bg},children:v("PRAYER")}),b.jsx("th",{className:`${a?"py-3":"py-4"} text-2xl font-light`,style:{backgroundColor:d?"#3F5551":n.bg},children:v("ADHAN")}),b.jsx("th",{className:`${a?"py-3":"py-4"} text-2xl font-light`,style:{backgroundColor:d?"#3F5551":n.bg},children:v("IQAMAH")}),b.jsx("th",{className:`${a?"py-3":"py-4"} text-2xl font-light`,style:{backgroundColor:d?"#3F5551":n.bg},children:v("TOMORROW")})]})}),b.jsxs("tbody",{children:[e.map((E,D)=>{const R=D===S,O=uN(E.adhan)<g,j=R?d?"#F30303":"#E01919":d?"#DDF4E7":n.text;return b.jsxs("tr",{children:[b.jsx("td",{className:`font-bold text-3xl ${a?"py-1":"py-3"} ${p?"text-right pr-6":"text-left pl-6"}`,style:{color:j,backgroundColor:_},children:E.name==="Fajr end"?b.jsx(Ud,{color:"orange",size:28}):v(E.name.toUpperCase())}),b.jsx("td",{className:`font-bold text-3xl ${a?"py-1":"py-3"}`,style:{backgroundColor:_},children:b.jsx("span",{className:O?"opacity-40":"",style:{color:j},children:E.adhan})}),b.jsx("td",{className:`font-bold text-3xl ${a?"":"py-3"}`,style:{backgroundColor:_},children:E.iqamah&&b.jsx("span",{className:"p-3 w-[92px] h-full text-center rounded-lg",style:{backgroundColor:a?"":d?"#DDF4E7":i?"#124170":r.text,color:a?R?d?"#F30303":"#DE0404":d?"#D6EBDF":n.text:d?"#0C221F":i?"white":r.bg,fontWeight:"bold"},children:b.jsx("span",{className:O?"opacity-40":"opacity-100",children:E.iqamah})})}),b.jsx("td",{className:`font-extrabold text-3xl ${a?"py-1":"py-3"}`,style:{backgroundColor:_},children:b.jsx("span",{style:{color:j},children:E.tomorrow})})]},E.name||D)}),b.jsxs("tr",{className:`${a?"":"border-t-2"}`,style:{borderColor:d?"#DDF4E733":n.text+"33",color:d?"#DDF4E7":n.text},children:[b.jsx("td",{className:"pt-6",style:{backgroundColor:d?"#0C221F":n.bg}}),[1,2,3].map(E=>a?b.jsx("td",{className:"pt-6",style:{backgroundColor:d?"#0C221F":n.bg}},E):b.jsxs("td",{className:"text-xl font-medium pt-2",style:{backgroundColor:d?"#0C221F":n.bg,color:d?"#DDF4E7":n.text},children:[v("JAMAAT")," ",E]},E))]}),t.filter(E=>E.label==="Eid"?Array.isArray(E.time)&&E.time.some(D=>D&&D.trim()!==""):!0).map((E,D)=>b.jsxs("tr",{children:[b.jsx("td",{className:`font-bold text-3xl ${a?"py-1":"py-3"} w-65 ${p?"text-right pr-6":"text-left pl-6"}`,style:{color:d?"#DDF4E7":r.text,backgroundColor:d?"#0C221F":r.bg},children:v(E.label.toUpperCase())}),[0,1,2].map(R=>b.jsx("td",{className:"text-center",style:{backgroundColor:d?"#0C221F":r.bg},children:b.jsx("p",{className:"text-3xl font-bold",style:{color:d?"#DDF4E7":r.text,minWidth:"4rem"},children:Array.isArray(E.time)?E.time[R]||"":E.time||""})},R))]},E.label||D))]})]})})})},fN=C.createContext(null),U1={didCatch:!1,error:null};let TI=class extends C.Component{constructor(t){super(t),this.resetErrorBoundary=this.resetErrorBoundary.bind(this),this.state=U1}static getDerivedStateFromError(t){return{didCatch:!0,error:t}}resetErrorBoundary(...t){var r,a;const{error:n}=this.state;n!==null&&((a=(r=this.props).onReset)==null||a.call(r,{args:t,reason:"imperative-api"}),this.setState(U1))}componentDidCatch(t,n){var r,a;(a=(r=this.props).onError)==null||a.call(r,t,n)}componentDidUpdate(t,n){var i,s;const{didCatch:r}=this.state,{resetKeys:a}=this.props;r&&n.error!==null&&OI(t.resetKeys,a)&&((s=(i=this.props).onReset)==null||s.call(i,{next:a,prev:t.resetKeys,reason:"keys"}),this.setState(U1))}render(){const{children:t,fallbackRender:n,FallbackComponent:r,fallback:a}=this.props,{didCatch:i,error:s}=this.state;let o=t;if(i){const l={error:s,resetErrorBoundary:this.resetErrorBoundary};if(typeof n=="function")o=n(l);else if(r)o=C.createElement(r,l);else if(a!==void 0)o=a;else throw s}return C.createElement(fN.Provider,{value:{didCatch:i,error:s,resetErrorBoundary:this.resetErrorBoundary}},o)}};function OI(e=[],t=[]){return e.length!==t.length||e.some((n,r)=>!Object.is(n,t[r]))}function DI(e){return e!==null&&typeof e=="object"&&"didCatch"in e&&typeof e.didCatch=="boolean"&&"error"in e&&"resetErrorBoundary"in e&&typeof e.resetErrorBoundary=="function"}function RI(e){if(!DI(e))throw new Error("ErrorBoundaryContext not found")}function dN(){const e=C.useContext(fN);RI(e);const{error:t,resetErrorBoundary:n}=e,[r,a]=C.useState({error:null,hasError:!1}),i=C.useMemo(()=>({error:t,resetBoundary:()=>{n(),a({error:null,hasError:!1})},showBoundary:s=>a({error:s,hasError:!0})}),[t,n]);if(r.hasError)throw r.error;return i}const MI={BackgroundDiv:e=>{const{prayerTimes:t,prayerTimesWithSunrise:n,extraInfo:r,date:a,isDefault:i,textColor:s,prayerTimesColor:o,extraInfoColor:l,...u}=e;return b.jsx("div",{...u})},TimeTablePart:yI,ClockPart:xI,MasjidLogo:Vd,TimeAndDate:SI,ClockAndPrayers:NI,ExtraInfo:oN,CountdownBox:EI,DigitalClockPart:LI,TimeTable:cN};function Rv({components:e,componentProps:t}){const{darkMode:n}=or();return b.jsx(b.Fragment,{children:e.map((r,a)=>{var s,o,l,u,c,f,p,d;const i=MI[r.type];if(i){const v={...r.props||{},...t};let S={};return n?(s=r.style)!=null&&s.darkBackgroundImage?S={backgroundImage:`url(${"https://yhbphdjhoxovcxfoimdx.supabase.co/storage/v1/object/public"+r.style.darkBackgroundImage})`,backgroundSize:"cover",backgroundPosition:"center",backgroundRepeat:"no-repeat"}:(o=r.style)!=null&&o.backgroundColor?S={backgroundColor:r.style.backgroundColor}:(l=r.style)!=null&&l.darkBackground&&(S={backgroundColor:r.style.darkBackground}):(u=r.style)!=null&&u.backgroundColor?S={backgroundColor:r.style.backgroundColor}:(c=r.style)!=null&&c.background?S={backgroundColor:r.style.background}:(f=r.style)!=null&&f.backgroundImage?S={backgroundImage:`url(${"https://yhbphdjhoxovcxfoimdx.supabase.co/storage/v1/object/public"+r.style.backgroundImage})`,backgroundSize:"cover",backgroundPosition:"center",backgroundRepeat:"no-repeat",filter:(p=r.style)==null?void 0:p.backgroundBlur}:(d=r.style)!=null&&d.background&&(S={backgroundColor:r.style.background}),b.jsx("div",{className:r.className||"",style:S,children:b.jsx(i,{...v})},a)}else return r.components&&r.gridConfig?b.jsx("div",{className:r.gridConfig.className+" "+(r.className||""),children:b.jsx(Rv,{components:r.components,componentProps:t})},a):r.components?b.jsx("div",{className:r.className||"",children:b.jsx(Rv,{components:r.components,componentProps:t})},a):null})})}function kI({config:e,componentProps:t={}}){const[n,r]=C.useState("loading"),{error:a,showBoundary:i}=dN();return C.useEffect(()=>{if(!e)return;const s=setTimeout(()=>{n==="loading"&&(!e||!e.components||!e.gridConfig)&&i(new Error("No Prayer hall layout configuration Found"))},5e3);return()=>clearTimeout(s)},[e,i]),C.useEffect(()=>{e!=null&&e.components&&e.gridConfig&&r("ready")},[e]),a?null:n==="loading"?b.jsx("div",{className:"min-h-screen flex items-center justify-center p-8 bg-gradient-to-br from-emerald-50 to-teal-50",children:b.jsxs("div",{className:"text-center max-w-md",children:[b.jsx("div",{className:"w-16 h-16 border-4 border-emerald-200 border-t-emerald-600 rounded-full animate-spin mx-auto mb-4"}),b.jsx("h2",{className:"text-xl font-semibold text-gray-900 mb-2",children:"Loading prayer hall..."}),b.jsx("p",{className:"text-gray-600",children:"Preparing prayer space"})]})}):b.jsx("div",{className:e.gridConfig.className||"",style:e.gridConfig.style,children:b.jsx(Rv,{components:e.components,componentProps:t})})}const hc=({classNames:e="border-black"})=>b.jsx("div",{className:"flex items-center justify-center h-full",children:b.jsx("div",{className:`w-8 h-8 border-3 border-t-transparent rounded-full animate-spin ${e}`})}),hN="prayer-times-db",Rm="prayerTimes";async function PI(e,t,n){await(await $n(hN,1,{upgrade(a){a.createObjectStore(Rm)}})).put(Rm,n,`${e}_${t}`)}async function y4(e,t){return(await $n(hN,1,{upgrade(r){r.createObjectStore(Rm)}})).get(Rm,`${e}_${t}`)}const gf={Fajr:"فجر",Dhuhr:"ظهر",Asr:"عصر",Maghrib:"مغرب",Isha:"عشاء",Sunrise:"شروق",Jumuah:"جمعة","Fajr end":""},Mv={Fajr:"fajr",Dhuhr:"duhr",Asr:e=>{switch(e){case 1:return"shadow_1x";case 2:return"shadow_2x";case 3:return"wusta_noon_sunset";default:return"asr"}},Maghrib:"maghrib",Isha:"isha",Sunrise:"shuruq_sunrise","Fajr end":"fajr_endtime"};async function pN(e,t,n,r){try{const{data:a,error:i}=await Ke.from("mosque_t").select(`
91
+ *,
92
+ location_postnumber (
93
+ location_iso,
94
+ location_t (
95
+ asr_method
96
+ )
97
+ )
98
+ `).eq("organisasjonsnummer",e).single();if(i)throw i;if(!a)throw new Error("Mosque not found");const s=new Date(t);s.setDate(s.getDate()+1);const o=s.toISOString().split("T")[0],l=a.location_postnumber.location_iso,u=r||a.prayer_method,[{data:c},{data:f},{data:p},{data:d}]=await Promise.all([Ke.from("prayertime").select("*").eq("location_iso",l).eq("date",t).eq("prayer_method",u).maybeSingle(),Ke.from("prayertime").select("*").eq("location_iso",l).eq("date",o).eq("prayer_method",u).maybeSingle(),Ke.from("mosque_jamatperiode").select("*").eq("mosque_id",e).lte("start_date",t).gte("end_date",t).maybeSingle(),Ke.from("mosque_jamatperiode").select("*").eq("mosque_id",e).lte("start_date",o).gte("end_date",o).maybeSingle()]);if(!c)throw new Error(`No prayer times found: Location: ${l}, Prayer Method: ${u}`);const v=["Fajr","Fajr end","Dhuhr","Asr","Maghrib","Isha"].map(g=>{var V,T,P,q,Y;const y=Mv[g],_=a.location_postnumber.location_t.asr_method,E=typeof y=="function"?y(n!==0?n:_):y,D=g==="Asr"?"asr":g==="Dhuhr"?"dhuhr":E,R=((V=c==null?void 0:c[E])==null?void 0:V.slice(0,5))||"",O=((T=f==null?void 0:f[E])==null?void 0:T.slice(0,5))||"";let j=(P=p==null?void 0:p[D])==null?void 0:P.slice(0,5),$=g==="Fajr end"?(q=f==null?void 0:f.fajr_endtime)==null?void 0:q.slice(0,5):(Y=d==null?void 0:d[D])==null?void 0:Y.slice(0,5);if(!j&&R){const se=`${g.toLowerCase()}_offset`,G=p==null?void 0:p[se];if(typeof G=="number"){const[ne,Q]=R.split(":").map(Number),ie=ne*60+Q+G,J=String(Math.floor(ie/60)%24).padStart(2,"0"),le=String(ie%60).padStart(2,"0");j=`${J}:${le}`}else j=""}if(!$&&O){const se=`${g.toLowerCase()}_offset`,G=d==null?void 0:d[se];if(typeof G=="number"){const[ne,Q]=O.split(":").map(Number),ie=ne*60+Q+G,J=String(Math.floor(ie/60)%24).padStart(2,"0"),le=String(ie%60).padStart(2,"0");$=`${J}:${le}`}else $=""}return{name:g,arabic:gf[g],adhan:R,iqamah:j,tomorrow:$}});let S;if(!(p!=null&&p.id))console.warn("Today's Jamaat is missing, skipping jummah query"),S=[];else{const{data:g,error:y}=await Ke.from("mosque_jummah").select("jummah").eq("mosque_id",e).eq("jamat_id",p==null?void 0:p.id);if(y)throw y;S=g||null}const x=await Promise.all(["Jumuah","Eid"].map(async g=>{var E,D,R,O;const y=Mv[g],_=typeof y=="function"?y(a.asr_method):y;if(g==="Jumuah"){const j=S.map($=>{var V;return(V=$.jummah)==null?void 0:V.slice(0,5)}).filter(Boolean).sort(($,V)=>{const[T,P]=$.split(":").map(Number),[q,Y]=V.split(":").map(Number),se=(T===12?12:T+12)*60+P,G=(q===12?12:q+12)*60+Y;return se-G});return{label:g,arabic:gf[g],time:j||""}}if(g==="Eid"){const{data:j,error:$}=await Ke.from("mosque_t").select("show_eid").eq("organisasjonsnummer",e).single();if($||!j)return console.error("Error fetching Eid show data:",$),{label:g,arabic:gf[g],time:[]};const V=[(E=a.eidprayer_time1)==null?void 0:E.slice(0,5),(D=a.eidprayer_time2)==null?void 0:D.slice(0,5),(R=a.eidprayer_time3)==null?void 0:R.slice(0,5)].filter(Boolean);return{label:g,arabic:gf[g],time:V}}return{label:g,arabic:gf[g],time:((O=c==null?void 0:c[_])==null?void 0:O.slice(0,5))||""}}));return{prayerTimes:v,extraInfo:x}}catch(a){return console.error("Error fetching prayer times:",a),Ht("error",`Error fetching prayer times: ${a.message}`),{prayerTimes:[],extraInfo:[]}}}const II=async(e,t,n,r)=>{const{data:a}=await Ke.from("prayertime").select(`
99
+ *,
100
+ location_t (
101
+ asr_method
102
+ )
103
+ `).eq("location_iso",e).eq("date",t).eq("prayer_method",r).single();return{prayerTimes:["Fajr","Fajr end","Dhuhr","Asr","Maghrib","Isha"].map(s=>{var f;const o=Mv[s],l=a==null?void 0:a.location_t.asr_method,u=typeof o=="function"?o(n!==0?n:l):o,c=((f=a==null?void 0:a[u])==null?void 0:f.slice(0,5))||"";return{name:s,adhan:c,iqamah:"",tomorrow:""}})}},FI=async(e,t,n,r,a)=>{try{const{data:i,error:s}=await Ke.from("prayertime").select("*").eq("location_iso",e).eq("prayer_method",a).gte("date",t).lte("date",n).order("date");if(s)throw s;if(!i||i.length===0)return[];const l=(c=>{switch(c){case 1:return"shadow_1x";case 2:return"shadow_2x";case 3:return"wusta_noon_sunset";default:return"asr"}})(r);return i.map(c=>{var f,p,d,v,S,x;return{date:c.date,fajr:((f=c.fajr)==null?void 0:f.slice(0,5))||"",sunrise:((p=c.shuruq_sunrise)==null?void 0:p.slice(0,5))||"",dhuhr:((d=c.duhr)==null?void 0:d.slice(0,5))||"",asr:((v=c[l])==null?void 0:v.slice(0,5))||"",maghrib:((S=c.maghrib)==null?void 0:S.slice(0,5))||"",isha:((x=c.isha)==null?void 0:x.slice(0,5))||""}})}catch(i){throw console.error("Unexpected error in getPrayerTimesInADateRange:",i),i}};function mN(e,t){const[n,r]=C.useState([]),[a,i]=C.useState([]),[s,o]=C.useState(!0);return C.useEffect(()=>{if(!e)return;o(!0);const l=async()=>{let f=null;if(!navigator.onLine&&(f=await y4(e,t),f)){r(f.prayerTimes),i(f.extraInfo),o(!1);return}try{const{prayerTimes:p,extraInfo:d}=await pN(e,t);if(!p||!d){if(f=await y4(e,t),f){r(f.prayerTimes),i(f.extraInfo),o(!1);return}}else r(p),i(d),await PI(e,t,{prayerTimes:p,extraInfo:d})}catch(p){console.error("Failed to fetch prayer times:",p)}finally{o(!1)}};l();const u=Ke.channel("prayer_times_changes").on("postgres_changes",{event:"*",schema:"public",table:"mosque_jamatperiode",filter:`mosque_id=eq.${e}`},()=>{l()}).subscribe(),c=Ke.channel("mosque_t_changes").on("postgres_changes",{event:"*",schema:"public",table:"mosque_t",filter:`organisasjonsnummer=eq.${e}`},()=>{l()}).subscribe();return()=>{Ke.removeChannel(u),Ke.removeChannel(c)}},[e,t]),C.useEffect(()=>{const l=()=>{Ht("success","Back online!")},u=()=>{Ht("warning","You are offline!")};return window.addEventListener("online",l),window.addEventListener("offline",u),()=>{window.removeEventListener("online",l),window.removeEventListener("offline",u)}},[]),{prayerTimes:n,extraInfo:a,loading:s}}const BI="layout-db",Mm="layoutConfig";async function gN(){return $n(BI,2,{upgrade(e){e.objectStoreNames.contains(Mm)||e.createObjectStore(Mm)}})}async function vl(e,t){await(await gN()).put(Mm,t,e)}async function pc(e){return(await gN()).get(Mm,e)}const kv=async(e,t={})=>{const n={message:e.message||String(e),stack:e.stack||null,context:t,url:typeof window<"u"?window.location.href:null,useragent:typeof navigator<"u"?navigator.userAgent:null,created_at:new Date().toISOString()};try{const{error:r}=await Ke.from("logs").insert([n]);r&&console.error("Supabase insert error:",r)}catch(r){console.error("Failed to send log:",r)}};function $I(e){const[t,n]=C.useState(null),[r,a]=C.useState(!0);return C.useEffect(()=>{let i=null;if(!e){n(null),a(!1);return}const s=async()=>{if(a(!0),!navigator.onLine){const o=await pc(`${e}-prayerhall`);if(o){n(o),a(!1);return}}try{const{data:o}=await Ke.from("layout").select("prayerhall_theme_id, prayerhall_layout").eq("mosque_id",e).single();if(o&&o.prayerhall_layout)n(o.prayerhall_layout),await vl(`${e}-prayerhall`,o.prayerhall_layout);else{const{data:l,error:u}=await Ke.from("mosque_t").select("organisasjonsnummer").eq("organisasjonsnummer",e).single();if(!l||u){Ht("error","Please enter a valid org_nr!");return}if(l){const{data:c,error:f}=await Ke.from("layout").select("prayerhall_theme_id, prayerhall_layout").eq("mosque_id",982842840).single();if(f)throw f;const{error:p}=await Ke.from("layout").upsert([{mosque_id:e,prayerhall_theme_id:c.prayerhall_theme_id,prayerhall_layout:c==null?void 0:c.prayerhall_layout}],{onConflict:"mosque_id"}).single();if(p)throw p;n(c==null?void 0:c.prayerhall_layout),await vl(`${e}-prayerhall`,c==null?void 0:c.prayerhall_layout)}}}catch(o){const l=await pc(`${e}-prayerhall`);n(l||null),console.log("Error fetching or creating config: ",o),await kv(o,{mosqueId:e})}finally{a(!1)}};return s(),i=Ke.channel(`prayerhall_layout_changes:${e}`).on("postgres_changes",{event:"*",schema:"public",table:"layout",filter:`mosque_id=eq.${e}`},()=>{s()}).subscribe(),()=>{i==null||i.unsubscribe()}},[e]),{config:t,loading:r}}function P5(e){return lr({attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"},child:[]},{tag:"path",attr:{d:"M7 8h10c.29 0 .57.06.84.13.09-.33.16-.67.16-1.04 0-1.31-.65-2.53-1.74-3.25L12 1 7.74 3.84A3.887 3.887 0 0 0 6 7.09c0 .37.07.71.16 1.04.27-.07.55-.13.84-.13z"},child:[]},{tag:"path",attr:{d:"M24 7c0-1.1-2-3-2-3s-2 1.9-2 3c0 .74.4 1.38 1 1.72V13h-2v-2c0-1.1-.9-2-2-2H7c-1.1 0-2 .9-2 2v2H3V8.72c.6-.34 1-.98 1-1.72 0-1.1-2-3-2-3S0 5.9 0 7c0 .74.4 1.38 1 1.72V21h9v-4c0-1.1.9-2 2-2s2 .9 2 2v4h9V8.72c.6-.34 1-.98 1-1.72z"},child:[]}]})(e)}function UI(e){return lr({attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"},child:[]},{tag:"path",attr:{d:"M5 16h3v3h2v-5H5v2zm3-8H5v2h5V5H8v3zm6 11h2v-3h3v-2h-5v5zm2-11V5h-2v5h5V8h-3z"},child:[]}]})(e)}function zI(e){return lr({attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"},child:[]},{tag:"path",attr:{d:"M7 14H5v5h5v-2H7v-3zm-2-4h2V7h3V5H5v5zm12 7h-3v2h5v-5h-2v3zM14 5v2h3v3h2V5h-5z"},child:[]}]})(e)}const vN=({targetRef:e})=>{const[t,n]=C.useState(!1);C.useEffect(()=>{const a=()=>{n(!!document.fullscreenElement)};return document.addEventListener("fullscreenchange",a),()=>{document.removeEventListener("fullscreenchange",a)}},[]);const r=()=>{var a;document.fullscreenElement?document.exitFullscreen():(a=e.current)==null||a.requestFullscreen()};return b.jsx("button",{onClick:r,className:`absolute top-4 right-4 z-50 ${t?"bg-white/40 hover:bg-white/50":"bg-white/80 hover:bg-white/90"} rounded shadow hover:cursor-pointer`,title:t?"Exit Fullscreen":"Enter Fullscreen",children:t?b.jsx(UI,{size:30}):b.jsx(zI,{size:30})})};function yN(e){if(!e[1].adhan||!e[4].adhan)return"light";const t=new Date;function n(i){const[s,o]=i.split(":").map(Number),l=new Date(t);return l.setHours(s,o,0,0),l}const r=n(e[1].adhan),a=n(e[4].adhan);return t>=r&&t<a?"light":"dark"}function qI(e){return lr({attr:{viewBox:"0 0 448 512"},child:[{tag:"path",attr:{d:"M223.7 239l136-136c9.4-9.4 24.6-9.4 33.9 0l22.6 22.6c9.4 9.4 9.4 24.6 0 33.9L319.9 256l96.4 96.4c9.4 9.4 9.4 24.6 0 33.9L393.7 409c-9.4 9.4-24.6 9.4-33.9 0l-136-136c-9.5-9.4-9.5-24.6-.1-34zm-192 34l136 136c9.4 9.4 24.6 9.4 33.9 0l22.6-22.6c9.4-9.4 9.4-24.6 0-33.9L127.9 256l96.4-96.4c9.4-9.4 9.4-24.6 0-33.9L201.7 103c-9.4-9.4-24.6-9.4-33.9 0l-136 136c-9.5 9.4-9.5 24.6-.1 34z"},child:[]}]})(e)}function HI(e){return lr({attr:{viewBox:"0 0 448 512"},child:[{tag:"path",attr:{d:"M224.3 273l-136 136c-9.4 9.4-24.6 9.4-33.9 0l-22.6-22.6c-9.4-9.4-9.4-24.6 0-33.9l96.4-96.4-96.4-96.4c-9.4-9.4-9.4-24.6 0-33.9L54.3 103c9.4-9.4 24.6-9.4 33.9 0l136 136c9.5 9.4 9.5 24.6.1 34zm192-34l-136-136c-9.4-9.4-24.6-9.4-33.9 0l-22.6 22.6c-9.4 9.4-9.4 24.6 0 33.9l96.4 96.4-96.4 96.4c-9.4 9.4-9.4 24.6 0 33.9l22.6 22.6c9.4 9.4 24.6 9.4 33.9 0l136-136c9.4-9.2 9.4-24.4 0-33.8z"},child:[]}]})(e)}function VI(e){return lr({attr:{viewBox:"0 0 320 512"},child:[{tag:"path",attr:{d:"M34.52 239.03L228.87 44.69c9.37-9.37 24.57-9.37 33.94 0l22.67 22.67c9.36 9.36 9.37 24.52.04 33.9L131.49 256l154.02 154.75c9.34 9.38 9.32 24.54-.04 33.9l-22.67 22.67c-9.37 9.37-24.57 9.37-33.94 0L34.52 272.97c-9.37-9.37-9.37-24.57 0-33.94z"},child:[]}]})(e)}function YI(e){return lr({attr:{viewBox:"0 0 320 512"},child:[{tag:"path",attr:{d:"M285.476 272.971L91.132 467.314c-9.373 9.373-24.569 9.373-33.941 0l-22.667-22.667c-9.357-9.357-9.375-24.522-.04-33.901L188.505 256 34.484 101.255c-9.335-9.379-9.317-24.544.04-33.901l22.667-22.667c9.373-9.373 24.569-9.373 33.941 0L285.475 239.03c9.373 9.372 9.373 24.568.001 33.941z"},child:[]}]})(e)}function bN(e){return lr({attr:{viewBox:"0 0 320 512"},child:[{tag:"path",attr:{d:"M272 0H48C21.5 0 0 21.5 0 48v416c0 26.5 21.5 48 48 48h224c26.5 0 48-21.5 48-48V48c0-26.5-21.5-48-48-48zM160 480c-17.7 0-32-14.3-32-32s14.3-32 32-32 32 14.3 32 32-14.3 32-32 32zm112-108c0 6.6-5.4 12-12 12H60c-6.6 0-12-5.4-12-12V60c0-6.6 5.4-12 12-12h200c6.6 0 12 5.4 12 12v312z"},child:[]}]})(e)}function GI(e){return lr({attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M497.39 361.8l-112-48a24 24 0 0 0-28 6.9l-49.6 60.6A370.66 370.66 0 0 1 130.6 204.11l60.6-49.6a23.94 23.94 0 0 0 6.9-28l-48-112A24.16 24.16 0 0 0 122.6.61l-104 24A24 24 0 0 0 0 48c0 256.5 207.9 464 464 464a24 24 0 0 0 23.4-18.6l24-104a24.29 24.29 0 0 0-14.01-27.6z"},child:[]}]})(e)}function wN(e){return lr({attr:{viewBox:"0 0 384 512"},child:[{tag:"path",attr:{d:"M256 128c35.35 0 64-28.65 64-64S291.35 0 256 0s-64 28.65-64 64 28.65 64 64 64zm-30.63 169.75c14.06 16.72 39 19.09 55.97 5.22l88-72.02c17.09-13.98 19.59-39.19 5.62-56.28-13.97-17.11-39.19-19.59-56.31-5.62l-57.44 47-38.91-46.31c-15.44-18.39-39.22-27.92-64-25.33-24.19 2.48-45.25 16.27-56.37 36.92l-49.37 92.03c-23.4 43.64-8.69 96.37 34.19 123.75L131.56 432H40c-22.09 0-40 17.91-40 40s17.91 40 40 40h208c34.08 0 53.77-42.79 28.28-68.28L166.42 333.86l34.8-64.87 24.15 28.76z"},child:[]}]})(e)}function z1(e){return lr({attr:{viewBox:"0 0 448 512"},child:[{tag:"path",attr:{d:"M148 288h-40c-6.6 0-12-5.4-12-12v-40c0-6.6 5.4-12 12-12h40c6.6 0 12 5.4 12 12v40c0 6.6-5.4 12-12 12zm108-12v-40c0-6.6-5.4-12-12-12h-40c-6.6 0-12 5.4-12 12v40c0 6.6 5.4 12 12 12h40c6.6 0 12-5.4 12-12zm96 0v-40c0-6.6-5.4-12-12-12h-40c-6.6 0-12 5.4-12 12v40c0 6.6 5.4 12 12 12h40c6.6 0 12-5.4 12-12zm-96 96v-40c0-6.6-5.4-12-12-12h-40c-6.6 0-12 5.4-12 12v40c0 6.6 5.4 12 12 12h40c6.6 0 12-5.4 12-12zm-96 0v-40c0-6.6-5.4-12-12-12h-40c-6.6 0-12 5.4-12 12v40c0 6.6 5.4 12 12 12h40c6.6 0 12-5.4 12-12zm192 0v-40c0-6.6-5.4-12-12-12h-40c-6.6 0-12 5.4-12 12v40c0 6.6 5.4 12 12 12h40c6.6 0 12-5.4 12-12zm96-260v352c0 26.5-21.5 48-48 48H48c-26.5 0-48-21.5-48-48V112c0-26.5 21.5-48 48-48h48V12c0-6.6 5.4-12 12-12h40c6.6 0 12 5.4 12 12v52h128V12c0-6.6 5.4-12 12-12h40c6.6 0 12 5.4 12 12v52h48c26.5 0 48 21.5 48 48zm-48 346V160H48v298c0 3.3 2.7 6 6 6h340c3.3 0 6-2.7 6-6z"},child:[]}]})(e)}function WI(){const{org_nr:e}=Cn(),t=fa(),n=new Date().toISOString().split("T")[0],{config:r}=$I(e),{isDefault:a,textColor:i,prayerTimesColor:s,extraInfoColor:o,...l}=r||{},{prayerTimes:u,extraInfo:c,loading:f}=mN(e,n),{setDarkMode:p}=or();C.useEffect(()=>{if(!u||u.length===0)return;const x=()=>{const y=yN(u);y==="dark"?p(!0):y==="light"&&p(!1)};x();const g=setInterval(x,60*1e3);return()=>clearInterval(g)},[u,p]),Ms(e);const d=C.useRef(null),[v,S]=C.useState(!1);return C.useEffect(()=>{const x=()=>{S(!!document.fullscreenElement)};return document.addEventListener("fullscreenchange",x),()=>document.removeEventListener("fullscreenchange",x)},[]),f?b.jsx("div",{className:"h-screen",children:b.jsx(hc,{})}):u?b.jsxs("div",{ref:d,className:"relative",children:[!v&&b.jsxs(b.Fragment,{children:[b.jsx("button",{onClick:()=>t(`/${e||"982842840"}`),className:"absolute top-4 right-26 z-50 px-3 py-1 text-sm text-white font-semibold rounded-lg shadow-md hover:opacity-90 hover:cursor-pointer transition",style:{backgroundColor:i||"#4F46E5"},children:b.jsx(bN,{size:24,className:"cursor-pointer"})}),b.jsx("button",{onClick:()=>t(`/${e||"982842840"}/lobby`),className:"absolute top-4 right-13 z-50 px-3 py-1 text-sm text-white font-semibold rounded-lg shadow-md hover:opacity-90 hover:cursor-pointer transition",style:{backgroundColor:i||"#4F46E5"},children:b.jsx(P5,{size:24,className:"cursor-pointer"})})]}),b.jsx(vN,{targetRef:d}),b.jsx(kI,{config:l,componentProps:{date:n,prayerTimes:u,extraInfo:c,textColor:i,prayerTimesColor:s,extraInfoColor:o,isDefault:a}})]}):b.jsx("div",{children:"Prayer times not found."})}const xN=({nr:e,prayerTimes:t,date:n,color:r,reverse:a=!1})=>{const{i18n:i,t:s}=Dn(),o=i.language||"en",{org_nr:l}=Cn(),u=kg(),{darkMode:c}=or(),[f,p]=C.useState(()=>new Date().toLocaleTimeString([],{hour:"2-digit",minute:"2-digit",second:"2-digit",hour12:!1})),[d,v]=C.useState(()=>new Date(n).toLocaleDateString(o==="no"?"nb-NO":"en-IN",{year:"numeric",month:"long",day:"numeric"}));C.useEffect(()=>{const y=setInterval(()=>{p(new Date().toLocaleTimeString([],{hour:"2-digit",minute:"2-digit",second:"2-digit",hour12:!1}))},1e3);return()=>clearInterval(y)},[]),C.useEffect(()=>{const y=new Date(n);v(y.toLocaleDateString(o==="no"?"nb-NO":"en-IN",{year:"numeric",month:"long",day:"numeric"}))},[n,o]);const[S,x]=C.useState(null);C.useEffect(()=>{(async()=>{if(n){if(!navigator.onLine){const _=await xs(n);if(_){x(_);return}}try{const{data:_,error:E}=await Ke.from("hijri_dates").select("hijri_date_day, hijri_date_month, hijri_date_year").eq("gregorian_date",n).single();if(E)throw new Error(E.message);if(!_)throw new Error("No corresponding hijri day found!");x(_),await Rg(n,_)}catch(_){const E=await xs(n);E&&x(E),console.log(_)}}})()},[n]);const g=Ig(t);return b.jsxs("div",{className:`w-full h-full flex flex-col sm:flex-row ${a?"sm:flex-row-reverse ml-4":"-ml-2 2xl:-ml-4"}`,children:[b.jsxs("div",{className:`w-full sm:w-[55%] flex flex-col ${a?"pl-10":"pl-4"} justify-between py-2 2xl:py-4 font-chakra dark:text-[#F2E7D5]`,style:{color:c?e===1?"#F2E7D5":"#F5C45E":r},children:[b.jsx(Vd,{nr:e,orgNr:l,textColor:r,isLobby:!0}),b.jsxs("div",{children:[b.jsx("h2",{className:"font-bold text-3xl sm:text-4xl md:text-7xl mb-2 sm:mb-3",children:f}),b.jsx("h4",{className:"font-bold text-base lg:text-2xl",children:S&&u.length>0?Hi({hijriDayObj:S,language:o,t:s,hijriMonthNames:u}):"-"}),b.jsx("h4",{className:"font-bold text-base lg:text-2xl",children:d})]})]}),b.jsx("div",{className:"w-full h-full sm:w-[45%] flex items-center justify-center",children:b.jsx("div",{className:"w-full max-w-[100%] scale-110",children:b.jsx(Fg,{prayerTimes:g,theme:1})})})]})},b4=e=>{const[t,n]=e.split(":").map(Number);return t*60+n},JI=({prayerTimes:e,extraInfo:t,prayerTimesColor:n,extraInfoColor:r,isDefault:a})=>{const{darkMode:i}=or(),{org_nr:s}=Cn(),{language:o}=Ms(s||void 0),{t:l}=Dn(),u=new Date,c=u.getHours()*60+u.getMinutes(),f=e.findIndex(d=>b4(d.adhan)>c),p=o==="ar";return b.jsx("div",{className:"font-chakra w-full mt-auto",style:{color:i?"#F2E7D5":n.text},children:b.jsxs("div",{className:" dark:text-[#F2E7D5] backdrop-blur-md rounded-2xl 2xl:rounded-3xl shadow-sm min-w-0 dark:bg-gradient-to-r dark:from-[#1C1B1BBF] dark:to-[#13121299]",style:{backgroundColor:i?"":a?mA(n.bg,.75):n.bg},dir:p?"rtl":"ltr",children:[b.jsxs("div",{className:"table w-full border-b-2 border-[#00000026] dark:border-[#F2E7D530] p-2 2xl:px-4 py-3",children:[b.jsx("div",{className:"table-header-group w-full text-sm sm:text-base 2xl:text-xl font-bold",style:{color:i?"#F2E7D5":a?"#53452E":n.text},children:b.jsxs("div",{className:"table-row",children:[b.jsx("div",{className:`table-cell py-1 pl-2 ${p?"text-right":"text-left"} border-b-2 border-[#00000026] dark:border-[#F2E7D530]`,children:l("SALAH")}),!p&&b.jsx("div",{className:"table-cell text-right border-b-2 border-[#00000026] dark:border-[#F2E7D530]"}),b.jsx("div",{className:"table-cell text-center border-b-2 border-[#00000026] dark:border-[#F2E7D530]",children:l("ADHAN")}),b.jsx("div",{className:"table-cell text-center border-b-2 border-[#00000026] dark:border-[#F2E7D530]",children:l("IQAMAH")}),b.jsx("div",{className:"table-cell text-center border-b-2 border-[#00000026] dark:border-[#F2E7D530]",children:l("TMRW")})]})}),b.jsx("div",{className:"table-row-group w-full text-base sm:text-lg 2xl:text-2xl",children:e.map((d,v)=>{const S=b4(d.adhan),x=v===f,y=S<c&&!x?"dark:text-[#F2E7D5] opacity-40":"",_={backgroundColor:i?"#54462E":a?"#CFB78F":r.bg,color:a?"":r.text,borderBlockColor:i?"#F2E7DF":a?"#53452E":r.text};return b.jsxs("div",{className:"table-row",children:[b.jsx("div",{className:`table-cell py-1 pl-2 ${p?"text-right":"text-left"} font-bold ${x?p?"border-r-2 border-y-2 rounded-r-xl":"border-l-2 border-y-2 rounded-l-xl":""}`,style:x?_:{},children:d.name==="Fajr end"?b.jsx(Ud,{color:"orange",size:28}):l(d.name.toUpperCase())}),!p&&b.jsx("div",{className:`table-cell py-1 text-right ${x&&"border-y-2"}`,style:x?_:{},children:d.arabic}),b.jsx("div",{className:`table-cell py-1 text-center font-bold ${y} ${x&&"border-y-2"}`,style:x?_:{},children:d.adhan}),b.jsx("div",{className:`table-cell py-1 text-center font-semibold ${y} ${x?p?"border-l-2 border-y-2 rounded-l-xl":"border-r-2 border-y-2 rounded-r-xl":""}`,style:x?_:{},children:d.iqamah}),b.jsx("div",{className:"table-cell py-1 text-center font-semibold",children:d.tomorrow})]},v)})})]}),b.jsx("div",{className:"px-6 py-4 text-sm sm:text-base 2xl:text-xl font-bold rounded-b-3xl",style:{color:i?"#F2E7D5":r.text,backgroundColor:i?"#54462E":a?"#CFB78F":r.bg},children:b.jsx("div",{className:p?"w-[60%]":"",children:t.filter(d=>d.label==="Eid"?Array.isArray(d.time)&&d.time.some(v=>v&&v.trim()!==""):!0).map((d,v)=>b.jsxs("div",{className:"flex justify-between py-2",children:[b.jsx("div",{className:"w-2/5",children:l(d==null?void 0:d.label.toUpperCase())}),Array.isArray(d.time)?(p?[2,1,0]:[0,1,2]).map(S=>b.jsx("div",{className:"w-1/4 md:w-1/5 text-center ",children:d.time[S]},S)):b.jsxs(b.Fragment,{children:[b.jsx("div",{className:"w-1/5 text-center ",children:d.time}),b.jsx("div",{className:"w-1/5"}),b.jsx("div",{className:"w-1/5"})]})]},v))})})]})})},KI=({prayerTimes:e,extraInfo:t,date:n,textColor:r,prayerTimesColor:a,extraInfoColor:i,isDefault:s})=>b.jsxs("div",{className:"flex flex-col h-full min-h-0",children:[b.jsx("div",{className:"overflow-hidden flex flex-col bg-red- flex-2 p-1 2xl:p-2 justify-center h-full",children:b.jsx(xN,{nr:1,color:r,prayerTimes:e,date:n})}),b.jsx("div",{className:"overflow-hidden min-h-0 flex flex-col flex-3 justify-center h-full",children:b.jsx(JI,{prayerTimes:e,extraInfo:t,prayerTimesColor:a,extraInfoColor:i,isDefault:s})})]}),XI=({date:e,prayerTimes:t,extraInfo:n,textColor:r,prayerTimesColor:a,extraInfoColor:i,isDefault:s})=>{const{org_nr:o}=Cn();return b.jsxs("div",{className:"w-full h-full flex flex-col dark:bg-[#0C221F]",children:[b.jsxs("div",{className:"px-2 sm:px-4",children:[b.jsx(Vd,{nr:3,textColor:r,orgNr:o,isLobby:!0,date:e}),b.jsx(lN,{isLobby:!0,color:r})]}),b.jsx("div",{className:"flex-1 flex justify-center 2xl:pb-4 overflow-hidden",children:b.jsx(cN,{prayerTimes:t,extraInfo:n,prayerTimesColor:a,extraInfoColor:i,isLobby:!0,isDefault:s})})]})},w4=e=>{const[t,n]=e.split(":").map(Number);return t*60+n},QI=({prayerTimes:e,extraInfo:t,prayerTimesColor:n,extraInfoColor:r,isDefault:a,isPreview:i})=>{const s=new Date,o=s.getHours()*60+s.getMinutes(),l=e.findIndex(u=>w4(u.adhan)>o)-1;return b.jsxs("div",{className:"grid grid-cols-3 gap-4",children:[e.filter(u=>u.name!=="Fajr end").map((u,c)=>{const f=w4(u.adhan),p=c===l,d=f<o;return b.jsx("div",{children:b.jsx(sN,{name:u.name,arabic:u.arabic,adhan:u.adhan,iqamah:u.iqamah,tomorrow:u.tomorrow,isNext:p,isPast:d,isSmall:!0,color:n.text,bg:n.bg,isDefault:a,isPreview:i})},u.name)}),b.jsx("div",{className:"col-span-1 row-span-2 flex",children:b.jsx(oN,{extraInfo:t,extraInfoColor:r,isLobby:!0,isDefault:a,isPreview:i})})]})},ZI=({date:e,prayerTimes:t,extraInfo:n,textColor:r,prayerTimesColor:a,extraInfoColor:i,isDefault:s,isPreview:o})=>b.jsxs("div",{className:"flex flex-col justify-center h-full min-h-0",children:[b.jsx("div",{className:"flex mb-10 mt-8",children:b.jsx(xN,{nr:2,prayerTimes:t,date:e,color:r,reverse:!0})}),b.jsx("div",{className:"flex h-full w-full",children:b.jsx(QI,{prayerTimes:t,extraInfo:n,prayerTimesColor:a,extraInfoColor:i,isDefault:s,isPreview:o})})]}),SN="mosque-media-db",km="media";async function eF(e,t){await(await $n(SN,1,{upgrade(r){r.createObjectStore(km)}})).put(km,t,e)}async function x4(e){return await(await $n(SN,1,{upgrade(n){n.createObjectStore(km)}})).get(km,e)}function tF(e){const[t,n]=C.useState([]),[r,a]=C.useState(3e3),[i,s]=C.useState(!0);return C.useEffect(()=>{let o=null;if(!e){n([]),s(!1);return}const l=async()=>{if(s(!0),!navigator.onLine){const u=await x4(e);if(u){n(u),s(!1);return}}try{const{data:u,error:c}=await Ke.from("multimedia").select("path, type, enabled").eq("mosque_id",e).order("order");if(c)throw c;let f=(u||[]).filter(v=>v.enabled===!0).map(v=>({type:v.type,path:v.path}));if(u.length===0){const v={created_at:new Date().toISOString(),mosque_id:e,path:"https://qulifhogfdofhzgreged.supabase.co/storage/v1/object/public/mosques/982842840/multimedia/quran%20img%201.png",type:"image",enabled:!0,order:1},{data:S}=await Ke.from("multimedia").select("id").eq("mosque_id",e).eq("path",v.path);if(!S||S.length===0){const{error:x}=await Ke.from("multimedia").upsert(v,{onConflict:"mosque_id, path"});if(x&&!x.message.includes("duplicate key"))throw x;f=[{type:v.type,path:v.path}]}}n(f),await eF(e,f);const{data:p,error:d}=await Ke.from("mosque_t").select("multimedia_duration").eq("organisasjonsnummer",e).single();if(d)throw d;a(p.multimedia_duration*1e3)}catch(u){const c=await x4(e);c&&n(c),console.log("Error fetching media: ",u)}finally{s(!1)}};return l(),o=Ke.channel("multimedia-changes").on("postgres_changes",{event:"*",schema:"public",table:"multimedia"},u=>{var c,f;(((c=u.new)==null?void 0:c.mosque_id)===e||((f=u.old)==null?void 0:f.mosque_id)===e)&&l()}),o.subscribe(),()=>{o==null||o.unsubscribe()}},[e]),{mediaItems:t,duration:r,loading:i}}var _N={exports:{}},nF="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED",rF=nF,aF=rF;function AN(){}function NN(){}NN.resetWarningCache=AN;var iF=function(){function e(r,a,i,s,o,l){if(l!==aF){var u=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw u.name="Invariant Violation",u}}e.isRequired=e;function t(){return e}var n={array:e,bigint:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:NN,resetWarningCache:AN};return n.PropTypes=n,n};_N.exports=iF();var sF=_N.exports;const wr=Xm(sF);var oF=function e(t,n){if(t===n)return!0;if(t&&n&&typeof t=="object"&&typeof n=="object"){if(t.constructor!==n.constructor)return!1;var r,a,i;if(Array.isArray(t)){if(r=t.length,r!=n.length)return!1;for(a=r;a--!==0;)if(!e(t[a],n[a]))return!1;return!0}if(t.constructor===RegExp)return t.source===n.source&&t.flags===n.flags;if(t.valueOf!==Object.prototype.valueOf)return t.valueOf()===n.valueOf();if(t.toString!==Object.prototype.toString)return t.toString()===n.toString();if(i=Object.keys(t),r=i.length,r!==Object.keys(n).length)return!1;for(a=r;a--!==0;)if(!Object.prototype.hasOwnProperty.call(n,i[a]))return!1;for(a=r;a--!==0;){var s=i[a];if(!e(t[s],n[s]))return!1}return!0}return t!==t&&n!==n};const lF=Xm(oF);var Pv={exports:{}},EN;/**
104
+ * @link https://github.com/gajus/sister for the canonical source repository
105
+ * @license https://github.com/gajus/sister/blob/master/LICENSE BSD 3-Clause
106
+ */EN=function(){var e={},t={};return e.on=function(n,r){var a={name:n,handler:r};return t[n]=t[n]||[],t[n].unshift(a),a},e.off=function(n){var r=t[n.name].indexOf(n);r!==-1&&t[n.name].splice(r,1)},e.trigger=function(n,r){var a=t[n],i;if(a)for(i=a.length;i--;)a[i].handler(r)},e};var uF=EN,Iv={exports:{}},cF=function(t,n,r){var a=document.head||document.getElementsByTagName("head")[0],i=document.createElement("script");typeof n=="function"&&(r=n,n={}),n=n||{},r=r||function(){},i.type=n.type||"text/javascript",i.charset=n.charset||"utf8",i.async="async"in n?!!n.async:!0,i.src=t,n.attrs&&fF(i,n.attrs),n.text&&(i.text=""+n.text);var s="onload"in i?S4:dF;s(i,r),i.onload||S4(i,r),a.appendChild(i)};function fF(e,t){for(var n in t)e.setAttribute(n,t[n])}function S4(e,t){e.onload=function(){this.onerror=this.onload=null,t(null,e)},e.onerror=function(){this.onerror=this.onload=null,t(new Error("Failed to load "+this.src),e)}}function dF(e,t){e.onreadystatechange=function(){this.readyState!="complete"&&this.readyState!="loaded"||(this.onreadystatechange=null,t(null,e))}}(function(e,t){Object.defineProperty(t,"__esModule",{value:!0});var n=cF,r=a(n);function a(i){return i&&i.__esModule?i:{default:i}}t.default=function(i){var s=new Promise(function(o){if(window.YT&&window.YT.Player&&window.YT.Player instanceof Function){o(window.YT);return}else{var l=window.location.protocol==="http:"?"http:":"https:";(0,r.default)(l+"//www.youtube.com/iframe_api",function(c){c&&i.trigger("error",c)})}var u=window.onYouTubeIframeAPIReady;window.onYouTubeIframeAPIReady=function(){u&&u(),o(window.YT)}});return s},e.exports=t.default})(Iv,Iv.exports);var hF=Iv.exports,Fv={exports:{}},Bv={exports:{}},$v={exports:{}},gd=1e3,vd=gd*60,yd=vd*60,bd=yd*24,pF=bd*365.25,mF=function(e,t){t=t||{};var n=typeof e;if(n==="string"&&e.length>0)return gF(e);if(n==="number"&&isNaN(e)===!1)return t.long?yF(e):vF(e);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(e))};function gF(e){if(e=String(e),!(e.length>100)){var t=/^((?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|years?|yrs?|y)?$/i.exec(e);if(t){var n=parseFloat(t[1]),r=(t[2]||"ms").toLowerCase();switch(r){case"years":case"year":case"yrs":case"yr":case"y":return n*pF;case"days":case"day":case"d":return n*bd;case"hours":case"hour":case"hrs":case"hr":case"h":return n*yd;case"minutes":case"minute":case"mins":case"min":case"m":return n*vd;case"seconds":case"second":case"secs":case"sec":case"s":return n*gd;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return n;default:return}}}}function vF(e){return e>=bd?Math.round(e/bd)+"d":e>=yd?Math.round(e/yd)+"h":e>=vd?Math.round(e/vd)+"m":e>=gd?Math.round(e/gd)+"s":e+"ms"}function yF(e){return sp(e,bd,"day")||sp(e,yd,"hour")||sp(e,vd,"minute")||sp(e,gd,"second")||e+" ms"}function sp(e,t,n){if(!(e<t))return e<t*1.5?Math.floor(e/t)+" "+n:Math.ceil(e/t)+" "+n+"s"}(function(e,t){t=e.exports=a.debug=a.default=a,t.coerce=l,t.disable=s,t.enable=i,t.enabled=o,t.humanize=mF,t.names=[],t.skips=[],t.formatters={};var n;function r(u){var c=0,f;for(f in u)c=(c<<5)-c+u.charCodeAt(f),c|=0;return t.colors[Math.abs(c)%t.colors.length]}function a(u){function c(){if(c.enabled){var f=c,p=+new Date,d=p-(n||p);f.diff=d,f.prev=n,f.curr=p,n=p;for(var v=new Array(arguments.length),S=0;S<v.length;S++)v[S]=arguments[S];v[0]=t.coerce(v[0]),typeof v[0]!="string"&&v.unshift("%O");var x=0;v[0]=v[0].replace(/%([a-zA-Z%])/g,function(y,_){if(y==="%%")return y;x++;var E=t.formatters[_];if(typeof E=="function"){var D=v[x];y=E.call(f,D),v.splice(x,1),x--}return y}),t.formatArgs.call(f,v);var g=c.log||t.log||console.log.bind(console);g.apply(f,v)}}return c.namespace=u,c.enabled=t.enabled(u),c.useColors=t.useColors(),c.color=r(u),typeof t.init=="function"&&t.init(c),c}function i(u){t.save(u),t.names=[],t.skips=[];for(var c=(typeof u=="string"?u:"").split(/[\s,]+/),f=c.length,p=0;p<f;p++)c[p]&&(u=c[p].replace(/\*/g,".*?"),u[0]==="-"?t.skips.push(new RegExp("^"+u.substr(1)+"$")):t.names.push(new RegExp("^"+u+"$")))}function s(){t.enable("")}function o(u){var c,f;for(c=0,f=t.skips.length;c<f;c++)if(t.skips[c].test(u))return!1;for(c=0,f=t.names.length;c<f;c++)if(t.names[c].test(u))return!0;return!1}function l(u){return u instanceof Error?u.stack||u.message:u}})($v,$v.exports);var bF=$v.exports;(function(e,t){var n={};t=e.exports=bF,t.log=i,t.formatArgs=a,t.save=s,t.load=o,t.useColors=r,t.storage=typeof chrome<"u"&&typeof chrome.storage<"u"?chrome.storage.local:l(),t.colors=["lightseagreen","forestgreen","goldenrod","dodgerblue","darkorchid","crimson"];function r(){return typeof window<"u"&&window.process&&window.process.type==="renderer"?!0:typeof document<"u"&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||typeof window<"u"&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)}t.formatters.j=function(u){try{return JSON.stringify(u)}catch(c){return"[UnexpectedJSONParseError]: "+c.message}};function a(u){var c=this.useColors;if(u[0]=(c?"%c":"")+this.namespace+(c?" %c":" ")+u[0]+(c?"%c ":" ")+"+"+t.humanize(this.diff),!!c){var f="color: "+this.color;u.splice(1,0,f,"color: inherit");var p=0,d=0;u[0].replace(/%[a-zA-Z%]/g,function(v){v!=="%%"&&(p++,v==="%c"&&(d=p))}),u.splice(d,0,f)}}function i(){return typeof console=="object"&&console.log&&Function.prototype.apply.call(console.log,console,arguments)}function s(u){try{u==null?t.storage.removeItem("debug"):t.storage.debug=u}catch{}}function o(){var u;try{u=t.storage.debug}catch{}return!u&&typeof process<"u"&&"env"in process&&(u=n.DEBUG),u}t.enable(o());function l(){try{return window.localStorage}catch{}}})(Bv,Bv.exports);var wF=Bv.exports,Uv={exports:{}};(function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=["cueVideoById","loadVideoById","cueVideoByUrl","loadVideoByUrl","playVideo","pauseVideo","stopVideo","getVideoLoadedFraction","cuePlaylist","loadPlaylist","nextVideo","previousVideo","playVideoAt","setShuffle","setLoop","getPlaylist","getPlaylistIndex","setOption","mute","unMute","isMuted","setVolume","getVolume","seekTo","getPlayerState","getPlaybackRate","setPlaybackRate","getAvailablePlaybackRates","getPlaybackQuality","setPlaybackQuality","getAvailableQualityLevels","getCurrentTime","getDuration","removeEventListener","getVideoUrl","getVideoEmbedCode","getOptions","getOption","addEventListener","destroy","setSize","getIframe"],e.exports=t.default})(Uv,Uv.exports);var xF=Uv.exports,zv={exports:{}};(function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=["ready","stateChange","playbackQualityChange","playbackRateChange","error","apiChange","volumeChange"],e.exports=t.default})(zv,zv.exports);var SF=zv.exports,qv={exports:{}},Hv={exports:{}};(function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default={BUFFERING:3,ENDED:0,PAUSED:2,PLAYING:1,UNSTARTED:-1,VIDEO_CUED:5},e.exports=t.default})(Hv,Hv.exports);var _F=Hv.exports;(function(e,t){Object.defineProperty(t,"__esModule",{value:!0});var n=_F,r=a(n);function a(i){return i&&i.__esModule?i:{default:i}}t.default={pauseVideo:{acceptableStates:[r.default.ENDED,r.default.PAUSED],stateChangeRequired:!1},playVideo:{acceptableStates:[r.default.ENDED,r.default.PLAYING],stateChangeRequired:!1},seekTo:{acceptableStates:[r.default.ENDED,r.default.PLAYING,r.default.PAUSED],stateChangeRequired:!0,timeout:3e3}},e.exports=t.default})(qv,qv.exports);var AF=qv.exports;(function(e,t){Object.defineProperty(t,"__esModule",{value:!0});var n=wF,r=c(n),a=xF,i=c(a),s=SF,o=c(s),l=AF,u=c(l);function c(d){return d&&d.__esModule?d:{default:d}}var f=(0,r.default)("youtube-player"),p={};p.proxyEvents=function(d){var v={},S=function(O){var j="on"+O.slice(0,1).toUpperCase()+O.slice(1);v[j]=function($){f('event "%s"',j,$),d.trigger(O,$)}},x=!0,g=!1,y=void 0;try{for(var _=o.default[Symbol.iterator](),E;!(x=(E=_.next()).done);x=!0){var D=E.value;S(D)}}catch(R){g=!0,y=R}finally{try{!x&&_.return&&_.return()}finally{if(g)throw y}}return v},p.promisifyPlayer=function(d){var v=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,S={},x=function(j){v&&u.default[j]?S[j]=function(){for(var $=arguments.length,V=Array($),T=0;T<$;T++)V[T]=arguments[T];return d.then(function(P){var q=u.default[j],Y=P.getPlayerState(),se=P[j].apply(P,V);return q.stateChangeRequired||Array.isArray(q.acceptableStates)&&q.acceptableStates.indexOf(Y)===-1?new Promise(function(G){var ne=function Q(){var ie=P.getPlayerState(),J=void 0;typeof q.timeout=="number"&&(J=setTimeout(function(){P.removeEventListener("onStateChange",Q),G()},q.timeout)),Array.isArray(q.acceptableStates)&&q.acceptableStates.indexOf(ie)!==-1&&(P.removeEventListener("onStateChange",Q),clearTimeout(J),G())};P.addEventListener("onStateChange",ne)}).then(function(){return se}):se})}:S[j]=function(){for(var $=arguments.length,V=Array($),T=0;T<$;T++)V[T]=arguments[T];return d.then(function(P){return P[j].apply(P,V)})}},g=!0,y=!1,_=void 0;try{for(var E=i.default[Symbol.iterator](),D;!(g=(D=E.next()).done);g=!0){var R=D.value;x(R)}}catch(O){y=!0,_=O}finally{try{!g&&E.return&&E.return()}finally{if(y)throw _}}return S},t.default=p,e.exports=t.default})(Fv,Fv.exports);var NF=Fv.exports;(function(e,t){Object.defineProperty(t,"__esModule",{value:!0});var n=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(f){return typeof f}:function(f){return f&&typeof Symbol=="function"&&f.constructor===Symbol&&f!==Symbol.prototype?"symbol":typeof f},r=uF,a=u(r),i=hF,s=u(i),o=NF,l=u(o);function u(f){return f&&f.__esModule?f:{default:f}}var c=void 0;t.default=function(f){var p=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},d=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,v=(0,a.default)();if(c||(c=(0,s.default)(v)),p.events)throw new Error("Event handlers cannot be overwritten.");if(typeof f=="string"&&!document.getElementById(f))throw new Error('Element "'+f+'" does not exist.');p.events=l.default.proxyEvents(v);var S=new Promise(function(g){if((typeof f>"u"?"undefined":n(f))==="object"&&f.playVideo instanceof Function){var y=f;g(y)}else c.then(function(_){var E=new _.Player(f,p);return v.on("ready",function(){g(E)}),null})}),x=l.default.promisifyPlayer(S,d);return x.on=v.on,x.off=v.off,x},e.exports=t.default})(Pv,Pv.exports);var EF=Pv.exports;const CF=Xm(EF);var LF=Object.defineProperty,jF=Object.defineProperties,TF=Object.getOwnPropertyDescriptors,_4=Object.getOwnPropertySymbols,OF=Object.prototype.hasOwnProperty,DF=Object.prototype.propertyIsEnumerable,A4=(e,t,n)=>t in e?LF(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Vv=(e,t)=>{for(var n in t||(t={}))OF.call(t,n)&&A4(e,n,t[n]);if(_4)for(var n of _4(t))DF.call(t,n)&&A4(e,n,t[n]);return e},Yv=(e,t)=>jF(e,TF(t)),RF=(e,t,n)=>new Promise((r,a)=>{var i=l=>{try{o(n.next(l))}catch(u){a(u)}},s=l=>{try{o(n.throw(l))}catch(u){a(u)}},o=l=>l.done?r(l.value):Promise.resolve(l.value).then(i,s);o((n=n.apply(e,t)).next())});function MF(e,t){var n,r;if(e.videoId!==t.videoId)return!0;const a=((n=e.opts)==null?void 0:n.playerVars)||{},i=((r=t.opts)==null?void 0:r.playerVars)||{};return a.start!==i.start||a.end!==i.end}function N4(e={}){return Yv(Vv({},e),{height:0,width:0,playerVars:Yv(Vv({},e.playerVars),{autoplay:0,start:0,end:0})})}function kF(e,t){return e.videoId!==t.videoId||!lF(N4(e.opts),N4(t.opts))}function PF(e,t){var n,r,a,i;return e.id!==t.id||e.className!==t.className||((n=e.opts)==null?void 0:n.width)!==((r=t.opts)==null?void 0:r.width)||((a=e.opts)==null?void 0:a.height)!==((i=t.opts)==null?void 0:i.height)||e.iframeClassName!==t.iframeClassName||e.title!==t.title}var IF={videoId:"",id:"",className:"",iframeClassName:"",style:{},title:"",loading:void 0,opts:{},onReady:()=>{},onError:()=>{},onPlay:()=>{},onPause:()=>{},onEnd:()=>{},onStateChange:()=>{},onPlaybackRateChange:()=>{},onPlaybackQualityChange:()=>{}},FF={videoId:wr.string,id:wr.string,className:wr.string,iframeClassName:wr.string,style:wr.object,title:wr.string,loading:wr.oneOf(["lazy","eager"]),opts:wr.objectOf(wr.any),onReady:wr.func,onError:wr.func,onPlay:wr.func,onPause:wr.func,onEnd:wr.func,onStateChange:wr.func,onPlaybackRateChange:wr.func,onPlaybackQualityChange:wr.func},Ip=class extends Lt.Component{constructor(e){super(e),this.destroyPlayerPromise=void 0,this.onPlayerReady=t=>{var n,r;return(r=(n=this.props).onReady)==null?void 0:r.call(n,t)},this.onPlayerError=t=>{var n,r;return(r=(n=this.props).onError)==null?void 0:r.call(n,t)},this.onPlayerStateChange=t=>{var n,r,a,i,s,o,l,u;switch((r=(n=this.props).onStateChange)==null||r.call(n,t),t.data){case Ip.PlayerState.ENDED:(i=(a=this.props).onEnd)==null||i.call(a,t);break;case Ip.PlayerState.PLAYING:(o=(s=this.props).onPlay)==null||o.call(s,t);break;case Ip.PlayerState.PAUSED:(u=(l=this.props).onPause)==null||u.call(l,t);break}},this.onPlayerPlaybackRateChange=t=>{var n,r;return(r=(n=this.props).onPlaybackRateChange)==null?void 0:r.call(n,t)},this.onPlayerPlaybackQualityChange=t=>{var n,r;return(r=(n=this.props).onPlaybackQualityChange)==null?void 0:r.call(n,t)},this.destroyPlayer=()=>this.internalPlayer?(this.destroyPlayerPromise=this.internalPlayer.destroy().then(()=>this.destroyPlayerPromise=void 0),this.destroyPlayerPromise):Promise.resolve(),this.createPlayer=()=>{if(typeof document>"u")return;if(this.destroyPlayerPromise){this.destroyPlayerPromise.then(this.createPlayer);return}const t=Yv(Vv({},this.props.opts),{videoId:this.props.videoId});this.internalPlayer=CF(this.container,t),this.internalPlayer.on("ready",this.onPlayerReady),this.internalPlayer.on("error",this.onPlayerError),this.internalPlayer.on("stateChange",this.onPlayerStateChange),this.internalPlayer.on("playbackRateChange",this.onPlayerPlaybackRateChange),this.internalPlayer.on("playbackQualityChange",this.onPlayerPlaybackQualityChange),(this.props.title||this.props.loading)&&this.internalPlayer.getIframe().then(n=>{this.props.title&&n.setAttribute("title",this.props.title),this.props.loading&&n.setAttribute("loading",this.props.loading)})},this.resetPlayer=()=>this.destroyPlayer().then(this.createPlayer),this.updatePlayer=()=>{var t;(t=this.internalPlayer)==null||t.getIframe().then(n=>{this.props.id?n.setAttribute("id",this.props.id):n.removeAttribute("id"),this.props.iframeClassName?n.setAttribute("class",this.props.iframeClassName):n.removeAttribute("class"),this.props.opts&&this.props.opts.width?n.setAttribute("width",this.props.opts.width.toString()):n.removeAttribute("width"),this.props.opts&&this.props.opts.height?n.setAttribute("height",this.props.opts.height.toString()):n.removeAttribute("height"),this.props.title?n.setAttribute("title",this.props.title):n.setAttribute("title","YouTube video player"),this.props.loading?n.setAttribute("loading",this.props.loading):n.removeAttribute("loading")})},this.getInternalPlayer=()=>this.internalPlayer,this.updateVideo=()=>{var t,n,r,a;if(typeof this.props.videoId>"u"||this.props.videoId===null){(t=this.internalPlayer)==null||t.stopVideo();return}let i=!1;const s={videoId:this.props.videoId};if((n=this.props.opts)!=null&&n.playerVars&&(i=this.props.opts.playerVars.autoplay===1,"start"in this.props.opts.playerVars&&(s.startSeconds=this.props.opts.playerVars.start),"end"in this.props.opts.playerVars&&(s.endSeconds=this.props.opts.playerVars.end)),i){(r=this.internalPlayer)==null||r.loadVideoById(s);return}(a=this.internalPlayer)==null||a.cueVideoById(s)},this.refContainer=t=>{this.container=t},this.container=null,this.internalPlayer=null}componentDidMount(){this.createPlayer()}componentDidUpdate(e){return RF(this,null,function*(){PF(e,this.props)&&this.updatePlayer(),kF(e,this.props)&&(yield this.resetPlayer()),MF(e,this.props)&&this.updateVideo()})}componentWillUnmount(){this.destroyPlayer()}render(){return Lt.createElement("div",{className:this.props.className,style:this.props.style},Lt.createElement("div",{id:this.props.id,className:this.props.iframeClassName,ref:this.refContainer}))}},Bg=Ip;Bg.propTypes=FF;Bg.defaultProps=IF;Bg.PlayerState={UNSTARTED:-1,ENDED:0,PLAYING:1,PAUSED:2,BUFFERING:3,CUED:5};var BF=Bg;function $F({orgNr:e,color1:t}){var y,_,E,D,R,O,j,$;const[n,r]=C.useState(0),a=C.useRef(null),i=C.useRef(null),{org_nr:s}=Cn(),{mediaItems:o,duration:l,loading:u}=tF(s||e),{darkMode:c}=or(),f=((y=o[n])==null?void 0:y.type)==="video",p=((_=o[n])==null?void 0:_.type)==="youtube",d=((E=o[n])==null?void 0:E.type)==="webpage";function v(V){if(!V)return null;const T=/(?:youtube\.com\/(?:[^\/\n\s]+\/\S+\/|(?:v|embed|shorts)\/|\S*?[?&]v=)|youtu\.be\/)([a-zA-Z0-9_-]{11})/,P=V.match(T);return P?P[1]:null}const S=()=>{r(V=>(V+1)%o.length)},x={height:"100%",width:"100%",playerVars:{autoplay:1,mute:1,controls:1,playlist:v((D=o[n])==null?void 0:D.path)||"",origin:window.location.origin}};C.useEffect(()=>(i.current&&clearInterval(i.current),!f&&!p&&o.length>0&&(i.current=setInterval(()=>{r(V=>(V+1)%o.length)},l)),()=>{i.current&&clearInterval(i.current)}),[n,f,p,o.length,l]),C.useEffect(()=>{if(f&&a.current){const V=a.current,T=()=>{r(P=>(P+1)%o.length)};return V.addEventListener("ended",T),()=>{V.removeEventListener("ended",T)}}},[n,f,o.length]);const g=V=>r(V);if(!u)return o.length===0?b.jsx("div",{className:"text-2xl font-semibold",style:{color:c?"#F5C45E":t},children:"No media found"}):b.jsxs("div",{className:"relative w-full h-full flex flex-col",children:[b.jsx("div",{className:"overflow-hidden w-full h-full flex items-center justify-center",children:d?b.jsx("iframe",{src:(R=o[n])==null?void 0:R.path,className:"w-full h-full object-contain",style:{border:"none"},sandbox:"allow-scripts allow-same-origin allow-forms allow-popups"}):p?b.jsx(BF,{videoId:v((O=o[n])==null?void 0:O.path)||"",opts:x,onEnd:S,className:"w-full h-full object-contain"}):f?b.jsx("video",{ref:a,src:(j=o[n])==null?void 0:j.path,autoPlay:!0,muted:!0,playsInline:!0,className:"w-full h-full object-contain"}):b.jsx("img",{src:($=o[n])==null?void 0:$.path,alt:"carousel item",className:"w-full h-full object-contain"})}),b.jsx("div",{className:"absolute bottom-4 left-1/2 -translate-x-1/2 flex gap-2 z-50",children:o.map((V,T)=>b.jsx("button",{type:"button",onClick:()=>g(T),className:`w-3 h-3 rounded-full ${T===n?"bg-white":"bg-gray-500"} transition duration-300`,"aria-label":`Go to slide ${T+1}`,tabIndex:0},T))})]})}const CN="mosque-announcements",Pm="announcements";async function E4(e){return await(await $n(CN,1,{upgrade(n){n.createObjectStore(Pm)}})).get(Pm,e)??null}async function UF(e,t){return(await $n(CN,1,{upgrade(r){r.createObjectStore(Pm)}})).put(Pm,t,e)}function zF(e){const[t,n]=C.useState(null),[r,a]=C.useState(!0);return C.useEffect(()=>{let i=null;const s=async()=>{if(a(!0),!navigator.onLine){const o=await E4(e);if(o!==null){n(o),a(!1);return}}try{const{data:o,error:l}=await Ke.from("mosque_t").select("announcement").eq("organisasjonsnummer",e).single();if(l)throw l;n(o.announcement??""),await UF(e,o.announcement??"")}catch(o){const l=await E4(e);l!==null&&n(l),console.log("error fetching announcement: ",o)}finally{a(!1)}};return s(),i=Ke.channel(`announcement-changes-${e}`).on("postgres_changes",{event:"*",schema:"public",table:"mosque_t",filter:`organisasjonsnummer=eq.${e}`},()=>{s()}).subscribe(),()=>{i==null||i.unsubscribe()}},[e]),{announcement:t,loading:r}}const LN=()=>{const{org_nr:e}=Cn(),{announcement:t,loading:n}=zF(e||"982842840"),r=n?"Loading...":t!=null&&t.trim()?t:"No announcements at the moment";return b.jsx("div",{className:"relative w-full overflow-hidden text-black bg-white py-0.5 lg:py-1.5 text-xl lg:text-2xl",children:b.jsx("div",{className:"ticker-text font-semibold",children:r})})},qF=({nr:e,prayerTimes:t,color:n,bg:r,isDefault:a})=>{const{darkMode:i}=or(),[s,o]=C.useState({label:"",hours:0,minutes:0,seconds:0});return C.useEffect(()=>{if(!t.length)return;function l(){o(Pg(t))}l();const u=setInterval(l,1e3);return()=>clearInterval(u)},[t]),s.label?b.jsxs("div",{className:"text-center font-bold text-lg sm:text-xl lg:text-2xl h-full flex justify-center items-center",style:{color:i?e===1?"#F2E7D5":e===2?"#F5C35E":"#0C221F":a?e===3?"#124170":"#000000":n,backgroundColor:i?e===1?"#53452D":e===2?"#102E50":"#67C090":a?e===1?"#C7B08A":e===2?"#F5C45E":"#67C090":r},children:[b.jsxs("span",{className:"",children:[s.label.includes("iqamah")?s.label:s.label.split(" ")[0]," in "]}),b.jsx("span",{className:"",children:`${String(s.hours).padStart(2,"0")}:${String(s.minutes).padStart(2,"0")}:${String(s.seconds).padStart(2,"0")}`})]}):null},HF=({nr:e,prayerTimes:t,prayerTimesColor:n,isDefault:r})=>b.jsxs("div",{className:"flex",children:[b.jsx("div",{className:"w-[30%]",children:b.jsx(qF,{nr:e,prayerTimes:t,color:n.text,bg:n.bg,isDefault:r})}),b.jsx(LN,{})]}),VF={BackgroundDiv:e=>{const{prayerTimes:t,prayerTimesWithSunrise:n,extraInfo:r,date:a,isDefault:i,textColor:s,prayerTimesColor:o,extraInfoColor:l,isPreview:u,announcement:c,...f}=e;return b.jsx("div",{...f})},TablePart:KI,AnnouncementPart:HF,PrayerPart:ZI,TimePart:XI,Carousel:$F};function Gv({components:e,componentProps:t}){const{darkMode:n}=or();return b.jsx(b.Fragment,{children:e.map((r,a)=>{var s,o,l,u,c,f,p,d,v,S,x,g;const i=VF[r.type];if(i){const y={...r.props||{},...t};let _={};return n?(s=r.style)!=null&&s.darkBackgroundImage?_={backgroundImage:`url(${"https://yhbphdjhoxovcxfoimdx.supabase.co/storage/v1/object/public"+r.style.darkBackgroundImage})`,backgroundSize:"cover",backgroundPosition:"center",backgroundRepeat:"no-repeat"}:(o=r.style)!=null&&o.backgroundColor?_={backgroundColor:r.style.backgroundColor}:(l=r.style)!=null&&l.darkBackground&&(_={backgroundColor:r.style.darkBackground}):(u=r.style)!=null&&u.backgroundColor?_={backgroundColor:r.style.backgroundColor,backgroundImage:"none"}:(c=r.style)!=null&&c.backgroundImage?_={backgroundImage:`url(${"https://yhbphdjhoxovcxfoimdx.supabase.co/storage/v1/object/public"+r.style.backgroundImage})`,backgroundSize:"cover",backgroundPosition:"center",backgroundRepeat:"no-repeat",filter:(f=r.style)==null?void 0:f.backgroundBlur}:(p=r.style)!=null&&p.background&&(_={backgroundColor:r.style.background}),b.jsx("div",{className:r.className||"",style:_,children:b.jsx(i,{...y})},a)}else if(r.components&&r.gridConfig){let y={};if((d=r.gridConfig.style)!=null&&d.backgroundImage){const _=n?(v=r.gridConfig.style)==null?void 0:v.darkBackgroundImage:(S=r.gridConfig.style)==null?void 0:S.backgroundImage;y=_?{backgroundImage:`url(${_})`,backgroundSize:"cover",backgroundPosition:"center",backgroundRepeat:"no-repeat",backgroundColor:n?"#1a1a1a":"#ffffff"}:{backgroundColor:((x=r.gridConfig.style)==null?void 0:x.backgroundColor)||(n?"#1a1a1a":"#ffffff")}}else(g=r.gridConfig.style)!=null&&g.backgroundColor&&(y=r.gridConfig.style);return b.jsx("div",{className:r.gridConfig.className+" "+(r.className||""),style:y,children:b.jsx(Gv,{components:r.components,componentProps:t})},a)}else return r.components?b.jsx("div",{className:r.className||"",children:b.jsx(Gv,{components:r.components,componentProps:t})},a):null})})}function YF({config:e,componentProps:t={}}){var s;const[n,r]=C.useState("loading"),{error:a,showBoundary:i}=dN();return C.useEffect(()=>{const o=setTimeout(()=>{n==="loading"&&(!e||!e.components)&&i(new Error("No Lobby layout configuration Found"))},5e3);return()=>clearTimeout(o)},[e,n]),C.useEffect(()=>{e!=null&&e.components&&e.gridConfig&&r("ready")},[e]),a?null:n==="loading"?b.jsx("div",{className:"min-h-screen flex items-center justify-center p-8 bg-gradient-to-br from-indigo-50 to-purple-50",children:b.jsxs("div",{className:"text-center max-w-md",children:[b.jsx("div",{className:"w-16 h-16 border-4 border-indigo-200 border-t-indigo-600 rounded-full animate-spin mx-auto mb-4"}),b.jsx("h2",{className:"text-xl font-semibold text-gray-900 mb-2",children:"Loading lobby..."}),b.jsx("p",{className:"text-gray-600",children:"Setting up your space"})]})}):b.jsx("div",{className:((s=e.gridConfig)==null?void 0:s.className)||"",children:b.jsx(Gv,{components:e.components,componentProps:t})})}function GF(e){const[t,n]=C.useState(null),[r,a]=C.useState(!0);return C.useEffect(()=>{let i=null;if(!e){n(null),a(!1);return}const s=async()=>{if(a(!0),!navigator.onLine){const o=await pc(`${e}-lobby`);if(o){n(o),a(!1);return}}try{const{data:o}=await Ke.from("layout").select("lobby_theme_id, lobby_layout").eq("mosque_id",e).single();if(o&&o.lobby_layout)n(o.lobby_layout),await vl(`${e}-lobby`,o.lobby_layout);else{const{data:l,error:u}=await Ke.from("mosque_t").select("organisasjonsnummer").eq("organisasjonsnummer",e).single();if(!l||u){Ht("error","Please enter a valid org_nr!");return}const{data:c,error:f}=await Ke.from("layout").select("lobby_theme_id, lobby_layout").eq("mosque_id",982842840).single();if(f)throw f;const{error:p}=await Ke.from("layout").upsert([{mosque_id:e,lobby_theme_id:c.lobby_theme_id,lobby_layout:c==null?void 0:c.lobby_layout}],{onConflict:"mosque_id"}).single();if(p)throw p;n(c==null?void 0:c.lobby_layout),await vl(`${e}-lobby`,c==null?void 0:c.lobby_layout)}}catch(o){const l=await pc(`${e}-lobby`);l&&n(l),console.log("Error fetching config: ",o)}finally{a(!1)}};return s(),i=Ke.channel(`lobby_layout_changes: ${e}`).on("postgres_changes",{event:"*",schema:"public",table:"layout",filter:`mosque_id=eq.${e}`},()=>{s()}),i.subscribe(),()=>{i==null||i.unsubscribe()}},[e]),{config:t,loading:r}}function WF(){const{org_nr:e}=Cn(),t=fa(),n=new Date().toISOString().split("T")[0],{config:r}=GF(e),{isDefault:a,textColor:i,prayerTimesColor:s,extraInfoColor:o,...l}=r||{},{prayerTimes:u,extraInfo:c,loading:f}=mN(e,n),{setDarkMode:p}=or();C.useEffect(()=>{if(!u||u.length===0)return;const x=()=>{const y=yN(u);y==="dark"?p(!0):y==="light"&&p(!1)};x();const g=setInterval(x,60*1e3);return()=>clearInterval(g)},[u,p]),Ms(e);const d=C.useRef(null),[v,S]=C.useState(!1);return C.useEffect(()=>{const x=()=>{S(!!document.fullscreenElement)};return document.addEventListener("fullscreenchange",x),()=>document.removeEventListener("fullscreenchange",x)},[]),f?b.jsx("div",{className:"h-screen",children:b.jsx(hc,{})}):u?b.jsxs("div",{ref:d,className:"relative",children:[!v&&b.jsxs(b.Fragment,{children:[b.jsx("button",{onClick:()=>t(`/${e||"982842840"}`),className:"absolute top-4 right-26 z-50 px-3 py-1 text-sm text-white font-semibold rounded-lg shadow-md hover:opacity-90 hover:cursor-pointer transition",style:{backgroundColor:i||"#4F46E5"},children:b.jsx(bN,{size:24,className:"cursor-pointer"})}),b.jsx("button",{onClick:()=>t(`/${e}/masjid`),className:"absolute top-4 right-13 z-50 px-3 py-1 text-sm text-white font-semibold rounded-lg shadow-md hover:opacity-90 hover:cursor-pointer transition",style:{backgroundColor:i||"#4F46E5"},children:b.jsx(wN,{size:24,className:"cursor-pointer"})})]}),b.jsx(vN,{targetRef:d}),b.jsx(YF,{config:l,componentProps:{date:n,prayerTimes:u,extraInfo:c,textColor:i,prayerTimesColor:s,extraInfoColor:o,isDefault:a,isPreview:!1}})]}):b.jsx("div",{children:"Prayer times not found."})}function JF(e){return lr({attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M261.56 101.28a8 8 0 0 0-11.06 0L66.4 277.15a8 8 0 0 0-2.47 5.79L63.9 448a32 32 0 0 0 32 32H192a16 16 0 0 0 16-16V328a8 8 0 0 1 8-8h80a8 8 0 0 1 8 8v136a16 16 0 0 0 16 16h96.06a32 32 0 0 0 32-32V282.94a8 8 0 0 0-2.47-5.79z"},child:[]},{tag:"path",attr:{d:"m490.91 244.15-74.8-71.56V64a16 16 0 0 0-16-16h-48a16 16 0 0 0-16 16v32l-57.92-55.38C272.77 35.14 264.71 32 256 32c-8.68 0-16.72 3.14-22.14 8.63l-212.7 203.5c-6.22 6-7 15.87-1.34 22.37A16 16 0 0 0 43 267.56L250.5 69.28a8 8 0 0 1 11.06 0l207.52 198.28a16 16 0 0 0 22.59-.44c6.14-6.36 5.63-16.86-.76-22.97z"},child:[]}]})(e)}function KF(e){return lr({attr:{viewBox:"0 0 384 512"},child:[{tag:"path",attr:{d:"M215.7 499.2C267 435 384 279.4 384 192C384 86 298 0 192 0S0 86 0 192c0 87.4 117 243 168.3 307.2c12.3 15.3 35.1 15.3 47.4 0zM192 128a64 64 0 1 1 0 128 64 64 0 1 1 0-128z"},child:[]}]})(e)}const jN="prayer-times-db",Vu="prayerTimes";async function C4(e,t){await(await $n(jN,1,{upgrade(r){r.objectStoreNames.contains(Vu)||r.createObjectStore(Vu)}})).put(Vu,t,e)}async function XF(e){return(await $n(jN,1,{upgrade(n){n.objectStoreNames.contains(Vu)||n.createObjectStore(Vu)}})).get(Vu,e)}function QF(e,t,n,r){return e?`mosque_${e}_${n}`:`location_${t}_${n}_${r}`}function ZF(e){return!e||e.length<6?e:[e[0],e[5],...e.slice(1,5)]}function eB({locationId:e,org_nr:t,date:n,asrMethod:r,prayerMethod:a}){const[i,s]=C.useState([]),[o,l]=C.useState([]),[u,c]=C.useState(!1),[f]=C.useState(navigator.onLine);return C.useEffect(()=>{let d=null,v=null;c(!1);const S=n.toISOString().split("T")[0],x=QF(t,e,S,r),g=async()=>{const y=await XF(x);if(y&&(s(ZF(y.prayerTimes)),l(y.extraInfo)),!f){c(!0);return}try{if(t){const{prayerTimes:_,extraInfo:E}=await pN(t,S,r,a);(_==null?void 0:_.length)>0&&(s(_),l(E||[]),await C4(x,{prayerTimes:_,extraInfo:E||[]}))}else{const{prayerTimes:_}=await II(e,S,r,a);(_==null?void 0:_.length)>0&&(s(_),await C4(x,{prayerTimes:_,extraInfo:o}))}}catch(_){console.error("Failed to fetch prayer times:",_)}c(!0)};return g(),t&&f&&(d=Ke.channel("prayer_times_changes").on("postgres_changes",{event:"*",schema:"public",table:"mosque_jamatperiode",filter:`mosque_id=eq.${t}`},g).subscribe(),v=Ke.channel("mosque_t_changes").on("postgres_changes",{event:"*",schema:"public",table:"mosque_t",filter:`organisasjonsnummer=eq.${t}`},g).subscribe()),()=>{d&&Ke.removeChannel(d),v&&Ke.removeChannel(v)}},[e,t,n,r,a,f]),{prayerTimes:Ig(i),prayerTimesWithSunrise:i,extraInfo:o,ready:u,isOnline:f}}const tB=async()=>{try{const{data:e,error:t}=await Ke.from("location_t").select("location_name, location_iso");if(t){console.error("Error fetching locations: ",t),Ht("error","Error fetching locations");return}if(!e||e.length===0){console.error("No data fetched"),Ht("error","No data fetched");return}const n=new Intl.Collator("nb-NO");return e.map(({location_name:a,location_iso:i})=>({name:a,id:i})).sort((a,i)=>n.compare(a.name,i.name))}catch(e){console.error("Error fetching locations: ",e),Ht("error","Error fetching locations");return}},nB=async e=>{try{const{data:t,error:n}=await Ke.from("mosque_t").select(`
107
+ reg_postnummer,
108
+ post_no,
109
+ lat,
110
+ lon,
111
+ location_postnumber (
112
+ location_iso,
113
+ location_t (
114
+ lat_n_s,
115
+ long_e_w
116
+ )
117
+ )
118
+ `).eq("organisasjonsnummer",e).single();if(n)throw n;if(!t)return;const r=Array.isArray(t.location_postnumber)?t.location_postnumber[0]:t.location_postnumber,a=Array.isArray(r==null?void 0:r.location_t)?r.location_t[0]:r==null?void 0:r.location_t;return{location_iso:(r==null?void 0:r.location_iso)||null,lat:t.lat||(a==null?void 0:a.lat_n_s)||null,lon:t.lon||(a==null?void 0:a.long_e_w)||null}}catch(t){console.error(`Error fetching location for mosque ${e}: `,t),Ht("error",`Error fetching location for mosque ${e}: ${t.message}`);return}},rB=async e=>{try{const{data:t,error:n}=await Ke.from("location_t").select("lat_n_s, long_e_w").eq("location_iso",e).single();if(n||!t)throw n||new Error("No locTation data found");return{lat:t.lat_n_s,lon:t.long_e_w}}catch(t){console.error(`Error fetching coordinates of location ${e}: `,t),Ht("error",`Error fetching location for location ${e}`);return}};function aB(e){const[t,n]=C.useState([]),[r,a]=C.useState(!0);return C.useEffect(()=>{(async()=>{try{const i=await vI(e);n(i)}catch(i){console.error("Error fetching special dates: ",i),Ht("error",i.message||"Failed to load special dates")}finally{a(!1)}})()},[e]),{events:t,loading:r}}const iB="layoutDB",Im="colorSchemeStore",sB=1;async function TN(){return $n(iB,sB,{upgrade(e){e.objectStoreNames.contains(Im)||e.createObjectStore(Im)}})}async function oB(e,t){await(await TN()).put(Im,t,e)}async function L4(e){return await(await TN()).get(Im,e)}function lB(e="982842840",t){const[n,r]=C.useState({isDefault:!0,bgImage:"",bgOpacity:1,bgRepeat:"",bgColor:"",textColor:"",prayerTimesColor:{bg:"",text:""}}),[a,i]=C.useState(!0);return C.useEffect(()=>{if(!e&&!t)return;const s=e||t||"982842840",o=async()=>{var u,c,f,p,d,v;try{if(!navigator.onLine){const D=await L4(s);if(D){r(D),i(!1);return}}const{data:S,error:x}=await Ke.from("layout").select("ud_layout").eq("mosque_id",s).single();if(x)throw x;const g=S.ud_layout,y=(u=g==null?void 0:g.components)==null?void 0:u.find(D=>D.type==="BackgroundDiv"),_=(c=g==null?void 0:g.components)==null?void 0:c.find(D=>D.type==="Main"),E={isDefault:(g==null?void 0:g.isDefault)??!0,bgImage:((f=y==null?void 0:y.style)==null?void 0:f.backgroundImage)??"",bgOpacity:((p=y==null?void 0:y.style)==null?void 0:p.backgroundOpacity)??1,bgRepeat:((d=y==null?void 0:y.style)==null?void 0:d.backgroundRepeat)??"",bgColor:((v=_==null?void 0:_.style)==null?void 0:v.backgroundColor)??"",textColor:(g==null?void 0:g.textColor)??"",prayerTimesColor:(g==null?void 0:g.prayerTimesColor)??{}};r(E),await oB(s,E)}catch(S){console.error("Error fetching color scheme:",S);const x=await L4(s);r(x||{isDefault:!0,bgImage:"",bgOpacity:1,bgRepeat:"",bgColor:"",textColor:"",prayerTimesColor:{bg:"",text:""}})}finally{i(!1)}};o();const l=Ke.channel("color_scheme_changes").on("postgres_changes",{event:"*",schema:"public",table:"layout",filter:`mosque_id=eq.${s}`},()=>{console.log("Realtime update detected for color scheme"),o()}).subscribe();return()=>{Ke.removeChannel(l)}},[e,t]),{colorScheme:n,loading:a}}const ON=C.createContext(null),da=()=>{const e=C.useContext(ON);if(!e)throw new Error("useUDContext must be used within a <UDProvider>");return e},DN=({children:e,org_nr:t,loc_id:n})=>{const[r,a]=C.useState("NO0301"),[i,s]=C.useState({value:"",label:""}),o=new Date,[l,u]=C.useState(o),[c,f]=C.useState(null),[p,d]=C.useState(null),[v,S]=C.useState("en"),[x,g]=C.useState(0),[y,_]=C.useState(1),[E,D]=C.useState("Monthly"),[R,O]=C.useState(new Date(o.getFullYear(),o.getMonth(),1)),[j,$]=C.useState(new Date(o.getFullYear(),o.getMonth()+1,0)),[V,T]=C.useState(null),[P,q]=C.useState(null),[Y,se]=C.useState([]),{language:G}=Ms(t||(i==null?void 0:i.value));C.useEffect(()=>{v==="en"&&G&&S(G)},[G]);const{masjidLogo:ne}=Hd(t||(i==null?void 0:i.value)||"982842840"),{events:Q,loading:ie}=aB(v),{colorScheme:J}=lB(t,i==null?void 0:i.value);C.useEffect(()=>{(async()=>{const ee=await aN();se(ee)})()},[]),C.useEffect(()=>{if(n)a(n),(async()=>{const ee=await rB(n);ee&&(T(ee.lat),q(ee.lon))})();else if(t){const B=async()=>{const fe=await nB(t);fe&&(a(fe.location_iso),T(fe.lat),q(fe.lon))},ee=async()=>{const fe=await gI(t);fe&&s(fe)};B(),ee()}},[n,t]),C.useEffect(()=>{(async()=>{const ee=await nN(t||(i==null?void 0:i.value)||"982842840");ee&&ee.asr_method!==void 0&&g(ee.asr_method),ee&&ee.prayer_method!==void 0&&_(ee.prayer_method)})()},[t,i==null?void 0:i.value]);const{prayerTimes:le,prayerTimesWithSunrise:L,extraInfo:z,ready:W}=eB(n?{org_nr:t||(i==null?void 0:i.value)||null,locationId:n,date:l,asrMethod:x,prayerMethod:y}:{org_nr:t||(i==null?void 0:i.value)||"982842840",locationId:r||"NO0301",date:l,asrMethod:x,prayerMethod:y}),te=Lt.useMemo(()=>({locationId:r,setLocationId:a,selectedMosque:i,setSelectedMosque:s,date:l,setDate:u,hijriDay:c,setHijriDay:f,nextHijriDay:p,setNextHijriDay:d,asrMethod:x,setAsrMethod:g,prayerMethod:y,setPrayerMethod:_,language:v,setLanguage:S,org_nr:(i==null?void 0:i.value)||t||null,prayerTimes:le,prayerTimesWithSunrise:L,extraInfo:z,prayerTimesReady:W,periodType:E,setPeriodType:D,periodFrom:R,periodTo:j,setPeriodFrom:O,setPeriodTo:$,events:Q,eventsLoading:ie,colorScheme:J,mosqueLogo:ne,lat:V,lon:P,hijriMonthNames:Y}),[r,i,l,c,p,x,y,v,t,le,L,z,E,R,j,Q,ie,J,ne,V,P,Y]);return b.jsx(ON.Provider,{value:te,children:e})};function Ut(e){"@babel/helpers - typeof";return Ut=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Ut(e)}function uB(e,t){if(Ut(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(Ut(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function RN(e){var t=uB(e,"string");return Ut(t)=="symbol"?t:t+""}function Lf(e,t,n){return(t=RN(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function j4(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function st(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?j4(Object(n),!0).forEach(function(r){Lf(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):j4(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function cB(e){if(Array.isArray(e))return e}function fB(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,a,i,s,o=[],l=!0,u=!1;try{if(i=(n=n.call(e)).next,t===0){if(Object(n)!==n)return;l=!1}else for(;!(l=(r=i.call(n)).done)&&(o.push(r.value),o.length!==t);l=!0);}catch(c){u=!0,a=c}finally{try{if(!l&&n.return!=null&&(s=n.return(),Object(s)!==s))return}finally{if(u)throw a}}return o}}function Wv(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function MN(e,t){if(e){if(typeof e=="string")return Wv(e,t);var n={}.toString.call(e).slice(8,-1);return n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set"?Array.from(e):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Wv(e,t):void 0}}function dB(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
119
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Ss(e,t){return cB(e)||fB(e,t)||MN(e,t)||dB()}function hB(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}function ks(e,t){if(e==null)return{};var n,r,a=hB(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}var pB=["defaultInputValue","defaultMenuIsOpen","defaultValue","inputValue","menuIsOpen","onChange","onInputChange","onMenuClose","onMenuOpen","value"];function mB(e){var t=e.defaultInputValue,n=t===void 0?"":t,r=e.defaultMenuIsOpen,a=r===void 0?!1:r,i=e.defaultValue,s=i===void 0?null:i,o=e.inputValue,l=e.menuIsOpen,u=e.onChange,c=e.onInputChange,f=e.onMenuClose,p=e.onMenuOpen,d=e.value,v=ks(e,pB),S=C.useState(o!==void 0?o:n),x=Ss(S,2),g=x[0],y=x[1],_=C.useState(l!==void 0?l:a),E=Ss(_,2),D=E[0],R=E[1],O=C.useState(d!==void 0?d:s),j=Ss(O,2),$=j[0],V=j[1],T=C.useCallback(function(Q,ie){typeof u=="function"&&u(Q,ie),V(Q)},[u]),P=C.useCallback(function(Q,ie){var J;typeof c=="function"&&(J=c(Q,ie)),y(J!==void 0?J:Q)},[c]),q=C.useCallback(function(){typeof p=="function"&&p(),R(!0)},[p]),Y=C.useCallback(function(){typeof f=="function"&&f(),R(!1)},[f]),se=o!==void 0?o:g,G=l!==void 0?l:D,ne=d!==void 0?d:$;return st(st({},v),{},{inputValue:se,menuIsOpen:G,onChange:T,onInputChange:P,onMenuClose:Y,onMenuOpen:q,value:ne})}function ot(){return ot=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},ot.apply(null,arguments)}function gB(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function T4(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,RN(r.key),r)}}function vB(e,t,n){return t&&T4(e.prototype,t),n&&T4(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function Jv(e,t){return Jv=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,r){return n.__proto__=r,n},Jv(e,t)}function yB(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Jv(e,t)}function Fm(e){return Fm=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Fm(e)}function kN(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(kN=function(){return!!e})()}function bB(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function wB(e,t){if(t&&(Ut(t)=="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return bB(e)}function xB(e){var t=kN();return function(){var n,r=Fm(e);if(t){var a=Fm(this).constructor;n=Reflect.construct(r,arguments,a)}else n=r.apply(this,arguments);return wB(this,n)}}function SB(e){if(Array.isArray(e))return Wv(e)}function _B(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function AB(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
120
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function I5(e){return SB(e)||_B(e)||MN(e)||AB()}function NB(e){if(e.sheet)return e.sheet;for(var t=0;t<document.styleSheets.length;t++)if(document.styleSheets[t].ownerNode===e)return document.styleSheets[t]}function EB(e){var t=document.createElement("style");return t.setAttribute("data-emotion",e.key),e.nonce!==void 0&&t.setAttribute("nonce",e.nonce),t.appendChild(document.createTextNode("")),t.setAttribute("data-s",""),t}var CB=function(){function e(n){var r=this;this._insertTag=function(a){var i;r.tags.length===0?r.insertionPoint?i=r.insertionPoint.nextSibling:r.prepend?i=r.container.firstChild:i=r.before:i=r.tags[r.tags.length-1].nextSibling,r.container.insertBefore(a,i),r.tags.push(a)},this.isSpeedy=n.speedy===void 0?!0:n.speedy,this.tags=[],this.ctr=0,this.nonce=n.nonce,this.key=n.key,this.container=n.container,this.prepend=n.prepend,this.insertionPoint=n.insertionPoint,this.before=null}var t=e.prototype;return t.hydrate=function(r){r.forEach(this._insertTag)},t.insert=function(r){this.ctr%(this.isSpeedy?65e3:1)===0&&this._insertTag(EB(this));var a=this.tags[this.tags.length-1];if(this.isSpeedy){var i=NB(a);try{i.insertRule(r,i.cssRules.length)}catch{}}else a.appendChild(document.createTextNode(r));this.ctr++},t.flush=function(){this.tags.forEach(function(r){var a;return(a=r.parentNode)==null?void 0:a.removeChild(r)}),this.tags=[],this.ctr=0},e}(),Mr="-ms-",Bm="-moz-",Jt="-webkit-",PN="comm",F5="rule",B5="decl",LB="@import",IN="@keyframes",jB="@layer",TB=Math.abs,$g=String.fromCharCode,OB=Object.assign;function DB(e,t){return Sr(e,0)^45?(((t<<2^Sr(e,0))<<2^Sr(e,1))<<2^Sr(e,2))<<2^Sr(e,3):0}function FN(e){return e.trim()}function RB(e,t){return(e=t.exec(e))?e[0]:e}function Kt(e,t,n){return e.replace(t,n)}function Kv(e,t){return e.indexOf(t)}function Sr(e,t){return e.charCodeAt(t)|0}function wd(e,t,n){return e.slice(t,n)}function Oi(e){return e.length}function $5(e){return e.length}function op(e,t){return t.push(e),e}function MB(e,t){return e.map(t).join("")}var Ug=1,mc=1,BN=0,ua=0,tr=0,Cc="";function zg(e,t,n,r,a,i,s){return{value:e,root:t,parent:n,type:r,props:a,children:i,line:Ug,column:mc,length:s,return:""}}function vf(e,t){return OB(zg("",null,null,"",null,null,0),e,{length:-e.length},t)}function kB(){return tr}function PB(){return tr=ua>0?Sr(Cc,--ua):0,mc--,tr===10&&(mc=1,Ug--),tr}function Oa(){return tr=ua<BN?Sr(Cc,ua++):0,mc++,tr===10&&(mc=1,Ug++),tr}function $i(){return Sr(Cc,ua)}function Fp(){return ua}function Yd(e,t){return wd(Cc,e,t)}function xd(e){switch(e){case 0:case 9:case 10:case 13:case 32:return 5;case 33:case 43:case 44:case 47:case 62:case 64:case 126:case 59:case 123:case 125:return 4;case 58:return 3;case 34:case 39:case 40:case 91:return 2;case 41:case 93:return 1}return 0}function $N(e){return Ug=mc=1,BN=Oi(Cc=e),ua=0,[]}function UN(e){return Cc="",e}function Bp(e){return FN(Yd(ua-1,Xv(e===91?e+2:e===40?e+1:e)))}function IB(e){for(;(tr=$i())&&tr<33;)Oa();return xd(e)>2||xd(tr)>3?"":" "}function FB(e,t){for(;--t&&Oa()&&!(tr<48||tr>102||tr>57&&tr<65||tr>70&&tr<97););return Yd(e,Fp()+(t<6&&$i()==32&&Oa()==32))}function Xv(e){for(;Oa();)switch(tr){case e:return ua;case 34:case 39:e!==34&&e!==39&&Xv(tr);break;case 40:e===41&&Xv(e);break;case 92:Oa();break}return ua}function BB(e,t){for(;Oa()&&e+tr!==57;)if(e+tr===84&&$i()===47)break;return"/*"+Yd(t,ua-1)+"*"+$g(e===47?e:Oa())}function $B(e){for(;!xd($i());)Oa();return Yd(e,ua)}function UB(e){return UN($p("",null,null,null,[""],e=$N(e),0,[0],e))}function $p(e,t,n,r,a,i,s,o,l){for(var u=0,c=0,f=s,p=0,d=0,v=0,S=1,x=1,g=1,y=0,_="",E=a,D=i,R=r,O=_;x;)switch(v=y,y=Oa()){case 40:if(v!=108&&Sr(O,f-1)==58){Kv(O+=Kt(Bp(y),"&","&\f"),"&\f")!=-1&&(g=-1);break}case 34:case 39:case 91:O+=Bp(y);break;case 9:case 10:case 13:case 32:O+=IB(v);break;case 92:O+=FB(Fp()-1,7);continue;case 47:switch($i()){case 42:case 47:op(zB(BB(Oa(),Fp()),t,n),l);break;default:O+="/"}break;case 123*S:o[u++]=Oi(O)*g;case 125*S:case 59:case 0:switch(y){case 0:case 125:x=0;case 59+c:g==-1&&(O=Kt(O,/\f/g,"")),d>0&&Oi(O)-f&&op(d>32?D4(O+";",r,n,f-1):D4(Kt(O," ","")+";",r,n,f-2),l);break;case 59:O+=";";default:if(op(R=O4(O,t,n,u,c,a,o,_,E=[],D=[],f),i),y===123)if(c===0)$p(O,t,R,R,E,i,f,o,D);else switch(p===99&&Sr(O,3)===110?100:p){case 100:case 108:case 109:case 115:$p(e,R,R,r&&op(O4(e,R,R,0,0,a,o,_,a,E=[],f),D),a,D,f,o,r?E:D);break;default:$p(O,R,R,R,[""],D,0,o,D)}}u=c=d=0,S=g=1,_=O="",f=s;break;case 58:f=1+Oi(O),d=v;default:if(S<1){if(y==123)--S;else if(y==125&&S++==0&&PB()==125)continue}switch(O+=$g(y),y*S){case 38:g=c>0?1:(O+="\f",-1);break;case 44:o[u++]=(Oi(O)-1)*g,g=1;break;case 64:$i()===45&&(O+=Bp(Oa())),p=$i(),c=f=Oi(_=O+=$B(Fp())),y++;break;case 45:v===45&&Oi(O)==2&&(S=0)}}return i}function O4(e,t,n,r,a,i,s,o,l,u,c){for(var f=a-1,p=a===0?i:[""],d=$5(p),v=0,S=0,x=0;v<r;++v)for(var g=0,y=wd(e,f+1,f=TB(S=s[v])),_=e;g<d;++g)(_=FN(S>0?p[g]+" "+y:Kt(y,/&\f/g,p[g])))&&(l[x++]=_);return zg(e,t,n,a===0?F5:o,l,u,c)}function zB(e,t,n){return zg(e,t,n,PN,$g(kB()),wd(e,2,-2),0)}function D4(e,t,n,r){return zg(e,t,n,B5,wd(e,0,r),wd(e,r+1,-1),r)}function Yu(e,t){for(var n="",r=$5(e),a=0;a<r;a++)n+=t(e[a],a,e,t)||"";return n}function qB(e,t,n,r){switch(e.type){case jB:if(e.children.length)break;case LB:case B5:return e.return=e.return||e.value;case PN:return"";case IN:return e.return=e.value+"{"+Yu(e.children,r)+"}";case F5:e.value=e.props.join(",")}return Oi(n=Yu(e.children,r))?e.return=e.value+"{"+n+"}":""}function HB(e){var t=$5(e);return function(n,r,a,i){for(var s="",o=0;o<t;o++)s+=e[o](n,r,a,i)||"";return s}}function VB(e){return function(t){t.root||(t=t.return)&&e(t)}}function YB(e){var t=Object.create(null);return function(n){return t[n]===void 0&&(t[n]=e(n)),t[n]}}var GB=function(t,n,r){for(var a=0,i=0;a=i,i=$i(),a===38&&i===12&&(n[r]=1),!xd(i);)Oa();return Yd(t,ua)},WB=function(t,n){var r=-1,a=44;do switch(xd(a)){case 0:a===38&&$i()===12&&(n[r]=1),t[r]+=GB(ua-1,n,r);break;case 2:t[r]+=Bp(a);break;case 4:if(a===44){t[++r]=$i()===58?"&\f":"",n[r]=t[r].length;break}default:t[r]+=$g(a)}while(a=Oa());return t},JB=function(t,n){return UN(WB($N(t),n))},R4=new WeakMap,KB=function(t){if(!(t.type!=="rule"||!t.parent||t.length<1)){for(var n=t.value,r=t.parent,a=t.column===r.column&&t.line===r.line;r.type!=="rule";)if(r=r.parent,!r)return;if(!(t.props.length===1&&n.charCodeAt(0)!==58&&!R4.get(r))&&!a){R4.set(t,!0);for(var i=[],s=JB(n,i),o=r.props,l=0,u=0;l<s.length;l++)for(var c=0;c<o.length;c++,u++)t.props[u]=i[l]?s[l].replace(/&\f/g,o[c]):o[c]+" "+s[l]}}},XB=function(t){if(t.type==="decl"){var n=t.value;n.charCodeAt(0)===108&&n.charCodeAt(2)===98&&(t.return="",t.value="")}};function zN(e,t){switch(DB(e,t)){case 5103:return Jt+"print-"+e+e;case 5737:case 4201:case 3177:case 3433:case 1641:case 4457:case 2921:case 5572:case 6356:case 5844:case 3191:case 6645:case 3005:case 6391:case 5879:case 5623:case 6135:case 4599:case 4855:case 4215:case 6389:case 5109:case 5365:case 5621:case 3829:return Jt+e+e;case 5349:case 4246:case 4810:case 6968:case 2756:return Jt+e+Bm+e+Mr+e+e;case 6828:case 4268:return Jt+e+Mr+e+e;case 6165:return Jt+e+Mr+"flex-"+e+e;case 5187:return Jt+e+Kt(e,/(\w+).+(:[^]+)/,Jt+"box-$1$2"+Mr+"flex-$1$2")+e;case 5443:return Jt+e+Mr+"flex-item-"+Kt(e,/flex-|-self/,"")+e;case 4675:return Jt+e+Mr+"flex-line-pack"+Kt(e,/align-content|flex-|-self/,"")+e;case 5548:return Jt+e+Mr+Kt(e,"shrink","negative")+e;case 5292:return Jt+e+Mr+Kt(e,"basis","preferred-size")+e;case 6060:return Jt+"box-"+Kt(e,"-grow","")+Jt+e+Mr+Kt(e,"grow","positive")+e;case 4554:return Jt+Kt(e,/([^-])(transform)/g,"$1"+Jt+"$2")+e;case 6187:return Kt(Kt(Kt(e,/(zoom-|grab)/,Jt+"$1"),/(image-set)/,Jt+"$1"),e,"")+e;case 5495:case 3959:return Kt(e,/(image-set\([^]*)/,Jt+"$1$`$1");case 4968:return Kt(Kt(e,/(.+:)(flex-)?(.*)/,Jt+"box-pack:$3"+Mr+"flex-pack:$3"),/s.+-b[^;]+/,"justify")+Jt+e+e;case 4095:case 3583:case 4068:case 2532:return Kt(e,/(.+)-inline(.+)/,Jt+"$1$2")+e;case 8116:case 7059:case 5753:case 5535:case 5445:case 5701:case 4933:case 4677:case 5533:case 5789:case 5021:case 4765:if(Oi(e)-1-t>6)switch(Sr(e,t+1)){case 109:if(Sr(e,t+4)!==45)break;case 102:return Kt(e,/(.+:)(.+)-([^]+)/,"$1"+Jt+"$2-$3$1"+Bm+(Sr(e,t+3)==108?"$3":"$2-$3"))+e;case 115:return~Kv(e,"stretch")?zN(Kt(e,"stretch","fill-available"),t)+e:e}break;case 4949:if(Sr(e,t+1)!==115)break;case 6444:switch(Sr(e,Oi(e)-3-(~Kv(e,"!important")&&10))){case 107:return Kt(e,":",":"+Jt)+e;case 101:return Kt(e,/(.+:)([^;!]+)(;|!.+)?/,"$1"+Jt+(Sr(e,14)===45?"inline-":"")+"box$3$1"+Jt+"$2$3$1"+Mr+"$2box$3")+e}break;case 5936:switch(Sr(e,t+11)){case 114:return Jt+e+Mr+Kt(e,/[svh]\w+-[tblr]{2}/,"tb")+e;case 108:return Jt+e+Mr+Kt(e,/[svh]\w+-[tblr]{2}/,"tb-rl")+e;case 45:return Jt+e+Mr+Kt(e,/[svh]\w+-[tblr]{2}/,"lr")+e}return Jt+e+Mr+e+e}return e}var QB=function(t,n,r,a){if(t.length>-1&&!t.return)switch(t.type){case B5:t.return=zN(t.value,t.length);break;case IN:return Yu([vf(t,{value:Kt(t.value,"@","@"+Jt)})],a);case F5:if(t.length)return MB(t.props,function(i){switch(RB(i,/(::plac\w+|:read-\w+)/)){case":read-only":case":read-write":return Yu([vf(t,{props:[Kt(i,/:(read-\w+)/,":"+Bm+"$1")]})],a);case"::placeholder":return Yu([vf(t,{props:[Kt(i,/:(plac\w+)/,":"+Jt+"input-$1")]}),vf(t,{props:[Kt(i,/:(plac\w+)/,":"+Bm+"$1")]}),vf(t,{props:[Kt(i,/:(plac\w+)/,Mr+"input-$1")]})],a)}return""})}},ZB=[QB],e$=function(t){var n=t.key;if(n==="css"){var r=document.querySelectorAll("style[data-emotion]:not([data-s])");Array.prototype.forEach.call(r,function(S){var x=S.getAttribute("data-emotion");x.indexOf(" ")!==-1&&(document.head.appendChild(S),S.setAttribute("data-s",""))})}var a=t.stylisPlugins||ZB,i={},s,o=[];s=t.container||document.head,Array.prototype.forEach.call(document.querySelectorAll('style[data-emotion^="'+n+' "]'),function(S){for(var x=S.getAttribute("data-emotion").split(" "),g=1;g<x.length;g++)i[x[g]]=!0;o.push(S)});var l,u=[KB,XB];{var c,f=[qB,VB(function(S){c.insert(S)})],p=HB(u.concat(a,f)),d=function(x){return Yu(UB(x),p)};l=function(x,g,y,_){c=y,d(x?x+"{"+g.styles+"}":g.styles),_&&(v.inserted[g.name]=!0)}}var v={key:n,sheet:new CB({key:n,container:s,nonce:t.nonce,speedy:t.speedy,prepend:t.prepend,insertionPoint:t.insertionPoint}),nonce:t.nonce,inserted:i,registered:{},insert:l};return v.sheet.hydrate(o),v},qN={exports:{}},sn={};/** @license React v16.13.1
121
+ * react-is.production.min.js
122
+ *
123
+ * Copyright (c) Facebook, Inc. and its affiliates.
124
+ *
125
+ * This source code is licensed under the MIT license found in the
126
+ * LICENSE file in the root directory of this source tree.
127
+ */var vr=typeof Symbol=="function"&&Symbol.for,U5=vr?Symbol.for("react.element"):60103,z5=vr?Symbol.for("react.portal"):60106,qg=vr?Symbol.for("react.fragment"):60107,Hg=vr?Symbol.for("react.strict_mode"):60108,Vg=vr?Symbol.for("react.profiler"):60114,Yg=vr?Symbol.for("react.provider"):60109,Gg=vr?Symbol.for("react.context"):60110,q5=vr?Symbol.for("react.async_mode"):60111,Wg=vr?Symbol.for("react.concurrent_mode"):60111,Jg=vr?Symbol.for("react.forward_ref"):60112,Kg=vr?Symbol.for("react.suspense"):60113,t$=vr?Symbol.for("react.suspense_list"):60120,Xg=vr?Symbol.for("react.memo"):60115,Qg=vr?Symbol.for("react.lazy"):60116,n$=vr?Symbol.for("react.block"):60121,r$=vr?Symbol.for("react.fundamental"):60117,a$=vr?Symbol.for("react.responder"):60118,i$=vr?Symbol.for("react.scope"):60119;function Ma(e){if(typeof e=="object"&&e!==null){var t=e.$$typeof;switch(t){case U5:switch(e=e.type,e){case q5:case Wg:case qg:case Vg:case Hg:case Kg:return e;default:switch(e=e&&e.$$typeof,e){case Gg:case Jg:case Qg:case Xg:case Yg:return e;default:return t}}case z5:return t}}}function HN(e){return Ma(e)===Wg}sn.AsyncMode=q5;sn.ConcurrentMode=Wg;sn.ContextConsumer=Gg;sn.ContextProvider=Yg;sn.Element=U5;sn.ForwardRef=Jg;sn.Fragment=qg;sn.Lazy=Qg;sn.Memo=Xg;sn.Portal=z5;sn.Profiler=Vg;sn.StrictMode=Hg;sn.Suspense=Kg;sn.isAsyncMode=function(e){return HN(e)||Ma(e)===q5};sn.isConcurrentMode=HN;sn.isContextConsumer=function(e){return Ma(e)===Gg};sn.isContextProvider=function(e){return Ma(e)===Yg};sn.isElement=function(e){return typeof e=="object"&&e!==null&&e.$$typeof===U5};sn.isForwardRef=function(e){return Ma(e)===Jg};sn.isFragment=function(e){return Ma(e)===qg};sn.isLazy=function(e){return Ma(e)===Qg};sn.isMemo=function(e){return Ma(e)===Xg};sn.isPortal=function(e){return Ma(e)===z5};sn.isProfiler=function(e){return Ma(e)===Vg};sn.isStrictMode=function(e){return Ma(e)===Hg};sn.isSuspense=function(e){return Ma(e)===Kg};sn.isValidElementType=function(e){return typeof e=="string"||typeof e=="function"||e===qg||e===Wg||e===Vg||e===Hg||e===Kg||e===t$||typeof e=="object"&&e!==null&&(e.$$typeof===Qg||e.$$typeof===Xg||e.$$typeof===Yg||e.$$typeof===Gg||e.$$typeof===Jg||e.$$typeof===r$||e.$$typeof===a$||e.$$typeof===i$||e.$$typeof===n$)};sn.typeOf=Ma;qN.exports=sn;var s$=qN.exports,VN=s$,o$={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},l$={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},YN={};YN[VN.ForwardRef]=o$;YN[VN.Memo]=l$;var u$=!0;function c$(e,t,n){var r="";return n.split(" ").forEach(function(a){e[a]!==void 0?t.push(e[a]+";"):a&&(r+=a+" ")}),r}var GN=function(t,n,r){var a=t.key+"-"+n.name;(r===!1||u$===!1)&&t.registered[a]===void 0&&(t.registered[a]=n.styles)},f$=function(t,n,r){GN(t,n,r);var a=t.key+"-"+n.name;if(t.inserted[n.name]===void 0){var i=n;do t.insert(n===i?"."+a:"",i,t.sheet,!0),i=i.next;while(i!==void 0)}};function d$(e){for(var t=0,n,r=0,a=e.length;a>=4;++r,a-=4)n=e.charCodeAt(r)&255|(e.charCodeAt(++r)&255)<<8|(e.charCodeAt(++r)&255)<<16|(e.charCodeAt(++r)&255)<<24,n=(n&65535)*1540483477+((n>>>16)*59797<<16),n^=n>>>24,t=(n&65535)*1540483477+((n>>>16)*59797<<16)^(t&65535)*1540483477+((t>>>16)*59797<<16);switch(a){case 3:t^=(e.charCodeAt(r+2)&255)<<16;case 2:t^=(e.charCodeAt(r+1)&255)<<8;case 1:t^=e.charCodeAt(r)&255,t=(t&65535)*1540483477+((t>>>16)*59797<<16)}return t^=t>>>13,t=(t&65535)*1540483477+((t>>>16)*59797<<16),((t^t>>>15)>>>0).toString(36)}var h$={animationIterationCount:1,aspectRatio:1,borderImageOutset:1,borderImageSlice:1,borderImageWidth:1,boxFlex:1,boxFlexGroup:1,boxOrdinalGroup:1,columnCount:1,columns:1,flex:1,flexGrow:1,flexPositive:1,flexShrink:1,flexNegative:1,flexOrder:1,gridRow:1,gridRowEnd:1,gridRowSpan:1,gridRowStart:1,gridColumn:1,gridColumnEnd:1,gridColumnSpan:1,gridColumnStart:1,msGridRow:1,msGridRowSpan:1,msGridColumn:1,msGridColumnSpan:1,fontWeight:1,lineHeight:1,opacity:1,order:1,orphans:1,scale:1,tabSize:1,widows:1,zIndex:1,zoom:1,WebkitLineClamp:1,fillOpacity:1,floodOpacity:1,stopOpacity:1,strokeDasharray:1,strokeDashoffset:1,strokeMiterlimit:1,strokeOpacity:1,strokeWidth:1},p$=/[A-Z]|^ms/g,m$=/_EMO_([^_]+?)_([^]*?)_EMO_/g,WN=function(t){return t.charCodeAt(1)===45},M4=function(t){return t!=null&&typeof t!="boolean"},q1=YB(function(e){return WN(e)?e:e.replace(p$,"-$&").toLowerCase()}),k4=function(t,n){switch(t){case"animation":case"animationName":if(typeof n=="string")return n.replace(m$,function(r,a,i){return Di={name:a,styles:i,next:Di},a})}return h$[t]!==1&&!WN(t)&&typeof n=="number"&&n!==0?n+"px":n};function Sd(e,t,n){if(n==null)return"";var r=n;if(r.__emotion_styles!==void 0)return r;switch(typeof n){case"boolean":return"";case"object":{var a=n;if(a.anim===1)return Di={name:a.name,styles:a.styles,next:Di},a.name;var i=n;if(i.styles!==void 0){var s=i.next;if(s!==void 0)for(;s!==void 0;)Di={name:s.name,styles:s.styles,next:Di},s=s.next;var o=i.styles+";";return o}return g$(e,t,n)}case"function":{if(e!==void 0){var l=Di,u=n(e);return Di=l,Sd(e,t,u)}break}}var c=n;return c}function g$(e,t,n){var r="";if(Array.isArray(n))for(var a=0;a<n.length;a++)r+=Sd(e,t,n[a])+";";else for(var i in n){var s=n[i];if(typeof s!="object"){var o=s;M4(o)&&(r+=q1(i)+":"+k4(i,o)+";")}else if(Array.isArray(s)&&typeof s[0]=="string"&&t==null)for(var l=0;l<s.length;l++)M4(s[l])&&(r+=q1(i)+":"+k4(i,s[l])+";");else{var u=Sd(e,t,s);switch(i){case"animation":case"animationName":{r+=q1(i)+":"+u+";";break}default:r+=i+"{"+u+"}"}}}return r}var P4=/label:\s*([^\s;{]+)\s*(;|$)/g,Di;function JN(e,t,n){if(e.length===1&&typeof e[0]=="object"&&e[0]!==null&&e[0].styles!==void 0)return e[0];var r=!0,a="";Di=void 0;var i=e[0];if(i==null||i.raw===void 0)r=!1,a+=Sd(n,t,i);else{var s=i;a+=s[0]}for(var o=1;o<e.length;o++)if(a+=Sd(n,t,e[o]),r){var l=i;a+=l[o]}P4.lastIndex=0;for(var u="",c;(c=P4.exec(a))!==null;)u+="-"+c[1];var f=d$(a)+u;return{name:f,styles:a,next:Di}}var v$=function(t){return t()},y$=Rb.useInsertionEffect?Rb.useInsertionEffect:!1,b$=y$||v$,KN=C.createContext(typeof HTMLElement<"u"?e$({key:"css"}):null);KN.Provider;var w$=function(t){return C.forwardRef(function(n,r){var a=C.useContext(KN);return t(n,a,r)})},x$=C.createContext({}),H5={}.hasOwnProperty,Qv="__EMOTION_TYPE_PLEASE_DO_NOT_USE__",S$=function(t,n){var r={};for(var a in n)H5.call(n,a)&&(r[a]=n[a]);return r[Qv]=t,r},_$=function(t){var n=t.cache,r=t.serialized,a=t.isStringTag;return GN(n,r,a),b$(function(){return f$(n,r,a)}),null},A$=w$(function(e,t,n){var r=e.css;typeof r=="string"&&t.registered[r]!==void 0&&(r=t.registered[r]);var a=e[Qv],i=[r],s="";typeof e.className=="string"?s=c$(t.registered,i,e.className):e.className!=null&&(s=e.className+" ");var o=JN(i,void 0,C.useContext(x$));s+=t.key+"-"+o.name;var l={};for(var u in e)H5.call(e,u)&&u!=="css"&&u!==Qv&&(l[u]=e[u]);return l.className=s,n&&(l.ref=n),C.createElement(C.Fragment,null,C.createElement(_$,{cache:t,serialized:o,isStringTag:typeof a=="string"}),C.createElement(a,l))}),N$=A$,rt=function(t,n){var r=arguments;if(n==null||!H5.call(n,"css"))return C.createElement.apply(void 0,r);var a=r.length,i=new Array(a);i[0]=N$,i[1]=S$(t,n);for(var s=2;s<a;s++)i[s]=r[s];return C.createElement.apply(null,i)};(function(e){var t;t||(t=e.JSX||(e.JSX={}))})(rt||(rt={}));function V5(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return JN(t)}function E$(){var e=V5.apply(void 0,arguments),t="animation-"+e.name;return{name:t,styles:"@keyframes "+t+"{"+e.styles+"}",anim:1,toString:function(){return"_EMO_"+this.name+"_"+this.styles+"_EMO_"}}}function C$(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}const L$=Math.min,j$=Math.max,$m=Math.round,lp=Math.floor,Um=e=>({x:e,y:e});function T$(e){const{x:t,y:n,width:r,height:a}=e;return{width:r,height:a,top:n,left:t,right:t+r,bottom:n+a,x:t,y:n}}function Zg(){return typeof window<"u"}function XN(e){return ZN(e)?(e.nodeName||"").toLowerCase():"#document"}function Ts(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function QN(e){var t;return(t=(ZN(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function ZN(e){return Zg()?e instanceof Node||e instanceof Ts(e).Node:!1}function O$(e){return Zg()?e instanceof Element||e instanceof Ts(e).Element:!1}function Y5(e){return Zg()?e instanceof HTMLElement||e instanceof Ts(e).HTMLElement:!1}function I4(e){return!Zg()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof Ts(e).ShadowRoot}function eE(e){const{overflow:t,overflowX:n,overflowY:r,display:a}=G5(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!["inline","contents"].includes(a)}function D$(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function R$(e){return["html","body","#document"].includes(XN(e))}function G5(e){return Ts(e).getComputedStyle(e)}function M$(e){if(XN(e)==="html")return e;const t=e.assignedSlot||e.parentNode||I4(e)&&e.host||QN(e);return I4(t)?t.host:t}function tE(e){const t=M$(e);return R$(t)?e.ownerDocument?e.ownerDocument.body:e.body:Y5(t)&&eE(t)?t:tE(t)}function zm(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const a=tE(e),i=a===((r=e.ownerDocument)==null?void 0:r.body),s=Ts(a);if(i){const o=Zv(s);return t.concat(s,s.visualViewport||[],eE(a)?a:[],o&&n?zm(o):[])}return t.concat(a,zm(a,[],n))}function Zv(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function k$(e){const t=G5(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const a=Y5(e),i=a?e.offsetWidth:n,s=a?e.offsetHeight:r,o=$m(n)!==i||$m(r)!==s;return o&&(n=i,r=s),{width:n,height:r,$:o}}function W5(e){return O$(e)?e:e.contextElement}function F4(e){const t=W5(e);if(!Y5(t))return Um(1);const n=t.getBoundingClientRect(),{width:r,height:a,$:i}=k$(t);let s=(i?$m(n.width):n.width)/r,o=(i?$m(n.height):n.height)/a;return(!s||!Number.isFinite(s))&&(s=1),(!o||!Number.isFinite(o))&&(o=1),{x:s,y:o}}const P$=Um(0);function I$(e){const t=Ts(e);return!D$()||!t.visualViewport?P$:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function F$(e,t,n){return!1}function B4(e,t,n,r){t===void 0&&(t=!1);const a=e.getBoundingClientRect(),i=W5(e);let s=Um(1);t&&(s=F4(e));const o=F$()?I$(i):Um(0);let l=(a.left+o.x)/s.x,u=(a.top+o.y)/s.y,c=a.width/s.x,f=a.height/s.y;if(i){const p=Ts(i),d=r;let v=p,S=Zv(v);for(;S&&r&&d!==v;){const x=F4(S),g=S.getBoundingClientRect(),y=G5(S),_=g.left+(S.clientLeft+parseFloat(y.paddingLeft))*x.x,E=g.top+(S.clientTop+parseFloat(y.paddingTop))*x.y;l*=x.x,u*=x.y,c*=x.x,f*=x.y,l+=_,u+=E,v=Ts(S),S=Zv(v)}}return T$({width:c,height:f,x:l,y:u})}function nE(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function B$(e,t){let n=null,r;const a=QN(e);function i(){var o;clearTimeout(r),(o=n)==null||o.disconnect(),n=null}function s(o,l){o===void 0&&(o=!1),l===void 0&&(l=1),i();const u=e.getBoundingClientRect(),{left:c,top:f,width:p,height:d}=u;if(o||t(),!p||!d)return;const v=lp(f),S=lp(a.clientWidth-(c+p)),x=lp(a.clientHeight-(f+d)),g=lp(c),_={rootMargin:-v+"px "+-S+"px "+-x+"px "+-g+"px",threshold:j$(0,L$(1,l))||1};let E=!0;function D(R){const O=R[0].intersectionRatio;if(O!==l){if(!E)return s();O?s(!1,O):r=setTimeout(()=>{s(!1,1e-7)},1e3)}O===1&&!nE(u,e.getBoundingClientRect())&&s(),E=!1}try{n=new IntersectionObserver(D,{..._,root:a.ownerDocument})}catch{n=new IntersectionObserver(D,_)}n.observe(e)}return s(!0),i}function $$(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:a=!0,ancestorResize:i=!0,elementResize:s=typeof ResizeObserver=="function",layoutShift:o=typeof IntersectionObserver=="function",animationFrame:l=!1}=r,u=W5(e),c=a||i?[...u?zm(u):[],...zm(t)]:[];c.forEach(g=>{a&&g.addEventListener("scroll",n,{passive:!0}),i&&g.addEventListener("resize",n)});const f=u&&o?B$(u,n):null;let p=-1,d=null;s&&(d=new ResizeObserver(g=>{let[y]=g;y&&y.target===u&&d&&(d.unobserve(t),cancelAnimationFrame(p),p=requestAnimationFrame(()=>{var _;(_=d)==null||_.observe(t)})),n()}),u&&!l&&d.observe(u),d.observe(t));let v,S=l?B4(e):null;l&&x();function x(){const g=B4(e);S&&!nE(S,g)&&n(),S=g,v=requestAnimationFrame(x)}return n(),()=>{var g;c.forEach(y=>{a&&y.removeEventListener("scroll",n),i&&y.removeEventListener("resize",n)}),f==null||f(),(g=d)==null||g.disconnect(),d=null,l&&cancelAnimationFrame(v)}}var ey=C.useLayoutEffect,U$=["className","clearValue","cx","getStyles","getClassNames","getValue","hasValue","isMulti","isRtl","options","selectOption","selectProps","setValue","theme"],qm=function(){};function z$(e,t){return t?t[0]==="-"?e+t:e+"__"+t:e}function q$(e,t){for(var n=arguments.length,r=new Array(n>2?n-2:0),a=2;a<n;a++)r[a-2]=arguments[a];var i=[].concat(r);if(t&&e)for(var s in t)t.hasOwnProperty(s)&&t[s]&&i.push("".concat(z$(e,s)));return i.filter(function(o){return o}).map(function(o){return String(o).trim()}).join(" ")}var $4=function(t){return Q$(t)?t.filter(Boolean):Ut(t)==="object"&&t!==null?[t]:[]},rE=function(t){t.className,t.clearValue,t.cx,t.getStyles,t.getClassNames,t.getValue,t.hasValue,t.isMulti,t.isRtl,t.options,t.selectOption,t.selectProps,t.setValue,t.theme;var n=ks(t,U$);return st({},n)},Bn=function(t,n,r){var a=t.cx,i=t.getStyles,s=t.getClassNames,o=t.className;return{css:i(n,t),className:a(r??{},s(n,t),o)}};function e0(e){return[document.documentElement,document.body,window].indexOf(e)>-1}function H$(e){return e0(e)?window.innerHeight:e.clientHeight}function aE(e){return e0(e)?window.pageYOffset:e.scrollTop}function Hm(e,t){if(e0(e)){window.scrollTo(0,t);return}e.scrollTop=t}function V$(e){var t=getComputedStyle(e),n=t.position==="absolute",r=/(auto|scroll)/;if(t.position==="fixed")return document.documentElement;for(var a=e;a=a.parentElement;)if(t=getComputedStyle(a),!(n&&t.position==="static")&&r.test(t.overflow+t.overflowY+t.overflowX))return a;return document.documentElement}function Y$(e,t,n,r){return n*((e=e/r-1)*e*e+1)+t}function up(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:200,r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:qm,a=aE(e),i=t-a,s=10,o=0;function l(){o+=s;var u=Y$(o,a,i,n);Hm(e,u),o<n?window.requestAnimationFrame(l):r(e)}l()}function U4(e,t){var n=e.getBoundingClientRect(),r=t.getBoundingClientRect(),a=t.offsetHeight/3;r.bottom+a>n.bottom?Hm(e,Math.min(t.offsetTop+t.clientHeight-e.offsetHeight+a,e.scrollHeight)):r.top-a<n.top&&Hm(e,Math.max(t.offsetTop-a,0))}function G$(e){var t=e.getBoundingClientRect();return{bottom:t.bottom,height:t.height,left:t.left,right:t.right,top:t.top,width:t.width}}function z4(){try{return document.createEvent("TouchEvent"),!0}catch{return!1}}function W$(){try{return/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)}catch{return!1}}var iE=!1,J$={get passive(){return iE=!0}},cp=typeof window<"u"?window:{};cp.addEventListener&&cp.removeEventListener&&(cp.addEventListener("p",qm,J$),cp.removeEventListener("p",qm,!1));var K$=iE;function X$(e){return e!=null}function Q$(e){return Array.isArray(e)}function fp(e,t,n){return e?t:n}var Z$=function(t){for(var n=arguments.length,r=new Array(n>1?n-1:0),a=1;a<n;a++)r[a-1]=arguments[a];var i=Object.entries(t).filter(function(s){var o=Ss(s,1),l=o[0];return!r.includes(l)});return i.reduce(function(s,o){var l=Ss(o,2),u=l[0],c=l[1];return s[u]=c,s},{})},eU=["children","innerProps"],tU=["children","innerProps"];function nU(e){var t=e.maxHeight,n=e.menuEl,r=e.minHeight,a=e.placement,i=e.shouldScroll,s=e.isFixedPosition,o=e.controlHeight,l=V$(n),u={placement:"bottom",maxHeight:t};if(!n||!n.offsetParent)return u;var c=l.getBoundingClientRect(),f=c.height,p=n.getBoundingClientRect(),d=p.bottom,v=p.height,S=p.top,x=n.offsetParent.getBoundingClientRect(),g=x.top,y=s?window.innerHeight:H$(l),_=aE(l),E=parseInt(getComputedStyle(n).marginBottom,10),D=parseInt(getComputedStyle(n).marginTop,10),R=g-D,O=y-S,j=R+_,$=f-_-S,V=d-y+_+E,T=_+S-D,P=160;switch(a){case"auto":case"bottom":if(O>=v)return{placement:"bottom",maxHeight:t};if($>=v&&!s)return i&&up(l,V,P),{placement:"bottom",maxHeight:t};if(!s&&$>=r||s&&O>=r){i&&up(l,V,P);var q=s?O-E:$-E;return{placement:"bottom",maxHeight:q}}if(a==="auto"||s){var Y=t,se=s?R:j;return se>=r&&(Y=Math.min(se-E-o,t)),{placement:"top",maxHeight:Y}}if(a==="bottom")return i&&Hm(l,V),{placement:"bottom",maxHeight:t};break;case"top":if(R>=v)return{placement:"top",maxHeight:t};if(j>=v&&!s)return i&&up(l,T,P),{placement:"top",maxHeight:t};if(!s&&j>=r||s&&R>=r){var G=t;return(!s&&j>=r||s&&R>=r)&&(G=s?R-D:j-D),i&&up(l,T,P),{placement:"top",maxHeight:G}}return{placement:"bottom",maxHeight:t};default:throw new Error('Invalid placement provided "'.concat(a,'".'))}return u}function rU(e){var t={bottom:"top",top:"bottom"};return e?t[e]:"bottom"}var sE=function(t){return t==="auto"?"bottom":t},aU=function(t,n){var r,a=t.placement,i=t.theme,s=i.borderRadius,o=i.spacing,l=i.colors;return st((r={label:"menu"},Lf(r,rU(a),"100%"),Lf(r,"position","absolute"),Lf(r,"width","100%"),Lf(r,"zIndex",1),r),n?{}:{backgroundColor:l.neutral0,borderRadius:s,boxShadow:"0 0 0 1px hsla(0, 0%, 0%, 0.1), 0 4px 11px hsla(0, 0%, 0%, 0.1)",marginBottom:o.menuGutter,marginTop:o.menuGutter})},oE=C.createContext(null),iU=function(t){var n=t.children,r=t.minMenuHeight,a=t.maxMenuHeight,i=t.menuPlacement,s=t.menuPosition,o=t.menuShouldScrollIntoView,l=t.theme,u=C.useContext(oE)||{},c=u.setPortalPlacement,f=C.useRef(null),p=C.useState(a),d=Ss(p,2),v=d[0],S=d[1],x=C.useState(null),g=Ss(x,2),y=g[0],_=g[1],E=l.spacing.controlHeight;return ey(function(){var D=f.current;if(D){var R=s==="fixed",O=o&&!R,j=nU({maxHeight:a,menuEl:D,minHeight:r,placement:i,shouldScroll:O,isFixedPosition:R,controlHeight:E});S(j.maxHeight),_(j.placement),c==null||c(j.placement)}},[a,i,s,o,r,c,E]),n({ref:f,placerProps:st(st({},t),{},{placement:y||sE(i),maxHeight:v})})},sU=function(t){var n=t.children,r=t.innerRef,a=t.innerProps;return rt("div",ot({},Bn(t,"menu",{menu:!0}),{ref:r},a),n)},oU=sU,lU=function(t,n){var r=t.maxHeight,a=t.theme.spacing.baseUnit;return st({maxHeight:r,overflowY:"auto",position:"relative",WebkitOverflowScrolling:"touch"},n?{}:{paddingBottom:a,paddingTop:a})},uU=function(t){var n=t.children,r=t.innerProps,a=t.innerRef,i=t.isMulti;return rt("div",ot({},Bn(t,"menuList",{"menu-list":!0,"menu-list--is-multi":i}),{ref:a},r),n)},lE=function(t,n){var r=t.theme,a=r.spacing.baseUnit,i=r.colors;return st({textAlign:"center"},n?{}:{color:i.neutral40,padding:"".concat(a*2,"px ").concat(a*3,"px")})},cU=lE,fU=lE,dU=function(t){var n=t.children,r=n===void 0?"No options":n,a=t.innerProps,i=ks(t,eU);return rt("div",ot({},Bn(st(st({},i),{},{children:r,innerProps:a}),"noOptionsMessage",{"menu-notice":!0,"menu-notice--no-options":!0}),a),r)},hU=function(t){var n=t.children,r=n===void 0?"Loading...":n,a=t.innerProps,i=ks(t,tU);return rt("div",ot({},Bn(st(st({},i),{},{children:r,innerProps:a}),"loadingMessage",{"menu-notice":!0,"menu-notice--loading":!0}),a),r)},pU=function(t){var n=t.rect,r=t.offset,a=t.position;return{left:n.left,position:a,top:r,width:n.width,zIndex:1}},mU=function(t){var n=t.appendTo,r=t.children,a=t.controlElement,i=t.innerProps,s=t.menuPlacement,o=t.menuPosition,l=C.useRef(null),u=C.useRef(null),c=C.useState(sE(s)),f=Ss(c,2),p=f[0],d=f[1],v=C.useMemo(function(){return{setPortalPlacement:d}},[]),S=C.useState(null),x=Ss(S,2),g=x[0],y=x[1],_=C.useCallback(function(){if(a){var O=G$(a),j=o==="fixed"?0:window.pageYOffset,$=O[p]+j;($!==(g==null?void 0:g.offset)||O.left!==(g==null?void 0:g.rect.left)||O.width!==(g==null?void 0:g.rect.width))&&y({offset:$,rect:O})}},[a,o,p,g==null?void 0:g.offset,g==null?void 0:g.rect.left,g==null?void 0:g.rect.width]);ey(function(){_()},[_]);var E=C.useCallback(function(){typeof u.current=="function"&&(u.current(),u.current=null),a&&l.current&&(u.current=$$(a,l.current,_,{elementResize:"ResizeObserver"in window}))},[a,_]);ey(function(){E()},[E]);var D=C.useCallback(function(O){l.current=O,E()},[E]);if(!n&&o!=="fixed"||!g)return null;var R=rt("div",ot({ref:D},Bn(st(st({},t),{},{offset:g.offset,position:o,rect:g.rect}),"menuPortal",{"menu-portal":!0}),i),r);return rt(oE.Provider,{value:v},n?_y.createPortal(R,n):R)},gU=function(t){var n=t.isDisabled,r=t.isRtl;return{label:"container",direction:r?"rtl":void 0,pointerEvents:n?"none":void 0,position:"relative"}},vU=function(t){var n=t.children,r=t.innerProps,a=t.isDisabled,i=t.isRtl;return rt("div",ot({},Bn(t,"container",{"--is-disabled":a,"--is-rtl":i}),r),n)},yU=function(t,n){var r=t.theme.spacing,a=t.isMulti,i=t.hasValue,s=t.selectProps.controlShouldRenderValue;return st({alignItems:"center",display:a&&i&&s?"flex":"grid",flex:1,flexWrap:"wrap",WebkitOverflowScrolling:"touch",position:"relative",overflow:"hidden"},n?{}:{padding:"".concat(r.baseUnit/2,"px ").concat(r.baseUnit*2,"px")})},bU=function(t){var n=t.children,r=t.innerProps,a=t.isMulti,i=t.hasValue;return rt("div",ot({},Bn(t,"valueContainer",{"value-container":!0,"value-container--is-multi":a,"value-container--has-value":i}),r),n)},wU=function(){return{alignItems:"center",alignSelf:"stretch",display:"flex",flexShrink:0}},xU=function(t){var n=t.children,r=t.innerProps;return rt("div",ot({},Bn(t,"indicatorsContainer",{indicators:!0}),r),n)},q4,SU=["size"],_U=["innerProps","isRtl","size"],AU={name:"8mmkcg",styles:"display:inline-block;fill:currentColor;line-height:1;stroke:currentColor;stroke-width:0"},uE=function(t){var n=t.size,r=ks(t,SU);return rt("svg",ot({height:n,width:n,viewBox:"0 0 20 20","aria-hidden":"true",focusable:"false",css:AU},r))},J5=function(t){return rt(uE,ot({size:20},t),rt("path",{d:"M14.348 14.849c-0.469 0.469-1.229 0.469-1.697 0l-2.651-3.030-2.651 3.029c-0.469 0.469-1.229 0.469-1.697 0-0.469-0.469-0.469-1.229 0-1.697l2.758-3.15-2.759-3.152c-0.469-0.469-0.469-1.228 0-1.697s1.228-0.469 1.697 0l2.652 3.031 2.651-3.031c0.469-0.469 1.228-0.469 1.697 0s0.469 1.229 0 1.697l-2.758 3.152 2.758 3.15c0.469 0.469 0.469 1.229 0 1.698z"}))},cE=function(t){return rt(uE,ot({size:20},t),rt("path",{d:"M4.516 7.548c0.436-0.446 1.043-0.481 1.576 0l3.908 3.747 3.908-3.747c0.533-0.481 1.141-0.446 1.574 0 0.436 0.445 0.408 1.197 0 1.615-0.406 0.418-4.695 4.502-4.695 4.502-0.217 0.223-0.502 0.335-0.787 0.335s-0.57-0.112-0.789-0.335c0 0-4.287-4.084-4.695-4.502s-0.436-1.17 0-1.615z"}))},fE=function(t,n){var r=t.isFocused,a=t.theme,i=a.spacing.baseUnit,s=a.colors;return st({label:"indicatorContainer",display:"flex",transition:"color 150ms"},n?{}:{color:r?s.neutral60:s.neutral20,padding:i*2,":hover":{color:r?s.neutral80:s.neutral40}})},NU=fE,EU=function(t){var n=t.children,r=t.innerProps;return rt("div",ot({},Bn(t,"dropdownIndicator",{indicator:!0,"dropdown-indicator":!0}),r),n||rt(cE,null))},CU=fE,LU=function(t){var n=t.children,r=t.innerProps;return rt("div",ot({},Bn(t,"clearIndicator",{indicator:!0,"clear-indicator":!0}),r),n||rt(J5,null))},jU=function(t,n){var r=t.isDisabled,a=t.theme,i=a.spacing.baseUnit,s=a.colors;return st({label:"indicatorSeparator",alignSelf:"stretch",width:1},n?{}:{backgroundColor:r?s.neutral10:s.neutral20,marginBottom:i*2,marginTop:i*2})},TU=function(t){var n=t.innerProps;return rt("span",ot({},n,Bn(t,"indicatorSeparator",{"indicator-separator":!0})))},OU=E$(q4||(q4=C$([`
128
+ 0%, 80%, 100% { opacity: 0; }
129
+ 40% { opacity: 1; }
130
+ `]))),DU=function(t,n){var r=t.isFocused,a=t.size,i=t.theme,s=i.colors,o=i.spacing.baseUnit;return st({label:"loadingIndicator",display:"flex",transition:"color 150ms",alignSelf:"center",fontSize:a,lineHeight:1,marginRight:a,textAlign:"center",verticalAlign:"middle"},n?{}:{color:r?s.neutral60:s.neutral20,padding:o*2})},H1=function(t){var n=t.delay,r=t.offset;return rt("span",{css:V5({animation:"".concat(OU," 1s ease-in-out ").concat(n,"ms infinite;"),backgroundColor:"currentColor",borderRadius:"1em",display:"inline-block",marginLeft:r?"1em":void 0,height:"1em",verticalAlign:"top",width:"1em"},"","")})},RU=function(t){var n=t.innerProps,r=t.isRtl,a=t.size,i=a===void 0?4:a,s=ks(t,_U);return rt("div",ot({},Bn(st(st({},s),{},{innerProps:n,isRtl:r,size:i}),"loadingIndicator",{indicator:!0,"loading-indicator":!0}),n),rt(H1,{delay:0,offset:r}),rt(H1,{delay:160,offset:!0}),rt(H1,{delay:320,offset:!r}))},MU=function(t,n){var r=t.isDisabled,a=t.isFocused,i=t.theme,s=i.colors,o=i.borderRadius,l=i.spacing;return st({label:"control",alignItems:"center",cursor:"default",display:"flex",flexWrap:"wrap",justifyContent:"space-between",minHeight:l.controlHeight,outline:"0 !important",position:"relative",transition:"all 100ms"},n?{}:{backgroundColor:r?s.neutral5:s.neutral0,borderColor:r?s.neutral10:a?s.primary:s.neutral20,borderRadius:o,borderStyle:"solid",borderWidth:1,boxShadow:a?"0 0 0 1px ".concat(s.primary):void 0,"&:hover":{borderColor:a?s.primary:s.neutral30}})},kU=function(t){var n=t.children,r=t.isDisabled,a=t.isFocused,i=t.innerRef,s=t.innerProps,o=t.menuIsOpen;return rt("div",ot({ref:i},Bn(t,"control",{control:!0,"control--is-disabled":r,"control--is-focused":a,"control--menu-is-open":o}),s,{"aria-disabled":r||void 0}),n)},PU=kU,IU=["data"],FU=function(t,n){var r=t.theme.spacing;return n?{}:{paddingBottom:r.baseUnit*2,paddingTop:r.baseUnit*2}},BU=function(t){var n=t.children,r=t.cx,a=t.getStyles,i=t.getClassNames,s=t.Heading,o=t.headingProps,l=t.innerProps,u=t.label,c=t.theme,f=t.selectProps;return rt("div",ot({},Bn(t,"group",{group:!0}),l),rt(s,ot({},o,{selectProps:f,theme:c,getStyles:a,getClassNames:i,cx:r}),u),rt("div",null,n))},$U=function(t,n){var r=t.theme,a=r.colors,i=r.spacing;return st({label:"group",cursor:"default",display:"block"},n?{}:{color:a.neutral40,fontSize:"75%",fontWeight:500,marginBottom:"0.25em",paddingLeft:i.baseUnit*3,paddingRight:i.baseUnit*3,textTransform:"uppercase"})},UU=function(t){var n=rE(t);n.data;var r=ks(n,IU);return rt("div",ot({},Bn(t,"groupHeading",{"group-heading":!0}),r))},zU=BU,qU=["innerRef","isDisabled","isHidden","inputClassName"],HU=function(t,n){var r=t.isDisabled,a=t.value,i=t.theme,s=i.spacing,o=i.colors;return st(st({visibility:r?"hidden":"visible",transform:a?"translateZ(0)":""},VU),n?{}:{margin:s.baseUnit/2,paddingBottom:s.baseUnit/2,paddingTop:s.baseUnit/2,color:o.neutral80})},dE={gridArea:"1 / 2",font:"inherit",minWidth:"2px",border:0,margin:0,outline:0,padding:0},VU={flex:"1 1 auto",display:"inline-grid",gridArea:"1 / 1 / 2 / 3",gridTemplateColumns:"0 min-content","&:after":st({content:'attr(data-value) " "',visibility:"hidden",whiteSpace:"pre"},dE)},YU=function(t){return st({label:"input",color:"inherit",background:0,opacity:t?0:1,width:"100%"},dE)},GU=function(t){var n=t.cx,r=t.value,a=rE(t),i=a.innerRef,s=a.isDisabled,o=a.isHidden,l=a.inputClassName,u=ks(a,qU);return rt("div",ot({},Bn(t,"input",{"input-container":!0}),{"data-value":r||""}),rt("input",ot({className:n({input:!0},l),ref:i,style:YU(o),disabled:s},u)))},WU=GU,JU=function(t,n){var r=t.theme,a=r.spacing,i=r.borderRadius,s=r.colors;return st({label:"multiValue",display:"flex",minWidth:0},n?{}:{backgroundColor:s.neutral10,borderRadius:i/2,margin:a.baseUnit/2})},KU=function(t,n){var r=t.theme,a=r.borderRadius,i=r.colors,s=t.cropWithEllipsis;return st({overflow:"hidden",textOverflow:s||s===void 0?"ellipsis":void 0,whiteSpace:"nowrap"},n?{}:{borderRadius:a/2,color:i.neutral80,fontSize:"85%",padding:3,paddingLeft:6})},XU=function(t,n){var r=t.theme,a=r.spacing,i=r.borderRadius,s=r.colors,o=t.isFocused;return st({alignItems:"center",display:"flex"},n?{}:{borderRadius:i/2,backgroundColor:o?s.dangerLight:void 0,paddingLeft:a.baseUnit,paddingRight:a.baseUnit,":hover":{backgroundColor:s.dangerLight,color:s.danger}})},hE=function(t){var n=t.children,r=t.innerProps;return rt("div",r,n)},QU=hE,ZU=hE;function ez(e){var t=e.children,n=e.innerProps;return rt("div",ot({role:"button"},n),t||rt(J5,{size:14}))}var tz=function(t){var n=t.children,r=t.components,a=t.data,i=t.innerProps,s=t.isDisabled,o=t.removeProps,l=t.selectProps,u=r.Container,c=r.Label,f=r.Remove;return rt(u,{data:a,innerProps:st(st({},Bn(t,"multiValue",{"multi-value":!0,"multi-value--is-disabled":s})),i),selectProps:l},rt(c,{data:a,innerProps:st({},Bn(t,"multiValueLabel",{"multi-value__label":!0})),selectProps:l},n),rt(f,{data:a,innerProps:st(st({},Bn(t,"multiValueRemove",{"multi-value__remove":!0})),{},{"aria-label":"Remove ".concat(n||"option")},o),selectProps:l}))},nz=tz,rz=function(t,n){var r=t.isDisabled,a=t.isFocused,i=t.isSelected,s=t.theme,o=s.spacing,l=s.colors;return st({label:"option",cursor:"default",display:"block",fontSize:"inherit",width:"100%",userSelect:"none",WebkitTapHighlightColor:"rgba(0, 0, 0, 0)"},n?{}:{backgroundColor:i?l.primary:a?l.primary25:"transparent",color:r?l.neutral20:i?l.neutral0:"inherit",padding:"".concat(o.baseUnit*2,"px ").concat(o.baseUnit*3,"px"),":active":{backgroundColor:r?void 0:i?l.primary:l.primary50}})},az=function(t){var n=t.children,r=t.isDisabled,a=t.isFocused,i=t.isSelected,s=t.innerRef,o=t.innerProps;return rt("div",ot({},Bn(t,"option",{option:!0,"option--is-disabled":r,"option--is-focused":a,"option--is-selected":i}),{ref:s,"aria-disabled":r},o),n)},iz=az,sz=function(t,n){var r=t.theme,a=r.spacing,i=r.colors;return st({label:"placeholder",gridArea:"1 / 1 / 2 / 3"},n?{}:{color:i.neutral50,marginLeft:a.baseUnit/2,marginRight:a.baseUnit/2})},oz=function(t){var n=t.children,r=t.innerProps;return rt("div",ot({},Bn(t,"placeholder",{placeholder:!0}),r),n)},lz=oz,uz=function(t,n){var r=t.isDisabled,a=t.theme,i=a.spacing,s=a.colors;return st({label:"singleValue",gridArea:"1 / 1 / 2 / 3",maxWidth:"100%",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},n?{}:{color:r?s.neutral40:s.neutral80,marginLeft:i.baseUnit/2,marginRight:i.baseUnit/2})},cz=function(t){var n=t.children,r=t.isDisabled,a=t.innerProps;return rt("div",ot({},Bn(t,"singleValue",{"single-value":!0,"single-value--is-disabled":r}),a),n)},fz=cz,pE={ClearIndicator:LU,Control:PU,DropdownIndicator:EU,DownChevron:cE,CrossIcon:J5,Group:zU,GroupHeading:UU,IndicatorsContainer:xU,IndicatorSeparator:TU,Input:WU,LoadingIndicator:RU,Menu:oU,MenuList:uU,MenuPortal:mU,LoadingMessage:hU,NoOptionsMessage:dU,MultiValue:nz,MultiValueContainer:QU,MultiValueLabel:ZU,MultiValueRemove:ez,Option:iz,Placeholder:lz,SelectContainer:vU,SingleValue:fz,ValueContainer:bU},dz=function(t){return st(st({},pE),t.components)},H4=Number.isNaN||function(t){return typeof t=="number"&&t!==t};function hz(e,t){return!!(e===t||H4(e)&&H4(t))}function pz(e,t){if(e.length!==t.length)return!1;for(var n=0;n<e.length;n++)if(!hz(e[n],t[n]))return!1;return!0}function mz(e,t){t===void 0&&(t=pz);var n=null;function r(){for(var a=[],i=0;i<arguments.length;i++)a[i]=arguments[i];if(n&&n.lastThis===this&&t(a,n.lastArgs))return n.lastResult;var s=e.apply(this,a);return n={lastResult:s,lastArgs:a,lastThis:this},s}return r.clear=function(){n=null},r}var gz={name:"7pg0cj-a11yText",styles:"label:a11yText;z-index:9999;border:0;clip:rect(1px, 1px, 1px, 1px);height:1px;width:1px;position:absolute;overflow:hidden;padding:0;white-space:nowrap"},vz=function(t){return rt("span",ot({css:gz},t))},V4=vz,yz={guidance:function(t){var n=t.isSearchable,r=t.isMulti,a=t.tabSelectsValue,i=t.context,s=t.isInitialFocus;switch(i){case"menu":return"Use Up and Down to choose options, press Enter to select the currently focused option, press Escape to exit the menu".concat(a?", press Tab to select the option and exit the menu":"",".");case"input":return s?"".concat(t["aria-label"]||"Select"," is focused ").concat(n?",type to refine list":"",", press Down to open the menu, ").concat(r?" press left to focus selected values":""):"";case"value":return"Use left and right to toggle between focused values, press Backspace to remove the currently focused value";default:return""}},onChange:function(t){var n=t.action,r=t.label,a=r===void 0?"":r,i=t.labels,s=t.isDisabled;switch(n){case"deselect-option":case"pop-value":case"remove-value":return"option ".concat(a,", deselected.");case"clear":return"All selected options have been cleared.";case"initial-input-focus":return"option".concat(i.length>1?"s":""," ").concat(i.join(","),", selected.");case"select-option":return s?"option ".concat(a," is disabled. Select another option."):"option ".concat(a,", selected.");default:return""}},onFocus:function(t){var n=t.context,r=t.focused,a=t.options,i=t.label,s=i===void 0?"":i,o=t.selectValue,l=t.isDisabled,u=t.isSelected,c=t.isAppleDevice,f=function(S,x){return S&&S.length?"".concat(S.indexOf(x)+1," of ").concat(S.length):""};if(n==="value"&&o)return"value ".concat(s," focused, ").concat(f(o,r),".");if(n==="menu"&&c){var p=l?" disabled":"",d="".concat(u?" selected":"").concat(p);return"".concat(s).concat(d,", ").concat(f(a,r),".")}return""},onFilter:function(t){var n=t.inputValue,r=t.resultsMessage;return"".concat(r).concat(n?" for search term "+n:"",".")}},bz=function(t){var n=t.ariaSelection,r=t.focusedOption,a=t.focusedValue,i=t.focusableOptions,s=t.isFocused,o=t.selectValue,l=t.selectProps,u=t.id,c=t.isAppleDevice,f=l.ariaLiveMessages,p=l.getOptionLabel,d=l.inputValue,v=l.isMulti,S=l.isOptionDisabled,x=l.isSearchable,g=l.menuIsOpen,y=l.options,_=l.screenReaderStatus,E=l.tabSelectsValue,D=l.isLoading,R=l["aria-label"],O=l["aria-live"],j=C.useMemo(function(){return st(st({},yz),f||{})},[f]),$=C.useMemo(function(){var se="";if(n&&j.onChange){var G=n.option,ne=n.options,Q=n.removedValue,ie=n.removedValues,J=n.value,le=function(fe){return Array.isArray(fe)?null:fe},L=Q||G||le(J),z=L?p(L):"",W=ne||ie||void 0,te=W?W.map(p):[],B=st({isDisabled:L&&S(L,o),label:z,labels:te},n);se=j.onChange(B)}return se},[n,j,S,o,p]),V=C.useMemo(function(){var se="",G=r||a,ne=!!(r&&o&&o.includes(r));if(G&&j.onFocus){var Q={focused:G,label:p(G),isDisabled:S(G,o),isSelected:ne,options:i,context:G===r?"menu":"value",selectValue:o,isAppleDevice:c};se=j.onFocus(Q)}return se},[r,a,p,S,j,i,o,c]),T=C.useMemo(function(){var se="";if(g&&y.length&&!D&&j.onFilter){var G=_({count:i.length});se=j.onFilter({inputValue:d,resultsMessage:G})}return se},[i,d,g,j,y,_,D]),P=(n==null?void 0:n.action)==="initial-input-focus",q=C.useMemo(function(){var se="";if(j.guidance){var G=a?"value":g?"menu":"input";se=j.guidance({"aria-label":R,context:G,isDisabled:r&&S(r,o),isMulti:v,isSearchable:x,tabSelectsValue:E,isInitialFocus:P})}return se},[R,r,a,v,S,x,g,j,o,E,P]),Y=rt(C.Fragment,null,rt("span",{id:"aria-selection"},$),rt("span",{id:"aria-focused"},V),rt("span",{id:"aria-results"},T),rt("span",{id:"aria-guidance"},q));return rt(C.Fragment,null,rt(V4,{id:u},P&&Y),rt(V4,{"aria-live":O,"aria-atomic":"false","aria-relevant":"additions text",role:"log"},s&&!P&&Y))},wz=bz,ty=[{base:"A",letters:"AⒶAÀÁÂẦẤẪẨÃĀĂẰẮẴẲȦǠÄǞẢÅǺǍȀȂẠẬẶḀĄȺⱯ"},{base:"AA",letters:"Ꜳ"},{base:"AE",letters:"ÆǼǢ"},{base:"AO",letters:"Ꜵ"},{base:"AU",letters:"Ꜷ"},{base:"AV",letters:"ꜸꜺ"},{base:"AY",letters:"Ꜽ"},{base:"B",letters:"BⒷBḂḄḆɃƂƁ"},{base:"C",letters:"CⒸCĆĈĊČÇḈƇȻꜾ"},{base:"D",letters:"DⒹDḊĎḌḐḒḎĐƋƊƉꝹ"},{base:"DZ",letters:"DZDŽ"},{base:"Dz",letters:"DzDž"},{base:"E",letters:"EⒺEÈÉÊỀẾỄỂẼĒḔḖĔĖËẺĚȄȆẸỆȨḜĘḘḚƐƎ"},{base:"F",letters:"FⒻFḞƑꝻ"},{base:"G",letters:"GⒼGǴĜḠĞĠǦĢǤƓꞠꝽꝾ"},{base:"H",letters:"HⒽHĤḢḦȞḤḨḪĦⱧⱵꞍ"},{base:"I",letters:"IⒾIÌÍÎĨĪĬİÏḮỈǏȈȊỊĮḬƗ"},{base:"J",letters:"JⒿJĴɈ"},{base:"K",letters:"KⓀKḰǨḲĶḴƘⱩꝀꝂꝄꞢ"},{base:"L",letters:"LⓁLĿĹĽḶḸĻḼḺŁȽⱢⱠꝈꝆꞀ"},{base:"LJ",letters:"LJ"},{base:"Lj",letters:"Lj"},{base:"M",letters:"MⓂMḾṀṂⱮƜ"},{base:"N",letters:"NⓃNǸŃÑṄŇṆŅṊṈȠƝꞐꞤ"},{base:"NJ",letters:"NJ"},{base:"Nj",letters:"Nj"},{base:"O",letters:"OⓄOÒÓÔỒỐỖỔÕṌȬṎŌṐṒŎȮȰÖȪỎŐǑȌȎƠỜỚỠỞỢỌỘǪǬØǾƆƟꝊꝌ"},{base:"OI",letters:"Ƣ"},{base:"OO",letters:"Ꝏ"},{base:"OU",letters:"Ȣ"},{base:"P",letters:"PⓅPṔṖƤⱣꝐꝒꝔ"},{base:"Q",letters:"QⓆQꝖꝘɊ"},{base:"R",letters:"RⓇRŔṘŘȐȒṚṜŖṞɌⱤꝚꞦꞂ"},{base:"S",letters:"SⓈSẞŚṤŜṠŠṦṢṨȘŞⱾꞨꞄ"},{base:"T",letters:"TⓉTṪŤṬȚŢṰṮŦƬƮȾꞆ"},{base:"TZ",letters:"Ꜩ"},{base:"U",letters:"UⓊUÙÚÛŨṸŪṺŬÜǛǗǕǙỦŮŰǓȔȖƯỪỨỮỬỰỤṲŲṶṴɄ"},{base:"V",letters:"VⓋVṼṾƲꝞɅ"},{base:"VY",letters:"Ꝡ"},{base:"W",letters:"WⓌWẀẂŴẆẄẈⱲ"},{base:"X",letters:"XⓍXẊẌ"},{base:"Y",letters:"YⓎYỲÝŶỸȲẎŸỶỴƳɎỾ"},{base:"Z",letters:"ZⓏZŹẐŻŽẒẔƵȤⱿⱫꝢ"},{base:"a",letters:"aⓐaẚàáâầấẫẩãāăằắẵẳȧǡäǟảåǻǎȁȃạậặḁąⱥɐ"},{base:"aa",letters:"ꜳ"},{base:"ae",letters:"æǽǣ"},{base:"ao",letters:"ꜵ"},{base:"au",letters:"ꜷ"},{base:"av",letters:"ꜹꜻ"},{base:"ay",letters:"ꜽ"},{base:"b",letters:"bⓑbḃḅḇƀƃɓ"},{base:"c",letters:"cⓒcćĉċčçḉƈȼꜿↄ"},{base:"d",letters:"dⓓdḋďḍḑḓḏđƌɖɗꝺ"},{base:"dz",letters:"dzdž"},{base:"e",letters:"eⓔeèéêềếễểẽēḕḗĕėëẻěȅȇẹệȩḝęḙḛɇɛǝ"},{base:"f",letters:"fⓕfḟƒꝼ"},{base:"g",letters:"gⓖgǵĝḡğġǧģǥɠꞡᵹꝿ"},{base:"h",letters:"hⓗhĥḣḧȟḥḩḫẖħⱨⱶɥ"},{base:"hv",letters:"ƕ"},{base:"i",letters:"iⓘiìíîĩīĭïḯỉǐȉȋịįḭɨı"},{base:"j",letters:"jⓙjĵǰɉ"},{base:"k",letters:"kⓚkḱǩḳķḵƙⱪꝁꝃꝅꞣ"},{base:"l",letters:"lⓛlŀĺľḷḹļḽḻſłƚɫⱡꝉꞁꝇ"},{base:"lj",letters:"lj"},{base:"m",letters:"mⓜmḿṁṃɱɯ"},{base:"n",letters:"nⓝnǹńñṅňṇņṋṉƞɲʼnꞑꞥ"},{base:"nj",letters:"nj"},{base:"o",letters:"oⓞoòóôồốỗổõṍȭṏōṑṓŏȯȱöȫỏőǒȍȏơờớỡởợọộǫǭøǿɔꝋꝍɵ"},{base:"oi",letters:"ƣ"},{base:"ou",letters:"ȣ"},{base:"oo",letters:"ꝏ"},{base:"p",letters:"pⓟpṕṗƥᵽꝑꝓꝕ"},{base:"q",letters:"qⓠqɋꝗꝙ"},{base:"r",letters:"rⓡrŕṙřȑȓṛṝŗṟɍɽꝛꞧꞃ"},{base:"s",letters:"sⓢsßśṥŝṡšṧṣṩșşȿꞩꞅẛ"},{base:"t",letters:"tⓣtṫẗťṭțţṱṯŧƭʈⱦꞇ"},{base:"tz",letters:"ꜩ"},{base:"u",letters:"uⓤuùúûũṹūṻŭüǜǘǖǚủůűǔȕȗưừứữửựụṳųṷṵʉ"},{base:"v",letters:"vⓥvṽṿʋꝟʌ"},{base:"vy",letters:"ꝡ"},{base:"w",letters:"wⓦwẁẃŵẇẅẘẉⱳ"},{base:"x",letters:"xⓧxẋẍ"},{base:"y",letters:"yⓨyỳýŷỹȳẏÿỷẙỵƴɏỿ"},{base:"z",letters:"zⓩzźẑżžẓẕƶȥɀⱬꝣ"}],xz=new RegExp("["+ty.map(function(e){return e.letters}).join("")+"]","g"),mE={};for(var V1=0;V1<ty.length;V1++)for(var Y1=ty[V1],G1=0;G1<Y1.letters.length;G1++)mE[Y1.letters[G1]]=Y1.base;var gE=function(t){return t.replace(xz,function(n){return mE[n]})},Sz=mz(gE),Y4=function(t){return t.replace(/^\s+|\s+$/g,"")},_z=function(t){return"".concat(t.label," ").concat(t.value)},Az=function(t){return function(n,r){if(n.data.__isNew__)return!0;var a=st({ignoreCase:!0,ignoreAccents:!0,stringify:_z,trim:!0,matchFrom:"any"},t),i=a.ignoreCase,s=a.ignoreAccents,o=a.stringify,l=a.trim,u=a.matchFrom,c=l?Y4(r):r,f=l?Y4(o(n)):o(n);return i&&(c=c.toLowerCase(),f=f.toLowerCase()),s&&(c=Sz(c),f=gE(f)),u==="start"?f.substr(0,c.length)===c:f.indexOf(c)>-1}},Nz=["innerRef"];function Ez(e){var t=e.innerRef,n=ks(e,Nz),r=Z$(n,"onExited","in","enter","exit","appear");return rt("input",ot({ref:t},r,{css:V5({label:"dummyInput",background:0,border:0,caretColor:"transparent",fontSize:"inherit",gridArea:"1 / 1 / 2 / 3",outline:0,padding:0,width:1,color:"transparent",left:-100,opacity:0,position:"relative",transform:"scale(.01)"},"","")}))}var Cz=function(t){t.cancelable&&t.preventDefault(),t.stopPropagation()};function Lz(e){var t=e.isEnabled,n=e.onBottomArrive,r=e.onBottomLeave,a=e.onTopArrive,i=e.onTopLeave,s=C.useRef(!1),o=C.useRef(!1),l=C.useRef(0),u=C.useRef(null),c=C.useCallback(function(x,g){if(u.current!==null){var y=u.current,_=y.scrollTop,E=y.scrollHeight,D=y.clientHeight,R=u.current,O=g>0,j=E-D-_,$=!1;j>g&&s.current&&(r&&r(x),s.current=!1),O&&o.current&&(i&&i(x),o.current=!1),O&&g>j?(n&&!s.current&&n(x),R.scrollTop=E,$=!0,s.current=!0):!O&&-g>_&&(a&&!o.current&&a(x),R.scrollTop=0,$=!0,o.current=!0),$&&Cz(x)}},[n,r,a,i]),f=C.useCallback(function(x){c(x,x.deltaY)},[c]),p=C.useCallback(function(x){l.current=x.changedTouches[0].clientY},[]),d=C.useCallback(function(x){var g=l.current-x.changedTouches[0].clientY;c(x,g)},[c]),v=C.useCallback(function(x){if(x){var g=K$?{passive:!1}:!1;x.addEventListener("wheel",f,g),x.addEventListener("touchstart",p,g),x.addEventListener("touchmove",d,g)}},[d,p,f]),S=C.useCallback(function(x){x&&(x.removeEventListener("wheel",f,!1),x.removeEventListener("touchstart",p,!1),x.removeEventListener("touchmove",d,!1))},[d,p,f]);return C.useEffect(function(){if(t){var x=u.current;return v(x),function(){S(x)}}},[t,v,S]),function(x){u.current=x}}var G4=["boxSizing","height","overflow","paddingRight","position"],W4={boxSizing:"border-box",overflow:"hidden",position:"relative",height:"100%"};function J4(e){e.cancelable&&e.preventDefault()}function K4(e){e.stopPropagation()}function X4(){var e=this.scrollTop,t=this.scrollHeight,n=e+this.offsetHeight;e===0?this.scrollTop=1:n===t&&(this.scrollTop=e-1)}function Q4(){return"ontouchstart"in window||navigator.maxTouchPoints}var Z4=!!(typeof window<"u"&&window.document&&window.document.createElement),yf=0,fu={capture:!1,passive:!1};function jz(e){var t=e.isEnabled,n=e.accountForScrollbars,r=n===void 0?!0:n,a=C.useRef({}),i=C.useRef(null),s=C.useCallback(function(l){if(Z4){var u=document.body,c=u&&u.style;if(r&&G4.forEach(function(v){var S=c&&c[v];a.current[v]=S}),r&&yf<1){var f=parseInt(a.current.paddingRight,10)||0,p=document.body?document.body.clientWidth:0,d=window.innerWidth-p+f||0;Object.keys(W4).forEach(function(v){var S=W4[v];c&&(c[v]=S)}),c&&(c.paddingRight="".concat(d,"px"))}u&&Q4()&&(u.addEventListener("touchmove",J4,fu),l&&(l.addEventListener("touchstart",X4,fu),l.addEventListener("touchmove",K4,fu))),yf+=1}},[r]),o=C.useCallback(function(l){if(Z4){var u=document.body,c=u&&u.style;yf=Math.max(yf-1,0),r&&yf<1&&G4.forEach(function(f){var p=a.current[f];c&&(c[f]=p)}),u&&Q4()&&(u.removeEventListener("touchmove",J4,fu),l&&(l.removeEventListener("touchstart",X4,fu),l.removeEventListener("touchmove",K4,fu)))}},[r]);return C.useEffect(function(){if(t){var l=i.current;return s(l),function(){o(l)}}},[t,s,o]),function(l){i.current=l}}var Tz=function(t){var n=t.target;return n.ownerDocument.activeElement&&n.ownerDocument.activeElement.blur()},Oz={name:"1kfdb0e",styles:"position:fixed;left:0;bottom:0;right:0;top:0"};function Dz(e){var t=e.children,n=e.lockEnabled,r=e.captureEnabled,a=r===void 0?!0:r,i=e.onBottomArrive,s=e.onBottomLeave,o=e.onTopArrive,l=e.onTopLeave,u=Lz({isEnabled:a,onBottomArrive:i,onBottomLeave:s,onTopArrive:o,onTopLeave:l}),c=jz({isEnabled:n}),f=function(d){u(d),c(d)};return rt(C.Fragment,null,n&&rt("div",{onClick:Tz,css:Oz}),t(f))}var Rz={name:"1a0ro4n-requiredInput",styles:"label:requiredInput;opacity:0;pointer-events:none;position:absolute;bottom:0;left:0;right:0;width:100%"},Mz=function(t){var n=t.name,r=t.onFocus;return rt("input",{required:!0,name:n,tabIndex:-1,"aria-hidden":"true",onFocus:r,css:Rz,value:"",onChange:function(){}})},kz=Mz;function K5(e){var t;return typeof window<"u"&&window.navigator!=null?e.test(((t=window.navigator.userAgentData)===null||t===void 0?void 0:t.platform)||window.navigator.platform):!1}function Pz(){return K5(/^iPhone/i)}function vE(){return K5(/^Mac/i)}function Iz(){return K5(/^iPad/i)||vE()&&navigator.maxTouchPoints>1}function Fz(){return Pz()||Iz()}function Bz(){return vE()||Fz()}var $z=function(t){return t.label},Uz=function(t){return t.label},zz=function(t){return t.value},qz=function(t){return!!t.isDisabled},Hz={clearIndicator:CU,container:gU,control:MU,dropdownIndicator:NU,group:FU,groupHeading:$U,indicatorsContainer:wU,indicatorSeparator:jU,input:HU,loadingIndicator:DU,loadingMessage:fU,menu:aU,menuList:lU,menuPortal:pU,multiValue:JU,multiValueLabel:KU,multiValueRemove:XU,noOptionsMessage:cU,option:rz,placeholder:sz,singleValue:uz,valueContainer:yU},Vz={primary:"#2684FF",primary75:"#4C9AFF",primary50:"#B2D4FF",primary25:"#DEEBFF",danger:"#DE350B",dangerLight:"#FFBDAD",neutral0:"hsl(0, 0%, 100%)",neutral5:"hsl(0, 0%, 95%)",neutral10:"hsl(0, 0%, 90%)",neutral20:"hsl(0, 0%, 80%)",neutral30:"hsl(0, 0%, 70%)",neutral40:"hsl(0, 0%, 60%)",neutral50:"hsl(0, 0%, 50%)",neutral60:"hsl(0, 0%, 40%)",neutral70:"hsl(0, 0%, 30%)",neutral80:"hsl(0, 0%, 20%)",neutral90:"hsl(0, 0%, 10%)"},Yz=4,yE=4,Gz=38,Wz=yE*2,Jz={baseUnit:yE,controlHeight:Gz,menuGutter:Wz},W1={borderRadius:Yz,colors:Vz,spacing:Jz},Kz={"aria-live":"polite",backspaceRemovesValue:!0,blurInputOnSelect:z4(),captureMenuScroll:!z4(),classNames:{},closeMenuOnSelect:!0,closeMenuOnScroll:!1,components:{},controlShouldRenderValue:!0,escapeClearsValue:!1,filterOption:Az(),formatGroupLabel:$z,getOptionLabel:Uz,getOptionValue:zz,isDisabled:!1,isLoading:!1,isMulti:!1,isRtl:!1,isSearchable:!0,isOptionDisabled:qz,loadingMessage:function(){return"Loading..."},maxMenuHeight:300,minMenuHeight:140,menuIsOpen:!1,menuPlacement:"bottom",menuPosition:"absolute",menuShouldBlockScroll:!1,menuShouldScrollIntoView:!W$(),noOptionsMessage:function(){return"No options"},openMenuOnFocus:!1,openMenuOnClick:!0,options:[],pageSize:5,placeholder:"Select...",screenReaderStatus:function(t){var n=t.count;return"".concat(n," result").concat(n!==1?"s":""," available")},styles:{},tabIndex:0,tabSelectsValue:!0,unstyled:!1};function e3(e,t,n,r){var a=xE(e,t,n),i=SE(e,t,n),s=wE(e,t),o=Vm(e,t);return{type:"option",data:t,isDisabled:a,isSelected:i,label:s,value:o,index:r}}function Up(e,t){return e.options.map(function(n,r){if("options"in n){var a=n.options.map(function(s,o){return e3(e,s,t,o)}).filter(function(s){return n3(e,s)});return a.length>0?{type:"group",data:n,options:a,index:r}:void 0}var i=e3(e,n,t,r);return n3(e,i)?i:void 0}).filter(X$)}function bE(e){return e.reduce(function(t,n){return n.type==="group"?t.push.apply(t,I5(n.options.map(function(r){return r.data}))):t.push(n.data),t},[])}function t3(e,t){return e.reduce(function(n,r){return r.type==="group"?n.push.apply(n,I5(r.options.map(function(a){return{data:a.data,id:"".concat(t,"-").concat(r.index,"-").concat(a.index)}}))):n.push({data:r.data,id:"".concat(t,"-").concat(r.index)}),n},[])}function Xz(e,t){return bE(Up(e,t))}function n3(e,t){var n=e.inputValue,r=n===void 0?"":n,a=t.data,i=t.isSelected,s=t.label,o=t.value;return(!AE(e)||!i)&&_E(e,{label:s,value:o,data:a},r)}function Qz(e,t){var n=e.focusedValue,r=e.selectValue,a=r.indexOf(n);if(a>-1){var i=t.indexOf(n);if(i>-1)return n;if(a<t.length)return t[a]}return null}function Zz(e,t){var n=e.focusedOption;return n&&t.indexOf(n)>-1?n:t[0]}var J1=function(t,n){var r,a=(r=t.find(function(i){return i.data===n}))===null||r===void 0?void 0:r.id;return a||null},wE=function(t,n){return t.getOptionLabel(n)},Vm=function(t,n){return t.getOptionValue(n)};function xE(e,t,n){return typeof e.isOptionDisabled=="function"?e.isOptionDisabled(t,n):!1}function SE(e,t,n){if(n.indexOf(t)>-1)return!0;if(typeof e.isOptionSelected=="function")return e.isOptionSelected(t,n);var r=Vm(e,t);return n.some(function(a){return Vm(e,a)===r})}function _E(e,t,n){return e.filterOption?e.filterOption(t,n):!0}var AE=function(t){var n=t.hideSelectedOptions,r=t.isMulti;return n===void 0?r:n},eq=1,NE=function(e){yB(n,e);var t=xB(n);function n(r){var a;if(gB(this,n),a=t.call(this,r),a.state={ariaSelection:null,focusedOption:null,focusedOptionId:null,focusableOptionsWithIds:[],focusedValue:null,inputIsHidden:!1,isFocused:!1,selectValue:[],clearFocusValueOnUpdate:!1,prevWasFocused:!1,inputIsHiddenAfterUpdate:void 0,prevProps:void 0,instancePrefix:""},a.blockOptionHover=!1,a.isComposing=!1,a.commonProps=void 0,a.initialTouchX=0,a.initialTouchY=0,a.openAfterFocus=!1,a.scrollToFocusedOptionOnUpdate=!1,a.userIsDragging=void 0,a.isAppleDevice=Bz(),a.controlRef=null,a.getControlRef=function(l){a.controlRef=l},a.focusedOptionRef=null,a.getFocusedOptionRef=function(l){a.focusedOptionRef=l},a.menuListRef=null,a.getMenuListRef=function(l){a.menuListRef=l},a.inputRef=null,a.getInputRef=function(l){a.inputRef=l},a.focus=a.focusInput,a.blur=a.blurInput,a.onChange=function(l,u){var c=a.props,f=c.onChange,p=c.name;u.name=p,a.ariaOnChange(l,u),f(l,u)},a.setValue=function(l,u,c){var f=a.props,p=f.closeMenuOnSelect,d=f.isMulti,v=f.inputValue;a.onInputChange("",{action:"set-value",prevInputValue:v}),p&&(a.setState({inputIsHiddenAfterUpdate:!d}),a.onMenuClose()),a.setState({clearFocusValueOnUpdate:!0}),a.onChange(l,{action:u,option:c})},a.selectOption=function(l){var u=a.props,c=u.blurInputOnSelect,f=u.isMulti,p=u.name,d=a.state.selectValue,v=f&&a.isOptionSelected(l,d),S=a.isOptionDisabled(l,d);if(v){var x=a.getOptionValue(l);a.setValue(d.filter(function(g){return a.getOptionValue(g)!==x}),"deselect-option",l)}else if(!S)f?a.setValue([].concat(I5(d),[l]),"select-option",l):a.setValue(l,"select-option");else{a.ariaOnChange(l,{action:"select-option",option:l,name:p});return}c&&a.blurInput()},a.removeValue=function(l){var u=a.props.isMulti,c=a.state.selectValue,f=a.getOptionValue(l),p=c.filter(function(v){return a.getOptionValue(v)!==f}),d=fp(u,p,p[0]||null);a.onChange(d,{action:"remove-value",removedValue:l}),a.focusInput()},a.clearValue=function(){var l=a.state.selectValue;a.onChange(fp(a.props.isMulti,[],null),{action:"clear",removedValues:l})},a.popValue=function(){var l=a.props.isMulti,u=a.state.selectValue,c=u[u.length-1],f=u.slice(0,u.length-1),p=fp(l,f,f[0]||null);c&&a.onChange(p,{action:"pop-value",removedValue:c})},a.getFocusedOptionId=function(l){return J1(a.state.focusableOptionsWithIds,l)},a.getFocusableOptionsWithIds=function(){return t3(Up(a.props,a.state.selectValue),a.getElementId("option"))},a.getValue=function(){return a.state.selectValue},a.cx=function(){for(var l=arguments.length,u=new Array(l),c=0;c<l;c++)u[c]=arguments[c];return q$.apply(void 0,[a.props.classNamePrefix].concat(u))},a.getOptionLabel=function(l){return wE(a.props,l)},a.getOptionValue=function(l){return Vm(a.props,l)},a.getStyles=function(l,u){var c=a.props.unstyled,f=Hz[l](u,c);f.boxSizing="border-box";var p=a.props.styles[l];return p?p(f,u):f},a.getClassNames=function(l,u){var c,f;return(c=(f=a.props.classNames)[l])===null||c===void 0?void 0:c.call(f,u)},a.getElementId=function(l){return"".concat(a.state.instancePrefix,"-").concat(l)},a.getComponents=function(){return dz(a.props)},a.buildCategorizedOptions=function(){return Up(a.props,a.state.selectValue)},a.getCategorizedOptions=function(){return a.props.menuIsOpen?a.buildCategorizedOptions():[]},a.buildFocusableOptions=function(){return bE(a.buildCategorizedOptions())},a.getFocusableOptions=function(){return a.props.menuIsOpen?a.buildFocusableOptions():[]},a.ariaOnChange=function(l,u){a.setState({ariaSelection:st({value:l},u)})},a.onMenuMouseDown=function(l){l.button===0&&(l.stopPropagation(),l.preventDefault(),a.focusInput())},a.onMenuMouseMove=function(l){a.blockOptionHover=!1},a.onControlMouseDown=function(l){if(!l.defaultPrevented){var u=a.props.openMenuOnClick;a.state.isFocused?a.props.menuIsOpen?l.target.tagName!=="INPUT"&&l.target.tagName!=="TEXTAREA"&&a.onMenuClose():u&&a.openMenu("first"):(u&&(a.openAfterFocus=!0),a.focusInput()),l.target.tagName!=="INPUT"&&l.target.tagName!=="TEXTAREA"&&l.preventDefault()}},a.onDropdownIndicatorMouseDown=function(l){if(!(l&&l.type==="mousedown"&&l.button!==0)&&!a.props.isDisabled){var u=a.props,c=u.isMulti,f=u.menuIsOpen;a.focusInput(),f?(a.setState({inputIsHiddenAfterUpdate:!c}),a.onMenuClose()):a.openMenu("first"),l.preventDefault()}},a.onClearIndicatorMouseDown=function(l){l&&l.type==="mousedown"&&l.button!==0||(a.clearValue(),l.preventDefault(),a.openAfterFocus=!1,l.type==="touchend"?a.focusInput():setTimeout(function(){return a.focusInput()}))},a.onScroll=function(l){typeof a.props.closeMenuOnScroll=="boolean"?l.target instanceof HTMLElement&&e0(l.target)&&a.props.onMenuClose():typeof a.props.closeMenuOnScroll=="function"&&a.props.closeMenuOnScroll(l)&&a.props.onMenuClose()},a.onCompositionStart=function(){a.isComposing=!0},a.onCompositionEnd=function(){a.isComposing=!1},a.onTouchStart=function(l){var u=l.touches,c=u&&u.item(0);c&&(a.initialTouchX=c.clientX,a.initialTouchY=c.clientY,a.userIsDragging=!1)},a.onTouchMove=function(l){var u=l.touches,c=u&&u.item(0);if(c){var f=Math.abs(c.clientX-a.initialTouchX),p=Math.abs(c.clientY-a.initialTouchY),d=5;a.userIsDragging=f>d||p>d}},a.onTouchEnd=function(l){a.userIsDragging||(a.controlRef&&!a.controlRef.contains(l.target)&&a.menuListRef&&!a.menuListRef.contains(l.target)&&a.blurInput(),a.initialTouchX=0,a.initialTouchY=0)},a.onControlTouchEnd=function(l){a.userIsDragging||a.onControlMouseDown(l)},a.onClearIndicatorTouchEnd=function(l){a.userIsDragging||a.onClearIndicatorMouseDown(l)},a.onDropdownIndicatorTouchEnd=function(l){a.userIsDragging||a.onDropdownIndicatorMouseDown(l)},a.handleInputChange=function(l){var u=a.props.inputValue,c=l.currentTarget.value;a.setState({inputIsHiddenAfterUpdate:!1}),a.onInputChange(c,{action:"input-change",prevInputValue:u}),a.props.menuIsOpen||a.onMenuOpen()},a.onInputFocus=function(l){a.props.onFocus&&a.props.onFocus(l),a.setState({inputIsHiddenAfterUpdate:!1,isFocused:!0}),(a.openAfterFocus||a.props.openMenuOnFocus)&&a.openMenu("first"),a.openAfterFocus=!1},a.onInputBlur=function(l){var u=a.props.inputValue;if(a.menuListRef&&a.menuListRef.contains(document.activeElement)){a.inputRef.focus();return}a.props.onBlur&&a.props.onBlur(l),a.onInputChange("",{action:"input-blur",prevInputValue:u}),a.onMenuClose(),a.setState({focusedValue:null,isFocused:!1})},a.onOptionHover=function(l){if(!(a.blockOptionHover||a.state.focusedOption===l)){var u=a.getFocusableOptions(),c=u.indexOf(l);a.setState({focusedOption:l,focusedOptionId:c>-1?a.getFocusedOptionId(l):null})}},a.shouldHideSelectedOptions=function(){return AE(a.props)},a.onValueInputFocus=function(l){l.preventDefault(),l.stopPropagation(),a.focus()},a.onKeyDown=function(l){var u=a.props,c=u.isMulti,f=u.backspaceRemovesValue,p=u.escapeClearsValue,d=u.inputValue,v=u.isClearable,S=u.isDisabled,x=u.menuIsOpen,g=u.onKeyDown,y=u.tabSelectsValue,_=u.openMenuOnFocus,E=a.state,D=E.focusedOption,R=E.focusedValue,O=E.selectValue;if(!S&&!(typeof g=="function"&&(g(l),l.defaultPrevented))){switch(a.blockOptionHover=!0,l.key){case"ArrowLeft":if(!c||d)return;a.focusValue("previous");break;case"ArrowRight":if(!c||d)return;a.focusValue("next");break;case"Delete":case"Backspace":if(d)return;if(R)a.removeValue(R);else{if(!f)return;c?a.popValue():v&&a.clearValue()}break;case"Tab":if(a.isComposing||l.shiftKey||!x||!y||!D||_&&a.isOptionSelected(D,O))return;a.selectOption(D);break;case"Enter":if(l.keyCode===229)break;if(x){if(!D||a.isComposing)return;a.selectOption(D);break}return;case"Escape":x?(a.setState({inputIsHiddenAfterUpdate:!1}),a.onInputChange("",{action:"menu-close",prevInputValue:d}),a.onMenuClose()):v&&p&&a.clearValue();break;case" ":if(d)return;if(!x){a.openMenu("first");break}if(!D)return;a.selectOption(D);break;case"ArrowUp":x?a.focusOption("up"):a.openMenu("last");break;case"ArrowDown":x?a.focusOption("down"):a.openMenu("first");break;case"PageUp":if(!x)return;a.focusOption("pageup");break;case"PageDown":if(!x)return;a.focusOption("pagedown");break;case"Home":if(!x)return;a.focusOption("first");break;case"End":if(!x)return;a.focusOption("last");break;default:return}l.preventDefault()}},a.state.instancePrefix="react-select-"+(a.props.instanceId||++eq),a.state.selectValue=$4(r.value),r.menuIsOpen&&a.state.selectValue.length){var i=a.getFocusableOptionsWithIds(),s=a.buildFocusableOptions(),o=s.indexOf(a.state.selectValue[0]);a.state.focusableOptionsWithIds=i,a.state.focusedOption=s[o],a.state.focusedOptionId=J1(i,s[o])}return a}return vB(n,[{key:"componentDidMount",value:function(){this.startListeningComposition(),this.startListeningToTouch(),this.props.closeMenuOnScroll&&document&&document.addEventListener&&document.addEventListener("scroll",this.onScroll,!0),this.props.autoFocus&&this.focusInput(),this.props.menuIsOpen&&this.state.focusedOption&&this.menuListRef&&this.focusedOptionRef&&U4(this.menuListRef,this.focusedOptionRef)}},{key:"componentDidUpdate",value:function(a){var i=this.props,s=i.isDisabled,o=i.menuIsOpen,l=this.state.isFocused;(l&&!s&&a.isDisabled||l&&o&&!a.menuIsOpen)&&this.focusInput(),l&&s&&!a.isDisabled?this.setState({isFocused:!1},this.onMenuClose):!l&&!s&&a.isDisabled&&this.inputRef===document.activeElement&&this.setState({isFocused:!0}),this.menuListRef&&this.focusedOptionRef&&this.scrollToFocusedOptionOnUpdate&&(U4(this.menuListRef,this.focusedOptionRef),this.scrollToFocusedOptionOnUpdate=!1)}},{key:"componentWillUnmount",value:function(){this.stopListeningComposition(),this.stopListeningToTouch(),document.removeEventListener("scroll",this.onScroll,!0)}},{key:"onMenuOpen",value:function(){this.props.onMenuOpen()}},{key:"onMenuClose",value:function(){this.onInputChange("",{action:"menu-close",prevInputValue:this.props.inputValue}),this.props.onMenuClose()}},{key:"onInputChange",value:function(a,i){this.props.onInputChange(a,i)}},{key:"focusInput",value:function(){this.inputRef&&this.inputRef.focus()}},{key:"blurInput",value:function(){this.inputRef&&this.inputRef.blur()}},{key:"openMenu",value:function(a){var i=this,s=this.state,o=s.selectValue,l=s.isFocused,u=this.buildFocusableOptions(),c=a==="first"?0:u.length-1;if(!this.props.isMulti){var f=u.indexOf(o[0]);f>-1&&(c=f)}this.scrollToFocusedOptionOnUpdate=!(l&&this.menuListRef),this.setState({inputIsHiddenAfterUpdate:!1,focusedValue:null,focusedOption:u[c],focusedOptionId:this.getFocusedOptionId(u[c])},function(){return i.onMenuOpen()})}},{key:"focusValue",value:function(a){var i=this.state,s=i.selectValue,o=i.focusedValue;if(this.props.isMulti){this.setState({focusedOption:null});var l=s.indexOf(o);o||(l=-1);var u=s.length-1,c=-1;if(s.length){switch(a){case"previous":l===0?c=0:l===-1?c=u:c=l-1;break;case"next":l>-1&&l<u&&(c=l+1);break}this.setState({inputIsHidden:c!==-1,focusedValue:s[c]})}}}},{key:"focusOption",value:function(){var a=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"first",i=this.props.pageSize,s=this.state.focusedOption,o=this.getFocusableOptions();if(o.length){var l=0,u=o.indexOf(s);s||(u=-1),a==="up"?l=u>0?u-1:o.length-1:a==="down"?l=(u+1)%o.length:a==="pageup"?(l=u-i,l<0&&(l=0)):a==="pagedown"?(l=u+i,l>o.length-1&&(l=o.length-1)):a==="last"&&(l=o.length-1),this.scrollToFocusedOptionOnUpdate=!0,this.setState({focusedOption:o[l],focusedValue:null,focusedOptionId:this.getFocusedOptionId(o[l])})}}},{key:"getTheme",value:function(){return this.props.theme?typeof this.props.theme=="function"?this.props.theme(W1):st(st({},W1),this.props.theme):W1}},{key:"getCommonProps",value:function(){var a=this.clearValue,i=this.cx,s=this.getStyles,o=this.getClassNames,l=this.getValue,u=this.selectOption,c=this.setValue,f=this.props,p=f.isMulti,d=f.isRtl,v=f.options,S=this.hasValue();return{clearValue:a,cx:i,getStyles:s,getClassNames:o,getValue:l,hasValue:S,isMulti:p,isRtl:d,options:v,selectOption:u,selectProps:f,setValue:c,theme:this.getTheme()}}},{key:"hasValue",value:function(){var a=this.state.selectValue;return a.length>0}},{key:"hasOptions",value:function(){return!!this.getFocusableOptions().length}},{key:"isClearable",value:function(){var a=this.props,i=a.isClearable,s=a.isMulti;return i===void 0?s:i}},{key:"isOptionDisabled",value:function(a,i){return xE(this.props,a,i)}},{key:"isOptionSelected",value:function(a,i){return SE(this.props,a,i)}},{key:"filterOption",value:function(a,i){return _E(this.props,a,i)}},{key:"formatOptionLabel",value:function(a,i){if(typeof this.props.formatOptionLabel=="function"){var s=this.props.inputValue,o=this.state.selectValue;return this.props.formatOptionLabel(a,{context:i,inputValue:s,selectValue:o})}else return this.getOptionLabel(a)}},{key:"formatGroupLabel",value:function(a){return this.props.formatGroupLabel(a)}},{key:"startListeningComposition",value:function(){document&&document.addEventListener&&(document.addEventListener("compositionstart",this.onCompositionStart,!1),document.addEventListener("compositionend",this.onCompositionEnd,!1))}},{key:"stopListeningComposition",value:function(){document&&document.removeEventListener&&(document.removeEventListener("compositionstart",this.onCompositionStart),document.removeEventListener("compositionend",this.onCompositionEnd))}},{key:"startListeningToTouch",value:function(){document&&document.addEventListener&&(document.addEventListener("touchstart",this.onTouchStart,!1),document.addEventListener("touchmove",this.onTouchMove,!1),document.addEventListener("touchend",this.onTouchEnd,!1))}},{key:"stopListeningToTouch",value:function(){document&&document.removeEventListener&&(document.removeEventListener("touchstart",this.onTouchStart),document.removeEventListener("touchmove",this.onTouchMove),document.removeEventListener("touchend",this.onTouchEnd))}},{key:"renderInput",value:function(){var a=this.props,i=a.isDisabled,s=a.isSearchable,o=a.inputId,l=a.inputValue,u=a.tabIndex,c=a.form,f=a.menuIsOpen,p=a.required,d=this.getComponents(),v=d.Input,S=this.state,x=S.inputIsHidden,g=S.ariaSelection,y=this.commonProps,_=o||this.getElementId("input"),E=st(st(st({"aria-autocomplete":"list","aria-expanded":f,"aria-haspopup":!0,"aria-errormessage":this.props["aria-errormessage"],"aria-invalid":this.props["aria-invalid"],"aria-label":this.props["aria-label"],"aria-labelledby":this.props["aria-labelledby"],"aria-required":p,role:"combobox","aria-activedescendant":this.isAppleDevice?void 0:this.state.focusedOptionId||""},f&&{"aria-controls":this.getElementId("listbox")}),!s&&{"aria-readonly":!0}),this.hasValue()?(g==null?void 0:g.action)==="initial-input-focus"&&{"aria-describedby":this.getElementId("live-region")}:{"aria-describedby":this.getElementId("placeholder")});return s?C.createElement(v,ot({},y,{autoCapitalize:"none",autoComplete:"off",autoCorrect:"off",id:_,innerRef:this.getInputRef,isDisabled:i,isHidden:x,onBlur:this.onInputBlur,onChange:this.handleInputChange,onFocus:this.onInputFocus,spellCheck:"false",tabIndex:u,form:c,type:"text",value:l},E)):C.createElement(Ez,ot({id:_,innerRef:this.getInputRef,onBlur:this.onInputBlur,onChange:qm,onFocus:this.onInputFocus,disabled:i,tabIndex:u,inputMode:"none",form:c,value:""},E))}},{key:"renderPlaceholderOrValue",value:function(){var a=this,i=this.getComponents(),s=i.MultiValue,o=i.MultiValueContainer,l=i.MultiValueLabel,u=i.MultiValueRemove,c=i.SingleValue,f=i.Placeholder,p=this.commonProps,d=this.props,v=d.controlShouldRenderValue,S=d.isDisabled,x=d.isMulti,g=d.inputValue,y=d.placeholder,_=this.state,E=_.selectValue,D=_.focusedValue,R=_.isFocused;if(!this.hasValue()||!v)return g?null:C.createElement(f,ot({},p,{key:"placeholder",isDisabled:S,isFocused:R,innerProps:{id:this.getElementId("placeholder")}}),y);if(x)return E.map(function(j,$){var V=j===D,T="".concat(a.getOptionLabel(j),"-").concat(a.getOptionValue(j));return C.createElement(s,ot({},p,{components:{Container:o,Label:l,Remove:u},isFocused:V,isDisabled:S,key:T,index:$,removeProps:{onClick:function(){return a.removeValue(j)},onTouchEnd:function(){return a.removeValue(j)},onMouseDown:function(q){q.preventDefault()}},data:j}),a.formatOptionLabel(j,"value"))});if(g)return null;var O=E[0];return C.createElement(c,ot({},p,{data:O,isDisabled:S}),this.formatOptionLabel(O,"value"))}},{key:"renderClearIndicator",value:function(){var a=this.getComponents(),i=a.ClearIndicator,s=this.commonProps,o=this.props,l=o.isDisabled,u=o.isLoading,c=this.state.isFocused;if(!this.isClearable()||!i||l||!this.hasValue()||u)return null;var f={onMouseDown:this.onClearIndicatorMouseDown,onTouchEnd:this.onClearIndicatorTouchEnd,"aria-hidden":"true"};return C.createElement(i,ot({},s,{innerProps:f,isFocused:c}))}},{key:"renderLoadingIndicator",value:function(){var a=this.getComponents(),i=a.LoadingIndicator,s=this.commonProps,o=this.props,l=o.isDisabled,u=o.isLoading,c=this.state.isFocused;if(!i||!u)return null;var f={"aria-hidden":"true"};return C.createElement(i,ot({},s,{innerProps:f,isDisabled:l,isFocused:c}))}},{key:"renderIndicatorSeparator",value:function(){var a=this.getComponents(),i=a.DropdownIndicator,s=a.IndicatorSeparator;if(!i||!s)return null;var o=this.commonProps,l=this.props.isDisabled,u=this.state.isFocused;return C.createElement(s,ot({},o,{isDisabled:l,isFocused:u}))}},{key:"renderDropdownIndicator",value:function(){var a=this.getComponents(),i=a.DropdownIndicator;if(!i)return null;var s=this.commonProps,o=this.props.isDisabled,l=this.state.isFocused,u={onMouseDown:this.onDropdownIndicatorMouseDown,onTouchEnd:this.onDropdownIndicatorTouchEnd,"aria-hidden":"true"};return C.createElement(i,ot({},s,{innerProps:u,isDisabled:o,isFocused:l}))}},{key:"renderMenu",value:function(){var a=this,i=this.getComponents(),s=i.Group,o=i.GroupHeading,l=i.Menu,u=i.MenuList,c=i.MenuPortal,f=i.LoadingMessage,p=i.NoOptionsMessage,d=i.Option,v=this.commonProps,S=this.state.focusedOption,x=this.props,g=x.captureMenuScroll,y=x.inputValue,_=x.isLoading,E=x.loadingMessage,D=x.minMenuHeight,R=x.maxMenuHeight,O=x.menuIsOpen,j=x.menuPlacement,$=x.menuPosition,V=x.menuPortalTarget,T=x.menuShouldBlockScroll,P=x.menuShouldScrollIntoView,q=x.noOptionsMessage,Y=x.onMenuScrollToTop,se=x.onMenuScrollToBottom;if(!O)return null;var G=function(z,W){var te=z.type,B=z.data,ee=z.isDisabled,fe=z.isSelected,me=z.label,Se=z.value,we=S===B,je=ee?void 0:function(){return a.onOptionHover(B)},Ae=ee?void 0:function(){return a.selectOption(B)},Me="".concat(a.getElementId("option"),"-").concat(W),pe={id:Me,onClick:Ae,onMouseMove:je,onMouseOver:je,tabIndex:-1,role:"option","aria-selected":a.isAppleDevice?void 0:fe};return C.createElement(d,ot({},v,{innerProps:pe,data:B,isDisabled:ee,isSelected:fe,key:Me,label:me,type:te,value:Se,isFocused:we,innerRef:we?a.getFocusedOptionRef:void 0}),a.formatOptionLabel(z.data,"menu"))},ne;if(this.hasOptions())ne=this.getCategorizedOptions().map(function(L){if(L.type==="group"){var z=L.data,W=L.options,te=L.index,B="".concat(a.getElementId("group"),"-").concat(te),ee="".concat(B,"-heading");return C.createElement(s,ot({},v,{key:B,data:z,options:W,Heading:o,headingProps:{id:ee,data:L.data},label:a.formatGroupLabel(L.data)}),L.options.map(function(fe){return G(fe,"".concat(te,"-").concat(fe.index))}))}else if(L.type==="option")return G(L,"".concat(L.index))});else if(_){var Q=E({inputValue:y});if(Q===null)return null;ne=C.createElement(f,v,Q)}else{var ie=q({inputValue:y});if(ie===null)return null;ne=C.createElement(p,v,ie)}var J={minMenuHeight:D,maxMenuHeight:R,menuPlacement:j,menuPosition:$,menuShouldScrollIntoView:P},le=C.createElement(iU,ot({},v,J),function(L){var z=L.ref,W=L.placerProps,te=W.placement,B=W.maxHeight;return C.createElement(l,ot({},v,J,{innerRef:z,innerProps:{onMouseDown:a.onMenuMouseDown,onMouseMove:a.onMenuMouseMove},isLoading:_,placement:te}),C.createElement(Dz,{captureEnabled:g,onTopArrive:Y,onBottomArrive:se,lockEnabled:T},function(ee){return C.createElement(u,ot({},v,{innerRef:function(me){a.getMenuListRef(me),ee(me)},innerProps:{role:"listbox","aria-multiselectable":v.isMulti,id:a.getElementId("listbox")},isLoading:_,maxHeight:B,focusedOption:S}),ne)}))});return V||$==="fixed"?C.createElement(c,ot({},v,{appendTo:V,controlElement:this.controlRef,menuPlacement:j,menuPosition:$}),le):le}},{key:"renderFormField",value:function(){var a=this,i=this.props,s=i.delimiter,o=i.isDisabled,l=i.isMulti,u=i.name,c=i.required,f=this.state.selectValue;if(c&&!this.hasValue()&&!o)return C.createElement(kz,{name:u,onFocus:this.onValueInputFocus});if(!(!u||o))if(l)if(s){var p=f.map(function(S){return a.getOptionValue(S)}).join(s);return C.createElement("input",{name:u,type:"hidden",value:p})}else{var d=f.length>0?f.map(function(S,x){return C.createElement("input",{key:"i-".concat(x),name:u,type:"hidden",value:a.getOptionValue(S)})}):C.createElement("input",{name:u,type:"hidden",value:""});return C.createElement("div",null,d)}else{var v=f[0]?this.getOptionValue(f[0]):"";return C.createElement("input",{name:u,type:"hidden",value:v})}}},{key:"renderLiveRegion",value:function(){var a=this.commonProps,i=this.state,s=i.ariaSelection,o=i.focusedOption,l=i.focusedValue,u=i.isFocused,c=i.selectValue,f=this.getFocusableOptions();return C.createElement(wz,ot({},a,{id:this.getElementId("live-region"),ariaSelection:s,focusedOption:o,focusedValue:l,isFocused:u,selectValue:c,focusableOptions:f,isAppleDevice:this.isAppleDevice}))}},{key:"render",value:function(){var a=this.getComponents(),i=a.Control,s=a.IndicatorsContainer,o=a.SelectContainer,l=a.ValueContainer,u=this.props,c=u.className,f=u.id,p=u.isDisabled,d=u.menuIsOpen,v=this.state.isFocused,S=this.commonProps=this.getCommonProps();return C.createElement(o,ot({},S,{className:c,innerProps:{id:f,onKeyDown:this.onKeyDown},isDisabled:p,isFocused:v}),this.renderLiveRegion(),C.createElement(i,ot({},S,{innerRef:this.getControlRef,innerProps:{onMouseDown:this.onControlMouseDown,onTouchEnd:this.onControlTouchEnd},isDisabled:p,isFocused:v,menuIsOpen:d}),C.createElement(l,ot({},S,{isDisabled:p}),this.renderPlaceholderOrValue(),this.renderInput()),C.createElement(s,ot({},S,{isDisabled:p}),this.renderClearIndicator(),this.renderLoadingIndicator(),this.renderIndicatorSeparator(),this.renderDropdownIndicator())),this.renderMenu(),this.renderFormField())}}],[{key:"getDerivedStateFromProps",value:function(a,i){var s=i.prevProps,o=i.clearFocusValueOnUpdate,l=i.inputIsHiddenAfterUpdate,u=i.ariaSelection,c=i.isFocused,f=i.prevWasFocused,p=i.instancePrefix,d=a.options,v=a.value,S=a.menuIsOpen,x=a.inputValue,g=a.isMulti,y=$4(v),_={};if(s&&(v!==s.value||d!==s.options||S!==s.menuIsOpen||x!==s.inputValue)){var E=S?Xz(a,y):[],D=S?t3(Up(a,y),"".concat(p,"-option")):[],R=o?Qz(i,y):null,O=Zz(i,E),j=J1(D,O);_={selectValue:y,focusedOption:O,focusedOptionId:j,focusableOptionsWithIds:D,focusedValue:R,clearFocusValueOnUpdate:!1}}var $=l!=null&&a!==s?{inputIsHidden:l,inputIsHiddenAfterUpdate:void 0}:{},V=u,T=c&&f;return c&&!T&&(V={value:fp(g,y,y[0]||null),options:y,action:"initial-input-focus"},T=!f),(u==null?void 0:u.action)==="initial-input-focus"&&(V=null),st(st(st({},_),$),{},{prevProps:a,ariaSelection:V,prevWasFocused:T})}}]),n}(C.Component);NE.defaultProps=Kz;var tq=C.forwardRef(function(e,t){var n=mB(e);return C.createElement(NE,ot({ref:t},n))}),nq=tq;const EE="mosques-by-location-db",Gu="mosquesByLocation";async function rq(e,t){await(await $n(EE,1,{upgrade(r){r.objectStoreNames.contains(Gu)||r.createObjectStore(Gu)}})).put(Gu,t,e)}async function aq(e){return(await $n(EE,1,{upgrade(n){n.objectStoreNames.contains(Gu)||n.createObjectStore(Gu)}})).get(Gu,e)}function iq(e,{onFetchMosques:t}={}){const[n,r]=C.useState([]),[a,i]=C.useState(!1);return C.useEffect(()=>{if(!e){r([]);return}let s=!1;return i(!0),(async()=>{try{const l=await aq(e);if(!s&&l&&l.length>0&&(r(l),t==null||t(l)),navigator.onLine){const u=await mI(e);if(!s)if(!u||u.length===0)r([]),t==null||t([]);else{const c=u.map(f=>({value:f.id,label:f.name,isDisabled:f.name==="Other Masjids"?!0:f.isDisabled??!1}));r(c),t==null||t(c),await rq(e,c)}}else(!l||l.length===0)&&(r([]),t==null||t([]),Ht("info","You are offline and no cached mosque data is available."))}catch(l){s||(r([]),Ht("error",l.message))}finally{s||i(!1)}})(),()=>{s=!0}},[e]),{mosques:n,loading:a}}const sq=e=>{const t=C.useRef(null);return C.useEffect(()=>{const n=t.current;n&&(n.tabIndex=0,n.focus())},[]),b.jsx(pE.Input,{...e,innerRef:n=>{t.current=n}})},oq={control:e=>({...e,color:"#1a202c",backgroundColor:"white"}),singleValue:e=>({...e,color:"#1a202c"}),input:e=>({...e,color:"#1a202c"}),option:(e,t)=>({...e,color:t.isDisabled?"green":t.isSelected?"#fff":"#1a202c",backgroundColor:t.isDisabled?"#f0f0f0":t.isSelected?"#2563eb":"#fff",cursor:t.isDisabled?"default":"pointer",fontWeight:t.isDisabled?"bold":"normal",pointerEvents:t.isDisabled?"none":"auto"}),placeholder:e=>({...e,color:"#a0aec0"})},CE=({isHome:e=!0})=>{const{org_nr:t}=Cn(),{locationId:n,selectedMosque:r,setSelectedMosque:a}=da(),{mosques:i}=iq(n),s=fa(),o=xi(),{t:l}=Dn(),u=c=>{if(a(c),!c)return;const f=o.pathname;f.includes("events")?s(`/${c.value}/events`):f.includes("view-timetable")?s(`/${c.value}/view-timetable`):s(e?`/${c.value}`:`/${c.value}/view-timetable`)};return b.jsxs("div",{className:"flex justify-center gap-1",children:[b.jsx("div",{children:b.jsx("button",{type:"button",disabled:e,className:`p-0 border-0 bg-transparent ${e?"cursor-default":"cursor-pointer"}`,onClick:()=>{e||s(`/${t}`)},"aria-label":"Go to masjid home",children:b.jsx("img",{src:"/img/masjid-select.png",alt:""})})}),b.jsx("div",{className:"w-50",children:b.jsx(nq,{options:i,value:r,onChange:u,isSearchable:!0,placeholder:l("Select Masjid"),noOptionsMessage:()=>"No masjid found",styles:oq,components:{Input:sq}})})]})};function lq(e){return lr({attr:{viewBox:"0 0 24 24",fill:"currentColor"},child:[{tag:"path",attr:{d:"M11.9997 10.5865L16.9495 5.63672L18.3637 7.05093L13.4139 12.0007L18.3637 16.9504L16.9495 18.3646L11.9997 13.4149L7.04996 18.3646L5.63574 16.9504L10.5855 12.0007L5.63574 7.05093L7.04996 5.63672L11.9997 10.5865Z"},child:[]}]})(e)}const LE="location-db",Wu="locations";async function uq(e){await(await $n(LE,1,{upgrade(n){n.objectStoreNames.contains(Wu)||n.createObjectStore(Wu)}})).put(Wu,e,"all")}async function r3(){return(await $n(LE,1,{upgrade(t){t.objectStoreNames.contains(Wu)||t.createObjectStore(Wu)}})).get(Wu,"all")}function cq(){const[e,t]=C.useState([{name:"Oslo",id:"NO0301"}]),[n,r]=C.useState(!0);return C.useEffect(()=>{(async()=>{try{const i=await r3();if(!navigator.onLine){i&&i.length>0&&t(i),r(!1);return}const o=await tB();if(!o){i&&i.length>0&&(t(i),Ht("warning","Could not fetch fresh data, showing cached locations.")),r(!1);return}t(o),await uq(o),r(!1)}catch(i){console.error("Error fetching locations: ",i),Ht("error","Error fetching locations");const s=await r3();s&&s.length>0&&(t(s),Ht("info","Showing cached locations due to fetch error.")),r(!1)}})()},[]),{locations:e,loading:n}}function X5(e){return lr({attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M217.9 256L345 129c9.4-9.4 9.4-24.6 0-33.9-9.4-9.4-24.6-9.3-34 0L167 239c-9.1 9.1-9.3 23.7-.7 33.1L310.9 417c4.7 4.7 10.9 7 17 7s12.3-2.3 17-7c9.4-9.4 9.4-24.6 0-33.9L217.9 256z"},child:[]}]})(e)}function fq(e){return lr({attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M416.3 256c0-21 13.1-38.9 31.7-46.1-4.9-20.5-13-39.7-23.7-57.1-6.4 2.8-13.2 4.3-20.1 4.3-12.6 0-25.2-4.8-34.9-14.4-14.9-14.9-18.2-36.8-10.2-55-17.3-10.7-36.6-18.8-57-23.7C295 82.5 277 95.7 256 95.7S217 82.5 209.9 64c-20.5 4.9-39.7 13-57.1 23.7 8.1 18.1 4.7 40.1-10.2 55-9.6 9.6-22.3 14.4-34.9 14.4-6.9 0-13.7-1.4-20.1-4.3C77 170.3 68.9 189.5 64 210c18.5 7.1 31.7 25 31.7 46.1 0 21-13.1 38.9-31.6 46.1 4.9 20.5 13 39.7 23.7 57.1 6.4-2.8 13.2-4.2 20-4.2 12.6 0 25.2 4.8 34.9 14.4 14.8 14.8 18.2 36.8 10.2 54.9 17.4 10.7 36.7 18.8 57.1 23.7 7.1-18.5 25-31.6 46-31.6s38.9 13.1 46 31.6c20.5-4.9 39.7-13 57.1-23.7-8-18.1-4.6-40 10.2-54.9 9.6-9.6 22.2-14.4 34.9-14.4 6.8 0 13.7 1.4 20 4.2 10.7-17.4 18.8-36.7 23.7-57.1-18.4-7.2-31.6-25.1-31.6-46.2zm-159.4 79.9c-44.3 0-80-35.9-80-80s35.7-80 80-80 80 35.9 80 80-35.7 80-80 80z"},child:[]}]})(e)}const t0=({isHome:e=!0})=>{const{org_nr:t,loc_id:n}=Cn(),r=fa(),{t:a,i18n:i}=Dn(),{language:s,setLanguage:o,asrMethod:l,setAsrMethod:u,prayerMethod:c,setPrayerMethod:f,locationId:p,setLocationId:d,mosqueLogo:v,selectedMosque:S,setSelectedMosque:x,lat:g,lon:y}=da(),{masjidName:_,masjidAddress:E,masjidPostName:D,masjidContact:R,masjidEmail:O,masjidInfo:j}=Hd(t||(S==null?void 0:S.value)||"982842840"),{locations:$}=cq(),[V,T]=C.useState(!1),[P,q]=C.useState(!1),[Y,se]=C.useState(!1),[G,ne]=C.useState(!1),Q=s==="ar",ie=g&&y?`https://www.openstreetmap.org/export/embed.html?bbox=${y},${g},${y+.002},${g+.002}&marker=${g},${y}&layer=mapnik`:"";C.useEffect(()=>{t&&S||ne(!0)},[t,S,n]);const J=L=>{o(Lv(L)),i.changeLanguage(Lv(L))},le=L=>{const z=L.target.value;$.find(te=>te.id===z)&&(d(z),e&&r(`/loc/${z}`)),x(null)};return b.jsxs("div",{children:[b.jsxs("div",{className:"w-full mb-4 flex justify-between items-center",children:[b.jsxs("div",{className:"flex items-center",children:[!e&&b.jsx("button",{onClick:()=>r(`/${t}`),className:"text-sm font-semibold px-3 py-1 rounded hover:bg-gray-100 hover:text-black",children:b.jsx(JF,{})}),b.jsx("select",{value:p,onChange:le,className:"w-20 sm:w-40 h-full font-semibold hover:cursor-pointer",children:$.map(L=>b.jsx("option",{value:L.id,className:"text-black",children:L.name},L.id))})]}),b.jsx("div",{className:"flex items-center space-x-2 h-full",children:b.jsx("img",{src:v!=null&&v.startsWith("http")?v:v?`data:image/png;base64,${v}`:"/default-logo.png",alt:"logo",className:"h-10 2xl:h-14 object-contain",loading:"lazy"})})]}),b.jsxs("div",{className:"flex flex-col sm:items-end justify-center w-full gap-5 sm:flex-row sm:justify-between",children:[b.jsxs("div",{className:"flex flex-col sm:flex-row items-center sm:w-1/2 gap-5",children:[G&&b.jsx(CE,{isHome:e}),b.jsxs("div",{children:[b.jsxs("h4",{className:"flex justify-center sm:justify-start items-center gap-4 text-lg sm:text-xl font-medium text-center mb-1",children:[_,!G&&b.jsx("span",{className:"cursor-pointer",onClick:()=>ne(!0),children:b.jsx(lq,{size:20,color:"red"})})]}),b.jsx("p",{className:"text-sm md:text-base",children:j})]})]}),b.jsx("div",{dir:Q?"rtl":"ltr",children:b.jsxs("h4",{className:"flex sm:text-xl font-medium items-center justify-center gap-4",children:[b.jsx(P5,{size:22,className:"cursor-pointer hover:text-green-500 hidden md:block",onClick:()=>r(`/${t||"982842840"}/lobby`)}),b.jsx(wN,{className:"cursor-pointer hover:text-yellow-500 hidden md:block",onClick:()=>r(`/${t||"982842840"}/masjid`)}),b.jsx(GI,{className:"cursor-pointer hover:text-blue-500",onClick:()=>q(!0),title:"View Phone"}),b.jsx(KF,{className:"cursor-pointer hover:text-red-500",onClick:()=>T(!0),title:"View Location"}),b.jsx(fq,{size:24,className:"cursor-pointer hover:text-blue-500",onClick:()=>se(!0),title:"Settings"})]})})]}),b.jsx("div",{className:"border-b w-full mt-2 sm:mt-4"}),V&&b.jsx("div",{className:"fixed inset-0 flex items-center justify-center bg-black/50 z-50",onClick:()=>T(!1),children:b.jsx("div",{className:"bg-white rounded-lg p-4 relative shadow-lg w-[90vw] h-[50vh] sm:w-[600px] sm:h-[400px]",onClick:L=>L.stopPropagation(),children:ie?b.jsx("iframe",{width:"100%",height:"100%",className:"rounded-md",src:ie,style:{border:0},allowFullScreen:!0}):b.jsx("h2",{className:"flex justify-center items-center h-full text-xl text-black",children:"No map found!"})})}),P&&b.jsx("div",{className:`\r
131
+ fixed inset-0 flex items-center justify-center \r
132
+ lg:block \r
133
+ bg-black/50 z-50\r
134
+ `,onClick:()=>q(!1),children:b.jsxs("div",{className:`\r
135
+ bg-white rounded-lg p-4 shadow-lg flex flex-col gap-1\r
136
+ w-[80vw] sm:w-[300px]\r
137
+ mt-15\r
138
+ \r
139
+ /* Ensure text wraps instead of overflowing */\r
140
+ break-words\r
141
+ \r
142
+ /* Center for small screens */\r
143
+ sm:mx-auto sm:mt-[20vh]\r
144
+ \r
145
+ /* Right-bottom for large screens */\r
146
+ lg:absolute lg:top-15 lg:right-10\r
147
+ `,onClick:L=>L.stopPropagation(),children:[b.jsxs("p",{className:"text-sm font-medium text-black",children:["Address: ",E]}),b.jsxs("p",{className:"text-sm font-medium text-black",children:["Post Name: ",D]}),b.jsxs("p",{className:"text-sm font-medium text-black",children:["Phone: ",R]}),b.jsxs("p",{className:"text-sm font-medium text-black",children:["Email: ",O]})]})}),Y&&b.jsx("div",{className:`\r
148
+ fixed inset-0 flex items-center justify-center \r
149
+ lg:block \r
150
+ bg-black/50 z-50\r
151
+ `,onClick:()=>se(!1),children:b.jsxs("div",{className:`\r
152
+ bg-white rounded-lg p-4 shadow-lg flex flex-col gap-1\r
153
+ w-[80vw] sm:w-[300px]\r
154
+ mt-15\r
155
+ \r
156
+ /* Ensure text wraps instead of overflowing */\r
157
+ break-words\r
158
+ \r
159
+ /* Center for small screens */\r
160
+ sm:mx-auto sm:mt-[20vh]\r
161
+ \r
162
+ /* Right-bottom for large screens */\r
163
+ lg:absolute lg:top-15 lg:right-10\r
164
+ `,onClick:L=>L.stopPropagation(),children:[b.jsxs("div",{className:"flex gap-2",children:[b.jsx("label",{className:"text-md font-semibold",children:a("LANGUAGE")}),b.jsxs("select",{value:s!==null?s:"",onChange:L=>J(Number(L.target.value)),className:"text-sm rounded-md px-2 py-1",children:[b.jsx("option",{value:"",children:a("SELECT")}),b.jsx("option",{value:1,children:a("NORWEGIAN")}),b.jsx("option",{value:2,children:a("ENGLISH")}),b.jsx("option",{value:3,children:a("ARABIC")})]})]}),b.jsxs("div",{className:"flex gap-2",children:[b.jsx("h2",{className:"text-md font-semibold",children:a("ASR METHOD")}),b.jsxs("select",{value:l!==null?l:"",onChange:L=>u(Number(L.target.value)),className:"bg-white text-sm rounded-md px-2 py-1",children:[b.jsx("option",{value:"",children:a("SELECT")}),b.jsx("option",{value:0,children:a("IRN DEFAULT")}),b.jsx("option",{value:1,children:a("1X METHOD")}),b.jsx("option",{value:2,children:a("2X METHOD")}),b.jsx("option",{value:3,children:a("50% METHOD")})]})]}),b.jsxs("div",{className:"flex gap-2",children:[b.jsx("h2",{className:"text-md font-semibold",children:a("PRAYER METHOD")}),b.jsxs("select",{value:c!==null?c:"",onChange:L=>f(Number(L.target.value)),className:"bg-white text-sm rounded-md px-2 py-1",children:[b.jsx("option",{value:"",children:a("SELECT")}),b.jsx("option",{value:1,children:a("IRN DEFAULT")}),b.jsxs("option",{value:2,children:[a("NORTH")," ",a("METHOD").toLowerCase()]}),b.jsxs("option",{value:3,children:[a("SOUTH")," ",a("METHOD").toLowerCase()]})]})]})]})})]})},dq=["SUN","MON","TUE","WED","THU","FRI","SAT"],hq=e=>{switch(e){case 7:return{calendarBg:"#F8F5E9",calendarText:"#27391C",buttonBg:"#FFFFFF",headingColor:"#FFFFFF",buttonTextColor:"#3A7D44"};case 8:return{calendarBg:"#543A14",calendarText:"#F0BB78",buttonBg:"#543A14",headingColor:"#543A14",buttonTextColor:"#FFF0DC"};case 9:return{calendarBg:"#FEF9E133",calendarText:"#E5D0AC",buttonBg:"#FEF9E1",headingColor:"#FEF9E1",buttonTextColor:"#6D2323"};default:return{calendarBg:"white",calendarText:"black",buttonBg:"black",headingColor:"black",buttonTextColor:"white"}}},dp=e=>Math.floor(e*.9703+622),zp=({tn:e,showDate:t=!0,initialDate:n,onDateSelect:r})=>{const{org_nr:a}=Cn(),{t:i}=Dn(),o=Ms(a||void 0).language,[l,u]=C.useState(n||new Date),[c,f]=C.useState(n||new Date),[p,d]=C.useState(null),[v,S]=C.useState(new Map),{colorScheme:x,hijriMonthNames:g}=da(),y=x.isDefault,_=hq(e??0),D=(()=>{const B=xi(),ee=`/${a}`;return a?B.pathname===ee:B.pathname==="/"})(),R=o==="ar"?"hijri":"gregorian",[O,j]=C.useState(0),[$,V]=C.useState(0),T=l.getFullYear(),P=l.getMonth(),q=new Date,Y=o==="ar"?6:0,se=[];for(let B=0;B<7;B++){const ee=(Y+B)%7;se.push(dq[ee])}C.useEffect(()=>{n&&(f(n),u(new Date(n.getFullYear(),n.getMonth())))},[n]),C.useEffect(()=>{if(!v.size)return;const B=c.toLocaleDateString("en-CA"),ee=v.get(B);d(ee||null),R==="hijri"&&O===0&&ee&&(j(ee.hijri_date_year),V(ee.hijri_date_month),u(new Date(dp(ee.hijri_date_year),P)))},[v,c,R,O,P]),C.useEffect(()=>{const B=T,ee=new Date(B-1,0,1),fe=new Date(B+1,11,31),me=ee.toISOString().split("T")[0],Se=fe.toISOString().split("T")[0];Mg(me,Se).then(we=>{S(je=>new Map([...je,...we]))}).catch(we=>{console.error("Failed to fetch Hijri dates for year:",we)})},[T]);const G=()=>{if(R==="gregorian"){const ee=(new Date(T,P,1).getDay()-Y+7)%7,fe=new Date(T,P+1,0).getDate(),me=[],Se=P===0?11:P-1,we=P===0?T-1:T,je=new Date(we,Se+1,0).getDate();for(let pe=ee;pe>0;pe--){const X=new Date(we,Se,je-pe+1),Ge=X.toLocaleDateString("en-CA"),Pe=v.get(Ge);me.push({gregorian:X.getDate(),hijri:Pe==null?void 0:Pe.hijri_date_day,hijriObj:Pe,currentMonth:!1,fullDate:X})}for(let pe=1;pe<=fe;pe++){const X=new Date(T,P,pe),Ge=X.toLocaleDateString("en-CA"),Pe=v.get(Ge);me.push({gregorian:pe,hijri:Pe==null?void 0:Pe.hijri_date_day,hijriObj:Pe,currentMonth:!0,fullDate:X})}const Me=(7-me.length%7)%7;for(let pe=1;pe<=Me;pe++){const X=new Date(T,P+1,pe),Ge=X.toLocaleDateString("en-CA"),Pe=v.get(Ge);me.push({gregorian:pe,hijri:Pe==null?void 0:Pe.hijri_date_day,hijriObj:Pe,currentMonth:!1,fullDate:X})}return me}else{const B=[];for(const[Ae,Me]of v.entries())if(Me.hijri_date_year===O&&Me.hijri_date_month===$){const pe=new Date(Ae);B.push({gregorian:pe.getDate(),hijri:Me.hijri_date_day,hijriObj:Me,currentMonth:!0,fullDate:pe})}if(B.sort((Ae,Me)=>Ae.fullDate.getTime()-Me.fullDate.getTime()),B.length===0)return[];const ee=B[0].fullDate,fe=B[B.length-1].fullDate,me=(ee.getDay()-Y+7)%7,Se=[];for(let Ae=me;Ae>0;Ae--){const Me=new Date(ee);Me.setDate(Me.getDate()-Ae);const pe=Me.toLocaleDateString("en-CA"),X=v.get(pe);Se.push({gregorian:Me.getDate(),hijri:X==null?void 0:X.hijri_date_day,hijriObj:X,currentMonth:!1,fullDate:Me})}Se.push(...B);const je=(7-Se.length%7)%7;for(let Ae=1;Ae<=je;Ae++){const Me=new Date(fe);Me.setDate(Me.getDate()+Ae);const pe=Me.toLocaleDateString("en-CA"),X=v.get(pe);Se.push({gregorian:Me.getDate(),hijri:X==null?void 0:X.hijri_date_day,hijriObj:X,currentMonth:!1,fullDate:Me})}return Se}},ne=(B,ee)=>{const fe=B.getFullYear(),me=B.getMonth();u(new Date(fe,me)),f(B),d(ee||null),R==="hijri"&&ee&&(j(ee.hijri_date_year),V(ee.hijri_date_month)),r&&r(B,ee)},Q=()=>{const B=q.toLocaleDateString("en-CA"),ee=v.get(B),fe=q.getFullYear(),me=q.getMonth();u(new Date(fe,me)),f(q),d(ee||null),R==="hijri"&&ee&&(j(ee.hijri_date_year),V(ee.hijri_date_month)),r&&r(q,ee)},ie=()=>{if(R==="gregorian")u(new Date(T,P-1));else{let B=$-1,ee=O;B<1&&(B=12,ee--),V(B),j(ee),u(new Date(dp(ee),0))}},J=()=>{if(R==="gregorian")u(new Date(T,P+1));else{let B=$+1,ee=O;B>12&&(B=1,ee++),V(B),j(ee),u(new Date(dp(ee),0))}},le=B=>{R==="gregorian"?u(new Date(B,P)):(j(B),u(new Date(dp(B),0)))},L=G();let z;R==="gregorian"?z=l.toLocaleString("default",{month:"long"}):z=g[$-1]||`Month ${$}`;const W=Array.from({length:20},(B,ee)=>R==="gregorian"?2015+ee:1436+ee),te=R==="gregorian"?T:O;return b.jsx("div",{style:{color:y?_.calendarText:x.textColor},className:"",children:b.jsxs("div",{className:`${D?"p-4":"p-4 md:p-6"} rounded-lg border`,style:{color:y?_.calendarText:x.prayerTimesColor.text,backgroundColor:y?_.calendarBg:x.prayerTimesColor.bg,direction:o==="ar"?"rtl":"ltr"},children:[b.jsx("h2",{className:`text-center font-bold ${D?"text-sm sm:text-base mb-4":"text-md md:text-lg mb-4"}`,children:i("HIJRI CALENDAR").toUpperCase()}),b.jsxs("div",{className:`flex justify-between items-center ${D?"mb-3 px-2":"mb-4 md:mb-6 md:px-4"}`,children:[b.jsx("select",{value:te,onChange:B=>le(Number(B.target.value)),className:`border p-${D?"1":"2"} rounded ${D?"text-sm":"text-sm md:text-md font-semibold"}`,style:{backgroundColor:y?_.buttonBg:x.prayerTimesColor.text,color:y?_.buttonTextColor:x.prayerTimesColor.bg},children:W.map(B=>b.jsx("option",{value:B,children:B},B))}),b.jsxs("div",{className:`flex items-center ${D?"gap-2":"gap-2 md:gap-4"}`,children:[b.jsx("button",{onClick:ie,className:`${D?"px-2":"md:px-2"}`,children:"<"}),b.jsx("span",{className:`font-semibold text-center ${D?"min-w-[80px] text-sm":"min-w-[60px] text-sm md:text-md"}`,children:i(z.toUpperCase())}),b.jsx("button",{onClick:J,className:`${D?"px-2":"md:px-2"}`,children:">"})]})]}),b.jsx("div",{className:`grid grid-cols-7 gap-1 text-center ${D?"mb-2 text-sm":"mb-2 md:mb-3 md:text-md"} font-semibold`,children:se.map(B=>b.jsx("div",{children:i(B)},B))}),b.jsx("div",{className:"grid grid-cols-7 gap-1 text-center",children:L.map((B,ee)=>{const fe=B.fullDate.getDate()===c.getDate()&&B.fullDate.getMonth()===c.getMonth()&&B.fullDate.getFullYear()===c.getFullYear();return b.jsx("div",{onClick:()=>ne(B.fullDate,B.hijriObj),className:`${D?"p-1":"p-2"} rounded leading-none cursor-pointer ${fe?"font-bold":""} ${!B.currentMonth&&!fe?"opacity-90":""}`,style:{backgroundColor:fe?y?_.buttonBg:x.prayerTimesColor.text:"transparent",color:fe?y?_.buttonTextColor:x.prayerTimesColor.bg:B.currentMonth?y?_.calendarText:x.prayerTimesColor.text:y?`${_.calendarText}80`:`${x.prayerTimesColor.text}80`,lineHeight:"1"},children:o==="ar"?b.jsxs(b.Fragment,{children:[b.jsx("div",{className:"text-[14px] leading-none",children:B.hijri??""}),b.jsx("div",{className:"text-[10px] leading-none",children:B.gregorian})]}):b.jsxs(b.Fragment,{children:[b.jsx("div",{className:"text-[14px] leading-none",children:B.gregorian}),b.jsx("div",{className:"text-[10px] leading-none",children:B.hijri??""})]})},ee)})}),b.jsxs("div",{className:`mt-4 gap-4 ${t?"flex justify-between items-center":"flex justify-end items-center"}`,children:[t&&b.jsxs("div",{className:`flex-1 text-center md:ml-${D?"20":"10"} lg:ml-${D?"20":"10"}`,children:[b.jsx("h2",{className:`${D?"text-sm":"text-sm md:text-md"} font-semibold`,children:c.toLocaleDateString("en-GB",{day:"numeric",month:"long",year:"numeric"})}),b.jsx("h2",{className:`${D?"text-sm":"text-sm md:text-md"} font-semibold`,children:p?Hi({hijriDayObj:p,language:o,t:i,hijriMonthNames:g}):"-"})]}),b.jsx("button",{onClick:Q,className:`${D?"px-3 py-1 text-sm":"px-2 py-1 text-sm md:text-md"} rounded-md font-semibold`,style:{backgroundColor:y?_.buttonBg:x.prayerTimesColor.text,color:y?_.buttonTextColor:x.prayerTimesColor.bg},children:i("TODAY")})]})]})})},du=["Muharram","Safar","Rabi'ul Awwal","Rabi'ul Akhir","Jumadal Ula","Jumadal Akhira","Rajab","Sha'ban","Ramadan","Shawwal","Dhul Qa'ada","Dhul Hijja"];function Q5({nr:e,isHome:t=!0}){const{i18n:n,t:r}=Dn(),a=n.language||"en",{colorScheme:i,date:s,setDate:o,setNextHijriDay:l,periodType:u,setPeriodType:c,periodFrom:f,periodTo:p,setPeriodFrom:d,setPeriodTo:v,hijriMonthNames:S}=da(),[x,g]=C.useState(null),[y,_]=C.useState(null),[E,D]=C.useState(new Map),[R,O]=C.useState(!1),[j,$]=C.useState(!1),[V,T]=C.useState(!1),P=i.textColor,q=i.isDefault,Y=C.useRef(null),se=C.useRef(null),G=C.useRef(null),ne=C.useRef(null),Q=C.useRef(null),ie=C.useRef(null);C.useEffect(()=>{const B=ee=>{R&&Y.current&&!Y.current.contains(ee.target)&&se.current&&!se.current.contains(ee.target)&&(console.log("Clicked outside main calendar, closing..."),O(!1)),j&&G.current&&!G.current.contains(ee.target)&&Q.current&&!Q.current.contains(ee.target)&&(console.log("Clicked outside From calendar, closing..."),$(!1)),V&&ne.current&&!ne.current.contains(ee.target)&&ie.current&&!ie.current.contains(ee.target)&&(console.log("Clicked outside To calendar, closing..."),T(!1))};return document.addEventListener("mousedown",B),()=>{document.removeEventListener("mousedown",B)}},[R,j,V]),C.useEffect(()=>{if(!s)return;const B=s.getFullYear(),ee=new Date(B,0,1),fe=new Date(B,11,31),me=ee.toLocaleDateString("en-CA"),Se=fe.toLocaleDateString("en-CA");Mg(me,Se).then(we=>{D(we);const je=s.toLocaleDateString("en-CA"),Ae=we.get(je);g(Ae||null),u==="Custom"&&_(Ae||null)}).catch(we=>{console.error("Failed to fetch Hijri dates for year:",we)})},[s,u]),C.useEffect(()=>{t&&c("Daily")},[t]),C.useEffect(()=>{if(s)if(u==="Daily")d(s),v(s);else if(u==="Weekly")d(s),v(new Date(s.getTime()+6*864e5));else if(u==="Monthly"){const B=new Date(s.getFullYear(),s.getMonth(),1),ee=new Date(s.getFullYear(),s.getMonth()+1,0);d(B),v(ee)}else u==="Custom"&&(d(s),v(s))},[s,u,d,v]),C.useEffect(()=>{if(!f||!p||!E.size)return;const B=f.toLocaleDateString("en-CA"),ee=p.toLocaleDateString("en-CA"),fe=E.get(B);g(fe||null);const me=E.get(ee);if(_(me||null),u==="Daily"){const Se=new Date(f);Se.setDate(Se.getDate()+1);const we=Se.toLocaleDateString("en-CA"),je=E.get(we);l(je||null)}else l(null)},[f,p,u,E,l]);const J=(B,ee,fe=!0)=>{if(!B)return;const me=B.toLocaleDateString("en-CA"),Se=E.get(me)||ee;u==="Custom"?fe?(d(B),g(Se||null),$(!1),p&&B>p&&(v(B),_(Se||null))):(f&&B<f?(v(f),_(x),d(B),g(Se||null)):(v(B),_(Se||null)),T(!1)):(o(B),g(Se||null),O(!1))};function le(){const B=t?"text-sm sm:text-base lg:text-lg":"text-xs sm:text-sm",ee=t?"text-xs sm:text-sm lg:text-base":"text-xs sm:text-sm",fe=we=>{const je=we.toLocaleString("en-US",{month:"long"}),Ae=r(je.toUpperCase()),Me=we.getDate(),pe=we.getFullYear();return a==="ar"?`${pe} ${Ae} ${Me}`:`${Me} ${Ae} ${pe}`},me=(we,je)=>{if(!we||!je)return"Loading...";const Ae=we.toLocaleString("en-US",{month:"long"}),Me=je.toLocaleString("en-US",{month:"long"}),pe=r(Ae.toUpperCase()),X=r(Me.toUpperCase()),Ge=we.getDate(),Pe=je.getDate(),Te=we.getFullYear(),Ie=je.getFullYear();return a==="ar"?Te===Ie&&pe===X?`${Te} ${pe} ${Ge} – ${Pe}`:Te===Ie?`${Te} ${pe} ${Ge} – ${X} ${Pe}`:`${Te} ${pe} ${Ge} – ${Ie} ${X} ${Pe}`:Te===Ie&&pe===X?`${Ge} – ${Pe} ${pe} ${Te}`:Te===Ie?`${Ge} ${pe} – ${Pe} ${X} ${Te}`:`${Ge} ${pe} ${Te} – ${Pe} ${X} ${Ie}`},Se=(we,je)=>{if(!we||!je)return"-";const Ae=r(du[we.hijri_date_month-1].toUpperCase()),Me=r(du[je.hijri_date_month-1].toUpperCase()),pe=we.hijri_date_day,X=je.hijri_date_day,Ge=we.hijri_date_year,Pe=je.hijri_date_year;return a==="ar"?Ge===Pe&&Ae===Me?`${Ge} ${Ae} ${pe} – ${X}`:Ge===Pe?`${Ge} ${Ae} ${pe} – ${Me} ${X}`:`${Ge} ${Ae} ${pe} – ${Pe} ${Me} ${X}`:Ge===Pe&&Ae===Me?`${pe} – ${X} ${Ae} ${Ge}`:Ge===Pe?`${pe} ${Ae} – ${X} ${Me} ${Ge}`:`${pe} ${Ae} ${Ge} – ${X} ${Me} ${Pe}`};if(u==="Daily")return b.jsxs(b.Fragment,{children:[b.jsx("div",{className:`font-medium ${B}`,style:{color:q?"":P},children:f?fe(f):"Loading..."}),b.jsx("div",{className:`font-medium ${ee}`,style:{color:q?"":P},children:x&&S.length>0?Hi({hijriDayObj:x,language:a,t:r,hijriMonthNames:S}):"-"})]});if(u==="Weekly")return b.jsxs(b.Fragment,{children:[b.jsx("div",{className:`font-medium ${B}`,style:{color:q?"":P},children:me(f,p)}),b.jsx("div",{className:`font-medium ${ee}`,style:{color:q?"":P},children:Se(x,y)})]});if(u==="Monthly")if(a==="ar"){const we=f?`${f.getFullYear()} ${r(f.toLocaleString("en-US",{month:"long"}).toUpperCase())}`:"Loading...";let je="";if(x&&y){const Ae=r(du[x.hijri_date_month-1].toUpperCase()),Me=r(du[y.hijri_date_month-1].toUpperCase()),pe=x.hijri_date_year;je=Ae===Me?`${Ae} ${pe}`:`${Ae} – ${Me} ${pe}`}return b.jsxs(b.Fragment,{children:[b.jsx("div",{className:`font-medium ${B}`,style:{color:q?"":P},children:we}),b.jsx("div",{className:`font-medium ${ee}`,style:{color:q?"":P},children:je})]})}else{const we=f?`${r(f.toLocaleString("en-US",{month:"long"}).toUpperCase())} ${f.getFullYear()}`:"Loading...";let je="";if(x&&y){const Ae=r(du[x.hijri_date_month-1].toUpperCase()),Me=r(du[y.hijri_date_month-1].toUpperCase()),pe=x.hijri_date_year;je=Ae===Me?`${Ae} ${pe}`:`${Ae} – ${Me} ${pe}`}return b.jsxs(b.Fragment,{children:[b.jsx("div",{className:`font-medium ${B}`,style:{color:q?"":P},children:we}),b.jsx("div",{className:`font-medium ${ee}`,style:{color:q?"":P},children:je||"-"})]})}else if(u==="Custom")return b.jsxs(b.Fragment,{children:[b.jsx("div",{className:`font-medium ${B}`,style:{color:q?"":P},children:me(f,p)}),b.jsx("div",{className:`font-medium ${ee}`,style:{color:q?"":P},children:Se(x,y)})]});return null}const L=()=>{if(s)if(u==="Monthly"){const B=new Date(s);B.setMonth(B.getMonth()-1),o(B)}else if(u==="Custom"){if(f){const B=new Date(f.getTime()-864e5);d(B),o(B),p.getTime()===f.getTime()&&v(B)}}else o(new Date(s.getTime()-24*60*60*1e3))},z=()=>{if(s)if(u==="Monthly"){const B=new Date(s);B.setMonth(B.getMonth()+1),o(B)}else if(u==="Custom"){if(f){const B=new Date(f.getTime()+864e5);d(B),o(B),p.getTime()===f.getTime()&&v(B)}}else o(new Date(s.getTime()+24*60*60*1e3))},W=()=>{if(s){if(a==="ar"&&u==="Monthly"&&x){let B=x.hijri_date_month-1,ee=x.hijri_date_year;B<1&&(B=12,ee--);const fe=Math.floor(ee*.9703+622);o(new Date(fe,0,1))}else{const B=new Date(s);B.setMonth(B.getMonth()-1),o(B)}if(u==="Custom"&&f){const B=new Date(f);B.setMonth(B.getMonth()-1),d(B),p.getTime()===f.getTime()&&v(B)}}},te=()=>{if(s){if(a==="ar"&&u==="Monthly"&&x){let B=x.hijri_date_month+1,ee=x.hijri_date_year;B>12&&(B=1,ee++);const fe=Math.floor(ee*.9703+622);o(new Date(fe,0,1))}else{const B=new Date(s);B.setMonth(B.getMonth()+1),o(B)}if(u==="Custom"&&f){const B=new Date(f);B.setMonth(B.getMonth()+1),d(B),p.getTime()===f.getTime()&&v(B)}}};return b.jsxs("div",{className:`flex items-center ${u==="Custom"?"justify-between gap-4 sm:gap-6 lg:gap-10":"justify-center gap-1 sm:gap-2 lg:gap-4"}`,children:[u==="Custom"?b.jsxs("div",{className:"flex flex-col gap-2 items-center w-full sm:w-auto",children:[b.jsxs("div",{className:"flex justify-between items-center w-full gap-2",children:[b.jsx("label",{className:`font-medium ${t?"text-xs sm:text-sm lg:text-base":"text-xs sm:text-sm"}`,style:{color:q?"":P},children:r("FROM")}),b.jsxs("div",{className:"relative flex items-center",children:[b.jsx("input",{type:"date",value:f?f.toLocaleDateString("en-CA"):"",onChange:B=>{const ee=new Date(B.target.value);J(ee,void 0,!0)},className:`text-black font-medium text-center rounded p-1 ${t?"h-6 sm:h-7 lg:h-8 w-24 sm:w-28 lg:w-32 text-xs sm:text-sm lg:text-base":"h-5 sm:h-6 w-24 lg:w-26 sm:w-24 text-xs sm:text-sm"} ${e===7?"bg-white":e===8?"bg-[#F0BB78]":"bg-[#E5D0AC]"}`,style:{backgroundColor:q?"":P}}),b.jsx("button",{ref:Q,className:"ml-1 sm:ml-2 text-sm sm:text-base lg:text-lg p-1 sm:p-1.5 lg:p-2 transition","aria-label":"Open From calendar",type:"button",onClick:()=>$(!j),children:b.jsx(z1,{color:q?"":P,size:24})}),j&&b.jsx("div",{ref:G,className:"absolute bg-white border border-gray-300 shadow-md rounded-md z-10 w-60 h-64 sm:w-64 sm:h-auto",style:{top:"100%",left:0},children:b.jsx(zp,{showDate:!1,initialDate:f||s,onDateSelect:(B,ee)=>J(B,ee,!0)})})]})]}),b.jsxs("div",{className:"flex justify-between items-center w-full gap-2",children:[b.jsx("label",{className:`font-medium ${t?"text-xs sm:text-sm lg:text-base":"text-xs sm:text-sm"} ${e===7?"text-white":e===8?"text-[#543A14]":"text-[#E5D0AC]"}`,style:{color:q?"":P},children:r("TO")}),b.jsxs("div",{className:"relative flex items-center",children:[b.jsx("input",{type:"date",value:p?p.toLocaleDateString("en-CA"):"",min:f?f.toLocaleDateString("en-CA"):"",onChange:B=>{const ee=new Date(B.target.value);J(ee,void 0,!1)},className:`text-black font-medium text-center rounded p-1 ${t?"h-6 sm:h-7 lg:h-8 w-24 sm:w-28 lg:w-32 text-xs sm:text-sm lg:text-base":"h-5 sm:h-6 w-24 lg:w-26 sm:w-24 text-xs sm:text-sm"} ${e===7?"bg-white":e===8?"bg-[#F0BB78]":"bg-[#E5D0AC]"}`,style:{backgroundColor:q?"":P}}),b.jsx("button",{ref:ie,className:"ml-1 sm:ml-2 text-sm sm:text-base lg:text-lg p-1 sm:p-1.5 lg:p-2 transition","aria-label":"Open To calendar",type:"button",onClick:()=>T(!V),children:b.jsx(z1,{color:q?"":P,size:24})}),V&&b.jsx("div",{ref:ne,className:"absolute bg-white border border-gray-300 shadow-md rounded-md z-10 w-60 h-64 sm:w-64 sm:h-auto",style:{top:"100%",left:0},children:b.jsx(zp,{showDate:!1,initialDate:p||s,onDateSelect:(B,ee)=>J(B,ee,!1)})})]})]})]}):b.jsxs(b.Fragment,{children:[b.jsxs("div",{className:`flex items-center ${t?"gap-1 sm:gap-2 lg:gap-4":"gap-0.5 sm:gap-1"}`,children:[t&&b.jsx("button",{onClick:W,className:`rounded-md transition flex items-center justify-center ${t?"text-xs sm:text-sm lg:text-base w-6 sm:w-8 lg:w-10 h-6 sm:h-8 lg:h-10":"text-xs sm:text-sm w-5 sm:w-6 h-5 sm:h-6"} ${e===7?"text-[#3A7D44] bg-white hover:bg-white/80":e===8?"text-[#FFF0DC] bg-[#543A14] hover:bg-black/60":"text-[#6D2323] bg-[#E5D0AC] hover:bg-white/80"}`,style:{backgroundColor:q?"":P},"aria-label":"Previous month",type:"button",children:b.jsx(qI,{})}),b.jsx("button",{onClick:L,className:`rounded-md transition flex items-center justify-center ${t?"text-xs sm:text-sm lg:text-base w-6 sm:w-8 lg:w-10 h-6 sm:h-8 lg:h-10":"text-xs sm:text-sm w-5 sm:w-6 h-5 sm:h-6"} ${e===7?"text-[#3A7D44] bg-white hover:bg-white/80":e===8?"text-[#FFF0DC] bg-[#543A14] hover:bg-black/60":"text-[#6D2323] bg-[#E5D0AC] hover:bg-white/80"}`,style:{backgroundColor:q?"":P},"aria-label":"Previous period",type:"button",children:b.jsx(VI,{})}),b.jsx("div",{className:"flex flex-col items-center justify-center flex-1",children:le()}),b.jsx("button",{onClick:z,className:`rounded-md transition flex items-center justify-center ${t?"text-xs sm:text-sm lg:text-base w-6 sm:w-8 lg:w-10 h-6 sm:h-8 lg:h-10":"text-xs sm:text-sm w-5 sm:w-6 h-5 sm:h-6"} ${e===7?"text-[#3A7D44] bg-white hover:bg-white/80":e===8?"text-[#FFF0DC] bg-[#543A14] hover:bg-black/60":"text-[#6D2323] bg-[#E5D0AC] hover:bg-white/80"}`,style:{backgroundColor:q?"":P},"aria-label":"Next period",type:"button",children:b.jsx(YI,{})}),t&&b.jsx("button",{onClick:te,className:`rounded-md transition flex items-center justify-center ${t?"text-xs sm:text-sm lg:text-base w-6 sm:w-8 lg:w-10 h-6 sm:h-8 lg:h-10":"text-xs sm:text-sm w-5 sm:w-6 h-5 sm:h-6"} ${e===7?"text-[#3A7D44] bg-white hover:bg-white/80":e===8?"text-[#FFF0DC] bg-[#543A14] hover:bg-black/60":"text-[#6D2323] bg-[#E5D0AC] hover:bg-white/80"}`,style:{backgroundColor:q?"":P},"aria-label":"Next month",type:"button",children:b.jsx(HI,{})})]}),b.jsxs("div",{className:"relative",children:[b.jsx("button",{ref:se,className:"text-sm sm:text-base lg:text-lg p-1 sm:p-1.5 lg:p-2 transition flex items-center justify-center","aria-label":"Open calendar",type:"button",tabIndex:0,onClick:()=>O(!R),children:b.jsx(z1,{color:q?"":P,size:24})}),R&&b.jsx("div",{ref:Y,className:"absolute bg-white border border-gray-300 shadow-md rounded-md z-10 w-60 h-64 sm:w-64 sm:h-auto",style:{top:"100%",right:0},children:b.jsx(zp,{showDate:!1,initialDate:s,onDateSelect:(B,ee)=>J(B,ee,!0)})})]})]}),!t&&b.jsx("div",{className:"",children:b.jsxs("select",{value:u,className:`rounded-sm focus:outline-none ${t?"text-xs sm:text-sm lg:text-base p-1":"text-xs sm:text-sm p-0.5 sm:p-1"} text-black ${e===7?"bg-white":e===8?"bg-[#F0BB78]":"bg-[#E5D0AC]"}`,style:{color:q?"":i.bgColor,backgroundColor:q?"":P},onChange:B=>c(B.target.value),children:[b.jsx("option",{value:"Daily",children:r("DAILY")}),b.jsx("option",{value:"Weekly",children:r("WEEKLY")}),b.jsx("option",{value:"Monthly",children:r("MONTHLY")}),b.jsx("option",{value:"Custom",children:r("CUSTOM")})]})})]})}function jE(e){return lr({attr:{viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true"},child:[{tag:"path",attr:{fillRule:"evenodd",d:"M9.383 3.076A1 1 0 0110 4v12a1 1 0 01-1.707.707L4.586 13H2a1 1 0 01-1-1V8a1 1 0 011-1h2.586l3.707-3.707a1 1 0 011.09-.217zM12.293 7.293a1 1 0 011.414 0L15 8.586l1.293-1.293a1 1 0 111.414 1.414L16.414 10l1.293 1.293a1 1 0 01-1.414 1.414L15 11.414l-1.293 1.293a1 1 0 01-1.414-1.414L13.586 10l-1.293-1.293a1 1 0 010-1.414z",clipRule:"evenodd"},child:[]}]})(e)}function TE(e){return lr({attr:{viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true"},child:[{tag:"path",attr:{fillRule:"evenodd",d:"M9.383 3.076A1 1 0 0110 4v12a1 1 0 01-1.707.707L4.586 13H2a1 1 0 01-1-1V8a1 1 0 011-1h2.586l3.707-3.707a1 1 0 011.09-.217zM14.657 2.929a1 1 0 011.414 0A9.972 9.972 0 0119 10a9.972 9.972 0 01-2.929 7.071 1 1 0 01-1.414-1.414A7.971 7.971 0 0017 10c0-2.21-.894-4.208-2.343-5.657a1 1 0 010-1.414zm-2.829 2.828a1 1 0 011.415 0A5.983 5.983 0 0115 10a5.984 5.984 0 01-1.757 4.243 1 1 0 01-1.415-1.415A3.984 3.984 0 0013 10a3.983 3.983 0 00-1.172-2.828 1 1 0 010-1.415z",clipRule:"evenodd"},child:[]}]})(e)}const OE=e=>{const[t,n]=C.useState({}),[r,a]=C.useState(!0),[i,s]=C.useState(null),o=["fajr","dhuhr","asr","maghrib","isha","jumuah"],l=async()=>{a(!0),s(null);try{const{data:u,error:c}=await Ke.from("adhan_audio").select("fajr, dhuhr, asr, maghrib, isha, jumuah").eq("mosque_id",e||"982842840").maybeSingle();if(c&&c.code!=="PGRST116")throw new Error(c.message||"Failed to fetch audio sources");const f={};u&&o.forEach(p=>{const d=u[p];if(d&&typeof d=="string"){const v=d.split("/").pop()||`${p}.mp3`;f[p]={src:d,fileName:v,type:"upload",media:"audio"}}}),n(f)}catch(u){const c=u instanceof Error?u.message:"Unknown error occurred";s(c),console.error("Fetch adhan audio error:",c)}finally{a(!1)}};return C.useEffect(()=>{if(!e){a(!1);return}a(!0),l();const u=Ke.channel("adhan_audio_changes").on("postgres_changes",{event:"*",schema:"public",table:"adhan_audio",filter:`mosque_id=eq.${e}`},()=>{l()}).subscribe();return()=>{Ke.removeChannel(u)}},[e]),{audioSources:t,loading:r,error:i}};/*! js-cookie v3.0.5 | MIT */function hp(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)e[r]=n[r]}return e}var pq={read:function(e){return e[0]==='"'&&(e=e.slice(1,-1)),e.replace(/(%[\dA-F]{2})+/gi,decodeURIComponent)},write:function(e){return encodeURIComponent(e).replace(/%(2[346BF]|3[AC-F]|40|5[BDE]|60|7[BCD])/g,decodeURIComponent)}};function ny(e,t){function n(a,i,s){if(!(typeof document>"u")){s=hp({},t,s),typeof s.expires=="number"&&(s.expires=new Date(Date.now()+s.expires*864e5)),s.expires&&(s.expires=s.expires.toUTCString()),a=encodeURIComponent(a).replace(/%(2[346B]|5E|60|7C)/g,decodeURIComponent).replace(/[()]/g,escape);var o="";for(var l in s)s[l]&&(o+="; "+l,s[l]!==!0&&(o+="="+s[l].split(";")[0]));return document.cookie=a+"="+e.write(i,a)+o}}function r(a){if(!(typeof document>"u"||arguments.length&&!a)){for(var i=document.cookie?document.cookie.split("; "):[],s={},o=0;o<i.length;o++){var l=i[o].split("="),u=l.slice(1).join("=");try{var c=decodeURIComponent(l[0]);if(s[c]=e.read(u,c),a===c)break}catch{}}return a?s[a]:s}}return Object.create({set:n,get:r,remove:function(a,i){n(a,"",hp({},i,{expires:-1}))},withAttributes:function(a){return ny(this.converter,hp({},this.attributes,a))},withConverter:function(a){return ny(hp({},this.converter,a),this.attributes)}},{attributes:{value:Object.freeze(t)},converter:{value:Object.freeze(e)}})}var Ym=ny(pq,{path:"/"});const a3=e=>{const t=new Date,[n,r]=e.split(":").map(Number),a=new Date(t.getFullYear(),t.getMonth(),t.getDate(),n,r),i=(t.getTime()-a.getTime())/1e3;return i>=0&&i<=1},i3=e=>{const t=new Date,n=e.iqamah||e.adhan,[r,a]=n.split(":").map(Number),s=(new Date(t.getFullYear(),t.getMonth(),t.getDate(),r,a).getTime()-t.getTime())/1e3;if(s<=0)return"Now";const o=Math.floor(s/60),l=Math.floor(s%60);return`${o}m ${l}s`},mq=({prayerTimesColor:e})=>{const{language:t,prayerTimesWithSunrise:n,extraInfo:r,org_nr:a,nextHijriDay:i,hijriMonthNames:s}=da(),{t:o}=Dn(),{audioSources:l,loading:u,error:c}=OE(a),[f,p]=C.useState(null),[d,v]=C.useState(!1),[S,x]=C.useState(null),[g,y]=C.useState(""),[_,E]=C.useState([]),D=C.useRef(null),[R,O]=C.useState(null),[j,$]=C.useState(!1),[V,T]=C.useState(()=>{const J={},le=Ym.get("volumeStates"),L=le?JSON.parse(le):{};return n.forEach((z,W)=>{J[W]=L[W]!==void 0?L[W]:!1}),J});C.useEffect(()=>{Ym.set("volumeStates",JSON.stringify(V),{expires:365})},[V]);const P=/iphone|ipad|ipod/i.test(window.navigator.userAgent),q=()=>window.matchMedia("(display-mode: standalone)").matches||window.navigator.standalone;C.useEffect(()=>{P&&!q()&&$(!0)},[]),C.useEffect(()=>{if(P&&!q()){console.log("Skip notification request — iPhone must add to Home Screen first");return}Notification.permission==="default"&&Notification.requestPermission()},[]),C.useEffect(()=>{const J=new Date,le=new Date(J.getFullYear(),J.getMonth(),J.getDate()+1,0,0,0).getTime()-J.getTime(),L=setTimeout(()=>{E([]),console.log("Reset triggered prayers at midnight")},le);return()=>clearTimeout(L)},[]),C.useEffect(()=>{if(!d||!S)return;const J=setInterval(()=>{const le=i3(S);y(le),le==="Now"&&(v(!1),x(null),clearInterval(J))},1e3);return()=>clearInterval(J)},[d,S]),C.useEffect(()=>{if(u||c||!n)return;const J=setInterval(()=>{n.forEach((le,L)=>{const z=le.name.toLowerCase();if(le.name!=="Fajr end"&&!V[L]&&a3(le.adhan)&&R!==le.name&&!_.includes(le.name)){const W=l[z];console.log(`Attempting to play ${z} audio:`,{audioSource:W==null?void 0:W.src}),W!=null&&W.src?(D.current&&(D.current.pause(),D.current.currentTime=0),D.current=new Audio(W.src),D.current.play().catch(te=>console.error(`Error playing ${z} audio:`,te)),p(z),O(le.name),D.current.onended=()=>{p(null),O(null),D.current=null}):console.warn(`No audio source for ${z}`),E(te=>[...te,le.name])}})},1e3);return()=>clearInterval(J)},[n,l,V,R,u,c,_]),C.useEffect(()=>{if(u||c||!n)return;const J=setInterval(()=>{n.forEach(le=>{le.name!=="Fajr end"&&a3(le.adhan)&&!_.includes(le.name)&&(Notification.permission==="granted"&&(console.log(`Triggering notification for prayer: ${le.name}`),new Notification(`${o(le.name)} Iqamah Time ${le.iqamah||le.adhan} Arrive On Time`)),v(!0),x(le),y(i3(le)),E(L=>[...L,le.name]))})},1e3);return()=>clearInterval(J)},[n,u,c,_,o]);const Y=()=>{D.current&&(D.current.pause(),D.current.currentTime=0,D.current=null,p(null),O(null))},se=J=>{T(le=>({...le,[J]:!le[J]}))},G=()=>{v(!1),x(null)};function ne(J){return J?J.startsWith("linear-gradient")||J.startsWith("radial-gradient")?{backgroundImage:J,color:e.text}:{backgroundColor:J,color:e.text}:{}}const Q=ne(e.bg),ie=t==="ar";return b.jsxs("div",{className:"w-full mx-auto font-DM py-2 sm:py-4",dir:ie?"rtl":"ltr",children:[u&&b.jsx("div",{className:"p-4 text-center",children:"Loading..."}),c&&b.jsx("div",{className:"p-4 text-center text-red-600",children:c}),!u&&!c&&b.jsxs(b.Fragment,{children:[b.jsxs("div",{className:"flex justify-between text-sm sm:text-base items-center py-1 px-4",children:[b.jsx("div",{className:`${a?"w-[40%]":"w-1/2"}`}),b.jsx("div",{className:`${a?"w-1/5":"w-full"} text-center font-medium`,children:o("ADHAN")}),a&&b.jsx("div",{className:"w-1/5 text-center font-medium",children:o("JAMAAT")}),a&&b.jsxs("div",{className:"w-1/5 text-center font-medium",children:[b.jsx("span",{className:"block sm:hidden",children:o("TMRW")}),b.jsx("span",{className:"hidden sm:block",children:o("TOMORROW")})]})]}),b.jsx("div",{className:"p-[1px] rounded-lg bg-gradient-to-br from-white to-[#807E7E57]",children:b.jsxs("div",{className:"py-2 sm:px-4 rounded-lg backdrop-blur-md",style:Q,children:[n==null?void 0:n.map((J,le)=>b.jsxs(Lt.Fragment,{children:[b.jsxs("div",{className:"flex items-center justify-between px-3 py-2",children:[b.jsxs("div",{className:`${a?"w-[40%]":"w-1/2"} flex items-center justify-between`,children:[b.jsx("span",{className:"sm:text-lg font-semibold",children:J.name==="Fajr end"?b.jsx(Ud,{color:"orange",size:28}):o(J.name.toUpperCase())}),J.name!=="Fajr end"&&b.jsxs("div",{className:"flex items-center",children:[f===J.name.toLowerCase()&&b.jsx("button",{type:"button",className:"mr-2 w-6 h-6 bg-red-500 rounded-full focus:outline-none",onClick:Y}),b.jsx("button",{type:"button",className:"ml-2 focus:outline-none","aria-label":V[le]?"Mute":"Unmute",onClick:()=>se(le),children:V[le]?b.jsx(jE,{}):b.jsx(TE,{})})]})]}),b.jsx("div",{className:`${a?"w-1/5":"w-full"} sm:text-lg text-center font-semibold`,children:J.adhan}),a&&b.jsx("div",{className:"w-1/5 text-center sm:text-lg font-semibold",children:J.iqamah}),a&&b.jsx("div",{className:"w-1/5 text-center sm:text-lg font-semibold",children:J.tomorrow})]}),le===4&&b.jsx("div",{className:`text-sm font-semibold p-3 ${ie?"text-right":""}`,children:i?Hi({hijriDayObj:i,language:t,t:o,hijriMonthNames:s}):" "})]},le)),a&&b.jsxs(b.Fragment,{children:[b.jsx("div",{className:"border-b py-1 sm:py-2"}),b.jsxs("div",{className:"flex flex-col gap-4 items-center justify- shadow- rounded- px-3 py-4",children:[b.jsxs("div",{className:"flex w-full",children:[b.jsx("div",{className:"w-1/4 md:w-2/5"}),[1,2,3].map(J=>b.jsxs("div",{className:"w-1/4 md:w-1/5 text-center text-sm sm:text-base ",children:[o("JAMAAT")," ",J]},J))]}),r.filter(J=>J.label==="Eid"?Array.isArray(J.time)&&J.time.some(le=>le&&le.trim()!==""):!0).map(J=>b.jsxs("div",{className:"flex w-full",children:[b.jsx("div",{className:"w-1/4 md:w-2/5 md:text-lg font-semibold",children:o(J==null?void 0:J.label.toUpperCase())}),Array.isArray(J.time)?[0,1,2].map(le=>b.jsx("div",{className:"w-1/4 md:w-1/5 text-center text-lg font-semibold ",children:J.time[le]},le)):b.jsxs(b.Fragment,{children:[b.jsx("div",{className:"w-1/4 md:w-1/5 text-center text-lg font-semibold ",children:J.time}),b.jsx("div",{className:"w-1/4 md:w-1/5"}),b.jsx("div",{className:"w-1/4 md:w-1/5"})]})]},J==null?void 0:J.label))]})]})]})})]}),d&&S&&b.jsxs("div",{className:"fixed bottom-4 right-4 text-black text-lg bg-white p-4 rounded shadow-lg z-50",children:[b.jsxs("p",{children:[o(S.name)," Iqamah Time Within: ",g]}),b.jsx("button",{className:"mt-2 bg-blue-500 text-white px-2 py-1 rounded",onClick:G,children:"Close"})]}),j&&b.jsxs("div",{className:"fixed bottom-5 left-1/2 -translate-x-1/2 bg-white shadow-xl border p-3 rounded-lg text-center z-50 w-[90%] max-w-[400px]",children:[b.jsx("p",{className:"font-semibold mb-2",children:"To receive Adhan Notifications"}),b.jsxs("p",{className:"text-sm mb-2",children:["Please ",b.jsx("b",{children:"add this app to your Home Screen"}),"."]}),b.jsxs("p",{className:"text-xs",children:["Tap ",b.jsx("b",{children:"Share → Add to Home Screen"})]}),b.jsx("button",{className:"mt-3 px-3 py-1 text-sm rounded bg-blue-600 text-white",onClick:()=>$(!1),children:"OK"})]})]})},gq=()=>{const e=()=>new Date().toLocaleTimeString([],{hour:"2-digit",minute:"2-digit",hour12:!1}),[t,n]=C.useState(e());return C.useEffect(()=>{const r=setInterval(()=>{n(e())},1e3);return()=>clearInterval(r)},[]),b.jsx("div",{className:"w-full flex justify-center font-bold text-4xl mt-6 sm:mt-4",children:t})},s3=e=>{const t=new Date,[n,r]=e.split(":").map(Number),a=new Date(t.getFullYear(),t.getMonth(),t.getDate(),n,r),i=(t.getTime()-a.getTime())/1e3;return i>=0&&i<=1},o3=e=>{const t=new Date,n=e.iqamah||e.adhan,[r,a]=n.split(":").map(Number),s=(new Date(t.getFullYear(),t.getMonth(),t.getDate(),r,a).getTime()-t.getTime())/1e3;if(s<=0)return"Now";const o=Math.floor(s/60),l=Math.floor(s%60);return`${o}m ${l}s`},vq=({prayerTimesColor:e})=>{const{t}=Dn(),{language:n,prayerTimesWithSunrise:r,extraInfo:a,org_nr:i,nextHijriDay:s,hijriMonthNames:o}=da(),l=n==="ar",{audioSources:u,loading:c,error:f}=OE(i),[p,d]=C.useState(null),[v,S]=C.useState(!1),[x,g]=C.useState(null),[y,_]=C.useState(""),[E,D]=C.useState([]),R=C.useRef(null),[O,j]=C.useState(null),[$,V]=C.useState(!1),[T,P]=C.useState(()=>{const J={},le=Ym.get("volumeStates"),L=le?JSON.parse(le):{};return r.forEach((z,W)=>{J[W]=L[W]!==void 0?L[W]:!1}),J});C.useEffect(()=>{Ym.set("volumeStates",JSON.stringify(T),{expires:365})},[T]);const q=/iphone|ipad|ipod/i.test(window.navigator.userAgent),Y=()=>window.matchMedia("(display-mode: standalone)").matches||window.navigator.standalone;C.useEffect(()=>{q&&!Y()&&V(!0)},[]),C.useEffect(()=>{if(q&&!Y()){console.log("Skip notification request — iPhone must add to Home Screen first");return}Notification.permission==="default"&&Notification.requestPermission()},[]),C.useEffect(()=>{const J=new Date,le=new Date(J.getFullYear(),J.getMonth(),J.getDate()+1,0,0,0).getTime()-J.getTime(),L=setTimeout(()=>{D([]),console.log("Reset triggered prayers at midnight")},le);return()=>clearTimeout(L)},[]),C.useEffect(()=>{if(!v||!x)return;const J=setInterval(()=>{const le=o3(x);_(le),le==="Now"&&(S(!1),g(null),clearInterval(J))},1e3);return()=>clearInterval(J)},[v,x]),C.useEffect(()=>{if(c||f||!r)return;const J=setInterval(()=>{r.forEach((le,L)=>{const z=le.name.toLowerCase();if(le.name!=="Fajr end"&&!T[L]&&s3(le.adhan)&&O!==le.name&&!E.includes(le.name)){const W=u[z];console.log(`Attempting to play ${z} audio:`,{audioSource:W==null?void 0:W.src}),W!=null&&W.src?(R.current&&(R.current.pause(),R.current.currentTime=0,console.log(`Stopped previous audio for ${O}`)),R.current=new Audio(W.src),R.current.play().then(()=>{console.log(`Playing ${z} audio`),d(z),j(le.name),D(te=>[...te,le.name])}).catch(te=>console.error(`Error playing ${z} audio:`,te)),R.current.onended=()=>{console.log(`Audio ended for ${le.name}`),d(null),j(null),R.current=null}):(console.warn(`No audio source for ${z}`),D(te=>[...te,le.name]))}})},1e3);return()=>clearInterval(J)},[r,u,T,O,c,f,E]),C.useEffect(()=>{if(c||f||!r)return;const J=setInterval(()=>{r.forEach(le=>{le.name!=="Fajr end"&&s3(le.adhan)&&!E.includes(le.name)&&(Notification.permission==="granted"&&new Notification(`${t(le.name)} Iqamah Time ${le.iqamah||le.adhan} Arrive On Time`),S(!0),g(le),_(o3(le)),D(L=>[...L,le.name]))})},1e3);return()=>clearInterval(J)},[r,c,f,E,t]);const se=()=>{R.current&&(R.current.pause(),R.current.currentTime=0,R.current=null,d(null),j(null),console.log("Audio stopped by user"))},G=J=>{console.log(`Toggling volume for prayer index ${J}: ${!T[J]}`),P(le=>({...le,[J]:!le[J]}))},ne=()=>{S(!1),g(null),console.log("Popup closed by user")};function Q(J){return J?J.startsWith("linear-gradient")||J.startsWith("radial-gradient")?{backgroundImage:J,color:e.text}:{backgroundColor:J,color:e.text}:{}}const ie=Q(e.bg);return b.jsxs("div",{className:"min-w-[300px] mx-auto font-DM",style:{direction:l?"rtl":"ltr"},children:[c&&b.jsx("div",{className:"p-4 text-center",children:"Loading..."}),f&&b.jsx("div",{className:"p-4 text-center text-red-600",children:f}),!c&&!f&&r&&b.jsxs(b.Fragment,{children:[b.jsxs("div",{className:"flex justify-between items-center px-2 py-2",children:[b.jsx("div",{className:"w-[35%] items-center justify-between"}),b.jsx("div",{className:`${i?"w-1/5":"w-full"} text-center font-medium`,children:t("ADHAN")}),i&&b.jsx("div",{className:"w-1/5 text-center font-medium",children:t("JAMAAT")}),i&&b.jsx("div",{className:"w-1/5 text-center font-medium",children:t("TMRW")})]}),r.map((J,le)=>{var L;return b.jsxs(Lt.Fragment,{children:[b.jsxs("div",{className:"flex items-center justify-between border shadow-md rounded-xl px-3 py-4 mb-2 backdrop-blur-md",style:ie,children:[b.jsxs("div",{className:"w-[35%] flex items-center justify-between",children:[b.jsx("span",{className:"md:text-lg font-medium",children:J.name==="Fajr end"?b.jsx(Ud,{color:"orange",size:28}):t(J.name.toUpperCase())}),J.name!=="Fajr end"&&b.jsxs("div",{className:"flex items-center",children:[p===J.name.toLowerCase()&&b.jsx("button",{type:"button",className:"mr-2 w-6 h-6 bg-red-500 rounded-full focus:outline-none",onClick:se}),b.jsx("button",{type:"button",className:"focus:outline-none","aria-label":T[le]?"Mute":"Unmute",onClick:()=>G(le),children:T[le]?b.jsx(jE,{}):b.jsx(TE,{})})]})]}),b.jsx("div",{className:`${i?"w-1/5":"w-full"} text-center md:text-lg font-medium`,children:J.name==="Sunrise"?(L=a[1])==null?void 0:L.time:J.adhan}),i&&b.jsx("div",{className:"w-1/5 text-center md:text-lg font-medium",children:J.iqamah}),i&&b.jsx("div",{className:"w-1/5 text-center md:text-lg font-medium",children:J.tomorrow})]}),le===4&&b.jsx("div",{className:`m-2 text-sm font-medium ${l?"text-right":"text-left"}`,children:s&&o.length>0?Hi({hijriDayObj:s,language:n,t,hijriMonthNames:o}):" "})]},le)}),i&&b.jsxs("div",{className:"flex flex-col gap-4 border shadow-md rounded-xl px-3 py-4 mt-10 backdrop-blur-md",style:ie,children:[b.jsxs("div",{className:"flex w-full",children:[b.jsx("div",{className:`w-1/4 md:w-2/5 ${l?"text-right":"text-left"}`}),[1,2,3].map(J=>b.jsxs("div",{className:"w-1/4 md:w-1/5 text-center text-sm md:text-base",children:[t("JAMAAT")," ",J]},J))]}),a.filter(J=>J.label==="Eid"?Array.isArray(J.time)&&J.time.some(le=>le&&le.trim()!==""):!0).map(J=>b.jsxs("div",{className:"flex w-full",children:[b.jsx("div",{className:`w-1/4 md:w-2/5 md:text-lg font-medium ${l?"text-right":"text-left"}`,children:t(J.label.toUpperCase())}),Array.isArray(J.time)?[0,1,2].map(le=>b.jsx("div",{className:"w-1/4 md:w-1/5 text-center text-lg font-medium",children:J.time[le]},le)):b.jsxs(b.Fragment,{children:[b.jsx("div",{className:"w-1/4 md:w-1/5 text-center text-lg font-medium",children:J.time}),b.jsx("div",{className:"w-1/4 md:w-1/5 text-lg font-medium"}),b.jsx("div",{className:"w-1/4 md:w-1/5 text-lg font-medium"})]})]},J.label))]})]}),v&&x&&b.jsxs("div",{className:"fixed bottom-4 right-4 text-black text-lg bg-white p-4 rounded shadow-lg z-50",children:[b.jsxs("p",{children:[t(x.name)," Iqamah Time Within: ",y]}),b.jsx("button",{className:"mt-2 bg-blue-500 text-white px-2 py-1 rounded",onClick:ne,children:"Close"})]}),$&&b.jsxs("div",{className:"fixed bottom-5 left-1/2 -translate-x-1/2 bg-white shadow-xl border p-3 rounded-lg text-center z-50 w-[90%] max-w-[400px]",children:[b.jsx("p",{className:"font-semibold mb-2",children:"To receive Adhan Notifications"}),b.jsxs("p",{className:"text-sm mb-2",children:["Please ",b.jsx("b",{children:"add this app to your Home Screen"}),"."]}),b.jsxs("p",{className:"text-xs",children:["Tap ",b.jsx("b",{children:"Share → Add to Home Screen"})]}),b.jsx("button",{className:"mt-3 px-3 py-1 text-sm rounded bg-blue-600 text-white",onClick:()=>V(!1),children:"OK"})]})]})},yq={7:{container:"font-DM py-10",item:"bg-[#255F38] p-3 rounded-md min-w-[200px] text-left flex-col justify-center"},8:{container:"font-montserrat py-4 sm:py-6 w-full",item:"bg-[#F0BB78] p-3 rounded-md text-left min-w-[200px] text-xs font-medium transition",heading:"text-xl font-bold mb-2",subheading:"text-xs sm:text-sm"},9:{container:"font-onest py-4 sm:py-6 w-full hover:cursor-pointer",item:"bg-[#FEF9E1]/10 border border-white p-3 min-w-[200px] rounded-md text-xs text-white hover:bg-[#581a1a] transition",heading:"text-xl font-bold mb-2",subheading:"text-xs sm:text-sm"}},bq=({tn:e=7,prayerTimesColor:t})=>{const{i18n:n,t:r}=Dn(),a=n.language,i=fa(),{colorScheme:s,events:o,selectedMosque:l,hijriMonthNames:u}=da(),c=yq[e],f=s.isDefault,[p,d]=C.useState(new Map);return C.useEffect(()=>{if(!o||o.length===0)return;const v=o.map(D=>new Date(D.date)),S=new Date(Math.min(...v.map(D=>D.getTime()))),x=new Date(Math.max(...v.map(D=>D.getTime()))),g=new Date(S.getFullYear(),0,1),y=new Date(x.getFullYear(),11,31),_=g.toLocaleDateString("en-CA"),E=y.toLocaleDateString("en-CA");Mg(_,E).then(D=>{d(D)}).catch(D=>{console.error("Failed to fetch Hijri dates for events:",D)})},[o]),b.jsx("div",{className:c.container,onClick:()=>i(`/${(l==null?void 0:l.value)||982842840}/events`),children:b.jsxs(b.Fragment,{children:[b.jsxs("div",{className:"flex justify-between items-center mb-3",children:[b.jsx("h2",{className:"text-sm sm:text-base font-semibold sm:font-bold",children:r("EVENTS & CALENDAR").toUpperCase()}),b.jsx(wg,{className:"text-xs font-medium hover:underline",to:`/${(l==null?void 0:l.value)||982842840}/events`,children:r("SEE ALL")})]}),b.jsx("div",{className:"w-full h-24 rounded-md overflow-x-auto flex gap-4 [scrollbar-width:none] [-ms-overflow-style:none] [&::-webkit-scrollbar]:hidden",style:{color:t.text},children:o.length===0?b.jsx("div",{className:`${c.item} flex items-center justify-center h-full w-full`,style:{color:t.text,backgroundColor:f?"":t.bg},children:b.jsx("p",{className:"text-sm sm:text-base font-bold",children:"No events found"})}):o.slice(0,3).map((v,S)=>{const x=new Date(v.date);let g;if(a==="ar"){const y=x.toLocaleDateString("en-CA"),_=p.get(y);g=_?Hi({hijriDayObj:_,language:a,t:r,hijriMonthNames:u}):"Loading..."}else g=x.toLocaleDateString("en-US",{month:"long",day:"numeric"}),g=g.split(" ")[0].toUpperCase()+" "+g.split(" ")[1];return b.jsxs("div",{className:c.item,style:{color:t.text,backgroundColor:f?"":t.bg},children:[b.jsx("p",{className:"text-sm sm:text-base font-extrabold",children:g}),b.jsx("p",{className:"text-[10px] sm:text-xs font-bold mt-1 leading-tight",children:v.description})]},S)})})]})})},wq={7:{container:"font-DM",card:"bg-[#255F38] p-3 rounded-md flex flex-col justify-start h-32 relative",heading:"py-1",subheading:"text-xs sm:text-sm font-light mt-1",button:"absolute bottom-4 right-5 bg-white text-[#27391C] text-[11px] sm:text-xs px-3 py-2 rounded hover:bg-gray-100"},8:{container:"font-montserrat w-full",card:"p-6 rounded-md flex flex-col bg-[#F0BB78] justify- h-38 relative",heading:"py-1",subheading:"text-xs sm:text-sm font-light mt-1",button:"absolute bottom-4 right-5 text-[#FFFFFF] text-[11px] sm:text-xs px-3 py-2 rounded-md hover:bg-gray-"},9:{container:"font-onest hover:cursor-pointer",card:"p-4 bg-[#FEF9E1]/10 flex flex-col rounded-lg border border-white relative",heading:"",subheading:"py-5 text-xs sm:text-sm"}},xq=({tn:e,prayerTimesColor:t})=>{const n=wq[e],{t:r}=Dn(),a=fa(),{colorScheme:i,selectedMosque:s}=da(),o=i.isDefault;return b.jsx("div",{className:n.container,onClick:e===9?()=>a(`/${(s==null?void 0:s.value)||982842840}/view-timetable`):void 0,children:b.jsxs("div",{className:n.card,style:{backgroundColor:o?n.card:t.bg,color:t.text},children:[b.jsx("h2",{className:`font-bold sm:text-lg ${n.heading}`,children:r("CREATE YOUR PRAYER TIMETABLE")}),b.jsxs("div",{className:"flex items-center justify-between pr-4",children:[b.jsx("p",{className:n.subheading,children:r("VIEW AND DOWNLOAD YOUR CUSTOM PRAYER TIMETABLE")}),e===9&&b.jsx(P5,{className:"",size:50})]}),e!==9&&b.jsxs(wg,{className:n.button,to:`/${(s==null?void 0:s.value)||982842840}/view-timetable`,style:{color:o?n.button:t.bg,backgroundColor:t.text},children:[r("VIEW FULL CALENDAR")," >"]})]})})},Sq={BackgroundDiv:e=>{const{className:t,style:n}=e;return b.jsx("div",{className:t,style:n})},Header:t0,MasjidSelect:CE,DateSelector:Q5,PrayerTable:mq,MasjidPrayerClock:Fg,Time:gq,PrayerTableTab:vq,EventCard:bq,CreatePrayerTimetableCard:xq,AnnouncementBar:LN};function ry({components:e,componentProps:t={}}){return b.jsx(b.Fragment,{children:e.map((n,r)=>{var i,s;const a=Sq[n.type];if(a){const o={...n.props||{},...t};let l={};if((i=n.style)!=null&&i.backgroundImage){const u=n.style.backgroundImage,f="https://yhbphdjhoxovcxfoimdx.supabase.co/storage/v1/object/public"+u,p=n.style.backgroundRepeat,d=n.style.backgroundOpacity;l=u?{backgroundImage:`url(${f})`,backgroundSize:p?"":"cover",backgroundPosition:"center",backgroundRepeat:p?"repeat":"no-repeat",opacity:d||1,filter:p?"":"blur(8px)"}:{}}else(s=n.style)!=null&&s.backgroundColor&&(l={...n.style});return b.jsx("div",{className:n.className||"",style:l,children:b.jsx(a,{...o})},r)}else{if(n.components&&n.gridConfig)return b.jsx("div",{className:`${n.gridConfig.className||""} ${n.className||""}`,style:n.gridConfig.style,children:b.jsx(ry,{components:n.components,componentProps:t})},r);if(n.components){let o={};return n.type==="Main"&&(o={...n.style}),b.jsx("div",{className:n.className||"",style:o,children:b.jsx(ry,{components:n.components,componentProps:t})},r)}}return null})})}function _q({config:e,componentProps:t={}}){var s,o;const[n,r]=C.useState("loading"),[a,i]=C.useState(null);return C.useEffect(()=>{const l=setTimeout(()=>{n==="loading"&&(r("error"),i("No Layout configuration Found"))},5e3);return()=>clearTimeout(l)},[n]),C.useEffect(()=>{e!=null&&e.components&&e.gridConfig?(r("ready"),i(null)):e==null&&(r("error"),i("No layout configuration provided"))},[e]),n==="loading"?b.jsx("div",{className:"min-h-screen flex items-center justify-center p-8",children:b.jsxs("div",{className:"text-center max-w-md",children:[b.jsx("div",{className:"w-16 h-16 border-4 border-blue-200 border-t-blue-600 rounded-full animate-spin mx-auto mb-4"}),b.jsx("h2",{className:"text-xl font-semibold text-gray-900 mb-2",children:"Loading layout..."}),b.jsx("p",{className:"text-gray-600",children:"Preparing your dashboard"})]})}):n==="error"?b.jsx("div",{className:"min-h-screen bg-gradient-to-br from-red-50 to-orange-50 flex items-center justify-center p-8",children:b.jsxs("div",{className:"max-w-md w-full bg-white rounded-2xl shadow-2xl border border-red-100 p-8 text-center",children:[b.jsx("div",{className:"w-24 h-24 mx-auto mb-6 bg-red-100 rounded-2xl flex items-center justify-center",children:b.jsx("svg",{className:"w-12 h-12 text-red-500",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:b.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-2.5L13.732 4c-.77-.833-1.964-.833-2.732 0L3.732 16.5c-.77.833.192 2.5 1.732 2.5z"})})}),b.jsx("h2",{className:"text-2xl font-bold text-gray-900 mb-4",children:"Layout Failed"}),b.jsx("p",{className:"text-gray-600 mb-6",children:a||"Configuration is invalid or missing"}),b.jsxs("div",{className:"flex flex-col sm:flex-row gap-3 justify-center",children:[b.jsx("button",{onClick:()=>window.location.reload(),className:"px-6 py-3 bg-blue-600 text-white font-medium rounded-xl hover:bg-blue-700",children:"Reload Page"}),b.jsx("button",{onClick:()=>r("loading"),className:"px-6 py-3 bg-gray-100 text-gray-900 font-medium rounded-xl hover:bg-gray-200",children:"Retry"})]})]})}):b.jsx("div",{className:((s=e==null?void 0:e.gridConfig)==null?void 0:s.className)||"",style:(o=e==null?void 0:e.gridConfig)==null?void 0:o.style,children:b.jsx(ry,{components:(e==null?void 0:e.components)||[],componentProps:t})})}function Gd(e){const[t,n]=C.useState(null),[r,a]=C.useState(8),[i,s]=C.useState(!0);return C.useEffect(()=>{let o=null;const l=async()=>{if(s(!0),!e){try{const{data:u,error:c}=await Ke.from("layout").select("ud_theme_id, ud_layout").eq("mosque_id",982842840).single();if(c)throw c;n(u.ud_layout),a(u.ud_theme_id),await vl(`${e}-ud`,{layout:u.ud_layout,udThemeId:u.ud_theme_id})}catch(u){console.error("Error loading default layout:",u),await kv(u,{mosqueId:null,context:"default layout fallback"}),Ht("error","Could not load default theme."),n(null)}finally{s(!1)}return}if(!navigator.onLine){const u=await pc(`${e}-ud`);if(u){n(u.layout),a(u.id),s(!1);return}}try{const{data:u}=await Ke.from("layout").select("ud_theme_id, ud_layout").eq("mosque_id",e).single();if(u&&u.ud_layout)n(u.ud_layout),a(u.ud_theme_id),await vl(`${e}-ud`,{layout:u.ud_layout,id:u.ud_theme_id});else{const{data:c,error:f}=await Ke.from("mosque_t").select("organisasjonsnummer").eq("organisasjonsnummer",e).single();if(!c||f){Ht("warning","Please enter a valid org_nr!");return}if(c){const{data:p,error:d}=await Ke.from("layout").select("ud_theme_id, ud_layout").eq("mosque_id",982842840).single();if(d)throw d;const{error:v}=await Ke.from("layout").upsert([{mosque_id:e,ud_theme_id:p.ud_theme_id,ud_layout:p==null?void 0:p.ud_layout}],{onConflict:"mosque_id"}).single();if(v)throw v;n(p==null?void 0:p.ud_layout),a(p.ud_theme_id),await vl(`${e}-ud`,{layout:p.ud_layout,id:p.ud_theme_id})}}}catch(u){const c=await pc(`${e}-ud`);c?(n(c.layout),c.id&&a(c.id)):n(null),console.log("Error fetching config: ",u),await kv(u,{mosqueId:e})}finally{s(!1)}};return l(),o=Ke.channel(`ud_layout_changes:${e}`).on("postgres_changes",{event:"*",schema:"public",table:"layout",filter:`mosque_id=eq.${e}`},()=>{l()}).subscribe(),()=>{o==null||o.unsubscribe()}},[e]),{udConfig:t,udThemeId:r,loading:i}}function Aq(){const{selectedMosque:e,prayerTimes:t,prayerTimesReady:n}=da(),{org_nr:r}=Cn(),{udConfig:a,loading:i}=Gd(r||(e==null?void 0:e.value)||""),{isDefault:s,textColor:o,prayerTimesColor:l,...u}=a||{},{loading:c}=Hd(r||(e==null?void 0:e.value)||"982842840");return C.useEffect(()=>{const f=()=>{Ht("success","Back online!")},p=()=>{Ht("warning","You are offline!")};return window.addEventListener("online",f),window.addEventListener("offline",p),()=>{window.removeEventListener("online",f),window.removeEventListener("offline",p)}},[]),i||c||!n?b.jsx("div",{className:"h-screen flex items-center justify-center",children:b.jsx(hc,{})}):b.jsx(_q,{config:u,componentProps:{isDefault:s,textColor:o,prayerTimesColor:l,prayerTimes:t}})}function l3(){const{org_nr:e,loc_id:t}=Cn();return b.jsx(DN,{org_nr:e,loc_id:t,children:b.jsx(Aq,{})})}const Nq=()=>b.jsxs("div",{className:"h-screen flex flex-col items-center justify-center text-center px-4",children:[b.jsx("h1",{className:"text-4xl font-bold text-red-600",children:"404 - Page Not Found"}),b.jsx("p",{className:"mt-4 text-lg text-gray-600",children:"Sorry, the page you are looking for does not exist."})]}),Eq=()=>{const{org_nr:e,loc_id:t}=Cn();return b.jsx(DN,{org_nr:e,loc_id:t,children:b.jsx(E7,{})})};var kr=Uint8Array,Ea=Uint16Array,Z5=Int32Array,n0=new kr([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0]),r0=new kr([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0]),ay=new kr([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),DE=function(e,t){for(var n=new Ea(31),r=0;r<31;++r)n[r]=t+=1<<e[r-1];for(var a=new Z5(n[30]),r=1;r<30;++r)for(var i=n[r];i<n[r+1];++i)a[i]=i-n[r]<<5|r;return{b:n,r:a}},RE=DE(n0,2),ME=RE.b,iy=RE.r;ME[28]=258,iy[258]=28;var kE=DE(r0,0),Cq=kE.b,u3=kE.r,sy=new Ea(32768);for(var An=0;An<32768;++An){var eo=(An&43690)>>1|(An&21845)<<1;eo=(eo&52428)>>2|(eo&13107)<<2,eo=(eo&61680)>>4|(eo&3855)<<4,sy[An]=((eo&65280)>>8|(eo&255)<<8)>>1}var Ui=function(e,t,n){for(var r=e.length,a=0,i=new Ea(t);a<r;++a)e[a]&&++i[e[a]-1];var s=new Ea(t);for(a=1;a<t;++a)s[a]=s[a-1]+i[a-1]<<1;var o;if(n){o=new Ea(1<<t);var l=15-t;for(a=0;a<r;++a)if(e[a])for(var u=a<<4|e[a],c=t-e[a],f=s[e[a]-1]++<<c,p=f|(1<<c)-1;f<=p;++f)o[sy[f]>>l]=u}else for(o=new Ea(r),a=0;a<r;++a)e[a]&&(o[a]=sy[s[e[a]-1]++]>>15-e[a]);return o},Po=new kr(288);for(var An=0;An<144;++An)Po[An]=8;for(var An=144;An<256;++An)Po[An]=9;for(var An=256;An<280;++An)Po[An]=7;for(var An=280;An<288;++An)Po[An]=8;var _d=new kr(32);for(var An=0;An<32;++An)_d[An]=5;var Lq=Ui(Po,9,0),jq=Ui(Po,9,1),Tq=Ui(_d,5,0),Oq=Ui(_d,5,1),K1=function(e){for(var t=e[0],n=1;n<e.length;++n)e[n]>t&&(t=e[n]);return t},pi=function(e,t,n){var r=t/8|0;return(e[r]|e[r+1]<<8)>>(t&7)&n},X1=function(e,t){var n=t/8|0;return(e[n]|e[n+1]<<8|e[n+2]<<16)>>(t&7)},eb=function(e){return(e+7)/8|0},PE=function(e,t,n){return(n==null||n>e.length)&&(n=e.length),new kr(e.subarray(t,n))},Dq=["unexpected EOF","invalid block type","invalid length/literal","invalid distance","stream finished","no stream handler",,"no callback","invalid UTF-8 data","extra field too long","date not in range 1980-2099","filename too long","stream finishing","invalid zip data"],gi=function(e,t,n){var r=new Error(t||Dq[e]);if(r.code=e,Error.captureStackTrace&&Error.captureStackTrace(r,gi),!n)throw r;return r},Rq=function(e,t,n,r){var a=e.length,i=0;if(!a||t.f&&!t.l)return n||new kr(0);var s=!n,o=s||t.i!=2,l=t.i;s&&(n=new kr(a*3));var u=function(we){var je=n.length;if(we>je){var Ae=new kr(Math.max(je*2,we));Ae.set(n),n=Ae}},c=t.f||0,f=t.p||0,p=t.b||0,d=t.l,v=t.d,S=t.m,x=t.n,g=a*8;do{if(!d){c=pi(e,f,1);var y=pi(e,f+1,3);if(f+=3,y)if(y==1)d=jq,v=Oq,S=9,x=5;else if(y==2){var R=pi(e,f,31)+257,O=pi(e,f+10,15)+4,j=R+pi(e,f+5,31)+1;f+=14;for(var $=new kr(j),V=new kr(19),T=0;T<O;++T)V[ay[T]]=pi(e,f+T*3,7);f+=O*3;for(var P=K1(V),q=(1<<P)-1,Y=Ui(V,P,1),T=0;T<j;){var se=Y[pi(e,f,q)];f+=se&15;var _=se>>4;if(_<16)$[T++]=_;else{var G=0,ne=0;for(_==16?(ne=3+pi(e,f,3),f+=2,G=$[T-1]):_==17?(ne=3+pi(e,f,7),f+=3):_==18&&(ne=11+pi(e,f,127),f+=7);ne--;)$[T++]=G}}var Q=$.subarray(0,R),ie=$.subarray(R);S=K1(Q),x=K1(ie),d=Ui(Q,S,1),v=Ui(ie,x,1)}else gi(1);else{var _=eb(f)+4,E=e[_-4]|e[_-3]<<8,D=_+E;if(D>a){l&&gi(0);break}o&&u(p+E),n.set(e.subarray(_,D),p),t.b=p+=E,t.p=f=D*8,t.f=c;continue}if(f>g){l&&gi(0);break}}o&&u(p+131072);for(var J=(1<<S)-1,le=(1<<x)-1,L=f;;L=f){var G=d[X1(e,f)&J],z=G>>4;if(f+=G&15,f>g){l&&gi(0);break}if(G||gi(2),z<256)n[p++]=z;else if(z==256){L=f,d=null;break}else{var W=z-254;if(z>264){var T=z-257,te=n0[T];W=pi(e,f,(1<<te)-1)+ME[T],f+=te}var B=v[X1(e,f)&le],ee=B>>4;B||gi(3),f+=B&15;var ie=Cq[ee];if(ee>3){var te=r0[ee];ie+=X1(e,f)&(1<<te)-1,f+=te}if(f>g){l&&gi(0);break}o&&u(p+131072);var fe=p+W;if(p<ie){var me=i-ie,Se=Math.min(ie,fe);for(me+p<0&&gi(3);p<Se;++p)n[p]=r[me+p]}for(;p<fe;++p)n[p]=n[p-ie]}}t.l=d,t.p=L,t.b=p,t.f=c,d&&(c=1,t.m=S,t.d=v,t.n=x)}while(!c);return p!=n.length&&s?PE(n,0,p):n.subarray(0,p)},ls=function(e,t,n){n<<=t&7;var r=t/8|0;e[r]|=n,e[r+1]|=n>>8},bf=function(e,t,n){n<<=t&7;var r=t/8|0;e[r]|=n,e[r+1]|=n>>8,e[r+2]|=n>>16},Q1=function(e,t){for(var n=[],r=0;r<e.length;++r)e[r]&&n.push({s:r,f:e[r]});var a=n.length,i=n.slice();if(!a)return{t:FE,l:0};if(a==1){var s=new kr(n[0].s+1);return s[n[0].s]=1,{t:s,l:1}}n.sort(function(D,R){return D.f-R.f}),n.push({s:-1,f:25001});var o=n[0],l=n[1],u=0,c=1,f=2;for(n[0]={s:-1,f:o.f+l.f,l:o,r:l};c!=a-1;)o=n[n[u].f<n[f].f?u++:f++],l=n[u!=c&&n[u].f<n[f].f?u++:f++],n[c++]={s:-1,f:o.f+l.f,l:o,r:l};for(var p=i[0].s,r=1;r<a;++r)i[r].s>p&&(p=i[r].s);var d=new Ea(p+1),v=oy(n[c-1],d,0);if(v>t){var r=0,S=0,x=v-t,g=1<<x;for(i.sort(function(R,O){return d[O.s]-d[R.s]||R.f-O.f});r<a;++r){var y=i[r].s;if(d[y]>t)S+=g-(1<<v-d[y]),d[y]=t;else break}for(S>>=x;S>0;){var _=i[r].s;d[_]<t?S-=1<<t-d[_]++-1:++r}for(;r>=0&&S;--r){var E=i[r].s;d[E]==t&&(--d[E],++S)}v=t}return{t:new kr(d),l:v}},oy=function(e,t,n){return e.s==-1?Math.max(oy(e.l,t,n+1),oy(e.r,t,n+1)):t[e.s]=n},c3=function(e){for(var t=e.length;t&&!e[--t];);for(var n=new Ea(++t),r=0,a=e[0],i=1,s=function(l){n[r++]=l},o=1;o<=t;++o)if(e[o]==a&&o!=t)++i;else{if(!a&&i>2){for(;i>138;i-=138)s(32754);i>2&&(s(i>10?i-11<<5|28690:i-3<<5|12305),i=0)}else if(i>3){for(s(a),--i;i>6;i-=6)s(8304);i>2&&(s(i-3<<5|8208),i=0)}for(;i--;)s(a);i=1,a=e[o]}return{c:n.subarray(0,r),n:t}},wf=function(e,t){for(var n=0,r=0;r<t.length;++r)n+=e[r]*t[r];return n},IE=function(e,t,n){var r=n.length,a=eb(t+2);e[a]=r&255,e[a+1]=r>>8,e[a+2]=e[a]^255,e[a+3]=e[a+1]^255;for(var i=0;i<r;++i)e[a+i+4]=n[i];return(a+4+r)*8},f3=function(e,t,n,r,a,i,s,o,l,u,c){ls(t,c++,n),++a[256];for(var f=Q1(a,15),p=f.t,d=f.l,v=Q1(i,15),S=v.t,x=v.l,g=c3(p),y=g.c,_=g.n,E=c3(S),D=E.c,R=E.n,O=new Ea(19),j=0;j<y.length;++j)++O[y[j]&31];for(var j=0;j<D.length;++j)++O[D[j]&31];for(var $=Q1(O,7),V=$.t,T=$.l,P=19;P>4&&!V[ay[P-1]];--P);var q=u+5<<3,Y=wf(a,Po)+wf(i,_d)+s,se=wf(a,p)+wf(i,S)+s+14+3*P+wf(O,V)+2*O[16]+3*O[17]+7*O[18];if(l>=0&&q<=Y&&q<=se)return IE(t,c,e.subarray(l,l+u));var G,ne,Q,ie;if(ls(t,c,1+(se<Y)),c+=2,se<Y){G=Ui(p,d,0),ne=p,Q=Ui(S,x,0),ie=S;var J=Ui(V,T,0);ls(t,c,_-257),ls(t,c+5,R-1),ls(t,c+10,P-4),c+=14;for(var j=0;j<P;++j)ls(t,c+3*j,V[ay[j]]);c+=3*P;for(var le=[y,D],L=0;L<2;++L)for(var z=le[L],j=0;j<z.length;++j){var W=z[j]&31;ls(t,c,J[W]),c+=V[W],W>15&&(ls(t,c,z[j]>>5&127),c+=z[j]>>12)}}else G=Lq,ne=Po,Q=Tq,ie=_d;for(var j=0;j<o;++j){var te=r[j];if(te>255){var W=te>>18&31;bf(t,c,G[W+257]),c+=ne[W+257],W>7&&(ls(t,c,te>>23&31),c+=n0[W]);var B=te&31;bf(t,c,Q[B]),c+=ie[B],B>3&&(bf(t,c,te>>5&8191),c+=r0[B])}else bf(t,c,G[te]),c+=ne[te]}return bf(t,c,G[256]),c+ne[256]},Mq=new Z5([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),FE=new kr(0),kq=function(e,t,n,r,a,i){var s=i.z||e.length,o=new kr(r+s+5*(1+Math.ceil(s/7e3))+a),l=o.subarray(r,o.length-a),u=i.l,c=(i.r||0)&7;if(t){c&&(l[0]=i.r>>3);for(var f=Mq[t-1],p=f>>13,d=f&8191,v=(1<<n)-1,S=i.p||new Ea(32768),x=i.h||new Ea(v+1),g=Math.ceil(n/3),y=2*g,_=function(Me){return(e[Me]^e[Me+1]<<g^e[Me+2]<<y)&v},E=new Z5(25e3),D=new Ea(288),R=new Ea(32),O=0,j=0,$=i.i||0,V=0,T=i.w||0,P=0;$+2<s;++$){var q=_($),Y=$&32767,se=x[q];if(S[Y]=se,x[q]=Y,T<=$){var G=s-$;if((O>7e3||V>24576)&&(G>423||!u)){c=f3(e,l,0,E,D,R,j,V,P,$-P,c),V=O=j=0,P=$;for(var ne=0;ne<286;++ne)D[ne]=0;for(var ne=0;ne<30;++ne)R[ne]=0}var Q=2,ie=0,J=d,le=Y-se&32767;if(G>2&&q==_($-le))for(var L=Math.min(p,G)-1,z=Math.min(32767,$),W=Math.min(258,G);le<=z&&--J&&Y!=se;){if(e[$+Q]==e[$+Q-le]){for(var te=0;te<W&&e[$+te]==e[$+te-le];++te);if(te>Q){if(Q=te,ie=le,te>L)break;for(var B=Math.min(le,te-2),ee=0,ne=0;ne<B;++ne){var fe=$-le+ne&32767,me=S[fe],Se=fe-me&32767;Se>ee&&(ee=Se,se=fe)}}}Y=se,se=S[Y],le+=Y-se&32767}if(ie){E[V++]=268435456|iy[Q]<<18|u3[ie];var we=iy[Q]&31,je=u3[ie]&31;j+=n0[we]+r0[je],++D[257+we],++R[je],T=$+Q,++O}else E[V++]=e[$],++D[e[$]]}}for($=Math.max($,T);$<s;++$)E[V++]=e[$],++D[e[$]];c=f3(e,l,u,E,D,R,j,V,P,$-P,c),u||(i.r=c&7|l[c/8|0]<<3,c-=7,i.h=x,i.p=S,i.i=$,i.w=T)}else{for(var $=i.w||0;$<s+u;$+=65535){var Ae=$+65535;Ae>=s&&(l[c/8|0]=u,Ae=s),c=IE(l,c+1,e.subarray($,Ae))}i.i=s}return PE(o,0,r+eb(c)+a)},BE=function(){var e=1,t=0;return{p:function(n){for(var r=e,a=t,i=n.length|0,s=0;s!=i;){for(var o=Math.min(s+2655,i);s<o;++s)a+=r+=n[s];r=(r&65535)+15*(r>>16),a=(a&65535)+15*(a>>16)}e=r,t=a},d:function(){return e%=65521,t%=65521,(e&255)<<24|(e&65280)<<8|(t&255)<<8|t>>8}}},Pq=function(e,t,n,r,a){if(!a&&(a={l:1},t.dictionary)){var i=t.dictionary.subarray(-32768),s=new kr(i.length+e.length);s.set(i),s.set(e,i.length),e=s,a.w=i.length}return kq(e,t.level==null?6:t.level,t.mem==null?a.l?Math.ceil(Math.max(8,Math.min(13,Math.log(e.length)))*1.5):20:12+t.mem,n,r,a)},$E=function(e,t,n){for(;n;++t)e[t]=n,n>>>=8},Iq=function(e,t){var n=t.level,r=n==0?0:n<6?1:n==9?3:2;if(e[0]=120,e[1]=r<<6|(t.dictionary&&32),e[1]|=31-(e[0]<<8|e[1])%31,t.dictionary){var a=BE();a.p(t.dictionary),$E(e,2,a.d())}},Fq=function(e,t){return((e[0]&15)!=8||e[0]>>4>7||(e[0]<<8|e[1])%31)&&gi(6,"invalid zlib data"),(e[1]>>5&1)==1&&gi(6,"invalid zlib data: "+(e[1]&32?"need":"unexpected")+" dictionary"),(e[1]>>3&4)+2};function ly(e,t){t||(t={});var n=BE();n.p(e);var r=Pq(e,t,t.dictionary?6:2,4);return Iq(r,t),$E(r,r.length-4,n.d()),r}function Bq(e,t){return Rq(e.subarray(Fq(e),-4),{i:2},t,t)}var $q=typeof TextDecoder<"u"&&new TextDecoder,Uq=0;try{$q.decode(FE,{stream:!0}),Uq=1}catch{}var ct=function(){return typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:this}();function Z1(){ct.console&&typeof ct.console.log=="function"&&ct.console.log.apply(ct.console,arguments)}var fn={log:Z1,warn:function(e){ct.console&&(typeof ct.console.warn=="function"?ct.console.warn.apply(ct.console,arguments):Z1.call(null,arguments))},error:function(e){ct.console&&(typeof ct.console.error=="function"?ct.console.error.apply(ct.console,arguments):Z1(e))}};function e2(e,t,n){var r=new XMLHttpRequest;r.open("GET",e),r.responseType="blob",r.onload=function(){il(r.response,t,n)},r.onerror=function(){fn.error("could not download file")},r.send()}function d3(e){var t=new XMLHttpRequest;t.open("HEAD",e,!1);try{t.send()}catch{}return t.status>=200&&t.status<=299}function pp(e){try{e.dispatchEvent(new MouseEvent("click"))}catch{var t=document.createEvent("MouseEvents");t.initMouseEvent("click",!0,!0,window,0,0,0,80,20,!1,!1,!1,!1,0,null),e.dispatchEvent(t)}}var Gf,uy,il=ct.saveAs||((typeof window>"u"?"undefined":Ut(window))!=="object"||window!==ct?function(){}:typeof HTMLAnchorElement<"u"&&"download"in HTMLAnchorElement.prototype?function(e,t,n){var r=ct.URL||ct.webkitURL,a=document.createElement("a");t=t||e.name||"download",a.download=t,a.rel="noopener",typeof e=="string"?(a.href=e,a.origin!==location.origin?d3(a.href)?e2(e,t,n):pp(a,a.target="_blank"):pp(a)):(a.href=r.createObjectURL(e),setTimeout(function(){r.revokeObjectURL(a.href)},4e4),setTimeout(function(){pp(a)},0))}:"msSaveOrOpenBlob"in navigator?function(e,t,n){if(t=t||e.name||"download",typeof e=="string")if(d3(e))e2(e,t,n);else{var r=document.createElement("a");r.href=e,r.target="_blank",setTimeout(function(){pp(r)})}else navigator.msSaveOrOpenBlob(function(a,i){return i===void 0?i={autoBom:!1}:Ut(i)!=="object"&&(fn.warn("Deprecated: Expected third argument to be a object"),i={autoBom:!i}),i.autoBom&&/^\s*(?:text\/\S*|application\/xml|\S*\/\S*\+xml)\s*;.*charset\s*=\s*utf-8/i.test(a.type)?new Blob(["\uFEFF",a],{type:a.type}):a}(e,n),t)}:function(e,t,n,r){if((r=r||open("","_blank"))&&(r.document.title=r.document.body.innerText="downloading..."),typeof e=="string")return e2(e,t,n);var a=e.type==="application/octet-stream",i=/constructor/i.test(ct.HTMLElement)||ct.safari,s=/CriOS\/[\d]+/.test(navigator.userAgent);if((s||a&&i)&&(typeof FileReader>"u"?"undefined":Ut(FileReader))==="object"){var o=new FileReader;o.onloadend=function(){var c=o.result;c=s?c:c.replace(/^data:[^;]*;/,"data:attachment/file;"),r?r.location.href=c:location=c,r=null},o.readAsDataURL(e)}else{var l=ct.URL||ct.webkitURL,u=l.createObjectURL(e);r?r.location=u:location.href=u,r=null,setTimeout(function(){l.revokeObjectURL(u)},4e4)}});/**
165
+ * A class to parse color values
166
+ * @author Stoyan Stefanov <sstoo@gmail.com>
167
+ * {@link http://www.phpied.com/rgb-color-parser-in-javascript/}
168
+ * @license Use it if you like it
169
+ */function UE(e){var t;e=e||"",this.ok=!1,e.charAt(0)=="#"&&(e=e.substr(1,6)),e={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",darkkhaki:"bdb76b",darkmagenta:"8b008b",darkolivegreen:"556b2f",darkorange:"ff8c00",darkorchid:"9932cc",darkred:"8b0000",darksalmon:"e9967a",darkseagreen:"8fbc8f",darkslateblue:"483d8b",darkslategray:"2f4f4f",darkturquoise:"00ced1",darkviolet:"9400d3",deeppink:"ff1493",deepskyblue:"00bfff",dimgray:"696969",dodgerblue:"1e90ff",feldspar:"d19275",firebrick:"b22222",floralwhite:"fffaf0",forestgreen:"228b22",fuchsia:"ff00ff",gainsboro:"dcdcdc",ghostwhite:"f8f8ff",gold:"ffd700",goldenrod:"daa520",gray:"808080",green:"008000",greenyellow:"adff2f",honeydew:"f0fff0",hotpink:"ff69b4",indianred:"cd5c5c",indigo:"4b0082",ivory:"fffff0",khaki:"f0e68c",lavender:"e6e6fa",lavenderblush:"fff0f5",lawngreen:"7cfc00",lemonchiffon:"fffacd",lightblue:"add8e6",lightcoral:"f08080",lightcyan:"e0ffff",lightgoldenrodyellow:"fafad2",lightgrey:"d3d3d3",lightgreen:"90ee90",lightpink:"ffb6c1",lightsalmon:"ffa07a",lightseagreen:"20b2aa",lightskyblue:"87cefa",lightslateblue:"8470ff",lightslategray:"778899",lightsteelblue:"b0c4de",lightyellow:"ffffe0",lime:"00ff00",limegreen:"32cd32",linen:"faf0e6",magenta:"ff00ff",maroon:"800000",mediumaquamarine:"66cdaa",mediumblue:"0000cd",mediumorchid:"ba55d3",mediumpurple:"9370d8",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:"d87093",papayawhip:"ffefd5",peachpuff:"ffdab9",peru:"cd853f",pink:"ffc0cb",plum:"dda0dd",powderblue:"b0e0e6",purple:"800080",red:"ff0000",rosybrown:"bc8f8f",royalblue:"4169e1",saddlebrown:"8b4513",salmon:"fa8072",sandybrown:"f4a460",seagreen:"2e8b57",seashell:"fff5ee",sienna:"a0522d",silver:"c0c0c0",skyblue:"87ceeb",slateblue:"6a5acd",slategray:"708090",snow:"fffafa",springgreen:"00ff7f",steelblue:"4682b4",tan:"d2b48c",teal:"008080",thistle:"d8bfd8",tomato:"ff6347",turquoise:"40e0d0",violet:"ee82ee",violetred:"d02090",wheat:"f5deb3",white:"ffffff",whitesmoke:"f5f5f5",yellow:"ffff00",yellowgreen:"9acd32"}[e=(e=e.replace(/ /g,"")).toLowerCase()]||e;for(var n=[{re:/^rgb\((\d{1,3}),\s*(\d{1,3}),\s*(\d{1,3})\)$/,example:["rgb(123, 234, 45)","rgb(255,234,245)"],process:function(o){return[parseInt(o[1]),parseInt(o[2]),parseInt(o[3])]}},{re:/^(\w{2})(\w{2})(\w{2})$/,example:["#00ff00","336699"],process:function(o){return[parseInt(o[1],16),parseInt(o[2],16),parseInt(o[3],16)]}},{re:/^(\w{1})(\w{1})(\w{1})$/,example:["#fb0","f0f"],process:function(o){return[parseInt(o[1]+o[1],16),parseInt(o[2]+o[2],16),parseInt(o[3]+o[3],16)]}}],r=0;r<n.length;r++){var a=n[r].re,i=n[r].process,s=a.exec(e);s&&(t=i(s),this.r=t[0],this.g=t[1],this.b=t[2],this.ok=!0)}this.r=this.r<0||isNaN(this.r)?0:this.r>255?255:this.r,this.g=this.g<0||isNaN(this.g)?0:this.g>255?255:this.g,this.b=this.b<0||isNaN(this.b)?0:this.b>255?255:this.b,this.toRGB=function(){return"rgb("+this.r+", "+this.g+", "+this.b+")"},this.toHex=function(){var o=this.r.toString(16),l=this.g.toString(16),u=this.b.toString(16);return o.length==1&&(o="0"+o),l.length==1&&(l="0"+l),u.length==1&&(u="0"+u),"#"+o+l+u}}/**
170
+ * @license
171
+ * Joseph Myers does not specify a particular license for his work.
172
+ *
173
+ * Author: Joseph Myers
174
+ * Accessed from: http://www.myersdaily.org/joseph/javascript/md5.js
175
+ *
176
+ * Modified by: Owen Leong
177
+ */function t2(e,t){var n=e[0],r=e[1],a=e[2],i=e[3];n=Tr(n,r,a,i,t[0],7,-680876936),i=Tr(i,n,r,a,t[1],12,-389564586),a=Tr(a,i,n,r,t[2],17,606105819),r=Tr(r,a,i,n,t[3],22,-1044525330),n=Tr(n,r,a,i,t[4],7,-176418897),i=Tr(i,n,r,a,t[5],12,1200080426),a=Tr(a,i,n,r,t[6],17,-1473231341),r=Tr(r,a,i,n,t[7],22,-45705983),n=Tr(n,r,a,i,t[8],7,1770035416),i=Tr(i,n,r,a,t[9],12,-1958414417),a=Tr(a,i,n,r,t[10],17,-42063),r=Tr(r,a,i,n,t[11],22,-1990404162),n=Tr(n,r,a,i,t[12],7,1804603682),i=Tr(i,n,r,a,t[13],12,-40341101),a=Tr(a,i,n,r,t[14],17,-1502002290),n=Or(n,r=Tr(r,a,i,n,t[15],22,1236535329),a,i,t[1],5,-165796510),i=Or(i,n,r,a,t[6],9,-1069501632),a=Or(a,i,n,r,t[11],14,643717713),r=Or(r,a,i,n,t[0],20,-373897302),n=Or(n,r,a,i,t[5],5,-701558691),i=Or(i,n,r,a,t[10],9,38016083),a=Or(a,i,n,r,t[15],14,-660478335),r=Or(r,a,i,n,t[4],20,-405537848),n=Or(n,r,a,i,t[9],5,568446438),i=Or(i,n,r,a,t[14],9,-1019803690),a=Or(a,i,n,r,t[3],14,-187363961),r=Or(r,a,i,n,t[8],20,1163531501),n=Or(n,r,a,i,t[13],5,-1444681467),i=Or(i,n,r,a,t[2],9,-51403784),a=Or(a,i,n,r,t[7],14,1735328473),n=Dr(n,r=Or(r,a,i,n,t[12],20,-1926607734),a,i,t[5],4,-378558),i=Dr(i,n,r,a,t[8],11,-2022574463),a=Dr(a,i,n,r,t[11],16,1839030562),r=Dr(r,a,i,n,t[14],23,-35309556),n=Dr(n,r,a,i,t[1],4,-1530992060),i=Dr(i,n,r,a,t[4],11,1272893353),a=Dr(a,i,n,r,t[7],16,-155497632),r=Dr(r,a,i,n,t[10],23,-1094730640),n=Dr(n,r,a,i,t[13],4,681279174),i=Dr(i,n,r,a,t[0],11,-358537222),a=Dr(a,i,n,r,t[3],16,-722521979),r=Dr(r,a,i,n,t[6],23,76029189),n=Dr(n,r,a,i,t[9],4,-640364487),i=Dr(i,n,r,a,t[12],11,-421815835),a=Dr(a,i,n,r,t[15],16,530742520),n=Rr(n,r=Dr(r,a,i,n,t[2],23,-995338651),a,i,t[0],6,-198630844),i=Rr(i,n,r,a,t[7],10,1126891415),a=Rr(a,i,n,r,t[14],15,-1416354905),r=Rr(r,a,i,n,t[5],21,-57434055),n=Rr(n,r,a,i,t[12],6,1700485571),i=Rr(i,n,r,a,t[3],10,-1894986606),a=Rr(a,i,n,r,t[10],15,-1051523),r=Rr(r,a,i,n,t[1],21,-2054922799),n=Rr(n,r,a,i,t[8],6,1873313359),i=Rr(i,n,r,a,t[15],10,-30611744),a=Rr(a,i,n,r,t[6],15,-1560198380),r=Rr(r,a,i,n,t[13],21,1309151649),n=Rr(n,r,a,i,t[4],6,-145523070),i=Rr(i,n,r,a,t[11],10,-1120210379),a=Rr(a,i,n,r,t[2],15,718787259),r=Rr(r,a,i,n,t[9],21,-343485551),e[0]=xo(n,e[0]),e[1]=xo(r,e[1]),e[2]=xo(a,e[2]),e[3]=xo(i,e[3])}function a0(e,t,n,r,a,i){return t=xo(xo(t,e),xo(r,i)),xo(t<<a|t>>>32-a,n)}function Tr(e,t,n,r,a,i,s){return a0(t&n|~t&r,e,t,a,i,s)}function Or(e,t,n,r,a,i,s){return a0(t&r|n&~r,e,t,a,i,s)}function Dr(e,t,n,r,a,i,s){return a0(t^n^r,e,t,a,i,s)}function Rr(e,t,n,r,a,i,s){return a0(n^(t|~r),e,t,a,i,s)}function zE(e){var t,n=e.length,r=[1732584193,-271733879,-1732584194,271733878];for(t=64;t<=e.length;t+=64)t2(r,zq(e.substring(t-64,t)));e=e.substring(t-64);var a=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];for(t=0;t<e.length;t++)a[t>>2]|=e.charCodeAt(t)<<(t%4<<3);if(a[t>>2]|=128<<(t%4<<3),t>55)for(t2(r,a),t=0;t<16;t++)a[t]=0;return a[14]=8*n,t2(r,a),r}function zq(e){var t,n=[];for(t=0;t<64;t+=4)n[t>>2]=e.charCodeAt(t)+(e.charCodeAt(t+1)<<8)+(e.charCodeAt(t+2)<<16)+(e.charCodeAt(t+3)<<24);return n}Gf=ct.atob.bind(ct),uy=ct.btoa.bind(ct);var h3="0123456789abcdef".split("");function qq(e){for(var t="",n=0;n<4;n++)t+=h3[e>>8*n+4&15]+h3[e>>8*n&15];return t}function Hq(e){return String.fromCharCode((255&e)>>0,(65280&e)>>8,(16711680&e)>>16,(4278190080&e)>>24)}function cy(e){return zE(e).map(Hq).join("")}var Vq=function(e){for(var t=0;t<e.length;t++)e[t]=qq(e[t]);return e.join("")}(zE("hello"))!="5d41402abc4b2a76b9719d911017c592";function xo(e,t){if(Vq){var n=(65535&e)+(65535&t);return(e>>16)+(t>>16)+(n>>16)<<16|65535&n}return e+t&4294967295}/**
178
+ * @license
179
+ * FPDF is released under a permissive license: there is no usage restriction.
180
+ * You may embed it freely in your application (commercial or not), with or
181
+ * without modifications.
182
+ *
183
+ * Reference: http://www.fpdf.org/en/script/script37.php
184
+ */function fy(e,t){var n,r,a,i;if(e!==n){for(var s=(a=e,i=1+(256/e.length>>0),new Array(i+1).join(a)),o=[],l=0;l<256;l++)o[l]=l;var u=0;for(l=0;l<256;l++){var c=o[l];u=(u+c+s.charCodeAt(l))%256,o[l]=o[u],o[u]=c}n=e,r=o}else o=r;var f=t.length,p=0,d=0,v="";for(l=0;l<f;l++)d=(d+(c=o[p=(p+1)%256]))%256,o[p]=o[d],o[d]=c,s=o[(o[p]+o[d])%256],v+=String.fromCharCode(t.charCodeAt(l)^s);return v}/**
185
+ * @license
186
+ * Licensed under the MIT License.
187
+ * http://opensource.org/licenses/mit-license
188
+ * Author: Owen Leong (@owenl131)
189
+ * Date: 15 Oct 2020
190
+ * References:
191
+ * https://www.cs.cmu.edu/~dst/Adobe/Gallery/anon21jul01-pdf-encryption.txt
192
+ * https://github.com/foliojs/pdfkit/blob/master/lib/security.js
193
+ * http://www.fpdf.org/en/script/script37.php
194
+ */var p3={print:4,modify:8,copy:16,"annot-forms":32};function wu(e,t,n,r){this.v=1,this.r=2;var a=192;e.forEach(function(o){if(p3.perm!==void 0)throw new Error("Invalid permission: "+o);a+=p3[o]}),this.padding="(¿N^NuŠAd\0NVÿú\b..\0¶Ðh>€/\f©þdSiz";var i=(t+this.padding).substr(0,32),s=(n+this.padding).substr(0,32);this.O=this.processOwnerPassword(i,s),this.P=-(1+(255^a)),this.encryptionKey=cy(i+this.O+this.lsbFirstWord(this.P)+this.hexToBytes(r)).substr(0,5),this.U=fy(this.encryptionKey,this.padding)}function xu(e){if(/[^\u0000-\u00ff]/.test(e))throw new Error("Invalid PDF Name Object: "+e+", Only accept ASCII characters.");for(var t="",n=e.length,r=0;r<n;r++){var a=e.charCodeAt(r);a<33||a===35||a===37||a===40||a===41||a===47||a===60||a===62||a===91||a===93||a===123||a===125||a>126?t+="#"+("0"+a.toString(16)).slice(-2):t+=e[r]}return t}function m3(e){if(Ut(e)!=="object")throw new Error("Invalid Context passed to initialize PubSub (jsPDF-module)");var t={};this.subscribe=function(n,r,a){if(a=a||!1,typeof n!="string"||typeof r!="function"||typeof a!="boolean")throw new Error("Invalid arguments passed to PubSub.subscribe (jsPDF-module)");t.hasOwnProperty(n)||(t[n]={});var i=Math.random().toString(35);return t[n][i]=[r,!!a],i},this.unsubscribe=function(n){for(var r in t)if(t[r][n])return delete t[r][n],Object.keys(t[r]).length===0&&delete t[r],!0;return!1},this.publish=function(n){if(t.hasOwnProperty(n)){var r=Array.prototype.slice.call(arguments,1),a=[];for(var i in t[n]){var s=t[n][i];try{s[0].apply(e,r)}catch(o){ct.console&&fn.error("jsPDF PubSub Error",o.message,o)}s[1]&&a.push(i)}a.length&&a.forEach(this.unsubscribe)}},this.getTopics=function(){return t}}function Gm(e){if(!(this instanceof Gm))return new Gm(e);var t="opacity,stroke-opacity".split(",");for(var n in e)e.hasOwnProperty(n)&&t.indexOf(n)>=0&&(this[n]=e[n]);this.id="",this.objectNumber=-1}function qE(e,t){this.gState=e,this.matrix=t,this.id="",this.objectNumber=-1}function ol(e,t,n,r,a){if(!(this instanceof ol))return new ol(e,t,n,r,a);this.type=e==="axial"?2:3,this.coords=t,this.colors=n,qE.call(this,r,a)}function Mu(e,t,n,r,a){if(!(this instanceof Mu))return new Mu(e,t,n,r,a);this.boundingBox=e,this.xStep=t,this.yStep=n,this.stream="",this.cloneIndex=0,qE.call(this,r,a)}function lt(e){var t,n=typeof arguments[0]=="string"?arguments[0]:"p",r=arguments[1],a=arguments[2],i=arguments[3],s=[],o=1,l=16,u="S",c=null;Ut(e=e||{})==="object"&&(n=e.orientation,r=e.unit||r,a=e.format||a,i=e.compress||e.compressPdf||i,(c=e.encryption||null)!==null&&(c.userPassword=c.userPassword||"",c.ownerPassword=c.ownerPassword||"",c.userPermissions=c.userPermissions||[]),o=typeof e.userUnit=="number"?Math.abs(e.userUnit):1,e.precision!==void 0&&(t=e.precision),e.floatPrecision!==void 0&&(l=e.floatPrecision),u=e.defaultPathOperation||"S"),s=e.filters||(i===!0?["FlateEncode"]:s),r=r||"mm",n=(""+(n||"P")).toLowerCase();var f=e.putOnlyUsedFonts||!1,p={},d={internal:{},__private__:{}};d.__private__.PubSub=m3;var v="1.3",S=d.__private__.getPdfVersion=function(){return v};d.__private__.setPdfVersion=function(w){v=w};var x={a0:[2383.94,3370.39],a1:[1683.78,2383.94],a2:[1190.55,1683.78],a3:[841.89,1190.55],a4:[595.28,841.89],a5:[419.53,595.28],a6:[297.64,419.53],a7:[209.76,297.64],a8:[147.4,209.76],a9:[104.88,147.4],a10:[73.7,104.88],b0:[2834.65,4008.19],b1:[2004.09,2834.65],b2:[1417.32,2004.09],b3:[1000.63,1417.32],b4:[708.66,1000.63],b5:[498.9,708.66],b6:[354.33,498.9],b7:[249.45,354.33],b8:[175.75,249.45],b9:[124.72,175.75],b10:[87.87,124.72],c0:[2599.37,3676.54],c1:[1836.85,2599.37],c2:[1298.27,1836.85],c3:[918.43,1298.27],c4:[649.13,918.43],c5:[459.21,649.13],c6:[323.15,459.21],c7:[229.61,323.15],c8:[161.57,229.61],c9:[113.39,161.57],c10:[79.37,113.39],dl:[311.81,623.62],letter:[612,792],"government-letter":[576,756],legal:[612,1008],"junior-legal":[576,360],ledger:[1224,792],tabloid:[792,1224],"credit-card":[153,243]};d.__private__.getPageFormats=function(){return x};var g=d.__private__.getPageFormat=function(w){return x[w]};a=a||"a4";var y={COMPAT:"compat",ADVANCED:"advanced"},_=y.COMPAT;function E(){this.saveGraphicsState(),X(new ae(He,0,0,-He,0,$s()*He).toString()+" cm"),this.setFontSize(this.getFontSize()/He),u="n",_=y.ADVANCED}function D(){this.restoreGraphicsState(),u="S",_=y.COMPAT}var R=d.__private__.combineFontStyleAndFontWeight=function(w,k){if(w=="bold"&&k=="normal"||w=="bold"&&k==400||w=="normal"&&k=="italic"||w=="bold"&&k=="italic")throw new Error("Invalid Combination of fontweight and fontstyle");return k&&(w=k==400||k==="normal"?w==="italic"?"italic":"normal":k!=700&&k!=="bold"||w!=="normal"?(k==700?"bold":k)+""+w:"bold"),w};d.advancedAPI=function(w){var k=_===y.COMPAT;return k&&E.call(this),typeof w!="function"||(w(this),k&&D.call(this)),this},d.compatAPI=function(w){var k=_===y.ADVANCED;return k&&D.call(this),typeof w!="function"||(w(this),k&&E.call(this)),this},d.isAdvancedAPI=function(){return _===y.ADVANCED};var O,j=function(w){if(_!==y.ADVANCED)throw new Error(w+" is only available in 'advanced' API mode. You need to call advancedAPI() first.")},$=d.roundToPrecision=d.__private__.roundToPrecision=function(w,k){var Z=t||k;if(isNaN(w)||isNaN(Z))throw new Error("Invalid argument passed to jsPDF.roundToPrecision");return w.toFixed(Z).replace(/0+$/,"")};O=d.hpf=d.__private__.hpf=typeof l=="number"?function(w){if(isNaN(w))throw new Error("Invalid argument passed to jsPDF.hpf");return $(w,l)}:l==="smart"?function(w){if(isNaN(w))throw new Error("Invalid argument passed to jsPDF.hpf");return $(w,w>-1&&w<1?16:5)}:function(w){if(isNaN(w))throw new Error("Invalid argument passed to jsPDF.hpf");return $(w,16)};var V=d.f2=d.__private__.f2=function(w){if(isNaN(w))throw new Error("Invalid argument passed to jsPDF.f2");return $(w,2)},T=d.__private__.f3=function(w){if(isNaN(w))throw new Error("Invalid argument passed to jsPDF.f3");return $(w,3)},P=d.scale=d.__private__.scale=function(w){if(isNaN(w))throw new Error("Invalid argument passed to jsPDF.scale");return _===y.COMPAT?w*He:_===y.ADVANCED?w:void 0},q=function(w){return _===y.COMPAT?$s()-w:_===y.ADVANCED?w:void 0},Y=function(w){return P(q(w))};d.__private__.setPrecision=d.setPrecision=function(w){typeof parseInt(w,10)=="number"&&(t=parseInt(w,10))};var se,G="00000000000000000000000000000000",ne=d.__private__.getFileId=function(){return G},Q=d.__private__.setFileId=function(w){return G=w!==void 0&&/^[a-fA-F0-9]{32}$/.test(w)?w.toUpperCase():G.split("").map(function(){return"ABCDEF0123456789".charAt(Math.floor(16*Math.random()))}).join(""),c!==null&&(Lr=new wu(c.userPermissions,c.userPassword,c.ownerPassword,G)),G};d.setFileId=function(w){return Q(w),this},d.getFileId=function(){return ne()};var ie=d.__private__.convertDateToPDFDate=function(w){var k=w.getTimezoneOffset(),Z=k<0?"+":"-",oe=Math.floor(Math.abs(k/60)),ge=Math.abs(k%60),_e=[Z,W(oe),"'",W(ge),"'"].join("");return["D:",w.getFullYear(),W(w.getMonth()+1),W(w.getDate()),W(w.getHours()),W(w.getMinutes()),W(w.getSeconds()),_e].join("")},J=d.__private__.convertPDFDateToDate=function(w){var k=parseInt(w.substr(2,4),10),Z=parseInt(w.substr(6,2),10)-1,oe=parseInt(w.substr(8,2),10),ge=parseInt(w.substr(10,2),10),_e=parseInt(w.substr(12,2),10),Re=parseInt(w.substr(14,2),10);return new Date(k,Z,oe,ge,_e,Re,0)},le=d.__private__.setCreationDate=function(w){var k;if(w===void 0&&(w=new Date),w instanceof Date)k=ie(w);else{if(!/^D:(20[0-2][0-9]|203[0-7]|19[7-9][0-9])(0[0-9]|1[0-2])([0-2][0-9]|3[0-1])(0[0-9]|1[0-9]|2[0-3])(0[0-9]|[1-5][0-9])(0[0-9]|[1-5][0-9])(\+0[0-9]|\+1[0-4]|-0[0-9]|-1[0-1])'(0[0-9]|[1-5][0-9])'?$/.test(w))throw new Error("Invalid argument passed to jsPDF.setCreationDate");k=w}return se=k},L=d.__private__.getCreationDate=function(w){var k=se;return w==="jsDate"&&(k=J(se)),k};d.setCreationDate=function(w){return le(w),this},d.getCreationDate=function(w){return L(w)};var z,W=d.__private__.padd2=function(w){return("0"+parseInt(w)).slice(-2)},te=d.__private__.padd2Hex=function(w){return("00"+(w=w.toString())).substr(w.length)},B=0,ee=[],fe=[],me=0,Se=[],we=[],je=!1,Ae=fe,Me=function(){B=0,me=0,fe=[],ee=[],Se=[],tt=Ue(),et=Ue()};d.__private__.setCustomOutputDestination=function(w){je=!0,Ae=w};var pe=function(w){je||(Ae=w)};d.__private__.resetCustomOutputDestination=function(){je=!1,Ae=fe};var X=d.__private__.out=function(w){return w=w.toString(),me+=w.length+1,Ae.push(w),Ae},Ge=d.__private__.write=function(w){return X(arguments.length===1?w.toString():Array.prototype.join.call(arguments," "))},Pe=d.__private__.getArrayBuffer=function(w){for(var k=w.length,Z=new ArrayBuffer(k),oe=new Uint8Array(Z);k--;)oe[k]=w.charCodeAt(k);return Z},Te=[["Helvetica","helvetica","normal","WinAnsiEncoding"],["Helvetica-Bold","helvetica","bold","WinAnsiEncoding"],["Helvetica-Oblique","helvetica","italic","WinAnsiEncoding"],["Helvetica-BoldOblique","helvetica","bolditalic","WinAnsiEncoding"],["Courier","courier","normal","WinAnsiEncoding"],["Courier-Bold","courier","bold","WinAnsiEncoding"],["Courier-Oblique","courier","italic","WinAnsiEncoding"],["Courier-BoldOblique","courier","bolditalic","WinAnsiEncoding"],["Times-Roman","times","normal","WinAnsiEncoding"],["Times-Bold","times","bold","WinAnsiEncoding"],["Times-Italic","times","italic","WinAnsiEncoding"],["Times-BoldItalic","times","bolditalic","WinAnsiEncoding"],["ZapfDingbats","zapfdingbats","normal",null],["Symbol","symbol","normal",null]];d.__private__.getStandardFonts=function(){return Te};var Ie=e.fontSize||16;d.__private__.setFontSize=d.setFontSize=function(w){return Ie=_===y.ADVANCED?w/He:w,this};var qe,Fe=d.__private__.getFontSize=d.getFontSize=function(){return _===y.COMPAT?Ie:Ie*He},Qe=e.R2L||!1;d.__private__.setR2L=d.setR2L=function(w){return Qe=w,this},d.__private__.getR2L=d.getR2L=function(){return Qe};var ht,gt=d.__private__.setZoomMode=function(w){var k=[void 0,null,"fullwidth","fullheight","fullpage","original"];if(/^(?:\d+\.\d*|\d*\.\d+|\d+)%$/.test(w))qe=w;else if(isNaN(w)){if(k.indexOf(w)===-1)throw new Error('zoom must be Integer (e.g. 2), a percentage Value (e.g. 300%) or fullwidth, fullheight, fullpage, original. "'+w+'" is not recognized.');qe=w}else qe=parseInt(w,10)};d.__private__.getZoomMode=function(){return qe};var ft,wt=d.__private__.setPageMode=function(w){if([void 0,null,"UseNone","UseOutlines","UseThumbs","FullScreen"].indexOf(w)==-1)throw new Error('Page mode must be one of UseNone, UseOutlines, UseThumbs, or FullScreen. "'+w+'" is not recognized.');ht=w};d.__private__.getPageMode=function(){return ht};var Vt=d.__private__.setLayoutMode=function(w){if([void 0,null,"continuous","single","twoleft","tworight","two"].indexOf(w)==-1)throw new Error('Layout mode must be one of continuous, single, twoleft, tworight. "'+w+'" is not recognized.');ft=w};d.__private__.getLayoutMode=function(){return ft},d.__private__.setDisplayMode=d.setDisplayMode=function(w,k,Z){return gt(w),Vt(k),wt(Z),this};var ut={title:"",subject:"",author:"",keywords:"",creator:""};d.__private__.getDocumentProperty=function(w){if(Object.keys(ut).indexOf(w)===-1)throw new Error("Invalid argument passed to jsPDF.getDocumentProperty");return ut[w]},d.__private__.getDocumentProperties=function(){return ut},d.__private__.setDocumentProperties=d.setProperties=d.setDocumentProperties=function(w){for(var k in ut)ut.hasOwnProperty(k)&&w[k]&&(ut[k]=w[k]);return this},d.__private__.setDocumentProperty=function(w,k){if(Object.keys(ut).indexOf(w)===-1)throw new Error("Invalid arguments passed to jsPDF.setDocumentProperty");return ut[w]=k};var Et,He,hn,Pt,Yr,en={},pn={},pa=[],It={},Ai={},mn={},ma={},ka=null,Ln=0,pt=[],Ft=new m3(d),Pa=e.hotfixes||[],rr={},Ia={},re=[],ae=function w(k,Z,oe,ge,_e,Re){if(!(this instanceof w))return new w(k,Z,oe,ge,_e,Re);isNaN(k)&&(k=1),isNaN(Z)&&(Z=0),isNaN(oe)&&(oe=0),isNaN(ge)&&(ge=1),isNaN(_e)&&(_e=0),isNaN(Re)&&(Re=0),this._matrix=[k,Z,oe,ge,_e,Re]};Object.defineProperty(ae.prototype,"sx",{get:function(){return this._matrix[0]},set:function(w){this._matrix[0]=w}}),Object.defineProperty(ae.prototype,"shy",{get:function(){return this._matrix[1]},set:function(w){this._matrix[1]=w}}),Object.defineProperty(ae.prototype,"shx",{get:function(){return this._matrix[2]},set:function(w){this._matrix[2]=w}}),Object.defineProperty(ae.prototype,"sy",{get:function(){return this._matrix[3]},set:function(w){this._matrix[3]=w}}),Object.defineProperty(ae.prototype,"tx",{get:function(){return this._matrix[4]},set:function(w){this._matrix[4]=w}}),Object.defineProperty(ae.prototype,"ty",{get:function(){return this._matrix[5]},set:function(w){this._matrix[5]=w}}),Object.defineProperty(ae.prototype,"a",{get:function(){return this._matrix[0]},set:function(w){this._matrix[0]=w}}),Object.defineProperty(ae.prototype,"b",{get:function(){return this._matrix[1]},set:function(w){this._matrix[1]=w}}),Object.defineProperty(ae.prototype,"c",{get:function(){return this._matrix[2]},set:function(w){this._matrix[2]=w}}),Object.defineProperty(ae.prototype,"d",{get:function(){return this._matrix[3]},set:function(w){this._matrix[3]=w}}),Object.defineProperty(ae.prototype,"e",{get:function(){return this._matrix[4]},set:function(w){this._matrix[4]=w}}),Object.defineProperty(ae.prototype,"f",{get:function(){return this._matrix[5]},set:function(w){this._matrix[5]=w}}),Object.defineProperty(ae.prototype,"rotation",{get:function(){return Math.atan2(this.shx,this.sx)}}),Object.defineProperty(ae.prototype,"scaleX",{get:function(){return this.decompose().scale.sx}}),Object.defineProperty(ae.prototype,"scaleY",{get:function(){return this.decompose().scale.sy}}),Object.defineProperty(ae.prototype,"isIdentity",{get:function(){return this.sx===1&&this.shy===0&&this.shx===0&&this.sy===1&&this.tx===0&&this.ty===0}}),ae.prototype.join=function(w){return[this.sx,this.shy,this.shx,this.sy,this.tx,this.ty].map(O).join(w)},ae.prototype.multiply=function(w){var k=w.sx*this.sx+w.shy*this.shx,Z=w.sx*this.shy+w.shy*this.sy,oe=w.shx*this.sx+w.sy*this.shx,ge=w.shx*this.shy+w.sy*this.sy,_e=w.tx*this.sx+w.ty*this.shx+this.tx,Re=w.tx*this.shy+w.ty*this.sy+this.ty;return new ae(k,Z,oe,ge,_e,Re)},ae.prototype.decompose=function(){var w=this.sx,k=this.shy,Z=this.shx,oe=this.sy,ge=this.tx,_e=this.ty,Re=Math.sqrt(w*w+k*k),Ye=(w/=Re)*Z+(k/=Re)*oe;Z-=w*Ye,oe-=k*Ye;var nt=Math.sqrt(Z*Z+oe*oe);return Ye/=nt,w*(oe/=nt)<k*(Z/=nt)&&(w=-w,k=-k,Ye=-Ye,Re=-Re),{scale:new ae(Re,0,0,nt,0,0),translate:new ae(1,0,0,1,ge,_e),rotate:new ae(w,k,-k,w,0,0),skew:new ae(1,0,Ye,1,0,0)}},ae.prototype.toString=function(w){return this.join(" ")},ae.prototype.inversed=function(){var w=this.sx,k=this.shy,Z=this.shx,oe=this.sy,ge=this.tx,_e=this.ty,Re=1/(w*oe-k*Z),Ye=oe*Re,nt=-k*Re,xt=-Z*Re,yt=w*Re;return new ae(Ye,nt,xt,yt,-Ye*ge-xt*_e,-nt*ge-yt*_e)},ae.prototype.applyToPoint=function(w){var k=w.x*this.sx+w.y*this.shx+this.tx,Z=w.x*this.shy+w.y*this.sy+this.ty;return new $l(k,Z)},ae.prototype.applyToRectangle=function(w){var k=this.applyToPoint(w),Z=this.applyToPoint(new $l(w.x+w.w,w.y+w.h));return new Ic(k.x,k.y,Z.x-k.x,Z.y-k.y)},ae.prototype.clone=function(){var w=this.sx,k=this.shy,Z=this.shx,oe=this.sy,ge=this.tx,_e=this.ty;return new ae(w,k,Z,oe,ge,_e)},d.Matrix=ae;var be=d.matrixMult=function(w,k){return k.multiply(w)},De=new ae(1,0,0,1,0,0);d.unitMatrix=d.identityMatrix=De;var ke=function(w,k){if(!Ai[w]){var Z=(k instanceof ol?"Sh":"P")+(Object.keys(It).length+1).toString(10);k.id=Z,Ai[w]=Z,It[Z]=k,Ft.publish("addPattern",k)}};d.ShadingPattern=ol,d.TilingPattern=Mu,d.addShadingPattern=function(w,k){return j("addShadingPattern()"),ke(w,k),this},d.beginTilingPattern=function(w){j("beginTilingPattern()"),lh(w.boundingBox[0],w.boundingBox[1],w.boundingBox[2]-w.boundingBox[0],w.boundingBox[3]-w.boundingBox[1],w.matrix)},d.endTilingPattern=function(w,k){j("endTilingPattern()"),k.stream=we[z].join(`
195
+ `),ke(w,k),Ft.publish("endTilingPattern",k),re.pop().restore()};var $e=d.__private__.newObject=function(){var w=Ue();return Ve(w,!0),w},Ue=d.__private__.newObjectDeferred=function(){return B++,ee[B]=function(){return me},B},Ve=function(w,k){return k=typeof k=="boolean"&&k,ee[w]=me,k&&X(w+" 0 obj"),w},Ze=d.__private__.newAdditionalObject=function(){var w={objId:Ue(),content:""};return Se.push(w),w},tt=Ue(),et=Ue(),Je=d.__private__.decodeColorString=function(w){var k=w.split(" ");if(k.length!==2||k[1]!=="g"&&k[1]!=="G")k.length===5&&(k[4]==="k"||k[4]==="K")&&(k=[(1-k[0])*(1-k[3]),(1-k[1])*(1-k[3]),(1-k[2])*(1-k[3]),"r"]);else{var Z=parseFloat(k[0]);k=[Z,Z,Z,"r"]}for(var oe="#",ge=0;ge<3;ge++)oe+=("0"+Math.floor(255*parseFloat(k[ge])).toString(16)).slice(-2);return oe},at=d.__private__.encodeColorString=function(w){var k;typeof w=="string"&&(w={ch1:w});var Z=w.ch1,oe=w.ch2,ge=w.ch3,_e=w.ch4,Re=w.pdfColorType==="draw"?["G","RG","K"]:["g","rg","k"];if(typeof Z=="string"&&Z.charAt(0)!=="#"){var Ye=new UE(Z);if(Ye.ok)Z=Ye.toHex();else if(!/^\d*\.?\d*$/.test(Z))throw new Error('Invalid color "'+Z+'" passed to jsPDF.encodeColorString.')}if(typeof Z=="string"&&/^#[0-9A-Fa-f]{3}$/.test(Z)&&(Z="#"+Z[1]+Z[1]+Z[2]+Z[2]+Z[3]+Z[3]),typeof Z=="string"&&/^#[0-9A-Fa-f]{6}$/.test(Z)){var nt=parseInt(Z.substr(1),16);Z=nt>>16&255,oe=nt>>8&255,ge=255&nt}if(oe===void 0||_e===void 0&&Z===oe&&oe===ge)if(typeof Z=="string")k=Z+" "+Re[0];else switch(w.precision){case 2:k=V(Z/255)+" "+Re[0];break;case 3:default:k=T(Z/255)+" "+Re[0]}else if(_e===void 0||Ut(_e)==="object"){if(_e&&!isNaN(_e.a)&&_e.a===0)return k=["1.","1.","1.",Re[1]].join(" ");if(typeof Z=="string")k=[Z,oe,ge,Re[1]].join(" ");else switch(w.precision){case 2:k=[V(Z/255),V(oe/255),V(ge/255),Re[1]].join(" ");break;default:case 3:k=[T(Z/255),T(oe/255),T(ge/255),Re[1]].join(" ")}}else if(typeof Z=="string")k=[Z,oe,ge,_e,Re[2]].join(" ");else switch(w.precision){case 2:k=[V(Z),V(oe),V(ge),V(_e),Re[2]].join(" ");break;case 3:default:k=[T(Z),T(oe),T(ge),T(_e),Re[2]].join(" ")}return k},Tt=d.__private__.getFilters=function(){return s},Yt=d.__private__.putStream=function(w){var k=(w=w||{}).data||"",Z=w.filters||Tt(),oe=w.alreadyAppliedFilters||[],ge=w.addLength1||!1,_e=k.length,Re=w.objectId,Ye=function(jr){return jr};if(c!==null&&Re===void 0)throw new Error("ObjectId must be passed to putStream for file encryption");c!==null&&(Ye=Lr.encryptor(Re,0));var nt={};Z===!0&&(Z=["FlateEncode"]);var xt=w.additionalKeyValues||[],yt=(nt=lt.API.processDataByFilters!==void 0?lt.API.processDataByFilters(k,Z):{data:k,reverseChain:[]}).reverseChain+(Array.isArray(oe)?oe.join(" "):oe.toString());if(nt.data.length!==0&&(xt.push({key:"Length",value:nt.data.length}),ge===!0&&xt.push({key:"Length1",value:_e})),yt.length!=0)if(yt.split("/").length-1==1)xt.push({key:"Filter",value:yt});else{xt.push({key:"Filter",value:"["+yt+"]"});for(var $t=0;$t<xt.length;$t+=1)if(xt[$t].key==="DecodeParms"){for(var On=[],Rn=0;Rn<nt.reverseChain.split("/").length-1;Rn+=1)On.push("null");On.push(xt[$t].value),xt[$t].value="["+On.join(" ")+"]"}}X("<<");for(var Jn=0;Jn<xt.length;Jn++)X("/"+xt[Jn].key+" "+xt[Jn].value);X(">>"),nt.data.length!==0&&(X("stream"),X(Ye(nt.data)),X("endstream"))},gn=d.__private__.putPage=function(w){var k=w.number,Z=w.data,oe=w.objId,ge=w.contentsObjId;Ve(oe,!0),X("<</Type /Page"),X("/Parent "+w.rootDictionaryObjId+" 0 R"),X("/Resources "+w.resourceDictionaryObjId+" 0 R"),X("/MediaBox ["+parseFloat(O(w.mediaBox.bottomLeftX))+" "+parseFloat(O(w.mediaBox.bottomLeftY))+" "+O(w.mediaBox.topRightX)+" "+O(w.mediaBox.topRightY)+"]"),w.cropBox!==null&&X("/CropBox ["+O(w.cropBox.bottomLeftX)+" "+O(w.cropBox.bottomLeftY)+" "+O(w.cropBox.topRightX)+" "+O(w.cropBox.topRightY)+"]"),w.bleedBox!==null&&X("/BleedBox ["+O(w.bleedBox.bottomLeftX)+" "+O(w.bleedBox.bottomLeftY)+" "+O(w.bleedBox.topRightX)+" "+O(w.bleedBox.topRightY)+"]"),w.trimBox!==null&&X("/TrimBox ["+O(w.trimBox.bottomLeftX)+" "+O(w.trimBox.bottomLeftY)+" "+O(w.trimBox.topRightX)+" "+O(w.trimBox.topRightY)+"]"),w.artBox!==null&&X("/ArtBox ["+O(w.artBox.bottomLeftX)+" "+O(w.artBox.bottomLeftY)+" "+O(w.artBox.topRightX)+" "+O(w.artBox.topRightY)+"]"),typeof w.userUnit=="number"&&w.userUnit!==1&&X("/UserUnit "+w.userUnit),Ft.publish("putPage",{objId:oe,pageContext:pt[k],pageNumber:k,page:Z}),X("/Contents "+ge+" 0 R"),X(">>"),X("endobj");var _e=Z.join(`
196
+ `);return _===y.ADVANCED&&(_e+=`
197
+ Q`),Ve(ge,!0),Yt({data:_e,filters:Tt(),objectId:ge}),X("endobj"),oe},Gt=d.__private__.putPages=function(){var w,k,Z=[];for(w=1;w<=Ln;w++)pt[w].objId=Ue(),pt[w].contentsObjId=Ue();for(w=1;w<=Ln;w++)Z.push(gn({number:w,data:we[w],objId:pt[w].objId,contentsObjId:pt[w].contentsObjId,mediaBox:pt[w].mediaBox,cropBox:pt[w].cropBox,bleedBox:pt[w].bleedBox,trimBox:pt[w].trimBox,artBox:pt[w].artBox,userUnit:pt[w].userUnit,rootDictionaryObjId:tt,resourceDictionaryObjId:et}));Ve(tt,!0),X("<</Type /Pages");var oe="/Kids [";for(k=0;k<Ln;k++)oe+=Z[k]+" 0 R ";X(oe+"]"),X("/Count "+Ln),X(">>"),X("endobj"),Ft.publish("postPutPages")},qt=function(w){Ft.publish("putFont",{font:w,out:X,newObject:$e,putStream:Yt}),w.isAlreadyPutted!==!0&&(w.objectNumber=$e(),X("<<"),X("/Type /Font"),X("/BaseFont /"+xu(w.postScriptName)),X("/Subtype /Type1"),typeof w.encoding=="string"&&X("/Encoding /"+w.encoding),X("/FirstChar 32"),X("/LastChar 255"),X(">>"),X("endobj"))},Gr=function(){for(var w in en)en.hasOwnProperty(w)&&(f===!1||f===!0&&p.hasOwnProperty(w))&&qt(en[w])},Fa=function(w){w.objectNumber=$e();var k=[];k.push({key:"Type",value:"/XObject"}),k.push({key:"Subtype",value:"/Form"}),k.push({key:"BBox",value:"["+[O(w.x),O(w.y),O(w.x+w.width),O(w.y+w.height)].join(" ")+"]"}),k.push({key:"Matrix",value:"["+w.matrix.toString()+"]"});var Z=w.pages[1].join(`
198
+ `);Yt({data:Z,additionalKeyValues:k,objectId:w.objectNumber}),X("endobj")},Pr=function(){for(var w in rr)rr.hasOwnProperty(w)&&Fa(rr[w])},Ir=function(w,k){var Z,oe=[],ge=1/(k-1);for(Z=0;Z<1;Z+=ge)oe.push(Z);if(oe.push(1),w[0].offset!=0){var _e={offset:0,color:w[0].color};w.unshift(_e)}if(w[w.length-1].offset!=1){var Re={offset:1,color:w[w.length-1].color};w.push(Re)}for(var Ye="",nt=0,xt=0;xt<oe.length;xt++){for(Z=oe[xt];Z>w[nt+1].offset;)nt++;var yt=w[nt].offset,$t=(Z-yt)/(w[nt+1].offset-yt),On=w[nt].color,Rn=w[nt+1].color;Ye+=te(Math.round((1-$t)*On[0]+$t*Rn[0]).toString(16))+te(Math.round((1-$t)*On[1]+$t*Rn[1]).toString(16))+te(Math.round((1-$t)*On[2]+$t*Rn[2]).toString(16))}return Ye.trim()},Uo=function(w,k){k||(k=21);var Z=$e(),oe=Ir(w.colors,k),ge=[];ge.push({key:"FunctionType",value:"0"}),ge.push({key:"Domain",value:"[0.0 1.0]"}),ge.push({key:"Size",value:"["+k+"]"}),ge.push({key:"BitsPerSample",value:"8"}),ge.push({key:"Range",value:"[0.0 1.0 0.0 1.0 0.0 1.0]"}),ge.push({key:"Decode",value:"[0.0 1.0 0.0 1.0 0.0 1.0]"}),Yt({data:oe,additionalKeyValues:ge,alreadyAppliedFilters:["/ASCIIHexDecode"],objectId:Z}),X("endobj"),w.objectNumber=$e(),X("<< /ShadingType "+w.type),X("/ColorSpace /DeviceRGB");var _e="/Coords ["+O(parseFloat(w.coords[0]))+" "+O(parseFloat(w.coords[1]))+" ";w.type===2?_e+=O(parseFloat(w.coords[2]))+" "+O(parseFloat(w.coords[3])):_e+=O(parseFloat(w.coords[2]))+" "+O(parseFloat(w.coords[3]))+" "+O(parseFloat(w.coords[4]))+" "+O(parseFloat(w.coords[5])),X(_e+="]"),w.matrix&&X("/Matrix ["+w.matrix.toString()+"]"),X("/Function "+Z+" 0 R"),X("/Extend [true true]"),X(">>"),X("endobj")},Yi=function(w,k){var Z=Ue(),oe=$e();k.push({resourcesOid:Z,objectOid:oe}),w.objectNumber=oe;var ge=[];ge.push({key:"Type",value:"/Pattern"}),ge.push({key:"PatternType",value:"1"}),ge.push({key:"PaintType",value:"1"}),ge.push({key:"TilingType",value:"1"}),ge.push({key:"BBox",value:"["+w.boundingBox.map(O).join(" ")+"]"}),ge.push({key:"XStep",value:O(w.xStep)}),ge.push({key:"YStep",value:O(w.yStep)}),ge.push({key:"Resources",value:Z+" 0 R"}),w.matrix&&ge.push({key:"Matrix",value:"["+w.matrix.toString()+"]"}),Yt({data:w.stream,additionalKeyValues:ge,objectId:w.objectNumber}),X("endobj")},Wr=function(w){var k;for(k in It)It.hasOwnProperty(k)&&(It[k]instanceof ol?Uo(It[k]):It[k]instanceof Mu&&Yi(It[k],w))},Gi=function(w){for(var k in w.objectNumber=$e(),X("<<"),w)switch(k){case"opacity":X("/ca "+V(w[k]));break;case"stroke-opacity":X("/CA "+V(w[k]))}X(">>"),X("endobj")},Ps=function(){var w;for(w in mn)mn.hasOwnProperty(w)&&Gi(mn[w])},jt=function(){for(var w in X("/XObject <<"),rr)rr.hasOwnProperty(w)&&rr[w].objectNumber>=0&&X("/"+w+" "+rr[w].objectNumber+" 0 R");Ft.publish("putXobjectDict"),X(">>")},Wn=function(){Lr.oid=$e(),X("<<"),X("/Filter /Standard"),X("/V "+Lr.v),X("/R "+Lr.r),X("/U <"+Lr.toHexString(Lr.U)+">"),X("/O <"+Lr.toHexString(Lr.O)+">"),X("/P "+Lr.P),X(">>"),X("endobj")},si=function(){for(var w in X("/Font <<"),en)en.hasOwnProperty(w)&&(f===!1||f===!0&&p.hasOwnProperty(w))&&X("/"+w+" "+en[w].objectNumber+" 0 R");X(">>")},oi=function(){if(Object.keys(It).length>0){for(var w in X("/Shading <<"),It)It.hasOwnProperty(w)&&It[w]instanceof ol&&It[w].objectNumber>=0&&X("/"+w+" "+It[w].objectNumber+" 0 R");Ft.publish("putShadingPatternDict"),X(">>")}},vn=function(w){if(Object.keys(It).length>0){for(var k in X("/Pattern <<"),It)It.hasOwnProperty(k)&&It[k]instanceof d.TilingPattern&&It[k].objectNumber>=0&&It[k].objectNumber<w&&X("/"+k+" "+It[k].objectNumber+" 0 R");Ft.publish("putTilingPatternDict"),X(">>")}},Is=function(){if(Object.keys(mn).length>0){var w;for(w in X("/ExtGState <<"),mn)mn.hasOwnProperty(w)&&mn[w].objectNumber>=0&&X("/"+w+" "+mn[w].objectNumber+" 0 R");Ft.publish("putGStateDict"),X(">>")}},jn=function(w){Ve(w.resourcesOid,!0),X("<<"),X("/ProcSet [/PDF /Text /ImageB /ImageC /ImageI]"),si(),oi(),vn(w.objectOid),Is(),jt(),X(">>"),X("endobj")},Rl=function(){var w=[];Gr(),Ps(),Pr(),Wr(w),Ft.publish("putResources"),w.forEach(jn),jn({resourcesOid:et,objectOid:Number.MAX_SAFE_INTEGER}),Ft.publish("postPutResources")},Wd=function(){Ft.publish("putAdditionalObjects");for(var w=0;w<Se.length;w++){var k=Se[w];Ve(k.objId,!0),X(k.content),X("endobj")}Ft.publish("postPutAdditionalObjects")},Jd=function(w){pn[w.fontName]=pn[w.fontName]||{},pn[w.fontName][w.fontStyle]=w.id},Lc=function(w,k,Z,oe,ge){var _e={id:"F"+(Object.keys(en).length+1).toString(10),postScriptName:w,fontName:k,fontStyle:Z,encoding:oe,isStandardFont:ge||!1,metadata:{}};return Ft.publish("addFont",{font:_e,instance:this}),en[_e.id]=_e,Jd(_e),_e.id},s0=function(w){for(var k=0,Z=Te.length;k<Z;k++){var oe=Lc.call(this,w[k][0],w[k][1],w[k][2],Te[k][3],!0);f===!1&&(p[oe]=!0);var ge=w[k][0].split("-");Jd({id:oe,fontName:ge[0],fontStyle:ge[1]||""})}Ft.publish("addFonts",{fonts:en,dictionary:pn})},li=function(w){return w.foo=function(){try{return w.apply(this,arguments)}catch(oe){var k=oe.stack||"";~k.indexOf(" at ")&&(k=k.split(" at ")[1]);var Z="Error in function "+k.split(`
199
+ `)[0].split("<")[0]+": "+oe.message;if(!ct.console)throw new Error(Z);ct.console.error(Z,oe),ct.alert&&alert(Z)}},w.foo.bar=w,w.foo},Ml=function(w,k){var Z,oe,ge,_e,Re,Ye,nt,xt,yt;if(ge=(k=k||{}).sourceEncoding||"Unicode",Re=k.outputEncoding,(k.autoencode||Re)&&en[Et].metadata&&en[Et].metadata[ge]&&en[Et].metadata[ge].encoding&&(_e=en[Et].metadata[ge].encoding,!Re&&en[Et].encoding&&(Re=en[Et].encoding),!Re&&_e.codePages&&(Re=_e.codePages[0]),typeof Re=="string"&&(Re=_e[Re]),Re)){for(nt=!1,Ye=[],Z=0,oe=w.length;Z<oe;Z++)(xt=Re[w.charCodeAt(Z)])?Ye.push(String.fromCharCode(xt)):Ye.push(w[Z]),Ye[Z].charCodeAt(0)>>8&&(nt=!0);w=Ye.join("")}for(Z=w.length;nt===void 0&&Z!==0;)w.charCodeAt(Z-1)>>8&&(nt=!0),Z--;if(!nt)return w;for(Ye=k.noBOM?[]:[254,255],Z=0,oe=w.length;Z<oe;Z++){if((yt=(xt=w.charCodeAt(Z))>>8)>>8)throw new Error("Character at position "+Z+" of string '"+w+"' exceeds 16bits. Cannot be encoded into UCS-2 BE");Ye.push(yt),Ye.push(xt-(yt<<8))}return String.fromCharCode.apply(void 0,Ye)},Jr=d.__private__.pdfEscape=d.pdfEscape=function(w,k){return Ml(w,k).replace(/\\/g,"\\\\").replace(/\(/g,"\\(").replace(/\)/g,"\\)")},jc=d.__private__.beginPage=function(w){we[++Ln]=[],pt[Ln]={objId:0,contentsObjId:0,userUnit:Number(o),artBox:null,bleedBox:null,cropBox:null,trimBox:null,mediaBox:{bottomLeftX:0,bottomLeftY:0,topRightX:Number(w[0]),topRightY:Number(w[1])}},Xd(Ln),pe(we[z])},Kd=function(w,k){var Z,oe,ge;switch(n=k||n,typeof w=="string"&&(Z=g(w.toLowerCase()),Array.isArray(Z)&&(oe=Z[0],ge=Z[1])),Array.isArray(w)&&(oe=w[0]*He,ge=w[1]*He),isNaN(oe)&&(oe=a[0],ge=a[1]),(oe>14400||ge>14400)&&(fn.warn("A page in a PDF can not be wider or taller than 14400 userUnit. jsPDF limits the width/height to 14400"),oe=Math.min(14400,oe),ge=Math.min(14400,ge)),a=[oe,ge],n.substr(0,1)){case"l":ge>oe&&(a=[ge,oe]);break;case"p":oe>ge&&(a=[ge,oe])}jc(a),rh(Rc),X(ui),kc!==0&&X(kc+" J"),Pc!==0&&X(Pc+" j"),Ft.publish("addPage",{pageNumber:Ln})},o0=function(w){w>0&&w<=Ln&&(we.splice(w,1),pt.splice(w,1),Ln--,z>Ln&&(z=Ln),this.setPage(z))},Xd=function(w){w>0&&w<=Ln&&(z=w)},l0=d.__private__.getNumberOfPages=d.getNumberOfPages=function(){return we.length-1},Qd=function(w,k,Z){var oe,ge=void 0;return Z=Z||{},w=w!==void 0?w:en[Et].fontName,k=k!==void 0?k:en[Et].fontStyle,oe=w.toLowerCase(),pn[oe]!==void 0&&pn[oe][k]!==void 0?ge=pn[oe][k]:pn[w]!==void 0&&pn[w][k]!==void 0?ge=pn[w][k]:Z.disableWarning===!1&&fn.warn("Unable to look up font label for font '"+w+"', '"+k+"'. Refer to getFontList() for available fonts."),ge||Z.noFallback||(ge=pn.times[k])==null&&(ge=pn.times.normal),ge},u0=d.__private__.putInfo=function(){var w=$e(),k=function(oe){return oe};for(var Z in c!==null&&(k=Lr.encryptor(w,0)),X("<<"),X("/Producer ("+Jr(k("jsPDF "+lt.version))+")"),ut)ut.hasOwnProperty(Z)&&ut[Z]&&X("/"+Z.substr(0,1).toUpperCase()+Z.substr(1)+" ("+Jr(k(ut[Z]))+")");X("/CreationDate ("+Jr(k(se))+")"),X(">>"),X("endobj")},Tc=d.__private__.putCatalog=function(w){var k=(w=w||{}).rootDictionaryObjId||tt;switch($e(),X("<<"),X("/Type /Catalog"),X("/Pages "+k+" 0 R"),qe||(qe="fullwidth"),qe){case"fullwidth":X("/OpenAction [3 0 R /FitH null]");break;case"fullheight":X("/OpenAction [3 0 R /FitV null]");break;case"fullpage":X("/OpenAction [3 0 R /Fit]");break;case"original":X("/OpenAction [3 0 R /XYZ null null 1]");break;default:var Z=""+qe;Z.substr(Z.length-1)==="%"&&(qe=parseInt(qe)/100),typeof qe=="number"&&X("/OpenAction [3 0 R /XYZ null null "+V(qe)+"]")}switch(ft||(ft="continuous"),ft){case"continuous":X("/PageLayout /OneColumn");break;case"single":X("/PageLayout /SinglePage");break;case"two":case"twoleft":X("/PageLayout /TwoColumnLeft");break;case"tworight":X("/PageLayout /TwoColumnRight")}ht&&X("/PageMode /"+ht),Ft.publish("putCatalog"),X(">>"),X("endobj")},c0=d.__private__.putTrailer=function(){X("trailer"),X("<<"),X("/Size "+(B+1)),X("/Root "+B+" 0 R"),X("/Info "+(B-1)+" 0 R"),c!==null&&X("/Encrypt "+Lr.oid+" 0 R"),X("/ID [ <"+G+"> <"+G+"> ]"),X(">>")},f0=d.__private__.putHeader=function(){X("%PDF-"+v),X("%ºß¬à")},d0=d.__private__.putXRef=function(){var w="0000000000";X("xref"),X("0 "+(B+1)),X("0000000000 65535 f ");for(var k=1;k<=B;k++)typeof ee[k]=="function"?X((w+ee[k]()).slice(-10)+" 00000 n "):ee[k]!==void 0?X((w+ee[k]).slice(-10)+" 00000 n "):X("0000000000 00000 n ")},Wi=d.__private__.buildDocument=function(){Me(),pe(fe),Ft.publish("buildDocument"),f0(),Gt(),Wd(),Rl(),c!==null&&Wn(),u0(),Tc();var w=me;return d0(),c0(),X("startxref"),X(""+w),X("%%EOF"),pe(we[z]),fe.join(`
200
+ `)},kl=d.__private__.getBlob=function(w){return new Blob([Pe(w)],{type:"application/pdf"})},Pl=d.output=d.__private__.output=li(function(w,k){switch(typeof(k=k||{})=="string"?k={filename:k}:k.filename=k.filename||"generated.pdf",w){case void 0:return Wi();case"save":d.save(k.filename);break;case"arraybuffer":return Pe(Wi());case"blob":return kl(Wi());case"bloburi":case"bloburl":if(ct.URL!==void 0&&typeof ct.URL.createObjectURL=="function")return ct.URL&&ct.URL.createObjectURL(kl(Wi()))||void 0;fn.warn("bloburl is not supported by your system, because URL.createObjectURL is not supported by your browser.");break;case"datauristring":case"dataurlstring":var Z="",oe=Wi();try{Z=uy(oe)}catch{Z=uy(unescape(encodeURIComponent(oe)))}return"data:application/pdf;filename="+k.filename+";base64,"+Z;case"pdfobjectnewwindow":if(Object.prototype.toString.call(ct)==="[object Window]"){var ge="https://cdnjs.cloudflare.com/ajax/libs/pdfobject/2.1.1/pdfobject.min.js",_e=' integrity="sha512-4ze/a9/4jqu+tX9dfOqJYSvyYd5M6qum/3HpCLr+/Jqf0whc37VUbkpNGHR7/8pSnCFw47T1fmIpwBV7UySh3g==" crossorigin="anonymous"';k.pdfObjectUrl&&(ge=k.pdfObjectUrl,_e="");var Re='<html><style>html, body { padding: 0; margin: 0; } iframe { width: 100%; height: 100%; border: 0;} </style><body><script src="'+ge+'"'+_e+'><\/script><script >PDFObject.embed("'+this.output("dataurlstring")+'", '+JSON.stringify(k)+");<\/script></body></html>",Ye=ct.open();return Ye!==null&&Ye.document.write(Re),Ye}throw new Error("The option pdfobjectnewwindow just works in a browser-environment.");case"pdfjsnewwindow":if(Object.prototype.toString.call(ct)==="[object Window]"){var nt='<html><style>html, body { padding: 0; margin: 0; } iframe { width: 100%; height: 100%; border: 0;} </style><body><iframe id="pdfViewer" src="'+(k.pdfJsUrl||"examples/PDF.js/web/viewer.html")+"?file=&downloadName="+k.filename+'" width="500px" height="400px" /></body></html>',xt=ct.open();if(xt!==null){xt.document.write(nt);var yt=this;xt.document.documentElement.querySelector("#pdfViewer").onload=function(){xt.document.title=k.filename,xt.document.documentElement.querySelector("#pdfViewer").contentWindow.PDFViewerApplication.open(yt.output("bloburl"))}}return xt}throw new Error("The option pdfjsnewwindow just works in a browser-environment.");case"dataurlnewwindow":if(Object.prototype.toString.call(ct)!=="[object Window]")throw new Error("The option dataurlnewwindow just works in a browser-environment.");var $t='<html><style>html, body { padding: 0; margin: 0; } iframe { width: 100%; height: 100%; border: 0;} </style><body><iframe src="'+this.output("datauristring",k)+'"></iframe></body></html>',On=ct.open();if(On!==null&&(On.document.write($t),On.document.title=k.filename),On||typeof safari>"u")return On;break;case"datauri":case"dataurl":return ct.document.location.href=this.output("datauristring",k);default:return null}}),Zd=function(w){return Array.isArray(Pa)===!0&&Pa.indexOf(w)>-1};switch(r){case"pt":He=1;break;case"mm":He=72/25.4;break;case"cm":He=72/2.54;break;case"in":He=72;break;case"px":He=Zd("px_scaling")==1?.75:96/72;break;case"pc":case"em":He=12;break;case"ex":He=6;break;default:if(typeof r!="number")throw new Error("Invalid unit: "+r);He=r}var Lr=null;le(),Q();var h0=function(w){return c!==null?Lr.encryptor(w,0):function(k){return k}},eh=d.__private__.getPageInfo=d.getPageInfo=function(w){if(isNaN(w)||w%1!=0)throw new Error("Invalid argument passed to jsPDF.getPageInfo");return{objId:pt[w].objId,pageNumber:w,pageContext:pt[w]}},vt=d.__private__.getPageInfoByObjId=function(w){if(isNaN(w)||w%1!=0)throw new Error("Invalid argument passed to jsPDF.getPageInfoByObjId");for(var k in pt)if(pt[k].objId===w)break;return eh(k)},p0=d.__private__.getCurrentPageInfo=d.getCurrentPageInfo=function(){return{objId:pt[z].objId,pageNumber:z,pageContext:pt[z]}};d.addPage=function(){return Kd.apply(this,arguments),this},d.setPage=function(){return Xd.apply(this,arguments),pe.call(this,we[z]),this},d.insertPage=function(w){return this.addPage(),this.movePage(z,w),this},d.movePage=function(w,k){var Z,oe;if(w>k){Z=we[w],oe=pt[w];for(var ge=w;ge>k;ge--)we[ge]=we[ge-1],pt[ge]=pt[ge-1];we[k]=Z,pt[k]=oe,this.setPage(k)}else if(w<k){Z=we[w],oe=pt[w];for(var _e=w;_e<k;_e++)we[_e]=we[_e+1],pt[_e]=pt[_e+1];we[k]=Z,pt[k]=oe,this.setPage(k)}return this},d.deletePage=function(){return o0.apply(this,arguments),this},d.__private__.text=d.text=function(w,k,Z,oe,ge){var _e,Re,Ye,nt,xt,yt,$t,On,Rn,Jn=(oe=oe||{}).scope||this;if(typeof w=="number"&&typeof k=="number"&&(typeof Z=="string"||Array.isArray(Z))){var jr=Z;Z=k,k=w,w=jr}if(arguments[3]instanceof ae?(j("The transform parameter of text() with a Matrix value"),Rn=ge):(Ye=arguments[4],nt=arguments[5],Ut($t=arguments[3])==="object"&&$t!==null||(typeof Ye=="string"&&(nt=Ye,Ye=null),typeof $t=="string"&&(nt=$t,$t=null),typeof $t=="number"&&(Ye=$t,$t=null),oe={flags:$t,angle:Ye,align:nt})),isNaN(k)||isNaN(Z)||w==null)throw new Error("Invalid arguments passed to jsPDF.text");if(w.length===0)return Jn;var ur="",ci=!1,ga=typeof oe.lineHeightFactor=="number"?oe.lineHeightFactor:qo,Ci=Jn.internal.scaleFactor;function uh(yn){return yn=yn.split(" ").join(Array(oe.TabLen||9).join(" ")),Jr(yn,$t)}function Uc(yn){for(var bn,zn=yn.concat(),ar=[],Zi=zn.length;Zi--;)typeof(bn=zn.shift())=="string"?ar.push(bn):Array.isArray(yn)&&(bn.length===1||bn[1]===void 0&&bn[2]===void 0)?ar.push(bn[0]):ar.push([bn[0],bn[1],bn[2]]);return ar}function zc(yn,bn){var zn;if(typeof yn=="string")zn=bn(yn)[0];else if(Array.isArray(yn)){for(var ar,Zi,Kc=yn.concat(),Xl=[],ph=Kc.length;ph--;)typeof(ar=Kc.shift())=="string"?Xl.push(bn(ar)[0]):Array.isArray(ar)&&typeof ar[0]=="string"&&(Zi=bn(ar[0],ar[1],ar[2]),Xl.push([Zi[0],Zi[1],Zi[2]]));zn=Xl}return zn}var zl=!1,qc=!0;if(typeof w=="string")zl=!0;else if(Array.isArray(w)){var Hc=w.concat();Re=[];for(var ql,yr=Hc.length;yr--;)(typeof(ql=Hc.shift())!="string"||Array.isArray(ql)&&typeof ql[0]!="string")&&(qc=!1);zl=qc}if(zl===!1)throw new Error('Type of text must be string or Array. "'+w+'" is not recognized.');typeof w=="string"&&(w=w.match(/[\r?\n]/)?w.split(/\r\n|\r|\n/g):[w]);var Hl=Ie/Jn.internal.scaleFactor,Vl=Hl*(ga-1);switch(oe.baseline){case"bottom":Z-=Vl;break;case"top":Z+=Hl-Vl;break;case"hanging":Z+=Hl-2*Vl;break;case"middle":Z+=Hl/2-Vl}if((yt=oe.maxWidth||0)>0&&(typeof w=="string"?w=Jn.splitTextToSize(w,yt):Object.prototype.toString.call(w)==="[object Array]"&&(w=w.reduce(function(yn,bn){return yn.concat(Jn.splitTextToSize(bn,yt))},[]))),_e={text:w,x:k,y:Z,options:oe,mutex:{pdfEscape:Jr,activeFontKey:Et,fonts:en,activeFontSize:Ie}},Ft.publish("preProcessText",_e),w=_e.text,Ye=(oe=_e.options).angle,!(Rn instanceof ae)&&Ye&&typeof Ye=="number"){Ye*=Math.PI/180,oe.rotationDirection===0&&(Ye=-Ye),_===y.ADVANCED&&(Ye=-Ye);var Yl=Math.cos(Ye),Vc=Math.sin(Ye);Rn=new ae(Yl,Vc,-Vc,Yl,0,0)}else Ye&&Ye instanceof ae&&(Rn=Ye);_!==y.ADVANCED||Rn||(Rn=De),(xt=oe.charSpace||Bl)!==void 0&&(ur+=O(P(xt))+` Tc
201
+ `,this.setCharSpace(this.getCharSpace()||0)),(On=oe.horizontalScale)!==void 0&&(ur+=O(100*On)+` Tz
202
+ `),oe.lang;var Kr=-1,A0=oe.renderingMode!==void 0?oe.renderingMode:oe.stroke,Yc=Jn.internal.getCurrentPageInfo().pageContext;switch(A0){case 0:case!1:case"fill":Kr=0;break;case 1:case!0:case"stroke":Kr=1;break;case 2:case"fillThenStroke":Kr=2;break;case 3:case"invisible":Kr=3;break;case 4:case"fillAndAddForClipping":Kr=4;break;case 5:case"strokeAndAddPathForClipping":Kr=5;break;case 6:case"fillThenStrokeAndAddToPathForClipping":Kr=6;break;case 7:case"addToPathForClipping":Kr=7}var ch=Yc.usedRenderingMode!==void 0?Yc.usedRenderingMode:-1;Kr!==-1?ur+=Kr+` Tr
203
+ `:ch!==-1&&(ur+=`0 Tr
204
+ `),Kr!==-1&&(Yc.usedRenderingMode=Kr),nt=oe.align||"left";var Ba,Gl=Ie*ga,fh=Jn.internal.pageSize.getWidth(),dh=en[Et];xt=oe.charSpace||Bl,yt=oe.maxWidth||0,$t=Object.assign({autoencode:!0,noBOM:!0},oe.flags);var Us=[],Yo=function(yn){return Jn.getStringUnitWidth(yn,{font:dh,charSpace:xt,fontSize:Ie,doKerning:!1})*Ie/Ci};if(Object.prototype.toString.call(w)==="[object Array]"){var Xr;Re=Uc(w),nt!=="left"&&(Ba=Re.map(Yo));var Fr,zs=0;if(nt==="right"){k-=Ba[0],w=[],yr=Re.length;for(var Ki=0;Ki<yr;Ki++)Ki===0?(Fr=Ei(k),Xr=Ji(Z)):(Fr=P(zs-Ba[Ki]),Xr=-Gl),w.push([Re[Ki],Fr,Xr]),zs=Ba[Ki]}else if(nt==="center"){k-=Ba[0]/2,w=[],yr=Re.length;for(var Xi=0;Xi<yr;Xi++)Xi===0?(Fr=Ei(k),Xr=Ji(Z)):(Fr=P((zs-Ba[Xi])/2),Xr=-Gl),w.push([Re[Xi],Fr,Xr]),zs=Ba[Xi]}else if(nt==="left"){w=[],yr=Re.length;for(var Wl=0;Wl<yr;Wl++)w.push(Re[Wl])}else if(nt==="justify"&&dh.encoding==="Identity-H"){w=[],yr=Re.length,yt=yt!==0?yt:fh;for(var Qi=0,Un=0;Un<yr;Un++)if(Xr=Un===0?Ji(Z):-Gl,Fr=Un===0?Ei(k):Qi,Un<yr-1){var Gc=P((yt-Ba[Un])/(Re[Un].split(" ").length-1)),Br=Re[Un].split(" ");w.push([Br[0]+" ",Fr,Xr]),Qi=0;for(var $a=1;$a<Br.length;$a++){var Jl=(Yo(Br[$a-1]+" "+Br[$a])-Yo(Br[$a]))*Ci+Gc;$a==Br.length-1?w.push([Br[$a],Jl,0]):w.push([Br[$a]+" ",Jl,0]),Qi-=Jl}}else w.push([Re[Un],Fr,Xr]);w.push(["",Qi,0])}else{if(nt!=="justify")throw new Error('Unrecognized alignment option, use "left", "center", "right" or "justify".');for(w=[],yr=Re.length,yt=yt!==0?yt:fh,Un=0;Un<yr;Un++)Xr=Un===0?Ji(Z):-Gl,Fr=Un===0?Ei(k):0,Un<yr-1?Us.push(O(P((yt-Ba[Un])/(Re[Un].split(" ").length-1)))):Us.push(0),w.push([Re[Un],Fr,Xr])}}var hh=typeof oe.R2L=="boolean"?oe.R2L:Qe;hh===!0&&(w=zc(w,function(yn,bn,zn){return[yn.split("").reverse().join(""),bn,zn]})),_e={text:w,x:k,y:Z,options:oe,mutex:{pdfEscape:Jr,activeFontKey:Et,fonts:en,activeFontSize:Ie}},Ft.publish("postProcessText",_e),w=_e.text,ci=_e.mutex.isHex||!1;var Wc=en[Et].encoding;Wc!=="WinAnsiEncoding"&&Wc!=="StandardEncoding"||(w=zc(w,function(yn,bn,zn){return[uh(yn),bn,zn]})),Re=Uc(w),w=[];for(var Go,Wo,qs,Jo=0,Kl=1,Ko=Array.isArray(Re[0])?Kl:Jo,Hs="",Jc=function(yn,bn,zn){var ar="";return zn instanceof ae?(zn=typeof oe.angle=="number"?be(zn,new ae(1,0,0,1,yn,bn)):be(new ae(1,0,0,1,yn,bn),zn),_===y.ADVANCED&&(zn=be(new ae(1,0,0,-1,0,0),zn)),ar=zn.join(" ")+` Tm
205
+ `):ar=O(yn)+" "+O(bn)+` Td
206
+ `,ar},Ua=0;Ua<Re.length;Ua++){switch(Hs="",Ko){case Kl:qs=(ci?"<":"(")+Re[Ua][0]+(ci?">":")"),Go=parseFloat(Re[Ua][1]),Wo=parseFloat(Re[Ua][2]);break;case Jo:qs=(ci?"<":"(")+Re[Ua]+(ci?">":")"),Go=Ei(k),Wo=Ji(Z)}Us!==void 0&&Us[Ua]!==void 0&&(Hs=Us[Ua]+` Tw
207
+ `),Ua===0?w.push(Hs+Jc(Go,Wo,Rn)+qs):Ko===Jo?w.push(Hs+qs):Ko===Kl&&w.push(Hs+Jc(Go,Wo,Rn)+qs)}w=Ko===Jo?w.join(` Tj
208
+ T* `):w.join(` Tj
209
+ `),w+=` Tj
210
+ `;var za=`BT
211
+ /`;return za+=Et+" "+Ie+` Tf
212
+ `,za+=O(Ie*ga)+` TL
213
+ `,za+=Ho+`
214
+ `,za+=ur,za+=w,X(za+="ET"),p[Et]=!0,Jn};var m0=d.__private__.clip=d.clip=function(w){return X(w==="evenodd"?"W*":"W"),this};d.clipEvenOdd=function(){return m0("evenodd")},d.__private__.discardPath=d.discardPath=function(){return X("n"),this};var Ni=d.__private__.isValidStyle=function(w){var k=!1;return[void 0,null,"S","D","F","DF","FD","f","f*","B","B*","n"].indexOf(w)!==-1&&(k=!0),k};d.__private__.setDefaultPathOperation=d.setDefaultPathOperation=function(w){return Ni(w)&&(u=w),this};var th=d.__private__.getStyle=d.getStyle=function(w){var k=u;switch(w){case"D":case"S":k="S";break;case"F":k="f";break;case"FD":case"DF":k="B";break;case"f":case"f*":case"B":case"B*":k=w}return k},nh=d.close=function(){return X("h"),this};d.stroke=function(){return X("S"),this},d.fill=function(w){return Il("f",w),this},d.fillEvenOdd=function(w){return Il("f*",w),this},d.fillStroke=function(w){return Il("B",w),this},d.fillStrokeEvenOdd=function(w){return Il("B*",w),this};var Il=function(w,k){Ut(k)==="object"?v0(k,w):X(w)},Oc=function(w){w===null||_===y.ADVANCED&&w===void 0||(w=th(w),X(w))};function g0(w,k,Z,oe,ge){var _e=new Mu(k||this.boundingBox,Z||this.xStep,oe||this.yStep,this.gState,ge||this.matrix);_e.stream=this.stream;var Re=w+"$$"+this.cloneIndex+++"$$";return ke(Re,_e),_e}var v0=function(w,k){var Z=Ai[w.key],oe=It[Z];if(oe instanceof ol)X("q"),X(y0(k)),oe.gState&&d.setGState(oe.gState),X(w.matrix.toString()+" cm"),X("/"+Z+" sh"),X("Q");else if(oe instanceof Mu){var ge=new ae(1,0,0,-1,0,$s());w.matrix&&(ge=ge.multiply(w.matrix||De),Z=g0.call(oe,w.key,w.boundingBox,w.xStep,w.yStep,ge).id),X("q"),X("/Pattern cs"),X("/"+Z+" scn"),oe.gState&&d.setGState(oe.gState),X(k),X("Q")}},y0=function(w){switch(w){case"f":case"F":return"W n";case"f*":return"W* n";case"B":return"W S";case"B*":return"W* S";case"S":return"W S";case"n":return"W n"}},Dc=d.moveTo=function(w,k){return X(O(P(w))+" "+O(Y(k))+" m"),this},zo=d.lineTo=function(w,k){return X(O(P(w))+" "+O(Y(k))+" l"),this},Fs=d.curveTo=function(w,k,Z,oe,ge,_e){return X([O(P(w)),O(Y(k)),O(P(Z)),O(Y(oe)),O(P(ge)),O(Y(_e)),"c"].join(" ")),this};d.__private__.line=d.line=function(w,k,Z,oe,ge){if(isNaN(w)||isNaN(k)||isNaN(Z)||isNaN(oe)||!Ni(ge))throw new Error("Invalid arguments passed to jsPDF.line");return _===y.COMPAT?this.lines([[Z-w,oe-k]],w,k,[1,1],ge||"S"):this.lines([[Z-w,oe-k]],w,k,[1,1]).stroke()},d.__private__.lines=d.lines=function(w,k,Z,oe,ge,_e){var Re,Ye,nt,xt,yt,$t,On,Rn,Jn,jr,ur,ci;if(typeof w=="number"&&(ci=Z,Z=k,k=w,w=ci),oe=oe||[1,1],_e=_e||!1,isNaN(k)||isNaN(Z)||!Array.isArray(w)||!Array.isArray(oe)||!Ni(ge)||typeof _e!="boolean")throw new Error("Invalid arguments passed to jsPDF.lines");for(Dc(k,Z),Re=oe[0],Ye=oe[1],xt=w.length,jr=k,ur=Z,nt=0;nt<xt;nt++)(yt=w[nt]).length===2?(jr=yt[0]*Re+jr,ur=yt[1]*Ye+ur,zo(jr,ur)):($t=yt[0]*Re+jr,On=yt[1]*Ye+ur,Rn=yt[2]*Re+jr,Jn=yt[3]*Ye+ur,jr=yt[4]*Re+jr,ur=yt[5]*Ye+ur,Fs($t,On,Rn,Jn,jr,ur));return _e&&nh(),Oc(ge),this},d.path=function(w){for(var k=0;k<w.length;k++){var Z=w[k],oe=Z.c;switch(Z.op){case"m":Dc(oe[0],oe[1]);break;case"l":zo(oe[0],oe[1]);break;case"c":Fs.apply(this,oe);break;case"h":nh()}}return this},d.__private__.rect=d.rect=function(w,k,Z,oe,ge){if(isNaN(w)||isNaN(k)||isNaN(Z)||isNaN(oe)||!Ni(ge))throw new Error("Invalid arguments passed to jsPDF.rect");return _===y.COMPAT&&(oe=-oe),X([O(P(w)),O(Y(k)),O(P(Z)),O(P(oe)),"re"].join(" ")),Oc(ge),this},d.__private__.triangle=d.triangle=function(w,k,Z,oe,ge,_e,Re){if(isNaN(w)||isNaN(k)||isNaN(Z)||isNaN(oe)||isNaN(ge)||isNaN(_e)||!Ni(Re))throw new Error("Invalid arguments passed to jsPDF.triangle");return this.lines([[Z-w,oe-k],[ge-Z,_e-oe],[w-ge,k-_e]],w,k,[1,1],Re,!0),this},d.__private__.roundedRect=d.roundedRect=function(w,k,Z,oe,ge,_e,Re){if(isNaN(w)||isNaN(k)||isNaN(Z)||isNaN(oe)||isNaN(ge)||isNaN(_e)||!Ni(Re))throw new Error("Invalid arguments passed to jsPDF.roundedRect");var Ye=4/3*(Math.SQRT2-1);return ge=Math.min(ge,.5*Z),_e=Math.min(_e,.5*oe),this.lines([[Z-2*ge,0],[ge*Ye,0,ge,_e-_e*Ye,ge,_e],[0,oe-2*_e],[0,_e*Ye,-ge*Ye,_e,-ge,_e],[2*ge-Z,0],[-ge*Ye,0,-ge,-_e*Ye,-ge,-_e],[0,2*_e-oe],[0,-_e*Ye,ge*Ye,-_e,ge,-_e]],w+ge,k,[1,1],Re,!0),this},d.__private__.ellipse=d.ellipse=function(w,k,Z,oe,ge){if(isNaN(w)||isNaN(k)||isNaN(Z)||isNaN(oe)||!Ni(ge))throw new Error("Invalid arguments passed to jsPDF.ellipse");var _e=4/3*(Math.SQRT2-1)*Z,Re=4/3*(Math.SQRT2-1)*oe;return Dc(w+Z,k),Fs(w+Z,k-Re,w+_e,k-oe,w,k-oe),Fs(w-_e,k-oe,w-Z,k-Re,w-Z,k),Fs(w-Z,k+Re,w-_e,k+oe,w,k+oe),Fs(w+_e,k+oe,w+Z,k+Re,w+Z,k),Oc(ge),this},d.__private__.circle=d.circle=function(w,k,Z,oe){if(isNaN(w)||isNaN(k)||isNaN(Z)||!Ni(oe))throw new Error("Invalid arguments passed to jsPDF.circle");return this.ellipse(w,k,Z,Z,oe)},d.setFont=function(w,k,Z){return Z&&(k=R(k,Z)),Et=Qd(w,k,{disableWarning:!1}),this};var b0=d.__private__.getFont=d.getFont=function(){return en[Qd.apply(d,arguments)]};d.__private__.getFontList=d.getFontList=function(){var w,k,Z={};for(w in pn)if(pn.hasOwnProperty(w))for(k in Z[w]=[],pn[w])pn[w].hasOwnProperty(k)&&Z[w].push(k);return Z},d.addFont=function(w,k,Z,oe,ge){var _e=["StandardEncoding","MacRomanEncoding","Identity-H","WinAnsiEncoding"];return arguments[3]&&_e.indexOf(arguments[3])!==-1?ge=arguments[3]:arguments[3]&&_e.indexOf(arguments[3])==-1&&(Z=R(Z,oe)),ge=ge||"Identity-H",Lc.call(this,w,k,Z,ge)};var qo,Rc=e.lineWidth||.200025,Fl=d.__private__.getLineWidth=d.getLineWidth=function(){return Rc},rh=d.__private__.setLineWidth=d.setLineWidth=function(w){return Rc=w,X(O(P(w))+" w"),this};d.__private__.setLineDash=lt.API.setLineDash=lt.API.setLineDashPattern=function(w,k){if(w=w||[],k=k||0,isNaN(k)||!Array.isArray(w))throw new Error("Invalid arguments passed to jsPDF.setLineDash");return w=w.map(function(Z){return O(P(Z))}).join(" "),k=O(P(k)),X("["+w+"] "+k+" d"),this};var ah=d.__private__.getLineHeight=d.getLineHeight=function(){return Ie*qo};d.__private__.getLineHeight=d.getLineHeight=function(){return Ie*qo};var ih=d.__private__.setLineHeightFactor=d.setLineHeightFactor=function(w){return typeof(w=w||1.15)=="number"&&(qo=w),this},sh=d.__private__.getLineHeightFactor=d.getLineHeightFactor=function(){return qo};ih(e.lineHeight);var Ei=d.__private__.getHorizontalCoordinate=function(w){return P(w)},Ji=d.__private__.getVerticalCoordinate=function(w){return _===y.ADVANCED?w:pt[z].mediaBox.topRightY-pt[z].mediaBox.bottomLeftY-P(w)},w0=d.__private__.getHorizontalCoordinateString=d.getHorizontalCoordinateString=function(w){return O(Ei(w))},Bs=d.__private__.getVerticalCoordinateString=d.getVerticalCoordinateString=function(w){return O(Ji(w))},ui=e.strokeColor||"0 G";d.__private__.getStrokeColor=d.getDrawColor=function(){return Je(ui)},d.__private__.setStrokeColor=d.setDrawColor=function(w,k,Z,oe){return ui=at({ch1:w,ch2:k,ch3:Z,ch4:oe,pdfColorType:"draw",precision:2}),X(ui),this};var Mc=e.fillColor||"0 g";d.__private__.getFillColor=d.getFillColor=function(){return Je(Mc)},d.__private__.setFillColor=d.setFillColor=function(w,k,Z,oe){return Mc=at({ch1:w,ch2:k,ch3:Z,ch4:oe,pdfColorType:"fill",precision:2}),X(Mc),this};var Ho=e.textColor||"0 g",x0=d.__private__.getTextColor=d.getTextColor=function(){return Je(Ho)};d.__private__.setTextColor=d.setTextColor=function(w,k,Z,oe){return Ho=at({ch1:w,ch2:k,ch3:Z,ch4:oe,pdfColorType:"text",precision:3}),this};var Bl=e.charSpace,S0=d.__private__.getCharSpace=d.getCharSpace=function(){return parseFloat(Bl||0)};d.__private__.setCharSpace=d.setCharSpace=function(w){if(isNaN(w))throw new Error("Invalid argument passed to jsPDF.setCharSpace");return Bl=w,this};var kc=0;d.CapJoinStyles={0:0,butt:0,but:0,miter:0,1:1,round:1,rounded:1,circle:1,2:2,projecting:2,project:2,square:2,bevel:2},d.__private__.setLineCap=d.setLineCap=function(w){var k=d.CapJoinStyles[w];if(k===void 0)throw new Error("Line cap style of '"+w+"' is not recognized. See or extend .CapJoinStyles property for valid styles");return kc=k,X(k+" J"),this};var Pc=0;d.__private__.setLineJoin=d.setLineJoin=function(w){var k=d.CapJoinStyles[w];if(k===void 0)throw new Error("Line join style of '"+w+"' is not recognized. See or extend .CapJoinStyles property for valid styles");return Pc=k,X(k+" j"),this},d.__private__.setLineMiterLimit=d.__private__.setMiterLimit=d.setLineMiterLimit=d.setMiterLimit=function(w){if(w=w||0,isNaN(w))throw new Error("Invalid argument passed to jsPDF.setLineMiterLimit");return X(O(P(w))+" M"),this},d.GState=Gm,d.setGState=function(w){(w=typeof w=="string"?mn[ma[w]]:oh(null,w)).equals(ka)||(X("/"+w.id+" gs"),ka=w)};var oh=function(w,k){if(!w||!ma[w]){var Z=!1;for(var oe in mn)if(mn.hasOwnProperty(oe)&&mn[oe].equals(k)){Z=!0;break}if(Z)k=mn[oe];else{var ge="GS"+(Object.keys(mn).length+1).toString(10);mn[ge]=k,k.id=ge}return w&&(ma[w]=k.id),Ft.publish("addGState",k),k}};d.addGState=function(w,k){return oh(w,k),this},d.saveGraphicsState=function(){return X("q"),pa.push({key:Et,size:Ie,color:Ho}),this},d.restoreGraphicsState=function(){X("Q");var w=pa.pop();return Et=w.key,Ie=w.size,Ho=w.color,ka=null,this},d.setCurrentTransformationMatrix=function(w){return X(w.toString()+" cm"),this},d.comment=function(w){return X("#"+w),this};var $l=function(w,k){var Z=w||0;Object.defineProperty(this,"x",{enumerable:!0,get:function(){return Z},set:function(_e){isNaN(_e)||(Z=parseFloat(_e))}});var oe=k||0;Object.defineProperty(this,"y",{enumerable:!0,get:function(){return oe},set:function(_e){isNaN(_e)||(oe=parseFloat(_e))}});var ge="pt";return Object.defineProperty(this,"type",{enumerable:!0,get:function(){return ge},set:function(_e){ge=_e.toString()}}),this},Ic=function(w,k,Z,oe){$l.call(this,w,k),this.type="rect";var ge=Z||0;Object.defineProperty(this,"w",{enumerable:!0,get:function(){return ge},set:function(Re){isNaN(Re)||(ge=parseFloat(Re))}});var _e=oe||0;return Object.defineProperty(this,"h",{enumerable:!0,get:function(){return _e},set:function(Re){isNaN(Re)||(_e=parseFloat(Re))}}),this},Fc=function(){this.page=Ln,this.currentPage=z,this.pages=we.slice(0),this.pagesContext=pt.slice(0),this.x=hn,this.y=Pt,this.matrix=Yr,this.width=Vo(z),this.height=$s(z),this.outputDestination=Ae,this.id="",this.objectNumber=-1};Fc.prototype.restore=function(){Ln=this.page,z=this.currentPage,pt=this.pagesContext,we=this.pages,hn=this.x,Pt=this.y,Yr=this.matrix,Bc(z,this.width),$c(z,this.height),Ae=this.outputDestination};var lh=function(w,k,Z,oe,ge){re.push(new Fc),Ln=z=0,we=[],hn=w,Pt=k,Yr=ge,jc([Z,oe])},_0=function(w){if(Ia[w])re.pop().restore();else{var k=new Fc,Z="Xo"+(Object.keys(rr).length+1).toString(10);k.id=Z,Ia[w]=Z,rr[Z]=k,Ft.publish("addFormObject",k),re.pop().restore()}};for(var Ul in d.beginFormObject=function(w,k,Z,oe,ge){return lh(w,k,Z,oe,ge),this},d.endFormObject=function(w){return _0(w),this},d.doFormObject=function(w,k){var Z=rr[Ia[w]];return X("q"),X(k.toString()+" cm"),X("/"+Z.id+" Do"),X("Q"),this},d.getFormObject=function(w){var k=rr[Ia[w]];return{x:k.x,y:k.y,width:k.width,height:k.height,matrix:k.matrix}},d.save=function(w,k){return w=w||"generated.pdf",(k=k||{}).returnPromise=k.returnPromise||!1,k.returnPromise===!1?(il(kl(Wi()),w),typeof il.unload=="function"&&ct.setTimeout&&setTimeout(il.unload,911),this):new Promise(function(Z,oe){try{var ge=il(kl(Wi()),w);typeof il.unload=="function"&&ct.setTimeout&&setTimeout(il.unload,911),Z(ge)}catch(_e){oe(_e.message)}})},lt.API)lt.API.hasOwnProperty(Ul)&&(Ul==="events"&&lt.API.events.length?function(w,k){var Z,oe,ge;for(ge=k.length-1;ge!==-1;ge--)Z=k[ge][0],oe=k[ge][1],w.subscribe.apply(w,[Z].concat(typeof oe=="function"?[oe]:oe))}(Ft,lt.API.events):d[Ul]=lt.API[Ul]);var Vo=d.getPageWidth=function(w){return(pt[w=w||z].mediaBox.topRightX-pt[w].mediaBox.bottomLeftX)/He},Bc=d.setPageWidth=function(w,k){pt[w].mediaBox.topRightX=k*He+pt[w].mediaBox.bottomLeftX},$s=d.getPageHeight=function(w){return(pt[w=w||z].mediaBox.topRightY-pt[w].mediaBox.bottomLeftY)/He},$c=d.setPageHeight=function(w,k){pt[w].mediaBox.topRightY=k*He+pt[w].mediaBox.bottomLeftY};return d.internal={pdfEscape:Jr,getStyle:th,getFont:b0,getFontSize:Fe,getCharSpace:S0,getTextColor:x0,getLineHeight:ah,getLineHeightFactor:sh,getLineWidth:Fl,write:Ge,getHorizontalCoordinate:Ei,getVerticalCoordinate:Ji,getCoordinateString:w0,getVerticalCoordinateString:Bs,collections:{},newObject:$e,newAdditionalObject:Ze,newObjectDeferred:Ue,newObjectDeferredBegin:Ve,getFilters:Tt,putStream:Yt,events:Ft,scaleFactor:He,pageSize:{getWidth:function(){return Vo(z)},setWidth:function(w){Bc(z,w)},getHeight:function(){return $s(z)},setHeight:function(w){$c(z,w)}},encryptionOptions:c,encryption:Lr,getEncryptor:h0,output:Pl,getNumberOfPages:l0,pages:we,out:X,f2:V,f3:T,getPageInfo:eh,getPageInfoByObjId:vt,getCurrentPageInfo:p0,getPDFVersion:S,Point:$l,Rectangle:Ic,Matrix:ae,hasHotfix:Zd},Object.defineProperty(d.internal.pageSize,"width",{get:function(){return Vo(z)},set:function(w){Bc(z,w)},enumerable:!0,configurable:!0}),Object.defineProperty(d.internal.pageSize,"height",{get:function(){return $s(z)},set:function(w){$c(z,w)},enumerable:!0,configurable:!0}),s0.call(d,Te),Et="F1",Kd(a,n),Ft.publish("initialized"),d}wu.prototype.lsbFirstWord=function(e){return String.fromCharCode(e>>0&255,e>>8&255,e>>16&255,e>>24&255)},wu.prototype.toHexString=function(e){return e.split("").map(function(t){return("0"+(255&t.charCodeAt(0)).toString(16)).slice(-2)}).join("")},wu.prototype.hexToBytes=function(e){for(var t=[],n=0;n<e.length;n+=2)t.push(String.fromCharCode(parseInt(e.substr(n,2),16)));return t.join("")},wu.prototype.processOwnerPassword=function(e,t){return fy(cy(t).substr(0,5),e)},wu.prototype.encryptor=function(e,t){var n=cy(this.encryptionKey+String.fromCharCode(255&e,e>>8&255,e>>16&255,255&t,t>>8&255)).substr(0,10);return function(r){return fy(n,r)}},Gm.prototype.equals=function(e){var t,n="id,objectNumber,equals";if(!e||Ut(e)!==Ut(this))return!1;var r=0;for(t in this)if(!(n.indexOf(t)>=0)){if(this.hasOwnProperty(t)&&!e.hasOwnProperty(t)||this[t]!==e[t])return!1;r++}for(t in e)e.hasOwnProperty(t)&&n.indexOf(t)<0&&r--;return r===0},lt.API={events:[]},lt.version="3.0.1";var Pn=lt.API,tb=1,Dl=function(e){return e.replace(/\\/g,"\\\\").replace(/\(/g,"\\(").replace(/\)/g,"\\)")},hu=function(e){return e.replace(/\\\\/g,"\\").replace(/\\\(/g,"(").replace(/\\\)/g,")")},bt=function(e){return e.toFixed(2)},to=function(e){return e.toFixed(5)};Pn.__acroform__={};var ha=function(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e},g3=function(e){return e*tb},Ti=function(e){var t=new VE,n=Xe.internal.getHeight(e)||0,r=Xe.internal.getWidth(e)||0;return t.BBox=[0,0,Number(bt(r)),Number(bt(n))],t},Yq=Pn.__acroform__.setBit=function(e,t){if(e=e||0,t=t||0,isNaN(e)||isNaN(t))throw new Error("Invalid arguments passed to jsPDF.API.__acroform__.setBit");return e|=1<<t},Gq=Pn.__acroform__.clearBit=function(e,t){if(e=e||0,t=t||0,isNaN(e)||isNaN(t))throw new Error("Invalid arguments passed to jsPDF.API.__acroform__.clearBit");return e&=~(1<<t)},Wq=Pn.__acroform__.getBit=function(e,t){if(isNaN(e)||isNaN(t))throw new Error("Invalid arguments passed to jsPDF.API.__acroform__.getBit");return e&1<<t?1:0},qn=Pn.__acroform__.getBitForPdf=function(e,t){if(isNaN(e)||isNaN(t))throw new Error("Invalid arguments passed to jsPDF.API.__acroform__.getBitForPdf");return Wq(e,t-1)},Hn=Pn.__acroform__.setBitForPdf=function(e,t){if(isNaN(e)||isNaN(t))throw new Error("Invalid arguments passed to jsPDF.API.__acroform__.setBitForPdf");return Yq(e,t-1)},Vn=Pn.__acroform__.clearBitForPdf=function(e,t){if(isNaN(e)||isNaN(t))throw new Error("Invalid arguments passed to jsPDF.API.__acroform__.clearBitForPdf");return Gq(e,t-1)},Jq=Pn.__acroform__.calculateCoordinates=function(e,t){var n=t.internal.getHorizontalCoordinate,r=t.internal.getVerticalCoordinate,a=e[0],i=e[1],s=e[2],o=e[3],l={};return l.lowerLeft_X=n(a)||0,l.lowerLeft_Y=r(i+o)||0,l.upperRight_X=n(a+s)||0,l.upperRight_Y=r(i)||0,[Number(bt(l.lowerLeft_X)),Number(bt(l.lowerLeft_Y)),Number(bt(l.upperRight_X)),Number(bt(l.upperRight_Y))]},Kq=function(e){if(e.appearanceStreamContent)return e.appearanceStreamContent;if(e.V||e.DV){var t=[],n=e._V||e.DV,r=dy(e,n),a=e.scope.internal.getFont(e.fontName,e.fontStyle).id;t.push("/Tx BMC"),t.push("q"),t.push("BT"),t.push(e.scope.__private__.encodeColorString(e.color)),t.push("/"+a+" "+bt(r.fontSize)+" Tf"),t.push("1 0 0 1 0 0 Tm"),t.push(r.text),t.push("ET"),t.push("Q"),t.push("EMC");var i=Ti(e);return i.scope=e.scope,i.stream=t.join(`
215
+ `),i}},dy=function(e,t){var n=e.fontSize===0?e.maxFontSize:e.fontSize,r={text:"",fontSize:""},a=(t=(t=t.substr(0,1)=="("?t.substr(1):t).substr(t.length-1)==")"?t.substr(0,t.length-1):t).split(" ");a=e.multiline?a.map(function(T){return T.split(`
216
+ `)}):a.map(function(T){return[T]});var i=n,s=Xe.internal.getHeight(e)||0;s=s<0?-s:s;var o=Xe.internal.getWidth(e)||0;o=o<0?-o:o;var l=function(T,P,q){if(T+1<a.length){var Y=P+" "+a[T+1][0];return mp(Y,e,q).width<=o-4}return!1};i++;e:for(;i>0;){t="",i--;var u,c,f=mp("3",e,i).height,p=e.multiline?s-i:(s-f)/2,d=p+=2,v=0,S=0,x=0;if(i<=0){t=`(...) Tj
217
+ `,t+="% Width of Text: "+mp(t,e,i=12).width+", FieldWidth:"+o+`
218
+ `;break}for(var g="",y=0,_=0;_<a.length;_++)if(a.hasOwnProperty(_)){var E=!1;if(a[_].length!==1&&x!==a[_].length-1){if((f+2)*(y+2)+2>s)continue e;g+=a[_][x],E=!0,S=_,_--}else{g=(g+=a[_][x]+" ").substr(g.length-1)==" "?g.substr(0,g.length-1):g;var D=parseInt(_),R=l(D,g,i),O=_>=a.length-1;if(R&&!O){g+=" ",x=0;continue}if(R||O){if(O)S=D;else if(e.multiline&&(f+2)*(y+2)+2>s)continue e}else{if(!e.multiline||(f+2)*(y+2)+2>s)continue e;S=D}}for(var j="",$=v;$<=S;$++){var V=a[$];if(e.multiline){if($===S){j+=V[x]+" ",x=(x+1)%V.length;continue}if($===v){j+=V[V.length-1]+" ";continue}}j+=V[0]+" "}switch(j=j.substr(j.length-1)==" "?j.substr(0,j.length-1):j,c=mp(j,e,i).width,e.textAlign){case"right":u=o-c-2;break;case"center":u=(o-c)/2;break;case"left":default:u=2}t+=bt(u)+" "+bt(d)+` Td
219
+ `,t+="("+Dl(j)+`) Tj
220
+ `,t+=-bt(u)+` 0 Td
221
+ `,d=-(i+2),c=0,v=E?S:S+1,y++,g=""}break}return r.text=t,r.fontSize=i,r},mp=function(e,t,n){var r=t.scope.internal.getFont(t.fontName,t.fontStyle),a=t.scope.getStringUnitWidth(e,{font:r,fontSize:parseFloat(n),charSpace:0})*parseFloat(n);return{height:t.scope.getStringUnitWidth("3",{font:r,fontSize:parseFloat(n),charSpace:0})*parseFloat(n)*1.5,width:a}},Xq={fields:[],xForms:[],acroFormDictionaryRoot:null,printedOut:!1,internal:null,isInitialized:!1},Qq=function(e,t){var n={type:"reference",object:e};t.internal.getPageInfo(e.page).pageContext.annotations.find(function(r){return r.type===n.type&&r.object===n.object})===void 0&&t.internal.getPageInfo(e.page).pageContext.annotations.push(n)},Zq=function(e,t){for(var n in e)if(e.hasOwnProperty(n)){var r=n,a=e[n];t.internal.newObjectDeferredBegin(a.objId,!0),Ut(a)==="object"&&typeof a.putStream=="function"&&a.putStream(),delete e[r]}},eH=function(e,t){if(t.scope=e,e.internal!==void 0&&(e.internal.acroformPlugin===void 0||e.internal.acroformPlugin.isInitialized===!1)){if(Si.FieldNum=0,e.internal.acroformPlugin=JSON.parse(JSON.stringify(Xq)),e.internal.acroformPlugin.acroFormDictionaryRoot)throw new Error("Exception while creating AcroformDictionary");tb=e.internal.scaleFactor,e.internal.acroformPlugin.acroFormDictionaryRoot=new YE,e.internal.acroformPlugin.acroFormDictionaryRoot.scope=e,e.internal.acroformPlugin.acroFormDictionaryRoot._eventID=e.internal.events.subscribe("postPutResources",function(){(function(n){n.internal.events.unsubscribe(n.internal.acroformPlugin.acroFormDictionaryRoot._eventID),delete n.internal.acroformPlugin.acroFormDictionaryRoot._eventID,n.internal.acroformPlugin.printedOut=!0})(e)}),e.internal.events.subscribe("buildDocument",function(){(function(n){n.internal.acroformPlugin.acroFormDictionaryRoot.objId=void 0;var r=n.internal.acroformPlugin.acroFormDictionaryRoot.Fields;for(var a in r)if(r.hasOwnProperty(a)){var i=r[a];i.objId=void 0,i.hasAnnotation&&Qq(i,n)}})(e)}),e.internal.events.subscribe("putCatalog",function(){(function(n){if(n.internal.acroformPlugin.acroFormDictionaryRoot===void 0)throw new Error("putCatalogCallback: Root missing.");n.internal.write("/AcroForm "+n.internal.acroformPlugin.acroFormDictionaryRoot.objId+" 0 R")})(e)}),e.internal.events.subscribe("postPutPages",function(n){(function(r,a){var i=!r;for(var s in r||(a.internal.newObjectDeferredBegin(a.internal.acroformPlugin.acroFormDictionaryRoot.objId,!0),a.internal.acroformPlugin.acroFormDictionaryRoot.putStream()),r=r||a.internal.acroformPlugin.acroFormDictionaryRoot.Kids)if(r.hasOwnProperty(s)){var o=r[s],l=[],u=o.Rect;if(o.Rect&&(o.Rect=Jq(o.Rect,a)),a.internal.newObjectDeferredBegin(o.objId,!0),o.DA=Xe.createDefaultAppearanceStream(o),Ut(o)==="object"&&typeof o.getKeyValueListForStream=="function"&&(l=o.getKeyValueListForStream()),o.Rect=u,o.hasAppearanceStream&&!o.appearanceStreamContent){var c=Kq(o);l.push({key:"AP",value:"<</N "+c+">>"}),a.internal.acroformPlugin.xForms.push(c)}if(o.appearanceStreamContent){var f="";for(var p in o.appearanceStreamContent)if(o.appearanceStreamContent.hasOwnProperty(p)){var d=o.appearanceStreamContent[p];if(f+="/"+p+" ",f+="<<",Object.keys(d).length>=1||Array.isArray(d)){for(var s in d)if(d.hasOwnProperty(s)){var v=d[s];typeof v=="function"&&(v=v.call(a,o)),f+="/"+s+" "+v+" ",a.internal.acroformPlugin.xForms.indexOf(v)>=0||a.internal.acroformPlugin.xForms.push(v)}}else typeof(v=d)=="function"&&(v=v.call(a,o)),f+="/"+s+" "+v,a.internal.acroformPlugin.xForms.indexOf(v)>=0||a.internal.acroformPlugin.xForms.push(v);f+=">>"}l.push({key:"AP",value:`<<
222
+ `+f+">>"})}a.internal.putStream({additionalKeyValues:l,objectId:o.objId}),a.internal.out("endobj")}i&&Zq(a.internal.acroformPlugin.xForms,a)})(n,e)}),e.internal.acroformPlugin.isInitialized=!0}},HE=Pn.__acroform__.arrayToPdfArray=function(e,t,n){var r=function(s){return s};if(Array.isArray(e)){for(var a="[",i=0;i<e.length;i++)switch(i!==0&&(a+=" "),Ut(e[i])){case"boolean":case"number":case"object":a+=e[i].toString();break;case"string":e[i].substr(0,1)!=="/"?(t!==void 0&&n&&(r=n.internal.getEncryptor(t)),a+="("+Dl(r(e[i].toString()))+")"):a+=e[i].toString()}return a+="]"}throw new Error("Invalid argument passed to jsPDF.__acroform__.arrayToPdfArray")},n2=function(e,t,n){var r=function(a){return a};return t!==void 0&&n&&(r=n.internal.getEncryptor(t)),(e=e||"").toString(),e="("+Dl(r(e))+")"},Ii=function(){this._objId=void 0,this._scope=void 0,Object.defineProperty(this,"objId",{get:function(){if(this._objId===void 0){if(this.scope===void 0)return;this._objId=this.scope.internal.newObjectDeferred()}return this._objId},set:function(e){this._objId=e}}),Object.defineProperty(this,"scope",{value:this._scope,writable:!0})};Ii.prototype.toString=function(){return this.objId+" 0 R"},Ii.prototype.putStream=function(){var e=this.getKeyValueListForStream();this.scope.internal.putStream({data:this.stream,additionalKeyValues:e,objectId:this.objId}),this.scope.internal.out("endobj")},Ii.prototype.getKeyValueListForStream=function(){var e=[],t=Object.getOwnPropertyNames(this).filter(function(i){return i!="content"&&i!="appearanceStreamContent"&&i!="scope"&&i!="objId"&&i.substring(0,1)!="_"});for(var n in t)if(Object.getOwnPropertyDescriptor(this,t[n]).configurable===!1){var r=t[n],a=this[r];a&&(Array.isArray(a)?e.push({key:r,value:HE(a,this.objId,this.scope)}):a instanceof Ii?(a.scope=this.scope,e.push({key:r,value:a.objId+" 0 R"})):typeof a!="function"&&e.push({key:r,value:a}))}return e};var VE=function(){Ii.call(this),Object.defineProperty(this,"Type",{value:"/XObject",configurable:!1,writable:!0}),Object.defineProperty(this,"Subtype",{value:"/Form",configurable:!1,writable:!0}),Object.defineProperty(this,"FormType",{value:1,configurable:!1,writable:!0});var e,t=[];Object.defineProperty(this,"BBox",{configurable:!1,get:function(){return t},set:function(n){t=n}}),Object.defineProperty(this,"Resources",{value:"2 0 R",configurable:!1,writable:!0}),Object.defineProperty(this,"stream",{enumerable:!1,configurable:!0,set:function(n){e=n.trim()},get:function(){return e||null}})};ha(VE,Ii);var YE=function(){Ii.call(this);var e,t=[];Object.defineProperty(this,"Kids",{enumerable:!1,configurable:!0,get:function(){return t.length>0?t:void 0}}),Object.defineProperty(this,"Fields",{enumerable:!1,configurable:!1,get:function(){return t}}),Object.defineProperty(this,"DA",{enumerable:!1,configurable:!1,get:function(){if(e){var n=function(r){return r};return this.scope&&(n=this.scope.internal.getEncryptor(this.objId)),"("+Dl(n(e))+")"}},set:function(n){e=n}})};ha(YE,Ii);var Si=function e(){Ii.call(this);var t=4;Object.defineProperty(this,"F",{enumerable:!1,configurable:!1,get:function(){return t},set:function(g){if(isNaN(g))throw new Error('Invalid value "'+g+'" for attribute F supplied.');t=g}}),Object.defineProperty(this,"showWhenPrinted",{enumerable:!0,configurable:!0,get:function(){return!!qn(t,3)},set:function(g){g?this.F=Hn(t,3):this.F=Vn(t,3)}});var n=0;Object.defineProperty(this,"Ff",{enumerable:!1,configurable:!1,get:function(){return n},set:function(g){if(isNaN(g))throw new Error('Invalid value "'+g+'" for attribute Ff supplied.');n=g}});var r=[];Object.defineProperty(this,"Rect",{enumerable:!1,configurable:!1,get:function(){if(r.length!==0)return r},set:function(g){r=g!==void 0?g:[]}}),Object.defineProperty(this,"x",{enumerable:!0,configurable:!0,get:function(){return!r||isNaN(r[0])?0:r[0]},set:function(g){r[0]=g}}),Object.defineProperty(this,"y",{enumerable:!0,configurable:!0,get:function(){return!r||isNaN(r[1])?0:r[1]},set:function(g){r[1]=g}}),Object.defineProperty(this,"width",{enumerable:!0,configurable:!0,get:function(){return!r||isNaN(r[2])?0:r[2]},set:function(g){r[2]=g}}),Object.defineProperty(this,"height",{enumerable:!0,configurable:!0,get:function(){return!r||isNaN(r[3])?0:r[3]},set:function(g){r[3]=g}});var a="";Object.defineProperty(this,"FT",{enumerable:!0,configurable:!1,get:function(){return a},set:function(g){switch(g){case"/Btn":case"/Tx":case"/Ch":case"/Sig":a=g;break;default:throw new Error('Invalid value "'+g+'" for attribute FT supplied.')}}});var i=null;Object.defineProperty(this,"T",{enumerable:!0,configurable:!1,get:function(){if(!i||i.length<1){if(this instanceof Wm)return;i="FieldObject"+e.FieldNum++}var g=function(y){return y};return this.scope&&(g=this.scope.internal.getEncryptor(this.objId)),"("+Dl(g(i))+")"},set:function(g){i=g.toString()}}),Object.defineProperty(this,"fieldName",{configurable:!0,enumerable:!0,get:function(){return i},set:function(g){i=g}});var s="helvetica";Object.defineProperty(this,"fontName",{enumerable:!0,configurable:!0,get:function(){return s},set:function(g){s=g}});var o="normal";Object.defineProperty(this,"fontStyle",{enumerable:!0,configurable:!0,get:function(){return o},set:function(g){o=g}});var l=0;Object.defineProperty(this,"fontSize",{enumerable:!0,configurable:!0,get:function(){return l},set:function(g){l=g}});var u=void 0;Object.defineProperty(this,"maxFontSize",{enumerable:!0,configurable:!0,get:function(){return u===void 0?50/tb:u},set:function(g){u=g}});var c="black";Object.defineProperty(this,"color",{enumerable:!0,configurable:!0,get:function(){return c},set:function(g){c=g}});var f="/F1 0 Tf 0 g";Object.defineProperty(this,"DA",{enumerable:!0,configurable:!1,get:function(){if(!(!f||this instanceof Wm||this instanceof yl))return n2(f,this.objId,this.scope)},set:function(g){g=g.toString(),f=g}});var p=null;Object.defineProperty(this,"DV",{enumerable:!1,configurable:!1,get:function(){if(p)return this instanceof pr?p:n2(p,this.objId,this.scope)},set:function(g){g=g.toString(),p=this instanceof pr?g:g.substr(0,1)==="("?hu(g.substr(1,g.length-2)):hu(g)}}),Object.defineProperty(this,"defaultValue",{enumerable:!0,configurable:!0,get:function(){return this instanceof pr?hu(p.substr(1,p.length-1)):p},set:function(g){g=g.toString(),p=this instanceof pr?"/"+g:g}});var d=null;Object.defineProperty(this,"_V",{enumerable:!1,configurable:!1,get:function(){if(d)return d},set:function(g){this.V=g}}),Object.defineProperty(this,"V",{enumerable:!1,configurable:!1,get:function(){if(d)return this instanceof pr?d:n2(d,this.objId,this.scope)},set:function(g){g=g.toString(),d=this instanceof pr?g:g.substr(0,1)==="("?hu(g.substr(1,g.length-2)):hu(g)}}),Object.defineProperty(this,"value",{enumerable:!0,configurable:!0,get:function(){return this instanceof pr?hu(d.substr(1,d.length-1)):d},set:function(g){g=g.toString(),d=this instanceof pr?"/"+g:g}}),Object.defineProperty(this,"hasAnnotation",{enumerable:!0,configurable:!0,get:function(){return this.Rect}}),Object.defineProperty(this,"Type",{enumerable:!0,configurable:!1,get:function(){return this.hasAnnotation?"/Annot":null}}),Object.defineProperty(this,"Subtype",{enumerable:!0,configurable:!1,get:function(){return this.hasAnnotation?"/Widget":null}});var v,S=!1;Object.defineProperty(this,"hasAppearanceStream",{enumerable:!0,configurable:!0,get:function(){return S},set:function(g){g=!!g,S=g}}),Object.defineProperty(this,"page",{enumerable:!0,configurable:!0,get:function(){if(v)return v},set:function(g){v=g}}),Object.defineProperty(this,"readOnly",{enumerable:!0,configurable:!0,get:function(){return!!qn(this.Ff,1)},set:function(g){g?this.Ff=Hn(this.Ff,1):this.Ff=Vn(this.Ff,1)}}),Object.defineProperty(this,"required",{enumerable:!0,configurable:!0,get:function(){return!!qn(this.Ff,2)},set:function(g){g?this.Ff=Hn(this.Ff,2):this.Ff=Vn(this.Ff,2)}}),Object.defineProperty(this,"noExport",{enumerable:!0,configurable:!0,get:function(){return!!qn(this.Ff,3)},set:function(g){g?this.Ff=Hn(this.Ff,3):this.Ff=Vn(this.Ff,3)}});var x=null;Object.defineProperty(this,"Q",{enumerable:!0,configurable:!1,get:function(){if(x!==null)return x},set:function(g){if([0,1,2].indexOf(g)===-1)throw new Error('Invalid value "'+g+'" for attribute Q supplied.');x=g}}),Object.defineProperty(this,"textAlign",{get:function(){var g;switch(x){case 0:default:g="left";break;case 1:g="center";break;case 2:g="right"}return g},configurable:!0,enumerable:!0,set:function(g){switch(g){case"right":case 2:x=2;break;case"center":case 1:x=1;break;case"left":case 0:default:x=0}}})};ha(Si,Ii);var Ju=function(){Si.call(this),this.FT="/Ch",this.V="()",this.fontName="zapfdingbats";var e=0;Object.defineProperty(this,"TI",{enumerable:!0,configurable:!1,get:function(){return e},set:function(n){e=n}}),Object.defineProperty(this,"topIndex",{enumerable:!0,configurable:!0,get:function(){return e},set:function(n){e=n}});var t=[];Object.defineProperty(this,"Opt",{enumerable:!0,configurable:!1,get:function(){return HE(t,this.objId,this.scope)},set:function(n){var r,a;a=[],typeof(r=n)=="string"&&(a=function(i,s,o){o||(o=1);for(var l,u=[];l=s.exec(i);)u.push(l[o]);return u}(r,/\((.*?)\)/g)),t=a}}),this.getOptions=function(){return t},this.setOptions=function(n){t=n,this.sort&&t.sort()},this.addOption=function(n){n=(n=n||"").toString(),t.push(n),this.sort&&t.sort()},this.removeOption=function(n,r){for(r=r||!1,n=(n=n||"").toString();t.indexOf(n)!==-1&&(t.splice(t.indexOf(n),1),r!==!1););},Object.defineProperty(this,"combo",{enumerable:!0,configurable:!0,get:function(){return!!qn(this.Ff,18)},set:function(n){n?this.Ff=Hn(this.Ff,18):this.Ff=Vn(this.Ff,18)}}),Object.defineProperty(this,"edit",{enumerable:!0,configurable:!0,get:function(){return!!qn(this.Ff,19)},set:function(n){this.combo===!0&&(n?this.Ff=Hn(this.Ff,19):this.Ff=Vn(this.Ff,19))}}),Object.defineProperty(this,"sort",{enumerable:!0,configurable:!0,get:function(){return!!qn(this.Ff,20)},set:function(n){n?(this.Ff=Hn(this.Ff,20),t.sort()):this.Ff=Vn(this.Ff,20)}}),Object.defineProperty(this,"multiSelect",{enumerable:!0,configurable:!0,get:function(){return!!qn(this.Ff,22)},set:function(n){n?this.Ff=Hn(this.Ff,22):this.Ff=Vn(this.Ff,22)}}),Object.defineProperty(this,"doNotSpellCheck",{enumerable:!0,configurable:!0,get:function(){return!!qn(this.Ff,23)},set:function(n){n?this.Ff=Hn(this.Ff,23):this.Ff=Vn(this.Ff,23)}}),Object.defineProperty(this,"commitOnSelChange",{enumerable:!0,configurable:!0,get:function(){return!!qn(this.Ff,27)},set:function(n){n?this.Ff=Hn(this.Ff,27):this.Ff=Vn(this.Ff,27)}}),this.hasAppearanceStream=!1};ha(Ju,Si);var Ku=function(){Ju.call(this),this.fontName="helvetica",this.combo=!1};ha(Ku,Ju);var Xu=function(){Ku.call(this),this.combo=!0};ha(Xu,Ku);var qp=function(){Xu.call(this),this.edit=!0};ha(qp,Xu);var pr=function(){Si.call(this),this.FT="/Btn",Object.defineProperty(this,"noToggleToOff",{enumerable:!0,configurable:!0,get:function(){return!!qn(this.Ff,15)},set:function(n){n?this.Ff=Hn(this.Ff,15):this.Ff=Vn(this.Ff,15)}}),Object.defineProperty(this,"radio",{enumerable:!0,configurable:!0,get:function(){return!!qn(this.Ff,16)},set:function(n){n?this.Ff=Hn(this.Ff,16):this.Ff=Vn(this.Ff,16)}}),Object.defineProperty(this,"pushButton",{enumerable:!0,configurable:!0,get:function(){return!!qn(this.Ff,17)},set:function(n){n?this.Ff=Hn(this.Ff,17):this.Ff=Vn(this.Ff,17)}}),Object.defineProperty(this,"radioIsUnison",{enumerable:!0,configurable:!0,get:function(){return!!qn(this.Ff,26)},set:function(n){n?this.Ff=Hn(this.Ff,26):this.Ff=Vn(this.Ff,26)}});var e,t={};Object.defineProperty(this,"MK",{enumerable:!1,configurable:!1,get:function(){var n=function(i){return i};if(this.scope&&(n=this.scope.internal.getEncryptor(this.objId)),Object.keys(t).length!==0){var r,a=[];for(r in a.push("<<"),t)a.push("/"+r+" ("+Dl(n(t[r]))+")");return a.push(">>"),a.join(`
223
+ `)}},set:function(n){Ut(n)==="object"&&(t=n)}}),Object.defineProperty(this,"caption",{enumerable:!0,configurable:!0,get:function(){return t.CA||""},set:function(n){typeof n=="string"&&(t.CA=n)}}),Object.defineProperty(this,"AS",{enumerable:!1,configurable:!1,get:function(){return e},set:function(n){e=n}}),Object.defineProperty(this,"appearanceState",{enumerable:!0,configurable:!0,get:function(){return e.substr(1,e.length-1)},set:function(n){e="/"+n}})};ha(pr,Si);var Hp=function(){pr.call(this),this.pushButton=!0};ha(Hp,pr);var Qu=function(){pr.call(this),this.radio=!0,this.pushButton=!1;var e=[];Object.defineProperty(this,"Kids",{enumerable:!0,configurable:!1,get:function(){return e},set:function(t){e=t!==void 0?t:[]}})};ha(Qu,pr);var Wm=function(){var e,t;Si.call(this),Object.defineProperty(this,"Parent",{enumerable:!1,configurable:!1,get:function(){return e},set:function(a){e=a}}),Object.defineProperty(this,"optionName",{enumerable:!1,configurable:!0,get:function(){return t},set:function(a){t=a}});var n,r={};Object.defineProperty(this,"MK",{enumerable:!1,configurable:!1,get:function(){var a=function(o){return o};this.scope&&(a=this.scope.internal.getEncryptor(this.objId));var i,s=[];for(i in s.push("<<"),r)s.push("/"+i+" ("+Dl(a(r[i]))+")");return s.push(">>"),s.join(`
224
+ `)},set:function(a){Ut(a)==="object"&&(r=a)}}),Object.defineProperty(this,"caption",{enumerable:!0,configurable:!0,get:function(){return r.CA||""},set:function(a){typeof a=="string"&&(r.CA=a)}}),Object.defineProperty(this,"AS",{enumerable:!1,configurable:!1,get:function(){return n},set:function(a){n=a}}),Object.defineProperty(this,"appearanceState",{enumerable:!0,configurable:!0,get:function(){return n.substr(1,n.length-1)},set:function(a){n="/"+a}}),this.caption="l",this.appearanceState="Off",this._AppearanceType=Xe.RadioButton.Circle,this.appearanceStreamContent=this._AppearanceType.createAppearanceStream(this.optionName)};ha(Wm,Si),Qu.prototype.setAppearance=function(e){if(!("createAppearanceStream"in e)||!("getCA"in e))throw new Error("Couldn't assign Appearance to RadioButton. Appearance was Invalid!");for(var t in this.Kids)if(this.Kids.hasOwnProperty(t)){var n=this.Kids[t];n.appearanceStreamContent=e.createAppearanceStream(n.optionName),n.caption=e.getCA()}},Qu.prototype.createOption=function(e){var t=new Wm;return t.Parent=this,t.optionName=e,this.Kids.push(t),tH.call(this.scope,t),t};var Vp=function(){pr.call(this),this.fontName="zapfdingbats",this.caption="3",this.appearanceState="On",this.value="On",this.textAlign="center",this.appearanceStreamContent=Xe.CheckBox.createAppearanceStream()};ha(Vp,pr);var yl=function(){Si.call(this),this.FT="/Tx",Object.defineProperty(this,"multiline",{enumerable:!0,configurable:!0,get:function(){return!!qn(this.Ff,13)},set:function(t){t?this.Ff=Hn(this.Ff,13):this.Ff=Vn(this.Ff,13)}}),Object.defineProperty(this,"fileSelect",{enumerable:!0,configurable:!0,get:function(){return!!qn(this.Ff,21)},set:function(t){t?this.Ff=Hn(this.Ff,21):this.Ff=Vn(this.Ff,21)}}),Object.defineProperty(this,"doNotSpellCheck",{enumerable:!0,configurable:!0,get:function(){return!!qn(this.Ff,23)},set:function(t){t?this.Ff=Hn(this.Ff,23):this.Ff=Vn(this.Ff,23)}}),Object.defineProperty(this,"doNotScroll",{enumerable:!0,configurable:!0,get:function(){return!!qn(this.Ff,24)},set:function(t){t?this.Ff=Hn(this.Ff,24):this.Ff=Vn(this.Ff,24)}}),Object.defineProperty(this,"comb",{enumerable:!0,configurable:!0,get:function(){return!!qn(this.Ff,25)},set:function(t){t?this.Ff=Hn(this.Ff,25):this.Ff=Vn(this.Ff,25)}}),Object.defineProperty(this,"richText",{enumerable:!0,configurable:!0,get:function(){return!!qn(this.Ff,26)},set:function(t){t?this.Ff=Hn(this.Ff,26):this.Ff=Vn(this.Ff,26)}});var e=null;Object.defineProperty(this,"MaxLen",{enumerable:!0,configurable:!1,get:function(){return e},set:function(t){e=t}}),Object.defineProperty(this,"maxLength",{enumerable:!0,configurable:!0,get:function(){return e},set:function(t){Number.isInteger(t)&&(e=t)}}),Object.defineProperty(this,"hasAppearanceStream",{enumerable:!0,configurable:!0,get:function(){return this.V||this.DV}})};ha(yl,Si);var Yp=function(){yl.call(this),Object.defineProperty(this,"password",{enumerable:!0,configurable:!0,get:function(){return!!qn(this.Ff,14)},set:function(e){e?this.Ff=Hn(this.Ff,14):this.Ff=Vn(this.Ff,14)}}),this.password=!0};ha(Yp,yl);var Xe={CheckBox:{createAppearanceStream:function(){return{N:{On:Xe.CheckBox.YesNormal},D:{On:Xe.CheckBox.YesPushDown,Off:Xe.CheckBox.OffPushDown}}},YesPushDown:function(e){var t=Ti(e);t.scope=e.scope;var n=[],r=e.scope.internal.getFont(e.fontName,e.fontStyle).id,a=e.scope.__private__.encodeColorString(e.color),i=dy(e,e.caption);return n.push("0.749023 g"),n.push("0 0 "+bt(Xe.internal.getWidth(e))+" "+bt(Xe.internal.getHeight(e))+" re"),n.push("f"),n.push("BMC"),n.push("q"),n.push("0 0 1 rg"),n.push("/"+r+" "+bt(i.fontSize)+" Tf "+a),n.push("BT"),n.push(i.text),n.push("ET"),n.push("Q"),n.push("EMC"),t.stream=n.join(`
225
+ `),t},YesNormal:function(e){var t=Ti(e);t.scope=e.scope;var n=e.scope.internal.getFont(e.fontName,e.fontStyle).id,r=e.scope.__private__.encodeColorString(e.color),a=[],i=Xe.internal.getHeight(e),s=Xe.internal.getWidth(e),o=dy(e,e.caption);return a.push("1 g"),a.push("0 0 "+bt(s)+" "+bt(i)+" re"),a.push("f"),a.push("q"),a.push("0 0 1 rg"),a.push("0 0 "+bt(s-1)+" "+bt(i-1)+" re"),a.push("W"),a.push("n"),a.push("0 g"),a.push("BT"),a.push("/"+n+" "+bt(o.fontSize)+" Tf "+r),a.push(o.text),a.push("ET"),a.push("Q"),t.stream=a.join(`
226
+ `),t},OffPushDown:function(e){var t=Ti(e);t.scope=e.scope;var n=[];return n.push("0.749023 g"),n.push("0 0 "+bt(Xe.internal.getWidth(e))+" "+bt(Xe.internal.getHeight(e))+" re"),n.push("f"),t.stream=n.join(`
227
+ `),t}},RadioButton:{Circle:{createAppearanceStream:function(e){var t={D:{Off:Xe.RadioButton.Circle.OffPushDown},N:{}};return t.N[e]=Xe.RadioButton.Circle.YesNormal,t.D[e]=Xe.RadioButton.Circle.YesPushDown,t},getCA:function(){return"l"},YesNormal:function(e){var t=Ti(e);t.scope=e.scope;var n=[],r=Xe.internal.getWidth(e)<=Xe.internal.getHeight(e)?Xe.internal.getWidth(e)/4:Xe.internal.getHeight(e)/4;r=Number((.9*r).toFixed(5));var a=Xe.internal.Bezier_C,i=Number((r*a).toFixed(5));return n.push("q"),n.push("1 0 0 1 "+to(Xe.internal.getWidth(e)/2)+" "+to(Xe.internal.getHeight(e)/2)+" cm"),n.push(r+" 0 m"),n.push(r+" "+i+" "+i+" "+r+" 0 "+r+" c"),n.push("-"+i+" "+r+" -"+r+" "+i+" -"+r+" 0 c"),n.push("-"+r+" -"+i+" -"+i+" -"+r+" 0 -"+r+" c"),n.push(i+" -"+r+" "+r+" -"+i+" "+r+" 0 c"),n.push("f"),n.push("Q"),t.stream=n.join(`
228
+ `),t},YesPushDown:function(e){var t=Ti(e);t.scope=e.scope;var n=[],r=Xe.internal.getWidth(e)<=Xe.internal.getHeight(e)?Xe.internal.getWidth(e)/4:Xe.internal.getHeight(e)/4;r=Number((.9*r).toFixed(5));var a=Number((2*r).toFixed(5)),i=Number((a*Xe.internal.Bezier_C).toFixed(5)),s=Number((r*Xe.internal.Bezier_C).toFixed(5));return n.push("0.749023 g"),n.push("q"),n.push("1 0 0 1 "+to(Xe.internal.getWidth(e)/2)+" "+to(Xe.internal.getHeight(e)/2)+" cm"),n.push(a+" 0 m"),n.push(a+" "+i+" "+i+" "+a+" 0 "+a+" c"),n.push("-"+i+" "+a+" -"+a+" "+i+" -"+a+" 0 c"),n.push("-"+a+" -"+i+" -"+i+" -"+a+" 0 -"+a+" c"),n.push(i+" -"+a+" "+a+" -"+i+" "+a+" 0 c"),n.push("f"),n.push("Q"),n.push("0 g"),n.push("q"),n.push("1 0 0 1 "+to(Xe.internal.getWidth(e)/2)+" "+to(Xe.internal.getHeight(e)/2)+" cm"),n.push(r+" 0 m"),n.push(r+" "+s+" "+s+" "+r+" 0 "+r+" c"),n.push("-"+s+" "+r+" -"+r+" "+s+" -"+r+" 0 c"),n.push("-"+r+" -"+s+" -"+s+" -"+r+" 0 -"+r+" c"),n.push(s+" -"+r+" "+r+" -"+s+" "+r+" 0 c"),n.push("f"),n.push("Q"),t.stream=n.join(`
229
+ `),t},OffPushDown:function(e){var t=Ti(e);t.scope=e.scope;var n=[],r=Xe.internal.getWidth(e)<=Xe.internal.getHeight(e)?Xe.internal.getWidth(e)/4:Xe.internal.getHeight(e)/4;r=Number((.9*r).toFixed(5));var a=Number((2*r).toFixed(5)),i=Number((a*Xe.internal.Bezier_C).toFixed(5));return n.push("0.749023 g"),n.push("q"),n.push("1 0 0 1 "+to(Xe.internal.getWidth(e)/2)+" "+to(Xe.internal.getHeight(e)/2)+" cm"),n.push(a+" 0 m"),n.push(a+" "+i+" "+i+" "+a+" 0 "+a+" c"),n.push("-"+i+" "+a+" -"+a+" "+i+" -"+a+" 0 c"),n.push("-"+a+" -"+i+" -"+i+" -"+a+" 0 -"+a+" c"),n.push(i+" -"+a+" "+a+" -"+i+" "+a+" 0 c"),n.push("f"),n.push("Q"),t.stream=n.join(`
230
+ `),t}},Cross:{createAppearanceStream:function(e){var t={D:{Off:Xe.RadioButton.Cross.OffPushDown},N:{}};return t.N[e]=Xe.RadioButton.Cross.YesNormal,t.D[e]=Xe.RadioButton.Cross.YesPushDown,t},getCA:function(){return"8"},YesNormal:function(e){var t=Ti(e);t.scope=e.scope;var n=[],r=Xe.internal.calculateCross(e);return n.push("q"),n.push("1 1 "+bt(Xe.internal.getWidth(e)-2)+" "+bt(Xe.internal.getHeight(e)-2)+" re"),n.push("W"),n.push("n"),n.push(bt(r.x1.x)+" "+bt(r.x1.y)+" m"),n.push(bt(r.x2.x)+" "+bt(r.x2.y)+" l"),n.push(bt(r.x4.x)+" "+bt(r.x4.y)+" m"),n.push(bt(r.x3.x)+" "+bt(r.x3.y)+" l"),n.push("s"),n.push("Q"),t.stream=n.join(`
231
+ `),t},YesPushDown:function(e){var t=Ti(e);t.scope=e.scope;var n=Xe.internal.calculateCross(e),r=[];return r.push("0.749023 g"),r.push("0 0 "+bt(Xe.internal.getWidth(e))+" "+bt(Xe.internal.getHeight(e))+" re"),r.push("f"),r.push("q"),r.push("1 1 "+bt(Xe.internal.getWidth(e)-2)+" "+bt(Xe.internal.getHeight(e)-2)+" re"),r.push("W"),r.push("n"),r.push(bt(n.x1.x)+" "+bt(n.x1.y)+" m"),r.push(bt(n.x2.x)+" "+bt(n.x2.y)+" l"),r.push(bt(n.x4.x)+" "+bt(n.x4.y)+" m"),r.push(bt(n.x3.x)+" "+bt(n.x3.y)+" l"),r.push("s"),r.push("Q"),t.stream=r.join(`
232
+ `),t},OffPushDown:function(e){var t=Ti(e);t.scope=e.scope;var n=[];return n.push("0.749023 g"),n.push("0 0 "+bt(Xe.internal.getWidth(e))+" "+bt(Xe.internal.getHeight(e))+" re"),n.push("f"),t.stream=n.join(`
233
+ `),t}}},createDefaultAppearanceStream:function(e){var t=e.scope.internal.getFont(e.fontName,e.fontStyle).id,n=e.scope.__private__.encodeColorString(e.color);return"/"+t+" "+e.fontSize+" Tf "+n}};Xe.internal={Bezier_C:.551915024494,calculateCross:function(e){var t=Xe.internal.getWidth(e),n=Xe.internal.getHeight(e),r=Math.min(t,n);return{x1:{x:(t-r)/2,y:(n-r)/2+r},x2:{x:(t-r)/2+r,y:(n-r)/2},x3:{x:(t-r)/2,y:(n-r)/2},x4:{x:(t-r)/2+r,y:(n-r)/2+r}}}},Xe.internal.getWidth=function(e){var t=0;return Ut(e)==="object"&&(t=g3(e.Rect[2])),t},Xe.internal.getHeight=function(e){var t=0;return Ut(e)==="object"&&(t=g3(e.Rect[3])),t};var tH=Pn.addField=function(e){if(eH(this,e),!(e instanceof Si))throw new Error("Invalid argument passed to jsPDF.addField.");var t;return(t=e).scope.internal.acroformPlugin.printedOut&&(t.scope.internal.acroformPlugin.printedOut=!1,t.scope.internal.acroformPlugin.acroFormDictionaryRoot=null),t.scope.internal.acroformPlugin.acroFormDictionaryRoot.Fields.push(t),e.page=e.scope.internal.getCurrentPageInfo().pageNumber,this};Pn.AcroFormChoiceField=Ju,Pn.AcroFormListBox=Ku,Pn.AcroFormComboBox=Xu,Pn.AcroFormEditBox=qp,Pn.AcroFormButton=pr,Pn.AcroFormPushButton=Hp,Pn.AcroFormRadioButton=Qu,Pn.AcroFormCheckBox=Vp,Pn.AcroFormTextField=yl,Pn.AcroFormPasswordField=Yp,Pn.AcroFormAppearance=Xe,Pn.AcroForm={ChoiceField:Ju,ListBox:Ku,ComboBox:Xu,EditBox:qp,Button:pr,PushButton:Hp,RadioButton:Qu,CheckBox:Vp,TextField:yl,PasswordField:Yp,Appearance:Xe},lt.AcroForm={ChoiceField:Ju,ListBox:Ku,ComboBox:Xu,EditBox:qp,Button:pr,PushButton:Hp,RadioButton:Qu,CheckBox:Vp,TextField:yl,PasswordField:Yp,Appearance:Xe};lt.AcroForm;function GE(e){return e.reduce(function(t,n,r){return t[n]=r,t},{})}(function(e){e.__addimage__={};var t="UNKNOWN",n={PNG:[[137,80,78,71]],TIFF:[[77,77,0,42],[73,73,42,0]],JPEG:[[255,216,255,224,void 0,void 0,74,70,73,70,0],[255,216,255,225,void 0,void 0,69,120,105,102,0,0],[255,216,255,219],[255,216,255,238]],JPEG2000:[[0,0,0,12,106,80,32,32]],GIF87a:[[71,73,70,56,55,97]],GIF89a:[[71,73,70,56,57,97]],WEBP:[[82,73,70,70,void 0,void 0,void 0,void 0,87,69,66,80]],BMP:[[66,77],[66,65],[67,73],[67,80],[73,67],[80,84]]},r=e.__addimage__.getImageFileTypeByImageData=function(T,P){var q,Y,se,G,ne,Q=t;if((P=P||t)==="RGBA"||T.data!==void 0&&T.data instanceof Uint8ClampedArray&&"height"in T&&"width"in T)return"RGBA";if(R(T))for(ne in n)for(se=n[ne],q=0;q<se.length;q+=1){for(G=!0,Y=0;Y<se[q].length;Y+=1)if(se[q][Y]!==void 0&&se[q][Y]!==T[Y]){G=!1;break}if(G===!0){Q=ne;break}}else for(ne in n)for(se=n[ne],q=0;q<se.length;q+=1){for(G=!0,Y=0;Y<se[q].length;Y+=1)if(se[q][Y]!==void 0&&se[q][Y]!==T.charCodeAt(Y)){G=!1;break}if(G===!0){Q=ne;break}}return Q===t&&P!==t&&(Q=P),Q},a=function T(P){for(var q=this.internal.write,Y=this.internal.putStream,se=(0,this.internal.getFilters)();se.indexOf("FlateEncode")!==-1;)se.splice(se.indexOf("FlateEncode"),1);P.objectId=this.internal.newObject();var G=[];if(G.push({key:"Type",value:"/XObject"}),G.push({key:"Subtype",value:"/Image"}),G.push({key:"Width",value:P.width}),G.push({key:"Height",value:P.height}),P.colorSpace===x.INDEXED?G.push({key:"ColorSpace",value:"[/Indexed /DeviceRGB "+(P.palette.length/3-1)+" "+("sMask"in P&&P.sMask!==void 0?P.objectId+2:P.objectId+1)+" 0 R]"}):(G.push({key:"ColorSpace",value:"/"+P.colorSpace}),P.colorSpace===x.DEVICE_CMYK&&G.push({key:"Decode",value:"[1 0 1 0 1 0 1 0]"})),G.push({key:"BitsPerComponent",value:P.bitsPerComponent}),"decodeParameters"in P&&P.decodeParameters!==void 0&&G.push({key:"DecodeParms",value:"<<"+P.decodeParameters+">>"}),"transparency"in P&&Array.isArray(P.transparency)){for(var ne="",Q=0,ie=P.transparency.length;Q<ie;Q++)ne+=P.transparency[Q]+" "+P.transparency[Q]+" ";G.push({key:"Mask",value:"["+ne+"]"})}P.sMask!==void 0&&G.push({key:"SMask",value:P.objectId+1+" 0 R"});var J=P.filter!==void 0?["/"+P.filter]:void 0;if(Y({data:P.data,additionalKeyValues:G,alreadyAppliedFilters:J,objectId:P.objectId}),q("endobj"),"sMask"in P&&P.sMask!==void 0){var le="/Predictor "+P.predictor+" /Colors 1 /BitsPerComponent "+P.bitsPerComponent+" /Columns "+P.width,L={width:P.width,height:P.height,colorSpace:"DeviceGray",bitsPerComponent:P.bitsPerComponent,decodeParameters:le,data:P.sMask};"filter"in P&&(L.filter=P.filter),T.call(this,L)}if(P.colorSpace===x.INDEXED){var z=this.internal.newObject();Y({data:j(new Uint8Array(P.palette)),objectId:z}),q("endobj")}},i=function(){var T=this.internal.collections.addImage_images;for(var P in T)a.call(this,T[P])},s=function(){var T,P=this.internal.collections.addImage_images,q=this.internal.write;for(var Y in P)q("/I"+(T=P[Y]).index,T.objectId,"0","R")},o=function(){this.internal.collections.addImage_images||(this.internal.collections.addImage_images={},this.internal.events.subscribe("putResources",i),this.internal.events.subscribe("putXobjectDict",s))},l=function(){var T=this.internal.collections.addImage_images;return o.call(this),T},u=function(){return Object.keys(this.internal.collections.addImage_images).length},c=function(T){return typeof e["process"+T.toUpperCase()]=="function"},f=function(T){return Ut(T)==="object"&&T.nodeType===1},p=function(T,P){if(T.nodeName==="IMG"&&T.hasAttribute("src")){var q=""+T.getAttribute("src");if(q.indexOf("data:image/")===0)return Gf(unescape(q).split("base64,").pop());var Y=e.loadFile(q,!0);if(Y!==void 0)return Y}if(T.nodeName==="CANVAS"){if(T.width===0||T.height===0)throw new Error("Given canvas must have data. Canvas width: "+T.width+", height: "+T.height);var se;switch(P){case"PNG":se="image/png";break;case"WEBP":se="image/webp";break;case"JPEG":case"JPG":default:se="image/jpeg"}return Gf(T.toDataURL(se,1).split("base64,").pop())}},d=function(T){var P=this.internal.collections.addImage_images;if(P){for(var q in P)if(T===P[q].alias)return P[q]}},v=function(T,P,q){return T||P||(T=-96,P=-96),T<0&&(T=-1*q.width*72/T/this.internal.scaleFactor),P<0&&(P=-1*q.height*72/P/this.internal.scaleFactor),T===0&&(T=P*q.width/q.height),P===0&&(P=T*q.height/q.width),[T,P]},S=function(T,P,q,Y,se,G){var ne=v.call(this,q,Y,se),Q=this.internal.getCoordinateString,ie=this.internal.getVerticalCoordinateString,J=l.call(this);if(q=ne[0],Y=ne[1],J[se.index]=se,G){G*=Math.PI/180;var le=Math.cos(G),L=Math.sin(G),z=function(te){return te.toFixed(4)},W=[z(le),z(L),z(-1*L),z(le),0,0,"cm"]}this.internal.write("q"),G?(this.internal.write([1,"0","0",1,Q(T),ie(P+Y),"cm"].join(" ")),this.internal.write(W.join(" ")),this.internal.write([Q(q),"0","0",Q(Y),"0","0","cm"].join(" "))):this.internal.write([Q(q),"0","0",Q(Y),Q(T),ie(P+Y),"cm"].join(" ")),this.isAdvancedAPI()&&this.internal.write([1,0,0,-1,0,0,"cm"].join(" ")),this.internal.write("/I"+se.index+" Do"),this.internal.write("Q")},x=e.color_spaces={DEVICE_RGB:"DeviceRGB",DEVICE_GRAY:"DeviceGray",DEVICE_CMYK:"DeviceCMYK",CAL_GREY:"CalGray",CAL_RGB:"CalRGB",LAB:"Lab",ICC_BASED:"ICCBased",INDEXED:"Indexed",PATTERN:"Pattern",SEPARATION:"Separation",DEVICE_N:"DeviceN"};e.decode={DCT_DECODE:"DCTDecode",FLATE_DECODE:"FlateDecode",LZW_DECODE:"LZWDecode",JPX_DECODE:"JPXDecode",JBIG2_DECODE:"JBIG2Decode",ASCII85_DECODE:"ASCII85Decode",ASCII_HEX_DECODE:"ASCIIHexDecode",RUN_LENGTH_DECODE:"RunLengthDecode",CCITT_FAX_DECODE:"CCITTFaxDecode"};var g=e.image_compression={NONE:"NONE",FAST:"FAST",MEDIUM:"MEDIUM",SLOW:"SLOW"},y=e.__addimage__.sHashCode=function(T){var P,q,Y=0;if(typeof T=="string")for(q=T.length,P=0;P<q;P++)Y=(Y<<5)-Y+T.charCodeAt(P),Y|=0;else if(R(T))for(q=T.byteLength/2,P=0;P<q;P++)Y=(Y<<5)-Y+T[P],Y|=0;return Y},_=e.__addimage__.validateStringAsBase64=function(T){(T=T||"").toString().trim();var P=!0;return T.length===0&&(P=!1),T.length%4!=0&&(P=!1),/^[A-Za-z0-9+/]+$/.test(T.substr(0,T.length-2))===!1&&(P=!1),/^[A-Za-z0-9/][A-Za-z0-9+/]|[A-Za-z0-9+/]=|==$/.test(T.substr(-2))===!1&&(P=!1),P},E=e.__addimage__.extractImageFromDataUrl=function(T){if(T==null||!(T=T.trim()).startsWith("data:"))return null;var P=T.indexOf(",");return P<0?null:T.substring(0,P).trim().endsWith("base64")?T.substring(P+1):null},D=e.__addimage__.supportsArrayBuffer=function(){return typeof ArrayBuffer<"u"&&typeof Uint8Array<"u"};e.__addimage__.isArrayBuffer=function(T){return D()&&T instanceof ArrayBuffer};var R=e.__addimage__.isArrayBufferView=function(T){return D()&&typeof Uint32Array<"u"&&(T instanceof Int8Array||T instanceof Uint8Array||typeof Uint8ClampedArray<"u"&&T instanceof Uint8ClampedArray||T instanceof Int16Array||T instanceof Uint16Array||T instanceof Int32Array||T instanceof Uint32Array||T instanceof Float32Array||T instanceof Float64Array)},O=e.__addimage__.binaryStringToUint8Array=function(T){for(var P=T.length,q=new Uint8Array(P),Y=0;Y<P;Y++)q[Y]=T.charCodeAt(Y);return q},j=e.__addimage__.arrayBufferToBinaryString=function(T){for(var P="",q=R(T)?T:new Uint8Array(T),Y=0;Y<q.length;Y+=8192)P+=String.fromCharCode.apply(null,q.subarray(Y,Y+8192));return P};e.addImage=function(){var T,P,q,Y,se,G,ne,Q,ie;if(typeof arguments[1]=="number"?(P=t,q=arguments[1],Y=arguments[2],se=arguments[3],G=arguments[4],ne=arguments[5],Q=arguments[6],ie=arguments[7]):(P=arguments[1],q=arguments[2],Y=arguments[3],se=arguments[4],G=arguments[5],ne=arguments[6],Q=arguments[7],ie=arguments[8]),Ut(T=arguments[0])==="object"&&!f(T)&&"imageData"in T){var J=T;T=J.imageData,P=J.format||P||t,q=J.x||q||0,Y=J.y||Y||0,se=J.w||J.width||se,G=J.h||J.height||G,ne=J.alias||ne,Q=J.compression||Q,ie=J.rotation||J.angle||ie}var le=this.internal.getFilters();if(Q===void 0&&le.indexOf("FlateEncode")!==-1&&(Q="SLOW"),isNaN(q)||isNaN(Y))throw new Error("Invalid coordinates passed to jsPDF.addImage");o.call(this);var L=$.call(this,T,P,ne,Q);return S.call(this,q,Y,se,G,L,ie),this};var $=function(T,P,q,Y){var se,G,ne;if(typeof T=="string"&&r(T)===t){T=unescape(T);var Q=V(T,!1);(Q!==""||(Q=e.loadFile(T,!0))!==void 0)&&(T=Q)}if(f(T)&&(T=p(T,P)),P=r(T,P),!c(P))throw new Error("addImage does not support files of type '"+P+"', please ensure that a plugin for '"+P+"' support is added.");if(((ne=q)==null||ne.length===0)&&(q=function(ie){return typeof ie=="string"||R(ie)?y(ie):R(ie.data)?y(ie.data):null}(T)),(se=d.call(this,q))||(D()&&(T instanceof Uint8Array||P==="RGBA"||(G=T,T=O(T))),se=this["process"+P.toUpperCase()](T,u.call(this),q,function(ie){return ie&&typeof ie=="string"&&(ie=ie.toUpperCase()),ie in e.image_compression?ie:g.NONE}(Y),G)),!se)throw new Error("An unknown error occurred whilst processing the image.");return se},V=e.__addimage__.convertBase64ToBinaryString=function(T,P){P=typeof P!="boolean"||P;var q,Y="";if(typeof T=="string"){var se;q=(se=E(T))!==null&&se!==void 0?se:T;try{Y=Gf(q)}catch(G){if(P)throw _(q)?new Error("atob-Error in jsPDF.convertBase64ToBinaryString "+G.message):new Error("Supplied Data is not a valid base64-String jsPDF.convertBase64ToBinaryString ")}}return Y};e.getImageProperties=function(T){var P,q,Y="";if(f(T)&&(T=p(T)),typeof T=="string"&&r(T)===t&&((Y=V(T,!1))===""&&(Y=e.loadFile(T)||""),T=Y),q=r(T),!c(q))throw new Error("addImage does not support files of type '"+q+"', please ensure that a plugin for '"+q+"' support is added.");if(!D()||T instanceof Uint8Array||(T=O(T)),!(P=this["process"+q.toUpperCase()](T)))throw new Error("An unknown error occurred whilst processing the image");return P.fileType=q,P}})(lt.API),function(e){var t=function(n){if(n!==void 0&&n!="")return!0};lt.API.events.push(["addPage",function(n){this.internal.getPageInfo(n.pageNumber).pageContext.annotations=[]}]),e.events.push(["putPage",function(n){for(var r,a,i,s=this.internal.getCoordinateString,o=this.internal.getVerticalCoordinateString,l=this.internal.getPageInfoByObjId(n.objId),u=n.pageContext.annotations,c=!1,f=0;f<u.length&&!c;f++)switch((r=u[f]).type){case"link":(t(r.options.url)||t(r.options.pageNumber))&&(c=!0);break;case"reference":case"text":case"freetext":c=!0}if(c!=0){this.internal.write("/Annots [");for(var p=0;p<u.length;p++){r=u[p];var d=this.internal.pdfEscape,v=this.internal.getEncryptor(n.objId);switch(r.type){case"reference":this.internal.write(" "+r.object.objId+" 0 R ");break;case"text":var S=this.internal.newAdditionalObject(),x=this.internal.newAdditionalObject(),g=this.internal.getEncryptor(S.objId),y=r.title||"Note";i="<</Type /Annot /Subtype /Text "+(a="/Rect ["+s(r.bounds.x)+" "+o(r.bounds.y+r.bounds.h)+" "+s(r.bounds.x+r.bounds.w)+" "+o(r.bounds.y)+"] ")+"/Contents ("+d(g(r.contents))+")",i+=" /Popup "+x.objId+" 0 R",i+=" /P "+l.objId+" 0 R",i+=" /T ("+d(g(y))+") >>",S.content=i;var _=S.objId+" 0 R";i="<</Type /Annot /Subtype /Popup "+(a="/Rect ["+s(r.bounds.x+30)+" "+o(r.bounds.y+r.bounds.h)+" "+s(r.bounds.x+r.bounds.w+30)+" "+o(r.bounds.y)+"] ")+" /Parent "+_,r.open&&(i+=" /Open true"),i+=" >>",x.content=i,this.internal.write(S.objId,"0 R",x.objId,"0 R");break;case"freetext":a="/Rect ["+s(r.bounds.x)+" "+o(r.bounds.y)+" "+s(r.bounds.x+r.bounds.w)+" "+o(r.bounds.y+r.bounds.h)+"] ";var E=r.color||"#000000";i="<</Type /Annot /Subtype /FreeText "+a+"/Contents ("+d(v(r.contents))+")",i+=" /DS(font: Helvetica,sans-serif 12.0pt; text-align:left; color:#"+E+")",i+=" /Border [0 0 0]",i+=" >>",this.internal.write(i);break;case"link":if(r.options.name){var D=this.annotations._nameMap[r.options.name];r.options.pageNumber=D.page,r.options.top=D.y}else r.options.top||(r.options.top=0);if(a="/Rect ["+r.finalBounds.x+" "+r.finalBounds.y+" "+r.finalBounds.w+" "+r.finalBounds.h+"] ",i="",r.options.url)i="<</Type /Annot /Subtype /Link "+a+"/Border [0 0 0] /A <</S /URI /URI ("+d(v(r.options.url))+") >>";else if(r.options.pageNumber)switch(i="<</Type /Annot /Subtype /Link "+a+"/Border [0 0 0] /Dest ["+this.internal.getPageInfo(r.options.pageNumber).objId+" 0 R",r.options.magFactor=r.options.magFactor||"XYZ",r.options.magFactor){case"Fit":i+=" /Fit]";break;case"FitH":i+=" /FitH "+r.options.top+"]";break;case"FitV":r.options.left=r.options.left||0,i+=" /FitV "+r.options.left+"]";break;case"XYZ":default:var R=o(r.options.top);r.options.left=r.options.left||0,r.options.zoom===void 0&&(r.options.zoom=0),i+=" /XYZ "+r.options.left+" "+R+" "+r.options.zoom+"]"}i!=""&&(i+=" >>",this.internal.write(i))}}this.internal.write("]")}}]),e.createAnnotation=function(n){var r=this.internal.getCurrentPageInfo();switch(n.type){case"link":this.link(n.bounds.x,n.bounds.y,n.bounds.w,n.bounds.h,n);break;case"text":case"freetext":r.pageContext.annotations.push(n)}},e.link=function(n,r,a,i,s){var o=this.internal.getCurrentPageInfo(),l=this.internal.getCoordinateString,u=this.internal.getVerticalCoordinateString;o.pageContext.annotations.push({finalBounds:{x:l(n),y:u(r),w:l(n+a),h:u(r+i)},options:s,type:"link"})},e.textWithLink=function(n,r,a,i){var s,o,l=this.getTextWidth(n),u=this.internal.getLineHeight()/this.internal.scaleFactor;if(i.maxWidth!==void 0){o=i.maxWidth;var c=this.splitTextToSize(n,o).length;s=Math.ceil(u*c)}else o=l,s=u;return this.text(n,r,a,i),a+=.2*u,i.align==="center"&&(r-=l/2),i.align==="right"&&(r-=l),this.link(r,a-u,o,s,i),l},e.getTextWidth=function(n){var r=this.internal.getFontSize();return this.getStringUnitWidth(n)*r/this.internal.scaleFactor}}(lt.API),function(e){var t={1569:[65152],1570:[65153,65154],1571:[65155,65156],1572:[65157,65158],1573:[65159,65160],1574:[65161,65162,65163,65164],1575:[65165,65166],1576:[65167,65168,65169,65170],1577:[65171,65172],1578:[65173,65174,65175,65176],1579:[65177,65178,65179,65180],1580:[65181,65182,65183,65184],1581:[65185,65186,65187,65188],1582:[65189,65190,65191,65192],1583:[65193,65194],1584:[65195,65196],1585:[65197,65198],1586:[65199,65200],1587:[65201,65202,65203,65204],1588:[65205,65206,65207,65208],1589:[65209,65210,65211,65212],1590:[65213,65214,65215,65216],1591:[65217,65218,65219,65220],1592:[65221,65222,65223,65224],1593:[65225,65226,65227,65228],1594:[65229,65230,65231,65232],1601:[65233,65234,65235,65236],1602:[65237,65238,65239,65240],1603:[65241,65242,65243,65244],1604:[65245,65246,65247,65248],1605:[65249,65250,65251,65252],1606:[65253,65254,65255,65256],1607:[65257,65258,65259,65260],1608:[65261,65262],1609:[65263,65264,64488,64489],1610:[65265,65266,65267,65268],1649:[64336,64337],1655:[64477],1657:[64358,64359,64360,64361],1658:[64350,64351,64352,64353],1659:[64338,64339,64340,64341],1662:[64342,64343,64344,64345],1663:[64354,64355,64356,64357],1664:[64346,64347,64348,64349],1667:[64374,64375,64376,64377],1668:[64370,64371,64372,64373],1670:[64378,64379,64380,64381],1671:[64382,64383,64384,64385],1672:[64392,64393],1676:[64388,64389],1677:[64386,64387],1678:[64390,64391],1681:[64396,64397],1688:[64394,64395],1700:[64362,64363,64364,64365],1702:[64366,64367,64368,64369],1705:[64398,64399,64400,64401],1709:[64467,64468,64469,64470],1711:[64402,64403,64404,64405],1713:[64410,64411,64412,64413],1715:[64406,64407,64408,64409],1722:[64414,64415],1723:[64416,64417,64418,64419],1726:[64426,64427,64428,64429],1728:[64420,64421],1729:[64422,64423,64424,64425],1733:[64480,64481],1734:[64473,64474],1735:[64471,64472],1736:[64475,64476],1737:[64482,64483],1739:[64478,64479],1740:[64508,64509,64510,64511],1744:[64484,64485,64486,64487],1746:[64430,64431],1747:[64432,64433]},n={65247:{65154:65269,65156:65271,65160:65273,65166:65275},65248:{65154:65270,65156:65272,65160:65274,65166:65276},65165:{65247:{65248:{65258:65010}}},1617:{1612:64606,1613:64607,1614:64608,1615:64609,1616:64610}},r={1612:64606,1613:64607,1614:64608,1615:64609,1616:64610},a=[1570,1571,1573,1575];e.__arabicParser__={};var i=e.__arabicParser__.isInArabicSubstitutionA=function(S){return t[S.charCodeAt(0)]!==void 0},s=e.__arabicParser__.isArabicLetter=function(S){return typeof S=="string"&&/^[\u0600-\u06FF\u0750-\u077F\u08A0-\u08FF\uFB50-\uFDFF\uFE70-\uFEFF]+$/.test(S)},o=e.__arabicParser__.isArabicEndLetter=function(S){return s(S)&&i(S)&&t[S.charCodeAt(0)].length<=2},l=e.__arabicParser__.isArabicAlfLetter=function(S){return s(S)&&a.indexOf(S.charCodeAt(0))>=0};e.__arabicParser__.arabicLetterHasIsolatedForm=function(S){return s(S)&&i(S)&&t[S.charCodeAt(0)].length>=1};var u=e.__arabicParser__.arabicLetterHasFinalForm=function(S){return s(S)&&i(S)&&t[S.charCodeAt(0)].length>=2};e.__arabicParser__.arabicLetterHasInitialForm=function(S){return s(S)&&i(S)&&t[S.charCodeAt(0)].length>=3};var c=e.__arabicParser__.arabicLetterHasMedialForm=function(S){return s(S)&&i(S)&&t[S.charCodeAt(0)].length==4},f=e.__arabicParser__.resolveLigatures=function(S){var x=0,g=n,y="",_=0;for(x=0;x<S.length;x+=1)g[S.charCodeAt(x)]!==void 0?(_++,typeof(g=g[S.charCodeAt(x)])=="number"&&(y+=String.fromCharCode(g),g=n,_=0),x===S.length-1&&(g=n,y+=S.charAt(x-(_-1)),x-=_-1,_=0)):(g=n,y+=S.charAt(x-_),x-=_,_=0);return y};e.__arabicParser__.isArabicDiacritic=function(S){return S!==void 0&&r[S.charCodeAt(0)]!==void 0};var p=e.__arabicParser__.getCorrectForm=function(S,x,g){return s(S)?i(S)===!1?-1:!u(S)||!s(x)&&!s(g)||!s(g)&&o(x)||o(S)&&!s(x)||o(S)&&l(x)||o(S)&&o(x)?0:c(S)&&s(x)&&!o(x)&&s(g)&&u(g)?3:o(S)||!s(g)?1:2:-1},d=function(S){var x=0,g=0,y=0,_="",E="",D="",R=(S=S||"").split("\\s+"),O=[];for(x=0;x<R.length;x+=1){for(O.push(""),g=0;g<R[x].length;g+=1)_=R[x][g],E=R[x][g-1],D=R[x][g+1],s(_)?(y=p(_,E,D),O[x]+=y!==-1?String.fromCharCode(t[_.charCodeAt(0)][y]):_):O[x]+=_;O[x]=f(O[x])}return O.join(" ")},v=e.__arabicParser__.processArabic=e.processArabic=function(){var S,x=typeof arguments[0]=="string"?arguments[0]:arguments[0].text,g=[];if(Array.isArray(x)){var y=0;for(g=[],y=0;y<x.length;y+=1)Array.isArray(x[y])?g.push([d(x[y][0]),x[y][1],x[y][2]]):g.push([d(x[y])]);S=g}else S=d(x);return typeof arguments[0]=="string"?S:(arguments[0].text=S,arguments[0])};e.events.push(["preProcessText",v])}(lt.API),lt.API.autoPrint=function(e){var t;switch((e=e||{}).variant=e.variant||"non-conform",e.variant){case"javascript":this.addJS("print({});");break;case"non-conform":default:this.internal.events.subscribe("postPutResources",function(){t=this.internal.newObject(),this.internal.out("<<"),this.internal.out("/S /Named"),this.internal.out("/Type /Action"),this.internal.out("/N /Print"),this.internal.out(">>"),this.internal.out("endobj")}),this.internal.events.subscribe("putCatalog",function(){this.internal.out("/OpenAction "+t+" 0 R")})}return this},function(e){var t=function(){var n=void 0;Object.defineProperty(this,"pdf",{get:function(){return n},set:function(o){n=o}});var r=150;Object.defineProperty(this,"width",{get:function(){return r},set:function(o){r=isNaN(o)||Number.isInteger(o)===!1||o<0?150:o,this.getContext("2d").pageWrapXEnabled&&(this.getContext("2d").pageWrapX=r+1)}});var a=300;Object.defineProperty(this,"height",{get:function(){return a},set:function(o){a=isNaN(o)||Number.isInteger(o)===!1||o<0?300:o,this.getContext("2d").pageWrapYEnabled&&(this.getContext("2d").pageWrapY=a+1)}});var i=[];Object.defineProperty(this,"childNodes",{get:function(){return i},set:function(o){i=o}});var s={};Object.defineProperty(this,"style",{get:function(){return s},set:function(o){s=o}}),Object.defineProperty(this,"parentNode",{})};t.prototype.getContext=function(n,r){var a;if((n=n||"2d")!=="2d")return null;for(a in r)this.pdf.context2d.hasOwnProperty(a)&&(this.pdf.context2d[a]=r[a]);return this.pdf.context2d._canvas=this,this.pdf.context2d},t.prototype.toDataURL=function(){throw new Error("toDataURL is not implemented.")},e.events.push(["initialized",function(){this.canvas=new t,this.canvas.pdf=this}])}(lt.API),function(e){var t={left:0,top:0,bottom:0,right:0},n=!1,r=function(){this.internal.__cell__===void 0&&(this.internal.__cell__={},this.internal.__cell__.padding=3,this.internal.__cell__.headerFunction=void 0,this.internal.__cell__.margins=Object.assign({},t),this.internal.__cell__.margins.width=this.getPageWidth(),a.call(this))},a=function(){this.internal.__cell__.lastCell=new i,this.internal.__cell__.pages=1},i=function(){var l=arguments[0];Object.defineProperty(this,"x",{enumerable:!0,get:function(){return l},set:function(S){l=S}});var u=arguments[1];Object.defineProperty(this,"y",{enumerable:!0,get:function(){return u},set:function(S){u=S}});var c=arguments[2];Object.defineProperty(this,"width",{enumerable:!0,get:function(){return c},set:function(S){c=S}});var f=arguments[3];Object.defineProperty(this,"height",{enumerable:!0,get:function(){return f},set:function(S){f=S}});var p=arguments[4];Object.defineProperty(this,"text",{enumerable:!0,get:function(){return p},set:function(S){p=S}});var d=arguments[5];Object.defineProperty(this,"lineNumber",{enumerable:!0,get:function(){return d},set:function(S){d=S}});var v=arguments[6];return Object.defineProperty(this,"align",{enumerable:!0,get:function(){return v},set:function(S){v=S}}),this};i.prototype.clone=function(){return new i(this.x,this.y,this.width,this.height,this.text,this.lineNumber,this.align)},i.prototype.toArray=function(){return[this.x,this.y,this.width,this.height,this.text,this.lineNumber,this.align]},e.setHeaderFunction=function(l){return r.call(this),this.internal.__cell__.headerFunction=typeof l=="function"?l:void 0,this},e.getTextDimensions=function(l,u){r.call(this);var c=(u=u||{}).fontSize||this.getFontSize(),f=u.font||this.getFont(),p=u.scaleFactor||this.internal.scaleFactor,d=0,v=0,S=0,x=this;if(!Array.isArray(l)&&typeof l!="string"){if(typeof l!="number")throw new Error("getTextDimensions expects text-parameter to be of type String or type Number or an Array of Strings.");l=String(l)}var g=u.maxWidth;g>0?typeof l=="string"?l=this.splitTextToSize(l,g):Object.prototype.toString.call(l)==="[object Array]"&&(l=l.reduce(function(_,E){return _.concat(x.splitTextToSize(E,g))},[])):l=Array.isArray(l)?l:[l];for(var y=0;y<l.length;y++)d<(S=this.getStringUnitWidth(l[y],{font:f})*c)&&(d=S);return d!==0&&(v=l.length),{w:d/=p,h:Math.max((v*c*this.getLineHeightFactor()-c*(this.getLineHeightFactor()-1))/p,0)}},e.cellAddPage=function(){r.call(this),this.addPage();var l=this.internal.__cell__.margins||t;return this.internal.__cell__.lastCell=new i(l.left,l.top,void 0,void 0),this.internal.__cell__.pages+=1,this};var s=e.cell=function(){var l;l=arguments[0]instanceof i?arguments[0]:new i(arguments[0],arguments[1],arguments[2],arguments[3],arguments[4],arguments[5]),r.call(this);var u=this.internal.__cell__.lastCell,c=this.internal.__cell__.padding,f=this.internal.__cell__.margins||t,p=this.internal.__cell__.tableHeaderRow,d=this.internal.__cell__.printHeaders;return u.lineNumber!==void 0&&(u.lineNumber===l.lineNumber?(l.x=(u.x||0)+(u.width||0),l.y=u.y||0):u.y+u.height+l.height+f.bottom>this.getPageHeight()?(this.cellAddPage(),l.y=f.top,d&&p&&(this.printHeaderRow(l.lineNumber,!0),l.y+=p[0].height)):l.y=u.y+u.height||l.y),l.text[0]!==void 0&&(this.rect(l.x,l.y,l.width,l.height,n===!0?"FD":void 0),l.align==="right"?this.text(l.text,l.x+l.width-c,l.y+c,{align:"right",baseline:"top"}):l.align==="center"?this.text(l.text,l.x+l.width/2,l.y+c,{align:"center",baseline:"top",maxWidth:l.width-c-c}):this.text(l.text,l.x+c,l.y+c,{align:"left",baseline:"top",maxWidth:l.width-c-c})),this.internal.__cell__.lastCell=l,this};e.table=function(l,u,c,f,p){if(r.call(this),!c)throw new Error("No data for PDF table.");var d,v,S,x,g=[],y=[],_=[],E={},D={},R=[],O=[],j=(p=p||{}).autoSize||!1,$=p.printHeaders!==!1,V=p.css&&p.css["font-size"]!==void 0?16*p.css["font-size"]:p.fontSize||12,T=p.margins||Object.assign({width:this.getPageWidth()},t),P=typeof p.padding=="number"?p.padding:3,q=p.headerBackgroundColor||"#c8c8c8",Y=p.headerTextColor||"#000";if(a.call(this),this.internal.__cell__.printHeaders=$,this.internal.__cell__.margins=T,this.internal.__cell__.table_font_size=V,this.internal.__cell__.padding=P,this.internal.__cell__.headerBackgroundColor=q,this.internal.__cell__.headerTextColor=Y,this.setFontSize(V),f==null)y=g=Object.keys(c[0]),_=g.map(function(){return"left"});else if(Array.isArray(f)&&Ut(f[0])==="object")for(g=f.map(function(J){return J.name}),y=f.map(function(J){return J.prompt||J.name||""}),_=f.map(function(J){return J.align||"left"}),d=0;d<f.length;d+=1)D[f[d].name]=f[d].width*(19.049976/25.4);else Array.isArray(f)&&typeof f[0]=="string"&&(y=g=f,_=g.map(function(){return"left"}));if(j||Array.isArray(f)&&typeof f[0]=="string")for(d=0;d<g.length;d+=1){for(E[x=g[d]]=c.map(function(J){return J[x]}),this.setFont(void 0,"bold"),R.push(this.getTextDimensions(y[d],{fontSize:this.internal.__cell__.table_font_size,scaleFactor:this.internal.scaleFactor}).w),v=E[x],this.setFont(void 0,"normal"),S=0;S<v.length;S+=1)R.push(this.getTextDimensions(v[S],{fontSize:this.internal.__cell__.table_font_size,scaleFactor:this.internal.scaleFactor}).w);D[x]=Math.max.apply(null,R)+P+P,R=[]}if($){var se={};for(d=0;d<g.length;d+=1)se[g[d]]={},se[g[d]].text=y[d],se[g[d]].align=_[d];var G=o.call(this,se,D);O=g.map(function(J){return new i(l,u,D[J],G,se[J].text,void 0,se[J].align)}),this.setTableHeaderRow(O),this.printHeaderRow(1,!1)}var ne=f.reduce(function(J,le){return J[le.name]=le.align,J},{});for(d=0;d<c.length;d+=1){"rowStart"in p&&p.rowStart instanceof Function&&p.rowStart({row:d,data:c[d]},this);var Q=o.call(this,c[d],D);for(S=0;S<g.length;S+=1){var ie=c[d][g[S]];"cellStart"in p&&p.cellStart instanceof Function&&p.cellStart({row:d,col:S,data:ie},this),s.call(this,new i(l,u,D[g[S]],Q,ie,d+2,ne[g[S]]))}}return this.internal.__cell__.table_x=l,this.internal.__cell__.table_y=u,this};var o=function(l,u){var c=this.internal.__cell__.padding,f=this.internal.__cell__.table_font_size,p=this.internal.scaleFactor;return Object.keys(l).map(function(d){var v=l[d];return this.splitTextToSize(v.hasOwnProperty("text")?v.text:v,u[d]-c-c)},this).map(function(d){return this.getLineHeightFactor()*d.length*f/p+c+c},this).reduce(function(d,v){return Math.max(d,v)},0)};e.setTableHeaderRow=function(l){r.call(this),this.internal.__cell__.tableHeaderRow=l},e.printHeaderRow=function(l,u){if(r.call(this),!this.internal.__cell__.tableHeaderRow)throw new Error("Property tableHeaderRow does not exist.");var c;if(n=!0,typeof this.internal.__cell__.headerFunction=="function"){var f=this.internal.__cell__.headerFunction(this,this.internal.__cell__.pages);this.internal.__cell__.lastCell=new i(f[0],f[1],f[2],f[3],void 0,-1)}this.setFont(void 0,"bold");for(var p=[],d=0;d<this.internal.__cell__.tableHeaderRow.length;d+=1){c=this.internal.__cell__.tableHeaderRow[d].clone(),u&&(c.y=this.internal.__cell__.margins.top||0,p.push(c)),c.lineNumber=l;var v=this.getTextColor();this.setTextColor(this.internal.__cell__.headerTextColor),this.setFillColor(this.internal.__cell__.headerBackgroundColor),s.call(this,c),this.setTextColor(v)}p.length>0&&this.setTableHeaderRow(p),this.setFont(void 0,"normal"),n=!1}}(lt.API);var WE={italic:["italic","oblique","normal"],oblique:["oblique","italic","normal"],normal:["normal","oblique","italic"]},JE=["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded"],hy=GE(JE),KE=[100,200,300,400,500,600,700,800,900],nH=GE(KE);function py(e){var t=e.family.replace(/"|'/g,"").toLowerCase(),n=function(i){return WE[i=i||"normal"]?i:"normal"}(e.style),r=function(i){if(!i)return 400;if(typeof i=="number")return i>=100&&i<=900&&i%100==0?i:400;if(/^\d00$/.test(i))return parseInt(i);switch(i){case"bold":return 700;case"normal":default:return 400}}(e.weight),a=function(i){return typeof hy[i=i||"normal"]=="number"?i:"normal"}(e.stretch);return{family:t,style:n,weight:r,stretch:a,src:e.src||[],ref:e.ref||{name:t,style:[a,n,r].join(" ")}}}function v3(e,t,n,r){var a;for(a=n;a>=0&&a<t.length;a+=r)if(e[t[a]])return e[t[a]];for(a=n;a>=0&&a<t.length;a-=r)if(e[t[a]])return e[t[a]]}var rH={"sans-serif":"helvetica",fixed:"courier",monospace:"courier",terminal:"courier",cursive:"times",fantasy:"times",serif:"times"},y3={caption:"times",icon:"times",menu:"times","message-box":"times","small-caption":"times","status-bar":"times"};function b3(e){return[e.stretch,e.style,e.weight,e.family].join(" ")}function aH(e,t,n){for(var r=(n=n||{}).defaultFontFamily||"times",a=Object.assign({},rH,n.genericFontFamilies||{}),i=null,s=null,o=0;o<t.length;++o)if(a[(i=py(t[o])).family]&&(i.family=a[i.family]),e.hasOwnProperty(i.family)){s=e[i.family];break}if(!(s=s||e[r]))throw new Error("Could not find a font-family for the rule '"+b3(i)+"' and default family '"+r+"'.");if(s=function(l,u){if(u[l])return u[l];var c=hy[l],f=c<=hy.normal?-1:1,p=v3(u,JE,c,f);if(!p)throw new Error("Could not find a matching font-stretch value for "+l);return p}(i.stretch,s),s=function(l,u){if(u[l])return u[l];for(var c=WE[l],f=0;f<c.length;++f)if(u[c[f]])return u[c[f]];throw new Error("Could not find a matching font-style for "+l)}(i.style,s),!(s=function(l,u){if(u[l])return u[l];if(l===400&&u[500])return u[500];if(l===500&&u[400])return u[400];var c=nH[l],f=v3(u,KE,c,l<400?-1:1);if(!f)throw new Error("Could not find a matching font-weight for value "+l);return f}(i.weight,s)))throw new Error("Failed to resolve a font for the rule '"+b3(i)+"'.");return s}function w3(e){return e.trimLeft()}function iH(e,t){for(var n=0;n<e.length;){if(e.charAt(n)===t)return[e.substring(0,n),e.substring(n+1)];n+=1}return null}function sH(e){var t=e.match(/^(-[a-z_]|[a-z_])[a-z0-9_-]*/i);return t===null?null:[t[0],e.substring(t[0].length)]}var gp,x3,S3,r2=["times"];(function(e){var t,n,r,a,i,s,o,l,u,c=function(L){return L=L||{},this.isStrokeTransparent=L.isStrokeTransparent||!1,this.strokeOpacity=L.strokeOpacity||1,this.strokeStyle=L.strokeStyle||"#000000",this.fillStyle=L.fillStyle||"#000000",this.isFillTransparent=L.isFillTransparent||!1,this.fillOpacity=L.fillOpacity||1,this.font=L.font||"10px sans-serif",this.textBaseline=L.textBaseline||"alphabetic",this.textAlign=L.textAlign||"left",this.lineWidth=L.lineWidth||1,this.lineJoin=L.lineJoin||"miter",this.lineCap=L.lineCap||"butt",this.path=L.path||[],this.transform=L.transform!==void 0?L.transform.clone():new l,this.globalCompositeOperation=L.globalCompositeOperation||"normal",this.globalAlpha=L.globalAlpha||1,this.clip_path=L.clip_path||[],this.currentPoint=L.currentPoint||new s,this.miterLimit=L.miterLimit||10,this.lastPoint=L.lastPoint||new s,this.lineDashOffset=L.lineDashOffset||0,this.lineDash=L.lineDash||[],this.margin=L.margin||[0,0,0,0],this.prevPageLastElemOffset=L.prevPageLastElemOffset||0,this.ignoreClearRect=typeof L.ignoreClearRect!="boolean"||L.ignoreClearRect,this};e.events.push(["initialized",function(){this.context2d=new f(this),t=this.internal.f2,n=this.internal.getCoordinateString,r=this.internal.getVerticalCoordinateString,a=this.internal.getHorizontalCoordinate,i=this.internal.getVerticalCoordinate,s=this.internal.Point,o=this.internal.Rectangle,l=this.internal.Matrix,u=new c}]);var f=function(L){Object.defineProperty(this,"canvas",{get:function(){return{parentNode:!1,style:!1}}});var z=L;Object.defineProperty(this,"pdf",{get:function(){return z}});var W=!1;Object.defineProperty(this,"pageWrapXEnabled",{get:function(){return W},set:function(pe){W=!!pe}});var te=!1;Object.defineProperty(this,"pageWrapYEnabled",{get:function(){return te},set:function(pe){te=!!pe}});var B=0;Object.defineProperty(this,"posX",{get:function(){return B},set:function(pe){isNaN(pe)||(B=pe)}});var ee=0;Object.defineProperty(this,"posY",{get:function(){return ee},set:function(pe){isNaN(pe)||(ee=pe)}}),Object.defineProperty(this,"margin",{get:function(){return u.margin},set:function(pe){var X;typeof pe=="number"?X=[pe,pe,pe,pe]:((X=new Array(4))[0]=pe[0],X[1]=pe.length>=2?pe[1]:X[0],X[2]=pe.length>=3?pe[2]:X[0],X[3]=pe.length>=4?pe[3]:X[1]),u.margin=X}});var fe=!1;Object.defineProperty(this,"autoPaging",{get:function(){return fe},set:function(pe){fe=pe}});var me=0;Object.defineProperty(this,"lastBreak",{get:function(){return me},set:function(pe){me=pe}});var Se=[];Object.defineProperty(this,"pageBreaks",{get:function(){return Se},set:function(pe){Se=pe}}),Object.defineProperty(this,"ctx",{get:function(){return u},set:function(pe){pe instanceof c&&(u=pe)}}),Object.defineProperty(this,"path",{get:function(){return u.path},set:function(pe){u.path=pe}});var we=[];Object.defineProperty(this,"ctxStack",{get:function(){return we},set:function(pe){we=pe}}),Object.defineProperty(this,"fillStyle",{get:function(){return this.ctx.fillStyle},set:function(pe){var X;X=p(pe),this.ctx.fillStyle=X.style,this.ctx.isFillTransparent=X.a===0,this.ctx.fillOpacity=X.a,this.pdf.setFillColor(X.r,X.g,X.b,{a:X.a}),this.pdf.setTextColor(X.r,X.g,X.b,{a:X.a})}}),Object.defineProperty(this,"strokeStyle",{get:function(){return this.ctx.strokeStyle},set:function(pe){var X=p(pe);this.ctx.strokeStyle=X.style,this.ctx.isStrokeTransparent=X.a===0,this.ctx.strokeOpacity=X.a,X.a===0?this.pdf.setDrawColor(255,255,255):(X.a,this.pdf.setDrawColor(X.r,X.g,X.b))}}),Object.defineProperty(this,"lineCap",{get:function(){return this.ctx.lineCap},set:function(pe){["butt","round","square"].indexOf(pe)!==-1&&(this.ctx.lineCap=pe,this.pdf.setLineCap(pe))}}),Object.defineProperty(this,"lineWidth",{get:function(){return this.ctx.lineWidth},set:function(pe){isNaN(pe)||(this.ctx.lineWidth=pe,this.pdf.setLineWidth(pe))}}),Object.defineProperty(this,"lineJoin",{get:function(){return this.ctx.lineJoin},set:function(pe){["bevel","round","miter"].indexOf(pe)!==-1&&(this.ctx.lineJoin=pe,this.pdf.setLineJoin(pe))}}),Object.defineProperty(this,"miterLimit",{get:function(){return this.ctx.miterLimit},set:function(pe){isNaN(pe)||(this.ctx.miterLimit=pe,this.pdf.setMiterLimit(pe))}}),Object.defineProperty(this,"textBaseline",{get:function(){return this.ctx.textBaseline},set:function(pe){this.ctx.textBaseline=pe}}),Object.defineProperty(this,"textAlign",{get:function(){return this.ctx.textAlign},set:function(pe){["right","end","center","left","start"].indexOf(pe)!==-1&&(this.ctx.textAlign=pe)}});var je=null;function Ae(pe,X){if(je===null){var Ge=function(Pe){var Te=[];return Object.keys(Pe).forEach(function(Ie){Pe[Ie].forEach(function(qe){var Fe=null;switch(qe){case"bold":Fe={family:Ie,weight:"bold"};break;case"italic":Fe={family:Ie,style:"italic"};break;case"bolditalic":Fe={family:Ie,weight:"bold",style:"italic"};break;case"":case"normal":Fe={family:Ie}}Fe!==null&&(Fe.ref={name:Ie,style:qe},Te.push(Fe))})}),Te}(pe.getFontList());je=function(Pe){for(var Te={},Ie=0;Ie<Pe.length;++Ie){var qe=py(Pe[Ie]),Fe=qe.family,Qe=qe.stretch,ht=qe.style,gt=qe.weight;Te[Fe]=Te[Fe]||{},Te[Fe][Qe]=Te[Fe][Qe]||{},Te[Fe][Qe][ht]=Te[Fe][Qe][ht]||{},Te[Fe][Qe][ht][gt]=qe}return Te}(Ge.concat(X))}return je}var Me=null;Object.defineProperty(this,"fontFaces",{get:function(){return Me},set:function(pe){je=null,Me=pe}}),Object.defineProperty(this,"font",{get:function(){return this.ctx.font},set:function(pe){var X;if(this.ctx.font=pe,(X=/^\s*(?=(?:(?:[-a-z]+\s*){0,2}(italic|oblique))?)(?=(?:(?:[-a-z]+\s*){0,2}(small-caps))?)(?=(?:(?:[-a-z]+\s*){0,2}(bold(?:er)?|lighter|[1-9]00))?)(?:(?:normal|\1|\2|\3)\s*){0,3}((?:xx?-)?(?:small|large)|medium|smaller|larger|[.\d]+(?:\%|in|[cem]m|ex|p[ctx]))(?:\s*\/\s*(normal|[.\d]+(?:\%|in|[cem]m|ex|p[ctx])))?\s*([-_,\"\'\sa-z]+?)\s*$/i.exec(pe))!==null){var Ge=X[1];X[2];var Pe=X[3],Te=X[4];X[5];var Ie=X[6],qe=/^([.\d]+)((?:%|in|[cem]m|ex|p[ctx]))$/i.exec(Te)[2];Te=Math.floor(qe==="px"?parseFloat(Te)*this.pdf.internal.scaleFactor:qe==="em"?parseFloat(Te)*this.pdf.getFontSize():parseFloat(Te)*this.pdf.internal.scaleFactor),this.pdf.setFontSize(Te);var Fe=function(ut){var Et,He,hn=[],Pt=ut.trim();if(Pt==="")return r2;if(Pt in y3)return[y3[Pt]];for(;Pt!=="";){switch(He=null,Et=(Pt=w3(Pt)).charAt(0)){case'"':case"'":He=iH(Pt.substring(1),Et);break;default:He=sH(Pt)}if(He===null||(hn.push(He[0]),(Pt=w3(He[1]))!==""&&Pt.charAt(0)!==","))return r2;Pt=Pt.replace(/^,/,"")}return hn}(Ie);if(this.fontFaces){var Qe=aH(Ae(this.pdf,this.fontFaces),Fe.map(function(ut){return{family:ut,stretch:"normal",weight:Pe,style:Ge}}));this.pdf.setFont(Qe.ref.name,Qe.ref.style)}else{var ht="";(Pe==="bold"||parseInt(Pe,10)>=700||Ge==="bold")&&(ht="bold"),Ge==="italic"&&(ht+="italic"),ht.length===0&&(ht="normal");for(var gt="",ft={arial:"Helvetica",Arial:"Helvetica",verdana:"Helvetica",Verdana:"Helvetica",helvetica:"Helvetica",Helvetica:"Helvetica","sans-serif":"Helvetica",fixed:"Courier",monospace:"Courier",terminal:"Courier",cursive:"Times",fantasy:"Times",serif:"Times"},wt=0;wt<Fe.length;wt++){if(this.pdf.internal.getFont(Fe[wt],ht,{noFallback:!0,disableWarning:!0})!==void 0){gt=Fe[wt];break}if(ht==="bolditalic"&&this.pdf.internal.getFont(Fe[wt],"bold",{noFallback:!0,disableWarning:!0})!==void 0)gt=Fe[wt],ht="bold";else if(this.pdf.internal.getFont(Fe[wt],"normal",{noFallback:!0,disableWarning:!0})!==void 0){gt=Fe[wt],ht="normal";break}}if(gt===""){for(var Vt=0;Vt<Fe.length;Vt++)if(ft[Fe[Vt]]){gt=ft[Fe[Vt]];break}}gt=gt===""?"Times":gt,this.pdf.setFont(gt,ht)}}}}),Object.defineProperty(this,"globalCompositeOperation",{get:function(){return this.ctx.globalCompositeOperation},set:function(pe){this.ctx.globalCompositeOperation=pe}}),Object.defineProperty(this,"globalAlpha",{get:function(){return this.ctx.globalAlpha},set:function(pe){this.ctx.globalAlpha=pe}}),Object.defineProperty(this,"lineDashOffset",{get:function(){return this.ctx.lineDashOffset},set:function(pe){this.ctx.lineDashOffset=pe,le.call(this)}}),Object.defineProperty(this,"lineDash",{get:function(){return this.ctx.lineDash},set:function(pe){this.ctx.lineDash=pe,le.call(this)}}),Object.defineProperty(this,"ignoreClearRect",{get:function(){return this.ctx.ignoreClearRect},set:function(pe){this.ctx.ignoreClearRect=!!pe}})};f.prototype.setLineDash=function(L){this.lineDash=L},f.prototype.getLineDash=function(){return this.lineDash.length%2?this.lineDash.concat(this.lineDash):this.lineDash.slice()},f.prototype.fill=function(){E.call(this,"fill",!1)},f.prototype.stroke=function(){E.call(this,"stroke",!1)},f.prototype.beginPath=function(){this.path=[{type:"begin"}]},f.prototype.moveTo=function(L,z){if(isNaN(L)||isNaN(z))throw fn.error("jsPDF.context2d.moveTo: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.moveTo");var W=this.ctx.transform.applyToPoint(new s(L,z));this.path.push({type:"mt",x:W.x,y:W.y}),this.ctx.lastPoint=new s(L,z)},f.prototype.closePath=function(){var L=new s(0,0),z=0;for(z=this.path.length-1;z!==-1;z--)if(this.path[z].type==="begin"&&Ut(this.path[z+1])==="object"&&typeof this.path[z+1].x=="number"){L=new s(this.path[z+1].x,this.path[z+1].y);break}this.path.push({type:"close"}),this.ctx.lastPoint=new s(L.x,L.y)},f.prototype.lineTo=function(L,z){if(isNaN(L)||isNaN(z))throw fn.error("jsPDF.context2d.lineTo: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.lineTo");var W=this.ctx.transform.applyToPoint(new s(L,z));this.path.push({type:"lt",x:W.x,y:W.y}),this.ctx.lastPoint=new s(W.x,W.y)},f.prototype.clip=function(){this.ctx.clip_path=JSON.parse(JSON.stringify(this.path)),E.call(this,null,!0)},f.prototype.quadraticCurveTo=function(L,z,W,te){if(isNaN(W)||isNaN(te)||isNaN(L)||isNaN(z))throw fn.error("jsPDF.context2d.quadraticCurveTo: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.quadraticCurveTo");var B=this.ctx.transform.applyToPoint(new s(W,te)),ee=this.ctx.transform.applyToPoint(new s(L,z));this.path.push({type:"qct",x1:ee.x,y1:ee.y,x:B.x,y:B.y}),this.ctx.lastPoint=new s(B.x,B.y)},f.prototype.bezierCurveTo=function(L,z,W,te,B,ee){if(isNaN(B)||isNaN(ee)||isNaN(L)||isNaN(z)||isNaN(W)||isNaN(te))throw fn.error("jsPDF.context2d.bezierCurveTo: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.bezierCurveTo");var fe=this.ctx.transform.applyToPoint(new s(B,ee)),me=this.ctx.transform.applyToPoint(new s(L,z)),Se=this.ctx.transform.applyToPoint(new s(W,te));this.path.push({type:"bct",x1:me.x,y1:me.y,x2:Se.x,y2:Se.y,x:fe.x,y:fe.y}),this.ctx.lastPoint=new s(fe.x,fe.y)},f.prototype.arc=function(L,z,W,te,B,ee){if(isNaN(L)||isNaN(z)||isNaN(W)||isNaN(te)||isNaN(B))throw fn.error("jsPDF.context2d.arc: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.arc");if(ee=!!ee,!this.ctx.transform.isIdentity){var fe=this.ctx.transform.applyToPoint(new s(L,z));L=fe.x,z=fe.y;var me=this.ctx.transform.applyToPoint(new s(0,W)),Se=this.ctx.transform.applyToPoint(new s(0,0));W=Math.sqrt(Math.pow(me.x-Se.x,2)+Math.pow(me.y-Se.y,2))}Math.abs(B-te)>=2*Math.PI&&(te=0,B=2*Math.PI),this.path.push({type:"arc",x:L,y:z,radius:W,startAngle:te,endAngle:B,counterclockwise:ee})},f.prototype.arcTo=function(L,z,W,te,B){throw new Error("arcTo not implemented.")},f.prototype.rect=function(L,z,W,te){if(isNaN(L)||isNaN(z)||isNaN(W)||isNaN(te))throw fn.error("jsPDF.context2d.rect: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.rect");this.moveTo(L,z),this.lineTo(L+W,z),this.lineTo(L+W,z+te),this.lineTo(L,z+te),this.lineTo(L,z),this.lineTo(L+W,z),this.lineTo(L,z)},f.prototype.fillRect=function(L,z,W,te){if(isNaN(L)||isNaN(z)||isNaN(W)||isNaN(te))throw fn.error("jsPDF.context2d.fillRect: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.fillRect");if(!d.call(this)){var B={};this.lineCap!=="butt"&&(B.lineCap=this.lineCap,this.lineCap="butt"),this.lineJoin!=="miter"&&(B.lineJoin=this.lineJoin,this.lineJoin="miter"),this.beginPath(),this.rect(L,z,W,te),this.fill(),B.hasOwnProperty("lineCap")&&(this.lineCap=B.lineCap),B.hasOwnProperty("lineJoin")&&(this.lineJoin=B.lineJoin)}},f.prototype.strokeRect=function(L,z,W,te){if(isNaN(L)||isNaN(z)||isNaN(W)||isNaN(te))throw fn.error("jsPDF.context2d.strokeRect: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.strokeRect");v.call(this)||(this.beginPath(),this.rect(L,z,W,te),this.stroke())},f.prototype.clearRect=function(L,z,W,te){if(isNaN(L)||isNaN(z)||isNaN(W)||isNaN(te))throw fn.error("jsPDF.context2d.clearRect: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.clearRect");this.ignoreClearRect||(this.fillStyle="#ffffff",this.fillRect(L,z,W,te))},f.prototype.save=function(L){L=typeof L!="boolean"||L;for(var z=this.pdf.internal.getCurrentPageInfo().pageNumber,W=0;W<this.pdf.internal.getNumberOfPages();W++)this.pdf.setPage(W+1),this.pdf.internal.out("q");if(this.pdf.setPage(z),L){this.ctx.fontSize=this.pdf.internal.getFontSize();var te=new c(this.ctx);this.ctxStack.push(this.ctx),this.ctx=te}},f.prototype.restore=function(L){L=typeof L!="boolean"||L;for(var z=this.pdf.internal.getCurrentPageInfo().pageNumber,W=0;W<this.pdf.internal.getNumberOfPages();W++)this.pdf.setPage(W+1),this.pdf.internal.out("Q");this.pdf.setPage(z),L&&this.ctxStack.length!==0&&(this.ctx=this.ctxStack.pop(),this.fillStyle=this.ctx.fillStyle,this.strokeStyle=this.ctx.strokeStyle,this.font=this.ctx.font,this.lineCap=this.ctx.lineCap,this.lineWidth=this.ctx.lineWidth,this.lineJoin=this.ctx.lineJoin,this.lineDash=this.ctx.lineDash,this.lineDashOffset=this.ctx.lineDashOffset)},f.prototype.toDataURL=function(){throw new Error("toDataUrl not implemented.")};var p=function(L){var z,W,te,B;if(L.isCanvasGradient===!0&&(L=L.getColor()),!L)return{r:0,g:0,b:0,a:0,style:L};if(/transparent|rgba\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*,\s*0+\s*\)/.test(L))z=0,W=0,te=0,B=0;else{var ee=/rgb\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)/.exec(L);if(ee!==null)z=parseInt(ee[1]),W=parseInt(ee[2]),te=parseInt(ee[3]),B=1;else if((ee=/rgba\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*,\s*([\d.]+)\s*\)/.exec(L))!==null)z=parseInt(ee[1]),W=parseInt(ee[2]),te=parseInt(ee[3]),B=parseFloat(ee[4]);else{if(B=1,typeof L=="string"&&L.charAt(0)!=="#"){var fe=new UE(L);L=fe.ok?fe.toHex():"#000000"}L.length===4?(z=L.substring(1,2),z+=z,W=L.substring(2,3),W+=W,te=L.substring(3,4),te+=te):(z=L.substring(1,3),W=L.substring(3,5),te=L.substring(5,7)),z=parseInt(z,16),W=parseInt(W,16),te=parseInt(te,16)}}return{r:z,g:W,b:te,a:B,style:L}},d=function(){return this.ctx.isFillTransparent||this.globalAlpha==0},v=function(){return!!(this.ctx.isStrokeTransparent||this.globalAlpha==0)};f.prototype.fillText=function(L,z,W,te){if(isNaN(z)||isNaN(W)||typeof L!="string")throw fn.error("jsPDF.context2d.fillText: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.fillText");if(te=isNaN(te)?void 0:te,!d.call(this)){var B=Q(this.ctx.transform.rotation),ee=this.ctx.transform.scaleX;P.call(this,{text:L,x:z,y:W,scale:ee,angle:B,align:this.textAlign,maxWidth:te})}},f.prototype.strokeText=function(L,z,W,te){if(isNaN(z)||isNaN(W)||typeof L!="string")throw fn.error("jsPDF.context2d.strokeText: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.strokeText");if(!v.call(this)){te=isNaN(te)?void 0:te;var B=Q(this.ctx.transform.rotation),ee=this.ctx.transform.scaleX;P.call(this,{text:L,x:z,y:W,scale:ee,renderingMode:"stroke",angle:B,align:this.textAlign,maxWidth:te})}},f.prototype.measureText=function(L){if(typeof L!="string")throw fn.error("jsPDF.context2d.measureText: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.measureText");var z=this.pdf,W=this.pdf.internal.scaleFactor,te=z.internal.getFontSize(),B=z.getStringUnitWidth(L)*te/z.internal.scaleFactor,ee=function(fe){var me=(fe=fe||{}).width||0;return Object.defineProperty(this,"width",{get:function(){return me}}),this};return new ee({width:B*=Math.round(96*W/72*1e4)/1e4})},f.prototype.scale=function(L,z){if(isNaN(L)||isNaN(z))throw fn.error("jsPDF.context2d.scale: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.scale");var W=new l(L,0,0,z,0,0);this.ctx.transform=this.ctx.transform.multiply(W)},f.prototype.rotate=function(L){if(isNaN(L))throw fn.error("jsPDF.context2d.rotate: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.rotate");var z=new l(Math.cos(L),Math.sin(L),-Math.sin(L),Math.cos(L),0,0);this.ctx.transform=this.ctx.transform.multiply(z)},f.prototype.translate=function(L,z){if(isNaN(L)||isNaN(z))throw fn.error("jsPDF.context2d.translate: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.translate");var W=new l(1,0,0,1,L,z);this.ctx.transform=this.ctx.transform.multiply(W)},f.prototype.transform=function(L,z,W,te,B,ee){if(isNaN(L)||isNaN(z)||isNaN(W)||isNaN(te)||isNaN(B)||isNaN(ee))throw fn.error("jsPDF.context2d.transform: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.transform");var fe=new l(L,z,W,te,B,ee);this.ctx.transform=this.ctx.transform.multiply(fe)},f.prototype.setTransform=function(L,z,W,te,B,ee){L=isNaN(L)?1:L,z=isNaN(z)?0:z,W=isNaN(W)?0:W,te=isNaN(te)?1:te,B=isNaN(B)?0:B,ee=isNaN(ee)?0:ee,this.ctx.transform=new l(L,z,W,te,B,ee)};var S=function(){return this.margin[0]>0||this.margin[1]>0||this.margin[2]>0||this.margin[3]>0};f.prototype.drawImage=function(L,z,W,te,B,ee,fe,me,Se){var we=this.pdf.getImageProperties(L),je=1,Ae=1,Me=1,pe=1;te!==void 0&&me!==void 0&&(Me=me/te,pe=Se/B,je=we.width/te*me/te,Ae=we.height/B*Se/B),ee===void 0&&(ee=z,fe=W,z=0,W=0),te!==void 0&&me===void 0&&(me=te,Se=B),te===void 0&&me===void 0&&(me=we.width,Se=we.height);for(var X,Ge=this.ctx.transform.decompose(),Pe=Q(Ge.rotate.shx),Te=new l,Ie=(Te=(Te=(Te=Te.multiply(Ge.translate)).multiply(Ge.skew)).multiply(Ge.scale)).applyToRectangle(new o(ee-z*Me,fe-W*pe,te*je,B*Ae)),qe=x.call(this,Ie),Fe=[],Qe=0;Qe<qe.length;Qe+=1)Fe.indexOf(qe[Qe])===-1&&Fe.push(qe[Qe]);if(_(Fe),this.autoPaging)for(var ht=Fe[0],gt=Fe[Fe.length-1],ft=ht;ft<gt+1;ft++){this.pdf.setPage(ft);var wt=this.pdf.internal.pageSize.width-this.margin[3]-this.margin[1],Vt=ft===1?this.posY+this.margin[0]:this.margin[0],ut=this.pdf.internal.pageSize.height-this.posY-this.margin[0]-this.margin[2],Et=this.pdf.internal.pageSize.height-this.margin[0]-this.margin[2],He=ft===1?0:ut+(ft-2)*Et;if(this.ctx.clip_path.length!==0){var hn=this.path;X=JSON.parse(JSON.stringify(this.ctx.clip_path)),this.path=y(X,this.posX+this.margin[3],-He+Vt+this.ctx.prevPageLastElemOffset),D.call(this,"fill",!0),this.path=hn}var Pt=JSON.parse(JSON.stringify(Ie));Pt=y([Pt],this.posX+this.margin[3],-He+Vt+this.ctx.prevPageLastElemOffset)[0];var Yr=(ft>ht||ft<gt)&&S.call(this);Yr&&(this.pdf.saveGraphicsState(),this.pdf.rect(this.margin[3],this.margin[0],wt,Et,null).clip().discardPath()),this.pdf.addImage(L,"JPEG",Pt.x,Pt.y,Pt.w,Pt.h,null,null,Pe),Yr&&this.pdf.restoreGraphicsState()}else this.pdf.addImage(L,"JPEG",Ie.x,Ie.y,Ie.w,Ie.h,null,null,Pe)};var x=function(L,z,W){var te=[];z=z||this.pdf.internal.pageSize.width,W=W||this.pdf.internal.pageSize.height-this.margin[0]-this.margin[2];var B=this.posY+this.ctx.prevPageLastElemOffset;switch(L.type){default:case"mt":case"lt":te.push(Math.floor((L.y+B)/W)+1);break;case"arc":te.push(Math.floor((L.y+B-L.radius)/W)+1),te.push(Math.floor((L.y+B+L.radius)/W)+1);break;case"qct":var ee=ie(this.ctx.lastPoint.x,this.ctx.lastPoint.y,L.x1,L.y1,L.x,L.y);te.push(Math.floor((ee.y+B)/W)+1),te.push(Math.floor((ee.y+ee.h+B)/W)+1);break;case"bct":var fe=J(this.ctx.lastPoint.x,this.ctx.lastPoint.y,L.x1,L.y1,L.x2,L.y2,L.x,L.y);te.push(Math.floor((fe.y+B)/W)+1),te.push(Math.floor((fe.y+fe.h+B)/W)+1);break;case"rect":te.push(Math.floor((L.y+B)/W)+1),te.push(Math.floor((L.y+L.h+B)/W)+1)}for(var me=0;me<te.length;me+=1)for(;this.pdf.internal.getNumberOfPages()<te[me];)g.call(this);return te},g=function(){var L=this.fillStyle,z=this.strokeStyle,W=this.font,te=this.lineCap,B=this.lineWidth,ee=this.lineJoin;this.pdf.addPage(),this.fillStyle=L,this.strokeStyle=z,this.font=W,this.lineCap=te,this.lineWidth=B,this.lineJoin=ee},y=function(L,z,W){for(var te=0;te<L.length;te++)switch(L[te].type){case"bct":L[te].x2+=z,L[te].y2+=W;case"qct":L[te].x1+=z,L[te].y1+=W;case"mt":case"lt":case"arc":default:L[te].x+=z,L[te].y+=W}return L},_=function(L){return L.sort(function(z,W){return z-W})},E=function(L,z){for(var W,te,B=this.fillStyle,ee=this.strokeStyle,fe=this.lineCap,me=this.lineWidth,Se=Math.abs(me*this.ctx.transform.scaleX),we=this.lineJoin,je=JSON.parse(JSON.stringify(this.path)),Ae=JSON.parse(JSON.stringify(this.path)),Me=[],pe=0;pe<Ae.length;pe++)if(Ae[pe].x!==void 0)for(var X=x.call(this,Ae[pe]),Ge=0;Ge<X.length;Ge+=1)Me.indexOf(X[Ge])===-1&&Me.push(X[Ge]);for(var Pe=0;Pe<Me.length;Pe++)for(;this.pdf.internal.getNumberOfPages()<Me[Pe];)g.call(this);if(_(Me),this.autoPaging)for(var Te=Me[0],Ie=Me[Me.length-1],qe=Te;qe<Ie+1;qe++){this.pdf.setPage(qe),this.fillStyle=B,this.strokeStyle=ee,this.lineCap=fe,this.lineWidth=Se,this.lineJoin=we;var Fe=this.pdf.internal.pageSize.width-this.margin[3]-this.margin[1],Qe=qe===1?this.posY+this.margin[0]:this.margin[0],ht=this.pdf.internal.pageSize.height-this.posY-this.margin[0]-this.margin[2],gt=this.pdf.internal.pageSize.height-this.margin[0]-this.margin[2],ft=qe===1?0:ht+(qe-2)*gt;if(this.ctx.clip_path.length!==0){var wt=this.path;W=JSON.parse(JSON.stringify(this.ctx.clip_path)),this.path=y(W,this.posX+this.margin[3],-ft+Qe+this.ctx.prevPageLastElemOffset),D.call(this,L,!0),this.path=wt}if(te=JSON.parse(JSON.stringify(je)),this.path=y(te,this.posX+this.margin[3],-ft+Qe+this.ctx.prevPageLastElemOffset),z===!1||qe===0){var Vt=(qe>Te||qe<Ie)&&S.call(this);Vt&&(this.pdf.saveGraphicsState(),this.pdf.rect(this.margin[3],this.margin[0],Fe,gt,null).clip().discardPath()),D.call(this,L,z),Vt&&this.pdf.restoreGraphicsState()}this.lineWidth=me}else this.lineWidth=Se,D.call(this,L,z),this.lineWidth=me;this.path=je},D=function(L,z){if((L!=="stroke"||z||!v.call(this))&&(L==="stroke"||z||!d.call(this))){for(var W,te,B=[],ee=this.path,fe=0;fe<ee.length;fe++){var me=ee[fe];switch(me.type){case"begin":B.push({begin:!0});break;case"close":B.push({close:!0});break;case"mt":B.push({start:me,deltas:[],abs:[]});break;case"lt":var Se=B.length;if(ee[fe-1]&&!isNaN(ee[fe-1].x)&&(W=[me.x-ee[fe-1].x,me.y-ee[fe-1].y],Se>0)){for(;Se>=0;Se--)if(B[Se-1].close!==!0&&B[Se-1].begin!==!0){B[Se-1].deltas.push(W),B[Se-1].abs.push(me);break}}break;case"bct":W=[me.x1-ee[fe-1].x,me.y1-ee[fe-1].y,me.x2-ee[fe-1].x,me.y2-ee[fe-1].y,me.x-ee[fe-1].x,me.y-ee[fe-1].y],B[B.length-1].deltas.push(W);break;case"qct":var we=ee[fe-1].x+2/3*(me.x1-ee[fe-1].x),je=ee[fe-1].y+2/3*(me.y1-ee[fe-1].y),Ae=me.x+2/3*(me.x1-me.x),Me=me.y+2/3*(me.y1-me.y),pe=me.x,X=me.y;W=[we-ee[fe-1].x,je-ee[fe-1].y,Ae-ee[fe-1].x,Me-ee[fe-1].y,pe-ee[fe-1].x,X-ee[fe-1].y],B[B.length-1].deltas.push(W);break;case"arc":B.push({deltas:[],abs:[],arc:!0}),Array.isArray(B[B.length-1].abs)&&B[B.length-1].abs.push(me)}}te=z?null:L==="stroke"?"stroke":"fill";for(var Ge=!1,Pe=0;Pe<B.length;Pe++)if(B[Pe].arc)for(var Te=B[Pe].abs,Ie=0;Ie<Te.length;Ie++){var qe=Te[Ie];qe.type==="arc"?j.call(this,qe.x,qe.y,qe.radius,qe.startAngle,qe.endAngle,qe.counterclockwise,void 0,z,!Ge):q.call(this,qe.x,qe.y),Ge=!0}else if(B[Pe].close===!0)this.pdf.internal.out("h"),Ge=!1;else if(B[Pe].begin!==!0){var Fe=B[Pe].start.x,Qe=B[Pe].start.y;Y.call(this,B[Pe].deltas,Fe,Qe),Ge=!0}te&&$.call(this,te),z&&V.call(this)}},R=function(L){var z=this.pdf.internal.getFontSize()/this.pdf.internal.scaleFactor,W=z*(this.pdf.internal.getLineHeightFactor()-1);switch(this.ctx.textBaseline){case"bottom":return L-W;case"top":return L+z-W;case"hanging":return L+z-2*W;case"middle":return L+z/2-W;case"ideographic":return L;case"alphabetic":default:return L}},O=function(L){return L+this.pdf.internal.getFontSize()/this.pdf.internal.scaleFactor*(this.pdf.internal.getLineHeightFactor()-1)};f.prototype.createLinearGradient=function(){var L=function(){};return L.colorStops=[],L.addColorStop=function(z,W){this.colorStops.push([z,W])},L.getColor=function(){return this.colorStops.length===0?"#000000":this.colorStops[0][1]},L.isCanvasGradient=!0,L},f.prototype.createPattern=function(){return this.createLinearGradient()},f.prototype.createRadialGradient=function(){return this.createLinearGradient()};var j=function(L,z,W,te,B,ee,fe,me,Se){for(var we=G.call(this,W,te,B,ee),je=0;je<we.length;je++){var Ae=we[je];je===0&&(Se?T.call(this,Ae.x1+L,Ae.y1+z):q.call(this,Ae.x1+L,Ae.y1+z)),se.call(this,L,z,Ae.x2,Ae.y2,Ae.x3,Ae.y3,Ae.x4,Ae.y4)}me?V.call(this):$.call(this,fe)},$=function(L){switch(L){case"stroke":this.pdf.internal.out("S");break;case"fill":this.pdf.internal.out("f")}},V=function(){this.pdf.clip(),this.pdf.discardPath()},T=function(L,z){this.pdf.internal.out(n(L)+" "+r(z)+" m")},P=function(L){var z;switch(L.align){case"right":case"end":z="right";break;case"center":z="center";break;case"left":case"start":default:z="left"}var W=this.pdf.getTextDimensions(L.text),te=R.call(this,L.y),B=O.call(this,te)-W.h,ee=this.ctx.transform.applyToPoint(new s(L.x,te)),fe=this.ctx.transform.decompose(),me=new l;me=(me=(me=me.multiply(fe.translate)).multiply(fe.skew)).multiply(fe.scale);for(var Se,we,je,Ae=this.ctx.transform.applyToRectangle(new o(L.x,te,W.w,W.h)),Me=me.applyToRectangle(new o(L.x,B,W.w,W.h)),pe=x.call(this,Me),X=[],Ge=0;Ge<pe.length;Ge+=1)X.indexOf(pe[Ge])===-1&&X.push(pe[Ge]);if(_(X),this.autoPaging)for(var Pe=X[0],Te=X[X.length-1],Ie=Pe;Ie<Te+1;Ie++){this.pdf.setPage(Ie);var qe=Ie===1?this.posY+this.margin[0]:this.margin[0],Fe=this.pdf.internal.pageSize.height-this.posY-this.margin[0]-this.margin[2],Qe=this.pdf.internal.pageSize.height-this.margin[2],ht=Qe-this.margin[0],gt=this.pdf.internal.pageSize.width-this.margin[1],ft=gt-this.margin[3],wt=Ie===1?0:Fe+(Ie-2)*ht;if(this.ctx.clip_path.length!==0){var Vt=this.path;Se=JSON.parse(JSON.stringify(this.ctx.clip_path)),this.path=y(Se,this.posX+this.margin[3],-1*wt+qe),D.call(this,"fill",!0),this.path=Vt}var ut=y([JSON.parse(JSON.stringify(Me))],this.posX+this.margin[3],-wt+qe+this.ctx.prevPageLastElemOffset)[0];L.scale>=.01&&(we=this.pdf.internal.getFontSize(),this.pdf.setFontSize(we*L.scale),je=this.lineWidth,this.lineWidth=je*L.scale);var Et=this.autoPaging!=="text";if(Et||ut.y+ut.h<=Qe){if(Et||ut.y>=qe&&ut.x<=gt){var He=Et?L.text:this.pdf.splitTextToSize(L.text,L.maxWidth||gt-ut.x)[0],hn=y([JSON.parse(JSON.stringify(Ae))],this.posX+this.margin[3],-wt+qe+this.ctx.prevPageLastElemOffset)[0],Pt=Et&&(Ie>Pe||Ie<Te)&&S.call(this);Pt&&(this.pdf.saveGraphicsState(),this.pdf.rect(this.margin[3],this.margin[0],ft,ht,null).clip().discardPath()),this.pdf.text(He,hn.x,hn.y,{angle:L.angle,align:z,renderingMode:L.renderingMode}),Pt&&this.pdf.restoreGraphicsState()}}else ut.y<Qe&&(this.ctx.prevPageLastElemOffset+=Qe-ut.y);L.scale>=.01&&(this.pdf.setFontSize(we),this.lineWidth=je)}else L.scale>=.01&&(we=this.pdf.internal.getFontSize(),this.pdf.setFontSize(we*L.scale),je=this.lineWidth,this.lineWidth=je*L.scale),this.pdf.text(L.text,ee.x+this.posX,ee.y+this.posY,{angle:L.angle,align:z,renderingMode:L.renderingMode,maxWidth:L.maxWidth}),L.scale>=.01&&(this.pdf.setFontSize(we),this.lineWidth=je)},q=function(L,z,W,te){W=W||0,te=te||0,this.pdf.internal.out(n(L+W)+" "+r(z+te)+" l")},Y=function(L,z,W){return this.pdf.lines(L,z,W,null,null)},se=function(L,z,W,te,B,ee,fe,me){this.pdf.internal.out([t(a(W+L)),t(i(te+z)),t(a(B+L)),t(i(ee+z)),t(a(fe+L)),t(i(me+z)),"c"].join(" "))},G=function(L,z,W,te){for(var B=2*Math.PI,ee=Math.PI/2;z>W;)z-=B;var fe=Math.abs(W-z);fe<B&&te&&(fe=B-fe);for(var me=[],Se=te?-1:1,we=z;fe>1e-5;){var je=we+Se*Math.min(fe,ee);me.push(ne.call(this,L,we,je)),fe-=Math.abs(je-we),we=je}return me},ne=function(L,z,W){var te=(W-z)/2,B=L*Math.cos(te),ee=L*Math.sin(te),fe=B,me=-ee,Se=fe*fe+me*me,we=Se+fe*B+me*ee,je=4/3*(Math.sqrt(2*Se*we)-we)/(fe*ee-me*B),Ae=fe-je*me,Me=me+je*fe,pe=Ae,X=-Me,Ge=te+z,Pe=Math.cos(Ge),Te=Math.sin(Ge);return{x1:L*Math.cos(z),y1:L*Math.sin(z),x2:Ae*Pe-Me*Te,y2:Ae*Te+Me*Pe,x3:pe*Pe-X*Te,y3:pe*Te+X*Pe,x4:L*Math.cos(W),y4:L*Math.sin(W)}},Q=function(L){return 180*L/Math.PI},ie=function(L,z,W,te,B,ee){var fe=L+.5*(W-L),me=z+.5*(te-z),Se=B+.5*(W-B),we=ee+.5*(te-ee),je=Math.min(L,B,fe,Se),Ae=Math.max(L,B,fe,Se),Me=Math.min(z,ee,me,we),pe=Math.max(z,ee,me,we);return new o(je,Me,Ae-je,pe-Me)},J=function(L,z,W,te,B,ee,fe,me){var Se,we,je,Ae,Me,pe,X,Ge,Pe,Te,Ie,qe,Fe,Qe,ht=W-L,gt=te-z,ft=B-W,wt=ee-te,Vt=fe-B,ut=me-ee;for(we=0;we<41;we++)Pe=(X=(je=L+(Se=we/40)*ht)+Se*((Me=W+Se*ft)-je))+Se*(Me+Se*(B+Se*Vt-Me)-X),Te=(Ge=(Ae=z+Se*gt)+Se*((pe=te+Se*wt)-Ae))+Se*(pe+Se*(ee+Se*ut-pe)-Ge),we==0?(Ie=Pe,qe=Te,Fe=Pe,Qe=Te):(Ie=Math.min(Ie,Pe),qe=Math.min(qe,Te),Fe=Math.max(Fe,Pe),Qe=Math.max(Qe,Te));return new o(Math.round(Ie),Math.round(qe),Math.round(Fe-Ie),Math.round(Qe-qe))},le=function(){if(this.prevLineDash||this.ctx.lineDash.length||this.ctx.lineDashOffset){var L,z,W=(L=this.ctx.lineDash,z=this.ctx.lineDashOffset,JSON.stringify({lineDash:L,lineDashOffset:z}));this.prevLineDash!==W&&(this.pdf.setLineDash(this.ctx.lineDash,this.ctx.lineDashOffset),this.prevLineDash=W)}}})(lt.API),function(e){var t=function(i){var s,o,l,u,c,f,p,d,v,S;for(o=[],l=0,u=(i+=s="\0\0\0\0".slice(i.length%4||4)).length;u>l;l+=4)(c=(i.charCodeAt(l)<<24)+(i.charCodeAt(l+1)<<16)+(i.charCodeAt(l+2)<<8)+i.charCodeAt(l+3))!==0?(f=(c=((c=((c=((c=(c-(S=c%85))/85)-(v=c%85))/85)-(d=c%85))/85)-(p=c%85))/85)%85,o.push(f+33,p+33,d+33,v+33,S+33)):o.push(122);return function(x,g){for(var y=g;y>0;y--)x.pop()}(o,s.length),String.fromCharCode.apply(String,o)+"~>"},n=function(i){var s,o,l,u,c,f=String,p="length",d=255,v="charCodeAt",S="slice",x="replace";for(i[S](-2),i=i[S](0,-2)[x](/\s/g,"")[x]("z","!!!!!"),l=[],u=0,c=(i+=s="uuuuu"[S](i[p]%5||5))[p];c>u;u+=5)o=52200625*(i[v](u)-33)+614125*(i[v](u+1)-33)+7225*(i[v](u+2)-33)+85*(i[v](u+3)-33)+(i[v](u+4)-33),l.push(d&o>>24,d&o>>16,d&o>>8,d&o);return function(g,y){for(var _=y;_>0;_--)g.pop()}(l,s[p]),f.fromCharCode.apply(f,l)},r=function(i){var s=new RegExp(/^([0-9A-Fa-f]{2})+$/);if((i=i.replace(/\s/g,"")).indexOf(">")!==-1&&(i=i.substr(0,i.indexOf(">"))),i.length%2&&(i+="0"),s.test(i)===!1)return"";for(var o="",l=0;l<i.length;l+=2)o+=String.fromCharCode("0x"+(i[l]+i[l+1]));return o},a=function(i){for(var s=new Uint8Array(i.length),o=i.length;o--;)s[o]=i.charCodeAt(o);return i=(s=ly(s)).reduce(function(l,u){return l+String.fromCharCode(u)},"")};e.processDataByFilters=function(i,s){var o=0,l=i||"",u=[];for(typeof(s=s||[])=="string"&&(s=[s]),o=0;o<s.length;o+=1)switch(s[o]){case"ASCII85Decode":case"/ASCII85Decode":l=n(l),u.push("/ASCII85Encode");break;case"ASCII85Encode":case"/ASCII85Encode":l=t(l),u.push("/ASCII85Decode");break;case"ASCIIHexDecode":case"/ASCIIHexDecode":l=r(l),u.push("/ASCIIHexEncode");break;case"ASCIIHexEncode":case"/ASCIIHexEncode":l=l.split("").map(function(c){return("0"+c.charCodeAt().toString(16)).slice(-2)}).join("")+">",u.push("/ASCIIHexDecode");break;case"FlateEncode":case"/FlateEncode":l=a(l),u.push("/FlateDecode");break;default:throw new Error('The filter: "'+s[o]+'" is not implemented')}return{data:l,reverseChain:u.reverse().join(" ")}}}(lt.API),function(e){e.loadFile=function(t,n,r){return function(a,i,s){i=i!==!1,s=typeof s=="function"?s:function(){};var o=void 0;try{o=function(l,u,c){var f=new XMLHttpRequest,p=0,d=function(v){var S=v.length,x=[],g=String.fromCharCode;for(p=0;p<S;p+=1)x.push(g(255&v.charCodeAt(p)));return x.join("")};if(f.open("GET",l,!u),f.overrideMimeType("text/plain; charset=x-user-defined"),u===!1&&(f.onload=function(){f.status===200?c(d(this.responseText)):c(void 0)}),f.send(null),u&&f.status===200)return d(f.responseText)}(a,i,s)}catch{}return o}(t,n,r)},e.loadImageFile=e.loadFile}(lt.API),function(e){function t(){return(ct.html2canvas?Promise.resolve(ct.html2canvas):Ls(()=>import("./html2canvas.esm-CBrSDip1.js"),[])).catch(function(s){return Promise.reject(new Error("Could not load html2canvas: "+s))}).then(function(s){return s.default?s.default:s})}function n(){return(ct.DOMPurify?Promise.resolve(ct.DOMPurify):Ls(()=>import("./purify.es-CQJ0hv7W.js"),[])).catch(function(s){return Promise.reject(new Error("Could not load dompurify: "+s))}).then(function(s){return s.default?s.default:s})}var r=function(s){var o=Ut(s);return o==="undefined"?"undefined":o==="string"||s instanceof String?"string":o==="number"||s instanceof Number?"number":o==="function"||s instanceof Function?"function":s&&s.constructor===Array?"array":s&&s.nodeType===1?"element":o==="object"?"object":"unknown"},a=function(s,o){var l=document.createElement(s);for(var u in o.className&&(l.className=o.className),o.innerHTML&&o.dompurify&&(l.innerHTML=o.dompurify.sanitize(o.innerHTML)),o.style)l.style[u]=o.style[u];return l},i=function s(o){var l=Object.assign(s.convert(Promise.resolve()),JSON.parse(JSON.stringify(s.template))),u=s.convert(Promise.resolve(),l);return u=(u=u.setProgress(1,s,1,[s])).set(o)};(i.prototype=Object.create(Promise.prototype)).constructor=i,i.convert=function(s,o){return s.__proto__=o||i.prototype,s},i.template={prop:{src:null,container:null,overlay:null,canvas:null,img:null,pdf:null,pageSize:null,callback:function(){}},progress:{val:0,state:null,n:0,stack:[]},opt:{filename:"file.pdf",margin:[0,0,0,0],enableLinks:!0,x:0,y:0,html2canvas:{},jsPDF:{},backgroundColor:"transparent"}},i.prototype.from=function(s,o){return this.then(function(){switch(o=o||function(l){switch(r(l)){case"string":return"string";case"element":return l.nodeName.toLowerCase()==="canvas"?"canvas":"element";default:return"unknown"}}(s)){case"string":return this.then(n).then(function(l){return this.set({src:a("div",{innerHTML:s,dompurify:l})})});case"element":return this.set({src:s});case"canvas":return this.set({canvas:s});case"img":return this.set({img:s});default:return this.error("Unknown source type.")}})},i.prototype.to=function(s){switch(s){case"container":return this.toContainer();case"canvas":return this.toCanvas();case"img":return this.toImg();case"pdf":return this.toPdf();default:return this.error("Invalid target.")}},i.prototype.toContainer=function(){return this.thenList([function(){return this.prop.src||this.error("Cannot duplicate - no source HTML.")},function(){return this.prop.pageSize||this.setPageSize()}]).then(function(){var s={position:"relative",display:"inline-block",width:(typeof this.opt.width!="number"||isNaN(this.opt.width)||typeof this.opt.windowWidth!="number"||isNaN(this.opt.windowWidth)?Math.max(this.prop.src.clientWidth,this.prop.src.scrollWidth,this.prop.src.offsetWidth):this.opt.windowWidth)+"px",left:0,right:0,top:0,margin:"auto",backgroundColor:this.opt.backgroundColor},o=function l(u,c){for(var f=u.nodeType===3?document.createTextNode(u.nodeValue):u.cloneNode(!1),p=u.firstChild;p;p=p.nextSibling)c!==!0&&p.nodeType===1&&p.nodeName==="SCRIPT"||f.appendChild(l(p,c));return u.nodeType===1&&(u.nodeName==="CANVAS"?(f.width=u.width,f.height=u.height,f.getContext("2d").drawImage(u,0,0)):u.nodeName!=="TEXTAREA"&&u.nodeName!=="SELECT"||(f.value=u.value),f.addEventListener("load",function(){f.scrollTop=u.scrollTop,f.scrollLeft=u.scrollLeft},!0)),f}(this.prop.src,this.opt.html2canvas.javascriptEnabled);o.tagName==="BODY"&&(s.height=Math.max(document.body.scrollHeight,document.body.offsetHeight,document.documentElement.clientHeight,document.documentElement.scrollHeight,document.documentElement.offsetHeight)+"px"),this.prop.overlay=a("div",{className:"html2pdf__overlay",style:{position:"fixed",overflow:"hidden",zIndex:1e3,left:"-100000px",right:0,bottom:0,top:0}}),this.prop.container=a("div",{className:"html2pdf__container",style:s}),this.prop.container.appendChild(o),this.prop.container.firstChild.appendChild(a("div",{style:{clear:"both",border:"0 none transparent",margin:0,padding:0,height:0}})),this.prop.container.style.float="none",this.prop.overlay.appendChild(this.prop.container),document.body.appendChild(this.prop.overlay),this.prop.container.firstChild.style.position="relative",this.prop.container.height=Math.max(this.prop.container.firstChild.clientHeight,this.prop.container.firstChild.scrollHeight,this.prop.container.firstChild.offsetHeight)+"px"})},i.prototype.toCanvas=function(){var s=[function(){return document.body.contains(this.prop.container)||this.toContainer()}];return this.thenList(s).then(t).then(function(o){var l=Object.assign({},this.opt.html2canvas);return delete l.onrendered,o(this.prop.container,l)}).then(function(o){(this.opt.html2canvas.onrendered||function(){})(o),this.prop.canvas=o,document.body.removeChild(this.prop.overlay)})},i.prototype.toContext2d=function(){var s=[function(){return document.body.contains(this.prop.container)||this.toContainer()}];return this.thenList(s).then(t).then(function(o){var l=this.opt.jsPDF,u=this.opt.fontFaces,c=typeof this.opt.width!="number"||isNaN(this.opt.width)||typeof this.opt.windowWidth!="number"||isNaN(this.opt.windowWidth)?1:this.opt.width/this.opt.windowWidth,f=Object.assign({async:!0,allowTaint:!0,scale:c,scrollX:this.opt.scrollX||0,scrollY:this.opt.scrollY||0,backgroundColor:"#ffffff",imageTimeout:15e3,logging:!0,proxy:null,removeContainer:!0,foreignObjectRendering:!1,useCORS:!1},this.opt.html2canvas);if(delete f.onrendered,l.context2d.autoPaging=this.opt.autoPaging===void 0||this.opt.autoPaging,l.context2d.posX=this.opt.x,l.context2d.posY=this.opt.y,l.context2d.margin=this.opt.margin,l.context2d.fontFaces=u,u)for(var p=0;p<u.length;++p){var d=u[p],v=d.src.find(function(S){return S.format==="truetype"});v&&l.addFont(v.url,d.ref.name,d.ref.style)}return f.windowHeight=f.windowHeight||0,f.windowHeight=f.windowHeight==0?Math.max(this.prop.container.clientHeight,this.prop.container.scrollHeight,this.prop.container.offsetHeight):f.windowHeight,l.context2d.save(!0),o(this.prop.container,f)}).then(function(o){this.opt.jsPDF.context2d.restore(!0),(this.opt.html2canvas.onrendered||function(){})(o),this.prop.canvas=o,document.body.removeChild(this.prop.overlay)})},i.prototype.toImg=function(){return this.thenList([function(){return this.prop.canvas||this.toCanvas()}]).then(function(){var s=this.prop.canvas.toDataURL("image/"+this.opt.image.type,this.opt.image.quality);this.prop.img=document.createElement("img"),this.prop.img.src=s})},i.prototype.toPdf=function(){return this.thenList([function(){return this.toContext2d()}]).then(function(){this.prop.pdf=this.prop.pdf||this.opt.jsPDF})},i.prototype.output=function(s,o,l){return(l=l||"pdf").toLowerCase()==="img"||l.toLowerCase()==="image"?this.outputImg(s,o):this.outputPdf(s,o)},i.prototype.outputPdf=function(s,o){return this.thenList([function(){return this.prop.pdf||this.toPdf()}]).then(function(){return this.prop.pdf.output(s,o)})},i.prototype.outputImg=function(s){return this.thenList([function(){return this.prop.img||this.toImg()}]).then(function(){switch(s){case void 0:case"img":return this.prop.img;case"datauristring":case"dataurlstring":return this.prop.img.src;case"datauri":case"dataurl":return document.location.href=this.prop.img.src;default:throw'Image output type "'+s+'" is not supported.'}})},i.prototype.save=function(s){return this.thenList([function(){return this.prop.pdf||this.toPdf()}]).set(s?{filename:s}:null).then(function(){this.prop.pdf.save(this.opt.filename)})},i.prototype.doCallback=function(){return this.thenList([function(){return this.prop.pdf||this.toPdf()}]).then(function(){this.prop.callback(this.prop.pdf)})},i.prototype.set=function(s){if(r(s)!=="object")return this;var o=Object.keys(s||{}).map(function(l){if(l in i.template.prop)return function(){this.prop[l]=s[l]};switch(l){case"margin":return this.setMargin.bind(this,s.margin);case"jsPDF":return function(){return this.opt.jsPDF=s.jsPDF,this.setPageSize()};case"pageSize":return this.setPageSize.bind(this,s.pageSize);default:return function(){this.opt[l]=s[l]}}},this);return this.then(function(){return this.thenList(o)})},i.prototype.get=function(s,o){return this.then(function(){var l=s in i.template.prop?this.prop[s]:this.opt[s];return o?o(l):l})},i.prototype.setMargin=function(s){return this.then(function(){switch(r(s)){case"number":s=[s,s,s,s];case"array":if(s.length===2&&(s=[s[0],s[1],s[0],s[1]]),s.length===4)break;default:return this.error("Invalid margin array.")}this.opt.margin=s}).then(this.setPageSize)},i.prototype.setPageSize=function(s){function o(l,u){return Math.floor(l*u/72*96)}return this.then(function(){(s=s||lt.getPageSize(this.opt.jsPDF)).hasOwnProperty("inner")||(s.inner={width:s.width-this.opt.margin[1]-this.opt.margin[3],height:s.height-this.opt.margin[0]-this.opt.margin[2]},s.inner.px={width:o(s.inner.width,s.k),height:o(s.inner.height,s.k)},s.inner.ratio=s.inner.height/s.inner.width),this.prop.pageSize=s})},i.prototype.setProgress=function(s,o,l,u){return s!=null&&(this.progress.val=s),o!=null&&(this.progress.state=o),l!=null&&(this.progress.n=l),u!=null&&(this.progress.stack=u),this.progress.ratio=this.progress.val/this.progress.state,this},i.prototype.updateProgress=function(s,o,l,u){return this.setProgress(s?this.progress.val+s:null,o||null,l?this.progress.n+l:null,u?this.progress.stack.concat(u):null)},i.prototype.then=function(s,o){var l=this;return this.thenCore(s,o,function(u,c){return l.updateProgress(null,null,1,[u]),Promise.prototype.then.call(this,function(f){return l.updateProgress(null,u),f}).then(u,c).then(function(f){return l.updateProgress(1),f})})},i.prototype.thenCore=function(s,o,l){l=l||Promise.prototype.then,s&&(s=s.bind(this)),o&&(o=o.bind(this));var u=Promise.toString().indexOf("[native code]")!==-1&&Promise.name==="Promise"?this:i.convert(Object.assign({},this),Promise.prototype),c=l.call(u,s,o);return i.convert(c,this.__proto__)},i.prototype.thenExternal=function(s,o){return Promise.prototype.then.call(this,s,o)},i.prototype.thenList=function(s){var o=this;return s.forEach(function(l){o=o.thenCore(l)}),o},i.prototype.catch=function(s){s&&(s=s.bind(this));var o=Promise.prototype.catch.call(this,s);return i.convert(o,this)},i.prototype.catchExternal=function(s){return Promise.prototype.catch.call(this,s)},i.prototype.error=function(s){return this.then(function(){throw new Error(s)})},i.prototype.using=i.prototype.set,i.prototype.saveAs=i.prototype.save,i.prototype.export=i.prototype.output,i.prototype.run=i.prototype.then,lt.getPageSize=function(s,o,l){if(Ut(s)==="object"){var u=s;s=u.orientation,o=u.unit||o,l=u.format||l}o=o||"mm",l=l||"a4",s=(""+(s||"P")).toLowerCase();var c,f=(""+l).toLowerCase(),p={a0:[2383.94,3370.39],a1:[1683.78,2383.94],a2:[1190.55,1683.78],a3:[841.89,1190.55],a4:[595.28,841.89],a5:[419.53,595.28],a6:[297.64,419.53],a7:[209.76,297.64],a8:[147.4,209.76],a9:[104.88,147.4],a10:[73.7,104.88],b0:[2834.65,4008.19],b1:[2004.09,2834.65],b2:[1417.32,2004.09],b3:[1000.63,1417.32],b4:[708.66,1000.63],b5:[498.9,708.66],b6:[354.33,498.9],b7:[249.45,354.33],b8:[175.75,249.45],b9:[124.72,175.75],b10:[87.87,124.72],c0:[2599.37,3676.54],c1:[1836.85,2599.37],c2:[1298.27,1836.85],c3:[918.43,1298.27],c4:[649.13,918.43],c5:[459.21,649.13],c6:[323.15,459.21],c7:[229.61,323.15],c8:[161.57,229.61],c9:[113.39,161.57],c10:[79.37,113.39],dl:[311.81,623.62],letter:[612,792],"government-letter":[576,756],legal:[612,1008],"junior-legal":[576,360],ledger:[1224,792],tabloid:[792,1224],"credit-card":[153,243]};switch(o){case"pt":c=1;break;case"mm":c=72/25.4;break;case"cm":c=72/2.54;break;case"in":c=72;break;case"px":c=.75;break;case"pc":case"em":c=12;break;case"ex":c=6;break;default:throw"Invalid unit: "+o}var d,v=0,S=0;if(p.hasOwnProperty(f))v=p[f][1]/c,S=p[f][0]/c;else try{v=l[1],S=l[0]}catch{throw new Error("Invalid format: "+l)}if(s==="p"||s==="portrait")s="p",S>v&&(d=S,S=v,v=d);else{if(s!=="l"&&s!=="landscape")throw"Invalid orientation: "+s;s="l",v>S&&(d=S,S=v,v=d)}return{width:S,height:v,unit:o,k:c,orientation:s}},e.html=function(s,o){(o=o||{}).callback=o.callback||function(){},o.html2canvas=o.html2canvas||{},o.html2canvas.canvas=o.html2canvas.canvas||this.canvas,o.jsPDF=o.jsPDF||this,o.fontFaces=o.fontFaces?o.fontFaces.map(py):null;var l=new i(o);return o.worker?l:l.from(s).doCallback()}}(lt.API),lt.API.addJS=function(e){return S3=e,this.internal.events.subscribe("postPutResources",function(){gp=this.internal.newObject(),this.internal.out("<<"),this.internal.out("/Names [(EmbeddedJS) "+(gp+1)+" 0 R]"),this.internal.out(">>"),this.internal.out("endobj"),x3=this.internal.newObject(),this.internal.out("<<"),this.internal.out("/S /JavaScript"),this.internal.out("/JS ("+S3+")"),this.internal.out(">>"),this.internal.out("endobj")}),this.internal.events.subscribe("putCatalog",function(){gp!==void 0&&x3!==void 0&&this.internal.out("/Names <</JavaScript "+gp+" 0 R>>")}),this},function(e){var t;e.events.push(["postPutResources",function(){var n=this,r=/^(\d+) 0 obj$/;if(this.outline.root.children.length>0)for(var a=n.outline.render().split(/\r\n/),i=0;i<a.length;i++){var s=a[i],o=r.exec(s);if(o!=null){var l=o[1];n.internal.newObjectDeferredBegin(l,!1)}n.internal.write(s)}if(this.outline.createNamedDestinations){var u=this.internal.pages.length,c=[];for(i=0;i<u;i++){var f=n.internal.newObject();c.push(f);var p=n.internal.getPageInfo(i+1);n.internal.write("<< /D["+p.objId+" 0 R /XYZ null null null]>> endobj")}var d=n.internal.newObject();for(n.internal.write("<< /Names [ "),i=0;i<c.length;i++)n.internal.write("(page_"+(i+1)+")"+c[i]+" 0 R");n.internal.write(" ] >>","endobj"),t=n.internal.newObject(),n.internal.write("<< /Dests "+d+" 0 R"),n.internal.write(">>","endobj")}}]),e.events.push(["putCatalog",function(){this.outline.root.children.length>0&&(this.internal.write("/Outlines",this.outline.makeRef(this.outline.root)),this.outline.createNamedDestinations&&this.internal.write("/Names "+t+" 0 R"))}]),e.events.push(["initialized",function(){var n=this;n.outline={createNamedDestinations:!1,root:{children:[]}},n.outline.add=function(r,a,i){var s={title:a,options:i,children:[]};return r==null&&(r=this.root),r.children.push(s),s},n.outline.render=function(){return this.ctx={},this.ctx.val="",this.ctx.pdf=n,this.genIds_r(this.root),this.renderRoot(this.root),this.renderItems(this.root),this.ctx.val},n.outline.genIds_r=function(r){r.id=n.internal.newObjectDeferred();for(var a=0;a<r.children.length;a++)this.genIds_r(r.children[a])},n.outline.renderRoot=function(r){this.objStart(r),this.line("/Type /Outlines"),r.children.length>0&&(this.line("/First "+this.makeRef(r.children[0])),this.line("/Last "+this.makeRef(r.children[r.children.length-1]))),this.line("/Count "+this.count_r({count:0},r)),this.objEnd()},n.outline.renderItems=function(r){for(var a=this.ctx.pdf.internal.getVerticalCoordinateString,i=0;i<r.children.length;i++){var s=r.children[i];this.objStart(s),this.line("/Title "+this.makeString(s.title)),this.line("/Parent "+this.makeRef(r)),i>0&&this.line("/Prev "+this.makeRef(r.children[i-1])),i<r.children.length-1&&this.line("/Next "+this.makeRef(r.children[i+1])),s.children.length>0&&(this.line("/First "+this.makeRef(s.children[0])),this.line("/Last "+this.makeRef(s.children[s.children.length-1])));var o=this.count=this.count_r({count:0},s);if(o>0&&this.line("/Count "+o),s.options&&s.options.pageNumber){var l=n.internal.getPageInfo(s.options.pageNumber);this.line("/Dest ["+l.objId+" 0 R /XYZ 0 "+a(0)+" 0]")}this.objEnd()}for(var u=0;u<r.children.length;u++)this.renderItems(r.children[u])},n.outline.line=function(r){this.ctx.val+=r+`\r
234
+ `},n.outline.makeRef=function(r){return r.id+" 0 R"},n.outline.makeString=function(r){return"("+n.internal.pdfEscape(r)+")"},n.outline.objStart=function(r){this.ctx.val+=`\r
235
+ `+r.id+` 0 obj\r
236
+ <<\r
237
+ `},n.outline.objEnd=function(){this.ctx.val+=`>> \r
238
+ endobj\r
239
+ `},n.outline.count_r=function(r,a){for(var i=0;i<a.children.length;i++)r.count++,this.count_r(r,a.children[i]);return r.count}}])}(lt.API),function(e){var t=[192,193,194,195,196,197,198,199];e.processJPEG=function(n,r,a,i,s,o){var l,u=this.decode.DCT_DECODE,c=null;if(typeof n=="string"||this.__addimage__.isArrayBuffer(n)||this.__addimage__.isArrayBufferView(n)){switch(n=s||n,n=this.__addimage__.isArrayBuffer(n)?new Uint8Array(n):n,(l=function(f){for(var p,d=256*f.charCodeAt(4)+f.charCodeAt(5),v=f.length,S={width:0,height:0,numcomponents:1},x=4;x<v;x+=2){if(x+=d,t.indexOf(f.charCodeAt(x+1))!==-1){p=256*f.charCodeAt(x+5)+f.charCodeAt(x+6),S={width:256*f.charCodeAt(x+7)+f.charCodeAt(x+8),height:p,numcomponents:f.charCodeAt(x+9)};break}d=256*f.charCodeAt(x+2)+f.charCodeAt(x+3)}return S}(n=this.__addimage__.isArrayBufferView(n)?this.__addimage__.arrayBufferToBinaryString(n):n)).numcomponents){case 1:o=this.color_spaces.DEVICE_GRAY;break;case 4:o=this.color_spaces.DEVICE_CMYK;break;case 3:o=this.color_spaces.DEVICE_RGB}c={data:n,width:l.width,height:l.height,colorSpace:o,bitsPerComponent:8,filter:u,index:r,alias:a}}return c}}(lt.API);var pu,vp,_3,A3,N3,oH=function(){var e,t,n;function r(i){var s,o,l,u,c,f,p,d,v,S,x,g,y,_;for(this.data=i,this.pos=8,this.palette=[],this.imgData=[],this.transparency={},this.animation=null,this.text={},f=null;;){switch(s=this.readUInt32(),v=(function(){var E,D;for(D=[],E=0;E<4;++E)D.push(String.fromCharCode(this.data[this.pos++]));return D}).call(this).join("")){case"IHDR":this.width=this.readUInt32(),this.height=this.readUInt32(),this.bits=this.data[this.pos++],this.colorType=this.data[this.pos++],this.compressionMethod=this.data[this.pos++],this.filterMethod=this.data[this.pos++],this.interlaceMethod=this.data[this.pos++];break;case"acTL":this.animation={numFrames:this.readUInt32(),numPlays:this.readUInt32()||1/0,frames:[]};break;case"PLTE":this.palette=this.read(s);break;case"fcTL":f&&this.animation.frames.push(f),this.pos+=4,f={width:this.readUInt32(),height:this.readUInt32(),xOffset:this.readUInt32(),yOffset:this.readUInt32()},c=this.readUInt16(),u=this.readUInt16()||100,f.delay=1e3*c/u,f.disposeOp=this.data[this.pos++],f.blendOp=this.data[this.pos++],f.data=[];break;case"IDAT":case"fdAT":for(v==="fdAT"&&(this.pos+=4,s-=4),i=(f!=null?f.data:void 0)||this.imgData,g=0;0<=s?g<s:g>s;0<=s?++g:--g)i.push(this.data[this.pos++]);break;case"tRNS":switch(this.transparency={},this.colorType){case 3:if(l=this.palette.length/3,this.transparency.indexed=this.read(s),this.transparency.indexed.length>l)throw new Error("More transparent colors than palette size");if((S=l-this.transparency.indexed.length)>0)for(y=0;0<=S?y<S:y>S;0<=S?++y:--y)this.transparency.indexed.push(255);break;case 0:this.transparency.grayscale=this.read(s)[0];break;case 2:this.transparency.rgb=this.read(s)}break;case"tEXt":p=(x=this.read(s)).indexOf(0),d=String.fromCharCode.apply(String,x.slice(0,p)),this.text[d]=String.fromCharCode.apply(String,x.slice(p+1));break;case"IEND":return f&&this.animation.frames.push(f),this.colors=(function(){switch(this.colorType){case 0:case 3:case 4:return 1;case 2:case 6:return 3}}).call(this),this.hasAlphaChannel=(_=this.colorType)===4||_===6,o=this.colors+(this.hasAlphaChannel?1:0),this.pixelBitlength=this.bits*o,this.colorSpace=(function(){switch(this.colors){case 1:return"DeviceGray";case 3:return"DeviceRGB"}}).call(this),void(this.imgData=new Uint8Array(this.imgData));default:this.pos+=s}if(this.pos+=4,this.pos>this.data.length)throw new Error("Incomplete or corrupt PNG file")}}r.prototype.read=function(i){var s,o;for(o=[],s=0;0<=i?s<i:s>i;0<=i?++s:--s)o.push(this.data[this.pos++]);return o},r.prototype.readUInt32=function(){return this.data[this.pos++]<<24|this.data[this.pos++]<<16|this.data[this.pos++]<<8|this.data[this.pos++]},r.prototype.readUInt16=function(){return this.data[this.pos++]<<8|this.data[this.pos++]},r.prototype.decodePixels=function(i){var s=this.pixelBitlength/8,o=new Uint8Array(this.width*this.height*s),l=0,u=this;if(i==null&&(i=this.imgData),i.length===0)return new Uint8Array(0);function c(f,p,d,v){var S,x,g,y,_,E,D,R,O,j,$,V,T,P,q,Y,se,G,ne,Q,ie,J=Math.ceil((u.width-f)/d),le=Math.ceil((u.height-p)/v),L=u.width==J&&u.height==le;for(P=s*J,V=L?o:new Uint8Array(P*le),E=i.length,T=0,x=0;T<le&&l<E;){switch(i[l++]){case 0:for(y=se=0;se<P;y=se+=1)V[x++]=i[l++];break;case 1:for(y=G=0;G<P;y=G+=1)S=i[l++],_=y<s?0:V[x-s],V[x++]=(S+_)%256;break;case 2:for(y=ne=0;ne<P;y=ne+=1)S=i[l++],g=(y-y%s)/s,q=T&&V[(T-1)*P+g*s+y%s],V[x++]=(q+S)%256;break;case 3:for(y=Q=0;Q<P;y=Q+=1)S=i[l++],g=(y-y%s)/s,_=y<s?0:V[x-s],q=T&&V[(T-1)*P+g*s+y%s],V[x++]=(S+Math.floor((_+q)/2))%256;break;case 4:for(y=ie=0;ie<P;y=ie+=1)S=i[l++],g=(y-y%s)/s,_=y<s?0:V[x-s],T===0?q=Y=0:(q=V[(T-1)*P+g*s+y%s],Y=g&&V[(T-1)*P+(g-1)*s+y%s]),D=_+q-Y,R=Math.abs(D-_),j=Math.abs(D-q),$=Math.abs(D-Y),O=R<=j&&R<=$?_:j<=$?q:Y,V[x++]=(S+O)%256;break;default:throw new Error("Invalid filter algorithm: "+i[l-1])}if(!L){var z=((p+T*v)*u.width+f)*s,W=T*P;for(y=0;y<J;y+=1){for(var te=0;te<s;te+=1)o[z++]=V[W++];z+=(d-1)*s}}T++}}return i=Bq(i),u.interlaceMethod==1?(c(0,0,8,8),c(4,0,8,8),c(0,4,4,8),c(2,0,4,4),c(0,2,2,4),c(1,0,2,2),c(0,1,1,2)):c(0,0,1,1),o},r.prototype.decodePalette=function(){var i,s,o,l,u,c,f,p,d;for(o=this.palette,c=this.transparency.indexed||[],u=new Uint8Array((c.length||0)+o.length),l=0,i=0,s=f=0,p=o.length;f<p;s=f+=3)u[l++]=o[s],u[l++]=o[s+1],u[l++]=o[s+2],u[l++]=(d=c[i++])!=null?d:255;return u},r.prototype.copyToImageData=function(i,s){var o,l,u,c,f,p,d,v,S,x,g;if(l=this.colors,S=null,o=this.hasAlphaChannel,this.palette.length&&(S=(g=this._decodedPalette)!=null?g:this._decodedPalette=this.decodePalette(),l=4,o=!0),v=(u=i.data||i).length,f=S||s,c=p=0,l===1)for(;c<v;)d=S?4*s[c/4]:p,x=f[d++],u[c++]=x,u[c++]=x,u[c++]=x,u[c++]=o?f[d++]:255,p=d;else for(;c<v;)d=S?4*s[c/4]:p,u[c++]=f[d++],u[c++]=f[d++],u[c++]=f[d++],u[c++]=o?f[d++]:255,p=d},r.prototype.decode=function(){var i;return i=new Uint8Array(this.width*this.height*4),this.copyToImageData(i,this.decodePixels()),i};var a=function(){if(Object.prototype.toString.call(ct)==="[object Window]"){try{t=ct.document.createElement("canvas"),n=t.getContext("2d")}catch{return!1}return!0}return!1};return a(),e=function(i){var s;if(a()===!0)return n.width=i.width,n.height=i.height,n.clearRect(0,0,i.width,i.height),n.putImageData(i,0,0),(s=new Image).src=t.toDataURL(),s;throw new Error("This method requires a Browser with Canvas-capability.")},r.prototype.decodeFrames=function(i){var s,o,l,u,c,f,p,d;if(this.animation){for(d=[],o=c=0,f=(p=this.animation.frames).length;c<f;o=++c)s=p[o],l=i.createImageData(s.width,s.height),u=this.decodePixels(new Uint8Array(s.data)),this.copyToImageData(l,u),s.imageData=l,d.push(s.image=e(l));return d}},r.prototype.renderFrame=function(i,s){var o,l,u;return o=(l=this.animation.frames)[s],u=l[s-1],s===0&&i.clearRect(0,0,this.width,this.height),(u!=null?u.disposeOp:void 0)===1?i.clearRect(u.xOffset,u.yOffset,u.width,u.height):(u!=null?u.disposeOp:void 0)===2&&i.putImageData(u.imageData,u.xOffset,u.yOffset),o.blendOp===0&&i.clearRect(o.xOffset,o.yOffset,o.width,o.height),i.drawImage(o.image,o.xOffset,o.yOffset)},r.prototype.animate=function(i){var s,o,l,u,c,f,p=this;return o=0,f=this.animation,u=f.numFrames,l=f.frames,c=f.numPlays,(s=function(){var d,v;if(d=o++%u,v=l[d],p.renderFrame(i,d),u>1&&o/u<c)return p.animation._timeout=setTimeout(s,v.delay)})()},r.prototype.stopAnimation=function(){var i;return clearTimeout((i=this.animation)!=null?i._timeout:void 0)},r.prototype.render=function(i){var s,o;return i._png&&i._png.stopAnimation(),i._png=this,i.width=this.width,i.height=this.height,s=i.getContext("2d"),this.animation?(this.decodeFrames(s),this.animate(s)):(o=s.createImageData(this.width,this.height),this.copyToImageData(o,this.decodePixels()),s.putImageData(o,0,0))},r}();/**
240
+ * @license
241
+ *
242
+ * Copyright (c) 2014 James Robb, https://github.com/jamesbrobb
243
+ *
244
+ * Permission is hereby granted, free of charge, to any person obtaining
245
+ * a copy of this software and associated documentation files (the
246
+ * "Software"), to deal in the Software without restriction, including
247
+ * without limitation the rights to use, copy, modify, merge, publish,
248
+ * distribute, sublicense, and/or sell copies of the Software, and to
249
+ * permit persons to whom the Software is furnished to do so, subject to
250
+ * the following conditions:
251
+ *
252
+ * The above copyright notice and this permission notice shall be
253
+ * included in all copies or substantial portions of the Software.
254
+ *
255
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
256
+ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
257
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
258
+ * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
259
+ * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
260
+ * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
261
+ * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
262
+ * ====================================================================
263
+ *//**
264
+ * @license
265
+ * (c) Dean McNamee <dean@gmail.com>, 2013.
266
+ *
267
+ * https://github.com/deanm/omggif
268
+ *
269
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
270
+ * of this software and associated documentation files (the "Software"), to
271
+ * deal in the Software without restriction, including without limitation the
272
+ * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
273
+ * sell copies of the Software, and to permit persons to whom the Software is
274
+ * furnished to do so, subject to the following conditions:
275
+ *
276
+ * The above copyright notice and this permission notice shall be included in
277
+ * all copies or substantial portions of the Software.
278
+ *
279
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
280
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
281
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
282
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
283
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
284
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
285
+ * IN THE SOFTWARE.
286
+ *
287
+ * omggif is a JavaScript implementation of a GIF 89a encoder and decoder,
288
+ * including animation and compression. It does not rely on any specific
289
+ * underlying system, so should run in the browser, Node, or Plask.
290
+ */function lH(e){var t=0;if(e[t++]!==71||e[t++]!==73||e[t++]!==70||e[t++]!==56||(e[t++]+1&253)!=56||e[t++]!==97)throw new Error("Invalid GIF 87a/89a header.");var n=e[t++]|e[t++]<<8,r=e[t++]|e[t++]<<8,a=e[t++],i=a>>7,s=1<<(7&a)+1;e[t++],e[t++];var o=null,l=null;i&&(o=t,l=s,t+=3*s);var u=!0,c=[],f=0,p=null,d=0,v=null;for(this.width=n,this.height=r;u&&t<e.length;)switch(e[t++]){case 33:switch(e[t++]){case 255:if(e[t]!==11||e[t+1]==78&&e[t+2]==69&&e[t+3]==84&&e[t+4]==83&&e[t+5]==67&&e[t+6]==65&&e[t+7]==80&&e[t+8]==69&&e[t+9]==50&&e[t+10]==46&&e[t+11]==48&&e[t+12]==3&&e[t+13]==1&&e[t+16]==0)t+=14,v=e[t++]|e[t++]<<8,t++;else for(t+=12;;){if(!((T=e[t++])>=0))throw Error("Invalid block size");if(T===0)break;t+=T}break;case 249:if(e[t++]!==4||e[t+4]!==0)throw new Error("Invalid graphics extension block.");var S=e[t++];f=e[t++]|e[t++]<<8,p=e[t++],!(1&S)&&(p=null),d=S>>2&7,t++;break;case 254:for(;;){if(!((T=e[t++])>=0))throw Error("Invalid block size");if(T===0)break;t+=T}break;default:throw new Error("Unknown graphic control label: 0x"+e[t-1].toString(16))}break;case 44:var x=e[t++]|e[t++]<<8,g=e[t++]|e[t++]<<8,y=e[t++]|e[t++]<<8,_=e[t++]|e[t++]<<8,E=e[t++],D=E>>6&1,R=1<<(7&E)+1,O=o,j=l,$=!1;E>>7&&($=!0,O=t,j=R,t+=3*R);var V=t;for(t++;;){var T;if(!((T=e[t++])>=0))throw Error("Invalid block size");if(T===0)break;t+=T}c.push({x,y:g,width:y,height:_,has_local_palette:$,palette_offset:O,palette_size:j,data_offset:V,data_length:t-V,transparent_index:p,interlaced:!!D,delay:f,disposal:d});break;case 59:u=!1;break;default:throw new Error("Unknown gif block: 0x"+e[t-1].toString(16))}this.numFrames=function(){return c.length},this.loopCount=function(){return v},this.frameInfo=function(P){if(P<0||P>=c.length)throw new Error("Frame index out of range.");return c[P]},this.decodeAndBlitFrameBGRA=function(P,q){var Y=this.frameInfo(P),se=Y.width*Y.height,G=new Uint8Array(se);E3(e,Y.data_offset,G,se);var ne=Y.palette_offset,Q=Y.transparent_index;Q===null&&(Q=256);var ie=Y.width,J=n-ie,le=ie,L=4*(Y.y*n+Y.x),z=4*((Y.y+Y.height)*n+Y.x),W=L,te=4*J;Y.interlaced===!0&&(te+=4*n*7);for(var B=8,ee=0,fe=G.length;ee<fe;++ee){var me=G[ee];if(le===0&&(le=ie,(W+=te)>=z&&(te=4*J+4*n*(B-1),W=L+(ie+J)*(B<<1),B>>=1)),me===Q)W+=4;else{var Se=e[ne+3*me],we=e[ne+3*me+1],je=e[ne+3*me+2];q[W++]=je,q[W++]=we,q[W++]=Se,q[W++]=255}--le}},this.decodeAndBlitFrameRGBA=function(P,q){var Y=this.frameInfo(P),se=Y.width*Y.height,G=new Uint8Array(se);E3(e,Y.data_offset,G,se);var ne=Y.palette_offset,Q=Y.transparent_index;Q===null&&(Q=256);var ie=Y.width,J=n-ie,le=ie,L=4*(Y.y*n+Y.x),z=4*((Y.y+Y.height)*n+Y.x),W=L,te=4*J;Y.interlaced===!0&&(te+=4*n*7);for(var B=8,ee=0,fe=G.length;ee<fe;++ee){var me=G[ee];if(le===0&&(le=ie,(W+=te)>=z&&(te=4*J+4*n*(B-1),W=L+(ie+J)*(B<<1),B>>=1)),me===Q)W+=4;else{var Se=e[ne+3*me],we=e[ne+3*me+1],je=e[ne+3*me+2];q[W++]=Se,q[W++]=we,q[W++]=je,q[W++]=255}--le}}}function E3(e,t,n,r){for(var a=e[t++],i=1<<a,s=i+1,o=s+1,l=a+1,u=(1<<l)-1,c=0,f=0,p=0,d=e[t++],v=new Int32Array(4096),S=null;;){for(;c<16&&d!==0;)f|=e[t++]<<c,c+=8,d===1?d=e[t++]:--d;if(c<l)break;var x=f&u;if(f>>=l,c-=l,x!==i){if(x===s)break;for(var g=x<o?x:S,y=0,_=g;_>i;)_=v[_]>>8,++y;var E=_;if(p+y+(g!==x?1:0)>r)return void fn.log("Warning, gif stream longer than expected.");n[p++]=E;var D=p+=y;for(g!==x&&(n[p++]=E),_=g;y--;)_=v[_],n[--D]=255&_,_>>=8;S!==null&&o<4096&&(v[o++]=S<<8|E,o>=u+1&&l<12&&(++l,u=u<<1|1)),S=x}else o=s+1,u=(1<<(l=a+1))-1,S=null}return p!==r&&fn.log("Warning, gif stream shorter than expected."),n}/**
291
+ * @license
292
+ Copyright (c) 2008, Adobe Systems Incorporated
293
+ All rights reserved.
294
+
295
+ Redistribution and use in source and binary forms, with or without
296
+ modification, are permitted provided that the following conditions are
297
+ met:
298
+
299
+ * Redistributions of source code must retain the above copyright notice,
300
+ this list of conditions and the following disclaimer.
301
+
302
+ * Redistributions in binary form must reproduce the above copyright
303
+ notice, this list of conditions and the following disclaimer in the
304
+ documentation and/or other materials provided with the distribution.
305
+
306
+ * Neither the name of Adobe Systems Incorporated nor the names of its
307
+ contributors may be used to endorse or promote products derived from
308
+ this software without specific prior written permission.
309
+
310
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
311
+ IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
312
+ THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
313
+ PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
314
+ CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
315
+ EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
316
+ PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
317
+ PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
318
+ LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
319
+ NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
320
+ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
321
+ */function a2(e){var t,n,r,a,i,s=Math.floor,o=new Array(64),l=new Array(64),u=new Array(64),c=new Array(64),f=new Array(65535),p=new Array(65535),d=new Array(64),v=new Array(64),S=[],x=0,g=7,y=new Array(64),_=new Array(64),E=new Array(64),D=new Array(256),R=new Array(2048),O=[0,1,5,6,14,15,27,28,2,4,7,13,16,26,29,42,3,8,12,17,25,30,41,43,9,11,18,24,31,40,44,53,10,19,23,32,39,45,52,54,20,22,33,38,46,51,55,60,21,34,37,47,50,56,59,61,35,36,48,49,57,58,62,63],j=[0,0,1,5,1,1,1,1,1,1,0,0,0,0,0,0,0],$=[0,1,2,3,4,5,6,7,8,9,10,11],V=[0,0,2,1,3,3,2,4,3,5,5,4,4,0,0,1,125],T=[1,2,3,0,4,17,5,18,33,49,65,6,19,81,97,7,34,113,20,50,129,145,161,8,35,66,177,193,21,82,209,240,36,51,98,114,130,9,10,22,23,24,25,26,37,38,39,40,41,42,52,53,54,55,56,57,58,67,68,69,70,71,72,73,74,83,84,85,86,87,88,89,90,99,100,101,102,103,104,105,106,115,116,117,118,119,120,121,122,131,132,133,134,135,136,137,138,146,147,148,149,150,151,152,153,154,162,163,164,165,166,167,168,169,170,178,179,180,181,182,183,184,185,186,194,195,196,197,198,199,200,201,202,210,211,212,213,214,215,216,217,218,225,226,227,228,229,230,231,232,233,234,241,242,243,244,245,246,247,248,249,250],P=[0,0,3,1,1,1,1,1,1,1,1,1,0,0,0,0,0],q=[0,1,2,3,4,5,6,7,8,9,10,11],Y=[0,0,2,1,2,4,4,3,4,7,5,4,4,0,1,2,119],se=[0,1,2,3,17,4,5,33,49,6,18,65,81,7,97,113,19,34,50,129,8,20,66,145,161,177,193,9,35,51,82,240,21,98,114,209,10,22,36,52,225,37,241,23,24,25,26,38,39,40,41,42,53,54,55,56,57,58,67,68,69,70,71,72,73,74,83,84,85,86,87,88,89,90,99,100,101,102,103,104,105,106,115,116,117,118,119,120,121,122,130,131,132,133,134,135,136,137,138,146,147,148,149,150,151,152,153,154,162,163,164,165,166,167,168,169,170,178,179,180,181,182,183,184,185,186,194,195,196,197,198,199,200,201,202,210,211,212,213,214,215,216,217,218,226,227,228,229,230,231,232,233,234,242,243,244,245,246,247,248,249,250];function G(L,z){for(var W=0,te=0,B=new Array,ee=1;ee<=16;ee++){for(var fe=1;fe<=L[ee];fe++)B[z[te]]=[],B[z[te]][0]=W,B[z[te]][1]=ee,te++,W++;W*=2}return B}function ne(L){for(var z=L[0],W=L[1]-1;W>=0;)z&1<<W&&(x|=1<<g),W--,--g<0&&(x==255?(Q(255),Q(0)):Q(x),g=7,x=0)}function Q(L){S.push(L)}function ie(L){Q(L>>8&255),Q(255&L)}function J(L,z,W,te,B){for(var ee,fe=B[0],me=B[240],Se=function(Te,Ie){var qe,Fe,Qe,ht,gt,ft,wt,Vt,ut,Et,He=0;for(ut=0;ut<8;++ut){qe=Te[He],Fe=Te[He+1],Qe=Te[He+2],ht=Te[He+3],gt=Te[He+4],ft=Te[He+5],wt=Te[He+6];var hn=qe+(Vt=Te[He+7]),Pt=qe-Vt,Yr=Fe+wt,en=Fe-wt,pn=Qe+ft,pa=Qe-ft,It=ht+gt,Ai=ht-gt,mn=hn+It,ma=hn-It,ka=Yr+pn,Ln=Yr-pn;Te[He]=mn+ka,Te[He+4]=mn-ka;var pt=.707106781*(Ln+ma);Te[He+2]=ma+pt,Te[He+6]=ma-pt;var Ft=.382683433*((mn=Ai+pa)-(Ln=en+Pt)),Pa=.5411961*mn+Ft,rr=1.306562965*Ln+Ft,Ia=.707106781*(ka=pa+en),re=Pt+Ia,ae=Pt-Ia;Te[He+5]=ae+Pa,Te[He+3]=ae-Pa,Te[He+1]=re+rr,Te[He+7]=re-rr,He+=8}for(He=0,ut=0;ut<8;++ut){qe=Te[He],Fe=Te[He+8],Qe=Te[He+16],ht=Te[He+24],gt=Te[He+32],ft=Te[He+40],wt=Te[He+48];var be=qe+(Vt=Te[He+56]),De=qe-Vt,ke=Fe+wt,$e=Fe-wt,Ue=Qe+ft,Ve=Qe-ft,Ze=ht+gt,tt=ht-gt,et=be+Ze,Je=be-Ze,at=ke+Ue,Tt=ke-Ue;Te[He]=et+at,Te[He+32]=et-at;var Yt=.707106781*(Tt+Je);Te[He+16]=Je+Yt,Te[He+48]=Je-Yt;var gn=.382683433*((et=tt+Ve)-(Tt=$e+De)),Gt=.5411961*et+gn,qt=1.306562965*Tt+gn,Gr=.707106781*(at=Ve+$e),Fa=De+Gr,Pr=De-Gr;Te[He+40]=Pr+Gt,Te[He+24]=Pr-Gt,Te[He+8]=Fa+qt,Te[He+56]=Fa-qt,He++}for(ut=0;ut<64;++ut)Et=Te[ut]*Ie[ut],d[ut]=Et>0?Et+.5|0:Et-.5|0;return d}(L,z),we=0;we<64;++we)v[O[we]]=Se[we];var je=v[0]-W;W=v[0],je==0?ne(te[0]):(ne(te[p[ee=32767+je]]),ne(f[ee]));for(var Ae=63;Ae>0&&v[Ae]==0;)Ae--;if(Ae==0)return ne(fe),W;for(var Me,pe=1;pe<=Ae;){for(var X=pe;v[pe]==0&&pe<=Ae;)++pe;var Ge=pe-X;if(Ge>=16){Me=Ge>>4;for(var Pe=1;Pe<=Me;++Pe)ne(me);Ge&=15}ee=32767+v[pe],ne(B[(Ge<<4)+p[ee]]),ne(f[ee]),pe++}return Ae!=63&&ne(fe),W}function le(L){L=Math.min(Math.max(L,1),100),i!=L&&(function(z){for(var W=[16,11,10,16,24,40,51,61,12,12,14,19,26,58,60,55,14,13,16,24,40,57,69,56,14,17,22,29,51,87,80,62,18,22,37,56,68,109,103,77,24,35,55,64,81,104,113,92,49,64,78,87,103,121,120,101,72,92,95,98,112,100,103,99],te=0;te<64;te++){var B=s((W[te]*z+50)/100);B=Math.min(Math.max(B,1),255),o[O[te]]=B}for(var ee=[17,18,24,47,99,99,99,99,18,21,26,66,99,99,99,99,24,26,56,99,99,99,99,99,47,66,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99],fe=0;fe<64;fe++){var me=s((ee[fe]*z+50)/100);me=Math.min(Math.max(me,1),255),l[O[fe]]=me}for(var Se=[1,1.387039845,1.306562965,1.175875602,1,.785694958,.5411961,.275899379],we=0,je=0;je<8;je++)for(var Ae=0;Ae<8;Ae++)u[we]=1/(o[O[we]]*Se[je]*Se[Ae]*8),c[we]=1/(l[O[we]]*Se[je]*Se[Ae]*8),we++}(L<50?Math.floor(5e3/L):Math.floor(200-2*L)),i=L)}this.encode=function(L,z){z&&le(z),S=new Array,x=0,g=7,ie(65496),ie(65504),ie(16),Q(74),Q(70),Q(73),Q(70),Q(0),Q(1),Q(1),Q(0),ie(1),ie(1),Q(0),Q(0),function(){ie(65499),ie(132),Q(0);for(var Fe=0;Fe<64;Fe++)Q(o[Fe]);Q(1);for(var Qe=0;Qe<64;Qe++)Q(l[Qe])}(),function(Fe,Qe){ie(65472),ie(17),Q(8),ie(Qe),ie(Fe),Q(3),Q(1),Q(17),Q(0),Q(2),Q(17),Q(1),Q(3),Q(17),Q(1)}(L.width,L.height),function(){ie(65476),ie(418),Q(0);for(var Fe=0;Fe<16;Fe++)Q(j[Fe+1]);for(var Qe=0;Qe<=11;Qe++)Q($[Qe]);Q(16);for(var ht=0;ht<16;ht++)Q(V[ht+1]);for(var gt=0;gt<=161;gt++)Q(T[gt]);Q(1);for(var ft=0;ft<16;ft++)Q(P[ft+1]);for(var wt=0;wt<=11;wt++)Q(q[wt]);Q(17);for(var Vt=0;Vt<16;Vt++)Q(Y[Vt+1]);for(var ut=0;ut<=161;ut++)Q(se[ut])}(),ie(65498),ie(12),Q(3),Q(1),Q(0),Q(2),Q(17),Q(3),Q(17),Q(0),Q(63),Q(0);var W=0,te=0,B=0;x=0,g=7,this.encode.displayName="_encode_";for(var ee,fe,me,Se,we,je,Ae,Me,pe,X=L.data,Ge=L.width,Pe=L.height,Te=4*Ge,Ie=0;Ie<Pe;){for(ee=0;ee<Te;){for(we=Te*Ie+ee,Ae=-1,Me=0,pe=0;pe<64;pe++)je=we+(Me=pe>>3)*Te+(Ae=4*(7&pe)),Ie+Me>=Pe&&(je-=Te*(Ie+1+Me-Pe)),ee+Ae>=Te&&(je-=ee+Ae-Te+4),fe=X[je++],me=X[je++],Se=X[je++],y[pe]=(R[fe]+R[me+256>>0]+R[Se+512>>0]>>16)-128,_[pe]=(R[fe+768>>0]+R[me+1024>>0]+R[Se+1280>>0]>>16)-128,E[pe]=(R[fe+1280>>0]+R[me+1536>>0]+R[Se+1792>>0]>>16)-128;W=J(y,u,W,t,r),te=J(_,c,te,n,a),B=J(E,c,B,n,a),ee+=32}Ie+=8}if(g>=0){var qe=[];qe[1]=g+1,qe[0]=(1<<g+1)-1,ne(qe)}return ie(65497),new Uint8Array(S)},e=e||50,function(){for(var L=String.fromCharCode,z=0;z<256;z++)D[z]=L(z)}(),t=G(j,$),n=G(P,q),r=G(V,T),a=G(Y,se),function(){for(var L=1,z=2,W=1;W<=15;W++){for(var te=L;te<z;te++)p[32767+te]=W,f[32767+te]=[],f[32767+te][1]=W,f[32767+te][0]=te;for(var B=-(z-1);B<=-L;B++)p[32767+B]=W,f[32767+B]=[],f[32767+B][1]=W,f[32767+B][0]=z-1+B;L<<=1,z<<=1}}(),function(){for(var L=0;L<256;L++)R[L]=19595*L,R[L+256>>0]=38470*L,R[L+512>>0]=7471*L+32768,R[L+768>>0]=-11059*L,R[L+1024>>0]=-21709*L,R[L+1280>>0]=32768*L+8421375,R[L+1536>>0]=-27439*L,R[L+1792>>0]=-5329*L}(),le(e)}/**
322
+ * @license
323
+ * Copyright (c) 2017 Aras Abbasi
324
+ *
325
+ * Licensed under the MIT License.
326
+ * http://opensource.org/licenses/mit-license
327
+ */function mi(e,t){if(this.pos=0,this.buffer=e,this.datav=new DataView(e.buffer),this.is_with_alpha=!!t,this.bottom_up=!0,this.flag=String.fromCharCode(this.buffer[0])+String.fromCharCode(this.buffer[1]),this.pos+=2,["BM","BA","CI","CP","IC","PT"].indexOf(this.flag)===-1)throw new Error("Invalid BMP File");this.parseHeader(),this.parseBGR()}function C3(e){function t(j){if(!j)throw Error("assert :P")}function n(j,$,V){for(var T=0;4>T;T++)if(j[$+T]!=V.charCodeAt(T))return!0;return!1}function r(j,$,V,T,P){for(var q=0;q<P;q++)j[$+q]=V[T+q]}function a(j,$,V,T){for(var P=0;P<T;P++)j[$+P]=V}function i(j){return new Int32Array(j)}function s(j,$){for(var V=[],T=0;T<j;T++)V.push(new $);return V}function o(j,$){var V=[];return function T(P,q,Y){for(var se=Y[q],G=0;G<se&&(P.push(Y.length>q+1?[]:new $),!(Y.length<q+1));G++)T(P[G],q+1,Y)}(V,0,j),V}var l=function(){var j=this;function $(h,m){for(var A=1<<m-1>>>0;h&A;)A>>>=1;return A?(h&A-1)+A:h}function V(h,m,A,N,M){t(!(N%A));do h[m+(N-=A)]=M;while(0<N)}function T(h,m,A,N,M){if(t(2328>=M),512>=M)var I=i(512);else if((I=i(M))==null)return 0;return function(F,U,H,K,ue,ve){var ye,he,Le=U,xe=1<<H,ce=i(16),de=i(16);for(t(ue!=0),t(K!=null),t(F!=null),t(0<H),he=0;he<ue;++he){if(15<K[he])return 0;++ce[K[he]]}if(ce[0]==ue)return 0;for(de[1]=0,ye=1;15>ye;++ye){if(ce[ye]>1<<ye)return 0;de[ye+1]=de[ye]+ce[ye]}for(he=0;he<ue;++he)ye=K[he],0<K[he]&&(ve[de[ye]++]=he);if(de[15]==1)return(K=new P).g=0,K.value=ve[0],V(F,Le,1,xe,K),xe;var Ne,Oe=-1,Ce=xe-1,We=0,Be=1,it=1,ze=1<<H;for(he=0,ye=1,ue=2;ye<=H;++ye,ue<<=1){if(Be+=it<<=1,0>(it-=ce[ye]))return 0;for(;0<ce[ye];--ce[ye])(K=new P).g=ye,K.value=ve[he++],V(F,Le+We,ue,ze,K),We=$(We,ye)}for(ye=H+1,ue=2;15>=ye;++ye,ue<<=1){if(Be+=it<<=1,0>(it-=ce[ye]))return 0;for(;0<ce[ye];--ce[ye]){if(K=new P,(We&Ce)!=Oe){for(Le+=ze,Ne=1<<(Oe=ye)-H;15>Oe&&!(0>=(Ne-=ce[Oe]));)++Oe,Ne<<=1;xe+=ze=1<<(Ne=Oe-H),F[U+(Oe=We&Ce)].g=Ne+H,F[U+Oe].value=Le-U-Oe}K.g=ye-H,K.value=ve[he++],V(F,Le+(We>>H),ue,ze,K),We=$(We,ye)}}return Be!=2*de[15]-1?0:xe}(h,m,A,N,M,I)}function P(){this.value=this.g=0}function q(){this.value=this.g=0}function Y(){this.G=s(5,P),this.H=i(5),this.jc=this.Qb=this.qb=this.nd=0,this.pd=s(yr,q)}function se(h,m,A,N){t(h!=null),t(m!=null),t(2147483648>N),h.Ca=254,h.I=0,h.b=-8,h.Ka=0,h.oa=m,h.pa=A,h.Jd=m,h.Yc=A+N,h.Zc=4<=N?A+N-4+1:A,ee(h)}function G(h,m){for(var A=0;0<m--;)A|=me(h,128)<<m;return A}function ne(h,m){var A=G(h,m);return fe(h)?-A:A}function Q(h,m,A,N){var M,I=0;for(t(h!=null),t(m!=null),t(4294967288>N),h.Sb=N,h.Ra=0,h.u=0,h.h=0,4<N&&(N=4),M=0;M<N;++M)I+=m[A+M]<<8*M;h.Ra=I,h.bb=N,h.oa=m,h.pa=A}function ie(h){for(;8<=h.u&&h.bb<h.Sb;)h.Ra>>>=8,h.Ra+=h.oa[h.pa+h.bb]<<Yl-8>>>0,++h.bb,h.u-=8;W(h)&&(h.h=1,h.u=0)}function J(h,m){if(t(0<=m),!h.h&&m<=Vl){var A=z(h)&Hl[m];return h.u+=m,ie(h),A}return h.h=1,h.u=0}function le(){this.b=this.Ca=this.I=0,this.oa=[],this.pa=0,this.Jd=[],this.Yc=0,this.Zc=[],this.Ka=0}function L(){this.Ra=0,this.oa=[],this.h=this.u=this.bb=this.Sb=this.pa=0}function z(h){return h.Ra>>>(h.u&Yl-1)>>>0}function W(h){return t(h.bb<=h.Sb),h.h||h.bb==h.Sb&&h.u>Yl}function te(h,m){h.u=m,h.h=W(h)}function B(h){h.u>=Vc&&(t(h.u>=Vc),ie(h))}function ee(h){t(h!=null&&h.oa!=null),h.pa<h.Zc?(h.I=(h.oa[h.pa++]|h.I<<8)>>>0,h.b+=8):(t(h!=null&&h.oa!=null),h.pa<h.Yc?(h.b+=8,h.I=h.oa[h.pa++]|h.I<<8):h.Ka?h.b=0:(h.I<<=8,h.b+=8,h.Ka=1))}function fe(h){return G(h,1)}function me(h,m){var A=h.Ca;0>h.b&&ee(h);var N=h.b,M=A*m>>>8,I=(h.I>>>N>M)+0;for(I?(A-=M,h.I-=M+1<<N>>>0):A=M+1,N=A,M=0;256<=N;)M+=8,N>>=8;return N=7^M+Kr[N],h.b-=N,h.Ca=(A<<N)-1,I}function Se(h,m,A){h[m+0]=A>>24&255,h[m+1]=A>>16&255,h[m+2]=A>>8&255,h[m+3]=A>>0&255}function we(h,m){return h[m+0]<<0|h[m+1]<<8}function je(h,m){return we(h,m)|h[m+2]<<16}function Ae(h,m){return we(h,m)|we(h,m+2)<<16}function Me(h,m){var A=1<<m;return t(h!=null),t(0<m),h.X=i(A),h.X==null?0:(h.Mb=32-m,h.Xa=m,1)}function pe(h,m){t(h!=null),t(m!=null),t(h.Xa==m.Xa),r(m.X,0,h.X,0,1<<m.Xa)}function X(){this.X=[],this.Xa=this.Mb=0}function Ge(h,m,A,N){t(A!=null),t(N!=null);var M=A[0],I=N[0];return M==0&&(M=(h*I+m/2)/m),I==0&&(I=(m*M+h/2)/h),0>=M||0>=I?0:(A[0]=M,N[0]=I,1)}function Pe(h,m){return h+(1<<m)-1>>>m}function Te(h,m){return((4278255360&h)+(4278255360&m)>>>0&4278255360)+((16711935&h)+(16711935&m)>>>0&16711935)>>>0}function Ie(h,m){j[m]=function(A,N,M,I,F,U,H){var K;for(K=0;K<F;++K){var ue=j[h](U[H+K-1],M,I+K);U[H+K]=Te(A[N+K],ue)}}}function qe(){this.ud=this.hd=this.jd=0}function Fe(h,m){return((4278124286&(h^m))>>>1)+(h&m)>>>0}function Qe(h){return 0<=h&&256>h?h:0>h?0:255<h?255:void 0}function ht(h,m){return Qe(h+(h-m+.5>>1))}function gt(h,m,A){return Math.abs(m-A)-Math.abs(h-A)}function ft(h,m,A,N,M,I,F){for(N=I[F-1],A=0;A<M;++A)I[F+A]=N=Te(h[m+A],N)}function wt(h,m,A,N,M){var I;for(I=0;I<A;++I){var F=h[m+I],U=F>>8&255,H=16711935&(H=(H=16711935&F)+((U<<16)+U));N[M+I]=(4278255360&F)+H>>>0}}function Vt(h,m){m.jd=h>>0&255,m.hd=h>>8&255,m.ud=h>>16&255}function ut(h,m,A,N,M,I){var F;for(F=0;F<N;++F){var U=m[A+F],H=U>>>8,K=U,ue=255&(ue=(ue=U>>>16)+((h.jd<<24>>24)*(H<<24>>24)>>>5));K=255&(K=(K=K+((h.hd<<24>>24)*(H<<24>>24)>>>5))+((h.ud<<24>>24)*(ue<<24>>24)>>>5)),M[I+F]=(4278255360&U)+(ue<<16)+K}}function Et(h,m,A,N,M){j[m]=function(I,F,U,H,K,ue,ve,ye,he){for(H=ve;H<ye;++H)for(ve=0;ve<he;++ve)K[ue++]=M(U[N(I[F++])])},j[h]=function(I,F,U,H,K,ue,ve){var ye=8>>I.b,he=I.Ea,Le=I.K[0],xe=I.w;if(8>ye)for(I=(1<<I.b)-1,xe=(1<<ye)-1;F<U;++F){var ce,de=0;for(ce=0;ce<he;++ce)ce&I||(de=N(H[K++])),ue[ve++]=M(Le[de&xe]),de>>=ye}else j["VP8LMapColor"+A](H,K,Le,xe,ue,ve,F,U,he)}}function He(h,m,A,N,M){for(A=m+A;m<A;){var I=h[m++];N[M++]=I>>16&255,N[M++]=I>>8&255,N[M++]=I>>0&255}}function hn(h,m,A,N,M){for(A=m+A;m<A;){var I=h[m++];N[M++]=I>>16&255,N[M++]=I>>8&255,N[M++]=I>>0&255,N[M++]=I>>24&255}}function Pt(h,m,A,N,M){for(A=m+A;m<A;){var I=(F=h[m++])>>16&240|F>>12&15,F=F>>0&240|F>>28&15;N[M++]=I,N[M++]=F}}function Yr(h,m,A,N,M){for(A=m+A;m<A;){var I=(F=h[m++])>>16&248|F>>13&7,F=F>>5&224|F>>3&31;N[M++]=I,N[M++]=F}}function en(h,m,A,N,M){for(A=m+A;m<A;){var I=h[m++];N[M++]=I>>0&255,N[M++]=I>>8&255,N[M++]=I>>16&255}}function pn(h,m,A,N,M,I){if(I==0)for(A=m+A;m<A;)Se(N,((I=h[m++])[0]>>24|I[1]>>8&65280|I[2]<<8&16711680|I[3]<<24)>>>0),M+=32;else r(N,M,h,m,A)}function pa(h,m){j[m][0]=j[h+"0"],j[m][1]=j[h+"1"],j[m][2]=j[h+"2"],j[m][3]=j[h+"3"],j[m][4]=j[h+"4"],j[m][5]=j[h+"5"],j[m][6]=j[h+"6"],j[m][7]=j[h+"7"],j[m][8]=j[h+"8"],j[m][9]=j[h+"9"],j[m][10]=j[h+"10"],j[m][11]=j[h+"11"],j[m][12]=j[h+"12"],j[m][13]=j[h+"13"],j[m][14]=j[h+"0"],j[m][15]=j[h+"0"]}function It(h){return h==C0||h==L0||h==wh||h==j0}function Ai(){this.eb=[],this.size=this.A=this.fb=0}function mn(){this.y=[],this.f=[],this.ea=[],this.F=[],this.Tc=this.Ed=this.Cd=this.Fd=this.lb=this.Db=this.Ab=this.fa=this.J=this.W=this.N=this.O=0}function ma(){this.Rd=this.height=this.width=this.S=0,this.f={},this.f.RGBA=new Ai,this.f.kb=new mn,this.sd=null}function ka(){this.width=[0],this.height=[0],this.Pd=[0],this.Qd=[0],this.format=[0]}function Ln(){this.Id=this.fd=this.Md=this.hb=this.ib=this.da=this.bd=this.cd=this.j=this.v=this.Da=this.Sd=this.ob=0}function pt(h){return alert("todo:WebPSamplerProcessPlane"),h.T}function Ft(h,m){var A=h.T,N=m.ba.f.RGBA,M=N.eb,I=N.fb+h.ka*N.A,F=Ha[m.ba.S],U=h.y,H=h.O,K=h.f,ue=h.N,ve=h.ea,ye=h.W,he=m.cc,Le=m.dc,xe=m.Mc,ce=m.Nc,de=h.ka,Ne=h.ka+h.T,Oe=h.U,Ce=Oe+1>>1;for(de==0?F(U,H,null,null,K,ue,ve,ye,K,ue,ve,ye,M,I,null,null,Oe):(F(m.ec,m.fc,U,H,he,Le,xe,ce,K,ue,ve,ye,M,I-N.A,M,I,Oe),++A);de+2<Ne;de+=2)he=K,Le=ue,xe=ve,ce=ye,ue+=h.Rc,ye+=h.Rc,I+=2*N.A,F(U,(H+=2*h.fa)-h.fa,U,H,he,Le,xe,ce,K,ue,ve,ye,M,I-N.A,M,I,Oe);return H+=h.fa,h.j+Ne<h.o?(r(m.ec,m.fc,U,H,Oe),r(m.cc,m.dc,K,ue,Ce),r(m.Mc,m.Nc,ve,ye,Ce),A--):1&Ne||F(U,H,null,null,K,ue,ve,ye,K,ue,ve,ye,M,I+N.A,null,null,Oe),A}function Pa(h,m,A){var N=h.F,M=[h.J];if(N!=null){var I=h.U,F=m.ba.S,U=F==bh||F==wh;m=m.ba.f.RGBA;var H=[0],K=h.ka;H[0]=h.T,h.Kb&&(K==0?--H[0]:(--K,M[0]-=h.width),h.j+h.ka+h.T==h.o&&(H[0]=h.o-h.j-K));var ue=m.eb;K=m.fb+K*m.A,h=bn(N,M[0],h.width,I,H,ue,K+(U?0:3),m.A),t(A==H),h&&It(F)&&za(ue,K,U,I,H,m.A)}return 0}function rr(h){var m=h.ma,A=m.ba.S,N=11>A,M=A==vh||A==yh||A==bh||A==E0||A==12||It(A);if(m.memory=null,m.Ib=null,m.Jb=null,m.Nd=null,!qc(m.Oa,h,M?11:12))return 0;if(M&&It(A)&&Re(),h.da)alert("todo:use_scaling");else{if(N){if(m.Ib=pt,h.Kb){if(A=h.U+1>>1,m.memory=i(h.U+2*A),m.memory==null)return 0;m.ec=m.memory,m.fc=0,m.cc=m.ec,m.dc=m.fc+h.U,m.Mc=m.cc,m.Nc=m.dc+A,m.Ib=Ft,Re()}}else alert("todo:EmitYUV");M&&(m.Jb=Pa,N&&ge())}if(N&&!fb){for(h=0;256>h;++h)M8[h]=89858*(h-128)+Sh>>xh,I8[h]=-22014*(h-128)+Sh,P8[h]=-45773*(h-128),k8[h]=113618*(h-128)+Sh>>xh;for(h=Qc;h<D0;++h)m=76283*(h-16)+Sh>>xh,F8[h-Qc]=ga(m,255),B8[h-Qc]=ga(m+8>>4,15);fb=1}return 1}function Ia(h){var m=h.ma,A=h.U,N=h.T;return t(!(1&h.ka)),0>=A||0>=N?0:(A=m.Ib(h,m),m.Jb!=null&&m.Jb(h,m,A),m.Dc+=A,1)}function re(h){h.ma.memory=null}function ae(h,m,A,N){return J(h,8)!=47?0:(m[0]=J(h,14)+1,A[0]=J(h,14)+1,N[0]=J(h,1),J(h,3)!=0?0:!h.h)}function be(h,m){if(4>h)return h+1;var A=h-2>>1;return(2+(1&h)<<A)+J(m,A)+1}function De(h,m){return 120<m?m-120:1<=(A=((A=w8[m-1])>>4)*h+(8-(15&A)))?A:1;var A}function ke(h,m,A){var N=z(A),M=h[m+=255&N].g-8;return 0<M&&(te(A,A.u+8),N=z(A),m+=h[m].value,m+=N&(1<<M)-1),te(A,A.u+h[m].g),h[m].value}function $e(h,m,A){return A.g+=h.g,A.value+=h.value<<m>>>0,t(8>=A.g),h.g}function Ue(h,m,A){var N=h.xc;return t((m=N==0?0:h.vc[h.md*(A>>N)+(m>>N)])<h.Wb),h.Ya[m]}function Ve(h,m,A,N){var M=h.ab,I=h.c*m,F=h.C;m=F+m;var U=A,H=N;for(N=h.Ta,A=h.Ua;0<M--;){var K=h.gc[M],ue=F,ve=m,ye=U,he=H,Le=(H=N,U=A,K.Ea);switch(t(ue<ve),t(ve<=K.nc),K.hc){case 2:ch(ye,he,(ve-ue)*Le,H,U);break;case 0:var xe=ue,ce=ve,de=H,Ne=U,Oe=(ze=K).Ea;xe==0&&(A0(ye,he,null,null,1,de,Ne),ft(ye,he+1,0,0,Oe-1,de,Ne+1),he+=Oe,Ne+=Oe,++xe);for(var Ce=1<<ze.b,We=Ce-1,Be=Pe(Oe,ze.b),it=ze.K,ze=ze.w+(xe>>ze.b)*Be;xe<ce;){var Wt=it,tn=ze,zt=1;for(Yc(ye,he,de,Ne-Oe,1,de,Ne);zt<Oe;){var Rt=(zt&~We)+Ce;Rt>Oe&&(Rt=Oe),(0,Us[Wt[tn++]>>8&15])(ye,he+ +zt,de,Ne+zt-Oe,Rt-zt,de,Ne+zt),zt=Rt}he+=Oe,Ne+=Oe,++xe&We||(ze+=Be)}ve!=K.nc&&r(H,U-Le,H,U+(ve-ue-1)*Le,Le);break;case 1:for(Le=ye,ce=he,Oe=(ye=K.Ea)-(Ne=ye&~(de=(he=1<<K.b)-1)),xe=Pe(ye,K.b),Ce=K.K,K=K.w+(ue>>K.b)*xe;ue<ve;){for(We=Ce,Be=K,it=new qe,ze=ce+Ne,Wt=ce+ye;ce<ze;)Vt(We[Be++],it),Yo(it,Le,ce,he,H,U),ce+=he,U+=he;ce<Wt&&(Vt(We[Be++],it),Yo(it,Le,ce,Oe,H,U),ce+=Oe,U+=Oe),++ue&de||(K+=xe)}break;case 3:if(ye==H&&he==U&&0<K.b){for(ce=H,ye=Le=U+(ve-ue)*Le-(Ne=(ve-ue)*Pe(K.Ea,K.b)),he=H,de=U,xe=[],Ne=(Oe=Ne)-1;0<=Ne;--Ne)xe[Ne]=he[de+Ne];for(Ne=Oe-1;0<=Ne;--Ne)ce[ye+Ne]=xe[Ne];Ba(K,ue,ve,H,Le,H,U)}else Ba(K,ue,ve,ye,he,H,U)}U=N,H=A}H!=A&&r(N,A,U,H,I)}function Ze(h,m){var A=h.V,N=h.Ba+h.c*h.C,M=m-h.C;if(t(m<=h.l.o),t(16>=M),0<M){var I=h.l,F=h.Ta,U=h.Ua,H=I.width;if(Ve(h,M,A,N),M=U=[U],t((A=h.C)<(N=m)),t(I.v<I.va),N>I.o&&(N=I.o),A<I.j){var K=I.j-A;A=I.j,M[0]+=K*H}if(A>=N?A=0:(M[0]+=4*I.v,I.ka=A-I.j,I.U=I.va-I.v,I.T=N-A,A=1),A){if(U=U[0],11>(A=h.ca).S){var ue=A.f.RGBA,ve=(N=A.S,M=I.U,I=I.T,K=ue.eb,ue.A),ye=I;for(ue=ue.fb+h.Ma*ue.A;0<ye--;){var he=F,Le=U,xe=M,ce=K,de=ue;switch(N){case gh:Xr(he,Le,xe,ce,de);break;case vh:Fr(he,Le,xe,ce,de);break;case C0:Fr(he,Le,xe,ce,de),za(ce,de,0,xe,1,0);break;case nb:Xi(he,Le,xe,ce,de);break;case yh:pn(he,Le,xe,ce,de,1);break;case L0:pn(he,Le,xe,ce,de,1),za(ce,de,0,xe,1,0);break;case bh:pn(he,Le,xe,ce,de,0);break;case wh:pn(he,Le,xe,ce,de,0),za(ce,de,1,xe,1,0);break;case E0:zs(he,Le,xe,ce,de);break;case j0:zs(he,Le,xe,ce,de),yn(ce,de,xe,1,0);break;case rb:Ki(he,Le,xe,ce,de);break;default:t(0)}U+=H,ue+=ve}h.Ma+=I}else alert("todo:EmitRescaledRowsYUVA");t(h.Ma<=A.height)}}h.C=m,t(h.C<=h.i)}function tt(h){var m;if(0<h.ua)return 0;for(m=0;m<h.Wb;++m){var A=h.Ya[m].G,N=h.Ya[m].H;if(0<A[1][N[1]+0].g||0<A[2][N[2]+0].g||0<A[3][N[3]+0].g)return 0}return 1}function et(h,m,A,N,M,I){if(h.Z!=0){var F=h.qd,U=h.rd;for(t(Ys[h.Z]!=null);m<A;++m)Ys[h.Z](F,U,N,M,N,M,I),F=N,U=M,M+=I;h.qd=F,h.rd=U}}function Je(h,m){var A=h.l.ma,N=A.Z==0||A.Z==1?h.l.j:h.C;if(N=h.C<N?N:h.C,t(m<=h.l.o),m>N){var M=h.l.width,I=A.ca,F=A.tb+M*N,U=h.V,H=h.Ba+h.c*N,K=h.gc;t(h.ab==1),t(K[0].hc==3),fh(K[0],N,m,U,H,I,F),et(A,N,m,I,F,M)}h.C=h.Ma=m}function at(h,m,A,N,M,I,F){var U=h.$/N,H=h.$%N,K=h.m,ue=h.s,ve=A+h.$,ye=ve;M=A+N*M;var he=A+N*I,Le=280+ue.ua,xe=h.Pb?U:16777216,ce=0<ue.ua?ue.Wa:null,de=ue.wc,Ne=ve<he?Ue(ue,H,U):null;t(h.C<I),t(he<=M);var Oe=!1;e:for(;;){for(;Oe||ve<he;){var Ce=0;if(U>=xe){var We=ve-A;t((xe=h).Pb),xe.wd=xe.m,xe.xd=We,0<xe.s.ua&&pe(xe.s.Wa,xe.s.vb),xe=U+S8}if(H&de||(Ne=Ue(ue,H,U)),t(Ne!=null),Ne.Qb&&(m[ve]=Ne.qb,Oe=!0),!Oe)if(B(K),Ne.jc){Ce=K,We=m;var Be=ve,it=Ne.pd[z(Ce)&yr-1];t(Ne.jc),256>it.g?(te(Ce,Ce.u+it.g),We[Be]=it.value,Ce=0):(te(Ce,Ce.u+it.g-256),t(256<=it.value),Ce=it.value),Ce==0&&(Oe=!0)}else Ce=ke(Ne.G[0],Ne.H[0],K);if(K.h)break;if(Oe||256>Ce){if(!Oe)if(Ne.nd)m[ve]=(Ne.qb|Ce<<8)>>>0;else{if(B(K),Oe=ke(Ne.G[1],Ne.H[1],K),B(K),We=ke(Ne.G[2],Ne.H[2],K),Be=ke(Ne.G[3],Ne.H[3],K),K.h)break;m[ve]=(Be<<24|Oe<<16|Ce<<8|We)>>>0}if(Oe=!1,++ve,++H>=N&&(H=0,++U,F!=null&&U<=I&&!(U%16)&&F(h,U),ce!=null))for(;ye<ve;)Ce=m[ye++],ce.X[(506832829*Ce&4294967295)>>>ce.Mb]=Ce}else if(280>Ce){if(Ce=be(Ce-256,K),We=ke(Ne.G[4],Ne.H[4],K),B(K),We=De(N,We=be(We,K)),K.h)break;if(ve-A<We||M-ve<Ce)break e;for(Be=0;Be<Ce;++Be)m[ve+Be]=m[ve+Be-We];for(ve+=Ce,H+=Ce;H>=N;)H-=N,++U,F!=null&&U<=I&&!(U%16)&&F(h,U);if(t(ve<=M),H&de&&(Ne=Ue(ue,H,U)),ce!=null)for(;ye<ve;)Ce=m[ye++],ce.X[(506832829*Ce&4294967295)>>>ce.Mb]=Ce}else{if(!(Ce<Le))break e;for(Oe=Ce-280,t(ce!=null);ye<ve;)Ce=m[ye++],ce.X[(506832829*Ce&4294967295)>>>ce.Mb]=Ce;Ce=ve,t(!(Oe>>>(We=ce).Xa)),m[Ce]=We.X[Oe],Oe=!0}Oe||t(K.h==W(K))}if(h.Pb&&K.h&&ve<M)t(h.m.h),h.a=5,h.m=h.wd,h.$=h.xd,0<h.s.ua&&pe(h.s.vb,h.s.Wa);else{if(K.h)break e;F!=null&&F(h,U>I?I:U),h.a=0,h.$=ve-A}return 1}return h.a=3,0}function Tt(h){t(h!=null),h.vc=null,h.yc=null,h.Ya=null;var m=h.Wa;m!=null&&(m.X=null),h.vb=null,t(h!=null)}function Yt(){var h=new _0;return h==null?null:(h.a=0,h.xb=sb,pa("Predictor","VP8LPredictors"),pa("Predictor","VP8LPredictors_C"),pa("PredictorAdd","VP8LPredictorsAdd"),pa("PredictorAdd","VP8LPredictorsAdd_C"),ch=wt,Yo=ut,Xr=He,Fr=hn,zs=Pt,Ki=Yr,Xi=en,j.VP8LMapColor32b=Gl,j.VP8LMapColor8b=dh,h)}function gn(h,m,A,N,M){var I=1,F=[h],U=[m],H=N.m,K=N.s,ue=null,ve=0;e:for(;;){if(A)for(;I&&J(H,1);){var ye=F,he=U,Le=N,xe=1,ce=Le.m,de=Le.gc[Le.ab],Ne=J(ce,2);if(Le.Oc&1<<Ne)I=0;else{switch(Le.Oc|=1<<Ne,de.hc=Ne,de.Ea=ye[0],de.nc=he[0],de.K=[null],++Le.ab,t(4>=Le.ab),Ne){case 0:case 1:de.b=J(ce,3)+2,xe=gn(Pe(de.Ea,de.b),Pe(de.nc,de.b),0,Le,de.K),de.K=de.K[0];break;case 3:var Oe,Ce=J(ce,8)+1,We=16<Ce?0:4<Ce?1:2<Ce?2:3;if(ye[0]=Pe(de.Ea,We),de.b=We,Oe=xe=gn(Ce,1,0,Le,de.K)){var Be,it=Ce,ze=de,Wt=1<<(8>>ze.b),tn=i(Wt);if(tn==null)Oe=0;else{var zt=ze.K[0],Rt=ze.w;for(tn[0]=ze.K[0][0],Be=1;Be<1*it;++Be)tn[Be]=Te(zt[Rt+Be],tn[Be-1]);for(;Be<4*Wt;++Be)tn[Be]=0;ze.K[0]=null,ze.K[0]=tn,Oe=1}}xe=Oe;break;case 2:break;default:t(0)}I=xe}}if(F=F[0],U=U[0],I&&J(H,1)&&!(I=1<=(ve=J(H,4))&&11>=ve)){N.a=3;break e}var cn;if(cn=I)t:{var on,_t,Kn,Qr=N,Xn=F,Zr=U,nn=ve,ya=A,ba=Qr.m,cr=Qr.s,br=[null],$r=1,Va=0,Li=x8[nn];n:for(;;){if(ya&&J(ba,1)){var fr=J(ba,3)+2,ts=Pe(Xn,fr),Xo=Pe(Zr,fr),Ql=ts*Xo;if(!gn(ts,Xo,0,Qr,br))break n;for(br=br[0],cr.xc=fr,on=0;on<Ql;++on){var Gs=br[on]>>8&65535;br[on]=Gs,Gs>=$r&&($r=Gs+1)}}if(ba.h)break n;for(_t=0;5>_t;++_t){var Mn=ab[_t];!_t&&0<nn&&(Mn+=1<<nn),Va<Mn&&(Va=Mn)}var R0=s($r*Li,P),pb=$r,mb=s(pb,Y);if(mb==null)var Ah=null;else t(65536>=pb),Ah=mb;var Zc=i(Va);if(Ah==null||Zc==null||R0==null){Qr.a=1;break n}var Nh=R0;for(on=Kn=0;on<$r;++on){var di=Ah[on],Zl=di.G,eu=di.H,gb=0,Eh=1,vb=0;for(_t=0;5>_t;++_t){Mn=ab[_t],Zl[_t]=Nh,eu[_t]=Kn,!_t&&0<nn&&(Mn+=1<<nn);a:{var Ch,M0=Mn,Lh=Qr,ef=Zc,z8=Nh,q8=Kn,k0=0,Ws=Lh.m,H8=J(Ws,1);if(a(ef,0,0,M0),H8){var V8=J(Ws,1)+1,Y8=J(Ws,1),yb=J(Ws,Y8==0?1:8);ef[yb]=1,V8==2&&(ef[yb=J(Ws,8)]=1);var jh=1}else{var bb=i(19),wb=J(Ws,4)+4;if(19<wb){Lh.a=3;var Th=0;break a}for(Ch=0;Ch<wb;++Ch)bb[b8[Ch]]=J(Ws,3);var P0=void 0,tf=void 0,xb=Lh,G8=bb,Oh=M0,Sb=ef,I0=0,Js=xb.m,_b=8,Ab=s(128,P);r:for(;T(Ab,0,7,G8,19);){if(J(Js,1)){var W8=2+2*J(Js,3);if((P0=2+J(Js,W8))>Oh)break r}else P0=Oh;for(tf=0;tf<Oh&&P0--;){B(Js);var Nb=Ab[0+(127&z(Js))];te(Js,Js.u+Nb.g);var tu=Nb.value;if(16>tu)Sb[tf++]=tu,tu!=0&&(_b=tu);else{var J8=tu==16,Eb=tu-16,K8=v8[Eb],Cb=J(Js,g8[Eb])+K8;if(tf+Cb>Oh)break r;for(var X8=J8?_b:0;0<Cb--;)Sb[tf++]=X8}}I0=1;break r}I0||(xb.a=3),jh=I0}(jh=jh&&!Ws.h)&&(k0=T(z8,q8,8,ef,M0)),jh&&k0!=0?Th=k0:(Lh.a=3,Th=0)}if(Th==0)break n;if(Eh&&y8[_t]==1&&(Eh=Nh[Kn].g==0),gb+=Nh[Kn].g,Kn+=Th,3>=_t){var nf,F0=Zc[0];for(nf=1;nf<Mn;++nf)Zc[nf]>F0&&(F0=Zc[nf]);vb+=F0}}if(di.nd=Eh,di.Qb=0,Eh&&(di.qb=(Zl[3][eu[3]+0].value<<24|Zl[1][eu[1]+0].value<<16|Zl[2][eu[2]+0].value)>>>0,gb==0&&256>Zl[0][eu[0]+0].value&&(di.Qb=1,di.qb+=Zl[0][eu[0]+0].value<<8)),di.jc=!di.Qb&&6>vb,di.jc){var Dh,ns=di;for(Dh=0;Dh<yr;++Dh){var Ks=Dh,Xs=ns.pd[Ks],Rh=ns.G[0][ns.H[0]+Ks];256<=Rh.value?(Xs.g=Rh.g+256,Xs.value=Rh.value):(Xs.g=0,Xs.value=0,Ks>>=$e(Rh,8,Xs),Ks>>=$e(ns.G[1][ns.H[1]+Ks],16,Xs),Ks>>=$e(ns.G[2][ns.H[2]+Ks],0,Xs),$e(ns.G[3][ns.H[3]+Ks],24,Xs))}}}cr.vc=br,cr.Wb=$r,cr.Ya=Ah,cr.yc=R0,cn=1;break t}cn=0}if(!(I=cn)){N.a=3;break e}if(0<ve){if(K.ua=1<<ve,!Me(K.Wa,ve)){N.a=1,I=0;break e}}else K.ua=0;var B0=N,Lb=F,Q8=U,$0=B0.s,U0=$0.xc;if(B0.c=Lb,B0.i=Q8,$0.md=Pe(Lb,U0),$0.wc=U0==0?-1:(1<<U0)-1,A){N.xb=j8;break e}if((ue=i(F*U))==null){N.a=1,I=0;break e}I=(I=at(N,ue,0,F,U,U,null))&&!H.h;break e}return I?(M!=null?M[0]=ue:(t(ue==null),t(A)),N.$=0,A||Tt(K)):Tt(K),I}function Gt(h,m){var A=h.c*h.i,N=A+m+16*m;return t(h.c<=m),h.V=i(N),h.V==null?(h.Ta=null,h.Ua=0,h.a=1,0):(h.Ta=h.V,h.Ua=h.Ba+A+m,1)}function qt(h,m){var A=h.C,N=m-A,M=h.V,I=h.Ba+h.c*A;for(t(m<=h.l.o);0<N;){var F=16<N?16:N,U=h.l.ma,H=h.l.width,K=H*F,ue=U.ca,ve=U.tb+H*A,ye=h.Ta,he=h.Ua;Ve(h,F,M,I),zn(ye,he,ue,ve,K),et(U,A,A+F,ue,ve,H),N-=F,M+=F*h.c,A+=F}t(A==m),h.C=h.Ma=m}function Gr(){this.ub=this.yd=this.td=this.Rb=0}function Fa(){this.Kd=this.Ld=this.Ud=this.Td=this.i=this.c=0}function Pr(){this.Fb=this.Bb=this.Cb=0,this.Zb=i(4),this.Lb=i(4)}function Ir(){this.Yb=function(){var h=[];return function m(A,N,M){for(var I=M[N],F=0;F<I&&(A.push(M.length>N+1?[]:0),!(M.length<N+1));F++)m(A[F],N+1,M)}(h,0,[3,11]),h}()}function Uo(){this.jb=i(3),this.Wc=o([4,8],Ir),this.Xc=o([4,17],Ir)}function Yi(){this.Pc=this.wb=this.Tb=this.zd=0,this.vd=new i(4),this.od=new i(4)}function Wr(){this.ld=this.La=this.dd=this.tc=0}function Gi(){this.Na=this.la=0}function Ps(){this.Sc=[0,0],this.Eb=[0,0],this.Qc=[0,0],this.ia=this.lc=0}function jt(){this.ad=i(384),this.Za=0,this.Ob=i(16),this.$b=this.Ad=this.ia=this.Gc=this.Hc=this.Dd=0}function Wn(){this.uc=this.M=this.Nb=0,this.wa=Array(new Wr),this.Y=0,this.ya=Array(new jt),this.aa=0,this.l=new vn}function si(){this.y=i(16),this.f=i(8),this.ea=i(8)}function oi(){this.cb=this.a=0,this.sc="",this.m=new le,this.Od=new Gr,this.Kc=new Fa,this.ed=new Yi,this.Qa=new Pr,this.Ic=this.$c=this.Aa=0,this.D=new Wn,this.Xb=this.Va=this.Hb=this.zb=this.yb=this.Ub=this.za=0,this.Jc=s(8,le),this.ia=0,this.pb=s(4,Ps),this.Pa=new Uo,this.Bd=this.kc=0,this.Ac=[],this.Bc=0,this.zc=[0,0,0,0],this.Gd=Array(new si),this.Hd=0,this.rb=Array(new Gi),this.sb=0,this.wa=Array(new Wr),this.Y=0,this.oc=[],this.pc=0,this.sa=[],this.ta=0,this.qa=[],this.ra=0,this.Ha=[],this.B=this.R=this.Ia=0,this.Ec=[],this.M=this.ja=this.Vb=this.Fc=0,this.ya=Array(new jt),this.L=this.aa=0,this.gd=o([4,2],Wr),this.ga=null,this.Fa=[],this.Cc=this.qc=this.P=0,this.Gb=[],this.Uc=0,this.mb=[],this.nb=0,this.rc=[],this.Ga=this.Vc=0}function vn(){this.T=this.U=this.ka=this.height=this.width=0,this.y=[],this.f=[],this.ea=[],this.Rc=this.fa=this.W=this.N=this.O=0,this.ma="void",this.put="VP8IoPutHook",this.ac="VP8IoSetupHook",this.bc="VP8IoTeardownHook",this.ha=this.Kb=0,this.data=[],this.hb=this.ib=this.da=this.o=this.j=this.va=this.v=this.Da=this.ob=this.w=0,this.F=[],this.J=0}function Is(){var h=new oi;return h!=null&&(h.a=0,h.sc="OK",h.cb=0,h.Xb=0,Xc||(Xc=Jd)),h}function jn(h,m,A){return h.a==0&&(h.a=m,h.sc=A,h.cb=0),0}function Rl(h,m,A){return 3<=A&&h[m+0]==157&&h[m+1]==1&&h[m+2]==42}function Wd(h,m){if(h==null)return 0;if(h.a=0,h.sc="OK",m==null)return jn(h,2,"null VP8Io passed to VP8GetHeaders()");var A=m.data,N=m.w,M=m.ha;if(4>M)return jn(h,7,"Truncated header.");var I=A[N+0]|A[N+1]<<8|A[N+2]<<16,F=h.Od;if(F.Rb=!(1&I),F.td=I>>1&7,F.yd=I>>4&1,F.ub=I>>5,3<F.td)return jn(h,3,"Incorrect keyframe parameters.");if(!F.yd)return jn(h,4,"Frame not displayable.");N+=3,M-=3;var U=h.Kc;if(F.Rb){if(7>M)return jn(h,7,"cannot parse picture header");if(!Rl(A,N,M))return jn(h,3,"Bad code word");U.c=16383&(A[N+4]<<8|A[N+3]),U.Td=A[N+4]>>6,U.i=16383&(A[N+6]<<8|A[N+5]),U.Ud=A[N+6]>>6,N+=7,M-=7,h.za=U.c+15>>4,h.Ub=U.i+15>>4,m.width=U.c,m.height=U.i,m.Da=0,m.j=0,m.v=0,m.va=m.width,m.o=m.height,m.da=0,m.ib=m.width,m.hb=m.height,m.U=m.width,m.T=m.height,a((I=h.Pa).jb,0,255,I.jb.length),t((I=h.Qa)!=null),I.Cb=0,I.Bb=0,I.Fb=1,a(I.Zb,0,0,I.Zb.length),a(I.Lb,0,0,I.Lb)}if(F.ub>M)return jn(h,7,"bad partition length");se(I=h.m,A,N,F.ub),N+=F.ub,M-=F.ub,F.Rb&&(U.Ld=fe(I),U.Kd=fe(I)),U=h.Qa;var H,K=h.Pa;if(t(I!=null),t(U!=null),U.Cb=fe(I),U.Cb){if(U.Bb=fe(I),fe(I)){for(U.Fb=fe(I),H=0;4>H;++H)U.Zb[H]=fe(I)?ne(I,7):0;for(H=0;4>H;++H)U.Lb[H]=fe(I)?ne(I,6):0}if(U.Bb)for(H=0;3>H;++H)K.jb[H]=fe(I)?G(I,8):255}else U.Bb=0;if(I.Ka)return jn(h,3,"cannot parse segment header");if((U=h.ed).zd=fe(I),U.Tb=G(I,6),U.wb=G(I,3),U.Pc=fe(I),U.Pc&&fe(I)){for(K=0;4>K;++K)fe(I)&&(U.vd[K]=ne(I,6));for(K=0;4>K;++K)fe(I)&&(U.od[K]=ne(I,6))}if(h.L=U.Tb==0?0:U.zd?1:2,I.Ka)return jn(h,3,"cannot parse filter header");var ue=M;if(M=H=N,N=H+ue,U=ue,h.Xb=(1<<G(h.m,2))-1,ue<3*(K=h.Xb))A=7;else{for(H+=3*K,U-=3*K,ue=0;ue<K;++ue){var ve=A[M+0]|A[M+1]<<8|A[M+2]<<16;ve>U&&(ve=U),se(h.Jc[+ue],A,H,ve),H+=ve,U-=ve,M+=3}se(h.Jc[+K],A,H,U),A=H<N?0:5}if(A!=0)return jn(h,A,"cannot parse partitions");for(A=G(H=h.m,7),M=fe(H)?ne(H,4):0,N=fe(H)?ne(H,4):0,U=fe(H)?ne(H,4):0,K=fe(H)?ne(H,4):0,H=fe(H)?ne(H,4):0,ue=h.Qa,ve=0;4>ve;++ve){if(ue.Cb){var ye=ue.Zb[ve];ue.Fb||(ye+=A)}else{if(0<ve){h.pb[ve]=h.pb[0];continue}ye=A}var he=h.pb[ve];he.Sc[0]=T0[ga(ye+M,127)],he.Sc[1]=O0[ga(ye+0,127)],he.Eb[0]=2*T0[ga(ye+N,127)],he.Eb[1]=101581*O0[ga(ye+U,127)]>>16,8>he.Eb[1]&&(he.Eb[1]=8),he.Qc[0]=T0[ga(ye+K,117)],he.Qc[1]=O0[ga(ye+H,127)],he.lc=ye+H}if(!F.Rb)return jn(h,4,"Not a key frame.");for(fe(I),F=h.Pa,A=0;4>A;++A){for(M=0;8>M;++M)for(N=0;3>N;++N)for(U=0;11>U;++U)K=me(I,C8[A][M][N][U])?G(I,8):N8[A][M][N][U],F.Wc[A][M].Yb[N][U]=K;for(M=0;17>M;++M)F.Xc[A][M]=F.Wc[A][L8[M]]}return h.kc=fe(I),h.kc&&(h.Bd=G(I,8)),h.cb=1}function Jd(h,m,A,N,M,I,F){var U=m[M].Yb[A];for(A=0;16>M;++M){if(!me(h,U[A+0]))return M;for(;!me(h,U[A+1]);)if(U=m[++M].Yb[0],A=0,M==16)return 16;var H=m[M+1].Yb;if(me(h,U[A+2])){var K=h,ue=0;if(me(K,(ye=U)[(ve=A)+3]))if(me(K,ye[ve+6])){for(U=0,ve=2*(ue=me(K,ye[ve+8]))+(ye=me(K,ye[ve+9+ue])),ue=0,ye=_8[ve];ye[U];++U)ue+=ue+me(K,ye[U]);ue+=3+(8<<ve)}else me(K,ye[ve+7])?(ue=7+2*me(K,165),ue+=me(K,145)):ue=5+me(K,159);else ue=me(K,ye[ve+4])?3+me(K,ye[ve+5]):2;U=H[2]}else ue=1,U=H[1];H=F+A8[M],0>(K=h).b&&ee(K);var ve,ye=K.b,he=(ve=K.Ca>>1)-(K.I>>ye)>>31;--K.b,K.Ca+=he,K.Ca|=1,K.I-=(ve+1&he)<<ye,I[H]=((ue^he)-he)*N[(0<M)+0]}return 16}function Lc(h){var m=h.rb[h.sb-1];m.la=0,m.Na=0,a(h.zc,0,0,h.zc.length),h.ja=0}function s0(h,m){if(h==null)return 0;if(m==null)return jn(h,2,"NULL VP8Io parameter in VP8Decode().");if(!h.cb&&!Wd(h,m))return 0;if(t(h.cb),m.ac==null||m.ac(m)){m.ob&&(h.L=0);var A=_h[h.L];if(h.L==2?(h.yb=0,h.zb=0):(h.yb=m.v-A>>4,h.zb=m.j-A>>4,0>h.yb&&(h.yb=0),0>h.zb&&(h.zb=0)),h.Va=m.o+15+A>>4,h.Hb=m.va+15+A>>4,h.Hb>h.za&&(h.Hb=h.za),h.Va>h.Ub&&(h.Va=h.Ub),0<h.L){var N=h.ed;for(A=0;4>A;++A){var M;if(h.Qa.Cb){var I=h.Qa.Lb[A];h.Qa.Fb||(I+=N.Tb)}else I=N.Tb;for(M=0;1>=M;++M){var F=h.gd[A][M],U=I;if(N.Pc&&(U+=N.vd[0],M&&(U+=N.od[0])),0<(U=0>U?0:63<U?63:U)){var H=U;0<N.wb&&(H=4<N.wb?H>>2:H>>1)>9-N.wb&&(H=9-N.wb),1>H&&(H=1),F.dd=H,F.tc=2*U+H,F.ld=40<=U?2:15<=U?1:0}else F.tc=0;F.La=M}}}A=0}else jn(h,6,"Frame setup failed"),A=h.a;if(A=A==0){if(A){h.$c=0,0<h.Aa||(h.Ic=U8);e:{A=h.Ic,N=4*(H=h.za);var K=32*H,ue=H+1,ve=0<h.L?H*(0<h.Aa?2:1):0,ye=(h.Aa==2?2:1)*H;if((F=N+832+(M=3*(16*A+_h[h.L])/2*K)+(I=h.Fa!=null&&0<h.Fa.length?h.Kc.c*h.Kc.i:0))!=F)A=0;else{if(F>h.Vb){if(h.Vb=0,h.Ec=i(F),h.Fc=0,h.Ec==null){A=jn(h,1,"no memory during frame initialization.");break e}h.Vb=F}F=h.Ec,U=h.Fc,h.Ac=F,h.Bc=U,U+=N,h.Gd=s(K,si),h.Hd=0,h.rb=s(ue+1,Gi),h.sb=1,h.wa=ve?s(ve,Wr):null,h.Y=0,h.D.Nb=0,h.D.wa=h.wa,h.D.Y=h.Y,0<h.Aa&&(h.D.Y+=H),t(!0),h.oc=F,h.pc=U,U+=832,h.ya=s(ye,jt),h.aa=0,h.D.ya=h.ya,h.D.aa=h.aa,h.Aa==2&&(h.D.aa+=H),h.R=16*H,h.B=8*H,H=(K=_h[h.L])*h.R,K=K/2*h.B,h.sa=F,h.ta=U+H,h.qa=h.sa,h.ra=h.ta+16*A*h.R+K,h.Ha=h.qa,h.Ia=h.ra+8*A*h.B+K,h.$c=0,U+=M,h.mb=I?F:null,h.nb=I?U:null,t(U+I<=h.Fc+h.Vb),Lc(h),a(h.Ac,h.Bc,0,N),A=1}}if(A){if(m.ka=0,m.y=h.sa,m.O=h.ta,m.f=h.qa,m.N=h.ra,m.ea=h.Ha,m.Vd=h.Ia,m.fa=h.R,m.Rc=h.B,m.F=null,m.J=0,!ph){for(A=-255;255>=A;++A)ar[255+A]=0>A?-A:A;for(A=-1020;1020>=A;++A)Zi[1020+A]=-128>A?-128:127<A?127:A;for(A=-112;112>=A;++A)Kc[112+A]=-16>A?-16:15<A?15:A;for(A=-255;510>=A;++A)Xl[255+A]=0>A?0:255<A?255:A;ph=1}Wl=u0,Qi=o0,Gc=Xd,Br=l0,$a=Qd,Un=Kd,Jl=Mc,hh=Ho,Wc=S0,Go=kc,Wo=x0,qs=Bl,Jo=Pc,Kl=oh,Ko=sh,Hs=Ei,Jc=Ji,Ua=w0,fi[0]=Ni,fi[1]=c0,fi[2]=p0,fi[3]=m0,fi[4]=th,fi[5]=Il,fi[6]=nh,fi[7]=Oc,fi[8]=v0,fi[9]=g0,Vs[0]=Zd,Vs[1]=d0,Vs[2]=Wi,Vs[3]=kl,Vs[4]=Lr,Vs[5]=h0,Vs[6]=eh,es[0]=Fs,es[1]=f0,es[2]=y0,es[3]=Dc,es[4]=qo,es[5]=b0,es[6]=Rc,A=1}else A=0}A&&(A=function(he,Le){for(he.M=0;he.M<he.Va;++he.M){var xe,ce=he.Jc[he.M&he.Xb],de=he.m,Ne=he;for(xe=0;xe<Ne.za;++xe){var Oe=de,Ce=Ne,We=Ce.Ac,Be=Ce.Bc+4*xe,it=Ce.zc,ze=Ce.ya[Ce.aa+xe];if(Ce.Qa.Bb?ze.$b=me(Oe,Ce.Pa.jb[0])?2+me(Oe,Ce.Pa.jb[2]):me(Oe,Ce.Pa.jb[1]):ze.$b=0,Ce.kc&&(ze.Ad=me(Oe,Ce.Bd)),ze.Za=!me(Oe,145)+0,ze.Za){var Wt=ze.Ob,tn=0;for(Ce=0;4>Ce;++Ce){var zt,Rt=it[0+Ce];for(zt=0;4>zt;++zt){Rt=E8[We[Be+zt]][Rt];for(var cn=ib[me(Oe,Rt[0])];0<cn;)cn=ib[2*cn+me(Oe,Rt[cn])];Rt=-cn,We[Be+zt]=Rt}r(Wt,tn,We,Be,4),tn+=4,it[0+Ce]=Rt}}else Rt=me(Oe,156)?me(Oe,128)?1:3:me(Oe,163)?2:0,ze.Ob[0]=Rt,a(We,Be,Rt,4),a(it,0,Rt,4);ze.Dd=me(Oe,142)?me(Oe,114)?me(Oe,183)?1:3:2:0}if(Ne.m.Ka)return jn(he,7,"Premature end-of-partition0 encountered.");for(;he.ja<he.za;++he.ja){if(Ne=ce,Oe=(de=he).rb[de.sb-1],We=de.rb[de.sb+de.ja],xe=de.ya[de.aa+de.ja],Be=de.kc?xe.Ad:0)Oe.la=We.la=0,xe.Za||(Oe.Na=We.Na=0),xe.Hc=0,xe.Gc=0,xe.ia=0;else{var on,_t;if(Oe=We,We=Ne,Be=de.Pa.Xc,it=de.ya[de.aa+de.ja],ze=de.pb[it.$b],Ce=it.ad,Wt=0,tn=de.rb[de.sb-1],Rt=zt=0,a(Ce,Wt,0,384),it.Za)var Kn=0,Qr=Be[3];else{cn=i(16);var Xn=Oe.Na+tn.Na;if(Xn=Xc(We,Be[1],Xn,ze.Eb,0,cn,0),Oe.Na=tn.Na=(0<Xn)+0,1<Xn)Wl(cn,0,Ce,Wt);else{var Zr=cn[0]+3>>3;for(cn=0;256>cn;cn+=16)Ce[Wt+cn]=Zr}Kn=1,Qr=Be[0]}var nn=15&Oe.la,ya=15&tn.la;for(cn=0;4>cn;++cn){var ba=1&ya;for(Zr=_t=0;4>Zr;++Zr)nn=nn>>1|(ba=(Xn=Xc(We,Qr,Xn=ba+(1&nn),ze.Sc,Kn,Ce,Wt))>Kn)<<7,_t=_t<<2|(3<Xn?3:1<Xn?2:Ce[Wt+0]!=0),Wt+=16;nn>>=4,ya=ya>>1|ba<<7,zt=(zt<<8|_t)>>>0}for(Qr=nn,Kn=ya>>4,on=0;4>on;on+=2){for(_t=0,nn=Oe.la>>4+on,ya=tn.la>>4+on,cn=0;2>cn;++cn){for(ba=1&ya,Zr=0;2>Zr;++Zr)Xn=ba+(1&nn),nn=nn>>1|(ba=0<(Xn=Xc(We,Be[2],Xn,ze.Qc,0,Ce,Wt)))<<3,_t=_t<<2|(3<Xn?3:1<Xn?2:Ce[Wt+0]!=0),Wt+=16;nn>>=2,ya=ya>>1|ba<<5}Rt|=_t<<4*on,Qr|=nn<<4<<on,Kn|=(240&ya)<<on}Oe.la=Qr,tn.la=Kn,it.Hc=zt,it.Gc=Rt,it.ia=43690&Rt?0:ze.ia,Be=!(zt|Rt)}if(0<de.L&&(de.wa[de.Y+de.ja]=de.gd[xe.$b][xe.Za],de.wa[de.Y+de.ja].La|=!Be),Ne.Ka)return jn(he,7,"Premature end-of-file encountered.")}if(Lc(he),de=Le,Ne=1,xe=(ce=he).D,Oe=0<ce.L&&ce.M>=ce.zb&&ce.M<=ce.Va,ce.Aa==0)e:{if(xe.M=ce.M,xe.uc=Oe,zc(ce,xe),Ne=1,xe=(_t=ce.D).Nb,Oe=(Rt=_h[ce.L])*ce.R,We=Rt/2*ce.B,cn=16*xe*ce.R,Zr=8*xe*ce.B,Be=ce.sa,it=ce.ta-Oe+cn,ze=ce.qa,Ce=ce.ra-We+Zr,Wt=ce.Ha,tn=ce.Ia-We+Zr,ya=(nn=_t.M)==0,zt=nn>=ce.Va-1,ce.Aa==2&&zc(ce,_t),_t.uc)for(ba=(Xn=ce).D.M,t(Xn.D.uc),_t=Xn.yb;_t<Xn.Hb;++_t){Kn=_t,Qr=ba;var cr=(br=(Mn=Xn).D).Nb;on=Mn.R;var br=br.wa[br.Y+Kn],$r=Mn.sa,Va=Mn.ta+16*cr*on+16*Kn,Li=br.dd,fr=br.tc;if(fr!=0)if(t(3<=fr),Mn.L==1)0<Kn&&Hs($r,Va,on,fr+4),br.La&&Ua($r,Va,on,fr),0<Qr&&Ko($r,Va,on,fr+4),br.La&&Jc($r,Va,on,fr);else{var ts=Mn.B,Xo=Mn.qa,Ql=Mn.ra+8*cr*ts+8*Kn,Gs=Mn.Ha,Mn=Mn.Ia+8*cr*ts+8*Kn;cr=br.ld,0<Kn&&(hh($r,Va,on,fr+4,Li,cr),Go(Xo,Ql,Gs,Mn,ts,fr+4,Li,cr)),br.La&&(qs($r,Va,on,fr,Li,cr),Kl(Xo,Ql,Gs,Mn,ts,fr,Li,cr)),0<Qr&&(Jl($r,Va,on,fr+4,Li,cr),Wc(Xo,Ql,Gs,Mn,ts,fr+4,Li,cr)),br.La&&(Wo($r,Va,on,fr,Li,cr),Jo(Xo,Ql,Gs,Mn,ts,fr,Li,cr))}}if(ce.ia&&alert("todo:DitherRow"),de.put!=null){if(_t=16*nn,nn=16*(nn+1),ya?(de.y=ce.sa,de.O=ce.ta+cn,de.f=ce.qa,de.N=ce.ra+Zr,de.ea=ce.Ha,de.W=ce.Ia+Zr):(_t-=Rt,de.y=Be,de.O=it,de.f=ze,de.N=Ce,de.ea=Wt,de.W=tn),zt||(nn-=Rt),nn>de.o&&(nn=de.o),de.F=null,de.J=null,ce.Fa!=null&&0<ce.Fa.length&&_t<nn&&(de.J=$c(ce,de,_t,nn-_t),de.F=ce.mb,de.F==null&&de.F.length==0)){Ne=jn(ce,3,"Could not decode alpha data.");break e}_t<de.j&&(Rt=de.j-_t,_t=de.j,t(!(1&Rt)),de.O+=ce.R*Rt,de.N+=ce.B*(Rt>>1),de.W+=ce.B*(Rt>>1),de.F!=null&&(de.J+=de.width*Rt)),_t<nn&&(de.O+=de.v,de.N+=de.v>>1,de.W+=de.v>>1,de.F!=null&&(de.J+=de.v),de.ka=_t-de.j,de.U=de.va-de.v,de.T=nn-_t,Ne=de.put(de))}xe+1!=ce.Ic||zt||(r(ce.sa,ce.ta-Oe,Be,it+16*ce.R,Oe),r(ce.qa,ce.ra-We,ze,Ce+8*ce.B,We),r(ce.Ha,ce.Ia-We,Wt,tn+8*ce.B,We))}if(!Ne)return jn(he,6,"Output aborted.")}return 1}(h,m)),m.bc!=null&&m.bc(m),A&=1}return A?(h.cb=0,A):0}function li(h,m,A,N,M){M=h[m+A+32*N]+(M>>3),h[m+A+32*N]=-256&M?0>M?0:255:M}function Ml(h,m,A,N,M,I){li(h,m,0,A,N+M),li(h,m,1,A,N+I),li(h,m,2,A,N-I),li(h,m,3,A,N-M)}function Jr(h){return(20091*h>>16)+h}function jc(h,m,A,N){var M,I=0,F=i(16);for(M=0;4>M;++M){var U=h[m+0]+h[m+8],H=h[m+0]-h[m+8],K=(35468*h[m+4]>>16)-Jr(h[m+12]),ue=Jr(h[m+4])+(35468*h[m+12]>>16);F[I+0]=U+ue,F[I+1]=H+K,F[I+2]=H-K,F[I+3]=U-ue,I+=4,m++}for(M=I=0;4>M;++M)U=(h=F[I+0]+4)+F[I+8],H=h-F[I+8],K=(35468*F[I+4]>>16)-Jr(F[I+12]),li(A,N,0,0,U+(ue=Jr(F[I+4])+(35468*F[I+12]>>16))),li(A,N,1,0,H+K),li(A,N,2,0,H-K),li(A,N,3,0,U-ue),I++,N+=32}function Kd(h,m,A,N){var M=h[m+0]+4,I=35468*h[m+4]>>16,F=Jr(h[m+4]),U=35468*h[m+1]>>16;Ml(A,N,0,M+F,h=Jr(h[m+1]),U),Ml(A,N,1,M+I,h,U),Ml(A,N,2,M-I,h,U),Ml(A,N,3,M-F,h,U)}function o0(h,m,A,N,M){jc(h,m,A,N),M&&jc(h,m+16,A,N+4)}function Xd(h,m,A,N){Qi(h,m+0,A,N,1),Qi(h,m+32,A,N+128,1)}function l0(h,m,A,N){var M;for(h=h[m+0]+4,M=0;4>M;++M)for(m=0;4>m;++m)li(A,N,m,M,h)}function Qd(h,m,A,N){h[m+0]&&Br(h,m+0,A,N),h[m+16]&&Br(h,m+16,A,N+4),h[m+32]&&Br(h,m+32,A,N+128),h[m+48]&&Br(h,m+48,A,N+128+4)}function u0(h,m,A,N){var M,I=i(16);for(M=0;4>M;++M){var F=h[m+0+M]+h[m+12+M],U=h[m+4+M]+h[m+8+M],H=h[m+4+M]-h[m+8+M],K=h[m+0+M]-h[m+12+M];I[0+M]=F+U,I[8+M]=F-U,I[4+M]=K+H,I[12+M]=K-H}for(M=0;4>M;++M)F=(h=I[0+4*M]+3)+I[3+4*M],U=I[1+4*M]+I[2+4*M],H=I[1+4*M]-I[2+4*M],K=h-I[3+4*M],A[N+0]=F+U>>3,A[N+16]=K+H>>3,A[N+32]=F-U>>3,A[N+48]=K-H>>3,N+=64}function Tc(h,m,A){var N,M=m-32,I=va,F=255-h[M-1];for(N=0;N<A;++N){var U,H=I,K=F+h[m-1];for(U=0;U<A;++U)h[m+U]=H[K+h[M+U]];m+=32}}function c0(h,m){Tc(h,m,4)}function f0(h,m){Tc(h,m,8)}function d0(h,m){Tc(h,m,16)}function Wi(h,m){var A;for(A=0;16>A;++A)r(h,m+32*A,h,m-32,16)}function kl(h,m){var A;for(A=16;0<A;--A)a(h,m,h[m-1],16),m+=32}function Pl(h,m,A){var N;for(N=0;16>N;++N)a(m,A+32*N,h,16)}function Zd(h,m){var A,N=16;for(A=0;16>A;++A)N+=h[m-1+32*A]+h[m+A-32];Pl(N>>5,h,m)}function Lr(h,m){var A,N=8;for(A=0;16>A;++A)N+=h[m-1+32*A];Pl(N>>4,h,m)}function h0(h,m){var A,N=8;for(A=0;16>A;++A)N+=h[m+A-32];Pl(N>>4,h,m)}function eh(h,m){Pl(128,h,m)}function vt(h,m,A){return h+2*m+A+2>>2}function p0(h,m){var A,N=m-32;for(N=new Uint8Array([vt(h[N-1],h[N+0],h[N+1]),vt(h[N+0],h[N+1],h[N+2]),vt(h[N+1],h[N+2],h[N+3]),vt(h[N+2],h[N+3],h[N+4])]),A=0;4>A;++A)r(h,m+32*A,N,0,N.length)}function m0(h,m){var A=h[m-1],N=h[m-1+32],M=h[m-1+64],I=h[m-1+96];Se(h,m+0,16843009*vt(h[m-1-32],A,N)),Se(h,m+32,16843009*vt(A,N,M)),Se(h,m+64,16843009*vt(N,M,I)),Se(h,m+96,16843009*vt(M,I,I))}function Ni(h,m){var A,N=4;for(A=0;4>A;++A)N+=h[m+A-32]+h[m-1+32*A];for(N>>=3,A=0;4>A;++A)a(h,m+32*A,N,4)}function th(h,m){var A=h[m-1+0],N=h[m-1+32],M=h[m-1+64],I=h[m-1-32],F=h[m+0-32],U=h[m+1-32],H=h[m+2-32],K=h[m+3-32];h[m+0+96]=vt(N,M,h[m-1+96]),h[m+1+96]=h[m+0+64]=vt(A,N,M),h[m+2+96]=h[m+1+64]=h[m+0+32]=vt(I,A,N),h[m+3+96]=h[m+2+64]=h[m+1+32]=h[m+0+0]=vt(F,I,A),h[m+3+64]=h[m+2+32]=h[m+1+0]=vt(U,F,I),h[m+3+32]=h[m+2+0]=vt(H,U,F),h[m+3+0]=vt(K,H,U)}function nh(h,m){var A=h[m+1-32],N=h[m+2-32],M=h[m+3-32],I=h[m+4-32],F=h[m+5-32],U=h[m+6-32],H=h[m+7-32];h[m+0+0]=vt(h[m+0-32],A,N),h[m+1+0]=h[m+0+32]=vt(A,N,M),h[m+2+0]=h[m+1+32]=h[m+0+64]=vt(N,M,I),h[m+3+0]=h[m+2+32]=h[m+1+64]=h[m+0+96]=vt(M,I,F),h[m+3+32]=h[m+2+64]=h[m+1+96]=vt(I,F,U),h[m+3+64]=h[m+2+96]=vt(F,U,H),h[m+3+96]=vt(U,H,H)}function Il(h,m){var A=h[m-1+0],N=h[m-1+32],M=h[m-1+64],I=h[m-1-32],F=h[m+0-32],U=h[m+1-32],H=h[m+2-32],K=h[m+3-32];h[m+0+0]=h[m+1+64]=I+F+1>>1,h[m+1+0]=h[m+2+64]=F+U+1>>1,h[m+2+0]=h[m+3+64]=U+H+1>>1,h[m+3+0]=H+K+1>>1,h[m+0+96]=vt(M,N,A),h[m+0+64]=vt(N,A,I),h[m+0+32]=h[m+1+96]=vt(A,I,F),h[m+1+32]=h[m+2+96]=vt(I,F,U),h[m+2+32]=h[m+3+96]=vt(F,U,H),h[m+3+32]=vt(U,H,K)}function Oc(h,m){var A=h[m+0-32],N=h[m+1-32],M=h[m+2-32],I=h[m+3-32],F=h[m+4-32],U=h[m+5-32],H=h[m+6-32],K=h[m+7-32];h[m+0+0]=A+N+1>>1,h[m+1+0]=h[m+0+64]=N+M+1>>1,h[m+2+0]=h[m+1+64]=M+I+1>>1,h[m+3+0]=h[m+2+64]=I+F+1>>1,h[m+0+32]=vt(A,N,M),h[m+1+32]=h[m+0+96]=vt(N,M,I),h[m+2+32]=h[m+1+96]=vt(M,I,F),h[m+3+32]=h[m+2+96]=vt(I,F,U),h[m+3+64]=vt(F,U,H),h[m+3+96]=vt(U,H,K)}function g0(h,m){var A=h[m-1+0],N=h[m-1+32],M=h[m-1+64],I=h[m-1+96];h[m+0+0]=A+N+1>>1,h[m+2+0]=h[m+0+32]=N+M+1>>1,h[m+2+32]=h[m+0+64]=M+I+1>>1,h[m+1+0]=vt(A,N,M),h[m+3+0]=h[m+1+32]=vt(N,M,I),h[m+3+32]=h[m+1+64]=vt(M,I,I),h[m+3+64]=h[m+2+64]=h[m+0+96]=h[m+1+96]=h[m+2+96]=h[m+3+96]=I}function v0(h,m){var A=h[m-1+0],N=h[m-1+32],M=h[m-1+64],I=h[m-1+96],F=h[m-1-32],U=h[m+0-32],H=h[m+1-32],K=h[m+2-32];h[m+0+0]=h[m+2+32]=A+F+1>>1,h[m+0+32]=h[m+2+64]=N+A+1>>1,h[m+0+64]=h[m+2+96]=M+N+1>>1,h[m+0+96]=I+M+1>>1,h[m+3+0]=vt(U,H,K),h[m+2+0]=vt(F,U,H),h[m+1+0]=h[m+3+32]=vt(A,F,U),h[m+1+32]=h[m+3+64]=vt(N,A,F),h[m+1+64]=h[m+3+96]=vt(M,N,A),h[m+1+96]=vt(I,M,N)}function y0(h,m){var A;for(A=0;8>A;++A)r(h,m+32*A,h,m-32,8)}function Dc(h,m){var A;for(A=0;8>A;++A)a(h,m,h[m-1],8),m+=32}function zo(h,m,A){var N;for(N=0;8>N;++N)a(m,A+32*N,h,8)}function Fs(h,m){var A,N=8;for(A=0;8>A;++A)N+=h[m+A-32]+h[m-1+32*A];zo(N>>4,h,m)}function b0(h,m){var A,N=4;for(A=0;8>A;++A)N+=h[m+A-32];zo(N>>3,h,m)}function qo(h,m){var A,N=4;for(A=0;8>A;++A)N+=h[m-1+32*A];zo(N>>3,h,m)}function Rc(h,m){zo(128,h,m)}function Fl(h,m,A){var N=h[m-A],M=h[m+0],I=3*(M-N)+N0[1020+h[m-2*A]-h[m+A]],F=mh[112+(I+4>>3)];h[m-A]=va[255+N+mh[112+(I+3>>3)]],h[m+0]=va[255+M-F]}function rh(h,m,A,N){var M=h[m+0],I=h[m+A];return qa[255+h[m-2*A]-h[m-A]]>N||qa[255+I-M]>N}function ah(h,m,A,N){return 4*qa[255+h[m-A]-h[m+0]]+qa[255+h[m-2*A]-h[m+A]]<=N}function ih(h,m,A,N,M){var I=h[m-3*A],F=h[m-2*A],U=h[m-A],H=h[m+0],K=h[m+A],ue=h[m+2*A],ve=h[m+3*A];return 4*qa[255+U-H]+qa[255+F-K]>N?0:qa[255+h[m-4*A]-I]<=M&&qa[255+I-F]<=M&&qa[255+F-U]<=M&&qa[255+ve-ue]<=M&&qa[255+ue-K]<=M&&qa[255+K-H]<=M}function sh(h,m,A,N){var M=2*N+1;for(N=0;16>N;++N)ah(h,m+N,A,M)&&Fl(h,m+N,A)}function Ei(h,m,A,N){var M=2*N+1;for(N=0;16>N;++N)ah(h,m+N*A,1,M)&&Fl(h,m+N*A,1)}function Ji(h,m,A,N){var M;for(M=3;0<M;--M)sh(h,m+=4*A,A,N)}function w0(h,m,A,N){var M;for(M=3;0<M;--M)Ei(h,m+=4,A,N)}function Bs(h,m,A,N,M,I,F,U){for(I=2*I+1;0<M--;){if(ih(h,m,A,I,F))if(rh(h,m,A,U))Fl(h,m,A);else{var H=h,K=m,ue=A,ve=H[K-2*ue],ye=H[K-ue],he=H[K+0],Le=H[K+ue],xe=H[K+2*ue],ce=27*(Ne=N0[1020+3*(he-ye)+N0[1020+ve-Le]])+63>>7,de=18*Ne+63>>7,Ne=9*Ne+63>>7;H[K-3*ue]=va[255+H[K-3*ue]+Ne],H[K-2*ue]=va[255+ve+de],H[K-ue]=va[255+ye+ce],H[K+0]=va[255+he-ce],H[K+ue]=va[255+Le-de],H[K+2*ue]=va[255+xe-Ne]}m+=N}}function ui(h,m,A,N,M,I,F,U){for(I=2*I+1;0<M--;){if(ih(h,m,A,I,F))if(rh(h,m,A,U))Fl(h,m,A);else{var H=h,K=m,ue=A,ve=H[K-ue],ye=H[K+0],he=H[K+ue],Le=mh[112+((xe=3*(ye-ve))+4>>3)],xe=mh[112+(xe+3>>3)],ce=Le+1>>1;H[K-2*ue]=va[255+H[K-2*ue]+ce],H[K-ue]=va[255+ve+xe],H[K+0]=va[255+ye-Le],H[K+ue]=va[255+he-ce]}m+=N}}function Mc(h,m,A,N,M,I){Bs(h,m,A,1,16,N,M,I)}function Ho(h,m,A,N,M,I){Bs(h,m,1,A,16,N,M,I)}function x0(h,m,A,N,M,I){var F;for(F=3;0<F;--F)ui(h,m+=4*A,A,1,16,N,M,I)}function Bl(h,m,A,N,M,I){var F;for(F=3;0<F;--F)ui(h,m+=4,1,A,16,N,M,I)}function S0(h,m,A,N,M,I,F,U){Bs(h,m,M,1,8,I,F,U),Bs(A,N,M,1,8,I,F,U)}function kc(h,m,A,N,M,I,F,U){Bs(h,m,1,M,8,I,F,U),Bs(A,N,1,M,8,I,F,U)}function Pc(h,m,A,N,M,I,F,U){ui(h,m+4*M,M,1,8,I,F,U),ui(A,N+4*M,M,1,8,I,F,U)}function oh(h,m,A,N,M,I,F,U){ui(h,m+4,1,M,8,I,F,U),ui(A,N+4,1,M,8,I,F,U)}function $l(){this.ba=new ma,this.ec=[],this.cc=[],this.Mc=[],this.Dc=this.Nc=this.dc=this.fc=0,this.Oa=new Ln,this.memory=0,this.Ib="OutputFunc",this.Jb="OutputAlphaFunc",this.Nd="OutputRowFunc"}function Ic(){this.data=[],this.offset=this.kd=this.ha=this.w=0,this.na=[],this.xa=this.gb=this.Ja=this.Sa=this.P=0}function Fc(){this.nc=this.Ea=this.b=this.hc=0,this.K=[],this.w=0}function lh(){this.ua=0,this.Wa=new X,this.vb=new X,this.md=this.xc=this.wc=0,this.vc=[],this.Wb=0,this.Ya=new Y,this.yc=new P}function _0(){this.xb=this.a=0,this.l=new vn,this.ca=new ma,this.V=[],this.Ba=0,this.Ta=[],this.Ua=0,this.m=new L,this.Pb=0,this.wd=new L,this.Ma=this.$=this.C=this.i=this.c=this.xd=0,this.s=new lh,this.ab=0,this.gc=s(4,Fc),this.Oc=0}function Ul(){this.Lc=this.Z=this.$a=this.i=this.c=0,this.l=new vn,this.ic=0,this.ca=[],this.tb=0,this.qd=null,this.rd=0}function Vo(h,m,A,N,M,I,F){for(h=h==null?0:h[m+0],m=0;m<F;++m)M[I+m]=h+A[N+m]&255,h=M[I+m]}function Bc(h,m,A,N,M,I,F){var U;if(h==null)Vo(null,null,A,N,M,I,F);else for(U=0;U<F;++U)M[I+U]=h[m+U]+A[N+U]&255}function $s(h,m,A,N,M,I,F){if(h==null)Vo(null,null,A,N,M,I,F);else{var U,H=h[m+0],K=H,ue=H;for(U=0;U<F;++U)K=ue+(H=h[m+U])-K,ue=A[N+U]+(-256&K?0>K?0:255:K)&255,K=H,M[I+U]=ue}}function $c(h,m,A,N){var M=m.width,I=m.o;if(t(h!=null&&m!=null),0>A||0>=N||A+N>I)return null;if(!h.Cc){if(h.ga==null){var F;if(h.ga=new Ul,(F=h.ga==null)||(F=m.width*m.o,t(h.Gb.length==0),h.Gb=i(F),h.Uc=0,h.Gb==null?F=0:(h.mb=h.Gb,h.nb=h.Uc,h.rc=null,F=1),F=!F),!F){F=h.ga;var U=h.Fa,H=h.P,K=h.qc,ue=h.mb,ve=h.nb,ye=H+1,he=K-1,Le=F.l;if(t(U!=null&&ue!=null&&m!=null),Ys[0]=null,Ys[1]=Vo,Ys[2]=Bc,Ys[3]=$s,F.ca=ue,F.tb=ve,F.c=m.width,F.i=m.height,t(0<F.c&&0<F.i),1>=K)m=0;else if(F.$a=U[H+0]>>0&3,F.Z=U[H+0]>>2&3,F.Lc=U[H+0]>>4&3,H=U[H+0]>>6&3,0>F.$a||1<F.$a||4<=F.Z||1<F.Lc||H)m=0;else if(Le.put=Ia,Le.ac=rr,Le.bc=re,Le.ma=F,Le.width=m.width,Le.height=m.height,Le.Da=m.Da,Le.v=m.v,Le.va=m.va,Le.j=m.j,Le.o=m.o,F.$a)e:{t(F.$a==1),m=Yt();t:for(;;){if(m==null){m=0;break e}if(t(F!=null),F.mc=m,m.c=F.c,m.i=F.i,m.l=F.l,m.l.ma=F,m.l.width=F.c,m.l.height=F.i,m.a=0,Q(m.m,U,ye,he),!gn(F.c,F.i,1,m,null)||(m.ab==1&&m.gc[0].hc==3&&tt(m.s)?(F.ic=1,U=m.c*m.i,m.Ta=null,m.Ua=0,m.V=i(U),m.Ba=0,m.V==null?(m.a=1,m=0):m=1):(F.ic=0,m=Gt(m,F.c)),!m))break t;m=1;break e}F.mc=null,m=0}else m=he>=F.c*F.i;F=!m}if(F)return null;h.ga.Lc!=1?h.Ga=0:N=I-A}t(h.ga!=null),t(A+N<=I);e:{if(m=(U=h.ga).c,I=U.l.o,U.$a==0){if(ye=h.rc,he=h.Vc,Le=h.Fa,H=h.P+1+A*m,K=h.mb,ue=h.nb+A*m,t(H<=h.P+h.qc),U.Z!=0)for(t(Ys[U.Z]!=null),F=0;F<N;++F)Ys[U.Z](ye,he,Le,H,K,ue,m),ye=K,he=ue,ue+=m,H+=m;else for(F=0;F<N;++F)r(K,ue,Le,H,m),ye=K,he=ue,ue+=m,H+=m;h.rc=ye,h.Vc=he}else{if(t(U.mc!=null),m=A+N,t((F=U.mc)!=null),t(m<=F.i),F.C>=m)m=1;else if(U.ic||ge(),U.ic){U=F.V,ye=F.Ba,he=F.c;var xe=F.i,ce=(Le=1,H=F.$/he,K=F.$%he,ue=F.m,ve=F.s,F.$),de=he*xe,Ne=he*m,Oe=ve.wc,Ce=ce<Ne?Ue(ve,K,H):null;t(ce<=de),t(m<=xe),t(tt(ve));t:for(;;){for(;!ue.h&&ce<Ne;){if(K&Oe||(Ce=Ue(ve,K,H)),t(Ce!=null),B(ue),256>(xe=ke(Ce.G[0],Ce.H[0],ue)))U[ye+ce]=xe,++ce,++K>=he&&(K=0,++H<=m&&!(H%16)&&Je(F,H));else{if(!(280>xe)){Le=0;break t}xe=be(xe-256,ue);var We,Be=ke(Ce.G[4],Ce.H[4],ue);if(B(ue),!(ce>=(Be=De(he,Be=be(Be,ue)))&&de-ce>=xe)){Le=0;break t}for(We=0;We<xe;++We)U[ye+ce+We]=U[ye+ce+We-Be];for(ce+=xe,K+=xe;K>=he;)K-=he,++H<=m&&!(H%16)&&Je(F,H);ce<Ne&&K&Oe&&(Ce=Ue(ve,K,H))}t(ue.h==W(ue))}Je(F,H>m?m:H);break t}!Le||ue.h&&ce<de?(Le=0,F.a=ue.h?5:3):F.$=ce,m=Le}else m=at(F,F.V,F.Ba,F.c,F.i,m,qt);if(!m){N=0;break e}}A+N>=I&&(h.Cc=1),N=1}if(!N)return null;if(h.Cc&&((N=h.ga)!=null&&(N.mc=null),h.ga=null,0<h.Ga))return alert("todo:WebPDequantizeLevels"),null}return h.nb+A*M}function w(h,m,A,N,M,I){for(;0<M--;){var F,U=h,H=m+(A?1:0),K=h,ue=m+(A?0:3);for(F=0;F<N;++F){var ve=K[ue+4*F];ve!=255&&(ve*=32897,U[H+4*F+0]=U[H+4*F+0]*ve>>23,U[H+4*F+1]=U[H+4*F+1]*ve>>23,U[H+4*F+2]=U[H+4*F+2]*ve>>23)}m+=I}}function k(h,m,A,N,M){for(;0<N--;){var I;for(I=0;I<A;++I){var F=h[m+2*I+0],U=15&(K=h[m+2*I+1]),H=4369*U,K=(240&K|K>>4)*H>>16;h[m+2*I+0]=(240&F|F>>4)*H>>16&240|(15&F|F<<4)*H>>16>>4&15,h[m+2*I+1]=240&K|U}m+=M}}function Z(h,m,A,N,M,I,F,U){var H,K,ue=255;for(K=0;K<M;++K){for(H=0;H<N;++H){var ve=h[m+H];I[F+4*H]=ve,ue&=ve}m+=A,F+=U}return ue!=255}function oe(h,m,A,N,M){var I;for(I=0;I<M;++I)A[N+I]=h[m+I]>>8}function ge(){za=w,yn=k,bn=Z,zn=oe}function _e(h,m,A){j[h]=function(N,M,I,F,U,H,K,ue,ve,ye,he,Le,xe,ce,de,Ne,Oe){var Ce,We=Oe-1>>1,Be=U[H+0]|K[ue+0]<<16,it=ve[ye+0]|he[Le+0]<<16;t(N!=null);var ze=3*Be+it+131074>>2;for(m(N[M+0],255&ze,ze>>16,xe,ce),I!=null&&(ze=3*it+Be+131074>>2,m(I[F+0],255&ze,ze>>16,de,Ne)),Ce=1;Ce<=We;++Ce){var Wt=U[H+Ce]|K[ue+Ce]<<16,tn=ve[ye+Ce]|he[Le+Ce]<<16,zt=Be+Wt+it+tn+524296,Rt=zt+2*(Wt+it)>>3;ze=Rt+Be>>1,Be=(zt=zt+2*(Be+tn)>>3)+Wt>>1,m(N[M+2*Ce-1],255&ze,ze>>16,xe,ce+(2*Ce-1)*A),m(N[M+2*Ce-0],255&Be,Be>>16,xe,ce+(2*Ce-0)*A),I!=null&&(ze=zt+it>>1,Be=Rt+tn>>1,m(I[F+2*Ce-1],255&ze,ze>>16,de,Ne+(2*Ce-1)*A),m(I[F+2*Ce+0],255&Be,Be>>16,de,Ne+(2*Ce+0)*A)),Be=Wt,it=tn}1&Oe||(ze=3*Be+it+131074>>2,m(N[M+Oe-1],255&ze,ze>>16,xe,ce+(Oe-1)*A),I!=null&&(ze=3*it+Be+131074>>2,m(I[F+Oe-1],255&ze,ze>>16,de,Ne+(Oe-1)*A)))}}function Re(){Ha[gh]=T8,Ha[vh]=ob,Ha[nb]=O8,Ha[yh]=lb,Ha[bh]=ub,Ha[E0]=cb,Ha[rb]=D8,Ha[C0]=ob,Ha[L0]=lb,Ha[wh]=ub,Ha[j0]=cb}function Ye(h){return h&-16384?0>h?0:255:h>>R8}function nt(h,m){return Ye((19077*h>>8)+(26149*m>>8)-14234)}function xt(h,m,A){return Ye((19077*h>>8)-(6419*m>>8)-(13320*A>>8)+8708)}function yt(h,m){return Ye((19077*h>>8)+(33050*m>>8)-17685)}function $t(h,m,A,N,M){N[M+0]=nt(h,A),N[M+1]=xt(h,m,A),N[M+2]=yt(h,m)}function On(h,m,A,N,M){N[M+0]=yt(h,m),N[M+1]=xt(h,m,A),N[M+2]=nt(h,A)}function Rn(h,m,A,N,M){var I=xt(h,m,A);m=I<<3&224|yt(h,m)>>3,N[M+0]=248&nt(h,A)|I>>5,N[M+1]=m}function Jn(h,m,A,N,M){var I=240&yt(h,m)|15;N[M+0]=240&nt(h,A)|xt(h,m,A)>>4,N[M+1]=I}function jr(h,m,A,N,M){N[M+0]=255,$t(h,m,A,N,M+1)}function ur(h,m,A,N,M){On(h,m,A,N,M),N[M+3]=255}function ci(h,m,A,N,M){$t(h,m,A,N,M),N[M+3]=255}function ga(h,m){return 0>h?0:h>m?m:h}function Ci(h,m,A){j[h]=function(N,M,I,F,U,H,K,ue,ve){for(var ye=ue+(-2&ve)*A;ue!=ye;)m(N[M+0],I[F+0],U[H+0],K,ue),m(N[M+1],I[F+0],U[H+0],K,ue+A),M+=2,++F,++H,ue+=2*A;1&ve&&m(N[M+0],I[F+0],U[H+0],K,ue)}}function uh(h,m,A){return A==0?h==0?m==0?6:5:m==0?4:0:A}function Uc(h,m,A,N,M){switch(h>>>30){case 3:Qi(m,A,N,M,0);break;case 2:Un(m,A,N,M);break;case 1:Br(m,A,N,M)}}function zc(h,m){var A,N,M=m.M,I=m.Nb,F=h.oc,U=h.pc+40,H=h.oc,K=h.pc+584,ue=h.oc,ve=h.pc+600;for(A=0;16>A;++A)F[U+32*A-1]=129;for(A=0;8>A;++A)H[K+32*A-1]=129,ue[ve+32*A-1]=129;for(0<M?F[U-1-32]=H[K-1-32]=ue[ve-1-32]=129:(a(F,U-32-1,127,21),a(H,K-32-1,127,9),a(ue,ve-32-1,127,9)),N=0;N<h.za;++N){var ye=m.ya[m.aa+N];if(0<N){for(A=-1;16>A;++A)r(F,U+32*A-4,F,U+32*A+12,4);for(A=-1;8>A;++A)r(H,K+32*A-4,H,K+32*A+4,4),r(ue,ve+32*A-4,ue,ve+32*A+4,4)}var he=h.Gd,Le=h.Hd+N,xe=ye.ad,ce=ye.Hc;if(0<M&&(r(F,U-32,he[Le].y,0,16),r(H,K-32,he[Le].f,0,8),r(ue,ve-32,he[Le].ea,0,8)),ye.Za){var de=F,Ne=U-32+16;for(0<M&&(N>=h.za-1?a(de,Ne,he[Le].y[15],4):r(de,Ne,he[Le+1].y,0,4)),A=0;4>A;A++)de[Ne+128+A]=de[Ne+256+A]=de[Ne+384+A]=de[Ne+0+A];for(A=0;16>A;++A,ce<<=2)de=F,Ne=U+db[A],fi[ye.Ob[A]](de,Ne),Uc(ce,xe,16*+A,de,Ne)}else if(de=uh(N,M,ye.Ob[0]),Vs[de](F,U),ce!=0)for(A=0;16>A;++A,ce<<=2)Uc(ce,xe,16*+A,F,U+db[A]);for(A=ye.Gc,de=uh(N,M,ye.Dd),es[de](H,K),es[de](ue,ve),ce=xe,de=H,Ne=K,255&(ye=A>>0)&&(170&ye?Gc(ce,256,de,Ne):$a(ce,256,de,Ne)),ye=ue,ce=ve,255&(A>>=8)&&(170&A?Gc(xe,320,ye,ce):$a(xe,320,ye,ce)),M<h.Ub-1&&(r(he[Le].y,0,F,U+480,16),r(he[Le].f,0,H,K+224,8),r(he[Le].ea,0,ue,ve+224,8)),A=8*I*h.B,he=h.sa,Le=h.ta+16*N+16*I*h.R,xe=h.qa,ye=h.ra+8*N+A,ce=h.Ha,de=h.Ia+8*N+A,A=0;16>A;++A)r(he,Le+A*h.R,F,U+32*A,16);for(A=0;8>A;++A)r(xe,ye+A*h.B,H,K+32*A,8),r(ce,de+A*h.B,ue,ve+32*A,8)}}function zl(h,m,A,N,M,I,F,U,H){var K=[0],ue=[0],ve=0,ye=H!=null?H.kd:0,he=H??new Ic;if(h==null||12>A)return 7;he.data=h,he.w=m,he.ha=A,m=[m],A=[A],he.gb=[he.gb];e:{var Le=m,xe=A,ce=he.gb;if(t(h!=null),t(xe!=null),t(ce!=null),ce[0]=0,12<=xe[0]&&!n(h,Le[0],"RIFF")){if(n(h,Le[0]+8,"WEBP")){ce=3;break e}var de=Ae(h,Le[0]+4);if(12>de||4294967286<de){ce=3;break e}if(ye&&de>xe[0]-8){ce=7;break e}ce[0]=de,Le[0]+=12,xe[0]-=12}ce=0}if(ce!=0)return ce;for(de=0<he.gb[0],A=A[0];;){e:{var Ne=h;xe=m,ce=A;var Oe=K,Ce=ue,We=Le=[0];if((ze=ve=[ve])[0]=0,8>ce[0])ce=7;else{if(!n(Ne,xe[0],"VP8X")){if(Ae(Ne,xe[0]+4)!=10){ce=3;break e}if(18>ce[0]){ce=7;break e}var Be=Ae(Ne,xe[0]+8),it=1+je(Ne,xe[0]+12);if(2147483648<=it*(Ne=1+je(Ne,xe[0]+15))){ce=3;break e}We!=null&&(We[0]=Be),Oe!=null&&(Oe[0]=it),Ce!=null&&(Ce[0]=Ne),xe[0]+=18,ce[0]-=18,ze[0]=1}ce=0}}if(ve=ve[0],Le=Le[0],ce!=0)return ce;if(xe=!!(2&Le),!de&&ve)return 3;if(I!=null&&(I[0]=!!(16&Le)),F!=null&&(F[0]=xe),U!=null&&(U[0]=0),F=K[0],Le=ue[0],ve&&xe&&H==null){ce=0;break}if(4>A){ce=7;break}if(de&&ve||!de&&!ve&&!n(h,m[0],"ALPH")){A=[A],he.na=[he.na],he.P=[he.P],he.Sa=[he.Sa];e:{Be=h,ce=m,de=A;var ze=he.gb;Oe=he.na,Ce=he.P,We=he.Sa,it=22,t(Be!=null),t(de!=null),Ne=ce[0];var Wt=de[0];for(t(Oe!=null),t(We!=null),Oe[0]=null,Ce[0]=null,We[0]=0;;){if(ce[0]=Ne,de[0]=Wt,8>Wt){ce=7;break e}var tn=Ae(Be,Ne+4);if(4294967286<tn){ce=3;break e}var zt=8+tn+1&-2;if(it+=zt,0<ze&&it>ze){ce=3;break e}if(!n(Be,Ne,"VP8 ")||!n(Be,Ne,"VP8L")){ce=0;break e}if(Wt[0]<zt){ce=7;break e}n(Be,Ne,"ALPH")||(Oe[0]=Be,Ce[0]=Ne+8,We[0]=tn),Ne+=zt,Wt-=zt}}if(A=A[0],he.na=he.na[0],he.P=he.P[0],he.Sa=he.Sa[0],ce!=0)break}A=[A],he.Ja=[he.Ja],he.xa=[he.xa];e:if(ze=h,ce=m,de=A,Oe=he.gb[0],Ce=he.Ja,We=he.xa,Be=ce[0],Ne=!n(ze,Be,"VP8 "),it=!n(ze,Be,"VP8L"),t(ze!=null),t(de!=null),t(Ce!=null),t(We!=null),8>de[0])ce=7;else{if(Ne||it){if(ze=Ae(ze,Be+4),12<=Oe&&ze>Oe-12){ce=3;break e}if(ye&&ze>de[0]-8){ce=7;break e}Ce[0]=ze,ce[0]+=8,de[0]-=8,We[0]=it}else We[0]=5<=de[0]&&ze[Be+0]==47&&!(ze[Be+4]>>5),Ce[0]=de[0];ce=0}if(A=A[0],he.Ja=he.Ja[0],he.xa=he.xa[0],m=m[0],ce!=0)break;if(4294967286<he.Ja)return 3;if(U==null||xe||(U[0]=he.xa?2:1),F=[F],Le=[Le],he.xa){if(5>A){ce=7;break}U=F,ye=Le,xe=I,h==null||5>A?h=0:5<=A&&h[m+0]==47&&!(h[m+4]>>5)?(de=[0],ze=[0],Oe=[0],Q(Ce=new L,h,m,A),ae(Ce,de,ze,Oe)?(U!=null&&(U[0]=de[0]),ye!=null&&(ye[0]=ze[0]),xe!=null&&(xe[0]=Oe[0]),h=1):h=0):h=0}else{if(10>A){ce=7;break}U=Le,h==null||10>A||!Rl(h,m+3,A-3)?h=0:(ye=h[m+0]|h[m+1]<<8|h[m+2]<<16,xe=16383&(h[m+7]<<8|h[m+6]),h=16383&(h[m+9]<<8|h[m+8]),1&ye||3<(ye>>1&7)||!(ye>>4&1)||ye>>5>=he.Ja||!xe||!h?h=0:(F&&(F[0]=xe),U&&(U[0]=h),h=1))}if(!h||(F=F[0],Le=Le[0],ve&&(K[0]!=F||ue[0]!=Le)))return 3;H!=null&&(H[0]=he,H.offset=m-H.w,t(4294967286>m-H.w),t(H.offset==H.ha-A));break}return ce==0||ce==7&&ve&&H==null?(I!=null&&(I[0]|=he.na!=null&&0<he.na.length),N!=null&&(N[0]=F),M!=null&&(M[0]=Le),0):ce}function qc(h,m,A){var N=m.width,M=m.height,I=0,F=0,U=N,H=M;if(m.Da=h!=null&&0<h.Da,m.Da&&(U=h.cd,H=h.bd,I=h.v,F=h.j,11>A||(I&=-2,F&=-2),0>I||0>F||0>=U||0>=H||I+U>N||F+H>M))return 0;if(m.v=I,m.j=F,m.va=I+U,m.o=F+H,m.U=U,m.T=H,m.da=h!=null&&0<h.da,m.da){if(!Ge(U,H,A=[h.ib],I=[h.hb]))return 0;m.ib=A[0],m.hb=I[0]}return m.ob=h!=null&&h.ob,m.Kb=h==null||!h.Sd,m.da&&(m.ob=m.ib<3*N/4&&m.hb<3*M/4,m.Kb=0),1}function Hc(h){if(h==null)return 2;if(11>h.S){var m=h.f.RGBA;m.fb+=(h.height-1)*m.A,m.A=-m.A}else m=h.f.kb,h=h.height,m.O+=(h-1)*m.fa,m.fa=-m.fa,m.N+=(h-1>>1)*m.Ab,m.Ab=-m.Ab,m.W+=(h-1>>1)*m.Db,m.Db=-m.Db,m.F!=null&&(m.J+=(h-1)*m.lb,m.lb=-m.lb);return 0}function ql(h,m,A,N){if(N==null||0>=h||0>=m)return 2;if(A!=null){if(A.Da){var M=A.cd,I=A.bd,F=-2&A.v,U=-2&A.j;if(0>F||0>U||0>=M||0>=I||F+M>h||U+I>m)return 2;h=M,m=I}if(A.da){if(!Ge(h,m,M=[A.ib],I=[A.hb]))return 2;h=M[0],m=I[0]}}N.width=h,N.height=m;e:{var H=N.width,K=N.height;if(h=N.S,0>=H||0>=K||!(h>=gh&&13>h))h=2;else{if(0>=N.Rd&&N.sd==null){F=I=M=m=0;var ue=(U=H*hb[h])*K;if(11>h||(I=(K+1)/2*(m=(H+1)/2),h==12&&(F=(M=H)*K)),(K=i(ue+2*I+F))==null){h=1;break e}N.sd=K,11>h?((H=N.f.RGBA).eb=K,H.fb=0,H.A=U,H.size=ue):((H=N.f.kb).y=K,H.O=0,H.fa=U,H.Fd=ue,H.f=K,H.N=0+ue,H.Ab=m,H.Cd=I,H.ea=K,H.W=0+ue+I,H.Db=m,H.Ed=I,h==12&&(H.F=K,H.J=0+ue+2*I),H.Tc=F,H.lb=M)}if(m=1,M=N.S,I=N.width,F=N.height,M>=gh&&13>M)if(11>M)h=N.f.RGBA,m&=(U=Math.abs(h.A))*(F-1)+I<=h.size,m&=U>=I*hb[M],m&=h.eb!=null;else{h=N.f.kb,U=(I+1)/2,ue=(F+1)/2,H=Math.abs(h.fa),K=Math.abs(h.Ab);var ve=Math.abs(h.Db),ye=Math.abs(h.lb),he=ye*(F-1)+I;m&=H*(F-1)+I<=h.Fd,m&=K*(ue-1)+U<=h.Cd,m=(m&=ve*(ue-1)+U<=h.Ed)&H>=I&K>=U&ve>=U,m&=h.y!=null,m&=h.f!=null,m&=h.ea!=null,M==12&&(m&=ye>=I,m&=he<=h.Tc,m&=h.F!=null)}else m=0;h=m?0:2}}return h!=0||A!=null&&A.fd&&(h=Hc(N)),h}var yr=64,Hl=[0,1,3,7,15,31,63,127,255,511,1023,2047,4095,8191,16383,32767,65535,131071,262143,524287,1048575,2097151,4194303,8388607,16777215],Vl=24,Yl=32,Vc=8,Kr=[0,0,1,1,2,2,2,2,3,3,3,3,3,3,3,3,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7];Ie("Predictor0","PredictorAdd0"),j.Predictor0=function(){return 4278190080},j.Predictor1=function(h){return h},j.Predictor2=function(h,m,A){return m[A+0]},j.Predictor3=function(h,m,A){return m[A+1]},j.Predictor4=function(h,m,A){return m[A-1]},j.Predictor5=function(h,m,A){return Fe(Fe(h,m[A+1]),m[A+0])},j.Predictor6=function(h,m,A){return Fe(h,m[A-1])},j.Predictor7=function(h,m,A){return Fe(h,m[A+0])},j.Predictor8=function(h,m,A){return Fe(m[A-1],m[A+0])},j.Predictor9=function(h,m,A){return Fe(m[A+0],m[A+1])},j.Predictor10=function(h,m,A){return Fe(Fe(h,m[A-1]),Fe(m[A+0],m[A+1]))},j.Predictor11=function(h,m,A){var N=m[A+0];return 0>=gt(N>>24&255,h>>24&255,(m=m[A-1])>>24&255)+gt(N>>16&255,h>>16&255,m>>16&255)+gt(N>>8&255,h>>8&255,m>>8&255)+gt(255&N,255&h,255&m)?N:h},j.Predictor12=function(h,m,A){var N=m[A+0];return(Qe((h>>24&255)+(N>>24&255)-((m=m[A-1])>>24&255))<<24|Qe((h>>16&255)+(N>>16&255)-(m>>16&255))<<16|Qe((h>>8&255)+(N>>8&255)-(m>>8&255))<<8|Qe((255&h)+(255&N)-(255&m)))>>>0},j.Predictor13=function(h,m,A){var N=m[A-1];return(ht((h=Fe(h,m[A+0]))>>24&255,N>>24&255)<<24|ht(h>>16&255,N>>16&255)<<16|ht(h>>8&255,N>>8&255)<<8|ht(h>>0&255,N>>0&255))>>>0};var A0=j.PredictorAdd0;j.PredictorAdd1=ft,Ie("Predictor2","PredictorAdd2"),Ie("Predictor3","PredictorAdd3"),Ie("Predictor4","PredictorAdd4"),Ie("Predictor5","PredictorAdd5"),Ie("Predictor6","PredictorAdd6"),Ie("Predictor7","PredictorAdd7"),Ie("Predictor8","PredictorAdd8"),Ie("Predictor9","PredictorAdd9"),Ie("Predictor10","PredictorAdd10"),Ie("Predictor11","PredictorAdd11"),Ie("Predictor12","PredictorAdd12"),Ie("Predictor13","PredictorAdd13");var Yc=j.PredictorAdd2;Et("ColorIndexInverseTransform","MapARGB","32b",function(h){return h>>8&255},function(h){return h}),Et("VP8LColorIndexInverseTransformAlpha","MapAlpha","8b",function(h){return h},function(h){return h>>8&255});var ch,Ba=j.ColorIndexInverseTransform,Gl=j.MapARGB,fh=j.VP8LColorIndexInverseTransformAlpha,dh=j.MapAlpha,Us=j.VP8LPredictorsAdd=[];Us.length=16,(j.VP8LPredictors=[]).length=16,(j.VP8LPredictorsAdd_C=[]).length=16,(j.VP8LPredictors_C=[]).length=16;var Yo,Xr,Fr,zs,Ki,Xi,Wl,Qi,Un,Gc,Br,$a,Jl,hh,Wc,Go,Wo,qs,Jo,Kl,Ko,Hs,Jc,Ua,za,yn,bn,zn,ar=i(511),Zi=i(2041),Kc=i(225),Xl=i(767),ph=0,N0=Zi,mh=Kc,va=Xl,qa=ar,gh=0,vh=1,nb=2,yh=3,bh=4,E0=5,rb=6,C0=7,L0=8,wh=9,j0=10,g8=[2,3,7],v8=[3,3,11],ab=[280,256,256,256,40],y8=[0,1,1,1,0],b8=[17,18,0,1,2,3,4,5,16,6,7,8,9,10,11,12,13,14,15],w8=[24,7,23,25,40,6,39,41,22,26,38,42,56,5,55,57,21,27,54,58,37,43,72,4,71,73,20,28,53,59,70,74,36,44,88,69,75,52,60,3,87,89,19,29,86,90,35,45,68,76,85,91,51,61,104,2,103,105,18,30,102,106,34,46,84,92,67,77,101,107,50,62,120,1,119,121,83,93,17,31,100,108,66,78,118,122,33,47,117,123,49,63,99,109,82,94,0,116,124,65,79,16,32,98,110,48,115,125,81,95,64,114,126,97,111,80,113,127,96,112],x8=[2954,2956,2958,2962,2970,2986,3018,3082,3212,3468,3980,5004],S8=8,T0=[4,5,6,7,8,9,10,10,11,12,13,14,15,16,17,17,18,19,20,20,21,21,22,22,23,23,24,25,25,26,27,28,29,30,31,32,33,34,35,36,37,37,38,39,40,41,42,43,44,45,46,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,76,77,78,79,80,81,82,83,84,85,86,87,88,89,91,93,95,96,98,100,101,102,104,106,108,110,112,114,116,118,122,124,126,128,130,132,134,136,138,140,143,145,148,151,154,157],O0=[4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,60,62,64,66,68,70,72,74,76,78,80,82,84,86,88,90,92,94,96,98,100,102,104,106,108,110,112,114,116,119,122,125,128,131,134,137,140,143,146,149,152,155,158,161,164,167,170,173,177,181,185,189,193,197,201,205,209,213,217,221,225,229,234,239,245,249,254,259,264,269,274,279,284],Xc=null,_8=[[173,148,140,0],[176,155,140,135,0],[180,157,141,134,130,0],[254,254,243,230,196,177,153,140,133,130,129,0]],A8=[0,1,4,8,5,2,3,6,9,12,13,10,7,11,14,15],ib=[-0,1,-1,2,-2,3,4,6,-3,5,-4,-5,-6,7,-7,8,-8,-9],N8=[[[[128,128,128,128,128,128,128,128,128,128,128],[128,128,128,128,128,128,128,128,128,128,128],[128,128,128,128,128,128,128,128,128,128,128]],[[253,136,254,255,228,219,128,128,128,128,128],[189,129,242,255,227,213,255,219,128,128,128],[106,126,227,252,214,209,255,255,128,128,128]],[[1,98,248,255,236,226,255,255,128,128,128],[181,133,238,254,221,234,255,154,128,128,128],[78,134,202,247,198,180,255,219,128,128,128]],[[1,185,249,255,243,255,128,128,128,128,128],[184,150,247,255,236,224,128,128,128,128,128],[77,110,216,255,236,230,128,128,128,128,128]],[[1,101,251,255,241,255,128,128,128,128,128],[170,139,241,252,236,209,255,255,128,128,128],[37,116,196,243,228,255,255,255,128,128,128]],[[1,204,254,255,245,255,128,128,128,128,128],[207,160,250,255,238,128,128,128,128,128,128],[102,103,231,255,211,171,128,128,128,128,128]],[[1,152,252,255,240,255,128,128,128,128,128],[177,135,243,255,234,225,128,128,128,128,128],[80,129,211,255,194,224,128,128,128,128,128]],[[1,1,255,128,128,128,128,128,128,128,128],[246,1,255,128,128,128,128,128,128,128,128],[255,128,128,128,128,128,128,128,128,128,128]]],[[[198,35,237,223,193,187,162,160,145,155,62],[131,45,198,221,172,176,220,157,252,221,1],[68,47,146,208,149,167,221,162,255,223,128]],[[1,149,241,255,221,224,255,255,128,128,128],[184,141,234,253,222,220,255,199,128,128,128],[81,99,181,242,176,190,249,202,255,255,128]],[[1,129,232,253,214,197,242,196,255,255,128],[99,121,210,250,201,198,255,202,128,128,128],[23,91,163,242,170,187,247,210,255,255,128]],[[1,200,246,255,234,255,128,128,128,128,128],[109,178,241,255,231,245,255,255,128,128,128],[44,130,201,253,205,192,255,255,128,128,128]],[[1,132,239,251,219,209,255,165,128,128,128],[94,136,225,251,218,190,255,255,128,128,128],[22,100,174,245,186,161,255,199,128,128,128]],[[1,182,249,255,232,235,128,128,128,128,128],[124,143,241,255,227,234,128,128,128,128,128],[35,77,181,251,193,211,255,205,128,128,128]],[[1,157,247,255,236,231,255,255,128,128,128],[121,141,235,255,225,227,255,255,128,128,128],[45,99,188,251,195,217,255,224,128,128,128]],[[1,1,251,255,213,255,128,128,128,128,128],[203,1,248,255,255,128,128,128,128,128,128],[137,1,177,255,224,255,128,128,128,128,128]]],[[[253,9,248,251,207,208,255,192,128,128,128],[175,13,224,243,193,185,249,198,255,255,128],[73,17,171,221,161,179,236,167,255,234,128]],[[1,95,247,253,212,183,255,255,128,128,128],[239,90,244,250,211,209,255,255,128,128,128],[155,77,195,248,188,195,255,255,128,128,128]],[[1,24,239,251,218,219,255,205,128,128,128],[201,51,219,255,196,186,128,128,128,128,128],[69,46,190,239,201,218,255,228,128,128,128]],[[1,191,251,255,255,128,128,128,128,128,128],[223,165,249,255,213,255,128,128,128,128,128],[141,124,248,255,255,128,128,128,128,128,128]],[[1,16,248,255,255,128,128,128,128,128,128],[190,36,230,255,236,255,128,128,128,128,128],[149,1,255,128,128,128,128,128,128,128,128]],[[1,226,255,128,128,128,128,128,128,128,128],[247,192,255,128,128,128,128,128,128,128,128],[240,128,255,128,128,128,128,128,128,128,128]],[[1,134,252,255,255,128,128,128,128,128,128],[213,62,250,255,255,128,128,128,128,128,128],[55,93,255,128,128,128,128,128,128,128,128]],[[128,128,128,128,128,128,128,128,128,128,128],[128,128,128,128,128,128,128,128,128,128,128],[128,128,128,128,128,128,128,128,128,128,128]]],[[[202,24,213,235,186,191,220,160,240,175,255],[126,38,182,232,169,184,228,174,255,187,128],[61,46,138,219,151,178,240,170,255,216,128]],[[1,112,230,250,199,191,247,159,255,255,128],[166,109,228,252,211,215,255,174,128,128,128],[39,77,162,232,172,180,245,178,255,255,128]],[[1,52,220,246,198,199,249,220,255,255,128],[124,74,191,243,183,193,250,221,255,255,128],[24,71,130,219,154,170,243,182,255,255,128]],[[1,182,225,249,219,240,255,224,128,128,128],[149,150,226,252,216,205,255,171,128,128,128],[28,108,170,242,183,194,254,223,255,255,128]],[[1,81,230,252,204,203,255,192,128,128,128],[123,102,209,247,188,196,255,233,128,128,128],[20,95,153,243,164,173,255,203,128,128,128]],[[1,222,248,255,216,213,128,128,128,128,128],[168,175,246,252,235,205,255,255,128,128,128],[47,116,215,255,211,212,255,255,128,128,128]],[[1,121,236,253,212,214,255,255,128,128,128],[141,84,213,252,201,202,255,219,128,128,128],[42,80,160,240,162,185,255,205,128,128,128]],[[1,1,255,128,128,128,128,128,128,128,128],[244,1,255,128,128,128,128,128,128,128,128],[238,1,255,128,128,128,128,128,128,128,128]]]],E8=[[[231,120,48,89,115,113,120,152,112],[152,179,64,126,170,118,46,70,95],[175,69,143,80,85,82,72,155,103],[56,58,10,171,218,189,17,13,152],[114,26,17,163,44,195,21,10,173],[121,24,80,195,26,62,44,64,85],[144,71,10,38,171,213,144,34,26],[170,46,55,19,136,160,33,206,71],[63,20,8,114,114,208,12,9,226],[81,40,11,96,182,84,29,16,36]],[[134,183,89,137,98,101,106,165,148],[72,187,100,130,157,111,32,75,80],[66,102,167,99,74,62,40,234,128],[41,53,9,178,241,141,26,8,107],[74,43,26,146,73,166,49,23,157],[65,38,105,160,51,52,31,115,128],[104,79,12,27,217,255,87,17,7],[87,68,71,44,114,51,15,186,23],[47,41,14,110,182,183,21,17,194],[66,45,25,102,197,189,23,18,22]],[[88,88,147,150,42,46,45,196,205],[43,97,183,117,85,38,35,179,61],[39,53,200,87,26,21,43,232,171],[56,34,51,104,114,102,29,93,77],[39,28,85,171,58,165,90,98,64],[34,22,116,206,23,34,43,166,73],[107,54,32,26,51,1,81,43,31],[68,25,106,22,64,171,36,225,114],[34,19,21,102,132,188,16,76,124],[62,18,78,95,85,57,50,48,51]],[[193,101,35,159,215,111,89,46,111],[60,148,31,172,219,228,21,18,111],[112,113,77,85,179,255,38,120,114],[40,42,1,196,245,209,10,25,109],[88,43,29,140,166,213,37,43,154],[61,63,30,155,67,45,68,1,209],[100,80,8,43,154,1,51,26,71],[142,78,78,16,255,128,34,197,171],[41,40,5,102,211,183,4,1,221],[51,50,17,168,209,192,23,25,82]],[[138,31,36,171,27,166,38,44,229],[67,87,58,169,82,115,26,59,179],[63,59,90,180,59,166,93,73,154],[40,40,21,116,143,209,34,39,175],[47,15,16,183,34,223,49,45,183],[46,17,33,183,6,98,15,32,183],[57,46,22,24,128,1,54,17,37],[65,32,73,115,28,128,23,128,205],[40,3,9,115,51,192,18,6,223],[87,37,9,115,59,77,64,21,47]],[[104,55,44,218,9,54,53,130,226],[64,90,70,205,40,41,23,26,57],[54,57,112,184,5,41,38,166,213],[30,34,26,133,152,116,10,32,134],[39,19,53,221,26,114,32,73,255],[31,9,65,234,2,15,1,118,73],[75,32,12,51,192,255,160,43,51],[88,31,35,67,102,85,55,186,85],[56,21,23,111,59,205,45,37,192],[55,38,70,124,73,102,1,34,98]],[[125,98,42,88,104,85,117,175,82],[95,84,53,89,128,100,113,101,45],[75,79,123,47,51,128,81,171,1],[57,17,5,71,102,57,53,41,49],[38,33,13,121,57,73,26,1,85],[41,10,67,138,77,110,90,47,114],[115,21,2,10,102,255,166,23,6],[101,29,16,10,85,128,101,196,26],[57,18,10,102,102,213,34,20,43],[117,20,15,36,163,128,68,1,26]],[[102,61,71,37,34,53,31,243,192],[69,60,71,38,73,119,28,222,37],[68,45,128,34,1,47,11,245,171],[62,17,19,70,146,85,55,62,70],[37,43,37,154,100,163,85,160,1],[63,9,92,136,28,64,32,201,85],[75,15,9,9,64,255,184,119,16],[86,6,28,5,64,255,25,248,1],[56,8,17,132,137,255,55,116,128],[58,15,20,82,135,57,26,121,40]],[[164,50,31,137,154,133,25,35,218],[51,103,44,131,131,123,31,6,158],[86,40,64,135,148,224,45,183,128],[22,26,17,131,240,154,14,1,209],[45,16,21,91,64,222,7,1,197],[56,21,39,155,60,138,23,102,213],[83,12,13,54,192,255,68,47,28],[85,26,85,85,128,128,32,146,171],[18,11,7,63,144,171,4,4,246],[35,27,10,146,174,171,12,26,128]],[[190,80,35,99,180,80,126,54,45],[85,126,47,87,176,51,41,20,32],[101,75,128,139,118,146,116,128,85],[56,41,15,176,236,85,37,9,62],[71,30,17,119,118,255,17,18,138],[101,38,60,138,55,70,43,26,142],[146,36,19,30,171,255,97,27,20],[138,45,61,62,219,1,81,188,64],[32,41,20,117,151,142,20,21,163],[112,19,12,61,195,128,48,4,24]]],C8=[[[[255,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]],[[176,246,255,255,255,255,255,255,255,255,255],[223,241,252,255,255,255,255,255,255,255,255],[249,253,253,255,255,255,255,255,255,255,255]],[[255,244,252,255,255,255,255,255,255,255,255],[234,254,254,255,255,255,255,255,255,255,255],[253,255,255,255,255,255,255,255,255,255,255]],[[255,246,254,255,255,255,255,255,255,255,255],[239,253,254,255,255,255,255,255,255,255,255],[254,255,254,255,255,255,255,255,255,255,255]],[[255,248,254,255,255,255,255,255,255,255,255],[251,255,254,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]],[[255,253,254,255,255,255,255,255,255,255,255],[251,254,254,255,255,255,255,255,255,255,255],[254,255,254,255,255,255,255,255,255,255,255]],[[255,254,253,255,254,255,255,255,255,255,255],[250,255,254,255,254,255,255,255,255,255,255],[254,255,255,255,255,255,255,255,255,255,255]],[[255,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]]],[[[217,255,255,255,255,255,255,255,255,255,255],[225,252,241,253,255,255,254,255,255,255,255],[234,250,241,250,253,255,253,254,255,255,255]],[[255,254,255,255,255,255,255,255,255,255,255],[223,254,254,255,255,255,255,255,255,255,255],[238,253,254,254,255,255,255,255,255,255,255]],[[255,248,254,255,255,255,255,255,255,255,255],[249,254,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]],[[255,253,255,255,255,255,255,255,255,255,255],[247,254,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]],[[255,253,254,255,255,255,255,255,255,255,255],[252,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]],[[255,254,254,255,255,255,255,255,255,255,255],[253,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]],[[255,254,253,255,255,255,255,255,255,255,255],[250,255,255,255,255,255,255,255,255,255,255],[254,255,255,255,255,255,255,255,255,255,255]],[[255,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]]],[[[186,251,250,255,255,255,255,255,255,255,255],[234,251,244,254,255,255,255,255,255,255,255],[251,251,243,253,254,255,254,255,255,255,255]],[[255,253,254,255,255,255,255,255,255,255,255],[236,253,254,255,255,255,255,255,255,255,255],[251,253,253,254,254,255,255,255,255,255,255]],[[255,254,254,255,255,255,255,255,255,255,255],[254,254,254,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]],[[255,254,255,255,255,255,255,255,255,255,255],[254,254,255,255,255,255,255,255,255,255,255],[254,255,255,255,255,255,255,255,255,255,255]],[[255,255,255,255,255,255,255,255,255,255,255],[254,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]],[[255,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]],[[255,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]],[[255,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]]],[[[248,255,255,255,255,255,255,255,255,255,255],[250,254,252,254,255,255,255,255,255,255,255],[248,254,249,253,255,255,255,255,255,255,255]],[[255,253,253,255,255,255,255,255,255,255,255],[246,253,253,255,255,255,255,255,255,255,255],[252,254,251,254,254,255,255,255,255,255,255]],[[255,254,252,255,255,255,255,255,255,255,255],[248,254,253,255,255,255,255,255,255,255,255],[253,255,254,254,255,255,255,255,255,255,255]],[[255,251,254,255,255,255,255,255,255,255,255],[245,251,254,255,255,255,255,255,255,255,255],[253,253,254,255,255,255,255,255,255,255,255]],[[255,251,253,255,255,255,255,255,255,255,255],[252,253,254,255,255,255,255,255,255,255,255],[255,254,255,255,255,255,255,255,255,255,255]],[[255,252,255,255,255,255,255,255,255,255,255],[249,255,254,255,255,255,255,255,255,255,255],[255,255,254,255,255,255,255,255,255,255,255]],[[255,255,253,255,255,255,255,255,255,255,255],[250,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]],[[255,255,255,255,255,255,255,255,255,255,255],[254,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]]]],L8=[0,1,2,3,6,4,5,6,6,6,6,6,6,6,6,7,0],Vs=[],fi=[],es=[],j8=1,sb=2,Ys=[],Ha=[];_e("UpsampleRgbLinePair",$t,3),_e("UpsampleBgrLinePair",On,3),_e("UpsampleRgbaLinePair",ci,4),_e("UpsampleBgraLinePair",ur,4),_e("UpsampleArgbLinePair",jr,4),_e("UpsampleRgba4444LinePair",Jn,2),_e("UpsampleRgb565LinePair",Rn,2);var T8=j.UpsampleRgbLinePair,O8=j.UpsampleBgrLinePair,ob=j.UpsampleRgbaLinePair,lb=j.UpsampleBgraLinePair,ub=j.UpsampleArgbLinePair,cb=j.UpsampleRgba4444LinePair,D8=j.UpsampleRgb565LinePair,xh=16,Sh=1<<xh-1,Qc=-227,D0=482,R8=6,fb=0,M8=i(256),k8=i(256),P8=i(256),I8=i(256),F8=i(D0-Qc),B8=i(D0-Qc);Ci("YuvToRgbRow",$t,3),Ci("YuvToBgrRow",On,3),Ci("YuvToRgbaRow",ci,4),Ci("YuvToBgraRow",ur,4),Ci("YuvToArgbRow",jr,4),Ci("YuvToRgba4444Row",Jn,2),Ci("YuvToRgb565Row",Rn,2);var db=[0,4,8,12,128,132,136,140,256,260,264,268,384,388,392,396],_h=[0,2,8],$8=[8,7,6,4,4,2,2,2,1,1,1,1],U8=1;this.WebPDecodeRGBA=function(h,m,A,N,M){var I=vh,F=new $l,U=new ma;F.ba=U,U.S=I,U.width=[U.width],U.height=[U.height];var H=U.width,K=U.height,ue=new ka;if(ue==null||h==null)var ve=2;else t(ue!=null),ve=zl(h,m,A,ue.width,ue.height,ue.Pd,ue.Qd,ue.format,null);if(ve!=0?H=0:(H!=null&&(H[0]=ue.width[0]),K!=null&&(K[0]=ue.height[0]),H=1),H){U.width=U.width[0],U.height=U.height[0],N!=null&&(N[0]=U.width),M!=null&&(M[0]=U.height);e:{if(N=new vn,(M=new Ic).data=h,M.w=m,M.ha=A,M.kd=1,m=[0],t(M!=null),((h=zl(M.data,M.w,M.ha,null,null,null,m,null,M))==0||h==7)&&m[0]&&(h=4),(m=h)==0){if(t(F!=null),N.data=M.data,N.w=M.w+M.offset,N.ha=M.ha-M.offset,N.put=Ia,N.ac=rr,N.bc=re,N.ma=F,M.xa){if((h=Yt())==null){F=1;break e}if(function(ye,he){var Le=[0],xe=[0],ce=[0];t:for(;;){if(ye==null)return 0;if(he==null)return ye.a=2,0;if(ye.l=he,ye.a=0,Q(ye.m,he.data,he.w,he.ha),!ae(ye.m,Le,xe,ce)){ye.a=3;break t}if(ye.xb=sb,he.width=Le[0],he.height=xe[0],!gn(Le[0],xe[0],1,ye,null))break t;return 1}return t(ye.a!=0),0}(h,N)){if(N=(m=ql(N.width,N.height,F.Oa,F.ba))==0){t:{N=h;n:for(;;){if(N==null){N=0;break t}if(t(N.s.yc!=null),t(N.s.Ya!=null),t(0<N.s.Wb),t((A=N.l)!=null),t((M=A.ma)!=null),N.xb!=0){if(N.ca=M.ba,N.tb=M.tb,t(N.ca!=null),!qc(M.Oa,A,yh)){N.a=2;break n}if(!Gt(N,A.width)||A.da)break n;if((A.da||It(N.ca.S))&&ge(),11>N.ca.S||(alert("todo:WebPInitConvertARGBToYUV"),N.ca.f.kb.F!=null&&ge()),N.Pb&&0<N.s.ua&&N.s.vb.X==null&&!Me(N.s.vb,N.s.Wa.Xa)){N.a=1;break n}N.xb=0}if(!at(N,N.V,N.Ba,N.c,N.i,A.o,Ze))break n;M.Dc=N.Ma,N=1;break t}t(N.a!=0),N=0}N=!N}N&&(m=h.a)}else m=h.a}else{if((h=new Is)==null){F=1;break e}if(h.Fa=M.na,h.P=M.P,h.qc=M.Sa,Wd(h,N)){if((m=ql(N.width,N.height,F.Oa,F.ba))==0){if(h.Aa=0,A=F.Oa,t((M=h)!=null),A!=null){if(0<(H=0>(H=A.Md)?0:100<H?255:255*H/100)){for(K=ue=0;4>K;++K)12>(ve=M.pb[K]).lc&&(ve.ia=H*$8[0>ve.lc?0:ve.lc]>>3),ue|=ve.ia;ue&&(alert("todo:VP8InitRandom"),M.ia=1)}M.Ga=A.Id,100<M.Ga?M.Ga=100:0>M.Ga&&(M.Ga=0)}s0(h,N)||(m=h.a)}}else m=h.a}m==0&&F.Oa!=null&&F.Oa.fd&&(m=Hc(F.ba))}F=m}I=F!=0?null:11>I?U.f.RGBA.eb:U.f.kb.y}else I=null;return I};var hb=[3,4,3,4,4,2,2,4,4,4,2,1,1]};function u(j,$){for(var V="",T=0;T<4;T++)V+=String.fromCharCode(j[$++]);return V}function c(j,$){return(j[$+0]<<0|j[$+1]<<8|j[$+2]<<16)>>>0}function f(j,$){return(j[$+0]<<0|j[$+1]<<8|j[$+2]<<16|j[$+3]<<24)>>>0}new l;var p=[0],d=[0],v=[],S=new l,x=e,g=function(j,$){var V={},T=0,P=!1,q=0,Y=0;if(V.frames=[],!function(z,W,te,B){for(var ee=0;ee<B;ee++)if(z[W+ee]!=te.charCodeAt(ee))return!0;return!1}(j,$,"RIFF",4)){for(f(j,$+=4),$+=8;$<j.length;){var se=u(j,$),G=f(j,$+=4);$+=4;var ne=G+(1&G);switch(se){case"VP8 ":case"VP8L":V.frames[T]===void 0&&(V.frames[T]={}),(J=V.frames[T]).src_off=P?Y:$-8,J.src_size=q+G+8,T++,P&&(P=!1,q=0,Y=0);break;case"VP8X":(J=V.header={}).feature_flags=j[$];var Q=$+4;J.canvas_width=1+c(j,Q),Q+=3,J.canvas_height=1+c(j,Q),Q+=3;break;case"ALPH":P=!0,q=ne+8,Y=$-8;break;case"ANIM":(J=V.header).bgcolor=f(j,$),Q=$+4,J.loop_count=(le=j)[(L=Q)+0]<<0|le[L+1]<<8,Q+=2;break;case"ANMF":var ie,J;(J=V.frames[T]={}).offset_x=2*c(j,$),$+=3,J.offset_y=2*c(j,$),$+=3,J.width=1+c(j,$),$+=3,J.height=1+c(j,$),$+=3,J.duration=c(j,$),$+=3,ie=j[$++],J.dispose=1&ie,J.blend=ie>>1&1}se!="ANMF"&&($+=ne)}var le,L;return V}}(x,0);g.response=x,g.rgbaoutput=!0,g.dataurl=!1;var y=g.header?g.header:null,_=g.frames?g.frames:null;if(y){y.loop_counter=y.loop_count,p=[y.canvas_height],d=[y.canvas_width];for(var E=0;E<_.length&&_[E].blend!=0;E++);}var D=_[0],R=S.WebPDecodeRGBA(x,D.src_off,D.src_size,d,p);D.rgba=R,D.imgwidth=d[0],D.imgheight=p[0];for(var O=0;O<d[0]*p[0]*4;O++)v[O]=R[O];return this.width=d,this.height=p,this.data=v,this}(function(e){var t=function(){return typeof ly=="function"},n=function(p,d,v,S){var x=4,g=s;switch(S){case e.image_compression.FAST:x=1,g=i;break;case e.image_compression.MEDIUM:x=6,g=o;break;case e.image_compression.SLOW:x=9,g=l}p=r(p,d,v,g);var y=ly(p,{level:x});return e.__addimage__.arrayBufferToBinaryString(y)},r=function(p,d,v,S){for(var x,g,y,_=p.length/d,E=new Uint8Array(p.length+_),D=c(),R=0;R<_;R+=1){if(y=R*d,x=p.subarray(y,y+d),S)E.set(S(x,v,g),y+R);else{for(var O,j=D.length,$=[];O<j;O+=1)$[O]=D[O](x,v,g);var V=f($.concat());E.set($[V],y+R)}g=x}return E},a=function(p){var d=Array.apply([],p);return d.unshift(0),d},i=function(p,d){var v,S=[],x=p.length;S[0]=1;for(var g=0;g<x;g+=1)v=p[g-d]||0,S[g+1]=p[g]-v+256&255;return S},s=function(p,d,v){var S,x=[],g=p.length;x[0]=2;for(var y=0;y<g;y+=1)S=v&&v[y]||0,x[y+1]=p[y]-S+256&255;return x},o=function(p,d,v){var S,x,g=[],y=p.length;g[0]=3;for(var _=0;_<y;_+=1)S=p[_-d]||0,x=v&&v[_]||0,g[_+1]=p[_]+256-(S+x>>>1)&255;return g},l=function(p,d,v){var S,x,g,y,_=[],E=p.length;_[0]=4;for(var D=0;D<E;D+=1)S=p[D-d]||0,x=v&&v[D]||0,g=v&&v[D-d]||0,y=u(S,x,g),_[D+1]=p[D]-y+256&255;return _},u=function(p,d,v){if(p===d&&d===v)return p;var S=Math.abs(d-v),x=Math.abs(p-v),g=Math.abs(p+d-v-v);return S<=x&&S<=g?p:x<=g?d:v},c=function(){return[a,i,s,o,l]},f=function(p){var d=p.map(function(v){return v.reduce(function(S,x){return S+Math.abs(x)},0)});return d.indexOf(Math.min.apply(null,d))};e.processPNG=function(p,d,v,S){var x,g,y,_,E,D,R,O,j,$,V,T,P,q,Y,se=this.decode.FLATE_DECODE,G="";if(this.__addimage__.isArrayBuffer(p)&&(p=new Uint8Array(p)),this.__addimage__.isArrayBufferView(p)){if(p=(y=new oH(p)).imgData,g=y.bits,x=y.colorSpace,E=y.colors,[4,6].indexOf(y.colorType)!==-1){if(y.bits===8){j=(O=y.pixelBitlength==32?new Uint32Array(y.decodePixels().buffer):y.pixelBitlength==16?new Uint16Array(y.decodePixels().buffer):new Uint8Array(y.decodePixels().buffer)).length,V=new Uint8Array(j*y.colors),$=new Uint8Array(j);var ne,Q=y.pixelBitlength-y.bits;for(q=0,Y=0;q<j;q++){for(P=O[q],ne=0;ne<Q;)V[Y++]=P>>>ne&255,ne+=y.bits;$[q]=P>>>ne&255}}if(y.bits===16){j=(O=new Uint32Array(y.decodePixels().buffer)).length,V=new Uint8Array(j*(32/y.pixelBitlength)*y.colors),$=new Uint8Array(j*(32/y.pixelBitlength)),T=y.colors>1,q=0,Y=0;for(var ie=0;q<j;)P=O[q++],V[Y++]=P>>>0&255,T&&(V[Y++]=P>>>16&255,P=O[q++],V[Y++]=P>>>0&255),$[ie++]=P>>>16&255;g=8}S!==e.image_compression.NONE&&t()?(p=n(V,y.width*y.colors,y.colors,S),R=n($,y.width,1,S)):(p=V,R=$,se=void 0)}if(y.colorType===3&&(x=this.color_spaces.INDEXED,D=y.palette,y.transparency.indexed)){var J=y.transparency.indexed,le=0;for(q=0,j=J.length;q<j;++q)le+=J[q];if((le/=255)===j-1&&J.indexOf(0)!==-1)_=[J.indexOf(0)];else if(le!==j){for(O=y.decodePixels(),$=new Uint8Array(O.length),q=0,j=O.length;q<j;q++)$[q]=J[O[q]];R=n($,y.width,1)}}var L=function(z){var W;switch(z){case e.image_compression.FAST:W=11;break;case e.image_compression.MEDIUM:W=13;break;case e.image_compression.SLOW:W=14;break;default:W=12}return W}(S);return se===this.decode.FLATE_DECODE&&(G="/Predictor "+L+" "),G+="/Colors "+E+" /BitsPerComponent "+g+" /Columns "+y.width,(this.__addimage__.isArrayBuffer(p)||this.__addimage__.isArrayBufferView(p))&&(p=this.__addimage__.arrayBufferToBinaryString(p)),(R&&this.__addimage__.isArrayBuffer(R)||this.__addimage__.isArrayBufferView(R))&&(R=this.__addimage__.arrayBufferToBinaryString(R)),{alias:v,data:p,index:d,filter:se,decodeParameters:G,transparency:_,palette:D,sMask:R,predictor:L,width:y.width,height:y.height,bitsPerComponent:g,colorSpace:x}}}})(lt.API),function(e){e.processGIF89A=function(t,n,r,a){var i=new lH(t),s=i.width,o=i.height,l=[];i.decodeAndBlitFrameRGBA(0,l);var u={data:l,width:s,height:o},c=new a2(100).encode(u,100);return e.processJPEG.call(this,c,n,r,a)},e.processGIF87A=e.processGIF89A}(lt.API),mi.prototype.parseHeader=function(){if(this.fileSize=this.datav.getUint32(this.pos,!0),this.pos+=4,this.reserved=this.datav.getUint32(this.pos,!0),this.pos+=4,this.offset=this.datav.getUint32(this.pos,!0),this.pos+=4,this.headerSize=this.datav.getUint32(this.pos,!0),this.pos+=4,this.width=this.datav.getUint32(this.pos,!0),this.pos+=4,this.height=this.datav.getInt32(this.pos,!0),this.pos+=4,this.planes=this.datav.getUint16(this.pos,!0),this.pos+=2,this.bitPP=this.datav.getUint16(this.pos,!0),this.pos+=2,this.compress=this.datav.getUint32(this.pos,!0),this.pos+=4,this.rawSize=this.datav.getUint32(this.pos,!0),this.pos+=4,this.hr=this.datav.getUint32(this.pos,!0),this.pos+=4,this.vr=this.datav.getUint32(this.pos,!0),this.pos+=4,this.colors=this.datav.getUint32(this.pos,!0),this.pos+=4,this.importantColors=this.datav.getUint32(this.pos,!0),this.pos+=4,this.bitPP===16&&this.is_with_alpha&&(this.bitPP=15),this.bitPP<15){var e=this.colors===0?1<<this.bitPP:this.colors;this.palette=new Array(e);for(var t=0;t<e;t++){var n=this.datav.getUint8(this.pos++,!0),r=this.datav.getUint8(this.pos++,!0),a=this.datav.getUint8(this.pos++,!0),i=this.datav.getUint8(this.pos++,!0);this.palette[t]={red:a,green:r,blue:n,quad:i}}}this.height<0&&(this.height*=-1,this.bottom_up=!1)},mi.prototype.parseBGR=function(){this.pos=this.offset;try{var e="bit"+this.bitPP,t=this.width*this.height*4;this.data=new Uint8Array(t),this[e]()}catch(n){fn.log("bit decode error:"+n)}},mi.prototype.bit1=function(){var e,t=Math.ceil(this.width/8),n=t%4;for(e=this.height-1;e>=0;e--){for(var r=this.bottom_up?e:this.height-1-e,a=0;a<t;a++)for(var i=this.datav.getUint8(this.pos++,!0),s=r*this.width*4+8*a*4,o=0;o<8&&8*a+o<this.width;o++){var l=this.palette[i>>7-o&1];this.data[s+4*o]=l.blue,this.data[s+4*o+1]=l.green,this.data[s+4*o+2]=l.red,this.data[s+4*o+3]=255}n!==0&&(this.pos+=4-n)}},mi.prototype.bit4=function(){for(var e=Math.ceil(this.width/2),t=e%4,n=this.height-1;n>=0;n--){for(var r=this.bottom_up?n:this.height-1-n,a=0;a<e;a++){var i=this.datav.getUint8(this.pos++,!0),s=r*this.width*4+2*a*4,o=i>>4,l=15&i,u=this.palette[o];if(this.data[s]=u.blue,this.data[s+1]=u.green,this.data[s+2]=u.red,this.data[s+3]=255,2*a+1>=this.width)break;u=this.palette[l],this.data[s+4]=u.blue,this.data[s+4+1]=u.green,this.data[s+4+2]=u.red,this.data[s+4+3]=255}t!==0&&(this.pos+=4-t)}},mi.prototype.bit8=function(){for(var e=this.width%4,t=this.height-1;t>=0;t--){for(var n=this.bottom_up?t:this.height-1-t,r=0;r<this.width;r++){var a=this.datav.getUint8(this.pos++,!0),i=n*this.width*4+4*r;if(a<this.palette.length){var s=this.palette[a];this.data[i]=s.red,this.data[i+1]=s.green,this.data[i+2]=s.blue,this.data[i+3]=255}else this.data[i]=255,this.data[i+1]=255,this.data[i+2]=255,this.data[i+3]=255}e!==0&&(this.pos+=4-e)}},mi.prototype.bit15=function(){for(var e=this.width%3,t=parseInt("11111",2),n=this.height-1;n>=0;n--){for(var r=this.bottom_up?n:this.height-1-n,a=0;a<this.width;a++){var i=this.datav.getUint16(this.pos,!0);this.pos+=2;var s=(i&t)/t*255|0,o=(i>>5&t)/t*255|0,l=(i>>10&t)/t*255|0,u=i>>15?255:0,c=r*this.width*4+4*a;this.data[c]=l,this.data[c+1]=o,this.data[c+2]=s,this.data[c+3]=u}this.pos+=e}},mi.prototype.bit16=function(){for(var e=this.width%3,t=parseInt("11111",2),n=parseInt("111111",2),r=this.height-1;r>=0;r--){for(var a=this.bottom_up?r:this.height-1-r,i=0;i<this.width;i++){var s=this.datav.getUint16(this.pos,!0);this.pos+=2;var o=(s&t)/t*255|0,l=(s>>5&n)/n*255|0,u=(s>>11)/t*255|0,c=a*this.width*4+4*i;this.data[c]=u,this.data[c+1]=l,this.data[c+2]=o,this.data[c+3]=255}this.pos+=e}},mi.prototype.bit24=function(){for(var e=this.height-1;e>=0;e--){for(var t=this.bottom_up?e:this.height-1-e,n=0;n<this.width;n++){var r=this.datav.getUint8(this.pos++,!0),a=this.datav.getUint8(this.pos++,!0),i=this.datav.getUint8(this.pos++,!0),s=t*this.width*4+4*n;this.data[s]=i,this.data[s+1]=a,this.data[s+2]=r,this.data[s+3]=255}this.pos+=this.width%4}},mi.prototype.bit32=function(){for(var e=this.height-1;e>=0;e--)for(var t=this.bottom_up?e:this.height-1-e,n=0;n<this.width;n++){var r=this.datav.getUint8(this.pos++,!0),a=this.datav.getUint8(this.pos++,!0),i=this.datav.getUint8(this.pos++,!0),s=this.datav.getUint8(this.pos++,!0),o=t*this.width*4+4*n;this.data[o]=i,this.data[o+1]=a,this.data[o+2]=r,this.data[o+3]=s}},mi.prototype.getData=function(){return this.data},function(e){e.processBMP=function(t,n,r,a){var i=new mi(t,!1),s=i.width,o=i.height,l={data:i.getData(),width:s,height:o},u=new a2(100).encode(l,100);return e.processJPEG.call(this,u,n,r,a)}}(lt.API),C3.prototype.getData=function(){return this.data},function(e){e.processWEBP=function(t,n,r,a){var i=new C3(t),s=i.width,o=i.height,l={data:i.getData(),width:s,height:o},u=new a2(100).encode(l,100);return e.processJPEG.call(this,u,n,r,a)}}(lt.API),lt.API.processRGBA=function(e,t,n){for(var r=e.data,a=r.length,i=new Uint8Array(a/4*3),s=new Uint8Array(a/4),o=0,l=0,u=0;u<a;u+=4){var c=r[u],f=r[u+1],p=r[u+2],d=r[u+3];i[o++]=c,i[o++]=f,i[o++]=p,s[l++]=d}var v=this.__addimage__.arrayBufferToBinaryString(i);return{alpha:this.__addimage__.arrayBufferToBinaryString(s),data:v,index:t,alias:n,colorSpace:"DeviceRGB",bitsPerComponent:8,width:e.width,height:e.height}},lt.API.setLanguage=function(e){return this.internal.languageSettings===void 0&&(this.internal.languageSettings={},this.internal.languageSettings.isSubscribed=!1),{af:"Afrikaans",sq:"Albanian",ar:"Arabic (Standard)","ar-DZ":"Arabic (Algeria)","ar-BH":"Arabic (Bahrain)","ar-EG":"Arabic (Egypt)","ar-IQ":"Arabic (Iraq)","ar-JO":"Arabic (Jordan)","ar-KW":"Arabic (Kuwait)","ar-LB":"Arabic (Lebanon)","ar-LY":"Arabic (Libya)","ar-MA":"Arabic (Morocco)","ar-OM":"Arabic (Oman)","ar-QA":"Arabic (Qatar)","ar-SA":"Arabic (Saudi Arabia)","ar-SY":"Arabic (Syria)","ar-TN":"Arabic (Tunisia)","ar-AE":"Arabic (U.A.E.)","ar-YE":"Arabic (Yemen)",an:"Aragonese",hy:"Armenian",as:"Assamese",ast:"Asturian",az:"Azerbaijani",eu:"Basque",be:"Belarusian",bn:"Bengali",bs:"Bosnian",br:"Breton",bg:"Bulgarian",my:"Burmese",ca:"Catalan",ch:"Chamorro",ce:"Chechen",zh:"Chinese","zh-HK":"Chinese (Hong Kong)","zh-CN":"Chinese (PRC)","zh-SG":"Chinese (Singapore)","zh-TW":"Chinese (Taiwan)",cv:"Chuvash",co:"Corsican",cr:"Cree",hr:"Croatian",cs:"Czech",da:"Danish",nl:"Dutch (Standard)","nl-BE":"Dutch (Belgian)",en:"English","en-AU":"English (Australia)","en-BZ":"English (Belize)","en-CA":"English (Canada)","en-IE":"English (Ireland)","en-JM":"English (Jamaica)","en-NZ":"English (New Zealand)","en-PH":"English (Philippines)","en-ZA":"English (South Africa)","en-TT":"English (Trinidad & Tobago)","en-GB":"English (United Kingdom)","en-US":"English (United States)","en-ZW":"English (Zimbabwe)",eo:"Esperanto",et:"Estonian",fo:"Faeroese",fj:"Fijian",fi:"Finnish",fr:"French (Standard)","fr-BE":"French (Belgium)","fr-CA":"French (Canada)","fr-FR":"French (France)","fr-LU":"French (Luxembourg)","fr-MC":"French (Monaco)","fr-CH":"French (Switzerland)",fy:"Frisian",fur:"Friulian",gd:"Gaelic (Scots)","gd-IE":"Gaelic (Irish)",gl:"Galacian",ka:"Georgian",de:"German (Standard)","de-AT":"German (Austria)","de-DE":"German (Germany)","de-LI":"German (Liechtenstein)","de-LU":"German (Luxembourg)","de-CH":"German (Switzerland)",el:"Greek",gu:"Gujurati",ht:"Haitian",he:"Hebrew",hi:"Hindi",hu:"Hungarian",is:"Icelandic",id:"Indonesian",iu:"Inuktitut",ga:"Irish",it:"Italian (Standard)","it-CH":"Italian (Switzerland)",ja:"Japanese",kn:"Kannada",ks:"Kashmiri",kk:"Kazakh",km:"Khmer",ky:"Kirghiz",tlh:"Klingon",ko:"Korean","ko-KP":"Korean (North Korea)","ko-KR":"Korean (South Korea)",la:"Latin",lv:"Latvian",lt:"Lithuanian",lb:"Luxembourgish",mk:"North Macedonia",ms:"Malay",ml:"Malayalam",mt:"Maltese",mi:"Maori",mr:"Marathi",mo:"Moldavian",nv:"Navajo",ng:"Ndonga",ne:"Nepali",no:"Norwegian",nb:"Norwegian (Bokmal)",nn:"Norwegian (Nynorsk)",oc:"Occitan",or:"Oriya",om:"Oromo",fa:"Persian","fa-IR":"Persian/Iran",pl:"Polish",pt:"Portuguese","pt-BR":"Portuguese (Brazil)",pa:"Punjabi","pa-IN":"Punjabi (India)","pa-PK":"Punjabi (Pakistan)",qu:"Quechua",rm:"Rhaeto-Romanic",ro:"Romanian","ro-MO":"Romanian (Moldavia)",ru:"Russian","ru-MO":"Russian (Moldavia)",sz:"Sami (Lappish)",sg:"Sango",sa:"Sanskrit",sc:"Sardinian",sd:"Sindhi",si:"Singhalese",sr:"Serbian",sk:"Slovak",sl:"Slovenian",so:"Somani",sb:"Sorbian",es:"Spanish","es-AR":"Spanish (Argentina)","es-BO":"Spanish (Bolivia)","es-CL":"Spanish (Chile)","es-CO":"Spanish (Colombia)","es-CR":"Spanish (Costa Rica)","es-DO":"Spanish (Dominican Republic)","es-EC":"Spanish (Ecuador)","es-SV":"Spanish (El Salvador)","es-GT":"Spanish (Guatemala)","es-HN":"Spanish (Honduras)","es-MX":"Spanish (Mexico)","es-NI":"Spanish (Nicaragua)","es-PA":"Spanish (Panama)","es-PY":"Spanish (Paraguay)","es-PE":"Spanish (Peru)","es-PR":"Spanish (Puerto Rico)","es-ES":"Spanish (Spain)","es-UY":"Spanish (Uruguay)","es-VE":"Spanish (Venezuela)",sx:"Sutu",sw:"Swahili",sv:"Swedish","sv-FI":"Swedish (Finland)","sv-SV":"Swedish (Sweden)",ta:"Tamil",tt:"Tatar",te:"Teluga",th:"Thai",tig:"Tigre",ts:"Tsonga",tn:"Tswana",tr:"Turkish",tk:"Turkmen",uk:"Ukrainian",hsb:"Upper Sorbian",ur:"Urdu",ve:"Venda",vi:"Vietnamese",vo:"Volapuk",wa:"Walloon",cy:"Welsh",xh:"Xhosa",ji:"Yiddish",zu:"Zulu"}[e]!==void 0&&(this.internal.languageSettings.languageCode=e,this.internal.languageSettings.isSubscribed===!1&&(this.internal.events.subscribe("putCatalog",function(){this.internal.write("/Lang ("+this.internal.languageSettings.languageCode+")")}),this.internal.languageSettings.isSubscribed=!0)),this},pu=lt.API,vp=pu.getCharWidthsArray=function(e,t){var n,r,a=(t=t||{}).font||this.internal.getFont(),i=t.fontSize||this.internal.getFontSize(),s=t.charSpace||this.internal.getCharSpace(),o=t.widths?t.widths:a.metadata.Unicode.widths,l=o.fof?o.fof:1,u=t.kerning?t.kerning:a.metadata.Unicode.kerning,c=u.fof?u.fof:1,f=t.doKerning!==!1,p=0,d=e.length,v=0,S=o[0]||l,x=[];for(n=0;n<d;n++)r=e.charCodeAt(n),typeof a.metadata.widthOfString=="function"?x.push((a.metadata.widthOfGlyph(a.metadata.characterToGlyph(r))+s*(1e3/i)||0)/1e3):(p=f&&Ut(u[r])==="object"&&!isNaN(parseInt(u[r][v],10))?u[r][v]/c:0,x.push((o[r]||S)/l+p)),v=r;return x},_3=pu.getStringUnitWidth=function(e,t){var n=(t=t||{}).fontSize||this.internal.getFontSize(),r=t.font||this.internal.getFont(),a=t.charSpace||this.internal.getCharSpace();return pu.processArabic&&(e=pu.processArabic(e)),typeof r.metadata.widthOfString=="function"?r.metadata.widthOfString(e,n,a)/n:vp.apply(this,arguments).reduce(function(i,s){return i+s},0)},A3=function(e,t,n,r){for(var a=[],i=0,s=e.length,o=0;i!==s&&o+t[i]<n;)o+=t[i],i++;a.push(e.slice(0,i));var l=i;for(o=0;i!==s;)o+t[i]>r&&(a.push(e.slice(l,i)),o=0,l=i),o+=t[i],i++;return l!==i&&a.push(e.slice(l,i)),a},N3=function(e,t,n){n||(n={});var r,a,i,s,o,l,u,c=[],f=[c],p=n.textIndent||0,d=0,v=0,S=e.split(" "),x=vp.apply(this,[" ",n])[0];if(l=n.lineIndent===-1?S[0].length+2:n.lineIndent||0){var g=Array(l).join(" "),y=[];S.map(function(E){(E=E.split(/\s*\n/)).length>1?y=y.concat(E.map(function(D,R){return(R&&D.length?`
328
+ `:"")+D})):y.push(E[0])}),S=y,l=_3.apply(this,[g,n])}for(i=0,s=S.length;i<s;i++){var _=0;if(r=S[i],l&&r[0]==`
329
+ `&&(r=r.substr(1),_=1),p+d+(v=(a=vp.apply(this,[r,n])).reduce(function(E,D){return E+D},0))>t||_){if(v>t){for(o=A3.apply(this,[r,a,t-(p+d),t]),c.push(o.shift()),c=[o.pop()];o.length;)f.push([o.shift()]);v=a.slice(r.length-(c[0]?c[0].length:0)).reduce(function(E,D){return E+D},0)}else c=[r];f.push(c),p=v+l,d=x}else c.push(r),p+=d+v,d=x}return u=l?function(E,D){return(D?g:"")+E.join(" ")}:function(E){return E.join(" ")},f.map(u)},pu.splitTextToSize=function(e,t,n){var r,a=(n=n||{}).fontSize||this.internal.getFontSize(),i=(function(c){if(c.widths&&c.kerning)return{widths:c.widths,kerning:c.kerning};var f=this.internal.getFont(c.fontName,c.fontStyle);return f.metadata.Unicode?{widths:f.metadata.Unicode.widths||{0:1},kerning:f.metadata.Unicode.kerning||{}}:{font:f.metadata,fontSize:this.internal.getFontSize(),charSpace:this.internal.getCharSpace()}}).call(this,n);r=Array.isArray(e)?e:String(e).split(/\r?\n/);var s=1*this.internal.scaleFactor*t/a;i.textIndent=n.textIndent?1*n.textIndent*this.internal.scaleFactor/a:0,i.lineIndent=n.lineIndent;var o,l,u=[];for(o=0,l=r.length;o<l;o++)u=u.concat(N3.apply(this,[r[o],s,i]));return u},function(e){e.__fontmetrics__=e.__fontmetrics__||{};for(var t="klmnopqrstuvwxyz",n={},r={},a=0;a<t.length;a++)n[t[a]]="0123456789abcdef"[a],r["0123456789abcdef"[a]]=t[a];var i=function(f){return"0x"+parseInt(f,10).toString(16)},s=e.__fontmetrics__.compress=function(f){var p,d,v,S,x=["{"];for(var g in f){if(p=f[g],isNaN(parseInt(g,10))?d="'"+g+"'":(g=parseInt(g,10),d=(d=i(g).slice(2)).slice(0,-1)+r[d.slice(-1)]),typeof p=="number")p<0?(v=i(p).slice(3),S="-"):(v=i(p).slice(2),S=""),v=S+v.slice(0,-1)+r[v.slice(-1)];else{if(Ut(p)!=="object")throw new Error("Don't know what to do with value type "+Ut(p)+".");v=s(p)}x.push(d+v)}return x.push("}"),x.join("")},o=e.__fontmetrics__.uncompress=function(f){if(typeof f!="string")throw new Error("Invalid argument passed to uncompress.");for(var p,d,v,S,x={},g=1,y=x,_=[],E="",D="",R=f.length-1,O=1;O<R;O+=1)(S=f[O])=="'"?p?(v=p.join(""),p=void 0):p=[]:p?p.push(S):S=="{"?(_.push([y,v]),y={},v=void 0):S=="}"?((d=_.pop())[0][d[1]]=y,v=void 0,y=d[0]):S=="-"?g=-1:v===void 0?n.hasOwnProperty(S)?(E+=n[S],v=parseInt(E,16)*g,g=1,E=""):E+=S:n.hasOwnProperty(S)?(D+=n[S],y[v]=parseInt(D,16)*g,g=1,v=void 0,D=""):D+=S;return x},l={codePages:["WinAnsiEncoding"],WinAnsiEncoding:o("{19m8n201n9q201o9r201s9l201t9m201u8m201w9n201x9o201y8o202k8q202l8r202m9p202q8p20aw8k203k8t203t8v203u9v2cq8s212m9t15m8w15n9w2dw9s16k8u16l9u17s9z17x8y17y9y}")},u={Unicode:{Courier:l,"Courier-Bold":l,"Courier-BoldOblique":l,"Courier-Oblique":l,Helvetica:l,"Helvetica-Bold":l,"Helvetica-BoldOblique":l,"Helvetica-Oblique":l,"Times-Roman":l,"Times-Bold":l,"Times-BoldItalic":l,"Times-Italic":l}},c={Unicode:{"Courier-Oblique":o("{'widths'{k3w'fof'6o}'kerning'{'fof'-6o}}"),"Times-BoldItalic":o("{'widths'{k3o2q4ycx2r201n3m201o6o201s2l201t2l201u2l201w3m201x3m201y3m2k1t2l2r202m2n2n3m2o3m2p5n202q6o2r1w2s2l2t2l2u3m2v3t2w1t2x2l2y1t2z1w3k3m3l3m3m3m3n3m3o3m3p3m3q3m3r3m3s3m203t2l203u2l3v2l3w3t3x3t3y3t3z3m4k5n4l4m4m4m4n4m4o4s4p4m4q4m4r4s4s4y4t2r4u3m4v4m4w3x4x5t4y4s4z4s5k3x5l4s5m4m5n3r5o3x5p4s5q4m5r5t5s4m5t3x5u3x5v2l5w1w5x2l5y3t5z3m6k2l6l3m6m3m6n2w6o3m6p2w6q2l6r3m6s3r6t1w6u1w6v3m6w1w6x4y6y3r6z3m7k3m7l3m7m2r7n2r7o1w7p3r7q2w7r4m7s3m7t2w7u2r7v2n7w1q7x2n7y3t202l3mcl4mal2ram3man3mao3map3mar3mas2lat4uau1uav3maw3way4uaz2lbk2sbl3t'fof'6obo2lbp3tbq3mbr1tbs2lbu1ybv3mbz3mck4m202k3mcm4mcn4mco4mcp4mcq5ycr4mcs4mct4mcu4mcv4mcw2r2m3rcy2rcz2rdl4sdm4sdn4sdo4sdp4sdq4sds4sdt4sdu4sdv4sdw4sdz3mek3mel3mem3men3meo3mep3meq4ser2wes2wet2weu2wev2wew1wex1wey1wez1wfl3rfm3mfn3mfo3mfp3mfq3mfr3tfs3mft3rfu3rfv3rfw3rfz2w203k6o212m6o2dw2l2cq2l3t3m3u2l17s3x19m3m}'kerning'{cl{4qu5kt5qt5rs17ss5ts}201s{201ss}201t{cks4lscmscnscoscpscls2wu2yu201ts}201x{2wu2yu}2k{201ts}2w{4qx5kx5ou5qx5rs17su5tu}2x{17su5tu5ou}2y{4qx5kx5ou5qx5rs17ss5ts}'fof'-6ofn{17sw5tw5ou5qw5rs}7t{cksclscmscnscoscps4ls}3u{17su5tu5os5qs}3v{17su5tu5os5qs}7p{17su5tu}ck{4qu5kt5qt5rs17ss5ts}4l{4qu5kt5qt5rs17ss5ts}cm{4qu5kt5qt5rs17ss5ts}cn{4qu5kt5qt5rs17ss5ts}co{4qu5kt5qt5rs17ss5ts}cp{4qu5kt5qt5rs17ss5ts}6l{4qu5ou5qw5rt17su5tu}5q{ckuclucmucnucoucpu4lu}5r{ckuclucmucnucoucpu4lu}7q{cksclscmscnscoscps4ls}6p{4qu5ou5qw5rt17sw5tw}ek{4qu5ou5qw5rt17su5tu}el{4qu5ou5qw5rt17su5tu}em{4qu5ou5qw5rt17su5tu}en{4qu5ou5qw5rt17su5tu}eo{4qu5ou5qw5rt17su5tu}ep{4qu5ou5qw5rt17su5tu}es{17ss5ts5qs4qu}et{4qu5ou5qw5rt17sw5tw}eu{4qu5ou5qw5rt17ss5ts}ev{17ss5ts5qs4qu}6z{17sw5tw5ou5qw5rs}fm{17sw5tw5ou5qw5rs}7n{201ts}fo{17sw5tw5ou5qw5rs}fp{17sw5tw5ou5qw5rs}fq{17sw5tw5ou5qw5rs}7r{cksclscmscnscoscps4ls}fs{17sw5tw5ou5qw5rs}ft{17su5tu}fu{17su5tu}fv{17su5tu}fw{17su5tu}fz{cksclscmscnscoscps4ls}}}"),"Helvetica-Bold":o("{'widths'{k3s2q4scx1w201n3r201o6o201s1w201t1w201u1w201w3m201x3m201y3m2k1w2l2l202m2n2n3r2o3r2p5t202q6o2r1s2s2l2t2l2u2r2v3u2w1w2x2l2y1w2z1w3k3r3l3r3m3r3n3r3o3r3p3r3q3r3r3r3s3r203t2l203u2l3v2l3w3u3x3u3y3u3z3x4k6l4l4s4m4s4n4s4o4s4p4m4q3x4r4y4s4s4t1w4u3r4v4s4w3x4x5n4y4s4z4y5k4m5l4y5m4s5n4m5o3x5p4s5q4m5r5y5s4m5t4m5u3x5v2l5w1w5x2l5y3u5z3r6k2l6l3r6m3x6n3r6o3x6p3r6q2l6r3x6s3x6t1w6u1w6v3r6w1w6x5t6y3x6z3x7k3x7l3x7m2r7n3r7o2l7p3x7q3r7r4y7s3r7t3r7u3m7v2r7w1w7x2r7y3u202l3rcl4sal2lam3ran3rao3rap3rar3ras2lat4tau2pav3raw3uay4taz2lbk2sbl3u'fof'6obo2lbp3xbq3rbr1wbs2lbu2obv3rbz3xck4s202k3rcm4scn4sco4scp4scq6ocr4scs4mct4mcu4mcv4mcw1w2m2zcy1wcz1wdl4sdm4ydn4ydo4ydp4ydq4yds4ydt4sdu4sdv4sdw4sdz3xek3rel3rem3ren3reo3rep3req5ter3res3ret3reu3rev3rew1wex1wey1wez1wfl3xfm3xfn3xfo3xfp3xfq3xfr3ufs3xft3xfu3xfv3xfw3xfz3r203k6o212m6o2dw2l2cq2l3t3r3u2l17s4m19m3r}'kerning'{cl{4qs5ku5ot5qs17sv5tv}201t{2ww4wy2yw}201w{2ks}201x{2ww4wy2yw}2k{201ts201xs}2w{7qs4qu5kw5os5qw5rs17su5tu7tsfzs}2x{5ow5qs}2y{7qs4qu5kw5os5qw5rs17su5tu7tsfzs}'fof'-6o7p{17su5tu5ot}ck{4qs5ku5ot5qs17sv5tv}4l{4qs5ku5ot5qs17sv5tv}cm{4qs5ku5ot5qs17sv5tv}cn{4qs5ku5ot5qs17sv5tv}co{4qs5ku5ot5qs17sv5tv}cp{4qs5ku5ot5qs17sv5tv}6l{17st5tt5os}17s{2kwclvcmvcnvcovcpv4lv4wwckv}5o{2kucltcmtcntcotcpt4lt4wtckt}5q{2ksclscmscnscoscps4ls4wvcks}5r{2ks4ws}5t{2kwclvcmvcnvcovcpv4lv4wwckv}eo{17st5tt5os}fu{17su5tu5ot}6p{17ss5ts}ek{17st5tt5os}el{17st5tt5os}em{17st5tt5os}en{17st5tt5os}6o{201ts}ep{17st5tt5os}es{17ss5ts}et{17ss5ts}eu{17ss5ts}ev{17ss5ts}6z{17su5tu5os5qt}fm{17su5tu5os5qt}fn{17su5tu5os5qt}fo{17su5tu5os5qt}fp{17su5tu5os5qt}fq{17su5tu5os5qt}fs{17su5tu5os5qt}ft{17su5tu5ot}7m{5os}fv{17su5tu5ot}fw{17su5tu5ot}}}"),Courier:o("{'widths'{k3w'fof'6o}'kerning'{'fof'-6o}}"),"Courier-BoldOblique":o("{'widths'{k3w'fof'6o}'kerning'{'fof'-6o}}"),"Times-Bold":o("{'widths'{k3q2q5ncx2r201n3m201o6o201s2l201t2l201u2l201w3m201x3m201y3m2k1t2l2l202m2n2n3m2o3m2p6o202q6o2r1w2s2l2t2l2u3m2v3t2w1t2x2l2y1t2z1w3k3m3l3m3m3m3n3m3o3m3p3m3q3m3r3m3s3m203t2l203u2l3v2l3w3t3x3t3y3t3z3m4k5x4l4s4m4m4n4s4o4s4p4m4q3x4r4y4s4y4t2r4u3m4v4y4w4m4x5y4y4s4z4y5k3x5l4y5m4s5n3r5o4m5p4s5q4s5r6o5s4s5t4s5u4m5v2l5w1w5x2l5y3u5z3m6k2l6l3m6m3r6n2w6o3r6p2w6q2l6r3m6s3r6t1w6u2l6v3r6w1w6x5n6y3r6z3m7k3r7l3r7m2w7n2r7o2l7p3r7q3m7r4s7s3m7t3m7u2w7v2r7w1q7x2r7y3o202l3mcl4sal2lam3man3mao3map3mar3mas2lat4uau1yav3maw3tay4uaz2lbk2sbl3t'fof'6obo2lbp3rbr1tbs2lbu2lbv3mbz3mck4s202k3mcm4scn4sco4scp4scq6ocr4scs4mct4mcu4mcv4mcw2r2m3rcy2rcz2rdl4sdm4ydn4ydo4ydp4ydq4yds4ydt4sdu4sdv4sdw4sdz3rek3mel3mem3men3meo3mep3meq4ser2wes2wet2weu2wev2wew1wex1wey1wez1wfl3rfm3mfn3mfo3mfp3mfq3mfr3tfs3mft3rfu3rfv3rfw3rfz3m203k6o212m6o2dw2l2cq2l3t3m3u2l17s4s19m3m}'kerning'{cl{4qt5ks5ot5qy5rw17sv5tv}201t{cks4lscmscnscoscpscls4wv}2k{201ts}2w{4qu5ku7mu5os5qx5ru17su5tu}2x{17su5tu5ou5qs}2y{4qv5kv7mu5ot5qz5ru17su5tu}'fof'-6o7t{cksclscmscnscoscps4ls}3u{17su5tu5os5qu}3v{17su5tu5os5qu}fu{17su5tu5ou5qu}7p{17su5tu5ou5qu}ck{4qt5ks5ot5qy5rw17sv5tv}4l{4qt5ks5ot5qy5rw17sv5tv}cm{4qt5ks5ot5qy5rw17sv5tv}cn{4qt5ks5ot5qy5rw17sv5tv}co{4qt5ks5ot5qy5rw17sv5tv}cp{4qt5ks5ot5qy5rw17sv5tv}6l{17st5tt5ou5qu}17s{ckuclucmucnucoucpu4lu4wu}5o{ckuclucmucnucoucpu4lu4wu}5q{ckzclzcmzcnzcozcpz4lz4wu}5r{ckxclxcmxcnxcoxcpx4lx4wu}5t{ckuclucmucnucoucpu4lu4wu}7q{ckuclucmucnucoucpu4lu}6p{17sw5tw5ou5qu}ek{17st5tt5qu}el{17st5tt5ou5qu}em{17st5tt5qu}en{17st5tt5qu}eo{17st5tt5qu}ep{17st5tt5ou5qu}es{17ss5ts5qu}et{17sw5tw5ou5qu}eu{17sw5tw5ou5qu}ev{17ss5ts5qu}6z{17sw5tw5ou5qu5rs}fm{17sw5tw5ou5qu5rs}fn{17sw5tw5ou5qu5rs}fo{17sw5tw5ou5qu5rs}fp{17sw5tw5ou5qu5rs}fq{17sw5tw5ou5qu5rs}7r{cktcltcmtcntcotcpt4lt5os}fs{17sw5tw5ou5qu5rs}ft{17su5tu5ou5qu}7m{5os}fv{17su5tu5ou5qu}fw{17su5tu5ou5qu}fz{cksclscmscnscoscps4ls}}}"),Symbol:o("{'widths'{k3uaw4r19m3m2k1t2l2l202m2y2n3m2p5n202q6o3k3m2s2l2t2l2v3r2w1t3m3m2y1t2z1wbk2sbl3r'fof'6o3n3m3o3m3p3m3q3m3r3m3s3m3t3m3u1w3v1w3w3r3x3r3y3r3z2wbp3t3l3m5v2l5x2l5z3m2q4yfr3r7v3k7w1o7x3k}'kerning'{'fof'-6o}}"),Helvetica:o("{'widths'{k3p2q4mcx1w201n3r201o6o201s1q201t1q201u1q201w2l201x2l201y2l2k1w2l1w202m2n2n3r2o3r2p5t202q6o2r1n2s2l2t2l2u2r2v3u2w1w2x2l2y1w2z1w3k3r3l3r3m3r3n3r3o3r3p3r3q3r3r3r3s3r203t2l203u2l3v1w3w3u3x3u3y3u3z3r4k6p4l4m4m4m4n4s4o4s4p4m4q3x4r4y4s4s4t1w4u3m4v4m4w3r4x5n4y4s4z4y5k4m5l4y5m4s5n4m5o3x5p4s5q4m5r5y5s4m5t4m5u3x5v1w5w1w5x1w5y2z5z3r6k2l6l3r6m3r6n3m6o3r6p3r6q1w6r3r6s3r6t1q6u1q6v3m6w1q6x5n6y3r6z3r7k3r7l3r7m2l7n3m7o1w7p3r7q3m7r4s7s3m7t3m7u3m7v2l7w1u7x2l7y3u202l3rcl4mal2lam3ran3rao3rap3rar3ras2lat4tau2pav3raw3uay4taz2lbk2sbl3u'fof'6obo2lbp3rbr1wbs2lbu2obv3rbz3xck4m202k3rcm4mcn4mco4mcp4mcq6ocr4scs4mct4mcu4mcv4mcw1w2m2ncy1wcz1wdl4sdm4ydn4ydo4ydp4ydq4yds4ydt4sdu4sdv4sdw4sdz3xek3rel3rem3ren3reo3rep3req5ter3mes3ret3reu3rev3rew1wex1wey1wez1wfl3rfm3rfn3rfo3rfp3rfq3rfr3ufs3xft3rfu3rfv3rfw3rfz3m203k6o212m6o2dw2l2cq2l3t3r3u1w17s4m19m3r}'kerning'{5q{4wv}cl{4qs5kw5ow5qs17sv5tv}201t{2wu4w1k2yu}201x{2wu4wy2yu}17s{2ktclucmucnu4otcpu4lu4wycoucku}2w{7qs4qz5k1m17sy5ow5qx5rsfsu5ty7tufzu}2x{17sy5ty5oy5qs}2y{7qs4qz5k1m17sy5ow5qx5rsfsu5ty7tufzu}'fof'-6o7p{17sv5tv5ow}ck{4qs5kw5ow5qs17sv5tv}4l{4qs5kw5ow5qs17sv5tv}cm{4qs5kw5ow5qs17sv5tv}cn{4qs5kw5ow5qs17sv5tv}co{4qs5kw5ow5qs17sv5tv}cp{4qs5kw5ow5qs17sv5tv}6l{17sy5ty5ow}do{17st5tt}4z{17st5tt}7s{fst}dm{17st5tt}dn{17st5tt}5o{ckwclwcmwcnwcowcpw4lw4wv}dp{17st5tt}dq{17st5tt}7t{5ow}ds{17st5tt}5t{2ktclucmucnu4otcpu4lu4wycoucku}fu{17sv5tv5ow}6p{17sy5ty5ow5qs}ek{17sy5ty5ow}el{17sy5ty5ow}em{17sy5ty5ow}en{5ty}eo{17sy5ty5ow}ep{17sy5ty5ow}es{17sy5ty5qs}et{17sy5ty5ow5qs}eu{17sy5ty5ow5qs}ev{17sy5ty5ow5qs}6z{17sy5ty5ow5qs}fm{17sy5ty5ow5qs}fn{17sy5ty5ow5qs}fo{17sy5ty5ow5qs}fp{17sy5ty5qs}fq{17sy5ty5ow5qs}7r{5ow}fs{17sy5ty5ow5qs}ft{17sv5tv5ow}7m{5ow}fv{17sv5tv5ow}fw{17sv5tv5ow}}}"),"Helvetica-BoldOblique":o("{'widths'{k3s2q4scx1w201n3r201o6o201s1w201t1w201u1w201w3m201x3m201y3m2k1w2l2l202m2n2n3r2o3r2p5t202q6o2r1s2s2l2t2l2u2r2v3u2w1w2x2l2y1w2z1w3k3r3l3r3m3r3n3r3o3r3p3r3q3r3r3r3s3r203t2l203u2l3v2l3w3u3x3u3y3u3z3x4k6l4l4s4m4s4n4s4o4s4p4m4q3x4r4y4s4s4t1w4u3r4v4s4w3x4x5n4y4s4z4y5k4m5l4y5m4s5n4m5o3x5p4s5q4m5r5y5s4m5t4m5u3x5v2l5w1w5x2l5y3u5z3r6k2l6l3r6m3x6n3r6o3x6p3r6q2l6r3x6s3x6t1w6u1w6v3r6w1w6x5t6y3x6z3x7k3x7l3x7m2r7n3r7o2l7p3x7q3r7r4y7s3r7t3r7u3m7v2r7w1w7x2r7y3u202l3rcl4sal2lam3ran3rao3rap3rar3ras2lat4tau2pav3raw3uay4taz2lbk2sbl3u'fof'6obo2lbp3xbq3rbr1wbs2lbu2obv3rbz3xck4s202k3rcm4scn4sco4scp4scq6ocr4scs4mct4mcu4mcv4mcw1w2m2zcy1wcz1wdl4sdm4ydn4ydo4ydp4ydq4yds4ydt4sdu4sdv4sdw4sdz3xek3rel3rem3ren3reo3rep3req5ter3res3ret3reu3rev3rew1wex1wey1wez1wfl3xfm3xfn3xfo3xfp3xfq3xfr3ufs3xft3xfu3xfv3xfw3xfz3r203k6o212m6o2dw2l2cq2l3t3r3u2l17s4m19m3r}'kerning'{cl{4qs5ku5ot5qs17sv5tv}201t{2ww4wy2yw}201w{2ks}201x{2ww4wy2yw}2k{201ts201xs}2w{7qs4qu5kw5os5qw5rs17su5tu7tsfzs}2x{5ow5qs}2y{7qs4qu5kw5os5qw5rs17su5tu7tsfzs}'fof'-6o7p{17su5tu5ot}ck{4qs5ku5ot5qs17sv5tv}4l{4qs5ku5ot5qs17sv5tv}cm{4qs5ku5ot5qs17sv5tv}cn{4qs5ku5ot5qs17sv5tv}co{4qs5ku5ot5qs17sv5tv}cp{4qs5ku5ot5qs17sv5tv}6l{17st5tt5os}17s{2kwclvcmvcnvcovcpv4lv4wwckv}5o{2kucltcmtcntcotcpt4lt4wtckt}5q{2ksclscmscnscoscps4ls4wvcks}5r{2ks4ws}5t{2kwclvcmvcnvcovcpv4lv4wwckv}eo{17st5tt5os}fu{17su5tu5ot}6p{17ss5ts}ek{17st5tt5os}el{17st5tt5os}em{17st5tt5os}en{17st5tt5os}6o{201ts}ep{17st5tt5os}es{17ss5ts}et{17ss5ts}eu{17ss5ts}ev{17ss5ts}6z{17su5tu5os5qt}fm{17su5tu5os5qt}fn{17su5tu5os5qt}fo{17su5tu5os5qt}fp{17su5tu5os5qt}fq{17su5tu5os5qt}fs{17su5tu5os5qt}ft{17su5tu5ot}7m{5os}fv{17su5tu5ot}fw{17su5tu5ot}}}"),ZapfDingbats:o("{'widths'{k4u2k1w'fof'6o}'kerning'{'fof'-6o}}"),"Courier-Bold":o("{'widths'{k3w'fof'6o}'kerning'{'fof'-6o}}"),"Times-Italic":o("{'widths'{k3n2q4ycx2l201n3m201o5t201s2l201t2l201u2l201w3r201x3r201y3r2k1t2l2l202m2n2n3m2o3m2p5n202q5t2r1p2s2l2t2l2u3m2v4n2w1t2x2l2y1t2z1w3k3m3l3m3m3m3n3m3o3m3p3m3q3m3r3m3s3m203t2l203u2l3v2l3w4n3x4n3y4n3z3m4k5w4l3x4m3x4n4m4o4s4p3x4q3x4r4s4s4s4t2l4u2w4v4m4w3r4x5n4y4m4z4s5k3x5l4s5m3x5n3m5o3r5p4s5q3x5r5n5s3x5t3r5u3r5v2r5w1w5x2r5y2u5z3m6k2l6l3m6m3m6n2w6o3m6p2w6q1w6r3m6s3m6t1w6u1w6v2w6w1w6x4s6y3m6z3m7k3m7l3m7m2r7n2r7o1w7p3m7q2w7r4m7s2w7t2w7u2r7v2s7w1v7x2s7y3q202l3mcl3xal2ram3man3mao3map3mar3mas2lat4wau1vav3maw4nay4waz2lbk2sbl4n'fof'6obo2lbp3mbq3obr1tbs2lbu1zbv3mbz3mck3x202k3mcm3xcn3xco3xcp3xcq5tcr4mcs3xct3xcu3xcv3xcw2l2m2ucy2lcz2ldl4mdm4sdn4sdo4sdp4sdq4sds4sdt4sdu4sdv4sdw4sdz3mek3mel3mem3men3meo3mep3meq4mer2wes2wet2weu2wev2wew1wex1wey1wez1wfl3mfm3mfn3mfo3mfp3mfq3mfr4nfs3mft3mfu3mfv3mfw3mfz2w203k6o212m6m2dw2l2cq2l3t3m3u2l17s3r19m3m}'kerning'{cl{5kt4qw}201s{201sw}201t{201tw2wy2yy6q-t}201x{2wy2yy}2k{201tw}2w{7qs4qy7rs5ky7mw5os5qx5ru17su5tu}2x{17ss5ts5os}2y{7qs4qy7rs5ky7mw5os5qx5ru17su5tu}'fof'-6o6t{17ss5ts5qs}7t{5os}3v{5qs}7p{17su5tu5qs}ck{5kt4qw}4l{5kt4qw}cm{5kt4qw}cn{5kt4qw}co{5kt4qw}cp{5kt4qw}6l{4qs5ks5ou5qw5ru17su5tu}17s{2ks}5q{ckvclvcmvcnvcovcpv4lv}5r{ckuclucmucnucoucpu4lu}5t{2ks}6p{4qs5ks5ou5qw5ru17su5tu}ek{4qs5ks5ou5qw5ru17su5tu}el{4qs5ks5ou5qw5ru17su5tu}em{4qs5ks5ou5qw5ru17su5tu}en{4qs5ks5ou5qw5ru17su5tu}eo{4qs5ks5ou5qw5ru17su5tu}ep{4qs5ks5ou5qw5ru17su5tu}es{5ks5qs4qs}et{4qs5ks5ou5qw5ru17su5tu}eu{4qs5ks5qw5ru17su5tu}ev{5ks5qs4qs}ex{17ss5ts5qs}6z{4qv5ks5ou5qw5ru17su5tu}fm{4qv5ks5ou5qw5ru17su5tu}fn{4qv5ks5ou5qw5ru17su5tu}fo{4qv5ks5ou5qw5ru17su5tu}fp{4qv5ks5ou5qw5ru17su5tu}fq{4qv5ks5ou5qw5ru17su5tu}7r{5os}fs{4qv5ks5ou5qw5ru17su5tu}ft{17su5tu5qs}fu{17su5tu5qs}fv{17su5tu5qs}fw{17su5tu5qs}}}"),"Times-Roman":o("{'widths'{k3n2q4ycx2l201n3m201o6o201s2l201t2l201u2l201w2w201x2w201y2w2k1t2l2l202m2n2n3m2o3m2p5n202q6o2r1m2s2l2t2l2u3m2v3s2w1t2x2l2y1t2z1w3k3m3l3m3m3m3n3m3o3m3p3m3q3m3r3m3s3m203t2l203u2l3v1w3w3s3x3s3y3s3z2w4k5w4l4s4m4m4n4m4o4s4p3x4q3r4r4s4s4s4t2l4u2r4v4s4w3x4x5t4y4s4z4s5k3r5l4s5m4m5n3r5o3x5p4s5q4s5r5y5s4s5t4s5u3x5v2l5w1w5x2l5y2z5z3m6k2l6l2w6m3m6n2w6o3m6p2w6q2l6r3m6s3m6t1w6u1w6v3m6w1w6x4y6y3m6z3m7k3m7l3m7m2l7n2r7o1w7p3m7q3m7r4s7s3m7t3m7u2w7v3k7w1o7x3k7y3q202l3mcl4sal2lam3man3mao3map3mar3mas2lat4wau1vav3maw3say4waz2lbk2sbl3s'fof'6obo2lbp3mbq2xbr1tbs2lbu1zbv3mbz2wck4s202k3mcm4scn4sco4scp4scq5tcr4mcs3xct3xcu3xcv3xcw2l2m2tcy2lcz2ldl4sdm4sdn4sdo4sdp4sdq4sds4sdt4sdu4sdv4sdw4sdz3mek2wel2wem2wen2weo2wep2weq4mer2wes2wet2weu2wev2wew1wex1wey1wez1wfl3mfm3mfn3mfo3mfp3mfq3mfr3sfs3mft3mfu3mfv3mfw3mfz3m203k6o212m6m2dw2l2cq2l3t3m3u1w17s4s19m3m}'kerning'{cl{4qs5ku17sw5ou5qy5rw201ss5tw201ws}201s{201ss}201t{ckw4lwcmwcnwcowcpwclw4wu201ts}2k{201ts}2w{4qs5kw5os5qx5ru17sx5tx}2x{17sw5tw5ou5qu}2y{4qs5kw5os5qx5ru17sx5tx}'fof'-6o7t{ckuclucmucnucoucpu4lu5os5rs}3u{17su5tu5qs}3v{17su5tu5qs}7p{17sw5tw5qs}ck{4qs5ku17sw5ou5qy5rw201ss5tw201ws}4l{4qs5ku17sw5ou5qy5rw201ss5tw201ws}cm{4qs5ku17sw5ou5qy5rw201ss5tw201ws}cn{4qs5ku17sw5ou5qy5rw201ss5tw201ws}co{4qs5ku17sw5ou5qy5rw201ss5tw201ws}cp{4qs5ku17sw5ou5qy5rw201ss5tw201ws}6l{17su5tu5os5qw5rs}17s{2ktclvcmvcnvcovcpv4lv4wuckv}5o{ckwclwcmwcnwcowcpw4lw4wu}5q{ckyclycmycnycoycpy4ly4wu5ms}5r{cktcltcmtcntcotcpt4lt4ws}5t{2ktclvcmvcnvcovcpv4lv4wuckv}7q{cksclscmscnscoscps4ls}6p{17su5tu5qw5rs}ek{5qs5rs}el{17su5tu5os5qw5rs}em{17su5tu5os5qs5rs}en{17su5qs5rs}eo{5qs5rs}ep{17su5tu5os5qw5rs}es{5qs}et{17su5tu5qw5rs}eu{17su5tu5qs5rs}ev{5qs}6z{17sv5tv5os5qx5rs}fm{5os5qt5rs}fn{17sv5tv5os5qx5rs}fo{17sv5tv5os5qx5rs}fp{5os5qt5rs}fq{5os5qt5rs}7r{ckuclucmucnucoucpu4lu5os}fs{17sv5tv5os5qx5rs}ft{17ss5ts5qs}fu{17sw5tw5qs}fv{17sw5tw5qs}fw{17ss5ts5qs}fz{ckuclucmucnucoucpu4lu5os5rs}}}"),"Helvetica-Oblique":o("{'widths'{k3p2q4mcx1w201n3r201o6o201s1q201t1q201u1q201w2l201x2l201y2l2k1w2l1w202m2n2n3r2o3r2p5t202q6o2r1n2s2l2t2l2u2r2v3u2w1w2x2l2y1w2z1w3k3r3l3r3m3r3n3r3o3r3p3r3q3r3r3r3s3r203t2l203u2l3v1w3w3u3x3u3y3u3z3r4k6p4l4m4m4m4n4s4o4s4p4m4q3x4r4y4s4s4t1w4u3m4v4m4w3r4x5n4y4s4z4y5k4m5l4y5m4s5n4m5o3x5p4s5q4m5r5y5s4m5t4m5u3x5v1w5w1w5x1w5y2z5z3r6k2l6l3r6m3r6n3m6o3r6p3r6q1w6r3r6s3r6t1q6u1q6v3m6w1q6x5n6y3r6z3r7k3r7l3r7m2l7n3m7o1w7p3r7q3m7r4s7s3m7t3m7u3m7v2l7w1u7x2l7y3u202l3rcl4mal2lam3ran3rao3rap3rar3ras2lat4tau2pav3raw3uay4taz2lbk2sbl3u'fof'6obo2lbp3rbr1wbs2lbu2obv3rbz3xck4m202k3rcm4mcn4mco4mcp4mcq6ocr4scs4mct4mcu4mcv4mcw1w2m2ncy1wcz1wdl4sdm4ydn4ydo4ydp4ydq4yds4ydt4sdu4sdv4sdw4sdz3xek3rel3rem3ren3reo3rep3req5ter3mes3ret3reu3rev3rew1wex1wey1wez1wfl3rfm3rfn3rfo3rfp3rfq3rfr3ufs3xft3rfu3rfv3rfw3rfz3m203k6o212m6o2dw2l2cq2l3t3r3u1w17s4m19m3r}'kerning'{5q{4wv}cl{4qs5kw5ow5qs17sv5tv}201t{2wu4w1k2yu}201x{2wu4wy2yu}17s{2ktclucmucnu4otcpu4lu4wycoucku}2w{7qs4qz5k1m17sy5ow5qx5rsfsu5ty7tufzu}2x{17sy5ty5oy5qs}2y{7qs4qz5k1m17sy5ow5qx5rsfsu5ty7tufzu}'fof'-6o7p{17sv5tv5ow}ck{4qs5kw5ow5qs17sv5tv}4l{4qs5kw5ow5qs17sv5tv}cm{4qs5kw5ow5qs17sv5tv}cn{4qs5kw5ow5qs17sv5tv}co{4qs5kw5ow5qs17sv5tv}cp{4qs5kw5ow5qs17sv5tv}6l{17sy5ty5ow}do{17st5tt}4z{17st5tt}7s{fst}dm{17st5tt}dn{17st5tt}5o{ckwclwcmwcnwcowcpw4lw4wv}dp{17st5tt}dq{17st5tt}7t{5ow}ds{17st5tt}5t{2ktclucmucnu4otcpu4lu4wycoucku}fu{17sv5tv5ow}6p{17sy5ty5ow5qs}ek{17sy5ty5ow}el{17sy5ty5ow}em{17sy5ty5ow}en{5ty}eo{17sy5ty5ow}ep{17sy5ty5ow}es{17sy5ty5qs}et{17sy5ty5ow5qs}eu{17sy5ty5ow5qs}ev{17sy5ty5ow5qs}6z{17sy5ty5ow5qs}fm{17sy5ty5ow5qs}fn{17sy5ty5ow5qs}fo{17sy5ty5ow5qs}fp{17sy5ty5qs}fq{17sy5ty5ow5qs}7r{5ow}fs{17sy5ty5ow5qs}ft{17sv5tv5ow}7m{5ow}fv{17sv5tv5ow}fw{17sv5tv5ow}}}")}};e.events.push(["addFont",function(f){var p=f.font,d=c.Unicode[p.postScriptName];d&&(p.metadata.Unicode={},p.metadata.Unicode.widths=d.widths,p.metadata.Unicode.kerning=d.kerning);var v=u.Unicode[p.postScriptName];v&&(p.metadata.Unicode.encoding=v,p.encoding=v.codePages[0])}])}(lt.API),function(e){var t=function(n){for(var r=n.length,a=new Uint8Array(r),i=0;i<r;i++)a[i]=n.charCodeAt(i);return a};e.API.events.push(["addFont",function(n){var r=void 0,a=n.font,i=n.instance;if(!a.isStandardFont){if(i===void 0)throw new Error("Font does not exist in vFS, import fonts or remove declaration doc.addFont('"+a.postScriptName+"').");if(typeof(r=i.existsFileInVFS(a.postScriptName)===!1?i.loadFile(a.postScriptName):i.getFileFromVFS(a.postScriptName))!="string")throw new Error("Font is not stored as string-data in vFS, import fonts or remove declaration doc.addFont('"+a.postScriptName+"').");(function(s,o){o=/^\x00\x01\x00\x00/.test(o)?t(o):t(Gf(o)),s.metadata=e.API.TTFFont.open(o),s.metadata.Unicode=s.metadata.Unicode||{encoding:{},kerning:{},widths:[]},s.metadata.glyIdsUsed=[0]})(a,r)}}])}(lt),function(e){function t(){return(ct.canvg?Promise.resolve(ct.canvg):Ls(()=>import("./index.es-BowDWdhy.js"),[])).catch(function(n){return Promise.reject(new Error("Could not load canvg: "+n))}).then(function(n){return n.default?n.default:n})}lt.API.addSvgAsImage=function(n,r,a,i,s,o,l,u){if(isNaN(r)||isNaN(a))throw fn.error("jsPDF.addSvgAsImage: Invalid coordinates",arguments),new Error("Invalid coordinates passed to jsPDF.addSvgAsImage");if(isNaN(i)||isNaN(s))throw fn.error("jsPDF.addSvgAsImage: Invalid measurements",arguments),new Error("Invalid measurements (width and/or height) passed to jsPDF.addSvgAsImage");var c=document.createElement("canvas");c.width=i,c.height=s;var f=c.getContext("2d");f.fillStyle="#fff",f.fillRect(0,0,c.width,c.height);var p={ignoreMouse:!0,ignoreAnimation:!0,ignoreDimensions:!0},d=this;return t().then(function(v){return v.fromString(f,n,p)},function(){return Promise.reject(new Error("Could not load canvg."))}).then(function(v){return v.render(p)}).then(function(){d.addImage(c.toDataURL("image/jpeg",1),r,a,i,s,l,u)})}}(),lt.API.putTotalPages=function(e){var t,n=0;parseInt(this.internal.getFont().id.substr(1),10)<15?(t=new RegExp(e,"g"),n=this.internal.getNumberOfPages()):(t=new RegExp(this.pdfEscape16(e,this.internal.getFont()),"g"),n=this.pdfEscape16(this.internal.getNumberOfPages()+"",this.internal.getFont()));for(var r=1;r<=this.internal.getNumberOfPages();r++)for(var a=0;a<this.internal.pages[r].length;a++)this.internal.pages[r][a]=this.internal.pages[r][a].replace(t,n);return this},lt.API.viewerPreferences=function(e,t){var n;e=e||{},t=t||!1;var r,a,i,s={HideToolbar:{defaultValue:!1,value:!1,type:"boolean",explicitSet:!1,valueSet:[!0,!1],pdfVersion:1.3},HideMenubar:{defaultValue:!1,value:!1,type:"boolean",explicitSet:!1,valueSet:[!0,!1],pdfVersion:1.3},HideWindowUI:{defaultValue:!1,value:!1,type:"boolean",explicitSet:!1,valueSet:[!0,!1],pdfVersion:1.3},FitWindow:{defaultValue:!1,value:!1,type:"boolean",explicitSet:!1,valueSet:[!0,!1],pdfVersion:1.3},CenterWindow:{defaultValue:!1,value:!1,type:"boolean",explicitSet:!1,valueSet:[!0,!1],pdfVersion:1.3},DisplayDocTitle:{defaultValue:!1,value:!1,type:"boolean",explicitSet:!1,valueSet:[!0,!1],pdfVersion:1.4},NonFullScreenPageMode:{defaultValue:"UseNone",value:"UseNone",type:"name",explicitSet:!1,valueSet:["UseNone","UseOutlines","UseThumbs","UseOC"],pdfVersion:1.3},Direction:{defaultValue:"L2R",value:"L2R",type:"name",explicitSet:!1,valueSet:["L2R","R2L"],pdfVersion:1.3},ViewArea:{defaultValue:"CropBox",value:"CropBox",type:"name",explicitSet:!1,valueSet:["MediaBox","CropBox","TrimBox","BleedBox","ArtBox"],pdfVersion:1.4},ViewClip:{defaultValue:"CropBox",value:"CropBox",type:"name",explicitSet:!1,valueSet:["MediaBox","CropBox","TrimBox","BleedBox","ArtBox"],pdfVersion:1.4},PrintArea:{defaultValue:"CropBox",value:"CropBox",type:"name",explicitSet:!1,valueSet:["MediaBox","CropBox","TrimBox","BleedBox","ArtBox"],pdfVersion:1.4},PrintClip:{defaultValue:"CropBox",value:"CropBox",type:"name",explicitSet:!1,valueSet:["MediaBox","CropBox","TrimBox","BleedBox","ArtBox"],pdfVersion:1.4},PrintScaling:{defaultValue:"AppDefault",value:"AppDefault",type:"name",explicitSet:!1,valueSet:["AppDefault","None"],pdfVersion:1.6},Duplex:{defaultValue:"",value:"none",type:"name",explicitSet:!1,valueSet:["Simplex","DuplexFlipShortEdge","DuplexFlipLongEdge","none"],pdfVersion:1.7},PickTrayByPDFSize:{defaultValue:!1,value:!1,type:"boolean",explicitSet:!1,valueSet:[!0,!1],pdfVersion:1.7},PrintPageRange:{defaultValue:"",value:"",type:"array",explicitSet:!1,valueSet:null,pdfVersion:1.7},NumCopies:{defaultValue:1,value:1,type:"integer",explicitSet:!1,valueSet:null,pdfVersion:1.7}},o=Object.keys(s),l=[],u=0,c=0,f=0;function p(v,S){var x,g=!1;for(x=0;x<v.length;x+=1)v[x]===S&&(g=!0);return g}if(this.internal.viewerpreferences===void 0&&(this.internal.viewerpreferences={},this.internal.viewerpreferences.configuration=JSON.parse(JSON.stringify(s)),this.internal.viewerpreferences.isSubscribed=!1),n=this.internal.viewerpreferences.configuration,e==="reset"||t===!0){var d=o.length;for(f=0;f<d;f+=1)n[o[f]].value=n[o[f]].defaultValue,n[o[f]].explicitSet=!1}if(Ut(e)==="object"){for(a in e)if(i=e[a],p(o,a)&&i!==void 0){if(n[a].type==="boolean"&&typeof i=="boolean")n[a].value=i;else if(n[a].type==="name"&&p(n[a].valueSet,i))n[a].value=i;else if(n[a].type==="integer"&&Number.isInteger(i))n[a].value=i;else if(n[a].type==="array"){for(u=0;u<i.length;u+=1)if(r=!0,i[u].length===1&&typeof i[u][0]=="number")l.push(String(i[u]-1));else if(i[u].length>1){for(c=0;c<i[u].length;c+=1)typeof i[u][c]!="number"&&(r=!1);r===!0&&l.push([i[u][0]-1,i[u][1]-1].join(" "))}n[a].value="["+l.join(" ")+"]"}else n[a].value=n[a].defaultValue;n[a].explicitSet=!0}}return this.internal.viewerpreferences.isSubscribed===!1&&(this.internal.events.subscribe("putCatalog",function(){var v,S=[];for(v in n)n[v].explicitSet===!0&&(n[v].type==="name"?S.push("/"+v+" /"+n[v].value):S.push("/"+v+" "+n[v].value));S.length!==0&&this.internal.write(`/ViewerPreferences
330
+ <<
331
+ `+S.join(`
332
+ `)+`
333
+ >>`)}),this.internal.viewerpreferences.isSubscribed=!0),this.internal.viewerpreferences.configuration=n,this},function(e){var t=function(){var r='<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"><rdf:Description rdf:about="" xmlns:jspdf="'+this.internal.__metadata__.namespaceuri+'"><jspdf:metadata>',a=unescape(encodeURIComponent('<x:xmpmeta xmlns:x="adobe:ns:meta/">')),i=unescape(encodeURIComponent(r)),s=unescape(encodeURIComponent(this.internal.__metadata__.metadata)),o=unescape(encodeURIComponent("</jspdf:metadata></rdf:Description></rdf:RDF>")),l=unescape(encodeURIComponent("</x:xmpmeta>")),u=i.length+s.length+o.length+a.length+l.length;this.internal.__metadata__.metadata_object_number=this.internal.newObject(),this.internal.write("<< /Type /Metadata /Subtype /XML /Length "+u+" >>"),this.internal.write("stream"),this.internal.write(a+i+s+o+l),this.internal.write("endstream"),this.internal.write("endobj")},n=function(){this.internal.__metadata__.metadata_object_number&&this.internal.write("/Metadata "+this.internal.__metadata__.metadata_object_number+" 0 R")};e.addMetadata=function(r,a){return this.internal.__metadata__===void 0&&(this.internal.__metadata__={metadata:r,namespaceuri:a||"http://jspdf.default.namespaceuri/"},this.internal.events.subscribe("putCatalog",n),this.internal.events.subscribe("postPutResources",t)),this}}(lt.API),function(e){var t=e.API,n=t.pdfEscape16=function(i,s){for(var o,l=s.metadata.Unicode.widths,u=["","0","00","000","0000"],c=[""],f=0,p=i.length;f<p;++f){if(o=s.metadata.characterToGlyph(i.charCodeAt(f)),s.metadata.glyIdsUsed.push(o),s.metadata.toUnicode[o]=i.charCodeAt(f),l.indexOf(o)==-1&&(l.push(o),l.push([parseInt(s.metadata.widthOfGlyph(o),10)])),o=="0")return c.join("");o=o.toString(16),c.push(u[4-o.length],o)}return c.join("")},r=function(i){var s,o,l,u,c,f,p;for(c=`/CIDInit /ProcSet findresource begin
334
+ 12 dict begin
335
+ begincmap
336
+ /CIDSystemInfo <<
337
+ /Registry (Adobe)
338
+ /Ordering (UCS)
339
+ /Supplement 0
340
+ >> def
341
+ /CMapName /Adobe-Identity-UCS def
342
+ /CMapType 2 def
343
+ 1 begincodespacerange
344
+ <0000><ffff>
345
+ endcodespacerange`,l=[],f=0,p=(o=Object.keys(i).sort(function(d,v){return d-v})).length;f<p;f++)s=o[f],l.length>=100&&(c+=`
346
+ `+l.length+` beginbfchar
347
+ `+l.join(`
348
+ `)+`
349
+ endbfchar`,l=[]),i[s]!==void 0&&i[s]!==null&&typeof i[s].toString=="function"&&(u=("0000"+i[s].toString(16)).slice(-4),s=("0000"+(+s).toString(16)).slice(-4),l.push("<"+s+"><"+u+">"));return l.length&&(c+=`
350
+ `+l.length+` beginbfchar
351
+ `+l.join(`
352
+ `)+`
353
+ endbfchar
354
+ `),c+=`endcmap
355
+ CMapName currentdict /CMap defineresource pop
356
+ end
357
+ end`};t.events.push(["putFont",function(i){(function(s){var o=s.font,l=s.out,u=s.newObject,c=s.putStream;if(o.metadata instanceof e.API.TTFFont&&o.encoding==="Identity-H"){for(var f=o.metadata.Unicode.widths,p=o.metadata.subset.encode(o.metadata.glyIdsUsed,1),d="",v=0;v<p.length;v++)d+=String.fromCharCode(p[v]);var S=u();c({data:d,addLength1:!0,objectId:S}),l("endobj");var x=u();c({data:r(o.metadata.toUnicode),addLength1:!0,objectId:x}),l("endobj");var g=u();l("<<"),l("/Type /FontDescriptor"),l("/FontName /"+xu(o.fontName)),l("/FontFile2 "+S+" 0 R"),l("/FontBBox "+e.API.PDFObject.convert(o.metadata.bbox)),l("/Flags "+o.metadata.flags),l("/StemV "+o.metadata.stemV),l("/ItalicAngle "+o.metadata.italicAngle),l("/Ascent "+o.metadata.ascender),l("/Descent "+o.metadata.decender),l("/CapHeight "+o.metadata.capHeight),l(">>"),l("endobj");var y=u();l("<<"),l("/Type /Font"),l("/BaseFont /"+xu(o.fontName)),l("/FontDescriptor "+g+" 0 R"),l("/W "+e.API.PDFObject.convert(f)),l("/CIDToGIDMap /Identity"),l("/DW 1000"),l("/Subtype /CIDFontType2"),l("/CIDSystemInfo"),l("<<"),l("/Supplement 0"),l("/Registry (Adobe)"),l("/Ordering ("+o.encoding+")"),l(">>"),l(">>"),l("endobj"),o.objectNumber=u(),l("<<"),l("/Type /Font"),l("/Subtype /Type0"),l("/ToUnicode "+x+" 0 R"),l("/BaseFont /"+xu(o.fontName)),l("/Encoding /"+o.encoding),l("/DescendantFonts ["+y+" 0 R]"),l(">>"),l("endobj"),o.isAlreadyPutted=!0}})(i)}]),t.events.push(["putFont",function(i){(function(s){var o=s.font,l=s.out,u=s.newObject,c=s.putStream;if(o.metadata instanceof e.API.TTFFont&&o.encoding==="WinAnsiEncoding"){for(var f=o.metadata.rawData,p="",d=0;d<f.length;d++)p+=String.fromCharCode(f[d]);var v=u();c({data:p,addLength1:!0,objectId:v}),l("endobj");var S=u();c({data:r(o.metadata.toUnicode),addLength1:!0,objectId:S}),l("endobj");var x=u();l("<<"),l("/Descent "+o.metadata.decender),l("/CapHeight "+o.metadata.capHeight),l("/StemV "+o.metadata.stemV),l("/Type /FontDescriptor"),l("/FontFile2 "+v+" 0 R"),l("/Flags 96"),l("/FontBBox "+e.API.PDFObject.convert(o.metadata.bbox)),l("/FontName /"+xu(o.fontName)),l("/ItalicAngle "+o.metadata.italicAngle),l("/Ascent "+o.metadata.ascender),l(">>"),l("endobj"),o.objectNumber=u();for(var g=0;g<o.metadata.hmtx.widths.length;g++)o.metadata.hmtx.widths[g]=parseInt(o.metadata.hmtx.widths[g]*(1e3/o.metadata.head.unitsPerEm));l("<</Subtype/TrueType/Type/Font/ToUnicode "+S+" 0 R/BaseFont/"+xu(o.fontName)+"/FontDescriptor "+x+" 0 R/Encoding/"+o.encoding+" /FirstChar 29 /LastChar 255 /Widths "+e.API.PDFObject.convert(o.metadata.hmtx.widths)+">>"),l("endobj"),o.isAlreadyPutted=!0}})(i)}]);var a=function(i){var s,o=i.text||"",l=i.x,u=i.y,c=i.options||{},f=i.mutex||{},p=f.pdfEscape,d=f.activeFontKey,v=f.fonts,S=d,x="",g=0,y="",_=v[S].encoding;if(v[S].encoding!=="Identity-H")return{text:o,x:l,y:u,options:c,mutex:f};for(y=o,S=d,Array.isArray(o)&&(y=o[0]),g=0;g<y.length;g+=1)v[S].metadata.hasOwnProperty("cmap")&&(s=v[S].metadata.cmap.unicode.codeMap[y[g].charCodeAt(0)]),s||y[g].charCodeAt(0)<256&&v[S].metadata.hasOwnProperty("Unicode")?x+=y[g]:x+="";var E="";return parseInt(S.slice(1))<14||_==="WinAnsiEncoding"?E=p(x,S).split("").map(function(D){return D.charCodeAt(0).toString(16)}).join(""):_==="Identity-H"&&(E=n(x,v[S])),f.isHex=!0,{text:E,x:l,y:u,options:c,mutex:f}};t.events.push(["postProcessText",function(i){var s=i.text||"",o=[],l={text:s,x:i.x,y:i.y,options:i.options,mutex:i.mutex};if(Array.isArray(s)){var u=0;for(u=0;u<s.length;u+=1)Array.isArray(s[u])&&s[u].length===3?o.push([a(Object.assign({},l,{text:s[u][0]})).text,s[u][1],s[u][2]]):o.push(a(Object.assign({},l,{text:s[u]})).text);i.text=o}else i.text=a(Object.assign({},l,{text:s})).text}])}(lt),function(e){var t=function(){return this.internal.vFS===void 0&&(this.internal.vFS={}),!0};e.existsFileInVFS=function(n){return t.call(this),this.internal.vFS[n]!==void 0},e.addFileToVFS=function(n,r){return t.call(this),this.internal.vFS[n]=r,this},e.getFileFromVFS=function(n){return t.call(this),this.internal.vFS[n]!==void 0?this.internal.vFS[n]:null}}(lt.API),function(e){e.__bidiEngine__=e.prototype.__bidiEngine__=function(r){var a,i,s,o,l,u,c,f=t,p=[[0,3,0,1,0,0,0],[0,3,0,1,2,2,0],[0,3,0,17,2,0,1],[0,3,5,5,4,1,0],[0,3,21,21,4,0,1],[0,3,5,5,4,2,0]],d=[[2,0,1,1,0,1,0],[2,0,1,1,0,2,0],[2,0,2,1,3,2,0],[2,0,2,33,3,1,1]],v={L:0,R:1,EN:2,AN:3,N:4,B:5,S:6},S={0:0,5:1,6:2,7:3,32:4,251:5,254:6,255:7},x=["(",")","(","<",">","<","[","]","[","{","}","{","«","»","«","‹","›","‹","⁅","⁆","⁅","⁽","⁾","⁽","₍","₎","₍","≤","≥","≤","〈","〉","〈","﹙","﹚","﹙","﹛","﹜","﹛","﹝","﹞","﹝","﹤","﹥","﹤"],g=new RegExp(/^([1-4|9]|1[0-9]|2[0-9]|3[0168]|4[04589]|5[012]|7[78]|159|16[0-9]|17[0-2]|21[569]|22[03489]|250)$/),y=!1,_=0;this.__bidiEngine__={};var E=function(T){var P=T.charCodeAt(),q=P>>8,Y=S[q];return Y!==void 0?f[256*Y+(255&P)]:q===252||q===253?"AL":g.test(q)?"L":q===8?"R":"N"},D=function(T){for(var P,q=0;q<T.length;q++){if((P=E(T.charAt(q)))==="L")return!1;if(P==="R")return!0}return!1},R=function(T,P,q,Y){var se,G,ne,Q,ie=P[Y];switch(ie){case"L":case"R":y=!1;break;case"N":case"AN":break;case"EN":y&&(ie="AN");break;case"AL":y=!0,ie="R";break;case"WS":ie="N";break;case"CS":Y<1||Y+1>=P.length||(se=q[Y-1])!=="EN"&&se!=="AN"||(G=P[Y+1])!=="EN"&&G!=="AN"?ie="N":y&&(G="AN"),ie=G===se?G:"N";break;case"ES":ie=(se=Y>0?q[Y-1]:"B")==="EN"&&Y+1<P.length&&P[Y+1]==="EN"?"EN":"N";break;case"ET":if(Y>0&&q[Y-1]==="EN"){ie="EN";break}if(y){ie="N";break}for(ne=Y+1,Q=P.length;ne<Q&&P[ne]==="ET";)ne++;ie=ne<Q&&P[ne]==="EN"?"EN":"N";break;case"NSM":if(s&&!o){for(Q=P.length,ne=Y+1;ne<Q&&P[ne]==="NSM";)ne++;if(ne<Q){var J=T[Y],le=J>=1425&&J<=2303||J===64286;if(se=P[ne],le&&(se==="R"||se==="AL")){ie="R";break}}}ie=Y<1||(se=P[Y-1])==="B"?"N":q[Y-1];break;case"B":y=!1,a=!0,ie=_;break;case"S":i=!0,ie="N";break;case"LRE":case"RLE":case"LRO":case"RLO":case"PDF":y=!1;break;case"BN":ie="N"}return ie},O=function(T,P,q){var Y=T.split("");return q&&j(Y,q,{hiLevel:_}),Y.reverse(),P&&P.reverse(),Y.join("")},j=function(T,P,q){var Y,se,G,ne,Q,ie=-1,J=T.length,le=0,L=[],z=_?d:p,W=[];for(y=!1,a=!1,i=!1,se=0;se<J;se++)W[se]=E(T[se]);for(G=0;G<J;G++){if(Q=le,L[G]=R(T,W,L,G),Y=240&(le=z[Q][v[L[G]]]),le&=15,P[G]=ne=z[le][5],Y>0)if(Y===16){for(se=ie;se<G;se++)P[se]=1;ie=-1}else ie=-1;if(z[le][6])ie===-1&&(ie=G);else if(ie>-1){for(se=ie;se<G;se++)P[se]=ne;ie=-1}W[G]==="B"&&(P[G]=0),q.hiLevel|=ne}i&&function(te,B,ee){for(var fe=0;fe<ee;fe++)if(te[fe]==="S"){B[fe]=_;for(var me=fe-1;me>=0&&te[me]==="WS";me--)B[me]=_}}(W,P,J)},$=function(T,P,q,Y,se){if(!(se.hiLevel<T)){if(T===1&&_===1&&!a)return P.reverse(),void(q&&q.reverse());for(var G,ne,Q,ie,J=P.length,le=0;le<J;){if(Y[le]>=T){for(Q=le+1;Q<J&&Y[Q]>=T;)Q++;for(ie=le,ne=Q-1;ie<ne;ie++,ne--)G=P[ie],P[ie]=P[ne],P[ne]=G,q&&(G=q[ie],q[ie]=q[ne],q[ne]=G);le=Q}le++}}},V=function(T,P,q){var Y=T.split(""),se={hiLevel:_};return q||(q=[]),j(Y,q,se),function(G,ne,Q){if(Q.hiLevel!==0&&c)for(var ie,J=0;J<G.length;J++)ne[J]===1&&(ie=x.indexOf(G[J]))>=0&&(G[J]=x[ie+1])}(Y,q,se),$(2,Y,P,q,se),$(1,Y,P,q,se),Y.join("")};return this.__bidiEngine__.doBidiReorder=function(T,P,q){if(function(se,G){if(G)for(var ne=0;ne<se.length;ne++)G[ne]=ne;o===void 0&&(o=D(se)),u===void 0&&(u=D(se))}(T,P),s||!l||u)if(s&&l&&o^u)_=o?1:0,T=O(T,P,q);else if(!s&&l&&u)_=o?1:0,T=V(T,P,q),T=O(T,P);else if(!s||o||l||u){if(s&&!l&&o^u)T=O(T,P),o?(_=0,T=V(T,P,q)):(_=1,T=V(T,P,q),T=O(T,P));else if(s&&o&&!l&&u)_=1,T=V(T,P,q),T=O(T,P);else if(!s&&!l&&o^u){var Y=c;o?(_=1,T=V(T,P,q),_=0,c=!1,T=V(T,P,q),c=Y):(_=0,T=V(T,P,q),T=O(T,P),_=1,c=!1,T=V(T,P,q),c=Y,T=O(T,P))}}else _=0,T=V(T,P,q);else _=o?1:0,T=V(T,P,q);return T},this.__bidiEngine__.setOptions=function(T){T&&(s=T.isInputVisual,l=T.isOutputVisual,o=T.isInputRtl,u=T.isOutputRtl,c=T.isSymmetricSwapping)},this.__bidiEngine__.setOptions(r),this.__bidiEngine__};var t=["BN","BN","BN","BN","BN","BN","BN","BN","BN","S","B","S","WS","B","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","B","B","B","S","WS","N","N","ET","ET","ET","N","N","N","N","N","ES","CS","ES","CS","CS","EN","EN","EN","EN","EN","EN","EN","EN","EN","EN","CS","N","N","N","N","N","N","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","N","N","N","N","N","N","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","N","N","N","N","BN","BN","BN","BN","BN","BN","B","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","CS","N","ET","ET","ET","ET","N","N","N","N","L","N","N","BN","N","N","ET","ET","EN","EN","N","L","N","N","N","EN","L","N","N","N","N","N","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","N","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","N","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","N","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","N","N","L","L","L","L","L","L","L","N","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","N","L","N","N","N","N","N","ET","N","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","R","NSM","R","NSM","NSM","R","NSM","NSM","R","NSM","N","N","N","N","N","N","N","N","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","N","N","N","N","N","R","R","R","R","R","N","N","N","N","N","N","N","N","N","N","N","AN","AN","AN","AN","AN","AN","N","N","AL","ET","ET","AL","CS","AL","N","N","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","AL","AL","N","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","AN","AN","AN","AN","AN","AN","AN","AN","AN","AN","ET","AN","AN","AL","AL","AL","NSM","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","NSM","NSM","NSM","NSM","NSM","NSM","NSM","AN","N","NSM","NSM","NSM","NSM","NSM","NSM","AL","AL","NSM","NSM","N","NSM","NSM","NSM","NSM","AL","AL","EN","EN","EN","EN","EN","EN","EN","EN","EN","EN","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","N","AL","AL","NSM","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","N","N","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","AL","N","N","N","N","N","N","N","N","N","N","N","N","N","N","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","R","R","N","N","N","N","R","N","N","N","N","N","WS","WS","WS","WS","WS","WS","WS","WS","WS","WS","WS","BN","BN","BN","L","R","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","WS","B","LRE","RLE","PDF","LRO","RLO","CS","ET","ET","ET","ET","ET","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","CS","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","WS","BN","BN","BN","BN","BN","N","LRI","RLI","FSI","PDI","BN","BN","BN","BN","BN","BN","EN","L","N","N","EN","EN","EN","EN","EN","EN","ES","ES","N","N","N","L","EN","EN","EN","EN","EN","EN","EN","EN","EN","EN","ES","ES","N","N","N","N","L","L","L","L","L","L","L","L","L","L","L","L","L","N","N","N","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","L","L","L","L","L","L","L","N","N","N","N","N","N","N","N","N","N","N","N","L","L","L","L","L","N","N","N","N","N","R","NSM","R","R","R","R","R","R","R","R","R","R","ES","R","R","R","R","R","R","R","R","R","R","R","R","R","N","R","R","R","R","R","N","R","N","R","R","N","R","R","N","R","R","R","R","R","R","R","R","R","R","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","CS","N","CS","N","N","CS","N","N","N","N","N","N","N","N","N","ET","N","N","ES","ES","N","N","N","N","N","ET","ET","N","N","N","N","N","AL","AL","AL","AL","AL","N","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","N","N","BN","N","N","N","ET","ET","ET","N","N","N","N","N","ES","CS","ES","CS","CS","EN","EN","EN","EN","EN","EN","EN","EN","EN","EN","CS","N","N","N","N","N","N","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","N","N","N","N","N","N","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","N","N","N","N","N","N","N","N","N","N","N","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","N","N","N","L","L","L","L","L","L","N","N","L","L","L","L","L","L","N","N","L","L","L","L","L","L","N","N","L","L","L","N","N","N","ET","ET","N","N","N","ET","ET","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N"],n=new e.__bidiEngine__({isInputVisual:!0});e.API.events.push(["postProcessText",function(r){var a=r.text;r.x,r.y;var i=r.options||{};r.mutex,i.lang;var s=[];if(i.isInputVisual=typeof i.isInputVisual!="boolean"||i.isInputVisual,n.setOptions(i),Object.prototype.toString.call(a)==="[object Array]"){var o=0;for(s=[],o=0;o<a.length;o+=1)Object.prototype.toString.call(a[o])==="[object Array]"?s.push([n.doBidiReorder(a[o][0]),a[o][1],a[o][2]]):s.push([n.doBidiReorder(a[o])]);r.text=s}else r.text=n.doBidiReorder(a);n.setOptions({isInputVisual:!0})}])}(lt),lt.API.TTFFont=function(){function e(t){var n;if(this.rawData=t,n=this.contents=new Io(t),this.contents.pos=4,n.readString(4)==="ttcf")throw new Error("TTCF not supported.");n.pos=0,this.parse(),this.subset=new _H(this),this.registerTTF()}return e.open=function(t){return new e(t)},e.prototype.parse=function(){return this.directory=new uH(this.contents),this.head=new fH(this),this.name=new gH(this),this.cmap=new XE(this),this.toUnicode={},this.hhea=new dH(this),this.maxp=new vH(this),this.hmtx=new yH(this),this.post=new pH(this),this.os2=new hH(this),this.loca=new SH(this),this.glyf=new bH(this),this.ascender=this.os2.exists&&this.os2.ascender||this.hhea.ascender,this.decender=this.os2.exists&&this.os2.decender||this.hhea.decender,this.lineGap=this.os2.exists&&this.os2.lineGap||this.hhea.lineGap,this.bbox=[this.head.xMin,this.head.yMin,this.head.xMax,this.head.yMax]},e.prototype.registerTTF=function(){var t,n,r,a,i;if(this.scaleFactor=1e3/this.head.unitsPerEm,this.bbox=(function(){var s,o,l,u;for(u=[],s=0,o=(l=this.bbox).length;s<o;s++)t=l[s],u.push(Math.round(t*this.scaleFactor));return u}).call(this),this.stemV=0,this.post.exists?(r=255&(a=this.post.italic_angle),32768&(n=a>>16)&&(n=-(1+(65535^n))),this.italicAngle=+(n+"."+r)):this.italicAngle=0,this.ascender=Math.round(this.ascender*this.scaleFactor),this.decender=Math.round(this.decender*this.scaleFactor),this.lineGap=Math.round(this.lineGap*this.scaleFactor),this.capHeight=this.os2.exists&&this.os2.capHeight||this.ascender,this.xHeight=this.os2.exists&&this.os2.xHeight||0,this.familyClass=(this.os2.exists&&this.os2.familyClass||0)>>8,this.isSerif=(i=this.familyClass)===1||i===2||i===3||i===4||i===5||i===7,this.isScript=this.familyClass===10,this.flags=0,this.post.isFixedPitch&&(this.flags|=1),this.isSerif&&(this.flags|=2),this.isScript&&(this.flags|=8),this.italicAngle!==0&&(this.flags|=64),this.flags|=32,!this.cmap.unicode)throw new Error("No unicode cmap for font")},e.prototype.characterToGlyph=function(t){var n;return((n=this.cmap.unicode)!=null?n.codeMap[t]:void 0)||0},e.prototype.widthOfGlyph=function(t){var n;return n=1e3/this.head.unitsPerEm,this.hmtx.forGlyph(t).advance*n},e.prototype.widthOfString=function(t,n,r){var a,i,s,o;for(s=0,i=0,o=(t=""+t).length;0<=o?i<o:i>o;i=0<=o?++i:--i)a=t.charCodeAt(i),s+=this.widthOfGlyph(this.characterToGlyph(a))+r*(1e3/n)||0;return s*(n/1e3)},e.prototype.lineHeight=function(t,n){var r;return n==null&&(n=!1),r=n?this.lineGap:0,(this.ascender+r-this.decender)/1e3*t},e}();var _i,Io=function(){function e(t){this.data=t??[],this.pos=0,this.length=this.data.length}return e.prototype.readByte=function(){return this.data[this.pos++]},e.prototype.writeByte=function(t){return this.data[this.pos++]=t},e.prototype.readUInt32=function(){return 16777216*this.readByte()+(this.readByte()<<16)+(this.readByte()<<8)+this.readByte()},e.prototype.writeUInt32=function(t){return this.writeByte(t>>>24&255),this.writeByte(t>>16&255),this.writeByte(t>>8&255),this.writeByte(255&t)},e.prototype.readInt32=function(){var t;return(t=this.readUInt32())>=2147483648?t-4294967296:t},e.prototype.writeInt32=function(t){return t<0&&(t+=4294967296),this.writeUInt32(t)},e.prototype.readUInt16=function(){return this.readByte()<<8|this.readByte()},e.prototype.writeUInt16=function(t){return this.writeByte(t>>8&255),this.writeByte(255&t)},e.prototype.readInt16=function(){var t;return(t=this.readUInt16())>=32768?t-65536:t},e.prototype.writeInt16=function(t){return t<0&&(t+=65536),this.writeUInt16(t)},e.prototype.readString=function(t){var n,r;for(r=[],n=0;0<=t?n<t:n>t;n=0<=t?++n:--n)r[n]=String.fromCharCode(this.readByte());return r.join("")},e.prototype.writeString=function(t){var n,r,a;for(a=[],n=0,r=t.length;0<=r?n<r:n>r;n=0<=r?++n:--n)a.push(this.writeByte(t.charCodeAt(n)));return a},e.prototype.readShort=function(){return this.readInt16()},e.prototype.writeShort=function(t){return this.writeInt16(t)},e.prototype.readLongLong=function(){var t,n,r,a,i,s,o,l;return t=this.readByte(),n=this.readByte(),r=this.readByte(),a=this.readByte(),i=this.readByte(),s=this.readByte(),o=this.readByte(),l=this.readByte(),128&t?-1*(72057594037927940*(255^t)+281474976710656*(255^n)+1099511627776*(255^r)+4294967296*(255^a)+16777216*(255^i)+65536*(255^s)+256*(255^o)+(255^l)+1):72057594037927940*t+281474976710656*n+1099511627776*r+4294967296*a+16777216*i+65536*s+256*o+l},e.prototype.writeLongLong=function(t){var n,r;return n=Math.floor(t/4294967296),r=4294967295&t,this.writeByte(n>>24&255),this.writeByte(n>>16&255),this.writeByte(n>>8&255),this.writeByte(255&n),this.writeByte(r>>24&255),this.writeByte(r>>16&255),this.writeByte(r>>8&255),this.writeByte(255&r)},e.prototype.readInt=function(){return this.readInt32()},e.prototype.writeInt=function(t){return this.writeInt32(t)},e.prototype.read=function(t){var n,r;for(n=[],r=0;0<=t?r<t:r>t;r=0<=t?++r:--r)n.push(this.readByte());return n},e.prototype.write=function(t){var n,r,a,i;for(i=[],r=0,a=t.length;r<a;r++)n=t[r],i.push(this.writeByte(n));return i},e}(),uH=function(){var e;function t(n){var r,a,i;for(this.scalarType=n.readInt(),this.tableCount=n.readShort(),this.searchRange=n.readShort(),this.entrySelector=n.readShort(),this.rangeShift=n.readShort(),this.tables={},a=0,i=this.tableCount;0<=i?a<i:a>i;a=0<=i?++a:--a)r={tag:n.readString(4),checksum:n.readInt(),offset:n.readInt(),length:n.readInt()},this.tables[r.tag]=r}return t.prototype.encode=function(n){var r,a,i,s,o,l,u,c,f,p,d,v,S;for(S in d=Object.keys(n).length,l=Math.log(2),f=16*Math.floor(Math.log(d)/l),s=Math.floor(f/l),c=16*d-f,(a=new Io).writeInt(this.scalarType),a.writeShort(d),a.writeShort(f),a.writeShort(s),a.writeShort(c),i=16*d,u=a.pos+i,o=null,v=[],n)for(p=n[S],a.writeString(S),a.writeInt(e(p)),a.writeInt(u),a.writeInt(p.length),v=v.concat(p),S==="head"&&(o=u),u+=p.length;u%4;)v.push(0),u++;return a.write(v),r=2981146554-e(a.data),a.pos=o+8,a.writeUInt32(r),a.data},e=function(n){var r,a,i,s;for(n=QE.call(n);n.length%4;)n.push(0);for(i=new Io(n),a=0,r=0,s=n.length;r<s;r=r+=4)a+=i.readUInt32();return 4294967295&a},t}(),cH={}.hasOwnProperty,Vi=function(e,t){for(var n in t)cH.call(t,n)&&(e[n]=t[n]);function r(){this.constructor=e}return r.prototype=t.prototype,e.prototype=new r,e.__super__=t.prototype,e};_i=function(){function e(t){var n;this.file=t,n=this.file.directory.tables[this.tag],this.exists=!!n,n&&(this.offset=n.offset,this.length=n.length,this.parse(this.file.contents))}return e.prototype.parse=function(){},e.prototype.encode=function(){},e.prototype.raw=function(){return this.exists?(this.file.contents.pos=this.offset,this.file.contents.read(this.length)):null},e}();var fH=function(e){function t(){return t.__super__.constructor.apply(this,arguments)}return Vi(t,_i),t.prototype.tag="head",t.prototype.parse=function(n){return n.pos=this.offset,this.version=n.readInt(),this.revision=n.readInt(),this.checkSumAdjustment=n.readInt(),this.magicNumber=n.readInt(),this.flags=n.readShort(),this.unitsPerEm=n.readShort(),this.created=n.readLongLong(),this.modified=n.readLongLong(),this.xMin=n.readShort(),this.yMin=n.readShort(),this.xMax=n.readShort(),this.yMax=n.readShort(),this.macStyle=n.readShort(),this.lowestRecPPEM=n.readShort(),this.fontDirectionHint=n.readShort(),this.indexToLocFormat=n.readShort(),this.glyphDataFormat=n.readShort()},t.prototype.encode=function(n){var r;return(r=new Io).writeInt(this.version),r.writeInt(this.revision),r.writeInt(this.checkSumAdjustment),r.writeInt(this.magicNumber),r.writeShort(this.flags),r.writeShort(this.unitsPerEm),r.writeLongLong(this.created),r.writeLongLong(this.modified),r.writeShort(this.xMin),r.writeShort(this.yMin),r.writeShort(this.xMax),r.writeShort(this.yMax),r.writeShort(this.macStyle),r.writeShort(this.lowestRecPPEM),r.writeShort(this.fontDirectionHint),r.writeShort(n),r.writeShort(this.glyphDataFormat),r.data},t}(),L3=function(){function e(t,n){var r,a,i,s,o,l,u,c,f,p,d,v,S,x,g,y,_;switch(this.platformID=t.readUInt16(),this.encodingID=t.readShort(),this.offset=n+t.readInt(),f=t.pos,t.pos=this.offset,this.format=t.readUInt16(),this.length=t.readUInt16(),this.language=t.readUInt16(),this.isUnicode=this.platformID===3&&this.encodingID===1&&this.format===4||this.platformID===0&&this.format===4,this.codeMap={},this.format){case 0:for(l=0;l<256;++l)this.codeMap[l]=t.readByte();break;case 4:for(d=t.readUInt16(),p=d/2,t.pos+=6,i=function(){var E,D;for(D=[],l=E=0;0<=p?E<p:E>p;l=0<=p?++E:--E)D.push(t.readUInt16());return D}(),t.pos+=2,S=function(){var E,D;for(D=[],l=E=0;0<=p?E<p:E>p;l=0<=p?++E:--E)D.push(t.readUInt16());return D}(),u=function(){var E,D;for(D=[],l=E=0;0<=p?E<p:E>p;l=0<=p?++E:--E)D.push(t.readUInt16());return D}(),c=function(){var E,D;for(D=[],l=E=0;0<=p?E<p:E>p;l=0<=p?++E:--E)D.push(t.readUInt16());return D}(),a=(this.length-t.pos+this.offset)/2,o=function(){var E,D;for(D=[],l=E=0;0<=a?E<a:E>a;l=0<=a?++E:--E)D.push(t.readUInt16());return D}(),l=g=0,_=i.length;g<_;l=++g)for(x=i[l],r=y=v=S[l];v<=x?y<=x:y>=x;r=v<=x?++y:--y)c[l]===0?s=r+u[l]:(s=o[c[l]/2+(r-v)-(p-l)]||0)!==0&&(s+=u[l]),this.codeMap[r]=65535&s}t.pos=f}return e.encode=function(t,n){var r,a,i,s,o,l,u,c,f,p,d,v,S,x,g,y,_,E,D,R,O,j,$,V,T,P,q,Y,se,G,ne,Q,ie,J,le,L,z,W,te,B,ee,fe,me,Se,we,je;switch(Y=new Io,s=Object.keys(t).sort(function(Ae,Me){return Ae-Me}),n){case"macroman":for(S=0,x=function(){var Ae=[];for(v=0;v<256;++v)Ae.push(0);return Ae}(),y={0:0},i={},se=0,ie=s.length;se<ie;se++)y[me=t[a=s[se]]]==null&&(y[me]=++S),i[a]={old:t[a],new:y[t[a]]},x[a]=y[t[a]];return Y.writeUInt16(1),Y.writeUInt16(0),Y.writeUInt32(12),Y.writeUInt16(0),Y.writeUInt16(262),Y.writeUInt16(0),Y.write(x),{charMap:i,subtable:Y.data,maxGlyphID:S+1};case"unicode":for(P=[],f=[],_=0,y={},r={},g=u=null,G=0,J=s.length;G<J;G++)y[D=t[a=s[G]]]==null&&(y[D]=++_),r[a]={old:D,new:y[D]},o=y[D]-a,g!=null&&o===u||(g&&f.push(g),P.push(a),u=o),g=a;for(g&&f.push(g),f.push(65535),P.push(65535),V=2*($=P.length),j=2*Math.pow(Math.log($)/Math.LN2,2),p=Math.log(j/2)/Math.LN2,O=2*$-j,l=[],R=[],d=[],v=ne=0,le=P.length;ne<le;v=++ne){if(T=P[v],c=f[v],T===65535){l.push(0),R.push(0);break}if(T-(q=r[T].new)>=32768)for(l.push(0),R.push(2*(d.length+$-v)),a=Q=T;T<=c?Q<=c:Q>=c;a=T<=c?++Q:--Q)d.push(r[a].new);else l.push(q-T),R.push(0)}for(Y.writeUInt16(3),Y.writeUInt16(1),Y.writeUInt32(12),Y.writeUInt16(4),Y.writeUInt16(16+8*$+2*d.length),Y.writeUInt16(0),Y.writeUInt16(V),Y.writeUInt16(j),Y.writeUInt16(p),Y.writeUInt16(O),ee=0,L=f.length;ee<L;ee++)a=f[ee],Y.writeUInt16(a);for(Y.writeUInt16(0),fe=0,z=P.length;fe<z;fe++)a=P[fe],Y.writeUInt16(a);for(Se=0,W=l.length;Se<W;Se++)o=l[Se],Y.writeUInt16(o);for(we=0,te=R.length;we<te;we++)E=R[we],Y.writeUInt16(E);for(je=0,B=d.length;je<B;je++)S=d[je],Y.writeUInt16(S);return{charMap:r,subtable:Y.data,maxGlyphID:_+1}}},e}(),XE=function(e){function t(){return t.__super__.constructor.apply(this,arguments)}return Vi(t,_i),t.prototype.tag="cmap",t.prototype.parse=function(n){var r,a,i;for(n.pos=this.offset,this.version=n.readUInt16(),i=n.readUInt16(),this.tables=[],this.unicode=null,a=0;0<=i?a<i:a>i;a=0<=i?++a:--a)r=new L3(n,this.offset),this.tables.push(r),r.isUnicode&&this.unicode==null&&(this.unicode=r);return!0},t.encode=function(n,r){var a,i;return r==null&&(r="macroman"),a=L3.encode(n,r),(i=new Io).writeUInt16(0),i.writeUInt16(1),a.table=i.data.concat(a.subtable),a},t}(),dH=function(e){function t(){return t.__super__.constructor.apply(this,arguments)}return Vi(t,_i),t.prototype.tag="hhea",t.prototype.parse=function(n){return n.pos=this.offset,this.version=n.readInt(),this.ascender=n.readShort(),this.decender=n.readShort(),this.lineGap=n.readShort(),this.advanceWidthMax=n.readShort(),this.minLeftSideBearing=n.readShort(),this.minRightSideBearing=n.readShort(),this.xMaxExtent=n.readShort(),this.caretSlopeRise=n.readShort(),this.caretSlopeRun=n.readShort(),this.caretOffset=n.readShort(),n.pos+=8,this.metricDataFormat=n.readShort(),this.numberOfMetrics=n.readUInt16()},t}(),hH=function(e){function t(){return t.__super__.constructor.apply(this,arguments)}return Vi(t,_i),t.prototype.tag="OS/2",t.prototype.parse=function(n){if(n.pos=this.offset,this.version=n.readUInt16(),this.averageCharWidth=n.readShort(),this.weightClass=n.readUInt16(),this.widthClass=n.readUInt16(),this.type=n.readShort(),this.ySubscriptXSize=n.readShort(),this.ySubscriptYSize=n.readShort(),this.ySubscriptXOffset=n.readShort(),this.ySubscriptYOffset=n.readShort(),this.ySuperscriptXSize=n.readShort(),this.ySuperscriptYSize=n.readShort(),this.ySuperscriptXOffset=n.readShort(),this.ySuperscriptYOffset=n.readShort(),this.yStrikeoutSize=n.readShort(),this.yStrikeoutPosition=n.readShort(),this.familyClass=n.readShort(),this.panose=function(){var r,a;for(a=[],r=0;r<10;++r)a.push(n.readByte());return a}(),this.charRange=function(){var r,a;for(a=[],r=0;r<4;++r)a.push(n.readInt());return a}(),this.vendorID=n.readString(4),this.selection=n.readShort(),this.firstCharIndex=n.readShort(),this.lastCharIndex=n.readShort(),this.version>0&&(this.ascent=n.readShort(),this.descent=n.readShort(),this.lineGap=n.readShort(),this.winAscent=n.readShort(),this.winDescent=n.readShort(),this.codePageRange=function(){var r,a;for(a=[],r=0;r<2;r=++r)a.push(n.readInt());return a}(),this.version>1))return this.xHeight=n.readShort(),this.capHeight=n.readShort(),this.defaultChar=n.readShort(),this.breakChar=n.readShort(),this.maxContext=n.readShort()},t}(),pH=function(e){function t(){return t.__super__.constructor.apply(this,arguments)}return Vi(t,_i),t.prototype.tag="post",t.prototype.parse=function(n){var r,a,i;switch(n.pos=this.offset,this.format=n.readInt(),this.italicAngle=n.readInt(),this.underlinePosition=n.readShort(),this.underlineThickness=n.readShort(),this.isFixedPitch=n.readInt(),this.minMemType42=n.readInt(),this.maxMemType42=n.readInt(),this.minMemType1=n.readInt(),this.maxMemType1=n.readInt(),this.format){case 65536:break;case 131072:var s;for(a=n.readUInt16(),this.glyphNameIndex=[],s=0;0<=a?s<a:s>a;s=0<=a?++s:--s)this.glyphNameIndex.push(n.readUInt16());for(this.names=[],i=[];n.pos<this.offset+this.length;)r=n.readByte(),i.push(this.names.push(n.readString(r)));return i;case 151552:return a=n.readUInt16(),this.offsets=n.read(a);case 196608:break;case 262144:return this.map=(function(){var o,l,u;for(u=[],s=o=0,l=this.file.maxp.numGlyphs;0<=l?o<l:o>l;s=0<=l?++o:--o)u.push(n.readUInt32());return u}).call(this)}},t}(),mH=function(e,t){this.raw=e,this.length=e.length,this.platformID=t.platformID,this.encodingID=t.encodingID,this.languageID=t.languageID},gH=function(e){function t(){return t.__super__.constructor.apply(this,arguments)}return Vi(t,_i),t.prototype.tag="name",t.prototype.parse=function(n){var r,a,i,s,o,l,u,c,f,p,d;for(n.pos=this.offset,n.readShort(),r=n.readShort(),l=n.readShort(),a=[],s=0;0<=r?s<r:s>r;s=0<=r?++s:--s)a.push({platformID:n.readShort(),encodingID:n.readShort(),languageID:n.readShort(),nameID:n.readShort(),length:n.readShort(),offset:this.offset+l+n.readShort()});for(u={},s=f=0,p=a.length;f<p;s=++f)i=a[s],n.pos=i.offset,c=n.readString(i.length),o=new mH(c,i),u[d=i.nameID]==null&&(u[d]=[]),u[i.nameID].push(o);this.strings=u,this.copyright=u[0],this.fontFamily=u[1],this.fontSubfamily=u[2],this.uniqueSubfamily=u[3],this.fontName=u[4],this.version=u[5];try{this.postscriptName=u[6][0].raw.replace(/[\x00-\x19\x80-\xff]/g,"")}catch{this.postscriptName=u[4][0].raw.replace(/[\x00-\x19\x80-\xff]/g,"")}return this.trademark=u[7],this.manufacturer=u[8],this.designer=u[9],this.description=u[10],this.vendorUrl=u[11],this.designerUrl=u[12],this.license=u[13],this.licenseUrl=u[14],this.preferredFamily=u[15],this.preferredSubfamily=u[17],this.compatibleFull=u[18],this.sampleText=u[19]},t}(),vH=function(e){function t(){return t.__super__.constructor.apply(this,arguments)}return Vi(t,_i),t.prototype.tag="maxp",t.prototype.parse=function(n){return n.pos=this.offset,this.version=n.readInt(),this.numGlyphs=n.readUInt16(),this.maxPoints=n.readUInt16(),this.maxContours=n.readUInt16(),this.maxCompositePoints=n.readUInt16(),this.maxComponentContours=n.readUInt16(),this.maxZones=n.readUInt16(),this.maxTwilightPoints=n.readUInt16(),this.maxStorage=n.readUInt16(),this.maxFunctionDefs=n.readUInt16(),this.maxInstructionDefs=n.readUInt16(),this.maxStackElements=n.readUInt16(),this.maxSizeOfInstructions=n.readUInt16(),this.maxComponentElements=n.readUInt16(),this.maxComponentDepth=n.readUInt16()},t}(),yH=function(e){function t(){return t.__super__.constructor.apply(this,arguments)}return Vi(t,_i),t.prototype.tag="hmtx",t.prototype.parse=function(n){var r,a,i,s,o,l,u;for(n.pos=this.offset,this.metrics=[],r=0,l=this.file.hhea.numberOfMetrics;0<=l?r<l:r>l;r=0<=l?++r:--r)this.metrics.push({advance:n.readUInt16(),lsb:n.readInt16()});for(i=this.file.maxp.numGlyphs-this.file.hhea.numberOfMetrics,this.leftSideBearings=function(){var c,f;for(f=[],r=c=0;0<=i?c<i:c>i;r=0<=i?++c:--c)f.push(n.readInt16());return f}(),this.widths=(function(){var c,f,p,d;for(d=[],c=0,f=(p=this.metrics).length;c<f;c++)s=p[c],d.push(s.advance);return d}).call(this),a=this.widths[this.widths.length-1],u=[],r=o=0;0<=i?o<i:o>i;r=0<=i?++o:--o)u.push(this.widths.push(a));return u},t.prototype.forGlyph=function(n){return n in this.metrics?this.metrics[n]:{advance:this.metrics[this.metrics.length-1].advance,lsb:this.leftSideBearings[n-this.metrics.length]}},t}(),QE=[].slice,bH=function(e){function t(){return t.__super__.constructor.apply(this,arguments)}return Vi(t,_i),t.prototype.tag="glyf",t.prototype.parse=function(){return this.cache={}},t.prototype.glyphFor=function(n){var r,a,i,s,o,l,u,c,f,p;return n in this.cache?this.cache[n]:(s=this.file.loca,r=this.file.contents,a=s.indexOf(n),(i=s.lengthOf(n))===0?this.cache[n]=null:(r.pos=this.offset+a,o=(l=new Io(r.read(i))).readShort(),c=l.readShort(),p=l.readShort(),u=l.readShort(),f=l.readShort(),this.cache[n]=o===-1?new xH(l,c,p,u,f):new wH(l,o,c,p,u,f),this.cache[n]))},t.prototype.encode=function(n,r,a){var i,s,o,l,u;for(o=[],s=[],l=0,u=r.length;l<u;l++)i=n[r[l]],s.push(o.length),i&&(o=o.concat(i.encode(a)));return s.push(o.length),{table:o,offsets:s}},t}(),wH=function(){function e(t,n,r,a,i,s){this.raw=t,this.numberOfContours=n,this.xMin=r,this.yMin=a,this.xMax=i,this.yMax=s,this.compound=!1}return e.prototype.encode=function(){return this.raw.data},e}(),xH=function(){function e(t,n,r,a,i){var s,o;for(this.raw=t,this.xMin=n,this.yMin=r,this.xMax=a,this.yMax=i,this.compound=!0,this.glyphIDs=[],this.glyphOffsets=[],s=this.raw;o=s.readShort(),this.glyphOffsets.push(s.pos),this.glyphIDs.push(s.readUInt16()),32&o;)s.pos+=1&o?4:2,128&o?s.pos+=8:64&o?s.pos+=4:8&o&&(s.pos+=2)}return e.prototype.encode=function(){var t,n,r;for(n=new Io(QE.call(this.raw.data)),t=0,r=this.glyphIDs.length;t<r;++t)n.pos=this.glyphOffsets[t];return n.data},e}(),SH=function(e){function t(){return t.__super__.constructor.apply(this,arguments)}return Vi(t,_i),t.prototype.tag="loca",t.prototype.parse=function(n){var r,a;return n.pos=this.offset,r=this.file.head.indexToLocFormat,this.offsets=r===0?(function(){var i,s;for(s=[],a=0,i=this.length;a<i;a+=2)s.push(2*n.readUInt16());return s}).call(this):(function(){var i,s;for(s=[],a=0,i=this.length;a<i;a+=4)s.push(n.readUInt32());return s}).call(this)},t.prototype.indexOf=function(n){return this.offsets[n]},t.prototype.lengthOf=function(n){return this.offsets[n+1]-this.offsets[n]},t.prototype.encode=function(n,r){for(var a=new Uint32Array(this.offsets.length),i=0,s=0,o=0;o<a.length;++o)if(a[o]=i,s<r.length&&r[s]==o){++s,a[o]=i;var l=this.offsets[o],u=this.offsets[o+1]-l;u>0&&(i+=u)}for(var c=new Array(4*a.length),f=0;f<a.length;++f)c[4*f+3]=255&a[f],c[4*f+2]=(65280&a[f])>>8,c[4*f+1]=(16711680&a[f])>>16,c[4*f]=(4278190080&a[f])>>24;return c},t}(),_H=function(){function e(t){this.font=t,this.subset={},this.unicodes={},this.next=33}return e.prototype.generateCmap=function(){var t,n,r,a,i;for(n in a=this.font.cmap.tables[0].codeMap,t={},i=this.subset)r=i[n],t[n]=a[r];return t},e.prototype.glyphsFor=function(t){var n,r,a,i,s,o,l;for(a={},s=0,o=t.length;s<o;s++)a[i=t[s]]=this.font.glyf.glyphFor(i);for(i in n=[],a)(r=a[i])!=null&&r.compound&&n.push.apply(n,r.glyphIDs);if(n.length>0)for(i in l=this.glyphsFor(n))r=l[i],a[i]=r;return a},e.prototype.encode=function(t,n){var r,a,i,s,o,l,u,c,f,p,d,v,S,x,g;for(a in r=XE.encode(this.generateCmap(),"unicode"),s=this.glyphsFor(t),d={0:0},g=r.charMap)d[(l=g[a]).old]=l.new;for(v in p=r.maxGlyphID,s)v in d||(d[v]=p++);return c=function(y){var _,E;for(_ in E={},y)E[y[_]]=_;return E}(d),f=Object.keys(c).sort(function(y,_){return y-_}),S=function(){var y,_,E;for(E=[],y=0,_=f.length;y<_;y++)o=f[y],E.push(c[o]);return E}(),i=this.font.glyf.encode(s,S,d),u=this.font.loca.encode(i.offsets,S),x={cmap:this.font.cmap.raw(),glyf:i.table,loca:u,hmtx:this.font.hmtx.raw(),hhea:this.font.hhea.raw(),maxp:this.font.maxp.raw(),post:this.font.post.raw(),name:this.font.name.raw(),head:this.font.head.encode(n)},this.font.os2.exists&&(x["OS/2"]=this.font.os2.raw()),this.font.directory.encode(x)},e}();lt.API.PDFObject=function(){var e;function t(){}return e=function(n,r){return(Array(r+1).join("0")+n).slice(-r)},t.convert=function(n){var r,a,i,s;if(Array.isArray(n))return"["+function(){var o,l,u;for(u=[],o=0,l=n.length;o<l;o++)r=n[o],u.push(t.convert(r));return u}().join(" ")+"]";if(typeof n=="string")return"/"+n;if(n!=null&&n.isString)return"("+n+")";if(n instanceof Date)return"(D:"+e(n.getUTCFullYear(),4)+e(n.getUTCMonth(),2)+e(n.getUTCDate(),2)+e(n.getUTCHours(),2)+e(n.getUTCMinutes(),2)+e(n.getUTCSeconds(),2)+"Z)";if({}.toString.call(n)==="[object Object]"){for(a in i=["<<"],n)s=n[a],i.push("/"+a+" "+t.convert(s));return i.push(">>"),i.join(`
358
+ `)}return""+n},t}();function ZE(e,t,n,r,a){r=r||{};var i=1.15,s=a.internal.scaleFactor,o=a.internal.getFontSize()/s,l=a.getLineHeightFactor?a.getLineHeightFactor():i,u=o*l,c=/\r\n|\r|\n/g,f="",p=1;if((r.valign==="middle"||r.valign==="bottom"||r.halign==="center"||r.halign==="right")&&(f=typeof e=="string"?e.split(c):e,p=f.length||1),n+=o*(2-i),r.valign==="middle"?n-=p/2*u:r.valign==="bottom"&&(n-=p*u),r.halign==="center"||r.halign==="right"){var d=o;if(r.halign==="center"&&(d*=.5),f&&p>=1){for(var v=0;v<f.length;v++)a.text(f[v],t-a.getStringUnitWidth(f[v])*d,n),n+=u;return a}t-=a.getStringUnitWidth(e)*d}return r.halign==="justify"?a.text(e,t,n,{maxWidth:r.maxWidth||100,align:"justify"}):a.text(e,t,n),a}var j3={},Zu=function(){function e(t){this.jsPDFDocument=t,this.userStyles={textColor:t.getTextColor?this.jsPDFDocument.getTextColor():0,fontSize:t.internal.getFontSize(),fontStyle:t.internal.getFont().fontStyle,font:t.internal.getFont().fontName,lineWidth:t.getLineWidth?this.jsPDFDocument.getLineWidth():0,lineColor:t.getDrawColor?this.jsPDFDocument.getDrawColor():0}}return e.setDefaults=function(t,n){n===void 0&&(n=null),n?n.__autoTableDocumentDefaults=t:j3=t},e.unifyColor=function(t){return Array.isArray(t)?t:typeof t=="number"?[t,t,t]:typeof t=="string"?[t]:null},e.prototype.applyStyles=function(t,n){var r,a,i;n===void 0&&(n=!1),t.fontStyle&&this.jsPDFDocument.setFontStyle&&this.jsPDFDocument.setFontStyle(t.fontStyle);var s=this.jsPDFDocument.internal.getFont(),o=s.fontStyle,l=s.fontName;if(t.font&&(l=t.font),t.fontStyle){o=t.fontStyle;var u=this.getFontList()[l];u&&u.indexOf(o)===-1&&this.jsPDFDocument.setFontStyle&&(this.jsPDFDocument.setFontStyle(u[0]),o=u[0])}if(this.jsPDFDocument.setFont(l,o),t.fontSize&&this.jsPDFDocument.setFontSize(t.fontSize),!n){var c=e.unifyColor(t.fillColor);c&&(r=this.jsPDFDocument).setFillColor.apply(r,c),c=e.unifyColor(t.textColor),c&&(a=this.jsPDFDocument).setTextColor.apply(a,c),c=e.unifyColor(t.lineColor),c&&(i=this.jsPDFDocument).setDrawColor.apply(i,c),typeof t.lineWidth=="number"&&this.jsPDFDocument.setLineWidth(t.lineWidth)}},e.prototype.splitTextToSize=function(t,n,r){return this.jsPDFDocument.splitTextToSize(t,n,r)},e.prototype.rect=function(t,n,r,a,i){return this.jsPDFDocument.rect(t,n,r,a,i)},e.prototype.getLastAutoTable=function(){return this.jsPDFDocument.lastAutoTable||null},e.prototype.getTextWidth=function(t){return this.jsPDFDocument.getTextWidth(t)},e.prototype.getDocument=function(){return this.jsPDFDocument},e.prototype.setPage=function(t){this.jsPDFDocument.setPage(t)},e.prototype.addPage=function(){return this.jsPDFDocument.addPage()},e.prototype.getFontList=function(){return this.jsPDFDocument.getFontList()},e.prototype.getGlobalOptions=function(){return j3||{}},e.prototype.getDocumentOptions=function(){return this.jsPDFDocument.__autoTableDocumentDefaults||{}},e.prototype.pageSize=function(){var t=this.jsPDFDocument.internal.pageSize;return t.width==null&&(t={width:t.getWidth(),height:t.getHeight()}),t},e.prototype.scaleFactor=function(){return this.jsPDFDocument.internal.scaleFactor},e.prototype.getLineHeightFactor=function(){var t=this.jsPDFDocument;return t.getLineHeightFactor?t.getLineHeightFactor():1.15},e.prototype.getLineHeight=function(t){return t/this.scaleFactor()*this.getLineHeightFactor()},e.prototype.pageNumber=function(){var t=this.jsPDFDocument.internal.getCurrentPageInfo();return t?t.pageNumber:this.jsPDFDocument.internal.getNumberOfPages()},e}(),my=function(e,t){return my=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,r){n.__proto__=r}||function(n,r){for(var a in r)Object.prototype.hasOwnProperty.call(r,a)&&(n[a]=r[a])},my(e,t)};function e8(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");my(e,t);function n(){this.constructor=e}e.prototype=t===null?Object.create(t):(n.prototype=t.prototype,new n)}var t8=function(e){e8(t,e);function t(n){var r=e.call(this)||this;return r._element=n,r}return t}(Array);function AH(e){return{font:"helvetica",fontStyle:"normal",overflow:"linebreak",fillColor:!1,textColor:20,halign:"left",valign:"top",fontSize:10,cellPadding:5/e,lineColor:200,lineWidth:0,cellWidth:"auto",minCellHeight:0,minCellWidth:0}}function NH(e){var t={striped:{table:{fillColor:255,textColor:80,fontStyle:"normal"},head:{textColor:255,fillColor:[41,128,185],fontStyle:"bold"},body:{},foot:{textColor:255,fillColor:[41,128,185],fontStyle:"bold"},alternateRow:{fillColor:245}},grid:{table:{fillColor:255,textColor:80,fontStyle:"normal",lineWidth:.1},head:{textColor:255,fillColor:[26,188,156],fontStyle:"bold",lineWidth:0},body:{},foot:{textColor:255,fillColor:[26,188,156],fontStyle:"bold",lineWidth:0},alternateRow:{}},plain:{head:{fontStyle:"bold"},foot:{fontStyle:"bold"}}};return t[e]}function Jm(e,t,n){n.applyStyles(t,!0);var r=Array.isArray(e)?e:[e],a=r.map(function(i){return n.getTextWidth(i)}).reduce(function(i,s){return Math.max(i,s)},0);return a}function n8(e,t,n,r){var a=t.settings.tableLineWidth,i=t.settings.tableLineColor;e.applyStyles({lineWidth:a,lineColor:i});var s=r8(a,!1);s&&e.rect(n.x,n.y,t.getWidth(e.pageSize().width),r.y-n.y,s)}function r8(e,t){var n=e>0,r=t||t===0;return n&&r?"DF":n?"S":r?"F":null}function i0(e,t){var n,r,a,i;if(e=e||t,Array.isArray(e)){if(e.length>=4)return{top:e[0],right:e[1],bottom:e[2],left:e[3]};if(e.length===3)return{top:e[0],right:e[1],bottom:e[2],left:e[1]};if(e.length===2)return{top:e[0],right:e[1],bottom:e[0],left:e[1]};e.length===1?e=e[0]:e=t}return typeof e=="object"?(typeof e.vertical=="number"&&(e.top=e.vertical,e.bottom=e.vertical),typeof e.horizontal=="number"&&(e.right=e.horizontal,e.left=e.horizontal),{left:(n=e.left)!==null&&n!==void 0?n:t,top:(r=e.top)!==null&&r!==void 0?r:t,right:(a=e.right)!==null&&a!==void 0?a:t,bottom:(i=e.bottom)!==null&&i!==void 0?i:t}):(typeof e!="number"&&(e=t),{top:e,right:e,bottom:e,left:e})}function a8(e,t){var n=i0(t.settings.margin,0);return e.pageSize().width-(n.left+n.right)}function EH(e,t,n,r,a){var i={},s=1.3333333333333333,o=i2(t,function(_){return a.getComputedStyle(_).backgroundColor});o!=null&&(i.fillColor=o);var l=i2(t,function(_){return a.getComputedStyle(_).color});l!=null&&(i.textColor=l);var u=LH(r,n);u&&(i.cellPadding=u);var c="borderTopColor",f=s*n,p=r.borderTopWidth;if(r.borderBottomWidth===p&&r.borderRightWidth===p&&r.borderLeftWidth===p){var d=(parseFloat(p)||0)/f;d&&(i.lineWidth=d)}else i.lineWidth={top:(parseFloat(r.borderTopWidth)||0)/f,right:(parseFloat(r.borderRightWidth)||0)/f,bottom:(parseFloat(r.borderBottomWidth)||0)/f,left:(parseFloat(r.borderLeftWidth)||0)/f},i.lineWidth.top||(i.lineWidth.right?c="borderRightColor":i.lineWidth.bottom?c="borderBottomColor":i.lineWidth.left&&(c="borderLeftColor"));var v=i2(t,function(_){return a.getComputedStyle(_)[c]});v!=null&&(i.lineColor=v);var S=["left","right","center","justify"];S.indexOf(r.textAlign)!==-1&&(i.halign=r.textAlign),S=["middle","bottom","top"],S.indexOf(r.verticalAlign)!==-1&&(i.valign=r.verticalAlign);var x=parseInt(r.fontSize||"");isNaN(x)||(i.fontSize=x/s);var g=CH(r);g&&(i.fontStyle=g);var y=(r.fontFamily||"").toLowerCase();return e.indexOf(y)!==-1&&(i.font=y),i}function CH(e){var t="";return(e.fontWeight==="bold"||e.fontWeight==="bolder"||parseInt(e.fontWeight)>=700)&&(t="bold"),(e.fontStyle==="italic"||e.fontStyle==="oblique")&&(t+="italic"),t}function i2(e,t){var n=i8(e,t);if(!n)return null;var r=n.match(/^rgba?\((\d+),\s*(\d+),\s*(\d+)(?:,\s*(\d*\.?\d*))?\)$/);if(!r||!Array.isArray(r))return null;var a=[parseInt(r[1]),parseInt(r[2]),parseInt(r[3])],i=parseInt(r[4]);return i===0||isNaN(a[0])||isNaN(a[1])||isNaN(a[2])?null:a}function i8(e,t){var n=t(e);return n==="rgba(0, 0, 0, 0)"||n==="transparent"||n==="initial"||n==="inherit"?e.parentElement==null?null:i8(e.parentElement,t):n}function LH(e,t){var n=[e.paddingTop,e.paddingRight,e.paddingBottom,e.paddingLeft],r=96/(72/t),a=(parseInt(e.lineHeight)-parseInt(e.fontSize))/t/2,i=n.map(function(o){return parseInt(o||"0")/r}),s=i0(i,0);return a>s.top&&(s.top=a),a>s.bottom&&(s.bottom=a),s}function s8(e,t,n,r,a){var i,s;r===void 0&&(r=!1),a===void 0&&(a=!1);var o;typeof t=="string"?o=n.document.querySelector(t):o=t;var l=Object.keys(e.getFontList()),u=e.scaleFactor(),c=[],f=[],p=[];if(!o)return console.error("Html table could not be found with input: ",t),{head:c,body:f,foot:p};for(var d=0;d<o.rows.length;d++){var v=o.rows[d],S=(s=(i=v==null?void 0:v.parentElement)===null||i===void 0?void 0:i.tagName)===null||s===void 0?void 0:s.toLowerCase(),x=jH(l,u,n,v,r,a);x&&(S==="thead"?c.push(x):S==="tfoot"?p.push(x):f.push(x))}return{head:c,body:f,foot:p}}function jH(e,t,n,r,a,i){for(var s=new t8(r),o=0;o<r.cells.length;o++){var l=r.cells[o],u=n.getComputedStyle(l);if(a||u.display!=="none"){var c=void 0;i&&(c=EH(e,l,t,u,n)),s.push({rowSpan:l.rowSpan,colSpan:l.colSpan,styles:c,_element:l,content:TH(l)})}}var f=n.getComputedStyle(r);if(s.length>0&&(a||f.display!=="none"))return s}function TH(e){var t=e.cloneNode(!0);return t.innerHTML=t.innerHTML.replace(/\n/g,"").replace(/ +/g," "),t.innerHTML=t.innerHTML.split(/<br.*?>/).map(function(n){return n.trim()}).join(`
359
+ `),t.innerText||t.textContent||""}function OH(e,t,n){for(var r=0,a=[e,t,n];r<a.length;r++){var i=a[r];i&&typeof i!="object"&&console.error("The options parameter should be of type object, is: "+typeof i),i.startY&&typeof i.startY!="number"&&(console.error("Invalid value for startY option",i.startY),delete i.startY)}}function vs(e,t,n,r,a){if(e==null)throw new TypeError("Cannot convert undefined or null to object");for(var i=Object(e),s=1;s<arguments.length;s++){var o=arguments[s];if(o!=null)for(var l in o)Object.prototype.hasOwnProperty.call(o,l)&&(i[l]=o[l])}return i}function o8(e,t){var n=new Zu(e),r=n.getDocumentOptions(),a=n.getGlobalOptions();OH(a,r,t);var i=vs({},a,r,t),s;typeof window<"u"&&(s=window);var o=DH(a,r,t),l=RH(a,r,t),u=MH(n,i),c=PH(n,i,s);return{id:t.tableId,content:c,hooks:l,styles:o,settings:u}}function DH(e,t,n){for(var r={styles:{},headStyles:{},bodyStyles:{},footStyles:{},alternateRowStyles:{},columnStyles:{}},a=function(l){if(l==="columnStyles"){var u=e[l],c=t[l],f=n[l];r.columnStyles=vs({},u,c,f)}else{var p=[e,t,n],d=p.map(function(v){return v[l]||{}});r[l]=vs({},d[0],d[1],d[2])}},i=0,s=Object.keys(r);i<s.length;i++){var o=s[i];a(o)}return r}function RH(e,t,n){for(var r=[e,t,n],a={didParseCell:[],willDrawCell:[],didDrawCell:[],willDrawPage:[],didDrawPage:[]},i=0,s=r;i<s.length;i++){var o=s[i];o.didParseCell&&a.didParseCell.push(o.didParseCell),o.willDrawCell&&a.willDrawCell.push(o.willDrawCell),o.didDrawCell&&a.didDrawCell.push(o.didDrawCell),o.willDrawPage&&a.willDrawPage.push(o.willDrawPage),o.didDrawPage&&a.didDrawPage.push(o.didDrawPage)}return a}function MH(e,t){var n,r,a,i,s,o,l,u,c,f,p,d,v=i0(t.margin,40/e.scaleFactor()),S=(n=kH(e,t.startY))!==null&&n!==void 0?n:v.top,x;t.showFoot===!0?x="everyPage":t.showFoot===!1?x="never":x=(r=t.showFoot)!==null&&r!==void 0?r:"everyPage";var g;t.showHead===!0?g="everyPage":t.showHead===!1?g="never":g=(a=t.showHead)!==null&&a!==void 0?a:"everyPage";var y=(i=t.useCss)!==null&&i!==void 0?i:!1,_=t.theme||(y?"plain":"striped"),E=!!t.horizontalPageBreak,D=(s=t.horizontalPageBreakRepeat)!==null&&s!==void 0?s:null;return{includeHiddenHtml:(o=t.includeHiddenHtml)!==null&&o!==void 0?o:!1,useCss:y,theme:_,startY:S,margin:v,pageBreak:(l=t.pageBreak)!==null&&l!==void 0?l:"auto",rowPageBreak:(u=t.rowPageBreak)!==null&&u!==void 0?u:"auto",tableWidth:(c=t.tableWidth)!==null&&c!==void 0?c:"auto",showHead:g,showFoot:x,tableLineWidth:(f=t.tableLineWidth)!==null&&f!==void 0?f:0,tableLineColor:(p=t.tableLineColor)!==null&&p!==void 0?p:200,horizontalPageBreak:E,horizontalPageBreakRepeat:D,horizontalPageBreakBehaviour:(d=t.horizontalPageBreakBehaviour)!==null&&d!==void 0?d:"afterAllRows"}}function kH(e,t){var n=e.getLastAutoTable(),r=e.scaleFactor(),a=e.pageNumber(),i=!1;if(n&&n.startPageNumber){var s=n.startPageNumber+n.pageNumber-1;i=s===a}return typeof t=="number"?t:(t==null||t===!1)&&i&&(n==null?void 0:n.finalY)!=null?n.finalY+20/r:null}function PH(e,t,n){var r=t.head||[],a=t.body||[],i=t.foot||[];if(t.html){var s=t.includeHiddenHtml;if(n){var o=s8(e,t.html,n,s,t.useCss)||{};r=o.head||r,a=o.body||r,i=o.foot||r}else console.error("Cannot parse html in non browser environment")}var l=t.columns||IH(r,a,i);return{columns:l,head:r,body:a,foot:i}}function IH(e,t,n){var r=e[0]||t[0]||n[0]||[],a=[];return Object.keys(r).filter(function(i){return i!=="_element"}).forEach(function(i){var s=1,o;Array.isArray(r)?o=r[parseInt(i)]:o=r[i],typeof o=="object"&&!Array.isArray(o)&&(s=(o==null?void 0:o.colSpan)||1);for(var l=0;l<s;l++){var u=void 0;Array.isArray(r)?u=a.length:u=i+(l>0?"_".concat(l):"");var c={dataKey:u};a.push(c)}}),a}var gy=function(){function e(t,n,r){this.table=n,this.pageNumber=n.pageNumber,this.settings=n.settings,this.cursor=r,this.doc=t.getDocument()}return e}(),FH=function(e){e8(t,e);function t(n,r,a,i,s,o){var l=e.call(this,n,r,o)||this;return l.cell=a,l.row=i,l.column=s,l.section=i.section,l}return t}(gy),BH=function(){function e(t,n){this.pageNumber=1,this.id=t.id,this.settings=t.settings,this.styles=t.styles,this.hooks=t.hooks,this.columns=n.columns,this.head=n.head,this.body=n.body,this.foot=n.foot}return e.prototype.getHeadHeight=function(t){return this.head.reduce(function(n,r){return n+r.getMaxCellHeight(t)},0)},e.prototype.getFootHeight=function(t){return this.foot.reduce(function(n,r){return n+r.getMaxCellHeight(t)},0)},e.prototype.allRows=function(){return this.head.concat(this.body).concat(this.foot)},e.prototype.callCellHooks=function(t,n,r,a,i,s){for(var o=0,l=n;o<l.length;o++){var u=l[o],c=new FH(t,this,r,a,i,s),f=u(c)===!1;if(r.text=Array.isArray(r.text)?r.text:[r.text],f)return!1}return!0},e.prototype.callEndPageHooks=function(t,n){t.applyStyles(t.userStyles);for(var r=0,a=this.hooks.didDrawPage;r<a.length;r++){var i=a[r];i(new gy(t,this,n))}},e.prototype.callWillDrawPageHooks=function(t,n){for(var r=0,a=this.hooks.willDrawPage;r<a.length;r++){var i=a[r];i(new gy(t,this,n))}},e.prototype.getWidth=function(t){if(typeof this.settings.tableWidth=="number")return this.settings.tableWidth;if(this.settings.tableWidth==="wrap"){var n=this.columns.reduce(function(a,i){return a+i.wrappedWidth},0);return n}else{var r=this.settings.margin;return t-r.left-r.right}},e}(),l8=function(){function e(t,n,r,a,i){i===void 0&&(i=!1),this.height=0,this.raw=t,t instanceof t8&&(this.raw=t._element,this.element=t._element),this.index=n,this.section=r,this.cells=a,this.spansMultiplePages=i}return e.prototype.getMaxCellHeight=function(t){var n=this;return t.reduce(function(r,a){var i;return Math.max(r,((i=n.cells[a.index])===null||i===void 0?void 0:i.height)||0)},0)},e.prototype.hasRowSpan=function(t){var n=this;return t.filter(function(r){var a=n.cells[r.index];return a?a.rowSpan>1:!1}).length>0},e.prototype.canEntireRowFit=function(t,n){return this.getMaxCellHeight(n)<=t},e.prototype.getMinimumRowHeight=function(t,n){var r=this;return t.reduce(function(a,i){var s=r.cells[i.index];if(!s)return 0;var o=n.getLineHeight(s.styles.fontSize),l=s.padding("vertical"),u=l+o;return u>a?u:a},0)},e}(),u8=function(){function e(t,n,r){var a;this.contentHeight=0,this.contentWidth=0,this.wrappedWidth=0,this.minReadableWidth=0,this.minWidth=0,this.width=0,this.height=0,this.x=0,this.y=0,this.styles=n,this.section=r,this.raw=t;var i=t;t!=null&&typeof t=="object"&&!Array.isArray(t)?(this.rowSpan=t.rowSpan||1,this.colSpan=t.colSpan||1,i=(a=t.content)!==null&&a!==void 0?a:t,t._element&&(this.raw=t._element)):(this.rowSpan=1,this.colSpan=1);var s=i!=null?""+i:"",o=/\r\n|\r|\n/g;this.text=s.split(o)}return e.prototype.getTextPos=function(){var t;if(this.styles.valign==="top")t=this.y+this.padding("top");else if(this.styles.valign==="bottom")t=this.y+this.height-this.padding("bottom");else{var n=this.height-this.padding("vertical");t=this.y+n/2+this.padding("top")}var r;if(this.styles.halign==="right")r=this.x+this.width-this.padding("right");else if(this.styles.halign==="center"){var a=this.width-this.padding("horizontal");r=this.x+a/2+this.padding("left")}else r=this.x+this.padding("left");return{x:r,y:t}},e.prototype.getContentHeight=function(t,n){n===void 0&&(n=1.15);var r=Array.isArray(this.text)?this.text.length:1,a=this.styles.fontSize/t*n,i=r*a+this.padding("vertical");return Math.max(i,this.styles.minCellHeight)},e.prototype.padding=function(t){var n=i0(this.styles.cellPadding,0);return t==="vertical"?n.top+n.bottom:t==="horizontal"?n.left+n.right:n[t]},e}(),$H=function(){function e(t,n,r){this.wrappedWidth=0,this.minReadableWidth=0,this.minWidth=0,this.width=0,this.dataKey=t,this.raw=n,this.index=r}return e.prototype.getMaxCustomCellWidth=function(t){for(var n=0,r=0,a=t.allRows();r<a.length;r++){var i=a[r],s=i.cells[this.index];s&&typeof s.styles.cellWidth=="number"&&(n=Math.max(n,s.styles.cellWidth))}return n},e}();function UH(e,t){zH(e,t);var n=[],r=0;t.columns.forEach(function(i){var s=i.getMaxCustomCellWidth(t);s?i.width=s:(i.width=i.wrappedWidth,n.push(i)),r+=i.width});var a=t.getWidth(e.pageSize().width)-r;a&&(a=vy(n,a,function(i){return Math.max(i.minReadableWidth,i.minWidth)})),a&&(a=vy(n,a,function(i){return i.minWidth})),a=Math.abs(a),!t.settings.horizontalPageBreak&&a>.1/e.scaleFactor()&&(a=a<1?a:Math.round(a),console.warn("Of the table content, ".concat(a," units width could not fit page"))),HH(t),VH(t,e),qH(t)}function zH(e,t){var n=e.scaleFactor(),r=t.settings.horizontalPageBreak,a=a8(e,t);t.allRows().forEach(function(i){for(var s=0,o=t.columns;s<o.length;s++){var l=o[s],u=i.cells[l.index];if(u){var c=t.hooks.didParseCell;t.callCellHooks(e,c,u,i,l,null);var f=u.padding("horizontal");u.contentWidth=Jm(u.text,u.styles,e)+f;var p=Jm(u.text.join(" ").split(/[^\S\u00A0]+/),u.styles,e);if(u.minReadableWidth=p+u.padding("horizontal"),typeof u.styles.cellWidth=="number")u.minWidth=u.styles.cellWidth,u.wrappedWidth=u.styles.cellWidth;else if(u.styles.cellWidth==="wrap"||r===!0)u.contentWidth>a?(u.minWidth=a,u.wrappedWidth=a):(u.minWidth=u.contentWidth,u.wrappedWidth=u.contentWidth);else{var d=10/n;u.minWidth=u.styles.minCellWidth||d,u.wrappedWidth=u.contentWidth,u.minWidth>u.wrappedWidth&&(u.wrappedWidth=u.minWidth)}}}}),t.allRows().forEach(function(i){for(var s=0,o=t.columns;s<o.length;s++){var l=o[s],u=i.cells[l.index];if(u&&u.colSpan===1)l.wrappedWidth=Math.max(l.wrappedWidth,u.wrappedWidth),l.minWidth=Math.max(l.minWidth,u.minWidth),l.minReadableWidth=Math.max(l.minReadableWidth,u.minReadableWidth);else{var c=t.styles.columnStyles[l.dataKey]||t.styles.columnStyles[l.index]||{},f=c.cellWidth||c.minCellWidth;f&&typeof f=="number"&&(l.minWidth=f,l.wrappedWidth=f)}u&&(u.colSpan>1&&!l.minWidth&&(l.minWidth=u.minWidth),u.colSpan>1&&!l.wrappedWidth&&(l.wrappedWidth=u.minWidth))}})}function vy(e,t,n){for(var r=t,a=e.reduce(function(d,v){return d+v.wrappedWidth},0),i=0;i<e.length;i++){var s=e[i],o=s.wrappedWidth/a,l=r*o,u=s.width+l,c=n(s),f=u<c?c:u;t-=f-s.width,s.width=f}if(t=Math.round(t*1e10)/1e10,t){var p=e.filter(function(d){return t<0?d.width>n(d):!0});p.length&&(t=vy(p,t,n))}return t}function qH(e){for(var t={},n=1,r=e.allRows(),a=0;a<r.length;a++)for(var i=r[a],s=0,o=e.columns;s<o.length;s++){var l=o[s],u=t[l.index];if(n>1)n--,delete i.cells[l.index];else if(u)u.cell.height+=i.height,n=u.cell.colSpan,delete i.cells[l.index],u.left--,u.left<=1&&delete t[l.index];else{var c=i.cells[l.index];if(!c)continue;if(c.height=i.height,c.rowSpan>1){var f=r.length-a,p=c.rowSpan>f?f:c.rowSpan;t[l.index]={cell:c,left:p,row:i}}}}}function HH(e){for(var t=e.allRows(),n=0;n<t.length;n++)for(var r=t[n],a=null,i=0,s=0,o=0;o<e.columns.length;o++){var l=e.columns[o];if(s-=1,s>1&&e.columns[o+1])i+=l.width,delete r.cells[l.index];else if(a){var u=a;delete r.cells[l.index],a=null,u.width=l.width+i}else{var u=r.cells[l.index];if(!u)continue;if(s=u.colSpan,i=0,u.colSpan>1){a=u,i+=l.width;continue}u.width=l.width+i}}}function VH(e,t){for(var n={count:0,height:0},r=0,a=e.allRows();r<a.length;r++){for(var i=a[r],s=0,o=e.columns;s<o.length;s++){var l=o[s],u=i.cells[l.index];if(u){t.applyStyles(u.styles,!0);var c=u.width-u.padding("horizontal");if(u.styles.overflow==="linebreak")u.text=t.splitTextToSize(u.text,c+1/t.scaleFactor(),{fontSize:u.styles.fontSize});else if(u.styles.overflow==="ellipsize")u.text=T3(u.text,c,u.styles,t,"...");else if(u.styles.overflow==="hidden")u.text=T3(u.text,c,u.styles,t,"");else if(typeof u.styles.overflow=="function"){var f=u.styles.overflow(u.text,c);typeof f=="string"?u.text=[f]:u.text=f}u.contentHeight=u.getContentHeight(t.scaleFactor(),t.getLineHeightFactor());var p=u.contentHeight/u.rowSpan;u.rowSpan>1&&n.count*n.height<p*u.rowSpan?n={height:p,count:u.rowSpan}:n&&n.count>0&&n.height>p&&(p=n.height),p>i.height&&(i.height=p)}}n.count--}}function T3(e,t,n,r,a){return e.map(function(i){return YH(i,t,n,r,a)})}function YH(e,t,n,r,a){var i=1e4*r.scaleFactor();if(t=Math.ceil(t*i)/i,t>=Jm(e,n,r))return e;for(;t<Jm(e+a,n,r)&&!(e.length<=1);)e=e.substring(0,e.length-1);return e.trim()+a}function c8(e,t){var n=new Zu(e),r=GH(t,n.scaleFactor()),a=new BH(t,r);return UH(n,a),n.applyStyles(n.userStyles),a}function GH(e,t){var n=e.content,r=JH(n.columns);if(n.head.length===0){var a=O3(r,"head");a&&n.head.push(a)}if(n.foot.length===0){var a=O3(r,"foot");a&&n.foot.push(a)}var i=e.settings.theme,s=e.styles;return{columns:r,head:s2("head",n.head,r,s,i,t),body:s2("body",n.body,r,s,i,t),foot:s2("foot",n.foot,r,s,i,t)}}function s2(e,t,n,r,a,i){var s={},o=t.map(function(l,u){for(var c=0,f={},p=0,d=0,v=0,S=n;v<S.length;v++){var x=S[v];if(s[x.index]==null||s[x.index].left===0)if(d===0){var g=void 0;Array.isArray(l)?g=l[x.index-p-c]:g=l[x.dataKey];var y={};typeof g=="object"&&!Array.isArray(g)&&(y=(g==null?void 0:g.styles)||{});var _=KH(e,x,u,a,r,i,y),E=new u8(g,_,e);f[x.dataKey]=E,f[x.index]=E,d=E.colSpan-1,s[x.index]={left:E.rowSpan-1,times:d}}else d--,p++;else s[x.index].left--,d=s[x.index].times,c++}return new l8(l,u,e,f)});return o}function O3(e,t){var n={};return e.forEach(function(r){if(r.raw!=null){var a=WH(t,r.raw);a!=null&&(n[r.dataKey]=a)}}),Object.keys(n).length>0?n:null}function WH(e,t){if(e==="head"){if(typeof t=="object")return t.header||null;if(typeof t=="string"||typeof t=="number")return t}else if(e==="foot"&&typeof t=="object")return t.footer;return null}function JH(e){return e.map(function(t,n){var r,a;return typeof t=="object"?a=(r=t.dataKey)!==null&&r!==void 0?r:n:a=n,new $H(a,t,n)})}function KH(e,t,n,r,a,i,s){var o=NH(r),l;e==="head"?l=a.headStyles:e==="body"?l=a.bodyStyles:e==="foot"&&(l=a.footStyles);var u=vs({},o.table,o[e],a.styles,l),c=a.columnStyles[t.dataKey]||a.columnStyles[t.index]||{},f=e==="body"?c:{},p=e==="body"&&n%2===0?vs({},o.alternateRow,a.alternateRowStyles):{},d=AH(i),v=vs({},d,u,p,f);return vs(v,s)}function XH(e,t,n){var r;n===void 0&&(n={});var a=a8(e,t),i=new Map,s=[],o=[],l=[];Array.isArray(t.settings.horizontalPageBreakRepeat)?l=t.settings.horizontalPageBreakRepeat:(typeof t.settings.horizontalPageBreakRepeat=="string"||typeof t.settings.horizontalPageBreakRepeat=="number")&&(l=[t.settings.horizontalPageBreakRepeat]),l.forEach(function(p){var d=t.columns.find(function(v){return v.dataKey===p||v.index===p});d&&!i.has(d.index)&&(i.set(d.index,!0),s.push(d.index),o.push(t.columns[d.index]),a-=d.wrappedWidth)});for(var u=!0,c=(r=n==null?void 0:n.start)!==null&&r!==void 0?r:0;c<t.columns.length;){if(i.has(c)){c++;continue}var f=t.columns[c].wrappedWidth;if(u||a>=f)u=!1,s.push(c),o.push(t.columns[c]),a-=f;else break;c++}return{colIndexes:s,columns:o,lastIndex:c-1}}function QH(e,t){for(var n=[],r=0;r<t.columns.length;r++){var a=XH(e,t,{start:r});a.columns.length&&(n.push(a),r=a.lastIndex)}return n}function f8(e,t){var n=t.settings,r=n.startY,a=n.margin,i={x:a.left,y:r},s=t.getHeadHeight(t.columns)+t.getFootHeight(t.columns),o=r+a.bottom+s;if(n.pageBreak==="avoid"){var l=t.body,u=l.reduce(function(p,d){return p+d.height},0);o+=u}var c=new Zu(e);(n.pageBreak==="always"||n.startY!=null&&o>c.pageSize().height)&&(h8(c),i.y=a.top),t.callWillDrawPageHooks(c,i);var f=vs({},i);t.startPageNumber=c.pageNumber(),n.horizontalPageBreak?ZH(c,t,f,i):(c.applyStyles(c.userStyles),(n.showHead==="firstPage"||n.showHead==="everyPage")&&t.head.forEach(function(p){return Os(c,t,p,i,t.columns)}),c.applyStyles(c.userStyles),t.body.forEach(function(p,d){var v=d===t.body.length-1;Km(c,t,p,v,f,i,t.columns)}),c.applyStyles(c.userStyles),(n.showFoot==="lastPage"||n.showFoot==="everyPage")&&t.foot.forEach(function(p){return Os(c,t,p,i,t.columns)})),n8(c,t,f,i),t.callEndPageHooks(c,i),t.finalY=i.y,e.lastAutoTable=t,c.applyStyles(c.userStyles)}function ZH(e,t,n,r){var a=QH(e,t),i=t.settings;if(i.horizontalPageBreakBehaviour==="afterAllRows")a.forEach(function(u,c){e.applyStyles(e.userStyles),c>0?Wf(e,t,n,r,u.columns,!0):D3(e,t,r,u.columns),eV(e,t,n,r,u.columns),o2(e,t,r,u.columns)});else for(var s=-1,o=a[0],l=function(){var u=s;if(o){e.applyStyles(e.userStyles);var c=o.columns;s>=0?Wf(e,t,n,r,c,!0):D3(e,t,r,c),u=R3(e,t,s+1,r,c),o2(e,t,r,c)}var f=u-s;a.slice(1).forEach(function(p){e.applyStyles(e.userStyles),Wf(e,t,n,r,p.columns,!0),R3(e,t,s+1,r,p.columns,f),o2(e,t,r,p.columns)}),s=u};s<t.body.length-1;)l()}function D3(e,t,n,r){var a=t.settings;e.applyStyles(e.userStyles),(a.showHead==="firstPage"||a.showHead==="everyPage")&&t.head.forEach(function(i){return Os(e,t,i,n,r)})}function eV(e,t,n,r,a){e.applyStyles(e.userStyles),t.body.forEach(function(i,s){var o=s===t.body.length-1;Km(e,t,i,o,n,r,a)})}function R3(e,t,n,r,a,i){e.applyStyles(e.userStyles),i=i??t.body.length;var s=Math.min(n+i,t.body.length),o=-1;return t.body.slice(n,s).forEach(function(l,u){var c=n+u===t.body.length-1,f=d8(e,t,c,r);l.canEntireRowFit(f,a)&&(Os(e,t,l,r,a),o=n+u)}),o}function o2(e,t,n,r){var a=t.settings;e.applyStyles(e.userStyles),(a.showFoot==="lastPage"||a.showFoot==="everyPage")&&t.foot.forEach(function(i){return Os(e,t,i,n,r)})}function tV(e,t,n){var r=n.getLineHeight(e.styles.fontSize),a=e.padding("vertical"),i=Math.floor((t-a)/r);return Math.max(0,i)}function nV(e,t,n,r){var a={};e.spansMultiplePages=!0,e.height=0;for(var i=0,s=0,o=n.columns;s<o.length;s++){var l=o[s],u=e.cells[l.index];if(u){Array.isArray(u.text)||(u.text=[u.text]);var c=new u8(u.raw,u.styles,u.section);c=vs(c,u),c.text=[];var f=tV(u,t,r);u.text.length>f&&(c.text=u.text.splice(f,u.text.length));var p=r.scaleFactor(),d=r.getLineHeightFactor();u.contentHeight=u.getContentHeight(p,d),u.contentHeight>=t&&(u.contentHeight=t,c.styles.minCellHeight-=t),u.contentHeight>e.height&&(e.height=u.contentHeight),c.contentHeight=c.getContentHeight(p,d),c.contentHeight>i&&(i=c.contentHeight),a[l.index]=c}}var v=new l8(e.raw,-1,e.section,a,!0);v.height=i;for(var S=0,x=n.columns;S<x.length;S++){var l=x[S],c=v.cells[l.index];c&&(c.height=v.height);var u=e.cells[l.index];u&&(u.height=e.height)}return v}function rV(e,t,n,r){var a=e.pageSize().height,i=r.settings.margin,s=i.top+i.bottom,o=a-s;t.section==="body"&&(o-=r.getHeadHeight(r.columns)+r.getFootHeight(r.columns));var l=t.getMinimumRowHeight(r.columns,e),u=l<n;if(l>o)return console.error("Will not be able to print row ".concat(t.index," correctly since it's minimum height is larger than page height")),!0;if(!u)return!1;var c=t.hasRowSpan(r.columns),f=t.getMaxCellHeight(r.columns)>o;return f?(c&&console.error("The content of row ".concat(t.index," will not be drawn correctly since drawing rows with a height larger than the page height and has cells with rowspans is not supported.")),!0):!(c||r.settings.rowPageBreak==="avoid")}function Km(e,t,n,r,a,i,s){var o=d8(e,t,r,i);if(n.canEntireRowFit(o,s))Os(e,t,n,i,s);else if(rV(e,n,o,t)){var l=nV(n,o,t,e);Os(e,t,n,i,s),Wf(e,t,a,i,s),Km(e,t,l,r,a,i,s)}else Wf(e,t,a,i,s),Km(e,t,n,r,a,i,s)}function Os(e,t,n,r,a){r.x=t.settings.margin.left;for(var i=0,s=a;i<s.length;i++){var o=s[i],l=n.cells[o.index];if(!l){r.x+=o.width;continue}e.applyStyles(l.styles),l.x=r.x,l.y=r.y;var u=t.callCellHooks(e,t.hooks.willDrawCell,l,n,o,r);if(u===!1){r.x+=o.width;continue}aV(e,l,r);var c=l.getTextPos();ZE(l.text,c.x,c.y,{halign:l.styles.halign,valign:l.styles.valign,maxWidth:Math.ceil(l.width-l.padding("left")-l.padding("right"))},e.getDocument()),t.callCellHooks(e,t.hooks.didDrawCell,l,n,o,r),r.x+=o.width}r.y+=n.height}function aV(e,t,n){var r=t.styles;if(e.getDocument().setFillColor(e.getDocument().getFillColor()),typeof r.lineWidth=="number"){var a=r8(r.lineWidth,r.fillColor);a&&e.rect(t.x,n.y,t.width,t.height,a)}else typeof r.lineWidth=="object"&&(r.fillColor&&e.rect(t.x,n.y,t.width,t.height,"F"),iV(e,t,n,r.lineWidth))}function iV(e,t,n,r){var a,i,s,o;r.top&&(a=n.x,i=n.y,s=n.x+t.width,o=n.y,r.right&&(s+=.5*r.right),r.left&&(a-=.5*r.left),l(r.top,a,i,s,o)),r.bottom&&(a=n.x,i=n.y+t.height,s=n.x+t.width,o=n.y+t.height,r.right&&(s+=.5*r.right),r.left&&(a-=.5*r.left),l(r.bottom,a,i,s,o)),r.left&&(a=n.x,i=n.y,s=n.x,o=n.y+t.height,r.top&&(i-=.5*r.top),r.bottom&&(o+=.5*r.bottom),l(r.left,a,i,s,o)),r.right&&(a=n.x+t.width,i=n.y,s=n.x+t.width,o=n.y+t.height,r.top&&(i-=.5*r.top),r.bottom&&(o+=.5*r.bottom),l(r.right,a,i,s,o));function l(u,c,f,p,d){e.getDocument().setLineWidth(u),e.getDocument().line(c,f,p,d,"S")}}function d8(e,t,n,r){var a=t.settings.margin.bottom,i=t.settings.showFoot;return(i==="everyPage"||i==="lastPage"&&n)&&(a+=t.getFootHeight(t.columns)),e.pageSize().height-r.y-a}function Wf(e,t,n,r,a,i){a===void 0&&(a=[]),i===void 0&&(i=!1),e.applyStyles(e.userStyles),t.settings.showFoot==="everyPage"&&!i&&t.foot.forEach(function(o){return Os(e,t,o,r,a)}),t.callEndPageHooks(e,r);var s=t.settings.margin;n8(e,t,n,r),h8(e),t.pageNumber++,r.x=s.left,r.y=s.top,n.y=s.top,t.callWillDrawPageHooks(e,r),t.settings.showHead==="everyPage"&&(t.head.forEach(function(o){return Os(e,t,o,r,a)}),e.applyStyles(e.userStyles))}function h8(e){var t=e.pageNumber();e.setPage(t+1);var n=e.pageNumber();return n===t?(e.addPage(),!0):!1}function sV(e){e.API.autoTable=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];var r=t[0],a=o8(this,r),i=c8(this,a);return f8(this,i),this},e.API.lastAutoTable=!1,e.API.autoTableText=function(t,n,r,a){ZE(t,n,r,a,this)},e.API.autoTableSetDefaults=function(t){return Zu.setDefaults(t,this),this},e.autoTableSetDefaults=function(t,n){Zu.setDefaults(t,n)},e.API.autoTableHtmlToJson=function(t,n){var r;if(n===void 0&&(n=!1),typeof window>"u")return console.error("Cannot run autoTableHtmlToJson in non browser environment"),null;var a=new Zu(this),i=s8(a,t,window,n,!1),s=i.head,o=i.body,l=((r=s[0])===null||r===void 0?void 0:r.map(function(u){return u.content}))||[];return{columns:l,rows:o,data:o}}}var l2;function oV(e,t){var n=o8(e,t),r=c8(e,n);f8(e,r)}try{if(typeof window<"u"&&window){var M3=window,k3=M3.jsPDF||((l2=M3.jspdf)===null||l2===void 0?void 0:l2.jsPDF);k3&&sV(k3)}}catch(e){console.error("Could not apply autoTable plugin",e)}const P3=()=>b.jsx("div",{className:"flex items-center justify-center h-full",children:b.jsx("div",{className:"w-5 h-5 border-2 border-primary border-t-transparent rounded-full animate-spin"})}),lV=({onCSV:e,onPDF:t,onCancel:n,downloading:r})=>{const{t:a}=Dn();return b.jsx("div",{className:"fixed inset-0 bg-black/50 flex justify-center items-center z-50",children:b.jsx("div",{className:"bg-white rounded-lg p-6 max-w-xs w-full shadow-lg",children:b.jsxs("div",{className:"flex flex-col gap-3",children:[b.jsx("button",{className:"bg-green-600 text-white rounded py-2 font-medium hover:cursor-pointer",onClick:e,disabled:r,children:r?b.jsx(P3,{}):a("SAVE AS CSV")}),b.jsx("button",{className:"bg-blue-600 text-white rounded py-2 font-medium hover:cursor-pointer",onClick:t,disabled:r,children:r?b.jsx(P3,{}):a("SAVE AS PDF")}),b.jsx("button",{className:"text-gray-500 mt-2 hover:cursor-pointer",onClick:n,disabled:r,children:a("CANCEL")})]})})})},uV=e=>new Promise((t,n)=>{const r=new Image;r.crossOrigin="anonymous",r.onload=()=>{const a=document.createElement("canvas");a.width=r.width,a.height=r.height;const i=a.getContext("2d");if(!i){n("Canvas context is null");return}i.drawImage(r,0,0);try{const s=a.toDataURL("image/png");t(s)}catch(s){n("Failed to convert image to base64: "+s)}},r.onerror=a=>n("Image load error: "+a),r.src=e}),p8="prayerApp",ec="prayer_ranges";async function cV(e,t){await(await $n(p8,1,{upgrade(r){r.objectStoreNames.contains(ec)||r.createObjectStore(ec,{keyPath:"key"})}})).put(ec,{key:e,data:t,timestamp:Date.now()})}async function fV(e){const n=await(await $n(p8,1,{upgrade(r){r.objectStoreNames.contains(ec)||r.createObjectStore(ec,{keyPath:"key"})}})).get(ec,e);return n&&Date.now()-n.timestamp<24*60*60*1e3?n:null}function I3(e){const t=e.getFullYear(),n=(e.getMonth()+1).toString().padStart(2,"0"),r=e.getDate().toString().padStart(2,"0");return`${t}-${n}-${r}`}function dV({locationId:e,periodFrom:t,periodTo:n,asrMethod:r,prayerMethod:a}){const[i,s]=C.useState([]),[o,l]=C.useState(!1),u=async(f=!0)=>{f&&l(!1);const p=I3(t),d=I3(n),v=`prayer_range_${e}_${p}_${d}`;try{const S=await fV(v);if(S&&s(S.data),!navigator.onLine){f&&l(!0);return}const x=new AbortController,g=setTimeout(()=>x.abort(),1e4),y=await Promise.race([FI(e,p,d,r,a),new Promise((_,E)=>setTimeout(()=>E(new Error("Request timeout")),1e4))]);clearTimeout(g),x.abort(),s(y),await cV(v,y)}catch(S){console.error("Error fetching prayer times range:",S),S.name==="AbortError"||S.message.includes("timeout")?Ht("warning","Slow connection, showing cached data"):Ht("error",`Error: ${S.message}`)}finally{f&&l(!0)}};return C.useEffect(()=>{u(!0)},[e,t,n,r,a]),C.useEffect(()=>{if(!navigator.onLine)return;let f=null;return f=Ke.channel(`prayer_times_range:${e}`).on("postgres_changes",{event:"*",schema:"public",table:"prayertime",filter:`location_iso=eq.${e}`},()=>{u(!1)}).subscribe(),()=>{f==null||f.unsubscribe()}},[e]),{prayerTimes:i,ready:o,refetch:()=>u(!0)}}const F3={7:{text:"text-white",footer:"text-[#27391C]",button:"bg-[#D9D9D9] text-[#27391C] mb-3 mr-3"},8:{text:"text-[#543A14]",footer:"text-[#543A14]",button:"bg-[#F0BB78] text-[#27391C] mb-3 mr-3"},9:{text:"text-[#E5D0AC]",footer:"text-[#6D2323]",button:"bg-[#E5D0AC] text-[#27391C] mb-3 mr-3"}},m8=({isView:e})=>{const{language:t,colorScheme:n,locationId:r,selectedMosque:a,periodFrom:i,periodTo:s,asrMethod:o,prayerMethod:l}=da(),[u,c]=C.useState(!1),[f,p]=C.useState(!1),d=fa(),{org_nr:v}=Cn(),{t:S}=Dn(),x=t==="ar",{udThemeId:g}=Gd(v),{masjidName:y,masjidLogo:_,masjidAddress:E,masjidContact:D}=Hd(a==null?void 0:a.value),R=n.isDefault,O=F3[g]||F3[7],{prayerTimes:j,ready:$}=dV({locationId:r,periodFrom:i,periodTo:s,asrMethod:o,prayerMethod:l}),V=()=>{if(p(!0),j.length===0){Ht("error","No prayer times to download."),p(!1),c(!1);return}const q=["Date","Fajr","Sunrise","Dhuhr","Asr","Maghrib","Isha"],Y=j.map(ie=>[new Date(ie.date).toLocaleDateString("en-IN"),ie.fajr,ie.sunrise,ie.dhuhr,ie.asr,ie.maghrib,ie.isha]),se=[q,...Y].map(ie=>ie.join(",")).join(`
360
+ `),G=new Blob([se],{type:"text/csv;charset=utf-8;"}),ne=URL.createObjectURL(G),Q=document.createElement("a");Q.href=ne,Q.setAttribute("download",`prayer-timetable-${new Date().toISOString().slice(0,10)}.csv`),document.body.appendChild(Q),Q.click(),document.body.removeChild(Q),URL.revokeObjectURL(ne),p(!1),c(!1)},T=async()=>{if(p(!0),j.length===0){Ht("error","No prayer times to download."),p(!1),c(!1);return}const q=new lt({orientation:"portrait",unit:"mm",format:[210,350]}),Y=q.internal.pageSize.getWidth();let se="/img/IRN-logo.png";if(_)try{se=_!=null&&_.startsWith("http")?await uV(_):`data:image/png;base64,${_}`}catch(B){console.warn("Could not convert mosque logo to base64, using fallback.",B)}try{q.addImage(se,"PNG",14,8,30,20)}catch(B){console.warn("Error adding logo to PDF:",B)}const G=12,ne=14,Q=[y||"Islamic Resource Network",E||"Contact us: info@irn.no",D||"Phone: +47 123 456 789"].filter(Boolean);q.setFontSize(14);const ie=q.getFont().fontName;q.setFont(ie,"bold");const J=Q[0];let le=q.getTextWidth(J);q.text(J,Y-ne-le,G),q.setFontSize(10),q.setFont(ie,"normal");let L=7;for(let B=1;B<Q.length;B++){const ee=Q[B],fe=q.getTextWidth(ee);q.text(ee,Y-ne-fe,G+L*B)}q.setFontSize(16),q.text("Prayer Timetable",14,50);const z=["Date","Fajr","Sunrise","Dhuhr","Asr","Maghrib","Isha"],W=j.map(B=>[new Date(B.date).toLocaleDateString("en-IN"),B.fajr,B.sunrise,B.dhuhr,B.asr,B.maghrib,B.isha]);oV(q,{startY:40,head:[z],body:W,styles:{fontSize:10,cellPadding:2},headStyles:{fillColor:[58,125,68]}});const te=`prayer-timetable-${new Date().toISOString().slice(0,10)}.pdf`;q.save(te),p(!1),c(!1)},P=q=>{const Y=new Date(q),se=Y.getDate().toString().padStart(2,"0"),G=(Y.getMonth()+1).toString().padStart(2,"0"),ne=Y.getFullYear().toString().slice(-2);return`${se}-${G}-${ne}`};return $?b.jsxs("div",{className:"w-full h-full font-DM flex flex-col justify-between",style:{direction:x?"rtl":"ltr"},children:[b.jsxs("div",{className:"flex-1 border shadow-md rounded-xl px-4 py-1 mb-2 backdrop-blur-md flex flex-col justify-between",style:{color:R?O.text:n.prayerTimesColor.text,backgroundColor:e?R?"#ffffff33":n.prayerTimesColor.bg:"#F8F5E9"},children:[e&&!a?b.jsx("div",{className:"flex justify-center items-center py-3 border-b border-[#0000004D]",children:b.jsx("span",{className:`font-medium ${O.text}`,children:"Prayer Timetable"})}):b.jsxs("div",{className:"border-b border-[#0000004D] flex justify-between items-center py-3",children:[e?b.jsx("span",{className:"text-sm sm:text-base font-medium",children:S("PRAYER TIMETABLE")}):b.jsx("img",{src:_!=null&&_.startsWith("http")?_:_?`data:image/png;base64,${_}`:"/default-logo.png",alt:"logo",className:"h-12"}),e?b.jsx("p",{className:`text-sm sm:text-base font-medium ${x?"text-left":"text-right"}`,children:y}):b.jsxs("p",{className:`text-sm font-semibold ${x?"text-left":"text-right"}`,children:[E," ",b.jsx("br",{}),D]})]}),b.jsx("div",{className:"flex-1 overflow-auto px-2",children:b.jsxs("table",{className:"w-full text-sm text-left text-black border-collapse",children:[b.jsx("thead",{className:"bg-white text-xs font-bold border-b border-black/30",children:b.jsxs("tr",{children:[b.jsx("th",{className:`px-4 py-2 ${x?"text-right":"text-left"}`,children:S("DATE")}),b.jsx("th",{className:"px-4 py-2",children:S("FAJR")}),b.jsx("th",{className:"px-4 py-2",children:S("SUNRISE")}),b.jsx("th",{className:"px-4 py-2",children:S("DHUHR")}),b.jsx("th",{className:"px-4 py-2",children:S("ASR")}),b.jsx("th",{className:"px-4 py-2",children:S("MAGHRIB")}),b.jsx("th",{className:"px-4 py-2",children:S("ISHA")})]})}),$?b.jsx("tbody",{children:j.length===0?b.jsx("tr",{children:b.jsx("td",{colSpan:7,className:"text-center py-4",children:"No prayer times available"})}):j.map((q,Y)=>b.jsxs("tr",{className:"border-b bg-white/70",children:[b.jsx("td",{className:`px-4 py-2 font-semibold ${x?"text-right":"text-left"} whitespace-nowrap`,children:P(q.date)}),b.jsx("td",{className:"px-4 py-2",children:q.fajr}),b.jsx("td",{className:"px-4 py-2",children:q.sunrise}),b.jsx("td",{className:"px-4 py-2",children:q.dhuhr}),b.jsx("td",{className:"px-4 py-2",children:q.asr}),b.jsx("td",{className:"px-4 py-2",children:q.maghrib}),b.jsx("td",{className:"px-4 py-2",children:q.isha})]},q.date||Y))}):b.jsx("tbody",{children:b.jsx("tr",{children:b.jsx("td",{colSpan:7,children:b.jsx("div",{className:"flex justify-center items-center h-[200px] w-full",children:b.jsx(hc,{})})})})})]})}),b.jsx("div",{className:"border-t border-[#0000004D] h-9 flex justify-center items-center",children:b.jsx("span",{className:"text-sm font-semibold",children:!e&&"irn.no"})})]}),b.jsx("div",{className:"mt-3 flex justify-end",children:b.jsx("button",{className:`${O.button} rounded-lg py-2 px-4 text-xs font-medium hover:cursor-pointer`,style:{color:R?"":n.bgColor,backgroundColor:R?"":n.textColor},onClick:()=>{e?d(`/${(a==null?void 0:a.value)||982842840}/download-timetable`):c(!0)},children:S(e?"DOWNLOAD TIMETABLE":"DOWNLOAD (CSV/PDF)")})}),u&&b.jsx(lV,{onCSV:V,onPDF:T,onCancel:()=>c(!1),downloading:f})]}):b.jsx(hc,{})},hV={7:{text:"text-white"},8:{text:"text-[#543A14]",backgroundImage:"/img/ud/bg2.png",overlayOpacityClass:"",backgroundColorClass:"bg-[#FFF0DC]/90"},9:{text:"text-[#E5D0AC]",backgroundImage:"/img/ud/bg3.png",overlayOpacityClass:"",backgroundColorClass:"bg-[#6D2323]/97"}},pV={text:"text-black"},mV=()=>{const{colorScheme:e}=da(),t=fa(),{org_nr:n}=Cn(),{udThemeId:r}=Gd(n),a=hV[r]||pV;return b.jsxs("div",{className:`relative w-full h-screen ${a.text}`,style:{color:e.textColor},children:[b.jsx("div",{className:"absolute inset-0 bg-center pointer-events-none",style:{backgroundImage:e.bgImage?`url('${e.bgImage}')`:void 0,backgroundRepeat:e.bgRepeat??"",backgroundSize:e.bgRepeat?"":"cover",opacity:e.bgOpacity,filter:e.bgRepeat?"":"blur(8px)"}}),b.jsxs("div",{className:"relative h-full z-10 p-4 flex flex-col",style:{backgroundColor:e.bgColor},children:[b.jsxs("div",{className:"flex flex-col",children:[b.jsx(t0,{isHome:!1}),b.jsxs("div",{className:"flex justify-between gap-3 mt-3 mb-3",children:[b.jsx("button",{onClick:()=>t(-1),className:"w-6 h-6 rounded-md flex items-center justify-center mt-2",style:{backgroundColor:e.textColor,color:e.bgColor},children:b.jsx(X5,{})}),b.jsx("div",{className:"flex justify-end",children:b.jsx(Q5,{nr:r,isHome:!1})})]})]}),b.jsx("div",{className:"flex-1 overflow-auto",children:b.jsx(m8,{isView:!1})})]})]})},gV=()=>{const{org_nr:e}=Cn(),t=fa(),{udThemeId:n}=Gd(e),{colorScheme:r,setPeriodType:a,setPeriodFrom:i,setPeriodTo:s}=da();return C.useEffect(()=>{a("Monthly");const o=new Date,l=new Date(o.getFullYear(),o.getMonth(),1),u=new Date(o.getFullYear(),o.getMonth()+1,0);i(l),s(u)},[]),b.jsxs("div",{className:"relative w-full h-screen",style:{color:r.textColor},children:[b.jsx("div",{className:"absolute inset-0 pointer-events-none bg-center",style:{backgroundImage:r.bgImage?`url('${r.bgImage}')`:void 0,backgroundRepeat:r.bgRepeat??"",backgroundSize:r.bgRepeat?"":"cover",opacity:r.bgOpacity,filter:r.bgRepeat?"":"blur(8px)"}}),b.jsxs("div",{className:"relative h-full z-10 p-4 flex flex-col",style:{backgroundColor:r.bgColor},children:[b.jsxs("div",{className:"flex flex-col",children:[b.jsx(t0,{isHome:!1}),b.jsxs("div",{className:"flex justify-between gap-3 mt-3 mb-3",children:[b.jsx("button",{onClick:()=>t(-1),className:"w-6 h-6 rounded-md flex items-center justify-center mt-2",style:{backgroundColor:r.textColor,color:r.bgColor},children:b.jsx(X5,{})}),b.jsx("div",{className:"flex justify-end",children:b.jsx(Q5,{nr:n,isHome:!1})})]})]}),b.jsx("div",{className:"flex-1 overflow-auto",children:b.jsx(m8,{isView:!0})})]})]})},vV={7:{container:"bg-[#255F38]",item:"p-3 rounded-md text-left transition",date:"sm:text-lg font-bold pb-2",description:"text-sm sm:text-base font-semibold"},8:{container:"bg-[#F0BB78]",item:"p-3 rounded-md text-left transition",date:"sm:text-lg font-bold pb-2",description:"text-sm sm:text-base font-semibold"},9:{container:"bg-[#FEF9E1]/20 border",item:"p-3 rounded-md text-left transition",date:"sm:text-lg font-bold pb-2",description:"text-sm sm:text-base font-semibold"}},yV=({events:e=[],tn:t=7})=>{const{i18n:n,t:r}=Dn(),a=n.language,i=vV[t],{colorScheme:s,hijriMonthNames:o}=da(),l=s.isDefault,[u,c]=C.useState(new Map);return C.useEffect(()=>{if(!e||e.length===0)return;const f=e.map(y=>new Date(y.date)),p=new Date(Math.min(...f.map(y=>y.getTime()))),d=new Date(Math.max(...f.map(y=>y.getTime()))),v=new Date(p.getFullYear(),0,1),S=new Date(d.getFullYear(),11,31),x=v.toLocaleDateString("en-CA"),g=S.toLocaleDateString("en-CA");Mg(x,g).then(y=>{c(y)}).catch(y=>{console.error("Failed to fetch Hijri dates for events:",y)})},[e]),b.jsx("div",{className:`pb-2 px-2 rounded-lg shadow-md mt- ${i.container}`,style:{color:s.prayerTimesColor.text,backgroundColor:l?"":s.prayerTimesColor.bg},children:b.jsx("div",{className:"flex justify-between items-center",children:b.jsx("div",{children:e.map((f,p)=>{const d=new Date(f.date);let v;if(a==="ar"){const S=d.toLocaleDateString("en-CA"),x=u.get(S);v=x?Hi({hijriDayObj:x,language:a,t:r,hijriMonthNames:o}):""}else{const S=d.toLocaleDateString("en-US",{month:"long"}).toUpperCase(),x=d.getDate(),g=d.getFullYear();v=`${x} ${S} ${g}`}return b.jsxs("div",{className:i.item,children:[b.jsx("h2",{className:`${i.date} font-extrabold text-sm sm:text-base`,children:v}),b.jsx("p",{className:`${i.description} text-[10px] sm:text-xs font-medium leading-tight`,children:f.description})]},p)})})})})},bV={7:{text:"text-white font-DM"},8:{text:"text-[#543A14] font-montserrat",bg:"bg-[#FFF0DC]/90"},9:{text:"text-[#FEF9E1] font-ones"}},wV=()=>{const{colorScheme:e,events:t,eventsLoading:n}=da(),{t:r}=Dn(),a=fa(),{org_nr:i}=Cn(),{udThemeId:s}=Gd(i),o=bV[s];return n?b.jsx("div",{className:"h-screen",children:b.jsx(hc,{})}):b.jsxs("div",{className:`relative w-full min-h-screen font-DM ${o.text}`,style:{color:e.textColor},children:[e.bgImage&&b.jsx("div",{className:"absolute inset-0 pointer-events-none min-h-screen",style:{backgroundImage:e.bgImage?`url('${e.bgImage}')`:void 0,backgroundRepeat:e.bgRepeat??"",opacity:e.bgOpacity,filter:e.bgRepeat?"":"blur(8px)"}}),b.jsxs("div",{className:"relative flex flex-col min-h-screen z-10 p-4",style:{backgroundColor:e.bgColor},children:[b.jsx(t0,{isHome:!1}),b.jsxs("div",{className:"flex flex-col md:gap-4",children:[b.jsxs("div",{className:"flex items-center gap-3 py-8",children:[b.jsx("button",{onClick:()=>a(-1),className:"w-6 h-6 rounded-md flex items-center justify-center",style:{backgroundColor:e.textColor,color:e.bgColor},children:b.jsx(X5,{})}),b.jsx("div",{className:"text-center w-full",children:b.jsx("h2",{className:"text-lg sm:text-xl font-bold",style:{color:e.textColor},children:r("EVENTS & CALENDAR").toUpperCase()})})]}),b.jsxs("div",{className:"flex flex-col md:flex-row gap-4",children:[b.jsx("div",{className:"calendar-container flex-grow",children:b.jsx(zp,{tn:s,showDate:!0})}),b.jsx("div",{className:"md:w-1/2 flex items-center pt-",children:b.jsx("div",{className:"w-full grid gap-2 md:max-h-[calc(100vh-200px)] md:overflow-y-auto",children:t.map((l,u)=>b.jsx(yV,{events:[l],tn:s},u))})})]})]})]})]})},xV=()=>{const e=fa(),{org_nr:t}=Cn(),[n]=iO(),r=n.get("name"),a=n.get("iqamah"),i=n.get("duration"),s=r?{name:r,iqamah:a||""}:null,o=i?Number(i):null;return C.useEffect(()=>{},[s,o,t]),C.useEffect(()=>{if(s&&o&&t){const l=setTimeout(()=>{console.log("Navigating to /:org_nr/masjid after",o,"seconds"),e(`/${t}/masjid`)},o*1e3);return()=>clearTimeout(l)}else console.log("Missing currentPrayer, iqamahDuration, or org_nr, navigating to /:org_nr/masjid"),t?e(`/${t}/masjid`):(console.log("No org_nr, navigating to default /masjid"),e("/masjid"))},[s,o,t,e]),s?b.jsxs("div",{className:"min-h-screen w-full bg-black flex flex-col items-center justify-center gap-12",children:[b.jsxs("div",{className:"bg-black p-8 rounded-lg shadow-lg text-center max-w-md w-full",children:[b.jsx("h1",{className:"text-4xl font-bold text-white mb-6",children:"IQAMAH"}),b.jsx("br",{}),b.jsx("h1",{className:"text-4xl font-bold text-white mb-6",children:"قد قامت الصلاة"}),b.jsx("p",{className:"text-5xl text-white mb-8 font-bold",children:s.name})]}),b.jsxs("div",{className:"flex items-center gap-6 bg-white rounded-[70px] p-6",children:[b.jsx("img",{src:"/img/instruction.jpg",alt:"No Mobile",className:"w-24 h-24 rounded-full object-cover"}),b.jsx("p",{className:"text-3xl text-black font-bold",children:"Please keep your phones OFF or in silent mode"})]})]}):(console.log("No currentPrayer, rendering fallback UI"),b.jsx("div",{className:"min-h-dvh w-full bg-black flex items-center justify-center text-white",children:"No prayer data available."}))};function SV({error:e,resetErrorBoundary:t}){return b.jsx("div",{className:"min-h-screen bg-gradient-to-br from-red-50 to-orange-50 flex items-center justify-center p-8",children:b.jsxs("div",{className:"max-w-md w-full bg-white rounded-2xl shadow-2xl border border-red-100 p-8 text-center",children:[b.jsx("div",{className:"w-24 h-24 mx-auto mb-6 bg-red-100 rounded-2xl flex items-center justify-center",children:b.jsx("svg",{className:"w-12 h-12 text-red-500",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:b.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-2.5L13.732 4c-.77-.833-1.964-.833-2.732 0L3.732 16.5c-.77.833.192 2.5 1.732 2.5z"})})}),b.jsx("h2",{className:"text-2xl md:text-3xl font-bold text-gray-900 mb-4",children:"Something went wrong"}),b.jsx("p",{className:"text-gray-600 mb-6 leading-relaxed",children:e.message||"An unexpected error occurred. Please try again."}),b.jsxs("div",{className:"flex flex-col sm:flex-row gap-3 justify-center",children:[b.jsx("button",{onClick:t,className:"px-6 py-3 bg-blue-600 text-white font-medium rounded-xl hover:bg-blue-700 focus:outline-none focus:ring-2 focus:ring-blue-500 focus:ring-offset-2 transition-all duration-200 shadow-lg",children:"Try Again"}),b.jsx("button",{onClick:()=>window.location.reload(),className:"px-6 py-3 bg-gray-100 text-gray-900 font-medium rounded-xl hover:bg-gray-200 focus:outline-none focus:ring-2 focus:ring-gray-500 focus:ring-offset-2 transition-all duration-200",children:"Refresh Page"})]}),b.jsxs("details",{className:"mt-6 p-4 bg-gray-50 rounded-xl border",children:[b.jsx("summary",{className:"cursor-pointer font-medium text-sm text-gray-700 mb-2",children:"Show technical details"}),b.jsx("pre",{className:"text-xs text-red-800 bg-red-50 p-3 rounded font-mono overflow-auto max-h-40",children:e.message}),b.jsx("button",{onClick:()=>navigator.clipboard.writeText(e.message),className:"mt-2 text-xs text-blue-600 hover:underline",children:"Copy error"})]})]})})}const _V=()=>b.jsxs(TI,{fallbackRender:SV,children:[b.jsxs(L7,{children:[b.jsxs(Ur,{element:b.jsx(Eq,{}),children:[b.jsx(Ur,{path:"/:org_nr",element:b.jsx(l3,{})}),b.jsx(Ur,{path:"/user",element:b.jsx(Qh,{to:"/982842840"})}),b.jsx(Ur,{path:"/loc/:loc_id",element:b.jsx(l3,{})}),b.jsx(Ur,{path:"/:org_nr/events",element:b.jsx(wV,{})}),b.jsx(Ur,{path:"/:org_nr/view-timetable",element:b.jsx(gV,{})}),b.jsx(Ur,{path:"/:org_nr/download-timetable",element:b.jsx(mV,{})})]}),b.jsx(Ur,{path:"/:org_nr/masjid",element:b.jsx(WI,{})}),b.jsx(Ur,{path:"/:org_nr/masjid/iqamah",element:b.jsx(xV,{})}),b.jsx(Ur,{path:"/masjid",element:b.jsx(Qh,{to:"/982842840/masjid"})}),b.jsx(Ur,{path:"/:org_nr/lobby",element:b.jsx(WF,{})}),b.jsx(Ur,{path:"/lobby",element:b.jsx(Qh,{to:"/982842840/lobby"})}),b.jsx(Ur,{path:"/",element:b.jsx(Qh,{to:"/loc/NO0301"})}),b.jsx(Ur,{path:"*",element:b.jsx(Nq,{})})]}),b.jsx(pI,{})]});function AV(){const e=Q7([{path:"/*",element:b.jsx(_V,{})}]);return b.jsx(fO,{router:e})}Kj.createRoot(document.getElementById("root")).render(b.jsx(C.StrictMode,{children:b.jsx(LO,{children:b.jsx(AV,{})})}));export{Lf as _,ni as c,Xm as g};