wsemi 1.8.85 → 1.8.86

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 (484) hide show
  1. package/README.md +1 -1
  2. package/dist/wsemi.umd.js +2 -2
  3. package/dist/wsemi.umd.js.map +1 -1
  4. package/docs/-_class.mjs.html +1 -1
  5. package/docs/ab2blob.mjs.html +1 -1
  6. package/docs/ab2u8arr.mjs.html +1 -1
  7. package/docs/addExcelWorksheetFromData.mjs.html +1 -1
  8. package/docs/addMonth.mjs.html +1 -1
  9. package/docs/aes2str.mjs.html +1 -1
  10. package/docs/alive.mjs.html +1 -1
  11. package/docs/arr2dt.mjs.html +1 -1
  12. package/docs/arrAccum.mjs.html +1 -1
  13. package/docs/arrAdd.mjs.html +1 -1
  14. package/docs/arrAt.mjs.html +1 -1
  15. package/docs/arrDiff.mjs.html +1 -1
  16. package/docs/arrFilterByKeywords.mjs.html +1 -1
  17. package/docs/arrFilterByNum.mjs.html +1 -1
  18. package/docs/arrFilterByPnum.mjs.html +1 -1
  19. package/docs/arrFilterByPnumAndToLog.mjs.html +1 -1
  20. package/docs/arrFind.mjs.html +1 -1
  21. package/docs/arrGroupByMaxmin.mjs.html +1 -1
  22. package/docs/arrHas.mjs.html +1 -1
  23. package/docs/arrInsert.mjs.html +1 -1
  24. package/docs/arrLookupByMaxmin.mjs.html +1 -1
  25. package/docs/arrMax.mjs.html +1 -1
  26. package/docs/arrMin.mjs.html +1 -1
  27. package/docs/arrMulti.mjs.html +1 -1
  28. package/docs/arrNorm.mjs.html +1 -1
  29. package/docs/arrProduct.mjs.html +1 -1
  30. package/docs/arrPull.mjs.html +1 -1
  31. package/docs/arrPullAt.mjs.html +1 -1
  32. package/docs/arrReduce.mjs.html +1 -1
  33. package/docs/arrReverse.mjs.html +1 -1
  34. package/docs/arrSep.mjs.html +1 -1
  35. package/docs/arrSort.mjs.html +1 -1
  36. package/docs/asind.mjs.html +1 -1
  37. package/docs/atan2d.mjs.html +1 -1
  38. package/docs/atand.mjs.html +1 -1
  39. package/docs/attstr.mjs.html +1 -1
  40. package/docs/b642obj.mjs.html +1 -1
  41. package/docs/b642str.mjs.html +1 -1
  42. package/docs/b642u16arr.mjs.html +1 -1
  43. package/docs/b642u8arr.mjs.html +1 -1
  44. package/docs/binstr.mjs.html +1 -1
  45. package/docs/blob2ab.mjs.html +1 -1
  46. package/docs/blob2b64.mjs.html +1 -1
  47. package/docs/blob2str.mjs.html +1 -1
  48. package/docs/blob2u8arr.mjs.html +1 -1
  49. package/docs/blobs2b64s.mjs.html +1 -1
  50. package/docs/blobs2u8arrs.mjs.html +1 -1
  51. package/docs/bodyLog.mjs.html +1 -1
  52. package/docs/browserView.mjs.html +1 -1
  53. package/docs/browserViewFromBlob.mjs.html +1 -1
  54. package/docs/browserViewFromText.mjs.html +1 -1
  55. package/docs/browserViewFromU8arr.mjs.html +1 -1
  56. package/docs/bs2u8arr.mjs.html +1 -1
  57. package/docs/bufRead.mjs.html +1 -1
  58. package/docs/bufReadDbl.mjs.html +1 -1
  59. package/docs/bufWrite.mjs.html +1 -1
  60. package/docs/bufWriteDbl.mjs.html +1 -1
  61. package/docs/cache.mjs.html +1 -1
  62. package/docs/cacheBd.mjs.html +1 -1
  63. package/docs/cacheSt.mjs.html +1 -1
  64. package/docs/cbol.mjs.html +1 -1
  65. package/docs/cdbl.mjs.html +1 -1
  66. package/docs/ceil.mjs.html +1 -1
  67. package/docs/cfilesize.mjs.html +1 -1
  68. package/docs/cfinancial.mjs.html +1 -1
  69. package/docs/cint.mjs.html +1 -1
  70. package/docs/clearXSS.mjs.html +1 -1
  71. package/docs/clearXSSDyn.mjs.html +1 -1
  72. package/docs/color.mjs.html +1 -1
  73. package/docs/composeToTree.mjs.html +1 -1
  74. package/docs/convertToTree.mjs.html +1 -1
  75. package/docs/copyStrToClipboard.mjs.html +1 -1
  76. package/docs/cosd.mjs.html +1 -1
  77. package/docs/cotd.mjs.html +1 -1
  78. package/docs/createExcelWorkbook.mjs.html +1 -1
  79. package/docs/cscd.mjs.html +1 -1
  80. package/docs/cstr.mjs.html +1 -1
  81. package/docs/day2cht.mjs.html +1 -1
  82. package/docs/debounce.mjs.html +1 -1
  83. package/docs/delay.mjs.html +1 -1
  84. package/docs/dig.mjs.html +1 -1
  85. package/docs/digExp.mjs.html +1 -1
  86. package/docs/domAlert.mjs.html +1 -1
  87. package/docs/domAppend.mjs.html +1 -1
  88. package/docs/domCancelEvent.mjs.html +1 -1
  89. package/docs/domCompareText.mjs.html +1 -1
  90. package/docs/domConvertToPic.mjs.html +1 -1
  91. package/docs/domConvertToPicDyn.mjs.html +1 -1
  92. package/docs/domDetect.mjs.html +1 -1
  93. package/docs/domDrag.mjs.html +1 -1
  94. package/docs/domDragBarAndScroll.mjs.html +1 -1
  95. package/docs/domDragPreview.mjs.html +1 -1
  96. package/docs/domDropFiles.mjs.html +1 -1
  97. package/docs/domElementsFromPoint.mjs.html +1 -1
  98. package/docs/domFadeIn.mjs.html +1 -1
  99. package/docs/domFadeOut.mjs.html +1 -1
  100. package/docs/domFind.mjs.html +1 -1
  101. package/docs/domFinds.mjs.html +1 -1
  102. package/docs/domGetAttr.mjs.html +1 -1
  103. package/docs/domGetBoudRect.mjs.html +1 -1
  104. package/docs/domGetBoudRectRefSelf.mjs.html +1 -1
  105. package/docs/domGetFileAccept.mjs.html +1 -1
  106. package/docs/domGetFiles.mjs.html +1 -1
  107. package/docs/domGetParents.mjs.html +1 -1
  108. package/docs/domGetPointFromEvent.mjs.html +1 -1
  109. package/docs/domGetScrollableParent.mjs.html +1 -1
  110. package/docs/domGetWindowSize.mjs.html +1 -1
  111. package/docs/domIsClientXYIn.mjs.html +1 -1
  112. package/docs/domIsFocused.mjs.html +1 -1
  113. package/docs/domIsStable.mjs.html +1 -1
  114. package/docs/domIsVisible.mjs.html +1 -1
  115. package/docs/domPrepend.mjs.html +1 -1
  116. package/docs/domRemove.mjs.html +1 -1
  117. package/docs/domRenderMarkdownMind.mjs.html +1 -1
  118. package/docs/domRenderMarkdownMindDyn.mjs.html +1 -1
  119. package/docs/domRipple.mjs.html +1 -1
  120. package/docs/domScrollIntoView.mjs.html +1 -1
  121. package/docs/domScrollTo.mjs.html +1 -1
  122. package/docs/domSetAttr.mjs.html +1 -1
  123. package/docs/domShowImages.mjs.html +1 -1
  124. package/docs/domShowImagesDyn.mjs.html +1 -1
  125. package/docs/domShowInputAndGetFiles.mjs.html +1 -1
  126. package/docs/domShowInputAndGetFilesU8Arrs.mjs.html +1 -1
  127. package/docs/domShowInputDatatime.mjs.html +1 -1
  128. package/docs/domTooltip.mjs.html +1 -1
  129. package/docs/domTriggerEvent.mjs.html +1 -1
  130. package/docs/domVirtualCreate.mjs.html +1 -1
  131. package/docs/domVirtualCreateQueue.mjs.html +1 -1
  132. package/docs/downloadExcelFileFromData.mjs.html +1 -1
  133. package/docs/downloadExcelFileFromDataDyn.mjs.html +1 -1
  134. package/docs/downloadFileFromB64.mjs.html +1 -1
  135. package/docs/downloadFileFromBlob.mjs.html +1 -1
  136. package/docs/downloadFileFromText.mjs.html +1 -1
  137. package/docs/downloadFileFromU8Arr.mjs.html +1 -1
  138. package/docs/dtmapping.mjs.html +1 -1
  139. package/docs/dtpick.mjs.html +1 -1
  140. package/docs/estimateTicks.mjs.html +1 -1
  141. package/docs/evem.mjs.html +1 -1
  142. package/docs/examples/ex-blob2b64.html +1 -1
  143. package/docs/examples/ex-clearXSS.html +1 -1
  144. package/docs/examples/ex-clearXSSDyn.html +1 -1
  145. package/docs/examples/ex-colorConverter.html +1 -1
  146. package/docs/examples/ex-domCompareText.html +1 -1
  147. package/docs/examples/ex-domConvertToPic.html +1 -1
  148. package/docs/examples/ex-domDrag.html +1 -1
  149. package/docs/examples/ex-domDropFiles.html +1 -1
  150. package/docs/examples/ex-domIsVisible.html +1 -1
  151. package/docs/examples/ex-domRenderMarkdownMind.html +1 -1
  152. package/docs/examples/ex-domRenderMarkdownMindDyn.html +1 -1
  153. package/docs/examples/ex-domRipple.html +1 -1
  154. package/docs/examples/ex-domScrollIntoView.html +1 -1
  155. package/docs/examples/ex-domScrollTo.html +1 -1
  156. package/docs/examples/ex-domShowImages.html +1 -1
  157. package/docs/examples/ex-domShowImagesDyn.html +1 -1
  158. package/docs/examples/ex-domShowInputAndGetFiles.html +1 -1
  159. package/docs/examples/ex-domTooltip.html +1 -1
  160. package/docs/examples/ex-getFileHash.html +1 -1
  161. package/docs/examples/ex-getUserAgent.html +1 -1
  162. package/docs/examples/ex-getUserAgentDyn.html +1 -1
  163. package/docs/examples/ex-html2str.html +1 -1
  164. package/docs/examples/ex-obj2u8arr-u8arr2obj.html +1 -1
  165. package/docs/examples/ex-openLink.html +1 -1
  166. package/docs/examples/ex-str2aes-aes2str.html +1 -1
  167. package/docs/examples/ex-str2b64-b642str.html +1 -1
  168. package/docs/examples/ex-strFindFuzz.html +1 -1
  169. package/docs/examples/ex-timeTZ2expire-timeTZ2past.html +1 -1
  170. package/docs/examples/ex-xlsx.html +1 -1
  171. package/docs/execCli.mjs.html +1 -1
  172. package/docs/execCliCore.mjs.html +1 -1
  173. package/docs/execCliJsonRpc.mjs.html +1 -1
  174. package/docs/execCliSession.mjs.html +1 -1
  175. package/docs/execJsCode.mjs.html +1 -1
  176. package/docs/execProcess.mjs.html +1 -1
  177. package/docs/execProcessKillPid.mjs.html +1 -1
  178. package/docs/filepathToTree.mjs.html +1 -1
  179. package/docs/files2data.mjs.html +1 -1
  180. package/docs/flattenToConn.mjs.html +1 -1
  181. package/docs/flattenTree.mjs.html +1 -1
  182. package/docs/floor.mjs.html +1 -1
  183. package/docs/fsBuildReadStreamText.mjs.html +1 -1
  184. package/docs/fsBuildWriteStreamText.mjs.html +1 -1
  185. package/docs/fsCleanFolder.mjs.html +1 -1
  186. package/docs/fsCleanFolderCore.mjs.html +1 -1
  187. package/docs/fsCopyFile.mjs.html +1 -1
  188. package/docs/fsCopyFileCore.mjs.html +1 -1
  189. package/docs/fsCopyFolder.mjs.html +1 -1
  190. package/docs/fsCopyFolderCore.mjs.html +1 -1
  191. package/docs/fsCreateFile.mjs.html +1 -1
  192. package/docs/fsCreateFileCore.mjs.html +1 -1
  193. package/docs/fsCreateFolder.mjs.html +1 -1
  194. package/docs/fsCreateFolderCore.mjs.html +1 -1
  195. package/docs/fsDeleteFile.mjs.html +1 -1
  196. package/docs/fsDeleteFileCore.mjs.html +1 -1
  197. package/docs/fsDeleteFileSafe.mjs.html +1 -1
  198. package/docs/fsDeleteFileSafeCore.mjs.html +1 -1
  199. package/docs/fsDeleteFolder.mjs.html +1 -1
  200. package/docs/fsDeleteFolderCore.mjs.html +1 -1
  201. package/docs/fsDeleteFolderSafe.mjs.html +1 -1
  202. package/docs/fsDeleteFolderSafeCore.mjs.html +1 -1
  203. package/docs/fsDownloadFile.mjs.html +1 -1
  204. package/docs/fsDownloadFileCore.mjs.html +1 -1
  205. package/docs/fsEvem.mjs.html +1 -1
  206. package/docs/fsExists.mjs.html +1 -1
  207. package/docs/fsExistsCore.mjs.html +1 -1
  208. package/docs/fsGetFileBasicHash.mjs.html +1 -1
  209. package/docs/fsGetFileBasicHashCore.mjs.html +1 -1
  210. package/docs/fsGetFileHash.mjs.html +1 -1
  211. package/docs/fsGetFileHashCore.mjs.html +1 -1
  212. package/docs/fsGetFileXxHash.mjs.html +1 -1
  213. package/docs/fsGetFileXxHashCore.mjs.html +1 -1
  214. package/docs/fsGetFilesInFolder.mjs.html +1 -1
  215. package/docs/fsGetFilesInFolderCore.mjs.html +1 -1
  216. package/docs/fsGetFilesWithHashInFolder.mjs.html +1 -1
  217. package/docs/fsGetFilesWithHashInFolderCore.mjs.html +1 -1
  218. package/docs/fsGetFolderBasicHash.mjs.html +1 -1
  219. package/docs/fsGetFolderBasicHashCore.mjs.html +1 -1
  220. package/docs/fsGetFoldersInFolder.mjs.html +1 -1
  221. package/docs/fsGetFoldersInFolderCore.mjs.html +1 -1
  222. package/docs/fsIsFile.mjs.html +1 -1
  223. package/docs/fsIsFileCore.mjs.html +1 -1
  224. package/docs/fsIsFolder.mjs.html +1 -1
  225. package/docs/fsIsFolderCore.mjs.html +1 -1
  226. package/docs/fsMergeFiles.mjs.html +1 -1
  227. package/docs/fsMergeFilesCore.mjs.html +100 -48
  228. package/docs/fsReadJson.mjs.html +1 -1
  229. package/docs/fsReadText.mjs.html +1 -1
  230. package/docs/fsReadTextCore.mjs.html +1 -1
  231. package/docs/fsRenameFile.mjs.html +1 -1
  232. package/docs/fsRenameFileCore.mjs.html +1 -1
  233. package/docs/fsRenameFolder.mjs.html +1 -1
  234. package/docs/fsRenameFolderCore.mjs.html +1 -1
  235. package/docs/fsSrlog.mjs.html +1 -1
  236. package/docs/fsSyncFolder.mjs.html +1 -1
  237. package/docs/fsSyncFolderCore.mjs.html +1 -1
  238. package/docs/fsTask.mjs.html +1 -1
  239. package/docs/fsTaskCp.mjs.html +1 -1
  240. package/docs/fsTreeFolder.mjs.html +1 -1
  241. package/docs/fsTreeFolderCore.mjs.html +1 -1
  242. package/docs/fsTreeFolderWithHash.mjs.html +1 -1
  243. package/docs/fsTreeFolderWithHashCore.mjs.html +1 -1
  244. package/docs/fsWatchFile.mjs.html +1 -1
  245. package/docs/fsWatchFolder.mjs.html +1 -1
  246. package/docs/fsWriteJson.mjs.html +1 -1
  247. package/docs/fsWriteText.mjs.html +1 -1
  248. package/docs/fsWriteTextCore.mjs.html +1 -1
  249. package/docs/genGradientColor.mjs.html +1 -1
  250. package/docs/genID.mjs.html +1 -1
  251. package/docs/genIDSeq.mjs.html +1 -1
  252. package/docs/genPm.mjs.html +1 -1
  253. package/docs/getBufferSize.mjs.html +1 -1
  254. package/docs/getClearPathName.mjs.html +1 -1
  255. package/docs/getCsvStrFromData.mjs.html +1 -1
  256. package/docs/getDataFromExcelFileU8Arr.mjs.html +1 -1
  257. package/docs/getDataFromExcelFileU8ArrDyn.mjs.html +1 -1
  258. package/docs/getEnv.mjs.html +1 -1
  259. package/docs/getErrorMessage.mjs.html +1 -1
  260. package/docs/getExcelU8ArrFromData.mjs.html +1 -1
  261. package/docs/getExcelU8ArrFromWorkbook.mjs.html +1 -1
  262. package/docs/getExcelWorkbookFromData.mjs.html +1 -1
  263. package/docs/getExcelWorkbookFromWorksheet.mjs.html +1 -1
  264. package/docs/getExcelWorksheetFromData.mjs.html +1 -1
  265. package/docs/getFileAccept.mjs.html +1 -1
  266. package/docs/getFileBasicHash.mjs.html +1 -1
  267. package/docs/getFileHash.mjs.html +1 -1
  268. package/docs/getFileName.mjs.html +1 -1
  269. package/docs/getFileNameExt.mjs.html +1 -1
  270. package/docs/getFileTrueName.mjs.html +1 -1
  271. package/docs/getFileType.mjs.html +1 -1
  272. package/docs/getFileXxHash.mjs.html +1 -1
  273. package/docs/getGlobal.mjs.html +1 -1
  274. package/docs/getObjSize.mjs.html +1 -1
  275. package/docs/getPathParent.mjs.html +1 -1
  276. package/docs/getTimeBetween.mjs.html +1 -1
  277. package/docs/getTimeFromUnit.mjs.html +1 -1
  278. package/docs/getTimeHp.mjs.html +1 -1
  279. package/docs/getTimeObject.mjs.html +1 -1
  280. package/docs/getTimeRange.mjs.html +1 -1
  281. package/docs/getUserAgent.mjs.html +1 -1
  282. package/docs/getUserAgentDyn.mjs.html +1 -1
  283. package/docs/getltdtkeys.mjs.html +1 -1
  284. package/docs/global.html +1 -1
  285. package/docs/haskey.mjs.html +1 -1
  286. package/docs/html2str.mjs.html +1 -1
  287. package/docs/htmlDecode.mjs.html +1 -1
  288. package/docs/htmlEncode.mjs.html +1 -1
  289. package/docs/importResources.mjs.html +1 -1
  290. package/docs/index.html +1 -1
  291. package/docs/interp1.mjs.html +1 -1
  292. package/docs/isDate.mjs.html +1 -1
  293. package/docs/isDev.mjs.html +1 -1
  294. package/docs/isEle.mjs.html +1 -1
  295. package/docs/isEleExistByID.mjs.html +1 -1
  296. package/docs/isEmail.mjs.html +1 -1
  297. package/docs/isErr.mjs.html +1 -1
  298. package/docs/isIE.mjs.html +1 -1
  299. package/docs/isNarrow.mjs.html +1 -1
  300. package/docs/isStrHasCapital.mjs.html +1 -1
  301. package/docs/isStrHasLetter.mjs.html +1 -1
  302. package/docs/isStrHasLowerCase.mjs.html +1 -1
  303. package/docs/isStrHasNumber.mjs.html +1 -1
  304. package/docs/isStrHasSpace.mjs.html +1 -1
  305. package/docs/isStrHasSymbol.mjs.html +1 -1
  306. package/docs/isUserIdentify.mjs.html +1 -1
  307. package/docs/isUserName.mjs.html +1 -1
  308. package/docs/isUserPw.mjs.html +1 -1
  309. package/docs/isWindow.mjs.html +1 -1
  310. package/docs/isab.mjs.html +1 -1
  311. package/docs/isarr.mjs.html +1 -1
  312. package/docs/isarr0.mjs.html +1 -1
  313. package/docs/isbigint.mjs.html +1 -1
  314. package/docs/isblob.mjs.html +1 -1
  315. package/docs/isbol.mjs.html +1 -1
  316. package/docs/isday.mjs.html +1 -1
  317. package/docs/isearr.mjs.html +1 -1
  318. package/docs/iseobj.mjs.html +1 -1
  319. package/docs/iser.mjs.html +1 -1
  320. package/docs/isernot.mjs.html +1 -1
  321. package/docs/isestr.mjs.html +1 -1
  322. package/docs/isfile.mjs.html +1 -1
  323. package/docs/isfun.mjs.html +1 -1
  324. package/docs/isint.mjs.html +1 -1
  325. package/docs/ismonth.mjs.html +1 -1
  326. package/docs/isn0int.mjs.html +1 -1
  327. package/docs/isn0num.mjs.html +1 -1
  328. package/docs/isnan.mjs.html +1 -1
  329. package/docs/isnbr.mjs.html +1 -1
  330. package/docs/isnint.mjs.html +1 -1
  331. package/docs/isnnum.mjs.html +1 -1
  332. package/docs/isnull.mjs.html +1 -1
  333. package/docs/isnum.mjs.html +1 -1
  334. package/docs/isobj.mjs.html +1 -1
  335. package/docs/isobj0.mjs.html +1 -1
  336. package/docs/isp0int.mjs.html +1 -1
  337. package/docs/isp0num.mjs.html +1 -1
  338. package/docs/ispint.mjs.html +1 -1
  339. package/docs/ispm.mjs.html +1 -1
  340. package/docs/ispnum.mjs.html +1 -1
  341. package/docs/isstr.mjs.html +1 -1
  342. package/docs/isstr0.mjs.html +1 -1
  343. package/docs/istime.mjs.html +1 -1
  344. package/docs/istimeTZ.mjs.html +1 -1
  345. package/docs/istimems.mjs.html +1 -1
  346. package/docs/istimemsTZ.mjs.html +1 -1
  347. package/docs/isu16arr.mjs.html +1 -1
  348. package/docs/isu8arr.mjs.html +1 -1
  349. package/docs/isundefined.mjs.html +1 -1
  350. package/docs/j2o.mjs.html +1 -1
  351. package/docs/judge.mjs.html +1 -1
  352. package/docs/keysmat2ltdt.mjs.html +1 -1
  353. package/docs/ltdt2vrtsable.mjs.html +1 -1
  354. package/docs/ltdtDiff.mjs.html +1 -1
  355. package/docs/ltdtDiffByKey.mjs.html +1 -1
  356. package/docs/ltdtkeys2mat.mjs.html +1 -1
  357. package/docs/ltdtkeysheads2mat.mjs.html +1 -1
  358. package/docs/ltdtmapping.mjs.html +1 -1
  359. package/docs/ltdtmerge.mjs.html +1 -1
  360. package/docs/ltdtpick.mjs.html +1 -1
  361. package/docs/ltdtpull.mjs.html +1 -1
  362. package/docs/mat2ltdt.mjs.html +1 -1
  363. package/docs/matConcat.mjs.html +1 -1
  364. package/docs/matDiff.mjs.html +1 -1
  365. package/docs/matat.mjs.html +1 -1
  366. package/docs/now2str.mjs.html +1 -1
  367. package/docs/now2strp.mjs.html +1 -1
  368. package/docs/nowDay2str.mjs.html +1 -1
  369. package/docs/nowms2str.mjs.html +1 -1
  370. package/docs/nowms2strp.mjs.html +1 -1
  371. package/docs/o2j.mjs.html +1 -1
  372. package/docs/obj2b64.mjs.html +1 -1
  373. package/docs/obj2pb64.mjs.html +1 -1
  374. package/docs/obj2str.mjs.html +1 -1
  375. package/docs/obj2stru8arr.mjs.html +1 -1
  376. package/docs/obj2u8arr.mjs.html +1 -1
  377. package/docs/objSortBy.mjs.html +1 -1
  378. package/docs/objSortByKeys.mjs.html +1 -1
  379. package/docs/oo.mjs.html +1 -1
  380. package/docs/openLink.mjs.html +1 -1
  381. package/docs/pb642obj.mjs.html +1 -1
  382. package/docs/pmChain.mjs.html +1 -1
  383. package/docs/pmConvertResolve.mjs.html +1 -1
  384. package/docs/pmDebounce.mjs.html +1 -1
  385. package/docs/pmHook.mjs.html +1 -1
  386. package/docs/pmHookReject.mjs.html +1 -1
  387. package/docs/pmIni.mjs.html +1 -1
  388. package/docs/pmInvResolve.mjs.html +1 -1
  389. package/docs/pmKeyMutex.mjs.html +1 -1
  390. package/docs/pmMap.mjs.html +1 -1
  391. package/docs/pmQueue.mjs.html +1 -1
  392. package/docs/pmSeries.mjs.html +1 -1
  393. package/docs/pmThrottle.mjs.html +1 -1
  394. package/docs/pmTimeout.mjs.html +1 -1
  395. package/docs/preciseNum.mjs.html +1 -1
  396. package/docs/pseudoRandom.mjs.html +1 -1
  397. package/docs/pseudoRandomIntRange.mjs.html +1 -1
  398. package/docs/pseudoRandomIntsNdpRange.mjs.html +1 -1
  399. package/docs/pseudoRandomIntsRange.mjs.html +1 -1
  400. package/docs/pseudoRandomRange.mjs.html +1 -1
  401. package/docs/pseudoRandomsRange.mjs.html +1 -1
  402. package/docs/queue.mjs.html +1 -1
  403. package/docs/random.mjs.html +1 -1
  404. package/docs/randomIntRange.mjs.html +1 -1
  405. package/docs/randomIntsNdpRange.mjs.html +1 -1
  406. package/docs/randomIntsRange.mjs.html +1 -1
  407. package/docs/randomRange.mjs.html +1 -1
  408. package/docs/randomsRange.mjs.html +1 -1
  409. package/docs/rang.mjs.html +1 -1
  410. package/docs/rep.mjs.html +1 -1
  411. package/docs/repObj.mjs.html +1 -1
  412. package/docs/replace.mjs.html +1 -1
  413. package/docs/replaceObj.mjs.html +1 -1
  414. package/docs/replacePlus.mjs.html +1 -1
  415. package/docs/round.mjs.html +1 -1
  416. package/docs/secd.mjs.html +1 -1
  417. package/docs/sep.mjs.html +1 -1
  418. package/docs/sepInt.mjs.html +1 -1
  419. package/docs/setIntervalHp.mjs.html +1 -1
  420. package/docs/setTimeoutHp.mjs.html +1 -1
  421. package/docs/sind.mjs.html +1 -1
  422. package/docs/split.mjs.html +1 -1
  423. package/docs/str2aes.mjs.html +1 -1
  424. package/docs/str2b64.mjs.html +1 -1
  425. package/docs/str2hint.mjs.html +1 -1
  426. package/docs/str2md5.mjs.html +1 -1
  427. package/docs/str2obj.mjs.html +1 -1
  428. package/docs/str2sha.mjs.html +1 -1
  429. package/docs/str2sha512.mjs.html +1 -1
  430. package/docs/str2u8arr.mjs.html +1 -1
  431. package/docs/strCompare.mjs.html +1 -1
  432. package/docs/strCompareForVersion.mjs.html +1 -1
  433. package/docs/strDiff.mjs.html +1 -1
  434. package/docs/strDiffToHtml.mjs.html +1 -1
  435. package/docs/strFindFuzz.mjs.html +1 -1
  436. package/docs/strFindSimilar.mjs.html +1 -1
  437. package/docs/strTruncate.mjs.html +1 -1
  438. package/docs/strdelleft.mjs.html +1 -1
  439. package/docs/strdelright.mjs.html +1 -1
  440. package/docs/strleft.mjs.html +1 -1
  441. package/docs/strmid.mjs.html +1 -1
  442. package/docs/strright.mjs.html +1 -1
  443. package/docs/stru8arr2obj.mjs.html +1 -1
  444. package/docs/tand.mjs.html +1 -1
  445. package/docs/time2day.mjs.html +1 -1
  446. package/docs/time2hour.mjs.html +1 -1
  447. package/docs/time2min.mjs.html +1 -1
  448. package/docs/timeTZ2day.mjs.html +1 -1
  449. package/docs/timeTZ2expire.mjs.html +1 -1
  450. package/docs/timeTZ2hour.mjs.html +1 -1
  451. package/docs/timeTZ2min.mjs.html +1 -1
  452. package/docs/timeTZ2past.mjs.html +1 -1
  453. package/docs/timems2day.mjs.html +1 -1
  454. package/docs/timems2hour.mjs.html +1 -1
  455. package/docs/timems2min.mjs.html +1 -1
  456. package/docs/timems2time.mjs.html +1 -1
  457. package/docs/timemsTZ2day.mjs.html +1 -1
  458. package/docs/timemsTZ2expire.mjs.html +1 -1
  459. package/docs/timemsTZ2hour.mjs.html +1 -1
  460. package/docs/timemsTZ2min.mjs.html +1 -1
  461. package/docs/timemsTZ2past.mjs.html +1 -1
  462. package/docs/timemsTZ2time.mjs.html +1 -1
  463. package/docs/treeObj.mjs.html +1 -1
  464. package/docs/treeToFilepath.mjs.html +1 -1
  465. package/docs/trim.mjs.html +1 -1
  466. package/docs/u16arr2b64.mjs.html +1 -1
  467. package/docs/u16arr2u8arr.mjs.html +1 -1
  468. package/docs/u8arr2ab.mjs.html +1 -1
  469. package/docs/u8arr2b64.mjs.html +1 -1
  470. package/docs/u8arr2blob.mjs.html +1 -1
  471. package/docs/u8arr2bs.mjs.html +1 -1
  472. package/docs/u8arr2obj.mjs.html +1 -1
  473. package/docs/u8arr2str.mjs.html +1 -1
  474. package/docs/u8arr2u16arr.mjs.html +1 -1
  475. package/docs/urlParse.mjs.html +1 -1
  476. package/docs/verifyValue.mjs.html +1 -1
  477. package/docs/waitFun.mjs.html +1 -1
  478. package/docs/wsemi.html +2 -2
  479. package/package.json +2 -2
  480. package/src/fsMergeFilesCore.mjs +98 -46
  481. package/test/fsMergeFiles.test.mjs +192 -0
  482. package/toolfp/dist/wsemip.umd.js +1 -1
  483. package/toolparfor/dist/wpf.umd.js +1 -1
  484. package/toolparfor/dist/wpf_pmSeries.umd.js +1 -1
package/dist/wsemi.umd.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * wsemi v1.8.85
2
+ * wsemi v1.8.86
3
3
  * (c) 2018-2021 yuda-lyu(semisphere)
4
4
  * Released under the MIT License.
5
5
  */
@@ -21,7 +21,7 @@ var ds,hs,ps=9e15,gs=1e9,ms="0123456789abcdef",ys="2.302585092994045684017991454
21
21
  * Released under the MIT license
22
22
  *
23
23
  * Date: 2026-08-22T13:00:39.652Z
24
- */!function(e){e.exports=function(){function e(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function t(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,s(r.key),r)}}function n(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function r(e,t,n){return(t=s(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function i(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function o(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?i(Object(n),!0).forEach(function(t){r(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):i(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function a(e,t){if("object"!=typeof e||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}function s(e){var t=a(e,"string");return"symbol"==typeof t?t:t+""}function l(e){return l="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},l(e)}var c={backdrop:!0,button:!0,navbar:!0,title:!0,toolbar:!0,className:"",container:"body",filter:null,fullscreen:!0,inheritedAttributes:["crossOrigin","decoding","isMap","loading","referrerPolicy","sizes","srcset","useMap"],initialCoverage:.9,initialViewIndex:0,inline:!1,interval:5e3,keyboard:!0,focus:!0,loading:!0,loop:!0,minWidth:200,minHeight:100,movable:!0,rotatable:!0,scalable:!0,zoomable:!0,zoomOnTouch:!0,zoomOnWheel:!0,slideOnTouch:!0,toggleOnDblclick:!0,tooltip:!0,transition:!0,zIndex:2015,zIndexInline:0,zoomRatio:.1,minZoomRatio:.01,maxZoomRatio:100,url:"src",ready:null,show:null,shown:null,hide:null,hidden:null,view:null,viewed:null,move:null,moved:null,rotate:null,rotated:null,scale:null,scaled:null,zoom:null,zoomed:null,play:null,stop:null},u='<div class="viewer-container" tabindex="-1" touch-action="none"><div class="viewer-canvas"></div><div class="viewer-footer"><div class="viewer-title"></div><div class="viewer-toolbar"></div><div class="viewer-navbar"><ul class="viewer-list" role="navigation"></ul></div></div><div class="viewer-tooltip" role="alert" aria-hidden="true"></div><div class="viewer-button" data-viewer-action="mix" role="button"></div><div class="viewer-player"></div></div>',f="undefined"!=typeof window&&void 0!==window.document,d=f?window:{},h=!(!f||!d.document.documentElement)&&"ontouchstart"in d.document.documentElement,p=!!f&&"PointerEvent"in d,g="viewer",m="move",y="switch",v="zoom",A="".concat(g,"-active"),b="".concat(g,"-close"),w="".concat(g,"-fade"),I="".concat(g,"-fixed"),x="".concat(g,"-fullscreen"),C="".concat(g,"-fullscreen-exit"),B="".concat(g,"-hide"),E="".concat(g,"-hide-md-down"),k="".concat(g,"-hide-sm-down"),S="".concat(g,"-hide-xs-down"),F="".concat(g,"-in"),D="".concat(g,"-invisible"),N="".concat(g,"-loading"),M="".concat(g,"-move"),Q="".concat(g,"-open"),T="".concat(g,"-show"),L="".concat(g,"-transition"),R="click",U="dblclick",H="dragstart",q="focusin",O="keydown",P="load",z="error",$=h?"touchend touchcancel":"mouseup",j=h?"touchmove":"mousemove",V=h?"touchstart":"mousedown",Y=p?"pointerdown":V,G=p?"pointermove":j,W=p?"pointerup pointercancel":$,J="resize",_="transitionend",X="wheel",K="ready",Z="show",ee="shown",te="hide",ne="hidden",re="view",ie="viewed",oe="move",ae="moved",se="rotate",le="rotated",ce="scale",ue="scaled",fe="zoom",de="zoomed",he="play",pe="stop",ge="".concat(g,"Action"),me=/\s+/,ye=["zoom-in","zoom-out","one-to-one","reset","prev","play","next","rotate-left","rotate-right","flip-horizontal","flip-vertical"];function ve(e){return"string"==typeof e}var Ae=Number.isNaN||d.isNaN;function be(e){return"number"==typeof e&&!Ae(e)}function we(e){return void 0===e}function Ie(e){return"object"===l(e)&&null!==e}var xe=Object.prototype.hasOwnProperty;function Ce(e){if(!Ie(e))return!1;try{var t=e.constructor,n=t.prototype;return t&&n&&xe.call(n,"isPrototypeOf")}catch(e){return!1}}function Be(e){return"function"==typeof e}function Ee(e,t){if(e&&Be(t))if(Array.isArray(e)||be(e.length)){var n,r=e.length;for(n=0;n<r&&!1!==t.call(e,e[n],n,e);n+=1);}else Ie(e)&&Object.keys(e).forEach(function(n){t.call(e,e[n],n,e)});return e}var ke=Object.assign||function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];return Ie(e)&&n.length>0&&n.forEach(function(t){Ie(t)&&Object.keys(t).forEach(function(n){e[n]=t[n]})}),e},Se=/^(?:width|height|left|top|marginLeft|marginTop)$/;function Fe(e,t){var n=e.style;Ee(t,function(e,t){Se.test(t)&&be(e)&&(e+="px"),n[t]=e})}function De(e){return ve(e)?e.replace(/&(?!amp;|quot;|#39;|lt;|gt;)/g,"&amp;").replace(/"/g,"&quot;").replace(/'/g,"&#39;").replace(/</g,"&lt;").replace(/>/g,"&gt;"):e}function Ne(e,t){return!(!e||!t)&&(e.classList?e.classList.contains(t):e.className.split(me).indexOf(t)>-1)}function Me(e,t){if(e&&t)if(be(e.length))Ee(e,function(e){Me(e,t)});else if(e.classList)e.classList.add(t);else{var n=e.className.trim();n?n.indexOf(t)<0&&(e.className="".concat(n," ").concat(t)):e.className=t}}function Qe(e,t){if(e&&t)if(be(e.length))Ee(e,function(e){Qe(e,t)});else if(e.classList)e.classList.remove(t);else{var n=e.className;n&&n.indexOf(t)>=0&&(e.className=n.split(me).filter(function(e){return e&&e!==t}).join(" "))}}function Te(e,t,n){t&&(be(e.length)?Ee(e,function(e){Te(e,t,n)}):n?Me(e,t):Qe(e,t))}var Le=/([a-z\d])([A-Z])/g;function Re(e){return e.replace(Le,"$1-$2").toLowerCase()}function Ue(e,t){return Ie(e[t])?e[t]:e.dataset?e.dataset[t]:e.getAttribute("data-".concat(Re(t)))}function He(e,t,n){Ie(n)?e[t]=n:e.dataset?e.dataset[t]=n:e.setAttribute("data-".concat(Re(t)),n)}var qe=function(){var e=!1;if(f){var t=!1,n=function(){},r=Object.defineProperty({},"once",{get:function(){return e=!0,t},set:function(e){t=e}});d.addEventListener("test",n,r),d.removeEventListener("test",n,r)}return e}();function Oe(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},i=n;t.trim().split(me).forEach(function(t){if(!qe){var o=e.listeners;o&&o[t]&&o[t][n]&&(i=o[t][n],delete o[t][n],0===Object.keys(o[t]).length&&delete o[t],0===Object.keys(o).length&&delete e.listeners)}e.removeEventListener(t,i,r)})}function Pe(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},i=n;t.trim().split(me).forEach(function(t){if(r.once&&!qe){var o=e.listeners,a=void 0===o?{}:o;i=function(){delete a[t][n],e.removeEventListener(t,i,r);for(var o=arguments.length,s=new Array(o),l=0;l<o;l++)s[l]=arguments[l];n.apply(e,s)},a[t]||(a[t]={}),a[t][n]&&e.removeEventListener(t,a[t][n],r),a[t][n]=i,e.listeners=a}e.addEventListener(t,i,r)})}function ze(e,t,n,r){var i;return Be(Event)&&Be(CustomEvent)?i=new CustomEvent(t,o({bubbles:!0,cancelable:!0,detail:n},r)):(i=document.createEvent("CustomEvent")).initCustomEvent(t,!0,!0,n),e.dispatchEvent(i)}function $e(e){var t=e.getBoundingClientRect();return{left:t.left+(window.pageXOffset-document.documentElement.clientLeft),top:t.top+(window.pageYOffset-document.documentElement.clientTop)}}function je(e){var t=e.rotate,n=e.scaleX,r=e.scaleY,i=e.translateX,o=e.translateY,a=[];be(i)&&0!==i&&a.push("translateX(".concat(i,"px)")),be(o)&&0!==o&&a.push("translateY(".concat(o,"px)")),be(t)&&0!==t&&a.push("rotate(".concat(t,"deg)")),be(n)&&1!==n&&a.push("scaleX(".concat(n,")")),be(r)&&1!==r&&a.push("scaleY(".concat(r,")"));var s=a.length?a.join(" "):"none";return{WebkitTransform:s,msTransform:s,transform:s}}function Ve(e){return ve(e)?decodeURIComponent(e.replace(/^.*\//,"").replace(/[?&#].*$/,"")):""}var Ye=d.navigator&&/Version\/\d+(\.\d+)+?\s+Safari/i.test(d.navigator.userAgent);function Ge(e,t,n){var r=document.createElement("img");if(e.naturalWidth&&!Ye)return n(e.naturalWidth,e.naturalHeight),r;var i=document.body||document.documentElement;return r.onload=function(){n(r.width,r.height),Ye||i.removeChild(r)},Ee(t.inheritedAttributes,function(t){var n=e.getAttribute(t);null!==n&&r.setAttribute(t,n)}),r.src=e.src,Ye||(r.style.cssText="left:0;max-height:none!important;max-width:none!important;min-height:0!important;min-width:0!important;opacity:0;position:absolute;top:0;z-index:-1;",i.appendChild(r)),r}function We(e){switch(e){case 2:return S;case 3:return k;case 4:return E;default:return""}}function Je(e){var t=o({},e),n=[];return Ee(e,function(e,r){delete t[r],Ee(t,function(t){var r=Math.abs(e.startX-t.startX),i=Math.abs(e.startY-t.startY),o=Math.abs(e.endX-t.endX),a=Math.abs(e.endY-t.endY),s=Math.sqrt(r*r+i*i),l=(Math.sqrt(o*o+a*a)-s)/s;n.push(l)})}),n.sort(function(e,t){return Math.abs(e)<Math.abs(t)}),n[0]}function _e(e,t){var n=e.pageX,r=e.pageY,i={endX:n,endY:r};return t?i:o({timeStamp:Date.now(),startX:n,startY:r},i)}function Xe(e){var t=0,n=0,r=0;return Ee(e,function(e){var i=e.startX,o=e.startY;t+=i,n+=o,r+=1}),{pageX:t/=r,pageY:n/=r}}var Ke,Ze={render:function(){this.initContainer(),this.initViewer(),this.initList(),this.renderViewer()},initBody:function(){var e=this.element.ownerDocument,t=e.body||e.documentElement;this.body=t,this.scrollbarWidth=window.innerWidth-e.documentElement.clientWidth,this.initialBodyPaddingRight=t.style.paddingRight,this.initialBodyComputedPaddingRight=window.getComputedStyle(t).paddingRight},initContainer:function(){this.containerData={width:window.innerWidth,height:window.innerHeight}},initViewer:function(){var e,t=this.options,n=this.parent;t.inline&&(e={width:Math.max(n.offsetWidth,t.minWidth),height:Math.max(n.offsetHeight,t.minHeight)},this.parentData=e),!this.fulled&&e||(e=this.containerData),this.viewerData=ke({},e)},renderViewer:function(){this.options.inline&&!this.fulled&&Fe(this.viewer,this.viewerData)},initList:function(){var e=this,t=this.element,n=this.options,r=this.list,i=[];r.innerHTML="",Ee(this.images,function(t,o){var a=t.src,s=t.alt||Ve(a),l=e.getImageURL(t);if(a||l){var c=document.createElement("li"),u=document.createElement("img");Ee(n.inheritedAttributes,function(e){var n=t.getAttribute(e);null!==n&&u.setAttribute(e,n)}),n.navbar&&(u.src=a||l),u.alt=s,u.setAttribute("data-original-url",l||a),c.setAttribute("data-index",o),c.setAttribute("data-viewer-action","view"),c.setAttribute("role","button"),n.keyboard&&c.setAttribute("tabindex",0),c.appendChild(u),r.appendChild(c),i.push(c)}}),this.items=i,Ee(i,function(t){var r,i,o=t.firstElementChild;He(o,"filled",!0),n.loading&&Me(t,N),Pe(o,P,r=function(r){Oe(o,z,i),n.loading&&Qe(t,N),e.loadImage(r)},{once:!0}),Pe(o,z,i=function(){Oe(o,P,r),n.loading&&Qe(t,N)},{once:!0})}),n.transition&&Pe(t,ie,function(){Me(r,L)},{once:!0})},renderList:function(){var e=this.index,t=this.items[e];if(t){var n=t.nextElementSibling,r=parseInt(window.getComputedStyle(n||t).marginLeft,10),i=t.offsetWidth,o=i+r;Fe(this.list,ke({width:o*this.length-r},je({translateX:(this.viewerData.width-i)/2-o*e})))}},resetList:function(){var e=this.list;e.innerHTML="",Qe(e,L),Fe(e,ke({width:0},je({translateX:0})))},initImage:function(e){var t,n=this,r=this.options,i=this.image,o=this.viewerData,a=this.footer.offsetHeight,s=o.width,l=Math.max(o.height-a,a),c=this.imageData||{};this.imageInitializing={abort:function(){t.onload=null}},t=Ge(i,r,function(t,i){var o=t/i,a=Math.max(0,Math.min(1,r.initialCoverage)),u=s,f=l;n.imageInitializing=!1,l*o>s?f=s/o:u=l*o,a=be(a)?a:.9,u=Math.min(u*a,t),f=Math.min(f*a,i);var d=(s-u)/2,h=(l-f)/2,p={left:d,top:h,x:d,y:h,width:u,height:f,oldRatio:1,ratio:u/t,aspectRatio:o,naturalWidth:t,naturalHeight:i},g=ke({},p);r.rotatable&&(p.rotate=c.rotate||0,g.rotate=0),r.scalable&&(p.scaleX=c.scaleX||1,p.scaleY=c.scaleY||1,g.scaleX=1,g.scaleY=1),n.imageData=p,n.initialImageData=g,e&&e()})},renderImage:function(e){var t=this,n=this.image,r=this.imageData;if(Fe(n,ke({width:r.width,height:r.height,marginLeft:r.x,marginTop:r.y},je(r))),e)if((this.viewing||this.moving||this.rotating||this.scaling||this.zooming)&&this.options.transition&&Ne(n,L)){var i=function(){t.imageRendering=!1,e()};this.imageRendering={abort:function(){Oe(n,_,i)}},Pe(n,_,i,{once:!0})}else e()},resetImage:function(){var e=this.image;e&&(this.viewing&&this.viewing.abort(),e.parentNode.removeChild(e),this.image=null,this.title.innerHTML="")}},et={bind:function(){var e=this.options,t=this.viewer,n=this.canvas,r=this.element.ownerDocument;Pe(t,R,this.onClick=this.click.bind(this)),Pe(t,H,this.onDragStart=this.dragstart.bind(this)),Pe(n,Y,this.onPointerDown=this.pointerdown.bind(this)),Pe(r,G,this.onPointerMove=this.pointermove.bind(this)),Pe(r,W,this.onPointerUp=this.pointerup.bind(this)),Pe(r,O,this.onKeyDown=this.keydown.bind(this)),Pe(window,J,this.onResize=this.resize.bind(this)),e.zoomable&&e.zoomOnWheel&&Pe(t,X,this.onWheel=this.wheel.bind(this),{passive:!1,capture:!0}),e.toggleOnDblclick&&Pe(n,U,this.onDblclick=this.dblclick.bind(this))},unbind:function(){var e=this.options,t=this.viewer,n=this.canvas,r=this.element.ownerDocument;Oe(t,R,this.onClick),Oe(t,H,this.onDragStart),Oe(n,Y,this.onPointerDown),Oe(r,G,this.onPointerMove),Oe(r,W,this.onPointerUp),Oe(r,O,this.onKeyDown),Oe(window,J,this.onResize),e.zoomable&&e.zoomOnWheel&&Oe(t,X,this.onWheel,{passive:!1,capture:!0}),e.toggleOnDblclick&&Oe(n,U,this.onDblclick)}},tt={click:function(e){var t=this.options,n=this.imageData,r=e.target,i=Ue(r,ge);switch(i||"img"!==r.localName||"li"!==r.parentElement.localName||(i=Ue(r=r.parentElement,ge)),h&&e.isTrusted&&r===this.canvas&&clearTimeout(this.clickCanvasTimeout),i){case"mix":this.played?this.stop():t.inline?this.fulled?this.exit():this.full():this.hide();break;case"hide":this.pointerMoved||this.hide();break;case"view":this.view(Ue(r,"index"));break;case"zoom-in":this.zoom(.1,!0);break;case"zoom-out":this.zoom(-.1,!0);break;case"one-to-one":this.toggle();break;case"reset":this.reset();break;case"prev":this.prev(t.loop);break;case"play":this.play(t.fullscreen);break;case"next":this.next(t.loop);break;case"rotate-left":this.rotate(-90);break;case"rotate-right":this.rotate(90);break;case"flip-horizontal":this.scaleX(-n.scaleX||-1);break;case"flip-vertical":this.scaleY(-n.scaleY||-1);break;default:this.played&&this.stop()}},dblclick:function(e){e.preventDefault(),this.viewed&&e.target===this.image&&(h&&e.isTrusted&&clearTimeout(this.doubleClickImageTimeout),this.toggle(e.isTrusted?e:e.detail&&e.detail.originalEvent))},load:function(){var e=this;this.timeout&&(clearTimeout(this.timeout),this.timeout=!1);var t=this.element,n=this.options,r=this.image,i=this.index,o=this.viewerData;Qe(r,D),n.loading&&Qe(this.canvas,N),r.style.cssText="height:0;"+"margin-left:".concat(o.width/2,"px;")+"margin-top:".concat(o.height/2,"px;")+"max-width:none!important;position:relative;width:0;",this.initImage(function(){Te(r,M,n.movable),Te(r,L,n.transition),e.renderImage(function(){e.viewed=!0,e.viewing=!1,Be(n.viewed)&&Pe(t,ie,n.viewed,{once:!0}),ze(t,ie,{originalImage:e.images[i],index:i,image:r},{cancelable:!1})})})},loadImage:function(e){var t=e.target,n=t.parentNode,r=n.offsetWidth||30,i=n.offsetHeight||50,o=!!Ue(t,"filled");Ge(t,this.options,function(e,n){var a=e/n,s=r,l=i;i*a>r?o?s=i*a:l=r/a:o?l=r/a:s=i*a,Fe(t,ke({width:s,height:l},je({translateX:(r-s)/2,translateY:(i-l)/2})))})},keydown:function(e){var t=this.options;if(t.keyboard){var n=e.keyCode||e.which||e.charCode;if(13===n&&this.viewer.contains(e.target)&&this.click(e),this.fulled)switch(n){case 27:this.played?this.stop():t.inline?this.fulled&&this.exit():this.hide();break;case 32:this.played&&this.stop();break;case 37:this.played&&this.playing?this.playing.prev():this.prev(t.loop);break;case 38:e.preventDefault(),this.zoom(t.zoomRatio,!0);break;case 39:this.played&&this.playing?this.playing.next():this.next(t.loop);break;case 40:e.preventDefault(),this.zoom(-t.zoomRatio,!0);break;case 48:case 49:e.ctrlKey&&(e.preventDefault(),this.toggle())}}},dragstart:function(e){"img"===e.target.localName&&e.preventDefault()},pointerdown:function(e){var t=this.options,n=this.pointers,r=e.buttons,i=e.button;if(this.pointerMoved=!1,!(!this.viewed||this.showing||this.viewing||this.hiding||("mousedown"===e.type||"pointerdown"===e.type&&"mouse"===e.pointerType)&&(be(r)&&1!==r||be(i)&&0!==i||e.ctrlKey))){e.preventDefault(),e.changedTouches?Ee(e.changedTouches,function(e){n[e.identifier]=_e(e)}):n[e.pointerId||0]=_e(e);var o=!!t.movable&&m;t.zoomOnTouch&&t.zoomable&&Object.keys(n).length>1?o=v:t.slideOnTouch&&("touch"===e.pointerType||"touchstart"===e.type)&&this.isSwitchable()&&(o=y),!t.transition||o!==m&&o!==v||Qe(this.image,L),this.action=o}},pointermove:function(e){var t=this.pointers,n=this.action;this.viewed&&n&&(e.preventDefault(),e.changedTouches?Ee(e.changedTouches,function(e){ke(t[e.identifier]||{},_e(e,!0))}):ke(t[e.pointerId||0]||{},_e(e,!0)),this.change(e))},pointerup:function(e){var t,n=this,r=this.options,i=this.action,o=this.pointers;e.changedTouches?Ee(e.changedTouches,function(e){t=o[e.identifier],delete o[e.identifier]}):(t=o[e.pointerId||0],delete o[e.pointerId||0]),i&&(e.preventDefault(),!r.transition||i!==m&&i!==v||Me(this.image,L),this.action=!1,h&&i!==v&&t&&Date.now()-t.timeStamp<500&&(clearTimeout(this.clickCanvasTimeout),clearTimeout(this.doubleClickImageTimeout),r.toggleOnDblclick&&this.viewed&&e.target===this.image?this.pointerMoved?this.imageClicked=!1:this.imageClicked?(this.imageClicked=!1,this.doubleClickImageTimeout=setTimeout(function(){ze(n.image,U,{originalEvent:e})},50)):(this.imageClicked=!0,this.doubleClickImageTimeout=setTimeout(function(){n.imageClicked=!1},500)):(this.imageClicked=!1,r.backdrop&&"static"!==r.backdrop&&e.target===this.canvas&&(this.clickCanvasTimeout=setTimeout(function(){ze(n.canvas,R,{originalEvent:e})},50)))))},resize:function(){var e=this;if(this.isShown&&!this.hiding&&(this.fulled&&(this.close(),this.initBody(),this.open()),this.initContainer(),this.initViewer(),this.renderViewer(),this.renderList(),this.viewed&&this.initImage(function(){e.renderImage()}),this.played)){if(this.options.fullscreen&&this.fulled&&!(document.fullscreenElement||document.webkitFullscreenElement||document.mozFullScreenElement||document.msFullscreenElement))return void this.stop();Ee(this.player.getElementsByTagName("img"),function(t){Pe(t,P,e.loadImage.bind(e),{once:!0}),ze(t,P)})}},wheel:function(e){var t=this;if(this.viewed&&(e.preventDefault(),!this.wheeling)){this.wheeling=!0,setTimeout(function(){t.wheeling=!1},50);var n=Number(this.options.zoomRatio)||.1,r=1;e.deltaY?r=e.deltaY>0?1:-1:e.wheelDelta?r=-e.wheelDelta/120:e.detail&&(r=e.detail>0?1:-1),this.zoom(-r*n,!0,null,e)}}},nt={show:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=this.element,n=this.options;if(n.inline||this.showing||this.isShown||this.showing)return this;if(!this.ready)return this.build(),this.ready&&this.show(e),this;if(Be(n.show)&&Pe(t,Z,n.show,{once:!0}),!1===ze(t,Z)||!this.ready)return this;this.hiding&&this.transitioning.abort(),this.showing=!0,this.open();var r=this.viewer;if(Qe(r,B),r.setAttribute("role","dialog"),r.setAttribute("aria-labelledby",this.title.id),r.setAttribute("aria-modal",!0),r.removeAttribute("aria-hidden"),n.transition&&!e){var i=this.shown.bind(this);this.transitioning={abort:function(){Oe(r,_,i),Qe(r,F)}},Me(r,L),r.initialOffsetWidth=r.offsetWidth,Pe(r,_,i,{once:!0}),Me(r,F)}else Me(r,F),this.shown();return this},hide:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]&&arguments[0],n=this.element,r=this.options;if(r.inline||this.hiding||!this.isShown&&!this.showing)return this;if(Be(r.hide)&&Pe(n,te,r.hide,{once:!0}),!1===ze(n,te))return this;this.showing&&this.transitioning.abort(),this.hiding=!0,this.played?this.stop():this.viewing&&this.viewing.abort();var i=this.viewer,o=this.image,a=function(){Qe(i,F),e.hidden()};if(r.transition&&!t){var s=function(t){t&&t.target===i&&(Oe(i,_,s),e.hidden())},l=function(){Ne(i,L)?(Pe(i,_,s),Qe(i,F)):a()};this.transitioning={abort:function(){e.viewed&&Ne(o,L)?Oe(o,_,l):Ne(i,L)&&Oe(i,_,s)}},this.viewed&&Ne(o,L)?(Pe(o,_,l,{once:!0}),this.zoomTo(0,!1,null,null,!0)):l()}else a();return this},view:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.options.initialViewIndex;if(t=Number(t)||0,this.hiding||this.played||t<0||t>=this.length||this.viewed&&t===this.index)return this;if(!this.isShown)return this.index=t,this.show();this.viewing&&this.viewing.abort();var n=this.element,r=this.options,i=this.title,o=this.canvas,a=this.items[t],s=a.querySelector("img"),l=Ue(s,"originalUrl"),c=s.getAttribute("alt"),u=document.createElement("img");if(Ee(r.inheritedAttributes,function(e){var t=s.getAttribute(e);null!==t&&u.setAttribute(e,t)}),u.src=l,u.alt=c,Be(r.view)&&Pe(n,re,r.view,{once:!0}),!1===ze(n,re,{originalImage:this.images[t],index:t,image:u})||!this.isShown||this.hiding||this.played)return this;var f=this.items[this.index];f&&(Qe(f,A),f.removeAttribute("aria-selected")),Me(a,A),a.setAttribute("aria-selected",!0),r.focus&&a.focus(),this.image=u,this.viewed=!1,this.index=t,this.imageData={},Me(u,D),r.loading&&Me(o,N),o.innerHTML="",o.appendChild(u),this.renderList(),i.innerHTML="";var d,h,p=function(){var t=e.imageData,n=Array.isArray(r.title)?r.title[1]:r.title;i.innerHTML=De(Be(n)?n.call(e,u,t):"".concat(c," (").concat(t.naturalWidth," × ").concat(t.naturalHeight,")"))};return Pe(n,ie,p,{once:!0}),this.viewing={abort:function(){Oe(n,ie,p),u.complete?e.imageRendering?e.imageRendering.abort():e.imageInitializing&&e.imageInitializing.abort():(u.src="",Oe(u,P,d),e.timeout&&clearTimeout(e.timeout))}},u.complete?this.load():(Pe(u,P,d=function(){Oe(u,z,h),e.load()},{once:!0}),Pe(u,z,h=function(){Oe(u,P,d),e.timeout&&(clearTimeout(e.timeout),e.timeout=!1),Qe(u,D),r.loading&&Qe(e.canvas,N)},{once:!0}),this.timeout&&clearTimeout(this.timeout),this.timeout=setTimeout(function(){Qe(u,D),e.timeout=!1},1e3)),this},prev:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=this.index-1;return t<0&&(t=e?this.length-1:0),this.view(t),this},next:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=this.length-1,n=this.index+1;return n>t&&(n=e?0:t),this.view(n),this},move:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:e,n=this.imageData;return this.moveTo(we(e)?e:n.x+Number(e),we(t)?t:n.y+Number(t)),this},moveTo:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:e,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,i=this.element,o=this.options,a=this.imageData;if(e=Number(e),n=Number(n),this.viewed&&!this.played&&o.movable){var s=a.x,l=a.y,c=!1;if(be(e)?c=!0:e=s,be(n)?c=!0:n=l,c){if(Be(o.move)&&Pe(i,oe,o.move,{once:!0}),!1===ze(i,oe,{x:e,y:n,oldX:s,oldY:l,originalEvent:r}))return this;a.x=e,a.y=n,a.left=e,a.top=n,this.moving=!0,this.renderImage(function(){t.moving=!1,Be(o.moved)&&Pe(i,ae,o.moved,{once:!0}),ze(i,ae,{x:e,y:n,oldX:s,oldY:l,originalEvent:r},{cancelable:!1})})}}return this},rotate:function(e){return this.rotateTo((this.imageData.rotate||0)+Number(e)),this},rotateTo:function(e){var t=this,n=this.element,r=this.options,i=this.imageData;if(be(e=Number(e))&&this.viewed&&!this.played&&r.rotatable){var o=i.rotate;if(Be(r.rotate)&&Pe(n,se,r.rotate,{once:!0}),!1===ze(n,se,{degree:e,oldDegree:o}))return this;i.rotate=e,this.rotating=!0,this.renderImage(function(){t.rotating=!1,Be(r.rotated)&&Pe(n,le,r.rotated,{once:!0}),ze(n,le,{degree:e,oldDegree:o},{cancelable:!1})})}return this},scaleX:function(e){return this.scale(e,this.imageData.scaleY),this},scaleY:function(e){return this.scale(this.imageData.scaleX,e),this},scale:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:e,r=this.element,i=this.options,o=this.imageData;if(e=Number(e),n=Number(n),this.viewed&&!this.played&&i.scalable){var a=o.scaleX,s=o.scaleY,l=!1;if(be(e)?l=!0:e=a,be(n)?l=!0:n=s,l){if(Be(i.scale)&&Pe(r,ce,i.scale,{once:!0}),!1===ze(r,ce,{scaleX:e,scaleY:n,oldScaleX:a,oldScaleY:s}))return this;o.scaleX=e,o.scaleY=n,this.scaling=!0,this.renderImage(function(){t.scaling=!1,Be(i.scaled)&&Pe(r,ue,i.scaled,{once:!0}),ze(r,ue,{scaleX:e,scaleY:n,oldScaleX:a,oldScaleY:s},{cancelable:!1})})}}return this},zoom:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null,i=this.imageData;return e=(e=Number(e))<0?1/(1-e):1+e,this.zoomTo(i.width*e/i.naturalWidth,t,n,r),this},zoomTo:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]&&arguments[1],r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null,o=arguments.length>4&&void 0!==arguments[4]&&arguments[4],a=this.element,s=this.options,l=this.pointers,c=this.imageData,u=c.x,f=c.y,d=c.width,h=c.height,p=c.naturalWidth,g=c.naturalHeight;if(be(e=Math.max(0,e))&&this.viewed&&!this.played&&(o||s.zoomable)){if(!o){var m=Math.max(.01,s.minZoomRatio),y=Math.min(100,s.maxZoomRatio);e=Math.min(Math.max(e,m),y)}if(i)switch(i.type){case"wheel":s.zoomRatio>=.055&&e>.95&&e<1.05&&(e=1);break;case"pointermove":case"touchmove":case"mousemove":e>.99&&e<1.01&&(e=1)}var v=p*e,A=g*e,b=v-d,w=A-h,I=c.ratio;if(Be(s.zoom)&&Pe(a,fe,s.zoom,{once:!0}),!1===ze(a,fe,{ratio:e,oldRatio:I,originalEvent:i}))return this;if(this.zooming=!0,i){var x=$e(this.viewer),C=l&&Object.keys(l).length>0?Xe(l):{pageX:i.pageX,pageY:i.pageY};c.x-=b*((C.pageX-x.left-u)/d),c.y-=w*((C.pageY-x.top-f)/h)}else Ce(r)&&be(r.x)&&be(r.y)?(c.x-=b*((r.x-u)/d),c.y-=w*((r.y-f)/h)):(c.x-=b/2,c.y-=w/2);c.left=c.x,c.top=c.y,c.width=v,c.height=A,c.oldRatio=I,c.ratio=e,this.renderImage(function(){t.zooming=!1,Be(s.zoomed)&&Pe(a,de,s.zoomed,{once:!0}),ze(a,de,{ratio:e,oldRatio:I,originalEvent:i},{cancelable:!1})}),n&&this.tooltip()}return this},play:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(!this.isShown||this.played)return this;var n=this.element,r=this.options;if(Be(r.play)&&Pe(n,he,r.play,{once:!0}),!1===ze(n,he))return this;var i=this.player,o=this.loadImage.bind(this),a=[],s=0,l=0;if(this.played=!0,this.onLoadWhenPlay=o,t&&this.requestFullscreen(t),Me(i,T),Ee(this.items,function(e,t){var n=e.querySelector("img"),c=document.createElement("img");c.src=Ue(n,"originalUrl"),c.alt=n.getAttribute("alt"),c.referrerPolicy=n.referrerPolicy,s+=1,Me(c,w),Te(c,L,r.transition),Ne(e,A)&&(Me(c,F),l=t),a.push(c),Pe(c,P,o,{once:!0}),i.appendChild(c)}),be(r.interval)&&r.interval>0){var c=function(){clearTimeout(e.playing.timeout),Qe(a[l],F),Me(a[l=(l-=1)>=0?l:s-1],F),e.playing.timeout=setTimeout(c,r.interval)},u=function(){clearTimeout(e.playing.timeout),Qe(a[l],F),Me(a[l=(l+=1)<s?l:0],F),e.playing.timeout=setTimeout(u,r.interval)};s>1&&(this.playing={prev:c,next:u,timeout:setTimeout(u,r.interval)})}return this},stop:function(){var e=this;if(!this.played)return this;var t=this.element,n=this.options;if(Be(n.stop)&&Pe(t,pe,n.stop,{once:!0}),!1===ze(t,pe))return this;var r=this.player;return clearTimeout(this.playing.timeout),this.playing=!1,this.played=!1,Ee(r.getElementsByTagName("img"),function(t){Oe(t,P,e.onLoadWhenPlay)}),Qe(r,T),r.innerHTML="",this.exitFullscreen(),this},full:function(){var e=this,t=this.options,n=this.viewer,r=this.image,i=this.list;return!this.isShown||this.played||this.fulled||!t.inline||(this.fulled=!0,this.open(),Me(this.button,C),t.transition&&(Qe(i,L),this.viewed&&Qe(r,L)),Me(n,I),n.setAttribute("role","dialog"),n.setAttribute("aria-labelledby",this.title.id),n.setAttribute("aria-modal",!0),n.removeAttribute("style"),Fe(n,{zIndex:t.zIndex}),t.focus&&this.enforceFocus(),this.initContainer(),this.viewerData=ke({},this.containerData),this.renderList(),this.viewed&&this.initImage(function(){e.renderImage(function(){t.transition&&setTimeout(function(){Me(r,L),Me(i,L)},0)})})),this},exit:function(){var e=this,t=this.options,n=this.viewer,r=this.image,i=this.list;return this.isShown&&!this.played&&this.fulled&&t.inline?(this.fulled=!1,this.close(),Qe(this.button,C),t.transition&&(Qe(i,L),this.viewed&&Qe(r,L)),t.focus&&this.clearEnforceFocus(),n.removeAttribute("role"),n.removeAttribute("aria-labelledby"),n.removeAttribute("aria-modal"),Qe(n,I),Fe(n,{zIndex:t.zIndexInline}),this.viewerData=ke({},this.parentData),this.renderViewer(),this.renderList(),this.viewed&&this.initImage(function(){e.renderImage(function(){t.transition&&setTimeout(function(){Me(r,L),Me(i,L)},0)})}),this):this},tooltip:function(){var e=this,t=this.options,n=this.tooltipBox,r=this.imageData;return this.viewed&&!this.played&&t.tooltip?(n.textContent="".concat(Math.round(100*r.ratio),"%"),this.tooltipping?clearTimeout(this.tooltipping):t.transition?(this.fading&&ze(n,_),Me(n,T),Me(n,w),Me(n,L),n.removeAttribute("aria-hidden"),n.initialOffsetWidth=n.offsetWidth,Me(n,F)):(Me(n,T),n.removeAttribute("aria-hidden")),this.tooltipping=setTimeout(function(){t.transition?(Pe(n,_,function(){Qe(n,T),Qe(n,w),Qe(n,L),n.setAttribute("aria-hidden",!0),e.fading=!1},{once:!0}),Qe(n,F),e.fading=!0):(Qe(n,T),n.setAttribute("aria-hidden",!0)),e.tooltipping=!1},1e3),this):this},toggle:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;return 1===this.imageData.ratio?this.zoomTo(this.imageData.oldRatio,!0,null,e):this.zoomTo(1,!0,null,e),this},reset:function(){return this.viewed&&!this.played&&(this.imageData=ke({},this.initialImageData),this.renderImage()),this},update:function(){var e=this,t=this.element,n=this.options,r=this.isImg;if(r&&!t.parentNode)return this.destroy();var i=[];if(Ee(r?[t]:t.querySelectorAll("img"),function(t){Be(n.filter)?n.filter.call(e,t)&&i.push(t):e.getImageURL(t)&&i.push(t)}),!i.length)return this;if(this.images=i,this.length=i.length,this.ready){var o=[];if(Ee(this.items,function(e,t){var n=e.querySelector("img"),r=i[t];r&&n&&r.src===n.src&&r.alt===n.alt||o.push(t)}),Fe(this.list,{width:"auto"}),this.initList(),this.isShown)if(this.length){if(this.viewed){var a=o.indexOf(this.index);if(a>=0)this.viewed=!1,this.view(Math.max(Math.min(this.index-a,this.length-1),0));else{var s=this.items[this.index];Me(s,A),s.setAttribute("aria-selected",!0)}}}else this.image=null,this.viewed=!1,this.index=0,this.imageData={},this.canvas.innerHTML="",this.title.innerHTML=""}else this.build();return this},destroy:function(){var e=this.element,t=this.options;return e[g]?(this.destroyed=!0,this.ready?(this.played&&this.stop(),t.inline?(this.fulled&&this.exit(),this.unbind()):this.isShown?(this.viewing&&(this.imageRendering?this.imageRendering.abort():this.imageInitializing&&this.imageInitializing.abort()),this.hiding&&this.transitioning.abort(),this.hidden()):this.showing&&(this.transitioning.abort(),this.hidden()),this.ready=!1,this.viewer.parentNode.removeChild(this.viewer)):t.inline&&(this.delaying?this.delaying.abort():this.initializing&&this.initializing.abort()),t.inline||(Oe(e,R,this.onElementClick),Oe(e,O,this.onElementKeyDown)),e[g]=void 0,this):this}},rt={getImageURL:function(e){var t=this.options.url;return t=ve(t)?e.getAttribute(t):Be(t)?t.call(this,e):""},enforceFocus:function(){var e=this;this.clearEnforceFocus(),Pe(document,q,this.onFocusin=function(t){var n=e.viewer,r=t.target;if(r!==document&&r!==n&&!n.contains(r)){for(;r;){if(null!==r.getAttribute("tabindex")||"true"===r.getAttribute("aria-modal"))return;r=r.parentElement}n.focus()}})},clearEnforceFocus:function(){this.onFocusin&&(Oe(document,q,this.onFocusin),this.onFocusin=null)},open:function(){var e=this.body;Me(e,Q),this.scrollbarWidth>0&&(e.style.paddingRight="".concat(this.scrollbarWidth+(parseFloat(this.initialBodyComputedPaddingRight)||0),"px"))},close:function(){var e=this.body;Qe(e,Q),this.scrollbarWidth>0&&(e.style.paddingRight=this.initialBodyPaddingRight)},shown:function(){var e=this.element,t=this.options,n=this.viewer;this.fulled=!0,this.isShown=!0,this.render(),this.bind(),this.showing=!1,t.focus&&(n.focus(),this.enforceFocus()),Be(t.shown)&&Pe(e,ee,t.shown,{once:!0}),!1!==ze(e,ee)&&this.ready&&this.isShown&&!this.hiding&&this.view(this.index)},hidden:function(){var e=this.element,t=this.options,n=this.viewer,r=n.ownerDocument.activeElement;r&&n.contains(r)&&Be(r.blur)&&r.blur(),t.focus&&this.clearEnforceFocus(),this.close(),this.unbind(),Me(n,B),n.removeAttribute("role"),n.removeAttribute("aria-labelledby"),n.removeAttribute("aria-modal"),n.setAttribute("aria-hidden",!0),this.resetList(),this.resetImage(),this.fulled=!1,this.viewed=!1,this.isShown=!1,this.hiding=!1,this.destroyed||(Be(t.hidden)&&Pe(e,ne,t.hidden,{once:!0}),ze(e,ne,null,{cancelable:!1}))},requestFullscreen:function(e){var t=this.element.ownerDocument;if(this.fulled&&!(t.fullscreenElement||t.webkitFullscreenElement||t.mozFullScreenElement||t.msFullscreenElement)){var n=t.documentElement;n.requestFullscreen?Ce(e)?n.requestFullscreen(e):n.requestFullscreen():n.webkitRequestFullscreen?n.webkitRequestFullscreen(Element.ALLOW_KEYBOARD_INPUT):n.mozRequestFullScreen?n.mozRequestFullScreen():n.msRequestFullscreen&&n.msRequestFullscreen()}},exitFullscreen:function(){var e=this.element.ownerDocument;this.fulled&&(e.fullscreenElement||e.webkitFullscreenElement||e.mozFullScreenElement||e.msFullscreenElement)&&(e.exitFullscreen?e.exitFullscreen():e.webkitExitFullscreen?e.webkitExitFullscreen():e.mozCancelFullScreen?e.mozCancelFullScreen():e.msExitFullscreen&&e.msExitFullscreen())},change:function(e){var t=this.options,n=this.pointers,r=n[Object.keys(n)[0]];if(r){var i=r.endX-r.startX,o=r.endY-r.startY;switch(this.action){case m:0===i&&0===o||(this.pointerMoved=!0,this.move(i,o,e));break;case v:this.zoom(Je(n),!1,null,e);break;case y:this.action="switched";var a=Math.abs(i);a>1&&a>Math.abs(o)&&(this.pointers={},i>1?this.prev(t.loop):i<-1&&this.next(t.loop))}Ee(n,function(e){e.startX=e.endX,e.startY=e.endY})}},isSwitchable:function(){var e=this.imageData,t=this.viewerData;return this.length>1&&e.x>=0&&e.y>=0&&e.width<=t.width&&e.height<=t.height}},it=d.Viewer,ot=(Ke=-1,function(){return Ke+=1}),at=function(){function t(n){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(e(this,t),!n||1!==n.nodeType)throw new Error("The first argument is required and must be an element.");this.element=n,this.options=ke({},c,Ce(r)&&r),this.action=!1,this.fading=!1,this.fulled=!1,this.hiding=!1,this.imageClicked=!1,this.imageData={},this.index=this.options.initialViewIndex,this.isImg=!1,this.isShown=!1,this.length=0,this.moving=!1,this.played=!1,this.playing=!1,this.pointers={},this.ready=!1,this.rotating=!1,this.scaling=!1,this.showing=!1,this.timeout=!1,this.tooltipping=!1,this.viewed=!1,this.viewing=!1,this.wheeling=!1,this.zooming=!1,this.pointerMoved=!1,this.id=ot(),this.init()}return n(t,[{key:"init",value:function(){var e=this,t=this.element,n=this.options;if(!t[g]){t[g]=this,n.focus&&!n.keyboard&&(n.focus=!1);var r="img"===t.localName,i=[];if(Ee(r?[t]:t.querySelectorAll("img"),function(t){Be(n.filter)?n.filter.call(e,t)&&i.push(t):e.getImageURL(t)&&i.push(t)}),this.isImg=r,this.length=i.length,this.images=i,this.initBody(),we(document.createElement(g).style.transition)&&(n.transition=!1),n.inline){var o=0,a=function(){var t;(o+=1)===e.length&&(e.initializing=!1,e.delaying={abort:function(){clearTimeout(t)}},t=setTimeout(function(){e.delaying=!1,e.build()},0))};this.initializing={abort:function(){Ee(i,function(e){e.complete||(Oe(e,P,a),Oe(e,z,a))})}},Ee(i,function(e){var t,n;e.complete?a():(Pe(e,P,t=function(){Oe(e,z,n),a()},{once:!0}),Pe(e,z,n=function(){Oe(e,P,t),a()},{once:!0}))})}else Pe(t,R,this.onElementClick=function(t){var r=t.target;"img"!==r.localName||Be(n.filter)&&!n.filter.call(e,r)||e.view(e.images.indexOf(r))}),Pe(t,O,this.onElementKeyDown=function(t){var r=t.target,i=t.key;"img"!==r.localName||"Enter"!==i&&" "!==i||(t.preventDefault(),Be(n.filter)&&!n.filter.call(e,r)||e.view(e.images.indexOf(r)))})}}},{key:"build",value:function(){if(!this.ready){var e=this.element,t=this.options,n=e.parentNode,r=document.createElement("div");r.innerHTML=u;var i=r.querySelector(".".concat(g,"-container")),o=i.querySelector(".".concat(g,"-title")),a=i.querySelector(".".concat(g,"-toolbar")),s=i.querySelector(".".concat(g,"-navbar")),l=i.querySelector(".".concat(g,"-button")),c=i.querySelector(".".concat(g,"-canvas"));if(this.parent=n,this.viewer=i,this.title=o,this.toolbar=a,this.navbar=s,this.button=l,this.canvas=c,this.footer=i.querySelector(".".concat(g,"-footer")),this.tooltipBox=i.querySelector(".".concat(g,"-tooltip")),this.player=i.querySelector(".".concat(g,"-player")),this.list=i.querySelector(".".concat(g,"-list")),i.id="".concat(g).concat(this.id),o.id="".concat(g,"Title").concat(this.id),Me(o,t.title?We(Array.isArray(t.title)?t.title[0]:t.title):B),Me(s,t.navbar?We(t.navbar):B),Te(l,B,!t.button),t.keyboard&&l.setAttribute("tabindex",0),t.backdrop&&(Me(i,"".concat(g,"-backdrop")),t.inline||"static"===t.backdrop||He(c,ge,"hide")),ve(t.className)&&t.className&&t.className.split(me).forEach(function(e){Me(i,e)}),t.toolbar){var f=document.createElement("ul"),d=Ce(t.toolbar),h=ye.slice(0,3),p=ye.slice(7,9),m=ye.slice(9);d||Me(a,We(t.toolbar)),Ee(d?t.toolbar:ye,function(e,n){var r=d&&Ce(e),i=d?Re(n):e,o=r&&!we(e.show)?e.show:e;if(o&&(t.zoomable||-1===h.indexOf(i))&&(t.rotatable||-1===p.indexOf(i))&&(t.scalable||-1===m.indexOf(i))){var a=r&&!we(e.size)?e.size:e,s=r&&!we(e.click)?e.click:e,l=document.createElement("li");t.keyboard&&l.setAttribute("tabindex",0),l.setAttribute("role","button"),Me(l,"".concat(g,"-").concat(i)),Be(s)||He(l,ge,i),be(o)&&Me(l,We(o)),-1!==["small","large"].indexOf(a)?Me(l,"".concat(g,"-").concat(a)):"play"===i&&Me(l,"".concat(g,"-large")),Be(s)&&Pe(l,R,s),f.appendChild(l)}}),a.appendChild(f)}else Me(a,B);if(!t.rotatable){var y=a.querySelectorAll('li[class*="rotate"]');Me(y,D),Ee(y,function(e){a.appendChild(e)})}if(t.inline)Me(l,x),Fe(i,{zIndex:t.zIndexInline}),"static"===window.getComputedStyle(n).position&&Fe(n,{position:"relative"}),n.insertBefore(i,e.nextSibling);else{Me(l,b),Me(i,I),Me(i,w),Me(i,B),Fe(i,{zIndex:t.zIndex});var v=t.container;ve(v)&&(v=e.ownerDocument.querySelector(v)),v||(v=this.body),v.appendChild(i)}t.inline&&(this.render(),this.bind(),this.isShown=!0),this.ready=!0,Be(t.ready)&&Pe(e,K,t.ready,{once:!0}),!1!==ze(e,K)?this.ready&&t.inline&&this.view(this.index):this.ready=!1}}}],[{key:"noConflict",value:function(){return window.Viewer=it,t}},{key:"setDefaults",value:function(e){ke(c,Ce(e)&&e)}}])}();return ke(at.prototype,Ze,et,tt,nt,rt),at}()}(My);var Qy=Br(My.exports);function Ty(e,t){void 0===t&&(t={});var n=t.insertAt;if(e&&"undefined"!=typeof document){var r=document.head||document.getElementsByTagName("head")[0],i=document.createElement("style");i.type="text/css","top"===n&&r.firstChild?r.insertBefore(i,r.firstChild):r.appendChild(i),i.styleSheet?i.styleSheet.cssText=e:i.appendChild(document.createTextNode(e))}}function Ly(e,t,n){(void 0!==n&&!te(e[t],n)||void 0===n&&!(t in e))&&ei(e,t,n)}function Ry(e){return N(e)&&ut(e)}function Uy(e,t){if(("constructor"!==t||"function"!=typeof e[t])&&"__proto__"!=t)return e[t]}function Hy(e,t,n,r,i,o,a){var s=Uy(e,n),l=Uy(t,n),c=a.get(l);if(c)Ly(e,n,c);else{var u,f=o?o(s,l,n+"",e,t,a):void 0,d=void 0===f;if(d){var h=A(l),p=!h&&je(l),g=!h&&!p&&tt(l);f=l,h||p||g?A(s)?f=s:Ry(s)?f=In(s):p?(d=!1,f=fi(l,!0)):g?(d=!1,f=bi(l,!0)):f=[]:gu(l)||Oe(l)?(f=s,Oe(s)?f=ri(u=s,ai(u)):R(s)&&!U(s)||(f=Ci(l))):d=!1}d&&(a.set(l,f),i(f,l,r,o,a),a.delete(l)),Ly(e,n,f)}}function qy(e,t,n,r,i){e!==t&&Qe(t,function(o,a){if(i||(i=new gt),R(o))Hy(e,t,a,n,qy,r,i);else{var s=r?r(Uy(e,a),o,a+"",e,t,i):void 0;void 0===s&&(s=o),Ly(e,a,s)}},ai)}Ty("/*!\n * Viewer.js v1.12.0\n * https://fengyuanchen.github.io/viewerjs\n *\n * Copyright 2015-present Chen Fengyuan\n * Released under the MIT license\n *\n * Date: 2026-08-22T13:00:37.884Z\n */\n\n.viewer-zoom-in::before, .viewer-zoom-out::before, .viewer-one-to-one::before, .viewer-reset::before, .viewer-prev::before, .viewer-play::before, .viewer-next::before, .viewer-rotate-left::before, .viewer-rotate-right::before, .viewer-flip-horizontal::before, .viewer-flip-vertical::before, .viewer-fullscreen::before, .viewer-fullscreen-exit::before, .viewer-close::before {\n background-image: url(\"data:image/svg+xml,%3Csvg xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22 viewBox%3D%220 0 560 40%22%3E%3Cpath fill%3D%22%23fff%22 d%3D%22M49.6 17.9h20.2v3.9H49.6zm123.1 2 10.9-11 2.7 2.8-8.2 8.2 8.2 8.2-2.7 2.7-10.9-10.9zm94 0-10.8-11-2.7 2.8 8.1 8.2-8.1 8.2 2.7 2.7 10.8-10.9zM212 9.3l20.1 10.6L212 30.5V9.3zm161.5 4.6-7.2 6 7.2 5.9v-4h12.4v4l7.3-5.9-7.3-6v4h-12.4v-4zm40.2 12.3 5.9 7.2 5.9-7.2h-4V13.6h4l-5.9-7.3-5.9 7.3h4v12.6h-4zm35.9-16.5h6.3v2h-4.3V16h-2V9.7Zm14 0h6.2V16h-2v-4.3h-4.2v-2Zm6.2 14V30h-6.2v-2h4.2v-4.3h2Zm-14 6.3h-6.2v-6.3h2v4.4h4.3v2Zm-438 .1v-8.3H9.6v-3.9h8.2V9.7h3.9v8.2h8.1v3.9h-8.1v8.3h-3.9zM93.6 9.7h-5.8v3.9h2V30h3.8V9.7zm16.1 0h-5.8v3.9h1.9V30h3.9V9.7zm-11.9 4.1h3.9v3.9h-3.9zm0 8.2h3.9v3.9h-3.9zm244.6-11.7 7.2 5.9-7.2 6v-3.6c-5.4-.4-7.8.8-8.7 2.8-.8 1.7-1.8 4.9 2.8 8.2-6.3-2-7.5-6.9-6-11.3 1.6-4.4 8-5 11.9-4.9v-3.1Zm147.2 13.4h6.3V30h-2v-4.3h-4.3v-2zm14 6.3v-6.3h6.2v2h-4.3V30h-1.9zm6.2-14h-6.2V9.7h1.9V14h4.3v2zm-13.9 0h-6.3v-2h4.3V9.7h2V16zm33.3 12.5 8.6-8.6-8.6-8.7 1.9-1.9 8.6 8.7 8.6-8.7 1.9 1.9-8.6 8.7 8.6 8.6-1.9 2-8.6-8.7-8.6 8.7-1.9-2zM297 10.3l-7.1 5.9 7.2 6v-3.6c5.3-.4 7.7.8 8.7 2.8.8 1.7 1.7 4.9-2.9 8.2 6.3-2 7.5-6.9 6-11.3-1.6-4.4-7.9-5-11.8-4.9v-3.1Zm-157.3-.6c2.3 0 4.4.7 6 2l2.5-3 1.9 9.2h-9.3l2.6-3.1a6.2 6.2 0 0 0-9.9 5.1c0 3.4 2.8 6.3 6.2 6.3 2.8 0 5.1-1.9 6-4.4h4c-1 4.7-5 8.3-10 8.3a10 10 0 0 1-10-10.2 10 10 0 0 1 10-10.2Z%22%2F%3E%3C%2Fsvg%3E\");\n background-repeat: no-repeat;\n background-size: 280px;\n color: transparent;\n display: block;\n font-size: 0;\n height: 20px;\n line-height: 0;\n width: 20px;\n }\n\n.viewer-zoom-in::before {\n background-position: 0 0;\n content: 'Zoom In';\n}\n\n.viewer-zoom-out::before {\n background-position: -20px 0;\n content: 'Zoom Out';\n}\n\n.viewer-one-to-one::before {\n background-position: -40px 0;\n content: 'One to One';\n}\n\n.viewer-reset::before {\n background-position: -60px 0;\n content: 'Reset';\n}\n\n.viewer-prev::before {\n background-position: -80px 0;\n content: 'Previous';\n}\n\n.viewer-play::before {\n background-position: -100px 0;\n content: 'Play';\n}\n\n.viewer-next::before {\n background-position: -120px 0;\n content: 'Next';\n}\n\n.viewer-rotate-left::before {\n background-position: -140px 0;\n content: 'Rotate Left';\n}\n\n.viewer-rotate-right::before {\n background-position: -160px 0;\n content: 'Rotate Right';\n}\n\n.viewer-flip-horizontal::before {\n background-position: -180px 0;\n content: 'Flip Horizontal';\n}\n\n.viewer-flip-vertical::before {\n background-position: -200px 0;\n content: 'Flip Vertical';\n}\n\n.viewer-fullscreen::before {\n background-position: -220px 0;\n content: 'Enter Full Screen';\n}\n\n.viewer-fullscreen-exit::before {\n background-position: -240px 0;\n content: 'Exit Full Screen';\n}\n\n.viewer-close::before {\n background-position: -260px 0;\n content: 'Close';\n}\n\n.viewer-container {\n bottom: 0;\n direction: ltr;\n font-size: 0;\n left: 0;\n line-height: 0;\n overflow: hidden;\n position: absolute;\n right: 0;\n -webkit-tap-highlight-color: transparent;\n top: 0;\n -ms-touch-action: none;\n touch-action: none;\n -webkit-touch-callout: none;\n -webkit-user-select: none;\n -moz-user-select: none;\n -ms-user-select: none;\n user-select: none;\n}\n\n.viewer-container::-moz-selection, .viewer-container *::-moz-selection {\n background-color: transparent;\n }\n\n.viewer-container::selection,\n .viewer-container *::selection {\n background-color: transparent;\n }\n\n.viewer-container:focus {\n outline: 0;\n }\n\n.viewer-container img {\n display: block;\n height: auto;\n max-height: none !important;\n max-width: none !important;\n min-height: 0 !important;\n min-width: 0 !important;\n width: 100%;\n }\n\n.viewer-canvas {\n bottom: 0;\n left: 0;\n overflow: hidden;\n position: absolute;\n right: 0;\n top: 0;\n}\n\n.viewer-canvas > img {\n height: auto;\n margin: 15px auto;\n max-width: 90% !important;\n width: auto;\n }\n\n.viewer-footer {\n bottom: 0;\n left: 0;\n overflow: hidden;\n position: absolute;\n right: 0;\n text-align: center;\n}\n\n.viewer-navbar {\n background-color: rgba(0, 0, 0, 0.5);\n overflow: hidden;\n}\n\n.viewer-list {\n box-sizing: content-box;\n height: 50px;\n margin: 0;\n overflow: hidden;\n padding: 1px 0;\n}\n\n.viewer-list > li {\n color: transparent;\n cursor: pointer;\n float: left;\n font-size: 0;\n height: 50px;\n line-height: 0;\n opacity: 0.5;\n overflow: hidden;\n transition: opacity 0.15s;\n width: 30px;\n }\n\n.viewer-list > li:focus,\n .viewer-list > li:hover {\n opacity: 0.75;\n }\n\n.viewer-list > li:focus {\n outline: 0;\n }\n\n.viewer-list > li + li {\n margin-left: 1px;\n }\n\n.viewer-list > .viewer-loading {\n position: relative;\n }\n\n.viewer-list > .viewer-loading::after {\n border-width: 2px;\n height: 20px;\n margin-left: -10px;\n margin-top: -10px;\n width: 20px;\n }\n\n.viewer-list > .viewer-active,\n .viewer-list > .viewer-active:focus,\n .viewer-list > .viewer-active:hover {\n opacity: 1;\n }\n\n.viewer-player {\n background-color: #000;\n bottom: 0;\n cursor: none;\n display: none;\n left: 0;\n position: absolute;\n right: 0;\n top: 0;\n z-index: 1;\n}\n\n.viewer-player > img {\n left: 0;\n position: absolute;\n top: 0;\n }\n\n.viewer-toolbar > ul {\n display: inline-block;\n margin: 0 auto 5px;\n overflow: hidden;\n padding: 6px 3px;\n }\n\n.viewer-toolbar > ul > li {\n background-color: rgba(0, 0, 0, 0.5);\n border-radius: 50%;\n cursor: pointer;\n float: left;\n height: 24px;\n overflow: hidden;\n transition: background-color 0.15s;\n width: 24px;\n }\n\n.viewer-toolbar > ul > li:focus,\n .viewer-toolbar > ul > li:hover {\n background-color: rgba(0, 0, 0, 0.8);\n }\n\n.viewer-toolbar > ul > li:focus {\n box-shadow: 0 0 3px #fff;\n outline: 0;\n position: relative;\n z-index: 1;\n }\n\n.viewer-toolbar > ul > li::before {\n margin: 2px;\n }\n\n.viewer-toolbar > ul > li + li {\n margin-left: 1px;\n }\n\n.viewer-toolbar > ul > .viewer-small {\n height: 18px;\n margin-bottom: 3px;\n margin-top: 3px;\n width: 18px;\n }\n\n.viewer-toolbar > ul > .viewer-small::before {\n margin: -1px;\n }\n\n.viewer-toolbar > ul > .viewer-large {\n height: 30px;\n margin-bottom: -3px;\n margin-top: -3px;\n width: 30px;\n }\n\n.viewer-toolbar > ul > .viewer-large::before {\n margin: 5px;\n }\n\n.viewer-tooltip {\n background-color: rgba(0, 0, 0, 0.8);\n border-radius: 10px;\n color: #fff;\n display: none;\n font-size: 12px;\n height: 20px;\n left: 50%;\n line-height: 20px;\n margin-left: -25px;\n margin-top: -10px;\n position: absolute;\n text-align: center;\n top: 50%;\n width: 50px;\n}\n\n.viewer-title {\n color: #ccc;\n display: inline-block;\n font-size: 12px;\n line-height: 1.2;\n margin: 5px 5%;\n max-width: 90%;\n min-height: 14px;\n opacity: 0.8;\n overflow: hidden;\n text-overflow: ellipsis;\n transition: opacity 0.15s;\n white-space: nowrap;\n}\n\n.viewer-title:hover {\n opacity: 1;\n }\n\n.viewer-button {\n -webkit-app-region: no-drag;\n background-color: rgba(0, 0, 0, 0.5);\n border-radius: 50%;\n cursor: pointer;\n height: 80px;\n overflow: hidden;\n position: absolute;\n right: -40px;\n top: -40px;\n transition: background-color 0.15s;\n width: 80px;\n}\n\n.viewer-button:focus,\n .viewer-button:hover {\n background-color: rgba(0, 0, 0, 0.8);\n }\n\n.viewer-button:focus {\n box-shadow: 0 0 3px #fff;\n outline: 0;\n }\n\n.viewer-button::before {\n bottom: 15px;\n left: 15px;\n position: absolute;\n }\n\n.viewer-fixed {\n position: fixed;\n}\n\n.viewer-open {\n overflow: hidden;\n}\n\n.viewer-show {\n display: block;\n}\n\n.viewer-hide {\n display: none;\n}\n\n.viewer-backdrop {\n background-color: rgba(0, 0, 0, 0.5);\n}\n\n.viewer-invisible {\n visibility: hidden;\n}\n\n.viewer-move {\n cursor: move;\n cursor: grab;\n}\n\n.viewer-fade {\n opacity: 0;\n}\n\n.viewer-in {\n opacity: 1;\n}\n\n.viewer-transition {\n transition: all 0.3s;\n}\n\n@keyframes viewer-spinner {\n 0% {\n transform: rotate(0deg);\n }\n\n 100% {\n transform: rotate(360deg);\n }\n}\n\n.viewer-loading::after {\n animation: viewer-spinner 1s linear infinite;\n border: 4px solid rgba(255, 255, 255, 0.1);\n border-left-color: rgba(255, 255, 255, 0.5);\n border-radius: 50%;\n content: '';\n display: inline-block;\n height: 40px;\n left: 50%;\n margin-left: -20px;\n margin-top: -20px;\n position: absolute;\n top: 50%;\n width: 40px;\n z-index: 1;\n }\n\n@media (max-width: 767px) {\n .viewer-hide-xs-down {\n display: none;\n }\n}\n\n@media (max-width: 991px) {\n .viewer-hide-sm-down {\n display: none;\n }\n}\n\n@media (max-width: 1199px) {\n .viewer-hide-md-down {\n display: none;\n }\n}\n");var Oy,Py=(Oy=function(e,t,n){qy(e,t,n)},ka(function(e,t){var n=-1,r=t.length,i=r>1?t[r-1]:void 0,o=r>2?t[2]:void 0;for(i=Oy.length>3&&"function"==typeof i?(r--,i):void 0,o&&dn(t[0],t[1],o)&&(i=r<3?void 0:i,r=1),e=Object(e);++n<r;){var a=t[n];a&&Oy(e,a,n,i)}return e}));async function zy(e,t=null,n={}){let r=!0,i=null,o=Ya();Ce(n)||(n={});let a=we(n,"disTouchMoveToHide",null);if(fo(a)||(a=4),a=zi(a),!Iu(e))return o.reject("eleImg is not a HTMLElement"),o;if(i=e,null!==t){if(!Iu(t))return o.reject("eleGroup is not a HTMLElement"),o;r=!1,i=t}if(!r){let e=rr(t.querySelectorAll("img"));if(0===e)return o.reject("eleGroup does not contain any img"),o;1===e&&(r=!0)}let s={button:!1,navbar:!1,title:!1,toolbar:{zoomIn:4,zoomOut:4,oneToOne:4,reset:4,prev:0,play:0,next:0,rotateLeft:4,rotateRight:4,flipHorizontal:4,flipVertical:4},tooltip:!1,movable:!0,zoomable:!0,rotatable:!0,scalable:!0,transition:!0,fullscreen:!1,keyboard:!0};r||(s=function(){let e={button:!1,navbar:!1,title:!1,toolbar:{zoomIn:4,zoomOut:4,oneToOne:4,reset:4,prev:0,play:0,next:0,rotateLeft:4,rotateRight:4,flipHorizontal:4,flipVertical:4},tooltip:!1,movable:!0,zoomable:!0,rotatable:!0,scalable:!0,transition:!0,fullscreen:!1,keyboard:!0};return e.navbar=!0,e.toolbar.prev=4,e.toolbar.next=4,e}()),s=Py(s,Ti(n)),s.shown=function(){(async()=>{let e=null;await us(()=>(e=c.viewer,Iu(e)));let t=!1,n=0,r=0,i=0;e.addEventListener("touchstart",e=>{let i=e.touches[0];n=i.clientX,r=i.clientY,((e,t)=>{let n=document.elementsFromPoint(e,t).find(e=>"IMG"===e.tagName);if(!Iu(n))return!0;let r=n?.classList?.contains("viewer-move");return!r})(n,r)&&(t=!0)},{passive:!1}),e.addEventListener("touchmove",e=>{if(!t)return;let o=e.touches[0],a=o.clientX,s=o.clientY,l=a-n,c=s-r,u=Math.sqrt(l*l+c*c);i+=u,n=o.clientX,r=o.clientY},{passive:!1}),e.addEventListener("touchend",e=>{t&&(i<a&&(e.preventDefault(),e.stopPropagation(),c.hide(!0)),t=!1,i=0)},{passive:!1}),e.addEventListener("touchcancel",e=>{t=!1,i=0})})().catch(e=>{console.log(e)})};let l=!1;s.hide=function(){l||(l=!0,c.hide(!0))},s.hidden=function(){c.destroy(),o.resolve("close")};let c=new Qy(i,s);return c.show(),o}function $y(e,t){let n=new MouseEvent(t,{view:window,bubbles:!0,cancelable:!0});e.dispatchEvent(n)}function jy(e={}){let t=we(e,"kind","*"),n=we(e,"multiple");or(n)||(n=!1);let r=we(e,"entireHierarchy");or(r)||(r=!1),r&&!n&&(n=!0);let i=we(e,"sizeMbLimit");Fe(i)||(i=1e3),i=Ir(i);let o=Ya(),a="drf"+Mu(),s="GrpDomReadFile";um(`[name=${s}]`);let l=Rm(t),c=`<div name="${s}" style="position:relative; width:0px; height:0px; overflow:hidden;"><input id="${a}" type="file" accept="${l}" ${n?"multiple":""} ${r?"webkitdirectory":""} style="opacity:0; position:absolute; top:-10000px; left:-10000px;"></div>`;zu(document.querySelector("body"),c);let u=Sm("#"+a),f=!1;function d(e){f=!0;let t=Um(this,i);o.resolve(t),u.removeEventListener("change",d,!0),u.removeEventListener("cancel",h,!0),r||window.removeEventListener("focus",p),um(`[name=${s}]`)}function h(e){f||d.call(u,e)}function p(e){setTimeout(()=>{f||d.call(u,e)},1500)}return u.addEventListener("change",d,!0),u.addEventListener("cancel",h,!0),r||window.addEventListener("focus",p),$y(u,"click"),o}function Vy(e){if(!Ee(e))return!1;let n="YYYY-MM-DDTHH:mm:ss";return e===t(e,n).format(n)}Ga()&&function(){try{return new MouseEvent("MouseEventPolyfillTest"),!1}catch(e){}let e=function(e,t){t=t||{bubbles:!1,cancelable:!1};let n=document.createEvent("MouseEvent");return n.initMouseEvent(e,t.bubbles,t.cancelable,window,0,t.screenX||0,t.screenY||0,t.clientX||0,t.clientY||0,t.ctrlKey||!1,t.altKey||!1,t.shiftKey||!1,t.metaKey||!1,t.button||0,t.relatedTarget||null),n};e.prototype=Event.prototype,window.MouseEvent=e}();var Yy="top",Gy="bottom",Wy="right",Jy="left",_y="auto",Xy=[Yy,Gy,Wy,Jy],Ky="start",Zy="end",ev="viewport",tv="popper",nv=Xy.reduce(function(e,t){return e.concat([t+"-"+Ky,t+"-"+Zy])},[]),rv=[].concat(Xy,[_y]).reduce(function(e,t){return e.concat([t,t+"-"+Ky,t+"-"+Zy])},[]),iv=["beforeRead","read","afterRead","beforeMain","main","afterMain","beforeWrite","write","afterWrite"];function ov(e){return e?(e.nodeName||"").toLowerCase():null}function av(e){if(null==e)return window;if("[object Window]"!==e.toString()){var t=e.ownerDocument;return t&&t.defaultView||window}return e}function sv(e){return e instanceof av(e).Element||e instanceof Element}function lv(e){return e instanceof av(e).HTMLElement||e instanceof HTMLElement}function cv(e){return"undefined"!=typeof ShadowRoot&&(e instanceof av(e).ShadowRoot||e instanceof ShadowRoot)}var uv={name:"applyStyles",enabled:!0,phase:"write",fn:function(e){var t=e.state;Object.keys(t.elements).forEach(function(e){var n=t.styles[e]||{},r=t.attributes[e]||{},i=t.elements[e];lv(i)&&ov(i)&&(Object.assign(i.style,n),Object.keys(r).forEach(function(e){var t=r[e];!1===t?i.removeAttribute(e):i.setAttribute(e,!0===t?"":t)}))})},effect:function(e){var t=e.state,n={popper:{position:t.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(t.elements.popper.style,n.popper),t.styles=n,t.elements.arrow&&Object.assign(t.elements.arrow.style,n.arrow),function(){Object.keys(t.elements).forEach(function(e){var r=t.elements[e],i=t.attributes[e]||{},o=Object.keys(t.styles.hasOwnProperty(e)?t.styles[e]:n[e]).reduce(function(e,t){return e[t]="",e},{});lv(r)&&ov(r)&&(Object.assign(r.style,o),Object.keys(i).forEach(function(e){r.removeAttribute(e)}))})}},requires:["computeStyles"]};function fv(e){return e.split("-")[0]}var dv=Math.max,hv=Math.min,pv=Math.round;function gv(){var e=navigator.userAgentData;return null!=e&&e.brands&&Array.isArray(e.brands)?e.brands.map(function(e){return e.brand+"/"+e.version}).join(" "):navigator.userAgent}function mv(){return!/^((?!chrome|android).)*safari/i.test(gv())}function yv(e,t,n){void 0===t&&(t=!1),void 0===n&&(n=!1);var r=e.getBoundingClientRect(),i=1,o=1;t&&lv(e)&&(i=e.offsetWidth>0&&pv(r.width)/e.offsetWidth||1,o=e.offsetHeight>0&&pv(r.height)/e.offsetHeight||1);var a=(sv(e)?av(e):window).visualViewport,s=!mv()&&n,l=(r.left+(s&&a?a.offsetLeft:0))/i,c=(r.top+(s&&a?a.offsetTop:0))/o,u=r.width/i,f=r.height/o;return{width:u,height:f,top:c,right:l+u,bottom:c+f,left:l,x:l,y:c}}function vv(e){var t=yv(e),n=e.offsetWidth,r=e.offsetHeight;return Math.abs(t.width-n)<=1&&(n=t.width),Math.abs(t.height-r)<=1&&(r=t.height),{x:e.offsetLeft,y:e.offsetTop,width:n,height:r}}function Av(e,t){var n=t.getRootNode&&t.getRootNode();if(e.contains(t))return!0;if(n&&cv(n)){var r=t;do{if(r&&e.isSameNode(r))return!0;r=r.parentNode||r.host}while(r)}return!1}function bv(e){return av(e).getComputedStyle(e)}function wv(e){return["table","td","th"].indexOf(ov(e))>=0}function Iv(e){return((sv(e)?e.ownerDocument:e.document)||window.document).documentElement}function xv(e){return"html"===ov(e)?e:e.assignedSlot||e.parentNode||(cv(e)?e.host:null)||Iv(e)}function Cv(e){return lv(e)&&"fixed"!==bv(e).position?e.offsetParent:null}function Bv(e){for(var t=av(e),n=Cv(e);n&&wv(n)&&"static"===bv(n).position;)n=Cv(n);return n&&("html"===ov(n)||"body"===ov(n)&&"static"===bv(n).position)?t:n||function(e){var t=/firefox/i.test(gv());if(/Trident/i.test(gv())&&lv(e)&&"fixed"===bv(e).position)return null;var n=xv(e);for(cv(n)&&(n=n.host);lv(n)&&["html","body"].indexOf(ov(n))<0;){var r=bv(n);if("none"!==r.transform||"none"!==r.perspective||"paint"===r.contain||-1!==["transform","perspective"].indexOf(r.willChange)||t&&"filter"===r.willChange||t&&r.filter&&"none"!==r.filter)return n;n=n.parentNode}return null}(e)||t}function Ev(e){return["top","bottom"].indexOf(e)>=0?"x":"y"}function kv(e,t,n){return dv(e,hv(t,n))}function Sv(e){return Object.assign({},{top:0,right:0,bottom:0,left:0},e)}function Fv(e,t){return t.reduce(function(t,n){return t[n]=e,t},{})}var Dv={name:"arrow",enabled:!0,phase:"main",fn:function(e){var t,n=e.state,r=e.name,i=e.options,o=n.elements.arrow,a=n.modifiersData.popperOffsets,s=fv(n.placement),l=Ev(s),c=[Jy,Wy].indexOf(s)>=0?"height":"width";if(o&&a){var u=function(e,t){return Sv("number"!=typeof(e="function"==typeof e?e(Object.assign({},t.rects,{placement:t.placement})):e)?e:Fv(e,Xy))}(i.padding,n),f=vv(o),d="y"===l?Yy:Jy,h="y"===l?Gy:Wy,p=n.rects.reference[c]+n.rects.reference[l]-a[l]-n.rects.popper[c],g=a[l]-n.rects.reference[l],m=Bv(o),y=m?"y"===l?m.clientHeight||0:m.clientWidth||0:0,v=p/2-g/2,A=u[d],b=y-f[c]-u[h],w=y/2-f[c]/2+v,I=kv(A,w,b),x=l;n.modifiersData[r]=((t={})[x]=I,t.centerOffset=I-w,t)}},effect:function(e){var t=e.state,n=e.options.element,r=void 0===n?"[data-popper-arrow]":n;null!=r&&("string"!=typeof r||(r=t.elements.popper.querySelector(r)))&&Av(t.elements.popper,r)&&(t.elements.arrow=r)},requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function Nv(e){return e.split("-")[1]}var Mv={top:"auto",right:"auto",bottom:"auto",left:"auto"};function Qv(e){var t,n=e.popper,r=e.popperRect,i=e.placement,o=e.variation,a=e.offsets,s=e.position,l=e.gpuAcceleration,c=e.adaptive,u=e.roundOffsets,f=e.isFixed,d=a.x,h=void 0===d?0:d,p=a.y,g=void 0===p?0:p,m="function"==typeof u?u({x:h,y:g}):{x:h,y:g};h=m.x,g=m.y;var y=a.hasOwnProperty("x"),v=a.hasOwnProperty("y"),A=Jy,b=Yy,w=window;if(c){var I=Bv(n),x="clientHeight",C="clientWidth";if(I===av(n)&&"static"!==bv(I=Iv(n)).position&&"absolute"===s&&(x="scrollHeight",C="scrollWidth"),i===Yy||(i===Jy||i===Wy)&&o===Zy)b=Gy,g-=(f&&I===w&&w.visualViewport?w.visualViewport.height:I[x])-r.height,g*=l?1:-1;if(i===Jy||(i===Yy||i===Gy)&&o===Zy)A=Wy,h-=(f&&I===w&&w.visualViewport?w.visualViewport.width:I[C])-r.width,h*=l?1:-1}var B,E=Object.assign({position:s},c&&Mv),k=!0===u?function(e,t){var n=e.x,r=e.y,i=t.devicePixelRatio||1;return{x:pv(n*i)/i||0,y:pv(r*i)/i||0}}({x:h,y:g},av(n)):{x:h,y:g};return h=k.x,g=k.y,l?Object.assign({},E,((B={})[b]=v?"0":"",B[A]=y?"0":"",B.transform=(w.devicePixelRatio||1)<=1?"translate("+h+"px, "+g+"px)":"translate3d("+h+"px, "+g+"px, 0)",B)):Object.assign({},E,((t={})[b]=v?g+"px":"",t[A]=y?h+"px":"",t.transform="",t))}var Tv={passive:!0};var Lv={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:function(e){var t=e.state,n=e.instance,r=e.options,i=r.scroll,o=void 0===i||i,a=r.resize,s=void 0===a||a,l=av(t.elements.popper),c=[].concat(t.scrollParents.reference,t.scrollParents.popper);return o&&c.forEach(function(e){e.addEventListener("scroll",n.update,Tv)}),s&&l.addEventListener("resize",n.update,Tv),function(){o&&c.forEach(function(e){e.removeEventListener("scroll",n.update,Tv)}),s&&l.removeEventListener("resize",n.update,Tv)}},data:{}},Rv={left:"right",right:"left",bottom:"top",top:"bottom"};function Uv(e){return e.replace(/left|right|bottom|top/g,function(e){return Rv[e]})}var Hv={start:"end",end:"start"};function qv(e){return e.replace(/start|end/g,function(e){return Hv[e]})}function Ov(e){var t=av(e);return{scrollLeft:t.pageXOffset,scrollTop:t.pageYOffset}}function Pv(e){return yv(Iv(e)).left+Ov(e).scrollLeft}function zv(e){var t=bv(e),n=t.overflow,r=t.overflowX,i=t.overflowY;return/auto|scroll|overlay|hidden/.test(n+i+r)}function $v(e){return["html","body","#document"].indexOf(ov(e))>=0?e.ownerDocument.body:lv(e)&&zv(e)?e:$v(xv(e))}function jv(e,t){var n;void 0===t&&(t=[]);var r=$v(e),i=r===(null==(n=e.ownerDocument)?void 0:n.body),o=av(r),a=i?[o].concat(o.visualViewport||[],zv(r)?r:[]):r,s=t.concat(a);return i?s:s.concat(jv(xv(a)))}function Vv(e){return Object.assign({},e,{left:e.x,top:e.y,right:e.x+e.width,bottom:e.y+e.height})}function Yv(e,t,n){return t===ev?Vv(function(e,t){var n=av(e),r=Iv(e),i=n.visualViewport,o=r.clientWidth,a=r.clientHeight,s=0,l=0;if(i){o=i.width,a=i.height;var c=mv();(c||!c&&"fixed"===t)&&(s=i.offsetLeft,l=i.offsetTop)}return{width:o,height:a,x:s+Pv(e),y:l}}(e,n)):sv(t)?function(e,t){var n=yv(e,!1,"fixed"===t);return n.top=n.top+e.clientTop,n.left=n.left+e.clientLeft,n.bottom=n.top+e.clientHeight,n.right=n.left+e.clientWidth,n.width=e.clientWidth,n.height=e.clientHeight,n.x=n.left,n.y=n.top,n}(t,n):Vv(function(e){var t,n=Iv(e),r=Ov(e),i=null==(t=e.ownerDocument)?void 0:t.body,o=dv(n.scrollWidth,n.clientWidth,i?i.scrollWidth:0,i?i.clientWidth:0),a=dv(n.scrollHeight,n.clientHeight,i?i.scrollHeight:0,i?i.clientHeight:0),s=-r.scrollLeft+Pv(e),l=-r.scrollTop;return"rtl"===bv(i||n).direction&&(s+=dv(n.clientWidth,i?i.clientWidth:0)-o),{width:o,height:a,x:s,y:l}}(Iv(e)))}function Gv(e,t,n,r){var i="clippingParents"===t?function(e){var t=jv(xv(e)),n=["absolute","fixed"].indexOf(bv(e).position)>=0&&lv(e)?Bv(e):e;return sv(n)?t.filter(function(e){return sv(e)&&Av(e,n)&&"body"!==ov(e)}):[]}(e):[].concat(t),o=[].concat(i,[n]),a=o[0],s=o.reduce(function(t,n){var i=Yv(e,n,r);return t.top=dv(i.top,t.top),t.right=hv(i.right,t.right),t.bottom=hv(i.bottom,t.bottom),t.left=dv(i.left,t.left),t},Yv(e,a,r));return s.width=s.right-s.left,s.height=s.bottom-s.top,s.x=s.left,s.y=s.top,s}function Wv(e){var t,n=e.reference,r=e.element,i=e.placement,o=i?fv(i):null,a=i?Nv(i):null,s=n.x+n.width/2-r.width/2,l=n.y+n.height/2-r.height/2;switch(o){case Yy:t={x:s,y:n.y-r.height};break;case Gy:t={x:s,y:n.y+n.height};break;case Wy:t={x:n.x+n.width,y:l};break;case Jy:t={x:n.x-r.width,y:l};break;default:t={x:n.x,y:n.y}}var c=o?Ev(o):null;if(null!=c){var u="y"===c?"height":"width";switch(a){case Ky:t[c]=t[c]-(n[u]/2-r[u]/2);break;case Zy:t[c]=t[c]+(n[u]/2-r[u]/2)}}return t}function Jv(e,t){void 0===t&&(t={});var n=t,r=n.placement,i=void 0===r?e.placement:r,o=n.strategy,a=void 0===o?e.strategy:o,s=n.boundary,l=void 0===s?"clippingParents":s,c=n.rootBoundary,u=void 0===c?ev:c,f=n.elementContext,d=void 0===f?tv:f,h=n.altBoundary,p=void 0!==h&&h,g=n.padding,m=void 0===g?0:g,y=Sv("number"!=typeof m?m:Fv(m,Xy)),v=d===tv?"reference":tv,A=e.rects.popper,b=e.elements[p?v:d],w=Gv(sv(b)?b:b.contextElement||Iv(e.elements.popper),l,u,a),I=yv(e.elements.reference),x=Wv({reference:I,element:A,strategy:"absolute",placement:i}),C=Vv(Object.assign({},A,x)),B=d===tv?C:I,E={top:w.top-B.top+y.top,bottom:B.bottom-w.bottom+y.bottom,left:w.left-B.left+y.left,right:B.right-w.right+y.right},k=e.modifiersData.offset;if(d===tv&&k){var S=k[i];Object.keys(E).forEach(function(e){var t=[Wy,Gy].indexOf(e)>=0?1:-1,n=[Yy,Gy].indexOf(e)>=0?"y":"x";E[e]+=S[n]*t})}return E}function _v(e,t){void 0===t&&(t={});var n=t,r=n.placement,i=n.boundary,o=n.rootBoundary,a=n.padding,s=n.flipVariations,l=n.allowedAutoPlacements,c=void 0===l?rv:l,u=Nv(r),f=u?s?nv:nv.filter(function(e){return Nv(e)===u}):Xy,d=f.filter(function(e){return c.indexOf(e)>=0});0===d.length&&(d=f);var h=d.reduce(function(t,n){return t[n]=Jv(e,{placement:n,boundary:i,rootBoundary:o,padding:a})[fv(n)],t},{});return Object.keys(h).sort(function(e,t){return h[e]-h[t]})}var Xv={name:"flip",enabled:!0,phase:"main",fn:function(e){var t=e.state,n=e.options,r=e.name;if(!t.modifiersData[r]._skip){for(var i=n.mainAxis,o=void 0===i||i,a=n.altAxis,s=void 0===a||a,l=n.fallbackPlacements,c=n.padding,u=n.boundary,f=n.rootBoundary,d=n.altBoundary,h=n.flipVariations,p=void 0===h||h,g=n.allowedAutoPlacements,m=t.options.placement,y=fv(m),v=l||(y===m||!p?[Uv(m)]:function(e){if(fv(e)===_y)return[];var t=Uv(e);return[qv(e),t,qv(t)]}(m)),A=[m].concat(v).reduce(function(e,n){return e.concat(fv(n)===_y?_v(t,{placement:n,boundary:u,rootBoundary:f,padding:c,flipVariations:p,allowedAutoPlacements:g}):n)},[]),b=t.rects.reference,w=t.rects.popper,I=new Map,x=!0,C=A[0],B=0;B<A.length;B++){var E=A[B],k=fv(E),S=Nv(E)===Ky,F=[Yy,Gy].indexOf(k)>=0,D=F?"width":"height",N=Jv(t,{placement:E,boundary:u,rootBoundary:f,altBoundary:d,padding:c}),M=F?S?Wy:Jy:S?Gy:Yy;b[D]>w[D]&&(M=Uv(M));var Q=Uv(M),T=[];if(o&&T.push(N[k]<=0),s&&T.push(N[M]<=0,N[Q]<=0),T.every(function(e){return e})){C=E,x=!1;break}I.set(E,T)}if(x)for(var L=function(e){var t=A.find(function(t){var n=I.get(t);if(n)return n.slice(0,e).every(function(e){return e})});if(t)return C=t,"break"},R=p?3:1;R>0;R--){if("break"===L(R))break}t.placement!==C&&(t.modifiersData[r]._skip=!0,t.placement=C,t.reset=!0)}},requiresIfExists:["offset"],data:{_skip:!1}};function Kv(e,t,n){return void 0===n&&(n={x:0,y:0}),{top:e.top-t.height-n.y,right:e.right-t.width+n.x,bottom:e.bottom-t.height+n.y,left:e.left-t.width-n.x}}function Zv(e){return[Yy,Wy,Gy,Jy].some(function(t){return e[t]>=0})}var eA={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:function(e){var t=e.state,n=e.options,r=e.name,i=n.offset,o=void 0===i?[0,0]:i,a=rv.reduce(function(e,n){return e[n]=function(e,t,n){var r=fv(e),i=[Jy,Yy].indexOf(r)>=0?-1:1,o="function"==typeof n?n(Object.assign({},t,{placement:e})):n,a=o[0],s=o[1];return a=a||0,s=(s||0)*i,[Jy,Wy].indexOf(r)>=0?{x:s,y:a}:{x:a,y:s}}(n,t.rects,o),e},{}),s=a[t.placement],l=s.x,c=s.y;null!=t.modifiersData.popperOffsets&&(t.modifiersData.popperOffsets.x+=l,t.modifiersData.popperOffsets.y+=c),t.modifiersData[r]=a}};var tA={name:"preventOverflow",enabled:!0,phase:"main",fn:function(e){var t=e.state,n=e.options,r=e.name,i=n.mainAxis,o=void 0===i||i,a=n.altAxis,s=void 0!==a&&a,l=n.boundary,c=n.rootBoundary,u=n.altBoundary,f=n.padding,d=n.tether,h=void 0===d||d,p=n.tetherOffset,g=void 0===p?0:p,m=Jv(t,{boundary:l,rootBoundary:c,padding:f,altBoundary:u}),y=fv(t.placement),v=Nv(t.placement),A=!v,b=Ev(y),w="x"===b?"y":"x",I=t.modifiersData.popperOffsets,x=t.rects.reference,C=t.rects.popper,B="function"==typeof g?g(Object.assign({},t.rects,{placement:t.placement})):g,E="number"==typeof B?{mainAxis:B,altAxis:B}:Object.assign({mainAxis:0,altAxis:0},B),k=t.modifiersData.offset?t.modifiersData.offset[t.placement]:null,S={x:0,y:0};if(I){if(o){var F,D="y"===b?Yy:Jy,N="y"===b?Gy:Wy,M="y"===b?"height":"width",Q=I[b],T=Q+m[D],L=Q-m[N],R=h?-C[M]/2:0,U=v===Ky?x[M]:C[M],H=v===Ky?-C[M]:-x[M],q=t.elements.arrow,O=h&&q?vv(q):{width:0,height:0},P=t.modifiersData["arrow#persistent"]?t.modifiersData["arrow#persistent"].padding:{top:0,right:0,bottom:0,left:0},z=P[D],$=P[N],j=kv(0,x[M],O[M]),V=A?x[M]/2-R-j-z-E.mainAxis:U-j-z-E.mainAxis,Y=A?-x[M]/2+R+j+$+E.mainAxis:H+j+$+E.mainAxis,G=t.elements.arrow&&Bv(t.elements.arrow),W=G?"y"===b?G.clientTop||0:G.clientLeft||0:0,J=null!=(F=null==k?void 0:k[b])?F:0,_=Q+Y-J,X=kv(h?hv(T,Q+V-J-W):T,Q,h?dv(L,_):L);I[b]=X,S[b]=X-Q}if(s){var K,Z="x"===b?Yy:Jy,ee="x"===b?Gy:Wy,te=I[w],ne="y"===w?"height":"width",re=te+m[Z],ie=te-m[ee],oe=-1!==[Yy,Jy].indexOf(y),ae=null!=(K=null==k?void 0:k[w])?K:0,se=oe?re:te-x[ne]-C[ne]-ae+E.altAxis,le=oe?te+x[ne]+C[ne]-ae-E.altAxis:ie,ce=h&&oe?function(e,t,n){var r=kv(e,t,n);return r>n?n:r}(se,te,le):kv(h?se:re,te,h?le:ie);I[w]=ce,S[w]=ce-te}t.modifiersData[r]=S}},requiresIfExists:["offset"]};function nA(e,t,n){void 0===n&&(n=!1);var r,i,o=lv(t),a=lv(t)&&function(e){var t=e.getBoundingClientRect(),n=pv(t.width)/e.offsetWidth||1,r=pv(t.height)/e.offsetHeight||1;return 1!==n||1!==r}(t),s=Iv(t),l=yv(e,a,n),c={scrollLeft:0,scrollTop:0},u={x:0,y:0};return(o||!o&&!n)&&(("body"!==ov(t)||zv(s))&&(c=(r=t)!==av(r)&&lv(r)?{scrollLeft:(i=r).scrollLeft,scrollTop:i.scrollTop}:Ov(r)),lv(t)?((u=yv(t,!0)).x+=t.clientLeft,u.y+=t.clientTop):s&&(u.x=Pv(s))),{x:l.left+c.scrollLeft-u.x,y:l.top+c.scrollTop-u.y,width:l.width,height:l.height}}function rA(e){var t=new Map,n=new Set,r=[];function i(e){n.add(e.name),[].concat(e.requires||[],e.requiresIfExists||[]).forEach(function(e){if(!n.has(e)){var r=t.get(e);r&&i(r)}}),r.push(e)}return e.forEach(function(e){t.set(e.name,e)}),e.forEach(function(e){n.has(e.name)||i(e)}),r}function iA(e){var t;return function(){return t||(t=new Promise(function(n){Promise.resolve().then(function(){t=void 0,n(e())})})),t}}var oA={placement:"bottom",modifiers:[],strategy:"absolute"};function aA(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return!t.some(function(e){return!(e&&"function"==typeof e.getBoundingClientRect)})}function sA(e){void 0===e&&(e={});var t=e,n=t.defaultModifiers,r=void 0===n?[]:n,i=t.defaultOptions,o=void 0===i?oA:i;return function(e,t,n){void 0===n&&(n=o);var i={placement:"bottom",orderedModifiers:[],options:Object.assign({},oA,o),modifiersData:{},elements:{reference:e,popper:t},attributes:{},styles:{}},a=[],s=!1,l={state:i,setOptions:function(n){var s="function"==typeof n?n(i.options):n;c(),i.options=Object.assign({},o,i.options,s),i.scrollParents={reference:sv(e)?jv(e):e.contextElement?jv(e.contextElement):[],popper:jv(t)};var u,f,d=function(e){var t=rA(e);return iv.reduce(function(e,n){return e.concat(t.filter(function(e){return e.phase===n}))},[])}((u=[].concat(r,i.options.modifiers),f=u.reduce(function(e,t){var n=e[t.name];return e[t.name]=n?Object.assign({},n,t,{options:Object.assign({},n.options,t.options),data:Object.assign({},n.data,t.data)}):t,e},{}),Object.keys(f).map(function(e){return f[e]})));return i.orderedModifiers=d.filter(function(e){return e.enabled}),i.orderedModifiers.forEach(function(e){var t=e.name,n=e.options,r=void 0===n?{}:n,o=e.effect;if("function"==typeof o){var s=o({state:i,name:t,instance:l,options:r}),c=function(){};a.push(s||c)}}),l.update()},forceUpdate:function(){if(!s){var e=i.elements,t=e.reference,n=e.popper;if(aA(t,n)){i.rects={reference:nA(t,Bv(n),"fixed"===i.options.strategy),popper:vv(n)},i.reset=!1,i.placement=i.options.placement,i.orderedModifiers.forEach(function(e){return i.modifiersData[e.name]=Object.assign({},e.data)});for(var r=0;r<i.orderedModifiers.length;r++)if(!0!==i.reset){var o=i.orderedModifiers[r],a=o.fn,c=o.options,u=void 0===c?{}:c,f=o.name;"function"==typeof a&&(i=a({state:i,options:u,name:f,instance:l})||i)}else i.reset=!1,r=-1}}},update:iA(function(){return new Promise(function(e){l.forceUpdate(),e(i)})}),destroy:function(){c(),s=!0}};if(!aA(e,t))return l;function c(){a.forEach(function(e){return e()}),a=[]}return l.setOptions(n).then(function(e){!s&&n.onFirstUpdate&&n.onFirstUpdate(e)}),l}}var lA=sA({defaultModifiers:[Lv,{name:"popperOffsets",enabled:!0,phase:"read",fn:function(e){var t=e.state,n=e.name;t.modifiersData[n]=Wv({reference:t.rects.reference,element:t.rects.popper,strategy:"absolute",placement:t.placement})},data:{}},{name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:function(e){var t=e.state,n=e.options,r=n.gpuAcceleration,i=void 0===r||r,o=n.adaptive,a=void 0===o||o,s=n.roundOffsets,l=void 0===s||s,c={placement:fv(t.placement),variation:Nv(t.placement),popper:t.elements.popper,popperRect:t.rects.popper,gpuAcceleration:i,isFixed:"fixed"===t.options.strategy};null!=t.modifiersData.popperOffsets&&(t.styles.popper=Object.assign({},t.styles.popper,Qv(Object.assign({},c,{offsets:t.modifiersData.popperOffsets,position:t.options.strategy,adaptive:a,roundOffsets:l})))),null!=t.modifiersData.arrow&&(t.styles.arrow=Object.assign({},t.styles.arrow,Qv(Object.assign({},c,{offsets:t.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:l})))),t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-placement":t.placement})},data:{}},uv,eA,Xv,tA,Dv,{name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:function(e){var t=e.state,n=e.name,r=t.rects.reference,i=t.rects.popper,o=t.modifiersData.preventOverflow,a=Jv(t,{elementContext:"reference"}),s=Jv(t,{altBoundary:!0}),l=Kv(a,r),c=Kv(s,i,o),u=Zv(l),f=Zv(c);t.modifiersData[n]={referenceClippingOffsets:l,popperEscapeOffsets:c,isReferenceHidden:u,hasPopperEscaped:f},t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-reference-hidden":u,"data-popper-escaped":f})}}]}),cA="tippy-content",uA="tippy-arrow",fA="tippy-svg-arrow",dA={passive:!0,capture:!0},hA=function(){return document.body};function pA(e,t,n){if(Array.isArray(e)){var r=e[t];return null==r?Array.isArray(n)?n[t]:n:r}return e}function gA(e,t){var n={}.toString.call(e);return 0===n.indexOf("[object")&&n.indexOf(t+"]")>-1}function mA(e,t){return"function"==typeof e?e.apply(void 0,t):e}function yA(e,t){return 0===t?e:function(r){clearTimeout(n),n=setTimeout(function(){e(r)},t)};var n}function vA(e){return[].concat(e)}function AA(e,t){-1===e.indexOf(t)&&e.push(t)}function bA(e){return[].slice.call(e)}function wA(e){return Object.keys(e).reduce(function(t,n){return void 0!==e[n]&&(t[n]=e[n]),t},{})}function IA(){return document.createElement("div")}function xA(e){return["Element","Fragment"].some(function(t){return gA(e,t)})}function CA(e){return xA(e)?[e]:function(e){return gA(e,"NodeList")}(e)?bA(e):Array.isArray(e)?e:bA(document.querySelectorAll(e))}function BA(e,t){e.forEach(function(e){e&&(e.style.transitionDuration=t+"ms")})}function EA(e,t){e.forEach(function(e){e&&e.setAttribute("data-state",t)})}function kA(e,t,n){var r=t+"EventListener";["transitionend","webkitTransitionEnd"].forEach(function(t){e[r](t,n)})}function SA(e,t){for(var n=t;n;){var r;if(e.contains(n))return!0;n=null==n.getRootNode||null==(r=n.getRootNode())?void 0:r.host}return!1}var FA={isTouch:!1},DA=0;function NA(){FA.isTouch||(FA.isTouch=!0,window.performance&&document.addEventListener("mousemove",MA))}function MA(){var e=performance.now();e-DA<20&&(FA.isTouch=!1,document.removeEventListener("mousemove",MA)),DA=e}function QA(){var e,t=document.activeElement;if((e=t)&&e._tippy&&e._tippy.reference===e){var n=t._tippy;t.blur&&!n.state.isVisible&&t.blur()}}var TA,LA=!!("undefined"!=typeof window&&"undefined"!=typeof document)&&!!window.msCrypto;function RA(e){return[e+"() was called on a"+("destroy"===e?"n already-":" ")+"destroyed instance. This is a no-op but","indicates a potential memory leak."].join(" ")}function UA(e){return e.replace(/[ \t]{2,}/g," ").replace(/^[ \t]*/gm,"").trim()}function HA(e){return UA("\n %ctippy.js\n\n %c"+UA(e)+"\n\n %c👷‍ This is a development-only message. It will be removed in production.\n ")}function qA(e){return[HA(e),"color: #00C584; font-size: 1.3em; font-weight: bold;","line-height: 1.5","color: #a6a095;"]}function OA(e,t){var n;e&&!TA.has(t)&&(TA.add(t),(n=console).warn.apply(n,qA(t)))}function PA(e,t){var n;e&&!TA.has(t)&&(TA.add(t),(n=console).error.apply(n,qA(t)))}TA=new Set;var zA={animateFill:!1,followCursor:!1,inlinePositioning:!1,sticky:!1},$A=Object.assign({appendTo:hA,aria:{content:"auto",expanded:"auto"},delay:0,duration:[300,250],getReferenceClientRect:null,hideOnClick:!0,ignoreAttributes:!1,interactive:!1,interactiveBorder:2,interactiveDebounce:0,moveTransition:"",offset:[0,10],onAfterUpdate:function(){},onBeforeUpdate:function(){},onCreate:function(){},onDestroy:function(){},onHidden:function(){},onHide:function(){},onMount:function(){},onShow:function(){},onShown:function(){},onTrigger:function(){},onUntrigger:function(){},onClickOutside:function(){},placement:"top",plugins:[],popperOptions:{},render:null,showOnCreate:!1,touch:!0,trigger:"mouseenter focus",triggerTarget:null},zA,{allowHTML:!1,animation:"fade",arrow:!0,content:"",inertia:!1,maxWidth:350,role:"tooltip",theme:"",zIndex:9999}),jA=Object.keys($A);function VA(e){var t=(e.plugins||[]).reduce(function(t,n){var r,i=n.name,o=n.defaultValue;i&&(t[i]=void 0!==e[i]?e[i]:null!=(r=$A[i])?r:o);return t},{});return Object.assign({},e,t)}function YA(e,t){var n=Object.assign({},t,{content:mA(t.content,[e])},t.ignoreAttributes?{}:function(e,t){return(t?Object.keys(VA(Object.assign({},$A,{plugins:t}))):jA).reduce(function(t,n){var r=(e.getAttribute("data-tippy-"+n)||"").trim();if(!r)return t;if("content"===n)t[n]=r;else try{t[n]=JSON.parse(r)}catch(e){t[n]=r}return t},{})}(e,t.plugins));return n.aria=Object.assign({},$A.aria,n.aria),n.aria={expanded:"auto"===n.aria.expanded?t.interactive:n.aria.expanded,content:"auto"===n.aria.content?t.interactive?null:"describedby":n.aria.content},n}function GA(e,t){void 0===e&&(e={}),void 0===t&&(t=[]),Object.keys(e).forEach(function(e){var n=function(e,t){var n=Object.assign({},e);return t.forEach(function(e){delete n[e]}),n}($A,Object.keys(zA)),r=!function(e,t){return{}.hasOwnProperty.call(e,t)}(n,e);r&&(r=0===t.filter(function(t){return t.name===e}).length),OA(r,["`"+e+"`","is not a valid prop. You may have spelled it incorrectly, or if it's","a plugin, forgot to pass it in an array as props.plugins.","\n\n","All props: https://atomiks.github.io/tippyjs/v6/all-props/\n","Plugins: https://atomiks.github.io/tippyjs/v6/plugins/"].join(" "))})}function WA(e,t){e.innerHTML=t}function JA(e){var t=IA();return!0===e?t.className=uA:(t.className=fA,xA(e)?t.appendChild(e):WA(t,e)),t}function _A(e,t){xA(t.content)?(WA(e,""),e.appendChild(t.content)):"function"!=typeof t.content&&(t.allowHTML?WA(e,t.content):e.textContent=t.content)}function XA(e){var t=e.firstElementChild,n=bA(t.children);return{box:t,content:n.find(function(e){return e.classList.contains(cA)}),arrow:n.find(function(e){return e.classList.contains(uA)||e.classList.contains(fA)}),backdrop:n.find(function(e){return e.classList.contains("tippy-backdrop")})}}function KA(e){var t=IA(),n=IA();n.className="tippy-box",n.setAttribute("data-state","hidden"),n.setAttribute("tabindex","-1");var r=IA();function i(n,r){var i=XA(t),o=i.box,a=i.content,s=i.arrow;r.theme?o.setAttribute("data-theme",r.theme):o.removeAttribute("data-theme"),"string"==typeof r.animation?o.setAttribute("data-animation",r.animation):o.removeAttribute("data-animation"),r.inertia?o.setAttribute("data-inertia",""):o.removeAttribute("data-inertia"),o.style.maxWidth="number"==typeof r.maxWidth?r.maxWidth+"px":r.maxWidth,r.role?o.setAttribute("role",r.role):o.removeAttribute("role"),n.content===r.content&&n.allowHTML===r.allowHTML||_A(a,e.props),r.arrow?s?n.arrow!==r.arrow&&(o.removeChild(s),o.appendChild(JA(r.arrow))):o.appendChild(JA(r.arrow)):s&&o.removeChild(s)}return r.className=cA,r.setAttribute("data-state","hidden"),_A(r,e.props),t.appendChild(n),n.appendChild(r),i(e.props,e.props),{popper:t,onUpdate:i}}KA.$$tippy=!0;var ZA=1,eb=[],tb=[];function nb(e,t){var n,r,i,o,a,s,l,c,u=YA(e,Object.assign({},$A,VA(wA(t)))),f=!1,d=!1,h=!1,p=!1,g=[],m=yA(G,u.interactiveDebounce),y=ZA++,v=(c=u.plugins).filter(function(e,t){return c.indexOf(e)===t}),A={id:y,reference:e,popper:IA(),popperInstance:null,props:u,state:{isEnabled:!0,isVisible:!1,isDestroyed:!1,isMounted:!1,isShown:!1},plugins:v,clearDelayTimeouts:function(){clearTimeout(n),clearTimeout(r),cancelAnimationFrame(i)},setProps:function(t){if(OA(A.state.isDestroyed,RA("setProps")),A.state.isDestroyed)return;Q("onBeforeUpdate",[A,t]),V();var n=A.props,r=YA(e,Object.assign({},n,wA(t),{ignoreAttributes:!0}));A.props=r,j(),n.interactiveDebounce!==r.interactiveDebounce&&(R(),m=yA(G,r.interactiveDebounce));n.triggerTarget&&!r.triggerTarget?vA(n.triggerTarget).forEach(function(e){e.removeAttribute("aria-expanded")}):r.triggerTarget&&e.removeAttribute("aria-expanded");L(),M(),I&&I(n,r);A.popperInstance&&(X(),Z().forEach(function(e){requestAnimationFrame(e._tippy.popperInstance.forceUpdate)}));Q("onAfterUpdate",[A,t])},setContent:function(e){A.setProps({content:e})},show:function(){OA(A.state.isDestroyed,RA("show"));var e=A.state.isVisible,t=A.state.isDestroyed,n=!A.state.isEnabled,r=FA.isTouch&&!A.props.touch,i=pA(A.props.duration,0,$A.duration);if(e||t||n||r)return;if(S().hasAttribute("disabled"))return;if(Q("onShow",[A],!1),!1===A.props.onShow(A))return;A.state.isVisible=!0,k()&&(w.style.visibility="visible");M(),O(),A.state.isMounted||(w.style.transition="none");if(k()){var o=D();BA([o.box,o.content],0)}s=function(){var e;if(A.state.isVisible&&!p){if(p=!0,w.offsetHeight,w.style.transition=A.props.moveTransition,k()&&A.props.animation){var t=D(),n=t.box,r=t.content;BA([n,r],i),EA([n,r],"visible")}T(),L(),AA(tb,A),null==(e=A.popperInstance)||e.forceUpdate(),Q("onMount",[A]),A.props.animation&&k()&&function(e,t){z(e,t)}(i,function(){A.state.isShown=!0,Q("onShown",[A])})}},function(){var e,t=A.props.appendTo,n=S();e=A.props.interactive&&t===hA||"parent"===t?n.parentNode:mA(t,[n]);e.contains(w)||e.appendChild(w);A.state.isMounted=!0,X(),OA(A.props.interactive&&t===$A.appendTo&&n.nextElementSibling!==w,["Interactive tippy element may not be accessible via keyboard","navigation because it is not directly after the reference element","in the DOM source order.","\n\n","Using a wrapper <div> or <span> tag around the reference element","solves this by creating a new parentNode context.","\n\n","Specifying `appendTo: document.body` silences this warning, but it","assumes you are using a focus management solution to handle","keyboard navigation.","\n\n","See: https://atomiks.github.io/tippyjs/v6/accessibility/#interactivity"].join(" "))}()},hide:function(){OA(A.state.isDestroyed,RA("hide"));var e=!A.state.isVisible,t=A.state.isDestroyed,n=!A.state.isEnabled,r=pA(A.props.duration,1,$A.duration);if(e||t||n)return;if(Q("onHide",[A],!1),!1===A.props.onHide(A))return;A.state.isVisible=!1,A.state.isShown=!1,p=!1,f=!1,k()&&(w.style.visibility="hidden");if(R(),P(),M(!0),k()){var i=D(),o=i.box,a=i.content;A.props.animation&&(BA([o,a],r),EA([o,a],"hidden"))}T(),L(),A.props.animation?k()&&function(e,t){z(e,function(){!A.state.isVisible&&w.parentNode&&w.parentNode.contains(w)&&t()})}(r,A.unmount):A.unmount()},hideWithInteractivity:function(e){OA(A.state.isDestroyed,RA("hideWithInteractivity")),F().addEventListener("mousemove",m),AA(eb,m),m(e)},enable:function(){A.state.isEnabled=!0},disable:function(){A.hide(),A.state.isEnabled=!1},unmount:function(){OA(A.state.isDestroyed,RA("unmount")),A.state.isVisible&&A.hide();if(!A.state.isMounted)return;K(),Z().forEach(function(e){e._tippy.unmount()}),w.parentNode&&w.parentNode.removeChild(w);tb=tb.filter(function(e){return e!==A}),A.state.isMounted=!1,Q("onHidden",[A])},destroy:function(){if(OA(A.state.isDestroyed,RA("destroy")),A.state.isDestroyed)return;A.clearDelayTimeouts(),A.unmount(),V(),delete e._tippy,A.state.isDestroyed=!0,Q("onDestroy",[A])}};if(!u.render)return PA(!0,"render() function has not been supplied."),A;var b=u.render(A),w=b.popper,I=b.onUpdate;w.setAttribute("data-tippy-root",""),w.id="tippy-"+A.id,A.popper=w,e._tippy=A,w._tippy=A;var x=v.map(function(e){return e.fn(A)}),C=e.hasAttribute("aria-expanded");return j(),L(),M(),Q("onCreate",[A]),u.showOnCreate&&ee(),w.addEventListener("mouseenter",function(){A.props.interactive&&A.state.isVisible&&A.clearDelayTimeouts()}),w.addEventListener("mouseleave",function(){A.props.interactive&&A.props.trigger.indexOf("mouseenter")>=0&&F().addEventListener("mousemove",m)}),A;function B(){var e=A.props.touch;return Array.isArray(e)?e:[e,0]}function E(){return"hold"===B()[0]}function k(){var e;return!(null==(e=A.props.render)||!e.$$tippy)}function S(){return l||e}function F(){var e,t,n=S().parentNode;return n?null!=(t=vA(n)[0])&&null!=(e=t.ownerDocument)&&e.body?t.ownerDocument:document:document}function D(){return XA(w)}function N(e){return A.state.isMounted&&!A.state.isVisible||FA.isTouch||o&&"focus"===o.type?0:pA(A.props.delay,e?0:1,$A.delay)}function M(e){void 0===e&&(e=!1),w.style.pointerEvents=A.props.interactive&&!e?"":"none",w.style.zIndex=""+A.props.zIndex}function Q(e,t,n){var r;(void 0===n&&(n=!0),x.forEach(function(n){n[e]&&n[e].apply(n,t)}),n)&&(r=A.props)[e].apply(r,t)}function T(){var t=A.props.aria;if(t.content){var n="aria-"+t.content,r=w.id;vA(A.props.triggerTarget||e).forEach(function(e){var t=e.getAttribute(n);if(A.state.isVisible)e.setAttribute(n,t?t+" "+r:r);else{var i=t&&t.replace(r,"").trim();i?e.setAttribute(n,i):e.removeAttribute(n)}})}}function L(){!C&&A.props.aria.expanded&&vA(A.props.triggerTarget||e).forEach(function(e){A.props.interactive?e.setAttribute("aria-expanded",A.state.isVisible&&e===S()?"true":"false"):e.removeAttribute("aria-expanded")})}function R(){F().removeEventListener("mousemove",m),eb=eb.filter(function(e){return e!==m})}function U(t){if(!FA.isTouch||!h&&"mousedown"!==t.type){var n=t.composedPath&&t.composedPath()[0]||t.target;if(!A.props.interactive||!SA(w,n)){if(vA(A.props.triggerTarget||e).some(function(e){return SA(e,n)})){if(FA.isTouch)return;if(A.state.isVisible&&A.props.trigger.indexOf("click")>=0)return}else Q("onClickOutside",[A,t]);!0===A.props.hideOnClick&&(A.clearDelayTimeouts(),A.hide(),d=!0,setTimeout(function(){d=!1}),A.state.isMounted||P())}}}function H(){h=!0}function q(){h=!1}function O(){var e=F();e.addEventListener("mousedown",U,!0),e.addEventListener("touchend",U,dA),e.addEventListener("touchstart",q,dA),e.addEventListener("touchmove",H,dA)}function P(){var e=F();e.removeEventListener("mousedown",U,!0),e.removeEventListener("touchend",U,dA),e.removeEventListener("touchstart",q,dA),e.removeEventListener("touchmove",H,dA)}function z(e,t){var n=D().box;function r(e){e.target===n&&(kA(n,"remove",r),t())}if(0===e)return t();kA(n,"remove",a),kA(n,"add",r),a=r}function $(t,n,r){void 0===r&&(r=!1),vA(A.props.triggerTarget||e).forEach(function(e){e.addEventListener(t,n,r),g.push({node:e,eventType:t,handler:n,options:r})})}function j(){var e;E()&&($("touchstart",Y,{passive:!0}),$("touchend",W,{passive:!0})),(e=A.props.trigger,e.split(/\s+/).filter(Boolean)).forEach(function(e){if("manual"!==e)switch($(e,Y),e){case"mouseenter":$("mouseleave",W);break;case"focus":$(LA?"focusout":"blur",J);break;case"focusin":$("focusout",J)}})}function V(){g.forEach(function(e){var t=e.node,n=e.eventType,r=e.handler,i=e.options;t.removeEventListener(n,r,i)}),g=[]}function Y(e){var t,n=!1;if(A.state.isEnabled&&!_(e)&&!d){var r="focus"===(null==(t=o)?void 0:t.type);o=e,l=e.currentTarget,L(),!A.state.isVisible&&gA(e,"MouseEvent")&&eb.forEach(function(t){return t(e)}),"click"===e.type&&(A.props.trigger.indexOf("mouseenter")<0||f)&&!1!==A.props.hideOnClick&&A.state.isVisible?n=!0:ee(e),"click"===e.type&&(f=!n),n&&!r&&te(e)}}function G(e){var t=e.target,n=S().contains(t)||w.contains(t);if("mousemove"!==e.type||!n){var r=Z().concat(w).map(function(e){var t,n=null==(t=e._tippy.popperInstance)?void 0:t.state;return n?{popperRect:e.getBoundingClientRect(),popperState:n,props:u}:null}).filter(Boolean);(function(e,t){var n=t.clientX,r=t.clientY;return e.every(function(e){var t=e.popperRect,i=e.popperState,o=e.props.interactiveBorder,a=i.placement.split("-")[0],s=i.modifiersData.offset;if(!s)return!0;var l="bottom"===a?s.top.y:0,c="top"===a?s.bottom.y:0,u="right"===a?s.left.x:0,f="left"===a?s.right.x:0,d=t.top-r+l>o,h=r-t.bottom-c>o,p=t.left-n+u>o,g=n-t.right-f>o;return d||h||p||g})})(r,e)&&(R(),te(e))}}function W(e){_(e)||A.props.trigger.indexOf("click")>=0&&f||(A.props.interactive?A.hideWithInteractivity(e):te(e))}function J(e){A.props.trigger.indexOf("focusin")<0&&e.target!==S()||A.props.interactive&&e.relatedTarget&&w.contains(e.relatedTarget)||te(e)}function _(e){return!!FA.isTouch&&E()!==e.type.indexOf("touch")>=0}function X(){K();var t=A.props,n=t.popperOptions,r=t.placement,i=t.offset,o=t.getReferenceClientRect,a=t.moveTransition,l=k()?XA(w).arrow:null,c=o?{getBoundingClientRect:o,contextElement:o.contextElement||S()}:e,u={name:"$$tippy",enabled:!0,phase:"beforeWrite",requires:["computeStyles"],fn:function(e){var t=e.state;if(k()){var n=D().box;["placement","reference-hidden","escaped"].forEach(function(e){"placement"===e?n.setAttribute("data-placement",t.placement):t.attributes.popper["data-popper-"+e]?n.setAttribute("data-"+e,""):n.removeAttribute("data-"+e)}),t.attributes.popper={}}}},f=[{name:"offset",options:{offset:i}},{name:"preventOverflow",options:{padding:{top:2,bottom:2,left:5,right:5}}},{name:"flip",options:{padding:5}},{name:"computeStyles",options:{adaptive:!a}},u];k()&&l&&f.push({name:"arrow",options:{element:l,padding:3}}),f.push.apply(f,(null==n?void 0:n.modifiers)||[]),A.popperInstance=lA(c,w,Object.assign({},n,{placement:r,onFirstUpdate:s,modifiers:f}))}function K(){A.popperInstance&&(A.popperInstance.destroy(),A.popperInstance=null)}function Z(){return bA(w.querySelectorAll("[data-tippy-root]"))}function ee(e){A.clearDelayTimeouts(),e&&Q("onTrigger",[A,e]),O();var t=N(!0),r=B(),i=r[0],o=r[1];FA.isTouch&&"hold"===i&&o&&(t=o),t?n=setTimeout(function(){A.show()},t):A.show()}function te(e){if(A.clearDelayTimeouts(),Q("onUntrigger",[A,e]),A.state.isVisible){if(!(A.props.trigger.indexOf("mouseenter")>=0&&A.props.trigger.indexOf("click")>=0&&["mouseleave","mousemove"].indexOf(e.type)>=0&&f)){var t=N(!1);t?r=setTimeout(function(){A.state.isVisible&&A.hide()},t):i=requestAnimationFrame(function(){A.hide()})}}else P()}}function rb(e,t){void 0===t&&(t={});var n=$A.plugins.concat(t.plugins||[]);!function(e){var t=!e,n="[object Object]"===Object.prototype.toString.call(e)&&!e.addEventListener;PA(t,["tippy() was passed","`"+String(e)+"`","as its targets (first) argument. Valid types are: String, Element,","Element[], or NodeList."].join(" ")),PA(n,["tippy() was passed a plain object which is not supported as an argument","for virtual positioning. Use props.getReferenceClientRect instead."].join(" "))}(e),GA(t,n),document.addEventListener("touchstart",NA,dA),window.addEventListener("blur",QA);var r=Object.assign({},t,{plugins:n}),i=CA(e),o=xA(r.content),a=i.length>1;OA(o&&a,["tippy() was passed an Element as the `content` prop, but more than","one tippy instance was created by this invocation. This means the","content element will only be appended to the last tippy instance.","\n\n","Instead, pass the .innerHTML of the element, or use a function that","returns a cloned version of the element instead.","\n\n","1) content: element.innerHTML\n","2) content: () => element.cloneNode(true)"].join(" "));var s=i.reduce(function(e,t){var n=t&&nb(t,r);return n&&e.push(n),e},[]);return xA(e)?s[0]:s}rb.defaultProps=$A,rb.setDefaultProps=function(e){GA(e,[]),Object.keys(e).forEach(function(t){$A[t]=e[t]})},rb.currentInput=FA,Object.assign({},uv,{effect:function(e){var t=e.state,n={popper:{position:t.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};Object.assign(t.elements.popper.style,n.popper),t.styles=n,t.elements.arrow&&Object.assign(t.elements.arrow.style,n.arrow)}}),rb.setDefaultProps({render:KA});Ty('.tippy-box[data-animation=fade][data-state=hidden]{opacity:0}[data-tippy-root]{max-width:calc(100vw - 10px)}.tippy-box{position:relative;background-color:#333;color:#fff;border-radius:4px;font-size:14px;line-height:1.4;white-space:normal;outline:0;transition-property:transform,visibility,opacity}.tippy-box[data-placement^=top]>.tippy-arrow{bottom:0}.tippy-box[data-placement^=top]>.tippy-arrow:before{bottom:-7px;left:0;border-width:8px 8px 0;border-top-color:initial;transform-origin:center top}.tippy-box[data-placement^=bottom]>.tippy-arrow{top:0}.tippy-box[data-placement^=bottom]>.tippy-arrow:before{top:-7px;left:0;border-width:0 8px 8px;border-bottom-color:initial;transform-origin:center bottom}.tippy-box[data-placement^=left]>.tippy-arrow{right:0}.tippy-box[data-placement^=left]>.tippy-arrow:before{border-width:8px 0 8px 8px;border-left-color:initial;right:-7px;transform-origin:center left}.tippy-box[data-placement^=right]>.tippy-arrow{left:0}.tippy-box[data-placement^=right]>.tippy-arrow:before{left:-7px;border-width:8px 8px 8px 0;border-right-color:initial;transform-origin:center right}.tippy-box[data-inertia][data-state=visible]{transition-timing-function:cubic-bezier(.54,1.5,.38,1.11)}.tippy-arrow{width:16px;height:16px;color:#333}.tippy-arrow:before{content:"";position:absolute;border-color:transparent;border-style:solid}.tippy-content{position:relative;padding:5px 9px;z-index:1}');async function ib(e,t={}){if(!ca(e))throw new Error("invalid fun");let n=we(t,"width");n=Ee(n)?_o(n):Fe(n)?Ir(n):null;let r=we(t,"height");r=Ee(r)?_o(r):Fe(r)?Ir(r):null;let i=document.createElement("div");Fe(n)&&(i.style.width=`${n}px`),Fe(r)&&(i.style.height=`${r}px`);let o=document.createElement("div");o.style.position="absolute",o.style.top=0,o.style.left=0,o.style.zIndex=-1,o.appendChild(i);let a=document.createElement("div");a.style.position="relative",a.appendChild(o);let s,l=document.createElement("div");l.style.position="fixed",l.style.zIndex=-1,l.appendChild(a),fm(document.querySelector("body"),l);let c=e(i);return s=cs(c)?await c:c,um(l),s}function ob(e){if(!ca(e))throw new Error("fn is not a function");return function(){let t=Ya(),n=null,r=null;try{n=e.apply(this,arguments)}catch(e){r=e}return null!==r?t.resolve({state:"error",msg:r}):cs(n)?n.then(e=>{t.resolve({state:"success",msg:e})}).catch(e=>{"cancelled"===we(e,"reason")?t.resolve({state:"cancelled",msg:""}):t.resolve({state:"error",msg:e})}):t.resolve({state:"success",msg:n}),t}}Ty(".tippy-box[data-theme~=light]{color:#26323d;box-shadow:0 0 20px 4px rgba(154,161,177,.15),0 4px 80px -8px rgba(36,40,47,.25),0 4px 4px -2px rgba(91,94,105,.15);background-color:#fff}.tippy-box[data-theme~=light][data-placement^=top]>.tippy-arrow:before{border-top-color:#fff}.tippy-box[data-theme~=light][data-placement^=bottom]>.tippy-arrow:before{border-bottom-color:#fff}.tippy-box[data-theme~=light][data-placement^=left]>.tippy-arrow:before{border-left-color:#fff}.tippy-box[data-theme~=light][data-placement^=right]>.tippy-arrow:before{border-right-color:#fff}.tippy-box[data-theme~=light]>.tippy-backdrop{background-color:#fff}.tippy-box[data-theme~=light]>.tippy-svg-arrow{fill:#fff}");let ab=ob;function sb(e){if(!xr(e))return!1;return zi(e)<0}function lb(e=0){let t=0,n=[];sb(e)&&(e=0),e=zi(e);let r=Ui();return r.get=function(){if(n.length>0){return t+=1,n.splice(0,1)[0]}return null},r.cb=function(){t-=1,t<0&&(t=0),n.length>0&&r.emit("message",n)},r.push=function(i){n.push(i),(e<=0||t<e)&&r.emit("message",n)},r.clear=function(){t=0,n=[]},r}function cb(e=0,t=!1){return new function(e,t){let n=null;fo(e)||(e=0),e=zi(e),ir(t)||(t=!1);let r=lb(e);return r.on("message",async function(e){let t=r.get();if(!t)return;await ls(1);let n,i=we(t,"id"),o=we(t,"fun"),a=we(t,"input");n=ca(o)?await ab(o)(...a):{state:"error",msg:"fun is not a function"},r.emit(i,n),r.cb()}),function(e,...i){let o=Ya(),a=Mu();n=a;let s={id:a,fun:e,input:i};return r.push(s),r.once(a,e=>{t?a===n?"success"===e.state?o.resolve(e.msg):o.reject(e.msg):o.reject({reason:"cancelled"}):"success"===e.state?o.resolve(e.msg):o.reject(e.msg)}),o}}(e,t)}function ub(e,t){Ga()?Ee(e)?$u()?function(e,t){window.navigator.msSaveOrOpenBlob(t,e)}(e,t):function(e,t){let n=window.URL.createObjectURL(t),r=document.createElement("a");r.href=n,r.download=e,document.body.appendChild(r),r.click(),document.body.removeChild(r),window.URL.revokeObjectURL(n)}(e,t):console.log("no filename"):console.log("no window")}function fb(e,t="data"){if(!xe(e))return{error:"sheet is not an object"};if(!Ie(we(e,"rows")))return{error:"sheet.rows is not an array"};Ee(t)||(t="data");let n={sheets:[]};return n.sheets.push({...e,name:t}),n}function db(e,t="data"){if(!Ie(e))return{error:"data is not an array"};Ee(t)||(t="data");let n=null,r=cr(e);return De(r,"error")?r:(n=fb(r,t),De(n,"error"),n)}class hb extends Error{name="HucreError";constructor(e,t){super(e,t)}}class pb extends hb{details;name="ParseError";constructor(e,t,n){super(e,n),this.details=t}}class gb extends hb{name="ZipError"}class mb extends hb{name="XmlError"}class yb extends hb{name="InvalidArgumentError"}class vb extends hb{name="EncryptedFileError";format;constructor(e,t){super(t??(e?`File is password-protected (${e.toUpperCase()} encrypted with the OLE2/CFB container). Provide a password in options to decrypt it.`:"File is password-protected. Provide a password in options.")),this.format=e}}class Ab extends hb{name="DecryptionError";constructor(e="Failed to decrypt: incorrect password or corrupt encryption data.",t){super(e,t)}}const bb=536870888;class wb extends pb{}function Ib(e,t){try{return new TextDecoder("utf-8").decode(e)}catch(n){if(n instanceof RangeError||"ERR_STRING_TOO_LONG"===n?.code||e.length>bb)throw function(e,t){return new wb(`Part "${e}" is ${t.toLocaleString("en-US")} bytes, over the ${bb.toLocaleString("en-US")}-character maximum string length this runtime supports, so it cannot be read into memory whole.\n - streamXlsxRows(input) reads a worksheet of any size, a row at a time.\n - The workbook is not damaged; this is a limit of the buffered reader.`)}(t,e.length);throw n}}const xb={amp:"&",lt:"<",gt:">",quot:'"',apos:"'"};function Cb(e){return-1===e.indexOf("\r")?e:e.replace(/\r\n?/g,"\n")}function Bb(e){return-1===e.indexOf("&")?e:e.replace(/&(#x[0-9a-fA-F]+|#[0-9]+|[a-zA-Z]+);/g,(e,t)=>{if(35===t.charCodeAt(0)){const n=120===t.charCodeAt(1)||88===t.charCodeAt(1)?parseInt(t.slice(2),16):parseInt(t.slice(1),10);return Number.isNaN(n)||(n<0||n>1114111)?e:String.fromCodePoint(n)}return xb[t]??e})}function Eb(e){return-1===e.indexOf("_x")?e:e.replace(/_x([0-9A-Fa-f]{4})_/g,(e,t)=>String.fromCharCode(parseInt(t,16)))}function kb(e){const t={};let n=0;const r=e.length;for(;n<r;){for(;n<r&&Sb(e.charCodeAt(n));)n++;if(n>=r)break;const i=n;for(;n<r&&61!==e.charCodeAt(n)&&!Sb(e.charCodeAt(n));)n++;const o=e.slice(i,n);if(!o)break;for(;n<r&&Sb(e.charCodeAt(n));)n++;if(n>=r||61!==e.charCodeAt(n)){t[o]="";continue}for(n++;n<r&&Sb(e.charCodeAt(n));)n++;if(n>=r)break;const a=e.charCodeAt(n);if(34===a||39===a){n++;const i=n;for(;n<r&&e.charCodeAt(n)!==a;)n++;t[o]=Bb(Cb(e.slice(i,n))),n++}else{const i=n;for(;n<r&&!Sb(e.charCodeAt(n));)n++;t[o]=Bb(Cb(e.slice(i,n)))}}return t}function Sb(e){return 32===e||9===e||10===e||13===e}function Fb(e,t){const n=65279===e.charCodeAt(0)?e.slice(1):e,r=n.length;let i=0;function o(e){let t=1,o=1;for(let e=0;e<i&&e<r;e++)10===n.charCodeAt(e)?(t++,o=1):o++;throw new mb(`${e} at line ${t}, column ${o}`)}for(;i<r;){if(60===n.charCodeAt(i)){const e=i+1<r?n.charCodeAt(i+1):0;if(33===e){if("\x3c!--"===n.slice(i,i+4)){const e=n.indexOf("--\x3e",i+4);-1===e&&o("Unterminated comment"),i=e+3;continue}if("<![CDATA["===n.slice(i,i+9)){const e=n.indexOf("]]>",i+9);-1===e&&o("Unterminated CDATA section");const r=n.slice(i+9,e);t.onCData?.(r),t.onText?.(r),i=e+3;continue}const e=n.indexOf(">",i+2);-1===e&&o("Unterminated declaration"),i=e+1;continue}if(63===e){const e=n.indexOf("?>",i+2);-1===e&&o("Unterminated processing instruction"),i=e+2;continue}if(47===e){const e=n.indexOf(">",i+2);-1===e&&o("Unterminated closing tag");const r=n.slice(i+2,e).trim();t.onCloseTag?.(r),i=e+1;continue}let a=i+1,s=0;for(;a<r;){const e=n.charCodeAt(a);if(s)e===s&&(s=0);else if(34===e||39===e)s=e;else if(62===e)break;a++}a>=r&&o("Unterminated opening tag");const l=47===n.charCodeAt(a-1),c=n.slice(i+1,l?a-1:a);let u=0;const f=c.length;for(;u<f&&!Sb(c.charCodeAt(u));)u++;const d=c.slice(0,u),h=u<f?c.slice(u+1):"",p=h?kb(h):{};t.onOpenTag?.(d,p),l&&t.onCloseTag?.(d),i=a+1;continue}const e=i;for(;i<r&&60!==n.charCodeAt(i);)i++;const a=n.slice(e,i);if(a){const e=Bb(Cb(a));t.onText?.(e)}}}const Db=262144,Nb=64;function Mb(e,t,n){let r=n;const i=e.lastIndexOf("&",r-1);i>=t&&n-i<=Nb&&-1===e.indexOf(";",i)&&(r=i);const o=r>t?e.charCodeAt(r-1):0;return(o>=55296&&o<=56319||13===o)&&r--,r>t?r:t}function Qb(e,t,n,r){if(e)throw new mb(r);return t.slice(n)}function Tb(e,t,n,r){let i=0;const o=e.length;for(;i<o;){if(60===e.charCodeAt(i)){const a=i+1<o?e.charCodeAt(i+1):-1;if(-1===a&&!n)return e.slice(i);if(33===a){if("\x3c!--"===e.slice(i,i+4)){const t=e.indexOf("--\x3e",i+4);if(-1===t)return Qb(n&&r,e,i,"Unterminated comment");i=t+3;continue}if("<![CDATA["===e.slice(i,i+9)){const o=e.indexOf("]]>",i+9);if(-1===o)return Qb(n&&r,e,i,"Unterminated CDATA section");const a=e.slice(i+9,o);t.onCData?.(a),t.onText?.(a),i=o+3;continue}if(!n&&o-i<9)return e.slice(i);const a=e.indexOf(">",i+2);if(-1===a)return Qb(n&&r,e,i,"Unterminated declaration");i=a+1;continue}if(63===a){const t=e.indexOf("?>",i+2);if(-1===t)return Qb(n&&r,e,i,"Unterminated processing instruction");i=t+2;continue}if(47===a){const o=e.indexOf(">",i+2);if(-1===o)return Qb(n&&r,e,i,"Unterminated closing tag");const a=e.slice(i+2,o).trim();t.onCloseTag?.(a),i=o+1;continue}let s=i+1,l=0;for(;s<o;){const t=e.charCodeAt(s);if(l)t===l&&(l=0);else if(34===t||39===t)l=t;else if(62===t)break;s++}if(s>=o)return Qb(n&&r,e,i,"Unterminated opening tag");const c=47===e.charCodeAt(s-1),u=e.slice(i+1,c?s-1:s);let f=0;const d=u.length;for(;f<d&&!Sb(u.charCodeAt(f));)f++;const h=u.slice(0,f),p=f<d?u.slice(f+1):"",g=p?kb(p):{};t.onOpenTag?.(h,g),c&&t.onCloseTag?.(h),i=s+1;continue}const a=i;for(;i<o&&60!==e.charCodeAt(i);)i++;if(i>=o&&!n){if(o-a>Db){const n=Mb(e,a,o);if(n>a)return t.onText?.(Bb(Cb(e.slice(a,n)))),e.slice(n)}return e.slice(a)}const s=e.slice(a,i);if(s){const e=Bb(Cb(s));t.onText?.(e)}}return""}function Lb(e){const t={tag:"",local:"",prefix:"",attrs:{},children:[]},n=[t];if(Fb(e,{onOpenTag(e,t){const{local:r,prefix:i}=function(e){const t=e.indexOf(":");return-1===t?{local:e,prefix:""}:{prefix:e.slice(0,t),local:e.slice(t+1)}}(e),o={tag:e,local:r,prefix:i,attrs:t,children:[]};n[n.length-1].children.push(o),n.push(o)},onCloseTag(e){if(n.length<=1)throw new mb("Unexpected closing tag: no matching open tag");const t=n[n.length-1];if(t.tag!==e)throw new mb(`Mismatched closing tag: expected </${t.tag}> but found </${e}>`);if(n.pop(),t.children.length>0){const e=[];for(const n of t.children)"string"==typeof n&&e.push(n);e.length>0&&(t.text=e.join(""))}},onText(e){n[n.length-1].children.push(e)}}),n.length>1){const e=n[n.length-1].tag;throw new mb(`Unexpected end of document: unclosed element <${e}>`)}if(0===t.children.length)throw new mb("Empty document: no root element found");for(const e of t.children)if("string"!=typeof e)return e;throw new mb("No root element found in document")}function Rb(e,t){for(const n of e.children)if("string"!=typeof n&&n.local===t)return n}function Ub(e){const t=[];for(const n of e.children)"string"!=typeof n&&t.push(n);return t}function Hb(e,t){if(e.local===t)return e;for(const n of e.children){if("string"==typeof n)continue;const e=Hb(n,t);if(e)return e}}function qb(e,t){const n=Rb(e,t);if(!n)return"";let r="";for(const e of n.children)"string"==typeof e&&(r+=e);return r}function Ob(e,t){if(void 0===e)return t;const n=parseInt(e,10);return Number.isNaN(n)?t:n}function Pb(e){const t=Lb(e),n=[];for(const e of Ub(t)){if("threadedComment"!==e.local)continue;const t=e.attrs.id,r=e.attrs.personId;if(!t||!r)continue;const i={id:t,personId:r,text:qb(e,"text")};e.attrs.ref&&(i.ref=e.attrs.ref),e.attrs.parentId&&(i.parentId=e.attrs.parentId),e.attrs.dT&&(i.date=e.attrs.dT),"1"!==e.attrs.done&&"true"!==e.attrs.done||(i.done=!0);const o=Rb(e,"mentions");if(o){const e=[];for(const t of Ub(o)){if("mention"!==t.local)continue;const n=t.attrs.mentionpersonId,r=t.attrs.mentionId;n&&r&&e.push({mentionPersonId:n,mentionId:r,startIndex:Ob(t.attrs.startIndex,0),length:Ob(t.attrs.length,0)})}e.length>0&&(i.mentions=e)}n.push(i)}return n}function zb(e){const t=Lb(e),n=[];for(const e of t.children){if("string"==typeof e)continue;if("Relationship"===(e.local||e.tag)){const t=e.attrs.Id??"",r=e.attrs.Type??"",i=e.attrs.Target??"",o=e.attrs.TargetMode;if(t&&r&&i){const e={id:t,type:r,target:i};o&&(e.targetMode=o),n.push(e)}}}return n}function $b(e,t){if(t.startsWith("/"))return t.slice(1);const n=e.split("/").filter(Boolean),r=t.split("/").filter(Boolean);for(const e of r)".."===e?n.pop():"."!==e&&n.push(e);return n.join("/")}function jb(e){const t=e.lastIndexOf("/");return-1===t?"":e.slice(0,t)}function Vb(e){for(const t of Object.keys(e))if(t.endsWith(":id")&&e[t].startsWith("rId"))return e[t]}const Yb=new Set(["n","s","b","e","str"]);function Gb(e,t){const n=Rb(Lb(e),"externalBook");let r,i="";if(n&&t){const e=zb(t),o=n.attrs["r:id"]??n.attrs.id,a=o?e.find(e=>e.id===o):void 0;a&&(i=a.target,"External"!==a.targetMode&&"Internal"!==a.targetMode||(r=a.targetMode))}const o=function(e){const t=e?Rb(e,"sheetNames"):void 0;if(!t)return[];const n=[];for(const e of Ub(t))"sheetName"===e.local&&n.push(e.attrs.val??"");return n}(n),a=function(e){const t=e?Rb(e,"sheetDataSet"):void 0;if(!t)return[];const n=[];for(const e of Ub(t)){if("sheetData"!==e.local)continue;const t=Ob(e.attrs.sheetId,0),r=[];for(const t of Ub(e))if("row"===t.local)for(const e of Ub(t)){if("cell"!==e.local)continue;const t=e.attrs.r??"";if(!t)continue;const n=e.attrs.t??"n",i=Yb.has(n)?n:"n",o=qb(e,"v");r.push({ref:t,type:i,value:Wb(i,o)})}n.push({sheetId:t,cells:r})}return n}(n),s=function(e){const t=e?Rb(e,"definedNames"):void 0;if(!t)return[];const n=[];for(const e of Ub(t)){if("definedName"!==e.local)continue;const t={name:e.attrs.name??""};if(e.attrs.refersTo&&(t.refersTo=e.attrs.refersTo),void 0!==e.attrs.sheetId){const n=Ob(e.attrs.sheetId,NaN);Number.isNaN(n)||(t.sheetId=n)}t.name&&n.push(t)}return n}(n),l={target:i,sheetNames:o,sheetData:a};return r&&(l.targetMode=r),s&&s.length>0&&(l.definedNames=s),l}function Wb(e,t){switch(e){case"n":case"s":{const e=Number(t);return Number.isFinite(e)?e:0}case"b":return"1"===t||"true"===t;case"e":case"str":return t}}function Jb(e){const t=Rb(e,"pic");if(!t)return;const n=Rb(t,"nvPicPr"),r=n?Rb(n,"cNvPr"):void 0,i=r?.attrs.name;if(!i)return;const o=Rb(t,"blipFill"),a=o?Rb(o,"blip"):void 0,s=a?.attrs["r:embed"]??a?.attrs.embed;if(!s)return;const l={id:i,embedRId:s},c=r?.attrs.descr;return c&&(l.description=c),l}function _b(e){const t=Lb(e),n="pivotCacheDefinition"===t.local?t:Rb(t,"pivotCacheDefinition");if(!n)return;const r={cacheId:0,fieldNames:[]},i=Rb(n,"cacheSource");if(i){const e=i.attrs.type;"worksheet"!==e&&"external"!==e&&"consolidation"!==e&&"scenario"!==e||(r.sourceType=e);const t=Rb(i,"worksheetSource");t&&(t.attrs.ref?r.sourceRef=t.attrs.ref:t.attrs.name&&(r.sourceRef=t.attrs.name),t.attrs.sheet&&(r.sourceSheet=t.attrs.sheet))}const o=Rb(n,"cacheFields");if(o)for(const e of Ub(o)){if("cacheField"!==e.local)continue;const t=e.attrs.name??"";r.fieldNames.push(t)}return r}function Xb(e){const t=Lb(e),n="pivotTableDefinition"===t.local?t:Rb(t,"pivotTableDefinition");if(!n)return;const r=n.attrs.name;if(!r)return;const i=Ob(n.attrs.cacheId,NaN),o={name:r,cacheId:Number.isNaN(i)?0:i,location:"",fields:[]},a=Rb(n,"location");if(a){a.attrs.ref&&(o.location=a.attrs.ref);const e=Ob(a.attrs.firstHeaderRow,NaN);Number.isNaN(e)||(o.firstHeaderRow=e);const t=Ob(a.attrs.firstDataRow,NaN);Number.isNaN(t)||(o.firstDataRow=t);const n=Ob(a.attrs.firstDataCol,NaN);Number.isNaN(n)||(o.firstDataCol=n);const r=Ob(a.attrs.rowPageCount,NaN);Number.isNaN(r)||(o.rowPageCount=r);const i=Ob(a.attrs.colPageCount,NaN);Number.isNaN(i)||(o.colPageCount=i)}const s=Rb(n,"pivotFields"),l=[];if(s)for(const e of Ub(s)){if("pivotField"!==e.local)continue;const t=e.attrs.axis,n="1"===e.attrs.dataField||"true"===e.attrs.dataField;let r="hidden";"axisRow"===t?r="row":"axisCol"===t?r="col":"axisPage"===t?r="page":("axisValues"===t||n)&&(r="data"),l.push({axis:r,raw:e})}const c=Rb(n,"dataFields"),u=new Map;if(c)for(const e of Ub(c)){if("dataField"!==e.local)continue;const t=Ob(e.attrs.fld,NaN);if(Number.isNaN(t))continue;const n={};e.attrs.name&&(n.name=e.attrs.name);const r=Zb(e.attrs.subtotal);r&&(n.subtotal=r),u.set(t,n)}for(let e=0;e<l.length;e++){const{axis:t}=l[e],n={name:`field${e+1}`,axis:t};if("data"===t){const t=u.get(e);n.function=t?.subtotal?t.subtotal:"sum",t?.name&&(n.displayName=t.name)}o.fields.push(n)}const f=Rb(n,"pivotTableStyleInfo");return f?.attrs.name&&(o.styleName=f.attrs.name),n.attrs.dataCaption&&(o.dataCaption=n.attrs.dataCaption),o}function Kb(e,t){for(let n=0;n<e.fields.length;n++){const r=t.fieldNames[n];r&&(e.fields[n].name=r)}}function Zb(e){if(e)switch(e){case"sum":case"count":case"average":case"max":case"min":case"product":case"countNums":case"stdDev":case"stdDevp":case"var":case"varp":return e;case"countA":return"count";default:return}}function ew(e){const t=Lb(e),n=[];for(const e of Ub(t)){if("slicer"!==e.local)continue;const t=e.attrs.name,r=e.attrs.cache;if(!t||!r)continue;const i={name:t,cache:r};if(e.attrs.caption&&(i.caption=e.attrs.caption),void 0!==e.attrs.columnCount){const t=Ob(e.attrs.columnCount,NaN);Number.isNaN(t)||(i.columnCount=t)}if(e.attrs.style&&(i.style=e.attrs.style),e.attrs.sortOrder&&(i.sortOrder=e.attrs.sortOrder),void 0!==e.attrs.rowHeight){const t=Ob(e.attrs.rowHeight,NaN);Number.isNaN(t)||(i.rowHeight=t)}n.push(i)}return n}function tw(e){const t=Lb(e),n="slicerCacheDefinition"===t.local?t:Rb(t,"slicerCacheDefinition");if(!n)return;const r=n.attrs.name;if(!r)return;const i={name:r};n.attrs.sourceName&&(i.sourceName=n.attrs.sourceName);const o=iw(n);o.length>0&&(i.pivotTables=o);const a=function(e){const t=Rb(e,"extLst");if(!t)return;for(const e of Ub(t)){if("ext"!==e.local)continue;const t=Rb(e,"tableSlicerCache");if(!t)continue;const n=t.attrs.name??t.attrs.tableId;if(!n)continue;const r={name:n};return t.attrs.column&&(r.column=t.attrs.column),r}return}(n);return a&&(i.tableSource=a),i}function nw(e){const t=Lb(e),n=[];for(const e of Ub(t)){if("timeline"!==e.local)continue;const t=e.attrs.name,r=e.attrs.cache;if(!t||!r)continue;const i={name:t,cache:r};e.attrs.caption&&(i.caption=e.attrs.caption),e.attrs.style&&(i.style=e.attrs.style),e.attrs.level&&(i.level=e.attrs.level),void 0!==e.attrs.showHeader&&(i.showHeader=ow(e.attrs.showHeader)),void 0!==e.attrs.showSelectionLabel&&(i.showSelectionLabel=ow(e.attrs.showSelectionLabel)),void 0!==e.attrs.showTimeLevel&&(i.showTimeLevel=ow(e.attrs.showTimeLevel)),void 0!==e.attrs.showHorizontalScrollbar&&(i.showHorizontalScrollbar=ow(e.attrs.showHorizontalScrollbar)),n.push(i)}return n}function rw(e){const t=Lb(e),n="timelineCacheDefinition"===t.local?t:Rb(t,"timelineCacheDefinition");if(!n)return;const r=n.attrs.name;if(!r)return;const i={name:r};n.attrs.sourceName&&(i.sourceName=n.attrs.sourceName);const o=iw(n);return o.length>0&&(i.pivotTables=o),i}function iw(e){const t=Rb(e,"pivotTables");if(!t)return[];const n=[];for(const e of Ub(t)){if("pivotTable"!==e.local)continue;const t=e.attrs.name;if(!t)continue;const r=Ob(e.attrs.tabId,NaN);Number.isNaN(r)||n.push({tabId:r,name:t})}return n}function ow(e){return"1"===e||"true"===e}function aw(e){return`_x${e.toString(16).toUpperCase().padStart(4,"0")}_`}function sw(e){return e>=0&&e<=8||11===e||12===e||e>=14&&e<=31}function lw(e,t="ooxml"){let n="",r=0;for(let i=0;i<e.length;i++){const o=e.charCodeAt(i);let a;switch(o){case 38:a="&amp;";break;case 60:a="&lt;";break;case 62:a="&gt;";break;case 13:a="charRef"===t?"&#13;":aw(13);break;default:sw(o)&&(a=aw(o))}a&&(n+=e.slice(r,i)+a,r=i+1)}return 0===r?e:n+e.slice(r)}function cw(e){let t="",n=0;for(let r=0;r<e.length;r++){let i;switch(e.charCodeAt(r)){case 38:i="&amp;";break;case 60:i="&lt;";break;case 62:i="&gt;";break;case 34:i="&quot;";break;case 39:i="&apos;";break;case 9:i="&#9;";break;case 10:i="&#10;";break;case 13:i="&#13;";break;default:sw(e.charCodeAt(r))&&(i=aw(e.charCodeAt(r)))}i&&(t+=e.slice(n,r)+i,n=r+1)}return 0===n?e:t+e.slice(n)}function uw(e){if(!e)return"";let t="";const n=Object.keys(e);for(let r=0;r<n.length;r++){const i=n[r],o=e[i];null!=o&&(t+="boolean"==typeof o?` ${i}="${o?"true":"false"}"`:` ${i}="${cw(String(o))}"`)}return t}function fw(e,t){return`<${e}${uw(t)}/>`}function dw(e){const t=lw(e);return e.length>0&&(" "===e[0]||" "===e[e.length-1]||e.includes("\n")||e.includes("\t"))?`<t xml:space="preserve">${t}</t>`:hw("t",void 0,t)}function hw(e,t,n){const r=uw(t);if(null==n)return`<${e}${r}/>`;const i=Array.isArray(n)?n.join(""):n;return i?`<${e}${r}>${i}</${e}>`:`<${e}${r}/>`}function pw(e,t,n,r){const i=[];return!1!==r?.declaration&&i.push(function(e){return`<?xml version="1.0" encoding="UTF-8" standalone="${e?.standalone??"yes"}"?>`}(r)),null==n?i.push(fw(e,t)):i.push(hw(e,t,n)),i.join("")}function gw(e,t){for(const n of e.children)"string"!=typeof n&&("t"===n.local?t.push(mw(n)):gw(n,t))}function mw(e){let t="";for(const n of e.children)t+="string"==typeof n?n:mw(n);return t}function yw(e){if("string"!=typeof e)return;const t=e.trim().toLowerCase();return"1"===t||"true"===t||"0"!==t&&"false"!==t&&void 0}function vw(e){const t=e.attrs.val;if("string"==typeof t)return"1"===t||"true"===t.toLowerCase()}function Aw(e){if(void 0!==e)return"1"===e||"true"===e||"0"!==e&&"false"!==e&&void 0}function bw(e){if(!e)return;const t=Rb(e,"numRef")??Rb(e,"strRef");if(t){const e=Rb(t,"f");if(e){const t=mw(e).trim();if(t.length>0)return t}}const n=Rb(e,"f");if(n){const e=mw(n).trim();if(e.length>0)return e}}function ww(e,t){const n=Rb(e,t);if(!n)return;const r=n.attrs.val;if("string"!=typeof r)return;const i=r.trim();if(0===i.length)return;const o=Number(i);return Number.isFinite(o)?o:void 0}const Iw=.25,xw=13.5,Cw=12700,Bw=new Set(["solid","dot","dash","lgDash","dashDot","lgDashDot","lgDashDotDot","sysDash","sysDot","sysDashDot","sysDashDotDot"]),Ew=new Set(["solid","dash","dashDot","dot","lgDash","lgDashDot","lgDashDotDot","sysDash","sysDashDot","sysDashDotDot","sysDot"]),kw=new Set(["rnd","sq","flat"]),Sw=new Set(["sng","dbl","thickThin","thinThick","tri"]);function Fw(e){if("string"==typeof e&&kw.has(e)&&"flat"!==e)return e}function Dw(e){if("string"==typeof e&&Sw.has(e)&&"sng"!==e)return e}function Nw(e){const t=Rb(e,"spPr");if(!t)return;const n=Rb(t,"ln");if(!n)return;const r=n.attrs.cap;if("string"!=typeof r)return;const i=r.trim();return kw.has(i)&&"flat"!==i?i:void 0}function Mw(e){const t=Rb(e,"spPr");if(!t)return;const n=Rb(t,"ln");if(!n)return;const r=n.attrs.cmpd;if("string"!=typeof r)return;const i=r.trim();return Sw.has(i)&&"sng"!==i?i:void 0}const Qw=new Set(["bg1","tx1","bg2","tx2","accent1","accent2","accent3","accent4","accent5","accent6","hlink","folHlink","phClr","dk1","lt1","dk2","lt2"]),Tw=1e5,Lw=-1e5,Rw=1e5;function Uw(e,t,n,r){const i=Rb(e,t);if(!i)return;const o=i.attrs.val;if("string"!=typeof o)return;const a=Number.parseInt(o.trim(),10);return Number.isFinite(a)&&!(a<n||a>r)?a:void 0}function Hw(e){const t=e.attrs.val;if("string"!=typeof t)return;const n=t.trim();if(!Qw.has(n))return;const r={theme:n},i=Uw(e,"lumMod",0,Tw);void 0!==i&&(r.lumMod=i);const o=Uw(e,"lumOff",0,Tw);void 0!==o&&(r.lumOff=o);const a=Uw(e,"tint",Lw,Rw);void 0!==a&&(r.tint=a);const s=Uw(e,"shade",Lw,Rw);void 0!==s&&(r.shade=s);const l=Uw(e,"alpha",0,Tw);return void 0!==l&&(r.alpha=l),r}function qw(e){if(null==e)return;if("string"==typeof e){return Pw(e)}if("object"!=typeof e)return;const t=e.theme;if("string"!=typeof t||!Qw.has(t))return;const n={theme:t},r=(e,t,n)=>{if("number"!=typeof e||!Number.isFinite(e))return;const r=Math.round(e);return r<t||r>n?void 0:r},i=r(e.lumMod,0,Tw);void 0!==i&&(n.lumMod=i);const o=r(e.lumOff,0,Tw);void 0!==o&&(n.lumOff=o);const a=r(e.tint,Lw,Rw);void 0!==a&&(n.tint=a);const s=r(e.shade,Lw,Rw);void 0!==s&&(n.shade=s);const l=r(e.alpha,0,Tw);return void 0!==l&&(n.alpha=l),n}function Ow(e){if("string"==typeof e)return fw("a:srgbClr",{val:e});const t=[];return void 0!==e.tint&&t.push(fw("a:tint",{val:e.tint})),void 0!==e.shade&&t.push(fw("a:shade",{val:e.shade})),void 0!==e.alpha&&t.push(fw("a:alpha",{val:e.alpha})),void 0!==e.lumMod&&t.push(fw("a:lumMod",{val:e.lumMod})),void 0!==e.lumOff&&t.push(fw("a:lumOff",{val:e.lumOff})),0===t.length?fw("a:schemeClr",{val:e.theme}):hw("a:schemeClr",{val:e.theme},t)}function Pw(e){if("string"!=typeof e)return;const t=e.trim();if(0===t.length)return;const n=t.startsWith("#")?t.slice(1):t;return 6===n.length&&/^[0-9a-fA-F]{6}$/.test(n)?n.toUpperCase():void 0}function zw(e){const t=Rb(e,"spPr");if(!t)return;const n=Rb(t,"solidFill");if(!n)return;const r=Rb(n,"srgbClr");if(r)return Pw(r.attrs.val);const i=Rb(n,"schemeClr");return i?Hw(i):void 0}function $w(e){const t=Rb(e,"spPr");if(!t)return;const n=Rb(t,"ln");if(!n)return;const r=Rb(n,"solidFill");if(!r)return;const i=Rb(r,"srgbClr");if(i)return Pw(i.attrs.val);const o=Rb(r,"schemeClr");return o?Hw(o):void 0}function jw(e){const t=Rb(e,"spPr");if(!t)return;const n=Rb(t,"ln");if(!n)return;const r=n.attrs.w;if("string"!=typeof r)return;const i=Number.parseFloat(r);if(!Number.isFinite(i)||i<=0)return;const o=Math.round(i/Cw*4)/4;return o<Iw?Iw:o>xw?xw:o}function Vw(e){const t=Rb(e,"spPr");if(!t)return;const n=Rb(t,"ln");if(!n)return;const r=Rb(n,"prstDash");if(!r)return;const i=r.attrs.val;if("string"!=typeof i)return;const o=i.trim();return Ew.has(o)&&"solid"!==o?o:void 0}function Yw(e){if(void 0===e||!Number.isFinite(e))return;const t=Math.round(4*e)/4;return t<Iw?Iw:t>xw?xw:t}function Gw(e){if("string"==typeof e&&Ew.has(e)&&"solid"!==e)return e}function Ww(e){const t=Rb(e,"view3D");if(!t)return;const n={},r=Jw(t,"rotX",-90,90);void 0!==r&&(n.rotX=r);const i=Jw(t,"hPercent",5,500);void 0!==i&&(n.hPercent=i);const o=Jw(t,"rotY",0,360);void 0!==o&&(n.rotY=o);const a=Jw(t,"depthPercent",20,2e3);void 0!==a&&(n.depthPercent=a);const s=function(e,t){const n=Rb(e,t);if(!n)return;const r=n.attrs.val;if("string"!=typeof r)return;switch(r){case"1":case"true":return!0;case"0":case"false":return!1;default:return}}(t,"rAngAx");void 0!==s&&(n.rAngAx=s);const l=Jw(t,"perspective",0,240);return void 0!==l&&(n.perspective=l),n}function Jw(e,t,n,r){const i=Rb(e,t);if(!i)return;const o=i.attrs.val;if("string"!=typeof o)return;if(!/^-?\d+$/.test(o))return;const a=Number(o);return Number.isInteger(a)&&!(a<n||a>r)?a:void 0}function _w(e,t,n){if("number"==typeof e&&Number.isFinite(e)&&Number.isInteger(e)&&!(e<t||e>n))return e}function Xw(e){if(!e)return;const t=e.attrs.val;if("string"!=typeof t)return;const n=t.trim();if(0===n.length)return;const r=Number(n);return Number.isFinite(r)&&!(r<0||r>1)?r:void 0}function Kw(e){const t=Rb(e,"layout");if(!t)return;const n=Rb(t,"manualLayout");if(!n)return;const r=Xw(Rb(n,"x")),i=Xw(Rb(n,"y")),o=Xw(Rb(n,"w")),a=Xw(Rb(n,"h"));if(void 0===r&&void 0===i&&void 0===o&&void 0===a)return;const s={};return void 0!==r&&(s.x=r),void 0!==i&&(s.y=i),void 0!==o&&(s.w=o),void 0!==a&&(s.h=a),s}function Zw(e){if(!e||"object"!=typeof e)return;const t={},n=eI(e.x);void 0!==n&&(t.x=n);const r=eI(e.y);void 0!==r&&(t.y=r);const i=eI(e.w);void 0!==i&&(t.w=i);const o=eI(e.h);return void 0!==o&&(t.h=o),void 0!==t.x||void 0!==t.y||void 0!==t.w||void 0!==t.h?t:void 0}function eI(e){if("number"==typeof e&&Number.isFinite(e)&&!(e<0||e>1))return e}function tI(e){if(!e)return;const t=[];return void 0!==e.x&&t.push(fw("c:xMode",{val:"edge"})),void 0!==e.y&&t.push(fw("c:yMode",{val:"edge"})),void 0!==e.w&&t.push(fw("c:wMode",{val:"edge"})),void 0!==e.h&&t.push(fw("c:hMode",{val:"edge"})),void 0!==e.x&&t.push(fw("c:x",{val:e.x})),void 0!==e.y&&t.push(fw("c:y",{val:e.y})),void 0!==e.w&&t.push(fw("c:w",{val:e.w})),void 0!==e.h&&t.push(fw("c:h",{val:e.h})),0!==t.length?hw("c:layout",void 0,[hw("c:manualLayout",void 0,t)]):void 0}function nI(e){const t=Rb(e,"txPr");if(t)return iI(t)}function rI(e){const t=Rb(e,"title");if(!t)return;const n=Rb(t,"tx");if(!n)return;const r=Rb(n,"rich");return r?iI(r):void 0}function iI(e){const t=Rb(e,"p");if(!t)return;const n=Rb(t,"pPr");return n?Rb(n,"defRPr"):void 0}const oI=6e4,aI=100,sI=400,lI=oI,cI=-90;function uI(e,t,n,r,i,o){if(void 0===e&&void 0===t&&void 0===n&&void 0===r&&void 0===i&&void 0===o)return;const a=[];if(void 0!==e&&a.push(hw("a:solidFill",void 0,[Ow(e)])),void 0!==t||void 0!==n||void 0!==r||void 0!==i||void 0!==o){const e={};void 0!==n&&(e.w=Math.round(n*Cw)),void 0!==i&&(e.cap=i),void 0!==o&&(e.cmpd=o);const s=[];void 0!==t&&s.push(hw("a:solidFill",void 0,[Ow(t)])),void 0!==r&&s.push(fw("a:prstDash",{val:r})),a.push(0===s.length?fw("a:ln",e):hw("a:ln",Object.keys(e).length>0?e:void 0,s))}return hw("c:spPr",void 0,a)}function fI(e){if(void 0===e||"number"!=typeof e||!Number.isFinite(e))return;let t=Math.round(e);return t<cI?t=cI:t>90&&(t=90),0!==t?t:void 0}function dI(e){if(void 0===e||"number"!=typeof e||!Number.isFinite(e))return;const t=Math.round(2*e)/2;return t<1||t>400?void 0:t}function hI(e){return!0===e||!1!==e&&void 0}function pI(e){return!0===e||!1!==e&&void 0}function gI(e){return"string"==typeof e?Pw(e):qw(e)}function mI(e){return!0===e||!1!==e&&void 0}function yI(e){return!0===e||!1!==e&&void 0}const vI=aI,AI=sI;function bI(e,t,n,r,i,o,a,s,l,c,u,f,d,h,p,g,m){const y=[fw("c:legendPos",{val:e})];for(const e of n){const t=[fw("c:idx",{val:e.idx}),fw("c:delete",{val:e.delete?1:0})],n=wI(e.fontSize,e.bold,e.italic,e.underline,e.strikethrough,e.color,e.fontFamily);void 0!==n&&t.push(n),y.push(hw("c:legendEntry",void 0,t))}const v=tI(u);void 0!==v&&y.push(v),y.push(fw("c:overlay",{val:t?1:0}));const A=function(e,t,n,r,i,o){if(void 0===e&&void 0===t&&void 0===n&&void 0===r&&void 0===i&&void 0===o)return;const a=[];void 0!==e&&a.push(hw("a:solidFill",void 0,[Ow(e)]));if(void 0!==t||void 0!==n||void 0!==r||void 0!==i||void 0!==o){const e={};void 0!==n&&(e.w=Math.round(n*Cw)),void 0!==i&&(e.cap=i),void 0!==o&&(e.cmpd=o);const s=[];void 0!==t&&s.push(hw("a:solidFill",void 0,[Ow(t)])),void 0!==r&&s.push(fw("a:prstDash",{val:r})),a.push(0===s.length?fw("a:ln",e):hw("a:ln",Object.keys(e).length>0?e:void 0,s))}return hw("c:spPr",void 0,a)}(f,d,h,p,g,m);void 0!==A&&y.push(A);const b=wI(r,i,o,a,s,l,c);return void 0!==b&&y.push(b),hw("c:legend",void 0,y)}function wI(e,t,n,r,i,o,a){if(void 0===e&&void 0===t&&void 0===n&&void 0===r&&void 0===i&&void 0===o&&void 0===a)return;const s={};void 0!==e&&(s.sz=e*vI),void 0!==t&&(s.b=t?1:0),void 0!==n&&(s.i=n?1:0),void 0!==r&&(s.u=r?"sng":"none"),!0===i&&(s.strike="sngStrike");const l=void 0!==o?hw("a:solidFill",void 0,[Ow(o)]):void 0,c=a?fw("a:latin",{typeface:a}):void 0,u=[];l&&u.push(l),c&&u.push(c);const f=u.length>0?hw("a:defRPr",s,u):fw("a:defRPr",s);return hw("c:txPr",void 0,[fw("a:bodyPr"),fw("a:lstStyle"),hw("a:p",void 0,[hw("a:pPr",void 0,[f]),fw("a:endParaRPr",{lang:"en-US"})])])}const II=aI;function xI(e){const t=Rb(e,"dTable");if(!t)return;const n={},r=CI(t,"showHorzBorder");void 0!==r&&(n.showHorzBorder=r);const i=CI(t,"showVertBorder");void 0!==i&&(n.showVertBorder=i);const o=CI(t,"showOutline");void 0!==o&&(n.showOutline=o);const a=CI(t,"showKeys");void 0!==a&&(n.showKeys=a);const s=function(e){const t=nI(e);if(!t)return;const n=t.attrs.sz;if("string"!=typeof n)return;const r=n.trim();if(0===r.length)return;const i=Number.parseInt(r,10);if(!Number.isFinite(i))return;const o=Math.round(i/II*2)/2;return o<1||o>400?void 0:o}(t);void 0!==s&&(n.fontSize=s);const l=function(e){const t=nI(e);if(!t)return;const n=Rb(t,"solidFill");if(!n)return;const r=Rb(n,"srgbClr");if(r)return Pw(r.attrs.val);const i=Rb(n,"schemeClr");return i?Hw(i):void 0}(t);void 0!==l&&(n.fontColor=l);const c=function(e){const t=nI(e);if(!t)return;const n=t.attrs.b;if("string"!=typeof n)return;switch(n){case"1":case"true":return!0;case"0":case"false":return!1;default:return}}(t);void 0!==c&&(n.bold=c);const u=function(e){const t=nI(e);if(!t)return;const n=t.attrs.i;if("string"!=typeof n)return;switch(n){case"1":case"true":return!0;case"0":case"false":return!1;default:return}}(t);void 0!==u&&(n.italic=u);const f=function(e){const t=nI(e);if(!t)return;const n=t.attrs.u;return"sng"===n||"none"!==n&&void 0}(t);void 0!==f&&(n.underline=f);const d=function(e){const t=nI(e);if(!t)return;return"sngStrike"===t.attrs.strike||void 0}(t);void 0!==d&&(n.strikethrough=d);const h=function(e){const t=nI(e);if(!t)return;const n=Rb(t,"latin");if(!n)return;const r=n.attrs.typeface;if("string"!=typeof r)return;const i=r.trim();return 0===i.length?void 0:i}(t);void 0!==h&&(n.fontFamily=h);const p=zw(t);void 0!==p&&(n.fillColor=p);const g=function(e){return $w(e)}(t);void 0!==g&&(n.borderColor=g);const m=jw(t);void 0!==m&&(n.borderWidth=m);const y=Vw(t);void 0!==y&&(n.borderDash=y);const v=Nw(t);void 0!==v&&(n.borderCap=v);const A=Mw(t);return void 0!==A&&(n.borderCompound=A),n}function CI(e,t){const n=Rb(e,t);if(!n)return;const r=n.attrs.val;if("string"==typeof r)switch(r){case"1":case"true":return!0;case"0":case"false":return!1;default:return}}function BI(e){return gI(e)}function EI(e){return!0===e||!1!==e&&void 0}function kI(e){return!0===e||!1!==e&&void 0}function SI(e){return!0===e||!1!==e&&void 0}function FI(e){if(!0===e)return!0}function DI(e){if("string"!=typeof e)return;const t=e.trim();return 0!==t.length?t:void 0}function NI(e){return gI(e)}function MI(e){return gI(e)}function QI(e){const t=[fw("c:showHorzBorder",{val:e.showHorzBorder?1:0}),fw("c:showVertBorder",{val:e.showVertBorder?1:0}),fw("c:showOutline",{val:e.showOutline?1:0}),fw("c:showKeys",{val:e.showKeys?1:0})],n=function(e,t,n,r,i,o){if(void 0===e&&void 0===t&&void 0===n&&void 0===r&&void 0===i&&void 0===o)return;const a=[];void 0!==e&&a.push(hw("a:solidFill",void 0,[Ow(e)]));if(void 0!==t||void 0!==n||void 0!==r||void 0!==i||void 0!==o){const e={};void 0!==n&&(e.w=Math.round(n*Cw)),void 0!==i&&(e.cap=i),void 0!==o&&(e.cmpd=o);const s=[];void 0!==t&&s.push(hw("a:solidFill",void 0,[Ow(t)])),void 0!==r&&s.push(fw("a:prstDash",{val:r})),a.push(0===s.length?fw("a:ln",e):hw("a:ln",Object.keys(e).length>0?e:void 0,s))}return hw("c:spPr",void 0,a)}(e.fillColor,e.borderColor,e.borderWidth,e.borderDash,e.borderCap,e.borderCompound);void 0!==n&&t.push(n);const r=function(e,t,n,r,i,o,a){if(void 0===e&&void 0===t&&void 0===n&&void 0===r&&void 0===i&&void 0===o&&void 0===a)return;const s={};void 0!==e&&(s.sz=e*II);void 0!==n&&(s.b=n?1:0);void 0!==r&&(s.i=r?1:0);void 0!==i&&(s.u=i?"sng":"none");!0===o&&(s.strike="sngStrike");const l=void 0!==t?hw("a:solidFill",void 0,[Ow(t)]):void 0,c=a?fw("a:latin",{typeface:a}):void 0,u=[];l&&u.push(l);c&&u.push(c);const f=u.length>0?hw("a:defRPr",s,u):fw("a:defRPr",s);return hw("c:txPr",void 0,[fw("a:bodyPr"),fw("a:lstStyle"),hw("a:p",void 0,[hw("a:pPr",void 0,[f]),fw("a:endParaRPr",{lang:"en-US"})])])}(e.fontSize,e.fontColor,e.bold,e.italic,e.underline,e.strikethrough,e.fontFamily);return void 0!==r&&t.push(r),hw("c:dTable",void 0,t)}const TI=aI,LI=new Set(["t","b","l","r","ctr","inEnd","inBase","outEnd","bestFit"]);function RI(e){const t=Rb(e,"delete");if(t&&!0===vw(t))return;const n={},r=Rb(e,"dLblPos");if(r){const e=r.attrs.val;"string"==typeof e&&LI.has(e)&&(n.position=e)}const i=Rb(e,"showLegendKey");i&&!0===vw(i)&&(n.showLegendKey=!0);const o=Rb(e,"showVal");o&&!0===vw(o)&&(n.showValue=!0);const a=Rb(e,"showCatName");a&&!0===vw(a)&&(n.showCategoryName=!0);const s=Rb(e,"showSerName");s&&!0===vw(s)&&(n.showSeriesName=!0);const l=Rb(e,"showPercent");l&&!0===vw(l)&&(n.showPercent=!0);const c=Rb(e,"separator");if(c){const e=mw(c);e.length>0&&(n.separator=e)}const u=function(e){const t=Rb(e,"numFmt");if(!t)return;const n=t.attrs.formatCode;if("string"!=typeof n||0===n.length)return;const r={formatCode:n},i=t.attrs.sourceLinked;"string"==typeof i&&("1"!==i&&"true"!==i.toLowerCase()||(r.sourceLinked=!0));return r}(e);u&&(n.numberFormat=u);const f=Rb(e,"showLeaderLines");if(f){const e=f.attrs.val;"string"!=typeof e||"0"!==e&&"false"!==e.toLowerCase()||(n.showLeaderLines=!1)}const d=function(e){const t=nI(e);if(!t)return;const n=t.attrs.sz;if("string"!=typeof n)return;const r=n.trim();if(0===r.length)return;const i=Number.parseInt(r,10);if(!Number.isFinite(i))return;const o=Math.round(i/TI*2)/2;return o<1||o>400?void 0:o}(e);void 0!==d&&(n.fontSize=d);const h=function(e){const t=nI(e);if(!t)return;const n=Rb(t,"solidFill");if(!n)return;const r=Rb(n,"srgbClr");if(r)return Pw(r.attrs.val);const i=Rb(n,"schemeClr");return i?Hw(i):void 0}(e);void 0!==h&&(n.fontColor=h);const p=function(e){const t=nI(e);if(!t)return;const n=t.attrs.b;return"1"===n||"true"===n||void 0}(e);void 0!==p&&(n.bold=p);const g=function(e){const t=nI(e);if(!t)return;const n=t.attrs.i;return"1"===n||"true"===n||void 0}(e);void 0!==g&&(n.italic=g);const m=function(e){const t=nI(e);if(!t)return;return"sng"===t.attrs.u||void 0}(e);void 0!==m&&(n.underline=m);const y=function(e){const t=nI(e);if(!t)return;return"sngStrike"===t.attrs.strike||void 0}(e);void 0!==y&&(n.strikethrough=y);const v=function(e){const t=nI(e);if(!t)return;const n=Rb(t,"latin");if(!n)return;const r=n.attrs.typeface;if("string"!=typeof r)return;const i=r.trim();return 0===i.length?void 0:i}(e);void 0!==v&&(n.fontFamily=v);const A=zw(e);void 0!==A&&(n.fillColor=A);const b=function(e){return $w(e)}(e);void 0!==b&&(n.borderColor=b);const w=jw(e);void 0!==w&&(n.borderWidth=w);const I=Vw(e);void 0!==I&&(n.borderDash=I);const x=Nw(e);void 0!==x&&(n.borderCap=x);const C=Mw(e);return void 0!==C&&(n.borderCompound=C),void 0!==n.position||n.showValue||n.showCategoryName||n.showSeriesName||n.showPercent||n.showLegendKey||void 0!==n.separator||void 0!==n.numberFormat||void 0!==n.showLeaderLines||void 0!==n.fontSize||void 0!==n.fontColor||void 0!==n.bold||void 0!==n.italic||void 0!==n.underline||void 0!==n.strikethrough||void 0!==n.fontFamily||void 0!==n.fillColor||void 0!==n.borderColor||void 0!==n.borderWidth||void 0!==n.borderDash||void 0!==n.borderCap||void 0!==n.borderCompound?n:void 0}function UI(e){if(e.dataLabels)return HI(e.dataLabels,e.type)}function HI(e,t){const n=[],r=function(e){if(!e)return;const t=e.formatCode;if("string"!=typeof t||0===t.length)return;const n={formatCode:t};!0===e.sourceLinked&&(n.sourceLinked=!0);return n}(e.numberFormat);r&&n.push(fw("c:numFmt",{formatCode:r.formatCode,sourceLinked:!0===r.sourceLinked?1:0}));const i=function(e,t,n,r,i,o){if(void 0===e&&void 0===t&&void 0===n&&void 0===r&&void 0===i&&void 0===o)return;const a=[];void 0!==e&&a.push(hw("a:solidFill",void 0,[Ow(e)]));if(void 0!==t||void 0!==n||void 0!==r||void 0!==i||void 0!==o){const e={};void 0!==n&&(e.w=Math.round(n*Cw)),void 0!==i&&(e.cap=i),void 0!==o&&(e.cmpd=o);const s=[];void 0!==t&&s.push(hw("a:solidFill",void 0,[Ow(t)])),void 0!==r&&s.push(fw("a:prstDash",{val:r})),a.push(0===s.length?fw("a:ln",e):hw("a:ln",Object.keys(e).length>0?e:void 0,s))}return hw("c:spPr",void 0,a)}(gI(e.fillColor),function(e){return gI(e)}(e.borderColor),Yw(e.borderWidth),Gw(e.borderDash),Fw(e.borderCap),Dw(e.borderCompound));void 0!==i&&n.push(i);const o=function(e,t,n,r,i,o,a){if(void 0===e&&void 0===t&&void 0===n&&void 0===r&&void 0===i&&void 0===o&&void 0===a)return;const s={};void 0!==e&&(s.sz=e*TI);void 0!==n&&(s.b=n?1:0);void 0!==r&&(s.i=r?1:0);void 0!==i&&(s.u=i?"sng":"none");!0===o&&(s.strike="sngStrike");const l=void 0!==t?hw("a:solidFill",void 0,[Ow(t)]):void 0,c=a?fw("a:latin",{typeface:a}):void 0,u=[];l&&u.push(l);c&&u.push(c);const f=u.length>0?hw("a:defRPr",s,u):fw("a:defRPr",s);return hw("c:txPr",void 0,[fw("a:bodyPr"),fw("a:lstStyle"),hw("a:p",void 0,[hw("a:pPr",void 0,[f]),fw("a:endParaRPr",{lang:"en-US"})])])}(function(e){return dI(e)}(e.fontSize),function(e){return gI(e)}(e.fontColor),function(e){return!0===e||!1!==e&&void 0}(e.bold),function(e){return!0===e||!1!==e&&void 0}(e.italic),function(e){return!0===e||!1!==e&&void 0}(e.underline),function(e){return!0===e||void 0}(e.strikethrough),function(e){if("string"!=typeof e)return;const t=e.trim();return 0===t.length?void 0:t}(e.fontFamily));return void 0!==o&&n.push(o),e.position&&n.push(fw("c:dLblPos",{val:e.position})),n.push(fw("c:showLegendKey",{val:!0===e.showLegendKey?1:0})),n.push(fw("c:showVal",{val:e.showValue?1:0})),n.push(fw("c:showCatName",{val:e.showCategoryName?1:0})),n.push(fw("c:showSerName",{val:e.showSeriesName?1:0})),n.push(fw("c:showPercent",{val:e.showPercent?1:0})),n.push(fw("c:showBubbleSize",{val:0})),void 0!==e.separator&&n.push(hw("c:separator",void 0,lw(e.separator))),"pie"!==t&&"doughnut"!==t||!1!==e.showLeaderLines||n.push(fw("c:showLeaderLines",{val:0})),hw("c:dLbls",void 0,n)}const qI=new Set(["cone","coneToMax","box","cylinder","pyramid","pyramidToMax"]),OI=new Set(["linear","log","exp","power","poly","movingAvg"]),PI=new Set(["x","y"]),zI=new Set(["both","minus","plus"]),$I=new Set(["cust","fixedVal","percentage","stdDev","stdErr"]);function jI(e){const t=function(e){if("string"==typeof e)return qI.has(e)?e:void 0}(e);if(void 0!==t)return fw("c:shape",{val:t})}function VI(e){const t=Rb(e,"spPr");if(!t)return;const n=Rb(t,"solidFill");if(!n)return;const r=Rb(n,"srgbClr");return r?Pw(r.attrs.val):void 0}function YI(e){const t=Rb(e,"spPr");if(!t)return;const n=Rb(t,"ln");if(!n)return;const r=Rb(n,"solidFill");if(!r)return;const i=Rb(r,"srgbClr");return i?Pw(i.attrs.val):void 0}function GI(e){const t=Rb(e,"spPr");if(!t)return;const n=Rb(t,"ln");if(!n)return;const r=n.attrs.w;if("string"!=typeof r)return;const i=Number.parseFloat(r);if(!Number.isFinite(i)||i<=0)return;const o=Math.round(i/Cw*4)/4;return o<Iw?Iw:o>xw?xw:o}function WI(e){const t=Rb(e,"spPr");if(!t)return;const n=Rb(t,"ln");if(!n)return;const r=Rb(n,"prstDash");if(!r)return;const i=r.attrs.val;if("string"!=typeof i)return;const o=i.trim();return Ew.has(o)&&"solid"!==o?o:void 0}function JI(e){const t="string"==typeof e.type&&OI.has(e.type)?e.type:void 0;if(void 0===t)return;const n=[];"string"==typeof e.name&&e.name.trim().length>0&&n.push(hw("c:name",void 0,e.name.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;")));const r=function(e){const t=Pw(e.lineColor),n=Yw(e.lineWidth),r=Gw(e.lineDash);if(!t&&void 0===n&&void 0===r)return;const i={};void 0!==n&&(i.w=Math.round(n*Cw));const o=[];t&&o.push(hw("a:solidFill",void 0,[fw("a:srgbClr",{val:t})]));void 0!==r&&o.push(fw("a:prstDash",{val:r}));const a=0===o.length?fw("a:ln",i):hw("a:ln",Object.keys(i).length>0?i:void 0,o);return hw("c:spPr",void 0,[a])}(e);if(r&&n.push(r),n.push(fw("c:trendlineType",{val:t})),"poly"===t&&"number"==typeof e.order&&Number.isFinite(e.order)){const t=Math.max(2,Math.min(6,Math.round(e.order)));n.push(fw("c:order",{val:t}))}if("movingAvg"===t&&"number"==typeof e.period&&Number.isFinite(e.period)){const t=Math.max(2,Math.min(100,Math.round(e.period)));n.push(fw("c:period",{val:t}))}return"number"==typeof e.forward&&Number.isFinite(e.forward)&&n.push(fw("c:forward",{val:e.forward})),"number"==typeof e.backward&&Number.isFinite(e.backward)&&n.push(fw("c:backward",{val:e.backward})),"number"==typeof e.intercept&&Number.isFinite(e.intercept)&&n.push(fw("c:intercept",{val:e.intercept})),!0===e.dispRSquared&&n.push(fw("c:dispRSqr",{val:1})),!0===e.dispEquation&&n.push(fw("c:dispEq",{val:1})),hw("c:trendline",void 0,n)}function _I(e){if(!PI.has(e.direction))return;if(!zI.has(e.type))return;if(!$I.has(e.valType))return;const t=[fw("c:errDir",{val:e.direction}),fw("c:errBarType",{val:e.type}),fw("c:errValType",{val:e.valType})];!0===e.noEndCap&&t.push(fw("c:noEndCap",{val:1})),"stdErr"!==e.valType&&"cust"!==e.valType&&"number"==typeof e.value&&Number.isFinite(e.value)&&t.push(fw("c:val",{val:e.value}));const n=Pw(e.lineColor),r=Yw(e.lineWidth),i=Gw(e.lineDash);if(n||void 0!==r||void 0!==i){const e={};void 0!==r&&(e.w=Math.round(r*Cw));const o=[];n&&o.push(hw("a:solidFill",void 0,[fw("a:srgbClr",{val:n})])),void 0!==i&&o.push(fw("a:prstDash",{val:i}));const a=0===o.length?fw("a:ln",e):hw("a:ln",Object.keys(e).length>0?e:void 0,o);t.push(hw("c:spPr",void 0,[a]))}return hw("c:errBars",void 0,t)}const XI=new Set(["none","auto","circle","square","diamond","triangle","x","star","dot","dash","plus"]),KI=2,ZI=72;function ex(e,t){return e.includes("!")?e:`${n=t,/^[A-Za-z_][A-Za-z0-9_]*$/.test(n)?n:`'${n.replace(/'/g,"''")}'`}!${e}`;var n}function tx(e,t,n){const r={kind:t,index:n},i=function(e){const t=Rb(e,"tx");if(!t)return;const n=Rb(t,"v");if(n){const e=mw(n).trim();if(e.length>0)return e}const r=Rb(t,"strRef");if(r){const e=Rb(r,"strCache");if(e)for(const t of Ub(e)){if("pt"!==t.local)continue;const e=Rb(t,"v");if(e){const t=mw(e).trim();if(t.length>0)return t}}const t=bw(r);if(t)return t}return}(e);void 0!==i&&(r.name=i);const o=bw(Rb(e,"val"))??bw(Rb(e,"yVal"));void 0!==o&&(r.valuesRef=o);const a=bw(Rb(e,"cat"))??bw(Rb(e,"xVal"));void 0!==a&&(r.categoriesRef=a);const s=function(e){const t=Rb(e,"spPr");if(!t)return;const n=Rb(t,"solidFill");if(!n)return;const r=Rb(n,"srgbClr");if(r){const e=r.attrs.val;if("string"!=typeof e)return;const t=e.replace(/^#/,"").toUpperCase();return/^[0-9A-F]{6}$/.test(t)?t:void 0}const i=Rb(n,"schemeClr");return i?Hw(i):void 0}(e);void 0!==s&&(r.color=s);const l=Rb(e,"dLbls");if(l){const e=RI(l);e&&(r.dataLabels=e)}if("line"===t||"line3D"===t||"scatter"===t){const t=function(e){const t=Rb(e,"smooth");if(!t)return;return!0===vw(t)||void 0}(e);void 0!==t&&(r.smooth=t);const n=function(e){const t=Rb(e,"spPr");if(!t)return;const n=Rb(t,"ln");if(!n)return;const r={},i=n.attrs.w;if("string"==typeof i){const e=Number.parseFloat(i);if(Number.isFinite(e)&&e>0){const t=Math.round(e/Cw*4)/4;r.width=t<Iw?Iw:t>xw?xw:t}}const o=Rb(n,"prstDash");if(o){const e=o.attrs.val;"string"==typeof e&&Bw.has(e)&&(r.dash=e)}const a=n.attrs.cap;if("string"==typeof a){const e=a.trim();kw.has(e)&&"flat"!==e&&(r.cap=e)}const s=n.attrs.cmpd;if("string"==typeof s){const e=s.trim();Sw.has(e)&&"sng"!==e&&(r.compound=e)}return void 0===r.dash&&void 0===r.width&&void 0===r.cap&&void 0===r.compound?void 0:r}(e);void 0!==n&&(r.stroke=n);const i=nx(e);void 0!==i&&(r.marker=i)}if("bar"===t||"bar3D"===t){const t=function(e){const t=Rb(e,"invertIfNegative");if(!t)return;return!0===vw(t)||void 0}(e);void 0!==t&&(r.invertIfNegative=t)}if("pie"===t||"pie3D"===t||"doughnut"===t||"ofPie"===t){const t=function(e){const t=Rb(e,"explosion");if(!t)return;const n=t.attrs.val;if("string"!=typeof n)return;const r=Number.parseFloat(n);if(!Number.isFinite(r)||r<0)return;const i=Math.round(r);return 0===i?void 0:i}(e);void 0!==t&&(r.explosion=t)}const c=function(e){const t=[];for(const n of Ub(e)){if("dPt"!==n.local)continue;const e=Rb(n,"idx");if(!e)continue;const r=e.attrs.val;if("string"!=typeof r)continue;const i=Number.parseInt(r,10);if(!Number.isFinite(i)||i<0)continue;const o={idx:i},a=Rb(n,"explosion");if(a){const e=a.attrs.val;if("string"==typeof e){const t=Number.parseFloat(e);if(Number.isFinite(t)&&t>0){const e=Math.round(t);e>0&&(o.explosion=e)}}}const s=Rb(n,"bubble3D");s&&!0===vw(s)&&(o.bubble3D=!0);const l=VI(n);void 0!==l&&(o.fillColor=l);const c=YI(n);void 0!==c&&(o.borderColor=c);const u=GI(n);void 0!==u&&(o.borderWidth=u);const f=WI(n);void 0!==f&&(o.borderDash=f);const d=nx(n);void 0!==d&&(o.marker=d),t.push(o)}return t.length>0?t:void 0}(e);if(void 0!==c&&(r.dataPoints=c),"bar"===t||"bar3D"===t||"line"===t||"line3D"===t||"area"===t||"area3D"===t||"scatter"===t||"bubble"===t){const t=function(e){const t=[];for(const n of Ub(e)){if("trendline"!==n.local)continue;const e=Rb(n,"trendlineType");if(!e)continue;const r=e.attrs.val;if("string"!=typeof r)continue;const i=r.trim();if(!OI.has(i))continue;const o={type:i},a=Rb(n,"name");if(a){let e="";for(const t of a.children)"string"==typeof t&&(e+=t);const t=e.trim();t.length>0&&(o.name=t)}const s=Rb(n,"order");if(s){const e=parseFloat(String(s.attrs.val??""));if(Number.isFinite(e)){const t=Math.round(e);t>=2&&t<=6&&(o.order=t)}}const l=Rb(n,"period");if(l){const e=parseFloat(String(l.attrs.val??""));if(Number.isFinite(e)){const t=Math.round(e);t>=2&&t<=100&&(o.period=t)}}const c=Rb(n,"forward");if(c){const e=parseFloat(String(c.attrs.val??""));Number.isFinite(e)&&(o.forward=e)}const u=Rb(n,"backward");if(u){const e=parseFloat(String(u.attrs.val??""));Number.isFinite(e)&&(o.backward=e)}const f=Rb(n,"intercept");if(f){const e=parseFloat(String(f.attrs.val??""));Number.isFinite(e)&&(o.intercept=e)}const d=Rb(n,"dispEq");d&&!0===vw(d)&&(o.dispEquation=!0);const h=Rb(n,"dispRSqr");h&&!0===vw(h)&&(o.dispRSquared=!0);const p=Rb(n,"spPr");if(p){const e=Rb(p,"ln");if(e){const t=Rb(e,"solidFill");if(t){const e=Rb(t,"srgbClr");if(e){const t=Pw(e.attrs.val);t&&(o.lineColor=t)}}const n=e.attrs.w;if("string"==typeof n){const e=Number.parseFloat(n);if(Number.isFinite(e)&&e>0){const t=Math.round(e/Cw*4)/4;o.lineWidth=t>=Iw&&t<=xw?t:t<Iw?Iw:xw}}const r=Rb(e,"prstDash");if(r){const e=r.attrs.val;if("string"==typeof e){const t=e.trim();Ew.has(t)&&"solid"!==t&&(o.lineDash=t)}}}}t.push(o)}return t.length>0?t:void 0}(e);void 0!==t&&(r.trendlines=t);const n=function(e){const t=[];for(const n of Ub(e)){if("errBars"!==n.local)continue;const e=Rb(n,"errDir");if(!e)continue;const r=e.attrs.val;if("string"!=typeof r)continue;const i=r.trim();if(!PI.has(i))continue;const o=Rb(n,"errBarType");if(!o)continue;const a=o.attrs.val;if("string"!=typeof a)continue;const s=a.trim();if(!zI.has(s))continue;const l=Rb(n,"errValType");if(!l)continue;const c=l.attrs.val;if("string"!=typeof c)continue;const u=c.trim();if(!$I.has(u))continue;const f={direction:i,type:s,valType:u},d=Rb(n,"val");if(d){const e=parseFloat(String(d.attrs.val??""));Number.isFinite(e)&&(f.value=e)}const h=Rb(n,"noEndCap");h&&!0===vw(h)&&(f.noEndCap=!0);const p=Rb(n,"spPr");if(p){const e=Rb(p,"ln");if(e){const t=Rb(e,"solidFill");if(t){const e=Rb(t,"srgbClr");if(e){const t=Pw(e.attrs.val);t&&(f.lineColor=t)}}const n=e.attrs.w;if("string"==typeof n){const e=Number.parseFloat(n);if(Number.isFinite(e)&&e>0){const t=Math.round(e/Cw*4)/4;f.lineWidth=t<Iw?Iw:t>xw?xw:t}}const r=Rb(e,"prstDash");if(r){const e=r.attrs.val;if("string"==typeof e){const t=e.trim();Ew.has(t)&&"solid"!==t&&(f.lineDash=t)}}}}t.push(f)}return t.length>0?t:void 0}(e);void 0!==n&&(r.errorBars=n)}if("bubble"===t){const t=function(e){return bw(Rb(e,"bubbleSize"))}(e);void 0!==t&&(r.bubbleSizeRef=t)}if("bar3D"===t){const t=function(e){const t=Rb(e,"shape");if(!t)return;const n=t.attrs.val;if("string"!=typeof n)return;const r=n.trim();return qI.has(r)?r:void 0}(e);void 0!==t&&(r.shape3D=t)}return r}function nx(e){const t=Rb(e,"marker");if(!t)return;const n={},r=Rb(t,"symbol");if(r){const e=r.attrs.val;"string"==typeof e&&XI.has(e)&&(n.symbol=e)}const i=Rb(t,"size");if(i){const e=i.attrs.val;if("string"==typeof e){const t=Number.parseInt(e,10);Number.isFinite(t)&&(n.size=t<2?2:t>72?72:t)}}const o=Rb(t,"spPr");if(o){const e=Rb(o,"solidFill");if(e){const t=Rb(e,"srgbClr"),r=t?.attrs.val;if("string"==typeof r){const e=r.replace(/^#/,"").toUpperCase();/^[0-9A-F]{6}$/.test(e)&&(n.fill=e)}}const t=Rb(o,"ln");if(t){const e=Rb(t,"solidFill");if(e){const t=Rb(e,"srgbClr"),r=t?.attrs.val;if("string"==typeof r){const e=r.replace(/^#/,"").toUpperCase();/^[0-9A-F]{6}$/.test(e)&&(n.line=e)}}}}return void 0!==n.symbol||void 0!==n.size||void 0!==n.fill||void 0!==n.line?n:void 0}function rx(e,t,n,r,i){const o=[fw("c:idx",{val:t}),fw("c:order",{val:t})];e.name&&o.push(hw("c:tx",void 0,[hw("c:v",void 0,lw(e.name))]));const a=function(e,t){let n;if("string"==typeof e){const t=e.replace(/^#/,"").toUpperCase();n=/^[0-9A-F]{6}$/.test(t)?t:void 0}else void 0!==e&&(n=qw(e));const r=(c=t?.dash,void 0===c?void 0:Bw.has(c)?c:void 0),i=Yw(t?.width),o=Fw(t?.cap),a="flat"===o?void 0:o,s=Dw(t?.compound),l="sng"===s?void 0:s;var c;if(!n&&void 0===r&&void 0===i&&void 0===a&&void 0===l)return;const u=[];void 0!==n&&u.push(hw("a:solidFill",void 0,[Ow(n)]));if(void 0!==n||void 0!==r||void 0!==i||void 0!==a||void 0!==l){const e={};void 0!==i&&(e.w=Math.round(i*Cw)),void 0!==a&&(e.cap=a),void 0!==l&&(e.cmpd=l);const t=[];void 0!==n&&t.push(hw("a:solidFill",void 0,[Ow(n)])),void 0!==r&&t.push(fw("a:prstDash",{val:r})),u.push(0===t.length?fw("a:ln",e):hw("a:ln",Object.keys(e).length>0?e:void 0,t))}return hw("c:spPr",void 0,u)}(e.color,i?.stroke);a&&o.push(a);const s=ix(i?.marker);s&&o.push(s),!0===i?.invertIfNegative&&o.push(fw("c:invertIfNegative",{val:1}));const l=function(e){if(void 0===e||!Number.isFinite(e))return;const t=Math.round(e);return t<=0?void 0:t>400?400:t}(i?.explosion);void 0!==l&&o.push(fw("c:explosion",{val:l}));const c=function(e,t){if(!e||0===e.length)return[];const n="pie"===t||"doughnut"===t||"pie3D"===t,r=[];for(const t of e){if(!Number.isFinite(t.idx)||t.idx<0)continue;const e=Math.floor(t.idx),i=[];i.push(fw("c:idx",{val:e}));const o=ix(t.marker);if(o&&i.push(o),i.push(fw("c:bubble3D",{val:!0===t.bubble3D?1:0})),n&&void 0!==t.explosion&&Number.isFinite(t.explosion)){const e=Math.max(0,Math.min(400,Math.round(t.explosion)));e>0&&i.push(fw("c:explosion",{val:e}))}const a=Pw(t.fillColor),s=Pw(t.borderColor),l=Yw(t.borderWidth),c=Gw(t.borderDash);if(a||s||void 0!==l||void 0!==c){const e=[];if(a&&e.push(hw("a:solidFill",void 0,[fw("a:srgbClr",{val:a})])),s||void 0!==l||void 0!==c){const t={};void 0!==l&&(t.w=Math.round(l*Cw));const n=[];s&&n.push(hw("a:solidFill",void 0,[fw("a:srgbClr",{val:s})])),void 0!==c&&n.push(fw("a:prstDash",{val:c})),e.push(0===n.length?fw("a:ln",t):hw("a:ln",Object.keys(t).length>0?t:void 0,n))}i.push(hw("c:spPr",void 0,e))}r.push(hw("c:dPt",void 0,i))}return r}(i.dataPoints,i.chartType);for(const e of c)o.push(e);const u=(f=e.dataLabels,i.dataLabels,d=i.chartType,!1===f?hw("c:dLbls",void 0,[hw("c:dLbl",void 0,[fw("c:idx",{val:0}),fw("c:delete",{val:1})]),fw("c:delete",{val:1})]):f?HI(f,d):void 0);var f,d;if(u&&o.push(u),i.trendlines&&i.trendlines.length>0){if(!("pie"===i.chartType||"doughnut"===i.chartType)){const e=function(e){if(!e||0===e.length)return[];const t=[];for(const n of e){const e=JI(n);e&&t.push(e)}return t}(i.trendlines);for(const t of e)o.push(t)}}if(i.errorBars&&i.errorBars.length>0){if(!("pie"===i.chartType||"doughnut"===i.chartType)){const e=function(e){if(!e||0===e.length)return[];const t=[];for(const n of e){const e=_I(n);e&&t.push(e)}return t}(i.errorBars);for(const t of e)o.push(t)}}if(e.categories){const t=ex(e.categories,n);r?o.push(hw("c:xVal",void 0,[hw("c:numRef",void 0,[hw("c:f",void 0,lw(t))])])):o.push(hw("c:cat",void 0,[hw("c:strRef",void 0,[hw("c:f",void 0,lw(t))])]))}const h=ex(e.values,n);if(r?o.push(hw("c:yVal",void 0,[hw("c:numRef",void 0,[hw("c:f",void 0,lw(h))])])):o.push(hw("c:val",void 0,[hw("c:numRef",void 0,[hw("c:f",void 0,lw(h))])])),void 0!==i?.smooth&&o.push(fw("c:smooth",{val:i.smooth?1:0})),void 0!==i.shape3D){const e=jI(i.shape3D);e&&o.push(e)}if("string"==typeof i.bubbleSize&&i.bubbleSize.length>0){const e=ex(i.bubbleSize,n);o.push(hw("c:bubbleSize",void 0,[hw("c:numRef",void 0,[hw("c:f",void 0,lw(e))])]))}return hw("c:ser",void 0,o)}function ix(e){if(!e)return;const t=function(e){if(void 0!==e)return XI.has(e)?e:void 0}(e.symbol),n=function(e){if(void 0===e||!Number.isFinite(e))return;const t=Math.round(e);return t<KI?KI:t>ZI?ZI:t}(e.size),r=Pw(e.fill),i=Pw(e.line);if(void 0===t&&void 0===n&&!r&&!i)return;const o=[];if(void 0!==t&&o.push(fw("c:symbol",{val:t})),void 0!==n&&o.push(fw("c:size",{val:n})),r||i){const e=[];r&&e.push(hw("a:solidFill",void 0,[fw("a:srgbClr",{val:r})])),i&&e.push(hw("a:ln",void 0,[hw("a:solidFill",void 0,[fw("a:srgbClr",{val:i})])])),o.push(hw("c:spPr",void 0,e))}return hw("c:marker",void 0,o)}const ox=aI,ax=sI,sx=new Set(["none","in","out","cross"]),lx=new Set(["nextTo","low","high","none"]),cx=new Set(["ctr","l","r"]),ux=-90,fx=90,dx=new Set(["autoZero","min","max"]),hx=new Set(["hundreds","thousands","tenThousands","hundredThousands","millions","tenMillions","hundredMillions","billions","trillions"]),px=new Set(["between","midCat"]);function gx(e,t){const n=function(e){const t=Rb(e,"title");if(!t)return;const n=Rb(t,"tx");if(!n)return;const r=Rb(n,"rich");if(r){const e=[];gw(r,e);const t=e.join("").trim();return t.length>0?t:void 0}const i=Rb(n,"strRef");if(i){const e=Rb(i,"strCache");if(e)for(const t of Ub(e)){if("pt"!==t.local)continue;const e=Rb(t,"v");if(e){const t=mw(e).trim();if(t.length>0)return t}}}return}(e),r=function(e){const t=Rb(e,"title");if(!t)return;const n=Rb(t,"tx");if(!n)return;const r=Rb(n,"rich");if(!r)return;const i=Rb(r,"bodyPr");if(!i)return;const o=i.attrs.rot;if("string"!=typeof o)return;const a=o.trim();if(0===a.length)return;const s=Number.parseInt(a,10);if(!Number.isFinite(s))return;const l=Math.round(s/oI);return 0===l?void 0:l<ux?ux:l>fx?fx:l}(e),i=function(e){const t=rI(e);if(!t)return;const n=t.attrs.sz;if("string"!=typeof n)return;const r=n.trim();if(0===r.length)return;const i=Number.parseInt(r,10);if(!Number.isFinite(i))return;const o=Math.round(i/ox*2)/2;return o<1||o>ax?void 0:o}(e),o=function(e){const t=rI(e);if(!t)return;return!0===yw(t.attrs.b)||void 0}(e),a=function(e){const t=rI(e);if(!t)return;return!0===yw(t.attrs.i)||void 0}(e),s=function(e){const t=rI(e);if(!t)return;const n=Rb(t,"solidFill");if(!n)return;const r=Rb(n,"srgbClr");if(r)return Pw(r.attrs.val);const i=Rb(n,"schemeClr");return i?Hw(i):void 0}(e),l=function(e){const t=rI(e);if(!t)return;return"sngStrike"===t.attrs.strike||void 0}(e),c=function(e){const t=rI(e);if(!t)return;return"sng"===t.attrs.u||void 0}(e),u=function(e){const t=rI(e);if(!t)return;const n=Rb(t,"latin");if(!n)return;const r=n.attrs.typeface;if("string"!=typeof r)return;const i=r.trim();return 0===i.length?void 0:i}(e),f=function(e){const t=Rb(e,"title");if(!t)return;const n=Rb(t,"overlay");if(!n)return;const r=n.attrs.val;if("string"!=typeof r)return;switch(r){case"1":case"true":return!0;default:return}}(e),d=function(e){const t=Rb(e,"title");return t?Kw(t):void 0}(e),h=function(e){const t=Rb(e,"title");return t?zw(t):void 0}(e),p=function(e){const t=Rb(e,"title");return t?$w(t):void 0}(e),g=function(e){const t=Rb(e,"title");return t?jw(t):void 0}(e),m=function(e){const t=Rb(e,"title");return t?Vw(t):void 0}(e),y=function(e){const t=Rb(e,"title");return t?Nw(t):void 0}(e),v=function(e){const t=Rb(e,"title");return t?Mw(t):void 0}(e),A=function(e){const t=void 0!==Rb(e,"majorGridlines"),n=void 0!==Rb(e,"minorGridlines");if(!t&&!n)return;const r={};t&&(r.major=!0);n&&(r.minor=!0);return r}(e),b=function(e){const t={},n=Rb(e,"scaling");if(n){const e=ww(n,"min");void 0!==e&&(t.min=e);const r=ww(n,"max");void 0!==r&&(t.max=r);const i=ww(n,"logBase");void 0!==i&&(t.logBase=i)}const r=ww(e,"majorUnit");void 0!==r&&r>0&&(t.majorUnit=r);const i=ww(e,"minorUnit");void 0!==i&&i>0&&(t.minorUnit=i);return Object.keys(t).length>0?t:void 0}(e),w=function(e){const t=Rb(e,"numFmt");if(!t)return;const n=t.attrs.formatCode;if("string"!=typeof n||0===n.length)return;const r={formatCode:n},i=t.attrs.sourceLinked;void 0!==i&&!0===yw(i)&&(r.sourceLinked=!0);return r}(e),I=mx(e,"majorTickMark","out"),x=mx(e,"minorTickMark","none"),C=function(e){const t=Rb(e,"tickLblPos");if(!t)return;const n=t.attrs.val;if("string"!=typeof n)return;const r=n.trim();return lx.has(r)?"nextTo"===r?void 0:r:void 0}(e),B=function(e){const t=Rb(e,"txPr");if(!t)return;const n=Rb(t,"bodyPr");if(!n)return;const r=n.attrs.rot;if("string"!=typeof r)return;const i=r.trim();if(0===i.length)return;const o=Number.parseInt(i,10);if(!Number.isFinite(o))return;const a=Math.round(o/oI);return 0===a?void 0:a<ux?ux:a>fx?fx:a}(e),E=function(e){const t=nI(e);if(!t)return;const n=t.attrs.sz;if("string"!=typeof n)return;const r=n.trim();if(0===r.length)return;const i=Number.parseInt(r,10);if(!Number.isFinite(i))return;const o=Math.round(i/ox*2)/2;return o<1||o>ax?void 0:o}(e),k=function(e){const t=nI(e);if(!t)return;return!0===yw(t.attrs.b)||void 0}(e),S=function(e){const t=nI(e);if(!t)return;return!0===yw(t.attrs.i)||void 0}(e),F=function(e){const t=nI(e);if(!t)return;const n=Rb(t,"solidFill");if(!n)return;const r=Rb(n,"srgbClr");if(r)return Pw(r.attrs.val);const i=Rb(n,"schemeClr");return i?Hw(i):void 0}(e),D=function(e){const t=nI(e);if(!t)return;return"sng"===t.attrs.u||void 0}(e),N=function(e){const t=nI(e);if(!t)return;return"sngStrike"===t.attrs.strike||void 0}(e),M=function(e){const t=nI(e);if(!t)return;const n=Rb(t,"latin");if(!n)return;const r=n.attrs.typeface;if("string"!=typeof r)return;const i=r.trim();return 0===i.length?void 0:i}(e),Q=function(e){const t=Rb(e,"scaling");if(!t)return;const n=Rb(t,"orientation");if(!n)return;const r=n.attrs.val;if("string"!=typeof r)return;return"maxMin"===r.trim()||void 0}(e),T="catAx"===e.local||"dateAx"===e.local,L=T?yx(e,"tickLblSkip"):void 0,R=T?yx(e,"tickMarkSkip"):void 0,U=T?function(e){const t=Rb(e,"lblOffset");if(!t)return;const n=t.attrs.val;if("string"!=typeof n)return;const r=n.trim();if(0===r.length)return;const i=Number.parseInt(r,10);return Number.isFinite(i)?i<0||i>1e3||100===i?void 0:i:void 0}(e):void 0,H=T?function(e){const t=Rb(e,"lblAlgn");if(!t)return;const n=t.attrs.val;if("string"!=typeof n)return;const r=n.trim();return cx.has(r)?"ctr"===r?void 0:r:void 0}(e):void 0,q="catAx"===e.local?function(e){const t=Rb(e,"noMultiLvlLbl");if(!t)return;const n=t.attrs.val;if("string"!=typeof n)return;switch(n.trim()){case"1":case"true":return!0;default:return}}(e):void 0,O="catAx"===e.local?function(e){const t=Rb(e,"auto");if(!t)return;const n=t.attrs.val;if("string"!=typeof n)return;switch(n.trim()){case"0":case"false":return!1;default:return}}(e):void 0,P=function(e){const t=Rb(e,"delete");if(!t)return;const n=t.attrs.val;if("string"!=typeof n)return;switch(n.trim()){case"1":case"true":return!0;default:return}}(e),z=function(e){const t=Rb(e,"crossesAt");if(t){const e=t.attrs.val;if("string"==typeof e){const t=e.trim();if(t.length>0){const e=Number.parseFloat(t);if(Number.isFinite(e))return{crossesAt:e}}}}const n=Rb(e,"crosses");if(!n)return{};const r=n.attrs.val;if("string"!=typeof r)return{};const i=r.trim();return dx.has(i)?"autoZero"===i?{}:{crosses:i}:{}}(e),$=z.crosses,j=z.crossesAt,V="valAx"===e.local?function(e){const t=Rb(e,"dispUnits");if(!t)return;const n={},r=Rb(t,"custUnit");if(r){const e=r.attrs.val;if("string"==typeof e){const t=Number.parseFloat(e.trim());Number.isFinite(t)&&t>0&&(n.custUnit=t)}}if(void 0===n.custUnit){const e=Rb(t,"builtInUnit");if(e){const t=e.attrs.val;if("string"==typeof t){const e=t.trim();hx.has(e)&&(n.unit=e)}}}if(void 0===n.unit&&void 0===n.custUnit)return;const i=Rb(t,"dispUnitsLbl");if(i){n.showLabel=!0;const e=Rb(i,"tx");if(e){const t=Rb(e,"rich");if(t){const e=[];for(const n of t.children){if("string"==typeof n)continue;if("p"!==n.local)continue;const t=[];for(const e of n.children)if("string"!=typeof e&&"r"===e.local)for(const n of e.children){if("string"==typeof n)continue;if("t"!==n.local)continue;let e="";for(const t of n.children)"string"==typeof t&&(e+=t);t.push(e)}t.length>0&&e.push(t.join(""))}const r=e.join("\n").trim();r.length>0&&(n.customLabel=r)}}}return n}(e):void 0,Y="valAx"===e.local?function(e){const t=Rb(e,"crossBetween");if(!t)return;const n=t.attrs.val;if("string"!=typeof n)return;const r=n.trim();return px.has(r)?r:void 0}(e):void 0,G=Y===t?void 0:Y;if(void 0===n&&void 0===r&&void 0===i&&void 0===o&&void 0===a&&void 0===s&&void 0===l&&void 0===c&&void 0===u&&void 0===f&&void 0===d&&void 0===h&&void 0===p&&void 0===g&&void 0===m&&void 0===y&&void 0===v&&void 0===A&&void 0===b&&void 0===w&&void 0===I&&void 0===x&&void 0===C&&void 0===B&&void 0===E&&void 0===k&&void 0===S&&void 0===F&&void 0===M&&void 0===D&&void 0===N&&void 0===Q&&void 0===L&&void 0===R&&void 0===U&&void 0===H&&void 0===q&&void 0===O&&void 0===P&&void 0===$&&void 0===j&&void 0===V&&void 0===G)return;const W={};return void 0!==n&&(W.title=n),void 0!==r&&(W.axisTitleRotation=r),void 0!==i&&(W.axisTitleFontSize=i),void 0!==o&&(W.axisTitleBold=o),void 0!==a&&(W.axisTitleItalic=a),void 0!==s&&(W.axisTitleColor=s),void 0!==l&&(W.axisTitleStrike=l),void 0!==c&&(W.axisTitleUnderline=c),void 0!==u&&(W.axisTitleFontFamily=u),void 0!==f&&(W.axisTitleOverlay=f),void 0!==d&&(W.axisTitleLayout=d),void 0!==h&&(W.axisTitleFillColor=h),void 0!==p&&(W.axisTitleBorderColor=p),void 0!==g&&(W.axisTitleBorderWidth=g),void 0!==m&&(W.axisTitleBorderDash=m),void 0!==y&&(W.axisTitleBorderCap=y),void 0!==v&&(W.axisTitleBorderCompound=v),void 0!==A&&(W.gridlines=A),void 0!==b&&(W.scale=b),void 0!==w&&(W.numberFormat=w),void 0!==I&&(W.majorTickMark=I),void 0!==x&&(W.minorTickMark=x),void 0!==C&&(W.tickLblPos=C),void 0!==B&&(W.labelRotation=B),void 0!==E&&(W.labelFontSize=E),void 0!==k&&(W.labelBold=k),void 0!==S&&(W.labelItalic=S),void 0!==F&&(W.labelColor=F),void 0!==M&&(W.labelFontFamily=M),void 0!==D&&(W.labelUnderline=D),void 0!==N&&(W.labelStrike=N),void 0!==Q&&(W.reverse=Q),void 0!==L&&(W.tickLblSkip=L),void 0!==R&&(W.tickMarkSkip=R),void 0!==U&&(W.lblOffset=U),void 0!==H&&(W.lblAlgn=H),void 0!==q&&(W.noMultiLvlLbl=q),void 0!==O&&(W.auto=O),void 0!==P&&(W.hidden=P),void 0!==$&&(W.crosses=$),void 0!==j&&(W.crossesAt=j),void 0!==V&&(W.dispUnits=V),void 0!==G&&(W.crossBetween=G),W}function mx(e,t,n){const r=Rb(e,t);if(!r)return;const i=r.attrs.val;if("string"!=typeof i)return;const o=i.trim();return sx.has(o)?o===n?void 0:o:void 0}function yx(e,t){const n=Rb(e,t);if(!n)return;const r=n.attrs.val;if("string"!=typeof r)return;const i=r.trim();if(0===i.length)return;const o=Number.parseInt(i,10);return Number.isFinite(o)&&!(o<1||o>32767)&&1!==o?o:void 0}const vx=new Set(["autoZero","min","max"]),Ax=111111111,bx=222222222,wx=333333333,Ix=444444444,xx=new Set(["none","in","out","cross"]),Cx=new Set(["nextTo","low","high","none"]);function Bx(e){if(!0===e.autoTitleDeleted)return!0;if(!1===e.autoTitleDeleted)return!1;return!((e.showTitle??Boolean(e.title))&&e.title)}function Ex(e){if("string"!=typeof e)return;const t=e.trim();return t.length>0?t:void 0}function kx(e){if(!e)return;const t=!0===e.major,n=!0===e.minor;return t||n?{major:t,minor:n}:void 0}function Sx(e){if(!e)return[];const t=[];return e.major&&t.push(hw("c:majorGridlines",void 0,[])),e.minor&&t.push(hw("c:minorGridlines",void 0,[])),t}function Fx(e){if(!e)return;const t={};return"number"==typeof e.min&&Number.isFinite(e.min)&&(t.min=e.min),"number"==typeof e.max&&Number.isFinite(e.max)&&(t.max=e.max),void 0!==t.min&&void 0!==t.max&&t.min>=t.max&&delete t.max,"number"==typeof e.majorUnit&&Number.isFinite(e.majorUnit)&&e.majorUnit>0&&(t.majorUnit=e.majorUnit),"number"==typeof e.minorUnit&&Number.isFinite(e.minorUnit)&&e.minorUnit>0&&(t.minorUnit=e.minorUnit),"number"==typeof e.logBase&&Number.isFinite(e.logBase)&&e.logBase>=2&&e.logBase<=1e3&&(t.logBase=e.logBase),Object.keys(t).length>0?t:void 0}function Dx(e){if(!e)return;const t="string"==typeof e.formatCode?e.formatCode:"";if(0===t.length)return;const n={formatCode:t};return!0===e.sourceLinked&&(n.sourceLinked=!0),n}function Nx(e){if(void 0===e||!Number.isFinite(e))return;const t=Math.round(e);return t<1||t>32767||1===t?void 0:t}function Mx(e){if(void 0===e||!Number.isFinite(e))return;const t=Math.round(e);return t<0||t>1e3||100===t?void 0:t}function Qx(e){if(void 0!==e&&("ctr"===e||"l"===e||"r"===e)&&"ctr"!==e)return e}function Tx(e){return!0===e}function Lx(e){if(void 0===e||"number"!=typeof e||!Number.isFinite(e))return;let t=Math.round(e);return t<ux?t=ux:t>fx&&(t=fx),0!==t?t:void 0}function Rx(e){if(void 0===e||"number"!=typeof e||!Number.isFinite(e))return;const t=Math.round(2*e)/2;return t<1||t>ax?void 0:t}function Ux(e){return hI(e)}function Hx(e){return pI(e)}function qx(e){return gI(e)}function Ox(e){return yI(e)}function Px(e){return mI(e)}function zx(e){if("string"!=typeof e)return;const t=e.trim();return 0!==t.length?t:void 0}function $x(e,t,n,r,i,o,a,s){if(void 0===e&&void 0===t&&void 0===n&&void 0===r&&void 0===i&&void 0===o&&void 0===a&&void 0===s)return;const l=void 0===e?void 0:e*oI,c=void 0===t?void 0:t*ox,u=void 0===n?void 0:n?1:0,f=void 0===r?void 0:r?1:0,d=!0===o?"sng":void 0,h=!0===a?"sngStrike":void 0,p=void 0!==i?hw("a:solidFill",void 0,[Ow(i)]):void 0,g=s?fw("a:latin",{typeface:s}):void 0,m=[];p&&m.push(p),g&&m.push(g);const y=m.length>0?hw("a:defRPr",{sz:c,b:u,i:f,u:d,strike:h},m):fw("a:defRPr",{sz:c,b:u,i:f,u:d,strike:h});return hw("c:txPr",void 0,[fw("a:bodyPr",{rot:l}),fw("a:lstStyle"),hw("a:p",void 0,[hw("a:pPr",void 0,[y]),fw("a:endParaRPr",{lang:"en-US"})])])}function jx(e,t){return"number"==typeof t&&Number.isFinite(t)?{kind:"numeric",value:t}:void 0!==e&&vx.has(e)&&"autoZero"!==e?{kind:"semantic",value:e}:{kind:"default"}}function Vx(e){switch(e.kind){case"numeric":return fw("c:crossesAt",{val:e.value});case"semantic":return fw("c:crosses",{val:e.value});case"default":return fw("c:crosses",{val:"autoZero"})}}function Yx(e,t=!1){const{before:n,after:r}=function(e){if(!e)return{before:[],after:[]};const t=[],n=[];return void 0!==e.logBase&&t.push(fw("c:logBase",{val:e.logBase})),void 0!==e.max&&n.push(fw("c:max",{val:e.max})),void 0!==e.min&&n.push(fw("c:min",{val:e.min})),{before:t,after:n}}(e);return hw("c:scaling",void 0,[...n,fw("c:orientation",{val:t?"maxMin":"minMax"}),...r])}function Gx(e){if(!e)return[];const t=[];return void 0!==e.majorUnit&&t.push(fw("c:majorUnit",{val:e.majorUnit})),void 0!==e.minorUnit&&t.push(fw("c:minorUnit",{val:e.minorUnit})),t}function Wx(e){if(void 0===e)return;if("string"==typeof e)return hx.has(e)?{unit:e}:void 0;if("object"!=typeof e||null===e)return;const t={},n=e.unit;"string"==typeof n&&hx.has(n)&&(t.unit=n);const r=e.custUnit;if("number"==typeof r&&Number.isFinite(r)&&r>0&&(t.custUnit=r),void 0!==t.unit||void 0!==t.custUnit){if(!0===e.showLabel&&(t.showLabel=!0),"string"==typeof e.customLabel){const n=e.customLabel.trim();n.length>0&&(t.customLabel=n)}return t}}function Jx(e){if(!e)return[];const t=[];if(void 0!==e.custUnit)t.push(fw("c:custUnit",{val:e.custUnit}));else{if(void 0===e.unit)return[];t.push(fw("c:builtInUnit",{val:e.unit}))}if(!0===e.showLabel||"string"==typeof e.customLabel&&e.customLabel.trim().length>0){const n="string"==typeof e.customLabel?e.customLabel.trim():"";if(n.length>0){const e=n.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;"),r=hw("c:rich",void 0,[fw("a:bodyPr"),fw("a:lstStyle"),hw("a:p",void 0,[hw("a:r",void 0,[hw("a:t",void 0,e)])])]),i=hw("c:tx",void 0,[r]);t.push(hw("c:dispUnitsLbl",void 0,[i]))}else t.push(fw("c:dispUnitsLbl"))}return[hw("c:dispUnits",void 0,t)]}function _x(e){if("string"==typeof e)return px.has(e)?e:void 0}function Xx(e){if(!e)return[];const t=!0===e.sourceLinked?1:0;return[fw("c:numFmt",{formatCode:e.formatCode,sourceLinked:t})]}function Kx(e){if(void 0!==e)return xx.has(e)?e:void 0}function Zx(e){if(void 0!==e)return Cx.has(e)?e:void 0}function eC(e,t,n){const r=[];return void 0!==e&&r.push(fw("c:majorTickMark",{val:e})),void 0!==t&&r.push(fw("c:minorTickMark",{val:t})),void 0!==n&&r.push(fw("c:tickLblPos",{val:n})),r}function tC(e,t){const n="column"===e?"b":"l",r="column"===e?"l":"b",i=[fw("c:axId",{val:Ax}),Yx(t.xScale,t.xReverse),fw("c:delete",{val:t.xHidden?1:0}),fw("c:axPos",{val:n}),...Sx(t.xGridlines)];t.xAxisTitle&&i.push(nC(t.xAxisTitle,t.xAxisTitleRotation,t.xAxisTitleFontSize,t.xAxisTitleBold,t.xAxisTitleItalic,t.xAxisTitleColor,t.xAxisTitleStrike,t.xAxisTitleUnderline,t.xAxisTitleFontFamily,t.xAxisTitleOverlay,t.xAxisTitleLayout,t.xAxisTitleFillColor,t.xAxisTitleBorderColor,t.xAxisTitleBorderWidth,t.xAxisTitleBorderDash,t.xAxisTitleBorderCap,t.xAxisTitleBorderCompound)),i.push(...Xx(t.xNumFmt),...eC(t.xMajorTickMark,t.xMinorTickMark,t.xTickLblPos));const o=$x(t.xLabelRotation,t.xLabelFontSize,t.xLabelBold,t.xLabelItalic,t.xLabelColor,t.xLabelUnderline,t.xLabelStrike,t.xLabelFontFamily);o&&i.push(o),i.push(fw("c:crossAx",{val:bx}),Vx(t.xCrosses),fw("c:auto",{val:t.xAuto?1:0}),fw("c:lblAlgn",{val:t.xLblAlgn??"ctr"}),fw("c:lblOffset",{val:t.xLblOffset??100}),...function(e,t){const n=[];return void 0!==e&&n.push(fw("c:tickLblSkip",{val:e})),void 0!==t&&n.push(fw("c:tickMarkSkip",{val:t})),n}(t.xTickLblSkip,t.xTickMarkSkip),fw("c:noMultiLvlLbl",{val:t.xNoMultiLvlLbl?1:0}));const a=[fw("c:axId",{val:bx}),Yx(t.yScale,t.yReverse),fw("c:delete",{val:t.yHidden?1:0}),fw("c:axPos",{val:r}),...Sx(t.yGridlines)];t.yAxisTitle&&a.push(nC(t.yAxisTitle,t.yAxisTitleRotation,t.yAxisTitleFontSize,t.yAxisTitleBold,t.yAxisTitleItalic,t.yAxisTitleColor,t.yAxisTitleStrike,t.yAxisTitleUnderline,t.yAxisTitleFontFamily,t.yAxisTitleOverlay,t.yAxisTitleLayout,t.yAxisTitleFillColor,t.yAxisTitleBorderColor,t.yAxisTitleBorderWidth,t.yAxisTitleBorderDash,t.yAxisTitleBorderCap,t.yAxisTitleBorderCompound)),a.push(...Xx(t.yNumFmt),...eC(t.yMajorTickMark,t.yMinorTickMark,t.yTickLblPos));const s=$x(t.yLabelRotation,t.yLabelFontSize,t.yLabelBold,t.yLabelItalic,t.yLabelColor,t.yLabelUnderline,t.yLabelStrike,t.yLabelFontFamily);return s&&a.push(s),a.push(fw("c:crossAx",{val:Ax}),Vx(t.yCrosses),fw("c:crossBetween",{val:t.yCrossBetween??"between"}),...Gx(t.yScale),...Jx(t.yDispUnits)),[hw("c:catAx",void 0,i),hw("c:valAx",void 0,a)]}function nC(e,t,n,r,i,o,a,s,l,c,u,f,d,h,p,g,m){const y=void 0===t?0:6e4*t,v=void 0===n?1e3:n*ox,A=r?1:0,b=!0===i?1:void 0,w=!0===a?"sngStrike":void 0,I=!0===s?"sng":void 0,x=void 0!==o?hw("a:solidFill",void 0,[Ow(o)]):void 0,C=l?fw("a:latin",{typeface:l}):void 0,B=[];x&&B.push(x),C&&B.push(C);const E=B.length>0?hw("a:defRPr",{sz:v,b:A,i:b,u:I,strike:w},B):fw("a:defRPr",{sz:v,b:A,i:b,u:I,strike:w}),k=B.length>0?hw("a:rPr",{lang:"en-US",sz:v,b:A,i:b,u:I,strike:w},B):fw("a:rPr",{lang:"en-US",sz:v,b:A,i:b,u:I,strike:w}),S=tI(u),F=[hw("c:tx",void 0,[hw("c:rich",void 0,[hw("a:bodyPr",{rot:y,spcFirstLastPara:1,vertOverflow:"ellipsis",wrap:"square",anchor:"ctr",anchorCtr:1},[]),fw("a:lstStyle"),hw("a:p",void 0,[hw("a:pPr",void 0,[E]),hw("a:r",void 0,[k,hw("a:t",void 0,lw(e))])])])])];S&&F.push(S),F.push(fw("c:overlay",{val:c?1:0}));const D=uI(f,d,h,p,g,m);return void 0!==D&&F.push(D),hw("c:title",void 0,F)}function rC(e){return fI(e)}function iC(e){return dI(e)}function oC(e){return hI(e)}function aC(e){return pI(e)}function sC(e){return gI(e)}function lC(e){return mI(e)}function cC(e){return yI(e)}function uC(e){if("string"!=typeof e)return;const t=e.trim();return 0!==t.length?t:void 0}const fC=new Set(["pie","pie3D","doughnut","ofPie"]),dC=new Set(["none","line","lineMarker","marker","smooth","smoothMarker"]),hC=new Set(["pie","doughnut"]),pC=new Set(["none","line","lineMarker","marker","smooth","smoothMarker"]);function gC(e,t){const n=Rb(e,"varyColors");if(!n)return;const r=n.attrs.val;if("string"!=typeof r)return;const i=fC.has(t);let o;switch(r){case"1":case"true":o=!0;break;case"0":case"false":o=!1;break;default:return}return o!==i?o:void 0}function mC(e){const t=Rb(e,"scatterStyle");if(!t)return;const n=t.attrs.val;return"string"==typeof n&&dC.has(n)?n:void 0}function yC(e){return!!Rb(e,"dropLines")||void 0}function vC(e){return!!Rb(e,"hiLowLines")||void 0}function AC(e){return!!Rb(e,"serLines")||void 0}function bC(e){const t=Rb(e,"marker");if(!t)return;const n=t.attrs.val;if("string"==typeof n)switch(n){case"0":case"false":return!1;default:return}}function wC(e){const t=Rb(e,"grouping");if(!t)return;const n=t.attrs.val;if("string"==typeof n)switch(n){case"stacked":return"stacked";case"percentStacked":return"percentStacked";case"clustered":return"clustered";default:return}}function IC(e){const t=Rb(e,"holeSize");if(!t)return;const n=t.attrs.val;if("string"!=typeof n)return;const r=Number.parseInt(n,10);return Number.isFinite(r)&&!(r<1||r>99)?r:void 0}function xC(e){const t=Rb(e,"gapWidth");if(!t)return;const n=t.attrs.val;if("string"!=typeof n)return;const r=Number.parseInt(n,10);return Number.isFinite(r)&&!(r<0||r>500)&&150!==r?r:void 0}function CC(e){const t=Rb(e,"gapWidth");if(!t)return;const n=t.attrs.val;if("string"!=typeof n)return;const r=Number.parseInt(n,10);return Number.isFinite(r)&&!(r<0||r>500)&&150!==r?r:void 0}function BC(e){const t=Rb(e,"overlap");if(!t)return;const n=t.attrs.val;if("string"!=typeof n)return;const r=Number.parseInt(n,10);return Number.isFinite(r)&&!(r<-100||r>100)&&0!==r?r:void 0}function EC(e){const t=Rb(e,"firstSliceAng");if(!t)return;const n=t.attrs.val;if("string"!=typeof n)return;const r=Number.parseInt(n,10);return Number.isFinite(r)&&!(r<0||r>360)&&0!==r&&360!==r?r:void 0}function kC(e){const t=Rb(e,"grouping");if(!t)return;const n=t.attrs.val;if("string"==typeof n)switch(n){case"stacked":return"stacked";case"percentStacked":return"percentStacked";default:return}}function SC(e,t){const n=tI(function(e){return Zw(e.plotAreaLayout)}(e)),r=[n??fw("c:layout")],i={xAxisTitle:Ex(e.axes?.x?.title),yAxisTitle:Ex(e.axes?.y?.title),xAxisTitleRotation:rC(e.axes?.x?.axisTitleRotation),yAxisTitleRotation:rC(e.axes?.y?.axisTitleRotation),xAxisTitleFontSize:iC(e.axes?.x?.axisTitleFontSize),yAxisTitleFontSize:iC(e.axes?.y?.axisTitleFontSize),xAxisTitleBold:oC(e.axes?.x?.axisTitleBold),yAxisTitleBold:oC(e.axes?.y?.axisTitleBold),xAxisTitleItalic:aC(e.axes?.x?.axisTitleItalic),yAxisTitleItalic:aC(e.axes?.y?.axisTitleItalic),xAxisTitleColor:sC(e.axes?.x?.axisTitleColor),yAxisTitleColor:sC(e.axes?.y?.axisTitleColor),xAxisTitleStrike:lC(e.axes?.x?.axisTitleStrike),yAxisTitleStrike:lC(e.axes?.y?.axisTitleStrike),xAxisTitleUnderline:cC(e.axes?.x?.axisTitleUnderline),yAxisTitleUnderline:cC(e.axes?.y?.axisTitleUnderline),xAxisTitleFontFamily:uC(e.axes?.x?.axisTitleFontFamily),yAxisTitleFontFamily:uC(e.axes?.y?.axisTitleFontFamily),xAxisTitleOverlay:!0===e.axes?.x?.axisTitleOverlay,yAxisTitleOverlay:!0===e.axes?.y?.axisTitleOverlay,xAxisTitleLayout:Zw(e.axes?.x?.axisTitleLayout),yAxisTitleLayout:Zw(e.axes?.y?.axisTitleLayout),xAxisTitleFillColor:gI(e.axes?.x?.axisTitleFillColor),yAxisTitleFillColor:gI(e.axes?.y?.axisTitleFillColor),xAxisTitleBorderColor:gI(e.axes?.x?.axisTitleBorderColor),yAxisTitleBorderColor:gI(e.axes?.y?.axisTitleBorderColor),xAxisTitleBorderWidth:Yw(e.axes?.x?.axisTitleBorderWidth),yAxisTitleBorderWidth:Yw(e.axes?.y?.axisTitleBorderWidth),xAxisTitleBorderDash:Gw(e.axes?.x?.axisTitleBorderDash),yAxisTitleBorderDash:Gw(e.axes?.y?.axisTitleBorderDash),xAxisTitleBorderCap:Fw(e.axes?.x?.axisTitleBorderCap),yAxisTitleBorderCap:Fw(e.axes?.y?.axisTitleBorderCap),xAxisTitleBorderCompound:Dw(e.axes?.x?.axisTitleBorderCompound),yAxisTitleBorderCompound:Dw(e.axes?.y?.axisTitleBorderCompound),xGridlines:kx(e.axes?.x?.gridlines),yGridlines:kx(e.axes?.y?.gridlines),xScale:Fx(e.axes?.x?.scale),yScale:Fx(e.axes?.y?.scale),xNumFmt:Dx(e.axes?.x?.numberFormat),yNumFmt:Dx(e.axes?.y?.numberFormat),xMajorTickMark:Kx(e.axes?.x?.majorTickMark),yMajorTickMark:Kx(e.axes?.y?.majorTickMark),xMinorTickMark:Kx(e.axes?.x?.minorTickMark),yMinorTickMark:Kx(e.axes?.y?.minorTickMark),xTickLblPos:Zx(e.axes?.x?.tickLblPos),yTickLblPos:Zx(e.axes?.y?.tickLblPos),xLabelRotation:Lx(e.axes?.x?.labelRotation),yLabelRotation:Lx(e.axes?.y?.labelRotation),xLabelFontSize:Rx(e.axes?.x?.labelFontSize),yLabelFontSize:Rx(e.axes?.y?.labelFontSize),xLabelBold:Ux(e.axes?.x?.labelBold),yLabelBold:Ux(e.axes?.y?.labelBold),xLabelItalic:Hx(e.axes?.x?.labelItalic),yLabelItalic:Hx(e.axes?.y?.labelItalic),xLabelColor:qx(e.axes?.x?.labelColor),yLabelColor:qx(e.axes?.y?.labelColor),xLabelUnderline:Ox(e.axes?.x?.labelUnderline),yLabelUnderline:Ox(e.axes?.y?.labelUnderline),xLabelStrike:Px(e.axes?.x?.labelStrike),yLabelStrike:Px(e.axes?.y?.labelStrike),xLabelFontFamily:zx(e.axes?.x?.labelFontFamily),yLabelFontFamily:zx(e.axes?.y?.labelFontFamily),xReverse:!0===e.axes?.x?.reverse,yReverse:!0===e.axes?.y?.reverse,xTickLblSkip:Nx(e.axes?.x?.tickLblSkip),xTickMarkSkip:Nx(e.axes?.x?.tickMarkSkip),xLblOffset:Mx(e.axes?.x?.lblOffset),xLblAlgn:Qx(e.axes?.x?.lblAlgn),xNoMultiLvlLbl:!0===e.axes?.x?.noMultiLvlLbl,xAuto:!1!==e.axes?.x?.auto,xHidden:Tx(e.axes?.x?.hidden),yHidden:Tx(e.axes?.y?.hidden),xCrosses:jx(e.axes?.x?.crosses,e.axes?.x?.crossesAt),yCrosses:jx(e.axes?.y?.crosses,e.axes?.y?.crossesAt),xDispUnits:Wx(e.axes?.x?.dispUnits),yDispUnits:Wx(e.axes?.y?.dispUnits),xCrossBetween:_x(e.axes?.x?.crossBetween),yCrossBetween:_x(e.axes?.y?.crossBetween)};switch(e.type){case"bar":case"column":r.push(function(e,t){const n=e.barGrouping??"clustered",r="bar"===e.type?"bar":"col",i="percentStacked"===n||"stacked"===n,o=[fw("c:barDir",{val:r}),fw("c:grouping",{val:n}),fw("c:varyColors",{val:NC(e)?1:0})];for(let n=0;n<e.series.length;n++)o.push(rx(e.series[n],n,t,!1,{chartType:e.type,dataLabels:e.dataLabels,invertIfNegative:!0===e.series[n].invertIfNegative,dataPoints:e.series[n].dataPoints,trendlines:e.series[n].trendlines,errorBars:e.series[n].errorBars}));const a=UI(e);a&&o.push(a);const s=function(e){if(void 0===e||!Number.isFinite(e))return;const t=Math.round(e);return t<0?0:t>500?500:t}(e.gapWidth),l=function(e){if(void 0===e||!Number.isFinite(e))return;const t=Math.round(e);return t<-100?-100:t>100?100:t}(e.overlap),c=s??(i?void 0:150);void 0!==c&&o.push(fw("c:gapWidth",{val:c}));const u=l??(i?100:void 0);void 0!==u&&o.push(fw("c:overlap",{val:u}));!0===e.serLines&&o.push(hw("c:serLines",void 0,[]));return o.push(fw("c:axId",{val:Ax})),o.push(fw("c:axId",{val:bx})),hw("c:barChart",void 0,o)}(e,t)),r.push(...tC(e.type,i));break;case"line":r.push(function(e,t){const n=e.lineGrouping??"standard",r=[fw("c:grouping",{val:n}),fw("c:varyColors",{val:NC(e)?1:0})];for(let n=0;n<e.series.length;n++){const i=rx(e.series[n],n,t,!1,{chartType:e.type,smooth:!0===e.series[n].smooth,dataLabels:e.dataLabels,stroke:e.series[n].stroke,marker:e.series[n].marker,dataPoints:e.series[n].dataPoints,trendlines:e.series[n].trendlines,errorBars:e.series[n].errorBars});r.push(i)}const i=UI(e);i&&r.push(i);!0===e.dropLines&&r.push(hw("c:dropLines",void 0,[]));!0===e.hiLowLines&&r.push(hw("c:hiLowLines",void 0,[]));!0===e.upDownBars&&r.push(function(e){const t=function(e){if(void 0===e||!Number.isFinite(e))return;const t=Math.round(e);return t<0||t>500?void 0:t}(e)??150;return hw("c:upDownBars",void 0,[fw("c:gapWidth",{val:t})])}(e.upDownBarsGapWidth));return r.push(fw("c:marker",{val:!1===e.showLineMarkers?0:1})),r.push(fw("c:axId",{val:Ax})),r.push(fw("c:axId",{val:bx})),hw("c:lineChart",void 0,r)}(e,t)),r.push(...tC("column",i));break;case"area":r.push(function(e,t){const n=e.areaGrouping??"standard",r=[fw("c:grouping",{val:n}),fw("c:varyColors",{val:NC(e)?1:0})];for(let n=0;n<e.series.length;n++)r.push(rx(e.series[n],n,t,!1,{chartType:e.type,dataLabels:e.dataLabels,dataPoints:e.series[n].dataPoints,trendlines:e.series[n].trendlines,errorBars:e.series[n].errorBars}));const i=UI(e);i&&r.push(i);!0===e.dropLines&&r.push(hw("c:dropLines",void 0,[]));return r.push(fw("c:axId",{val:Ax})),r.push(fw("c:axId",{val:bx})),hw("c:areaChart",void 0,r)}(e,t)),r.push(...tC("column",i));break;case"pie":r.push(function(e,t){const n=[fw("c:varyColors",{val:NC(e)?1:0})];e.series.length>0&&n.push(rx(e.series[0],0,t,!1,{chartType:e.type,dataLabels:e.dataLabels,explosion:e.series[0].explosion,dataPoints:e.series[0].dataPoints}));const r=UI(e);r&&n.push(r);const i=FC(e.firstSliceAng);void 0!==i&&n.push(fw("c:firstSliceAng",{val:i}));return hw("c:pieChart",void 0,n)}(e,t));break;case"doughnut":r.push(function(e,t){const n=[fw("c:varyColors",{val:NC(e)?1:0})];for(let r=0;r<e.series.length;r++)n.push(rx(e.series[r],r,t,!1,{chartType:e.type,dataLabels:e.dataLabels,explosion:e.series[r].explosion,dataPoints:e.series[r].dataPoints}));const r=UI(e);r&&n.push(r);return n.push(fw("c:firstSliceAng",{val:FC(e.firstSliceAng)??0})),n.push(fw("c:holeSize",{val:DC(e.holeSize)})),hw("c:doughnutChart",void 0,n)}(e,t));break;case"scatter":r.push(function(e,t){const n=[fw("c:scatterStyle",{val:MC(e)}),fw("c:varyColors",{val:NC(e)?1:0})];for(let r=0;r<e.series.length;r++)n.push(rx(e.series[r],r,t,!0,{chartType:e.type,smooth:!0===e.series[r].smooth||void 0,dataLabels:e.dataLabels,stroke:e.series[r].stroke,marker:e.series[r].marker,dataPoints:e.series[r].dataPoints,trendlines:e.series[r].trendlines,errorBars:e.series[r].errorBars}));const r=UI(e);r&&n.push(r);return n.push(fw("c:axId",{val:wx})),n.push(fw("c:axId",{val:Ix})),hw("c:scatterChart",void 0,n)}(e,t)),r.push(...function(e){const t=[fw("c:axId",{val:wx}),Yx(e.xScale,e.xReverse),fw("c:delete",{val:e.xHidden?1:0}),fw("c:axPos",{val:"b"}),...Sx(e.xGridlines)];e.xAxisTitle&&t.push(nC(e.xAxisTitle,e.xAxisTitleRotation,e.xAxisTitleFontSize,e.xAxisTitleBold,e.xAxisTitleItalic,e.xAxisTitleColor,e.xAxisTitleStrike,e.xAxisTitleUnderline,e.xAxisTitleFontFamily,e.xAxisTitleOverlay,e.xAxisTitleLayout,e.xAxisTitleFillColor,e.xAxisTitleBorderColor,e.xAxisTitleBorderWidth,e.xAxisTitleBorderDash,e.xAxisTitleBorderCap,e.xAxisTitleBorderCompound)),t.push(...Xx(e.xNumFmt),...eC(e.xMajorTickMark,e.xMinorTickMark,e.xTickLblPos));const n=$x(e.xLabelRotation,e.xLabelFontSize,e.xLabelBold,e.xLabelItalic,e.xLabelColor,e.xLabelUnderline,e.xLabelStrike,e.xLabelFontFamily);n&&t.push(n),t.push(fw("c:crossAx",{val:Ix}),Vx(e.xCrosses),fw("c:crossBetween",{val:e.xCrossBetween??"midCat"}),...Gx(e.xScale),...Jx(e.xDispUnits));const r=[fw("c:axId",{val:Ix}),Yx(e.yScale,e.yReverse),fw("c:delete",{val:e.yHidden?1:0}),fw("c:axPos",{val:"l"}),...Sx(e.yGridlines)];e.yAxisTitle&&r.push(nC(e.yAxisTitle,e.yAxisTitleRotation,e.yAxisTitleFontSize,e.yAxisTitleBold,e.yAxisTitleItalic,e.yAxisTitleColor,e.yAxisTitleStrike,e.yAxisTitleUnderline,e.yAxisTitleFontFamily,e.yAxisTitleOverlay,e.yAxisTitleLayout,e.yAxisTitleFillColor,e.yAxisTitleBorderColor,e.yAxisTitleBorderWidth,e.yAxisTitleBorderDash,e.yAxisTitleBorderCap,e.yAxisTitleBorderCompound)),r.push(...Xx(e.yNumFmt),...eC(e.yMajorTickMark,e.yMinorTickMark,e.yTickLblPos));const i=$x(e.yLabelRotation,e.yLabelFontSize,e.yLabelBold,e.yLabelItalic,e.yLabelColor,e.yLabelUnderline,e.yLabelStrike,e.yLabelFontFamily);return i&&r.push(i),r.push(fw("c:crossAx",{val:wx}),Vx(e.yCrosses),fw("c:crossBetween",{val:e.yCrossBetween??"midCat"}),...Gx(e.yScale),...Jx(e.yDispUnits)),[hw("c:valAx",void 0,t),hw("c:valAx",void 0,r)]}(i));break;default:{const t=e.type;throw new Error(`Unsupported chart type: ${String(t)}`)}}const o=function(e){if("pie"===e.type||"doughnut"===e.type)return;const t=e.dataTable;var n;return void 0!==t&&!1!==t?!0===t?{showHorzBorder:!0,showVertBorder:!0,showOutline:!0,showKeys:!0,fontSize:void 0,fontColor:void 0,bold:void 0,italic:void 0,underline:void 0,strikethrough:void 0,fontFamily:void 0,fillColor:void 0,borderColor:void 0,borderWidth:void 0,borderDash:void 0,borderCap:void 0,borderCompound:void 0}:{showHorzBorder:!1!==t.showHorzBorder,showVertBorder:!1!==t.showVertBorder,showOutline:!1!==t.showOutline,showKeys:!1!==t.showKeys,fontSize:(n=t.fontSize,dI(n)),fontColor:BI(t.fontColor),bold:EI(t.bold),italic:kI(t.italic),underline:SI(t.underline),strikethrough:FI(t.strikethrough),fontFamily:DI(t.fontFamily),fillColor:NI(t.fillColor),borderColor:MI(t.borderColor),borderWidth:Yw(t.borderWidth),borderDash:Gw(t.borderDash),borderCap:Fw(t.borderCap),borderCompound:Dw(t.borderCompound)}:void 0}(e);void 0!==o&&r.push(QI(o));const a=function(e){const t=(s=e.plotAreaFillColor,gI(s)),n=function(e){return gI(e)}(e.plotAreaBorderColor),r=Yw(e.plotAreaBorderWidth),i=Gw(e.plotAreaBorderDash),o=Fw(e.plotAreaBorderCap),a=Dw(e.plotAreaBorderCompound);var s;if(void 0===t&&void 0===n&&void 0===r&&void 0===i&&void 0===o&&void 0===a)return;const l=[];void 0!==t&&l.push(hw("a:solidFill",void 0,[Ow(t)]));if(void 0!==n||void 0!==r||void 0!==i||void 0!==o||void 0!==a){const e={};void 0!==r&&(e.w=Math.round(r*Cw)),void 0!==o&&(e.cap=o),void 0!==a&&(e.cmpd=a);const t=[];void 0!==n&&t.push(hw("a:solidFill",void 0,[Ow(n)])),void 0!==i&&t.push(fw("a:prstDash",{val:i})),l.push(0===t.length?fw("a:ln",e):hw("a:ln",Object.keys(e).length>0?e:void 0,t))}return hw("c:spPr",void 0,l)}(e);return void 0!==a&&r.push(a),hw("c:plotArea",void 0,r)}function FC(e){if(void 0===e||!Number.isFinite(e))return;let t=Math.round(e)%360;return t<0&&(t+=360),0!==t?t:void 0}function DC(e){if(void 0===e||!Number.isFinite(e))return 50;const t=Math.round(e);return t<10?10:t>90?90:t}function NC(e){return"boolean"==typeof e.varyColors?e.varyColors:hC.has(e.type)}function MC(e){const t=e.scatterStyle;return t&&pC.has(t)?t:"lineMarker"}const QC=new Map([["barChart","bar"],["bar3DChart","bar3D"],["lineChart","line"],["line3DChart","line3D"],["pieChart","pie"],["pie3DChart","pie3D"],["doughnutChart","doughnut"],["areaChart","area"],["area3DChart","area3D"],["scatterChart","scatter"],["bubbleChart","bubble"],["radarChart","radar"],["surfaceChart","surface"],["surface3DChart","surface3D"],["stockChart","stock"],["ofPieChart","ofPie"]]);function TC(e){const t=Lb(e),n="chartSpace"===t.local?t:Hb(t,"chartSpace");if(!n)return;const r=Rb(n,"chart");if(!r)return{kinds:[],seriesCount:0};const i={kinds:[],seriesCount:0},o=function(e){const t=Rb(e,"title");if(!t)return;const n=Rb(t,"tx");if(!n)return;const r=Rb(n,"rich");if(r){const e=[];gw(r,e);const t=e.join("").trim();return t.length>0?t:void 0}const i=Rb(n,"strRef");if(i){const e=Rb(i,"strCache");if(e)for(const t of Ub(e)){if("pt"!==t.local)continue;const e=Rb(t,"v");if(e){const t=mw(e).trim();if(t.length>0)return t}}}}(r);void 0!==o&&(i.title=o);const a=function(e){const t=Rb(e,"title");if(!t)return;const n=Rb(t,"overlay");if(!n)return;const r=n.attrs.val;if("string"==typeof r)switch(r){case"1":case"true":return!0;default:return}}(r);void 0!==a&&(i.titleOverlay=a);const s=function(e){const t=Rb(e,"title");if(!t)return;const n=Rb(t,"tx");if(!n)return;const r=Rb(n,"rich");if(!r)return;const i=Rb(r,"bodyPr");if(!i)return;const o=i.attrs.rot;if("string"!=typeof o)return;const a=o.trim();if(0===a.length)return;const s=Number.parseInt(a,10);if(!Number.isFinite(s))return;const l=Math.round(s/lI);return 0!==l?l<cI?cI:l>90?90:l:void 0}(r);void 0!==s&&(i.titleRotation=s);const l=function(e){const t=rI(e);if(!t)return;const n=t.attrs.sz;if("string"!=typeof n)return;const r=n.trim();if(0===r.length)return;const i=Number.parseInt(r,10);if(!Number.isFinite(i))return;const o=Math.round(i/100*2)/2;return o<1||o>400?void 0:o}(r);void 0!==l&&(i.titleFontSize=l);const c=function(e){const t=rI(e);if(!t)return;return!0===yw(t.attrs.b)||void 0}(r);void 0!==c&&(i.titleBold=c);const u=function(e){const t=rI(e);if(!t)return;return!0===yw(t.attrs.i)||void 0}(r);void 0!==u&&(i.titleItalic=u);const f=function(e){const t=rI(e);if(!t)return;const n=Rb(t,"solidFill");if(!n)return;const r=Rb(n,"srgbClr");if(r)return Pw(r.attrs.val);const i=Rb(n,"schemeClr");return i?Hw(i):void 0}(r);void 0!==f&&(i.titleColor=f);const d=function(e){const t=rI(e);if(!t)return;return"sngStrike"===t.attrs.strike||void 0}(r);void 0!==d&&(i.titleStrike=d);const h=function(e){const t=rI(e);if(!t)return;return"sng"===t.attrs.u||void 0}(r);void 0!==h&&(i.titleUnderline=h);const p=function(e){const t=rI(e);if(!t)return;const n=Rb(t,"latin");if(!n)return;const r=n.attrs.typeface;if("string"!=typeof r)return;const i=r.trim();return 0!==i.length?i:void 0}(r);void 0!==p&&(i.titleFontFamily=p);const g=function(e){const t=Rb(e,"title");if(t)return Kw(t)}(r);void 0!==g&&(i.titleLayout=g);const m=function(e){const t=Rb(e,"title");if(t)return zw(t)}(r);void 0!==m&&(i.titleFillColor=m);const y=function(e){const t=Rb(e,"title");if(t)return $w(t)}(r);void 0!==y&&(i.titleBorderColor=y);const v=function(e){const t=Rb(e,"title");if(t)return jw(t)}(r);void 0!==v&&(i.titleBorderWidth=v);const A=function(e){const t=Rb(e,"title");if(t)return Vw(t)}(r);void 0!==A&&(i.titleBorderDash=A);const b=function(e){const t=Rb(e,"title");if(t)return Nw(t)}(r);void 0!==b&&(i.titleBorderCap=b);const w=function(e){const t=Rb(e,"title");if(t)return Mw(t)}(r);void 0!==w&&(i.titleBorderCompound=w);const I=function(e){const t=Rb(e,"autoTitleDeleted");if(!t)return;const n=t.attrs.val;if("string"==typeof n)switch(n){case"1":case"true":return!0;default:return}}(r);void 0!==I&&(i.autoTitleDeleted=I);const x=Rb(r,"plotArea");if(x){let e=0;const t=[];let n,r,o,a,s,l,c,u,f,d,h,p,g,m,y,v;for(const A of Ub(x)){const b=QC.get(A.local);if(!b)continue;if(i.kinds.includes(b)||i.kinds.push(b),void 0===f&&(f=gC(A,b)),void 0!==n||"bar"!==b&&"bar3D"!==b||(n=wC(A)),void 0!==l||"bar"!==b&&"bar3D"!==b||(l=xC(A)),void 0!==c||"bar"!==b&&"bar3D"!==b||(c=BC(A)),void 0!==r||"line"!==b&&"line3D"!==b||(r=kC(A)),void 0!==o||"area"!==b&&"area3D"!==b||(o=kC(A)),void 0===s&&"doughnut"===b&&(s=IC(A)),void 0!==u||"pie"!==b&&"pie3D"!==b&&"doughnut"!==b&&"ofPie"!==b||(u=EC(A)),void 0===d&&"scatter"===b&&(d=mC(A)),void 0!==h||"line"!==b&&"line3D"!==b&&"area"!==b&&"area3D"!==b||(h=yC(A)),void 0!==p||"line"!==b&&"line3D"!==b&&"stock"!==b||(p=vC(A)),void 0!==g||"bar"!==b&&"ofPie"!==b||(g=AC(A)),void 0===m&&("line"===b||"line3D"===b||"stock"===b)){const e=Rb(A,"upDownBars");void 0!==e&&(m=!0,y=CC(e))}void 0===v&&"line"===b&&(v=bC(A));let w=0;for(const n of Ub(A))"ser"===n.local&&(e++,t.push(tx(n,b,w)),w++);if(void 0===a){const e=Rb(A,"dLbls");if(e){const t=RI(e);t&&(a=t)}}}i.seriesCount=e,t.length>0&&(i.series=t),void 0!==n&&(i.barGrouping=n),void 0!==r&&(i.lineGrouping=r),void 0!==o&&(i.areaGrouping=o),a&&(i.dataLabels=a),void 0!==s&&(i.holeSize=s),void 0!==l&&(i.gapWidth=l),void 0!==c&&(i.overlap=c),void 0!==u&&(i.firstSliceAng=u),void 0!==f&&(i.varyColors=f),void 0!==d&&(i.scatterStyle=d),void 0!==h&&(i.dropLines=h),void 0!==p&&(i.hiLowLines=p),void 0!==g&&(i.serLines=g),void 0!==m&&(i.upDownBars=m),void 0!==y&&(i.upDownBarsGapWidth=y),void 0!==v&&(i.showLineMarkers=v);const A=function(e){let t;const n=[];for(const r of Ub(e))"catAx"===r.local?t??=r:"valAx"===r.local&&n.push(r);let r,i;t?(r=t,i=n[0]):(r=n[0],i=n[1]);const o=t?"between":"midCat",a=r?gx(r,o):void 0,s=i?gx(i,o):void 0;if(!a&&!s)return;const l={};return a&&(l.x=a),s&&(l.y=s),l}(x);void 0!==A&&(i.axes=A);const b=xI(x);void 0!==b&&(i.dataTable=b);const w=function(e){return Kw(e)}(x);void 0!==w&&(i.plotAreaLayout=w);const I=function(e){return zw(e)}(x);void 0!==I&&(i.plotAreaFillColor=I);const C=function(e){return $w(e)}(x);void 0!==C&&(i.plotAreaBorderColor=C);const B=function(e){return jw(e)}(x);void 0!==B&&(i.plotAreaBorderWidth=B);const E=Vw(x);void 0!==E&&(i.plotAreaBorderDash=E);const k=Nw(x);void 0!==k&&(i.plotAreaBorderCap=k);const S=Mw(x);void 0!==S&&(i.plotAreaBorderCompound=S)}const C=function(e){const t=Rb(e,"legend");if(!t)return;const n=Rb(t,"delete");if(n&&!0===Aw(n.attrs.val))return!1;const r=Rb(t,"legendPos");if(!r)return"right";const i=r.attrs.val;if("string"!=typeof i)return"right";switch(i){case"t":return"top";case"b":return"bottom";case"l":return"left";case"r":return"right";case"tr":return"topRight";default:return}}(r);if(void 0!==C&&(i.legend=C),void 0!==C&&!1!==C){const e=function(e){const t=Rb(e,"legend");if(!t)return;const n=Rb(t,"overlay");if(!n)return;const r=n.attrs.val;if("string"==typeof r)switch(r){case"1":case"true":return!0;default:return}}(r);void 0!==e&&(i.legendOverlay=e);const t=function(e){const t=Rb(e,"legend");if(!t)return;const n=new Set,r=[];for(const e of Ub(t)){if("legendEntry"!==e.local)continue;const t=Rb(e,"idx");if(!t)continue;const i=t.attrs.val;if("string"!=typeof i)continue;const o=Number.parseInt(i,10);if(!Number.isFinite(o)||o<0)continue;if(n.has(o))continue;n.add(o);const a=Rb(e,"delete"),s={idx:o,delete:void 0!==a&&!0===Aw(a.attrs.val)},l=nI(e);if(l){const e=l.attrs.sz;if("string"==typeof e){const t=e.trim();if(t.length>0){const e=Number.parseInt(t,10);if(Number.isFinite(e)){const t=Math.round(e/vI*2)/2;t>=1&&t<=AI&&(s.fontSize=t)}}}const t=l.attrs.b;"string"==typeof t&&!0===Aw(t)&&(s.bold=!0);const n=l.attrs.i;"string"==typeof n&&!0===Aw(n)&&(s.italic=!0);const r=l.attrs.u;"string"==typeof r&&"sng"===r&&(s.underline=!0);const i=l.attrs.strike;"string"==typeof i&&"sngStrike"===i&&(s.strikethrough=!0);const o=Rb(l,"solidFill");if(o){const e=Rb(o,"srgbClr");if(e){const t=e.attrs.val;if("string"==typeof t){const e=t.replace(/^#/,"").toUpperCase();/^[0-9A-F]{6}$/.test(e)&&(s.color=e)}}}const a=Rb(l,"latin");if(a){const e=a.attrs.typeface;if("string"==typeof e){const t=e.trim();t.length>0&&(s.fontFamily=t)}}}r.push(s)}return r.length>0?r:void 0}(r);void 0!==t&&(i.legendEntries=t);const n=function(e){const t=Rb(e,"legend");if(!t)return;const n=nI(t);if(!n)return;const r=n.attrs.sz;if("string"!=typeof r)return;const i=r.trim();if(0===i.length)return;const o=Number.parseInt(i,10);if(!Number.isFinite(o))return;const a=Math.round(o/vI*2)/2;return a<1||a>AI?void 0:a}(r);void 0!==n&&(i.legendFontSize=n);const o=function(e){const t=Rb(e,"legend");if(!t)return;const n=nI(t);if(!n)return;const r=n.attrs.b;return"1"===r||"true"===r||void 0}(r);void 0!==o&&(i.legendBold=o);const a=function(e){const t=Rb(e,"legend");if(!t)return;const n=nI(t);if(!n)return;const r=n.attrs.i;return"1"===r||"true"===r||void 0}(r);void 0!==a&&(i.legendItalic=a);const s=function(e){const t=Rb(e,"legend");if(!t)return;const n=nI(t);if(!n)return;return"sng"===n.attrs.u||void 0}(r);void 0!==s&&(i.legendUnderline=s);const l=function(e){const t=Rb(e,"legend");if(!t)return;const n=nI(t);if(!n)return;return"sngStrike"===n.attrs.strike||void 0}(r);void 0!==l&&(i.legendStrikethrough=l);const c=function(e){const t=Rb(e,"legend");if(!t)return;const n=nI(t);if(!n)return;const r=Rb(n,"solidFill");if(!r)return;const i=Rb(r,"srgbClr");if(i)return Pw(i.attrs.val);const o=Rb(r,"schemeClr");return o?Hw(o):void 0}(r);void 0!==c&&(i.legendFontColor=c);const u=function(e){const t=Rb(e,"legend");if(!t)return;const n=nI(t);if(!n)return;const r=Rb(n,"latin");if(!r)return;const i=r.attrs.typeface;if("string"!=typeof i)return;const o=i.trim();return 0!==o.length?o:void 0}(r);void 0!==u&&(i.legendFontFamily=u);const f=function(e){const t=Rb(e,"legend");if(t)return Kw(t)}(r);void 0!==f&&(i.legendLayout=f);const d=function(e){const t=Rb(e,"legend");if(t)return zw(t)}(r);void 0!==d&&(i.legendFillColor=d);const h=function(e){const t=Rb(e,"legend");if(t)return $w(t)}(r);void 0!==h&&(i.legendBorderColor=h);const p=function(e){const t=Rb(e,"legend");if(t)return jw(t)}(r);void 0!==p&&(i.legendBorderWidth=p);const g=function(e){const t=Rb(e,"legend");if(t)return Vw(t)}(r);void 0!==g&&(i.legendBorderDash=g);const m=function(e){const t=Rb(e,"legend");if(t)return Nw(t)}(r);void 0!==m&&(i.legendBorderCap=m);const y=function(e){const t=Rb(e,"legend");if(t)return Mw(t)}(r);void 0!==y&&(i.legendBorderCompound=y)}const B=function(e){const t=Rb(e,"dispBlanksAs");if(!t)return;const n=t.attrs.val;if("string"!=typeof n)return;switch(n){case"zero":return"zero";case"span":return"span";default:return}}(r);void 0!==B&&(i.dispBlanksAs=B);const E=function(e){const t=Rb(e,"plotVisOnly");if(!t)return;const n=t.attrs.val;if("string"!=typeof n)return;switch(n){case"0":case"false":return!1;default:return}}(r);void 0!==E&&(i.plotVisOnly=E);const k=function(e){const t=Rb(e,"showDLblsOverMax");if(!t)return;const n=t.attrs.val;if("string"!=typeof n)return;switch(n){case"0":case"false":return!1;default:return}}(r);void 0!==k&&(i.showDLblsOverMax=k);const S=function(e){const t=Rb(e,"roundedCorners");if(!t)return;const n=t.attrs.val;if("string"!=typeof n)return;switch(n){case"1":case"true":return!0;default:return}}(n);void 0!==S&&(i.roundedCorners=S);const F=function(e){const t=Rb(e,"style");if(!t)return;const n=t.attrs.val;if("string"!=typeof n)return;if(!/^\d+$/.test(n))return;const r=Number(n);return Number.isInteger(r)?r<1||r>48?void 0:r:void 0}(n);void 0!==F&&(i.style=F);const D=function(e){const t=Rb(e,"lang");if(!t)return;const n=t.attrs.val;return"string"!=typeof n?void 0:/^[A-Za-z]{2,3}(-[A-Za-z0-9]{2,8})*$/.test(n)?n:void 0}(n);void 0!==D&&(i.lang=D);const N=function(e){const t=Rb(e,"date1904");if(!t)return;const n=t.attrs.val;if("string"!=typeof n)return;switch(n){case"1":case"true":return!0;default:return}}(n);void 0!==N&&(i.date1904=N);const M=function(e){const t=Rb(e,"protection");if(!t)return;const n={},r=LC(t,"chartObject");void 0!==r&&(n.chartObject=r);const i=LC(t,"data");void 0!==i&&(n.data=i);const o=LC(t,"formatting");void 0!==o&&(n.formatting=o);const a=LC(t,"selection");void 0!==a&&(n.selection=a);const s=LC(t,"userInterface");void 0!==s&&(n.userInterface=s);return n}(n);void 0!==M&&(i.protection=M);const Q=Ww(r);void 0!==Q&&(i.view3D=Q);const T=function(e){const t=Rb(e,"floor");if(!t)return;const n=Rb(t,"thickness");if(!n)return;const r=n.attrs.val;if("string"!=typeof r)return;if(!/^\d+$/.test(r))return;const i=Number(r);return!Number.isInteger(i)||0===i||i>100?void 0:i}(r);void 0!==T&&(i.floorThickness=T);const L=function(e){const t=Rb(e,"sideWall");if(!t)return;const n=Rb(t,"thickness");if(!n)return;const r=n.attrs.val;if("string"!=typeof r)return;if(!/^\d+$/.test(r))return;const i=Number(r);return!Number.isInteger(i)||0===i||i>100?void 0:i}(r);void 0!==L&&(i.sideWallThickness=L);const R=function(e){const t=Rb(e,"backWall");if(!t)return;const n=Rb(t,"thickness");if(!n)return;const r=n.attrs.val;if("string"!=typeof r)return;if(!/^\d+$/.test(r))return;const i=Number(r);return!Number.isInteger(i)||0===i||i>100?void 0:i}(r);void 0!==R&&(i.backWallThickness=R);const U=function(e){return zw(e)}(n);void 0!==U&&(i.chartSpaceFillColor=U);const H=function(e){return $w(e)}(n);void 0!==H&&(i.chartSpaceBorderColor=H);const q=jw(n);void 0!==q&&(i.chartSpaceBorderWidth=q);const O=Vw(n);void 0!==O&&(i.chartSpaceBorderDash=O);const P=Nw(n);void 0!==P&&(i.chartSpaceBorderCap=P);const z=Mw(n);return void 0!==z&&(i.chartSpaceBorderCompound=z),i}function LC(e,t){const n=Rb(e,t);if(!n)return;const r=n.attrs.val;if("string"==typeof r)switch(r){case"1":case"true":return!0;case"0":case"false":return!1;default:return}}const RC=1073741824,UC=1048575,HC=16383,qC=16777216,OC=Object.freeze([208,207,17,224,161,177,26,225]);async function PC(e,t){if(e instanceof Uint8Array)return e;if(e instanceof ArrayBuffer)return new Uint8Array(e);if("object"==typeof(n=e)&&null!==n&&"function"==typeof n.getReader)return async function(e,t=1073741824){const n=Number.isFinite(t)&&t>0?t:RC,r=e.getReader(),i=[];let o=0;try{for(;;){const{done:e,value:t}=await r.read();if(e)break;if(t){if(o+=t.length,o>n)throw new pb(`Input stream exceeds the maximum of ${n} bytes. Raise \`maxInputBytes\` if the file really is this large.`);i.push(t)}}if(0===i.length)return new Uint8Array(0);if(1===i.length)return i[0];const e=new Uint8Array(o);let t=0;for(const n of i)e.set(n,t),t+=n.length;return e}finally{try{await r.cancel()}catch{}try{r.releaseLock()}catch{}}}(e,t);var n;throw new pb("Unsupported input type. Expected Uint8Array, ArrayBuffer, or ReadableStream<Uint8Array>.")}const zC=[208,207,17,224,161,177,26,225],$C=4294967294,jC=4294967295,VC=4096,YC=64;function GC(e){if(e.length<512)throw new pb("CFB: file too small");for(let t=0;t<zC.length;t++)if(e[t]!==zC[t])throw new pb("CFB: bad signature");const t=new DataView(e.buffer,e.byteOffset,e.byteLength),n=1<<t.getUint16(30,!0),r=1<<t.getUint16(32,!0),i=t.getUint32(44,!0),o=t.getUint32(48,!0),a=t.getUint32(56,!0),s=t.getUint32(60,!0),l=t.getUint32(64,!0),c=t.getUint32(68,!0),u=t.getUint32(72,!0),f=t=>{const r=(e=>(e+1)*n)(t);if(r+n>e.length)throw new pb("CFB: sector out of range");return e.subarray(r,r+n)},d=[];for(let e=0;e<109&&d.length<i;e++){const n=t.getUint32(76+4*e,!0);if(n===jC||n===$C)break;d.push(n)}const h=Math.floor(e.length/n)+1,p=Math.min(u,h);let g=c,m=0;for(;g!==$C&&g!==jC&&p>0&&m++<p+1;){const e=f(g),t=new DataView(e.buffer,e.byteOffset,e.byteLength),r=n/4-1;for(let e=0;e<r&&d.length<i;e++){const n=t.getUint32(4*e,!0);n!==jC&&n!==$C&&d.push(n)}g=t.getUint32(n-4,!0)}const y=[];for(const e of d){const t=f(e),r=new DataView(t.buffer,t.byteOffset,t.byteLength);for(let e=0;e<n/4;e++)y.push(r.getUint32(4*e,!0))}const v=(e,t)=>{const r=(e=>{const t=[];let n=e,r=0;for(;n!==$C&&n!==jC&&r++<y.length+1;)t.push(n),n=y[n]??$C;return t})(e),i=new Uint8Array(r.length*n);let o=0;for(const e of r)i.set(f(e),o),o+=n;return t>=0?i.subarray(0,t):i},A=v(o,-1),b=new DataView(A.buffer,A.byteOffset,A.byteLength),w=[];for(let e=0;e+128<=A.length;e+=128){const t=A[e+66];if(0===t)continue;const n=b.getUint16(e+64,!0);let r="";for(let t=0;t+1<n;t+=2){const n=b.getUint16(e+t,!0);if(0===n)break;r+=String.fromCharCode(n)}const i=b.getUint32(e+116,!0),o=b.getUint32(e+120,!0);w.push({name:r,type:t,startSector:i,size:o})}const I=w.find(e=>5===e.type);if(!I)throw new pb("CFB: missing root entry");const x=v(I.startSector,I.size),C=[];if(l>0&&s!==$C){const e=v(s,l*n),t=new DataView(e.buffer,e.byteOffset,e.byteLength);for(let n=0;n<e.length/4;n++)C.push(t.getUint32(4*n,!0))}const B=(e,t)=>{if(t<0||t>x.length)throw new pb("CFB: mini stream size out of range");const n=new Uint8Array(t);let i=e,o=0,a=0;for(;i!==$C&&i!==jC&&o<t&&a++<C.length+1;){const e=i*r,a=Math.min(r,t-o);n.set(x.subarray(e,e+a),o),o+=a,i=C[i]??$C}return n},E=new Map;for(const e of w){if(2!==e.type)continue;const t=a||VC;E.set(e.name,e.size<t?B(e.startSector,e.size):v(e.startSector,e.size))}return E}function WC(e){const t=512,n=[],r=[],i=[],o=new Map;let a=0;for(const t of e)if(t.data.length<VC){o.set(t.name,{mini:!0}),r.push(a);const e=JC(t.data,YC);n.push(e),a+=e.length/YC}else o.set(t.name,{mini:!1}),i.push({name:t.name,data:t.data});const s=function(e){let t=0;for(const n of e)t+=n.length;const n=new Uint8Array(t);let r=0;for(const t of e)n.set(t,r),r+=t.length;return n}(n);let l=0;const c=e=>{const n=Math.max(1,Math.ceil(e/t)),r=l;return l+=n,{startSector:r,sectorCount:n}},u=i.map(e=>({name:e.name,data:e.data,region:c(e.data.length)})),f=s.length>0?c(s.length):null,d=new Uint8Array(Math.ceil(Math.max(a,0)/128)*t);{const t=new DataView(d.buffer);for(let e=0;e<d.length/4;e++)t.setUint32(4*e,jC,!0);let n=0;for(const i of e){if(i.data.length>=VC)continue;const e=JC(i.data,YC).length/YC;for(let i=0;i<e;i++){const o=r[n]+i;t.setUint32(4*o,i===e-1?$C:o+1,!0)}n++}}const h=a>0?c(d.length):null,p=1+e.length,g=Math.ceil(p/4)*t,m=c(g),y=l;let v=1;for(;;){const e=y+v,t=Math.ceil(e/128);if(t<=v)break;v=t}const A={startSector:l,sectorCount:v};l+=v;const b=l,w=new Uint32Array(128*v);w.fill(jC);const I=e=>{for(let t=0;t<e.sectorCount;t++)w[e.startSector+t]=t===e.sectorCount-1?$C:e.startSector+t+1};for(const e of u)I(e.region);f&&I(f),h&&I(h),I(m);for(let e=0;e<v;e++)w[A.startSector+e]=4294967293;const x=new Uint8Array(g),C=new DataView(x.buffer),B=(e,t,n,r,i,o,a,s,l)=>{const c=128*e;for(let e=0;e<t.length;e++)C.setUint16(c+2*e,t.charCodeAt(e),!0);C.setUint16(c+64,2*(t.length+1),!0),x[c+66]=n,x[c+67]=r,C.setUint32(c+68,i,!0),C.setUint32(c+72,o,!0),C.setUint32(c+76,a,!0),C.setUint32(c+116,s,!0),C.setUint32(c+120,l,!0)};for(let e=0;e<g/128;e++)C.setUint32(128*e+68,jC,!0),C.setUint32(128*e+72,jC,!0),C.setUint32(128*e+76,jC,!0);B(0,"Root Entry",5,1,jC,jC,e.length>0?1:jC,f?f.startSector:$C,s.length);for(let t=0;t<e.length;t++){const n=e[t],r=o.get(n.name),i=t+1,a=t+1<e.length?i+1:jC;let s;if(r.mini){let n=0;for(let r=0;r<t;r++){const t=e[r];t.data.length<VC&&(n+=JC(t.data,YC).length/YC)}s=n}else{s=u.find(e=>e.name===n.name).region.startSector}B(i,n.name,2,1,jC,a,jC,s,n.data.length)}const E=new Uint8Array((b+1)*t),k=new DataView(E.buffer);for(let e=0;e<zC.length;e++)E[e]=zC[e];k.setUint16(24,62,!0),k.setUint16(26,3,!0),k.setUint16(28,65534,!0),k.setUint16(30,9,!0),k.setUint16(32,6,!0),k.setUint32(44,v,!0),k.setUint32(48,m.startSector,!0),k.setUint32(56,VC,!0),k.setUint32(60,h?h.startSector:$C,!0),k.setUint32(64,h?h.sectorCount:0,!0),k.setUint32(68,$C,!0),k.setUint32(72,0,!0);for(let e=0;e<109;e++)k.setUint32(76+4*e,e<v?A.startSector+e:jC,!0);const S=e=>(e+1)*t,F=(e,t)=>{E.set(t,S(e.startSector))};for(const e of u)F(e.region,e.data);f&&F(f,s),h&&F(h,d),F(m,x);{const e=S(A.startSector),n=new DataView(E.buffer,e,v*t);for(let e=0;e<w.length;e++)n.setUint32(4*e,w[e],!0)}return E}function JC(e,t){if(e.length%t===0)return e;const n=new Uint8Array(Math.ceil(e.length/t)*t);return n.set(e,0),n}const _C=new Uint8Array([254,167,210,118,59,75,158,121]),XC=new Uint8Array([215,170,15,109,48,97,52,78]),KC=new Uint8Array([20,110,11,231,171,172,208,214]),ZC=new Uint8Array([95,178,173,1,12,185,225,246]),eB=new Uint8Array([160,103,127,2,178,44,132,51]),tB=4096,nB=new Uint8Array(16);async function rB(e,t,n=1e7){let r;try{r=GC(e)}catch(e){throw new Ab("Not a valid encrypted workbook container.",{cause:e})}const i=r.get("EncryptionInfo"),o=r.get("EncryptedPackage");if(!i||!o)throw new Ab("Encrypted workbook missing EncryptionInfo/EncryptedPackage.");const a=i[0]|i[1]<<8,s=i[2]|i[3]<<8;if(4!==a||4!==s)throw new Ab(`Unsupported encryption (version ${a}.${s}); only ECMA-376 Agile is supported.`);const l=new TextDecoder("utf-8").decode(i.subarray(8)),c=function(e,t){const n=yB(e,"encryptedKey");if(!n)throw new Ab("EncryptionInfo missing encryptedKey.");const r=parseInt(vB(n,"spinCount"),10);if(!Number.isFinite(r)||r<0)throw new Ab("EncryptionInfo has an invalid spinCount.");if(r>t)throw new Ab(`EncryptionInfo spinCount ${r} exceeds the maximum of ${t}. Raise \`maxSpinCount\` to agree to spend that time.`);return{saltValue:EB(vB(n,"saltValue")),hashAlgorithm:bB(vB(n,"hashAlgorithm")),keyBytes:parseInt(vB(n,"keyBits"),10)/8,blockSize:parseInt(vB(n,"blockSize"),10),spinCount:r,encryptedVerifierHashInput:EB(vB(n,"encryptedVerifierHashInput")),encryptedVerifierHashValue:EB(vB(n,"encryptedVerifierHashValue")),encryptedKeyValue:EB(vB(n,"encryptedKeyValue"))}}(l,n),u=function(e){const t=yB(e,"keyData");if(!t)throw new Ab("EncryptionInfo missing keyData.");return{saltValue:EB(vB(t,"saltValue")),hashAlgorithm:bB(vB(t,"hashAlgorithm")),keyBytes:parseInt(vB(t,"keyBits"),10)/8,blockSize:parseInt(vB(t,"blockSize"),10)}}(l),f=await async function(e,t){const n=await aB(e,t.saltValue,t.spinCount,t.hashAlgorithm),r=await sB(n,_C,t.keyBytes,t.hashAlgorithm),i=await sB(n,XC,t.keyBytes,t.hashAlgorithm),o=await sB(n,KC,t.keyBytes,t.hashAlgorithm),a=await pB(r,t.saltValue,t.encryptedVerifierHashInput),s=await pB(i,t.saltValue,t.encryptedVerifierHashValue),l=await fB(t.hashAlgorithm,a),c=Math.min(l.length,s.length);if(!function(e,t){if(e.length!==t.length)return!1;let n=0;for(let r=0;r<e.length;r++)n|=e[r]^t[r];return 0===n}(l.subarray(0,c),s.subarray(0,c)))return null;const u=await pB(o,t.saltValue,t.encryptedKeyValue);return u.subarray(0,t.keyBytes)}(t,c);if(!f)throw new Ab("Incorrect password.");return await async function(e,t,n,r){const i=yB(e,"dataIntegrity");if(!i)return;if("SHA-512"!==r.hashAlgorithm)return;const o=EB(vB(i,"encryptedHmacKey")),a=EB(vB(i,"encryptedHmacValue"));if(0===o.length||0===a.length)return;const s=await lB(r.saltValue,ZC,r.hashAlgorithm,r.blockSize),l=await lB(r.saltValue,eB,r.hashAlgorithm,r.blockSize),c=await pB(n,s,o),u=await pB(n,l,a),f=await mB(c,t),d=Math.min(f.length,u.length);let h=0===f.length?1:0;for(let e=0;e<d;e++)h|=f[e]^u[e];if(0!==h)throw new Ab("Encrypted package failed integrity check (HMAC mismatch).")}(l,o,f,u),async function(e,t,n){const r=Number(new DataView(e.buffer,e.byteOffset,8).getBigUint64(0,!0)),i=e.subarray(8),o=new Uint8Array(Math.ceil(i.length/tB)*tB),a=new Uint8Array(4),s=new DataView(a.buffer);let l=0,c=0;for(;l<i.length;){const e=i.subarray(l,Math.min(l+tB,i.length));s.setUint32(0,c,!0);const r=cB(await fB(n.hashAlgorithm,xB([n.saltValue,a])),n.blockSize),u=await pB(t,r,e);o.set(u,l),l+=tB,c++}return o.subarray(0,r)}(o,f,u)}async function iB(e,t,n){const r=n?.spinCount??1e5,i="SHA-512",o=32,a=16,s=wB(16),l=wB(16),c=wB(o),u=await aB(t,l,r,i),f=wB(a),d=await fB(i,f),h=await sB(u,_C,o,i),p=await sB(u,XC,o,i),g=await sB(u,KC,o,i),m=await gB(h,l,f),y=await gB(p,l,IB(d,a)),v=await gB(g,l,c),A=await async function(e,t,n){const r=new Uint8Array(8);new DataView(r.buffer).setBigUint64(0,BigInt(e.length),!0);const i=IB(e,tB),o=new Uint8Array(i.length),a=new Uint8Array(4),s=new DataView(a.buffer);let l=0,c=0;for(;l<i.length;){const e=i.subarray(l,l+tB);s.setUint32(0,c,!0);const r=cB(await fB(n.hashAlgorithm,xB([n.saltValue,a])),n.blockSize),u=await gB(t,r,e);o.set(u,l),l+=tB,c++}return xB([r,o])}(e,c,{saltValue:s,hashAlgorithm:i,keyBytes:o,blockSize:a}),b=wB(64),w=await lB(s,ZC,i,a),I=await gB(c,w,IB(b,a)),x=await mB(b,A),C=await lB(s,eB,i,a),B=function(e){const t=BB;return`<?xml version="1.0" encoding="UTF-8" standalone="yes"?><encryption xmlns="http://schemas.microsoft.com/office/2006/encryption" xmlns:p="http://schemas.microsoft.com/office/2006/keyEncryptor/password"><keyData saltSize="${e.keyDataSalt.length}" blockSize="${e.blockSize}" keyBits="${e.keyBits}" hashSize="${e.hashSize}" cipherAlgorithm="AES" cipherChaining="ChainingModeCBC" hashAlgorithm="SHA512" saltValue="${t(e.keyDataSalt)}"/><dataIntegrity encryptedHmacKey="${t(e.encryptedHmacKey)}" encryptedHmacValue="${t(e.encryptedHmacValue)}"/><keyEncryptors><keyEncryptor uri="http://schemas.microsoft.com/office/2006/keyEncryptor/password"><p:encryptedKey spinCount="${e.spinCount}" saltSize="${e.pwSalt.length}" blockSize="${e.blockSize}" keyBits="${e.keyBits}" hashSize="${e.hashSize}" cipherAlgorithm="AES" cipherChaining="ChainingModeCBC" hashAlgorithm="SHA512" saltValue="${t(e.pwSalt)}" encryptedVerifierHashInput="${t(e.encryptedVerifierHashInput)}" encryptedVerifierHashValue="${t(e.encryptedVerifierHashValue)}" encryptedKeyValue="${t(e.encryptedKeyValue)}"/></keyEncryptor></keyEncryptors></encryption>`}({keyDataSalt:s,pwSalt:l,spinCount:r,keyBits:256,hashSize:64,blockSize:a,encryptedVerifierHashInput:m,encryptedVerifierHashValue:y,encryptedKeyValue:v,encryptedHmacKey:I,encryptedHmacValue:await gB(c,C,IB(x,a))}),E=new Uint8Array(8),k=new DataView(E.buffer);k.setUint16(0,4,!0),k.setUint16(2,4,!0),k.setUint32(4,64,!0);return WC([{name:"EncryptionInfo",data:xB([E,(new TextEncoder).encode(B)])},{name:"EncryptedPackage",data:A}])}function oB(e){const t=new Uint8Array(2*e.length),n=new DataView(t.buffer);for(let t=0;t<e.length;t++)n.setUint16(2*t,e.charCodeAt(t),!0);return t}async function aB(e,t,n,r){let i=await fB(r,xB([t,oB(e)]));const o=new Uint8Array(4),a=new DataView(o.buffer);for(let e=0;e<n;e++)a.setUint32(0,e,!0),i=await fB(r,xB([o,i]));return i}async function sB(e,t,n,r){return function(e,t){if(e.length>=t)return e.subarray(0,t);const n=new Uint8Array(t).fill(54);return n.set(e,0),n}(await fB(r,xB([e,t])),n)}async function lB(e,t,n,r){return cB(await fB(n,xB([e,t])),r)}function cB(e,t){if(e.length>=t)return e.subarray(0,t);const n=new Uint8Array(t).fill(54);return n.set(e,0),n}const uB=e=>e;async function fB(e,t){return new Uint8Array(await crypto.subtle.digest(e,uB(t)))}async function dB(e){return crypto.subtle.importKey("raw",uB(e),{name:"AES-CBC"},!1,["encrypt","decrypt"])}async function hB(e,t,n){if(0===n.length)return new Uint8Array(0);const r=n.subarray(n.length-16),i=new Uint8Array(16);for(let e=0;e<16;e++)i[e]=16^r[e];const o=await async function(e,t){return new Uint8Array(await crypto.subtle.encrypt({name:"AES-CBC",iv:uB(nB)},e,uB(t))).subarray(0,16)}(e,i),a=xB([n,o]);return new Uint8Array(await crypto.subtle.decrypt({name:"AES-CBC",iv:uB(t)},e,uB(a))).subarray(0,n.length)}async function pB(e,t,n){return hB(await dB(e),t,n)}async function gB(e,t,n){return async function(e,t,n){return 0===n.length?new Uint8Array(0):new Uint8Array(await crypto.subtle.encrypt({name:"AES-CBC",iv:uB(t)},e,uB(n))).subarray(0,n.length)}(await dB(e),t,n)}async function mB(e,t){const n=await crypto.subtle.importKey("raw",uB(e),{name:"HMAC",hash:"SHA-512"},!1,["sign"]);return new Uint8Array(await crypto.subtle.sign("HMAC",n,uB(t)))}function yB(e,t){const n=new RegExp(`<(?:\\w+:)?${t}\\b[^>]*?/?>`).exec(e);return n?n[0]:null}function vB(e,t){const n=new RegExp(`\\b${t}="([^"]*)"`).exec(e);return n?n[1]:""}const AB={SHA512:"SHA-512",SHA384:"SHA-384",SHA256:"SHA-256",SHA1:"SHA-1"};function bB(e){return AB[e]??"SHA-512"}function wB(e){const t=new Uint8Array(e);return crypto.getRandomValues(t),t}function IB(e,t){if(e.length%t===0)return e;const n=new Uint8Array(Math.ceil(e.length/t)*t);return n.set(e,0),n}function xB(e){let t=0;for(const n of e)t+=n.length;const n=new Uint8Array(t);let r=0;for(const t of e)n.set(t,r),r+=t.length;return n}const CB="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";function BB(e){let t="",n=0;for(;n+2<e.length;n+=3){const r=e[n]<<16|e[n+1]<<8|e[n+2];t+=CB[r>>18&63]+CB[r>>12&63]+CB[r>>6&63]+CB[63&r]}if(n<e.length){if(1===e.length-n){const r=e[n]<<16;t+=CB[r>>18&63]+CB[r>>12&63]+"=="}else{const r=e[n]<<16|e[n+1]<<8;t+=CB[r>>18&63]+CB[r>>12&63]+CB[r>>6&63]+"="}}return t}function EB(e){const t=e.replace(/[^A-Za-z0-9+/]/g,""),n=Math.floor(3*t.length/4),r=new Uint8Array(n);let i=0,o=0,a=0;for(let e=0;e<t.length;e++)o=o<<6|CB.indexOf(t[e]),i+=6,i>=8&&(i-=8,r[a++]=o>>i&255);return r.subarray(0,a)}function kB(e){let t=0;return new ReadableStream({pull(n){if(t>=e.length)return void n.close();const r=Math.min(t+1048576,e.length);n.enqueue(e.subarray(t,r)),t=r}})}const SB=(()=>{const e=new Uint32Array(256);for(let t=0;t<256;t++){let n=t;for(let e=0;e<8;e++)n=1&n?3988292384^n>>>1:n>>>1;e[t]=n}return e})();function FB(e){return t=function(e,t){let n=e;for(let e=0;e<t.length;e++)n=SB[255&(n^t[e])]^n>>>8;return n>>>0}(4294967295,e),(4294967295^t)>>>0;var t}class DB{data;pos=0;bitBuf=0;bitCount=0;constructor(e){this.data=e}readBits(e){for(;this.bitCount<e;){if(this.pos>=this.data.length)throw new gb("Unexpected end of DEFLATE data");this.bitBuf|=this.data[this.pos++]<<this.bitCount,this.bitCount+=8}const t=this.bitBuf&(1<<e)-1;return this.bitBuf>>>=e,this.bitCount-=e,t}alignToByte(){this.bitBuf=0,this.bitCount=0}readByte(){if(this.pos>=this.data.length)throw new gb("Unexpected end of DEFLATE data");return this.data[this.pos++]}readUint16LE(){return this.readByte()|this.readByte()<<8}get offset(){return this.pos}get available(){return this.pos<this.data.length||this.bitCount>0}}function NB(e,t){const n=new Uint16Array(16);for(let r=0;r<t;r++)e[r]&&n[e[r]]++;const r=new Uint16Array(16);for(let e=1;e<15;e++)r[e+1]=r[e]+n[e];const i=r[15]+n[15],o=new Uint16Array(i);for(let n=0;n<t;n++)e[n]&&(o[r[e[n]]++]=n);return{counts:n,symbols:o}}function MB(e,t){let n=0,r=0,i=0;for(let o=1;o<=15;o++){n|=e.readBits(1);const a=t.counts[o];if(n<r+a)return t.symbols[i+(n-r)];i+=a,r=r+a<<1,n<<=1}throw new gb("Invalid Huffman code")}const QB=(()=>{const e=new Uint8Array(288);for(let t=0;t<=143;t++)e[t]=8;for(let t=144;t<=255;t++)e[t]=9;for(let t=256;t<=279;t++)e[t]=7;for(let t=280;t<=287;t++)e[t]=8;return NB(e,288)})(),TB=(()=>{const e=new Uint8Array(32);for(let t=0;t<32;t++)e[t]=5;return NB(e,32)})(),LB=[3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258],RB=[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],UB=[1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577],HB=[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],qB=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15];function OB(e,t=2147483648){const n=new DB(e);let r=new Uint8Array(3*e.length||1024),i=0;function o(e){if(i+e>t)throw new gb(`Decompressed size exceeds limit of ${t} bytes (possible zip bomb)`);if(i+e>r.length){let n=2*r.length;for(;i+e>n;)n*=2;n>t&&(n=t);const o=new Uint8Array(n);o.set(r),r=o}}function a(e){o(1),r[i++]=e}function s(e,t){o(t);let n=i-e;for(let e=0;e<t;e++)r[i++]=r[n++]}function l(e,t){for(;;){const r=MB(n,e);if(r<256)a(r);else{if(256===r)return;{const e=r-257,i=LB[e]+n.readBits(RB[e]),o=MB(n,t);s(UB[o]+n.readBits(HB[o]),i)}}}}let c=0;do{c=n.readBits(1);const e=n.readBits(2);if(0===e){n.alignToByte();const e=n.readUint16LE();n.readUint16LE(),o(e);for(let t=0;t<e;t++)r[i++]=n.readByte()}else if(1===e)l(QB,TB);else{if(2!==e)throw new gb(`Invalid DEFLATE block type: ${e}`);{const e=n.readBits(5)+257,t=n.readBits(5)+1,r=n.readBits(4)+4,i=new Uint8Array(19);for(let e=0;e<r;e++)i[qB[e]]=n.readBits(3);const o=NB(i,19),a=e+t,s=new Uint8Array(a);let c=0;for(;c<a;){const e=MB(n,o);if(e<16)s[c++]=e;else if(16===e){const e=n.readBits(2)+3,t=c>0?s[c-1]:0;for(let n=0;n<e;n++)s[c++]=t}else if(17===e){const e=n.readBits(3)+3;for(let t=0;t<e;t++)s[c++]=0}else if(18===e){const e=n.readBits(7)+11;for(let t=0;t<e;t++)s[c++]=0}}const u=s.subarray(0,e),f=s.subarray(e,e+t);l(NB(u,e),NB(f,t))}}}while(0===c);return r.subarray(0,i)}function PB(e){return 0===e.length?new Uint8Array([3,0]):e.length<=64?function(e){const t=[];let n=0;for(;n<e.length;){const r=e.length-n,i=Math.min(r,65535),o=n+i>=e.length,a=new Uint8Array(5+i);a[0]=o?1:0,a[1]=255&i,a[2]=i>>8&255,a[3]=255&~i,a[4]=~i>>8&255,a.set(e.subarray(n,n+i),5),t.push(a),n+=i}const r=t.reduce((e,t)=>e+t.length,0),i=new Uint8Array(r);let o=0;for(const e of t)i.set(e,o),o+=e.length;return i}(e):function(e){let t=new Uint8Array(e.length+512),n=0,r=0,i=0;function o(e){if(n+e>t.length){let r=2*t.length;for(;n+e>r;)r*=2;const i=new Uint8Array(r);i.set(t),t=i}}function a(e,a){for(r|=e<<i,i+=a;i>=8;)o(1),t[n++]=255&r,r>>>=8,i-=8}function s(){i>0&&(o(1),t[n++]=255&r,r=0,i=0)}function l(e){e<=143?a(zB(48+e,8),8):e<=255?a(zB(e-144+400,9),9):e<=279?a(zB(e-256,7),7):a(zB(e-280+192,8),8)}function c(e){a(zB(e,5),5)}a(1,1),a(1,2);const u=32768,f=258,d=3,h=32768,p=h-1,g=new Int32Array(h).fill(-1),m=new Int32Array(u);function y(t){return t+2>=e.length?0:(e[t]<<10^e[t+1]<<5^e[t+2])&p}let v=0;for(;v<e.length;){if(v+d>e.length){l(e[v]),v++;continue}const t=y(v);let n=d-1,r=0,i=g[t],o=0;const s=128,h=Math.max(0,v-u);for(;i>=h&&o<s;){const t=v-i;if(t>0&&t<=u){let o=0;const a=Math.min(f,e.length-v);for(;o<a&&e[i+o]===e[v+o];)o++;if(o>n&&(n=o,r=t,o===f))break}i=m[i&u-1],o++}if(m[v&u-1]=g[t],g[t]=v,n>=d){const t=$B(n);l(t+257),a(n-LB[t],RB[t]);const i=jB(r);c(i),a(r-UB[i],HB[i]);for(let t=1;t<n;t++){const n=v+t;if(n+d<=e.length){const e=y(n);m[n&u-1]=g[e],g[e]=n}}v+=n}else l(e[v]),v++}return l(256),s(),t.subarray(0,n)}(e)}function zB(e,t){let n=0;for(let r=0;r<t;r++)n=n<<1|1&e,e>>=1;return n}function $B(e){for(let t=LB.length-1;t>=0;t--)if(e>=LB[t])return t;return 0}function jB(e){for(let t=UB.length-1;t>=0;t--)if(e>=UB[t])return t;return 0}let VB,YB;function GB(){if(void 0===YB)try{new DecompressionStream("deflate-raw"),YB="undefined"!=typeof ReadableStream}catch{YB=!1}return YB}const WB=67324752,JB=4294967295;class _B{data;view;centralDir=[];entryMap=new Map;maxDecompressedBytes;constructor(e,t=2147483648){if(this.data=e,this.maxDecompressedBytes=t,e.length<22)throw new gb("Data too small to be a valid ZIP archive");this.view=new DataView(e.buffer,e.byteOffset,e.byteLength),this.readEndOfCentralDir()}entries(){return this.centralDir.map(e=>e.fileName)}has(e){return this.entryMap.has(e)}declaredSize(e){const t=this.entryMap.get(e);if(!t?.uncompressedSize)return;const n=0===t.compressionMethod?t.compressedSize:1032*t.compressedSize;return t.compressedSize>0&&t.uncompressedSize>n?void 0:t.uncompressedSize}async extract(e){const t=this.entryMap.get(e);if(!t)throw new gb(`Entry not found: ${e}`);return this.extractEntry(t)}extractStream(e){const t=this.entryMap.get(e);if(!t)throw new gb(`Entry not found: ${e}`);return this.extractEntryStream(t)}async extractAll(){const e=new Map;for(const t of this.centralDir){if(t.fileName.endsWith("/"))continue;const n=await this.extractEntry(t);e.set(t.fileName,n)}return e}readEndOfCentralDir(){const e=Math.max(0,this.data.length-65557);let t=-1;for(let n=this.data.length-22;n>=e;n--)if(101010256===this.view.getUint32(n,!0)){t=n;break}if(-1===t)throw new gb("End of Central Directory not found — not a valid ZIP file");let n=this.view.getUint32(t+12,!0),r=this.view.getUint32(t+16,!0),i=this.view.getUint16(t+10,!0);if(65535===i||n===JB||r===JB){const e=this.readZip64EndOfCentralDir(t);i=e.entryCount,n=e.centralDirSize,r=e.centralDirOffset}this.readCentralDirectory(r,n,i)}readZip64EndOfCentralDir(e){const t=e-20;if(t<0||117853008!==this.view.getUint32(t,!0))throw new gb("ZIP64 End of Central Directory locator not found");const n=this.readUint64(t+8,"ZIP64 EOCD offset");if(n+56>this.data.length)throw new gb("ZIP64 End of Central Directory record extends beyond file");if(101075792!==this.view.getUint32(n,!0))throw new gb("Invalid ZIP64 End of Central Directory signature");return{entryCount:this.readUint64(n+32,"ZIP64 entry count"),centralDirSize:this.readUint64(n+40,"ZIP64 central directory size"),centralDirOffset:this.readUint64(n+48,"ZIP64 central directory offset")}}readUint64(e,t){if(e+8>this.data.length)throw new gb(`${t} extends beyond file`);const n=this.view.getBigUint64(e,!0);if(n>BigInt(Number.MAX_SAFE_INTEGER))throw new gb(`${t} (${n}) exceeds the addressable range`);return Number(n)}readCentralDirectory(e,t,n){let r=e;for(let e=0;e<n;e++){if(r+46>this.data.length)throw new gb("Central Directory entry extends beyond file");const e=this.view.getUint32(r,!0);if(33639248!==e)throw new gb(`Invalid Central Directory signature at offset ${r}: 0x${e.toString(16)}`);const t=this.view.getUint16(r+8,!0),n=this.view.getUint16(r+10,!0),i=this.view.getUint32(r+16,!0);let o=this.view.getUint32(r+20,!0),a=this.view.getUint32(r+24,!0);const s=this.view.getUint16(r+28,!0),l=this.view.getUint16(r+30,!0),c=this.view.getUint16(r+32,!0);let u=this.view.getUint32(r+42,!0);const f=this.data.subarray(r+46,r+46+s),d=(new TextDecoder).decode(f);if(o===JB||a===JB||u===JB){const e=this.readZip64Extra(r+46+s,l,a===JB,o===JB,u===JB,d);void 0!==e.uncompressedSize&&(a=e.uncompressedSize),void 0!==e.compressedSize&&(o=e.compressedSize),void 0!==e.localHeaderOffset&&(u=e.localHeaderOffset)}const h={fileName:d,compressionMethod:n,compressedSize:o,uncompressedSize:a,crc32:i,localHeaderOffset:u,hasDataDescriptor:!!(8&t)};this.centralDir.push(h),this.entryMap.set(d,h),r+=46+s+l+c}}readZip64Extra(e,t,n,r,i,o){const a=Math.min(e+t,this.data.length);let s=e;for(;s+4<=a;){const e=this.view.getUint16(s,!0),t=this.view.getUint16(s+2,!0),a=s+4;if(1!==e){s=a+t;continue}const l=a+t;let c=a;const u={},f=e=>{if(c+8>l)throw new gb(`Truncated ZIP64 extra field for entry: ${o}`);const t=this.readUint64(c,e);return c+=8,t};return n&&(u.uncompressedSize=f("ZIP64 uncompressed size")),r&&(u.compressedSize=f("ZIP64 compressed size")),i&&(u.localHeaderOffset=f("ZIP64 local header offset")),u}throw new gb(`Missing ZIP64 extra field for entry: ${o}`)}async extractEntry(e){const t=e.localHeaderOffset;if(t+30>this.data.length)throw new gb("Local file header extends beyond file");if(this.view.getUint32(t,!0)!==WB)throw new gb(`Invalid local file header signature at offset ${t}`);const n=t+30+this.view.getUint16(t+26,!0)+this.view.getUint16(t+28,!0);let{compressedSize:r,uncompressedSize:i,crc32:o}=e;if(e.hasDataDescriptor&&0===r){const e=this.view.getUint32(t+18,!0);e>0&&e!==JB&&(r=e);const a=this.view.getUint32(t+22,!0);if(a>0&&a!==JB&&(i=a),0===r){const e=this.findDataDescriptor(n);e&&(o=e.crc,r=e.compressedSize,i=e.uncompressedSize)}}if(n+r>this.data.length)throw new gb(`Compressed data extends beyond file for entry: ${e.fileName}`);const a=this.data.subarray(n,n+r);let s;if(0===e.compressionMethod)s=a;else{if(8!==e.compressionMethod)throw new gb(`Unsupported compression method ${e.compressionMethod} for entry: ${e.fileName}`);if(0===r&&0===i)s=new Uint8Array(0);else{const e=i>0?Math.min(i,this.maxDecompressedBytes):this.maxDecompressedBytes;s=await async function(e,t=2147483648){if(GB())try{const n=new DecompressionStream("deflate-raw"),r=n.writable.getWriter(),i=n.readable.getReader();r.write(e).catch(()=>{}),r.close().catch(()=>{});const o=[];let a=0;for(;;){const{done:e,value:n}=await i.read();if(e)break;if(a+=n.length,a>t){try{await i.cancel()}catch{}throw new gb(`Decompressed size exceeds limit of ${t} bytes (possible zip bomb)`)}o.push(n)}const s=new Uint8Array(a);let l=0;for(const e of o)s.set(e,l),l+=e.length;return s}catch(e){if(e instanceof gb)throw e}return OB(e,t)}(a,e)}}if(0!==o&&s.length>0){const t=FB(s);if(t!==o)throw new gb(`CRC-32 mismatch for ${e.fileName}: expected 0x${o.toString(16)}, got 0x${t.toString(16)}`)}return s}extractEntryStream(e){const t=e.localHeaderOffset;if(t+30>this.data.length)throw new gb("Local file header extends beyond file");if(this.view.getUint32(t,!0)!==WB)throw new gb(`Invalid local file header signature at offset ${t}`);const n=t+30+this.view.getUint16(t+26,!0)+this.view.getUint16(t+28,!0);let{compressedSize:r}=e;if(e.hasDataDescriptor&&0===r){const e=this.view.getUint32(t+18,!0);if(e>0&&e!==JB&&(r=e),0===r){const e=this.findDataDescriptor(n);e&&(r=e.compressedSize)}}if(n+r>this.data.length)throw new gb(`Compressed data extends beyond file for entry: ${e.fileName}`);const i=this.data.subarray(n,n+r);if(0===e.compressionMethod)return kB(i);if(8===e.compressionMethod){if(0===r&&0===e.uncompressedSize)return new ReadableStream({start(e){e.close()}});const t=e.uncompressedSize>0?Math.min(e.uncompressedSize,this.maxDecompressedBytes):this.maxDecompressedBytes;if(GB()){return new ReadableStream({start(e){e.enqueue(i),e.close()}}).pipeThrough(new DecompressionStream("deflate-raw")).pipeThrough(function(e){let t=0;return new TransformStream({transform(n,r){if(t+=n.length,t>e)throw new gb(`Decompressed size exceeds limit of ${e} bytes (possible zip bomb)`);r.enqueue(n)}})}(t))}return kB(OB(i,t))}throw new gb(`Unsupported compression method ${e.compressionMethod} for entry: ${e.fileName}`)}findDataDescriptor(e){for(let t=e;t<this.data.length-16;t++)if(134695760===this.view.getUint32(t,!0))return{crc:this.view.getUint32(t+4,!0),compressedSize:this.view.getUint32(t+8,!0),uncompressedSize:this.view.getUint32(t+12,!0)};return null}}function XB(e){const t=[];let n=null;for(const r of e.children){if("string"==typeof r)continue;const e=r.local||r.tag;"t"===e?n=KB(r):"r"===e&&t.push(r)}if(0===t.length)return{text:Eb(n??"")};const r=[],i=[];for(const e of t){let t,n="";for(const r of e.children){if("string"==typeof r)continue;const e=r.local||r.tag;"t"===e?n=KB(r):"rPr"===e&&(t=ZB(r))}const o=Eb(n);i.push(o),r.push(t?{text:o,font:t}:{text:o})}return{text:i.join(""),richText:r}}function KB(e){return e.text??""}function ZB(e){const t={};for(const n of e.children){if("string"==typeof n)continue;switch(n.local||n.tag){case"b":t.bold="0"!==n.attrs.val&&"false"!==n.attrs.val;break;case"i":t.italic="0"!==n.attrs.val&&"false"!==n.attrs.val;break;case"u":{const e=n.attrs.val;t.underline="double"===e?"double":"singleAccounting"===e?"singleAccounting":"doubleAccounting"!==e||"doubleAccounting";break}case"strike":t.strikethrough="0"!==n.attrs.val&&"false"!==n.attrs.val;break;case"sz":n.attrs.val&&(t.size=Number(n.attrs.val));break;case"rFont":n.attrs.val&&(t.name=n.attrs.val);break;case"color":if(t.color={},n.attrs.rgb){const e=n.attrs.rgb;t.color.rgb=8===e.length?e.slice(2):e}n.attrs.theme&&(t.color.theme=Number(n.attrs.theme)),n.attrs.tint&&(t.color.tint=Number(n.attrs.tint)),n.attrs.indexed&&(t.color.indexed=Number(n.attrs.indexed));break;case"vertAlign":"superscript"!==n.attrs.val&&"subscript"!==n.attrs.val||(t.vertAlign=n.attrs.val);break;case"family":n.attrs.val&&(t.family=Number(n.attrs.val));break;case"charset":n.attrs.val&&(t.charset=Number(n.attrs.val));break;case"scheme":"major"!==n.attrs.val&&"minor"!==n.attrs.val&&"none"!==n.attrs.val||(t.scheme=n.attrs.val)}}return t}const eE=Date.UTC(1899,11,31),tE=Date.UTC(1904,0,1),nE=864e5;function rE(e,t){const n=e.getTime();if(t)return(n-tE)/nE;let r=(n-eE)/nE;return r>=60&&(r+=1),Math.round(1e10*r)/1e10}const iE=new Set([14,15,16,17,18,19,20,21,22,27,28,29,30,31,32,33,34,35,36,45,46,47,50,51,52,53,54,55,56,57,58]);function oE(e){if(!e)return!1;const t=Number(e);if(!Number.isNaN(t)&&Number.isInteger(t)&&iE.has(t))return!0;let n=e.replace(/\[[$\-\w]*\]/g,"");if(n=n.replace(/\\./g,""),n=n.replace(/"[^"]*"/g,""),n=n.replace(/[*_]./g,""),/^(General|@)$/i.test(n.trim()))return!1;const r=n.toLowerCase();if(/[hs]/.test(r)){if(/\bh{1,2}\b|(?:^|[^a-z])h{1,2}(?:[^a-z]|$)/i.test(r))return!0;if(/\bs{1,2}\b|(?:^|[^a-z])s{1,2}(?:[^a-z]|$)/i.test(r))return!0}return!!/am\/pm|a\/p/i.test(r)||(!!/\[h+\]|\[m+\]|\[s+\]/i.test(e)||(!!/y{1,4}/.test(r)||(!!/d{1,4}/.test(r)||!!/m{3,}/.test(r))))}const aE=["January","February","March","April","May","June","July","August","September","October","November","December"],sE=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],lE=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],cE=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"];const uE=["000000","FFFFFF","FF0000","00FF00","0000FF","FFFF00","FF00FF","00FFFF","000000","FFFFFF","FF0000","00FF00","0000FF","FFFF00","FF00FF","00FFFF","800000","008000","000080","808000","800080","008080","C0C0C0","808080","9999FF","993366","FFFFCC","CCFFFF","660066","FF8080","0066CC","CCCCFF","000080","FF00FF","FFFF00","00FFFF","800080","800000","008080","0000FF","00CCFF","CCFFFF","CCFFCC","FFFF99","99CCFF","FF99CC","CC99FF","FFCC99","3366FF","33CCCC","99CC00","FFCC00","FF9900","FF6600","666699","969696","003366","339966","003300","333300","993300","993366","333399","333333"],fE="http://schemas.microsoft.com/office/spreadsheetml/2022/featurepropertybag",dE="{C7286773-470A-42A8-94C5-96B5CB345126}",hE="xl/featurePropertyBag/featurePropertyBag.xml";const pE={0:"General",1:"0",2:"0.00",3:"#,##0",4:"#,##0.00",5:"$#,##0_);\\($#,##0\\)",6:"$#,##0_);[Red]\\($#,##0\\)",7:"$#,##0.00_);\\($#,##0.00\\)",8:"$#,##0.00_);[Red]\\($#,##0.00\\)",9:"0%",10:"0.00%",11:"0.00E+00",12:"# ?/?",13:"# ??/??",14:"m/d/yyyy",15:"d-mmm-yy",16:"d-mmm",17:"mmm-yy",18:"h:mm AM/PM",19:"h:mm:ss AM/PM",20:"h:mm",21:"h:mm:ss",22:"m/d/yyyy h:mm",37:"#,##0 ;(#,##0)",38:"#,##0 ;[Red](#,##0)",39:"#,##0.00;(#,##0.00)",40:"#,##0.00;[Red](#,##0.00)",45:"mm:ss",46:"[h]:mm:ss",47:"mmss.0",48:"##0.0E+0",49:"@"};function gE(e){const t=Lb(e),n=new Map,r=[],i=[],o=[],a=[],s=[];for(const e of t.children){if("string"==typeof e)continue;switch(e.local||e.tag){case"numFmts":yE(e,n);break;case"fonts":vE(e,r);break;case"fills":wE(e,i);break;case"borders":BE(e,o);break;case"cellXfs":SE(e,a);break;case"dxfs":DE(e,s)}}const l=function(e){for(const t of e.children)if("string"!=typeof t&&"colors"===(t.local||t.tag))for(const e of t.children){if("string"==typeof e)continue;if("indexedColors"!==(e.local||e.tag))continue;const t=[];for(const n of e.children){if("string"==typeof n)continue;if("rgbColor"!==(n.local||n.tag))continue;const e=n.attrs.rgb;e&&t.push(8===e.length?e.slice(2):e)}if(t.length>0)return t}return uE}(t);for(const e of[r,i,o,s])mE(e,l);return{numFmts:n,fonts:r,fills:i,borders:o,cellXfs:a,dxfs:s}}function mE(e,t){if(null===e||"object"!=typeof e)return;if(Array.isArray(e)){for(const n of e)mE(n,t);return}const n=e;if("number"==typeof n.indexed&&"string"!=typeof n.rgb){const e=t[n.indexed];e&&(n.rgb=e)}for(const e of Object.values(n))mE(e,t)}function yE(e,t){for(const n of e.children){if("string"==typeof n)continue;if("numFmt"===(n.local||n.tag)){const e=Number(n.attrs.numFmtId),r=n.attrs.formatCode??"";Number.isNaN(e)||t.set(e,r)}}}function vE(e,t){for(const n of e.children){if("string"==typeof n)continue;"font"===(n.local||n.tag)&&t.push(AE(n))}}function AE(e){const t={};for(const n of e.children){if("string"==typeof n)continue;switch(n.local||n.tag){case"b":t.bold="0"!==n.attrs.val&&"false"!==n.attrs.val;break;case"i":t.italic="0"!==n.attrs.val&&"false"!==n.attrs.val;break;case"u":{const e=n.attrs.val;t.underline="double"===e?"double":"singleAccounting"===e?"singleAccounting":"doubleAccounting"!==e||"doubleAccounting";break}case"strike":t.strikethrough="0"!==n.attrs.val&&"false"!==n.attrs.val;break;case"sz":n.attrs.val&&(t.size=Number(n.attrs.val));break;case"name":n.attrs.val&&(t.name=n.attrs.val);break;case"color":t.color=bE(n);break;case"vertAlign":"superscript"!==n.attrs.val&&"subscript"!==n.attrs.val||(t.vertAlign=n.attrs.val);break;case"family":n.attrs.val&&(t.family=Number(n.attrs.val));break;case"charset":n.attrs.val&&(t.charset=Number(n.attrs.val));break;case"scheme":"major"!==n.attrs.val&&"minor"!==n.attrs.val&&"none"!==n.attrs.val||(t.scheme=n.attrs.val)}}return t}function bE(e){const t={};if(e.attrs.rgb){const n=e.attrs.rgb;t.rgb=8===n.length?n.slice(2):n}return e.attrs.theme&&(t.theme=Number(e.attrs.theme)),e.attrs.tint&&(t.tint=Number(e.attrs.tint)),e.attrs.indexed&&(t.indexed=Number(e.attrs.indexed)),t}function wE(e,t){for(const n of e.children){if("string"==typeof n)continue;"fill"===(n.local||n.tag)&&t.push(IE(n))}}function IE(e){for(const t of e.children){if("string"==typeof t)continue;const e=t.local||t.tag;if("patternFill"===e)return xE(t);if("gradientFill"===e)return CE(t)}return{type:"pattern",pattern:"none"}}function xE(e){const t={type:"pattern",pattern:e.attrs.patternType??"none"};for(const n of e.children){if("string"==typeof n)continue;const e=n.local||n.tag;"fgColor"===e?t.fgColor=bE(n):"bgColor"===e&&(t.bgColor=bE(n))}return t}function CE(e){const t=e.attrs.degree?Number(e.attrs.degree):void 0,n=[];for(const t of e.children){if("string"==typeof t)continue;if("stop"===(t.local||t.tag)){const e=Number(t.attrs.position??"0");for(const r of t.children){if("string"==typeof r)continue;"color"===(r.local||r.tag)&&n.push({position:e,color:bE(r)})}}}return{type:"gradient",degree:t,stops:n}}function BE(e,t){for(const n of e.children){if("string"==typeof n)continue;"border"===(n.local||n.tag)&&t.push(EE(n))}}function EE(e){const t={},n=e.attrs.diagonalUp,r=e.attrs.diagonalDown;"1"!==n&&"true"!==n||(t.diagonalUp=!0),"1"!==r&&"true"!==r||(t.diagonalDown=!0);for(const n of e.children){if("string"==typeof n)continue;const e=n.local||n.tag,r=kE(n);if(r)switch(e){case"left":t.left=r;break;case"right":t.right=r;break;case"top":t.top=r;break;case"bottom":t.bottom=r;break;case"diagonal":t.diagonal=r}}return t}function kE(e){const t=e.attrs.style;if(!t)return;const n={style:t};for(const t of e.children){if("string"==typeof t)continue;"color"===(t.local||t.tag)&&(n.color=bE(t))}return n}function SE(e,t){for(const n of e.children){if("string"==typeof n)continue;"xf"===(n.local||n.tag)&&t.push(FE(n))}}function FE(e){const t={numFmtId:Number(e.attrs.numFmtId??"0"),fontId:Number(e.attrs.fontId??"0"),fillId:Number(e.attrs.fillId??"0"),borderId:Number(e.attrs.borderId??"0")};"1"!==e.attrs.applyNumberFormat&&"true"!==e.attrs.applyNumberFormat||(t.applyNumberFormat=!0),"1"!==e.attrs.applyFont&&"true"!==e.attrs.applyFont||(t.applyFont=!0),"1"!==e.attrs.applyFill&&"true"!==e.attrs.applyFill||(t.applyFill=!0),"1"!==e.attrs.applyBorder&&"true"!==e.attrs.applyBorder||(t.applyBorder=!0),"1"!==e.attrs.applyAlignment&&"true"!==e.attrs.applyAlignment||(t.applyAlignment=!0),"1"!==e.attrs.applyProtection&&"true"!==e.attrs.applyProtection||(t.applyProtection=!0);for(const n of e.children){if("string"==typeof n)continue;const e=n.local||n.tag;"alignment"===e?t.alignment=TE(n):"protection"===e?t.protection=QE(n):"extLst"===e&&ME(n)&&(t.hasCheckboxFeature=!0)}return t}function DE(e,t){for(const n of e.children){if("string"==typeof n)continue;"dxf"===(n.local||n.tag)&&t.push(NE(n))}}function NE(e){const t={};for(const n of e.children){if("string"==typeof n)continue;switch(n.local||n.tag){case"font":t.font=AE(n);break;case"numFmt":{const e=n.attrs.formatCode;if(e)t.numFmt=e;else{const e=Number(n.attrs.numFmtId),r=Number.isNaN(e)?void 0:pE[e];r&&(t.numFmt=r)}break}case"fill":t.fill=IE(n);break;case"border":t.border=EE(n);break;case"alignment":t.alignment=TE(n)}}return t}function ME(e){for(const t of e.children){if("string"==typeof t)continue;if("ext"===(t.local||t.tag)&&t.attrs.uri===dE)return!0}return!1}function QE(e){const t={},n=e.attrs.locked;void 0!==n&&(t.locked="1"===n||"true"===n);const r=e.attrs.hidden;return void 0!==r&&(t.hidden="1"===r||"true"===r),t}function TE(e){const t={};if(e.attrs.horizontal&&(t.horizontal=e.attrs.horizontal),e.attrs.vertical&&(t.vertical=e.attrs.vertical),"1"!==e.attrs.wrapText&&"true"!==e.attrs.wrapText||(t.wrapText=!0),"1"!==e.attrs.shrinkToFit&&"true"!==e.attrs.shrinkToFit||(t.shrinkToFit=!0),e.attrs.textRotation&&(t.textRotation=Number(e.attrs.textRotation)),e.attrs.indent&&(t.indent=Number(e.attrs.indent)),e.attrs.readingOrder){const n=Number(e.attrs.readingOrder);t.readingOrder=1===n?"ltr":2===n?"rtl":"context"}return t}function LE(e,t){const n=e.cellXfs[t];if(!n)return{};const r={};if(0!==n.numFmtId){const t=e.numFmts.get(n.numFmtId)??pE[n.numFmtId];t&&(r.numFmt=t)}return n.fontId<e.fonts.length&&0!==n.fontId&&(r.font=e.fonts[n.fontId]),n.fillId<e.fills.length&&n.fillId>1&&(r.fill=e.fills[n.fillId]),n.borderId<e.borders.length&&0!==n.borderId&&(r.border=e.borders[n.borderId]),n.alignment&&(r.alignment=n.alignment),n.protection&&(r.protection=n.protection),r}function RE(e,t){const n=e.cellXfs[t];if(!n)return!1;const r=n.numFmtId,i=e.numFmts.get(r);if(i)return oE(i);if(o=r,iE.has(o))return!0;var o;const a=pE[r];return!!a&&oE(a)}function UE(e){return void 0===e?void 0:{...e}}function HE(e){const t={...e};return e.color&&(t.color=UE(e.color)),t}function qE(e){if("gradient"===e.type)return{...e,stops:e.stops.map(e=>({...e,color:{...e.color}}))};const t={...e};return e.fgColor&&(t.fgColor=UE(e.fgColor)),e.bgColor&&(t.bgColor=UE(e.bgColor)),t}function OE(e){if(void 0===e)return;const t={...e};return e.color&&(t.color=UE(e.color)),t}function PE(e){const t={...e};for(const n of["top","right","bottom","left","diagonal"])e[n]&&(t[n]=OE(e[n]));return t}function zE(e){const t={...e};return e.font&&(t.font=HE(e.font)),e.fill&&(t.fill=qE(e.fill)),e.border&&(t.border=PE(e.border)),e.alignment&&(t.alignment={...e.alignment}),e.protection&&(t.protection={...e.protection}),t}function $E(e){return"string"==typeof e?function(e){const t=e.split(":"),n=Rk(t[0]),r=t.length>1?Rk(t[1]):n;return{startRow:n.row,startCol:n.col,endRow:r.row,endCol:r.col}}(e):e}function jE(e){return"object"==typeof e&&null!==e&&"string"==typeof e.hyperlink&&"string"==typeof e.text}function VE(e){return jE(e)?e.text:e}function YE(e){return e>=19968&&e<=40959||e>=13312&&e<=19903||e>=131072&&e<=173791||e>=63744&&e<=64255||e>=44032&&e<=55215||e>=12448&&e<=12543||e>=12352&&e<=12447||e>=12288&&e<=12351||e>=65280&&e<=65376||e>=65504&&e<=65510}function GE(e){const t=e.indexOf(".");if(-1===t)return 0;let n=0;for(let r=t+1;r<e.length&&("0"===e[r]||"#"===e[r]);r++)n++;return n}function WE(e,t){if(!t.includes(","))return e;const n=e.split(".");let r=n[0];const i=r.startsWith("-");i&&(r=r.slice(1));let o="";for(let e=0;e<r.length;e++)e>0&&(r.length-e)%3==0&&(o+=","),o+=r[e];return i&&(o="-"+o),void 0!==n[1]&&(o+="."+n[1]),o}function JE(e){let t=0;for(const n of e){const e=n.codePointAt(0);void 0!==e&&YE(e)?t+=2:t+=1}return t}function _E(e,t){if(null==e)return 0;if("boolean"==typeof e)return e?5:6;if("string"==typeof e){if(0===e.length)return 0;if(e.includes("\n")){const t=e.split("\n");let n=0;for(const e of t){const t=JE(e);t>n&&(n=t)}return n}return JE(e)}if("number"==typeof e){if(t){const n=function(e,t){const n=t.trim().split(";");let r;if(e>0?r=n[0]:e<0&&n.length>1?(r=n[1],e=Math.abs(e)):r=0===e&&n.length>2?n[2]:n[0],r=r.replace(/\[[^\]]*\]/g,""),r=r.replace(/\\./g,e=>e[1]),r=r.replace(/"([^"]*)"/g,"$1"),r.includes("%")){const t=GE(r.replace(/%/g,""));return WE((100*e).toFixed(t),r)+"%"}const i=GE(r);return WE(e.toFixed(i),r)}(e,t),r=function(e){let t=0;const n=e.split(";")[0].replace(/\[[^\]]*\]/g,"");for(let e=0;e<n.length;e++){const r=n[e];if('"'===r)for(e++;e<n.length&&'"'!==n[e];)t++,e++;else"\\"===r?(t++,e++):"$"!==r&&"€"!==r&&"£"!==r&&"¥"!==r||t++}return t}(t);return JE(n)+r}return JE(String(e))}if(e instanceof Date){if(t){const n=function(e,t,n){const r=e.getUTCFullYear(),i=e.getUTCMonth(),o=e.getUTCDate(),a=e.getUTCDay();let s=e.getUTCHours();const l=e.getUTCMinutes(),c=e.getUTCSeconds(),u=e.getUTCMilliseconds();let f="",d=s;/am\/pm|a\/p/i.test(t)&&(f=s>=12?"PM":"AM",d=s%12,0===d&&(d=12));const h=function(e){const t=[];let n=0;for(;n<e.length;){if("["===e[n]&&"$"===e[n+1]){const t=e.indexOf("]",n);if(-1!==t){n=t+1;continue}}if("["===e[n]){const r=e.indexOf("]",n);if(-1!==r){const i=e.slice(n+1,r);if(/^h+$/i.test(i)||/^m+$/i.test(i)||/^s+$/i.test(i)){t.push(e.slice(n,r+1)),n=r+1;continue}n=r+1;continue}}if('"'===e[n]){let r="";for(n++;n<e.length&&'"'!==e[n];)r+=e[n],n++;n++,t.push(r);continue}if("\\"===e[n]){n++,n<e.length&&(t.push(e[n]),n++);continue}if(/^am\/pm/i.test(e.slice(n))){t.push(e.slice(n,n+5)),n+=5;continue}if(/^a\/p/i.test(e.slice(n))){t.push(e.slice(n,n+3)),n+=3;continue}if("."===e[n]&&n+1<e.length&&"0"===e[n+1]){let r=".",i=n+1;for(;i<e.length&&"0"===e[i];)r+="0",i++;t.push(r),n=i;continue}const r=e[n].toLowerCase();if("ymdhsn".includes(r)){let i="";const o=r;for(;n<e.length&&e[n].toLowerCase()===o;)i+=e[n],n++;t.push(i);continue}t.push(e[n]),n++}return t}(t),p=void 0!==n&&n>0?n:0,g=Math.floor(24*p),m=Math.floor(24*p*60),y=Math.floor(24*p*60*60),v=Array.from({length:h.length},()=>!1);for(let e=0;e<h.length;e++){const t=h[e].toLowerCase();if("m"!==t&&"mm"!==t)continue;let n=!1;for(let t=e-1;t>=0;t--){const e=h[t].toLowerCase();if("h"===e||"hh"===e||/^\[h+\]$/.test(e)){n=!0;break}if(/^[ymdhs]+$/.test(e)||/^\[[ms]+\]$/.test(e)||"am/pm"===e||"a/p"===e)break}let r=!1;for(let t=e+1;t<h.length;t++){const e=h[t].toLowerCase();if("s"===e||"ss"===e){r=!0;break}if(/^[ymdh]+$/.test(e)||"am/pm"===e||"a/p"===e)break}v[e]=n||r}let A="";for(let e=0;e<h.length;e++){const t=h[e],n=t.toLowerCase();if(t.startsWith("[")&&t.endsWith("]")){const e=n.slice(1,-1);/^h+$/.test(e)?A+=String(g).padStart(e.length,"0"):/^m+$/.test(e)?A+=String(m).padStart(e.length,"0"):/^s+$/.test(e)&&(A+=String(y).padStart(e.length,"0"));continue}switch(n){case"yyyy":A+=String(r);break;case"yy":A+=String(r%100).padStart(2,"0");break;case"mmmm":A+=aE[i];break;case"mmm":A+=sE[i];break;case"mm":v[e]?A+=String(l).padStart(2,"0"):A+=String(i+1).padStart(2,"0");break;case"m":v[e]?A+=String(l):A+=String(i+1);break;case"dddd":A+=lE[a];break;case"ddd":A+=cE[a];break;case"dd":A+=String(o).padStart(2,"0");break;case"d":A+=String(o);break;case"hh":A+=String(d).padStart(2,"0");break;case"h":A+=String(d);break;case"ss":A+=String(c).padStart(2,"0");break;case"s":A+=String(c);break;case".0":case".00":case".000":{const e=n.length-1;A+="."+String(u).padStart(3,"0").slice(0,e)}break;case"am/pm":A+=f;break;case"a/p":A+=f.charAt(0);break;default:A+=t}}return A}(e,t);return JE(n)}return JE(`${e.getUTCFullYear()}-${String(e.getUTCMonth()+1).padStart(2,"0")}-${String(e.getUTCDate()).padStart(2,"0")}`)}return 0}function XE(e,t){const n=t?.minWidth??8,r=t?.maxWidth??255,i=t?.padding??2,o=!0===t?.font?.bold;let a=0;for(const n of e){const e=_E(n,t?.numFmt);e>a&&(a=e)}let s=1.1*a;return o&&(s*=1.05),s+=i,s=Math.ceil(2*s)/2,s<n&&(s=n),s>r&&(s=r),s}const KE="XLDAPR",ZE="{bdbb8cdc-fa1e-496e-a857-3c3f30c029c3}",ek="xl/metadata.xml";function tk(e){for(const t of Ub(e))if("extLst"===t.local)for(const e of Ub(t))if("ext"===e.local&&(e.attrs.uri??"").toLowerCase()===ZE)for(const t of Ub(e)){if("dynamicArrayProperties"!==t.local)continue;const e=t.attrs.fDynamic;return"0"!==e&&"false"!==e}return!0}function nk(e){let t=0;for(let n=e.length-1;n>=0;n--){t=t>>14&1|t<<1&32767,t^=e.charCodeAt(n)}return t=t>>14&1|t<<1&32767,t^=e.length,t^=52811,t.toString(16).toUpperCase().padStart(4,"0")}const rk=/[[\]:*?/\\]/;function ik(e,t){const n=`sheet ${t+1}`;if("string"!=typeof e||0===e.length)throw new yb(`Sheet name is empty (${n}); Excel requires a name`);if(e.length>31)throw new yb(`Sheet name "${e}" is ${e.length} characters (${n}); Excel allows at most 31`);const r=e.match(rk);if(r)throw new yb(`Sheet name "${e}" contains ${JSON.stringify(r[0])} (${n}); Excel forbids [ ] : * ? / \\ in sheet names`);if(e.startsWith("'")||e.endsWith("'"))throw new yb(`Sheet name "${e}" starts or ends with an apostrophe (${n}); Excel forbids it because it breaks quoted range references`);if("history"===e.toLowerCase())throw new yb(`Sheet name "${e}" is reserved by Excel for change tracking (${n})`)}function ok(e){return!("object"!=typeof e||null===e||e instanceof Date||Array.isArray(e)||jE(e))}function ak(e){return ok(e)?e.value??null:e}function sk(e){let t=!1;const n=e.map(e=>{const n=function(e){const t=e.rows;if(!t)return e;let n=!1;for(const e of t){for(const t of e)if(ok(t)){n=!0;break}if(n)break}if(!n)return e;const r=[],i=new Map;for(let e=0;e<t.length;e++){const n=t[e],o=[];for(let t=0;t<n.length;t++){const r=n[t];ok(r)?(i.set(`${e},${t}`,r),o.push(r.value??null)):o.push(r)}r[e]=o}if(e.cells)for(const[t,n]of e.cells)i.set(t,n);return{...e,rows:r,cells:i}}(e);return n!==e&&(t=!0),n});return t?n:e}const lk="http://schemas.openxmlformats.org/spreadsheetml/2006/main";function ck(e){!function(e){if(!Number.isInteger(e)||e<0||e>HC)throw new yb(`Column index ${e} is not a valid 0-based column (Excel allows 0..16383)`)}(e);let t="",n=e;do{t=String.fromCharCode(65+n%26)+t,n=Math.floor(n/26)-1}while(n>=0);return t}function uk(e,t){const n={r:e+1};return void 0!==t?.height&&(n.ht=t.height,n.customHeight=1),t?.hidden&&(n.hidden=1),t?.outlineLevel&&(n.outlineLevel=t.outlineLevel),t?.collapsed&&(n.collapsed=1),n}function fk(e,t){return ck(t)+(e+1)}function dk(e,t,n,r){return`${fk(e,t)}:${fk(n,r)}`}function hk(e){const t=e.hyperlink.startsWith("#")?{target:"",location:e.hyperlink.slice(1),display:e.text}:{target:e.hyperlink,display:e.text};return void 0!==e.tooltip&&(t.tooltip=e.tooltip),t}const pk="yyyy-mm-dd",gk=Object.freeze({numFmt:pk}),mk=new WeakMap,yk=new Set(["#VALUE!","#REF!","#N/A","#NAME?","#NULL!","#DIV/0!","#NUM!","#GETTING_DATA","#SPILL!","#CALC!"]);function vk(e,t,n,r,i,o,a){const s="1904"===r,l=bk(e),c=l.length;let u=0;for(const e of l)e.length>u&&(u=e.length);e.columns&&e.columns.length>u&&(u=e.columns.length);const f=[];{const t=[];if(e.view?.tabColor&&t.push(fw("tabColor",Ek(e.view.tabColor))),e.outlineProperties){const n={};void 0!==e.outlineProperties.summaryBelow&&(n.summaryBelow=e.outlineProperties.summaryBelow?1:0),void 0!==e.outlineProperties.summaryRight&&(n.summaryRight=e.outlineProperties.summaryRight?1:0),t.push(fw("outlinePr",n))}e.pageSetup?.fitToPage&&t.push(fw("pageSetUpPr",{fitToPage:1})),t.length>0&&f.push(hw("sheetPr",void 0,t))}if(c>0||u>0){const e=c>0?c-1:0,t=u>0?u-1:0;f.push(fw("dimension",{ref:dk(0,0,e,t)}))}const d=[];if(e.freezePane){const t=e.freezePane,n=fk(t.rows??0,t.columns??0),r={};t.columns&&t.columns>0&&(r.xSplit=t.columns),t.rows&&t.rows>0&&(r.ySplit=t.rows),r.topLeftCell=n,r.state="frozen";const i=t.columns&&t.columns>0,o=t.rows&&t.rows>0;r.activePane=i&&o?"bottomRight":i?"topRight":"bottomLeft",d.push(fw("pane",r))}else if(e.splitPane){const t=e.splitPane,n={},r=void 0!==t.xSplit&&t.xSplit>0,i=void 0!==t.ySplit&&t.ySplit>0;r&&(n.xSplit=t.xSplit),i&&(n.ySplit=t.ySplit),n.topLeftCell="A1",n.state="split",n.activePane=r&&i?"bottomRight":r?"topRight":"bottomLeft",d.push(fw("pane",n))}const h={workbookViewId:0};e.view&&(!1===e.view.showGridLines&&(h.showGridLines=0),!1===e.view.showRowColHeaders&&(h.showRowColHeaders=0),void 0!==e.view.zoomScale&&(h.zoomScale=e.view.zoomScale),e.view.rightToLeft&&(h.rightToLeft=1)),f.push(hw("sheetViews",void 0,[d.length>0?hw("sheetView",h,d):fw("sheetView",h)]));const p={defaultRowHeight:e.defaultRowHeight??15};if(void 0!==e.defaultRowHeight&&(p.customHeight=1),void 0!==e.defaultColWidth&&(p.defaultColWidth=e.defaultColWidth),f.push(fw("sheetFormatPr",p)),e.columns&&e.columns.length>0){const n=[];for(let r=0;r<e.columns.length;r++){const i=e.columns[r];let o=i.width;if(i.autoWidth&&void 0===o){const e=[];for(const t of l)t&&r<t.length&&t[r]&&e.push(t[r].value);o=XE(e,{font:i.style?.font,numFmt:i.numFmt??i.style?.numFmt})}const a=i.numFmt&&!i.style?.numFmt?{...i.style,numFmt:i.numFmt}:i.style??void 0,s=a?t.addStyle(a):0;if(void 0!==o||i.hidden||i.outlineLevel||i.collapsed||0!==s){const e={min:r+1,max:r+1};void 0!==o&&(e.width=o,e.customWidth=!0),0!==s&&(e.style=s),i.hidden&&(e.hidden=!0),i.outlineLevel&&(e.outlineLevel=i.outlineLevel),i.collapsed&&(e.collapsed=!0),n.push(fw("col",e))}}n.length>0&&f.push(hw("cols",void 0,n))}const g=[];let m=!1;for(let r=0;r<c;r++){const i=l[r],a=e.rowDefs?.get(r),c=a&&(void 0!==a.height||a.hidden||a.outlineLevel||a.collapsed);if(!(i&&0!==i.length||c))continue;const u=[];let f=!1;if(i)for(let e=0;e<i.length;e++){const a=i[e];if(!a)continue;a.formulaDynamic&&void 0!==a.formula&&null!==a.formula&&(m=!0);const l=Ik(r,e,a,t,n,s,o);l&&(u.push(l),f=!0)}if(f||c){const e=uk(r,a);f?g.push(hw("row",e,u)):g.push(fw("row",e))}}if(f.push(hw("sheetData",void 0,g.length>0?g:"")),e.protection&&f.push(function(e){const t={};e.password&&(t.password=nk(e.password));!1!==e.sheet&&(t.sheet=1);e.objects&&(t.objects=1);e.scenarios&&(t.scenarios=1);const n=[["selectLockedCells","selectLockedCells"],["selectUnlockedCells","selectUnlockedCells"],["formatCells","formatCells"],["formatColumns","formatColumns"],["formatRows","formatRows"],["insertColumns","insertColumns"],["insertRows","insertRows"],["insertHyperlinks","insertHyperlinks"],["deleteColumns","deleteColumns"],["deleteRows","deleteRows"],["sort","sort"],["autoFilter","autoFilter"],["pivotTables","pivotTables"]];for(const[r,i]of n){const n=e[r];void 0!==n&&"boolean"==typeof n&&(t[i]=n?0:1)}return fw("sheetProtection",t)}(e.protection)),e.autoFilter)if(e.autoFilter.columns&&e.autoFilter.columns.length>0){const t=[];for(const n of e.autoFilter.columns)if(n.filters&&n.filters.length>0){const e=n.filters.map(e=>fw("filter",{val:e}));t.push(hw("filterColumn",{colId:n.colIndex},[hw("filters",void 0,e)]))}f.push(hw("autoFilter",{ref:e.autoFilter.range},t))}else f.push(fw("autoFilter",{ref:e.autoFilter.range}));const y=function(e){if(e)return e.some(e=>"string"==typeof e)?e.map($E):e}(e.merges);if(y&&y.length>0){const e=y.map(e=>fw("mergeCell",{ref:dk(e.startRow,e.startCol,e.endRow,e.endCol)}));f.push(hw("mergeCells",{count:y.length},e))}e.conditionalRules&&e.conditionalRules.length>0&&f.push(...function(e,t){const n=new Map;for(const t of e){const e=n.get(t.range);e?e.push(t):n.set(t.range,[t])}const r=[];for(const[e,i]of n){const n=[];for(const e of i)n.push(Sk(e,t));r.push(hw("conditionalFormatting",{sqref:e},n))}return r}(e.conditionalRules,t)),e.dataValidations&&e.dataValidations.length>0&&f.push(function(e){const t=[];for(const n of e){const e={type:n.type,sqref:n.range};n.operator&&(e.operator=n.operator),n.allowBlank&&(e.allowBlank=1),n.showInputMessage&&(e.showInputMessage=1),n.showErrorMessage&&(e.showErrorMessage=1),n.errorStyle&&(e.errorStyle=n.errorStyle),n.inputTitle&&(e.promptTitle=n.inputTitle),n.inputMessage&&(e.prompt=n.inputMessage),n.errorTitle&&(e.errorTitle=n.errorTitle),n.errorMessage&&(e.error=n.errorMessage);const r=[];if("list"===n.type&&n.values&&n.values.length>0){const e=`"${n.values.join(",")}"`;r.push(hw("formula1",void 0,lw(e)))}else void 0!==n.formula1&&r.push(hw("formula1",void 0,lw(n.formula1)));void 0!==n.formula2&&r.push(hw("formula2",void 0,lw(n.formula2))),r.length>0?t.push(hw("dataValidation",e,r)):t.push(fw("dataValidation",e))}return hw("dataValidations",{count:e.length},t)}(e.dataValidations));const{xml:v,relationships:A}=function(e,t){const n=t??bk(e),r=[],i=[];let o=1;for(let e=0;e<n.length;e++){const t=n[e];for(let n=0;n<t.length;n++){const a=t[n]?.hyperlink;if(!a)continue;const s={ref:fk(e,n)};if(a.location)s.location=a.location;else if(a.target){const e="rId"+o++;s["r:id"]=e,i.push({id:e,target:a.target})}a.tooltip&&(s.tooltip=a.tooltip),a.display&&(s.display=a.display),r.push(fw("hyperlink",s))}}if(0===r.length)return{xml:"",relationships:[]};return{xml:hw("hyperlinks",void 0,r),relationships:i}}(e,l);v&&f.push(v);const b=function(e){if(!e)return"";const t={};e.showGridLines&&(t.gridLines=1);e.showRowColHeaders&&(t.headings=1);e.horizontalCentered&&(t.horizontalCentered=1);e.verticalCentered&&(t.verticalCentered=1);return 0===Object.keys(t).length?"":fw("printOptions",t)}(e.pageSetup);if(b&&f.push(b),f.push(function(e){const t=e??{};return fw("pageMargins",{left:t.left??Bk.left,right:t.right??Bk.right,top:t.top??Bk.top,bottom:t.bottom??Bk.bottom,header:t.header??Bk.header,footer:t.footer??Bk.footer})}(e.pageSetup?.margins)),e.pageSetup&&f.push(function(e){const t={};if(void 0!==e.paperSize){const n=function(e){if("number"==typeof e)return Number.isInteger(e)&&e>0?e:void 0;return xk[e]}(e.paperSize);void 0!==n&&(t.paperSize=n)}e.orientation&&(t.orientation=e.orientation);void 0!==e.scale&&(t.scale=e.scale);e.fitToPage&&(void 0!==e.fitToWidth&&(t.fitToWidth=e.fitToWidth),void 0!==e.fitToHeight&&(t.fitToHeight=e.fitToHeight));void 0!==e.paperWidth&&(t.paperWidth=e.paperWidth);void 0!==e.paperHeight&&(t.paperHeight=e.paperHeight);void 0!==e.firstPageNumber&&(t.firstPageNumber=e.firstPageNumber);const n=e.useFirstPageNumber??(void 0!==e.firstPageNumber||void 0);void 0!==n&&(t.useFirstPageNumber=n?1:0);void 0!==e.pageOrder&&"downThenOver"!==e.pageOrder&&(t.pageOrder=e.pageOrder);e.blackAndWhite&&(t.blackAndWhite=1);e.draft&&(t.draft=1);void 0!==e.cellComments&&"none"!==e.cellComments&&(t.cellComments=e.cellComments);void 0!==e.errors&&"displayed"!==e.errors&&(t.errors=e.errors);void 0!==e.copies&&(t.copies=e.copies);void 0!==e.horizontalDpi&&(t.horizontalDpi=e.horizontalDpi);void 0!==e.verticalDpi&&(t.verticalDpi=e.verticalDpi);!1===e.usePrinterDefaults&&(t.usePrinterDefaults=0);if(0===Object.keys(t).length)return"";return fw("pageSetup",t)}(e.pageSetup)),e.headerFooter&&f.push(function(e){const t={};e.differentOddEven&&(t.differentOddEven=1);e.differentFirst&&(t.differentFirst=1);const n=[];e.oddHeader&&n.push(hw("oddHeader",void 0,lw(e.oddHeader)));e.oddFooter&&n.push(hw("oddFooter",void 0,lw(e.oddFooter)));e.evenHeader&&n.push(hw("evenHeader",void 0,lw(e.evenHeader)));e.evenFooter&&n.push(hw("evenFooter",void 0,lw(e.evenFooter)));e.firstHeader&&n.push(hw("firstHeader",void 0,lw(e.firstHeader)));e.firstFooter&&n.push(hw("firstFooter",void 0,lw(e.firstFooter)));if(0===n.length)return"";return hw("headerFooter",Object.keys(t).length>0?t:void 0,n)}(e.headerFooter)),e.rowBreaks&&e.rowBreaks.length>0){const t=[...e.rowBreaks].sort((e,t)=>e-t),n=t.map(e=>fw("brk",{id:e+1,max:16383,man:1}));f.push(hw("rowBreaks",{count:t.length,manualBreakCount:t.length},n))}if(e.colBreaks&&e.colBreaks.length>0){const t=[...e.colBreaks].sort((e,t)=>e-t),n=t.map(e=>fw("brk",{id:e+1,max:1048575,man:1}));f.push(hw("colBreaks",{count:t.length,manualBreakCount:t.length},n))}let w=null,I=A.length+1;const x=e.images&&e.images.length>0,C=e.textBoxes&&e.textBoxes.length>0,B=e.charts&&e.charts.length>0,E=f.length;(x||C||B)&&(w=`rId${I}`,I++,f.push(fw("drawing",{"r:id":w})));let k=null,S=null,F=!1;if(e.cells)for(const[,t]of e.cells)if(t.comment){F=!0;break}F&&(k=`rId${I}`,I++,S=`rId${I}`,I++,f.push(fw("legacyDrawing",{"r:id":k})));let D=null;e.backgroundImage&&(D=`rId${I}`,I++,f.push(fw("picture",{"r:id":D})));const N=[];if(e.tables&&e.tables.length>0&&void 0!==i){const t=[];for(let n=0;n<e.tables.length;n++){const e=`rId${I}`;I++;const r=i+n;N.push({rId:e,globalTableIndex:r}),t.push(fw("tablePart",{"r:id":e}))}f.push(hw("tableParts",{count:e.tables.length},t))}e.sparklines&&e.sparklines.length>0&&f.push(function(e){const t=[];let n=1;for(const r of e){const e={},i=r.type??"line";"line"!==i&&(e.type=i),e.displayEmptyCellsAs="gap";const o=`{00000000-0000-0000-0000-${String(n++).padStart(12,"0")}}`;e["xr2:uid"]=o,r.markers&&(e.markers="1");const a=[],s=r.color??"376092",l=6===s.length?`FF${s}`:s;a.push(fw("x14:colorSeries",{rgb:l}));const c=hw("x14:sparkline",void 0,[hw("xm:f",void 0,r.dataRange),hw("xm:sqref",void 0,r.location)]);a.push(hw("x14:sparklines",void 0,[c])),t.push(hw("x14:sparklineGroup",e,a))}const r=hw("x14:sparklineGroups",{"xmlns:xm":Dk},t),i=hw("ext",{uri:Mk,"xmlns:x14":Fk,"xmlns:xr2":Nk},[r]);return hw("extLst",void 0,[i])}(e.sparklines));const M=[];if(e.pivotTables&&e.pivotTables.length>0&&void 0!==a)for(let t=0;t<e.pivotTables.length;t++){const e=`rId${I}`;I++,M.push({rId:e,globalPivotIndex:a+t})}const Q=pw("worksheet",{xmlns:lk,"xmlns:r":"http://schemas.openxmlformats.org/officeDocument/2006/relationships"},f);return{xml:Q,drawingInsertOffset:Qk(Q,f,E),hyperlinkRelationships:A,drawingRId:w,legacyDrawingRId:k,commentsRId:S,hasComments:F,tables:N,pictureRId:D,pivotTables:M,hasDynamicArray:m}}function Ak(e){if(e)return e.numFmt&&!e.style?.numFmt?{...e.style,numFmt:e.numFmt}:e.style}function bk(e){const t=[];if(e.data&&e.columns){const n=e.columns.map(e=>e.key);if(e.columns.some(e=>e.header)){const n=[];for(let t=0;t<e.columns.length;t++){const r=e.columns[t];n.push({value:r.header??r.key??null,style:r.style})}t.push(n)}for(const r of e.data){const i=[];for(let t=0;t<n.length;t++){const o=n[t],a=void 0!==o?r[o]??null:null,s={value:jE(a)?a.text:a,style:Ak(e.columns[t])};jE(a)&&(s.hyperlink=hk(a)),i.push(s)}t.push(i)}}else if(e.rows)for(const n of e.rows){const r=[];for(let t=0;t<n.length;t++){const i=ak(n[t]),o=e.columns?Ak(e.columns[t]):void 0;r.push(o?{value:i,style:o}:{value:i})}t.push(r)}if(e.cells)for(const[n,r]of e.cells){const[e,i]=n.split(","),o=parseInt(e,10),a=parseInt(i,10);for(;t.length<=o;)t.push([]);const s=t[o];for(;s.length<=a;)s.push(null);const l=s[a];s[a]={value:r.value??l?.value??null,style:r.style??l?.style,checkbox:r.checkbox??l?.checkbox,formula:r.formula??l?.formula,formulaResult:r.formulaResult??l?.formulaResult,formulaType:r.formulaType??l?.formulaType,formulaSharedIndex:r.formulaSharedIndex??l?.formulaSharedIndex,formulaRef:r.formulaRef??l?.formulaRef,formulaDynamic:r.formulaDynamic??l?.formulaDynamic,richText:r.richText??l?.richText,hyperlink:r.hyperlink??l?.hyperlink}}return t}function wk(e,t,n,r){return 0===t?""===n?`<c r="${e}"><v>${r}</v></c>`:`<c r="${e}" t="${n}"><v>${r}</v></c>`:""===n?`<c r="${e}" s="${t}"><v>${r}</v></c>`:`<c r="${e}" t="${n}" s="${t}"><v>${r}</v></c>`}function Ik(e,t,n,r,i,o,a){const{value:s,style:l,formula:c,formulaResult:u,formulaType:f,formulaSharedIndex:d,formulaRef:h,formulaDynamic:p,richText:g}=n;let m=0,y=l;if(s instanceof Date&&(!y||!y.numFmt))if(y){const e=mk.get(y);if(e)y=e;else{const e={...y,numFmt:pk};mk.set(y,e),y=e}}else y=gk;n.checkbox?m=r.addCheckboxStyle(y):y&&(m=r.addStyle(y));const v=fk(e,t);if(g&&g.length>0){const e={r:v,t:"inlineStr"};0!==m&&(e.s=m);const t=function(e){const t=[];for(const n of e){const e=[];if(n.font){const t=kk(n.font);t.length>0&&e.push(hw("rPr",void 0,t))}e.push(dw(n.text)),t.push(hw("r",void 0,e))}return t}(g);return hw("c",e,[hw("is",void 0,t)])}if(null!=c){const e={r:v};let t;if(0!==m&&(e.s=m),p&&(e.cm=1),"shared"===f){const e={t:"shared"};void 0!==d&&(e.si=d),h&&(e.ref=h),t=""===c?fw("f",e):hw("f",e,lw(c))}else if("array"===f){const e={t:"array"};h&&(e.ref=h),t=hw("f",e,lw(c))}else t=hw("f",void 0,lw(c));const n=[t];return null!=u&&("string"==typeof u?(e.t="str",n.push(hw("v",void 0,lw(u)))):"boolean"==typeof u?(e.t="b",n.push(hw("v",void 0,u?"1":"0"))):"number"==typeof u?Number.isFinite(u)&&n.push(hw("v",void 0,String(u))):u instanceof Date&&n.push(hw("v",void 0,String(rE(u,o))))),hw("c",e,n)}if(null==s)return 0!==m?fw("c",{r:v,s:m}):null;if("string"==typeof s&&yk.has(s))return wk(v,m,"e",s);if("string"==typeof s){if(a){const e=`<is>${dw(s)}</is>`;return 0===m?`<c r="${v}" t="inlineStr">${e}</c>`:`<c r="${v}" t="inlineStr" s="${m}">${e}</c>`}return wk(v,m,"s",String(i.add(s)))}return"number"==typeof s?Number.isFinite(s)?wk(v,m,"",String(s)):0!==m?fw("c",{r:v,s:m}):null:"boolean"==typeof s?wk(v,m,"b",s?"1":"0"):s instanceof Date?wk(v,m,"",String(rE(s,o))):null}const xk={letter:1,letterSmall:2,tabloid:3,ledger:4,legal:5,statement:6,executive:7,a3:8,a4:9,a4Small:10,a5:11,b4:12,b5:13,folio:14,quarto:15,note:18,envelope9:19,envelope10:20,envelope11:21,envelope12:22,envelope14:23,cSheet:24,dSheet:25,eSheet:26,envelopeDL:27,envelopeC5:28,envelopeC3:29,envelopeC4:30,envelopeC6:31,envelopeC65:32,envelopeB4:33,envelopeB5:34,envelopeB6:35,envelopeItaly:36,envelopeMonarch:37,envelopePersonal:38,fanfoldUS:39,fanfoldGermanStd:40,fanfoldGermanLegal:41,a6:70,japanesePostcard:43,japaneseDoublePostcard:69},Ck={};for(const[e,t]of Object.entries(xk))Ck[t]=e;const Bk={left:.7,right:.7,top:.75,bottom:.75,header:.3,footer:.3};function Ek(e){const t={};if(void 0!==e.rgb){const n=e.rgb;t.rgb=6===n.length?`FF${n}`:n}return void 0!==e.theme&&(t.theme=e.theme),void 0!==e.tint&&(t.tint=e.tint),void 0!==e.indexed&&(t.indexed=e.indexed),t}function kk(e){const t=[];return e.bold&&t.push(fw("b")),e.italic&&t.push(fw("i")),e.underline&&(!0===e.underline||"single"===e.underline?t.push(fw("u")):t.push(fw("u",{val:e.underline}))),e.strikethrough&&t.push(fw("strike")),e.vertAlign&&t.push(fw("vertAlign",{val:e.vertAlign})),void 0!==e.size&&t.push(fw("sz",{val:e.size})),e.color&&t.push(fw("color",Ek(e.color))),e.name&&t.push(fw("rFont",{val:e.name})),void 0!==e.family&&t.push(fw("family",{val:e.family})),void 0!==e.charset&&t.push(fw("charset",{val:e.charset})),e.scheme&&t.push(fw("scheme",{val:e.scheme})),t}function Sk(e,t){const n={type:e.type,priority:e.priority};e.style&&(n.dxfId=t.addDxf(e.style)),e.operator&&(n.operator=e.operator),e.stopIfTrue&&(n.stopIfTrue=!0),void 0!==e.text&&(n.text=e.text);const r=[];if(void 0!==e.formula){const t=Array.isArray(e.formula)?e.formula:[e.formula];for(const e of t)r.push(hw("formula",void 0,lw(e)))}if("colorScale"===e.type&&e.colorScale){const t=[];for(const n of e.colorScale.cfvo){const e={type:n.type};void 0!==n.value&&(e.val=n.value),t.push(fw("cfvo",e))}for(const n of e.colorScale.colors)t.push(fw("color",{rgb:n}));r.push(hw("colorScale",void 0,t))}if("dataBar"===e.type&&e.dataBar){const t=[];for(const n of e.dataBar.cfvo){const e={type:n.type};void 0!==n.value&&(e.val=n.value),t.push(fw("cfvo",e))}t.push(fw("color",{rgb:e.dataBar.color})),r.push(hw("dataBar",void 0,t))}if("iconSet"===e.type&&e.iconSet){const t={iconSet:e.iconSet.iconSet};e.iconSet.reverse&&(t.reverse=!0),!1===e.iconSet.showValue&&(t.showValue=!1);const n=[];for(const t of e.iconSet.cfvo){const e={type:t.type};void 0!==t.value&&(e.val=t.value),n.push(fw("cfvo",e))}r.push(hw("iconSet",t,n))}return r.length>0?hw("cfRule",n,r):fw("cfRule",n)}const Fk="http://schemas.microsoft.com/office/spreadsheetml/2009/9/main",Dk="http://schemas.microsoft.com/office/excel/2006/main",Nk="http://schemas.microsoft.com/office/spreadsheetml/2015/revision2",Mk="{05C60535-1F16-4fd2-B633-F4F36F0B64E0}";function Qk(e,t,n){const r=t.join(""),i=0===r.length?e.lastIndexOf("</worksheet>"):e.indexOf(r);if(i<0)return e.lastIndexOf("</worksheet>");let o=i;for(let e=0;e<n;e++)o+=t[e].length;return o}function Tk(e,t,n){if(!(e.size<qC||e.has(t)))throw new pb(`Sheet "${n??"?"}" has more than 16777216 filled cells, which is the most \`Sheet.cells\` can hold — a Map caps at 2^24 entries.\n - streamXlsxRows(input) reads it a row at a time and has no such bound.\nThe file is not damaged; it is larger than this model.`)}function Lk(e,t){if(void 0===e)return!1;const n=Number(e);return!(!Number.isFinite(n)||n<=0)&&(!t.dynamicArrayCm||t.dynamicArrayCm.has(n))}function Rk(e){let t=0,n=0;for(;t<e.length;){const r=e.charCodeAt(t);if(r>=65&&r<=90)n=26*n+(r-64),t++;else{if(!(r>=97&&r<=122))break;n=26*n+(r-96),t++}}n--;return{row:Number(e.slice(t))-1,col:n}}function Uk(e,t){const n=Number(e??"");if(Number.isNaN(n))return t;const r=Math.trunc(n);return r<1?t:Math.min(r,16384)}function Hk(e){const t=e.split(":"),n=Rk(t[0]),r=t.length>1?Rk(t[1]):n;return{startRow:n.row,startCol:n.col,endRow:r.row,endCol:r.col}}function qk(e,t){const n=[],r=new Map,i=[];let o,a=-1,s=-1,l=0,c=!1;t.range&&(o=Hk(t.range));const u=[],f=[],d=[];let h,p,g,m,y,v,A,b,w,I=!1,x=-1,C=[],B=!1,E=!1;const k=[],S=[];let F=!1,D=!1;const N=[];let M=!1,Q=!1,T=!1,L=!1,R=!1,U="",H="",q=!1,O="",P="",z=!1,$=!1,j=!1,V=!1,Y=!1,G=!1,W=!1,J="";const _=t.maxRows??0;let X=0;const K=new Map,Z=[];let ee,te,ne,re=!1,ie=!1,oe=!1,ae=!1,se=!1,le=!1,ce=!1,ue=!1,fe=!1,de=!1,he=!1,pe=!1,ge=!1,me=!1,ye="",ve="",Ae={},be=!1,we="",Ie=!1,xe={},Ce=!1,Be="",Ee=[],ke=!1,Se=[],Fe=[],De=!1,Ne=[],Me="",Qe=!1,Te={},Le=[],Re=!1,Ue=!1,He=!1,qe="",Oe=0,Pe=0,ze="",$e=-1,je="",Ve="",Ye="",Ge=-1,We="",Je=!1,_e="",Xe=[],Ke="";const Ze={onOpenTag(e,n){const r=e.includes(":")?e.slice(e.indexOf(":")+1):e;switch(r){case"cols":re=!0;break;case"col":if(re){const e=Uk(n.min,1),r=Uk(n.max,0),i=n.width?Number(n.width):void 0,o="1"===n.hidden||"true"===n.hidden,a=n.outlineLevel?Number(n.outlineLevel):void 0,s="1"===n.collapsed||"true"===n.collapsed,l="1"===n.bestFit||"true"===n.bestFit,c=void 0!==n.style?Number(n.style):void 0,u=t.readStyles&&t.styles&&void 0!==c&&c>=0?LE(t.styles,c):void 0;for(let t=e;t<=r;t++){const e=t-1;for(;Z.length<=e;)Z.push({});const n={};void 0===i||Number.isNaN(i)||(n.width=i),o&&(n.hidden=!0),void 0!==a&&!Number.isNaN(a)&&a>0&&(n.outlineLevel=a),s&&(n.collapsed=!0),l&&(n.autoWidth=!0),u&&Object.keys(u).length>0&&(n.style=zE(u)),Object.keys(n).length>0&&(Z[e]=n)}}break;case"sheetFormatPr":{const e=n.defaultRowHeight,t=n.defaultColWidth;if(void 0!==e){const t=Number(e);Number.isFinite(t)&&t>0&&15!==t&&(ee=t)}if(void 0!==t){const e=Number(t);Number.isFinite(e)&&e>0&&(te=e)}break}case"sheetData":ie=!0;break;case"row":if(ie){if(_>0&&X>=_)break;if(oe=!0,Oe=Number(n.r)||Oe+1,Pe=0,n.ht&&("1"===n.customHeight||"true"===n.customHeight)){const e=Number(n.r)-1,t=Number(n.ht);if(!Number.isNaN(e)&&!Number.isNaN(t)){const n=K.get(e)??{};n.height=t,K.set(e,n)}}if("1"===n.hidden||"true"===n.hidden){const e=Number(n.r)-1;if(!Number.isNaN(e)){const t=K.get(e)??{};t.hidden=!0,K.set(e,t)}}if(n.outlineLevel){const e=Number(n.r)-1,t=Number(n.outlineLevel);if(!Number.isNaN(e)&&!Number.isNaN(t)&&t>0){const n=K.get(e)??{};n.outlineLevel=t,K.set(e,n)}}if("1"===n.collapsed||"true"===n.collapsed){const e=Number(n.r)-1;if(!Number.isNaN(e)){const t=K.get(e)??{};t.collapsed=!0,K.set(e,t)}}}break;case"c":oe&&(ae=!0,qe=n.r??"",ze=n.t??"",$e=n.s?Number(n.s):-1,je="",Ve="",Ye="",Ge=-1,We="",Je=Lk(n.cm,t),_e="",Xe=[]);break;case"v":ae&&(se=!0);break;case"f":T?(L=!0,O=""):ae&&(le=!0,Ye=n.t??"",void 0!==n.si&&(Ge=Number(n.si)),n.ref&&(We=n.ref),void 0!==n.cm&&Lk(n.cm,t)&&(Je=!0));break;case"is":ae&&(ce=!0);break;case"t":ce&&!Re?ue=!0:Re&&(He=!0);break;case"r":ce&&(Re=!0,Ke="",ne=void 0);break;case"rPr":Re&&(Ue=!0,ne={});break;case"sheetPr":B=!0;break;case"outlinePr":if(B){const e={};void 0!==n.summaryBelow&&(e.summaryBelow="1"===n.summaryBelow||"true"===n.summaryBelow),void 0!==n.summaryRight&&(e.summaryRight="1"===n.summaryRight||"true"===n.summaryRight),Object.keys(e).length>0&&(m=e)}break;case"pageSetUpPr":B&&(E="1"===n.fitToPage||"true"===n.fitToPage);break;case"tabColor":B&&(g||(g={}),g.tabColor=function(e){const t={};if(e.rgb){const n=e.rgb;t.rgb=8===n.length?n.slice(2):n}e.theme&&(t.theme=Number(e.theme));e.tint&&(t.tint=Number(e.tint));e.indexed&&(t.indexed=Number(e.indexed));return t}(n));break;case"sheetView":if(!ie){if(g||(g={}),"0"!==n.showGridLines&&"false"!==n.showGridLines||(g.showGridLines=!1),"0"!==n.showRowColHeaders&&"false"!==n.showRowColHeaders||(g.showRowColHeaders=!1),n.zoomScale){const e=Number(n.zoomScale);Number.isNaN(e)||(g.zoomScale=e)}"1"!==n.rightToLeft&&"true"!==n.rightToLeft||(g.rightToLeft=!0)}break;case"pane":if(!ie){const e=n.state;if("frozen"===e||"frozenSplit"===e){const e=Number(n.xSplit||"0"),t=Number(n.ySplit||"0");(e>0||t>0)&&(y={},e>0&&(y.columns=e),t>0&&(y.rows=t))}else if("split"===e){const e=Number(n.xSplit||"0"),t=Number(n.ySplit||"0");(e>0||t>0)&&(v={},e>0&&(v.xSplit=e),t>0&&(v.ySplit=t))}}break;case"sheetProtection":p=function(e){const t={};"1"!==e.sheet&&"true"!==e.sheet||(t.sheet=!0);"1"!==e.objects&&"true"!==e.objects||(t.objects=!0);"1"!==e.scenarios&&"true"!==e.scenarios||(t.scenarios=!0);const n=[["selectLockedCells","selectLockedCells"],["selectUnlockedCells","selectUnlockedCells"],["formatCells","formatCells"],["formatColumns","formatColumns"],["formatRows","formatRows"],["insertColumns","insertColumns"],["insertRows","insertRows"],["insertHyperlinks","insertHyperlinks"],["deleteColumns","deleteColumns"],["deleteRows","deleteRows"],["sort","sort"],["autoFilter","autoFilter"],["pivotTables","pivotTables"]];for(const[r,i]of n){const n=e[r];void 0!==n&&(t[i]=!("1"===n||"true"===n))}return t}(n);break;case"autoFilter":n.ref&&(h={range:n.ref},I=!0);break;case"filterColumn":I&&void 0!==n.colId&&(x=Number(n.colId),C=[]);break;case"filter":I&&x>=0&&void 0!==n.val&&C.push(n.val);break;case"mergeCells":fe=!0;break;case"mergeCell":fe&&n.ref&&i.push(Hk(n.ref));break;case"hyperlinks":de=!0;break;case"hyperlink":if(de&&n.ref){const e={ref:n.ref},t=n["r:id"]??n["R:id"];t&&(e.rId=t),n.location&&(e.location=n.location),n.tooltip&&(e.tooltip=n.tooltip),n.display&&(e.display=n.display),u.push(e)}break;case"conditionalFormatting":be=!0,we=n.sqref??"";break;case"cfRule":be&&(Ie=!0,xe={...n},Ee=[],Se=[],Fe=[],Ne=[],Me="",Le=[],Te={});break;case"colorScale":Ie&&(ke=!0,Se=[],Fe=[]);break;case"cfvo":ke?Se.push({type:n.type??"min",value:n.val}):De?Ne.push({type:n.type??"min",value:n.val}):Qe&&Le.push({type:n.type??"min",value:n.val});break;case"dataBar":Ie&&(De=!0,Ne=[],Me="");break;case"iconSet":Ie&&(Qe=!0,Te={...n},Le=[]);break;case"dataValidations":he=!0;break;case"dataValidation":he&&(pe=!0,Ae={...n},ye="",ve="");break;case"formula1":pe&&(ge=!0);break;case"formula2":pe&&(me=!0);break;case"pageMargins":b=function(e){const t={};e.left&&(t.left=Number(e.left));e.right&&(t.right=Number(e.right));e.top&&(t.top=Number(e.top));e.bottom&&(t.bottom=Number(e.bottom));e.header&&(t.header=Number(e.header));e.footer&&(t.footer=Number(e.footer));return t}(n);break;case"pageSetup":A={...A,...Vk(n,t)};break;case"printOptions":A=function(e,t){const n=e??{},r=e=>"1"===e||"true"===e;r(t.gridLines)&&(n.showGridLines=!0);r(t.headings)&&(n.showRowColHeaders=!0);r(t.horizontalCentered)&&(n.horizontalCentered=!0);r(t.verticalCentered)&&(n.verticalCentered=!0);return n}(A,n);break;case"headerFooter":z=!0,w={},"1"!==n.differentOddEven&&"true"!==n.differentOddEven||(w.differentOddEven=!0),"1"!==n.differentFirst&&"true"!==n.differentFirst||(w.differentFirst=!0);break;case"oddHeader":z&&($=!0,J="");break;case"oddFooter":z&&(j=!0,J="");break;case"evenHeader":z&&(V=!0,J="");break;case"evenFooter":z&&(Y=!0,J="");break;case"firstHeader":z&&(G=!0,J="");break;case"firstFooter":z&&(W=!0,J="");break;case"rowBreaks":F=!0;break;case"colBreaks":D=!0;break;case"brk":if(F||D){const e=n.id;if(e){const t=Number(e)-1;F?k.push(t):S.push(t)}}break;case"color":ke?Fe.push(n.rgb??""):De?Me=n.rgb??"":Ue&&ne&&jk(ne,r,n);break;case"formula":Ie&&!pe&&(Ce=!0,Be="");break;case"sparklineGroups":M=!0;break;case"sparklineGroup":M&&(Q=!0,U=n.type??"line",H="",q="1"===n.markers||"true"===n.markers);break;case"colorSeries":if(Q){const e=n.rgb??"";H=8===e.length?e.slice(2):e}break;case"sparkline":Q&&(T=!0,O="",P="");break;default:if(T&&"sqref"===r){R=!0,P="";break}Ue&&ne&&jk(ne,r,n)}},onText(e){se?je+=e:le?Ve+=e:Ce?Be+=e:ue?_e+=e:He?Ke+=e:ge?ye+=e:me?ve+=e:$||j||V||Y||G||W?J+=e:L?O+=e:R&&(P+=e)},onCloseTag(e){const i=e.includes(":")?e.slice(e.indexOf(":")+1):e;switch(i){case"cols":re=!1;break;case"sheetData":ie=!1;break;case"row":oe&&X++,oe=!1;break;case"c":if(ae){const e=qe?Rk(qe).row:Oe-1,i=qe?Rk(qe).col:Pe;Pe=i+1;let u=!1;o&&(e<o.startRow||e>o.endRow||i<o.startCol||i>o.endCol)&&(u=!0);const f=""!==je||""!==_e||Xe.length>0||""!==Ve||"e"===ze||"inlineStr"===ze||t.readStyles&&$e>=0||!!(t.styles&&$e>=0)&&(t.styles.cellXfs[$e]?.hasCheckboxFeature??!1);!u&&f&&(!function(e,t,n,r,i,o,a,s,l,c,u,f,d,h,p,g){const m=""!==e?Rk(e):void 0!==p&&void 0!==g?{row:p,col:g}:null;if(!m)return;const{row:y,col:v}=m;if(y>UC||v>HC)throw new pb(`Cell reference "${e}" is outside the supported sheet bounds (max row 1048576, max col 16384)`);if(!Number.isInteger(y)||!Number.isInteger(v)||y<0||v<0)return void s.onWarning?.({code:"malformed-cell-ref",message:`Cell reference "${e}" is not a cell reference — a column needs a row number and rows are 1-based. The cell is dropped; the rest of the sheet is read.`,sheet:s.sheetName});if(!s.sparse){for(;l.length<=y;)l.push([]);for(;l[y].length<=v;)l[y].push(null)}let A,b,w,I=null,x="empty";i?A=i:"shared"===u&&void 0!==f&&f>=0&&(A="");switch(t){case"s":{const t=Number(r);if(!Number.isNaN(t)&&t>=0&&t<s.sharedStrings.length){const e=s.sharedStrings[t];I=e.text,e.richText&&e.richText.length>0?(w=e.richText,x="richText"):x="string"}else s.onWarning?.({code:"unresolved-shared-string",message:`Cell ${e||`${y},${v}`} points at shared string ${r}, which the file does not have (${s.sharedStrings.length} present). Read as empty.`,sheet:s.sheetName,row:y,col:v}),I=null,x="empty";break}case"str":I=Eb(r),x=A?"formula":"string",A&&(b=I);break;case"inlineStr":a&&a.length>0?(I=a.map(e=>e.text).join(""),w=a,x="richText"):(I=Eb(o),x="string");break;case"b":I="1"===r||"true"===r.toLowerCase(),x=A?"formula":"boolean",A&&(b=I);break;case"e":I=r,x=A?"formula":"error",A&&(b=I);break;case"d":{const e=function(e){const t=e.trim();if(!/^\d{4}-\d{2}-\d{2}([T ]\d{2}:\d{2}(:\d{2}(\.\d+)?)?(Z|[+-]\d{2}:?\d{2})?)?$/.test(t))return;const n=/(?:Z|[+-]\d{2}:?\d{2})$/.test(t),r=/[T ]\d{2}:/.test(t),i=t.replace(" ","T"),o=new Date(r&&!n?`${i}Z`:i);return Number.isNaN(o.getTime())?void 0:o}(r);e?(I=e,x="date"):""!==r?(I=r,x="string"):(I=null,x="empty"),A&&(b=I,x="formula");break}default:{if(""===r&&!A){I=null,x="empty";break}const e=Number(r);Number.isNaN(e)||""===r?""!==r&&(I=r,x="string"):s.styles&&n>=0&&RE(s.styles,n)?(I=function(e,t){if(t){const t=tE+Math.round(e*nE);return new Date(t)}if(60===e)return new Date(Date.UTC(1900,1,28));let n=e;e>60&&(n=e-1);const r=eE+Math.round(n*nE);return new Date(r)}(e,"1904"===s.dateSystem),x="date"):(I=e,x="number"),A&&(b=I,x="formula");break}}s.sparse||(l[y][v]=I);const C=!!(s.styles&&n>=0)&&(s.styles.cellXfs[n]?.hasCheckboxFeature??!1),B=s.sparse||void 0!==A||void 0!==w||s.readStyles&&s.styles&&n>=0||C||"error"===x||"formula"===x||"richText"===x;if(B){const t={value:I,type:x};if(C&&(t.checkbox=!0),void 0!==A&&(t.formula=A,void 0!==b&&(t.formulaResult=b),"shared"===u?(t.formulaType="shared",void 0!==f&&f>=0&&(t.formulaSharedIndex=f),d&&(t.formulaRef=d)):"array"===u&&(t.formulaType="array",d&&(t.formulaRef=d)),h&&(t.formulaDynamic=!0)),w&&(t.richText=w),s.readStyles&&s.styles&&n>=0){const r=LE(s.styles,n);Object.keys(r).length>0?t.style=r:n>=s.styles.cellXfs.length&&s.onWarning?.({code:"unresolved-style",message:`Cell ${e||`${y},${v}`} points at cell format ${n}, which the file does not have (${s.styles.cellXfs.length} present). Read unstyled.`,sheet:s.sheetName,row:y,col:v})}const r=`${y},${v}`;Tk(c,r,s.sheetName),c.set(r,t)}}(qe,ze,$e,je,Ve,_e,Xe.length>0?Xe:void 0,t,n,r,Ye,Ge,We,Je,e,i),e>=0&&i>=0&&(i>a&&(a=i),e>s&&(s=e),c=!0,l++)),ae=!1}break;case"v":se=!1;break;case"f":L?L=!1:le=!1;break;case"is":ce=!1;break;case"t":He?He=!1:ue&&(ue=!1);break;case"r":if(Re){const e=Eb(Ke);Xe.push(ne?{text:e,font:ne}:{text:e}),Re=!1}break;case"rPr":Ue=!1;break;case"sheetPr":B=!1;break;case"mergeCells":fe=!1;break;case"autoFilter":I=!1;break;case"filterColumn":I&&h&&x>=0&&C.length>0&&(h.columns||(h.columns=[]),h.columns.push({colIndex:x,filters:C})),x=-1,C=[];break;case"hyperlinks":de=!1;break;case"conditionalFormatting":be=!1;break;case"cfRule":if(Ie){const e=function(e,t,n,r,i,o,a,s,l,c,u){const f=e.type;if(!f||!$k.has(f))return null;if(!t)return null;const d={type:f,priority:Number(e.priority??"1"),range:t},h=e.operator;h&&zk.has(h)&&(d.operator=h);const p=Number(e.dxfId);if(c&&!Number.isNaN(p)){const e=c[p];e&&Object.keys(e).length>0?d.style=e:e||u?.onWarning?.({code:"unresolved-dxf",message:`Conditional rule on ${t} asks for differential format ${p}, which the file does not have (${c.length} present). The rule keeps its condition and loses its formatting.`,sheet:u.sheetName})}"1"!==e.stopIfTrue&&"true"!==e.stopIfTrue||(d.stopIfTrue=!0);void 0!==e.text&&(d.text=e.text);1===n.length?d.formula=n[0]:n.length>1&&(d.formula=n);"colorScale"===f&&r.length>0&&(d.colorScale={cfvo:r.map(e=>({type:e.type,value:e.value})),colors:i});"dataBar"===f&&o.length>0&&(d.dataBar={cfvo:o.map(e=>({type:e.type,value:e.value})),color:a});"iconSet"===f&&s.length>0&&(d.iconSet={iconSet:l.iconSet??"3TrafficLights1",cfvo:s.map(e=>({type:e.type,value:e.value}))},"1"!==l.reverse&&"true"!==l.reverse||(d.iconSet.reverse=!0),"0"!==l.showValue&&"false"!==l.showValue||(d.iconSet.showValue=!1));return d}(xe,we,Ee,Se,Fe,Ne,Me,Le,Te,t.styles?.dxfs,t);e&&d.push(e),Ie=!1}break;case"colorScale":ke=!1;break;case"dataBar":Ie&&(De=!1);break;case"iconSet":Qe=!1;break;case"formula":Ce&&(Ee.push(Be),Ce=!1);break;case"dataValidations":he=!1;break;case"dataValidation":if(pe){const e=function(e,t,n){const r=e.type;if(!r||!Pk.has(r))return null;const i=e.sqref;if(!i)return null;const o={type:r,range:i},a=e.operator;a&&zk.has(a)&&(o.operator=a);"1"!==e.allowBlank&&"true"!==e.allowBlank||(o.allowBlank=!0);"1"!==e.showInputMessage&&"true"!==e.showInputMessage||(o.showInputMessage=!0);"1"!==e.showErrorMessage&&"true"!==e.showErrorMessage||(o.showErrorMessage=!0);const s=e.errorStyle;"stop"!==s&&"warning"!==s&&"information"!==s||(o.errorStyle=s);e.promptTitle&&(o.inputTitle=e.promptTitle);e.prompt&&(o.inputMessage=e.prompt);e.errorTitle&&(o.errorTitle=e.errorTitle);e.error&&(o.errorMessage=e.error);if(t)if("list"===r){const e=t.trim();if(e.startsWith('"')&&e.endsWith('"')){const t=e.slice(1,-1);o.values=t.split(",")}else o.formula1=t}else o.formula1=t;n&&(o.formula2=n);return o}(Ae,ye,ve);e&&f.push(e),pe=!1}break;case"formula1":ge=!1;break;case"formula2":me=!1;break;case"headerFooter":z=!1;break;case"oddHeader":$&&w&&(w.oddHeader=J,$=!1);break;case"oddFooter":j&&w&&(w.oddFooter=J,j=!1);break;case"evenHeader":V&&w&&(w.evenHeader=J,V=!1);break;case"evenFooter":Y&&w&&(w.evenFooter=J,Y=!1);break;case"firstHeader":G&&w&&(w.firstHeader=J,G=!1);break;case"firstFooter":W&&w&&(w.firstFooter=J,W=!1);break;case"rowBreaks":F=!1;break;case"colBreaks":D=!1;break;case"sparklineGroups":M=!1;break;case"sparklineGroup":Q=!1;break;case"sparkline":if(T&&P){const e={location:P,dataRange:O};U&&"line"!==U&&(e.type=U),H&&(e.color=H),q&&(e.markers=!0),N.push(e)}T=!1;break;default:if(T&&"sqref"===i){R=!1;break}}}};return{handlers:Ze,finish:function(){if(c&&!t.sparse){const r=a+1,i=(s+1)*r,o=t.maxTotalCells??2e7;if(i>o)throw new pb(function(e,t,n,r,i,o){const a=i<=qC;return`Sheet "${e}" spans ${t} rows x ${n} columns (${r} cells, ${(r>0?100*i/r:100).toFixed(2)}% of them filled), over the ${o} limit.\n - streamXlsxRows(input) reads it a row at a time, whatever the box.\n`+(a?" - readXlsx(input, { sparse: true }) returns the cells and no grid.\n":` - \`sparse: true\` cannot help here: ${i} filled cells is past the 16777216 a Map can hold.\n`)+" - `range` or `maxRows` bound the area, if you know where the data is.\n - `maxTotalCells` raises the bound, if the sheet really is this large."}(e,s+1,r,i,l,o));for(let e=0;e<=s;e++)if(n[e])for(;n[e].length<r;)n[e].push(null);else n[e]=Array.from({length:r},()=>null)}const o=new Map;if(t.worksheetRels)for(const e of t.worksheetRels)o.set(e.id,e.target);for(const i of u){const a=Rk(i.ref),s=`${a.row},${a.col}`;let l=r.get(s);l||(l={value:(n[a.row]&&n[a.row][a.col])??null,type:"string"},Tk(r,s,e),r.set(s,l));const c={target:""};if(i.location)c.location=i.location,c.target=i.location;else if(i.rId){const e=o.get(i.rId);e?c.target=e:t.onWarning?.({code:"unresolved-hyperlink",message:`Cell ${i.ref} links through ${i.rId}, which the sheet's relationships do not define. Read with an empty target.`,sheet:t.sheetName,row:a.row,col:a.col})}i.tooltip&&(c.tooltip=i.tooltip),i.display&&(c.display=i.display),l.hyperlink=c}const I={name:e,rows:n};if(r.size>0&&(I.cells=r),void 0!==ee&&(I.defaultRowHeight=ee),void 0!==te&&(I.defaultColWidth=te),Z.some(e=>Object.keys(e).length>0)&&(I.columns=Z),i.length>0&&(I.merges=i),f.length>0&&(I.dataValidations=f),d.length>0&&(I.conditionalRules=d),h&&(I.autoFilter=h),y&&(I.freezePane=y),v&&(I.splitPane=v),p&&(I.protection=p),g&&Object.keys(g).length>0&&(I.view=g),A||b||E){const e=A??{};b&&(e.margins=b),E&&(e.fitToPage=!0),I.pageSetup=e}return w&&Object.keys(w).length>0&&(I.headerFooter=w),k.length>0&&(I.rowBreaks=k.sort((e,t)=>e-t)),S.length>0&&(I.colBreaks=S.sort((e,t)=>e-t)),K.size>0&&(I.rowDefs=K),N.length>0&&(I.sparklines=N),m&&(I.outlineProperties=m),I}}}async function Ok(e,t,n){const{handlers:r,finish:i}=qk(t,n);return await async function(e,t,n){const r=n?.strict??!1,i=e.getReader(),o=new TextDecoder("utf-8");let a="",s=!1;try{for(;;){const{done:e,value:n}=await i.read();if(e)break;a+=o.decode(n,{stream:!0}),s||(65279===a.charCodeAt(0)&&(a=a.slice(1)),s=!0),a=Tb(a,t,!1,r)}a+=o.decode(),a.length>0&&Tb(a,t,!0,r)}finally{try{await i.cancel()}catch{}try{i.releaseLock()}catch{}}}(e,r,{strict:!0}),i()}const Pk=new Set(["list","whole","decimal","date","time","textLength","custom"]),zk=new Set(["between","notBetween","equal","notEqual","greaterThan","lessThan","greaterThanOrEqual","lessThanOrEqual"]);const $k=new Set(["cellIs","expression","colorScale","dataBar","iconSet","top10","aboveAverage","duplicateValues","uniqueValues","containsText","notContainsText","beginsWith","endsWith","containsBlanks","notContainsBlanks"]);function jk(e,t,n){switch(t){case"b":e.bold="0"!==n.val&&"false"!==n.val;break;case"i":e.italic="0"!==n.val&&"false"!==n.val;break;case"u":{const t=n.val;e.underline="double"!==t||"double";break}case"strike":e.strikethrough="0"!==n.val&&"false"!==n.val;break;case"sz":n.val&&(e.size=Number(n.val));break;case"rFont":n.val&&(e.name=n.val);break;case"color":if(e.color={},n.rgb){const t=n.rgb;e.color.rgb=8===t.length?t.slice(2):t}n.theme&&(e.color.theme=Number(n.theme)),n.tint&&(e.color.tint=Number(n.tint)),n.indexed&&(e.color.indexed=Number(n.indexed));break;case"vertAlign":"superscript"!==n.val&&"subscript"!==n.val||(e.vertAlign=n.val);break;case"family":n.val&&(e.family=Number(n.val));break;case"charset":n.val&&(e.charset=Number(n.val));break;case"scheme":"major"!==n.val&&"minor"!==n.val&&"none"!==n.val||(e.scheme=n.val)}}function Vk(e,t){const n={};if(e.paperSize){const r=Number(e.paperSize);Number.isInteger(r)&&r>0?n.paperSize=Ck[r]??r:t?.onWarning?.({code:"unusable-paper-size",message:`Page setup names paper size "${e.paperSize}", which is not a positive integer code. Dropped; the sheet reads with no paper size set.`,sheet:t.sheetName})}"landscape"!==e.orientation&&"portrait"!==e.orientation||(n.orientation=e.orientation),e.scale&&(n.scale=Number(e.scale)),void 0===e.fitToWidth&&void 0===e.fitToHeight||(n.fitToPage=!0,e.fitToWidth&&(n.fitToWidth=Number(e.fitToWidth)),e.fitToHeight&&(n.fitToHeight=Number(e.fitToHeight))),"1"!==e.horizontalCentered&&"true"!==e.horizontalCentered||(n.horizontalCentered=!0),"1"!==e.verticalCentered&&"true"!==e.verticalCentered||(n.verticalCentered=!0),e.paperWidth&&(n.paperWidth=e.paperWidth),e.paperHeight&&(n.paperHeight=e.paperHeight);const r=Gk(e.firstPageNumber);void 0!==r&&(n.firstPageNumber=r),void 0!==e.useFirstPageNumber&&(n.useFirstPageNumber=Yk(e.useFirstPageNumber)),"overThenDown"!==e.pageOrder&&"downThenOver"!==e.pageOrder||(n.pageOrder=e.pageOrder),Yk(e.blackAndWhite)&&(n.blackAndWhite=!0),Yk(e.draft)&&(n.draft=!0);const i=e.cellComments;"none"!==i&&"asDisplayed"!==i&&"atEnd"!==i||(n.cellComments=i);const o=e.errors;"displayed"!==o&&"blank"!==o&&"dash"!==o&&"NA"!==o||(n.errors=o);const a=Gk(e.copies);void 0!==a&&(n.copies=a);const s=Gk(e.horizontalDpi);void 0!==s&&(n.horizontalDpi=s);const l=Gk(e.verticalDpi);return void 0!==l&&(n.verticalDpi=l),void 0!==e.usePrinterDefaults&&(n.usePrinterDefaults=Yk(e.usePrinterDefaults)),n}function Yk(e){return"1"===e||"true"===e}function Gk(e){if(void 0===e)return;const t=Number(e);return Number.isInteger(t)&&t>=0?t:void 0}function Wk(e){const t=new Map,n=[];let r=!1,i=!1,o=!1,a=!1,s=!1,l=!1,c="",u="",f=-1,d="";return Fb(e,{onOpenTag(e,t){switch(e.includes(":")?e.slice(e.indexOf(":")+1):e){case"authors":r=!0;break;case"author":r&&(i=!0,c="");break;case"commentList":o=!0;break;case"comment":o&&(a=!0,u=t.ref??"",f=t.authorId?Number(t.authorId):-1,d="");break;case"text":a&&(s=!0);break;case"r":break;case"t":s&&(l=!0)}},onText(e){i?c+=e:l&&(d+=e)},onCloseTag(e){switch(e.includes(":")?e.slice(e.indexOf(":")+1):e){case"authors":r=!1;break;case"author":i&&(n.push(c),i=!1);break;case"commentList":o=!1;break;case"comment":if(a&&u){const e={text:d};if(f>=0&&f<n.length){const t=n[f];t&&(e.author=t)}t.set(u,e),a=!1}break;case"text":s=!1;break;case"r":break;case"t":l=!1}}}),t}function Jk(e,t){for(const n of e.children){if("string"==typeof n)continue;if((n.local||n.tag)===t){return n.children.filter(e=>"string"==typeof e).join("")||void 0}}}function _k(e){if(e)return function(e){const t=e.trim(),n=t.indexOf("T"),r=n>=0&&/(?:Z|[+-]\d{2}:?\d{2})$/.test(t.slice(n+1)),i=new Date(n>=0&&!r?`${t}Z`:t);return Number.isNaN(i.getTime())?void 0:i}(e)}const Xk=["dk1","lt1","dk2","lt2","accent1","accent2","accent3","accent4","accent5","accent6","hlink","folHlink"];function Kk(e,t){return e===`http://schemas.openxmlformats.org/officeDocument/2006/relationships/${t}`||e===`http://purl.oclc.org/ooxml/officeDocument/relationships/${t}`||e.endsWith("/"+t)}function Zk(e,t="(unknown)"){return Ib(e,t)}async function eS(e,t,n,r){const i=e.declaredSize(t);if(void 0===i||i<=bb)try{return function(e,t,n){const{handlers:r,finish:i}=qk(t,n);return Fb(e,r),i()}(Zk(await e.extract(t),t),n,r)}catch(e){if(!function(e){return e instanceof wb}(e))throw e}return Ok(e.extractStream(t),n,r)}async function tS(e,t){let n,r=await PC(e,t?.maxInputBytes);if(function(e){if(e.length<OC.length)return!1;for(let t=0;t<OC.length;t++)if(e[t]!==OC[t])return!1;return!0}(r)){if(!t?.password)throw new vb("xlsx");r=await rB(r,t.password,t.maxSpinCount)}try{n=new _B(r,t?.maxDecompressedBytes)}catch(e){if(e instanceof gb)throw e;throw new pb("Failed to open XLSX file: not a valid ZIP archive",void 0,{cause:e})}if(!n.has("[Content_Types].xml"))throw new pb("Invalid XLSX: missing [Content_Types].xml");if(function(e){const t=Lb(e),n=new Map,r=new Map;for(const e of t.children){if("string"==typeof e)continue;const t=e.local||e.tag;if("Default"===t){const t=e.attrs.Extension,r=e.attrs.ContentType;t&&r&&n.set(t,r)}else if("Override"===t){const t=e.attrs.PartName,n=e.attrs.ContentType;t&&n&&r.set(t,n)}}}(Zk(await n.extract("[Content_Types].xml"),"[Content_Types].xml")),!n.has("_rels/.rels"))throw new pb("Invalid XLSX: missing _rels/.rels");const i=zb(Zk(await n.extract("_rels/.rels"),"_rels/.rels")).find(e=>Kk(e.type,"officeDocument"));if(!i)throw new pb("Invalid XLSX: cannot find workbook relationship in _rels/.rels");const o=i.target.startsWith("/")?i.target.slice(1):i.target,a=jb(o),s=a?`${a}/_rels/${o.slice(a.length+1)}.rels`:`_rels/${o}.rels`;let l=[];if(n.has(s)){l=zb(Zk(await n.extract(s),s))}if(!n.has(o))throw new pb(`Invalid XLSX: missing workbook at ${o}`);const c=Zk(await n.extract(o),o),{sheets:u,dateSystem:f,namedRanges:d,workbookProtection:h,activeSheet:p,pivotCacheRefs:g}=function(e,t){const n=Lb(e),r=[],i=[],o=[];let a,s,l="1900";"1904"===t?.dateSystem?l="1904":"1900"===t?.dateSystem&&(l="1900");for(const e of n.children){if("string"==typeof e)continue;const n=e.local||e.tag;if("workbookPr"===n&&("1"!==e.attrs.date1904&&"true"!==e.attrs.date1904||t?.dateSystem&&"auto"!==t.dateSystem||(l="1904")),"workbookProtection"===n){const t="1"===e.attrs.lockStructure||"true"===e.attrs.lockStructure,n="1"===e.attrs.lockWindows||"true"===e.attrs.lockWindows;(t||n)&&(a={},t&&(a.lockStructure=!0),n&&(a.lockWindows=!0))}if("bookViews"===n)for(const t of e.children){if("string"==typeof t)continue;if("workbookView"!==(t.local||t.tag))continue;const e=Number(t.attrs.activeTab);Number.isInteger(e)&&e>0&&void 0===s&&(s=e)}if("sheets"===n)for(const t of e.children){if("string"==typeof t)continue;if("sheet"===(t.local||t.tag)){const e=t.attrs.name??"",n=Number(t.attrs.sheetId??"0"),i=t.attrs["r:id"]??t.attrs["R:id"]??Vb(t.attrs)??"",o=t.attrs.state;let a="visible";"hidden"===o?a="hidden":"veryHidden"===o&&(a="veryHidden"),e&&i&&r.push({name:e,sheetId:n,rId:i,state:a})}}if("pivotCaches"===n)for(const t of e.children){if("string"==typeof t)continue;if("pivotCache"===(t.local||t.tag)){const e=t.attrs.cacheId,n=void 0===e?NaN:Number(e),r=t.attrs["r:id"]??t.attrs["R:id"]??Vb(t.attrs)??"";r&&!Number.isNaN(n)&&o.push({cacheId:n,rId:r})}}}for(const e of n.children){if("string"==typeof e)continue;if("definedNames"===(e.local||e.tag))for(const t of e.children){if("string"==typeof t)continue;if("definedName"===(t.local||t.tag)){const e=t.attrs.name??"",n=t.children.filter(e=>"string"==typeof e).join("");if(e&&n){const o={name:e,range:n},a=t.attrs.localSheetId;if(void 0!==a){const e=Number(a);e>=0&&e<r.length&&(o.scope=r[e].name)}t.attrs.comment&&(o.comment=t.attrs.comment),i.push(o)}}}}return{sheets:r,dateSystem:l,namedRanges:i,workbookProtection:a,activeSheet:s,pivotCacheRefs:o}}(c,t);let m=[];const y=l.find(e=>Kk(e.type,"sharedStrings"));if(y){const e=$b(a,y.target);if(n.has(e)){m=function(e){const t=Lb(e),n=[];for(const e of t.children)"string"!=typeof e&&"si"===(e.local||e.tag)&&n.push(XB(e));return n}(Zk(await n.extract(e),e))}}let v=null;const A=l.find(e=>Kk(e.type,"styles"));if(A){const e=$b(a,A.target);if(n.has(e)){v=gE(Zk(await n.extract(e),e))}}let b;const w=a?`${a}/theme/theme1.xml`:"theme/theme1.xml";if(n.has(w)){b=function(e){const t=new Map;let n=!1,r="";return Fb(e,{onOpenTag(e,i){if("clrScheme"===e||"a:clrScheme"===e)return void(n=!0);if(!n)return;const o=e.includes(":")?e.split(":").pop():e;Xk.includes(o)?r=o:r&&("srgbClr"===o&&i.val?t.set(r,i.val.toUpperCase()):"sysClr"===o&&i.lastClr&&t.set(r,i.lastClr.toUpperCase()))},onCloseTag(e){const t=e.includes(":")?e.split(":").pop():e;"clrScheme"===t&&(n=!1),r&&Xk.includes(t)&&(r="")}}),Xk.map(e=>t.get(e)??"000000")}(Zk(await n.extract(w),w))}let I;const x=l.find(e=>Kk(e.type,"person"));if(x){const e=$b(a,x.target);if(n.has(e)){I=function(e){const t=Lb(e),n=[];for(const e of Ub(t)){if("person"!==e.local)continue;const t=e.attrs.id,r=e.attrs.displayName;if(!t||void 0===r)continue;const i={id:t,displayName:r};e.attrs.userId&&(i.userId=e.attrs.userId),e.attrs.providerId&&(i.providerId=e.attrs.providerId),n.push(i)}return n}(Zk(await n.extract(e),e))}}const C=l.filter(e=>Kk(e.type,"externalLink")).sort((e,t)=>rS(e.id)-rS(t.id)),B=[];for(const e of C){const t=$b(a,e.target);if(!n.has(t))continue;const r=Zk(await n.extract(t),t),i=iS(t),o=n.has(i)?Zk(await n.extract(i),i):void 0;B.push(Gb(r,o))}let E;const k=l.find(e=>"http://www.wps.cn/officeDocument/2017/relationships/cellimage"===e.type);if(k){const e=$b(a,k.target);if(n.has(e)){const t=function(e){const t=Lb(e),n=[];for(const e of Ub(t)){if("cellImage"!==e.local)continue;const t=Jb(e);t&&n.push(t)}return n}(Zk(await n.extract(e),e)),r=iS(e),i=jb(e),o=new Map;if(n.has(r)){const e=Zk(await n.extract(r),r);for(const t of zb(e)){if(!Kk(t.type,"image"))continue;const e=$b(i,t.target);if(!n.has(e))continue;const r=e.split(".").pop()?.toLowerCase()??"",a=oS[r];a&&o.set(t.id,{data:await n.extract(e),type:a})}}const a=function(e,t){const n=[],r=new Set;for(const i of e){if(r.has(i.id))continue;const e=t.get(i.embedRId);if(!e)continue;const o={id:i.id,data:e.data,type:e.type};i.description&&(o.description=i.description),n.push(o),r.add(i.id)}return n}(t,o);a.length>0&&(E=a)}}const S=new Map,F=new Map;for(const e of g){const t=l.find(t=>t.id===e.rId);if(!t)continue;const r=$b(a,t.target);if(!n.has(r))continue;const i=_b(Zk(await n.extract(r),r));if(!i)continue;i.cacheId=e.cacheId;const o=iS(r);if(n.has(o)){zb(Zk(await n.extract(o),o)).some(e=>Kk(e.type,"pivotCacheRecords"))&&(i.hasRecords=!0)}S.set(e.cacheId,i),F.set(e.rId,i)}const D=g.map(e=>S.get(e.cacheId)).filter(e=>void 0!==e),N=l.filter(e=>Kk(e.type,"slicerCache")).sort((e,t)=>nS(e.target)-nS(t.target)),M=[];for(const e of N){const t=$b(a,e.target);if(!n.has(t))continue;const r=tw(Zk(await n.extract(t),t));r&&M.push(r)}const Q=l.filter(e=>Kk(e.type,"timelineCache")).sort((e,t)=>nS(e.target)-nS(t.target)),T=[];for(const e of Q){const t=$b(a,e.target);if(!n.has(t))continue;const r=rw(Zk(await n.extract(t),t));r&&T.push(r)}let L;const R=l.find(e=>Kk(e.type,"sheetMetadata"));if(R){const e=$b(a,R.target);n.has(e)&&(L=function(e){const t=new Set,n=Lb(e),r="metadata"===n.local?n:Rb(n,"metadata");if(!r)return t;const i=[],o=Rb(r,"metadataTypes");if(o)for(const e of Ub(o))"metadataType"===e.local&&i.push(e.attrs.name??"");const a=new Map;for(const e of Ub(r)){if("futureMetadata"!==e.local)continue;const t=e.attrs.name??"",n=a.get(t)??[];for(const t of Ub(e))"bk"===t.local&&n.push(tk(t));a.set(t,n)}const s=Rb(r,"cellMetadata");if(!s)return t;let l=0;for(const e of Ub(s))if("bk"===e.local){l++;for(const n of Ub(e)){if("rc"!==n.local)continue;if(i[Ob(n.attrs.t,0)-1]!==KE)continue;const e=a.get(KE),r=Ob(n.attrs.v,-1);(!e||r<0||r>=e.length||e[r])&&t.add(l)}}return t}(Zk(await n.extract(e),e)))}const U=new Map,H=new Map;for(const e of l)Kk(e.type,"worksheet")?U.set(e.id,$b(a,e.target)):Kk(e.type,"chartsheet")?H.set(e.id,"chartsheet"):Kk(e.type,"dialogsheet")&&H.set(e.id,"dialogsheet");const q=function(e,t){if(void 0===t)return e;if("function"==typeof t){const n=[];for(let r=0;r<e.length;r++){const i=e[r];t({name:i.name,index:r,hidden:"hidden"===i.state,veryHidden:"veryHidden"===i.state},r)&&n.push(i)}return n}if(0===t.length)return e;const n=[];for(const r of t)if("number"==typeof r)r>=0&&r<e.length&&n.push(e[r]);else{const t=e.find(e=>e.name===r);t&&n.push(t)}return n}(u,t?.sheets),O=t?.readStyles??!1,P=[];for(const e of q){const r=H.get(e.rId);if(void 0!==r){const t={name:e.name,rows:[],kind:r};"hidden"===e.state&&(t.hidden=!0),"veryHidden"===e.state&&(t.veryHidden=!0),P.push(t);continue}const i=U.get(e.rId);if(!i||!n.has(i))throw new pb(`Invalid XLSX: missing worksheet file for sheet "${e.name}"`);const o=jb(i),s=iS(i);let c;if(n.has(s)){c=zb(Zk(await n.extract(s),s))}const u={sharedStrings:m,styles:v,readStyles:O,dateSystem:f,worksheetRels:c,maxRows:t?.maxRows,range:t?.range,maxTotalCells:t?.maxTotalCells,sparse:t?.sparse,dynamicArrayCm:L,sheetName:e.name,onWarning:t?.onWarning},d=await eS(n,i,e.name,u);if("hidden"===e.state&&(d.hidden=!0),"veryHidden"===e.state&&(d.veryHidden=!0),c){const e=c.find(e=>Kk(e.type,"drawing"));if(e){const t=$b(o,e.target),r=await aS(n,t);if(r.images.length>0&&(d.images=r.images),r.textBoxes.length>0&&(d.textBoxes=r.textBoxes),r.chartRefs.length>0){const e=[];for(const t of r.chartRefs){if(!n.has(t.path))continue;const r=TC(Zk(await n.extract(t.path),t.path));r&&(t.anchor&&(r.anchor=t.anchor),t.altText&&(r.altText=t.altText),t.frameTitle&&(r.frameTitle=t.frameTitle),e.push(r))}e.length>0&&(d.charts=e)}}}if(c){const e=c.find(e=>Kk(e.type,"comments"));if(e){const t=$b(o,e.target);if(n.has(t)){const e=Wk(Zk(await n.extract(t),t));if(e.size>0){d.cells||(d.cells=new Map);for(const[t,n]of e){const e=Rk(t),r=`${e.row},${e.col}`;let i=d.cells.get(r);i||(i={value:(d.rows[e.row]&&d.rows[e.row][e.col])??null,type:"string"},d.cells.set(r,i)),i.comment=n}}}}const t=c.find(e=>Kk(e.type,"threadedComment"));if(t){const e=$b(o,t.target);if(n.has(e)){const t=Pb(Zk(await n.extract(e),e));t.length>0&&(d.threadedComments=t)}}}if(c){const e=c.filter(e=>Kk(e.type,"table"));if(e.length>0){const t=[];for(const r of e){const e=$b(o,r.target);if(n.has(e)){const r=wS(Zk(await n.extract(e),e));r&&t.push(r)}}t.length>0&&(d.tables=t)}}if(c){const e=c.find(e=>Kk(e.type,"image"));if(e){const t=$b(o,e.target);n.has(t)&&(d.backgroundImage=await n.extract(t))}}if(c){const e=c.filter(e=>Kk(e.type,"pivotTable"));if(e.length>0){const t=[];for(const r of e){const e=$b(o,r.target);if(!n.has(e))continue;const i=Xb(Zk(await n.extract(e),e));if(!i)continue;const s=iS(e);if(n.has(s)){const t=zb(Zk(await n.extract(s),s)).find(e=>Kk(e.type,"pivotCacheDefinition"));if(t){const n=$b(jb(e),t.target);for(const e of g){const t=l.find(t=>t.id===e.rId);if(!t)continue;if($b(a,t.target)===n){i.cacheId=e.cacheId;break}}}}const c=S.get(i.cacheId);c&&Kb(i,c),t.push(i)}t.length>0&&(d.pivotTables=t)}const t=c.filter(e=>Kk(e.type,"slicer"));if(t.length>0){const e=[];for(const r of t){const t=$b(o,r.target);if(!n.has(t))continue;const i=Zk(await n.extract(t),t);for(const t of ew(i))e.push(t)}e.length>0&&(d.slicers=e)}const r=c.filter(e=>Kk(e.type,"timeline"));if(r.length>0){const e=[];for(const t of r){const r=$b(o,t.target);if(!n.has(r))continue;const i=Zk(await n.extract(r),r);for(const t of nw(i))e.push(t)}e.length>0&&(d.timelines=e)}}P.push(d)}let z;if(n.has("docProps/core.xml")){const e=function(e){const t=Lb(e),n={};for(const e of t.children){if("string"==typeof e)continue;const t=e.local||e.tag,r=e.children.filter(e=>"string"==typeof e).join("");switch(t){case"title":r&&(n.title=r);break;case"subject":r&&(n.subject=r);break;case"creator":r&&(n.creator=r);break;case"keywords":r&&(n.keywords=r);break;case"description":r&&(n.description=r);break;case"lastModifiedBy":r&&(n.lastModifiedBy=r);break;case"category":r&&(n.category=r);break;case"created":if(r){const e=_k(r);e&&(n.created=e)}break;case"modified":if(r){const e=_k(r);e&&(n.modified=e)}}}return n}(Zk(await n.extract("docProps/core.xml"),"docProps/core.xml"));Object.keys(e).length>0&&(z={...e})}if(n.has("docProps/app.xml")){const e=function(e){const t=Lb(e),n={},r=Jk(t,"Company");r&&(n.company=r);const i=Jk(t,"Manager");return i&&(n.manager=i),n}(Zk(await n.extract("docProps/app.xml"),"docProps/app.xml"));Object.keys(e).length>0&&(z={...z,...e})}if(n.has("docProps/custom.xml")){const e=function(e){const t=Lb(e),n={};for(const e of t.children){if("string"==typeof e)continue;if("property"!==(e.local||e.tag))continue;const t=e.attrs.name;if(t)for(const r of e.children){if("string"==typeof r)continue;const e=r.local||r.tag,i=r.children.filter(e=>"string"==typeof e).join("");switch(e){case"lpwstr":n[t]=i;break;case"i4":case"i8":case"int":i&&(n[t]=parseInt(i,10));break;case"r8":case"decimal":i&&(n[t]=parseFloat(i));break;case"bool":n[t]="true"===i||"1"===i;break;case"filetime":case"date":if(i){const e=new Date(i);Number.isNaN(e.getTime())||(n[t]=e)}}break}}return n}(Zk(await n.extract("docProps/custom.xml"),"docProps/custom.xml"));Object.keys(e).length>0&&(z||(z={}),z.custom=e)}const $={sheets:P,dateSystem:f},j=function(e,t){if(0===t.length)return t;const n=new Map;for(const t of e)n.set(t.name,t);const r=[];for(const e of t){const t="_xlnm.Print_Area"===e.name,i="_xlnm.Print_Titles"===e.name,o=void 0!==e.scope?n.get(e.scope):void 0;if(!t&&!i||!o){r.push(e);continue}const a=o.pageSetup??(o.pageSetup={});if(t){const t=e.range.split(",").map(bS).filter(e=>e.length>0).join(",");t&&(a.printArea=t)}else for(const t of e.range.split(",")){const e=bS(t);e&&(/\d/.test(e)?a.printTitlesRow=e:a.printTitlesColumn=e)}}return r}(P,d);j.length>0&&($.namedRanges=j),z&&($.properties=z),b&&($.themeColors=b),h&&($.workbookProtection=h),void 0!==p&&($.activeSheet=p);const V=v?.fonts[0];return V&&Object.keys(V).length>0&&($.defaultFont=V),I&&I.length>0&&($.persons=I),B.length>0&&($.externalLinks=B),E&&E.length>0&&($.cellImages=E),D.length>0&&($.pivotCaches=D),M.length>0&&($.slicerCaches=M),T.length>0&&($.timelineCaches=T),$}function nS(e){const t=e.match(/(\d+)\.xml$/i);return t?parseInt(t[1],10):Number.POSITIVE_INFINITY}function rS(e){const t=e.match(/(\d+)$/);return t?parseInt(t[1],10):Number.POSITIVE_INFINITY}function iS(e){const t=e.lastIndexOf("/");return-1===t?`_rels/${e}.rels`:`${e.slice(0,t)}/_rels/${e.slice(t+1)}.rels`}const oS={png:"png",jpg:"jpeg",jpeg:"jpeg",gif:"gif",svg:"svg",webp:"webp"};async function aS(e,t){if(!e.has(t))return{images:[],textBoxes:[],chartRefs:[]};const n=Zk(await e.extract(t),t),r=jb(t),i=iS(t),o=new Map,a=new Map;if(e.has(i)){const t=zb(Zk(await e.extract(i),i));for(const e of t)Kk(e.type,"image")?o.set(e.id,$b(r,e.target)):Kk(e.type,"chart")&&a.set(e.id,$b(r,e.target))}const s=Lb(n),l=[],c=[],u=[];for(const t of s.children){if("string"==typeof t)continue;const n=t.local||t.tag;if("twoCellAnchor"===n||"oneCellAnchor"===n||"absoluteAnchor"===n){const e=lS(t);if(e){const r=a.get(e);if(r&&!u.some(e=>e.path===r)){const e="absoluteAnchor"===n?void 0:sS(t,n),i={path:r};e&&(i.anchor=e);const o=dS(t,"graphicFrame");if(o){const e=mS(o,"nvGraphicFramePr");e.altText&&(i.altText=e.altText),e.title&&(i.frameTitle=e.title)}u.push(i)}}}if("twoCellAnchor"===n){const n=fS(t);if(n){c.push(n);continue}const r=cS(t,o);if(r){const t=r.mediaPath;if(e.has(t)){const n={data:await e.extract(t),type:r.type,anchor:r.anchor};void 0!==r.width&&(n.width=r.width),void 0!==r.height&&(n.height=r.height),void 0!==r.altText&&(n.altText=r.altText),void 0!==r.title&&(n.title=r.title),l.push(n)}}}else if("oneCellAnchor"===n){const n=gS(t,o);if(n){const t=n.mediaPath;if(e.has(t)){const r={data:await e.extract(t),type:n.type,anchor:n.anchor};void 0!==n.width&&(r.width=n.width),void 0!==n.height&&(r.height=n.height),void 0!==n.altText&&(r.altText=n.altText),void 0!==n.title&&(r.title=n.title),l.push(r)}}}}return{images:l,textBoxes:c,chartRefs:u}}function sS(e,t){let n,r;for(const t of e.children){if("string"==typeof t)continue;const e=t,i=e.local||e.tag;"from"===i?n=yS(e):"to"===i&&(r=yS(e))}if(n)return"twoCellAnchor"===t&&r?{from:n,to:r}:{from:n}}function lS(e){for(const t of e.children){if("string"==typeof t)continue;const e=t;if("chart"===(e.local||e.tag)){const t=e.attrs["r:id"]??e.attrs.id;if(t)return t}const n=lS(e);if(n)return n}}function cS(e,t){let n,r,i,o,a=0,s=0,l=0,c=0;for(const t of e.children){if("string"==typeof t)continue;const e=t,u=e.local||e.tag;if("from"===u){const t=yS(e);a=t.row,s=t.col}else if("to"===u){const t=yS(e);l=t.row,c=t.col}else if("pic"===u){n=vS(e);const t=mS(e,"nvPicPr");r=t.altText,i=t.title,o=uS(e)}}if(!n)return null;const u=t.get(n);if(!u)return null;const f=u.split(".").pop()?.toLowerCase()??"",d={mediaPath:u,type:oS[f]??"png",anchor:{from:{row:a,col:s},to:{row:l,col:c}}};return o&&(d.width=o.width,d.height=o.height),r&&(d.altText=r),i&&(d.title=i),d}function uS(e){const t=dS(e,"spPr");if(!t)return;const n=dS(t,"xfrm");if(!n)return;const r=dS(n,"ext");if(!r)return;const i=Number(r.attrs.cx),o=Number(r.attrs.cy);return i>0&&o>0?{width:Math.round(i/pS),height:Math.round(o/pS)}:void 0}function fS(e){let t=0,n=0,r=0,i=0,o=null;for(const a of e.children){if("string"==typeof a)continue;const e=a,s=e.local||e.tag;if("from"===s){const r=yS(e);t=r.row,n=r.col}else if("to"===s){const t=yS(e);r=t.row,i=t.col}else if("sp"===s){const t=dS(e,"nvSpPr");if(t){const n=dS(t,"cNvSpPr");!n||"1"!==n.attrs.txBox&&"true"!==n.attrs.txBox||(o=e)}}}if(!o)return null;const a=dS(o,"txBody");let s,l,c,u,f,d="";if(a){const e=[];for(const t of a.children){if("string"==typeof t)continue;if("p"===(t.local||t.tag)){const n=hS(t);e.push(n.text),void 0!==n.fontSize&&void 0===s&&(s=n.fontSize),void 0!==n.bold&&void 0===l&&(l=n.bold),void 0!==n.color&&void 0===c&&(c=n.color)}}d=e.join("\n")}if(!d)return null;const h=dS(o,"spPr");if(h){const e=dS(h,"solidFill");if(e){const t=dS(e,"srgbClr");t&&t.attrs.val&&(u=t.attrs.val)}const t=dS(h,"ln");if(t){const e=dS(t,"solidFill");if(e){const t=dS(e,"srgbClr");t&&t.attrs.val&&(f=t.attrs.val)}}}const p={text:d,anchor:{from:{row:t,col:n},to:{row:r,col:i}}},g=uS(o);g&&(p.width=g.width,p.height=g.height);const m=mS(o,"nvSpPr");m.altText&&(p.altText=m.altText),m.title&&(p.title=m.title);const y={};let v=!1;return void 0!==s&&(y.fontSize=s,v=!0),void 0!==l&&(y.bold=l,v=!0),void 0!==c&&(y.color=c,v=!0),void 0!==u&&(y.fillColor=u,v=!0),void 0!==f&&(y.borderColor=f,v=!0),v&&(p.style=y),p}function dS(e,t){for(const n of e.children){if("string"==typeof n)continue;const e=n;if((e.local||e.tag)===t)return e}return null}function hS(e){let t,n,r,i="";for(const o of e.children){if("string"==typeof o)continue;const e=o;if("r"===(e.local||e.tag)){const o=dS(e,"rPr");if(o){o.attrs.sz&&(t=Number(o.attrs.sz)/100),"1"!==o.attrs.b&&"true"!==o.attrs.b||(n=!0);const e=dS(o,"solidFill");if(e){const t=dS(e,"srgbClr");t&&t.attrs.val&&(r=t.attrs.val)}}const a=dS(e,"t");a&&(i+=a.children.filter(e=>"string"==typeof e).join(""))}}return{text:i,fontSize:t,bold:n,color:r}}const pS=9525;function gS(e,t){let n,r,i,o=0,a=0,s=0,l=0;for(const t of e.children){if("string"==typeof t)continue;const e=t,c=e.local||e.tag;if("from"===c){const t=yS(e);o=t.row,a=t.col}else if("ext"===c)s=Number(e.attrs.cx)||0,l=Number(e.attrs.cy)||0;else if("pic"===c){n=vS(e);const t=mS(e,"nvPicPr");r=t.altText,i=t.title}}if(!n)return null;const c=t.get(n);if(!c)return null;const u=c.split(".").pop()?.toLowerCase()??"",f={mediaPath:c,type:oS[u]??"png",anchor:{from:{row:o,col:a}}};return s>0&&(f.width=Math.round(s/pS)),l>0&&(f.height=Math.round(l/pS)),r&&(f.altText=r),i&&(f.title=i),f}function mS(e,t){const n=dS(e,t);if(!n)return{};const r=dS(n,"cNvPr");if(!r)return{};const i={};return r.attrs.descr&&(i.altText=r.attrs.descr),r.attrs.title&&(i.title=r.attrs.title),i}function yS(e){let t=0,n=0;for(const r of e.children){if("string"==typeof r)continue;const e=r,i=e.local||e.tag,o=e.children.filter(e=>"string"==typeof e).join("");"row"===i?t=Number(o)||0:"col"===i&&(n=Number(o)||0)}return{row:t,col:n}}function vS(e){for(const t of e.children){if("string"==typeof t)continue;const e=t;if("blipFill"===(e.local||e.tag))for(const t of e.children){if("string"==typeof t)continue;const e=t;if("blip"===(e.local||e.tag))return e.attrs["r:embed"]??e.attrs["R:embed"]??AS(e.attrs)}}}function AS(e){for(const t of Object.keys(e))if(t.endsWith(":embed")&&e[t].startsWith("rId"))return e[t]}function bS(e){const t=e.trim(),n=t.lastIndexOf("!");return-1===n?t:t.slice(n+1)}function wS(e){const t=Lb(e),n=t.attrs.name??"",r=t.attrs.displayName??n,i=t.attrs.ref??"";if(!n)return null;const o=t.attrs.totalsRowCount,a=void 0!==o&&"0"!==o,s=[];let l,c,u,f=!1;for(const e of t.children){if("string"==typeof e)continue;const t=e.local||e.tag;if("autoFilter"===t)f=!0;else if("tableColumns"===t)for(const t of e.children){if("string"==typeof t)continue;if("tableColumn"===(t.local||t.tag)){const e={name:t.attrs.name??""};t.attrs.totalsRowFunction&&(e.totalFunction=t.attrs.totalsRowFunction),t.attrs.totalsRowLabel&&(e.totalLabel=t.attrs.totalsRowLabel);for(const n of t.children){if("string"==typeof n)continue;if("totalsRowFormula"===(n.local||n.tag)){const t=n.children.filter(e=>"string"==typeof e).join("");t&&(e.totalFormula=t)}}s.push(e)}}else"tableStyleInfo"===t&&(l=e.attrs.name,c="1"===e.attrs.showRowStripes,u="1"===e.attrs.showColumnStripes)}const d={name:n,columns:s};return r&&r!==n&&(d.displayName=r),i&&(d.range=i),l&&(d.style=l),void 0!==c&&(d.showRowStripes=c),void 0!==u&&(d.showColumnStripes=u),d.showAutoFilter=f,a&&(d.showTotalRow=!0),d}async function IS(e){if(function(){if(void 0===VB)try{new CompressionStream("deflate-raw"),VB="undefined"!=typeof ReadableStream}catch{VB=!1}return VB}())try{const t=new CompressionStream("deflate-raw"),n=t.writable.getWriter(),r=t.readable.getReader();n.write(e),n.close();const i=[];let o=0;for(;;){const{done:e,value:t}=await r.read();if(e)break;i.push(t),o+=t.length}const a=new Uint8Array(o);let s=0;for(const e of i)a.set(e,s),s+=e.length;return a}catch{}return PB(e)}class xS{entries=[];paths=new Set;add(e,t,n){if(this.paths.has(e))throw new gb(`Duplicate ZIP entry: "${e}"`);this.paths.add(e);const r=n?.compress??!0;this.entries.push({path:e,data:t,compress:r})}async build(){const e=[];for(const t of this.entries){const n=t.data.length>0?FB(t.data):0;let r,i;t.compress&&t.data.length>0?(r=await IS(t.data),i=8,r.length>=t.data.length&&(r=t.data,i=0)):(r=t.data,i=0),e.push({path:t.path,data:t.data,compressedData:r,method:i,entryCrc32:n})}const t=new TextEncoder,n=e.map(e=>t.encode(e.path));let r=0;for(let t=0;t<e.length;t++)r+=30+n[t].length+e[t].compressedData.length;let i=0;for(let t=0;t<e.length;t++)i+=46+n[t].length;const o=new Uint8Array(r+i+22),a=new DataView(o.buffer);let s=0;const l=[];for(let t=0;t<e.length;t++){const r=e[t],i=n[t];l.push(s),a.setUint32(s,67324752,!0),a.setUint16(s+4,20,!0),a.setUint16(s+6,0,!0),a.setUint16(s+8,r.method,!0),a.setUint16(s+10,0,!0),a.setUint16(s+12,33,!0),a.setUint32(s+14,r.entryCrc32,!0),a.setUint32(s+18,r.compressedData.length,!0),a.setUint32(s+22,r.data.length,!0),a.setUint16(s+26,i.length,!0),a.setUint16(s+28,0,!0),o.set(i,s+30),s+=30+i.length,o.set(r.compressedData,s),s+=r.compressedData.length}const c=s;for(let t=0;t<e.length;t++){const r=e[t],i=n[t];a.setUint32(s,33639248,!0),a.setUint16(s+4,20,!0),a.setUint16(s+6,20,!0),a.setUint16(s+8,0,!0),a.setUint16(s+10,r.method,!0),a.setUint16(s+12,0,!0),a.setUint16(s+14,33,!0),a.setUint32(s+16,r.entryCrc32,!0),a.setUint32(s+20,r.compressedData.length,!0),a.setUint32(s+24,r.data.length,!0),a.setUint16(s+28,i.length,!0),a.setUint16(s+30,0,!0),a.setUint16(s+32,0,!0),a.setUint16(s+34,0,!0),a.setUint16(s+36,0,!0),a.setUint32(s+38,0,!0),a.setUint32(s+42,l[t],!0),o.set(i,s+46),s+=46+i.length}const u=s-c;return a.setUint32(s,101010256,!0),a.setUint16(s+4,0,!0),a.setUint16(s+6,0,!0),a.setUint16(s+8,e.length,!0),a.setUint16(s+10,e.length,!0),a.setUint32(s+12,u,!0),a.setUint32(s+16,c,!0),a.setUint16(s+20,0,!0),o}}const CS={png:"image/png",jpeg:"image/jpeg",gif:"image/gif",svg:"image/svg+xml",webp:"image/webp"};const BS="http://schemas.openxmlformats.org/package/2006/relationships";function ES(e,t){const n={};return void 0!==t.rgb&&(n.rgb=6===t.rgb.length?`FF${t.rgb}`:t.rgb),void 0!==t.theme&&(n.theme=t.theme),void 0!==t.tint&&(n.tint=t.tint),void 0!==t.indexed&&(n.indexed=t.indexed),fw(e,n)}function kS(e){const t=[];return e.bold&&t.push(fw("b")),e.italic&&t.push(fw("i")),void 0!==e.underline&&!1!==e.underline&&(!0===e.underline||"single"===e.underline?t.push(fw("u")):t.push(fw("u",{val:e.underline}))),e.strikethrough&&t.push(fw("strike")),void 0!==e.charset&&t.push(fw("charset",{val:e.charset})),void 0!==e.family&&t.push(fw("family",{val:e.family})),e.scheme&&t.push(fw("scheme",{val:e.scheme})),e.color&&t.push(ES("color",e.color)),void 0!==e.size&&t.push(fw("sz",{val:e.size})),e.name&&t.push(fw("name",{val:e.name})),e.vertAlign&&t.push(fw("vertAlign",{val:e.vertAlign})),hw("font",void 0,t)}function SS(e){if("pattern"===e.type){const t=[];e.fgColor&&t.push(ES("fgColor",e.fgColor)),e.bgColor&&t.push(ES("bgColor",e.bgColor));const n=hw("patternFill",{patternType:e.pattern},t.length>0?t:void 0);return hw("fill",void 0,[n])}const t=[];for(const n of e.stops)t.push(hw("stop",{position:n.position},[ES("color",n.color)]));const n={};void 0!==e.degree&&(n.degree=e.degree);const r=hw("gradientFill",n,t);return hw("fill",void 0,[r])}function FS(e,t){return t?t.color?hw(""+e,{style:t.style},[ES("color",t.color)]):fw(e,{style:t.style}):fw(e)}function DS(e){const t={};e.diagonalUp&&(t.diagonalUp=!0),e.diagonalDown&&(t.diagonalDown=!0);const n=[FS("left",e.left),FS("right",e.right),FS("top",e.top),FS("bottom",e.bottom),FS("diagonal",e.diagonal)];return hw("border",Object.keys(t).length>0?t:void 0,n)}function NS(e){if(!e)return"";const t=[];return void 0!==e.rgb&&t.push(`rgb:${e.rgb}`),void 0!==e.theme&&t.push(`th:${e.theme}`),void 0!==e.tint&&t.push(`tint:${e.tint}`),void 0!==e.indexed&&t.push(`idx:${e.indexed}`),t.join("|")}function MS(e){const t=[];return e.name&&t.push(`n:${e.name}`),void 0!==e.size&&t.push(`s:${e.size}`),e.bold&&t.push("b"),e.italic&&t.push("i"),void 0!==e.underline&&!1!==e.underline&&t.push(`u:${e.underline}`),e.strikethrough&&t.push("st"),e.color&&t.push(`c:${NS(e.color)}`),e.vertAlign&&t.push(`va:${e.vertAlign}`),void 0!==e.family&&t.push(`fam:${e.family}`),void 0!==e.charset&&t.push(`cs:${e.charset}`),e.scheme&&t.push(`sch:${e.scheme}`),t.join(",")}function QS(e){return"pattern"===e.type?`p:${e.pattern}|fg:${NS(e.fgColor)}|bg:${NS(e.bgColor)}`:`g:${e.degree??""}|${e.stops.map(e=>`${e.position}:${NS(e.color)}`).join(";")}`}function TS(e){return e?`${e.style}:${NS(e.color)}`:""}function LS(e){return[`l:${TS(e.left)}`,`r:${TS(e.right)}`,`t:${TS(e.top)}`,`b:${TS(e.bottom)}`,`d:${TS(e.diagonal)}`,e.diagonalUp?"du":"",e.diagonalDown?"dd":""].join("|")}function RS(e,t){const n=t?.reuseStyleIdentity??!1,r={name:e?.name??"Calibri",size:e?.size??11,...e},i=[{key:MS(r),font:r}],o=new Map([[i[0].key,0]]),a=[{key:"p:none|fg:|bg:",fill:{type:"pattern",pattern:"none"}},{key:"p:gray125|fg:|bg:",fill:{type:"pattern",pattern:"gray125"}}],s=new Map([[a[0].key,0],[a[1].key,1]]),l={},c=[{key:LS(l),border:l}],u=new Map([[c[0].key,0]]),f=[],d=new Map;let h=164;const p="nf:0|f:0|fl:0|b:0|a:|p:",g=[{key:p,numFmtId:0,fontId:0,fillId:0,borderId:0}],m=new Map([[p,0]]);function y(e){const t=d.get(e);if(void 0!==t)return t;const n=h++;return f.push({id:n,formatCode:e}),d.set(e,n),n}function v(e){if(!e)return"";const t=[];return e.horizontal&&t.push(`h:${e.horizontal}`),e.vertical&&t.push(`v:${e.vertical}`),e.wrapText&&t.push("w"),e.shrinkToFit&&t.push("sf"),void 0!==e.textRotation&&t.push(`r:${e.textRotation}`),void 0!==e.indent&&t.push(`i:${e.indent}`),e.readingOrder&&t.push(`ro:${e.readingOrder}`),t.join(",")}function A(e){if(!e)return"";const t=[];return void 0!==e.locked&&t.push(`l:${e.locked}`),void 0!==e.hidden&&t.push(`h:${e.hidden}`),t.join(",")}const b=[],w=new Map;const I=n?new WeakMap:void 0;function x(e,t){if(I&&!t){const t=I.get(e);if(void 0!==t)return t}const n=e.font?function(e){const t=MS(e),n=o.get(t);if(void 0!==n)return n;const r=i.length;return i.push({key:t,font:HE(e)}),o.set(t,r),r}(e.font):0,r=e.fill?function(e){const t=QS(e),n=s.get(t);if(void 0!==n)return n;const r=a.length;return a.push({key:t,fill:qE(e)}),s.set(t,r),r}(e.fill):0,l=e.border?function(e){const t=LS(e),n=u.get(t);if(void 0!==n)return n;const r=c.length;return c.push({key:t,border:PE(e)}),u.set(t,r),r}(e.border):0,f=e.numFmt?y(e.numFmt):0,d=[`nf:${f}`,`f:${n}`,`fl:${r}`,`b:${l}`,`a:${v(e.alignment)}`,`p:${A(e.protection)}`,t?"cb:1":"cb:0"].join("|"),h=m.get(d);if(void 0!==h)return I&&!t&&I.set(e,h),h;const p=g.length;return g.push({key:d,numFmtId:f,fontId:n,fillId:r,borderId:l,alignment:e.alignment?{...e.alignment}:void 0,protection:e.protection?{...e.protection}:void 0,hasCheckboxFeature:t||void 0}),m.set(d,p),I&&!t&&I.set(e,p),p}function C(e){const t={};if(e.horizontal&&(t.horizontal=e.horizontal),e.vertical&&(t.vertical=e.vertical),e.wrapText&&(t.wrapText=!0),e.shrinkToFit&&(t.shrinkToFit=!0),void 0!==e.textRotation&&(t.textRotation=e.textRotation),void 0!==e.indent&&(t.indent=e.indent),e.readingOrder){const n={ltr:1,rtl:2,context:0};t.readingOrder=n[e.readingOrder]}return fw("alignment",t)}return{addStyle:function(e){return x(e,!1)},addCheckboxStyle:function(e){return x(e??{},!0)},addNumFmt:y,addDxf:function(e){const t=function(e){const t=[];return e.font&&t.push(`f:${MS(e.font)}`),e.fill&&t.push(`fl:${QS(e.fill)}`),e.border&&t.push(`b:${LS(e.border)}`),e.numFmt&&t.push(`nf:${e.numFmt}`),e.alignment&&t.push(`a:${v(e.alignment)}`),t.join("|")}(e),n=w.get(t);if(void 0!==n)return n;const r=b.length;return b.push(e),w.set(t,r),r},hasCheckboxFeature:function(){for(const e of g)if(e.hasCheckboxFeature)return!0;return!1},toXml:function(){const e=[];if(f.length>0){const t=f.map(e=>fw("numFmt",{numFmtId:e.id,formatCode:e.formatCode}));e.push(hw("numFmts",{count:f.length},t))}const t=i.map(e=>kS(e.font));e.push(hw("fonts",{count:i.length},t));const n=a.map(e=>SS(e.fill));e.push(hw("fills",{count:a.length},n));const r=c.map(e=>DS(e.border));e.push(hw("borders",{count:c.length},r)),e.push(hw("cellStyleXfs",{count:1},[fw("xf",{numFmtId:0,fontId:0,fillId:0,borderId:0})]));const o=g.map(e=>{const t={numFmtId:e.numFmtId,fontId:e.fontId,fillId:e.fillId,borderId:e.borderId,xfId:0};0!==e.numFmtId&&(t.applyNumberFormat=!0),0!==e.fontId&&(t.applyFont=!0),0!==e.fillId&&(t.applyFill=!0),0!==e.borderId&&(t.applyBorder=!0);const n=void 0!==e.alignment,r=void 0!==e.protection,i=!0===e.hasCheckboxFeature;if(n&&(t.applyAlignment=!0),r&&(t.applyProtection=!0),n||r||i){const o=[];return n&&o.push(C(e.alignment)),r&&o.push(function(e){const t={};return void 0!==e.locked&&(t.locked=e.locked?1:0),void 0!==e.hidden&&(t.hidden=e.hidden?1:0),fw("protection",t)}(e.protection)),i&&o.push(hw("extLst",void 0,hw("ext",{uri:dE,"xmlns:xfpb":fE},fw("xfpb:xfComplement",{i:"0"})))),hw("xf",t,o)}return fw("xf",t)});if(e.push(hw("cellXfs",{count:g.length},o)),e.push(hw("cellStyles",{count:1},[fw("cellStyle",{name:"Normal",xfId:0,builtinId:0})])),b.length>0){const t=b.map(e=>{const t=[];if(e.font&&t.push(kS(e.font)),e.numFmt){const n=y(e.numFmt);t.push(fw("numFmt",{numFmtId:n,formatCode:e.numFmt}))}return e.fill&&t.push(SS(e.fill)),e.border&&t.push(DS(e.border)),e.alignment&&t.push(C(e.alignment)),hw("dxf",void 0,t)});e.push(hw("dxfs",{count:b.length},t))}else e.push(fw("dxfs",{count:0}));return e.push(fw("tableStyles",{count:0,defaultTableStyle:"TableStyleMedium2",defaultPivotStyle:"PivotStyleLight16"})),pw("styleSheet",{xmlns:"http://schemas.openxmlformats.org/spreadsheetml/2006/main"},e)}}}function US(e){const t=e;return t.length>=8&&137===t[0]&&80===t[1]&&78===t[2]&&71===t[3]?"png":t.length>=3&&255===t[0]&&216===t[1]&&255===t[2]?"jpeg":t.length>=6&&71===t[0]&&73===t[1]&&70===t[2]?"gif":t.length>=12&&82===t[0]&&73===t[1]&&70===t[2]&&70===t[3]&&87===t[8]&&69===t[9]&&66===t[10]&&80===t[11]?"webp":function(e){const t=e.subarray(0,HS);let n="";for(let e=0;e<t.length;e++)n+=String.fromCharCode(t[e]);const r=n.trimStart().replace(/^/,"");return!!r.startsWith("<")&&/<svg[\s>]/i.test(r)}(t)?"svg":"png"}const HS=1024;const qS="http://schemas.openxmlformats.org/officeDocument/2006/relationships",OS="http://schemas.openxmlformats.org/drawingml/2006/chart",PS=9525,zS={png:"png",jpeg:"jpeg",gif:"gif",svg:"svg",webp:"webp"},$S={png:"image/png",jpeg:"image/jpeg",gif:"image/gif",svg:"image/svg+xml",webp:"image/webp"};function jS(e,t,n,r,i=1){const o=[],a=[],s=[];for(let n=0;n<e.length;n++){const r=e[n],i=t+n,l=`rId${n+1}`,c=zS[r.type]??"png",u=$S[r.type]??"image/png",f=`xl/media/image${i}.${c}`,d=`../media/image${i}.${c}`;o.push({path:f,data:r.data,contentType:u}),a.push(fw("Relationship",{Id:l,Type:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/image",Target:d}));const h=r.width?r.width*PS:3e6,p=r.height?r.height*PS:2e6,g=r.anchor.from.col,m=r.anchor.from.row,y=r.anchor.to?.col??g+3,v=r.anchor.to?.row??m+5,A=hw("xdr:from",void 0,[hw("xdr:col",void 0,String(g)),hw("xdr:colOff",void 0,"0"),hw("xdr:row",void 0,String(m)),hw("xdr:rowOff",void 0,"0")]),b=hw("xdr:to",void 0,[hw("xdr:col",void 0,String(y)),hw("xdr:colOff",void 0,"0"),hw("xdr:row",void 0,String(v)),hw("xdr:rowOff",void 0,"0")]),w={id:n+2,name:`Picture ${n+1}`};r.title&&(w.title=r.title),r.altText&&(w.descr=r.altText);const I=hw("xdr:nvPicPr",void 0,[fw("xdr:cNvPr",w),hw("xdr:cNvPicPr",void 0,[fw("a:picLocks",{noChangeAspect:1})])]),x=hw("xdr:blipFill",void 0,[fw("a:blip",{"r:embed":l}),hw("a:stretch",void 0,[fw("a:fillRect")])]),C=hw("xdr:spPr",void 0,[hw("a:xfrm",void 0,[fw("a:off",{x:0,y:0}),fw("a:ext",{cx:h,cy:p})]),hw("a:prstGeom",{prst:"rect"},[fw("a:avLst")])]),B=hw("xdr:pic",void 0,[I,x,C]),E=hw("xdr:twoCellAnchor",void 0,[A,b,B,fw("xdr:clientData")]);s.push(E)}if(n&&n.length>0){let t=e.length+2;for(let e=0;e<n.length;e++){const r=n[e],i=r.anchor.from.col,o=r.anchor.from.row,a=r.anchor.to?.col??i+3,l=r.anchor.to?.row??o+3,c=r.width?r.width*PS:2e6,u=r.height?r.height*PS:5e5,f=hw("xdr:from",void 0,[hw("xdr:col",void 0,String(i)),hw("xdr:colOff",void 0,"0"),hw("xdr:row",void 0,String(o)),hw("xdr:rowOff",void 0,"0")]),d=hw("xdr:to",void 0,[hw("xdr:col",void 0,String(a)),hw("xdr:colOff",void 0,"0"),hw("xdr:row",void 0,String(l)),hw("xdr:rowOff",void 0,"0")]),h={id:t++,name:`TextBox ${e+1}`};r.title&&(h.title=r.title),r.altText&&(h.descr=r.altText);const p=hw("xdr:nvSpPr",void 0,[fw("xdr:cNvPr",h),hw("xdr:cNvSpPr",{txBox:1},[])]),g=[hw("a:xfrm",void 0,[fw("a:off",{x:0,y:0}),fw("a:ext",{cx:c,cy:u})]),hw("a:prstGeom",{prst:"rect"},[fw("a:avLst")])],m=r.style?.fillColor??"FFFFFF";g.push(hw("a:solidFill",void 0,[fw("a:srgbClr",{val:m})]));const y=r.style?.borderColor??"000000";g.push(hw("a:ln",void 0,[hw("a:solidFill",void 0,[fw("a:srgbClr",{val:y})])]));const v=hw("xdr:spPr",void 0,g),A={lang:"en-US",sz:100*(r.style?.fontSize??11)};r.style?.bold&&(A.b=1);const b=[];r.style?.color&&b.push(hw("a:solidFill",void 0,[fw("a:srgbClr",{val:r.style.color})]));const w=b.length>0?hw("a:rPr",A,b):fw("a:rPr",A),I=hw("xdr:txBody",void 0,[fw("a:bodyPr",{wrap:"square"}),hw("a:p",void 0,[hw("a:r",void 0,[w,hw("a:t",void 0,lw(r.text))])])]),x=hw("xdr:sp",void 0,[p,v,I]),C=hw("xdr:twoCellAnchor",void 0,[f,d,x,fw("xdr:clientData")]);s.push(C)}}const l=[];if(r&&r.length>0){let t=e.length+(n?.length??0)+2;for(let n=0;n<r.length;n++){const o=r[n],c=i+n,u=`rId${e.length+n+1}`;a.push(fw("Relationship",{Id:u,Type:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/chart",Target:`../charts/chart${c}.xml`}));const f=o.anchor.from.col,d=o.anchor.from.row,h=o.anchor.to?.col??f+8,p=o.anchor.to?.row??d+15,g=hw("xdr:from",void 0,[hw("xdr:col",void 0,String(f)),hw("xdr:colOff",void 0,"0"),hw("xdr:row",void 0,String(d)),hw("xdr:rowOff",void 0,"0")]),m=hw("xdr:to",void 0,[hw("xdr:col",void 0,String(h)),hw("xdr:colOff",void 0,"0"),hw("xdr:row",void 0,String(p)),hw("xdr:rowOff",void 0,"0")]),y={id:t++,name:`Chart ${n+1}`};o.frameTitle&&(y.title=o.frameTitle),o.altText&&(y.descr=o.altText);const v=hw("xdr:nvGraphicFramePr",void 0,[fw("xdr:cNvPr",y),hw("xdr:cNvGraphicFramePr",void 0,[])]),A=hw("xdr:xfrm",void 0,[fw("a:off",{x:0,y:0}),fw("a:ext",{cx:0,cy:0})]),b=hw("a:graphic",void 0,hw("a:graphicData",{uri:OS},[fw("c:chart",{"xmlns:c":OS,"xmlns:r":qS,"r:id":u})])),w=hw("xdr:graphicFrame",{macro:""},[v,A,b]),I=hw("xdr:twoCellAnchor",{editAs:"oneCell"},[g,m,w,fw("xdr:clientData")]);s.push(I),l.push({globalChartIndex:c})}}return{drawingXml:pw("xdr:wsDr",{"xmlns:xdr":"http://schemas.openxmlformats.org/drawingml/2006/spreadsheetDrawing","xmlns:a":"http://schemas.openxmlformats.org/drawingml/2006/main","xmlns:r":qS},s),drawingRels:pw("Relationships",{xmlns:"http://schemas.openxmlformats.org/package/2006/relationships"},a),images:o,charts:l}}function VS(e,t){const n=e.showTitle??Boolean(e.title),r=function(e){if(!1===e.legend)return null;if(void 0===e.legend)return"scatter"===e.type?"b":"r";switch(e.legend){case"top":return"t";case"bottom":return"b";case"left":return"l";case"right":return"r";case"topRight":return"tr"}}(e),i=[];n&&e.title&&i.push(function(e,t,n,r,i,o,a,s,l,c,u,f,d,h,p,g,m){const y=void 0===n?0:n*lI,v=void 0===r?1400:100*r,A=i?1:0,b=!0===o?1:void 0,w=!0===s?"sngStrike":void 0,I=!0===l?"sng":void 0,x=void 0!==a?hw("a:solidFill",void 0,[Ow(a)]):void 0,C=c?fw("a:latin",{typeface:c}):void 0,B=[];x&&B.push(x),C&&B.push(C);const E=B.length>0?hw("a:defRPr",{sz:v,b:A,i:b,u:I,strike:w},B):fw("a:defRPr",{sz:v,b:A,i:b,u:I,strike:w}),k=B.length>0?hw("a:rPr",{lang:"en-US",sz:v,b:A,i:b,u:I,strike:w},B):fw("a:rPr",{lang:"en-US",sz:v,b:A,i:b,u:I,strike:w}),S=tI(u),F=[hw("c:tx",void 0,[hw("c:rich",void 0,[hw("a:bodyPr",{rot:y,spcFirstLastPara:1,vertOverflow:"ellipsis",wrap:"square",anchor:"ctr",anchorCtr:1},[]),fw("a:lstStyle"),hw("a:p",void 0,[hw("a:pPr",void 0,[E]),hw("a:r",void 0,[k,hw("a:t",void 0,lw(e))])])])])];void 0!==S&&F.push(S),F.push(fw("c:overlay",{val:t?1:0}));const D=uI(f,d,h,p,g,m);return void 0!==D&&F.push(D),hw("c:title",void 0,F)}(e.title,function(e){return!0===e.titleOverlay}(e),function(e){return fI(e.titleRotation)}(e),function(e){return dI(e.titleFontSize)}(e),function(e){return hI(e.titleBold)}(e),function(e){return pI(e.titleItalic)}(e),function(e){return gI(e.titleColor)}(e),function(e){return mI(e.titleStrike)}(e),function(e){return yI(e.titleUnderline)}(e),function(e){return function(e){if("string"!=typeof e)return;const t=e.trim();return 0!==t.length?t:void 0}(e.titleFontFamily)}(e),function(e){return Zw(e.titleLayout)}(e),function(e){return gI(e.titleFillColor)}(e),function(e){return gI(e.titleBorderColor)}(e),function(e){return Yw(e.titleBorderWidth)}(e),function(e){return Gw(e.titleBorderDash)}(e),function(e){return Fw(e.titleBorderCap)}(e),function(e){return Dw(e.titleBorderCompound)}(e))),i.push(fw("c:autoTitleDeleted",{val:Bx(e)?1:0}));const o=function(e){if(void 0===e)return;const t=[],n=_w(e.rotX,-90,90);void 0!==n&&t.push(fw("c:rotX",{val:n}));const r=_w(e.hPercent,5,500);void 0!==r&&t.push(fw("c:hPercent",{val:r}));const i=_w(e.rotY,0,360);void 0!==i&&t.push(fw("c:rotY",{val:i}));const o=_w(e.depthPercent,20,2e3);void 0!==o&&t.push(fw("c:depthPercent",{val:o})),!0===e.rAngAx?t.push(fw("c:rAngAx",{val:1})):!1===e.rAngAx&&t.push(fw("c:rAngAx",{val:0}));const a=_w(e.perspective,0,240);return void 0!==a&&t.push(fw("c:perspective",{val:a})),hw("c:view3D",void 0,t)}(e.view3D);void 0!==o&&i.push(o);const a=function(e){if("number"==typeof e&&Number.isFinite(e)&&Number.isInteger(e)&&!(e<=0||e>100))return hw("c:floor",void 0,[fw("c:thickness",{val:e})])}(e.floorThickness);void 0!==a&&i.push(a);const s=function(e){if("number"==typeof e&&Number.isFinite(e)&&Number.isInteger(e)&&!(e<=0||e>100))return hw("c:sideWall",void 0,[fw("c:thickness",{val:e})])}(e.sideWallThickness);void 0!==s&&i.push(s);const l=function(e){if("number"==typeof e&&Number.isFinite(e)&&Number.isInteger(e)&&!(e<=0||e>100))return hw("c:backWall",void 0,[fw("c:thickness",{val:e})])}(e.backWallThickness);void 0!==l&&i.push(l),i.push(SC(e,t)),r&&i.push(bI(r,function(e){return!0===e.legendOverlay}(e),function(e){const t=e.legendEntries;if(!Array.isArray(t)||0===t.length)return[];const n=new Map;for(const e of t){if(!e||"object"!=typeof e)continue;const t=e.idx;if("number"!=typeof t||!Number.isFinite(t))continue;if(!Number.isInteger(t)||t<0)continue;const r={idx:t,delete:!0===e.delete};if("number"==typeof e.fontSize&&Number.isFinite(e.fontSize)){const t=Math.round(2*e.fontSize)/2;t>=1&&t<=AI&&(r.fontSize=t)}if(!0===e.bold?r.bold=!0:!1===e.bold&&(r.bold=!1),!0===e.italic?r.italic=!0:!1===e.italic&&(r.italic=!1),!0===e.underline?r.underline=!0:!1===e.underline&&(r.underline=!1),!0===e.strikethrough?r.strikethrough=!0:!1===e.strikethrough&&(r.strikethrough=!1),void 0!==e.color){const t=qw(e.color);void 0!==t&&(r.color=t)}if("string"==typeof e.fontFamily){const t=e.fontFamily.trim();t.length>0&&(r.fontFamily=t)}n.set(t,r)}return Array.from(n.values()).sort((e,t)=>e.idx-t.idx)}(e),function(e){return dI(e.legendFontSize)}(e),function(e){const t=e.legendBold;return!0===t||!1!==t&&void 0}(e),function(e){const t=e.legendItalic;return!0===t||!1!==t&&void 0}(e),function(e){const t=e.legendUnderline;return!0===t||!1!==t&&void 0}(e),function(e){if(!0===e.legendStrikethrough)return!0}(e),function(e){return gI(e.legendFontColor)}(e),function(e){return function(e){if("string"!=typeof e)return;const t=e.trim();return 0!==t.length?t:void 0}(e.legendFontFamily)}(e),function(e){return Zw(e.legendLayout)}(e),function(e){return gI(e.legendFillColor)}(e),function(e){return gI(e.legendBorderColor)}(e),function(e){return Yw(e.legendBorderWidth)}(e),function(e){return Gw(e.legendBorderDash)}(e),Fw(e.legendBorderCap),Dw(e.legendBorderCompound))),i.push(fw("c:plotVisOnly",{val:WS(e)?1:0})),i.push(fw("c:dispBlanksAs",{val:GS(e)})),i.push(fw("c:showDLblsOverMax",{val:JS(e)?1:0}));const c=hw("c:chart",void 0,i),u=[];(function(e){return!0===e.date1904})(e)&&u.push(fw("c:date1904",{val:1}));const f=function(e){const t=e.lang;return"string"!=typeof t?void 0:/^[A-Za-z]{2,3}(-[A-Za-z0-9]{2,8})*$/.test(t)?t:void 0}(e);void 0!==f&&u.push(fw("c:lang",{val:f})),u.push(fw("c:roundedCorners",{val:_S(e)?1:0}));const d=function(e){const t=e.style;return"number"!=typeof t?void 0:Number.isInteger(t)?t<1||t>48?void 0:t:void 0}(e);void 0!==d&&u.push(fw("c:style",{val:d}));const h=function(e){const t=e.protection;if(void 0===t||!1===t)return;if(!0===t)return{chartObject:!1,data:!1,formatting:!1,selection:!1,userInterface:!1};return{chartObject:!0===t.chartObject,data:!0===t.data,formatting:!0===t.formatting,selection:!0===t.selection,userInterface:!0===t.userInterface}}(e);void 0!==h&&u.push(function(e){return hw("c:protection",void 0,[fw("c:chartObject",{val:e.chartObject?1:0}),fw("c:data",{val:e.data?1:0}),fw("c:formatting",{val:e.formatting?1:0}),fw("c:selection",{val:e.selection?1:0}),fw("c:userInterface",{val:e.userInterface?1:0})])}(h)),u.push(c);const p=function(e){const t=(s=e.chartSpaceFillColor,gI(s)),n=function(e){return gI(e)}(e.chartSpaceBorderColor),r=Yw(e.chartSpaceBorderWidth),i=Gw(e.chartSpaceBorderDash),o=Fw(e.chartSpaceBorderCap),a=Dw(e.chartSpaceBorderCompound);var s;if(void 0===t&&void 0===n&&void 0===r&&void 0===i&&void 0===o&&void 0===a)return;const l=[];void 0!==t&&l.push(hw("a:solidFill",void 0,[Ow(t)]));if(void 0!==n||void 0!==r||void 0!==i||void 0!==o||void 0!==a){const e={};void 0!==r&&(e.w=Math.round(r*Cw)),void 0!==o&&(e.cap=o),void 0!==a&&(e.cmpd=a);const t=[];void 0!==n&&t.push(hw("a:solidFill",void 0,[Ow(n)])),void 0!==i&&t.push(fw("a:prstDash",{val:i})),l.push(0===t.length?fw("a:ln",e):hw("a:ln",Object.keys(e).length>0?e:void 0,t))}return hw("c:spPr",void 0,l)}(e);void 0!==p&&u.push(p);return{chartXml:pw("c:chartSpace",{"xmlns:c":"http://schemas.openxmlformats.org/drawingml/2006/chart","xmlns:a":"http://schemas.openxmlformats.org/drawingml/2006/main","xmlns:r":"http://schemas.openxmlformats.org/officeDocument/2006/relationships"},u),chartRels:pw("Relationships",{xmlns:"http://schemas.openxmlformats.org/package/2006/relationships"},[])}}const YS=new Set(["gap","zero","span"]);function GS(e){const t=e.dispBlanksAs;return t&&YS.has(t)?t:"gap"}function WS(e){return"boolean"!=typeof e.plotVisOnly||e.plotVisOnly}function JS(e){return"boolean"!=typeof e.showDLblsOverMax||e.showDLblsOverMax}function _S(e){return"boolean"==typeof e.roundedCorners&&e.roundedCorners}const XS="http://schemas.openxmlformats.org/spreadsheetml/2006/main";function KS(e,t){const n=[];for(const[t,r]of e){if(!r.comment)continue;const[e,i]=t.split(","),o=parseInt(e,10),a=parseInt(i,10),s=fk(o,a),l=r.comment.author??"",c=r.comment.text;n.push({ref:s,row:o,col:a,author:l,text:c})}if(0===n.length)return null;n.sort((e,t)=>e.row-t.row||e.col-t.col);const r=new Map;for(const e of n)r.has(e.author)||r.set(e.author,r.size);const i=function(e,t){const n=[];for(const[e]of t)n.push(hw("author",void 0,lw(e)));const r=hw("authors",void 0,n),i=[];for(const n of e){const e=t.get(n.author)??0,r=hw("text",void 0,[hw("r",void 0,[hw("t",void 0,lw(n.text))])]);i.push(hw("comment",{ref:n.ref,authorId:e},[r]))}const o=hw("commentList",void 0,i);return pw("comments",{xmlns:XS},[r,o])}(n,r),o=function(e,t){const n=[];n.push('<xml xmlns:v="urn:schemas-microsoft-com:vml"',' xmlns:o="urn:schemas-microsoft-com:office:office"',' xmlns:x="urn:schemas-microsoft-com:office:excel">'),n.push('<o:shapelayout v:ext="edit">',`<o:idmap v:ext="edit" data="${t+1}"/>`,"</o:shapelayout>"),n.push('<v:shapetype id="_x0000_t202" coordsize="21600,21600" o:spt="202"',' path="m,l,21600r21600,l21600,xe">','<v:stroke joinstyle="miter"/>','<v:path gradientshapeok="t" o:connecttype="rect"/>',"</v:shapetype>");const r=1024*(t+1)+1;for(let t=0;t<e.length;t++){const i=e[t],o=r+t,a=i.col+1,s=i.row,l=a+2,c=s+4,u=48*(i.col+1),f=15*i.row;n.push(`<v:shape id="_x0000_s${o}" type="#_x0000_t202"`,` style="position:absolute;margin-left:${u}pt;margin-top:${f}pt;`,`width:108pt;height:59.25pt;z-index:${t+1};visibility:hidden"`,' fillcolor="#ffffe1" o:insetmode="auto">','<v:fill color2="#ffffe1"/>','<v:shadow on="t" color="black" obscured="t"/>','<v:path o:connecttype="none"/>','<v:textbox style="mso-direction-alt:auto">','<div style="text-align:left"/>',"</v:textbox>",'<x:ClientData ObjectType="Note">',"<x:MoveWithCells/>","<x:SizeWithCells/>",`<x:Anchor>${a},15,${s},2,${l},31,${c},4</x:Anchor>`,"<x:AutoFill>False</x:AutoFill>",`<x:Row>${i.row}</x:Row>`,`<x:Column>${i.col}</x:Column>`,"</x:ClientData>","</v:shape>")}return n.push("</xml>"),n.join("")}(n,t);return{commentsXml:i,vmlXml:o,comments:n}}function ZS(e,t,n){const r=e.displayName??e.name,i=e.range??"",o=!1!==e.showAutoFilter,a=!0===e.showTotalRow,s={xmlns:"http://schemas.openxmlformats.org/spreadsheetml/2006/main",id:t,name:e.name,displayName:r,ref:i};a?s.totalsRowCount=1:s.totalsRowShown=0;const l=[];if(o){const e=a?function(e){const t=e.indexOf(":");if(-1===t)return e;const n=e.slice(t+1);let r=n.length;for(;r>0&&n.charCodeAt(r-1)>=48&&n.charCodeAt(r-1)<=57;)r--;const i=n.slice(0,r),o=parseInt(n.slice(r),10);return isNaN(o)||o<=1?e:`${e.slice(0,t+1)}${i}${o-1}`}(i):i;l.push(fw("autoFilter",{ref:e}))}const c=[];for(let t=0;t<e.columns.length;t++){const n=e.columns[t],r={id:t+1,name:n.name};if(a&&n.totalFunction&&(r.totalsRowFunction=n.totalFunction),a&&n.totalLabel&&(r.totalsRowLabel=n.totalLabel),a&&"custom"===n.totalFunction&&n.totalFormula){const e=hw("totalsRowFormula",void 0,lw(n.totalFormula));c.push(hw("tableColumn",r,[e]))}else c.push(fw("tableColumn",r))}l.push(hw("tableColumns",{count:e.columns.length},c));const u=e.style??"TableStyleMedium2",f=!1!==e.showRowStripes,d=!0===e.showColumnStripes;l.push(fw("tableStyleInfo",{name:u,showFirstColumn:0,showLastColumn:0,showRowStripes:f?1:0,showColumnStripes:d?1:0}));return{tableXml:pw("table",s,l),tableId:t}}function eF(e,t){const n=e.columns.length;let r=0;if(t.rows)r=t.rows.length;else if(t.data){const e=t.columns?.some(e=>e.header);r=t.data.length+(e?1:0)}e.showTotalRow&&(r+=1),r<1&&(r=1);return`${ck(0)}1:${ck(n-1)}${r}`}const tF="http://schemas.openxmlformats.org/spreadsheetml/2006/main",nF="http://schemas.openxmlformats.org/officeDocument/2006/relationships",rF="http://schemas.openxmlformats.org/package/2006/relationships",iF="http://schemas.openxmlformats.org/officeDocument/2006/relationships/pivotCacheRecords",oF="http://schemas.openxmlformats.org/officeDocument/2006/relationships/pivotCacheDefinition";function aF(e,t,n,r=1){const i=function(e,t){const n=t.fieldNames.map((e,n)=>({index:n,name:e,axis:"hidden",axisOrder:0,kind:lF(t.dataRows,n)})),r=(e,t)=>{if(e)for(let r=0;r<e.length;r++){const i=n.find(t=>t.name===e[r]);i&&(i.axis=t,i.axisOrder=r)}};r(e.rows,"row"),r(e.columns,"col"),r(e.pages,"page");const i=[];for(let r=0;r<e.values.length;r++){const o=e.values[r],a=t.fieldNames.indexOf(o.field);if(-1===a)continue;n[a].axis="data",n[a].axisOrder=r;const s=o.function??"sum",l={fieldIndex:a,function:s,displayName:o.displayName??hF(s,o.field)};void 0!==o.numberFormat&&(l.numberFormat=o.numberFormat),i.push(l)}for(const e of n){if("data"===e.axis||"hidden"===e.axis)continue;if("string"!==e.kind)continue;const n=new Set,r=[];for(const i of t.dataRows){const t=i[e.index],o=null==t?"":String(t);n.has(o)||(n.add(o),r.push(o))}e.sharedStrings=r,e.sharedIndex=new Map(r.map((e,t)=>[e,t]))}return{fields:n,dataFieldDefs:i}}(e,t),o=function(e,t){const n=hw("cacheSource",{type:"worksheet"},[fw("worksheetSource",{ref:e.ref,sheet:e.sheetName})]),r=[];for(const n of t.fields)r.push(cF(n,e.dataRows));return pw("pivotCacheDefinition",{xmlns:tF,"xmlns:r":nF,"r:id":"rId1",refreshOnLoad:1,refreshedBy:"hucre",refreshedDate:0,createdVersion:6,refreshedVersion:6,minRefreshableVersion:3,recordCount:e.dataRows.length},[n,hw("cacheFields",{count:t.fields.length},r)])}(t,i),a=function(e){return pw("Relationships",{xmlns:rF},[fw("Relationship",{Id:"rId1",Type:iF,Target:`pivotCacheRecords${e}.xml`})])}(r),s=function(e,t){const n=[];for(const r of e.dataRows){const e=[];for(const n of t.fields)e.push(uF(r[n.index],n));n.push(hw("r",void 0,e))}return pw("pivotCacheRecords",{xmlns:tF,"xmlns:r":nF,count:e.dataRows.length},n)}(t,i),l=function(e,t,n){const r=t.fields.filter(e=>"row"===e.axis).sort((e,t)=>e.axisOrder-t.axisOrder),i=t.fields.filter(e=>"col"===e.axis).sort((e,t)=>e.axisOrder-t.axisOrder),o=t.fields.filter(e=>"page"===e.axis).sort((e,t)=>e.axisOrder-t.axisOrder),a=e.targetCell??"A1",s=e.styleName??"PivotStyleLight16",l=e.dataCaption??"Values",c=function(e,t,n,r){const{col:i,row:o}=function(e){const t=/^([A-Z]+)(\d+)$/i.exec(e.trim());if(!t)throw new Error(`Invalid pivot targetCell "${e}" — expected an A1-style reference`);const n=t[1].toUpperCase();let r=0;for(let e=0;e<n.length;e++)r=26*r+(n.charCodeAt(e)-64);return{col:r-1,row:parseInt(t[2],10)-1}}(e),a=0,s=Math.max(1,n)+(r.dataFieldDefs.length>1?1:0),l=Math.max(1,t),c=Math.max(2,t+Math.max(1,r.dataFieldDefs.length)),u=s+2,f=dF(o,i),d=dF(o+u-1,i+c-1);return{ref:`${f}:${d}`,firstHeaderRow:a,firstDataRow:s,firstDataCol:l}}(a,r.length,i.length,t),u=[];u.push(fw("location",c));const f=[];for(const e of t.fields)f.push(fF(e));u.push(hw("pivotFields",{count:t.fields.length},f)),r.length>0&&(u.push(hw("rowFields",{count:r.length},r.map(e=>fw("field",{x:e.index})))),u.push(hw("rowItems",{count:1},[hw("i",void 0,[fw("x")])])));if(i.length>0)u.push(hw("colFields",{count:i.length},i.map(e=>fw("field",{x:e.index})))),u.push(hw("colItems",{count:1},[hw("i",void 0,[fw("x")])]));else if(t.dataFieldDefs.length>1){u.push(hw("colFields",{count:1},[fw("field",{x:-2})]));const e=[];for(let n=0;n<t.dataFieldDefs.length;n++)e.push(hw("i",0===n?void 0:{i:n},[fw("x",{v:n})]));u.push(hw("colItems",{count:t.dataFieldDefs.length},e))}o.length>0&&u.push(hw("pageFields",{count:o.length},o.map(e=>fw("pageField",{fld:e.index,hier:-1}))));if(t.dataFieldDefs.length>0){const e=[];for(const n of t.dataFieldDefs){const t={name:n.displayName,fld:n.fieldIndex,baseField:0,baseItem:0};"sum"!==n.function&&(t.subtotal=n.function),void 0!==n.numberFormat&&(t.numFmtId=0),e.push(fw("dataField",t))}u.push(hw("dataFields",{count:t.dataFieldDefs.length},e))}return u.push(fw("pivotTableStyleInfo",{name:s,showRowHeaders:1,showColHeaders:1,showRowStripes:0,showColStripes:0,showLastColumn:1})),pw("pivotTableDefinition",{xmlns:tF,"xmlns:r":nF,name:e.name,cacheId:n,applyNumberFormats:0,applyBorderFormats:0,applyFontFormats:0,applyPatternFormats:0,applyAlignmentFormats:0,applyWidthHeightFormats:1,dataCaption:l,updatedVersion:6,minRefreshableVersion:3,useAutoFormatting:1,itemPrintTitles:1,createdVersion:6,indent:0,outline:1,outlineData:1,multipleFieldFilters:0},u)}(e,i,n),c=function(e){return pw("Relationships",{xmlns:rF},[fw("Relationship",{Id:"rId1",Type:oF,Target:`../pivotCache/pivotCacheDefinition${e}.xml`})])}(r);return{cacheDefinitionXml:o,cacheDefinitionRels:a,cacheRecordsXml:s,pivotTableXml:l,pivotTableRels:c}}function sF(e,t,n){if(n.length<2)throw new Error(`Pivot "${e.name}" source sheet "${t}" needs at least a header row plus one data row (got ${n.length}).`);const r=n[0],i=[];for(let e=0;e<r.length;e++){const t=r[e];i.push(null==t?`Column${e+1}`:String(t))}const o=[];for(let e=1;e<n.length;e++){const t=n[e],r=[];for(let e=0;e<i.length;e++)r.push(e<t.length?t[e]:null);o.push(r)}const a=new Set(i),s=[...e.rows??[],...e.columns??[],...e.pages??[]];for(const t of e.values)s.push(t.field);for(const t of s)if(!a.has(t))throw new Error(`Pivot "${e.name}" references field "${t}" which is not in the source header (have: ${i.join(", ")}).`);const l=e.sourceRange??function(e,t){if(e<=0||t<=0)throw new Error("Pivot source range must contain at least one column and row");const n=dF(0,0),r=dF(t-1,e-1);return`${n}:${r}`}(i.length,n.length);return{sheetName:t,fieldNames:i,dataRows:o,ref:l}}function lF(e,t){for(const n of e){const e=n[t];if(null!=e&&""!==e&&("number"!=typeof e||!Number.isFinite(e)))return"string"}return"number"}function cF(e,t){if("string"===e.kind){const t=[];if(e.sharedStrings)for(const n of e.sharedStrings)t.push(fw("s",{v:n}));return hw("cacheField",{name:e.name,numFmtId:0},[hw("sharedItems",{count:t.length},t)])}let n=1/0,r=-1/0,i=!1;for(const o of t){const t=o[e.index];null!=t&&""!==t?"number"==typeof t&&(t<n&&(n=t),t>r&&(r=t)):i=!0}const o={containsSemiMixedTypes:0,containsString:0,containsNumber:1,containsInteger:Number.isInteger(n)&&Number.isInteger(r)?1:0};return i&&(o.containsBlank=1),Number.isFinite(n)&&(o.minValue=n),Number.isFinite(r)&&(o.maxValue=r),hw("cacheField",{name:e.name,numFmtId:0},[fw("sharedItems",o)])}function uF(e,t){if(null==e||""===e)return fw("m");if("string"===t.kind){const n=t.sharedIndex?.get(String(e));return void 0!==n?fw("x",{v:n}):fw("s",{v:String(e)})}return"number"==typeof e&&Number.isFinite(e)?fw("n",{v:e}):"boolean"==typeof e?fw("b",{v:e?1:0}):fw("s",{v:String(e)})}function fF(e){if("data"===e.axis)return fw("pivotField",{dataField:1,showAll:0});if("hidden"===e.axis)return fw("pivotField",{showAll:0});const t="row"===e.axis?"axisRow":"col"===e.axis?"axisCol":"axisPage",n=[];if(e.sharedStrings)for(let t=0;t<e.sharedStrings.length;t++)n.push(fw("item",{x:t}));return n.push(fw("item",{t:"default"})),hw("pivotField",{axis:t,showAll:0},[hw("items",{count:n.length},n)])}function dF(e,t){let n=t,r="";for(;n>=0;)r=String.fromCharCode(65+n%26)+r,n=Math.floor(n/26)-1;return`${r}${e+1}`}function hF(e,t){return`${"sum"===e?"Sum":"count"===e?"Count":"average"===e?"Average":"max"===e?"Max":"min"===e?"Min":"product"===e?"Product":"countNums"===e?"Count Nums":"stdDev"===e?"StdDev":"stdDevp"===e?"StdDevp":"var"===e?"Var":"Varp"} of ${t}`}function pF(e){return e.toISOString().replace(/\.\d{3}Z$/,"Z")}const gF=new TextEncoder;async function mF(e){const t=sk(e.sheets),{defaultFont:n,dateSystem:r,namedRanges:i,activeSheet:o,workbookProtection:a}=e;!function(e){const t=new Map;for(let n=0;n<e.length;n++){const r=e[n].name;ik(r,n);const i=r.toLowerCase(),o=t.get(i);if(void 0!==o)throw new yb(`Duplicate sheet name "${r}" (sheets ${o+1} and ${n+1}); Excel compares sheet names case-insensitively`);t.set(i,n)}}(t);const s=function(e){const t=e.properties;if(t?.description)return t;for(const n of e.sheets){const e=n.a11y?.summary;if(e&&e.trim().length>0)return{...t,description:e}}return t}(e),l=RS(n,{reuseStyleIdentity:!0}),c=function(){const e=[],t=new Map;return{add:function(n){const r=t.get(n);if(void 0!==r)return r;const i=e.length;return e.push(n),t.set(n,i),i},getAll:function(){return e},count:function(){return e.length}}}();let u=1;const f=[];for(const e of t)e.tables&&e.tables.length>0?(f.push(u),u+=e.tables.length):f.push(void 0);let d=1;const h=[];for(const e of t)e.pivotTables&&e.pivotTables.length>0?(h.push(d),d+=e.pivotTables.length):h.push(void 0);const p=[];for(let n=0;n<t.length;n++){const i=vk(t[n],l,c,r,f[n],"inline"===e.stringMode,h[n]);p.push(i)}const g=c.count()>0,m=[],y=[],v=new Set;let A=1,b=1;const w=[],I=[];for(let e=0;e<t.length;e++){const n=t[e],r=n.images&&n.images.length>0,i=n.textBoxes&&n.textBoxes.length>0,o=n.charts&&n.charts.length>0;if(r||i||o){const t=jS(n.images??[],A,n.textBoxes,n.charts,b);m.push(t),y.push(e+1);for(const e of t.images){const t=e.path.split(".").pop();t&&v.add(t)}n.images&&(A+=n.images.length);const r=[];if(n.charts){for(let e=0;e<n.charts.length;e++){const t=VS(n.charts[e],n.name),i=b+e;r.push({globalIndex:i,xml:t.chartXml,rels:t.chartRels}),I.push(i)}b+=n.charts.length}w.push(r)}else m.push(null),w.push([])}const{paths:x,nextIndex:C}=function(e,t,n){const r=[];let i=t;for(const t of e){if(!t.backgroundImage){r.push(null);continue}const e=US(t.backgroundImage);r.push(`xl/media/image${i}.${e}`),n.add(e),i++}return{paths:r,nextIndex:i}}(t,A,v);A=C;const B=[],E=[];for(let e=0;e<t.length;e++){const n=t[e];if(n.cells){const t=KS(n.cells,e);t?(B.push(t),E.push(e+1)):B.push(null)}else B.push(null)}const k=[];for(const e of p)for(const t of e.tables)k.push(t.globalTableIndex);const S=[];for(let e=0;e<t.length;e++){const n=t[e];if(!n.pivotTables||0===n.pivotTables.length)continue;const r=h[e];if(void 0!==r)for(let e=0;e<n.pivotTables.length;e++){const i=n.pivotTables[e],o=i.sourceSheet??n.name,a=t.find(e=>e.name===o);if(!a)throw new Error(`Pivot "${i.name}" sourceSheet "${o}" not found in workbook`);const s=yF(a),l=r+e,c=aF(i,sF(i,o,s),l-1,l);S.push({parts:c,globalIndex:l})}}const F=S.map(e=>e.globalIndex),D=S.map(e=>({rId:`rIdPivot${e.globalIndex}`,target:`pivotCache/pivotCacheDefinition${e.globalIndex}.xml`})),N=S.map((e,t)=>({cacheId:e.globalIndex-1,rId:D[t].rId})),M=new xS,Q=function(e){if(!e?.custom)return null;const t=Object.entries(e.custom);if(0===t.length)return null;const n=[];let r=2;for(const[e,i]of t){let t;if("string"==typeof i)t=hw("vt:lpwstr",void 0,lw(i));else if("number"==typeof i)t=Number.isInteger(i)?hw("vt:i4",void 0,String(i)):hw("vt:r8",void 0,String(i));else if("boolean"==typeof i)t=hw("vt:bool",void 0,i?"true":"false");else{if(!(i instanceof Date))continue;t=hw("vt:filetime",void 0,pF(i))}n.push(hw("property",{fmtid:"{D5CDD505-2E9C-101B-9397-08002B2CF9AE}",pid:r++,name:e},t))}return 0===n.length?null:pw("Properties",{xmlns:"http://schemas.openxmlformats.org/officeDocument/2006/custom-properties","xmlns:vt":"http://schemas.openxmlformats.org/officeDocument/2006/docPropsVTypes"},n)}(s),T=null!==Q,L=void 0!==e.vbaProject&&e.vbaProject.length>0,R=l.hasCheckboxFeature(),U=p.some(e=>e.hasDynamicArray),H={sheetCount:t.length,hasSharedStrings:g,drawingIndices:y.length>0?y:void 0,chartIndices:I.length>0?I:void 0,imageExtensions:v.size>0?v:void 0,commentIndices:E.length>0?E:void 0,tableIndices:k.length>0?k:void 0,pivotTableIndices:F.length>0?F:void 0,pivotCacheDefinitionIndices:F.length>0?F:void 0,pivotCacheRecordIndices:F.length>0?F:void 0,hasCoreProps:!0,hasAppProps:!0,hasCustomProps:T,hasMacros:L,hasFeaturePropertyBag:R,hasMetadata:U};M.add("[Content_Types].xml",gF.encode(function(e,t){let n;n="number"==typeof e?{sheetCount:e,hasSharedStrings:t??!1}:e;const r=[];if(r.push(fw("Default",{Extension:"rels",ContentType:"application/vnd.openxmlformats-package.relationships+xml"})),r.push(fw("Default",{Extension:"xml",ContentType:"application/xml"})),n.hasMacros&&r.push(fw("Default",{Extension:"bin",ContentType:"application/vnd.ms-office.vbaProject"})),n.imageExtensions)for(const e of n.imageExtensions){const t=CS[e];t&&r.push(fw("Default",{Extension:e,ContentType:t}))}r.push(fw("Override",{PartName:"/xl/workbook.xml",ContentType:n.hasMacros?"application/vnd.ms-excel.sheet.macroEnabled.main+xml":"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet.main+xml"}));for(let e=1;e<=n.sheetCount;e++)r.push(fw("Override",{PartName:`/xl/worksheets/sheet${e}.xml`,ContentType:"application/vnd.openxmlformats-officedocument.spreadsheetml.worksheet+xml"}));if(r.push(fw("Override",{PartName:"/xl/styles.xml",ContentType:"application/vnd.openxmlformats-officedocument.spreadsheetml.styles+xml"})),r.push(fw("Override",{PartName:"/xl/theme/theme1.xml",ContentType:"application/vnd.openxmlformats-officedocument.theme+xml"})),n.hasSharedStrings&&r.push(fw("Override",{PartName:"/xl/sharedStrings.xml",ContentType:"application/vnd.openxmlformats-officedocument.spreadsheetml.sharedStrings+xml"})),n.drawingIndices)for(const e of n.drawingIndices)r.push(fw("Override",{PartName:`/xl/drawings/drawing${e}.xml`,ContentType:"application/vnd.openxmlformats-officedocument.drawing+xml"}));if(n.chartIndices)for(const e of n.chartIndices)r.push(fw("Override",{PartName:`/xl/charts/chart${e}.xml`,ContentType:"application/vnd.openxmlformats-officedocument.drawingml.chart+xml"}));if(n.commentIndices&&n.commentIndices.length>0&&r.push(fw("Default",{Extension:"vml",ContentType:"application/vnd.openxmlformats-officedocument.vmlDrawing"})),n.commentIndices)for(const e of n.commentIndices)r.push(fw("Override",{PartName:`/xl/comments${e}.xml`,ContentType:"application/vnd.openxmlformats-officedocument.spreadsheetml.comments+xml"}));if(n.tableIndices)for(const e of n.tableIndices)r.push(fw("Override",{PartName:`/xl/tables/table${e}.xml`,ContentType:"application/vnd.openxmlformats-officedocument.spreadsheetml.table+xml"}));if(n.threadedCommentSheetIndices)for(const e of n.threadedCommentSheetIndices)r.push(fw("Override",{PartName:`/xl/threadedComments/threadedComment${e}.xml`,ContentType:"application/vnd.ms-excel.threadedcomments+xml"}));if(n.hasPersons&&r.push(fw("Override",{PartName:"/xl/persons/person.xml",ContentType:"application/vnd.ms-excel.person+xml"})),n.externalLinkIndices)for(const e of n.externalLinkIndices)r.push(fw("Override",{PartName:`/xl/externalLinks/externalLink${e}.xml`,ContentType:"application/vnd.openxmlformats-officedocument.spreadsheetml.externalLink+xml"}));if(n.hasCellImages&&r.push(fw("Override",{PartName:"/xl/cellimages.xml",ContentType:"application/vnd.openxmlformats-officedocument.drawing+xml"})),n.pivotTableIndices)for(const e of n.pivotTableIndices)r.push(fw("Override",{PartName:`/xl/pivotTables/pivotTable${e}.xml`,ContentType:"application/vnd.openxmlformats-officedocument.spreadsheetml.pivotTable+xml"}));if(n.pivotCacheDefinitionIndices)for(const e of n.pivotCacheDefinitionIndices)r.push(fw("Override",{PartName:`/xl/pivotCache/pivotCacheDefinition${e}.xml`,ContentType:"application/vnd.openxmlformats-officedocument.spreadsheetml.pivotCacheDefinition+xml"}));if(n.pivotCacheRecordIndices)for(const e of n.pivotCacheRecordIndices)r.push(fw("Override",{PartName:`/xl/pivotCache/pivotCacheRecords${e}.xml`,ContentType:"application/vnd.openxmlformats-officedocument.spreadsheetml.pivotCacheRecords+xml"}));if(n.slicerIndices)for(const e of n.slicerIndices)r.push(fw("Override",{PartName:`/xl/slicers/slicer${e}.xml`,ContentType:"application/vnd.ms-excel.slicer+xml"}));if(n.slicerCacheIndices)for(const e of n.slicerCacheIndices)r.push(fw("Override",{PartName:`/xl/slicerCaches/slicerCache${e}.xml`,ContentType:"application/vnd.ms-excel.slicerCache+xml"}));if(n.timelineIndices)for(const e of n.timelineIndices)r.push(fw("Override",{PartName:`/xl/timelines/timeline${e}.xml`,ContentType:"application/vnd.ms-excel.timeline+xml"}));if(n.timelineCacheIndices)for(const e of n.timelineCacheIndices)r.push(fw("Override",{PartName:`/xl/timelineCaches/timelineCache${e}.xml`,ContentType:"application/vnd.ms-excel.timelineCache+xml"}));if(n.chartStyleIndices)for(const e of n.chartStyleIndices)r.push(fw("Override",{PartName:`/xl/charts/style${e}.xml`,ContentType:"application/vnd.ms-office.chartstyle+xml"}));if(n.chartColorsIndices)for(const e of n.chartColorsIndices)r.push(fw("Override",{PartName:`/xl/charts/colors${e}.xml`,ContentType:"application/vnd.ms-office.chartcolorstyle+xml"}));return n.hasMetadata&&r.push(fw("Override",{PartName:`/${ek}`,ContentType:"application/vnd.openxmlformats-officedocument.spreadsheetml.sheetMetadata+xml"})),n.hasFeaturePropertyBag&&r.push(fw("Override",{PartName:`/${hE}`,ContentType:"application/vnd.ms-excel.featurepropertybag+xml"})),n.hasCoreProps&&r.push(fw("Override",{PartName:"/docProps/core.xml",ContentType:"application/vnd.openxmlformats-package.core-properties+xml"})),n.hasAppProps&&r.push(fw("Override",{PartName:"/docProps/app.xml",ContentType:"application/vnd.openxmlformats-officedocument.extended-properties+xml"})),n.hasCustomProps&&r.push(fw("Override",{PartName:"/docProps/custom.xml",ContentType:"application/vnd.openxmlformats-officedocument.custom-properties+xml"})),pw("Types",{xmlns:"http://schemas.openxmlformats.org/package/2006/content-types"},r)}(H))),M.add("_rels/.rels",gF.encode(function(e){const t=[];t.push(fw("Relationship",{Id:"rId1",Type:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/officeDocument",Target:"xl/workbook.xml"}));let n=2;return e?.hasCoreProps&&t.push(fw("Relationship",{Id:"rId"+n++,Type:"http://schemas.openxmlformats.org/package/2006/relationships/metadata/core-properties",Target:"docProps/core.xml"})),e?.hasAppProps&&t.push(fw("Relationship",{Id:"rId"+n++,Type:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/extended-properties",Target:"docProps/app.xml"})),e?.hasCustomProps&&t.push(fw("Relationship",{Id:"rId"+n++,Type:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/custom-properties",Target:"docProps/custom.xml"})),pw("Relationships",{xmlns:BS},t)}({hasCoreProps:!0,hasAppProps:!0,hasCustomProps:T}))),M.add("docProps/core.xml",gF.encode(function(e){const t=[];e?.title&&t.push(hw("dc:title",void 0,lw(e.title))),e?.subject&&t.push(hw("dc:subject",void 0,lw(e.subject))),e?.creator&&t.push(hw("dc:creator",void 0,lw(e.creator))),e?.keywords&&t.push(hw("cp:keywords",void 0,lw(e.keywords))),e?.description&&t.push(hw("dc:description",void 0,lw(e.description))),e?.lastModifiedBy&&t.push(hw("cp:lastModifiedBy",void 0,lw(e.lastModifiedBy))),e?.category&&t.push(hw("cp:category",void 0,lw(e.category))),e?.created&&t.push(hw("dcterms:created",{"xsi:type":"dcterms:W3CDTF"},pF(e.created)));const n=e?.modified??new Date;return t.push(hw("dcterms:modified",{"xsi:type":"dcterms:W3CDTF"},pF(n))),pw("cp:coreProperties",{"xmlns:cp":"http://schemas.openxmlformats.org/package/2006/metadata/core-properties","xmlns:dc":"http://purl.org/dc/elements/1.1/","xmlns:dcterms":"http://purl.org/dc/terms/","xmlns:xsi":"http://www.w3.org/2001/XMLSchema-instance"},t)}(s))),M.add("docProps/app.xml",gF.encode(function(e){const t=[];return t.push(hw("Application",void 0,"hucre")),t.push(hw("DocSecurity",void 0,"0")),e?.company&&t.push(hw("Company",void 0,lw(e.company))),e?.manager&&t.push(hw("Manager",void 0,lw(e.manager))),pw("Properties",{xmlns:"http://schemas.openxmlformats.org/officeDocument/2006/extended-properties"},t)}(s))),Q&&M.add("docProps/custom.xml",gF.encode(Q));const q=function(e,t){const n=t?[...t]:[];for(const t of e){const e=t.pageSetup;if(!e)continue;e.printArea&&n.push({name:"_xlnm.Print_Area",range:`${t.name}!${e.printArea}`,scope:t.name});const r=[];e.printTitlesRow&&r.push(`${t.name}!${e.printTitlesRow}`),e.printTitlesColumn&&r.push(`${t.name}!${e.printTitlesColumn}`),r.length>0&&n.push({name:"_xlnm.Print_Titles",range:r.join(","),scope:t.name})}return n}(t,i);M.add("xl/workbook.xml",gF.encode(function(e,t,n,r,i,o,a,s,l){const c=[];for(let t=0;t<e.length;t++){const n=e[t],r={name:n.name,sheetId:t+1,"r:id":`rId${t+1}`};n.hidden?r.state="hidden":n.veryHidden&&(r.state="veryHidden"),c.push(fw("sheet",r))}const u=[];if("1904"===n&&u.push(fw("workbookPr",{date1904:1})),i){const e={};i.lockStructure&&(e.lockStructure=1),i.lockWindows&&(e.lockWindows=1),i.password&&(e.workbookPassword=nk(i.password)),u.push(fw("workbookProtection",e))}const f=r??0;if(u.push(hw("bookViews",void 0,[fw("workbookView",{xWindow:0,yWindow:0,windowWidth:16384,windowHeight:8192,activeTab:f})])),u.push(hw("sheets",void 0,c)),o&&o.length>0){const e=o.map(e=>fw("externalReference",{"r:id":e.rId}));u.push(hw("externalReferences",void 0,e))}if(t&&t.length>0){const n=new Map;for(let t=0;t<e.length;t++)n.set(e[t].name,t);const r=[];for(const e of t){const t={name:e.name};if(void 0!==e.scope){const r=n.get(e.scope);void 0!==r&&(t.localSheetId=r)}e.comment&&(t.comment=e.comment),r.push(hw("definedName",t,lw(e.range)))}u.push(hw("definedNames",void 0,r))}if(u.push(fw("calcPr",{calcId:0,fullCalcOnLoad:1})),a&&a.length>0){const e=a.map(e=>fw("pivotCache",{cacheId:e.cacheId,"r:id":e.rId}));u.push(hw("pivotCaches",void 0,e))}const d=[];if(s&&s.length>0){const e=hw("x14:slicerCaches",void 0,s.map(e=>fw("x14:slicerCache",{"r:id":e.rId})));d.push(hw("ext",{uri:"{BBE1A952-AA13-448E-AADC-164F8A28A991}","xmlns:x14":"http://schemas.microsoft.com/office/spreadsheetml/2009/9/main"},[e]))}if(l&&l.length>0){const e=hw("x15:timelineCachePivotCaches",void 0,l.map(e=>fw("x15:timelineCachePivotCache",{"r:id":e.rId})));d.push(hw("ext",{uri:"{7E03D99C-DC04-49D9-9315-930204A7B6E9}","xmlns:x15":"http://schemas.microsoft.com/office/spreadsheetml/2010/11/main"},[e]))}return d.length>0&&u.push(hw("extLst",void 0,d)),pw("workbook",{xmlns:"http://schemas.openxmlformats.org/spreadsheetml/2006/main","xmlns:r":"http://schemas.openxmlformats.org/officeDocument/2006/relationships"},u)}(t,q.length>0?q:void 0,r,o,a,void 0,N.length>0?N:void 0))),M.add("xl/_rels/workbook.xml.rels",gF.encode(function(e,t,n,r,i,o,a,s,l,c,u){const f=[];for(let t=1;t<=e;t++)f.push(fw("Relationship",{Id:`rId${t}`,Type:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/worksheet",Target:`worksheets/sheet${t}.xml`}));let d=e+1;if(f.push(fw("Relationship",{Id:`rId${d}`,Type:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/styles",Target:"styles.xml"})),d++,t&&(f.push(fw("Relationship",{Id:`rId${d}`,Type:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/sharedStrings",Target:"sharedStrings.xml"})),d++),f.push(fw("Relationship",{Id:`rId${d}`,Type:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/theme",Target:"theme/theme1.xml"})),d++,u&&(f.push(fw("Relationship",{Id:`rId${d}`,Type:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/sheetMetadata",Target:"metadata.xml"})),d++),n&&(f.push(fw("Relationship",{Id:`rId${d}`,Type:"http://schemas.microsoft.com/office/2006/relationships/vbaProject",Target:"vbaProject.bin"})),d++),r&&(f.push(fw("Relationship",{Id:`rId${d}`,Type:"http://schemas.microsoft.com/office/2022/11/relationships/FeaturePropertyBag",Target:"featurePropertyBag/featurePropertyBag.xml"})),d++),i&&(f.push(fw("Relationship",{Id:`rId${d}`,Type:"http://schemas.microsoft.com/office/2017/10/relationships/person",Target:"persons/person.xml"})),d++),o){for(const e of o)f.push(fw("Relationship",{Id:e.rId,Type:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/externalLink",Target:e.target}));d+=o.length}if(c&&(f.push(fw("Relationship",{Id:`rId${d}`,Type:"http://www.wps.cn/officeDocument/2017/relationships/cellimage",Target:"cellimages.xml"})),d++),a)for(const e of a)f.push(fw("Relationship",{Id:e.rId,Type:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/pivotCacheDefinition",Target:e.target}));if(s)for(const e of s)f.push(fw("Relationship",{Id:e.rId,Type:"http://schemas.microsoft.com/office/2007/relationships/slicerCache",Target:e.target}));if(l)for(const e of l)f.push(fw("Relationship",{Id:e.rId,Type:"http://schemas.microsoft.com/office/2011/relationships/timelineCache",Target:e.target}));return pw("Relationships",{xmlns:BS},f)}(t.length,g,L,R,void 0,void 0,D.length>0?D:void 0,void 0,void 0,void 0,U))),M.add("xl/styles.xml",gF.encode(l.toXml())),M.add("xl/theme/theme1.xml",gF.encode('<?xml version="1.0" encoding="UTF-8" standalone="yes"?>\n<a:theme xmlns:a="http://schemas.openxmlformats.org/drawingml/2006/main" name="Office Theme"><a:themeElements><a:clrScheme name="Office"><a:dk1><a:sysClr val="windowText" lastClr="000000"/></a:dk1><a:lt1><a:sysClr val="window" lastClr="FFFFFF"/></a:lt1><a:dk2><a:srgbClr val="44546A"/></a:dk2><a:lt2><a:srgbClr val="E7E6E6"/></a:lt2><a:accent1><a:srgbClr val="4472C4"/></a:accent1><a:accent2><a:srgbClr val="ED7D31"/></a:accent2><a:accent3><a:srgbClr val="A5A5A5"/></a:accent3><a:accent4><a:srgbClr val="FFC000"/></a:accent4><a:accent5><a:srgbClr val="5B9BD5"/></a:accent5><a:accent6><a:srgbClr val="70AD47"/></a:accent6><a:hlink><a:srgbClr val="0563C1"/></a:hlink><a:folHlink><a:srgbClr val="954F72"/></a:folHlink></a:clrScheme><a:fontScheme name="Office"><a:majorFont><a:latin typeface="Calibri Light"/><a:ea typeface=""/><a:cs typeface=""/></a:majorFont><a:minorFont><a:latin typeface="Calibri"/><a:ea typeface=""/><a:cs typeface=""/></a:minorFont></a:fontScheme><a:fmtScheme name="Office"><a:fillStyleLst><a:solidFill><a:schemeClr val="phClr"/></a:solidFill><a:solidFill><a:schemeClr val="phClr"/></a:solidFill><a:solidFill><a:schemeClr val="phClr"/></a:solidFill></a:fillStyleLst><a:lnStyleLst><a:ln w="6350"><a:solidFill><a:schemeClr val="phClr"/></a:solidFill></a:ln><a:ln w="12700"><a:solidFill><a:schemeClr val="phClr"/></a:solidFill></a:ln><a:ln w="19050"><a:solidFill><a:schemeClr val="phClr"/></a:solidFill></a:ln></a:lnStyleLst><a:effectStyleLst><a:effectStyle><a:effectLst/></a:effectStyle><a:effectStyle><a:effectLst/></a:effectStyle><a:effectStyle><a:effectLst/></a:effectStyle></a:effectStyleLst><a:bgFillStyleLst><a:solidFill><a:schemeClr val="phClr"/></a:solidFill><a:solidFill><a:schemeClr val="phClr"/></a:solidFill><a:solidFill><a:schemeClr val="phClr"/></a:solidFill></a:bgFillStyleLst></a:fmtScheme></a:themeElements></a:theme>')),g&&M.add("xl/sharedStrings.xml",gF.encode(function(e){const t=e.getAll(),n=t.length;if(0===n)return pw("sst",{xmlns:lk,count:0,uniqueCount:0},"");const r=[];for(const e of t)r.push(hw("si",void 0,[dw(e)]));return pw("sst",{xmlns:lk,count:n,uniqueCount:n},r)}(c))),U&&M.add(ek,gF.encode(function(){const e=fw("metadataType",{name:KE,minSupportedVersion:12e4,copy:1,pasteAll:1,pasteValues:1,merge:1,splitFirst:1,rowColShift:1,clearFormats:1,clearComments:1,assign:1,coerce:1,cellMeta:1}),t=hw("bk",void 0,[hw("extLst",void 0,[hw("ext",{uri:ZE},[fw("xda:dynamicArrayProperties",{fDynamic:1,fCollapsed:0})])])]),n=hw("bk",void 0,[fw("rc",{t:1,v:0})]);return pw("metadata",{xmlns:"http://schemas.openxmlformats.org/spreadsheetml/2006/main","xmlns:xda":"http://schemas.microsoft.com/office/spreadsheetml/2017/dynamicarray"},[hw("metadataTypes",{count:1},[e]),hw("futureMetadata",{name:KE,count:1},[t]),hw("cellMetadata",{count:1},[n])])}())),R&&M.add(hE,gF.encode(function(){const e=[fw("bag",{type:"Checkbox"}),hw("bag",{type:"XFControls"},[hw("bagId",{k:"CellControl"},"0")]),hw("bag",{type:"XFComplement"},[hw("bagId",{k:"XFControls"},"1")]),hw("bag",{type:"XFComplements",extRef:"XFComplementsMapperExtRef"},[hw("a",{k:"MappedFeaturePropertyBags"},[hw("bagId",void 0,"2")])])];return pw("FeaturePropertyBags",{xmlns:fE},e)}())),L&&M.add("xl/vbaProject.bin",e.vbaProject);for(let e=0;e<p.length;e++){const n=p[e],r=m[e],i=B[e];M.add(`xl/worksheets/sheet${e+1}.xml`,gF.encode(n.xml));const o=n.hyperlinkRelationships.length>0,a=null!==r&&null!==n.drawingRId,s=null!==i&&null!==n.legacyDrawingRId,l=n.tables.length>0,c=null!==n.pictureRId&&null!==x[e],u=n.pivotTables.length>0;if(o||a||s||l||c||u){const t=[];for(const e of n.hyperlinkRelationships)t.push(fw("Relationship",{Id:e.id,Type:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/hyperlink",Target:e.target,TargetMode:"External"}));a&&n.drawingRId&&t.push(fw("Relationship",{Id:n.drawingRId,Type:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/drawing",Target:`../drawings/drawing${e+1}.xml`})),s&&n.legacyDrawingRId&&n.commentsRId&&(t.push(fw("Relationship",{Id:n.legacyDrawingRId,Type:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/vmlDrawing",Target:`../drawings/vmlDrawing${e+1}.vml`})),t.push(fw("Relationship",{Id:n.commentsRId,Type:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/comments",Target:`../comments${e+1}.xml`})));for(const e of n.tables)t.push(fw("Relationship",{Id:e.rId,Type:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/table",Target:`../tables/table${e.globalTableIndex}.xml`}));if(c&&n.pictureRId&&x[e]){const r=`../${x[e].slice(3)}`;t.push(fw("Relationship",{Id:n.pictureRId,Type:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/image",Target:r}))}for(const e of n.pivotTables)t.push(fw("Relationship",{Id:e.rId,Type:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/pivotTable",Target:`../pivotTables/pivotTable${e.globalPivotIndex}.xml`}));const r=pw("Relationships",{xmlns:"http://schemas.openxmlformats.org/package/2006/relationships"},t);M.add(`xl/worksheets/_rels/sheet${e+1}.xml.rels`,gF.encode(r))}if(r){M.add(`xl/drawings/drawing${e+1}.xml`,gF.encode(r.drawingXml)),M.add(`xl/drawings/_rels/drawing${e+1}.xml.rels`,gF.encode(r.drawingRels));for(const e of r.images)M.add(e.path,e.data,{compress:!1})}const f=w[e];if(f&&f.length>0)for(const e of f)M.add(`xl/charts/chart${e.globalIndex}.xml`,gF.encode(e.xml)),M.add(`xl/charts/_rels/chart${e.globalIndex}.xml.rels`,gF.encode(e.rels));c&&x[e]&&t[e].backgroundImage&&M.add(x[e],t[e].backgroundImage,{compress:!1}),i&&(M.add(`xl/comments${e+1}.xml`,gF.encode(i.commentsXml)),M.add(`xl/drawings/vmlDrawing${e+1}.vml`,gF.encode(i.vmlXml)));const d=t[e];if(d.tables&&d.tables.length>0)for(let e=0;e<d.tables.length;e++){const t=d.tables[e],r=n.tables[e].globalTableIndex;let i=t.range;i||(i=eF(t,d));const o=ZS({...t,range:i},r);M.add(`xl/tables/table${r}.xml`,gF.encode(o.tableXml))}}for(const e of S){const t=e.globalIndex;M.add(`xl/pivotCache/pivotCacheDefinition${t}.xml`,gF.encode(e.parts.cacheDefinitionXml)),M.add(`xl/pivotCache/_rels/pivotCacheDefinition${t}.xml.rels`,gF.encode(e.parts.cacheDefinitionRels)),M.add(`xl/pivotCache/pivotCacheRecords${t}.xml`,gF.encode(e.parts.cacheRecordsXml)),M.add(`xl/pivotTables/pivotTable${t}.xml`,gF.encode(e.parts.pivotTableXml)),M.add(`xl/pivotTables/_rels/pivotTable${t}.xml.rels`,gF.encode(e.parts.pivotTableRels))}const O=await M.build(),P=e.encryption;return P?.password?iB(O,P.password,{spinCount:P.spinCount}):O}function yF(e){if(e.rows&&e.rows.length>0)return e.rows.map(e=>e.map(ak));if(e.data&&e.data.length>0&&e.columns&&e.columns.length>0){const t=[],n=e.columns.map(e=>e.header??e.key??"");t.push(n);for(const n of e.data){const r=e.columns.map(e=>{if(!e.key)return null;const t=n[e.key];return void 0===t?null:VE(t)});t.push(r)}return t}return[]}async function vF(e){if(!Ce(e))return{error:"wb is not an effective object"};if(!Ie(we(e,"sheets")))return{error:"wb.sheets is not an array"};let t=null;try{t=await mF(e)}catch(e){return{error:e}}return t}async function AF(e,t="data",n){if(!Ee(e)){let t="no filename";return console.log(t,e),{error:t}}if(Ee(t)||(t="data"),!Ie(n)){let e="data is not an array";return console.log(e,n),{error:e}}Ie(n)&&Ce(we(n,0,null))&&(n=lr(n));let r=db(n,t);if(De(r,"error"))return console.log(r.error),r;let i=await vF(r);if(De(i,"error"))return console.log(i.error),i;if(Ga())ub(e,new Blob([i]));else{let t="fs";(await import(t)).default.writeFileSync(e,i)}}function bF(e){if(!za(e))return new Blob;return new Blob([e])}function wF(e,t,n=""){if(!Dn(t))return{};let r={};return mn(t,function(t){r[t]=we(e,t,n)}),r}function IF(e,t){if(!xe(e))return{};if(!Dn(t))return{};let n={};return mn(t,function(t){De(e,t)&&(n[t]=we(e,t))}),n}function xF(e,t=0,n={}){fo(t)||(t=0),t=zi(t);let r=we(n,"rounding","");return"ROUND_HALF_UP"!==r&&"ROUND_HALF_EVEN"!==r&&(r="ROUND_HALF_UP"),Fe(e)?new Gl(e).toDecimalPlaces(t,Gl[r]).toNumber():""}function CF(e,t={}){if(!Fe(e))throw new Error("v is not a number");let n=we(t,"returnDigit");if(or(n)||(n=!1),xr(e))return n?0:Da(e);let r=null,i=null;for(let t=1;t<=16;t++){let n=e*Math.pow(10,t);if(Math.abs(n-Math.round(n))<1e-9){r=t,i=Jl(e,t);break}}return null===i&&(r=16,i=Da(e)),n?r:i}let BF=e=>{let t=1;e<0&&(t=-1);let n=null;if((e=Math.abs(e))<.1)for(let r=1;r<16;r++){let i=Math.pow(10,r);if((e*=i)<1){n={r:1/i,v:t*e};break}}else{if(e<1)return{r:1,v:t*e};if(e>=1)for(let r=1;r<16;r++){let i=Math.pow(10,r);if((e/=i)<1){n={r:i,v:t*e};break}}}if(null===n)throw new Error(`can not normalize v[${e}]`);return n};function EF(e,t,n={}){if(!Ee(e))return"";if(!fo(t))return e;if(t=zi(t),e.length<=t)return e;let r=we(n,"funWithMsg"),i="";if(ca(r)){let n=r(e,t);Ee(n)&&(i=n)}return Zo(e,t)+`...${i}`}function kF(e){let t=Ya();return i(Number(e),"SIGKILL",n=>{n?t.reject(n):t.resolve(`pid[${e}] killed`)}),t}function SF(e,t={}){let n=we(t,"fs"),r=!1;try{n.statSync(e),r=!0}catch{r=!1}return r}function FF(e,t={}){let n=we(t,"fs");return!!SF(e,{fs:n})&&(!n.lstatSync(e).isDirectory()&&!n.lstatSync(e).isSymbolicLink())}function DF(e){return FF(e,{fs:a})}function NF(e,t={}){let n=null,r=we(t,"fs"),i="";try{i=r.readFileSync(e,"utf8")}catch(e){n=e}return null!==n?{error:n}:{success:i}}function MF(e){return NF(e,{fs:a})}let QF={buildSpawnArgs:function(e,t=[]){if(Ie(t)||(t=[]),"win32"!==process.platform)return{file:e,args:t,opt:{}};let n=function(e){if("win32"!==process.platform)return e;if(/\.(cmd|exe|bat|ps1)$/i.test(e))return e;if(o.isAbsolute(e))return e;try{let t=r.execFileSync("where",[e],{encoding:"utf8",timeout:5e3,windowsHide:!0,shell:!1,stdio:["ignore","pipe","ignore"]}).trim().split(/\r?\n/),n=t.find(e=>/\.cmd$/i.test(e));return n||(t.find(e=>/\.exe$/i.test(e))||t[0]||e)}catch{return e}}(e);if(/\.exe$/i.test(n))return{file:n,args:t,opt:{}};if(/\.(cmd|bat)$/i.test(n)){let e=function(e){let t=we(MF(e),"success","");if(!Ee(t))return null;let n=t.match(/%dp0%\\(node_modules\\[^"]+)"/i);if(!n)return null;let r=o.dirname(e),i=o.join(r,n[1]);return DF(i)?i:null}(n);if(e)return/\.exe$/i.test(e)?{file:e,args:t,opt:{}}:{file:process.execPath,args:[e,...t],opt:{}};let r=t.map(e=>`"${e.replace(/(\\*)"/g,'$1$1\\"').replace(/(\\*)$/,"$1$1")}"`.replace(/[()%!^"<>&|]/g,"^$&")),a=`${i=n,i.replace(/[()%!^"<>&|;, ]/g,"^$&")} ${r.join(" ")}`;return{file:process.env.comspec||process.env.COMSPEC||"cmd.exe",args:["/d","/s","/c",`"${a}"`],opt:{windowsVerbatimArguments:!0}}}var i;return{file:n,args:t,opt:{}}},buildSpawnEnv:function(e=void 0){let t={...process.env,PYTHONIOENCODING:"utf-8"};if(void 0!==e){if("win32"===process.platform){let n=Object.keys(e).map(e=>e.toLowerCase());for(let e of Object.keys(t))n.includes(e.toLowerCase())&&delete t[e]}t={...t,...e}}return t}},{buildSpawnArgs:TF,buildSpawnEnv:LF}=QF,RF={funWithMsg:e=>`(truncated, total ${e.length} chars)`};function UF(e,t=[],n={}){let{timeoutMs:i=12e4,cwd:o=process.cwd(),input:a,validate:s,maxBuffer:l=10485760,onStdout:c,onStderr:u,env:f}=n,d=function(e){if(ca(e))return e;if(!Ee(e))return null;let t=e.split(",").map(e=>e.trim()).filter(Boolean);return 0===t.length?null:e=>{for(let n of t)if("nonempty"===n){if(!Ee(e)||""===e.trim())return!1}else if("json"===n)try{JSON.parse(e)}catch{return!1}else if("min:"===Zo(n,4)){let t=ta(n,4);if(!Fe(t))return!1;let r=zi(t);if(!Ee(e)||e.length<r)return!1}return!0}}(s),h=Date.now(),p=Ya(),g=LF(f),m=TF(e,t),y=r.spawn(m.file,m.args,{cwd:o,stdio:["pipe","pipe","pipe"],windowsHide:!0,env:g,...m.opt}),v="",A="",b=new TextDecoder("utf-8"),w=new TextDecoder("utf-8"),I=!1,x=!1;y.stdout.on("data",e=>{let t=b.decode(e,{stream:!0});t&&(ca(c)&&c(t),v.length<l&&(v+=t))}),y.stderr.on("data",e=>{let t=w.decode(e,{stream:!0});t&&(ca(u)&&u(t),A.length<l&&(A+=t))}),y.stdin.on("error",()=>{}),void 0!==a&&y.stdin.write(a,"utf8"),y.stdin.end();let C=setTimeout(()=>{I||(x=!0,kF(y.pid).catch(()=>{}),setTimeout(()=>{I||(I=!0,p.resolve({ok:!1,stdout:EF(v,500,RF),stderr:EF(A,500,RF),code:null,error:`TIMEOUT after ${i/1e3}s(子進程未能結束)`,durationMs:Date.now()-h,pid:y.pid}))},3e3).unref())},i);return y.on("error",e=>{I||(I=!0,clearTimeout(C),p.resolve({ok:!1,stdout:"",stderr:"",code:null,error:`${e.code||"UNKNOWN"}: ${e.message}`,durationMs:Date.now()-h,pid:y.pid}))}),y.on("close",(e,t)=>{if(I)return;I=!0,clearTimeout(C);let n=b.decode();n&&v.length<l&&(v+=n);let r=w.decode();r&&A.length<l&&(A+=r);let o=Date.now()-h;x?p.resolve({ok:!1,stdout:EF(v,500,RF),stderr:EF(A,500,RF),code:e,error:`TIMEOUT after ${i/1e3}s`,durationMs:o,pid:y.pid}):0===e?!d||d(v)?p.resolve({ok:!0,stdout:v,stderr:A,code:0,error:"",durationMs:o,pid:y.pid}):p.resolve({ok:!1,stdout:EF(v,500,RF),stderr:EF(A,500,RF),code:0,error:"OUTPUT_VALIDATION_FAILED",durationMs:o,pid:y.pid}):p.resolve({ok:!1,stdout:EF(v,500,RF),stderr:EF(A,1e3,RF),code:e,error:t?`Signal: ${t}`:`Exit code ${e}`,durationMs:o,pid:y.pid})}),p}let{buildSpawnArgs:HF,buildSpawnEnv:qF}=QF;function OF(e,t=[],n={}){Ie(t)||(t=[]),xe(n)||(n={});let i=we(n,"cwd");Ee(i)||(i=process.cwd());let o=we(n,"env");xe(o)||(o=void 0);let a=we(n,"timeoutMs");$i(a)||(a=null);let s=we(n,"exitGraceMs");fo(s)||(s=2e3);let l=we(n,"killWaitMs");fo(l)||(l=3e3);let c=we(n,"stderrKeep");fo(c)||(c=4e3);let u=we(n,"onLine"),f=we(n,"onStdout"),d=we(n,"onStderr"),h=we(n,"onExit"),p=Date.now(),g=!1,m=null,y=!1,v=!1,A=!1,b="",w="",I=null,x=null,C=null,B=Ya(),E=null,k={pid:null,exited:!1,write:null,writeLine:null,stop:null},S=e=>{g||(g=!0,clearTimeout(I),clearTimeout(x),clearTimeout(C),m={code:null,signal:null,exited:!0,timeout:y,killed:v,error:"",stderr:b,durationMs:Date.now()-p,pid:k.pid,...e},k.exited=!0,ca(h)&&h(m),B.resolve(m))},F=()=>E||(E=Ya(),B.then(e=>{E.resolve(e)}),E);if(!Ee(e))return k.write=async()=>!1,k.writeLine=async()=>!1,k.stop=F,setTimeout(()=>{S({error:"command 須為非空字串"})},1),k;let D,N=HF(e,t);try{D=r.spawn(N.file,N.args,{cwd:i,stdio:["pipe","pipe","pipe"],windowsHide:!0,env:qF(o),...N.opt})}catch(e){return k.write=async()=>!1,k.writeLine=async()=>!1,k.stop=F,setTimeout(()=>{S({error:`${e.code||"UNKNOWN"}: ${e.message}`})},1),k}k.pid=D.pid||null;let M=new TextDecoder("utf-8"),Q=new TextDecoder("utf-8"),T=(e,t)=>{w+=e;let n=w.indexOf("\n");for(;n>=0;){let e=w.slice(0,n);w=w.slice(n+1),e.endsWith("\r")&&(e=e.slice(0,-1)),ca(u)&&u(e),n=w.indexOf("\n")}if(t&&""!==w){let e=w;w="",e.endsWith("\r")&&(e=e.slice(0,-1)),ca(u)&&u(e)}},L=e=>{b=0!==c?(b+e).slice(-c):""};D.stdout.on("data",e=>{let t=M.decode(e,{stream:!0});t&&(ca(f)&&f(t),T(t,!1))}),D.stderr.on("data",e=>{let t=Q.decode(e,{stream:!0});t&&(ca(d)&&d(t),L(t))}),D.stdin.on("error",()=>{});let R=e=>{v=!0,kF(D.pid).catch(()=>{}),C=setTimeout(()=>{g||S({code:null,exited:!1,error:e})},l)};return null!==a&&(I=setTimeout(()=>{g||(y=!0,R(`TIMEOUT after ${a/1e3}s(子進程未能結束)`))},a)),D.on("error",e=>{S({error:`${e.code||"UNKNOWN"}: ${e.message}`})}),D.on("close",(e,t)=>{if(g)return;let n=M.decode();n&&(ca(f)&&f(n),T(n,!1)),T("",!0);let r=Q.decode();r&&(ca(d)&&d(r),L(r));let i="";y?i=`TIMEOUT after ${a/1e3}s`:v||(t?i=`Signal: ${t}`:0!==e&&(i=`Exit code ${e}`)),S({code:e,signal:t,error:i})}),k.write=e=>{let t=Ya();if(g||A||D.stdin.destroyed||!D.stdin.writable)return t.resolve(!1),t;try{D.stdin.write(String(e),"utf8",e=>{t.resolve(!e)})}catch{t.resolve(!1)}return t},k.writeLine=e=>k.write(String(e)+"\n"),k.stop=()=>{if(E)return E;if(E=Ya(),g)return E.resolve(m),E;A=!0;try{D.stdin.end()}catch{}return x=setTimeout(()=>{g||R("STOP_TIMEOUT(子進程未能結束)")},s),B.then(e=>{E.resolve(e)}),E},k}function PF(e,t){return e>t}function zF(e){return e&&e.length?Hm(e,ln,PF):void 0}function $F(e){return null==e?[]:function(e,t){return he(t,function(t){return e[t]})}(e,ft(e))}function jF(e,t,n,r){for(var i=-1,o=null==e?0:e.length;++i<o;){var a=e[i];t(r,a,n(a),e)}return r}function VF(e,t,n,r){return ht(e,function(e,i,o){t(r,e,n(e),o)}),r}var YF,GF,WF=Object.prototype.hasOwnProperty,JF=(YF=function(e,t,n){WF.call(e,n)?e[n].push(t):ei(e,n,[t])},function(e,t){var n=A(e)?jF:VF,r=GF?GF():{};return n(e,YF,fn(t),r)}),_F=JF;function XF(e,t){if(!Ie(e)||!Ie(t))return[];if(e.length!==t.length)return[];return vn(e,function(n,r){return Py(e[r],t[r])})}function KF(e,t={}){let n=we(t,"fs");if(!SF(e,{fs:n}))return!1;let r=n.lstatSync(e);return!r.isFile()&&!r.isSymbolicLink()}function ZF(e,t={}){let n=we(t,"fs");if(KF(e,{fs:n}))return{success:"input folder is already exists: "+e};if(SF(e,{fs:n}))return{error:"input path already exists: "+e};try{n.mkdirSync(e,{recursive:!0})}catch(e){return{error:e}}return{success:"done: "+e}}function eD(e,t={}){let n=we(t,"path"),r=we(t,"fs");if(!SF(e,{fs:r})){let t=ZF(e,{fs:r});return t.error?t.error:{success:"done: "+e}}if(!KF(e,{fs:r}))return{error:"input path is not a folder"};try{let t=r.readdirSync(e);for(let i of t){let t=n.join(e,i);r.statSync(t).isDirectory()?r.rmSync(t,{recursive:!0,force:!0}):r.unlinkSync(t)}}catch(e){return{error:e}}return{success:"done: "+e}}function tD(e,t,n={}){let r=we(n,"path"),i=we(n,"fs"),o=we(n,"useSync","");or(o)||(o=!0);let a="";return a=o?function(e,t,n={}){let r=we(n,"path"),i=we(n,"fs");if(!FF(e,{fs:i}))return{error:`fpSrc[${e}] is not a file`};try{ZF(r.dirname(t),{fs:i}),i.copyFileSync(e,t)}catch(e){return{error:e}}return{success:"done: "+t}}(e,t,{path:r,fs:i}):async function(e,t,n={}){let r=we(n,"path"),i=we(n,"fs");if(!FF(e,{fs:i}))return{error:`fpSrc[${e}] is not a file`};let o=null;return await(async(e,t)=>{ZF(r.dirname(t),{fs:i}),await new Promise((n,r)=>{let o=i.createReadStream(e),a=i.createWriteStream(t);o.on("error",r),a.on("error",r),a.on("finish",n),o.pipe(a)})})(e,t).then(()=>{o={success:"done: "+t}}).catch(e=>{o={error:e}}),o}(e,t,{path:r,fs:i}),a}function nD(e,t,n={}){let r=we(n,"path"),i=we(n,"fs");if(!KF(e,{fs:i}))return{error:`fpSrc[${e}] is not a folder`};try{i.readdirSync(e).forEach(function(n){let o=r.resolve(e,n),a=r.resolve(t,n),s=i.lstatSync(o);if(s.isDirectory())ZF(a,{fs:i}),nD(o,a,{path:r,fs:i});else if(s.isSymbolicLink()){let e=i.readlinkSync(o);i.symlinkSync(e,a)}else ZF(r.dirname(a),{fs:i}),i.copyFileSync(o,a)})}catch(e){return{error:e}}return{success:"done: "+t}}function rD(e,t,n={}){let r=we(n,"path"),i=we(n,"fs"),o=we(n,"useSync","");or(o)||(o=!0);let a="";return a=o?nD(e,t,{path:r,fs:i}):async function(e,t,n={}){let r=we(n,"path"),i=we(n,"fs");if(!KF(e,{fs:i}))return{error:`fpSrc[${e}] is not a folder`};let o=async(e,t)=>{let n=i.readdirSync(e);for(let a of n){let n=r.join(e,a),s=r.join(t,a),l=i.lstatSync(n);if(l.isDirectory())ZF(s,{fs:i}),await o(n,s);else if(l.isSymbolicLink()){let e=i.readlinkSync(n);i.symlinkSync(e,s)}else ZF(r.dirname(s),{fs:i}),await new Promise((e,t)=>{let r=i.createReadStream(n),o=i.createWriteStream(s);r.on("error",t),o.on("error",t),o.on("finish",e),r.pipe(o)})}},a=null;return await o(e,t).then(()=>{a={success:"done: "+t}}).catch(e=>{a={error:e}}),a}(e,t,{path:r,fs:i}),a}function iD(e){if(!Ee(e))return{path:"",isRoot:!1};for(;e.indexOf("\\\\")>=0;)e=e.replace("\\\\","\\");for(;e.indexOf("//")>=0;)e=e.replace("//","/");if(":"===ea(e,1))return{path:`${e}\\`,isRoot:!0};if("\\"===ea(e,1)){let t=Ma(e,1);return":"===ea(t,1)?{path:e,isRoot:!0}:{path:t,isRoot:!1}}if("/"===ea(e,1)){let t=Ma(e,1);return 0===t.length?{path:e,isRoot:!0}:{path:t,isRoot:!1}}return{path:e,isRoot:!1}}function oD(e){if(!Ee(e))return"";let t=iD(e);if(t.isRoot)return t.path;let n=t.path;try{n=n.split("\\").pop().split("/").pop()}catch(e){}return n}function aD(e){if(!Ee(e))return"";let t=iD(e);if(t.isRoot)return t.path;let n=oD(e=t.path);if(!Ee(n))return e;let r=iD(e=Ma(e,n.length));return r.isRoot,r.path}function sD(e,t="",n={}){let r=we(n,"fs"),i=we(n,"encoding","");if(Ee(i)||(i="utf8"),SF(e,{fs:r}))return{error:"input path already exists: "+e};if(FF(e,{fs:r}))return{error:"input file is already exists: "+e};let o=aD(e);KF(o,{fs:r})||ZF(o,{fs:r});try{r.writeFileSync(e,t,{encoding:i})}catch(e){return{error:e}}return{success:"done: "+e}}function lD(e){return ZF(e,{fs:a})}function cD(e,t={}){let n=we(t,"fs");if(!SF(e,{fs:n}))return{success:"file does not exist: "+e};if(!FF(e,{fs:n}))return{error:"input path is not a file: "+e};try{n.unlinkSync(e)}catch(e){return{error:e}}return{success:"done: "+e}}async function uD(e,t={}){let n=we(t,"numRetry");$i(n)||(n=5),n=zi(n);let r=we(t,"fs",null);if(!SF(e,{fs:r}))return"file does not exist: "+e;if(!FF(e,{fs:r}))return Promise.reject("input path is not a file: "+e);for(let t=0;t<n;t++)try{r.unlinkSync(e);break}catch(e){if("EBUSY"!==e.code)return Promise.reject(e);await ls(300)}return"done: "+e}function fD(e,t={}){let n=we(t,"fs");if(!SF(e,{fs:n}))return{success:"folder does not exist: "+e};if(!KF(e,{fs:n}))return{error:"input path is not a folder: "+e};try{n.rmSync(e,{recursive:!0,force:!0})}catch(e){return{error:e}}return{success:"done: "+e}}function dD(e){return fD(e,{fs:a})}async function hD(e,t={}){let n=we(t,"numRetry");$i(n)||(n=5),n=zi(n);let r=we(t,"fs",null);if(!SF(e,{fs:r}))return"folder does not exist: "+e;if(!KF(e,{fs:r}))return Promise.reject("input path is not a folder: "+e);for(let t=0;t<n;t++)try{r.rmSync(e,{recursive:!0,force:!0});break}catch(e){if("EBUSY"!==e.code)return Promise.reject(e);await ls(300)}return"done: "+e}async function pD(e,t,n={}){let r="",i=we(n,"fs"),o=we(n,"Readable");if(!Ee(e))throw new Error("urlIn in not an effective string");let a=aD(t),s=we(n,"fnOut","");Ee(s)||(s=oD(t)),KF(a,{fs:i})||ZF(a,{fs:i});let l=Ya();try{let n=await fetch(e);if(!n.ok)return l.reject(n.statusText),l;let a=i.createWriteStream(t);o.fromWeb(n.body).pipe(a),a.on("finish",()=>{l.resolve(t)}),a.on("error",e=>{r=e.message,l.reject(r)})}catch(e){r=e.message,l.reject(r)}return l}function gD(){if(!ca(t))throw new Error("invalid dayjs");return t().format("YYYY-MM-DDTHH:mm:ssZ")}function mD(e){if(!Ee(e))return"";let t=oD(e),n=Qo(t,".");if(rr(n)<=1)return t;let r="";try{n=To(n),r=go(n,".")}catch(e){}return r}function yD(e){return KF(e,{fs:a})}function vD(e,t={}){let n=we(t,"polling");or(n)||(n=!1);let r=we(t,"timeInterval");$i(r)||(r=100),r=zi(r);let i=we(t,"timeBinaryInterval");$i(i)||(i=300),i=zi(i);let s=new u.EventEmitter,l=e,c=null,d=setInterval(()=>{if(null===c)yD(l)&&(c=f.watch(l,{usePolling:n,interval:r,binaryInterval:i,awaitWriteFinish:!0}),c.on("all",(e,t,n)=>{t=o.resolve(t),s.emit("change",{type:e,fp:t,stats:n}),"unlinkDir"===e&&o.resolve(l)===t&&setTimeout(()=>{h()},1)}));else if(!yD(l)){let e=a.fstatSync;s.emit("change",{type:"unlinkDir",fp:o.resolve(l),stats:e}),setTimeout(()=>{h()},1)}},r),h=()=>{if(null!==c){try{c.unwatch(l)}catch(e){console.log(e)}c.close().catch(e=>{console.log(e)}).finally(()=>{c=null})}};return s.clear=()=>{h(),clearInterval(d)},s}function AD(e,t={}){let n=we(t,"fs"),r=we(t,"crypto"),i=we(t,"type","");Ee(i)||(i="sha512");let o=Ya();if(!FF(e,{fs:n}))return o.reject(`fp[${e}] is not a file`),o;try{let t=r.createHash(i),a=n.createReadStream(e);a.on("readable",()=>{let e=a.read();e?t.update(e):o.resolve(t.digest("hex"))}),a.on("error",e=>{o.reject(e.toString())})}catch(e){o.reject(e.toString())}return o}const bD=new Uint8Array([0,97,115,109,1,0,0,0,1,48,8,96,3,127,127,127,1,127,96,3,127,127,127,0,96,2,127,127,0,96,1,127,1,127,96,3,127,127,126,1,126,96,3,126,127,127,1,126,96,2,127,126,0,96,1,127,1,126,3,11,10,0,0,2,1,3,4,5,6,1,7,5,3,1,0,1,7,85,9,3,109,101,109,2,0,5,120,120,104,51,50,0,0,6,105,110,105,116,51,50,0,2,8,117,112,100,97,116,101,51,50,0,3,8,100,105,103,101,115,116,51,50,0,4,5,120,120,104,54,52,0,5,6,105,110,105,116,54,52,0,7,8,117,112,100,97,116,101,54,52,0,8,8,100,105,103,101,115,116,54,52,0,9,10,251,22,10,242,1,1,4,127,32,0,32,1,106,33,3,32,1,65,16,79,4,127,32,3,65,16,107,33,6,32,2,65,168,136,141,161,2,106,33,3,32,2,65,137,235,208,208,7,107,33,4,32,2,65,207,140,162,142,6,106,33,5,3,64,32,3,32,0,40,2,0,65,247,148,175,175,120,108,106,65,13,119,65,177,243,221,241,121,108,33,3,32,4,32,0,65,4,106,34,0,40,2,0,65,247,148,175,175,120,108,106,65,13,119,65,177,243,221,241,121,108,33,4,32,2,32,0,65,4,106,34,0,40,2,0,65,247,148,175,175,120,108,106,65,13,119,65,177,243,221,241,121,108,33,2,32,5,32,0,65,4,106,34,0,40,2,0,65,247,148,175,175,120,108,106,65,13,119,65,177,243,221,241,121,108,33,5,32,6,32,0,65,4,106,34,0,79,13,0,11,32,2,65,12,119,32,5,65,18,119,106,32,4,65,7,119,106,32,3,65,1,119,106,5,32,2,65,177,207,217,178,1,106,11,32,1,106,32,0,32,1,65,15,113,16,1,11,146,1,0,32,1,32,2,106,33,2,3,64,32,1,65,4,106,32,2,75,69,4,64,32,0,32,1,40,2,0,65,189,220,202,149,124,108,106,65,17,119,65,175,214,211,190,2,108,33,0,32,1,65,4,106,33,1,12,1,11,11,3,64,32,1,32,2,79,69,4,64,32,0,32,1,45,0,0,65,177,207,217,178,1,108,106,65,11,119,65,177,243,221,241,121,108,33,0,32,1,65,1,106,33,1,12,1,11,11,32,0,32,0,65,15,118,115,65,247,148,175,175,120,108,34,0,65,13,118,32,0,115,65,189,220,202,149,124,108,34,0,65,16,118,32,0,115,11,63,0,32,0,65,8,106,32,1,65,168,136,141,161,2,106,54,2,0,32,0,65,12,106,32,1,65,137,235,208,208,7,107,54,2,0,32,0,65,16,106,32,1,54,2,0,32,0,65,20,106,32,1,65,207,140,162,142,6,106,54,2,0,11,195,4,1,6,127,32,1,32,2,106,33,6,32,0,65,24,106,33,4,32,0,65,40,106,40,2,0,33,3,32,0,32,0,40,2,0,32,2,106,54,2,0,32,0,65,4,106,34,5,32,5,40,2,0,32,2,65,16,79,32,0,40,2,0,65,16,79,114,114,54,2,0,32,2,32,3,106,65,16,73,4,64,32,3,32,4,106,32,1,32,2,252,10,0,0,32,0,65,40,106,32,2,32,3,106,54,2,0,15,11,32,3,4,64,32,3,32,4,106,32,1,65,16,32,3,107,34,2,252,10,0,0,32,0,65,8,106,34,3,32,3,40,2,0,32,4,40,2,0,65,247,148,175,175,120,108,106,65,13,119,65,177,243,221,241,121,108,54,2,0,32,0,65,12,106,34,3,32,3,40,2,0,32,4,65,4,106,40,2,0,65,247,148,175,175,120,108,106,65,13,119,65,177,243,221,241,121,108,54,2,0,32,0,65,16,106,34,3,32,3,40,2,0,32,4,65,8,106,40,2,0,65,247,148,175,175,120,108,106,65,13,119,65,177,243,221,241,121,108,54,2,0,32,0,65,20,106,34,3,32,3,40,2,0,32,4,65,12,106,40,2,0,65,247,148,175,175,120,108,106,65,13,119,65,177,243,221,241,121,108,54,2,0,32,0,65,40,106,65,0,54,2,0,32,1,32,2,106,33,1,11,32,1,32,6,65,16,107,77,4,64,32,6,65,16,107,33,8,32,0,65,8,106,40,2,0,33,2,32,0,65,12,106,40,2,0,33,3,32,0,65,16,106,40,2,0,33,5,32,0,65,20,106,40,2,0,33,7,3,64,32,2,32,1,40,2,0,65,247,148,175,175,120,108,106,65,13,119,65,177,243,221,241,121,108,33,2,32,3,32,1,65,4,106,34,1,40,2,0,65,247,148,175,175,120,108,106,65,13,119,65,177,243,221,241,121,108,33,3,32,5,32,1,65,4,106,34,1,40,2,0,65,247,148,175,175,120,108,106,65,13,119,65,177,243,221,241,121,108,33,5,32,7,32,1,65,4,106,34,1,40,2,0,65,247,148,175,175,120,108,106,65,13,119,65,177,243,221,241,121,108,33,7,32,8,32,1,65,4,106,34,1,79,13,0,11,32,0,65,8,106,32,2,54,2,0,32,0,65,12,106,32,3,54,2,0,32,0,65,16,106,32,5,54,2,0,32,0,65,20,106,32,7,54,2,0,11,32,1,32,6,73,4,64,32,4,32,1,32,6,32,1,107,34,1,252,10,0,0,32,0,65,40,106,32,1,54,2,0,11,11,97,1,1,127,32,0,65,16,106,40,2,0,33,1,32,0,65,4,106,40,2,0,4,127,32,1,65,12,119,32,0,65,20,106,40,2,0,65,18,119,106,32,0,65,12,106,40,2,0,65,7,119,106,32,0,65,8,106,40,2,0,65,1,119,106,5,32,1,65,177,207,217,178,1,106,11,32,0,40,2,0,106,32,0,65,24,106,32,0,65,40,106,40,2,0,16,1,11,255,3,2,3,126,1,127,32,0,32,1,106,33,6,32,1,65,32,79,4,126,32,6,65,32,107,33,6,32,2,66,214,235,130,238,234,253,137,245,224,0,124,33,3,32,2,66,177,169,172,193,173,184,212,166,61,125,33,4,32,2,66,249,234,208,208,231,201,161,228,225,0,124,33,5,3,64,32,3,32,0,41,3,0,66,207,214,211,190,210,199,171,217,66,126,124,66,31,137,66,135,149,175,175,152,182,222,155,158,127,126,33,3,32,4,32,0,65,8,106,34,0,41,3,0,66,207,214,211,190,210,199,171,217,66,126,124,66,31,137,66,135,149,175,175,152,182,222,155,158,127,126,33,4,32,2,32,0,65,8,106,34,0,41,3,0,66,207,214,211,190,210,199,171,217,66,126,124,66,31,137,66,135,149,175,175,152,182,222,155,158,127,126,33,2,32,5,32,0,65,8,106,34,0,41,3,0,66,207,214,211,190,210,199,171,217,66,126,124,66,31,137,66,135,149,175,175,152,182,222,155,158,127,126,33,5,32,6,32,0,65,8,106,34,0,79,13,0,11,32,2,66,12,137,32,5,66,18,137,124,32,4,66,7,137,124,32,3,66,1,137,124,32,3,66,207,214,211,190,210,199,171,217,66,126,66,31,137,66,135,149,175,175,152,182,222,155,158,127,126,133,66,135,149,175,175,152,182,222,155,158,127,126,66,157,163,181,234,131,177,141,138,250,0,125,32,4,66,207,214,211,190,210,199,171,217,66,126,66,31,137,66,135,149,175,175,152,182,222,155,158,127,126,133,66,135,149,175,175,152,182,222,155,158,127,126,66,157,163,181,234,131,177,141,138,250,0,125,32,2,66,207,214,211,190,210,199,171,217,66,126,66,31,137,66,135,149,175,175,152,182,222,155,158,127,126,133,66,135,149,175,175,152,182,222,155,158,127,126,66,157,163,181,234,131,177,141,138,250,0,125,32,5,66,207,214,211,190,210,199,171,217,66,126,66,31,137,66,135,149,175,175,152,182,222,155,158,127,126,133,66,135,149,175,175,152,182,222,155,158,127,126,66,157,163,181,234,131,177,141,138,250,0,125,5,32,2,66,197,207,217,178,241,229,186,234,39,124,11,32,1,173,124,32,0,32,1,65,31,113,16,6,11,134,2,0,32,1,32,2,106,33,2,3,64,32,2,32,1,65,8,106,79,4,64,32,1,41,3,0,66,207,214,211,190,210,199,171,217,66,126,66,31,137,66,135,149,175,175,152,182,222,155,158,127,126,32,0,133,66,27,137,66,135,149,175,175,152,182,222,155,158,127,126,66,157,163,181,234,131,177,141,138,250,0,125,33,0,32,1,65,8,106,33,1,12,1,11,11,32,1,65,4,106,32,2,77,4,64,32,0,32,1,53,2,0,66,135,149,175,175,152,182,222,155,158,127,126,133,66,23,137,66,207,214,211,190,210,199,171,217,66,126,66,249,243,221,241,153,246,153,171,22,124,33,0,32,1,65,4,106,33,1,11,3,64,32,1,32,2,73,4,64,32,0,32,1,49,0,0,66,197,207,217,178,241,229,186,234,39,126,133,66,11,137,66,135,149,175,175,152,182,222,155,158,127,126,33,0,32,1,65,1,106,33,1,12,1,11,11,32,0,32,0,66,33,136,133,66,207,214,211,190,210,199,171,217,66,126,34,0,32,0,66,29,136,133,66,249,243,221,241,153,246,153,171,22,126,34,0,32,0,66,32,136,133,11,77,0,32,0,65,8,106,32,1,66,214,235,130,238,234,253,137,245,224,0,124,55,3,0,32,0,65,16,106,32,1,66,177,169,172,193,173,184,212,166,61,125,55,3,0,32,0,65,24,106,32,1,55,3,0,32,0,65,32,106,32,1,66,249,234,208,208,231,201,161,228,225,0,124,55,3,0,11,244,4,2,3,127,4,126,32,1,32,2,106,33,5,32,0,65,40,106,33,4,32,0,65,200,0,106,40,2,0,33,3,32,0,32,0,41,3,0,32,2,173,124,55,3,0,32,2,32,3,106,65,32,73,4,64,32,3,32,4,106,32,1,32,2,252,10,0,0,32,0,65,200,0,106,32,2,32,3,106,54,2,0,15,11,32,3,4,64,32,3,32,4,106,32,1,65,32,32,3,107,34,2,252,10,0,0,32,0,65,8,106,34,3,32,3,41,3,0,32,4,41,3,0,66,207,214,211,190,210,199,171,217,66,126,124,66,31,137,66,135,149,175,175,152,182,222,155,158,127,126,55,3,0,32,0,65,16,106,34,3,32,3,41,3,0,32,4,65,8,106,41,3,0,66,207,214,211,190,210,199,171,217,66,126,124,66,31,137,66,135,149,175,175,152,182,222,155,158,127,126,55,3,0,32,0,65,24,106,34,3,32,3,41,3,0,32,4,65,16,106,41,3,0,66,207,214,211,190,210,199,171,217,66,126,124,66,31,137,66,135,149,175,175,152,182,222,155,158,127,126,55,3,0,32,0,65,32,106,34,3,32,3,41,3,0,32,4,65,24,106,41,3,0,66,207,214,211,190,210,199,171,217,66,126,124,66,31,137,66,135,149,175,175,152,182,222,155,158,127,126,55,3,0,32,0,65,200,0,106,65,0,54,2,0,32,1,32,2,106,33,1,11,32,1,65,32,106,32,5,77,4,64,32,5,65,32,107,33,2,32,0,65,8,106,41,3,0,33,6,32,0,65,16,106,41,3,0,33,7,32,0,65,24,106,41,3,0,33,8,32,0,65,32,106,41,3,0,33,9,3,64,32,6,32,1,41,3,0,66,207,214,211,190,210,199,171,217,66,126,124,66,31,137,66,135,149,175,175,152,182,222,155,158,127,126,33,6,32,7,32,1,65,8,106,34,1,41,3,0,66,207,214,211,190,210,199,171,217,66,126,124,66,31,137,66,135,149,175,175,152,182,222,155,158,127,126,33,7,32,8,32,1,65,8,106,34,1,41,3,0,66,207,214,211,190,210,199,171,217,66,126,124,66,31,137,66,135,149,175,175,152,182,222,155,158,127,126,33,8,32,9,32,1,65,8,106,34,1,41,3,0,66,207,214,211,190,210,199,171,217,66,126,124,66,31,137,66,135,149,175,175,152,182,222,155,158,127,126,33,9,32,2,32,1,65,8,106,34,1,79,13,0,11,32,0,65,8,106,32,6,55,3,0,32,0,65,16,106,32,7,55,3,0,32,0,65,24,106,32,8,55,3,0,32,0,65,32,106,32,9,55,3,0,11,32,1,32,5,73,4,64,32,4,32,1,32,5,32,1,107,34,1,252,10,0,0,32,0,65,200,0,106,32,1,54,2,0,11,11,188,2,1,5,126,32,0,65,24,106,41,3,0,33,1,32,0,41,3,0,34,2,66,32,90,4,126,32,0,65,8,106,41,3,0,34,3,66,1,137,32,0,65,16,106,41,3,0,34,4,66,7,137,124,32,1,66,12,137,32,0,65,32,106,41,3,0,34,5,66,18,137,124,124,32,3,66,207,214,211,190,210,199,171,217,66,126,66,31,137,66,135,149,175,175,152,182,222,155,158,127,126,133,66,135,149,175,175,152,182,222,155,158,127,126,66,157,163,181,234,131,177,141,138,250,0,125,32,4,66,207,214,211,190,210,199,171,217,66,126,66,31,137,66,135,149,175,175,152,182,222,155,158,127,126,133,66,135,149,175,175,152,182,222,155,158,127,126,66,157,163,181,234,131,177,141,138,250,0,125,32,1,66,207,214,211,190,210,199,171,217,66,126,66,31,137,66,135,149,175,175,152,182,222,155,158,127,126,133,66,135,149,175,175,152,182,222,155,158,127,126,66,157,163,181,234,131,177,141,138,250,0,125,32,5,66,207,214,211,190,210,199,171,217,66,126,66,31,137,66,135,149,175,175,152,182,222,155,158,127,126,133,66,135,149,175,175,152,182,222,155,158,127,126,66,157,163,181,234,131,177,141,138,250,0,125,5,32,1,66,197,207,217,178,241,229,186,234,39,124,11,32,2,124,32,0,65,40,106,32,2,66,31,131,167,16,6,11]);async function wD(){return function(e){const{exports:{mem:t,xxh32:n,xxh64:r,init32:i,update32:o,digest32:a,init64:s,update64:l,digest64:c}}=e;let u=new Uint8Array(t.buffer);function f(e,n){if(t.buffer.byteLength<e+n){const r=Math.ceil((e+n-t.buffer.byteLength)/65536);t.grow(r),u=new Uint8Array(t.buffer)}}function d(e,t,n,r,i,o){f(e);const a=new Uint8Array(e);return u.set(a),n(0,t),a.set(u.subarray(0,e)),{update(t){let n;return u.set(a),"string"==typeof t?(f(3*t.length,e),n=m.encodeInto(t,u.subarray(e)).written):(f(t.byteLength,e),u.set(t,e),n=t.byteLength),r(0,e,n),a.set(u.subarray(0,e)),this},digest:()=>(u.set(a),o(i(0)))}}function h(e){return e>>>0}const p=2n**64n-1n;function g(e){return e&p}const m=new TextEncoder;function y(e,t=0){return f(3*e.length,0),h(n(0,m.encodeInto(e,u).written,t))}function v(e,t=0n){return f(3*e.length,0),g(r(0,m.encodeInto(e,u).written,t))}return{h32:y,h32ToString:(e,t=0)=>y(e,t).toString(16).padStart(8,"0"),h32Raw:(e,t=0)=>(f(e.byteLength,0),u.set(e),h(n(0,e.byteLength,t))),create32:(e=0)=>d(48,e,i,o,a,h),h64:v,h64ToString:(e,t=0n)=>v(e,t).toString(16).padStart(16,"0"),h64Raw:(e,t=0n)=>(f(e.byteLength,0),u.set(e),g(r(0,e.byteLength,t))),create64:(e=0n)=>d(88,e,s,l,c,g)}}((await WebAssembly.instantiate(bD)).instance)}async function ID(e,t={}){let n=we(t,"fs"),r=we(t,"chunkSize");if(Fe(r)||(r=67108864),r=Ir(r),!FF(e,{fs:n}))return Promise.reject("fp is not a file");let i=Ya();try{let{create64:t}=await wD(),o=t(),a=n.createReadStream(e,{highWaterMark:r});a.on("data",e=>{o.update(e)}),a.on("end",()=>{let e=o.digest().toString(16).padStart(16,"0");i.resolve(e)}),a.on("error",i.reject)}catch(e){i.reject(e.toString())}return i}function xD(e,t={}){let n=we(t,"fs"),r=we(t,"crypto"),i=we(t,"type","");Ee(i)||(i="sha512");let o=we(t,"chunkSize");Fe(o)||(o=67108864),o=Ir(o);let a=Ya();return FF(e,{fs:n})?"xxhash64"===i?ID(e,{fs:n,chunkSize:o}):AD(e,{fs:n,crypto:r,type:i}):(a.reject(`fp[${e}] is not a file`),a)}function CD(e,t=1,n={}){let r=1,i=we(n,"path"),o=we(n,"fs");if(!KF(e,{fs:o}))throw new Error(`fd[${e}] is not a folder`);return null!==t&&$i(t)&&(t=zi(t))<1&&(t=1),function e(n){let a=[];return KF(n,{fs:o})?(mn(o.readdirSync(n),function(s){let l=i.resolve(n,s),c=null;try{c=o.statSync(l)}catch(e){}c&&c.isDirectory()?(a.push({isFolder:!0,level:r,path:l,name:i.basename(l)}),r+=1,(r<=t||null===t)&&(a=a.concat(e(l))),r-=1):a.push({isFolder:!1,level:r,path:l,name:i.basename(l)})}),a):a}(e)}function BD(e,t=1,n={}){let r=we(n,"path"),i=we(n,"fs");if(!KF(e,{fs:i}))throw new Error(`fd[${e}] is not a folder`);let o=[];return o=CD(e,t,{path:r,fs:i}),o=ra(o,{isFolder:!1}),o=vn(o,e=>(delete e.isFolder,e)),o}async function ED(e,t=1,n={}){let r=we(n,"path"),i=we(n,"fs"),o=we(n,"crypto"),a=we(n,"type","");if(Ee(a)||(a="md5"),!KF(e,{fs:i}))throw new Error(`fd[${e}] is not a folder`);let s=BD(e,t,{path:r,fs:i});return s=await Kl(s,async e=>{let t=we(e,"path","");return e.hashType=a,e.hash="",Ee(t)&&(e.hash=await xD(t,{fs:i,crypto:o,type:a,useSync:!1})),e}),s}async function kD(e,t=1,n={}){return ED(e,t,{path:o,fs:a,crypto:d,...n})}async function SD(e,t={}){let n=we(t,"path"),r=we(t,"fs"),i=we(t,"crypto"),o=we(t,"type","");Ee(o)||(o="md5");let a=[],s=CD(e,null,{path:n,fs:r});return await Kl(s,async e=>{if(e.isFolder)return;let t=await AD(e.path,{fs:r,crypto:i,type:o});a.push(t)}),go(a,"|")}function FD(e,t=1,n={}){let r=we(n,"path"),i=we(n,"fs");if(!KF(e,{fs:i}))throw new Error(`fd[${e}] is not a folder`);let o=[];return o=CD(e,t,{path:r,fs:i}),o=ra(o,{isFolder:!0}),o=vn(o,e=>(delete e.isFolder,e)),o}async function DD(e,t,n={}){let r="",i=we(n,"fs");if(!Dn(e))throw new Error("fpsIn in not an effective array");let o=aD(t),a=we(n,"fnOut","");Ee(a)||(a=oD(t)),KF(o,{fs:i})||ZF(o,{fs:i});let s=Ya();try{let n=i.createWriteStream(t);for(let t=0;t<e.length;t++){let o=e[t];if(!FF(o,{fs:i}))throw new Error(`fpIn[${o}] is not a file`);let a=()=>{let e=Ya(),t=i.createReadStream(o);return t.on("error",t=>{r=t.message,e.reject(t)}),t.on("end",()=>{cD(o,{fs:i}),e.resolve()}),t.pipe(n,{end:!1}),e};await a()}n.end(),n.on("error",e=>{r=e.message,s.reject(r)}),n.on("finish",()=>{let e={filename:a,path:t};s.resolve(e)})}catch(e){r=e.message,s.reject(r)}return s}function ND(e,t,n={}){let r=we(n,"fs");if(!FF(e,{fs:r}))return{error:`pahOld[${e}] is not a file`};if(SF(t,{fs:r}))return{error:`pahNew[${t}] already exists`};let i=aD(t);KF(i,{fs:r})||ZF(i,{fs:r});try{r.renameSync(e,t)}catch(e){return{error:e}}return{success:"done: "+t}}function MD(e,t,n={}){let r=we(n,"fs");if(!KF(e,{fs:r}))return{error:`pahOld[${e}] is not a folder`};if(SF(t,{fs:r}))return{error:`pahNew[${t}] already exists`};let i=aD(t);KF(i,{fs:r})||ZF(i,{fs:r});try{r.renameSync(e,t)}catch(e){return{error:e}}return{success:"done: "+t}}function QD(e,t,n,r={}){let i=we(r,"withInfor");or(i)||(i=!0);let o={del:[],add:[],same:[],diff:[]};if(!Ee(n))return console.log("invalid key"),i&&(o.infor={}),o;Ie(e)||(e=[e]),Ie(t)||(t=[t]),e=ra(e,e=>De(e,n)),t=ra(t,e=>De(e,n));let a=new Map(t.map(e=>[e[n],e]));for(let t of e){let e=a.get(t[n]);if(e){JSON.stringify(t)===JSON.stringify(e)?o.same.push(e):o.diff.push(e),a.delete(t[n])}else o.del.push(t)}if(o.add=Array.from(a.values()),i){let e={};for(let t of o.del)e[t[n]]="del";for(let t of o.add)e[t[n]]="add";for(let t of o.diff)e[t[n]]="diff";for(let t of o.same)e[t[n]]="same";o.infor=e}return o}async function TD(e,t=1,n={}){let r=we(n,"path"),i=we(n,"fs"),o=we(n,"crypto"),a=we(n,"type","");Ee(a)||(a="md5");let s=we(n,"forFile",null);or(s)||(s=!0);let l=we(n,"forFolder",null);if(or(l)||(l=!1),!KF(e,{fs:i}))throw new Error(`fd[${e}] is not a folder`);let c=CD(e,t,{path:r,fs:i});return c=await Kl(c,async e=>{let t="";return s&&!e.isFolder&&(t=await AD(e.path,{fs:i,crypto:o,type:a})),l&&e.isFolder&&(t=await SD(e.path,{path:r,fs:i,crypto:o,type:a})),e.hash=t,e}),c}async function LD(e,t,n={}){let r=we(n,"path"),i=we(n,"fs"),o=we(n,"crypto"),a=we(n,"type","");if(Ee(a)||(a="md5"),!KF(e,{fs:i}))throw new Error(`fdSrc[${e}] is not a folder`);let s=!1;if(!KF(t,{fs:i}))return await rD(e,t,{path:r,fs:i,useSync:!1}),s=!0,s;let l=r.sep,c=r.sep.length,u=(e,t)=>(e=vn(e,e=>((e,t)=>{let n=e.isFolder?"folder":"file",r=e.path.replace(t,"");return Zo(r,c)===l&&(r=ta(r,c)),r=r.replaceAll("\\","/"),{id:`${n}|${r}`,isFolder:e.isFolder,name:e.name,rpath:r,hash:e.hash}})(e,t)),e),f=await TD(e,null,{path:r,fs:i,crypto:o,type:a,forFile:!0,forFolder:!1});f=u(f,r.resolve(e));let d=await TD(t,null,{path:r,fs:i,crypto:o,type:a,forFile:!0,forFolder:!1});d=u(d,r.resolve(t));let h=QD(d,f,"id",{withInfor:!1});return s=rr(h.del)>0||rr(h.add)>0||rr(h.diff)>0,await Kl(h.del,async e=>{if(e.isFolder){fD(r.resolve(t,e.rpath),{fs:i})}}),await Kl(h.del,async e=>{if(!e.isFolder){cD(r.resolve(t,e.rpath),{fs:i})}}),await Kl([...h.add,...h.diff],async n=>{if(!n.isFolder){let o=r.resolve(e,n.rpath),a=r.resolve(t,n.rpath);await tD(o,a,{path:r,fs:i,useSync:!1})}}),s}function RD(e,t={}){let n=we(t,"polling");or(n)||(n=!1);let r=we(t,"timeInterval");$i(r)||(r=100),r=zi(r);let i=we(t,"timeBinaryInterval");$i(i)||(i=300),i=zi(i);let a=new u.EventEmitter,s=e,l=null,c=setInterval(()=>{null===l&&DF(s)&&(l=f.watch(s,{usePolling:n,interval:r,binaryInterval:i,awaitWriteFinish:!0}),l.on("all",(e,t,n)=>{t=o.resolve(t),a.emit("change",{type:e,fp:t,stats:n})}))},r);return a.clear=()=>{(()=>{if(null!==l){try{l.unwatch(s)}catch(e){console.log(e)}l.close().catch(e=>{console.log(e)}).finally(()=>{l=null})}})(),clearInterval(c)},a}function UD(e,t,n={}){let r=null,i=we(n,"fs"),o=aD(e);KF(o,{fs:i})||ZF(o,{fs:i});try{i.writeFileSync(e,t,"utf8")}catch(e){r=e}return null!==r?{error:r}:{success:e}}const HD=[];for(let e=0;e<256;++e)HD.push((e+256).toString(16).slice(1));const qD=new Uint8Array(16);function OD(){return crypto.getRandomValues(qD)}const PD={};function zD(e,t,n){let r;if(e)r=$D(e.random??e.rng?.()??OD(),e.msecs,e.seq,t,n);else{const e=Date.now(),i=OD();!function(e,t,n){e.msecs??=-1/0,e.seq??=0,t>e.msecs?(e.seq=jD(n),e.msecs=t):(e.seq=e.seq+1|0,0===e.seq&&e.msecs++)}(PD,e,i),r=$D(i,PD.msecs,PD.seq,t,n)}return t??function(e,t=0){return(HD[e[t+0]]+HD[e[t+1]]+HD[e[t+2]]+HD[e[t+3]]+"-"+HD[e[t+4]]+HD[e[t+5]]+"-"+HD[e[t+6]]+HD[e[t+7]]+"-"+HD[e[t+8]]+HD[e[t+9]]+"-"+HD[e[t+10]]+HD[e[t+11]]+HD[e[t+12]]+HD[e[t+13]]+HD[e[t+14]]+HD[e[t+15]]).toLowerCase()}(r)}function $D(e,t,n,r,i=0){if(e.length<16)throw new Error("Random bytes length must be >= 16");if(r){if(i<0||i+16>r.length)throw new RangeError(`UUID byte range ${i}:${i+15} is out of buffer bounds`)}else r=new Uint8Array(16),i=0;return t??=Date.now(),n??=jD(e),r[i++]=t/1099511627776&255,r[i++]=t/4294967296&255,r[i++]=t/16777216&255,r[i++]=t/65536&255,r[i++]=t/256&255,r[i++]=255&t,r[i++]=112|n>>>28&15,r[i++]=n>>>20&255,r[i++]=128|n>>>14&63,r[i++]=n>>>6&255,r[i++]=n<<2&255|3&e[10],r[i++]=e[11],r[i++]=e[12],r[i++]=e[13],r[i++]=e[14],r[i++]=e[15],r}function jD(e){return(127&e[6])<<24|e[7]<<16|e[8]<<8|e[9]}function VD(e){return"[object Uint16Array]"===Object.prototype.toString.call(e)}function YD(e){if(!(y(e)||rs(e)||za(e)||VD(e)))return null;try{if(e.byteLength)return e.byteLength}catch(e){}try{if(e.length)return e.length}catch(e){}try{if(e.size)return e.size}catch(e){}return null}function GD(e,t=!0){if(!Dn(e)){return{error:"no data"}}let n=null;try{n=function(e,t=!0){let n=t?"\ufeff":"";return mn(e,e=>{let t=[];mn(e,e=>{Be(e)?(e=ic(e,"\r\n",""),e=ic(e,"\r",""),e=`"${e=ic(e,"\n","")}"`):e=or(e)?e?"true":"false":Da(e),t.push(e)}),n+=go(t,",")+"\r\n"}),n}(e,t)}catch(e){return{error:e}}return n}function WD(e){return or(e)?e?"true":"false":Da(e)}function JD(e,t){let n=[];return mn(e,e=>{let r=vn(e.rows,e=>vn(e,e=>null===e?"":t?WD(e):e));n.push({sheetname:e.name,data:r})}),n}async function _D(e,t){let n=we(t,"fmt","ltdt");if(!la(["ltdt","csv","array"],n))return{error:"opt.fmt is not one of 'ltdt', 'csv', 'array'"};let r,i=we(t,"valueToString",!0);if(!or(i))return{error:"opt.valueToString is not a boolean"};try{r=await tS(e)}catch(e){return console.log("error: ",e),{error:"can not read data from u8a"}}let o=null;try{"ltdt"===n?o=function(e,t){let n=[];return mn(e,e=>{let r=e.rows,i=vn(we(r,0,[]),e=>null===e||""===e?null:WD(e)),o=[];for(let e=1;e<r.length;e++){let n=r[e];if(hn(n,e=>null===e))continue;let a={};for(let e=0;e<i.length;e++){if(null===i[e])continue;let r=we(n,e,null);null!==r&&(t&&(r=WD(r)),a[i[e]]=r)}o.push(a)}n.push({sheetname:e.name,data:o})}),n}(r.sheets,i):"array"===n?o=JD(r.sheets,i):"csv"===n&&(o=function(e,t){let n=JD(e,t);return mn(n,(e,t)=>{n[t].data=GD(e.data,!1)}),n}(r.sheets,i))}catch(e){return console.log("error: ",e),{error:"can not convert data"}}return o}var XD;function KD(e){if(!N(e))return!1;var t=D(e);return"[object Error]"==t||"[object DOMException]"==t||"string"==typeof e.message&&"string"==typeof e.name&&!gu(e)}function ZD(e){return KD(e)}
24
+ */!function(e){e.exports=function(){function e(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function t(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,s(r.key),r)}}function n(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function r(e,t,n){return(t=s(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function i(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function o(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?i(Object(n),!0).forEach(function(t){r(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):i(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function a(e,t){if("object"!=typeof e||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}function s(e){var t=a(e,"string");return"symbol"==typeof t?t:t+""}function l(e){return l="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},l(e)}var c={backdrop:!0,button:!0,navbar:!0,title:!0,toolbar:!0,className:"",container:"body",filter:null,fullscreen:!0,inheritedAttributes:["crossOrigin","decoding","isMap","loading","referrerPolicy","sizes","srcset","useMap"],initialCoverage:.9,initialViewIndex:0,inline:!1,interval:5e3,keyboard:!0,focus:!0,loading:!0,loop:!0,minWidth:200,minHeight:100,movable:!0,rotatable:!0,scalable:!0,zoomable:!0,zoomOnTouch:!0,zoomOnWheel:!0,slideOnTouch:!0,toggleOnDblclick:!0,tooltip:!0,transition:!0,zIndex:2015,zIndexInline:0,zoomRatio:.1,minZoomRatio:.01,maxZoomRatio:100,url:"src",ready:null,show:null,shown:null,hide:null,hidden:null,view:null,viewed:null,move:null,moved:null,rotate:null,rotated:null,scale:null,scaled:null,zoom:null,zoomed:null,play:null,stop:null},u='<div class="viewer-container" tabindex="-1" touch-action="none"><div class="viewer-canvas"></div><div class="viewer-footer"><div class="viewer-title"></div><div class="viewer-toolbar"></div><div class="viewer-navbar"><ul class="viewer-list" role="navigation"></ul></div></div><div class="viewer-tooltip" role="alert" aria-hidden="true"></div><div class="viewer-button" data-viewer-action="mix" role="button"></div><div class="viewer-player"></div></div>',f="undefined"!=typeof window&&void 0!==window.document,d=f?window:{},h=!(!f||!d.document.documentElement)&&"ontouchstart"in d.document.documentElement,p=!!f&&"PointerEvent"in d,g="viewer",m="move",y="switch",v="zoom",A="".concat(g,"-active"),b="".concat(g,"-close"),w="".concat(g,"-fade"),I="".concat(g,"-fixed"),x="".concat(g,"-fullscreen"),C="".concat(g,"-fullscreen-exit"),B="".concat(g,"-hide"),E="".concat(g,"-hide-md-down"),k="".concat(g,"-hide-sm-down"),S="".concat(g,"-hide-xs-down"),F="".concat(g,"-in"),D="".concat(g,"-invisible"),N="".concat(g,"-loading"),M="".concat(g,"-move"),Q="".concat(g,"-open"),T="".concat(g,"-show"),L="".concat(g,"-transition"),R="click",U="dblclick",H="dragstart",q="focusin",O="keydown",P="load",z="error",$=h?"touchend touchcancel":"mouseup",j=h?"touchmove":"mousemove",V=h?"touchstart":"mousedown",Y=p?"pointerdown":V,G=p?"pointermove":j,W=p?"pointerup pointercancel":$,J="resize",_="transitionend",X="wheel",K="ready",Z="show",ee="shown",te="hide",ne="hidden",re="view",ie="viewed",oe="move",ae="moved",se="rotate",le="rotated",ce="scale",ue="scaled",fe="zoom",de="zoomed",he="play",pe="stop",ge="".concat(g,"Action"),me=/\s+/,ye=["zoom-in","zoom-out","one-to-one","reset","prev","play","next","rotate-left","rotate-right","flip-horizontal","flip-vertical"];function ve(e){return"string"==typeof e}var Ae=Number.isNaN||d.isNaN;function be(e){return"number"==typeof e&&!Ae(e)}function we(e){return void 0===e}function Ie(e){return"object"===l(e)&&null!==e}var xe=Object.prototype.hasOwnProperty;function Ce(e){if(!Ie(e))return!1;try{var t=e.constructor,n=t.prototype;return t&&n&&xe.call(n,"isPrototypeOf")}catch(e){return!1}}function Be(e){return"function"==typeof e}function Ee(e,t){if(e&&Be(t))if(Array.isArray(e)||be(e.length)){var n,r=e.length;for(n=0;n<r&&!1!==t.call(e,e[n],n,e);n+=1);}else Ie(e)&&Object.keys(e).forEach(function(n){t.call(e,e[n],n,e)});return e}var ke=Object.assign||function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];return Ie(e)&&n.length>0&&n.forEach(function(t){Ie(t)&&Object.keys(t).forEach(function(n){e[n]=t[n]})}),e},Se=/^(?:width|height|left|top|marginLeft|marginTop)$/;function Fe(e,t){var n=e.style;Ee(t,function(e,t){Se.test(t)&&be(e)&&(e+="px"),n[t]=e})}function De(e){return ve(e)?e.replace(/&(?!amp;|quot;|#39;|lt;|gt;)/g,"&amp;").replace(/"/g,"&quot;").replace(/'/g,"&#39;").replace(/</g,"&lt;").replace(/>/g,"&gt;"):e}function Ne(e,t){return!(!e||!t)&&(e.classList?e.classList.contains(t):e.className.split(me).indexOf(t)>-1)}function Me(e,t){if(e&&t)if(be(e.length))Ee(e,function(e){Me(e,t)});else if(e.classList)e.classList.add(t);else{var n=e.className.trim();n?n.indexOf(t)<0&&(e.className="".concat(n," ").concat(t)):e.className=t}}function Qe(e,t){if(e&&t)if(be(e.length))Ee(e,function(e){Qe(e,t)});else if(e.classList)e.classList.remove(t);else{var n=e.className;n&&n.indexOf(t)>=0&&(e.className=n.split(me).filter(function(e){return e&&e!==t}).join(" "))}}function Te(e,t,n){t&&(be(e.length)?Ee(e,function(e){Te(e,t,n)}):n?Me(e,t):Qe(e,t))}var Le=/([a-z\d])([A-Z])/g;function Re(e){return e.replace(Le,"$1-$2").toLowerCase()}function Ue(e,t){return Ie(e[t])?e[t]:e.dataset?e.dataset[t]:e.getAttribute("data-".concat(Re(t)))}function He(e,t,n){Ie(n)?e[t]=n:e.dataset?e.dataset[t]=n:e.setAttribute("data-".concat(Re(t)),n)}var qe=function(){var e=!1;if(f){var t=!1,n=function(){},r=Object.defineProperty({},"once",{get:function(){return e=!0,t},set:function(e){t=e}});d.addEventListener("test",n,r),d.removeEventListener("test",n,r)}return e}();function Oe(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},i=n;t.trim().split(me).forEach(function(t){if(!qe){var o=e.listeners;o&&o[t]&&o[t][n]&&(i=o[t][n],delete o[t][n],0===Object.keys(o[t]).length&&delete o[t],0===Object.keys(o).length&&delete e.listeners)}e.removeEventListener(t,i,r)})}function Pe(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},i=n;t.trim().split(me).forEach(function(t){if(r.once&&!qe){var o=e.listeners,a=void 0===o?{}:o;i=function(){delete a[t][n],e.removeEventListener(t,i,r);for(var o=arguments.length,s=new Array(o),l=0;l<o;l++)s[l]=arguments[l];n.apply(e,s)},a[t]||(a[t]={}),a[t][n]&&e.removeEventListener(t,a[t][n],r),a[t][n]=i,e.listeners=a}e.addEventListener(t,i,r)})}function ze(e,t,n,r){var i;return Be(Event)&&Be(CustomEvent)?i=new CustomEvent(t,o({bubbles:!0,cancelable:!0,detail:n},r)):(i=document.createEvent("CustomEvent")).initCustomEvent(t,!0,!0,n),e.dispatchEvent(i)}function $e(e){var t=e.getBoundingClientRect();return{left:t.left+(window.pageXOffset-document.documentElement.clientLeft),top:t.top+(window.pageYOffset-document.documentElement.clientTop)}}function je(e){var t=e.rotate,n=e.scaleX,r=e.scaleY,i=e.translateX,o=e.translateY,a=[];be(i)&&0!==i&&a.push("translateX(".concat(i,"px)")),be(o)&&0!==o&&a.push("translateY(".concat(o,"px)")),be(t)&&0!==t&&a.push("rotate(".concat(t,"deg)")),be(n)&&1!==n&&a.push("scaleX(".concat(n,")")),be(r)&&1!==r&&a.push("scaleY(".concat(r,")"));var s=a.length?a.join(" "):"none";return{WebkitTransform:s,msTransform:s,transform:s}}function Ve(e){return ve(e)?decodeURIComponent(e.replace(/^.*\//,"").replace(/[?&#].*$/,"")):""}var Ye=d.navigator&&/Version\/\d+(\.\d+)+?\s+Safari/i.test(d.navigator.userAgent);function Ge(e,t,n){var r=document.createElement("img");if(e.naturalWidth&&!Ye)return n(e.naturalWidth,e.naturalHeight),r;var i=document.body||document.documentElement;return r.onload=function(){n(r.width,r.height),Ye||i.removeChild(r)},Ee(t.inheritedAttributes,function(t){var n=e.getAttribute(t);null!==n&&r.setAttribute(t,n)}),r.src=e.src,Ye||(r.style.cssText="left:0;max-height:none!important;max-width:none!important;min-height:0!important;min-width:0!important;opacity:0;position:absolute;top:0;z-index:-1;",i.appendChild(r)),r}function We(e){switch(e){case 2:return S;case 3:return k;case 4:return E;default:return""}}function Je(e){var t=o({},e),n=[];return Ee(e,function(e,r){delete t[r],Ee(t,function(t){var r=Math.abs(e.startX-t.startX),i=Math.abs(e.startY-t.startY),o=Math.abs(e.endX-t.endX),a=Math.abs(e.endY-t.endY),s=Math.sqrt(r*r+i*i),l=(Math.sqrt(o*o+a*a)-s)/s;n.push(l)})}),n.sort(function(e,t){return Math.abs(e)<Math.abs(t)}),n[0]}function _e(e,t){var n=e.pageX,r=e.pageY,i={endX:n,endY:r};return t?i:o({timeStamp:Date.now(),startX:n,startY:r},i)}function Xe(e){var t=0,n=0,r=0;return Ee(e,function(e){var i=e.startX,o=e.startY;t+=i,n+=o,r+=1}),{pageX:t/=r,pageY:n/=r}}var Ke,Ze={render:function(){this.initContainer(),this.initViewer(),this.initList(),this.renderViewer()},initBody:function(){var e=this.element.ownerDocument,t=e.body||e.documentElement;this.body=t,this.scrollbarWidth=window.innerWidth-e.documentElement.clientWidth,this.initialBodyPaddingRight=t.style.paddingRight,this.initialBodyComputedPaddingRight=window.getComputedStyle(t).paddingRight},initContainer:function(){this.containerData={width:window.innerWidth,height:window.innerHeight}},initViewer:function(){var e,t=this.options,n=this.parent;t.inline&&(e={width:Math.max(n.offsetWidth,t.minWidth),height:Math.max(n.offsetHeight,t.minHeight)},this.parentData=e),!this.fulled&&e||(e=this.containerData),this.viewerData=ke({},e)},renderViewer:function(){this.options.inline&&!this.fulled&&Fe(this.viewer,this.viewerData)},initList:function(){var e=this,t=this.element,n=this.options,r=this.list,i=[];r.innerHTML="",Ee(this.images,function(t,o){var a=t.src,s=t.alt||Ve(a),l=e.getImageURL(t);if(a||l){var c=document.createElement("li"),u=document.createElement("img");Ee(n.inheritedAttributes,function(e){var n=t.getAttribute(e);null!==n&&u.setAttribute(e,n)}),n.navbar&&(u.src=a||l),u.alt=s,u.setAttribute("data-original-url",l||a),c.setAttribute("data-index",o),c.setAttribute("data-viewer-action","view"),c.setAttribute("role","button"),n.keyboard&&c.setAttribute("tabindex",0),c.appendChild(u),r.appendChild(c),i.push(c)}}),this.items=i,Ee(i,function(t){var r,i,o=t.firstElementChild;He(o,"filled",!0),n.loading&&Me(t,N),Pe(o,P,r=function(r){Oe(o,z,i),n.loading&&Qe(t,N),e.loadImage(r)},{once:!0}),Pe(o,z,i=function(){Oe(o,P,r),n.loading&&Qe(t,N)},{once:!0})}),n.transition&&Pe(t,ie,function(){Me(r,L)},{once:!0})},renderList:function(){var e=this.index,t=this.items[e];if(t){var n=t.nextElementSibling,r=parseInt(window.getComputedStyle(n||t).marginLeft,10),i=t.offsetWidth,o=i+r;Fe(this.list,ke({width:o*this.length-r},je({translateX:(this.viewerData.width-i)/2-o*e})))}},resetList:function(){var e=this.list;e.innerHTML="",Qe(e,L),Fe(e,ke({width:0},je({translateX:0})))},initImage:function(e){var t,n=this,r=this.options,i=this.image,o=this.viewerData,a=this.footer.offsetHeight,s=o.width,l=Math.max(o.height-a,a),c=this.imageData||{};this.imageInitializing={abort:function(){t.onload=null}},t=Ge(i,r,function(t,i){var o=t/i,a=Math.max(0,Math.min(1,r.initialCoverage)),u=s,f=l;n.imageInitializing=!1,l*o>s?f=s/o:u=l*o,a=be(a)?a:.9,u=Math.min(u*a,t),f=Math.min(f*a,i);var d=(s-u)/2,h=(l-f)/2,p={left:d,top:h,x:d,y:h,width:u,height:f,oldRatio:1,ratio:u/t,aspectRatio:o,naturalWidth:t,naturalHeight:i},g=ke({},p);r.rotatable&&(p.rotate=c.rotate||0,g.rotate=0),r.scalable&&(p.scaleX=c.scaleX||1,p.scaleY=c.scaleY||1,g.scaleX=1,g.scaleY=1),n.imageData=p,n.initialImageData=g,e&&e()})},renderImage:function(e){var t=this,n=this.image,r=this.imageData;if(Fe(n,ke({width:r.width,height:r.height,marginLeft:r.x,marginTop:r.y},je(r))),e)if((this.viewing||this.moving||this.rotating||this.scaling||this.zooming)&&this.options.transition&&Ne(n,L)){var i=function(){t.imageRendering=!1,e()};this.imageRendering={abort:function(){Oe(n,_,i)}},Pe(n,_,i,{once:!0})}else e()},resetImage:function(){var e=this.image;e&&(this.viewing&&this.viewing.abort(),e.parentNode.removeChild(e),this.image=null,this.title.innerHTML="")}},et={bind:function(){var e=this.options,t=this.viewer,n=this.canvas,r=this.element.ownerDocument;Pe(t,R,this.onClick=this.click.bind(this)),Pe(t,H,this.onDragStart=this.dragstart.bind(this)),Pe(n,Y,this.onPointerDown=this.pointerdown.bind(this)),Pe(r,G,this.onPointerMove=this.pointermove.bind(this)),Pe(r,W,this.onPointerUp=this.pointerup.bind(this)),Pe(r,O,this.onKeyDown=this.keydown.bind(this)),Pe(window,J,this.onResize=this.resize.bind(this)),e.zoomable&&e.zoomOnWheel&&Pe(t,X,this.onWheel=this.wheel.bind(this),{passive:!1,capture:!0}),e.toggleOnDblclick&&Pe(n,U,this.onDblclick=this.dblclick.bind(this))},unbind:function(){var e=this.options,t=this.viewer,n=this.canvas,r=this.element.ownerDocument;Oe(t,R,this.onClick),Oe(t,H,this.onDragStart),Oe(n,Y,this.onPointerDown),Oe(r,G,this.onPointerMove),Oe(r,W,this.onPointerUp),Oe(r,O,this.onKeyDown),Oe(window,J,this.onResize),e.zoomable&&e.zoomOnWheel&&Oe(t,X,this.onWheel,{passive:!1,capture:!0}),e.toggleOnDblclick&&Oe(n,U,this.onDblclick)}},tt={click:function(e){var t=this.options,n=this.imageData,r=e.target,i=Ue(r,ge);switch(i||"img"!==r.localName||"li"!==r.parentElement.localName||(i=Ue(r=r.parentElement,ge)),h&&e.isTrusted&&r===this.canvas&&clearTimeout(this.clickCanvasTimeout),i){case"mix":this.played?this.stop():t.inline?this.fulled?this.exit():this.full():this.hide();break;case"hide":this.pointerMoved||this.hide();break;case"view":this.view(Ue(r,"index"));break;case"zoom-in":this.zoom(.1,!0);break;case"zoom-out":this.zoom(-.1,!0);break;case"one-to-one":this.toggle();break;case"reset":this.reset();break;case"prev":this.prev(t.loop);break;case"play":this.play(t.fullscreen);break;case"next":this.next(t.loop);break;case"rotate-left":this.rotate(-90);break;case"rotate-right":this.rotate(90);break;case"flip-horizontal":this.scaleX(-n.scaleX||-1);break;case"flip-vertical":this.scaleY(-n.scaleY||-1);break;default:this.played&&this.stop()}},dblclick:function(e){e.preventDefault(),this.viewed&&e.target===this.image&&(h&&e.isTrusted&&clearTimeout(this.doubleClickImageTimeout),this.toggle(e.isTrusted?e:e.detail&&e.detail.originalEvent))},load:function(){var e=this;this.timeout&&(clearTimeout(this.timeout),this.timeout=!1);var t=this.element,n=this.options,r=this.image,i=this.index,o=this.viewerData;Qe(r,D),n.loading&&Qe(this.canvas,N),r.style.cssText="height:0;"+"margin-left:".concat(o.width/2,"px;")+"margin-top:".concat(o.height/2,"px;")+"max-width:none!important;position:relative;width:0;",this.initImage(function(){Te(r,M,n.movable),Te(r,L,n.transition),e.renderImage(function(){e.viewed=!0,e.viewing=!1,Be(n.viewed)&&Pe(t,ie,n.viewed,{once:!0}),ze(t,ie,{originalImage:e.images[i],index:i,image:r},{cancelable:!1})})})},loadImage:function(e){var t=e.target,n=t.parentNode,r=n.offsetWidth||30,i=n.offsetHeight||50,o=!!Ue(t,"filled");Ge(t,this.options,function(e,n){var a=e/n,s=r,l=i;i*a>r?o?s=i*a:l=r/a:o?l=r/a:s=i*a,Fe(t,ke({width:s,height:l},je({translateX:(r-s)/2,translateY:(i-l)/2})))})},keydown:function(e){var t=this.options;if(t.keyboard){var n=e.keyCode||e.which||e.charCode;if(13===n&&this.viewer.contains(e.target)&&this.click(e),this.fulled)switch(n){case 27:this.played?this.stop():t.inline?this.fulled&&this.exit():this.hide();break;case 32:this.played&&this.stop();break;case 37:this.played&&this.playing?this.playing.prev():this.prev(t.loop);break;case 38:e.preventDefault(),this.zoom(t.zoomRatio,!0);break;case 39:this.played&&this.playing?this.playing.next():this.next(t.loop);break;case 40:e.preventDefault(),this.zoom(-t.zoomRatio,!0);break;case 48:case 49:e.ctrlKey&&(e.preventDefault(),this.toggle())}}},dragstart:function(e){"img"===e.target.localName&&e.preventDefault()},pointerdown:function(e){var t=this.options,n=this.pointers,r=e.buttons,i=e.button;if(this.pointerMoved=!1,!(!this.viewed||this.showing||this.viewing||this.hiding||("mousedown"===e.type||"pointerdown"===e.type&&"mouse"===e.pointerType)&&(be(r)&&1!==r||be(i)&&0!==i||e.ctrlKey))){e.preventDefault(),e.changedTouches?Ee(e.changedTouches,function(e){n[e.identifier]=_e(e)}):n[e.pointerId||0]=_e(e);var o=!!t.movable&&m;t.zoomOnTouch&&t.zoomable&&Object.keys(n).length>1?o=v:t.slideOnTouch&&("touch"===e.pointerType||"touchstart"===e.type)&&this.isSwitchable()&&(o=y),!t.transition||o!==m&&o!==v||Qe(this.image,L),this.action=o}},pointermove:function(e){var t=this.pointers,n=this.action;this.viewed&&n&&(e.preventDefault(),e.changedTouches?Ee(e.changedTouches,function(e){ke(t[e.identifier]||{},_e(e,!0))}):ke(t[e.pointerId||0]||{},_e(e,!0)),this.change(e))},pointerup:function(e){var t,n=this,r=this.options,i=this.action,o=this.pointers;e.changedTouches?Ee(e.changedTouches,function(e){t=o[e.identifier],delete o[e.identifier]}):(t=o[e.pointerId||0],delete o[e.pointerId||0]),i&&(e.preventDefault(),!r.transition||i!==m&&i!==v||Me(this.image,L),this.action=!1,h&&i!==v&&t&&Date.now()-t.timeStamp<500&&(clearTimeout(this.clickCanvasTimeout),clearTimeout(this.doubleClickImageTimeout),r.toggleOnDblclick&&this.viewed&&e.target===this.image?this.pointerMoved?this.imageClicked=!1:this.imageClicked?(this.imageClicked=!1,this.doubleClickImageTimeout=setTimeout(function(){ze(n.image,U,{originalEvent:e})},50)):(this.imageClicked=!0,this.doubleClickImageTimeout=setTimeout(function(){n.imageClicked=!1},500)):(this.imageClicked=!1,r.backdrop&&"static"!==r.backdrop&&e.target===this.canvas&&(this.clickCanvasTimeout=setTimeout(function(){ze(n.canvas,R,{originalEvent:e})},50)))))},resize:function(){var e=this;if(this.isShown&&!this.hiding&&(this.fulled&&(this.close(),this.initBody(),this.open()),this.initContainer(),this.initViewer(),this.renderViewer(),this.renderList(),this.viewed&&this.initImage(function(){e.renderImage()}),this.played)){if(this.options.fullscreen&&this.fulled&&!(document.fullscreenElement||document.webkitFullscreenElement||document.mozFullScreenElement||document.msFullscreenElement))return void this.stop();Ee(this.player.getElementsByTagName("img"),function(t){Pe(t,P,e.loadImage.bind(e),{once:!0}),ze(t,P)})}},wheel:function(e){var t=this;if(this.viewed&&(e.preventDefault(),!this.wheeling)){this.wheeling=!0,setTimeout(function(){t.wheeling=!1},50);var n=Number(this.options.zoomRatio)||.1,r=1;e.deltaY?r=e.deltaY>0?1:-1:e.wheelDelta?r=-e.wheelDelta/120:e.detail&&(r=e.detail>0?1:-1),this.zoom(-r*n,!0,null,e)}}},nt={show:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=this.element,n=this.options;if(n.inline||this.showing||this.isShown||this.showing)return this;if(!this.ready)return this.build(),this.ready&&this.show(e),this;if(Be(n.show)&&Pe(t,Z,n.show,{once:!0}),!1===ze(t,Z)||!this.ready)return this;this.hiding&&this.transitioning.abort(),this.showing=!0,this.open();var r=this.viewer;if(Qe(r,B),r.setAttribute("role","dialog"),r.setAttribute("aria-labelledby",this.title.id),r.setAttribute("aria-modal",!0),r.removeAttribute("aria-hidden"),n.transition&&!e){var i=this.shown.bind(this);this.transitioning={abort:function(){Oe(r,_,i),Qe(r,F)}},Me(r,L),r.initialOffsetWidth=r.offsetWidth,Pe(r,_,i,{once:!0}),Me(r,F)}else Me(r,F),this.shown();return this},hide:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]&&arguments[0],n=this.element,r=this.options;if(r.inline||this.hiding||!this.isShown&&!this.showing)return this;if(Be(r.hide)&&Pe(n,te,r.hide,{once:!0}),!1===ze(n,te))return this;this.showing&&this.transitioning.abort(),this.hiding=!0,this.played?this.stop():this.viewing&&this.viewing.abort();var i=this.viewer,o=this.image,a=function(){Qe(i,F),e.hidden()};if(r.transition&&!t){var s=function(t){t&&t.target===i&&(Oe(i,_,s),e.hidden())},l=function(){Ne(i,L)?(Pe(i,_,s),Qe(i,F)):a()};this.transitioning={abort:function(){e.viewed&&Ne(o,L)?Oe(o,_,l):Ne(i,L)&&Oe(i,_,s)}},this.viewed&&Ne(o,L)?(Pe(o,_,l,{once:!0}),this.zoomTo(0,!1,null,null,!0)):l()}else a();return this},view:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.options.initialViewIndex;if(t=Number(t)||0,this.hiding||this.played||t<0||t>=this.length||this.viewed&&t===this.index)return this;if(!this.isShown)return this.index=t,this.show();this.viewing&&this.viewing.abort();var n=this.element,r=this.options,i=this.title,o=this.canvas,a=this.items[t],s=a.querySelector("img"),l=Ue(s,"originalUrl"),c=s.getAttribute("alt"),u=document.createElement("img");if(Ee(r.inheritedAttributes,function(e){var t=s.getAttribute(e);null!==t&&u.setAttribute(e,t)}),u.src=l,u.alt=c,Be(r.view)&&Pe(n,re,r.view,{once:!0}),!1===ze(n,re,{originalImage:this.images[t],index:t,image:u})||!this.isShown||this.hiding||this.played)return this;var f=this.items[this.index];f&&(Qe(f,A),f.removeAttribute("aria-selected")),Me(a,A),a.setAttribute("aria-selected",!0),r.focus&&a.focus(),this.image=u,this.viewed=!1,this.index=t,this.imageData={},Me(u,D),r.loading&&Me(o,N),o.innerHTML="",o.appendChild(u),this.renderList(),i.innerHTML="";var d,h,p=function(){var t=e.imageData,n=Array.isArray(r.title)?r.title[1]:r.title;i.innerHTML=De(Be(n)?n.call(e,u,t):"".concat(c," (").concat(t.naturalWidth," × ").concat(t.naturalHeight,")"))};return Pe(n,ie,p,{once:!0}),this.viewing={abort:function(){Oe(n,ie,p),u.complete?e.imageRendering?e.imageRendering.abort():e.imageInitializing&&e.imageInitializing.abort():(u.src="",Oe(u,P,d),e.timeout&&clearTimeout(e.timeout))}},u.complete?this.load():(Pe(u,P,d=function(){Oe(u,z,h),e.load()},{once:!0}),Pe(u,z,h=function(){Oe(u,P,d),e.timeout&&(clearTimeout(e.timeout),e.timeout=!1),Qe(u,D),r.loading&&Qe(e.canvas,N)},{once:!0}),this.timeout&&clearTimeout(this.timeout),this.timeout=setTimeout(function(){Qe(u,D),e.timeout=!1},1e3)),this},prev:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=this.index-1;return t<0&&(t=e?this.length-1:0),this.view(t),this},next:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=this.length-1,n=this.index+1;return n>t&&(n=e?0:t),this.view(n),this},move:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:e,n=this.imageData;return this.moveTo(we(e)?e:n.x+Number(e),we(t)?t:n.y+Number(t)),this},moveTo:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:e,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,i=this.element,o=this.options,a=this.imageData;if(e=Number(e),n=Number(n),this.viewed&&!this.played&&o.movable){var s=a.x,l=a.y,c=!1;if(be(e)?c=!0:e=s,be(n)?c=!0:n=l,c){if(Be(o.move)&&Pe(i,oe,o.move,{once:!0}),!1===ze(i,oe,{x:e,y:n,oldX:s,oldY:l,originalEvent:r}))return this;a.x=e,a.y=n,a.left=e,a.top=n,this.moving=!0,this.renderImage(function(){t.moving=!1,Be(o.moved)&&Pe(i,ae,o.moved,{once:!0}),ze(i,ae,{x:e,y:n,oldX:s,oldY:l,originalEvent:r},{cancelable:!1})})}}return this},rotate:function(e){return this.rotateTo((this.imageData.rotate||0)+Number(e)),this},rotateTo:function(e){var t=this,n=this.element,r=this.options,i=this.imageData;if(be(e=Number(e))&&this.viewed&&!this.played&&r.rotatable){var o=i.rotate;if(Be(r.rotate)&&Pe(n,se,r.rotate,{once:!0}),!1===ze(n,se,{degree:e,oldDegree:o}))return this;i.rotate=e,this.rotating=!0,this.renderImage(function(){t.rotating=!1,Be(r.rotated)&&Pe(n,le,r.rotated,{once:!0}),ze(n,le,{degree:e,oldDegree:o},{cancelable:!1})})}return this},scaleX:function(e){return this.scale(e,this.imageData.scaleY),this},scaleY:function(e){return this.scale(this.imageData.scaleX,e),this},scale:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:e,r=this.element,i=this.options,o=this.imageData;if(e=Number(e),n=Number(n),this.viewed&&!this.played&&i.scalable){var a=o.scaleX,s=o.scaleY,l=!1;if(be(e)?l=!0:e=a,be(n)?l=!0:n=s,l){if(Be(i.scale)&&Pe(r,ce,i.scale,{once:!0}),!1===ze(r,ce,{scaleX:e,scaleY:n,oldScaleX:a,oldScaleY:s}))return this;o.scaleX=e,o.scaleY=n,this.scaling=!0,this.renderImage(function(){t.scaling=!1,Be(i.scaled)&&Pe(r,ue,i.scaled,{once:!0}),ze(r,ue,{scaleX:e,scaleY:n,oldScaleX:a,oldScaleY:s},{cancelable:!1})})}}return this},zoom:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null,i=this.imageData;return e=(e=Number(e))<0?1/(1-e):1+e,this.zoomTo(i.width*e/i.naturalWidth,t,n,r),this},zoomTo:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]&&arguments[1],r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null,o=arguments.length>4&&void 0!==arguments[4]&&arguments[4],a=this.element,s=this.options,l=this.pointers,c=this.imageData,u=c.x,f=c.y,d=c.width,h=c.height,p=c.naturalWidth,g=c.naturalHeight;if(be(e=Math.max(0,e))&&this.viewed&&!this.played&&(o||s.zoomable)){if(!o){var m=Math.max(.01,s.minZoomRatio),y=Math.min(100,s.maxZoomRatio);e=Math.min(Math.max(e,m),y)}if(i)switch(i.type){case"wheel":s.zoomRatio>=.055&&e>.95&&e<1.05&&(e=1);break;case"pointermove":case"touchmove":case"mousemove":e>.99&&e<1.01&&(e=1)}var v=p*e,A=g*e,b=v-d,w=A-h,I=c.ratio;if(Be(s.zoom)&&Pe(a,fe,s.zoom,{once:!0}),!1===ze(a,fe,{ratio:e,oldRatio:I,originalEvent:i}))return this;if(this.zooming=!0,i){var x=$e(this.viewer),C=l&&Object.keys(l).length>0?Xe(l):{pageX:i.pageX,pageY:i.pageY};c.x-=b*((C.pageX-x.left-u)/d),c.y-=w*((C.pageY-x.top-f)/h)}else Ce(r)&&be(r.x)&&be(r.y)?(c.x-=b*((r.x-u)/d),c.y-=w*((r.y-f)/h)):(c.x-=b/2,c.y-=w/2);c.left=c.x,c.top=c.y,c.width=v,c.height=A,c.oldRatio=I,c.ratio=e,this.renderImage(function(){t.zooming=!1,Be(s.zoomed)&&Pe(a,de,s.zoomed,{once:!0}),ze(a,de,{ratio:e,oldRatio:I,originalEvent:i},{cancelable:!1})}),n&&this.tooltip()}return this},play:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(!this.isShown||this.played)return this;var n=this.element,r=this.options;if(Be(r.play)&&Pe(n,he,r.play,{once:!0}),!1===ze(n,he))return this;var i=this.player,o=this.loadImage.bind(this),a=[],s=0,l=0;if(this.played=!0,this.onLoadWhenPlay=o,t&&this.requestFullscreen(t),Me(i,T),Ee(this.items,function(e,t){var n=e.querySelector("img"),c=document.createElement("img");c.src=Ue(n,"originalUrl"),c.alt=n.getAttribute("alt"),c.referrerPolicy=n.referrerPolicy,s+=1,Me(c,w),Te(c,L,r.transition),Ne(e,A)&&(Me(c,F),l=t),a.push(c),Pe(c,P,o,{once:!0}),i.appendChild(c)}),be(r.interval)&&r.interval>0){var c=function(){clearTimeout(e.playing.timeout),Qe(a[l],F),Me(a[l=(l-=1)>=0?l:s-1],F),e.playing.timeout=setTimeout(c,r.interval)},u=function(){clearTimeout(e.playing.timeout),Qe(a[l],F),Me(a[l=(l+=1)<s?l:0],F),e.playing.timeout=setTimeout(u,r.interval)};s>1&&(this.playing={prev:c,next:u,timeout:setTimeout(u,r.interval)})}return this},stop:function(){var e=this;if(!this.played)return this;var t=this.element,n=this.options;if(Be(n.stop)&&Pe(t,pe,n.stop,{once:!0}),!1===ze(t,pe))return this;var r=this.player;return clearTimeout(this.playing.timeout),this.playing=!1,this.played=!1,Ee(r.getElementsByTagName("img"),function(t){Oe(t,P,e.onLoadWhenPlay)}),Qe(r,T),r.innerHTML="",this.exitFullscreen(),this},full:function(){var e=this,t=this.options,n=this.viewer,r=this.image,i=this.list;return!this.isShown||this.played||this.fulled||!t.inline||(this.fulled=!0,this.open(),Me(this.button,C),t.transition&&(Qe(i,L),this.viewed&&Qe(r,L)),Me(n,I),n.setAttribute("role","dialog"),n.setAttribute("aria-labelledby",this.title.id),n.setAttribute("aria-modal",!0),n.removeAttribute("style"),Fe(n,{zIndex:t.zIndex}),t.focus&&this.enforceFocus(),this.initContainer(),this.viewerData=ke({},this.containerData),this.renderList(),this.viewed&&this.initImage(function(){e.renderImage(function(){t.transition&&setTimeout(function(){Me(r,L),Me(i,L)},0)})})),this},exit:function(){var e=this,t=this.options,n=this.viewer,r=this.image,i=this.list;return this.isShown&&!this.played&&this.fulled&&t.inline?(this.fulled=!1,this.close(),Qe(this.button,C),t.transition&&(Qe(i,L),this.viewed&&Qe(r,L)),t.focus&&this.clearEnforceFocus(),n.removeAttribute("role"),n.removeAttribute("aria-labelledby"),n.removeAttribute("aria-modal"),Qe(n,I),Fe(n,{zIndex:t.zIndexInline}),this.viewerData=ke({},this.parentData),this.renderViewer(),this.renderList(),this.viewed&&this.initImage(function(){e.renderImage(function(){t.transition&&setTimeout(function(){Me(r,L),Me(i,L)},0)})}),this):this},tooltip:function(){var e=this,t=this.options,n=this.tooltipBox,r=this.imageData;return this.viewed&&!this.played&&t.tooltip?(n.textContent="".concat(Math.round(100*r.ratio),"%"),this.tooltipping?clearTimeout(this.tooltipping):t.transition?(this.fading&&ze(n,_),Me(n,T),Me(n,w),Me(n,L),n.removeAttribute("aria-hidden"),n.initialOffsetWidth=n.offsetWidth,Me(n,F)):(Me(n,T),n.removeAttribute("aria-hidden")),this.tooltipping=setTimeout(function(){t.transition?(Pe(n,_,function(){Qe(n,T),Qe(n,w),Qe(n,L),n.setAttribute("aria-hidden",!0),e.fading=!1},{once:!0}),Qe(n,F),e.fading=!0):(Qe(n,T),n.setAttribute("aria-hidden",!0)),e.tooltipping=!1},1e3),this):this},toggle:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;return 1===this.imageData.ratio?this.zoomTo(this.imageData.oldRatio,!0,null,e):this.zoomTo(1,!0,null,e),this},reset:function(){return this.viewed&&!this.played&&(this.imageData=ke({},this.initialImageData),this.renderImage()),this},update:function(){var e=this,t=this.element,n=this.options,r=this.isImg;if(r&&!t.parentNode)return this.destroy();var i=[];if(Ee(r?[t]:t.querySelectorAll("img"),function(t){Be(n.filter)?n.filter.call(e,t)&&i.push(t):e.getImageURL(t)&&i.push(t)}),!i.length)return this;if(this.images=i,this.length=i.length,this.ready){var o=[];if(Ee(this.items,function(e,t){var n=e.querySelector("img"),r=i[t];r&&n&&r.src===n.src&&r.alt===n.alt||o.push(t)}),Fe(this.list,{width:"auto"}),this.initList(),this.isShown)if(this.length){if(this.viewed){var a=o.indexOf(this.index);if(a>=0)this.viewed=!1,this.view(Math.max(Math.min(this.index-a,this.length-1),0));else{var s=this.items[this.index];Me(s,A),s.setAttribute("aria-selected",!0)}}}else this.image=null,this.viewed=!1,this.index=0,this.imageData={},this.canvas.innerHTML="",this.title.innerHTML=""}else this.build();return this},destroy:function(){var e=this.element,t=this.options;return e[g]?(this.destroyed=!0,this.ready?(this.played&&this.stop(),t.inline?(this.fulled&&this.exit(),this.unbind()):this.isShown?(this.viewing&&(this.imageRendering?this.imageRendering.abort():this.imageInitializing&&this.imageInitializing.abort()),this.hiding&&this.transitioning.abort(),this.hidden()):this.showing&&(this.transitioning.abort(),this.hidden()),this.ready=!1,this.viewer.parentNode.removeChild(this.viewer)):t.inline&&(this.delaying?this.delaying.abort():this.initializing&&this.initializing.abort()),t.inline||(Oe(e,R,this.onElementClick),Oe(e,O,this.onElementKeyDown)),e[g]=void 0,this):this}},rt={getImageURL:function(e){var t=this.options.url;return t=ve(t)?e.getAttribute(t):Be(t)?t.call(this,e):""},enforceFocus:function(){var e=this;this.clearEnforceFocus(),Pe(document,q,this.onFocusin=function(t){var n=e.viewer,r=t.target;if(r!==document&&r!==n&&!n.contains(r)){for(;r;){if(null!==r.getAttribute("tabindex")||"true"===r.getAttribute("aria-modal"))return;r=r.parentElement}n.focus()}})},clearEnforceFocus:function(){this.onFocusin&&(Oe(document,q,this.onFocusin),this.onFocusin=null)},open:function(){var e=this.body;Me(e,Q),this.scrollbarWidth>0&&(e.style.paddingRight="".concat(this.scrollbarWidth+(parseFloat(this.initialBodyComputedPaddingRight)||0),"px"))},close:function(){var e=this.body;Qe(e,Q),this.scrollbarWidth>0&&(e.style.paddingRight=this.initialBodyPaddingRight)},shown:function(){var e=this.element,t=this.options,n=this.viewer;this.fulled=!0,this.isShown=!0,this.render(),this.bind(),this.showing=!1,t.focus&&(n.focus(),this.enforceFocus()),Be(t.shown)&&Pe(e,ee,t.shown,{once:!0}),!1!==ze(e,ee)&&this.ready&&this.isShown&&!this.hiding&&this.view(this.index)},hidden:function(){var e=this.element,t=this.options,n=this.viewer,r=n.ownerDocument.activeElement;r&&n.contains(r)&&Be(r.blur)&&r.blur(),t.focus&&this.clearEnforceFocus(),this.close(),this.unbind(),Me(n,B),n.removeAttribute("role"),n.removeAttribute("aria-labelledby"),n.removeAttribute("aria-modal"),n.setAttribute("aria-hidden",!0),this.resetList(),this.resetImage(),this.fulled=!1,this.viewed=!1,this.isShown=!1,this.hiding=!1,this.destroyed||(Be(t.hidden)&&Pe(e,ne,t.hidden,{once:!0}),ze(e,ne,null,{cancelable:!1}))},requestFullscreen:function(e){var t=this.element.ownerDocument;if(this.fulled&&!(t.fullscreenElement||t.webkitFullscreenElement||t.mozFullScreenElement||t.msFullscreenElement)){var n=t.documentElement;n.requestFullscreen?Ce(e)?n.requestFullscreen(e):n.requestFullscreen():n.webkitRequestFullscreen?n.webkitRequestFullscreen(Element.ALLOW_KEYBOARD_INPUT):n.mozRequestFullScreen?n.mozRequestFullScreen():n.msRequestFullscreen&&n.msRequestFullscreen()}},exitFullscreen:function(){var e=this.element.ownerDocument;this.fulled&&(e.fullscreenElement||e.webkitFullscreenElement||e.mozFullScreenElement||e.msFullscreenElement)&&(e.exitFullscreen?e.exitFullscreen():e.webkitExitFullscreen?e.webkitExitFullscreen():e.mozCancelFullScreen?e.mozCancelFullScreen():e.msExitFullscreen&&e.msExitFullscreen())},change:function(e){var t=this.options,n=this.pointers,r=n[Object.keys(n)[0]];if(r){var i=r.endX-r.startX,o=r.endY-r.startY;switch(this.action){case m:0===i&&0===o||(this.pointerMoved=!0,this.move(i,o,e));break;case v:this.zoom(Je(n),!1,null,e);break;case y:this.action="switched";var a=Math.abs(i);a>1&&a>Math.abs(o)&&(this.pointers={},i>1?this.prev(t.loop):i<-1&&this.next(t.loop))}Ee(n,function(e){e.startX=e.endX,e.startY=e.endY})}},isSwitchable:function(){var e=this.imageData,t=this.viewerData;return this.length>1&&e.x>=0&&e.y>=0&&e.width<=t.width&&e.height<=t.height}},it=d.Viewer,ot=(Ke=-1,function(){return Ke+=1}),at=function(){function t(n){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(e(this,t),!n||1!==n.nodeType)throw new Error("The first argument is required and must be an element.");this.element=n,this.options=ke({},c,Ce(r)&&r),this.action=!1,this.fading=!1,this.fulled=!1,this.hiding=!1,this.imageClicked=!1,this.imageData={},this.index=this.options.initialViewIndex,this.isImg=!1,this.isShown=!1,this.length=0,this.moving=!1,this.played=!1,this.playing=!1,this.pointers={},this.ready=!1,this.rotating=!1,this.scaling=!1,this.showing=!1,this.timeout=!1,this.tooltipping=!1,this.viewed=!1,this.viewing=!1,this.wheeling=!1,this.zooming=!1,this.pointerMoved=!1,this.id=ot(),this.init()}return n(t,[{key:"init",value:function(){var e=this,t=this.element,n=this.options;if(!t[g]){t[g]=this,n.focus&&!n.keyboard&&(n.focus=!1);var r="img"===t.localName,i=[];if(Ee(r?[t]:t.querySelectorAll("img"),function(t){Be(n.filter)?n.filter.call(e,t)&&i.push(t):e.getImageURL(t)&&i.push(t)}),this.isImg=r,this.length=i.length,this.images=i,this.initBody(),we(document.createElement(g).style.transition)&&(n.transition=!1),n.inline){var o=0,a=function(){var t;(o+=1)===e.length&&(e.initializing=!1,e.delaying={abort:function(){clearTimeout(t)}},t=setTimeout(function(){e.delaying=!1,e.build()},0))};this.initializing={abort:function(){Ee(i,function(e){e.complete||(Oe(e,P,a),Oe(e,z,a))})}},Ee(i,function(e){var t,n;e.complete?a():(Pe(e,P,t=function(){Oe(e,z,n),a()},{once:!0}),Pe(e,z,n=function(){Oe(e,P,t),a()},{once:!0}))})}else Pe(t,R,this.onElementClick=function(t){var r=t.target;"img"!==r.localName||Be(n.filter)&&!n.filter.call(e,r)||e.view(e.images.indexOf(r))}),Pe(t,O,this.onElementKeyDown=function(t){var r=t.target,i=t.key;"img"!==r.localName||"Enter"!==i&&" "!==i||(t.preventDefault(),Be(n.filter)&&!n.filter.call(e,r)||e.view(e.images.indexOf(r)))})}}},{key:"build",value:function(){if(!this.ready){var e=this.element,t=this.options,n=e.parentNode,r=document.createElement("div");r.innerHTML=u;var i=r.querySelector(".".concat(g,"-container")),o=i.querySelector(".".concat(g,"-title")),a=i.querySelector(".".concat(g,"-toolbar")),s=i.querySelector(".".concat(g,"-navbar")),l=i.querySelector(".".concat(g,"-button")),c=i.querySelector(".".concat(g,"-canvas"));if(this.parent=n,this.viewer=i,this.title=o,this.toolbar=a,this.navbar=s,this.button=l,this.canvas=c,this.footer=i.querySelector(".".concat(g,"-footer")),this.tooltipBox=i.querySelector(".".concat(g,"-tooltip")),this.player=i.querySelector(".".concat(g,"-player")),this.list=i.querySelector(".".concat(g,"-list")),i.id="".concat(g).concat(this.id),o.id="".concat(g,"Title").concat(this.id),Me(o,t.title?We(Array.isArray(t.title)?t.title[0]:t.title):B),Me(s,t.navbar?We(t.navbar):B),Te(l,B,!t.button),t.keyboard&&l.setAttribute("tabindex",0),t.backdrop&&(Me(i,"".concat(g,"-backdrop")),t.inline||"static"===t.backdrop||He(c,ge,"hide")),ve(t.className)&&t.className&&t.className.split(me).forEach(function(e){Me(i,e)}),t.toolbar){var f=document.createElement("ul"),d=Ce(t.toolbar),h=ye.slice(0,3),p=ye.slice(7,9),m=ye.slice(9);d||Me(a,We(t.toolbar)),Ee(d?t.toolbar:ye,function(e,n){var r=d&&Ce(e),i=d?Re(n):e,o=r&&!we(e.show)?e.show:e;if(o&&(t.zoomable||-1===h.indexOf(i))&&(t.rotatable||-1===p.indexOf(i))&&(t.scalable||-1===m.indexOf(i))){var a=r&&!we(e.size)?e.size:e,s=r&&!we(e.click)?e.click:e,l=document.createElement("li");t.keyboard&&l.setAttribute("tabindex",0),l.setAttribute("role","button"),Me(l,"".concat(g,"-").concat(i)),Be(s)||He(l,ge,i),be(o)&&Me(l,We(o)),-1!==["small","large"].indexOf(a)?Me(l,"".concat(g,"-").concat(a)):"play"===i&&Me(l,"".concat(g,"-large")),Be(s)&&Pe(l,R,s),f.appendChild(l)}}),a.appendChild(f)}else Me(a,B);if(!t.rotatable){var y=a.querySelectorAll('li[class*="rotate"]');Me(y,D),Ee(y,function(e){a.appendChild(e)})}if(t.inline)Me(l,x),Fe(i,{zIndex:t.zIndexInline}),"static"===window.getComputedStyle(n).position&&Fe(n,{position:"relative"}),n.insertBefore(i,e.nextSibling);else{Me(l,b),Me(i,I),Me(i,w),Me(i,B),Fe(i,{zIndex:t.zIndex});var v=t.container;ve(v)&&(v=e.ownerDocument.querySelector(v)),v||(v=this.body),v.appendChild(i)}t.inline&&(this.render(),this.bind(),this.isShown=!0),this.ready=!0,Be(t.ready)&&Pe(e,K,t.ready,{once:!0}),!1!==ze(e,K)?this.ready&&t.inline&&this.view(this.index):this.ready=!1}}}],[{key:"noConflict",value:function(){return window.Viewer=it,t}},{key:"setDefaults",value:function(e){ke(c,Ce(e)&&e)}}])}();return ke(at.prototype,Ze,et,tt,nt,rt),at}()}(My);var Qy=Br(My.exports);function Ty(e,t){void 0===t&&(t={});var n=t.insertAt;if(e&&"undefined"!=typeof document){var r=document.head||document.getElementsByTagName("head")[0],i=document.createElement("style");i.type="text/css","top"===n&&r.firstChild?r.insertBefore(i,r.firstChild):r.appendChild(i),i.styleSheet?i.styleSheet.cssText=e:i.appendChild(document.createTextNode(e))}}function Ly(e,t,n){(void 0!==n&&!te(e[t],n)||void 0===n&&!(t in e))&&ei(e,t,n)}function Ry(e){return N(e)&&ut(e)}function Uy(e,t){if(("constructor"!==t||"function"!=typeof e[t])&&"__proto__"!=t)return e[t]}function Hy(e,t,n,r,i,o,a){var s=Uy(e,n),l=Uy(t,n),c=a.get(l);if(c)Ly(e,n,c);else{var u,f=o?o(s,l,n+"",e,t,a):void 0,d=void 0===f;if(d){var h=A(l),p=!h&&je(l),g=!h&&!p&&tt(l);f=l,h||p||g?A(s)?f=s:Ry(s)?f=In(s):p?(d=!1,f=fi(l,!0)):g?(d=!1,f=bi(l,!0)):f=[]:gu(l)||Oe(l)?(f=s,Oe(s)?f=ri(u=s,ai(u)):R(s)&&!U(s)||(f=Ci(l))):d=!1}d&&(a.set(l,f),i(f,l,r,o,a),a.delete(l)),Ly(e,n,f)}}function qy(e,t,n,r,i){e!==t&&Qe(t,function(o,a){if(i||(i=new gt),R(o))Hy(e,t,a,n,qy,r,i);else{var s=r?r(Uy(e,a),o,a+"",e,t,i):void 0;void 0===s&&(s=o),Ly(e,a,s)}},ai)}Ty("/*!\n * Viewer.js v1.12.0\n * https://fengyuanchen.github.io/viewerjs\n *\n * Copyright 2015-present Chen Fengyuan\n * Released under the MIT license\n *\n * Date: 2026-08-22T13:00:37.884Z\n */\n\n.viewer-zoom-in::before, .viewer-zoom-out::before, .viewer-one-to-one::before, .viewer-reset::before, .viewer-prev::before, .viewer-play::before, .viewer-next::before, .viewer-rotate-left::before, .viewer-rotate-right::before, .viewer-flip-horizontal::before, .viewer-flip-vertical::before, .viewer-fullscreen::before, .viewer-fullscreen-exit::before, .viewer-close::before {\n background-image: url(\"data:image/svg+xml,%3Csvg xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22 viewBox%3D%220 0 560 40%22%3E%3Cpath fill%3D%22%23fff%22 d%3D%22M49.6 17.9h20.2v3.9H49.6zm123.1 2 10.9-11 2.7 2.8-8.2 8.2 8.2 8.2-2.7 2.7-10.9-10.9zm94 0-10.8-11-2.7 2.8 8.1 8.2-8.1 8.2 2.7 2.7 10.8-10.9zM212 9.3l20.1 10.6L212 30.5V9.3zm161.5 4.6-7.2 6 7.2 5.9v-4h12.4v4l7.3-5.9-7.3-6v4h-12.4v-4zm40.2 12.3 5.9 7.2 5.9-7.2h-4V13.6h4l-5.9-7.3-5.9 7.3h4v12.6h-4zm35.9-16.5h6.3v2h-4.3V16h-2V9.7Zm14 0h6.2V16h-2v-4.3h-4.2v-2Zm6.2 14V30h-6.2v-2h4.2v-4.3h2Zm-14 6.3h-6.2v-6.3h2v4.4h4.3v2Zm-438 .1v-8.3H9.6v-3.9h8.2V9.7h3.9v8.2h8.1v3.9h-8.1v8.3h-3.9zM93.6 9.7h-5.8v3.9h2V30h3.8V9.7zm16.1 0h-5.8v3.9h1.9V30h3.9V9.7zm-11.9 4.1h3.9v3.9h-3.9zm0 8.2h3.9v3.9h-3.9zm244.6-11.7 7.2 5.9-7.2 6v-3.6c-5.4-.4-7.8.8-8.7 2.8-.8 1.7-1.8 4.9 2.8 8.2-6.3-2-7.5-6.9-6-11.3 1.6-4.4 8-5 11.9-4.9v-3.1Zm147.2 13.4h6.3V30h-2v-4.3h-4.3v-2zm14 6.3v-6.3h6.2v2h-4.3V30h-1.9zm6.2-14h-6.2V9.7h1.9V14h4.3v2zm-13.9 0h-6.3v-2h4.3V9.7h2V16zm33.3 12.5 8.6-8.6-8.6-8.7 1.9-1.9 8.6 8.7 8.6-8.7 1.9 1.9-8.6 8.7 8.6 8.6-1.9 2-8.6-8.7-8.6 8.7-1.9-2zM297 10.3l-7.1 5.9 7.2 6v-3.6c5.3-.4 7.7.8 8.7 2.8.8 1.7 1.7 4.9-2.9 8.2 6.3-2 7.5-6.9 6-11.3-1.6-4.4-7.9-5-11.8-4.9v-3.1Zm-157.3-.6c2.3 0 4.4.7 6 2l2.5-3 1.9 9.2h-9.3l2.6-3.1a6.2 6.2 0 0 0-9.9 5.1c0 3.4 2.8 6.3 6.2 6.3 2.8 0 5.1-1.9 6-4.4h4c-1 4.7-5 8.3-10 8.3a10 10 0 0 1-10-10.2 10 10 0 0 1 10-10.2Z%22%2F%3E%3C%2Fsvg%3E\");\n background-repeat: no-repeat;\n background-size: 280px;\n color: transparent;\n display: block;\n font-size: 0;\n height: 20px;\n line-height: 0;\n width: 20px;\n }\n\n.viewer-zoom-in::before {\n background-position: 0 0;\n content: 'Zoom In';\n}\n\n.viewer-zoom-out::before {\n background-position: -20px 0;\n content: 'Zoom Out';\n}\n\n.viewer-one-to-one::before {\n background-position: -40px 0;\n content: 'One to One';\n}\n\n.viewer-reset::before {\n background-position: -60px 0;\n content: 'Reset';\n}\n\n.viewer-prev::before {\n background-position: -80px 0;\n content: 'Previous';\n}\n\n.viewer-play::before {\n background-position: -100px 0;\n content: 'Play';\n}\n\n.viewer-next::before {\n background-position: -120px 0;\n content: 'Next';\n}\n\n.viewer-rotate-left::before {\n background-position: -140px 0;\n content: 'Rotate Left';\n}\n\n.viewer-rotate-right::before {\n background-position: -160px 0;\n content: 'Rotate Right';\n}\n\n.viewer-flip-horizontal::before {\n background-position: -180px 0;\n content: 'Flip Horizontal';\n}\n\n.viewer-flip-vertical::before {\n background-position: -200px 0;\n content: 'Flip Vertical';\n}\n\n.viewer-fullscreen::before {\n background-position: -220px 0;\n content: 'Enter Full Screen';\n}\n\n.viewer-fullscreen-exit::before {\n background-position: -240px 0;\n content: 'Exit Full Screen';\n}\n\n.viewer-close::before {\n background-position: -260px 0;\n content: 'Close';\n}\n\n.viewer-container {\n bottom: 0;\n direction: ltr;\n font-size: 0;\n left: 0;\n line-height: 0;\n overflow: hidden;\n position: absolute;\n right: 0;\n -webkit-tap-highlight-color: transparent;\n top: 0;\n -ms-touch-action: none;\n touch-action: none;\n -webkit-touch-callout: none;\n -webkit-user-select: none;\n -moz-user-select: none;\n -ms-user-select: none;\n user-select: none;\n}\n\n.viewer-container::-moz-selection, .viewer-container *::-moz-selection {\n background-color: transparent;\n }\n\n.viewer-container::selection,\n .viewer-container *::selection {\n background-color: transparent;\n }\n\n.viewer-container:focus {\n outline: 0;\n }\n\n.viewer-container img {\n display: block;\n height: auto;\n max-height: none !important;\n max-width: none !important;\n min-height: 0 !important;\n min-width: 0 !important;\n width: 100%;\n }\n\n.viewer-canvas {\n bottom: 0;\n left: 0;\n overflow: hidden;\n position: absolute;\n right: 0;\n top: 0;\n}\n\n.viewer-canvas > img {\n height: auto;\n margin: 15px auto;\n max-width: 90% !important;\n width: auto;\n }\n\n.viewer-footer {\n bottom: 0;\n left: 0;\n overflow: hidden;\n position: absolute;\n right: 0;\n text-align: center;\n}\n\n.viewer-navbar {\n background-color: rgba(0, 0, 0, 0.5);\n overflow: hidden;\n}\n\n.viewer-list {\n box-sizing: content-box;\n height: 50px;\n margin: 0;\n overflow: hidden;\n padding: 1px 0;\n}\n\n.viewer-list > li {\n color: transparent;\n cursor: pointer;\n float: left;\n font-size: 0;\n height: 50px;\n line-height: 0;\n opacity: 0.5;\n overflow: hidden;\n transition: opacity 0.15s;\n width: 30px;\n }\n\n.viewer-list > li:focus,\n .viewer-list > li:hover {\n opacity: 0.75;\n }\n\n.viewer-list > li:focus {\n outline: 0;\n }\n\n.viewer-list > li + li {\n margin-left: 1px;\n }\n\n.viewer-list > .viewer-loading {\n position: relative;\n }\n\n.viewer-list > .viewer-loading::after {\n border-width: 2px;\n height: 20px;\n margin-left: -10px;\n margin-top: -10px;\n width: 20px;\n }\n\n.viewer-list > .viewer-active,\n .viewer-list > .viewer-active:focus,\n .viewer-list > .viewer-active:hover {\n opacity: 1;\n }\n\n.viewer-player {\n background-color: #000;\n bottom: 0;\n cursor: none;\n display: none;\n left: 0;\n position: absolute;\n right: 0;\n top: 0;\n z-index: 1;\n}\n\n.viewer-player > img {\n left: 0;\n position: absolute;\n top: 0;\n }\n\n.viewer-toolbar > ul {\n display: inline-block;\n margin: 0 auto 5px;\n overflow: hidden;\n padding: 6px 3px;\n }\n\n.viewer-toolbar > ul > li {\n background-color: rgba(0, 0, 0, 0.5);\n border-radius: 50%;\n cursor: pointer;\n float: left;\n height: 24px;\n overflow: hidden;\n transition: background-color 0.15s;\n width: 24px;\n }\n\n.viewer-toolbar > ul > li:focus,\n .viewer-toolbar > ul > li:hover {\n background-color: rgba(0, 0, 0, 0.8);\n }\n\n.viewer-toolbar > ul > li:focus {\n box-shadow: 0 0 3px #fff;\n outline: 0;\n position: relative;\n z-index: 1;\n }\n\n.viewer-toolbar > ul > li::before {\n margin: 2px;\n }\n\n.viewer-toolbar > ul > li + li {\n margin-left: 1px;\n }\n\n.viewer-toolbar > ul > .viewer-small {\n height: 18px;\n margin-bottom: 3px;\n margin-top: 3px;\n width: 18px;\n }\n\n.viewer-toolbar > ul > .viewer-small::before {\n margin: -1px;\n }\n\n.viewer-toolbar > ul > .viewer-large {\n height: 30px;\n margin-bottom: -3px;\n margin-top: -3px;\n width: 30px;\n }\n\n.viewer-toolbar > ul > .viewer-large::before {\n margin: 5px;\n }\n\n.viewer-tooltip {\n background-color: rgba(0, 0, 0, 0.8);\n border-radius: 10px;\n color: #fff;\n display: none;\n font-size: 12px;\n height: 20px;\n left: 50%;\n line-height: 20px;\n margin-left: -25px;\n margin-top: -10px;\n position: absolute;\n text-align: center;\n top: 50%;\n width: 50px;\n}\n\n.viewer-title {\n color: #ccc;\n display: inline-block;\n font-size: 12px;\n line-height: 1.2;\n margin: 5px 5%;\n max-width: 90%;\n min-height: 14px;\n opacity: 0.8;\n overflow: hidden;\n text-overflow: ellipsis;\n transition: opacity 0.15s;\n white-space: nowrap;\n}\n\n.viewer-title:hover {\n opacity: 1;\n }\n\n.viewer-button {\n -webkit-app-region: no-drag;\n background-color: rgba(0, 0, 0, 0.5);\n border-radius: 50%;\n cursor: pointer;\n height: 80px;\n overflow: hidden;\n position: absolute;\n right: -40px;\n top: -40px;\n transition: background-color 0.15s;\n width: 80px;\n}\n\n.viewer-button:focus,\n .viewer-button:hover {\n background-color: rgba(0, 0, 0, 0.8);\n }\n\n.viewer-button:focus {\n box-shadow: 0 0 3px #fff;\n outline: 0;\n }\n\n.viewer-button::before {\n bottom: 15px;\n left: 15px;\n position: absolute;\n }\n\n.viewer-fixed {\n position: fixed;\n}\n\n.viewer-open {\n overflow: hidden;\n}\n\n.viewer-show {\n display: block;\n}\n\n.viewer-hide {\n display: none;\n}\n\n.viewer-backdrop {\n background-color: rgba(0, 0, 0, 0.5);\n}\n\n.viewer-invisible {\n visibility: hidden;\n}\n\n.viewer-move {\n cursor: move;\n cursor: grab;\n}\n\n.viewer-fade {\n opacity: 0;\n}\n\n.viewer-in {\n opacity: 1;\n}\n\n.viewer-transition {\n transition: all 0.3s;\n}\n\n@keyframes viewer-spinner {\n 0% {\n transform: rotate(0deg);\n }\n\n 100% {\n transform: rotate(360deg);\n }\n}\n\n.viewer-loading::after {\n animation: viewer-spinner 1s linear infinite;\n border: 4px solid rgba(255, 255, 255, 0.1);\n border-left-color: rgba(255, 255, 255, 0.5);\n border-radius: 50%;\n content: '';\n display: inline-block;\n height: 40px;\n left: 50%;\n margin-left: -20px;\n margin-top: -20px;\n position: absolute;\n top: 50%;\n width: 40px;\n z-index: 1;\n }\n\n@media (max-width: 767px) {\n .viewer-hide-xs-down {\n display: none;\n }\n}\n\n@media (max-width: 991px) {\n .viewer-hide-sm-down {\n display: none;\n }\n}\n\n@media (max-width: 1199px) {\n .viewer-hide-md-down {\n display: none;\n }\n}\n");var Oy,Py=(Oy=function(e,t,n){qy(e,t,n)},ka(function(e,t){var n=-1,r=t.length,i=r>1?t[r-1]:void 0,o=r>2?t[2]:void 0;for(i=Oy.length>3&&"function"==typeof i?(r--,i):void 0,o&&dn(t[0],t[1],o)&&(i=r<3?void 0:i,r=1),e=Object(e);++n<r;){var a=t[n];a&&Oy(e,a,n,i)}return e}));async function zy(e,t=null,n={}){let r=!0,i=null,o=Ya();Ce(n)||(n={});let a=we(n,"disTouchMoveToHide",null);if(fo(a)||(a=4),a=zi(a),!Iu(e))return o.reject("eleImg is not a HTMLElement"),o;if(i=e,null!==t){if(!Iu(t))return o.reject("eleGroup is not a HTMLElement"),o;r=!1,i=t}if(!r){let e=rr(t.querySelectorAll("img"));if(0===e)return o.reject("eleGroup does not contain any img"),o;1===e&&(r=!0)}let s={button:!1,navbar:!1,title:!1,toolbar:{zoomIn:4,zoomOut:4,oneToOne:4,reset:4,prev:0,play:0,next:0,rotateLeft:4,rotateRight:4,flipHorizontal:4,flipVertical:4},tooltip:!1,movable:!0,zoomable:!0,rotatable:!0,scalable:!0,transition:!0,fullscreen:!1,keyboard:!0};r||(s=function(){let e={button:!1,navbar:!1,title:!1,toolbar:{zoomIn:4,zoomOut:4,oneToOne:4,reset:4,prev:0,play:0,next:0,rotateLeft:4,rotateRight:4,flipHorizontal:4,flipVertical:4},tooltip:!1,movable:!0,zoomable:!0,rotatable:!0,scalable:!0,transition:!0,fullscreen:!1,keyboard:!0};return e.navbar=!0,e.toolbar.prev=4,e.toolbar.next=4,e}()),s=Py(s,Ti(n)),s.shown=function(){(async()=>{let e=null;await us(()=>(e=c.viewer,Iu(e)));let t=!1,n=0,r=0,i=0;e.addEventListener("touchstart",e=>{let i=e.touches[0];n=i.clientX,r=i.clientY,((e,t)=>{let n=document.elementsFromPoint(e,t).find(e=>"IMG"===e.tagName);if(!Iu(n))return!0;let r=n?.classList?.contains("viewer-move");return!r})(n,r)&&(t=!0)},{passive:!1}),e.addEventListener("touchmove",e=>{if(!t)return;let o=e.touches[0],a=o.clientX,s=o.clientY,l=a-n,c=s-r,u=Math.sqrt(l*l+c*c);i+=u,n=o.clientX,r=o.clientY},{passive:!1}),e.addEventListener("touchend",e=>{t&&(i<a&&(e.preventDefault(),e.stopPropagation(),c.hide(!0)),t=!1,i=0)},{passive:!1}),e.addEventListener("touchcancel",e=>{t=!1,i=0})})().catch(e=>{console.log(e)})};let l=!1;s.hide=function(){l||(l=!0,c.hide(!0))},s.hidden=function(){c.destroy(),o.resolve("close")};let c=new Qy(i,s);return c.show(),o}function $y(e,t){let n=new MouseEvent(t,{view:window,bubbles:!0,cancelable:!0});e.dispatchEvent(n)}function jy(e={}){let t=we(e,"kind","*"),n=we(e,"multiple");or(n)||(n=!1);let r=we(e,"entireHierarchy");or(r)||(r=!1),r&&!n&&(n=!0);let i=we(e,"sizeMbLimit");Fe(i)||(i=1e3),i=Ir(i);let o=Ya(),a="drf"+Mu(),s="GrpDomReadFile";um(`[name=${s}]`);let l=Rm(t),c=`<div name="${s}" style="position:relative; width:0px; height:0px; overflow:hidden;"><input id="${a}" type="file" accept="${l}" ${n?"multiple":""} ${r?"webkitdirectory":""} style="opacity:0; position:absolute; top:-10000px; left:-10000px;"></div>`;zu(document.querySelector("body"),c);let u=Sm("#"+a),f=!1;function d(e){f=!0;let t=Um(this,i);o.resolve(t),u.removeEventListener("change",d,!0),u.removeEventListener("cancel",h,!0),r||window.removeEventListener("focus",p),um(`[name=${s}]`)}function h(e){f||d.call(u,e)}function p(e){setTimeout(()=>{f||d.call(u,e)},1500)}return u.addEventListener("change",d,!0),u.addEventListener("cancel",h,!0),r||window.addEventListener("focus",p),$y(u,"click"),o}function Vy(e){if(!Ee(e))return!1;let n="YYYY-MM-DDTHH:mm:ss";return e===t(e,n).format(n)}Ga()&&function(){try{return new MouseEvent("MouseEventPolyfillTest"),!1}catch(e){}let e=function(e,t){t=t||{bubbles:!1,cancelable:!1};let n=document.createEvent("MouseEvent");return n.initMouseEvent(e,t.bubbles,t.cancelable,window,0,t.screenX||0,t.screenY||0,t.clientX||0,t.clientY||0,t.ctrlKey||!1,t.altKey||!1,t.shiftKey||!1,t.metaKey||!1,t.button||0,t.relatedTarget||null),n};e.prototype=Event.prototype,window.MouseEvent=e}();var Yy="top",Gy="bottom",Wy="right",Jy="left",_y="auto",Xy=[Yy,Gy,Wy,Jy],Ky="start",Zy="end",ev="viewport",tv="popper",nv=Xy.reduce(function(e,t){return e.concat([t+"-"+Ky,t+"-"+Zy])},[]),rv=[].concat(Xy,[_y]).reduce(function(e,t){return e.concat([t,t+"-"+Ky,t+"-"+Zy])},[]),iv=["beforeRead","read","afterRead","beforeMain","main","afterMain","beforeWrite","write","afterWrite"];function ov(e){return e?(e.nodeName||"").toLowerCase():null}function av(e){if(null==e)return window;if("[object Window]"!==e.toString()){var t=e.ownerDocument;return t&&t.defaultView||window}return e}function sv(e){return e instanceof av(e).Element||e instanceof Element}function lv(e){return e instanceof av(e).HTMLElement||e instanceof HTMLElement}function cv(e){return"undefined"!=typeof ShadowRoot&&(e instanceof av(e).ShadowRoot||e instanceof ShadowRoot)}var uv={name:"applyStyles",enabled:!0,phase:"write",fn:function(e){var t=e.state;Object.keys(t.elements).forEach(function(e){var n=t.styles[e]||{},r=t.attributes[e]||{},i=t.elements[e];lv(i)&&ov(i)&&(Object.assign(i.style,n),Object.keys(r).forEach(function(e){var t=r[e];!1===t?i.removeAttribute(e):i.setAttribute(e,!0===t?"":t)}))})},effect:function(e){var t=e.state,n={popper:{position:t.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(t.elements.popper.style,n.popper),t.styles=n,t.elements.arrow&&Object.assign(t.elements.arrow.style,n.arrow),function(){Object.keys(t.elements).forEach(function(e){var r=t.elements[e],i=t.attributes[e]||{},o=Object.keys(t.styles.hasOwnProperty(e)?t.styles[e]:n[e]).reduce(function(e,t){return e[t]="",e},{});lv(r)&&ov(r)&&(Object.assign(r.style,o),Object.keys(i).forEach(function(e){r.removeAttribute(e)}))})}},requires:["computeStyles"]};function fv(e){return e.split("-")[0]}var dv=Math.max,hv=Math.min,pv=Math.round;function gv(){var e=navigator.userAgentData;return null!=e&&e.brands&&Array.isArray(e.brands)?e.brands.map(function(e){return e.brand+"/"+e.version}).join(" "):navigator.userAgent}function mv(){return!/^((?!chrome|android).)*safari/i.test(gv())}function yv(e,t,n){void 0===t&&(t=!1),void 0===n&&(n=!1);var r=e.getBoundingClientRect(),i=1,o=1;t&&lv(e)&&(i=e.offsetWidth>0&&pv(r.width)/e.offsetWidth||1,o=e.offsetHeight>0&&pv(r.height)/e.offsetHeight||1);var a=(sv(e)?av(e):window).visualViewport,s=!mv()&&n,l=(r.left+(s&&a?a.offsetLeft:0))/i,c=(r.top+(s&&a?a.offsetTop:0))/o,u=r.width/i,f=r.height/o;return{width:u,height:f,top:c,right:l+u,bottom:c+f,left:l,x:l,y:c}}function vv(e){var t=yv(e),n=e.offsetWidth,r=e.offsetHeight;return Math.abs(t.width-n)<=1&&(n=t.width),Math.abs(t.height-r)<=1&&(r=t.height),{x:e.offsetLeft,y:e.offsetTop,width:n,height:r}}function Av(e,t){var n=t.getRootNode&&t.getRootNode();if(e.contains(t))return!0;if(n&&cv(n)){var r=t;do{if(r&&e.isSameNode(r))return!0;r=r.parentNode||r.host}while(r)}return!1}function bv(e){return av(e).getComputedStyle(e)}function wv(e){return["table","td","th"].indexOf(ov(e))>=0}function Iv(e){return((sv(e)?e.ownerDocument:e.document)||window.document).documentElement}function xv(e){return"html"===ov(e)?e:e.assignedSlot||e.parentNode||(cv(e)?e.host:null)||Iv(e)}function Cv(e){return lv(e)&&"fixed"!==bv(e).position?e.offsetParent:null}function Bv(e){for(var t=av(e),n=Cv(e);n&&wv(n)&&"static"===bv(n).position;)n=Cv(n);return n&&("html"===ov(n)||"body"===ov(n)&&"static"===bv(n).position)?t:n||function(e){var t=/firefox/i.test(gv());if(/Trident/i.test(gv())&&lv(e)&&"fixed"===bv(e).position)return null;var n=xv(e);for(cv(n)&&(n=n.host);lv(n)&&["html","body"].indexOf(ov(n))<0;){var r=bv(n);if("none"!==r.transform||"none"!==r.perspective||"paint"===r.contain||-1!==["transform","perspective"].indexOf(r.willChange)||t&&"filter"===r.willChange||t&&r.filter&&"none"!==r.filter)return n;n=n.parentNode}return null}(e)||t}function Ev(e){return["top","bottom"].indexOf(e)>=0?"x":"y"}function kv(e,t,n){return dv(e,hv(t,n))}function Sv(e){return Object.assign({},{top:0,right:0,bottom:0,left:0},e)}function Fv(e,t){return t.reduce(function(t,n){return t[n]=e,t},{})}var Dv={name:"arrow",enabled:!0,phase:"main",fn:function(e){var t,n=e.state,r=e.name,i=e.options,o=n.elements.arrow,a=n.modifiersData.popperOffsets,s=fv(n.placement),l=Ev(s),c=[Jy,Wy].indexOf(s)>=0?"height":"width";if(o&&a){var u=function(e,t){return Sv("number"!=typeof(e="function"==typeof e?e(Object.assign({},t.rects,{placement:t.placement})):e)?e:Fv(e,Xy))}(i.padding,n),f=vv(o),d="y"===l?Yy:Jy,h="y"===l?Gy:Wy,p=n.rects.reference[c]+n.rects.reference[l]-a[l]-n.rects.popper[c],g=a[l]-n.rects.reference[l],m=Bv(o),y=m?"y"===l?m.clientHeight||0:m.clientWidth||0:0,v=p/2-g/2,A=u[d],b=y-f[c]-u[h],w=y/2-f[c]/2+v,I=kv(A,w,b),x=l;n.modifiersData[r]=((t={})[x]=I,t.centerOffset=I-w,t)}},effect:function(e){var t=e.state,n=e.options.element,r=void 0===n?"[data-popper-arrow]":n;null!=r&&("string"!=typeof r||(r=t.elements.popper.querySelector(r)))&&Av(t.elements.popper,r)&&(t.elements.arrow=r)},requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function Nv(e){return e.split("-")[1]}var Mv={top:"auto",right:"auto",bottom:"auto",left:"auto"};function Qv(e){var t,n=e.popper,r=e.popperRect,i=e.placement,o=e.variation,a=e.offsets,s=e.position,l=e.gpuAcceleration,c=e.adaptive,u=e.roundOffsets,f=e.isFixed,d=a.x,h=void 0===d?0:d,p=a.y,g=void 0===p?0:p,m="function"==typeof u?u({x:h,y:g}):{x:h,y:g};h=m.x,g=m.y;var y=a.hasOwnProperty("x"),v=a.hasOwnProperty("y"),A=Jy,b=Yy,w=window;if(c){var I=Bv(n),x="clientHeight",C="clientWidth";if(I===av(n)&&"static"!==bv(I=Iv(n)).position&&"absolute"===s&&(x="scrollHeight",C="scrollWidth"),i===Yy||(i===Jy||i===Wy)&&o===Zy)b=Gy,g-=(f&&I===w&&w.visualViewport?w.visualViewport.height:I[x])-r.height,g*=l?1:-1;if(i===Jy||(i===Yy||i===Gy)&&o===Zy)A=Wy,h-=(f&&I===w&&w.visualViewport?w.visualViewport.width:I[C])-r.width,h*=l?1:-1}var B,E=Object.assign({position:s},c&&Mv),k=!0===u?function(e,t){var n=e.x,r=e.y,i=t.devicePixelRatio||1;return{x:pv(n*i)/i||0,y:pv(r*i)/i||0}}({x:h,y:g},av(n)):{x:h,y:g};return h=k.x,g=k.y,l?Object.assign({},E,((B={})[b]=v?"0":"",B[A]=y?"0":"",B.transform=(w.devicePixelRatio||1)<=1?"translate("+h+"px, "+g+"px)":"translate3d("+h+"px, "+g+"px, 0)",B)):Object.assign({},E,((t={})[b]=v?g+"px":"",t[A]=y?h+"px":"",t.transform="",t))}var Tv={passive:!0};var Lv={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:function(e){var t=e.state,n=e.instance,r=e.options,i=r.scroll,o=void 0===i||i,a=r.resize,s=void 0===a||a,l=av(t.elements.popper),c=[].concat(t.scrollParents.reference,t.scrollParents.popper);return o&&c.forEach(function(e){e.addEventListener("scroll",n.update,Tv)}),s&&l.addEventListener("resize",n.update,Tv),function(){o&&c.forEach(function(e){e.removeEventListener("scroll",n.update,Tv)}),s&&l.removeEventListener("resize",n.update,Tv)}},data:{}},Rv={left:"right",right:"left",bottom:"top",top:"bottom"};function Uv(e){return e.replace(/left|right|bottom|top/g,function(e){return Rv[e]})}var Hv={start:"end",end:"start"};function qv(e){return e.replace(/start|end/g,function(e){return Hv[e]})}function Ov(e){var t=av(e);return{scrollLeft:t.pageXOffset,scrollTop:t.pageYOffset}}function Pv(e){return yv(Iv(e)).left+Ov(e).scrollLeft}function zv(e){var t=bv(e),n=t.overflow,r=t.overflowX,i=t.overflowY;return/auto|scroll|overlay|hidden/.test(n+i+r)}function $v(e){return["html","body","#document"].indexOf(ov(e))>=0?e.ownerDocument.body:lv(e)&&zv(e)?e:$v(xv(e))}function jv(e,t){var n;void 0===t&&(t=[]);var r=$v(e),i=r===(null==(n=e.ownerDocument)?void 0:n.body),o=av(r),a=i?[o].concat(o.visualViewport||[],zv(r)?r:[]):r,s=t.concat(a);return i?s:s.concat(jv(xv(a)))}function Vv(e){return Object.assign({},e,{left:e.x,top:e.y,right:e.x+e.width,bottom:e.y+e.height})}function Yv(e,t,n){return t===ev?Vv(function(e,t){var n=av(e),r=Iv(e),i=n.visualViewport,o=r.clientWidth,a=r.clientHeight,s=0,l=0;if(i){o=i.width,a=i.height;var c=mv();(c||!c&&"fixed"===t)&&(s=i.offsetLeft,l=i.offsetTop)}return{width:o,height:a,x:s+Pv(e),y:l}}(e,n)):sv(t)?function(e,t){var n=yv(e,!1,"fixed"===t);return n.top=n.top+e.clientTop,n.left=n.left+e.clientLeft,n.bottom=n.top+e.clientHeight,n.right=n.left+e.clientWidth,n.width=e.clientWidth,n.height=e.clientHeight,n.x=n.left,n.y=n.top,n}(t,n):Vv(function(e){var t,n=Iv(e),r=Ov(e),i=null==(t=e.ownerDocument)?void 0:t.body,o=dv(n.scrollWidth,n.clientWidth,i?i.scrollWidth:0,i?i.clientWidth:0),a=dv(n.scrollHeight,n.clientHeight,i?i.scrollHeight:0,i?i.clientHeight:0),s=-r.scrollLeft+Pv(e),l=-r.scrollTop;return"rtl"===bv(i||n).direction&&(s+=dv(n.clientWidth,i?i.clientWidth:0)-o),{width:o,height:a,x:s,y:l}}(Iv(e)))}function Gv(e,t,n,r){var i="clippingParents"===t?function(e){var t=jv(xv(e)),n=["absolute","fixed"].indexOf(bv(e).position)>=0&&lv(e)?Bv(e):e;return sv(n)?t.filter(function(e){return sv(e)&&Av(e,n)&&"body"!==ov(e)}):[]}(e):[].concat(t),o=[].concat(i,[n]),a=o[0],s=o.reduce(function(t,n){var i=Yv(e,n,r);return t.top=dv(i.top,t.top),t.right=hv(i.right,t.right),t.bottom=hv(i.bottom,t.bottom),t.left=dv(i.left,t.left),t},Yv(e,a,r));return s.width=s.right-s.left,s.height=s.bottom-s.top,s.x=s.left,s.y=s.top,s}function Wv(e){var t,n=e.reference,r=e.element,i=e.placement,o=i?fv(i):null,a=i?Nv(i):null,s=n.x+n.width/2-r.width/2,l=n.y+n.height/2-r.height/2;switch(o){case Yy:t={x:s,y:n.y-r.height};break;case Gy:t={x:s,y:n.y+n.height};break;case Wy:t={x:n.x+n.width,y:l};break;case Jy:t={x:n.x-r.width,y:l};break;default:t={x:n.x,y:n.y}}var c=o?Ev(o):null;if(null!=c){var u="y"===c?"height":"width";switch(a){case Ky:t[c]=t[c]-(n[u]/2-r[u]/2);break;case Zy:t[c]=t[c]+(n[u]/2-r[u]/2)}}return t}function Jv(e,t){void 0===t&&(t={});var n=t,r=n.placement,i=void 0===r?e.placement:r,o=n.strategy,a=void 0===o?e.strategy:o,s=n.boundary,l=void 0===s?"clippingParents":s,c=n.rootBoundary,u=void 0===c?ev:c,f=n.elementContext,d=void 0===f?tv:f,h=n.altBoundary,p=void 0!==h&&h,g=n.padding,m=void 0===g?0:g,y=Sv("number"!=typeof m?m:Fv(m,Xy)),v=d===tv?"reference":tv,A=e.rects.popper,b=e.elements[p?v:d],w=Gv(sv(b)?b:b.contextElement||Iv(e.elements.popper),l,u,a),I=yv(e.elements.reference),x=Wv({reference:I,element:A,strategy:"absolute",placement:i}),C=Vv(Object.assign({},A,x)),B=d===tv?C:I,E={top:w.top-B.top+y.top,bottom:B.bottom-w.bottom+y.bottom,left:w.left-B.left+y.left,right:B.right-w.right+y.right},k=e.modifiersData.offset;if(d===tv&&k){var S=k[i];Object.keys(E).forEach(function(e){var t=[Wy,Gy].indexOf(e)>=0?1:-1,n=[Yy,Gy].indexOf(e)>=0?"y":"x";E[e]+=S[n]*t})}return E}function _v(e,t){void 0===t&&(t={});var n=t,r=n.placement,i=n.boundary,o=n.rootBoundary,a=n.padding,s=n.flipVariations,l=n.allowedAutoPlacements,c=void 0===l?rv:l,u=Nv(r),f=u?s?nv:nv.filter(function(e){return Nv(e)===u}):Xy,d=f.filter(function(e){return c.indexOf(e)>=0});0===d.length&&(d=f);var h=d.reduce(function(t,n){return t[n]=Jv(e,{placement:n,boundary:i,rootBoundary:o,padding:a})[fv(n)],t},{});return Object.keys(h).sort(function(e,t){return h[e]-h[t]})}var Xv={name:"flip",enabled:!0,phase:"main",fn:function(e){var t=e.state,n=e.options,r=e.name;if(!t.modifiersData[r]._skip){for(var i=n.mainAxis,o=void 0===i||i,a=n.altAxis,s=void 0===a||a,l=n.fallbackPlacements,c=n.padding,u=n.boundary,f=n.rootBoundary,d=n.altBoundary,h=n.flipVariations,p=void 0===h||h,g=n.allowedAutoPlacements,m=t.options.placement,y=fv(m),v=l||(y===m||!p?[Uv(m)]:function(e){if(fv(e)===_y)return[];var t=Uv(e);return[qv(e),t,qv(t)]}(m)),A=[m].concat(v).reduce(function(e,n){return e.concat(fv(n)===_y?_v(t,{placement:n,boundary:u,rootBoundary:f,padding:c,flipVariations:p,allowedAutoPlacements:g}):n)},[]),b=t.rects.reference,w=t.rects.popper,I=new Map,x=!0,C=A[0],B=0;B<A.length;B++){var E=A[B],k=fv(E),S=Nv(E)===Ky,F=[Yy,Gy].indexOf(k)>=0,D=F?"width":"height",N=Jv(t,{placement:E,boundary:u,rootBoundary:f,altBoundary:d,padding:c}),M=F?S?Wy:Jy:S?Gy:Yy;b[D]>w[D]&&(M=Uv(M));var Q=Uv(M),T=[];if(o&&T.push(N[k]<=0),s&&T.push(N[M]<=0,N[Q]<=0),T.every(function(e){return e})){C=E,x=!1;break}I.set(E,T)}if(x)for(var L=function(e){var t=A.find(function(t){var n=I.get(t);if(n)return n.slice(0,e).every(function(e){return e})});if(t)return C=t,"break"},R=p?3:1;R>0;R--){if("break"===L(R))break}t.placement!==C&&(t.modifiersData[r]._skip=!0,t.placement=C,t.reset=!0)}},requiresIfExists:["offset"],data:{_skip:!1}};function Kv(e,t,n){return void 0===n&&(n={x:0,y:0}),{top:e.top-t.height-n.y,right:e.right-t.width+n.x,bottom:e.bottom-t.height+n.y,left:e.left-t.width-n.x}}function Zv(e){return[Yy,Wy,Gy,Jy].some(function(t){return e[t]>=0})}var eA={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:function(e){var t=e.state,n=e.options,r=e.name,i=n.offset,o=void 0===i?[0,0]:i,a=rv.reduce(function(e,n){return e[n]=function(e,t,n){var r=fv(e),i=[Jy,Yy].indexOf(r)>=0?-1:1,o="function"==typeof n?n(Object.assign({},t,{placement:e})):n,a=o[0],s=o[1];return a=a||0,s=(s||0)*i,[Jy,Wy].indexOf(r)>=0?{x:s,y:a}:{x:a,y:s}}(n,t.rects,o),e},{}),s=a[t.placement],l=s.x,c=s.y;null!=t.modifiersData.popperOffsets&&(t.modifiersData.popperOffsets.x+=l,t.modifiersData.popperOffsets.y+=c),t.modifiersData[r]=a}};var tA={name:"preventOverflow",enabled:!0,phase:"main",fn:function(e){var t=e.state,n=e.options,r=e.name,i=n.mainAxis,o=void 0===i||i,a=n.altAxis,s=void 0!==a&&a,l=n.boundary,c=n.rootBoundary,u=n.altBoundary,f=n.padding,d=n.tether,h=void 0===d||d,p=n.tetherOffset,g=void 0===p?0:p,m=Jv(t,{boundary:l,rootBoundary:c,padding:f,altBoundary:u}),y=fv(t.placement),v=Nv(t.placement),A=!v,b=Ev(y),w="x"===b?"y":"x",I=t.modifiersData.popperOffsets,x=t.rects.reference,C=t.rects.popper,B="function"==typeof g?g(Object.assign({},t.rects,{placement:t.placement})):g,E="number"==typeof B?{mainAxis:B,altAxis:B}:Object.assign({mainAxis:0,altAxis:0},B),k=t.modifiersData.offset?t.modifiersData.offset[t.placement]:null,S={x:0,y:0};if(I){if(o){var F,D="y"===b?Yy:Jy,N="y"===b?Gy:Wy,M="y"===b?"height":"width",Q=I[b],T=Q+m[D],L=Q-m[N],R=h?-C[M]/2:0,U=v===Ky?x[M]:C[M],H=v===Ky?-C[M]:-x[M],q=t.elements.arrow,O=h&&q?vv(q):{width:0,height:0},P=t.modifiersData["arrow#persistent"]?t.modifiersData["arrow#persistent"].padding:{top:0,right:0,bottom:0,left:0},z=P[D],$=P[N],j=kv(0,x[M],O[M]),V=A?x[M]/2-R-j-z-E.mainAxis:U-j-z-E.mainAxis,Y=A?-x[M]/2+R+j+$+E.mainAxis:H+j+$+E.mainAxis,G=t.elements.arrow&&Bv(t.elements.arrow),W=G?"y"===b?G.clientTop||0:G.clientLeft||0:0,J=null!=(F=null==k?void 0:k[b])?F:0,_=Q+Y-J,X=kv(h?hv(T,Q+V-J-W):T,Q,h?dv(L,_):L);I[b]=X,S[b]=X-Q}if(s){var K,Z="x"===b?Yy:Jy,ee="x"===b?Gy:Wy,te=I[w],ne="y"===w?"height":"width",re=te+m[Z],ie=te-m[ee],oe=-1!==[Yy,Jy].indexOf(y),ae=null!=(K=null==k?void 0:k[w])?K:0,se=oe?re:te-x[ne]-C[ne]-ae+E.altAxis,le=oe?te+x[ne]+C[ne]-ae-E.altAxis:ie,ce=h&&oe?function(e,t,n){var r=kv(e,t,n);return r>n?n:r}(se,te,le):kv(h?se:re,te,h?le:ie);I[w]=ce,S[w]=ce-te}t.modifiersData[r]=S}},requiresIfExists:["offset"]};function nA(e,t,n){void 0===n&&(n=!1);var r,i,o=lv(t),a=lv(t)&&function(e){var t=e.getBoundingClientRect(),n=pv(t.width)/e.offsetWidth||1,r=pv(t.height)/e.offsetHeight||1;return 1!==n||1!==r}(t),s=Iv(t),l=yv(e,a,n),c={scrollLeft:0,scrollTop:0},u={x:0,y:0};return(o||!o&&!n)&&(("body"!==ov(t)||zv(s))&&(c=(r=t)!==av(r)&&lv(r)?{scrollLeft:(i=r).scrollLeft,scrollTop:i.scrollTop}:Ov(r)),lv(t)?((u=yv(t,!0)).x+=t.clientLeft,u.y+=t.clientTop):s&&(u.x=Pv(s))),{x:l.left+c.scrollLeft-u.x,y:l.top+c.scrollTop-u.y,width:l.width,height:l.height}}function rA(e){var t=new Map,n=new Set,r=[];function i(e){n.add(e.name),[].concat(e.requires||[],e.requiresIfExists||[]).forEach(function(e){if(!n.has(e)){var r=t.get(e);r&&i(r)}}),r.push(e)}return e.forEach(function(e){t.set(e.name,e)}),e.forEach(function(e){n.has(e.name)||i(e)}),r}function iA(e){var t;return function(){return t||(t=new Promise(function(n){Promise.resolve().then(function(){t=void 0,n(e())})})),t}}var oA={placement:"bottom",modifiers:[],strategy:"absolute"};function aA(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return!t.some(function(e){return!(e&&"function"==typeof e.getBoundingClientRect)})}function sA(e){void 0===e&&(e={});var t=e,n=t.defaultModifiers,r=void 0===n?[]:n,i=t.defaultOptions,o=void 0===i?oA:i;return function(e,t,n){void 0===n&&(n=o);var i={placement:"bottom",orderedModifiers:[],options:Object.assign({},oA,o),modifiersData:{},elements:{reference:e,popper:t},attributes:{},styles:{}},a=[],s=!1,l={state:i,setOptions:function(n){var s="function"==typeof n?n(i.options):n;c(),i.options=Object.assign({},o,i.options,s),i.scrollParents={reference:sv(e)?jv(e):e.contextElement?jv(e.contextElement):[],popper:jv(t)};var u,f,d=function(e){var t=rA(e);return iv.reduce(function(e,n){return e.concat(t.filter(function(e){return e.phase===n}))},[])}((u=[].concat(r,i.options.modifiers),f=u.reduce(function(e,t){var n=e[t.name];return e[t.name]=n?Object.assign({},n,t,{options:Object.assign({},n.options,t.options),data:Object.assign({},n.data,t.data)}):t,e},{}),Object.keys(f).map(function(e){return f[e]})));return i.orderedModifiers=d.filter(function(e){return e.enabled}),i.orderedModifiers.forEach(function(e){var t=e.name,n=e.options,r=void 0===n?{}:n,o=e.effect;if("function"==typeof o){var s=o({state:i,name:t,instance:l,options:r}),c=function(){};a.push(s||c)}}),l.update()},forceUpdate:function(){if(!s){var e=i.elements,t=e.reference,n=e.popper;if(aA(t,n)){i.rects={reference:nA(t,Bv(n),"fixed"===i.options.strategy),popper:vv(n)},i.reset=!1,i.placement=i.options.placement,i.orderedModifiers.forEach(function(e){return i.modifiersData[e.name]=Object.assign({},e.data)});for(var r=0;r<i.orderedModifiers.length;r++)if(!0!==i.reset){var o=i.orderedModifiers[r],a=o.fn,c=o.options,u=void 0===c?{}:c,f=o.name;"function"==typeof a&&(i=a({state:i,options:u,name:f,instance:l})||i)}else i.reset=!1,r=-1}}},update:iA(function(){return new Promise(function(e){l.forceUpdate(),e(i)})}),destroy:function(){c(),s=!0}};if(!aA(e,t))return l;function c(){a.forEach(function(e){return e()}),a=[]}return l.setOptions(n).then(function(e){!s&&n.onFirstUpdate&&n.onFirstUpdate(e)}),l}}var lA=sA({defaultModifiers:[Lv,{name:"popperOffsets",enabled:!0,phase:"read",fn:function(e){var t=e.state,n=e.name;t.modifiersData[n]=Wv({reference:t.rects.reference,element:t.rects.popper,strategy:"absolute",placement:t.placement})},data:{}},{name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:function(e){var t=e.state,n=e.options,r=n.gpuAcceleration,i=void 0===r||r,o=n.adaptive,a=void 0===o||o,s=n.roundOffsets,l=void 0===s||s,c={placement:fv(t.placement),variation:Nv(t.placement),popper:t.elements.popper,popperRect:t.rects.popper,gpuAcceleration:i,isFixed:"fixed"===t.options.strategy};null!=t.modifiersData.popperOffsets&&(t.styles.popper=Object.assign({},t.styles.popper,Qv(Object.assign({},c,{offsets:t.modifiersData.popperOffsets,position:t.options.strategy,adaptive:a,roundOffsets:l})))),null!=t.modifiersData.arrow&&(t.styles.arrow=Object.assign({},t.styles.arrow,Qv(Object.assign({},c,{offsets:t.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:l})))),t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-placement":t.placement})},data:{}},uv,eA,Xv,tA,Dv,{name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:function(e){var t=e.state,n=e.name,r=t.rects.reference,i=t.rects.popper,o=t.modifiersData.preventOverflow,a=Jv(t,{elementContext:"reference"}),s=Jv(t,{altBoundary:!0}),l=Kv(a,r),c=Kv(s,i,o),u=Zv(l),f=Zv(c);t.modifiersData[n]={referenceClippingOffsets:l,popperEscapeOffsets:c,isReferenceHidden:u,hasPopperEscaped:f},t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-reference-hidden":u,"data-popper-escaped":f})}}]}),cA="tippy-content",uA="tippy-arrow",fA="tippy-svg-arrow",dA={passive:!0,capture:!0},hA=function(){return document.body};function pA(e,t,n){if(Array.isArray(e)){var r=e[t];return null==r?Array.isArray(n)?n[t]:n:r}return e}function gA(e,t){var n={}.toString.call(e);return 0===n.indexOf("[object")&&n.indexOf(t+"]")>-1}function mA(e,t){return"function"==typeof e?e.apply(void 0,t):e}function yA(e,t){return 0===t?e:function(r){clearTimeout(n),n=setTimeout(function(){e(r)},t)};var n}function vA(e){return[].concat(e)}function AA(e,t){-1===e.indexOf(t)&&e.push(t)}function bA(e){return[].slice.call(e)}function wA(e){return Object.keys(e).reduce(function(t,n){return void 0!==e[n]&&(t[n]=e[n]),t},{})}function IA(){return document.createElement("div")}function xA(e){return["Element","Fragment"].some(function(t){return gA(e,t)})}function CA(e){return xA(e)?[e]:function(e){return gA(e,"NodeList")}(e)?bA(e):Array.isArray(e)?e:bA(document.querySelectorAll(e))}function BA(e,t){e.forEach(function(e){e&&(e.style.transitionDuration=t+"ms")})}function EA(e,t){e.forEach(function(e){e&&e.setAttribute("data-state",t)})}function kA(e,t,n){var r=t+"EventListener";["transitionend","webkitTransitionEnd"].forEach(function(t){e[r](t,n)})}function SA(e,t){for(var n=t;n;){var r;if(e.contains(n))return!0;n=null==n.getRootNode||null==(r=n.getRootNode())?void 0:r.host}return!1}var FA={isTouch:!1},DA=0;function NA(){FA.isTouch||(FA.isTouch=!0,window.performance&&document.addEventListener("mousemove",MA))}function MA(){var e=performance.now();e-DA<20&&(FA.isTouch=!1,document.removeEventListener("mousemove",MA)),DA=e}function QA(){var e,t=document.activeElement;if((e=t)&&e._tippy&&e._tippy.reference===e){var n=t._tippy;t.blur&&!n.state.isVisible&&t.blur()}}var TA,LA=!!("undefined"!=typeof window&&"undefined"!=typeof document)&&!!window.msCrypto;function RA(e){return[e+"() was called on a"+("destroy"===e?"n already-":" ")+"destroyed instance. This is a no-op but","indicates a potential memory leak."].join(" ")}function UA(e){return e.replace(/[ \t]{2,}/g," ").replace(/^[ \t]*/gm,"").trim()}function HA(e){return UA("\n %ctippy.js\n\n %c"+UA(e)+"\n\n %c👷‍ This is a development-only message. It will be removed in production.\n ")}function qA(e){return[HA(e),"color: #00C584; font-size: 1.3em; font-weight: bold;","line-height: 1.5","color: #a6a095;"]}function OA(e,t){var n;e&&!TA.has(t)&&(TA.add(t),(n=console).warn.apply(n,qA(t)))}function PA(e,t){var n;e&&!TA.has(t)&&(TA.add(t),(n=console).error.apply(n,qA(t)))}TA=new Set;var zA={animateFill:!1,followCursor:!1,inlinePositioning:!1,sticky:!1},$A=Object.assign({appendTo:hA,aria:{content:"auto",expanded:"auto"},delay:0,duration:[300,250],getReferenceClientRect:null,hideOnClick:!0,ignoreAttributes:!1,interactive:!1,interactiveBorder:2,interactiveDebounce:0,moveTransition:"",offset:[0,10],onAfterUpdate:function(){},onBeforeUpdate:function(){},onCreate:function(){},onDestroy:function(){},onHidden:function(){},onHide:function(){},onMount:function(){},onShow:function(){},onShown:function(){},onTrigger:function(){},onUntrigger:function(){},onClickOutside:function(){},placement:"top",plugins:[],popperOptions:{},render:null,showOnCreate:!1,touch:!0,trigger:"mouseenter focus",triggerTarget:null},zA,{allowHTML:!1,animation:"fade",arrow:!0,content:"",inertia:!1,maxWidth:350,role:"tooltip",theme:"",zIndex:9999}),jA=Object.keys($A);function VA(e){var t=(e.plugins||[]).reduce(function(t,n){var r,i=n.name,o=n.defaultValue;i&&(t[i]=void 0!==e[i]?e[i]:null!=(r=$A[i])?r:o);return t},{});return Object.assign({},e,t)}function YA(e,t){var n=Object.assign({},t,{content:mA(t.content,[e])},t.ignoreAttributes?{}:function(e,t){return(t?Object.keys(VA(Object.assign({},$A,{plugins:t}))):jA).reduce(function(t,n){var r=(e.getAttribute("data-tippy-"+n)||"").trim();if(!r)return t;if("content"===n)t[n]=r;else try{t[n]=JSON.parse(r)}catch(e){t[n]=r}return t},{})}(e,t.plugins));return n.aria=Object.assign({},$A.aria,n.aria),n.aria={expanded:"auto"===n.aria.expanded?t.interactive:n.aria.expanded,content:"auto"===n.aria.content?t.interactive?null:"describedby":n.aria.content},n}function GA(e,t){void 0===e&&(e={}),void 0===t&&(t=[]),Object.keys(e).forEach(function(e){var n=function(e,t){var n=Object.assign({},e);return t.forEach(function(e){delete n[e]}),n}($A,Object.keys(zA)),r=!function(e,t){return{}.hasOwnProperty.call(e,t)}(n,e);r&&(r=0===t.filter(function(t){return t.name===e}).length),OA(r,["`"+e+"`","is not a valid prop. You may have spelled it incorrectly, or if it's","a plugin, forgot to pass it in an array as props.plugins.","\n\n","All props: https://atomiks.github.io/tippyjs/v6/all-props/\n","Plugins: https://atomiks.github.io/tippyjs/v6/plugins/"].join(" "))})}function WA(e,t){e.innerHTML=t}function JA(e){var t=IA();return!0===e?t.className=uA:(t.className=fA,xA(e)?t.appendChild(e):WA(t,e)),t}function _A(e,t){xA(t.content)?(WA(e,""),e.appendChild(t.content)):"function"!=typeof t.content&&(t.allowHTML?WA(e,t.content):e.textContent=t.content)}function XA(e){var t=e.firstElementChild,n=bA(t.children);return{box:t,content:n.find(function(e){return e.classList.contains(cA)}),arrow:n.find(function(e){return e.classList.contains(uA)||e.classList.contains(fA)}),backdrop:n.find(function(e){return e.classList.contains("tippy-backdrop")})}}function KA(e){var t=IA(),n=IA();n.className="tippy-box",n.setAttribute("data-state","hidden"),n.setAttribute("tabindex","-1");var r=IA();function i(n,r){var i=XA(t),o=i.box,a=i.content,s=i.arrow;r.theme?o.setAttribute("data-theme",r.theme):o.removeAttribute("data-theme"),"string"==typeof r.animation?o.setAttribute("data-animation",r.animation):o.removeAttribute("data-animation"),r.inertia?o.setAttribute("data-inertia",""):o.removeAttribute("data-inertia"),o.style.maxWidth="number"==typeof r.maxWidth?r.maxWidth+"px":r.maxWidth,r.role?o.setAttribute("role",r.role):o.removeAttribute("role"),n.content===r.content&&n.allowHTML===r.allowHTML||_A(a,e.props),r.arrow?s?n.arrow!==r.arrow&&(o.removeChild(s),o.appendChild(JA(r.arrow))):o.appendChild(JA(r.arrow)):s&&o.removeChild(s)}return r.className=cA,r.setAttribute("data-state","hidden"),_A(r,e.props),t.appendChild(n),n.appendChild(r),i(e.props,e.props),{popper:t,onUpdate:i}}KA.$$tippy=!0;var ZA=1,eb=[],tb=[];function nb(e,t){var n,r,i,o,a,s,l,c,u=YA(e,Object.assign({},$A,VA(wA(t)))),f=!1,d=!1,h=!1,p=!1,g=[],m=yA(G,u.interactiveDebounce),y=ZA++,v=(c=u.plugins).filter(function(e,t){return c.indexOf(e)===t}),A={id:y,reference:e,popper:IA(),popperInstance:null,props:u,state:{isEnabled:!0,isVisible:!1,isDestroyed:!1,isMounted:!1,isShown:!1},plugins:v,clearDelayTimeouts:function(){clearTimeout(n),clearTimeout(r),cancelAnimationFrame(i)},setProps:function(t){if(OA(A.state.isDestroyed,RA("setProps")),A.state.isDestroyed)return;Q("onBeforeUpdate",[A,t]),V();var n=A.props,r=YA(e,Object.assign({},n,wA(t),{ignoreAttributes:!0}));A.props=r,j(),n.interactiveDebounce!==r.interactiveDebounce&&(R(),m=yA(G,r.interactiveDebounce));n.triggerTarget&&!r.triggerTarget?vA(n.triggerTarget).forEach(function(e){e.removeAttribute("aria-expanded")}):r.triggerTarget&&e.removeAttribute("aria-expanded");L(),M(),I&&I(n,r);A.popperInstance&&(X(),Z().forEach(function(e){requestAnimationFrame(e._tippy.popperInstance.forceUpdate)}));Q("onAfterUpdate",[A,t])},setContent:function(e){A.setProps({content:e})},show:function(){OA(A.state.isDestroyed,RA("show"));var e=A.state.isVisible,t=A.state.isDestroyed,n=!A.state.isEnabled,r=FA.isTouch&&!A.props.touch,i=pA(A.props.duration,0,$A.duration);if(e||t||n||r)return;if(S().hasAttribute("disabled"))return;if(Q("onShow",[A],!1),!1===A.props.onShow(A))return;A.state.isVisible=!0,k()&&(w.style.visibility="visible");M(),O(),A.state.isMounted||(w.style.transition="none");if(k()){var o=D();BA([o.box,o.content],0)}s=function(){var e;if(A.state.isVisible&&!p){if(p=!0,w.offsetHeight,w.style.transition=A.props.moveTransition,k()&&A.props.animation){var t=D(),n=t.box,r=t.content;BA([n,r],i),EA([n,r],"visible")}T(),L(),AA(tb,A),null==(e=A.popperInstance)||e.forceUpdate(),Q("onMount",[A]),A.props.animation&&k()&&function(e,t){z(e,t)}(i,function(){A.state.isShown=!0,Q("onShown",[A])})}},function(){var e,t=A.props.appendTo,n=S();e=A.props.interactive&&t===hA||"parent"===t?n.parentNode:mA(t,[n]);e.contains(w)||e.appendChild(w);A.state.isMounted=!0,X(),OA(A.props.interactive&&t===$A.appendTo&&n.nextElementSibling!==w,["Interactive tippy element may not be accessible via keyboard","navigation because it is not directly after the reference element","in the DOM source order.","\n\n","Using a wrapper <div> or <span> tag around the reference element","solves this by creating a new parentNode context.","\n\n","Specifying `appendTo: document.body` silences this warning, but it","assumes you are using a focus management solution to handle","keyboard navigation.","\n\n","See: https://atomiks.github.io/tippyjs/v6/accessibility/#interactivity"].join(" "))}()},hide:function(){OA(A.state.isDestroyed,RA("hide"));var e=!A.state.isVisible,t=A.state.isDestroyed,n=!A.state.isEnabled,r=pA(A.props.duration,1,$A.duration);if(e||t||n)return;if(Q("onHide",[A],!1),!1===A.props.onHide(A))return;A.state.isVisible=!1,A.state.isShown=!1,p=!1,f=!1,k()&&(w.style.visibility="hidden");if(R(),P(),M(!0),k()){var i=D(),o=i.box,a=i.content;A.props.animation&&(BA([o,a],r),EA([o,a],"hidden"))}T(),L(),A.props.animation?k()&&function(e,t){z(e,function(){!A.state.isVisible&&w.parentNode&&w.parentNode.contains(w)&&t()})}(r,A.unmount):A.unmount()},hideWithInteractivity:function(e){OA(A.state.isDestroyed,RA("hideWithInteractivity")),F().addEventListener("mousemove",m),AA(eb,m),m(e)},enable:function(){A.state.isEnabled=!0},disable:function(){A.hide(),A.state.isEnabled=!1},unmount:function(){OA(A.state.isDestroyed,RA("unmount")),A.state.isVisible&&A.hide();if(!A.state.isMounted)return;K(),Z().forEach(function(e){e._tippy.unmount()}),w.parentNode&&w.parentNode.removeChild(w);tb=tb.filter(function(e){return e!==A}),A.state.isMounted=!1,Q("onHidden",[A])},destroy:function(){if(OA(A.state.isDestroyed,RA("destroy")),A.state.isDestroyed)return;A.clearDelayTimeouts(),A.unmount(),V(),delete e._tippy,A.state.isDestroyed=!0,Q("onDestroy",[A])}};if(!u.render)return PA(!0,"render() function has not been supplied."),A;var b=u.render(A),w=b.popper,I=b.onUpdate;w.setAttribute("data-tippy-root",""),w.id="tippy-"+A.id,A.popper=w,e._tippy=A,w._tippy=A;var x=v.map(function(e){return e.fn(A)}),C=e.hasAttribute("aria-expanded");return j(),L(),M(),Q("onCreate",[A]),u.showOnCreate&&ee(),w.addEventListener("mouseenter",function(){A.props.interactive&&A.state.isVisible&&A.clearDelayTimeouts()}),w.addEventListener("mouseleave",function(){A.props.interactive&&A.props.trigger.indexOf("mouseenter")>=0&&F().addEventListener("mousemove",m)}),A;function B(){var e=A.props.touch;return Array.isArray(e)?e:[e,0]}function E(){return"hold"===B()[0]}function k(){var e;return!(null==(e=A.props.render)||!e.$$tippy)}function S(){return l||e}function F(){var e,t,n=S().parentNode;return n?null!=(t=vA(n)[0])&&null!=(e=t.ownerDocument)&&e.body?t.ownerDocument:document:document}function D(){return XA(w)}function N(e){return A.state.isMounted&&!A.state.isVisible||FA.isTouch||o&&"focus"===o.type?0:pA(A.props.delay,e?0:1,$A.delay)}function M(e){void 0===e&&(e=!1),w.style.pointerEvents=A.props.interactive&&!e?"":"none",w.style.zIndex=""+A.props.zIndex}function Q(e,t,n){var r;(void 0===n&&(n=!0),x.forEach(function(n){n[e]&&n[e].apply(n,t)}),n)&&(r=A.props)[e].apply(r,t)}function T(){var t=A.props.aria;if(t.content){var n="aria-"+t.content,r=w.id;vA(A.props.triggerTarget||e).forEach(function(e){var t=e.getAttribute(n);if(A.state.isVisible)e.setAttribute(n,t?t+" "+r:r);else{var i=t&&t.replace(r,"").trim();i?e.setAttribute(n,i):e.removeAttribute(n)}})}}function L(){!C&&A.props.aria.expanded&&vA(A.props.triggerTarget||e).forEach(function(e){A.props.interactive?e.setAttribute("aria-expanded",A.state.isVisible&&e===S()?"true":"false"):e.removeAttribute("aria-expanded")})}function R(){F().removeEventListener("mousemove",m),eb=eb.filter(function(e){return e!==m})}function U(t){if(!FA.isTouch||!h&&"mousedown"!==t.type){var n=t.composedPath&&t.composedPath()[0]||t.target;if(!A.props.interactive||!SA(w,n)){if(vA(A.props.triggerTarget||e).some(function(e){return SA(e,n)})){if(FA.isTouch)return;if(A.state.isVisible&&A.props.trigger.indexOf("click")>=0)return}else Q("onClickOutside",[A,t]);!0===A.props.hideOnClick&&(A.clearDelayTimeouts(),A.hide(),d=!0,setTimeout(function(){d=!1}),A.state.isMounted||P())}}}function H(){h=!0}function q(){h=!1}function O(){var e=F();e.addEventListener("mousedown",U,!0),e.addEventListener("touchend",U,dA),e.addEventListener("touchstart",q,dA),e.addEventListener("touchmove",H,dA)}function P(){var e=F();e.removeEventListener("mousedown",U,!0),e.removeEventListener("touchend",U,dA),e.removeEventListener("touchstart",q,dA),e.removeEventListener("touchmove",H,dA)}function z(e,t){var n=D().box;function r(e){e.target===n&&(kA(n,"remove",r),t())}if(0===e)return t();kA(n,"remove",a),kA(n,"add",r),a=r}function $(t,n,r){void 0===r&&(r=!1),vA(A.props.triggerTarget||e).forEach(function(e){e.addEventListener(t,n,r),g.push({node:e,eventType:t,handler:n,options:r})})}function j(){var e;E()&&($("touchstart",Y,{passive:!0}),$("touchend",W,{passive:!0})),(e=A.props.trigger,e.split(/\s+/).filter(Boolean)).forEach(function(e){if("manual"!==e)switch($(e,Y),e){case"mouseenter":$("mouseleave",W);break;case"focus":$(LA?"focusout":"blur",J);break;case"focusin":$("focusout",J)}})}function V(){g.forEach(function(e){var t=e.node,n=e.eventType,r=e.handler,i=e.options;t.removeEventListener(n,r,i)}),g=[]}function Y(e){var t,n=!1;if(A.state.isEnabled&&!_(e)&&!d){var r="focus"===(null==(t=o)?void 0:t.type);o=e,l=e.currentTarget,L(),!A.state.isVisible&&gA(e,"MouseEvent")&&eb.forEach(function(t){return t(e)}),"click"===e.type&&(A.props.trigger.indexOf("mouseenter")<0||f)&&!1!==A.props.hideOnClick&&A.state.isVisible?n=!0:ee(e),"click"===e.type&&(f=!n),n&&!r&&te(e)}}function G(e){var t=e.target,n=S().contains(t)||w.contains(t);if("mousemove"!==e.type||!n){var r=Z().concat(w).map(function(e){var t,n=null==(t=e._tippy.popperInstance)?void 0:t.state;return n?{popperRect:e.getBoundingClientRect(),popperState:n,props:u}:null}).filter(Boolean);(function(e,t){var n=t.clientX,r=t.clientY;return e.every(function(e){var t=e.popperRect,i=e.popperState,o=e.props.interactiveBorder,a=i.placement.split("-")[0],s=i.modifiersData.offset;if(!s)return!0;var l="bottom"===a?s.top.y:0,c="top"===a?s.bottom.y:0,u="right"===a?s.left.x:0,f="left"===a?s.right.x:0,d=t.top-r+l>o,h=r-t.bottom-c>o,p=t.left-n+u>o,g=n-t.right-f>o;return d||h||p||g})})(r,e)&&(R(),te(e))}}function W(e){_(e)||A.props.trigger.indexOf("click")>=0&&f||(A.props.interactive?A.hideWithInteractivity(e):te(e))}function J(e){A.props.trigger.indexOf("focusin")<0&&e.target!==S()||A.props.interactive&&e.relatedTarget&&w.contains(e.relatedTarget)||te(e)}function _(e){return!!FA.isTouch&&E()!==e.type.indexOf("touch")>=0}function X(){K();var t=A.props,n=t.popperOptions,r=t.placement,i=t.offset,o=t.getReferenceClientRect,a=t.moveTransition,l=k()?XA(w).arrow:null,c=o?{getBoundingClientRect:o,contextElement:o.contextElement||S()}:e,u={name:"$$tippy",enabled:!0,phase:"beforeWrite",requires:["computeStyles"],fn:function(e){var t=e.state;if(k()){var n=D().box;["placement","reference-hidden","escaped"].forEach(function(e){"placement"===e?n.setAttribute("data-placement",t.placement):t.attributes.popper["data-popper-"+e]?n.setAttribute("data-"+e,""):n.removeAttribute("data-"+e)}),t.attributes.popper={}}}},f=[{name:"offset",options:{offset:i}},{name:"preventOverflow",options:{padding:{top:2,bottom:2,left:5,right:5}}},{name:"flip",options:{padding:5}},{name:"computeStyles",options:{adaptive:!a}},u];k()&&l&&f.push({name:"arrow",options:{element:l,padding:3}}),f.push.apply(f,(null==n?void 0:n.modifiers)||[]),A.popperInstance=lA(c,w,Object.assign({},n,{placement:r,onFirstUpdate:s,modifiers:f}))}function K(){A.popperInstance&&(A.popperInstance.destroy(),A.popperInstance=null)}function Z(){return bA(w.querySelectorAll("[data-tippy-root]"))}function ee(e){A.clearDelayTimeouts(),e&&Q("onTrigger",[A,e]),O();var t=N(!0),r=B(),i=r[0],o=r[1];FA.isTouch&&"hold"===i&&o&&(t=o),t?n=setTimeout(function(){A.show()},t):A.show()}function te(e){if(A.clearDelayTimeouts(),Q("onUntrigger",[A,e]),A.state.isVisible){if(!(A.props.trigger.indexOf("mouseenter")>=0&&A.props.trigger.indexOf("click")>=0&&["mouseleave","mousemove"].indexOf(e.type)>=0&&f)){var t=N(!1);t?r=setTimeout(function(){A.state.isVisible&&A.hide()},t):i=requestAnimationFrame(function(){A.hide()})}}else P()}}function rb(e,t){void 0===t&&(t={});var n=$A.plugins.concat(t.plugins||[]);!function(e){var t=!e,n="[object Object]"===Object.prototype.toString.call(e)&&!e.addEventListener;PA(t,["tippy() was passed","`"+String(e)+"`","as its targets (first) argument. Valid types are: String, Element,","Element[], or NodeList."].join(" ")),PA(n,["tippy() was passed a plain object which is not supported as an argument","for virtual positioning. Use props.getReferenceClientRect instead."].join(" "))}(e),GA(t,n),document.addEventListener("touchstart",NA,dA),window.addEventListener("blur",QA);var r=Object.assign({},t,{plugins:n}),i=CA(e),o=xA(r.content),a=i.length>1;OA(o&&a,["tippy() was passed an Element as the `content` prop, but more than","one tippy instance was created by this invocation. This means the","content element will only be appended to the last tippy instance.","\n\n","Instead, pass the .innerHTML of the element, or use a function that","returns a cloned version of the element instead.","\n\n","1) content: element.innerHTML\n","2) content: () => element.cloneNode(true)"].join(" "));var s=i.reduce(function(e,t){var n=t&&nb(t,r);return n&&e.push(n),e},[]);return xA(e)?s[0]:s}rb.defaultProps=$A,rb.setDefaultProps=function(e){GA(e,[]),Object.keys(e).forEach(function(t){$A[t]=e[t]})},rb.currentInput=FA,Object.assign({},uv,{effect:function(e){var t=e.state,n={popper:{position:t.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};Object.assign(t.elements.popper.style,n.popper),t.styles=n,t.elements.arrow&&Object.assign(t.elements.arrow.style,n.arrow)}}),rb.setDefaultProps({render:KA});Ty('.tippy-box[data-animation=fade][data-state=hidden]{opacity:0}[data-tippy-root]{max-width:calc(100vw - 10px)}.tippy-box{position:relative;background-color:#333;color:#fff;border-radius:4px;font-size:14px;line-height:1.4;white-space:normal;outline:0;transition-property:transform,visibility,opacity}.tippy-box[data-placement^=top]>.tippy-arrow{bottom:0}.tippy-box[data-placement^=top]>.tippy-arrow:before{bottom:-7px;left:0;border-width:8px 8px 0;border-top-color:initial;transform-origin:center top}.tippy-box[data-placement^=bottom]>.tippy-arrow{top:0}.tippy-box[data-placement^=bottom]>.tippy-arrow:before{top:-7px;left:0;border-width:0 8px 8px;border-bottom-color:initial;transform-origin:center bottom}.tippy-box[data-placement^=left]>.tippy-arrow{right:0}.tippy-box[data-placement^=left]>.tippy-arrow:before{border-width:8px 0 8px 8px;border-left-color:initial;right:-7px;transform-origin:center left}.tippy-box[data-placement^=right]>.tippy-arrow{left:0}.tippy-box[data-placement^=right]>.tippy-arrow:before{left:-7px;border-width:8px 8px 8px 0;border-right-color:initial;transform-origin:center right}.tippy-box[data-inertia][data-state=visible]{transition-timing-function:cubic-bezier(.54,1.5,.38,1.11)}.tippy-arrow{width:16px;height:16px;color:#333}.tippy-arrow:before{content:"";position:absolute;border-color:transparent;border-style:solid}.tippy-content{position:relative;padding:5px 9px;z-index:1}');async function ib(e,t={}){if(!ca(e))throw new Error("invalid fun");let n=we(t,"width");n=Ee(n)?_o(n):Fe(n)?Ir(n):null;let r=we(t,"height");r=Ee(r)?_o(r):Fe(r)?Ir(r):null;let i=document.createElement("div");Fe(n)&&(i.style.width=`${n}px`),Fe(r)&&(i.style.height=`${r}px`);let o=document.createElement("div");o.style.position="absolute",o.style.top=0,o.style.left=0,o.style.zIndex=-1,o.appendChild(i);let a=document.createElement("div");a.style.position="relative",a.appendChild(o);let s,l=document.createElement("div");l.style.position="fixed",l.style.zIndex=-1,l.appendChild(a),fm(document.querySelector("body"),l);let c=e(i);return s=cs(c)?await c:c,um(l),s}function ob(e){if(!ca(e))throw new Error("fn is not a function");return function(){let t=Ya(),n=null,r=null;try{n=e.apply(this,arguments)}catch(e){r=e}return null!==r?t.resolve({state:"error",msg:r}):cs(n)?n.then(e=>{t.resolve({state:"success",msg:e})}).catch(e=>{"cancelled"===we(e,"reason")?t.resolve({state:"cancelled",msg:""}):t.resolve({state:"error",msg:e})}):t.resolve({state:"success",msg:n}),t}}Ty(".tippy-box[data-theme~=light]{color:#26323d;box-shadow:0 0 20px 4px rgba(154,161,177,.15),0 4px 80px -8px rgba(36,40,47,.25),0 4px 4px -2px rgba(91,94,105,.15);background-color:#fff}.tippy-box[data-theme~=light][data-placement^=top]>.tippy-arrow:before{border-top-color:#fff}.tippy-box[data-theme~=light][data-placement^=bottom]>.tippy-arrow:before{border-bottom-color:#fff}.tippy-box[data-theme~=light][data-placement^=left]>.tippy-arrow:before{border-left-color:#fff}.tippy-box[data-theme~=light][data-placement^=right]>.tippy-arrow:before{border-right-color:#fff}.tippy-box[data-theme~=light]>.tippy-backdrop{background-color:#fff}.tippy-box[data-theme~=light]>.tippy-svg-arrow{fill:#fff}");let ab=ob;function sb(e){if(!xr(e))return!1;return zi(e)<0}function lb(e=0){let t=0,n=[];sb(e)&&(e=0),e=zi(e);let r=Ui();return r.get=function(){if(n.length>0){return t+=1,n.splice(0,1)[0]}return null},r.cb=function(){t-=1,t<0&&(t=0),n.length>0&&r.emit("message",n)},r.push=function(i){n.push(i),(e<=0||t<e)&&r.emit("message",n)},r.clear=function(){t=0,n=[]},r}function cb(e=0,t=!1){return new function(e,t){let n=null;fo(e)||(e=0),e=zi(e),ir(t)||(t=!1);let r=lb(e);return r.on("message",async function(e){let t=r.get();if(!t)return;await ls(1);let n,i=we(t,"id"),o=we(t,"fun"),a=we(t,"input");n=ca(o)?await ab(o)(...a):{state:"error",msg:"fun is not a function"},r.emit(i,n),r.cb()}),function(e,...i){let o=Ya(),a=Mu();n=a;let s={id:a,fun:e,input:i};return r.push(s),r.once(a,e=>{t?a===n?"success"===e.state?o.resolve(e.msg):o.reject(e.msg):o.reject({reason:"cancelled"}):"success"===e.state?o.resolve(e.msg):o.reject(e.msg)}),o}}(e,t)}function ub(e,t){Ga()?Ee(e)?$u()?function(e,t){window.navigator.msSaveOrOpenBlob(t,e)}(e,t):function(e,t){let n=window.URL.createObjectURL(t),r=document.createElement("a");r.href=n,r.download=e,document.body.appendChild(r),r.click(),document.body.removeChild(r),window.URL.revokeObjectURL(n)}(e,t):console.log("no filename"):console.log("no window")}function fb(e,t="data"){if(!xe(e))return{error:"sheet is not an object"};if(!Ie(we(e,"rows")))return{error:"sheet.rows is not an array"};Ee(t)||(t="data");let n={sheets:[]};return n.sheets.push({...e,name:t}),n}function db(e,t="data"){if(!Ie(e))return{error:"data is not an array"};Ee(t)||(t="data");let n=null,r=cr(e);return De(r,"error")?r:(n=fb(r,t),De(n,"error"),n)}class hb extends Error{name="HucreError";constructor(e,t){super(e,t)}}class pb extends hb{details;name="ParseError";constructor(e,t,n){super(e,n),this.details=t}}class gb extends hb{name="ZipError"}class mb extends hb{name="XmlError"}class yb extends hb{name="InvalidArgumentError"}class vb extends hb{name="EncryptedFileError";format;constructor(e,t){super(t??(e?`File is password-protected (${e.toUpperCase()} encrypted with the OLE2/CFB container). Provide a password in options to decrypt it.`:"File is password-protected. Provide a password in options.")),this.format=e}}class Ab extends hb{name="DecryptionError";constructor(e="Failed to decrypt: incorrect password or corrupt encryption data.",t){super(e,t)}}const bb=536870888;class wb extends pb{}function Ib(e,t){try{return new TextDecoder("utf-8").decode(e)}catch(n){if(n instanceof RangeError||"ERR_STRING_TOO_LONG"===n?.code||e.length>bb)throw function(e,t){return new wb(`Part "${e}" is ${t.toLocaleString("en-US")} bytes, over the ${bb.toLocaleString("en-US")}-character maximum string length this runtime supports, so it cannot be read into memory whole.\n - streamXlsxRows(input) reads a worksheet of any size, a row at a time.\n - The workbook is not damaged; this is a limit of the buffered reader.`)}(t,e.length);throw n}}const xb={amp:"&",lt:"<",gt:">",quot:'"',apos:"'"};function Cb(e){return-1===e.indexOf("\r")?e:e.replace(/\r\n?/g,"\n")}function Bb(e){return-1===e.indexOf("&")?e:e.replace(/&(#x[0-9a-fA-F]+|#[0-9]+|[a-zA-Z]+);/g,(e,t)=>{if(35===t.charCodeAt(0)){const n=120===t.charCodeAt(1)||88===t.charCodeAt(1)?parseInt(t.slice(2),16):parseInt(t.slice(1),10);return Number.isNaN(n)||(n<0||n>1114111)?e:String.fromCodePoint(n)}return xb[t]??e})}function Eb(e){return-1===e.indexOf("_x")?e:e.replace(/_x([0-9A-Fa-f]{4})_/g,(e,t)=>String.fromCharCode(parseInt(t,16)))}function kb(e){const t={};let n=0;const r=e.length;for(;n<r;){for(;n<r&&Sb(e.charCodeAt(n));)n++;if(n>=r)break;const i=n;for(;n<r&&61!==e.charCodeAt(n)&&!Sb(e.charCodeAt(n));)n++;const o=e.slice(i,n);if(!o)break;for(;n<r&&Sb(e.charCodeAt(n));)n++;if(n>=r||61!==e.charCodeAt(n)){t[o]="";continue}for(n++;n<r&&Sb(e.charCodeAt(n));)n++;if(n>=r)break;const a=e.charCodeAt(n);if(34===a||39===a){n++;const i=n;for(;n<r&&e.charCodeAt(n)!==a;)n++;t[o]=Bb(Cb(e.slice(i,n))),n++}else{const i=n;for(;n<r&&!Sb(e.charCodeAt(n));)n++;t[o]=Bb(Cb(e.slice(i,n)))}}return t}function Sb(e){return 32===e||9===e||10===e||13===e}function Fb(e,t){const n=65279===e.charCodeAt(0)?e.slice(1):e,r=n.length;let i=0;function o(e){let t=1,o=1;for(let e=0;e<i&&e<r;e++)10===n.charCodeAt(e)?(t++,o=1):o++;throw new mb(`${e} at line ${t}, column ${o}`)}for(;i<r;){if(60===n.charCodeAt(i)){const e=i+1<r?n.charCodeAt(i+1):0;if(33===e){if("\x3c!--"===n.slice(i,i+4)){const e=n.indexOf("--\x3e",i+4);-1===e&&o("Unterminated comment"),i=e+3;continue}if("<![CDATA["===n.slice(i,i+9)){const e=n.indexOf("]]>",i+9);-1===e&&o("Unterminated CDATA section");const r=n.slice(i+9,e);t.onCData?.(r),t.onText?.(r),i=e+3;continue}const e=n.indexOf(">",i+2);-1===e&&o("Unterminated declaration"),i=e+1;continue}if(63===e){const e=n.indexOf("?>",i+2);-1===e&&o("Unterminated processing instruction"),i=e+2;continue}if(47===e){const e=n.indexOf(">",i+2);-1===e&&o("Unterminated closing tag");const r=n.slice(i+2,e).trim();t.onCloseTag?.(r),i=e+1;continue}let a=i+1,s=0;for(;a<r;){const e=n.charCodeAt(a);if(s)e===s&&(s=0);else if(34===e||39===e)s=e;else if(62===e)break;a++}a>=r&&o("Unterminated opening tag");const l=47===n.charCodeAt(a-1),c=n.slice(i+1,l?a-1:a);let u=0;const f=c.length;for(;u<f&&!Sb(c.charCodeAt(u));)u++;const d=c.slice(0,u),h=u<f?c.slice(u+1):"",p=h?kb(h):{};t.onOpenTag?.(d,p),l&&t.onCloseTag?.(d),i=a+1;continue}const e=i;for(;i<r&&60!==n.charCodeAt(i);)i++;const a=n.slice(e,i);if(a){const e=Bb(Cb(a));t.onText?.(e)}}}const Db=262144,Nb=64;function Mb(e,t,n){let r=n;const i=e.lastIndexOf("&",r-1);i>=t&&n-i<=Nb&&-1===e.indexOf(";",i)&&(r=i);const o=r>t?e.charCodeAt(r-1):0;return(o>=55296&&o<=56319||13===o)&&r--,r>t?r:t}function Qb(e,t,n,r){if(e)throw new mb(r);return t.slice(n)}function Tb(e,t,n,r){let i=0;const o=e.length;for(;i<o;){if(60===e.charCodeAt(i)){const a=i+1<o?e.charCodeAt(i+1):-1;if(-1===a&&!n)return e.slice(i);if(33===a){if("\x3c!--"===e.slice(i,i+4)){const t=e.indexOf("--\x3e",i+4);if(-1===t)return Qb(n&&r,e,i,"Unterminated comment");i=t+3;continue}if("<![CDATA["===e.slice(i,i+9)){const o=e.indexOf("]]>",i+9);if(-1===o)return Qb(n&&r,e,i,"Unterminated CDATA section");const a=e.slice(i+9,o);t.onCData?.(a),t.onText?.(a),i=o+3;continue}if(!n&&o-i<9)return e.slice(i);const a=e.indexOf(">",i+2);if(-1===a)return Qb(n&&r,e,i,"Unterminated declaration");i=a+1;continue}if(63===a){const t=e.indexOf("?>",i+2);if(-1===t)return Qb(n&&r,e,i,"Unterminated processing instruction");i=t+2;continue}if(47===a){const o=e.indexOf(">",i+2);if(-1===o)return Qb(n&&r,e,i,"Unterminated closing tag");const a=e.slice(i+2,o).trim();t.onCloseTag?.(a),i=o+1;continue}let s=i+1,l=0;for(;s<o;){const t=e.charCodeAt(s);if(l)t===l&&(l=0);else if(34===t||39===t)l=t;else if(62===t)break;s++}if(s>=o)return Qb(n&&r,e,i,"Unterminated opening tag");const c=47===e.charCodeAt(s-1),u=e.slice(i+1,c?s-1:s);let f=0;const d=u.length;for(;f<d&&!Sb(u.charCodeAt(f));)f++;const h=u.slice(0,f),p=f<d?u.slice(f+1):"",g=p?kb(p):{};t.onOpenTag?.(h,g),c&&t.onCloseTag?.(h),i=s+1;continue}const a=i;for(;i<o&&60!==e.charCodeAt(i);)i++;if(i>=o&&!n){if(o-a>Db){const n=Mb(e,a,o);if(n>a)return t.onText?.(Bb(Cb(e.slice(a,n)))),e.slice(n)}return e.slice(a)}const s=e.slice(a,i);if(s){const e=Bb(Cb(s));t.onText?.(e)}}return""}function Lb(e){const t={tag:"",local:"",prefix:"",attrs:{},children:[]},n=[t];if(Fb(e,{onOpenTag(e,t){const{local:r,prefix:i}=function(e){const t=e.indexOf(":");return-1===t?{local:e,prefix:""}:{prefix:e.slice(0,t),local:e.slice(t+1)}}(e),o={tag:e,local:r,prefix:i,attrs:t,children:[]};n[n.length-1].children.push(o),n.push(o)},onCloseTag(e){if(n.length<=1)throw new mb("Unexpected closing tag: no matching open tag");const t=n[n.length-1];if(t.tag!==e)throw new mb(`Mismatched closing tag: expected </${t.tag}> but found </${e}>`);if(n.pop(),t.children.length>0){const e=[];for(const n of t.children)"string"==typeof n&&e.push(n);e.length>0&&(t.text=e.join(""))}},onText(e){n[n.length-1].children.push(e)}}),n.length>1){const e=n[n.length-1].tag;throw new mb(`Unexpected end of document: unclosed element <${e}>`)}if(0===t.children.length)throw new mb("Empty document: no root element found");for(const e of t.children)if("string"!=typeof e)return e;throw new mb("No root element found in document")}function Rb(e,t){for(const n of e.children)if("string"!=typeof n&&n.local===t)return n}function Ub(e){const t=[];for(const n of e.children)"string"!=typeof n&&t.push(n);return t}function Hb(e,t){if(e.local===t)return e;for(const n of e.children){if("string"==typeof n)continue;const e=Hb(n,t);if(e)return e}}function qb(e,t){const n=Rb(e,t);if(!n)return"";let r="";for(const e of n.children)"string"==typeof e&&(r+=e);return r}function Ob(e,t){if(void 0===e)return t;const n=parseInt(e,10);return Number.isNaN(n)?t:n}function Pb(e){const t=Lb(e),n=[];for(const e of Ub(t)){if("threadedComment"!==e.local)continue;const t=e.attrs.id,r=e.attrs.personId;if(!t||!r)continue;const i={id:t,personId:r,text:qb(e,"text")};e.attrs.ref&&(i.ref=e.attrs.ref),e.attrs.parentId&&(i.parentId=e.attrs.parentId),e.attrs.dT&&(i.date=e.attrs.dT),"1"!==e.attrs.done&&"true"!==e.attrs.done||(i.done=!0);const o=Rb(e,"mentions");if(o){const e=[];for(const t of Ub(o)){if("mention"!==t.local)continue;const n=t.attrs.mentionpersonId,r=t.attrs.mentionId;n&&r&&e.push({mentionPersonId:n,mentionId:r,startIndex:Ob(t.attrs.startIndex,0),length:Ob(t.attrs.length,0)})}e.length>0&&(i.mentions=e)}n.push(i)}return n}function zb(e){const t=Lb(e),n=[];for(const e of t.children){if("string"==typeof e)continue;if("Relationship"===(e.local||e.tag)){const t=e.attrs.Id??"",r=e.attrs.Type??"",i=e.attrs.Target??"",o=e.attrs.TargetMode;if(t&&r&&i){const e={id:t,type:r,target:i};o&&(e.targetMode=o),n.push(e)}}}return n}function $b(e,t){if(t.startsWith("/"))return t.slice(1);const n=e.split("/").filter(Boolean),r=t.split("/").filter(Boolean);for(const e of r)".."===e?n.pop():"."!==e&&n.push(e);return n.join("/")}function jb(e){const t=e.lastIndexOf("/");return-1===t?"":e.slice(0,t)}function Vb(e){for(const t of Object.keys(e))if(t.endsWith(":id")&&e[t].startsWith("rId"))return e[t]}const Yb=new Set(["n","s","b","e","str"]);function Gb(e,t){const n=Rb(Lb(e),"externalBook");let r,i="";if(n&&t){const e=zb(t),o=n.attrs["r:id"]??n.attrs.id,a=o?e.find(e=>e.id===o):void 0;a&&(i=a.target,"External"!==a.targetMode&&"Internal"!==a.targetMode||(r=a.targetMode))}const o=function(e){const t=e?Rb(e,"sheetNames"):void 0;if(!t)return[];const n=[];for(const e of Ub(t))"sheetName"===e.local&&n.push(e.attrs.val??"");return n}(n),a=function(e){const t=e?Rb(e,"sheetDataSet"):void 0;if(!t)return[];const n=[];for(const e of Ub(t)){if("sheetData"!==e.local)continue;const t=Ob(e.attrs.sheetId,0),r=[];for(const t of Ub(e))if("row"===t.local)for(const e of Ub(t)){if("cell"!==e.local)continue;const t=e.attrs.r??"";if(!t)continue;const n=e.attrs.t??"n",i=Yb.has(n)?n:"n",o=qb(e,"v");r.push({ref:t,type:i,value:Wb(i,o)})}n.push({sheetId:t,cells:r})}return n}(n),s=function(e){const t=e?Rb(e,"definedNames"):void 0;if(!t)return[];const n=[];for(const e of Ub(t)){if("definedName"!==e.local)continue;const t={name:e.attrs.name??""};if(e.attrs.refersTo&&(t.refersTo=e.attrs.refersTo),void 0!==e.attrs.sheetId){const n=Ob(e.attrs.sheetId,NaN);Number.isNaN(n)||(t.sheetId=n)}t.name&&n.push(t)}return n}(n),l={target:i,sheetNames:o,sheetData:a};return r&&(l.targetMode=r),s&&s.length>0&&(l.definedNames=s),l}function Wb(e,t){switch(e){case"n":case"s":{const e=Number(t);return Number.isFinite(e)?e:0}case"b":return"1"===t||"true"===t;case"e":case"str":return t}}function Jb(e){const t=Rb(e,"pic");if(!t)return;const n=Rb(t,"nvPicPr"),r=n?Rb(n,"cNvPr"):void 0,i=r?.attrs.name;if(!i)return;const o=Rb(t,"blipFill"),a=o?Rb(o,"blip"):void 0,s=a?.attrs["r:embed"]??a?.attrs.embed;if(!s)return;const l={id:i,embedRId:s},c=r?.attrs.descr;return c&&(l.description=c),l}function _b(e){const t=Lb(e),n="pivotCacheDefinition"===t.local?t:Rb(t,"pivotCacheDefinition");if(!n)return;const r={cacheId:0,fieldNames:[]},i=Rb(n,"cacheSource");if(i){const e=i.attrs.type;"worksheet"!==e&&"external"!==e&&"consolidation"!==e&&"scenario"!==e||(r.sourceType=e);const t=Rb(i,"worksheetSource");t&&(t.attrs.ref?r.sourceRef=t.attrs.ref:t.attrs.name&&(r.sourceRef=t.attrs.name),t.attrs.sheet&&(r.sourceSheet=t.attrs.sheet))}const o=Rb(n,"cacheFields");if(o)for(const e of Ub(o)){if("cacheField"!==e.local)continue;const t=e.attrs.name??"";r.fieldNames.push(t)}return r}function Xb(e){const t=Lb(e),n="pivotTableDefinition"===t.local?t:Rb(t,"pivotTableDefinition");if(!n)return;const r=n.attrs.name;if(!r)return;const i=Ob(n.attrs.cacheId,NaN),o={name:r,cacheId:Number.isNaN(i)?0:i,location:"",fields:[]},a=Rb(n,"location");if(a){a.attrs.ref&&(o.location=a.attrs.ref);const e=Ob(a.attrs.firstHeaderRow,NaN);Number.isNaN(e)||(o.firstHeaderRow=e);const t=Ob(a.attrs.firstDataRow,NaN);Number.isNaN(t)||(o.firstDataRow=t);const n=Ob(a.attrs.firstDataCol,NaN);Number.isNaN(n)||(o.firstDataCol=n);const r=Ob(a.attrs.rowPageCount,NaN);Number.isNaN(r)||(o.rowPageCount=r);const i=Ob(a.attrs.colPageCount,NaN);Number.isNaN(i)||(o.colPageCount=i)}const s=Rb(n,"pivotFields"),l=[];if(s)for(const e of Ub(s)){if("pivotField"!==e.local)continue;const t=e.attrs.axis,n="1"===e.attrs.dataField||"true"===e.attrs.dataField;let r="hidden";"axisRow"===t?r="row":"axisCol"===t?r="col":"axisPage"===t?r="page":("axisValues"===t||n)&&(r="data"),l.push({axis:r,raw:e})}const c=Rb(n,"dataFields"),u=new Map;if(c)for(const e of Ub(c)){if("dataField"!==e.local)continue;const t=Ob(e.attrs.fld,NaN);if(Number.isNaN(t))continue;const n={};e.attrs.name&&(n.name=e.attrs.name);const r=Zb(e.attrs.subtotal);r&&(n.subtotal=r),u.set(t,n)}for(let e=0;e<l.length;e++){const{axis:t}=l[e],n={name:`field${e+1}`,axis:t};if("data"===t){const t=u.get(e);n.function=t?.subtotal?t.subtotal:"sum",t?.name&&(n.displayName=t.name)}o.fields.push(n)}const f=Rb(n,"pivotTableStyleInfo");return f?.attrs.name&&(o.styleName=f.attrs.name),n.attrs.dataCaption&&(o.dataCaption=n.attrs.dataCaption),o}function Kb(e,t){for(let n=0;n<e.fields.length;n++){const r=t.fieldNames[n];r&&(e.fields[n].name=r)}}function Zb(e){if(e)switch(e){case"sum":case"count":case"average":case"max":case"min":case"product":case"countNums":case"stdDev":case"stdDevp":case"var":case"varp":return e;case"countA":return"count";default:return}}function ew(e){const t=Lb(e),n=[];for(const e of Ub(t)){if("slicer"!==e.local)continue;const t=e.attrs.name,r=e.attrs.cache;if(!t||!r)continue;const i={name:t,cache:r};if(e.attrs.caption&&(i.caption=e.attrs.caption),void 0!==e.attrs.columnCount){const t=Ob(e.attrs.columnCount,NaN);Number.isNaN(t)||(i.columnCount=t)}if(e.attrs.style&&(i.style=e.attrs.style),e.attrs.sortOrder&&(i.sortOrder=e.attrs.sortOrder),void 0!==e.attrs.rowHeight){const t=Ob(e.attrs.rowHeight,NaN);Number.isNaN(t)||(i.rowHeight=t)}n.push(i)}return n}function tw(e){const t=Lb(e),n="slicerCacheDefinition"===t.local?t:Rb(t,"slicerCacheDefinition");if(!n)return;const r=n.attrs.name;if(!r)return;const i={name:r};n.attrs.sourceName&&(i.sourceName=n.attrs.sourceName);const o=iw(n);o.length>0&&(i.pivotTables=o);const a=function(e){const t=Rb(e,"extLst");if(!t)return;for(const e of Ub(t)){if("ext"!==e.local)continue;const t=Rb(e,"tableSlicerCache");if(!t)continue;const n=t.attrs.name??t.attrs.tableId;if(!n)continue;const r={name:n};return t.attrs.column&&(r.column=t.attrs.column),r}return}(n);return a&&(i.tableSource=a),i}function nw(e){const t=Lb(e),n=[];for(const e of Ub(t)){if("timeline"!==e.local)continue;const t=e.attrs.name,r=e.attrs.cache;if(!t||!r)continue;const i={name:t,cache:r};e.attrs.caption&&(i.caption=e.attrs.caption),e.attrs.style&&(i.style=e.attrs.style),e.attrs.level&&(i.level=e.attrs.level),void 0!==e.attrs.showHeader&&(i.showHeader=ow(e.attrs.showHeader)),void 0!==e.attrs.showSelectionLabel&&(i.showSelectionLabel=ow(e.attrs.showSelectionLabel)),void 0!==e.attrs.showTimeLevel&&(i.showTimeLevel=ow(e.attrs.showTimeLevel)),void 0!==e.attrs.showHorizontalScrollbar&&(i.showHorizontalScrollbar=ow(e.attrs.showHorizontalScrollbar)),n.push(i)}return n}function rw(e){const t=Lb(e),n="timelineCacheDefinition"===t.local?t:Rb(t,"timelineCacheDefinition");if(!n)return;const r=n.attrs.name;if(!r)return;const i={name:r};n.attrs.sourceName&&(i.sourceName=n.attrs.sourceName);const o=iw(n);return o.length>0&&(i.pivotTables=o),i}function iw(e){const t=Rb(e,"pivotTables");if(!t)return[];const n=[];for(const e of Ub(t)){if("pivotTable"!==e.local)continue;const t=e.attrs.name;if(!t)continue;const r=Ob(e.attrs.tabId,NaN);Number.isNaN(r)||n.push({tabId:r,name:t})}return n}function ow(e){return"1"===e||"true"===e}function aw(e){return`_x${e.toString(16).toUpperCase().padStart(4,"0")}_`}function sw(e){return e>=0&&e<=8||11===e||12===e||e>=14&&e<=31}function lw(e,t="ooxml"){let n="",r=0;for(let i=0;i<e.length;i++){const o=e.charCodeAt(i);let a;switch(o){case 38:a="&amp;";break;case 60:a="&lt;";break;case 62:a="&gt;";break;case 13:a="charRef"===t?"&#13;":aw(13);break;default:sw(o)&&(a=aw(o))}a&&(n+=e.slice(r,i)+a,r=i+1)}return 0===r?e:n+e.slice(r)}function cw(e){let t="",n=0;for(let r=0;r<e.length;r++){let i;switch(e.charCodeAt(r)){case 38:i="&amp;";break;case 60:i="&lt;";break;case 62:i="&gt;";break;case 34:i="&quot;";break;case 39:i="&apos;";break;case 9:i="&#9;";break;case 10:i="&#10;";break;case 13:i="&#13;";break;default:sw(e.charCodeAt(r))&&(i=aw(e.charCodeAt(r)))}i&&(t+=e.slice(n,r)+i,n=r+1)}return 0===n?e:t+e.slice(n)}function uw(e){if(!e)return"";let t="";const n=Object.keys(e);for(let r=0;r<n.length;r++){const i=n[r],o=e[i];null!=o&&(t+="boolean"==typeof o?` ${i}="${o?"true":"false"}"`:` ${i}="${cw(String(o))}"`)}return t}function fw(e,t){return`<${e}${uw(t)}/>`}function dw(e){const t=lw(e);return e.length>0&&(" "===e[0]||" "===e[e.length-1]||e.includes("\n")||e.includes("\t"))?`<t xml:space="preserve">${t}</t>`:hw("t",void 0,t)}function hw(e,t,n){const r=uw(t);if(null==n)return`<${e}${r}/>`;const i=Array.isArray(n)?n.join(""):n;return i?`<${e}${r}>${i}</${e}>`:`<${e}${r}/>`}function pw(e,t,n,r){const i=[];return!1!==r?.declaration&&i.push(function(e){return`<?xml version="1.0" encoding="UTF-8" standalone="${e?.standalone??"yes"}"?>`}(r)),null==n?i.push(fw(e,t)):i.push(hw(e,t,n)),i.join("")}function gw(e,t){for(const n of e.children)"string"!=typeof n&&("t"===n.local?t.push(mw(n)):gw(n,t))}function mw(e){let t="";for(const n of e.children)t+="string"==typeof n?n:mw(n);return t}function yw(e){if("string"!=typeof e)return;const t=e.trim().toLowerCase();return"1"===t||"true"===t||"0"!==t&&"false"!==t&&void 0}function vw(e){const t=e.attrs.val;if("string"==typeof t)return"1"===t||"true"===t.toLowerCase()}function Aw(e){if(void 0!==e)return"1"===e||"true"===e||"0"!==e&&"false"!==e&&void 0}function bw(e){if(!e)return;const t=Rb(e,"numRef")??Rb(e,"strRef");if(t){const e=Rb(t,"f");if(e){const t=mw(e).trim();if(t.length>0)return t}}const n=Rb(e,"f");if(n){const e=mw(n).trim();if(e.length>0)return e}}function ww(e,t){const n=Rb(e,t);if(!n)return;const r=n.attrs.val;if("string"!=typeof r)return;const i=r.trim();if(0===i.length)return;const o=Number(i);return Number.isFinite(o)?o:void 0}const Iw=.25,xw=13.5,Cw=12700,Bw=new Set(["solid","dot","dash","lgDash","dashDot","lgDashDot","lgDashDotDot","sysDash","sysDot","sysDashDot","sysDashDotDot"]),Ew=new Set(["solid","dash","dashDot","dot","lgDash","lgDashDot","lgDashDotDot","sysDash","sysDashDot","sysDashDotDot","sysDot"]),kw=new Set(["rnd","sq","flat"]),Sw=new Set(["sng","dbl","thickThin","thinThick","tri"]);function Fw(e){if("string"==typeof e&&kw.has(e)&&"flat"!==e)return e}function Dw(e){if("string"==typeof e&&Sw.has(e)&&"sng"!==e)return e}function Nw(e){const t=Rb(e,"spPr");if(!t)return;const n=Rb(t,"ln");if(!n)return;const r=n.attrs.cap;if("string"!=typeof r)return;const i=r.trim();return kw.has(i)&&"flat"!==i?i:void 0}function Mw(e){const t=Rb(e,"spPr");if(!t)return;const n=Rb(t,"ln");if(!n)return;const r=n.attrs.cmpd;if("string"!=typeof r)return;const i=r.trim();return Sw.has(i)&&"sng"!==i?i:void 0}const Qw=new Set(["bg1","tx1","bg2","tx2","accent1","accent2","accent3","accent4","accent5","accent6","hlink","folHlink","phClr","dk1","lt1","dk2","lt2"]),Tw=1e5,Lw=-1e5,Rw=1e5;function Uw(e,t,n,r){const i=Rb(e,t);if(!i)return;const o=i.attrs.val;if("string"!=typeof o)return;const a=Number.parseInt(o.trim(),10);return Number.isFinite(a)&&!(a<n||a>r)?a:void 0}function Hw(e){const t=e.attrs.val;if("string"!=typeof t)return;const n=t.trim();if(!Qw.has(n))return;const r={theme:n},i=Uw(e,"lumMod",0,Tw);void 0!==i&&(r.lumMod=i);const o=Uw(e,"lumOff",0,Tw);void 0!==o&&(r.lumOff=o);const a=Uw(e,"tint",Lw,Rw);void 0!==a&&(r.tint=a);const s=Uw(e,"shade",Lw,Rw);void 0!==s&&(r.shade=s);const l=Uw(e,"alpha",0,Tw);return void 0!==l&&(r.alpha=l),r}function qw(e){if(null==e)return;if("string"==typeof e){return Pw(e)}if("object"!=typeof e)return;const t=e.theme;if("string"!=typeof t||!Qw.has(t))return;const n={theme:t},r=(e,t,n)=>{if("number"!=typeof e||!Number.isFinite(e))return;const r=Math.round(e);return r<t||r>n?void 0:r},i=r(e.lumMod,0,Tw);void 0!==i&&(n.lumMod=i);const o=r(e.lumOff,0,Tw);void 0!==o&&(n.lumOff=o);const a=r(e.tint,Lw,Rw);void 0!==a&&(n.tint=a);const s=r(e.shade,Lw,Rw);void 0!==s&&(n.shade=s);const l=r(e.alpha,0,Tw);return void 0!==l&&(n.alpha=l),n}function Ow(e){if("string"==typeof e)return fw("a:srgbClr",{val:e});const t=[];return void 0!==e.tint&&t.push(fw("a:tint",{val:e.tint})),void 0!==e.shade&&t.push(fw("a:shade",{val:e.shade})),void 0!==e.alpha&&t.push(fw("a:alpha",{val:e.alpha})),void 0!==e.lumMod&&t.push(fw("a:lumMod",{val:e.lumMod})),void 0!==e.lumOff&&t.push(fw("a:lumOff",{val:e.lumOff})),0===t.length?fw("a:schemeClr",{val:e.theme}):hw("a:schemeClr",{val:e.theme},t)}function Pw(e){if("string"!=typeof e)return;const t=e.trim();if(0===t.length)return;const n=t.startsWith("#")?t.slice(1):t;return 6===n.length&&/^[0-9a-fA-F]{6}$/.test(n)?n.toUpperCase():void 0}function zw(e){const t=Rb(e,"spPr");if(!t)return;const n=Rb(t,"solidFill");if(!n)return;const r=Rb(n,"srgbClr");if(r)return Pw(r.attrs.val);const i=Rb(n,"schemeClr");return i?Hw(i):void 0}function $w(e){const t=Rb(e,"spPr");if(!t)return;const n=Rb(t,"ln");if(!n)return;const r=Rb(n,"solidFill");if(!r)return;const i=Rb(r,"srgbClr");if(i)return Pw(i.attrs.val);const o=Rb(r,"schemeClr");return o?Hw(o):void 0}function jw(e){const t=Rb(e,"spPr");if(!t)return;const n=Rb(t,"ln");if(!n)return;const r=n.attrs.w;if("string"!=typeof r)return;const i=Number.parseFloat(r);if(!Number.isFinite(i)||i<=0)return;const o=Math.round(i/Cw*4)/4;return o<Iw?Iw:o>xw?xw:o}function Vw(e){const t=Rb(e,"spPr");if(!t)return;const n=Rb(t,"ln");if(!n)return;const r=Rb(n,"prstDash");if(!r)return;const i=r.attrs.val;if("string"!=typeof i)return;const o=i.trim();return Ew.has(o)&&"solid"!==o?o:void 0}function Yw(e){if(void 0===e||!Number.isFinite(e))return;const t=Math.round(4*e)/4;return t<Iw?Iw:t>xw?xw:t}function Gw(e){if("string"==typeof e&&Ew.has(e)&&"solid"!==e)return e}function Ww(e){const t=Rb(e,"view3D");if(!t)return;const n={},r=Jw(t,"rotX",-90,90);void 0!==r&&(n.rotX=r);const i=Jw(t,"hPercent",5,500);void 0!==i&&(n.hPercent=i);const o=Jw(t,"rotY",0,360);void 0!==o&&(n.rotY=o);const a=Jw(t,"depthPercent",20,2e3);void 0!==a&&(n.depthPercent=a);const s=function(e,t){const n=Rb(e,t);if(!n)return;const r=n.attrs.val;if("string"!=typeof r)return;switch(r){case"1":case"true":return!0;case"0":case"false":return!1;default:return}}(t,"rAngAx");void 0!==s&&(n.rAngAx=s);const l=Jw(t,"perspective",0,240);return void 0!==l&&(n.perspective=l),n}function Jw(e,t,n,r){const i=Rb(e,t);if(!i)return;const o=i.attrs.val;if("string"!=typeof o)return;if(!/^-?\d+$/.test(o))return;const a=Number(o);return Number.isInteger(a)&&!(a<n||a>r)?a:void 0}function _w(e,t,n){if("number"==typeof e&&Number.isFinite(e)&&Number.isInteger(e)&&!(e<t||e>n))return e}function Xw(e){if(!e)return;const t=e.attrs.val;if("string"!=typeof t)return;const n=t.trim();if(0===n.length)return;const r=Number(n);return Number.isFinite(r)&&!(r<0||r>1)?r:void 0}function Kw(e){const t=Rb(e,"layout");if(!t)return;const n=Rb(t,"manualLayout");if(!n)return;const r=Xw(Rb(n,"x")),i=Xw(Rb(n,"y")),o=Xw(Rb(n,"w")),a=Xw(Rb(n,"h"));if(void 0===r&&void 0===i&&void 0===o&&void 0===a)return;const s={};return void 0!==r&&(s.x=r),void 0!==i&&(s.y=i),void 0!==o&&(s.w=o),void 0!==a&&(s.h=a),s}function Zw(e){if(!e||"object"!=typeof e)return;const t={},n=eI(e.x);void 0!==n&&(t.x=n);const r=eI(e.y);void 0!==r&&(t.y=r);const i=eI(e.w);void 0!==i&&(t.w=i);const o=eI(e.h);return void 0!==o&&(t.h=o),void 0!==t.x||void 0!==t.y||void 0!==t.w||void 0!==t.h?t:void 0}function eI(e){if("number"==typeof e&&Number.isFinite(e)&&!(e<0||e>1))return e}function tI(e){if(!e)return;const t=[];return void 0!==e.x&&t.push(fw("c:xMode",{val:"edge"})),void 0!==e.y&&t.push(fw("c:yMode",{val:"edge"})),void 0!==e.w&&t.push(fw("c:wMode",{val:"edge"})),void 0!==e.h&&t.push(fw("c:hMode",{val:"edge"})),void 0!==e.x&&t.push(fw("c:x",{val:e.x})),void 0!==e.y&&t.push(fw("c:y",{val:e.y})),void 0!==e.w&&t.push(fw("c:w",{val:e.w})),void 0!==e.h&&t.push(fw("c:h",{val:e.h})),0!==t.length?hw("c:layout",void 0,[hw("c:manualLayout",void 0,t)]):void 0}function nI(e){const t=Rb(e,"txPr");if(t)return iI(t)}function rI(e){const t=Rb(e,"title");if(!t)return;const n=Rb(t,"tx");if(!n)return;const r=Rb(n,"rich");return r?iI(r):void 0}function iI(e){const t=Rb(e,"p");if(!t)return;const n=Rb(t,"pPr");return n?Rb(n,"defRPr"):void 0}const oI=6e4,aI=100,sI=400,lI=oI,cI=-90;function uI(e,t,n,r,i,o){if(void 0===e&&void 0===t&&void 0===n&&void 0===r&&void 0===i&&void 0===o)return;const a=[];if(void 0!==e&&a.push(hw("a:solidFill",void 0,[Ow(e)])),void 0!==t||void 0!==n||void 0!==r||void 0!==i||void 0!==o){const e={};void 0!==n&&(e.w=Math.round(n*Cw)),void 0!==i&&(e.cap=i),void 0!==o&&(e.cmpd=o);const s=[];void 0!==t&&s.push(hw("a:solidFill",void 0,[Ow(t)])),void 0!==r&&s.push(fw("a:prstDash",{val:r})),a.push(0===s.length?fw("a:ln",e):hw("a:ln",Object.keys(e).length>0?e:void 0,s))}return hw("c:spPr",void 0,a)}function fI(e){if(void 0===e||"number"!=typeof e||!Number.isFinite(e))return;let t=Math.round(e);return t<cI?t=cI:t>90&&(t=90),0!==t?t:void 0}function dI(e){if(void 0===e||"number"!=typeof e||!Number.isFinite(e))return;const t=Math.round(2*e)/2;return t<1||t>400?void 0:t}function hI(e){return!0===e||!1!==e&&void 0}function pI(e){return!0===e||!1!==e&&void 0}function gI(e){return"string"==typeof e?Pw(e):qw(e)}function mI(e){return!0===e||!1!==e&&void 0}function yI(e){return!0===e||!1!==e&&void 0}const vI=aI,AI=sI;function bI(e,t,n,r,i,o,a,s,l,c,u,f,d,h,p,g,m){const y=[fw("c:legendPos",{val:e})];for(const e of n){const t=[fw("c:idx",{val:e.idx}),fw("c:delete",{val:e.delete?1:0})],n=wI(e.fontSize,e.bold,e.italic,e.underline,e.strikethrough,e.color,e.fontFamily);void 0!==n&&t.push(n),y.push(hw("c:legendEntry",void 0,t))}const v=tI(u);void 0!==v&&y.push(v),y.push(fw("c:overlay",{val:t?1:0}));const A=function(e,t,n,r,i,o){if(void 0===e&&void 0===t&&void 0===n&&void 0===r&&void 0===i&&void 0===o)return;const a=[];void 0!==e&&a.push(hw("a:solidFill",void 0,[Ow(e)]));if(void 0!==t||void 0!==n||void 0!==r||void 0!==i||void 0!==o){const e={};void 0!==n&&(e.w=Math.round(n*Cw)),void 0!==i&&(e.cap=i),void 0!==o&&(e.cmpd=o);const s=[];void 0!==t&&s.push(hw("a:solidFill",void 0,[Ow(t)])),void 0!==r&&s.push(fw("a:prstDash",{val:r})),a.push(0===s.length?fw("a:ln",e):hw("a:ln",Object.keys(e).length>0?e:void 0,s))}return hw("c:spPr",void 0,a)}(f,d,h,p,g,m);void 0!==A&&y.push(A);const b=wI(r,i,o,a,s,l,c);return void 0!==b&&y.push(b),hw("c:legend",void 0,y)}function wI(e,t,n,r,i,o,a){if(void 0===e&&void 0===t&&void 0===n&&void 0===r&&void 0===i&&void 0===o&&void 0===a)return;const s={};void 0!==e&&(s.sz=e*vI),void 0!==t&&(s.b=t?1:0),void 0!==n&&(s.i=n?1:0),void 0!==r&&(s.u=r?"sng":"none"),!0===i&&(s.strike="sngStrike");const l=void 0!==o?hw("a:solidFill",void 0,[Ow(o)]):void 0,c=a?fw("a:latin",{typeface:a}):void 0,u=[];l&&u.push(l),c&&u.push(c);const f=u.length>0?hw("a:defRPr",s,u):fw("a:defRPr",s);return hw("c:txPr",void 0,[fw("a:bodyPr"),fw("a:lstStyle"),hw("a:p",void 0,[hw("a:pPr",void 0,[f]),fw("a:endParaRPr",{lang:"en-US"})])])}const II=aI;function xI(e){const t=Rb(e,"dTable");if(!t)return;const n={},r=CI(t,"showHorzBorder");void 0!==r&&(n.showHorzBorder=r);const i=CI(t,"showVertBorder");void 0!==i&&(n.showVertBorder=i);const o=CI(t,"showOutline");void 0!==o&&(n.showOutline=o);const a=CI(t,"showKeys");void 0!==a&&(n.showKeys=a);const s=function(e){const t=nI(e);if(!t)return;const n=t.attrs.sz;if("string"!=typeof n)return;const r=n.trim();if(0===r.length)return;const i=Number.parseInt(r,10);if(!Number.isFinite(i))return;const o=Math.round(i/II*2)/2;return o<1||o>400?void 0:o}(t);void 0!==s&&(n.fontSize=s);const l=function(e){const t=nI(e);if(!t)return;const n=Rb(t,"solidFill");if(!n)return;const r=Rb(n,"srgbClr");if(r)return Pw(r.attrs.val);const i=Rb(n,"schemeClr");return i?Hw(i):void 0}(t);void 0!==l&&(n.fontColor=l);const c=function(e){const t=nI(e);if(!t)return;const n=t.attrs.b;if("string"!=typeof n)return;switch(n){case"1":case"true":return!0;case"0":case"false":return!1;default:return}}(t);void 0!==c&&(n.bold=c);const u=function(e){const t=nI(e);if(!t)return;const n=t.attrs.i;if("string"!=typeof n)return;switch(n){case"1":case"true":return!0;case"0":case"false":return!1;default:return}}(t);void 0!==u&&(n.italic=u);const f=function(e){const t=nI(e);if(!t)return;const n=t.attrs.u;return"sng"===n||"none"!==n&&void 0}(t);void 0!==f&&(n.underline=f);const d=function(e){const t=nI(e);if(!t)return;return"sngStrike"===t.attrs.strike||void 0}(t);void 0!==d&&(n.strikethrough=d);const h=function(e){const t=nI(e);if(!t)return;const n=Rb(t,"latin");if(!n)return;const r=n.attrs.typeface;if("string"!=typeof r)return;const i=r.trim();return 0===i.length?void 0:i}(t);void 0!==h&&(n.fontFamily=h);const p=zw(t);void 0!==p&&(n.fillColor=p);const g=function(e){return $w(e)}(t);void 0!==g&&(n.borderColor=g);const m=jw(t);void 0!==m&&(n.borderWidth=m);const y=Vw(t);void 0!==y&&(n.borderDash=y);const v=Nw(t);void 0!==v&&(n.borderCap=v);const A=Mw(t);return void 0!==A&&(n.borderCompound=A),n}function CI(e,t){const n=Rb(e,t);if(!n)return;const r=n.attrs.val;if("string"==typeof r)switch(r){case"1":case"true":return!0;case"0":case"false":return!1;default:return}}function BI(e){return gI(e)}function EI(e){return!0===e||!1!==e&&void 0}function kI(e){return!0===e||!1!==e&&void 0}function SI(e){return!0===e||!1!==e&&void 0}function FI(e){if(!0===e)return!0}function DI(e){if("string"!=typeof e)return;const t=e.trim();return 0!==t.length?t:void 0}function NI(e){return gI(e)}function MI(e){return gI(e)}function QI(e){const t=[fw("c:showHorzBorder",{val:e.showHorzBorder?1:0}),fw("c:showVertBorder",{val:e.showVertBorder?1:0}),fw("c:showOutline",{val:e.showOutline?1:0}),fw("c:showKeys",{val:e.showKeys?1:0})],n=function(e,t,n,r,i,o){if(void 0===e&&void 0===t&&void 0===n&&void 0===r&&void 0===i&&void 0===o)return;const a=[];void 0!==e&&a.push(hw("a:solidFill",void 0,[Ow(e)]));if(void 0!==t||void 0!==n||void 0!==r||void 0!==i||void 0!==o){const e={};void 0!==n&&(e.w=Math.round(n*Cw)),void 0!==i&&(e.cap=i),void 0!==o&&(e.cmpd=o);const s=[];void 0!==t&&s.push(hw("a:solidFill",void 0,[Ow(t)])),void 0!==r&&s.push(fw("a:prstDash",{val:r})),a.push(0===s.length?fw("a:ln",e):hw("a:ln",Object.keys(e).length>0?e:void 0,s))}return hw("c:spPr",void 0,a)}(e.fillColor,e.borderColor,e.borderWidth,e.borderDash,e.borderCap,e.borderCompound);void 0!==n&&t.push(n);const r=function(e,t,n,r,i,o,a){if(void 0===e&&void 0===t&&void 0===n&&void 0===r&&void 0===i&&void 0===o&&void 0===a)return;const s={};void 0!==e&&(s.sz=e*II);void 0!==n&&(s.b=n?1:0);void 0!==r&&(s.i=r?1:0);void 0!==i&&(s.u=i?"sng":"none");!0===o&&(s.strike="sngStrike");const l=void 0!==t?hw("a:solidFill",void 0,[Ow(t)]):void 0,c=a?fw("a:latin",{typeface:a}):void 0,u=[];l&&u.push(l);c&&u.push(c);const f=u.length>0?hw("a:defRPr",s,u):fw("a:defRPr",s);return hw("c:txPr",void 0,[fw("a:bodyPr"),fw("a:lstStyle"),hw("a:p",void 0,[hw("a:pPr",void 0,[f]),fw("a:endParaRPr",{lang:"en-US"})])])}(e.fontSize,e.fontColor,e.bold,e.italic,e.underline,e.strikethrough,e.fontFamily);return void 0!==r&&t.push(r),hw("c:dTable",void 0,t)}const TI=aI,LI=new Set(["t","b","l","r","ctr","inEnd","inBase","outEnd","bestFit"]);function RI(e){const t=Rb(e,"delete");if(t&&!0===vw(t))return;const n={},r=Rb(e,"dLblPos");if(r){const e=r.attrs.val;"string"==typeof e&&LI.has(e)&&(n.position=e)}const i=Rb(e,"showLegendKey");i&&!0===vw(i)&&(n.showLegendKey=!0);const o=Rb(e,"showVal");o&&!0===vw(o)&&(n.showValue=!0);const a=Rb(e,"showCatName");a&&!0===vw(a)&&(n.showCategoryName=!0);const s=Rb(e,"showSerName");s&&!0===vw(s)&&(n.showSeriesName=!0);const l=Rb(e,"showPercent");l&&!0===vw(l)&&(n.showPercent=!0);const c=Rb(e,"separator");if(c){const e=mw(c);e.length>0&&(n.separator=e)}const u=function(e){const t=Rb(e,"numFmt");if(!t)return;const n=t.attrs.formatCode;if("string"!=typeof n||0===n.length)return;const r={formatCode:n},i=t.attrs.sourceLinked;"string"==typeof i&&("1"!==i&&"true"!==i.toLowerCase()||(r.sourceLinked=!0));return r}(e);u&&(n.numberFormat=u);const f=Rb(e,"showLeaderLines");if(f){const e=f.attrs.val;"string"!=typeof e||"0"!==e&&"false"!==e.toLowerCase()||(n.showLeaderLines=!1)}const d=function(e){const t=nI(e);if(!t)return;const n=t.attrs.sz;if("string"!=typeof n)return;const r=n.trim();if(0===r.length)return;const i=Number.parseInt(r,10);if(!Number.isFinite(i))return;const o=Math.round(i/TI*2)/2;return o<1||o>400?void 0:o}(e);void 0!==d&&(n.fontSize=d);const h=function(e){const t=nI(e);if(!t)return;const n=Rb(t,"solidFill");if(!n)return;const r=Rb(n,"srgbClr");if(r)return Pw(r.attrs.val);const i=Rb(n,"schemeClr");return i?Hw(i):void 0}(e);void 0!==h&&(n.fontColor=h);const p=function(e){const t=nI(e);if(!t)return;const n=t.attrs.b;return"1"===n||"true"===n||void 0}(e);void 0!==p&&(n.bold=p);const g=function(e){const t=nI(e);if(!t)return;const n=t.attrs.i;return"1"===n||"true"===n||void 0}(e);void 0!==g&&(n.italic=g);const m=function(e){const t=nI(e);if(!t)return;return"sng"===t.attrs.u||void 0}(e);void 0!==m&&(n.underline=m);const y=function(e){const t=nI(e);if(!t)return;return"sngStrike"===t.attrs.strike||void 0}(e);void 0!==y&&(n.strikethrough=y);const v=function(e){const t=nI(e);if(!t)return;const n=Rb(t,"latin");if(!n)return;const r=n.attrs.typeface;if("string"!=typeof r)return;const i=r.trim();return 0===i.length?void 0:i}(e);void 0!==v&&(n.fontFamily=v);const A=zw(e);void 0!==A&&(n.fillColor=A);const b=function(e){return $w(e)}(e);void 0!==b&&(n.borderColor=b);const w=jw(e);void 0!==w&&(n.borderWidth=w);const I=Vw(e);void 0!==I&&(n.borderDash=I);const x=Nw(e);void 0!==x&&(n.borderCap=x);const C=Mw(e);return void 0!==C&&(n.borderCompound=C),void 0!==n.position||n.showValue||n.showCategoryName||n.showSeriesName||n.showPercent||n.showLegendKey||void 0!==n.separator||void 0!==n.numberFormat||void 0!==n.showLeaderLines||void 0!==n.fontSize||void 0!==n.fontColor||void 0!==n.bold||void 0!==n.italic||void 0!==n.underline||void 0!==n.strikethrough||void 0!==n.fontFamily||void 0!==n.fillColor||void 0!==n.borderColor||void 0!==n.borderWidth||void 0!==n.borderDash||void 0!==n.borderCap||void 0!==n.borderCompound?n:void 0}function UI(e){if(e.dataLabels)return HI(e.dataLabels,e.type)}function HI(e,t){const n=[],r=function(e){if(!e)return;const t=e.formatCode;if("string"!=typeof t||0===t.length)return;const n={formatCode:t};!0===e.sourceLinked&&(n.sourceLinked=!0);return n}(e.numberFormat);r&&n.push(fw("c:numFmt",{formatCode:r.formatCode,sourceLinked:!0===r.sourceLinked?1:0}));const i=function(e,t,n,r,i,o){if(void 0===e&&void 0===t&&void 0===n&&void 0===r&&void 0===i&&void 0===o)return;const a=[];void 0!==e&&a.push(hw("a:solidFill",void 0,[Ow(e)]));if(void 0!==t||void 0!==n||void 0!==r||void 0!==i||void 0!==o){const e={};void 0!==n&&(e.w=Math.round(n*Cw)),void 0!==i&&(e.cap=i),void 0!==o&&(e.cmpd=o);const s=[];void 0!==t&&s.push(hw("a:solidFill",void 0,[Ow(t)])),void 0!==r&&s.push(fw("a:prstDash",{val:r})),a.push(0===s.length?fw("a:ln",e):hw("a:ln",Object.keys(e).length>0?e:void 0,s))}return hw("c:spPr",void 0,a)}(gI(e.fillColor),function(e){return gI(e)}(e.borderColor),Yw(e.borderWidth),Gw(e.borderDash),Fw(e.borderCap),Dw(e.borderCompound));void 0!==i&&n.push(i);const o=function(e,t,n,r,i,o,a){if(void 0===e&&void 0===t&&void 0===n&&void 0===r&&void 0===i&&void 0===o&&void 0===a)return;const s={};void 0!==e&&(s.sz=e*TI);void 0!==n&&(s.b=n?1:0);void 0!==r&&(s.i=r?1:0);void 0!==i&&(s.u=i?"sng":"none");!0===o&&(s.strike="sngStrike");const l=void 0!==t?hw("a:solidFill",void 0,[Ow(t)]):void 0,c=a?fw("a:latin",{typeface:a}):void 0,u=[];l&&u.push(l);c&&u.push(c);const f=u.length>0?hw("a:defRPr",s,u):fw("a:defRPr",s);return hw("c:txPr",void 0,[fw("a:bodyPr"),fw("a:lstStyle"),hw("a:p",void 0,[hw("a:pPr",void 0,[f]),fw("a:endParaRPr",{lang:"en-US"})])])}(function(e){return dI(e)}(e.fontSize),function(e){return gI(e)}(e.fontColor),function(e){return!0===e||!1!==e&&void 0}(e.bold),function(e){return!0===e||!1!==e&&void 0}(e.italic),function(e){return!0===e||!1!==e&&void 0}(e.underline),function(e){return!0===e||void 0}(e.strikethrough),function(e){if("string"!=typeof e)return;const t=e.trim();return 0===t.length?void 0:t}(e.fontFamily));return void 0!==o&&n.push(o),e.position&&n.push(fw("c:dLblPos",{val:e.position})),n.push(fw("c:showLegendKey",{val:!0===e.showLegendKey?1:0})),n.push(fw("c:showVal",{val:e.showValue?1:0})),n.push(fw("c:showCatName",{val:e.showCategoryName?1:0})),n.push(fw("c:showSerName",{val:e.showSeriesName?1:0})),n.push(fw("c:showPercent",{val:e.showPercent?1:0})),n.push(fw("c:showBubbleSize",{val:0})),void 0!==e.separator&&n.push(hw("c:separator",void 0,lw(e.separator))),"pie"!==t&&"doughnut"!==t||!1!==e.showLeaderLines||n.push(fw("c:showLeaderLines",{val:0})),hw("c:dLbls",void 0,n)}const qI=new Set(["cone","coneToMax","box","cylinder","pyramid","pyramidToMax"]),OI=new Set(["linear","log","exp","power","poly","movingAvg"]),PI=new Set(["x","y"]),zI=new Set(["both","minus","plus"]),$I=new Set(["cust","fixedVal","percentage","stdDev","stdErr"]);function jI(e){const t=function(e){if("string"==typeof e)return qI.has(e)?e:void 0}(e);if(void 0!==t)return fw("c:shape",{val:t})}function VI(e){const t=Rb(e,"spPr");if(!t)return;const n=Rb(t,"solidFill");if(!n)return;const r=Rb(n,"srgbClr");return r?Pw(r.attrs.val):void 0}function YI(e){const t=Rb(e,"spPr");if(!t)return;const n=Rb(t,"ln");if(!n)return;const r=Rb(n,"solidFill");if(!r)return;const i=Rb(r,"srgbClr");return i?Pw(i.attrs.val):void 0}function GI(e){const t=Rb(e,"spPr");if(!t)return;const n=Rb(t,"ln");if(!n)return;const r=n.attrs.w;if("string"!=typeof r)return;const i=Number.parseFloat(r);if(!Number.isFinite(i)||i<=0)return;const o=Math.round(i/Cw*4)/4;return o<Iw?Iw:o>xw?xw:o}function WI(e){const t=Rb(e,"spPr");if(!t)return;const n=Rb(t,"ln");if(!n)return;const r=Rb(n,"prstDash");if(!r)return;const i=r.attrs.val;if("string"!=typeof i)return;const o=i.trim();return Ew.has(o)&&"solid"!==o?o:void 0}function JI(e){const t="string"==typeof e.type&&OI.has(e.type)?e.type:void 0;if(void 0===t)return;const n=[];"string"==typeof e.name&&e.name.trim().length>0&&n.push(hw("c:name",void 0,e.name.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;")));const r=function(e){const t=Pw(e.lineColor),n=Yw(e.lineWidth),r=Gw(e.lineDash);if(!t&&void 0===n&&void 0===r)return;const i={};void 0!==n&&(i.w=Math.round(n*Cw));const o=[];t&&o.push(hw("a:solidFill",void 0,[fw("a:srgbClr",{val:t})]));void 0!==r&&o.push(fw("a:prstDash",{val:r}));const a=0===o.length?fw("a:ln",i):hw("a:ln",Object.keys(i).length>0?i:void 0,o);return hw("c:spPr",void 0,[a])}(e);if(r&&n.push(r),n.push(fw("c:trendlineType",{val:t})),"poly"===t&&"number"==typeof e.order&&Number.isFinite(e.order)){const t=Math.max(2,Math.min(6,Math.round(e.order)));n.push(fw("c:order",{val:t}))}if("movingAvg"===t&&"number"==typeof e.period&&Number.isFinite(e.period)){const t=Math.max(2,Math.min(100,Math.round(e.period)));n.push(fw("c:period",{val:t}))}return"number"==typeof e.forward&&Number.isFinite(e.forward)&&n.push(fw("c:forward",{val:e.forward})),"number"==typeof e.backward&&Number.isFinite(e.backward)&&n.push(fw("c:backward",{val:e.backward})),"number"==typeof e.intercept&&Number.isFinite(e.intercept)&&n.push(fw("c:intercept",{val:e.intercept})),!0===e.dispRSquared&&n.push(fw("c:dispRSqr",{val:1})),!0===e.dispEquation&&n.push(fw("c:dispEq",{val:1})),hw("c:trendline",void 0,n)}function _I(e){if(!PI.has(e.direction))return;if(!zI.has(e.type))return;if(!$I.has(e.valType))return;const t=[fw("c:errDir",{val:e.direction}),fw("c:errBarType",{val:e.type}),fw("c:errValType",{val:e.valType})];!0===e.noEndCap&&t.push(fw("c:noEndCap",{val:1})),"stdErr"!==e.valType&&"cust"!==e.valType&&"number"==typeof e.value&&Number.isFinite(e.value)&&t.push(fw("c:val",{val:e.value}));const n=Pw(e.lineColor),r=Yw(e.lineWidth),i=Gw(e.lineDash);if(n||void 0!==r||void 0!==i){const e={};void 0!==r&&(e.w=Math.round(r*Cw));const o=[];n&&o.push(hw("a:solidFill",void 0,[fw("a:srgbClr",{val:n})])),void 0!==i&&o.push(fw("a:prstDash",{val:i}));const a=0===o.length?fw("a:ln",e):hw("a:ln",Object.keys(e).length>0?e:void 0,o);t.push(hw("c:spPr",void 0,[a]))}return hw("c:errBars",void 0,t)}const XI=new Set(["none","auto","circle","square","diamond","triangle","x","star","dot","dash","plus"]),KI=2,ZI=72;function ex(e,t){return e.includes("!")?e:`${n=t,/^[A-Za-z_][A-Za-z0-9_]*$/.test(n)?n:`'${n.replace(/'/g,"''")}'`}!${e}`;var n}function tx(e,t,n){const r={kind:t,index:n},i=function(e){const t=Rb(e,"tx");if(!t)return;const n=Rb(t,"v");if(n){const e=mw(n).trim();if(e.length>0)return e}const r=Rb(t,"strRef");if(r){const e=Rb(r,"strCache");if(e)for(const t of Ub(e)){if("pt"!==t.local)continue;const e=Rb(t,"v");if(e){const t=mw(e).trim();if(t.length>0)return t}}const t=bw(r);if(t)return t}return}(e);void 0!==i&&(r.name=i);const o=bw(Rb(e,"val"))??bw(Rb(e,"yVal"));void 0!==o&&(r.valuesRef=o);const a=bw(Rb(e,"cat"))??bw(Rb(e,"xVal"));void 0!==a&&(r.categoriesRef=a);const s=function(e){const t=Rb(e,"spPr");if(!t)return;const n=Rb(t,"solidFill");if(!n)return;const r=Rb(n,"srgbClr");if(r){const e=r.attrs.val;if("string"!=typeof e)return;const t=e.replace(/^#/,"").toUpperCase();return/^[0-9A-F]{6}$/.test(t)?t:void 0}const i=Rb(n,"schemeClr");return i?Hw(i):void 0}(e);void 0!==s&&(r.color=s);const l=Rb(e,"dLbls");if(l){const e=RI(l);e&&(r.dataLabels=e)}if("line"===t||"line3D"===t||"scatter"===t){const t=function(e){const t=Rb(e,"smooth");if(!t)return;return!0===vw(t)||void 0}(e);void 0!==t&&(r.smooth=t);const n=function(e){const t=Rb(e,"spPr");if(!t)return;const n=Rb(t,"ln");if(!n)return;const r={},i=n.attrs.w;if("string"==typeof i){const e=Number.parseFloat(i);if(Number.isFinite(e)&&e>0){const t=Math.round(e/Cw*4)/4;r.width=t<Iw?Iw:t>xw?xw:t}}const o=Rb(n,"prstDash");if(o){const e=o.attrs.val;"string"==typeof e&&Bw.has(e)&&(r.dash=e)}const a=n.attrs.cap;if("string"==typeof a){const e=a.trim();kw.has(e)&&"flat"!==e&&(r.cap=e)}const s=n.attrs.cmpd;if("string"==typeof s){const e=s.trim();Sw.has(e)&&"sng"!==e&&(r.compound=e)}return void 0===r.dash&&void 0===r.width&&void 0===r.cap&&void 0===r.compound?void 0:r}(e);void 0!==n&&(r.stroke=n);const i=nx(e);void 0!==i&&(r.marker=i)}if("bar"===t||"bar3D"===t){const t=function(e){const t=Rb(e,"invertIfNegative");if(!t)return;return!0===vw(t)||void 0}(e);void 0!==t&&(r.invertIfNegative=t)}if("pie"===t||"pie3D"===t||"doughnut"===t||"ofPie"===t){const t=function(e){const t=Rb(e,"explosion");if(!t)return;const n=t.attrs.val;if("string"!=typeof n)return;const r=Number.parseFloat(n);if(!Number.isFinite(r)||r<0)return;const i=Math.round(r);return 0===i?void 0:i}(e);void 0!==t&&(r.explosion=t)}const c=function(e){const t=[];for(const n of Ub(e)){if("dPt"!==n.local)continue;const e=Rb(n,"idx");if(!e)continue;const r=e.attrs.val;if("string"!=typeof r)continue;const i=Number.parseInt(r,10);if(!Number.isFinite(i)||i<0)continue;const o={idx:i},a=Rb(n,"explosion");if(a){const e=a.attrs.val;if("string"==typeof e){const t=Number.parseFloat(e);if(Number.isFinite(t)&&t>0){const e=Math.round(t);e>0&&(o.explosion=e)}}}const s=Rb(n,"bubble3D");s&&!0===vw(s)&&(o.bubble3D=!0);const l=VI(n);void 0!==l&&(o.fillColor=l);const c=YI(n);void 0!==c&&(o.borderColor=c);const u=GI(n);void 0!==u&&(o.borderWidth=u);const f=WI(n);void 0!==f&&(o.borderDash=f);const d=nx(n);void 0!==d&&(o.marker=d),t.push(o)}return t.length>0?t:void 0}(e);if(void 0!==c&&(r.dataPoints=c),"bar"===t||"bar3D"===t||"line"===t||"line3D"===t||"area"===t||"area3D"===t||"scatter"===t||"bubble"===t){const t=function(e){const t=[];for(const n of Ub(e)){if("trendline"!==n.local)continue;const e=Rb(n,"trendlineType");if(!e)continue;const r=e.attrs.val;if("string"!=typeof r)continue;const i=r.trim();if(!OI.has(i))continue;const o={type:i},a=Rb(n,"name");if(a){let e="";for(const t of a.children)"string"==typeof t&&(e+=t);const t=e.trim();t.length>0&&(o.name=t)}const s=Rb(n,"order");if(s){const e=parseFloat(String(s.attrs.val??""));if(Number.isFinite(e)){const t=Math.round(e);t>=2&&t<=6&&(o.order=t)}}const l=Rb(n,"period");if(l){const e=parseFloat(String(l.attrs.val??""));if(Number.isFinite(e)){const t=Math.round(e);t>=2&&t<=100&&(o.period=t)}}const c=Rb(n,"forward");if(c){const e=parseFloat(String(c.attrs.val??""));Number.isFinite(e)&&(o.forward=e)}const u=Rb(n,"backward");if(u){const e=parseFloat(String(u.attrs.val??""));Number.isFinite(e)&&(o.backward=e)}const f=Rb(n,"intercept");if(f){const e=parseFloat(String(f.attrs.val??""));Number.isFinite(e)&&(o.intercept=e)}const d=Rb(n,"dispEq");d&&!0===vw(d)&&(o.dispEquation=!0);const h=Rb(n,"dispRSqr");h&&!0===vw(h)&&(o.dispRSquared=!0);const p=Rb(n,"spPr");if(p){const e=Rb(p,"ln");if(e){const t=Rb(e,"solidFill");if(t){const e=Rb(t,"srgbClr");if(e){const t=Pw(e.attrs.val);t&&(o.lineColor=t)}}const n=e.attrs.w;if("string"==typeof n){const e=Number.parseFloat(n);if(Number.isFinite(e)&&e>0){const t=Math.round(e/Cw*4)/4;o.lineWidth=t>=Iw&&t<=xw?t:t<Iw?Iw:xw}}const r=Rb(e,"prstDash");if(r){const e=r.attrs.val;if("string"==typeof e){const t=e.trim();Ew.has(t)&&"solid"!==t&&(o.lineDash=t)}}}}t.push(o)}return t.length>0?t:void 0}(e);void 0!==t&&(r.trendlines=t);const n=function(e){const t=[];for(const n of Ub(e)){if("errBars"!==n.local)continue;const e=Rb(n,"errDir");if(!e)continue;const r=e.attrs.val;if("string"!=typeof r)continue;const i=r.trim();if(!PI.has(i))continue;const o=Rb(n,"errBarType");if(!o)continue;const a=o.attrs.val;if("string"!=typeof a)continue;const s=a.trim();if(!zI.has(s))continue;const l=Rb(n,"errValType");if(!l)continue;const c=l.attrs.val;if("string"!=typeof c)continue;const u=c.trim();if(!$I.has(u))continue;const f={direction:i,type:s,valType:u},d=Rb(n,"val");if(d){const e=parseFloat(String(d.attrs.val??""));Number.isFinite(e)&&(f.value=e)}const h=Rb(n,"noEndCap");h&&!0===vw(h)&&(f.noEndCap=!0);const p=Rb(n,"spPr");if(p){const e=Rb(p,"ln");if(e){const t=Rb(e,"solidFill");if(t){const e=Rb(t,"srgbClr");if(e){const t=Pw(e.attrs.val);t&&(f.lineColor=t)}}const n=e.attrs.w;if("string"==typeof n){const e=Number.parseFloat(n);if(Number.isFinite(e)&&e>0){const t=Math.round(e/Cw*4)/4;f.lineWidth=t<Iw?Iw:t>xw?xw:t}}const r=Rb(e,"prstDash");if(r){const e=r.attrs.val;if("string"==typeof e){const t=e.trim();Ew.has(t)&&"solid"!==t&&(f.lineDash=t)}}}}t.push(f)}return t.length>0?t:void 0}(e);void 0!==n&&(r.errorBars=n)}if("bubble"===t){const t=function(e){return bw(Rb(e,"bubbleSize"))}(e);void 0!==t&&(r.bubbleSizeRef=t)}if("bar3D"===t){const t=function(e){const t=Rb(e,"shape");if(!t)return;const n=t.attrs.val;if("string"!=typeof n)return;const r=n.trim();return qI.has(r)?r:void 0}(e);void 0!==t&&(r.shape3D=t)}return r}function nx(e){const t=Rb(e,"marker");if(!t)return;const n={},r=Rb(t,"symbol");if(r){const e=r.attrs.val;"string"==typeof e&&XI.has(e)&&(n.symbol=e)}const i=Rb(t,"size");if(i){const e=i.attrs.val;if("string"==typeof e){const t=Number.parseInt(e,10);Number.isFinite(t)&&(n.size=t<2?2:t>72?72:t)}}const o=Rb(t,"spPr");if(o){const e=Rb(o,"solidFill");if(e){const t=Rb(e,"srgbClr"),r=t?.attrs.val;if("string"==typeof r){const e=r.replace(/^#/,"").toUpperCase();/^[0-9A-F]{6}$/.test(e)&&(n.fill=e)}}const t=Rb(o,"ln");if(t){const e=Rb(t,"solidFill");if(e){const t=Rb(e,"srgbClr"),r=t?.attrs.val;if("string"==typeof r){const e=r.replace(/^#/,"").toUpperCase();/^[0-9A-F]{6}$/.test(e)&&(n.line=e)}}}}return void 0!==n.symbol||void 0!==n.size||void 0!==n.fill||void 0!==n.line?n:void 0}function rx(e,t,n,r,i){const o=[fw("c:idx",{val:t}),fw("c:order",{val:t})];e.name&&o.push(hw("c:tx",void 0,[hw("c:v",void 0,lw(e.name))]));const a=function(e,t){let n;if("string"==typeof e){const t=e.replace(/^#/,"").toUpperCase();n=/^[0-9A-F]{6}$/.test(t)?t:void 0}else void 0!==e&&(n=qw(e));const r=(c=t?.dash,void 0===c?void 0:Bw.has(c)?c:void 0),i=Yw(t?.width),o=Fw(t?.cap),a="flat"===o?void 0:o,s=Dw(t?.compound),l="sng"===s?void 0:s;var c;if(!n&&void 0===r&&void 0===i&&void 0===a&&void 0===l)return;const u=[];void 0!==n&&u.push(hw("a:solidFill",void 0,[Ow(n)]));if(void 0!==n||void 0!==r||void 0!==i||void 0!==a||void 0!==l){const e={};void 0!==i&&(e.w=Math.round(i*Cw)),void 0!==a&&(e.cap=a),void 0!==l&&(e.cmpd=l);const t=[];void 0!==n&&t.push(hw("a:solidFill",void 0,[Ow(n)])),void 0!==r&&t.push(fw("a:prstDash",{val:r})),u.push(0===t.length?fw("a:ln",e):hw("a:ln",Object.keys(e).length>0?e:void 0,t))}return hw("c:spPr",void 0,u)}(e.color,i?.stroke);a&&o.push(a);const s=ix(i?.marker);s&&o.push(s),!0===i?.invertIfNegative&&o.push(fw("c:invertIfNegative",{val:1}));const l=function(e){if(void 0===e||!Number.isFinite(e))return;const t=Math.round(e);return t<=0?void 0:t>400?400:t}(i?.explosion);void 0!==l&&o.push(fw("c:explosion",{val:l}));const c=function(e,t){if(!e||0===e.length)return[];const n="pie"===t||"doughnut"===t||"pie3D"===t,r=[];for(const t of e){if(!Number.isFinite(t.idx)||t.idx<0)continue;const e=Math.floor(t.idx),i=[];i.push(fw("c:idx",{val:e}));const o=ix(t.marker);if(o&&i.push(o),i.push(fw("c:bubble3D",{val:!0===t.bubble3D?1:0})),n&&void 0!==t.explosion&&Number.isFinite(t.explosion)){const e=Math.max(0,Math.min(400,Math.round(t.explosion)));e>0&&i.push(fw("c:explosion",{val:e}))}const a=Pw(t.fillColor),s=Pw(t.borderColor),l=Yw(t.borderWidth),c=Gw(t.borderDash);if(a||s||void 0!==l||void 0!==c){const e=[];if(a&&e.push(hw("a:solidFill",void 0,[fw("a:srgbClr",{val:a})])),s||void 0!==l||void 0!==c){const t={};void 0!==l&&(t.w=Math.round(l*Cw));const n=[];s&&n.push(hw("a:solidFill",void 0,[fw("a:srgbClr",{val:s})])),void 0!==c&&n.push(fw("a:prstDash",{val:c})),e.push(0===n.length?fw("a:ln",t):hw("a:ln",Object.keys(t).length>0?t:void 0,n))}i.push(hw("c:spPr",void 0,e))}r.push(hw("c:dPt",void 0,i))}return r}(i.dataPoints,i.chartType);for(const e of c)o.push(e);const u=(f=e.dataLabels,i.dataLabels,d=i.chartType,!1===f?hw("c:dLbls",void 0,[hw("c:dLbl",void 0,[fw("c:idx",{val:0}),fw("c:delete",{val:1})]),fw("c:delete",{val:1})]):f?HI(f,d):void 0);var f,d;if(u&&o.push(u),i.trendlines&&i.trendlines.length>0){if(!("pie"===i.chartType||"doughnut"===i.chartType)){const e=function(e){if(!e||0===e.length)return[];const t=[];for(const n of e){const e=JI(n);e&&t.push(e)}return t}(i.trendlines);for(const t of e)o.push(t)}}if(i.errorBars&&i.errorBars.length>0){if(!("pie"===i.chartType||"doughnut"===i.chartType)){const e=function(e){if(!e||0===e.length)return[];const t=[];for(const n of e){const e=_I(n);e&&t.push(e)}return t}(i.errorBars);for(const t of e)o.push(t)}}if(e.categories){const t=ex(e.categories,n);r?o.push(hw("c:xVal",void 0,[hw("c:numRef",void 0,[hw("c:f",void 0,lw(t))])])):o.push(hw("c:cat",void 0,[hw("c:strRef",void 0,[hw("c:f",void 0,lw(t))])]))}const h=ex(e.values,n);if(r?o.push(hw("c:yVal",void 0,[hw("c:numRef",void 0,[hw("c:f",void 0,lw(h))])])):o.push(hw("c:val",void 0,[hw("c:numRef",void 0,[hw("c:f",void 0,lw(h))])])),void 0!==i?.smooth&&o.push(fw("c:smooth",{val:i.smooth?1:0})),void 0!==i.shape3D){const e=jI(i.shape3D);e&&o.push(e)}if("string"==typeof i.bubbleSize&&i.bubbleSize.length>0){const e=ex(i.bubbleSize,n);o.push(hw("c:bubbleSize",void 0,[hw("c:numRef",void 0,[hw("c:f",void 0,lw(e))])]))}return hw("c:ser",void 0,o)}function ix(e){if(!e)return;const t=function(e){if(void 0!==e)return XI.has(e)?e:void 0}(e.symbol),n=function(e){if(void 0===e||!Number.isFinite(e))return;const t=Math.round(e);return t<KI?KI:t>ZI?ZI:t}(e.size),r=Pw(e.fill),i=Pw(e.line);if(void 0===t&&void 0===n&&!r&&!i)return;const o=[];if(void 0!==t&&o.push(fw("c:symbol",{val:t})),void 0!==n&&o.push(fw("c:size",{val:n})),r||i){const e=[];r&&e.push(hw("a:solidFill",void 0,[fw("a:srgbClr",{val:r})])),i&&e.push(hw("a:ln",void 0,[hw("a:solidFill",void 0,[fw("a:srgbClr",{val:i})])])),o.push(hw("c:spPr",void 0,e))}return hw("c:marker",void 0,o)}const ox=aI,ax=sI,sx=new Set(["none","in","out","cross"]),lx=new Set(["nextTo","low","high","none"]),cx=new Set(["ctr","l","r"]),ux=-90,fx=90,dx=new Set(["autoZero","min","max"]),hx=new Set(["hundreds","thousands","tenThousands","hundredThousands","millions","tenMillions","hundredMillions","billions","trillions"]),px=new Set(["between","midCat"]);function gx(e,t){const n=function(e){const t=Rb(e,"title");if(!t)return;const n=Rb(t,"tx");if(!n)return;const r=Rb(n,"rich");if(r){const e=[];gw(r,e);const t=e.join("").trim();return t.length>0?t:void 0}const i=Rb(n,"strRef");if(i){const e=Rb(i,"strCache");if(e)for(const t of Ub(e)){if("pt"!==t.local)continue;const e=Rb(t,"v");if(e){const t=mw(e).trim();if(t.length>0)return t}}}return}(e),r=function(e){const t=Rb(e,"title");if(!t)return;const n=Rb(t,"tx");if(!n)return;const r=Rb(n,"rich");if(!r)return;const i=Rb(r,"bodyPr");if(!i)return;const o=i.attrs.rot;if("string"!=typeof o)return;const a=o.trim();if(0===a.length)return;const s=Number.parseInt(a,10);if(!Number.isFinite(s))return;const l=Math.round(s/oI);return 0===l?void 0:l<ux?ux:l>fx?fx:l}(e),i=function(e){const t=rI(e);if(!t)return;const n=t.attrs.sz;if("string"!=typeof n)return;const r=n.trim();if(0===r.length)return;const i=Number.parseInt(r,10);if(!Number.isFinite(i))return;const o=Math.round(i/ox*2)/2;return o<1||o>ax?void 0:o}(e),o=function(e){const t=rI(e);if(!t)return;return!0===yw(t.attrs.b)||void 0}(e),a=function(e){const t=rI(e);if(!t)return;return!0===yw(t.attrs.i)||void 0}(e),s=function(e){const t=rI(e);if(!t)return;const n=Rb(t,"solidFill");if(!n)return;const r=Rb(n,"srgbClr");if(r)return Pw(r.attrs.val);const i=Rb(n,"schemeClr");return i?Hw(i):void 0}(e),l=function(e){const t=rI(e);if(!t)return;return"sngStrike"===t.attrs.strike||void 0}(e),c=function(e){const t=rI(e);if(!t)return;return"sng"===t.attrs.u||void 0}(e),u=function(e){const t=rI(e);if(!t)return;const n=Rb(t,"latin");if(!n)return;const r=n.attrs.typeface;if("string"!=typeof r)return;const i=r.trim();return 0===i.length?void 0:i}(e),f=function(e){const t=Rb(e,"title");if(!t)return;const n=Rb(t,"overlay");if(!n)return;const r=n.attrs.val;if("string"!=typeof r)return;switch(r){case"1":case"true":return!0;default:return}}(e),d=function(e){const t=Rb(e,"title");return t?Kw(t):void 0}(e),h=function(e){const t=Rb(e,"title");return t?zw(t):void 0}(e),p=function(e){const t=Rb(e,"title");return t?$w(t):void 0}(e),g=function(e){const t=Rb(e,"title");return t?jw(t):void 0}(e),m=function(e){const t=Rb(e,"title");return t?Vw(t):void 0}(e),y=function(e){const t=Rb(e,"title");return t?Nw(t):void 0}(e),v=function(e){const t=Rb(e,"title");return t?Mw(t):void 0}(e),A=function(e){const t=void 0!==Rb(e,"majorGridlines"),n=void 0!==Rb(e,"minorGridlines");if(!t&&!n)return;const r={};t&&(r.major=!0);n&&(r.minor=!0);return r}(e),b=function(e){const t={},n=Rb(e,"scaling");if(n){const e=ww(n,"min");void 0!==e&&(t.min=e);const r=ww(n,"max");void 0!==r&&(t.max=r);const i=ww(n,"logBase");void 0!==i&&(t.logBase=i)}const r=ww(e,"majorUnit");void 0!==r&&r>0&&(t.majorUnit=r);const i=ww(e,"minorUnit");void 0!==i&&i>0&&(t.minorUnit=i);return Object.keys(t).length>0?t:void 0}(e),w=function(e){const t=Rb(e,"numFmt");if(!t)return;const n=t.attrs.formatCode;if("string"!=typeof n||0===n.length)return;const r={formatCode:n},i=t.attrs.sourceLinked;void 0!==i&&!0===yw(i)&&(r.sourceLinked=!0);return r}(e),I=mx(e,"majorTickMark","out"),x=mx(e,"minorTickMark","none"),C=function(e){const t=Rb(e,"tickLblPos");if(!t)return;const n=t.attrs.val;if("string"!=typeof n)return;const r=n.trim();return lx.has(r)?"nextTo"===r?void 0:r:void 0}(e),B=function(e){const t=Rb(e,"txPr");if(!t)return;const n=Rb(t,"bodyPr");if(!n)return;const r=n.attrs.rot;if("string"!=typeof r)return;const i=r.trim();if(0===i.length)return;const o=Number.parseInt(i,10);if(!Number.isFinite(o))return;const a=Math.round(o/oI);return 0===a?void 0:a<ux?ux:a>fx?fx:a}(e),E=function(e){const t=nI(e);if(!t)return;const n=t.attrs.sz;if("string"!=typeof n)return;const r=n.trim();if(0===r.length)return;const i=Number.parseInt(r,10);if(!Number.isFinite(i))return;const o=Math.round(i/ox*2)/2;return o<1||o>ax?void 0:o}(e),k=function(e){const t=nI(e);if(!t)return;return!0===yw(t.attrs.b)||void 0}(e),S=function(e){const t=nI(e);if(!t)return;return!0===yw(t.attrs.i)||void 0}(e),F=function(e){const t=nI(e);if(!t)return;const n=Rb(t,"solidFill");if(!n)return;const r=Rb(n,"srgbClr");if(r)return Pw(r.attrs.val);const i=Rb(n,"schemeClr");return i?Hw(i):void 0}(e),D=function(e){const t=nI(e);if(!t)return;return"sng"===t.attrs.u||void 0}(e),N=function(e){const t=nI(e);if(!t)return;return"sngStrike"===t.attrs.strike||void 0}(e),M=function(e){const t=nI(e);if(!t)return;const n=Rb(t,"latin");if(!n)return;const r=n.attrs.typeface;if("string"!=typeof r)return;const i=r.trim();return 0===i.length?void 0:i}(e),Q=function(e){const t=Rb(e,"scaling");if(!t)return;const n=Rb(t,"orientation");if(!n)return;const r=n.attrs.val;if("string"!=typeof r)return;return"maxMin"===r.trim()||void 0}(e),T="catAx"===e.local||"dateAx"===e.local,L=T?yx(e,"tickLblSkip"):void 0,R=T?yx(e,"tickMarkSkip"):void 0,U=T?function(e){const t=Rb(e,"lblOffset");if(!t)return;const n=t.attrs.val;if("string"!=typeof n)return;const r=n.trim();if(0===r.length)return;const i=Number.parseInt(r,10);return Number.isFinite(i)?i<0||i>1e3||100===i?void 0:i:void 0}(e):void 0,H=T?function(e){const t=Rb(e,"lblAlgn");if(!t)return;const n=t.attrs.val;if("string"!=typeof n)return;const r=n.trim();return cx.has(r)?"ctr"===r?void 0:r:void 0}(e):void 0,q="catAx"===e.local?function(e){const t=Rb(e,"noMultiLvlLbl");if(!t)return;const n=t.attrs.val;if("string"!=typeof n)return;switch(n.trim()){case"1":case"true":return!0;default:return}}(e):void 0,O="catAx"===e.local?function(e){const t=Rb(e,"auto");if(!t)return;const n=t.attrs.val;if("string"!=typeof n)return;switch(n.trim()){case"0":case"false":return!1;default:return}}(e):void 0,P=function(e){const t=Rb(e,"delete");if(!t)return;const n=t.attrs.val;if("string"!=typeof n)return;switch(n.trim()){case"1":case"true":return!0;default:return}}(e),z=function(e){const t=Rb(e,"crossesAt");if(t){const e=t.attrs.val;if("string"==typeof e){const t=e.trim();if(t.length>0){const e=Number.parseFloat(t);if(Number.isFinite(e))return{crossesAt:e}}}}const n=Rb(e,"crosses");if(!n)return{};const r=n.attrs.val;if("string"!=typeof r)return{};const i=r.trim();return dx.has(i)?"autoZero"===i?{}:{crosses:i}:{}}(e),$=z.crosses,j=z.crossesAt,V="valAx"===e.local?function(e){const t=Rb(e,"dispUnits");if(!t)return;const n={},r=Rb(t,"custUnit");if(r){const e=r.attrs.val;if("string"==typeof e){const t=Number.parseFloat(e.trim());Number.isFinite(t)&&t>0&&(n.custUnit=t)}}if(void 0===n.custUnit){const e=Rb(t,"builtInUnit");if(e){const t=e.attrs.val;if("string"==typeof t){const e=t.trim();hx.has(e)&&(n.unit=e)}}}if(void 0===n.unit&&void 0===n.custUnit)return;const i=Rb(t,"dispUnitsLbl");if(i){n.showLabel=!0;const e=Rb(i,"tx");if(e){const t=Rb(e,"rich");if(t){const e=[];for(const n of t.children){if("string"==typeof n)continue;if("p"!==n.local)continue;const t=[];for(const e of n.children)if("string"!=typeof e&&"r"===e.local)for(const n of e.children){if("string"==typeof n)continue;if("t"!==n.local)continue;let e="";for(const t of n.children)"string"==typeof t&&(e+=t);t.push(e)}t.length>0&&e.push(t.join(""))}const r=e.join("\n").trim();r.length>0&&(n.customLabel=r)}}}return n}(e):void 0,Y="valAx"===e.local?function(e){const t=Rb(e,"crossBetween");if(!t)return;const n=t.attrs.val;if("string"!=typeof n)return;const r=n.trim();return px.has(r)?r:void 0}(e):void 0,G=Y===t?void 0:Y;if(void 0===n&&void 0===r&&void 0===i&&void 0===o&&void 0===a&&void 0===s&&void 0===l&&void 0===c&&void 0===u&&void 0===f&&void 0===d&&void 0===h&&void 0===p&&void 0===g&&void 0===m&&void 0===y&&void 0===v&&void 0===A&&void 0===b&&void 0===w&&void 0===I&&void 0===x&&void 0===C&&void 0===B&&void 0===E&&void 0===k&&void 0===S&&void 0===F&&void 0===M&&void 0===D&&void 0===N&&void 0===Q&&void 0===L&&void 0===R&&void 0===U&&void 0===H&&void 0===q&&void 0===O&&void 0===P&&void 0===$&&void 0===j&&void 0===V&&void 0===G)return;const W={};return void 0!==n&&(W.title=n),void 0!==r&&(W.axisTitleRotation=r),void 0!==i&&(W.axisTitleFontSize=i),void 0!==o&&(W.axisTitleBold=o),void 0!==a&&(W.axisTitleItalic=a),void 0!==s&&(W.axisTitleColor=s),void 0!==l&&(W.axisTitleStrike=l),void 0!==c&&(W.axisTitleUnderline=c),void 0!==u&&(W.axisTitleFontFamily=u),void 0!==f&&(W.axisTitleOverlay=f),void 0!==d&&(W.axisTitleLayout=d),void 0!==h&&(W.axisTitleFillColor=h),void 0!==p&&(W.axisTitleBorderColor=p),void 0!==g&&(W.axisTitleBorderWidth=g),void 0!==m&&(W.axisTitleBorderDash=m),void 0!==y&&(W.axisTitleBorderCap=y),void 0!==v&&(W.axisTitleBorderCompound=v),void 0!==A&&(W.gridlines=A),void 0!==b&&(W.scale=b),void 0!==w&&(W.numberFormat=w),void 0!==I&&(W.majorTickMark=I),void 0!==x&&(W.minorTickMark=x),void 0!==C&&(W.tickLblPos=C),void 0!==B&&(W.labelRotation=B),void 0!==E&&(W.labelFontSize=E),void 0!==k&&(W.labelBold=k),void 0!==S&&(W.labelItalic=S),void 0!==F&&(W.labelColor=F),void 0!==M&&(W.labelFontFamily=M),void 0!==D&&(W.labelUnderline=D),void 0!==N&&(W.labelStrike=N),void 0!==Q&&(W.reverse=Q),void 0!==L&&(W.tickLblSkip=L),void 0!==R&&(W.tickMarkSkip=R),void 0!==U&&(W.lblOffset=U),void 0!==H&&(W.lblAlgn=H),void 0!==q&&(W.noMultiLvlLbl=q),void 0!==O&&(W.auto=O),void 0!==P&&(W.hidden=P),void 0!==$&&(W.crosses=$),void 0!==j&&(W.crossesAt=j),void 0!==V&&(W.dispUnits=V),void 0!==G&&(W.crossBetween=G),W}function mx(e,t,n){const r=Rb(e,t);if(!r)return;const i=r.attrs.val;if("string"!=typeof i)return;const o=i.trim();return sx.has(o)?o===n?void 0:o:void 0}function yx(e,t){const n=Rb(e,t);if(!n)return;const r=n.attrs.val;if("string"!=typeof r)return;const i=r.trim();if(0===i.length)return;const o=Number.parseInt(i,10);return Number.isFinite(o)&&!(o<1||o>32767)&&1!==o?o:void 0}const vx=new Set(["autoZero","min","max"]),Ax=111111111,bx=222222222,wx=333333333,Ix=444444444,xx=new Set(["none","in","out","cross"]),Cx=new Set(["nextTo","low","high","none"]);function Bx(e){if(!0===e.autoTitleDeleted)return!0;if(!1===e.autoTitleDeleted)return!1;return!((e.showTitle??Boolean(e.title))&&e.title)}function Ex(e){if("string"!=typeof e)return;const t=e.trim();return t.length>0?t:void 0}function kx(e){if(!e)return;const t=!0===e.major,n=!0===e.minor;return t||n?{major:t,minor:n}:void 0}function Sx(e){if(!e)return[];const t=[];return e.major&&t.push(hw("c:majorGridlines",void 0,[])),e.minor&&t.push(hw("c:minorGridlines",void 0,[])),t}function Fx(e){if(!e)return;const t={};return"number"==typeof e.min&&Number.isFinite(e.min)&&(t.min=e.min),"number"==typeof e.max&&Number.isFinite(e.max)&&(t.max=e.max),void 0!==t.min&&void 0!==t.max&&t.min>=t.max&&delete t.max,"number"==typeof e.majorUnit&&Number.isFinite(e.majorUnit)&&e.majorUnit>0&&(t.majorUnit=e.majorUnit),"number"==typeof e.minorUnit&&Number.isFinite(e.minorUnit)&&e.minorUnit>0&&(t.minorUnit=e.minorUnit),"number"==typeof e.logBase&&Number.isFinite(e.logBase)&&e.logBase>=2&&e.logBase<=1e3&&(t.logBase=e.logBase),Object.keys(t).length>0?t:void 0}function Dx(e){if(!e)return;const t="string"==typeof e.formatCode?e.formatCode:"";if(0===t.length)return;const n={formatCode:t};return!0===e.sourceLinked&&(n.sourceLinked=!0),n}function Nx(e){if(void 0===e||!Number.isFinite(e))return;const t=Math.round(e);return t<1||t>32767||1===t?void 0:t}function Mx(e){if(void 0===e||!Number.isFinite(e))return;const t=Math.round(e);return t<0||t>1e3||100===t?void 0:t}function Qx(e){if(void 0!==e&&("ctr"===e||"l"===e||"r"===e)&&"ctr"!==e)return e}function Tx(e){return!0===e}function Lx(e){if(void 0===e||"number"!=typeof e||!Number.isFinite(e))return;let t=Math.round(e);return t<ux?t=ux:t>fx&&(t=fx),0!==t?t:void 0}function Rx(e){if(void 0===e||"number"!=typeof e||!Number.isFinite(e))return;const t=Math.round(2*e)/2;return t<1||t>ax?void 0:t}function Ux(e){return hI(e)}function Hx(e){return pI(e)}function qx(e){return gI(e)}function Ox(e){return yI(e)}function Px(e){return mI(e)}function zx(e){if("string"!=typeof e)return;const t=e.trim();return 0!==t.length?t:void 0}function $x(e,t,n,r,i,o,a,s){if(void 0===e&&void 0===t&&void 0===n&&void 0===r&&void 0===i&&void 0===o&&void 0===a&&void 0===s)return;const l=void 0===e?void 0:e*oI,c=void 0===t?void 0:t*ox,u=void 0===n?void 0:n?1:0,f=void 0===r?void 0:r?1:0,d=!0===o?"sng":void 0,h=!0===a?"sngStrike":void 0,p=void 0!==i?hw("a:solidFill",void 0,[Ow(i)]):void 0,g=s?fw("a:latin",{typeface:s}):void 0,m=[];p&&m.push(p),g&&m.push(g);const y=m.length>0?hw("a:defRPr",{sz:c,b:u,i:f,u:d,strike:h},m):fw("a:defRPr",{sz:c,b:u,i:f,u:d,strike:h});return hw("c:txPr",void 0,[fw("a:bodyPr",{rot:l}),fw("a:lstStyle"),hw("a:p",void 0,[hw("a:pPr",void 0,[y]),fw("a:endParaRPr",{lang:"en-US"})])])}function jx(e,t){return"number"==typeof t&&Number.isFinite(t)?{kind:"numeric",value:t}:void 0!==e&&vx.has(e)&&"autoZero"!==e?{kind:"semantic",value:e}:{kind:"default"}}function Vx(e){switch(e.kind){case"numeric":return fw("c:crossesAt",{val:e.value});case"semantic":return fw("c:crosses",{val:e.value});case"default":return fw("c:crosses",{val:"autoZero"})}}function Yx(e,t=!1){const{before:n,after:r}=function(e){if(!e)return{before:[],after:[]};const t=[],n=[];return void 0!==e.logBase&&t.push(fw("c:logBase",{val:e.logBase})),void 0!==e.max&&n.push(fw("c:max",{val:e.max})),void 0!==e.min&&n.push(fw("c:min",{val:e.min})),{before:t,after:n}}(e);return hw("c:scaling",void 0,[...n,fw("c:orientation",{val:t?"maxMin":"minMax"}),...r])}function Gx(e){if(!e)return[];const t=[];return void 0!==e.majorUnit&&t.push(fw("c:majorUnit",{val:e.majorUnit})),void 0!==e.minorUnit&&t.push(fw("c:minorUnit",{val:e.minorUnit})),t}function Wx(e){if(void 0===e)return;if("string"==typeof e)return hx.has(e)?{unit:e}:void 0;if("object"!=typeof e||null===e)return;const t={},n=e.unit;"string"==typeof n&&hx.has(n)&&(t.unit=n);const r=e.custUnit;if("number"==typeof r&&Number.isFinite(r)&&r>0&&(t.custUnit=r),void 0!==t.unit||void 0!==t.custUnit){if(!0===e.showLabel&&(t.showLabel=!0),"string"==typeof e.customLabel){const n=e.customLabel.trim();n.length>0&&(t.customLabel=n)}return t}}function Jx(e){if(!e)return[];const t=[];if(void 0!==e.custUnit)t.push(fw("c:custUnit",{val:e.custUnit}));else{if(void 0===e.unit)return[];t.push(fw("c:builtInUnit",{val:e.unit}))}if(!0===e.showLabel||"string"==typeof e.customLabel&&e.customLabel.trim().length>0){const n="string"==typeof e.customLabel?e.customLabel.trim():"";if(n.length>0){const e=n.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;"),r=hw("c:rich",void 0,[fw("a:bodyPr"),fw("a:lstStyle"),hw("a:p",void 0,[hw("a:r",void 0,[hw("a:t",void 0,e)])])]),i=hw("c:tx",void 0,[r]);t.push(hw("c:dispUnitsLbl",void 0,[i]))}else t.push(fw("c:dispUnitsLbl"))}return[hw("c:dispUnits",void 0,t)]}function _x(e){if("string"==typeof e)return px.has(e)?e:void 0}function Xx(e){if(!e)return[];const t=!0===e.sourceLinked?1:0;return[fw("c:numFmt",{formatCode:e.formatCode,sourceLinked:t})]}function Kx(e){if(void 0!==e)return xx.has(e)?e:void 0}function Zx(e){if(void 0!==e)return Cx.has(e)?e:void 0}function eC(e,t,n){const r=[];return void 0!==e&&r.push(fw("c:majorTickMark",{val:e})),void 0!==t&&r.push(fw("c:minorTickMark",{val:t})),void 0!==n&&r.push(fw("c:tickLblPos",{val:n})),r}function tC(e,t){const n="column"===e?"b":"l",r="column"===e?"l":"b",i=[fw("c:axId",{val:Ax}),Yx(t.xScale,t.xReverse),fw("c:delete",{val:t.xHidden?1:0}),fw("c:axPos",{val:n}),...Sx(t.xGridlines)];t.xAxisTitle&&i.push(nC(t.xAxisTitle,t.xAxisTitleRotation,t.xAxisTitleFontSize,t.xAxisTitleBold,t.xAxisTitleItalic,t.xAxisTitleColor,t.xAxisTitleStrike,t.xAxisTitleUnderline,t.xAxisTitleFontFamily,t.xAxisTitleOverlay,t.xAxisTitleLayout,t.xAxisTitleFillColor,t.xAxisTitleBorderColor,t.xAxisTitleBorderWidth,t.xAxisTitleBorderDash,t.xAxisTitleBorderCap,t.xAxisTitleBorderCompound)),i.push(...Xx(t.xNumFmt),...eC(t.xMajorTickMark,t.xMinorTickMark,t.xTickLblPos));const o=$x(t.xLabelRotation,t.xLabelFontSize,t.xLabelBold,t.xLabelItalic,t.xLabelColor,t.xLabelUnderline,t.xLabelStrike,t.xLabelFontFamily);o&&i.push(o),i.push(fw("c:crossAx",{val:bx}),Vx(t.xCrosses),fw("c:auto",{val:t.xAuto?1:0}),fw("c:lblAlgn",{val:t.xLblAlgn??"ctr"}),fw("c:lblOffset",{val:t.xLblOffset??100}),...function(e,t){const n=[];return void 0!==e&&n.push(fw("c:tickLblSkip",{val:e})),void 0!==t&&n.push(fw("c:tickMarkSkip",{val:t})),n}(t.xTickLblSkip,t.xTickMarkSkip),fw("c:noMultiLvlLbl",{val:t.xNoMultiLvlLbl?1:0}));const a=[fw("c:axId",{val:bx}),Yx(t.yScale,t.yReverse),fw("c:delete",{val:t.yHidden?1:0}),fw("c:axPos",{val:r}),...Sx(t.yGridlines)];t.yAxisTitle&&a.push(nC(t.yAxisTitle,t.yAxisTitleRotation,t.yAxisTitleFontSize,t.yAxisTitleBold,t.yAxisTitleItalic,t.yAxisTitleColor,t.yAxisTitleStrike,t.yAxisTitleUnderline,t.yAxisTitleFontFamily,t.yAxisTitleOverlay,t.yAxisTitleLayout,t.yAxisTitleFillColor,t.yAxisTitleBorderColor,t.yAxisTitleBorderWidth,t.yAxisTitleBorderDash,t.yAxisTitleBorderCap,t.yAxisTitleBorderCompound)),a.push(...Xx(t.yNumFmt),...eC(t.yMajorTickMark,t.yMinorTickMark,t.yTickLblPos));const s=$x(t.yLabelRotation,t.yLabelFontSize,t.yLabelBold,t.yLabelItalic,t.yLabelColor,t.yLabelUnderline,t.yLabelStrike,t.yLabelFontFamily);return s&&a.push(s),a.push(fw("c:crossAx",{val:Ax}),Vx(t.yCrosses),fw("c:crossBetween",{val:t.yCrossBetween??"between"}),...Gx(t.yScale),...Jx(t.yDispUnits)),[hw("c:catAx",void 0,i),hw("c:valAx",void 0,a)]}function nC(e,t,n,r,i,o,a,s,l,c,u,f,d,h,p,g,m){const y=void 0===t?0:6e4*t,v=void 0===n?1e3:n*ox,A=r?1:0,b=!0===i?1:void 0,w=!0===a?"sngStrike":void 0,I=!0===s?"sng":void 0,x=void 0!==o?hw("a:solidFill",void 0,[Ow(o)]):void 0,C=l?fw("a:latin",{typeface:l}):void 0,B=[];x&&B.push(x),C&&B.push(C);const E=B.length>0?hw("a:defRPr",{sz:v,b:A,i:b,u:I,strike:w},B):fw("a:defRPr",{sz:v,b:A,i:b,u:I,strike:w}),k=B.length>0?hw("a:rPr",{lang:"en-US",sz:v,b:A,i:b,u:I,strike:w},B):fw("a:rPr",{lang:"en-US",sz:v,b:A,i:b,u:I,strike:w}),S=tI(u),F=[hw("c:tx",void 0,[hw("c:rich",void 0,[hw("a:bodyPr",{rot:y,spcFirstLastPara:1,vertOverflow:"ellipsis",wrap:"square",anchor:"ctr",anchorCtr:1},[]),fw("a:lstStyle"),hw("a:p",void 0,[hw("a:pPr",void 0,[E]),hw("a:r",void 0,[k,hw("a:t",void 0,lw(e))])])])])];S&&F.push(S),F.push(fw("c:overlay",{val:c?1:0}));const D=uI(f,d,h,p,g,m);return void 0!==D&&F.push(D),hw("c:title",void 0,F)}function rC(e){return fI(e)}function iC(e){return dI(e)}function oC(e){return hI(e)}function aC(e){return pI(e)}function sC(e){return gI(e)}function lC(e){return mI(e)}function cC(e){return yI(e)}function uC(e){if("string"!=typeof e)return;const t=e.trim();return 0!==t.length?t:void 0}const fC=new Set(["pie","pie3D","doughnut","ofPie"]),dC=new Set(["none","line","lineMarker","marker","smooth","smoothMarker"]),hC=new Set(["pie","doughnut"]),pC=new Set(["none","line","lineMarker","marker","smooth","smoothMarker"]);function gC(e,t){const n=Rb(e,"varyColors");if(!n)return;const r=n.attrs.val;if("string"!=typeof r)return;const i=fC.has(t);let o;switch(r){case"1":case"true":o=!0;break;case"0":case"false":o=!1;break;default:return}return o!==i?o:void 0}function mC(e){const t=Rb(e,"scatterStyle");if(!t)return;const n=t.attrs.val;return"string"==typeof n&&dC.has(n)?n:void 0}function yC(e){return!!Rb(e,"dropLines")||void 0}function vC(e){return!!Rb(e,"hiLowLines")||void 0}function AC(e){return!!Rb(e,"serLines")||void 0}function bC(e){const t=Rb(e,"marker");if(!t)return;const n=t.attrs.val;if("string"==typeof n)switch(n){case"0":case"false":return!1;default:return}}function wC(e){const t=Rb(e,"grouping");if(!t)return;const n=t.attrs.val;if("string"==typeof n)switch(n){case"stacked":return"stacked";case"percentStacked":return"percentStacked";case"clustered":return"clustered";default:return}}function IC(e){const t=Rb(e,"holeSize");if(!t)return;const n=t.attrs.val;if("string"!=typeof n)return;const r=Number.parseInt(n,10);return Number.isFinite(r)&&!(r<1||r>99)?r:void 0}function xC(e){const t=Rb(e,"gapWidth");if(!t)return;const n=t.attrs.val;if("string"!=typeof n)return;const r=Number.parseInt(n,10);return Number.isFinite(r)&&!(r<0||r>500)&&150!==r?r:void 0}function CC(e){const t=Rb(e,"gapWidth");if(!t)return;const n=t.attrs.val;if("string"!=typeof n)return;const r=Number.parseInt(n,10);return Number.isFinite(r)&&!(r<0||r>500)&&150!==r?r:void 0}function BC(e){const t=Rb(e,"overlap");if(!t)return;const n=t.attrs.val;if("string"!=typeof n)return;const r=Number.parseInt(n,10);return Number.isFinite(r)&&!(r<-100||r>100)&&0!==r?r:void 0}function EC(e){const t=Rb(e,"firstSliceAng");if(!t)return;const n=t.attrs.val;if("string"!=typeof n)return;const r=Number.parseInt(n,10);return Number.isFinite(r)&&!(r<0||r>360)&&0!==r&&360!==r?r:void 0}function kC(e){const t=Rb(e,"grouping");if(!t)return;const n=t.attrs.val;if("string"==typeof n)switch(n){case"stacked":return"stacked";case"percentStacked":return"percentStacked";default:return}}function SC(e,t){const n=tI(function(e){return Zw(e.plotAreaLayout)}(e)),r=[n??fw("c:layout")],i={xAxisTitle:Ex(e.axes?.x?.title),yAxisTitle:Ex(e.axes?.y?.title),xAxisTitleRotation:rC(e.axes?.x?.axisTitleRotation),yAxisTitleRotation:rC(e.axes?.y?.axisTitleRotation),xAxisTitleFontSize:iC(e.axes?.x?.axisTitleFontSize),yAxisTitleFontSize:iC(e.axes?.y?.axisTitleFontSize),xAxisTitleBold:oC(e.axes?.x?.axisTitleBold),yAxisTitleBold:oC(e.axes?.y?.axisTitleBold),xAxisTitleItalic:aC(e.axes?.x?.axisTitleItalic),yAxisTitleItalic:aC(e.axes?.y?.axisTitleItalic),xAxisTitleColor:sC(e.axes?.x?.axisTitleColor),yAxisTitleColor:sC(e.axes?.y?.axisTitleColor),xAxisTitleStrike:lC(e.axes?.x?.axisTitleStrike),yAxisTitleStrike:lC(e.axes?.y?.axisTitleStrike),xAxisTitleUnderline:cC(e.axes?.x?.axisTitleUnderline),yAxisTitleUnderline:cC(e.axes?.y?.axisTitleUnderline),xAxisTitleFontFamily:uC(e.axes?.x?.axisTitleFontFamily),yAxisTitleFontFamily:uC(e.axes?.y?.axisTitleFontFamily),xAxisTitleOverlay:!0===e.axes?.x?.axisTitleOverlay,yAxisTitleOverlay:!0===e.axes?.y?.axisTitleOverlay,xAxisTitleLayout:Zw(e.axes?.x?.axisTitleLayout),yAxisTitleLayout:Zw(e.axes?.y?.axisTitleLayout),xAxisTitleFillColor:gI(e.axes?.x?.axisTitleFillColor),yAxisTitleFillColor:gI(e.axes?.y?.axisTitleFillColor),xAxisTitleBorderColor:gI(e.axes?.x?.axisTitleBorderColor),yAxisTitleBorderColor:gI(e.axes?.y?.axisTitleBorderColor),xAxisTitleBorderWidth:Yw(e.axes?.x?.axisTitleBorderWidth),yAxisTitleBorderWidth:Yw(e.axes?.y?.axisTitleBorderWidth),xAxisTitleBorderDash:Gw(e.axes?.x?.axisTitleBorderDash),yAxisTitleBorderDash:Gw(e.axes?.y?.axisTitleBorderDash),xAxisTitleBorderCap:Fw(e.axes?.x?.axisTitleBorderCap),yAxisTitleBorderCap:Fw(e.axes?.y?.axisTitleBorderCap),xAxisTitleBorderCompound:Dw(e.axes?.x?.axisTitleBorderCompound),yAxisTitleBorderCompound:Dw(e.axes?.y?.axisTitleBorderCompound),xGridlines:kx(e.axes?.x?.gridlines),yGridlines:kx(e.axes?.y?.gridlines),xScale:Fx(e.axes?.x?.scale),yScale:Fx(e.axes?.y?.scale),xNumFmt:Dx(e.axes?.x?.numberFormat),yNumFmt:Dx(e.axes?.y?.numberFormat),xMajorTickMark:Kx(e.axes?.x?.majorTickMark),yMajorTickMark:Kx(e.axes?.y?.majorTickMark),xMinorTickMark:Kx(e.axes?.x?.minorTickMark),yMinorTickMark:Kx(e.axes?.y?.minorTickMark),xTickLblPos:Zx(e.axes?.x?.tickLblPos),yTickLblPos:Zx(e.axes?.y?.tickLblPos),xLabelRotation:Lx(e.axes?.x?.labelRotation),yLabelRotation:Lx(e.axes?.y?.labelRotation),xLabelFontSize:Rx(e.axes?.x?.labelFontSize),yLabelFontSize:Rx(e.axes?.y?.labelFontSize),xLabelBold:Ux(e.axes?.x?.labelBold),yLabelBold:Ux(e.axes?.y?.labelBold),xLabelItalic:Hx(e.axes?.x?.labelItalic),yLabelItalic:Hx(e.axes?.y?.labelItalic),xLabelColor:qx(e.axes?.x?.labelColor),yLabelColor:qx(e.axes?.y?.labelColor),xLabelUnderline:Ox(e.axes?.x?.labelUnderline),yLabelUnderline:Ox(e.axes?.y?.labelUnderline),xLabelStrike:Px(e.axes?.x?.labelStrike),yLabelStrike:Px(e.axes?.y?.labelStrike),xLabelFontFamily:zx(e.axes?.x?.labelFontFamily),yLabelFontFamily:zx(e.axes?.y?.labelFontFamily),xReverse:!0===e.axes?.x?.reverse,yReverse:!0===e.axes?.y?.reverse,xTickLblSkip:Nx(e.axes?.x?.tickLblSkip),xTickMarkSkip:Nx(e.axes?.x?.tickMarkSkip),xLblOffset:Mx(e.axes?.x?.lblOffset),xLblAlgn:Qx(e.axes?.x?.lblAlgn),xNoMultiLvlLbl:!0===e.axes?.x?.noMultiLvlLbl,xAuto:!1!==e.axes?.x?.auto,xHidden:Tx(e.axes?.x?.hidden),yHidden:Tx(e.axes?.y?.hidden),xCrosses:jx(e.axes?.x?.crosses,e.axes?.x?.crossesAt),yCrosses:jx(e.axes?.y?.crosses,e.axes?.y?.crossesAt),xDispUnits:Wx(e.axes?.x?.dispUnits),yDispUnits:Wx(e.axes?.y?.dispUnits),xCrossBetween:_x(e.axes?.x?.crossBetween),yCrossBetween:_x(e.axes?.y?.crossBetween)};switch(e.type){case"bar":case"column":r.push(function(e,t){const n=e.barGrouping??"clustered",r="bar"===e.type?"bar":"col",i="percentStacked"===n||"stacked"===n,o=[fw("c:barDir",{val:r}),fw("c:grouping",{val:n}),fw("c:varyColors",{val:NC(e)?1:0})];for(let n=0;n<e.series.length;n++)o.push(rx(e.series[n],n,t,!1,{chartType:e.type,dataLabels:e.dataLabels,invertIfNegative:!0===e.series[n].invertIfNegative,dataPoints:e.series[n].dataPoints,trendlines:e.series[n].trendlines,errorBars:e.series[n].errorBars}));const a=UI(e);a&&o.push(a);const s=function(e){if(void 0===e||!Number.isFinite(e))return;const t=Math.round(e);return t<0?0:t>500?500:t}(e.gapWidth),l=function(e){if(void 0===e||!Number.isFinite(e))return;const t=Math.round(e);return t<-100?-100:t>100?100:t}(e.overlap),c=s??(i?void 0:150);void 0!==c&&o.push(fw("c:gapWidth",{val:c}));const u=l??(i?100:void 0);void 0!==u&&o.push(fw("c:overlap",{val:u}));!0===e.serLines&&o.push(hw("c:serLines",void 0,[]));return o.push(fw("c:axId",{val:Ax})),o.push(fw("c:axId",{val:bx})),hw("c:barChart",void 0,o)}(e,t)),r.push(...tC(e.type,i));break;case"line":r.push(function(e,t){const n=e.lineGrouping??"standard",r=[fw("c:grouping",{val:n}),fw("c:varyColors",{val:NC(e)?1:0})];for(let n=0;n<e.series.length;n++){const i=rx(e.series[n],n,t,!1,{chartType:e.type,smooth:!0===e.series[n].smooth,dataLabels:e.dataLabels,stroke:e.series[n].stroke,marker:e.series[n].marker,dataPoints:e.series[n].dataPoints,trendlines:e.series[n].trendlines,errorBars:e.series[n].errorBars});r.push(i)}const i=UI(e);i&&r.push(i);!0===e.dropLines&&r.push(hw("c:dropLines",void 0,[]));!0===e.hiLowLines&&r.push(hw("c:hiLowLines",void 0,[]));!0===e.upDownBars&&r.push(function(e){const t=function(e){if(void 0===e||!Number.isFinite(e))return;const t=Math.round(e);return t<0||t>500?void 0:t}(e)??150;return hw("c:upDownBars",void 0,[fw("c:gapWidth",{val:t})])}(e.upDownBarsGapWidth));return r.push(fw("c:marker",{val:!1===e.showLineMarkers?0:1})),r.push(fw("c:axId",{val:Ax})),r.push(fw("c:axId",{val:bx})),hw("c:lineChart",void 0,r)}(e,t)),r.push(...tC("column",i));break;case"area":r.push(function(e,t){const n=e.areaGrouping??"standard",r=[fw("c:grouping",{val:n}),fw("c:varyColors",{val:NC(e)?1:0})];for(let n=0;n<e.series.length;n++)r.push(rx(e.series[n],n,t,!1,{chartType:e.type,dataLabels:e.dataLabels,dataPoints:e.series[n].dataPoints,trendlines:e.series[n].trendlines,errorBars:e.series[n].errorBars}));const i=UI(e);i&&r.push(i);!0===e.dropLines&&r.push(hw("c:dropLines",void 0,[]));return r.push(fw("c:axId",{val:Ax})),r.push(fw("c:axId",{val:bx})),hw("c:areaChart",void 0,r)}(e,t)),r.push(...tC("column",i));break;case"pie":r.push(function(e,t){const n=[fw("c:varyColors",{val:NC(e)?1:0})];e.series.length>0&&n.push(rx(e.series[0],0,t,!1,{chartType:e.type,dataLabels:e.dataLabels,explosion:e.series[0].explosion,dataPoints:e.series[0].dataPoints}));const r=UI(e);r&&n.push(r);const i=FC(e.firstSliceAng);void 0!==i&&n.push(fw("c:firstSliceAng",{val:i}));return hw("c:pieChart",void 0,n)}(e,t));break;case"doughnut":r.push(function(e,t){const n=[fw("c:varyColors",{val:NC(e)?1:0})];for(let r=0;r<e.series.length;r++)n.push(rx(e.series[r],r,t,!1,{chartType:e.type,dataLabels:e.dataLabels,explosion:e.series[r].explosion,dataPoints:e.series[r].dataPoints}));const r=UI(e);r&&n.push(r);return n.push(fw("c:firstSliceAng",{val:FC(e.firstSliceAng)??0})),n.push(fw("c:holeSize",{val:DC(e.holeSize)})),hw("c:doughnutChart",void 0,n)}(e,t));break;case"scatter":r.push(function(e,t){const n=[fw("c:scatterStyle",{val:MC(e)}),fw("c:varyColors",{val:NC(e)?1:0})];for(let r=0;r<e.series.length;r++)n.push(rx(e.series[r],r,t,!0,{chartType:e.type,smooth:!0===e.series[r].smooth||void 0,dataLabels:e.dataLabels,stroke:e.series[r].stroke,marker:e.series[r].marker,dataPoints:e.series[r].dataPoints,trendlines:e.series[r].trendlines,errorBars:e.series[r].errorBars}));const r=UI(e);r&&n.push(r);return n.push(fw("c:axId",{val:wx})),n.push(fw("c:axId",{val:Ix})),hw("c:scatterChart",void 0,n)}(e,t)),r.push(...function(e){const t=[fw("c:axId",{val:wx}),Yx(e.xScale,e.xReverse),fw("c:delete",{val:e.xHidden?1:0}),fw("c:axPos",{val:"b"}),...Sx(e.xGridlines)];e.xAxisTitle&&t.push(nC(e.xAxisTitle,e.xAxisTitleRotation,e.xAxisTitleFontSize,e.xAxisTitleBold,e.xAxisTitleItalic,e.xAxisTitleColor,e.xAxisTitleStrike,e.xAxisTitleUnderline,e.xAxisTitleFontFamily,e.xAxisTitleOverlay,e.xAxisTitleLayout,e.xAxisTitleFillColor,e.xAxisTitleBorderColor,e.xAxisTitleBorderWidth,e.xAxisTitleBorderDash,e.xAxisTitleBorderCap,e.xAxisTitleBorderCompound)),t.push(...Xx(e.xNumFmt),...eC(e.xMajorTickMark,e.xMinorTickMark,e.xTickLblPos));const n=$x(e.xLabelRotation,e.xLabelFontSize,e.xLabelBold,e.xLabelItalic,e.xLabelColor,e.xLabelUnderline,e.xLabelStrike,e.xLabelFontFamily);n&&t.push(n),t.push(fw("c:crossAx",{val:Ix}),Vx(e.xCrosses),fw("c:crossBetween",{val:e.xCrossBetween??"midCat"}),...Gx(e.xScale),...Jx(e.xDispUnits));const r=[fw("c:axId",{val:Ix}),Yx(e.yScale,e.yReverse),fw("c:delete",{val:e.yHidden?1:0}),fw("c:axPos",{val:"l"}),...Sx(e.yGridlines)];e.yAxisTitle&&r.push(nC(e.yAxisTitle,e.yAxisTitleRotation,e.yAxisTitleFontSize,e.yAxisTitleBold,e.yAxisTitleItalic,e.yAxisTitleColor,e.yAxisTitleStrike,e.yAxisTitleUnderline,e.yAxisTitleFontFamily,e.yAxisTitleOverlay,e.yAxisTitleLayout,e.yAxisTitleFillColor,e.yAxisTitleBorderColor,e.yAxisTitleBorderWidth,e.yAxisTitleBorderDash,e.yAxisTitleBorderCap,e.yAxisTitleBorderCompound)),r.push(...Xx(e.yNumFmt),...eC(e.yMajorTickMark,e.yMinorTickMark,e.yTickLblPos));const i=$x(e.yLabelRotation,e.yLabelFontSize,e.yLabelBold,e.yLabelItalic,e.yLabelColor,e.yLabelUnderline,e.yLabelStrike,e.yLabelFontFamily);return i&&r.push(i),r.push(fw("c:crossAx",{val:wx}),Vx(e.yCrosses),fw("c:crossBetween",{val:e.yCrossBetween??"midCat"}),...Gx(e.yScale),...Jx(e.yDispUnits)),[hw("c:valAx",void 0,t),hw("c:valAx",void 0,r)]}(i));break;default:{const t=e.type;throw new Error(`Unsupported chart type: ${String(t)}`)}}const o=function(e){if("pie"===e.type||"doughnut"===e.type)return;const t=e.dataTable;var n;return void 0!==t&&!1!==t?!0===t?{showHorzBorder:!0,showVertBorder:!0,showOutline:!0,showKeys:!0,fontSize:void 0,fontColor:void 0,bold:void 0,italic:void 0,underline:void 0,strikethrough:void 0,fontFamily:void 0,fillColor:void 0,borderColor:void 0,borderWidth:void 0,borderDash:void 0,borderCap:void 0,borderCompound:void 0}:{showHorzBorder:!1!==t.showHorzBorder,showVertBorder:!1!==t.showVertBorder,showOutline:!1!==t.showOutline,showKeys:!1!==t.showKeys,fontSize:(n=t.fontSize,dI(n)),fontColor:BI(t.fontColor),bold:EI(t.bold),italic:kI(t.italic),underline:SI(t.underline),strikethrough:FI(t.strikethrough),fontFamily:DI(t.fontFamily),fillColor:NI(t.fillColor),borderColor:MI(t.borderColor),borderWidth:Yw(t.borderWidth),borderDash:Gw(t.borderDash),borderCap:Fw(t.borderCap),borderCompound:Dw(t.borderCompound)}:void 0}(e);void 0!==o&&r.push(QI(o));const a=function(e){const t=(s=e.plotAreaFillColor,gI(s)),n=function(e){return gI(e)}(e.plotAreaBorderColor),r=Yw(e.plotAreaBorderWidth),i=Gw(e.plotAreaBorderDash),o=Fw(e.plotAreaBorderCap),a=Dw(e.plotAreaBorderCompound);var s;if(void 0===t&&void 0===n&&void 0===r&&void 0===i&&void 0===o&&void 0===a)return;const l=[];void 0!==t&&l.push(hw("a:solidFill",void 0,[Ow(t)]));if(void 0!==n||void 0!==r||void 0!==i||void 0!==o||void 0!==a){const e={};void 0!==r&&(e.w=Math.round(r*Cw)),void 0!==o&&(e.cap=o),void 0!==a&&(e.cmpd=a);const t=[];void 0!==n&&t.push(hw("a:solidFill",void 0,[Ow(n)])),void 0!==i&&t.push(fw("a:prstDash",{val:i})),l.push(0===t.length?fw("a:ln",e):hw("a:ln",Object.keys(e).length>0?e:void 0,t))}return hw("c:spPr",void 0,l)}(e);return void 0!==a&&r.push(a),hw("c:plotArea",void 0,r)}function FC(e){if(void 0===e||!Number.isFinite(e))return;let t=Math.round(e)%360;return t<0&&(t+=360),0!==t?t:void 0}function DC(e){if(void 0===e||!Number.isFinite(e))return 50;const t=Math.round(e);return t<10?10:t>90?90:t}function NC(e){return"boolean"==typeof e.varyColors?e.varyColors:hC.has(e.type)}function MC(e){const t=e.scatterStyle;return t&&pC.has(t)?t:"lineMarker"}const QC=new Map([["barChart","bar"],["bar3DChart","bar3D"],["lineChart","line"],["line3DChart","line3D"],["pieChart","pie"],["pie3DChart","pie3D"],["doughnutChart","doughnut"],["areaChart","area"],["area3DChart","area3D"],["scatterChart","scatter"],["bubbleChart","bubble"],["radarChart","radar"],["surfaceChart","surface"],["surface3DChart","surface3D"],["stockChart","stock"],["ofPieChart","ofPie"]]);function TC(e){const t=Lb(e),n="chartSpace"===t.local?t:Hb(t,"chartSpace");if(!n)return;const r=Rb(n,"chart");if(!r)return{kinds:[],seriesCount:0};const i={kinds:[],seriesCount:0},o=function(e){const t=Rb(e,"title");if(!t)return;const n=Rb(t,"tx");if(!n)return;const r=Rb(n,"rich");if(r){const e=[];gw(r,e);const t=e.join("").trim();return t.length>0?t:void 0}const i=Rb(n,"strRef");if(i){const e=Rb(i,"strCache");if(e)for(const t of Ub(e)){if("pt"!==t.local)continue;const e=Rb(t,"v");if(e){const t=mw(e).trim();if(t.length>0)return t}}}}(r);void 0!==o&&(i.title=o);const a=function(e){const t=Rb(e,"title");if(!t)return;const n=Rb(t,"overlay");if(!n)return;const r=n.attrs.val;if("string"==typeof r)switch(r){case"1":case"true":return!0;default:return}}(r);void 0!==a&&(i.titleOverlay=a);const s=function(e){const t=Rb(e,"title");if(!t)return;const n=Rb(t,"tx");if(!n)return;const r=Rb(n,"rich");if(!r)return;const i=Rb(r,"bodyPr");if(!i)return;const o=i.attrs.rot;if("string"!=typeof o)return;const a=o.trim();if(0===a.length)return;const s=Number.parseInt(a,10);if(!Number.isFinite(s))return;const l=Math.round(s/lI);return 0!==l?l<cI?cI:l>90?90:l:void 0}(r);void 0!==s&&(i.titleRotation=s);const l=function(e){const t=rI(e);if(!t)return;const n=t.attrs.sz;if("string"!=typeof n)return;const r=n.trim();if(0===r.length)return;const i=Number.parseInt(r,10);if(!Number.isFinite(i))return;const o=Math.round(i/100*2)/2;return o<1||o>400?void 0:o}(r);void 0!==l&&(i.titleFontSize=l);const c=function(e){const t=rI(e);if(!t)return;return!0===yw(t.attrs.b)||void 0}(r);void 0!==c&&(i.titleBold=c);const u=function(e){const t=rI(e);if(!t)return;return!0===yw(t.attrs.i)||void 0}(r);void 0!==u&&(i.titleItalic=u);const f=function(e){const t=rI(e);if(!t)return;const n=Rb(t,"solidFill");if(!n)return;const r=Rb(n,"srgbClr");if(r)return Pw(r.attrs.val);const i=Rb(n,"schemeClr");return i?Hw(i):void 0}(r);void 0!==f&&(i.titleColor=f);const d=function(e){const t=rI(e);if(!t)return;return"sngStrike"===t.attrs.strike||void 0}(r);void 0!==d&&(i.titleStrike=d);const h=function(e){const t=rI(e);if(!t)return;return"sng"===t.attrs.u||void 0}(r);void 0!==h&&(i.titleUnderline=h);const p=function(e){const t=rI(e);if(!t)return;const n=Rb(t,"latin");if(!n)return;const r=n.attrs.typeface;if("string"!=typeof r)return;const i=r.trim();return 0!==i.length?i:void 0}(r);void 0!==p&&(i.titleFontFamily=p);const g=function(e){const t=Rb(e,"title");if(t)return Kw(t)}(r);void 0!==g&&(i.titleLayout=g);const m=function(e){const t=Rb(e,"title");if(t)return zw(t)}(r);void 0!==m&&(i.titleFillColor=m);const y=function(e){const t=Rb(e,"title");if(t)return $w(t)}(r);void 0!==y&&(i.titleBorderColor=y);const v=function(e){const t=Rb(e,"title");if(t)return jw(t)}(r);void 0!==v&&(i.titleBorderWidth=v);const A=function(e){const t=Rb(e,"title");if(t)return Vw(t)}(r);void 0!==A&&(i.titleBorderDash=A);const b=function(e){const t=Rb(e,"title");if(t)return Nw(t)}(r);void 0!==b&&(i.titleBorderCap=b);const w=function(e){const t=Rb(e,"title");if(t)return Mw(t)}(r);void 0!==w&&(i.titleBorderCompound=w);const I=function(e){const t=Rb(e,"autoTitleDeleted");if(!t)return;const n=t.attrs.val;if("string"==typeof n)switch(n){case"1":case"true":return!0;default:return}}(r);void 0!==I&&(i.autoTitleDeleted=I);const x=Rb(r,"plotArea");if(x){let e=0;const t=[];let n,r,o,a,s,l,c,u,f,d,h,p,g,m,y,v;for(const A of Ub(x)){const b=QC.get(A.local);if(!b)continue;if(i.kinds.includes(b)||i.kinds.push(b),void 0===f&&(f=gC(A,b)),void 0!==n||"bar"!==b&&"bar3D"!==b||(n=wC(A)),void 0!==l||"bar"!==b&&"bar3D"!==b||(l=xC(A)),void 0!==c||"bar"!==b&&"bar3D"!==b||(c=BC(A)),void 0!==r||"line"!==b&&"line3D"!==b||(r=kC(A)),void 0!==o||"area"!==b&&"area3D"!==b||(o=kC(A)),void 0===s&&"doughnut"===b&&(s=IC(A)),void 0!==u||"pie"!==b&&"pie3D"!==b&&"doughnut"!==b&&"ofPie"!==b||(u=EC(A)),void 0===d&&"scatter"===b&&(d=mC(A)),void 0!==h||"line"!==b&&"line3D"!==b&&"area"!==b&&"area3D"!==b||(h=yC(A)),void 0!==p||"line"!==b&&"line3D"!==b&&"stock"!==b||(p=vC(A)),void 0!==g||"bar"!==b&&"ofPie"!==b||(g=AC(A)),void 0===m&&("line"===b||"line3D"===b||"stock"===b)){const e=Rb(A,"upDownBars");void 0!==e&&(m=!0,y=CC(e))}void 0===v&&"line"===b&&(v=bC(A));let w=0;for(const n of Ub(A))"ser"===n.local&&(e++,t.push(tx(n,b,w)),w++);if(void 0===a){const e=Rb(A,"dLbls");if(e){const t=RI(e);t&&(a=t)}}}i.seriesCount=e,t.length>0&&(i.series=t),void 0!==n&&(i.barGrouping=n),void 0!==r&&(i.lineGrouping=r),void 0!==o&&(i.areaGrouping=o),a&&(i.dataLabels=a),void 0!==s&&(i.holeSize=s),void 0!==l&&(i.gapWidth=l),void 0!==c&&(i.overlap=c),void 0!==u&&(i.firstSliceAng=u),void 0!==f&&(i.varyColors=f),void 0!==d&&(i.scatterStyle=d),void 0!==h&&(i.dropLines=h),void 0!==p&&(i.hiLowLines=p),void 0!==g&&(i.serLines=g),void 0!==m&&(i.upDownBars=m),void 0!==y&&(i.upDownBarsGapWidth=y),void 0!==v&&(i.showLineMarkers=v);const A=function(e){let t;const n=[];for(const r of Ub(e))"catAx"===r.local?t??=r:"valAx"===r.local&&n.push(r);let r,i;t?(r=t,i=n[0]):(r=n[0],i=n[1]);const o=t?"between":"midCat",a=r?gx(r,o):void 0,s=i?gx(i,o):void 0;if(!a&&!s)return;const l={};return a&&(l.x=a),s&&(l.y=s),l}(x);void 0!==A&&(i.axes=A);const b=xI(x);void 0!==b&&(i.dataTable=b);const w=function(e){return Kw(e)}(x);void 0!==w&&(i.plotAreaLayout=w);const I=function(e){return zw(e)}(x);void 0!==I&&(i.plotAreaFillColor=I);const C=function(e){return $w(e)}(x);void 0!==C&&(i.plotAreaBorderColor=C);const B=function(e){return jw(e)}(x);void 0!==B&&(i.plotAreaBorderWidth=B);const E=Vw(x);void 0!==E&&(i.plotAreaBorderDash=E);const k=Nw(x);void 0!==k&&(i.plotAreaBorderCap=k);const S=Mw(x);void 0!==S&&(i.plotAreaBorderCompound=S)}const C=function(e){const t=Rb(e,"legend");if(!t)return;const n=Rb(t,"delete");if(n&&!0===Aw(n.attrs.val))return!1;const r=Rb(t,"legendPos");if(!r)return"right";const i=r.attrs.val;if("string"!=typeof i)return"right";switch(i){case"t":return"top";case"b":return"bottom";case"l":return"left";case"r":return"right";case"tr":return"topRight";default:return}}(r);if(void 0!==C&&(i.legend=C),void 0!==C&&!1!==C){const e=function(e){const t=Rb(e,"legend");if(!t)return;const n=Rb(t,"overlay");if(!n)return;const r=n.attrs.val;if("string"==typeof r)switch(r){case"1":case"true":return!0;default:return}}(r);void 0!==e&&(i.legendOverlay=e);const t=function(e){const t=Rb(e,"legend");if(!t)return;const n=new Set,r=[];for(const e of Ub(t)){if("legendEntry"!==e.local)continue;const t=Rb(e,"idx");if(!t)continue;const i=t.attrs.val;if("string"!=typeof i)continue;const o=Number.parseInt(i,10);if(!Number.isFinite(o)||o<0)continue;if(n.has(o))continue;n.add(o);const a=Rb(e,"delete"),s={idx:o,delete:void 0!==a&&!0===Aw(a.attrs.val)},l=nI(e);if(l){const e=l.attrs.sz;if("string"==typeof e){const t=e.trim();if(t.length>0){const e=Number.parseInt(t,10);if(Number.isFinite(e)){const t=Math.round(e/vI*2)/2;t>=1&&t<=AI&&(s.fontSize=t)}}}const t=l.attrs.b;"string"==typeof t&&!0===Aw(t)&&(s.bold=!0);const n=l.attrs.i;"string"==typeof n&&!0===Aw(n)&&(s.italic=!0);const r=l.attrs.u;"string"==typeof r&&"sng"===r&&(s.underline=!0);const i=l.attrs.strike;"string"==typeof i&&"sngStrike"===i&&(s.strikethrough=!0);const o=Rb(l,"solidFill");if(o){const e=Rb(o,"srgbClr");if(e){const t=e.attrs.val;if("string"==typeof t){const e=t.replace(/^#/,"").toUpperCase();/^[0-9A-F]{6}$/.test(e)&&(s.color=e)}}}const a=Rb(l,"latin");if(a){const e=a.attrs.typeface;if("string"==typeof e){const t=e.trim();t.length>0&&(s.fontFamily=t)}}}r.push(s)}return r.length>0?r:void 0}(r);void 0!==t&&(i.legendEntries=t);const n=function(e){const t=Rb(e,"legend");if(!t)return;const n=nI(t);if(!n)return;const r=n.attrs.sz;if("string"!=typeof r)return;const i=r.trim();if(0===i.length)return;const o=Number.parseInt(i,10);if(!Number.isFinite(o))return;const a=Math.round(o/vI*2)/2;return a<1||a>AI?void 0:a}(r);void 0!==n&&(i.legendFontSize=n);const o=function(e){const t=Rb(e,"legend");if(!t)return;const n=nI(t);if(!n)return;const r=n.attrs.b;return"1"===r||"true"===r||void 0}(r);void 0!==o&&(i.legendBold=o);const a=function(e){const t=Rb(e,"legend");if(!t)return;const n=nI(t);if(!n)return;const r=n.attrs.i;return"1"===r||"true"===r||void 0}(r);void 0!==a&&(i.legendItalic=a);const s=function(e){const t=Rb(e,"legend");if(!t)return;const n=nI(t);if(!n)return;return"sng"===n.attrs.u||void 0}(r);void 0!==s&&(i.legendUnderline=s);const l=function(e){const t=Rb(e,"legend");if(!t)return;const n=nI(t);if(!n)return;return"sngStrike"===n.attrs.strike||void 0}(r);void 0!==l&&(i.legendStrikethrough=l);const c=function(e){const t=Rb(e,"legend");if(!t)return;const n=nI(t);if(!n)return;const r=Rb(n,"solidFill");if(!r)return;const i=Rb(r,"srgbClr");if(i)return Pw(i.attrs.val);const o=Rb(r,"schemeClr");return o?Hw(o):void 0}(r);void 0!==c&&(i.legendFontColor=c);const u=function(e){const t=Rb(e,"legend");if(!t)return;const n=nI(t);if(!n)return;const r=Rb(n,"latin");if(!r)return;const i=r.attrs.typeface;if("string"!=typeof i)return;const o=i.trim();return 0!==o.length?o:void 0}(r);void 0!==u&&(i.legendFontFamily=u);const f=function(e){const t=Rb(e,"legend");if(t)return Kw(t)}(r);void 0!==f&&(i.legendLayout=f);const d=function(e){const t=Rb(e,"legend");if(t)return zw(t)}(r);void 0!==d&&(i.legendFillColor=d);const h=function(e){const t=Rb(e,"legend");if(t)return $w(t)}(r);void 0!==h&&(i.legendBorderColor=h);const p=function(e){const t=Rb(e,"legend");if(t)return jw(t)}(r);void 0!==p&&(i.legendBorderWidth=p);const g=function(e){const t=Rb(e,"legend");if(t)return Vw(t)}(r);void 0!==g&&(i.legendBorderDash=g);const m=function(e){const t=Rb(e,"legend");if(t)return Nw(t)}(r);void 0!==m&&(i.legendBorderCap=m);const y=function(e){const t=Rb(e,"legend");if(t)return Mw(t)}(r);void 0!==y&&(i.legendBorderCompound=y)}const B=function(e){const t=Rb(e,"dispBlanksAs");if(!t)return;const n=t.attrs.val;if("string"!=typeof n)return;switch(n){case"zero":return"zero";case"span":return"span";default:return}}(r);void 0!==B&&(i.dispBlanksAs=B);const E=function(e){const t=Rb(e,"plotVisOnly");if(!t)return;const n=t.attrs.val;if("string"!=typeof n)return;switch(n){case"0":case"false":return!1;default:return}}(r);void 0!==E&&(i.plotVisOnly=E);const k=function(e){const t=Rb(e,"showDLblsOverMax");if(!t)return;const n=t.attrs.val;if("string"!=typeof n)return;switch(n){case"0":case"false":return!1;default:return}}(r);void 0!==k&&(i.showDLblsOverMax=k);const S=function(e){const t=Rb(e,"roundedCorners");if(!t)return;const n=t.attrs.val;if("string"!=typeof n)return;switch(n){case"1":case"true":return!0;default:return}}(n);void 0!==S&&(i.roundedCorners=S);const F=function(e){const t=Rb(e,"style");if(!t)return;const n=t.attrs.val;if("string"!=typeof n)return;if(!/^\d+$/.test(n))return;const r=Number(n);return Number.isInteger(r)?r<1||r>48?void 0:r:void 0}(n);void 0!==F&&(i.style=F);const D=function(e){const t=Rb(e,"lang");if(!t)return;const n=t.attrs.val;return"string"!=typeof n?void 0:/^[A-Za-z]{2,3}(-[A-Za-z0-9]{2,8})*$/.test(n)?n:void 0}(n);void 0!==D&&(i.lang=D);const N=function(e){const t=Rb(e,"date1904");if(!t)return;const n=t.attrs.val;if("string"!=typeof n)return;switch(n){case"1":case"true":return!0;default:return}}(n);void 0!==N&&(i.date1904=N);const M=function(e){const t=Rb(e,"protection");if(!t)return;const n={},r=LC(t,"chartObject");void 0!==r&&(n.chartObject=r);const i=LC(t,"data");void 0!==i&&(n.data=i);const o=LC(t,"formatting");void 0!==o&&(n.formatting=o);const a=LC(t,"selection");void 0!==a&&(n.selection=a);const s=LC(t,"userInterface");void 0!==s&&(n.userInterface=s);return n}(n);void 0!==M&&(i.protection=M);const Q=Ww(r);void 0!==Q&&(i.view3D=Q);const T=function(e){const t=Rb(e,"floor");if(!t)return;const n=Rb(t,"thickness");if(!n)return;const r=n.attrs.val;if("string"!=typeof r)return;if(!/^\d+$/.test(r))return;const i=Number(r);return!Number.isInteger(i)||0===i||i>100?void 0:i}(r);void 0!==T&&(i.floorThickness=T);const L=function(e){const t=Rb(e,"sideWall");if(!t)return;const n=Rb(t,"thickness");if(!n)return;const r=n.attrs.val;if("string"!=typeof r)return;if(!/^\d+$/.test(r))return;const i=Number(r);return!Number.isInteger(i)||0===i||i>100?void 0:i}(r);void 0!==L&&(i.sideWallThickness=L);const R=function(e){const t=Rb(e,"backWall");if(!t)return;const n=Rb(t,"thickness");if(!n)return;const r=n.attrs.val;if("string"!=typeof r)return;if(!/^\d+$/.test(r))return;const i=Number(r);return!Number.isInteger(i)||0===i||i>100?void 0:i}(r);void 0!==R&&(i.backWallThickness=R);const U=function(e){return zw(e)}(n);void 0!==U&&(i.chartSpaceFillColor=U);const H=function(e){return $w(e)}(n);void 0!==H&&(i.chartSpaceBorderColor=H);const q=jw(n);void 0!==q&&(i.chartSpaceBorderWidth=q);const O=Vw(n);void 0!==O&&(i.chartSpaceBorderDash=O);const P=Nw(n);void 0!==P&&(i.chartSpaceBorderCap=P);const z=Mw(n);return void 0!==z&&(i.chartSpaceBorderCompound=z),i}function LC(e,t){const n=Rb(e,t);if(!n)return;const r=n.attrs.val;if("string"==typeof r)switch(r){case"1":case"true":return!0;case"0":case"false":return!1;default:return}}const RC=1073741824,UC=1048575,HC=16383,qC=16777216,OC=Object.freeze([208,207,17,224,161,177,26,225]);async function PC(e,t){if(e instanceof Uint8Array)return e;if(e instanceof ArrayBuffer)return new Uint8Array(e);if("object"==typeof(n=e)&&null!==n&&"function"==typeof n.getReader)return async function(e,t=1073741824){const n=Number.isFinite(t)&&t>0?t:RC,r=e.getReader(),i=[];let o=0;try{for(;;){const{done:e,value:t}=await r.read();if(e)break;if(t){if(o+=t.length,o>n)throw new pb(`Input stream exceeds the maximum of ${n} bytes. Raise \`maxInputBytes\` if the file really is this large.`);i.push(t)}}if(0===i.length)return new Uint8Array(0);if(1===i.length)return i[0];const e=new Uint8Array(o);let t=0;for(const n of i)e.set(n,t),t+=n.length;return e}finally{try{await r.cancel()}catch{}try{r.releaseLock()}catch{}}}(e,t);var n;throw new pb("Unsupported input type. Expected Uint8Array, ArrayBuffer, or ReadableStream<Uint8Array>.")}const zC=[208,207,17,224,161,177,26,225],$C=4294967294,jC=4294967295,VC=4096,YC=64;function GC(e){if(e.length<512)throw new pb("CFB: file too small");for(let t=0;t<zC.length;t++)if(e[t]!==zC[t])throw new pb("CFB: bad signature");const t=new DataView(e.buffer,e.byteOffset,e.byteLength),n=1<<t.getUint16(30,!0),r=1<<t.getUint16(32,!0),i=t.getUint32(44,!0),o=t.getUint32(48,!0),a=t.getUint32(56,!0),s=t.getUint32(60,!0),l=t.getUint32(64,!0),c=t.getUint32(68,!0),u=t.getUint32(72,!0),f=t=>{const r=(e=>(e+1)*n)(t);if(r+n>e.length)throw new pb("CFB: sector out of range");return e.subarray(r,r+n)},d=[];for(let e=0;e<109&&d.length<i;e++){const n=t.getUint32(76+4*e,!0);if(n===jC||n===$C)break;d.push(n)}const h=Math.floor(e.length/n)+1,p=Math.min(u,h);let g=c,m=0;for(;g!==$C&&g!==jC&&p>0&&m++<p+1;){const e=f(g),t=new DataView(e.buffer,e.byteOffset,e.byteLength),r=n/4-1;for(let e=0;e<r&&d.length<i;e++){const n=t.getUint32(4*e,!0);n!==jC&&n!==$C&&d.push(n)}g=t.getUint32(n-4,!0)}const y=[];for(const e of d){const t=f(e),r=new DataView(t.buffer,t.byteOffset,t.byteLength);for(let e=0;e<n/4;e++)y.push(r.getUint32(4*e,!0))}const v=(e,t)=>{const r=(e=>{const t=[];let n=e,r=0;for(;n!==$C&&n!==jC&&r++<y.length+1;)t.push(n),n=y[n]??$C;return t})(e),i=new Uint8Array(r.length*n);let o=0;for(const e of r)i.set(f(e),o),o+=n;return t>=0?i.subarray(0,t):i},A=v(o,-1),b=new DataView(A.buffer,A.byteOffset,A.byteLength),w=[];for(let e=0;e+128<=A.length;e+=128){const t=A[e+66];if(0===t)continue;const n=b.getUint16(e+64,!0);let r="";for(let t=0;t+1<n;t+=2){const n=b.getUint16(e+t,!0);if(0===n)break;r+=String.fromCharCode(n)}const i=b.getUint32(e+116,!0),o=b.getUint32(e+120,!0);w.push({name:r,type:t,startSector:i,size:o})}const I=w.find(e=>5===e.type);if(!I)throw new pb("CFB: missing root entry");const x=v(I.startSector,I.size),C=[];if(l>0&&s!==$C){const e=v(s,l*n),t=new DataView(e.buffer,e.byteOffset,e.byteLength);for(let n=0;n<e.length/4;n++)C.push(t.getUint32(4*n,!0))}const B=(e,t)=>{if(t<0||t>x.length)throw new pb("CFB: mini stream size out of range");const n=new Uint8Array(t);let i=e,o=0,a=0;for(;i!==$C&&i!==jC&&o<t&&a++<C.length+1;){const e=i*r,a=Math.min(r,t-o);n.set(x.subarray(e,e+a),o),o+=a,i=C[i]??$C}return n},E=new Map;for(const e of w){if(2!==e.type)continue;const t=a||VC;E.set(e.name,e.size<t?B(e.startSector,e.size):v(e.startSector,e.size))}return E}function WC(e){const t=512,n=[],r=[],i=[],o=new Map;let a=0;for(const t of e)if(t.data.length<VC){o.set(t.name,{mini:!0}),r.push(a);const e=JC(t.data,YC);n.push(e),a+=e.length/YC}else o.set(t.name,{mini:!1}),i.push({name:t.name,data:t.data});const s=function(e){let t=0;for(const n of e)t+=n.length;const n=new Uint8Array(t);let r=0;for(const t of e)n.set(t,r),r+=t.length;return n}(n);let l=0;const c=e=>{const n=Math.max(1,Math.ceil(e/t)),r=l;return l+=n,{startSector:r,sectorCount:n}},u=i.map(e=>({name:e.name,data:e.data,region:c(e.data.length)})),f=s.length>0?c(s.length):null,d=new Uint8Array(Math.ceil(Math.max(a,0)/128)*t);{const t=new DataView(d.buffer);for(let e=0;e<d.length/4;e++)t.setUint32(4*e,jC,!0);let n=0;for(const i of e){if(i.data.length>=VC)continue;const e=JC(i.data,YC).length/YC;for(let i=0;i<e;i++){const o=r[n]+i;t.setUint32(4*o,i===e-1?$C:o+1,!0)}n++}}const h=a>0?c(d.length):null,p=1+e.length,g=Math.ceil(p/4)*t,m=c(g),y=l;let v=1;for(;;){const e=y+v,t=Math.ceil(e/128);if(t<=v)break;v=t}const A={startSector:l,sectorCount:v};l+=v;const b=l,w=new Uint32Array(128*v);w.fill(jC);const I=e=>{for(let t=0;t<e.sectorCount;t++)w[e.startSector+t]=t===e.sectorCount-1?$C:e.startSector+t+1};for(const e of u)I(e.region);f&&I(f),h&&I(h),I(m);for(let e=0;e<v;e++)w[A.startSector+e]=4294967293;const x=new Uint8Array(g),C=new DataView(x.buffer),B=(e,t,n,r,i,o,a,s,l)=>{const c=128*e;for(let e=0;e<t.length;e++)C.setUint16(c+2*e,t.charCodeAt(e),!0);C.setUint16(c+64,2*(t.length+1),!0),x[c+66]=n,x[c+67]=r,C.setUint32(c+68,i,!0),C.setUint32(c+72,o,!0),C.setUint32(c+76,a,!0),C.setUint32(c+116,s,!0),C.setUint32(c+120,l,!0)};for(let e=0;e<g/128;e++)C.setUint32(128*e+68,jC,!0),C.setUint32(128*e+72,jC,!0),C.setUint32(128*e+76,jC,!0);B(0,"Root Entry",5,1,jC,jC,e.length>0?1:jC,f?f.startSector:$C,s.length);for(let t=0;t<e.length;t++){const n=e[t],r=o.get(n.name),i=t+1,a=t+1<e.length?i+1:jC;let s;if(r.mini){let n=0;for(let r=0;r<t;r++){const t=e[r];t.data.length<VC&&(n+=JC(t.data,YC).length/YC)}s=n}else{s=u.find(e=>e.name===n.name).region.startSector}B(i,n.name,2,1,jC,a,jC,s,n.data.length)}const E=new Uint8Array((b+1)*t),k=new DataView(E.buffer);for(let e=0;e<zC.length;e++)E[e]=zC[e];k.setUint16(24,62,!0),k.setUint16(26,3,!0),k.setUint16(28,65534,!0),k.setUint16(30,9,!0),k.setUint16(32,6,!0),k.setUint32(44,v,!0),k.setUint32(48,m.startSector,!0),k.setUint32(56,VC,!0),k.setUint32(60,h?h.startSector:$C,!0),k.setUint32(64,h?h.sectorCount:0,!0),k.setUint32(68,$C,!0),k.setUint32(72,0,!0);for(let e=0;e<109;e++)k.setUint32(76+4*e,e<v?A.startSector+e:jC,!0);const S=e=>(e+1)*t,F=(e,t)=>{E.set(t,S(e.startSector))};for(const e of u)F(e.region,e.data);f&&F(f,s),h&&F(h,d),F(m,x);{const e=S(A.startSector),n=new DataView(E.buffer,e,v*t);for(let e=0;e<w.length;e++)n.setUint32(4*e,w[e],!0)}return E}function JC(e,t){if(e.length%t===0)return e;const n=new Uint8Array(Math.ceil(e.length/t)*t);return n.set(e,0),n}const _C=new Uint8Array([254,167,210,118,59,75,158,121]),XC=new Uint8Array([215,170,15,109,48,97,52,78]),KC=new Uint8Array([20,110,11,231,171,172,208,214]),ZC=new Uint8Array([95,178,173,1,12,185,225,246]),eB=new Uint8Array([160,103,127,2,178,44,132,51]),tB=4096,nB=new Uint8Array(16);async function rB(e,t,n=1e7){let r;try{r=GC(e)}catch(e){throw new Ab("Not a valid encrypted workbook container.",{cause:e})}const i=r.get("EncryptionInfo"),o=r.get("EncryptedPackage");if(!i||!o)throw new Ab("Encrypted workbook missing EncryptionInfo/EncryptedPackage.");const a=i[0]|i[1]<<8,s=i[2]|i[3]<<8;if(4!==a||4!==s)throw new Ab(`Unsupported encryption (version ${a}.${s}); only ECMA-376 Agile is supported.`);const l=new TextDecoder("utf-8").decode(i.subarray(8)),c=function(e,t){const n=yB(e,"encryptedKey");if(!n)throw new Ab("EncryptionInfo missing encryptedKey.");const r=parseInt(vB(n,"spinCount"),10);if(!Number.isFinite(r)||r<0)throw new Ab("EncryptionInfo has an invalid spinCount.");if(r>t)throw new Ab(`EncryptionInfo spinCount ${r} exceeds the maximum of ${t}. Raise \`maxSpinCount\` to agree to spend that time.`);return{saltValue:EB(vB(n,"saltValue")),hashAlgorithm:bB(vB(n,"hashAlgorithm")),keyBytes:parseInt(vB(n,"keyBits"),10)/8,blockSize:parseInt(vB(n,"blockSize"),10),spinCount:r,encryptedVerifierHashInput:EB(vB(n,"encryptedVerifierHashInput")),encryptedVerifierHashValue:EB(vB(n,"encryptedVerifierHashValue")),encryptedKeyValue:EB(vB(n,"encryptedKeyValue"))}}(l,n),u=function(e){const t=yB(e,"keyData");if(!t)throw new Ab("EncryptionInfo missing keyData.");return{saltValue:EB(vB(t,"saltValue")),hashAlgorithm:bB(vB(t,"hashAlgorithm")),keyBytes:parseInt(vB(t,"keyBits"),10)/8,blockSize:parseInt(vB(t,"blockSize"),10)}}(l),f=await async function(e,t){const n=await aB(e,t.saltValue,t.spinCount,t.hashAlgorithm),r=await sB(n,_C,t.keyBytes,t.hashAlgorithm),i=await sB(n,XC,t.keyBytes,t.hashAlgorithm),o=await sB(n,KC,t.keyBytes,t.hashAlgorithm),a=await pB(r,t.saltValue,t.encryptedVerifierHashInput),s=await pB(i,t.saltValue,t.encryptedVerifierHashValue),l=await fB(t.hashAlgorithm,a),c=Math.min(l.length,s.length);if(!function(e,t){if(e.length!==t.length)return!1;let n=0;for(let r=0;r<e.length;r++)n|=e[r]^t[r];return 0===n}(l.subarray(0,c),s.subarray(0,c)))return null;const u=await pB(o,t.saltValue,t.encryptedKeyValue);return u.subarray(0,t.keyBytes)}(t,c);if(!f)throw new Ab("Incorrect password.");return await async function(e,t,n,r){const i=yB(e,"dataIntegrity");if(!i)return;if("SHA-512"!==r.hashAlgorithm)return;const o=EB(vB(i,"encryptedHmacKey")),a=EB(vB(i,"encryptedHmacValue"));if(0===o.length||0===a.length)return;const s=await lB(r.saltValue,ZC,r.hashAlgorithm,r.blockSize),l=await lB(r.saltValue,eB,r.hashAlgorithm,r.blockSize),c=await pB(n,s,o),u=await pB(n,l,a),f=await mB(c,t),d=Math.min(f.length,u.length);let h=0===f.length?1:0;for(let e=0;e<d;e++)h|=f[e]^u[e];if(0!==h)throw new Ab("Encrypted package failed integrity check (HMAC mismatch).")}(l,o,f,u),async function(e,t,n){const r=Number(new DataView(e.buffer,e.byteOffset,8).getBigUint64(0,!0)),i=e.subarray(8),o=new Uint8Array(Math.ceil(i.length/tB)*tB),a=new Uint8Array(4),s=new DataView(a.buffer);let l=0,c=0;for(;l<i.length;){const e=i.subarray(l,Math.min(l+tB,i.length));s.setUint32(0,c,!0);const r=cB(await fB(n.hashAlgorithm,xB([n.saltValue,a])),n.blockSize),u=await pB(t,r,e);o.set(u,l),l+=tB,c++}return o.subarray(0,r)}(o,f,u)}async function iB(e,t,n){const r=n?.spinCount??1e5,i="SHA-512",o=32,a=16,s=wB(16),l=wB(16),c=wB(o),u=await aB(t,l,r,i),f=wB(a),d=await fB(i,f),h=await sB(u,_C,o,i),p=await sB(u,XC,o,i),g=await sB(u,KC,o,i),m=await gB(h,l,f),y=await gB(p,l,IB(d,a)),v=await gB(g,l,c),A=await async function(e,t,n){const r=new Uint8Array(8);new DataView(r.buffer).setBigUint64(0,BigInt(e.length),!0);const i=IB(e,tB),o=new Uint8Array(i.length),a=new Uint8Array(4),s=new DataView(a.buffer);let l=0,c=0;for(;l<i.length;){const e=i.subarray(l,l+tB);s.setUint32(0,c,!0);const r=cB(await fB(n.hashAlgorithm,xB([n.saltValue,a])),n.blockSize),u=await gB(t,r,e);o.set(u,l),l+=tB,c++}return xB([r,o])}(e,c,{saltValue:s,hashAlgorithm:i,keyBytes:o,blockSize:a}),b=wB(64),w=await lB(s,ZC,i,a),I=await gB(c,w,IB(b,a)),x=await mB(b,A),C=await lB(s,eB,i,a),B=function(e){const t=BB;return`<?xml version="1.0" encoding="UTF-8" standalone="yes"?><encryption xmlns="http://schemas.microsoft.com/office/2006/encryption" xmlns:p="http://schemas.microsoft.com/office/2006/keyEncryptor/password"><keyData saltSize="${e.keyDataSalt.length}" blockSize="${e.blockSize}" keyBits="${e.keyBits}" hashSize="${e.hashSize}" cipherAlgorithm="AES" cipherChaining="ChainingModeCBC" hashAlgorithm="SHA512" saltValue="${t(e.keyDataSalt)}"/><dataIntegrity encryptedHmacKey="${t(e.encryptedHmacKey)}" encryptedHmacValue="${t(e.encryptedHmacValue)}"/><keyEncryptors><keyEncryptor uri="http://schemas.microsoft.com/office/2006/keyEncryptor/password"><p:encryptedKey spinCount="${e.spinCount}" saltSize="${e.pwSalt.length}" blockSize="${e.blockSize}" keyBits="${e.keyBits}" hashSize="${e.hashSize}" cipherAlgorithm="AES" cipherChaining="ChainingModeCBC" hashAlgorithm="SHA512" saltValue="${t(e.pwSalt)}" encryptedVerifierHashInput="${t(e.encryptedVerifierHashInput)}" encryptedVerifierHashValue="${t(e.encryptedVerifierHashValue)}" encryptedKeyValue="${t(e.encryptedKeyValue)}"/></keyEncryptor></keyEncryptors></encryption>`}({keyDataSalt:s,pwSalt:l,spinCount:r,keyBits:256,hashSize:64,blockSize:a,encryptedVerifierHashInput:m,encryptedVerifierHashValue:y,encryptedKeyValue:v,encryptedHmacKey:I,encryptedHmacValue:await gB(c,C,IB(x,a))}),E=new Uint8Array(8),k=new DataView(E.buffer);k.setUint16(0,4,!0),k.setUint16(2,4,!0),k.setUint32(4,64,!0);return WC([{name:"EncryptionInfo",data:xB([E,(new TextEncoder).encode(B)])},{name:"EncryptedPackage",data:A}])}function oB(e){const t=new Uint8Array(2*e.length),n=new DataView(t.buffer);for(let t=0;t<e.length;t++)n.setUint16(2*t,e.charCodeAt(t),!0);return t}async function aB(e,t,n,r){let i=await fB(r,xB([t,oB(e)]));const o=new Uint8Array(4),a=new DataView(o.buffer);for(let e=0;e<n;e++)a.setUint32(0,e,!0),i=await fB(r,xB([o,i]));return i}async function sB(e,t,n,r){return function(e,t){if(e.length>=t)return e.subarray(0,t);const n=new Uint8Array(t).fill(54);return n.set(e,0),n}(await fB(r,xB([e,t])),n)}async function lB(e,t,n,r){return cB(await fB(n,xB([e,t])),r)}function cB(e,t){if(e.length>=t)return e.subarray(0,t);const n=new Uint8Array(t).fill(54);return n.set(e,0),n}const uB=e=>e;async function fB(e,t){return new Uint8Array(await crypto.subtle.digest(e,uB(t)))}async function dB(e){return crypto.subtle.importKey("raw",uB(e),{name:"AES-CBC"},!1,["encrypt","decrypt"])}async function hB(e,t,n){if(0===n.length)return new Uint8Array(0);const r=n.subarray(n.length-16),i=new Uint8Array(16);for(let e=0;e<16;e++)i[e]=16^r[e];const o=await async function(e,t){return new Uint8Array(await crypto.subtle.encrypt({name:"AES-CBC",iv:uB(nB)},e,uB(t))).subarray(0,16)}(e,i),a=xB([n,o]);return new Uint8Array(await crypto.subtle.decrypt({name:"AES-CBC",iv:uB(t)},e,uB(a))).subarray(0,n.length)}async function pB(e,t,n){return hB(await dB(e),t,n)}async function gB(e,t,n){return async function(e,t,n){return 0===n.length?new Uint8Array(0):new Uint8Array(await crypto.subtle.encrypt({name:"AES-CBC",iv:uB(t)},e,uB(n))).subarray(0,n.length)}(await dB(e),t,n)}async function mB(e,t){const n=await crypto.subtle.importKey("raw",uB(e),{name:"HMAC",hash:"SHA-512"},!1,["sign"]);return new Uint8Array(await crypto.subtle.sign("HMAC",n,uB(t)))}function yB(e,t){const n=new RegExp(`<(?:\\w+:)?${t}\\b[^>]*?/?>`).exec(e);return n?n[0]:null}function vB(e,t){const n=new RegExp(`\\b${t}="([^"]*)"`).exec(e);return n?n[1]:""}const AB={SHA512:"SHA-512",SHA384:"SHA-384",SHA256:"SHA-256",SHA1:"SHA-1"};function bB(e){return AB[e]??"SHA-512"}function wB(e){const t=new Uint8Array(e);return crypto.getRandomValues(t),t}function IB(e,t){if(e.length%t===0)return e;const n=new Uint8Array(Math.ceil(e.length/t)*t);return n.set(e,0),n}function xB(e){let t=0;for(const n of e)t+=n.length;const n=new Uint8Array(t);let r=0;for(const t of e)n.set(t,r),r+=t.length;return n}const CB="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";function BB(e){let t="",n=0;for(;n+2<e.length;n+=3){const r=e[n]<<16|e[n+1]<<8|e[n+2];t+=CB[r>>18&63]+CB[r>>12&63]+CB[r>>6&63]+CB[63&r]}if(n<e.length){if(1===e.length-n){const r=e[n]<<16;t+=CB[r>>18&63]+CB[r>>12&63]+"=="}else{const r=e[n]<<16|e[n+1]<<8;t+=CB[r>>18&63]+CB[r>>12&63]+CB[r>>6&63]+"="}}return t}function EB(e){const t=e.replace(/[^A-Za-z0-9+/]/g,""),n=Math.floor(3*t.length/4),r=new Uint8Array(n);let i=0,o=0,a=0;for(let e=0;e<t.length;e++)o=o<<6|CB.indexOf(t[e]),i+=6,i>=8&&(i-=8,r[a++]=o>>i&255);return r.subarray(0,a)}function kB(e){let t=0;return new ReadableStream({pull(n){if(t>=e.length)return void n.close();const r=Math.min(t+1048576,e.length);n.enqueue(e.subarray(t,r)),t=r}})}const SB=(()=>{const e=new Uint32Array(256);for(let t=0;t<256;t++){let n=t;for(let e=0;e<8;e++)n=1&n?3988292384^n>>>1:n>>>1;e[t]=n}return e})();function FB(e){return t=function(e,t){let n=e;for(let e=0;e<t.length;e++)n=SB[255&(n^t[e])]^n>>>8;return n>>>0}(4294967295,e),(4294967295^t)>>>0;var t}class DB{data;pos=0;bitBuf=0;bitCount=0;constructor(e){this.data=e}readBits(e){for(;this.bitCount<e;){if(this.pos>=this.data.length)throw new gb("Unexpected end of DEFLATE data");this.bitBuf|=this.data[this.pos++]<<this.bitCount,this.bitCount+=8}const t=this.bitBuf&(1<<e)-1;return this.bitBuf>>>=e,this.bitCount-=e,t}alignToByte(){this.bitBuf=0,this.bitCount=0}readByte(){if(this.pos>=this.data.length)throw new gb("Unexpected end of DEFLATE data");return this.data[this.pos++]}readUint16LE(){return this.readByte()|this.readByte()<<8}get offset(){return this.pos}get available(){return this.pos<this.data.length||this.bitCount>0}}function NB(e,t){const n=new Uint16Array(16);for(let r=0;r<t;r++)e[r]&&n[e[r]]++;const r=new Uint16Array(16);for(let e=1;e<15;e++)r[e+1]=r[e]+n[e];const i=r[15]+n[15],o=new Uint16Array(i);for(let n=0;n<t;n++)e[n]&&(o[r[e[n]]++]=n);return{counts:n,symbols:o}}function MB(e,t){let n=0,r=0,i=0;for(let o=1;o<=15;o++){n|=e.readBits(1);const a=t.counts[o];if(n<r+a)return t.symbols[i+(n-r)];i+=a,r=r+a<<1,n<<=1}throw new gb("Invalid Huffman code")}const QB=(()=>{const e=new Uint8Array(288);for(let t=0;t<=143;t++)e[t]=8;for(let t=144;t<=255;t++)e[t]=9;for(let t=256;t<=279;t++)e[t]=7;for(let t=280;t<=287;t++)e[t]=8;return NB(e,288)})(),TB=(()=>{const e=new Uint8Array(32);for(let t=0;t<32;t++)e[t]=5;return NB(e,32)})(),LB=[3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258],RB=[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],UB=[1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577],HB=[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],qB=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15];function OB(e,t=2147483648){const n=new DB(e);let r=new Uint8Array(3*e.length||1024),i=0;function o(e){if(i+e>t)throw new gb(`Decompressed size exceeds limit of ${t} bytes (possible zip bomb)`);if(i+e>r.length){let n=2*r.length;for(;i+e>n;)n*=2;n>t&&(n=t);const o=new Uint8Array(n);o.set(r),r=o}}function a(e){o(1),r[i++]=e}function s(e,t){o(t);let n=i-e;for(let e=0;e<t;e++)r[i++]=r[n++]}function l(e,t){for(;;){const r=MB(n,e);if(r<256)a(r);else{if(256===r)return;{const e=r-257,i=LB[e]+n.readBits(RB[e]),o=MB(n,t);s(UB[o]+n.readBits(HB[o]),i)}}}}let c=0;do{c=n.readBits(1);const e=n.readBits(2);if(0===e){n.alignToByte();const e=n.readUint16LE();n.readUint16LE(),o(e);for(let t=0;t<e;t++)r[i++]=n.readByte()}else if(1===e)l(QB,TB);else{if(2!==e)throw new gb(`Invalid DEFLATE block type: ${e}`);{const e=n.readBits(5)+257,t=n.readBits(5)+1,r=n.readBits(4)+4,i=new Uint8Array(19);for(let e=0;e<r;e++)i[qB[e]]=n.readBits(3);const o=NB(i,19),a=e+t,s=new Uint8Array(a);let c=0;for(;c<a;){const e=MB(n,o);if(e<16)s[c++]=e;else if(16===e){const e=n.readBits(2)+3,t=c>0?s[c-1]:0;for(let n=0;n<e;n++)s[c++]=t}else if(17===e){const e=n.readBits(3)+3;for(let t=0;t<e;t++)s[c++]=0}else if(18===e){const e=n.readBits(7)+11;for(let t=0;t<e;t++)s[c++]=0}}const u=s.subarray(0,e),f=s.subarray(e,e+t);l(NB(u,e),NB(f,t))}}}while(0===c);return r.subarray(0,i)}function PB(e){return 0===e.length?new Uint8Array([3,0]):e.length<=64?function(e){const t=[];let n=0;for(;n<e.length;){const r=e.length-n,i=Math.min(r,65535),o=n+i>=e.length,a=new Uint8Array(5+i);a[0]=o?1:0,a[1]=255&i,a[2]=i>>8&255,a[3]=255&~i,a[4]=~i>>8&255,a.set(e.subarray(n,n+i),5),t.push(a),n+=i}const r=t.reduce((e,t)=>e+t.length,0),i=new Uint8Array(r);let o=0;for(const e of t)i.set(e,o),o+=e.length;return i}(e):function(e){let t=new Uint8Array(e.length+512),n=0,r=0,i=0;function o(e){if(n+e>t.length){let r=2*t.length;for(;n+e>r;)r*=2;const i=new Uint8Array(r);i.set(t),t=i}}function a(e,a){for(r|=e<<i,i+=a;i>=8;)o(1),t[n++]=255&r,r>>>=8,i-=8}function s(){i>0&&(o(1),t[n++]=255&r,r=0,i=0)}function l(e){e<=143?a(zB(48+e,8),8):e<=255?a(zB(e-144+400,9),9):e<=279?a(zB(e-256,7),7):a(zB(e-280+192,8),8)}function c(e){a(zB(e,5),5)}a(1,1),a(1,2);const u=32768,f=258,d=3,h=32768,p=h-1,g=new Int32Array(h).fill(-1),m=new Int32Array(u);function y(t){return t+2>=e.length?0:(e[t]<<10^e[t+1]<<5^e[t+2])&p}let v=0;for(;v<e.length;){if(v+d>e.length){l(e[v]),v++;continue}const t=y(v);let n=d-1,r=0,i=g[t],o=0;const s=128,h=Math.max(0,v-u);for(;i>=h&&o<s;){const t=v-i;if(t>0&&t<=u){let o=0;const a=Math.min(f,e.length-v);for(;o<a&&e[i+o]===e[v+o];)o++;if(o>n&&(n=o,r=t,o===f))break}i=m[i&u-1],o++}if(m[v&u-1]=g[t],g[t]=v,n>=d){const t=$B(n);l(t+257),a(n-LB[t],RB[t]);const i=jB(r);c(i),a(r-UB[i],HB[i]);for(let t=1;t<n;t++){const n=v+t;if(n+d<=e.length){const e=y(n);m[n&u-1]=g[e],g[e]=n}}v+=n}else l(e[v]),v++}return l(256),s(),t.subarray(0,n)}(e)}function zB(e,t){let n=0;for(let r=0;r<t;r++)n=n<<1|1&e,e>>=1;return n}function $B(e){for(let t=LB.length-1;t>=0;t--)if(e>=LB[t])return t;return 0}function jB(e){for(let t=UB.length-1;t>=0;t--)if(e>=UB[t])return t;return 0}let VB,YB;function GB(){if(void 0===YB)try{new DecompressionStream("deflate-raw"),YB="undefined"!=typeof ReadableStream}catch{YB=!1}return YB}const WB=67324752,JB=4294967295;class _B{data;view;centralDir=[];entryMap=new Map;maxDecompressedBytes;constructor(e,t=2147483648){if(this.data=e,this.maxDecompressedBytes=t,e.length<22)throw new gb("Data too small to be a valid ZIP archive");this.view=new DataView(e.buffer,e.byteOffset,e.byteLength),this.readEndOfCentralDir()}entries(){return this.centralDir.map(e=>e.fileName)}has(e){return this.entryMap.has(e)}declaredSize(e){const t=this.entryMap.get(e);if(!t?.uncompressedSize)return;const n=0===t.compressionMethod?t.compressedSize:1032*t.compressedSize;return t.compressedSize>0&&t.uncompressedSize>n?void 0:t.uncompressedSize}async extract(e){const t=this.entryMap.get(e);if(!t)throw new gb(`Entry not found: ${e}`);return this.extractEntry(t)}extractStream(e){const t=this.entryMap.get(e);if(!t)throw new gb(`Entry not found: ${e}`);return this.extractEntryStream(t)}async extractAll(){const e=new Map;for(const t of this.centralDir){if(t.fileName.endsWith("/"))continue;const n=await this.extractEntry(t);e.set(t.fileName,n)}return e}readEndOfCentralDir(){const e=Math.max(0,this.data.length-65557);let t=-1;for(let n=this.data.length-22;n>=e;n--)if(101010256===this.view.getUint32(n,!0)){t=n;break}if(-1===t)throw new gb("End of Central Directory not found — not a valid ZIP file");let n=this.view.getUint32(t+12,!0),r=this.view.getUint32(t+16,!0),i=this.view.getUint16(t+10,!0);if(65535===i||n===JB||r===JB){const e=this.readZip64EndOfCentralDir(t);i=e.entryCount,n=e.centralDirSize,r=e.centralDirOffset}this.readCentralDirectory(r,n,i)}readZip64EndOfCentralDir(e){const t=e-20;if(t<0||117853008!==this.view.getUint32(t,!0))throw new gb("ZIP64 End of Central Directory locator not found");const n=this.readUint64(t+8,"ZIP64 EOCD offset");if(n+56>this.data.length)throw new gb("ZIP64 End of Central Directory record extends beyond file");if(101075792!==this.view.getUint32(n,!0))throw new gb("Invalid ZIP64 End of Central Directory signature");return{entryCount:this.readUint64(n+32,"ZIP64 entry count"),centralDirSize:this.readUint64(n+40,"ZIP64 central directory size"),centralDirOffset:this.readUint64(n+48,"ZIP64 central directory offset")}}readUint64(e,t){if(e+8>this.data.length)throw new gb(`${t} extends beyond file`);const n=this.view.getBigUint64(e,!0);if(n>BigInt(Number.MAX_SAFE_INTEGER))throw new gb(`${t} (${n}) exceeds the addressable range`);return Number(n)}readCentralDirectory(e,t,n){let r=e;for(let e=0;e<n;e++){if(r+46>this.data.length)throw new gb("Central Directory entry extends beyond file");const e=this.view.getUint32(r,!0);if(33639248!==e)throw new gb(`Invalid Central Directory signature at offset ${r}: 0x${e.toString(16)}`);const t=this.view.getUint16(r+8,!0),n=this.view.getUint16(r+10,!0),i=this.view.getUint32(r+16,!0);let o=this.view.getUint32(r+20,!0),a=this.view.getUint32(r+24,!0);const s=this.view.getUint16(r+28,!0),l=this.view.getUint16(r+30,!0),c=this.view.getUint16(r+32,!0);let u=this.view.getUint32(r+42,!0);const f=this.data.subarray(r+46,r+46+s),d=(new TextDecoder).decode(f);if(o===JB||a===JB||u===JB){const e=this.readZip64Extra(r+46+s,l,a===JB,o===JB,u===JB,d);void 0!==e.uncompressedSize&&(a=e.uncompressedSize),void 0!==e.compressedSize&&(o=e.compressedSize),void 0!==e.localHeaderOffset&&(u=e.localHeaderOffset)}const h={fileName:d,compressionMethod:n,compressedSize:o,uncompressedSize:a,crc32:i,localHeaderOffset:u,hasDataDescriptor:!!(8&t)};this.centralDir.push(h),this.entryMap.set(d,h),r+=46+s+l+c}}readZip64Extra(e,t,n,r,i,o){const a=Math.min(e+t,this.data.length);let s=e;for(;s+4<=a;){const e=this.view.getUint16(s,!0),t=this.view.getUint16(s+2,!0),a=s+4;if(1!==e){s=a+t;continue}const l=a+t;let c=a;const u={},f=e=>{if(c+8>l)throw new gb(`Truncated ZIP64 extra field for entry: ${o}`);const t=this.readUint64(c,e);return c+=8,t};return n&&(u.uncompressedSize=f("ZIP64 uncompressed size")),r&&(u.compressedSize=f("ZIP64 compressed size")),i&&(u.localHeaderOffset=f("ZIP64 local header offset")),u}throw new gb(`Missing ZIP64 extra field for entry: ${o}`)}async extractEntry(e){const t=e.localHeaderOffset;if(t+30>this.data.length)throw new gb("Local file header extends beyond file");if(this.view.getUint32(t,!0)!==WB)throw new gb(`Invalid local file header signature at offset ${t}`);const n=t+30+this.view.getUint16(t+26,!0)+this.view.getUint16(t+28,!0);let{compressedSize:r,uncompressedSize:i,crc32:o}=e;if(e.hasDataDescriptor&&0===r){const e=this.view.getUint32(t+18,!0);e>0&&e!==JB&&(r=e);const a=this.view.getUint32(t+22,!0);if(a>0&&a!==JB&&(i=a),0===r){const e=this.findDataDescriptor(n);e&&(o=e.crc,r=e.compressedSize,i=e.uncompressedSize)}}if(n+r>this.data.length)throw new gb(`Compressed data extends beyond file for entry: ${e.fileName}`);const a=this.data.subarray(n,n+r);let s;if(0===e.compressionMethod)s=a;else{if(8!==e.compressionMethod)throw new gb(`Unsupported compression method ${e.compressionMethod} for entry: ${e.fileName}`);if(0===r&&0===i)s=new Uint8Array(0);else{const e=i>0?Math.min(i,this.maxDecompressedBytes):this.maxDecompressedBytes;s=await async function(e,t=2147483648){if(GB())try{const n=new DecompressionStream("deflate-raw"),r=n.writable.getWriter(),i=n.readable.getReader();r.write(e).catch(()=>{}),r.close().catch(()=>{});const o=[];let a=0;for(;;){const{done:e,value:n}=await i.read();if(e)break;if(a+=n.length,a>t){try{await i.cancel()}catch{}throw new gb(`Decompressed size exceeds limit of ${t} bytes (possible zip bomb)`)}o.push(n)}const s=new Uint8Array(a);let l=0;for(const e of o)s.set(e,l),l+=e.length;return s}catch(e){if(e instanceof gb)throw e}return OB(e,t)}(a,e)}}if(0!==o&&s.length>0){const t=FB(s);if(t!==o)throw new gb(`CRC-32 mismatch for ${e.fileName}: expected 0x${o.toString(16)}, got 0x${t.toString(16)}`)}return s}extractEntryStream(e){const t=e.localHeaderOffset;if(t+30>this.data.length)throw new gb("Local file header extends beyond file");if(this.view.getUint32(t,!0)!==WB)throw new gb(`Invalid local file header signature at offset ${t}`);const n=t+30+this.view.getUint16(t+26,!0)+this.view.getUint16(t+28,!0);let{compressedSize:r}=e;if(e.hasDataDescriptor&&0===r){const e=this.view.getUint32(t+18,!0);if(e>0&&e!==JB&&(r=e),0===r){const e=this.findDataDescriptor(n);e&&(r=e.compressedSize)}}if(n+r>this.data.length)throw new gb(`Compressed data extends beyond file for entry: ${e.fileName}`);const i=this.data.subarray(n,n+r);if(0===e.compressionMethod)return kB(i);if(8===e.compressionMethod){if(0===r&&0===e.uncompressedSize)return new ReadableStream({start(e){e.close()}});const t=e.uncompressedSize>0?Math.min(e.uncompressedSize,this.maxDecompressedBytes):this.maxDecompressedBytes;if(GB()){return new ReadableStream({start(e){e.enqueue(i),e.close()}}).pipeThrough(new DecompressionStream("deflate-raw")).pipeThrough(function(e){let t=0;return new TransformStream({transform(n,r){if(t+=n.length,t>e)throw new gb(`Decompressed size exceeds limit of ${e} bytes (possible zip bomb)`);r.enqueue(n)}})}(t))}return kB(OB(i,t))}throw new gb(`Unsupported compression method ${e.compressionMethod} for entry: ${e.fileName}`)}findDataDescriptor(e){for(let t=e;t<this.data.length-16;t++)if(134695760===this.view.getUint32(t,!0))return{crc:this.view.getUint32(t+4,!0),compressedSize:this.view.getUint32(t+8,!0),uncompressedSize:this.view.getUint32(t+12,!0)};return null}}function XB(e){const t=[];let n=null;for(const r of e.children){if("string"==typeof r)continue;const e=r.local||r.tag;"t"===e?n=KB(r):"r"===e&&t.push(r)}if(0===t.length)return{text:Eb(n??"")};const r=[],i=[];for(const e of t){let t,n="";for(const r of e.children){if("string"==typeof r)continue;const e=r.local||r.tag;"t"===e?n=KB(r):"rPr"===e&&(t=ZB(r))}const o=Eb(n);i.push(o),r.push(t?{text:o,font:t}:{text:o})}return{text:i.join(""),richText:r}}function KB(e){return e.text??""}function ZB(e){const t={};for(const n of e.children){if("string"==typeof n)continue;switch(n.local||n.tag){case"b":t.bold="0"!==n.attrs.val&&"false"!==n.attrs.val;break;case"i":t.italic="0"!==n.attrs.val&&"false"!==n.attrs.val;break;case"u":{const e=n.attrs.val;t.underline="double"===e?"double":"singleAccounting"===e?"singleAccounting":"doubleAccounting"!==e||"doubleAccounting";break}case"strike":t.strikethrough="0"!==n.attrs.val&&"false"!==n.attrs.val;break;case"sz":n.attrs.val&&(t.size=Number(n.attrs.val));break;case"rFont":n.attrs.val&&(t.name=n.attrs.val);break;case"color":if(t.color={},n.attrs.rgb){const e=n.attrs.rgb;t.color.rgb=8===e.length?e.slice(2):e}n.attrs.theme&&(t.color.theme=Number(n.attrs.theme)),n.attrs.tint&&(t.color.tint=Number(n.attrs.tint)),n.attrs.indexed&&(t.color.indexed=Number(n.attrs.indexed));break;case"vertAlign":"superscript"!==n.attrs.val&&"subscript"!==n.attrs.val||(t.vertAlign=n.attrs.val);break;case"family":n.attrs.val&&(t.family=Number(n.attrs.val));break;case"charset":n.attrs.val&&(t.charset=Number(n.attrs.val));break;case"scheme":"major"!==n.attrs.val&&"minor"!==n.attrs.val&&"none"!==n.attrs.val||(t.scheme=n.attrs.val)}}return t}const eE=Date.UTC(1899,11,31),tE=Date.UTC(1904,0,1),nE=864e5;function rE(e,t){const n=e.getTime();if(t)return(n-tE)/nE;let r=(n-eE)/nE;return r>=60&&(r+=1),Math.round(1e10*r)/1e10}const iE=new Set([14,15,16,17,18,19,20,21,22,27,28,29,30,31,32,33,34,35,36,45,46,47,50,51,52,53,54,55,56,57,58]);function oE(e){if(!e)return!1;const t=Number(e);if(!Number.isNaN(t)&&Number.isInteger(t)&&iE.has(t))return!0;let n=e.replace(/\[[$\-\w]*\]/g,"");if(n=n.replace(/\\./g,""),n=n.replace(/"[^"]*"/g,""),n=n.replace(/[*_]./g,""),/^(General|@)$/i.test(n.trim()))return!1;const r=n.toLowerCase();if(/[hs]/.test(r)){if(/\bh{1,2}\b|(?:^|[^a-z])h{1,2}(?:[^a-z]|$)/i.test(r))return!0;if(/\bs{1,2}\b|(?:^|[^a-z])s{1,2}(?:[^a-z]|$)/i.test(r))return!0}return!!/am\/pm|a\/p/i.test(r)||(!!/\[h+\]|\[m+\]|\[s+\]/i.test(e)||(!!/y{1,4}/.test(r)||(!!/d{1,4}/.test(r)||!!/m{3,}/.test(r))))}const aE=["January","February","March","April","May","June","July","August","September","October","November","December"],sE=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],lE=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],cE=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"];const uE=["000000","FFFFFF","FF0000","00FF00","0000FF","FFFF00","FF00FF","00FFFF","000000","FFFFFF","FF0000","00FF00","0000FF","FFFF00","FF00FF","00FFFF","800000","008000","000080","808000","800080","008080","C0C0C0","808080","9999FF","993366","FFFFCC","CCFFFF","660066","FF8080","0066CC","CCCCFF","000080","FF00FF","FFFF00","00FFFF","800080","800000","008080","0000FF","00CCFF","CCFFFF","CCFFCC","FFFF99","99CCFF","FF99CC","CC99FF","FFCC99","3366FF","33CCCC","99CC00","FFCC00","FF9900","FF6600","666699","969696","003366","339966","003300","333300","993300","993366","333399","333333"],fE="http://schemas.microsoft.com/office/spreadsheetml/2022/featurepropertybag",dE="{C7286773-470A-42A8-94C5-96B5CB345126}",hE="xl/featurePropertyBag/featurePropertyBag.xml";const pE={0:"General",1:"0",2:"0.00",3:"#,##0",4:"#,##0.00",5:"$#,##0_);\\($#,##0\\)",6:"$#,##0_);[Red]\\($#,##0\\)",7:"$#,##0.00_);\\($#,##0.00\\)",8:"$#,##0.00_);[Red]\\($#,##0.00\\)",9:"0%",10:"0.00%",11:"0.00E+00",12:"# ?/?",13:"# ??/??",14:"m/d/yyyy",15:"d-mmm-yy",16:"d-mmm",17:"mmm-yy",18:"h:mm AM/PM",19:"h:mm:ss AM/PM",20:"h:mm",21:"h:mm:ss",22:"m/d/yyyy h:mm",37:"#,##0 ;(#,##0)",38:"#,##0 ;[Red](#,##0)",39:"#,##0.00;(#,##0.00)",40:"#,##0.00;[Red](#,##0.00)",45:"mm:ss",46:"[h]:mm:ss",47:"mmss.0",48:"##0.0E+0",49:"@"};function gE(e){const t=Lb(e),n=new Map,r=[],i=[],o=[],a=[],s=[];for(const e of t.children){if("string"==typeof e)continue;switch(e.local||e.tag){case"numFmts":yE(e,n);break;case"fonts":vE(e,r);break;case"fills":wE(e,i);break;case"borders":BE(e,o);break;case"cellXfs":SE(e,a);break;case"dxfs":DE(e,s)}}const l=function(e){for(const t of e.children)if("string"!=typeof t&&"colors"===(t.local||t.tag))for(const e of t.children){if("string"==typeof e)continue;if("indexedColors"!==(e.local||e.tag))continue;const t=[];for(const n of e.children){if("string"==typeof n)continue;if("rgbColor"!==(n.local||n.tag))continue;const e=n.attrs.rgb;e&&t.push(8===e.length?e.slice(2):e)}if(t.length>0)return t}return uE}(t);for(const e of[r,i,o,s])mE(e,l);return{numFmts:n,fonts:r,fills:i,borders:o,cellXfs:a,dxfs:s}}function mE(e,t){if(null===e||"object"!=typeof e)return;if(Array.isArray(e)){for(const n of e)mE(n,t);return}const n=e;if("number"==typeof n.indexed&&"string"!=typeof n.rgb){const e=t[n.indexed];e&&(n.rgb=e)}for(const e of Object.values(n))mE(e,t)}function yE(e,t){for(const n of e.children){if("string"==typeof n)continue;if("numFmt"===(n.local||n.tag)){const e=Number(n.attrs.numFmtId),r=n.attrs.formatCode??"";Number.isNaN(e)||t.set(e,r)}}}function vE(e,t){for(const n of e.children){if("string"==typeof n)continue;"font"===(n.local||n.tag)&&t.push(AE(n))}}function AE(e){const t={};for(const n of e.children){if("string"==typeof n)continue;switch(n.local||n.tag){case"b":t.bold="0"!==n.attrs.val&&"false"!==n.attrs.val;break;case"i":t.italic="0"!==n.attrs.val&&"false"!==n.attrs.val;break;case"u":{const e=n.attrs.val;t.underline="double"===e?"double":"singleAccounting"===e?"singleAccounting":"doubleAccounting"!==e||"doubleAccounting";break}case"strike":t.strikethrough="0"!==n.attrs.val&&"false"!==n.attrs.val;break;case"sz":n.attrs.val&&(t.size=Number(n.attrs.val));break;case"name":n.attrs.val&&(t.name=n.attrs.val);break;case"color":t.color=bE(n);break;case"vertAlign":"superscript"!==n.attrs.val&&"subscript"!==n.attrs.val||(t.vertAlign=n.attrs.val);break;case"family":n.attrs.val&&(t.family=Number(n.attrs.val));break;case"charset":n.attrs.val&&(t.charset=Number(n.attrs.val));break;case"scheme":"major"!==n.attrs.val&&"minor"!==n.attrs.val&&"none"!==n.attrs.val||(t.scheme=n.attrs.val)}}return t}function bE(e){const t={};if(e.attrs.rgb){const n=e.attrs.rgb;t.rgb=8===n.length?n.slice(2):n}return e.attrs.theme&&(t.theme=Number(e.attrs.theme)),e.attrs.tint&&(t.tint=Number(e.attrs.tint)),e.attrs.indexed&&(t.indexed=Number(e.attrs.indexed)),t}function wE(e,t){for(const n of e.children){if("string"==typeof n)continue;"fill"===(n.local||n.tag)&&t.push(IE(n))}}function IE(e){for(const t of e.children){if("string"==typeof t)continue;const e=t.local||t.tag;if("patternFill"===e)return xE(t);if("gradientFill"===e)return CE(t)}return{type:"pattern",pattern:"none"}}function xE(e){const t={type:"pattern",pattern:e.attrs.patternType??"none"};for(const n of e.children){if("string"==typeof n)continue;const e=n.local||n.tag;"fgColor"===e?t.fgColor=bE(n):"bgColor"===e&&(t.bgColor=bE(n))}return t}function CE(e){const t=e.attrs.degree?Number(e.attrs.degree):void 0,n=[];for(const t of e.children){if("string"==typeof t)continue;if("stop"===(t.local||t.tag)){const e=Number(t.attrs.position??"0");for(const r of t.children){if("string"==typeof r)continue;"color"===(r.local||r.tag)&&n.push({position:e,color:bE(r)})}}}return{type:"gradient",degree:t,stops:n}}function BE(e,t){for(const n of e.children){if("string"==typeof n)continue;"border"===(n.local||n.tag)&&t.push(EE(n))}}function EE(e){const t={},n=e.attrs.diagonalUp,r=e.attrs.diagonalDown;"1"!==n&&"true"!==n||(t.diagonalUp=!0),"1"!==r&&"true"!==r||(t.diagonalDown=!0);for(const n of e.children){if("string"==typeof n)continue;const e=n.local||n.tag,r=kE(n);if(r)switch(e){case"left":t.left=r;break;case"right":t.right=r;break;case"top":t.top=r;break;case"bottom":t.bottom=r;break;case"diagonal":t.diagonal=r}}return t}function kE(e){const t=e.attrs.style;if(!t)return;const n={style:t};for(const t of e.children){if("string"==typeof t)continue;"color"===(t.local||t.tag)&&(n.color=bE(t))}return n}function SE(e,t){for(const n of e.children){if("string"==typeof n)continue;"xf"===(n.local||n.tag)&&t.push(FE(n))}}function FE(e){const t={numFmtId:Number(e.attrs.numFmtId??"0"),fontId:Number(e.attrs.fontId??"0"),fillId:Number(e.attrs.fillId??"0"),borderId:Number(e.attrs.borderId??"0")};"1"!==e.attrs.applyNumberFormat&&"true"!==e.attrs.applyNumberFormat||(t.applyNumberFormat=!0),"1"!==e.attrs.applyFont&&"true"!==e.attrs.applyFont||(t.applyFont=!0),"1"!==e.attrs.applyFill&&"true"!==e.attrs.applyFill||(t.applyFill=!0),"1"!==e.attrs.applyBorder&&"true"!==e.attrs.applyBorder||(t.applyBorder=!0),"1"!==e.attrs.applyAlignment&&"true"!==e.attrs.applyAlignment||(t.applyAlignment=!0),"1"!==e.attrs.applyProtection&&"true"!==e.attrs.applyProtection||(t.applyProtection=!0);for(const n of e.children){if("string"==typeof n)continue;const e=n.local||n.tag;"alignment"===e?t.alignment=TE(n):"protection"===e?t.protection=QE(n):"extLst"===e&&ME(n)&&(t.hasCheckboxFeature=!0)}return t}function DE(e,t){for(const n of e.children){if("string"==typeof n)continue;"dxf"===(n.local||n.tag)&&t.push(NE(n))}}function NE(e){const t={};for(const n of e.children){if("string"==typeof n)continue;switch(n.local||n.tag){case"font":t.font=AE(n);break;case"numFmt":{const e=n.attrs.formatCode;if(e)t.numFmt=e;else{const e=Number(n.attrs.numFmtId),r=Number.isNaN(e)?void 0:pE[e];r&&(t.numFmt=r)}break}case"fill":t.fill=IE(n);break;case"border":t.border=EE(n);break;case"alignment":t.alignment=TE(n)}}return t}function ME(e){for(const t of e.children){if("string"==typeof t)continue;if("ext"===(t.local||t.tag)&&t.attrs.uri===dE)return!0}return!1}function QE(e){const t={},n=e.attrs.locked;void 0!==n&&(t.locked="1"===n||"true"===n);const r=e.attrs.hidden;return void 0!==r&&(t.hidden="1"===r||"true"===r),t}function TE(e){const t={};if(e.attrs.horizontal&&(t.horizontal=e.attrs.horizontal),e.attrs.vertical&&(t.vertical=e.attrs.vertical),"1"!==e.attrs.wrapText&&"true"!==e.attrs.wrapText||(t.wrapText=!0),"1"!==e.attrs.shrinkToFit&&"true"!==e.attrs.shrinkToFit||(t.shrinkToFit=!0),e.attrs.textRotation&&(t.textRotation=Number(e.attrs.textRotation)),e.attrs.indent&&(t.indent=Number(e.attrs.indent)),e.attrs.readingOrder){const n=Number(e.attrs.readingOrder);t.readingOrder=1===n?"ltr":2===n?"rtl":"context"}return t}function LE(e,t){const n=e.cellXfs[t];if(!n)return{};const r={};if(0!==n.numFmtId){const t=e.numFmts.get(n.numFmtId)??pE[n.numFmtId];t&&(r.numFmt=t)}return n.fontId<e.fonts.length&&0!==n.fontId&&(r.font=e.fonts[n.fontId]),n.fillId<e.fills.length&&n.fillId>1&&(r.fill=e.fills[n.fillId]),n.borderId<e.borders.length&&0!==n.borderId&&(r.border=e.borders[n.borderId]),n.alignment&&(r.alignment=n.alignment),n.protection&&(r.protection=n.protection),r}function RE(e,t){const n=e.cellXfs[t];if(!n)return!1;const r=n.numFmtId,i=e.numFmts.get(r);if(i)return oE(i);if(o=r,iE.has(o))return!0;var o;const a=pE[r];return!!a&&oE(a)}function UE(e){return void 0===e?void 0:{...e}}function HE(e){const t={...e};return e.color&&(t.color=UE(e.color)),t}function qE(e){if("gradient"===e.type)return{...e,stops:e.stops.map(e=>({...e,color:{...e.color}}))};const t={...e};return e.fgColor&&(t.fgColor=UE(e.fgColor)),e.bgColor&&(t.bgColor=UE(e.bgColor)),t}function OE(e){if(void 0===e)return;const t={...e};return e.color&&(t.color=UE(e.color)),t}function PE(e){const t={...e};for(const n of["top","right","bottom","left","diagonal"])e[n]&&(t[n]=OE(e[n]));return t}function zE(e){const t={...e};return e.font&&(t.font=HE(e.font)),e.fill&&(t.fill=qE(e.fill)),e.border&&(t.border=PE(e.border)),e.alignment&&(t.alignment={...e.alignment}),e.protection&&(t.protection={...e.protection}),t}function $E(e){return"string"==typeof e?function(e){const t=e.split(":"),n=Rk(t[0]),r=t.length>1?Rk(t[1]):n;return{startRow:n.row,startCol:n.col,endRow:r.row,endCol:r.col}}(e):e}function jE(e){return"object"==typeof e&&null!==e&&"string"==typeof e.hyperlink&&"string"==typeof e.text}function VE(e){return jE(e)?e.text:e}function YE(e){return e>=19968&&e<=40959||e>=13312&&e<=19903||e>=131072&&e<=173791||e>=63744&&e<=64255||e>=44032&&e<=55215||e>=12448&&e<=12543||e>=12352&&e<=12447||e>=12288&&e<=12351||e>=65280&&e<=65376||e>=65504&&e<=65510}function GE(e){const t=e.indexOf(".");if(-1===t)return 0;let n=0;for(let r=t+1;r<e.length&&("0"===e[r]||"#"===e[r]);r++)n++;return n}function WE(e,t){if(!t.includes(","))return e;const n=e.split(".");let r=n[0];const i=r.startsWith("-");i&&(r=r.slice(1));let o="";for(let e=0;e<r.length;e++)e>0&&(r.length-e)%3==0&&(o+=","),o+=r[e];return i&&(o="-"+o),void 0!==n[1]&&(o+="."+n[1]),o}function JE(e){let t=0;for(const n of e){const e=n.codePointAt(0);void 0!==e&&YE(e)?t+=2:t+=1}return t}function _E(e,t){if(null==e)return 0;if("boolean"==typeof e)return e?5:6;if("string"==typeof e){if(0===e.length)return 0;if(e.includes("\n")){const t=e.split("\n");let n=0;for(const e of t){const t=JE(e);t>n&&(n=t)}return n}return JE(e)}if("number"==typeof e){if(t){const n=function(e,t){const n=t.trim().split(";");let r;if(e>0?r=n[0]:e<0&&n.length>1?(r=n[1],e=Math.abs(e)):r=0===e&&n.length>2?n[2]:n[0],r=r.replace(/\[[^\]]*\]/g,""),r=r.replace(/\\./g,e=>e[1]),r=r.replace(/"([^"]*)"/g,"$1"),r.includes("%")){const t=GE(r.replace(/%/g,""));return WE((100*e).toFixed(t),r)+"%"}const i=GE(r);return WE(e.toFixed(i),r)}(e,t),r=function(e){let t=0;const n=e.split(";")[0].replace(/\[[^\]]*\]/g,"");for(let e=0;e<n.length;e++){const r=n[e];if('"'===r)for(e++;e<n.length&&'"'!==n[e];)t++,e++;else"\\"===r?(t++,e++):"$"!==r&&"€"!==r&&"£"!==r&&"¥"!==r||t++}return t}(t);return JE(n)+r}return JE(String(e))}if(e instanceof Date){if(t){const n=function(e,t,n){const r=e.getUTCFullYear(),i=e.getUTCMonth(),o=e.getUTCDate(),a=e.getUTCDay();let s=e.getUTCHours();const l=e.getUTCMinutes(),c=e.getUTCSeconds(),u=e.getUTCMilliseconds();let f="",d=s;/am\/pm|a\/p/i.test(t)&&(f=s>=12?"PM":"AM",d=s%12,0===d&&(d=12));const h=function(e){const t=[];let n=0;for(;n<e.length;){if("["===e[n]&&"$"===e[n+1]){const t=e.indexOf("]",n);if(-1!==t){n=t+1;continue}}if("["===e[n]){const r=e.indexOf("]",n);if(-1!==r){const i=e.slice(n+1,r);if(/^h+$/i.test(i)||/^m+$/i.test(i)||/^s+$/i.test(i)){t.push(e.slice(n,r+1)),n=r+1;continue}n=r+1;continue}}if('"'===e[n]){let r="";for(n++;n<e.length&&'"'!==e[n];)r+=e[n],n++;n++,t.push(r);continue}if("\\"===e[n]){n++,n<e.length&&(t.push(e[n]),n++);continue}if(/^am\/pm/i.test(e.slice(n))){t.push(e.slice(n,n+5)),n+=5;continue}if(/^a\/p/i.test(e.slice(n))){t.push(e.slice(n,n+3)),n+=3;continue}if("."===e[n]&&n+1<e.length&&"0"===e[n+1]){let r=".",i=n+1;for(;i<e.length&&"0"===e[i];)r+="0",i++;t.push(r),n=i;continue}const r=e[n].toLowerCase();if("ymdhsn".includes(r)){let i="";const o=r;for(;n<e.length&&e[n].toLowerCase()===o;)i+=e[n],n++;t.push(i);continue}t.push(e[n]),n++}return t}(t),p=void 0!==n&&n>0?n:0,g=Math.floor(24*p),m=Math.floor(24*p*60),y=Math.floor(24*p*60*60),v=Array.from({length:h.length},()=>!1);for(let e=0;e<h.length;e++){const t=h[e].toLowerCase();if("m"!==t&&"mm"!==t)continue;let n=!1;for(let t=e-1;t>=0;t--){const e=h[t].toLowerCase();if("h"===e||"hh"===e||/^\[h+\]$/.test(e)){n=!0;break}if(/^[ymdhs]+$/.test(e)||/^\[[ms]+\]$/.test(e)||"am/pm"===e||"a/p"===e)break}let r=!1;for(let t=e+1;t<h.length;t++){const e=h[t].toLowerCase();if("s"===e||"ss"===e){r=!0;break}if(/^[ymdh]+$/.test(e)||"am/pm"===e||"a/p"===e)break}v[e]=n||r}let A="";for(let e=0;e<h.length;e++){const t=h[e],n=t.toLowerCase();if(t.startsWith("[")&&t.endsWith("]")){const e=n.slice(1,-1);/^h+$/.test(e)?A+=String(g).padStart(e.length,"0"):/^m+$/.test(e)?A+=String(m).padStart(e.length,"0"):/^s+$/.test(e)&&(A+=String(y).padStart(e.length,"0"));continue}switch(n){case"yyyy":A+=String(r);break;case"yy":A+=String(r%100).padStart(2,"0");break;case"mmmm":A+=aE[i];break;case"mmm":A+=sE[i];break;case"mm":v[e]?A+=String(l).padStart(2,"0"):A+=String(i+1).padStart(2,"0");break;case"m":v[e]?A+=String(l):A+=String(i+1);break;case"dddd":A+=lE[a];break;case"ddd":A+=cE[a];break;case"dd":A+=String(o).padStart(2,"0");break;case"d":A+=String(o);break;case"hh":A+=String(d).padStart(2,"0");break;case"h":A+=String(d);break;case"ss":A+=String(c).padStart(2,"0");break;case"s":A+=String(c);break;case".0":case".00":case".000":{const e=n.length-1;A+="."+String(u).padStart(3,"0").slice(0,e)}break;case"am/pm":A+=f;break;case"a/p":A+=f.charAt(0);break;default:A+=t}}return A}(e,t);return JE(n)}return JE(`${e.getUTCFullYear()}-${String(e.getUTCMonth()+1).padStart(2,"0")}-${String(e.getUTCDate()).padStart(2,"0")}`)}return 0}function XE(e,t){const n=t?.minWidth??8,r=t?.maxWidth??255,i=t?.padding??2,o=!0===t?.font?.bold;let a=0;for(const n of e){const e=_E(n,t?.numFmt);e>a&&(a=e)}let s=1.1*a;return o&&(s*=1.05),s+=i,s=Math.ceil(2*s)/2,s<n&&(s=n),s>r&&(s=r),s}const KE="XLDAPR",ZE="{bdbb8cdc-fa1e-496e-a857-3c3f30c029c3}",ek="xl/metadata.xml";function tk(e){for(const t of Ub(e))if("extLst"===t.local)for(const e of Ub(t))if("ext"===e.local&&(e.attrs.uri??"").toLowerCase()===ZE)for(const t of Ub(e)){if("dynamicArrayProperties"!==t.local)continue;const e=t.attrs.fDynamic;return"0"!==e&&"false"!==e}return!0}function nk(e){let t=0;for(let n=e.length-1;n>=0;n--){t=t>>14&1|t<<1&32767,t^=e.charCodeAt(n)}return t=t>>14&1|t<<1&32767,t^=e.length,t^=52811,t.toString(16).toUpperCase().padStart(4,"0")}const rk=/[[\]:*?/\\]/;function ik(e,t){const n=`sheet ${t+1}`;if("string"!=typeof e||0===e.length)throw new yb(`Sheet name is empty (${n}); Excel requires a name`);if(e.length>31)throw new yb(`Sheet name "${e}" is ${e.length} characters (${n}); Excel allows at most 31`);const r=e.match(rk);if(r)throw new yb(`Sheet name "${e}" contains ${JSON.stringify(r[0])} (${n}); Excel forbids [ ] : * ? / \\ in sheet names`);if(e.startsWith("'")||e.endsWith("'"))throw new yb(`Sheet name "${e}" starts or ends with an apostrophe (${n}); Excel forbids it because it breaks quoted range references`);if("history"===e.toLowerCase())throw new yb(`Sheet name "${e}" is reserved by Excel for change tracking (${n})`)}function ok(e){return!("object"!=typeof e||null===e||e instanceof Date||Array.isArray(e)||jE(e))}function ak(e){return ok(e)?e.value??null:e}function sk(e){let t=!1;const n=e.map(e=>{const n=function(e){const t=e.rows;if(!t)return e;let n=!1;for(const e of t){for(const t of e)if(ok(t)){n=!0;break}if(n)break}if(!n)return e;const r=[],i=new Map;for(let e=0;e<t.length;e++){const n=t[e],o=[];for(let t=0;t<n.length;t++){const r=n[t];ok(r)?(i.set(`${e},${t}`,r),o.push(r.value??null)):o.push(r)}r[e]=o}if(e.cells)for(const[t,n]of e.cells)i.set(t,n);return{...e,rows:r,cells:i}}(e);return n!==e&&(t=!0),n});return t?n:e}const lk="http://schemas.openxmlformats.org/spreadsheetml/2006/main";function ck(e){!function(e){if(!Number.isInteger(e)||e<0||e>HC)throw new yb(`Column index ${e} is not a valid 0-based column (Excel allows 0..16383)`)}(e);let t="",n=e;do{t=String.fromCharCode(65+n%26)+t,n=Math.floor(n/26)-1}while(n>=0);return t}function uk(e,t){const n={r:e+1};return void 0!==t?.height&&(n.ht=t.height,n.customHeight=1),t?.hidden&&(n.hidden=1),t?.outlineLevel&&(n.outlineLevel=t.outlineLevel),t?.collapsed&&(n.collapsed=1),n}function fk(e,t){return ck(t)+(e+1)}function dk(e,t,n,r){return`${fk(e,t)}:${fk(n,r)}`}function hk(e){const t=e.hyperlink.startsWith("#")?{target:"",location:e.hyperlink.slice(1),display:e.text}:{target:e.hyperlink,display:e.text};return void 0!==e.tooltip&&(t.tooltip=e.tooltip),t}const pk="yyyy-mm-dd",gk=Object.freeze({numFmt:pk}),mk=new WeakMap,yk=new Set(["#VALUE!","#REF!","#N/A","#NAME?","#NULL!","#DIV/0!","#NUM!","#GETTING_DATA","#SPILL!","#CALC!"]);function vk(e,t,n,r,i,o,a){const s="1904"===r,l=bk(e),c=l.length;let u=0;for(const e of l)e.length>u&&(u=e.length);e.columns&&e.columns.length>u&&(u=e.columns.length);const f=[];{const t=[];if(e.view?.tabColor&&t.push(fw("tabColor",Ek(e.view.tabColor))),e.outlineProperties){const n={};void 0!==e.outlineProperties.summaryBelow&&(n.summaryBelow=e.outlineProperties.summaryBelow?1:0),void 0!==e.outlineProperties.summaryRight&&(n.summaryRight=e.outlineProperties.summaryRight?1:0),t.push(fw("outlinePr",n))}e.pageSetup?.fitToPage&&t.push(fw("pageSetUpPr",{fitToPage:1})),t.length>0&&f.push(hw("sheetPr",void 0,t))}if(c>0||u>0){const e=c>0?c-1:0,t=u>0?u-1:0;f.push(fw("dimension",{ref:dk(0,0,e,t)}))}const d=[];if(e.freezePane){const t=e.freezePane,n=fk(t.rows??0,t.columns??0),r={};t.columns&&t.columns>0&&(r.xSplit=t.columns),t.rows&&t.rows>0&&(r.ySplit=t.rows),r.topLeftCell=n,r.state="frozen";const i=t.columns&&t.columns>0,o=t.rows&&t.rows>0;r.activePane=i&&o?"bottomRight":i?"topRight":"bottomLeft",d.push(fw("pane",r))}else if(e.splitPane){const t=e.splitPane,n={},r=void 0!==t.xSplit&&t.xSplit>0,i=void 0!==t.ySplit&&t.ySplit>0;r&&(n.xSplit=t.xSplit),i&&(n.ySplit=t.ySplit),n.topLeftCell="A1",n.state="split",n.activePane=r&&i?"bottomRight":r?"topRight":"bottomLeft",d.push(fw("pane",n))}const h={workbookViewId:0};e.view&&(!1===e.view.showGridLines&&(h.showGridLines=0),!1===e.view.showRowColHeaders&&(h.showRowColHeaders=0),void 0!==e.view.zoomScale&&(h.zoomScale=e.view.zoomScale),e.view.rightToLeft&&(h.rightToLeft=1)),f.push(hw("sheetViews",void 0,[d.length>0?hw("sheetView",h,d):fw("sheetView",h)]));const p={defaultRowHeight:e.defaultRowHeight??15};if(void 0!==e.defaultRowHeight&&(p.customHeight=1),void 0!==e.defaultColWidth&&(p.defaultColWidth=e.defaultColWidth),f.push(fw("sheetFormatPr",p)),e.columns&&e.columns.length>0){const n=[];for(let r=0;r<e.columns.length;r++){const i=e.columns[r];let o=i.width;if(i.autoWidth&&void 0===o){const e=[];for(const t of l)t&&r<t.length&&t[r]&&e.push(t[r].value);o=XE(e,{font:i.style?.font,numFmt:i.numFmt??i.style?.numFmt})}const a=i.numFmt&&!i.style?.numFmt?{...i.style,numFmt:i.numFmt}:i.style??void 0,s=a?t.addStyle(a):0;if(void 0!==o||i.hidden||i.outlineLevel||i.collapsed||0!==s){const e={min:r+1,max:r+1};void 0!==o&&(e.width=o,e.customWidth=!0),0!==s&&(e.style=s),i.hidden&&(e.hidden=!0),i.outlineLevel&&(e.outlineLevel=i.outlineLevel),i.collapsed&&(e.collapsed=!0),n.push(fw("col",e))}}n.length>0&&f.push(hw("cols",void 0,n))}const g=[];let m=!1;for(let r=0;r<c;r++){const i=l[r],a=e.rowDefs?.get(r),c=a&&(void 0!==a.height||a.hidden||a.outlineLevel||a.collapsed);if(!(i&&0!==i.length||c))continue;const u=[];let f=!1;if(i)for(let e=0;e<i.length;e++){const a=i[e];if(!a)continue;a.formulaDynamic&&void 0!==a.formula&&null!==a.formula&&(m=!0);const l=Ik(r,e,a,t,n,s,o);l&&(u.push(l),f=!0)}if(f||c){const e=uk(r,a);f?g.push(hw("row",e,u)):g.push(fw("row",e))}}if(f.push(hw("sheetData",void 0,g.length>0?g:"")),e.protection&&f.push(function(e){const t={};e.password&&(t.password=nk(e.password));!1!==e.sheet&&(t.sheet=1);e.objects&&(t.objects=1);e.scenarios&&(t.scenarios=1);const n=[["selectLockedCells","selectLockedCells"],["selectUnlockedCells","selectUnlockedCells"],["formatCells","formatCells"],["formatColumns","formatColumns"],["formatRows","formatRows"],["insertColumns","insertColumns"],["insertRows","insertRows"],["insertHyperlinks","insertHyperlinks"],["deleteColumns","deleteColumns"],["deleteRows","deleteRows"],["sort","sort"],["autoFilter","autoFilter"],["pivotTables","pivotTables"]];for(const[r,i]of n){const n=e[r];void 0!==n&&"boolean"==typeof n&&(t[i]=n?0:1)}return fw("sheetProtection",t)}(e.protection)),e.autoFilter)if(e.autoFilter.columns&&e.autoFilter.columns.length>0){const t=[];for(const n of e.autoFilter.columns)if(n.filters&&n.filters.length>0){const e=n.filters.map(e=>fw("filter",{val:e}));t.push(hw("filterColumn",{colId:n.colIndex},[hw("filters",void 0,e)]))}f.push(hw("autoFilter",{ref:e.autoFilter.range},t))}else f.push(fw("autoFilter",{ref:e.autoFilter.range}));const y=function(e){if(e)return e.some(e=>"string"==typeof e)?e.map($E):e}(e.merges);if(y&&y.length>0){const e=y.map(e=>fw("mergeCell",{ref:dk(e.startRow,e.startCol,e.endRow,e.endCol)}));f.push(hw("mergeCells",{count:y.length},e))}e.conditionalRules&&e.conditionalRules.length>0&&f.push(...function(e,t){const n=new Map;for(const t of e){const e=n.get(t.range);e?e.push(t):n.set(t.range,[t])}const r=[];for(const[e,i]of n){const n=[];for(const e of i)n.push(Sk(e,t));r.push(hw("conditionalFormatting",{sqref:e},n))}return r}(e.conditionalRules,t)),e.dataValidations&&e.dataValidations.length>0&&f.push(function(e){const t=[];for(const n of e){const e={type:n.type,sqref:n.range};n.operator&&(e.operator=n.operator),n.allowBlank&&(e.allowBlank=1),n.showInputMessage&&(e.showInputMessage=1),n.showErrorMessage&&(e.showErrorMessage=1),n.errorStyle&&(e.errorStyle=n.errorStyle),n.inputTitle&&(e.promptTitle=n.inputTitle),n.inputMessage&&(e.prompt=n.inputMessage),n.errorTitle&&(e.errorTitle=n.errorTitle),n.errorMessage&&(e.error=n.errorMessage);const r=[];if("list"===n.type&&n.values&&n.values.length>0){const e=`"${n.values.join(",")}"`;r.push(hw("formula1",void 0,lw(e)))}else void 0!==n.formula1&&r.push(hw("formula1",void 0,lw(n.formula1)));void 0!==n.formula2&&r.push(hw("formula2",void 0,lw(n.formula2))),r.length>0?t.push(hw("dataValidation",e,r)):t.push(fw("dataValidation",e))}return hw("dataValidations",{count:e.length},t)}(e.dataValidations));const{xml:v,relationships:A}=function(e,t){const n=t??bk(e),r=[],i=[];let o=1;for(let e=0;e<n.length;e++){const t=n[e];for(let n=0;n<t.length;n++){const a=t[n]?.hyperlink;if(!a)continue;const s={ref:fk(e,n)};if(a.location)s.location=a.location;else if(a.target){const e="rId"+o++;s["r:id"]=e,i.push({id:e,target:a.target})}a.tooltip&&(s.tooltip=a.tooltip),a.display&&(s.display=a.display),r.push(fw("hyperlink",s))}}if(0===r.length)return{xml:"",relationships:[]};return{xml:hw("hyperlinks",void 0,r),relationships:i}}(e,l);v&&f.push(v);const b=function(e){if(!e)return"";const t={};e.showGridLines&&(t.gridLines=1);e.showRowColHeaders&&(t.headings=1);e.horizontalCentered&&(t.horizontalCentered=1);e.verticalCentered&&(t.verticalCentered=1);return 0===Object.keys(t).length?"":fw("printOptions",t)}(e.pageSetup);if(b&&f.push(b),f.push(function(e){const t=e??{};return fw("pageMargins",{left:t.left??Bk.left,right:t.right??Bk.right,top:t.top??Bk.top,bottom:t.bottom??Bk.bottom,header:t.header??Bk.header,footer:t.footer??Bk.footer})}(e.pageSetup?.margins)),e.pageSetup&&f.push(function(e){const t={};if(void 0!==e.paperSize){const n=function(e){if("number"==typeof e)return Number.isInteger(e)&&e>0?e:void 0;return xk[e]}(e.paperSize);void 0!==n&&(t.paperSize=n)}e.orientation&&(t.orientation=e.orientation);void 0!==e.scale&&(t.scale=e.scale);e.fitToPage&&(void 0!==e.fitToWidth&&(t.fitToWidth=e.fitToWidth),void 0!==e.fitToHeight&&(t.fitToHeight=e.fitToHeight));void 0!==e.paperWidth&&(t.paperWidth=e.paperWidth);void 0!==e.paperHeight&&(t.paperHeight=e.paperHeight);void 0!==e.firstPageNumber&&(t.firstPageNumber=e.firstPageNumber);const n=e.useFirstPageNumber??(void 0!==e.firstPageNumber||void 0);void 0!==n&&(t.useFirstPageNumber=n?1:0);void 0!==e.pageOrder&&"downThenOver"!==e.pageOrder&&(t.pageOrder=e.pageOrder);e.blackAndWhite&&(t.blackAndWhite=1);e.draft&&(t.draft=1);void 0!==e.cellComments&&"none"!==e.cellComments&&(t.cellComments=e.cellComments);void 0!==e.errors&&"displayed"!==e.errors&&(t.errors=e.errors);void 0!==e.copies&&(t.copies=e.copies);void 0!==e.horizontalDpi&&(t.horizontalDpi=e.horizontalDpi);void 0!==e.verticalDpi&&(t.verticalDpi=e.verticalDpi);!1===e.usePrinterDefaults&&(t.usePrinterDefaults=0);if(0===Object.keys(t).length)return"";return fw("pageSetup",t)}(e.pageSetup)),e.headerFooter&&f.push(function(e){const t={};e.differentOddEven&&(t.differentOddEven=1);e.differentFirst&&(t.differentFirst=1);const n=[];e.oddHeader&&n.push(hw("oddHeader",void 0,lw(e.oddHeader)));e.oddFooter&&n.push(hw("oddFooter",void 0,lw(e.oddFooter)));e.evenHeader&&n.push(hw("evenHeader",void 0,lw(e.evenHeader)));e.evenFooter&&n.push(hw("evenFooter",void 0,lw(e.evenFooter)));e.firstHeader&&n.push(hw("firstHeader",void 0,lw(e.firstHeader)));e.firstFooter&&n.push(hw("firstFooter",void 0,lw(e.firstFooter)));if(0===n.length)return"";return hw("headerFooter",Object.keys(t).length>0?t:void 0,n)}(e.headerFooter)),e.rowBreaks&&e.rowBreaks.length>0){const t=[...e.rowBreaks].sort((e,t)=>e-t),n=t.map(e=>fw("brk",{id:e+1,max:16383,man:1}));f.push(hw("rowBreaks",{count:t.length,manualBreakCount:t.length},n))}if(e.colBreaks&&e.colBreaks.length>0){const t=[...e.colBreaks].sort((e,t)=>e-t),n=t.map(e=>fw("brk",{id:e+1,max:1048575,man:1}));f.push(hw("colBreaks",{count:t.length,manualBreakCount:t.length},n))}let w=null,I=A.length+1;const x=e.images&&e.images.length>0,C=e.textBoxes&&e.textBoxes.length>0,B=e.charts&&e.charts.length>0,E=f.length;(x||C||B)&&(w=`rId${I}`,I++,f.push(fw("drawing",{"r:id":w})));let k=null,S=null,F=!1;if(e.cells)for(const[,t]of e.cells)if(t.comment){F=!0;break}F&&(k=`rId${I}`,I++,S=`rId${I}`,I++,f.push(fw("legacyDrawing",{"r:id":k})));let D=null;e.backgroundImage&&(D=`rId${I}`,I++,f.push(fw("picture",{"r:id":D})));const N=[];if(e.tables&&e.tables.length>0&&void 0!==i){const t=[];for(let n=0;n<e.tables.length;n++){const e=`rId${I}`;I++;const r=i+n;N.push({rId:e,globalTableIndex:r}),t.push(fw("tablePart",{"r:id":e}))}f.push(hw("tableParts",{count:e.tables.length},t))}e.sparklines&&e.sparklines.length>0&&f.push(function(e){const t=[];let n=1;for(const r of e){const e={},i=r.type??"line";"line"!==i&&(e.type=i),e.displayEmptyCellsAs="gap";const o=`{00000000-0000-0000-0000-${String(n++).padStart(12,"0")}}`;e["xr2:uid"]=o,r.markers&&(e.markers="1");const a=[],s=r.color??"376092",l=6===s.length?`FF${s}`:s;a.push(fw("x14:colorSeries",{rgb:l}));const c=hw("x14:sparkline",void 0,[hw("xm:f",void 0,r.dataRange),hw("xm:sqref",void 0,r.location)]);a.push(hw("x14:sparklines",void 0,[c])),t.push(hw("x14:sparklineGroup",e,a))}const r=hw("x14:sparklineGroups",{"xmlns:xm":Dk},t),i=hw("ext",{uri:Mk,"xmlns:x14":Fk,"xmlns:xr2":Nk},[r]);return hw("extLst",void 0,[i])}(e.sparklines));const M=[];if(e.pivotTables&&e.pivotTables.length>0&&void 0!==a)for(let t=0;t<e.pivotTables.length;t++){const e=`rId${I}`;I++,M.push({rId:e,globalPivotIndex:a+t})}const Q=pw("worksheet",{xmlns:lk,"xmlns:r":"http://schemas.openxmlformats.org/officeDocument/2006/relationships"},f);return{xml:Q,drawingInsertOffset:Qk(Q,f,E),hyperlinkRelationships:A,drawingRId:w,legacyDrawingRId:k,commentsRId:S,hasComments:F,tables:N,pictureRId:D,pivotTables:M,hasDynamicArray:m}}function Ak(e){if(e)return e.numFmt&&!e.style?.numFmt?{...e.style,numFmt:e.numFmt}:e.style}function bk(e){const t=[];if(e.data&&e.columns){const n=e.columns.map(e=>e.key);if(e.columns.some(e=>e.header)){const n=[];for(let t=0;t<e.columns.length;t++){const r=e.columns[t];n.push({value:r.header??r.key??null,style:r.style})}t.push(n)}for(const r of e.data){const i=[];for(let t=0;t<n.length;t++){const o=n[t],a=void 0!==o?r[o]??null:null,s={value:jE(a)?a.text:a,style:Ak(e.columns[t])};jE(a)&&(s.hyperlink=hk(a)),i.push(s)}t.push(i)}}else if(e.rows)for(const n of e.rows){const r=[];for(let t=0;t<n.length;t++){const i=ak(n[t]),o=e.columns?Ak(e.columns[t]):void 0;r.push(o?{value:i,style:o}:{value:i})}t.push(r)}if(e.cells)for(const[n,r]of e.cells){const[e,i]=n.split(","),o=parseInt(e,10),a=parseInt(i,10);for(;t.length<=o;)t.push([]);const s=t[o];for(;s.length<=a;)s.push(null);const l=s[a];s[a]={value:r.value??l?.value??null,style:r.style??l?.style,checkbox:r.checkbox??l?.checkbox,formula:r.formula??l?.formula,formulaResult:r.formulaResult??l?.formulaResult,formulaType:r.formulaType??l?.formulaType,formulaSharedIndex:r.formulaSharedIndex??l?.formulaSharedIndex,formulaRef:r.formulaRef??l?.formulaRef,formulaDynamic:r.formulaDynamic??l?.formulaDynamic,richText:r.richText??l?.richText,hyperlink:r.hyperlink??l?.hyperlink}}return t}function wk(e,t,n,r){return 0===t?""===n?`<c r="${e}"><v>${r}</v></c>`:`<c r="${e}" t="${n}"><v>${r}</v></c>`:""===n?`<c r="${e}" s="${t}"><v>${r}</v></c>`:`<c r="${e}" t="${n}" s="${t}"><v>${r}</v></c>`}function Ik(e,t,n,r,i,o,a){const{value:s,style:l,formula:c,formulaResult:u,formulaType:f,formulaSharedIndex:d,formulaRef:h,formulaDynamic:p,richText:g}=n;let m=0,y=l;if(s instanceof Date&&(!y||!y.numFmt))if(y){const e=mk.get(y);if(e)y=e;else{const e={...y,numFmt:pk};mk.set(y,e),y=e}}else y=gk;n.checkbox?m=r.addCheckboxStyle(y):y&&(m=r.addStyle(y));const v=fk(e,t);if(g&&g.length>0){const e={r:v,t:"inlineStr"};0!==m&&(e.s=m);const t=function(e){const t=[];for(const n of e){const e=[];if(n.font){const t=kk(n.font);t.length>0&&e.push(hw("rPr",void 0,t))}e.push(dw(n.text)),t.push(hw("r",void 0,e))}return t}(g);return hw("c",e,[hw("is",void 0,t)])}if(null!=c){const e={r:v};let t;if(0!==m&&(e.s=m),p&&(e.cm=1),"shared"===f){const e={t:"shared"};void 0!==d&&(e.si=d),h&&(e.ref=h),t=""===c?fw("f",e):hw("f",e,lw(c))}else if("array"===f){const e={t:"array"};h&&(e.ref=h),t=hw("f",e,lw(c))}else t=hw("f",void 0,lw(c));const n=[t];return null!=u&&("string"==typeof u?(e.t="str",n.push(hw("v",void 0,lw(u)))):"boolean"==typeof u?(e.t="b",n.push(hw("v",void 0,u?"1":"0"))):"number"==typeof u?Number.isFinite(u)&&n.push(hw("v",void 0,String(u))):u instanceof Date&&n.push(hw("v",void 0,String(rE(u,o))))),hw("c",e,n)}if(null==s)return 0!==m?fw("c",{r:v,s:m}):null;if("string"==typeof s&&yk.has(s))return wk(v,m,"e",s);if("string"==typeof s){if(a){const e=`<is>${dw(s)}</is>`;return 0===m?`<c r="${v}" t="inlineStr">${e}</c>`:`<c r="${v}" t="inlineStr" s="${m}">${e}</c>`}return wk(v,m,"s",String(i.add(s)))}return"number"==typeof s?Number.isFinite(s)?wk(v,m,"",String(s)):0!==m?fw("c",{r:v,s:m}):null:"boolean"==typeof s?wk(v,m,"b",s?"1":"0"):s instanceof Date?wk(v,m,"",String(rE(s,o))):null}const xk={letter:1,letterSmall:2,tabloid:3,ledger:4,legal:5,statement:6,executive:7,a3:8,a4:9,a4Small:10,a5:11,b4:12,b5:13,folio:14,quarto:15,note:18,envelope9:19,envelope10:20,envelope11:21,envelope12:22,envelope14:23,cSheet:24,dSheet:25,eSheet:26,envelopeDL:27,envelopeC5:28,envelopeC3:29,envelopeC4:30,envelopeC6:31,envelopeC65:32,envelopeB4:33,envelopeB5:34,envelopeB6:35,envelopeItaly:36,envelopeMonarch:37,envelopePersonal:38,fanfoldUS:39,fanfoldGermanStd:40,fanfoldGermanLegal:41,a6:70,japanesePostcard:43,japaneseDoublePostcard:69},Ck={};for(const[e,t]of Object.entries(xk))Ck[t]=e;const Bk={left:.7,right:.7,top:.75,bottom:.75,header:.3,footer:.3};function Ek(e){const t={};if(void 0!==e.rgb){const n=e.rgb;t.rgb=6===n.length?`FF${n}`:n}return void 0!==e.theme&&(t.theme=e.theme),void 0!==e.tint&&(t.tint=e.tint),void 0!==e.indexed&&(t.indexed=e.indexed),t}function kk(e){const t=[];return e.bold&&t.push(fw("b")),e.italic&&t.push(fw("i")),e.underline&&(!0===e.underline||"single"===e.underline?t.push(fw("u")):t.push(fw("u",{val:e.underline}))),e.strikethrough&&t.push(fw("strike")),e.vertAlign&&t.push(fw("vertAlign",{val:e.vertAlign})),void 0!==e.size&&t.push(fw("sz",{val:e.size})),e.color&&t.push(fw("color",Ek(e.color))),e.name&&t.push(fw("rFont",{val:e.name})),void 0!==e.family&&t.push(fw("family",{val:e.family})),void 0!==e.charset&&t.push(fw("charset",{val:e.charset})),e.scheme&&t.push(fw("scheme",{val:e.scheme})),t}function Sk(e,t){const n={type:e.type,priority:e.priority};e.style&&(n.dxfId=t.addDxf(e.style)),e.operator&&(n.operator=e.operator),e.stopIfTrue&&(n.stopIfTrue=!0),void 0!==e.text&&(n.text=e.text);const r=[];if(void 0!==e.formula){const t=Array.isArray(e.formula)?e.formula:[e.formula];for(const e of t)r.push(hw("formula",void 0,lw(e)))}if("colorScale"===e.type&&e.colorScale){const t=[];for(const n of e.colorScale.cfvo){const e={type:n.type};void 0!==n.value&&(e.val=n.value),t.push(fw("cfvo",e))}for(const n of e.colorScale.colors)t.push(fw("color",{rgb:n}));r.push(hw("colorScale",void 0,t))}if("dataBar"===e.type&&e.dataBar){const t=[];for(const n of e.dataBar.cfvo){const e={type:n.type};void 0!==n.value&&(e.val=n.value),t.push(fw("cfvo",e))}t.push(fw("color",{rgb:e.dataBar.color})),r.push(hw("dataBar",void 0,t))}if("iconSet"===e.type&&e.iconSet){const t={iconSet:e.iconSet.iconSet};e.iconSet.reverse&&(t.reverse=!0),!1===e.iconSet.showValue&&(t.showValue=!1);const n=[];for(const t of e.iconSet.cfvo){const e={type:t.type};void 0!==t.value&&(e.val=t.value),n.push(fw("cfvo",e))}r.push(hw("iconSet",t,n))}return r.length>0?hw("cfRule",n,r):fw("cfRule",n)}const Fk="http://schemas.microsoft.com/office/spreadsheetml/2009/9/main",Dk="http://schemas.microsoft.com/office/excel/2006/main",Nk="http://schemas.microsoft.com/office/spreadsheetml/2015/revision2",Mk="{05C60535-1F16-4fd2-B633-F4F36F0B64E0}";function Qk(e,t,n){const r=t.join(""),i=0===r.length?e.lastIndexOf("</worksheet>"):e.indexOf(r);if(i<0)return e.lastIndexOf("</worksheet>");let o=i;for(let e=0;e<n;e++)o+=t[e].length;return o}function Tk(e,t,n){if(!(e.size<qC||e.has(t)))throw new pb(`Sheet "${n??"?"}" has more than 16777216 filled cells, which is the most \`Sheet.cells\` can hold — a Map caps at 2^24 entries.\n - streamXlsxRows(input) reads it a row at a time and has no such bound.\nThe file is not damaged; it is larger than this model.`)}function Lk(e,t){if(void 0===e)return!1;const n=Number(e);return!(!Number.isFinite(n)||n<=0)&&(!t.dynamicArrayCm||t.dynamicArrayCm.has(n))}function Rk(e){let t=0,n=0;for(;t<e.length;){const r=e.charCodeAt(t);if(r>=65&&r<=90)n=26*n+(r-64),t++;else{if(!(r>=97&&r<=122))break;n=26*n+(r-96),t++}}n--;return{row:Number(e.slice(t))-1,col:n}}function Uk(e,t){const n=Number(e??"");if(Number.isNaN(n))return t;const r=Math.trunc(n);return r<1?t:Math.min(r,16384)}function Hk(e){const t=e.split(":"),n=Rk(t[0]),r=t.length>1?Rk(t[1]):n;return{startRow:n.row,startCol:n.col,endRow:r.row,endCol:r.col}}function qk(e,t){const n=[],r=new Map,i=[];let o,a=-1,s=-1,l=0,c=!1;t.range&&(o=Hk(t.range));const u=[],f=[],d=[];let h,p,g,m,y,v,A,b,w,I=!1,x=-1,C=[],B=!1,E=!1;const k=[],S=[];let F=!1,D=!1;const N=[];let M=!1,Q=!1,T=!1,L=!1,R=!1,U="",H="",q=!1,O="",P="",z=!1,$=!1,j=!1,V=!1,Y=!1,G=!1,W=!1,J="";const _=t.maxRows??0;let X=0;const K=new Map,Z=[];let ee,te,ne,re=!1,ie=!1,oe=!1,ae=!1,se=!1,le=!1,ce=!1,ue=!1,fe=!1,de=!1,he=!1,pe=!1,ge=!1,me=!1,ye="",ve="",Ae={},be=!1,we="",Ie=!1,xe={},Ce=!1,Be="",Ee=[],ke=!1,Se=[],Fe=[],De=!1,Ne=[],Me="",Qe=!1,Te={},Le=[],Re=!1,Ue=!1,He=!1,qe="",Oe=0,Pe=0,ze="",$e=-1,je="",Ve="",Ye="",Ge=-1,We="",Je=!1,_e="",Xe=[],Ke="";const Ze={onOpenTag(e,n){const r=e.includes(":")?e.slice(e.indexOf(":")+1):e;switch(r){case"cols":re=!0;break;case"col":if(re){const e=Uk(n.min,1),r=Uk(n.max,0),i=n.width?Number(n.width):void 0,o="1"===n.hidden||"true"===n.hidden,a=n.outlineLevel?Number(n.outlineLevel):void 0,s="1"===n.collapsed||"true"===n.collapsed,l="1"===n.bestFit||"true"===n.bestFit,c=void 0!==n.style?Number(n.style):void 0,u=t.readStyles&&t.styles&&void 0!==c&&c>=0?LE(t.styles,c):void 0;for(let t=e;t<=r;t++){const e=t-1;for(;Z.length<=e;)Z.push({});const n={};void 0===i||Number.isNaN(i)||(n.width=i),o&&(n.hidden=!0),void 0!==a&&!Number.isNaN(a)&&a>0&&(n.outlineLevel=a),s&&(n.collapsed=!0),l&&(n.autoWidth=!0),u&&Object.keys(u).length>0&&(n.style=zE(u)),Object.keys(n).length>0&&(Z[e]=n)}}break;case"sheetFormatPr":{const e=n.defaultRowHeight,t=n.defaultColWidth;if(void 0!==e){const t=Number(e);Number.isFinite(t)&&t>0&&15!==t&&(ee=t)}if(void 0!==t){const e=Number(t);Number.isFinite(e)&&e>0&&(te=e)}break}case"sheetData":ie=!0;break;case"row":if(ie){if(_>0&&X>=_)break;if(oe=!0,Oe=Number(n.r)||Oe+1,Pe=0,n.ht&&("1"===n.customHeight||"true"===n.customHeight)){const e=Number(n.r)-1,t=Number(n.ht);if(!Number.isNaN(e)&&!Number.isNaN(t)){const n=K.get(e)??{};n.height=t,K.set(e,n)}}if("1"===n.hidden||"true"===n.hidden){const e=Number(n.r)-1;if(!Number.isNaN(e)){const t=K.get(e)??{};t.hidden=!0,K.set(e,t)}}if(n.outlineLevel){const e=Number(n.r)-1,t=Number(n.outlineLevel);if(!Number.isNaN(e)&&!Number.isNaN(t)&&t>0){const n=K.get(e)??{};n.outlineLevel=t,K.set(e,n)}}if("1"===n.collapsed||"true"===n.collapsed){const e=Number(n.r)-1;if(!Number.isNaN(e)){const t=K.get(e)??{};t.collapsed=!0,K.set(e,t)}}}break;case"c":oe&&(ae=!0,qe=n.r??"",ze=n.t??"",$e=n.s?Number(n.s):-1,je="",Ve="",Ye="",Ge=-1,We="",Je=Lk(n.cm,t),_e="",Xe=[]);break;case"v":ae&&(se=!0);break;case"f":T?(L=!0,O=""):ae&&(le=!0,Ye=n.t??"",void 0!==n.si&&(Ge=Number(n.si)),n.ref&&(We=n.ref),void 0!==n.cm&&Lk(n.cm,t)&&(Je=!0));break;case"is":ae&&(ce=!0);break;case"t":ce&&!Re?ue=!0:Re&&(He=!0);break;case"r":ce&&(Re=!0,Ke="",ne=void 0);break;case"rPr":Re&&(Ue=!0,ne={});break;case"sheetPr":B=!0;break;case"outlinePr":if(B){const e={};void 0!==n.summaryBelow&&(e.summaryBelow="1"===n.summaryBelow||"true"===n.summaryBelow),void 0!==n.summaryRight&&(e.summaryRight="1"===n.summaryRight||"true"===n.summaryRight),Object.keys(e).length>0&&(m=e)}break;case"pageSetUpPr":B&&(E="1"===n.fitToPage||"true"===n.fitToPage);break;case"tabColor":B&&(g||(g={}),g.tabColor=function(e){const t={};if(e.rgb){const n=e.rgb;t.rgb=8===n.length?n.slice(2):n}e.theme&&(t.theme=Number(e.theme));e.tint&&(t.tint=Number(e.tint));e.indexed&&(t.indexed=Number(e.indexed));return t}(n));break;case"sheetView":if(!ie){if(g||(g={}),"0"!==n.showGridLines&&"false"!==n.showGridLines||(g.showGridLines=!1),"0"!==n.showRowColHeaders&&"false"!==n.showRowColHeaders||(g.showRowColHeaders=!1),n.zoomScale){const e=Number(n.zoomScale);Number.isNaN(e)||(g.zoomScale=e)}"1"!==n.rightToLeft&&"true"!==n.rightToLeft||(g.rightToLeft=!0)}break;case"pane":if(!ie){const e=n.state;if("frozen"===e||"frozenSplit"===e){const e=Number(n.xSplit||"0"),t=Number(n.ySplit||"0");(e>0||t>0)&&(y={},e>0&&(y.columns=e),t>0&&(y.rows=t))}else if("split"===e){const e=Number(n.xSplit||"0"),t=Number(n.ySplit||"0");(e>0||t>0)&&(v={},e>0&&(v.xSplit=e),t>0&&(v.ySplit=t))}}break;case"sheetProtection":p=function(e){const t={};"1"!==e.sheet&&"true"!==e.sheet||(t.sheet=!0);"1"!==e.objects&&"true"!==e.objects||(t.objects=!0);"1"!==e.scenarios&&"true"!==e.scenarios||(t.scenarios=!0);const n=[["selectLockedCells","selectLockedCells"],["selectUnlockedCells","selectUnlockedCells"],["formatCells","formatCells"],["formatColumns","formatColumns"],["formatRows","formatRows"],["insertColumns","insertColumns"],["insertRows","insertRows"],["insertHyperlinks","insertHyperlinks"],["deleteColumns","deleteColumns"],["deleteRows","deleteRows"],["sort","sort"],["autoFilter","autoFilter"],["pivotTables","pivotTables"]];for(const[r,i]of n){const n=e[r];void 0!==n&&(t[i]=!("1"===n||"true"===n))}return t}(n);break;case"autoFilter":n.ref&&(h={range:n.ref},I=!0);break;case"filterColumn":I&&void 0!==n.colId&&(x=Number(n.colId),C=[]);break;case"filter":I&&x>=0&&void 0!==n.val&&C.push(n.val);break;case"mergeCells":fe=!0;break;case"mergeCell":fe&&n.ref&&i.push(Hk(n.ref));break;case"hyperlinks":de=!0;break;case"hyperlink":if(de&&n.ref){const e={ref:n.ref},t=n["r:id"]??n["R:id"];t&&(e.rId=t),n.location&&(e.location=n.location),n.tooltip&&(e.tooltip=n.tooltip),n.display&&(e.display=n.display),u.push(e)}break;case"conditionalFormatting":be=!0,we=n.sqref??"";break;case"cfRule":be&&(Ie=!0,xe={...n},Ee=[],Se=[],Fe=[],Ne=[],Me="",Le=[],Te={});break;case"colorScale":Ie&&(ke=!0,Se=[],Fe=[]);break;case"cfvo":ke?Se.push({type:n.type??"min",value:n.val}):De?Ne.push({type:n.type??"min",value:n.val}):Qe&&Le.push({type:n.type??"min",value:n.val});break;case"dataBar":Ie&&(De=!0,Ne=[],Me="");break;case"iconSet":Ie&&(Qe=!0,Te={...n},Le=[]);break;case"dataValidations":he=!0;break;case"dataValidation":he&&(pe=!0,Ae={...n},ye="",ve="");break;case"formula1":pe&&(ge=!0);break;case"formula2":pe&&(me=!0);break;case"pageMargins":b=function(e){const t={};e.left&&(t.left=Number(e.left));e.right&&(t.right=Number(e.right));e.top&&(t.top=Number(e.top));e.bottom&&(t.bottom=Number(e.bottom));e.header&&(t.header=Number(e.header));e.footer&&(t.footer=Number(e.footer));return t}(n);break;case"pageSetup":A={...A,...Vk(n,t)};break;case"printOptions":A=function(e,t){const n=e??{},r=e=>"1"===e||"true"===e;r(t.gridLines)&&(n.showGridLines=!0);r(t.headings)&&(n.showRowColHeaders=!0);r(t.horizontalCentered)&&(n.horizontalCentered=!0);r(t.verticalCentered)&&(n.verticalCentered=!0);return n}(A,n);break;case"headerFooter":z=!0,w={},"1"!==n.differentOddEven&&"true"!==n.differentOddEven||(w.differentOddEven=!0),"1"!==n.differentFirst&&"true"!==n.differentFirst||(w.differentFirst=!0);break;case"oddHeader":z&&($=!0,J="");break;case"oddFooter":z&&(j=!0,J="");break;case"evenHeader":z&&(V=!0,J="");break;case"evenFooter":z&&(Y=!0,J="");break;case"firstHeader":z&&(G=!0,J="");break;case"firstFooter":z&&(W=!0,J="");break;case"rowBreaks":F=!0;break;case"colBreaks":D=!0;break;case"brk":if(F||D){const e=n.id;if(e){const t=Number(e)-1;F?k.push(t):S.push(t)}}break;case"color":ke?Fe.push(n.rgb??""):De?Me=n.rgb??"":Ue&&ne&&jk(ne,r,n);break;case"formula":Ie&&!pe&&(Ce=!0,Be="");break;case"sparklineGroups":M=!0;break;case"sparklineGroup":M&&(Q=!0,U=n.type??"line",H="",q="1"===n.markers||"true"===n.markers);break;case"colorSeries":if(Q){const e=n.rgb??"";H=8===e.length?e.slice(2):e}break;case"sparkline":Q&&(T=!0,O="",P="");break;default:if(T&&"sqref"===r){R=!0,P="";break}Ue&&ne&&jk(ne,r,n)}},onText(e){se?je+=e:le?Ve+=e:Ce?Be+=e:ue?_e+=e:He?Ke+=e:ge?ye+=e:me?ve+=e:$||j||V||Y||G||W?J+=e:L?O+=e:R&&(P+=e)},onCloseTag(e){const i=e.includes(":")?e.slice(e.indexOf(":")+1):e;switch(i){case"cols":re=!1;break;case"sheetData":ie=!1;break;case"row":oe&&X++,oe=!1;break;case"c":if(ae){const e=qe?Rk(qe).row:Oe-1,i=qe?Rk(qe).col:Pe;Pe=i+1;let u=!1;o&&(e<o.startRow||e>o.endRow||i<o.startCol||i>o.endCol)&&(u=!0);const f=""!==je||""!==_e||Xe.length>0||""!==Ve||"e"===ze||"inlineStr"===ze||t.readStyles&&$e>=0||!!(t.styles&&$e>=0)&&(t.styles.cellXfs[$e]?.hasCheckboxFeature??!1);!u&&f&&(!function(e,t,n,r,i,o,a,s,l,c,u,f,d,h,p,g){const m=""!==e?Rk(e):void 0!==p&&void 0!==g?{row:p,col:g}:null;if(!m)return;const{row:y,col:v}=m;if(y>UC||v>HC)throw new pb(`Cell reference "${e}" is outside the supported sheet bounds (max row 1048576, max col 16384)`);if(!Number.isInteger(y)||!Number.isInteger(v)||y<0||v<0)return void s.onWarning?.({code:"malformed-cell-ref",message:`Cell reference "${e}" is not a cell reference — a column needs a row number and rows are 1-based. The cell is dropped; the rest of the sheet is read.`,sheet:s.sheetName});if(!s.sparse){for(;l.length<=y;)l.push([]);for(;l[y].length<=v;)l[y].push(null)}let A,b,w,I=null,x="empty";i?A=i:"shared"===u&&void 0!==f&&f>=0&&(A="");switch(t){case"s":{const t=Number(r);if(!Number.isNaN(t)&&t>=0&&t<s.sharedStrings.length){const e=s.sharedStrings[t];I=e.text,e.richText&&e.richText.length>0?(w=e.richText,x="richText"):x="string"}else s.onWarning?.({code:"unresolved-shared-string",message:`Cell ${e||`${y},${v}`} points at shared string ${r}, which the file does not have (${s.sharedStrings.length} present). Read as empty.`,sheet:s.sheetName,row:y,col:v}),I=null,x="empty";break}case"str":I=Eb(r),x=A?"formula":"string",A&&(b=I);break;case"inlineStr":a&&a.length>0?(I=a.map(e=>e.text).join(""),w=a,x="richText"):(I=Eb(o),x="string");break;case"b":I="1"===r||"true"===r.toLowerCase(),x=A?"formula":"boolean",A&&(b=I);break;case"e":I=r,x=A?"formula":"error",A&&(b=I);break;case"d":{const e=function(e){const t=e.trim();if(!/^\d{4}-\d{2}-\d{2}([T ]\d{2}:\d{2}(:\d{2}(\.\d+)?)?(Z|[+-]\d{2}:?\d{2})?)?$/.test(t))return;const n=/(?:Z|[+-]\d{2}:?\d{2})$/.test(t),r=/[T ]\d{2}:/.test(t),i=t.replace(" ","T"),o=new Date(r&&!n?`${i}Z`:i);return Number.isNaN(o.getTime())?void 0:o}(r);e?(I=e,x="date"):""!==r?(I=r,x="string"):(I=null,x="empty"),A&&(b=I,x="formula");break}default:{if(""===r&&!A){I=null,x="empty";break}const e=Number(r);Number.isNaN(e)||""===r?""!==r&&(I=r,x="string"):s.styles&&n>=0&&RE(s.styles,n)?(I=function(e,t){if(t){const t=tE+Math.round(e*nE);return new Date(t)}if(60===e)return new Date(Date.UTC(1900,1,28));let n=e;e>60&&(n=e-1);const r=eE+Math.round(n*nE);return new Date(r)}(e,"1904"===s.dateSystem),x="date"):(I=e,x="number"),A&&(b=I,x="formula");break}}s.sparse||(l[y][v]=I);const C=!!(s.styles&&n>=0)&&(s.styles.cellXfs[n]?.hasCheckboxFeature??!1),B=s.sparse||void 0!==A||void 0!==w||s.readStyles&&s.styles&&n>=0||C||"error"===x||"formula"===x||"richText"===x;if(B){const t={value:I,type:x};if(C&&(t.checkbox=!0),void 0!==A&&(t.formula=A,void 0!==b&&(t.formulaResult=b),"shared"===u?(t.formulaType="shared",void 0!==f&&f>=0&&(t.formulaSharedIndex=f),d&&(t.formulaRef=d)):"array"===u&&(t.formulaType="array",d&&(t.formulaRef=d)),h&&(t.formulaDynamic=!0)),w&&(t.richText=w),s.readStyles&&s.styles&&n>=0){const r=LE(s.styles,n);Object.keys(r).length>0?t.style=r:n>=s.styles.cellXfs.length&&s.onWarning?.({code:"unresolved-style",message:`Cell ${e||`${y},${v}`} points at cell format ${n}, which the file does not have (${s.styles.cellXfs.length} present). Read unstyled.`,sheet:s.sheetName,row:y,col:v})}const r=`${y},${v}`;Tk(c,r,s.sheetName),c.set(r,t)}}(qe,ze,$e,je,Ve,_e,Xe.length>0?Xe:void 0,t,n,r,Ye,Ge,We,Je,e,i),e>=0&&i>=0&&(i>a&&(a=i),e>s&&(s=e),c=!0,l++)),ae=!1}break;case"v":se=!1;break;case"f":L?L=!1:le=!1;break;case"is":ce=!1;break;case"t":He?He=!1:ue&&(ue=!1);break;case"r":if(Re){const e=Eb(Ke);Xe.push(ne?{text:e,font:ne}:{text:e}),Re=!1}break;case"rPr":Ue=!1;break;case"sheetPr":B=!1;break;case"mergeCells":fe=!1;break;case"autoFilter":I=!1;break;case"filterColumn":I&&h&&x>=0&&C.length>0&&(h.columns||(h.columns=[]),h.columns.push({colIndex:x,filters:C})),x=-1,C=[];break;case"hyperlinks":de=!1;break;case"conditionalFormatting":be=!1;break;case"cfRule":if(Ie){const e=function(e,t,n,r,i,o,a,s,l,c,u){const f=e.type;if(!f||!$k.has(f))return null;if(!t)return null;const d={type:f,priority:Number(e.priority??"1"),range:t},h=e.operator;h&&zk.has(h)&&(d.operator=h);const p=Number(e.dxfId);if(c&&!Number.isNaN(p)){const e=c[p];e&&Object.keys(e).length>0?d.style=e:e||u?.onWarning?.({code:"unresolved-dxf",message:`Conditional rule on ${t} asks for differential format ${p}, which the file does not have (${c.length} present). The rule keeps its condition and loses its formatting.`,sheet:u.sheetName})}"1"!==e.stopIfTrue&&"true"!==e.stopIfTrue||(d.stopIfTrue=!0);void 0!==e.text&&(d.text=e.text);1===n.length?d.formula=n[0]:n.length>1&&(d.formula=n);"colorScale"===f&&r.length>0&&(d.colorScale={cfvo:r.map(e=>({type:e.type,value:e.value})),colors:i});"dataBar"===f&&o.length>0&&(d.dataBar={cfvo:o.map(e=>({type:e.type,value:e.value})),color:a});"iconSet"===f&&s.length>0&&(d.iconSet={iconSet:l.iconSet??"3TrafficLights1",cfvo:s.map(e=>({type:e.type,value:e.value}))},"1"!==l.reverse&&"true"!==l.reverse||(d.iconSet.reverse=!0),"0"!==l.showValue&&"false"!==l.showValue||(d.iconSet.showValue=!1));return d}(xe,we,Ee,Se,Fe,Ne,Me,Le,Te,t.styles?.dxfs,t);e&&d.push(e),Ie=!1}break;case"colorScale":ke=!1;break;case"dataBar":Ie&&(De=!1);break;case"iconSet":Qe=!1;break;case"formula":Ce&&(Ee.push(Be),Ce=!1);break;case"dataValidations":he=!1;break;case"dataValidation":if(pe){const e=function(e,t,n){const r=e.type;if(!r||!Pk.has(r))return null;const i=e.sqref;if(!i)return null;const o={type:r,range:i},a=e.operator;a&&zk.has(a)&&(o.operator=a);"1"!==e.allowBlank&&"true"!==e.allowBlank||(o.allowBlank=!0);"1"!==e.showInputMessage&&"true"!==e.showInputMessage||(o.showInputMessage=!0);"1"!==e.showErrorMessage&&"true"!==e.showErrorMessage||(o.showErrorMessage=!0);const s=e.errorStyle;"stop"!==s&&"warning"!==s&&"information"!==s||(o.errorStyle=s);e.promptTitle&&(o.inputTitle=e.promptTitle);e.prompt&&(o.inputMessage=e.prompt);e.errorTitle&&(o.errorTitle=e.errorTitle);e.error&&(o.errorMessage=e.error);if(t)if("list"===r){const e=t.trim();if(e.startsWith('"')&&e.endsWith('"')){const t=e.slice(1,-1);o.values=t.split(",")}else o.formula1=t}else o.formula1=t;n&&(o.formula2=n);return o}(Ae,ye,ve);e&&f.push(e),pe=!1}break;case"formula1":ge=!1;break;case"formula2":me=!1;break;case"headerFooter":z=!1;break;case"oddHeader":$&&w&&(w.oddHeader=J,$=!1);break;case"oddFooter":j&&w&&(w.oddFooter=J,j=!1);break;case"evenHeader":V&&w&&(w.evenHeader=J,V=!1);break;case"evenFooter":Y&&w&&(w.evenFooter=J,Y=!1);break;case"firstHeader":G&&w&&(w.firstHeader=J,G=!1);break;case"firstFooter":W&&w&&(w.firstFooter=J,W=!1);break;case"rowBreaks":F=!1;break;case"colBreaks":D=!1;break;case"sparklineGroups":M=!1;break;case"sparklineGroup":Q=!1;break;case"sparkline":if(T&&P){const e={location:P,dataRange:O};U&&"line"!==U&&(e.type=U),H&&(e.color=H),q&&(e.markers=!0),N.push(e)}T=!1;break;default:if(T&&"sqref"===i){R=!1;break}}}};return{handlers:Ze,finish:function(){if(c&&!t.sparse){const r=a+1,i=(s+1)*r,o=t.maxTotalCells??2e7;if(i>o)throw new pb(function(e,t,n,r,i,o){const a=i<=qC;return`Sheet "${e}" spans ${t} rows x ${n} columns (${r} cells, ${(r>0?100*i/r:100).toFixed(2)}% of them filled), over the ${o} limit.\n - streamXlsxRows(input) reads it a row at a time, whatever the box.\n`+(a?" - readXlsx(input, { sparse: true }) returns the cells and no grid.\n":` - \`sparse: true\` cannot help here: ${i} filled cells is past the 16777216 a Map can hold.\n`)+" - `range` or `maxRows` bound the area, if you know where the data is.\n - `maxTotalCells` raises the bound, if the sheet really is this large."}(e,s+1,r,i,l,o));for(let e=0;e<=s;e++)if(n[e])for(;n[e].length<r;)n[e].push(null);else n[e]=Array.from({length:r},()=>null)}const o=new Map;if(t.worksheetRels)for(const e of t.worksheetRels)o.set(e.id,e.target);for(const i of u){const a=Rk(i.ref),s=`${a.row},${a.col}`;let l=r.get(s);l||(l={value:(n[a.row]&&n[a.row][a.col])??null,type:"string"},Tk(r,s,e),r.set(s,l));const c={target:""};if(i.location)c.location=i.location,c.target=i.location;else if(i.rId){const e=o.get(i.rId);e?c.target=e:t.onWarning?.({code:"unresolved-hyperlink",message:`Cell ${i.ref} links through ${i.rId}, which the sheet's relationships do not define. Read with an empty target.`,sheet:t.sheetName,row:a.row,col:a.col})}i.tooltip&&(c.tooltip=i.tooltip),i.display&&(c.display=i.display),l.hyperlink=c}const I={name:e,rows:n};if(r.size>0&&(I.cells=r),void 0!==ee&&(I.defaultRowHeight=ee),void 0!==te&&(I.defaultColWidth=te),Z.some(e=>Object.keys(e).length>0)&&(I.columns=Z),i.length>0&&(I.merges=i),f.length>0&&(I.dataValidations=f),d.length>0&&(I.conditionalRules=d),h&&(I.autoFilter=h),y&&(I.freezePane=y),v&&(I.splitPane=v),p&&(I.protection=p),g&&Object.keys(g).length>0&&(I.view=g),A||b||E){const e=A??{};b&&(e.margins=b),E&&(e.fitToPage=!0),I.pageSetup=e}return w&&Object.keys(w).length>0&&(I.headerFooter=w),k.length>0&&(I.rowBreaks=k.sort((e,t)=>e-t)),S.length>0&&(I.colBreaks=S.sort((e,t)=>e-t)),K.size>0&&(I.rowDefs=K),N.length>0&&(I.sparklines=N),m&&(I.outlineProperties=m),I}}}async function Ok(e,t,n){const{handlers:r,finish:i}=qk(t,n);return await async function(e,t,n){const r=n?.strict??!1,i=e.getReader(),o=new TextDecoder("utf-8");let a="",s=!1;try{for(;;){const{done:e,value:n}=await i.read();if(e)break;a+=o.decode(n,{stream:!0}),s||(65279===a.charCodeAt(0)&&(a=a.slice(1)),s=!0),a=Tb(a,t,!1,r)}a+=o.decode(),a.length>0&&Tb(a,t,!0,r)}finally{try{await i.cancel()}catch{}try{i.releaseLock()}catch{}}}(e,r,{strict:!0}),i()}const Pk=new Set(["list","whole","decimal","date","time","textLength","custom"]),zk=new Set(["between","notBetween","equal","notEqual","greaterThan","lessThan","greaterThanOrEqual","lessThanOrEqual"]);const $k=new Set(["cellIs","expression","colorScale","dataBar","iconSet","top10","aboveAverage","duplicateValues","uniqueValues","containsText","notContainsText","beginsWith","endsWith","containsBlanks","notContainsBlanks"]);function jk(e,t,n){switch(t){case"b":e.bold="0"!==n.val&&"false"!==n.val;break;case"i":e.italic="0"!==n.val&&"false"!==n.val;break;case"u":{const t=n.val;e.underline="double"!==t||"double";break}case"strike":e.strikethrough="0"!==n.val&&"false"!==n.val;break;case"sz":n.val&&(e.size=Number(n.val));break;case"rFont":n.val&&(e.name=n.val);break;case"color":if(e.color={},n.rgb){const t=n.rgb;e.color.rgb=8===t.length?t.slice(2):t}n.theme&&(e.color.theme=Number(n.theme)),n.tint&&(e.color.tint=Number(n.tint)),n.indexed&&(e.color.indexed=Number(n.indexed));break;case"vertAlign":"superscript"!==n.val&&"subscript"!==n.val||(e.vertAlign=n.val);break;case"family":n.val&&(e.family=Number(n.val));break;case"charset":n.val&&(e.charset=Number(n.val));break;case"scheme":"major"!==n.val&&"minor"!==n.val&&"none"!==n.val||(e.scheme=n.val)}}function Vk(e,t){const n={};if(e.paperSize){const r=Number(e.paperSize);Number.isInteger(r)&&r>0?n.paperSize=Ck[r]??r:t?.onWarning?.({code:"unusable-paper-size",message:`Page setup names paper size "${e.paperSize}", which is not a positive integer code. Dropped; the sheet reads with no paper size set.`,sheet:t.sheetName})}"landscape"!==e.orientation&&"portrait"!==e.orientation||(n.orientation=e.orientation),e.scale&&(n.scale=Number(e.scale)),void 0===e.fitToWidth&&void 0===e.fitToHeight||(n.fitToPage=!0,e.fitToWidth&&(n.fitToWidth=Number(e.fitToWidth)),e.fitToHeight&&(n.fitToHeight=Number(e.fitToHeight))),"1"!==e.horizontalCentered&&"true"!==e.horizontalCentered||(n.horizontalCentered=!0),"1"!==e.verticalCentered&&"true"!==e.verticalCentered||(n.verticalCentered=!0),e.paperWidth&&(n.paperWidth=e.paperWidth),e.paperHeight&&(n.paperHeight=e.paperHeight);const r=Gk(e.firstPageNumber);void 0!==r&&(n.firstPageNumber=r),void 0!==e.useFirstPageNumber&&(n.useFirstPageNumber=Yk(e.useFirstPageNumber)),"overThenDown"!==e.pageOrder&&"downThenOver"!==e.pageOrder||(n.pageOrder=e.pageOrder),Yk(e.blackAndWhite)&&(n.blackAndWhite=!0),Yk(e.draft)&&(n.draft=!0);const i=e.cellComments;"none"!==i&&"asDisplayed"!==i&&"atEnd"!==i||(n.cellComments=i);const o=e.errors;"displayed"!==o&&"blank"!==o&&"dash"!==o&&"NA"!==o||(n.errors=o);const a=Gk(e.copies);void 0!==a&&(n.copies=a);const s=Gk(e.horizontalDpi);void 0!==s&&(n.horizontalDpi=s);const l=Gk(e.verticalDpi);return void 0!==l&&(n.verticalDpi=l),void 0!==e.usePrinterDefaults&&(n.usePrinterDefaults=Yk(e.usePrinterDefaults)),n}function Yk(e){return"1"===e||"true"===e}function Gk(e){if(void 0===e)return;const t=Number(e);return Number.isInteger(t)&&t>=0?t:void 0}function Wk(e){const t=new Map,n=[];let r=!1,i=!1,o=!1,a=!1,s=!1,l=!1,c="",u="",f=-1,d="";return Fb(e,{onOpenTag(e,t){switch(e.includes(":")?e.slice(e.indexOf(":")+1):e){case"authors":r=!0;break;case"author":r&&(i=!0,c="");break;case"commentList":o=!0;break;case"comment":o&&(a=!0,u=t.ref??"",f=t.authorId?Number(t.authorId):-1,d="");break;case"text":a&&(s=!0);break;case"r":break;case"t":s&&(l=!0)}},onText(e){i?c+=e:l&&(d+=e)},onCloseTag(e){switch(e.includes(":")?e.slice(e.indexOf(":")+1):e){case"authors":r=!1;break;case"author":i&&(n.push(c),i=!1);break;case"commentList":o=!1;break;case"comment":if(a&&u){const e={text:d};if(f>=0&&f<n.length){const t=n[f];t&&(e.author=t)}t.set(u,e),a=!1}break;case"text":s=!1;break;case"r":break;case"t":l=!1}}}),t}function Jk(e,t){for(const n of e.children){if("string"==typeof n)continue;if((n.local||n.tag)===t){return n.children.filter(e=>"string"==typeof e).join("")||void 0}}}function _k(e){if(e)return function(e){const t=e.trim(),n=t.indexOf("T"),r=n>=0&&/(?:Z|[+-]\d{2}:?\d{2})$/.test(t.slice(n+1)),i=new Date(n>=0&&!r?`${t}Z`:t);return Number.isNaN(i.getTime())?void 0:i}(e)}const Xk=["dk1","lt1","dk2","lt2","accent1","accent2","accent3","accent4","accent5","accent6","hlink","folHlink"];function Kk(e,t){return e===`http://schemas.openxmlformats.org/officeDocument/2006/relationships/${t}`||e===`http://purl.oclc.org/ooxml/officeDocument/relationships/${t}`||e.endsWith("/"+t)}function Zk(e,t="(unknown)"){return Ib(e,t)}async function eS(e,t,n,r){const i=e.declaredSize(t);if(void 0===i||i<=bb)try{return function(e,t,n){const{handlers:r,finish:i}=qk(t,n);return Fb(e,r),i()}(Zk(await e.extract(t),t),n,r)}catch(e){if(!function(e){return e instanceof wb}(e))throw e}return Ok(e.extractStream(t),n,r)}async function tS(e,t){let n,r=await PC(e,t?.maxInputBytes);if(function(e){if(e.length<OC.length)return!1;for(let t=0;t<OC.length;t++)if(e[t]!==OC[t])return!1;return!0}(r)){if(!t?.password)throw new vb("xlsx");r=await rB(r,t.password,t.maxSpinCount)}try{n=new _B(r,t?.maxDecompressedBytes)}catch(e){if(e instanceof gb)throw e;throw new pb("Failed to open XLSX file: not a valid ZIP archive",void 0,{cause:e})}if(!n.has("[Content_Types].xml"))throw new pb("Invalid XLSX: missing [Content_Types].xml");if(function(e){const t=Lb(e),n=new Map,r=new Map;for(const e of t.children){if("string"==typeof e)continue;const t=e.local||e.tag;if("Default"===t){const t=e.attrs.Extension,r=e.attrs.ContentType;t&&r&&n.set(t,r)}else if("Override"===t){const t=e.attrs.PartName,n=e.attrs.ContentType;t&&n&&r.set(t,n)}}}(Zk(await n.extract("[Content_Types].xml"),"[Content_Types].xml")),!n.has("_rels/.rels"))throw new pb("Invalid XLSX: missing _rels/.rels");const i=zb(Zk(await n.extract("_rels/.rels"),"_rels/.rels")).find(e=>Kk(e.type,"officeDocument"));if(!i)throw new pb("Invalid XLSX: cannot find workbook relationship in _rels/.rels");const o=i.target.startsWith("/")?i.target.slice(1):i.target,a=jb(o),s=a?`${a}/_rels/${o.slice(a.length+1)}.rels`:`_rels/${o}.rels`;let l=[];if(n.has(s)){l=zb(Zk(await n.extract(s),s))}if(!n.has(o))throw new pb(`Invalid XLSX: missing workbook at ${o}`);const c=Zk(await n.extract(o),o),{sheets:u,dateSystem:f,namedRanges:d,workbookProtection:h,activeSheet:p,pivotCacheRefs:g}=function(e,t){const n=Lb(e),r=[],i=[],o=[];let a,s,l="1900";"1904"===t?.dateSystem?l="1904":"1900"===t?.dateSystem&&(l="1900");for(const e of n.children){if("string"==typeof e)continue;const n=e.local||e.tag;if("workbookPr"===n&&("1"!==e.attrs.date1904&&"true"!==e.attrs.date1904||t?.dateSystem&&"auto"!==t.dateSystem||(l="1904")),"workbookProtection"===n){const t="1"===e.attrs.lockStructure||"true"===e.attrs.lockStructure,n="1"===e.attrs.lockWindows||"true"===e.attrs.lockWindows;(t||n)&&(a={},t&&(a.lockStructure=!0),n&&(a.lockWindows=!0))}if("bookViews"===n)for(const t of e.children){if("string"==typeof t)continue;if("workbookView"!==(t.local||t.tag))continue;const e=Number(t.attrs.activeTab);Number.isInteger(e)&&e>0&&void 0===s&&(s=e)}if("sheets"===n)for(const t of e.children){if("string"==typeof t)continue;if("sheet"===(t.local||t.tag)){const e=t.attrs.name??"",n=Number(t.attrs.sheetId??"0"),i=t.attrs["r:id"]??t.attrs["R:id"]??Vb(t.attrs)??"",o=t.attrs.state;let a="visible";"hidden"===o?a="hidden":"veryHidden"===o&&(a="veryHidden"),e&&i&&r.push({name:e,sheetId:n,rId:i,state:a})}}if("pivotCaches"===n)for(const t of e.children){if("string"==typeof t)continue;if("pivotCache"===(t.local||t.tag)){const e=t.attrs.cacheId,n=void 0===e?NaN:Number(e),r=t.attrs["r:id"]??t.attrs["R:id"]??Vb(t.attrs)??"";r&&!Number.isNaN(n)&&o.push({cacheId:n,rId:r})}}}for(const e of n.children){if("string"==typeof e)continue;if("definedNames"===(e.local||e.tag))for(const t of e.children){if("string"==typeof t)continue;if("definedName"===(t.local||t.tag)){const e=t.attrs.name??"",n=t.children.filter(e=>"string"==typeof e).join("");if(e&&n){const o={name:e,range:n},a=t.attrs.localSheetId;if(void 0!==a){const e=Number(a);e>=0&&e<r.length&&(o.scope=r[e].name)}t.attrs.comment&&(o.comment=t.attrs.comment),i.push(o)}}}}return{sheets:r,dateSystem:l,namedRanges:i,workbookProtection:a,activeSheet:s,pivotCacheRefs:o}}(c,t);let m=[];const y=l.find(e=>Kk(e.type,"sharedStrings"));if(y){const e=$b(a,y.target);if(n.has(e)){m=function(e){const t=Lb(e),n=[];for(const e of t.children)"string"!=typeof e&&"si"===(e.local||e.tag)&&n.push(XB(e));return n}(Zk(await n.extract(e),e))}}let v=null;const A=l.find(e=>Kk(e.type,"styles"));if(A){const e=$b(a,A.target);if(n.has(e)){v=gE(Zk(await n.extract(e),e))}}let b;const w=a?`${a}/theme/theme1.xml`:"theme/theme1.xml";if(n.has(w)){b=function(e){const t=new Map;let n=!1,r="";return Fb(e,{onOpenTag(e,i){if("clrScheme"===e||"a:clrScheme"===e)return void(n=!0);if(!n)return;const o=e.includes(":")?e.split(":").pop():e;Xk.includes(o)?r=o:r&&("srgbClr"===o&&i.val?t.set(r,i.val.toUpperCase()):"sysClr"===o&&i.lastClr&&t.set(r,i.lastClr.toUpperCase()))},onCloseTag(e){const t=e.includes(":")?e.split(":").pop():e;"clrScheme"===t&&(n=!1),r&&Xk.includes(t)&&(r="")}}),Xk.map(e=>t.get(e)??"000000")}(Zk(await n.extract(w),w))}let I;const x=l.find(e=>Kk(e.type,"person"));if(x){const e=$b(a,x.target);if(n.has(e)){I=function(e){const t=Lb(e),n=[];for(const e of Ub(t)){if("person"!==e.local)continue;const t=e.attrs.id,r=e.attrs.displayName;if(!t||void 0===r)continue;const i={id:t,displayName:r};e.attrs.userId&&(i.userId=e.attrs.userId),e.attrs.providerId&&(i.providerId=e.attrs.providerId),n.push(i)}return n}(Zk(await n.extract(e),e))}}const C=l.filter(e=>Kk(e.type,"externalLink")).sort((e,t)=>rS(e.id)-rS(t.id)),B=[];for(const e of C){const t=$b(a,e.target);if(!n.has(t))continue;const r=Zk(await n.extract(t),t),i=iS(t),o=n.has(i)?Zk(await n.extract(i),i):void 0;B.push(Gb(r,o))}let E;const k=l.find(e=>"http://www.wps.cn/officeDocument/2017/relationships/cellimage"===e.type);if(k){const e=$b(a,k.target);if(n.has(e)){const t=function(e){const t=Lb(e),n=[];for(const e of Ub(t)){if("cellImage"!==e.local)continue;const t=Jb(e);t&&n.push(t)}return n}(Zk(await n.extract(e),e)),r=iS(e),i=jb(e),o=new Map;if(n.has(r)){const e=Zk(await n.extract(r),r);for(const t of zb(e)){if(!Kk(t.type,"image"))continue;const e=$b(i,t.target);if(!n.has(e))continue;const r=e.split(".").pop()?.toLowerCase()??"",a=oS[r];a&&o.set(t.id,{data:await n.extract(e),type:a})}}const a=function(e,t){const n=[],r=new Set;for(const i of e){if(r.has(i.id))continue;const e=t.get(i.embedRId);if(!e)continue;const o={id:i.id,data:e.data,type:e.type};i.description&&(o.description=i.description),n.push(o),r.add(i.id)}return n}(t,o);a.length>0&&(E=a)}}const S=new Map,F=new Map;for(const e of g){const t=l.find(t=>t.id===e.rId);if(!t)continue;const r=$b(a,t.target);if(!n.has(r))continue;const i=_b(Zk(await n.extract(r),r));if(!i)continue;i.cacheId=e.cacheId;const o=iS(r);if(n.has(o)){zb(Zk(await n.extract(o),o)).some(e=>Kk(e.type,"pivotCacheRecords"))&&(i.hasRecords=!0)}S.set(e.cacheId,i),F.set(e.rId,i)}const D=g.map(e=>S.get(e.cacheId)).filter(e=>void 0!==e),N=l.filter(e=>Kk(e.type,"slicerCache")).sort((e,t)=>nS(e.target)-nS(t.target)),M=[];for(const e of N){const t=$b(a,e.target);if(!n.has(t))continue;const r=tw(Zk(await n.extract(t),t));r&&M.push(r)}const Q=l.filter(e=>Kk(e.type,"timelineCache")).sort((e,t)=>nS(e.target)-nS(t.target)),T=[];for(const e of Q){const t=$b(a,e.target);if(!n.has(t))continue;const r=rw(Zk(await n.extract(t),t));r&&T.push(r)}let L;const R=l.find(e=>Kk(e.type,"sheetMetadata"));if(R){const e=$b(a,R.target);n.has(e)&&(L=function(e){const t=new Set,n=Lb(e),r="metadata"===n.local?n:Rb(n,"metadata");if(!r)return t;const i=[],o=Rb(r,"metadataTypes");if(o)for(const e of Ub(o))"metadataType"===e.local&&i.push(e.attrs.name??"");const a=new Map;for(const e of Ub(r)){if("futureMetadata"!==e.local)continue;const t=e.attrs.name??"",n=a.get(t)??[];for(const t of Ub(e))"bk"===t.local&&n.push(tk(t));a.set(t,n)}const s=Rb(r,"cellMetadata");if(!s)return t;let l=0;for(const e of Ub(s))if("bk"===e.local){l++;for(const n of Ub(e)){if("rc"!==n.local)continue;if(i[Ob(n.attrs.t,0)-1]!==KE)continue;const e=a.get(KE),r=Ob(n.attrs.v,-1);(!e||r<0||r>=e.length||e[r])&&t.add(l)}}return t}(Zk(await n.extract(e),e)))}const U=new Map,H=new Map;for(const e of l)Kk(e.type,"worksheet")?U.set(e.id,$b(a,e.target)):Kk(e.type,"chartsheet")?H.set(e.id,"chartsheet"):Kk(e.type,"dialogsheet")&&H.set(e.id,"dialogsheet");const q=function(e,t){if(void 0===t)return e;if("function"==typeof t){const n=[];for(let r=0;r<e.length;r++){const i=e[r];t({name:i.name,index:r,hidden:"hidden"===i.state,veryHidden:"veryHidden"===i.state},r)&&n.push(i)}return n}if(0===t.length)return e;const n=[];for(const r of t)if("number"==typeof r)r>=0&&r<e.length&&n.push(e[r]);else{const t=e.find(e=>e.name===r);t&&n.push(t)}return n}(u,t?.sheets),O=t?.readStyles??!1,P=[];for(const e of q){const r=H.get(e.rId);if(void 0!==r){const t={name:e.name,rows:[],kind:r};"hidden"===e.state&&(t.hidden=!0),"veryHidden"===e.state&&(t.veryHidden=!0),P.push(t);continue}const i=U.get(e.rId);if(!i||!n.has(i))throw new pb(`Invalid XLSX: missing worksheet file for sheet "${e.name}"`);const o=jb(i),s=iS(i);let c;if(n.has(s)){c=zb(Zk(await n.extract(s),s))}const u={sharedStrings:m,styles:v,readStyles:O,dateSystem:f,worksheetRels:c,maxRows:t?.maxRows,range:t?.range,maxTotalCells:t?.maxTotalCells,sparse:t?.sparse,dynamicArrayCm:L,sheetName:e.name,onWarning:t?.onWarning},d=await eS(n,i,e.name,u);if("hidden"===e.state&&(d.hidden=!0),"veryHidden"===e.state&&(d.veryHidden=!0),c){const e=c.find(e=>Kk(e.type,"drawing"));if(e){const t=$b(o,e.target),r=await aS(n,t);if(r.images.length>0&&(d.images=r.images),r.textBoxes.length>0&&(d.textBoxes=r.textBoxes),r.chartRefs.length>0){const e=[];for(const t of r.chartRefs){if(!n.has(t.path))continue;const r=TC(Zk(await n.extract(t.path),t.path));r&&(t.anchor&&(r.anchor=t.anchor),t.altText&&(r.altText=t.altText),t.frameTitle&&(r.frameTitle=t.frameTitle),e.push(r))}e.length>0&&(d.charts=e)}}}if(c){const e=c.find(e=>Kk(e.type,"comments"));if(e){const t=$b(o,e.target);if(n.has(t)){const e=Wk(Zk(await n.extract(t),t));if(e.size>0){d.cells||(d.cells=new Map);for(const[t,n]of e){const e=Rk(t),r=`${e.row},${e.col}`;let i=d.cells.get(r);i||(i={value:(d.rows[e.row]&&d.rows[e.row][e.col])??null,type:"string"},d.cells.set(r,i)),i.comment=n}}}}const t=c.find(e=>Kk(e.type,"threadedComment"));if(t){const e=$b(o,t.target);if(n.has(e)){const t=Pb(Zk(await n.extract(e),e));t.length>0&&(d.threadedComments=t)}}}if(c){const e=c.filter(e=>Kk(e.type,"table"));if(e.length>0){const t=[];for(const r of e){const e=$b(o,r.target);if(n.has(e)){const r=wS(Zk(await n.extract(e),e));r&&t.push(r)}}t.length>0&&(d.tables=t)}}if(c){const e=c.find(e=>Kk(e.type,"image"));if(e){const t=$b(o,e.target);n.has(t)&&(d.backgroundImage=await n.extract(t))}}if(c){const e=c.filter(e=>Kk(e.type,"pivotTable"));if(e.length>0){const t=[];for(const r of e){const e=$b(o,r.target);if(!n.has(e))continue;const i=Xb(Zk(await n.extract(e),e));if(!i)continue;const s=iS(e);if(n.has(s)){const t=zb(Zk(await n.extract(s),s)).find(e=>Kk(e.type,"pivotCacheDefinition"));if(t){const n=$b(jb(e),t.target);for(const e of g){const t=l.find(t=>t.id===e.rId);if(!t)continue;if($b(a,t.target)===n){i.cacheId=e.cacheId;break}}}}const c=S.get(i.cacheId);c&&Kb(i,c),t.push(i)}t.length>0&&(d.pivotTables=t)}const t=c.filter(e=>Kk(e.type,"slicer"));if(t.length>0){const e=[];for(const r of t){const t=$b(o,r.target);if(!n.has(t))continue;const i=Zk(await n.extract(t),t);for(const t of ew(i))e.push(t)}e.length>0&&(d.slicers=e)}const r=c.filter(e=>Kk(e.type,"timeline"));if(r.length>0){const e=[];for(const t of r){const r=$b(o,t.target);if(!n.has(r))continue;const i=Zk(await n.extract(r),r);for(const t of nw(i))e.push(t)}e.length>0&&(d.timelines=e)}}P.push(d)}let z;if(n.has("docProps/core.xml")){const e=function(e){const t=Lb(e),n={};for(const e of t.children){if("string"==typeof e)continue;const t=e.local||e.tag,r=e.children.filter(e=>"string"==typeof e).join("");switch(t){case"title":r&&(n.title=r);break;case"subject":r&&(n.subject=r);break;case"creator":r&&(n.creator=r);break;case"keywords":r&&(n.keywords=r);break;case"description":r&&(n.description=r);break;case"lastModifiedBy":r&&(n.lastModifiedBy=r);break;case"category":r&&(n.category=r);break;case"created":if(r){const e=_k(r);e&&(n.created=e)}break;case"modified":if(r){const e=_k(r);e&&(n.modified=e)}}}return n}(Zk(await n.extract("docProps/core.xml"),"docProps/core.xml"));Object.keys(e).length>0&&(z={...e})}if(n.has("docProps/app.xml")){const e=function(e){const t=Lb(e),n={},r=Jk(t,"Company");r&&(n.company=r);const i=Jk(t,"Manager");return i&&(n.manager=i),n}(Zk(await n.extract("docProps/app.xml"),"docProps/app.xml"));Object.keys(e).length>0&&(z={...z,...e})}if(n.has("docProps/custom.xml")){const e=function(e){const t=Lb(e),n={};for(const e of t.children){if("string"==typeof e)continue;if("property"!==(e.local||e.tag))continue;const t=e.attrs.name;if(t)for(const r of e.children){if("string"==typeof r)continue;const e=r.local||r.tag,i=r.children.filter(e=>"string"==typeof e).join("");switch(e){case"lpwstr":n[t]=i;break;case"i4":case"i8":case"int":i&&(n[t]=parseInt(i,10));break;case"r8":case"decimal":i&&(n[t]=parseFloat(i));break;case"bool":n[t]="true"===i||"1"===i;break;case"filetime":case"date":if(i){const e=new Date(i);Number.isNaN(e.getTime())||(n[t]=e)}}break}}return n}(Zk(await n.extract("docProps/custom.xml"),"docProps/custom.xml"));Object.keys(e).length>0&&(z||(z={}),z.custom=e)}const $={sheets:P,dateSystem:f},j=function(e,t){if(0===t.length)return t;const n=new Map;for(const t of e)n.set(t.name,t);const r=[];for(const e of t){const t="_xlnm.Print_Area"===e.name,i="_xlnm.Print_Titles"===e.name,o=void 0!==e.scope?n.get(e.scope):void 0;if(!t&&!i||!o){r.push(e);continue}const a=o.pageSetup??(o.pageSetup={});if(t){const t=e.range.split(",").map(bS).filter(e=>e.length>0).join(",");t&&(a.printArea=t)}else for(const t of e.range.split(",")){const e=bS(t);e&&(/\d/.test(e)?a.printTitlesRow=e:a.printTitlesColumn=e)}}return r}(P,d);j.length>0&&($.namedRanges=j),z&&($.properties=z),b&&($.themeColors=b),h&&($.workbookProtection=h),void 0!==p&&($.activeSheet=p);const V=v?.fonts[0];return V&&Object.keys(V).length>0&&($.defaultFont=V),I&&I.length>0&&($.persons=I),B.length>0&&($.externalLinks=B),E&&E.length>0&&($.cellImages=E),D.length>0&&($.pivotCaches=D),M.length>0&&($.slicerCaches=M),T.length>0&&($.timelineCaches=T),$}function nS(e){const t=e.match(/(\d+)\.xml$/i);return t?parseInt(t[1],10):Number.POSITIVE_INFINITY}function rS(e){const t=e.match(/(\d+)$/);return t?parseInt(t[1],10):Number.POSITIVE_INFINITY}function iS(e){const t=e.lastIndexOf("/");return-1===t?`_rels/${e}.rels`:`${e.slice(0,t)}/_rels/${e.slice(t+1)}.rels`}const oS={png:"png",jpg:"jpeg",jpeg:"jpeg",gif:"gif",svg:"svg",webp:"webp"};async function aS(e,t){if(!e.has(t))return{images:[],textBoxes:[],chartRefs:[]};const n=Zk(await e.extract(t),t),r=jb(t),i=iS(t),o=new Map,a=new Map;if(e.has(i)){const t=zb(Zk(await e.extract(i),i));for(const e of t)Kk(e.type,"image")?o.set(e.id,$b(r,e.target)):Kk(e.type,"chart")&&a.set(e.id,$b(r,e.target))}const s=Lb(n),l=[],c=[],u=[];for(const t of s.children){if("string"==typeof t)continue;const n=t.local||t.tag;if("twoCellAnchor"===n||"oneCellAnchor"===n||"absoluteAnchor"===n){const e=lS(t);if(e){const r=a.get(e);if(r&&!u.some(e=>e.path===r)){const e="absoluteAnchor"===n?void 0:sS(t,n),i={path:r};e&&(i.anchor=e);const o=dS(t,"graphicFrame");if(o){const e=mS(o,"nvGraphicFramePr");e.altText&&(i.altText=e.altText),e.title&&(i.frameTitle=e.title)}u.push(i)}}}if("twoCellAnchor"===n){const n=fS(t);if(n){c.push(n);continue}const r=cS(t,o);if(r){const t=r.mediaPath;if(e.has(t)){const n={data:await e.extract(t),type:r.type,anchor:r.anchor};void 0!==r.width&&(n.width=r.width),void 0!==r.height&&(n.height=r.height),void 0!==r.altText&&(n.altText=r.altText),void 0!==r.title&&(n.title=r.title),l.push(n)}}}else if("oneCellAnchor"===n){const n=gS(t,o);if(n){const t=n.mediaPath;if(e.has(t)){const r={data:await e.extract(t),type:n.type,anchor:n.anchor};void 0!==n.width&&(r.width=n.width),void 0!==n.height&&(r.height=n.height),void 0!==n.altText&&(r.altText=n.altText),void 0!==n.title&&(r.title=n.title),l.push(r)}}}}return{images:l,textBoxes:c,chartRefs:u}}function sS(e,t){let n,r;for(const t of e.children){if("string"==typeof t)continue;const e=t,i=e.local||e.tag;"from"===i?n=yS(e):"to"===i&&(r=yS(e))}if(n)return"twoCellAnchor"===t&&r?{from:n,to:r}:{from:n}}function lS(e){for(const t of e.children){if("string"==typeof t)continue;const e=t;if("chart"===(e.local||e.tag)){const t=e.attrs["r:id"]??e.attrs.id;if(t)return t}const n=lS(e);if(n)return n}}function cS(e,t){let n,r,i,o,a=0,s=0,l=0,c=0;for(const t of e.children){if("string"==typeof t)continue;const e=t,u=e.local||e.tag;if("from"===u){const t=yS(e);a=t.row,s=t.col}else if("to"===u){const t=yS(e);l=t.row,c=t.col}else if("pic"===u){n=vS(e);const t=mS(e,"nvPicPr");r=t.altText,i=t.title,o=uS(e)}}if(!n)return null;const u=t.get(n);if(!u)return null;const f=u.split(".").pop()?.toLowerCase()??"",d={mediaPath:u,type:oS[f]??"png",anchor:{from:{row:a,col:s},to:{row:l,col:c}}};return o&&(d.width=o.width,d.height=o.height),r&&(d.altText=r),i&&(d.title=i),d}function uS(e){const t=dS(e,"spPr");if(!t)return;const n=dS(t,"xfrm");if(!n)return;const r=dS(n,"ext");if(!r)return;const i=Number(r.attrs.cx),o=Number(r.attrs.cy);return i>0&&o>0?{width:Math.round(i/pS),height:Math.round(o/pS)}:void 0}function fS(e){let t=0,n=0,r=0,i=0,o=null;for(const a of e.children){if("string"==typeof a)continue;const e=a,s=e.local||e.tag;if("from"===s){const r=yS(e);t=r.row,n=r.col}else if("to"===s){const t=yS(e);r=t.row,i=t.col}else if("sp"===s){const t=dS(e,"nvSpPr");if(t){const n=dS(t,"cNvSpPr");!n||"1"!==n.attrs.txBox&&"true"!==n.attrs.txBox||(o=e)}}}if(!o)return null;const a=dS(o,"txBody");let s,l,c,u,f,d="";if(a){const e=[];for(const t of a.children){if("string"==typeof t)continue;if("p"===(t.local||t.tag)){const n=hS(t);e.push(n.text),void 0!==n.fontSize&&void 0===s&&(s=n.fontSize),void 0!==n.bold&&void 0===l&&(l=n.bold),void 0!==n.color&&void 0===c&&(c=n.color)}}d=e.join("\n")}if(!d)return null;const h=dS(o,"spPr");if(h){const e=dS(h,"solidFill");if(e){const t=dS(e,"srgbClr");t&&t.attrs.val&&(u=t.attrs.val)}const t=dS(h,"ln");if(t){const e=dS(t,"solidFill");if(e){const t=dS(e,"srgbClr");t&&t.attrs.val&&(f=t.attrs.val)}}}const p={text:d,anchor:{from:{row:t,col:n},to:{row:r,col:i}}},g=uS(o);g&&(p.width=g.width,p.height=g.height);const m=mS(o,"nvSpPr");m.altText&&(p.altText=m.altText),m.title&&(p.title=m.title);const y={};let v=!1;return void 0!==s&&(y.fontSize=s,v=!0),void 0!==l&&(y.bold=l,v=!0),void 0!==c&&(y.color=c,v=!0),void 0!==u&&(y.fillColor=u,v=!0),void 0!==f&&(y.borderColor=f,v=!0),v&&(p.style=y),p}function dS(e,t){for(const n of e.children){if("string"==typeof n)continue;const e=n;if((e.local||e.tag)===t)return e}return null}function hS(e){let t,n,r,i="";for(const o of e.children){if("string"==typeof o)continue;const e=o;if("r"===(e.local||e.tag)){const o=dS(e,"rPr");if(o){o.attrs.sz&&(t=Number(o.attrs.sz)/100),"1"!==o.attrs.b&&"true"!==o.attrs.b||(n=!0);const e=dS(o,"solidFill");if(e){const t=dS(e,"srgbClr");t&&t.attrs.val&&(r=t.attrs.val)}}const a=dS(e,"t");a&&(i+=a.children.filter(e=>"string"==typeof e).join(""))}}return{text:i,fontSize:t,bold:n,color:r}}const pS=9525;function gS(e,t){let n,r,i,o=0,a=0,s=0,l=0;for(const t of e.children){if("string"==typeof t)continue;const e=t,c=e.local||e.tag;if("from"===c){const t=yS(e);o=t.row,a=t.col}else if("ext"===c)s=Number(e.attrs.cx)||0,l=Number(e.attrs.cy)||0;else if("pic"===c){n=vS(e);const t=mS(e,"nvPicPr");r=t.altText,i=t.title}}if(!n)return null;const c=t.get(n);if(!c)return null;const u=c.split(".").pop()?.toLowerCase()??"",f={mediaPath:c,type:oS[u]??"png",anchor:{from:{row:o,col:a}}};return s>0&&(f.width=Math.round(s/pS)),l>0&&(f.height=Math.round(l/pS)),r&&(f.altText=r),i&&(f.title=i),f}function mS(e,t){const n=dS(e,t);if(!n)return{};const r=dS(n,"cNvPr");if(!r)return{};const i={};return r.attrs.descr&&(i.altText=r.attrs.descr),r.attrs.title&&(i.title=r.attrs.title),i}function yS(e){let t=0,n=0;for(const r of e.children){if("string"==typeof r)continue;const e=r,i=e.local||e.tag,o=e.children.filter(e=>"string"==typeof e).join("");"row"===i?t=Number(o)||0:"col"===i&&(n=Number(o)||0)}return{row:t,col:n}}function vS(e){for(const t of e.children){if("string"==typeof t)continue;const e=t;if("blipFill"===(e.local||e.tag))for(const t of e.children){if("string"==typeof t)continue;const e=t;if("blip"===(e.local||e.tag))return e.attrs["r:embed"]??e.attrs["R:embed"]??AS(e.attrs)}}}function AS(e){for(const t of Object.keys(e))if(t.endsWith(":embed")&&e[t].startsWith("rId"))return e[t]}function bS(e){const t=e.trim(),n=t.lastIndexOf("!");return-1===n?t:t.slice(n+1)}function wS(e){const t=Lb(e),n=t.attrs.name??"",r=t.attrs.displayName??n,i=t.attrs.ref??"";if(!n)return null;const o=t.attrs.totalsRowCount,a=void 0!==o&&"0"!==o,s=[];let l,c,u,f=!1;for(const e of t.children){if("string"==typeof e)continue;const t=e.local||e.tag;if("autoFilter"===t)f=!0;else if("tableColumns"===t)for(const t of e.children){if("string"==typeof t)continue;if("tableColumn"===(t.local||t.tag)){const e={name:t.attrs.name??""};t.attrs.totalsRowFunction&&(e.totalFunction=t.attrs.totalsRowFunction),t.attrs.totalsRowLabel&&(e.totalLabel=t.attrs.totalsRowLabel);for(const n of t.children){if("string"==typeof n)continue;if("totalsRowFormula"===(n.local||n.tag)){const t=n.children.filter(e=>"string"==typeof e).join("");t&&(e.totalFormula=t)}}s.push(e)}}else"tableStyleInfo"===t&&(l=e.attrs.name,c="1"===e.attrs.showRowStripes,u="1"===e.attrs.showColumnStripes)}const d={name:n,columns:s};return r&&r!==n&&(d.displayName=r),i&&(d.range=i),l&&(d.style=l),void 0!==c&&(d.showRowStripes=c),void 0!==u&&(d.showColumnStripes=u),d.showAutoFilter=f,a&&(d.showTotalRow=!0),d}async function IS(e){if(function(){if(void 0===VB)try{new CompressionStream("deflate-raw"),VB="undefined"!=typeof ReadableStream}catch{VB=!1}return VB}())try{const t=new CompressionStream("deflate-raw"),n=t.writable.getWriter(),r=t.readable.getReader();n.write(e),n.close();const i=[];let o=0;for(;;){const{done:e,value:t}=await r.read();if(e)break;i.push(t),o+=t.length}const a=new Uint8Array(o);let s=0;for(const e of i)a.set(e,s),s+=e.length;return a}catch{}return PB(e)}class xS{entries=[];paths=new Set;add(e,t,n){if(this.paths.has(e))throw new gb(`Duplicate ZIP entry: "${e}"`);this.paths.add(e);const r=n?.compress??!0;this.entries.push({path:e,data:t,compress:r})}async build(){const e=[];for(const t of this.entries){const n=t.data.length>0?FB(t.data):0;let r,i;t.compress&&t.data.length>0?(r=await IS(t.data),i=8,r.length>=t.data.length&&(r=t.data,i=0)):(r=t.data,i=0),e.push({path:t.path,data:t.data,compressedData:r,method:i,entryCrc32:n})}const t=new TextEncoder,n=e.map(e=>t.encode(e.path));let r=0;for(let t=0;t<e.length;t++)r+=30+n[t].length+e[t].compressedData.length;let i=0;for(let t=0;t<e.length;t++)i+=46+n[t].length;const o=new Uint8Array(r+i+22),a=new DataView(o.buffer);let s=0;const l=[];for(let t=0;t<e.length;t++){const r=e[t],i=n[t];l.push(s),a.setUint32(s,67324752,!0),a.setUint16(s+4,20,!0),a.setUint16(s+6,0,!0),a.setUint16(s+8,r.method,!0),a.setUint16(s+10,0,!0),a.setUint16(s+12,33,!0),a.setUint32(s+14,r.entryCrc32,!0),a.setUint32(s+18,r.compressedData.length,!0),a.setUint32(s+22,r.data.length,!0),a.setUint16(s+26,i.length,!0),a.setUint16(s+28,0,!0),o.set(i,s+30),s+=30+i.length,o.set(r.compressedData,s),s+=r.compressedData.length}const c=s;for(let t=0;t<e.length;t++){const r=e[t],i=n[t];a.setUint32(s,33639248,!0),a.setUint16(s+4,20,!0),a.setUint16(s+6,20,!0),a.setUint16(s+8,0,!0),a.setUint16(s+10,r.method,!0),a.setUint16(s+12,0,!0),a.setUint16(s+14,33,!0),a.setUint32(s+16,r.entryCrc32,!0),a.setUint32(s+20,r.compressedData.length,!0),a.setUint32(s+24,r.data.length,!0),a.setUint16(s+28,i.length,!0),a.setUint16(s+30,0,!0),a.setUint16(s+32,0,!0),a.setUint16(s+34,0,!0),a.setUint16(s+36,0,!0),a.setUint32(s+38,0,!0),a.setUint32(s+42,l[t],!0),o.set(i,s+46),s+=46+i.length}const u=s-c;return a.setUint32(s,101010256,!0),a.setUint16(s+4,0,!0),a.setUint16(s+6,0,!0),a.setUint16(s+8,e.length,!0),a.setUint16(s+10,e.length,!0),a.setUint32(s+12,u,!0),a.setUint32(s+16,c,!0),a.setUint16(s+20,0,!0),o}}const CS={png:"image/png",jpeg:"image/jpeg",gif:"image/gif",svg:"image/svg+xml",webp:"image/webp"};const BS="http://schemas.openxmlformats.org/package/2006/relationships";function ES(e,t){const n={};return void 0!==t.rgb&&(n.rgb=6===t.rgb.length?`FF${t.rgb}`:t.rgb),void 0!==t.theme&&(n.theme=t.theme),void 0!==t.tint&&(n.tint=t.tint),void 0!==t.indexed&&(n.indexed=t.indexed),fw(e,n)}function kS(e){const t=[];return e.bold&&t.push(fw("b")),e.italic&&t.push(fw("i")),void 0!==e.underline&&!1!==e.underline&&(!0===e.underline||"single"===e.underline?t.push(fw("u")):t.push(fw("u",{val:e.underline}))),e.strikethrough&&t.push(fw("strike")),void 0!==e.charset&&t.push(fw("charset",{val:e.charset})),void 0!==e.family&&t.push(fw("family",{val:e.family})),e.scheme&&t.push(fw("scheme",{val:e.scheme})),e.color&&t.push(ES("color",e.color)),void 0!==e.size&&t.push(fw("sz",{val:e.size})),e.name&&t.push(fw("name",{val:e.name})),e.vertAlign&&t.push(fw("vertAlign",{val:e.vertAlign})),hw("font",void 0,t)}function SS(e){if("pattern"===e.type){const t=[];e.fgColor&&t.push(ES("fgColor",e.fgColor)),e.bgColor&&t.push(ES("bgColor",e.bgColor));const n=hw("patternFill",{patternType:e.pattern},t.length>0?t:void 0);return hw("fill",void 0,[n])}const t=[];for(const n of e.stops)t.push(hw("stop",{position:n.position},[ES("color",n.color)]));const n={};void 0!==e.degree&&(n.degree=e.degree);const r=hw("gradientFill",n,t);return hw("fill",void 0,[r])}function FS(e,t){return t?t.color?hw(""+e,{style:t.style},[ES("color",t.color)]):fw(e,{style:t.style}):fw(e)}function DS(e){const t={};e.diagonalUp&&(t.diagonalUp=!0),e.diagonalDown&&(t.diagonalDown=!0);const n=[FS("left",e.left),FS("right",e.right),FS("top",e.top),FS("bottom",e.bottom),FS("diagonal",e.diagonal)];return hw("border",Object.keys(t).length>0?t:void 0,n)}function NS(e){if(!e)return"";const t=[];return void 0!==e.rgb&&t.push(`rgb:${e.rgb}`),void 0!==e.theme&&t.push(`th:${e.theme}`),void 0!==e.tint&&t.push(`tint:${e.tint}`),void 0!==e.indexed&&t.push(`idx:${e.indexed}`),t.join("|")}function MS(e){const t=[];return e.name&&t.push(`n:${e.name}`),void 0!==e.size&&t.push(`s:${e.size}`),e.bold&&t.push("b"),e.italic&&t.push("i"),void 0!==e.underline&&!1!==e.underline&&t.push(`u:${e.underline}`),e.strikethrough&&t.push("st"),e.color&&t.push(`c:${NS(e.color)}`),e.vertAlign&&t.push(`va:${e.vertAlign}`),void 0!==e.family&&t.push(`fam:${e.family}`),void 0!==e.charset&&t.push(`cs:${e.charset}`),e.scheme&&t.push(`sch:${e.scheme}`),t.join(",")}function QS(e){return"pattern"===e.type?`p:${e.pattern}|fg:${NS(e.fgColor)}|bg:${NS(e.bgColor)}`:`g:${e.degree??""}|${e.stops.map(e=>`${e.position}:${NS(e.color)}`).join(";")}`}function TS(e){return e?`${e.style}:${NS(e.color)}`:""}function LS(e){return[`l:${TS(e.left)}`,`r:${TS(e.right)}`,`t:${TS(e.top)}`,`b:${TS(e.bottom)}`,`d:${TS(e.diagonal)}`,e.diagonalUp?"du":"",e.diagonalDown?"dd":""].join("|")}function RS(e,t){const n=t?.reuseStyleIdentity??!1,r={name:e?.name??"Calibri",size:e?.size??11,...e},i=[{key:MS(r),font:r}],o=new Map([[i[0].key,0]]),a=[{key:"p:none|fg:|bg:",fill:{type:"pattern",pattern:"none"}},{key:"p:gray125|fg:|bg:",fill:{type:"pattern",pattern:"gray125"}}],s=new Map([[a[0].key,0],[a[1].key,1]]),l={},c=[{key:LS(l),border:l}],u=new Map([[c[0].key,0]]),f=[],d=new Map;let h=164;const p="nf:0|f:0|fl:0|b:0|a:|p:",g=[{key:p,numFmtId:0,fontId:0,fillId:0,borderId:0}],m=new Map([[p,0]]);function y(e){const t=d.get(e);if(void 0!==t)return t;const n=h++;return f.push({id:n,formatCode:e}),d.set(e,n),n}function v(e){if(!e)return"";const t=[];return e.horizontal&&t.push(`h:${e.horizontal}`),e.vertical&&t.push(`v:${e.vertical}`),e.wrapText&&t.push("w"),e.shrinkToFit&&t.push("sf"),void 0!==e.textRotation&&t.push(`r:${e.textRotation}`),void 0!==e.indent&&t.push(`i:${e.indent}`),e.readingOrder&&t.push(`ro:${e.readingOrder}`),t.join(",")}function A(e){if(!e)return"";const t=[];return void 0!==e.locked&&t.push(`l:${e.locked}`),void 0!==e.hidden&&t.push(`h:${e.hidden}`),t.join(",")}const b=[],w=new Map;const I=n?new WeakMap:void 0;function x(e,t){if(I&&!t){const t=I.get(e);if(void 0!==t)return t}const n=e.font?function(e){const t=MS(e),n=o.get(t);if(void 0!==n)return n;const r=i.length;return i.push({key:t,font:HE(e)}),o.set(t,r),r}(e.font):0,r=e.fill?function(e){const t=QS(e),n=s.get(t);if(void 0!==n)return n;const r=a.length;return a.push({key:t,fill:qE(e)}),s.set(t,r),r}(e.fill):0,l=e.border?function(e){const t=LS(e),n=u.get(t);if(void 0!==n)return n;const r=c.length;return c.push({key:t,border:PE(e)}),u.set(t,r),r}(e.border):0,f=e.numFmt?y(e.numFmt):0,d=[`nf:${f}`,`f:${n}`,`fl:${r}`,`b:${l}`,`a:${v(e.alignment)}`,`p:${A(e.protection)}`,t?"cb:1":"cb:0"].join("|"),h=m.get(d);if(void 0!==h)return I&&!t&&I.set(e,h),h;const p=g.length;return g.push({key:d,numFmtId:f,fontId:n,fillId:r,borderId:l,alignment:e.alignment?{...e.alignment}:void 0,protection:e.protection?{...e.protection}:void 0,hasCheckboxFeature:t||void 0}),m.set(d,p),I&&!t&&I.set(e,p),p}function C(e){const t={};if(e.horizontal&&(t.horizontal=e.horizontal),e.vertical&&(t.vertical=e.vertical),e.wrapText&&(t.wrapText=!0),e.shrinkToFit&&(t.shrinkToFit=!0),void 0!==e.textRotation&&(t.textRotation=e.textRotation),void 0!==e.indent&&(t.indent=e.indent),e.readingOrder){const n={ltr:1,rtl:2,context:0};t.readingOrder=n[e.readingOrder]}return fw("alignment",t)}return{addStyle:function(e){return x(e,!1)},addCheckboxStyle:function(e){return x(e??{},!0)},addNumFmt:y,addDxf:function(e){const t=function(e){const t=[];return e.font&&t.push(`f:${MS(e.font)}`),e.fill&&t.push(`fl:${QS(e.fill)}`),e.border&&t.push(`b:${LS(e.border)}`),e.numFmt&&t.push(`nf:${e.numFmt}`),e.alignment&&t.push(`a:${v(e.alignment)}`),t.join("|")}(e),n=w.get(t);if(void 0!==n)return n;const r=b.length;return b.push(e),w.set(t,r),r},hasCheckboxFeature:function(){for(const e of g)if(e.hasCheckboxFeature)return!0;return!1},toXml:function(){const e=[];if(f.length>0){const t=f.map(e=>fw("numFmt",{numFmtId:e.id,formatCode:e.formatCode}));e.push(hw("numFmts",{count:f.length},t))}const t=i.map(e=>kS(e.font));e.push(hw("fonts",{count:i.length},t));const n=a.map(e=>SS(e.fill));e.push(hw("fills",{count:a.length},n));const r=c.map(e=>DS(e.border));e.push(hw("borders",{count:c.length},r)),e.push(hw("cellStyleXfs",{count:1},[fw("xf",{numFmtId:0,fontId:0,fillId:0,borderId:0})]));const o=g.map(e=>{const t={numFmtId:e.numFmtId,fontId:e.fontId,fillId:e.fillId,borderId:e.borderId,xfId:0};0!==e.numFmtId&&(t.applyNumberFormat=!0),0!==e.fontId&&(t.applyFont=!0),0!==e.fillId&&(t.applyFill=!0),0!==e.borderId&&(t.applyBorder=!0);const n=void 0!==e.alignment,r=void 0!==e.protection,i=!0===e.hasCheckboxFeature;if(n&&(t.applyAlignment=!0),r&&(t.applyProtection=!0),n||r||i){const o=[];return n&&o.push(C(e.alignment)),r&&o.push(function(e){const t={};return void 0!==e.locked&&(t.locked=e.locked?1:0),void 0!==e.hidden&&(t.hidden=e.hidden?1:0),fw("protection",t)}(e.protection)),i&&o.push(hw("extLst",void 0,hw("ext",{uri:dE,"xmlns:xfpb":fE},fw("xfpb:xfComplement",{i:"0"})))),hw("xf",t,o)}return fw("xf",t)});if(e.push(hw("cellXfs",{count:g.length},o)),e.push(hw("cellStyles",{count:1},[fw("cellStyle",{name:"Normal",xfId:0,builtinId:0})])),b.length>0){const t=b.map(e=>{const t=[];if(e.font&&t.push(kS(e.font)),e.numFmt){const n=y(e.numFmt);t.push(fw("numFmt",{numFmtId:n,formatCode:e.numFmt}))}return e.fill&&t.push(SS(e.fill)),e.border&&t.push(DS(e.border)),e.alignment&&t.push(C(e.alignment)),hw("dxf",void 0,t)});e.push(hw("dxfs",{count:b.length},t))}else e.push(fw("dxfs",{count:0}));return e.push(fw("tableStyles",{count:0,defaultTableStyle:"TableStyleMedium2",defaultPivotStyle:"PivotStyleLight16"})),pw("styleSheet",{xmlns:"http://schemas.openxmlformats.org/spreadsheetml/2006/main"},e)}}}function US(e){const t=e;return t.length>=8&&137===t[0]&&80===t[1]&&78===t[2]&&71===t[3]?"png":t.length>=3&&255===t[0]&&216===t[1]&&255===t[2]?"jpeg":t.length>=6&&71===t[0]&&73===t[1]&&70===t[2]?"gif":t.length>=12&&82===t[0]&&73===t[1]&&70===t[2]&&70===t[3]&&87===t[8]&&69===t[9]&&66===t[10]&&80===t[11]?"webp":function(e){const t=e.subarray(0,HS);let n="";for(let e=0;e<t.length;e++)n+=String.fromCharCode(t[e]);const r=n.trimStart().replace(/^/,"");return!!r.startsWith("<")&&/<svg[\s>]/i.test(r)}(t)?"svg":"png"}const HS=1024;const qS="http://schemas.openxmlformats.org/officeDocument/2006/relationships",OS="http://schemas.openxmlformats.org/drawingml/2006/chart",PS=9525,zS={png:"png",jpeg:"jpeg",gif:"gif",svg:"svg",webp:"webp"},$S={png:"image/png",jpeg:"image/jpeg",gif:"image/gif",svg:"image/svg+xml",webp:"image/webp"};function jS(e,t,n,r,i=1){const o=[],a=[],s=[];for(let n=0;n<e.length;n++){const r=e[n],i=t+n,l=`rId${n+1}`,c=zS[r.type]??"png",u=$S[r.type]??"image/png",f=`xl/media/image${i}.${c}`,d=`../media/image${i}.${c}`;o.push({path:f,data:r.data,contentType:u}),a.push(fw("Relationship",{Id:l,Type:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/image",Target:d}));const h=r.width?r.width*PS:3e6,p=r.height?r.height*PS:2e6,g=r.anchor.from.col,m=r.anchor.from.row,y=r.anchor.to?.col??g+3,v=r.anchor.to?.row??m+5,A=hw("xdr:from",void 0,[hw("xdr:col",void 0,String(g)),hw("xdr:colOff",void 0,"0"),hw("xdr:row",void 0,String(m)),hw("xdr:rowOff",void 0,"0")]),b=hw("xdr:to",void 0,[hw("xdr:col",void 0,String(y)),hw("xdr:colOff",void 0,"0"),hw("xdr:row",void 0,String(v)),hw("xdr:rowOff",void 0,"0")]),w={id:n+2,name:`Picture ${n+1}`};r.title&&(w.title=r.title),r.altText&&(w.descr=r.altText);const I=hw("xdr:nvPicPr",void 0,[fw("xdr:cNvPr",w),hw("xdr:cNvPicPr",void 0,[fw("a:picLocks",{noChangeAspect:1})])]),x=hw("xdr:blipFill",void 0,[fw("a:blip",{"r:embed":l}),hw("a:stretch",void 0,[fw("a:fillRect")])]),C=hw("xdr:spPr",void 0,[hw("a:xfrm",void 0,[fw("a:off",{x:0,y:0}),fw("a:ext",{cx:h,cy:p})]),hw("a:prstGeom",{prst:"rect"},[fw("a:avLst")])]),B=hw("xdr:pic",void 0,[I,x,C]),E=hw("xdr:twoCellAnchor",void 0,[A,b,B,fw("xdr:clientData")]);s.push(E)}if(n&&n.length>0){let t=e.length+2;for(let e=0;e<n.length;e++){const r=n[e],i=r.anchor.from.col,o=r.anchor.from.row,a=r.anchor.to?.col??i+3,l=r.anchor.to?.row??o+3,c=r.width?r.width*PS:2e6,u=r.height?r.height*PS:5e5,f=hw("xdr:from",void 0,[hw("xdr:col",void 0,String(i)),hw("xdr:colOff",void 0,"0"),hw("xdr:row",void 0,String(o)),hw("xdr:rowOff",void 0,"0")]),d=hw("xdr:to",void 0,[hw("xdr:col",void 0,String(a)),hw("xdr:colOff",void 0,"0"),hw("xdr:row",void 0,String(l)),hw("xdr:rowOff",void 0,"0")]),h={id:t++,name:`TextBox ${e+1}`};r.title&&(h.title=r.title),r.altText&&(h.descr=r.altText);const p=hw("xdr:nvSpPr",void 0,[fw("xdr:cNvPr",h),hw("xdr:cNvSpPr",{txBox:1},[])]),g=[hw("a:xfrm",void 0,[fw("a:off",{x:0,y:0}),fw("a:ext",{cx:c,cy:u})]),hw("a:prstGeom",{prst:"rect"},[fw("a:avLst")])],m=r.style?.fillColor??"FFFFFF";g.push(hw("a:solidFill",void 0,[fw("a:srgbClr",{val:m})]));const y=r.style?.borderColor??"000000";g.push(hw("a:ln",void 0,[hw("a:solidFill",void 0,[fw("a:srgbClr",{val:y})])]));const v=hw("xdr:spPr",void 0,g),A={lang:"en-US",sz:100*(r.style?.fontSize??11)};r.style?.bold&&(A.b=1);const b=[];r.style?.color&&b.push(hw("a:solidFill",void 0,[fw("a:srgbClr",{val:r.style.color})]));const w=b.length>0?hw("a:rPr",A,b):fw("a:rPr",A),I=hw("xdr:txBody",void 0,[fw("a:bodyPr",{wrap:"square"}),hw("a:p",void 0,[hw("a:r",void 0,[w,hw("a:t",void 0,lw(r.text))])])]),x=hw("xdr:sp",void 0,[p,v,I]),C=hw("xdr:twoCellAnchor",void 0,[f,d,x,fw("xdr:clientData")]);s.push(C)}}const l=[];if(r&&r.length>0){let t=e.length+(n?.length??0)+2;for(let n=0;n<r.length;n++){const o=r[n],c=i+n,u=`rId${e.length+n+1}`;a.push(fw("Relationship",{Id:u,Type:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/chart",Target:`../charts/chart${c}.xml`}));const f=o.anchor.from.col,d=o.anchor.from.row,h=o.anchor.to?.col??f+8,p=o.anchor.to?.row??d+15,g=hw("xdr:from",void 0,[hw("xdr:col",void 0,String(f)),hw("xdr:colOff",void 0,"0"),hw("xdr:row",void 0,String(d)),hw("xdr:rowOff",void 0,"0")]),m=hw("xdr:to",void 0,[hw("xdr:col",void 0,String(h)),hw("xdr:colOff",void 0,"0"),hw("xdr:row",void 0,String(p)),hw("xdr:rowOff",void 0,"0")]),y={id:t++,name:`Chart ${n+1}`};o.frameTitle&&(y.title=o.frameTitle),o.altText&&(y.descr=o.altText);const v=hw("xdr:nvGraphicFramePr",void 0,[fw("xdr:cNvPr",y),hw("xdr:cNvGraphicFramePr",void 0,[])]),A=hw("xdr:xfrm",void 0,[fw("a:off",{x:0,y:0}),fw("a:ext",{cx:0,cy:0})]),b=hw("a:graphic",void 0,hw("a:graphicData",{uri:OS},[fw("c:chart",{"xmlns:c":OS,"xmlns:r":qS,"r:id":u})])),w=hw("xdr:graphicFrame",{macro:""},[v,A,b]),I=hw("xdr:twoCellAnchor",{editAs:"oneCell"},[g,m,w,fw("xdr:clientData")]);s.push(I),l.push({globalChartIndex:c})}}return{drawingXml:pw("xdr:wsDr",{"xmlns:xdr":"http://schemas.openxmlformats.org/drawingml/2006/spreadsheetDrawing","xmlns:a":"http://schemas.openxmlformats.org/drawingml/2006/main","xmlns:r":qS},s),drawingRels:pw("Relationships",{xmlns:"http://schemas.openxmlformats.org/package/2006/relationships"},a),images:o,charts:l}}function VS(e,t){const n=e.showTitle??Boolean(e.title),r=function(e){if(!1===e.legend)return null;if(void 0===e.legend)return"scatter"===e.type?"b":"r";switch(e.legend){case"top":return"t";case"bottom":return"b";case"left":return"l";case"right":return"r";case"topRight":return"tr"}}(e),i=[];n&&e.title&&i.push(function(e,t,n,r,i,o,a,s,l,c,u,f,d,h,p,g,m){const y=void 0===n?0:n*lI,v=void 0===r?1400:100*r,A=i?1:0,b=!0===o?1:void 0,w=!0===s?"sngStrike":void 0,I=!0===l?"sng":void 0,x=void 0!==a?hw("a:solidFill",void 0,[Ow(a)]):void 0,C=c?fw("a:latin",{typeface:c}):void 0,B=[];x&&B.push(x),C&&B.push(C);const E=B.length>0?hw("a:defRPr",{sz:v,b:A,i:b,u:I,strike:w},B):fw("a:defRPr",{sz:v,b:A,i:b,u:I,strike:w}),k=B.length>0?hw("a:rPr",{lang:"en-US",sz:v,b:A,i:b,u:I,strike:w},B):fw("a:rPr",{lang:"en-US",sz:v,b:A,i:b,u:I,strike:w}),S=tI(u),F=[hw("c:tx",void 0,[hw("c:rich",void 0,[hw("a:bodyPr",{rot:y,spcFirstLastPara:1,vertOverflow:"ellipsis",wrap:"square",anchor:"ctr",anchorCtr:1},[]),fw("a:lstStyle"),hw("a:p",void 0,[hw("a:pPr",void 0,[E]),hw("a:r",void 0,[k,hw("a:t",void 0,lw(e))])])])])];void 0!==S&&F.push(S),F.push(fw("c:overlay",{val:t?1:0}));const D=uI(f,d,h,p,g,m);return void 0!==D&&F.push(D),hw("c:title",void 0,F)}(e.title,function(e){return!0===e.titleOverlay}(e),function(e){return fI(e.titleRotation)}(e),function(e){return dI(e.titleFontSize)}(e),function(e){return hI(e.titleBold)}(e),function(e){return pI(e.titleItalic)}(e),function(e){return gI(e.titleColor)}(e),function(e){return mI(e.titleStrike)}(e),function(e){return yI(e.titleUnderline)}(e),function(e){return function(e){if("string"!=typeof e)return;const t=e.trim();return 0!==t.length?t:void 0}(e.titleFontFamily)}(e),function(e){return Zw(e.titleLayout)}(e),function(e){return gI(e.titleFillColor)}(e),function(e){return gI(e.titleBorderColor)}(e),function(e){return Yw(e.titleBorderWidth)}(e),function(e){return Gw(e.titleBorderDash)}(e),function(e){return Fw(e.titleBorderCap)}(e),function(e){return Dw(e.titleBorderCompound)}(e))),i.push(fw("c:autoTitleDeleted",{val:Bx(e)?1:0}));const o=function(e){if(void 0===e)return;const t=[],n=_w(e.rotX,-90,90);void 0!==n&&t.push(fw("c:rotX",{val:n}));const r=_w(e.hPercent,5,500);void 0!==r&&t.push(fw("c:hPercent",{val:r}));const i=_w(e.rotY,0,360);void 0!==i&&t.push(fw("c:rotY",{val:i}));const o=_w(e.depthPercent,20,2e3);void 0!==o&&t.push(fw("c:depthPercent",{val:o})),!0===e.rAngAx?t.push(fw("c:rAngAx",{val:1})):!1===e.rAngAx&&t.push(fw("c:rAngAx",{val:0}));const a=_w(e.perspective,0,240);return void 0!==a&&t.push(fw("c:perspective",{val:a})),hw("c:view3D",void 0,t)}(e.view3D);void 0!==o&&i.push(o);const a=function(e){if("number"==typeof e&&Number.isFinite(e)&&Number.isInteger(e)&&!(e<=0||e>100))return hw("c:floor",void 0,[fw("c:thickness",{val:e})])}(e.floorThickness);void 0!==a&&i.push(a);const s=function(e){if("number"==typeof e&&Number.isFinite(e)&&Number.isInteger(e)&&!(e<=0||e>100))return hw("c:sideWall",void 0,[fw("c:thickness",{val:e})])}(e.sideWallThickness);void 0!==s&&i.push(s);const l=function(e){if("number"==typeof e&&Number.isFinite(e)&&Number.isInteger(e)&&!(e<=0||e>100))return hw("c:backWall",void 0,[fw("c:thickness",{val:e})])}(e.backWallThickness);void 0!==l&&i.push(l),i.push(SC(e,t)),r&&i.push(bI(r,function(e){return!0===e.legendOverlay}(e),function(e){const t=e.legendEntries;if(!Array.isArray(t)||0===t.length)return[];const n=new Map;for(const e of t){if(!e||"object"!=typeof e)continue;const t=e.idx;if("number"!=typeof t||!Number.isFinite(t))continue;if(!Number.isInteger(t)||t<0)continue;const r={idx:t,delete:!0===e.delete};if("number"==typeof e.fontSize&&Number.isFinite(e.fontSize)){const t=Math.round(2*e.fontSize)/2;t>=1&&t<=AI&&(r.fontSize=t)}if(!0===e.bold?r.bold=!0:!1===e.bold&&(r.bold=!1),!0===e.italic?r.italic=!0:!1===e.italic&&(r.italic=!1),!0===e.underline?r.underline=!0:!1===e.underline&&(r.underline=!1),!0===e.strikethrough?r.strikethrough=!0:!1===e.strikethrough&&(r.strikethrough=!1),void 0!==e.color){const t=qw(e.color);void 0!==t&&(r.color=t)}if("string"==typeof e.fontFamily){const t=e.fontFamily.trim();t.length>0&&(r.fontFamily=t)}n.set(t,r)}return Array.from(n.values()).sort((e,t)=>e.idx-t.idx)}(e),function(e){return dI(e.legendFontSize)}(e),function(e){const t=e.legendBold;return!0===t||!1!==t&&void 0}(e),function(e){const t=e.legendItalic;return!0===t||!1!==t&&void 0}(e),function(e){const t=e.legendUnderline;return!0===t||!1!==t&&void 0}(e),function(e){if(!0===e.legendStrikethrough)return!0}(e),function(e){return gI(e.legendFontColor)}(e),function(e){return function(e){if("string"!=typeof e)return;const t=e.trim();return 0!==t.length?t:void 0}(e.legendFontFamily)}(e),function(e){return Zw(e.legendLayout)}(e),function(e){return gI(e.legendFillColor)}(e),function(e){return gI(e.legendBorderColor)}(e),function(e){return Yw(e.legendBorderWidth)}(e),function(e){return Gw(e.legendBorderDash)}(e),Fw(e.legendBorderCap),Dw(e.legendBorderCompound))),i.push(fw("c:plotVisOnly",{val:WS(e)?1:0})),i.push(fw("c:dispBlanksAs",{val:GS(e)})),i.push(fw("c:showDLblsOverMax",{val:JS(e)?1:0}));const c=hw("c:chart",void 0,i),u=[];(function(e){return!0===e.date1904})(e)&&u.push(fw("c:date1904",{val:1}));const f=function(e){const t=e.lang;return"string"!=typeof t?void 0:/^[A-Za-z]{2,3}(-[A-Za-z0-9]{2,8})*$/.test(t)?t:void 0}(e);void 0!==f&&u.push(fw("c:lang",{val:f})),u.push(fw("c:roundedCorners",{val:_S(e)?1:0}));const d=function(e){const t=e.style;return"number"!=typeof t?void 0:Number.isInteger(t)?t<1||t>48?void 0:t:void 0}(e);void 0!==d&&u.push(fw("c:style",{val:d}));const h=function(e){const t=e.protection;if(void 0===t||!1===t)return;if(!0===t)return{chartObject:!1,data:!1,formatting:!1,selection:!1,userInterface:!1};return{chartObject:!0===t.chartObject,data:!0===t.data,formatting:!0===t.formatting,selection:!0===t.selection,userInterface:!0===t.userInterface}}(e);void 0!==h&&u.push(function(e){return hw("c:protection",void 0,[fw("c:chartObject",{val:e.chartObject?1:0}),fw("c:data",{val:e.data?1:0}),fw("c:formatting",{val:e.formatting?1:0}),fw("c:selection",{val:e.selection?1:0}),fw("c:userInterface",{val:e.userInterface?1:0})])}(h)),u.push(c);const p=function(e){const t=(s=e.chartSpaceFillColor,gI(s)),n=function(e){return gI(e)}(e.chartSpaceBorderColor),r=Yw(e.chartSpaceBorderWidth),i=Gw(e.chartSpaceBorderDash),o=Fw(e.chartSpaceBorderCap),a=Dw(e.chartSpaceBorderCompound);var s;if(void 0===t&&void 0===n&&void 0===r&&void 0===i&&void 0===o&&void 0===a)return;const l=[];void 0!==t&&l.push(hw("a:solidFill",void 0,[Ow(t)]));if(void 0!==n||void 0!==r||void 0!==i||void 0!==o||void 0!==a){const e={};void 0!==r&&(e.w=Math.round(r*Cw)),void 0!==o&&(e.cap=o),void 0!==a&&(e.cmpd=a);const t=[];void 0!==n&&t.push(hw("a:solidFill",void 0,[Ow(n)])),void 0!==i&&t.push(fw("a:prstDash",{val:i})),l.push(0===t.length?fw("a:ln",e):hw("a:ln",Object.keys(e).length>0?e:void 0,t))}return hw("c:spPr",void 0,l)}(e);void 0!==p&&u.push(p);return{chartXml:pw("c:chartSpace",{"xmlns:c":"http://schemas.openxmlformats.org/drawingml/2006/chart","xmlns:a":"http://schemas.openxmlformats.org/drawingml/2006/main","xmlns:r":"http://schemas.openxmlformats.org/officeDocument/2006/relationships"},u),chartRels:pw("Relationships",{xmlns:"http://schemas.openxmlformats.org/package/2006/relationships"},[])}}const YS=new Set(["gap","zero","span"]);function GS(e){const t=e.dispBlanksAs;return t&&YS.has(t)?t:"gap"}function WS(e){return"boolean"!=typeof e.plotVisOnly||e.plotVisOnly}function JS(e){return"boolean"!=typeof e.showDLblsOverMax||e.showDLblsOverMax}function _S(e){return"boolean"==typeof e.roundedCorners&&e.roundedCorners}const XS="http://schemas.openxmlformats.org/spreadsheetml/2006/main";function KS(e,t){const n=[];for(const[t,r]of e){if(!r.comment)continue;const[e,i]=t.split(","),o=parseInt(e,10),a=parseInt(i,10),s=fk(o,a),l=r.comment.author??"",c=r.comment.text;n.push({ref:s,row:o,col:a,author:l,text:c})}if(0===n.length)return null;n.sort((e,t)=>e.row-t.row||e.col-t.col);const r=new Map;for(const e of n)r.has(e.author)||r.set(e.author,r.size);const i=function(e,t){const n=[];for(const[e]of t)n.push(hw("author",void 0,lw(e)));const r=hw("authors",void 0,n),i=[];for(const n of e){const e=t.get(n.author)??0,r=hw("text",void 0,[hw("r",void 0,[hw("t",void 0,lw(n.text))])]);i.push(hw("comment",{ref:n.ref,authorId:e},[r]))}const o=hw("commentList",void 0,i);return pw("comments",{xmlns:XS},[r,o])}(n,r),o=function(e,t){const n=[];n.push('<xml xmlns:v="urn:schemas-microsoft-com:vml"',' xmlns:o="urn:schemas-microsoft-com:office:office"',' xmlns:x="urn:schemas-microsoft-com:office:excel">'),n.push('<o:shapelayout v:ext="edit">',`<o:idmap v:ext="edit" data="${t+1}"/>`,"</o:shapelayout>"),n.push('<v:shapetype id="_x0000_t202" coordsize="21600,21600" o:spt="202"',' path="m,l,21600r21600,l21600,xe">','<v:stroke joinstyle="miter"/>','<v:path gradientshapeok="t" o:connecttype="rect"/>',"</v:shapetype>");const r=1024*(t+1)+1;for(let t=0;t<e.length;t++){const i=e[t],o=r+t,a=i.col+1,s=i.row,l=a+2,c=s+4,u=48*(i.col+1),f=15*i.row;n.push(`<v:shape id="_x0000_s${o}" type="#_x0000_t202"`,` style="position:absolute;margin-left:${u}pt;margin-top:${f}pt;`,`width:108pt;height:59.25pt;z-index:${t+1};visibility:hidden"`,' fillcolor="#ffffe1" o:insetmode="auto">','<v:fill color2="#ffffe1"/>','<v:shadow on="t" color="black" obscured="t"/>','<v:path o:connecttype="none"/>','<v:textbox style="mso-direction-alt:auto">','<div style="text-align:left"/>',"</v:textbox>",'<x:ClientData ObjectType="Note">',"<x:MoveWithCells/>","<x:SizeWithCells/>",`<x:Anchor>${a},15,${s},2,${l},31,${c},4</x:Anchor>`,"<x:AutoFill>False</x:AutoFill>",`<x:Row>${i.row}</x:Row>`,`<x:Column>${i.col}</x:Column>`,"</x:ClientData>","</v:shape>")}return n.push("</xml>"),n.join("")}(n,t);return{commentsXml:i,vmlXml:o,comments:n}}function ZS(e,t,n){const r=e.displayName??e.name,i=e.range??"",o=!1!==e.showAutoFilter,a=!0===e.showTotalRow,s={xmlns:"http://schemas.openxmlformats.org/spreadsheetml/2006/main",id:t,name:e.name,displayName:r,ref:i};a?s.totalsRowCount=1:s.totalsRowShown=0;const l=[];if(o){const e=a?function(e){const t=e.indexOf(":");if(-1===t)return e;const n=e.slice(t+1);let r=n.length;for(;r>0&&n.charCodeAt(r-1)>=48&&n.charCodeAt(r-1)<=57;)r--;const i=n.slice(0,r),o=parseInt(n.slice(r),10);return isNaN(o)||o<=1?e:`${e.slice(0,t+1)}${i}${o-1}`}(i):i;l.push(fw("autoFilter",{ref:e}))}const c=[];for(let t=0;t<e.columns.length;t++){const n=e.columns[t],r={id:t+1,name:n.name};if(a&&n.totalFunction&&(r.totalsRowFunction=n.totalFunction),a&&n.totalLabel&&(r.totalsRowLabel=n.totalLabel),a&&"custom"===n.totalFunction&&n.totalFormula){const e=hw("totalsRowFormula",void 0,lw(n.totalFormula));c.push(hw("tableColumn",r,[e]))}else c.push(fw("tableColumn",r))}l.push(hw("tableColumns",{count:e.columns.length},c));const u=e.style??"TableStyleMedium2",f=!1!==e.showRowStripes,d=!0===e.showColumnStripes;l.push(fw("tableStyleInfo",{name:u,showFirstColumn:0,showLastColumn:0,showRowStripes:f?1:0,showColumnStripes:d?1:0}));return{tableXml:pw("table",s,l),tableId:t}}function eF(e,t){const n=e.columns.length;let r=0;if(t.rows)r=t.rows.length;else if(t.data){const e=t.columns?.some(e=>e.header);r=t.data.length+(e?1:0)}e.showTotalRow&&(r+=1),r<1&&(r=1);return`${ck(0)}1:${ck(n-1)}${r}`}const tF="http://schemas.openxmlformats.org/spreadsheetml/2006/main",nF="http://schemas.openxmlformats.org/officeDocument/2006/relationships",rF="http://schemas.openxmlformats.org/package/2006/relationships",iF="http://schemas.openxmlformats.org/officeDocument/2006/relationships/pivotCacheRecords",oF="http://schemas.openxmlformats.org/officeDocument/2006/relationships/pivotCacheDefinition";function aF(e,t,n,r=1){const i=function(e,t){const n=t.fieldNames.map((e,n)=>({index:n,name:e,axis:"hidden",axisOrder:0,kind:lF(t.dataRows,n)})),r=(e,t)=>{if(e)for(let r=0;r<e.length;r++){const i=n.find(t=>t.name===e[r]);i&&(i.axis=t,i.axisOrder=r)}};r(e.rows,"row"),r(e.columns,"col"),r(e.pages,"page");const i=[];for(let r=0;r<e.values.length;r++){const o=e.values[r],a=t.fieldNames.indexOf(o.field);if(-1===a)continue;n[a].axis="data",n[a].axisOrder=r;const s=o.function??"sum",l={fieldIndex:a,function:s,displayName:o.displayName??hF(s,o.field)};void 0!==o.numberFormat&&(l.numberFormat=o.numberFormat),i.push(l)}for(const e of n){if("data"===e.axis||"hidden"===e.axis)continue;if("string"!==e.kind)continue;const n=new Set,r=[];for(const i of t.dataRows){const t=i[e.index],o=null==t?"":String(t);n.has(o)||(n.add(o),r.push(o))}e.sharedStrings=r,e.sharedIndex=new Map(r.map((e,t)=>[e,t]))}return{fields:n,dataFieldDefs:i}}(e,t),o=function(e,t){const n=hw("cacheSource",{type:"worksheet"},[fw("worksheetSource",{ref:e.ref,sheet:e.sheetName})]),r=[];for(const n of t.fields)r.push(cF(n,e.dataRows));return pw("pivotCacheDefinition",{xmlns:tF,"xmlns:r":nF,"r:id":"rId1",refreshOnLoad:1,refreshedBy:"hucre",refreshedDate:0,createdVersion:6,refreshedVersion:6,minRefreshableVersion:3,recordCount:e.dataRows.length},[n,hw("cacheFields",{count:t.fields.length},r)])}(t,i),a=function(e){return pw("Relationships",{xmlns:rF},[fw("Relationship",{Id:"rId1",Type:iF,Target:`pivotCacheRecords${e}.xml`})])}(r),s=function(e,t){const n=[];for(const r of e.dataRows){const e=[];for(const n of t.fields)e.push(uF(r[n.index],n));n.push(hw("r",void 0,e))}return pw("pivotCacheRecords",{xmlns:tF,"xmlns:r":nF,count:e.dataRows.length},n)}(t,i),l=function(e,t,n){const r=t.fields.filter(e=>"row"===e.axis).sort((e,t)=>e.axisOrder-t.axisOrder),i=t.fields.filter(e=>"col"===e.axis).sort((e,t)=>e.axisOrder-t.axisOrder),o=t.fields.filter(e=>"page"===e.axis).sort((e,t)=>e.axisOrder-t.axisOrder),a=e.targetCell??"A1",s=e.styleName??"PivotStyleLight16",l=e.dataCaption??"Values",c=function(e,t,n,r){const{col:i,row:o}=function(e){const t=/^([A-Z]+)(\d+)$/i.exec(e.trim());if(!t)throw new Error(`Invalid pivot targetCell "${e}" — expected an A1-style reference`);const n=t[1].toUpperCase();let r=0;for(let e=0;e<n.length;e++)r=26*r+(n.charCodeAt(e)-64);return{col:r-1,row:parseInt(t[2],10)-1}}(e),a=0,s=Math.max(1,n)+(r.dataFieldDefs.length>1?1:0),l=Math.max(1,t),c=Math.max(2,t+Math.max(1,r.dataFieldDefs.length)),u=s+2,f=dF(o,i),d=dF(o+u-1,i+c-1);return{ref:`${f}:${d}`,firstHeaderRow:a,firstDataRow:s,firstDataCol:l}}(a,r.length,i.length,t),u=[];u.push(fw("location",c));const f=[];for(const e of t.fields)f.push(fF(e));u.push(hw("pivotFields",{count:t.fields.length},f)),r.length>0&&(u.push(hw("rowFields",{count:r.length},r.map(e=>fw("field",{x:e.index})))),u.push(hw("rowItems",{count:1},[hw("i",void 0,[fw("x")])])));if(i.length>0)u.push(hw("colFields",{count:i.length},i.map(e=>fw("field",{x:e.index})))),u.push(hw("colItems",{count:1},[hw("i",void 0,[fw("x")])]));else if(t.dataFieldDefs.length>1){u.push(hw("colFields",{count:1},[fw("field",{x:-2})]));const e=[];for(let n=0;n<t.dataFieldDefs.length;n++)e.push(hw("i",0===n?void 0:{i:n},[fw("x",{v:n})]));u.push(hw("colItems",{count:t.dataFieldDefs.length},e))}o.length>0&&u.push(hw("pageFields",{count:o.length},o.map(e=>fw("pageField",{fld:e.index,hier:-1}))));if(t.dataFieldDefs.length>0){const e=[];for(const n of t.dataFieldDefs){const t={name:n.displayName,fld:n.fieldIndex,baseField:0,baseItem:0};"sum"!==n.function&&(t.subtotal=n.function),void 0!==n.numberFormat&&(t.numFmtId=0),e.push(fw("dataField",t))}u.push(hw("dataFields",{count:t.dataFieldDefs.length},e))}return u.push(fw("pivotTableStyleInfo",{name:s,showRowHeaders:1,showColHeaders:1,showRowStripes:0,showColStripes:0,showLastColumn:1})),pw("pivotTableDefinition",{xmlns:tF,"xmlns:r":nF,name:e.name,cacheId:n,applyNumberFormats:0,applyBorderFormats:0,applyFontFormats:0,applyPatternFormats:0,applyAlignmentFormats:0,applyWidthHeightFormats:1,dataCaption:l,updatedVersion:6,minRefreshableVersion:3,useAutoFormatting:1,itemPrintTitles:1,createdVersion:6,indent:0,outline:1,outlineData:1,multipleFieldFilters:0},u)}(e,i,n),c=function(e){return pw("Relationships",{xmlns:rF},[fw("Relationship",{Id:"rId1",Type:oF,Target:`../pivotCache/pivotCacheDefinition${e}.xml`})])}(r);return{cacheDefinitionXml:o,cacheDefinitionRels:a,cacheRecordsXml:s,pivotTableXml:l,pivotTableRels:c}}function sF(e,t,n){if(n.length<2)throw new Error(`Pivot "${e.name}" source sheet "${t}" needs at least a header row plus one data row (got ${n.length}).`);const r=n[0],i=[];for(let e=0;e<r.length;e++){const t=r[e];i.push(null==t?`Column${e+1}`:String(t))}const o=[];for(let e=1;e<n.length;e++){const t=n[e],r=[];for(let e=0;e<i.length;e++)r.push(e<t.length?t[e]:null);o.push(r)}const a=new Set(i),s=[...e.rows??[],...e.columns??[],...e.pages??[]];for(const t of e.values)s.push(t.field);for(const t of s)if(!a.has(t))throw new Error(`Pivot "${e.name}" references field "${t}" which is not in the source header (have: ${i.join(", ")}).`);const l=e.sourceRange??function(e,t){if(e<=0||t<=0)throw new Error("Pivot source range must contain at least one column and row");const n=dF(0,0),r=dF(t-1,e-1);return`${n}:${r}`}(i.length,n.length);return{sheetName:t,fieldNames:i,dataRows:o,ref:l}}function lF(e,t){for(const n of e){const e=n[t];if(null!=e&&""!==e&&("number"!=typeof e||!Number.isFinite(e)))return"string"}return"number"}function cF(e,t){if("string"===e.kind){const t=[];if(e.sharedStrings)for(const n of e.sharedStrings)t.push(fw("s",{v:n}));return hw("cacheField",{name:e.name,numFmtId:0},[hw("sharedItems",{count:t.length},t)])}let n=1/0,r=-1/0,i=!1;for(const o of t){const t=o[e.index];null!=t&&""!==t?"number"==typeof t&&(t<n&&(n=t),t>r&&(r=t)):i=!0}const o={containsSemiMixedTypes:0,containsString:0,containsNumber:1,containsInteger:Number.isInteger(n)&&Number.isInteger(r)?1:0};return i&&(o.containsBlank=1),Number.isFinite(n)&&(o.minValue=n),Number.isFinite(r)&&(o.maxValue=r),hw("cacheField",{name:e.name,numFmtId:0},[fw("sharedItems",o)])}function uF(e,t){if(null==e||""===e)return fw("m");if("string"===t.kind){const n=t.sharedIndex?.get(String(e));return void 0!==n?fw("x",{v:n}):fw("s",{v:String(e)})}return"number"==typeof e&&Number.isFinite(e)?fw("n",{v:e}):"boolean"==typeof e?fw("b",{v:e?1:0}):fw("s",{v:String(e)})}function fF(e){if("data"===e.axis)return fw("pivotField",{dataField:1,showAll:0});if("hidden"===e.axis)return fw("pivotField",{showAll:0});const t="row"===e.axis?"axisRow":"col"===e.axis?"axisCol":"axisPage",n=[];if(e.sharedStrings)for(let t=0;t<e.sharedStrings.length;t++)n.push(fw("item",{x:t}));return n.push(fw("item",{t:"default"})),hw("pivotField",{axis:t,showAll:0},[hw("items",{count:n.length},n)])}function dF(e,t){let n=t,r="";for(;n>=0;)r=String.fromCharCode(65+n%26)+r,n=Math.floor(n/26)-1;return`${r}${e+1}`}function hF(e,t){return`${"sum"===e?"Sum":"count"===e?"Count":"average"===e?"Average":"max"===e?"Max":"min"===e?"Min":"product"===e?"Product":"countNums"===e?"Count Nums":"stdDev"===e?"StdDev":"stdDevp"===e?"StdDevp":"var"===e?"Var":"Varp"} of ${t}`}function pF(e){return e.toISOString().replace(/\.\d{3}Z$/,"Z")}const gF=new TextEncoder;async function mF(e){const t=sk(e.sheets),{defaultFont:n,dateSystem:r,namedRanges:i,activeSheet:o,workbookProtection:a}=e;!function(e){const t=new Map;for(let n=0;n<e.length;n++){const r=e[n].name;ik(r,n);const i=r.toLowerCase(),o=t.get(i);if(void 0!==o)throw new yb(`Duplicate sheet name "${r}" (sheets ${o+1} and ${n+1}); Excel compares sheet names case-insensitively`);t.set(i,n)}}(t);const s=function(e){const t=e.properties;if(t?.description)return t;for(const n of e.sheets){const e=n.a11y?.summary;if(e&&e.trim().length>0)return{...t,description:e}}return t}(e),l=RS(n,{reuseStyleIdentity:!0}),c=function(){const e=[],t=new Map;return{add:function(n){const r=t.get(n);if(void 0!==r)return r;const i=e.length;return e.push(n),t.set(n,i),i},getAll:function(){return e},count:function(){return e.length}}}();let u=1;const f=[];for(const e of t)e.tables&&e.tables.length>0?(f.push(u),u+=e.tables.length):f.push(void 0);let d=1;const h=[];for(const e of t)e.pivotTables&&e.pivotTables.length>0?(h.push(d),d+=e.pivotTables.length):h.push(void 0);const p=[];for(let n=0;n<t.length;n++){const i=vk(t[n],l,c,r,f[n],"inline"===e.stringMode,h[n]);p.push(i)}const g=c.count()>0,m=[],y=[],v=new Set;let A=1,b=1;const w=[],I=[];for(let e=0;e<t.length;e++){const n=t[e],r=n.images&&n.images.length>0,i=n.textBoxes&&n.textBoxes.length>0,o=n.charts&&n.charts.length>0;if(r||i||o){const t=jS(n.images??[],A,n.textBoxes,n.charts,b);m.push(t),y.push(e+1);for(const e of t.images){const t=e.path.split(".").pop();t&&v.add(t)}n.images&&(A+=n.images.length);const r=[];if(n.charts){for(let e=0;e<n.charts.length;e++){const t=VS(n.charts[e],n.name),i=b+e;r.push({globalIndex:i,xml:t.chartXml,rels:t.chartRels}),I.push(i)}b+=n.charts.length}w.push(r)}else m.push(null),w.push([])}const{paths:x,nextIndex:C}=function(e,t,n){const r=[];let i=t;for(const t of e){if(!t.backgroundImage){r.push(null);continue}const e=US(t.backgroundImage);r.push(`xl/media/image${i}.${e}`),n.add(e),i++}return{paths:r,nextIndex:i}}(t,A,v);A=C;const B=[],E=[];for(let e=0;e<t.length;e++){const n=t[e];if(n.cells){const t=KS(n.cells,e);t?(B.push(t),E.push(e+1)):B.push(null)}else B.push(null)}const k=[];for(const e of p)for(const t of e.tables)k.push(t.globalTableIndex);const S=[];for(let e=0;e<t.length;e++){const n=t[e];if(!n.pivotTables||0===n.pivotTables.length)continue;const r=h[e];if(void 0!==r)for(let e=0;e<n.pivotTables.length;e++){const i=n.pivotTables[e],o=i.sourceSheet??n.name,a=t.find(e=>e.name===o);if(!a)throw new Error(`Pivot "${i.name}" sourceSheet "${o}" not found in workbook`);const s=yF(a),l=r+e,c=aF(i,sF(i,o,s),l-1,l);S.push({parts:c,globalIndex:l})}}const F=S.map(e=>e.globalIndex),D=S.map(e=>({rId:`rIdPivot${e.globalIndex}`,target:`pivotCache/pivotCacheDefinition${e.globalIndex}.xml`})),N=S.map((e,t)=>({cacheId:e.globalIndex-1,rId:D[t].rId})),M=new xS,Q=function(e){if(!e?.custom)return null;const t=Object.entries(e.custom);if(0===t.length)return null;const n=[];let r=2;for(const[e,i]of t){let t;if("string"==typeof i)t=hw("vt:lpwstr",void 0,lw(i));else if("number"==typeof i)t=Number.isInteger(i)?hw("vt:i4",void 0,String(i)):hw("vt:r8",void 0,String(i));else if("boolean"==typeof i)t=hw("vt:bool",void 0,i?"true":"false");else{if(!(i instanceof Date))continue;t=hw("vt:filetime",void 0,pF(i))}n.push(hw("property",{fmtid:"{D5CDD505-2E9C-101B-9397-08002B2CF9AE}",pid:r++,name:e},t))}return 0===n.length?null:pw("Properties",{xmlns:"http://schemas.openxmlformats.org/officeDocument/2006/custom-properties","xmlns:vt":"http://schemas.openxmlformats.org/officeDocument/2006/docPropsVTypes"},n)}(s),T=null!==Q,L=void 0!==e.vbaProject&&e.vbaProject.length>0,R=l.hasCheckboxFeature(),U=p.some(e=>e.hasDynamicArray),H={sheetCount:t.length,hasSharedStrings:g,drawingIndices:y.length>0?y:void 0,chartIndices:I.length>0?I:void 0,imageExtensions:v.size>0?v:void 0,commentIndices:E.length>0?E:void 0,tableIndices:k.length>0?k:void 0,pivotTableIndices:F.length>0?F:void 0,pivotCacheDefinitionIndices:F.length>0?F:void 0,pivotCacheRecordIndices:F.length>0?F:void 0,hasCoreProps:!0,hasAppProps:!0,hasCustomProps:T,hasMacros:L,hasFeaturePropertyBag:R,hasMetadata:U};M.add("[Content_Types].xml",gF.encode(function(e,t){let n;n="number"==typeof e?{sheetCount:e,hasSharedStrings:t??!1}:e;const r=[];if(r.push(fw("Default",{Extension:"rels",ContentType:"application/vnd.openxmlformats-package.relationships+xml"})),r.push(fw("Default",{Extension:"xml",ContentType:"application/xml"})),n.hasMacros&&r.push(fw("Default",{Extension:"bin",ContentType:"application/vnd.ms-office.vbaProject"})),n.imageExtensions)for(const e of n.imageExtensions){const t=CS[e];t&&r.push(fw("Default",{Extension:e,ContentType:t}))}r.push(fw("Override",{PartName:"/xl/workbook.xml",ContentType:n.hasMacros?"application/vnd.ms-excel.sheet.macroEnabled.main+xml":"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet.main+xml"}));for(let e=1;e<=n.sheetCount;e++)r.push(fw("Override",{PartName:`/xl/worksheets/sheet${e}.xml`,ContentType:"application/vnd.openxmlformats-officedocument.spreadsheetml.worksheet+xml"}));if(r.push(fw("Override",{PartName:"/xl/styles.xml",ContentType:"application/vnd.openxmlformats-officedocument.spreadsheetml.styles+xml"})),r.push(fw("Override",{PartName:"/xl/theme/theme1.xml",ContentType:"application/vnd.openxmlformats-officedocument.theme+xml"})),n.hasSharedStrings&&r.push(fw("Override",{PartName:"/xl/sharedStrings.xml",ContentType:"application/vnd.openxmlformats-officedocument.spreadsheetml.sharedStrings+xml"})),n.drawingIndices)for(const e of n.drawingIndices)r.push(fw("Override",{PartName:`/xl/drawings/drawing${e}.xml`,ContentType:"application/vnd.openxmlformats-officedocument.drawing+xml"}));if(n.chartIndices)for(const e of n.chartIndices)r.push(fw("Override",{PartName:`/xl/charts/chart${e}.xml`,ContentType:"application/vnd.openxmlformats-officedocument.drawingml.chart+xml"}));if(n.commentIndices&&n.commentIndices.length>0&&r.push(fw("Default",{Extension:"vml",ContentType:"application/vnd.openxmlformats-officedocument.vmlDrawing"})),n.commentIndices)for(const e of n.commentIndices)r.push(fw("Override",{PartName:`/xl/comments${e}.xml`,ContentType:"application/vnd.openxmlformats-officedocument.spreadsheetml.comments+xml"}));if(n.tableIndices)for(const e of n.tableIndices)r.push(fw("Override",{PartName:`/xl/tables/table${e}.xml`,ContentType:"application/vnd.openxmlformats-officedocument.spreadsheetml.table+xml"}));if(n.threadedCommentSheetIndices)for(const e of n.threadedCommentSheetIndices)r.push(fw("Override",{PartName:`/xl/threadedComments/threadedComment${e}.xml`,ContentType:"application/vnd.ms-excel.threadedcomments+xml"}));if(n.hasPersons&&r.push(fw("Override",{PartName:"/xl/persons/person.xml",ContentType:"application/vnd.ms-excel.person+xml"})),n.externalLinkIndices)for(const e of n.externalLinkIndices)r.push(fw("Override",{PartName:`/xl/externalLinks/externalLink${e}.xml`,ContentType:"application/vnd.openxmlformats-officedocument.spreadsheetml.externalLink+xml"}));if(n.hasCellImages&&r.push(fw("Override",{PartName:"/xl/cellimages.xml",ContentType:"application/vnd.openxmlformats-officedocument.drawing+xml"})),n.pivotTableIndices)for(const e of n.pivotTableIndices)r.push(fw("Override",{PartName:`/xl/pivotTables/pivotTable${e}.xml`,ContentType:"application/vnd.openxmlformats-officedocument.spreadsheetml.pivotTable+xml"}));if(n.pivotCacheDefinitionIndices)for(const e of n.pivotCacheDefinitionIndices)r.push(fw("Override",{PartName:`/xl/pivotCache/pivotCacheDefinition${e}.xml`,ContentType:"application/vnd.openxmlformats-officedocument.spreadsheetml.pivotCacheDefinition+xml"}));if(n.pivotCacheRecordIndices)for(const e of n.pivotCacheRecordIndices)r.push(fw("Override",{PartName:`/xl/pivotCache/pivotCacheRecords${e}.xml`,ContentType:"application/vnd.openxmlformats-officedocument.spreadsheetml.pivotCacheRecords+xml"}));if(n.slicerIndices)for(const e of n.slicerIndices)r.push(fw("Override",{PartName:`/xl/slicers/slicer${e}.xml`,ContentType:"application/vnd.ms-excel.slicer+xml"}));if(n.slicerCacheIndices)for(const e of n.slicerCacheIndices)r.push(fw("Override",{PartName:`/xl/slicerCaches/slicerCache${e}.xml`,ContentType:"application/vnd.ms-excel.slicerCache+xml"}));if(n.timelineIndices)for(const e of n.timelineIndices)r.push(fw("Override",{PartName:`/xl/timelines/timeline${e}.xml`,ContentType:"application/vnd.ms-excel.timeline+xml"}));if(n.timelineCacheIndices)for(const e of n.timelineCacheIndices)r.push(fw("Override",{PartName:`/xl/timelineCaches/timelineCache${e}.xml`,ContentType:"application/vnd.ms-excel.timelineCache+xml"}));if(n.chartStyleIndices)for(const e of n.chartStyleIndices)r.push(fw("Override",{PartName:`/xl/charts/style${e}.xml`,ContentType:"application/vnd.ms-office.chartstyle+xml"}));if(n.chartColorsIndices)for(const e of n.chartColorsIndices)r.push(fw("Override",{PartName:`/xl/charts/colors${e}.xml`,ContentType:"application/vnd.ms-office.chartcolorstyle+xml"}));return n.hasMetadata&&r.push(fw("Override",{PartName:`/${ek}`,ContentType:"application/vnd.openxmlformats-officedocument.spreadsheetml.sheetMetadata+xml"})),n.hasFeaturePropertyBag&&r.push(fw("Override",{PartName:`/${hE}`,ContentType:"application/vnd.ms-excel.featurepropertybag+xml"})),n.hasCoreProps&&r.push(fw("Override",{PartName:"/docProps/core.xml",ContentType:"application/vnd.openxmlformats-package.core-properties+xml"})),n.hasAppProps&&r.push(fw("Override",{PartName:"/docProps/app.xml",ContentType:"application/vnd.openxmlformats-officedocument.extended-properties+xml"})),n.hasCustomProps&&r.push(fw("Override",{PartName:"/docProps/custom.xml",ContentType:"application/vnd.openxmlformats-officedocument.custom-properties+xml"})),pw("Types",{xmlns:"http://schemas.openxmlformats.org/package/2006/content-types"},r)}(H))),M.add("_rels/.rels",gF.encode(function(e){const t=[];t.push(fw("Relationship",{Id:"rId1",Type:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/officeDocument",Target:"xl/workbook.xml"}));let n=2;return e?.hasCoreProps&&t.push(fw("Relationship",{Id:"rId"+n++,Type:"http://schemas.openxmlformats.org/package/2006/relationships/metadata/core-properties",Target:"docProps/core.xml"})),e?.hasAppProps&&t.push(fw("Relationship",{Id:"rId"+n++,Type:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/extended-properties",Target:"docProps/app.xml"})),e?.hasCustomProps&&t.push(fw("Relationship",{Id:"rId"+n++,Type:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/custom-properties",Target:"docProps/custom.xml"})),pw("Relationships",{xmlns:BS},t)}({hasCoreProps:!0,hasAppProps:!0,hasCustomProps:T}))),M.add("docProps/core.xml",gF.encode(function(e){const t=[];e?.title&&t.push(hw("dc:title",void 0,lw(e.title))),e?.subject&&t.push(hw("dc:subject",void 0,lw(e.subject))),e?.creator&&t.push(hw("dc:creator",void 0,lw(e.creator))),e?.keywords&&t.push(hw("cp:keywords",void 0,lw(e.keywords))),e?.description&&t.push(hw("dc:description",void 0,lw(e.description))),e?.lastModifiedBy&&t.push(hw("cp:lastModifiedBy",void 0,lw(e.lastModifiedBy))),e?.category&&t.push(hw("cp:category",void 0,lw(e.category))),e?.created&&t.push(hw("dcterms:created",{"xsi:type":"dcterms:W3CDTF"},pF(e.created)));const n=e?.modified??new Date;return t.push(hw("dcterms:modified",{"xsi:type":"dcterms:W3CDTF"},pF(n))),pw("cp:coreProperties",{"xmlns:cp":"http://schemas.openxmlformats.org/package/2006/metadata/core-properties","xmlns:dc":"http://purl.org/dc/elements/1.1/","xmlns:dcterms":"http://purl.org/dc/terms/","xmlns:xsi":"http://www.w3.org/2001/XMLSchema-instance"},t)}(s))),M.add("docProps/app.xml",gF.encode(function(e){const t=[];return t.push(hw("Application",void 0,"hucre")),t.push(hw("DocSecurity",void 0,"0")),e?.company&&t.push(hw("Company",void 0,lw(e.company))),e?.manager&&t.push(hw("Manager",void 0,lw(e.manager))),pw("Properties",{xmlns:"http://schemas.openxmlformats.org/officeDocument/2006/extended-properties"},t)}(s))),Q&&M.add("docProps/custom.xml",gF.encode(Q));const q=function(e,t){const n=t?[...t]:[];for(const t of e){const e=t.pageSetup;if(!e)continue;e.printArea&&n.push({name:"_xlnm.Print_Area",range:`${t.name}!${e.printArea}`,scope:t.name});const r=[];e.printTitlesRow&&r.push(`${t.name}!${e.printTitlesRow}`),e.printTitlesColumn&&r.push(`${t.name}!${e.printTitlesColumn}`),r.length>0&&n.push({name:"_xlnm.Print_Titles",range:r.join(","),scope:t.name})}return n}(t,i);M.add("xl/workbook.xml",gF.encode(function(e,t,n,r,i,o,a,s,l){const c=[];for(let t=0;t<e.length;t++){const n=e[t],r={name:n.name,sheetId:t+1,"r:id":`rId${t+1}`};n.hidden?r.state="hidden":n.veryHidden&&(r.state="veryHidden"),c.push(fw("sheet",r))}const u=[];if("1904"===n&&u.push(fw("workbookPr",{date1904:1})),i){const e={};i.lockStructure&&(e.lockStructure=1),i.lockWindows&&(e.lockWindows=1),i.password&&(e.workbookPassword=nk(i.password)),u.push(fw("workbookProtection",e))}const f=r??0;if(u.push(hw("bookViews",void 0,[fw("workbookView",{xWindow:0,yWindow:0,windowWidth:16384,windowHeight:8192,activeTab:f})])),u.push(hw("sheets",void 0,c)),o&&o.length>0){const e=o.map(e=>fw("externalReference",{"r:id":e.rId}));u.push(hw("externalReferences",void 0,e))}if(t&&t.length>0){const n=new Map;for(let t=0;t<e.length;t++)n.set(e[t].name,t);const r=[];for(const e of t){const t={name:e.name};if(void 0!==e.scope){const r=n.get(e.scope);void 0!==r&&(t.localSheetId=r)}e.comment&&(t.comment=e.comment),r.push(hw("definedName",t,lw(e.range)))}u.push(hw("definedNames",void 0,r))}if(u.push(fw("calcPr",{calcId:0,fullCalcOnLoad:1})),a&&a.length>0){const e=a.map(e=>fw("pivotCache",{cacheId:e.cacheId,"r:id":e.rId}));u.push(hw("pivotCaches",void 0,e))}const d=[];if(s&&s.length>0){const e=hw("x14:slicerCaches",void 0,s.map(e=>fw("x14:slicerCache",{"r:id":e.rId})));d.push(hw("ext",{uri:"{BBE1A952-AA13-448E-AADC-164F8A28A991}","xmlns:x14":"http://schemas.microsoft.com/office/spreadsheetml/2009/9/main"},[e]))}if(l&&l.length>0){const e=hw("x15:timelineCachePivotCaches",void 0,l.map(e=>fw("x15:timelineCachePivotCache",{"r:id":e.rId})));d.push(hw("ext",{uri:"{7E03D99C-DC04-49D9-9315-930204A7B6E9}","xmlns:x15":"http://schemas.microsoft.com/office/spreadsheetml/2010/11/main"},[e]))}return d.length>0&&u.push(hw("extLst",void 0,d)),pw("workbook",{xmlns:"http://schemas.openxmlformats.org/spreadsheetml/2006/main","xmlns:r":"http://schemas.openxmlformats.org/officeDocument/2006/relationships"},u)}(t,q.length>0?q:void 0,r,o,a,void 0,N.length>0?N:void 0))),M.add("xl/_rels/workbook.xml.rels",gF.encode(function(e,t,n,r,i,o,a,s,l,c,u){const f=[];for(let t=1;t<=e;t++)f.push(fw("Relationship",{Id:`rId${t}`,Type:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/worksheet",Target:`worksheets/sheet${t}.xml`}));let d=e+1;if(f.push(fw("Relationship",{Id:`rId${d}`,Type:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/styles",Target:"styles.xml"})),d++,t&&(f.push(fw("Relationship",{Id:`rId${d}`,Type:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/sharedStrings",Target:"sharedStrings.xml"})),d++),f.push(fw("Relationship",{Id:`rId${d}`,Type:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/theme",Target:"theme/theme1.xml"})),d++,u&&(f.push(fw("Relationship",{Id:`rId${d}`,Type:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/sheetMetadata",Target:"metadata.xml"})),d++),n&&(f.push(fw("Relationship",{Id:`rId${d}`,Type:"http://schemas.microsoft.com/office/2006/relationships/vbaProject",Target:"vbaProject.bin"})),d++),r&&(f.push(fw("Relationship",{Id:`rId${d}`,Type:"http://schemas.microsoft.com/office/2022/11/relationships/FeaturePropertyBag",Target:"featurePropertyBag/featurePropertyBag.xml"})),d++),i&&(f.push(fw("Relationship",{Id:`rId${d}`,Type:"http://schemas.microsoft.com/office/2017/10/relationships/person",Target:"persons/person.xml"})),d++),o){for(const e of o)f.push(fw("Relationship",{Id:e.rId,Type:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/externalLink",Target:e.target}));d+=o.length}if(c&&(f.push(fw("Relationship",{Id:`rId${d}`,Type:"http://www.wps.cn/officeDocument/2017/relationships/cellimage",Target:"cellimages.xml"})),d++),a)for(const e of a)f.push(fw("Relationship",{Id:e.rId,Type:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/pivotCacheDefinition",Target:e.target}));if(s)for(const e of s)f.push(fw("Relationship",{Id:e.rId,Type:"http://schemas.microsoft.com/office/2007/relationships/slicerCache",Target:e.target}));if(l)for(const e of l)f.push(fw("Relationship",{Id:e.rId,Type:"http://schemas.microsoft.com/office/2011/relationships/timelineCache",Target:e.target}));return pw("Relationships",{xmlns:BS},f)}(t.length,g,L,R,void 0,void 0,D.length>0?D:void 0,void 0,void 0,void 0,U))),M.add("xl/styles.xml",gF.encode(l.toXml())),M.add("xl/theme/theme1.xml",gF.encode('<?xml version="1.0" encoding="UTF-8" standalone="yes"?>\n<a:theme xmlns:a="http://schemas.openxmlformats.org/drawingml/2006/main" name="Office Theme"><a:themeElements><a:clrScheme name="Office"><a:dk1><a:sysClr val="windowText" lastClr="000000"/></a:dk1><a:lt1><a:sysClr val="window" lastClr="FFFFFF"/></a:lt1><a:dk2><a:srgbClr val="44546A"/></a:dk2><a:lt2><a:srgbClr val="E7E6E6"/></a:lt2><a:accent1><a:srgbClr val="4472C4"/></a:accent1><a:accent2><a:srgbClr val="ED7D31"/></a:accent2><a:accent3><a:srgbClr val="A5A5A5"/></a:accent3><a:accent4><a:srgbClr val="FFC000"/></a:accent4><a:accent5><a:srgbClr val="5B9BD5"/></a:accent5><a:accent6><a:srgbClr val="70AD47"/></a:accent6><a:hlink><a:srgbClr val="0563C1"/></a:hlink><a:folHlink><a:srgbClr val="954F72"/></a:folHlink></a:clrScheme><a:fontScheme name="Office"><a:majorFont><a:latin typeface="Calibri Light"/><a:ea typeface=""/><a:cs typeface=""/></a:majorFont><a:minorFont><a:latin typeface="Calibri"/><a:ea typeface=""/><a:cs typeface=""/></a:minorFont></a:fontScheme><a:fmtScheme name="Office"><a:fillStyleLst><a:solidFill><a:schemeClr val="phClr"/></a:solidFill><a:solidFill><a:schemeClr val="phClr"/></a:solidFill><a:solidFill><a:schemeClr val="phClr"/></a:solidFill></a:fillStyleLst><a:lnStyleLst><a:ln w="6350"><a:solidFill><a:schemeClr val="phClr"/></a:solidFill></a:ln><a:ln w="12700"><a:solidFill><a:schemeClr val="phClr"/></a:solidFill></a:ln><a:ln w="19050"><a:solidFill><a:schemeClr val="phClr"/></a:solidFill></a:ln></a:lnStyleLst><a:effectStyleLst><a:effectStyle><a:effectLst/></a:effectStyle><a:effectStyle><a:effectLst/></a:effectStyle><a:effectStyle><a:effectLst/></a:effectStyle></a:effectStyleLst><a:bgFillStyleLst><a:solidFill><a:schemeClr val="phClr"/></a:solidFill><a:solidFill><a:schemeClr val="phClr"/></a:solidFill><a:solidFill><a:schemeClr val="phClr"/></a:solidFill></a:bgFillStyleLst></a:fmtScheme></a:themeElements></a:theme>')),g&&M.add("xl/sharedStrings.xml",gF.encode(function(e){const t=e.getAll(),n=t.length;if(0===n)return pw("sst",{xmlns:lk,count:0,uniqueCount:0},"");const r=[];for(const e of t)r.push(hw("si",void 0,[dw(e)]));return pw("sst",{xmlns:lk,count:n,uniqueCount:n},r)}(c))),U&&M.add(ek,gF.encode(function(){const e=fw("metadataType",{name:KE,minSupportedVersion:12e4,copy:1,pasteAll:1,pasteValues:1,merge:1,splitFirst:1,rowColShift:1,clearFormats:1,clearComments:1,assign:1,coerce:1,cellMeta:1}),t=hw("bk",void 0,[hw("extLst",void 0,[hw("ext",{uri:ZE},[fw("xda:dynamicArrayProperties",{fDynamic:1,fCollapsed:0})])])]),n=hw("bk",void 0,[fw("rc",{t:1,v:0})]);return pw("metadata",{xmlns:"http://schemas.openxmlformats.org/spreadsheetml/2006/main","xmlns:xda":"http://schemas.microsoft.com/office/spreadsheetml/2017/dynamicarray"},[hw("metadataTypes",{count:1},[e]),hw("futureMetadata",{name:KE,count:1},[t]),hw("cellMetadata",{count:1},[n])])}())),R&&M.add(hE,gF.encode(function(){const e=[fw("bag",{type:"Checkbox"}),hw("bag",{type:"XFControls"},[hw("bagId",{k:"CellControl"},"0")]),hw("bag",{type:"XFComplement"},[hw("bagId",{k:"XFControls"},"1")]),hw("bag",{type:"XFComplements",extRef:"XFComplementsMapperExtRef"},[hw("a",{k:"MappedFeaturePropertyBags"},[hw("bagId",void 0,"2")])])];return pw("FeaturePropertyBags",{xmlns:fE},e)}())),L&&M.add("xl/vbaProject.bin",e.vbaProject);for(let e=0;e<p.length;e++){const n=p[e],r=m[e],i=B[e];M.add(`xl/worksheets/sheet${e+1}.xml`,gF.encode(n.xml));const o=n.hyperlinkRelationships.length>0,a=null!==r&&null!==n.drawingRId,s=null!==i&&null!==n.legacyDrawingRId,l=n.tables.length>0,c=null!==n.pictureRId&&null!==x[e],u=n.pivotTables.length>0;if(o||a||s||l||c||u){const t=[];for(const e of n.hyperlinkRelationships)t.push(fw("Relationship",{Id:e.id,Type:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/hyperlink",Target:e.target,TargetMode:"External"}));a&&n.drawingRId&&t.push(fw("Relationship",{Id:n.drawingRId,Type:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/drawing",Target:`../drawings/drawing${e+1}.xml`})),s&&n.legacyDrawingRId&&n.commentsRId&&(t.push(fw("Relationship",{Id:n.legacyDrawingRId,Type:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/vmlDrawing",Target:`../drawings/vmlDrawing${e+1}.vml`})),t.push(fw("Relationship",{Id:n.commentsRId,Type:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/comments",Target:`../comments${e+1}.xml`})));for(const e of n.tables)t.push(fw("Relationship",{Id:e.rId,Type:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/table",Target:`../tables/table${e.globalTableIndex}.xml`}));if(c&&n.pictureRId&&x[e]){const r=`../${x[e].slice(3)}`;t.push(fw("Relationship",{Id:n.pictureRId,Type:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/image",Target:r}))}for(const e of n.pivotTables)t.push(fw("Relationship",{Id:e.rId,Type:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/pivotTable",Target:`../pivotTables/pivotTable${e.globalPivotIndex}.xml`}));const r=pw("Relationships",{xmlns:"http://schemas.openxmlformats.org/package/2006/relationships"},t);M.add(`xl/worksheets/_rels/sheet${e+1}.xml.rels`,gF.encode(r))}if(r){M.add(`xl/drawings/drawing${e+1}.xml`,gF.encode(r.drawingXml)),M.add(`xl/drawings/_rels/drawing${e+1}.xml.rels`,gF.encode(r.drawingRels));for(const e of r.images)M.add(e.path,e.data,{compress:!1})}const f=w[e];if(f&&f.length>0)for(const e of f)M.add(`xl/charts/chart${e.globalIndex}.xml`,gF.encode(e.xml)),M.add(`xl/charts/_rels/chart${e.globalIndex}.xml.rels`,gF.encode(e.rels));c&&x[e]&&t[e].backgroundImage&&M.add(x[e],t[e].backgroundImage,{compress:!1}),i&&(M.add(`xl/comments${e+1}.xml`,gF.encode(i.commentsXml)),M.add(`xl/drawings/vmlDrawing${e+1}.vml`,gF.encode(i.vmlXml)));const d=t[e];if(d.tables&&d.tables.length>0)for(let e=0;e<d.tables.length;e++){const t=d.tables[e],r=n.tables[e].globalTableIndex;let i=t.range;i||(i=eF(t,d));const o=ZS({...t,range:i},r);M.add(`xl/tables/table${r}.xml`,gF.encode(o.tableXml))}}for(const e of S){const t=e.globalIndex;M.add(`xl/pivotCache/pivotCacheDefinition${t}.xml`,gF.encode(e.parts.cacheDefinitionXml)),M.add(`xl/pivotCache/_rels/pivotCacheDefinition${t}.xml.rels`,gF.encode(e.parts.cacheDefinitionRels)),M.add(`xl/pivotCache/pivotCacheRecords${t}.xml`,gF.encode(e.parts.cacheRecordsXml)),M.add(`xl/pivotTables/pivotTable${t}.xml`,gF.encode(e.parts.pivotTableXml)),M.add(`xl/pivotTables/_rels/pivotTable${t}.xml.rels`,gF.encode(e.parts.pivotTableRels))}const O=await M.build(),P=e.encryption;return P?.password?iB(O,P.password,{spinCount:P.spinCount}):O}function yF(e){if(e.rows&&e.rows.length>0)return e.rows.map(e=>e.map(ak));if(e.data&&e.data.length>0&&e.columns&&e.columns.length>0){const t=[],n=e.columns.map(e=>e.header??e.key??"");t.push(n);for(const n of e.data){const r=e.columns.map(e=>{if(!e.key)return null;const t=n[e.key];return void 0===t?null:VE(t)});t.push(r)}return t}return[]}async function vF(e){if(!Ce(e))return{error:"wb is not an effective object"};if(!Ie(we(e,"sheets")))return{error:"wb.sheets is not an array"};let t=null;try{t=await mF(e)}catch(e){return{error:e}}return t}async function AF(e,t="data",n){if(!Ee(e)){let t="no filename";return console.log(t,e),{error:t}}if(Ee(t)||(t="data"),!Ie(n)){let e="data is not an array";return console.log(e,n),{error:e}}Ie(n)&&Ce(we(n,0,null))&&(n=lr(n));let r=db(n,t);if(De(r,"error"))return console.log(r.error),r;let i=await vF(r);if(De(i,"error"))return console.log(i.error),i;if(Ga())ub(e,new Blob([i]));else{let t="fs";(await import(t)).default.writeFileSync(e,i)}}function bF(e){if(!za(e))return new Blob;return new Blob([e])}function wF(e,t,n=""){if(!Dn(t))return{};let r={};return mn(t,function(t){r[t]=we(e,t,n)}),r}function IF(e,t){if(!xe(e))return{};if(!Dn(t))return{};let n={};return mn(t,function(t){De(e,t)&&(n[t]=we(e,t))}),n}function xF(e,t=0,n={}){fo(t)||(t=0),t=zi(t);let r=we(n,"rounding","");return"ROUND_HALF_UP"!==r&&"ROUND_HALF_EVEN"!==r&&(r="ROUND_HALF_UP"),Fe(e)?new Gl(e).toDecimalPlaces(t,Gl[r]).toNumber():""}function CF(e,t={}){if(!Fe(e))throw new Error("v is not a number");let n=we(t,"returnDigit");if(or(n)||(n=!1),xr(e))return n?0:Da(e);let r=null,i=null;for(let t=1;t<=16;t++){let n=e*Math.pow(10,t);if(Math.abs(n-Math.round(n))<1e-9){r=t,i=Jl(e,t);break}}return null===i&&(r=16,i=Da(e)),n?r:i}let BF=e=>{let t=1;e<0&&(t=-1);let n=null;if((e=Math.abs(e))<.1)for(let r=1;r<16;r++){let i=Math.pow(10,r);if((e*=i)<1){n={r:1/i,v:t*e};break}}else{if(e<1)return{r:1,v:t*e};if(e>=1)for(let r=1;r<16;r++){let i=Math.pow(10,r);if((e/=i)<1){n={r:i,v:t*e};break}}}if(null===n)throw new Error(`can not normalize v[${e}]`);return n};function EF(e,t,n={}){if(!Ee(e))return"";if(!fo(t))return e;if(t=zi(t),e.length<=t)return e;let r=we(n,"funWithMsg"),i="";if(ca(r)){let n=r(e,t);Ee(n)&&(i=n)}return Zo(e,t)+`...${i}`}function kF(e){let t=Ya();return i(Number(e),"SIGKILL",n=>{n?t.reject(n):t.resolve(`pid[${e}] killed`)}),t}function SF(e,t={}){let n=we(t,"fs"),r=!1;try{n.statSync(e),r=!0}catch{r=!1}return r}function FF(e,t={}){let n=we(t,"fs");return!!SF(e,{fs:n})&&(!n.lstatSync(e).isDirectory()&&!n.lstatSync(e).isSymbolicLink())}function DF(e){return FF(e,{fs:a})}function NF(e,t={}){let n=null,r=we(t,"fs"),i="";try{i=r.readFileSync(e,"utf8")}catch(e){n=e}return null!==n?{error:n}:{success:i}}function MF(e){return NF(e,{fs:a})}let QF={buildSpawnArgs:function(e,t=[]){if(Ie(t)||(t=[]),"win32"!==process.platform)return{file:e,args:t,opt:{}};let n=function(e){if("win32"!==process.platform)return e;if(/\.(cmd|exe|bat|ps1)$/i.test(e))return e;if(o.isAbsolute(e))return e;try{let t=r.execFileSync("where",[e],{encoding:"utf8",timeout:5e3,windowsHide:!0,shell:!1,stdio:["ignore","pipe","ignore"]}).trim().split(/\r?\n/),n=t.find(e=>/\.cmd$/i.test(e));return n||(t.find(e=>/\.exe$/i.test(e))||t[0]||e)}catch{return e}}(e);if(/\.exe$/i.test(n))return{file:n,args:t,opt:{}};if(/\.(cmd|bat)$/i.test(n)){let e=function(e){let t=we(MF(e),"success","");if(!Ee(t))return null;let n=t.match(/%dp0%\\(node_modules\\[^"]+)"/i);if(!n)return null;let r=o.dirname(e),i=o.join(r,n[1]);return DF(i)?i:null}(n);if(e)return/\.exe$/i.test(e)?{file:e,args:t,opt:{}}:{file:process.execPath,args:[e,...t],opt:{}};let r=t.map(e=>`"${e.replace(/(\\*)"/g,'$1$1\\"').replace(/(\\*)$/,"$1$1")}"`.replace(/[()%!^"<>&|]/g,"^$&")),a=`${i=n,i.replace(/[()%!^"<>&|;, ]/g,"^$&")} ${r.join(" ")}`;return{file:process.env.comspec||process.env.COMSPEC||"cmd.exe",args:["/d","/s","/c",`"${a}"`],opt:{windowsVerbatimArguments:!0}}}var i;return{file:n,args:t,opt:{}}},buildSpawnEnv:function(e=void 0){let t={...process.env,PYTHONIOENCODING:"utf-8"};if(void 0!==e){if("win32"===process.platform){let n=Object.keys(e).map(e=>e.toLowerCase());for(let e of Object.keys(t))n.includes(e.toLowerCase())&&delete t[e]}t={...t,...e}}return t}},{buildSpawnArgs:TF,buildSpawnEnv:LF}=QF,RF={funWithMsg:e=>`(truncated, total ${e.length} chars)`};function UF(e,t=[],n={}){let{timeoutMs:i=12e4,cwd:o=process.cwd(),input:a,validate:s,maxBuffer:l=10485760,onStdout:c,onStderr:u,env:f}=n,d=function(e){if(ca(e))return e;if(!Ee(e))return null;let t=e.split(",").map(e=>e.trim()).filter(Boolean);return 0===t.length?null:e=>{for(let n of t)if("nonempty"===n){if(!Ee(e)||""===e.trim())return!1}else if("json"===n)try{JSON.parse(e)}catch{return!1}else if("min:"===Zo(n,4)){let t=ta(n,4);if(!Fe(t))return!1;let r=zi(t);if(!Ee(e)||e.length<r)return!1}return!0}}(s),h=Date.now(),p=Ya(),g=LF(f),m=TF(e,t),y=r.spawn(m.file,m.args,{cwd:o,stdio:["pipe","pipe","pipe"],windowsHide:!0,env:g,...m.opt}),v="",A="",b=new TextDecoder("utf-8"),w=new TextDecoder("utf-8"),I=!1,x=!1;y.stdout.on("data",e=>{let t=b.decode(e,{stream:!0});t&&(ca(c)&&c(t),v.length<l&&(v+=t))}),y.stderr.on("data",e=>{let t=w.decode(e,{stream:!0});t&&(ca(u)&&u(t),A.length<l&&(A+=t))}),y.stdin.on("error",()=>{}),void 0!==a&&y.stdin.write(a,"utf8"),y.stdin.end();let C=setTimeout(()=>{I||(x=!0,kF(y.pid).catch(()=>{}),setTimeout(()=>{I||(I=!0,p.resolve({ok:!1,stdout:EF(v,500,RF),stderr:EF(A,500,RF),code:null,error:`TIMEOUT after ${i/1e3}s(子進程未能結束)`,durationMs:Date.now()-h,pid:y.pid}))},3e3).unref())},i);return y.on("error",e=>{I||(I=!0,clearTimeout(C),p.resolve({ok:!1,stdout:"",stderr:"",code:null,error:`${e.code||"UNKNOWN"}: ${e.message}`,durationMs:Date.now()-h,pid:y.pid}))}),y.on("close",(e,t)=>{if(I)return;I=!0,clearTimeout(C);let n=b.decode();n&&v.length<l&&(v+=n);let r=w.decode();r&&A.length<l&&(A+=r);let o=Date.now()-h;x?p.resolve({ok:!1,stdout:EF(v,500,RF),stderr:EF(A,500,RF),code:e,error:`TIMEOUT after ${i/1e3}s`,durationMs:o,pid:y.pid}):0===e?!d||d(v)?p.resolve({ok:!0,stdout:v,stderr:A,code:0,error:"",durationMs:o,pid:y.pid}):p.resolve({ok:!1,stdout:EF(v,500,RF),stderr:EF(A,500,RF),code:0,error:"OUTPUT_VALIDATION_FAILED",durationMs:o,pid:y.pid}):p.resolve({ok:!1,stdout:EF(v,500,RF),stderr:EF(A,1e3,RF),code:e,error:t?`Signal: ${t}`:`Exit code ${e}`,durationMs:o,pid:y.pid})}),p}let{buildSpawnArgs:HF,buildSpawnEnv:qF}=QF;function OF(e,t=[],n={}){Ie(t)||(t=[]),xe(n)||(n={});let i=we(n,"cwd");Ee(i)||(i=process.cwd());let o=we(n,"env");xe(o)||(o=void 0);let a=we(n,"timeoutMs");$i(a)||(a=null);let s=we(n,"exitGraceMs");fo(s)||(s=2e3);let l=we(n,"killWaitMs");fo(l)||(l=3e3);let c=we(n,"stderrKeep");fo(c)||(c=4e3);let u=we(n,"onLine"),f=we(n,"onStdout"),d=we(n,"onStderr"),h=we(n,"onExit"),p=Date.now(),g=!1,m=null,y=!1,v=!1,A=!1,b="",w="",I=null,x=null,C=null,B=Ya(),E=null,k={pid:null,exited:!1,write:null,writeLine:null,stop:null},S=e=>{g||(g=!0,clearTimeout(I),clearTimeout(x),clearTimeout(C),m={code:null,signal:null,exited:!0,timeout:y,killed:v,error:"",stderr:b,durationMs:Date.now()-p,pid:k.pid,...e},k.exited=!0,ca(h)&&h(m),B.resolve(m))},F=()=>E||(E=Ya(),B.then(e=>{E.resolve(e)}),E);if(!Ee(e))return k.write=async()=>!1,k.writeLine=async()=>!1,k.stop=F,setTimeout(()=>{S({error:"command 須為非空字串"})},1),k;let D,N=HF(e,t);try{D=r.spawn(N.file,N.args,{cwd:i,stdio:["pipe","pipe","pipe"],windowsHide:!0,env:qF(o),...N.opt})}catch(e){return k.write=async()=>!1,k.writeLine=async()=>!1,k.stop=F,setTimeout(()=>{S({error:`${e.code||"UNKNOWN"}: ${e.message}`})},1),k}k.pid=D.pid||null;let M=new TextDecoder("utf-8"),Q=new TextDecoder("utf-8"),T=(e,t)=>{w+=e;let n=w.indexOf("\n");for(;n>=0;){let e=w.slice(0,n);w=w.slice(n+1),e.endsWith("\r")&&(e=e.slice(0,-1)),ca(u)&&u(e),n=w.indexOf("\n")}if(t&&""!==w){let e=w;w="",e.endsWith("\r")&&(e=e.slice(0,-1)),ca(u)&&u(e)}},L=e=>{b=0!==c?(b+e).slice(-c):""};D.stdout.on("data",e=>{let t=M.decode(e,{stream:!0});t&&(ca(f)&&f(t),T(t,!1))}),D.stderr.on("data",e=>{let t=Q.decode(e,{stream:!0});t&&(ca(d)&&d(t),L(t))}),D.stdin.on("error",()=>{});let R=e=>{v=!0,kF(D.pid).catch(()=>{}),C=setTimeout(()=>{g||S({code:null,exited:!1,error:e})},l)};return null!==a&&(I=setTimeout(()=>{g||(y=!0,R(`TIMEOUT after ${a/1e3}s(子進程未能結束)`))},a)),D.on("error",e=>{S({error:`${e.code||"UNKNOWN"}: ${e.message}`})}),D.on("close",(e,t)=>{if(g)return;let n=M.decode();n&&(ca(f)&&f(n),T(n,!1)),T("",!0);let r=Q.decode();r&&(ca(d)&&d(r),L(r));let i="";y?i=`TIMEOUT after ${a/1e3}s`:v||(t?i=`Signal: ${t}`:0!==e&&(i=`Exit code ${e}`)),S({code:e,signal:t,error:i})}),k.write=e=>{let t=Ya();if(g||A||D.stdin.destroyed||!D.stdin.writable)return t.resolve(!1),t;try{D.stdin.write(String(e),"utf8",e=>{t.resolve(!e)})}catch{t.resolve(!1)}return t},k.writeLine=e=>k.write(String(e)+"\n"),k.stop=()=>{if(E)return E;if(E=Ya(),g)return E.resolve(m),E;A=!0;try{D.stdin.end()}catch{}return x=setTimeout(()=>{g||R("STOP_TIMEOUT(子進程未能結束)")},s),B.then(e=>{E.resolve(e)}),E},k}function PF(e,t){return e>t}function zF(e){return e&&e.length?Hm(e,ln,PF):void 0}function $F(e){return null==e?[]:function(e,t){return he(t,function(t){return e[t]})}(e,ft(e))}function jF(e,t,n,r){for(var i=-1,o=null==e?0:e.length;++i<o;){var a=e[i];t(r,a,n(a),e)}return r}function VF(e,t,n,r){return ht(e,function(e,i,o){t(r,e,n(e),o)}),r}var YF,GF,WF=Object.prototype.hasOwnProperty,JF=(YF=function(e,t,n){WF.call(e,n)?e[n].push(t):ei(e,n,[t])},function(e,t){var n=A(e)?jF:VF,r=GF?GF():{};return n(e,YF,fn(t),r)}),_F=JF;function XF(e,t){if(!Ie(e)||!Ie(t))return[];if(e.length!==t.length)return[];return vn(e,function(n,r){return Py(e[r],t[r])})}function KF(e,t={}){let n=we(t,"fs");if(!SF(e,{fs:n}))return!1;let r=n.lstatSync(e);return!r.isFile()&&!r.isSymbolicLink()}function ZF(e,t={}){let n=we(t,"fs");if(KF(e,{fs:n}))return{success:"input folder is already exists: "+e};if(SF(e,{fs:n}))return{error:"input path already exists: "+e};try{n.mkdirSync(e,{recursive:!0})}catch(e){return{error:e}}return{success:"done: "+e}}function eD(e,t={}){let n=we(t,"path"),r=we(t,"fs");if(!SF(e,{fs:r})){let t=ZF(e,{fs:r});return t.error?t.error:{success:"done: "+e}}if(!KF(e,{fs:r}))return{error:"input path is not a folder"};try{let t=r.readdirSync(e);for(let i of t){let t=n.join(e,i);r.statSync(t).isDirectory()?r.rmSync(t,{recursive:!0,force:!0}):r.unlinkSync(t)}}catch(e){return{error:e}}return{success:"done: "+e}}function tD(e,t,n={}){let r=we(n,"path"),i=we(n,"fs"),o=we(n,"useSync","");or(o)||(o=!0);let a="";return a=o?function(e,t,n={}){let r=we(n,"path"),i=we(n,"fs");if(!FF(e,{fs:i}))return{error:`fpSrc[${e}] is not a file`};try{ZF(r.dirname(t),{fs:i}),i.copyFileSync(e,t)}catch(e){return{error:e}}return{success:"done: "+t}}(e,t,{path:r,fs:i}):async function(e,t,n={}){let r=we(n,"path"),i=we(n,"fs");if(!FF(e,{fs:i}))return{error:`fpSrc[${e}] is not a file`};let o=null;return await(async(e,t)=>{ZF(r.dirname(t),{fs:i}),await new Promise((n,r)=>{let o=i.createReadStream(e),a=i.createWriteStream(t);o.on("error",r),a.on("error",r),a.on("finish",n),o.pipe(a)})})(e,t).then(()=>{o={success:"done: "+t}}).catch(e=>{o={error:e}}),o}(e,t,{path:r,fs:i}),a}function nD(e,t,n={}){let r=we(n,"path"),i=we(n,"fs");if(!KF(e,{fs:i}))return{error:`fpSrc[${e}] is not a folder`};try{i.readdirSync(e).forEach(function(n){let o=r.resolve(e,n),a=r.resolve(t,n),s=i.lstatSync(o);if(s.isDirectory())ZF(a,{fs:i}),nD(o,a,{path:r,fs:i});else if(s.isSymbolicLink()){let e=i.readlinkSync(o);i.symlinkSync(e,a)}else ZF(r.dirname(a),{fs:i}),i.copyFileSync(o,a)})}catch(e){return{error:e}}return{success:"done: "+t}}function rD(e,t,n={}){let r=we(n,"path"),i=we(n,"fs"),o=we(n,"useSync","");or(o)||(o=!0);let a="";return a=o?nD(e,t,{path:r,fs:i}):async function(e,t,n={}){let r=we(n,"path"),i=we(n,"fs");if(!KF(e,{fs:i}))return{error:`fpSrc[${e}] is not a folder`};let o=async(e,t)=>{let n=i.readdirSync(e);for(let a of n){let n=r.join(e,a),s=r.join(t,a),l=i.lstatSync(n);if(l.isDirectory())ZF(s,{fs:i}),await o(n,s);else if(l.isSymbolicLink()){let e=i.readlinkSync(n);i.symlinkSync(e,s)}else ZF(r.dirname(s),{fs:i}),await new Promise((e,t)=>{let r=i.createReadStream(n),o=i.createWriteStream(s);r.on("error",t),o.on("error",t),o.on("finish",e),r.pipe(o)})}},a=null;return await o(e,t).then(()=>{a={success:"done: "+t}}).catch(e=>{a={error:e}}),a}(e,t,{path:r,fs:i}),a}function iD(e){if(!Ee(e))return{path:"",isRoot:!1};for(;e.indexOf("\\\\")>=0;)e=e.replace("\\\\","\\");for(;e.indexOf("//")>=0;)e=e.replace("//","/");if(":"===ea(e,1))return{path:`${e}\\`,isRoot:!0};if("\\"===ea(e,1)){let t=Ma(e,1);return":"===ea(t,1)?{path:e,isRoot:!0}:{path:t,isRoot:!1}}if("/"===ea(e,1)){let t=Ma(e,1);return 0===t.length?{path:e,isRoot:!0}:{path:t,isRoot:!1}}return{path:e,isRoot:!1}}function oD(e){if(!Ee(e))return"";let t=iD(e);if(t.isRoot)return t.path;let n=t.path;try{n=n.split("\\").pop().split("/").pop()}catch(e){}return n}function aD(e){if(!Ee(e))return"";let t=iD(e);if(t.isRoot)return t.path;let n=oD(e=t.path);if(!Ee(n))return e;let r=iD(e=Ma(e,n.length));return r.isRoot,r.path}function sD(e,t="",n={}){let r=we(n,"fs"),i=we(n,"encoding","");if(Ee(i)||(i="utf8"),SF(e,{fs:r}))return{error:"input path already exists: "+e};if(FF(e,{fs:r}))return{error:"input file is already exists: "+e};let o=aD(e);KF(o,{fs:r})||ZF(o,{fs:r});try{r.writeFileSync(e,t,{encoding:i})}catch(e){return{error:e}}return{success:"done: "+e}}function lD(e){return ZF(e,{fs:a})}function cD(e,t={}){let n=we(t,"fs");if(!SF(e,{fs:n}))return{success:"file does not exist: "+e};if(!FF(e,{fs:n}))return{error:"input path is not a file: "+e};try{n.unlinkSync(e)}catch(e){return{error:e}}return{success:"done: "+e}}async function uD(e,t={}){let n=we(t,"numRetry");$i(n)||(n=5),n=zi(n);let r=we(t,"fs",null);if(!SF(e,{fs:r}))return"file does not exist: "+e;if(!FF(e,{fs:r}))return Promise.reject("input path is not a file: "+e);for(let t=0;t<n;t++)try{r.unlinkSync(e);break}catch(e){if("EBUSY"!==e.code)return Promise.reject(e);await ls(300)}return"done: "+e}function fD(e,t={}){let n=we(t,"fs");if(!SF(e,{fs:n}))return{success:"folder does not exist: "+e};if(!KF(e,{fs:n}))return{error:"input path is not a folder: "+e};try{n.rmSync(e,{recursive:!0,force:!0})}catch(e){return{error:e}}return{success:"done: "+e}}function dD(e){return fD(e,{fs:a})}async function hD(e,t={}){let n=we(t,"numRetry");$i(n)||(n=5),n=zi(n);let r=we(t,"fs",null);if(!SF(e,{fs:r}))return"folder does not exist: "+e;if(!KF(e,{fs:r}))return Promise.reject("input path is not a folder: "+e);for(let t=0;t<n;t++)try{r.rmSync(e,{recursive:!0,force:!0});break}catch(e){if("EBUSY"!==e.code)return Promise.reject(e);await ls(300)}return"done: "+e}async function pD(e,t,n={}){let r="",i=we(n,"fs"),o=we(n,"Readable");if(!Ee(e))throw new Error("urlIn in not an effective string");let a=aD(t),s=we(n,"fnOut","");Ee(s)||(s=oD(t)),KF(a,{fs:i})||ZF(a,{fs:i});let l=Ya();try{let n=await fetch(e);if(!n.ok)return l.reject(n.statusText),l;let a=i.createWriteStream(t);o.fromWeb(n.body).pipe(a),a.on("finish",()=>{l.resolve(t)}),a.on("error",e=>{r=e.message,l.reject(r)})}catch(e){r=e.message,l.reject(r)}return l}function gD(){if(!ca(t))throw new Error("invalid dayjs");return t().format("YYYY-MM-DDTHH:mm:ssZ")}function mD(e){if(!Ee(e))return"";let t=oD(e),n=Qo(t,".");if(rr(n)<=1)return t;let r="";try{n=To(n),r=go(n,".")}catch(e){}return r}function yD(e){return KF(e,{fs:a})}function vD(e,t={}){let n=we(t,"polling");or(n)||(n=!1);let r=we(t,"timeInterval");$i(r)||(r=100),r=zi(r);let i=we(t,"timeBinaryInterval");$i(i)||(i=300),i=zi(i);let s=new u.EventEmitter,l=e,c=null,d=setInterval(()=>{if(null===c)yD(l)&&(c=f.watch(l,{usePolling:n,interval:r,binaryInterval:i,awaitWriteFinish:!0}),c.on("all",(e,t,n)=>{t=o.resolve(t),s.emit("change",{type:e,fp:t,stats:n}),"unlinkDir"===e&&o.resolve(l)===t&&setTimeout(()=>{h()},1)}));else if(!yD(l)){let e=a.fstatSync;s.emit("change",{type:"unlinkDir",fp:o.resolve(l),stats:e}),setTimeout(()=>{h()},1)}},r),h=()=>{if(null!==c){try{c.unwatch(l)}catch(e){console.log(e)}c.close().catch(e=>{console.log(e)}).finally(()=>{c=null})}};return s.clear=()=>{h(),clearInterval(d)},s}function AD(e,t={}){let n=we(t,"fs"),r=we(t,"crypto"),i=we(t,"type","");Ee(i)||(i="sha512");let o=Ya();if(!FF(e,{fs:n}))return o.reject(`fp[${e}] is not a file`),o;try{let t=r.createHash(i),a=n.createReadStream(e);a.on("readable",()=>{let e=a.read();e?t.update(e):o.resolve(t.digest("hex"))}),a.on("error",e=>{o.reject(e.toString())})}catch(e){o.reject(e.toString())}return o}const bD=new Uint8Array([0,97,115,109,1,0,0,0,1,48,8,96,3,127,127,127,1,127,96,3,127,127,127,0,96,2,127,127,0,96,1,127,1,127,96,3,127,127,126,1,126,96,3,126,127,127,1,126,96,2,127,126,0,96,1,127,1,126,3,11,10,0,0,2,1,3,4,5,6,1,7,5,3,1,0,1,7,85,9,3,109,101,109,2,0,5,120,120,104,51,50,0,0,6,105,110,105,116,51,50,0,2,8,117,112,100,97,116,101,51,50,0,3,8,100,105,103,101,115,116,51,50,0,4,5,120,120,104,54,52,0,5,6,105,110,105,116,54,52,0,7,8,117,112,100,97,116,101,54,52,0,8,8,100,105,103,101,115,116,54,52,0,9,10,251,22,10,242,1,1,4,127,32,0,32,1,106,33,3,32,1,65,16,79,4,127,32,3,65,16,107,33,6,32,2,65,168,136,141,161,2,106,33,3,32,2,65,137,235,208,208,7,107,33,4,32,2,65,207,140,162,142,6,106,33,5,3,64,32,3,32,0,40,2,0,65,247,148,175,175,120,108,106,65,13,119,65,177,243,221,241,121,108,33,3,32,4,32,0,65,4,106,34,0,40,2,0,65,247,148,175,175,120,108,106,65,13,119,65,177,243,221,241,121,108,33,4,32,2,32,0,65,4,106,34,0,40,2,0,65,247,148,175,175,120,108,106,65,13,119,65,177,243,221,241,121,108,33,2,32,5,32,0,65,4,106,34,0,40,2,0,65,247,148,175,175,120,108,106,65,13,119,65,177,243,221,241,121,108,33,5,32,6,32,0,65,4,106,34,0,79,13,0,11,32,2,65,12,119,32,5,65,18,119,106,32,4,65,7,119,106,32,3,65,1,119,106,5,32,2,65,177,207,217,178,1,106,11,32,1,106,32,0,32,1,65,15,113,16,1,11,146,1,0,32,1,32,2,106,33,2,3,64,32,1,65,4,106,32,2,75,69,4,64,32,0,32,1,40,2,0,65,189,220,202,149,124,108,106,65,17,119,65,175,214,211,190,2,108,33,0,32,1,65,4,106,33,1,12,1,11,11,3,64,32,1,32,2,79,69,4,64,32,0,32,1,45,0,0,65,177,207,217,178,1,108,106,65,11,119,65,177,243,221,241,121,108,33,0,32,1,65,1,106,33,1,12,1,11,11,32,0,32,0,65,15,118,115,65,247,148,175,175,120,108,34,0,65,13,118,32,0,115,65,189,220,202,149,124,108,34,0,65,16,118,32,0,115,11,63,0,32,0,65,8,106,32,1,65,168,136,141,161,2,106,54,2,0,32,0,65,12,106,32,1,65,137,235,208,208,7,107,54,2,0,32,0,65,16,106,32,1,54,2,0,32,0,65,20,106,32,1,65,207,140,162,142,6,106,54,2,0,11,195,4,1,6,127,32,1,32,2,106,33,6,32,0,65,24,106,33,4,32,0,65,40,106,40,2,0,33,3,32,0,32,0,40,2,0,32,2,106,54,2,0,32,0,65,4,106,34,5,32,5,40,2,0,32,2,65,16,79,32,0,40,2,0,65,16,79,114,114,54,2,0,32,2,32,3,106,65,16,73,4,64,32,3,32,4,106,32,1,32,2,252,10,0,0,32,0,65,40,106,32,2,32,3,106,54,2,0,15,11,32,3,4,64,32,3,32,4,106,32,1,65,16,32,3,107,34,2,252,10,0,0,32,0,65,8,106,34,3,32,3,40,2,0,32,4,40,2,0,65,247,148,175,175,120,108,106,65,13,119,65,177,243,221,241,121,108,54,2,0,32,0,65,12,106,34,3,32,3,40,2,0,32,4,65,4,106,40,2,0,65,247,148,175,175,120,108,106,65,13,119,65,177,243,221,241,121,108,54,2,0,32,0,65,16,106,34,3,32,3,40,2,0,32,4,65,8,106,40,2,0,65,247,148,175,175,120,108,106,65,13,119,65,177,243,221,241,121,108,54,2,0,32,0,65,20,106,34,3,32,3,40,2,0,32,4,65,12,106,40,2,0,65,247,148,175,175,120,108,106,65,13,119,65,177,243,221,241,121,108,54,2,0,32,0,65,40,106,65,0,54,2,0,32,1,32,2,106,33,1,11,32,1,32,6,65,16,107,77,4,64,32,6,65,16,107,33,8,32,0,65,8,106,40,2,0,33,2,32,0,65,12,106,40,2,0,33,3,32,0,65,16,106,40,2,0,33,5,32,0,65,20,106,40,2,0,33,7,3,64,32,2,32,1,40,2,0,65,247,148,175,175,120,108,106,65,13,119,65,177,243,221,241,121,108,33,2,32,3,32,1,65,4,106,34,1,40,2,0,65,247,148,175,175,120,108,106,65,13,119,65,177,243,221,241,121,108,33,3,32,5,32,1,65,4,106,34,1,40,2,0,65,247,148,175,175,120,108,106,65,13,119,65,177,243,221,241,121,108,33,5,32,7,32,1,65,4,106,34,1,40,2,0,65,247,148,175,175,120,108,106,65,13,119,65,177,243,221,241,121,108,33,7,32,8,32,1,65,4,106,34,1,79,13,0,11,32,0,65,8,106,32,2,54,2,0,32,0,65,12,106,32,3,54,2,0,32,0,65,16,106,32,5,54,2,0,32,0,65,20,106,32,7,54,2,0,11,32,1,32,6,73,4,64,32,4,32,1,32,6,32,1,107,34,1,252,10,0,0,32,0,65,40,106,32,1,54,2,0,11,11,97,1,1,127,32,0,65,16,106,40,2,0,33,1,32,0,65,4,106,40,2,0,4,127,32,1,65,12,119,32,0,65,20,106,40,2,0,65,18,119,106,32,0,65,12,106,40,2,0,65,7,119,106,32,0,65,8,106,40,2,0,65,1,119,106,5,32,1,65,177,207,217,178,1,106,11,32,0,40,2,0,106,32,0,65,24,106,32,0,65,40,106,40,2,0,16,1,11,255,3,2,3,126,1,127,32,0,32,1,106,33,6,32,1,65,32,79,4,126,32,6,65,32,107,33,6,32,2,66,214,235,130,238,234,253,137,245,224,0,124,33,3,32,2,66,177,169,172,193,173,184,212,166,61,125,33,4,32,2,66,249,234,208,208,231,201,161,228,225,0,124,33,5,3,64,32,3,32,0,41,3,0,66,207,214,211,190,210,199,171,217,66,126,124,66,31,137,66,135,149,175,175,152,182,222,155,158,127,126,33,3,32,4,32,0,65,8,106,34,0,41,3,0,66,207,214,211,190,210,199,171,217,66,126,124,66,31,137,66,135,149,175,175,152,182,222,155,158,127,126,33,4,32,2,32,0,65,8,106,34,0,41,3,0,66,207,214,211,190,210,199,171,217,66,126,124,66,31,137,66,135,149,175,175,152,182,222,155,158,127,126,33,2,32,5,32,0,65,8,106,34,0,41,3,0,66,207,214,211,190,210,199,171,217,66,126,124,66,31,137,66,135,149,175,175,152,182,222,155,158,127,126,33,5,32,6,32,0,65,8,106,34,0,79,13,0,11,32,2,66,12,137,32,5,66,18,137,124,32,4,66,7,137,124,32,3,66,1,137,124,32,3,66,207,214,211,190,210,199,171,217,66,126,66,31,137,66,135,149,175,175,152,182,222,155,158,127,126,133,66,135,149,175,175,152,182,222,155,158,127,126,66,157,163,181,234,131,177,141,138,250,0,125,32,4,66,207,214,211,190,210,199,171,217,66,126,66,31,137,66,135,149,175,175,152,182,222,155,158,127,126,133,66,135,149,175,175,152,182,222,155,158,127,126,66,157,163,181,234,131,177,141,138,250,0,125,32,2,66,207,214,211,190,210,199,171,217,66,126,66,31,137,66,135,149,175,175,152,182,222,155,158,127,126,133,66,135,149,175,175,152,182,222,155,158,127,126,66,157,163,181,234,131,177,141,138,250,0,125,32,5,66,207,214,211,190,210,199,171,217,66,126,66,31,137,66,135,149,175,175,152,182,222,155,158,127,126,133,66,135,149,175,175,152,182,222,155,158,127,126,66,157,163,181,234,131,177,141,138,250,0,125,5,32,2,66,197,207,217,178,241,229,186,234,39,124,11,32,1,173,124,32,0,32,1,65,31,113,16,6,11,134,2,0,32,1,32,2,106,33,2,3,64,32,2,32,1,65,8,106,79,4,64,32,1,41,3,0,66,207,214,211,190,210,199,171,217,66,126,66,31,137,66,135,149,175,175,152,182,222,155,158,127,126,32,0,133,66,27,137,66,135,149,175,175,152,182,222,155,158,127,126,66,157,163,181,234,131,177,141,138,250,0,125,33,0,32,1,65,8,106,33,1,12,1,11,11,32,1,65,4,106,32,2,77,4,64,32,0,32,1,53,2,0,66,135,149,175,175,152,182,222,155,158,127,126,133,66,23,137,66,207,214,211,190,210,199,171,217,66,126,66,249,243,221,241,153,246,153,171,22,124,33,0,32,1,65,4,106,33,1,11,3,64,32,1,32,2,73,4,64,32,0,32,1,49,0,0,66,197,207,217,178,241,229,186,234,39,126,133,66,11,137,66,135,149,175,175,152,182,222,155,158,127,126,33,0,32,1,65,1,106,33,1,12,1,11,11,32,0,32,0,66,33,136,133,66,207,214,211,190,210,199,171,217,66,126,34,0,32,0,66,29,136,133,66,249,243,221,241,153,246,153,171,22,126,34,0,32,0,66,32,136,133,11,77,0,32,0,65,8,106,32,1,66,214,235,130,238,234,253,137,245,224,0,124,55,3,0,32,0,65,16,106,32,1,66,177,169,172,193,173,184,212,166,61,125,55,3,0,32,0,65,24,106,32,1,55,3,0,32,0,65,32,106,32,1,66,249,234,208,208,231,201,161,228,225,0,124,55,3,0,11,244,4,2,3,127,4,126,32,1,32,2,106,33,5,32,0,65,40,106,33,4,32,0,65,200,0,106,40,2,0,33,3,32,0,32,0,41,3,0,32,2,173,124,55,3,0,32,2,32,3,106,65,32,73,4,64,32,3,32,4,106,32,1,32,2,252,10,0,0,32,0,65,200,0,106,32,2,32,3,106,54,2,0,15,11,32,3,4,64,32,3,32,4,106,32,1,65,32,32,3,107,34,2,252,10,0,0,32,0,65,8,106,34,3,32,3,41,3,0,32,4,41,3,0,66,207,214,211,190,210,199,171,217,66,126,124,66,31,137,66,135,149,175,175,152,182,222,155,158,127,126,55,3,0,32,0,65,16,106,34,3,32,3,41,3,0,32,4,65,8,106,41,3,0,66,207,214,211,190,210,199,171,217,66,126,124,66,31,137,66,135,149,175,175,152,182,222,155,158,127,126,55,3,0,32,0,65,24,106,34,3,32,3,41,3,0,32,4,65,16,106,41,3,0,66,207,214,211,190,210,199,171,217,66,126,124,66,31,137,66,135,149,175,175,152,182,222,155,158,127,126,55,3,0,32,0,65,32,106,34,3,32,3,41,3,0,32,4,65,24,106,41,3,0,66,207,214,211,190,210,199,171,217,66,126,124,66,31,137,66,135,149,175,175,152,182,222,155,158,127,126,55,3,0,32,0,65,200,0,106,65,0,54,2,0,32,1,32,2,106,33,1,11,32,1,65,32,106,32,5,77,4,64,32,5,65,32,107,33,2,32,0,65,8,106,41,3,0,33,6,32,0,65,16,106,41,3,0,33,7,32,0,65,24,106,41,3,0,33,8,32,0,65,32,106,41,3,0,33,9,3,64,32,6,32,1,41,3,0,66,207,214,211,190,210,199,171,217,66,126,124,66,31,137,66,135,149,175,175,152,182,222,155,158,127,126,33,6,32,7,32,1,65,8,106,34,1,41,3,0,66,207,214,211,190,210,199,171,217,66,126,124,66,31,137,66,135,149,175,175,152,182,222,155,158,127,126,33,7,32,8,32,1,65,8,106,34,1,41,3,0,66,207,214,211,190,210,199,171,217,66,126,124,66,31,137,66,135,149,175,175,152,182,222,155,158,127,126,33,8,32,9,32,1,65,8,106,34,1,41,3,0,66,207,214,211,190,210,199,171,217,66,126,124,66,31,137,66,135,149,175,175,152,182,222,155,158,127,126,33,9,32,2,32,1,65,8,106,34,1,79,13,0,11,32,0,65,8,106,32,6,55,3,0,32,0,65,16,106,32,7,55,3,0,32,0,65,24,106,32,8,55,3,0,32,0,65,32,106,32,9,55,3,0,11,32,1,32,5,73,4,64,32,4,32,1,32,5,32,1,107,34,1,252,10,0,0,32,0,65,200,0,106,32,1,54,2,0,11,11,188,2,1,5,126,32,0,65,24,106,41,3,0,33,1,32,0,41,3,0,34,2,66,32,90,4,126,32,0,65,8,106,41,3,0,34,3,66,1,137,32,0,65,16,106,41,3,0,34,4,66,7,137,124,32,1,66,12,137,32,0,65,32,106,41,3,0,34,5,66,18,137,124,124,32,3,66,207,214,211,190,210,199,171,217,66,126,66,31,137,66,135,149,175,175,152,182,222,155,158,127,126,133,66,135,149,175,175,152,182,222,155,158,127,126,66,157,163,181,234,131,177,141,138,250,0,125,32,4,66,207,214,211,190,210,199,171,217,66,126,66,31,137,66,135,149,175,175,152,182,222,155,158,127,126,133,66,135,149,175,175,152,182,222,155,158,127,126,66,157,163,181,234,131,177,141,138,250,0,125,32,1,66,207,214,211,190,210,199,171,217,66,126,66,31,137,66,135,149,175,175,152,182,222,155,158,127,126,133,66,135,149,175,175,152,182,222,155,158,127,126,66,157,163,181,234,131,177,141,138,250,0,125,32,5,66,207,214,211,190,210,199,171,217,66,126,66,31,137,66,135,149,175,175,152,182,222,155,158,127,126,133,66,135,149,175,175,152,182,222,155,158,127,126,66,157,163,181,234,131,177,141,138,250,0,125,5,32,1,66,197,207,217,178,241,229,186,234,39,124,11,32,2,124,32,0,65,40,106,32,2,66,31,131,167,16,6,11]);async function wD(){return function(e){const{exports:{mem:t,xxh32:n,xxh64:r,init32:i,update32:o,digest32:a,init64:s,update64:l,digest64:c}}=e;let u=new Uint8Array(t.buffer);function f(e,n){if(t.buffer.byteLength<e+n){const r=Math.ceil((e+n-t.buffer.byteLength)/65536);t.grow(r),u=new Uint8Array(t.buffer)}}function d(e,t,n,r,i,o){f(e);const a=new Uint8Array(e);return u.set(a),n(0,t),a.set(u.subarray(0,e)),{update(t){let n;return u.set(a),"string"==typeof t?(f(3*t.length,e),n=m.encodeInto(t,u.subarray(e)).written):(f(t.byteLength,e),u.set(t,e),n=t.byteLength),r(0,e,n),a.set(u.subarray(0,e)),this},digest:()=>(u.set(a),o(i(0)))}}function h(e){return e>>>0}const p=2n**64n-1n;function g(e){return e&p}const m=new TextEncoder;function y(e,t=0){return f(3*e.length,0),h(n(0,m.encodeInto(e,u).written,t))}function v(e,t=0n){return f(3*e.length,0),g(r(0,m.encodeInto(e,u).written,t))}return{h32:y,h32ToString:(e,t=0)=>y(e,t).toString(16).padStart(8,"0"),h32Raw:(e,t=0)=>(f(e.byteLength,0),u.set(e),h(n(0,e.byteLength,t))),create32:(e=0)=>d(48,e,i,o,a,h),h64:v,h64ToString:(e,t=0n)=>v(e,t).toString(16).padStart(16,"0"),h64Raw:(e,t=0n)=>(f(e.byteLength,0),u.set(e),g(r(0,e.byteLength,t))),create64:(e=0n)=>d(88,e,s,l,c,g)}}((await WebAssembly.instantiate(bD)).instance)}async function ID(e,t={}){let n=we(t,"fs"),r=we(t,"chunkSize");if(Fe(r)||(r=67108864),r=Ir(r),!FF(e,{fs:n}))return Promise.reject("fp is not a file");let i=Ya();try{let{create64:t}=await wD(),o=t(),a=n.createReadStream(e,{highWaterMark:r});a.on("data",e=>{o.update(e)}),a.on("end",()=>{let e=o.digest().toString(16).padStart(16,"0");i.resolve(e)}),a.on("error",i.reject)}catch(e){i.reject(e.toString())}return i}function xD(e,t={}){let n=we(t,"fs"),r=we(t,"crypto"),i=we(t,"type","");Ee(i)||(i="sha512");let o=we(t,"chunkSize");Fe(o)||(o=67108864),o=Ir(o);let a=Ya();return FF(e,{fs:n})?"xxhash64"===i?ID(e,{fs:n,chunkSize:o}):AD(e,{fs:n,crypto:r,type:i}):(a.reject(`fp[${e}] is not a file`),a)}function CD(e,t=1,n={}){let r=1,i=we(n,"path"),o=we(n,"fs");if(!KF(e,{fs:o}))throw new Error(`fd[${e}] is not a folder`);return null!==t&&$i(t)&&(t=zi(t))<1&&(t=1),function e(n){let a=[];return KF(n,{fs:o})?(mn(o.readdirSync(n),function(s){let l=i.resolve(n,s),c=null;try{c=o.statSync(l)}catch(e){}c&&c.isDirectory()?(a.push({isFolder:!0,level:r,path:l,name:i.basename(l)}),r+=1,(r<=t||null===t)&&(a=a.concat(e(l))),r-=1):a.push({isFolder:!1,level:r,path:l,name:i.basename(l)})}),a):a}(e)}function BD(e,t=1,n={}){let r=we(n,"path"),i=we(n,"fs");if(!KF(e,{fs:i}))throw new Error(`fd[${e}] is not a folder`);let o=[];return o=CD(e,t,{path:r,fs:i}),o=ra(o,{isFolder:!1}),o=vn(o,e=>(delete e.isFolder,e)),o}async function ED(e,t=1,n={}){let r=we(n,"path"),i=we(n,"fs"),o=we(n,"crypto"),a=we(n,"type","");if(Ee(a)||(a="md5"),!KF(e,{fs:i}))throw new Error(`fd[${e}] is not a folder`);let s=BD(e,t,{path:r,fs:i});return s=await Kl(s,async e=>{let t=we(e,"path","");return e.hashType=a,e.hash="",Ee(t)&&(e.hash=await xD(t,{fs:i,crypto:o,type:a,useSync:!1})),e}),s}async function kD(e,t=1,n={}){return ED(e,t,{path:o,fs:a,crypto:d,...n})}async function SD(e,t={}){let n=we(t,"path"),r=we(t,"fs"),i=we(t,"crypto"),o=we(t,"type","");Ee(o)||(o="md5");let a=[],s=CD(e,null,{path:n,fs:r});return await Kl(s,async e=>{if(e.isFolder)return;let t=await AD(e.path,{fs:r,crypto:i,type:o});a.push(t)}),go(a,"|")}function FD(e,t=1,n={}){let r=we(n,"path"),i=we(n,"fs");if(!KF(e,{fs:i}))throw new Error(`fd[${e}] is not a folder`);let o=[];return o=CD(e,t,{path:r,fs:i}),o=ra(o,{isFolder:!0}),o=vn(o,e=>(delete e.isFolder,e)),o}async function DD(e,t,n={}){let r="",i=we(n,"fs");if(!Dn(e))throw new Error("fpsIn in not an effective array");let o=aD(t),a=we(n,"fnOut","");Ee(a)||(a=oD(t)),KF(o,{fs:i})||ZF(o,{fs:i});let s=Ya();s.catch(()=>{});let l=null,c=null,f=Ya();f.catch(()=>{});try{l=i.createWriteStream(t),l.on("error",e=>{c=e,r=e.message,f.reject(e),s.reject(r)}),l.on("finish",()=>{let e={filename:a,path:t};s.resolve(e)});for(let t=0;t<e.length;t++){if(null!==c)throw c;let n=e[t];if(!FF(n,{fs:i}))throw new Error(`fpIn[${n}] is not a file`);let r=async()=>{let e=i.createReadStream(n),t=null;for await(let n of e){if(null!==c)throw c;let e=!1,r=new Promise((t,r)=>{e=!l.write(n,e=>{e?r(e):t()})});r.catch(()=>{}),t=r,e&&await Promise.race([u.once(l,"drain"),f])}if(null!==t&&await t,null!==c)throw c;cD(n,{fs:i})};await r()}l.end()}catch(e){r=we(e,"message",String(e));try{l.destroy()}catch(e){}s.reject(r)}return s}function ND(e,t,n={}){let r=we(n,"fs");if(!FF(e,{fs:r}))return{error:`pahOld[${e}] is not a file`};if(SF(t,{fs:r}))return{error:`pahNew[${t}] already exists`};let i=aD(t);KF(i,{fs:r})||ZF(i,{fs:r});try{r.renameSync(e,t)}catch(e){return{error:e}}return{success:"done: "+t}}function MD(e,t,n={}){let r=we(n,"fs");if(!KF(e,{fs:r}))return{error:`pahOld[${e}] is not a folder`};if(SF(t,{fs:r}))return{error:`pahNew[${t}] already exists`};let i=aD(t);KF(i,{fs:r})||ZF(i,{fs:r});try{r.renameSync(e,t)}catch(e){return{error:e}}return{success:"done: "+t}}function QD(e,t,n,r={}){let i=we(r,"withInfor");or(i)||(i=!0);let o={del:[],add:[],same:[],diff:[]};if(!Ee(n))return console.log("invalid key"),i&&(o.infor={}),o;Ie(e)||(e=[e]),Ie(t)||(t=[t]),e=ra(e,e=>De(e,n)),t=ra(t,e=>De(e,n));let a=new Map(t.map(e=>[e[n],e]));for(let t of e){let e=a.get(t[n]);if(e){JSON.stringify(t)===JSON.stringify(e)?o.same.push(e):o.diff.push(e),a.delete(t[n])}else o.del.push(t)}if(o.add=Array.from(a.values()),i){let e={};for(let t of o.del)e[t[n]]="del";for(let t of o.add)e[t[n]]="add";for(let t of o.diff)e[t[n]]="diff";for(let t of o.same)e[t[n]]="same";o.infor=e}return o}async function TD(e,t=1,n={}){let r=we(n,"path"),i=we(n,"fs"),o=we(n,"crypto"),a=we(n,"type","");Ee(a)||(a="md5");let s=we(n,"forFile",null);or(s)||(s=!0);let l=we(n,"forFolder",null);if(or(l)||(l=!1),!KF(e,{fs:i}))throw new Error(`fd[${e}] is not a folder`);let c=CD(e,t,{path:r,fs:i});return c=await Kl(c,async e=>{let t="";return s&&!e.isFolder&&(t=await AD(e.path,{fs:i,crypto:o,type:a})),l&&e.isFolder&&(t=await SD(e.path,{path:r,fs:i,crypto:o,type:a})),e.hash=t,e}),c}async function LD(e,t,n={}){let r=we(n,"path"),i=we(n,"fs"),o=we(n,"crypto"),a=we(n,"type","");if(Ee(a)||(a="md5"),!KF(e,{fs:i}))throw new Error(`fdSrc[${e}] is not a folder`);let s=!1;if(!KF(t,{fs:i}))return await rD(e,t,{path:r,fs:i,useSync:!1}),s=!0,s;let l=r.sep,c=r.sep.length,u=(e,t)=>(e=vn(e,e=>((e,t)=>{let n=e.isFolder?"folder":"file",r=e.path.replace(t,"");return Zo(r,c)===l&&(r=ta(r,c)),r=r.replaceAll("\\","/"),{id:`${n}|${r}`,isFolder:e.isFolder,name:e.name,rpath:r,hash:e.hash}})(e,t)),e),f=await TD(e,null,{path:r,fs:i,crypto:o,type:a,forFile:!0,forFolder:!1});f=u(f,r.resolve(e));let d=await TD(t,null,{path:r,fs:i,crypto:o,type:a,forFile:!0,forFolder:!1});d=u(d,r.resolve(t));let h=QD(d,f,"id",{withInfor:!1});return s=rr(h.del)>0||rr(h.add)>0||rr(h.diff)>0,await Kl(h.del,async e=>{if(e.isFolder){fD(r.resolve(t,e.rpath),{fs:i})}}),await Kl(h.del,async e=>{if(!e.isFolder){cD(r.resolve(t,e.rpath),{fs:i})}}),await Kl([...h.add,...h.diff],async n=>{if(!n.isFolder){let o=r.resolve(e,n.rpath),a=r.resolve(t,n.rpath);await tD(o,a,{path:r,fs:i,useSync:!1})}}),s}function RD(e,t={}){let n=we(t,"polling");or(n)||(n=!1);let r=we(t,"timeInterval");$i(r)||(r=100),r=zi(r);let i=we(t,"timeBinaryInterval");$i(i)||(i=300),i=zi(i);let a=new u.EventEmitter,s=e,l=null,c=setInterval(()=>{null===l&&DF(s)&&(l=f.watch(s,{usePolling:n,interval:r,binaryInterval:i,awaitWriteFinish:!0}),l.on("all",(e,t,n)=>{t=o.resolve(t),a.emit("change",{type:e,fp:t,stats:n})}))},r);return a.clear=()=>{(()=>{if(null!==l){try{l.unwatch(s)}catch(e){console.log(e)}l.close().catch(e=>{console.log(e)}).finally(()=>{l=null})}})(),clearInterval(c)},a}function UD(e,t,n={}){let r=null,i=we(n,"fs"),o=aD(e);KF(o,{fs:i})||ZF(o,{fs:i});try{i.writeFileSync(e,t,"utf8")}catch(e){r=e}return null!==r?{error:r}:{success:e}}const HD=[];for(let e=0;e<256;++e)HD.push((e+256).toString(16).slice(1));const qD=new Uint8Array(16);function OD(){return crypto.getRandomValues(qD)}const PD={};function zD(e,t,n){let r;if(e)r=$D(e.random??e.rng?.()??OD(),e.msecs,e.seq,t,n);else{const e=Date.now(),i=OD();!function(e,t,n){e.msecs??=-1/0,e.seq??=0,t>e.msecs?(e.seq=jD(n),e.msecs=t):(e.seq=e.seq+1|0,0===e.seq&&e.msecs++)}(PD,e,i),r=$D(i,PD.msecs,PD.seq,t,n)}return t??function(e,t=0){return(HD[e[t+0]]+HD[e[t+1]]+HD[e[t+2]]+HD[e[t+3]]+"-"+HD[e[t+4]]+HD[e[t+5]]+"-"+HD[e[t+6]]+HD[e[t+7]]+"-"+HD[e[t+8]]+HD[e[t+9]]+"-"+HD[e[t+10]]+HD[e[t+11]]+HD[e[t+12]]+HD[e[t+13]]+HD[e[t+14]]+HD[e[t+15]]).toLowerCase()}(r)}function $D(e,t,n,r,i=0){if(e.length<16)throw new Error("Random bytes length must be >= 16");if(r){if(i<0||i+16>r.length)throw new RangeError(`UUID byte range ${i}:${i+15} is out of buffer bounds`)}else r=new Uint8Array(16),i=0;return t??=Date.now(),n??=jD(e),r[i++]=t/1099511627776&255,r[i++]=t/4294967296&255,r[i++]=t/16777216&255,r[i++]=t/65536&255,r[i++]=t/256&255,r[i++]=255&t,r[i++]=112|n>>>28&15,r[i++]=n>>>20&255,r[i++]=128|n>>>14&63,r[i++]=n>>>6&255,r[i++]=n<<2&255|3&e[10],r[i++]=e[11],r[i++]=e[12],r[i++]=e[13],r[i++]=e[14],r[i++]=e[15],r}function jD(e){return(127&e[6])<<24|e[7]<<16|e[8]<<8|e[9]}function VD(e){return"[object Uint16Array]"===Object.prototype.toString.call(e)}function YD(e){if(!(y(e)||rs(e)||za(e)||VD(e)))return null;try{if(e.byteLength)return e.byteLength}catch(e){}try{if(e.length)return e.length}catch(e){}try{if(e.size)return e.size}catch(e){}return null}function GD(e,t=!0){if(!Dn(e)){return{error:"no data"}}let n=null;try{n=function(e,t=!0){let n=t?"\ufeff":"";return mn(e,e=>{let t=[];mn(e,e=>{Be(e)?(e=ic(e,"\r\n",""),e=ic(e,"\r",""),e=`"${e=ic(e,"\n","")}"`):e=or(e)?e?"true":"false":Da(e),t.push(e)}),n+=go(t,",")+"\r\n"}),n}(e,t)}catch(e){return{error:e}}return n}function WD(e){return or(e)?e?"true":"false":Da(e)}function JD(e,t){let n=[];return mn(e,e=>{let r=vn(e.rows,e=>vn(e,e=>null===e?"":t?WD(e):e));n.push({sheetname:e.name,data:r})}),n}async function _D(e,t){let n=we(t,"fmt","ltdt");if(!la(["ltdt","csv","array"],n))return{error:"opt.fmt is not one of 'ltdt', 'csv', 'array'"};let r,i=we(t,"valueToString",!0);if(!or(i))return{error:"opt.valueToString is not a boolean"};try{r=await tS(e)}catch(e){return console.log("error: ",e),{error:"can not read data from u8a"}}let o=null;try{"ltdt"===n?o=function(e,t){let n=[];return mn(e,e=>{let r=e.rows,i=vn(we(r,0,[]),e=>null===e||""===e?null:WD(e)),o=[];for(let e=1;e<r.length;e++){let n=r[e];if(hn(n,e=>null===e))continue;let a={};for(let e=0;e<i.length;e++){if(null===i[e])continue;let r=we(n,e,null);null!==r&&(t&&(r=WD(r)),a[i[e]]=r)}o.push(a)}n.push({sheetname:e.name,data:o})}),n}(r.sheets,i):"array"===n?o=JD(r.sheets,i):"csv"===n&&(o=function(e,t){let n=JD(e,t);return mn(n,(e,t)=>{n[t].data=GD(e.data,!1)}),n}(r.sheets,i))}catch(e){return console.log("error: ",e),{error:"can not convert data"}}return o}var XD;function KD(e){if(!N(e))return!1;var t=D(e);return"[object Error]"==t||"[object DOMException]"==t||"string"==typeof e.message&&"string"==typeof e.name&&!gu(e)}function ZD(e){return KD(e)}
25
25
  /*!
26
26
  * hash-wasm (https://www.npmjs.com/package/hash-wasm)
27
27
  * (c) Dani Biro