chainlit 1.3.0rc0__py3-none-any.whl → 1.3.1__py3-none-any.whl

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.

Potentially problematic release.


This version of chainlit might be problematic. Click here for more details.

Files changed (49) hide show
  1. chainlit/auth.py +2 -0
  2. chainlit/context.py +4 -6
  3. chainlit/copilot/dist/index.js +252 -261
  4. chainlit/data/sql_alchemy.py +1 -1
  5. chainlit/frontend/dist/assets/DailyMotion-CwoOhIL8.js +1 -0
  6. chainlit/frontend/dist/assets/Facebook-BhnGXlzq.js +1 -0
  7. chainlit/frontend/dist/assets/FilePlayer-CPSVT6fz.js +1 -0
  8. chainlit/frontend/dist/assets/Kaltura-COYaLzsL.js +1 -0
  9. chainlit/frontend/dist/assets/Mixcloud-JdadNiQ5.js +1 -0
  10. chainlit/frontend/dist/assets/Mux-CBN7RO2u.js +1 -0
  11. chainlit/frontend/dist/assets/Preview-CxAFvvjV.js +1 -0
  12. chainlit/frontend/dist/assets/SoundCloud-JlgmASWm.js +1 -0
  13. chainlit/frontend/dist/assets/Streamable-CUWgr6Zw.js +1 -0
  14. chainlit/frontend/dist/assets/Twitch-BiN1HEDM.js +1 -0
  15. chainlit/frontend/dist/assets/Vidyard-qhPmrhDm.js +1 -0
  16. chainlit/frontend/dist/assets/Vimeo-CrZVSCaT.js +1 -0
  17. chainlit/frontend/dist/assets/Wistia-C891KrBP.js +1 -0
  18. chainlit/frontend/dist/assets/YouTube-DKjw5Hbn.js +1 -0
  19. chainlit/frontend/dist/assets/index-DLRdQOIx.js +723 -0
  20. chainlit/frontend/dist/assets/{react-plotly-39a45803.js → react-plotly-Dpmqg5Sy.js} +94 -94
  21. chainlit/frontend/dist/index.html +2 -3
  22. chainlit/oauth_providers.py +43 -9
  23. chainlit/openai/__init__.py +3 -5
  24. chainlit/server.py +20 -9
  25. chainlit/step.py +9 -17
  26. {chainlit-1.3.0rc0.dist-info → chainlit-1.3.1.dist-info}/METADATA +12 -4
  27. {chainlit-1.3.0rc0.dist-info → chainlit-1.3.1.dist-info}/RECORD +34 -34
  28. chainlit/frontend/dist/assets/DailyMotion-deaa038d.js +0 -1
  29. chainlit/frontend/dist/assets/Facebook-07c55425.js +0 -1
  30. chainlit/frontend/dist/assets/FilePlayer-2acc46b1.js +0 -1
  31. chainlit/frontend/dist/assets/Kaltura-c2689eb3.js +0 -1
  32. chainlit/frontend/dist/assets/Mixcloud-79d681a7.js +0 -1
  33. chainlit/frontend/dist/assets/Mux-549353dc.js +0 -1
  34. chainlit/frontend/dist/assets/Preview-000efdea.js +0 -1
  35. chainlit/frontend/dist/assets/SoundCloud-81b2bf43.js +0 -1
  36. chainlit/frontend/dist/assets/Streamable-032d3cc5.js +0 -1
  37. chainlit/frontend/dist/assets/Twitch-43744e0a.js +0 -1
  38. chainlit/frontend/dist/assets/Vidyard-4ac486dc.js +0 -1
  39. chainlit/frontend/dist/assets/Vimeo-7f1f7543.js +0 -1
  40. chainlit/frontend/dist/assets/Wistia-d0d070c9.js +0 -1
  41. chainlit/frontend/dist/assets/YouTube-8a2bf9cd.js +0 -1
  42. chainlit/frontend/dist/assets/index-a0fa87f1.js +0 -729
  43. /chainlit/copilot/dist/assets/{logo_dark-2a3cf740.svg → logo_dark-IkGJ_IwC.svg} +0 -0
  44. /chainlit/copilot/dist/assets/{logo_light-b078e7bc.svg → logo_light-Bb_IPh6r.svg} +0 -0
  45. /chainlit/frontend/dist/assets/{index-aaf974a9.css → index-CwmincdQ.css} +0 -0
  46. /chainlit/frontend/dist/assets/{logo_dark-2a3cf740.svg → logo_dark-IkGJ_IwC.svg} +0 -0
  47. /chainlit/frontend/dist/assets/{logo_light-b078e7bc.svg → logo_light-Bb_IPh6r.svg} +0 -0
  48. {chainlit-1.3.0rc0.dist-info → chainlit-1.3.1.dist-info}/WHEEL +0 -0
  49. {chainlit-1.3.0rc0.dist-info → chainlit-1.3.1.dist-info}/entry_points.txt +0 -0
@@ -21,11 +21,10 @@
21
21
  <script>
22
22
  const global = globalThis;
23
23
  </script>
24
- <script type="module" crossorigin src="/assets/index-a0fa87f1.js"></script>
25
- <link rel="stylesheet" href="/assets/index-aaf974a9.css">
24
+ <script type="module" crossorigin src="/assets/index-DLRdQOIx.js"></script>
25
+ <link rel="stylesheet" crossorigin href="/assets/index-CwmincdQ.css">
26
26
  </head>
27
27
  <body>
28
28
  <div id="root"></div>
29
-
30
29
  </body>
31
30
  </html>
@@ -16,6 +16,7 @@ class OAuthProvider:
16
16
  client_secret: str
17
17
  authorize_url: str
18
18
  authorize_params: Dict[str, str]
19
+ default_prompt: Optional[str] = None
19
20
 
20
21
  def is_configured(self):
21
22
  return all([os.environ.get(env) for env in self.env])
@@ -26,6 +27,21 @@ class OAuthProvider:
26
27
  async def get_user_info(self, token: str) -> Tuple[Dict[str, str], User]:
27
28
  raise NotImplementedError()
28
29
 
30
+ def get_env_prefix(self) -> str:
31
+ """Return environment prefix, like AZURE_AD."""
32
+
33
+ return self.id.replace("-", "_").upper()
34
+
35
+ def get_prompt(self) -> Optional[str]:
36
+ """Return OAuth prompt param."""
37
+ if prompt := os.environ.get(f"OAUTH_{self.get_env_prefix()}_PROMPT"):
38
+ return prompt
39
+
40
+ if prompt := os.environ.get("OAUTH_PROMPT"):
41
+ return prompt
42
+
43
+ return self.default_prompt
44
+
29
45
 
30
46
  class GithubOAuthProvider(OAuthProvider):
31
47
  id = "github"
@@ -37,9 +53,11 @@ class GithubOAuthProvider(OAuthProvider):
37
53
  self.client_secret = os.environ.get("OAUTH_GITHUB_CLIENT_SECRET")
38
54
  self.authorize_params = {
39
55
  "scope": "user:email",
40
- "prompt": "consent",
41
56
  }
42
57
 
58
+ if prompt := self.get_prompt():
59
+ self.authorize_params["prompt"] = prompt
60
+
43
61
  async def get_token(self, code: str, url: str):
44
62
  payload = {
45
63
  "client_id": self.client_id,
@@ -96,9 +114,11 @@ class GoogleOAuthProvider(OAuthProvider):
96
114
  "scope": "https://www.googleapis.com/auth/userinfo.profile https://www.googleapis.com/auth/userinfo.email",
97
115
  "response_type": "code",
98
116
  "access_type": "offline",
99
- "prompt": "login",
100
117
  }
101
118
 
119
+ if prompt := self.get_prompt():
120
+ self.authorize_params["prompt"] = prompt
121
+
102
122
  async def get_token(self, code: str, url: str):
103
123
  payload = {
104
124
  "client_id": self.client_id,
@@ -164,9 +184,11 @@ class AzureADOAuthProvider(OAuthProvider):
164
184
  "response_type": "code",
165
185
  "scope": "https://graph.microsoft.com/User.Read",
166
186
  "response_mode": "query",
167
- "prompt": "login",
168
187
  }
169
188
 
189
+ if prompt := self.get_prompt():
190
+ self.authorize_params["prompt"] = prompt
191
+
170
192
  async def get_token(self, code: str, url: str):
171
193
  payload = {
172
194
  "client_id": self.client_id,
@@ -249,9 +271,11 @@ class AzureADHybridOAuthProvider(OAuthProvider):
249
271
  "scope": "https://graph.microsoft.com/User.Read https://graph.microsoft.com/openid",
250
272
  "response_mode": "form_post",
251
273
  "nonce": nonce,
252
- "prompt": "login",
253
274
  }
254
275
 
276
+ if prompt := self.get_prompt():
277
+ self.authorize_params["prompt"] = prompt
278
+
255
279
  async def get_token(self, code: str, url: str):
256
280
  payload = {
257
281
  "client_id": self.client_id,
@@ -329,9 +353,11 @@ class OktaOAuthProvider(OAuthProvider):
329
353
  "response_type": "code",
330
354
  "scope": "openid profile email",
331
355
  "response_mode": "query",
332
- "prompt": "login",
333
356
  }
334
357
 
358
+ if prompt := self.get_prompt():
359
+ self.authorize_params["prompt"] = prompt
360
+
335
361
  def get_authorization_server_path(self):
336
362
  if not self.authorization_server_id:
337
363
  return "/default"
@@ -401,9 +427,11 @@ class Auth0OAuthProvider(OAuthProvider):
401
427
  "response_type": "code",
402
428
  "scope": "openid profile email",
403
429
  "audience": f"{self.original_domain}/userinfo",
404
- "prompt": "login",
405
430
  }
406
431
 
432
+ if prompt := self.get_prompt():
433
+ self.authorize_params["prompt"] = prompt
434
+
407
435
  async def get_token(self, code: str, url: str):
408
436
  payload = {
409
437
  "client_id": self.client_id,
@@ -459,9 +487,11 @@ class DescopeOAuthProvider(OAuthProvider):
459
487
  "response_type": "code",
460
488
  "scope": "openid profile email",
461
489
  "audience": f"{self.domain}/userinfo",
462
- "prompt": "login",
463
490
  }
464
491
 
492
+ if prompt := self.get_prompt():
493
+ self.authorize_params["prompt"] = prompt
494
+
465
495
  async def get_token(self, code: str, url: str):
466
496
  payload = {
467
497
  "client_id": self.client_id,
@@ -518,9 +548,11 @@ class AWSCognitoOAuthProvider(OAuthProvider):
518
548
  "response_type": "code",
519
549
  "client_id": self.client_id,
520
550
  "scope": "openid profile email",
521
- "prompt": "login",
522
551
  }
523
552
 
553
+ if prompt := self.get_prompt():
554
+ self.authorize_params["prompt"] = prompt
555
+
524
556
  async def get_token(self, code: str, url: str):
525
557
  payload = {
526
558
  "client_id": self.client_id,
@@ -587,9 +619,11 @@ class GitlabOAuthProvider(OAuthProvider):
587
619
  self.authorize_params = {
588
620
  "scope": "openid profile email",
589
621
  "response_type": "code",
590
- "prompt": "login",
591
622
  }
592
623
 
624
+ if prompt := self.get_prompt():
625
+ self.authorize_params["prompt"] = prompt
626
+
593
627
  async def get_token(self, code: str, url: str):
594
628
  payload = {
595
629
  "client_id": self.client_id,
@@ -1,7 +1,7 @@
1
1
  import asyncio
2
2
  from typing import Union
3
3
 
4
- from chainlit.context import get_context
4
+ from chainlit.context import local_steps
5
5
  from chainlit.step import Step
6
6
  from chainlit.utils import check_module_version
7
7
  from literalai import ChatGeneration, CompletionGeneration
@@ -19,11 +19,9 @@ def instrument_openai():
19
19
  def on_new_generation(
20
20
  generation: Union["ChatGeneration", "CompletionGeneration"], timing
21
21
  ):
22
- context = get_context()
22
+ previous_steps = local_steps.get()
23
23
 
24
- parent_id = None
25
- if context.current_step:
26
- parent_id = context.current_step.id
24
+ parent_id = previous_steps[-1].id if previous_steps else None
27
25
 
28
26
  step = Step(
29
27
  name=generation.model if generation.model else generation.provider,
chainlit/server.py CHANGED
@@ -41,6 +41,7 @@ from fastapi import (
41
41
  APIRouter,
42
42
  Depends,
43
43
  FastAPI,
44
+ File,
44
45
  Form,
45
46
  HTTPException,
46
47
  Query,
@@ -645,7 +646,7 @@ async def oauth_azure_hf_callback(
645
646
 
646
647
 
647
648
  _language_pattern = (
648
- "^[a-zA-Z]{2,3}(-[a-zA-Z]{2,3})?(-[a-zA-Z]{2,8})?(-x-[a-zA-Z0-9]{1,8})?$"
649
+ "^[a-zA-Z]{2,3}(-[a-zA-Z0-9]{2,3})?(-[a-zA-Z0-9]{2,8})?(-x-[a-zA-Z0-9]{1,8})?$"
649
650
  )
650
651
 
651
652
 
@@ -839,11 +840,9 @@ async def delete_thread(
839
840
 
840
841
  @router.post("/project/file")
841
842
  async def upload_file(
843
+ current_user: Annotated[Union[User, PersistedUser], Depends(get_current_user)],
842
844
  session_id: str,
843
845
  file: UploadFile,
844
- current_user: Annotated[
845
- Union[None, User, PersistedUser], Depends(get_current_user)
846
- ],
847
846
  ):
848
847
  """Upload a file to the session files directory."""
849
848
 
@@ -868,17 +867,21 @@ async def upload_file(
868
867
 
869
868
  content = await file.read()
870
869
 
870
+ assert file.filename, "No filename for uploaded file"
871
+ assert file.content_type, "No content type for uploaded file"
872
+
871
873
  file_response = await session.persist_file(
872
874
  name=file.filename, content=content, mime=file.content_type
873
875
  )
874
876
 
875
- return JSONResponse(file_response)
877
+ return JSONResponse(content=file_response)
876
878
 
877
879
 
878
880
  @router.get("/project/file/{file_id}")
879
881
  async def get_file(
880
882
  file_id: str,
881
- session_id: Optional[str] = None,
883
+ session_id: str,
884
+ # current_user: Annotated[Union[User, PersistedUser], Depends(get_current_user)], #TODO: Causes 401 error. See https://github.com/Chainlit/chainlit/issues/1472
882
885
  ):
883
886
  """Get a file from the session files directory."""
884
887
 
@@ -888,10 +891,18 @@ async def get_file(
888
891
 
889
892
  if not session:
890
893
  raise HTTPException(
891
- status_code=404,
892
- detail="Session not found",
894
+ status_code=401,
895
+ detail="Unauthorized",
893
896
  )
894
897
 
898
+ #TODO: Causes 401 error. See https://github.com/Chainlit/chainlit/issues/1472
899
+ # if current_user:
900
+ # if not session.user or session.user.identifier != current_user.identifier:
901
+ # raise HTTPException(
902
+ # status_code=401,
903
+ # detail="You are not authorized to download files from this session",
904
+ # )
905
+
895
906
  if file_id in session.files:
896
907
  file = session.files[file_id]
897
908
  return FileResponse(file["path"], media_type=file["type"])
@@ -961,7 +972,7 @@ async def get_logo(theme: Optional[Theme] = Query(Theme.light)):
961
972
  @router.get("/avatars/{avatar_id:str}")
962
973
  async def get_avatar(avatar_id: str):
963
974
  """Get the avatar for the user based on the avatar_id."""
964
- if not re.match(r"^[a-zA-Z0-9_-]+$", avatar_id):
975
+ if not re.match(r"^[a-zA-Z0-9_ -]+$", avatar_id):
965
976
  raise HTTPException(status_code=400, detail="Invalid avatar_id")
966
977
 
967
978
  if avatar_id == "default":
chainlit/step.py CHANGED
@@ -65,7 +65,7 @@ class StepDict(TypedDict, total=False):
65
65
  feedback: Optional[FeedbackDict]
66
66
 
67
67
 
68
- def flatten_args_kwargs(func, *args, **kwargs):
68
+ def flatten_args_kwargs(func, args, kwargs):
69
69
  signature = inspect.signature(func)
70
70
  bound_arguments = signature.bind(*args, **kwargs)
71
71
  bound_arguments.apply_defaults()
@@ -434,7 +434,6 @@ class Step:
434
434
  if not self.parent_id:
435
435
  if parent_step:
436
436
  self.parent_id = parent_step.id
437
- context.active_steps.append(self)
438
437
  local_steps.set(previous_steps + [self])
439
438
  await self.send()
440
439
  return self
@@ -446,13 +445,10 @@ class Step:
446
445
  self.output = str(exc_val)
447
446
  self.is_error = True
448
447
 
449
- if self in context.active_steps:
450
- context.active_steps.remove(self)
451
-
452
- local_active_steps = local_steps.get()
453
- if local_active_steps and self in local_active_steps:
454
- local_active_steps.remove(self)
455
- local_steps.set(local_active_steps)
448
+ current_steps = local_steps.get()
449
+ if current_steps and self in current_steps:
450
+ current_steps.remove(self)
451
+ local_steps.set(current_steps)
456
452
 
457
453
  await self.update()
458
454
 
@@ -465,7 +461,6 @@ class Step:
465
461
  if not self.parent_id:
466
462
  if parent_step:
467
463
  self.parent_id = parent_step.id
468
- context.active_steps.append(self)
469
464
  local_steps.set(previous_steps + [self])
470
465
 
471
466
  asyncio.create_task(self.send())
@@ -478,12 +473,9 @@ class Step:
478
473
  self.output = str(exc_val)
479
474
  self.is_error = True
480
475
 
481
- if self in context.active_steps:
482
- context.active_steps.remove(self)
483
-
484
- local_active_steps = local_steps.get()
485
- if local_active_steps and self in local_active_steps:
486
- local_active_steps.remove(self)
487
- local_steps.set(local_active_steps)
476
+ current_steps = local_steps.get()
477
+ if current_steps and self in current_steps:
478
+ current_steps.remove(self)
479
+ local_steps.set(current_steps)
488
480
 
489
481
  asyncio.create_task(self.update())
@@ -1,18 +1,25 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: chainlit
3
- Version: 1.3.0rc0
3
+ Version: 1.3.1
4
4
  Summary: Build Conversational AI.
5
- Home-page: https://github.com/Chainlit/chainlit
6
- License: Apache-2.0 license
5
+ Home-page: https://chainlit.io/
6
+ License: Apache-2.0
7
7
  Keywords: LLM,Agents,gen ai,chat ui,chatbot ui,openai,copilot,langchain,conversational ai
8
- Author: Chainlit
8
+ Author: Willy Douhard
9
9
  Requires-Python: >=3.9,<4.0.0
10
+ Classifier: Environment :: Web Environment
11
+ Classifier: Framework :: FastAPI
10
12
  Classifier: License :: Other/Proprietary License
13
+ Classifier: Programming Language :: JavaScript
11
14
  Classifier: Programming Language :: Python :: 3
12
15
  Classifier: Programming Language :: Python :: 3.9
13
16
  Classifier: Programming Language :: Python :: 3.10
14
17
  Classifier: Programming Language :: Python :: 3.11
15
18
  Classifier: Programming Language :: Python :: 3.12
19
+ Classifier: Topic :: Communications :: Chat
20
+ Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
21
+ Classifier: Topic :: Software Development :: Libraries :: Python Modules
22
+ Classifier: Topic :: Software Development :: User Interfaces
16
23
  Requires-Dist: aiofiles (>=23.1.0,<24.0.0)
17
24
  Requires-Dist: asyncer (>=0.0.7,<0.0.8)
18
25
  Requires-Dist: click (>=8.1.3,<9.0.0)
@@ -36,6 +43,7 @@ Requires-Dist: tomli (>=2.0.1,<3.0.0)
36
43
  Requires-Dist: uptrace (>=1.22.0,<2.0.0)
37
44
  Requires-Dist: uvicorn (>=0.25.0,<0.26.0)
38
45
  Requires-Dist: watchfiles (>=0.20.0,<0.21.0)
46
+ Project-URL: Documentation, https://docs.chainlit.io/
39
47
  Project-URL: Repository, https://github.com/Chainlit/chainlit
40
48
  Description-Content-Type: text/markdown
41
49
 
@@ -2,50 +2,50 @@ chainlit/__init__.py,sha256=DS5myAgKWFdM2L2jlXDyKBrZiuCg9N9VmXDXs61YGiU,4324
2
2
  chainlit/__main__.py,sha256=7Vg3w3T3qDuz4KDu5lQhLH6lQ3cYdume7gHH7Z1V97U,87
3
3
  chainlit/_utils.py,sha256=vaKfEpXcL4kXktp54IRQWZRK4L_HGK8gJuAoIM29YYc,289
4
4
  chainlit/action.py,sha256=k-GsblVHI4DnDWFyF-RZgq3KfdfAFICFh2OBeU4w8N8,1410
5
- chainlit/auth.py,sha256=5G7H0khUaXxLkxvJotHFYJMQgDlXkHgJrv9s8rtDuP4,2671
5
+ chainlit/auth.py,sha256=53trhZr3j_QBxNn8xo512s8qKdLo0IyZGvNwU84jLuc,2770
6
6
  chainlit/cache.py,sha256=Bv3dT4eHhE6Fq3c6Do0ZTpiyoXgXYewdxTgpYghEd9g,1361
7
7
  chainlit/callbacks.py,sha256=3t5Z799SLN7CE23DhuXeOfEVA07Hs_1PJRb2WfXmXZI,8723
8
8
  chainlit/chat_context.py,sha256=X1NInuCkhrfFhFUNIbipVaqf-90xXuyCAB9fvJlEUD4,1868
9
9
  chainlit/chat_settings.py,sha256=2ByenmwS8O6jQjDVJjhhbLrBPGA5aY2F7R3VvQQxXPk,877
10
10
  chainlit/cli/__init__.py,sha256=s-2SkMzIpo4ifEAJ0p1VARGM5F7fkb1so6G8Enj5iHs,6230
11
11
  chainlit/config.py,sha256=j6wAlRQG5Kr_2CcVLqm1za94pr0bcC5VY2vDqOHoQFM,17306
12
- chainlit/context.py,sha256=RdLGlRjx8nBW1onooQdCdcbtMyIBGFlxYkL95oHacdk,3338
13
- chainlit/copilot/dist/assets/logo_dark-2a3cf740.svg,sha256=Kjz3QMh-oh-ag4YatjU0YCPqGF7F8nHh8VUQoJIs01E,8887
14
- chainlit/copilot/dist/assets/logo_light-b078e7bc.svg,sha256=sHjnvEq1rfqh3bcexJNYUY7WEDdTQZq3aKZYpi4w4ck,8889
15
- chainlit/copilot/dist/index.js,sha256=vz1SRtAoQcApK2DCF6XJ8IvGwvrXlsALkIzqZxmEgDs,6778390
12
+ chainlit/context.py,sha256=0eyhjQuMY7N1_-pcMXs_z1JxtuEsGmGzEeyctLOfPVc,3306
13
+ chainlit/copilot/dist/assets/logo_dark-IkGJ_IwC.svg,sha256=Kjz3QMh-oh-ag4YatjU0YCPqGF7F8nHh8VUQoJIs01E,8887
14
+ chainlit/copilot/dist/assets/logo_light-Bb_IPh6r.svg,sha256=sHjnvEq1rfqh3bcexJNYUY7WEDdTQZq3aKZYpi4w4ck,8889
15
+ chainlit/copilot/dist/index.js,sha256=xGnKQfdFfCoXyfUtNtP-VXh06bZo7g5hm5cpwprP6LM,6775931
16
16
  chainlit/data/__init__.py,sha256=oaKft5-ejrduen95fTMVmqLMLXVyEa97mQI72oDDSlE,751
17
17
  chainlit/data/acl.py,sha256=5EwZuKVcZediw77L661MohGce3JzGIaYmw6NutmMTw0,578
18
18
  chainlit/data/base.py,sha256=08CYstw0heUBfBzIjD6i-G3-83JMlhjxOxMEuoD0Epk,2907
19
19
  chainlit/data/dynamodb.py,sha256=EgeYOeREswvtx7nfYJALh58u5ARJfWnIqk5H00sdwfw,19410
20
20
  chainlit/data/literalai.py,sha256=H6fxhqwJVeA6movnmlcB_TToD7jslY1X8u2vg3gIku0,17256
21
- chainlit/data/sql_alchemy.py,sha256=cspyQOz5IVs1TrFnujxW1_Zil_sUpGUoa11DnAbEkGE,29511
21
+ chainlit/data/sql_alchemy.py,sha256=LQVDnGuk-r8t1ldzNGMb6NbDmB4IUi4RLFcuomj6-U0,29517
22
22
  chainlit/data/storage_clients.py,sha256=uKVsl6oUSclj4h7QrBz13K46RZWtaHbpzf8ZdJg7bVo,3535
23
23
  chainlit/data/utils.py,sha256=cVe8p9F-lITgmAD2xhON_h0nKJVrh1P0AUoLCq6JCWs,966
24
24
  chainlit/discord/__init__.py,sha256=kZ_AAMaCToqO-1FdeQ8_IHS2pqNT0QJ-yyd8bCMaHHs,198
25
25
  chainlit/discord/app.py,sha256=-efl4v9wNvfidYPjS2kqNqaaUCvvfBlErZe6lyQF_IE,11174
26
26
  chainlit/element.py,sha256=CbpWgqeLAeyC0TONmzUc57cVg55a0cEnUDAxoa7qwB4,10954
27
27
  chainlit/emitter.py,sha256=vfPtgqeHfm5CxZrMHIUXjw7U0wGWYCrQonaEC2SK0vo,13036
28
- chainlit/frontend/dist/assets/DailyMotion-deaa038d.js,sha256=feRBbCj80OH5TXXLoftE9UvvjOMvY_9ZRAqZcBCx0qQ,2961
29
- chainlit/frontend/dist/assets/Facebook-07c55425.js,sha256=PUuh_xCwzfLxNbk7BUT9vNSCRCx8bStnXKBfM_x96nQ,3216
30
- chainlit/frontend/dist/assets/FilePlayer-2acc46b1.js,sha256=2u_pzbCZFqU0qRPWKCoKLALM1rlrAaizV-vmXdrhKMg,9041
31
- chainlit/frontend/dist/assets/Kaltura-c2689eb3.js,sha256=Wi4aknF-wjhVcc2_Hj6ljFiiGkzyZ8R0yZxdKR3eP3k,2790
32
- chainlit/frontend/dist/assets/Mixcloud-79d681a7.js,sha256=4W4J5EbOTjhYzC101e__1QBwQackPwH2UUJlL2h_bsk,2638
33
- chainlit/frontend/dist/assets/Mux-549353dc.js,sha256=rNkQcbcJKCn-DoHwrXM2iYlUl1pWMUBsjvAuWO_ZJg8,5360
34
- chainlit/frontend/dist/assets/Preview-000efdea.js,sha256=ECr04U8M0q-oU659I_FUyCnHuWOqrFQc5o3hTsCH35E,3011
35
- chainlit/frontend/dist/assets/SoundCloud-81b2bf43.js,sha256=gR2diUV83oieGtNf9FS4RVPD2spBmwIi3t8DdFfJZ3E,2923
36
- chainlit/frontend/dist/assets/Streamable-032d3cc5.js,sha256=AFApk1KRKs4HKGvEqO6xN9rPVj3b8u7deIFbdwrHIbs,2935
37
- chainlit/frontend/dist/assets/Twitch-43744e0a.js,sha256=mIqto5GPsxrPAXJYXBPIWRrSxal7-KkU2cpl1E7VUdo,3083
38
- chainlit/frontend/dist/assets/Vidyard-4ac486dc.js,sha256=7fRrwfmEo0suQqidmb2DQC5ptjc8N3y6VP5VpTDRCyg,2857
39
- chainlit/frontend/dist/assets/Vimeo-7f1f7543.js,sha256=7KWPiMrsUuNrR7yVxCEv8l2xbc-daXQICiryImqxWtA,3627
40
- chainlit/frontend/dist/assets/Wistia-d0d070c9.js,sha256=VpJl5GAM7oMCUUPcszIKMpQ6apgW_vlxsm_lzrCZelI,3514
41
- chainlit/frontend/dist/assets/YouTube-8a2bf9cd.js,sha256=gOjdnMzqpGL3MAWIEPlxu7A2yN97qpnR6tDblQwHq4Y,4448
42
- chainlit/frontend/dist/assets/index-a0fa87f1.js,sha256=RzjMgOpp6FftEoFn1kWtqmQsuIfmIyd0Aou4btRoGt0,2755176
43
- chainlit/frontend/dist/assets/index-aaf974a9.css,sha256=qvl0qUmR5u0JcmJAfkzaZpN-0ZKdQjzqCSE9cnrQpZQ,2559
44
- chainlit/frontend/dist/assets/logo_dark-2a3cf740.svg,sha256=Kjz3QMh-oh-ag4YatjU0YCPqGF7F8nHh8VUQoJIs01E,8887
45
- chainlit/frontend/dist/assets/logo_light-b078e7bc.svg,sha256=sHjnvEq1rfqh3bcexJNYUY7WEDdTQZq3aKZYpi4w4ck,8889
46
- chainlit/frontend/dist/assets/react-plotly-39a45803.js,sha256=VueovMWAqa5Jk3KjA0NVtOZX6cArSjyjDpFzmAhJtm8,3763471
28
+ chainlit/frontend/dist/assets/DailyMotion-CwoOhIL8.js,sha256=kdg8jO-13L-4Mg3uxt20-avLIQdlErP9NO3ahmV_a2c,2958
29
+ chainlit/frontend/dist/assets/Facebook-BhnGXlzq.js,sha256=U_tXeKVfiK1RibDiURO1-trylK7Yq_T2YvE1m-xQ_G4,3213
30
+ chainlit/frontend/dist/assets/FilePlayer-CPSVT6fz.js,sha256=4Ocju0lGAUjfMjg6aK6LonRlHY2OAjhNi9iAEVwnwSs,9038
31
+ chainlit/frontend/dist/assets/Kaltura-COYaLzsL.js,sha256=suaMDOakSjwP78clQ2rpJt4sTDM-Hmzz1YdouhyDD3s,2787
32
+ chainlit/frontend/dist/assets/Mixcloud-JdadNiQ5.js,sha256=VFrHlibbQs6ZMJhT1mLzzVFLxSMkvegN1_hMUVuXYYc,2635
33
+ chainlit/frontend/dist/assets/Mux-CBN7RO2u.js,sha256=Y8jN3L4jJECEI9XqioUZFtg_0FoIIcVo20j_-udRMVc,5357
34
+ chainlit/frontend/dist/assets/Preview-CxAFvvjV.js,sha256=RPQ2LHkP_FvGnkwIV3u641GUdQpus2W4AoJmJDE5usg,3008
35
+ chainlit/frontend/dist/assets/SoundCloud-JlgmASWm.js,sha256=kGn9CjnT0S7Vv6KgPlpIo9V2LvosUn_KWwDyN9YyQmU,2920
36
+ chainlit/frontend/dist/assets/Streamable-CUWgr6Zw.js,sha256=Qkio_3tXYQnFAXuH-BPvKsqCqDh_aSS45StRxbJy1Lo,2932
37
+ chainlit/frontend/dist/assets/Twitch-BiN1HEDM.js,sha256=7XyX65ZCfo22sUOA59HiRzgNZg5581FVY3E9du8nIC8,3080
38
+ chainlit/frontend/dist/assets/Vidyard-qhPmrhDm.js,sha256=vf0qn1I-QRHnsAt9Ux1frmGd8XMAez1D6Hw50c9IZ2I,2854
39
+ chainlit/frontend/dist/assets/Vimeo-CrZVSCaT.js,sha256=j_Yw1BxQPUecotDuAjwNpi-waSi8jFKFsJCNEF3FIcg,3624
40
+ chainlit/frontend/dist/assets/Wistia-C891KrBP.js,sha256=gOtYlRihzsfkROcRwTu6_dZjYGpzO9-nd_pJxRPBGFo,3511
41
+ chainlit/frontend/dist/assets/YouTube-DKjw5Hbn.js,sha256=qPyskJefUeYsLZMkSGBUMCdblMXZx1LpxWn1PAglNqY,4445
42
+ chainlit/frontend/dist/assets/index-CwmincdQ.css,sha256=qvl0qUmR5u0JcmJAfkzaZpN-0ZKdQjzqCSE9cnrQpZQ,2559
43
+ chainlit/frontend/dist/assets/index-DLRdQOIx.js,sha256=Fn6yegFbplbGuSjdfDk98prNX8sGHhGcUq8nXiSDdWs,2752072
44
+ chainlit/frontend/dist/assets/logo_dark-IkGJ_IwC.svg,sha256=Kjz3QMh-oh-ag4YatjU0YCPqGF7F8nHh8VUQoJIs01E,8887
45
+ chainlit/frontend/dist/assets/logo_light-Bb_IPh6r.svg,sha256=sHjnvEq1rfqh3bcexJNYUY7WEDdTQZq3aKZYpi4w4ck,8889
46
+ chainlit/frontend/dist/assets/react-plotly-Dpmqg5Sy.js,sha256=dv9y3rJWJt8KVB4ZRCE6wUmdZ5Ek4cb_-wEBwSGep0g,3762918
47
47
  chainlit/frontend/dist/favicon.svg,sha256=0Cy8x28obT5eWW3nxZRhsEvu6_zMqrqbg0y6hT3D0Q0,6455
48
- chainlit/frontend/dist/index.html,sha256=5hF1UYFz7dyJETcX9-ciY31EwO4fcdVIs5372xmHerA,965
48
+ chainlit/frontend/dist/index.html,sha256=EDEeSA6F7ImtpvW2ncwwf5fIA9p23X-q56NQ6Un6Bgo,972
49
49
  chainlit/haystack/__init__.py,sha256=uZ77YiPy-qleSTi3dQCDO9HE6S6F6GpJWmh7jO4cxXA,217
50
50
  chainlit/haystack/callbacks.py,sha256=mh6CS6n0Z70u9B1s72iF0kSl-qi2N55T-AgaMtUvq9Y,5036
51
51
  chainlit/hello.py,sha256=LwENQWo5s5r8nNDn4iKSV77vX60Ky5r_qGjQhyi7qlY,416
@@ -59,16 +59,16 @@ chainlit/logger.py,sha256=wTwRSZsLfXwWy6U4351IgWAm4KCMThgxm9EZpjGUEr4,373
59
59
  chainlit/markdown.py,sha256=V-Op4hyqyTTvXInU5QrHfxs0nb71lBMU8trOSAlast8,2142
60
60
  chainlit/message.py,sha256=kMPRE0L10WhJKcyPUNg3FRVPviby0LOn1KHAI4pGszM,17287
61
61
  chainlit/mistralai/__init__.py,sha256=Zr3-mb-3ycNXR1e5ui_yX_7ZxGB0cu5d9E80ir7t-2w,1507
62
- chainlit/oauth_providers.py,sha256=T17iFZdDXClzscki2v7AEgSGvrGYSiq2QG4MrgqgBzg,23242
63
- chainlit/openai/__init__.py,sha256=aj8toIwvCktANU1TaH1verKS7ApS6tlhDZFtm1oTyCM,1715
62
+ chainlit/oauth_providers.py,sha256=e-HupFy6HFPCAavBfD3XGBgwHU1n0JrGHO7QjeBp0ts,24297
63
+ chainlit/openai/__init__.py,sha256=CJp-3lr4NS3X-aZ0H3OvKcL5wFf-cJZffIK0Bwl9jxA,1690
64
64
  chainlit/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
65
65
  chainlit/secret.py,sha256=cQvIFGTQ7r2heC8EOGdgifSZZYqslh-qQxhUhKhD8vU,295
66
- chainlit/server.py,sha256=vCTBPiFfJYTM3vxkrmCuZJwbh3lszGdBEP_wjsZ8CZM,29961
66
+ chainlit/server.py,sha256=NA_GdRqdEJ1scS1Rhcm3geh02ec7xWOSzchmrqLi1Vg,30598
67
67
  chainlit/session.py,sha256=dU56wmJ9LSuSAOwKBpYF8ZofV5SoN1oPmWycHWEN85k,9219
68
68
  chainlit/slack/__init__.py,sha256=Q41ztJHeVmpoXVgVqAcwGOufQp_bjf7dDT7eEXDdhPI,207
69
69
  chainlit/slack/app.py,sha256=jzy6Nz9kmnJ6j1wfoI94cweSNDjdv7X-ur_lWnq5oVE,11741
70
70
  chainlit/socket.py,sha256=CNrkIshIFm-S4MBq6XQaA3wj72w8pSJ4ND2ZuUS2-KE,12761
71
- chainlit/step.py,sha256=YI6O_-FoJ24r1aAIMr7X_9floR_9RIwP4TuvEQlaz7s,14584
71
+ chainlit/step.py,sha256=skY9zpxqrl-Czkp7zKVlxRGvKq9xAwT3nfLarD_Q7z0,14271
72
72
  chainlit/sync.py,sha256=G1n-7-3WgXsN8y1bJkEyws_YwmHZIyDZoZUwhprigag,1235
73
73
  chainlit/teams/__init__.py,sha256=ZSEbsRJHT_mKfGn6yuzM5NX-xItleSDS0af7vt8Z1OA,217
74
74
  chainlit/teams/app.py,sha256=gJm_wBNzCawaTLIYtOEhDlpRwBDprnguTAIoWZhlO8o,10533
@@ -90,7 +90,7 @@ chainlit/user.py,sha256=mUhnGhYQ__qEx8YzigHhF2Z9xxuqQo5C2U8opKpiVRs,752
90
90
  chainlit/user_session.py,sha256=T1nQVN_weELXTrkDIV54YgdrA3zIvJGe1tN-nypunt4,1531
91
91
  chainlit/utils.py,sha256=hXb5z3jb2syJP0P_jTz3zjDEuIfl0IAmQbA3MooSCTs,3989
92
92
  chainlit/version.py,sha256=iosXhlXclBwBqlADFKEilxAC2wWKbtuBKi87AmPi7s8,196
93
- chainlit-1.3.0rc0.dist-info/METADATA,sha256=iRg2Az8XjpOnnCm1JgB3ROvG4w9bEqVi4rEk4Ht6ELQ,6398
94
- chainlit-1.3.0rc0.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
95
- chainlit-1.3.0rc0.dist-info/entry_points.txt,sha256=FrkqdjrFl8juSnvBndniyX7XuKojmUwO4ghRh-CFMQc,45
96
- chainlit-1.3.0rc0.dist-info/RECORD,,
93
+ chainlit-1.3.1.dist-info/METADATA,sha256=6rdyLKbvKt386FUV3R9QA6skSlDRY8y8ES6Bdba_95w,6803
94
+ chainlit-1.3.1.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
95
+ chainlit-1.3.1.dist-info/entry_points.txt,sha256=FrkqdjrFl8juSnvBndniyX7XuKojmUwO4ghRh-CFMQc,45
96
+ chainlit-1.3.1.dist-info/RECORD,,
@@ -1 +0,0 @@
1
- import{g as P,r as v,u as D,a as O}from"./index-a0fa87f1.js";function b(t,e){for(var r=0;r<e.length;r++){const o=e[r];if(typeof o!="string"&&!Array.isArray(o)){for(const a in o)if(a!=="default"&&!(a in t)){const i=Object.getOwnPropertyDescriptor(o,a);i&&Object.defineProperty(t,a,i.get?i:{enumerable:!0,get:()=>o[a]})}}}return Object.freeze(Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}))}var M=Object.create,s=Object.defineProperty,w=Object.getOwnPropertyDescriptor,S=Object.getOwnPropertyNames,j=Object.getPrototypeOf,T=Object.prototype.hasOwnProperty,E=(t,e,r)=>e in t?s(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,A=(t,e)=>{for(var r in e)s(t,r,{get:e[r],enumerable:!0})},h=(t,e,r,o)=>{if(e&&typeof e=="object"||typeof e=="function")for(let a of S(e))!T.call(t,a)&&a!==r&&s(t,a,{get:()=>e[a],enumerable:!(o=w(e,a))||o.enumerable});return t},L=(t,e,r)=>(r=t!=null?M(j(t)):{},h(e||!t||!t.__esModule?s(r,"default",{value:t,enumerable:!0}):r,t)),C=t=>h(s({},"__esModule",{value:!0}),t),n=(t,e,r)=>(E(t,typeof e!="symbol"?e+"":e,r),r),d={};A(d,{default:()=>p});var _=C(d),c=L(v),l=D,f=O;const x="https://api.dmcdn.net/all.js",N="DM",K="dmAsyncInit";class p extends c.Component{constructor(){super(...arguments),n(this,"callPlayer",l.callPlayer),n(this,"onDurationChange",()=>{const e=this.getDuration();this.props.onDuration(e)}),n(this,"mute",()=>{this.callPlayer("setMuted",!0)}),n(this,"unmute",()=>{this.callPlayer("setMuted",!1)}),n(this,"ref",e=>{this.container=e})}componentDidMount(){this.props.onMount&&this.props.onMount(this)}load(e){const{controls:r,config:o,onError:a,playing:i}=this.props,[,y]=e.match(f.MATCH_URL_DAILYMOTION);if(this.player){this.player.load(y,{start:(0,l.parseStartTime)(e),autoplay:i});return}(0,l.getSDK)(x,N,K,u=>u.player).then(u=>{if(!this.container)return;const g=u.player;this.player=new g(this.container,{width:"100%",height:"100%",video:y,params:{controls:r,autoplay:this.props.playing,mute:this.props.muted,start:(0,l.parseStartTime)(e),origin:window.location.origin,...o.params},events:{apiready:this.props.onReady,seeked:()=>this.props.onSeek(this.player.currentTime),video_end:this.props.onEnded,durationchange:this.onDurationChange,pause:this.props.onPause,playing:this.props.onPlay,waiting:this.props.onBuffer,error:m=>a(m)}})},a)}play(){this.callPlayer("play")}pause(){this.callPlayer("pause")}stop(){}seekTo(e,r=!0){this.callPlayer("seek",e),r||this.pause()}setVolume(e){this.callPlayer("setVolume",e)}getDuration(){return this.player.duration||null}getCurrentTime(){return this.player.currentTime}getSecondsLoaded(){return this.player.bufferedTime}render(){const{display:e}=this.props,r={width:"100%",height:"100%",display:e};return c.default.createElement("div",{style:r},c.default.createElement("div",{ref:this.ref}))}}n(p,"displayName","DailyMotion");n(p,"canPlay",f.canPlay.dailymotion);n(p,"loopOnEnded",!0);const R=P(_),I=b({__proto__:null,default:R},[_]);export{I as D};
@@ -1 +0,0 @@
1
- import{g as _,r as g,u as P,a as m}from"./index-a0fa87f1.js";function v(t,e){for(var r=0;r<e.length;r++){const a=e[r];if(typeof a!="string"&&!Array.isArray(a)){for(const s in a)if(s!=="default"&&!(s in t)){const p=Object.getOwnPropertyDescriptor(a,s);p&&Object.defineProperty(t,s,p.get?p:{enumerable:!0,get:()=>a[s]})}}}return Object.freeze(Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}))}var O=Object.create,i=Object.defineProperty,D=Object.getOwnPropertyDescriptor,E=Object.getOwnPropertyNames,S=Object.getPrototypeOf,j=Object.prototype.hasOwnProperty,I=(t,e,r)=>e in t?i(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,k=(t,e)=>{for(var r in e)i(t,r,{get:e[r],enumerable:!0})},h=(t,e,r,a)=>{if(e&&typeof e=="object"||typeof e=="function")for(let s of E(e))!j.call(t,s)&&s!==r&&i(t,s,{get:()=>e[s],enumerable:!(a=D(e,s))||a.enumerable});return t},w=(t,e,r)=>(r=t!=null?O(S(t)):{},h(e||!t||!t.__esModule?i(r,"default",{value:t,enumerable:!0}):r,t)),F=t=>h(i({},"__esModule",{value:!0}),t),o=(t,e,r)=>(I(t,typeof e!="symbol"?e+"":e,r),r),b={};k(b,{default:()=>l});var d=F(b),u=w(g),n=P,x=m;const c="https://connect.facebook.net/en_US/sdk.js",y="FB",f="fbAsyncInit",L="facebook-player-";class l extends u.Component{constructor(){super(...arguments),o(this,"callPlayer",n.callPlayer),o(this,"playerID",this.props.config.playerId||`${L}${(0,n.randomString)()}`),o(this,"mute",()=>{this.callPlayer("mute")}),o(this,"unmute",()=>{this.callPlayer("unmute")})}componentDidMount(){this.props.onMount&&this.props.onMount(this)}load(e,r){if(r){(0,n.getSDK)(c,y,f).then(a=>a.XFBML.parse());return}(0,n.getSDK)(c,y,f).then(a=>{a.init({appId:this.props.config.appId,xfbml:!0,version:this.props.config.version}),a.Event.subscribe("xfbml.render",s=>{this.props.onLoaded()}),a.Event.subscribe("xfbml.ready",s=>{s.type==="video"&&s.id===this.playerID&&(this.player=s.instance,this.player.subscribe("startedPlaying",this.props.onPlay),this.player.subscribe("paused",this.props.onPause),this.player.subscribe("finishedPlaying",this.props.onEnded),this.player.subscribe("startedBuffering",this.props.onBuffer),this.player.subscribe("finishedBuffering",this.props.onBufferEnd),this.player.subscribe("error",this.props.onError),this.props.muted?this.callPlayer("mute"):this.callPlayer("unmute"),this.props.onReady(),document.getElementById(this.playerID).querySelector("iframe").style.visibility="visible")})})}play(){this.callPlayer("play")}pause(){this.callPlayer("pause")}stop(){}seekTo(e,r=!0){this.callPlayer("seek",e),r||this.pause()}setVolume(e){this.callPlayer("setVolume",e)}getDuration(){return this.callPlayer("getDuration")}getCurrentTime(){return this.callPlayer("getCurrentPosition")}getSecondsLoaded(){return null}render(){const{attributes:e}=this.props.config,r={width:"100%",height:"100%"};return u.default.createElement("div",{style:r,id:this.playerID,className:"fb-video","data-href":this.props.url,"data-autoplay":this.props.playing?"true":"false","data-allowfullscreen":"true","data-controls":this.props.controls?"true":"false",...e})}}o(l,"displayName","Facebook");o(l,"canPlay",x.canPlay.facebook);o(l,"loopOnEnded",!0);const M=_(d),B=v({__proto__:null,default:M},[d]);export{B as F};
@@ -1 +0,0 @@
1
- import{g as b,r as _,u as O,a as A}from"./index-a0fa87f1.js";function R(s,e){for(var t=0;t<e.length;t++){const i=e[t];if(typeof i!="string"&&!Array.isArray(i)){for(const n in i)if(n!=="default"&&!(n in s)){const l=Object.getOwnPropertyDescriptor(i,n);l&&Object.defineProperty(s,n,l.get?l:{enumerable:!0,get:()=>i[n]})}}}return Object.freeze(Object.defineProperty(s,Symbol.toStringTag,{value:"Module"}))}var I=Object.create,u=Object.defineProperty,D=Object.getOwnPropertyDescriptor,w=Object.getOwnPropertyNames,M=Object.getPrototypeOf,k=Object.prototype.hasOwnProperty,U=(s,e,t)=>e in s?u(s,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):s[e]=t,N=(s,e)=>{for(var t in e)u(s,t,{get:e[t],enumerable:!0})},E=(s,e,t,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of w(e))!k.call(s,n)&&n!==t&&u(s,n,{get:()=>e[n],enumerable:!(i=D(e,n))||i.enumerable});return s},j=(s,e,t)=>(t=s!=null?I(M(s)):{},E(e||!s||!s.__esModule?u(t,"default",{value:s,enumerable:!0}):t,s)),H=s=>E(u({},"__esModule",{value:!0}),s),r=(s,e,t)=>(U(s,typeof e!="symbol"?e+"":e,t),t),m={};N(m,{default:()=>P});var g=H(m),c=j(_),a=O,d=A;const y=typeof navigator<"u",F=y&&navigator.platform==="MacIntel"&&navigator.maxTouchPoints>1,v=y&&(/iPad|iPhone|iPod/.test(navigator.userAgent)||F)&&!window.MSStream,V=y&&/^((?!chrome|android).)*safari/i.test(navigator.userAgent)&&!window.MSStream,T="https://cdn.jsdelivr.net/npm/hls.js@VERSION/dist/hls.min.js",C="Hls",B="https://cdnjs.cloudflare.com/ajax/libs/dashjs/VERSION/dash.all.min.js",x="dashjs",K="https://cdn.jsdelivr.net/npm/flv.js@VERSION/dist/flv.min.js",G="flvjs",X=/www\.dropbox\.com\/.+/,f=/https:\/\/watch\.cloudflarestream\.com\/([a-z0-9]+)/,W="https://videodelivery.net/{id}/manifest/video.m3u8";class P extends c.Component{constructor(){super(...arguments),r(this,"onReady",(...e)=>this.props.onReady(...e)),r(this,"onPlay",(...e)=>this.props.onPlay(...e)),r(this,"onBuffer",(...e)=>this.props.onBuffer(...e)),r(this,"onBufferEnd",(...e)=>this.props.onBufferEnd(...e)),r(this,"onPause",(...e)=>this.props.onPause(...e)),r(this,"onEnded",(...e)=>this.props.onEnded(...e)),r(this,"onError",(...e)=>this.props.onError(...e)),r(this,"onPlayBackRateChange",e=>this.props.onPlaybackRateChange(e.target.playbackRate)),r(this,"onEnablePIP",(...e)=>this.props.onEnablePIP(...e)),r(this,"onDisablePIP",e=>{const{onDisablePIP:t,playing:i}=this.props;t(e),i&&this.play()}),r(this,"onPresentationModeChange",e=>{if(this.player&&(0,a.supportsWebKitPresentationMode)(this.player)){const{webkitPresentationMode:t}=this.player;t==="picture-in-picture"?this.onEnablePIP(e):t==="inline"&&this.onDisablePIP(e)}}),r(this,"onSeek",e=>{this.props.onSeek(e.target.currentTime)}),r(this,"mute",()=>{this.player.muted=!0}),r(this,"unmute",()=>{this.player.muted=!1}),r(this,"renderSourceElement",(e,t)=>typeof e=="string"?c.default.createElement("source",{key:t,src:e}):c.default.createElement("source",{key:t,...e})),r(this,"renderTrack",(e,t)=>c.default.createElement("track",{key:t,...e})),r(this,"ref",e=>{this.player&&(this.prevPlayer=this.player),this.player=e})}componentDidMount(){this.props.onMount&&this.props.onMount(this),this.addListeners(this.player);const e=this.getSource(this.props.url);e&&(this.player.src=e),(v||this.props.config.forceDisableHls)&&this.player.load()}componentDidUpdate(e){this.shouldUseAudio(this.props)!==this.shouldUseAudio(e)&&(this.removeListeners(this.prevPlayer,e.url),this.addListeners(this.player)),this.props.url!==e.url&&!(0,a.isMediaStream)(this.props.url)&&!(this.props.url instanceof Array)&&(this.player.srcObject=null)}componentWillUnmount(){this.player.removeAttribute("src"),this.removeListeners(this.player),this.hls&&this.hls.destroy()}addListeners(e){const{url:t,playsinline:i}=this.props;e.addEventListener("play",this.onPlay),e.addEventListener("waiting",this.onBuffer),e.addEventListener("playing",this.onBufferEnd),e.addEventListener("pause",this.onPause),e.addEventListener("seeked",this.onSeek),e.addEventListener("ended",this.onEnded),e.addEventListener("error",this.onError),e.addEventListener("ratechange",this.onPlayBackRateChange),e.addEventListener("enterpictureinpicture",this.onEnablePIP),e.addEventListener("leavepictureinpicture",this.onDisablePIP),e.addEventListener("webkitpresentationmodechanged",this.onPresentationModeChange),this.shouldUseHLS(t)||e.addEventListener("canplay",this.onReady),i&&(e.setAttribute("playsinline",""),e.setAttribute("webkit-playsinline",""),e.setAttribute("x5-playsinline",""))}removeListeners(e,t){e.removeEventListener("canplay",this.onReady),e.removeEventListener("play",this.onPlay),e.removeEventListener("waiting",this.onBuffer),e.removeEventListener("playing",this.onBufferEnd),e.removeEventListener("pause",this.onPause),e.removeEventListener("seeked",this.onSeek),e.removeEventListener("ended",this.onEnded),e.removeEventListener("error",this.onError),e.removeEventListener("ratechange",this.onPlayBackRateChange),e.removeEventListener("enterpictureinpicture",this.onEnablePIP),e.removeEventListener("leavepictureinpicture",this.onDisablePIP),e.removeEventListener("webkitpresentationmodechanged",this.onPresentationModeChange),this.shouldUseHLS(t)||e.removeEventListener("canplay",this.onReady)}shouldUseAudio(e){return e.config.forceVideo||e.config.attributes.poster?!1:d.AUDIO_EXTENSIONS.test(e.url)||e.config.forceAudio}shouldUseHLS(e){return V&&this.props.config.forceSafariHLS||this.props.config.forceHLS?!0:v||this.props.config.forceDisableHls?!1:d.HLS_EXTENSIONS.test(e)||f.test(e)}shouldUseDASH(e){return d.DASH_EXTENSIONS.test(e)||this.props.config.forceDASH}shouldUseFLV(e){return d.FLV_EXTENSIONS.test(e)||this.props.config.forceFLV}load(e){const{hlsVersion:t,hlsOptions:i,dashVersion:n,flvVersion:l}=this.props.config;if(this.hls&&this.hls.destroy(),this.dash&&this.dash.reset(),this.shouldUseHLS(e)&&(0,a.getSDK)(T.replace("VERSION",t),C).then(o=>{if(this.hls=new o(i),this.hls.on(o.Events.MANIFEST_PARSED,()=>{this.props.onReady()}),this.hls.on(o.Events.ERROR,(h,p)=>{this.props.onError(h,p,this.hls,o)}),f.test(e)){const h=e.match(f)[1];this.hls.loadSource(W.replace("{id}",h))}else this.hls.loadSource(e);this.hls.attachMedia(this.player),this.props.onLoaded()}),this.shouldUseDASH(e)&&(0,a.getSDK)(B.replace("VERSION",n),x).then(o=>{this.dash=o.MediaPlayer().create(),this.dash.initialize(this.player,e,this.props.playing),this.dash.on("error",this.props.onError),parseInt(n)<3?this.dash.getDebug().setLogToBrowserConsole(!1):this.dash.updateSettings({debug:{logLevel:o.Debug.LOG_LEVEL_NONE}}),this.props.onLoaded()}),this.shouldUseFLV(e)&&(0,a.getSDK)(K.replace("VERSION",l),G).then(o=>{this.flv=o.createPlayer({type:"flv",url:e}),this.flv.attachMediaElement(this.player),this.flv.on(o.Events.ERROR,(h,p)=>{this.props.onError(h,p,this.flv,o)}),this.flv.load(),this.props.onLoaded()}),e instanceof Array)this.player.load();else if((0,a.isMediaStream)(e))try{this.player.srcObject=e}catch{this.player.src=window.URL.createObjectURL(e)}}play(){const e=this.player.play();e&&e.catch(this.props.onError)}pause(){this.player.pause()}stop(){this.player.removeAttribute("src"),this.dash&&this.dash.reset()}seekTo(e,t=!0){this.player.currentTime=e,t||this.pause()}setVolume(e){this.player.volume=e}enablePIP(){this.player.requestPictureInPicture&&document.pictureInPictureElement!==this.player?this.player.requestPictureInPicture():(0,a.supportsWebKitPresentationMode)(this.player)&&this.player.webkitPresentationMode!=="picture-in-picture"&&this.player.webkitSetPresentationMode("picture-in-picture")}disablePIP(){document.exitPictureInPicture&&document.pictureInPictureElement===this.player?document.exitPictureInPicture():(0,a.supportsWebKitPresentationMode)(this.player)&&this.player.webkitPresentationMode!=="inline"&&this.player.webkitSetPresentationMode("inline")}setPlaybackRate(e){try{this.player.playbackRate=e}catch(t){this.props.onError(t)}}getDuration(){if(!this.player)return null;const{duration:e,seekable:t}=this.player;return e===1/0&&t.length>0?t.end(t.length-1):e}getCurrentTime(){return this.player?this.player.currentTime:null}getSecondsLoaded(){if(!this.player)return null;const{buffered:e}=this.player;if(e.length===0)return 0;const t=e.end(e.length-1),i=this.getDuration();return t>i?i:t}getSource(e){const t=this.shouldUseHLS(e),i=this.shouldUseDASH(e),n=this.shouldUseFLV(e);if(!(e instanceof Array||(0,a.isMediaStream)(e)||t||i||n))return X.test(e)?e.replace("www.dropbox.com","dl.dropboxusercontent.com"):e}render(){const{url:e,playing:t,loop:i,controls:n,muted:l,config:o,width:h,height:p}=this.props,L=this.shouldUseAudio(this.props)?"audio":"video",S={width:h==="auto"?h:"100%",height:p==="auto"?p:"100%"};return c.default.createElement(L,{ref:this.ref,src:this.getSource(e),style:S,preload:"auto",autoPlay:t||void 0,controls:n,muted:l,loop:i,...o.attributes},e instanceof Array&&e.map(this.renderSourceElement),o.tracks.map(this.renderTrack))}}r(P,"displayName","FilePlayer");r(P,"canPlay",d.canPlay.file);const z=b(g),J=R({__proto__:null,default:z},[g]);export{J as F};
@@ -1 +0,0 @@
1
- import{g as y,r as f,u as _,a as m}from"./index-a0fa87f1.js";function P(r,e){for(var t=0;t<e.length;t++){const s=e[t];if(typeof s!="string"&&!Array.isArray(s)){for(const a in s)if(a!=="default"&&!(a in r)){const l=Object.getOwnPropertyDescriptor(s,a);l&&Object.defineProperty(r,a,l.get?l:{enumerable:!0,get:()=>s[a]})}}}return Object.freeze(Object.defineProperty(r,Symbol.toStringTag,{value:"Module"}))}var g=Object.create,n=Object.defineProperty,b=Object.getOwnPropertyDescriptor,v=Object.getOwnPropertyNames,O=Object.getPrototypeOf,w=Object.prototype.hasOwnProperty,j=(r,e,t)=>e in r?n(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t,L=(r,e)=>{for(var t in e)n(r,t,{get:e[t],enumerable:!0})},c=(r,e,t,s)=>{if(e&&typeof e=="object"||typeof e=="function")for(let a of v(e))!w.call(r,a)&&a!==t&&n(r,a,{get:()=>e[a],enumerable:!(s=b(e,a))||s.enumerable});return r},K=(r,e,t)=>(t=r!=null?g(O(r)):{},c(e||!r||!r.__esModule?n(t,"default",{value:r,enumerable:!0}):t,r)),D=r=>c(n({},"__esModule",{value:!0}),r),o=(r,e,t)=>(j(r,typeof e!="symbol"?e+"":e,t),t),h={};L(h,{default:()=>i});var d=D(h),u=K(f),p=_,S=m;const T="https://cdn.embed.ly/player-0.1.0.min.js",E="playerjs";class i extends u.Component{constructor(){super(...arguments),o(this,"callPlayer",p.callPlayer),o(this,"duration",null),o(this,"currentTime",null),o(this,"secondsLoaded",null),o(this,"mute",()=>{this.callPlayer("mute")}),o(this,"unmute",()=>{this.callPlayer("unmute")}),o(this,"ref",e=>{this.iframe=e})}componentDidMount(){this.props.onMount&&this.props.onMount(this)}load(e){(0,p.getSDK)(T,E).then(t=>{this.iframe&&(this.player=new t.Player(this.iframe),this.player.on("ready",()=>{setTimeout(()=>{this.player.isReady=!0,this.player.setLoop(this.props.loop),this.props.muted&&this.player.mute(),this.addListeners(this.player,this.props),this.props.onReady()},500)}))},this.props.onError)}addListeners(e,t){e.on("play",t.onPlay),e.on("pause",t.onPause),e.on("ended",t.onEnded),e.on("error",t.onError),e.on("timeupdate",({duration:s,seconds:a})=>{this.duration=s,this.currentTime=a})}play(){this.callPlayer("play")}pause(){this.callPlayer("pause")}stop(){}seekTo(e,t=!0){this.callPlayer("setCurrentTime",e),t||this.pause()}setVolume(e){this.callPlayer("setVolume",e)}setLoop(e){this.callPlayer("setLoop",e)}getDuration(){return this.duration}getCurrentTime(){return this.currentTime}getSecondsLoaded(){return this.secondsLoaded}render(){const e={width:"100%",height:"100%"};return u.default.createElement("iframe",{ref:this.ref,src:this.props.url,frameBorder:"0",scrolling:"no",style:e,allow:"encrypted-media; autoplay; fullscreen;",referrerPolicy:"no-referrer-when-downgrade"})}}o(i,"displayName","Kaltura");o(i,"canPlay",S.canPlay.kaltura);const M=y(d),C=P({__proto__:null,default:M},[d]);export{C as K};
@@ -1 +0,0 @@
1
- import{g as _,r as f,u as m,a as g}from"./index-a0fa87f1.js";function v(t,e){for(var r=0;r<e.length;r++){const s=e[r];if(typeof s!="string"&&!Array.isArray(s)){for(const o in s)if(o!=="default"&&!(o in t)){const n=Object.getOwnPropertyDescriptor(s,o);n&&Object.defineProperty(t,o,n.get?n:{enumerable:!0,get:()=>s[o]})}}}return Object.freeze(Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}))}var P=Object.create,i=Object.defineProperty,O=Object.getOwnPropertyDescriptor,b=Object.getOwnPropertyNames,M=Object.getPrototypeOf,w=Object.prototype.hasOwnProperty,x=(t,e,r)=>e in t?i(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,j=(t,e)=>{for(var r in e)i(t,r,{get:e[r],enumerable:!0})},c=(t,e,r,s)=>{if(e&&typeof e=="object"||typeof e=="function")for(let o of b(e))!w.call(t,o)&&o!==r&&i(t,o,{get:()=>e[o],enumerable:!(s=O(e,o))||s.enumerable});return t},D=(t,e,r)=>(r=t!=null?P(M(t)):{},c(e||!t||!t.__esModule?i(r,"default",{value:t,enumerable:!0}):r,t)),S=t=>c(i({},"__esModule",{value:!0}),t),a=(t,e,r)=>(x(t,typeof e!="symbol"?e+"":e,r),r),d={};j(d,{default:()=>l});var h=S(d),p=D(f),u=m,y=g;const E="https://widget.mixcloud.com/media/js/widgetApi.js",L="Mixcloud";class l extends p.Component{constructor(){super(...arguments),a(this,"callPlayer",u.callPlayer),a(this,"duration",null),a(this,"currentTime",null),a(this,"secondsLoaded",null),a(this,"mute",()=>{}),a(this,"unmute",()=>{}),a(this,"ref",e=>{this.iframe=e})}componentDidMount(){this.props.onMount&&this.props.onMount(this)}load(e){(0,u.getSDK)(E,L).then(r=>{this.player=r.PlayerWidget(this.iframe),this.player.ready.then(()=>{this.player.events.play.on(this.props.onPlay),this.player.events.pause.on(this.props.onPause),this.player.events.ended.on(this.props.onEnded),this.player.events.error.on(this.props.error),this.player.events.progress.on((s,o)=>{this.currentTime=s,this.duration=o}),this.props.onReady()})},this.props.onError)}play(){this.callPlayer("play")}pause(){this.callPlayer("pause")}stop(){}seekTo(e,r=!0){this.callPlayer("seek",e),r||this.pause()}setVolume(e){}getDuration(){return this.duration}getCurrentTime(){return this.currentTime}getSecondsLoaded(){return null}render(){const{url:e,config:r}=this.props,s=e.match(y.MATCH_URL_MIXCLOUD)[1],o={width:"100%",height:"100%"},n=(0,u.queryString)({...r.options,feed:`/${s}/`});return p.default.createElement("iframe",{key:s,ref:this.ref,style:o,src:`https://www.mixcloud.com/widget/iframe/?${n}`,frameBorder:"0",allow:"autoplay"})}}a(l,"displayName","Mixcloud");a(l,"canPlay",y.canPlay.mixcloud);a(l,"loopOnEnded",!0);const T=_(h),A=v({__proto__:null,default:T},[h]);export{A as M};
@@ -1 +0,0 @@
1
- import{g as m,_ as E,r as g,a as _}from"./index-a0fa87f1.js";function b(r,e){for(var t=0;t<e.length;t++){const i=e[t];if(typeof i!="string"&&!Array.isArray(i)){for(const s in i)if(s!=="default"&&!(s in r)){const o=Object.getOwnPropertyDescriptor(i,s);o&&Object.defineProperty(r,s,o.get?o:{enumerable:!0,get:()=>i[s]})}}}return Object.freeze(Object.defineProperty(r,Symbol.toStringTag,{value:"Module"}))}var L=Object.create,u=Object.defineProperty,I=Object.getOwnPropertyDescriptor,k=Object.getOwnPropertyNames,O=Object.getPrototypeOf,x=Object.prototype.hasOwnProperty,M=(r,e,t)=>e in r?u(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t,R=(r,e)=>{for(var t in e)u(r,t,{get:e[t],enumerable:!0})},f=(r,e,t,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let s of k(e))!x.call(r,s)&&s!==t&&u(r,s,{get:()=>e[s],enumerable:!(i=I(e,s))||i.enumerable});return r},w=(r,e,t)=>(t=r!=null?L(O(r)):{},f(e||!r||!r.__esModule?u(t,"default",{value:r,enumerable:!0}):t,r)),D=r=>f(u({},"__esModule",{value:!0}),r),n=(r,e,t)=>(M(r,typeof e!="symbol"?e+"":e,t),t),y={};R(y,{default:()=>l});var P=D(y),v=w(g),p=_;const j="https://cdn.jsdelivr.net/npm/@mux/mux-player@VERSION/dist/mux-player.mjs";class l extends v.Component{constructor(){super(...arguments),n(this,"onReady",(...e)=>this.props.onReady(...e)),n(this,"onPlay",(...e)=>this.props.onPlay(...e)),n(this,"onBuffer",(...e)=>this.props.onBuffer(...e)),n(this,"onBufferEnd",(...e)=>this.props.onBufferEnd(...e)),n(this,"onPause",(...e)=>this.props.onPause(...e)),n(this,"onEnded",(...e)=>this.props.onEnded(...e)),n(this,"onError",(...e)=>this.props.onError(...e)),n(this,"onPlayBackRateChange",e=>this.props.onPlaybackRateChange(e.target.playbackRate)),n(this,"onEnablePIP",(...e)=>this.props.onEnablePIP(...e)),n(this,"onSeek",e=>{this.props.onSeek(e.target.currentTime)}),n(this,"onDurationChange",()=>{const e=this.getDuration();this.props.onDuration(e)}),n(this,"mute",()=>{this.player.muted=!0}),n(this,"unmute",()=>{this.player.muted=!1}),n(this,"ref",e=>{this.player=e})}componentDidMount(){this.props.onMount&&this.props.onMount(this),this.addListeners(this.player);const e=this.getPlaybackId(this.props.url);e&&(this.player.playbackId=e)}componentWillUnmount(){this.player.playbackId=null,this.removeListeners(this.player)}addListeners(e){const{playsinline:t}=this.props;e.addEventListener("play",this.onPlay),e.addEventListener("waiting",this.onBuffer),e.addEventListener("playing",this.onBufferEnd),e.addEventListener("pause",this.onPause),e.addEventListener("seeked",this.onSeek),e.addEventListener("ended",this.onEnded),e.addEventListener("error",this.onError),e.addEventListener("ratechange",this.onPlayBackRateChange),e.addEventListener("enterpictureinpicture",this.onEnablePIP),e.addEventListener("leavepictureinpicture",this.onDisablePIP),e.addEventListener("webkitpresentationmodechanged",this.onPresentationModeChange),e.addEventListener("canplay",this.onReady),t&&e.setAttribute("playsinline","")}removeListeners(e){e.removeEventListener("canplay",this.onReady),e.removeEventListener("play",this.onPlay),e.removeEventListener("waiting",this.onBuffer),e.removeEventListener("playing",this.onBufferEnd),e.removeEventListener("pause",this.onPause),e.removeEventListener("seeked",this.onSeek),e.removeEventListener("ended",this.onEnded),e.removeEventListener("error",this.onError),e.removeEventListener("ratechange",this.onPlayBackRateChange),e.removeEventListener("enterpictureinpicture",this.onEnablePIP),e.removeEventListener("leavepictureinpicture",this.onDisablePIP),e.removeEventListener("canplay",this.onReady)}async load(e){var t;const{onError:i,config:s}=this.props;if(!((t=globalThis.customElements)!=null&&t.get("mux-player")))try{const a=j.replace("VERSION",s.version);await E(()=>import(`${a}`),[]),this.props.onLoaded()}catch(a){i(a)}const[,o]=e.match(p.MATCH_URL_MUX);this.player.playbackId=o}play(){const e=this.player.play();e&&e.catch(this.props.onError)}pause(){this.player.pause()}stop(){this.player.playbackId=null}seekTo(e,t=!0){this.player.currentTime=e,t||this.pause()}setVolume(e){this.player.volume=e}enablePIP(){this.player.requestPictureInPicture&&document.pictureInPictureElement!==this.player&&this.player.requestPictureInPicture()}disablePIP(){document.exitPictureInPicture&&document.pictureInPictureElement===this.player&&document.exitPictureInPicture()}setPlaybackRate(e){try{this.player.playbackRate=e}catch(t){this.props.onError(t)}}getDuration(){if(!this.player)return null;const{duration:e,seekable:t}=this.player;return e===1/0&&t.length>0?t.end(t.length-1):e}getCurrentTime(){return this.player?this.player.currentTime:null}getSecondsLoaded(){if(!this.player)return null;const{buffered:e}=this.player;if(e.length===0)return 0;const t=e.end(e.length-1),i=this.getDuration();return t>i?i:t}getPlaybackId(e){const[,t]=e.match(p.MATCH_URL_MUX);return t}render(){const{url:e,playing:t,loop:i,controls:s,muted:o,config:a,width:h,height:c}=this.props,d={width:h==="auto"?h:"100%",height:c==="auto"?c:"100%"};return s===!1&&(d["--controls"]="none"),v.default.createElement("mux-player",{ref:this.ref,"playback-id":this.getPlaybackId(e),style:d,preload:"auto",autoPlay:t||void 0,muted:o?"":void 0,loop:i?"":void 0,...a.attributes})}}n(l,"displayName","Mux");n(l,"canPlay",p.canPlay.mux);const C=m(P),B=b({__proto__:null,default:C},[P]);export{B as M};
@@ -1 +0,0 @@
1
- import{g as y,r as v}from"./index-a0fa87f1.js";function w(r,e){for(var t=0;t<e.length;t++){const n=e[t];if(typeof n!="string"&&!Array.isArray(n)){for(const a in n)if(a!=="default"&&!(a in r)){const o=Object.getOwnPropertyDescriptor(n,a);o&&Object.defineProperty(r,a,o.get?o:{enumerable:!0,get:()=>n[a]})}}}return Object.freeze(Object.defineProperty(r,Symbol.toStringTag,{value:"Module"}))}var P=Object.create,s=Object.defineProperty,O=Object.getOwnPropertyDescriptor,x=Object.getOwnPropertyNames,I=Object.getPrototypeOf,j=Object.prototype.hasOwnProperty,E=(r,e,t)=>e in r?s(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t,S=(r,e)=>{for(var t in e)s(r,t,{get:e[t],enumerable:!0})},_=(r,e,t,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let a of x(e))!j.call(r,a)&&a!==t&&s(r,a,{get:()=>e[a],enumerable:!(n=O(e,a))||n.enumerable});return r},C=(r,e,t)=>(t=r!=null?P(I(r)):{},_(e||!r||!r.__esModule?s(t,"default",{value:r,enumerable:!0}):t,r)),N=r=>_(s({},"__esModule",{value:!0}),r),p=(r,e,t)=>(E(r,typeof e!="symbol"?e+"":e,t),t),g={};S(g,{default:()=>k});var m=N(g),i=C(v);const u="64px",d={};class k extends i.Component{constructor(){super(...arguments),p(this,"mounted",!1),p(this,"state",{image:null}),p(this,"handleKeyPress",e=>{(e.key==="Enter"||e.key===" ")&&this.props.onClick()})}componentDidMount(){this.mounted=!0,this.fetchImage(this.props)}componentDidUpdate(e){const{url:t,light:n}=this.props;(e.url!==t||e.light!==n)&&this.fetchImage(this.props)}componentWillUnmount(){this.mounted=!1}fetchImage({url:e,light:t,oEmbedUrl:n}){if(!i.default.isValidElement(t)){if(typeof t=="string"){this.setState({image:t});return}if(d[e]){this.setState({image:d[e]});return}return this.setState({image:null}),window.fetch(n.replace("{url}",e)).then(a=>a.json()).then(a=>{if(a.thumbnail_url&&this.mounted){const o=a.thumbnail_url.replace("height=100","height=480").replace("-d_295x166","-d_640");this.setState({image:o}),d[e]=o}})}}render(){const{light:e,onClick:t,playIcon:n,previewTabIndex:a,previewAriaLabel:o}=this.props,{image:f}=this.state,l=i.default.isValidElement(e),h={display:"flex",alignItems:"center",justifyContent:"center"},c={preview:{width:"100%",height:"100%",backgroundImage:f&&!l?`url(${f})`:void 0,backgroundSize:"cover",backgroundPosition:"center",cursor:"pointer",...h},shadow:{background:"radial-gradient(rgb(0, 0, 0, 0.3), rgba(0, 0, 0, 0) 60%)",borderRadius:u,width:u,height:u,position:l?"absolute":void 0,...h},playIcon:{borderStyle:"solid",borderWidth:"16px 0 16px 26px",borderColor:"transparent transparent transparent white",marginLeft:"7px"}},b=i.default.createElement("div",{style:c.shadow,className:"react-player__shadow"},i.default.createElement("div",{style:c.playIcon,className:"react-player__play-icon"}));return i.default.createElement("div",{style:c.preview,className:"react-player__preview",onClick:t,tabIndex:a,onKeyPress:this.handleKeyPress,...o?{"aria-label":o}:{}},l?e:null,n||b)}}const D=y(m),A=w({__proto__:null,default:D},[m]);export{A as P};
@@ -1 +0,0 @@
1
- import{g as P,r as g,u as b,a as v}from"./index-a0fa87f1.js";function O(t,e){for(var r=0;r<e.length;r++){const s=e[r];if(typeof s!="string"&&!Array.isArray(s)){for(const o in s)if(o!=="default"&&!(o in t)){const i=Object.getOwnPropertyDescriptor(s,o);i&&Object.defineProperty(t,o,i.get?i:{enumerable:!0,get:()=>s[o]})}}}return Object.freeze(Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}))}var S=Object.create,l=Object.defineProperty,w=Object.getOwnPropertyDescriptor,j=Object.getOwnPropertyNames,C=Object.getPrototypeOf,E=Object.prototype.hasOwnProperty,D=(t,e,r)=>e in t?l(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,L=(t,e)=>{for(var r in e)l(t,r,{get:e[r],enumerable:!0})},d=(t,e,r,s)=>{if(e&&typeof e=="object"||typeof e=="function")for(let o of j(e))!E.call(t,o)&&o!==r&&l(t,o,{get:()=>e[o],enumerable:!(s=w(e,o))||s.enumerable});return t},R=(t,e,r)=>(r=t!=null?S(C(t)):{},d(e||!t||!t.__esModule?l(r,"default",{value:t,enumerable:!0}):r,t)),T=t=>d(l({},"__esModule",{value:!0}),t),a=(t,e,r)=>(D(t,typeof e!="symbol"?e+"":e,r),r),h={};L(h,{default:()=>u});var f=T(h),p=R(g),c=b,M=v;const x="https://w.soundcloud.com/player/api.js",A="SC";class u extends p.Component{constructor(){super(...arguments),a(this,"callPlayer",c.callPlayer),a(this,"duration",null),a(this,"currentTime",null),a(this,"fractionLoaded",null),a(this,"mute",()=>{this.setVolume(0)}),a(this,"unmute",()=>{this.props.volume!==null&&this.setVolume(this.props.volume)}),a(this,"ref",e=>{this.iframe=e})}componentDidMount(){this.props.onMount&&this.props.onMount(this)}load(e,r){(0,c.getSDK)(x,A).then(s=>{if(!this.iframe)return;const{PLAY:o,PLAY_PROGRESS:i,PAUSE:y,FINISH:_,ERROR:m}=s.Widget.Events;r||(this.player=s.Widget(this.iframe),this.player.bind(o,this.props.onPlay),this.player.bind(y,()=>{this.duration-this.currentTime<.05||this.props.onPause()}),this.player.bind(i,n=>{this.currentTime=n.currentPosition/1e3,this.fractionLoaded=n.loadedProgress}),this.player.bind(_,()=>this.props.onEnded()),this.player.bind(m,n=>this.props.onError(n))),this.player.load(e,{...this.props.config.options,callback:()=>{this.player.getDuration(n=>{this.duration=n/1e3,this.props.onReady()})}})})}play(){this.callPlayer("play")}pause(){this.callPlayer("pause")}stop(){}seekTo(e,r=!0){this.callPlayer("seekTo",e*1e3),r||this.pause()}setVolume(e){this.callPlayer("setVolume",e*100)}getDuration(){return this.duration}getCurrentTime(){return this.currentTime}getSecondsLoaded(){return this.fractionLoaded*this.duration}render(){const{display:e}=this.props,r={width:"100%",height:"100%",display:e};return p.default.createElement("iframe",{ref:this.ref,src:`https://w.soundcloud.com/player/?url=${encodeURIComponent(this.props.url)}`,style:r,frameBorder:0,allow:"autoplay"})}}a(u,"displayName","SoundCloud");a(u,"canPlay",M.canPlay.soundcloud);a(u,"loopOnEnded",!0);const N=P(f),F=O({__proto__:null,default:N},[f]);export{F as S};
@@ -1 +0,0 @@
1
- import{g as m,r as f,u as _,a as b}from"./index-a0fa87f1.js";function P(t,e){for(var r=0;r<e.length;r++){const s=e[r];if(typeof s!="string"&&!Array.isArray(s)){for(const a in s)if(a!=="default"&&!(a in t)){const n=Object.getOwnPropertyDescriptor(s,a);n&&Object.defineProperty(t,a,n.get?n:{enumerable:!0,get:()=>s[a]})}}}return Object.freeze(Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}))}var g=Object.create,l=Object.defineProperty,v=Object.getOwnPropertyDescriptor,O=Object.getOwnPropertyNames,S=Object.getPrototypeOf,j=Object.prototype.hasOwnProperty,L=(t,e,r)=>e in t?l(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,w=(t,e)=>{for(var r in e)l(t,r,{get:e[r],enumerable:!0})},c=(t,e,r,s)=>{if(e&&typeof e=="object"||typeof e=="function")for(let a of O(e))!j.call(t,a)&&a!==r&&l(t,a,{get:()=>e[a],enumerable:!(s=v(e,a))||s.enumerable});return t},D=(t,e,r)=>(r=t!=null?g(S(t)):{},c(e||!t||!t.__esModule?l(r,"default",{value:t,enumerable:!0}):r,t)),E=t=>c(l({},"__esModule",{value:!0}),t),o=(t,e,r)=>(L(t,typeof e!="symbol"?e+"":e,r),r),h={};w(h,{default:()=>i});var y=E(h),p=D(f),u=_,d=b;const M="https://cdn.embed.ly/player-0.1.0.min.js",T="playerjs";class i extends p.Component{constructor(){super(...arguments),o(this,"callPlayer",u.callPlayer),o(this,"duration",null),o(this,"currentTime",null),o(this,"secondsLoaded",null),o(this,"mute",()=>{this.callPlayer("mute")}),o(this,"unmute",()=>{this.callPlayer("unmute")}),o(this,"ref",e=>{this.iframe=e})}componentDidMount(){this.props.onMount&&this.props.onMount(this)}load(e){(0,u.getSDK)(M,T).then(r=>{this.iframe&&(this.player=new r.Player(this.iframe),this.player.setLoop(this.props.loop),this.player.on("ready",this.props.onReady),this.player.on("play",this.props.onPlay),this.player.on("pause",this.props.onPause),this.player.on("seeked",this.props.onSeek),this.player.on("ended",this.props.onEnded),this.player.on("error",this.props.onError),this.player.on("timeupdate",({duration:s,seconds:a})=>{this.duration=s,this.currentTime=a}),this.player.on("buffered",({percent:s})=>{this.duration&&(this.secondsLoaded=this.duration*s)}),this.props.muted&&this.player.mute())},this.props.onError)}play(){this.callPlayer("play")}pause(){this.callPlayer("pause")}stop(){}seekTo(e,r=!0){this.callPlayer("setCurrentTime",e),r||this.pause()}setVolume(e){this.callPlayer("setVolume",e*100)}setLoop(e){this.callPlayer("setLoop",e)}getDuration(){return this.duration}getCurrentTime(){return this.currentTime}getSecondsLoaded(){return this.secondsLoaded}render(){const e=this.props.url.match(d.MATCH_URL_STREAMABLE)[1],r={width:"100%",height:"100%"};return p.default.createElement("iframe",{ref:this.ref,src:`https://streamable.com/o/${e}`,frameBorder:"0",scrolling:"no",style:r,allow:"encrypted-media; autoplay; fullscreen;"})}}o(i,"displayName","Streamable");o(i,"canPlay",d.canPlay.streamable);const x=m(y),C=P({__proto__:null,default:x},[y]);export{C as S};
@@ -1 +0,0 @@
1
- import{g as w,r as D,u as C,a as N}from"./index-a0fa87f1.js";function I(t,e){for(var r=0;r<e.length;r++){const s=e[r];if(typeof s!="string"&&!Array.isArray(s)){for(const a in s)if(a!=="default"&&!(a in t)){const o=Object.getOwnPropertyDescriptor(s,a);o&&Object.defineProperty(t,a,o.get?o:{enumerable:!0,get:()=>s[a]})}}}return Object.freeze(Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}))}var S=Object.create,l=Object.defineProperty,j=Object.getOwnPropertyDescriptor,A=Object.getOwnPropertyNames,M=Object.getPrototypeOf,H=Object.prototype.hasOwnProperty,R=(t,e,r)=>e in t?l(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,x=(t,e)=>{for(var r in e)l(t,r,{get:e[r],enumerable:!0})},_=(t,e,r,s)=>{if(e&&typeof e=="object"||typeof e=="function")for(let a of A(e))!H.call(t,a)&&a!==r&&l(t,a,{get:()=>e[a],enumerable:!(s=j(e,a))||s.enumerable});return t},F=(t,e,r)=>(r=t!=null?S(M(t)):{},_(e||!t||!t.__esModule?l(r,"default",{value:t,enumerable:!0}):r,t)),U=t=>_(l({},"__esModule",{value:!0}),t),n=(t,e,r)=>(R(t,typeof e!="symbol"?e+"":e,r),r),P={};x(P,{default:()=>h});var f=U(P),d=F(D),c=C,u=N;const K="https://player.twitch.tv/js/embed/v1.js",V="Twitch",$="twitch-player-";class h extends d.Component{constructor(){super(...arguments),n(this,"callPlayer",c.callPlayer),n(this,"playerID",this.props.config.playerId||`${$}${(0,c.randomString)()}`),n(this,"mute",()=>{this.callPlayer("setMuted",!0)}),n(this,"unmute",()=>{this.callPlayer("setMuted",!1)})}componentDidMount(){this.props.onMount&&this.props.onMount(this)}load(e,r){const{playsinline:s,onError:a,config:o,controls:v}=this.props,i=u.MATCH_URL_TWITCH_CHANNEL.test(e),p=i?e.match(u.MATCH_URL_TWITCH_CHANNEL)[1]:e.match(u.MATCH_URL_TWITCH_VIDEO)[1];if(r){i?this.player.setChannel(p):this.player.setVideo("v"+p);return}(0,c.getSDK)(K,V).then(y=>{this.player=new y.Player(this.playerID,{video:i?"":p,channel:i?p:"",height:"100%",width:"100%",playsinline:s,autoplay:this.props.playing,muted:this.props.muted,controls:i?!0:v,time:(0,c.parseStartTime)(e),...o.options});const{READY:g,PLAYING:m,PAUSE:E,ENDED:O,ONLINE:L,OFFLINE:b,SEEK:T}=y.Player;this.player.addEventListener(g,this.props.onReady),this.player.addEventListener(m,this.props.onPlay),this.player.addEventListener(E,this.props.onPause),this.player.addEventListener(O,this.props.onEnded),this.player.addEventListener(T,this.props.onSeek),this.player.addEventListener(L,this.props.onLoaded),this.player.addEventListener(b,this.props.onLoaded)},a)}play(){this.callPlayer("play")}pause(){this.callPlayer("pause")}stop(){this.callPlayer("pause")}seekTo(e,r=!0){this.callPlayer("seek",e),r||this.pause()}setVolume(e){this.callPlayer("setVolume",e)}getDuration(){return this.callPlayer("getDuration")}getCurrentTime(){return this.callPlayer("getCurrentTime")}getSecondsLoaded(){return null}render(){const e={width:"100%",height:"100%"};return d.default.createElement("div",{style:e,id:this.playerID})}}n(h,"displayName","Twitch");n(h,"canPlay",u.canPlay.twitch);n(h,"loopOnEnded",!0);const W=w(f),G=I({__proto__:null,default:W},[f]);export{G as T};
@@ -1 +0,0 @@
1
- import{g as m,r as v,u as b,a as O}from"./index-a0fa87f1.js";function V(t,e){for(var r=0;r<e.length;r++){const s=e[r];if(typeof s!="string"&&!Array.isArray(s)){for(const a in s)if(a!=="default"&&!(a in t)){const n=Object.getOwnPropertyDescriptor(s,a);n&&Object.defineProperty(t,a,n.get?n:{enumerable:!0,get:()=>s[a]})}}}return Object.freeze(Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}))}var D=Object.create,i=Object.defineProperty,j=Object.getOwnPropertyDescriptor,w=Object.getOwnPropertyNames,S=Object.getPrototypeOf,M=Object.prototype.hasOwnProperty,A=(t,e,r)=>e in t?i(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,E=(t,e)=>{for(var r in e)i(t,r,{get:e[r],enumerable:!0})},h=(t,e,r,s)=>{if(e&&typeof e=="object"||typeof e=="function")for(let a of w(e))!M.call(t,a)&&a!==r&&i(t,a,{get:()=>e[a],enumerable:!(s=j(e,a))||s.enumerable});return t},L=(t,e,r)=>(r=t!=null?D(S(t)):{},h(e||!t||!t.__esModule?i(r,"default",{value:t,enumerable:!0}):r,t)),R=t=>h(i({},"__esModule",{value:!0}),t),o=(t,e,r)=>(A(t,typeof e!="symbol"?e+"":e,r),r),_={};E(_,{default:()=>y});var f=R(_),c=L(v),d=b,P=O;const x="https://play.vidyard.com/embed/v4.js",C="VidyardV4",N="onVidyardAPI";class y extends c.Component{constructor(){super(...arguments),o(this,"callPlayer",d.callPlayer),o(this,"mute",()=>{this.setVolume(0)}),o(this,"unmute",()=>{this.props.volume!==null&&this.setVolume(this.props.volume)}),o(this,"ref",e=>{this.container=e})}componentDidMount(){this.props.onMount&&this.props.onMount(this)}load(e){const{playing:r,config:s,onError:a,onDuration:n}=this.props,l=e&&e.match(P.MATCH_URL_VIDYARD)[1];this.player&&this.stop(),(0,d.getSDK)(x,C,N).then(p=>{this.container&&(p.api.addReadyListener((u,g)=>{this.player||(this.player=g,this.player.on("ready",this.props.onReady),this.player.on("play",this.props.onPlay),this.player.on("pause",this.props.onPause),this.player.on("seek",this.props.onSeek),this.player.on("playerComplete",this.props.onEnded))},l),p.api.renderPlayer({uuid:l,container:this.container,autoplay:r?1:0,...s.options}),p.api.getPlayerMetadata(l).then(u=>{this.duration=u.length_in_seconds,n(u.length_in_seconds)}))},a)}play(){this.callPlayer("play")}pause(){this.callPlayer("pause")}stop(){window.VidyardV4.api.destroyPlayer(this.player)}seekTo(e,r=!0){this.callPlayer("seek",e),r||this.pause()}setVolume(e){this.callPlayer("setVolume",e)}setPlaybackRate(e){this.callPlayer("setPlaybackSpeed",e)}getDuration(){return this.duration}getCurrentTime(){return this.callPlayer("currentTime")}getSecondsLoaded(){return null}render(){const{display:e}=this.props,r={width:"100%",height:"100%",display:e};return c.default.createElement("div",{style:r},c.default.createElement("div",{ref:this.ref}))}}o(y,"displayName","Vidyard");o(y,"canPlay",P.canPlay.vidyard);const T=m(f),K=V({__proto__:null,default:T},[f]);export{K as V};
@@ -1 +0,0 @@
1
- import{g as d,r as f,u as m,a as _}from"./index-a0fa87f1.js";function P(t,e){for(var r=0;r<e.length;r++){const a=e[r];if(typeof a!="string"&&!Array.isArray(a)){for(const o in a)if(o!=="default"&&!(o in t)){const s=Object.getOwnPropertyDescriptor(a,o);s&&Object.defineProperty(t,o,s.get?s:{enumerable:!0,get:()=>a[o]})}}}return Object.freeze(Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}))}var g=Object.create,n=Object.defineProperty,b=Object.getOwnPropertyDescriptor,v=Object.getOwnPropertyNames,O=Object.getPrototypeOf,D=Object.prototype.hasOwnProperty,w=(t,e,r)=>e in t?n(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,j=(t,e)=>{for(var r in e)n(t,r,{get:e[r],enumerable:!0})},h=(t,e,r,a)=>{if(e&&typeof e=="object"||typeof e=="function")for(let o of v(e))!D.call(t,o)&&o!==r&&n(t,o,{get:()=>e[o],enumerable:!(a=b(e,o))||a.enumerable});return t},M=(t,e,r)=>(r=t!=null?g(O(t)):{},h(e||!t||!t.__esModule?n(r,"default",{value:t,enumerable:!0}):r,t)),E=t=>h(n({},"__esModule",{value:!0}),t),i=(t,e,r)=>(w(t,typeof e!="symbol"?e+"":e,r),r),c={};j(c,{default:()=>l});var y=E(c),p=M(f),u=m,L=_;const S="https://player.vimeo.com/api/player.js",V="Vimeo",k=t=>t.replace("/manage/videos","");class l extends p.Component{constructor(){super(...arguments),i(this,"callPlayer",u.callPlayer),i(this,"duration",null),i(this,"currentTime",null),i(this,"secondsLoaded",null),i(this,"mute",()=>{this.setMuted(!0)}),i(this,"unmute",()=>{this.setMuted(!1)}),i(this,"ref",e=>{this.container=e})}componentDidMount(){this.props.onMount&&this.props.onMount(this)}load(e){this.duration=null,(0,u.getSDK)(S,V).then(r=>{if(!this.container)return;const{playerOptions:a,title:o}=this.props.config;this.player=new r.Player(this.container,{url:k(e),autoplay:this.props.playing,muted:this.props.muted,loop:this.props.loop,playsinline:this.props.playsinline,controls:this.props.controls,...a}),this.player.ready().then(()=>{const s=this.container.querySelector("iframe");s.style.width="100%",s.style.height="100%",o&&(s.title=o)}).catch(this.props.onError),this.player.on("loaded",()=>{this.props.onReady(),this.refreshDuration()}),this.player.on("play",()=>{this.props.onPlay(),this.refreshDuration()}),this.player.on("pause",this.props.onPause),this.player.on("seeked",s=>this.props.onSeek(s.seconds)),this.player.on("ended",this.props.onEnded),this.player.on("error",this.props.onError),this.player.on("timeupdate",({seconds:s})=>{this.currentTime=s}),this.player.on("progress",({seconds:s})=>{this.secondsLoaded=s}),this.player.on("bufferstart",this.props.onBuffer),this.player.on("bufferend",this.props.onBufferEnd),this.player.on("playbackratechange",s=>this.props.onPlaybackRateChange(s.playbackRate))},this.props.onError)}refreshDuration(){this.player.getDuration().then(e=>{this.duration=e})}play(){const e=this.callPlayer("play");e&&e.catch(this.props.onError)}pause(){this.callPlayer("pause")}stop(){this.callPlayer("unload")}seekTo(e,r=!0){this.callPlayer("setCurrentTime",e),r||this.pause()}setVolume(e){this.callPlayer("setVolume",e)}setMuted(e){this.callPlayer("setMuted",e)}setLoop(e){this.callPlayer("setLoop",e)}setPlaybackRate(e){this.callPlayer("setPlaybackRate",e)}getDuration(){return this.duration}getCurrentTime(){return this.currentTime}getSecondsLoaded(){return this.secondsLoaded}render(){const{display:e}=this.props,r={width:"100%",height:"100%",overflow:"hidden",display:e};return p.default.createElement("div",{key:this.props.url,ref:this.ref,style:r})}}i(l,"displayName","Vimeo");i(l,"canPlay",L.canPlay.vimeo);i(l,"forceLoad",!0);const T=d(y),C=P({__proto__:null,default:T},[y]);export{C as V};