{"version":3,"file":"room-BP3SCCCd.mjs","sources":["../../../node_modules/.pnpm/clsx@2.1.1/node_modules/clsx/dist/clsx.mjs","../src/mergeProps.ts","../src/utils.ts","../src/hooks/useLiveKitRoom.ts","../src/components/LiveKitRoom.tsx"],"sourcesContent":["function r(e){var t,f,n=\"\";if(\"string\"==typeof e||\"number\"==typeof e)n+=e;else if(\"object\"==typeof e)if(Array.isArray(e)){var o=e.length;for(t=0;t<o;t++)e[t]&&(f=r(e[t]))&&(n&&(n+=\" \"),n+=f)}else for(f in e)e[f]&&(n&&(n+=\" \"),n+=f);return n}export function clsx(){for(var e,t,f=0,n=\"\",o=arguments.length;f<o;f++)(e=arguments[f])&&(t=r(e))&&(n&&(n+=\" \"),n+=t);return n}export default clsx;","/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport clsx from 'clsx';\n\n/**\n * Calls all functions in the order they were chained with the same arguments.\n * @internal\n */\nexport function chain(...callbacks: any[]): (...args: any[]) => void {\n  return (...args: any[]) => {\n    for (const callback of callbacks) {\n      if (typeof callback === 'function') {\n        try {\n          callback(...args);\n        } catch (e) {\n          console.error(e);\n        }\n      }\n    }\n  };\n}\n\ninterface Props {\n  [key: string]: any;\n}\n\n// taken from: https://stackoverflow.com/questions/51603250/typescript-3-parameter-list-intersection-type/51604379#51604379\ntype TupleTypes<T> = { [P in keyof T]: T[P] } extends { [key: number]: infer V } ? V : never;\ntype UnionToIntersection<U> = (U extends any ? (k: U) => void : never) extends (k: infer I) => void\n  ? I\n  : never;\n\n/**\n * Merges multiple props objects together. Event handlers are chained,\n * classNames are combined, and ids are deduplicated - different ids\n * will trigger a side-effect and re-render components hooked up with `useId`.\n * For all other props, the last prop object overrides all previous ones.\n * @param args - Multiple sets of props to merge together.\n * @internal\n */\nexport function mergeProps<T extends Props[]>(...args: T): UnionToIntersection<TupleTypes<T>> {\n  // Start with a base clone of the first argument. This is a lot faster than starting\n  // with an empty object and adding properties as we go.\n  const result: Props = { ...args[0] };\n  for (let i = 1; i < args.length; i++) {\n    const props = args[i];\n    for (const key in props) {\n      const a = result[key];\n      const b = props[key];\n\n      // Chain events\n      if (\n        typeof a === 'function' &&\n        typeof b === 'function' &&\n        // This is a lot faster than a regex.\n        key[0] === 'o' &&\n        key[1] === 'n' &&\n        key.charCodeAt(2) >= /* 'A' */ 65 &&\n        key.charCodeAt(2) <= /* 'Z' */ 90\n      ) {\n        result[key] = chain(a, b);\n\n        // Merge classnames, sometimes classNames are empty string which eval to false, so we just need to do a type check\n      } else if (\n        (key === 'className' || key === 'UNSAFE_className') &&\n        typeof a === 'string' &&\n        typeof b === 'string'\n      ) {\n        result[key] = clsx(a, b);\n      } else {\n        result[key] = b !== undefined ? b : a;\n      }\n    }\n  }\n\n  return result as UnionToIntersection<TupleTypes<T>>;\n}\n","import * as React from 'react';\nimport { mergeProps as mergePropsReactAria } from './mergeProps';\nimport { log } from '@livekit/components-core';\nimport clsx from 'clsx';\n\n/** @internal */\nexport function isProp<U extends HTMLElement, T extends React.HTMLAttributes<U>>(\n  prop: T | undefined,\n): prop is T {\n  return prop !== undefined;\n}\n\n/** @internal */\nexport function mergeProps<\n  U extends HTMLElement,\n  T extends Array<React.HTMLAttributes<U> | undefined>,\n>(...props: T) {\n  return mergePropsReactAria(...props.filter(isProp));\n}\n\n/** @internal */\nexport function cloneSingleChild(\n  children: React.ReactNode | React.ReactNode[],\n  props?: Record<string, any>,\n  key?: any,\n) {\n  return React.Children.map(children, (child) => {\n    // Checking isValidElement is the safe way and avoids a typescript\n    // error too.\n    if (React.isValidElement(child) && React.Children.only(children)) {\n      if (child.props.className) {\n        // make sure we retain classnames of both passed props and child\n        props ??= {};\n        props.className = clsx(child.props.className, props.className);\n        props.style = { ...child.props.style, ...props.style };\n      }\n      return React.cloneElement(child, { ...props, key });\n    }\n    return child;\n  });\n}\n\n/**\n * @internal\n */\nexport function warnAboutMissingStyles(el?: HTMLElement) {\n  if (\n    typeof window !== 'undefined' &&\n    typeof process !== 'undefined' &&\n    // eslint-disable-next-line turbo/no-undeclared-env-vars\n    (process?.env?.NODE_ENV === 'dev' ||\n      // eslint-disable-next-line turbo/no-undeclared-env-vars\n      process?.env?.NODE_ENV === 'development')\n  ) {\n    const target = el ?? document.querySelector('.lk-room-container');\n    if (target && !getComputedStyle(target).getPropertyValue('--lk-has-imported-styles')) {\n      log.warn(\n        \"It looks like you're not using the `@livekit/components-styles package`. To render the UI with the default styling, please import it in your layout or page.\",\n      );\n    }\n  }\n}\n\n/**\n *\n * @internal\n * used to stringify room options to detect dependency changes for react hooks.\n * Replaces processors and e2ee options with strings.\n */\nexport function roomOptionsStringifyReplacer(key: string, val: unknown) {\n  if (key === 'processor' && val && typeof val === 'object' && 'name' in val) {\n    return val.name;\n  }\n  if (key === 'e2ee' && val) {\n    return 'e2ee-enabled';\n  }\n  return val;\n}\n","import { log, setupLiveKitRoom } from '@livekit/components-core';\nimport type { DisconnectReason } from 'livekit-client';\nimport { Room, MediaDeviceFailure, RoomEvent } from 'livekit-client';\nimport * as React from 'react';\nimport type { HTMLAttributes } from 'react';\n\nimport type { LiveKitRoomProps } from '../components';\nimport { mergeProps } from '../mergeProps';\nimport { roomOptionsStringifyReplacer } from '../utils';\n\nconst defaultRoomProps: Partial<LiveKitRoomProps> = {\n  connect: true,\n  audio: false,\n  video: false,\n};\n\n/**\n * The `useLiveKitRoom` hook is used to implement the `LiveKitRoom` or your custom implementation of it.\n * It returns a `Room` instance and HTML props that should be applied to the root element of the component.\n *\n * @example\n * ```tsx\n * const { room, htmlProps } = useLiveKitRoom();\n * return <div {...htmlProps}>...</div>;\n * ```\n * @public\n */\nexport function useLiveKitRoom<T extends HTMLElement>(\n  props: LiveKitRoomProps,\n): {\n  room: Room | undefined;\n  htmlProps: HTMLAttributes<T>;\n} {\n  const {\n    token,\n    serverUrl,\n    options,\n    room: passedRoom,\n    connectOptions,\n    connect,\n    audio,\n    video,\n    screen,\n    onConnected,\n    onDisconnected,\n    onError,\n    onMediaDeviceFailure,\n    onEncryptionError,\n    simulateParticipants,\n    ...rest\n  } = { ...defaultRoomProps, ...props };\n  if (options && passedRoom) {\n    log.warn(\n      'when using a manually created room, the options object will be ignored. set the desired options directly when creating the room instead.',\n    );\n  }\n\n  const [room, setRoom] = React.useState<Room | undefined>();\n\n  const shouldConnect = React.useRef(connect);\n\n  React.useEffect(() => {\n    setRoom(passedRoom ?? new Room(options));\n  }, [passedRoom, JSON.stringify(options, roomOptionsStringifyReplacer)]);\n\n  const htmlProps = React.useMemo(() => {\n    const { className } = setupLiveKitRoom();\n    return mergeProps(rest, { className }) as HTMLAttributes<T>;\n  }, [rest]);\n\n  React.useEffect(() => {\n    if (!room) return;\n    const onSignalConnected = () => {\n      const localP = room.localParticipant;\n\n      log.debug('trying to publish local tracks');\n      Promise.all([\n        localP.setMicrophoneEnabled(!!audio, typeof audio !== 'boolean' ? audio : undefined),\n        localP.setCameraEnabled(!!video, typeof video !== 'boolean' ? video : undefined),\n        localP.setScreenShareEnabled(!!screen, typeof screen !== 'boolean' ? screen : undefined),\n      ]).catch((e) => {\n        log.warn(e);\n        onError?.(e as Error);\n      });\n    };\n\n    const handleMediaDeviceError = (e: Error, kind?: MediaDeviceKind) => {\n      const mediaDeviceFailure = MediaDeviceFailure.getFailure(e);\n      onMediaDeviceFailure?.(mediaDeviceFailure, kind);\n    };\n    const handleEncryptionError = (e: Error) => {\n      onEncryptionError?.(e);\n    };\n    const handleDisconnected = (reason?: DisconnectReason) => {\n      onDisconnected?.(reason);\n    };\n    const handleConnected = () => {\n      onConnected?.();\n    };\n\n    room\n      .on(RoomEvent.SignalConnected, onSignalConnected)\n      .on(RoomEvent.MediaDevicesError, handleMediaDeviceError)\n      .on(RoomEvent.EncryptionError, handleEncryptionError)\n      .on(RoomEvent.Disconnected, handleDisconnected)\n      .on(RoomEvent.Connected, handleConnected);\n\n    return () => {\n      room\n        .off(RoomEvent.SignalConnected, onSignalConnected)\n        .off(RoomEvent.MediaDevicesError, handleMediaDeviceError)\n        .off(RoomEvent.EncryptionError, handleEncryptionError)\n        .off(RoomEvent.Disconnected, handleDisconnected)\n        .off(RoomEvent.Connected, handleConnected);\n    };\n  }, [\n    room,\n    audio,\n    video,\n    screen,\n    onError,\n    onEncryptionError,\n    onMediaDeviceFailure,\n    onConnected,\n    onDisconnected,\n  ]);\n\n  React.useEffect(() => {\n    if (!room) return;\n\n    if (simulateParticipants) {\n      room.simulateParticipants({\n        participants: {\n          count: simulateParticipants,\n        },\n        publish: {\n          audio: true,\n          useRealTracks: true,\n        },\n      });\n      return;\n    }\n\n    if (connect) {\n      shouldConnect.current = true;\n      log.debug('connecting');\n      if (!token) {\n        log.debug('no token yet');\n        return;\n      }\n      if (!serverUrl) {\n        log.warn('no livekit url provided');\n        onError?.(Error('no livekit url provided'));\n        return;\n      }\n      room.connect(serverUrl, token, connectOptions).catch((e) => {\n        log.warn(e);\n        if (shouldConnect.current === true) {\n          onError?.(e as Error);\n        }\n      });\n    } else {\n      log.debug('disconnecting because connect is false');\n      shouldConnect.current = false;\n      room.disconnect();\n    }\n  }, [\n    connect,\n    token,\n    JSON.stringify(connectOptions),\n    room,\n    onError,\n    serverUrl,\n    simulateParticipants,\n  ]);\n\n  React.useEffect(() => {\n    if (!room) return;\n    return () => {\n      log.info('disconnecting on onmount');\n      room.disconnect();\n    };\n  }, [room]);\n\n  return { room, htmlProps };\n}\n","import type {\n  AudioCaptureOptions,\n  DisconnectReason,\n  RoomConnectOptions,\n  RoomOptions,\n  ScreenShareCaptureOptions,\n  VideoCaptureOptions,\n} from 'livekit-client';\nimport type { MediaDeviceFailure, Room } from 'livekit-client';\nimport * as React from 'react';\nimport { type FeatureFlags, LKFeatureContext, RoomContext } from '../context';\nimport { useLiveKitRoom } from '../hooks';\n\n/** @public */\nexport interface LiveKitRoomProps extends Omit<React.HTMLAttributes<HTMLDivElement>, 'onError'> {\n  /**\n   * URL to the LiveKit server.\n   * For example: `wss://<domain>.livekit.cloud`\n   * To simplify the implementation, `undefined` is also accepted as an intermediate value, but only with a valid string url can the connection be established.\n   */\n  serverUrl: string | undefined;\n  /**\n   * A user specific access token for a client to authenticate to the room.\n   * This token is necessary to establish a connection to the room.\n   * To simplify the implementation, `undefined` is also accepted as an intermediate value, but only with a valid string token can the connection be established.\n   *\n   * @see https://docs.livekit.io/cloud/project-management/keys-and-tokens/#generating-access-tokens\n   */\n  token: string | undefined;\n  /**\n   * Publish audio immediately after connecting to your LiveKit room.\n   * @defaultValue `false`\n   * @see https://docs.livekit.io/client-sdk-js/interfaces/AudioCaptureOptions.html\n   */\n  audio?: AudioCaptureOptions | boolean;\n  /**\n   * Publish video immediately after connecting to your LiveKit room.\n   * @defaultValue `false`\n   * @see https://docs.livekit.io/client-sdk-js/interfaces/VideoCaptureOptions.html\n   */\n  video?: VideoCaptureOptions | boolean;\n  /**\n   * Publish screen share immediately after connecting to your LiveKit room.\n   * @defaultValue `false`\n   * @see https://docs.livekit.io/client-sdk-js/interfaces/ScreenShareCaptureOptions.html\n   */\n  screen?: ScreenShareCaptureOptions | boolean;\n  /**\n   * If set to true a connection to LiveKit room is initiated.\n   * @defaultValue `true`\n   */\n  connect?: boolean;\n  /**\n   * Options for when creating a new room.\n   * When you pass your own room instance to this component, these options have no effect.\n   * Instead, set the options directly in the room instance.\n   *\n   * @see https://docs.livekit.io/client-sdk-js/interfaces/RoomOptions.html\n   */\n  options?: RoomOptions;\n  /**\n   * Define options how to connect to the LiveKit server.\n   *\n   * @see https://docs.livekit.io/client-sdk-js/interfaces/RoomConnectOptions.html\n   */\n  connectOptions?: RoomConnectOptions;\n  onConnected?: () => void;\n  onDisconnected?: (reason?: DisconnectReason) => void;\n  onError?: (error: Error) => void;\n  onMediaDeviceFailure?: (failure?: MediaDeviceFailure, kind?: MediaDeviceKind) => void;\n  onEncryptionError?: (error: Error) => void;\n  /**\n   * Optional room instance.\n   * By passing your own room instance you overwrite the `options` parameter,\n   * make sure to set the options directly on the room instance itself.\n   */\n  room?: Room;\n\n  simulateParticipants?: number | undefined;\n\n  /**\n   * @internal\n   */\n  featureFlags?: FeatureFlags;\n}\n\n/**\n * The `LiveKitRoom` component provides the room context to all its child components.\n * It is generally the starting point of your LiveKit app and the root of the LiveKit component tree.\n * It provides the room state as a React context to all child components, so you don't have to pass it yourself.\n *\n * @example\n * ```tsx\n * <LiveKitRoom\n *  token='<livekit-token>'\n *  serverUrl='<url-to-livekit-server>'\n *  connect={true}\n * >\n *     ...\n * </LiveKitRoom>\n * ```\n * @public\n */\nexport const LiveKitRoom: (\n  props: React.PropsWithChildren<LiveKitRoomProps> & React.RefAttributes<HTMLDivElement>,\n) => React.ReactNode = /* @__PURE__ */ React.forwardRef<\n  HTMLDivElement,\n  React.PropsWithChildren<LiveKitRoomProps>\n>(function LiveKitRoom(props: React.PropsWithChildren<LiveKitRoomProps>, ref) {\n  const { room, htmlProps } = useLiveKitRoom(props);\n  return (\n    <div ref={ref} {...htmlProps}>\n      {room && (\n        <RoomContext.Provider value={room}>\n          <LKFeatureContext.Provider value={props.featureFlags}>\n            {props.children}\n          </LKFeatureContext.Provider>\n        </RoomContext.Provider>\n      )}\n    </div>\n  );\n});\n"],"names":["r","e","t","f","n","o","clsx","chain","callbacks","args","callback","mergeProps","result","i","props","key","a","b","isProp","prop","mergePropsReactAria","cloneSingleChild","children","React","child","warnAboutMissingStyles","el","_a","_b","target","log","roomOptionsStringifyReplacer","val","defaultRoomProps","useLiveKitRoom","token","serverUrl","options","passedRoom","connectOptions","connect","audio","video","screen","onConnected","onDisconnected","onError","onMediaDeviceFailure","onEncryptionError","simulateParticipants","rest","room","setRoom","shouldConnect","Room","htmlProps","className","setupLiveKitRoom","onSignalConnected","localP","handleMediaDeviceError","kind","mediaDeviceFailure","MediaDeviceFailure","handleEncryptionError","handleDisconnected","reason","handleConnected","RoomEvent","LiveKitRoom","ref","RoomContext","LKFeatureContext"],"mappings":";;;AAAA,SAASA,EAAEC,GAAE;AAAC,MAAIC,GAAEC,GAAEC,IAAE;AAAG,MAAa,OAAOH,KAAjB,YAA8B,OAAOA,KAAjB,SAAmB,CAAAG,KAAGH;AAAA,WAAoB,OAAOA,KAAjB,SAAmB,KAAG,MAAM,QAAQA,CAAC,GAAE;AAAC,QAAII,IAAEJ,EAAE;AAAO,SAAIC,IAAE,GAAEA,IAAEG,GAAEH,IAAI,CAAAD,EAAEC,CAAC,MAAIC,IAAEH,EAAEC,EAAEC,CAAC,CAAC,OAAKE,MAAIA,KAAG,MAAKA,KAAGD;AAAA,EAAE,MAAM,MAAIA,KAAKF,EAAE,CAAAA,EAAEE,CAAC,MAAIC,MAAIA,KAAG,MAAKA,KAAGD;AAAG,SAAOC;AAAC;AAAQ,SAASE,IAAM;AAAC,WAAQL,GAAEC,GAAEC,IAAE,GAAEC,IAAE,IAAGC,IAAE,UAAU,QAAOF,IAAEE,GAAEF,IAAI,EAACF,IAAE,UAAUE,CAAC,OAAKD,IAAEF,EAAEC,CAAC,OAAKG,MAAIA,KAAG,MAAKA,KAAGF;AAAG,SAAOE;AAAC;ACkBxW,SAASG,KAASC,GAA4C;AACnE,SAAO,IAAIC,MAAgB;AACzB,eAAWC,KAAYF;AACrB,UAAI,OAAOE,KAAa;AACtB,YAAI;AACF,UAAAA,EAAS,GAAGD,CAAI;AAAA,QAClB,SAASR,GAAG;AACV,kBAAQ,MAAMA,CAAC;AAAA,QACjB;AAAA,EAGN;AACF;AAoBO,SAASU,KAAiCF,GAA6C;AAG5F,QAAMG,IAAgB,EAAE,GAAGH,EAAK,CAAC,EAAA;AACjC,WAASI,IAAI,GAAGA,IAAIJ,EAAK,QAAQI,KAAK;AACpC,UAAMC,IAAQL,E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