home-atom 1.0.1 → 1.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (139) hide show
  1. package/dist/client/.vite/manifest.json +33 -33
  2. package/dist/client/_next/static/chunks/{app-top-nav-Dh0jEt8u.js → app-top-nav-Co7RIixU.js} +1 -1
  3. package/dist/client/_next/static/chunks/{index-hn3AiVww.js → index-BUxxgh38.js} +3 -3
  4. package/dist/client/_next/static/chunks/{layout-segment-context-DRM8YCgm.js → layout-segment-context-D_cL7vkY.js} +1 -1
  5. package/dist/client/_next/static/chunks/manage-profiles-modal-CWi3qgd4.js +1 -0
  6. package/dist/client/_next/static/chunks/netflix-browser-BrXQctI5.js +2 -0
  7. package/dist/client/_next/static/chunks/playback-activity-66FeikYZ.js +1 -0
  8. package/dist/client/_next/static/chunks/playback-activity-track-switcher-BzvHiv7c.js +1 -0
  9. package/dist/client/_next/static/chunks/{step-forward-CV8I5pPb.js → provider-registry-CWHfJn3B.js} +1 -1
  10. package/dist/client/_next/static/chunks/spotify-app-CJimeMR0.js +1 -0
  11. package/dist/client/_next/static/chunks/storefront-CCeanBPs.js +1 -0
  12. package/dist/client/_next/static/css/index.8o3Y-jts.css +1 -0
  13. package/dist/client/_next/static/css/layout.D2NsWbhP.css +1 -0
  14. package/dist/client/_next/static/css/layout.D4D5fsiD.css +1 -0
  15. package/dist/client/_next/static/css/manage-profiles-modal.BOKESpxI.css +1 -0
  16. package/dist/client/vinext-client-entry-manifest.json +1 -1
  17. package/dist/server/BUILD_ID +1 -1
  18. package/dist/server/__vite_rsc_assets_manifest.js +35 -35
  19. package/dist/server/_next/static/{app-page-cache-DcrtN14Y.js → app-page-cache-CQaSjBaF.js} +1 -1
  20. package/dist/server/_next/static/{app-page-cache-render-DoCquoNb.js → app-page-cache-render-Dty3aMiv.js} +1 -1
  21. package/dist/server/_next/static/{app-route-handler-dispatch-Be2YIqVp.js → app-route-handler-dispatch-DCSrhGNV.js} +1 -1
  22. package/dist/server/_next/static/{cache-headers-BQ-QuzWN.js → cache-headers-lY59goLh.js} +1 -1
  23. package/dist/server/_next/static/css/index.8o3Y-jts.css +1 -0
  24. package/dist/server/_next/static/css/layout.D2NsWbhP.css +1 -0
  25. package/dist/server/_next/static/css/layout.D4D5fsiD.css +1 -0
  26. package/dist/server/_next/static/database-D79CeUrn.js +161 -0
  27. package/dist/server/_next/static/{db-BE1J0NNS.js → db-x8J3Vuoa.js} +1 -1
  28. package/dist/server/_next/static/{downloader-DgnjNL5T.js → downloader-0G-gq1D-.js} +3 -3
  29. package/dist/server/_next/static/episode-sync-Ct5CeY25.js +1 -0
  30. package/dist/server/_next/static/{isr-decision-D1zHgPSI.js → isr-decision-BOA4L6nr.js} +1 -1
  31. package/dist/server/_next/static/netflix-page-Cpp2PgD1.js +1 -0
  32. package/dist/server/_next/static/{page-Cs-erYTy.js → page-BvzzZVuW.js} +1 -1
  33. package/dist/server/_next/static/{page-DlBGATQp.js → page-C27wjUYW.js} +1 -1
  34. package/dist/server/_next/static/{page-DlRXyzSQ.js → page-Rnpx_OjW.js} +1 -1
  35. package/dist/server/_next/static/{providers-B3YELr_F.js → providers-DwLUa_U_.js} +13 -13
  36. package/dist/server/_next/static/{providers-CMBIwNGs.js → providers-_uOQh6hB.js} +1 -1
  37. package/dist/server/_next/static/{request-profile-B1yGQ0l6.js → request-profile-ClcH0i0T.js} +1 -1
  38. package/dist/server/_next/static/route-4xkmbpc4.js +1 -0
  39. package/dist/server/_next/static/{route-CeVsDcbj2.js → route-B0L_rsrg2.js} +1 -1
  40. package/dist/server/_next/static/{route-xtz48fti.js → route-B6q-wR2F.js} +1 -1
  41. package/dist/server/_next/static/{route-DXTJyFWD.js → route-B6zrlXB5.js} +1 -1
  42. package/dist/server/_next/static/{route-CNNiXZoM2.js → route-B99Pvusz2.js} +1 -1
  43. package/dist/server/_next/static/route-B9YeBtG6.js +1 -0
  44. package/dist/server/_next/static/route-BHbJ9hFI2.js +1 -0
  45. package/dist/server/_next/static/{route-mzLdjDCs2.js → route-BR3Y_0V42.js} +1 -1
  46. package/dist/server/_next/static/{route-Cim7D4XQ.js → route-BaGo5TEW.js} +1 -1
  47. package/dist/server/_next/static/{route-DslPFTAK.js → route-BczKcyvV.js} +1 -1
  48. package/dist/server/_next/static/{route-B0WNLJZp.js → route-BiSvZr_s.js} +1 -1
  49. package/dist/server/_next/static/{route-Dbs39TkC.js → route-Bj7s6WXI.js} +1 -1
  50. package/dist/server/_next/static/{route-vD15s2A8.js → route-CGH08Y8C.js} +1 -1
  51. package/dist/server/_next/static/{route-CkH7Cg-p.js → route-CJmc17Dq.js} +1 -1
  52. package/dist/server/_next/static/{route-C74RA7va.js → route-CLvr0Ue3.js} +1 -1
  53. package/dist/server/_next/static/route-CUaIuP8a.js +1 -0
  54. package/dist/server/_next/static/{route-BPcAdbz_.js → route-CcrNbScT.js} +1 -1
  55. package/dist/server/_next/static/route-CiOFTfyw2.js +1 -0
  56. package/dist/server/_next/static/route-Cn7l9eYT.js +1 -0
  57. package/dist/server/_next/static/route-CnKXQb5r2.js +1 -0
  58. package/dist/server/_next/static/{route-CVPPmUto.js → route-D93PQ3NI2.js} +1 -1
  59. package/dist/server/_next/static/{route-D_G2SOlz.js → route-D9ZD1_5T.js} +1 -1
  60. package/dist/server/_next/static/{route-DAyF4BHS.js → route-DWPhX9kT2.js} +1 -1
  61. package/dist/server/_next/static/route-DihT2xS82.js +1 -0
  62. package/dist/server/_next/static/route-Dn-sYYEs.js +1 -0
  63. package/dist/server/_next/static/route-DpzLCx1V.js +1 -0
  64. package/dist/server/_next/static/route-Dswz7MvP2.js +1 -0
  65. package/dist/server/_next/static/route-Dwk0kt8B.js +1 -0
  66. package/dist/server/_next/static/route-DxLQx9eD.js +1 -0
  67. package/dist/server/_next/static/{route-zazqen-A2.js → route-FwNLcs2r2.js} +1 -1
  68. package/dist/server/_next/static/route-GmbSJZjk2.js +1 -0
  69. package/dist/server/_next/static/route-iUxcDN2r.js +1 -0
  70. package/dist/server/_next/static/{route-UWQN8uYr.js → route-j61HPczh.js} +1 -1
  71. package/dist/server/_next/static/{route-CHJzaQu2.js → route-qJ1EJhxJ.js} +1 -1
  72. package/dist/server/_next/static/{route-BWk9YK7r.js → route-sNW0pw7C.js} +1 -1
  73. package/dist/server/_next/static/{seed-cache-oCd9Lfdw.js → seed-cache-DsYPqBld.js} +1 -1
  74. package/dist/server/_next/static/{server-CS40XqUP.js → server-DwVU6UyP.js} +1 -1
  75. package/dist/server/_next/static/storage-fxaUbjG1.js +322 -0
  76. package/dist/server/_next/static/streamer-DUAWx_Tm.js +2 -0
  77. package/dist/server/_next/static/{subtitles-DYBlMnha.js → subtitles-4c0GFlaW.js} +1 -1
  78. package/dist/server/_next/static/{title-progress-CQBrSxvN.js → title-progress-BTypVYBz.js} +1 -1
  79. package/dist/server/index.js +2 -2
  80. package/dist/server/prerendered-routes/404.html +2 -2
  81. package/dist/server/prerendered-routes/index.html +2 -2
  82. package/dist/server/prerendered-routes/index.rsc +2 -2
  83. package/dist/server/ssr/__vite_rsc_assets_manifest.js +35 -35
  84. package/dist/server/ssr/_next/static/css/refresh-cw.BOKESpxI.css +1 -0
  85. package/dist/server/ssr/_next/static/minimize-gPI5ytrc.js +1 -0
  86. package/dist/server/ssr/_next/static/netflix-browser-CXJEizJ6.js +2 -0
  87. package/dist/server/ssr/_next/static/{pin-BQre-tQY.js → pin-DiZl7z2n.js} +1 -1
  88. package/dist/server/ssr/_next/static/playback-activity-AIsC-eO5.js +1 -0
  89. package/dist/server/ssr/_next/static/refresh-cw-DNvHlOAy.js +1 -0
  90. package/dist/server/ssr/_next/static/spotify-app-xyDH0rho.js +1 -0
  91. package/dist/server/ssr/_next/static/storefront-DMeL08z3.js +1 -0
  92. package/dist/server/ssr/index.js +1 -1
  93. package/dist/server/ssr/vinext-client-assets.js +1 -1
  94. package/dist/server/ssr/vinext-server.json +1 -1
  95. package/dist/server/vinext-client-assets.js +1 -1
  96. package/dist/server/vinext-prerender-paths.json +1 -1
  97. package/dist/server/vinext-prerender.json +16 -1
  98. package/dist/server/vinext-server.json +1 -1
  99. package/package.json +4 -2
  100. package/dist/client/_next/static/chunks/manage-profiles-modal-Doi6QM4e.js +0 -1
  101. package/dist/client/_next/static/chunks/netflix-browser-L_Vb9wXK.js +0 -2
  102. package/dist/client/_next/static/chunks/playback-activity-Dug3BRYr.js +0 -1
  103. package/dist/client/_next/static/chunks/playback-activity-track-switcher-CbO6kl8K.js +0 -1
  104. package/dist/client/_next/static/chunks/spotify-app-f93K4FG_.js +0 -1
  105. package/dist/client/_next/static/chunks/storefront-C_nmcuvH.js +0 -1
  106. package/dist/client/_next/static/css/index.BGXy8e6j.css +0 -1
  107. package/dist/client/_next/static/css/layout.AKSLtSR6.css +0 -1
  108. package/dist/client/_next/static/css/layout.D8T68cCD.css +0 -1
  109. package/dist/client/_next/static/css/manage-profiles-modal.BAVyxRRR.css +0 -1
  110. package/dist/server/_next/static/css/index.BGXy8e6j.css +0 -1
  111. package/dist/server/_next/static/css/layout.AKSLtSR6.css +0 -1
  112. package/dist/server/_next/static/css/layout.D8T68cCD.css +0 -1
  113. package/dist/server/_next/static/database-BNnYfHmT.js +0 -114
  114. package/dist/server/_next/static/netflix-page-BRbORN1F.js +0 -1
  115. package/dist/server/_next/static/route-96DdgJBs.js +0 -1
  116. package/dist/server/_next/static/route-BBmE0xf12.js +0 -1
  117. package/dist/server/_next/static/route-BdG5ojMj2.js +0 -1
  118. package/dist/server/_next/static/route-BovNctFc.js +0 -1
  119. package/dist/server/_next/static/route-C2LuSjoh.js +0 -1
  120. package/dist/server/_next/static/route-CCUsQ7AG.js +0 -1
  121. package/dist/server/_next/static/route-CN6VdJwN.js +0 -1
  122. package/dist/server/_next/static/route-CjUCKwSj2.js +0 -1
  123. package/dist/server/_next/static/route-Cn40NftM.js +0 -1
  124. package/dist/server/_next/static/route-DWAMZHLa.js +0 -1
  125. package/dist/server/_next/static/route-DiT9UYUd.js +0 -1
  126. package/dist/server/_next/static/route-jMq6H_yh.js +0 -1
  127. package/dist/server/_next/static/storage-D1zF0J_t.js +0 -288
  128. package/dist/server/_next/static/streamer-B1PRR-dj.js +0 -2
  129. package/dist/server/ssr/_next/static/css/refresh-cw.BAVyxRRR.css +0 -1
  130. package/dist/server/ssr/_next/static/minimize-C9JLgte-.js +0 -1
  131. package/dist/server/ssr/_next/static/netflix-browser-CMAehdwi.js +0 -2
  132. package/dist/server/ssr/_next/static/playback-activity-D5TYX2Ae.js +0 -1
  133. package/dist/server/ssr/_next/static/refresh-cw-CWdWHjqY.js +0 -1
  134. package/dist/server/ssr/_next/static/spotify-app-CE-RaTjZ.js +0 -1
  135. package/dist/server/ssr/_next/static/storefront-C5NNzPMa.js +0 -1
  136. /package/dist/client/_next/static/{e1ce9af7-d770-43d6-845a-511443f19971 → 7c810a6d-59fd-41d6-b465-cf61efaea04f}/_buildManifest.js +0 -0
  137. /package/dist/client/_next/static/{e1ce9af7-d770-43d6-845a-511443f19971 → 7c810a6d-59fd-41d6-b465-cf61efaea04f}/_ssgManifest.js +0 -0
  138. /package/dist/server/_next/static/{layout-Ds3pFa6r.js → layout-D1iejeee.js} +0 -0
  139. /package/dist/server/_next/static/{layout-ClEWbCcj.js → layout-DpOw0OgX.js} +0 -0
@@ -1,8 +1,8 @@
1
1
  export default {
2
- "bootstrapScriptContent": "import(\"/_next/static/chunks/index-hn3AiVww.js\")",
2
+ "bootstrapScriptContent": "import(\"/_next/static/chunks/index-BUxxgh38.js\")",
3
3
  "clientEntryDeps": {
4
4
  "js": [
5
- "/_next/static/chunks/index-hn3AiVww.js",
5
+ "/_next/static/chunks/index-BUxxgh38.js",
6
6
  "/_next/static/chunks/rolldown-runtime-QTnfLwEv.js",
7
7
  "/_next/static/chunks/framework-BQUlGUOV.js",
8
8
  "/_next/static/chunks/navigation-errors-C_V42-00.js"
@@ -12,10 +12,10 @@ export default {
12
12
  "clientReferenceDeps": {
13
13
  "a340ac14ea46": {
14
14
  "js": [
15
- "/_next/static/chunks/app-top-nav-Dh0jEt8u.js",
15
+ "/_next/static/chunks/app-top-nav-Co7RIixU.js",
16
16
  "/_next/static/chunks/framework-BQUlGUOV.js",
17
17
  "/_next/static/chunks/rolldown-runtime-QTnfLwEv.js",
18
- "/_next/static/chunks/index-hn3AiVww.js",
18
+ "/_next/static/chunks/index-BUxxgh38.js",
19
19
  "/_next/static/chunks/navigation-errors-C_V42-00.js",
20
20
  "/_next/static/chunks/chevron-left-Dn3noAqV.js",
21
21
  "/_next/static/chunks/house-DQz6VeTk.js"
@@ -24,56 +24,56 @@ export default {
24
24
  },
25
25
  "f1da2b17eb86": {
26
26
  "js": [
27
- "/_next/static/chunks/storefront-C_nmcuvH.js",
27
+ "/_next/static/chunks/storefront-CCeanBPs.js",
28
28
  "/_next/static/chunks/rolldown-runtime-QTnfLwEv.js",
29
29
  "/_next/static/chunks/framework-BQUlGUOV.js",
30
- "/_next/static/chunks/index-hn3AiVww.js",
30
+ "/_next/static/chunks/index-BUxxgh38.js",
31
31
  "/_next/static/chunks/navigation-errors-C_V42-00.js",
32
32
  "/_next/static/chunks/chevron-left-Dn3noAqV.js",
33
- "/_next/static/chunks/step-forward-CV8I5pPb.js",
34
- "/_next/static/chunks/playback-activity-track-switcher-CbO6kl8K.js",
35
- "/_next/static/chunks/manage-profiles-modal-Doi6QM4e.js"
33
+ "/_next/static/chunks/provider-registry-CWHfJn3B.js",
34
+ "/_next/static/chunks/playback-activity-track-switcher-BzvHiv7c.js",
35
+ "/_next/static/chunks/manage-profiles-modal-CWi3qgd4.js"
36
36
  ],
37
37
  "css": [
38
- "/_next/static/css/manage-profiles-modal.BAVyxRRR.css"
38
+ "/_next/static/css/manage-profiles-modal.BOKESpxI.css"
39
39
  ]
40
40
  },
41
41
  "278c117307e7": {
42
42
  "js": [
43
- "/_next/static/chunks/netflix-browser-L_Vb9wXK.js",
43
+ "/_next/static/chunks/netflix-browser-BrXQctI5.js",
44
44
  "/_next/static/chunks/rolldown-runtime-QTnfLwEv.js",
45
45
  "/_next/static/chunks/framework-BQUlGUOV.js",
46
- "/_next/static/chunks/index-hn3AiVww.js",
46
+ "/_next/static/chunks/index-BUxxgh38.js",
47
47
  "/_next/static/chunks/navigation-errors-C_V42-00.js",
48
48
  "/_next/static/chunks/chevron-left-Dn3noAqV.js",
49
- "/_next/static/chunks/step-forward-CV8I5pPb.js",
50
- "/_next/static/chunks/playback-activity-Dug3BRYr.js",
51
- "/_next/static/chunks/manage-profiles-modal-Doi6QM4e.js"
49
+ "/_next/static/chunks/provider-registry-CWHfJn3B.js",
50
+ "/_next/static/chunks/playback-activity-66FeikYZ.js",
51
+ "/_next/static/chunks/manage-profiles-modal-CWi3qgd4.js"
52
52
  ],
53
53
  "css": [
54
- "/_next/static/css/manage-profiles-modal.BAVyxRRR.css"
54
+ "/_next/static/css/manage-profiles-modal.BOKESpxI.css"
55
55
  ]
56
56
  },
57
57
  "6fda1fc439ba": {
58
58
  "js": [
59
- "/_next/static/chunks/spotify-app-f93K4FG_.js",
59
+ "/_next/static/chunks/spotify-app-CJimeMR0.js",
60
60
  "/_next/static/chunks/rolldown-runtime-QTnfLwEv.js",
61
61
  "/_next/static/chunks/framework-BQUlGUOV.js",
62
62
  "/_next/static/chunks/chevron-left-Dn3noAqV.js",
63
- "/_next/static/chunks/playback-activity-track-switcher-CbO6kl8K.js",
64
- "/_next/static/chunks/manage-profiles-modal-Doi6QM4e.js",
65
- "/_next/static/chunks/playback-activity-Dug3BRYr.js",
63
+ "/_next/static/chunks/playback-activity-track-switcher-BzvHiv7c.js",
64
+ "/_next/static/chunks/manage-profiles-modal-CWi3qgd4.js",
65
+ "/_next/static/chunks/playback-activity-66FeikYZ.js",
66
66
  "/_next/static/chunks/house-DQz6VeTk.js",
67
- "/_next/static/chunks/index-hn3AiVww.js",
67
+ "/_next/static/chunks/index-BUxxgh38.js",
68
68
  "/_next/static/chunks/navigation-errors-C_V42-00.js"
69
69
  ],
70
70
  "css": [
71
- "/_next/static/css/manage-profiles-modal.BAVyxRRR.css"
71
+ "/_next/static/css/manage-profiles-modal.BOKESpxI.css"
72
72
  ]
73
73
  },
74
74
  "9276801271d6": {
75
75
  "js": [
76
- "/_next/static/chunks/index-hn3AiVww.js",
76
+ "/_next/static/chunks/index-BUxxgh38.js",
77
77
  "/_next/static/chunks/rolldown-runtime-QTnfLwEv.js",
78
78
  "/_next/static/chunks/framework-BQUlGUOV.js",
79
79
  "/_next/static/chunks/navigation-errors-C_V42-00.js"
@@ -82,7 +82,7 @@ export default {
82
82
  },
83
83
  "0b874ad30386": {
84
84
  "js": [
85
- "/_next/static/chunks/index-hn3AiVww.js",
85
+ "/_next/static/chunks/index-BUxxgh38.js",
86
86
  "/_next/static/chunks/rolldown-runtime-QTnfLwEv.js",
87
87
  "/_next/static/chunks/framework-BQUlGUOV.js",
88
88
  "/_next/static/chunks/navigation-errors-C_V42-00.js"
@@ -91,7 +91,7 @@ export default {
91
91
  },
92
92
  "593f344dc510": {
93
93
  "js": [
94
- "/_next/static/chunks/index-hn3AiVww.js",
94
+ "/_next/static/chunks/index-BUxxgh38.js",
95
95
  "/_next/static/chunks/rolldown-runtime-QTnfLwEv.js",
96
96
  "/_next/static/chunks/framework-BQUlGUOV.js",
97
97
  "/_next/static/chunks/navigation-errors-C_V42-00.js"
@@ -100,7 +100,7 @@ export default {
100
100
  },
101
101
  "bad85346fc72": {
102
102
  "js": [
103
- "/_next/static/chunks/index-hn3AiVww.js",
103
+ "/_next/static/chunks/index-BUxxgh38.js",
104
104
  "/_next/static/chunks/rolldown-runtime-QTnfLwEv.js",
105
105
  "/_next/static/chunks/framework-BQUlGUOV.js",
106
106
  "/_next/static/chunks/navigation-errors-C_V42-00.js"
@@ -109,17 +109,17 @@ export default {
109
109
  },
110
110
  "15c18cfaeeff": {
111
111
  "js": [
112
- "/_next/static/chunks/layout-segment-context-DRM8YCgm.js",
112
+ "/_next/static/chunks/layout-segment-context-D_cL7vkY.js",
113
113
  "/_next/static/chunks/rolldown-runtime-QTnfLwEv.js",
114
114
  "/_next/static/chunks/framework-BQUlGUOV.js",
115
115
  "/_next/static/chunks/navigation-errors-C_V42-00.js",
116
- "/_next/static/chunks/index-hn3AiVww.js"
116
+ "/_next/static/chunks/index-BUxxgh38.js"
117
117
  ],
118
118
  "css": []
119
119
  },
120
120
  "8c0f216c4604": {
121
121
  "js": [
122
- "/_next/static/chunks/index-hn3AiVww.js",
122
+ "/_next/static/chunks/index-BUxxgh38.js",
123
123
  "/_next/static/chunks/rolldown-runtime-QTnfLwEv.js",
124
124
  "/_next/static/chunks/framework-BQUlGUOV.js",
125
125
  "/_next/static/chunks/navigation-errors-C_V42-00.js"
@@ -131,7 +131,7 @@ export default {
131
131
  "/_next/static/chunks/streamed-icons-DwsKSgMb.js",
132
132
  "/_next/static/chunks/rolldown-runtime-QTnfLwEv.js",
133
133
  "/_next/static/chunks/framework-BQUlGUOV.js",
134
- "/_next/static/chunks/index-hn3AiVww.js",
134
+ "/_next/static/chunks/index-BUxxgh38.js",
135
135
  "/_next/static/chunks/navigation-errors-C_V42-00.js"
136
136
  ],
137
137
  "css": []
@@ -141,21 +141,21 @@ export default {
141
141
  "app/layout.tsx": {
142
142
  "js": [],
143
143
  "css": [
144
- "/_next/static/css/index.BGXy8e6j.css"
144
+ "/_next/static/css/index.8o3Y-jts.css"
145
145
  ]
146
146
  },
147
147
  "app/netflix/layout.tsx": {
148
148
  "js": [],
149
149
  "css": [
150
- "/_next/static/css/layout.D8T68cCD.css",
151
- "/_next/static/css/index.BGXy8e6j.css"
150
+ "/_next/static/css/layout.D4D5fsiD.css",
151
+ "/_next/static/css/index.8o3Y-jts.css"
152
152
  ]
153
153
  },
154
154
  "app/spotify/layout.tsx": {
155
155
  "js": [],
156
156
  "css": [
157
- "/_next/static/css/layout.AKSLtSR6.css",
158
- "/_next/static/css/index.BGXy8e6j.css"
157
+ "/_next/static/css/layout.D2NsWbhP.css",
158
+ "/_next/static/css/index.8o3Y-jts.css"
159
159
  ]
160
160
  }
161
161
  }
@@ -0,0 +1 @@
1
+ .access-popover-wrap{position:relative}.access-popover{--access-surface:#000000f0;--access-border:#ffffff24;--access-line:#363636;--access-raised:#333;--access-field:#1c1c1c;--access-field-border:#444;--access-text:#fff;--access-strong:#eee;--access-muted:#b3b3b3;--access-accent:#e50914;--access-accent-soft:#e509142b;--access-accent-icon:#ff3943;--access-action:#fff;--access-action-hover:#dcdcdc;--access-action-text:#111;--access-shadow:0 1rem 2.5rem #00000073;z-index:60;top:var(--access-top,calc(100% + .55rem));right:var(--access-right,0);border:1px solid var(--access-border);background:var(--access-surface);width:min(26rem,100vw - 2rem);box-shadow:var(--access-shadow);color:var(--access-text);text-align:left;border-radius:.35rem;padding:.8rem;font-size:1rem;animation:.16s cubic-bezier(.2,.8,.2,1) access-popover-in;position:absolute}.access-popover--light{--access-surface:#fff;--access-border:#dadce0;--access-line:#e3e5e8;--access-raised:#e8f0fe;--access-field:#f8f9fa;--access-field-border:#dadce0;--access-text:#202124;--access-strong:#202124;--access-muted:#5f6368;--access-accent:#1a73e8;--access-accent-soft:#1a73e81f;--access-accent-icon:#1a73e8;--access-action:#1a73e8;--access-action-hover:#1b66c9;--access-action-text:#fff;--access-shadow:0 .5rem 1.5rem #3c404338}.access-popover .access-caret{border-top:1px solid var(--access-border);border-left:1px solid var(--access-border);background:var(--access-surface);width:.85rem;height:.85rem;position:absolute;top:-.48rem;right:1rem;transform:rotate(45deg)}.access-popover .access-heading{align-items:center;gap:.75rem;padding:.35rem .35rem .85rem;display:flex}.access-popover .access-heading>span{background:var(--access-accent-soft);width:2.5rem;height:2.5rem;color:var(--access-accent-icon);border-radius:50%;flex:none;place-items:center;display:grid}.access-popover .access-heading>span svg{width:1.2rem;height:1.2rem;color:inherit}.access-popover .access-heading>div{flex-direction:column;flex:1;min-width:0;display:flex}.access-popover .access-heading b{color:var(--access-text);font-size:.95rem}.access-popover .access-heading small{color:var(--access-muted);font-size:.7rem}.access-popover .access-tabs{border:1px solid var(--access-line);background:var(--access-field);border-radius:.3rem;grid-template-columns:1fr 1.35fr;gap:.2rem;padding:.2rem;display:grid}.access-popover .access-tabs button{width:100%;height:auto;min-height:2.35rem;color:var(--access-muted);cursor:pointer;background:0 0;border:0;border-radius:.2rem;padding:.45rem .65rem;font-family:inherit;font-size:.76rem;font-weight:700}.access-popover .access-tabs button:hover{color:var(--access-text)}.access-popover .access-tabs button[aria-selected=true]{background:var(--access-raised);color:var(--access-text);box-shadow:inset 0 -2px 0 var(--access-accent)}.access-popover .access-tab-panel{min-height:18.8rem;padding-top:.8rem}.access-popover .access-url-row{grid-template-columns:minmax(0,1fr) auto;gap:.45rem;display:grid}.access-popover .access-url-row>a{border:1px solid var(--access-field-border);background:var(--access-field);min-width:0;min-height:2.5rem;color:var(--access-muted);border-radius:.25rem;align-items:center;gap:.45rem;padding:.55rem .65rem;font-size:.72rem;text-decoration:none;display:flex}.access-popover .access-url-row>a:hover{border-color:var(--access-muted);color:var(--access-text)}.access-popover .access-url-row>a span{text-overflow:ellipsis;white-space:nowrap;min-width:0;overflow:hidden}.access-popover .access-url-row>a svg{width:.9rem;height:.9rem;color:inherit;flex:none}.access-popover .access-url-row>button{background:var(--access-action);width:auto;min-width:5.25rem;height:auto;color:var(--access-action-text);cursor:pointer;border:0;border-radius:.25rem;justify-content:center;align-items:center;gap:.38rem;padding:.55rem .7rem;font-family:inherit;font-size:.72rem;font-weight:800;display:flex}.access-popover .access-url-row>button:hover{background:var(--access-action-hover)}.access-popover .access-url-row>button svg{width:.95rem;height:.95rem;color:inherit}.access-popover .access-qr{background:#fff;border-radius:.35rem;place-items:center;width:max-content;margin:.8rem auto 0;display:grid;overflow:hidden}.access-popover .access-qr svg{width:min(11.5rem,50vw);height:auto;display:block}.access-popover .access-tab-panel>p{color:var(--access-muted);text-align:center;margin:.55rem 0 0;font-size:.7rem}.access-popover .access-loading,.access-popover .access-unavailable{min-height:17.5rem;color:var(--access-muted);text-align:center;flex-direction:column;justify-content:center;align-items:center;gap:.45rem;padding:1.5rem;font-size:.78rem;display:flex}.access-popover .access-loading svg,.access-popover .access-unavailable>svg{width:1.75rem;height:1.75rem;color:var(--access-muted);margin-bottom:.25rem}.access-popover .access-unavailable b{color:var(--access-strong);font-size:.85rem}.access-popover .access-unavailable small{max-width:17rem;color:var(--access-muted);font-size:.72rem;line-height:1.45}.access-popover .access-unavailable-link{background:var(--access-action);color:var(--access-action-text);border-radius:.25rem;align-items:center;gap:.38rem;margin-top:.5rem;padding:.5rem .8rem;font-size:.72rem;font-weight:800;text-decoration:none;display:flex}.access-popover .access-unavailable-link:hover{background:var(--access-action-hover)}.access-popover .access-unavailable-link svg{width:.9rem;height:.9rem;color:inherit;flex:none}.access-popover .access-spin{animation:.9s linear infinite access-spin}@keyframes access-popover-in{0%{opacity:0;transform:translateY(-.35rem)}}@keyframes access-spin{to{transform:rotate(360deg)}}@media (max-width:700px){.access-popover{top:var(--access-mobile-top,3.6rem);width:auto;max-height:calc(100dvh - var(--access-mobile-top,3.6rem) - .8rem);position:fixed;left:.6rem;right:.6rem;overflow-y:auto}.access-popover .access-caret{display:none}}@media (max-height:560px){.access-popover .access-heading,.access-popover .access-tab-panel>p{display:none}.access-popover .access-tab-panel,.access-popover .access-loading,.access-popover .access-unavailable{min-height:0}.access-popover .access-qr svg{width:min(11.5rem,34vh)}}._backdrop_ttlmb_1{z-index:150;color:#fff;-webkit-backdrop-filter:blur(.25rem);backdrop-filter:blur(.25rem);background:#000000c2;place-items:start center;padding:2.5rem 1rem;animation:.18s _backdrop-in_ttlmb_1;display:grid;position:fixed;inset:0;overflow-y:auto}._modal_ttlmb_15{--profile-manager-red:#e50914;background:radial-gradient(circle at 90% 0,#e5091429,#0000 18rem),#181818;border:1px solid #3f3f3f;border-radius:.65rem;width:min(45rem,100vw - 2rem);padding:2.5rem;animation:.22s cubic-bezier(.16,1,.3,1) _modal-in_ttlmb_1;position:relative;box-shadow:0 1.5rem 5rem #000000b8}._close_ttlmb_29{z-index:5;color:#fff;cursor:pointer;background:#181818;border:0;border-radius:50%;place-items:center;width:2.25rem;height:2.25rem;padding:0;display:grid;position:absolute;top:1rem;right:1rem}._close_ttlmb_29:hover{background:#303030}._close_ttlmb_29:focus-visible{outline-offset:2px;outline:2px solid #fff}._close_ttlmb_29 svg{width:1.35rem}._header_ttlmb_59{align-items:center;gap:.9rem;margin-bottom:1.5rem;display:flex}._icon_ttlmb_66{background:var(--profile-manager-red);border-radius:.45rem;flex:none;place-items:center;width:2.8rem;height:2.8rem;display:grid}._icon_ttlmb_66 svg{width:1.35rem}._header_ttlmb_59 h2{margin:0 0 .25rem;font-size:1.75rem}._header_ttlmb_59 p{color:#aaa;margin:0;font-size:.82rem}._list_ttlmb_91{border:1px solid #3b3b3b;border-radius:.4rem;display:grid;overflow:hidden}._row_ttlmb_98{background:#232323;border-bottom:1px solid #383838;grid-template-columns:auto 1fr auto auto;align-items:center;gap:.75rem;min-height:4.8rem;padding:.8rem;display:grid}._row_ttlmb_98:last-child{border-bottom:0}._avatar_ttlmb_113{border-radius:.35rem;flex:none;place-items:center;width:3rem;height:3rem;font-size:1.2rem;font-weight:850;display:grid;box-shadow:inset 0 -.35rem #00000021}._name_ttlmb_125{flex-direction:column;gap:.18rem;min-width:0;display:flex}._name_ttlmb_125 b{text-overflow:ellipsis;overflow:hidden}._name_ttlmb_125 small{color:#999;font-size:.7rem}._iconButton_ttlmb_142{color:#fff;cursor:pointer;background:0 0;border:1px solid #565656;border-radius:50%;place-items:center;width:2.35rem;height:2.35rem;padding:0;display:grid}._iconButton_ttlmb_142:hover{background:#343434;border-color:#fff}:is(._iconButton_ttlmb_142:focus-visible,._button_ttlmb_161:focus-visible){outline-offset:2px;outline:2px solid #fff}._iconButton_ttlmb_142 svg{width:1rem}._iconButtonDanger_ttlmb_170{color:#ff8d92}._iconButton_ttlmb_142:disabled{opacity:.3;cursor:not-allowed}._editor_ttlmb_179{background:#292929;border-bottom:1px solid #383838;grid-template-columns:auto minmax(0,1fr) auto;align-items:start;gap:1rem;padding:1rem;display:grid}._editorFields_ttlmb_189{gap:.4rem;min-width:0;display:grid}._editorFields_ttlmb_189>label,._addForm_ttlmb_196 label{font-size:.72rem;font-weight:750}._editorFields_ttlmb_189>input,._addForm_ttlmb_196>div>input{color:#fff;background:#181818;border:1px solid #686868;border-radius:.25rem;outline:0;width:100%;height:2.6rem;padding:0 .75rem}._editorFields_ttlmb_189>input:focus,._addForm_ttlmb_196 input:focus{border-color:#fff}._editorActions_ttlmb_218{align-self:center;gap:.45rem;display:flex}._button_ttlmb_161{color:#fff;cursor:pointer;background:#303030;border:1px solid #5a5a5a;border-radius:.25rem;justify-content:center;align-items:center;gap:.4rem;min-height:2.45rem;padding:.45rem .8rem;font-size:.75rem;font-weight:750;display:inline-flex}._button_ttlmb_161 svg{width:1rem}._buttonPrimary_ttlmb_244{border-color:var(--profile-manager-red);background:var(--profile-manager-red)}._buttonQuiet_ttlmb_249{background:0 0}._buttonDanger_ttlmb_253{background:#8f2026;border-color:#8f2026}._button_ttlmb_161:disabled{opacity:.55;cursor:wait}._colorPicker_ttlmb_263{border:0;min-width:0;margin:.25rem 0 0;padding:0}._colorPicker_ttlmb_263 legend{color:#aaa;margin-bottom:.35rem;font-size:.67rem}._colorPicker_ttlmb_263>div{flex-wrap:wrap;gap:.42rem;display:flex}._colorPicker_ttlmb_263 label{cursor:pointer;display:block}._colorPicker_ttlmb_263 input{opacity:0;width:1px;height:1px;position:absolute}._colorPicker_ttlmb_263 span{border:2px solid #0000;border-radius:50%;width:1.45rem;height:1.45rem;display:block;box-shadow:0 0 0 1px #5c5c5c}._colorPicker_ttlmb_263 input:focus-visible+span{outline-offset:2px;outline:2px solid #fff}._colorPicker_ttlmb_263 input:checked+span{border-color:#fff;box-shadow:0 0 0 2px #fff}._deleteConfirm_ttlmb_313{background:#75272b2b;border:1px solid #75272b;border-radius:.35rem;grid-template-columns:1fr auto auto;align-items:center;gap:.55rem;margin-top:.8rem;padding:.8rem;display:grid}._deleteConfirm_ttlmb_313>span{flex-direction:column;gap:.2rem;display:flex}._deleteConfirm_ttlmb_313 small{color:#aaa;font-size:.7rem}._addForm_ttlmb_196{grid-template-columns:minmax(10rem,1fr) 1fr auto;align-items:end;gap:1rem;margin-top:1.25rem;display:grid}._addForm_ttlmb_196>div:first-child{gap:.4rem;display:grid}._error_ttlmb_349{color:#ff777d;margin:.8rem 0 0;font-size:.78rem}._spin_ttlmb_355{animation:.9s linear infinite _spin_ttlmb_355}@keyframes _backdrop-in_ttlmb_1{0%{opacity:0}}@keyframes _modal-in_ttlmb_1{0%{opacity:0;transform:scale(.96)translateY(1rem)}}@keyframes _spin_ttlmb_355{to{transform:rotate(360deg)}}@media (max-width:700px){._backdrop_ttlmb_1{place-items:stretch stretch;padding:0}._modal_ttlmb_15{width:100%;min-height:100svh;padding:4.5rem 1rem max(2rem, env(safe-area-inset-bottom));border:0;border-radius:0}._editor_ttlmb_179{grid-template-columns:auto minmax(0,1fr)}._editorActions_ttlmb_218{grid-column:1/-1;justify-content:flex-end}._deleteConfirm_ttlmb_313,._addForm_ttlmb_196{grid-template-columns:1fr}._deleteConfirm_ttlmb_313 ._button_ttlmb_161{width:100%}._close_ttlmb_29{top:max(.8rem, env(safe-area-inset-top));position:fixed;right:.8rem}}
@@ -0,0 +1 @@
1
+ import{n as e}from"./chevron-left-CkBJG8E2.js";var t=e(`arrow-left`,[[`path`,{d:`m12 19-7-7 7-7`,key:`1l729n`}],[`path`,{d:`M19 12H5`,key:`x3x0zl`}]]),n=e(`circle-question-mark`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3`,key:`1u773s`}],[`path`,{d:`M12 17h.01`,key:`p32p05`}]]),r=e(`captions`,[[`rect`,{width:`18`,height:`14`,x:`3`,y:`5`,rx:`2`,ry:`2`,key:`12ruh7`}],[`path`,{d:`M7 15h4M15 15h2M7 11h2M13 11h4`,key:`1ueiar`}]]),i=e(`list-video`,[[`path`,{d:`M21 5H3`,key:`1fi0y6`}],[`path`,{d:`M10 12H3`,key:`1ulcyk`}],[`path`,{d:`M10 19H3`,key:`108z41`}],[`path`,{d:`M15 12.003a1 1 0 0 1 1.517-.859l4.997 2.997a1 1 0 0 1 0 1.718l-4.997 2.997a1 1 0 0 1-1.517-.86z`,key:`ms4nik`}]]),a=e(`rotate-ccw`,[[`path`,{d:`M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8`,key:`1357e3`}],[`path`,{d:`M3 3v5h5`,key:`1xhq8a`}]]),o=e(`rotate-cw`,[[`path`,{d:`M21 12a9 9 0 1 1-9-9c2.52 0 4.93 1 6.74 2.74L21 8`,key:`1p45f6`}],[`path`,{d:`M21 3v5h-5`,key:`1q7to0`}]]),s=e(`step-forward`,[[`path`,{d:`M10.029 4.285A2 2 0 0 0 7 6v12a2 2 0 0 0 3.029 1.715l9.997-5.998a2 2 0 0 0 .003-3.432z`,key:`1ystz2`}],[`path`,{d:`M3 4v16`,key:`1ph11n`}]]),c=[{id:`phimhdcss`,name:`PhimHDC`,baseUrl:`https://phimhdcss.com/`,hosts:[`phimhdcss.com`,`www.phimhdcss.com`,`phimhdcss.net`,`www.phimhdcss.net`],accentColor:`#7a171d`},{id:`fsharetv`,name:`FshareTV`,baseUrl:`https://fsharetv.com/`,hosts:[`fsharetv.com`,`www.fsharetv.com`],accentColor:`#235b76`},{id:`hh3d`,name:`HH3D`,baseUrl:`https://hh3d.com/`,hosts:[`hh3d.com`,`www.hh3d.com`],accentColor:`#d97706`},{id:`hhpanda`,name:`HHPanda`,baseUrl:`https://hhpanda.st/`,hosts:[`hhpanda.st`,`www.hhpanda.st`],accentColor:`#e11d48`}];function l(e){return c.find(t=>t.id===e)}function u(e,t=`Netflix library`){return l(e)?.name??t}var d=e(`maximize`,[[`path`,{d:`M8 3H5a2 2 0 0 0-2 2v3`,key:`1dcmit`}],[`path`,{d:`M21 8V5a2 2 0 0 0-2-2h-3`,key:`1e4gt3`}],[`path`,{d:`M3 16v3a2 2 0 0 0 2 2h3`,key:`wsl5sc`}],[`path`,{d:`M16 21h3a2 2 0 0 0 2-2v-3`,key:`18trek`}]]),f=e(`minimize`,[[`path`,{d:`M8 3v3a2 2 0 0 1-2 2H3`,key:`hohbtr`}],[`path`,{d:`M21 8h-3a2 2 0 0 1-2-2V3`,key:`5jw1f3`}],[`path`,{d:`M3 16h3a2 2 0 0 1 2 2v3`,key:`198tvr`}],[`path`,{d:`M16 21v-3a2 2 0 0 1 2-2h3`,key:`ph8mxp`}]]);export{s as a,i as c,t as d,u as i,r as l,d as n,o,c as r,a as s,f as t,n as u};
@@ -0,0 +1,2 @@
1
+ import{n as e,t}from"./chevron-left-CkBJG8E2.js";import{a as n,c as r,d as i,i as a,l as o,n as s,o as c,r as l,s as u,t as d,u as f}from"./minimize-gPI5ytrc.js";import{_ as p,a as m,c as ee,f as h,g,h as te,i as ne,l as _,m as v,n as y,o as b,r as re,s as x,t as ie,u as ae,v as S}from"./refresh-cw-DNvHlOAy.js";import{a as oe,c as se,i as ce,l as C,n as le,o as w,r as T,s as E,t as ue}from"./playback-activity-AIsC-eO5.js";import{Fragment as de,jsx as D,jsxs as O}from"react/jsx-runtime";import{useCallback as k,useEffect as A,useMemo as j,useRef as M,useState as N}from"react";var fe=e(`arrow-down-narrow-wide`,[[`path`,{d:`m3 16 4 4 4-4`,key:`1co6wj`}],[`path`,{d:`M7 20V4`,key:`1yoxec`}],[`path`,{d:`M11 4h4`,key:`6d7r33`}],[`path`,{d:`M11 8h7`,key:`djye34`}],[`path`,{d:`M11 12h10`,key:`1438ji`}]]),pe=e(`arrow-up-narrow-wide`,[[`path`,{d:`m3 8 4-4 4 4`,key:`11wl7u`}],[`path`,{d:`M7 4v16`,key:`1glfcx`}],[`path`,{d:`M11 12h4`,key:`q8tih4`}],[`path`,{d:`M11 16h7`,key:`uosisv`}],[`path`,{d:`M11 20h10`,key:`jvxblo`}]]),me=e(`bell-ring`,[[`path`,{d:`M10.268 21a2 2 0 0 0 3.464 0`,key:`vwvbt9`}],[`path`,{d:`M22 8c0-2.3-.8-4.3-2-6`,key:`5bb3ad`}],[`path`,{d:`M3.262 15.326A1 1 0 0 0 4 17h16a1 1 0 0 0 .74-1.673C19.41 13.956 18 12.499 18 8A6 6 0 0 0 6 8c0 4.499-1.411 5.956-2.738 7.326`,key:`11g9vi`}],[`path`,{d:`M4 2C2.8 3.7 2 5.7 2 8`,key:`tap9e0`}]]),he=e(`flag`,[[`path`,{d:`M4 22V4a1 1 0 0 1 .4-.8A6 6 0 0 1 8 2c3 0 5 2 7.333 2q2 0 3.067-.8A1 1 0 0 1 20 4v10a1 1 0 0 1-.4.8A6 6 0 0 1 16 16c-3 0-5-2-8-2a6 6 0 0 0-4 1.528`,key:`1jaruq`}]]),ge=e(`gauge`,[[`path`,{d:`m12 14 4-4`,key:`9kzdfg`}],[`path`,{d:`M3.34 19a10 10 0 1 1 17.32 0`,key:`19p75a`}]]),_e=e(`grip-vertical`,[[`circle`,{cx:`9`,cy:`12`,r:`1`,key:`1vctgf`}],[`circle`,{cx:`9`,cy:`5`,r:`1`,key:`hp0tcf`}],[`circle`,{cx:`9`,cy:`19`,r:`1`,key:`fkjjf6`}],[`circle`,{cx:`15`,cy:`12`,r:`1`,key:`1tmaij`}],[`circle`,{cx:`15`,cy:`5`,r:`1`,key:`19l28e`}],[`circle`,{cx:`15`,cy:`19`,r:`1`,key:`f4zoj3`}]]),ve=e(`info`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M12 16v-4`,key:`1dtifu`}],[`path`,{d:`M12 8h.01`,key:`e9boi3`}]]),ye=e(`log-out`,[[`path`,{d:`m16 17 5-5-5-5`,key:`1bji2h`}],[`path`,{d:`M21 12H9`,key:`dn1m92`}],[`path`,{d:`M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4`,key:`1uf3rs`}]]),be=e(`menu`,[[`path`,{d:`M4 5h16`,key:`1tepv9`}],[`path`,{d:`M4 12h16`,key:`1lakjw`}],[`path`,{d:`M4 19h16`,key:`1djgab`}]]),xe=e(`server`,[[`rect`,{width:`20`,height:`8`,x:`2`,y:`2`,rx:`2`,ry:`2`,key:`ngkwjq`}],[`rect`,{width:`20`,height:`8`,x:`2`,y:`14`,rx:`2`,ry:`2`,key:`iecqi9`}],[`line`,{x1:`6`,x2:`6.01`,y1:`6`,y2:`6`,key:`16zg32`}],[`line`,{x1:`6`,x2:`6.01`,y1:`18`,y2:`18`,key:`nzw8ys`}]]),Se=e(`settings`,[[`path`,{d:`M9.671 4.136a2.34 2.34 0 0 1 4.659 0 2.34 2.34 0 0 0 3.319 1.915 2.34 2.34 0 0 1 2.33 4.033 2.34 2.34 0 0 0 0 3.831 2.34 2.34 0 0 1-2.33 4.033 2.34 2.34 0 0 0-3.319 1.915 2.34 2.34 0 0 1-4.659 0 2.34 2.34 0 0 0-3.32-1.915 2.34 2.34 0 0 1-2.33-4.033 2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915`,key:`1i5ecw`}],[`circle`,{cx:`12`,cy:`12`,r:`3`,key:`1v7zrd`}]]),Ce=e(`thumbs-up`,[[`path`,{d:`M15 5.88 14 10h5.83a2 2 0 0 1 1.92 2.56l-2.33 8A2 2 0 0 1 17.5 22H4a2 2 0 0 1-2-2v-8a2 2 0 0 1 2-2h2.76a2 2 0 0 0 1.79-1.11L12 2a3.13 3.13 0 0 1 3 3.88Z`,key:`emmmcr`}],[`path`,{d:`M7 10v12`,key:`1qc93n`}]]);function we(e){return e.normalize(`NFD`).replace(/\p{M}/gu,``).toLowerCase().replace(/\b(?:19|20)\d{2}\b/g,` `).replace(/&/g,` and `).replace(/[^a-z0-9]+/g,` `).trim()}function Te(e){return Array.from(new Set([e.title,e.originalTitle].filter(e=>!!e?.trim()).map(we).filter(Boolean))).map(t=>`${t}:${e.year}`)}function Ee(e,t){return e.sourceProvider&&t.has(e.sourceProvider)?t.get(e.sourceProvider):e.sourceProvider?t.size+1:t.size}function De(e,t=l.map(e=>e.id)){let n=new Map(t.map((e,t)=>[e,t])),r=e.map((e,t)=>({movie:e,index:t})).sort((e,t)=>Ee(e.movie,n)-Ee(t.movie,n)||e.index-t.index),i=new Set,a=new Set,o=[];for(let{movie:e}of r){if(e.sourceUrl&&a.has(e.sourceUrl))continue;let t=Te(e);if(!t.some(e=>i.has(e))){o.push(e),e.sourceUrl&&a.add(e.sourceUrl);for(let e of t)i.add(e)}}return o}function Oe(e,t){let n=t.trim().toLocaleLowerCase();return n?[e.title,e.originalTitle??``,e.synopsis,e.genres.join(` `),e.cast.join(` `),e.creators?.join(` `)??``,e.director??``].join(` `).toLocaleLowerCase().includes(n):!1}var P=/(?:\s*[-–—|]\s*|\s+)(?:tập|tap|episode|ep\.?)\s*\d+(?:\s*\/\s*\d+)?(?:\s*(?:vietsub|thuyết\s*minh|thuyet\s*minh|lồng\s*tiếng|long\s*tieng|engsub|phụ\s*đề|phu\s*de|\[[^\]]+\]))*\s*$/iu;function F(e){let t=e.replace(/\s+/g,` `).trim();return t.replace(P,``).trim()||t}var ke={myList:[],likedTitles:[],episodeSort:{},trackedTitles:[],newEpisodes:[],progress:[],subtitlePreferences:{fontSize:32,positionX:50,positionY:78,fontColor:`#ffffff`,backgroundColor:`rgba(0,0,0,0.75)`,fontFamily:`default`,captionsOn:!1,updatedAt:``}},I=[{label:`Home`,href:`/netflix`},{label:`Series`,href:`/netflix#netflix-originals`},{label:`Films`,href:`/netflix#movie-night`},{label:`New & Popular`,href:`/netflix#top-10`},{label:`My List`,href:`/netflix#my-list`},{label:`Browse by language`,href:`/netflix#footer`}],Ae=5*6e4;function je(e){return e?`/netflix/search?q=${encodeURIComponent(e)}`:`/netflix/search`}function Me(e){return e.sourceUrl?e.mediaType!==`movie`||(e.episodes?.length??0)>0:!1}function Ne(e){return e.resumePositionSeconds!==void 0}function L(e){let t=Date.parse(e);if(Number.isNaN(t))return``;let n=Math.round((Date.now()-t)/6e4);if(n<1)return`Just now`;if(n<60)return`${n} minute${n===1?``:`s`} ago`;let r=Math.round(n/60);if(r<24)return`${r} hour${r===1?``:`s`} ago`;let i=Math.round(r/24);return`${i} day${i===1?``:`s`} ago`}function Pe(){let e=M(null);return A(()=>{let t=document.activeElement,n=()=>Array.from(e.current?.querySelectorAll(`button, a[href], input, select, textarea, [tabindex]:not([tabindex="-1"])`)??[]).filter(e=>!e.hasAttribute(`disabled`)),r=window.requestAnimationFrame(()=>n()[0]?.focus()),i=t=>{if(t.key!==`Tab`)return;let r=n();if(!r.length)return;let i=r[0],a=r[r.length-1];t.shiftKey&&document.activeElement===i?(t.preventDefault(),a.focus()):(!t.shiftKey&&document.activeElement===a||document.activeElement&&!e.current?.contains(document.activeElement))&&(t.preventDefault(),i.focus())};return document.addEventListener(`keydown`,i),()=>{window.cancelAnimationFrame(r),document.removeEventListener(`keydown`,i),t?.isConnected&&t.focus()}},[]),e}function Fe({featured:e,rows:t,initialImportedTitles:n,initialProviders:r,initialProfiles:i,initialActiveProfile:a,initialProfileLibrary:o,initialSearchOpen:s=!1,initialSearchQuery:c=``}){let[l,u]=N(!1),[d,f]=N(!1),[p,m]=N(!1),[ee,h]=N(!1),[g,te]=N(s),[ne,_]=N(!1),[v,y]=N(!1),[re,ie]=N(!1),[ae,S]=N(!1),[oe,se]=N(r),[ce,C]=N(n),[le,w]=N(i),[T,E]=N(a),[ue,fe]=N(o),[pe,me]=N(``),[he,ge]=N(c),[_e,ve]=N([]),[ye,be]=N(``),[xe,Se]=N(`idle`),[Ce,we]=N(``),[Te,Ee]=N(null),[P,F]=N(null),[I,L]=N(null),[Pe,Fe]=N(!1),[Le,Re]=N(new Set(o.myList)),[ze,Be]=N(new Set(o.likedTitles)),[B,We]=N(new Set(o.trackedTitles??[])),[Ge,Ke]=N(o.episodeSort??{}),qe=M(null),Je=M(s),Ye=M(c),V=M({version:0,controller:null}),H=M(a.id),Xe=M(r),U=M(0),$e=M(0),et=M(0),tt=M(Promise.resolve()),nt=M(!1),rt=k(e=>{H.current!==e&&(H.current=e,U.current+=1,et.current+=1,nt.current=!1,V.current.version+=1,V.current.controller?.abort(),V.current.controller=null,Xe.current=[],se([]),C([]),fe(ke),Re(new Set),Be(new Set),We(new Set),F(null),L(null),me(``))},[]),it=k(()=>{V.current.version+=1,V.current.controller?.abort(),V.current.controller=null},[]),at=k(()=>{it(),L(null)},[it]);A(()=>()=>{it()},[it]),A(()=>{Xe.current=oe},[oe]);let W=k((e,t,n)=>{let r=e?je(t):`/netflix`;`${window.location.pathname}${window.location.search}${window.location.hash}`!==r&&(n===`push`?window.history.pushState(null,``,r):window.history.replaceState(null,``,r))},[]),ot=k(e=>{let t=Je.current;if(Je.current=e,te(e),e){t||W(!0,Ye.current,`push`);return}Ye.current=``,ge(``),t&&W(!1,``,`push`)},[W]),st=k(e=>{Ye.current=e,ge(e),Je.current&&W(!0,e,`replace`)},[W]),ct=j(()=>{let n=[e,...ce,...t.flatMap(e=>e.items)];return Array.from(new Map(n.map(e=>[e.id,e])).values())},[e,ce,t]),G=j(()=>{let e=new Map(ue.progress.map(e=>[e.titleId,e]));return ct.map(t=>{let n=e.get(t.id);return!n||n.completed||n.positionSeconds<1?{...t,progress:void 0,resumeSeason:void 0,resumeEpisode:void 0,resumePositionSeconds:void 0,resumeDurationSeconds:void 0,resumeUpdatedAt:void 0}:{...t,progress:n.durationSeconds>0?Math.min(100,n.positionSeconds/n.durationSeconds*100):0,resumeSeason:n.seasonNumber,resumeEpisode:n.episodeNumber,resumePositionSeconds:n.positionSeconds,resumeDurationSeconds:n.durationSeconds,resumeUpdatedAt:n.updatedAt}})},[ct,ue.progress]),lt=j(()=>new Map(G.map(e=>[e.id,e])),[G]),ut=j(()=>{let e=he.trim();return e?G.filter(t=>Oe(t,e)):[]},[G,he]),dt=he.trim(),ft=j(()=>oe.map(e=>e.id),[oe]),pt=ft.join(`,`),mt=dt.length>=2&&ye===dt?_e:[],ht=dt.length<2?`idle`:ye===dt?xe:`loading`,gt=ye===dt?Ce:``,_t=De([...ut,...mt],ft),vt=j(()=>G.filter(e=>Le.has(e.id)),[Le,G]),K=j(()=>{let e=new Map(ue.progress.map(e=>[e.titleId,e]));return G.filter(t=>{let n=e.get(t.id);return!!(n&&!n.completed&&n.positionSeconds>=1&&(n.durationSeconds<=0||n.positionSeconds/n.durationSeconds<.95))}).sort((t,n)=>{let r=e.get(t.id)?.updatedAt??``;return(e.get(n.id)?.updatedAt??``).localeCompare(r)})},[ue.progress,G]),q=j(()=>ue.newEpisodes??[],[ue.newEpisodes]),yt=j(()=>q.filter(e=>!e.seen).length,[q]),bt=j(()=>{let e=new Map;for(let t of q){let n=e.get(t.titleId);(!n||t.seasonNumber>n.seasonNumber||t.seasonNumber===n.seasonNumber&&t.episodeNumber>n.episodeNumber)&&e.set(t.titleId,t)}return e},[q]),xt=j(()=>Array.from(bt.keys()).flatMap(e=>{let t=lt.get(e);return t?[t]:[]}),[bt,lt]);A(()=>{let e=()=>u(window.scrollY>24);return e(),window.addEventListener(`scroll`,e,{passive:!0}),()=>window.removeEventListener(`scroll`,e)},[]),A(()=>{let e=()=>{let e=window.location.pathname.replace(/\/+$/,``)===`/netflix/search`,t=e?new URLSearchParams(window.location.search).get(`q`)??``:``;Je.current=e,Ye.current=t,te(e),ge(t)};return window.addEventListener(`popstate`,e),()=>window.removeEventListener(`popstate`,e)},[]),A(()=>{g&&(window.scrollTo(0,0),qe.current?.focus())},[g]),A(()=>{let e=he.trim();if(!g||e.length<2)return;let t=new AbortController,n=window.setTimeout(()=>{be(e),ve([]),Se(`loading`),we(``);let n=new URLSearchParams({q:e,profileId:T.id});fetch(`/api/netflix/search?${n}`,{cache:`no-store`,signal:t.signal}).then(async e=>{let t=await e.json();if(!e.ok)throw Error(t.error||`Provider search failed.`);ve(t.titles??[]),Se(`ready`),t.failedProviders?.length&&we(`Some providers could not be searched: ${t.failedProviders.join(`, `)}.`)}).catch(e=>{t.signal.aborted||(Se(`error`),we(e instanceof Error?e.message:`Provider search failed.`))})},350);return()=>{window.clearTimeout(n),t.abort()}},[T.id,pt,g,he]),A(()=>{let e=e=>{e.key===`Escape`&&(I?at():P?F(null):ae?S(!1):re?ie(!1):g&&he?st(``):g?ot(!1):(_(!1),y(!1),f(!1),m(!1),h(!1)))};return document.addEventListener(`keydown`,e),()=>document.removeEventListener(`keydown`,e)},[re,at,ae,I,g,he,P,ot,st]);let St=k(async e=>{let t=++U.current,n=await fetch(`/api/netflix/library?profileId=${encodeURIComponent(e)}`,{cache:`no-store`});if(!n.ok)return;let r=await n.json();H.current!==e||t!==U.current||(nt.current||(Xe.current=r.providers,se(r.providers)),C(r.titles))},[]),Ct=k(async e=>{let t=T.id,n=++et.current;U.current+=1,nt.current=!0;let r=Xe.current,i=new Map(r.map(e=>[e.id,e])),a=e.flatMap(e=>{let t=i.get(e);return t?[t]:[]}),o=new Set(e),s=[...a,...r.filter(({id:e})=>!o.has(e))].map((e,t)=>({...e,priority:t}));Xe.current=s,se(s),me(`Saving source priority…`);try{let r={},i=!1,a=tt.current.catch(()=>void 0).then(async()=>{let n=await fetch(`/api/netflix/providers/order`,{method:`PUT`,headers:{"content-type":`application/json`},body:JSON.stringify({providerIds:e,profileId:t})});r=await n.json(),i=n.ok});if(tt.current=a,await a,!i||!r.providers)throw Error(r.error||`Source priority could not be saved.`);if(H.current!==t||et.current!==n)return;U.current+=1,nt.current=!1,Xe.current=r.providers,se(r.providers),me(`Source priority saved.`)}catch(e){if(H.current!==t||et.current!==n)return;nt.current=!1,Xe.current=r,se(r),me(e instanceof Error?e.message:`Source priority could not be saved.`);try{await St(t)}catch{}}},[T.id,St]),wt=k(async e=>{let t=T.id,n=G.find(t=>t.id===e.id||e.sourceUrl&&t.sourceUrl===e.sourceUrl);if(n||!e.sourceProvider||!e.sourceUrl){ot(!1),F(n??e);return}Ee(e.id),we(``);try{let n=await fetch(`/api/netflix/movies/import`,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify({url:e.sourceUrl,mode:`stream`,profileId:t})}),r=await n.json();if(!n.ok||!r.title)throw Error(r.error||`Movie details could not be loaded.`);if(H.current!==t)return;C(e=>[r.title,...e.filter(e=>e.id!==r.title.id&&e.sourceUrl!==r.title.sourceUrl)]),ot(!1),F(r.title)}catch(e){we(e instanceof Error?e.message:`Movie details could not be loaded.`)}finally{Ee(null)}},[T.id,G,ot]);A(()=>{let e=T.id,t=window.setTimeout(()=>void St(e),0);return()=>window.clearTimeout(t)},[T.id,St]),A(()=>{if(!ce.some(e=>e.downloadStatus===`queued`||e.downloadStatus===`downloading`))return;let e=T.id,t=window.setInterval(()=>void St(e),3e3);return()=>window.clearInterval(t)},[T.id,ce,St]),A(()=>{if(!P&&!I&&!re)return;let e=document.documentElement,t=document.body,n=e.style.overflow,r=t.style.overflow,i=e.style.overscrollBehavior,a=t.style.overscrollBehavior,o=t.style.position,s=t.style.top,c=t.style.left,l=t.style.right,u=t.style.width,d=window.scrollX,f=window.scrollY;return e.style.overflow=`hidden`,t.style.overflow=`hidden`,e.style.overscrollBehavior=`none`,t.style.overscrollBehavior=`none`,t.style.position=`fixed`,t.style.top=`${-f}px`,t.style.left=`${-d}px`,t.style.right=`0`,t.style.width=`100%`,()=>{e.style.overflow=n,t.style.overflow=r,e.style.overscrollBehavior=i,t.style.overscrollBehavior=a,t.style.position=o,t.style.top=s,t.style.left=c,t.style.right=l,t.style.width=u,window.scrollTo(d,f)}},[re,I,P]);let J=k(e=>{fe({...e,trackedTitles:e.trackedTitles??[],newEpisodes:e.newEpisodes??[]}),Re(new Set(e.myList)),Be(new Set(e.likedTitles)),We(new Set(e.trackedTitles??[])),Ke(e.episodeSort??{})},[]),Tt=k(async e=>{let t=await fetch(`/api/netflix/profiles/${encodeURIComponent(e)}/library`,{cache:`no-store`});if(!t.ok)throw Error(`Profile library could not be loaded.`);let n=await t.json();H.current===e&&J(n)},[J]),Y=k(async e=>{let t=++$e.current,n=await fetch(`/api/netflix/profiles/${encodeURIComponent(e.id)}/select`,{method:`POST`});if(!n.ok)return;let r=await n.json();t===$e.current&&(rt(r.activeProfile.id),E(r.activeProfile),J(r.library),m(!1),F(null),it(),L(null))},[J,rt,it]),Et=k(async(e,t)=>{let n=T.id!==t.id;n&&rt(t.id),w(e),E(t),n&&await Tt(t.id)},[T.id,rt,Tt]),X=e=>{let t=T.id,n=!Le.has(e.id);Re(t=>{let r=new Set(t);return n?r.add(e.id):r.delete(e.id),r}),fetch(`/api/netflix/profiles/${encodeURIComponent(t)}/library`,{method:`PATCH`,headers:{"content-type":`application/json`},body:JSON.stringify({titleId:e.id,inMyList:n})}).then(async e=>{if(!e.ok)throw Error();H.current===t&&J(await e.json())}).catch(()=>void Tt(t))},Dt=e=>{let t=T.id,n=!ze.has(e.id);Be(t=>{let r=new Set(t);return n?r.add(e.id):r.delete(e.id),r}),fetch(`/api/netflix/profiles/${encodeURIComponent(t)}/library`,{method:`PATCH`,headers:{"content-type":`application/json`},body:JSON.stringify({titleId:e.id,liked:n})}).then(async e=>{if(!e.ok)throw Error();H.current===t&&J(await e.json())}).catch(()=>void Tt(t))},Z=(e,t)=>{let n=T.id;Ke(n=>{let r={...n};return t===`asc`?delete r[e.id]:r[e.id]=t,r}),fetch(`/api/netflix/profiles/${encodeURIComponent(n)}/library`,{method:`PATCH`,headers:{"content-type":`application/json`},body:JSON.stringify({titleId:e.id,episodeSort:t})}).then(async e=>{if(!e.ok)throw Error();H.current===n&&J(await e.json())}).catch(()=>void Tt(n))},Ot=e=>{let t=T.id,n=!B.has(e.id);We(t=>{let r=new Set(t);return n?r.add(e.id):r.delete(e.id),r}),fetch(`/api/netflix/profiles/${encodeURIComponent(t)}/library`,{method:`PATCH`,headers:{"content-type":`application/json`},body:JSON.stringify({titleId:e.id,tracked:n})}).then(async e=>{if(!e.ok)throw Error();H.current===t&&J(await e.json())}).catch(()=>void Tt(t))},kt=k(e=>{let t=T.id;fetch(`/api/netflix/new-episodes`,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify({...e,profileId:t})}).then(async e=>{if(!e.ok)throw Error();H.current===t&&J(await e.json())}).catch(()=>void Tt(t))},[T.id,J,Tt]);A(()=>{let e=T.id,t=window.setInterval(()=>void Tt(e).catch(()=>void 0),Ae);return()=>window.clearInterval(t)},[T.id,Tt]);let At=(e,t)=>{if(it(),e.sourceProvider&&!e.playbackPath&&!e.canStream){F(e);return}let n=t??e.resumeEpisode,r=e.episodes?.find(e=>e.episode===n)||(e.episode?.episode===n?e.episode:void 0)||(n?{season:e.resumeSeason??e.episode?.season??1,episode:n,title:`Episode ${n}`,duration:e.resumeDurationSeconds?`${Math.max(1,Math.round(e.resumeDurationSeconds/60))}m`:`45m`}:e.episode||e.episodes?.[0]),i=t===void 0||t===e.resumeEpisode;F(null),L(r?{...e,episode:r,resumePositionSeconds:i?e.resumePositionSeconds:void 0,resumeDurationSeconds:i?e.resumeDurationSeconds:void 0}:e)},jt=k(async e=>{let t=V.current;t.version+=1;let n=t.version;t.controller?.abort();let r=new AbortController;t.controller=r;try{let t=await fetch(`/api/netflix/titles/${encodeURIComponent(e)}?profileId=${encodeURIComponent(T.id)}`,{cache:`no-store`,signal:r.signal}),i=await t.json();if(!t.ok||!i.title)throw Error(i.error||`The requested movie was not found.`);if(r.signal.aborted||n!==V.current.version)return;let a=i.title;if(a.sourceProvider&&!a.playbackPath&&!a.canStream)throw Error(`The requested movie is not available to stream.`);a.sourceProvider&&C(e=>[a,...e.filter(e=>e.id!==a.id)]);let o=a.resumeEpisode??a.episode?.episode,s=a.episodes?.find(e=>e.episode===o)||(a.episode?.episode===o?a.episode:void 0)||(o?{season:a.resumeSeason??a.episode?.season??1,episode:o,title:`Episode ${o}`,duration:a.resumeDurationSeconds?`${Math.max(1,Math.round(a.resumeDurationSeconds/60))}m`:`45m`}:a.episode||a.episodes?.[0]);F(null),L(s?{...a,episode:s}:a)}catch(e){if(r.signal.aborted||n!==V.current.version)return;throw e}finally{V.current.controller===r&&(V.current.controller=null)}},[T.id]),Mt=k(e=>{fe(t=>({...t,progress:[e,...t.progress.filter(t=>t.titleId!==e.titleId)]}))},[]);return O(`main`,{className:`site-shell`,children:[D(Ie,{isScrolled:l,mobileMenuOpen:d,setMobileMenuOpen:f,searchOpen:g,setSearchOpen:ot,searchQuery:he,setSearchQuery:st,searchInputRef:qe,profileOpen:p,setProfileOpen:m,notificationsOpen:ee,setNotificationsOpen:h,newEpisodeAlerts:q,unseenNotificationCount:yt,onNotificationsOpened:()=>kt({action:`mark-seen`}),onPlayNewEpisode:e=>{let t=lt.get(e.titleId);t&&(kt({action:`dismiss`,titleId:e.titleId}),At(t,e.episodeNumber))},sourcesOpen:ne,setSourcesOpen:_,downloadsOpen:v,setDownloadsOpen:y,downloads:ce.map(e=>lt.get(e.id)??e),onPlay:e=>{y(!1),At(e)},providers:oe,syncMessage:pe,onReorderProviders:Ct,onSync:async e=>{let t=T.id;se(t=>t.map(t=>t.id===e?{...t,syncStatus:`syncing`,lastError:null}:t)),me(`Syncing provider homepage…`);let n=await fetch(`/api/netflix/providers/${e}/sync?profileId=${encodeURIComponent(t)}`,{method:`POST`}),r=await n.json();H.current===t&&(me(n.ok?`${r.count??0} titles synced to SQLite.`:r.error||`Provider sync failed.`),await St(t))},onAddMovie:()=>{_(!1),y(!1),ie(!0)},profiles:le,activeProfile:T,onSelectProfile:Y,onManageProfiles:()=>{m(!1),S(!0)}}),g?D(He,{query:he,results:_t,providerStatus:ht,error:gt,resolvingTitleId:Te,onSelect:e=>void wt(e)}):O(de,{children:[D(R,{title:lt.get(e.id)??e,previewPaused:Pe,setPreviewPaused:Fe,onPlay:()=>At(lt.get(e.id)??e),onMoreInfo:()=>F(lt.get(e.id)??e)}),O(`section`,{className:`catalog`,"aria-label":`Netflix catalog`,children:[ce.length>0&&D(z,{row:{id:`provider-library`,title:`Your Provider Library`,kind:`standard`,items:ce.map(e=>lt.get(e.id)??e)},rowIndex:-2,myList:Le,likedTitles:ze,onSelect:F,onPlay:At,onToggleMyList:X,onToggleLike:Dt}),xt.length>0&&D(z,{row:{id:`new-episodes`,title:`New Episode`,kind:`standard`,items:xt},rowIndex:-4,myList:Le,likedTitles:ze,newEpisodeAlertsByTitle:bt,playOnCardClick:!0,onSelect:F,onPlay:(e,t)=>{let n=bt.get(e.id);kt({action:`dismiss`,titleId:e.id}),At(e,t??n?.episodeNumber)},onToggleMyList:X,onToggleLike:Dt}),K.length>0&&D(z,{row:{id:`continue-watching`,title:`Continue Watching for ${T.name}`,kind:`continue-watching`,items:K},rowIndex:-3,myList:Le,likedTitles:ze,onSelect:F,onPlay:At,onToggleMyList:X,onToggleLike:Dt}),D(`div`,{className:`my-list-anchor`,id:`my-list`,children:vt.length>0?D(z,{row:{id:`my-list-row`,title:`My List`,kind:`standard`,items:vt},rowIndex:-1,myList:Le,likedTitles:ze,onSelect:F,onPlay:At,onToggleMyList:X,onToggleLike:Dt}):O(`div`,{className:`my-list-empty`,children:[D(`span`,{"aria-hidden":`true`,children:D(x,{})}),O(`div`,{children:[D(`h2`,{children:`Your list is ready for something great`}),D(`p`,{children:`Use the plus button on any title to save it here for later.`})]})]})}),t.map((e,t)=>D(z,{row:{...e,items:e.items.map(e=>lt.get(e.id)??e)},rowIndex:t,myList:Le,likedTitles:ze,onSelect:F,onPlay:At,onToggleMyList:X,onToggleLike:Dt},e.id))]}),D(Qe,{})]}),P&&D(Ue,{title:P,isInMyList:Le.has(P.id),isLiked:ze.has(P.id),canTrack:Ne(P)&&Me(P),isTracked:B.has(P.id),episodeSort:Ge[P.id]??`asc`,onClose:()=>F(null),onPlay:e=>At(P,e),onToggleMyList:()=>X(P),onToggleLike:()=>Dt(P),onToggleTracking:()=>Ot(P),onEpisodeSortChange:e=>Z(P,e)}),I&&D(Ze,{title:I,profileId:T.id,subtitlePreferences:ue.subtitlePreferences,episodeSort:Ge[I.id]??`asc`,onProgressChange:Mt,onSubtitlePreferencesChange:e=>fe(t=>({...t,subtitlePreferences:e})),onSwitchTitle:jt,onEpisodeSortChange:e=>Z(I,e),onClose:at},I.id),ae&&D(b,{profiles:le,activeProfile:T,onClose:()=>S(!1),onProfilesChanged:Et}),re&&D(Ve,{profileId:T.id,onClose:()=>ie(!1),onImported:async()=>{ie(!1),me(`Title and episode metadata added to your library.`),await St(T.id)}})]})}function Ie({isScrolled:e,mobileMenuOpen:t,setMobileMenuOpen:n,searchOpen:r,setSearchOpen:i,searchQuery:a,setSearchQuery:o,searchInputRef:s,profileOpen:c,setProfileOpen:l,notificationsOpen:u,setNotificationsOpen:d,newEpisodeAlerts:f,unseenNotificationCount:p,onNotificationsOpened:m,onPlayNewEpisode:ee,sourcesOpen:h,setSourcesOpen:g,downloadsOpen:ne,setDownloadsOpen:y,downloads:b,onPlay:re,providers:x,syncMessage:ie,onReorderProviders:S,onSync:oe,onAddMovie:ce,profiles:le,activeProfile:w,onSelectProfile:T,onManageProfiles:ue}){let[de,k]=N(!1);return O(`header`,{className:`top-nav${e?` top-nav--solid`:``}${r?` top-nav--search`:``}`,children:[O(`div`,{className:`nav-start`,children:[D(`button`,{className:`icon-button mobile-menu-button`,"aria-label":t?`Close navigation`:`Open navigation`,onClick:()=>{k(!1),n(!t)},children:D(t?v:be,{})}),D(`a`,{className:`netflix-wordmark`,href:`/netflix`,"aria-label":`Netflix home`,children:`NETFLIX`}),D(`nav`,{className:`primary-nav${t?` primary-nav--open`:``}`,"aria-label":`Primary navigation`,children:I.map((e,t)=>D(`a`,{className:t===0?`active`:``,href:e.href,onClick:()=>n(!1),children:e.label},e.label))})]}),O(`div`,{className:`nav-end`,children:[D(ae,{id:`netflix-access-popover`,wrapClassName:`nav-popover-wrap`,buttonClassName:`icon-button access-button`,popoverClassName:`netflix-access-popover`,open:de,onOpenChange:e=>{k(e),g(!1),y(!1),l(!1),d(!1),i(!1)}}),O(`div`,{className:`nav-popover-wrap`,children:[D(`button`,{className:`icon-button source-button`,"aria-label":`Movie sources`,"aria-expanded":h,onClick:()=>{k(!1),g(!h),y(!1),l(!1),d(!1),i(!1)},children:D(se,{})}),h&&D(Le,{providers:x,message:ie,onReorder:S,onSync:oe,onAddMovie:ce})]}),O(`div`,{className:`nav-popover-wrap`,children:[O(`button`,{className:`icon-button download-button`,"aria-label":`Downloads`,"aria-expanded":ne,onClick:()=>{k(!1),y(!ne),g(!1),l(!1),d(!1),i(!1)},children:[D(E,{}),b.some(e=>e.downloadStatus===`queued`||e.downloadStatus===`downloading`)&&D(`span`,{className:`download-badge`,"aria-hidden":`true`,children:b.filter(e=>e.downloadStatus===`queued`||e.downloadStatus===`downloading`).length})]}),ne&&D(Re,{titles:b,onPlay:re})]}),O(`div`,{className:`search-box${r?` search-box--open`:``}`,children:[D(`button`,{className:`icon-button search-trigger`,"aria-label":r?`Focus search`:`Search`,onClick:()=>{k(!1),g(!1),y(!1),l(!1),d(!1),r?s.current?.focus():i(!0)},children:D(te,{})}),D(`input`,{ref:s,tabIndex:r?0:-1,"aria-label":`Search for titles, people, and genres`,placeholder:`Titles, people, genres`,value:a,onChange:e=>o(e.target.value)}),r&&D(`button`,{className:`search-clear`,"aria-label":a?`Clear search`:`Close search`,onClick:()=>{a?o(``):i(!1)},children:D(v,{})})]}),O(`div`,{className:`nav-popover-wrap`,children:[O(`button`,{className:`icon-button notification-button`,"aria-label":p?`Notifications, ${p} unread`:`Notifications`,"aria-expanded":u,onClick:()=>{k(!1),g(!1),y(!1);let e=!u;d(e),e&&p&&m(),l(!1)},children:[D(C,{}),p>0&&D(`span`,{className:`notification-badge`,"aria-hidden":`true`,children:p>9?`9+`:p})]}),u&&D(ze,{alerts:f,onSelectAlert:e=>{d(!1),ee(e)}})]}),O(`div`,{className:`nav-popover-wrap`,children:[O(`button`,{className:`profile-trigger`,"aria-label":`Open profile menu`,"aria-expanded":c,onClick:()=>{k(!1),g(!1),y(!1),l(!c),d(!1)},children:[O(`span`,{className:`profile-avatar`,"aria-hidden":`true`,style:{backgroundColor:w.avatarColor},children:[D(`span`,{}),D(`span`,{}),D(`span`,{})]}),D(_,{className:c?`rotate`:``})]}),c&&D(Be,{profiles:le,activeProfile:w,onSelectProfile:T,onManageProfiles:ue})]})]})]})}function Le({providers:e,message:t,onReorder:n,onSync:r,onAddMovie:i}){let[a,o]=N(null),[s,c]=N(null),[l,u]=N(``),d=M(0),f=M(null),p=M(null),m=M(null),ee=M([]),g=new Map(e.map(e=>[e.id,e])),te=a??e.map(e=>e.id),ne=new Set(te),_=[...te.flatMap(e=>{let t=g.get(e);return t?[t]:[]}),...e.filter(({id:e})=>!ne.has(e))],v=M(_),y=M(null),b=M(new Map),re=e=>{v.current=e,o(e.map(e=>e.id))},ae=(e,t)=>{let n=v.current,r=n.findIndex(t=>t.id===e);if(r<0)return n;let i=Math.max(0,Math.min(n.length-1,t));if(i===r)return n;let a=[...n],[o]=a.splice(r,1);return a.splice(i,0,o),re(a),a},S=(e,t)=>{let r=e.findIndex(e=>e.id===t.id);u(`${t.name} is now priority ${r+1} of ${e.length}.`);let i=++d.current;n(e.map(e=>e.id)).catch(()=>void 0).finally(()=>{i===d.current&&o(null)})},oe=(e,t)=>{let n=v.current.filter(t=>t.id!==e),r=n.findIndex(e=>{let n=b.current.get(e.id)?.getBoundingClientRect();return!!(n&&t<n.top+n.height/2)});r<0&&(r=n.length);let i=v.current.find(t=>t.id===e);if(!i)return;let a=[...n];a.splice(r,0,i),re(a)};return O(`div`,{className:`nav-popover sources-popover`,children:[D(`div`,{className:`popover-caret`}),O(`div`,{className:`sources-heading`,children:[D(`span`,{children:D(se,{})}),O(`div`,{children:[D(`b`,{children:`Content sources`}),D(`small`,{children:`Drag, or use the grip with your keyboard`})]})]}),D(`p`,{id:`source-priority-instructions`,className:`visually-hidden`,children:`Press Space or Enter to lift a source, use Arrow Up, Arrow Down, Home, or End to move it, then press Space or Enter again to save. Press Escape to cancel.`}),D(`p`,{className:`visually-hidden`,role:`status`,"aria-live":`polite`,children:l}),D(`div`,{className:`provider-list`,ref:y,role:`list`,"aria-label":`Source priority`,onPointerMove:e=>{let t=f.current;!t||p.current!==e.pointerId||!e.currentTarget.hasPointerCapture(e.pointerId)||oe(t,e.clientY)},onPointerUp:t=>{let n=f.current;if(!n||p.current!==t.pointerId)return;let r=v.current.find(e=>e.id===n),i=v.current;f.current=null,p.current=null,c(null),t.currentTarget.hasPointerCapture(t.pointerId)&&t.currentTarget.releasePointerCapture(t.pointerId),r&&i.some((t,n)=>t.id!==e[n]?.id)?S(i,r):o(null)},onPointerCancel:t=>{p.current===t.pointerId&&(f.current=null,p.current=null,c(null),v.current=e,o(null),t.currentTarget.hasPointerCapture(t.pointerId)&&t.currentTarget.releasePointerCapture(t.pointerId))},onLostPointerCapture:t=>{p.current===t.pointerId&&(f.current=null,p.current=null,c(null),v.current=e,o(null))},children:_.map((t,n)=>O(`article`,{className:s===t.id?`provider-row provider-row--dragging`:`provider-row`,ref:e=>{e?b.current.set(t.id,e):b.current.delete(t.id)},role:`listitem`,children:[D(`button`,{className:`provider-drag-handle`,type:`button`,"aria-describedby":`source-priority-instructions`,"aria-keyshortcuts":`Space Enter ArrowUp ArrowDown Home End Escape`,"aria-label":`${s===t.id?`Drop`:`Move`} ${t.name}, priority ${n+1} of ${_.length}`,"aria-pressed":s===t.id,title:`Drag ${t.name}, or press Space and use arrow keys`,onKeyDown:r=>{let i=r.key===` `||r.key===`Enter`,a=m.current===t.id;if(i){if(r.preventDefault(),v.current=_,a){m.current=null,c(null);let e=v.current,r=ee.current;e.some((e,t)=>e.id!==r[t])?S(e,t):(o(null),u(`${t.name} stayed at priority ${n+1}.`))}else m.current=t.id,ee.current=_.map(e=>e.id),o(ee.current),c(t.id),u(`${t.name} lifted. Use arrow keys to move it, then press Space or Enter to save.`);return}if(r.key===`Escape`&&a){r.preventDefault(),m.current=null,v.current=e,c(null),o(null),u(`${t.name} priority change canceled.`);return}let s=r.key===`ArrowUp`?n-1:r.key===`ArrowDown`?n+1:r.key===`Home`?0:r.key===`End`?_.length-1:null;if(s===null)return;r.preventDefault(),v.current=_;let l=v.current,d=ae(t.id,s);if(d!==l)if(a){let e=d.findIndex(e=>e.id===t.id);u(`${t.name} moved to priority ${e+1} of ${d.length}.`)}else S(d,t)},onPointerDown:e=>{if(e.button!==0)return;e.preventDefault();let n=y.current;n&&(n.setPointerCapture(e.pointerId),v.current=_,m.current=null,f.current=t.id,p.current=e.pointerId,c(t.id))},children:D(_e,{"aria-hidden":`true`})}),D(`span`,{className:`provider-mark`,children:t.name.slice(0,1).toUpperCase()}),O(`span`,{className:`provider-copy`,children:[D(`b`,{children:t.name}),D(`a`,{href:t.baseUrl,target:`_blank`,rel:`noreferrer`,children:new URL(t.baseUrl).hostname}),O(`small`,{children:[`Priority `,n+1,` ·`,` `,t.lastError||(t.lastSyncedAt?`Synced ${new Date(t.lastSyncedAt).toLocaleString()}`:`Not synced yet`)]})]}),D(`button`,{className:`provider-sync`,"aria-label":`Sync ${t.name}`,title:`Sync ${t.name}`,disabled:t.syncStatus===`syncing`,onClick:()=>void r(t.id),children:t.syncStatus===`syncing`?D(h,{className:`spin`}):D(ie,{})})]},t.id))}),t&&D(`p`,{className:`source-message`,role:`status`,children:t}),O(`button`,{className:`add-movie-button`,onClick:i,children:[D(x,{}),` Add movie from link`]})]})}function Re({titles:e,onPlay:t}){let n=e.filter(e=>e.sourceProvider&&e.downloadStatus&&e.downloadStatus!==`metadata`).sort((e,t)=>{let n=new Set([`queued`,`downloading`]);return Number(n.has(t.downloadStatus??``))-Number(n.has(e.downloadStatus??``))}),r=n.filter(e=>e.downloadStatus===`queued`||e.downloadStatus===`downloading`).length;return O(`div`,{className:`nav-popover downloads-popover`,children:[D(`div`,{className:`popover-caret`}),O(`div`,{className:`downloads-heading`,children:[D(`span`,{children:D(E,{})}),O(`div`,{children:[D(`b`,{children:`Downloads`}),D(`small`,{children:r>0?`${r} ${r===1?`movie`:`movies`} downloading`:n.length>0?`All downloads are up to date`:`No movies added yet`})]})]}),n.length>0?D(`div`,{className:`download-list`,"aria-live":`polite`,children:n.map(e=>{let n=Math.min(100,Math.max(0,e.downloadProgress??0)),r=e.downloadStatus===`queued`||e.downloadStatus===`downloading`,i=e.downloadStatus===`ready`?`Ready to play`:e.downloadStatus===`failed`?`Download failed`:e.downloadStatus===`queued`?`Waiting to download`:`Downloading — ${n}%`;return O(`article`,{className:`download-item download-item--${e.downloadStatus}`,children:[D(`button`,{type:`button`,className:`download-thumb`,"aria-label":`Play ${e.title}`,onClick:()=>t(e),style:{backgroundImage:`linear-gradient(90deg, transparent, rgba(0, 0, 0, 0.2)), url("${e.backdropImage}")`},children:D(`span`,{className:`download-thumb-play`,"aria-hidden":`true`,children:D(g,{fill:`currentColor`})})}),O(`div`,{className:`download-copy`,children:[O(`div`,{children:[D(`b`,{children:e.title}),D(`span`,{className:`download-status-icon`,"aria-hidden":`true`,children:e.downloadStatus===`ready`?D(S,{}):e.downloadStatus===`failed`?D(v,{}):D(h,{className:r?`spin`:``})})]}),D(`small`,{children:i}),D(`div`,{className:`download-progress`,role:`progressbar`,"aria-label":`${e.title} download progress`,"aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":n,children:D(`span`,{style:{width:`${n}%`}})}),e.downloadError&&D(`em`,{title:e.downloadError,children:e.downloadError})]})]},e.id)})}):O(`div`,{className:`downloads-empty`,children:[D(E,{}),D(`b`,{children:`Your downloads will appear here`}),D(`small`,{children:`Add a movie from the Sources menu to get started.`})]})]})}function ze({alerts:e,onSelectAlert:t}){return e.length?O(`div`,{className:`nav-popover notification-popover`,children:[D(`div`,{className:`popover-caret`}),e.map(e=>O(`button`,{type:`button`,className:`notification-item${e.seen?``:` is-unread`}`,onClick:()=>t(e),children:[D(`span`,{className:`notification-thumb`,style:e.artwork?{backgroundImage:`linear-gradient(140deg, transparent, rgba(0,0,0,.72)), url("${e.artwork}")`}:void 0}),O(`span`,{children:[O(`b`,{children:[`New episode: `,e.titleName]}),O(`small`,{children:[`S`,e.seasonNumber,` · E`,e.episodeNumber,e.episodeTitle?` — ${e.episodeTitle}`:``]}),D(`em`,{children:L(e.discoveredAt)})]})]},`${e.titleId}-${e.seasonNumber}-${e.episodeNumber}`))]}):O(`div`,{className:`nav-popover notification-popover`,children:[D(`div`,{className:`popover-caret`}),D(`p`,{className:`notification-empty`,children:`No new episodes yet. Tracked shows are checked every hour.`})]})}function Be({profiles:e,activeProfile:t,onSelectProfile:n,onManageProfiles:r}){return O(`div`,{className:`nav-popover profile-popover`,children:[D(`div`,{className:`popover-caret`}),e.map(e=>O(`button`,{type:`button`,className:`profile-option`,"aria-current":e.id===t.id?`true`:void 0,onClick:()=>void n(e),children:[D(`span`,{className:`mini-avatar`,style:{backgroundColor:e.avatarColor},children:e.name.slice(0,1).toUpperCase()}),D(`span`,{children:e.name}),e.id===t.id&&D(S,{className:`profile-active-check`,"aria-label":`Active profile`})]},e.id)),O(`button`,{type:`button`,onClick:r,children:[D(ee,{}),`Manage profile`]}),O(`a`,{href:`#account`,children:[D(Se,{}),`Account`]}),O(`a`,{href:`#help`,children:[D(f,{}),`Help Center`]}),O(`a`,{className:`profile-signout`,href:`#signout`,children:[D(ye,{}),`Sign out of Netflix`]})]})}function Ve({profileId:e,onClose:t,onImported:n}){let r=Pe(),[i,a]=N(``),[o,s]=N(!1),[c,l]=N(!1),[u,d]=N(``);return D(`div`,{className:`modal-backdrop add-movie-backdrop`,onMouseDown:t,children:O(`article`,{ref:r,className:`add-movie-modal`,role:`dialog`,"aria-modal":`true`,"aria-labelledby":`add-movie-title`,onMouseDown:e=>e.stopPropagation(),children:[D(`button`,{className:`modal-close`,"aria-label":`Close`,onClick:t,children:D(v,{})}),D(`span`,{className:`add-movie-icon`,children:D(w,{})}),D(`h2`,{id:`add-movie-title`,children:`Add a movie`}),D(`p`,{children:`Paste a supported movie page. Metadata is stored in SQLite and the video can stream directly from its provider.`}),O(`form`,{onSubmit:async t=>{t.preventDefault(),l(!0),d(``);try{let t=await fetch(`/api/netflix/movies/import`,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify({url:i,mode:o?`download`:`stream`,profileId:e})}),r=await t.json();if(!t.ok)throw Error(r.error||`Movie import failed.`);await n()}catch(e){d(e instanceof Error?e.message:`Movie import failed.`),l(!1)}},children:[D(`label`,{htmlFor:`movie-url`,children:`Movie link`}),D(`input`,{id:`movie-url`,type:`url`,required:!0,autoFocus:!0,placeholder:`https://phimhdcss.com/linh-hao-truy-sat-22642`,value:i,onChange:e=>a(e.target.value)}),D(`small`,{children:`Supported: phimhdcss.com, phimhdcss.net, and fsharetv.com`}),O(`label`,{className:`offline-option`,children:[D(`input`,{type:`checkbox`,checked:o,onChange:e=>s(e.currentTarget.checked)}),O(`span`,{children:[D(`b`,{children:`Save an offline copy`}),D(`small`,{children:`Optional. Downloads the media and subtitles into the local data folder.`})]})]}),u&&D(`p`,{className:`form-error`,role:`alert`,children:u}),O(`div`,{className:`add-movie-actions`,children:[D(`button`,{type:`button`,className:`button button--secondary`,onClick:t,children:`Cancel`}),O(`button`,{type:`submit`,className:`button button--primary`,disabled:c,children:[c?D(h,{className:`spin`}):o?D(E,{}):D(g,{fill:`currentColor`}),c?`Fetching movie…`:o?`Add & download`:`Add & stream`]})]})]})]})})}function R({title:e,previewPaused:t,setPreviewPaused:n,onPlay:r,onMoreInfo:i}){let a={"--hero-image":`url("${e.backdropImage}")`,"--hero-accent":e.accentColor};return O(`section`,{className:`hero${t?` hero--paused`:``}`,id:`top`,style:a,children:[D(`div`,{className:`hero-backdrop`}),D(`div`,{className:`hero-vignette`}),O(`div`,{className:`hero-content`,children:[O(`p`,{className:`netflix-series`,children:[D(`span`,{children:`N`}),` SERIES`]}),e.logoImage?O(de,{children:[D(`h1`,{className:`visually-hidden`,children:e.title}),D(`img`,{className:`hero-title-logo`,src:e.logoImage,alt:``,"aria-hidden":`true`})]}):D(`h1`,{children:e.title}),O(`p`,{className:`hero-rank`,children:[O(`span`,{children:[`TOP`,D(`br`,{}),`10`]}),`#`,e.rank??1,` in TV Shows Today`]}),D(`p`,{className:`hero-description`,children:e.synopsis}),O(`div`,{className:`hero-actions`,children:[O(`button`,{className:`button button--primary`,onClick:r,children:[D(g,{fill:`currentColor`}),` Play`]}),O(`button`,{className:`button button--secondary`,onClick:i,children:[D(ve,{}),` More Info`]})]})]}),O(`div`,{className:`hero-side-controls`,children:[D(`button`,{className:`round-button`,"aria-label":t?`Resume preview motion`:`Pause preview motion`,onClick:()=>n(!t),children:D(t?g:m,{fill:`currentColor`})}),D(`span`,{className:`maturity-badge`,children:e.maturityRating})]}),D(`div`,{className:`hero-scroll-cue`,children:D(_,{})})]})}function z({row:e,rowIndex:n,myList:r,likedTitles:i,newEpisodeAlertsByTitle:a,playOnCardClick:o=!1,onSelect:s,onPlay:c,onToggleMyList:l,onToggleLike:u}){let d=M(null),f=e=>{let t=window.matchMedia(`(prefers-reduced-motion: reduce)`).matches?`auto`:`smooth`;d.current?.scrollBy({left:e*d.current.clientWidth*.82,behavior:t})};return O(`section`,{className:`title-row title-row--${e.kind}`,id:n===0?`new-popular`:e.id,"aria-labelledby":`${e.id}-heading`,children:[O(`div`,{className:`row-heading`,children:[D(`h2`,{id:`${e.id}-heading`,children:e.title}),O(`button`,{className:`explore-link`,onClick:()=>d.current?.scrollTo({left:d.current.scrollWidth,behavior:window.matchMedia(`(prefers-reduced-motion: reduce)`).matches?`auto`:`smooth`}),children:[`Explore All `,D(p,{})]})]}),O(`div`,{className:`rail-shell`,children:[D(`button`,{className:`rail-control rail-control--left`,"aria-label":`Scroll ${e.title} left`,onClick:()=>f(-1),children:D(t,{})}),D(`div`,{className:`title-rail`,ref:d,children:e.items.map((t,n)=>D(B,{title:t,index:n,kind:e.kind,isInMyList:r.has(t.id),isLiked:i.has(t.id),newEpisodeAlert:a?.get(t.id),playOnCardClick:o,onSelect:()=>s(t),onPlay:()=>c(t),onPlayEpisode:e=>c(t,e),onToggleMyList:()=>l(t),onToggleLike:()=>u(t)},`${e.id}-${t.id}`))}),D(`button`,{className:`rail-control rail-control--right`,"aria-label":`Scroll ${e.title} right`,onClick:()=>f(1),children:D(p,{})})]})]})}function B({title:e,index:t,kind:n,isInMyList:r,isLiked:i,newEpisodeAlert:a,playOnCardClick:o,onSelect:s,onPlay:c,onPlayEpisode:l,onToggleMyList:u,onToggleLike:d}){let f=n===`ranked`,p=n===`originals`,m=n===`continue-watching`,ee=p||f?e.posterImage:e.backdropImage,h=Math.min(100,Math.max(0,e.progress??0)),te=m||o?c:s,ne=a&&o?`Play ${e.title}, Season ${a.seasonNumber} Episode ${a.episodeNumber}`:m?`Resume ${e.title}`:`Open details for ${e.title}${a?`, new episode Season ${a.seasonNumber} Episode ${a.episodeNumber}`:``}`;return O(`div`,{className:`title-card${f?` title-card--ranked`:``}${p?` title-card--portrait`:``}`,tabIndex:0,role:`button`,"aria-label":ne,onClick:te,onKeyDown:e=>{e.target===e.currentTarget&&(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),te())},children:[f&&D(`span`,{className:`rank-number`,"aria-hidden":`true`,children:e.rank??t+1}),O(`div`,{className:`card-visual`,children:[D(`img`,{src:ee,alt:``,loading:`lazy`}),D(`div`,{className:`card-image-shade`}),e.isOriginal&&O(`span`,{className:`card-n`,children:[`N`,D(`small`,{children:e.mediaType===`movie`?`FILM`:`SERIES`})]}),e.isNew&&!a&&D(`span`,{className:`new-season`,children:`New`}),a&&O(`span`,{className:`new-episode-label`,"aria-label":`New episode: Season ${a.seasonNumber}, Episode ${a.episodeNumber}${a.episodeTitle?`, ${a.episodeTitle}`:``}`,children:[O(`strong`,{children:[`S`,a.seasonNumber,` · E`,a.episodeNumber]}),a.episodeTitle&&O(`small`,{children:[`— `,a.episodeTitle]})]}),D(`span`,{className:`card-title-fallback`,children:e.title})]}),n===`continue-watching`&&O(de,{children:[D(`span`,{className:`resume-checkpoint`,children:e.resumeEpisode?`E${e.resumeEpisode} · ${H(e.resumePositionSeconds??0)}`:H(e.resumePositionSeconds??0)}),D(`div`,{className:`progress-track`,role:`progressbar`,"aria-label":`${e.title} watch progress`,"aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":h,children:D(`span`,{style:{width:`${h}%`}})})]}),O(`div`,{className:`card-details`,onClick:e=>e.stopPropagation(),children:[O(`div`,{className:`card-controls`,children:[D(`button`,{"aria-label":`Play ${e.title}`,onClick:c,children:D(g,{fill:`currentColor`})}),D(`button`,{"aria-label":r?`Remove from My List`:`Add to My List`,onClick:u,children:D(r?S:x,{})}),D(`button`,{className:i?`is-active`:``,"aria-label":i?`Remove rating`:`I like this`,"aria-pressed":i,onClick:d,children:D(Ce,{fill:i?`currentColor`:`none`})}),D(`button`,{className:`card-more-button`,"aria-label":`More information about ${e.title}`,onClick:s,children:D(_,{})})]}),O(`div`,{className:`card-meta`,children:[O(`strong`,{children:[e.match,`% Match`]}),D(`span`,{className:`mini-maturity`,children:e.maturityRating}),D(`span`,{children:e.duration}),e.isHD&&D(`span`,{className:`quality-badge`,children:`HD`})]}),D(`p`,{children:e.genres.slice(0,3).join(` • `)}),e.episodes?.length?D(`div`,{className:`card-episode-strip`,"aria-label":`${e.title} episodes`,children:e.episodes.map(t=>O(`button`,{type:`button`,"aria-label":`Play ${t.title}`,title:t.title,onClick:()=>l(t.episode),children:[D(`img`,{src:t.image||e.backdropImage,alt:``,loading:`lazy`}),D(`span`,{children:t.episode})]},t.id||t.episode))}):null]})]})}function He({query:e,results:t,providerStatus:n,error:r,resolvingTitleId:i,onSelect:o}){let s=!!e.trim(),c=n===`loading`,l=t.find(e=>e.id===i);return O(`section`,{className:`netflix-search-page`,"aria-label":s?`Search results for ${e}`:`Search titles`,children:[D(`p`,{className:`visually-hidden`,role:`status`,"aria-live":`polite`,children:s?l?`Loading “${l.title}” from its provider…`:c?`Searching your library and all providers for “${e}”…`:t.length?`${t.length} titles related to “${e}”`:`We couldn't find “${e}”`:`Enter a movie, series, person, or genre to search.`}),r&&D(`p`,{className:`netflix-search-notice`,role:`alert`,children:r}),s?t.length?D(`div`,{className:`netflix-search-grid`,children:t.map(e=>O(`button`,{className:`netflix-search-card`,"aria-label":`${e.title} · ${a(e.sourceProvider)}`,disabled:!!i,onClick:()=>o(e),children:[O(`span`,{className:`netflix-search-artwork`,children:[D(`img`,{src:e.backdropImage,alt:``}),i===e.id&&D(h,{className:`netflix-search-loader spin`})]}),D(`span`,{className:`netflix-search-title`,title:e.title,children:e.title})]},`${e.sourceProvider??`catalog`}:${e.id}`))}):c?O(`div`,{className:`empty-search`,children:[D(h,{className:`spin`}),D(`h2`,{children:`Searching all providers`}),D(`p`,{children:`Results follow the source priority in the sources menu.`})]}):O(`div`,{className:`empty-search`,children:[D(te,{}),D(`h2`,{children:`No matches found`}),D(`p`,{children:`Try a title, actor, director, or genre.`})]}):O(`div`,{className:`empty-search`,children:[D(te,{}),D(`h2`,{children:`Find something to watch`}),D(`p`,{children:`Search by movie, series, actor, director, or genre.`})]})]})}function Ue({title:e,isInMyList:t,isLiked:n,canTrack:r,isTracked:i,episodeSort:o,onClose:s,onPlay:c,onToggleMyList:l,onToggleLike:u,onToggleTracking:d,onEpisodeSortChange:f}){let p=Pe(),m=j(()=>{let t=[...e.episodes?.length?e.episodes:e.episode?[e.episode]:[]].sort((e,t)=>e.season-t.season||e.episode-t.episode);return o===`desc`?t.reverse():t},[o,e.episode,e.episodes]);return D(`div`,{className:`modal-backdrop`,role:`presentation`,onMouseDown:s,children:O(`article`,{ref:p,className:`details-modal`,role:`dialog`,"aria-modal":`true`,"aria-label":`${e.title} details`,onMouseDown:e=>e.stopPropagation(),children:[D(`button`,{className:`modal-close`,"aria-label":`Close`,onClick:s,children:D(v,{})}),D(`div`,{className:`modal-hero`,style:{"--modal-image":`url("${e.backdropImage}")`},children:O(`div`,{className:`modal-hero-content`,children:[O(`p`,{className:`netflix-series`,children:[D(`span`,{children:`N`}),` `,e.mediaType===`movie`?`FILM`:`SERIES`]}),D(`h2`,{children:e.title}),O(`div`,{className:`modal-actions`,children:[O(`button`,{className:`button button--primary`,onClick:()=>c(),disabled:!!(e.sourceProvider&&!e.playbackPath&&!e.canStream),children:[D(g,{fill:`currentColor`}),e.sourceProvider&&!e.playbackPath&&!e.canStream?`Metadata only`:e.sourceProvider&&e.downloadStatus!==`ready`?`Stream now`:e.resumePositionSeconds?`Resume at ${H(e.resumePositionSeconds)}`:`Play`]}),D(`button`,{className:`round-button`,"aria-label":t?`Remove from My List`:`Add to My List`,onClick:l,children:D(t?S:x,{})}),D(`button`,{className:`round-button${n?` is-active`:``}`,"aria-label":n?`Remove rating`:`I like this`,"aria-pressed":n,onClick:u,children:D(Ce,{fill:n?`currentColor`:`none`})}),r&&D(`button`,{className:`round-button track-button${i?` is-active`:``}`,"aria-label":i?`Stop tracking new episodes`:`Track new episodes`,"aria-pressed":i,title:i?`Tracking new episodes every hour`:`Track new episodes`,onClick:d,children:D(i?me:C,{})})]})]})}),O(`div`,{className:`modal-body`,children:[O(`div`,{className:`modal-main-copy`,children:[e.sourceProvider&&O(`div`,{className:`download-state download-state--${e.downloadStatus}`,children:[e.downloadStatus===`ready`?D(S,{}):e.downloadStatus===`metadata`?D(w,{}):D(E,{}),O(`span`,{children:[D(`b`,{children:e.downloadStatus===`ready`?`Ready to play locally`:e.downloadStatus===`failed`?`Offline download failed · Streaming available`:e.downloadStatus===`metadata`?e.canStream?`Ready to stream`:`Metadata synced`:`Streaming available · Downloading offline — ${e.downloadProgress??0}%`}),D(`small`,{children:e.downloadError||`Source: ${a(e.sourceProvider)} · Metadata stored in SQLite`})]})]}),O(`div`,{className:`modal-meta`,children:[O(`strong`,{children:[e.match,`% Match`]}),D(`span`,{children:e.year}),D(`span`,{children:e.duration}),D(`span`,{className:`quality-badge`,children:`HD`}),e.hasAudioDescription&&D(`span`,{className:`quality-badge`,children:`AD`})]}),D(`span`,{className:`modal-maturity`,children:e.maturityRating}),D(`p`,{className:`modal-synopsis`,children:e.synopsis})]}),O(`dl`,{className:`modal-facts`,children:[O(`div`,{children:[D(`dt`,{children:`Cast:`}),D(`dd`,{children:e.cast.slice(0,4).join(`, `)})]}),O(`div`,{children:[D(`dt`,{children:`Genres:`}),D(`dd`,{children:e.genres.join(`, `)})]}),e.creators?.length?O(`div`,{children:[D(`dt`,{children:`Creators:`}),D(`dd`,{children:e.creators.join(`, `)})]}):null]})]}),m.length>0&&O(`div`,{className:`episode-panel`,children:[O(`header`,{className:`episode-panel-header`,children:[D(`h3`,{children:`Episodes`}),O(`div`,{className:`episode-panel-tools`,children:[O(`span`,{children:[`Season `,Math.min(...m.map(e=>e.season)),` `,`· `,m.length,` episodes`]}),O(`button`,{className:`episode-sort-button`,type:`button`,"aria-label":o===`asc`?`Sort episodes newest first`:`Sort episodes oldest first`,title:o===`asc`?`Sorted oldest first`:`Sorted newest first`,onClick:()=>f(o===`asc`?`desc`:`asc`),children:[D(o===`asc`?fe:pe,{}),D(`span`,{children:o===`asc`?`Oldest`:`Newest`})]})]})]}),D(`div`,{className:`episode-card-list`,children:m.map(t=>O(`button`,{className:`episode-card`,"aria-label":`Play ${t.title}`,onClick:()=>c(t.episode),children:[D(`span`,{className:`episode-number`,children:t.episode}),D(`span`,{className:`episode-image`,style:{backgroundImage:`linear-gradient(90deg, transparent, rgba(0,0,0,.25)), url("${t.image||e.backdropImage}")`},children:D(g,{fill:`currentColor`})}),O(`span`,{className:`episode-copy`,children:[D(`b`,{children:t.title}),D(`small`,{children:t.duration}),D(`em`,{children:t.synopsis||e.tagline||e.synopsis})]})]},t.id||t.episode))})]})]})})}var We=4140,Ge=`home-atom:subtitle-preferences`,Ke={x:50,y:78},qe={label:`English`,language:`en`,src:`demo`};function Je(e){return{x:Math.max(7,Math.min(93,e.x)),y:Math.max(10,Math.min(86,e.y))}}function Ye(e,t,n){let r=Math.min(49,Math.max(7,(n.width/2+12)/t.width*100)),i=Math.min(49,Math.max(10,(n.height/2+12)/t.height*100));return{x:Math.max(r,Math.min(100-r,e.x)),y:Math.max(i,Math.min(86,100-i,e.y))}}function V(e){return Array.from(e.activeCues??[]).flatMap(e=>(`text`in e&&typeof e.text==`string`?e.text:``).replace(/<br\s*\/?>/gi,`
2
+ `).replace(/<[^>]*>/g,``).split(/\r?\n/).map(e=>e.trim()).filter(Boolean))}function H(e){let t=Math.max(0,Math.floor(e)),n=Math.floor(t/3600),r=Math.floor(t%3600/60),i=t%60;return n?`${n}:${String(r).padStart(2,`0`)}:${String(i).padStart(2,`0`)}`:`${r}:${String(i).padStart(2,`0`)}`}function Xe(e){let t=e?.match(/(\d+)\s*h/i)?.[1],n=e?.match(/(\d+)\s*(?:m|ph(?:út)?)/i)?.[1];return!t&&!n?We:(Number(t??0)*60+Number(n??0))*60}function Ze({title:e,profileId:t,subtitlePreferences:a,episodeSort:l,onProgressChange:f,onSubtitlePreferencesChange:p,onSwitchTitle:ee,onEpisodeSortChange:te,onClose:_}){let b=Pe(),x=M(null),ie=M(null),se=M(0),C=M(null),w=M(null),E=M(null),me=M(null),_e=M(null),ve=M(null),ye=M(null),be=M(!1),Ce=M(null),we=M(!0),Te=M(null),Ee=M(!1),De=M(new Set),Oe=M(0),P=M(()=>{}),[ke]=N(le),[I,Ae]=N(e.episodes??[]),[je,Me]=N(e.subtitles??[]),Ne=F(e.title),L=I[0]?.episode,Fe=e.episode?.episode||L||1,Ie=I.find(e=>e.episode===Fe)||e.episode,Le=!!(e.playbackPath&&(!L||Fe===L)),Re=!!(e.sourceProvider&&e.canStream&&!Le),ze=e.resumeEpisode===void 0||e.resumeEpisode===Fe?Math.max(0,e.resumePositionSeconds??0):0,Be=e.resumeDurationSeconds&&e.resumeDurationSeconds>0?e.resumeDurationSeconds:Xe(Ie?.duration),Ve=Be>0?ze/Be*100:0,[R,z]=N(!1),B=M(!1),[He,Ue]=N(!1),[We,Ze]=N(1),Qe=M(1),[U,$e]=N(a.captionsOn),[et,tt]=N(!1),[nt,rt]=N(0),[it,at]=N([]),[W,ot]=N(a.fontSize),[st,ct]=N({x:a.positionX,y:a.positionY}),[G,lt]=N(a.fontColor),[ut,dt]=N(a.backgroundColor),[ft,pt]=N(a.fontFamily),mt=M({fontSize:a.fontSize,positionX:a.positionX,positionY:a.positionY,fontColor:a.fontColor,backgroundColor:a.backgroundColor,fontFamily:a.fontFamily,captionsOn:a.captionsOn}),[ht,gt]=N(!0),[_t,vt]=N(!1),[K,q]=N(!1),[yt,bt]=N([]),[xt,St]=N(null),[Ct,wt]=N(!1),[J,Tt]=N(null),[Y,Et]=N(Fe),[X,Dt]=N(Be),[Z,Ot]=N(ze),[kt,At]=N(Math.min(100,Ve+4)),[jt,Mt]=N(1),[Nt,Pt]=N(!1),[Ft,It]=N(``),[Lt,Rt]=N(Re?`Connecting to provider…`:``),[zt,Bt]=N(Re),[Q,Vt]=N(Le&&e.playbackPath?{path:e.playbackPath,kind:e.playbackKind===`hls`?`hls`:`file`}:null),Ht=M(Q),[Ut,Wt]=N(!1),[Gt,Kt]=N(null),[$,qt]=N(null),[Jt,Yt]=N(null),[Xt,Zt]=N(!1),[Qt,$t]=N(!1),[en,tn]=N(!1),[nn,rn]=N(!1),an=M(null),on=M(null);M(null);let sn=M(!1),cn=M(``),ln=!!(e.playbackPath||e.sourceProvider&&e.canStream),un=!ln||Q?.kind===`embed`,dn=Math.max(8,(e.episode?.episode??1)+2),fn=j(()=>I.length?I.map(t=>({season:t.season,number:t.episode,title:t.title,duration:t.duration,synopsis:t.synopsis||e.synopsis,image:t.image||e.backdropImage,subtitles:t.subtitles||[]})):Array.from({length:dn},(t,n)=>{let r=n+1,i=r===e.episode?.episode;return{season:e.episode?.season??1,number:r,title:i?e.episode.title:`Episode ${r}`,duration:i?e.episode.duration:`${46+r*7%15}m`,synopsis:r===Y?e.synopsis:e.tagline??e.synopsis,image:e.backdropImage,subtitles:[]}}),[Y,dn,I,e.backdropImage,e.episode,e.synopsis,e.tagline]),pn=j(()=>l===`desc`?[...fn].reverse():fn,[l,fn]),mn=X>0?Z/X*100:0,hn=fn.find(e=>e.number===Y)??fn[0],gn=fn.findIndex(e=>e.number===Y),_n=gn>=0&&gn<fn.length-1,vn=hn?.season??Ie?.season??1,yn=yt.find(e=>e.id===xt),bn=hn?.subtitles.length?hn.subtitles:je,xn=bn.length>0?bn:ln?[]:[qe],Sn=Math.min(nt,Math.max(0,xn.length-1)),Cn=xn.length>0,wn={"--player-progress":`${mn}%`,"--player-buffered":`${Math.max(mn,kt)}%`},Tn=j(()=>{let t=e.synopsis.split(/[.!?]/).map(e=>e.trim()).find(Boolean)??e.synopsis,n=t.length>42?`${t.slice(0,41).trimEnd()}…`:t;return[`– ${e.tagline??hn?.title??e.title}`,`– ${n}`]},[hn?.title,e.synopsis,e.tagline,e.title]),En=ln?it:Tn,Dn=M({seasonNumber:vn,episodeNumber:Y,positionSeconds:Z,durationSeconds:X});A(()=>{Dn.current={seasonNumber:vn,episodeNumber:Y,positionSeconds:Z,durationSeconds:X}},[Y,Z,X,vn]);let On=k((n={},r=!1)=>{let i={...Dn.current,...n};if(i.positionSeconds<1&&!i.completed)return;let a=[i.seasonNumber,i.episodeNumber,Math.round(i.positionSeconds*10),Math.round(i.durationSeconds*10),!!i.completed].join(`:`);if(cn.current===a)return;cn.current=a;let o=!!i.completed||i.durationSeconds>0&&i.positionSeconds/i.durationSeconds>=.95,s={titleId:e.id,seasonNumber:i.seasonNumber,episodeNumber:i.episodeNumber,positionSeconds:i.positionSeconds,durationSeconds:i.durationSeconds,completed:o,updatedAt:new Date().toISOString()};f(s),fetch(`/api/netflix/progress`,{method:`PUT`,headers:{"content-type":`application/json`},body:JSON.stringify({profileId:t,...s}),keepalive:r}).then(async e=>{if(!e.ok)throw Error();f(await e.json())}).catch(()=>{r||It(`Watch position could not be saved`)})},[f,t,e.id]);A(()=>{let e=window.setInterval(()=>On(),5e3),t=()=>{document.visibilityState===`hidden`&&On({},!0)},n=()=>On({},!0);return document.addEventListener(`visibilitychange`,t),window.addEventListener(`beforeunload`,n),()=>{window.clearInterval(e),document.removeEventListener(`visibilitychange`,t),window.removeEventListener(`beforeunload`,n),On({},!0)}},[On]),A(()=>{let n=new AbortController;return fetch(`/api/netflix/markers?titleId=${encodeURIComponent(e.id)}&profileId=${encodeURIComponent(t)}`,{cache:`no-store`,signal:n.signal}).then(async e=>{if(!e.ok)return;let t=await e.json();if(!n.signal.aborted)for(let e of t.markers??[])e.markerType===`intro`?qt(e.timeSeconds):e.markerType===`outro`&&Yt(e.timeSeconds)}).catch(()=>{}),()=>n.abort()},[e.id,t]),A(()=>($!==null&&Z>=0&&Z<=$&&!R?(en||tn(!0),on.current!==null&&window.clearTimeout(on.current),on.current=window.setTimeout(()=>{tn(!1),on.current=null},8e3)):en&&(Z>($??0)||R)&&tn(!1),Jt!==null&&Z>=Jt&&X>0&&!R&&_n?nn||rn(!0):nn&&(Z<(Jt??1/0)||R)&&rn(!1),()=>{on.current!==null&&window.clearTimeout(on.current)}),[Z,$,Jt,R,en,nn,X,_n]),A(()=>{if(!Xt)return;let e=e=>{e.target instanceof Node&&!an.current?.contains(e.target)&&Zt(!1)},t=e=>{e.key===`Escape`&&Zt(!1)};return document.addEventListener(`pointerdown`,e),document.addEventListener(`keydown`,t),()=>{document.removeEventListener(`pointerdown`,e),document.removeEventListener(`keydown`,t)}},[Xt]),A(()=>{let n=!!(e.playbackPath&&(!L||Y===L));if(!e.sourceProvider||!e.canStream||n)return;let r=new AbortController,i=new URLSearchParams({profileId:t});return e.episodes?.length&&i.set(`episode`,String(Y)),J?.id&&i.set(`server`,J.id),fetch(`/api/netflix/stream/${encodeURIComponent(e.id)}?${i}`,{cache:`no-store`,signal:r.signal}).then(async e=>{let t=await e.json();if(!e.ok||!t.path||!t.kind)throw Error(t.error||`The provider stream is unavailable.`);if(t.episodeMetadata){let e={...t.episodeMetadata,subtitles:t.subtitles??t.episodeMetadata.subtitles};Ae(t=>[...t.some(t=>t.id===e.id||t.episode===e.episode)?t.map(t=>t.id===e.id||t.episode===e.episode?e:t):[...t,e]].sort((e,t)=>e.episode-t.episode))}else Array.isArray(t.subtitles)&&Me(t.subtitles);let n=Array.isArray(t.servers)?t.servers.filter(e=>typeof e?.id==`string`&&e.id.length>0&&typeof e.label==`string`&&e.label.length>0):[],r=t.server??t.selectedServerId,i=n.find(e=>e.id===r)??n.find(e=>e.id===J?.id)??n.find(e=>e.is4K||/(?:^|\s)4k(?:\s|$)/i.test(e.label))??n[0];bt(n),St(i?.id??null),n.length||wt(!1),Vt({path:t.path,kind:t.kind}),Rt(``),Bt(!1)}).catch(e=>{r.signal.aborted||(Rt(e instanceof Error?e.message:`The provider stream is unavailable.`),Bt(!1),z(!0))}),()=>r.abort()},[Y,L,e.canStream,e.episodes,e.id,e.playbackPath,e.sourceProvider,t,J]),A(()=>{Ht.current=Q;let e=x.current;if(!e||!Q||Q.kind===`embed`)return;let t=!1,n=()=>{};return Q.kind===`hls`&&!e.canPlayType(`application/vnd.apple.mpegurl`)?import(`./hls-CgexCc5Z.js`).then(({default:e})=>{if(t||!x.current||!e.isSupported())return;let r=new e;r.loadSource(Q.path),r.attachMedia(x.current),r.on(e.Events.MANIFEST_PARSED,()=>{t||(B.current?x.current?.pause():x.current?.play().catch(()=>z(!0)))}),r.on(e.Events.ERROR,(e,n)=>{n.fatal&&!t&&(Rt(`The provider stream stopped unexpectedly.`),z(!0))}),n=()=>r.destroy()}):(e.src=Q.path,B.current?e.pause():e.play().catch(()=>z(!0))),()=>{t=!0,n(),e.removeAttribute(`src`),e.load()}},[Q]),A(()=>{B.current=R;let e=x.current;!e||!Ht.current||(R?e.pause():e.play().catch(()=>z(!0)))},[R]),A(()=>{let e=x.current;e&&(e.playbackRate=jt)},[jt]),A(()=>{let e=x.current;We>0&&(Qe.current=We),e&&(e.volume=We)},[Q,We]),A(()=>{let e=x.current;if(!e){at([]);return}let t=Array.from(e.textTracks),n=t[Sn],r=()=>{at(U&&n?V(n):[])};for(let[e,n]of t.entries())n.mode=U&&e===Sn?`hidden`:`disabled`;return n?.addEventListener(`cuechange`,r),r(),()=>{n?.removeEventListener(`cuechange`,r)}},[Y,U,Q,Sn,bn.length]),A(()=>{let e=window.requestAnimationFrame(()=>{try{window.localStorage.getItem(Ge)&&window.localStorage.removeItem(Ge)}catch{}});return()=>window.cancelAnimationFrame(e)},[]),A(()=>{if(!ht)return;if(we.current){we.current=!1;return}let e={fontSize:W,positionX:st.x,positionY:st.y,fontColor:G,backgroundColor:ut,fontFamily:ft,captionsOn:U},n=mt.current,r={};if(e.fontSize!==n.fontSize&&(r.fontSize=e.fontSize),(e.positionX!==n.positionX||e.positionY!==n.positionY)&&(r.positionX=e.positionX,r.positionY=e.positionY),e.fontColor!==n.fontColor&&(r.fontColor=e.fontColor),e.backgroundColor!==n.backgroundColor&&(r.backgroundColor=e.backgroundColor),e.fontFamily!==n.fontFamily&&(r.fontFamily=e.fontFamily),e.captionsOn!==n.captionsOn&&(r.captionsOn=e.captionsOn),Object.keys(r).length)return Ce.current!==null&&window.clearTimeout(Ce.current),Ce.current=window.setTimeout(()=>{Ce.current=null,mt.current=e,fetch(`/api/netflix/subtitle-preferences`,{method:`PUT`,headers:{"content-type":`application/json`},body:JSON.stringify({profileId:t,...r})}).then(async e=>{e.ok&&p(await e.json())}).catch(()=>{})},600),()=>{Ce.current!==null&&window.clearTimeout(Ce.current)}},[t,W,st,G,ut,ft,U,ht,p]),A(()=>{if(!Ct)return;let e=e=>{e.target instanceof Node&&!_e.current?.contains(e.target)&&wt(!1)},t=e=>{e.key===`Escape`&&(e.preventDefault(),e.stopPropagation(),wt(!1),_e.current?.querySelector(`.player-server-trigger`)?.focus())};return document.addEventListener(`pointerdown`,e),window.addEventListener(`keydown`,t,!0),()=>{document.removeEventListener(`pointerdown`,e),window.removeEventListener(`keydown`,t,!0)}},[Ct]),A(()=>{if(!et)return;let e=e=>{e.target instanceof Node&&!me.current?.contains(e.target)&&tt(!1)},t=e=>{e.key===`Escape`&&tt(!1)};return document.addEventListener(`pointerdown`,e),document.addEventListener(`keydown`,t),()=>{document.removeEventListener(`pointerdown`,e),document.removeEventListener(`keydown`,t)}},[et]),A(()=>{if(!U||!En.length)return;let e=()=>{let e=b.current?.getBoundingClientRect(),t=ve.current?.getBoundingClientRect();!e||!t||ct(n=>{let r=Ye(n,e,t);return r.x===n.x&&r.y===n.y?n:r})},t=window.requestAnimationFrame(e);return window.addEventListener(`resize`,e),document.addEventListener(`fullscreenchange`,e),()=>{window.cancelAnimationFrame(t),window.removeEventListener(`resize`,e),document.removeEventListener(`fullscreenchange`,e)}},[U,b,W,En]),A(()=>{if(!un||R)return;let e=window.setInterval(()=>{Ot(e=>{let t=e+.5,n=Math.min(t,X);return Dn.current.positionSeconds=n,n})},500);return()=>window.clearInterval(e)},[X,R,un]),A(()=>{if(!un||R||X<=0||Z<X)return;On({positionSeconds:X,completed:!0});let e=window.requestAnimationFrame(()=>z(!0));return()=>window.cancelAnimationFrame(e)},[Z,X,R,On,un]),A(()=>{let e=()=>Pt(document.fullscreenElement===b.current);return document.addEventListener(`fullscreenchange`,e),()=>document.removeEventListener(`fullscreenchange`,e)},[b]),A(()=>()=>{w.current&&window.clearTimeout(w.current)},[]);let kn=k(()=>{Wt(!1),E.current&&window.clearTimeout(E.current),E.current=window.setTimeout(()=>Wt(!0),5e3)},[]);A(()=>{if(Q?.kind===`embed`||R||K||Ct||et||_t||Xt||Qt){E.current&&window.clearTimeout(E.current);let e=window.requestAnimationFrame(()=>Wt(!1));return()=>window.cancelAnimationFrame(e)}let e=window.requestAnimationFrame(kn),t=b.current;if(!t)return()=>window.cancelAnimationFrame(e);let n=[`mousemove`,`mousedown`,`keydown`,`touchstart`,`scroll`];for(let e of n)t.addEventListener(e,kn);return()=>{window.cancelAnimationFrame(e);for(let e of n)t.removeEventListener(e,kn);E.current&&window.clearTimeout(E.current)}},[Qt,K,Xt,Q?.kind,R,b,kn,Ct,_t,et]);let An=e=>{let t=Math.max(0,Math.min(X,e));x.current&&(x.current.currentTime=t),Dn.current.positionSeconds=t,Ot(t)},jn=k(()=>{let e=ie.current;if(!e||e.readyState<HTMLMediaElement.HAVE_METADATA)return;let t=se.current,n=Number.isFinite(e.duration)&&e.duration>0?Math.max(0,e.duration-.05):t;try{e.currentTime=Math.min(t,n)}catch{}},[]),Mn=e=>{se.current=e,C.current===null&&(C.current=window.requestAnimationFrame(()=>{C.current=null,jn()}))},Nn=e=>{let t=Math.max(0,Math.min(X,e));Mn(t),Kt({position:X>0?t/X*100:0,time:t})},Pn=(e,t)=>{let n=t.getBoundingClientRect(),r=n.width>0?Math.max(0,Math.min(1,(e-n.left)/n.width)):0;Nn(r*X)};A(()=>{let e=ie.current;if(!e||!Q||Q.kind===`embed`)return;let t=!1,n=()=>{};return Q.kind===`hls`&&!e.canPlayType(`application/vnd.apple.mpegurl`)?import(`./hls-CgexCc5Z.js`).then(({default:e})=>{if(t||!ie.current||!e.isSupported())return;let r=new e;r.loadSource(Q.path),r.attachMedia(ie.current),r.on(e.Events.MANIFEST_PARSED,()=>{t||jn()}),n=()=>r.destroy()}):(e.src=Q.path,e.load()),()=>{t=!0,n(),C.current!==null&&(window.cancelAnimationFrame(C.current),C.current=null),e.removeAttribute(`src`),e.load()}},[Q,jn]);let Fn=()=>{let e=x.current;if(e){e.paused?e.play():e.pause();return}z(e=>(B.current=!e,!e))},In=e=>{!e&&We<=0&&Ze(Qe.current||1),Ue(e)},Ln=(e,t=!1)=>{let n=e.currentTime;Number.isFinite(e.duration)&&e.duration>0&&(Dn.current.durationSeconds=e.duration,Dt(e.duration),t&&!sn.current&&ze>0&&(n=Math.min(ze,Math.max(0,e.duration-.1)),e.currentTime=n,sn.current=!0),e.buffered.length&&At(e.buffered.end(e.buffered.length-1)/e.duration*100)),Number.isFinite(n)&&(Dn.current.positionSeconds=n,Ot(n))},Rn=()=>{let e=[1,1.25,1.5,.75],t=e.indexOf(jt);Mt(e[(t+1)%e.length])},zn=async()=>{try{document.fullscreenElement===b.current?await document.exitFullscreen():await b.current?.requestFullscreen()}catch{It(`Fullscreen is unavailable in this window`)}},Bn=()=>{w.current&&window.clearTimeout(w.current),It(`Thanks — the playback issue was reported`),w.current=window.setTimeout(()=>It(``),2600)},Vn=n=>{let r=Z;n===`intro`?qt(r):Yt(r),Zt(!1),It(n===`intro`?`Intro end set at ${H(r)}`:`Outro start set at ${H(r)}`),w.current&&window.clearTimeout(w.current),w.current=window.setTimeout(()=>It(``),2600),fetch(`/api/netflix/markers`,{method:`PUT`,headers:{"content-type":`application/json`},body:JSON.stringify({titleId:e.id,markerType:n,timeSeconds:r,profileId:t})}).catch(()=>{It(`Marker could not be saved`)})},Hn=n=>{n===`intro`?qt(null):Yt(null),Zt(!1),It(n===`intro`?`Intro marker removed`:`Outro marker removed`),w.current&&window.clearTimeout(w.current),w.current=window.setTimeout(()=>It(``),2600),fetch(`/api/netflix/markers`,{method:`DELETE`,headers:{"content-type":`application/json`},body:JSON.stringify({titleId:e.id,markerType:n,profileId:t})}).catch(()=>{It(`Marker could not be removed`)})},Un=e=>{let t=ye.current,n=b.current?.getBoundingClientRect();!t||t.pointerId!==e.pointerId||!n||ct(Ye({x:(e.clientX-t.offsetX-n.left)/n.width*100,y:(e.clientY-t.offsetY-n.top)/n.height*100},n,e.currentTarget.getBoundingClientRect()))},Wn=e=>{if(e.button!==0)return;let t=b.current?.getBoundingClientRect();t&&(e.preventDefault(),e.stopPropagation(),ye.current={pointerId:e.pointerId,offsetX:e.clientX-(t.left+st.x/100*t.width),offsetY:e.clientY-(t.top+st.y/100*t.height)},e.currentTarget.setPointerCapture(e.pointerId),vt(!0),B.current?be.current=!1:(be.current=!0,B.current=!0,z(!0)))},Gn=e=>{ye.current?.pointerId===e.pointerId&&(Un(e),e.currentTarget.hasPointerCapture(e.pointerId)&&e.currentTarget.releasePointerCapture(e.pointerId),ye.current=null,vt(!1),be.current&&(be.current=!1,B.current=!1,z(!1)))},Kn=e=>{let t={ArrowLeft:{x:-1,y:0},ArrowRight:{x:1,y:0},ArrowUp:{x:0,y:-1},ArrowDown:{x:0,y:1}}[e.key];if(!t)return;e.preventDefault();let n=e.shiftKey?5:1,r=b.current?.getBoundingClientRect(),i=e.currentTarget.getBoundingClientRect();ct(e=>{let a={x:e.x+t.x*n,y:e.y+t.y*n};return r?Ye(a,r,i):Je(a)})},qn=e=>{if(e===null){$e(!1),at([]);return}rt(e),$e(!0)},Jn=e=>{wt(!1),$t(!1),q(!1),tt(!1),!(e.id===xt&&!zt)&&(Vt(null),Rt(`Loading ${e.label}…`),Bt(!0),Tt(t=>({id:e.id,nonce:(t?.nonce??0)+1})))},Yn=t=>{if(q(!1),wt(!1),tt(!1),t===Y)return;On();let n=fn.find(e=>e.number===t),r=!!(e.playbackPath&&(!L||t===L));Et(t),sn.current=!0,cn.current=``,Ot(0),At(0);let i=Xe(n?.duration);Dn.current={seasonNumber:n?.season??1,episodeNumber:t,positionSeconds:0,durationSeconds:i},Dt(i),B.current=!1,z(!1),!n?.subtitles.length&&!e.subtitles?.length&&$e(!1),r&&e.playbackPath?(Vt({path:e.playbackPath,kind:e.playbackKind===`hls`?`hls`:`file`}),Rt(``),Bt(!1)):e.sourceProvider&&e.canStream&&(Vt(null),Rt(`Loading ${n?.title||`Episode ${t}`}…`),Bt(!0))},Xn=()=>{let e=fn[gn+1];e&&Yn(e.number)};A(()=>{Te.current={sessionId:ke,profileId:t,titleId:e.id,title:Ne,artwork:hn?.image||e.backdropImage,seasonNumber:vn,episodeNumber:Y,episodeTitle:hn?.title||`Episode ${Y}`,episodes:fn.map(e=>({season:e.season,number:e.number,title:e.title})),currentTime:Z,duration:X,paused:R,muted:He,volume:We,subtitles:{available:Cn,captionsOn:U,fontSize:W,fontColor:G,backgroundColor:ut},machineName:T(),deviceType:ce(),updatedAt:Date.now()}});let Zn=k(()=>{if(Ee.current)return;let e=Te.current;if(!e)return;let t=new AbortController;De.current.add(t),fetch(`/api/netflix/activity`,{method:`PUT`,headers:{"content-type":`application/json`},body:JSON.stringify({activity:{...e,updatedAt:Date.now()}}),cache:`no-store`,signal:t.signal}).catch(()=>{}).finally(()=>{De.current.delete(t)})},[]);return A(()=>{P.current=e=>{switch(e.type){case`set-paused`:{let t=x.current;B.current=e.paused,z(e.paused),t&&(e.paused?t.pause():t.play().catch(()=>z(!0)));break}case`seek-relative`:An(Dn.current.positionSeconds+e.seconds);break;case`seek-to`:An(e.seconds);break;case`set-muted`:In(e.muted);break;case`set-volume`:{let t=Math.max(0,Math.min(1,e.volume));t>0&&(Qe.current=t),Ze(t),Ue(t<=0);break}case`next-episode`:Xn();break;case`select-episode`:Yn(e.episodeNumber);break;case`switch-title`:ee(e.titleId).catch(()=>{It(`Movie could not be switched`)});break;case`switch-track`:case`switch-playlist`:break;case`set-captions`:$e(e.enabled&&Cn),e.enabled||at([]);break;case`set-subtitle-font-size`:ot(Math.max(18,Math.min(64,e.fontSize)));break;case`set-subtitle-font-color`:lt(e.color);break;case`set-subtitle-background`:dt(e.background);break;case`reset-subtitle-position`:ct(Ke);break}window.requestAnimationFrame(Zn)}}),A(()=>{Ee.current=!1,Oe.current=0;let e=!1,n=null,r=new AbortController,i=()=>{if(!Ee.current){Ee.current=!0;for(let e of De.current)e.abort();De.current.clear(),r.abort(),fetch(`/api/netflix/activity`,{method:`DELETE`,headers:{"content-type":`application/json`},body:JSON.stringify({sessionId:ke,profileId:t}),cache:`no-store`,keepalive:!0}).catch(()=>{})}},a=async()=>{if(!(e||Ee.current||r.signal.aborted)){try{let e=Oe.current,n=await fetch(`/api/netflix/activity/${encodeURIComponent(ke)}/commands?after=${encodeURIComponent(e)}&profileId=${encodeURIComponent(t)}`,{cache:`no-store`,signal:r.signal});if(n.ok){let t=await n.json();if(typeof t==`object`&&t&&!Array.isArray(t)){let n=t,r=Array.isArray(n.commands)?n.commands:[],i=new Set,a=[];for(let t of r){if(typeof t!=`object`||!t||Array.isArray(t))continue;let n=t,r=n.id;if(typeof r!=`number`||!Number.isSafeInteger(r)||r<=e||i.has(r)||n.sessionId!==ke)continue;let o={kind:`command`,sessionId:ke,command:n.command};!oe(o)||o.kind!==`command`||(i.add(r),a.push({id:r,command:o.command}))}a.sort((e,t)=>e.id-t.id);for(let e of a)P.current(e.command);let o=n.cursor,s=a.length>0?a[a.length-1].id:e;typeof o==`number`&&Number.isSafeInteger(o)&&o>=s?Oe.current=o:a.length&&(Oe.current=s)}}}catch{}!e&&!Ee.current&&!r.signal.aborted&&(n=window.setTimeout(()=>void a(),Math.min(500,ue)))}};window.addEventListener(`pagehide`,i),Zn();let o=window.setInterval(Zn,ue);return a(),()=>{e=!0,window.clearInterval(o),n!==null&&window.clearTimeout(n),window.removeEventListener(`pagehide`,i),i()}},[ke,t,Zn]),A(()=>{Zn()},[Y,U,X,Cn,He,R,ut,G,W,We,Zn]),O(`section`,{ref:b,className:`player${R?` player--paused`:``}${ln?` player--local`:``}${Ut?` player--idle`:``}`,role:`dialog`,"aria-modal":`true`,"aria-label":`Playing ${Ne}`,style:{"--player-image":`url("${e.backdropImage}")`},children:[Q?.kind===`embed`?D(`iframe`,{className:`player-embed`,src:Q.path,title:`${Ne} provider player`,allow:`autoplay; encrypted-media; fullscreen; picture-in-picture`,allowFullScreen:!0,referrerPolicy:`origin`,sandbox:`allow-forms allow-presentation allow-same-origin allow-scripts`}):ln?D(`video`,{ref:x,className:`player-video`,autoPlay:!0,playsInline:!0,muted:He,poster:e.backdropImage,onClick:Fn,onLoadedMetadata:e=>Ln(e.currentTarget,!0),onProgress:e=>Ln(e.currentTarget),onTimeUpdate:e=>Ln(e.currentTarget),onPlay:()=>{B.current=!1,z(!1)},onPause:()=>{B.current=!0,z(!0),On()},onEnded:()=>{let e=x.current,t=e&&Number.isFinite(e.duration)?e.duration:X;Ot(t),On({positionSeconds:t,durationSeconds:t||X,completed:!0}),B.current=!0,z(!0)},onError:()=>{Rt(`The browser could not play this provider stream.`),B.current=!0,z(!0)},children:bn.map(e=>D(`track`,{kind:`subtitles`,src:e.src,srcLang:e.language,label:e.label},`${Y}-${e.language}-${e.src}`))}):null,Lt&&O(`div`,{className:`player-stream-status${zt?``:` player-stream-status--error`}`,role:`status`,children:[zt&&D(h,{className:`spin`}),D(`span`,{children:Lt})]}),D(`div`,{className:`player-cinematic-bars`}),D(`div`,{className:`player-noise`}),O(`header`,{className:`player-topbar`,children:[O(`div`,{className:`player-topbar-start`,children:[D(`button`,{className:`player-icon-button player-back`,onClick:()=>{On(),_()},"aria-label":`Exit player`,children:D(i,{})}),Q?.kind===`embed`&&O(`div`,{className:`player-embed-program`,children:[D(`strong`,{children:Ne}),O(`span`,{children:[`Episode `,Y]})]})]}),O(`div`,{className:`player-topbar-actions`,children:[yt.length>0&&O(`div`,{className:`player-server-control`,ref:_e,children:[D(`button`,{className:`player-icon-button player-server-trigger${Ct?` is-active`:``}`,type:`button`,"aria-label":yn?`Change server, currently ${yn.label}`:`Change server`,"aria-haspopup":`listbox`,"aria-expanded":Ct,onClick:()=>{let e=!Ct;$t(!1),q(!1),tt(!1),wt(e)},children:D(xe,{})}),Ct&&O(`div`,{className:`player-server-menu`,children:[D(`h2`,{children:`Servers`}),D(`div`,{className:`player-server-options`,role:`listbox`,"aria-label":`Servers`,children:yt.map(e=>{let t=e.id===xt;return O(`button`,{type:`button`,role:`option`,"aria-selected":t,onClick:()=>Jn(e),children:[D(xe,{"aria-hidden":`true`}),D(`span`,{children:e.label}),t&&D(S,{"aria-hidden":`true`})]},e.id)})})]})]}),Q?.kind===`embed`&&O(de,{children:[D(`button`,{className:`player-icon-button player-topbar-episodes${K?` is-active`:``}`,type:`button`,"aria-label":K?`Hide episodes`:`Show episodes`,"aria-expanded":K,onClick:()=>{$t(!1),wt(!1),tt(!1),q(e=>!e)},children:D(r,{})}),D(`button`,{className:`player-icon-button player-topbar-next`,type:`button`,"aria-label":`Next episode`,onClick:Xn,disabled:!_n,children:D(n,{})})]}),D(ae,{id:`player-access-popover`,wrapClassName:`player-popover-wrap`,buttonClassName:`player-icon-button player-access`,popoverClassName:`player-access-popover`,open:Qt,onOpenChange:e=>{e&&(wt(!1),q(!1),tt(!1)),$t(e)}}),D(`button`,{className:`player-icon-button player-report`,onClick:Bn,"aria-label":`Report a problem`,children:D(he,{})})]})]}),Q?.kind!==`embed`&&U&&En.length>0&&D(`div`,{ref:ve,className:`player-subtitles${_t?` player-subtitles--dragging`:``}`,style:{"--player-subtitle-font-size":`${W}px`,"--player-subtitle-color":G,"--player-subtitle-bg":ut,"--player-subtitle-font-family":ft==="default"?void 0:ft,left:`${st.x}%`,top:`${st.y}%`},role:`group`,"aria-label":`Draggable subtitles`,"aria-live":`polite`,tabIndex:0,onClick:e=>e.stopPropagation(),onKeyDown:Kn,onPointerDown:Wn,onPointerMove:Un,onPointerUp:Gn,onPointerCancel:Gn,children:En.map((e,t)=>D(`span`,{children:e},`${t}-${e}`))}),K&&O(`aside`,{className:`player-episodes${Q?.kind===`embed`?` player-episodes--embed`:``}`,"aria-label":`Episodes`,children:[O(`header`,{className:`player-episodes-header`,children:[D(`h2`,{children:e.mediaType===`limited-series`?`Limited Series`:`Season ${vn}`}),O(`button`,{className:`episode-sort-button`,type:`button`,"aria-label":l===`asc`?`Sort episodes newest first`:`Sort episodes oldest first`,title:l===`asc`?`Sorted oldest first`:`Sorted newest first`,onClick:()=>te(l===`asc`?`desc`:`asc`),children:[D(l===`asc`?fe:pe,{}),D(`span`,{children:l===`asc`?`Oldest`:`Newest`})]})]}),D(`div`,{className:`player-episode-list`,children:pn.map(e=>{let t=e.number===Y;return O(`button`,{className:`player-episode${t?` player-episode--active`:``}`,"aria-label":`${e.number}. ${e.title}, ${e.duration}`,"aria-current":t?`true`:void 0,onClick:()=>Yn(e.number),children:[O(`span`,{className:`player-episode-heading`,children:[D(`span`,{children:e.number}),D(`strong`,{children:e.title}),D(`i`,{"aria-hidden":`true`})]}),t&&O(`span`,{className:`player-episode-details`,children:[D(`span`,{className:`player-episode-thumbnail`,style:{backgroundImage:`linear-gradient(rgba(0, 0, 0, 0.34), rgba(0, 0, 0, 0.48)), url("${e.image}")`},children:O(`span`,{className:`player-now-playing`,children:[O(`span`,{className:`player-playing-bars`,"aria-hidden":`true`,children:[D(`i`,{}),D(`i`,{}),D(`i`,{}),D(`i`,{})]}),`Now playing`]})}),D(`span`,{className:`player-episode-synopsis`,children:e.synopsis})]})]},e.number)})})]}),Q?.kind!==`embed`&&R&&!Lt&&D(`button`,{className:`big-play`,onClick:Fn,"aria-label":`Resume`,children:D(g,{fill:`currentColor`})}),Ft&&D(`div`,{className:`player-notice`,role:`status`,children:Ft}),Q?.kind!==`embed`&&O(`div`,{className:`player-bottom${K?` player-bottom--drawer-open`:``}`,children:[!K&&O(`div`,{className:`player-timeline-row`,children:[O(`div`,{className:`player-timeline-wrap${Gt?` player-timeline-wrap--previewing`:``}`,style:{"--seek-preview-position":`${Gt?.position??0}%`},onPointerEnter:e=>Pn(e.clientX,e.currentTarget),onPointerMove:e=>Pn(e.clientX,e.currentTarget),onPointerLeave:()=>Kt(null),children:[O(`div`,{className:`player-seek-preview`,"aria-hidden":`true`,children:[Q?D(`video`,{ref:ie,className:`player-seek-preview-frame`,muted:!0,playsInline:!0,preload:`metadata`,poster:hn?.image||e.backdropImage,onLoadedMetadata:jn,onSeeked:e=>e.currentTarget.pause()}):D(de,{children:D(`img`,{src:hn?.image||e.backdropImage,alt:``,draggable:!1})}),D(`time`,{children:H(Gt?.time??Z)})]}),D(`input`,{className:`player-timeline`,type:`range`,min:0,max:X||1,step:.1,value:Math.min(Z,X||1),style:wn,onFocus:e=>Nn(Number(e.currentTarget.value)),onBlur:()=>Kt(null),onInput:e=>Nn(Number(e.currentTarget.value)),onChange:e=>An(Number(e.currentTarget.value)),"aria-label":`Seek`,"aria-valuetext":`${H(Z)} of ${H(X)}`}),$!==null&&X>0&&D(`div`,{className:`player-timeline-marker player-timeline-marker--intro`,style:{left:`${$/X*100}%`},"aria-label":`Intro end at ${H($)}`}),Jt!==null&&X>0&&D(`div`,{className:`player-timeline-marker player-timeline-marker--outro`,style:{left:`${Jt/X*100}%`},"aria-label":`Outro start at ${H(Jt)}`}),R&&!Lt&&O(`div`,{ref:an,className:`player-marker-control`,style:{left:`${mn}%`},onPointerEnter:e=>{e.stopPropagation(),Kt(null)},onPointerMove:e=>e.stopPropagation(),onPointerLeave:e=>e.stopPropagation(),children:[D(`button`,{className:`player-marker-trigger`,"aria-label":`Timeline marker settings`,"aria-expanded":Xt,onClick:e=>{e.stopPropagation(),Zt(e=>!e)},children:D(Se,{})}),Xt&&O(`div`,{className:`player-marker-menu`,role:`menu`,"aria-label":`Set timeline marker`,children:[O(`button`,{type:`button`,role:`menuitem`,onClick:()=>Vn(`intro`),children:[D(ne,{}),D(`span`,{children:`Set as Intro`}),$!==null&&D(`small`,{children:H($)})]}),O(`button`,{type:`button`,role:`menuitem`,onClick:()=>Vn(`outro`),children:[D(n,{}),D(`span`,{children:`Set as Outro`}),Jt!==null&&D(`small`,{children:H(Jt)})]}),$!==null&&O(`button`,{type:`button`,role:`menuitem`,className:`player-marker-menu-remove`,onClick:()=>Hn(`intro`),children:[D(v,{}),D(`span`,{children:`Remove Intro`}),D(`small`,{children:H($)})]}),Jt!==null&&O(`button`,{type:`button`,role:`menuitem`,className:`player-marker-menu-remove`,onClick:()=>Hn(`outro`),children:[D(v,{}),D(`span`,{children:`Remove Outro`}),D(`small`,{children:H(Jt)})]})]})]})]}),D(`time`,{children:H(X-Z)})]}),O(`div`,{className:`player-controls`,children:[O(`div`,{className:`player-controls-left`,children:[D(`button`,{className:`player-control-button`,onClick:Fn,"aria-label":R?`Play`:`Pause`,children:D(R?g:m,{fill:`currentColor`})}),O(`button`,{className:`player-control-button player-ten-second`,"aria-label":`Rewind 10 seconds`,onClick:()=>An(Z-10),children:[D(u,{}),D(`span`,{children:`10`})]}),O(`button`,{className:`player-control-button player-ten-second`,"aria-label":`Forward 10 seconds`,onClick:()=>An(Z+10),children:[D(c,{}),D(`span`,{children:`10`})]}),D(`button`,{className:`player-control-button`,"aria-label":He?`Unmute`:`Mute`,"aria-pressed":He,onClick:()=>In(!He),children:D(He?y:re,{})})]}),O(`div`,{className:`player-program`,children:[D(`strong`,{children:Ne}),O(`span`,{children:[`Season `,vn,`\xA0\xA0 Episode `,Y]})]}),O(`div`,{className:`player-controls-right`,children:[D(`button`,{className:`player-control-button`,"aria-label":`Next episode`,onClick:Xn,disabled:!_n,children:D(n,{})}),D(`button`,{className:`player-control-button player-episodes-trigger${K?` is-active`:``}`,type:`button`,"aria-label":K?`Hide episodes`:`Show episodes`,"aria-expanded":K,onClick:()=>{$t(!1),wt(!1),tt(!1),q(e=>!e)},children:D(r,{})}),O(`div`,{className:`player-subtitle-control`,ref:me,children:[et&&O(`div`,{className:`player-subtitle-menu`,role:`dialog`,"aria-label":`Subtitles`,children:[D(`h2`,{children:`Subtitles`}),O(`div`,{className:`player-subtitle-options`,role:`listbox`,"aria-label":`Subtitle language`,children:[O(`button`,{type:`button`,role:`option`,"aria-selected":!U,onClick:()=>qn(null),children:[D(`span`,{className:`player-subtitle-check`,"aria-hidden":`true`,children:!U&&D(S,{})}),D(`span`,{children:`Off`})]}),xn.map((e,t)=>{let n=U&&t===Sn;return O(`button`,{type:`button`,role:`option`,"aria-selected":n,onClick:()=>qn(t),children:[D(`span`,{className:`player-subtitle-check`,"aria-hidden":`true`,children:n&&D(S,{})}),D(`span`,{children:e.label})]},`${e.language}-${e.src}`)})]}),O(`div`,{className:`player-subtitle-settings`,children:[O(`div`,{className:`player-subtitle-setting-heading`,children:[D(`label`,{htmlFor:`player-subtitle-font-size`,children:`Font size`}),O(`output`,{htmlFor:`player-subtitle-font-size`,children:[W,`px`]})]}),O(`div`,{className:`player-subtitle-size-control`,children:[D(`span`,{"aria-hidden":`true`,children:`A`}),D(`input`,{id:`player-subtitle-font-size`,type:`range`,min:18,max:64,step:2,value:W,"aria-label":`Subtitle font size`,onChange:e=>ot(Number(e.currentTarget.value))}),D(`span`,{"aria-hidden":`true`,children:`A`})]}),O(`div`,{className:`player-subtitle-position-setting`,children:[D(`p`,{children:`Drag subtitles on screen to move them.`}),D(`button`,{type:`button`,onClick:()=>ct(Ke),children:`Reset position`})]}),O(`div`,{className:`player-subtitle-color-setting`,children:[D(`label`,{htmlFor:`player-subtitle-font-color`,children:`Font color`}),D(`input`,{id:`player-subtitle-font-color`,type:`color`,value:G,onChange:e=>lt(e.currentTarget.value)})]}),O(`div`,{className:`player-subtitle-color-setting`,children:[D(`label`,{htmlFor:`player-subtitle-bg-color`,children:`Background`}),O(`select`,{id:`player-subtitle-bg-color`,value:ut,onChange:e=>dt(e.currentTarget.value),children:[D(`option`,{value:`transparent`,children:`None`}),D(`option`,{value:`rgba(0,0,0,0.75)`,children:`Dark`}),D(`option`,{value:`rgba(0,0,0,0.5)`,children:`Semi-dark`}),D(`option`,{value:`rgba(0,0,0,0.3)`,children:`Light`}),D(`option`,{value:`rgba(0,0,0,1)`,children:`Solid black`})]})]})]})]}),D(`button`,{className:`player-control-button player-subtitle-trigger${U?` is-active`:``}`,"aria-label":Cn?`Subtitles`:`Subtitles unavailable`,"aria-haspopup":`dialog`,"aria-expanded":et,"aria-pressed":U,disabled:!Cn,onClick:()=>{q(!1),wt(!1),tt(e=>!e)},children:D(o,{})})]}),O(`button`,{className:`player-control-button player-speed`,"aria-label":`Change playback speed, currently ${jt}x`,onClick:Rn,children:[D(ge,{}),jt!==1&&O(`span`,{children:[jt,`×`]})]}),D(`button`,{className:`player-control-button`,"aria-label":Nt?`Exit fullscreen`:`Enter fullscreen`,onClick:()=>void zn(),children:D(Nt?d:s,{})})]})]})]}),Q?.kind!==`embed`&&en&&!R&&D(`button`,{className:`player-skip-intro`,onClick:()=>{$!==null&&An($),tn(!1)},children:`Skip Intro`}),Q?.kind!==`embed`&&nn&&!R&&_n&&O(`button`,{className:`player-next-episode-prompt`,onClick:()=>{rn(!1),Xn()},children:[D(g,{fill:`currentColor`}),`Next Episode`]})]})}function Qe(){return O(`footer`,{className:`site-footer`,id:`footer`,children:[O(`div`,{className:`social-links`,"aria-label":`Social media`,children:[D(`a`,{href:`#facebook`,"aria-label":`Facebook`,children:`f`}),D(`a`,{href:`#instagram`,"aria-label":`Instagram`,children:`◎`}),D(`a`,{href:`#twitter`,"aria-label":`X`,children:`𝕏`}),D(`a`,{href:`#youtube`,"aria-label":`YouTube`,children:`▶`})]}),D(`div`,{className:`footer-links`,children:[`Audio Description`,`Help Center`,`Gift Cards`,`Media Center`,`Investor Relations`,`Jobs`,`Terms of Use`,`Privacy`,`Legal Notices`,`Cookie Preferences`,`Corporate Information`,`Contact Us`].map(e=>D(`a`,{href:`#${U(e)}`,children:e},e))}),D(`span`,{className:`service-code`,children:`Service Code`}),D(`p`,{children:`© 1997–2026 Netflix Clone. Built for demonstration purposes.`})]})}function U(e){return e.toLowerCase().replace(/&/g,`and`).replace(/ /g,`-`)}export{Fe as NetflixBrowser};
@@ -1 +1 @@
1
- import{n as e}from"./chevron-left-CkBJG8E2.js";import{a as t,c as n,d as r,f as i,h as a,i as o,l as s,n as c,o as l,p as u,r as d,u as f}from"./refresh-cw-CWdWHjqY.js";import{Fragment as p,jsx as m,jsxs as h}from"react/jsx-runtime";import{useEffect as g,useId as _,useMemo as v,useRef as y,useState as b}from"react";import{createPortal as x}from"react-dom";var S=e(`arrow-right`,[[`path`,{d:`M5 12h14`,key:`1ays0h`}],[`path`,{d:`m12 5 7 7-7 7`,key:`xquz4c`}]]),C=e(`heart`,[[`path`,{d:`M2 9.5a5.5 5.5 0 0 1 9.591-3.676.56.56 0 0 0 .818 0A5.49 5.49 0 0 1 22 9.5c0 2.29-1.5 4-3 5.5l-5.492 5.313a2 2 0 0 1-3 .019L5 15c-1.5-1.5-3-3.2-3-5.5`,key:`mvr1a0`}]]),w=e(`laptop`,[[`path`,{d:`M18 5a2 2 0 0 1 2 2v8.526a2 2 0 0 0 .212.897l1.068 2.127a1 1 0 0 1-.9 1.45H3.62a1 1 0 0 1-.9-1.45l1.068-2.127A2 2 0 0 0 4 15.526V7a2 2 0 0 1 2-2z`,key:`1pdavp`}],[`path`,{d:`M20.054 15.987H3.946`,key:`14rxg9`}]]),T=e(`monitor`,[[`rect`,{width:`20`,height:`14`,x:`2`,y:`3`,rx:`2`,key:`48i651`}],[`line`,{x1:`8`,x2:`16`,y1:`21`,y2:`21`,key:`1svkeh`}],[`line`,{x1:`12`,x2:`12`,y1:`17`,y2:`21`,key:`vw1qmm`}]]),E=e(`smartphone`,[[`rect`,{width:`14`,height:`20`,x:`5`,y:`2`,rx:`2`,ry:`2`,key:`1yt0o3`}],[`path`,{d:`M12 18h.01`,key:`mhygvu`}]]),D=e(`sparkles`,[[`path`,{d:`M11.017 2.814a1 1 0 0 1 1.966 0l1.051 5.558a2 2 0 0 0 1.594 1.594l5.558 1.051a1 1 0 0 1 0 1.966l-5.558 1.051a2 2 0 0 0-1.594 1.594l-1.051 5.558a1 1 0 0 1-1.966 0l-1.051-5.558a2 2 0 0 0-1.594-1.594l-5.558-1.051a1 1 0 0 1 0-1.966l5.558-1.051a2 2 0 0 0 1.594-1.594z`,key:`1s2grr`}],[`path`,{d:`M20 2v4`,key:`1rf3ol`}],[`path`,{d:`M22 4h-4`,key:`gwowj6`}],[`circle`,{cx:`4`,cy:`20`,r:`2`,key:`6kqj1y`}]]),O=e(`tablet`,[[`rect`,{width:`16`,height:`20`,x:`4`,y:`2`,rx:`2`,ry:`2`,key:`76otgf`}],[`line`,{x1:`12`,x2:`12.01`,y1:`18`,y2:`18`,key:`1dp563`}]]),k=e(`circle-alert`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`line`,{x1:`12`,x2:`12`,y1:`8`,y2:`12`,key:`1pkeuh`}],[`line`,{x1:`12`,x2:`12.01`,y1:`16`,y2:`16`,key:`4dfq90`}]]);function A({profiles:e,activeProfile:t,onSelectProfile:n,onProfilesChanged:r}){let i=y(null),o=y(null),c=y(null),u=_(),[d,v]=b(!1),[S,C]=b(!1),[w,T]=b(null),[E,D]=b(``);g(()=>{if(!d)return;let e=window.requestAnimationFrame(()=>{c.current?.querySelector(`[role="menuitemradio"]:not(:disabled), [role="menuitem"]`)?.focus()}),t=e=>{e.target instanceof Node&&!i.current?.contains(e.target)&&v(!1)},n=e=>{e.key===`Escape`&&(e.preventDefault(),v(!1),o.current?.focus())};return document.addEventListener(`pointerdown`,t),document.addEventListener(`keydown`,n),()=>{window.cancelAnimationFrame(e),document.removeEventListener(`pointerdown`,t),document.removeEventListener(`keydown`,n)}},[d]);let O=e=>{e.relatedTarget instanceof Node&&i.current?.contains(e.relatedTarget)||v(!1)},k=e=>{if(e.key!==`ArrowDown`&&e.key!==`ArrowUp`&&e.key!==`Home`&&e.key!==`End`)return;let t=Array.from(c.current?.querySelectorAll(`[role="menuitemradio"]:not(:disabled), [role="menuitem"]`)??[]);if(!t.length)return;e.preventDefault();let n=t.findIndex(e=>e===document.activeElement),r=0;e.key===`End`?r=t.length-1:e.key===`ArrowUp`?r=n<=0?t.length-1:Math.max(0,n-1):e.key===`ArrowDown`&&(r=n<0||n===t.length-1?0:n+1),t[r]?.focus()},A=async e=>{if(!w){if(e.id===t.id){v(!1),o.current?.focus();return}D(``),T(e.id);try{await n(e),v(!1),o.current?.focus()}catch{D(`Profile could not be selected. Please try again.`)}finally{T(null)}}};return h(p,{children:[h(`div`,{className:`store-profile-menu`,ref:i,onBlur:O,children:[h(`button`,{className:`store-profile-trigger`,ref:o,type:`button`,"aria-label":`Profile: ${t.name}. Open profile menu`,"aria-haspopup":`menu`,"aria-expanded":d,"aria-controls":d?u:void 0,onClick:()=>{D(``),v(e=>!e)},onKeyDown:e=>{e.key!==`ArrowDown`&&e.key!==`ArrowUp`||(e.preventDefault(),D(``),v(!0))},children:[h(`span`,{className:`store-profile-avatar`,"aria-hidden":`true`,style:{backgroundColor:t.avatarColor},children:[m(`span`,{}),m(`span`,{}),m(`span`,{})]}),m(f,{className:`store-profile-chevron${d?` store-profile-chevron--open`:``}`,"aria-hidden":`true`})]}),d&&h(`div`,{className:`store-profile-popover`,id:u,ref:c,role:`menu`,"aria-label":`Choose a Netflix profile`,"aria-busy":w!==null,onKeyDown:k,children:[m(`span`,{className:`store-profile-caret`,"aria-hidden":`true`}),m(`div`,{className:`store-profile-options`,children:e.map(e=>{let n=e.id===t.id,r=e.id===w;return h(`button`,{className:`store-profile-option`,type:`button`,role:`menuitemradio`,"aria-checked":n,disabled:w!==null,onClick:()=>void A(e),children:[m(`span`,{className:`store-profile-mini-avatar`,style:{backgroundColor:e.avatarColor},"aria-hidden":`true`,children:e.name.slice(0,1).toUpperCase()}),h(`span`,{className:`store-profile-name`,children:[e.name,r?` — switching…`:``]}),n&&m(a,{className:`store-profile-active-check`,"aria-hidden":`true`})]},e.id)})}),h(`button`,{className:`store-profile-manage`,type:`button`,role:`menuitem`,onClick:()=>{v(!1),C(!0)},children:[m(s,{"aria-hidden":`true`}),m(`span`,{children:`Manage profile`})]}),E&&m(`p`,{className:`store-profile-error`,role:`alert`,children:E})]})]}),S&&x(m(l,{profiles:[...e],activeProfile:t,onClose:()=>{C(!1),window.requestAnimationFrame(()=>o.current?.focus())},onProfilesChanged:r}),document.body)]})}var j=e(`skip-back`,[[`path`,{d:`M17.971 4.285A2 2 0 0 1 21 6v12a2 2 0 0 1-3.029 1.715l-9.997-5.998a2 2 0 0 1-.003-3.432z`,key:`15892j`}],[`path`,{d:`M3 20V4`,key:`1ptbpl`}]]);function M({type:e}){switch(e){case`phone`:return m(E,{"aria-hidden":`true`});case`tablet`:return m(O,{"aria-hidden":`true`});case`laptop`:return m(w,{"aria-hidden":`true`});default:return m(T,{"aria-hidden":`true`})}}function N(e){let t=Math.max(0,Math.floor(e)),n=Math.floor(t/3600),r=Math.floor(t%3600/60),i=t%60;return n?`${n}:${String(r).padStart(2,`0`)}:${String(i).padStart(2,`0`)}`:`${r}:${String(i).padStart(2,`0`)}`}function P({activity:e,tabLabel:n,searchOpen:r,onSearchToggle:a,onCommand:s}){let[l,f]=b(null),p=Math.max(1,Math.round(e.duration)),g=Math.max(0,Math.min(p,Math.round(l??e.currentTime))),_=e.duration>0?Math.max(0,Math.min(100,g/e.duration*100)):0,v=Math.round(e.volume*100),y=t=>{let n=Math.max(0,Math.min(e.duration,Math.round(t)));f(null),s({type:`seek-to`,seconds:n})};return h(`article`,{className:`activity-card activity-card--spotify`,"aria-label":`${e.title} playback in ${n}`,style:{"--activity-artwork":`url("${e.artwork}")`},children:[h(`div`,{className:`activity-card__art`,children:[h(`div`,{className:`activity-card__source`,children:[h(`span`,{className:`activity-spotify-mark`,"aria-label":`Spotify`,children:[m(`i`,{}),m(`i`,{}),m(`i`,{})]}),h(`span`,{className:`activity-live`,children:[m(`i`,{"aria-hidden":`true`}),m(M,{type:e.deviceType}),n]})]}),h(`div`,{className:`activity-card__copy`,children:[m(`span`,{children:`Now listening`}),m(`h3`,{children:e.title}),h(`p`,{children:[e.artist,m(`span`,{"aria-hidden":`true`,children:` · `}),e.album]})]})]}),h(`div`,{className:`activity-card__remote`,children:[m(`input`,{className:`activity-progress`,type:`range`,min:0,max:p,step:1,value:g,disabled:e.duration<=0,"aria-label":`${e.title} progress`,"aria-valuetext":`${N(g)} of ${N(e.duration)}`,title:`Seek ${e.title}`,style:{"--activity-progress":`${_}%`},onChange:e=>f(Number(e.currentTarget.value)),onPointerUp:e=>y(Number(e.currentTarget.value)),onPointerCancel:()=>f(null),onKeyUp:e=>{(e.key===`ArrowLeft`||e.key===`ArrowRight`||e.key===`ArrowUp`||e.key===`ArrowDown`||e.key===`Home`||e.key===`End`||e.key===`PageUp`||e.key===`PageDown`)&&y(Number(e.currentTarget.value))},onBlur:e=>{l!==null&&y(Number(e.currentTarget.value))}}),h(`div`,{className:`activity-time`,children:[m(`time`,{children:N(g)}),m(`span`,{children:N(e.duration)})]}),h(`div`,{className:`activity-controls activity-controls--spotify`,role:`group`,"aria-label":`Controls for ${e.title} by ${e.artist}`,children:[m(`button`,{type:`button`,onClick:()=>s({type:`previous-track`}),"aria-label":`Previous track before ${e.title}`,children:m(j,{fill:`currentColor`})}),m(`button`,{type:`button`,onClick:()=>s({type:`set-paused`,paused:!e.paused}),"aria-label":`${e.paused?`Play`:`Pause`} ${e.title}`,children:e.paused?m(u,{fill:`currentColor`}):m(t,{fill:`currentColor`})}),m(`button`,{type:`button`,onClick:()=>s({type:`next-track`}),"aria-label":`Next track after ${e.title}`,children:m(o,{fill:`currentColor`})}),h(`div`,{className:`activity-volume`,children:[m(`button`,{type:`button`,onClick:()=>s({type:`set-muted`,muted:!e.muted}),"aria-label":`${e.muted?`Unmute`:`Mute`} ${e.title}`,"aria-pressed":e.muted,children:e.muted?m(c,{}):m(d,{})}),m(`input`,{type:`range`,min:0,max:100,step:1,value:v,style:{"--activity-volume":`${v}%`},onChange:e=>s({type:`set-volume`,volume:Number(e.currentTarget.value)/100}),"aria-label":`Volume for ${e.title}`,"aria-valuetext":e.muted?`Muted, level ${v}%`:`${v}%`})]}),m(`button`,{className:r?`is-active`:``,type:`button`,onClick:a,"aria-label":`Switch ${e.title} to another track`,"aria-expanded":r,"aria-controls":`activity-tracks-${e.sessionId}`,children:m(i,{})})]})]})]})}var F={chromaticWeather:{from:`#3659f7`,to:`#ed5b98`,accent:`#d9f8ff`,glyph:`✦`},stillFrames:{from:`#d16b5d`,to:`#4a1f35`,accent:`#ffe4c7`,glyph:`◌`},parallelStreets:{from:`#121c3d`,to:`#af2f78`,accent:`#65e4ff`,glyph:`//`},blueHour:{from:`#204b78`,to:`#9b6db2`,accent:`#d9edff`,glyph:`◐`},orbiting:{from:`#322063`,to:`#e34f86`,accent:`#f5d5ff`,glyph:`◎`},smallHours:{from:`#b66a35`,to:`#2b483b`,accent:`#ffe3a8`,glyph:`☕`},lowTide:{from:`#22676c`,to:`#102e46`,accent:`#b7f5df`,glyph:`≈`},dreamingMono:{from:`#3c3d42`,to:`#8e718f`,accent:`#f2ebd9`,glyph:`◇`},liked:{from:`#3f2db8`,to:`#8ed8c8`,accent:`#ffffff`,glyph:`♥`},coding:{from:`#083d35`,to:`#151d28`,accent:`#53f2b0`,glyph:`</>`},nightDrive:{from:`#15152f`,to:`#7b205d`,accent:`#ff6cc7`,glyph:`☾`},coffeehouse:{from:`#9d5c3e`,to:`#2e2924`,accent:`#ffd59d`,glyph:`AM`},sundayReset:{from:`#d9846a`,to:`#687c67`,accent:`#fff0d2`,glyph:`SUN`},neonPulse:{from:`#4d1ec9`,to:`#e31f74`,accent:`#67f6da`,glyph:`N`},softPop:{from:`#e995b5`,to:`#8e70c9`,accent:`#fff1b8`,glyph:`POP`},deepFocus:{from:`#174d4b`,to:`#18233e`,accent:`#79d6bb`,glyph:`∞`},morningLight:{from:`#ee9b52`,to:`#f0cf78`,accent:`#4e3628`,glyph:`✺`}},I=[{id:`neon-skyline`,title:`Neon Skyline`,artist:`Luma Coast`,album:`Chromatic Weather`,durationSec:224,palette:F.chromaticWeather},{id:`open-windows`,title:`Open Windows`,artist:`Luma Coast`,album:`Chromatic Weather`,durationSec:197,palette:F.chromaticWeather},{id:`slow-motion`,title:`Slow Motion`,artist:`Arlo Vale`,album:`Still Frames`,durationSec:208,palette:F.stillFrames},{id:`paper-moons`,title:`Paper Moons`,artist:`Arlo Vale`,album:`Still Frames`,durationSec:186,palette:F.stillFrames},{id:`after-hours-drive`,title:`After Hours Drive`,artist:`Night Atlas`,album:`Parallel Streets`,durationSec:251,palette:F.parallelStreets},{id:`city-rain`,title:`City Rain`,artist:`Night Atlas`,album:`Parallel Streets`,durationSec:239,palette:F.parallelStreets},{id:`blue-hour`,title:`Blue Hour`,artist:`Mira Lane`,album:`Northbound`,durationSec:216,palette:F.blueHour},{id:`velvet-morning`,title:`Velvet Morning`,artist:`Mira Lane`,album:`Northbound`,durationSec:203,palette:F.blueHour},{id:`satellite-hearts`,title:`Satellite Hearts`,artist:`Nova Bloom`,album:`Orbiting`,durationSec:232,palette:F.orbiting},{id:`signal-fires`,title:`Signal Fires`,artist:`Nova Bloom`,album:`Orbiting`,durationSec:245,palette:F.orbiting},{id:`coffee-stains`,title:`Coffee Stains`,artist:`The Daylights`,album:`Small Hours`,durationSec:194,palette:F.smallHours},{id:`golden-lines`,title:`Golden Lines`,artist:`The Daylights`,album:`Small Hours`,durationSec:211,palette:F.smallHours},{id:`quiet-current`,title:`Quiet Current`,artist:`Elio Pines`,album:`Low Tide Letters`,durationSec:263,palette:F.lowTide},{id:`tides-in-reverse`,title:`Tides in Reverse`,artist:`Elio Pines`,album:`Low Tide Letters`,durationSec:228,palette:F.lowTide},{id:`soft-static`,title:`Soft Static`,artist:`Static Garden`,album:`Dreaming in Mono`,durationSec:274,palette:F.dreamingMono},{id:`midnight-orchard`,title:`Midnight Orchard`,artist:`Static Garden`,album:`Dreaming in Mono`,durationSec:257,palette:F.dreamingMono}],L=[{id:`daily-mix-one`,title:`Daily Mix 01`,description:`Luma Coast, Nova Bloom, Mira Lane and more`,curator:`Spotify Atom`,trackIds:[`neon-skyline`,`satellite-hearts`,`blue-hour`,`open-windows`,`signal-fires`],palette:F.chromaticWeather},{id:`daily-mix-two`,title:`Daily Mix 02`,description:`Night Atlas, Static Garden, Elio Pines and more`,curator:`Spotify Atom`,trackIds:[`after-hours-drive`,`soft-static`,`city-rain`,`quiet-current`,`midnight-orchard`],palette:F.parallelStreets},{id:`daily-mix-three`,title:`Daily Mix 03`,description:`Arlo Vale, The Daylights, Mira Lane and more`,curator:`Spotify Atom`,trackIds:[`slow-motion`,`coffee-stains`,`velvet-morning`,`paper-moons`,`golden-lines`],palette:F.stillFrames},{id:`discover-weekly`,title:`Discover Weekly`,description:`A fresh collection picked for your week`,curator:`Spotify Atom`,trackIds:[`tides-in-reverse`,`signal-fires`,`open-windows`,`midnight-orchard`,`golden-lines`],palette:F.orbiting},{id:`coding-mode`,title:`Coding Mode`,description:`Steady electronic focus without the distractions`,curator:`Spotify Atom`,trackIds:[`soft-static`,`quiet-current`,`midnight-orchard`,`tides-in-reverse`,`city-rain`],palette:F.coding},{id:`night-drive`,title:`Night Drive`,description:`Glowing synths for roads after dark`,curator:`Spotify Atom`,trackIds:[`after-hours-drive`,`neon-skyline`,`city-rain`,`satellite-hearts`,`signal-fires`],palette:F.nightDrive},{id:`coffeehouse`,title:`Coffeehouse`,description:`Warm voices, soft strings, unhurried mornings`,curator:`Spotify Atom`,trackIds:[`coffee-stains`,`slow-motion`,`paper-moons`,`velvet-morning`,`golden-lines`],palette:F.coffeehouse},{id:`sunday-reset`,title:`Sunday Reset`,description:`Easy songs for a slower kind of day`,curator:`Spotify Atom`,trackIds:[`velvet-morning`,`open-windows`,`coffee-stains`,`quiet-current`,`paper-moons`],palette:F.sundayReset},{id:`neon-pulse`,title:`Neon Pulse`,description:`Electric color and late-night momentum`,curator:`Atom Editorial`,trackIds:[`neon-skyline`,`satellite-hearts`,`after-hours-drive`,`signal-fires`,`soft-static`],palette:F.neonPulse},{id:`soft-pop`,title:`Soft Pop`,description:`Bright hooks with all the edges smoothed out`,curator:`Atom Editorial`,trackIds:[`blue-hour`,`open-windows`,`slow-motion`,`satellite-hearts`,`golden-lines`],palette:F.softPop},{id:`acoustic-mornings`,title:`Acoustic Mornings`,description:`A gentle start in wood, wire, and sunlight`,curator:`Atom Editorial`,trackIds:[`velvet-morning`,`coffee-stains`,`paper-moons`,`golden-lines`,`tides-in-reverse`],palette:F.morningLight},{id:`deep-focus`,title:`Deep Focus`,description:`Ambient textures for long stretches of concentration`,curator:`Atom Editorial`,trackIds:[`quiet-current`,`soft-static`,`midnight-orchard`,`city-rain`,`tides-in-reverse`],palette:F.deepFocus},{id:`slow-sundays`,title:`Slow Sundays`,description:`Stay in, breathe out, let the afternoon drift`,curator:`For your mood`,trackIds:[`slow-motion`,`paper-moons`,`coffee-stains`,`quiet-current`,`velvet-morning`],palette:F.sundayReset},{id:`city-after-dark`,title:`City After Dark`,description:`Streetlights, reflections, and midnight motion`,curator:`For your mood`,trackIds:[`city-rain`,`after-hours-drive`,`neon-skyline`,`soft-static`,`signal-fires`],palette:F.nightDrive},{id:`morning-light`,title:`Morning Light`,description:`Optimistic songs for opening the curtains`,curator:`For your mood`,trackIds:[`velvet-morning`,`golden-lines`,`open-windows`,`blue-hour`,`coffee-stains`],palette:F.morningLight},{id:`headphones-on`,title:`Headphones On`,description:`Detailed production made for getting lost in`,curator:`For your mood`,trackIds:[`satellite-hearts`,`midnight-orchard`,`tides-in-reverse`,`blue-hour`,`soft-static`],palette:F.dreamingMono}],R=[{id:`made-for-you`,title:`Made for you`,description:`Personal mixes shaped around your listening`,playlistIds:[`daily-mix-one`,`daily-mix-two`,`daily-mix-three`,`discover-weekly`]},{id:`recently-played`,title:`Recently played`,playlistIds:[`coding-mode`,`night-drive`,`coffeehouse`,`sunday-reset`]},{id:`popular-playlists`,title:`Popular playlists`,playlistIds:[`neon-pulse`,`soft-pop`,`acoustic-mornings`,`deep-focus`]},{id:`mood-mixes`,title:`Mood mixes`,description:`Pick a soundtrack that meets you where you are`,playlistIds:[`slow-sundays`,`city-after-dark`,`morning-light`,`headphones-on`]}],z=[{id:`liked-songs`,title:`Liked Songs`,subtitle:`Playlist · 16 songs`,kind:`collection`,palette:F.liked,pinned:!0},{id:`library-coding-mode`,title:`Coding Mode`,subtitle:`Playlist · Spotify Atom`,kind:`playlist`,palette:F.coding,playlistId:`coding-mode`,pinned:!0},{id:`library-night-drive`,title:`Night Drive`,subtitle:`Playlist · Spotify Atom`,kind:`playlist`,palette:F.nightDrive,playlistId:`night-drive`},{id:`library-sunday-reset`,title:`Sunday Reset`,subtitle:`Playlist · Spotify Atom`,kind:`playlist`,palette:F.sundayReset,playlistId:`sunday-reset`},{id:`library-luma-coast`,title:`Luma Coast`,subtitle:`Artist`,kind:`artist`,palette:F.chromaticWeather},{id:`library-blue-hour`,title:`Northbound`,subtitle:`Album · Mira Lane`,kind:`album`,palette:F.blueHour},{id:`library-deep-focus`,title:`Deep Focus`,subtitle:`Playlist · Atom Editorial`,kind:`playlist`,palette:F.deepFocus,playlistId:`deep-focus`},{id:`library-nova-bloom`,title:`Nova Bloom`,subtitle:`Artist`,kind:`artist`,palette:F.orbiting}];function B(e){return e.kind===`track`?`track:${e.track.id}`:`playlist:${e.playlist.id}`}function V({activity:e,onClose:t,onSelectTrack:a,onSelectPlaylist:o}){let s=y(null),[c,l]=b(``),[u,d]=b(I),[f,_]=b(L.map(e=>({...e,trackCount:e.totalTracks??e.trackIds.length}))),[S,C]=b([]),[w,T]=b(!0),[E,D]=b(``),[O,k]=b(null),A=c.trim().toLocaleLowerCase(),j=`activity-tracks-${e.sessionId}`,M=v(()=>{let t=A?[...u.map(e=>({kind:`track`,track:e})),...f.map(e=>({kind:`playlist`,playlist:e}))]:S,n=new Set;return t.filter(t=>{if(t.kind===`track`&&t.track.id===e.titleId||A&&!(t.kind===`track`?[t.track.title,t.track.artist,t.track.album,t.track.provider]:[t.playlist.title,t.playlist.description,t.playlist.curator,t.playlist.provider]).filter(Boolean).some(e=>e?.toLocaleLowerCase().includes(A)))return!1;let r=B(t);return n.has(r)?!1:(n.add(r),!0)}).slice(0,A?void 0:10)},[e.titleId,A,f,S,u]),N=v(()=>L.map(e=>({...e,trackCount:e.totalTracks??e.trackIds.length})),[]);g(()=>{let e=document.activeElement instanceof HTMLElement?document.activeElement:null;return s.current?.focus(),()=>{e?.isConnected&&e.focus()}},[]),g(()=>{let t=new AbortController,n=`profileId=${encodeURIComponent(e.profileId)}`;return Promise.all([fetch(`/api/spotify/recently-played?${n}`,{cache:`no-store`,signal:t.signal}),fetch(`/api/spotify/tracks?${n}`,{cache:`no-store`,signal:t.signal}),fetch(`/api/spotify/playlists?${n}`,{cache:`no-store`,signal:t.signal})]).then(async([e,t,n])=>{let r=await e.json(),i=await t.json(),a=await n.json();if(!e.ok||!t.ok||!n.ok)throw Error(r.error||i.error||a.error||`Recently played music could not be loaded.`);let o=Array.isArray(i.tracks)?i.tracks:[],s=new Set(o.map(e=>e.id));d([...o,...I.filter(e=>!s.has(e.id))]);let c=Array.isArray(a.playlists)?a.playlists.map(e=>({id:e.id,title:e.title,description:e.description,curator:e.curator,trackCount:e.totalTracks??e.trackIds?.length??0,imageUrl:e.imageUrl,palette:e.palette,provider:e.provider})):[],l=new Set(c.map(e=>e.id));_([...c,...N.filter(e=>!l.has(e.id))]),C(Array.isArray(r.items)?r.items.slice(0,10):[])}).catch(e=>{t.signal.aborted||D(e instanceof Error?e.message:`Recently played music could not be loaded.`)}).finally(()=>{t.signal.aborted||T(!1)}),()=>t.abort()},[e.profileId,N]);let P=async e=>{let n=B(e);k(n),D(``);try{e.kind===`track`?await a(e.track):await o(e.playlist),t()}catch(e){D(e instanceof Error?e.message:`The music could not be switched.`),k(null)}};return x(m(`div`,{className:`activity-movie-search-overlay`,onMouseDown:e=>{e.target===e.currentTarget&&t()},onKeyDown:e=>{e.key===`Escape`&&(e.stopPropagation(),t())},children:h(`div`,{className:`activity-movie-search activity-track-search`,id:j,role:`dialog`,"aria-label":`Search another track for ${e.title}`,children:[h(`div`,{className:`activity-movie-search__header`,children:[h(`div`,{children:[m(`h3`,{children:`Switch music`}),h(`span`,{className:`activity-movie-search__now`,children:[`Now playing: `,e.title]})]}),m(`button`,{type:`button`,onClick:t,"aria-label":`Close track search`,children:m(r,{})})]}),h(`div`,{className:`activity-movie-search__field`,children:[m(i,{"aria-hidden":`true`}),m(`input`,{ref:s,type:`search`,value:c,onChange:e=>l(e.currentTarget.value),placeholder:`Search songs, artists, albums, and playlists`,"aria-label":`Search another track for ${e.title}`,autoComplete:`off`}),c&&m(`button`,{type:`button`,onClick:()=>{l(``),s.current?.focus()},"aria-label":`Clear track search`,children:m(r,{})})]}),m(`div`,{className:`activity-movie-search__heading`,children:m(`strong`,{children:A?`Search results`:`Recently played`})}),m(`p`,{className:`sr-only`,role:`status`,"aria-live":`polite`,children:O?`Switching from ${e.title}…`:w?`Loading recently played music…`:`${M.length} ${A?`search`:`recent`} ${M.length===1?`result`:`results`}.`}),E&&m(`p`,{className:`activity-movie-search__notice`,role:`alert`,children:E}),w?h(`div`,{className:`activity-movie-search__empty`,children:[m(n,{className:`spin`,"aria-hidden":`true`}),m(`span`,{children:`Loading recently played music…`})]}):M.length?m(`div`,{className:`activity-movie-search__results`,"aria-label":A?`Music search results`:`Recently played`,children:M.map(e=>{let t=B(e),r=e.kind===`track`?e.track:e.playlist;return h(`button`,{type:`button`,onClick:()=>void P(e),disabled:O!==null,"aria-label":e.kind===`track`?`Switch to ${e.track.title} by ${e.track.artist}`:`Switch to playlist ${e.playlist.title}`,children:[h(`span`,{className:`activity-movie-search__art activity-track-search__art`,style:r.imageUrl?{backgroundImage:`url(${JSON.stringify(r.imageUrl)})`}:r.palette?{backgroundImage:`linear-gradient(135deg, ${r.palette.from}, ${r.palette.to})`,color:r.palette.accent}:void 0,children:[!r.imageUrl&&m(`span`,{"aria-hidden":`true`,children:r.palette?.glyph??(e.kind===`playlist`?`☷`:`♫`)}),O===t&&m(n,{className:`spin`,"aria-hidden":`true`})]}),h(`span`,{className:`activity-movie-search__copy`,children:[m(`strong`,{children:r.title}),m(`small`,{children:e.kind===`track`?h(p,{children:[e.track.artist,m(`span`,{"aria-hidden":`true`,children:` · `}),e.track.album]}):h(p,{children:[`Playlist`,m(`span`,{"aria-hidden":`true`,children:` · `}),e.playlist.curator,m(`span`,{"aria-hidden":`true`,children:` · `}),e.playlist.trackCount,` `,e.playlist.trackCount===1?`song`:`songs`]})})]})]},t)})}):h(`div`,{className:`activity-movie-search__empty`,children:[m(i,{"aria-hidden":`true`}),m(`span`,{children:A?`No music found for “${c.trim()}”.`:`No recently played songs or playlists yet.`})]})]})}),document.body)}var H=e(`pin`,[[`path`,{d:`M12 17v5`,key:`bb1du9`}],[`path`,{d:`M9 10.76a2 2 0 0 1-1.11 1.79l-1.78.9A2 2 0 0 0 5 15.24V16a1 1 0 0 0 1 1h12a1 1 0 0 0 1-1v-.76a2 2 0 0 0-1.11-1.79l-1.78-.9A2 2 0 0 1 15 10.76V7a1 1 0 0 1 1-1 2 2 0 0 0 0-4H8a2 2 0 0 0 0 4 1 1 0 0 1 1 1z`,key:`1nkz8b`}]]);export{C as _,R as a,P as c,k as d,O as f,w as g,T as h,z as i,j as l,E as m,V as n,L as o,D as p,F as r,I as s,H as t,A as u,S as v};
1
+ import{n as e}from"./chevron-left-CkBJG8E2.js";import{a as t,c as n,f as r,g as i,h as a,i as o,l as s,m as c,n as l,o as u,r as d,v as f}from"./refresh-cw-DNvHlOAy.js";import{Fragment as p,jsx as m,jsxs as h}from"react/jsx-runtime";import{useEffect as g,useId as _,useMemo as v,useRef as y,useState as b}from"react";import{createPortal as x}from"react-dom";var S=e(`arrow-right`,[[`path`,{d:`M5 12h14`,key:`1ays0h`}],[`path`,{d:`m12 5 7 7-7 7`,key:`xquz4c`}]]),C=e(`heart`,[[`path`,{d:`M2 9.5a5.5 5.5 0 0 1 9.591-3.676.56.56 0 0 0 .818 0A5.49 5.49 0 0 1 22 9.5c0 2.29-1.5 4-3 5.5l-5.492 5.313a2 2 0 0 1-3 .019L5 15c-1.5-1.5-3-3.2-3-5.5`,key:`mvr1a0`}]]),w=e(`laptop`,[[`path`,{d:`M18 5a2 2 0 0 1 2 2v8.526a2 2 0 0 0 .212.897l1.068 2.127a1 1 0 0 1-.9 1.45H3.62a1 1 0 0 1-.9-1.45l1.068-2.127A2 2 0 0 0 4 15.526V7a2 2 0 0 1 2-2z`,key:`1pdavp`}],[`path`,{d:`M20.054 15.987H3.946`,key:`14rxg9`}]]),T=e(`monitor`,[[`rect`,{width:`20`,height:`14`,x:`2`,y:`3`,rx:`2`,key:`48i651`}],[`line`,{x1:`8`,x2:`16`,y1:`21`,y2:`21`,key:`1svkeh`}],[`line`,{x1:`12`,x2:`12`,y1:`17`,y2:`21`,key:`vw1qmm`}]]),E=e(`smartphone`,[[`rect`,{width:`14`,height:`20`,x:`5`,y:`2`,rx:`2`,ry:`2`,key:`1yt0o3`}],[`path`,{d:`M12 18h.01`,key:`mhygvu`}]]),D=e(`sparkles`,[[`path`,{d:`M11.017 2.814a1 1 0 0 1 1.966 0l1.051 5.558a2 2 0 0 0 1.594 1.594l5.558 1.051a1 1 0 0 1 0 1.966l-5.558 1.051a2 2 0 0 0-1.594 1.594l-1.051 5.558a1 1 0 0 1-1.966 0l-1.051-5.558a2 2 0 0 0-1.594-1.594l-5.558-1.051a1 1 0 0 1 0-1.966l5.558-1.051a2 2 0 0 0 1.594-1.594z`,key:`1s2grr`}],[`path`,{d:`M20 2v4`,key:`1rf3ol`}],[`path`,{d:`M22 4h-4`,key:`gwowj6`}],[`circle`,{cx:`4`,cy:`20`,r:`2`,key:`6kqj1y`}]]),O=e(`tablet`,[[`rect`,{width:`16`,height:`20`,x:`4`,y:`2`,rx:`2`,ry:`2`,key:`76otgf`}],[`line`,{x1:`12`,x2:`12.01`,y1:`18`,y2:`18`,key:`1dp563`}]]),k=e(`circle-alert`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`line`,{x1:`12`,x2:`12`,y1:`8`,y2:`12`,key:`1pkeuh`}],[`line`,{x1:`12`,x2:`12.01`,y1:`16`,y2:`16`,key:`4dfq90`}]]);function A({profiles:e,activeProfile:t,onSelectProfile:r,onProfilesChanged:i}){let a=y(null),o=y(null),c=y(null),l=_(),[d,v]=b(!1),[S,C]=b(!1),[w,T]=b(null),[E,D]=b(``);g(()=>{if(!d)return;let e=window.requestAnimationFrame(()=>{c.current?.querySelector(`[role="menuitemradio"]:not(:disabled), [role="menuitem"]`)?.focus()}),t=e=>{e.target instanceof Node&&!a.current?.contains(e.target)&&v(!1)},n=e=>{e.key===`Escape`&&(e.preventDefault(),v(!1),o.current?.focus())};return document.addEventListener(`pointerdown`,t),document.addEventListener(`keydown`,n),()=>{window.cancelAnimationFrame(e),document.removeEventListener(`pointerdown`,t),document.removeEventListener(`keydown`,n)}},[d]);let O=e=>{e.relatedTarget instanceof Node&&a.current?.contains(e.relatedTarget)||v(!1)},k=e=>{if(e.key!==`ArrowDown`&&e.key!==`ArrowUp`&&e.key!==`Home`&&e.key!==`End`)return;let t=Array.from(c.current?.querySelectorAll(`[role="menuitemradio"]:not(:disabled), [role="menuitem"]`)??[]);if(!t.length)return;e.preventDefault();let n=t.findIndex(e=>e===document.activeElement),r=0;e.key===`End`?r=t.length-1:e.key===`ArrowUp`?r=n<=0?t.length-1:Math.max(0,n-1):e.key===`ArrowDown`&&(r=n<0||n===t.length-1?0:n+1),t[r]?.focus()},A=async e=>{if(!w){if(e.id===t.id){v(!1),o.current?.focus();return}D(``),T(e.id);try{await r(e),v(!1),o.current?.focus()}catch{D(`Profile could not be selected. Please try again.`)}finally{T(null)}}};return h(p,{children:[h(`div`,{className:`store-profile-menu`,ref:a,onBlur:O,children:[h(`button`,{className:`store-profile-trigger`,ref:o,type:`button`,"aria-label":`Profile: ${t.name}. Open profile menu`,"aria-haspopup":`menu`,"aria-expanded":d,"aria-controls":d?l:void 0,onClick:()=>{D(``),v(e=>!e)},onKeyDown:e=>{e.key!==`ArrowDown`&&e.key!==`ArrowUp`||(e.preventDefault(),D(``),v(!0))},children:[h(`span`,{className:`store-profile-avatar`,"aria-hidden":`true`,style:{backgroundColor:t.avatarColor},children:[m(`span`,{}),m(`span`,{}),m(`span`,{})]}),m(s,{className:`store-profile-chevron${d?` store-profile-chevron--open`:``}`,"aria-hidden":`true`})]}),d&&h(`div`,{className:`store-profile-popover`,id:l,ref:c,role:`menu`,"aria-label":`Choose a Netflix profile`,"aria-busy":w!==null,onKeyDown:k,children:[m(`span`,{className:`store-profile-caret`,"aria-hidden":`true`}),m(`div`,{className:`store-profile-options`,children:e.map(e=>{let n=e.id===t.id,r=e.id===w;return h(`button`,{className:`store-profile-option`,type:`button`,role:`menuitemradio`,"aria-checked":n,disabled:w!==null,onClick:()=>void A(e),children:[m(`span`,{className:`store-profile-mini-avatar`,style:{backgroundColor:e.avatarColor},"aria-hidden":`true`,children:e.name.slice(0,1).toUpperCase()}),h(`span`,{className:`store-profile-name`,children:[e.name,r?` — switching…`:``]}),n&&m(f,{className:`store-profile-active-check`,"aria-hidden":`true`})]},e.id)})}),h(`button`,{className:`store-profile-manage`,type:`button`,role:`menuitem`,onClick:()=>{v(!1),C(!0)},children:[m(n,{"aria-hidden":`true`}),m(`span`,{children:`Manage profile`})]}),E&&m(`p`,{className:`store-profile-error`,role:`alert`,children:E})]})]}),S&&x(m(u,{profiles:[...e],activeProfile:t,onClose:()=>{C(!1),window.requestAnimationFrame(()=>o.current?.focus())},onProfilesChanged:i}),document.body)]})}var j=e(`skip-back`,[[`path`,{d:`M17.971 4.285A2 2 0 0 1 21 6v12a2 2 0 0 1-3.029 1.715l-9.997-5.998a2 2 0 0 1-.003-3.432z`,key:`15892j`}],[`path`,{d:`M3 20V4`,key:`1ptbpl`}]]);function M({type:e}){switch(e){case`phone`:return m(E,{"aria-hidden":`true`});case`tablet`:return m(O,{"aria-hidden":`true`});case`laptop`:return m(w,{"aria-hidden":`true`});default:return m(T,{"aria-hidden":`true`})}}function N(e){let t=Math.max(0,Math.floor(e)),n=Math.floor(t/3600),r=Math.floor(t%3600/60),i=t%60;return n?`${n}:${String(r).padStart(2,`0`)}:${String(i).padStart(2,`0`)}`:`${r}:${String(i).padStart(2,`0`)}`}function P({activity:e,tabLabel:n,searchOpen:r,onSearchToggle:s,onCommand:c}){let[u,f]=b(null),p=Math.max(1,Math.round(e.duration)),g=Math.max(0,Math.min(p,Math.round(u??e.currentTime))),_=e.duration>0?Math.max(0,Math.min(100,g/e.duration*100)):0,v=Math.round(e.volume*100),y=t=>{let n=Math.max(0,Math.min(e.duration,Math.round(t)));f(null),c({type:`seek-to`,seconds:n})};return h(`article`,{className:`activity-card activity-card--spotify`,"aria-label":`${e.title} playback in ${n}`,style:{"--activity-artwork":`url("${e.artwork}")`},children:[h(`div`,{className:`activity-card__art`,children:[h(`div`,{className:`activity-card__source`,children:[h(`span`,{className:`activity-spotify-mark`,"aria-label":`Spotify`,children:[m(`i`,{}),m(`i`,{}),m(`i`,{})]}),h(`span`,{className:`activity-live`,children:[m(`i`,{"aria-hidden":`true`}),m(M,{type:e.deviceType}),n]})]}),h(`div`,{className:`activity-card__copy`,children:[m(`span`,{children:`Now listening`}),m(`h3`,{children:e.title}),h(`p`,{children:[e.artist,m(`span`,{"aria-hidden":`true`,children:` · `}),e.album]})]})]}),h(`div`,{className:`activity-card__remote`,children:[m(`input`,{className:`activity-progress`,type:`range`,min:0,max:p,step:1,value:g,disabled:e.duration<=0,"aria-label":`${e.title} progress`,"aria-valuetext":`${N(g)} of ${N(e.duration)}`,title:`Seek ${e.title}`,style:{"--activity-progress":`${_}%`},onChange:e=>f(Number(e.currentTarget.value)),onPointerUp:e=>y(Number(e.currentTarget.value)),onPointerCancel:()=>f(null),onKeyUp:e=>{(e.key===`ArrowLeft`||e.key===`ArrowRight`||e.key===`ArrowUp`||e.key===`ArrowDown`||e.key===`Home`||e.key===`End`||e.key===`PageUp`||e.key===`PageDown`)&&y(Number(e.currentTarget.value))},onBlur:e=>{u!==null&&y(Number(e.currentTarget.value))}}),h(`div`,{className:`activity-time`,children:[m(`time`,{children:N(g)}),m(`span`,{children:N(e.duration)})]}),h(`div`,{className:`activity-controls activity-controls--spotify`,role:`group`,"aria-label":`Controls for ${e.title} by ${e.artist}`,children:[m(`button`,{type:`button`,onClick:()=>c({type:`previous-track`}),"aria-label":`Previous track before ${e.title}`,children:m(j,{fill:`currentColor`})}),m(`button`,{type:`button`,onClick:()=>c({type:`set-paused`,paused:!e.paused}),"aria-label":`${e.paused?`Play`:`Pause`} ${e.title}`,children:e.paused?m(i,{fill:`currentColor`}):m(t,{fill:`currentColor`})}),m(`button`,{type:`button`,onClick:()=>c({type:`next-track`}),"aria-label":`Next track after ${e.title}`,children:m(o,{fill:`currentColor`})}),h(`div`,{className:`activity-volume`,children:[m(`button`,{type:`button`,onClick:()=>c({type:`set-muted`,muted:!e.muted}),"aria-label":`${e.muted?`Unmute`:`Mute`} ${e.title}`,"aria-pressed":e.muted,children:e.muted?m(l,{}):m(d,{})}),m(`input`,{type:`range`,min:0,max:100,step:1,value:v,style:{"--activity-volume":`${v}%`},onChange:e=>c({type:`set-volume`,volume:Number(e.currentTarget.value)/100}),"aria-label":`Volume for ${e.title}`,"aria-valuetext":e.muted?`Muted, level ${v}%`:`${v}%`})]}),m(`button`,{className:r?`is-active`:``,type:`button`,onClick:s,"aria-label":`Switch ${e.title} to another track`,"aria-expanded":r,"aria-controls":`activity-tracks-${e.sessionId}`,children:m(a,{})})]})]})]})}var F={chromaticWeather:{from:`#3659f7`,to:`#ed5b98`,accent:`#d9f8ff`,glyph:`✦`},stillFrames:{from:`#d16b5d`,to:`#4a1f35`,accent:`#ffe4c7`,glyph:`◌`},parallelStreets:{from:`#121c3d`,to:`#af2f78`,accent:`#65e4ff`,glyph:`//`},blueHour:{from:`#204b78`,to:`#9b6db2`,accent:`#d9edff`,glyph:`◐`},orbiting:{from:`#322063`,to:`#e34f86`,accent:`#f5d5ff`,glyph:`◎`},smallHours:{from:`#b66a35`,to:`#2b483b`,accent:`#ffe3a8`,glyph:`☕`},lowTide:{from:`#22676c`,to:`#102e46`,accent:`#b7f5df`,glyph:`≈`},dreamingMono:{from:`#3c3d42`,to:`#8e718f`,accent:`#f2ebd9`,glyph:`◇`},liked:{from:`#3f2db8`,to:`#8ed8c8`,accent:`#ffffff`,glyph:`♥`},coding:{from:`#083d35`,to:`#151d28`,accent:`#53f2b0`,glyph:`</>`},nightDrive:{from:`#15152f`,to:`#7b205d`,accent:`#ff6cc7`,glyph:`☾`},coffeehouse:{from:`#9d5c3e`,to:`#2e2924`,accent:`#ffd59d`,glyph:`AM`},sundayReset:{from:`#d9846a`,to:`#687c67`,accent:`#fff0d2`,glyph:`SUN`},neonPulse:{from:`#4d1ec9`,to:`#e31f74`,accent:`#67f6da`,glyph:`N`},softPop:{from:`#e995b5`,to:`#8e70c9`,accent:`#fff1b8`,glyph:`POP`},deepFocus:{from:`#174d4b`,to:`#18233e`,accent:`#79d6bb`,glyph:`∞`},morningLight:{from:`#ee9b52`,to:`#f0cf78`,accent:`#4e3628`,glyph:`✺`}},I=[{id:`neon-skyline`,title:`Neon Skyline`,artist:`Luma Coast`,album:`Chromatic Weather`,durationSec:224,palette:F.chromaticWeather},{id:`open-windows`,title:`Open Windows`,artist:`Luma Coast`,album:`Chromatic Weather`,durationSec:197,palette:F.chromaticWeather},{id:`slow-motion`,title:`Slow Motion`,artist:`Arlo Vale`,album:`Still Frames`,durationSec:208,palette:F.stillFrames},{id:`paper-moons`,title:`Paper Moons`,artist:`Arlo Vale`,album:`Still Frames`,durationSec:186,palette:F.stillFrames},{id:`after-hours-drive`,title:`After Hours Drive`,artist:`Night Atlas`,album:`Parallel Streets`,durationSec:251,palette:F.parallelStreets},{id:`city-rain`,title:`City Rain`,artist:`Night Atlas`,album:`Parallel Streets`,durationSec:239,palette:F.parallelStreets},{id:`blue-hour`,title:`Blue Hour`,artist:`Mira Lane`,album:`Northbound`,durationSec:216,palette:F.blueHour},{id:`velvet-morning`,title:`Velvet Morning`,artist:`Mira Lane`,album:`Northbound`,durationSec:203,palette:F.blueHour},{id:`satellite-hearts`,title:`Satellite Hearts`,artist:`Nova Bloom`,album:`Orbiting`,durationSec:232,palette:F.orbiting},{id:`signal-fires`,title:`Signal Fires`,artist:`Nova Bloom`,album:`Orbiting`,durationSec:245,palette:F.orbiting},{id:`coffee-stains`,title:`Coffee Stains`,artist:`The Daylights`,album:`Small Hours`,durationSec:194,palette:F.smallHours},{id:`golden-lines`,title:`Golden Lines`,artist:`The Daylights`,album:`Small Hours`,durationSec:211,palette:F.smallHours},{id:`quiet-current`,title:`Quiet Current`,artist:`Elio Pines`,album:`Low Tide Letters`,durationSec:263,palette:F.lowTide},{id:`tides-in-reverse`,title:`Tides in Reverse`,artist:`Elio Pines`,album:`Low Tide Letters`,durationSec:228,palette:F.lowTide},{id:`soft-static`,title:`Soft Static`,artist:`Static Garden`,album:`Dreaming in Mono`,durationSec:274,palette:F.dreamingMono},{id:`midnight-orchard`,title:`Midnight Orchard`,artist:`Static Garden`,album:`Dreaming in Mono`,durationSec:257,palette:F.dreamingMono}],L=[{id:`daily-mix-one`,title:`Daily Mix 01`,description:`Luma Coast, Nova Bloom, Mira Lane and more`,curator:`Spotify Atom`,trackIds:[`neon-skyline`,`satellite-hearts`,`blue-hour`,`open-windows`,`signal-fires`],palette:F.chromaticWeather},{id:`daily-mix-two`,title:`Daily Mix 02`,description:`Night Atlas, Static Garden, Elio Pines and more`,curator:`Spotify Atom`,trackIds:[`after-hours-drive`,`soft-static`,`city-rain`,`quiet-current`,`midnight-orchard`],palette:F.parallelStreets},{id:`daily-mix-three`,title:`Daily Mix 03`,description:`Arlo Vale, The Daylights, Mira Lane and more`,curator:`Spotify Atom`,trackIds:[`slow-motion`,`coffee-stains`,`velvet-morning`,`paper-moons`,`golden-lines`],palette:F.stillFrames},{id:`discover-weekly`,title:`Discover Weekly`,description:`A fresh collection picked for your week`,curator:`Spotify Atom`,trackIds:[`tides-in-reverse`,`signal-fires`,`open-windows`,`midnight-orchard`,`golden-lines`],palette:F.orbiting},{id:`coding-mode`,title:`Coding Mode`,description:`Steady electronic focus without the distractions`,curator:`Spotify Atom`,trackIds:[`soft-static`,`quiet-current`,`midnight-orchard`,`tides-in-reverse`,`city-rain`],palette:F.coding},{id:`night-drive`,title:`Night Drive`,description:`Glowing synths for roads after dark`,curator:`Spotify Atom`,trackIds:[`after-hours-drive`,`neon-skyline`,`city-rain`,`satellite-hearts`,`signal-fires`],palette:F.nightDrive},{id:`coffeehouse`,title:`Coffeehouse`,description:`Warm voices, soft strings, unhurried mornings`,curator:`Spotify Atom`,trackIds:[`coffee-stains`,`slow-motion`,`paper-moons`,`velvet-morning`,`golden-lines`],palette:F.coffeehouse},{id:`sunday-reset`,title:`Sunday Reset`,description:`Easy songs for a slower kind of day`,curator:`Spotify Atom`,trackIds:[`velvet-morning`,`open-windows`,`coffee-stains`,`quiet-current`,`paper-moons`],palette:F.sundayReset},{id:`neon-pulse`,title:`Neon Pulse`,description:`Electric color and late-night momentum`,curator:`Atom Editorial`,trackIds:[`neon-skyline`,`satellite-hearts`,`after-hours-drive`,`signal-fires`,`soft-static`],palette:F.neonPulse},{id:`soft-pop`,title:`Soft Pop`,description:`Bright hooks with all the edges smoothed out`,curator:`Atom Editorial`,trackIds:[`blue-hour`,`open-windows`,`slow-motion`,`satellite-hearts`,`golden-lines`],palette:F.softPop},{id:`acoustic-mornings`,title:`Acoustic Mornings`,description:`A gentle start in wood, wire, and sunlight`,curator:`Atom Editorial`,trackIds:[`velvet-morning`,`coffee-stains`,`paper-moons`,`golden-lines`,`tides-in-reverse`],palette:F.morningLight},{id:`deep-focus`,title:`Deep Focus`,description:`Ambient textures for long stretches of concentration`,curator:`Atom Editorial`,trackIds:[`quiet-current`,`soft-static`,`midnight-orchard`,`city-rain`,`tides-in-reverse`],palette:F.deepFocus},{id:`slow-sundays`,title:`Slow Sundays`,description:`Stay in, breathe out, let the afternoon drift`,curator:`For your mood`,trackIds:[`slow-motion`,`paper-moons`,`coffee-stains`,`quiet-current`,`velvet-morning`],palette:F.sundayReset},{id:`city-after-dark`,title:`City After Dark`,description:`Streetlights, reflections, and midnight motion`,curator:`For your mood`,trackIds:[`city-rain`,`after-hours-drive`,`neon-skyline`,`soft-static`,`signal-fires`],palette:F.nightDrive},{id:`morning-light`,title:`Morning Light`,description:`Optimistic songs for opening the curtains`,curator:`For your mood`,trackIds:[`velvet-morning`,`golden-lines`,`open-windows`,`blue-hour`,`coffee-stains`],palette:F.morningLight},{id:`headphones-on`,title:`Headphones On`,description:`Detailed production made for getting lost in`,curator:`For your mood`,trackIds:[`satellite-hearts`,`midnight-orchard`,`tides-in-reverse`,`blue-hour`,`soft-static`],palette:F.dreamingMono}],R=[{id:`made-for-you`,title:`Made for you`,description:`Personal mixes shaped around your listening`,playlistIds:[`daily-mix-one`,`daily-mix-two`,`daily-mix-three`,`discover-weekly`]},{id:`recently-played`,title:`Recently played`,playlistIds:[`coding-mode`,`night-drive`,`coffeehouse`,`sunday-reset`]},{id:`popular-playlists`,title:`Popular playlists`,playlistIds:[`neon-pulse`,`soft-pop`,`acoustic-mornings`,`deep-focus`]},{id:`mood-mixes`,title:`Mood mixes`,description:`Pick a soundtrack that meets you where you are`,playlistIds:[`slow-sundays`,`city-after-dark`,`morning-light`,`headphones-on`]}],z=[{id:`liked-songs`,title:`Liked Songs`,subtitle:`Playlist · 16 songs`,kind:`collection`,palette:F.liked,pinned:!0},{id:`library-coding-mode`,title:`Coding Mode`,subtitle:`Playlist · Spotify Atom`,kind:`playlist`,palette:F.coding,playlistId:`coding-mode`,pinned:!0},{id:`library-night-drive`,title:`Night Drive`,subtitle:`Playlist · Spotify Atom`,kind:`playlist`,palette:F.nightDrive,playlistId:`night-drive`},{id:`library-sunday-reset`,title:`Sunday Reset`,subtitle:`Playlist · Spotify Atom`,kind:`playlist`,palette:F.sundayReset,playlistId:`sunday-reset`},{id:`library-luma-coast`,title:`Luma Coast`,subtitle:`Artist`,kind:`artist`,palette:F.chromaticWeather},{id:`library-blue-hour`,title:`Northbound`,subtitle:`Album · Mira Lane`,kind:`album`,palette:F.blueHour},{id:`library-deep-focus`,title:`Deep Focus`,subtitle:`Playlist · Atom Editorial`,kind:`playlist`,palette:F.deepFocus,playlistId:`deep-focus`},{id:`library-nova-bloom`,title:`Nova Bloom`,subtitle:`Artist`,kind:`artist`,palette:F.orbiting}];function B(e){return e.kind===`track`?`track:${e.track.id}`:`playlist:${e.playlist.id}`}function V({activity:e,onClose:t,onSelectTrack:n,onSelectPlaylist:i}){let o=y(null),[s,l]=b(``),[u,d]=b(I),[f,_]=b(L.map(e=>({...e,trackCount:e.totalTracks??e.trackIds.length}))),[S,C]=b([]),[w,T]=b(!0),[E,D]=b(``),[O,k]=b(null),A=s.trim().toLocaleLowerCase(),j=`activity-tracks-${e.sessionId}`,M=v(()=>{let t=A?[...u.map(e=>({kind:`track`,track:e})),...f.map(e=>({kind:`playlist`,playlist:e}))]:S,n=new Set;return t.filter(t=>{if(t.kind===`track`&&t.track.id===e.titleId||A&&!(t.kind===`track`?[t.track.title,t.track.artist,t.track.album,t.track.provider]:[t.playlist.title,t.playlist.description,t.playlist.curator,t.playlist.provider]).filter(Boolean).some(e=>e?.toLocaleLowerCase().includes(A)))return!1;let r=B(t);return n.has(r)?!1:(n.add(r),!0)}).slice(0,A?void 0:10)},[e.titleId,A,f,S,u]),N=v(()=>L.map(e=>({...e,trackCount:e.totalTracks??e.trackIds.length})),[]);g(()=>{let e=document.activeElement instanceof HTMLElement?document.activeElement:null;return o.current?.focus(),()=>{e?.isConnected&&e.focus()}},[]),g(()=>{let t=new AbortController,n=`profileId=${encodeURIComponent(e.profileId)}`;return Promise.all([fetch(`/api/spotify/recently-played?${n}`,{cache:`no-store`,signal:t.signal}),fetch(`/api/spotify/tracks?${n}`,{cache:`no-store`,signal:t.signal}),fetch(`/api/spotify/playlists?${n}`,{cache:`no-store`,signal:t.signal})]).then(async([e,t,n])=>{let r=await e.json(),i=await t.json(),a=await n.json();if(!e.ok||!t.ok||!n.ok)throw Error(r.error||i.error||a.error||`Recently played music could not be loaded.`);let o=Array.isArray(i.tracks)?i.tracks:[],s=new Set(o.map(e=>e.id));d([...o,...I.filter(e=>!s.has(e.id))]);let c=Array.isArray(a.playlists)?a.playlists.map(e=>({id:e.id,title:e.title,description:e.description,curator:e.curator,trackCount:e.totalTracks??e.trackIds?.length??0,imageUrl:e.imageUrl,palette:e.palette,provider:e.provider})):[],l=new Set(c.map(e=>e.id));_([...c,...N.filter(e=>!l.has(e.id))]),C(Array.isArray(r.items)?r.items.slice(0,10):[])}).catch(e=>{t.signal.aborted||D(e instanceof Error?e.message:`Recently played music could not be loaded.`)}).finally(()=>{t.signal.aborted||T(!1)}),()=>t.abort()},[e.profileId,N]);let P=async e=>{let r=B(e);k(r),D(``);try{e.kind===`track`?await n(e.track):await i(e.playlist),t()}catch(e){D(e instanceof Error?e.message:`The music could not be switched.`),k(null)}};return x(m(`div`,{className:`activity-movie-search-overlay`,onMouseDown:e=>{e.target===e.currentTarget&&t()},onKeyDown:e=>{e.key===`Escape`&&(e.stopPropagation(),t())},children:h(`div`,{className:`activity-movie-search activity-track-search`,id:j,role:`dialog`,"aria-label":`Search another track for ${e.title}`,children:[h(`div`,{className:`activity-movie-search__header`,children:[h(`div`,{children:[m(`h3`,{children:`Switch music`}),h(`span`,{className:`activity-movie-search__now`,children:[`Now playing: `,e.title]})]}),m(`button`,{type:`button`,onClick:t,"aria-label":`Close track search`,children:m(c,{})})]}),h(`div`,{className:`activity-movie-search__field`,children:[m(a,{"aria-hidden":`true`}),m(`input`,{ref:o,type:`search`,value:s,onChange:e=>l(e.currentTarget.value),placeholder:`Search songs, artists, albums, and playlists`,"aria-label":`Search another track for ${e.title}`,autoComplete:`off`}),s&&m(`button`,{type:`button`,onClick:()=>{l(``),o.current?.focus()},"aria-label":`Clear track search`,children:m(c,{})})]}),m(`div`,{className:`activity-movie-search__heading`,children:m(`strong`,{children:A?`Search results`:`Recently played`})}),m(`p`,{className:`sr-only`,role:`status`,"aria-live":`polite`,children:O?`Switching from ${e.title}…`:w?`Loading recently played music…`:`${M.length} ${A?`search`:`recent`} ${M.length===1?`result`:`results`}.`}),E&&m(`p`,{className:`activity-movie-search__notice`,role:`alert`,children:E}),w?h(`div`,{className:`activity-movie-search__empty`,children:[m(r,{className:`spin`,"aria-hidden":`true`}),m(`span`,{children:`Loading recently played music…`})]}):M.length?m(`div`,{className:`activity-movie-search__results`,"aria-label":A?`Music search results`:`Recently played`,children:M.map(e=>{let t=B(e),n=e.kind===`track`?e.track:e.playlist;return h(`button`,{type:`button`,onClick:()=>void P(e),disabled:O!==null,"aria-label":e.kind===`track`?`Switch to ${e.track.title} by ${e.track.artist}`:`Switch to playlist ${e.playlist.title}`,children:[h(`span`,{className:`activity-movie-search__art activity-track-search__art`,style:n.imageUrl?{backgroundImage:`url(${JSON.stringify(n.imageUrl)})`}:n.palette?{backgroundImage:`linear-gradient(135deg, ${n.palette.from}, ${n.palette.to})`,color:n.palette.accent}:void 0,children:[!n.imageUrl&&m(`span`,{"aria-hidden":`true`,children:n.palette?.glyph??(e.kind===`playlist`?`☷`:`♫`)}),O===t&&m(r,{className:`spin`,"aria-hidden":`true`})]}),h(`span`,{className:`activity-movie-search__copy`,children:[m(`strong`,{children:n.title}),m(`small`,{children:e.kind===`track`?h(p,{children:[e.track.artist,m(`span`,{"aria-hidden":`true`,children:` · `}),e.track.album]}):h(p,{children:[`Playlist`,m(`span`,{"aria-hidden":`true`,children:` · `}),e.playlist.curator,m(`span`,{"aria-hidden":`true`,children:` · `}),e.playlist.trackCount,` `,e.playlist.trackCount===1?`song`:`songs`]})})]})]},t)})}):h(`div`,{className:`activity-movie-search__empty`,children:[m(a,{"aria-hidden":`true`}),m(`span`,{children:A?`No music found for “${s.trim()}”.`:`No recently played songs or playlists yet.`})]})]})}),document.body)}var H=e(`pin`,[[`path`,{d:`M12 17v5`,key:`bb1du9`}],[`path`,{d:`M9 10.76a2 2 0 0 1-1.11 1.79l-1.78.9A2 2 0 0 0 5 15.24V16a1 1 0 0 0 1 1h12a1 1 0 0 0 1-1v-.76a2 2 0 0 0-1.11-1.79l-1.78-.9A2 2 0 0 1 15 10.76V7a1 1 0 0 1 1-1 2 2 0 0 0 0-4H8a2 2 0 0 0 0 4 1 1 0 0 1 1 1z`,key:`1nkz8b`}]]);export{C as _,R as a,P as c,k as d,O as f,w as g,T as h,z as i,j as l,E as m,V as n,L as o,D as p,F as r,I as s,H as t,A as u,S as v};
@@ -0,0 +1 @@
1
+ import{n as e}from"./chevron-left-CkBJG8E2.js";var t=e(`bell`,[[`path`,{d:`M10.268 21a2 2 0 0 0 3.464 0`,key:`vwvbt9`}],[`path`,{d:`M3.262 15.326A1 1 0 0 0 4 17h16a1 1 0 0 0 .74-1.673C19.41 13.956 18 12.499 18 8A6 6 0 0 0 6 8c0 4.499-1.411 5.956-2.738 7.326`,key:`11g9vi`}]]),n=e(`database`,[[`ellipse`,{cx:`12`,cy:`5`,rx:`9`,ry:`3`,key:`msslwz`}],[`path`,{d:`M3 5V19A9 3 0 0 0 21 19V5`,key:`1wlel7`}],[`path`,{d:`M3 12A9 3 0 0 0 21 12`,key:`mv7ke4`}]]),r=e(`download`,[[`path`,{d:`M12 15V3`,key:`m9g1x1`}],[`path`,{d:`M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4`,key:`ih7n3h`}],[`path`,{d:`m7 10 5 5 5-5`,key:`brsn70`}]]),i=e(`link-2`,[[`path`,{d:`M9 17H7A5 5 0 0 1 7 7h2`,key:`8i5ue5`}],[`path`,{d:`M15 7h2a5 5 0 1 1 0 10h-2`,key:`1b9ql8`}],[`line`,{x1:`8`,x2:`16`,y1:`12`,y2:`12`,key:`1jonct`}]]);function a(){if(typeof navigator>`u`)return`unknown`;let e=navigator.userAgent;return/android/i.test(e)?/Mobile/i.test(e)?`phone`:`tablet`:/iPad/i.test(e)||/Macintosh/i.test(e)&&`ontouchend`in document?`tablet`:/iPhone|iPod/i.test(e)?`phone`:/Macintosh|Mac OS X/i.test(e)||/CrOS/i.test(e)?`laptop`:/Windows/i.test(e)||/Linux/i.test(e)?`desktop`:`unknown`}function o(){if(typeof navigator>`u`)return`Unknown`;let e=navigator.userAgent;if(/android/i.test(e)){let t=e.match(/;\s*([^;)]+)\s+Build\//);return t?t[1].trim():`Android`}return/iPad/i.test(e)||/Macintosh/i.test(e)&&`ontouchend`in document?`iPad`:/iPhone/i.test(e)?`iPhone`:/iPod/i.test(e)?`iPod`:/Windows/i.test(e)?`Windows PC`:/Macintosh|Mac OS X/i.test(e)?`Mac`:/CrOS/i.test(e)?`Chromebook`:/Linux/i.test(e)?`Linux PC`:`Unknown`}var s=1e3,c=0;function l(){let e=globalThis.crypto;return typeof e?.randomUUID==`function`?e.randomUUID():(c+=1,[`playback`,Date.now().toString(36),c.toString(36),Math.random().toString(36).slice(2)].join(`-`))}function u(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function d(e){return typeof e==`string`&&e.trim().length>0}function f(e){return typeof e==`number`&&Number.isFinite(e)}function p(e){return f(e)&&e>=0}function m(e){return Number.isInteger(e)&&typeof e==`number`&&e>0}function h(e){return f(e)&&e>=0&&e<=1}function g(e){return u(e)&&m(e.season)&&m(e.number)&&d(e.title)}function _(e){return u(e)&&typeof e.available==`boolean`&&typeof e.captionsOn==`boolean`&&f(e.fontSize)&&e.fontSize>=18&&e.fontSize<=64&&d(e.fontColor)&&d(e.backgroundColor)}function v(e){return u(e)&&d(e.sessionId)&&d(e.profileId)&&d(e.titleId)&&d(e.title)&&d(e.artwork)&&p(e.currentTime)&&p(e.duration)&&typeof e.paused==`boolean`&&typeof e.muted==`boolean`&&h(e.volume)&&p(e.updatedAt)?e.service===`spotify`?d(e.artist)&&d(e.album)&&(e.provider===void 0||d(e.provider)):(e.service===void 0||e.service===`netflix`)&&m(e.seasonNumber)&&m(e.episodeNumber)&&d(e.episodeTitle)&&Array.isArray(e.episodes)&&e.episodes.every(g)&&_(e.subtitles):!1}function y(e){if(!u(e)||typeof e.type!=`string`)return!1;switch(e.type){case`set-paused`:return typeof e.paused==`boolean`;case`seek-relative`:return f(e.seconds);case`seek-to`:return p(e.seconds);case`set-muted`:return typeof e.muted==`boolean`;case`set-volume`:return h(e.volume);case`previous-track`:case`next-track`:case`next-episode`:case`reset-subtitle-position`:return!0;case`select-episode`:return m(e.episodeNumber);case`switch-track`:return d(e.trackId);case`switch-playlist`:return d(e.playlistId);case`switch-title`:return d(e.titleId);case`set-captions`:return typeof e.enabled==`boolean`;case`set-subtitle-font-size`:return f(e.fontSize)&&e.fontSize>=18&&e.fontSize<=64;case`set-subtitle-font-color`:return d(e.color);case`set-subtitle-background`:return d(e.background);default:return!1}}function b(e){if(!u(e)||typeof e.kind!=`string`)return!1;switch(e.kind){case`announce`:return v(e.activity);case`command`:return d(e.sessionId)&&y(e.command);default:return!1}}function x(e){try{return b(e)}catch{return!1}}export{x as a,n as c,a as i,t as l,l as n,i as o,o as r,r as s,s as t};