Spaces:
Running
Running
feat: Using bun
Browse files- 404.html +1 -1
- README.md +30 -16
- _next/static/chunks/190-a03d46f1813684ea.js +0 -0
- _next/static/chunks/251.b8ce00a7f6eefa34.js +1 -0
- _next/static/chunks/266d6a74.21fca583acb189b2.js +0 -1
- _next/static/chunks/332-dcb3f9d33411b2c1.js +0 -6
- _next/static/chunks/341.aebfdbdeb384a503.js +0 -0
- _next/static/chunks/360.47885073fb31529e.js +0 -0
- _next/static/chunks/{49ada614.cc7dff79d7281ee6.js β 50bd76a3.3d24d573e3ca7a71.js} +0 -0
- _next/static/chunks/51-de6ec599ce154973.js +1 -0
- _next/static/chunks/{28fd365c.0d75ba7c838a0b07.js β 590caa2a.be5af588047a1c85.js} +3 -3
- _next/static/chunks/6139e184.f5956607c9895a14.js +1 -0
- _next/static/chunks/72-b9a6a0da3e447ebd.js +6 -0
- _next/static/chunks/724.451ccadd4705cccd.js +0 -1
- _next/static/chunks/849-68d1881ffb6c5768.js +0 -1
- _next/static/chunks/925-02555f58b42a478a.js +0 -0
- _next/static/chunks/app/_not-found/{page-f692fe2608220f5d.js β page-367734fbb4e34400.js} +1 -1
- _next/static/chunks/app/{layout-1e509317e28476c4.js β layout-e0223e57eaadc292.js} +1 -1
- _next/static/chunks/app/page-7e312bb1702d52aa.js +0 -1
- _next/static/chunks/app/page-8d8ca48a7333bb5c.js +1 -0
- _next/static/chunks/{4b236691-df73c8aa6aaf3a9e.js β fd9d1056-7caaac656b5ccd86.js} +0 -0
- _next/static/chunks/{framework-2078c65ea7cdfc8a.js β framework-f66176bb897dc684.js} +0 -0
- _next/static/chunks/main-03c24bfcb55bddbe.js +0 -0
- _next/static/chunks/main-app-23c27476be19b2c2.js +0 -1
- _next/static/chunks/main-app-2781f8dc46d71368.js +1 -0
- _next/static/chunks/main-cf1084da7dc80b27.js +0 -0
- _next/static/chunks/pages/_app-6a626577ffa902a4.js +1 -0
- _next/static/chunks/pages/_app-98fafab7f2d09638.js +0 -1
- _next/static/chunks/pages/_error-0dc1e91229abefc4.js +0 -1
- _next/static/chunks/pages/_error-1be831200e60c5c0.js +1 -0
- _next/static/chunks/{webpack-905b1a80c0e778a5.js β webpack-12ca2ea8ed93dae2.js} +1 -1
- _next/static/css/{7f9a00ba16d0880a.css β 25145688737dc9c2.css} +1 -1
- _next/static/{5QDmEoxEwzqpz4kJky5dw β ctxmQKeU5HzCjFRh7FkKs}/_buildManifest.js +1 -1
- _next/static/{5QDmEoxEwzqpz4kJky5dw β ctxmQKeU5HzCjFRh7FkKs}/_ssgManifest.js +0 -0
- icons/android-icon-192x192.png +0 -0
- icons/android-icon-512x512.png +0 -0
- icons/apple-icon-16x16.png +0 -0
- icons/apple-icon-32x32.png +0 -0
- icons/apple-icon.png +0 -0
- icons/react.svg +1 -0
- icons/share.png +0 -0
- icons/{safari-pinned-tab.svg β vercel.svg} +0 -0
- index.html +1 -1
- index.txt +7 -7
- manifest.json +6 -6
- sw.js +1 -1
- workbox-0a19e6a8.js β workbox-f1770938.js +1 -1
404.html
CHANGED
@@ -1 +1 @@
|
|
1 |
-
<!DOCTYPE html><html lang="en"><head><meta charSet="utf-8"/><meta name="viewport" content="width=device-width, initial-scale=1"/><link rel="stylesheet" href="/_next/static/css/7f9a00ba16d0880a.css" data-precedence="next"/><link rel="preload" as="script" fetchPriority="low" href="/_next/static/chunks/webpack-905b1a80c0e778a5.js"/><script src="/_next/static/chunks/4b236691-df73c8aa6aaf3a9e.js" async=""></script><script src="/_next/static/chunks/925-02555f58b42a478a.js" async=""></script><script src="/_next/static/chunks/main-app-23c27476be19b2c2.js" async=""></script><script src="/_next/static/chunks/app/layout-1e509317e28476c4.js" async=""></script><title>404: This page could not be found.</title><title>PhoWhisper using Transformers.js + Next.js</title><meta name="description" content="PhoWhisper: Automatic Speech Recognition for Vietnamese (2024) using Transformer.js + Next.js"/><meta name="application-name" content="PhoWhisper-next"/><link rel="manifest" href="/manifest.json" crossorigin="use-credentials"/><meta name="keywords" content="PhoWhisper,Transformers.js,Next.js,speech-regconition,vietnamese"/><meta name="format-detection" content="telephone=no"/><meta name="apple-mobile-web-app-capable" content="yes"/><meta name="apple-mobile-web-app-title" content="PhoWhisper using Transformers.js + Next.js"/><meta name="apple-mobile-web-app-status-bar-style" content="default"/><meta property="og:title" content="PhoWhisper using Transformers.js + Next.js"/><meta property="og:description" content="PhoWhisper: Automatic Speech Recognition for Vietnamese (2024) using Transformer.js + Next.js"/><meta property="og:url" content="https://hf.co/spaces/huuquyet/PhoWhisper-next/"/><meta property="og:site_name" content="PhoWhisper-next"/><meta property="og:image" content="https://${process.env.vercel_url}/icon/share.png"/><meta property="og:type" content="website"/><meta name="twitter:card" content="summary"/><meta name="twitter:site" content="@HuuQuyetNg"/><meta name="twitter:title" content="PhoWhisper using Transformers.js + Next.js"/><meta name="twitter:description" content="PhoWhisper: Automatic Speech Recognition for Vietnamese (2024) using Transformer.js + Next.js"/><meta name="twitter:image" content="https://${process.env.vercel_url}/icon/share.png"/><script src="/_next/static/chunks/polyfills-78c92fac7aa8fdd8.js" noModule=""></script></head><body><div id="root"><div style="font-family:system-ui,"Segoe UI",Roboto,Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji";height:100vh;text-align:center;display:flex;flex-direction:column;align-items:center;justify-content:center"><div><style>body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}</style><h1 class="next-error-h1" style="display:inline-block;margin:0 20px 0 0;padding:0 23px 0 0;font-size:24px;font-weight:500;vertical-align:top;line-height:49px">404</h1><div style="display:inline-block"><h2 style="font-size:14px;font-weight:400;line-height:49px;margin:0">This page could not be found.</h2></div></div></div></div><script src="/_next/static/chunks/webpack-905b1a80c0e778a5.js" async=""></script><script>(self.__next_f=self.__next_f||[]).push([0]);self.__next_f.push([2,null])</script><script>self.__next_f.push([1,"1:HL[\"/_next/static/css/7f9a00ba16d0880a.css\",\"style\"]\n"])</script><script>self.__next_f.push([1,"2:I[4562,[],\"\"]\n4:I[70,[],\"\"]\n5:I[7046,[],\"\"]\na:I[8543,[\"185\",\"static/chunks/app/layout-1e509317e28476c4.js\"],\"Analytics\"]\nc:I[1676,[],\"\"]\n6:{\"fontFamily\":\"system-ui,\\\"Segoe UI\\\",Roboto,Helvetica,Arial,sans-serif,\\\"Apple Color Emoji\\\",\\\"Segoe UI Emoji\\\"\",\"height\":\"100vh\",\"textAlign\":\"center\",\"display\":\"flex\",\"flexDirection\":\"column\",\"alignItems\":\"center\",\"justifyContent\":\"center\"}\n7:{\"display\":\"inline-block\",\"margin\":\"0 20px 0 0\",\"padding\":\"0 23px 0 0\",\"fontSize\":24,\"fontWeight\":500,\"verticalAlign\":\"top\",\"lineHeight\":\"49px\"}\n8:{\"display\":\"inline-block\"}\n9:{\"fontSize\":14,\"fontWeight\":400,\"lineHeight\":\"49px\",\"margin\":0}\nd:[]\n"])</script><script>self.__next_f.push([1,"0:[[[\"$\",\"link\",\"0\",{\"rel\":\"stylesheet\",\"href\":\"/_next/static/css/7f9a00ba16d0880a.css\",\"precedence\":\"next\",\"crossOrigin\":\"$undefined\"}]],[\"$\",\"$L2\",null,{\"buildId\":\"5QDmEoxEwzqpz4kJky5dw\",\"assetPrefix\":\"\",\"initialCanonicalUrl\":\"/_not-found\",\"initialTree\":[\"\",{\"children\":[\"/_not-found\",{\"children\":[\"__PAGE__\",{}]}]},\"$undefined\",\"$undefined\",true],\"initialSeedData\":[\"\",{\"children\":[\"/_not-found\",{\"children\":[\"__PAGE__\",{},[[\"$L3\",[[\"$\",\"title\",null,{\"children\":\"404: This page could not be found.\"}],[\"$\",\"div\",null,{\"style\":{\"fontFamily\":\"system-ui,\\\"Segoe UI\\\",Roboto,Helvetica,Arial,sans-serif,\\\"Apple Color Emoji\\\",\\\"Segoe UI Emoji\\\"\",\"height\":\"100vh\",\"textAlign\":\"center\",\"display\":\"flex\",\"flexDirection\":\"column\",\"alignItems\":\"center\",\"justifyContent\":\"center\"},\"children\":[\"$\",\"div\",null,{\"children\":[[\"$\",\"style\",null,{\"dangerouslySetInnerHTML\":{\"__html\":\"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}\"}}],[\"$\",\"h1\",null,{\"className\":\"next-error-h1\",\"style\":{\"display\":\"inline-block\",\"margin\":\"0 20px 0 0\",\"padding\":\"0 23px 0 0\",\"fontSize\":24,\"fontWeight\":500,\"verticalAlign\":\"top\",\"lineHeight\":\"49px\"},\"children\":\"404\"}],[\"$\",\"div\",null,{\"style\":{\"display\":\"inline-block\"},\"children\":[\"$\",\"h2\",null,{\"style\":{\"fontSize\":14,\"fontWeight\":400,\"lineHeight\":\"49px\",\"margin\":0},\"children\":\"This page could not be found.\"}]}]]}]}]]],null],null]},[\"$\",\"$L4\",null,{\"parallelRouterKey\":\"children\",\"segmentPath\":[\"children\",\"/_not-found\",\"children\"],\"error\":\"$undefined\",\"errorStyles\":\"$undefined\",\"errorScripts\":\"$undefined\",\"template\":[\"$\",\"$L5\",null,{}],\"templateStyles\":\"$undefined\",\"templateScripts\":\"$undefined\",\"notFound\":\"$undefined\",\"notFoundStyles\":\"$undefined\",\"styles\":null}],null]},[[\"$\",\"html\",null,{\"lang\":\"en\",\"children\":[[\"$\",\"head\",null,{}],[\"$\",\"body\",null,{\"children\":[\"$\",\"div\",null,{\"id\":\"root\",\"children\":[[\"$\",\"$L4\",null,{\"parallelRouterKey\":\"children\",\"segmentPath\":[\"children\"],\"error\":\"$undefined\",\"errorStyles\":\"$undefined\",\"errorScripts\":\"$undefined\",\"template\":[\"$\",\"$L5\",null,{}],\"templateStyles\":\"$undefined\",\"templateScripts\":\"$undefined\",\"notFound\":[[\"$\",\"title\",null,{\"children\":\"404: This page could not be found.\"}],[\"$\",\"div\",null,{\"style\":\"$6\",\"children\":[\"$\",\"div\",null,{\"children\":[[\"$\",\"style\",null,{\"dangerouslySetInnerHTML\":{\"__html\":\"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}\"}}],[\"$\",\"h1\",null,{\"className\":\"next-error-h1\",\"style\":\"$7\",\"children\":\"404\"}],[\"$\",\"div\",null,{\"style\":\"$8\",\"children\":[\"$\",\"h2\",null,{\"style\":\"$9\",\"children\":\"This page could not be found.\"}]}]]}]}]],\"notFoundStyles\":[],\"styles\":null}],[\"$\",\"$La\",null,{}]]}]}]]}],null],null],\"couldBeIntercepted\":false,\"initialHead\":[false,\"$Lb\"],\"globalErrorComponent\":\"$c\",\"missingSlots\":\"$Wd\"}]]\n"])</script><script>self.__next_f.push([1,"b:[[\"$\",\"meta\",\"0\",{\"name\":\"viewport\",\"content\":\"width=device-width, initial-scale=1\"}],[\"$\",\"meta\",\"1\",{\"charSet\":\"utf-8\"}],[\"$\",\"title\",\"2\",{\"children\":\"PhoWhisper using Transformers.js + Next.js\"}],[\"$\",\"meta\",\"3\",{\"name\":\"description\",\"content\":\"PhoWhisper: Automatic Speech Recognition for Vietnamese (2024) using Transformer.js + Next.js\"}],[\"$\",\"meta\",\"4\",{\"name\":\"application-name\",\"content\":\"PhoWhisper-next\"}],[\"$\",\"link\",\"5\",{\"rel\":\"manifest\",\"href\":\"/manifest.json\",\"crossOrigin\":\"use-credentials\"}],[\"$\",\"meta\",\"6\",{\"name\":\"keywords\",\"content\":\"PhoWhisper,Transformers.js,Next.js,speech-regconition,vietnamese\"}],[\"$\",\"meta\",\"7\",{\"name\":\"format-detection\",\"content\":\"telephone=no\"}],[\"$\",\"meta\",\"8\",{\"name\":\"apple-mobile-web-app-capable\",\"content\":\"yes\"}],[\"$\",\"meta\",\"9\",{\"name\":\"apple-mobile-web-app-title\",\"content\":\"PhoWhisper using Transformers.js + Next.js\"}],[\"$\",\"meta\",\"10\",{\"name\":\"apple-mobile-web-app-status-bar-style\",\"content\":\"default\"}],[\"$\",\"meta\",\"11\",{\"property\":\"og:title\",\"content\":\"PhoWhisper using Transformers.js + Next.js\"}],[\"$\",\"meta\",\"12\",{\"property\":\"og:description\",\"content\":\"PhoWhisper: Automatic Speech Recognition for Vietnamese (2024) using Transformer.js + Next.js\"}],[\"$\",\"meta\",\"13\",{\"property\":\"og:url\",\"content\":\"https://hf.co/spaces/huuquyet/PhoWhisper-next/\"}],[\"$\",\"meta\",\"14\",{\"property\":\"og:site_name\",\"content\":\"PhoWhisper-next\"}],[\"$\",\"meta\",\"15\",{\"property\":\"og:image\",\"content\":\"https://${process.env.vercel_url}/icon/share.png\"}],[\"$\",\"meta\",\"16\",{\"property\":\"og:type\",\"content\":\"website\"}],[\"$\",\"meta\",\"17\",{\"name\":\"twitter:card\",\"content\":\"summary\"}],[\"$\",\"meta\",\"18\",{\"name\":\"twitter:site\",\"content\":\"@HuuQuyetNg\"}],[\"$\",\"meta\",\"19\",{\"name\":\"twitter:title\",\"content\":\"PhoWhisper using Transformers.js + Next.js\"}],[\"$\",\"meta\",\"20\",{\"name\":\"twitter:description\",\"content\":\"PhoWhisper: Automatic Speech Recognition for Vietnamese (2024) using Transformer.js + Next.js\"}],[\"$\",\"meta\",\"21\",{\"name\":\"twitter:image\",\"content\":\"https://${process.env.vercel_url}/icon/share.png\"}]]\n3:null\n"])</script></body></html>
|
|
|
1 |
+
<!DOCTYPE html><html lang="en"><head><meta charSet="utf-8"/><meta name="viewport" content="width=device-width, initial-scale=1"/><link rel="stylesheet" href="/_next/static/css/25145688737dc9c2.css" data-precedence="next"/><link rel="preload" as="script" fetchPriority="low" href="/_next/static/chunks/webpack-12ca2ea8ed93dae2.js"/><script src="/_next/static/chunks/fd9d1056-7caaac656b5ccd86.js" async=""></script><script src="/_next/static/chunks/190-a03d46f1813684ea.js" async=""></script><script src="/_next/static/chunks/main-app-2781f8dc46d71368.js" async=""></script><script src="/_next/static/chunks/app/layout-e0223e57eaadc292.js" async=""></script><title>404: This page could not be found.</title><title>PhoWhisper using Transformers.js + Next.js</title><meta name="description" content="PhoWhisper: Automatic Speech Recognition for Vietnamese (2024) using Transformer.js + Next.js"/><meta name="application-name" content="PhoWhisper-next"/><link rel="manifest" href="/manifest.json" crossorigin="use-credentials"/><meta name="keywords" content="PhoWhisper,Transformers.js,Next.js,speech-regconition,vietnamese"/><meta name="format-detection" content="telephone=no"/><meta name="apple-mobile-web-app-capable" content="yes"/><meta name="apple-mobile-web-app-title" content="PhoWhisper using Transformers.js + Next.js"/><meta name="apple-mobile-web-app-status-bar-style" content="default"/><meta property="og:title" content="PhoWhisper using Transformers.js + Next.js"/><meta property="og:description" content="PhoWhisper: Automatic Speech Recognition for Vietnamese (2024) using Transformer.js + Next.js"/><meta property="og:url" content="https://hf.co/spaces/huuquyet/PhoWhisper-next/"/><meta property="og:site_name" content="PhoWhisper-next"/><meta property="og:image" content="https://${process.env.vercel_url}/icons/vercel.svg"/><meta property="og:type" content="website"/><meta name="twitter:card" content="summary"/><meta name="twitter:site" content="@HuuQuyetNg"/><meta name="twitter:title" content="PhoWhisper using Transformers.js + Next.js"/><meta name="twitter:description" content="PhoWhisper: Automatic Speech Recognition for Vietnamese (2024) using Transformer.js + Next.js"/><meta name="twitter:image" content="https://${process.env.vercel_url}/icons/vercel.svg"/><script src="/_next/static/chunks/polyfills-78c92fac7aa8fdd8.js" noModule=""></script></head><body><div id="root"><div style="font-family:system-ui,"Segoe UI",Roboto,Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji";height:100vh;text-align:center;display:flex;flex-direction:column;align-items:center;justify-content:center"><div><style>body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}</style><h1 class="next-error-h1" style="display:inline-block;margin:0 20px 0 0;padding:0 23px 0 0;font-size:24px;font-weight:500;vertical-align:top;line-height:49px">404</h1><div style="display:inline-block"><h2 style="font-size:14px;font-weight:400;line-height:49px;margin:0">This page could not be found.</h2></div></div></div></div><script src="/_next/static/chunks/webpack-12ca2ea8ed93dae2.js" async=""></script><script>(self.__next_f=self.__next_f||[]).push([0]);self.__next_f.push([2,null])</script><script>self.__next_f.push([1,"1:HL[\"/_next/static/css/25145688737dc9c2.css\",\"style\"]\n"])</script><script>self.__next_f.push([1,"2:I[5751,[],\"\"]\n4:I[9275,[],\"\"]\n5:I[1343,[],\"\"]\na:I[1164,[\"185\",\"static/chunks/app/layout-e0223e57eaadc292.js\"],\"Analytics\"]\nc:I[6130,[],\"\"]\n6:{\"fontFamily\":\"system-ui,\\\"Segoe UI\\\",Roboto,Helvetica,Arial,sans-serif,\\\"Apple Color Emoji\\\",\\\"Segoe UI Emoji\\\"\",\"height\":\"100vh\",\"textAlign\":\"center\",\"display\":\"flex\",\"flexDirection\":\"column\",\"alignItems\":\"center\",\"justifyContent\":\"center\"}\n7:{\"display\":\"inline-block\",\"margin\":\"0 20px 0 0\",\"padding\":\"0 23px 0 0\",\"fontSize\":24,\"fontWeight\":500,\"verticalAlign\":\"top\",\"lineHeight\":\"49px\"}\n8:{\"display\":\"inline-block\"}\n9:{\"fontSize\":14,\"fontWeight\":400,\"lineHeight\":\"49px\",\"margin\":0}\nd:[]\n"])</script><script>self.__next_f.push([1,"0:[[[\"$\",\"link\",\"0\",{\"rel\":\"stylesheet\",\"href\":\"/_next/static/css/25145688737dc9c2.css\",\"precedence\":\"next\",\"crossOrigin\":\"$undefined\"}]],[\"$\",\"$L2\",null,{\"buildId\":\"ctxmQKeU5HzCjFRh7FkKs\",\"assetPrefix\":\"\",\"initialCanonicalUrl\":\"/_not-found\",\"initialTree\":[\"\",{\"children\":[\"/_not-found\",{\"children\":[\"__PAGE__\",{}]}]},\"$undefined\",\"$undefined\",true],\"initialSeedData\":[\"\",{\"children\":[\"/_not-found\",{\"children\":[\"__PAGE__\",{},[[\"$L3\",[[\"$\",\"title\",null,{\"children\":\"404: This page could not be found.\"}],[\"$\",\"div\",null,{\"style\":{\"fontFamily\":\"system-ui,\\\"Segoe UI\\\",Roboto,Helvetica,Arial,sans-serif,\\\"Apple Color Emoji\\\",\\\"Segoe UI Emoji\\\"\",\"height\":\"100vh\",\"textAlign\":\"center\",\"display\":\"flex\",\"flexDirection\":\"column\",\"alignItems\":\"center\",\"justifyContent\":\"center\"},\"children\":[\"$\",\"div\",null,{\"children\":[[\"$\",\"style\",null,{\"dangerouslySetInnerHTML\":{\"__html\":\"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}\"}}],[\"$\",\"h1\",null,{\"className\":\"next-error-h1\",\"style\":{\"display\":\"inline-block\",\"margin\":\"0 20px 0 0\",\"padding\":\"0 23px 0 0\",\"fontSize\":24,\"fontWeight\":500,\"verticalAlign\":\"top\",\"lineHeight\":\"49px\"},\"children\":\"404\"}],[\"$\",\"div\",null,{\"style\":{\"display\":\"inline-block\"},\"children\":[\"$\",\"h2\",null,{\"style\":{\"fontSize\":14,\"fontWeight\":400,\"lineHeight\":\"49px\",\"margin\":0},\"children\":\"This page could not be found.\"}]}]]}]}]]],null],null]},[\"$\",\"$L4\",null,{\"parallelRouterKey\":\"children\",\"segmentPath\":[\"children\",\"/_not-found\",\"children\"],\"error\":\"$undefined\",\"errorStyles\":\"$undefined\",\"errorScripts\":\"$undefined\",\"template\":[\"$\",\"$L5\",null,{}],\"templateStyles\":\"$undefined\",\"templateScripts\":\"$undefined\",\"notFound\":\"$undefined\",\"notFoundStyles\":\"$undefined\",\"styles\":null}],null]},[[\"$\",\"html\",null,{\"lang\":\"en\",\"children\":[[\"$\",\"head\",null,{}],[\"$\",\"body\",null,{\"children\":[\"$\",\"div\",null,{\"id\":\"root\",\"children\":[[\"$\",\"$L4\",null,{\"parallelRouterKey\":\"children\",\"segmentPath\":[\"children\"],\"error\":\"$undefined\",\"errorStyles\":\"$undefined\",\"errorScripts\":\"$undefined\",\"template\":[\"$\",\"$L5\",null,{}],\"templateStyles\":\"$undefined\",\"templateScripts\":\"$undefined\",\"notFound\":[[\"$\",\"title\",null,{\"children\":\"404: This page could not be found.\"}],[\"$\",\"div\",null,{\"style\":\"$6\",\"children\":[\"$\",\"div\",null,{\"children\":[[\"$\",\"style\",null,{\"dangerouslySetInnerHTML\":{\"__html\":\"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}\"}}],[\"$\",\"h1\",null,{\"className\":\"next-error-h1\",\"style\":\"$7\",\"children\":\"404\"}],[\"$\",\"div\",null,{\"style\":\"$8\",\"children\":[\"$\",\"h2\",null,{\"style\":\"$9\",\"children\":\"This page could not be found.\"}]}]]}]}]],\"notFoundStyles\":[],\"styles\":null}],[\"$\",\"$La\",null,{}]]}]}]]}],null],null],\"couldBeIntercepted\":false,\"initialHead\":[false,\"$Lb\"],\"globalErrorComponent\":\"$c\",\"missingSlots\":\"$Wd\"}]]\n"])</script><script>self.__next_f.push([1,"b:[[\"$\",\"meta\",\"0\",{\"name\":\"viewport\",\"content\":\"width=device-width, initial-scale=1\"}],[\"$\",\"meta\",\"1\",{\"charSet\":\"utf-8\"}],[\"$\",\"title\",\"2\",{\"children\":\"PhoWhisper using Transformers.js + Next.js\"}],[\"$\",\"meta\",\"3\",{\"name\":\"description\",\"content\":\"PhoWhisper: Automatic Speech Recognition for Vietnamese (2024) using Transformer.js + Next.js\"}],[\"$\",\"meta\",\"4\",{\"name\":\"application-name\",\"content\":\"PhoWhisper-next\"}],[\"$\",\"link\",\"5\",{\"rel\":\"manifest\",\"href\":\"/manifest.json\",\"crossOrigin\":\"use-credentials\"}],[\"$\",\"meta\",\"6\",{\"name\":\"keywords\",\"content\":\"PhoWhisper,Transformers.js,Next.js,speech-regconition,vietnamese\"}],[\"$\",\"meta\",\"7\",{\"name\":\"format-detection\",\"content\":\"telephone=no\"}],[\"$\",\"meta\",\"8\",{\"name\":\"apple-mobile-web-app-capable\",\"content\":\"yes\"}],[\"$\",\"meta\",\"9\",{\"name\":\"apple-mobile-web-app-title\",\"content\":\"PhoWhisper using Transformers.js + Next.js\"}],[\"$\",\"meta\",\"10\",{\"name\":\"apple-mobile-web-app-status-bar-style\",\"content\":\"default\"}],[\"$\",\"meta\",\"11\",{\"property\":\"og:title\",\"content\":\"PhoWhisper using Transformers.js + Next.js\"}],[\"$\",\"meta\",\"12\",{\"property\":\"og:description\",\"content\":\"PhoWhisper: Automatic Speech Recognition for Vietnamese (2024) using Transformer.js + Next.js\"}],[\"$\",\"meta\",\"13\",{\"property\":\"og:url\",\"content\":\"https://hf.co/spaces/huuquyet/PhoWhisper-next/\"}],[\"$\",\"meta\",\"14\",{\"property\":\"og:site_name\",\"content\":\"PhoWhisper-next\"}],[\"$\",\"meta\",\"15\",{\"property\":\"og:image\",\"content\":\"https://${process.env.vercel_url}/icons/vercel.svg\"}],[\"$\",\"meta\",\"16\",{\"property\":\"og:type\",\"content\":\"website\"}],[\"$\",\"meta\",\"17\",{\"name\":\"twitter:card\",\"content\":\"summary\"}],[\"$\",\"meta\",\"18\",{\"name\":\"twitter:site\",\"content\":\"@HuuQuyetNg\"}],[\"$\",\"meta\",\"19\",{\"name\":\"twitter:title\",\"content\":\"PhoWhisper using Transformers.js + Next.js\"}],[\"$\",\"meta\",\"20\",{\"name\":\"twitter:description\",\"content\":\"PhoWhisper: Automatic Speech Recognition for Vietnamese (2024) using Transformer.js + Next.js\"}],[\"$\",\"meta\",\"21\",{\"name\":\"twitter:image\",\"content\":\"https://${process.env.vercel_url}/icons/vercel.svg\"}]]\n3:nu"])</script><script>self.__next_f.push([1,"ll\n"])</script></body></html>
|
README.md
CHANGED
@@ -19,9 +19,10 @@ license: wtfpl
|
|
19 |
short_description: PhoWhisperML-powered speech recognition for Vietnamese
|
20 |
---
|
21 |
|
|
|
22 |
# PhoWhisper Web
|
23 |
|
24 |
-
ML-powered speech recognition for Vietnamese directly in your browser! Built with [π€ Transformers.js](https://github.com/xenova/transformers.js) + Next.js.
|
25 |
|
26 |
Using [π€ PhoWhisper](https://github.com/VinAIResearch/PhoWhisper) models:
|
27 |
- [PhoWhisper-tiny](https://hf.co/vinai/PhoWhisper-tiny/) converted to [ONNX model](https://hf.co/huuquyet/PhoWhisper-tiny)
|
@@ -30,28 +31,41 @@ Using [π€ PhoWhisper](https://github.com/VinAIResearch/PhoWhisper) models:
|
|
30 |
- [PhoWhisper-medium](https://hf.co/vinai/PhoWhisper-medium/) converted to [ONNX model](https://hf.co/huuquyet/PhoWhisper-medium)
|
31 |
- [PhoWhisper-large](https://hf.co/vinai/PhoWhisper-large/) converted to [ONNX model](https://hf.co/huuquyet/PhoWhisper-large)
|
32 |
|
33 |
-
|
34 |
-
|
35 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
36 |
|
37 |
https://github.com/xenova/whisper-web/assets/26504141/fb170d84-9678-41b5-9248-a112ecc74c27
|
38 |
|
39 |
## Running locally
|
40 |
|
41 |
-
1. Clone the repo and install dependencies:
|
42 |
|
43 |
-
|
44 |
-
|
45 |
-
|
46 |
-
|
47 |
-
|
48 |
|
49 |
2. Run the development server:
|
50 |
|
51 |
-
|
52 |
-
|
53 |
-
|
54 |
-
|
55 |
-
|
|
|
|
|
|
|
|
|
56 |
|
57 |
-
|
|
|
|
|
|
|
|
19 |
short_description: PhoWhisperML-powered speech recognition for Vietnamese
|
20 |
---
|
21 |
|
22 |
+
|
23 |
# PhoWhisper Web
|
24 |
|
25 |
+
ML-powered speech recognition for Vietnamese directly in your browser! Built with [π€ Transformers.js](https://github.com/xenova/transformers.js) + [Next.js](https://nextjs.org/).
|
26 |
|
27 |
Using [π€ PhoWhisper](https://github.com/VinAIResearch/PhoWhisper) models:
|
28 |
- [PhoWhisper-tiny](https://hf.co/vinai/PhoWhisper-tiny/) converted to [ONNX model](https://hf.co/huuquyet/PhoWhisper-tiny)
|
|
|
31 |
- [PhoWhisper-medium](https://hf.co/vinai/PhoWhisper-medium/) converted to [ONNX model](https://hf.co/huuquyet/PhoWhisper-medium)
|
32 |
- [PhoWhisper-large](https://hf.co/vinai/PhoWhisper-large/) converted to [ONNX model](https://hf.co/huuquyet/PhoWhisper-large)
|
33 |
|
34 |
+
Check out the demo sites:
|
35 |
+
<a href="https://huggingface.co/spaces/huuquyet/PhoWhisper-next">
|
36 |
+
<picture>
|
37 |
+
<source srcset="https://huggingface.co/datasets/huggingface/badges/resolve/main/open-in-hf-spaces-sm.svg" media="(prefers-color-scheme: light), (prefers-color-scheme: no-preference)">
|
38 |
+
<source srcset="https://huggingface.co/datasets/huggingface/badges/resolve/main/open-in-hf-spaces-sm-dark.svg" media="(prefers-color-scheme: dark)">
|
39 |
+
<img src="https://huggingface.co/datasets/huggingface/badges/resolve/main/open-in-hf-spaces-sm.svg" alt="Open in Spaces">
|
40 |
+
</picture>
|
41 |
+
</a>
|
42 |
+
or [Vercel app](https://pho-whisper-next.vercel.app/).
|
43 |
|
44 |
https://github.com/xenova/whisper-web/assets/26504141/fb170d84-9678-41b5-9248-a112ecc74c27
|
45 |
|
46 |
## Running locally
|
47 |
|
48 |
+
1. Clone the repo and install dependencies with [bun](https://bun.sh):
|
49 |
|
50 |
+
```bash
|
51 |
+
git clone https://github.com/huuquyet/PhoWhisper-next.git
|
52 |
+
cd PhoWhisper-next
|
53 |
+
bun install
|
54 |
+
```
|
55 |
|
56 |
2. Run the development server:
|
57 |
|
58 |
+
```bash
|
59 |
+
bun dev
|
60 |
+
```
|
61 |
+
> Firefox users need to change the `dom.workers.modules.enabled` setting in `about:config` to `true` to enable Web Workers.
|
62 |
+
> Check out [this issue](https://github.com/xenova/whisper-web/issues/8) for more details.
|
63 |
+
|
64 |
+
3. Open the link (e.g., [http://localhost:3000/](http://localhost:3000/)) in your browser.
|
65 |
+
|
66 |
+
## Acknowledgement
|
67 |
|
68 |
+
- [Whisper-web](https://github.com/xenova/whisper-web)
|
69 |
+
- [PhoWhisper](https://github.com/VinAIResearch/PhoWhisper)
|
70 |
+
- [Transformers.js](https://github.com/xenova/transformers.js)
|
71 |
+
- [Next.js](https://nextjs.org)
|
_next/static/chunks/190-a03d46f1813684ea.js
ADDED
The diff for this file is too large to render.
See raw diff
|
|
_next/static/chunks/251.b8ce00a7f6eefa34.js
ADDED
@@ -0,0 +1 @@
|
|
|
|
|
1 |
+
!function(){var t,e,n,i,o,s,r,a,u={495:function(){},7147:function(){},1418:function(){},8741:function(){},8386:function(){},3342:function(){},1969:function(t,e,n){"use strict";var i=n(7431),o=n(9078);o.OBj.allowLocalModels=!1;class s{static async getInstance(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;return null===this.instance&&(this.instance=(0,o.EUT)(this.task,this.model,{quantized:this.quantized,progress_callback:t,revision:this.model.includes("/whisper-medium")?"no_attentions":"main"})),this.instance}constructor(t,e,n){this.tokenizer=t,this.model=e,this.quantized=n}}(0,i._)(s,"task",null),(0,i._)(s,"model",null),(0,i._)(s,"quantized",null),(0,i._)(s,"instance",null),self.addEventListener("message",async t=>{let e=t.data,n=await a(e.audio,e.model,e.multilingual,e.quantized,e.subtask,e.language);null!==n&&self.postMessage({status:"complete",task:"automatic-speech-recognition",data:n})});class r extends s{}(0,i._)(r,"task","automatic-speech-recognition"),(0,i._)(r,"model",null),(0,i._)(r,"quantized",null);let a=async(t,e,n,i,o,s)=>{let a=e.startsWith("distil-whisper/")||e.startsWith("huuquyet"),u=e;a||n||(u+=".en"),(r.model!==u||r.quantized!==i)&&(r.model=u,r.quantized=i,null!==r.instance&&((await r.getInstance()).dispose(),r.instance=null));let c=await r.getInstance(t=>{self.postMessage(t)}),l=c.processor.feature_extractor.config.chunk_length/c.model.config.max_source_positions,f=[{tokens:[],finalised:!1}];return await c(t,{top_k:0,do_sample:!1,chunk_length_s:a?20:30,stride_length_s:a?3:5,language:s,task:o,return_timestamps:!0,force_full_sequences:!1,callback_function:function(t){f[f.length-1].tokens=[...t[0].output_token_ids];let e=c.tokenizer._decode_asr(f,{time_precision:l,return_timestamps:!0,force_full_sequences:!1});self.postMessage({status:"update",task:"automatic-speech-recognition",data:e})},chunk_callback:function(t){let e=f[f.length-1];Object.assign(e,t),e.finalised=!0,t.is_last||f.push({tokens:[],finalised:!1})}}).catch(t=>(self.postMessage({status:"error",task:"automatic-speech-recognition",data:t}),null))}}},c={};function l(t){var e=c[t];if(void 0!==e)return e.exports;var n=c[t]={exports:{}},i=!0;try{u[t](n,n.exports,l),i=!1}finally{i&&delete c[t]}return n.exports}l.m=u,l.x=function(){var t=l.O(void 0,[165,132,193,72,360],function(){return l(1969)});return l.O(t)},t=[],l.O=function(e,n,i,o){if(n){o=o||0;for(var s=t.length;s>0&&t[s-1][2]>o;s--)t[s]=t[s-1];t[s]=[n,i,o];return}for(var r=1/0,s=0;s<t.length;s++){for(var n=t[s][0],i=t[s][1],o=t[s][2],a=!0,u=0;u<n.length;u++)r>=o&&Object.keys(l.O).every(function(t){return l.O[t](n[u])})?n.splice(u--,1):(a=!1,o<r&&(r=o));if(a){t.splice(s--,1);var c=i();void 0!==c&&(e=c)}}return e},n=Object.getPrototypeOf?function(t){return Object.getPrototypeOf(t)}:function(t){return t.__proto__},l.t=function(t,i){if(1&i&&(t=this(t)),8&i||"object"==typeof t&&t&&(4&i&&t.__esModule||16&i&&"function"==typeof t.then))return t;var o=Object.create(null);l.r(o);var s={};e=e||[null,n({}),n([]),n(n)];for(var r=2&i&&t;"object"==typeof r&&!~e.indexOf(r);r=n(r))Object.getOwnPropertyNames(r).forEach(function(e){s[e]=function(){return t[e]}});return s.default=function(){return t},l.d(o,s),o},l.d=function(t,e){for(var n in e)l.o(e,n)&&!l.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},l.f={},l.e=function(t){return Promise.all(Object.keys(l.f).reduce(function(e,n){return l.f[n](t,e),e},[]))},l.u=function(t){return 72===t?"static/chunks/72-b9a6a0da3e447ebd.js":"static/chunks/"+(({132:"6139e184",165:"590caa2a",193:"50bd76a3"})[t]||t)+"."+({132:"f5956607c9895a14",165:"be5af588047a1c85",193:"3d24d573e3ca7a71",360:"47885073fb31529e"})[t]+".js"},l.miniCssF=function(t){},l.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||Function("return this")()}catch(t){if("object"==typeof window)return window}}(),l.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},l.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},l.tt=function(){return void 0===i&&(i={createScriptURL:function(t){return t}},"undefined"!=typeof trustedTypes&&trustedTypes.createPolicy&&(i=trustedTypes.createPolicy("nextjs#bundler",i))),i},l.tu=function(t){return l.tt().createScriptURL(t)},l.p="/_next/",o={251:1},l.f.i=function(t,e){o[t]||importScripts(l.tu(l.p+l.u(t)))},r=(s=self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push.bind(s),s.push=function(t){var e=t[0],n=t[1],i=t[2];for(var s in n)l.o(n,s)&&(l.m[s]=n[s]);for(i&&i(l);e.length;)o[e.pop()]=1;r(t)},a=l.x,l.x=function(){return Promise.all([165,132,193,72,360].map(l.e,l)).then(a)},_N_E=l.x()}();
|
_next/static/chunks/266d6a74.21fca583acb189b2.js
DELETED
@@ -1 +0,0 @@
|
|
1 |
-
"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[897],{6463:function(e,s,t){t.d(s,{$Bv:function(){return ia},$Sz:function(){return a2},DcG:function(){return ic},ENH:function(){return ir},En$:function(){return is},Hqk:function(){return a7},IFL:function(){return iu},K2m:function(){return il},Kf0:function(){return a4},LdW:function(){return io},OjJ:function(){return a1},S2d:function(){return id},U$$:function(){return it},Zn:function(){return ii},hY6:function(){return i_},hZO:function(){return a3},lbf:function(){return a5},o$X:function(){return a0},t78:function(){return a8},tLj:function(){return ie},wiU:function(){return a9},z6E:function(){return a6}});var n=t(4090),a=t(7179),i=t(2179),o=t(2806),r=t(2755),l=t(9448),c=t(7215);let{InferenceSession:d,Tensor:_,env:u}=l.ONNX,h={EncoderOnly:0,EncoderDecoder:1,Seq2Seq:2,Vision2Seq:3,DecoderOnly:4,MaskGeneration:5},m=new Map,p=new Map,f=new Map;async function g(e,s,t){let n=`onnx/${s}${t.quantized?"_quantized":""}.onnx`,a=await (0,i.st)(e,n,!0,t);try{return await d.create(a,{executionProviders:l.p})}catch(e){if(1===l.p.length&&"wasm"===l.p[0])throw e;return console.warn(e),console.warn("Something went wrong during model construction (most likely a missing operation). Using `wasm` as a fallback. "),await d.create(a,{executionProviders:["wasm"]})}}async function w(e,s){let t=function(e,s){let t=Object.create(null),n=[];for(let a of e.inputNames){let e=s[a];if(!(e instanceof r.es)){n.push(a);continue}t[a]=u.wasm.proxy?e.clone():e}if(n.length>0)throw Error(`An error occurred during model execution: "Missing the following inputs: ${n.join(", ")}.`);let a=Object.keys(s).length,i=e.inputNames.length;if(a>i){let t=Object.keys(s).filter(s=>!e.inputNames.includes(s));console.warn(`WARNING: Too many inputs were provided (${a} > ${i}). The following inputs will be ignored: "${t.join(", ")}".`)}return t}(e,s);try{let s=await e.run(t);return s=function e(s){for(let t in s)s[t]instanceof _?s[t]=new r.es(s[t]):"object"==typeof s[t]&&e(s[t]);return s}(s)}catch(e){throw console.error(`An error occurred during model execution: "${e}".`),console.error("Inputs given to model:",t),e}}function x(e,s){let t=e.config.pad_token_id??null,n=e.config.eos_token_id??null;(0,a.Wy)(n)&&(n=[n]);let i=-1!==s.indexOf(t),o=null===n||!n.includes(t);if(!i||!o)return(0,r.r6)(s);{let e=BigInt64Array.from(s.data.map(e=>e!=t));return new r.es("int64",e,s.dims)}}function y(e,s,t){if(!e.inputNames.includes("position_ids"))return;let n=new BigInt64Array(s.attention_mask.data.length);for(let e=0;e<s.attention_mask.dims[0];++e){let t=e*s.attention_mask.dims[1],a=BigInt(0);for(let e=0;e<s.attention_mask.dims[1];++e){let i=t+e;0n===s.attention_mask.data[i]?n[i]=BigInt(1):(n[i]=a,a+=s.attention_mask.data[i])}}s.position_ids=new r.es("int64",n,s.attention_mask.dims),t&&(s.position_ids=s.position_ids.slice(null,-1).unsqueeze_(-1))}function M(e){return new r.es("bool",[e],[1])}async function k(e,s){let{encoder_outputs:t,past_key_values:n}=s;t||(t=(await C(e,s)).last_hidden_state);let a={input_ids:s.decoder_input_ids,encoder_hidden_states:t},i=!!n;e.decoder_merged_session.inputNames.includes("use_cache_branch")&&(a.use_cache_branch=M(i)),e.decoder_merged_session.inputNames.includes("encoder_attention_mask")&&(a.encoder_attention_mask=s.attention_mask),y(e.decoder_merged_session,a,i),e.addPastKeyValues(a,n);let o=await w(e.decoder_merged_session,a);return new ih({logits:o.logits,past_key_values:n=e.getPastKeyValues(o,n),encoder_outputs:t,...e.getAttentions(o)})}function b(e,s,t,n){let a=[],i=0,o=e.requires_attention_mask??!0,l=t.decoder_input_ids??t.decoder_start_token_id??t.bos_token_id??t.eos_token_id;for(let t of(l instanceof r.es?l=l.tolist().flat():Array.isArray(l)||(l=[l]),s)){t.dims=[1,...t.dims];let s={inputs:t,encoder_outputs:null,prev_model_outputs:null,output_token_ids:l,done:!1,score:0,id:i++};o&&(s.attention_mask=x(e,t)),a.push(s)}return a}async function v(e,s){let t=e.main_input_name,n=s.output_token_ids;s.prev_model_outputs&&(n=n.slice(-1));let a={[t]:s.inputs,decoder_input_ids:function(e){if(e instanceof r.es)return e;if(0===e.length)throw Error("items must be non-empty");if(!Array.isArray(e[0]))return new r.es("int64",BigInt64Array.from(e.map(e=>BigInt(e))),[1,e.length]);if(e.some(s=>s.length!==e[0].length))throw Error("Unable to create tensor, you should probably activate truncation and/or padding with 'padding=True' and/or 'truncation=True' to have batched tensors with the same length.");return new r.es("int64",BigInt64Array.from(e.flat().map(e=>BigInt(e))),[e.length,e[0].length])}(n),encoder_outputs:s.encoder_outputs,past_key_values:s.prev_model_outputs?.past_key_values};s.attention_mask&&(a.attention_mask=s.attention_mask);let i=await e.forward(a);return s.prev_model_outputs=i,s.encoder_outputs=i.encoder_outputs,i}function S(e,s){e.output_token_ids=[...e.output_token_ids,s]}async function C(e,s){let t=Object.create(null);for(let n of e.session.inputNames)t[n]=s[n];return e.session.inputNames.includes("token_type_ids")&&!t.token_type_ids&&(t.token_type_ids=new r.es("int64",new BigInt64Array(t.input_ids.data.length),t.input_ids.dims)),await w(e.session,t)}async function F(e,s){let{input_ids:t,past_key_values:n,attention_mask:a}=s,i={input_ids:t,attention_mask:a??x(e,t)},o=!!n;e.session.inputNames.includes("use_cache_branch")&&(i.use_cache_branch=M(o)),y(e.session,i,o),e.addPastKeyValues(i,n);let r=await w(e.session,i);return{logits:r.logits,past_key_values:n=e.getPastKeyValues(r,n)}}function L(e,s,t,n,a){let i=[],o=0;for(let t of s){let s,r=t.tolist().map(Number);t.dims=[1,...t.dims],a?(s=a[o]).dims=[1,...s.dims]:s=x(e,t);let l={input:t,model_input_ids:t,attention_mask:s,prev_model_outputs:null,output_token_ids:r,num_output_tokens:n,done:!1,score:0,id:o++};i.push(l)}return i}async function A(e,s){let t=new BigInt64Array(s.output_token_ids.length).fill(1n),n={input_ids:s.model_input_ids,attention_mask:new r.es("int64",t,[1,t.length]),past_key_values:s.prev_model_outputs?.past_key_values},a=await e.forward(n);return s.prev_model_outputs=a,a}function P(e,s){e.output_token_ids=[...e.output_token_ids,s],e.model_input_ids=new r.es("int64",[BigInt(s)],[1,1])}class E extends a.Ag{main_input_name="input_ids";constructor(e,s){super(),this.config=e,this.session=s;let t=f.get(this.constructor),n=m.get(t);this.can_generate=!1,this._runBeam=null,this._getStartBeams=null,this._updateBeam=null,this._forward=null,n===h.DecoderOnly?(this.can_generate=!0,this._runBeam=A,this._getStartBeams=L,this._updateBeam=P,this._forward=F):n===h.Seq2Seq||n===h.Vision2Seq?(this.can_generate=!0,this._runBeam=v,this._getStartBeams=b,this._updateBeam=S,this._forward=k):(h.EncoderDecoder,this._forward=C)}async dispose(){let e=[];for(let s of Object.keys(this)){let t=this[s];t instanceof d&&e.push(t.handler.dispose())}return await Promise.all(e)}static async from_pretrained(e,{quantized:s=!0,progress_callback:t=null,config:a=null,cache_dir:o=null,local_files_only:r=!1,revision:l="main",model_file_name:c=null}={}){let d,_={quantized:s,progress_callback:t,config:a,cache_dir:o,local_files_only:r,revision:l,model_file_name:c},u=f.get(this),p=m.get(u);return p===h.DecoderOnly?d=await Promise.all([n.z.from_pretrained(e,_),g(e,_.model_file_name??"decoder_model_merged",_),(0,i.yM)(e,"generation_config.json",!1,_)]):p===h.Seq2Seq||p===h.Vision2Seq?d=await Promise.all([n.z.from_pretrained(e,_),g(e,"encoder_model",_),g(e,"decoder_model_merged",_),(0,i.yM)(e,"generation_config.json",!1,_)]):p===h.MaskGeneration?d=await Promise.all([n.z.from_pretrained(e,_),g(e,"vision_encoder",_),g(e,"prompt_encoder_mask_decoder",_)]):p===h.EncoderDecoder?d=await Promise.all([n.z.from_pretrained(e,_),g(e,"encoder_model",_),g(e,"decoder_model_merged",_)]):(p!==h.EncoderOnly&&console.warn(`Model type for '${u??a?.model_type}' not found, assuming encoder-only architecture. Please report this at https://github.com/xenova/transformers.js/issues/new/choose.`),d=await Promise.all([n.z.from_pretrained(e,_),g(e,_.model_file_name??"model",_)])),new this(...d)}async _call(e){return await this.forward(e)}async forward(e){return await this._forward(this,e)}_get_logits_processor(e,s,t=null){let n=new o.Jm;if(null!==e.repetition_penalty&&1!==e.repetition_penalty&&n.push(new o.Jj(e.repetition_penalty)),null!==e.no_repeat_ngram_size&&e.no_repeat_ngram_size>0&&n.push(new o.jF(e.no_repeat_ngram_size)),null!==e.bad_words_ids&&n.push(new o.AE(e.bad_words_ids,e.eos_token_id)),null!==e.min_length&&null!==e.eos_token_id&&e.min_length>0&&n.push(new o.ez(e.min_length,e.eos_token_id)),null!==e.min_new_tokens&&null!==e.eos_token_id&&e.min_new_tokens>0&&n.push(new o.CJ(s,e.min_new_tokens,e.eos_token_id)),null!==e.forced_bos_token_id&&n.push(new o.C9(e.forced_bos_token_id)),null!==e.forced_eos_token_id&&n.push(new o.dZ(e.max_length,e.forced_eos_token_id)),null!==e.begin_suppress_tokens){let t=s>1||null===e.forced_bos_token_id?s:s+1;null!==e.forced_decoder_ids&&(t+=e.forced_decoder_ids[e.forced_decoder_ids.length-1][0]),n.push(new o.GU(e.begin_suppress_tokens,t))}return null!==e.forced_decoder_ids&&n.push(new o.E(e.forced_decoder_ids)),null!==t&&n.extend(t),n}_get_generation_config(e){let s=new o.aP(this.config);return"generation_config"in this&&Object.assign(s,this.generation_config),null!==e&&Object.assign(s,e),s}async generate(e,s=null,t=null,{inputs_attention_mask:n=null}={}){let i;if(!this.can_generate){let e=f.get(this.constructor),s=`The current model class (${e}) is not compatible with \`.generate()\`, as it doesn't have a language model head.`,t=this.config.model_type,n=aT.get(t)??aB.get(t)??aL.get(t)??aq.get(t);throw n&&(s+=` Please use the following class instead: '${n[0]}'`),Error(s)}if(!(e instanceof r.es)&&!(0,a.fU)(e)&&!Array.isArray(e))throw Error(`\`inputs\` must be a Tensor, TypedArray, or Array, but is "${e.constructor.name}".`);if(this.config.is_encoder_decoder)i=0;else if(0===(i=e instanceof r.es?e.dims.at(-1):e.length))throw Error("Must supply a non-empty array of input token ids.");s=this._get_generation_config(s),t=t??new o.Jm,t=this._get_logits_processor(s,i,t);let l=s.eos_token_id;null===l||Array.isArray(l)||(l=[l]);let c=1,d=1+(s.max_new_tokens??1/0),_=Number.isInteger(s.max_length)&&(s.max_new_tokens??null)===null,u=o.Z4.getSampler(s),h=this.getStartBeams(e,s,c,n);for(;h.some(e=>!e.done)&&c<d;){let e=[];for(let n of h){if(n.done){e.push(n);continue}if(_&&n.output_token_ids.length>=s.max_length){n.done=!0,e.push(n);continue}let a=await this.runBeam(n);s.output_attentions&&this.addAttentionsToBeam(n,a),s.output_scores;let i=a.logits.slice(null,-1,null);for(let[s,a]of(t(n.output_token_ids,i),u(i))){let t={...n};this.updateBeam(t,s),t.score+=a,l&&l.includes(s)&&(t.done=!0),e.push(t)}}++c,h=(e=this.groupBeams(e).map(e=>e.sort((e,s)=>s.score-e.score).slice(0,s.num_beams))).flat(),s.callback_function&&s.callback_function(h)}let m=this.groupBeams(h),p=e=>m.map(t=>s.num_return_sequences>1?t.slice(0,s.num_return_sequences).map(s=>s[e]):[t[0][e]]).flat(),g=p("output_token_ids");return s.return_dict_in_generate?{sequences:g,decoder_attentions:p("decoder_attentions"),cross_attentions:p("cross_attentions")}:g}addAttentionsToBeam(e,s){if(this.config.is_encoder_decoder){if(!s.cross_attentions||0===s.cross_attentions.length)throw Error("`output_attentions` is true, but the model did not produce cross-attentions. This is most likely because the model was not exported with `output_attentions=True`.");e.cross_attentions||(e.cross_attentions=[]),e.cross_attentions.push(s.cross_attentions)}if(!s.decoder_attentions||0===s.decoder_attentions.length)throw Error("`output_attentions` is true, but the model did not produce decoder-attentions. This is most likely because the model was not exported with `output_attentions=True`.");e.decoder_attentions||(e.decoder_attentions=[]),e.decoder_attentions.push(s.decoder_attentions)}groupBeams(e){let s=Object.create(null);for(let t of e)void 0===s[t.id]?s[t.id]=[t]:s[t.id].push(t);return Object.values(s)}getPastKeyValues(e,s){let t=Object.create(null);for(let n in e)if(n.startsWith("present")){let a=n.replace("present","past_key_values");s&&n.includes("encoder")?t[a]=s[a]:t[a]=e[n]}return t}getAttentions(e){let s=Object.create(null);for(let t of["cross_attentions","decoder_attentions"]){let n=[];for(let s in e)s.startsWith(t)&&(n[s.split(".").pop()]=e[s]);s[t]=n}return s}addPastKeyValues(e,s){if(s)Object.assign(e,s);else if(this.config.is_encoder_decoder&&(this.add_encoder_pkv??!0)){let s=[1,this.num_encoder_heads,0,this.encoder_dim_kv],t=[1,this.num_decoder_heads,0,this.decoder_dim_kv];for(let n=0;n<this.num_decoder_layers;++n)e[`past_key_values.${n}.encoder.key`]=new r.es("float32",[],s),e[`past_key_values.${n}.encoder.value`]=new r.es("float32",[],s),e[`past_key_values.${n}.decoder.key`]=new r.es("float32",[],t),e[`past_key_values.${n}.decoder.value`]=new r.es("float32",[],t)}else if("falcon"===this.config.model_type){let s=[1*this.num_heads,0,this.dim_kv];for(let t=0;t<this.num_layers;++t)e[`past_key_values.${t}.key`]=new r.es("float32",[],s),e[`past_key_values.${t}.value`]=new r.es("float32",[],s)}else if(this.config.multi_query){let s=[1*this.num_heads,0,2*this.dim_kv];for(let t=0;t<this.num_layers;++t)e[`past_key_values.${t}.key_value`]=new r.es("float32",[],s)}else if("bloom"===this.config.model_type){let s=[1*this.num_heads,this.dim_kv,0],t=[1*this.num_heads,0,this.dim_kv];for(let n=0;n<this.num_layers;++n)e[`past_key_values.${n}.key`]=new r.es("float32",[],s),e[`past_key_values.${n}.value`]=new r.es("float32",[],t)}else{let s=[1,this.num_heads,0,this.dim_kv];for(let t=0;t<this.num_layers;++t)e[`past_key_values.${t}.key`]=new r.es("float32",[],s),e[`past_key_values.${t}.value`]=new r.es("float32",[],s)}}getStartBeams(e,s,t,n){return this._getStartBeams(this,e,s,t,n)}async runBeam(e){return await this._runBeam(this,e)}updateBeam(e,s){return this._updateBeam(e,s)}}class O{}class B extends E{}class T extends B{}class D extends B{async _call(e){return new iw(await super._call(e))}}class I extends B{async _call(e){return new im(await super._call(e))}}class q extends B{async _call(e){return new ig(await super._call(e))}}class N extends B{async _call(e){return new ix(await super._call(e))}}class G extends E{}class V extends G{}class z extends E{}class j extends z{}class $ extends z{async _call(e){return new iw(await super._call(e))}}class W extends z{async _call(e){return new im(await super._call(e))}}class R extends z{async _call(e){return new ig(await super._call(e))}}class Q extends z{async _call(e){return new ix(await super._call(e))}}class U extends E{}class X extends U{}class K extends U{async _call(e){return new iw(await super._call(e))}}class H extends U{async _call(e){return new im(await super._call(e))}}class J extends U{async _call(e){return new ig(await super._call(e))}}class Z extends U{async _call(e){return new ix(await super._call(e))}}class Y extends E{}class ee extends Y{}class es extends Y{async _call(e){return new iw(await super._call(e))}}class et extends Y{async _call(e){return new im(await super._call(e))}}class en extends Y{async _call(e){return new ig(await super._call(e))}}class ea extends Y{async _call(e){return new ix(await super._call(e))}}class ei extends E{}class eo extends ei{}class er extends ei{async _call(e){return new iw(await super._call(e))}}class el extends ei{async _call(e){return new im(await super._call(e))}}class ec extends ei{async _call(e){return new ig(await super._call(e))}}class ed extends ei{async _call(e){return new ix(await super._call(e))}}class e_ extends E{}class eu extends e_{}class eh extends e_{async _call(e){return new iw(await super._call(e))}}class em extends e_{async _call(e){return new im(await super._call(e))}}class ep extends e_{async _call(e){return new ig(await super._call(e))}}class ef extends e_{async _call(e){return new ix(await super._call(e))}}class eg extends E{}class ew extends eg{}class ex extends eg{async _call(e){return new iw(await super._call(e))}}class ey extends eg{async _call(e){return new im(await super._call(e))}}class eM extends eg{async _call(e){return new ig(await super._call(e))}}class ek extends eg{async _call(e){return new ix(await super._call(e))}}class eb extends E{}class ev extends eb{}class eS extends eb{async _call(e){return new im(await super._call(e))}}class eC extends eb{async _call(e){return new ig(await super._call(e))}}class eF extends eb{async _call(e){return new ix(await super._call(e))}}class eL extends eb{async _call(e){return new iw(await super._call(e))}}class eA extends E{}class eP extends eA{}class eE extends eA{async _call(e){return new iw(await super._call(e))}}class eO extends eA{async _call(e){return new im(await super._call(e))}}class eB extends eA{async _call(e){return new ig(await super._call(e))}}class eT extends E{}class eD extends eT{}class eI extends eT{async _call(e){return new iw(await super._call(e))}}class eq extends eT{async _call(e){return new im(await super._call(e))}}class eN extends eT{async _call(e){return new ix(await super._call(e))}}class eG extends E{}class eV extends eG{}class ez extends eG{async _call(e){return new iw(await super._call(e))}}class ej extends eG{async _call(e){return new im(await super._call(e))}}class e$ extends eG{async _call(e){return new ig(await super._call(e))}}class eW extends eG{async _call(e){return new ix(await super._call(e))}}class eR extends E{}class eQ extends eR{}class eU extends eR{async _call(e){return new iw(await super._call(e))}}class eX extends eR{async _call(e){return new im(await super._call(e))}}class eK extends eR{async _call(e){return new ix(await super._call(e))}}class eH extends E{}class eJ extends eH{}class eZ extends eH{async _call(e){return new im(await super._call(e))}}class eY extends eH{async _call(e){return new ix(await super._call(e))}}class e2 extends eH{async _call(e){return new iw(await super._call(e))}}class e0 extends E{}class e1 extends e0{}class e4 extends e0{constructor(e,s,t,n){super(e,s),this.decoder_merged_session=t,this.generation_config=n,this.num_decoder_layers=this.config.num_decoder_layers,this.num_decoder_heads=this.config.num_heads,this.decoder_dim_kv=this.config.d_kv,this.num_encoder_layers=this.config.num_layers,this.num_encoder_heads=this.config.num_heads,this.encoder_dim_kv=this.config.d_kv}}class e3 extends E{}class e5 extends e3{}class e6 extends e3{constructor(e,s,t,n){super(e,s),this.decoder_merged_session=t,this.generation_config=n,this.num_decoder_layers=this.config.num_decoder_layers,this.num_decoder_heads=this.config.num_heads,this.decoder_dim_kv=this.config.d_kv,this.num_encoder_layers=this.config.num_layers,this.num_encoder_heads=this.config.num_heads,this.encoder_dim_kv=this.config.d_kv}}class e7 extends E{}class e8 extends e7{}class e9 extends e7{constructor(e,s,t,n){super(e,s),this.decoder_merged_session=t,this.generation_config=n,this.num_decoder_layers=this.config.num_decoder_layers,this.num_decoder_heads=this.config.num_heads,this.decoder_dim_kv=this.config.d_kv,this.num_encoder_layers=this.config.num_layers,this.num_encoder_heads=this.config.num_heads,this.encoder_dim_kv=this.config.d_kv}}class se extends E{}class ss extends se{}class st extends se{constructor(e,s,t,n){super(e,s),this.decoder_merged_session=t,this.generation_config=n,this.num_decoder_layers=this.config.decoder_layers,this.num_decoder_heads=this.config.decoder_attention_heads,this.decoder_dim_kv=this.config.d_model/this.num_decoder_heads,this.num_encoder_layers=this.config.encoder_layers,this.num_encoder_heads=this.config.encoder_attention_heads,this.encoder_dim_kv=this.config.d_model/this.num_encoder_heads}}class sn extends se{async _call(e){return new im(await super._call(e))}}class sa extends E{}class si extends sa{}class so extends sa{constructor(e,s,t,n){super(e,s),this.decoder_merged_session=t,this.generation_config=n,this.num_decoder_layers=this.config.decoder_layers,this.num_decoder_heads=this.config.decoder_attention_heads,this.decoder_dim_kv=this.config.d_model/this.num_decoder_heads,this.num_encoder_layers=this.config.encoder_layers,this.num_encoder_heads=this.config.encoder_attention_heads,this.encoder_dim_kv=this.config.d_model/this.num_encoder_heads}}class sr extends sa{async _call(e){return new im(await super._call(e))}}class sl extends sa{constructor(e,s,t){super(e,s),this.generation_config=t,this.num_decoder_layers=this.config.decoder_layers,this.num_decoder_heads=this.config.decoder_attention_heads,this.decoder_dim_kv=this.config.d_model/this.num_decoder_heads,this.num_encoder_layers=this.config.encoder_layers,this.num_encoder_heads=this.config.encoder_attention_heads,this.encoder_dim_kv=this.config.d_model/this.num_encoder_heads}}class sc extends E{}class sd extends sc{}class s_ extends sc{constructor(e,s,t,n){super(e,s),this.decoder_merged_session=t,this.generation_config=n,this.num_decoder_layers=this.config.decoder_layers,this.num_decoder_heads=this.config.decoder_attention_heads,this.decoder_dim_kv=this.config.d_model/this.num_decoder_heads,this.num_encoder_layers=this.config.encoder_layers,this.num_encoder_heads=this.config.encoder_attention_heads,this.encoder_dim_kv=this.config.d_model/this.num_encoder_heads}}class su extends E{}class sh extends su{}class sm extends su{constructor(e,s,t,n){super(e,s),this.decoder_merged_session=t,this.generation_config=n,this.num_decoder_layers=this.config.decoder_layers,this.num_decoder_heads=this.config.decoder_attention_heads,this.decoder_dim_kv=this.config.d_model/this.num_decoder_heads,this.num_encoder_layers=this.config.encoder_layers,this.num_encoder_heads=this.config.encoder_attention_heads,this.encoder_dim_kv=this.config.d_model/this.num_encoder_heads}}class sp extends E{}class sf extends sp{}class sg extends sp{async _call(e){return new iw(await super._call(e))}}class sw extends sp{async _call(e){return new im(await super._call(e))}}class sx extends sp{async _call(e){return new ig(await super._call(e))}}class sy extends sp{async _call(e){return new ix(await super._call(e))}}class sM extends E{}class sk extends sM{}class sb extends sM{async _call(e){return new iw(await super._call(e))}}class sv extends sM{async _call(e){return new im(await super._call(e))}}class sS extends sM{async _call(e){return new ig(await super._call(e))}}class sC extends sM{async _call(e){return new ix(await super._call(e))}}class sF extends E{}class sL extends sF{}class sA extends sF{async _call(e){return new iw(await super._call(e))}}class sP extends sF{async _call(e){return new im(await super._call(e))}}class sE extends sF{async _call(e){return new ig(await super._call(e))}}class sO extends sF{async _call(e){return new ix(await super._call(e))}}class sB extends E{}class sT extends sB{}class sD extends sB{}class sI extends E{}class sq extends sI{}class sN extends sI{requires_attention_mask=!1;main_input_name="input_features";constructor(e,s,t,n){super(e,s),this.decoder_merged_session=t,this.generation_config=n,this.num_decoder_layers=this.config.decoder_layers,this.num_decoder_heads=this.config.decoder_attention_heads,this.decoder_dim_kv=this.config.d_model/this.num_decoder_heads,this.num_encoder_layers=this.config.encoder_layers,this.num_encoder_heads=this.config.encoder_attention_heads,this.encoder_dim_kv=this.config.d_model/this.num_encoder_heads}async generate(e,s=null,t=null){if(s=this._get_generation_config(s),s.return_timestamps??=!1,s.return_timestamps&&(t=[new o.Pg(s)]),s.return_token_timestamps&&(s.output_attentions=!0,s.return_dict_in_generate=!0,"translate"===s.task&&console.warn("Token-level timestamps may not be reliable for task 'translate'."),!s.alignment_heads))throw Error("Model generation config has no `alignment_heads`, token-level timestamps not available. See https://gist.github.com/hollance/42e32852f24243b748ae6bc1f985b13a on how to add this property to the generation config.");let n=await super.generate(e,s,t);return s.return_token_timestamps&&s.alignment_heads&&(n.token_timestamps=this._extract_token_timestamps(n,s.alignment_heads,s.num_frames)),n}_extract_token_timestamps(e,s,t=null,n=.02){if(!e.cross_attentions)throw Error("Model outputs must contain cross attentions to extract timestamps. This is most likely because the model was not exported with `output_attentions=True`.");let i=this.config.median_filter_width;void 0===i&&(console.warn("Model config has no `median_filter_width`, using default value of 7."),i=7);let o=e.cross_attentions.map(e=>{let n=Array.from({length:this.config.decoder_layers},(s,t)=>(0,r.d3)(e.map(e=>e[t]),2)),a=(0,r.kn)(s.map(([e,s])=>t?n[e].slice(null,s,null,[0,t]):n[e].slice(null,s)));a=a.transpose(1,0,2,3);let[o,l]=(0,r.f3)(a,-2,0,!0),d=a.clone();for(let e=0;e<d.dims[0];++e){let s=d[e];for(let t=0;t<s.dims[0];++t){let n=s[t],a=o[e][t][0],r=l[e][t][0];for(let e=0;e<n.dims[0];++e){let s=n[e];for(let e=0;e<s.data.length;++e)s.data[e]=(s.data[e]-r.data[e])/a.data[e];s.data.set((0,c.qCb)(s.data,i))}}}return(0,r.J6)(d,1)}),l=[e.sequences.length,e.sequences[0].length],d=new r.es("float32",new Float32Array(l[0]*l[1]),l);for(let e=0;e<l[0];++e){let s=o[e].neg().squeeze_(0),[t,i]=(0,r.Ks)(s),l=Array.from({length:t.length-1},(e,s)=>t[s+1]-t[s]),c=(0,a.eG)([1],l).map(e=>!!e),_=[];for(let e=0;e<c.length;++e)c[e]&&_.push(i[e]*n);d[e].data.set(_,1)}return d}}class sG extends E{main_input_name="pixel_values";constructor(e,s,t,n){super(e,s),this.decoder_merged_session=t,this.generation_config=n;let a=this.config.encoder,i=this.config.decoder,o=a.model_type;(aS.get(o)??aC.get(o))||console.warn(`Model type for encoder '${o}' not found, assuming encoder-only architecture. Please report this at https://github.com/xenova/transformers.js/issues/new/choose.`);let r=aT.get(i.model_type);if(!r)throw Error(`Unable to construct \`VisionEncoderDecoder\` due to unsupported decoder: "${this.config.decoder.model_type}"`);let l=new r[1](i,t,n);this.add_encoder_pkv="num_decoder_layers"in l,this.add_encoder_pkv?(this.num_decoder_layers=l.num_decoder_layers,this.num_decoder_heads=l.num_decoder_heads,this.decoder_dim_kv=l.decoder_dim_kv,this.num_encoder_layers=l.num_encoder_layers,this.num_encoder_heads=l.num_encoder_heads,this.encoder_dim_kv=l.encoder_dim_kv):(this.num_layers=l.num_layers,this.num_heads=l.num_heads,this.dim_kv=l.dim_kv)}}class sV extends E{}class sz extends sV{}class sj extends sV{static async from_pretrained(e,s={}){return s.model_file_name??="text_model",super.from_pretrained(e,s)}}class s$ extends sV{static async from_pretrained(e,s={}){return s.model_file_name??="vision_model",super.from_pretrained(e,s)}}class sW extends E{}class sR extends sW{}class sQ extends sW{static async from_pretrained(e,s={}){return s.model_file_name??="text_model",super.from_pretrained(e,s)}}class sU extends sV{static async from_pretrained(e,s={}){return s.model_file_name??="vision_model",super.from_pretrained(e,s)}}class sX extends E{}class sK extends sX{}class sH extends E{}class sJ extends sH{}class sZ extends sH{}class sY extends E{constructor(e,s,t){super(e,s),this.generation_config=t,this.config.pad_token_id=this.config.eos_token_id,this.num_heads=this.config.n_head,this.num_layers=this.config.n_layer,this.dim_kv=this.config.n_embd/this.num_heads}}class s2 extends sY{}class s0 extends sY{}class s1 extends E{constructor(e,s,t){super(e,s),this.generation_config=t,this.config.pad_token_id=this.config.eos_token_id,this.num_heads=this.config.num_heads,this.num_layers=this.config.num_layers,this.dim_kv=this.config.hidden_size/this.num_heads}}class s4 extends s1{}class s3 extends s1{}class s5 extends E{constructor(e,s,t){super(e,s),this.generation_config=t,this.config.pad_token_id=this.config.eos_token_id,this.num_heads=this.config.num_attention_heads,this.num_layers=this.config.num_hidden_layers,this.dim_kv=this.config.hidden_size/this.num_heads}}class s6 extends s5{}class s7 extends s5{}class s8 extends E{constructor(e,s,t){super(e,s),this.generation_config=t,this.config.pad_token_id=this.config.eos_token_id,this.num_heads=this.config.n_head,this.num_layers=this.config.n_layer,this.dim_kv=this.config.n_embd/this.num_heads}}class s9 extends s8{}class te extends s8{}class ts extends E{constructor(e,s,t){super(e,s),this.generation_config=t,this.config.pad_token_id=this.config.eos_token_id,this.num_heads=this.config.n_head,this.num_layers=this.config.n_layer,this.dim_kv=this.config.n_embd/this.num_heads}}class tt extends ts{}class tn extends ts{}class ta extends E{constructor(e,s,t){super(e,s),this.generation_config=t,this.config.pad_token_id=this.config.eos_token_id,this.num_heads=this.config.n_head,this.num_layers=this.config.n_layer,this.dim_kv=this.config.n_embd/this.num_heads}}class ti extends ta{}class to extends ta{}class tr extends E{constructor(e,s,t){super(e,s),this.generation_config=t,this.config.pad_token_id=this.config.eos_token_id,this.num_heads=this.config.num_key_value_heads??this.config.num_attention_heads,this.num_layers=this.config.num_hidden_layers,this.dim_kv=this.config.hidden_size/this.config.num_attention_heads}}class tl extends tr{}class tc extends tr{}class td extends E{constructor(e,s,t){super(e,s),this.generation_config=t,this.config.pad_token_id=this.config.eos_token_id,this.num_heads=this.config.num_key_value_heads??this.config.num_attention_heads,this.num_layers=this.config.num_hidden_layers,this.dim_kv=this.config.hidden_size/this.config.num_attention_heads}}class t_ extends td{}class tu extends td{}class th extends E{constructor(e,s,t){super(e,s),this.generation_config=t,this.config.pad_token_id=this.config.eos_token_id,this.num_heads=this.config.num_attention_heads,this.num_layers=this.config.num_hidden_layers,this.dim_kv=this.config.hidden_size/this.num_heads}}class tm extends th{}class tp extends th{}class tf extends E{constructor(e,s,t){super(e,s),this.generation_config=t,this.config.pad_token_id=this.config.eos_token_id,this.num_heads=this.config.n_head,this.num_layers=this.config.n_layer,this.dim_kv=this.config.hidden_size/this.num_heads}}class tg extends tf{}class tw extends tf{}class tx extends E{constructor(e,s,t){super(e,s),this.generation_config=t,this.config.pad_token_id=this.config.eos_token_id,this.num_heads=this.config.n_heads,this.num_layers=this.config.n_layers,this.dim_kv=this.config.d_model/this.num_heads}}class ty extends tx{}class tM extends tx{}class tk extends E{constructor(e,s,t){super(e,s),this.generation_config=t,this.config.pad_token_id=this.config.eos_token_id,this.num_heads=this.config.num_attention_heads,this.num_layers=this.config.num_hidden_layers,this.dim_kv=this.config.hidden_size/this.num_heads}}class tb extends tk{}class tv extends tk{}class tS extends E{}class tC extends tS{}class tF extends tS{async _call(e){return new im(await super._call(e))}}class tL extends E{}class tA extends tL{async _call(e){return new iM(await super._call(e))}}class tP extends E{}class tE extends tP{}class tO extends tP{async _call(e){return new im(await super._call(e))}}class tB extends E{}class tT extends tB{}class tD extends tB{}class tI extends E{}class tq extends tI{}class tN extends tI{}class tG extends E{}class tV extends tG{}class tz extends tG{async _call(e){return new im(await super._call(e))}}class tj extends E{}class t$ extends tj{}class tW extends tj{async _call(e){return new tQ(await super._call(e))}}class tR extends tj{async _call(e){return new tU(await super._call(e))}}class tQ extends O{constructor({logits:e,pred_boxes:s}){super(),this.logits=e,this.pred_boxes=s}}class tU extends O{constructor({logits:e,pred_boxes:s,pred_masks:t}){super(),this.logits=e,this.pred_boxes=s,this.pred_masks=t}}class tX extends E{}class tK extends tX{}class tH extends tX{async _call(e){return new tJ(await super._call(e))}}class tJ extends tQ{}class tZ extends E{}class tY extends tZ{}class t2 extends tZ{async _call(e){return new im(await super._call(e))}}class t0 extends E{}class t1 extends t0{}class t4 extends t0{async _call(e){return new im(await super._call(e))}}class t3 extends E{}class t5 extends t3{}class t6 extends t3{async _call(e){return new im(await super._call(e))}}class t7 extends E{}class t8 extends t7{}class t9 extends t7{}class ne extends E{}class ns extends ne{}class nt extends ne{}class nn extends E{}class na extends nn{}class ni extends E{}class no extends ni{}class nr extends ni{}class nl extends E{}class nc extends nl{}class nd extends E{}class n_ extends nd{}class nu extends nd{async _call(e){return new im(await super._call(e))}}class nh extends E{}class nm extends nh{}class np extends nh{async _call(e){return new im(await super._call(e))}}class nf extends E{}class ng extends nf{}class nw extends nf{async _call(e){return new im(await super._call(e))}}class nx extends E{}class ny extends nx{}class nM extends nx{async _call(e){return new nk(await super._call(e))}}class nk extends O{constructor({logits:e,pred_boxes:s}){super(),this.logits=e,this.pred_boxes=s}}class nb extends E{}class nv extends nb{constructor(e,s,t){super(e,s),this.prompt_encoder_mask_decoder=t}async get_image_embeddings({pixel_values:e}){return await C(this,{pixel_values:e})}async forward(e){if(e.image_embeddings&&e.image_positional_embeddings||(e={...e,...await this.get_image_embeddings(e)}),!e.input_labels){let s=e.input_points.dims.slice(0,-1),t=s.reduce((e,s)=>e*s,1);e.input_labels=new r.es("int64",new BigInt64Array(t).fill(1n),s)}return await w(this.prompt_encoder_mask_decoder,{input_points:e.input_points,input_labels:e.input_labels,image_embeddings:e.image_embeddings,image_positional_embeddings:e.image_positional_embeddings})}async _call(e){return new nS(await super._call(e))}}class nS extends O{constructor({iou_scores:e,pred_masks:s}){super(),this.iou_scores=e,this.pred_masks=s}}class nC extends E{}class nF extends nC{}class nL extends nC{constructor(e,s,t,n){super(e,s),this.decoder_merged_session=t,this.generation_config=n,this.num_decoder_layers=this.config.decoder_layers,this.num_decoder_heads=this.config.decoder_attention_heads,this.decoder_dim_kv=this.config.d_model/this.num_decoder_heads,this.num_encoder_layers=this.config.encoder_layers,this.num_encoder_heads=this.config.encoder_attention_heads,this.encoder_dim_kv=this.config.d_model/this.num_encoder_heads}}class nA extends E{}class nP extends nA{}class nE extends nA{constructor(e,s,t,n){super(e,s),this.decoder_merged_session=t,this.generation_config=n,this.num_decoder_layers=this.config.decoder_layers,this.num_decoder_heads=this.config.decoder_attention_heads,this.decoder_dim_kv=this.config.d_model/this.num_decoder_heads,this.num_encoder_layers=this.config.encoder_layers,this.num_encoder_heads=this.config.encoder_attention_heads,this.encoder_dim_kv=this.config.d_model/this.num_encoder_heads}}class nO extends E{}class nB extends nO{}class nT extends nO{async _call(e){return new iy(await super._call(e))}}class nD extends nO{async _call(e){return new im(await super._call(e))}}class nI extends nO{async _call(e){return new ig(await super._call(e))}}class nq extends E{}class nN extends nq{}class nG extends nq{async _call(e){return new iy(await super._call(e))}}class nV extends nq{async _call(e){return new im(await super._call(e))}}class nz extends E{}class nj extends nz{}class n$ extends nz{async _call(e){return new iy(await super._call(e))}}class nW extends nz{async _call(e){return new im(await super._call(e))}}class nR extends nz{async _call(e){return new ig(await super._call(e))}}class nQ extends E{}class nU extends nQ{}class nX extends nQ{async _call(e){return new iy(await super._call(e))}}class nK extends nQ{async _call(e){return new im(await super._call(e))}}class nH extends nO{}class nJ extends nO{async _call(e){return new iy(await super._call(e))}}class nZ extends nO{async _call(e){return new im(await super._call(e))}}class nY extends E{}class n2 extends nY{}class n0 extends nY{async _call(e){return new iy(await super._call(e))}}class n1 extends nY{async _call(e){return new im(await super._call(e))}}class n4 extends nY{async _call(e){return new ip(await super._call(e))}}class n3 extends nY{async _call(e){return new ig(await super._call(e))}}class n5 extends E{}class n6 extends n5{}class n7 extends n5{constructor(e,s,t,n){super(e,s),this.decoder_merged_session=t,this.generation_config=n,this.num_decoder_layers=this.config.decoder_layers,this.num_decoder_heads=this.config.decoder_attention_heads,this.decoder_dim_kv=this.config.hidden_size/this.num_decoder_heads,this.num_encoder_layers=this.config.encoder_layers,this.num_encoder_heads=this.config.encoder_attention_heads,this.encoder_dim_kv=this.config.hidden_size/this.num_encoder_heads}async generate_speech(e,s,{threshold:t=.5,minlenratio:n=0,maxlenratio:a=20,vocoder:i=null}={}){let{encoder_outputs:o,encoder_attention_mask:l}=await C(this,{input_ids:e}),c=o.dims[1]/this.config.reduction_factor,d=Math.floor(c*a),_=Math.floor(c*n),u=this.config.num_mel_bins,h=[],m=null,p=null,f=0;for(;;){++f;let e={use_cache_branch:M(!!p),output_sequence:p?p.output_sequence_out:new r.es("float32",new Float32Array(u),[1,1,u]),encoder_attention_mask:l,speaker_embeddings:s,encoder_hidden_states:o};this.addPastKeyValues(e,m),p=await w(this.decoder_merged_session,e),m=this.getPastKeyValues(p,m);let{prob:n,spectrum:a}=p;if(h.push(a),f>=_&&(Array.from(n.data).filter(e=>e>=t).length>0||f>=d))break}let g=(0,r.d3)(h),{waveform:x}=await w(i.session,{spectrogram:g});return{spectrogram:g,waveform:x}}}class n8 extends E{main_input_name="spectrogram"}class n9 extends E{constructor(e,s,t){super(e,s),this.generation_config=t,this.config.pad_token_id=this.config.eos_token_id,this.num_encoder_layers=this.num_decoder_layers=this.config.decoder_layers,this.num_encoder_heads=this.num_decoder_heads=this.config.decoder_attention_heads,this.encoder_dim_kv=this.decoder_dim_kv=this.config.d_model/this.num_decoder_heads}}class ae extends n9{}class as extends E{constructor(e,s,t){super(e,s),this.generation_config=t,this.config.pad_token_id=this.config.eos_token_id,this.num_heads=this.config.num_key_value_heads,this.num_layers=this.config.num_hidden_layers,this.dim_kv=this.config.hidden_size/this.config.num_attention_heads}}class at extends as{}class an extends as{}class aa extends E{constructor(e,s,t){super(e,s),this.generation_config=t,this.config.pad_token_id=this.config.eos_token_id,this.num_heads=this.config.num_key_value_heads,this.num_layers=this.config.num_hidden_layers,this.dim_kv=this.config.hidden_size/this.config.num_attention_heads}}class ai extends aa{}class ao extends aa{}class ar extends E{constructor(e,s,t){super(e,s),this.generation_config=t,this.config.pad_token_id=this.config.eos_token_id,this.num_heads=this.config.num_attention_heads,this.num_layers=this.config.num_hidden_layers,this.dim_kv=this.config.hidden_size/this.config.num_attention_heads}}class al extends ar{}class ac extends ar{}class ad extends E{}class a_ extends ad{}class au extends ad{static async from_pretrained(e,s={}){return s.model_file_name??="text_model",super.from_pretrained(e,s)}}class ah extends ad{static async from_pretrained(e,s={}){return s.model_file_name??="audio_model",super.from_pretrained(e,s)}}class am extends E{}class ap extends am{async _call(e){return new ik(await super._call(e))}}class af extends E{}class ag extends af{}class aw extends af{}class ax extends E{constructor(e,s,t){super(e,s),this.generation_config=t,this.config.pad_token_id=this.config.eos_token_id,this.num_heads=this.config.num_attention_heads,this.num_layers=this.config.num_hidden_layers,this.dim_kv=this.config.hidden_size/this.num_heads}}class ay extends ax{}class aM extends E{}class ak extends aM{}class ab extends aM{async _call(e){return new im(await super._call(e))}}class av{static MODEL_CLASS_MAPPINGS=null;static BASE_IF_FAIL=!1;static async from_pretrained(e,{quantized:s=!0,progress_callback:t=null,config:a=null,cache_dir:i=null,local_files_only:o=!1,revision:r="main",model_file_name:l=null}={}){let c={quantized:s,progress_callback:t,config:a,cache_dir:i,local_files_only:o,revision:r,model_file_name:l};if(a=await n.z.from_pretrained(e,c),c.config||(c.config=a),!this.MODEL_CLASS_MAPPINGS)throw Error("`MODEL_CLASS_MAPPINGS` not implemented for this type of `AutoClass`: "+this.name);for(let s of this.MODEL_CLASS_MAPPINGS){let t=s.get(a.model_type);if(t)return await t[1].from_pretrained(e,c)}if(this.BASE_IF_FAIL)return console.warn(`Unknown model class "${a.model_type}", attempting to construct from base class.`),await E.from_pretrained(e,c);throw Error(`Unsupported model type: ${a.model_type}`)}}let aS=new Map([["bert",["BertModel",T]],["nomic_bert",["NomicBertModel",V]],["roformer",["RoFormerModel",j]],["electra",["ElectraModel",ee]],["esm",["EsmModel",eP]],["convbert",["ConvBertModel",X]],["camembert",["CamembertModel",eo]],["deberta",["DebertaModel",eu]],["deberta-v2",["DebertaV2Model",ew]],["mpnet",["MPNetModel",eV]],["albert",["AlbertModel",eJ]],["distilbert",["DistilBertModel",ev]],["roberta",["RobertaModel",sf]],["xlm",["XLMModel",sk]],["xlm-roberta",["XLMRobertaModel",sL]],["clap",["ClapModel",a_]],["clip",["CLIPModel",sz]],["clipseg",["CLIPSegModel",sJ]],["chinese_clip",["ChineseCLIPModel",sK]],["siglip",["SiglipModel",sR]],["mobilebert",["MobileBertModel",eD]],["squeezebert",["SqueezeBertModel",eQ]],["wav2vec2",["Wav2Vec2Model",nB]],["wav2vec2-bert",["Wav2Vec2BertModel",nU]],["unispeech",["UniSpeechModel",nN]],["unispeech-sat",["UniSpeechSatModel",nj]],["hubert",["HubertModel",nH]],["wavlm",["WavLMModel",n2]],["audio-spectrogram-transformer",["ASTModel",sT]],["vits",["VitsModel",ap]],["detr",["DetrModel",t$]],["table-transformer",["TableTransformerModel",tK]],["vit",["ViTModel",tC]],["mobilevit",["MobileViTModel",tE]],["owlvit",["OwlViTModel",tT]],["owlv2",["Owlv2Model",tq]],["beit",["BeitModel",tV]],["deit",["DeiTModel",tY]],["convnext",["ConvNextModel",n_]],["convnextv2",["ConvNextV2Model",nm]],["dinov2",["Dinov2Model",ng]],["resnet",["ResNetModel",t1]],["swin",["SwinModel",t5]],["swin2sr",["Swin2SRModel",t8]],["donut-swin",["DonutSwinModel",nc]],["yolos",["YolosModel",ny]],["dpt",["DPTModel",ns]],["glpn",["GLPNModel",no]],["hifigan",["SpeechT5HifiGan",n8]],["efficientnet",["EfficientNetModel",ak]]]),aC=new Map([["t5",["T5Model",e1]],["longt5",["LongT5Model",e5]],["mt5",["MT5Model",e8]],["bart",["BartModel",ss]],["mbart",["MBartModel",si]],["marian",["MarianModel",nF]],["whisper",["WhisperModel",sq]],["m2m_100",["M2M100Model",nP]],["blenderbot",["BlenderbotModel",sd]],["blenderbot-small",["BlenderbotSmallModel",sh]]]),aF=new Map([["bloom",["BloomModel",tg]],["gpt2",["GPT2Model",s2]],["gptj",["GPTJModel",s9]],["gpt_bigcode",["GPTBigCodeModel",tt]],["gpt_neo",["GPTNeoModel",s4]],["gpt_neox",["GPTNeoXModel",s6]],["codegen",["CodeGenModel",ti]],["llama",["LlamaModel",tl]],["qwen2",["Qwen2Model",t_]],["phi",["PhiModel",tm]],["mpt",["MptModel",ty]],["opt",["OPTModel",tb]],["mistral",["MistralModel",at]],["starcoder2",["Starcoder2Model",ai]],["falcon",["FalconModel",al]]]),aL=new Map([["speecht5",["SpeechT5ForSpeechToText",n6]],["whisper",["WhisperForConditionalGeneration",sN]]]),aA=new Map([["speecht5",["SpeechT5ForTextToSpeech",n7]]]),aP=new Map([["vits",["VitsModel",ap]]]),aE=new Map([["bert",["BertForSequenceClassification",I]],["roformer",["RoFormerForSequenceClassification",W]],["electra",["ElectraForSequenceClassification",et]],["esm",["EsmForSequenceClassification",eO]],["convbert",["ConvBertForSequenceClassification",H]],["camembert",["CamembertForSequenceClassification",el]],["deberta",["DebertaForSequenceClassification",em]],["deberta-v2",["DebertaV2ForSequenceClassification",ey]],["mpnet",["MPNetForSequenceClassification",ej]],["albert",["AlbertForSequenceClassification",eZ]],["distilbert",["DistilBertForSequenceClassification",eS]],["roberta",["RobertaForSequenceClassification",sw]],["xlm",["XLMForSequenceClassification",sv]],["xlm-roberta",["XLMRobertaForSequenceClassification",sP]],["bart",["BartForSequenceClassification",sn]],["mbart",["MBartForSequenceClassification",sr]],["mobilebert",["MobileBertForSequenceClassification",eq]],["squeezebert",["SqueezeBertForSequenceClassification",eX]]]),aO=new Map([["bert",["BertForTokenClassification",q]],["roformer",["RoFormerForTokenClassification",R]],["electra",["ElectraForTokenClassification",en]],["esm",["EsmForTokenClassification",eB]],["convbert",["ConvBertForTokenClassification",J]],["camembert",["CamembertForTokenClassification",ec]],["deberta",["DebertaForTokenClassification",ep]],["deberta-v2",["DebertaV2ForTokenClassification",eM]],["mpnet",["MPNetForTokenClassification",e$]],["distilbert",["DistilBertForTokenClassification",eC]],["roberta",["RobertaForTokenClassification",sx]],["xlm",["XLMForTokenClassification",sS]],["xlm-roberta",["XLMRobertaForTokenClassification",sE]]]),aB=new Map([["t5",["T5ForConditionalGeneration",e4]],["longt5",["LongT5ForConditionalGeneration",e6]],["mt5",["MT5ForConditionalGeneration",e9]],["bart",["BartForConditionalGeneration",st]],["mbart",["MBartForConditionalGeneration",so]],["marian",["MarianMTModel",nL]],["m2m_100",["M2M100ForConditionalGeneration",nE]],["blenderbot",["BlenderbotForConditionalGeneration",s_]],["blenderbot-small",["BlenderbotSmallForConditionalGeneration",sm]]]),aT=new Map([["bloom",["BloomForCausalLM",tw]],["gpt2",["GPT2LMHeadModel",s0]],["gptj",["GPTJForCausalLM",te]],["gpt_bigcode",["GPTBigCodeForCausalLM",tn]],["gpt_neo",["GPTNeoForCausalLM",s3]],["gpt_neox",["GPTNeoXForCausalLM",s7]],["codegen",["CodeGenForCausalLM",to]],["llama",["LlamaForCausalLM",tc]],["qwen2",["Qwen2ForCausalLM",tu]],["phi",["PhiForCausalLM",tp]],["mpt",["MptForCausalLM",tM]],["opt",["OPTForCausalLM",tv]],["mbart",["MBartForCausalLM",sl]],["mistral",["MistralForCausalLM",an]],["starcoder2",["Starcoder2ForCausalLM",ao]],["falcon",["FalconForCausalLM",ac]],["trocr",["TrOCRForCausalLM",ae]],["stablelm",["StableLmForCausalLM",ay]]]),aD=new Map([["bert",["BertForMaskedLM",D]],["roformer",["RoFormerForMaskedLM",$]],["electra",["ElectraForMaskedLM",es]],["esm",["EsmForMaskedLM",eE]],["convbert",["ConvBertForMaskedLM",K]],["camembert",["CamembertForMaskedLM",er]],["deberta",["DebertaForMaskedLM",eh]],["deberta-v2",["DebertaV2ForMaskedLM",ex]],["mpnet",["MPNetForMaskedLM",ez]],["albert",["AlbertForMaskedLM",e2]],["distilbert",["DistilBertForMaskedLM",eL]],["roberta",["RobertaForMaskedLM",sg]],["xlm",["XLMWithLMHeadModel",sb]],["xlm-roberta",["XLMRobertaForMaskedLM",sA]],["mobilebert",["MobileBertForMaskedLM",eI]],["squeezebert",["SqueezeBertForMaskedLM",eU]]]),aI=new Map([["bert",["BertForQuestionAnswering",N]],["roformer",["RoFormerForQuestionAnswering",Q]],["electra",["ElectraForQuestionAnswering",ea]],["convbert",["ConvBertForQuestionAnswering",Z]],["camembert",["CamembertForQuestionAnswering",ed]],["deberta",["DebertaForQuestionAnswering",ef]],["deberta-v2",["DebertaV2ForQuestionAnswering",ek]],["mpnet",["MPNetForQuestionAnswering",eW]],["albert",["AlbertForQuestionAnswering",eY]],["distilbert",["DistilBertForQuestionAnswering",eF]],["roberta",["RobertaForQuestionAnswering",sy]],["xlm",["XLMForQuestionAnswering",sC]],["xlm-roberta",["XLMRobertaForQuestionAnswering",sO]],["mobilebert",["MobileBertForQuestionAnswering",eN]],["squeezebert",["SqueezeBertForQuestionAnswering",eK]]]),aq=new Map([["vision-encoder-decoder",["VisionEncoderDecoderModel",sG]]]),aN=new Map([["vision-encoder-decoder",["VisionEncoderDecoderModel",sG]]]),aG=new Map([["vit",["ViTForImageClassification",tF]],["mobilevit",["MobileViTForImageClassification",tO]],["beit",["BeitForImageClassification",tz]],["deit",["DeiTForImageClassification",t2]],["convnext",["ConvNextForImageClassification",nu]],["convnextv2",["ConvNextV2ForImageClassification",np]],["dinov2",["Dinov2ForImageClassification",nw]],["resnet",["ResNetForImageClassification",t4]],["swin",["SwinForImageClassification",t6]],["segformer",["SegformerForImageClassification",ag]],["efficientnet",["EfficientNetForImageClassification",ab]]]),aV=new Map([["detr",["DetrForObjectDetection",tW]],["table-transformer",["TableTransformerForObjectDetection",tH]],["yolos",["YolosForObjectDetection",nM]]]),az=new Map([["owlvit",["OwlViTForObjectDetection",tD]],["owlv2",["Owlv2ForObjectDetection",tN]]]),aj=new Map([["detr",["DetrForSegmentation",tR]],["clipseg",["CLIPSegForImageSegmentation",sZ]]]),a$=new Map([["segformer",["SegformerForSemanticSegmentation",aw]]]),aW=new Map([["sam",["SamModel",nv]]]),aR=new Map([["wav2vec2",["Wav2Vec2ForCTC",nT]],["wav2vec2-bert",["Wav2Vec2BertForCTC",nX]],["unispeech",["UniSpeechForCTC",nG]],["unispeech-sat",["UniSpeechSatForCTC",n$]],["wavlm",["WavLMForCTC",n0]],["hubert",["HubertForCTC",nJ]]]),aQ=new Map([["wav2vec2",["Wav2Vec2ForSequenceClassification",nD]],["wav2vec2-bert",["Wav2Vec2BertForSequenceClassification",nK]],["unispeech",["UniSpeechForSequenceClassification",nV]],["unispeech-sat",["UniSpeechSatForSequenceClassification",nW]],["wavlm",["WavLMForSequenceClassification",n1]],["hubert",["HubertForSequenceClassification",nZ]],["audio-spectrogram-transformer",["ASTForAudioClassification",sD]]]),aU=new Map([["wavlm",["WavLMForXVector",n4]]]),aX=new Map([["unispeech-sat",["UniSpeechSatForAudioFrameClassification",nR]],["wavlm",["WavLMForAudioFrameClassification",n3]],["wav2vec2",["Wav2Vec2ForAudioFrameClassification",nI]]]),aK=new Map([["vitmatte",["VitMatteForImageMatting",tA]]]),aH=new Map([["swin2sr",["Swin2SRForImageSuperResolution",t9]]]),aJ=new Map([["dpt",["DPTForDepthEstimation",nt]],["depth_anything",["DepthAnythingForDepthEstimation",na]],["glpn",["GLPNForDepthEstimation",nr]]]),aZ=new Map([["clip",["CLIPVisionModelWithProjection",s$]],["siglip",["SiglipVisionModel",sU]]]),aY=[[aS,h.EncoderOnly],[aC,h.EncoderDecoder],[aF,h.DecoderOnly],[aE,h.EncoderOnly],[aO,h.EncoderOnly],[aB,h.Seq2Seq],[aL,h.Seq2Seq],[aT,h.DecoderOnly],[aD,h.EncoderOnly],[aI,h.EncoderOnly],[aq,h.Vision2Seq],[aG,h.EncoderOnly],[aj,h.EncoderOnly],[a$,h.EncoderOnly],[aK,h.EncoderOnly],[aH,h.EncoderOnly],[aJ,h.EncoderOnly],[aV,h.EncoderOnly],[az,h.EncoderOnly],[aW,h.MaskGeneration],[aR,h.EncoderOnly],[aQ,h.EncoderOnly],[aA,h.Seq2Seq],[aP,h.EncoderOnly],[aU,h.EncoderOnly],[aX,h.EncoderOnly],[aZ,h.EncoderOnly]];for(let[e,s]of aY)for(let[t,n]of e.values())m.set(t,s),f.set(n,t),p.set(t,n);for(let[e,s,t]of[["CLIPTextModelWithProjection",sj,h.EncoderOnly],["SiglipTextModel",sQ,h.EncoderOnly],["ClapTextModelWithProjection",au,h.EncoderOnly],["ClapAudioModelWithProjection",ah,h.EncoderOnly]])m.set(e,t),f.set(s,e),p.set(e,s);class a2 extends av{static MODEL_CLASS_MAPPINGS=aY.map(e=>e[0]);static BASE_IF_FAIL=!0}class a0 extends av{static MODEL_CLASS_MAPPINGS=[aE]}class a1 extends av{static MODEL_CLASS_MAPPINGS=[aO]}class a4 extends av{static MODEL_CLASS_MAPPINGS=[aB]}class a3 extends av{static MODEL_CLASS_MAPPINGS=[aL]}class a5 extends av{static MODEL_CLASS_MAPPINGS=[aA]}class a6 extends av{static MODEL_CLASS_MAPPINGS=[aP]}class a7 extends av{static MODEL_CLASS_MAPPINGS=[aT]}class a8 extends av{static MODEL_CLASS_MAPPINGS=[aD]}class a9 extends av{static MODEL_CLASS_MAPPINGS=[aI]}class ie extends av{static MODEL_CLASS_MAPPINGS=[aq]}class is extends av{static MODEL_CLASS_MAPPINGS=[aG]}class it extends av{static MODEL_CLASS_MAPPINGS=[aj]}class ia extends av{static MODEL_CLASS_MAPPINGS=[a$]}class ii extends av{static MODEL_CLASS_MAPPINGS=[aV]}class io extends av{static MODEL_CLASS_MAPPINGS=[az]}class ir extends av{static MODEL_CLASS_MAPPINGS=[aR]}class il extends av{static MODEL_CLASS_MAPPINGS=[aQ]}class ic extends av{static MODEL_CLASS_MAPPINGS=[aN]}class id extends av{static MODEL_CLASS_MAPPINGS=[aH]}class i_ extends av{static MODEL_CLASS_MAPPINGS=[aJ]}class iu extends av{static MODEL_CLASS_MAPPINGS=[aZ]}class ih extends O{constructor({logits:e,past_key_values:s,encoder_outputs:t,decoder_attentions:n=null,cross_attentions:a=null}){super(),this.logits=e,this.past_key_values=s,this.encoder_outputs=t,this.decoder_attentions=n,this.cross_attentions=a}}class im extends O{constructor({logits:e}){super(),this.logits=e}}class ip extends O{constructor({logits:e,embeddings:s}){super(),this.logits=e,this.embeddings=s}}class ig extends O{constructor({logits:e}){super(),this.logits=e}}class iw extends O{constructor({logits:e}){super(),this.logits=e}}class ix extends O{constructor({start_logits:e,end_logits:s}){super(),this.start_logits=e,this.end_logits=s}}class iy extends O{constructor({logits:e}){super(),this.logits=e}}class iM extends O{constructor({alphas:e}){super(),this.alphas=e}}class ik extends O{constructor({waveform:e,spectrogram:s}){super(),this.waveform=e,this.spectrogram=s}}}}]);
|
|
|
|
_next/static/chunks/332-dcb3f9d33411b2c1.js
DELETED
@@ -1,6 +0,0 @@
|
|
1 |
-
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[332],{9332:function(t){!function(){var r={675:function(t,r){"use strict";r.byteLength=function(t){var r=s(t),e=r[0],n=r[1];return(e+n)*3/4-n},r.toByteArray=function(t){var r,e,i=s(t),f=i[0],u=i[1],h=new o((f+u)*3/4-u),a=0,p=u>0?f-4:f;for(e=0;e<p;e+=4)r=n[t.charCodeAt(e)]<<18|n[t.charCodeAt(e+1)]<<12|n[t.charCodeAt(e+2)]<<6|n[t.charCodeAt(e+3)],h[a++]=r>>16&255,h[a++]=r>>8&255,h[a++]=255&r;return 2===u&&(r=n[t.charCodeAt(e)]<<2|n[t.charCodeAt(e+1)]>>4,h[a++]=255&r),1===u&&(r=n[t.charCodeAt(e)]<<10|n[t.charCodeAt(e+1)]<<4|n[t.charCodeAt(e+2)]>>2,h[a++]=r>>8&255,h[a++]=255&r),h},r.fromByteArray=function(t){for(var r,n=t.length,o=n%3,i=[],f=0,u=n-o;f<u;f+=16383)i.push(function(t,r,n){for(var o,i=[],f=r;f<n;f+=3)i.push(e[(o=(t[f]<<16&16711680)+(t[f+1]<<8&65280)+(255&t[f+2]))>>18&63]+e[o>>12&63]+e[o>>6&63]+e[63&o]);return i.join("")}(t,f,f+16383>u?u:f+16383));return 1===o?i.push(e[(r=t[n-1])>>2]+e[r<<4&63]+"=="):2===o&&i.push(e[(r=(t[n-2]<<8)+t[n-1])>>10]+e[r>>4&63]+e[r<<2&63]+"="),i.join("")};for(var e=[],n=[],o="undefined"!=typeof Uint8Array?Uint8Array:Array,i="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",f=0,u=i.length;f<u;++f)e[f]=i[f],n[i.charCodeAt(f)]=f;function s(t){var r=t.length;if(r%4>0)throw Error("Invalid string. Length must be a multiple of 4");var e=t.indexOf("=");-1===e&&(e=r);var n=e===r?0:4-e%4;return[e,n]}n["-".charCodeAt(0)]=62,n["_".charCodeAt(0)]=63},72:function(t,r,e){"use strict";/*!
|
2 |
-
* The buffer module from node.js, for the browser.
|
3 |
-
*
|
4 |
-
* @author Feross Aboukhadijeh <https://feross.org>
|
5 |
-
* @license MIT
|
6 |
-
*/var n=e(675),o=e(783),i="function"==typeof Symbol&&"function"==typeof Symbol.for?Symbol.for("nodejs.util.inspect.custom"):null;function f(t){if(t>2147483647)throw RangeError('The value "'+t+'" is invalid for option "size"');var r=new Uint8Array(t);return Object.setPrototypeOf(r,u.prototype),r}function u(t,r,e){if("number"==typeof t){if("string"==typeof r)throw TypeError('The "string" argument must be of type string. Received type number');return a(t)}return s(t,r,e)}function s(t,r,e){if("string"==typeof t)return function(t,r){if(("string"!=typeof r||""===r)&&(r="utf8"),!u.isEncoding(r))throw TypeError("Unknown encoding: "+r);var e=0|l(t,r),n=f(e),o=n.write(t,r);return o!==e&&(n=n.slice(0,o)),n}(t,r);if(ArrayBuffer.isView(t))return p(t);if(null==t)throw TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof t);if(L(t,ArrayBuffer)||t&&L(t.buffer,ArrayBuffer)||"undefined"!=typeof SharedArrayBuffer&&(L(t,SharedArrayBuffer)||t&&L(t.buffer,SharedArrayBuffer)))return function(t,r,e){var n;if(r<0||t.byteLength<r)throw RangeError('"offset" is outside of buffer bounds');if(t.byteLength<r+(e||0))throw RangeError('"length" is outside of buffer bounds');return Object.setPrototypeOf(n=void 0===r&&void 0===e?new Uint8Array(t):void 0===e?new Uint8Array(t,r):new Uint8Array(t,r,e),u.prototype),n}(t,r,e);if("number"==typeof t)throw TypeError('The "value" argument must not be of type number. Received type number');var n=t.valueOf&&t.valueOf();if(null!=n&&n!==t)return u.from(n,r,e);var o=function(t){if(u.isBuffer(t)){var r,e=0|c(t.length),n=f(e);return 0===n.length||t.copy(n,0,0,e),n}return void 0!==t.length?"number"!=typeof t.length||(r=t.length)!=r?f(0):p(t):"Buffer"===t.type&&Array.isArray(t.data)?p(t.data):void 0}(t);if(o)return o;if("undefined"!=typeof Symbol&&null!=Symbol.toPrimitive&&"function"==typeof t[Symbol.toPrimitive])return u.from(t[Symbol.toPrimitive]("string"),r,e);throw TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof t)}function h(t){if("number"!=typeof t)throw TypeError('"size" argument must be of type number');if(t<0)throw RangeError('The value "'+t+'" is invalid for option "size"')}function a(t){return h(t),f(t<0?0:0|c(t))}function p(t){for(var r=t.length<0?0:0|c(t.length),e=f(r),n=0;n<r;n+=1)e[n]=255&t[n];return e}function c(t){if(t>=2147483647)throw RangeError("Attempt to allocate Buffer larger than maximum size: 0x7fffffff bytes");return 0|t}function l(t,r){if(u.isBuffer(t))return t.length;if(ArrayBuffer.isView(t)||L(t,ArrayBuffer))return t.byteLength;if("string"!=typeof t)throw TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof t);var e=t.length,n=arguments.length>2&&!0===arguments[2];if(!n&&0===e)return 0;for(var o=!1;;)switch(r){case"ascii":case"latin1":case"binary":return e;case"utf8":case"utf-8":return T(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*e;case"hex":return e>>>1;case"base64":return C(t).length;default:if(o)return n?-1:T(t).length;r=(""+r).toLowerCase(),o=!0}}function y(t,r,e){var o,i,f=!1;if((void 0===r||r<0)&&(r=0),r>this.length||((void 0===e||e>this.length)&&(e=this.length),e<=0||(e>>>=0)<=(r>>>=0)))return"";for(t||(t="utf8");;)switch(t){case"hex":return function(t,r,e){var n=t.length;(!r||r<0)&&(r=0),(!e||e<0||e>n)&&(e=n);for(var o="",i=r;i<e;++i)o+=O[t[i]];return o}(this,r,e);case"utf8":case"utf-8":return b(this,r,e);case"ascii":return function(t,r,e){var n="";e=Math.min(t.length,e);for(var o=r;o<e;++o)n+=String.fromCharCode(127&t[o]);return n}(this,r,e);case"latin1":case"binary":return function(t,r,e){var n="";e=Math.min(t.length,e);for(var o=r;o<e;++o)n+=String.fromCharCode(t[o]);return n}(this,r,e);case"base64":return o=r,i=e,0===o&&i===this.length?n.fromByteArray(this):n.fromByteArray(this.slice(o,i));case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return function(t,r,e){for(var n=t.slice(r,e),o="",i=0;i<n.length;i+=2)o+=String.fromCharCode(n[i]+256*n[i+1]);return o}(this,r,e);default:if(f)throw TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),f=!0}}function g(t,r,e){var n=t[r];t[r]=t[e],t[e]=n}function d(t,r,e,n,o){var i;if(0===t.length)return -1;if("string"==typeof e?(n=e,e=0):e>2147483647?e=2147483647:e<-2147483648&&(e=-2147483648),(i=e=+e)!=i&&(e=o?0:t.length-1),e<0&&(e=t.length+e),e>=t.length){if(o)return -1;e=t.length-1}else if(e<0){if(!o)return -1;e=0}if("string"==typeof r&&(r=u.from(r,n)),u.isBuffer(r))return 0===r.length?-1:v(t,r,e,n,o);if("number"==typeof r)return(r&=255,"function"==typeof Uint8Array.prototype.indexOf)?o?Uint8Array.prototype.indexOf.call(t,r,e):Uint8Array.prototype.lastIndexOf.call(t,r,e):v(t,[r],e,n,o);throw TypeError("val must be string, number or Buffer")}function v(t,r,e,n,o){var i,f=1,u=t.length,s=r.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(t.length<2||r.length<2)return -1;f=2,u/=2,s/=2,e/=2}function h(t,r){return 1===f?t[r]:t.readUInt16BE(r*f)}if(o){var a=-1;for(i=e;i<u;i++)if(h(t,i)===h(r,-1===a?0:i-a)){if(-1===a&&(a=i),i-a+1===s)return a*f}else -1!==a&&(i-=i-a),a=-1}else for(e+s>u&&(e=u-s),i=e;i>=0;i--){for(var p=!0,c=0;c<s;c++)if(h(t,i+c)!==h(r,c)){p=!1;break}if(p)return i}return -1}function b(t,r,e){e=Math.min(t.length,e);for(var n=[],o=r;o<e;){var i,f,u,s,h=t[o],a=null,p=h>239?4:h>223?3:h>191?2:1;if(o+p<=e)switch(p){case 1:h<128&&(a=h);break;case 2:(192&(i=t[o+1]))==128&&(s=(31&h)<<6|63&i)>127&&(a=s);break;case 3:i=t[o+1],f=t[o+2],(192&i)==128&&(192&f)==128&&(s=(15&h)<<12|(63&i)<<6|63&f)>2047&&(s<55296||s>57343)&&(a=s);break;case 4:i=t[o+1],f=t[o+2],u=t[o+3],(192&i)==128&&(192&f)==128&&(192&u)==128&&(s=(15&h)<<18|(63&i)<<12|(63&f)<<6|63&u)>65535&&s<1114112&&(a=s)}null===a?(a=65533,p=1):a>65535&&(a-=65536,n.push(a>>>10&1023|55296),a=56320|1023&a),n.push(a),o+=p}return function(t){var r=t.length;if(r<=4096)return String.fromCharCode.apply(String,t);for(var e="",n=0;n<r;)e+=String.fromCharCode.apply(String,t.slice(n,n+=4096));return e}(n)}function w(t,r,e){if(t%1!=0||t<0)throw RangeError("offset is not uint");if(t+r>e)throw RangeError("Trying to access beyond buffer length")}function m(t,r,e,n,o,i){if(!u.isBuffer(t))throw TypeError('"buffer" argument must be a Buffer instance');if(r>o||r<i)throw RangeError('"value" argument is out of bounds');if(e+n>t.length)throw RangeError("Index out of range")}function E(t,r,e,n,o,i){if(e+n>t.length||e<0)throw RangeError("Index out of range")}function A(t,r,e,n,i){return r=+r,e>>>=0,i||E(t,r,e,4,34028234663852886e22,-34028234663852886e22),o.write(t,r,e,n,23,4),e+4}function B(t,r,e,n,i){return r=+r,e>>>=0,i||E(t,r,e,8,17976931348623157e292,-17976931348623157e292),o.write(t,r,e,n,52,8),e+8}r.Buffer=u,r.SlowBuffer=function(t){return+t!=t&&(t=0),u.alloc(+t)},r.INSPECT_MAX_BYTES=50,r.kMaxLength=2147483647,u.TYPED_ARRAY_SUPPORT=function(){try{var t=new Uint8Array(1),r={foo:function(){return 42}};return Object.setPrototypeOf(r,Uint8Array.prototype),Object.setPrototypeOf(t,r),42===t.foo()}catch(t){return!1}}(),u.TYPED_ARRAY_SUPPORT||"undefined"==typeof console||"function"!=typeof console.error||console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support."),Object.defineProperty(u.prototype,"parent",{enumerable:!0,get:function(){if(u.isBuffer(this))return this.buffer}}),Object.defineProperty(u.prototype,"offset",{enumerable:!0,get:function(){if(u.isBuffer(this))return this.byteOffset}}),u.poolSize=8192,u.from=function(t,r,e){return s(t,r,e)},Object.setPrototypeOf(u.prototype,Uint8Array.prototype),Object.setPrototypeOf(u,Uint8Array),u.alloc=function(t,r,e){return(h(t),t<=0)?f(t):void 0!==r?"string"==typeof e?f(t).fill(r,e):f(t).fill(r):f(t)},u.allocUnsafe=function(t){return a(t)},u.allocUnsafeSlow=function(t){return a(t)},u.isBuffer=function(t){return null!=t&&!0===t._isBuffer&&t!==u.prototype},u.compare=function(t,r){if(L(t,Uint8Array)&&(t=u.from(t,t.offset,t.byteLength)),L(r,Uint8Array)&&(r=u.from(r,r.offset,r.byteLength)),!u.isBuffer(t)||!u.isBuffer(r))throw TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(t===r)return 0;for(var e=t.length,n=r.length,o=0,i=Math.min(e,n);o<i;++o)if(t[o]!==r[o]){e=t[o],n=r[o];break}return e<n?-1:n<e?1:0},u.isEncoding=function(t){switch(String(t).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},u.concat=function(t,r){if(!Array.isArray(t))throw TypeError('"list" argument must be an Array of Buffers');if(0===t.length)return u.alloc(0);if(void 0===r)for(e=0,r=0;e<t.length;++e)r+=t[e].length;var e,n=u.allocUnsafe(r),o=0;for(e=0;e<t.length;++e){var i=t[e];if(L(i,Uint8Array)&&(i=u.from(i)),!u.isBuffer(i))throw TypeError('"list" argument must be an Array of Buffers');i.copy(n,o),o+=i.length}return n},u.byteLength=l,u.prototype._isBuffer=!0,u.prototype.swap16=function(){var t=this.length;if(t%2!=0)throw RangeError("Buffer size must be a multiple of 16-bits");for(var r=0;r<t;r+=2)g(this,r,r+1);return this},u.prototype.swap32=function(){var t=this.length;if(t%4!=0)throw RangeError("Buffer size must be a multiple of 32-bits");for(var r=0;r<t;r+=4)g(this,r,r+3),g(this,r+1,r+2);return this},u.prototype.swap64=function(){var t=this.length;if(t%8!=0)throw RangeError("Buffer size must be a multiple of 64-bits");for(var r=0;r<t;r+=8)g(this,r,r+7),g(this,r+1,r+6),g(this,r+2,r+5),g(this,r+3,r+4);return this},u.prototype.toString=function(){var t=this.length;return 0===t?"":0==arguments.length?b(this,0,t):y.apply(this,arguments)},u.prototype.toLocaleString=u.prototype.toString,u.prototype.equals=function(t){if(!u.isBuffer(t))throw TypeError("Argument must be a Buffer");return this===t||0===u.compare(this,t)},u.prototype.inspect=function(){var t="",e=r.INSPECT_MAX_BYTES;return t=this.toString("hex",0,e).replace(/(.{2})/g,"$1 ").trim(),this.length>e&&(t+=" ... "),"<Buffer "+t+">"},i&&(u.prototype[i]=u.prototype.inspect),u.prototype.compare=function(t,r,e,n,o){if(L(t,Uint8Array)&&(t=u.from(t,t.offset,t.byteLength)),!u.isBuffer(t))throw TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof t);if(void 0===r&&(r=0),void 0===e&&(e=t?t.length:0),void 0===n&&(n=0),void 0===o&&(o=this.length),r<0||e>t.length||n<0||o>this.length)throw RangeError("out of range index");if(n>=o&&r>=e)return 0;if(n>=o)return -1;if(r>=e)return 1;if(r>>>=0,e>>>=0,n>>>=0,o>>>=0,this===t)return 0;for(var i=o-n,f=e-r,s=Math.min(i,f),h=this.slice(n,o),a=t.slice(r,e),p=0;p<s;++p)if(h[p]!==a[p]){i=h[p],f=a[p];break}return i<f?-1:f<i?1:0},u.prototype.includes=function(t,r,e){return -1!==this.indexOf(t,r,e)},u.prototype.indexOf=function(t,r,e){return d(this,t,r,e,!0)},u.prototype.lastIndexOf=function(t,r,e){return d(this,t,r,e,!1)},u.prototype.write=function(t,r,e,n){if(void 0===r)n="utf8",e=this.length,r=0;else if(void 0===e&&"string"==typeof r)n=r,e=this.length,r=0;else if(isFinite(r))r>>>=0,isFinite(e)?(e>>>=0,void 0===n&&(n="utf8")):(n=e,e=void 0);else throw Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");var o,i,f,u,s,h,a,p,c,l,y,g,d=this.length-r;if((void 0===e||e>d)&&(e=d),t.length>0&&(e<0||r<0)||r>this.length)throw RangeError("Attempt to write outside buffer bounds");n||(n="utf8");for(var v=!1;;)switch(n){case"hex":return function(t,r,e,n){e=Number(e)||0;var o=t.length-e;n?(n=Number(n))>o&&(n=o):n=o;var i=r.length;n>i/2&&(n=i/2);for(var f=0;f<n;++f){var u=parseInt(r.substr(2*f,2),16);if(u!=u)break;t[e+f]=u}return f}(this,t,r,e);case"utf8":case"utf-8":return s=r,h=e,S(T(t,this.length-s),this,s,h);case"ascii":return a=r,p=e,S(I(t),this,a,p);case"latin1":case"binary":;return o=this,i=t,f=r,u=e,S(I(i),o,f,u);case"base64":return c=r,l=e,S(C(t),this,c,l);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return y=r,g=e,S(function(t,r){for(var e,n,o=[],i=0;i<t.length&&!((r-=2)<0);++i)n=(e=t.charCodeAt(i))>>8,o.push(e%256),o.push(n);return o}(t,this.length-y),this,y,g);default:if(v)throw TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),v=!0}},u.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}},u.prototype.slice=function(t,r){var e=this.length;t=~~t,r=void 0===r?e:~~r,t<0?(t+=e)<0&&(t=0):t>e&&(t=e),r<0?(r+=e)<0&&(r=0):r>e&&(r=e),r<t&&(r=t);var n=this.subarray(t,r);return Object.setPrototypeOf(n,u.prototype),n},u.prototype.readUIntLE=function(t,r,e){t>>>=0,r>>>=0,e||w(t,r,this.length);for(var n=this[t],o=1,i=0;++i<r&&(o*=256);)n+=this[t+i]*o;return n},u.prototype.readUIntBE=function(t,r,e){t>>>=0,r>>>=0,e||w(t,r,this.length);for(var n=this[t+--r],o=1;r>0&&(o*=256);)n+=this[t+--r]*o;return n},u.prototype.readUInt8=function(t,r){return t>>>=0,r||w(t,1,this.length),this[t]},u.prototype.readUInt16LE=function(t,r){return t>>>=0,r||w(t,2,this.length),this[t]|this[t+1]<<8},u.prototype.readUInt16BE=function(t,r){return t>>>=0,r||w(t,2,this.length),this[t]<<8|this[t+1]},u.prototype.readUInt32LE=function(t,r){return t>>>=0,r||w(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+16777216*this[t+3]},u.prototype.readUInt32BE=function(t,r){return t>>>=0,r||w(t,4,this.length),16777216*this[t]+(this[t+1]<<16|this[t+2]<<8|this[t+3])},u.prototype.readIntLE=function(t,r,e){t>>>=0,r>>>=0,e||w(t,r,this.length);for(var n=this[t],o=1,i=0;++i<r&&(o*=256);)n+=this[t+i]*o;return n>=(o*=128)&&(n-=Math.pow(2,8*r)),n},u.prototype.readIntBE=function(t,r,e){t>>>=0,r>>>=0,e||w(t,r,this.length);for(var n=r,o=1,i=this[t+--n];n>0&&(o*=256);)i+=this[t+--n]*o;return i>=(o*=128)&&(i-=Math.pow(2,8*r)),i},u.prototype.readInt8=function(t,r){return(t>>>=0,r||w(t,1,this.length),128&this[t])?-((255-this[t]+1)*1):this[t]},u.prototype.readInt16LE=function(t,r){t>>>=0,r||w(t,2,this.length);var e=this[t]|this[t+1]<<8;return 32768&e?4294901760|e:e},u.prototype.readInt16BE=function(t,r){t>>>=0,r||w(t,2,this.length);var e=this[t+1]|this[t]<<8;return 32768&e?4294901760|e:e},u.prototype.readInt32LE=function(t,r){return t>>>=0,r||w(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},u.prototype.readInt32BE=function(t,r){return t>>>=0,r||w(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},u.prototype.readFloatLE=function(t,r){return t>>>=0,r||w(t,4,this.length),o.read(this,t,!0,23,4)},u.prototype.readFloatBE=function(t,r){return t>>>=0,r||w(t,4,this.length),o.read(this,t,!1,23,4)},u.prototype.readDoubleLE=function(t,r){return t>>>=0,r||w(t,8,this.length),o.read(this,t,!0,52,8)},u.prototype.readDoubleBE=function(t,r){return t>>>=0,r||w(t,8,this.length),o.read(this,t,!1,52,8)},u.prototype.writeUIntLE=function(t,r,e,n){if(t=+t,r>>>=0,e>>>=0,!n){var o=Math.pow(2,8*e)-1;m(this,t,r,e,o,0)}var i=1,f=0;for(this[r]=255&t;++f<e&&(i*=256);)this[r+f]=t/i&255;return r+e},u.prototype.writeUIntBE=function(t,r,e,n){if(t=+t,r>>>=0,e>>>=0,!n){var o=Math.pow(2,8*e)-1;m(this,t,r,e,o,0)}var i=e-1,f=1;for(this[r+i]=255&t;--i>=0&&(f*=256);)this[r+i]=t/f&255;return r+e},u.prototype.writeUInt8=function(t,r,e){return t=+t,r>>>=0,e||m(this,t,r,1,255,0),this[r]=255&t,r+1},u.prototype.writeUInt16LE=function(t,r,e){return t=+t,r>>>=0,e||m(this,t,r,2,65535,0),this[r]=255&t,this[r+1]=t>>>8,r+2},u.prototype.writeUInt16BE=function(t,r,e){return t=+t,r>>>=0,e||m(this,t,r,2,65535,0),this[r]=t>>>8,this[r+1]=255&t,r+2},u.prototype.writeUInt32LE=function(t,r,e){return t=+t,r>>>=0,e||m(this,t,r,4,4294967295,0),this[r+3]=t>>>24,this[r+2]=t>>>16,this[r+1]=t>>>8,this[r]=255&t,r+4},u.prototype.writeUInt32BE=function(t,r,e){return t=+t,r>>>=0,e||m(this,t,r,4,4294967295,0),this[r]=t>>>24,this[r+1]=t>>>16,this[r+2]=t>>>8,this[r+3]=255&t,r+4},u.prototype.writeIntLE=function(t,r,e,n){if(t=+t,r>>>=0,!n){var o=Math.pow(2,8*e-1);m(this,t,r,e,o-1,-o)}var i=0,f=1,u=0;for(this[r]=255&t;++i<e&&(f*=256);)t<0&&0===u&&0!==this[r+i-1]&&(u=1),this[r+i]=(t/f>>0)-u&255;return r+e},u.prototype.writeIntBE=function(t,r,e,n){if(t=+t,r>>>=0,!n){var o=Math.pow(2,8*e-1);m(this,t,r,e,o-1,-o)}var i=e-1,f=1,u=0;for(this[r+i]=255&t;--i>=0&&(f*=256);)t<0&&0===u&&0!==this[r+i+1]&&(u=1),this[r+i]=(t/f>>0)-u&255;return r+e},u.prototype.writeInt8=function(t,r,e){return t=+t,r>>>=0,e||m(this,t,r,1,127,-128),t<0&&(t=255+t+1),this[r]=255&t,r+1},u.prototype.writeInt16LE=function(t,r,e){return t=+t,r>>>=0,e||m(this,t,r,2,32767,-32768),this[r]=255&t,this[r+1]=t>>>8,r+2},u.prototype.writeInt16BE=function(t,r,e){return t=+t,r>>>=0,e||m(this,t,r,2,32767,-32768),this[r]=t>>>8,this[r+1]=255&t,r+2},u.prototype.writeInt32LE=function(t,r,e){return t=+t,r>>>=0,e||m(this,t,r,4,2147483647,-2147483648),this[r]=255&t,this[r+1]=t>>>8,this[r+2]=t>>>16,this[r+3]=t>>>24,r+4},u.prototype.writeInt32BE=function(t,r,e){return t=+t,r>>>=0,e||m(this,t,r,4,2147483647,-2147483648),t<0&&(t=4294967295+t+1),this[r]=t>>>24,this[r+1]=t>>>16,this[r+2]=t>>>8,this[r+3]=255&t,r+4},u.prototype.writeFloatLE=function(t,r,e){return A(this,t,r,!0,e)},u.prototype.writeFloatBE=function(t,r,e){return A(this,t,r,!1,e)},u.prototype.writeDoubleLE=function(t,r,e){return B(this,t,r,!0,e)},u.prototype.writeDoubleBE=function(t,r,e){return B(this,t,r,!1,e)},u.prototype.copy=function(t,r,e,n){if(!u.isBuffer(t))throw TypeError("argument should be a Buffer");if(e||(e=0),n||0===n||(n=this.length),r>=t.length&&(r=t.length),r||(r=0),n>0&&n<e&&(n=e),n===e||0===t.length||0===this.length)return 0;if(r<0)throw RangeError("targetStart out of bounds");if(e<0||e>=this.length)throw RangeError("Index out of range");if(n<0)throw RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),t.length-r<n-e&&(n=t.length-r+e);var o=n-e;if(this===t&&"function"==typeof Uint8Array.prototype.copyWithin)this.copyWithin(r,e,n);else if(this===t&&e<r&&r<n)for(var i=o-1;i>=0;--i)t[i+r]=this[i+e];else Uint8Array.prototype.set.call(t,this.subarray(e,n),r);return o},u.prototype.fill=function(t,r,e,n){if("string"==typeof t){if("string"==typeof r?(n=r,r=0,e=this.length):"string"==typeof e&&(n=e,e=this.length),void 0!==n&&"string"!=typeof n)throw TypeError("encoding must be a string");if("string"==typeof n&&!u.isEncoding(n))throw TypeError("Unknown encoding: "+n);if(1===t.length){var o,i=t.charCodeAt(0);("utf8"===n&&i<128||"latin1"===n)&&(t=i)}}else"number"==typeof t?t&=255:"boolean"==typeof t&&(t=Number(t));if(r<0||this.length<r||this.length<e)throw RangeError("Out of range index");if(e<=r)return this;if(r>>>=0,e=void 0===e?this.length:e>>>0,t||(t=0),"number"==typeof t)for(o=r;o<e;++o)this[o]=t;else{var f=u.isBuffer(t)?t:u.from(t,n),s=f.length;if(0===s)throw TypeError('The value "'+t+'" is invalid for argument "value"');for(o=0;o<e-r;++o)this[o+r]=f[o%s]}return this};var U=/[^+/0-9A-Za-z-_]/g;function T(t,r){r=r||1/0;for(var e,n=t.length,o=null,i=[],f=0;f<n;++f){if((e=t.charCodeAt(f))>55295&&e<57344){if(!o){if(e>56319||f+1===n){(r-=3)>-1&&i.push(239,191,189);continue}o=e;continue}if(e<56320){(r-=3)>-1&&i.push(239,191,189),o=e;continue}e=(o-55296<<10|e-56320)+65536}else o&&(r-=3)>-1&&i.push(239,191,189);if(o=null,e<128){if((r-=1)<0)break;i.push(e)}else if(e<2048){if((r-=2)<0)break;i.push(e>>6|192,63&e|128)}else if(e<65536){if((r-=3)<0)break;i.push(e>>12|224,e>>6&63|128,63&e|128)}else if(e<1114112){if((r-=4)<0)break;i.push(e>>18|240,e>>12&63|128,e>>6&63|128,63&e|128)}else throw Error("Invalid code point")}return i}function I(t){for(var r=[],e=0;e<t.length;++e)r.push(255&t.charCodeAt(e));return r}function C(t){return n.toByteArray(function(t){if((t=(t=t.split("=")[0]).trim().replace(U,"")).length<2)return"";for(;t.length%4!=0;)t+="=";return t}(t))}function S(t,r,e,n){for(var o=0;o<n&&!(o+e>=r.length)&&!(o>=t.length);++o)r[o+e]=t[o];return o}function L(t,r){return t instanceof r||null!=t&&null!=t.constructor&&null!=t.constructor.name&&t.constructor.name===r.name}var O=function(){for(var t="0123456789abcdef",r=Array(256),e=0;e<16;++e)for(var n=16*e,o=0;o<16;++o)r[n+o]=t[e]+t[o];return r}()},783:function(t,r){/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> */r.read=function(t,r,e,n,o){var i,f,u=8*o-n-1,s=(1<<u)-1,h=s>>1,a=-7,p=e?o-1:0,c=e?-1:1,l=t[r+p];for(p+=c,i=l&(1<<-a)-1,l>>=-a,a+=u;a>0;i=256*i+t[r+p],p+=c,a-=8);for(f=i&(1<<-a)-1,i>>=-a,a+=n;a>0;f=256*f+t[r+p],p+=c,a-=8);if(0===i)i=1-h;else{if(i===s)return f?NaN:1/0*(l?-1:1);f+=Math.pow(2,n),i-=h}return(l?-1:1)*f*Math.pow(2,i-n)},r.write=function(t,r,e,n,o,i){var f,u,s,h=8*i-o-1,a=(1<<h)-1,p=a>>1,c=23===o?5960464477539062e-23:0,l=n?0:i-1,y=n?1:-1,g=r<0||0===r&&1/r<0?1:0;for(isNaN(r=Math.abs(r))||r===1/0?(u=isNaN(r)?1:0,f=a):(f=Math.floor(Math.log(r)/Math.LN2),r*(s=Math.pow(2,-f))<1&&(f--,s*=2),f+p>=1?r+=c/s:r+=c*Math.pow(2,1-p),r*s>=2&&(f++,s/=2),f+p>=a?(u=0,f=a):f+p>=1?(u=(r*s-1)*Math.pow(2,o),f+=p):(u=r*Math.pow(2,p-1)*Math.pow(2,o),f=0));o>=8;t[e+l]=255&u,l+=y,u/=256,o-=8);for(f=f<<o|u,h+=o;h>0;t[e+l]=255&f,l+=y,f/=256,h-=8);t[e+l-y]|=128*g}}},e={};function n(t){var o=e[t];if(void 0!==o)return o.exports;var i=e[t]={exports:{}},f=!0;try{r[t](i,i.exports,n),f=!1}finally{f&&delete e[t]}return i.exports}n.ab="//";var o=n(72);t.exports=o}()}}]);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
_next/static/chunks/341.aebfdbdeb384a503.js
DELETED
The diff for this file is too large to render.
See raw diff
|
|
_next/static/chunks/360.47885073fb31529e.js
ADDED
The diff for this file is too large to render.
See raw diff
|
|
_next/static/chunks/{49ada614.cc7dff79d7281ee6.js β 50bd76a3.3d24d573e3ca7a71.js}
RENAMED
The diff for this file is too large to render.
See raw diff
|
|
_next/static/chunks/51-de6ec599ce154973.js
ADDED
@@ -0,0 +1 @@
|
|
|
|
|
1 |
+
"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[51],{912:function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"BailoutToCSR",{enumerable:!0,get:function(){return o}});let r=n(5592);function o(e){let{reason:t,children:n}=e;if("undefined"==typeof window)throw new r.BailoutToCSRError(t);return n}},1481:function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"PreloadCss",{enumerable:!0,get:function(){return i}});let r=n(7437),o=n(8512);function i(e){let{moduleIds:t}=e;if("undefined"!=typeof window)return null;let n=(0,o.getExpectedRequestStore)("next/dynamic css"),i=[];if(n.reactLoadableManifest&&t){let e=n.reactLoadableManifest;for(let n of t){if(!e[n])continue;let t=e[n].files.filter(e=>e.endsWith(".css"));i.push(...t)}}return 0===i.length?null:(0,r.jsx)(r.Fragment,{children:i.map(e=>(0,r.jsx)("link",{precedence:"dynamic",rel:"stylesheet",href:n.assetPrefix+"/_next/"+encodeURI(e),as:"style"},e))})}},943:function(e,t,n){let r,o,i,a,l,s,u,c,d,f,p,h,m,g;n.d(t,{V:function(){return eM}});var v,E,y,b=n(2265),w=n.t(b,2),S=n(9299),T=n(6584),O=n(8703);function R(e,t,n,r){let o=(0,O.E)(n);(0,b.useEffect)(()=>{function n(e){o.current(e)}return(e=null!=e?e:window).addEventListener(t,n,r),()=>e.removeEventListener(t,n,r)},[e,t,r])}var A=n(6400),C=n(8043);function P(e){let t=(0,T.z)(e),n=(0,b.useRef)(!1);(0,b.useEffect)(()=>(n.current=!1,()=>{n.current=!0,(0,C.Y)(()=>{n.current&&t()})}),[t])}var L=n(4462);function N(e){return L.O.isServer?null:e instanceof Node?e.ownerDocument:null!=e&&e.hasOwnProperty("current")&&e.current instanceof Node?e.current.ownerDocument:document}function F(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];return(0,b.useMemo)(()=>N(...t),[...t])}var x=n(3856),D=n(1469);function j(e,t,n){let r=(0,O.E)(t);(0,b.useEffect)(()=>{function t(e){r.current(e)}return window.addEventListener(e,t,n),()=>window.removeEventListener(e,t,n)},[e,n])}var k=((r=k||{})[r.Forwards=0]="Forwards",r[r.Backwards=1]="Backwards",r);function M(e,t){let n=(0,b.useRef)([]),r=(0,T.z)(e);(0,b.useEffect)(()=>{let e=[...n.current];for(let[o,i]of t.entries())if(n.current[o]!==i){let o=r(t,e);return n.current=t,o}},[r,...t])}var _=n(3600),U=((o=U||{})[o.None=1]="None",o[o.Focusable=2]="Focusable",o[o.Hidden=4]="Hidden",o);let B=(0,_.yV)(function(e,t){var n;let{features:r=1,...o}=e,i={ref:t,"aria-hidden":(2&r)==2||(null!=(n=o["aria-hidden"])?n:void 0),hidden:(4&r)==4||void 0,style:{position:"fixed",top:1,left:1,width:1,height:0,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0",...(4&r)==4&&(2&r)!=2&&{display:"none"}}};return(0,_.sY)({ourProps:i,theirProps:o,slot:{},defaultTag:"div",name:"Hidden"})}),H=[];!function(e){function t(){"loading"!==document.readyState&&(e(),document.removeEventListener("DOMContentLoaded",t))}"undefined"!=typeof window&&"undefined"!=typeof document&&(document.addEventListener("DOMContentLoaded",t),t())}(()=>{function e(e){e.target instanceof HTMLElement&&e.target!==document.body&&H[0]!==e.target&&(H.unshift(e.target),(H=H.filter(e=>null!=e&&e.isConnected)).splice(10))}window.addEventListener("click",e,{capture:!0}),window.addEventListener("mousedown",e,{capture:!0}),window.addEventListener("focus",e,{capture:!0}),document.body.addEventListener("click",e,{capture:!0}),document.body.addEventListener("mousedown",e,{capture:!0}),document.body.addEventListener("focus",e,{capture:!0})});var I=n(5583);let q=["[contentEditable=true]","[tabindex]","a[href]","area[href]","button:not([disabled])","iframe","input:not([disabled])","select:not([disabled])","textarea:not([disabled])"].map(e=>"".concat(e,":not([tabindex='-1'])")).join(",");var z=((i=z||{})[i.First=1]="First",i[i.Previous=2]="Previous",i[i.Next=4]="Next",i[i.Last=8]="Last",i[i.WrapAround=16]="WrapAround",i[i.NoScroll=32]="NoScroll",i),V=((a=V||{})[a.Error=0]="Error",a[a.Overflow=1]="Overflow",a[a.Success=2]="Success",a[a.Underflow=3]="Underflow",a),W=((l=W||{})[l.Previous=-1]="Previous",l[l.Next=1]="Next",l),Y=((s=Y||{})[s.Strict=0]="Strict",s[s.Loose=1]="Loose",s),J=((u=J||{})[u.Keyboard=0]="Keyboard",u[u.Mouse=1]="Mouse",u);function G(e){null==e||e.focus({preventScroll:!0})}function K(e,t){var n,r,o;let{sorted:i=!0,relativeTo:a=null,skipElements:l=[]}=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},s=Array.isArray(e)?e.length>0?e[0].ownerDocument:document:e.ownerDocument,u=Array.isArray(e)?i?function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:e=>e;return e.slice().sort((e,n)=>{let r=t(e),o=t(n);if(null===r||null===o)return 0;let i=r.compareDocumentPosition(o);return i&Node.DOCUMENT_POSITION_FOLLOWING?-1:i&Node.DOCUMENT_POSITION_PRECEDING?1:0})}(e):e:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:document.body;return null==e?[]:Array.from(e.querySelectorAll(q)).sort((e,t)=>Math.sign((e.tabIndex||Number.MAX_SAFE_INTEGER)-(t.tabIndex||Number.MAX_SAFE_INTEGER)))}(e);l.length>0&&u.length>1&&(u=u.filter(e=>!l.includes(e))),a=null!=a?a:s.activeElement;let c=(()=>{if(5&t)return 1;if(10&t)return -1;throw Error("Missing Focus.First, Focus.Previous, Focus.Next or Focus.Last")})(),d=(()=>{if(1&t)return 0;if(2&t)return Math.max(0,u.indexOf(a))-1;if(4&t)return Math.max(0,u.indexOf(a))+1;if(8&t)return u.length-1;throw Error("Missing Focus.First, Focus.Previous, Focus.Next or Focus.Last")})(),f=32&t?{preventScroll:!0}:{},p=0,h=u.length,m;do{if(p>=h||p+h<=0)return 0;let e=d+p;if(16&t)e=(e+h)%h;else{if(e<0)return 3;if(e>=h)return 1}null==(m=u[e])||m.focus(f),p+=c}while(m!==s.activeElement);return 6&t&&null!=(o=null==(r=null==(n=m)?void 0:n.matches)?void 0:r.call(n,"textarea,input"))&&o&&m.select(),2}function Z(e){if(!e)return new Set;if("function"==typeof e)return new Set(e());let t=new Set;for(let n of e.current)n.current instanceof HTMLElement&&t.add(n.current);return t}"undefined"!=typeof window&&"undefined"!=typeof document&&(document.addEventListener("keydown",e=>{e.metaKey||e.altKey||e.ctrlKey||(document.documentElement.dataset.headlessuiFocusVisible="")},!0),document.addEventListener("click",e=>{1===e.detail?delete document.documentElement.dataset.headlessuiFocusVisible:0===e.detail&&(document.documentElement.dataset.headlessuiFocusVisible="")},!0));var $=((c=$||{})[c.None=1]="None",c[c.InitialFocus=2]="InitialFocus",c[c.TabLock=4]="TabLock",c[c.FocusLock=8]="FocusLock",c[c.RestoreFocus=16]="RestoreFocus",c[c.All=30]="All",c);let X=Object.assign((0,_.yV)(function(e,t){let n,r=(0,b.useRef)(null),o=(0,D.T)(r,t),{initialFocus:i,containers:a,features:l=30,...s}=e;(0,x.H)()||(l=1);let u=F(r);!function(e,t){let{ownerDocument:n}=e,r=function(){let e=!(arguments.length>0)||void 0===arguments[0]||arguments[0],t=(0,b.useRef)(H.slice());return M((e,n)=>{let[r]=e,[o]=n;!0===o&&!1===r&&(0,C.Y)(()=>{t.current.splice(0)}),!1===o&&!0===r&&(t.current=H.slice())},[e,H,t]),(0,T.z)(()=>{var e;return null!=(e=t.current.find(e=>null!=e&&e.isConnected))?e:null})}(t);M(()=>{t||(null==n?void 0:n.activeElement)===(null==n?void 0:n.body)&&G(r())},[t]),P(()=>{t&&G(r())})}({ownerDocument:u},!!(16&l));let c=function(e,t){let{ownerDocument:n,container:r,initialFocus:o}=e,i=(0,b.useRef)(null),a=(0,A.t)();return M(()=>{if(!t)return;let e=r.current;e&&(0,C.Y)(()=>{if(!a.current)return;let t=null==n?void 0:n.activeElement;if(null!=o&&o.current){if((null==o?void 0:o.current)===t){i.current=t;return}}else if(e.contains(t)){i.current=t;return}null!=o&&o.current?G(o.current):K(e,z.First)===V.Error&&console.warn("There are no focusable elements inside the <FocusTrap />"),i.current=null==n?void 0:n.activeElement})},[t]),i}({ownerDocument:u,container:r,initialFocus:i},!!(2&l));!function(e,t){let{ownerDocument:n,container:r,containers:o,previousActiveElement:i}=e,a=(0,A.t)();R(null==n?void 0:n.defaultView,"focus",e=>{if(!t||!a.current)return;let n=Z(o);r.current instanceof HTMLElement&&n.add(r.current);let l=i.current;if(!l)return;let s=e.target;s&&s instanceof HTMLElement?Q(n,s)?(i.current=s,G(s)):(e.preventDefault(),e.stopPropagation(),G(l)):G(i.current)},!0)}({ownerDocument:u,container:r,containers:a,previousActiveElement:c},!!(8&l));let d=(n=(0,b.useRef)(0),j("keydown",e=>{"Tab"===e.key&&(n.current=e.shiftKey?1:0)},!0),n),f=(0,T.z)(e=>{let t=r.current;t&&(0,I.E)(d.current,{[k.Forwards]:()=>{K(t,z.First,{skipElements:[e.relatedTarget]})},[k.Backwards]:()=>{K(t,z.Last,{skipElements:[e.relatedTarget]})}})}),p=(0,S.G)(),h=(0,b.useRef)(!1);return b.createElement(b.Fragment,null,!!(4&l)&&b.createElement(B,{as:"button",type:"button","data-headlessui-focus-guard":!0,onFocus:f,features:U.Focusable}),(0,_.sY)({ourProps:{ref:o,onKeyDown(e){"Tab"==e.key&&(h.current=!0,p.requestAnimationFrame(()=>{h.current=!1}))},onBlur(e){let t=Z(a);r.current instanceof HTMLElement&&t.add(r.current);let n=e.relatedTarget;n instanceof HTMLElement&&"true"!==n.dataset.headlessuiFocusGuard&&(Q(t,n)||(h.current?K(r.current,(0,I.E)(d.current,{[k.Forwards]:()=>z.Next,[k.Backwards]:()=>z.Previous})|z.WrapAround,{relativeTo:e.target}):e.target instanceof HTMLElement&&G(e.target)))}},theirProps:s,defaultTag:"div",name:"FocusTrap"}),!!(4&l)&&b.createElement(B,{as:"button",type:"button","data-headlessui-focus-guard":!0,onFocus:f,features:U.Focusable}))}),{features:$});function Q(e,t){for(let n of e)if(n.contains(t))return!0;return!1}var ee=n(4887),et=n(1463);let en=(0,b.createContext)(!1);function er(e){return b.createElement(en.Provider,{value:e.force},e.children)}let eo=b.Fragment,ei=b.Fragment,ea=(0,b.createContext)(null),el=(0,b.createContext)(null),es=Object.assign((0,_.yV)(function(e,t){let n=(0,b.useRef)(null),r=(0,D.T)((0,D.h)(e=>{n.current=e}),t),o=F(n),i=function(e){let t=(0,b.useContext)(en),n=(0,b.useContext)(ea),r=F(e),[o,i]=(0,b.useState)(()=>{if(!t&&null!==n||L.O.isServer)return null;let e=null==r?void 0:r.getElementById("headlessui-portal-root");if(e)return e;if(null===r)return null;let o=r.createElement("div");return o.setAttribute("id","headlessui-portal-root"),r.body.appendChild(o)});return(0,b.useEffect)(()=>{null!==o&&(null!=r&&r.body.contains(o)||null==r||r.body.appendChild(o))},[o,r]),(0,b.useEffect)(()=>{t||null!==n&&i(n.current)},[n,i,t]),o}(n),[a]=(0,b.useState)(()=>{var e;return L.O.isServer?null:null!=(e=null==o?void 0:o.createElement("div"))?e:null}),l=(0,b.useContext)(el),s=(0,x.H)();return(0,et.e)(()=>{!i||!a||i.contains(a)||(a.setAttribute("data-headlessui-portal",""),i.appendChild(a))},[i,a]),(0,et.e)(()=>{if(a&&l)return l.register(a)},[l,a]),P(()=>{var e;i&&a&&(a instanceof Node&&i.contains(a)&&i.removeChild(a),i.childNodes.length<=0&&(null==(e=i.parentElement)||e.removeChild(i)))}),s&&i&&a?(0,ee.createPortal)((0,_.sY)({ourProps:{ref:r},theirProps:e,defaultTag:eo,name:"Portal"}),a):null}),{Group:(0,_.yV)(function(e,t){let{target:n,...r}=e,o={ref:(0,D.T)(t)};return b.createElement(ea.Provider,{value:n},(0,_.sY)({ourProps:o,theirProps:r,defaultTag:ei,name:"Popover.Group"}))})}),{useState:eu,useEffect:ec,useLayoutEffect:ed,useDebugValue:ef}=w;"undefined"!=typeof window&&void 0!==window.document&&window.document.createElement;let ep=w.useSyncExternalStore;var eh=n(777);function em(){return/iPhone/gi.test(window.navigator.platform)||/Mac/gi.test(window.navigator.platform)&&window.navigator.maxTouchPoints>0}let eg=(v=()=>new Map,E={PUSH(e,t){var n;let r=null!=(n=this.get(e))?n:{doc:e,count:0,d:(0,eh.k)(),meta:new Set};return r.count++,r.meta.add(t),this.set(e,r),this},POP(e,t){let n=this.get(e);return n&&(n.count--,n.meta.delete(t)),this},SCROLL_PREVENT(e){let t,{doc:n,d:r,meta:o}=e,i={doc:n,d:r,meta:function(e){let t={};for(let n of e)Object.assign(t,n(t));return t}(o)},a=[em()?{before(e){let{doc:t,d:n,meta:r}=e;function o(e){return r.containers.flatMap(e=>e()).some(t=>t.contains(e))}n.microTask(()=>{var e;if("auto"!==window.getComputedStyle(t.documentElement).scrollBehavior){let e=(0,eh.k)();e.style(t.documentElement,"scrollBehavior","auto"),n.add(()=>n.microTask(()=>e.dispose()))}let r=null!=(e=window.scrollY)?e:window.pageYOffset,i=null;n.addEventListener(t,"click",e=>{if(e.target instanceof HTMLElement)try{let n=e.target.closest("a");if(!n)return;let{hash:r}=new URL(n.href),a=t.querySelector(r);a&&!o(a)&&(i=a)}catch(e){}},!0),n.addEventListener(t,"touchstart",e=>{if(e.target instanceof HTMLElement){if(o(e.target)){let t=e.target;for(;t.parentElement&&o(t.parentElement);)t=t.parentElement;n.style(t,"overscrollBehavior","contain")}else n.style(e.target,"touchAction","none")}}),n.addEventListener(t,"touchmove",e=>{if(e.target instanceof HTMLElement){if(o(e.target)){let t=e.target;for(;t.parentElement&&""!==t.dataset.headlessuiPortal&&!(t.scrollHeight>t.clientHeight||t.scrollWidth>t.clientWidth);)t=t.parentElement;""===t.dataset.headlessuiPortal&&e.preventDefault()}else e.preventDefault()}},{passive:!1}),n.add(()=>{var e;r!==(null!=(e=window.scrollY)?e:window.pageYOffset)&&window.scrollTo(0,r),i&&i.isConnected&&(i.scrollIntoView({block:"nearest"}),i=null)})})}}:{},{before(e){var n;let{doc:r}=e,o=r.documentElement;t=(null!=(n=r.defaultView)?n:window).innerWidth-o.clientWidth},after(e){let{doc:n,d:r}=e,o=n.documentElement,i=o.clientWidth-o.offsetWidth,a=t-i;r.style(o,"paddingRight","".concat(a,"px"))}},{before(e){let{doc:t,d:n}=e;n.style(t.documentElement,"overflow","hidden")}}];a.forEach(e=>{let{before:t}=e;return null==t?void 0:t(i)}),a.forEach(e=>{let{after:t}=e;return null==t?void 0:t(i)})},SCROLL_ALLOW(e){let{d:t}=e;t.dispose()},TEARDOWN(e){let{doc:t}=e;this.delete(t)}},d=v(),f=new Set,{getSnapshot:()=>d,subscribe:e=>(f.add(e),()=>f.delete(e)),dispatch(e){for(var t=arguments.length,n=Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];let o=E[e].call(d,...n);o&&(d=o,f.forEach(e=>e()))}});eg.subscribe(()=>{let e=eg.getSnapshot(),t=new Map;for(let[n]of e)t.set(n,n.documentElement.style.overflow);for(let n of e.values()){let e="hidden"===t.get(n.doc),r=0!==n.count;(r&&!e||!r&&e)&&eg.dispatch(n.count>0?"SCROLL_PREVENT":"SCROLL_ALLOW",n),0===n.count&&eg.dispatch("TEARDOWN",n)}});let ev=null!=(y=b.useId)?y:function(){let e=(0,x.H)(),[t,n]=b.useState(e?()=>L.O.nextId():null);return(0,et.e)(()=>{null===t&&n(L.O.nextId())},[t]),null!=t?""+t:void 0},eE=new Map,ey=new Map;function eb(e){let t=!(arguments.length>1)||void 0===arguments[1]||arguments[1];(0,et.e)(()=>{var n;if(!t)return;let r="function"==typeof e?e():e.current;if(!r)return;let o=null!=(n=ey.get(r))?n:0;return ey.set(r,o+1),0!==o||(eE.set(r,{"aria-hidden":r.getAttribute("aria-hidden"),inert:r.inert}),r.setAttribute("aria-hidden","true"),r.inert=!0),function(){var e;if(!r)return;let t=null!=(e=ey.get(r))?e:1;if(1===t?ey.delete(r):ey.set(r,t-1),1!==t)return;let n=eE.get(r);n&&(null===n["aria-hidden"]?r.removeAttribute("aria-hidden"):r.setAttribute("aria-hidden",n["aria-hidden"]),r.inert=n.inert,eE.delete(r))}},[e,t])}function ew(e,t,n){let r=(0,O.E)(t);(0,b.useEffect)(()=>{function t(e){r.current(e)}return document.addEventListener(e,t,n),()=>document.removeEventListener(e,t,n)},[e,n])}var eS=n(3509);let eT=(0,b.createContext)(()=>{});eT.displayName="StackContext";var eO=((p=eO||{})[p.Add=0]="Add",p[p.Remove=1]="Remove",p);function eR(e){let{children:t,onUpdate:n,type:r,element:o,enabled:i}=e,a=(0,b.useContext)(eT),l=(0,T.z)(function(){for(var e=arguments.length,t=Array(e),r=0;r<e;r++)t[r]=arguments[r];null==n||n(...t),a(...t)});return(0,et.e)(()=>{let e=void 0===i||!0===i;return e&&l(0,r,o),()=>{e&&l(1,r,o)}},[l,r,o,i]),b.createElement(eT.Provider,{value:l},t)}let eA=(0,b.createContext)(null),eC=Object.assign((0,_.yV)(function(e,t){let n=ev(),{id:r="headlessui-description-".concat(n),...o}=e,i=function e(){let t=(0,b.useContext)(eA);if(null===t){let t=Error("You used a <Description /> component, but it is not inside a relevant parent.");throw Error.captureStackTrace&&Error.captureStackTrace(t,e),t}return t}(),a=(0,D.T)(t);(0,et.e)(()=>i.register(r),[r,i.register]);let l={ref:a,...i.props,id:r};return(0,_.sY)({ourProps:l,theirProps:o,slot:i.slot||{},defaultTag:"p",name:i.name||"Description"})}),{});var eP=((h=eP||{}).Space=" ",h.Enter="Enter",h.Escape="Escape",h.Backspace="Backspace",h.Delete="Delete",h.ArrowLeft="ArrowLeft",h.ArrowUp="ArrowUp",h.ArrowRight="ArrowRight",h.ArrowDown="ArrowDown",h.Home="Home",h.End="End",h.PageUp="PageUp",h.PageDown="PageDown",h.Tab="Tab",h),eL=((m=eL||{})[m.Open=0]="Open",m[m.Closed=1]="Closed",m),eN=((g=eN||{})[g.SetTitleId=0]="SetTitleId",g);let eF={0:(e,t)=>e.titleId===t.id?e:{...e,titleId:t.id}},ex=(0,b.createContext)(null);function eD(e){let t=(0,b.useContext)(ex);if(null===t){let t=Error("<".concat(e," /> is missing a parent <Dialog /> component."));throw Error.captureStackTrace&&Error.captureStackTrace(t,eD),t}return t}function ej(e,t){return(0,I.E)(t.type,eF,e,t)}ex.displayName="DialogContext";let ek=_.AN.RenderStrategy|_.AN.Static,eM=Object.assign((0,_.yV)(function(e,t){let n,r,o,i,a,l=ev(),{id:s="headlessui-dialog-".concat(l),open:u,onClose:c,initialFocus:d,role:f="dialog",__demoMode:p=!1,...h}=e,[m,g]=(0,b.useState)(0),v=(0,b.useRef)(!1);f="dialog"===f||"alertdialog"===f?f:(v.current||(v.current=!0,console.warn("Invalid role [".concat(f,"] passed to <Dialog />. Only `dialog` and and `alertdialog` are supported. Using `dialog` instead."))),"dialog");let E=(0,eS.oJ)();void 0===u&&null!==E&&(u=(E&eS.ZM.Open)===eS.ZM.Open);let y=(0,b.useRef)(null),w=(0,D.T)(y,t),S=F(y),O=e.hasOwnProperty("open")||null!==E,A=e.hasOwnProperty("onClose");if(!O&&!A)throw Error("You have to provide an `open` and an `onClose` prop to the `Dialog` component.");if(!O)throw Error("You provided an `onClose` prop to the `Dialog`, but forgot an `open` prop.");if(!A)throw Error("You provided an `open` prop to the `Dialog`, but forgot an `onClose` prop.");if("boolean"!=typeof u)throw Error("You provided an `open` prop to the `Dialog`, but the value is not a boolean. Received: ".concat(u));if("function"!=typeof c)throw Error("You provided an `onClose` prop to the `Dialog`, but the value is not a function. Received: ".concat(c));let C=u?0:1,[P,L]=(0,b.useReducer)(ej,{titleId:null,descriptionId:null,panelRef:(0,b.createRef)()}),k=(0,T.z)(()=>c(!1)),M=(0,T.z)(e=>L({type:0,id:e})),H=!!(0,x.H)()&&!p&&0===C,z=m>1,V=null!==(0,b.useContext)(ex),[W,J]=(n=(0,b.useContext)(el),r=(0,b.useRef)([]),o=(0,T.z)(e=>(r.current.push(e),n&&n.register(e),()=>i(e))),i=(0,T.z)(e=>{let t=r.current.indexOf(e);-1!==t&&r.current.splice(t,1),n&&n.unregister(e)}),a=(0,b.useMemo)(()=>({register:o,unregister:i,portals:r}),[o,i,r]),[r,(0,b.useMemo)(()=>function(e){let{children:t}=e;return b.createElement(el.Provider,{value:a},t)},[a])]),{resolveContainers:G,mainTreeNodeRef:K,MainTreeNode:Z}=function(){var e;let{defaultContainers:t=[],portals:n,mainTreeNodeRef:r}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},o=(0,b.useRef)(null!=(e=null==r?void 0:r.current)?e:null),i=F(o),a=(0,T.z)(()=>{var e,r,a;let l=[];for(let e of t)null!==e&&(e instanceof HTMLElement?l.push(e):"current"in e&&e.current instanceof HTMLElement&&l.push(e.current));if(null!=n&&n.current)for(let e of n.current)l.push(e);for(let t of null!=(e=null==i?void 0:i.querySelectorAll("html > *, body > *"))?e:[])t!==document.body&&t!==document.head&&t instanceof HTMLElement&&"headlessui-portal-root"!==t.id&&(t.contains(o.current)||t.contains(null==(a=null==(r=o.current)?void 0:r.getRootNode())?void 0:a.host)||l.some(e=>t.contains(e))||l.push(t));return l});return{resolveContainers:a,contains:(0,T.z)(e=>a().some(t=>t.contains(e))),mainTreeNodeRef:o,MainTreeNode:(0,b.useMemo)(()=>function(){return null!=r?null:b.createElement(B,{features:U.Hidden,ref:o})},[o,r])}}({portals:W,defaultContainers:[{get current(){var $;return null!=($=P.panelRef.current)?$:y.current}}]}),Q=null!==E&&(E&eS.ZM.Closing)===eS.ZM.Closing,ee=!V&&!Q&&H;eb((0,b.useCallback)(()=>{var e,t;return null!=(t=Array.from(null!=(e=null==S?void 0:S.querySelectorAll("body > *"))?e:[]).find(e=>"headlessui-portal-root"!==e.id&&e.contains(K.current)&&e instanceof HTMLElement))?t:null},[K]),ee);let en=!!z||H;eb((0,b.useCallback)(()=>{var e,t;return null!=(t=Array.from(null!=(e=null==S?void 0:S.querySelectorAll("[data-headlessui-portal]"))?e:[]).find(e=>e.contains(K.current)&&e instanceof HTMLElement))?t:null},[K]),en),function(e,t){let n=!(arguments.length>2)||void 0===arguments[2]||arguments[2],r=(0,b.useRef)(!1);function o(n,o){if(!r.current||n.defaultPrevented)return;let i=o(n);if(null!==i&&i.getRootNode().contains(i)&&i.isConnected){for(let t of function e(t){return"function"==typeof t?e(t()):Array.isArray(t)||t instanceof Set?t:[t]}(e)){if(null===t)continue;let e=t instanceof HTMLElement?t:t.current;if(null!=e&&e.contains(i)||n.composed&&n.composedPath().includes(e))return}return!function(e){var t;let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return e!==(null==(t=N(e))?void 0:t.body)&&(0,I.E)(n,{0:()=>e.matches(q),1(){let t=e;for(;null!==t;){if(t.matches(q))return!0;t=t.parentElement}return!1}})}(i,Y.Loose)&&-1!==i.tabIndex&&n.preventDefault(),t(n,i)}}(0,b.useEffect)(()=>{requestAnimationFrame(()=>{r.current=n})},[n]);let i=(0,b.useRef)(null);ew("pointerdown",e=>{var t,n;r.current&&(i.current=(null==(n=null==(t=e.composedPath)?void 0:t.call(e))?void 0:n[0])||e.target)},!0),ew("mousedown",e=>{var t,n;r.current&&(i.current=(null==(n=null==(t=e.composedPath)?void 0:t.call(e))?void 0:n[0])||e.target)},!0),ew("click",e=>{em()||/Android/gi.test(window.navigator.userAgent)||i.current&&(o(e,()=>i.current),i.current=null)},!0),ew("touchend",e=>o(e,()=>e.target instanceof HTMLElement?e.target:null),!0),j("blur",e=>o(e,()=>window.document.activeElement instanceof HTMLIFrameElement?window.document.activeElement:null),!0)}(G,e=>{e.preventDefault(),k()},!(!H||z));let eo=!(z||0!==C);R(null==S?void 0:S.defaultView,"keydown",e=>{eo&&(e.defaultPrevented||e.key===eP.Escape&&(e.preventDefault(),e.stopPropagation(),k()))}),function(e,t){var n;let r,o,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:()=>[document.body];n=e=>{var t;return{containers:[...null!=(t=e.containers)?t:[],i]}},r=ep(eg.subscribe,eg.getSnapshot,eg.getSnapshot),(o=e?r.get(e):void 0)&&o.count,(0,et.e)(()=>{if(!(!e||!t))return eg.dispatch("PUSH",e,n),()=>eg.dispatch("POP",e,n)},[t,e])}(S,!(Q||0!==C||V),G),(0,b.useEffect)(()=>{if(0!==C||!y.current)return;let e=new ResizeObserver(e=>{for(let t of e){let e=t.target.getBoundingClientRect();0===e.x&&0===e.y&&0===e.width&&0===e.height&&k()}});return e.observe(y.current),()=>e.disconnect()},[C,y,k]);let[ei,ea]=function(){let[e,t]=(0,b.useState)([]);return[e.length>0?e.join(" "):void 0,(0,b.useMemo)(()=>function(e){let n=(0,T.z)(e=>(t(t=>[...t,e]),()=>t(t=>{let n=t.slice(),r=n.indexOf(e);return -1!==r&&n.splice(r,1),n}))),r=(0,b.useMemo)(()=>({register:n,slot:e.slot,name:e.name,props:e.props}),[n,e.slot,e.name,e.props]);return b.createElement(eA.Provider,{value:r},e.children)},[t])]}(),eu=(0,b.useMemo)(()=>[{dialogState:C,close:k,setTitleId:M},P],[C,P,k,M]),ec=(0,b.useMemo)(()=>({open:0===C}),[C]),ed={ref:w,id:s,role:f,"aria-modal":0===C||void 0,"aria-labelledby":P.titleId,"aria-describedby":ei};return b.createElement(eR,{type:"Dialog",enabled:0===C,element:y,onUpdate:(0,T.z)((e,t)=>{"Dialog"===t&&(0,I.E)(e,{[eO.Add]:()=>g(e=>e+1),[eO.Remove]:()=>g(e=>e-1)})})},b.createElement(er,{force:!0},b.createElement(es,null,b.createElement(ex.Provider,{value:eu},b.createElement(es.Group,{target:y},b.createElement(er,{force:!1},b.createElement(ea,{slot:ec,name:"Dialog.Description"},b.createElement(X,{initialFocus:d,containers:G,features:H?(0,I.E)(z?"parent":"leaf",{parent:X.features.RestoreFocus,leaf:X.features.All&~X.features.FocusLock}):X.features.None},b.createElement(J,null,(0,_.sY)({ourProps:ed,theirProps:h,slot:ec,defaultTag:"div",features:ek,visible:0===C,name:"Dialog"}))))))))),b.createElement(Z,null))}),{Backdrop:(0,_.yV)(function(e,t){let n=ev(),{id:r="headlessui-dialog-backdrop-".concat(n),...o}=e,[{dialogState:i},a]=eD("Dialog.Backdrop"),l=(0,D.T)(t);(0,b.useEffect)(()=>{if(null===a.panelRef.current)throw Error("A <Dialog.Backdrop /> component is being used, but a <Dialog.Panel /> component is missing.")},[a.panelRef]);let s=(0,b.useMemo)(()=>({open:0===i}),[i]);return b.createElement(er,{force:!0},b.createElement(es,null,(0,_.sY)({ourProps:{ref:l,id:r,"aria-hidden":!0},theirProps:o,slot:s,defaultTag:"div",name:"Dialog.Backdrop"})))}),Panel:(0,_.yV)(function(e,t){let n=ev(),{id:r="headlessui-dialog-panel-".concat(n),...o}=e,[{dialogState:i},a]=eD("Dialog.Panel"),l=(0,D.T)(t,a.panelRef),s=(0,b.useMemo)(()=>({open:0===i}),[i]),u=(0,T.z)(e=>{e.stopPropagation()});return(0,_.sY)({ourProps:{ref:l,id:r,onClick:u},theirProps:o,slot:s,defaultTag:"div",name:"Dialog.Panel"})}),Overlay:(0,_.yV)(function(e,t){let n=ev(),{id:r="headlessui-dialog-overlay-".concat(n),...o}=e,[{dialogState:i,close:a}]=eD("Dialog.Overlay"),l=(0,D.T)(t),s=(0,T.z)(e=>{if(e.target===e.currentTarget){if(function(e){let t=e.parentElement,n=null;for(;t&&!(t instanceof HTMLFieldSetElement);)t instanceof HTMLLegendElement&&(n=t),t=t.parentElement;let r=(null==t?void 0:t.getAttribute("disabled"))==="";return!(r&&function(e){if(!e)return!1;let t=e.previousElementSibling;for(;null!==t;){if(t instanceof HTMLLegendElement)return!1;t=t.previousElementSibling}return!0}(n))&&r}(e.currentTarget))return e.preventDefault();e.preventDefault(),e.stopPropagation(),a()}}),u=(0,b.useMemo)(()=>({open:0===i}),[i]);return(0,_.sY)({ourProps:{ref:l,id:r,"aria-hidden":!0,onClick:s},theirProps:o,slot:u,defaultTag:"div",name:"Dialog.Overlay"})}),Title:(0,_.yV)(function(e,t){let n=ev(),{id:r="headlessui-dialog-title-".concat(n),...o}=e,[{dialogState:i,setTitleId:a}]=eD("Dialog.Title"),l=(0,D.T)(t);(0,b.useEffect)(()=>(a(r),()=>a(null)),[r,a]);let s=(0,b.useMemo)(()=>({open:0===i}),[i]);return(0,_.sY)({ourProps:{ref:l,id:r},theirProps:o,slot:s,defaultTag:"h2",name:"Dialog.Title"})}),Description:eC})},9226:function(e,t,n){let r;n.d(t,{u:function(){return x}});var o=n(2265),i=n(9299),a=n(6584),l=n(6400),s=n(1463),u=n(8703),c=n(3856),d=n(1469),f=n(777),p=n(5583);function h(e){for(var t=arguments.length,n=Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];e&&n.length>0&&e.classList.add(...n)}function m(e){for(var t=arguments.length,n=Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];e&&n.length>0&&e.classList.remove(...n)}var g=n(3509),v=n(2585),E=n(3600);function y(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return e.split(/\s+/).filter(e=>e.length>1)}let b=(0,o.createContext)(null);b.displayName="TransitionContext";var w=((r=w||{}).Visible="visible",r.Hidden="hidden",r);let S=(0,o.createContext)(null);function T(e){return"children"in e?T(e.children):e.current.filter(e=>{let{el:t}=e;return null!==t.current}).filter(e=>{let{state:t}=e;return"visible"===t}).length>0}function O(e,t){let n=(0,u.E)(e),r=(0,o.useRef)([]),s=(0,l.t)(),c=(0,i.G)(),d=(0,a.z)(function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:E.l4.Hidden,o=r.current.findIndex(t=>{let{el:n}=t;return n===e});-1!==o&&((0,p.E)(t,{[E.l4.Unmount](){r.current.splice(o,1)},[E.l4.Hidden](){r.current[o].state="hidden"}}),c.microTask(()=>{var e;!T(r)&&s.current&&(null==(e=n.current)||e.call(n))}))}),f=(0,a.z)(e=>{let t=r.current.find(t=>{let{el:n}=t;return n===e});return t?"visible"!==t.state&&(t.state="visible"):r.current.push({el:e,state:"visible"}),()=>d(e,E.l4.Unmount)}),h=(0,o.useRef)([]),m=(0,o.useRef)(Promise.resolve()),g=(0,o.useRef)({enter:[],leave:[],idle:[]}),v=(0,a.z)((e,n,r)=>{h.current.splice(0),t&&(t.chains.current[n]=t.chains.current[n].filter(t=>{let[n]=t;return n!==e})),null==t||t.chains.current[n].push([e,new Promise(e=>{h.current.push(e)})]),null==t||t.chains.current[n].push([e,new Promise(e=>{Promise.all(g.current[n].map(e=>{let[t,n]=e;return n})).then(()=>e())})]),"enter"===n?m.current=m.current.then(()=>null==t?void 0:t.wait.current).then(()=>r(n)):r(n)}),y=(0,a.z)((e,t,n)=>{Promise.all(g.current[t].splice(0).map(e=>{let[t,n]=e;return n})).then(()=>{var e;null==(e=h.current.shift())||e()}).then(()=>n(t))});return(0,o.useMemo)(()=>({children:r,register:f,unregister:d,onStart:v,onStop:y,wait:m,chains:g}),[f,d,r,v,y,g,m])}function R(){}S.displayName="NestingContext";let A=["beforeEnter","afterEnter","beforeLeave","afterLeave"];function C(e){var t;let n={};for(let r of A)n[r]=null!=(t=e[r])?t:R;return n}let P=E.AN.RenderStrategy,L=(0,E.yV)(function(e,t){let{show:n,appear:r=!1,unmount:i=!0,...l}=e,u=(0,o.useRef)(null),f=(0,d.T)(u,t);(0,c.H)();let p=(0,g.oJ)();if(void 0===n&&null!==p&&(n=(p&g.ZM.Open)===g.ZM.Open),![!0,!1].includes(n))throw Error("A <Transition /> is used but it is missing a `show={true | false}` prop.");let[h,m]=(0,o.useState)(n?"visible":"hidden"),v=O(()=>{m("hidden")}),[y,w]=(0,o.useState)(!0),R=(0,o.useRef)([n]);(0,s.e)(()=>{!1!==y&&R.current[R.current.length-1]!==n&&(R.current.push(n),w(!1))},[R,n]);let A=(0,o.useMemo)(()=>({show:n,appear:r,initial:y}),[n,r,y]);(0,o.useEffect)(()=>{if(n)m("visible");else if(T(v)){let e=u.current;if(!e)return;let t=e.getBoundingClientRect();0===t.x&&0===t.y&&0===t.width&&0===t.height&&m("hidden")}else m("hidden")},[n,v]);let C={unmount:i},L=(0,a.z)(()=>{var t;y&&w(!1),null==(t=e.beforeEnter)||t.call(e)}),F=(0,a.z)(()=>{var t;y&&w(!1),null==(t=e.beforeLeave)||t.call(e)});return o.createElement(S.Provider,{value:v},o.createElement(b.Provider,{value:A},(0,E.sY)({ourProps:{...C,as:o.Fragment,children:o.createElement(N,{ref:f,...C,...l,beforeEnter:L,beforeLeave:F})},theirProps:{},defaultTag:o.Fragment,features:P,visible:"visible"===h,name:"Transition"})))}),N=(0,E.yV)(function(e,t){var n,r,w;let R;let{beforeEnter:A,afterEnter:L,beforeLeave:N,afterLeave:F,enter:x,enterFrom:D,enterTo:j,entered:k,leave:M,leaveFrom:_,leaveTo:U,...B}=e,H=(0,o.useRef)(null),I=(0,d.T)(H,t),q=null==(n=B.unmount)||n?E.l4.Unmount:E.l4.Hidden,{show:z,appear:V,initial:W}=function(){let e=(0,o.useContext)(b);if(null===e)throw Error("A <Transition.Child /> is used but it is missing a parent <Transition /> or <Transition.Root />.");return e}(),[Y,J]=(0,o.useState)(z?"visible":"hidden"),G=function(){let e=(0,o.useContext)(S);if(null===e)throw Error("A <Transition.Child /> is used but it is missing a parent <Transition /> or <Transition.Root />.");return e}(),{register:K,unregister:Z}=G;(0,o.useEffect)(()=>K(H),[K,H]),(0,o.useEffect)(()=>{if(q===E.l4.Hidden&&H.current){if(z&&"visible"!==Y){J("visible");return}return(0,p.E)(Y,{hidden:()=>Z(H),visible:()=>K(H)})}},[Y,H,K,Z,z,q]);let $=(0,u.E)({base:y(B.className),enter:y(x),enterFrom:y(D),enterTo:y(j),entered:y(k),leave:y(M),leaveFrom:y(_),leaveTo:y(U)}),X=(w={beforeEnter:A,afterEnter:L,beforeLeave:N,afterLeave:F},R=(0,o.useRef)(C(w)),(0,o.useEffect)(()=>{R.current=C(w)},[w]),R),Q=(0,c.H)();(0,o.useEffect)(()=>{if(Q&&"visible"===Y&&null===H.current)throw Error("Did you forget to passthrough the `ref` to the actual DOM node?")},[H,Y,Q]);let ee=V&&z&&W,et=Q&&(!W||V)?z?"enter":"leave":"idle",en=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,[t,n]=(0,o.useState)(e),r=(0,l.t)(),i=(0,o.useCallback)(e=>{r.current&&n(t=>t|e)},[t,r]),a=(0,o.useCallback)(e=>!!(t&e),[t]);return{flags:t,addFlag:i,hasFlag:a,removeFlag:(0,o.useCallback)(e=>{r.current&&n(t=>t&~e)},[n,r]),toggleFlag:(0,o.useCallback)(e=>{r.current&&n(t=>t^e)},[n])}}(0),er=(0,a.z)(e=>(0,p.E)(e,{enter:()=>{en.addFlag(g.ZM.Opening),X.current.beforeEnter()},leave:()=>{en.addFlag(g.ZM.Closing),X.current.beforeLeave()},idle:()=>{}})),eo=(0,a.z)(e=>(0,p.E)(e,{enter:()=>{en.removeFlag(g.ZM.Opening),X.current.afterEnter()},leave:()=>{en.removeFlag(g.ZM.Closing),X.current.afterLeave()},idle:()=>{}})),ei=O(()=>{J("hidden"),Z(H)},G),ea=(0,o.useRef)(!1);!function(e){let{immediate:t,container:n,direction:r,classes:o,onStart:a,onStop:c}=e,d=(0,l.t)(),g=(0,i.G)(),v=(0,u.E)(r);(0,s.e)(()=>{t&&(v.current="enter")},[t]),(0,s.e)(()=>{let e=(0,f.k)();g.add(e.dispose);let t=n.current;if(t&&"idle"!==v.current&&d.current){var r,i,l;let n,s,u,d,g,E,y;return e.dispose(),a.current(v.current),e.add((r=o.current,i="enter"===v.current,l=()=>{e.dispose(),c.current(v.current)},s=i?"enter":"leave",u=(0,f.k)(),d=void 0!==l?(n={called:!1},function(){for(var e=arguments.length,t=Array(e),r=0;r<e;r++)t[r]=arguments[r];if(!n.called)return n.called=!0,l(...t)}):()=>{},"enter"===s&&(t.removeAttribute("hidden"),t.style.display=""),g=(0,p.E)(s,{enter:()=>r.enter,leave:()=>r.leave}),E=(0,p.E)(s,{enter:()=>r.enterTo,leave:()=>r.leaveTo}),y=(0,p.E)(s,{enter:()=>r.enterFrom,leave:()=>r.leaveFrom}),m(t,...r.base,...r.enter,...r.enterTo,...r.enterFrom,...r.leave,...r.leaveFrom,...r.leaveTo,...r.entered),h(t,...r.base,...g,...y),u.nextFrame(()=>{m(t,...r.base,...g,...y),h(t,...r.base,...g,...E),function(e,t){let n=(0,f.k)();if(!e)return n.dispose;let{transitionDuration:r,transitionDelay:o}=getComputedStyle(e),[i,a]=[r,o].map(e=>{let[t=0]=e.split(",").filter(Boolean).map(e=>e.includes("ms")?parseFloat(e):1e3*parseFloat(e)).sort((e,t)=>t-e);return t}),l=i+a;if(0!==l){n.group(n=>{n.setTimeout(()=>{t(),n.dispose()},l),n.addEventListener(e,"transitionrun",e=>{e.target===e.currentTarget&&n.dispose()})});let r=n.addEventListener(e,"transitionend",e=>{e.target===e.currentTarget&&(t(),r())})}else t();n.add(()=>t()),n.dispose}(t,()=>(m(t,...r.base,...g),h(t,...r.base,...r.entered),d()))}),u.dispose)),e.dispose}},[r])}({immediate:ee,container:H,classes:$,direction:et,onStart:(0,u.E)(e=>{ea.current=!0,ei.onStart(H,e,er)}),onStop:(0,u.E)(e=>{ea.current=!1,ei.onStop(H,e,eo),"leave"!==e||T(ei)||(J("hidden"),Z(H))})});let el=B;return ee?el={...el,className:(0,v.A)(B.className,...$.current.enter,...$.current.enterFrom)}:ea.current&&(el.className=(0,v.A)(B.className,null==(r=H.current)?void 0:r.className),""===el.className&&delete el.className),o.createElement(S.Provider,{value:ei},o.createElement(g.up,{value:(0,p.E)(Y,{visible:g.ZM.Open,hidden:g.ZM.Closed})|en.flags},(0,E.sY)({ourProps:{ref:I},theirProps:el,defaultTag:"div",features:P,visible:"visible"===Y,name:"Transition.Child"})))}),F=(0,E.yV)(function(e,t){let n=null!==(0,o.useContext)(b),r=null!==(0,g.oJ)();return o.createElement(o.Fragment,null,!n&&r?o.createElement(L,{ref:t,...e}):o.createElement(N,{ref:t,...e}))}),x=Object.assign(L,{Child:F,Root:L})},9299:function(e,t,n){n.d(t,{G:function(){return i}});var r=n(2265),o=n(777);function i(){let[e]=(0,r.useState)(o.k);return(0,r.useEffect)(()=>()=>e.dispose(),[e]),e}},6584:function(e,t,n){n.d(t,{z:function(){return i}});var r=n(2265),o=n(8703);let i=function(e){let t=(0,o.E)(e);return r.useCallback(function(){for(var e=arguments.length,n=Array(e),r=0;r<e;r++)n[r]=arguments[r];return t.current(...n)},[t])}},6400:function(e,t,n){n.d(t,{t:function(){return i}});var r=n(2265),o=n(1463);function i(){let e=(0,r.useRef)(!1);return(0,o.e)(()=>(e.current=!0,()=>{e.current=!1}),[]),e}},1463:function(e,t,n){n.d(t,{e:function(){return i}});var r=n(2265),o=n(4462);let i=(e,t)=>{o.O.isServer?(0,r.useEffect)(e,t):(0,r.useLayoutEffect)(e,t)}},8703:function(e,t,n){n.d(t,{E:function(){return i}});var r=n(2265),o=n(1463);function i(e){let t=(0,r.useRef)(e);return(0,o.e)(()=>{t.current=e},[e]),t}},3856:function(e,t,n){n.d(t,{H:function(){return a}});var r,o=n(2265),i=n(4462);function a(){let e;let t=(e="undefined"==typeof document,(0,(r||(r=n.t(o,2))).useSyncExternalStore)(()=>()=>{},()=>!1,()=>!e)),[a,l]=o.useState(i.O.isHandoffComplete);return a&&!1===i.O.isHandoffComplete&&l(!1),o.useEffect(()=>{!0!==a&&l(!0)},[a]),o.useEffect(()=>i.O.handoff(),[]),!t&&a}},1469:function(e,t,n){n.d(t,{T:function(){return l},h:function(){return a}});var r=n(2265),o=n(6584);let i=Symbol();function a(e){let t=!(arguments.length>1)||void 0===arguments[1]||arguments[1];return Object.assign(e,{[i]:t})}function l(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];let a=(0,r.useRef)(t);(0,r.useEffect)(()=>{a.current=t},[t]);let l=(0,o.z)(e=>{for(let t of a.current)null!=t&&("function"==typeof t?t(e):t.current=e)});return t.every(e=>null==e||(null==e?void 0:e[i]))?void 0:l}},3509:function(e,t,n){let r;n.d(t,{ZM:function(){return a},oJ:function(){return l},up:function(){return s}});var o=n(2265);let i=(0,o.createContext)(null);i.displayName="OpenClosedContext";var a=((r=a||{})[r.Open=1]="Open",r[r.Closed=2]="Closed",r[r.Closing=4]="Closing",r[r.Opening=8]="Opening",r);function l(){return(0,o.useContext)(i)}function s(e){let{value:t,children:n}=e;return o.createElement(i.Provider,{value:t},n)}},2585:function(e,t,n){n.d(t,{A:function(){return r}});function r(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];return Array.from(new Set(t.flatMap(e=>"string"==typeof e?e.split(" "):[]))).filter(Boolean).join(" ")}},777:function(e,t,n){n.d(t,{k:function(){return function e(){let t=[],n={addEventListener:(e,t,r,o)=>(e.addEventListener(t,r,o),n.add(()=>e.removeEventListener(t,r,o))),requestAnimationFrame(){for(var e=arguments.length,t=Array(e),r=0;r<e;r++)t[r]=arguments[r];let o=requestAnimationFrame(...t);return n.add(()=>cancelAnimationFrame(o))},nextFrame(){for(var e=arguments.length,t=Array(e),r=0;r<e;r++)t[r]=arguments[r];return n.requestAnimationFrame(()=>n.requestAnimationFrame(...t))},setTimeout(){for(var e=arguments.length,t=Array(e),r=0;r<e;r++)t[r]=arguments[r];let o=setTimeout(...t);return n.add(()=>clearTimeout(o))},microTask(){for(var e=arguments.length,t=Array(e),o=0;o<e;o++)t[o]=arguments[o];let i={current:!0};return(0,r.Y)(()=>{i.current&&t[0]()}),n.add(()=>{i.current=!1})},style(e,t,n){let r=e.style.getPropertyValue(t);return Object.assign(e.style,{[t]:n}),this.add(()=>{Object.assign(e.style,{[t]:r})})},group(t){let n=e();return t(n),this.add(()=>n.dispose())},add:e=>(t.push(e),()=>{let n=t.indexOf(e);if(n>=0)for(let e of t.splice(n,1))e()}),dispose(){for(let e of t.splice(0))e()}};return n}}});var r=n(8043)},4462:function(e,t,n){n.d(t,{O:function(){return l}});var r=Object.defineProperty,o=(e,t,n)=>t in e?r(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,i=(e,t,n)=>(o(e,"symbol"!=typeof t?t+"":t,n),n);class a{set(e){this.current!==e&&(this.handoffState="pending",this.currentId=0,this.current=e)}reset(){this.set(this.detect())}nextId(){return++this.currentId}get isServer(){return"server"===this.current}get isClient(){return"client"===this.current}detect(){return"undefined"==typeof window||"undefined"==typeof document?"server":"client"}handoff(){"pending"===this.handoffState&&(this.handoffState="complete")}get isHandoffComplete(){return"complete"===this.handoffState}constructor(){i(this,"current",this.detect()),i(this,"handoffState","pending"),i(this,"currentId",0)}}let l=new a},5583:function(e,t,n){n.d(t,{E:function(){return r}});function r(e,t){for(var n=arguments.length,o=Array(n>2?n-2:0),i=2;i<n;i++)o[i-2]=arguments[i];if(e in t){let n=t[e];return"function"==typeof n?n(...o):n}let a=Error('Tried to handle "'.concat(e,'" but there is no handler defined. Only defined handlers are: ').concat(Object.keys(t).map(e=>'"'.concat(e,'"')).join(", "),"."));throw Error.captureStackTrace&&Error.captureStackTrace(a,r),a}},8043:function(e,t,n){n.d(t,{Y:function(){return r}});function r(e){"function"==typeof queueMicrotask?queueMicrotask(e):Promise.resolve().then(e).catch(e=>setTimeout(()=>{throw e}))}},3600:function(e,t,n){let r,o;n.d(t,{AN:function(){return s},l4:function(){return u},sY:function(){return c},yV:function(){return h}});var i=n(2265),a=n(2585),l=n(5583),s=((r=s||{})[r.None=0]="None",r[r.RenderStrategy=1]="RenderStrategy",r[r.Static=2]="Static",r),u=((o=u||{})[o.Unmount=0]="Unmount",o[o.Hidden=1]="Hidden",o);function c(e){let{ourProps:t,theirProps:n,slot:r,defaultTag:o,features:i,visible:a=!0,name:s,mergeRefs:u}=e;u=null!=u?u:f;let c=p(n,t);if(a)return d(c,r,o,s,u);let h=null!=i?i:0;if(2&h){let{static:e=!1,...t}=c;if(e)return d(t,r,o,s,u)}if(1&h){let{unmount:e=!0,...t}=c;return(0,l.E)(e?0:1,{0:()=>null,1:()=>d({...t,hidden:!0,style:{display:"none"}},r,o,s,u)})}return d(c,r,o,s,u)}function d(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2?arguments[2]:void 0,r=arguments.length>3?arguments[3]:void 0,o=arguments.length>4?arguments[4]:void 0,{as:l=n,children:s,refName:u="ref",...c}=g(e,["unmount","static"]),d=void 0!==e.ref?{[u]:e.ref}:{},f="function"==typeof s?s(t):s;"className"in c&&c.className&&"function"==typeof c.className&&(c.className=c.className(t));let h={};if(t){let e=!1,n=[];for(let[r,o]of Object.entries(t))"boolean"==typeof o&&(e=!0),!0===o&&n.push(r);e&&(h["data-headlessui-state"]=n.join(" "))}if(l===i.Fragment&&Object.keys(m(c)).length>0){if(!(0,i.isValidElement)(f)||Array.isArray(f)&&f.length>1)throw Error(['Passing props on "Fragment"!',"","The current component <".concat(r,' /> is rendering a "Fragment".'),"However we need to passthrough the following props:",Object.keys(c).map(e=>" - ".concat(e)).join("\n"),"","You can apply a few solutions:",['Add an `as="..."` prop, to ensure that we render an actual element instead of a "Fragment".',"Render a single element as the child so that we can forward the props onto that element."].map(e=>" - ".concat(e)).join("\n")].join("\n"));let e=f.props,t="function"==typeof(null==e?void 0:e.className)?function(){for(var t=arguments.length,n=Array(t),r=0;r<t;r++)n[r]=arguments[r];return(0,a.A)(null==e?void 0:e.className(...n),c.className)}:(0,a.A)(null==e?void 0:e.className,c.className);return(0,i.cloneElement)(f,Object.assign({},p(f.props,m(g(c,["ref"]))),h,d,{ref:o(f.ref,d.ref)},t?{className:t}:{}))}return(0,i.createElement)(l,Object.assign({},g(c,["ref"]),l!==i.Fragment&&d,l!==i.Fragment&&h),f)}function f(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];return t.every(e=>null==e)?void 0:e=>{for(let n of t)null!=n&&("function"==typeof n?n(e):n.current=e)}}function p(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];if(0===t.length)return{};if(1===t.length)return t[0];let r={},o={};for(let e of t)for(let t in e)t.startsWith("on")&&"function"==typeof e[t]?(null!=o[t]||(o[t]=[]),o[t].push(e[t])):r[t]=e[t];if(r.disabled||r["aria-disabled"])return Object.assign(r,Object.fromEntries(Object.keys(o).map(e=>[e,void 0])));for(let e in o)Object.assign(r,{[e](t){for(var n=arguments.length,r=Array(n>1?n-1:0),i=1;i<n;i++)r[i-1]=arguments[i];for(let n of o[e]){if((t instanceof Event||(null==t?void 0:t.nativeEvent)instanceof Event)&&t.defaultPrevented)return;n(t,...r)}}});return r}function h(e){var t;return Object.assign((0,i.forwardRef)(e),{displayName:null!=(t=e.displayName)?t:e.name})}function m(e){let t=Object.assign({},e);for(let e in t)void 0===t[e]&&delete t[e];return t}function g(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],n=Object.assign({},e);for(let e of t)e in n&&delete n[e];return n}},8472:function(e,t,n){let r,o,i,a;n.d(t,{Z:function(){return to}});var l,s={};function u(e,t){return function(){return e.apply(t,arguments)}}n.r(s),n.d(s,{hasBrowserEnv:function(){return ed},hasStandardBrowserEnv:function(){return ef},hasStandardBrowserWebWorkerEnv:function(){return ep},origin:function(){return eh}});let{toString:c}=Object.prototype,{getPrototypeOf:d}=Object,f=(r=Object.create(null),e=>{let t=c.call(e);return r[t]||(r[t]=t.slice(8,-1).toLowerCase())}),p=e=>(e=e.toLowerCase(),t=>f(t)===e),h=e=>t=>typeof t===e,{isArray:m}=Array,g=h("undefined"),v=p("ArrayBuffer"),E=h("string"),y=h("function"),b=h("number"),w=e=>null!==e&&"object"==typeof e,S=e=>{if("object"!==f(e))return!1;let t=d(e);return(null===t||t===Object.prototype||null===Object.getPrototypeOf(t))&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)},T=p("Date"),O=p("File"),R=p("Blob"),A=p("FileList"),C=p("URLSearchParams"),[P,L,N,F]=["ReadableStream","Request","Response","Headers"].map(p);function x(e,t,{allOwnKeys:n=!1}={}){let r,o;if(null!=e){if("object"!=typeof e&&(e=[e]),m(e))for(r=0,o=e.length;r<o;r++)t.call(null,e[r],r,e);else{let o;let i=n?Object.getOwnPropertyNames(e):Object.keys(e),a=i.length;for(r=0;r<a;r++)o=i[r],t.call(null,e[o],o,e)}}}function D(e,t){let n;t=t.toLowerCase();let r=Object.keys(e),o=r.length;for(;o-- >0;)if(t===(n=r[o]).toLowerCase())return n;return null}let j="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:global,k=e=>!g(e)&&e!==j,M=(o="undefined"!=typeof Uint8Array&&d(Uint8Array),e=>o&&e instanceof o),_=p("HTMLFormElement"),U=(({hasOwnProperty:e})=>(t,n)=>e.call(t,n))(Object.prototype),B=p("RegExp"),H=(e,t)=>{let n=Object.getOwnPropertyDescriptors(e),r={};x(n,(n,o)=>{let i;!1!==(i=t(n,o,e))&&(r[o]=i||n)}),Object.defineProperties(e,r)},I="abcdefghijklmnopqrstuvwxyz",q="0123456789",z={DIGIT:q,ALPHA:I,ALPHA_DIGIT:I+I.toUpperCase()+q},V=p("AsyncFunction");var W={isArray:m,isArrayBuffer:v,isBuffer:function(e){return null!==e&&!g(e)&&null!==e.constructor&&!g(e.constructor)&&y(e.constructor.isBuffer)&&e.constructor.isBuffer(e)},isFormData:e=>{let t;return e&&("function"==typeof FormData&&e instanceof FormData||y(e.append)&&("formdata"===(t=f(e))||"object"===t&&y(e.toString)&&"[object FormData]"===e.toString()))},isArrayBufferView:function(e){return"undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(e):e&&e.buffer&&v(e.buffer)},isString:E,isNumber:b,isBoolean:e=>!0===e||!1===e,isObject:w,isPlainObject:S,isReadableStream:P,isRequest:L,isResponse:N,isHeaders:F,isUndefined:g,isDate:T,isFile:O,isBlob:R,isRegExp:B,isFunction:y,isStream:e=>w(e)&&y(e.pipe),isURLSearchParams:C,isTypedArray:M,isFileList:A,forEach:x,merge:function e(){let{caseless:t}=k(this)&&this||{},n={},r=(r,o)=>{let i=t&&D(n,o)||o;S(n[i])&&S(r)?n[i]=e(n[i],r):S(r)?n[i]=e({},r):m(r)?n[i]=r.slice():n[i]=r};for(let e=0,t=arguments.length;e<t;e++)arguments[e]&&x(arguments[e],r);return n},extend:(e,t,n,{allOwnKeys:r}={})=>(x(t,(t,r)=>{n&&y(t)?e[r]=u(t,n):e[r]=t},{allOwnKeys:r}),e),trim:e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,""),stripBOM:e=>(65279===e.charCodeAt(0)&&(e=e.slice(1)),e),inherits:(e,t,n,r)=>{e.prototype=Object.create(t.prototype,r),e.prototype.constructor=e,Object.defineProperty(e,"super",{value:t.prototype}),n&&Object.assign(e.prototype,n)},toFlatObject:(e,t,n,r)=>{let o,i,a;let l={};if(t=t||{},null==e)return t;do{for(i=(o=Object.getOwnPropertyNames(e)).length;i-- >0;)a=o[i],(!r||r(a,e,t))&&!l[a]&&(t[a]=e[a],l[a]=!0);e=!1!==n&&d(e)}while(e&&(!n||n(e,t))&&e!==Object.prototype);return t},kindOf:f,kindOfTest:p,endsWith:(e,t,n)=>{e=String(e),(void 0===n||n>e.length)&&(n=e.length),n-=t.length;let r=e.indexOf(t,n);return -1!==r&&r===n},toArray:e=>{if(!e)return null;if(m(e))return e;let t=e.length;if(!b(t))return null;let n=Array(t);for(;t-- >0;)n[t]=e[t];return n},forEachEntry:(e,t)=>{let n;let r=(e&&e[Symbol.iterator]).call(e);for(;(n=r.next())&&!n.done;){let r=n.value;t.call(e,r[0],r[1])}},matchAll:(e,t)=>{let n;let r=[];for(;null!==(n=e.exec(t));)r.push(n);return r},isHTMLForm:_,hasOwnProperty:U,hasOwnProp:U,reduceDescriptors:H,freezeMethods:e=>{H(e,(t,n)=>{if(y(e)&&-1!==["arguments","caller","callee"].indexOf(n))return!1;if(y(e[n])){if(t.enumerable=!1,"writable"in t){t.writable=!1;return}t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+n+"'")})}})},toObjectSet:(e,t)=>{let n={};return(e=>{e.forEach(e=>{n[e]=!0})})(m(e)?e:String(e).split(t)),n},toCamelCase:e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(e,t,n){return t.toUpperCase()+n}),noop:()=>{},toFiniteNumber:(e,t)=>null!=e&&Number.isFinite(e=+e)?e:t,findKey:D,global:j,isContextDefined:k,ALPHABET:z,generateString:(e=16,t=z.ALPHA_DIGIT)=>{let n="",{length:r}=t;for(;e--;)n+=t[Math.random()*r|0];return n},isSpecCompliantForm:function(e){return!!(e&&y(e.append)&&"FormData"===e[Symbol.toStringTag]&&e[Symbol.iterator])},toJSONObject:e=>{let t=Array(10),n=(e,r)=>{if(w(e)){if(t.indexOf(e)>=0)return;if(!("toJSON"in e)){t[r]=e;let o=m(e)?[]:{};return x(e,(e,t)=>{let i=n(e,r+1);g(i)||(o[t]=i)}),t[r]=void 0,o}}return e};return n(e,0)},isAsyncFn:V,isThenable:e=>e&&(w(e)||y(e))&&y(e.then)&&y(e.catch)};function Y(e,t,n,r,o){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=Error().stack,this.message=e,this.name="AxiosError",t&&(this.code=t),n&&(this.config=n),r&&(this.request=r),o&&(this.response=o)}W.inherits(Y,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:W.toJSONObject(this.config),code:this.code,status:this.response&&this.response.status?this.response.status:null}}});let J=Y.prototype,G={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach(e=>{G[e]={value:e}}),Object.defineProperties(Y,G),Object.defineProperty(J,"isAxiosError",{value:!0}),Y.from=(e,t,n,r,o,i)=>{let a=Object.create(J);return W.toFlatObject(e,a,function(e){return e!==Error.prototype},e=>"isAxiosError"!==e),Y.call(a,e.message,t,n,r,o),a.cause=e,a.name=e.name,i&&Object.assign(a,i),a};var K=n(9109).lW;function Z(e){return W.isPlainObject(e)||W.isArray(e)}function $(e){return W.endsWith(e,"[]")?e.slice(0,-2):e}function X(e,t,n){return e?e.concat(t).map(function(e,t){return e=$(e),!n&&t?"["+e+"]":e}).join(n?".":""):t}let Q=W.toFlatObject(W,{},null,function(e){return/^is[A-Z]/.test(e)});var ee=function(e,t,n){if(!W.isObject(e))throw TypeError("target must be an object");t=t||new FormData;let r=(n=W.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,function(e,t){return!W.isUndefined(t[e])})).metaTokens,o=n.visitor||u,i=n.dots,a=n.indexes,l=(n.Blob||"undefined"!=typeof Blob&&Blob)&&W.isSpecCompliantForm(t);if(!W.isFunction(o))throw TypeError("visitor must be a function");function s(e){if(null===e)return"";if(W.isDate(e))return e.toISOString();if(!l&&W.isBlob(e))throw new Y("Blob is not supported. Use a Buffer instead.");return W.isArrayBuffer(e)||W.isTypedArray(e)?l&&"function"==typeof Blob?new Blob([e]):K.from(e):e}function u(e,n,o){let l=e;if(e&&!o&&"object"==typeof e){if(W.endsWith(n,"{}"))n=r?n:n.slice(0,-2),e=JSON.stringify(e);else{var u;if(W.isArray(e)&&(u=e,W.isArray(u)&&!u.some(Z))||(W.isFileList(e)||W.endsWith(n,"[]"))&&(l=W.toArray(e)))return n=$(n),l.forEach(function(e,r){W.isUndefined(e)||null===e||t.append(!0===a?X([n],r,i):null===a?n:n+"[]",s(e))}),!1}}return!!Z(e)||(t.append(X(o,n,i),s(e)),!1)}let c=[],d=Object.assign(Q,{defaultVisitor:u,convertValue:s,isVisitable:Z});if(!W.isObject(e))throw TypeError("data must be an object");return!function e(n,r){if(!W.isUndefined(n)){if(-1!==c.indexOf(n))throw Error("Circular reference detected in "+r.join("."));c.push(n),W.forEach(n,function(n,i){!0===(!(W.isUndefined(n)||null===n)&&o.call(t,n,W.isString(i)?i.trim():i,r,d))&&e(n,r?r.concat(i):[i])}),c.pop()}}(e),t};function et(e){let t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,function(e){return t[e]})}function en(e,t){this._pairs=[],e&&ee(e,this,t)}let er=en.prototype;function eo(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function ei(e,t,n){let r;if(!t)return e;let o=n&&n.encode||eo,i=n&&n.serialize;if(r=i?i(t,n):W.isURLSearchParams(t)?t.toString():new en(t,n).toString(o)){let t=e.indexOf("#");-1!==t&&(e=e.slice(0,t)),e+=(-1===e.indexOf("?")?"?":"&")+r}return e}er.append=function(e,t){this._pairs.push([e,t])},er.toString=function(e){let t=e?function(t){return e.call(this,t,et)}:et;return this._pairs.map(function(e){return t(e[0])+"="+t(e[1])},"").join("&")};class ea{constructor(){this.handlers=[]}use(e,t,n){return this.handlers.push({fulfilled:e,rejected:t,synchronous:!!n&&n.synchronous,runWhen:n?n.runWhen:null}),this.handlers.length-1}eject(e){this.handlers[e]&&(this.handlers[e]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(e){W.forEach(this.handlers,function(t){null!==t&&e(t)})}}var el={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},es="undefined"!=typeof URLSearchParams?URLSearchParams:en,eu="undefined"!=typeof FormData?FormData:null,ec="undefined"!=typeof Blob?Blob:null;let ed="undefined"!=typeof window&&"undefined"!=typeof document,ef=(i="undefined"!=typeof navigator&&navigator.product,ed&&0>["ReactNative","NativeScript","NS"].indexOf(i)),ep="undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope&&"function"==typeof self.importScripts,eh=ed&&window.location.href||"http://localhost";var em={...s,isBrowser:!0,classes:{URLSearchParams:es,FormData:eu,Blob:ec},protocols:["http","https","file","blob","url","data"]},eg=function(e){if(W.isFormData(e)&&W.isFunction(e.entries)){let t={};return W.forEachEntry(e,(e,n)=>{!function e(t,n,r,o){let i=t[o++];if("__proto__"===i)return!0;let a=Number.isFinite(+i),l=o>=t.length;return(i=!i&&W.isArray(r)?r.length:i,l)?W.hasOwnProp(r,i)?r[i]=[r[i],n]:r[i]=n:(r[i]&&W.isObject(r[i])||(r[i]=[]),e(t,n,r[i],o)&&W.isArray(r[i])&&(r[i]=function(e){let t,n;let r={},o=Object.keys(e),i=o.length;for(t=0;t<i;t++)r[n=o[t]]=e[n];return r}(r[i]))),!a}(W.matchAll(/\w+|\[(\w*)]/g,e).map(e=>"[]"===e[0]?"":e[1]||e[0]),n,t,0)}),t}return null};let ev={transitional:el,adapter:["xhr","http","fetch"],transformRequest:[function(e,t){let n;let r=t.getContentType()||"",o=r.indexOf("application/json")>-1,i=W.isObject(e);if(i&&W.isHTMLForm(e)&&(e=new FormData(e)),W.isFormData(e))return o?JSON.stringify(eg(e)):e;if(W.isArrayBuffer(e)||W.isBuffer(e)||W.isStream(e)||W.isFile(e)||W.isBlob(e)||W.isReadableStream(e))return e;if(W.isArrayBufferView(e))return e.buffer;if(W.isURLSearchParams(e))return t.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),e.toString();if(i){if(r.indexOf("application/x-www-form-urlencoded")>-1){var a,l;return(a=e,l=this.formSerializer,ee(a,new em.classes.URLSearchParams,Object.assign({visitor:function(e,t,n,r){return em.isNode&&W.isBuffer(e)?(this.append(t,e.toString("base64")),!1):r.defaultVisitor.apply(this,arguments)}},l))).toString()}if((n=W.isFileList(e))||r.indexOf("multipart/form-data")>-1){let t=this.env&&this.env.FormData;return ee(n?{"files[]":e}:e,t&&new t,this.formSerializer)}}return i||o?(t.setContentType("application/json",!1),function(e,t,n){if(W.isString(e))try{return(0,JSON.parse)(e),W.trim(e)}catch(e){if("SyntaxError"!==e.name)throw e}return(0,JSON.stringify)(e)}(e)):e}],transformResponse:[function(e){let t=this.transitional||ev.transitional,n=t&&t.forcedJSONParsing,r="json"===this.responseType;if(W.isResponse(e)||W.isReadableStream(e))return e;if(e&&W.isString(e)&&(n&&!this.responseType||r)){let n=t&&t.silentJSONParsing;try{return JSON.parse(e)}catch(e){if(!n&&r){if("SyntaxError"===e.name)throw Y.from(e,Y.ERR_BAD_RESPONSE,this,null,this.response);throw e}}}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:em.classes.FormData,Blob:em.classes.Blob},validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};W.forEach(["delete","get","head","post","put","patch"],e=>{ev.headers[e]={}});let eE=W.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]);var ey=e=>{let t,n,r;let o={};return e&&e.split("\n").forEach(function(e){r=e.indexOf(":"),t=e.substring(0,r).trim().toLowerCase(),n=e.substring(r+1).trim(),!t||o[t]&&eE[t]||("set-cookie"===t?o[t]?o[t].push(n):o[t]=[n]:o[t]=o[t]?o[t]+", "+n:n)}),o};let eb=Symbol("internals");function ew(e){return e&&String(e).trim().toLowerCase()}function eS(e){return!1===e||null==e?e:W.isArray(e)?e.map(eS):String(e)}let eT=e=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim());function eO(e,t,n,r,o){if(W.isFunction(r))return r.call(this,t,n);if(o&&(t=n),W.isString(t)){if(W.isString(r))return -1!==t.indexOf(r);if(W.isRegExp(r))return r.test(t)}}class eR{constructor(e){e&&this.set(e)}set(e,t,n){let r=this;function o(e,t,n){let o=ew(t);if(!o)throw Error("header name must be a non-empty string");let i=W.findKey(r,o);i&&void 0!==r[i]&&!0!==n&&(void 0!==n||!1===r[i])||(r[i||t]=eS(e))}let i=(e,t)=>W.forEach(e,(e,n)=>o(e,n,t));if(W.isPlainObject(e)||e instanceof this.constructor)i(e,t);else if(W.isString(e)&&(e=e.trim())&&!eT(e))i(ey(e),t);else if(W.isHeaders(e))for(let[t,r]of e.entries())o(r,t,n);else null!=e&&o(t,e,n);return this}get(e,t){if(e=ew(e)){let n=W.findKey(this,e);if(n){let e=this[n];if(!t)return e;if(!0===t)return function(e){let t;let n=Object.create(null),r=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;for(;t=r.exec(e);)n[t[1]]=t[2];return n}(e);if(W.isFunction(t))return t.call(this,e,n);if(W.isRegExp(t))return t.exec(e);throw TypeError("parser must be boolean|regexp|function")}}}has(e,t){if(e=ew(e)){let n=W.findKey(this,e);return!!(n&&void 0!==this[n]&&(!t||eO(this,this[n],n,t)))}return!1}delete(e,t){let n=this,r=!1;function o(e){if(e=ew(e)){let o=W.findKey(n,e);o&&(!t||eO(n,n[o],o,t))&&(delete n[o],r=!0)}}return W.isArray(e)?e.forEach(o):o(e),r}clear(e){let t=Object.keys(this),n=t.length,r=!1;for(;n--;){let o=t[n];(!e||eO(this,this[o],o,e,!0))&&(delete this[o],r=!0)}return r}normalize(e){let t=this,n={};return W.forEach(this,(r,o)=>{let i=W.findKey(n,o);if(i){t[i]=eS(r),delete t[o];return}let a=e?o.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(e,t,n)=>t.toUpperCase()+n):String(o).trim();a!==o&&delete t[o],t[a]=eS(r),n[a]=!0}),this}concat(...e){return this.constructor.concat(this,...e)}toJSON(e){let t=Object.create(null);return W.forEach(this,(n,r)=>{null!=n&&!1!==n&&(t[r]=e&&W.isArray(n)?n.join(", "):n)}),t}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([e,t])=>e+": "+t).join("\n")}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(e){return e instanceof this?e:new this(e)}static concat(e,...t){let n=new this(e);return t.forEach(e=>n.set(e)),n}static accessor(e){let t=(this[eb]=this[eb]={accessors:{}}).accessors,n=this.prototype;function r(e){let r=ew(e);t[r]||(!function(e,t){let n=W.toCamelCase(" "+t);["get","set","has"].forEach(r=>{Object.defineProperty(e,r+n,{value:function(e,n,o){return this[r].call(this,t,e,n,o)},configurable:!0})})}(n,e),t[r]=!0)}return W.isArray(e)?e.forEach(r):r(e),this}}function eA(e,t){let n=this||ev,r=t||n,o=eR.from(r.headers),i=r.data;return W.forEach(e,function(e){i=e.call(n,i,o.normalize(),t?t.status:void 0)}),o.normalize(),i}function eC(e){return!!(e&&e.__CANCEL__)}function eP(e,t,n){Y.call(this,null==e?"canceled":e,Y.ERR_CANCELED,t,n),this.name="CanceledError"}function eL(e,t,n){let r=n.config.validateStatus;!n.status||!r||r(n.status)?e(n):t(new Y("Request failed with status code "+n.status,[Y.ERR_BAD_REQUEST,Y.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n))}eR.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),W.reduceDescriptors(eR.prototype,({value:e},t)=>{let n=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(e){this[n]=e}}}),W.freezeMethods(eR),W.inherits(eP,Y,{__CANCEL__:!0});var eN=function(e,t){let n;let r=Array(e=e||10),o=Array(e),i=0,a=0;return t=void 0!==t?t:1e3,function(l){let s=Date.now(),u=o[a];n||(n=s),r[i]=l,o[i]=s;let c=a,d=0;for(;c!==i;)d+=r[c++],c%=e;if((i=(i+1)%e)===a&&(a=(a+1)%e),s-n<t)return;let f=u&&s-u;return f?Math.round(1e3*d/f):void 0}},eF=function(e,t){let n=0,r=1e3/t,o=null;return function(){let t=Date.now();if(this===!0||t-n>r)return o&&(clearTimeout(o),o=null),n=t,e.apply(null,arguments);o||(o=setTimeout(()=>(o=null,n=Date.now(),e.apply(null,arguments)),r-(t-n)))}},ex=(e,t,n=3)=>{let r=0,o=eN(50,250);return eF(n=>{let i=n.loaded,a=n.lengthComputable?n.total:void 0,l=i-r,s=o(l);r=i;let u={loaded:i,total:a,progress:a?i/a:void 0,bytes:l,rate:s||void 0,estimated:s&&a&&i<=a?(a-i)/s:void 0,event:n,lengthComputable:null!=a};u[t?"download":"upload"]=!0,e(u)},n)},eD=em.hasStandardBrowserEnv?function(){let e;let t=/(msie|trident)/i.test(navigator.userAgent),n=document.createElement("a");function r(e){let r=e;return t&&(n.setAttribute("href",r),r=n.href),n.setAttribute("href",r),{href:n.href,protocol:n.protocol?n.protocol.replace(/:$/,""):"",host:n.host,search:n.search?n.search.replace(/^\?/,""):"",hash:n.hash?n.hash.replace(/^#/,""):"",hostname:n.hostname,port:n.port,pathname:"/"===n.pathname.charAt(0)?n.pathname:"/"+n.pathname}}return e=r(window.location.href),function(t){let n=W.isString(t)?r(t):t;return n.protocol===e.protocol&&n.host===e.host}}():function(){return!0},ej=em.hasStandardBrowserEnv?{write(e,t,n,r,o,i){let a=[e+"="+encodeURIComponent(t)];W.isNumber(n)&&a.push("expires="+new Date(n).toGMTString()),W.isString(r)&&a.push("path="+r),W.isString(o)&&a.push("domain="+o),!0===i&&a.push("secure"),document.cookie=a.join("; ")},read(e){let t=document.cookie.match(RegExp("(^|;\\s*)("+e+")=([^;]*)"));return t?decodeURIComponent(t[3]):null},remove(e){this.write(e,"",Date.now()-864e5)}}:{write(){},read:()=>null,remove(){}};function ek(e,t){return e&&!/^([a-z][a-z\d+\-.]*:)?\/\//i.test(t)?t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e:t}let eM=e=>e instanceof eR?{...e}:e;function e_(e,t){t=t||{};let n={};function r(e,t,n){return W.isPlainObject(e)&&W.isPlainObject(t)?W.merge.call({caseless:n},e,t):W.isPlainObject(t)?W.merge({},t):W.isArray(t)?t.slice():t}function o(e,t,n){return W.isUndefined(t)?W.isUndefined(e)?void 0:r(void 0,e,n):r(e,t,n)}function i(e,t){if(!W.isUndefined(t))return r(void 0,t)}function a(e,t){return W.isUndefined(t)?W.isUndefined(e)?void 0:r(void 0,e):r(void 0,t)}function l(n,o,i){return i in t?r(n,o):i in e?r(void 0,n):void 0}let s={url:i,method:i,data:i,baseURL:a,transformRequest:a,transformResponse:a,paramsSerializer:a,timeout:a,timeoutMessage:a,withCredentials:a,withXSRFToken:a,adapter:a,responseType:a,xsrfCookieName:a,xsrfHeaderName:a,onUploadProgress:a,onDownloadProgress:a,decompress:a,maxContentLength:a,maxBodyLength:a,beforeRedirect:a,transport:a,httpAgent:a,httpsAgent:a,cancelToken:a,socketPath:a,responseEncoding:a,validateStatus:l,headers:(e,t)=>o(eM(e),eM(t),!0)};return W.forEach(Object.keys(Object.assign({},e,t)),function(r){let i=s[r]||o,a=i(e[r],t[r],r);W.isUndefined(a)&&i!==l||(n[r]=a)}),n}var eU=e=>{let t;let n=e_({},e),{data:r,withXSRFToken:o,xsrfHeaderName:i,xsrfCookieName:a,headers:l,auth:s}=n;if(n.headers=l=eR.from(l),n.url=ei(ek(n.baseURL,n.url),e.params,e.paramsSerializer),s&&l.set("Authorization","Basic "+btoa((s.username||"")+":"+(s.password?unescape(encodeURIComponent(s.password)):""))),W.isFormData(r)){if(em.hasStandardBrowserEnv||em.hasStandardBrowserWebWorkerEnv)l.setContentType(void 0);else if(!1!==(t=l.getContentType())){let[e,...n]=t?t.split(";").map(e=>e.trim()).filter(Boolean):[];l.setContentType([e||"multipart/form-data",...n].join("; "))}}if(em.hasStandardBrowserEnv&&(o&&W.isFunction(o)&&(o=o(n)),o||!1!==o&&eD(n.url))){let e=i&&a&&ej.read(a);e&&l.set(i,e)}return n},eB="undefined"!=typeof XMLHttpRequest&&function(e){return new Promise(function(t,n){let r;let o=eU(e),i=o.data,a=eR.from(o.headers).normalize(),{responseType:l}=o;function s(){o.cancelToken&&o.cancelToken.unsubscribe(r),o.signal&&o.signal.removeEventListener("abort",r)}let u=new XMLHttpRequest;function c(){if(!u)return;let r=eR.from("getAllResponseHeaders"in u&&u.getAllResponseHeaders());eL(function(e){t(e),s()},function(e){n(e),s()},{data:l&&"text"!==l&&"json"!==l?u.response:u.responseText,status:u.status,statusText:u.statusText,headers:r,config:e,request:u}),u=null}u.open(o.method.toUpperCase(),o.url,!0),u.timeout=o.timeout,"onloadend"in u?u.onloadend=c:u.onreadystatechange=function(){u&&4===u.readyState&&(0!==u.status||u.responseURL&&0===u.responseURL.indexOf("file:"))&&setTimeout(c)},u.onabort=function(){u&&(n(new Y("Request aborted",Y.ECONNABORTED,o,u)),u=null)},u.onerror=function(){n(new Y("Network Error",Y.ERR_NETWORK,o,u)),u=null},u.ontimeout=function(){let e=o.timeout?"timeout of "+o.timeout+"ms exceeded":"timeout exceeded",t=o.transitional||el;o.timeoutErrorMessage&&(e=o.timeoutErrorMessage),n(new Y(e,t.clarifyTimeoutError?Y.ETIMEDOUT:Y.ECONNABORTED,o,u)),u=null},void 0===i&&a.setContentType(null),"setRequestHeader"in u&&W.forEach(a.toJSON(),function(e,t){u.setRequestHeader(t,e)}),W.isUndefined(o.withCredentials)||(u.withCredentials=!!o.withCredentials),l&&"json"!==l&&(u.responseType=o.responseType),"function"==typeof o.onDownloadProgress&&u.addEventListener("progress",ex(o.onDownloadProgress,!0)),"function"==typeof o.onUploadProgress&&u.upload&&u.upload.addEventListener("progress",ex(o.onUploadProgress)),(o.cancelToken||o.signal)&&(r=t=>{u&&(n(!t||t.type?new eP(null,e,u):t),u.abort(),u=null)},o.cancelToken&&o.cancelToken.subscribe(r),o.signal&&(o.signal.aborted?r():o.signal.addEventListener("abort",r)));let d=function(e){let t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}(o.url);if(d&&-1===em.protocols.indexOf(d)){n(new Y("Unsupported protocol "+d+":",Y.ERR_BAD_REQUEST,e));return}u.send(i||null)})},eH=(e,t)=>{let n,r=new AbortController,o=function(e){if(!n){n=!0,a();let t=e instanceof Error?e:this.reason;r.abort(t instanceof Y?t:new eP(t instanceof Error?t.message:t))}},i=t&&setTimeout(()=>{o(new Y(`timeout ${t} of ms exceeded`,Y.ETIMEDOUT))},t),a=()=>{e&&(i&&clearTimeout(i),i=null,e.forEach(e=>{e&&(e.removeEventListener?e.removeEventListener("abort",o):e.unsubscribe(o))}),e=null)};e.forEach(e=>e&&e.addEventListener&&e.addEventListener("abort",o));let{signal:l}=r;return l.unsubscribe=a,[l,()=>{i&&clearTimeout(i),i=null}]};let eI=function*(e,t){let n,r=e.byteLength;if(!t||r<t){yield e;return}let o=0;for(;o<r;)n=o+t,yield e.slice(o,n),o=n},eq=async function*(e,t,n){for await(let r of e)yield*eI(ArrayBuffer.isView(r)?r:await n(String(r)),t)},ez=(e,t,n,r,o)=>{let i=eq(e,t,o),a=0;return new ReadableStream({type:"bytes",async pull(e){let{done:t,value:o}=await i.next();if(t){e.close(),r();return}let l=o.byteLength;n&&n(a+=l),e.enqueue(new Uint8Array(o))},cancel:e=>(r(e),i.return())},{highWaterMark:2})},eV=(e,t)=>{let n=null!=e;return r=>setTimeout(()=>t({lengthComputable:n,total:e,loaded:r}))},eW="function"==typeof fetch&&"function"==typeof Request&&"function"==typeof Response,eY=eW&&"function"==typeof ReadableStream,eJ=eW&&("function"==typeof TextEncoder?(a=new TextEncoder,e=>a.encode(e)):async e=>new Uint8Array(await new Response(e).arrayBuffer())),eG=eY&&(()=>{let e=!1,t=new Request(em.origin,{body:new ReadableStream,method:"POST",get duplex(){return e=!0,"half"}}).headers.has("Content-Type");return e&&!t})(),eK=eY&&!!(()=>{try{return W.isReadableStream(new Response("").body)}catch(e){}})(),eZ={stream:eK&&(e=>e.body)};eW&&(l=new Response,["text","arrayBuffer","blob","formData","stream"].forEach(e=>{eZ[e]||(eZ[e]=W.isFunction(l[e])?t=>t[e]():(t,n)=>{throw new Y(`Response type '${e}' is not supported`,Y.ERR_NOT_SUPPORT,n)})}));let e$=async e=>null==e?0:W.isBlob(e)?e.size:W.isSpecCompliantForm(e)?(await new Request(e).arrayBuffer()).byteLength:W.isArrayBufferView(e)?e.byteLength:(W.isURLSearchParams(e)&&(e+=""),W.isString(e))?(await eJ(e)).byteLength:void 0,eX=async(e,t)=>{let n=W.toFiniteNumber(e.getContentLength());return null==n?e$(t):n},eQ={http:null,xhr:eB,fetch:eW&&(async e=>{let t,n,r,{url:o,method:i,data:a,signal:l,cancelToken:s,timeout:u,onDownloadProgress:c,onUploadProgress:d,responseType:f,headers:p,withCredentials:h="same-origin",fetchOptions:m}=eU(e);f=f?(f+"").toLowerCase():"text";let[g,v]=l||s||u?eH([l,s],u):[],E=()=>{t||setTimeout(()=>{g&&g.unsubscribe()}),t=!0};try{if(d&&eG&&"get"!==i&&"head"!==i&&0!==(r=await eX(p,a))){let e,t=new Request(o,{method:"POST",body:a,duplex:"half"});W.isFormData(a)&&(e=t.headers.get("content-type"))&&p.setContentType(e),t.body&&(a=ez(t.body,65536,eV(r,ex(d)),null,eJ))}W.isString(h)||(h=h?"cors":"omit"),n=new Request(o,{...m,signal:g,method:i.toUpperCase(),headers:p.normalize().toJSON(),body:a,duplex:"half",withCredentials:h});let t=await fetch(n),l=eK&&("stream"===f||"response"===f);if(eK&&(c||l)){let e={};["status","statusText","headers"].forEach(n=>{e[n]=t[n]});let n=W.toFiniteNumber(t.headers.get("content-length"));t=new Response(ez(t.body,65536,c&&eV(n,ex(c,!0)),l&&E,eJ),e)}f=f||"text";let s=await eZ[W.findKey(eZ,f)||"text"](t,e);return l||E(),v&&v(),await new Promise((r,o)=>{eL(r,o,{data:s,headers:eR.from(t.headers),status:t.status,statusText:t.statusText,config:e,request:n})})}catch(t){if(E(),t&&"TypeError"===t.name&&/fetch/i.test(t.message))throw Object.assign(new Y("Network Error",Y.ERR_NETWORK,e,n),{cause:t.cause||t});throw Y.from(t,t&&t.code,e,n)}})};W.forEach(eQ,(e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch(e){}Object.defineProperty(e,"adapterName",{value:t})}});let e0=e=>`- ${e}`,e1=e=>W.isFunction(e)||null===e||!1===e;var e2=e=>{let t,n;let{length:r}=e=W.isArray(e)?e:[e],o={};for(let i=0;i<r;i++){let r;if(n=t=e[i],!e1(t)&&void 0===(n=eQ[(r=String(t)).toLowerCase()]))throw new Y(`Unknown adapter '${r}'`);if(n)break;o[r||"#"+i]=n}if(!n){let e=Object.entries(o).map(([e,t])=>`adapter ${e} `+(!1===t?"is not supported by the environment":"is not available in the build"));throw new Y("There is no suitable adapter to dispatch the request "+(r?e.length>1?"since :\n"+e.map(e0).join("\n"):" "+e0(e[0]):"as no adapter specified"),"ERR_NOT_SUPPORT")}return n};function e4(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new eP(null,e)}function e5(e){return e4(e),e.headers=eR.from(e.headers),e.data=eA.call(e,e.transformRequest),-1!==["post","put","patch"].indexOf(e.method)&&e.headers.setContentType("application/x-www-form-urlencoded",!1),e2(e.adapter||ev.adapter)(e).then(function(t){return e4(e),t.data=eA.call(e,e.transformResponse,t),t.headers=eR.from(t.headers),t},function(t){return!eC(t)&&(e4(e),t&&t.response&&(t.response.data=eA.call(e,e.transformResponse,t.response),t.response.headers=eR.from(t.response.headers))),Promise.reject(t)})}let e3="1.7.2",e6={};["object","boolean","number","function","string","symbol"].forEach((e,t)=>{e6[e]=function(n){return typeof n===e||"a"+(t<1?"n ":" ")+e}});let e8={};e6.transitional=function(e,t,n){function r(e,t){return"[Axios v"+e3+"] Transitional option '"+e+"'"+t+(n?". "+n:"")}return(n,o,i)=>{if(!1===e)throw new Y(r(o," has been removed"+(t?" in "+t:"")),Y.ERR_DEPRECATED);return t&&!e8[o]&&(e8[o]=!0,console.warn(r(o," has been deprecated since v"+t+" and will be removed in the near future"))),!e||e(n,o,i)}};var e7={assertOptions:function(e,t,n){if("object"!=typeof e)throw new Y("options must be an object",Y.ERR_BAD_OPTION_VALUE);let r=Object.keys(e),o=r.length;for(;o-- >0;){let i=r[o],a=t[i];if(a){let t=e[i],n=void 0===t||a(t,i,e);if(!0!==n)throw new Y("option "+i+" must be "+n,Y.ERR_BAD_OPTION_VALUE);continue}if(!0!==n)throw new Y("Unknown option "+i,Y.ERR_BAD_OPTION)}},validators:e6};let e9=e7.validators;class te{constructor(e){this.defaults=e,this.interceptors={request:new ea,response:new ea}}async request(e,t){try{return await this._request(e,t)}catch(e){if(e instanceof Error){let t;Error.captureStackTrace?Error.captureStackTrace(t={}):t=Error();let n=t.stack?t.stack.replace(/^.+\n/,""):"";try{e.stack?n&&!String(e.stack).endsWith(n.replace(/^.+\n.+\n/,""))&&(e.stack+="\n"+n):e.stack=n}catch(e){}}throw e}}_request(e,t){let n,r;"string"==typeof e?(t=t||{}).url=e:t=e||{};let{transitional:o,paramsSerializer:i,headers:a}=t=e_(this.defaults,t);void 0!==o&&e7.assertOptions(o,{silentJSONParsing:e9.transitional(e9.boolean),forcedJSONParsing:e9.transitional(e9.boolean),clarifyTimeoutError:e9.transitional(e9.boolean)},!1),null!=i&&(W.isFunction(i)?t.paramsSerializer={serialize:i}:e7.assertOptions(i,{encode:e9.function,serialize:e9.function},!0)),t.method=(t.method||this.defaults.method||"get").toLowerCase();let l=a&&W.merge(a.common,a[t.method]);a&&W.forEach(["delete","get","head","post","put","patch","common"],e=>{delete a[e]}),t.headers=eR.concat(l,a);let s=[],u=!0;this.interceptors.request.forEach(function(e){("function"!=typeof e.runWhen||!1!==e.runWhen(t))&&(u=u&&e.synchronous,s.unshift(e.fulfilled,e.rejected))});let c=[];this.interceptors.response.forEach(function(e){c.push(e.fulfilled,e.rejected)});let d=0;if(!u){let e=[e5.bind(this),void 0];for(e.unshift.apply(e,s),e.push.apply(e,c),r=e.length,n=Promise.resolve(t);d<r;)n=n.then(e[d++],e[d++]);return n}r=s.length;let f=t;for(d=0;d<r;){let e=s[d++],t=s[d++];try{f=e(f)}catch(e){t.call(this,e);break}}try{n=e5.call(this,f)}catch(e){return Promise.reject(e)}for(d=0,r=c.length;d<r;)n=n.then(c[d++],c[d++]);return n}getUri(e){return ei(ek((e=e_(this.defaults,e)).baseURL,e.url),e.params,e.paramsSerializer)}}W.forEach(["delete","get","head","options"],function(e){te.prototype[e]=function(t,n){return this.request(e_(n||{},{method:e,url:t,data:(n||{}).data}))}}),W.forEach(["post","put","patch"],function(e){function t(t){return function(n,r,o){return this.request(e_(o||{},{method:e,headers:t?{"Content-Type":"multipart/form-data"}:{},url:n,data:r}))}}te.prototype[e]=t(),te.prototype[e+"Form"]=t(!0)});class tt{constructor(e){let t;if("function"!=typeof e)throw TypeError("executor must be a function.");this.promise=new Promise(function(e){t=e});let n=this;this.promise.then(e=>{if(!n._listeners)return;let t=n._listeners.length;for(;t-- >0;)n._listeners[t](e);n._listeners=null}),this.promise.then=e=>{let t;let r=new Promise(e=>{n.subscribe(e),t=e}).then(e);return r.cancel=function(){n.unsubscribe(t)},r},e(function(e,r,o){n.reason||(n.reason=new eP(e,r,o),t(n.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(e){if(this.reason){e(this.reason);return}this._listeners?this._listeners.push(e):this._listeners=[e]}unsubscribe(e){if(!this._listeners)return;let t=this._listeners.indexOf(e);-1!==t&&this._listeners.splice(t,1)}static source(){let e;return{token:new tt(function(t){e=t}),cancel:e}}}let tn={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(tn).forEach(([e,t])=>{tn[t]=e});let tr=function e(t){let n=new te(t),r=u(te.prototype.request,n);return W.extend(r,te.prototype,n,{allOwnKeys:!0}),W.extend(r,n,null,{allOwnKeys:!0}),r.create=function(n){return e(e_(t,n))},r}(ev);tr.Axios=te,tr.CanceledError=eP,tr.CancelToken=tt,tr.isCancel=eC,tr.VERSION=e3,tr.toFormData=ee,tr.AxiosError=Y,tr.Cancel=tr.CanceledError,tr.all=function(e){return Promise.all(e)},tr.spread=function(e){return function(t){return e.apply(null,t)}},tr.isAxiosError=function(e){return W.isObject(e)&&!0===e.isAxiosError},tr.mergeConfig=e_,tr.AxiosHeaders=eR,tr.formToJSON=e=>eg(W.isHTMLForm(e)?new FormData(e):e),tr.getAdapter=e2,tr.HttpStatusCode=tn,tr.default=tr;var to=tr}}]);
|
_next/static/chunks/{28fd365c.0d75ba7c838a0b07.js β 590caa2a.be5af588047a1c85.js}
RENAMED
@@ -1,7 +1,7 @@
|
|
1 |
-
"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[789],{9673:function(e,t,s){s.d(t,{t2:function(){return e9}});var n=s(7179),i=s(2179),r=s(8664),o=s(2755),a=s(7270),l=s(436);async function c(e,t){let s=await Promise.all([(0,i.yM)(e,"tokenizer.json",!0,t),(0,i.yM)(e,"tokenizer_config.json",!0,t)]);return null!==t.legacy&&(s[1].legacy=t.legacy),s}function h(e,t=!0){if(void 0!==e.Regex){let t=e.Regex.replace(/\\([#&~])/g,"$1");for(let[e,s]of g)t=t.replaceAll(e,s);return RegExp(t,"gu")}if(void 0===e.String)return console.warn("Unknown pattern type:",e),null;{let s=(0,n.hr)(e.String);return RegExp(t?s:`(${s})`,"gu")}}function u(e){return new Map(Object.entries(e))}function d(e){let t=e.dims;switch(t.length){case 1:return e.tolist();case 2:if(1!==t[0])throw Error("Unable to decode tensor with `batch size !== 1`. Use `tokenizer.batch_decode(...)` for batched inputs.");return e.tolist()[0];default:throw Error(`Expected tensor to have 1-2 dimensions, got ${t.length}.`)}}function _(e){return e.replace(/ \./g,".").replace(/ \?/g,"?").replace(/ \!/g,"!").replace(/ ,/g,",").replace(/ \' /g,"'").replace(/ n\'t/g,"n't").replace(/ \'m/g,"'m").replace(/ \'s/g,"'s").replace(/ \'ve/g,"'ve").replace(/ \'re/g,"'re")}function p(e){return e.replace(/[\u0300-\u036f]/g,"")}let f="\\p{P}\\u0021-\\u002F\\u003A-\\u0040\\u005B-\\u0060\\u007B-\\u007E",g=new Map([["(?i:'s|'t|'re|'ve|'m|'ll|'d)","(?:'([sS]|[tT]|[rR][eE]|[vV][eE]|[mM]|[lL][lL]|[dD]))"]]);class m{constructor(e){this.content=e.content,this.id=e.id,this.single_word=e.single_word??!1,this.lstrip=e.lstrip??!1,this.rstrip=e.rstrip??!1,this.special=e.special??!1,this.normalized=e.normalized??null}}class k extends n.Ag{constructor(e){super(),this.config=e,this.vocab=[],this.tokens_to_ids=new Map,this.unk_token_id=void 0,this.unk_token=void 0,this.end_of_word_suffix=void 0,this.fuse_unk=this.config.fuse_unk??!1}static fromConfig(e,...t){switch(e.type){case"WordPiece":return new x(e);case"Unigram":return new w(e,...t);case"BPE":return new v(e);default:if(e.vocab)return new z(e,...t);throw Error(`Unknown TokenizerModel type: ${e.type}`)}}_call(e){let t=this.encode(e);return this.fuse_unk&&(t=function(e,t,s){let n=[],i=0;for(;i<e.length;){if(n.push(e[i]),(s.get(e[i])??t)!==t){++i;continue}for(;i<e.length&&(s.get(e[i])??t)===t;)++i}return n}(t,this.unk_token_id,this.tokens_to_ids)),t}encode(e){throw Error("encode should be implemented in subclass.")}convert_tokens_to_ids(e){return e.map(e=>this.tokens_to_ids.get(e)??this.unk_token_id)}convert_ids_to_tokens(e){return e.map(e=>this.vocab[e]??this.unk_token)}}class x extends k{constructor(e){for(let[t,s]of(super(e),this.tokens_to_ids=u(e.vocab),this.unk_token_id=this.tokens_to_ids.get(e.unk_token),this.unk_token=e.unk_token,this.max_input_chars_per_word=e.max_input_chars_per_word??100,this.vocab=Array(this.tokens_to_ids.size),this.tokens_to_ids))this.vocab[s]=t}encode(e){let t=[];for(let s of e){let e=[...s];if(e.length>this.max_input_chars_per_word){t.push(this.unk_token);continue}let n=!1,i=0,r=[];for(;i<e.length;){let t=e.length,s=null;for(;i<t;){let n=e.slice(i,t).join("");if(i>0&&(n=this.config.continuing_subword_prefix+n),this.tokens_to_ids.has(n)){s=n;break}--t}if(null===s){n=!0;break}r.push(s),i=t}n?t.push(this.unk_token):t.push(...r)}return t}}class w extends k{constructor(e,t){super(e);let s=e.vocab.length;this.vocab=Array(s),this.scores=Array(s);for(let t=0;t<s;++t){let s=e.vocab[t];this.vocab[t]=s[0],this.scores[t]=s[1]}this.unk_token_id=e.unk_id,this.unk_token=this.vocab[e.unk_id],this.tokens_to_ids=new Map(this.vocab.map((e,t)=>[e,t])),this.bosToken=" ",this.bosTokenId=this.tokens_to_ids.get(this.bosToken),this.eosToken=t.eos_token,this.eosTokenId=this.tokens_to_ids.get(this.eosToken),this.unkToken=this.vocab[this.unk_token_id],this.minScore=(0,r.VV)(this.scores)[0],this.unkScore=this.minScore-10,this.scores[this.unk_token_id]=this.unkScore,this.trie=new a.GA,this.trie.extend(this.vocab),this.fuse_unk=!0}populateNodes(e){let t=e.sentence,s=t.length,n=0;for(;n<s;){let s=!1,i=[];for(let r of this.trie.commonPrefixSearch(t.slice(n))){i.push(r);let t=this.tokens_to_ids.get(r),o=this.scores[t],a=r.length;e.insert(n,a,o,t),s||1!==a||(s=!0)}s||e.insert(n,1,this.unkScore,this.unk_token_id),n+=1}}tokenize(e){let t=new a.pQ(e,this.bosTokenId,this.eosTokenId);return this.populateNodes(t),t.tokens()}encode(e){let t=[];for(let s of e){let e=this.tokenize(s);t.push(...e)}return t}}let y=(()=>{let e=[...Array.from({length:94},(e,t)=>t+33),...Array.from({length:12},(e,t)=>t+161),...Array.from({length:82},(e,t)=>t+174)],t=e.slice(),s=0;for(let n=0;n<256;++n)e.includes(n)||(e.push(n),t.push(256+s),s+=1);let n=t.map(e=>String.fromCharCode(e));return Object.fromEntries(e.map((e,t)=>[e,n[t]]))})(),b=(0,n.$2)(y);class v extends k{constructor(e){for(let[t,s]of(super(e),this.BPE_SPLIT_TOKEN=" ",this.tokens_to_ids=u(e.vocab),this.unk_token_id=this.tokens_to_ids.get(e.unk_token),this.unk_token=e.unk_token,this.vocab=Array(this.tokens_to_ids.size),this.tokens_to_ids))this.vocab[s]=t;this.bpe_ranks=new Map(e.merges.map((e,t)=>[e,t])),this.merges=e.merges.map(e=>e.split(this.BPE_SPLIT_TOKEN)),this.end_of_word_suffix=e.end_of_word_suffix,this.continuing_subword_suffix=e.continuing_subword_suffix??null,this.byte_fallback=this.config.byte_fallback??!1,this.byte_fallback&&(this.text_encoder=new TextEncoder),this.ignore_merges=this.config.ignore_merges??!1,this.cache=new Map}bpe(e){if(0===e.length)return[];let t=this.cache.get(e);if(void 0!==t)return t;let s=Array.from(e);this.end_of_word_suffix&&(s[s.length-1]+=this.end_of_word_suffix);let n=[];if(s.length>1){let e=new a.Z3((e,t)=>e.score<t.score),t={token:s[0],bias:0,prev:null,next:null},i=t;for(let t=1;t<s.length;++t){let n={bias:t/s.length,token:s[t],prev:i,next:null};i.next=n,this._add_node(e,i),i=n}for(;!e.isEmpty();){let s=e.pop();if(s.deleted||!s.next||s.next.deleted)continue;if(s.deleted=!0,s.next.deleted=!0,s.prev){let e={...s.prev};s.prev.deleted=!0,s.prev=e,e.prev?e.prev.next=e:t=e}let n={token:s.token+s.next.token,bias:s.bias,prev:s.prev,next:s.next.next};n.prev?(n.prev.next=n,this._add_node(e,n.prev)):t=n,n.next&&(n.next.prev=n,this._add_node(e,n))}for(let e=t;null!==e;e=e.next)n.push(e.token)}else n=s;if(this.continuing_subword_suffix)for(let e=0;e<n.length-1;++e)n[e]+=this.continuing_subword_suffix;return this.cache.set(e,n),n}_add_node(e,t){let s=this.bpe_ranks.get(t.token+this.BPE_SPLIT_TOKEN+t.next.token);void 0!==s&&(t.score=s+t.bias,e.push(t))}encode(e){let t=[];for(let s of e){if(this.ignore_merges&&this.tokens_to_ids.has(s)){t.push(s);continue}for(let e of this.bpe(s))this.tokens_to_ids.has(e)?t.push(e):this.byte_fallback?t.push(...Array.from(this.text_encoder.encode(e)).map(e=>`<0x${e.toString(16).toUpperCase().padStart(2,"0")}>`)):t.push(this.unk_token)}return t}}class z extends k{constructor(e,t){for(let[s,n]of(super(e),this.tokens_to_ids=u(t.target_lang?e.vocab[t.target_lang]:e.vocab),this.bos_token=t.bos_token,this.bos_token_id=this.tokens_to_ids.get(this.bos_token),this.eos_token=t.eos_token,this.eos_token_id=this.tokens_to_ids.get(this.eos_token),this.pad_token=t.pad_token,this.pad_token_id=this.tokens_to_ids.get(this.pad_token),this.unk_token=t.unk_token,this.unk_token_id=this.tokens_to_ids.get(this.unk_token),this.vocab=Array(this.tokens_to_ids.size),this.tokens_to_ids))this.vocab[n]=s}encode(e){return e}}class A extends n.Ag{constructor(e){super(),this.config=e}static fromConfig(e){if(null===e)return null;switch(e.type){case"BertNormalizer":return new N(e);case"Precompiled":return new eo(e);case"Sequence":return new R(e);case"Replace":return new S(e);case"NFC":return new E(e);case"NFKC":return new T(e);case"NFKD":return new C(e);case"Strip":return new j(e);case"StripAccents":return new M(e);case"Lowercase":return new P(e);case"Prepend":return new $(e);default:throw Error(`Unknown Normalizer type: ${e.type}`)}}normalize(e){throw Error("normalize should be implemented in subclass.")}_call(e){return this.normalize(e)}}class S extends A{normalize(e){let t=h(this.config.pattern);return null===t?e:e.replaceAll(t,this.config.content)}}class E extends A{normalize(e){return e=e.normalize("NFC")}}class T extends A{normalize(e){return e=e.normalize("NFKC")}}class C extends A{normalize(e){return e=e.normalize("NFKD")}}class j extends A{normalize(e){return this.config.strip_left&&this.config.strip_right?e=e.trim():(this.config.strip_left&&(e=e.trimStart()),this.config.strip_right&&(e=e.trimEnd())),e}}class M extends A{normalize(e){return e=p(e)}}class P extends A{normalize(e){return e=e.toLowerCase()}}class $ extends A{normalize(e){return e=this.config.prepend+e}}class R extends A{constructor(e){super(e),this.normalizers=e.normalizers.map(e=>A.fromConfig(e))}normalize(e){return this.normalizers.reduce((e,t)=>t.normalize(e),e)}}class N extends A{_tokenize_chinese_chars(e){let t=[];for(let s=0;s<e.length;++s){let n=e[s],i=n.charCodeAt(0);this._is_chinese_char(i)?(t.push(" "),t.push(n),t.push(" ")):t.push(n)}return t.join("")}_is_chinese_char(e){return e>=19968&&e<=40959||e>=13312&&e<=19903||e>=131072&&e<=173791||e>=173824&&e<=177983||e>=177984&&e<=178207||e>=178208&&e<=183983||e>=63744&&e<=64255||e>=194560&&e<=195103}stripAccents(e){return e.normalize("NFD").replace(/[\u0300-\u036f]/g,"")}_is_control(e){switch(e){case" ":case"\n":case"\r":return!1;default:return/^\p{Cc}|\p{Cf}|\p{Co}|\p{Cs}$/u.test(e)}}_clean_text(e){let t=[];for(let s of e){let e=s.charCodeAt(0);0===e||65533===e||this._is_control(s)||(/^\s$/.test(s)?t.push(" "):t.push(s))}return t.join("")}normalize(e){return this.config.clean_text&&(e=this._clean_text(e)),this.config.handle_chinese_chars&&(e=this._tokenize_chinese_chars(e)),this.config.lowercase?(e=e.toLowerCase(),!1!==this.config.strip_accents&&(e=this.stripAccents(e))):this.config.strip_accents&&(e=this.stripAccents(e)),e}}class F extends n.Ag{static fromConfig(e){if(null===e)return null;switch(e.type){case"BertPreTokenizer":return new L(e);case"Sequence":return new ea(e);case"Whitespace":return new el(e);case"WhitespaceSplit":return new ec(e);case"Metaspace":return new ei(e);case"ByteLevel":return new O(e);case"Split":return new U(e);case"Punctuation":return new W(e);case"Digits":return new G(e);case"Replace":return new eh(e);default:throw Error(`Unknown PreTokenizer type: ${e.type}`)}}pre_tokenize_text(e,t){throw Error("pre_tokenize_text should be implemented in subclass.")}pre_tokenize(e,t){return(Array.isArray(e)?e.map(e=>this.pre_tokenize_text(e,t)):this.pre_tokenize_text(e,t)).flat()}_call(e,t){return this.pre_tokenize(e,t)}}class L extends F{constructor(e){super(),this.pattern=RegExp(`[^\\s${f}]+|[${f}]`,"gu")}pre_tokenize_text(e,t){return e.trim().match(this.pattern)||[]}}class O extends F{constructor(e){super(),this.config=e,this.add_prefix_space=this.config.add_prefix_space,this.trim_offsets=this.config.trim_offsets,this.use_regex=this.config.use_regex??!0,this.pattern=/'s|'t|'re|'ve|'m|'ll|'d| ?\p{L}+| ?\p{N}+| ?[^\s\p{L}\p{N}]+|\s+(?!\S)|\s+/gu,this.byte_encoder=y,this.text_encoder=new TextEncoder}pre_tokenize_text(e,t){return this.add_prefix_space&&!e.startsWith(" ")&&(e=" "+e),(this.use_regex?e.match(this.pattern)||[]:[e]).map(e=>Array.from(this.text_encoder.encode(e),e=>this.byte_encoder[e]).join(""))}}class U extends F{constructor(e){super(),this.config=e,this.pattern=h(this.config.pattern,this.config.invert)}pre_tokenize_text(e,t){return null===this.pattern?[]:this.config.invert?e.match(this.pattern)||[]:function(e,t){let s=[],n=0;for(let i of e.matchAll(t)){let t=i[0];n<i.index&&s.push(e.slice(n,i.index)),t.length>0&&s.push(t),n=i.index+t.length}return n<e.length&&s.push(e.slice(n)),s}(e,this.pattern)}}class W extends F{constructor(e){super(),this.config=e,this.pattern=RegExp(`[^${f}]+|[${f}]+`,"gu")}pre_tokenize_text(e,t){return e.match(this.pattern)||[]}}class G extends F{constructor(e){super(),this.config=e;let t=`[^\\d]+|\\d${this.config.individual_digits?"":"+"}`;this.pattern=RegExp(t,"gu")}pre_tokenize_text(e,t){return e.match(this.pattern)||[]}}class I extends n.Ag{constructor(e){super(),this.config=e}static fromConfig(e){if(null===e)return null;switch(e.type){case"TemplateProcessing":return new q(e);case"ByteLevel":return new Y(e);case"RobertaProcessing":return new D(e);case"BertProcessing":return new B(e);default:throw Error(`Unknown PostProcessor type: ${e.type}`)}}post_process(e,...t){throw Error("post_process should be implemented in subclass.")}_call(e,...t){return this.post_process(e,...t)}}class B extends I{constructor(e){super(e),this.cls=e.cls[0],this.sep=e.sep[0]}post_process(e,t=null,{add_special_tokens:s=!0}={}){s&&(e=(0,n.eG)([this.cls],e,[this.sep]));let i=Array(e.length).fill(0);if(null!==t){let r=s&&this instanceof D?[this.sep]:[],o=s?[this.sep]:[];e=(0,n.eG)(e,r,t,o),i=(0,n.eG)(i,Array(t.length+r.length+o.length).fill(1))}return{tokens:e,token_type_ids:i}}}class D extends B{}class q extends I{constructor(e){super(e),this.single=e.single,this.pair=e.pair}post_process(e,t=null,{add_special_tokens:s=!0}={}){let i=null===t?this.single:this.pair,r=[],o=[];for(let a of i)"SpecialToken"in a?s&&(r.push(a.SpecialToken.id),o.push(a.SpecialToken.type_id)):"Sequence"in a&&("A"===a.Sequence.id?(r=(0,n.eG)(r,e),o=(0,n.eG)(o,Array(e.length).fill(a.Sequence.type_id))):"B"===a.Sequence.id&&(r=(0,n.eG)(r,t),o=(0,n.eG)(o,Array(t.length).fill(a.Sequence.type_id))));return{tokens:r,token_type_ids:o}}}class Y extends I{post_process(e,t=null){return t&&(e=(0,n.eG)(e,t)),{tokens:e}}}class K extends n.Ag{constructor(e){super(),this.config=e,this.added_tokens=[],this.end_of_word_suffix=null,this.trim_offsets=e.trim_offsets}static fromConfig(e){if(null===e)return null;switch(e.type){case"WordPiece":return new Q(e);case"Metaspace":return new er(e);case"ByteLevel":return new X(e);case"Replace":return new Z(e);case"ByteFallback":return new V(e);case"Fuse":return new H(e);case"Strip":return new J(e);case"Sequence":return new et(e);case"CTC":return new ee(e);case"BPEDecoder":return new es(e);default:throw Error(`Unknown Decoder type: ${e.type}`)}}_call(e){return this.decode(e)}decode(e){return this.decode_chain(e).join("")}decode_chain(e){throw Error("`decode_chain` should be implemented in subclass.")}}class Z extends K{decode_chain(e){let t=h(this.config.pattern);return null===t?e:e.map(e=>e.replaceAll(t,this.config.content))}}class V extends K{constructor(e){super(e),this.text_decoder=new TextDecoder}decode_chain(e){let t=[],s=[];for(let n of e){let e=null;if(6===n.length&&n.startsWith("<0x")&&n.endsWith(">")){let t=parseInt(n.slice(3,5),16);isNaN(t)||(e=t)}if(null!==e)s.push(e);else{if(s.length>0){let e=this.text_decoder.decode(Uint8Array.from(s));t.push(e),s=[]}t.push(n)}}if(s.length>0){let e=this.text_decoder.decode(Uint8Array.from(s));t.push(e),s=[]}return t}}class H extends K{decode_chain(e){return[e.join("")]}}class J extends K{constructor(e){super(e),this.content=this.config.content,this.start=this.config.start,this.stop=this.config.stop}decode_chain(e){return e.map(e=>{let t=0;for(let s=0;s<this.start;++s){if(e[s]===this.content){t=s+1;continue}break}let s=e.length;for(let t=0;t<this.stop;++t){let n=e.length-t-1;if(e[n]===this.content){s=n;continue}break}return e.slice(t,s)})}}class Q extends K{constructor(e){super(e),this.cleanup=e.cleanup}decode_chain(e){return e.map((e,t)=>(0!==t&&(e=e.startsWith(this.config.prefix)?e.replace(this.config.prefix,""):" "+e),this.cleanup&&(e=_(e)),e))}}class X extends K{constructor(e){super(e),this.byte_decoder=b,this.text_decoder=new TextDecoder("utf-8",{fatal:!1,ignoreBOM:!0}),this.end_of_word_suffix=null}convert_tokens_to_string(e){let t=new Uint8Array([...e.join("")].map(e=>this.byte_decoder[e]));return this.text_decoder.decode(t)}decode_chain(e){let t=[],s=[];for(let n of e)void 0!==this.added_tokens.find(e=>e.content===n)?(s.length>0&&(t.push(this.convert_tokens_to_string(s)),s=[]),t.push(n)):s.push(n);return s.length>0&&t.push(this.convert_tokens_to_string(s)),t}}class ee extends K{constructor(e){super(e),this.pad_token=this.config.pad_token,this.word_delimiter_token=this.config.word_delimiter_token,this.cleanup=this.config.cleanup}convert_tokens_to_string(e){if(0===e.length)return"";let t=[e[0]];for(let s=1;s<e.length;++s)e[s]!==t.at(-1)&&t.push(e[s]);let s=t.filter(e=>e!==this.pad_token).join("");return this.cleanup&&(s=_(s).replaceAll(this.word_delimiter_token," ").trim()),s}decode_chain(e){return[this.convert_tokens_to_string(e)]}}class et extends K{constructor(e){super(e),this.decoders=e.decoders.map(e=>K.fromConfig(e))}decode_chain(e){return this.decoders.reduce((e,t)=>t.decode_chain(e),e)}}class es extends K{constructor(e){super(e),this.suffix=this.config.suffix}decode_chain(e){return e.map((t,s)=>t.replaceAll(this.suffix,s===e.length-1?"":" "))}}class en extends K{decode_chain(e){let t="";for(let s=1;s<e.length;s+=2)t+=e[s];return[t]}}class ei extends F{constructor(e){super(),this.addPrefixSpace=e.add_prefix_space,this.replacement=e.replacement,this.strRep=e.str_rep||this.replacement,this.prepend_scheme=e.prepend_scheme??"always"}pre_tokenize_text(e,{section_index:t}={}){let s=e.replaceAll(" ",this.strRep);return this.addPrefixSpace&&!s.startsWith(this.replacement)&&("always"===this.prepend_scheme||"first"===this.prepend_scheme&&0===t)&&(s=this.strRep+s),[s]}}class er extends K{constructor(e){super(e),this.addPrefixSpace=e.add_prefix_space,this.replacement=e.replacement}decode_chain(e){let t=[];for(let s=0;s<e.length;++s){let n=e[s].replaceAll(this.replacement," ");this.addPrefixSpace&&0==s&&n.startsWith(" ")&&(n=n.substring(1)),t.push(n)}return t}}class eo extends A{constructor(e){super(e),this.charsmap=e.precompiled_charsmap}normalize(e){return e=(e=(e=e.replace(/[\u0001-\u0008\u000B\u000E-\u001F\u007F\u008F\u009F]/gm,"")).replace(/[\u0009\u000A\u000C\u000D\u1680\u200B\u200C\u200E\u200F\u2028\u2029\u2581\uFEFF\uFFFD]/gm," ")).includes("ο½")?e.split("ο½").map(e=>e.normalize("NFKC")).join("ο½"):e.normalize("NFKC")}}class ea extends F{constructor(e){super(),this.tokenizers=e.pretokenizers.map(e=>F.fromConfig(e))}pre_tokenize_text(e,t){return this.tokenizers.reduce((e,s)=>s.pre_tokenize(e,t),[e])}}class el extends F{constructor(e){super()}pre_tokenize_text(e,t){return e.match(/\w+|[^\w\s]+/g)||[]}}class ec extends F{constructor(e){super()}pre_tokenize_text(e,t){return e.match(/\S+/g)||[]}}class eh extends F{constructor(e){super(),this.config=e,this.pattern=h(this.config.pattern),this.content=this.config.content}pre_tokenize_text(e,t){return null===this.pattern?[e]:[e.replaceAll(this.pattern,this.config.content)]}}let eu=["bos_token","eos_token","unk_token","sep_token","pad_token","cls_token","mask_token"];class ed extends n.Ag{return_token_type_ids=!1;_default_chat_template=`{% for message in messages %}{{'<|im_start|>' + message['role'] + '
|
2 |
' + message['content'] + '<|im_end|>' + '
|
3 |
'}}{% endfor %}{% if add_generation_prompt %}{{ '<|im_start|>assistant
|
4 |
-
' }}{% endif %}`;constructor(e,t){for(let s of(super(),this._tokenizer_config=t,this.normalizer=A.fromConfig(e.normalizer),this.pre_tokenizer=F.fromConfig(e.pre_tokenizer),this.model=k.fromConfig(e.model,t),this.post_processor=I.fromConfig(e.post_processor),this.decoder=K.fromConfig(e.decoder),this.special_tokens=[],this.all_special_ids=[],this.added_tokens=[],e.added_tokens)){let e=new m(s);this.added_tokens.push(e),this.model.tokens_to_ids.set(e.content,e.id),this.model.vocab[e.id]=e.content,e.special&&(this.special_tokens.push(e.content),this.all_special_ids.push(e.id))}if(this.additional_special_tokens=t.additional_special_tokens??[],this.special_tokens.push(...this.additional_special_tokens),this.special_tokens=[...new Set(this.special_tokens)],this.decoder&&(this.decoder.added_tokens=this.added_tokens,this.decoder.end_of_word_suffix=this.model.end_of_word_suffix),this.added_tokens_regex=this.added_tokens.length>0?new RegExp(this.added_tokens.map(e=>`${e.lstrip?"\\s*":""}(${(0,n.hr)(e.content)})${e.rstrip?"\\s*":""}`).join("|")):null,this.mask_token=this.getToken("mask_token"),this.mask_token_id=this.model.tokens_to_ids.get(this.mask_token),this.pad_token=this.getToken("pad_token","eos_token"),this.pad_token_id=this.model.tokens_to_ids.get(this.pad_token),this.sep_token=this.getToken("sep_token"),this.sep_token_id=this.model.tokens_to_ids.get(this.sep_token),this.unk_token=this.getToken("unk_token"),this.unk_token_id=this.model.tokens_to_ids.get(this.unk_token),this.model_max_length=t.model_max_length,this.remove_space=t.remove_space,this.clean_up_tokenization_spaces=t.clean_up_tokenization_spaces??!0,this.do_lowercase_and_remove_accent=t.do_lowercase_and_remove_accent??!1,this.padding_side="right",this.legacy=!1,this.chat_template=t.chat_template??null,Array.isArray(this.chat_template)){let e=Object.create(null);for(let{name:t,template:s}of this.chat_template){if("string"!=typeof t||"string"!=typeof s)throw Error('Chat template must be a list of objects with "name" and "template" properties');e[t]=s}this.chat_template=e}this._compiled_template_cache=new Map}getToken(...e){for(let t of e){let e=this._tokenizer_config[t];if(e){if("object"!=typeof e)return e;if("AddedToken"===e.__type)return e.content;throw Error(`Unknown token: ${e}`)}}return null}static async from_pretrained(e,{progress_callback:t=null,config:s=null,cache_dir:n=null,local_files_only:i=!1,revision:r="main",legacy:o=null}={}){return new this(...await c(e,{progress_callback:t,config:s,cache_dir:n,local_files_only:i,revision:r,legacy:o}))}_call(e,{text_pair:t=null,add_special_tokens:s=!0,padding:i=!1,truncation:a=null,max_length:l=null,return_tensor:c=!0}={}){let h;let u=Array.isArray(e);if(u){if(0===e.length)throw Error("text array must be non-empty");if(null!==t){if(Array.isArray(t)){if(e.length!==t.length)throw Error("text and text_pair must have the same length")}else throw Error("text_pair must also be an array");h=e.map((e,n)=>this._encode_plus(e,t[n],{add_special_tokens:s}))}else h=e.map(e=>this._encode_plus(e,null,{add_special_tokens:s}))}else{if(null==e)throw Error("text may not be null or undefined");if(Array.isArray(t))throw Error("When specifying `text_pair`, since `text` is a string, `text_pair` must also be a string (i.e., not an array).");h=[this._encode_plus(e,t,{add_special_tokens:s})]}if(null===l?l="max_length"===i?this.model_max_length:(0,r.Fp)(h.map(e=>e.input_ids.length))[0]:a||console.warn("Truncation was not explicitly activated but `max_length` is provided a specific value, please use `truncation=true` to explicitly truncate examples to max length."),l=Math.min(l,this.model_max_length),i||a)for(let e=0;e<h.length;++e)h[e].input_ids.length!==l&&(h[e].input_ids.length>l?a&&function(e,t){for(let s of Object.keys(e))e[s].length=t}(h[e],l):i&&function(e,t,s,i){for(let r of Object.keys(e)){let o=t-e[r].length,a=s(r),l=Array(o).fill(a);e[r]="right"===i?(0,n.eG)(e[r],l):(0,n.eG)(l,e[r])}}(h[e],l,e=>"input_ids"===e?this.pad_token_id:0,this.padding_side));let d={};if(c){if(!(i&&a)&&h.some(e=>{for(let t of Object.keys(e))if(e[t].length!==h[0][t]?.length)return!0;return!1}))throw Error("Unable to create tensor, you should probably activate truncation and/or padding with 'padding=true' and 'truncation=true' to have batched tensors with the same length.");let e=[h.length,h[0].input_ids.length];for(let t of Object.keys(h[0]))d[t]=new o.es("int64",BigInt64Array.from(h.flatMap(e=>e[t]).map(BigInt)),e)}else{for(let e of Object.keys(h[0]))d[e]=h.map(t=>t[e]);if(!u)for(let e of Object.keys(d))d[e]=d[e][0]}return d}_encode_text(e){return null===e?null:(this.added_tokens_regex?e.split(this.added_tokens_regex).filter(e=>e):[e]).map((e,t)=>{if(void 0!==this.added_tokens.find(t=>t.content===e))return e;{if(!0===this.remove_space&&(e=e.trim().split(/\s+/).join(" ")),this.do_lowercase_and_remove_accent&&(e=p(e.toLowerCase())),null!==this.normalizer&&(e=this.normalizer(e)),0===e.length)return[];let s=null!==this.pre_tokenizer?this.pre_tokenizer(e,{section_index:t}):[e];return this.model(s)}}).flat()}_encode_plus(e,t=null,{add_special_tokens:s=!0}={}){let i=this._encode_text(e),r=this._encode_text(t),o=this.post_processor?this.post_processor(i,r,{add_special_tokens:s}):{tokens:(0,n.eG)(i??[],r??[])},a=this.model.convert_tokens_to_ids(o.tokens),l={input_ids:a,attention_mask:Array(a.length).fill(1)};return this.return_token_type_ids&&o.token_type_ids&&(l.token_type_ids=o.token_type_ids),l}encode(e,t=null,{add_special_tokens:s=!0}={}){let{input_ids:n}=this._encode_plus(e,t,{add_special_tokens:s});return n}batch_decode(e,t={}){return e instanceof o.es&&(e=e.tolist()),e.map(e=>this.decode(e,t))}decode(e,t={}){if(e instanceof o.es&&(e=d(e)),!Array.isArray(e)||0===e.length||!(0,n.Wy)(e[0]))throw Error("token_ids must be a non-empty array of integers.");return this.decode_single(e,t)}decode_single(e,{skip_special_tokens:t=!1,clean_up_tokenization_spaces:s=null}){let n=this.model.convert_ids_to_tokens(e);t&&(n=n.filter(e=>!this.special_tokens.includes(e)));let i=this.decoder?this.decoder(n):n.join(" ");return this.decoder&&this.decoder.end_of_word_suffix&&(i=i.replaceAll(this.decoder.end_of_word_suffix," "),t&&(i=i.trim())),(s??this.clean_up_tokenization_spaces)&&(i=_(i)),i}get default_chat_template(){return this._warned_about_chat_template||(console.warn("No chat template is defined for this tokenizer - using a default chat template that implements the ChatML format. If the default is not appropriate for your model, please set `tokenizer.chat_template` to an appropriate template. See https://huggingface.co/docs/transformers/main/chat_templating for more information."),this._warned_about_chat_template=!0),this._default_chat_template}apply_chat_template(e,{chat_template:t=null,add_generation_prompt:s=!1,tokenize:n=!0,padding:i=!1,truncation:r=!1,max_length:o=null,return_tensor:a=!0,tokenizer_kwargs:c={},...h}={}){if(this.chat_template&&"object"==typeof this.chat_template||null===this.chat_template&&this.default_chat_template&&"object"==typeof this.default_chat_template){let e=this.chat_template??this.default_chat_template;if(null!==t&&Object.hasOwn(e,t))t=e[t];else if(null===t&&"default"in e)t=e.default;else if(null===t)throw Error(`This model has multiple chat templates with no default specified! Please either pass a chat template or the name of the template you wish to use to the 'chat_template' argument. Available template names are ${Object.keys(e).sort()}.`)}else t??=this.chat_template??this.default_chat_template;if("string"!=typeof t)throw Error(`chat_template must be a string, but got ${typeof t}`);let u=this._compiled_template_cache.get(t);void 0===u&&(u=new l.YS(t),this._compiled_template_cache.set(t,u));let d=Object.create(null);for(let e of eu){let t=this.getToken(e);t&&(d[e]=t)}let _=u.render({messages:e,add_generation_prompt:s,...d,...h});return n?this._call(_,{add_special_tokens:!1,padding:i,truncation:r,max_length:o,return_tensor:a,...c}).input_ids:_}}class e_ extends ed{return_token_type_ids=!0}class ep extends ed{return_token_type_ids=!0}class ef extends ed{return_token_type_ids=!0}class eg extends ed{return_token_type_ids=!0}class em extends ed{return_token_type_ids=!0}class ek extends ed{return_token_type_ids=!0}class ex extends ed{return_token_type_ids=!0}class ew extends ed{return_token_type_ids=!0}class ey extends ed{return_token_type_ids=!0}class eb extends ed{}class ev extends ed{}class ez extends ed{return_token_type_ids=!0;constructor(e,t){super(e,t),console.warn('WARNING: `XLMTokenizer` is not yet supported by Hugging Face\'s "fast" tokenizers library. Therefore, you may experience slightly inaccurate results.')}}class eA extends ed{return_token_type_ids=!0}class eS extends ed{}class eE extends ed{_default_chat_template='{% for message in messages %}" "{{ message.content }}{{ eos_token }}" "{% endfor %}'}class eT extends ed{}class eC extends ed{constructor(e,t){super(e,t),this.languageRegex=/^[a-z]{2}_[A-Z]{2}$/,this.language_codes=this.special_tokens.filter(e=>this.languageRegex.test(e)),this.lang_to_token=e=>e}_build_translation_inputs(e,t,s){return eB(this,e,t,s)}}class ej extends eC{}class eM extends ed{}class eP extends eE{constructor(e,t){let s=".,!?β¦γοΌγΰ₯€ΫΨ",n=e.pre_tokenizer?.pretokenizers[0]?.pattern;n&&n.Regex===` ?[^(\\s|[${s}])]+`&&(n.Regex=` ?[^\\s${s}]+`),super(e,t)}}class e$ extends ed{_default_chat_template=`{% if messages[0]['role'] == 'system' %}{% set loop_messages = messages[1:] %}{% set system_message = messages[0]['content'] %}{% elif USE_DEFAULT_PROMPT == true and not '<<SYS>>' in messages[0]['content'] %}{% set loop_messages = messages %}{% set system_message = 'DEFAULT_SYSTEM_MESSAGE' %}{% else %}{% set loop_messages = messages %}{% set system_message = false %}{% endif %}{% for message in loop_messages %}{% if (message['role'] == 'user') != (loop.index0 % 2 == 0) %}{{ raise_exception('Conversation roles must alternate user/assistant/user/assistant/...') }}{% endif %}{% if loop.index0 == 0 and system_message != false %}{% set content = '<<SYS>>
|
5 |
' + system_message + '
|
6 |
<</SYS>>
|
7 |
|
@@ -9,4 +9,4 @@
|
|
9 |
' + content.strip() + '
|
10 |
<</SYS>>
|
11 |
|
12 |
-
' }}{% elif message['role'] == 'assistant' %}{{ ' ' + content.strip() + ' ' + eos_token }}{% endif %}{% endfor %}`;DEFAULT_SYSTEM_PROMPT="You are a helpful, respectful and honest assistant. Always answer as helpfully as possible, while being safe. Your answers should not include any harmful, unethical, racist, sexist, toxic, dangerous, or illegal content. Please ensure that your responses are socially unbiased and positive in nature.\n\nIf a question does not make any sense, or is not factually coherent, explain why instead of answering something not correct. If you don't know the answer to a question, please don't share false information.";constructor(e,t){super(e,t),this.use_default_system_prompt=t.use_default_system_prompt??!1,this.legacy=t.legacy??!0,this.legacy||(this.normalizer=null,this.pre_tokenizer=new ei({replacement:"β",add_prefix_space:!0,prepend_scheme:"first"}))}_encode_text(e){if(null===e)return null;if(this.legacy||0===e.length)return super._encode_text(e);let t=super._encode_text("β"+e.replaceAll("β"," "));return t.length>1&&"β"===t[0]&&this.special_tokens.includes(t[1])&&(t=t.slice(1)),t}get default_chat_template(){return super.default_chat_template.replaceAll("USE_DEFAULT_PROMPT",this.use_default_system_prompt?"true":"false").replaceAll("DEFAULT_SYSTEM_MESSAGE",this.DEFAULT_SYSTEM_PROMPT.replaceAll("\n","\\n").replaceAll("'","\\'"))}}class eR extends e${}class eN extends ed{}class eF extends ed{}class eL extends ed{}class eO extends ed{}class eU extends ed{}class eW extends ed{}class eG extends ed{_default_chat_template="{% if messages[0]['role'] == 'system' %}{{ raise_exception('System role not supported') }}{% endif %}{% for message in messages %}{% if (message['role'] == 'user') != (loop.index0 % 2 == 0) %}{{ raise_exception('Conversation roles must alternate user/assistant/user/assistant/...') }}{% endif %}{% if (message['role'] == 'assistant') %}{% set role = 'model' %}{% else %}{% set role = message['role'] %}{% endif %}{{ '<start_of_turn>' + role + '\n' + message['content'] | trim + '<end_of_turn>\n' }}{% endfor %}{% if add_generation_prompt %}{{'<start_of_turn>model\n'}}{% endif %}"}class eI extends ed{}function eB(e,t,s,n){if(!("language_codes"in e)||!Array.isArray(e.language_codes))throw Error("Tokenizer must have `language_codes` attribute set and it should be an array of language ids.");if(!("languageRegex"in e)||!(e.languageRegex instanceof RegExp))throw Error("Tokenizer must have `languageRegex` attribute set and it should be a regular expression.");if(!("lang_to_token"in e)||"function"!=typeof e.lang_to_token)throw Error("Tokenizer must have `lang_to_token` attribute set and it should be a function.");let i=n.src_lang,r=n.tgt_lang;if(!e.language_codes.includes(r))throw Error(`Target language code "${r}" is not valid. Must be one of: {${e.language_codes.join(", ")}}`);if(void 0!==i){if(!e.language_codes.includes(i))throw Error(`Source language code "${i}" is not valid. Must be one of: {${e.language_codes.join(", ")}}`);for(let t of e.post_processor.config.single)if("SpecialToken"in t&&e.languageRegex.test(t.SpecialToken.id)){t.SpecialToken.id=e.lang_to_token(i);break}}return n.forced_bos_token_id=e.model.convert_tokens_to_ids([e.lang_to_token(r)])[0],e._call(t,s)}class eD extends ed{constructor(e,t){super(e,t),this.languageRegex=/^[a-z]{3}_[A-Z][a-z]{3}$/,this.language_codes=this.special_tokens.filter(e=>this.languageRegex.test(e)),this.lang_to_token=e=>e}_build_translation_inputs(e,t,s){return eB(this,e,t,s)}}class eq extends ed{constructor(e,t){super(e,t),this.languageRegex=/^__[a-z]{2,3}__$/,this.language_codes=this.special_tokens.filter(e=>this.languageRegex.test(e)).map(e=>e.slice(2,-2)),this.lang_to_token=e=>`__${e}__`}_build_translation_inputs(e,t,s){return eB(this,e,t,s)}}let eY=[["en","english"],["zh","chinese"],["de","german"],["es","spanish"],["ru","russian"],["ko","korean"],["fr","french"],["ja","japanese"],["pt","portuguese"],["tr","turkish"],["pl","polish"],["ca","catalan"],["nl","dutch"],["ar","arabic"],["sv","swedish"],["it","italian"],["id","indonesian"],["hi","hindi"],["fi","finnish"],["vi","vietnamese"],["he","hebrew"],["uk","ukrainian"],["el","greek"],["ms","malay"],["cs","czech"],["ro","romanian"],["da","danish"],["hu","hungarian"],["ta","tamil"],["no","norwegian"],["th","thai"],["ur","urdu"],["hr","croatian"],["bg","bulgarian"],["lt","lithuanian"],["la","latin"],["mi","maori"],["ml","malayalam"],["cy","welsh"],["sk","slovak"],["te","telugu"],["fa","persian"],["lv","latvian"],["bn","bengali"],["sr","serbian"],["az","azerbaijani"],["sl","slovenian"],["kn","kannada"],["et","estonian"],["mk","macedonian"],["br","breton"],["eu","basque"],["is","icelandic"],["hy","armenian"],["ne","nepali"],["mn","mongolian"],["bs","bosnian"],["kk","kazakh"],["sq","albanian"],["sw","swahili"],["gl","galician"],["mr","marathi"],["pa","punjabi"],["si","sinhala"],["km","khmer"],["sn","shona"],["yo","yoruba"],["so","somali"],["af","afrikaans"],["oc","occitan"],["ka","georgian"],["be","belarusian"],["tg","tajik"],["sd","sindhi"],["gu","gujarati"],["am","amharic"],["yi","yiddish"],["lo","lao"],["uz","uzbek"],["fo","faroese"],["ht","haitian creole"],["ps","pashto"],["tk","turkmen"],["nn","nynorsk"],["mt","maltese"],["sa","sanskrit"],["lb","luxembourgish"],["my","myanmar"],["bo","tibetan"],["tl","tagalog"],["mg","malagasy"],["as","assamese"],["tt","tatar"],["haw","hawaiian"],["ln","lingala"],["ha","hausa"],["ba","bashkir"],["jw","javanese"],["su","sundanese"]],eK=new Map(eY),eZ=new Map([...eY.map(([e,t])=>[t,e]),["burmese","my"],["valencian","ca"],["flemish","nl"],["haitian","ht"],["letzeburgesch","lb"],["pushto","ps"],["panjabi","pa"],["moldavian","ro"],["moldovan","ro"],["sinhalese","si"],["castilian","es"]]);class eV extends ed{_default_chat_template='{% for message in messages %}" "{{ message.content }}{{ eos_token }}" "{% endfor %}';_decode_asr(e,{return_timestamps:t=!1,return_language:s=!1,time_precision:n=null,force_full_sequences:i=!0}={}){if(null===n)throw Error("Must specify time_precision");let o=null,a="word"===t;function l(){return{language:o,timestamp:[null,null],text:""}}let c=[],h=l(),u=0,d=this.model.convert_tokens_to_ids(["<|notimestamps|>"])[0]+1,_=[],p=[],f=!1,g=null,m=new Set(this.all_special_ids);for(let s of e){let e=s.tokens,i=a?s.token_timestamps:null,k=null,x=d;if("stride"in s){let[t,i,r]=s.stride;if(u-=i,g=t-r,i&&(x=i/n+d),r)for(let t=e.length-1;t>=0;--t){let s=e[t];if(s>=d){if(null!==k&&(s-d)*n<g)break;k=s}}}let w=[],y=[];for(let s=0;s<e.length;++s){let g=e[s];if(m.has(g)){let e=this.decode([g]),s=eK.get(e.slice(2,-2));if(void 0!==s){if(null!==o&&s!==o&&!t){_.push(w);let e=this.findLongestCommonSequence(_)[0],t=this.decode(e);h.text=t,c.push(h),_=[],w=[],h=l()}o=h.language=s}}else if(g>=d){let e=(g-d)*n+u,t=(0,r.NM)(e,2);if(null!==k&&g>=k)f=!0;else if(f||_.length>0&&g<x)f=!1;else if(null===h.timestamp[0])h.timestamp[0]=t;else if(t===h.timestamp[0]);else{h.timestamp[1]=t,_.push(w),a&&p.push(y);let[e,s]=this.findLongestCommonSequence(_,p),n=this.decode(e);h.text=n,a&&(h.words=this.collateWordTimestamps(e,s,o)),c.push(h),_=[],w=[],p=[],y=[],h=l()}}else if(w.push(g),a){let e,t=(0,r.NM)(i[s]+u,2);e=s+1<i.length?(0,r.NM)(i[s+1]+u,2):null,y.push([t,e])}}if("stride"in s){let[e,t,n]=s.stride;u+=e-n}w.length>0?(_.push(w),a&&p.push(y)):_.every(e=>0===e.length)&&(h=l(),_=[],w=[],p=[],y=[])}if(_.length>0){if(i&&t)throw Error("Whisper did not predict an ending timestamp, which can happen if audio is cut off in the middle of a word. Also make sure WhisperTimeStampLogitsProcessor was used during generation.");let[e,s]=this.findLongestCommonSequence(_,p),n=this.decode(e);h.text=n,a&&(h.words=this.collateWordTimestamps(e,s,o)),c.push(h)}let k=Object.create(null),x=c.map(e=>e.text).join("");if(t||s){for(let e=0;e<c.length;++e){let n=c[e];t||delete n.timestamp,s||delete n.language}if(a){let e=[];for(let t of c)for(let s of t.words)e.push(s);k={chunks:e}}else k={chunks:c}}return[x,k]}findLongestCommonSequence(e,t=null){let s=e[0],n=s.length,i=[],r=Array.isArray(t)&&t.length>0,o=r?[]:null,a=r?t[0]:null;for(let l=1;l<e.length;++l){let c=e[l],h=0,u=[n,n,0,0],d=c.length;for(let e=1;e<n+d;++e){let t=e/1e4,i=Math.max(0,n-e),r=Math.min(n,n+d-e),o=s.slice(i,r),a=Math.max(0,e-n),l=Math.min(d,e),_=c.slice(a,l);if(o.length!==_.length)throw Error("There is a bug within whisper `decode_asr` function, please report it. Dropping to prevent bad inference.");let p=o.filter((e,t)=>e===_[t]).length,f=p/e+t;p>1&&f>h&&(h=f,u=[i,r,a,l])}let[_,p,f,g]=u,m=Math.floor((p+_)/2),k=Math.floor((g+f)/2);i.push(...s.slice(0,m)),n=(s=c.slice(k)).length,r&&(o.push(...a.slice(0,m)),a=t[l].slice(k))}return(i.push(...s),r)?(o.push(...a),[i,o]):[i,[]]}collateWordTimestamps(e,t,s){let[n,i,r]=this.combineTokensIntoWords(e,s),o=[];for(let e=0;e<n.length;++e){let s=r[e];o.push({text:n[e],timestamp:[t[s.at(0)][0],t[s.at(-1)][1]]})}return o}combineTokensIntoWords(e,t,s="\"'β\xa1\xbf([{-",n="\"'.γ,οΌ!οΌ?οΌ:οΌβ)]}γ"){let i,r,o;return["chinese","japanese","thai","lao","myanmar"].includes(t=t??"english")?[i,r,o]=this.splitTokensOnUnicode(e):[i,r,o]=this.splitTokensOnSpaces(e),this.mergePunctuations(i,r,o,s,n)}decode(e,t){let s;return t&&t.decode_with_timestamps?(e instanceof o.es&&(e=d(e)),s=this.decodeWithTimestamps(e,t)):s=super.decode(e,t),s}decodeWithTimestamps(e,t){let s=t?.time_precision??.02,n=Array.from(this.all_special_ids).at(-1)+1,i=[[]];for(let t of e)if(t>=n){let e=(0,r.NM)((t-n)*s,2);i.push(`<|${e}|>`),i.push([])}else i[i.length-1].push(t);return(i=i.map(e=>"string"==typeof e?e:super.decode(e,t))).join("")}splitTokensOnUnicode(e){let t=this.decode(e,{decode_with_timestamps:!0}),s=[],n=[],i=[],r=[],o=[],a=0;for(let l=0;l<e.length;++l){let c=e[l];r.push(c),o.push(l);let h=this.decode(r,{decode_with_timestamps:!0});h.includes("οΏ½")&&"οΏ½"!==t[a+h.indexOf("οΏ½")]||(s.push(h),n.push(r),i.push(o),r=[],o=[],a+=h.length)}return[s,n,i]}splitTokensOnSpaces(e){let[t,s,n]=this.splitTokensOnUnicode(e),i=[],r=[],o=[],a=RegExp(`^[${f}]$`,"gu");for(let e=0;e<t.length;++e){let l=t[e],c=s[e],h=n[e],u=c[0]>=this.model.tokens_to_ids.get("<|endoftext|>"),d=l.startsWith(" "),_=l.trim(),p=a.test(_);if(u||d||p||0===i.length)i.push(l),r.push(c),o.push(h);else{let e=i.length-1;i[e]+=l,r[e].push(...c),o[e].push(...h)}}return[i,r,o]}mergePunctuations(e,t,s,i,r){let o=structuredClone(e),a=structuredClone(t),l=structuredClone(s),c=o.length-2,h=o.length-1;for(;c>=0;)o[c].startsWith(" ")&&i.includes(o[c].trim())?(o[h]=o[c]+o[h],a[h]=(0,n.eG)(a[c],a[h]),l[h]=(0,n.eG)(l[c],l[h]),o[c]="",a[c]=[],l[c]=[]):h=c,--c;for(c=0,h=1;h<o.length;)!o[c].endsWith(" ")&&r.includes(o[h])?(o[c]+=o[h],a[c]=(0,n.eG)(a[c],a[h]),l[c]=(0,n.eG)(l[c],l[h]),o[h]="",a[h]=[],l[h]=[]):c=h,++h;return[o.filter(e=>e),a.filter(e=>e.length>0),l.filter(e=>e.length>0)]}get_decoder_prompt_ids({language:e=null,task:t=null,no_timestamps:s=!0}={}){let n=[];if(e){e=e.toLowerCase();let t=eZ.get(e);if(void 0===t){if(eK.has(e))t=e;else{let t=2===e.length?eK.keys():eK.values();throw Error(`Language "${e}" is not supported. Must be one of: ${JSON.stringify(t)}`)}}let s=this.model.tokens_to_ids.get(`<|${t}|>`);if(void 0===s)throw Error(`Unable to find language "${t}" in model vocabulary. Please report this issue at https://github.com/xenova/transformers.js/issues/new/choose.`);n.push(s)}else n.push(null);if(t){if("transcribe"!==(t=t.toLowerCase())&&"translate"!==t)throw Error(`Task "${t}" is not supported. Must be one of: ["transcribe", "translate"]`);let e=this.model.tokens_to_ids.get(`<|${t}|>`);if(void 0===e)throw Error(`Unable to find task "${t}" in model vocabulary. Please report this issue at https://github.com/xenova/transformers.js/issues/new/choose.`);n.push(e)}else n.push(null);if(s){let e=this.model.tokens_to_ids.get("<|notimestamps|>");if(void 0===e)throw Error('Unable to find "<|notimestamps|>" in model vocabulary. Please report this issue at https://github.com/xenova/transformers.js/issues/new/choose.');n.push(e)}return n.map((e,t)=>[t+1,e]).filter(e=>null!==e[1])}}class eH extends ed{}class eJ extends ed{}class eQ extends ed{}class eX extends ed{constructor(e,t){super(e,t),this.languageRegex=/^(>>\w+<<)\s*/g,this.supported_language_codes=this.model.vocab.filter(e=>this.languageRegex.test(e)),console.warn('WARNING: `MarianTokenizer` is not yet supported by Hugging Face\'s "fast" tokenizers library. Therefore, you may experience slightly inaccurate results.')}_encode_text(e){if(null===e)return null;let[t,...s]=e.trim().split(this.languageRegex);if(0===s.length)return super._encode_text(t);if(2===s.length){let[e,t]=s;return this.supported_language_codes.includes(e)||console.warn(`Unsupported language code "${e}" detected, which may lead to unexpected behavior. Should be one of: ${JSON.stringify(this.supported_language_codes)}`),(0,n.eG)([e],super._encode_text(t))}}}class e0 extends ed{}class e1 extends ed{_default_chat_template="{% for message in messages %}{% if message['role'] == 'user' %}{{ ' ' }}{% endif %}{{ message['content'] }}{% if not loop.last %}{{ ' ' }}{% endif %}{% endfor %}{{ eos_token }}"}class e2 extends e1{}class e3 extends ed{}class e7 extends ed{}class e6 extends ed{constructor(e,t){super(e,t),this.decoder=new en({})}}class e8 extends ed{}class e9{static TOKENIZER_CLASS_MAPPING={T5Tokenizer:eS,DistilBertTokenizer:eb,CamembertTokenizer:ev,DebertaTokenizer:em,DebertaV2Tokenizer:ek,BertTokenizer:e_,HerbertTokenizer:ex,ConvBertTokenizer:ew,RoFormerTokenizer:ey,XLMTokenizer:ez,ElectraTokenizer:eA,MobileBertTokenizer:ef,SqueezeBertTokenizer:eg,AlbertTokenizer:ep,GPT2Tokenizer:eE,BartTokenizer:eT,MBartTokenizer:eC,MBart50Tokenizer:ej,RobertaTokenizer:eM,WhisperTokenizer:eV,CodeGenTokenizer:eH,CLIPTokenizer:eJ,SiglipTokenizer:eQ,MarianTokenizer:eX,BloomTokenizer:eP,NllbTokenizer:eD,M2M100Tokenizer:eq,LlamaTokenizer:e$,CodeLlamaTokenizer:eR,XLMRobertaTokenizer:eN,MPNetTokenizer:eF,FalconTokenizer:eL,GPTNeoXTokenizer:eO,EsmTokenizer:eU,Wav2Vec2CTCTokenizer:e0,BlenderbotTokenizer:e1,BlenderbotSmallTokenizer:e2,SpeechT5Tokenizer:e3,NougatTokenizer:e7,VitsTokenizer:e6,Qwen2Tokenizer:eW,GemmaTokenizer:eG,Grok1Tokenizer:eI,CohereTokenizer:e8,PreTrainedTokenizer:ed};static async from_pretrained(e,{quantized:t=!0,progress_callback:s=null,config:n=null,cache_dir:i=null,local_files_only:r=!1,revision:o="main",legacy:a=null}={}){let[l,h]=await c(e,{quantized:t,progress_callback:s,config:n,cache_dir:i,local_files_only:r,revision:o,legacy:a}),u=h.tokenizer_class?.replace(/Fast$/,"")??"PreTrainedTokenizer",d=this.TOKENIZER_CLASS_MAPPING[u];return d||(console.warn(`Unknown tokenizer class "${u}", attempting to construct from base class.`),d=ed),new d(l,h)}}}}]);
|
|
|
1 |
+
"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[165],{9046:function(e,t,s){s.d(t,{t2:function(){return e4}});var n=s(761),i=s(911),r=s(8709),o=s(2414),a=s(1510),l=s(4087);async function c(e,t){let s=await Promise.all([(0,i.yM)(e,"tokenizer.json",!0,t),(0,i.yM)(e,"tokenizer_config.json",!0,t)]);return null!==t.legacy&&(s[1].legacy=t.legacy),s}function h(e,t=!0){if(void 0!==e.Regex){let t=e.Regex.replace(/\\([#&~])/g,"$1");for(let[e,s]of g)t=t.replaceAll(e,s);return RegExp(t,"gu")}if(void 0===e.String)return console.warn("Unknown pattern type:",e),null;{let s=(0,n.hr)(e.String);return RegExp(t?s:`(${s})`,"gu")}}function u(e){return new Map(Object.entries(e))}function d(e){let t=e.dims;switch(t.length){case 1:return e.tolist();case 2:if(1!==t[0])throw Error("Unable to decode tensor with `batch size !== 1`. Use `tokenizer.batch_decode(...)` for batched inputs.");return e.tolist()[0];default:throw Error(`Expected tensor to have 1-2 dimensions, got ${t.length}.`)}}function _(e){return e.replace(/ \./g,".").replace(/ \?/g,"?").replace(/ \!/g,"!").replace(/ ,/g,",").replace(/ \' /g,"'").replace(/ n\'t/g,"n't").replace(/ \'m/g,"'m").replace(/ \'s/g,"'s").replace(/ \'ve/g,"'ve").replace(/ \'re/g,"'re")}function p(e){return e.replace(/[\u0300-\u036f]/g,"")}let f="\\p{P}\\u0021-\\u002F\\u003A-\\u0040\\u005B-\\u0060\\u007B-\\u007E",g=new Map([["(?i:'s|'t|'re|'ve|'m|'ll|'d)","(?:'([sS]|[tT]|[rR][eE]|[vV][eE]|[mM]|[lL][lL]|[dD]))"]]);class m{constructor(e){this.content=e.content,this.id=e.id,this.single_word=e.single_word??!1,this.lstrip=e.lstrip??!1,this.rstrip=e.rstrip??!1,this.special=e.special??!1,this.normalized=e.normalized??null}}class k extends n.Ag{constructor(e){super(),this.config=e,this.vocab=[],this.tokens_to_ids=new Map,this.unk_token_id=void 0,this.unk_token=void 0,this.end_of_word_suffix=void 0,this.fuse_unk=this.config.fuse_unk??!1}static fromConfig(e,...t){switch(e.type){case"WordPiece":return new x(e);case"Unigram":return new w(e,...t);case"BPE":return new v(e);default:if(e.vocab)return new z(e,...t);throw Error(`Unknown TokenizerModel type: ${e.type}`)}}_call(e){let t=this.encode(e);return this.fuse_unk&&(t=function(e,t,s){let n=[],i=0;for(;i<e.length;){if(n.push(e[i]),(s.get(e[i])??t)!==t){++i;continue}for(;i<e.length&&(s.get(e[i])??t)===t;)++i}return n}(t,this.unk_token_id,this.tokens_to_ids)),t}encode(e){throw Error("encode should be implemented in subclass.")}convert_tokens_to_ids(e){return e.map(e=>this.tokens_to_ids.get(e)??this.unk_token_id)}convert_ids_to_tokens(e){return e.map(e=>this.vocab[e]??this.unk_token)}}class x extends k{constructor(e){for(let[t,s]of(super(e),this.tokens_to_ids=u(e.vocab),this.unk_token_id=this.tokens_to_ids.get(e.unk_token),this.unk_token=e.unk_token,this.max_input_chars_per_word=e.max_input_chars_per_word??100,this.vocab=Array(this.tokens_to_ids.size),this.tokens_to_ids))this.vocab[s]=t}encode(e){let t=[];for(let s of e){let e=[...s];if(e.length>this.max_input_chars_per_word){t.push(this.unk_token);continue}let n=!1,i=0,r=[];for(;i<e.length;){let t=e.length,s=null;for(;i<t;){let n=e.slice(i,t).join("");if(i>0&&(n=this.config.continuing_subword_prefix+n),this.tokens_to_ids.has(n)){s=n;break}--t}if(null===s){n=!0;break}r.push(s),i=t}n?t.push(this.unk_token):t.push(...r)}return t}}class w extends k{constructor(e,t){super(e);let s=e.vocab.length;this.vocab=Array(s),this.scores=Array(s);for(let t=0;t<s;++t){let s=e.vocab[t];this.vocab[t]=s[0],this.scores[t]=s[1]}this.unk_token_id=e.unk_id,this.unk_token=this.vocab[e.unk_id],this.tokens_to_ids=new Map(this.vocab.map((e,t)=>[e,t])),this.bosToken=" ",this.bosTokenId=this.tokens_to_ids.get(this.bosToken),this.eosToken=t.eos_token,this.eosTokenId=this.tokens_to_ids.get(this.eosToken),this.unkToken=this.vocab[this.unk_token_id],this.minScore=(0,r.VV)(this.scores)[0],this.unkScore=this.minScore-10,this.scores[this.unk_token_id]=this.unkScore,this.trie=new a.GA,this.trie.extend(this.vocab),this.fuse_unk=!0}populateNodes(e){let t=e.sentence,s=t.length,n=0;for(;n<s;){let s=!1,i=[];for(let r of this.trie.commonPrefixSearch(t.slice(n))){i.push(r);let t=this.tokens_to_ids.get(r),o=this.scores[t],a=r.length;e.insert(n,a,o,t),s||1!==a||(s=!0)}s||e.insert(n,1,this.unkScore,this.unk_token_id),n+=1}}tokenize(e){let t=new a.pQ(e,this.bosTokenId,this.eosTokenId);return this.populateNodes(t),t.tokens()}encode(e){let t=[];for(let s of e){let e=this.tokenize(s);t.push(...e)}return t}}let y=(()=>{let e=[...Array.from({length:94},(e,t)=>t+33),...Array.from({length:12},(e,t)=>t+161),...Array.from({length:82},(e,t)=>t+174)],t=e.slice(),s=0;for(let n=0;n<256;++n)e.includes(n)||(e.push(n),t.push(256+s),s+=1);let n=t.map(e=>String.fromCharCode(e));return Object.fromEntries(e.map((e,t)=>[e,n[t]]))})(),b=(0,n.$2)(y);class v extends k{constructor(e){for(let[t,s]of(super(e),this.BPE_SPLIT_TOKEN=" ",this.tokens_to_ids=u(e.vocab),this.unk_token_id=this.tokens_to_ids.get(e.unk_token),this.unk_token=e.unk_token,this.vocab=Array(this.tokens_to_ids.size),this.tokens_to_ids))this.vocab[s]=t;this.bpe_ranks=new Map(e.merges.map((e,t)=>[e,t])),this.merges=e.merges.map(e=>e.split(this.BPE_SPLIT_TOKEN)),this.end_of_word_suffix=e.end_of_word_suffix,this.continuing_subword_suffix=e.continuing_subword_suffix??null,this.byte_fallback=this.config.byte_fallback??!1,this.byte_fallback&&(this.text_encoder=new TextEncoder),this.ignore_merges=this.config.ignore_merges??!1,this.cache=new Map}bpe(e){if(0===e.length)return[];let t=this.cache.get(e);if(void 0!==t)return t;let s=Array.from(e);this.end_of_word_suffix&&(s[s.length-1]+=this.end_of_word_suffix);let n=[];if(s.length>1){let e=new a.Z3((e,t)=>e.score<t.score),t={token:s[0],bias:0,prev:null,next:null},i=t;for(let t=1;t<s.length;++t){let n={bias:t/s.length,token:s[t],prev:i,next:null};i.next=n,this._add_node(e,i),i=n}for(;!e.isEmpty();){let s=e.pop();if(s.deleted||!s.next||s.next.deleted)continue;if(s.deleted=!0,s.next.deleted=!0,s.prev){let e={...s.prev};s.prev.deleted=!0,s.prev=e,e.prev?e.prev.next=e:t=e}let n={token:s.token+s.next.token,bias:s.bias,prev:s.prev,next:s.next.next};n.prev?(n.prev.next=n,this._add_node(e,n.prev)):t=n,n.next&&(n.next.prev=n,this._add_node(e,n))}for(let e=t;null!==e;e=e.next)n.push(e.token)}else n=s;if(this.continuing_subword_suffix)for(let e=0;e<n.length-1;++e)n[e]+=this.continuing_subword_suffix;return this.cache.set(e,n),n}_add_node(e,t){let s=this.bpe_ranks.get(t.token+this.BPE_SPLIT_TOKEN+t.next.token);void 0!==s&&(t.score=s+t.bias,e.push(t))}encode(e){let t=[];for(let s of e){if(this.ignore_merges&&this.tokens_to_ids.has(s)){t.push(s);continue}for(let e of this.bpe(s))this.tokens_to_ids.has(e)?t.push(e):this.byte_fallback?t.push(...Array.from(this.text_encoder.encode(e)).map(e=>`<0x${e.toString(16).toUpperCase().padStart(2,"0")}>`)):t.push(this.unk_token)}return t}}class z extends k{constructor(e,t){for(let[s,n]of(super(e),this.tokens_to_ids=u(t.target_lang?e.vocab[t.target_lang]:e.vocab),this.bos_token=t.bos_token,this.bos_token_id=this.tokens_to_ids.get(this.bos_token),this.eos_token=t.eos_token,this.eos_token_id=this.tokens_to_ids.get(this.eos_token),this.pad_token=t.pad_token,this.pad_token_id=this.tokens_to_ids.get(this.pad_token),this.unk_token=t.unk_token,this.unk_token_id=this.tokens_to_ids.get(this.unk_token),this.vocab=Array(this.tokens_to_ids.size),this.tokens_to_ids))this.vocab[n]=s}encode(e){return e}}class A extends n.Ag{constructor(e){super(),this.config=e}static fromConfig(e){if(null===e)return null;switch(e.type){case"BertNormalizer":return new N(e);case"Precompiled":return new ea(e);case"Sequence":return new R(e);case"Replace":return new S(e);case"NFC":return new E(e);case"NFKC":return new T(e);case"NFKD":return new C(e);case"Strip":return new j(e);case"StripAccents":return new M(e);case"Lowercase":return new P(e);case"Prepend":return new $(e);default:throw Error(`Unknown Normalizer type: ${e.type}`)}}normalize(e){throw Error("normalize should be implemented in subclass.")}_call(e){return this.normalize(e)}}class S extends A{normalize(e){let t=h(this.config.pattern);return null===t?e:e.replaceAll(t,this.config.content)}}class E extends A{normalize(e){return e=e.normalize("NFC")}}class T extends A{normalize(e){return e=e.normalize("NFKC")}}class C extends A{normalize(e){return e=e.normalize("NFKD")}}class j extends A{normalize(e){return this.config.strip_left&&this.config.strip_right?e=e.trim():(this.config.strip_left&&(e=e.trimStart()),this.config.strip_right&&(e=e.trimEnd())),e}}class M extends A{normalize(e){return e=p(e)}}class P extends A{normalize(e){return e=e.toLowerCase()}}class $ extends A{normalize(e){return e=this.config.prepend+e}}class R extends A{constructor(e){super(e),this.normalizers=e.normalizers.map(e=>A.fromConfig(e))}normalize(e){return this.normalizers.reduce((e,t)=>t.normalize(e),e)}}class N extends A{_tokenize_chinese_chars(e){let t=[];for(let s=0;s<e.length;++s){let n=e[s],i=n.charCodeAt(0);this._is_chinese_char(i)?(t.push(" "),t.push(n),t.push(" ")):t.push(n)}return t.join("")}_is_chinese_char(e){return e>=19968&&e<=40959||e>=13312&&e<=19903||e>=131072&&e<=173791||e>=173824&&e<=177983||e>=177984&&e<=178207||e>=178208&&e<=183983||e>=63744&&e<=64255||e>=194560&&e<=195103}stripAccents(e){return e.normalize("NFD").replace(/[\u0300-\u036f]/g,"")}_is_control(e){switch(e){case" ":case"\n":case"\r":return!1;default:return/^\p{Cc}|\p{Cf}|\p{Co}|\p{Cs}$/u.test(e)}}_clean_text(e){let t=[];for(let s of e){let e=s.charCodeAt(0);0===e||65533===e||this._is_control(s)||(/^\s$/.test(s)?t.push(" "):t.push(s))}return t.join("")}normalize(e){return this.config.clean_text&&(e=this._clean_text(e)),this.config.handle_chinese_chars&&(e=this._tokenize_chinese_chars(e)),this.config.lowercase?(e=e.toLowerCase(),!1!==this.config.strip_accents&&(e=this.stripAccents(e))):this.config.strip_accents&&(e=this.stripAccents(e)),e}}class F extends n.Ag{static fromConfig(e){if(null===e)return null;switch(e.type){case"BertPreTokenizer":return new L(e);case"Sequence":return new el(e);case"Whitespace":return new ec(e);case"WhitespaceSplit":return new eh(e);case"Metaspace":return new er(e);case"ByteLevel":return new O(e);case"Split":return new U(e);case"Punctuation":return new W(e);case"Digits":return new G(e);case"Replace":return new eu(e);default:throw Error(`Unknown PreTokenizer type: ${e.type}`)}}pre_tokenize_text(e,t){throw Error("pre_tokenize_text should be implemented in subclass.")}pre_tokenize(e,t){return(Array.isArray(e)?e.map(e=>this.pre_tokenize_text(e,t)):this.pre_tokenize_text(e,t)).flat()}_call(e,t){return this.pre_tokenize(e,t)}}class L extends F{constructor(e){super(),this.pattern=RegExp(`[^\\s${f}]+|[${f}]`,"gu")}pre_tokenize_text(e,t){return e.trim().match(this.pattern)||[]}}class O extends F{constructor(e){super(),this.config=e,this.add_prefix_space=this.config.add_prefix_space,this.trim_offsets=this.config.trim_offsets,this.use_regex=this.config.use_regex??!0,this.pattern=/'s|'t|'re|'ve|'m|'ll|'d| ?\p{L}+| ?\p{N}+| ?[^\s\p{L}\p{N}]+|\s+(?!\S)|\s+/gu,this.byte_encoder=y,this.text_encoder=new TextEncoder}pre_tokenize_text(e,t){return this.add_prefix_space&&!e.startsWith(" ")&&(e=" "+e),(this.use_regex?e.match(this.pattern)||[]:[e]).map(e=>Array.from(this.text_encoder.encode(e),e=>this.byte_encoder[e]).join(""))}}class U extends F{constructor(e){super(),this.config=e,this.pattern=h(this.config.pattern,this.config.invert)}pre_tokenize_text(e,t){return null===this.pattern?[]:this.config.invert?e.match(this.pattern)||[]:function(e,t){let s=[],n=0;for(let i of e.matchAll(t)){let t=i[0];n<i.index&&s.push(e.slice(n,i.index)),t.length>0&&s.push(t),n=i.index+t.length}return n<e.length&&s.push(e.slice(n)),s}(e,this.pattern)}}class W extends F{constructor(e){super(),this.config=e,this.pattern=RegExp(`[^${f}]+|[${f}]+`,"gu")}pre_tokenize_text(e,t){return e.match(this.pattern)||[]}}class G extends F{constructor(e){super(),this.config=e;let t=`[^\\d]+|\\d${this.config.individual_digits?"":"+"}`;this.pattern=RegExp(t,"gu")}pre_tokenize_text(e,t){return e.match(this.pattern)||[]}}class I extends n.Ag{constructor(e){super(),this.config=e}static fromConfig(e){if(null===e)return null;switch(e.type){case"TemplateProcessing":return new q(e);case"ByteLevel":return new Y(e);case"RobertaProcessing":return new D(e);case"BertProcessing":return new B(e);case"Sequence":return new K(e);default:throw Error(`Unknown PostProcessor type: ${e.type}`)}}post_process(e,...t){throw Error("post_process should be implemented in subclass.")}_call(e,...t){return this.post_process(e,...t)}}class B extends I{constructor(e){super(e),this.cls=e.cls[0],this.sep=e.sep[0]}post_process(e,t=null,{add_special_tokens:s=!0}={}){s&&(e=(0,n.eG)([this.cls],e,[this.sep]));let i=Array(e.length).fill(0);if(null!==t){let r=s&&this instanceof D?[this.sep]:[],o=s?[this.sep]:[];e=(0,n.eG)(e,r,t,o),i=(0,n.eG)(i,Array(t.length+r.length+o.length).fill(1))}return{tokens:e,token_type_ids:i}}}class D extends B{}class q extends I{constructor(e){super(e),this.single=e.single,this.pair=e.pair}post_process(e,t=null,{add_special_tokens:s=!0}={}){let i=null===t?this.single:this.pair,r=[],o=[];for(let a of i)"SpecialToken"in a?s&&(r.push(a.SpecialToken.id),o.push(a.SpecialToken.type_id)):"Sequence"in a&&("A"===a.Sequence.id?(r=(0,n.eG)(r,e),o=(0,n.eG)(o,Array(e.length).fill(a.Sequence.type_id))):"B"===a.Sequence.id&&(r=(0,n.eG)(r,t),o=(0,n.eG)(o,Array(t.length).fill(a.Sequence.type_id))));return{tokens:r,token_type_ids:o}}}class Y extends I{post_process(e,t=null){return t&&(e=(0,n.eG)(e,t)),{tokens:e}}}class K extends I{constructor(e){super(e),this.processors=e.processors.map(e=>I.fromConfig(e))}post_process(e,t=null,s={}){let n;for(let i of this.processors)if(i instanceof Y)e=i.post_process(e).tokens,t&&(t=i.post_process(t).tokens);else{let r=i.post_process(e,t,s);e=r.tokens,n=r.token_type_ids}return{tokens:e,token_type_ids:n}}}class Z extends n.Ag{constructor(e){super(),this.config=e,this.added_tokens=[],this.end_of_word_suffix=null,this.trim_offsets=e.trim_offsets}static fromConfig(e){if(null===e)return null;switch(e.type){case"WordPiece":return new X(e);case"Metaspace":return new eo(e);case"ByteLevel":return new ee(e);case"Replace":return new V(e);case"ByteFallback":return new H(e);case"Fuse":return new J(e);case"Strip":return new Q(e);case"Sequence":return new es(e);case"CTC":return new et(e);case"BPEDecoder":return new en(e);default:throw Error(`Unknown Decoder type: ${e.type}`)}}_call(e){return this.decode(e)}decode(e){return this.decode_chain(e).join("")}decode_chain(e){throw Error("`decode_chain` should be implemented in subclass.")}}class V extends Z{decode_chain(e){let t=h(this.config.pattern);return null===t?e:e.map(e=>e.replaceAll(t,this.config.content))}}class H extends Z{constructor(e){super(e),this.text_decoder=new TextDecoder}decode_chain(e){let t=[],s=[];for(let n of e){let e=null;if(6===n.length&&n.startsWith("<0x")&&n.endsWith(">")){let t=parseInt(n.slice(3,5),16);isNaN(t)||(e=t)}if(null!==e)s.push(e);else{if(s.length>0){let e=this.text_decoder.decode(Uint8Array.from(s));t.push(e),s=[]}t.push(n)}}if(s.length>0){let e=this.text_decoder.decode(Uint8Array.from(s));t.push(e),s=[]}return t}}class J extends Z{decode_chain(e){return[e.join("")]}}class Q extends Z{constructor(e){super(e),this.content=this.config.content,this.start=this.config.start,this.stop=this.config.stop}decode_chain(e){return e.map(e=>{let t=0;for(let s=0;s<this.start;++s){if(e[s]===this.content){t=s+1;continue}break}let s=e.length;for(let t=0;t<this.stop;++t){let n=e.length-t-1;if(e[n]===this.content){s=n;continue}break}return e.slice(t,s)})}}class X extends Z{constructor(e){super(e),this.cleanup=e.cleanup}decode_chain(e){return e.map((e,t)=>(0!==t&&(e=e.startsWith(this.config.prefix)?e.replace(this.config.prefix,""):" "+e),this.cleanup&&(e=_(e)),e))}}class ee extends Z{constructor(e){super(e),this.byte_decoder=b,this.text_decoder=new TextDecoder("utf-8",{fatal:!1,ignoreBOM:!0}),this.end_of_word_suffix=null}convert_tokens_to_string(e){let t=new Uint8Array([...e.join("")].map(e=>this.byte_decoder[e]));return this.text_decoder.decode(t)}decode_chain(e){let t=[],s=[];for(let n of e)void 0!==this.added_tokens.find(e=>e.content===n)?(s.length>0&&(t.push(this.convert_tokens_to_string(s)),s=[]),t.push(n)):s.push(n);return s.length>0&&t.push(this.convert_tokens_to_string(s)),t}}class et extends Z{constructor(e){super(e),this.pad_token=this.config.pad_token,this.word_delimiter_token=this.config.word_delimiter_token,this.cleanup=this.config.cleanup}convert_tokens_to_string(e){if(0===e.length)return"";let t=[e[0]];for(let s=1;s<e.length;++s)e[s]!==t.at(-1)&&t.push(e[s]);let s=t.filter(e=>e!==this.pad_token).join("");return this.cleanup&&(s=_(s).replaceAll(this.word_delimiter_token," ").trim()),s}decode_chain(e){return[this.convert_tokens_to_string(e)]}}class es extends Z{constructor(e){super(e),this.decoders=e.decoders.map(e=>Z.fromConfig(e))}decode_chain(e){return this.decoders.reduce((e,t)=>t.decode_chain(e),e)}}class en extends Z{constructor(e){super(e),this.suffix=this.config.suffix}decode_chain(e){return e.map((t,s)=>t.replaceAll(this.suffix,s===e.length-1?"":" "))}}class ei extends Z{decode_chain(e){let t="";for(let s=1;s<e.length;s+=2)t+=e[s];return[t]}}class er extends F{constructor(e){super(),this.addPrefixSpace=e.add_prefix_space,this.replacement=e.replacement,this.strRep=e.str_rep||this.replacement,this.prepend_scheme=e.prepend_scheme??"always"}pre_tokenize_text(e,{section_index:t}={}){let s=e.replaceAll(" ",this.strRep);return this.addPrefixSpace&&!s.startsWith(this.replacement)&&("always"===this.prepend_scheme||"first"===this.prepend_scheme&&0===t)&&(s=this.strRep+s),[s]}}class eo extends Z{constructor(e){super(e),this.addPrefixSpace=e.add_prefix_space,this.replacement=e.replacement}decode_chain(e){let t=[];for(let s=0;s<e.length;++s){let n=e[s].replaceAll(this.replacement," ");this.addPrefixSpace&&0==s&&n.startsWith(" ")&&(n=n.substring(1)),t.push(n)}return t}}class ea extends A{constructor(e){super(e),this.charsmap=e.precompiled_charsmap}normalize(e){return e=(e=(e=e.replace(/[\u0001-\u0008\u000B\u000E-\u001F\u007F\u008F\u009F]/gm,"")).replace(/[\u0009\u000A\u000C\u000D\u1680\u200B\u200C\u200E\u200F\u2028\u2029\u2581\uFEFF\uFFFD]/gm," ")).includes("ο½")?e.split("ο½").map(e=>e.normalize("NFKC")).join("ο½"):e.normalize("NFKC")}}class el extends F{constructor(e){super(),this.tokenizers=e.pretokenizers.map(e=>F.fromConfig(e))}pre_tokenize_text(e,t){return this.tokenizers.reduce((e,s)=>s.pre_tokenize(e,t),[e])}}class ec extends F{constructor(e){super()}pre_tokenize_text(e,t){return e.match(/\w+|[^\w\s]+/g)||[]}}class eh extends F{constructor(e){super()}pre_tokenize_text(e,t){return e.match(/\S+/g)||[]}}class eu extends F{constructor(e){super(),this.config=e,this.pattern=h(this.config.pattern),this.content=this.config.content}pre_tokenize_text(e,t){return null===this.pattern?[e]:[e.replaceAll(this.pattern,this.config.content)]}}let ed=["bos_token","eos_token","unk_token","sep_token","pad_token","cls_token","mask_token"];class e_ extends n.Ag{return_token_type_ids=!1;_default_chat_template=`{% for message in messages %}{{'<|im_start|>' + message['role'] + '
|
2 |
' + message['content'] + '<|im_end|>' + '
|
3 |
'}}{% endfor %}{% if add_generation_prompt %}{{ '<|im_start|>assistant
|
4 |
+
' }}{% endif %}`;constructor(e,t){for(let s of(super(),this._tokenizer_config=t,this.normalizer=A.fromConfig(e.normalizer),this.pre_tokenizer=F.fromConfig(e.pre_tokenizer),this.model=k.fromConfig(e.model,t),this.post_processor=I.fromConfig(e.post_processor),this.decoder=Z.fromConfig(e.decoder),this.special_tokens=[],this.all_special_ids=[],this.added_tokens=[],e.added_tokens)){let e=new m(s);this.added_tokens.push(e),this.model.tokens_to_ids.set(e.content,e.id),this.model.vocab[e.id]=e.content,e.special&&(this.special_tokens.push(e.content),this.all_special_ids.push(e.id))}if(this.additional_special_tokens=t.additional_special_tokens??[],this.special_tokens.push(...this.additional_special_tokens),this.special_tokens=[...new Set(this.special_tokens)],this.decoder&&(this.decoder.added_tokens=this.added_tokens,this.decoder.end_of_word_suffix=this.model.end_of_word_suffix),this.added_tokens_regex=this.added_tokens.length>0?new RegExp(this.added_tokens.map(e=>`${e.lstrip?"\\s*":""}(${(0,n.hr)(e.content)})${e.rstrip?"\\s*":""}`).join("|")):null,this.mask_token=this.getToken("mask_token"),this.mask_token_id=this.model.tokens_to_ids.get(this.mask_token),this.pad_token=this.getToken("pad_token","eos_token"),this.pad_token_id=this.model.tokens_to_ids.get(this.pad_token),this.sep_token=this.getToken("sep_token"),this.sep_token_id=this.model.tokens_to_ids.get(this.sep_token),this.unk_token=this.getToken("unk_token"),this.unk_token_id=this.model.tokens_to_ids.get(this.unk_token),this.model_max_length=t.model_max_length,this.remove_space=t.remove_space,this.clean_up_tokenization_spaces=t.clean_up_tokenization_spaces??!0,this.do_lowercase_and_remove_accent=t.do_lowercase_and_remove_accent??!1,this.padding_side="right",this.legacy=!1,this.chat_template=t.chat_template??null,Array.isArray(this.chat_template)){let e=Object.create(null);for(let{name:t,template:s}of this.chat_template){if("string"!=typeof t||"string"!=typeof s)throw Error('Chat template must be a list of objects with "name" and "template" properties');e[t]=s}this.chat_template=e}this._compiled_template_cache=new Map}getToken(...e){for(let t of e){let e=this._tokenizer_config[t];if(e){if("object"!=typeof e)return e;if("AddedToken"===e.__type)return e.content;throw Error(`Unknown token: ${e}`)}}return null}static async from_pretrained(e,{progress_callback:t=null,config:s=null,cache_dir:n=null,local_files_only:i=!1,revision:r="main",legacy:o=null}={}){return new this(...await c(e,{progress_callback:t,config:s,cache_dir:n,local_files_only:i,revision:r,legacy:o}))}_call(e,{text_pair:t=null,add_special_tokens:s=!0,padding:i=!1,truncation:a=null,max_length:l=null,return_tensor:c=!0,return_token_type_ids:h=null}={}){let u;let d=Array.isArray(e);if(d){if(0===e.length)throw Error("text array must be non-empty");if(null!==t){if(Array.isArray(t)){if(e.length!==t.length)throw Error("text and text_pair must have the same length")}else throw Error("text_pair must also be an array");u=e.map((e,n)=>this._encode_plus(e,t[n],{add_special_tokens:s,return_token_type_ids:h}))}else u=e.map(e=>this._encode_plus(e,null,{add_special_tokens:s,return_token_type_ids:h}))}else{if(null==e)throw Error("text may not be null or undefined");if(Array.isArray(t))throw Error("When specifying `text_pair`, since `text` is a string, `text_pair` must also be a string (i.e., not an array).");u=[this._encode_plus(e,t,{add_special_tokens:s,return_token_type_ids:h})]}if(null===l?l="max_length"===i?this.model_max_length:(0,r.Fp)(u.map(e=>e.input_ids.length))[0]:a||console.warn("Truncation was not explicitly activated but `max_length` is provided a specific value, please use `truncation=true` to explicitly truncate examples to max length."),l=Math.min(l,this.model_max_length),i||a)for(let e=0;e<u.length;++e)u[e].input_ids.length!==l&&(u[e].input_ids.length>l?a&&function(e,t){for(let s of Object.keys(e))e[s].length=t}(u[e],l):i&&function(e,t,s,i){for(let r of Object.keys(e)){let o=t-e[r].length,a=s(r),l=Array(o).fill(a);e[r]="right"===i?(0,n.eG)(e[r],l):(0,n.eG)(l,e[r])}}(u[e],l,e=>"input_ids"===e?this.pad_token_id:0,this.padding_side));let _={};if(c){if(!(i&&a)&&u.some(e=>{for(let t of Object.keys(e))if(e[t].length!==u[0][t]?.length)return!0;return!1}))throw Error("Unable to create tensor, you should probably activate truncation and/or padding with 'padding=true' and 'truncation=true' to have batched tensors with the same length.");let e=[u.length,u[0].input_ids.length];for(let t of Object.keys(u[0]))_[t]=new o.es("int64",BigInt64Array.from(u.flatMap(e=>e[t]).map(BigInt)),e)}else{for(let e of Object.keys(u[0]))_[e]=u.map(t=>t[e]);if(!d)for(let e of Object.keys(_))_[e]=_[e][0]}return _}_encode_text(e){return null===e?null:(this.added_tokens_regex?e.split(this.added_tokens_regex).filter(e=>e):[e]).map((e,t)=>{if(void 0!==this.added_tokens.find(t=>t.content===e))return e;{if(!0===this.remove_space&&(e=e.trim().split(/\s+/).join(" ")),this.do_lowercase_and_remove_accent&&(e=p(e.toLowerCase())),null!==this.normalizer&&(e=this.normalizer(e)),0===e.length)return[];let s=null!==this.pre_tokenizer?this.pre_tokenizer(e,{section_index:t}):[e];return this.model(s)}}).flat()}_encode_plus(e,t=null,{add_special_tokens:s=!0,return_token_type_ids:i=null}={}){let r=this._encode_text(e),o=this._encode_text(t),a=this.post_processor?this.post_processor(r,o,{add_special_tokens:s}):{tokens:(0,n.eG)(r??[],o??[])},l=this.model.convert_tokens_to_ids(a.tokens),c={input_ids:l,attention_mask:Array(l.length).fill(1)};return(i??this.return_token_type_ids)&&a.token_type_ids&&(c.token_type_ids=a.token_type_ids),c}encode(e,t=null,{add_special_tokens:s=!0,return_token_type_ids:n=null}={}){let{input_ids:i}=this._encode_plus(e,t,{add_special_tokens:s,return_token_type_ids:n});return i}batch_decode(e,t={}){return e instanceof o.es&&(e=e.tolist()),e.map(e=>this.decode(e,t))}decode(e,t={}){if(e instanceof o.es&&(e=d(e)),!Array.isArray(e)||0===e.length||!(0,n.Wy)(e[0]))throw Error("token_ids must be a non-empty array of integers.");return this.decode_single(e,t)}decode_single(e,{skip_special_tokens:t=!1,clean_up_tokenization_spaces:s=null}){let n=this.model.convert_ids_to_tokens(e);t&&(n=n.filter(e=>!this.special_tokens.includes(e)));let i=this.decoder?this.decoder(n):n.join(" ");return this.decoder&&this.decoder.end_of_word_suffix&&(i=i.replaceAll(this.decoder.end_of_word_suffix," "),t&&(i=i.trim())),(s??this.clean_up_tokenization_spaces)&&(i=_(i)),i}get default_chat_template(){return this._warned_about_chat_template||(console.warn("No chat template is defined for this tokenizer - using a default chat template that implements the ChatML format. If the default is not appropriate for your model, please set `tokenizer.chat_template` to an appropriate template. See https://huggingface.co/docs/transformers/main/chat_templating for more information."),this._warned_about_chat_template=!0),this._default_chat_template}apply_chat_template(e,{chat_template:t=null,add_generation_prompt:s=!1,tokenize:n=!0,padding:i=!1,truncation:r=!1,max_length:o=null,return_tensor:a=!0,tokenizer_kwargs:c={},...h}={}){if(this.chat_template&&"object"==typeof this.chat_template||null===this.chat_template&&this.default_chat_template&&"object"==typeof this.default_chat_template){let e=this.chat_template??this.default_chat_template;if(null!==t&&Object.hasOwn(e,t))t=e[t];else if(null===t&&"default"in e)t=e.default;else if(null===t)throw Error(`This model has multiple chat templates with no default specified! Please either pass a chat template or the name of the template you wish to use to the 'chat_template' argument. Available template names are ${Object.keys(e).sort()}.`)}else t??=this.chat_template??this.default_chat_template;if("string"!=typeof t)throw Error(`chat_template must be a string, but got ${typeof t}`);let u=this._compiled_template_cache.get(t);void 0===u&&(u=new l.YS(t),this._compiled_template_cache.set(t,u));let d=Object.create(null);for(let e of ed){let t=this.getToken(e);t&&(d[e]=t)}let _=u.render({messages:e,add_generation_prompt:s,...d,...h});return n?this._call(_,{add_special_tokens:!1,padding:i,truncation:r,max_length:o,return_tensor:a,...c}).input_ids:_}}class ep extends e_{return_token_type_ids=!0}class ef extends e_{return_token_type_ids=!0}class eg extends e_{return_token_type_ids=!0}class em extends e_{return_token_type_ids=!0}class ek extends e_{return_token_type_ids=!0}class ex extends e_{return_token_type_ids=!0}class ew extends e_{return_token_type_ids=!0}class ey extends e_{return_token_type_ids=!0}class eb extends e_{return_token_type_ids=!0}class ev extends e_{}class ez extends e_{}class eA extends e_{return_token_type_ids=!0;constructor(e,t){super(e,t),console.warn('WARNING: `XLMTokenizer` is not yet supported by Hugging Face\'s "fast" tokenizers library. Therefore, you may experience slightly inaccurate results.')}}class eS extends e_{return_token_type_ids=!0}class eE extends e_{}class eT extends e_{_default_chat_template='{% for message in messages %}" "{{ message.content }}{{ eos_token }}" "{% endfor %}'}class eC extends e_{}class ej extends e_{constructor(e,t){super(e,t),this.languageRegex=/^[a-z]{2}_[A-Z]{2}$/,this.language_codes=this.special_tokens.filter(e=>this.languageRegex.test(e)),this.lang_to_token=e=>e}_build_translation_inputs(e,t,s){return eD(this,e,t,s)}}class eM extends ej{}class eP extends e_{}class e$ extends eT{constructor(e,t){let s=".,!?β¦γοΌγΰ₯€ΫΨ",n=e.pre_tokenizer?.pretokenizers[0]?.pattern;n&&n.Regex===` ?[^(\\s|[${s}])]+`&&(n.Regex=` ?[^\\s${s}]+`),super(e,t)}}class eR extends e_{_default_chat_template=`{% if messages[0]['role'] == 'system' %}{% set loop_messages = messages[1:] %}{% set system_message = messages[0]['content'] %}{% elif USE_DEFAULT_PROMPT == true and not '<<SYS>>' in messages[0]['content'] %}{% set loop_messages = messages %}{% set system_message = 'DEFAULT_SYSTEM_MESSAGE' %}{% else %}{% set loop_messages = messages %}{% set system_message = false %}{% endif %}{% for message in loop_messages %}{% if (message['role'] == 'user') != (loop.index0 % 2 == 0) %}{{ raise_exception('Conversation roles must alternate user/assistant/user/assistant/...') }}{% endif %}{% if loop.index0 == 0 and system_message != false %}{% set content = '<<SYS>>
|
5 |
' + system_message + '
|
6 |
<</SYS>>
|
7 |
|
|
|
9 |
' + content.strip() + '
|
10 |
<</SYS>>
|
11 |
|
12 |
+
' }}{% elif message['role'] == 'assistant' %}{{ ' ' + content.strip() + ' ' + eos_token }}{% endif %}{% endfor %}`;DEFAULT_SYSTEM_PROMPT="You are a helpful, respectful and honest assistant. Always answer as helpfully as possible, while being safe. Your answers should not include any harmful, unethical, racist, sexist, toxic, dangerous, or illegal content. Please ensure that your responses are socially unbiased and positive in nature.\n\nIf a question does not make any sense, or is not factually coherent, explain why instead of answering something not correct. If you don't know the answer to a question, please don't share false information.";constructor(e,t){super(e,t),this.use_default_system_prompt=t.use_default_system_prompt??!1,this.legacy=t.legacy??!0,this.legacy||(this.normalizer=null,this.pre_tokenizer=new er({replacement:"β",add_prefix_space:!0,prepend_scheme:"first"}))}_encode_text(e){if(null===e)return null;if(this.legacy||0===e.length)return super._encode_text(e);let t=super._encode_text("β"+e.replaceAll("β"," "));return t.length>1&&"β"===t[0]&&this.special_tokens.includes(t[1])&&(t=t.slice(1)),t}get default_chat_template(){return super.default_chat_template.replaceAll("USE_DEFAULT_PROMPT",this.use_default_system_prompt?"true":"false").replaceAll("DEFAULT_SYSTEM_MESSAGE",this.DEFAULT_SYSTEM_PROMPT.replaceAll("\n","\\n").replaceAll("'","\\'"))}}class eN extends eR{}class eF extends e_{}class eL extends e_{}class eO extends e_{}class eU extends e_{}class eW extends e_{}class eG extends e_{}class eI extends e_{_default_chat_template="{% if messages[0]['role'] == 'system' %}{{ raise_exception('System role not supported') }}{% endif %}{% for message in messages %}{% if (message['role'] == 'user') != (loop.index0 % 2 == 0) %}{{ raise_exception('Conversation roles must alternate user/assistant/user/assistant/...') }}{% endif %}{% if (message['role'] == 'assistant') %}{% set role = 'model' %}{% else %}{% set role = message['role'] %}{% endif %}{{ '<start_of_turn>' + role + '\n' + message['content'] | trim + '<end_of_turn>\n' }}{% endfor %}{% if add_generation_prompt %}{{'<start_of_turn>model\n'}}{% endif %}"}class eB extends e_{}function eD(e,t,s,n){if(!("language_codes"in e)||!Array.isArray(e.language_codes))throw Error("Tokenizer must have `language_codes` attribute set and it should be an array of language ids.");if(!("languageRegex"in e)||!(e.languageRegex instanceof RegExp))throw Error("Tokenizer must have `languageRegex` attribute set and it should be a regular expression.");if(!("lang_to_token"in e)||"function"!=typeof e.lang_to_token)throw Error("Tokenizer must have `lang_to_token` attribute set and it should be a function.");let i=n.src_lang,r=n.tgt_lang;if(!e.language_codes.includes(r))throw Error(`Target language code "${r}" is not valid. Must be one of: {${e.language_codes.join(", ")}}`);if(void 0!==i){if(!e.language_codes.includes(i))throw Error(`Source language code "${i}" is not valid. Must be one of: {${e.language_codes.join(", ")}}`);for(let t of e.post_processor.config.single)if("SpecialToken"in t&&e.languageRegex.test(t.SpecialToken.id)){t.SpecialToken.id=e.lang_to_token(i);break}}return n.forced_bos_token_id=e.model.convert_tokens_to_ids([e.lang_to_token(r)])[0],e._call(t,s)}class eq extends e_{constructor(e,t){super(e,t),this.languageRegex=/^[a-z]{3}_[A-Z][a-z]{3}$/,this.language_codes=this.special_tokens.filter(e=>this.languageRegex.test(e)),this.lang_to_token=e=>e}_build_translation_inputs(e,t,s){return eD(this,e,t,s)}}class eY extends e_{constructor(e,t){super(e,t),this.languageRegex=/^__[a-z]{2,3}__$/,this.language_codes=this.special_tokens.filter(e=>this.languageRegex.test(e)).map(e=>e.slice(2,-2)),this.lang_to_token=e=>`__${e}__`}_build_translation_inputs(e,t,s){return eD(this,e,t,s)}}let eK=[["en","english"],["zh","chinese"],["de","german"],["es","spanish"],["ru","russian"],["ko","korean"],["fr","french"],["ja","japanese"],["pt","portuguese"],["tr","turkish"],["pl","polish"],["ca","catalan"],["nl","dutch"],["ar","arabic"],["sv","swedish"],["it","italian"],["id","indonesian"],["hi","hindi"],["fi","finnish"],["vi","vietnamese"],["he","hebrew"],["uk","ukrainian"],["el","greek"],["ms","malay"],["cs","czech"],["ro","romanian"],["da","danish"],["hu","hungarian"],["ta","tamil"],["no","norwegian"],["th","thai"],["ur","urdu"],["hr","croatian"],["bg","bulgarian"],["lt","lithuanian"],["la","latin"],["mi","maori"],["ml","malayalam"],["cy","welsh"],["sk","slovak"],["te","telugu"],["fa","persian"],["lv","latvian"],["bn","bengali"],["sr","serbian"],["az","azerbaijani"],["sl","slovenian"],["kn","kannada"],["et","estonian"],["mk","macedonian"],["br","breton"],["eu","basque"],["is","icelandic"],["hy","armenian"],["ne","nepali"],["mn","mongolian"],["bs","bosnian"],["kk","kazakh"],["sq","albanian"],["sw","swahili"],["gl","galician"],["mr","marathi"],["pa","punjabi"],["si","sinhala"],["km","khmer"],["sn","shona"],["yo","yoruba"],["so","somali"],["af","afrikaans"],["oc","occitan"],["ka","georgian"],["be","belarusian"],["tg","tajik"],["sd","sindhi"],["gu","gujarati"],["am","amharic"],["yi","yiddish"],["lo","lao"],["uz","uzbek"],["fo","faroese"],["ht","haitian creole"],["ps","pashto"],["tk","turkmen"],["nn","nynorsk"],["mt","maltese"],["sa","sanskrit"],["lb","luxembourgish"],["my","myanmar"],["bo","tibetan"],["tl","tagalog"],["mg","malagasy"],["as","assamese"],["tt","tatar"],["haw","hawaiian"],["ln","lingala"],["ha","hausa"],["ba","bashkir"],["jw","javanese"],["su","sundanese"]],eZ=new Map(eK),eV=new Map([...eK.map(([e,t])=>[t,e]),["burmese","my"],["valencian","ca"],["flemish","nl"],["haitian","ht"],["letzeburgesch","lb"],["pushto","ps"],["panjabi","pa"],["moldavian","ro"],["moldovan","ro"],["sinhalese","si"],["castilian","es"]]);class eH extends e_{_default_chat_template='{% for message in messages %}" "{{ message.content }}{{ eos_token }}" "{% endfor %}';_decode_asr(e,{return_timestamps:t=!1,return_language:s=!1,time_precision:n=null,force_full_sequences:i=!0}={}){if(null===n)throw Error("Must specify time_precision");let o=null,a="word"===t;function l(){return{language:o,timestamp:[null,null],text:""}}let c=[],h=l(),u=0,d=this.model.convert_tokens_to_ids(["<|notimestamps|>"])[0]+1,_=[],p=[],f=!1,g=null,m=new Set(this.all_special_ids);for(let s of e){let e=s.tokens,i=a?s.token_timestamps:null,k=null,x=d;if("stride"in s){let[t,i,r]=s.stride;if(u-=i,g=t-r,i&&(x=i/n+d),r)for(let t=e.length-1;t>=0;--t){let s=e[t];if(s>=d){if(null!==k&&(s-d)*n<g)break;k=s}}}let w=[],y=[];for(let s=0;s<e.length;++s){let g=e[s];if(m.has(g)){let e=this.decode([g]),s=eZ.get(e.slice(2,-2));if(void 0!==s){if(null!==o&&s!==o&&!t){_.push(w);let e=this.findLongestCommonSequence(_)[0],t=this.decode(e);h.text=t,c.push(h),_=[],w=[],h=l()}o=h.language=s}}else if(g>=d){let e=(g-d)*n+u,t=(0,r.NM)(e,2);if(null!==k&&g>=k)f=!0;else if(f||_.length>0&&g<x)f=!1;else if(null===h.timestamp[0])h.timestamp[0]=t;else if(t===h.timestamp[0]);else{h.timestamp[1]=t,_.push(w),a&&p.push(y);let[e,s]=this.findLongestCommonSequence(_,p),n=this.decode(e);h.text=n,a&&(h.words=this.collateWordTimestamps(e,s,o)),c.push(h),_=[],w=[],p=[],y=[],h=l()}}else if(w.push(g),a){let e,t=(0,r.NM)(i[s]+u,2);e=s+1<i.length?(0,r.NM)(i[s+1]+u,2):null,y.push([t,e])}}if("stride"in s){let[e,t,n]=s.stride;u+=e-n}w.length>0?(_.push(w),a&&p.push(y)):_.every(e=>0===e.length)&&(h=l(),_=[],w=[],p=[],y=[])}if(_.length>0){if(i&&t)throw Error("Whisper did not predict an ending timestamp, which can happen if audio is cut off in the middle of a word. Also make sure WhisperTimeStampLogitsProcessor was used during generation.");let[e,s]=this.findLongestCommonSequence(_,p),n=this.decode(e);h.text=n,a&&(h.words=this.collateWordTimestamps(e,s,o)),c.push(h)}let k=Object.create(null),x=c.map(e=>e.text).join("");if(t||s){for(let e=0;e<c.length;++e){let n=c[e];t||delete n.timestamp,s||delete n.language}if(a){let e=[];for(let t of c)for(let s of t.words)e.push(s);k={chunks:e}}else k={chunks:c}}return[x,k]}findLongestCommonSequence(e,t=null){let s=e[0],n=s.length,i=[],r=Array.isArray(t)&&t.length>0,o=r?[]:null,a=r?t[0]:null;for(let l=1;l<e.length;++l){let c=e[l],h=0,u=[n,n,0,0],d=c.length;for(let e=1;e<n+d;++e){let t=e/1e4,i=Math.max(0,n-e),r=Math.min(n,n+d-e),o=s.slice(i,r),a=Math.max(0,e-n),l=Math.min(d,e),_=c.slice(a,l);if(o.length!==_.length)throw Error("There is a bug within whisper `decode_asr` function, please report it. Dropping to prevent bad inference.");let p=o.filter((e,t)=>e===_[t]).length,f=p/e+t;p>1&&f>h&&(h=f,u=[i,r,a,l])}let[_,p,f,g]=u,m=Math.floor((p+_)/2),k=Math.floor((g+f)/2);i.push(...s.slice(0,m)),n=(s=c.slice(k)).length,r&&(o.push(...a.slice(0,m)),a=t[l].slice(k))}return(i.push(...s),r)?(o.push(...a),[i,o]):[i,[]]}collateWordTimestamps(e,t,s){let[n,i,r]=this.combineTokensIntoWords(e,s),o=[];for(let e=0;e<n.length;++e){let s=r[e];o.push({text:n[e],timestamp:[t[s.at(0)][0],t[s.at(-1)][1]]})}return o}combineTokensIntoWords(e,t,s="\"'β\xa1\xbf([{-",n="\"'.γ,οΌ!οΌ?οΌ:οΌβ)]}γ"){let i,r,o;return["chinese","japanese","thai","lao","myanmar"].includes(t=t??"english")?[i,r,o]=this.splitTokensOnUnicode(e):[i,r,o]=this.splitTokensOnSpaces(e),this.mergePunctuations(i,r,o,s,n)}decode(e,t){let s;return t&&t.decode_with_timestamps?(e instanceof o.es&&(e=d(e)),s=this.decodeWithTimestamps(e,t)):s=super.decode(e,t),s}decodeWithTimestamps(e,t){let s=t?.time_precision??.02,n=Array.from(this.all_special_ids).at(-1)+1,i=[[]];for(let t of e)if(t>=n){let e=(0,r.NM)((t-n)*s,2);i.push(`<|${e}|>`),i.push([])}else i[i.length-1].push(t);return(i=i.map(e=>"string"==typeof e?e:super.decode(e,t))).join("")}splitTokensOnUnicode(e){let t=this.decode(e,{decode_with_timestamps:!0}),s=[],n=[],i=[],r=[],o=[],a=0;for(let l=0;l<e.length;++l){let c=e[l];r.push(c),o.push(l);let h=this.decode(r,{decode_with_timestamps:!0});h.includes("οΏ½")&&"οΏ½"!==t[a+h.indexOf("οΏ½")]||(s.push(h),n.push(r),i.push(o),r=[],o=[],a+=h.length)}return[s,n,i]}splitTokensOnSpaces(e){let[t,s,n]=this.splitTokensOnUnicode(e),i=[],r=[],o=[],a=RegExp(`^[${f}]$`,"gu");for(let e=0;e<t.length;++e){let l=t[e],c=s[e],h=n[e],u=c[0]>=this.model.tokens_to_ids.get("<|endoftext|>"),d=l.startsWith(" "),_=l.trim(),p=a.test(_);if(u||d||p||0===i.length)i.push(l),r.push(c),o.push(h);else{let e=i.length-1;i[e]+=l,r[e].push(...c),o[e].push(...h)}}return[i,r,o]}mergePunctuations(e,t,s,i,r){let o=structuredClone(e),a=structuredClone(t),l=structuredClone(s),c=o.length-2,h=o.length-1;for(;c>=0;)o[c].startsWith(" ")&&i.includes(o[c].trim())?(o[h]=o[c]+o[h],a[h]=(0,n.eG)(a[c],a[h]),l[h]=(0,n.eG)(l[c],l[h]),o[c]="",a[c]=[],l[c]=[]):h=c,--c;for(c=0,h=1;h<o.length;)!o[c].endsWith(" ")&&r.includes(o[h])?(o[c]+=o[h],a[c]=(0,n.eG)(a[c],a[h]),l[c]=(0,n.eG)(l[c],l[h]),o[h]="",a[h]=[],l[h]=[]):c=h,++h;return[o.filter(e=>e),a.filter(e=>e.length>0),l.filter(e=>e.length>0)]}get_decoder_prompt_ids({language:e=null,task:t=null,no_timestamps:s=!0}={}){let n=[];if(e){e=e.toLowerCase();let t=eV.get(e);if(void 0===t){if(eZ.has(e))t=e;else{let t=2===e.length?eZ.keys():eZ.values();throw Error(`Language "${e}" is not supported. Must be one of: ${JSON.stringify(t)}`)}}let s=this.model.tokens_to_ids.get(`<|${t}|>`);if(void 0===s)throw Error(`Unable to find language "${t}" in model vocabulary. Please report this issue at https://github.com/xenova/transformers.js/issues/new/choose.`);n.push(s)}else n.push(null);if(t){if("transcribe"!==(t=t.toLowerCase())&&"translate"!==t)throw Error(`Task "${t}" is not supported. Must be one of: ["transcribe", "translate"]`);let e=this.model.tokens_to_ids.get(`<|${t}|>`);if(void 0===e)throw Error(`Unable to find task "${t}" in model vocabulary. Please report this issue at https://github.com/xenova/transformers.js/issues/new/choose.`);n.push(e)}else n.push(null);if(s){let e=this.model.tokens_to_ids.get("<|notimestamps|>");if(void 0===e)throw Error('Unable to find "<|notimestamps|>" in model vocabulary. Please report this issue at https://github.com/xenova/transformers.js/issues/new/choose.');n.push(e)}return n.map((e,t)=>[t+1,e]).filter(e=>null!==e[1])}}class eJ extends e_{}class eQ extends e_{}class eX extends e_{}class e0 extends e_{constructor(e,t){super(e,t),this.languageRegex=/^(>>\w+<<)\s*/g,this.supported_language_codes=this.model.vocab.filter(e=>this.languageRegex.test(e)),console.warn('WARNING: `MarianTokenizer` is not yet supported by Hugging Face\'s "fast" tokenizers library. Therefore, you may experience slightly inaccurate results.')}_encode_text(e){if(null===e)return null;let[t,...s]=e.trim().split(this.languageRegex);if(0===s.length)return super._encode_text(t);if(2===s.length){let[e,t]=s;return this.supported_language_codes.includes(e)||console.warn(`Unsupported language code "${e}" detected, which may lead to unexpected behavior. Should be one of: ${JSON.stringify(this.supported_language_codes)}`),(0,n.eG)([e],super._encode_text(t))}}}class e1 extends e_{}class e2 extends e_{_default_chat_template="{% for message in messages %}{% if message['role'] == 'user' %}{{ ' ' }}{% endif %}{{ message['content'] }}{% if not loop.last %}{{ ' ' }}{% endif %}{% endfor %}{{ eos_token }}"}class e3 extends e2{}class e8 extends e_{}class e6 extends e_{}class e7 extends e_{constructor(e,t){super(e,t),this.decoder=new ei({})}}class e9 extends e_{}class e4{static TOKENIZER_CLASS_MAPPING={T5Tokenizer:eE,DistilBertTokenizer:ev,CamembertTokenizer:ez,DebertaTokenizer:ek,DebertaV2Tokenizer:ex,BertTokenizer:ep,HerbertTokenizer:ew,ConvBertTokenizer:ey,RoFormerTokenizer:eb,XLMTokenizer:eA,ElectraTokenizer:eS,MobileBertTokenizer:eg,SqueezeBertTokenizer:em,AlbertTokenizer:ef,GPT2Tokenizer:eT,BartTokenizer:eC,MBartTokenizer:ej,MBart50Tokenizer:eM,RobertaTokenizer:eP,WhisperTokenizer:eH,CodeGenTokenizer:eJ,CLIPTokenizer:eQ,SiglipTokenizer:eX,MarianTokenizer:e0,BloomTokenizer:e$,NllbTokenizer:eq,M2M100Tokenizer:eY,LlamaTokenizer:eR,CodeLlamaTokenizer:eN,XLMRobertaTokenizer:eF,MPNetTokenizer:eL,FalconTokenizer:eO,GPTNeoXTokenizer:eU,EsmTokenizer:eW,Wav2Vec2CTCTokenizer:e1,BlenderbotTokenizer:e2,BlenderbotSmallTokenizer:e3,SpeechT5Tokenizer:e8,NougatTokenizer:e6,VitsTokenizer:e7,Qwen2Tokenizer:eG,GemmaTokenizer:eI,Grok1Tokenizer:eB,CohereTokenizer:e9,PreTrainedTokenizer:e_};static async from_pretrained(e,{quantized:t=!0,progress_callback:s=null,config:n=null,cache_dir:i=null,local_files_only:r=!1,revision:o="main",legacy:a=null}={}){let[l,h]=await c(e,{quantized:t,progress_callback:s,config:n,cache_dir:i,local_files_only:r,revision:o,legacy:a}),u=h.tokenizer_class?.replace(/Fast$/,"")??"PreTrainedTokenizer",d=this.TOKENIZER_CLASS_MAPPING[u];return d||(console.warn(`Unknown tokenizer class "${u}", attempting to construct from base class.`),d=e_),new d(l,h)}}}}]);
|
_next/static/chunks/6139e184.f5956607c9895a14.js
ADDED
@@ -0,0 +1 @@
|
|
|
|
|
1 |
+
"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[132],{9454:function(e,s,t){t.d(s,{$Bv:function(){return id},$Sz:function(){return a6},DcG:function(){return ip},ENH:function(){return ih},En$:function(){return il},Hqk:function(){return ia},IFL:function(){return ix},K2m:function(){return im},Kf0:function(){return a9},LdW:function(){return iu},OjJ:function(){return a8},S2d:function(){return ig},U$$:function(){return ic},Zn:function(){return i_},hY6:function(){return iw},hZO:function(){return ie},lbf:function(){return is},o$X:function(){return a7},t78:function(){return ii},tLj:function(){return ir},wiU:function(){return io},z6E:function(){return it}});var n=t(16),a=t(761),i=t(911),o=t(5774),r=t(2414),l=t(1542),c=t(9078);let{InferenceSession:d,Tensor:_,env:u}=l.ONNX,h={EncoderOnly:0,EncoderDecoder:1,Seq2Seq:2,Vision2Seq:3,DecoderOnly:4,MaskGeneration:5},m=new Map,p=new Map,f=new Map;async function g(e,s,t){let n=`onnx/${s}${t.quantized?"_quantized":""}.onnx`,a=await (0,i.st)(e,n,!0,t);try{return await d.create(a,{executionProviders:l.p})}catch(e){if(1===l.p.length&&"wasm"===l.p[0])throw e;return console.warn(e),console.warn("Something went wrong during model construction (most likely a missing operation). Using `wasm` as a fallback. "),await d.create(a,{executionProviders:["wasm"]})}}async function w(e,s){let t=function(e,s){let t=Object.create(null),n=[];for(let a of e.inputNames){let e=s[a];if(!(e instanceof r.es)){n.push(a);continue}t[a]=u.wasm.proxy?e.clone():e}if(n.length>0)throw Error(`An error occurred during model execution: "Missing the following inputs: ${n.join(", ")}.`);let a=Object.keys(s).length,i=e.inputNames.length;if(a>i){let t=Object.keys(s).filter(s=>!e.inputNames.includes(s));console.warn(`WARNING: Too many inputs were provided (${a} > ${i}). The following inputs will be ignored: "${t.join(", ")}".`)}return t}(e,s);try{let s=await e.run(t);return s=function e(s){for(let t in s)s[t]instanceof _?s[t]=new r.es(s[t]):"object"==typeof s[t]&&e(s[t]);return s}(s)}catch(e){throw console.error(`An error occurred during model execution: "${e}".`),console.error("Inputs given to model:",t),e}}function x(e,s){let t=e.config.pad_token_id??null,n=e.config.eos_token_id??null;(0,a.Wy)(n)&&(n=[n]);let i=-1!==s.indexOf(t),o=null===n||!n.includes(t);if(!i||!o)return(0,r.r6)(s);{let e=BigInt64Array.from(s.data.map(e=>e!=t));return new r.es("int64",e,s.dims)}}function y(e,s,t){if(!e.inputNames.includes("position_ids"))return;let n=new BigInt64Array(s.attention_mask.data.length);for(let e=0;e<s.attention_mask.dims[0];++e){let t=e*s.attention_mask.dims[1],a=BigInt(0);for(let e=0;e<s.attention_mask.dims[1];++e){let i=t+e;0n===s.attention_mask.data[i]?n[i]=BigInt(1):(n[i]=a,a+=s.attention_mask.data[i])}}s.position_ids=new r.es("int64",n,s.attention_mask.dims),t&&(s.position_ids=s.position_ids.slice(null,-1).unsqueeze_(-1))}function M(e){return new r.es("bool",[e],[1])}async function k(e,s){let{encoder_outputs:t,past_key_values:n}=s;t||(t=(await F(e,s)).last_hidden_state);let a={input_ids:s.decoder_input_ids,encoder_hidden_states:t},i=!!n;e.decoder_merged_session.inputNames.includes("use_cache_branch")&&(a.use_cache_branch=M(i)),e.decoder_merged_session.inputNames.includes("encoder_attention_mask")&&(a.encoder_attention_mask=s.attention_mask),y(e.decoder_merged_session,a,i),e.addPastKeyValues(a,n);let o=await w(e.decoder_merged_session,a);return new iy({logits:o.logits,past_key_values:n=e.getPastKeyValues(o,n),encoder_outputs:t,...e.getAttentions(o)})}function b(e,s,t,n){let a=[],i=0,o=e.requires_attention_mask??!0,l=t.decoder_input_ids??t.decoder_start_token_id??t.bos_token_id??t.eos_token_id;for(let t of(l instanceof r.es?l=l.tolist().flat():Array.isArray(l)||(l=[l]),s)){t.dims=[1,...t.dims];let s={inputs:t,encoder_outputs:null,prev_model_outputs:null,output_token_ids:l,done:!1,score:0,id:i++};o&&(s.attention_mask=x(e,t)),a.push(s)}return a}async function v(e,s){let t=e.main_input_name,n=s.output_token_ids;s.prev_model_outputs&&(n=n.slice(-1));let a={[t]:s.inputs,decoder_input_ids:function(e){if(e instanceof r.es)return e;if(0===e.length)throw Error("items must be non-empty");if(!Array.isArray(e[0]))return new r.es("int64",BigInt64Array.from(e.map(e=>BigInt(e))),[1,e.length]);if(e.some(s=>s.length!==e[0].length))throw Error("Unable to create tensor, you should probably activate truncation and/or padding with 'padding=True' and/or 'truncation=True' to have batched tensors with the same length.");return new r.es("int64",BigInt64Array.from(e.flat().map(e=>BigInt(e))),[e.length,e[0].length])}(n),encoder_outputs:s.encoder_outputs,past_key_values:s.prev_model_outputs?.past_key_values};s.attention_mask&&(a.attention_mask=s.attention_mask);let i=await e.forward(a);return s.prev_model_outputs=i,s.encoder_outputs=i.encoder_outputs,i}function S(e,s){e.output_token_ids=[...e.output_token_ids,s]}async function F(e,s){let t=Object.create(null);for(let n of e.session.inputNames)t[n]=s[n];return e.session.inputNames.includes("token_type_ids")&&!t.token_type_ids&&(t.token_type_ids=new r.es("int64",new BigInt64Array(t.input_ids.data.length),t.input_ids.dims)),await w(e.session,t)}async function C(e,s){let{input_ids:t,past_key_values:n,attention_mask:a}=s,i={input_ids:t,attention_mask:a??x(e,t)},o=!!n;e.session.inputNames.includes("use_cache_branch")&&(i.use_cache_branch=M(o)),y(e.session,i,o),e.addPastKeyValues(i,n);let r=await w(e.session,i);return{logits:r.logits,past_key_values:n=e.getPastKeyValues(r,n)}}function L(e,s,t,n,a){let i=[],o=0;for(let t of s){let s,r=t.tolist().map(Number);t.dims=[1,...t.dims],a?(s=a[o]).dims=[1,...s.dims]:s=x(e,t);let l={input:t,model_input_ids:t,attention_mask:s,prev_model_outputs:null,output_token_ids:r,num_output_tokens:n,done:!1,score:0,id:o++};i.push(l)}return i}async function A(e,s){let t=new BigInt64Array(s.output_token_ids.length).fill(1n),n={input_ids:s.model_input_ids,attention_mask:new r.es("int64",t,[1,t.length]),past_key_values:s.prev_model_outputs?.past_key_values},a=await e.forward(n);return s.prev_model_outputs=a,a}function P(e,s){e.output_token_ids=[...e.output_token_ids,s],e.model_input_ids=new r.es("int64",[BigInt(s)],[1,1])}class E extends a.Ag{main_input_name="input_ids";constructor(e,s){super(),this.config=e,this.session=s;let t=f.get(this.constructor),n=m.get(t);this.can_generate=!1,this._runBeam=null,this._getStartBeams=null,this._updateBeam=null,this._forward=null,n===h.DecoderOnly?(this.can_generate=!0,this._runBeam=A,this._getStartBeams=L,this._updateBeam=P,this._forward=C):n===h.Seq2Seq||n===h.Vision2Seq?(this.can_generate=!0,this._runBeam=v,this._getStartBeams=b,this._updateBeam=S,this._forward=k):(h.EncoderDecoder,this._forward=F)}async dispose(){let e=[];for(let s of Object.keys(this)){let t=this[s];t instanceof d&&e.push(t.handler.dispose())}return await Promise.all(e)}static async from_pretrained(e,{quantized:s=!0,progress_callback:t=null,config:a=null,cache_dir:o=null,local_files_only:r=!1,revision:l="main",model_file_name:c=null}={}){let d,_={quantized:s,progress_callback:t,config:a,cache_dir:o,local_files_only:r,revision:l,model_file_name:c},u=f.get(this),p=m.get(u);return p===h.DecoderOnly?d=await Promise.all([n.z.from_pretrained(e,_),g(e,_.model_file_name??"decoder_model_merged",_),(0,i.yM)(e,"generation_config.json",!1,_)]):p===h.Seq2Seq||p===h.Vision2Seq?d=await Promise.all([n.z.from_pretrained(e,_),g(e,"encoder_model",_),g(e,"decoder_model_merged",_),(0,i.yM)(e,"generation_config.json",!1,_)]):p===h.MaskGeneration?d=await Promise.all([n.z.from_pretrained(e,_),g(e,"vision_encoder",_),g(e,"prompt_encoder_mask_decoder",_)]):p===h.EncoderDecoder?d=await Promise.all([n.z.from_pretrained(e,_),g(e,"encoder_model",_),g(e,"decoder_model_merged",_)]):(p!==h.EncoderOnly&&console.warn(`Model type for '${u??a?.model_type}' not found, assuming encoder-only architecture. Please report this at https://github.com/xenova/transformers.js/issues/new/choose.`),d=await Promise.all([n.z.from_pretrained(e,_),g(e,_.model_file_name??"model",_)])),new this(...d)}async _call(e){return await this.forward(e)}async forward(e){return await this._forward(this,e)}_get_logits_processor(e,s,t=null){let n=new o.Jm;if(null!==e.repetition_penalty&&1!==e.repetition_penalty&&n.push(new o.Jj(e.repetition_penalty)),null!==e.no_repeat_ngram_size&&e.no_repeat_ngram_size>0&&n.push(new o.jF(e.no_repeat_ngram_size)),null!==e.bad_words_ids&&n.push(new o.AE(e.bad_words_ids,e.eos_token_id)),null!==e.min_length&&null!==e.eos_token_id&&e.min_length>0&&n.push(new o.ez(e.min_length,e.eos_token_id)),null!==e.min_new_tokens&&null!==e.eos_token_id&&e.min_new_tokens>0&&n.push(new o.CJ(s,e.min_new_tokens,e.eos_token_id)),null!==e.forced_bos_token_id&&n.push(new o.C9(e.forced_bos_token_id)),null!==e.forced_eos_token_id&&n.push(new o.dZ(e.max_length,e.forced_eos_token_id)),null!==e.begin_suppress_tokens){let t=s>1||null===e.forced_bos_token_id?s:s+1;null!==e.forced_decoder_ids&&(t+=e.forced_decoder_ids[e.forced_decoder_ids.length-1][0]),n.push(new o.GU(e.begin_suppress_tokens,t))}return null!==e.forced_decoder_ids&&n.push(new o.E(e.forced_decoder_ids)),null!==t&&n.extend(t),n}_get_generation_config(e){let s=new o.aP(this.config);return"generation_config"in this&&Object.assign(s,this.generation_config),null!==e&&Object.assign(s,e),s}async generate(e,s=null,t=null,{inputs_attention_mask:n=null}={}){let i;if(!this.can_generate){let e=f.get(this.constructor),s=`The current model class (${e}) is not compatible with \`.generate()\`, as it doesn't have a language model head.`,t=this.config.model_type,n=aV.get(t)??aG.get(t)??aB.get(t)??a$.get(t);throw n&&(s+=` Please use the following class instead: '${n[0]}'`),Error(s)}if(!(e instanceof r.es)&&!(0,a.fU)(e)&&!Array.isArray(e))throw Error(`\`inputs\` must be a Tensor, TypedArray, or Array, but is "${e.constructor.name}".`);if(this.config.is_encoder_decoder)i=0;else if(0===(i=e instanceof r.es?e.dims.at(-1):e.length))throw Error("Must supply a non-empty array of input token ids.");s=this._get_generation_config(s),t=t??new o.Jm,t=this._get_logits_processor(s,i,t);let l=s.eos_token_id;null===l||Array.isArray(l)||(l=[l]);let c=1,d=1+(s.max_new_tokens??1/0),_=Number.isInteger(s.max_length)&&(s.max_new_tokens??null)===null,u=o.Z4.getSampler(s),h=this.getStartBeams(e,s,c,n);for(;h.some(e=>!e.done)&&c<d;){let e=[];for(let n of h){if(n.done){e.push(n);continue}if(_&&n.output_token_ids.length>=s.max_length){n.done=!0,e.push(n);continue}let a=await this.runBeam(n);s.output_attentions&&this.addAttentionsToBeam(n,a),s.output_scores;let i=a.logits.slice(null,-1,null);for(let[s,a]of(t(n.output_token_ids,i),u(i))){let t={...n};this.updateBeam(t,s),t.score+=a,l&&l.includes(s)&&(t.done=!0),e.push(t)}}++c,h=(e=this.groupBeams(e).map(e=>e.sort((e,s)=>s.score-e.score).slice(0,s.num_beams))).flat(),s.callback_function&&s.callback_function(h)}let m=this.groupBeams(h),p=e=>m.map(t=>s.num_return_sequences>1?t.slice(0,s.num_return_sequences).map(s=>s[e]):[t[0][e]]).flat(),g=p("output_token_ids");return s.return_dict_in_generate?{sequences:g,decoder_attentions:p("decoder_attentions"),cross_attentions:p("cross_attentions")}:g}addAttentionsToBeam(e,s){if(this.config.is_encoder_decoder){if(!s.cross_attentions||0===s.cross_attentions.length)throw Error("`output_attentions` is true, but the model did not produce cross-attentions. This is most likely because the model was not exported with `output_attentions=True`.");e.cross_attentions||(e.cross_attentions=[]),e.cross_attentions.push(s.cross_attentions)}if(!s.decoder_attentions||0===s.decoder_attentions.length)throw Error("`output_attentions` is true, but the model did not produce decoder-attentions. This is most likely because the model was not exported with `output_attentions=True`.");e.decoder_attentions||(e.decoder_attentions=[]),e.decoder_attentions.push(s.decoder_attentions)}groupBeams(e){let s=Object.create(null);for(let t of e)void 0===s[t.id]?s[t.id]=[t]:s[t.id].push(t);return Object.values(s)}getPastKeyValues(e,s){let t=Object.create(null);for(let n in e)if(n.startsWith("present")){let a=n.replace("present","past_key_values");s&&n.includes("encoder")?t[a]=s[a]:t[a]=e[n]}return t}getAttentions(e){let s=Object.create(null);for(let t of["cross_attentions","decoder_attentions"]){let n=[];for(let s in e)s.startsWith(t)&&(n[s.split(".").pop()]=e[s]);s[t]=n}return s}addPastKeyValues(e,s){if(s)Object.assign(e,s);else if(this.config.is_encoder_decoder&&(this.add_encoder_pkv??!0)){let s=[1,this.num_encoder_heads,0,this.encoder_dim_kv],t=[1,this.num_decoder_heads,0,this.decoder_dim_kv];for(let n=0;n<this.num_decoder_layers;++n)e[`past_key_values.${n}.encoder.key`]=new r.es("float32",[],s),e[`past_key_values.${n}.encoder.value`]=new r.es("float32",[],s),e[`past_key_values.${n}.decoder.key`]=new r.es("float32",[],t),e[`past_key_values.${n}.decoder.value`]=new r.es("float32",[],t)}else if("falcon"===this.config.model_type){let s=[1*this.num_heads,0,this.dim_kv];for(let t=0;t<this.num_layers;++t)e[`past_key_values.${t}.key`]=new r.es("float32",[],s),e[`past_key_values.${t}.value`]=new r.es("float32",[],s)}else if(this.config.multi_query){let s=[1*this.num_heads,0,2*this.dim_kv];for(let t=0;t<this.num_layers;++t)e[`past_key_values.${t}.key_value`]=new r.es("float32",[],s)}else if("bloom"===this.config.model_type){let s=[1*this.num_heads,this.dim_kv,0],t=[1*this.num_heads,0,this.dim_kv];for(let n=0;n<this.num_layers;++n)e[`past_key_values.${n}.key`]=new r.es("float32",[],s),e[`past_key_values.${n}.value`]=new r.es("float32",[],t)}else{let s=[1,this.num_heads,0,this.dim_kv];for(let t=0;t<this.num_layers;++t)e[`past_key_values.${t}.key`]=new r.es("float32",[],s),e[`past_key_values.${t}.value`]=new r.es("float32",[],s)}}getStartBeams(e,s,t,n){return this._getStartBeams(this,e,s,t,n)}async runBeam(e){return await this._runBeam(this,e)}updateBeam(e,s){return this._updateBeam(e,s)}}class T{}class O extends E{}class B extends O{}class D extends O{async _call(e){return new iv(await super._call(e))}}class I extends O{async _call(e){return new iM(await super._call(e))}}class q extends O{async _call(e){return new ib(await super._call(e))}}class N extends O{async _call(e){return new iS(await super._call(e))}}class G extends E{}class V extends G{}class z extends E{}class j extends z{}class $ extends z{async _call(e){return new iv(await super._call(e))}}class W extends z{async _call(e){return new iM(await super._call(e))}}class R extends z{async _call(e){return new ib(await super._call(e))}}class Q extends z{async _call(e){return new iS(await super._call(e))}}class U extends E{}class X extends U{}class K extends U{async _call(e){return new iv(await super._call(e))}}class H extends U{async _call(e){return new iM(await super._call(e))}}class J extends U{async _call(e){return new ib(await super._call(e))}}class Z extends U{async _call(e){return new iS(await super._call(e))}}class Y extends E{}class ee extends Y{}class es extends Y{async _call(e){return new iv(await super._call(e))}}class et extends Y{async _call(e){return new iM(await super._call(e))}}class en extends Y{async _call(e){return new ib(await super._call(e))}}class ea extends Y{async _call(e){return new iS(await super._call(e))}}class ei extends E{}class eo extends ei{}class er extends ei{async _call(e){return new iv(await super._call(e))}}class el extends ei{async _call(e){return new iM(await super._call(e))}}class ec extends ei{async _call(e){return new ib(await super._call(e))}}class ed extends ei{async _call(e){return new iS(await super._call(e))}}class e_ extends E{}class eu extends e_{}class eh extends e_{async _call(e){return new iv(await super._call(e))}}class em extends e_{async _call(e){return new iM(await super._call(e))}}class ep extends e_{async _call(e){return new ib(await super._call(e))}}class ef extends e_{async _call(e){return new iS(await super._call(e))}}class eg extends E{}class ew extends eg{}class ex extends eg{async _call(e){return new iv(await super._call(e))}}class ey extends eg{async _call(e){return new iM(await super._call(e))}}class eM extends eg{async _call(e){return new ib(await super._call(e))}}class ek extends eg{async _call(e){return new iS(await super._call(e))}}class eb extends E{}class ev extends eb{}class eS extends eb{async _call(e){return new iM(await super._call(e))}}class eF extends eb{async _call(e){return new ib(await super._call(e))}}class eC extends eb{async _call(e){return new iS(await super._call(e))}}class eL extends eb{async _call(e){return new iv(await super._call(e))}}class eA extends E{}class eP extends eA{}class eE extends eA{async _call(e){return new iv(await super._call(e))}}class eT extends eA{async _call(e){return new iM(await super._call(e))}}class eO extends eA{async _call(e){return new ib(await super._call(e))}}class eB extends E{}class eD extends eB{}class eI extends eB{async _call(e){return new iv(await super._call(e))}}class eq extends eB{async _call(e){return new iM(await super._call(e))}}class eN extends eB{async _call(e){return new iS(await super._call(e))}}class eG extends E{}class eV extends eG{}class ez extends eG{async _call(e){return new iv(await super._call(e))}}class ej extends eG{async _call(e){return new iM(await super._call(e))}}class e$ extends eG{async _call(e){return new ib(await super._call(e))}}class eW extends eG{async _call(e){return new iS(await super._call(e))}}class eR extends E{}class eQ extends eR{}class eU extends eR{async _call(e){return new iv(await super._call(e))}}class eX extends eR{async _call(e){return new iM(await super._call(e))}}class eK extends eR{async _call(e){return new iS(await super._call(e))}}class eH extends E{}class eJ extends eH{}class eZ extends eH{async _call(e){return new iM(await super._call(e))}}class eY extends eH{async _call(e){return new iS(await super._call(e))}}class e2 extends eH{async _call(e){return new iv(await super._call(e))}}class e0 extends E{}class e1 extends e0{}class e4 extends e0{constructor(e,s,t,n){super(e,s),this.decoder_merged_session=t,this.generation_config=n,this.num_decoder_layers=this.config.num_decoder_layers,this.num_decoder_heads=this.config.num_heads,this.decoder_dim_kv=this.config.d_kv,this.num_encoder_layers=this.config.num_layers,this.num_encoder_heads=this.config.num_heads,this.encoder_dim_kv=this.config.d_kv}}class e3 extends E{}class e5 extends e3{}class e6 extends e3{constructor(e,s,t,n){super(e,s),this.decoder_merged_session=t,this.generation_config=n,this.num_decoder_layers=this.config.num_decoder_layers,this.num_decoder_heads=this.config.num_heads,this.decoder_dim_kv=this.config.d_kv,this.num_encoder_layers=this.config.num_layers,this.num_encoder_heads=this.config.num_heads,this.encoder_dim_kv=this.config.d_kv}}class e7 extends E{}class e8 extends e7{}class e9 extends e7{constructor(e,s,t,n){super(e,s),this.decoder_merged_session=t,this.generation_config=n,this.num_decoder_layers=this.config.num_decoder_layers,this.num_decoder_heads=this.config.num_heads,this.decoder_dim_kv=this.config.d_kv,this.num_encoder_layers=this.config.num_layers,this.num_encoder_heads=this.config.num_heads,this.encoder_dim_kv=this.config.d_kv}}class se extends E{}class ss extends se{}class st extends se{constructor(e,s,t,n){super(e,s),this.decoder_merged_session=t,this.generation_config=n,this.num_decoder_layers=this.config.decoder_layers,this.num_decoder_heads=this.config.decoder_attention_heads,this.decoder_dim_kv=this.config.d_model/this.num_decoder_heads,this.num_encoder_layers=this.config.encoder_layers,this.num_encoder_heads=this.config.encoder_attention_heads,this.encoder_dim_kv=this.config.d_model/this.num_encoder_heads}}class sn extends se{async _call(e){return new iM(await super._call(e))}}class sa extends E{}class si extends sa{}class so extends sa{constructor(e,s,t,n){super(e,s),this.decoder_merged_session=t,this.generation_config=n,this.num_decoder_layers=this.config.decoder_layers,this.num_decoder_heads=this.config.decoder_attention_heads,this.decoder_dim_kv=this.config.d_model/this.num_decoder_heads,this.num_encoder_layers=this.config.encoder_layers,this.num_encoder_heads=this.config.encoder_attention_heads,this.encoder_dim_kv=this.config.d_model/this.num_encoder_heads}}class sr extends sa{async _call(e){return new iM(await super._call(e))}}class sl extends sa{constructor(e,s,t){super(e,s),this.generation_config=t,this.num_decoder_layers=this.config.decoder_layers,this.num_decoder_heads=this.config.decoder_attention_heads,this.decoder_dim_kv=this.config.d_model/this.num_decoder_heads,this.num_encoder_layers=this.config.encoder_layers,this.num_encoder_heads=this.config.encoder_attention_heads,this.encoder_dim_kv=this.config.d_model/this.num_encoder_heads}}class sc extends E{}class sd extends sc{}class s_ extends sc{constructor(e,s,t,n){super(e,s),this.decoder_merged_session=t,this.generation_config=n,this.num_decoder_layers=this.config.decoder_layers,this.num_decoder_heads=this.config.decoder_attention_heads,this.decoder_dim_kv=this.config.d_model/this.num_decoder_heads,this.num_encoder_layers=this.config.encoder_layers,this.num_encoder_heads=this.config.encoder_attention_heads,this.encoder_dim_kv=this.config.d_model/this.num_encoder_heads}}class su extends E{}class sh extends su{}class sm extends su{constructor(e,s,t,n){super(e,s),this.decoder_merged_session=t,this.generation_config=n,this.num_decoder_layers=this.config.decoder_layers,this.num_decoder_heads=this.config.decoder_attention_heads,this.decoder_dim_kv=this.config.d_model/this.num_decoder_heads,this.num_encoder_layers=this.config.encoder_layers,this.num_encoder_heads=this.config.encoder_attention_heads,this.encoder_dim_kv=this.config.d_model/this.num_encoder_heads}}class sp extends E{}class sf extends sp{}class sg extends sp{async _call(e){return new iv(await super._call(e))}}class sw extends sp{async _call(e){return new iM(await super._call(e))}}class sx extends sp{async _call(e){return new ib(await super._call(e))}}class sy extends sp{async _call(e){return new iS(await super._call(e))}}class sM extends E{}class sk extends sM{}class sb extends sM{async _call(e){return new iv(await super._call(e))}}class sv extends sM{async _call(e){return new iM(await super._call(e))}}class sS extends sM{async _call(e){return new ib(await super._call(e))}}class sF extends sM{async _call(e){return new iS(await super._call(e))}}class sC extends E{}class sL extends sC{}class sA extends sC{async _call(e){return new iv(await super._call(e))}}class sP extends sC{async _call(e){return new iM(await super._call(e))}}class sE extends sC{async _call(e){return new ib(await super._call(e))}}class sT extends sC{async _call(e){return new iS(await super._call(e))}}class sO extends E{}class sB extends sO{}class sD extends sO{}class sI extends E{}class sq extends sI{}class sN extends sI{requires_attention_mask=!1;main_input_name="input_features";constructor(e,s,t,n){super(e,s),this.decoder_merged_session=t,this.generation_config=n,this.num_decoder_layers=this.config.decoder_layers,this.num_decoder_heads=this.config.decoder_attention_heads,this.decoder_dim_kv=this.config.d_model/this.num_decoder_heads,this.num_encoder_layers=this.config.encoder_layers,this.num_encoder_heads=this.config.encoder_attention_heads,this.encoder_dim_kv=this.config.d_model/this.num_encoder_heads}async generate(e,s=null,t=null){if(s=this._get_generation_config(s),s.return_timestamps??=!1,s.return_timestamps&&(t=[new o.Pg(s)]),s.return_token_timestamps&&(s.output_attentions=!0,s.return_dict_in_generate=!0,"translate"===s.task&&console.warn("Token-level timestamps may not be reliable for task 'translate'."),!s.alignment_heads))throw Error("Model generation config has no `alignment_heads`, token-level timestamps not available. See https://gist.github.com/hollance/42e32852f24243b748ae6bc1f985b13a on how to add this property to the generation config.");let n=await super.generate(e,s,t);return s.return_token_timestamps&&s.alignment_heads&&(n.token_timestamps=this._extract_token_timestamps(n,s.alignment_heads,s.num_frames)),n}_extract_token_timestamps(e,s,t=null,n=.02){if(!e.cross_attentions)throw Error("Model outputs must contain cross attentions to extract timestamps. This is most likely because the model was not exported with `output_attentions=True`.");let i=this.config.median_filter_width;void 0===i&&(console.warn("Model config has no `median_filter_width`, using default value of 7."),i=7);let o=e.cross_attentions.map(e=>{let n=Array.from({length:this.config.decoder_layers},(s,t)=>(0,r.d3)(e.map(e=>e[t]),2)),a=(0,r.kn)(s.map(([e,s])=>t?n[e].slice(null,s,null,[0,t]):n[e].slice(null,s)));a=a.transpose(1,0,2,3);let[o,l]=(0,r.f3)(a,-2,0,!0),d=a.clone();for(let e=0;e<d.dims[0];++e){let s=d[e];for(let t=0;t<s.dims[0];++t){let n=s[t],a=o[e][t][0],r=l[e][t][0];for(let e=0;e<n.dims[0];++e){let s=n[e];for(let e=0;e<s.data.length;++e)s.data[e]=(s.data[e]-r.data[e])/a.data[e];s.data.set((0,c.qCb)(s.data,i))}}}return(0,r.J6)(d,1)}),l=[e.sequences.length,e.sequences[0].length],d=new r.es("float32",new Float32Array(l[0]*l[1]),l);for(let e=0;e<l[0];++e){let s=o[e].neg().squeeze_(0),[t,i]=(0,r.Ks)(s),l=Array.from({length:t.length-1},(e,s)=>t[s+1]-t[s]),c=(0,a.eG)([1],l).map(e=>!!e),_=[];for(let e=0;e<c.length;++e)c[e]&&_.push(i[e]*n);d[e].data.set(_,1)}return d}}class sG extends E{main_input_name="pixel_values";constructor(e,s,t,n){super(e,s),this.decoder_merged_session=t,this.generation_config=n;let a=this.config.encoder,i=this.config.decoder,o=a.model_type;(aE.get(o)??aT.get(o))||console.warn(`Model type for encoder '${o}' not found, assuming encoder-only architecture. Please report this at https://github.com/xenova/transformers.js/issues/new/choose.`);let r=aV.get(i.model_type);if(!r)throw Error(`Unable to construct \`VisionEncoderDecoder\` due to unsupported decoder: "${this.config.decoder.model_type}"`);let l=new r[1](i,t,n);this.add_encoder_pkv="num_decoder_layers"in l,this.add_encoder_pkv?(this.num_decoder_layers=l.num_decoder_layers,this.num_decoder_heads=l.num_decoder_heads,this.decoder_dim_kv=l.decoder_dim_kv,this.num_encoder_layers=l.num_encoder_layers,this.num_encoder_heads=l.num_encoder_heads,this.encoder_dim_kv=l.encoder_dim_kv):(this.num_layers=l.num_layers,this.num_heads=l.num_heads,this.dim_kv=l.dim_kv)}}class sV extends E{}class sz extends sV{}class sj extends sV{static async from_pretrained(e,s={}){return s.model_file_name??="text_model",super.from_pretrained(e,s)}}class s$ extends sV{static async from_pretrained(e,s={}){return s.model_file_name??="vision_model",super.from_pretrained(e,s)}}class sW extends E{}class sR extends sW{}class sQ extends sW{static async from_pretrained(e,s={}){return s.model_file_name??="text_model",super.from_pretrained(e,s)}}class sU extends sV{static async from_pretrained(e,s={}){return s.model_file_name??="vision_model",super.from_pretrained(e,s)}}class sX extends E{}class sK extends sX{}class sH extends E{}class sJ extends sH{}class sZ extends sH{}class sY extends E{constructor(e,s,t){super(e,s),this.generation_config=t,this.config.pad_token_id=this.config.eos_token_id,this.num_heads=this.config.n_head,this.num_layers=this.config.n_layer,this.dim_kv=this.config.n_embd/this.num_heads}}class s2 extends sY{}class s0 extends sY{}class s1 extends E{constructor(e,s,t){super(e,s),this.generation_config=t,this.config.pad_token_id=this.config.eos_token_id,this.num_heads=this.config.num_heads,this.num_layers=this.config.num_layers,this.dim_kv=this.config.hidden_size/this.num_heads}}class s4 extends s1{}class s3 extends s1{}class s5 extends E{constructor(e,s,t){super(e,s),this.generation_config=t,this.config.pad_token_id=this.config.eos_token_id,this.num_heads=this.config.num_attention_heads,this.num_layers=this.config.num_hidden_layers,this.dim_kv=this.config.hidden_size/this.num_heads}}class s6 extends s5{}class s7 extends s5{}class s8 extends E{constructor(e,s,t){super(e,s),this.generation_config=t,this.config.pad_token_id=this.config.eos_token_id,this.num_heads=this.config.n_head,this.num_layers=this.config.n_layer,this.dim_kv=this.config.n_embd/this.num_heads}}class s9 extends s8{}class te extends s8{}class ts extends E{constructor(e,s,t){super(e,s),this.generation_config=t,this.config.pad_token_id=this.config.eos_token_id,this.num_heads=this.config.n_head,this.num_layers=this.config.n_layer,this.dim_kv=this.config.n_embd/this.num_heads}}class tt extends ts{}class tn extends ts{}class ta extends E{constructor(e,s,t){super(e,s),this.generation_config=t,this.config.pad_token_id=this.config.eos_token_id,this.num_heads=this.config.n_head,this.num_layers=this.config.n_layer,this.dim_kv=this.config.n_embd/this.num_heads}}class ti extends ta{}class to extends ta{}class tr extends E{constructor(e,s,t){super(e,s),this.generation_config=t,this.config.pad_token_id=this.config.eos_token_id,this.num_heads=this.config.num_key_value_heads??this.config.num_attention_heads,this.num_layers=this.config.num_hidden_layers,this.dim_kv=this.config.hidden_size/this.config.num_attention_heads}}class tl extends tr{}class tc extends tr{}class td extends E{constructor(e,s,t){super(e,s),this.generation_config=t,this.config.pad_token_id=this.config.eos_token_id,this.num_heads=this.config.num_key_value_heads??this.config.num_attention_heads,this.num_layers=this.config.num_hidden_layers,this.dim_kv=this.config.hidden_size/this.config.num_attention_heads}}class t_ extends td{}class tu extends td{}class th extends E{constructor(e,s,t){super(e,s),this.generation_config=t,this.config.pad_token_id=this.config.eos_token_id,this.num_heads=this.config.num_attention_heads,this.num_layers=this.config.num_hidden_layers,this.dim_kv=this.config.hidden_size/this.num_heads}}class tm extends th{}class tp extends th{}class tf extends E{constructor(e,s,t){super(e,s),this.generation_config=t,this.config.pad_token_id=this.config.eos_token_id,this.num_heads=this.config.n_head,this.num_layers=this.config.n_layer,this.dim_kv=this.config.hidden_size/this.num_heads}}class tg extends tf{}class tw extends tf{}class tx extends E{constructor(e,s,t){super(e,s),this.generation_config=t,this.config.pad_token_id=this.config.eos_token_id,this.num_heads=this.config.n_heads,this.num_layers=this.config.n_layers,this.dim_kv=this.config.d_model/this.num_heads}}class ty extends tx{}class tM extends tx{}class tk extends E{constructor(e,s,t){super(e,s),this.generation_config=t,this.config.pad_token_id=this.config.eos_token_id,this.num_heads=this.config.num_attention_heads,this.num_layers=this.config.num_hidden_layers,this.dim_kv=this.config.hidden_size/this.num_heads}}class tb extends tk{}class tv extends tk{}class tS extends E{}class tF extends tS{}class tC extends tS{async _call(e){return new iM(await super._call(e))}}class tL extends E{}class tA extends tL{}class tP extends tL{async _call(e){return new iM(await super._call(e))}}class tE extends E{}class tT extends tE{async _call(e){return new iC(await super._call(e))}}class tO extends E{}class tB extends tO{}class tD extends tO{async _call(e){return new iM(await super._call(e))}}class tI extends E{}class tq extends tI{}class tN extends tI{async _call(e){return new iM(await super._call(e))}}class tG extends E{}class tV extends tG{}class tz extends tG{}class tj extends E{}class t$ extends tj{}class tW extends tj{}class tR extends E{}class tQ extends tR{}class tU extends tR{async _call(e){return new iM(await super._call(e))}}class tX extends E{}class tK extends tX{}class tH extends tX{async _call(e){return new tZ(await super._call(e))}}class tJ extends tX{async _call(e){return new tY(await super._call(e))}}class tZ extends T{constructor({logits:e,pred_boxes:s}){super(),this.logits=e,this.pred_boxes=s}}class tY extends T{constructor({logits:e,pred_boxes:s,pred_masks:t}){super(),this.logits=e,this.pred_boxes=s,this.pred_masks=t}}class t2 extends E{}class t0 extends t2{}class t1 extends t2{async _call(e){return new t4(await super._call(e))}}class t4 extends tZ{}class t3 extends E{}class t5 extends t3{}class t6 extends t3{async _call(e){return new iM(await super._call(e))}}class t7 extends E{}class t8 extends t7{}class t9 extends t7{async _call(e){return new iM(await super._call(e))}}class ne extends E{}class ns extends ne{}class nt extends ne{async _call(e){return new iM(await super._call(e))}}class nn extends E{}class na extends nn{}class ni extends nn{}class no extends E{}class nr extends no{}class nl extends no{}class nc extends E{}class nd extends nc{}class n_ extends E{}class nu extends n_{}class nh extends n_{}class nm extends E{}class np extends nm{}class nf extends E{}class ng extends nf{}class nw extends nf{async _call(e){return new iM(await super._call(e))}}class nx extends E{}class ny extends nx{}class nM extends nx{async _call(e){return new iM(await super._call(e))}}class nk extends E{}class nb extends nk{}class nv extends nk{async _call(e){return new iM(await super._call(e))}}class nS extends E{}class nF extends nS{}class nC extends nS{async _call(e){return new nL(await super._call(e))}}class nL extends T{constructor({logits:e,pred_boxes:s}){super(),this.logits=e,this.pred_boxes=s}}class nA extends E{}class nP extends nA{constructor(e,s,t){super(e,s),this.prompt_encoder_mask_decoder=t}async get_image_embeddings({pixel_values:e}){return await F(this,{pixel_values:e})}async forward(e){if(e.image_embeddings&&e.image_positional_embeddings||(e={...e,...await this.get_image_embeddings(e)}),!e.input_labels){let s=e.input_points.dims.slice(0,-1),t=s.reduce((e,s)=>e*s,1);e.input_labels=new r.es("int64",new BigInt64Array(t).fill(1n),s)}return await w(this.prompt_encoder_mask_decoder,{input_points:e.input_points,input_labels:e.input_labels,image_embeddings:e.image_embeddings,image_positional_embeddings:e.image_positional_embeddings})}async _call(e){return new nE(await super._call(e))}}class nE extends T{constructor({iou_scores:e,pred_masks:s}){super(),this.iou_scores=e,this.pred_masks=s}}class nT extends E{}class nO extends nT{}class nB extends nT{constructor(e,s,t,n){super(e,s),this.decoder_merged_session=t,this.generation_config=n,this.num_decoder_layers=this.config.decoder_layers,this.num_decoder_heads=this.config.decoder_attention_heads,this.decoder_dim_kv=this.config.d_model/this.num_decoder_heads,this.num_encoder_layers=this.config.encoder_layers,this.num_encoder_heads=this.config.encoder_attention_heads,this.encoder_dim_kv=this.config.d_model/this.num_encoder_heads}}class nD extends E{}class nI extends nD{}class nq extends nD{constructor(e,s,t,n){super(e,s),this.decoder_merged_session=t,this.generation_config=n,this.num_decoder_layers=this.config.decoder_layers,this.num_decoder_heads=this.config.decoder_attention_heads,this.decoder_dim_kv=this.config.d_model/this.num_decoder_heads,this.num_encoder_layers=this.config.encoder_layers,this.num_encoder_heads=this.config.encoder_attention_heads,this.encoder_dim_kv=this.config.d_model/this.num_encoder_heads}}class nN extends E{}class nG extends nN{}class nV extends nN{async _call(e){return new iF(await super._call(e))}}class nz extends nN{async _call(e){return new iM(await super._call(e))}}class nj extends nN{async _call(e){return new ib(await super._call(e))}}class n$ extends E{}class nW extends n${}class nR extends n${async _call(e){return new iF(await super._call(e))}}class nQ extends n${async _call(e){return new iM(await super._call(e))}}class nU extends E{}class nX extends nU{}class nK extends nU{async _call(e){return new iF(await super._call(e))}}class nH extends nU{async _call(e){return new iM(await super._call(e))}}class nJ extends nU{async _call(e){return new ib(await super._call(e))}}class nZ extends E{}class nY extends nZ{}class n2 extends nZ{async _call(e){return new iF(await super._call(e))}}class n0 extends nZ{async _call(e){return new iM(await super._call(e))}}class n1 extends nN{}class n4 extends nN{async _call(e){return new iF(await super._call(e))}}class n3 extends nN{async _call(e){return new iM(await super._call(e))}}class n5 extends E{}class n6 extends n5{}class n7 extends n5{async _call(e){return new iF(await super._call(e))}}class n8 extends n5{async _call(e){return new iM(await super._call(e))}}class n9 extends n5{async _call(e){return new ik(await super._call(e))}}class ae extends n5{async _call(e){return new ib(await super._call(e))}}class as extends E{}class at extends as{}class an extends as{constructor(e,s,t,n){super(e,s),this.decoder_merged_session=t,this.generation_config=n,this.num_decoder_layers=this.config.decoder_layers,this.num_decoder_heads=this.config.decoder_attention_heads,this.decoder_dim_kv=this.config.hidden_size/this.num_decoder_heads,this.num_encoder_layers=this.config.encoder_layers,this.num_encoder_heads=this.config.encoder_attention_heads,this.encoder_dim_kv=this.config.hidden_size/this.num_encoder_heads}async generate_speech(e,s,{threshold:t=.5,minlenratio:n=0,maxlenratio:a=20,vocoder:i=null}={}){let{encoder_outputs:o,encoder_attention_mask:l}=await F(this,{input_ids:e}),c=o.dims[1]/this.config.reduction_factor,d=Math.floor(c*a),_=Math.floor(c*n),u=this.config.num_mel_bins,h=[],m=null,p=null,f=0;for(;;){++f;let e={use_cache_branch:M(!!p),output_sequence:p?p.output_sequence_out:new r.es("float32",new Float32Array(u),[1,1,u]),encoder_attention_mask:l,speaker_embeddings:s,encoder_hidden_states:o};this.addPastKeyValues(e,m),p=await w(this.decoder_merged_session,e),m=this.getPastKeyValues(p,m);let{prob:n,spectrum:a}=p;if(h.push(a),f>=_&&(Array.from(n.data).filter(e=>e>=t).length>0||f>=d))break}let g=(0,r.d3)(h),{waveform:x}=await w(i.session,{spectrogram:g});return{spectrogram:g,waveform:x}}}class aa extends E{main_input_name="spectrogram"}class ai extends E{constructor(e,s,t){super(e,s),this.generation_config=t,this.config.pad_token_id=this.config.eos_token_id,this.num_encoder_layers=this.num_decoder_layers=this.config.decoder_layers,this.num_encoder_heads=this.num_decoder_heads=this.config.decoder_attention_heads,this.encoder_dim_kv=this.decoder_dim_kv=this.config.d_model/this.num_decoder_heads}}class ao extends ai{}class ar extends E{constructor(e,s,t){super(e,s),this.generation_config=t,this.config.pad_token_id=this.config.eos_token_id,this.num_heads=this.config.num_key_value_heads,this.num_layers=this.config.num_hidden_layers,this.dim_kv=this.config.hidden_size/this.config.num_attention_heads}}class al extends ar{}class ac extends ar{}class ad extends E{constructor(e,s,t){super(e,s),this.generation_config=t,this.config.pad_token_id=this.config.eos_token_id,this.num_heads=this.config.num_key_value_heads,this.num_layers=this.config.num_hidden_layers,this.dim_kv=this.config.hidden_size/this.config.num_attention_heads}}class a_ extends ad{}class au extends ad{}class ah extends E{constructor(e,s,t){super(e,s),this.generation_config=t,this.config.pad_token_id=this.config.eos_token_id,this.num_heads=this.config.num_attention_heads,this.num_layers=this.config.num_hidden_layers,this.dim_kv=this.config.hidden_size/this.config.num_attention_heads}}class am extends ah{}class ap extends ah{}class af extends E{}class ag extends af{}class aw extends af{static async from_pretrained(e,s={}){return s.model_file_name??="text_model",super.from_pretrained(e,s)}}class ax extends af{static async from_pretrained(e,s={}){return s.model_file_name??="audio_model",super.from_pretrained(e,s)}}class ay extends E{}class aM extends ay{async _call(e){return new iL(await super._call(e))}}class ak extends E{}class ab extends ak{}class av extends ak{}class aS extends E{constructor(e,s,t){super(e,s),this.generation_config=t,this.config.pad_token_id=this.config.eos_token_id,this.num_heads=this.config.num_attention_heads,this.num_layers=this.config.num_hidden_layers,this.dim_kv=this.config.hidden_size/this.num_heads}}class aF extends aS{}class aC extends E{}class aL extends aC{}class aA extends aC{async _call(e){return new iM(await super._call(e))}}class aP{static MODEL_CLASS_MAPPINGS=null;static BASE_IF_FAIL=!1;static async from_pretrained(e,{quantized:s=!0,progress_callback:t=null,config:a=null,cache_dir:i=null,local_files_only:o=!1,revision:r="main",model_file_name:l=null}={}){let c={quantized:s,progress_callback:t,config:a,cache_dir:i,local_files_only:o,revision:r,model_file_name:l};if(a=await n.z.from_pretrained(e,c),c.config||(c.config=a),!this.MODEL_CLASS_MAPPINGS)throw Error("`MODEL_CLASS_MAPPINGS` not implemented for this type of `AutoClass`: "+this.name);for(let s of this.MODEL_CLASS_MAPPINGS){let t=s.get(a.model_type);if(t)return await t[1].from_pretrained(e,c)}if(this.BASE_IF_FAIL)return console.warn(`Unknown model class "${a.model_type}", attempting to construct from base class.`),await E.from_pretrained(e,c);throw Error(`Unsupported model type: ${a.model_type}`)}}let aE=new Map([["bert",["BertModel",B]],["nomic_bert",["NomicBertModel",V]],["roformer",["RoFormerModel",j]],["electra",["ElectraModel",ee]],["esm",["EsmModel",eP]],["convbert",["ConvBertModel",X]],["camembert",["CamembertModel",eo]],["deberta",["DebertaModel",eu]],["deberta-v2",["DebertaV2Model",ew]],["mpnet",["MPNetModel",eV]],["albert",["AlbertModel",eJ]],["distilbert",["DistilBertModel",ev]],["roberta",["RobertaModel",sf]],["xlm",["XLMModel",sk]],["xlm-roberta",["XLMRobertaModel",sL]],["clap",["ClapModel",ag]],["clip",["CLIPModel",sz]],["clipseg",["CLIPSegModel",sJ]],["chinese_clip",["ChineseCLIPModel",sK]],["siglip",["SiglipModel",sR]],["mobilebert",["MobileBertModel",eD]],["squeezebert",["SqueezeBertModel",eQ]],["wav2vec2",["Wav2Vec2Model",nG]],["wav2vec2-bert",["Wav2Vec2BertModel",nY]],["unispeech",["UniSpeechModel",nW]],["unispeech-sat",["UniSpeechSatModel",nX]],["hubert",["HubertModel",n1]],["wavlm",["WavLMModel",n6]],["audio-spectrogram-transformer",["ASTModel",sB]],["vits",["VitsModel",aM]],["detr",["DetrModel",tK]],["table-transformer",["TableTransformerModel",t0]],["vit",["ViTModel",tF]],["fastvit",["FastViTModel",tA]],["mobilevit",["MobileViTModel",tB]],["mobilevitv2",["MobileViTV2Model",tq]],["owlvit",["OwlViTModel",tV]],["owlv2",["Owlv2Model",t$]],["beit",["BeitModel",tQ]],["deit",["DeiTModel",t5]],["convnext",["ConvNextModel",ng]],["convnextv2",["ConvNextV2Model",ny]],["dinov2",["Dinov2Model",nb]],["resnet",["ResNetModel",t8]],["swin",["SwinModel",ns]],["swin2sr",["Swin2SRModel",na]],["donut-swin",["DonutSwinModel",np]],["yolos",["YolosModel",nF]],["dpt",["DPTModel",nr]],["glpn",["GLPNModel",nu]],["hifigan",["SpeechT5HifiGan",aa]],["efficientnet",["EfficientNetModel",aL]]]),aT=new Map([["t5",["T5Model",e1]],["longt5",["LongT5Model",e5]],["mt5",["MT5Model",e8]],["bart",["BartModel",ss]],["mbart",["MBartModel",si]],["marian",["MarianModel",nO]],["whisper",["WhisperModel",sq]],["m2m_100",["M2M100Model",nI]],["blenderbot",["BlenderbotModel",sd]],["blenderbot-small",["BlenderbotSmallModel",sh]]]),aO=new Map([["bloom",["BloomModel",tg]],["gpt2",["GPT2Model",s2]],["gptj",["GPTJModel",s9]],["gpt_bigcode",["GPTBigCodeModel",tt]],["gpt_neo",["GPTNeoModel",s4]],["gpt_neox",["GPTNeoXModel",s6]],["codegen",["CodeGenModel",ti]],["llama",["LlamaModel",tl]],["qwen2",["Qwen2Model",t_]],["phi",["PhiModel",tm]],["mpt",["MptModel",ty]],["opt",["OPTModel",tb]],["mistral",["MistralModel",al]],["starcoder2",["Starcoder2Model",a_]],["falcon",["FalconModel",am]]]),aB=new Map([["speecht5",["SpeechT5ForSpeechToText",at]],["whisper",["WhisperForConditionalGeneration",sN]]]),aD=new Map([["speecht5",["SpeechT5ForTextToSpeech",an]]]),aI=new Map([["vits",["VitsModel",aM]]]),aq=new Map([["bert",["BertForSequenceClassification",I]],["roformer",["RoFormerForSequenceClassification",W]],["electra",["ElectraForSequenceClassification",et]],["esm",["EsmForSequenceClassification",eT]],["convbert",["ConvBertForSequenceClassification",H]],["camembert",["CamembertForSequenceClassification",el]],["deberta",["DebertaForSequenceClassification",em]],["deberta-v2",["DebertaV2ForSequenceClassification",ey]],["mpnet",["MPNetForSequenceClassification",ej]],["albert",["AlbertForSequenceClassification",eZ]],["distilbert",["DistilBertForSequenceClassification",eS]],["roberta",["RobertaForSequenceClassification",sw]],["xlm",["XLMForSequenceClassification",sv]],["xlm-roberta",["XLMRobertaForSequenceClassification",sP]],["bart",["BartForSequenceClassification",sn]],["mbart",["MBartForSequenceClassification",sr]],["mobilebert",["MobileBertForSequenceClassification",eq]],["squeezebert",["SqueezeBertForSequenceClassification",eX]]]),aN=new Map([["bert",["BertForTokenClassification",q]],["roformer",["RoFormerForTokenClassification",R]],["electra",["ElectraForTokenClassification",en]],["esm",["EsmForTokenClassification",eO]],["convbert",["ConvBertForTokenClassification",J]],["camembert",["CamembertForTokenClassification",ec]],["deberta",["DebertaForTokenClassification",ep]],["deberta-v2",["DebertaV2ForTokenClassification",eM]],["mpnet",["MPNetForTokenClassification",e$]],["distilbert",["DistilBertForTokenClassification",eF]],["roberta",["RobertaForTokenClassification",sx]],["xlm",["XLMForTokenClassification",sS]],["xlm-roberta",["XLMRobertaForTokenClassification",sE]]]),aG=new Map([["t5",["T5ForConditionalGeneration",e4]],["longt5",["LongT5ForConditionalGeneration",e6]],["mt5",["MT5ForConditionalGeneration",e9]],["bart",["BartForConditionalGeneration",st]],["mbart",["MBartForConditionalGeneration",so]],["marian",["MarianMTModel",nB]],["m2m_100",["M2M100ForConditionalGeneration",nq]],["blenderbot",["BlenderbotForConditionalGeneration",s_]],["blenderbot-small",["BlenderbotSmallForConditionalGeneration",sm]]]),aV=new Map([["bloom",["BloomForCausalLM",tw]],["gpt2",["GPT2LMHeadModel",s0]],["gptj",["GPTJForCausalLM",te]],["gpt_bigcode",["GPTBigCodeForCausalLM",tn]],["gpt_neo",["GPTNeoForCausalLM",s3]],["gpt_neox",["GPTNeoXForCausalLM",s7]],["codegen",["CodeGenForCausalLM",to]],["llama",["LlamaForCausalLM",tc]],["qwen2",["Qwen2ForCausalLM",tu]],["phi",["PhiForCausalLM",tp]],["mpt",["MptForCausalLM",tM]],["opt",["OPTForCausalLM",tv]],["mbart",["MBartForCausalLM",sl]],["mistral",["MistralForCausalLM",ac]],["starcoder2",["Starcoder2ForCausalLM",au]],["falcon",["FalconForCausalLM",ap]],["trocr",["TrOCRForCausalLM",ao]],["stablelm",["StableLmForCausalLM",aF]]]),az=new Map([["bert",["BertForMaskedLM",D]],["roformer",["RoFormerForMaskedLM",$]],["electra",["ElectraForMaskedLM",es]],["esm",["EsmForMaskedLM",eE]],["convbert",["ConvBertForMaskedLM",K]],["camembert",["CamembertForMaskedLM",er]],["deberta",["DebertaForMaskedLM",eh]],["deberta-v2",["DebertaV2ForMaskedLM",ex]],["mpnet",["MPNetForMaskedLM",ez]],["albert",["AlbertForMaskedLM",e2]],["distilbert",["DistilBertForMaskedLM",eL]],["roberta",["RobertaForMaskedLM",sg]],["xlm",["XLMWithLMHeadModel",sb]],["xlm-roberta",["XLMRobertaForMaskedLM",sA]],["mobilebert",["MobileBertForMaskedLM",eI]],["squeezebert",["SqueezeBertForMaskedLM",eU]]]),aj=new Map([["bert",["BertForQuestionAnswering",N]],["roformer",["RoFormerForQuestionAnswering",Q]],["electra",["ElectraForQuestionAnswering",ea]],["convbert",["ConvBertForQuestionAnswering",Z]],["camembert",["CamembertForQuestionAnswering",ed]],["deberta",["DebertaForQuestionAnswering",ef]],["deberta-v2",["DebertaV2ForQuestionAnswering",ek]],["mpnet",["MPNetForQuestionAnswering",eW]],["albert",["AlbertForQuestionAnswering",eY]],["distilbert",["DistilBertForQuestionAnswering",eC]],["roberta",["RobertaForQuestionAnswering",sy]],["xlm",["XLMForQuestionAnswering",sF]],["xlm-roberta",["XLMRobertaForQuestionAnswering",sT]],["mobilebert",["MobileBertForQuestionAnswering",eN]],["squeezebert",["SqueezeBertForQuestionAnswering",eK]]]),a$=new Map([["vision-encoder-decoder",["VisionEncoderDecoderModel",sG]]]),aW=new Map([["vision-encoder-decoder",["VisionEncoderDecoderModel",sG]]]),aR=new Map([["vit",["ViTForImageClassification",tC]],["fastvit",["FastViTForImageClassification",tP]],["mobilevit",["MobileViTForImageClassification",tD]],["mobilevitv2",["MobileViTV2ForImageClassification",tN]],["beit",["BeitForImageClassification",tU]],["deit",["DeiTForImageClassification",t6]],["convnext",["ConvNextForImageClassification",nw]],["convnextv2",["ConvNextV2ForImageClassification",nM]],["dinov2",["Dinov2ForImageClassification",nv]],["resnet",["ResNetForImageClassification",t9]],["swin",["SwinForImageClassification",nt]],["segformer",["SegformerForImageClassification",ab]],["efficientnet",["EfficientNetForImageClassification",aA]]]),aQ=new Map([["detr",["DetrForObjectDetection",tH]],["table-transformer",["TableTransformerForObjectDetection",t1]],["yolos",["YolosForObjectDetection",nC]]]),aU=new Map([["owlvit",["OwlViTForObjectDetection",tz]],["owlv2",["Owlv2ForObjectDetection",tW]]]),aX=new Map([["detr",["DetrForSegmentation",tJ]],["clipseg",["CLIPSegForImageSegmentation",sZ]]]),aK=new Map([["segformer",["SegformerForSemanticSegmentation",av]]]),aH=new Map([["sam",["SamModel",nP]]]),aJ=new Map([["wav2vec2",["Wav2Vec2ForCTC",nV]],["wav2vec2-bert",["Wav2Vec2BertForCTC",n2]],["unispeech",["UniSpeechForCTC",nR]],["unispeech-sat",["UniSpeechSatForCTC",nK]],["wavlm",["WavLMForCTC",n7]],["hubert",["HubertForCTC",n4]]]),aZ=new Map([["wav2vec2",["Wav2Vec2ForSequenceClassification",nz]],["wav2vec2-bert",["Wav2Vec2BertForSequenceClassification",n0]],["unispeech",["UniSpeechForSequenceClassification",nQ]],["unispeech-sat",["UniSpeechSatForSequenceClassification",nH]],["wavlm",["WavLMForSequenceClassification",n8]],["hubert",["HubertForSequenceClassification",n3]],["audio-spectrogram-transformer",["ASTForAudioClassification",sD]]]),aY=new Map([["wavlm",["WavLMForXVector",n9]]]),a2=new Map([["unispeech-sat",["UniSpeechSatForAudioFrameClassification",nJ]],["wavlm",["WavLMForAudioFrameClassification",ae]],["wav2vec2",["Wav2Vec2ForAudioFrameClassification",nj]]]),a0=new Map([["vitmatte",["VitMatteForImageMatting",tT]]]),a1=new Map([["swin2sr",["Swin2SRForImageSuperResolution",ni]]]),a4=new Map([["dpt",["DPTForDepthEstimation",nl]],["depth_anything",["DepthAnythingForDepthEstimation",nd]],["glpn",["GLPNForDepthEstimation",nh]]]),a3=new Map([["clip",["CLIPVisionModelWithProjection",s$]],["siglip",["SiglipVisionModel",sU]]]),a5=[[aE,h.EncoderOnly],[aT,h.EncoderDecoder],[aO,h.DecoderOnly],[aq,h.EncoderOnly],[aN,h.EncoderOnly],[aG,h.Seq2Seq],[aB,h.Seq2Seq],[aV,h.DecoderOnly],[az,h.EncoderOnly],[aj,h.EncoderOnly],[a$,h.Vision2Seq],[aR,h.EncoderOnly],[aX,h.EncoderOnly],[aK,h.EncoderOnly],[a0,h.EncoderOnly],[a1,h.EncoderOnly],[a4,h.EncoderOnly],[aQ,h.EncoderOnly],[aU,h.EncoderOnly],[aH,h.MaskGeneration],[aJ,h.EncoderOnly],[aZ,h.EncoderOnly],[aD,h.Seq2Seq],[aI,h.EncoderOnly],[aY,h.EncoderOnly],[a2,h.EncoderOnly],[a3,h.EncoderOnly]];for(let[e,s]of a5)for(let[t,n]of e.values())m.set(t,s),f.set(n,t),p.set(t,n);for(let[e,s,t]of[["CLIPTextModelWithProjection",sj,h.EncoderOnly],["SiglipTextModel",sQ,h.EncoderOnly],["ClapTextModelWithProjection",aw,h.EncoderOnly],["ClapAudioModelWithProjection",ax,h.EncoderOnly]])m.set(e,t),f.set(s,e),p.set(e,s);class a6 extends aP{static MODEL_CLASS_MAPPINGS=a5.map(e=>e[0]);static BASE_IF_FAIL=!0}class a7 extends aP{static MODEL_CLASS_MAPPINGS=[aq]}class a8 extends aP{static MODEL_CLASS_MAPPINGS=[aN]}class a9 extends aP{static MODEL_CLASS_MAPPINGS=[aG]}class ie extends aP{static MODEL_CLASS_MAPPINGS=[aB]}class is extends aP{static MODEL_CLASS_MAPPINGS=[aD]}class it extends aP{static MODEL_CLASS_MAPPINGS=[aI]}class ia extends aP{static MODEL_CLASS_MAPPINGS=[aV]}class ii extends aP{static MODEL_CLASS_MAPPINGS=[az]}class io extends aP{static MODEL_CLASS_MAPPINGS=[aj]}class ir extends aP{static MODEL_CLASS_MAPPINGS=[a$]}class il extends aP{static MODEL_CLASS_MAPPINGS=[aR]}class ic extends aP{static MODEL_CLASS_MAPPINGS=[aX]}class id extends aP{static MODEL_CLASS_MAPPINGS=[aK]}class i_ extends aP{static MODEL_CLASS_MAPPINGS=[aQ]}class iu extends aP{static MODEL_CLASS_MAPPINGS=[aU]}class ih extends aP{static MODEL_CLASS_MAPPINGS=[aJ]}class im extends aP{static MODEL_CLASS_MAPPINGS=[aZ]}class ip extends aP{static MODEL_CLASS_MAPPINGS=[aW]}class ig extends aP{static MODEL_CLASS_MAPPINGS=[a1]}class iw extends aP{static MODEL_CLASS_MAPPINGS=[a4]}class ix extends aP{static MODEL_CLASS_MAPPINGS=[a3]}class iy extends T{constructor({logits:e,past_key_values:s,encoder_outputs:t,decoder_attentions:n=null,cross_attentions:a=null}){super(),this.logits=e,this.past_key_values=s,this.encoder_outputs=t,this.decoder_attentions=n,this.cross_attentions=a}}class iM extends T{constructor({logits:e}){super(),this.logits=e}}class ik extends T{constructor({logits:e,embeddings:s}){super(),this.logits=e,this.embeddings=s}}class ib extends T{constructor({logits:e}){super(),this.logits=e}}class iv extends T{constructor({logits:e}){super(),this.logits=e}}class iS extends T{constructor({start_logits:e,end_logits:s}){super(),this.start_logits=e,this.end_logits=s}}class iF extends T{constructor({logits:e}){super(),this.logits=e}}class iC extends T{constructor({alphas:e}){super(),this.alphas=e}}class iL extends T{constructor({waveform:e,spectrogram:s}){super(),this.waveform=e,this.spectrogram=s}}}}]);
|
_next/static/chunks/72-b9a6a0da3e447ebd.js
ADDED
@@ -0,0 +1,6 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[72],{8738:function(t,r){"use strict";r.byteLength=function(t){var r=s(t),e=r[0],n=r[1];return(e+n)*3/4-n},r.toByteArray=function(t){var r,e,i=s(t),f=i[0],u=i[1],h=new o((f+u)*3/4-u),a=0,p=u>0?f-4:f;for(e=0;e<p;e+=4)r=n[t.charCodeAt(e)]<<18|n[t.charCodeAt(e+1)]<<12|n[t.charCodeAt(e+2)]<<6|n[t.charCodeAt(e+3)],h[a++]=r>>16&255,h[a++]=r>>8&255,h[a++]=255&r;return 2===u&&(r=n[t.charCodeAt(e)]<<2|n[t.charCodeAt(e+1)]>>4,h[a++]=255&r),1===u&&(r=n[t.charCodeAt(e)]<<10|n[t.charCodeAt(e+1)]<<4|n[t.charCodeAt(e+2)]>>2,h[a++]=r>>8&255,h[a++]=255&r),h},r.fromByteArray=function(t){for(var r,n=t.length,o=n%3,i=[],f=0,u=n-o;f<u;f+=16383)i.push(function(t,r,n){for(var o,i=[],f=r;f<n;f+=3)i.push(e[(o=(t[f]<<16&16711680)+(t[f+1]<<8&65280)+(255&t[f+2]))>>18&63]+e[o>>12&63]+e[o>>6&63]+e[63&o]);return i.join("")}(t,f,f+16383>u?u:f+16383));return 1===o?i.push(e[(r=t[n-1])>>2]+e[r<<4&63]+"=="):2===o&&i.push(e[(r=(t[n-2]<<8)+t[n-1])>>10]+e[r>>4&63]+e[r<<2&63]+"="),i.join("")};for(var e=[],n=[],o="undefined"!=typeof Uint8Array?Uint8Array:Array,i="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",f=0,u=i.length;f<u;++f)e[f]=i[f],n[i.charCodeAt(f)]=f;function s(t){var r=t.length;if(r%4>0)throw Error("Invalid string. Length must be a multiple of 4");var e=t.indexOf("=");-1===e&&(e=r);var n=e===r?0:4-e%4;return[e,n]}n["-".charCodeAt(0)]=62,n["_".charCodeAt(0)]=63},9109:function(t,r,e){"use strict";/*!
|
2 |
+
* The buffer module from node.js, for the browser.
|
3 |
+
*
|
4 |
+
* @author Feross Aboukhadijeh <https://feross.org>
|
5 |
+
* @license MIT
|
6 |
+
*/var n=e(8738),o=e(6868),i="function"==typeof Symbol&&"function"==typeof Symbol.for?Symbol.for("nodejs.util.inspect.custom"):null;function f(t){if(t>2147483647)throw RangeError('The value "'+t+'" is invalid for option "size"');var r=new Uint8Array(t);return Object.setPrototypeOf(r,u.prototype),r}function u(t,r,e){if("number"==typeof t){if("string"==typeof r)throw TypeError('The "string" argument must be of type string. Received type number');return a(t)}return s(t,r,e)}function s(t,r,e){if("string"==typeof t)return function(t,r){if(("string"!=typeof r||""===r)&&(r="utf8"),!u.isEncoding(r))throw TypeError("Unknown encoding: "+r);var e=0|y(t,r),n=f(e),o=n.write(t,r);return o!==e&&(n=n.slice(0,o)),n}(t,r);if(ArrayBuffer.isView(t))return function(t){if(C(t,Uint8Array)){var r=new Uint8Array(t);return c(r.buffer,r.byteOffset,r.byteLength)}return p(t)}(t);if(null==t)throw TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof t);if(C(t,ArrayBuffer)||t&&C(t.buffer,ArrayBuffer)||"undefined"!=typeof SharedArrayBuffer&&(C(t,SharedArrayBuffer)||t&&C(t.buffer,SharedArrayBuffer)))return c(t,r,e);if("number"==typeof t)throw TypeError('The "value" argument must not be of type number. Received type number');var n=t.valueOf&&t.valueOf();if(null!=n&&n!==t)return u.from(n,r,e);var o=function(t){if(u.isBuffer(t)){var r,e=0|l(t.length),n=f(e);return 0===n.length||t.copy(n,0,0,e),n}return void 0!==t.length?"number"!=typeof t.length||(r=t.length)!=r?f(0):p(t):"Buffer"===t.type&&Array.isArray(t.data)?p(t.data):void 0}(t);if(o)return o;if("undefined"!=typeof Symbol&&null!=Symbol.toPrimitive&&"function"==typeof t[Symbol.toPrimitive])return u.from(t[Symbol.toPrimitive]("string"),r,e);throw TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof t)}function h(t){if("number"!=typeof t)throw TypeError('"size" argument must be of type number');if(t<0)throw RangeError('The value "'+t+'" is invalid for option "size"')}function a(t){return h(t),f(t<0?0:0|l(t))}function p(t){for(var r=t.length<0?0:0|l(t.length),e=f(r),n=0;n<r;n+=1)e[n]=255&t[n];return e}function c(t,r,e){var n;if(r<0||t.byteLength<r)throw RangeError('"offset" is outside of buffer bounds');if(t.byteLength<r+(e||0))throw RangeError('"length" is outside of buffer bounds');return Object.setPrototypeOf(n=void 0===r&&void 0===e?new Uint8Array(t):void 0===e?new Uint8Array(t,r):new Uint8Array(t,r,e),u.prototype),n}function l(t){if(t>=2147483647)throw RangeError("Attempt to allocate Buffer larger than maximum size: 0x7fffffff bytes");return 0|t}function y(t,r){if(u.isBuffer(t))return t.length;if(ArrayBuffer.isView(t)||C(t,ArrayBuffer))return t.byteLength;if("string"!=typeof t)throw TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof t);var e=t.length,n=arguments.length>2&&!0===arguments[2];if(!n&&0===e)return 0;for(var o=!1;;)switch(r){case"ascii":case"latin1":case"binary":return e;case"utf8":case"utf-8":return I(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*e;case"hex":return e>>>1;case"base64":return T(t).length;default:if(o)return n?-1:I(t).length;r=(""+r).toLowerCase(),o=!0}}function g(t,r,e){var o,i,f=!1;if((void 0===r||r<0)&&(r=0),r>this.length||((void 0===e||e>this.length)&&(e=this.length),e<=0||(e>>>=0)<=(r>>>=0)))return"";for(t||(t="utf8");;)switch(t){case"hex":return function(t,r,e){var n=t.length;(!r||r<0)&&(r=0),(!e||e<0||e>n)&&(e=n);for(var o="",i=r;i<e;++i)o+=R[t[i]];return o}(this,r,e);case"utf8":case"utf-8":return w(this,r,e);case"ascii":return function(t,r,e){var n="";e=Math.min(t.length,e);for(var o=r;o<e;++o)n+=String.fromCharCode(127&t[o]);return n}(this,r,e);case"latin1":case"binary":return function(t,r,e){var n="";e=Math.min(t.length,e);for(var o=r;o<e;++o)n+=String.fromCharCode(t[o]);return n}(this,r,e);case"base64":return o=r,i=e,0===o&&i===this.length?n.fromByteArray(this):n.fromByteArray(this.slice(o,i));case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return function(t,r,e){for(var n=t.slice(r,e),o="",i=0;i<n.length-1;i+=2)o+=String.fromCharCode(n[i]+256*n[i+1]);return o}(this,r,e);default:if(f)throw TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),f=!0}}function d(t,r,e){var n=t[r];t[r]=t[e],t[e]=n}function v(t,r,e,n,o){var i;if(0===t.length)return -1;if("string"==typeof e?(n=e,e=0):e>2147483647?e=2147483647:e<-2147483648&&(e=-2147483648),(i=e=+e)!=i&&(e=o?0:t.length-1),e<0&&(e=t.length+e),e>=t.length){if(o)return -1;e=t.length-1}else if(e<0){if(!o)return -1;e=0}if("string"==typeof r&&(r=u.from(r,n)),u.isBuffer(r))return 0===r.length?-1:b(t,r,e,n,o);if("number"==typeof r)return(r&=255,"function"==typeof Uint8Array.prototype.indexOf)?o?Uint8Array.prototype.indexOf.call(t,r,e):Uint8Array.prototype.lastIndexOf.call(t,r,e):b(t,[r],e,n,o);throw TypeError("val must be string, number or Buffer")}function b(t,r,e,n,o){var i,f=1,u=t.length,s=r.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(t.length<2||r.length<2)return -1;f=2,u/=2,s/=2,e/=2}function h(t,r){return 1===f?t[r]:t.readUInt16BE(r*f)}if(o){var a=-1;for(i=e;i<u;i++)if(h(t,i)===h(r,-1===a?0:i-a)){if(-1===a&&(a=i),i-a+1===s)return a*f}else -1!==a&&(i-=i-a),a=-1}else for(e+s>u&&(e=u-s),i=e;i>=0;i--){for(var p=!0,c=0;c<s;c++)if(h(t,i+c)!==h(r,c)){p=!1;break}if(p)return i}return -1}function w(t,r,e){e=Math.min(t.length,e);for(var n=[],o=r;o<e;){var i,f,u,s,h=t[o],a=null,p=h>239?4:h>223?3:h>191?2:1;if(o+p<=e)switch(p){case 1:h<128&&(a=h);break;case 2:(192&(i=t[o+1]))==128&&(s=(31&h)<<6|63&i)>127&&(a=s);break;case 3:i=t[o+1],f=t[o+2],(192&i)==128&&(192&f)==128&&(s=(15&h)<<12|(63&i)<<6|63&f)>2047&&(s<55296||s>57343)&&(a=s);break;case 4:i=t[o+1],f=t[o+2],u=t[o+3],(192&i)==128&&(192&f)==128&&(192&u)==128&&(s=(15&h)<<18|(63&i)<<12|(63&f)<<6|63&u)>65535&&s<1114112&&(a=s)}null===a?(a=65533,p=1):a>65535&&(a-=65536,n.push(a>>>10&1023|55296),a=56320|1023&a),n.push(a),o+=p}return function(t){var r=t.length;if(r<=4096)return String.fromCharCode.apply(String,t);for(var e="",n=0;n<r;)e+=String.fromCharCode.apply(String,t.slice(n,n+=4096));return e}(n)}function m(t,r,e){if(t%1!=0||t<0)throw RangeError("offset is not uint");if(t+r>e)throw RangeError("Trying to access beyond buffer length")}function E(t,r,e,n,o,i){if(!u.isBuffer(t))throw TypeError('"buffer" argument must be a Buffer instance');if(r>o||r<i)throw RangeError('"value" argument is out of bounds');if(e+n>t.length)throw RangeError("Index out of range")}function A(t,r,e,n,o,i){if(e+n>t.length||e<0)throw RangeError("Index out of range")}function B(t,r,e,n,i){return r=+r,e>>>=0,i||A(t,r,e,4,34028234663852886e22,-34028234663852886e22),o.write(t,r,e,n,23,4),e+4}function U(t,r,e,n,i){return r=+r,e>>>=0,i||A(t,r,e,8,17976931348623157e292,-17976931348623157e292),o.write(t,r,e,n,52,8),e+8}r.lW=u,r.h2=50,u.TYPED_ARRAY_SUPPORT=function(){try{var t=new Uint8Array(1),r={foo:function(){return 42}};return Object.setPrototypeOf(r,Uint8Array.prototype),Object.setPrototypeOf(t,r),42===t.foo()}catch(t){return!1}}(),u.TYPED_ARRAY_SUPPORT||"undefined"==typeof console||"function"!=typeof console.error||console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support."),Object.defineProperty(u.prototype,"parent",{enumerable:!0,get:function(){if(u.isBuffer(this))return this.buffer}}),Object.defineProperty(u.prototype,"offset",{enumerable:!0,get:function(){if(u.isBuffer(this))return this.byteOffset}}),u.poolSize=8192,u.from=function(t,r,e){return s(t,r,e)},Object.setPrototypeOf(u.prototype,Uint8Array.prototype),Object.setPrototypeOf(u,Uint8Array),u.alloc=function(t,r,e){return(h(t),t<=0)?f(t):void 0!==r?"string"==typeof e?f(t).fill(r,e):f(t).fill(r):f(t)},u.allocUnsafe=function(t){return a(t)},u.allocUnsafeSlow=function(t){return a(t)},u.isBuffer=function(t){return null!=t&&!0===t._isBuffer&&t!==u.prototype},u.compare=function(t,r){if(C(t,Uint8Array)&&(t=u.from(t,t.offset,t.byteLength)),C(r,Uint8Array)&&(r=u.from(r,r.offset,r.byteLength)),!u.isBuffer(t)||!u.isBuffer(r))throw TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(t===r)return 0;for(var e=t.length,n=r.length,o=0,i=Math.min(e,n);o<i;++o)if(t[o]!==r[o]){e=t[o],n=r[o];break}return e<n?-1:n<e?1:0},u.isEncoding=function(t){switch(String(t).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},u.concat=function(t,r){if(!Array.isArray(t))throw TypeError('"list" argument must be an Array of Buffers');if(0===t.length)return u.alloc(0);if(void 0===r)for(e=0,r=0;e<t.length;++e)r+=t[e].length;var e,n=u.allocUnsafe(r),o=0;for(e=0;e<t.length;++e){var i=t[e];if(C(i,Uint8Array))o+i.length>n.length?u.from(i).copy(n,o):Uint8Array.prototype.set.call(n,i,o);else if(u.isBuffer(i))i.copy(n,o);else throw TypeError('"list" argument must be an Array of Buffers');o+=i.length}return n},u.byteLength=y,u.prototype._isBuffer=!0,u.prototype.swap16=function(){var t=this.length;if(t%2!=0)throw RangeError("Buffer size must be a multiple of 16-bits");for(var r=0;r<t;r+=2)d(this,r,r+1);return this},u.prototype.swap32=function(){var t=this.length;if(t%4!=0)throw RangeError("Buffer size must be a multiple of 32-bits");for(var r=0;r<t;r+=4)d(this,r,r+3),d(this,r+1,r+2);return this},u.prototype.swap64=function(){var t=this.length;if(t%8!=0)throw RangeError("Buffer size must be a multiple of 64-bits");for(var r=0;r<t;r+=8)d(this,r,r+7),d(this,r+1,r+6),d(this,r+2,r+5),d(this,r+3,r+4);return this},u.prototype.toString=function(){var t=this.length;return 0===t?"":0==arguments.length?w(this,0,t):g.apply(this,arguments)},u.prototype.toLocaleString=u.prototype.toString,u.prototype.equals=function(t){if(!u.isBuffer(t))throw TypeError("Argument must be a Buffer");return this===t||0===u.compare(this,t)},u.prototype.inspect=function(){var t="",e=r.h2;return t=this.toString("hex",0,e).replace(/(.{2})/g,"$1 ").trim(),this.length>e&&(t+=" ... "),"<Buffer "+t+">"},i&&(u.prototype[i]=u.prototype.inspect),u.prototype.compare=function(t,r,e,n,o){if(C(t,Uint8Array)&&(t=u.from(t,t.offset,t.byteLength)),!u.isBuffer(t))throw TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof t);if(void 0===r&&(r=0),void 0===e&&(e=t?t.length:0),void 0===n&&(n=0),void 0===o&&(o=this.length),r<0||e>t.length||n<0||o>this.length)throw RangeError("out of range index");if(n>=o&&r>=e)return 0;if(n>=o)return -1;if(r>=e)return 1;if(r>>>=0,e>>>=0,n>>>=0,o>>>=0,this===t)return 0;for(var i=o-n,f=e-r,s=Math.min(i,f),h=this.slice(n,o),a=t.slice(r,e),p=0;p<s;++p)if(h[p]!==a[p]){i=h[p],f=a[p];break}return i<f?-1:f<i?1:0},u.prototype.includes=function(t,r,e){return -1!==this.indexOf(t,r,e)},u.prototype.indexOf=function(t,r,e){return v(this,t,r,e,!0)},u.prototype.lastIndexOf=function(t,r,e){return v(this,t,r,e,!1)},u.prototype.write=function(t,r,e,n){if(void 0===r)n="utf8",e=this.length,r=0;else if(void 0===e&&"string"==typeof r)n=r,e=this.length,r=0;else if(isFinite(r))r>>>=0,isFinite(e)?(e>>>=0,void 0===n&&(n="utf8")):(n=e,e=void 0);else throw Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");var o,i,f,u,s,h,a,p,c=this.length-r;if((void 0===e||e>c)&&(e=c),t.length>0&&(e<0||r<0)||r>this.length)throw RangeError("Attempt to write outside buffer bounds");n||(n="utf8");for(var l=!1;;)switch(n){case"hex":return function(t,r,e,n){e=Number(e)||0;var o=t.length-e;n?(n=Number(n))>o&&(n=o):n=o;var i=r.length;n>i/2&&(n=i/2);for(var f=0;f<n;++f){var u=parseInt(r.substr(2*f,2),16);if(u!=u)break;t[e+f]=u}return f}(this,t,r,e);case"utf8":case"utf-8":return o=r,i=e,O(I(t,this.length-o),this,o,i);case"ascii":case"latin1":case"binary":return f=r,u=e,O(function(t){for(var r=[],e=0;e<t.length;++e)r.push(255&t.charCodeAt(e));return r}(t),this,f,u);case"base64":return s=r,h=e,O(T(t),this,s,h);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return a=r,p=e,O(function(t,r){for(var e,n,o=[],i=0;i<t.length&&!((r-=2)<0);++i)n=(e=t.charCodeAt(i))>>8,o.push(e%256),o.push(n);return o}(t,this.length-a),this,a,p);default:if(l)throw TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),l=!0}},u.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}},u.prototype.slice=function(t,r){var e=this.length;t=~~t,r=void 0===r?e:~~r,t<0?(t+=e)<0&&(t=0):t>e&&(t=e),r<0?(r+=e)<0&&(r=0):r>e&&(r=e),r<t&&(r=t);var n=this.subarray(t,r);return Object.setPrototypeOf(n,u.prototype),n},u.prototype.readUintLE=u.prototype.readUIntLE=function(t,r,e){t>>>=0,r>>>=0,e||m(t,r,this.length);for(var n=this[t],o=1,i=0;++i<r&&(o*=256);)n+=this[t+i]*o;return n},u.prototype.readUintBE=u.prototype.readUIntBE=function(t,r,e){t>>>=0,r>>>=0,e||m(t,r,this.length);for(var n=this[t+--r],o=1;r>0&&(o*=256);)n+=this[t+--r]*o;return n},u.prototype.readUint8=u.prototype.readUInt8=function(t,r){return t>>>=0,r||m(t,1,this.length),this[t]},u.prototype.readUint16LE=u.prototype.readUInt16LE=function(t,r){return t>>>=0,r||m(t,2,this.length),this[t]|this[t+1]<<8},u.prototype.readUint16BE=u.prototype.readUInt16BE=function(t,r){return t>>>=0,r||m(t,2,this.length),this[t]<<8|this[t+1]},u.prototype.readUint32LE=u.prototype.readUInt32LE=function(t,r){return t>>>=0,r||m(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+16777216*this[t+3]},u.prototype.readUint32BE=u.prototype.readUInt32BE=function(t,r){return t>>>=0,r||m(t,4,this.length),16777216*this[t]+(this[t+1]<<16|this[t+2]<<8|this[t+3])},u.prototype.readIntLE=function(t,r,e){t>>>=0,r>>>=0,e||m(t,r,this.length);for(var n=this[t],o=1,i=0;++i<r&&(o*=256);)n+=this[t+i]*o;return n>=(o*=128)&&(n-=Math.pow(2,8*r)),n},u.prototype.readIntBE=function(t,r,e){t>>>=0,r>>>=0,e||m(t,r,this.length);for(var n=r,o=1,i=this[t+--n];n>0&&(o*=256);)i+=this[t+--n]*o;return i>=(o*=128)&&(i-=Math.pow(2,8*r)),i},u.prototype.readInt8=function(t,r){return(t>>>=0,r||m(t,1,this.length),128&this[t])?-((255-this[t]+1)*1):this[t]},u.prototype.readInt16LE=function(t,r){t>>>=0,r||m(t,2,this.length);var e=this[t]|this[t+1]<<8;return 32768&e?4294901760|e:e},u.prototype.readInt16BE=function(t,r){t>>>=0,r||m(t,2,this.length);var e=this[t+1]|this[t]<<8;return 32768&e?4294901760|e:e},u.prototype.readInt32LE=function(t,r){return t>>>=0,r||m(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},u.prototype.readInt32BE=function(t,r){return t>>>=0,r||m(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},u.prototype.readFloatLE=function(t,r){return t>>>=0,r||m(t,4,this.length),o.read(this,t,!0,23,4)},u.prototype.readFloatBE=function(t,r){return t>>>=0,r||m(t,4,this.length),o.read(this,t,!1,23,4)},u.prototype.readDoubleLE=function(t,r){return t>>>=0,r||m(t,8,this.length),o.read(this,t,!0,52,8)},u.prototype.readDoubleBE=function(t,r){return t>>>=0,r||m(t,8,this.length),o.read(this,t,!1,52,8)},u.prototype.writeUintLE=u.prototype.writeUIntLE=function(t,r,e,n){if(t=+t,r>>>=0,e>>>=0,!n){var o=Math.pow(2,8*e)-1;E(this,t,r,e,o,0)}var i=1,f=0;for(this[r]=255&t;++f<e&&(i*=256);)this[r+f]=t/i&255;return r+e},u.prototype.writeUintBE=u.prototype.writeUIntBE=function(t,r,e,n){if(t=+t,r>>>=0,e>>>=0,!n){var o=Math.pow(2,8*e)-1;E(this,t,r,e,o,0)}var i=e-1,f=1;for(this[r+i]=255&t;--i>=0&&(f*=256);)this[r+i]=t/f&255;return r+e},u.prototype.writeUint8=u.prototype.writeUInt8=function(t,r,e){return t=+t,r>>>=0,e||E(this,t,r,1,255,0),this[r]=255&t,r+1},u.prototype.writeUint16LE=u.prototype.writeUInt16LE=function(t,r,e){return t=+t,r>>>=0,e||E(this,t,r,2,65535,0),this[r]=255&t,this[r+1]=t>>>8,r+2},u.prototype.writeUint16BE=u.prototype.writeUInt16BE=function(t,r,e){return t=+t,r>>>=0,e||E(this,t,r,2,65535,0),this[r]=t>>>8,this[r+1]=255&t,r+2},u.prototype.writeUint32LE=u.prototype.writeUInt32LE=function(t,r,e){return t=+t,r>>>=0,e||E(this,t,r,4,4294967295,0),this[r+3]=t>>>24,this[r+2]=t>>>16,this[r+1]=t>>>8,this[r]=255&t,r+4},u.prototype.writeUint32BE=u.prototype.writeUInt32BE=function(t,r,e){return t=+t,r>>>=0,e||E(this,t,r,4,4294967295,0),this[r]=t>>>24,this[r+1]=t>>>16,this[r+2]=t>>>8,this[r+3]=255&t,r+4},u.prototype.writeIntLE=function(t,r,e,n){if(t=+t,r>>>=0,!n){var o=Math.pow(2,8*e-1);E(this,t,r,e,o-1,-o)}var i=0,f=1,u=0;for(this[r]=255&t;++i<e&&(f*=256);)t<0&&0===u&&0!==this[r+i-1]&&(u=1),this[r+i]=(t/f>>0)-u&255;return r+e},u.prototype.writeIntBE=function(t,r,e,n){if(t=+t,r>>>=0,!n){var o=Math.pow(2,8*e-1);E(this,t,r,e,o-1,-o)}var i=e-1,f=1,u=0;for(this[r+i]=255&t;--i>=0&&(f*=256);)t<0&&0===u&&0!==this[r+i+1]&&(u=1),this[r+i]=(t/f>>0)-u&255;return r+e},u.prototype.writeInt8=function(t,r,e){return t=+t,r>>>=0,e||E(this,t,r,1,127,-128),t<0&&(t=255+t+1),this[r]=255&t,r+1},u.prototype.writeInt16LE=function(t,r,e){return t=+t,r>>>=0,e||E(this,t,r,2,32767,-32768),this[r]=255&t,this[r+1]=t>>>8,r+2},u.prototype.writeInt16BE=function(t,r,e){return t=+t,r>>>=0,e||E(this,t,r,2,32767,-32768),this[r]=t>>>8,this[r+1]=255&t,r+2},u.prototype.writeInt32LE=function(t,r,e){return t=+t,r>>>=0,e||E(this,t,r,4,2147483647,-2147483648),this[r]=255&t,this[r+1]=t>>>8,this[r+2]=t>>>16,this[r+3]=t>>>24,r+4},u.prototype.writeInt32BE=function(t,r,e){return t=+t,r>>>=0,e||E(this,t,r,4,2147483647,-2147483648),t<0&&(t=4294967295+t+1),this[r]=t>>>24,this[r+1]=t>>>16,this[r+2]=t>>>8,this[r+3]=255&t,r+4},u.prototype.writeFloatLE=function(t,r,e){return B(this,t,r,!0,e)},u.prototype.writeFloatBE=function(t,r,e){return B(this,t,r,!1,e)},u.prototype.writeDoubleLE=function(t,r,e){return U(this,t,r,!0,e)},u.prototype.writeDoubleBE=function(t,r,e){return U(this,t,r,!1,e)},u.prototype.copy=function(t,r,e,n){if(!u.isBuffer(t))throw TypeError("argument should be a Buffer");if(e||(e=0),n||0===n||(n=this.length),r>=t.length&&(r=t.length),r||(r=0),n>0&&n<e&&(n=e),n===e||0===t.length||0===this.length)return 0;if(r<0)throw RangeError("targetStart out of bounds");if(e<0||e>=this.length)throw RangeError("Index out of range");if(n<0)throw RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),t.length-r<n-e&&(n=t.length-r+e);var o=n-e;return this===t&&"function"==typeof Uint8Array.prototype.copyWithin?this.copyWithin(r,e,n):Uint8Array.prototype.set.call(t,this.subarray(e,n),r),o},u.prototype.fill=function(t,r,e,n){if("string"==typeof t){if("string"==typeof r?(n=r,r=0,e=this.length):"string"==typeof e&&(n=e,e=this.length),void 0!==n&&"string"!=typeof n)throw TypeError("encoding must be a string");if("string"==typeof n&&!u.isEncoding(n))throw TypeError("Unknown encoding: "+n);if(1===t.length){var o,i=t.charCodeAt(0);("utf8"===n&&i<128||"latin1"===n)&&(t=i)}}else"number"==typeof t?t&=255:"boolean"==typeof t&&(t=Number(t));if(r<0||this.length<r||this.length<e)throw RangeError("Out of range index");if(e<=r)return this;if(r>>>=0,e=void 0===e?this.length:e>>>0,t||(t=0),"number"==typeof t)for(o=r;o<e;++o)this[o]=t;else{var f=u.isBuffer(t)?t:u.from(t,n),s=f.length;if(0===s)throw TypeError('The value "'+t+'" is invalid for argument "value"');for(o=0;o<e-r;++o)this[o+r]=f[o%s]}return this};var L=/[^+/0-9A-Za-z-_]/g;function I(t,r){r=r||1/0;for(var e,n=t.length,o=null,i=[],f=0;f<n;++f){if((e=t.charCodeAt(f))>55295&&e<57344){if(!o){if(e>56319||f+1===n){(r-=3)>-1&&i.push(239,191,189);continue}o=e;continue}if(e<56320){(r-=3)>-1&&i.push(239,191,189),o=e;continue}e=(o-55296<<10|e-56320)+65536}else o&&(r-=3)>-1&&i.push(239,191,189);if(o=null,e<128){if((r-=1)<0)break;i.push(e)}else if(e<2048){if((r-=2)<0)break;i.push(e>>6|192,63&e|128)}else if(e<65536){if((r-=3)<0)break;i.push(e>>12|224,e>>6&63|128,63&e|128)}else if(e<1114112){if((r-=4)<0)break;i.push(e>>18|240,e>>12&63|128,e>>6&63|128,63&e|128)}else throw Error("Invalid code point")}return i}function T(t){return n.toByteArray(function(t){if((t=(t=t.split("=")[0]).trim().replace(L,"")).length<2)return"";for(;t.length%4!=0;)t+="=";return t}(t))}function O(t,r,e,n){for(var o=0;o<n&&!(o+e>=r.length)&&!(o>=t.length);++o)r[o+e]=t[o];return o}function C(t,r){return t instanceof r||null!=t&&null!=t.constructor&&null!=t.constructor.name&&t.constructor.name===r.name}var R=function(){for(var t="0123456789abcdef",r=Array(256),e=0;e<16;++e)for(var n=16*e,o=0;o<16;++o)r[n+o]=t[e]+t[o];return r}()},6868:function(t,r){/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> */r.read=function(t,r,e,n,o){var i,f,u=8*o-n-1,s=(1<<u)-1,h=s>>1,a=-7,p=e?o-1:0,c=e?-1:1,l=t[r+p];for(p+=c,i=l&(1<<-a)-1,l>>=-a,a+=u;a>0;i=256*i+t[r+p],p+=c,a-=8);for(f=i&(1<<-a)-1,i>>=-a,a+=n;a>0;f=256*f+t[r+p],p+=c,a-=8);if(0===i)i=1-h;else{if(i===s)return f?NaN:1/0*(l?-1:1);f+=Math.pow(2,n),i-=h}return(l?-1:1)*f*Math.pow(2,i-n)},r.write=function(t,r,e,n,o,i){var f,u,s,h=8*i-o-1,a=(1<<h)-1,p=a>>1,c=23===o?5960464477539062e-23:0,l=n?0:i-1,y=n?1:-1,g=r<0||0===r&&1/r<0?1:0;for(isNaN(r=Math.abs(r))||r===1/0?(u=isNaN(r)?1:0,f=a):(f=Math.floor(Math.log(r)/Math.LN2),r*(s=Math.pow(2,-f))<1&&(f--,s*=2),f+p>=1?r+=c/s:r+=c*Math.pow(2,1-p),r*s>=2&&(f++,s/=2),f+p>=a?(u=0,f=a):f+p>=1?(u=(r*s-1)*Math.pow(2,o),f+=p):(u=r*Math.pow(2,p-1)*Math.pow(2,o),f=0));o>=8;t[e+l]=255&u,l+=y,u/=256,o-=8);for(f=f<<o|u,h+=o;h>0;t[e+l]=255&f,l+=y,f/=256,h-=8);t[e+l-y]|=128*g}},7431:function(t,r,e){"use strict";function n(t,r,e){return r in t?Object.defineProperty(t,r,{value:e,enumerable:!0,configurable:!0,writable:!0}):t[r]=e,t}e.d(r,{_:function(){return n}})}}]);
|
_next/static/chunks/724.451ccadd4705cccd.js
DELETED
@@ -1 +0,0 @@
|
|
1 |
-
!function(){var t,e,n,i,o,r,s,u,a={7585:function(){},1678:function(){},1988:function(){},5949:function(){},7558:function(){},6862:function(){},6027:function(){},3684:function(t,e,n){"use strict";var i=n(7215);function o(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}i.OBj.allowLocalModels=!1;class r{static async getInstance(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;return null===this.instance&&(this.instance=(0,i.EUT)(this.task,this.model,{quantized:this.quantized,progress_callback:t,revision:this.model.includes("/whisper-medium")?"no_attentions":"main"})),this.instance}constructor(t,e,n){this.tokenizer=t,this.model=e,this.quantized=n}}o(r,"task",null),o(r,"model",null),o(r,"quantized",null),o(r,"instance",null),self.addEventListener("message",async t=>{let e=t.data,n=await u(e.audio,e.model,e.multilingual,e.quantized,e.subtask,e.language);null!==n&&self.postMessage({status:"complete",task:"automatic-speech-recognition",data:n})});class s extends r{}o(s,"task","automatic-speech-recognition"),o(s,"model",null),o(s,"quantized",null);let u=async(t,e,n,i,o,r)=>{let u=e.startsWith("distil-whisper/")||e.startsWith("huuquyet"),a=e;u||n||(a+=".en"),(s.model!==a||s.quantized!==i)&&(s.model=a,s.quantized=i,null!==s.instance&&((await s.getInstance()).dispose(),s.instance=null));let c=await s.getInstance(t=>{self.postMessage(t)}),l=c.processor.feature_extractor.config.chunk_length/c.model.config.max_source_positions,f=[{tokens:[],finalised:!1}];return await c(t,{top_k:0,do_sample:!1,chunk_length_s:u?20:30,stride_length_s:u?3:5,language:r,task:o,return_timestamps:!0,force_full_sequences:!1,callback_function:function(t){f[f.length-1].tokens=[...t[0].output_token_ids];let e=c.tokenizer._decode_asr(f,{time_precision:l,return_timestamps:!0,force_full_sequences:!1});self.postMessage({status:"update",task:"automatic-speech-recognition",data:e})},chunk_callback:function(t){let e=f[f.length-1];Object.assign(e,t),e.finalised=!0,t.is_last||f.push({tokens:[],finalised:!1})}}).catch(t=>(self.postMessage({status:"error",task:"automatic-speech-recognition",data:t}),null))}}},c={};function l(t){var e=c[t];if(void 0!==e)return e.exports;var n=c[t]={exports:{}},i=!0;try{a[t](n,n.exports,l),i=!1}finally{i&&delete c[t]}return n.exports}l.m=a,l.x=function(){var t=l.O(void 0,[789,897,953,332,341],function(){return l(3684)});return l.O(t)},t=[],l.O=function(e,n,i,o){if(n){o=o||0;for(var r=t.length;r>0&&t[r-1][2]>o;r--)t[r]=t[r-1];t[r]=[n,i,o];return}for(var s=1/0,r=0;r<t.length;r++){for(var n=t[r][0],i=t[r][1],o=t[r][2],u=!0,a=0;a<n.length;a++)s>=o&&Object.keys(l.O).every(function(t){return l.O[t](n[a])})?n.splice(a--,1):(u=!1,o<s&&(s=o));if(u){t.splice(r--,1);var c=i();void 0!==c&&(e=c)}}return e},n=Object.getPrototypeOf?function(t){return Object.getPrototypeOf(t)}:function(t){return t.__proto__},l.t=function(t,i){if(1&i&&(t=this(t)),8&i||"object"==typeof t&&t&&(4&i&&t.__esModule||16&i&&"function"==typeof t.then))return t;var o=Object.create(null);l.r(o);var r={};e=e||[null,n({}),n([]),n(n)];for(var s=2&i&&t;"object"==typeof s&&!~e.indexOf(s);s=n(s))Object.getOwnPropertyNames(s).forEach(function(e){r[e]=function(){return t[e]}});return r.default=function(){return t},l.d(o,r),o},l.d=function(t,e){for(var n in e)l.o(e,n)&&!l.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},l.f={},l.e=function(t){return Promise.all(Object.keys(l.f).reduce(function(e,n){return l.f[n](t,e),e},[]))},l.u=function(t){return 332===t?"static/chunks/332-dcb3f9d33411b2c1.js":"static/chunks/"+(({789:"28fd365c",897:"266d6a74",953:"49ada614"})[t]||t)+"."+({341:"aebfdbdeb384a503",789:"0d75ba7c838a0b07",897:"21fca583acb189b2",953:"cc7dff79d7281ee6"})[t]+".js"},l.miniCssF=function(t){},l.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||Function("return this")()}catch(t){if("object"==typeof window)return window}}(),l.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},l.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},l.tt=function(){return void 0===i&&(i={createScriptURL:function(t){return t}},"undefined"!=typeof trustedTypes&&trustedTypes.createPolicy&&(i=trustedTypes.createPolicy("nextjs#bundler",i))),i},l.tu=function(t){return l.tt().createScriptURL(t)},l.p="/_next/",o={724:1},l.f.i=function(t,e){o[t]||importScripts(l.tu(l.p+l.u(t)))},s=(r=self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push.bind(r),r.push=function(t){var e=t[0],n=t[1],i=t[2];for(var r in n)l.o(n,r)&&(l.m[r]=n[r]);for(i&&i(l);e.length;)o[e.pop()]=1;s(t)},u=l.x,l.x=function(){return Promise.all([789,897,953,332,341].map(l.e,l)).then(u)},_N_E=l.x()}();
|
|
|
|
_next/static/chunks/849-68d1881ffb6c5768.js
DELETED
@@ -1 +0,0 @@
|
|
1 |
-
"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[849],{7559:function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"BailoutToCSR",{enumerable:!0,get:function(){return o}});let r=n(5086);function o(e){let{reason:t,children:n}=e;if("undefined"==typeof window)throw new r.BailoutToCSRError(t);return n}},1686:function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"PreloadCss",{enumerable:!0,get:function(){return i}});let r=n(1167),o=n(5172);function i(e){let{moduleIds:t}=e;if("undefined"!=typeof window)return null;let n=(0,o.getExpectedRequestStore)("next/dynamic css"),i=[];if(n.reactLoadableManifest&&t){let e=n.reactLoadableManifest;for(let n of t){if(!e[n])continue;let t=e[n].files.filter(e=>e.endsWith(".css"));i.push(...t)}}return 0===i.length?null:(0,r.jsx)(r.Fragment,{children:i.map(e=>(0,r.jsx)("link",{precedence:"dynamic",rel:"stylesheet",href:n.assetPrefix+"/_next/"+encodeURI(e),as:"style"},e))})}},5014:function(e,t,n){let r,o,i;n.d(t,{Z:function(){return eV}});var a={};function l(e,t){return function(){return e.apply(t,arguments)}}n.r(a),n.d(a,{hasBrowserEnv:function(){return ei},hasStandardBrowserEnv:function(){return ea},hasStandardBrowserWebWorkerEnv:function(){return el}});let{toString:s}=Object.prototype,{getPrototypeOf:u}=Object,c=(r=Object.create(null),e=>{let t=s.call(e);return r[t]||(r[t]=t.slice(8,-1).toLowerCase())}),d=e=>(e=e.toLowerCase(),t=>c(t)===e),f=e=>t=>typeof t===e,{isArray:p}=Array,h=f("undefined"),m=d("ArrayBuffer"),g=f("string"),v=f("function"),E=f("number"),y=e=>null!==e&&"object"==typeof e,b=e=>{if("object"!==c(e))return!1;let t=u(e);return(null===t||t===Object.prototype||null===Object.getPrototypeOf(t))&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)},w=d("Date"),S=d("File"),O=d("Blob"),T=d("FileList"),R=d("URLSearchParams");function A(e,t,{allOwnKeys:n=!1}={}){let r,o;if(null!=e){if("object"!=typeof e&&(e=[e]),p(e))for(r=0,o=e.length;r<o;r++)t.call(null,e[r],r,e);else{let o;let i=n?Object.getOwnPropertyNames(e):Object.keys(e),a=i.length;for(r=0;r<a;r++)o=i[r],t.call(null,e[o],o,e)}}}function C(e,t){let n;t=t.toLowerCase();let r=Object.keys(e),o=r.length;for(;o-- >0;)if(t===(n=r[o]).toLowerCase())return n;return null}let P="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:global,N=e=>!h(e)&&e!==P,L=(o="undefined"!=typeof Uint8Array&&u(Uint8Array),e=>o&&e instanceof o),F=d("HTMLFormElement"),x=(({hasOwnProperty:e})=>(t,n)=>e.call(t,n))(Object.prototype),k=d("RegExp"),j=(e,t)=>{let n=Object.getOwnPropertyDescriptors(e),r={};A(n,(n,o)=>{let i;!1!==(i=t(n,o,e))&&(r[o]=i||n)}),Object.defineProperties(e,r)},D="abcdefghijklmnopqrstuvwxyz",M="0123456789",_={DIGIT:M,ALPHA:D,ALPHA_DIGIT:D+D.toUpperCase()+M},U=d("AsyncFunction");var B={isArray:p,isArrayBuffer:m,isBuffer:function(e){return null!==e&&!h(e)&&null!==e.constructor&&!h(e.constructor)&&v(e.constructor.isBuffer)&&e.constructor.isBuffer(e)},isFormData:e=>{let t;return e&&("function"==typeof FormData&&e instanceof FormData||v(e.append)&&("formdata"===(t=c(e))||"object"===t&&v(e.toString)&&"[object FormData]"===e.toString()))},isArrayBufferView:function(e){return"undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(e):e&&e.buffer&&m(e.buffer)},isString:g,isNumber:E,isBoolean:e=>!0===e||!1===e,isObject:y,isPlainObject:b,isUndefined:h,isDate:w,isFile:S,isBlob:O,isRegExp:k,isFunction:v,isStream:e=>y(e)&&v(e.pipe),isURLSearchParams:R,isTypedArray:L,isFileList:T,forEach:A,merge:function e(){let{caseless:t}=N(this)&&this||{},n={},r=(r,o)=>{let i=t&&C(n,o)||o;b(n[i])&&b(r)?n[i]=e(n[i],r):b(r)?n[i]=e({},r):p(r)?n[i]=r.slice():n[i]=r};for(let e=0,t=arguments.length;e<t;e++)arguments[e]&&A(arguments[e],r);return n},extend:(e,t,n,{allOwnKeys:r}={})=>(A(t,(t,r)=>{n&&v(t)?e[r]=l(t,n):e[r]=t},{allOwnKeys:r}),e),trim:e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,""),stripBOM:e=>(65279===e.charCodeAt(0)&&(e=e.slice(1)),e),inherits:(e,t,n,r)=>{e.prototype=Object.create(t.prototype,r),e.prototype.constructor=e,Object.defineProperty(e,"super",{value:t.prototype}),n&&Object.assign(e.prototype,n)},toFlatObject:(e,t,n,r)=>{let o,i,a;let l={};if(t=t||{},null==e)return t;do{for(i=(o=Object.getOwnPropertyNames(e)).length;i-- >0;)a=o[i],(!r||r(a,e,t))&&!l[a]&&(t[a]=e[a],l[a]=!0);e=!1!==n&&u(e)}while(e&&(!n||n(e,t))&&e!==Object.prototype);return t},kindOf:c,kindOfTest:d,endsWith:(e,t,n)=>{e=String(e),(void 0===n||n>e.length)&&(n=e.length),n-=t.length;let r=e.indexOf(t,n);return -1!==r&&r===n},toArray:e=>{if(!e)return null;if(p(e))return e;let t=e.length;if(!E(t))return null;let n=Array(t);for(;t-- >0;)n[t]=e[t];return n},forEachEntry:(e,t)=>{let n;let r=(e&&e[Symbol.iterator]).call(e);for(;(n=r.next())&&!n.done;){let r=n.value;t.call(e,r[0],r[1])}},matchAll:(e,t)=>{let n;let r=[];for(;null!==(n=e.exec(t));)r.push(n);return r},isHTMLForm:F,hasOwnProperty:x,hasOwnProp:x,reduceDescriptors:j,freezeMethods:e=>{j(e,(t,n)=>{if(v(e)&&-1!==["arguments","caller","callee"].indexOf(n))return!1;if(v(e[n])){if(t.enumerable=!1,"writable"in t){t.writable=!1;return}t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+n+"'")})}})},toObjectSet:(e,t)=>{let n={};return(e=>{e.forEach(e=>{n[e]=!0})})(p(e)?e:String(e).split(t)),n},toCamelCase:e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(e,t,n){return t.toUpperCase()+n}),noop:()=>{},toFiniteNumber:(e,t)=>Number.isFinite(e=+e)?e:t,findKey:C,global:P,isContextDefined:N,ALPHABET:_,generateString:(e=16,t=_.ALPHA_DIGIT)=>{let n="",{length:r}=t;for(;e--;)n+=t[Math.random()*r|0];return n},isSpecCompliantForm:function(e){return!!(e&&v(e.append)&&"FormData"===e[Symbol.toStringTag]&&e[Symbol.iterator])},toJSONObject:e=>{let t=Array(10),n=(e,r)=>{if(y(e)){if(t.indexOf(e)>=0)return;if(!("toJSON"in e)){t[r]=e;let o=p(e)?[]:{};return A(e,(e,t)=>{let i=n(e,r+1);h(i)||(o[t]=i)}),t[r]=void 0,o}}return e};return n(e,0)},isAsyncFn:U,isThenable:e=>e&&(y(e)||v(e))&&v(e.then)&&v(e.catch)};function H(e,t,n,r,o){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=Error().stack,this.message=e,this.name="AxiosError",t&&(this.code=t),n&&(this.config=n),r&&(this.request=r),o&&(this.response=o)}B.inherits(H,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:B.toJSONObject(this.config),code:this.code,status:this.response&&this.response.status?this.response.status:null}}});let I=H.prototype,z={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach(e=>{z[e]={value:e}}),Object.defineProperties(H,z),Object.defineProperty(I,"isAxiosError",{value:!0}),H.from=(e,t,n,r,o,i)=>{let a=Object.create(I);return B.toFlatObject(e,a,function(e){return e!==Error.prototype},e=>"isAxiosError"!==e),H.call(a,e.message,t,n,r,o),a.cause=e,a.name=e.name,i&&Object.assign(a,i),a};var q=n(9332).Buffer;function V(e){return B.isPlainObject(e)||B.isArray(e)}function W(e){return B.endsWith(e,"[]")?e.slice(0,-2):e}function Y(e,t,n){return e?e.concat(t).map(function(e,t){return e=W(e),!n&&t?"["+e+"]":e}).join(n?".":""):t}let J=B.toFlatObject(B,{},null,function(e){return/^is[A-Z]/.test(e)});var G=function(e,t,n){if(!B.isObject(e))throw TypeError("target must be an object");t=t||new FormData;let r=(n=B.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,function(e,t){return!B.isUndefined(t[e])})).metaTokens,o=n.visitor||u,i=n.dots,a=n.indexes,l=(n.Blob||"undefined"!=typeof Blob&&Blob)&&B.isSpecCompliantForm(t);if(!B.isFunction(o))throw TypeError("visitor must be a function");function s(e){if(null===e)return"";if(B.isDate(e))return e.toISOString();if(!l&&B.isBlob(e))throw new H("Blob is not supported. Use a Buffer instead.");return B.isArrayBuffer(e)||B.isTypedArray(e)?l&&"function"==typeof Blob?new Blob([e]):q.from(e):e}function u(e,n,o){let l=e;if(e&&!o&&"object"==typeof e){if(B.endsWith(n,"{}"))n=r?n:n.slice(0,-2),e=JSON.stringify(e);else{var u;if(B.isArray(e)&&(u=e,B.isArray(u)&&!u.some(V))||(B.isFileList(e)||B.endsWith(n,"[]"))&&(l=B.toArray(e)))return n=W(n),l.forEach(function(e,r){B.isUndefined(e)||null===e||t.append(!0===a?Y([n],r,i):null===a?n:n+"[]",s(e))}),!1}}return!!V(e)||(t.append(Y(o,n,i),s(e)),!1)}let c=[],d=Object.assign(J,{defaultVisitor:u,convertValue:s,isVisitable:V});if(!B.isObject(e))throw TypeError("data must be an object");return!function e(n,r){if(!B.isUndefined(n)){if(-1!==c.indexOf(n))throw Error("Circular reference detected in "+r.join("."));c.push(n),B.forEach(n,function(n,i){!0===(!(B.isUndefined(n)||null===n)&&o.call(t,n,B.isString(i)?i.trim():i,r,d))&&e(n,r?r.concat(i):[i])}),c.pop()}}(e),t};function K(e){let t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,function(e){return t[e]})}function Z(e,t){this._pairs=[],e&&G(e,this,t)}let $=Z.prototype;function X(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function Q(e,t,n){let r;if(!t)return e;let o=n&&n.encode||X,i=n&&n.serialize;if(r=i?i(t,n):B.isURLSearchParams(t)?t.toString():new Z(t,n).toString(o)){let t=e.indexOf("#");-1!==t&&(e=e.slice(0,t)),e+=(-1===e.indexOf("?")?"?":"&")+r}return e}$.append=function(e,t){this._pairs.push([e,t])},$.toString=function(e){let t=e?function(t){return e.call(this,t,K)}:K;return this._pairs.map(function(e){return t(e[0])+"="+t(e[1])},"").join("&")};class ee{constructor(){this.handlers=[]}use(e,t,n){return this.handlers.push({fulfilled:e,rejected:t,synchronous:!!n&&n.synchronous,runWhen:n?n.runWhen:null}),this.handlers.length-1}eject(e){this.handlers[e]&&(this.handlers[e]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(e){B.forEach(this.handlers,function(t){null!==t&&e(t)})}}var et={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},en="undefined"!=typeof URLSearchParams?URLSearchParams:Z,er="undefined"!=typeof FormData?FormData:null,eo="undefined"!=typeof Blob?Blob:null;let ei="undefined"!=typeof window&&"undefined"!=typeof document,ea=(i="undefined"!=typeof navigator&&navigator.product,ei&&0>["ReactNative","NativeScript","NS"].indexOf(i)),el="undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope&&"function"==typeof self.importScripts;var es={...a,isBrowser:!0,classes:{URLSearchParams:en,FormData:er,Blob:eo},protocols:["http","https","file","blob","url","data"]},eu=function(e){if(B.isFormData(e)&&B.isFunction(e.entries)){let t={};return B.forEachEntry(e,(e,n)=>{!function e(t,n,r,o){let i=t[o++];if("__proto__"===i)return!0;let a=Number.isFinite(+i),l=o>=t.length;return(i=!i&&B.isArray(r)?r.length:i,l)?B.hasOwnProp(r,i)?r[i]=[r[i],n]:r[i]=n:(r[i]&&B.isObject(r[i])||(r[i]=[]),e(t,n,r[i],o)&&B.isArray(r[i])&&(r[i]=function(e){let t,n;let r={},o=Object.keys(e),i=o.length;for(t=0;t<i;t++)r[n=o[t]]=e[n];return r}(r[i]))),!a}(B.matchAll(/\w+|\[(\w*)]/g,e).map(e=>"[]"===e[0]?"":e[1]||e[0]),n,t,0)}),t}return null};let ec={transitional:et,adapter:["xhr","http"],transformRequest:[function(e,t){let n;let r=t.getContentType()||"",o=r.indexOf("application/json")>-1,i=B.isObject(e);if(i&&B.isHTMLForm(e)&&(e=new FormData(e)),B.isFormData(e))return o?JSON.stringify(eu(e)):e;if(B.isArrayBuffer(e)||B.isBuffer(e)||B.isStream(e)||B.isFile(e)||B.isBlob(e))return e;if(B.isArrayBufferView(e))return e.buffer;if(B.isURLSearchParams(e))return t.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),e.toString();if(i){if(r.indexOf("application/x-www-form-urlencoded")>-1){var a,l;return(a=e,l=this.formSerializer,G(a,new es.classes.URLSearchParams,Object.assign({visitor:function(e,t,n,r){return es.isNode&&B.isBuffer(e)?(this.append(t,e.toString("base64")),!1):r.defaultVisitor.apply(this,arguments)}},l))).toString()}if((n=B.isFileList(e))||r.indexOf("multipart/form-data")>-1){let t=this.env&&this.env.FormData;return G(n?{"files[]":e}:e,t&&new t,this.formSerializer)}}return i||o?(t.setContentType("application/json",!1),function(e,t,n){if(B.isString(e))try{return(0,JSON.parse)(e),B.trim(e)}catch(e){if("SyntaxError"!==e.name)throw e}return(0,JSON.stringify)(e)}(e)):e}],transformResponse:[function(e){let t=this.transitional||ec.transitional,n=t&&t.forcedJSONParsing,r="json"===this.responseType;if(e&&B.isString(e)&&(n&&!this.responseType||r)){let n=t&&t.silentJSONParsing;try{return JSON.parse(e)}catch(e){if(!n&&r){if("SyntaxError"===e.name)throw H.from(e,H.ERR_BAD_RESPONSE,this,null,this.response);throw e}}}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:es.classes.FormData,Blob:es.classes.Blob},validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};B.forEach(["delete","get","head","post","put","patch"],e=>{ec.headers[e]={}});let ed=B.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]);var ef=e=>{let t,n,r;let o={};return e&&e.split("\n").forEach(function(e){r=e.indexOf(":"),t=e.substring(0,r).trim().toLowerCase(),n=e.substring(r+1).trim(),!t||o[t]&&ed[t]||("set-cookie"===t?o[t]?o[t].push(n):o[t]=[n]:o[t]=o[t]?o[t]+", "+n:n)}),o};let ep=Symbol("internals");function eh(e){return e&&String(e).trim().toLowerCase()}function em(e){return!1===e||null==e?e:B.isArray(e)?e.map(em):String(e)}let eg=e=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim());function ev(e,t,n,r,o){if(B.isFunction(r))return r.call(this,t,n);if(o&&(t=n),B.isString(t)){if(B.isString(r))return -1!==t.indexOf(r);if(B.isRegExp(r))return r.test(t)}}class eE{constructor(e){e&&this.set(e)}set(e,t,n){let r=this;function o(e,t,n){let o=eh(t);if(!o)throw Error("header name must be a non-empty string");let i=B.findKey(r,o);i&&void 0!==r[i]&&!0!==n&&(void 0!==n||!1===r[i])||(r[i||t]=em(e))}let i=(e,t)=>B.forEach(e,(e,n)=>o(e,n,t));return B.isPlainObject(e)||e instanceof this.constructor?i(e,t):B.isString(e)&&(e=e.trim())&&!eg(e)?i(ef(e),t):null!=e&&o(t,e,n),this}get(e,t){if(e=eh(e)){let n=B.findKey(this,e);if(n){let e=this[n];if(!t)return e;if(!0===t)return function(e){let t;let n=Object.create(null),r=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;for(;t=r.exec(e);)n[t[1]]=t[2];return n}(e);if(B.isFunction(t))return t.call(this,e,n);if(B.isRegExp(t))return t.exec(e);throw TypeError("parser must be boolean|regexp|function")}}}has(e,t){if(e=eh(e)){let n=B.findKey(this,e);return!!(n&&void 0!==this[n]&&(!t||ev(this,this[n],n,t)))}return!1}delete(e,t){let n=this,r=!1;function o(e){if(e=eh(e)){let o=B.findKey(n,e);o&&(!t||ev(n,n[o],o,t))&&(delete n[o],r=!0)}}return B.isArray(e)?e.forEach(o):o(e),r}clear(e){let t=Object.keys(this),n=t.length,r=!1;for(;n--;){let o=t[n];(!e||ev(this,this[o],o,e,!0))&&(delete this[o],r=!0)}return r}normalize(e){let t=this,n={};return B.forEach(this,(r,o)=>{let i=B.findKey(n,o);if(i){t[i]=em(r),delete t[o];return}let a=e?o.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(e,t,n)=>t.toUpperCase()+n):String(o).trim();a!==o&&delete t[o],t[a]=em(r),n[a]=!0}),this}concat(...e){return this.constructor.concat(this,...e)}toJSON(e){let t=Object.create(null);return B.forEach(this,(n,r)=>{null!=n&&!1!==n&&(t[r]=e&&B.isArray(n)?n.join(", "):n)}),t}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([e,t])=>e+": "+t).join("\n")}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(e){return e instanceof this?e:new this(e)}static concat(e,...t){let n=new this(e);return t.forEach(e=>n.set(e)),n}static accessor(e){let t=(this[ep]=this[ep]={accessors:{}}).accessors,n=this.prototype;function r(e){let r=eh(e);t[r]||(!function(e,t){let n=B.toCamelCase(" "+t);["get","set","has"].forEach(r=>{Object.defineProperty(e,r+n,{value:function(e,n,o){return this[r].call(this,t,e,n,o)},configurable:!0})})}(n,e),t[r]=!0)}return B.isArray(e)?e.forEach(r):r(e),this}}function ey(e,t){let n=this||ec,r=t||n,o=eE.from(r.headers),i=r.data;return B.forEach(e,function(e){i=e.call(n,i,o.normalize(),t?t.status:void 0)}),o.normalize(),i}function eb(e){return!!(e&&e.__CANCEL__)}function ew(e,t,n){H.call(this,null==e?"canceled":e,H.ERR_CANCELED,t,n),this.name="CanceledError"}eE.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),B.reduceDescriptors(eE.prototype,({value:e},t)=>{let n=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(e){this[n]=e}}}),B.freezeMethods(eE),B.inherits(ew,H,{__CANCEL__:!0});var eS=es.hasStandardBrowserEnv?{write(e,t,n,r,o,i){let a=[e+"="+encodeURIComponent(t)];B.isNumber(n)&&a.push("expires="+new Date(n).toGMTString()),B.isString(r)&&a.push("path="+r),B.isString(o)&&a.push("domain="+o),!0===i&&a.push("secure"),document.cookie=a.join("; ")},read(e){let t=document.cookie.match(RegExp("(^|;\\s*)("+e+")=([^;]*)"));return t?decodeURIComponent(t[3]):null},remove(e){this.write(e,"",Date.now()-864e5)}}:{write(){},read:()=>null,remove(){}};function eO(e,t){return e&&!/^([a-z][a-z\d+\-.]*:)?\/\//i.test(t)?t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e:t}var eT=es.hasStandardBrowserEnv?function(){let e;let t=/(msie|trident)/i.test(navigator.userAgent),n=document.createElement("a");function r(e){let r=e;return t&&(n.setAttribute("href",r),r=n.href),n.setAttribute("href",r),{href:n.href,protocol:n.protocol?n.protocol.replace(/:$/,""):"",host:n.host,search:n.search?n.search.replace(/^\?/,""):"",hash:n.hash?n.hash.replace(/^#/,""):"",hostname:n.hostname,port:n.port,pathname:"/"===n.pathname.charAt(0)?n.pathname:"/"+n.pathname}}return e=r(window.location.href),function(t){let n=B.isString(t)?r(t):t;return n.protocol===e.protocol&&n.host===e.host}}():function(){return!0},eR=function(e,t){let n;let r=Array(e=e||10),o=Array(e),i=0,a=0;return t=void 0!==t?t:1e3,function(l){let s=Date.now(),u=o[a];n||(n=s),r[i]=l,o[i]=s;let c=a,d=0;for(;c!==i;)d+=r[c++],c%=e;if((i=(i+1)%e)===a&&(a=(a+1)%e),s-n<t)return;let f=u&&s-u;return f?Math.round(1e3*d/f):void 0}};function eA(e,t){let n=0,r=eR(50,250);return o=>{let i=o.loaded,a=o.lengthComputable?o.total:void 0,l=i-n,s=r(l);n=i;let u={loaded:i,total:a,progress:a?i/a:void 0,bytes:l,rate:s||void 0,estimated:s&&a&&i<=a?(a-i)/s:void 0,event:o};u[t?"download":"upload"]=!0,e(u)}}let eC={http:null,xhr:"undefined"!=typeof XMLHttpRequest&&function(e){return new Promise(function(t,n){let r,o,i=e.data,a=eE.from(e.headers).normalize(),{responseType:l,withXSRFToken:s}=e;function u(){e.cancelToken&&e.cancelToken.unsubscribe(r),e.signal&&e.signal.removeEventListener("abort",r)}if(B.isFormData(i)){if(es.hasStandardBrowserEnv||es.hasStandardBrowserWebWorkerEnv)a.setContentType(!1);else if(!1!==(o=a.getContentType())){let[e,...t]=o?o.split(";").map(e=>e.trim()).filter(Boolean):[];a.setContentType([e||"multipart/form-data",...t].join("; "))}}let c=new XMLHttpRequest;if(e.auth){let t=e.auth.username||"",n=e.auth.password?unescape(encodeURIComponent(e.auth.password)):"";a.set("Authorization","Basic "+btoa(t+":"+n))}let d=eO(e.baseURL,e.url);function f(){if(!c)return;let r=eE.from("getAllResponseHeaders"in c&&c.getAllResponseHeaders());!function(e,t,n){let r=n.config.validateStatus;!n.status||!r||r(n.status)?e(n):t(new H("Request failed with status code "+n.status,[H.ERR_BAD_REQUEST,H.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n))}(function(e){t(e),u()},function(e){n(e),u()},{data:l&&"text"!==l&&"json"!==l?c.response:c.responseText,status:c.status,statusText:c.statusText,headers:r,config:e,request:c}),c=null}if(c.open(e.method.toUpperCase(),Q(d,e.params,e.paramsSerializer),!0),c.timeout=e.timeout,"onloadend"in c?c.onloadend=f:c.onreadystatechange=function(){c&&4===c.readyState&&(0!==c.status||c.responseURL&&0===c.responseURL.indexOf("file:"))&&setTimeout(f)},c.onabort=function(){c&&(n(new H("Request aborted",H.ECONNABORTED,e,c)),c=null)},c.onerror=function(){n(new H("Network Error",H.ERR_NETWORK,e,c)),c=null},c.ontimeout=function(){let t=e.timeout?"timeout of "+e.timeout+"ms exceeded":"timeout exceeded",r=e.transitional||et;e.timeoutErrorMessage&&(t=e.timeoutErrorMessage),n(new H(t,r.clarifyTimeoutError?H.ETIMEDOUT:H.ECONNABORTED,e,c)),c=null},es.hasStandardBrowserEnv&&(s&&B.isFunction(s)&&(s=s(e)),s||!1!==s&&eT(d))){let t=e.xsrfHeaderName&&e.xsrfCookieName&&eS.read(e.xsrfCookieName);t&&a.set(e.xsrfHeaderName,t)}void 0===i&&a.setContentType(null),"setRequestHeader"in c&&B.forEach(a.toJSON(),function(e,t){c.setRequestHeader(t,e)}),B.isUndefined(e.withCredentials)||(c.withCredentials=!!e.withCredentials),l&&"json"!==l&&(c.responseType=e.responseType),"function"==typeof e.onDownloadProgress&&c.addEventListener("progress",eA(e.onDownloadProgress,!0)),"function"==typeof e.onUploadProgress&&c.upload&&c.upload.addEventListener("progress",eA(e.onUploadProgress)),(e.cancelToken||e.signal)&&(r=t=>{c&&(n(!t||t.type?new ew(null,e,c):t),c.abort(),c=null)},e.cancelToken&&e.cancelToken.subscribe(r),e.signal&&(e.signal.aborted?r():e.signal.addEventListener("abort",r)));let p=function(e){let t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}(d);if(p&&-1===es.protocols.indexOf(p)){n(new H("Unsupported protocol "+p+":",H.ERR_BAD_REQUEST,e));return}c.send(i||null)})}};B.forEach(eC,(e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch(e){}Object.defineProperty(e,"adapterName",{value:t})}});let eP=e=>`- ${e}`,eN=e=>B.isFunction(e)||null===e||!1===e;var eL=e=>{let t,n;let{length:r}=e=B.isArray(e)?e:[e],o={};for(let i=0;i<r;i++){let r;if(n=t=e[i],!eN(t)&&void 0===(n=eC[(r=String(t)).toLowerCase()]))throw new H(`Unknown adapter '${r}'`);if(n)break;o[r||"#"+i]=n}if(!n){let e=Object.entries(o).map(([e,t])=>`adapter ${e} `+(!1===t?"is not supported by the environment":"is not available in the build"));throw new H("There is no suitable adapter to dispatch the request "+(r?e.length>1?"since :\n"+e.map(eP).join("\n"):" "+eP(e[0]):"as no adapter specified"),"ERR_NOT_SUPPORT")}return n};function eF(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new ew(null,e)}function ex(e){return eF(e),e.headers=eE.from(e.headers),e.data=ey.call(e,e.transformRequest),-1!==["post","put","patch"].indexOf(e.method)&&e.headers.setContentType("application/x-www-form-urlencoded",!1),eL(e.adapter||ec.adapter)(e).then(function(t){return eF(e),t.data=ey.call(e,e.transformResponse,t),t.headers=eE.from(t.headers),t},function(t){return!eb(t)&&(eF(e),t&&t.response&&(t.response.data=ey.call(e,e.transformResponse,t.response),t.response.headers=eE.from(t.response.headers))),Promise.reject(t)})}let ek=e=>e instanceof eE?{...e}:e;function ej(e,t){t=t||{};let n={};function r(e,t,n){return B.isPlainObject(e)&&B.isPlainObject(t)?B.merge.call({caseless:n},e,t):B.isPlainObject(t)?B.merge({},t):B.isArray(t)?t.slice():t}function o(e,t,n){return B.isUndefined(t)?B.isUndefined(e)?void 0:r(void 0,e,n):r(e,t,n)}function i(e,t){if(!B.isUndefined(t))return r(void 0,t)}function a(e,t){return B.isUndefined(t)?B.isUndefined(e)?void 0:r(void 0,e):r(void 0,t)}function l(n,o,i){return i in t?r(n,o):i in e?r(void 0,n):void 0}let s={url:i,method:i,data:i,baseURL:a,transformRequest:a,transformResponse:a,paramsSerializer:a,timeout:a,timeoutMessage:a,withCredentials:a,withXSRFToken:a,adapter:a,responseType:a,xsrfCookieName:a,xsrfHeaderName:a,onUploadProgress:a,onDownloadProgress:a,decompress:a,maxContentLength:a,maxBodyLength:a,beforeRedirect:a,transport:a,httpAgent:a,httpsAgent:a,cancelToken:a,socketPath:a,responseEncoding:a,validateStatus:l,headers:(e,t)=>o(ek(e),ek(t),!0)};return B.forEach(Object.keys(Object.assign({},e,t)),function(r){let i=s[r]||o,a=i(e[r],t[r],r);B.isUndefined(a)&&i!==l||(n[r]=a)}),n}let eD="1.6.8",eM={};["object","boolean","number","function","string","symbol"].forEach((e,t)=>{eM[e]=function(n){return typeof n===e||"a"+(t<1?"n ":" ")+e}});let e_={};eM.transitional=function(e,t,n){function r(e,t){return"[Axios v"+eD+"] Transitional option '"+e+"'"+t+(n?". "+n:"")}return(n,o,i)=>{if(!1===e)throw new H(r(o," has been removed"+(t?" in "+t:"")),H.ERR_DEPRECATED);return t&&!e_[o]&&(e_[o]=!0,console.warn(r(o," has been deprecated since v"+t+" and will be removed in the near future"))),!e||e(n,o,i)}};var eU={assertOptions:function(e,t,n){if("object"!=typeof e)throw new H("options must be an object",H.ERR_BAD_OPTION_VALUE);let r=Object.keys(e),o=r.length;for(;o-- >0;){let i=r[o],a=t[i];if(a){let t=e[i],n=void 0===t||a(t,i,e);if(!0!==n)throw new H("option "+i+" must be "+n,H.ERR_BAD_OPTION_VALUE);continue}if(!0!==n)throw new H("Unknown option "+i,H.ERR_BAD_OPTION)}},validators:eM};let eB=eU.validators;class eH{constructor(e){this.defaults=e,this.interceptors={request:new ee,response:new ee}}async request(e,t){try{return await this._request(e,t)}catch(e){if(e instanceof Error){let t;Error.captureStackTrace?Error.captureStackTrace(t={}):t=Error();let n=t.stack?t.stack.replace(/^.+\n/,""):"";e.stack?n&&!String(e.stack).endsWith(n.replace(/^.+\n.+\n/,""))&&(e.stack+="\n"+n):e.stack=n}throw e}}_request(e,t){let n,r;"string"==typeof e?(t=t||{}).url=e:t=e||{};let{transitional:o,paramsSerializer:i,headers:a}=t=ej(this.defaults,t);void 0!==o&&eU.assertOptions(o,{silentJSONParsing:eB.transitional(eB.boolean),forcedJSONParsing:eB.transitional(eB.boolean),clarifyTimeoutError:eB.transitional(eB.boolean)},!1),null!=i&&(B.isFunction(i)?t.paramsSerializer={serialize:i}:eU.assertOptions(i,{encode:eB.function,serialize:eB.function},!0)),t.method=(t.method||this.defaults.method||"get").toLowerCase();let l=a&&B.merge(a.common,a[t.method]);a&&B.forEach(["delete","get","head","post","put","patch","common"],e=>{delete a[e]}),t.headers=eE.concat(l,a);let s=[],u=!0;this.interceptors.request.forEach(function(e){("function"!=typeof e.runWhen||!1!==e.runWhen(t))&&(u=u&&e.synchronous,s.unshift(e.fulfilled,e.rejected))});let c=[];this.interceptors.response.forEach(function(e){c.push(e.fulfilled,e.rejected)});let d=0;if(!u){let e=[ex.bind(this),void 0];for(e.unshift.apply(e,s),e.push.apply(e,c),r=e.length,n=Promise.resolve(t);d<r;)n=n.then(e[d++],e[d++]);return n}r=s.length;let f=t;for(d=0;d<r;){let e=s[d++],t=s[d++];try{f=e(f)}catch(e){t.call(this,e);break}}try{n=ex.call(this,f)}catch(e){return Promise.reject(e)}for(d=0,r=c.length;d<r;)n=n.then(c[d++],c[d++]);return n}getUri(e){return Q(eO((e=ej(this.defaults,e)).baseURL,e.url),e.params,e.paramsSerializer)}}B.forEach(["delete","get","head","options"],function(e){eH.prototype[e]=function(t,n){return this.request(ej(n||{},{method:e,url:t,data:(n||{}).data}))}}),B.forEach(["post","put","patch"],function(e){function t(t){return function(n,r,o){return this.request(ej(o||{},{method:e,headers:t?{"Content-Type":"multipart/form-data"}:{},url:n,data:r}))}}eH.prototype[e]=t(),eH.prototype[e+"Form"]=t(!0)});class eI{constructor(e){let t;if("function"!=typeof e)throw TypeError("executor must be a function.");this.promise=new Promise(function(e){t=e});let n=this;this.promise.then(e=>{if(!n._listeners)return;let t=n._listeners.length;for(;t-- >0;)n._listeners[t](e);n._listeners=null}),this.promise.then=e=>{let t;let r=new Promise(e=>{n.subscribe(e),t=e}).then(e);return r.cancel=function(){n.unsubscribe(t)},r},e(function(e,r,o){n.reason||(n.reason=new ew(e,r,o),t(n.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(e){if(this.reason){e(this.reason);return}this._listeners?this._listeners.push(e):this._listeners=[e]}unsubscribe(e){if(!this._listeners)return;let t=this._listeners.indexOf(e);-1!==t&&this._listeners.splice(t,1)}static source(){let e;return{token:new eI(function(t){e=t}),cancel:e}}}let ez={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(ez).forEach(([e,t])=>{ez[t]=e});let eq=function e(t){let n=new eH(t),r=l(eH.prototype.request,n);return B.extend(r,eH.prototype,n,{allOwnKeys:!0}),B.extend(r,n,null,{allOwnKeys:!0}),r.create=function(n){return e(ej(t,n))},r}(ec);eq.Axios=eH,eq.CanceledError=ew,eq.CancelToken=eI,eq.isCancel=eb,eq.VERSION=eD,eq.toFormData=G,eq.AxiosError=H,eq.Cancel=eq.CanceledError,eq.all=function(e){return Promise.all(e)},eq.spread=function(e){return function(t){return e.apply(null,t)}},eq.isAxiosError=function(e){return B.isObject(e)&&!0===e.isAxiosError},eq.mergeConfig=ej,eq.AxiosHeaders=eE,eq.formToJSON=e=>eu(B.isHTMLForm(e)?new FormData(e):e),eq.getAdapter=eL,eq.HttpStatusCode=ez,eq.default=eq;var eV=eq},5988:function(e,t,n){let r,o,i,a,l,s,u,c,d,f,p,h,m,g;n.d(t,{V:function(){return eM}});var v,E,y,b=n(7266),w=n.t(b,2),S=n(4851),O=n(1800),T=n(1894);function R(e,t,n,r){let o=(0,T.E)(n);(0,b.useEffect)(()=>{function n(e){o.current(e)}return(e=null!=e?e:window).addEventListener(t,n,r),()=>e.removeEventListener(t,n,r)},[e,t,r])}var A=n(6084),C=n(9283);function P(e){let t=(0,O.z)(e),n=(0,b.useRef)(!1);(0,b.useEffect)(()=>(n.current=!1,()=>{n.current=!0,(0,C.Y)(()=>{n.current&&t()})}),[t])}var N=n(2917);function L(e){return N.O.isServer?null:e instanceof Node?e.ownerDocument:null!=e&&e.hasOwnProperty("current")&&e.current instanceof Node?e.current.ownerDocument:document}function F(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];return(0,b.useMemo)(()=>L(...t),[...t])}var x=n(1660),k=n(9671);function j(e,t,n){let r=(0,T.E)(t);(0,b.useEffect)(()=>{function t(e){r.current(e)}return window.addEventListener(e,t,n),()=>window.removeEventListener(e,t,n)},[e,n])}var D=((r=D||{})[r.Forwards=0]="Forwards",r[r.Backwards=1]="Backwards",r);function M(e,t){let n=(0,b.useRef)([]),r=(0,O.z)(e);(0,b.useEffect)(()=>{let e=[...n.current];for(let[o,i]of t.entries())if(n.current[o]!==i){let o=r(t,e);return n.current=t,o}},[r,...t])}var _=n(2345),U=((o=U||{})[o.None=1]="None",o[o.Focusable=2]="Focusable",o[o.Hidden=4]="Hidden",o);let B=(0,_.yV)(function(e,t){var n;let{features:r=1,...o}=e,i={ref:t,"aria-hidden":(2&r)==2||(null!=(n=o["aria-hidden"])?n:void 0),hidden:(4&r)==4||void 0,style:{position:"fixed",top:1,left:1,width:1,height:0,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0",...(4&r)==4&&(2&r)!=2&&{display:"none"}}};return(0,_.sY)({ourProps:i,theirProps:o,slot:{},defaultTag:"div",name:"Hidden"})}),H=[];!function(e){function t(){"loading"!==document.readyState&&(e(),document.removeEventListener("DOMContentLoaded",t))}"undefined"!=typeof window&&"undefined"!=typeof document&&(document.addEventListener("DOMContentLoaded",t),t())}(()=>{function e(e){e.target instanceof HTMLElement&&e.target!==document.body&&H[0]!==e.target&&(H.unshift(e.target),(H=H.filter(e=>null!=e&&e.isConnected)).splice(10))}window.addEventListener("click",e,{capture:!0}),window.addEventListener("mousedown",e,{capture:!0}),window.addEventListener("focus",e,{capture:!0}),document.body.addEventListener("click",e,{capture:!0}),document.body.addEventListener("mousedown",e,{capture:!0}),document.body.addEventListener("focus",e,{capture:!0})});var I=n(9251);let z=["[contentEditable=true]","[tabindex]","a[href]","area[href]","button:not([disabled])","iframe","input:not([disabled])","select:not([disabled])","textarea:not([disabled])"].map(e=>"".concat(e,":not([tabindex='-1'])")).join(",");var q=((i=q||{})[i.First=1]="First",i[i.Previous=2]="Previous",i[i.Next=4]="Next",i[i.Last=8]="Last",i[i.WrapAround=16]="WrapAround",i[i.NoScroll=32]="NoScroll",i),V=((a=V||{})[a.Error=0]="Error",a[a.Overflow=1]="Overflow",a[a.Success=2]="Success",a[a.Underflow=3]="Underflow",a),W=((l=W||{})[l.Previous=-1]="Previous",l[l.Next=1]="Next",l),Y=((s=Y||{})[s.Strict=0]="Strict",s[s.Loose=1]="Loose",s),J=((u=J||{})[u.Keyboard=0]="Keyboard",u[u.Mouse=1]="Mouse",u);function G(e){null==e||e.focus({preventScroll:!0})}function K(e,t){var n,r,o;let{sorted:i=!0,relativeTo:a=null,skipElements:l=[]}=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},s=Array.isArray(e)?e.length>0?e[0].ownerDocument:document:e.ownerDocument,u=Array.isArray(e)?i?function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:e=>e;return e.slice().sort((e,n)=>{let r=t(e),o=t(n);if(null===r||null===o)return 0;let i=r.compareDocumentPosition(o);return i&Node.DOCUMENT_POSITION_FOLLOWING?-1:i&Node.DOCUMENT_POSITION_PRECEDING?1:0})}(e):e:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:document.body;return null==e?[]:Array.from(e.querySelectorAll(z)).sort((e,t)=>Math.sign((e.tabIndex||Number.MAX_SAFE_INTEGER)-(t.tabIndex||Number.MAX_SAFE_INTEGER)))}(e);l.length>0&&u.length>1&&(u=u.filter(e=>!l.includes(e))),a=null!=a?a:s.activeElement;let c=(()=>{if(5&t)return 1;if(10&t)return -1;throw Error("Missing Focus.First, Focus.Previous, Focus.Next or Focus.Last")})(),d=(()=>{if(1&t)return 0;if(2&t)return Math.max(0,u.indexOf(a))-1;if(4&t)return Math.max(0,u.indexOf(a))+1;if(8&t)return u.length-1;throw Error("Missing Focus.First, Focus.Previous, Focus.Next or Focus.Last")})(),f=32&t?{preventScroll:!0}:{},p=0,h=u.length,m;do{if(p>=h||p+h<=0)return 0;let e=d+p;if(16&t)e=(e+h)%h;else{if(e<0)return 3;if(e>=h)return 1}null==(m=u[e])||m.focus(f),p+=c}while(m!==s.activeElement);return 6&t&&null!=(o=null==(r=null==(n=m)?void 0:n.matches)?void 0:r.call(n,"textarea,input"))&&o&&m.select(),2}function Z(e){if(!e)return new Set;if("function"==typeof e)return new Set(e());let t=new Set;for(let n of e.current)n.current instanceof HTMLElement&&t.add(n.current);return t}"undefined"!=typeof window&&"undefined"!=typeof document&&(document.addEventListener("keydown",e=>{e.metaKey||e.altKey||e.ctrlKey||(document.documentElement.dataset.headlessuiFocusVisible="")},!0),document.addEventListener("click",e=>{1===e.detail?delete document.documentElement.dataset.headlessuiFocusVisible:0===e.detail&&(document.documentElement.dataset.headlessuiFocusVisible="")},!0));var $=((c=$||{})[c.None=1]="None",c[c.InitialFocus=2]="InitialFocus",c[c.TabLock=4]="TabLock",c[c.FocusLock=8]="FocusLock",c[c.RestoreFocus=16]="RestoreFocus",c[c.All=30]="All",c);let X=Object.assign((0,_.yV)(function(e,t){let n,r=(0,b.useRef)(null),o=(0,k.T)(r,t),{initialFocus:i,containers:a,features:l=30,...s}=e;(0,x.H)()||(l=1);let u=F(r);!function(e,t){let{ownerDocument:n}=e,r=function(){let e=!(arguments.length>0)||void 0===arguments[0]||arguments[0],t=(0,b.useRef)(H.slice());return M((e,n)=>{let[r]=e,[o]=n;!0===o&&!1===r&&(0,C.Y)(()=>{t.current.splice(0)}),!1===o&&!0===r&&(t.current=H.slice())},[e,H,t]),(0,O.z)(()=>{var e;return null!=(e=t.current.find(e=>null!=e&&e.isConnected))?e:null})}(t);M(()=>{t||(null==n?void 0:n.activeElement)===(null==n?void 0:n.body)&&G(r())},[t]),P(()=>{t&&G(r())})}({ownerDocument:u},!!(16&l));let c=function(e,t){let{ownerDocument:n,container:r,initialFocus:o}=e,i=(0,b.useRef)(null),a=(0,A.t)();return M(()=>{if(!t)return;let e=r.current;e&&(0,C.Y)(()=>{if(!a.current)return;let t=null==n?void 0:n.activeElement;if(null!=o&&o.current){if((null==o?void 0:o.current)===t){i.current=t;return}}else if(e.contains(t)){i.current=t;return}null!=o&&o.current?G(o.current):K(e,q.First)===V.Error&&console.warn("There are no focusable elements inside the <FocusTrap />"),i.current=null==n?void 0:n.activeElement})},[t]),i}({ownerDocument:u,container:r,initialFocus:i},!!(2&l));!function(e,t){let{ownerDocument:n,container:r,containers:o,previousActiveElement:i}=e,a=(0,A.t)();R(null==n?void 0:n.defaultView,"focus",e=>{if(!t||!a.current)return;let n=Z(o);r.current instanceof HTMLElement&&n.add(r.current);let l=i.current;if(!l)return;let s=e.target;s&&s instanceof HTMLElement?Q(n,s)?(i.current=s,G(s)):(e.preventDefault(),e.stopPropagation(),G(l)):G(i.current)},!0)}({ownerDocument:u,container:r,containers:a,previousActiveElement:c},!!(8&l));let d=(n=(0,b.useRef)(0),j("keydown",e=>{"Tab"===e.key&&(n.current=e.shiftKey?1:0)},!0),n),f=(0,O.z)(e=>{let t=r.current;t&&(0,I.E)(d.current,{[D.Forwards]:()=>{K(t,q.First,{skipElements:[e.relatedTarget]})},[D.Backwards]:()=>{K(t,q.Last,{skipElements:[e.relatedTarget]})}})}),p=(0,S.G)(),h=(0,b.useRef)(!1);return b.createElement(b.Fragment,null,!!(4&l)&&b.createElement(B,{as:"button",type:"button","data-headlessui-focus-guard":!0,onFocus:f,features:U.Focusable}),(0,_.sY)({ourProps:{ref:o,onKeyDown(e){"Tab"==e.key&&(h.current=!0,p.requestAnimationFrame(()=>{h.current=!1}))},onBlur(e){let t=Z(a);r.current instanceof HTMLElement&&t.add(r.current);let n=e.relatedTarget;n instanceof HTMLElement&&"true"!==n.dataset.headlessuiFocusGuard&&(Q(t,n)||(h.current?K(r.current,(0,I.E)(d.current,{[D.Forwards]:()=>q.Next,[D.Backwards]:()=>q.Previous})|q.WrapAround,{relativeTo:e.target}):e.target instanceof HTMLElement&&G(e.target)))}},theirProps:s,defaultTag:"div",name:"FocusTrap"}),!!(4&l)&&b.createElement(B,{as:"button",type:"button","data-headlessui-focus-guard":!0,onFocus:f,features:U.Focusable}))}),{features:$});function Q(e,t){for(let n of e)if(n.contains(t))return!0;return!1}var ee=n(9717),et=n(8839);let en=(0,b.createContext)(!1);function er(e){return b.createElement(en.Provider,{value:e.force},e.children)}let eo=b.Fragment,ei=b.Fragment,ea=(0,b.createContext)(null),el=(0,b.createContext)(null),es=Object.assign((0,_.yV)(function(e,t){let n=(0,b.useRef)(null),r=(0,k.T)((0,k.h)(e=>{n.current=e}),t),o=F(n),i=function(e){let t=(0,b.useContext)(en),n=(0,b.useContext)(ea),r=F(e),[o,i]=(0,b.useState)(()=>{if(!t&&null!==n||N.O.isServer)return null;let e=null==r?void 0:r.getElementById("headlessui-portal-root");if(e)return e;if(null===r)return null;let o=r.createElement("div");return o.setAttribute("id","headlessui-portal-root"),r.body.appendChild(o)});return(0,b.useEffect)(()=>{null!==o&&(null!=r&&r.body.contains(o)||null==r||r.body.appendChild(o))},[o,r]),(0,b.useEffect)(()=>{t||null!==n&&i(n.current)},[n,i,t]),o}(n),[a]=(0,b.useState)(()=>{var e;return N.O.isServer?null:null!=(e=null==o?void 0:o.createElement("div"))?e:null}),l=(0,b.useContext)(el),s=(0,x.H)();return(0,et.e)(()=>{!i||!a||i.contains(a)||(a.setAttribute("data-headlessui-portal",""),i.appendChild(a))},[i,a]),(0,et.e)(()=>{if(a&&l)return l.register(a)},[l,a]),P(()=>{var e;i&&a&&(a instanceof Node&&i.contains(a)&&i.removeChild(a),i.childNodes.length<=0&&(null==(e=i.parentElement)||e.removeChild(i)))}),s&&i&&a?(0,ee.createPortal)((0,_.sY)({ourProps:{ref:r},theirProps:e,defaultTag:eo,name:"Portal"}),a):null}),{Group:(0,_.yV)(function(e,t){let{target:n,...r}=e,o={ref:(0,k.T)(t)};return b.createElement(ea.Provider,{value:n},(0,_.sY)({ourProps:o,theirProps:r,defaultTag:ei,name:"Popover.Group"}))})}),{useState:eu,useEffect:ec,useLayoutEffect:ed,useDebugValue:ef}=w;"undefined"!=typeof window&&void 0!==window.document&&window.document.createElement;let ep=w.useSyncExternalStore;var eh=n(1819);function em(){return/iPhone/gi.test(window.navigator.platform)||/Mac/gi.test(window.navigator.platform)&&window.navigator.maxTouchPoints>0}let eg=(v=()=>new Map,E={PUSH(e,t){var n;let r=null!=(n=this.get(e))?n:{doc:e,count:0,d:(0,eh.k)(),meta:new Set};return r.count++,r.meta.add(t),this.set(e,r),this},POP(e,t){let n=this.get(e);return n&&(n.count--,n.meta.delete(t)),this},SCROLL_PREVENT(e){let t,{doc:n,d:r,meta:o}=e,i={doc:n,d:r,meta:function(e){let t={};for(let n of e)Object.assign(t,n(t));return t}(o)},a=[em()?{before(e){let{doc:t,d:n,meta:r}=e;function o(e){return r.containers.flatMap(e=>e()).some(t=>t.contains(e))}n.microTask(()=>{var e;if("auto"!==window.getComputedStyle(t.documentElement).scrollBehavior){let e=(0,eh.k)();e.style(t.documentElement,"scrollBehavior","auto"),n.add(()=>n.microTask(()=>e.dispose()))}let r=null!=(e=window.scrollY)?e:window.pageYOffset,i=null;n.addEventListener(t,"click",e=>{if(e.target instanceof HTMLElement)try{let n=e.target.closest("a");if(!n)return;let{hash:r}=new URL(n.href),a=t.querySelector(r);a&&!o(a)&&(i=a)}catch(e){}},!0),n.addEventListener(t,"touchstart",e=>{if(e.target instanceof HTMLElement){if(o(e.target)){let t=e.target;for(;t.parentElement&&o(t.parentElement);)t=t.parentElement;n.style(t,"overscrollBehavior","contain")}else n.style(e.target,"touchAction","none")}}),n.addEventListener(t,"touchmove",e=>{if(e.target instanceof HTMLElement){if(o(e.target)){let t=e.target;for(;t.parentElement&&""!==t.dataset.headlessuiPortal&&!(t.scrollHeight>t.clientHeight||t.scrollWidth>t.clientWidth);)t=t.parentElement;""===t.dataset.headlessuiPortal&&e.preventDefault()}else e.preventDefault()}},{passive:!1}),n.add(()=>{var e;r!==(null!=(e=window.scrollY)?e:window.pageYOffset)&&window.scrollTo(0,r),i&&i.isConnected&&(i.scrollIntoView({block:"nearest"}),i=null)})})}}:{},{before(e){var n;let{doc:r}=e,o=r.documentElement;t=(null!=(n=r.defaultView)?n:window).innerWidth-o.clientWidth},after(e){let{doc:n,d:r}=e,o=n.documentElement,i=o.clientWidth-o.offsetWidth,a=t-i;r.style(o,"paddingRight","".concat(a,"px"))}},{before(e){let{doc:t,d:n}=e;n.style(t.documentElement,"overflow","hidden")}}];a.forEach(e=>{let{before:t}=e;return null==t?void 0:t(i)}),a.forEach(e=>{let{after:t}=e;return null==t?void 0:t(i)})},SCROLL_ALLOW(e){let{d:t}=e;t.dispose()},TEARDOWN(e){let{doc:t}=e;this.delete(t)}},d=v(),f=new Set,{getSnapshot:()=>d,subscribe:e=>(f.add(e),()=>f.delete(e)),dispatch(e){for(var t=arguments.length,n=Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];let o=E[e].call(d,...n);o&&(d=o,f.forEach(e=>e()))}});eg.subscribe(()=>{let e=eg.getSnapshot(),t=new Map;for(let[n]of e)t.set(n,n.documentElement.style.overflow);for(let n of e.values()){let e="hidden"===t.get(n.doc),r=0!==n.count;(r&&!e||!r&&e)&&eg.dispatch(n.count>0?"SCROLL_PREVENT":"SCROLL_ALLOW",n),0===n.count&&eg.dispatch("TEARDOWN",n)}});let ev=null!=(y=b.useId)?y:function(){let e=(0,x.H)(),[t,n]=b.useState(e?()=>N.O.nextId():null);return(0,et.e)(()=>{null===t&&n(N.O.nextId())},[t]),null!=t?""+t:void 0},eE=new Map,ey=new Map;function eb(e){let t=!(arguments.length>1)||void 0===arguments[1]||arguments[1];(0,et.e)(()=>{var n;if(!t)return;let r="function"==typeof e?e():e.current;if(!r)return;let o=null!=(n=ey.get(r))?n:0;return ey.set(r,o+1),0!==o||(eE.set(r,{"aria-hidden":r.getAttribute("aria-hidden"),inert:r.inert}),r.setAttribute("aria-hidden","true"),r.inert=!0),function(){var e;if(!r)return;let t=null!=(e=ey.get(r))?e:1;if(1===t?ey.delete(r):ey.set(r,t-1),1!==t)return;let n=eE.get(r);n&&(null===n["aria-hidden"]?r.removeAttribute("aria-hidden"):r.setAttribute("aria-hidden",n["aria-hidden"]),r.inert=n.inert,eE.delete(r))}},[e,t])}function ew(e,t,n){let r=(0,T.E)(t);(0,b.useEffect)(()=>{function t(e){r.current(e)}return document.addEventListener(e,t,n),()=>document.removeEventListener(e,t,n)},[e,n])}var eS=n(9176);let eO=(0,b.createContext)(()=>{});eO.displayName="StackContext";var eT=((p=eT||{})[p.Add=0]="Add",p[p.Remove=1]="Remove",p);function eR(e){let{children:t,onUpdate:n,type:r,element:o,enabled:i}=e,a=(0,b.useContext)(eO),l=(0,O.z)(function(){for(var e=arguments.length,t=Array(e),r=0;r<e;r++)t[r]=arguments[r];null==n||n(...t),a(...t)});return(0,et.e)(()=>{let e=void 0===i||!0===i;return e&&l(0,r,o),()=>{e&&l(1,r,o)}},[l,r,o,i]),b.createElement(eO.Provider,{value:l},t)}let eA=(0,b.createContext)(null),eC=Object.assign((0,_.yV)(function(e,t){let n=ev(),{id:r="headlessui-description-".concat(n),...o}=e,i=function e(){let t=(0,b.useContext)(eA);if(null===t){let t=Error("You used a <Description /> component, but it is not inside a relevant parent.");throw Error.captureStackTrace&&Error.captureStackTrace(t,e),t}return t}(),a=(0,k.T)(t);(0,et.e)(()=>i.register(r),[r,i.register]);let l={ref:a,...i.props,id:r};return(0,_.sY)({ourProps:l,theirProps:o,slot:i.slot||{},defaultTag:"p",name:i.name||"Description"})}),{});var eP=((h=eP||{}).Space=" ",h.Enter="Enter",h.Escape="Escape",h.Backspace="Backspace",h.Delete="Delete",h.ArrowLeft="ArrowLeft",h.ArrowUp="ArrowUp",h.ArrowRight="ArrowRight",h.ArrowDown="ArrowDown",h.Home="Home",h.End="End",h.PageUp="PageUp",h.PageDown="PageDown",h.Tab="Tab",h),eN=((m=eN||{})[m.Open=0]="Open",m[m.Closed=1]="Closed",m),eL=((g=eL||{})[g.SetTitleId=0]="SetTitleId",g);let eF={0:(e,t)=>e.titleId===t.id?e:{...e,titleId:t.id}},ex=(0,b.createContext)(null);function ek(e){let t=(0,b.useContext)(ex);if(null===t){let t=Error("<".concat(e," /> is missing a parent <Dialog /> component."));throw Error.captureStackTrace&&Error.captureStackTrace(t,ek),t}return t}function ej(e,t){return(0,I.E)(t.type,eF,e,t)}ex.displayName="DialogContext";let eD=_.AN.RenderStrategy|_.AN.Static,eM=Object.assign((0,_.yV)(function(e,t){let n,r,o,i,a,l=ev(),{id:s="headlessui-dialog-".concat(l),open:u,onClose:c,initialFocus:d,role:f="dialog",__demoMode:p=!1,...h}=e,[m,g]=(0,b.useState)(0),v=(0,b.useRef)(!1);f="dialog"===f||"alertdialog"===f?f:(v.current||(v.current=!0,console.warn("Invalid role [".concat(f,"] passed to <Dialog />. Only `dialog` and and `alertdialog` are supported. Using `dialog` instead."))),"dialog");let E=(0,eS.oJ)();void 0===u&&null!==E&&(u=(E&eS.ZM.Open)===eS.ZM.Open);let y=(0,b.useRef)(null),w=(0,k.T)(y,t),S=F(y),T=e.hasOwnProperty("open")||null!==E,A=e.hasOwnProperty("onClose");if(!T&&!A)throw Error("You have to provide an `open` and an `onClose` prop to the `Dialog` component.");if(!T)throw Error("You provided an `onClose` prop to the `Dialog`, but forgot an `open` prop.");if(!A)throw Error("You provided an `open` prop to the `Dialog`, but forgot an `onClose` prop.");if("boolean"!=typeof u)throw Error("You provided an `open` prop to the `Dialog`, but the value is not a boolean. Received: ".concat(u));if("function"!=typeof c)throw Error("You provided an `onClose` prop to the `Dialog`, but the value is not a function. Received: ".concat(c));let C=u?0:1,[P,N]=(0,b.useReducer)(ej,{titleId:null,descriptionId:null,panelRef:(0,b.createRef)()}),D=(0,O.z)(()=>c(!1)),M=(0,O.z)(e=>N({type:0,id:e})),H=!!(0,x.H)()&&!p&&0===C,q=m>1,V=null!==(0,b.useContext)(ex),[W,J]=(n=(0,b.useContext)(el),r=(0,b.useRef)([]),o=(0,O.z)(e=>(r.current.push(e),n&&n.register(e),()=>i(e))),i=(0,O.z)(e=>{let t=r.current.indexOf(e);-1!==t&&r.current.splice(t,1),n&&n.unregister(e)}),a=(0,b.useMemo)(()=>({register:o,unregister:i,portals:r}),[o,i,r]),[r,(0,b.useMemo)(()=>function(e){let{children:t}=e;return b.createElement(el.Provider,{value:a},t)},[a])]),{resolveContainers:G,mainTreeNodeRef:K,MainTreeNode:Z}=function(){var e;let{defaultContainers:t=[],portals:n,mainTreeNodeRef:r}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},o=(0,b.useRef)(null!=(e=null==r?void 0:r.current)?e:null),i=F(o),a=(0,O.z)(()=>{var e,r,a;let l=[];for(let e of t)null!==e&&(e instanceof HTMLElement?l.push(e):"current"in e&&e.current instanceof HTMLElement&&l.push(e.current));if(null!=n&&n.current)for(let e of n.current)l.push(e);for(let t of null!=(e=null==i?void 0:i.querySelectorAll("html > *, body > *"))?e:[])t!==document.body&&t!==document.head&&t instanceof HTMLElement&&"headlessui-portal-root"!==t.id&&(t.contains(o.current)||t.contains(null==(a=null==(r=o.current)?void 0:r.getRootNode())?void 0:a.host)||l.some(e=>t.contains(e))||l.push(t));return l});return{resolveContainers:a,contains:(0,O.z)(e=>a().some(t=>t.contains(e))),mainTreeNodeRef:o,MainTreeNode:(0,b.useMemo)(()=>function(){return null!=r?null:b.createElement(B,{features:U.Hidden,ref:o})},[o,r])}}({portals:W,defaultContainers:[{get current(){var $;return null!=($=P.panelRef.current)?$:y.current}}]}),Q=null!==E&&(E&eS.ZM.Closing)===eS.ZM.Closing,ee=!V&&!Q&&H;eb((0,b.useCallback)(()=>{var e,t;return null!=(t=Array.from(null!=(e=null==S?void 0:S.querySelectorAll("body > *"))?e:[]).find(e=>"headlessui-portal-root"!==e.id&&e.contains(K.current)&&e instanceof HTMLElement))?t:null},[K]),ee);let en=!!q||H;eb((0,b.useCallback)(()=>{var e,t;return null!=(t=Array.from(null!=(e=null==S?void 0:S.querySelectorAll("[data-headlessui-portal]"))?e:[]).find(e=>e.contains(K.current)&&e instanceof HTMLElement))?t:null},[K]),en),function(e,t){let n=!(arguments.length>2)||void 0===arguments[2]||arguments[2],r=(0,b.useRef)(!1);function o(n,o){if(!r.current||n.defaultPrevented)return;let i=o(n);if(null!==i&&i.getRootNode().contains(i)&&i.isConnected){for(let t of function e(t){return"function"==typeof t?e(t()):Array.isArray(t)||t instanceof Set?t:[t]}(e)){if(null===t)continue;let e=t instanceof HTMLElement?t:t.current;if(null!=e&&e.contains(i)||n.composed&&n.composedPath().includes(e))return}return!function(e){var t;let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return e!==(null==(t=L(e))?void 0:t.body)&&(0,I.E)(n,{0:()=>e.matches(z),1(){let t=e;for(;null!==t;){if(t.matches(z))return!0;t=t.parentElement}return!1}})}(i,Y.Loose)&&-1!==i.tabIndex&&n.preventDefault(),t(n,i)}}(0,b.useEffect)(()=>{requestAnimationFrame(()=>{r.current=n})},[n]);let i=(0,b.useRef)(null);ew("pointerdown",e=>{var t,n;r.current&&(i.current=(null==(n=null==(t=e.composedPath)?void 0:t.call(e))?void 0:n[0])||e.target)},!0),ew("mousedown",e=>{var t,n;r.current&&(i.current=(null==(n=null==(t=e.composedPath)?void 0:t.call(e))?void 0:n[0])||e.target)},!0),ew("click",e=>{em()||/Android/gi.test(window.navigator.userAgent)||i.current&&(o(e,()=>i.current),i.current=null)},!0),ew("touchend",e=>o(e,()=>e.target instanceof HTMLElement?e.target:null),!0),j("blur",e=>o(e,()=>window.document.activeElement instanceof HTMLIFrameElement?window.document.activeElement:null),!0)}(G,e=>{e.preventDefault(),D()},!(!H||q));let eo=!(q||0!==C);R(null==S?void 0:S.defaultView,"keydown",e=>{eo&&(e.defaultPrevented||e.key===eP.Escape&&(e.preventDefault(),e.stopPropagation(),D()))}),function(e,t){var n;let r,o,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:()=>[document.body];n=e=>{var t;return{containers:[...null!=(t=e.containers)?t:[],i]}},r=ep(eg.subscribe,eg.getSnapshot,eg.getSnapshot),(o=e?r.get(e):void 0)&&o.count,(0,et.e)(()=>{if(!(!e||!t))return eg.dispatch("PUSH",e,n),()=>eg.dispatch("POP",e,n)},[t,e])}(S,!(Q||0!==C||V),G),(0,b.useEffect)(()=>{if(0!==C||!y.current)return;let e=new ResizeObserver(e=>{for(let t of e){let e=t.target.getBoundingClientRect();0===e.x&&0===e.y&&0===e.width&&0===e.height&&D()}});return e.observe(y.current),()=>e.disconnect()},[C,y,D]);let[ei,ea]=function(){let[e,t]=(0,b.useState)([]);return[e.length>0?e.join(" "):void 0,(0,b.useMemo)(()=>function(e){let n=(0,O.z)(e=>(t(t=>[...t,e]),()=>t(t=>{let n=t.slice(),r=n.indexOf(e);return -1!==r&&n.splice(r,1),n}))),r=(0,b.useMemo)(()=>({register:n,slot:e.slot,name:e.name,props:e.props}),[n,e.slot,e.name,e.props]);return b.createElement(eA.Provider,{value:r},e.children)},[t])]}(),eu=(0,b.useMemo)(()=>[{dialogState:C,close:D,setTitleId:M},P],[C,P,D,M]),ec=(0,b.useMemo)(()=>({open:0===C}),[C]),ed={ref:w,id:s,role:f,"aria-modal":0===C||void 0,"aria-labelledby":P.titleId,"aria-describedby":ei};return b.createElement(eR,{type:"Dialog",enabled:0===C,element:y,onUpdate:(0,O.z)((e,t)=>{"Dialog"===t&&(0,I.E)(e,{[eT.Add]:()=>g(e=>e+1),[eT.Remove]:()=>g(e=>e-1)})})},b.createElement(er,{force:!0},b.createElement(es,null,b.createElement(ex.Provider,{value:eu},b.createElement(es.Group,{target:y},b.createElement(er,{force:!1},b.createElement(ea,{slot:ec,name:"Dialog.Description"},b.createElement(X,{initialFocus:d,containers:G,features:H?(0,I.E)(q?"parent":"leaf",{parent:X.features.RestoreFocus,leaf:X.features.All&~X.features.FocusLock}):X.features.None},b.createElement(J,null,(0,_.sY)({ourProps:ed,theirProps:h,slot:ec,defaultTag:"div",features:eD,visible:0===C,name:"Dialog"}))))))))),b.createElement(Z,null))}),{Backdrop:(0,_.yV)(function(e,t){let n=ev(),{id:r="headlessui-dialog-backdrop-".concat(n),...o}=e,[{dialogState:i},a]=ek("Dialog.Backdrop"),l=(0,k.T)(t);(0,b.useEffect)(()=>{if(null===a.panelRef.current)throw Error("A <Dialog.Backdrop /> component is being used, but a <Dialog.Panel /> component is missing.")},[a.panelRef]);let s=(0,b.useMemo)(()=>({open:0===i}),[i]);return b.createElement(er,{force:!0},b.createElement(es,null,(0,_.sY)({ourProps:{ref:l,id:r,"aria-hidden":!0},theirProps:o,slot:s,defaultTag:"div",name:"Dialog.Backdrop"})))}),Panel:(0,_.yV)(function(e,t){let n=ev(),{id:r="headlessui-dialog-panel-".concat(n),...o}=e,[{dialogState:i},a]=ek("Dialog.Panel"),l=(0,k.T)(t,a.panelRef),s=(0,b.useMemo)(()=>({open:0===i}),[i]),u=(0,O.z)(e=>{e.stopPropagation()});return(0,_.sY)({ourProps:{ref:l,id:r,onClick:u},theirProps:o,slot:s,defaultTag:"div",name:"Dialog.Panel"})}),Overlay:(0,_.yV)(function(e,t){let n=ev(),{id:r="headlessui-dialog-overlay-".concat(n),...o}=e,[{dialogState:i,close:a}]=ek("Dialog.Overlay"),l=(0,k.T)(t),s=(0,O.z)(e=>{if(e.target===e.currentTarget){if(function(e){let t=e.parentElement,n=null;for(;t&&!(t instanceof HTMLFieldSetElement);)t instanceof HTMLLegendElement&&(n=t),t=t.parentElement;let r=(null==t?void 0:t.getAttribute("disabled"))==="";return!(r&&function(e){if(!e)return!1;let t=e.previousElementSibling;for(;null!==t;){if(t instanceof HTMLLegendElement)return!1;t=t.previousElementSibling}return!0}(n))&&r}(e.currentTarget))return e.preventDefault();e.preventDefault(),e.stopPropagation(),a()}}),u=(0,b.useMemo)(()=>({open:0===i}),[i]);return(0,_.sY)({ourProps:{ref:l,id:r,"aria-hidden":!0,onClick:s},theirProps:o,slot:u,defaultTag:"div",name:"Dialog.Overlay"})}),Title:(0,_.yV)(function(e,t){let n=ev(),{id:r="headlessui-dialog-title-".concat(n),...o}=e,[{dialogState:i,setTitleId:a}]=ek("Dialog.Title"),l=(0,k.T)(t);(0,b.useEffect)(()=>(a(r),()=>a(null)),[r,a]);let s=(0,b.useMemo)(()=>({open:0===i}),[i]);return(0,_.sY)({ourProps:{ref:l,id:r},theirProps:o,slot:s,defaultTag:"h2",name:"Dialog.Title"})}),Description:eC})},6656:function(e,t,n){let r;n.d(t,{u:function(){return x}});var o=n(7266),i=n(4851),a=n(1800),l=n(6084),s=n(8839),u=n(1894),c=n(1660),d=n(9671),f=n(1819),p=n(9251);function h(e){for(var t=arguments.length,n=Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];e&&n.length>0&&e.classList.add(...n)}function m(e){for(var t=arguments.length,n=Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];e&&n.length>0&&e.classList.remove(...n)}var g=n(9176),v=n(6676),E=n(2345);function y(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return e.split(/\s+/).filter(e=>e.length>1)}let b=(0,o.createContext)(null);b.displayName="TransitionContext";var w=((r=w||{}).Visible="visible",r.Hidden="hidden",r);let S=(0,o.createContext)(null);function O(e){return"children"in e?O(e.children):e.current.filter(e=>{let{el:t}=e;return null!==t.current}).filter(e=>{let{state:t}=e;return"visible"===t}).length>0}function T(e,t){let n=(0,u.E)(e),r=(0,o.useRef)([]),s=(0,l.t)(),c=(0,i.G)(),d=(0,a.z)(function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:E.l4.Hidden,o=r.current.findIndex(t=>{let{el:n}=t;return n===e});-1!==o&&((0,p.E)(t,{[E.l4.Unmount](){r.current.splice(o,1)},[E.l4.Hidden](){r.current[o].state="hidden"}}),c.microTask(()=>{var e;!O(r)&&s.current&&(null==(e=n.current)||e.call(n))}))}),f=(0,a.z)(e=>{let t=r.current.find(t=>{let{el:n}=t;return n===e});return t?"visible"!==t.state&&(t.state="visible"):r.current.push({el:e,state:"visible"}),()=>d(e,E.l4.Unmount)}),h=(0,o.useRef)([]),m=(0,o.useRef)(Promise.resolve()),g=(0,o.useRef)({enter:[],leave:[],idle:[]}),v=(0,a.z)((e,n,r)=>{h.current.splice(0),t&&(t.chains.current[n]=t.chains.current[n].filter(t=>{let[n]=t;return n!==e})),null==t||t.chains.current[n].push([e,new Promise(e=>{h.current.push(e)})]),null==t||t.chains.current[n].push([e,new Promise(e=>{Promise.all(g.current[n].map(e=>{let[t,n]=e;return n})).then(()=>e())})]),"enter"===n?m.current=m.current.then(()=>null==t?void 0:t.wait.current).then(()=>r(n)):r(n)}),y=(0,a.z)((e,t,n)=>{Promise.all(g.current[t].splice(0).map(e=>{let[t,n]=e;return n})).then(()=>{var e;null==(e=h.current.shift())||e()}).then(()=>n(t))});return(0,o.useMemo)(()=>({children:r,register:f,unregister:d,onStart:v,onStop:y,wait:m,chains:g}),[f,d,r,v,y,g,m])}function R(){}S.displayName="NestingContext";let A=["beforeEnter","afterEnter","beforeLeave","afterLeave"];function C(e){var t;let n={};for(let r of A)n[r]=null!=(t=e[r])?t:R;return n}let P=E.AN.RenderStrategy,N=(0,E.yV)(function(e,t){let{show:n,appear:r=!1,unmount:i=!0,...l}=e,u=(0,o.useRef)(null),f=(0,d.T)(u,t);(0,c.H)();let p=(0,g.oJ)();if(void 0===n&&null!==p&&(n=(p&g.ZM.Open)===g.ZM.Open),![!0,!1].includes(n))throw Error("A <Transition /> is used but it is missing a `show={true | false}` prop.");let[h,m]=(0,o.useState)(n?"visible":"hidden"),v=T(()=>{m("hidden")}),[y,w]=(0,o.useState)(!0),R=(0,o.useRef)([n]);(0,s.e)(()=>{!1!==y&&R.current[R.current.length-1]!==n&&(R.current.push(n),w(!1))},[R,n]);let A=(0,o.useMemo)(()=>({show:n,appear:r,initial:y}),[n,r,y]);(0,o.useEffect)(()=>{if(n)m("visible");else if(O(v)){let e=u.current;if(!e)return;let t=e.getBoundingClientRect();0===t.x&&0===t.y&&0===t.width&&0===t.height&&m("hidden")}else m("hidden")},[n,v]);let C={unmount:i},N=(0,a.z)(()=>{var t;y&&w(!1),null==(t=e.beforeEnter)||t.call(e)}),F=(0,a.z)(()=>{var t;y&&w(!1),null==(t=e.beforeLeave)||t.call(e)});return o.createElement(S.Provider,{value:v},o.createElement(b.Provider,{value:A},(0,E.sY)({ourProps:{...C,as:o.Fragment,children:o.createElement(L,{ref:f,...C,...l,beforeEnter:N,beforeLeave:F})},theirProps:{},defaultTag:o.Fragment,features:P,visible:"visible"===h,name:"Transition"})))}),L=(0,E.yV)(function(e,t){var n,r,w;let R;let{beforeEnter:A,afterEnter:N,beforeLeave:L,afterLeave:F,enter:x,enterFrom:k,enterTo:j,entered:D,leave:M,leaveFrom:_,leaveTo:U,...B}=e,H=(0,o.useRef)(null),I=(0,d.T)(H,t),z=null==(n=B.unmount)||n?E.l4.Unmount:E.l4.Hidden,{show:q,appear:V,initial:W}=function(){let e=(0,o.useContext)(b);if(null===e)throw Error("A <Transition.Child /> is used but it is missing a parent <Transition /> or <Transition.Root />.");return e}(),[Y,J]=(0,o.useState)(q?"visible":"hidden"),G=function(){let e=(0,o.useContext)(S);if(null===e)throw Error("A <Transition.Child /> is used but it is missing a parent <Transition /> or <Transition.Root />.");return e}(),{register:K,unregister:Z}=G;(0,o.useEffect)(()=>K(H),[K,H]),(0,o.useEffect)(()=>{if(z===E.l4.Hidden&&H.current){if(q&&"visible"!==Y){J("visible");return}return(0,p.E)(Y,{hidden:()=>Z(H),visible:()=>K(H)})}},[Y,H,K,Z,q,z]);let $=(0,u.E)({base:y(B.className),enter:y(x),enterFrom:y(k),enterTo:y(j),entered:y(D),leave:y(M),leaveFrom:y(_),leaveTo:y(U)}),X=(w={beforeEnter:A,afterEnter:N,beforeLeave:L,afterLeave:F},R=(0,o.useRef)(C(w)),(0,o.useEffect)(()=>{R.current=C(w)},[w]),R),Q=(0,c.H)();(0,o.useEffect)(()=>{if(Q&&"visible"===Y&&null===H.current)throw Error("Did you forget to passthrough the `ref` to the actual DOM node?")},[H,Y,Q]);let ee=V&&q&&W,et=Q&&(!W||V)?q?"enter":"leave":"idle",en=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,[t,n]=(0,o.useState)(e),r=(0,l.t)(),i=(0,o.useCallback)(e=>{r.current&&n(t=>t|e)},[t,r]),a=(0,o.useCallback)(e=>!!(t&e),[t]);return{flags:t,addFlag:i,hasFlag:a,removeFlag:(0,o.useCallback)(e=>{r.current&&n(t=>t&~e)},[n,r]),toggleFlag:(0,o.useCallback)(e=>{r.current&&n(t=>t^e)},[n])}}(0),er=(0,a.z)(e=>(0,p.E)(e,{enter:()=>{en.addFlag(g.ZM.Opening),X.current.beforeEnter()},leave:()=>{en.addFlag(g.ZM.Closing),X.current.beforeLeave()},idle:()=>{}})),eo=(0,a.z)(e=>(0,p.E)(e,{enter:()=>{en.removeFlag(g.ZM.Opening),X.current.afterEnter()},leave:()=>{en.removeFlag(g.ZM.Closing),X.current.afterLeave()},idle:()=>{}})),ei=T(()=>{J("hidden"),Z(H)},G),ea=(0,o.useRef)(!1);!function(e){let{immediate:t,container:n,direction:r,classes:o,onStart:a,onStop:c}=e,d=(0,l.t)(),g=(0,i.G)(),v=(0,u.E)(r);(0,s.e)(()=>{t&&(v.current="enter")},[t]),(0,s.e)(()=>{let e=(0,f.k)();g.add(e.dispose);let t=n.current;if(t&&"idle"!==v.current&&d.current){var r,i,l;let n,s,u,d,g,E,y;return e.dispose(),a.current(v.current),e.add((r=o.current,i="enter"===v.current,l=()=>{e.dispose(),c.current(v.current)},s=i?"enter":"leave",u=(0,f.k)(),d=void 0!==l?(n={called:!1},function(){for(var e=arguments.length,t=Array(e),r=0;r<e;r++)t[r]=arguments[r];if(!n.called)return n.called=!0,l(...t)}):()=>{},"enter"===s&&(t.removeAttribute("hidden"),t.style.display=""),g=(0,p.E)(s,{enter:()=>r.enter,leave:()=>r.leave}),E=(0,p.E)(s,{enter:()=>r.enterTo,leave:()=>r.leaveTo}),y=(0,p.E)(s,{enter:()=>r.enterFrom,leave:()=>r.leaveFrom}),m(t,...r.base,...r.enter,...r.enterTo,...r.enterFrom,...r.leave,...r.leaveFrom,...r.leaveTo,...r.entered),h(t,...r.base,...g,...y),u.nextFrame(()=>{m(t,...r.base,...g,...y),h(t,...r.base,...g,...E),function(e,t){let n=(0,f.k)();if(!e)return n.dispose;let{transitionDuration:r,transitionDelay:o}=getComputedStyle(e),[i,a]=[r,o].map(e=>{let[t=0]=e.split(",").filter(Boolean).map(e=>e.includes("ms")?parseFloat(e):1e3*parseFloat(e)).sort((e,t)=>t-e);return t}),l=i+a;if(0!==l){n.group(n=>{n.setTimeout(()=>{t(),n.dispose()},l),n.addEventListener(e,"transitionrun",e=>{e.target===e.currentTarget&&n.dispose()})});let r=n.addEventListener(e,"transitionend",e=>{e.target===e.currentTarget&&(t(),r())})}else t();n.add(()=>t()),n.dispose}(t,()=>(m(t,...r.base,...g),h(t,...r.base,...r.entered),d()))}),u.dispose)),e.dispose}},[r])}({immediate:ee,container:H,classes:$,direction:et,onStart:(0,u.E)(e=>{ea.current=!0,ei.onStart(H,e,er)}),onStop:(0,u.E)(e=>{ea.current=!1,ei.onStop(H,e,eo),"leave"!==e||O(ei)||(J("hidden"),Z(H))})});let el=B;return ee?el={...el,className:(0,v.A)(B.className,...$.current.enter,...$.current.enterFrom)}:ea.current&&(el.className=(0,v.A)(B.className,null==(r=H.current)?void 0:r.className),""===el.className&&delete el.className),o.createElement(S.Provider,{value:ei},o.createElement(g.up,{value:(0,p.E)(Y,{visible:g.ZM.Open,hidden:g.ZM.Closed})|en.flags},(0,E.sY)({ourProps:{ref:I},theirProps:el,defaultTag:"div",features:P,visible:"visible"===Y,name:"Transition.Child"})))}),F=(0,E.yV)(function(e,t){let n=null!==(0,o.useContext)(b),r=null!==(0,g.oJ)();return o.createElement(o.Fragment,null,!n&&r?o.createElement(N,{ref:t,...e}):o.createElement(L,{ref:t,...e}))}),x=Object.assign(N,{Child:F,Root:N})},4851:function(e,t,n){n.d(t,{G:function(){return i}});var r=n(7266),o=n(1819);function i(){let[e]=(0,r.useState)(o.k);return(0,r.useEffect)(()=>()=>e.dispose(),[e]),e}},1800:function(e,t,n){n.d(t,{z:function(){return i}});var r=n(7266),o=n(1894);let i=function(e){let t=(0,o.E)(e);return r.useCallback(function(){for(var e=arguments.length,n=Array(e),r=0;r<e;r++)n[r]=arguments[r];return t.current(...n)},[t])}},6084:function(e,t,n){n.d(t,{t:function(){return i}});var r=n(7266),o=n(8839);function i(){let e=(0,r.useRef)(!1);return(0,o.e)(()=>(e.current=!0,()=>{e.current=!1}),[]),e}},8839:function(e,t,n){n.d(t,{e:function(){return i}});var r=n(7266),o=n(2917);let i=(e,t)=>{o.O.isServer?(0,r.useEffect)(e,t):(0,r.useLayoutEffect)(e,t)}},1894:function(e,t,n){n.d(t,{E:function(){return i}});var r=n(7266),o=n(8839);function i(e){let t=(0,r.useRef)(e);return(0,o.e)(()=>{t.current=e},[e]),t}},1660:function(e,t,n){n.d(t,{H:function(){return a}});var r,o=n(7266),i=n(2917);function a(){let e;let t=(e="undefined"==typeof document,(0,(r||(r=n.t(o,2))).useSyncExternalStore)(()=>()=>{},()=>!1,()=>!e)),[a,l]=o.useState(i.O.isHandoffComplete);return a&&!1===i.O.isHandoffComplete&&l(!1),o.useEffect(()=>{!0!==a&&l(!0)},[a]),o.useEffect(()=>i.O.handoff(),[]),!t&&a}},9671:function(e,t,n){n.d(t,{T:function(){return l},h:function(){return a}});var r=n(7266),o=n(1800);let i=Symbol();function a(e){let t=!(arguments.length>1)||void 0===arguments[1]||arguments[1];return Object.assign(e,{[i]:t})}function l(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];let a=(0,r.useRef)(t);(0,r.useEffect)(()=>{a.current=t},[t]);let l=(0,o.z)(e=>{for(let t of a.current)null!=t&&("function"==typeof t?t(e):t.current=e)});return t.every(e=>null==e||(null==e?void 0:e[i]))?void 0:l}},9176:function(e,t,n){let r;n.d(t,{ZM:function(){return a},oJ:function(){return l},up:function(){return s}});var o=n(7266);let i=(0,o.createContext)(null);i.displayName="OpenClosedContext";var a=((r=a||{})[r.Open=1]="Open",r[r.Closed=2]="Closed",r[r.Closing=4]="Closing",r[r.Opening=8]="Opening",r);function l(){return(0,o.useContext)(i)}function s(e){let{value:t,children:n}=e;return o.createElement(i.Provider,{value:t},n)}},6676:function(e,t,n){n.d(t,{A:function(){return r}});function r(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];return Array.from(new Set(t.flatMap(e=>"string"==typeof e?e.split(" "):[]))).filter(Boolean).join(" ")}},1819:function(e,t,n){n.d(t,{k:function(){return function e(){let t=[],n={addEventListener:(e,t,r,o)=>(e.addEventListener(t,r,o),n.add(()=>e.removeEventListener(t,r,o))),requestAnimationFrame(){for(var e=arguments.length,t=Array(e),r=0;r<e;r++)t[r]=arguments[r];let o=requestAnimationFrame(...t);return n.add(()=>cancelAnimationFrame(o))},nextFrame(){for(var e=arguments.length,t=Array(e),r=0;r<e;r++)t[r]=arguments[r];return n.requestAnimationFrame(()=>n.requestAnimationFrame(...t))},setTimeout(){for(var e=arguments.length,t=Array(e),r=0;r<e;r++)t[r]=arguments[r];let o=setTimeout(...t);return n.add(()=>clearTimeout(o))},microTask(){for(var e=arguments.length,t=Array(e),o=0;o<e;o++)t[o]=arguments[o];let i={current:!0};return(0,r.Y)(()=>{i.current&&t[0]()}),n.add(()=>{i.current=!1})},style(e,t,n){let r=e.style.getPropertyValue(t);return Object.assign(e.style,{[t]:n}),this.add(()=>{Object.assign(e.style,{[t]:r})})},group(t){let n=e();return t(n),this.add(()=>n.dispose())},add:e=>(t.push(e),()=>{let n=t.indexOf(e);if(n>=0)for(let e of t.splice(n,1))e()}),dispose(){for(let e of t.splice(0))e()}};return n}}});var r=n(9283)},2917:function(e,t,n){n.d(t,{O:function(){return l}});var r=Object.defineProperty,o=(e,t,n)=>t in e?r(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,i=(e,t,n)=>(o(e,"symbol"!=typeof t?t+"":t,n),n);class a{set(e){this.current!==e&&(this.handoffState="pending",this.currentId=0,this.current=e)}reset(){this.set(this.detect())}nextId(){return++this.currentId}get isServer(){return"server"===this.current}get isClient(){return"client"===this.current}detect(){return"undefined"==typeof window||"undefined"==typeof document?"server":"client"}handoff(){"pending"===this.handoffState&&(this.handoffState="complete")}get isHandoffComplete(){return"complete"===this.handoffState}constructor(){i(this,"current",this.detect()),i(this,"handoffState","pending"),i(this,"currentId",0)}}let l=new a},9251:function(e,t,n){n.d(t,{E:function(){return r}});function r(e,t){for(var n=arguments.length,o=Array(n>2?n-2:0),i=2;i<n;i++)o[i-2]=arguments[i];if(e in t){let n=t[e];return"function"==typeof n?n(...o):n}let a=Error('Tried to handle "'.concat(e,'" but there is no handler defined. Only defined handlers are: ').concat(Object.keys(t).map(e=>'"'.concat(e,'"')).join(", "),"."));throw Error.captureStackTrace&&Error.captureStackTrace(a,r),a}},9283:function(e,t,n){n.d(t,{Y:function(){return r}});function r(e){"function"==typeof queueMicrotask?queueMicrotask(e):Promise.resolve().then(e).catch(e=>setTimeout(()=>{throw e}))}},2345:function(e,t,n){let r,o;n.d(t,{AN:function(){return s},l4:function(){return u},sY:function(){return c},yV:function(){return h}});var i=n(7266),a=n(6676),l=n(9251),s=((r=s||{})[r.None=0]="None",r[r.RenderStrategy=1]="RenderStrategy",r[r.Static=2]="Static",r),u=((o=u||{})[o.Unmount=0]="Unmount",o[o.Hidden=1]="Hidden",o);function c(e){let{ourProps:t,theirProps:n,slot:r,defaultTag:o,features:i,visible:a=!0,name:s,mergeRefs:u}=e;u=null!=u?u:f;let c=p(n,t);if(a)return d(c,r,o,s,u);let h=null!=i?i:0;if(2&h){let{static:e=!1,...t}=c;if(e)return d(t,r,o,s,u)}if(1&h){let{unmount:e=!0,...t}=c;return(0,l.E)(e?0:1,{0:()=>null,1:()=>d({...t,hidden:!0,style:{display:"none"}},r,o,s,u)})}return d(c,r,o,s,u)}function d(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2?arguments[2]:void 0,r=arguments.length>3?arguments[3]:void 0,o=arguments.length>4?arguments[4]:void 0,{as:l=n,children:s,refName:u="ref",...c}=g(e,["unmount","static"]),d=void 0!==e.ref?{[u]:e.ref}:{},f="function"==typeof s?s(t):s;"className"in c&&c.className&&"function"==typeof c.className&&(c.className=c.className(t));let h={};if(t){let e=!1,n=[];for(let[r,o]of Object.entries(t))"boolean"==typeof o&&(e=!0),!0===o&&n.push(r);e&&(h["data-headlessui-state"]=n.join(" "))}if(l===i.Fragment&&Object.keys(m(c)).length>0){if(!(0,i.isValidElement)(f)||Array.isArray(f)&&f.length>1)throw Error(['Passing props on "Fragment"!',"","The current component <".concat(r,' /> is rendering a "Fragment".'),"However we need to passthrough the following props:",Object.keys(c).map(e=>" - ".concat(e)).join("\n"),"","You can apply a few solutions:",['Add an `as="..."` prop, to ensure that we render an actual element instead of a "Fragment".',"Render a single element as the child so that we can forward the props onto that element."].map(e=>" - ".concat(e)).join("\n")].join("\n"));let e=f.props,t="function"==typeof(null==e?void 0:e.className)?function(){for(var t=arguments.length,n=Array(t),r=0;r<t;r++)n[r]=arguments[r];return(0,a.A)(null==e?void 0:e.className(...n),c.className)}:(0,a.A)(null==e?void 0:e.className,c.className);return(0,i.cloneElement)(f,Object.assign({},p(f.props,m(g(c,["ref"]))),h,d,{ref:o(f.ref,d.ref)},t?{className:t}:{}))}return(0,i.createElement)(l,Object.assign({},g(c,["ref"]),l!==i.Fragment&&d,l!==i.Fragment&&h),f)}function f(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];return t.every(e=>null==e)?void 0:e=>{for(let n of t)null!=n&&("function"==typeof n?n(e):n.current=e)}}function p(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];if(0===t.length)return{};if(1===t.length)return t[0];let r={},o={};for(let e of t)for(let t in e)t.startsWith("on")&&"function"==typeof e[t]?(null!=o[t]||(o[t]=[]),o[t].push(e[t])):r[t]=e[t];if(r.disabled||r["aria-disabled"])return Object.assign(r,Object.fromEntries(Object.keys(o).map(e=>[e,void 0])));for(let e in o)Object.assign(r,{[e](t){for(var n=arguments.length,r=Array(n>1?n-1:0),i=1;i<n;i++)r[i-1]=arguments[i];for(let n of o[e]){if((t instanceof Event||(null==t?void 0:t.nativeEvent)instanceof Event)&&t.defaultPrevented)return;n(t,...r)}}});return r}function h(e){var t;return Object.assign((0,i.forwardRef)(e),{displayName:null!=(t=e.displayName)?t:e.name})}function m(e){let t=Object.assign({},e);for(let e in t)void 0===t[e]&&delete t[e];return t}function g(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],n=Object.assign({},e);for(let e of t)e in n&&delete n[e];return n}}}]);
|
|
|
|
_next/static/chunks/925-02555f58b42a478a.js
DELETED
The diff for this file is too large to render.
See raw diff
|
|
_next/static/chunks/app/_not-found/{page-f692fe2608220f5d.js β page-367734fbb4e34400.js}
RENAMED
@@ -1 +1 @@
|
|
1 |
-
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[409],{
|
|
|
1 |
+
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[409],{7589:function(e,t,n){(window.__NEXT_P=window.__NEXT_P||[]).push(["/_not-found/page",function(){return n(5457)}])},5457:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"default",{enumerable:!0,get:function(){return s}}),n(9920);let i=n(7437);n(2265);let o={fontFamily:'system-ui,"Segoe UI",Roboto,Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji"',height:"100vh",textAlign:"center",display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center"},l={display:"inline-block"},r={display:"inline-block",margin:"0 20px 0 0",padding:"0 23px 0 0",fontSize:24,fontWeight:500,verticalAlign:"top",lineHeight:"49px"},d={fontSize:14,fontWeight:400,lineHeight:"49px",margin:0};function s(){return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)("title",{children:"404: This page could not be found."}),(0,i.jsx)("div",{style:o,children:(0,i.jsxs)("div",{children:[(0,i.jsx)("style",{dangerouslySetInnerHTML:{__html:"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}"}}),(0,i.jsx)("h1",{className:"next-error-h1",style:r,children:"404"}),(0,i.jsx)("div",{style:l,children:(0,i.jsx)("h2",{style:d,children:"This page could not be found."})})]})})]})}("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)}},function(e){e.O(0,[971,190,744],function(){return e(e.s=7589)}),_N_E=e.O()}]);
|
_next/static/chunks/app/{layout-1e509317e28476c4.js β layout-e0223e57eaadc292.js}
RENAMED
@@ -1 +1 @@
|
|
1 |
-
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[185],{
|
|
|
1 |
+
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[185],{6424:function(e,t,n){Promise.resolve().then(n.bind(n,1164)),Promise.resolve().then(n.t.bind(n,3054,23))},3054:function(){},1164:function(e,t,n){"use strict";n.d(t,{Analytics:function(){return d}});var o=n(2265),r=()=>{window.va||(window.va=function(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];(window.vaq=window.vaq||[]).push(t)})};function a(){return"undefined"!=typeof window}function c(){return"production"}function i(){return"development"===((a()?window.vam:c())||"production")}function d(e){return(0,o.useEffect)(()=>{!function(){var e;let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{debug:!0};if(!a())return;(function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"auto";if("auto"===e){window.vam=c();return}window.vam=e})(t.mode),r(),t.beforeSend&&(null==(e=window.va)||e.call(window,"beforeSend",t.beforeSend));let n=t.scriptSrc||(i()?"https://va.vercel-scripts.com/v1/script.debug.js":"/_vercel/insights/script.js");if(document.head.querySelector('script[src*="'.concat(n,'"]')))return;let o=document.createElement("script");o.src=n,o.defer=!0,o.dataset.sdkn="@vercel/analytics"+(t.framework?"/".concat(t.framework):""),o.dataset.sdkv="1.3.1",t.disableAutoTrack&&(o.dataset.disableAutoTrack="1"),t.endpoint&&(o.dataset.endpoint=t.endpoint),t.dsn&&(o.dataset.dsn=t.dsn),o.onerror=()=>{let e=i()?"Please check if any ad blockers are enabled and try again.":"Be sure to enable Web Analytics for your project and deploy again. See https://vercel.com/docs/analytics/quickstart for more information.";console.log("[Vercel Web Analytics] Failed to load script from ".concat(n,". ").concat(e))},i()&&!1===t.debug&&(o.dataset.debug="false"),document.head.appendChild(o)}({framework:e.framework||"react",...void 0!==e.route&&{disableAutoTrack:!0},...e})},[]),(0,o.useEffect)(()=>{e.route&&e.path&&function(e){var t;let{route:n,path:o}=e;null==(t=window.va)||t.call(window,"pageview",{route:n,path:o})}({route:e.route,path:e.path})},[e.route,e.path]),null}}},function(e){e.O(0,[141,971,190,744],function(){return e(e.s=6424)}),_N_E=e.O()}]);
|
_next/static/chunks/app/page-7e312bb1702d52aa.js
DELETED
@@ -1 +0,0 @@
|
|
1 |
-
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[931],{8336:function(e,t,n){Promise.resolve().then(n.bind(n,7559)),Promise.resolve().then(n.bind(n,1686)),Promise.resolve().then(n.bind(n,8012))},8012:function(e,t,n){"use strict";let a;n.r(t),n.d(t,{default:function(){return Q}});var r,i,s,o=n(1167),l=n(5014),c=n(7266),u={SAMPLING_RATE:16e3,DEFAULT_AUDIO_URL:"https://huggingface.co/spaces/huuquyet/PhoWhisper-next/resolve/main/demo.flac",DEFAULT_MODEL:"huuquyet/PhoWhisper-tiny",DEFAULT_SUBTASK:"transcribe",DEFAULT_LANGUAGE:"vietnamese",DEFAULT_QUANTIZED:(a=!1,r=navigator.userAgent||navigator.vendor||("opera"in window&&"string"==typeof window.opera?window.opera:""),(/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino|android|ipad|playbook|silk/i.test(r)||/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\-|your|zeto|zte\-/i.test(r.substr(0,4)))&&(a=!0),a),DEFAULT_MULTILINGUAL:!1};function d(e){let t=(0,c.useRef)(null),n=(0,c.useRef)(null);return(0,c.useEffect)(()=>{t.current&&n.current&&(n.current.src=e.audioUrl,t.current.load())},[e.audioUrl]),(0,o.jsx)("div",{className:"flex relative z-10 p-4 w-full",children:(0,o.jsx)("audio",{ref:t,controls:!0,className:"w-full h-14 rounded-lg bg-white shadow-xl shadow-black/5 ring-1 ring-slate-700/10",children:(0,o.jsx)("source",{ref:n,type:e.mimeType})})})}function m(e){return String(e).padStart(2,"0")}function p(e){let t=e/3600|0,n=(e-=3600*t)/60|0,a=0|(e-=60*n);return"".concat(t?"".concat(m(t),":"):"").concat(m(n),":").concat(m(a))}function y(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}let h={172351395:{name:"EBML",type:"Container"},646:{name:"EBMLVersion",type:"Uint"},759:{name:"EBMLReadVersion",type:"Uint"},754:{name:"EBMLMaxIDLength",type:"Uint"},755:{name:"EBMLMaxSizeLength",type:"Uint"},642:{name:"DocType",type:"String"},647:{name:"DocTypeVersion",type:"Uint"},645:{name:"DocTypeReadVersion",type:"Uint"},108:{name:"Void",type:"Binary"},63:{name:"CRC-32",type:"Binary"},190023271:{name:"SignatureSlot",type:"Container"},16010:{name:"SignatureAlgo",type:"Uint"},16026:{name:"SignatureHash",type:"Uint"},16037:{name:"SignaturePublicKey",type:"Binary"},16053:{name:"Signature",type:"Binary"},15963:{name:"SignatureElements",type:"Container"},15995:{name:"SignatureElementList",type:"Container"},9522:{name:"SignedElement",type:"Binary"},139690087:{name:"Segment",type:"Container"},21863284:{name:"SeekHead",type:"Container"},3515:{name:"Seek",type:"Container"},5035:{name:"SeekID",type:"Binary"},5036:{name:"SeekPosition",type:"Uint"},88713574:{name:"Info",type:"Container"},13220:{name:"SegmentUID",type:"Binary"},13188:{name:"SegmentFilename",type:"String"},1882403:{name:"PrevUID",type:"Binary"},1868715:{name:"PrevFilename",type:"String"},2013475:{name:"NextUID",type:"Binary"},1999803:{name:"NextFilename",type:"String"},1092:{name:"SegmentFamily",type:"Binary"},10532:{name:"ChapterTranslate",type:"Container"},10748:{name:"ChapterTranslateEditionUID",type:"Uint"},10687:{name:"ChapterTranslateCodec",type:"Uint"},10661:{name:"ChapterTranslateID",type:"Binary"},710577:{name:"TimecodeScale",type:"Uint"},1161:{name:"Duration",type:"Float"},1121:{name:"DateUTC",type:"Date"},15273:{name:"Title",type:"String"},3456:{name:"MuxingApp",type:"String"},5953:{name:"WritingApp",type:"String"},103:{name:"Timecode",type:"Uint"},6228:{name:"SilentTracks",type:"Container"},6359:{name:"SilentTrackNumber",type:"Uint"},39:{name:"Position",type:"Uint"},43:{name:"PrevSize",type:"Uint"},35:{name:"SimpleBlock",type:"Binary"},32:{name:"BlockGroup",type:"Container"},33:{name:"Block",type:"Binary"},34:{name:"BlockVirtual",type:"Binary"},13729:{name:"BlockAdditions",type:"Container"},38:{name:"BlockMore",type:"Container"},110:{name:"BlockAddID",type:"Uint"},37:{name:"BlockAdditional",type:"Binary"},27:{name:"BlockDuration",type:"Uint"},122:{name:"ReferencePriority",type:"Uint"},123:{name:"ReferenceBlock",type:"Int"},125:{name:"ReferenceVirtual",type:"Int"},36:{name:"CodecState",type:"Binary"},13730:{name:"DiscardPadding",type:"Int"},14:{name:"Slices",type:"Container"},104:{name:"TimeSlice",type:"Container"},76:{name:"LaceNumber",type:"Uint"},77:{name:"FrameNumber",type:"Uint"},75:{name:"BlockAdditionID",type:"Uint"},78:{name:"Delay",type:"Uint"},79:{name:"SliceDuration",type:"Uint"},72:{name:"ReferenceFrame",type:"Container"},73:{name:"ReferenceOffset",type:"Uint"},74:{name:"ReferenceTimeCode",type:"Uint"},47:{name:"EncryptedBlock",type:"Binary"},106212971:{name:"Tracks",type:"Container"},46:{name:"TrackEntry",type:"Container"},87:{name:"TrackNumber",type:"Uint"},13253:{name:"TrackUID",type:"Uint"},3:{name:"TrackType",type:"Uint"},57:{name:"FlagEnabled",type:"Uint"},8:{name:"FlagDefault",type:"Uint"},5546:{name:"FlagForced",type:"Uint"},28:{name:"FlagLacing",type:"Uint"},11751:{name:"MinCache",type:"Uint"},11768:{name:"MaxCache",type:"Uint"},254851:{name:"DefaultDuration",type:"Uint"},216698:{name:"DefaultDecodedFieldDuration",type:"Uint"},209231:{name:"TrackTimecodeScale",type:"Float"},4991:{name:"TrackOffset",type:"Int"},5614:{name:"MaxBlockAdditionID",type:"Uint"},4974:{name:"Name",type:"String"},177564:{name:"Language",type:"String"},6:{name:"CodecID",type:"String"},9122:{name:"CodecPrivate",type:"Binary"},362120:{name:"CodecName",type:"String"},13382:{name:"AttachmentLink",type:"Uint"},1742487:{name:"CodecSettings",type:"String"},1785920:{name:"CodecInfoURL",type:"String"},438848:{name:"CodecDownloadURL",type:"String"},42:{name:"CodecDecodeAll",type:"Uint"},12203:{name:"TrackOverlay",type:"Uint"},5802:{name:"CodecDelay",type:"Uint"},5819:{name:"SeekPreRoll",type:"Uint"},9764:{name:"TrackTranslate",type:"Container"},9980:{name:"TrackTranslateEditionUID",type:"Uint"},9919:{name:"TrackTranslateCodec",type:"Uint"},9893:{name:"TrackTranslateTrackID",type:"Binary"},96:{name:"Video",type:"Container"},26:{name:"FlagInterlaced",type:"Uint"},5048:{name:"StereoMode",type:"Uint"},5056:{name:"AlphaMode",type:"Uint"},5049:{name:"OldStereoMode",type:"Uint"},48:{name:"PixelWidth",type:"Uint"},58:{name:"PixelHeight",type:"Uint"},5290:{name:"PixelCropBottom",type:"Uint"},5307:{name:"PixelCropTop",type:"Uint"},5324:{name:"PixelCropLeft",type:"Uint"},5341:{name:"PixelCropRight",type:"Uint"},5296:{name:"DisplayWidth",type:"Uint"},5306:{name:"DisplayHeight",type:"Uint"},5298:{name:"DisplayUnit",type:"Uint"},5299:{name:"AspectRatioType",type:"Uint"},963876:{name:"ColourSpace",type:"Binary"},1029411:{name:"GammaValue",type:"Float"},230371:{name:"FrameRate",type:"Float"},97:{name:"Audio",type:"Container"},53:{name:"SamplingFrequency",type:"Float"},14517:{name:"OutputSamplingFrequency",type:"Float"},31:{name:"Channels",type:"Uint"},15739:{name:"ChannelPositions",type:"Binary"},8804:{name:"BitDepth",type:"Uint"},98:{name:"TrackOperation",type:"Container"},99:{name:"TrackCombinePlanes",type:"Container"},100:{name:"TrackPlane",type:"Container"},101:{name:"TrackPlaneUID",type:"Uint"},102:{name:"TrackPlaneType",type:"Uint"},105:{name:"TrackJoinBlocks",type:"Container"},109:{name:"TrackJoinUID",type:"Uint"},64:{name:"TrickTrackUID",type:"Uint"},65:{name:"TrickTrackSegmentUID",type:"Binary"},70:{name:"TrickTrackFlag",type:"Uint"},71:{name:"TrickMasterTrackUID",type:"Uint"},68:{name:"TrickMasterTrackSegmentUID",type:"Binary"},11648:{name:"ContentEncodings",type:"Container"},8768:{name:"ContentEncoding",type:"Container"},4145:{name:"ContentEncodingOrder",type:"Uint"},4146:{name:"ContentEncodingScope",type:"Uint"},4147:{name:"ContentEncodingType",type:"Uint"},4148:{name:"ContentCompression",type:"Container"},596:{name:"ContentCompAlgo",type:"Uint"},597:{name:"ContentCompSettings",type:"Binary"},4149:{name:"ContentEncryption",type:"Container"},2017:{name:"ContentEncAlgo",type:"Uint"},2018:{name:"ContentEncKeyID",type:"Binary"},2019:{name:"ContentSignature",type:"Binary"},2020:{name:"ContentSigKeyID",type:"Binary"},2021:{name:"ContentSigAlgo",type:"Uint"},2022:{name:"ContentSigHashAlgo",type:"Uint"},206814059:{name:"Cues",type:"Container"},59:{name:"CuePoint",type:"Container"},51:{name:"CueTime",type:"Uint"},55:{name:"CueTrackPositions",type:"Container"},119:{name:"CueTrack",type:"Uint"},113:{name:"CueClusterPosition",type:"Uint"},112:{name:"CueRelativePosition",type:"Uint"},50:{name:"CueDuration",type:"Uint"},4984:{name:"CueBlockNumber",type:"Uint"},106:{name:"CueCodecState",type:"Uint"},91:{name:"CueReference",type:"Container"},22:{name:"CueRefTime",type:"Uint"},23:{name:"CueRefCluster",type:"Uint"},4959:{name:"CueRefNumber",type:"Uint"},107:{name:"CueRefCodecState",type:"Uint"},155296873:{name:"Attachments",type:"Container"},8615:{name:"AttachedFile",type:"Container"},1662:{name:"FileDescription",type:"String"},1646:{name:"FileName",type:"String"},1632:{name:"FileMimeType",type:"String"},1628:{name:"FileData",type:"Binary"},1710:{name:"FileUID",type:"Uint"},1653:{name:"FileReferral",type:"Binary"},1633:{name:"FileUsedStartTime",type:"Uint"},1634:{name:"FileUsedEndTime",type:"Uint"},4433776:{name:"Chapters",type:"Container"},1465:{name:"EditionEntry",type:"Container"},1468:{name:"EditionUID",type:"Uint"},1469:{name:"EditionFlagHidden",type:"Uint"},1499:{name:"EditionFlagDefault",type:"Uint"},1501:{name:"EditionFlagOrdered",type:"Uint"},54:{name:"ChapterAtom",type:"Container"},13252:{name:"ChapterUID",type:"Uint"},5716:{name:"ChapterStringUID",type:"String"},17:{name:"ChapterTimeStart",type:"Uint"},18:{name:"ChapterTimeEnd",type:"Uint"},24:{name:"ChapterFlagHidden",type:"Uint"},1432:{name:"ChapterFlagEnabled",type:"Uint"},11879:{name:"ChapterSegmentUID",type:"Binary"},11964:{name:"ChapterSegmentEditionUID",type:"Uint"},9155:{name:"ChapterPhysicalEquiv",type:"Uint"},15:{name:"ChapterTrack",type:"Container"},9:{name:"ChapterTrackNumber",type:"Uint"},0:{name:"ChapterDisplay",type:"Container"},5:{name:"ChapString",type:"String"},892:{name:"ChapLanguage",type:"String"},894:{name:"ChapCountry",type:"String"},10564:{name:"ChapProcess",type:"Container"},10581:{name:"ChapProcessCodecID",type:"Uint"},1293:{name:"ChapProcessPrivate",type:"Binary"},10513:{name:"ChapProcessCommand",type:"Container"},10530:{name:"ChapProcessTime",type:"Uint"},10547:{name:"ChapProcessData",type:"Binary"},39109479:{name:"Tags",type:"Container"},13171:{name:"Tag",type:"Container"},9152:{name:"Targets",type:"Container"},10442:{name:"TargetTypeValue",type:"Uint"},9162:{name:"TargetType",type:"String"},9157:{name:"TagTrackUID",type:"Uint"},9161:{name:"TagEditionUID",type:"Uint"},9156:{name:"TagChapterUID",type:"Uint"},9158:{name:"TagAttachmentUID",type:"Uint"},10184:{name:"SimpleTag",type:"Container"},1443:{name:"TagName",type:"String"},1146:{name:"TagLanguage",type:"String"},1156:{name:"TagDefault",type:"Uint"},1159:{name:"TagString",type:"String"},1157:{name:"TagBinary",type:"Binary"}};class g{updateBySource(){}setSource(e){this.source=e,this.updateBySource()}updateByData(){}setData(e){this.data=e,this.updateByData()}constructor(e="Unknown",t="Unknown"){y(this,"name",void 0),y(this,"type",void 0),y(this,"source",void 0),y(this,"data",void 0),this.name=e,this.type=t}}class f extends g{updateBySource(){this.data="";for(let e=0;e<this.source.length;e++){let t=this.source[e].toString(16);this.data+=b(t)}}updateByData(){let e=this.data.length/2;this.source=new Uint8Array(e);for(let t=0;t<e;t++){let e=this.data.substr(2*t,2);this.source[t]=Number.parseInt(e,16)}}getValue(){return Number.parseInt(this.data,16)}setValue(e){this.setData(b(e.toString(16)))}constructor(e,t){super(e,t||"Uint")}}function b(e){return e.length%2==1?"0".concat(e):e}class x extends g{getFloatArrayType(){return this.source&&4===this.source.length?Float32Array:Float64Array}updateBySource(){let e=this.source.reverse(),t=new(this.getFloatArrayType())(e.buffer);this.data=t[0]}updateByData(){let e=new Uint8Array(new(this.getFloatArrayType())([this.data]).buffer);this.source=e.reverse()}getValue(){return this.data}setValue(e){this.setData(e)}constructor(e,t){super(e,t||"Float")}}class k extends g{readByte(){return this.source[this.offset++]}readUint(){let e=this.readByte(),t=8-e.toString(2).length,n=e-(1<<7-t);for(let e=0;e<t;e++)n*=256,n+=this.readByte();return n}updateBySource(){let e;for(this.data=[],this.offset=0;this.offset<this.source.length;this.offset=e){let t=this.readUint(),n=this.readUint();e=Math.min(this.offset+n,this.source.length);let a=this.source.slice(this.offset,e),r=h[t]||{name:"Unknown",type:"Unknown"},i=g;switch(r.type){case"Container":i=k;break;case"Uint":i=f;break;case"Float":i=x}let s=new i(r.name,r.type);s.setSource(a),this.data.push({id:t,idHex:t.toString(16),data:s})}}writeUint(e){let t,n,a=arguments.length>1&&void 0!==arguments[1]&&arguments[1];for(t=1,n=128;e>=n&&t<8;t++,n*=128);if(!a){let a=n+e;for(let e=t-1;e>=0;e--){let t=a%256;this.source[this.offset+e]=t,a=(a-t)/256}}this.offset+=t}writeSections(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];this.offset=0;for(let t=0;t<this.data.length;t++){let n=this.data[t],a=n.data.source,r=a.length;this.writeUint(n.id,e),this.writeUint(r,e),e||this.source.set(a,this.offset),this.offset+=r}return this.offset}updateByData(){let e=this.writeSections(!0);this.source=new Uint8Array(e),this.writeSections()}getSectionById(e){for(let t=0;t<this.data.length;t++){let n=this.data[t];if(n.id===e)return n.data}}constructor(e,t){super(e,t||"Container"),y(this,"offset",0),y(this,"data",[])}}class C extends k{fixDuration(e){let t=this.getSectionById(139690087);if(!t)return!1;let n=t.getSectionById(88713574);if(!n)return!1;let a=n.getSectionById(710577);if(!a)return!1;let r=n.getSectionById(1161);if(r){if(!(0>=r.getValue()))return!1;r.setValue(e)}else(r=new x("Duration","Float")).setValue(e),n.data.push({id:1161,data:r});return a.setValue(1e6),n.updateByData(),t.updateByData(),this.updateByData(),!0}toBlob(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"video/webm";return new Blob([this.source.buffer],{type:e})}constructor(e){super("File","File"),this.setSource(e)}}let v=function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"video/webm";return new Promise((a,r)=>{try{let i=new FileReader;i.addEventListener("loadend",()=>{try{let r=i.result,s=new C(new Uint8Array(r));s.fixDuration(t)?a(s.toBlob(n)):a(e)}catch(e){r(e)}}),i.addEventListener("error",()=>r()),i.readAsArrayBuffer(e)}catch(e){r(e)}})};function w(e){let[t,n]=(0,c.useState)(!1),[a,r]=(0,c.useState)(0),[i,s]=(0,c.useState)(null),l=(0,c.useRef)(null),u=(0,c.useRef)(null),d=(0,c.useRef)([]),m=(0,c.useRef)(null),y=async()=>{s(null);let t=Date.now();try{l.current||(l.current=await navigator.mediaDevices.getUserMedia({audio:!0}));let a=function(){let e=["audio/webm","audio/mp4","audio/ogg","audio/wav","audio/aac"];for(let t=0;t<e.length;t++)if(MediaRecorder.isTypeSupported(e[t]))return e[t]}(),r=new MediaRecorder(l.current,{mimeType:a});u.current=r,r.addEventListener("dataavailable",async n=>{if(n.data.size>0&&d.current.push(n.data),"inactive"===r.state){let n=Date.now()-t,r=new Blob(d.current,{type:a});"audio/webm"===a&&(r=await v(r,n,r.type)),s(r),e.onRecordingComplete(r),d.current=[]}}),r.start(),n(!0)}catch(e){console.error("Error accessing microphone:",e)}},h=()=>{u.current&&"recording"===u.current.state&&(u.current.stop(),r(0),n(!1))};return(0,c.useEffect)(()=>{if(t){let e=setInterval(()=>{r(e=>e+1)},1e3);return()=>{clearInterval(e)}}return()=>{}},[t]),(0,o.jsxs)("div",{className:"flex flex-col justify-center items-center",children:[(0,o.jsx)("button",{type:"button",className:"m-2 inline-flex justify-center rounded-md border border-transparent px-4 py-2 text-sm font-medium text-white focus:outline-none focus-visible:ring-2 focus-visible:ring-indigo-500 focus-visible:ring-offset-2 transition-all duration-200 ".concat(t?"bg-red-500 hover:bg-red-600":"bg-green-500 hover:bg-green-600"),onClick:()=>{t?h():y()},children:t?"Stop Recording (".concat(p(a),")"):"Start Recording"}),i&&(0,o.jsx)("audio",{className:"w-full",ref:m,controls:!0,children:(0,o.jsx)("source",{src:URL.createObjectURL(i),type:i.type})})]})}function U(e){let{text:t,percentage:n}=e;return n=null!=n?n:0,(0,o.jsx)("div",{className:"mt-0.5 w-full relative text-sm text-white background-bg-cyan-400 bg-gray-200 border-1 border-gray-400 rounded-lg text-left overflow-hidden",children:(0,o.jsxs)("div",{className:"top-0 h-full bg-blue-500 whitespace-nowrap px-2",style:{width:"".concat(n,"%")},children:[t," (","".concat(n.toFixed(2),"%"),")"]})})}function j(e){let{isModelLoading:t,isTranscribing:n,onClick:a,...r}=e;return(0,o.jsx)("button",{...r,onClick:e=>{!a||n||t||a(e)},disabled:n,className:"text-white bg-blue-700 hover:bg-blue-800 focus:ring-4 focus:ring-blue-300 font-medium rounded-lg text-sm px-5 py-2.5 text-center mr-2 dark:bg-blue-600 dark:hover:bg-blue-700 dark:focus:ring-blue-800 inline-flex items-center",children:t?(0,o.jsx)(S,{text:"Loading model..."}):n?(0,o.jsx)(S,{text:"Transcribing..."}):"Transcribe Audio"})}function S(e){return(0,o.jsxs)("div",{role:"status",children:[(0,o.jsxs)("svg",{"aria-hidden":"true",role:"status",className:"inline w-4 h-4 mr-3 text-white animate-spin",viewBox:"0 0 100 101",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[(0,o.jsx)("path",{d:"M100 50.5908C100 78.2051 77.6142 100.591 50 100.591C22.3858 100.591 0 78.2051 0 50.5908C0 22.9766 22.3858 0.59082 50 0.59082C77.6142 0.59082 100 22.9766 100 50.5908ZM9.08144 50.5908C9.08144 73.1895 27.4013 91.5094 50 91.5094C72.5987 91.5094 90.9186 73.1895 90.9186 50.5908C90.9186 27.9921 72.5987 9.67226 50 9.67226C27.4013 9.67226 9.08144 27.9921 9.08144 50.5908Z",fill:"#E5E7EB"}),(0,o.jsx)("path",{d:"M93.9676 39.0409C96.393 38.4038 97.8624 35.9116 97.0079 33.5539C95.2932 28.8227 92.871 24.3692 89.8167 20.348C85.8452 15.1192 80.8826 10.7238 75.2124 7.41289C69.5422 4.10194 63.2754 1.94025 56.7698 1.05124C51.7666 0.367541 46.6976 0.446843 41.7345 1.27873C39.2613 1.69328 37.813 4.19778 38.4501 6.62326C39.0873 9.04874 41.5694 10.4717 44.0505 10.1071C47.8511 9.54855 51.7191 9.52689 55.5402 10.0491C60.8642 10.7766 65.9928 12.5457 70.6331 15.2552C75.2735 17.9648 79.3347 21.5619 82.5849 25.841C84.9175 28.9121 86.7997 32.2913 88.1811 35.8758C89.083 38.2158 91.5421 39.6781 93.9676 39.0409Z",fill:"currentColor"})]}),e.text]})}var T=n(6656),D=n(5988);function B(e){let{show:t,onClose:n,onSubmit:a,title:r,content:i,submitText:s,submitEnabled:l=!0}=e;return(0,o.jsx)(T.u,{appear:!0,show:t,as:c.Fragment,children:(0,o.jsxs)(D.V,{as:"div",className:"relative z-10",onClose:n,children:[(0,o.jsx)(T.u.Child,{as:c.Fragment,enter:"ease-out duration-300",enterFrom:"opacity-0",enterTo:"opacity-100",leave:"ease-in duration-200",leaveFrom:"opacity-100",leaveTo:"opacity-0",children:(0,o.jsx)("div",{className:"fixed inset-0 bg-black bg-opacity-25"})}),(0,o.jsx)("div",{className:"fixed inset-0 overflow-y-auto",children:(0,o.jsx)("div",{className:"flex min-h-full items-center justify-center p-4 text-center",children:(0,o.jsx)(T.u.Child,{as:c.Fragment,enter:"ease-out duration-300",enterFrom:"opacity-0 scale-95",enterTo:"opacity-100 scale-100",leave:"ease-in duration-200",leaveFrom:"opacity-100 scale-100",leaveTo:"opacity-0 scale-95",children:(0,o.jsxs)(D.V.Panel,{className:"w-full max-w-md transform overflow-hidden rounded-2xl bg-white p-6 text-left align-middle shadow-xl transition-all",children:[(0,o.jsx)(D.V.Title,{as:"h3",className:"text-lg font-medium leading-6 text-gray-900",children:r}),(0,o.jsx)("div",{className:"mt-3 text-sm text-gray-500",children:i}),(0,o.jsxs)("div",{className:"mt-4 flex flex-row-reverse",children:[s&&(0,o.jsx)("button",{type:"button",disabled:!l,className:"inline-flex ml-4 justify-center rounded-md border border-transparent ".concat(l?"bg-indigo-600":"bg-grey-300"," px-4 py-2 text-sm font-medium text-indigo-100 ").concat(l?"hover:bg-indigo-500 focus:outline-none focus-visible:ring-2 focus-visible:ring-indigo-500 focus-visible:ring-offset-2":""," transition-all duration-300"),onClick:a,children:s}),(0,o.jsx)("button",{type:"button",className:"inline-flex justify-center rounded-md border border-transparent bg-indigo-100 px-4 py-2 text-sm font-medium text-indigo-900 hover:bg-indigo-200 focus:outline-none focus-visible:ring-2 focus-visible:ring-indigo-500 focus-visible:ring-offset-2 transition-all duration-300",onClick:n,children:"Close"})]})]})})})})]})})}function F(e){return(0,o.jsx)("div",{children:(0,o.jsx)("input",{...e,type:"url",className:"my-2 bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500",placeholder:"www.example.com",required:!0})})}function L(e){return((e=e.toLowerCase()).match(/\w+.?/g)||[]).map(e=>e.charAt(0).toUpperCase()+e.slice(1)).join("")}let N={en:"english",zh:"chinese",de:"german",es:"spanish/castilian",ru:"russian",ko:"korean",fr:"french",ja:"japanese",pt:"portuguese",tr:"turkish",pl:"polish",ca:"catalan/valencian",nl:"dutch/flemish",ar:"arabic",sv:"swedish",it:"italian",id:"indonesian",hi:"hindi",fi:"finnish",vi:"vietnamese",he:"hebrew",uk:"ukrainian",el:"greek",ms:"malay",cs:"czech",ro:"romanian/moldavian/moldovan",da:"danish",hu:"hungarian",ta:"tamil",no:"norwegian",th:"thai",ur:"urdu",hr:"croatian",bg:"bulgarian",lt:"lithuanian",la:"latin",mi:"maori",ml:"malayalam",cy:"welsh",sk:"slovak",te:"telugu",fa:"persian",lv:"latvian",bn:"bengali",sr:"serbian",az:"azerbaijani",sl:"slovenian",kn:"kannada",et:"estonian",mk:"macedonian",br:"breton",eu:"basque",is:"icelandic",hy:"armenian",ne:"nepali",mn:"mongolian",bs:"bosnian",kk:"kazakh",sq:"albanian",sw:"swahili",gl:"galician",mr:"marathi",pa:"punjabi/panjabi",si:"sinhala/sinhalese",km:"khmer",sn:"shona",yo:"yoruba",so:"somali",af:"afrikaans",oc:"occitan",ka:"georgian",be:"belarusian",tg:"tajik",sd:"sindhi",gu:"gujarati",am:"amharic",yi:"yiddish",lo:"lao",uz:"uzbek",fo:"faroese",ht:"haitian creole/haitian",ps:"pashto/pushto",tk:"turkmen",nn:"nynorsk",mt:"maltese",sa:"sanskrit",lb:"luxembourgish/letzeburgesch",my:"myanmar/burmese",bo:"tibetan",tl:"tagalog",mg:"malagasy",as:"assamese",tt:"tatar",haw:"hawaiian",ln:"lingala",ha:"hausa",ba:"bashkir",jw:"javanese",su:"sundanese"};function E(e){let[t,n]=(0,c.useState)(void 0),[a,r]=(0,c.useState)(void 0),[i,s]=(0,c.useState)(void 0),m=void 0!==t,p=()=>{r(void 0),s(void 0)},y=async(e,t)=>{let n=new AudioContext({sampleRate:u.SAMPLING_RATE}),a=URL.createObjectURL(new Blob([e],{type:"audio/*"}));r({buffer:await n.decodeAudioData(e),url:a,source:"URL",mimeType:t})},h=async e=>{p(),n(0);let t=URL.createObjectURL(e),a=new FileReader;a.onprogress=e=>{n(e.loaded/e.total||0)},a.onloadend=async()=>{let i=new AudioContext({sampleRate:u.SAMPLING_RATE}),s=a.result,o=await i.decodeAudioData(s);n(void 0),r({buffer:o,url:t,source:"RECORDING",mimeType:e.type})},a.readAsArrayBuffer(e)},g=async e=>{if(i)try{r(void 0),n(0);let{data:t,headers:a}=await l.Z.get(i,{signal:e.signal,responseType:"arraybuffer",onDownloadProgress(e){n(e.progress||0)}}),s=a["content-type"];s&&"audio/wave"!==s||(s="audio/wav"),y(t,s)}catch(e){console.log("Request failed or aborted",e)}finally{n(void 0)}};return(0,c.useEffect)(()=>{if(i){let e=new AbortController;return g(e),()=>{e.abort()}}},[i]),(0,o.jsxs)(o.Fragment,{children:[(0,o.jsxs)("div",{className:"flex flex-col justify-center items-center rounded-lg bg-white shadow-xl shadow-black/5 ring-1 ring-slate-700/10",children:[(0,o.jsxs)("div",{className:"flex flex-row space-x-2 py-2 w-full px-2",children:[(0,o.jsx)(z,{icon:(0,o.jsx)(G,{}),text:"From URL",onUrlUpdate:t=>{e.transcriber.onInputChange(),s(t)}}),(0,o.jsx)(I,{}),(0,o.jsx)(V,{icon:(0,o.jsx)(H,{}),text:"From file",onFileUpdate:(t,n,a)=>{e.transcriber.onInputChange(),r({buffer:t,url:n,source:"FILE",mimeType:a})}}),navigator.mediaDevices&&(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(I,{}),(0,o.jsx)(q,{icon:(0,o.jsx)(K,{}),text:"Record",setAudioData:t=>{e.transcriber.onInputChange(),h(t)}})]})]}),(0,o.jsx)(M,{progress:m?t:+!!a})]}),a&&(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(d,{audioUrl:a.url,mimeType:a.mimeType}),(0,o.jsxs)("div",{className:"relative w-full flex justify-center items-center",children:[(0,o.jsx)(j,{onClick:()=>{e.transcriber.start(a.buffer)},isModelLoading:e.transcriber.isModelLoading,isTranscribing:e.transcriber.isBusy}),(0,o.jsx)(A,{className:"absolute right-4",transcriber:e.transcriber,icon:(0,o.jsx)(Z,{})})]}),e.transcriber.progressItems.length>0&&(0,o.jsxs)("div",{className:"relative z-10 p-4 w-full",children:[(0,o.jsx)("label",{children:"Loading model files... (only run once)"}),e.transcriber.progressItems.map(e=>(0,o.jsx)("div",{children:(0,o.jsx)(U,{text:e.file,percentage:e.progress})},e.file))]})]})]})}function A(e){let[t,n]=(0,c.useState)(!1),a=()=>{n(!1)};return(0,o.jsxs)("div",{className:e.className,children:[(0,o.jsx)(W,{icon:e.icon,onClick:()=>{n(!0)}}),(0,o.jsx)(R,{show:t,onSubmit:e=>{a()},onClose:a,transcriber:e.transcriber})]})}function R(e){let t=Object.values(N).map(L),n={"huuquyet/PhoWhisper-tiny":[43,154],"huuquyet/PhoWhisper-base":[75,285],"huuquyet/PhoWhisper-small":[250,970],"huuquyet/PhoWhisper-medium":[776],"huuquyet/PhoWhisper-large":[3139],"Xenova/whisper-tiny":[41,152],"Xenova/whisper-base":[77,291]};return(0,o.jsx)(B,{show:e.show,title:"Settings",content:(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)("label",{children:"Select the model to use."}),(0,o.jsx)("select",{className:"mt-1 mb-1 bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500",defaultValue:e.transcriber.model,onChange:t=>{e.transcriber.setModel(t.target.value)},children:Object.keys(n).filter(t=>e.transcriber.quantized||2===n[t].length).filter(t=>!e.transcriber.multilingual||!t.startsWith("distil-whisper/")).map(t=>(0,o.jsx)("option",{value:t,children:"".concat(t).concat(e.transcriber.multilingual||t.startsWith("distil-whisper/")||t.startsWith("huuquyet")?"":".en"," (").concat(n[t][e.transcriber.quantized?0:1],"MB)")},t))}),(0,o.jsxs)("div",{className:"flex justify-between items-center mb-3 px-1",children:[(0,o.jsxs)("div",{className:"flex",children:[(0,o.jsx)("input",{id:"multilingual",type:"checkbox",checked:e.transcriber.multilingual,onChange:t=>{e.transcriber.setMultilingual(t.target.checked)}}),(0,o.jsx)("label",{htmlFor:"multilingual",className:"ms-1",children:"Multilingual"})]}),(0,o.jsxs)("div",{className:"flex",children:[(0,o.jsx)("input",{id:"quantize",type:"checkbox",checked:e.transcriber.quantized,onChange:t=>{e.transcriber.setQuantized(t.target.checked)}}),(0,o.jsx)("label",{htmlFor:"quantize",className:"ms-1",children:"Quantized"})]})]}),e.transcriber.multilingual&&(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)("label",{children:"Select the source language."}),(0,o.jsx)("select",{className:"mt-1 mb-3 bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500",defaultValue:e.transcriber.language,onChange:t=>{e.transcriber.setLanguage(t.target.value)},children:Object.keys(N).map((e,n)=>(0,o.jsx)("option",{value:e,children:t[n]},e))}),(0,o.jsx)("label",{children:"Select the task to perform."}),(0,o.jsxs)("select",{className:"mt-1 mb-3 bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500",defaultValue:e.transcriber.subtask,onChange:t=>{e.transcriber.setSubtask(t.target.value)},children:[(0,o.jsx)("option",{value:"transcribe",children:"Transcribe"}),(0,o.jsx)("option",{value:"translate",children:"Translate (to Vietnamese)"})]})]})]}),onClose:e.onClose,onSubmit:()=>{}})}function I(){return(0,o.jsx)("div",{className:"w-[1px] bg-slate-200"})}function M(e){return(0,o.jsx)(P,{progress:"".concat(Math.round(100*e.progress),"%")})}function P(e){return(0,o.jsx)("div",{className:"w-full bg-gray-200 rounded-full h-1 dark:bg-gray-700",children:(0,o.jsx)("div",{className:"bg-blue-600 h-1 rounded-full transition-all duration-100",style:{width:e.progress}})})}function z(e){let[t,n]=(0,c.useState)(!1),a=()=>{n(!1)};return(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(W,{icon:e.icon,text:e.text,onClick:()=>{n(!0)}}),(0,o.jsx)(O,{show:t,onSubmit:t=>{e.onUrlUpdate(t),a()},onClose:a})]})}function O(e){let[t,n]=(0,c.useState)(u.DEFAULT_AUDIO_URL);return(0,o.jsx)(B,{show:e.show,title:"From URL",content:(0,o.jsxs)(o.Fragment,{children:["Enter the URL of the audio file you want to load.",(0,o.jsx)(F,{onChange:e=>{n(e.target.value)},value:t})]}),onClose:e.onClose,submitText:"Load",onSubmit:()=>{e.onSubmit(t)}})}function V(e){let t=document.createElement("input");return t.type="file",t.oninput=n=>{let a=n.target.files;if(!a)return;let r=URL.createObjectURL(a[0]),i=a[0].type,s=new FileReader;s.addEventListener("load",async t=>{var n;let a=null===(n=t.target)||void 0===n?void 0:n.result;if(!a)return;let s=new AudioContext({sampleRate:u.SAMPLING_RATE}),o=await s.decodeAudioData(a);e.onFileUpdate(o,r,i)}),s.readAsArrayBuffer(a[0]),t.value=""},(0,o.jsx)(o.Fragment,{children:(0,o.jsx)(W,{icon:e.icon,text:e.text,onClick:()=>t.click()})})}function q(e){let[t,n]=(0,c.useState)(!1),a=()=>{n(!1)};return(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(W,{icon:e.icon,text:e.text,onClick:()=>{n(!0)}}),(0,o.jsx)(_,{show:t,onSubmit:t=>{t&&(e.setAudioData(t),a())},onClose:a})]})}function _(e){let[t,n]=(0,c.useState)();return(0,o.jsx)(B,{show:e.show,title:"From Recording",content:(0,o.jsxs)(o.Fragment,{children:["Record audio using your microphone",(0,o.jsx)(w,{onRecordingComplete:e=>{n(e)}})]}),onClose:()=>{e.onClose(),n(void 0)},submitText:"Load",submitEnabled:void 0!==t,onSubmit:()=>{e.onSubmit(t),n(void 0)}})}function W(e){return(0,o.jsxs)("button",{type:"button",onClick:e.onClick,className:"flex items-center justify-center rounded-lg p-2 bg-blue text-slate-500 hover:text-indigo-600 hover:bg-indigo-50 transition-all duration-200",children:[(0,o.jsx)("div",{className:"w-7 h-7",children:e.icon}),e.text&&(0,o.jsx)("div",{className:"ml-2 break-text text-center text-md w-30",children:e.text})]})}function G(){return(0,o.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:"1.5",stroke:"currentColor",children:(0,o.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M13.19 8.688a4.5 4.5 0 011.242 7.244l-4.5 4.5a4.5 4.5 0 01-6.364-6.364l1.757-1.757m13.35-.622l1.757-1.757a4.5 4.5 0 00-6.364-6.364l-4.5 4.5a4.5 4.5 0 001.242 7.244"})})}function H(){return(0,o.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:"1.5",stroke:"currentColor",children:(0,o.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M3.75 9.776c.112-.017.227-.026.344-.026h15.812c.117 0 .232.009.344.026m-16.5 0a2.25 2.25 0 00-1.883 2.542l.857 6a2.25 2.25 0 002.227 1.932H19.05a2.25 2.25 0 002.227-1.932l.857-6a2.25 2.25 0 00-1.883-2.542m-16.5 0V6A2.25 2.25 0 016 3.75h3.879a1.5 1.5 0 011.06.44l2.122 2.12a1.5 1.5 0 001.06.44H18A2.25 2.25 0 0120.25 9v.776"})})}function Z(){return(0,o.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:"1.25",stroke:"currentColor",children:[(0,o.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M9.594 3.94c.09-.542.56-.94 1.11-.94h2.593c.55 0 1.02.398 1.11.94l.213 1.281c.063.374.313.686.645.87.074.04.147.083.22.127.324.196.72.257 1.075.124l1.217-.456a1.125 1.125 0 011.37.49l1.296 2.247a1.125 1.125 0 01-.26 1.431l-1.003.827c-.293.24-.438.613-.431.992a6.759 6.759 0 010 .255c-.007.378.138.75.43.99l1.005.828c.424.35.534.954.26 1.43l-1.298 2.247a1.125 1.125 0 01-1.369.491l-1.217-.456c-.355-.133-.75-.072-1.076.124a6.57 6.57 0 01-.22.128c-.331.183-.581.495-.644.869l-.213 1.28c-.09.543-.56.941-1.11.941h-2.594c-.55 0-1.02-.398-1.11-.94l-.213-1.281c-.062-.374-.312-.686-.644-.87a6.52 6.52 0 01-.22-.127c-.325-.196-.72-.257-1.076-.124l-1.217.456a1.125 1.125 0 01-1.369-.49l-1.297-2.247a1.125 1.125 0 01.26-1.431l1.004-.827c.292-.24.437-.613.43-.992a6.932 6.932 0 010-.255c.007-.378-.138-.75-.43-.99l-1.004-.828a1.125 1.125 0 01-.26-1.43l1.297-2.247a1.125 1.125 0 011.37-.491l1.216.456c.356.133.751.072 1.076-.124.072-.044.146-.087.22-.128.332-.183.582-.495.644-.869l.214-1.281z"}),(0,o.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M15 12a3 3 0 11-6 0 3 3 0 016 0z"})]})}function K(){return(0,o.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",children:(0,o.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 18.75a6 6 0 006-6v-1.5m-6 7.5a6 6 0 01-6-6v-1.5m6 7.5v3.75m-3.75 0h7.5M12 15.75a3 3 0 01-3-3V4.5a3 3 0 116 0v8.25a3 3 0 01-3 3z"})})}function J(e){var t;let{transcribedData:n}=e,a=(0,c.useRef)(null),r=(e,t)=>{let n=URL.createObjectURL(e),a=document.createElement("a");a.href=n,a.download=t,a.click(),URL.revokeObjectURL(n)};return(0,c.useEffect)(()=>{a.current&&64>=Math.abs(a.current.offsetHeight+a.current.scrollTop-a.current.scrollHeight)&&(a.current.scrollTop=a.current.scrollHeight)}),(0,o.jsxs)("div",{ref:a,className:"w-full flex flex-col my-2 p-4 max-h-[20rem] overflow-y-auto",children:[null==n?void 0:null===(t=n.chunks)||void 0===t?void 0:t.map((e,t)=>(0,o.jsxs)("div",{className:"w-full flex flex-row mb-2 bg-white rounded-lg p-4 shadow-xl shadow-black/5 ring-1 ring-slate-700/10",children:[(0,o.jsx)("div",{className:"mr-5",children:p(e.timestamp[0])}),e.text]},"".concat(t,"-").concat(e.text))),n&&!n.isBusy&&(0,o.jsxs)("div",{className:"w-full text-right",children:[(0,o.jsx)("button",{type:"button",onClick:()=>{var e;r(new Blob([(null!==(e=null==n?void 0:n.chunks)&&void 0!==e?e:[]).map(e=>e.text).join("").trim()],{type:"text/plain"}),"transcript.txt")},className:"text-white bg-green-500 hover:bg-green-600 focus:ring-4 focus:ring-green-300 font-medium rounded-lg text-sm px-4 py-2 text-center mr-2 dark:bg-green-600 dark:hover:bg-green-700 dark:focus:ring-green-800 inline-flex items-center",children:"Export TXT"}),(0,o.jsx)("button",{type:"button",onClick:()=>{var e;let t=JSON.stringify(null!==(e=null==n?void 0:n.chunks)&&void 0!==e?e:[],null,2);r(new Blob([t=t.replace(/( {4}"timestamp": )\[\s+(\S+)\s+(\S+)\s+\]/gm,"$1[$2 $3]")],{type:"application/json"}),"transcript.json")},className:"text-white bg-green-500 hover:bg-green-600 focus:ring-4 focus:ring-green-300 font-medium rounded-lg text-sm px-4 py-2 text-center mr-2 dark:bg-green-600 dark:hover:bg-green-700 dark:focus:ring-green-800 inline-flex items-center",children:"Export JSON"})]})]})}function Q(){let e=function(){let[e,t]=(0,c.useState)(void 0),[a,r]=(0,c.useState)(!1),[i,s]=(0,c.useState)(!1),[o,l]=(0,c.useState)([]),d=function(e){let[t]=(0,c.useState)(()=>(function(e){let t=new Worker(n.tu(new URL(n.p+n.u(724),n.b)),{type:void 0});return t.addEventListener("message",e),t})(e));return t}(e=>{let n=e.data;switch(n.status){case"progress":l(e=>e.map(e=>e.file===n.file?{...e,progress:n.progress}:e));break;case"update":t({isBusy:!0,text:n.data[0],chunks:n.data[1].chunks});break;case"complete":t({isBusy:!1,text:n.data.text,chunks:n.data.chunks}),r(!1);break;case"initiate":s(!0),l(e=>[...e,n]);break;case"ready":s(!1);break;case"error":r(!1),alert("".concat(n.data.message," This is most likely because you are using Safari on an M1/M2 Mac. Please try again from Chrome, Firefox, or Edge.\n\nIf this is not the case, please file a bug report."));break;case"done":l(e=>e.filter(e=>e.file!==n.file))}}),[m,p]=(0,c.useState)(u.DEFAULT_MODEL),[y,h]=(0,c.useState)(u.DEFAULT_SUBTASK),[g,f]=(0,c.useState)(u.DEFAULT_QUANTIZED),[b,x]=(0,c.useState)(u.DEFAULT_MULTILINGUAL),[k,C]=(0,c.useState)(u.DEFAULT_LANGUAGE),v=(0,c.useCallback)(()=>{t(void 0)},[]),w=(0,c.useCallback)(async e=>{if(e){let n;if(t(void 0),r(!0),2===e.numberOfChannels){let t=Math.sqrt(2),a=e.getChannelData(0),r=e.getChannelData(1);n=new Float32Array(a.length);for(let i=0;i<e.length;++i)n[i]=t*(a[i]+r[i])/2}else n=e.getChannelData(0);d.postMessage({audio:n,model:m,multilingual:b,quantized:g,subtask:b?y:null,language:b&&"auto"!==k?k:null})}},[d,m,b,g,y,k]);return(0,c.useMemo)(()=>({onInputChange:v,isBusy:a,isModelLoading:i,progressItems:o,start:w,output:e,model:m,setModel:p,multilingual:b,setMultilingual:x,quantized:g,setQuantized:f,subtask:y,setSubtask:h,language:k,setLanguage:C}),[a,i,o,w,e,m,b,g,y,k])}();return(0,o.jsxs)("div",{className:"flex justify-center items-center min-h-screen",children:[(0,o.jsxs)("div",{className:"container flex flex-col justify-center items-center",children:[(0,o.jsx)("h1",{className:"text-5xl font-extrabold tracking-tight text-slate-900 sm:text-7xl text-center",children:"PhoWhisper Web"}),(0,o.jsx)("h2",{className:"mt-3 mb-5 px-4 text-center text-1xl font-semibold tracking-tight text-slate-900 sm:text-2xl",children:"ML-powered speech recognition for Vietnamese directly in your browser"}),(0,o.jsx)(E,{transcriber:e}),(0,o.jsx)(J,{transcribedData:e.output})]}),(0,o.jsxs)("div",{className:"absolute bottom-4",children:["Made with"," ",(0,o.jsx)("a",{className:"underline",href:"https://github.com/xenova/transformers.js",children:"\uD83E\uDD17 Transformers.js"})," ","+ Next.js"," ",(0,o.jsx)("a",{className:"underline",href:"https://github.com/huuquyet/PhoWhisper-next",children:"Give it a βοΈ"})]})]})}(i=s||(s={})).URL="URL",i.FILE="FILE",i.RECORDING="RECORDING"}},function(e){e.O(0,[332,849,371,925,744],function(){return e(e.s=8336)}),_N_E=e.O()}]);
|
|
|
|
_next/static/chunks/app/page-8d8ca48a7333bb5c.js
ADDED
@@ -0,0 +1 @@
|
|
|
|
|
1 |
+
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[931],{6972:function(e,t,n){Promise.resolve().then(n.bind(n,912)),Promise.resolve().then(n.bind(n,1481)),Promise.resolve().then(n.bind(n,4543))},4543:function(e,t,n){"use strict";let a;n.r(t),n.d(t,{default:function(){return Q}});var r,i,s,o=n(7437),l=n(8472),c=n(2265),u={SAMPLING_RATE:16e3,DEFAULT_AUDIO_URL:"https://huggingface.co/spaces/huuquyet/PhoWhisper-next/resolve/main/demo.flac",DEFAULT_MODEL:"huuquyet/PhoWhisper-tiny",DEFAULT_SUBTASK:"transcribe",DEFAULT_LANGUAGE:"vietnamese",DEFAULT_QUANTIZED:(a=!1,r=navigator.userAgent||navigator.vendor||("opera"in window&&"string"==typeof window.opera?window.opera:""),(/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino|android|ipad|playbook|silk/i.test(r)||/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\-|your|zeto|zte\-/i.test(r.substr(0,4)))&&(a=!0),a),DEFAULT_MULTILINGUAL:!1};function d(e){let t=(0,c.useRef)(null),n=(0,c.useRef)(null);return(0,c.useEffect)(()=>{t.current&&n.current&&(n.current.src=e.audioUrl,t.current.load())},[e.audioUrl]),(0,o.jsx)("div",{className:"flex relative z-10 p-4 w-full",children:(0,o.jsx)("audio",{ref:t,controls:!0,className:"w-full h-14 rounded-lg bg-white shadow-xl shadow-black/5 ring-1 ring-slate-700/10",children:(0,o.jsx)("source",{ref:n,type:e.mimeType})})})}function m(e){return String(e).padStart(2,"0")}function p(e){let t=e/3600|0,n=(e-=3600*t)/60|0,a=0|(e-=60*n);return"".concat(t?"".concat(m(t),":"):"").concat(m(n),":").concat(m(a))}var y=n(7431);let h={172351395:{name:"EBML",type:"Container"},646:{name:"EBMLVersion",type:"Uint"},759:{name:"EBMLReadVersion",type:"Uint"},754:{name:"EBMLMaxIDLength",type:"Uint"},755:{name:"EBMLMaxSizeLength",type:"Uint"},642:{name:"DocType",type:"String"},647:{name:"DocTypeVersion",type:"Uint"},645:{name:"DocTypeReadVersion",type:"Uint"},108:{name:"Void",type:"Binary"},63:{name:"CRC-32",type:"Binary"},190023271:{name:"SignatureSlot",type:"Container"},16010:{name:"SignatureAlgo",type:"Uint"},16026:{name:"SignatureHash",type:"Uint"},16037:{name:"SignaturePublicKey",type:"Binary"},16053:{name:"Signature",type:"Binary"},15963:{name:"SignatureElements",type:"Container"},15995:{name:"SignatureElementList",type:"Container"},9522:{name:"SignedElement",type:"Binary"},139690087:{name:"Segment",type:"Container"},21863284:{name:"SeekHead",type:"Container"},3515:{name:"Seek",type:"Container"},5035:{name:"SeekID",type:"Binary"},5036:{name:"SeekPosition",type:"Uint"},88713574:{name:"Info",type:"Container"},13220:{name:"SegmentUID",type:"Binary"},13188:{name:"SegmentFilename",type:"String"},1882403:{name:"PrevUID",type:"Binary"},1868715:{name:"PrevFilename",type:"String"},2013475:{name:"NextUID",type:"Binary"},1999803:{name:"NextFilename",type:"String"},1092:{name:"SegmentFamily",type:"Binary"},10532:{name:"ChapterTranslate",type:"Container"},10748:{name:"ChapterTranslateEditionUID",type:"Uint"},10687:{name:"ChapterTranslateCodec",type:"Uint"},10661:{name:"ChapterTranslateID",type:"Binary"},710577:{name:"TimecodeScale",type:"Uint"},1161:{name:"Duration",type:"Float"},1121:{name:"DateUTC",type:"Date"},15273:{name:"Title",type:"String"},3456:{name:"MuxingApp",type:"String"},5953:{name:"WritingApp",type:"String"},103:{name:"Timecode",type:"Uint"},6228:{name:"SilentTracks",type:"Container"},6359:{name:"SilentTrackNumber",type:"Uint"},39:{name:"Position",type:"Uint"},43:{name:"PrevSize",type:"Uint"},35:{name:"SimpleBlock",type:"Binary"},32:{name:"BlockGroup",type:"Container"},33:{name:"Block",type:"Binary"},34:{name:"BlockVirtual",type:"Binary"},13729:{name:"BlockAdditions",type:"Container"},38:{name:"BlockMore",type:"Container"},110:{name:"BlockAddID",type:"Uint"},37:{name:"BlockAdditional",type:"Binary"},27:{name:"BlockDuration",type:"Uint"},122:{name:"ReferencePriority",type:"Uint"},123:{name:"ReferenceBlock",type:"Int"},125:{name:"ReferenceVirtual",type:"Int"},36:{name:"CodecState",type:"Binary"},13730:{name:"DiscardPadding",type:"Int"},14:{name:"Slices",type:"Container"},104:{name:"TimeSlice",type:"Container"},76:{name:"LaceNumber",type:"Uint"},77:{name:"FrameNumber",type:"Uint"},75:{name:"BlockAdditionID",type:"Uint"},78:{name:"Delay",type:"Uint"},79:{name:"SliceDuration",type:"Uint"},72:{name:"ReferenceFrame",type:"Container"},73:{name:"ReferenceOffset",type:"Uint"},74:{name:"ReferenceTimeCode",type:"Uint"},47:{name:"EncryptedBlock",type:"Binary"},106212971:{name:"Tracks",type:"Container"},46:{name:"TrackEntry",type:"Container"},87:{name:"TrackNumber",type:"Uint"},13253:{name:"TrackUID",type:"Uint"},3:{name:"TrackType",type:"Uint"},57:{name:"FlagEnabled",type:"Uint"},8:{name:"FlagDefault",type:"Uint"},5546:{name:"FlagForced",type:"Uint"},28:{name:"FlagLacing",type:"Uint"},11751:{name:"MinCache",type:"Uint"},11768:{name:"MaxCache",type:"Uint"},254851:{name:"DefaultDuration",type:"Uint"},216698:{name:"DefaultDecodedFieldDuration",type:"Uint"},209231:{name:"TrackTimecodeScale",type:"Float"},4991:{name:"TrackOffset",type:"Int"},5614:{name:"MaxBlockAdditionID",type:"Uint"},4974:{name:"Name",type:"String"},177564:{name:"Language",type:"String"},6:{name:"CodecID",type:"String"},9122:{name:"CodecPrivate",type:"Binary"},362120:{name:"CodecName",type:"String"},13382:{name:"AttachmentLink",type:"Uint"},1742487:{name:"CodecSettings",type:"String"},1785920:{name:"CodecInfoURL",type:"String"},438848:{name:"CodecDownloadURL",type:"String"},42:{name:"CodecDecodeAll",type:"Uint"},12203:{name:"TrackOverlay",type:"Uint"},5802:{name:"CodecDelay",type:"Uint"},5819:{name:"SeekPreRoll",type:"Uint"},9764:{name:"TrackTranslate",type:"Container"},9980:{name:"TrackTranslateEditionUID",type:"Uint"},9919:{name:"TrackTranslateCodec",type:"Uint"},9893:{name:"TrackTranslateTrackID",type:"Binary"},96:{name:"Video",type:"Container"},26:{name:"FlagInterlaced",type:"Uint"},5048:{name:"StereoMode",type:"Uint"},5056:{name:"AlphaMode",type:"Uint"},5049:{name:"OldStereoMode",type:"Uint"},48:{name:"PixelWidth",type:"Uint"},58:{name:"PixelHeight",type:"Uint"},5290:{name:"PixelCropBottom",type:"Uint"},5307:{name:"PixelCropTop",type:"Uint"},5324:{name:"PixelCropLeft",type:"Uint"},5341:{name:"PixelCropRight",type:"Uint"},5296:{name:"DisplayWidth",type:"Uint"},5306:{name:"DisplayHeight",type:"Uint"},5298:{name:"DisplayUnit",type:"Uint"},5299:{name:"AspectRatioType",type:"Uint"},963876:{name:"ColourSpace",type:"Binary"},1029411:{name:"GammaValue",type:"Float"},230371:{name:"FrameRate",type:"Float"},97:{name:"Audio",type:"Container"},53:{name:"SamplingFrequency",type:"Float"},14517:{name:"OutputSamplingFrequency",type:"Float"},31:{name:"Channels",type:"Uint"},15739:{name:"ChannelPositions",type:"Binary"},8804:{name:"BitDepth",type:"Uint"},98:{name:"TrackOperation",type:"Container"},99:{name:"TrackCombinePlanes",type:"Container"},100:{name:"TrackPlane",type:"Container"},101:{name:"TrackPlaneUID",type:"Uint"},102:{name:"TrackPlaneType",type:"Uint"},105:{name:"TrackJoinBlocks",type:"Container"},109:{name:"TrackJoinUID",type:"Uint"},64:{name:"TrickTrackUID",type:"Uint"},65:{name:"TrickTrackSegmentUID",type:"Binary"},70:{name:"TrickTrackFlag",type:"Uint"},71:{name:"TrickMasterTrackUID",type:"Uint"},68:{name:"TrickMasterTrackSegmentUID",type:"Binary"},11648:{name:"ContentEncodings",type:"Container"},8768:{name:"ContentEncoding",type:"Container"},4145:{name:"ContentEncodingOrder",type:"Uint"},4146:{name:"ContentEncodingScope",type:"Uint"},4147:{name:"ContentEncodingType",type:"Uint"},4148:{name:"ContentCompression",type:"Container"},596:{name:"ContentCompAlgo",type:"Uint"},597:{name:"ContentCompSettings",type:"Binary"},4149:{name:"ContentEncryption",type:"Container"},2017:{name:"ContentEncAlgo",type:"Uint"},2018:{name:"ContentEncKeyID",type:"Binary"},2019:{name:"ContentSignature",type:"Binary"},2020:{name:"ContentSigKeyID",type:"Binary"},2021:{name:"ContentSigAlgo",type:"Uint"},2022:{name:"ContentSigHashAlgo",type:"Uint"},206814059:{name:"Cues",type:"Container"},59:{name:"CuePoint",type:"Container"},51:{name:"CueTime",type:"Uint"},55:{name:"CueTrackPositions",type:"Container"},119:{name:"CueTrack",type:"Uint"},113:{name:"CueClusterPosition",type:"Uint"},112:{name:"CueRelativePosition",type:"Uint"},50:{name:"CueDuration",type:"Uint"},4984:{name:"CueBlockNumber",type:"Uint"},106:{name:"CueCodecState",type:"Uint"},91:{name:"CueReference",type:"Container"},22:{name:"CueRefTime",type:"Uint"},23:{name:"CueRefCluster",type:"Uint"},4959:{name:"CueRefNumber",type:"Uint"},107:{name:"CueRefCodecState",type:"Uint"},155296873:{name:"Attachments",type:"Container"},8615:{name:"AttachedFile",type:"Container"},1662:{name:"FileDescription",type:"String"},1646:{name:"FileName",type:"String"},1632:{name:"FileMimeType",type:"String"},1628:{name:"FileData",type:"Binary"},1710:{name:"FileUID",type:"Uint"},1653:{name:"FileReferral",type:"Binary"},1633:{name:"FileUsedStartTime",type:"Uint"},1634:{name:"FileUsedEndTime",type:"Uint"},4433776:{name:"Chapters",type:"Container"},1465:{name:"EditionEntry",type:"Container"},1468:{name:"EditionUID",type:"Uint"},1469:{name:"EditionFlagHidden",type:"Uint"},1499:{name:"EditionFlagDefault",type:"Uint"},1501:{name:"EditionFlagOrdered",type:"Uint"},54:{name:"ChapterAtom",type:"Container"},13252:{name:"ChapterUID",type:"Uint"},5716:{name:"ChapterStringUID",type:"String"},17:{name:"ChapterTimeStart",type:"Uint"},18:{name:"ChapterTimeEnd",type:"Uint"},24:{name:"ChapterFlagHidden",type:"Uint"},1432:{name:"ChapterFlagEnabled",type:"Uint"},11879:{name:"ChapterSegmentUID",type:"Binary"},11964:{name:"ChapterSegmentEditionUID",type:"Uint"},9155:{name:"ChapterPhysicalEquiv",type:"Uint"},15:{name:"ChapterTrack",type:"Container"},9:{name:"ChapterTrackNumber",type:"Uint"},0:{name:"ChapterDisplay",type:"Container"},5:{name:"ChapString",type:"String"},892:{name:"ChapLanguage",type:"String"},894:{name:"ChapCountry",type:"String"},10564:{name:"ChapProcess",type:"Container"},10581:{name:"ChapProcessCodecID",type:"Uint"},1293:{name:"ChapProcessPrivate",type:"Binary"},10513:{name:"ChapProcessCommand",type:"Container"},10530:{name:"ChapProcessTime",type:"Uint"},10547:{name:"ChapProcessData",type:"Binary"},39109479:{name:"Tags",type:"Container"},13171:{name:"Tag",type:"Container"},9152:{name:"Targets",type:"Container"},10442:{name:"TargetTypeValue",type:"Uint"},9162:{name:"TargetType",type:"String"},9157:{name:"TagTrackUID",type:"Uint"},9161:{name:"TagEditionUID",type:"Uint"},9156:{name:"TagChapterUID",type:"Uint"},9158:{name:"TagAttachmentUID",type:"Uint"},10184:{name:"SimpleTag",type:"Container"},1443:{name:"TagName",type:"String"},1146:{name:"TagLanguage",type:"String"},1156:{name:"TagDefault",type:"Uint"},1159:{name:"TagString",type:"String"},1157:{name:"TagBinary",type:"Binary"}};class g{updateBySource(){}setSource(e){this.source=e,this.updateBySource()}updateByData(){}setData(e){this.data=e,this.updateByData()}constructor(e="Unknown",t="Unknown"){(0,y._)(this,"name",void 0),(0,y._)(this,"type",void 0),(0,y._)(this,"source",void 0),(0,y._)(this,"data",void 0),this.name=e,this.type=t}}class f extends g{updateBySource(){this.data="";for(let e=0;e<this.source.length;e++){let t=this.source[e].toString(16);this.data+=b(t)}}updateByData(){let e=this.data.length/2;this.source=new Uint8Array(e);for(let t=0;t<e;t++){let e=this.data.substr(2*t,2);this.source[t]=Number.parseInt(e,16)}}getValue(){return Number.parseInt(this.data,16)}setValue(e){this.setData(b(e.toString(16)))}constructor(e,t){super(e,t||"Uint")}}function b(e){return e.length%2==1?"0".concat(e):e}class x extends g{getFloatArrayType(){return this.source&&4===this.source.length?Float32Array:Float64Array}updateBySource(){let e=this.source.reverse(),t=new(this.getFloatArrayType())(e.buffer);this.data=t[0]}updateByData(){let e=new Uint8Array(new(this.getFloatArrayType())([this.data]).buffer);this.source=e.reverse()}getValue(){return this.data}setValue(e){this.setData(e)}constructor(e,t){super(e,t||"Float")}}class k extends g{readByte(){return this.source[this.offset++]}readUint(){let e=this.readByte(),t=8-e.toString(2).length,n=e-(1<<7-t);for(let e=0;e<t;e++)n*=256,n+=this.readByte();return n}updateBySource(){let e;for(this.data=[],this.offset=0;this.offset<this.source.length;this.offset=e){let t=this.readUint(),n=this.readUint();e=Math.min(this.offset+n,this.source.length);let a=this.source.slice(this.offset,e),r=h[t]||{name:"Unknown",type:"Unknown"},i=g;switch(r.type){case"Container":i=k;break;case"Uint":i=f;break;case"Float":i=x}let s=new i(r.name,r.type);s.setSource(a),this.data.push({id:t,idHex:t.toString(16),data:s})}}writeUint(e){let t,n,a=arguments.length>1&&void 0!==arguments[1]&&arguments[1];for(t=1,n=128;e>=n&&t<8;t++,n*=128);if(!a){let a=n+e;for(let e=t-1;e>=0;e--){let t=a%256;this.source[this.offset+e]=t,a=(a-t)/256}}this.offset+=t}writeSections(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];this.offset=0;for(let t=0;t<this.data.length;t++){let n=this.data[t],a=n.data.source,r=a.length;this.writeUint(n.id,e),this.writeUint(r,e),e||this.source.set(a,this.offset),this.offset+=r}return this.offset}updateByData(){let e=this.writeSections(!0);this.source=new Uint8Array(e),this.writeSections()}getSectionById(e){for(let t=0;t<this.data.length;t++){let n=this.data[t];if(n.id===e)return n.data}}constructor(e,t){super(e,t||"Container"),(0,y._)(this,"offset",0),(0,y._)(this,"data",[])}}class C extends k{fixDuration(e){let t=this.getSectionById(139690087);if(!t)return!1;let n=t.getSectionById(88713574);if(!n)return!1;let a=n.getSectionById(710577);if(!a)return!1;let r=n.getSectionById(1161);if(r){if(!(0>=r.getValue()))return!1;r.setValue(e)}else(r=new x("Duration","Float")).setValue(e),n.data.push({id:1161,data:r});return a.setValue(1e6),n.updateByData(),t.updateByData(),this.updateByData(),!0}toBlob(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"video/webm";return new Blob([this.source.buffer],{type:e})}constructor(e){super("File","File"),this.setSource(e)}}let v=function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"video/webm";return new Promise((a,r)=>{try{let i=new FileReader;i.addEventListener("loadend",()=>{try{let r=i.result,s=new C(new Uint8Array(r));s.fixDuration(t)?a(s.toBlob(n)):a(e)}catch(e){r(e)}}),i.addEventListener("error",()=>r()),i.readAsArrayBuffer(e)}catch(e){r(e)}})};function U(e){let[t,n]=(0,c.useState)(!1),[a,r]=(0,c.useState)(0),[i,s]=(0,c.useState)(null),l=(0,c.useRef)(null),u=(0,c.useRef)(null),d=(0,c.useRef)([]),m=(0,c.useRef)(null),y=async()=>{s(null);let t=Date.now();try{l.current||(l.current=await navigator.mediaDevices.getUserMedia({audio:!0}));let a=function(){let e=["audio/webm","audio/mp4","audio/ogg","audio/wav","audio/aac"];for(let t=0;t<e.length;t++)if(MediaRecorder.isTypeSupported(e[t]))return e[t]}(),r=new MediaRecorder(l.current,{mimeType:a});u.current=r,r.addEventListener("dataavailable",async n=>{if(n.data.size>0&&d.current.push(n.data),"inactive"===r.state){let n=Date.now()-t,r=new Blob(d.current,{type:a});"audio/webm"===a&&(r=await v(r,n,r.type)),s(r),e.onRecordingComplete(r),d.current=[]}}),r.start(),n(!0)}catch(e){console.error("Error accessing microphone:",e)}},h=()=>{u.current&&"recording"===u.current.state&&(u.current.stop(),r(0),n(!1))};return(0,c.useEffect)(()=>{if(t){let e=setInterval(()=>{r(e=>e+1)},1e3);return()=>{clearInterval(e)}}return()=>{}},[t]),(0,o.jsxs)("div",{className:"flex flex-col justify-center items-center",children:[(0,o.jsx)("button",{type:"button",className:"m-2 inline-flex justify-center rounded-md border border-transparent px-4 py-2 text-sm font-medium text-white focus:outline-none focus-visible:ring-2 focus-visible:ring-indigo-500 focus-visible:ring-offset-2 transition-all duration-200 ".concat(t?"bg-red-500 hover:bg-red-600":"bg-green-500 hover:bg-green-600"),onClick:()=>{t?h():y()},children:t?"Stop Recording (".concat(p(a),")"):"Start Recording"}),i&&(0,o.jsx)("audio",{className:"w-full",ref:m,controls:!0,children:(0,o.jsx)("source",{src:URL.createObjectURL(i),type:i.type})})]})}function w(e){let{text:t,percentage:n}=e;return n=null!=n?n:0,(0,o.jsx)("div",{className:"mt-0.5 w-full relative text-sm text-white background-bg-cyan-400 bg-gray-200 border-1 border-gray-400 rounded-lg text-left overflow-hidden",children:(0,o.jsxs)("div",{className:"top-0 h-full bg-blue-500 whitespace-nowrap px-2",style:{width:"".concat(n,"%")},children:[t," (","".concat(n.toFixed(2),"%"),")"]})})}function j(e){let{isModelLoading:t,isTranscribing:n,onClick:a,...r}=e;return(0,o.jsx)("button",{...r,onClick:e=>{!a||n||t||a(e)},disabled:n,className:"text-white bg-blue-700 hover:bg-blue-800 focus:ring-4 focus:ring-blue-300 font-medium rounded-lg text-sm px-5 py-2.5 text-center mr-2 dark:bg-blue-600 dark:hover:bg-blue-700 dark:focus:ring-blue-800 inline-flex items-center",children:t?(0,o.jsx)(S,{text:"Loading model..."}):n?(0,o.jsx)(S,{text:"Transcribing..."}):"Transcribe Audio"})}function S(e){return(0,o.jsxs)("div",{role:"status",children:[(0,o.jsxs)("svg",{"aria-hidden":"true",role:"status",className:"inline w-4 h-4 mr-3 text-white animate-spin",viewBox:"0 0 100 101",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[(0,o.jsx)("path",{d:"M100 50.5908C100 78.2051 77.6142 100.591 50 100.591C22.3858 100.591 0 78.2051 0 50.5908C0 22.9766 22.3858 0.59082 50 0.59082C77.6142 0.59082 100 22.9766 100 50.5908ZM9.08144 50.5908C9.08144 73.1895 27.4013 91.5094 50 91.5094C72.5987 91.5094 90.9186 73.1895 90.9186 50.5908C90.9186 27.9921 72.5987 9.67226 50 9.67226C27.4013 9.67226 9.08144 27.9921 9.08144 50.5908Z",fill:"#E5E7EB"}),(0,o.jsx)("path",{d:"M93.9676 39.0409C96.393 38.4038 97.8624 35.9116 97.0079 33.5539C95.2932 28.8227 92.871 24.3692 89.8167 20.348C85.8452 15.1192 80.8826 10.7238 75.2124 7.41289C69.5422 4.10194 63.2754 1.94025 56.7698 1.05124C51.7666 0.367541 46.6976 0.446843 41.7345 1.27873C39.2613 1.69328 37.813 4.19778 38.4501 6.62326C39.0873 9.04874 41.5694 10.4717 44.0505 10.1071C47.8511 9.54855 51.7191 9.52689 55.5402 10.0491C60.8642 10.7766 65.9928 12.5457 70.6331 15.2552C75.2735 17.9648 79.3347 21.5619 82.5849 25.841C84.9175 28.9121 86.7997 32.2913 88.1811 35.8758C89.083 38.2158 91.5421 39.6781 93.9676 39.0409Z",fill:"currentColor"})]}),e.text]})}var T=n(9226),D=n(943);function B(e){let{show:t,onClose:n,onSubmit:a,title:r,content:i,submitText:s,submitEnabled:l=!0}=e;return(0,o.jsx)(T.u,{appear:!0,show:t,as:c.Fragment,children:(0,o.jsxs)(D.V,{as:"div",className:"relative z-10",onClose:n,children:[(0,o.jsx)(T.u.Child,{as:c.Fragment,enter:"ease-out duration-300",enterFrom:"opacity-0",enterTo:"opacity-100",leave:"ease-in duration-200",leaveFrom:"opacity-100",leaveTo:"opacity-0",children:(0,o.jsx)("div",{className:"fixed inset-0 bg-black bg-opacity-25"})}),(0,o.jsx)("div",{className:"fixed inset-0 overflow-y-auto",children:(0,o.jsx)("div",{className:"flex min-h-full items-center justify-center p-4 text-center",children:(0,o.jsx)(T.u.Child,{as:c.Fragment,enter:"ease-out duration-300",enterFrom:"opacity-0 scale-95",enterTo:"opacity-100 scale-100",leave:"ease-in duration-200",leaveFrom:"opacity-100 scale-100",leaveTo:"opacity-0 scale-95",children:(0,o.jsxs)(D.V.Panel,{className:"w-full max-w-md transform overflow-hidden rounded-2xl bg-white p-6 text-left align-middle shadow-xl transition-all",children:[(0,o.jsx)(D.V.Title,{as:"h3",className:"text-lg font-medium leading-6 text-gray-900",children:r}),(0,o.jsx)("div",{className:"mt-3 text-sm text-gray-500",children:i}),(0,o.jsxs)("div",{className:"mt-4 flex flex-row-reverse",children:[s&&(0,o.jsx)("button",{type:"button",disabled:!l,className:"inline-flex ml-4 justify-center rounded-md border border-transparent ".concat(l?"bg-indigo-600":"bg-grey-300"," px-4 py-2 text-sm font-medium text-indigo-100 ").concat(l?"hover:bg-indigo-500 focus:outline-none focus-visible:ring-2 focus-visible:ring-indigo-500 focus-visible:ring-offset-2":""," transition-all duration-300"),onClick:a,children:s}),(0,o.jsx)("button",{type:"button",className:"inline-flex justify-center rounded-md border border-transparent bg-indigo-100 px-4 py-2 text-sm font-medium text-indigo-900 hover:bg-indigo-200 focus:outline-none focus-visible:ring-2 focus-visible:ring-indigo-500 focus-visible:ring-offset-2 transition-all duration-300",onClick:n,children:"Close"})]})]})})})})]})})}function F(e){return(0,o.jsx)("div",{children:(0,o.jsx)("input",{...e,type:"url",className:"my-2 bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500",placeholder:"www.example.com",required:!0})})}function L(e){return((e=e.toLowerCase()).match(/\w+.?/g)||[]).map(e=>e.charAt(0).toUpperCase()+e.slice(1)).join("")}let N={en:"english",zh:"chinese",de:"german",es:"spanish/castilian",ru:"russian",ko:"korean",fr:"french",ja:"japanese",pt:"portuguese",tr:"turkish",pl:"polish",ca:"catalan/valencian",nl:"dutch/flemish",ar:"arabic",sv:"swedish",it:"italian",id:"indonesian",hi:"hindi",fi:"finnish",vi:"vietnamese",he:"hebrew",uk:"ukrainian",el:"greek",ms:"malay",cs:"czech",ro:"romanian/moldavian/moldovan",da:"danish",hu:"hungarian",ta:"tamil",no:"norwegian",th:"thai",ur:"urdu",hr:"croatian",bg:"bulgarian",lt:"lithuanian",la:"latin",mi:"maori",ml:"malayalam",cy:"welsh",sk:"slovak",te:"telugu",fa:"persian",lv:"latvian",bn:"bengali",sr:"serbian",az:"azerbaijani",sl:"slovenian",kn:"kannada",et:"estonian",mk:"macedonian",br:"breton",eu:"basque",is:"icelandic",hy:"armenian",ne:"nepali",mn:"mongolian",bs:"bosnian",kk:"kazakh",sq:"albanian",sw:"swahili",gl:"galician",mr:"marathi",pa:"punjabi/panjabi",si:"sinhala/sinhalese",km:"khmer",sn:"shona",yo:"yoruba",so:"somali",af:"afrikaans",oc:"occitan",ka:"georgian",be:"belarusian",tg:"tajik",sd:"sindhi",gu:"gujarati",am:"amharic",yi:"yiddish",lo:"lao",uz:"uzbek",fo:"faroese",ht:"haitian creole/haitian",ps:"pashto/pushto",tk:"turkmen",nn:"nynorsk",mt:"maltese",sa:"sanskrit",lb:"luxembourgish/letzeburgesch",my:"myanmar/burmese",bo:"tibetan",tl:"tagalog",mg:"malagasy",as:"assamese",tt:"tatar",haw:"hawaiian",ln:"lingala",ha:"hausa",ba:"bashkir",jw:"javanese",su:"sundanese"};function E(e){let[t,n]=(0,c.useState)(void 0),[a,r]=(0,c.useState)(void 0),[i,s]=(0,c.useState)(void 0),m=void 0!==t,p=()=>{r(void 0),s(void 0)},y=async(e,t)=>{let n=new AudioContext({sampleRate:u.SAMPLING_RATE}),a=URL.createObjectURL(new Blob([e],{type:"audio/*"}));r({buffer:await n.decodeAudioData(e),url:a,source:"URL",mimeType:t})},h=async e=>{p(),n(0);let t=URL.createObjectURL(e),a=new FileReader;a.onprogress=e=>{n(e.loaded/e.total||0)},a.onloadend=async()=>{let i=new AudioContext({sampleRate:u.SAMPLING_RATE}),s=a.result,o=await i.decodeAudioData(s);n(void 0),r({buffer:o,url:t,source:"RECORDING",mimeType:e.type})},a.readAsArrayBuffer(e)},g=async e=>{if(i)try{r(void 0),n(0);let{data:t,headers:a}=await l.Z.get(i,{signal:e.signal,responseType:"arraybuffer",onDownloadProgress(e){n(e.progress||0)}}),s=a["content-type"];s&&"audio/wave"!==s||(s="audio/wav"),y(t,s)}catch(e){console.log("Request failed or aborted",e)}finally{n(void 0)}};return(0,c.useEffect)(()=>{if(i){let e=new AbortController;return g(e),()=>{e.abort()}}},[i]),(0,o.jsxs)(o.Fragment,{children:[(0,o.jsxs)("div",{className:"flex flex-col justify-center items-center rounded-lg bg-white shadow-xl shadow-black/5 ring-1 ring-slate-700/10",children:[(0,o.jsxs)("div",{className:"flex flex-row space-x-2 py-2 w-full px-2",children:[(0,o.jsx)(z,{icon:(0,o.jsx)(G,{}),text:"From URL",onUrlUpdate:t=>{e.transcriber.onInputChange(),s(t)}}),(0,o.jsx)(I,{}),(0,o.jsx)(O,{icon:(0,o.jsx)(H,{}),text:"From file",onFileUpdate:(t,n,a)=>{e.transcriber.onInputChange(),r({buffer:t,url:n,source:"FILE",mimeType:a})}}),navigator.mediaDevices&&(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(I,{}),(0,o.jsx)(V,{icon:(0,o.jsx)(K,{}),text:"Record",setAudioData:t=>{e.transcriber.onInputChange(),h(t)}})]})]}),(0,o.jsx)(M,{progress:m?t:+!!a})]}),a&&(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(d,{audioUrl:a.url,mimeType:a.mimeType}),(0,o.jsxs)("div",{className:"relative w-full flex justify-center items-center",children:[(0,o.jsx)(j,{onClick:()=>{e.transcriber.start(a.buffer)},isModelLoading:e.transcriber.isModelLoading,isTranscribing:e.transcriber.isBusy}),(0,o.jsx)(A,{className:"absolute right-4",transcriber:e.transcriber,icon:(0,o.jsx)(Z,{})})]}),e.transcriber.progressItems.length>0&&(0,o.jsxs)("div",{className:"relative z-10 p-4 w-full",children:[(0,o.jsx)("label",{children:"Loading model files... (only run once)"}),e.transcriber.progressItems.map(e=>(0,o.jsx)("div",{children:(0,o.jsx)(w,{text:e.file,percentage:e.progress})},e.file))]})]})]})}function A(e){let[t,n]=(0,c.useState)(!1),a=()=>{n(!1)};return(0,o.jsxs)("div",{className:e.className,children:[(0,o.jsx)(W,{icon:e.icon,onClick:()=>{n(!0)}}),(0,o.jsx)(R,{show:t,onSubmit:e=>{a()},onClose:a,transcriber:e.transcriber})]})}function R(e){let t=Object.values(N).map(L),n={"huuquyet/PhoWhisper-tiny":[43,154],"huuquyet/PhoWhisper-base":[75,285],"huuquyet/PhoWhisper-small":[250,970],"huuquyet/PhoWhisper-medium":[776],"huuquyet/PhoWhisper-large":[3139],"Xenova/whisper-tiny":[41,152],"Xenova/whisper-base":[77,291]};return(0,o.jsx)(B,{show:e.show,title:"Settings",content:(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)("label",{children:"Select the model to use."}),(0,o.jsx)("select",{className:"mt-1 mb-1 bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500",defaultValue:e.transcriber.model,onChange:t=>{e.transcriber.setModel(t.target.value)},children:Object.keys(n).filter(t=>e.transcriber.quantized||2===n[t].length).filter(t=>!e.transcriber.multilingual||!t.startsWith("distil-whisper/")).map(t=>(0,o.jsx)("option",{value:t,children:"".concat(t).concat(e.transcriber.multilingual||t.startsWith("distil-whisper/")||t.startsWith("huuquyet")?"":".en"," (").concat(n[t][e.transcriber.quantized?0:1],"MB)")},t))}),(0,o.jsxs)("div",{className:"flex justify-between items-center mb-3 px-1",children:[(0,o.jsxs)("div",{className:"flex",children:[(0,o.jsx)("input",{id:"multilingual",type:"checkbox",checked:e.transcriber.multilingual,onChange:t=>{e.transcriber.setMultilingual(t.target.checked)}}),(0,o.jsx)("label",{htmlFor:"multilingual",className:"ms-1",children:"Multilingual"})]}),(0,o.jsxs)("div",{className:"flex",children:[(0,o.jsx)("input",{id:"quantize",type:"checkbox",checked:e.transcriber.quantized,onChange:t=>{e.transcriber.setQuantized(t.target.checked)}}),(0,o.jsx)("label",{htmlFor:"quantize",className:"ms-1",children:"Quantized"})]})]}),e.transcriber.multilingual&&(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)("label",{children:"Select the source language."}),(0,o.jsx)("select",{className:"mt-1 mb-3 bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500",defaultValue:e.transcriber.language,onChange:t=>{e.transcriber.setLanguage(t.target.value)},children:Object.keys(N).map((e,n)=>(0,o.jsx)("option",{value:e,children:t[n]},e))}),(0,o.jsx)("label",{children:"Select the task to perform."}),(0,o.jsxs)("select",{className:"mt-1 mb-3 bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500",defaultValue:e.transcriber.subtask,onChange:t=>{e.transcriber.setSubtask(t.target.value)},children:[(0,o.jsx)("option",{value:"transcribe",children:"Transcribe"}),(0,o.jsx)("option",{value:"translate",children:"Translate (to Vietnamese)"})]})]})]}),onClose:e.onClose,onSubmit:()=>{}})}function I(){return(0,o.jsx)("div",{className:"w-[1px] bg-slate-200"})}function M(e){return(0,o.jsx)(P,{progress:"".concat(Math.round(100*e.progress),"%")})}function P(e){return(0,o.jsx)("div",{className:"w-full bg-gray-200 rounded-full h-1 dark:bg-gray-700",children:(0,o.jsx)("div",{className:"bg-blue-600 h-1 rounded-full transition-all duration-100",style:{width:e.progress}})})}function z(e){let[t,n]=(0,c.useState)(!1),a=()=>{n(!1)};return(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(W,{icon:e.icon,text:e.text,onClick:()=>{n(!0)}}),(0,o.jsx)(_,{show:t,onSubmit:t=>{e.onUrlUpdate(t),a()},onClose:a})]})}function _(e){let[t,n]=(0,c.useState)(u.DEFAULT_AUDIO_URL);return(0,o.jsx)(B,{show:e.show,title:"From URL",content:(0,o.jsxs)(o.Fragment,{children:["Enter the URL of the audio file you want to load.",(0,o.jsx)(F,{onChange:e=>{n(e.target.value)},value:t})]}),onClose:e.onClose,submitText:"Load",onSubmit:()=>{e.onSubmit(t)}})}function O(e){let t=document.createElement("input");return t.type="file",t.oninput=n=>{let a=n.target.files;if(!a)return;let r=URL.createObjectURL(a[0]),i=a[0].type,s=new FileReader;s.addEventListener("load",async t=>{var n;let a=null===(n=t.target)||void 0===n?void 0:n.result;if(!a)return;let s=new AudioContext({sampleRate:u.SAMPLING_RATE}),o=await s.decodeAudioData(a);e.onFileUpdate(o,r,i)}),s.readAsArrayBuffer(a[0]),t.value=""},(0,o.jsx)(o.Fragment,{children:(0,o.jsx)(W,{icon:e.icon,text:e.text,onClick:()=>t.click()})})}function V(e){let[t,n]=(0,c.useState)(!1),a=()=>{n(!1)};return(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(W,{icon:e.icon,text:e.text,onClick:()=>{n(!0)}}),(0,o.jsx)(q,{show:t,onSubmit:t=>{t&&(e.setAudioData(t),a())},onClose:a})]})}function q(e){let[t,n]=(0,c.useState)();return(0,o.jsx)(B,{show:e.show,title:"From Recording",content:(0,o.jsxs)(o.Fragment,{children:["Record audio using your microphone",(0,o.jsx)(U,{onRecordingComplete:e=>{n(e)}})]}),onClose:()=>{e.onClose(),n(void 0)},submitText:"Load",submitEnabled:void 0!==t,onSubmit:()=>{e.onSubmit(t),n(void 0)}})}function W(e){return(0,o.jsxs)("button",{type:"button",onClick:e.onClick,className:"flex items-center justify-center rounded-lg p-2 bg-blue text-slate-500 hover:text-indigo-600 hover:bg-indigo-50 transition-all duration-200",children:[(0,o.jsx)("div",{className:"w-7 h-7",children:e.icon}),e.text&&(0,o.jsx)("div",{className:"ml-2 break-text text-center text-md w-30",children:e.text})]})}function G(){return(0,o.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:"1.5",stroke:"currentColor",children:(0,o.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M13.19 8.688a4.5 4.5 0 011.242 7.244l-4.5 4.5a4.5 4.5 0 01-6.364-6.364l1.757-1.757m13.35-.622l1.757-1.757a4.5 4.5 0 00-6.364-6.364l-4.5 4.5a4.5 4.5 0 001.242 7.244"})})}function H(){return(0,o.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:"1.5",stroke:"currentColor",children:(0,o.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M3.75 9.776c.112-.017.227-.026.344-.026h15.812c.117 0 .232.009.344.026m-16.5 0a2.25 2.25 0 00-1.883 2.542l.857 6a2.25 2.25 0 002.227 1.932H19.05a2.25 2.25 0 002.227-1.932l.857-6a2.25 2.25 0 00-1.883-2.542m-16.5 0V6A2.25 2.25 0 016 3.75h3.879a1.5 1.5 0 011.06.44l2.122 2.12a1.5 1.5 0 001.06.44H18A2.25 2.25 0 0120.25 9v.776"})})}function Z(){return(0,o.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:"1.25",stroke:"currentColor",children:[(0,o.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M9.594 3.94c.09-.542.56-.94 1.11-.94h2.593c.55 0 1.02.398 1.11.94l.213 1.281c.063.374.313.686.645.87.074.04.147.083.22.127.324.196.72.257 1.075.124l1.217-.456a1.125 1.125 0 011.37.49l1.296 2.247a1.125 1.125 0 01-.26 1.431l-1.003.827c-.293.24-.438.613-.431.992a6.759 6.759 0 010 .255c-.007.378.138.75.43.99l1.005.828c.424.35.534.954.26 1.43l-1.298 2.247a1.125 1.125 0 01-1.369.491l-1.217-.456c-.355-.133-.75-.072-1.076.124a6.57 6.57 0 01-.22.128c-.331.183-.581.495-.644.869l-.213 1.28c-.09.543-.56.941-1.11.941h-2.594c-.55 0-1.02-.398-1.11-.94l-.213-1.281c-.062-.374-.312-.686-.644-.87a6.52 6.52 0 01-.22-.127c-.325-.196-.72-.257-1.076-.124l-1.217.456a1.125 1.125 0 01-1.369-.49l-1.297-2.247a1.125 1.125 0 01.26-1.431l1.004-.827c.292-.24.437-.613.43-.992a6.932 6.932 0 010-.255c.007-.378-.138-.75-.43-.99l-1.004-.828a1.125 1.125 0 01-.26-1.43l1.297-2.247a1.125 1.125 0 011.37-.491l1.216.456c.356.133.751.072 1.076-.124.072-.044.146-.087.22-.128.332-.183.582-.495.644-.869l.214-1.281z"}),(0,o.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M15 12a3 3 0 11-6 0 3 3 0 016 0z"})]})}function K(){return(0,o.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",children:(0,o.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 18.75a6 6 0 006-6v-1.5m-6 7.5a6 6 0 01-6-6v-1.5m6 7.5v3.75m-3.75 0h7.5M12 15.75a3 3 0 01-3-3V4.5a3 3 0 116 0v8.25a3 3 0 01-3 3z"})})}function J(e){var t;let{transcribedData:n}=e,a=(0,c.useRef)(null),r=(e,t)=>{let n=URL.createObjectURL(e),a=document.createElement("a");a.href=n,a.download=t,a.click(),URL.revokeObjectURL(n)};return(0,c.useEffect)(()=>{a.current&&64>=Math.abs(a.current.offsetHeight+a.current.scrollTop-a.current.scrollHeight)&&(a.current.scrollTop=a.current.scrollHeight)}),(0,o.jsxs)("div",{ref:a,className:"w-full flex flex-col my-2 p-4 max-h-[20rem] overflow-y-auto",children:[null==n?void 0:null===(t=n.chunks)||void 0===t?void 0:t.map((e,t)=>(0,o.jsxs)("div",{className:"w-full flex flex-row mb-2 bg-white rounded-lg p-4 shadow-xl shadow-black/5 ring-1 ring-slate-700/10",children:[(0,o.jsx)("div",{className:"mr-5",children:p(e.timestamp[0])}),e.text]},"".concat(t,"-").concat(e.text))),n&&!n.isBusy&&(0,o.jsxs)("div",{className:"w-full text-right",children:[(0,o.jsx)("button",{type:"button",onClick:()=>{var e;r(new Blob([(null!==(e=null==n?void 0:n.chunks)&&void 0!==e?e:[]).map(e=>e.text).join("").trim()],{type:"text/plain"}),"transcript.txt")},className:"text-white bg-green-500 hover:bg-green-600 focus:ring-4 focus:ring-green-300 font-medium rounded-lg text-sm px-4 py-2 text-center mr-2 dark:bg-green-600 dark:hover:bg-green-700 dark:focus:ring-green-800 inline-flex items-center",children:"Export TXT"}),(0,o.jsx)("button",{type:"button",onClick:()=>{var e;let t=JSON.stringify(null!==(e=null==n?void 0:n.chunks)&&void 0!==e?e:[],null,2);r(new Blob([t=t.replace(/( {4}"timestamp": )\[\s+(\S+)\s+(\S+)\s+\]/gm,"$1[$2 $3]")],{type:"application/json"}),"transcript.json")},className:"text-white bg-green-500 hover:bg-green-600 focus:ring-4 focus:ring-green-300 font-medium rounded-lg text-sm px-4 py-2 text-center mr-2 dark:bg-green-600 dark:hover:bg-green-700 dark:focus:ring-green-800 inline-flex items-center",children:"Export JSON"})]})]})}function Q(){let e=function(){let[e,t]=(0,c.useState)(void 0),[a,r]=(0,c.useState)(!1),[i,s]=(0,c.useState)(!1),[o,l]=(0,c.useState)([]),d=function(e){let[t]=(0,c.useState)(()=>(function(e){let t=new Worker(n.tu(new URL(n.p+n.u(251),n.b)),{type:void 0});return t.addEventListener("message",e),t})(e));return t}(e=>{let n=e.data;switch(n.status){case"progress":l(e=>e.map(e=>e.file===n.file?{...e,progress:n.progress}:e));break;case"update":t({isBusy:!0,text:n.data[0],chunks:n.data[1].chunks});break;case"complete":t({isBusy:!1,text:n.data.text,chunks:n.data.chunks}),r(!1);break;case"initiate":s(!0),l(e=>[...e,n]);break;case"ready":s(!1);break;case"error":r(!1),alert("".concat(n.data.message," This is most likely because you are using Safari on an M1/M2 Mac. Please try again from Chrome, Firefox, or Edge.\n\nIf this is not the case, please file a bug report."));break;case"done":l(e=>e.filter(e=>e.file!==n.file))}}),[m,p]=(0,c.useState)(u.DEFAULT_MODEL),[y,h]=(0,c.useState)(u.DEFAULT_SUBTASK),[g,f]=(0,c.useState)(u.DEFAULT_QUANTIZED),[b,x]=(0,c.useState)(u.DEFAULT_MULTILINGUAL),[k,C]=(0,c.useState)(u.DEFAULT_LANGUAGE),v=(0,c.useCallback)(()=>{t(void 0)},[]),U=(0,c.useCallback)(async e=>{if(e){let n;if(t(void 0),r(!0),2===e.numberOfChannels){let t=Math.sqrt(2),a=e.getChannelData(0),r=e.getChannelData(1);n=new Float32Array(a.length);for(let i=0;i<e.length;++i)n[i]=t*(a[i]+r[i])/2}else n=e.getChannelData(0);d.postMessage({audio:n,model:m,multilingual:b,quantized:g,subtask:b?y:null,language:b&&"auto"!==k?k:null})}},[d,m,b,g,y,k]);return(0,c.useMemo)(()=>({onInputChange:v,isBusy:a,isModelLoading:i,progressItems:o,start:U,output:e,model:m,setModel:p,multilingual:b,setMultilingual:x,quantized:g,setQuantized:f,subtask:y,setSubtask:h,language:k,setLanguage:C}),[a,i,o,U,e,m,b,g,y,k])}();return(0,o.jsxs)("div",{className:"flex justify-center items-center min-h-screen",children:[(0,o.jsxs)("div",{className:"container flex flex-col justify-center items-center",children:[(0,o.jsx)("h1",{className:"text-5xl font-extrabold tracking-tight text-slate-900 sm:text-7xl text-center",children:"PhoWhisper Web"}),(0,o.jsx)("h2",{className:"mt-3 mb-5 px-4 text-center text-1xl font-semibold tracking-tight text-slate-900 sm:text-2xl",children:"ML-powered speech recognition for Vietnamese directly in your browser"}),(0,o.jsx)(E,{transcriber:e}),(0,o.jsx)(J,{transcribedData:e.output})]}),(0,o.jsxs)("div",{className:"absolute bottom-4",children:["Made with"," ",(0,o.jsx)("a",{className:"underline",href:"https://github.com/xenova/transformers.js",children:"\uD83E\uDD17 Transformers.js"})," ","+ Next.js"," ",(0,o.jsx)("a",{className:"underline",href:"https://github.com/huuquyet/PhoWhisper-next",children:"Give it a βοΈ"})]})]})}(i=s||(s={})).URL="URL",i.FILE="FILE",i.RECORDING="RECORDING"}},function(e){e.O(0,[72,51,971,190,744],function(){return e(e.s=6972)}),_N_E=e.O()}]);
|
_next/static/chunks/{4b236691-df73c8aa6aaf3a9e.js β fd9d1056-7caaac656b5ccd86.js}
RENAMED
The diff for this file is too large to render.
See raw diff
|
|
_next/static/chunks/{framework-2078c65ea7cdfc8a.js β framework-f66176bb897dc684.js}
RENAMED
The diff for this file is too large to render.
See raw diff
|
|
_next/static/chunks/main-03c24bfcb55bddbe.js
DELETED
The diff for this file is too large to render.
See raw diff
|
|
_next/static/chunks/main-app-23c27476be19b2c2.js
DELETED
@@ -1 +0,0 @@
|
|
1 |
-
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[744],{1220:function(e,n,t){Promise.resolve().then(t.t.bind(t,4562,23)),Promise.resolve().then(t.t.bind(t,3932,23)),Promise.resolve().then(t.t.bind(t,1676,23)),Promise.resolve().then(t.t.bind(t,70,23)),Promise.resolve().then(t.t.bind(t,4237,23)),Promise.resolve().then(t.t.bind(t,7046,23))}},function(e){var n=function(n){return e(e.s=n)};e.O(0,[371,925],function(){return n(415),n(462),n(1220)}),_N_E=e.O()}]);
|
|
|
|
_next/static/chunks/main-app-2781f8dc46d71368.js
ADDED
@@ -0,0 +1 @@
|
|
|
|
|
1 |
+
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[744],{4946:function(e,n,t){Promise.resolve().then(t.t.bind(t,5751,23)),Promise.resolve().then(t.t.bind(t,6513,23)),Promise.resolve().then(t.t.bind(t,6130,23)),Promise.resolve().then(t.t.bind(t,9275,23)),Promise.resolve().then(t.t.bind(t,5324,23)),Promise.resolve().then(t.t.bind(t,1343,23))}},function(e){var n=function(n){return e(e.s=n)};e.O(0,[971,190],function(){return n(7804),n(1028),n(4946)}),_N_E=e.O()}]);
|
_next/static/chunks/main-cf1084da7dc80b27.js
ADDED
The diff for this file is too large to render.
See raw diff
|
|
_next/static/chunks/pages/_app-6a626577ffa902a4.js
ADDED
@@ -0,0 +1 @@
|
|
|
|
|
1 |
+
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[888],{1597:function(n,_,u){(window.__NEXT_P=window.__NEXT_P||[]).push(["/_app",function(){return u(2239)}])}},function(n){var _=function(_){return n(n.s=_)};n.O(0,[774,179],function(){return _(1597),_(6036)}),_N_E=n.O()}]);
|
_next/static/chunks/pages/_app-98fafab7f2d09638.js
DELETED
@@ -1 +0,0 @@
|
|
1 |
-
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[888],{660:function(n,_,u){(window.__NEXT_P=window.__NEXT_P||[]).push(["/_app",function(){return u(8943)}])}},function(n){var _=function(_){return n(n.s=_)};n.O(0,[774,179],function(){return _(660),_(2417)}),_N_E=n.O()}]);
|
|
|
|
_next/static/chunks/pages/_error-0dc1e91229abefc4.js
DELETED
@@ -1 +0,0 @@
|
|
1 |
-
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[820],{7899:function(n,_,u){(window.__NEXT_P=window.__NEXT_P||[]).push(["/_error",function(){return u(1110)}])}},function(n){n.O(0,[888,774,179],function(){return n(n.s=7899)}),_N_E=n.O()}]);
|
|
|
|
_next/static/chunks/pages/_error-1be831200e60c5c0.js
ADDED
@@ -0,0 +1 @@
|
|
|
|
|
1 |
+
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[820],{1981:function(n,_,u){(window.__NEXT_P=window.__NEXT_P||[]).push(["/_error",function(){return u(3387)}])}},function(n){n.O(0,[888,774,179],function(){return n(n.s=1981)}),_N_E=n.O()}]);
|
_next/static/chunks/{webpack-905b1a80c0e778a5.js β webpack-12ca2ea8ed93dae2.js}
RENAMED
@@ -1 +1 @@
|
|
1 |
-
!function(){"use strict";var e,t,r,n,o,u,i,c,f,a={},l={};function s(e){var t=l[e];if(void 0!==t)return t.exports;var r=l[e]={exports:{}},n=!0;try{a[e](r,r.exports,s),n=!1}finally{n&&delete l[e]}return r.exports}s.m=a,e=[],s.O=function(t,r,n,o){if(r){o=o||0;for(var u=e.length;u>0&&e[u-1][2]>o;u--)e[u]=e[u-1];e[u]=[r,n,o];return}for(var i=1/0,u=0;u<e.length;u++){for(var r=e[u][0],n=e[u][1],o=e[u][2],c=!0,f=0;f<r.length;f++)i>=o&&Object.keys(s.O).every(function(e){return s.O[e](r[f])})?r.splice(f--,1):(c=!1,o<i&&(i=o));if(c){e.splice(u--,1);var a=n();void 0!==a&&(t=a)}}return t},r=Object.getPrototypeOf?function(e){return Object.getPrototypeOf(e)}:function(e){return e.__proto__},s.t=function(e,n){if(1&n&&(e=this(e)),8&n||"object"==typeof e&&e&&(4&n&&e.__esModule||16&n&&"function"==typeof e.then))return e;var o=Object.create(null);s.r(o);var u={};t=t||[null,r({}),r([]),r(r)];for(var i=2&n&&e;"object"==typeof i&&!~t.indexOf(i);i=r(i))Object.getOwnPropertyNames(i).forEach(function(t){u[t]=function(){return e[t]}});return u.default=function(){return e},s.d(o,u),o},s.d=function(e,t){for(var r in t)s.o(t,r)&&!s.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},s.f={},s.e=function(e){return Promise.all(Object.keys(s.f).reduce(function(t,r){return s.f[r](e,t),t},[]))},s.u=function(e){return"static/chunks/"+e+".
|
|
|
1 |
+
!function(){"use strict";var e,t,r,n,o,u,i,c,f,a={},l={};function s(e){var t=l[e];if(void 0!==t)return t.exports;var r=l[e]={exports:{}},n=!0;try{a[e](r,r.exports,s),n=!1}finally{n&&delete l[e]}return r.exports}s.m=a,e=[],s.O=function(t,r,n,o){if(r){o=o||0;for(var u=e.length;u>0&&e[u-1][2]>o;u--)e[u]=e[u-1];e[u]=[r,n,o];return}for(var i=1/0,u=0;u<e.length;u++){for(var r=e[u][0],n=e[u][1],o=e[u][2],c=!0,f=0;f<r.length;f++)i>=o&&Object.keys(s.O).every(function(e){return s.O[e](r[f])})?r.splice(f--,1):(c=!1,o<i&&(i=o));if(c){e.splice(u--,1);var a=n();void 0!==a&&(t=a)}}return t},r=Object.getPrototypeOf?function(e){return Object.getPrototypeOf(e)}:function(e){return e.__proto__},s.t=function(e,n){if(1&n&&(e=this(e)),8&n||"object"==typeof e&&e&&(4&n&&e.__esModule||16&n&&"function"==typeof e.then))return e;var o=Object.create(null);s.r(o);var u={};t=t||[null,r({}),r([]),r(r)];for(var i=2&n&&e;"object"==typeof i&&!~t.indexOf(i);i=r(i))Object.getOwnPropertyNames(i).forEach(function(t){u[t]=function(){return e[t]}});return u.default=function(){return e},s.d(o,u),o},s.d=function(e,t){for(var r in t)s.o(t,r)&&!s.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},s.f={},s.e=function(e){return Promise.all(Object.keys(s.f).reduce(function(t,r){return s.f[r](e,t),t},[]))},s.u=function(e){return"static/chunks/"+e+".b8ce00a7f6eefa34.js"},s.miniCssF=function(e){},s.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n={},o="_N_E:",s.l=function(e,t,r,u){if(n[e]){n[e].push(t);return}if(void 0!==r)for(var i,c,f=document.getElementsByTagName("script"),a=0;a<f.length;a++){var l=f[a];if(l.getAttribute("src")==e||l.getAttribute("data-webpack")==o+r){i=l;break}}i||(c=!0,(i=document.createElement("script")).charset="utf-8",i.timeout=120,s.nc&&i.setAttribute("nonce",s.nc),i.setAttribute("data-webpack",o+r),i.src=s.tu(e)),n[e]=[t];var d=function(t,r){i.onerror=i.onload=null,clearTimeout(p);var o=n[e];if(delete n[e],i.parentNode&&i.parentNode.removeChild(i),o&&o.forEach(function(e){return e(r)}),t)return t(r)},p=setTimeout(d.bind(null,void 0,{type:"timeout",target:i}),12e4);i.onerror=d.bind(null,i.onerror),i.onload=d.bind(null,i.onload),c&&document.head.appendChild(i)},s.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},s.tt=function(){return void 0===u&&(u={createScriptURL:function(e){return e}},"undefined"!=typeof trustedTypes&&trustedTypes.createPolicy&&(u=trustedTypes.createPolicy("nextjs#bundler",u))),u},s.tu=function(e){return s.tt().createScriptURL(e)},s.p="/_next/",s.b=document.baseURI||self.location.href,i={272:0,141:0},s.f.j=function(e,t){var r=s.o(i,e)?i[e]:void 0;if(0!==r){if(r)t.push(r[2]);else if(/^(141|272)$/.test(e))i[e]=0;else{var n=new Promise(function(t,n){r=i[e]=[t,n]});t.push(r[2]=n);var o=s.p+s.u(e),u=Error();s.l(o,function(t){if(s.o(i,e)&&(0!==(r=i[e])&&(i[e]=void 0),r)){var n=t&&("load"===t.type?"missing":t.type),o=t&&t.target&&t.target.src;u.message="Loading chunk "+e+" failed.\n("+n+": "+o+")",u.name="ChunkLoadError",u.type=n,u.request=o,r[1](u)}},"chunk-"+e,e)}}},s.O.j=function(e){return 0===i[e]},c=function(e,t){var r,n,o=t[0],u=t[1],c=t[2],f=0;if(o.some(function(e){return 0!==i[e]})){for(r in u)s.o(u,r)&&(s.m[r]=u[r]);if(c)var a=c(s)}for(e&&e(t);f<o.length;f++)n=o[f],s.o(i,n)&&i[n]&&i[n][0](),i[n]=0;return s.O(a)},(f=self.webpackChunk_N_E=self.webpackChunk_N_E||[]).forEach(c.bind(null,0)),f.push=c.bind(null,f.push.bind(f))}();
|
_next/static/css/{7f9a00ba16d0880a.css β 25145688737dc9c2.css}
RENAMED
@@ -1,3 +1,3 @@
|
|
1 |
/*
|
2 |
-
! tailwindcss v3.4.
|
3 |
*/*,:after,:before{box-sizing:border-box;border:0 solid #e5e7eb}:after,:before{--tw-content:""}:host,html{line-height:1.5;-webkit-text-size-adjust:100%;-moz-tab-size:4;-o-tab-size:4;tab-size:4;font-family:ui-sans-serif,system-ui,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;font-feature-settings:normal;font-variation-settings:normal;-webkit-tap-highlight-color:transparent}body{margin:0;line-height:inherit}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,pre,samp{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-feature-settings:normal;font-variation-settings:normal;font-size:1em}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}button,input,optgroup,select,textarea{font-family:inherit;font-feature-settings:inherit;font-variation-settings:inherit;font-size:100%;font-weight:inherit;line-height:inherit;letter-spacing:inherit;color:inherit;margin:0;padding:0}button,select{text-transform:none}button,input:where([type=button]),input:where([type=reset]),input:where([type=submit]){-webkit-appearance:button;background-color:transparent;background-image:none}:-moz-focusring{outline:auto}:-moz-ui-invalid{box-shadow:none}progress{vertical-align:baseline}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}summary{display:list-item}blockquote,dd,dl,figure,h1,h2,h3,h4,h5,h6,hr,p,pre{margin:0}fieldset{margin:0}fieldset,legend{padding:0}menu,ol,ul{list-style:none;margin:0;padding:0}dialog{padding:0}textarea{resize:vertical}input::-moz-placeholder,textarea::-moz-placeholder{opacity:1;color:#9ca3af}input::placeholder,textarea::placeholder{opacity:1;color:#9ca3af}[role=button],button{cursor:pointer}:disabled{cursor:default}audio,canvas,embed,iframe,img,object,svg,video{display:block;vertical-align:middle}img,video{max-width:100%;height:auto}[hidden]{display:none}*,:after,:before{--tw-border-spacing-x:0;--tw-border-spacing-y:0;--tw-translate-x:0;--tw-translate-y:0;--tw-rotate:0;--tw-skew-x:0;--tw-skew-y:0;--tw-scale-x:1;--tw-scale-y:1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness:proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-color:rgba(59,130,246,.5);--tw-ring-offset-shadow:0 0 #0000;--tw-ring-shadow:0 0 #0000;--tw-shadow:0 0 #0000;--tw-shadow-colored:0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }::backdrop{--tw-border-spacing-x:0;--tw-border-spacing-y:0;--tw-translate-x:0;--tw-translate-y:0;--tw-rotate:0;--tw-skew-x:0;--tw-skew-y:0;--tw-scale-x:1;--tw-scale-y:1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness:proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-color:rgba(59,130,246,.5);--tw-ring-offset-shadow:0 0 #0000;--tw-ring-shadow:0 0 #0000;--tw-shadow:0 0 #0000;--tw-shadow-colored:0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }.container{width:100%}@media (min-width:640px){.container{max-width:640px}}@media (min-width:768px){.container{max-width:768px}}@media (min-width:1024px){.container{max-width:1024px}}@media (min-width:1280px){.container{max-width:1280px}}@media (min-width:1536px){.container{max-width:1536px}}.static{position:static}.fixed{position:fixed}.absolute{position:absolute}.relative{position:relative}.inset-0{inset:0}.bottom-4{bottom:1rem}.right-4{right:1rem}.top-0{top:0}.z-10{z-index:10}.m-2{margin:.5rem}.my-2{margin-top:.5rem;margin-bottom:.5rem}.mb-1{margin-bottom:.25rem}.mb-2{margin-bottom:.5rem}.mb-3{margin-bottom:.75rem}.mb-5{margin-bottom:1.25rem}.ml-2{margin-left:.5rem}.ml-4{margin-left:1rem}.mr-2{margin-right:.5rem}.mr-3{margin-right:.75rem}.mr-5{margin-right:1.25rem}.ms-1{margin-inline-start:.25rem}.mt-0{margin-top:0}.mt-0\.5{margin-top:.125rem}.mt-1{margin-top:.25rem}.mt-3{margin-top:.75rem}.mt-4{margin-top:1rem}.block{display:block}.inline{display:inline}.flex{display:flex}.inline-flex{display:inline-flex}.hidden{display:none}.h-1{height:.25rem}.h-14{height:3.5rem}.h-4{height:1rem}.h-7{height:1.75rem}.h-full{height:100%}.max-h-\[20rem\]{max-height:20rem}.min-h-full{min-height:100%}.min-h-screen{min-height:100vh}.w-4{width:1rem}.w-7{width:1.75rem}.w-\[1px\]{width:1px}.w-full{width:100%}.max-w-md{max-width:28rem}.scale-100{--tw-scale-x:1;--tw-scale-y:1}.scale-100,.scale-95{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.scale-95{--tw-scale-x:.95;--tw-scale-y:.95}.transform{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}@keyframes spin{to{transform:rotate(1turn)}}.animate-spin{animation:spin 1s linear infinite}.flex-row{flex-direction:row}.flex-row-reverse{flex-direction:row-reverse}.flex-col{flex-direction:column}.items-center{align-items:center}.justify-center{justify-content:center}.justify-between{justify-content:space-between}.space-x-2>:not([hidden])~:not([hidden]){--tw-space-x-reverse:0;margin-right:calc(.5rem * var(--tw-space-x-reverse));margin-left:calc(.5rem * calc(1 - var(--tw-space-x-reverse)))}.overflow-hidden{overflow:hidden}.overflow-y-auto{overflow-y:auto}.whitespace-nowrap{white-space:nowrap}.rounded-2xl{border-radius:1rem}.rounded-full{border-radius:9999px}.rounded-lg{border-radius:.5rem}.rounded-md{border-radius:.375rem}.border{border-width:1px}.border-gray-300{--tw-border-opacity:1;border-color:rgb(209 213 219/var(--tw-border-opacity))}.border-gray-400{--tw-border-opacity:1;border-color:rgb(156 163 175/var(--tw-border-opacity))}.border-transparent{border-color:transparent}.bg-black{--tw-bg-opacity:1;background-color:rgb(0 0 0/var(--tw-bg-opacity))}.bg-blue-500{--tw-bg-opacity:1;background-color:rgb(59 130 246/var(--tw-bg-opacity))}.bg-blue-600{--tw-bg-opacity:1;background-color:rgb(37 99 235/var(--tw-bg-opacity))}.bg-blue-700{--tw-bg-opacity:1;background-color:rgb(29 78 216/var(--tw-bg-opacity))}.bg-gray-200{--tw-bg-opacity:1;background-color:rgb(229 231 235/var(--tw-bg-opacity))}.bg-gray-50{--tw-bg-opacity:1;background-color:rgb(249 250 251/var(--tw-bg-opacity))}.bg-green-500{--tw-bg-opacity:1;background-color:rgb(34 197 94/var(--tw-bg-opacity))}.bg-indigo-100{--tw-bg-opacity:1;background-color:rgb(224 231 255/var(--tw-bg-opacity))}.bg-indigo-600{--tw-bg-opacity:1;background-color:rgb(79 70 229/var(--tw-bg-opacity))}.bg-red-500{--tw-bg-opacity:1;background-color:rgb(239 68 68/var(--tw-bg-opacity))}.bg-slate-200{--tw-bg-opacity:1;background-color:rgb(226 232 240/var(--tw-bg-opacity))}.bg-white{--tw-bg-opacity:1;background-color:rgb(255 255 255/var(--tw-bg-opacity))}.bg-opacity-25{--tw-bg-opacity:0.25}.p-2{padding:.5rem}.p-2\.5{padding:.625rem}.p-4{padding:1rem}.p-6{padding:1.5rem}.px-1{padding-left:.25rem;padding-right:.25rem}.px-2{padding-left:.5rem;padding-right:.5rem}.px-4{padding-left:1rem;padding-right:1rem}.px-5{padding-left:1.25rem;padding-right:1.25rem}.py-2{padding-top:.5rem;padding-bottom:.5rem}.py-2\.5{padding-top:.625rem;padding-bottom:.625rem}.text-left{text-align:left}.text-center{text-align:center}.text-right{text-align:right}.align-middle{vertical-align:middle}.text-5xl{font-size:3rem;line-height:1}.text-lg{font-size:1.125rem;line-height:1.75rem}.text-sm{font-size:.875rem;line-height:1.25rem}.font-extrabold{font-weight:800}.font-medium{font-weight:500}.font-semibold{font-weight:600}.leading-6{line-height:1.5rem}.tracking-tight{letter-spacing:-.025em}.text-gray-500{--tw-text-opacity:1;color:rgb(107 114 128/var(--tw-text-opacity))}.text-gray-900{--tw-text-opacity:1;color:rgb(17 24 39/var(--tw-text-opacity))}.text-indigo-100{--tw-text-opacity:1;color:rgb(224 231 255/var(--tw-text-opacity))}.text-indigo-900{--tw-text-opacity:1;color:rgb(49 46 129/var(--tw-text-opacity))}.text-slate-500{--tw-text-opacity:1;color:rgb(100 116 139/var(--tw-text-opacity))}.text-slate-900{--tw-text-opacity:1;color:rgb(15 23 42/var(--tw-text-opacity))}.text-white{--tw-text-opacity:1;color:rgb(255 255 255/var(--tw-text-opacity))}.underline{text-decoration-line:underline}.opacity-0{opacity:0}.opacity-100{opacity:1}.shadow-xl{--tw-shadow:0 20px 25px -5px rgba(0,0,0,.1),0 8px 10px -6px rgba(0,0,0,.1);--tw-shadow-colored:0 20px 25px -5px var(--tw-shadow-color),0 8px 10px -6px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow)}.shadow-black\/5{--tw-shadow-color:rgba(0,0,0,.05);--tw-shadow:var(--tw-shadow-colored)}.ring-1{--tw-ring-offset-shadow:var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow:var(--tw-ring-inset) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow,0 0 #0000)}.ring-slate-700\/10{--tw-ring-color:rgba(51,65,85,.1)}.filter{filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.transition-all{transition-property:all;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.duration-100{transition-duration:.1s}.duration-200{transition-duration:.2s}.duration-300{transition-duration:.3s}.ease-in{transition-timing-function:cubic-bezier(.4,0,1,1)}.ease-out{transition-timing-function:cubic-bezier(0,0,.2,1)}#root,body,html{height:100%}audio::-webkit-media-controls-panel{background-color:#fff}.container{width:41rem;max-width:95vw}.hover\:bg-blue-800:hover{--tw-bg-opacity:1;background-color:rgb(30 64 175/var(--tw-bg-opacity))}.hover\:bg-green-600:hover{--tw-bg-opacity:1;background-color:rgb(22 163 74/var(--tw-bg-opacity))}.hover\:bg-indigo-200:hover{--tw-bg-opacity:1;background-color:rgb(199 210 254/var(--tw-bg-opacity))}.hover\:bg-indigo-50:hover{--tw-bg-opacity:1;background-color:rgb(238 242 255/var(--tw-bg-opacity))}.hover\:bg-indigo-500:hover{--tw-bg-opacity:1;background-color:rgb(99 102 241/var(--tw-bg-opacity))}.hover\:bg-red-600:hover{--tw-bg-opacity:1;background-color:rgb(220 38 38/var(--tw-bg-opacity))}.hover\:text-indigo-600:hover{--tw-text-opacity:1;color:rgb(79 70 229/var(--tw-text-opacity))}.focus\:border-blue-500:focus{--tw-border-opacity:1;border-color:rgb(59 130 246/var(--tw-border-opacity))}.focus\:outline-none:focus{outline:2px solid transparent;outline-offset:2px}.focus\:ring-4:focus{--tw-ring-offset-shadow:var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow:var(--tw-ring-inset) 0 0 0 calc(4px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow,0 0 #0000)}.focus\:ring-blue-300:focus{--tw-ring-opacity:1;--tw-ring-color:rgb(147 197 253/var(--tw-ring-opacity))}.focus\:ring-blue-500:focus{--tw-ring-opacity:1;--tw-ring-color:rgb(59 130 246/var(--tw-ring-opacity))}.focus\:ring-green-300:focus{--tw-ring-opacity:1;--tw-ring-color:rgb(134 239 172/var(--tw-ring-opacity))}.focus-visible\:ring-2:focus-visible{--tw-ring-offset-shadow:var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow:var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow,0 0 #0000)}.focus-visible\:ring-indigo-500:focus-visible{--tw-ring-opacity:1;--tw-ring-color:rgb(99 102 241/var(--tw-ring-opacity))}.focus-visible\:ring-offset-2:focus-visible{--tw-ring-offset-width:2px}@media (min-width:640px){.sm\:text-2xl{font-size:1.5rem;line-height:2rem}.sm\:text-7xl{font-size:4.5rem;line-height:1}}@media (prefers-color-scheme:dark){.dark\:border-gray-600{--tw-border-opacity:1;border-color:rgb(75 85 99/var(--tw-border-opacity))}.dark\:bg-blue-600{--tw-bg-opacity:1;background-color:rgb(37 99 235/var(--tw-bg-opacity))}.dark\:bg-gray-700{--tw-bg-opacity:1;background-color:rgb(55 65 81/var(--tw-bg-opacity))}.dark\:bg-green-600{--tw-bg-opacity:1;background-color:rgb(22 163 74/var(--tw-bg-opacity))}.dark\:text-white{--tw-text-opacity:1;color:rgb(255 255 255/var(--tw-text-opacity))}.dark\:placeholder-gray-400::-moz-placeholder{--tw-placeholder-opacity:1;color:rgb(156 163 175/var(--tw-placeholder-opacity))}.dark\:placeholder-gray-400::placeholder{--tw-placeholder-opacity:1;color:rgb(156 163 175/var(--tw-placeholder-opacity))}.dark\:hover\:bg-blue-700:hover{--tw-bg-opacity:1;background-color:rgb(29 78 216/var(--tw-bg-opacity))}.dark\:hover\:bg-green-700:hover{--tw-bg-opacity:1;background-color:rgb(21 128 61/var(--tw-bg-opacity))}.dark\:focus\:border-blue-500:focus{--tw-border-opacity:1;border-color:rgb(59 130 246/var(--tw-border-opacity))}.dark\:focus\:ring-blue-500:focus{--tw-ring-opacity:1;--tw-ring-color:rgb(59 130 246/var(--tw-ring-opacity))}.dark\:focus\:ring-blue-800:focus{--tw-ring-opacity:1;--tw-ring-color:rgb(30 64 175/var(--tw-ring-opacity))}.dark\:focus\:ring-green-800:focus{--tw-ring-opacity:1;--tw-ring-color:rgb(22 101 52/var(--tw-ring-opacity))}}
|
|
|
1 |
/*
|
2 |
+
! tailwindcss v3.4.4 | MIT License | https://tailwindcss.com
|
3 |
*/*,:after,:before{box-sizing:border-box;border:0 solid #e5e7eb}:after,:before{--tw-content:""}:host,html{line-height:1.5;-webkit-text-size-adjust:100%;-moz-tab-size:4;-o-tab-size:4;tab-size:4;font-family:ui-sans-serif,system-ui,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;font-feature-settings:normal;font-variation-settings:normal;-webkit-tap-highlight-color:transparent}body{margin:0;line-height:inherit}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,pre,samp{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-feature-settings:normal;font-variation-settings:normal;font-size:1em}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}button,input,optgroup,select,textarea{font-family:inherit;font-feature-settings:inherit;font-variation-settings:inherit;font-size:100%;font-weight:inherit;line-height:inherit;letter-spacing:inherit;color:inherit;margin:0;padding:0}button,select{text-transform:none}button,input:where([type=button]),input:where([type=reset]),input:where([type=submit]){-webkit-appearance:button;background-color:transparent;background-image:none}:-moz-focusring{outline:auto}:-moz-ui-invalid{box-shadow:none}progress{vertical-align:baseline}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}summary{display:list-item}blockquote,dd,dl,figure,h1,h2,h3,h4,h5,h6,hr,p,pre{margin:0}fieldset{margin:0}fieldset,legend{padding:0}menu,ol,ul{list-style:none;margin:0;padding:0}dialog{padding:0}textarea{resize:vertical}input::-moz-placeholder,textarea::-moz-placeholder{opacity:1;color:#9ca3af}input::placeholder,textarea::placeholder{opacity:1;color:#9ca3af}[role=button],button{cursor:pointer}:disabled{cursor:default}audio,canvas,embed,iframe,img,object,svg,video{display:block;vertical-align:middle}img,video{max-width:100%;height:auto}[hidden]{display:none}*,:after,:before{--tw-border-spacing-x:0;--tw-border-spacing-y:0;--tw-translate-x:0;--tw-translate-y:0;--tw-rotate:0;--tw-skew-x:0;--tw-skew-y:0;--tw-scale-x:1;--tw-scale-y:1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness:proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-color:rgba(59,130,246,.5);--tw-ring-offset-shadow:0 0 #0000;--tw-ring-shadow:0 0 #0000;--tw-shadow:0 0 #0000;--tw-shadow-colored:0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }::backdrop{--tw-border-spacing-x:0;--tw-border-spacing-y:0;--tw-translate-x:0;--tw-translate-y:0;--tw-rotate:0;--tw-skew-x:0;--tw-skew-y:0;--tw-scale-x:1;--tw-scale-y:1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness:proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-color:rgba(59,130,246,.5);--tw-ring-offset-shadow:0 0 #0000;--tw-ring-shadow:0 0 #0000;--tw-shadow:0 0 #0000;--tw-shadow-colored:0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }.container{width:100%}@media (min-width:640px){.container{max-width:640px}}@media (min-width:768px){.container{max-width:768px}}@media (min-width:1024px){.container{max-width:1024px}}@media (min-width:1280px){.container{max-width:1280px}}@media (min-width:1536px){.container{max-width:1536px}}.static{position:static}.fixed{position:fixed}.absolute{position:absolute}.relative{position:relative}.inset-0{inset:0}.bottom-4{bottom:1rem}.right-4{right:1rem}.top-0{top:0}.z-10{z-index:10}.m-2{margin:.5rem}.my-2{margin-top:.5rem;margin-bottom:.5rem}.mb-1{margin-bottom:.25rem}.mb-2{margin-bottom:.5rem}.mb-3{margin-bottom:.75rem}.mb-5{margin-bottom:1.25rem}.ml-2{margin-left:.5rem}.ml-4{margin-left:1rem}.mr-2{margin-right:.5rem}.mr-3{margin-right:.75rem}.mr-5{margin-right:1.25rem}.ms-1{margin-inline-start:.25rem}.mt-0{margin-top:0}.mt-0\.5{margin-top:.125rem}.mt-1{margin-top:.25rem}.mt-3{margin-top:.75rem}.mt-4{margin-top:1rem}.block{display:block}.inline{display:inline}.flex{display:flex}.inline-flex{display:inline-flex}.hidden{display:none}.h-1{height:.25rem}.h-14{height:3.5rem}.h-4{height:1rem}.h-7{height:1.75rem}.h-full{height:100%}.max-h-\[20rem\]{max-height:20rem}.min-h-full{min-height:100%}.min-h-screen{min-height:100vh}.w-4{width:1rem}.w-7{width:1.75rem}.w-\[1px\]{width:1px}.w-full{width:100%}.max-w-md{max-width:28rem}.scale-100{--tw-scale-x:1;--tw-scale-y:1}.scale-100,.scale-95{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.scale-95{--tw-scale-x:.95;--tw-scale-y:.95}.transform{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}@keyframes spin{to{transform:rotate(1turn)}}.animate-spin{animation:spin 1s linear infinite}.flex-row{flex-direction:row}.flex-row-reverse{flex-direction:row-reverse}.flex-col{flex-direction:column}.items-center{align-items:center}.justify-center{justify-content:center}.justify-between{justify-content:space-between}.space-x-2>:not([hidden])~:not([hidden]){--tw-space-x-reverse:0;margin-right:calc(.5rem * var(--tw-space-x-reverse));margin-left:calc(.5rem * calc(1 - var(--tw-space-x-reverse)))}.overflow-hidden{overflow:hidden}.overflow-y-auto{overflow-y:auto}.whitespace-nowrap{white-space:nowrap}.rounded-2xl{border-radius:1rem}.rounded-full{border-radius:9999px}.rounded-lg{border-radius:.5rem}.rounded-md{border-radius:.375rem}.border{border-width:1px}.border-gray-300{--tw-border-opacity:1;border-color:rgb(209 213 219/var(--tw-border-opacity))}.border-gray-400{--tw-border-opacity:1;border-color:rgb(156 163 175/var(--tw-border-opacity))}.border-transparent{border-color:transparent}.bg-black{--tw-bg-opacity:1;background-color:rgb(0 0 0/var(--tw-bg-opacity))}.bg-blue-500{--tw-bg-opacity:1;background-color:rgb(59 130 246/var(--tw-bg-opacity))}.bg-blue-600{--tw-bg-opacity:1;background-color:rgb(37 99 235/var(--tw-bg-opacity))}.bg-blue-700{--tw-bg-opacity:1;background-color:rgb(29 78 216/var(--tw-bg-opacity))}.bg-gray-200{--tw-bg-opacity:1;background-color:rgb(229 231 235/var(--tw-bg-opacity))}.bg-gray-50{--tw-bg-opacity:1;background-color:rgb(249 250 251/var(--tw-bg-opacity))}.bg-green-500{--tw-bg-opacity:1;background-color:rgb(34 197 94/var(--tw-bg-opacity))}.bg-indigo-100{--tw-bg-opacity:1;background-color:rgb(224 231 255/var(--tw-bg-opacity))}.bg-indigo-600{--tw-bg-opacity:1;background-color:rgb(79 70 229/var(--tw-bg-opacity))}.bg-red-500{--tw-bg-opacity:1;background-color:rgb(239 68 68/var(--tw-bg-opacity))}.bg-slate-200{--tw-bg-opacity:1;background-color:rgb(226 232 240/var(--tw-bg-opacity))}.bg-white{--tw-bg-opacity:1;background-color:rgb(255 255 255/var(--tw-bg-opacity))}.bg-opacity-25{--tw-bg-opacity:0.25}.p-2{padding:.5rem}.p-2\.5{padding:.625rem}.p-4{padding:1rem}.p-6{padding:1.5rem}.px-1{padding-left:.25rem;padding-right:.25rem}.px-2{padding-left:.5rem;padding-right:.5rem}.px-4{padding-left:1rem;padding-right:1rem}.px-5{padding-left:1.25rem;padding-right:1.25rem}.py-2{padding-top:.5rem;padding-bottom:.5rem}.py-2\.5{padding-top:.625rem;padding-bottom:.625rem}.text-left{text-align:left}.text-center{text-align:center}.text-right{text-align:right}.align-middle{vertical-align:middle}.text-5xl{font-size:3rem;line-height:1}.text-lg{font-size:1.125rem;line-height:1.75rem}.text-sm{font-size:.875rem;line-height:1.25rem}.font-extrabold{font-weight:800}.font-medium{font-weight:500}.font-semibold{font-weight:600}.leading-6{line-height:1.5rem}.tracking-tight{letter-spacing:-.025em}.text-gray-500{--tw-text-opacity:1;color:rgb(107 114 128/var(--tw-text-opacity))}.text-gray-900{--tw-text-opacity:1;color:rgb(17 24 39/var(--tw-text-opacity))}.text-indigo-100{--tw-text-opacity:1;color:rgb(224 231 255/var(--tw-text-opacity))}.text-indigo-900{--tw-text-opacity:1;color:rgb(49 46 129/var(--tw-text-opacity))}.text-slate-500{--tw-text-opacity:1;color:rgb(100 116 139/var(--tw-text-opacity))}.text-slate-900{--tw-text-opacity:1;color:rgb(15 23 42/var(--tw-text-opacity))}.text-white{--tw-text-opacity:1;color:rgb(255 255 255/var(--tw-text-opacity))}.underline{text-decoration-line:underline}.opacity-0{opacity:0}.opacity-100{opacity:1}.shadow-xl{--tw-shadow:0 20px 25px -5px rgba(0,0,0,.1),0 8px 10px -6px rgba(0,0,0,.1);--tw-shadow-colored:0 20px 25px -5px var(--tw-shadow-color),0 8px 10px -6px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow)}.shadow-black\/5{--tw-shadow-color:rgba(0,0,0,.05);--tw-shadow:var(--tw-shadow-colored)}.ring-1{--tw-ring-offset-shadow:var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow:var(--tw-ring-inset) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow,0 0 #0000)}.ring-slate-700\/10{--tw-ring-color:rgba(51,65,85,.1)}.filter{filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.transition-all{transition-property:all;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.duration-100{transition-duration:.1s}.duration-200{transition-duration:.2s}.duration-300{transition-duration:.3s}.ease-in{transition-timing-function:cubic-bezier(.4,0,1,1)}.ease-out{transition-timing-function:cubic-bezier(0,0,.2,1)}#root,body,html{height:100%}audio::-webkit-media-controls-panel{background-color:#fff}.container{width:41rem;max-width:95vw}.hover\:bg-blue-800:hover{--tw-bg-opacity:1;background-color:rgb(30 64 175/var(--tw-bg-opacity))}.hover\:bg-green-600:hover{--tw-bg-opacity:1;background-color:rgb(22 163 74/var(--tw-bg-opacity))}.hover\:bg-indigo-200:hover{--tw-bg-opacity:1;background-color:rgb(199 210 254/var(--tw-bg-opacity))}.hover\:bg-indigo-50:hover{--tw-bg-opacity:1;background-color:rgb(238 242 255/var(--tw-bg-opacity))}.hover\:bg-indigo-500:hover{--tw-bg-opacity:1;background-color:rgb(99 102 241/var(--tw-bg-opacity))}.hover\:bg-red-600:hover{--tw-bg-opacity:1;background-color:rgb(220 38 38/var(--tw-bg-opacity))}.hover\:text-indigo-600:hover{--tw-text-opacity:1;color:rgb(79 70 229/var(--tw-text-opacity))}.focus\:border-blue-500:focus{--tw-border-opacity:1;border-color:rgb(59 130 246/var(--tw-border-opacity))}.focus\:outline-none:focus{outline:2px solid transparent;outline-offset:2px}.focus\:ring-4:focus{--tw-ring-offset-shadow:var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow:var(--tw-ring-inset) 0 0 0 calc(4px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow,0 0 #0000)}.focus\:ring-blue-300:focus{--tw-ring-opacity:1;--tw-ring-color:rgb(147 197 253/var(--tw-ring-opacity))}.focus\:ring-blue-500:focus{--tw-ring-opacity:1;--tw-ring-color:rgb(59 130 246/var(--tw-ring-opacity))}.focus\:ring-green-300:focus{--tw-ring-opacity:1;--tw-ring-color:rgb(134 239 172/var(--tw-ring-opacity))}.focus-visible\:ring-2:focus-visible{--tw-ring-offset-shadow:var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow:var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow,0 0 #0000)}.focus-visible\:ring-indigo-500:focus-visible{--tw-ring-opacity:1;--tw-ring-color:rgb(99 102 241/var(--tw-ring-opacity))}.focus-visible\:ring-offset-2:focus-visible{--tw-ring-offset-width:2px}@media (min-width:640px){.sm\:text-2xl{font-size:1.5rem;line-height:2rem}.sm\:text-7xl{font-size:4.5rem;line-height:1}}@media (prefers-color-scheme:dark){.dark\:border-gray-600{--tw-border-opacity:1;border-color:rgb(75 85 99/var(--tw-border-opacity))}.dark\:bg-blue-600{--tw-bg-opacity:1;background-color:rgb(37 99 235/var(--tw-bg-opacity))}.dark\:bg-gray-700{--tw-bg-opacity:1;background-color:rgb(55 65 81/var(--tw-bg-opacity))}.dark\:bg-green-600{--tw-bg-opacity:1;background-color:rgb(22 163 74/var(--tw-bg-opacity))}.dark\:text-white{--tw-text-opacity:1;color:rgb(255 255 255/var(--tw-text-opacity))}.dark\:placeholder-gray-400::-moz-placeholder{--tw-placeholder-opacity:1;color:rgb(156 163 175/var(--tw-placeholder-opacity))}.dark\:placeholder-gray-400::placeholder{--tw-placeholder-opacity:1;color:rgb(156 163 175/var(--tw-placeholder-opacity))}.dark\:hover\:bg-blue-700:hover{--tw-bg-opacity:1;background-color:rgb(29 78 216/var(--tw-bg-opacity))}.dark\:hover\:bg-green-700:hover{--tw-bg-opacity:1;background-color:rgb(21 128 61/var(--tw-bg-opacity))}.dark\:focus\:border-blue-500:focus{--tw-border-opacity:1;border-color:rgb(59 130 246/var(--tw-border-opacity))}.dark\:focus\:ring-blue-500:focus{--tw-ring-opacity:1;--tw-ring-color:rgb(59 130 246/var(--tw-ring-opacity))}.dark\:focus\:ring-blue-800:focus{--tw-ring-opacity:1;--tw-ring-color:rgb(30 64 175/var(--tw-ring-opacity))}.dark\:focus\:ring-green-800:focus{--tw-ring-opacity:1;--tw-ring-color:rgb(22 101 52/var(--tw-ring-opacity))}}
|
_next/static/{5QDmEoxEwzqpz4kJky5dw β ctxmQKeU5HzCjFRh7FkKs}/_buildManifest.js
RENAMED
@@ -1 +1 @@
|
|
1 |
-
self.__BUILD_MANIFEST={__rewrites:{afterFiles:[],beforeFiles:[],fallback:[]},"/_error":["static/chunks/pages/_error-
|
|
|
1 |
+
self.__BUILD_MANIFEST={__rewrites:{afterFiles:[],beforeFiles:[],fallback:[]},"/_error":["static/chunks/pages/_error-1be831200e60c5c0.js"],sortedPages:["/_app","/_error"]},self.__BUILD_MANIFEST_CB&&self.__BUILD_MANIFEST_CB();
|
_next/static/{5QDmEoxEwzqpz4kJky5dw β ctxmQKeU5HzCjFRh7FkKs}/_ssgManifest.js
RENAMED
File without changes
|
icons/android-icon-192x192.png
DELETED
Binary file (705 Bytes)
|
|
icons/android-icon-512x512.png
DELETED
Binary file (705 Bytes)
|
|
icons/apple-icon-16x16.png
DELETED
Binary file (427 Bytes)
|
|
icons/apple-icon-32x32.png
DELETED
Binary file (472 Bytes)
|
|
icons/apple-icon.png
DELETED
Binary file (667 Bytes)
|
|
icons/react.svg
ADDED
icons/share.png
DELETED
Binary file (756 Bytes)
|
|
icons/{safari-pinned-tab.svg β vercel.svg}
RENAMED
File without changes
|
index.html
CHANGED
@@ -1 +1 @@
|
|
1 |
-
<!DOCTYPE html><html lang="en"><head><meta charSet="utf-8"/><meta name="viewport" content="width=device-width, initial-scale=1"/><link rel="stylesheet" href="/_next/static/css/
|
|
|
1 |
+
<!DOCTYPE html><html lang="en"><head><meta charSet="utf-8"/><meta name="viewport" content="width=device-width, initial-scale=1"/><link rel="stylesheet" href="/_next/static/css/25145688737dc9c2.css" data-precedence="next"/><link rel="preload" as="script" fetchPriority="low" href="/_next/static/chunks/webpack-12ca2ea8ed93dae2.js"/><script src="/_next/static/chunks/fd9d1056-7caaac656b5ccd86.js" async=""></script><script src="/_next/static/chunks/190-a03d46f1813684ea.js" async=""></script><script src="/_next/static/chunks/main-app-2781f8dc46d71368.js" async=""></script><script src="/_next/static/chunks/72-b9a6a0da3e447ebd.js" async=""></script><script src="/_next/static/chunks/51-de6ec599ce154973.js" async=""></script><script src="/_next/static/chunks/app/page-8d8ca48a7333bb5c.js" async=""></script><script src="/_next/static/chunks/app/layout-e0223e57eaadc292.js" async=""></script><title>PhoWhisper using Transformers.js + Next.js</title><meta name="description" content="PhoWhisper: Automatic Speech Recognition for Vietnamese (2024) using Transformer.js + Next.js"/><meta name="application-name" content="PhoWhisper-next"/><link rel="manifest" href="/manifest.json" crossorigin="use-credentials"/><meta name="keywords" content="PhoWhisper,Transformers.js,Next.js,speech-regconition,vietnamese"/><meta name="format-detection" content="telephone=no"/><meta name="apple-mobile-web-app-capable" content="yes"/><meta name="apple-mobile-web-app-title" content="PhoWhisper using Transformers.js + Next.js"/><meta name="apple-mobile-web-app-status-bar-style" content="default"/><meta property="og:title" content="PhoWhisper using Transformers.js + Next.js"/><meta property="og:description" content="PhoWhisper: Automatic Speech Recognition for Vietnamese (2024) using Transformer.js + Next.js"/><meta property="og:url" content="https://hf.co/spaces/huuquyet/PhoWhisper-next/"/><meta property="og:site_name" content="PhoWhisper-next"/><meta property="og:image" content="https://${process.env.vercel_url}/icons/vercel.svg"/><meta property="og:type" content="website"/><meta name="twitter:card" content="summary"/><meta name="twitter:site" content="@HuuQuyetNg"/><meta name="twitter:title" content="PhoWhisper using Transformers.js + Next.js"/><meta name="twitter:description" content="PhoWhisper: Automatic Speech Recognition for Vietnamese (2024) using Transformer.js + Next.js"/><meta name="twitter:image" content="https://${process.env.vercel_url}/icons/vercel.svg"/><script src="/_next/static/chunks/polyfills-78c92fac7aa8fdd8.js" noModule=""></script></head><body><div id="root"><!--$!--><template data-dgst="BAILOUT_TO_CLIENT_SIDE_RENDERING"></template><!--/$--></div><script src="/_next/static/chunks/webpack-12ca2ea8ed93dae2.js" async=""></script><script>(self.__next_f=self.__next_f||[]).push([0]);self.__next_f.push([2,null])</script><script>self.__next_f.push([1,"1:HL[\"/_next/static/css/25145688737dc9c2.css\",\"style\"]\n"])</script><script>self.__next_f.push([1,"2:I[5751,[],\"\"]\n4:\"$Sreact.suspense\"\n5:I[912,[\"72\",\"static/chunks/72-b9a6a0da3e447ebd.js\",\"51\",\"static/chunks/51-de6ec599ce154973.js\",\"931\",\"static/chunks/app/page-8d8ca48a7333bb5c.js\"],\"BailoutToCSR\"]\n7:I[9275,[],\"\"]\n8:I[1343,[],\"\"]\n9:I[1164,[\"185\",\"static/chunks/app/layout-e0223e57eaadc292.js\"],\"Analytics\"]\nb:I[6130,[],\"\"]\nc:[]\n"])</script><script>self.__next_f.push([1,"0:[[[\"$\",\"link\",\"0\",{\"rel\":\"stylesheet\",\"href\":\"/_next/static/css/25145688737dc9c2.css\",\"precedence\":\"next\",\"crossOrigin\":\"$undefined\"}]],[\"$\",\"$L2\",null,{\"buildId\":\"ctxmQKeU5HzCjFRh7FkKs\",\"assetPrefix\":\"\",\"initialCanonicalUrl\":\"/\",\"initialTree\":[\"\",{\"children\":[\"__PAGE__\",{}]},\"$undefined\",\"$undefined\",true],\"initialSeedData\":[\"\",{\"children\":[\"__PAGE__\",{},[[\"$L3\",[\"$\",\"$4\",null,{\"fallback\":null,\"children\":[\"$\",\"$L5\",null,{\"reason\":\"next/dynamic\",\"children\":\"$L6\"}]}]],null],null]},[[\"$\",\"html\",null,{\"lang\":\"en\",\"children\":[[\"$\",\"head\",null,{}],[\"$\",\"body\",null,{\"children\":[\"$\",\"div\",null,{\"id\":\"root\",\"children\":[[\"$\",\"$L7\",null,{\"parallelRouterKey\":\"children\",\"segmentPath\":[\"children\"],\"error\":\"$undefined\",\"errorStyles\":\"$undefined\",\"errorScripts\":\"$undefined\",\"template\":[\"$\",\"$L8\",null,{}],\"templateStyles\":\"$undefined\",\"templateScripts\":\"$undefined\",\"notFound\":[[\"$\",\"title\",null,{\"children\":\"404: This page could not be found.\"}],[\"$\",\"div\",null,{\"style\":{\"fontFamily\":\"system-ui,\\\"Segoe UI\\\",Roboto,Helvetica,Arial,sans-serif,\\\"Apple Color Emoji\\\",\\\"Segoe UI Emoji\\\"\",\"height\":\"100vh\",\"textAlign\":\"center\",\"display\":\"flex\",\"flexDirection\":\"column\",\"alignItems\":\"center\",\"justifyContent\":\"center\"},\"children\":[\"$\",\"div\",null,{\"children\":[[\"$\",\"style\",null,{\"dangerouslySetInnerHTML\":{\"__html\":\"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}\"}}],[\"$\",\"h1\",null,{\"className\":\"next-error-h1\",\"style\":{\"display\":\"inline-block\",\"margin\":\"0 20px 0 0\",\"padding\":\"0 23px 0 0\",\"fontSize\":24,\"fontWeight\":500,\"verticalAlign\":\"top\",\"lineHeight\":\"49px\"},\"children\":\"404\"}],[\"$\",\"div\",null,{\"style\":{\"display\":\"inline-block\"},\"children\":[\"$\",\"h2\",null,{\"style\":{\"fontSize\":14,\"fontWeight\":400,\"lineHeight\":\"49px\",\"margin\":0},\"children\":\"This page could not be found.\"}]}]]}]}]],\"notFoundStyles\":[],\"styles\":null}],[\"$\",\"$L9\",null,{}]]}]}]]}],null],null],\"couldBeIntercepted\":false,\"initialHead\":[false,\"$La\"],\"globalErrorComponent\":\"$b\",\"missingSlots\":\"$Wc\"}]]\n"])</script><script>self.__next_f.push([1,"d:I[4543,[\"72\",\"static/chunks/72-b9a6a0da3e447ebd.js\",\"51\",\"static/chunks/51-de6ec599ce154973.js\",\"931\",\"static/chunks/app/page-8d8ca48a7333bb5c.js\"],\"default\"]\n6:[\"$\",\"$Ld\",null,{}]\na:[[\"$\",\"meta\",\"0\",{\"name\":\"viewport\",\"content\":\"width=device-width, initial-scale=1\"}],[\"$\",\"meta\",\"1\",{\"charSet\":\"utf-8\"}],[\"$\",\"title\",\"2\",{\"children\":\"PhoWhisper using Transformers.js + Next.js\"}],[\"$\",\"meta\",\"3\",{\"name\":\"description\",\"content\":\"PhoWhisper: Automatic Speech Recognition for Vietnamese (2024) using Transformer.js + Next.js\"}],[\"$\",\"meta\",\"4\",{\"name\":\"application-name\",\"content\":\"PhoWhisper-next\"}],[\"$\",\"link\",\"5\",{\"rel\":\"manifest\",\"href\":\"/manifest.json\",\"crossOrigin\":\"use-credentials\"}],[\"$\",\"meta\",\"6\",{\"name\":\"keywords\",\"content\":\"PhoWhisper,Transformers.js,Next.js,speech-regconition,vietnamese\"}],[\"$\",\"meta\",\"7\",{\"name\":\"format-detection\",\"content\":\"telephone=no\"}],[\"$\",\"meta\",\"8\",{\"name\":\"apple-mobile-web-app-capable\",\"content\":\"yes\"}],[\"$\",\"meta\",\"9\",{\"name\":\"apple-mobile-web-app-title\",\"content\":\"PhoWhisper using Transformers.js + Next.js\"}],[\"$\",\"meta\",\"10\",{\"name\":\"apple-mobile-web-app-status-bar-style\",\"content\":\"default\"}],[\"$\",\"meta\",\"11\",{\"property\":\"og:title\",\"content\":\"PhoWhisper using Transformers.js + Next.js\"}],[\"$\",\"meta\",\"12\",{\"property\":\"og:description\",\"content\":\"PhoWhisper: Automatic Speech Recognition for Vietnamese (2024) using Transformer.js + Next.js\"}],[\"$\",\"meta\",\"13\",{\"property\":\"og:url\",\"content\":\"https://hf.co/spaces/huuquyet/PhoWhisper-next/\"}],[\"$\",\"meta\",\"14\",{\"property\":\"og:site_name\",\"content\":\"PhoWhisper-next\"}],[\"$\",\"meta\",\"15\",{\"property\":\"og:image\",\"content\":\"https://${process.env.vercel_url}/icons/vercel.svg\"}],[\"$\",\"meta\",\"16\",{\"property\":\"og:type\",\"content\":\"website\"}],[\"$\",\"meta\",\"17\",{\"name\":\"twitter:card\",\"content\":\"summary\"}],[\"$\",\"meta\",\"18\",{\"name\":\"twitter:site\",\"content\":\"@HuuQuyetNg\"}],[\"$\",\"meta\",\"19\",{\"name\":\"twitter:title\",\"content\":\"PhoWhisper using Transformers.js + Next.js\"}],[\"$\",\"meta\",\"20\",{\"name\":\"twitter:description\",\"content\":\"PhoWhisper: Automatic Spe"])</script><script>self.__next_f.push([1,"ech Recognition for Vietnamese (2024) using Transformer.js + Next.js\"}],[\"$\",\"meta\",\"21\",{\"name\":\"twitter:image\",\"content\":\"https://${process.env.vercel_url}/icons/vercel.svg\"}]]\n3:null\n"])</script></body></html>
|
index.txt
CHANGED
@@ -1,10 +1,10 @@
|
|
1 |
2:"$Sreact.suspense"
|
2 |
-
3:I[
|
3 |
-
5:I[
|
4 |
-
6:I[
|
5 |
-
7:I[
|
6 |
-
0:["
|
7 |
-
9:I[
|
8 |
4:["$","$L9",null,{}]
|
9 |
-
8:[["$","meta","0",{"name":"viewport","content":"width=device-width, initial-scale=1"}],["$","meta","1",{"charSet":"utf-8"}],["$","title","2",{"children":"PhoWhisper using Transformers.js + Next.js"}],["$","meta","3",{"name":"description","content":"PhoWhisper: Automatic Speech Recognition for Vietnamese (2024) using Transformer.js + Next.js"}],["$","meta","4",{"name":"application-name","content":"PhoWhisper-next"}],["$","link","5",{"rel":"manifest","href":"/manifest.json","crossOrigin":"use-credentials"}],["$","meta","6",{"name":"keywords","content":"PhoWhisper,Transformers.js,Next.js,speech-regconition,vietnamese"}],["$","meta","7",{"name":"format-detection","content":"telephone=no"}],["$","meta","8",{"name":"apple-mobile-web-app-capable","content":"yes"}],["$","meta","9",{"name":"apple-mobile-web-app-title","content":"PhoWhisper using Transformers.js + Next.js"}],["$","meta","10",{"name":"apple-mobile-web-app-status-bar-style","content":"default"}],["$","meta","11",{"property":"og:title","content":"PhoWhisper using Transformers.js + Next.js"}],["$","meta","12",{"property":"og:description","content":"PhoWhisper: Automatic Speech Recognition for Vietnamese (2024) using Transformer.js + Next.js"}],["$","meta","13",{"property":"og:url","content":"https://hf.co/spaces/huuquyet/PhoWhisper-next/"}],["$","meta","14",{"property":"og:site_name","content":"PhoWhisper-next"}],["$","meta","15",{"property":"og:image","content":"https://${process.env.vercel_url}/
|
10 |
1:null
|
|
|
1 |
2:"$Sreact.suspense"
|
2 |
+
3:I[912,["72","static/chunks/72-b9a6a0da3e447ebd.js","51","static/chunks/51-de6ec599ce154973.js","931","static/chunks/app/page-8d8ca48a7333bb5c.js"],"BailoutToCSR"]
|
3 |
+
5:I[9275,[],""]
|
4 |
+
6:I[1343,[],""]
|
5 |
+
7:I[1164,["185","static/chunks/app/layout-e0223e57eaadc292.js"],"Analytics"]
|
6 |
+
0:["ctxmQKeU5HzCjFRh7FkKs",[[["",{"children":["__PAGE__",{}]},"$undefined","$undefined",true],["",{"children":["__PAGE__",{},[["$L1",["$","$2",null,{"fallback":null,"children":["$","$L3",null,{"reason":"next/dynamic","children":"$L4"}]}]],null],null]},[["$","html",null,{"lang":"en","children":[["$","head",null,{}],["$","body",null,{"children":["$","div",null,{"id":"root","children":[["$","$L5",null,{"parallelRouterKey":"children","segmentPath":["children"],"error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L6",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":[["$","title",null,{"children":"404: This page could not be found."}],["$","div",null,{"style":{"fontFamily":"system-ui,\"Segoe UI\",Roboto,Helvetica,Arial,sans-serif,\"Apple Color Emoji\",\"Segoe UI Emoji\"","height":"100vh","textAlign":"center","display":"flex","flexDirection":"column","alignItems":"center","justifyContent":"center"},"children":["$","div",null,{"children":[["$","style",null,{"dangerouslySetInnerHTML":{"__html":"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}"}}],["$","h1",null,{"className":"next-error-h1","style":{"display":"inline-block","margin":"0 20px 0 0","padding":"0 23px 0 0","fontSize":24,"fontWeight":500,"verticalAlign":"top","lineHeight":"49px"},"children":"404"}],["$","div",null,{"style":{"display":"inline-block"},"children":["$","h2",null,{"style":{"fontSize":14,"fontWeight":400,"lineHeight":"49px","margin":0},"children":"This page could not be found."}]}]]}]}]],"notFoundStyles":[],"styles":null}],["$","$L7",null,{}]]}]}]]}],null],null],[[["$","link","0",{"rel":"stylesheet","href":"/_next/static/css/25145688737dc9c2.css","precedence":"next","crossOrigin":"$undefined"}]],"$L8"]]]]
|
7 |
+
9:I[4543,["72","static/chunks/72-b9a6a0da3e447ebd.js","51","static/chunks/51-de6ec599ce154973.js","931","static/chunks/app/page-8d8ca48a7333bb5c.js"],"default"]
|
8 |
4:["$","$L9",null,{}]
|
9 |
+
8:[["$","meta","0",{"name":"viewport","content":"width=device-width, initial-scale=1"}],["$","meta","1",{"charSet":"utf-8"}],["$","title","2",{"children":"PhoWhisper using Transformers.js + Next.js"}],["$","meta","3",{"name":"description","content":"PhoWhisper: Automatic Speech Recognition for Vietnamese (2024) using Transformer.js + Next.js"}],["$","meta","4",{"name":"application-name","content":"PhoWhisper-next"}],["$","link","5",{"rel":"manifest","href":"/manifest.json","crossOrigin":"use-credentials"}],["$","meta","6",{"name":"keywords","content":"PhoWhisper,Transformers.js,Next.js,speech-regconition,vietnamese"}],["$","meta","7",{"name":"format-detection","content":"telephone=no"}],["$","meta","8",{"name":"apple-mobile-web-app-capable","content":"yes"}],["$","meta","9",{"name":"apple-mobile-web-app-title","content":"PhoWhisper using Transformers.js + Next.js"}],["$","meta","10",{"name":"apple-mobile-web-app-status-bar-style","content":"default"}],["$","meta","11",{"property":"og:title","content":"PhoWhisper using Transformers.js + Next.js"}],["$","meta","12",{"property":"og:description","content":"PhoWhisper: Automatic Speech Recognition for Vietnamese (2024) using Transformer.js + Next.js"}],["$","meta","13",{"property":"og:url","content":"https://hf.co/spaces/huuquyet/PhoWhisper-next/"}],["$","meta","14",{"property":"og:site_name","content":"PhoWhisper-next"}],["$","meta","15",{"property":"og:image","content":"https://${process.env.vercel_url}/icons/vercel.svg"}],["$","meta","16",{"property":"og:type","content":"website"}],["$","meta","17",{"name":"twitter:card","content":"summary"}],["$","meta","18",{"name":"twitter:site","content":"@HuuQuyetNg"}],["$","meta","19",{"name":"twitter:title","content":"PhoWhisper using Transformers.js + Next.js"}],["$","meta","20",{"name":"twitter:description","content":"PhoWhisper: Automatic Speech Recognition for Vietnamese (2024) using Transformer.js + Next.js"}],["$","meta","21",{"name":"twitter:image","content":"https://${process.env.vercel_url}/icons/vercel.svg"}]]
|
10 |
1:null
|
manifest.json
CHANGED
@@ -3,21 +3,21 @@
|
|
3 |
"short_name": "PhoWhisper-next",
|
4 |
"icons": [
|
5 |
{
|
6 |
-
"src": "/icons/
|
7 |
"sizes": "64x64 32x32 24x24 16x16",
|
8 |
-
"type": "
|
9 |
"purpose": "any maskable"
|
10 |
},
|
11 |
{
|
12 |
-
"src": "/icons/
|
13 |
"sizes": "192x192",
|
14 |
-
"type": "
|
15 |
"purpose": "any maskable"
|
16 |
},
|
17 |
{
|
18 |
-
"src": "/icons/
|
19 |
"sizes": "512x512",
|
20 |
-
"type": "
|
21 |
"purpose": "any maskable"
|
22 |
}
|
23 |
],
|
|
|
3 |
"short_name": "PhoWhisper-next",
|
4 |
"icons": [
|
5 |
{
|
6 |
+
"src": "/icons/vercel.svg",
|
7 |
"sizes": "64x64 32x32 24x24 16x16",
|
8 |
+
"type": "svg",
|
9 |
"purpose": "any maskable"
|
10 |
},
|
11 |
{
|
12 |
+
"src": "/icons/vercel.svg",
|
13 |
"sizes": "192x192",
|
14 |
+
"type": "svg",
|
15 |
"purpose": "any maskable"
|
16 |
},
|
17 |
{
|
18 |
+
"src": "/icons/vercel.svg",
|
19 |
"sizes": "512x512",
|
20 |
+
"type": "svg",
|
21 |
"purpose": "any maskable"
|
22 |
}
|
23 |
],
|
sw.js
CHANGED
@@ -1 +1 @@
|
|
1 |
-
if(!self.define){let e,s={};const a=(a,n)=>(a=new URL(a+".js",n).href,s[a]||new Promise((s=>{if("document"in self){const e=document.createElement("script");e.src=a,e.onload=s,document.head.appendChild(e)}else e=a,importScripts(a),s()})).then((()=>{let e=s[a];if(!e)throw new Error(`Module ${a} didnβt register its module`);return e})));self.define=(n,
|
|
|
1 |
+
if(!self.define){let e,s={};const a=(a,n)=>(a=new URL(a+".js",n).href,s[a]||new Promise((s=>{if("document"in self){const e=document.createElement("script");e.src=a,e.onload=s,document.head.appendChild(e)}else e=a,importScripts(a),s()})).then((()=>{let e=s[a];if(!e)throw new Error(`Module ${a} didnβt register its module`);return e})));self.define=(n,t)=>{const c=e||("document"in self?document.currentScript.src:"")||location.href;if(s[c])return;let i={};const r=e=>a(e,c),o={module:{uri:c},exports:i,require:r};s[c]=Promise.all(n.map((e=>o[e]||r(e)))).then((e=>(t(...e),i)))}}define(["./workbox-f1770938"],(function(e){"use strict";importScripts(),self.skipWaiting(),e.clientsClaim(),e.precacheAndRoute([{url:"/_next/static/chunks/190-a03d46f1813684ea.js",revision:"ctxmQKeU5HzCjFRh7FkKs"},{url:"/_next/static/chunks/251.b8ce00a7f6eefa34.js",revision:"b8ce00a7f6eefa34"},{url:"/_next/static/chunks/360.47885073fb31529e.js",revision:"47885073fb31529e"},{url:"/_next/static/chunks/50bd76a3.3d24d573e3ca7a71.js",revision:"3d24d573e3ca7a71"},{url:"/_next/static/chunks/51-de6ec599ce154973.js",revision:"ctxmQKeU5HzCjFRh7FkKs"},{url:"/_next/static/chunks/590caa2a.be5af588047a1c85.js",revision:"be5af588047a1c85"},{url:"/_next/static/chunks/6139e184.f5956607c9895a14.js",revision:"f5956607c9895a14"},{url:"/_next/static/chunks/72-b9a6a0da3e447ebd.js",revision:"ctxmQKeU5HzCjFRh7FkKs"},{url:"/_next/static/chunks/app/_not-found/page-367734fbb4e34400.js",revision:"ctxmQKeU5HzCjFRh7FkKs"},{url:"/_next/static/chunks/app/layout-e0223e57eaadc292.js",revision:"ctxmQKeU5HzCjFRh7FkKs"},{url:"/_next/static/chunks/app/page-8d8ca48a7333bb5c.js",revision:"ctxmQKeU5HzCjFRh7FkKs"},{url:"/_next/static/chunks/fd9d1056-7caaac656b5ccd86.js",revision:"ctxmQKeU5HzCjFRh7FkKs"},{url:"/_next/static/chunks/framework-f66176bb897dc684.js",revision:"ctxmQKeU5HzCjFRh7FkKs"},{url:"/_next/static/chunks/main-app-2781f8dc46d71368.js",revision:"ctxmQKeU5HzCjFRh7FkKs"},{url:"/_next/static/chunks/main-cf1084da7dc80b27.js",revision:"ctxmQKeU5HzCjFRh7FkKs"},{url:"/_next/static/chunks/pages/_app-6a626577ffa902a4.js",revision:"ctxmQKeU5HzCjFRh7FkKs"},{url:"/_next/static/chunks/pages/_error-1be831200e60c5c0.js",revision:"ctxmQKeU5HzCjFRh7FkKs"},{url:"/_next/static/chunks/polyfills-78c92fac7aa8fdd8.js",revision:"79330112775102f91e1010318bae2bd3"},{url:"/_next/static/chunks/webpack-12ca2ea8ed93dae2.js",revision:"ctxmQKeU5HzCjFRh7FkKs"},{url:"/_next/static/css/25145688737dc9c2.css",revision:"25145688737dc9c2"},{url:"/_next/static/ctxmQKeU5HzCjFRh7FkKs/_buildManifest.js",revision:"2ec694eb52ae4f523f265a46bae4d768"},{url:"/_next/static/ctxmQKeU5HzCjFRh7FkKs/_ssgManifest.js",revision:"b6652df95db52feb4daf4eca35380933"},{url:"/favicon.ico",revision:"4106c96e0a55d35b1b13fa4281a907b7"},{url:"/icons/react.svg",revision:"f0402b67b6ce880f65666bb49e841696"},{url:"/icons/vercel.svg",revision:"5876746bbc008fdab40fd1abf568ca6b"},{url:"/manifest.json",revision:"7c94b8bd5ec49e002499652298b8efec"}],{ignoreURLParametersMatching:[/^utm_/,/^fbclid$/]}),e.cleanupOutdatedCaches(),e.registerRoute("/",new e.NetworkFirst({cacheName:"start-url",plugins:[{cacheWillUpdate:async({response:e})=>e&&"opaqueredirect"===e.type?new Response(e.body,{status:200,statusText:"OK",headers:e.headers}):e}]}),"GET"),e.registerRoute(/^https:\/\/fonts\.(?:gstatic)\.com\/.*/i,new e.CacheFirst({cacheName:"google-fonts-webfonts",plugins:[new e.ExpirationPlugin({maxEntries:4,maxAgeSeconds:31536e3})]}),"GET"),e.registerRoute(/^https:\/\/fonts\.(?:googleapis)\.com\/.*/i,new e.StaleWhileRevalidate({cacheName:"google-fonts-stylesheets",plugins:[new e.ExpirationPlugin({maxEntries:4,maxAgeSeconds:604800})]}),"GET"),e.registerRoute(/\.(?:eot|otf|ttc|ttf|woff|woff2|font.css)$/i,new e.StaleWhileRevalidate({cacheName:"static-font-assets",plugins:[new e.ExpirationPlugin({maxEntries:4,maxAgeSeconds:604800})]}),"GET"),e.registerRoute(/\.(?:jpg|jpeg|gif|png|svg|ico|webp)$/i,new e.StaleWhileRevalidate({cacheName:"static-image-assets",plugins:[new e.ExpirationPlugin({maxEntries:64,maxAgeSeconds:2592e3})]}),"GET"),e.registerRoute(/\/_next\/static.+\.js$/i,new e.CacheFirst({cacheName:"next-static-js-assets",plugins:[new e.ExpirationPlugin({maxEntries:64,maxAgeSeconds:86400})]}),"GET"),e.registerRoute(/\/_next\/image\?url=.+$/i,new e.StaleWhileRevalidate({cacheName:"next-image",plugins:[new e.ExpirationPlugin({maxEntries:64,maxAgeSeconds:86400})]}),"GET"),e.registerRoute(/\.(?:mp3|wav|ogg)$/i,new e.CacheFirst({cacheName:"static-audio-assets",plugins:[new e.RangeRequestsPlugin,new e.ExpirationPlugin({maxEntries:32,maxAgeSeconds:86400})]}),"GET"),e.registerRoute(/\.(?:mp4|webm)$/i,new e.CacheFirst({cacheName:"static-video-assets",plugins:[new e.RangeRequestsPlugin,new e.ExpirationPlugin({maxEntries:32,maxAgeSeconds:86400})]}),"GET"),e.registerRoute(/\.(?:js)$/i,new e.StaleWhileRevalidate({cacheName:"static-js-assets",plugins:[new e.ExpirationPlugin({maxEntries:48,maxAgeSeconds:86400})]}),"GET"),e.registerRoute(/\.(?:css|less)$/i,new e.StaleWhileRevalidate({cacheName:"static-style-assets",plugins:[new e.ExpirationPlugin({maxEntries:32,maxAgeSeconds:86400})]}),"GET"),e.registerRoute(/\/_next\/data\/.+\/.+\.json$/i,new e.StaleWhileRevalidate({cacheName:"next-data",plugins:[new e.ExpirationPlugin({maxEntries:32,maxAgeSeconds:86400})]}),"GET"),e.registerRoute(/\.(?:json|xml|csv)$/i,new e.NetworkFirst({cacheName:"static-data-assets",plugins:[new e.ExpirationPlugin({maxEntries:32,maxAgeSeconds:86400})]}),"GET"),e.registerRoute((({sameOrigin:e,url:{pathname:s}})=>!(!e||s.startsWith("/api/auth/callback")||!s.startsWith("/api/"))),new e.NetworkFirst({cacheName:"apis",networkTimeoutSeconds:10,plugins:[new e.ExpirationPlugin({maxEntries:16,maxAgeSeconds:86400})]}),"GET"),e.registerRoute((({request:e,url:{pathname:s},sameOrigin:a})=>"1"===e.headers.get("RSC")&&"1"===e.headers.get("Next-Router-Prefetch")&&a&&!s.startsWith("/api/")),new e.NetworkFirst({cacheName:"pages-rsc-prefetch",plugins:[new e.ExpirationPlugin({maxEntries:32,maxAgeSeconds:86400})]}),"GET"),e.registerRoute((({request:e,url:{pathname:s},sameOrigin:a})=>"1"===e.headers.get("RSC")&&a&&!s.startsWith("/api/")),new e.NetworkFirst({cacheName:"pages-rsc",plugins:[new e.ExpirationPlugin({maxEntries:32,maxAgeSeconds:86400})]}),"GET"),e.registerRoute((({url:{pathname:e},sameOrigin:s})=>s&&!e.startsWith("/api/")),new e.NetworkFirst({cacheName:"pages",plugins:[new e.ExpirationPlugin({maxEntries:32,maxAgeSeconds:86400})]}),"GET"),e.registerRoute((({sameOrigin:e})=>!e),new e.NetworkFirst({cacheName:"cross-origin",networkTimeoutSeconds:10,plugins:[new e.ExpirationPlugin({maxEntries:32,maxAgeSeconds:3600})]}),"GET")}));
|
workbox-0a19e6a8.js β workbox-f1770938.js
RENAMED
@@ -1 +1 @@
|
|
1 |
-
define(["exports"],(function(t){"use strict";try{self["workbox:core:7.0.0"]&&_()}catch(t){}const e=(t,...e)=>{let s=t;return e.length>0&&(s+=` :: ${JSON.stringify(e)}`),s};class s extends Error{constructor(t,s){super(e(t,s)),this.name=t,this.details=s}}try{self["workbox:routing:7.0.0"]&&_()}catch(t){}const n=t=>t&&"object"==typeof t?t:{handle:t};class r{constructor(t,e,s="GET"){this.handler=n(e),this.match=t,this.method=s}setCatchHandler(t){this.catchHandler=n(t)}}class i extends r{constructor(t,e,s){super((({url:e})=>{const s=t.exec(e.href);if(s&&(e.origin===location.origin||0===s.index))return s.slice(1)}),e,s)}}class a{constructor(){this.t=new Map,this.i=new Map}get routes(){return this.t}addFetchListener(){self.addEventListener("fetch",(t=>{const{request:e}=t,s=this.handleRequest({request:e,event:t});s&&t.respondWith(s)}))}addCacheListener(){self.addEventListener("message",(t=>{if(t.data&&"CACHE_URLS"===t.data.type){const{payload:e}=t.data,s=Promise.all(e.urlsToCache.map((e=>{"string"==typeof e&&(e=[e]);const s=new Request(...e);return this.handleRequest({request:s,event:t})})));t.waitUntil(s),t.ports&&t.ports[0]&&s.then((()=>t.ports[0].postMessage(!0)))}}))}handleRequest({request:t,event:e}){const s=new URL(t.url,location.href);if(!s.protocol.startsWith("http"))return;const n=s.origin===location.origin,{params:r,route:i}=this.findMatchingRoute({event:e,request:t,sameOrigin:n,url:s});let a=i&&i.handler;const o=t.method;if(!a&&this.i.has(o)&&(a=this.i.get(o)),!a)return;let c;try{c=a.handle({url:s,request:t,event:e,params:r})}catch(t){c=Promise.reject(t)}const h=i&&i.catchHandler;return c instanceof Promise&&(this.o||h)&&(c=c.catch((async n=>{if(h)try{return await h.handle({url:s,request:t,event:e,params:r})}catch(t){t instanceof Error&&(n=t)}if(this.o)return this.o.handle({url:s,request:t,event:e});throw n}))),c}findMatchingRoute({url:t,sameOrigin:e,request:s,event:n}){const r=this.t.get(s.method)||[];for(const i of r){let r;const a=i.match({url:t,sameOrigin:e,request:s,event:n});if(a)return r=a,(Array.isArray(r)&&0===r.length||a.constructor===Object&&0===Object.keys(a).length||"boolean"==typeof a)&&(r=void 0),{route:i,params:r}}return{}}setDefaultHandler(t,e="GET"){this.i.set(e,n(t))}setCatchHandler(t){this.o=n(t)}registerRoute(t){this.t.has(t.method)||this.t.set(t.method,[]),this.t.get(t.method).push(t)}unregisterRoute(t){if(!this.t.has(t.method))throw new s("unregister-route-but-not-found-with-method",{method:t.method});const e=this.t.get(t.method).indexOf(t);if(!(e>-1))throw new s("unregister-route-route-not-registered");this.t.get(t.method).splice(e,1)}}let o;const c=()=>(o||(o=new a,o.addFetchListener(),o.addCacheListener()),o);function h(t,e,n){let a;if("string"==typeof t){const s=new URL(t,location.href);a=new r((({url:t})=>t.href===s.href),e,n)}else if(t instanceof RegExp)a=new i(t,e,n);else if("function"==typeof t)a=new r(t,e,n);else{if(!(t instanceof r))throw new s("unsupported-route-type",{moduleName:"workbox-routing",funcName:"registerRoute",paramName:"capture"});a=t}return c().registerRoute(a),a}try{self["workbox:strategies:7.0.0"]&&_()}catch(t){}const u={cacheWillUpdate:async({response:t})=>200===t.status||0===t.status?t:null},l={googleAnalytics:"googleAnalytics",precache:"precache-v2",prefix:"workbox",runtime:"runtime",suffix:"undefined"!=typeof registration?registration.scope:""},f=t=>[l.prefix,t,l.suffix].filter((t=>t&&t.length>0)).join("-"),w=t=>t||f(l.precache),d=t=>t||f(l.runtime);function p(t,e){const s=new URL(t);for(const t of e)s.searchParams.delete(t);return s.href}class y{constructor(){this.promise=new Promise(((t,e)=>{this.resolve=t,this.reject=e}))}}const g=new Set;function m(t){return"string"==typeof t?new Request(t):t}class R{constructor(t,e){this.h={},Object.assign(this,e),this.event=e.event,this.u=t,this.l=new y,this.p=[],this.m=[...t.plugins],this.R=new Map;for(const t of this.m)this.R.set(t,{});this.event.waitUntil(this.l.promise)}async fetch(t){const{event:e}=this;let n=m(t);if("navigate"===n.mode&&e instanceof FetchEvent&&e.preloadResponse){const t=await e.preloadResponse;if(t)return t}const r=this.hasCallback("fetchDidFail")?n.clone():null;try{for(const t of this.iterateCallbacks("requestWillFetch"))n=await t({request:n.clone(),event:e})}catch(t){if(t instanceof Error)throw new s("plugin-error-request-will-fetch",{thrownErrorMessage:t.message})}const i=n.clone();try{let t;t=await fetch(n,"navigate"===n.mode?void 0:this.u.fetchOptions);for(const s of this.iterateCallbacks("fetchDidSucceed"))t=await s({event:e,request:i,response:t});return t}catch(t){throw r&&await this.runCallbacks("fetchDidFail",{error:t,event:e,originalRequest:r.clone(),request:i.clone()}),t}}async fetchAndCachePut(t){const e=await this.fetch(t),s=e.clone();return this.waitUntil(this.cachePut(t,s)),e}async cacheMatch(t){const e=m(t);let s;const{cacheName:n,matchOptions:r}=this.u,i=await this.getCacheKey(e,"read"),a=Object.assign(Object.assign({},r),{cacheName:n});s=await caches.match(i,a);for(const t of this.iterateCallbacks("cachedResponseWillBeUsed"))s=await t({cacheName:n,matchOptions:r,cachedResponse:s,request:i,event:this.event})||void 0;return s}async cachePut(t,e){const n=m(t);var r;await(r=0,new Promise((t=>setTimeout(t,r))));const i=await this.getCacheKey(n,"write");if(!e)throw new s("cache-put-with-no-response",{url:(a=i.url,new URL(String(a),location.href).href.replace(new RegExp(`^${location.origin}`),""))});var a;const o=await this.v(e);if(!o)return!1;const{cacheName:c,matchOptions:h}=this.u,u=await self.caches.open(c),l=this.hasCallback("cacheDidUpdate"),f=l?await async function(t,e,s,n){const r=p(e.url,s);if(e.url===r)return t.match(e,n);const i=Object.assign(Object.assign({},n),{ignoreSearch:!0}),a=await t.keys(e,i);for(const e of a)if(r===p(e.url,s))return t.match(e,n)}(u,i.clone(),["__WB_REVISION__"],h):null;try{await u.put(i,l?o.clone():o)}catch(t){if(t instanceof Error)throw"QuotaExceededError"===t.name&&await async function(){for(const t of g)await t()}(),t}for(const t of this.iterateCallbacks("cacheDidUpdate"))await t({cacheName:c,oldResponse:f,newResponse:o.clone(),request:i,event:this.event});return!0}async getCacheKey(t,e){const s=`${t.url} | ${e}`;if(!this.h[s]){let n=t;for(const t of this.iterateCallbacks("cacheKeyWillBeUsed"))n=m(await t({mode:e,request:n,event:this.event,params:this.params}));this.h[s]=n}return this.h[s]}hasCallback(t){for(const e of this.u.plugins)if(t in e)return!0;return!1}async runCallbacks(t,e){for(const s of this.iterateCallbacks(t))await s(e)}*iterateCallbacks(t){for(const e of this.u.plugins)if("function"==typeof e[t]){const s=this.R.get(e),n=n=>{const r=Object.assign(Object.assign({},n),{state:s});return e[t](r)};yield n}}waitUntil(t){return this.p.push(t),t}async doneWaiting(){let t;for(;t=this.p.shift();)await t}destroy(){this.l.resolve(null)}async v(t){let e=t,s=!1;for(const t of this.iterateCallbacks("cacheWillUpdate"))if(e=await t({request:this.request,response:e,event:this.event})||void 0,s=!0,!e)break;return s||e&&200!==e.status&&(e=void 0),e}}class v{constructor(t={}){this.cacheName=d(t.cacheName),this.plugins=t.plugins||[],this.fetchOptions=t.fetchOptions,this.matchOptions=t.matchOptions}handle(t){const[e]=this.handleAll(t);return e}handleAll(t){t instanceof FetchEvent&&(t={event:t,request:t.request});const e=t.event,s="string"==typeof t.request?new Request(t.request):t.request,n="params"in t?t.params:void 0,r=new R(this,{event:e,request:s,params:n}),i=this.q(r,s,e);return[i,this.D(i,r,s,e)]}async q(t,e,n){let r;await t.runCallbacks("handlerWillStart",{event:n,request:e});try{if(r=await this.U(e,t),!r||"error"===r.type)throw new s("no-response",{url:e.url})}catch(s){if(s instanceof Error)for(const i of t.iterateCallbacks("handlerDidError"))if(r=await i({error:s,event:n,request:e}),r)break;if(!r)throw s}for(const s of t.iterateCallbacks("handlerWillRespond"))r=await s({event:n,request:e,response:r});return r}async D(t,e,s,n){let r,i;try{r=await t}catch(i){}try{await e.runCallbacks("handlerDidRespond",{event:n,request:s,response:r}),await e.doneWaiting()}catch(t){t instanceof Error&&(i=t)}if(await e.runCallbacks("handlerDidComplete",{event:n,request:s,response:r,error:i}),e.destroy(),i)throw i}}function b(t){t.then((()=>{}))}function q(){return q=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var s=arguments[e];for(var n in s)Object.prototype.hasOwnProperty.call(s,n)&&(t[n]=s[n])}return t},q.apply(this,arguments)}const D=(t,e)=>e.some((e=>t instanceof e));let U,x;const L=new WeakMap,I=new WeakMap,C=new WeakMap,E=new WeakMap,N=new WeakMap;let O={get(t,e,s){if(t instanceof IDBTransaction){if("done"===e)return I.get(t);if("objectStoreNames"===e)return t.objectStoreNames||C.get(t);if("store"===e)return s.objectStoreNames[1]?void 0:s.objectStore(s.objectStoreNames[0])}return B(t[e])},set:(t,e,s)=>(t[e]=s,!0),has:(t,e)=>t instanceof IDBTransaction&&("done"===e||"store"===e)||e in t};function T(t){return t!==IDBDatabase.prototype.transaction||"objectStoreNames"in IDBTransaction.prototype?(x||(x=[IDBCursor.prototype.advance,IDBCursor.prototype.continue,IDBCursor.prototype.continuePrimaryKey])).includes(t)?function(...e){return t.apply(P(this),e),B(L.get(this))}:function(...e){return B(t.apply(P(this),e))}:function(e,...s){const n=t.call(P(this),e,...s);return C.set(n,e.sort?e.sort():[e]),B(n)}}function k(t){return"function"==typeof t?T(t):(t instanceof IDBTransaction&&function(t){if(I.has(t))return;const e=new Promise(((e,s)=>{const n=()=>{t.removeEventListener("complete",r),t.removeEventListener("error",i),t.removeEventListener("abort",i)},r=()=>{e(),n()},i=()=>{s(t.error||new DOMException("AbortError","AbortError")),n()};t.addEventListener("complete",r),t.addEventListener("error",i),t.addEventListener("abort",i)}));I.set(t,e)}(t),D(t,U||(U=[IDBDatabase,IDBObjectStore,IDBIndex,IDBCursor,IDBTransaction]))?new Proxy(t,O):t)}function B(t){if(t instanceof IDBRequest)return function(t){const e=new Promise(((e,s)=>{const n=()=>{t.removeEventListener("success",r),t.removeEventListener("error",i)},r=()=>{e(B(t.result)),n()},i=()=>{s(t.error),n()};t.addEventListener("success",r),t.addEventListener("error",i)}));return e.then((e=>{e instanceof IDBCursor&&L.set(e,t)})).catch((()=>{})),N.set(e,t),e}(t);if(E.has(t))return E.get(t);const e=k(t);return e!==t&&(E.set(t,e),N.set(e,t)),e}const P=t=>N.get(t);const M=["get","getKey","getAll","getAllKeys","count"],W=["put","add","delete","clear"],j=new Map;function S(t,e){if(!(t instanceof IDBDatabase)||e in t||"string"!=typeof e)return;if(j.get(e))return j.get(e);const s=e.replace(/FromIndex$/,""),n=e!==s,r=W.includes(s);if(!(s in(n?IDBIndex:IDBObjectStore).prototype)||!r&&!M.includes(s))return;const i=async function(t,...e){const i=this.transaction(t,r?"readwrite":"readonly");let a=i.store;return n&&(a=a.index(e.shift())),(await Promise.all([a[s](...e),r&&i.done]))[0]};return j.set(e,i),i}O=(t=>q({},t,{get:(e,s,n)=>S(e,s)||t.get(e,s,n),has:(e,s)=>!!S(e,s)||t.has(e,s)}))(O);try{self["workbox:expiration:7.0.0"]&&_()}catch(t){}const K="cache-entries",A=t=>{const e=new URL(t,location.href);return e.hash="",e.href};class F{constructor(t){this._=null,this.L=t}I(t){const e=t.createObjectStore(K,{keyPath:"id"});e.createIndex("cacheName","cacheName",{unique:!1}),e.createIndex("timestamp","timestamp",{unique:!1})}C(t){this.I(t),this.L&&function(t,{blocked:e}={}){const s=indexedDB.deleteDatabase(t);e&&s.addEventListener("blocked",(t=>e(t.oldVersion,t))),B(s).then((()=>{}))}(this.L)}async setTimestamp(t,e){const s={url:t=A(t),timestamp:e,cacheName:this.L,id:this.N(t)},n=(await this.getDb()).transaction(K,"readwrite",{durability:"relaxed"});await n.store.put(s),await n.done}async getTimestamp(t){const e=await this.getDb(),s=await e.get(K,this.N(t));return null==s?void 0:s.timestamp}async expireEntries(t,e){const s=await this.getDb();let n=await s.transaction(K).store.index("timestamp").openCursor(null,"prev");const r=[];let i=0;for(;n;){const s=n.value;s.cacheName===this.L&&(t&&s.timestamp<t||e&&i>=e?r.push(n.value):i++),n=await n.continue()}const a=[];for(const t of r)await s.delete(K,t.id),a.push(t.url);return a}N(t){return this.L+"|"+A(t)}async getDb(){return this._||(this._=await function(t,e,{blocked:s,upgrade:n,blocking:r,terminated:i}={}){const a=indexedDB.open(t,e),o=B(a);return n&&a.addEventListener("upgradeneeded",(t=>{n(B(a.result),t.oldVersion,t.newVersion,B(a.transaction),t)})),s&&a.addEventListener("blocked",(t=>s(t.oldVersion,t.newVersion,t))),o.then((t=>{i&&t.addEventListener("close",(()=>i())),r&&t.addEventListener("versionchange",(t=>r(t.oldVersion,t.newVersion,t)))})).catch((()=>{})),o}("workbox-expiration",1,{upgrade:this.C.bind(this)})),this._}}class H{constructor(t,e={}){this.O=!1,this.T=!1,this.k=e.maxEntries,this.B=e.maxAgeSeconds,this.P=e.matchOptions,this.L=t,this.M=new F(t)}async expireEntries(){if(this.O)return void(this.T=!0);this.O=!0;const t=this.B?Date.now()-1e3*this.B:0,e=await this.M.expireEntries(t,this.k),s=await self.caches.open(this.L);for(const t of e)await s.delete(t,this.P);this.O=!1,this.T&&(this.T=!1,b(this.expireEntries()))}async updateTimestamp(t){await this.M.setTimestamp(t,Date.now())}async isURLExpired(t){if(this.B){const e=await this.M.getTimestamp(t),s=Date.now()-1e3*this.B;return void 0===e||e<s}return!1}async delete(){this.T=!1,await this.M.expireEntries(1/0)}}try{self["workbox:range-requests:7.0.0"]&&_()}catch(t){}async function $(t,e){try{if(206===e.status)return e;const n=t.headers.get("range");if(!n)throw new s("no-range-header");const r=function(t){const e=t.trim().toLowerCase();if(!e.startsWith("bytes="))throw new s("unit-must-be-bytes",{normalizedRangeHeader:e});if(e.includes(","))throw new s("single-range-only",{normalizedRangeHeader:e});const n=/(\d*)-(\d*)/.exec(e);if(!n||!n[1]&&!n[2])throw new s("invalid-range-values",{normalizedRangeHeader:e});return{start:""===n[1]?void 0:Number(n[1]),end:""===n[2]?void 0:Number(n[2])}}(n),i=await e.blob(),a=function(t,e,n){const r=t.size;if(n&&n>r||e&&e<0)throw new s("range-not-satisfiable",{size:r,end:n,start:e});let i,a;return void 0!==e&&void 0!==n?(i=e,a=n+1):void 0!==e&&void 0===n?(i=e,a=r):void 0!==n&&void 0===e&&(i=r-n,a=r),{start:i,end:a}}(i,r.start,r.end),o=i.slice(a.start,a.end),c=o.size,h=new Response(o,{status:206,statusText:"Partial Content",headers:e.headers});return h.headers.set("Content-Length",String(c)),h.headers.set("Content-Range",`bytes ${a.start}-${a.end-1}/${i.size}`),h}catch(t){return new Response("",{status:416,statusText:"Range Not Satisfiable"})}}function z(t,e){const s=e();return t.waitUntil(s),s}try{self["workbox:precaching:7.0.0"]&&_()}catch(t){}function G(t){if(!t)throw new s("add-to-cache-list-unexpected-type",{entry:t});if("string"==typeof t){const e=new URL(t,location.href);return{cacheKey:e.href,url:e.href}}const{revision:e,url:n}=t;if(!n)throw new s("add-to-cache-list-unexpected-type",{entry:t});if(!e){const t=new URL(n,location.href);return{cacheKey:t.href,url:t.href}}const r=new URL(n,location.href),i=new URL(n,location.href);return r.searchParams.set("__WB_REVISION__",e),{cacheKey:r.href,url:i.href}}class V{constructor(){this.updatedURLs=[],this.notUpdatedURLs=[],this.handlerWillStart=async({request:t,state:e})=>{e&&(e.originalRequest=t)},this.cachedResponseWillBeUsed=async({event:t,state:e,cachedResponse:s})=>{if("install"===t.type&&e&&e.originalRequest&&e.originalRequest instanceof Request){const t=e.originalRequest.url;s?this.notUpdatedURLs.push(t):this.updatedURLs.push(t)}return s}}}class J{constructor({precacheController:t}){this.cacheKeyWillBeUsed=async({request:t,params:e})=>{const s=(null==e?void 0:e.cacheKey)||this.W.getCacheKeyForURL(t.url);return s?new Request(s,{headers:t.headers}):t},this.W=t}}let Q,X;async function Y(t,e){let n=null;if(t.url){n=new URL(t.url).origin}if(n!==self.location.origin)throw new s("cross-origin-copy-response",{origin:n});const r=t.clone(),i={headers:new Headers(r.headers),status:r.status,statusText:r.statusText},a=e?e(i):i,o=function(){if(void 0===Q){const t=new Response("");if("body"in t)try{new Response(t.body),Q=!0}catch(t){Q=!1}Q=!1}return Q}()?r.body:await r.blob();return new Response(o,a)}class Z extends v{constructor(t={}){t.cacheName=w(t.cacheName),super(t),this.j=!1!==t.fallbackToNetwork,this.plugins.push(Z.copyRedirectedCacheableResponsesPlugin)}async U(t,e){const s=await e.cacheMatch(t);return s||(e.event&&"install"===e.event.type?await this.S(t,e):await this.K(t,e))}async K(t,e){let n;const r=e.params||{};if(!this.j)throw new s("missing-precache-entry",{cacheName:this.cacheName,url:t.url});{const s=r.integrity,i=t.integrity,a=!i||i===s;n=await e.fetch(new Request(t,{integrity:"no-cors"!==t.mode?i||s:void 0})),s&&a&&"no-cors"!==t.mode&&(this.A(),await e.cachePut(t,n.clone()))}return n}async S(t,e){this.A();const n=await e.fetch(t);if(!await e.cachePut(t,n.clone()))throw new s("bad-precaching-response",{url:t.url,status:n.status});return n}A(){let t=null,e=0;for(const[s,n]of this.plugins.entries())n!==Z.copyRedirectedCacheableResponsesPlugin&&(n===Z.defaultPrecacheCacheabilityPlugin&&(t=s),n.cacheWillUpdate&&e++);0===e?this.plugins.push(Z.defaultPrecacheCacheabilityPlugin):e>1&&null!==t&&this.plugins.splice(t,1)}}Z.defaultPrecacheCacheabilityPlugin={cacheWillUpdate:async({response:t})=>!t||t.status>=400?null:t},Z.copyRedirectedCacheableResponsesPlugin={cacheWillUpdate:async({response:t})=>t.redirected?await Y(t):t};class tt{constructor({cacheName:t,plugins:e=[],fallbackToNetwork:s=!0}={}){this.F=new Map,this.H=new Map,this.$=new Map,this.u=new Z({cacheName:w(t),plugins:[...e,new J({precacheController:this})],fallbackToNetwork:s}),this.install=this.install.bind(this),this.activate=this.activate.bind(this)}get strategy(){return this.u}precache(t){this.addToCacheList(t),this.G||(self.addEventListener("install",this.install),self.addEventListener("activate",this.activate),this.G=!0)}addToCacheList(t){const e=[];for(const n of t){"string"==typeof n?e.push(n):n&&void 0===n.revision&&e.push(n.url);const{cacheKey:t,url:r}=G(n),i="string"!=typeof n&&n.revision?"reload":"default";if(this.F.has(r)&&this.F.get(r)!==t)throw new s("add-to-cache-list-conflicting-entries",{firstEntry:this.F.get(r),secondEntry:t});if("string"!=typeof n&&n.integrity){if(this.$.has(t)&&this.$.get(t)!==n.integrity)throw new s("add-to-cache-list-conflicting-integrities",{url:r});this.$.set(t,n.integrity)}if(this.F.set(r,t),this.H.set(r,i),e.length>0){const t=`Workbox is precaching URLs without revision info: ${e.join(", ")}\nThis is generally NOT safe. Learn more at https://bit.ly/wb-precache`;console.warn(t)}}}install(t){return z(t,(async()=>{const e=new V;this.strategy.plugins.push(e);for(const[e,s]of this.F){const n=this.$.get(s),r=this.H.get(e),i=new Request(e,{integrity:n,cache:r,credentials:"same-origin"});await Promise.all(this.strategy.handleAll({params:{cacheKey:s},request:i,event:t}))}const{updatedURLs:s,notUpdatedURLs:n}=e;return{updatedURLs:s,notUpdatedURLs:n}}))}activate(t){return z(t,(async()=>{const t=await self.caches.open(this.strategy.cacheName),e=await t.keys(),s=new Set(this.F.values()),n=[];for(const r of e)s.has(r.url)||(await t.delete(r),n.push(r.url));return{deletedURLs:n}}))}getURLsToCacheKeys(){return this.F}getCachedURLs(){return[...this.F.keys()]}getCacheKeyForURL(t){const e=new URL(t,location.href);return this.F.get(e.href)}getIntegrityForCacheKey(t){return this.$.get(t)}async matchPrecache(t){const e=t instanceof Request?t.url:t,s=this.getCacheKeyForURL(e);if(s){return(await self.caches.open(this.strategy.cacheName)).match(s)}}createHandlerBoundToURL(t){const e=this.getCacheKeyForURL(t);if(!e)throw new s("non-precached-url",{url:t});return s=>(s.request=new Request(t),s.params=Object.assign({cacheKey:e},s.params),this.strategy.handle(s))}}const et=()=>(X||(X=new tt),X);class st extends r{constructor(t,e){super((({request:s})=>{const n=t.getURLsToCacheKeys();for(const r of function*(t,{ignoreURLParametersMatching:e=[/^utm_/,/^fbclid$/],directoryIndex:s="index.html",cleanURLs:n=!0,urlManipulation:r}={}){const i=new URL(t,location.href);i.hash="",yield i.href;const a=function(t,e=[]){for(const s of[...t.searchParams.keys()])e.some((t=>t.test(s)))&&t.searchParams.delete(s);return t}(i,e);if(yield a.href,s&&a.pathname.endsWith("/")){const t=new URL(a.href);t.pathname+=s,yield t.href}if(n){const t=new URL(a.href);t.pathname+=".html",yield t.href}if(r){const t=r({url:i});for(const e of t)yield e.href}}(s.url,e)){const e=n.get(r);if(e){return{cacheKey:e,integrity:t.getIntegrityForCacheKey(e)}}}}),t.strategy)}}t.CacheFirst=class extends v{async U(t,e){let n,r=await e.cacheMatch(t);if(!r)try{r=await e.fetchAndCachePut(t)}catch(t){t instanceof Error&&(n=t)}if(!r)throw new s("no-response",{url:t.url,error:n});return r}},t.ExpirationPlugin=class{constructor(t={}){this.cachedResponseWillBeUsed=async({event:t,request:e,cacheName:s,cachedResponse:n})=>{if(!n)return null;const r=this.V(n),i=this.J(s);b(i.expireEntries());const a=i.updateTimestamp(e.url);if(t)try{t.waitUntil(a)}catch(t){}return r?n:null},this.cacheDidUpdate=async({cacheName:t,request:e})=>{const s=this.J(t);await s.updateTimestamp(e.url),await s.expireEntries()},this.X=t,this.B=t.maxAgeSeconds,this.Y=new Map,t.purgeOnQuotaError&&function(t){g.add(t)}((()=>this.deleteCacheAndMetadata()))}J(t){if(t===d())throw new s("expire-custom-caches-only");let e=this.Y.get(t);return e||(e=new H(t,this.X),this.Y.set(t,e)),e}V(t){if(!this.B)return!0;const e=this.Z(t);if(null===e)return!0;return e>=Date.now()-1e3*this.B}Z(t){if(!t.headers.has("date"))return null;const e=t.headers.get("date"),s=new Date(e).getTime();return isNaN(s)?null:s}async deleteCacheAndMetadata(){for(const[t,e]of this.Y)await self.caches.delete(t),await e.delete();this.Y=new Map}},t.NetworkFirst=class extends v{constructor(t={}){super(t),this.plugins.some((t=>"cacheWillUpdate"in t))||this.plugins.unshift(u),this.tt=t.networkTimeoutSeconds||0}async U(t,e){const n=[],r=[];let i;if(this.tt){const{id:s,promise:a}=this.et({request:t,logs:n,handler:e});i=s,r.push(a)}const a=this.st({timeoutId:i,request:t,logs:n,handler:e});r.push(a);const o=await e.waitUntil((async()=>await e.waitUntil(Promise.race(r))||await a)());if(!o)throw new s("no-response",{url:t.url});return o}et({request:t,logs:e,handler:s}){let n;return{promise:new Promise((e=>{n=setTimeout((async()=>{e(await s.cacheMatch(t))}),1e3*this.tt)})),id:n}}async st({timeoutId:t,request:e,logs:s,handler:n}){let r,i;try{i=await n.fetchAndCachePut(e)}catch(t){t instanceof Error&&(r=t)}return t&&clearTimeout(t),!r&&i||(i=await n.cacheMatch(e)),i}},t.RangeRequestsPlugin=class{constructor(){this.cachedResponseWillBeUsed=async({request:t,cachedResponse:e})=>e&&t.headers.has("range")?await $(t,e):e}},t.StaleWhileRevalidate=class extends v{constructor(t={}){super(t),this.plugins.some((t=>"cacheWillUpdate"in t))||this.plugins.unshift(u)}async U(t,e){const n=e.fetchAndCachePut(t).catch((()=>{}));e.waitUntil(n);let r,i=await e.cacheMatch(t);if(i);else try{i=await n}catch(t){t instanceof Error&&(r=t)}if(!i)throw new s("no-response",{url:t.url,error:r});return i}},t.cleanupOutdatedCaches=function(){self.addEventListener("activate",(t=>{const e=w();t.waitUntil((async(t,e="-precache-")=>{const s=(await self.caches.keys()).filter((s=>s.includes(e)&&s.includes(self.registration.scope)&&s!==t));return await Promise.all(s.map((t=>self.caches.delete(t)))),s})(e).then((t=>{})))}))},t.clientsClaim=function(){self.addEventListener("activate",(()=>self.clients.claim()))},t.precacheAndRoute=function(t,e){!function(t){et().precache(t)}(t),function(t){const e=et();h(new st(e,t))}(e)},t.registerRoute=h}));
|
|
|
1 |
+
define(["exports"],(function(t){"use strict";try{self["workbox:core:7.0.0"]&&_()}catch(t){}const e=(t,...e)=>{let s=t;return e.length>0&&(s+=` :: ${JSON.stringify(e)}`),s};class s extends Error{constructor(t,s){super(e(t,s)),this.name=t,this.details=s}}try{self["workbox:routing:7.0.0"]&&_()}catch(t){}const n=t=>t&&"object"==typeof t?t:{handle:t};class r{constructor(t,e,s="GET"){this.handler=n(e),this.match=t,this.method=s}setCatchHandler(t){this.catchHandler=n(t)}}class i extends r{constructor(t,e,s){super((({url:e})=>{const s=t.exec(e.href);if(s&&(e.origin===location.origin||0===s.index))return s.slice(1)}),e,s)}}class a{constructor(){this.t=new Map,this.i=new Map}get routes(){return this.t}addFetchListener(){self.addEventListener("fetch",(t=>{const{request:e}=t,s=this.handleRequest({request:e,event:t});s&&t.respondWith(s)}))}addCacheListener(){self.addEventListener("message",(t=>{if(t.data&&"CACHE_URLS"===t.data.type){const{payload:e}=t.data,s=Promise.all(e.urlsToCache.map((e=>{"string"==typeof e&&(e=[e]);const s=new Request(...e);return this.handleRequest({request:s,event:t})})));t.waitUntil(s),t.ports&&t.ports[0]&&s.then((()=>t.ports[0].postMessage(!0)))}}))}handleRequest({request:t,event:e}){const s=new URL(t.url,location.href);if(!s.protocol.startsWith("http"))return;const n=s.origin===location.origin,{params:r,route:i}=this.findMatchingRoute({event:e,request:t,sameOrigin:n,url:s});let a=i&&i.handler;const o=t.method;if(!a&&this.i.has(o)&&(a=this.i.get(o)),!a)return;let c;try{c=a.handle({url:s,request:t,event:e,params:r})}catch(t){c=Promise.reject(t)}const h=i&&i.catchHandler;return c instanceof Promise&&(this.o||h)&&(c=c.catch((async n=>{if(h)try{return await h.handle({url:s,request:t,event:e,params:r})}catch(t){t instanceof Error&&(n=t)}if(this.o)return this.o.handle({url:s,request:t,event:e});throw n}))),c}findMatchingRoute({url:t,sameOrigin:e,request:s,event:n}){const r=this.t.get(s.method)||[];for(const i of r){let r;const a=i.match({url:t,sameOrigin:e,request:s,event:n});if(a)return r=a,(Array.isArray(r)&&0===r.length||a.constructor===Object&&0===Object.keys(a).length||"boolean"==typeof a)&&(r=void 0),{route:i,params:r}}return{}}setDefaultHandler(t,e="GET"){this.i.set(e,n(t))}setCatchHandler(t){this.o=n(t)}registerRoute(t){this.t.has(t.method)||this.t.set(t.method,[]),this.t.get(t.method).push(t)}unregisterRoute(t){if(!this.t.has(t.method))throw new s("unregister-route-but-not-found-with-method",{method:t.method});const e=this.t.get(t.method).indexOf(t);if(!(e>-1))throw new s("unregister-route-route-not-registered");this.t.get(t.method).splice(e,1)}}let o;const c=()=>(o||(o=new a,o.addFetchListener(),o.addCacheListener()),o);function h(t,e,n){let a;if("string"==typeof t){const s=new URL(t,location.href);a=new r((({url:t})=>t.href===s.href),e,n)}else if(t instanceof RegExp)a=new i(t,e,n);else if("function"==typeof t)a=new r(t,e,n);else{if(!(t instanceof r))throw new s("unsupported-route-type",{moduleName:"workbox-routing",funcName:"registerRoute",paramName:"capture"});a=t}return c().registerRoute(a),a}try{self["workbox:strategies:7.0.0"]&&_()}catch(t){}const u={cacheWillUpdate:async({response:t})=>200===t.status||0===t.status?t:null},l={googleAnalytics:"googleAnalytics",precache:"precache-v2",prefix:"workbox",runtime:"runtime",suffix:"undefined"!=typeof registration?registration.scope:""},f=t=>[l.prefix,t,l.suffix].filter((t=>t&&t.length>0)).join("-"),w=t=>t||f(l.precache),d=t=>t||f(l.runtime);function p(t,e){const s=new URL(t);for(const t of e)s.searchParams.delete(t);return s.href}class y{constructor(){this.promise=new Promise(((t,e)=>{this.resolve=t,this.reject=e}))}}const g=new Set;function m(t){return"string"==typeof t?new Request(t):t}class R{constructor(t,e){this.h={},Object.assign(this,e),this.event=e.event,this.u=t,this.l=new y,this.p=[],this.m=[...t.plugins],this.R=new Map;for(const t of this.m)this.R.set(t,{});this.event.waitUntil(this.l.promise)}async fetch(t){const{event:e}=this;let n=m(t);if("navigate"===n.mode&&e instanceof FetchEvent&&e.preloadResponse){const t=await e.preloadResponse;if(t)return t}const r=this.hasCallback("fetchDidFail")?n.clone():null;try{for(const t of this.iterateCallbacks("requestWillFetch"))n=await t({request:n.clone(),event:e})}catch(t){if(t instanceof Error)throw new s("plugin-error-request-will-fetch",{thrownErrorMessage:t.message})}const i=n.clone();try{let t;t=await fetch(n,"navigate"===n.mode?void 0:this.u.fetchOptions);for(const s of this.iterateCallbacks("fetchDidSucceed"))t=await s({event:e,request:i,response:t});return t}catch(t){throw r&&await this.runCallbacks("fetchDidFail",{error:t,event:e,originalRequest:r.clone(),request:i.clone()}),t}}async fetchAndCachePut(t){const e=await this.fetch(t),s=e.clone();return this.waitUntil(this.cachePut(t,s)),e}async cacheMatch(t){const e=m(t);let s;const{cacheName:n,matchOptions:r}=this.u,i=await this.getCacheKey(e,"read"),a=Object.assign(Object.assign({},r),{cacheName:n});s=await caches.match(i,a);for(const t of this.iterateCallbacks("cachedResponseWillBeUsed"))s=await t({cacheName:n,matchOptions:r,cachedResponse:s,request:i,event:this.event})||void 0;return s}async cachePut(t,e){const n=m(t);var r;await(r=0,new Promise((t=>setTimeout(t,r))));const i=await this.getCacheKey(n,"write");if(!e)throw new s("cache-put-with-no-response",{url:(a=i.url,new URL(String(a),location.href).href.replace(new RegExp(`^${location.origin}`),""))});var a;const o=await this.v(e);if(!o)return!1;const{cacheName:c,matchOptions:h}=this.u,u=await self.caches.open(c),l=this.hasCallback("cacheDidUpdate"),f=l?await async function(t,e,s,n){const r=p(e.url,s);if(e.url===r)return t.match(e,n);const i=Object.assign(Object.assign({},n),{ignoreSearch:!0}),a=await t.keys(e,i);for(const e of a)if(r===p(e.url,s))return t.match(e,n)}(u,i.clone(),["__WB_REVISION__"],h):null;try{await u.put(i,l?o.clone():o)}catch(t){if(t instanceof Error)throw"QuotaExceededError"===t.name&&await async function(){for(const t of g)await t()}(),t}for(const t of this.iterateCallbacks("cacheDidUpdate"))await t({cacheName:c,oldResponse:f,newResponse:o.clone(),request:i,event:this.event});return!0}async getCacheKey(t,e){const s=`${t.url} | ${e}`;if(!this.h[s]){let n=t;for(const t of this.iterateCallbacks("cacheKeyWillBeUsed"))n=m(await t({mode:e,request:n,event:this.event,params:this.params}));this.h[s]=n}return this.h[s]}hasCallback(t){for(const e of this.u.plugins)if(t in e)return!0;return!1}async runCallbacks(t,e){for(const s of this.iterateCallbacks(t))await s(e)}*iterateCallbacks(t){for(const e of this.u.plugins)if("function"==typeof e[t]){const s=this.R.get(e),n=n=>{const r=Object.assign(Object.assign({},n),{state:s});return e[t](r)};yield n}}waitUntil(t){return this.p.push(t),t}async doneWaiting(){let t;for(;t=this.p.shift();)await t}destroy(){this.l.resolve(null)}async v(t){let e=t,s=!1;for(const t of this.iterateCallbacks("cacheWillUpdate"))if(e=await t({request:this.request,response:e,event:this.event})||void 0,s=!0,!e)break;return s||e&&200!==e.status&&(e=void 0),e}}class v{constructor(t={}){this.cacheName=d(t.cacheName),this.plugins=t.plugins||[],this.fetchOptions=t.fetchOptions,this.matchOptions=t.matchOptions}handle(t){const[e]=this.handleAll(t);return e}handleAll(t){t instanceof FetchEvent&&(t={event:t,request:t.request});const e=t.event,s="string"==typeof t.request?new Request(t.request):t.request,n="params"in t?t.params:void 0,r=new R(this,{event:e,request:s,params:n}),i=this.q(r,s,e);return[i,this.D(i,r,s,e)]}async q(t,e,n){let r;await t.runCallbacks("handlerWillStart",{event:n,request:e});try{if(r=await this.U(e,t),!r||"error"===r.type)throw new s("no-response",{url:e.url})}catch(s){if(s instanceof Error)for(const i of t.iterateCallbacks("handlerDidError"))if(r=await i({error:s,event:n,request:e}),r)break;if(!r)throw s}for(const s of t.iterateCallbacks("handlerWillRespond"))r=await s({event:n,request:e,response:r});return r}async D(t,e,s,n){let r,i;try{r=await t}catch(i){}try{await e.runCallbacks("handlerDidRespond",{event:n,request:s,response:r}),await e.doneWaiting()}catch(t){t instanceof Error&&(i=t)}if(await e.runCallbacks("handlerDidComplete",{event:n,request:s,response:r,error:i}),e.destroy(),i)throw i}}function b(t){t.then((()=>{}))}function q(){return q=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var s=arguments[e];for(var n in s)({}).hasOwnProperty.call(s,n)&&(t[n]=s[n])}return t},q.apply(null,arguments)}const D=(t,e)=>e.some((e=>t instanceof e));let U,x;const L=new WeakMap,I=new WeakMap,C=new WeakMap,E=new WeakMap,N=new WeakMap;let O={get(t,e,s){if(t instanceof IDBTransaction){if("done"===e)return I.get(t);if("objectStoreNames"===e)return t.objectStoreNames||C.get(t);if("store"===e)return s.objectStoreNames[1]?void 0:s.objectStore(s.objectStoreNames[0])}return B(t[e])},set:(t,e,s)=>(t[e]=s,!0),has:(t,e)=>t instanceof IDBTransaction&&("done"===e||"store"===e)||e in t};function T(t){return t!==IDBDatabase.prototype.transaction||"objectStoreNames"in IDBTransaction.prototype?(x||(x=[IDBCursor.prototype.advance,IDBCursor.prototype.continue,IDBCursor.prototype.continuePrimaryKey])).includes(t)?function(...e){return t.apply(P(this),e),B(L.get(this))}:function(...e){return B(t.apply(P(this),e))}:function(e,...s){const n=t.call(P(this),e,...s);return C.set(n,e.sort?e.sort():[e]),B(n)}}function k(t){return"function"==typeof t?T(t):(t instanceof IDBTransaction&&function(t){if(I.has(t))return;const e=new Promise(((e,s)=>{const n=()=>{t.removeEventListener("complete",r),t.removeEventListener("error",i),t.removeEventListener("abort",i)},r=()=>{e(),n()},i=()=>{s(t.error||new DOMException("AbortError","AbortError")),n()};t.addEventListener("complete",r),t.addEventListener("error",i),t.addEventListener("abort",i)}));I.set(t,e)}(t),D(t,U||(U=[IDBDatabase,IDBObjectStore,IDBIndex,IDBCursor,IDBTransaction]))?new Proxy(t,O):t)}function B(t){if(t instanceof IDBRequest)return function(t){const e=new Promise(((e,s)=>{const n=()=>{t.removeEventListener("success",r),t.removeEventListener("error",i)},r=()=>{e(B(t.result)),n()},i=()=>{s(t.error),n()};t.addEventListener("success",r),t.addEventListener("error",i)}));return e.then((e=>{e instanceof IDBCursor&&L.set(e,t)})).catch((()=>{})),N.set(e,t),e}(t);if(E.has(t))return E.get(t);const e=k(t);return e!==t&&(E.set(t,e),N.set(e,t)),e}const P=t=>N.get(t);const M=["get","getKey","getAll","getAllKeys","count"],W=["put","add","delete","clear"],j=new Map;function S(t,e){if(!(t instanceof IDBDatabase)||e in t||"string"!=typeof e)return;if(j.get(e))return j.get(e);const s=e.replace(/FromIndex$/,""),n=e!==s,r=W.includes(s);if(!(s in(n?IDBIndex:IDBObjectStore).prototype)||!r&&!M.includes(s))return;const i=async function(t,...e){const i=this.transaction(t,r?"readwrite":"readonly");let a=i.store;return n&&(a=a.index(e.shift())),(await Promise.all([a[s](...e),r&&i.done]))[0]};return j.set(e,i),i}O=(t=>q({},t,{get:(e,s,n)=>S(e,s)||t.get(e,s,n),has:(e,s)=>!!S(e,s)||t.has(e,s)}))(O);try{self["workbox:expiration:7.0.0"]&&_()}catch(t){}const K="cache-entries",A=t=>{const e=new URL(t,location.href);return e.hash="",e.href};class F{constructor(t){this._=null,this.L=t}I(t){const e=t.createObjectStore(K,{keyPath:"id"});e.createIndex("cacheName","cacheName",{unique:!1}),e.createIndex("timestamp","timestamp",{unique:!1})}C(t){this.I(t),this.L&&function(t,{blocked:e}={}){const s=indexedDB.deleteDatabase(t);e&&s.addEventListener("blocked",(t=>e(t.oldVersion,t))),B(s).then((()=>{}))}(this.L)}async setTimestamp(t,e){const s={url:t=A(t),timestamp:e,cacheName:this.L,id:this.N(t)},n=(await this.getDb()).transaction(K,"readwrite",{durability:"relaxed"});await n.store.put(s),await n.done}async getTimestamp(t){const e=await this.getDb(),s=await e.get(K,this.N(t));return null==s?void 0:s.timestamp}async expireEntries(t,e){const s=await this.getDb();let n=await s.transaction(K).store.index("timestamp").openCursor(null,"prev");const r=[];let i=0;for(;n;){const s=n.value;s.cacheName===this.L&&(t&&s.timestamp<t||e&&i>=e?r.push(n.value):i++),n=await n.continue()}const a=[];for(const t of r)await s.delete(K,t.id),a.push(t.url);return a}N(t){return this.L+"|"+A(t)}async getDb(){return this._||(this._=await function(t,e,{blocked:s,upgrade:n,blocking:r,terminated:i}={}){const a=indexedDB.open(t,e),o=B(a);return n&&a.addEventListener("upgradeneeded",(t=>{n(B(a.result),t.oldVersion,t.newVersion,B(a.transaction),t)})),s&&a.addEventListener("blocked",(t=>s(t.oldVersion,t.newVersion,t))),o.then((t=>{i&&t.addEventListener("close",(()=>i())),r&&t.addEventListener("versionchange",(t=>r(t.oldVersion,t.newVersion,t)))})).catch((()=>{})),o}("workbox-expiration",1,{upgrade:this.C.bind(this)})),this._}}class H{constructor(t,e={}){this.O=!1,this.T=!1,this.k=e.maxEntries,this.B=e.maxAgeSeconds,this.P=e.matchOptions,this.L=t,this.M=new F(t)}async expireEntries(){if(this.O)return void(this.T=!0);this.O=!0;const t=this.B?Date.now()-1e3*this.B:0,e=await this.M.expireEntries(t,this.k),s=await self.caches.open(this.L);for(const t of e)await s.delete(t,this.P);this.O=!1,this.T&&(this.T=!1,b(this.expireEntries()))}async updateTimestamp(t){await this.M.setTimestamp(t,Date.now())}async isURLExpired(t){if(this.B){const e=await this.M.getTimestamp(t),s=Date.now()-1e3*this.B;return void 0===e||e<s}return!1}async delete(){this.T=!1,await this.M.expireEntries(1/0)}}try{self["workbox:range-requests:7.0.0"]&&_()}catch(t){}async function $(t,e){try{if(206===e.status)return e;const n=t.headers.get("range");if(!n)throw new s("no-range-header");const r=function(t){const e=t.trim().toLowerCase();if(!e.startsWith("bytes="))throw new s("unit-must-be-bytes",{normalizedRangeHeader:e});if(e.includes(","))throw new s("single-range-only",{normalizedRangeHeader:e});const n=/(\d*)-(\d*)/.exec(e);if(!n||!n[1]&&!n[2])throw new s("invalid-range-values",{normalizedRangeHeader:e});return{start:""===n[1]?void 0:Number(n[1]),end:""===n[2]?void 0:Number(n[2])}}(n),i=await e.blob(),a=function(t,e,n){const r=t.size;if(n&&n>r||e&&e<0)throw new s("range-not-satisfiable",{size:r,end:n,start:e});let i,a;return void 0!==e&&void 0!==n?(i=e,a=n+1):void 0!==e&&void 0===n?(i=e,a=r):void 0!==n&&void 0===e&&(i=r-n,a=r),{start:i,end:a}}(i,r.start,r.end),o=i.slice(a.start,a.end),c=o.size,h=new Response(o,{status:206,statusText:"Partial Content",headers:e.headers});return h.headers.set("Content-Length",String(c)),h.headers.set("Content-Range",`bytes ${a.start}-${a.end-1}/${i.size}`),h}catch(t){return new Response("",{status:416,statusText:"Range Not Satisfiable"})}}function z(t,e){const s=e();return t.waitUntil(s),s}try{self["workbox:precaching:7.0.0"]&&_()}catch(t){}function G(t){if(!t)throw new s("add-to-cache-list-unexpected-type",{entry:t});if("string"==typeof t){const e=new URL(t,location.href);return{cacheKey:e.href,url:e.href}}const{revision:e,url:n}=t;if(!n)throw new s("add-to-cache-list-unexpected-type",{entry:t});if(!e){const t=new URL(n,location.href);return{cacheKey:t.href,url:t.href}}const r=new URL(n,location.href),i=new URL(n,location.href);return r.searchParams.set("__WB_REVISION__",e),{cacheKey:r.href,url:i.href}}class V{constructor(){this.updatedURLs=[],this.notUpdatedURLs=[],this.handlerWillStart=async({request:t,state:e})=>{e&&(e.originalRequest=t)},this.cachedResponseWillBeUsed=async({event:t,state:e,cachedResponse:s})=>{if("install"===t.type&&e&&e.originalRequest&&e.originalRequest instanceof Request){const t=e.originalRequest.url;s?this.notUpdatedURLs.push(t):this.updatedURLs.push(t)}return s}}}class J{constructor({precacheController:t}){this.cacheKeyWillBeUsed=async({request:t,params:e})=>{const s=(null==e?void 0:e.cacheKey)||this.W.getCacheKeyForURL(t.url);return s?new Request(s,{headers:t.headers}):t},this.W=t}}let Q,X;async function Y(t,e){let n=null;if(t.url){n=new URL(t.url).origin}if(n!==self.location.origin)throw new s("cross-origin-copy-response",{origin:n});const r=t.clone(),i={headers:new Headers(r.headers),status:r.status,statusText:r.statusText},a=e?e(i):i,o=function(){if(void 0===Q){const t=new Response("");if("body"in t)try{new Response(t.body),Q=!0}catch(t){Q=!1}Q=!1}return Q}()?r.body:await r.blob();return new Response(o,a)}class Z extends v{constructor(t={}){t.cacheName=w(t.cacheName),super(t),this.j=!1!==t.fallbackToNetwork,this.plugins.push(Z.copyRedirectedCacheableResponsesPlugin)}async U(t,e){const s=await e.cacheMatch(t);return s||(e.event&&"install"===e.event.type?await this.S(t,e):await this.K(t,e))}async K(t,e){let n;const r=e.params||{};if(!this.j)throw new s("missing-precache-entry",{cacheName:this.cacheName,url:t.url});{const s=r.integrity,i=t.integrity,a=!i||i===s;n=await e.fetch(new Request(t,{integrity:"no-cors"!==t.mode?i||s:void 0})),s&&a&&"no-cors"!==t.mode&&(this.A(),await e.cachePut(t,n.clone()))}return n}async S(t,e){this.A();const n=await e.fetch(t);if(!await e.cachePut(t,n.clone()))throw new s("bad-precaching-response",{url:t.url,status:n.status});return n}A(){let t=null,e=0;for(const[s,n]of this.plugins.entries())n!==Z.copyRedirectedCacheableResponsesPlugin&&(n===Z.defaultPrecacheCacheabilityPlugin&&(t=s),n.cacheWillUpdate&&e++);0===e?this.plugins.push(Z.defaultPrecacheCacheabilityPlugin):e>1&&null!==t&&this.plugins.splice(t,1)}}Z.defaultPrecacheCacheabilityPlugin={cacheWillUpdate:async({response:t})=>!t||t.status>=400?null:t},Z.copyRedirectedCacheableResponsesPlugin={cacheWillUpdate:async({response:t})=>t.redirected?await Y(t):t};class tt{constructor({cacheName:t,plugins:e=[],fallbackToNetwork:s=!0}={}){this.F=new Map,this.H=new Map,this.$=new Map,this.u=new Z({cacheName:w(t),plugins:[...e,new J({precacheController:this})],fallbackToNetwork:s}),this.install=this.install.bind(this),this.activate=this.activate.bind(this)}get strategy(){return this.u}precache(t){this.addToCacheList(t),this.G||(self.addEventListener("install",this.install),self.addEventListener("activate",this.activate),this.G=!0)}addToCacheList(t){const e=[];for(const n of t){"string"==typeof n?e.push(n):n&&void 0===n.revision&&e.push(n.url);const{cacheKey:t,url:r}=G(n),i="string"!=typeof n&&n.revision?"reload":"default";if(this.F.has(r)&&this.F.get(r)!==t)throw new s("add-to-cache-list-conflicting-entries",{firstEntry:this.F.get(r),secondEntry:t});if("string"!=typeof n&&n.integrity){if(this.$.has(t)&&this.$.get(t)!==n.integrity)throw new s("add-to-cache-list-conflicting-integrities",{url:r});this.$.set(t,n.integrity)}if(this.F.set(r,t),this.H.set(r,i),e.length>0){const t=`Workbox is precaching URLs without revision info: ${e.join(", ")}\nThis is generally NOT safe. Learn more at https://bit.ly/wb-precache`;console.warn(t)}}}install(t){return z(t,(async()=>{const e=new V;this.strategy.plugins.push(e);for(const[e,s]of this.F){const n=this.$.get(s),r=this.H.get(e),i=new Request(e,{integrity:n,cache:r,credentials:"same-origin"});await Promise.all(this.strategy.handleAll({params:{cacheKey:s},request:i,event:t}))}const{updatedURLs:s,notUpdatedURLs:n}=e;return{updatedURLs:s,notUpdatedURLs:n}}))}activate(t){return z(t,(async()=>{const t=await self.caches.open(this.strategy.cacheName),e=await t.keys(),s=new Set(this.F.values()),n=[];for(const r of e)s.has(r.url)||(await t.delete(r),n.push(r.url));return{deletedURLs:n}}))}getURLsToCacheKeys(){return this.F}getCachedURLs(){return[...this.F.keys()]}getCacheKeyForURL(t){const e=new URL(t,location.href);return this.F.get(e.href)}getIntegrityForCacheKey(t){return this.$.get(t)}async matchPrecache(t){const e=t instanceof Request?t.url:t,s=this.getCacheKeyForURL(e);if(s){return(await self.caches.open(this.strategy.cacheName)).match(s)}}createHandlerBoundToURL(t){const e=this.getCacheKeyForURL(t);if(!e)throw new s("non-precached-url",{url:t});return s=>(s.request=new Request(t),s.params=Object.assign({cacheKey:e},s.params),this.strategy.handle(s))}}const et=()=>(X||(X=new tt),X);class st extends r{constructor(t,e){super((({request:s})=>{const n=t.getURLsToCacheKeys();for(const r of function*(t,{ignoreURLParametersMatching:e=[/^utm_/,/^fbclid$/],directoryIndex:s="index.html",cleanURLs:n=!0,urlManipulation:r}={}){const i=new URL(t,location.href);i.hash="",yield i.href;const a=function(t,e=[]){for(const s of[...t.searchParams.keys()])e.some((t=>t.test(s)))&&t.searchParams.delete(s);return t}(i,e);if(yield a.href,s&&a.pathname.endsWith("/")){const t=new URL(a.href);t.pathname+=s,yield t.href}if(n){const t=new URL(a.href);t.pathname+=".html",yield t.href}if(r){const t=r({url:i});for(const e of t)yield e.href}}(s.url,e)){const e=n.get(r);if(e){return{cacheKey:e,integrity:t.getIntegrityForCacheKey(e)}}}}),t.strategy)}}t.CacheFirst=class extends v{async U(t,e){let n,r=await e.cacheMatch(t);if(!r)try{r=await e.fetchAndCachePut(t)}catch(t){t instanceof Error&&(n=t)}if(!r)throw new s("no-response",{url:t.url,error:n});return r}},t.ExpirationPlugin=class{constructor(t={}){this.cachedResponseWillBeUsed=async({event:t,request:e,cacheName:s,cachedResponse:n})=>{if(!n)return null;const r=this.V(n),i=this.J(s);b(i.expireEntries());const a=i.updateTimestamp(e.url);if(t)try{t.waitUntil(a)}catch(t){}return r?n:null},this.cacheDidUpdate=async({cacheName:t,request:e})=>{const s=this.J(t);await s.updateTimestamp(e.url),await s.expireEntries()},this.X=t,this.B=t.maxAgeSeconds,this.Y=new Map,t.purgeOnQuotaError&&function(t){g.add(t)}((()=>this.deleteCacheAndMetadata()))}J(t){if(t===d())throw new s("expire-custom-caches-only");let e=this.Y.get(t);return e||(e=new H(t,this.X),this.Y.set(t,e)),e}V(t){if(!this.B)return!0;const e=this.Z(t);if(null===e)return!0;return e>=Date.now()-1e3*this.B}Z(t){if(!t.headers.has("date"))return null;const e=t.headers.get("date"),s=new Date(e).getTime();return isNaN(s)?null:s}async deleteCacheAndMetadata(){for(const[t,e]of this.Y)await self.caches.delete(t),await e.delete();this.Y=new Map}},t.NetworkFirst=class extends v{constructor(t={}){super(t),this.plugins.some((t=>"cacheWillUpdate"in t))||this.plugins.unshift(u),this.tt=t.networkTimeoutSeconds||0}async U(t,e){const n=[],r=[];let i;if(this.tt){const{id:s,promise:a}=this.et({request:t,logs:n,handler:e});i=s,r.push(a)}const a=this.st({timeoutId:i,request:t,logs:n,handler:e});r.push(a);const o=await e.waitUntil((async()=>await e.waitUntil(Promise.race(r))||await a)());if(!o)throw new s("no-response",{url:t.url});return o}et({request:t,logs:e,handler:s}){let n;return{promise:new Promise((e=>{n=setTimeout((async()=>{e(await s.cacheMatch(t))}),1e3*this.tt)})),id:n}}async st({timeoutId:t,request:e,logs:s,handler:n}){let r,i;try{i=await n.fetchAndCachePut(e)}catch(t){t instanceof Error&&(r=t)}return t&&clearTimeout(t),!r&&i||(i=await n.cacheMatch(e)),i}},t.RangeRequestsPlugin=class{constructor(){this.cachedResponseWillBeUsed=async({request:t,cachedResponse:e})=>e&&t.headers.has("range")?await $(t,e):e}},t.StaleWhileRevalidate=class extends v{constructor(t={}){super(t),this.plugins.some((t=>"cacheWillUpdate"in t))||this.plugins.unshift(u)}async U(t,e){const n=e.fetchAndCachePut(t).catch((()=>{}));e.waitUntil(n);let r,i=await e.cacheMatch(t);if(i);else try{i=await n}catch(t){t instanceof Error&&(r=t)}if(!i)throw new s("no-response",{url:t.url,error:r});return i}},t.cleanupOutdatedCaches=function(){self.addEventListener("activate",(t=>{const e=w();t.waitUntil((async(t,e="-precache-")=>{const s=(await self.caches.keys()).filter((s=>s.includes(e)&&s.includes(self.registration.scope)&&s!==t));return await Promise.all(s.map((t=>self.caches.delete(t)))),s})(e).then((t=>{})))}))},t.clientsClaim=function(){self.addEventListener("activate",(()=>self.clients.claim()))},t.precacheAndRoute=function(t,e){!function(t){et().precache(t)}(t),function(t){const e=et();h(new st(e,t))}(e)},t.registerRoute=h}));
|