@omnidotdev/rdk 0.5.1 → 0.6.0

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 (48) hide show
  1. package/build/engine/useXRStore.d.ts +4 -12
  2. package/build/engine/useXRStore.d.ts.map +1 -1
  3. package/build/fiducial/FiducialAnchor.d.ts.map +1 -1
  4. package/build/fiducial/FiducialSession.d.ts +1 -4
  5. package/build/fiducial/FiducialSession.d.ts.map +1 -1
  6. package/build/fiducial/fiducialBackend.d.ts +9 -1
  7. package/build/fiducial/fiducialBackend.d.ts.map +1 -1
  8. package/build/fiducial/index.d.ts +2 -1
  9. package/build/fiducial/index.d.ts.map +1 -1
  10. package/build/fiducial/useFiducialBackend.d.ts +14 -0
  11. package/build/fiducial/useFiducialBackend.d.ts.map +1 -0
  12. package/build/geolocation/GeolocationAnchor.d.ts.map +1 -1
  13. package/build/geolocation/GeolocationSession.d.ts +1 -4
  14. package/build/geolocation/GeolocationSession.d.ts.map +1 -1
  15. package/build/geolocation/geolocationBackend.d.ts +40 -1
  16. package/build/geolocation/geolocationBackend.d.ts.map +1 -1
  17. package/build/geolocation/index.d.ts +2 -1
  18. package/build/geolocation/index.d.ts.map +1 -1
  19. package/build/geolocation/useGeolocationBackend.d.ts +14 -0
  20. package/build/geolocation/useGeolocationBackend.d.ts.map +1 -0
  21. package/build/immersive/ImmersiveSession.d.ts.map +1 -1
  22. package/build/index.cjs +1 -1
  23. package/build/index.d.ts +2 -1
  24. package/build/index.d.ts.map +1 -1
  25. package/build/index.js +378 -398
  26. package/build/lib/types/engine/backend/Backend.interface.d.ts +20 -4
  27. package/build/lib/types/engine/backend/Backend.interface.d.ts.map +1 -1
  28. package/build/lib/types/engine/backend/BackendInitArgs.interface.d.ts +4 -4
  29. package/build/lib/types/engine/backend/BackendInitArgs.interface.d.ts.map +1 -1
  30. package/build/lib/types/engine/backend/index.d.ts +2 -1
  31. package/build/lib/types/engine/backend/index.d.ts.map +1 -1
  32. package/build/lib/types/engine/index.d.ts +2 -2
  33. package/build/lib/types/engine/index.d.ts.map +1 -1
  34. package/package.json +17 -19
  35. package/build/lib/types/engine/context/ContextValue.interface.d.ts +0 -16
  36. package/build/lib/types/engine/context/ContextValue.interface.d.ts.map +0 -1
  37. package/build/lib/types/engine/context/index.d.ts +0 -2
  38. package/build/lib/types/engine/context/index.d.ts.map +0 -1
  39. package/build/lib/types/index.d.ts +0 -3
  40. package/build/lib/types/index.d.ts.map +0 -1
  41. package/build/lib/util/immersive/fromWebXRSessionMode.d.ts +0 -7
  42. package/build/lib/util/immersive/fromWebXRSessionMode.d.ts.map +0 -1
  43. package/build/lib/util/immersive/index.d.ts +0 -4
  44. package/build/lib/util/immersive/index.d.ts.map +0 -1
  45. package/build/lib/util/immersive/isImmersiveModeSupported.d.ts +0 -7
  46. package/build/lib/util/immersive/isImmersiveModeSupported.d.ts.map +0 -1
  47. package/build/lib/util/immersive/toWebXRSessionMode.d.ts +0 -7
  48. package/build/lib/util/immersive/toWebXRSessionMode.d.ts.map +0 -1
@@ -1,19 +1,11 @@
1
1
  import { XRStore as ReactThreeXRStore } from '@react-three/xr';
2
- import { Backend } from 'lib/types/engine';
2
+ import { Backend, BackendType } from 'lib/types/engine';
3
3
  import { Camera, Scene, WebGLRenderer } from 'three';
4
- export declare const SESSION_TYPES: {
5
- readonly FIDUCIAL: "FiducialSession";
6
- readonly GEOLOCATION: "GeolocationSession";
7
- readonly IMMERSIVE: "ImmersiveSession";
8
- };
9
- export type XRSessionType = (typeof SESSION_TYPES)[keyof typeof SESSION_TYPES];
10
4
  interface BaseXRStoreState {
11
5
  /** Shared video element. */
12
6
  video?: HTMLVideoElement | null;
13
7
  /** Active backends registered by sessions. */
14
- backends: Backend[];
15
- /** Active session types for compatibility checking. */
16
- sessionTypes: Set<XRSessionType>;
8
+ backends: Map<BackendType, Backend>;
17
9
  /** Store instance for immersive sessions. */
18
10
  immersiveStore?: ReactThreeXRStore | null;
19
11
  }
@@ -23,9 +15,9 @@ interface BaseXRStoreActions {
23
15
  scene: Scene;
24
16
  camera: Camera;
25
17
  renderer: WebGLRenderer;
26
- }, sessionType?: XRSessionType) => Promise<void>;
18
+ }) => Promise<void>;
27
19
  /** Unregister a backend (called by sessions). */
28
- unregisterBackend: (backend: Backend, sessionType?: XRSessionType) => void;
20
+ unregisterBackend: (backend: Backend) => void;
29
21
  /** Set shared video element. */
30
22
  setVideo: (video: HTMLVideoElement | null) => void;
31
23
  /** Update all registered backends (called per frame). */
@@ -1 +1 @@
1
- {"version":3,"file":"useXRStore.d.ts","sourceRoot":"","sources":["../../src/engine/useXRStore.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,OAAO,IAAI,iBAAiB,EAAE,MAAM,iBAAiB,CAAC;AACpE,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAChD,OAAO,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAE1D,eAAO,MAAM,aAAa;;;;CAIhB,CAAC;AAEX,MAAM,MAAM,aAAa,GAAG,CAAC,OAAO,aAAa,CAAC,CAAC,MAAM,OAAO,aAAa,CAAC,CAAC;AAE/E,UAAU,gBAAgB;IACxB,4BAA4B;IAC5B,KAAK,CAAC,EAAE,gBAAgB,GAAG,IAAI,CAAC;IAChC,8CAA8C;IAC9C,QAAQ,EAAE,OAAO,EAAE,CAAC;IACpB,uDAAuD;IACvD,YAAY,EAAE,GAAG,CAAC,aAAa,CAAC,CAAC;IACjC,6CAA6C;IAC7C,cAAc,CAAC,EAAE,iBAAiB,GAAG,IAAI,CAAC;CAC3C;AAED,UAAU,kBAAkB;IAC1B,+CAA+C;IAC/C,eAAe,EAAE,CACf,OAAO,EAAE,OAAO,EAChB,SAAS,EAAE;QAAE,KAAK,EAAE,KAAK,CAAC;QAAC,MAAM,EAAE,MAAM,CAAC;QAAC,QAAQ,EAAE,aAAa,CAAA;KAAE,EACpE,WAAW,CAAC,EAAE,aAAa,KACxB,OAAO,CAAC,IAAI,CAAC,CAAC;IACnB,iDAAiD;IACjD,iBAAiB,EAAE,CAAC,OAAO,EAAE,OAAO,EAAE,WAAW,CAAC,EAAE,aAAa,KAAK,IAAI,CAAC;IAC3E,gCAAgC;IAChC,QAAQ,EAAE,CAAC,KAAK,EAAE,gBAAgB,GAAG,IAAI,KAAK,IAAI,CAAC;IACnD,yDAAyD;IACzD,cAAc,EAAE,CAAC,EAAE,CAAC,EAAE,MAAM,KAAK,IAAI,CAAC;IACtC,oCAAoC;IACpC,iBAAiB,EAAE,CAAC,KAAK,EAAE,iBAAiB,GAAG,IAAI,KAAK,IAAI,CAAC;CAC9D;AAED,KAAK,WAAW,GAAG,gBAAgB,GAAG,kBAAkB,CAAC;AAEzD,MAAM,MAAM,OAAO,GAAG,WAAW,GAAG;IAClC,WAAW,EAAE,OAAO,CAAC;IACrB,SAAS,EAAE,iBAAiB,GAAG,IAAI,CAAC;CACrC,CAAC;AA+FF,eAAO,MAAM,UAAU,mBAAkC,CAAC;AAC1D,eAAO,MAAM,kBAAkB;;;;;;CAA2B,CAAC;AAE3D;;GAEG;AACH,QAAA,MAAM,UAAU,GAAI,CAAC,GAAG,OAAO,EAAE,WAAW,CAAC,KAAK,EAAE,OAAO,KAAK,CAAC,KAc5C,CACpB,CAAC;AAEF,eAAe,UAAU,CAAC"}
1
+ {"version":3,"file":"useXRStore.d.ts","sourceRoot":"","sources":["../../src/engine/useXRStore.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,OAAO,IAAI,iBAAiB,EAAE,MAAM,iBAAiB,CAAC;AACpE,OAAO,KAAK,EAAE,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAC7D,OAAO,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAE1D,UAAU,gBAAgB;IACxB,4BAA4B;IAC5B,KAAK,CAAC,EAAE,gBAAgB,GAAG,IAAI,CAAC;IAChC,8CAA8C;IAC9C,QAAQ,EAAE,GAAG,CAAC,WAAW,EAAE,OAAO,CAAC,CAAC;IACpC,6CAA6C;IAC7C,cAAc,CAAC,EAAE,iBAAiB,GAAG,IAAI,CAAC;CAC3C;AAED,UAAU,kBAAkB;IAC1B,+CAA+C;IAC/C,eAAe,EAAE,CACf,OAAO,EAAE,OAAO,EAChB,SAAS,EAAE;QAAE,KAAK,EAAE,KAAK,CAAC;QAAC,MAAM,EAAE,MAAM,CAAC;QAAC,QAAQ,EAAE,aAAa,CAAA;KAAE,KACjE,OAAO,CAAC,IAAI,CAAC,CAAC;IACnB,iDAAiD;IACjD,iBAAiB,EAAE,CAAC,OAAO,EAAE,OAAO,KAAK,IAAI,CAAC;IAC9C,gCAAgC;IAChC,QAAQ,EAAE,CAAC,KAAK,EAAE,gBAAgB,GAAG,IAAI,KAAK,IAAI,CAAC;IACnD,yDAAyD;IACzD,cAAc,EAAE,CAAC,EAAE,CAAC,EAAE,MAAM,KAAK,IAAI,CAAC;IACtC,oCAAoC;IACpC,iBAAiB,EAAE,CAAC,KAAK,EAAE,iBAAiB,GAAG,IAAI,KAAK,IAAI,CAAC;CAC9D;AAED,KAAK,WAAW,GAAG,gBAAgB,GAAG,kBAAkB,CAAC;AAEzD,MAAM,MAAM,OAAO,GAAG,WAAW,GAAG;IAClC,WAAW,EAAE,OAAO,CAAC;IACrB,SAAS,EAAE,iBAAiB,GAAG,IAAI,CAAC;CACrC,CAAC;AA0FF,eAAO,MAAM,UAAU,mBAAkC,CAAC;AAC1D,eAAO,MAAM,kBAAkB;;;;;;CAA2B,CAAC;AAE3D;;GAEG;AACH,QAAA,MAAM,UAAU,GAAI,CAAC,GAAG,OAAO,EAAE,WAAW,CAAC,KAAK,EAAE,OAAO,KAAK,CAAC,KAc5C,CACpB,CAAC;AAEF,eAAe,UAAU,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"FiducialAnchor.d.ts","sourceRoot":"","sources":["../../src/fiducial/FiducialAnchor.tsx"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,OAAO,CAAC;AAG/C,MAAM,WAAW,mBAAoB,SAAQ,iBAAiB;IAC5D,mBAAmB;IACnB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,qBAAqB;IACrB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,6BAA6B;IAC7B,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACjC,+CAA+C;IAC/C,aAAa,CAAC,EAAE,MAAM,IAAI,CAAC;IAC3B,8CAA8C;IAC9C,YAAY,CAAC,EAAE,MAAM,IAAI,CAAC;CAC3B;AAED;;GAEG;AACH,QAAA,MAAM,cAAc,GAAI,8EAOrB,mBAAmB,4CA+HrB,CAAC;AAEF,eAAe,cAAc,CAAC"}
1
+ {"version":3,"file":"FiducialAnchor.d.ts","sourceRoot":"","sources":["../../src/fiducial/FiducialAnchor.tsx"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,OAAO,CAAC;AAG/C,MAAM,WAAW,mBAAoB,SAAQ,iBAAiB;IAC5D,mBAAmB;IACnB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,qBAAqB;IACrB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,6BAA6B;IAC7B,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACjC,+CAA+C;IAC/C,aAAa,CAAC,EAAE,MAAM,IAAI,CAAC;IAC3B,8CAA8C;IAC9C,YAAY,CAAC,EAAE,MAAM,IAAI,CAAC;CAC3B;AAED;;GAEG;AACH,QAAA,MAAM,cAAc,GAAI,8EAOrB,mBAAmB,4CAqHrB,CAAC;AAEF,eAAe,cAAc,CAAC"}
@@ -8,9 +8,6 @@ export interface FiducialSessionProps extends PropsWithChildren {
8
8
  * Manage the fiducial marker detection backend.
9
9
  * Registers with the XR session provider and provides AR.js marker tracking capabilities.
10
10
  */
11
- declare const FiducialSession: {
12
- ({ options, children }: FiducialSessionProps): import('react').ReactNode;
13
- sessionType: string;
14
- };
11
+ declare const FiducialSession: ({ options, children }: FiducialSessionProps) => import('react').ReactNode;
15
12
  export default FiducialSession;
16
13
  //# sourceMappingURL=FiducialSession.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"FiducialSession.d.ts","sourceRoot":"","sources":["../../src/fiducial/FiducialSession.tsx"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,OAAO,CAAC;AAE/C,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,mBAAmB,CAAC;AAEhE,MAAM,WAAW,oBAAqB,SAAQ,iBAAiB;IAC7D,gCAAgC;IAChC,OAAO,CAAC,EAAE,sBAAsB,CAAC;CAClC;AAED;;;GAGG;AACH,QAAA,MAAM,eAAe;4BAAgC,oBAAoB;;CAgDxE,CAAC;AAKF,eAAe,eAAe,CAAC"}
1
+ {"version":3,"file":"FiducialSession.d.ts","sourceRoot":"","sources":["../../src/fiducial/FiducialSession.tsx"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,OAAO,CAAC;AAE/C,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,mBAAmB,CAAC;AAEhE,MAAM,WAAW,oBAAqB,SAAQ,iBAAiB;IAC7D,gCAAgC;IAChC,OAAO,CAAC,EAAE,sBAAsB,CAAC;CAClC;AAED;;;GAGG;AACH,QAAA,MAAM,eAAe,GAAI,uBAA4B,oBAAoB,8BA4CxE,CAAC;AAEF,eAAe,eAAe,CAAC"}
@@ -1,4 +1,12 @@
1
+ import { ArToolkitContext, ArToolkitSource } from '@ar-js-org/ar.js/three.js/build/ar-threex';
1
2
  import { Backend } from 'lib/types/engine';
3
+ /**
4
+ * Internal state exposed by the fiducial backend.
5
+ */
6
+ export interface FiducialInternal {
7
+ arSource: ArToolkitSource | null;
8
+ arContext: ArToolkitContext | null;
9
+ }
2
10
  export interface FiducialSessionOptions {
3
11
  /** Input source type. */
4
12
  sourceType?: "webcam" | "image" | "video";
@@ -14,6 +22,6 @@ export interface FiducialSessionOptions {
14
22
  /**
15
23
  * Create a fiducial marker-based AR backend.
16
24
  */
17
- declare const createFiducialBackend: (options: FiducialSessionOptions) => Backend;
25
+ declare const createFiducialBackend: (options?: FiducialSessionOptions) => Backend<FiducialInternal>;
18
26
  export default createFiducialBackend;
19
27
  //# sourceMappingURL=fiducialBackend.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"fiducialBackend.d.ts","sourceRoot":"","sources":["../../src/fiducial/fiducialBackend.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,OAAO,EAAmB,MAAM,kBAAkB,CAAC;AAGjE,MAAM,WAAW,sBAAsB;IACrC,yBAAyB;IACzB,UAAU,CAAC,EAAE,QAAQ,GAAG,OAAO,GAAG,OAAO,CAAC;IAC1C,6BAA6B;IAC7B,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAC7B,sBAAsB;IACtB,aAAa,CAAC,EAAE,OAAO,GAAG,kBAAkB,GAAG,MAAM,GAAG,iBAAiB,CAAC;IAC1E,qBAAqB;IACrB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,wBAAwB;IACxB,cAAc,CAAC,EACX,KAAK,GACL,eAAe,GACf,cAAc,GACd,KAAK,GACL,gBAAgB,GAChB,gBAAgB,CAAC;CACtB;AAWD;;GAEG;AACH,QAAA,MAAM,qBAAqB,GAAI,SAAS,sBAAsB,KAAG,OAwJhE,CAAC;AAEF,eAAe,qBAAqB,CAAC"}
1
+ {"version":3,"file":"fiducialBackend.d.ts","sourceRoot":"","sources":["../../src/fiducial/fiducialBackend.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,gBAAgB,EAChB,eAAe,EAChB,MAAM,2CAA2C,CAAC;AAInD,OAAO,KAAK,EAAE,OAAO,EAAmB,MAAM,kBAAkB,CAAC;AAGjE;;GAEG;AACH,MAAM,WAAW,gBAAgB;IAC/B,QAAQ,EAAE,eAAe,GAAG,IAAI,CAAC;IACjC,SAAS,EAAE,gBAAgB,GAAG,IAAI,CAAC;CACpC;AAED,MAAM,WAAW,sBAAsB;IACrC,yBAAyB;IACzB,UAAU,CAAC,EAAE,QAAQ,GAAG,OAAO,GAAG,OAAO,CAAC;IAC1C,6BAA6B;IAC7B,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAC7B,sBAAsB;IACtB,aAAa,CAAC,EAAE,OAAO,GAAG,kBAAkB,GAAG,MAAM,GAAG,iBAAiB,CAAC;IAC1E,qBAAqB;IACrB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,wBAAwB;IACxB,cAAc,CAAC,EACX,KAAK,GACL,eAAe,GACf,cAAc,GACd,KAAK,GACL,gBAAgB,GAChB,gBAAgB,CAAC;CACtB;AAED;;GAEG;AACH,QAAA,MAAM,qBAAqB,GACzB,UAAU,sBAAsB,KAC/B,OAAO,CAAC,gBAAgB,CA+I1B,CAAC;AAEF,eAAe,qBAAqB,CAAC"}
@@ -1,7 +1,8 @@
1
1
  export { default as FiducialAnchor } from './FiducialAnchor';
2
2
  export { default as FiducialSession } from './FiducialSession';
3
3
  export { default as createFiducialBackend } from './fiducialBackend';
4
+ export { default as useFiducialBackend } from './useFiducialBackend';
4
5
  export type { FiducialAnchorProps } from './FiducialAnchor';
5
6
  export type { FiducialSessionProps } from './FiducialSession';
6
- export type { FiducialSessionOptions } from './fiducialBackend';
7
+ export type { FiducialInternal, FiducialSessionOptions, } from './fiducialBackend';
7
8
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/fiducial/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAC7D,OAAO,EAAE,OAAO,IAAI,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAC/D,OAAO,EAAE,OAAO,IAAI,qBAAqB,EAAE,MAAM,mBAAmB,CAAC;AAErE,YAAY,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AAC5D,YAAY,EAAE,oBAAoB,EAAE,MAAM,mBAAmB,CAAC;AAC9D,YAAY,EAAE,sBAAsB,EAAE,MAAM,mBAAmB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/fiducial/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAC7D,OAAO,EAAE,OAAO,IAAI,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAC/D,OAAO,EAAE,OAAO,IAAI,qBAAqB,EAAE,MAAM,mBAAmB,CAAC;AACrE,OAAO,EAAE,OAAO,IAAI,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAErE,YAAY,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AAC5D,YAAY,EAAE,oBAAoB,EAAE,MAAM,mBAAmB,CAAC;AAC9D,YAAY,EACV,gBAAgB,EAChB,sBAAsB,GACvB,MAAM,mBAAmB,CAAC"}
@@ -0,0 +1,14 @@
1
+ import { FiducialInternal } from './fiducialBackend';
2
+ /**
3
+ * Access the fiducial backend internals.
4
+ * @returns fiducial backend or null if no fiducial session is active.
5
+ *
6
+ * @example
7
+ * ```tsx
8
+ * const fiducial = useFiducialBackend();
9
+ * const arContext = fiducial?.arContext;
10
+ * ```
11
+ */
12
+ declare const useFiducialBackend: () => FiducialInternal | null;
13
+ export default useFiducialBackend;
14
+ //# sourceMappingURL=useFiducialBackend.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useFiducialBackend.d.ts","sourceRoot":"","sources":["../../src/fiducial/useFiducialBackend.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AAE1D;;;;;;;;;GASG;AACH,QAAA,MAAM,kBAAkB,QAAO,gBAAgB,GAAG,IAMjD,CAAC;AAEF,eAAe,kBAAkB,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"GeolocationAnchor.d.ts","sourceRoot":"","sources":["../../src/geolocation/GeolocationAnchor.tsx"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,OAAO,CAAC;AAC/C,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,sBAAsB,CAAC;AA8BtE,MAAM,WAAW,sBACf,SAAQ,IAAI,CAAC,yBAAyB,EAAE,aAAa,CAAC,EACpD,iBAAiB;IACnB,wFAAwF;IACxF,QAAQ,EAAE,MAAM,CAAC;IACjB,yFAAyF;IACzF,SAAS,EAAE,MAAM,CAAC;IAClB;;;OAGG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB;;;OAGG;IACH,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,wEAAwE;IACxE,QAAQ,CAAC,EAAE,MAAM,IAAI,CAAC;CACvB;AAED;;GAEG;AACH,QAAA,MAAM,iBAAiB,GAAI,2GAQxB,sBAAsB,gCAiNxB,CAAC;AAEF,eAAe,iBAAiB,CAAC"}
1
+ {"version":3,"file":"GeolocationAnchor.d.ts","sourceRoot":"","sources":["../../src/geolocation/GeolocationAnchor.tsx"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,OAAO,CAAC;AAC/C,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,sBAAsB,CAAC;AAEtE,MAAM,WAAW,sBACf,SAAQ,IAAI,CAAC,yBAAyB,EAAE,aAAa,CAAC,EACpD,iBAAiB;IACnB,wFAAwF;IACxF,QAAQ,EAAE,MAAM,CAAC;IACjB,yFAAyF;IACzF,SAAS,EAAE,MAAM,CAAC;IAClB;;;OAGG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB;;;OAGG;IACH,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,wEAAwE;IACxE,QAAQ,CAAC,EAAE,MAAM,IAAI,CAAC;CACvB;AAED;;GAEG;AACH,QAAA,MAAM,iBAAiB,GAAI,2GAQxB,sBAAsB,gCA0DxB,CAAC;AAEF,eAAe,iBAAiB,CAAC"}
@@ -8,9 +8,6 @@ export interface GeolocationSessionProps extends PropsWithChildren {
8
8
  * Manage the GPS-based AR backend.
9
9
  * Registers with the XR session provider and provides LocAR.js geolocation capabilities.
10
10
  */
11
- declare const GeolocationSession: {
12
- ({ options, children, }: GeolocationSessionProps): import('react').ReactNode;
13
- sessionType: string;
14
- };
11
+ declare const GeolocationSession: ({ options, children, }: GeolocationSessionProps) => import('react').ReactNode;
15
12
  export default GeolocationSession;
16
13
  //# sourceMappingURL=GeolocationSession.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"GeolocationSession.d.ts","sourceRoot":"","sources":["../../src/geolocation/GeolocationSession.tsx"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,OAAO,CAAC;AAE/C,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,sBAAsB,CAAC;AAEtE,MAAM,WAAW,uBAAwB,SAAQ,iBAAiB;IAChE,mCAAmC;IACnC,OAAO,CAAC,EAAE,yBAAyB,CAAC;CACrC;AAED;;;GAGG;AACH,QAAA,MAAM,kBAAkB;6BAGrB,uBAAuB;;CAgDzB,CAAC;AAKF,eAAe,kBAAkB,CAAC"}
1
+ {"version":3,"file":"GeolocationSession.d.ts","sourceRoot":"","sources":["../../src/geolocation/GeolocationSession.tsx"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,OAAO,CAAC;AAE/C,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,sBAAsB,CAAC;AAEtE,MAAM,WAAW,uBAAwB,SAAQ,iBAAiB;IAChE,mCAAmC;IACnC,OAAO,CAAC,EAAE,yBAAyB,CAAC;CACrC;AAED;;;GAGG;AACH,QAAA,MAAM,kBAAkB,GAAI,wBAGzB,uBAAuB,8BA4CzB,CAAC;AAEF,eAAe,kBAAkB,CAAC"}
@@ -1,4 +1,43 @@
1
+ import { DeviceOrientationControls, LocationBased as LocAR, Webcam } from 'locar';
1
2
  import { Backend } from 'lib/types/engine';
3
+ import { Camera, Group, Scene } from 'three';
4
+ /**
5
+ * GPS update event structure emitted by LocAR.
6
+ */
7
+ export interface GpsUpdateEvent {
8
+ position: GeolocationPosition;
9
+ distMoved: number;
10
+ }
11
+ /**
12
+ * Anchor registration for tracking in the geolocation backend.
13
+ */
14
+ export interface AnchorEntry {
15
+ anchor: Group;
16
+ isAttached: boolean;
17
+ latitude: number;
18
+ longitude: number;
19
+ altitude: number;
20
+ onAttach?: () => void;
21
+ onGpsUpdate?: (position: GeolocationPosition, distMoved: number) => void;
22
+ }
23
+ /**
24
+ * Internal state exposed by the geolocation backend.
25
+ */
26
+ export interface GeolocationInternal {
27
+ locar: LocAR | null;
28
+ webcam: Webcam | null;
29
+ deviceOrientation: DeviceOrientationControls | null;
30
+ scene: Scene | null;
31
+ camera: Camera | null;
32
+ /** Last known GPS position. */
33
+ lastPosition: GeolocationPosition | null;
34
+ /** Register an anchor with the backend. */
35
+ registerAnchor: (id: string, entry: AnchorEntry) => void;
36
+ /** Unregister an anchor from the backend. */
37
+ unregisterAnchor: (id: string) => void;
38
+ /** Get an anchor entry by ID. */
39
+ getAnchor: (id: string) => AnchorEntry | undefined;
40
+ }
2
41
  /**
3
42
  * Options for the geolocation backend.
4
43
  */
@@ -19,6 +58,6 @@ export interface GeolocationSessionOptions {
19
58
  /**
20
59
  * Create a location-based AR backend.
21
60
  */
22
- declare const createGeolocationBackend: (options: GeolocationSessionOptions) => Backend;
61
+ declare const createGeolocationBackend: (options?: GeolocationSessionOptions) => Backend<GeolocationInternal>;
23
62
  export default createGeolocationBackend;
24
63
  //# sourceMappingURL=geolocationBackend.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"geolocationBackend.d.ts","sourceRoot":"","sources":["../../src/geolocation/geolocationBackend.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,OAAO,EAAmB,MAAM,kBAAkB,CAAC;AAGjE;;GAEG;AACH,MAAM,WAAW,yBAAyB;IACxC,2EAA2E;IAC3E,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,4EAA4E;IAC5E,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,iCAAiC;IACjC,iBAAiB,CAAC,EAAE,sBAAsB,CAAC;IAC3C;;;;OAIG;IAEH,WAAW,CAAC,EAAE,CAAC,QAAQ,EAAE,mBAAmB,EAAE,aAAa,EAAE,MAAM,KAAK,IAAI,CAAC;CAC9E;AAED;;GAEG;AACH,QAAA,MAAM,wBAAwB,GAC5B,SAAS,yBAAyB,KACjC,OA+KF,CAAC;AAEF,eAAe,wBAAwB,CAAC"}
1
+ {"version":3,"file":"geolocationBackend.d.ts","sourceRoot":"","sources":["../../src/geolocation/geolocationBackend.ts"],"names":[],"mappings":"AACA,OAAO,EACL,yBAAyB,EACzB,aAAa,IAAI,KAAK,EACtB,MAAM,EACP,MAAM,OAAO,CAAC;AAEf,OAAO,KAAK,EAAE,OAAO,EAAmB,MAAM,kBAAkB,CAAC;AACjE,OAAO,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,KAAK,EAAiB,MAAM,OAAO,CAAC;AAEjE;;GAEG;AAEH,MAAM,WAAW,cAAc;IAC7B,QAAQ,EAAE,mBAAmB,CAAC;IAC9B,SAAS,EAAE,MAAM,CAAC;CACnB;AAED;;GAEG;AACH,MAAM,WAAW,WAAW;IAC1B,MAAM,EAAE,KAAK,CAAC;IACd,UAAU,EAAE,OAAO,CAAC;IACpB,QAAQ,EAAE,MAAM,CAAC;IACjB,SAAS,EAAE,MAAM,CAAC;IAClB,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,CAAC,EAAE,MAAM,IAAI,CAAC;IACtB,WAAW,CAAC,EAAE,CAAC,QAAQ,EAAE,mBAAmB,EAAE,SAAS,EAAE,MAAM,KAAK,IAAI,CAAC;CAC1E;AAED;;GAEG;AACH,MAAM,WAAW,mBAAmB;IAClC,KAAK,EAAE,KAAK,GAAG,IAAI,CAAC;IACpB,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;IACtB,iBAAiB,EAAE,yBAAyB,GAAG,IAAI,CAAC;IACpD,KAAK,EAAE,KAAK,GAAG,IAAI,CAAC;IACpB,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;IACtB,+BAA+B;IAC/B,YAAY,EAAE,mBAAmB,GAAG,IAAI,CAAC;IACzC,2CAA2C;IAC3C,cAAc,EAAE,CAAC,EAAE,EAAE,MAAM,EAAE,KAAK,EAAE,WAAW,KAAK,IAAI,CAAC;IACzD,6CAA6C;IAC7C,gBAAgB,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,IAAI,CAAC;IACvC,iCAAiC;IACjC,SAAS,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,WAAW,GAAG,SAAS,CAAC;CACpD;AAED;;GAEG;AACH,MAAM,WAAW,yBAAyB;IACxC,2EAA2E;IAC3E,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,4EAA4E;IAC5E,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,iCAAiC;IACjC,iBAAiB,CAAC,EAAE,sBAAsB,CAAC;IAC3C;;;;OAIG;IACH,WAAW,CAAC,EAAE,CAAC,QAAQ,EAAE,mBAAmB,EAAE,aAAa,EAAE,MAAM,KAAK,IAAI,CAAC;CAC9E;AAED;;GAEG;AACH,QAAA,MAAM,wBAAwB,GAC5B,UAAU,yBAAyB,KAClC,OAAO,CAAC,mBAAmB,CA+N7B,CAAC;AAEF,eAAe,wBAAwB,CAAC"}
@@ -1,7 +1,8 @@
1
1
  export { default as GeolocationAnchor } from './GeolocationAnchor';
2
2
  export { default as GeolocationSession } from './GeolocationSession';
3
3
  export { default as createGeolocationBackend } from './geolocationBackend';
4
+ export { default as useGeolocationBackend } from './useGeolocationBackend';
4
5
  export type { GeolocationAnchorProps } from './GeolocationAnchor';
5
6
  export type { GeolocationSessionProps } from './GeolocationSession';
6
- export type { GeolocationSessionOptions } from './geolocationBackend';
7
+ export type { AnchorEntry, GeolocationInternal, GeolocationSessionOptions, GpsUpdateEvent, } from './geolocationBackend';
7
8
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/geolocation/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AACnE,OAAO,EAAE,OAAO,IAAI,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AACrE,OAAO,EAAE,OAAO,IAAI,wBAAwB,EAAE,MAAM,sBAAsB,CAAC;AAE3E,YAAY,EAAE,sBAAsB,EAAE,MAAM,qBAAqB,CAAC;AAClE,YAAY,EAAE,uBAAuB,EAAE,MAAM,sBAAsB,CAAC;AACpE,YAAY,EAAE,yBAAyB,EAAE,MAAM,sBAAsB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/geolocation/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AACnE,OAAO,EAAE,OAAO,IAAI,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AACrE,OAAO,EAAE,OAAO,IAAI,wBAAwB,EAAE,MAAM,sBAAsB,CAAC;AAC3E,OAAO,EAAE,OAAO,IAAI,qBAAqB,EAAE,MAAM,yBAAyB,CAAC;AAE3E,YAAY,EAAE,sBAAsB,EAAE,MAAM,qBAAqB,CAAC;AAClE,YAAY,EAAE,uBAAuB,EAAE,MAAM,sBAAsB,CAAC;AACpE,YAAY,EACV,WAAW,EACX,mBAAmB,EACnB,yBAAyB,EACzB,cAAc,GACf,MAAM,sBAAsB,CAAC"}
@@ -0,0 +1,14 @@
1
+ import { GeolocationInternal } from './geolocationBackend';
2
+ /**
3
+ * Access the geolocation backend internals.
4
+ * @returns geolocation backend or null if no geolocation session is active.
5
+ *
6
+ * @example
7
+ * ```tsx
8
+ * const geo = useGeolocationBackend();
9
+ * const worldCoords = geo?.locar?.lonLatToWorldCoords(lon, lat);
10
+ * ```
11
+ */
12
+ declare const useGeolocationBackend: () => GeolocationInternal | null;
13
+ export default useGeolocationBackend;
14
+ //# sourceMappingURL=useGeolocationBackend.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useGeolocationBackend.d.ts","sourceRoot":"","sources":["../../src/geolocation/useGeolocationBackend.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,sBAAsB,CAAC;AAEhE;;;;;;;;;GASG;AACH,QAAA,MAAM,qBAAqB,QAAO,mBAAmB,GAAG,IAMvD,CAAC;AAEF,eAAe,qBAAqB,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"ImmersiveSession.d.ts","sourceRoot":"","sources":["../../src/immersive/ImmersiveSession.tsx"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,OAAO,CAAC;AAI/C;;GAEG;AACH,QAAA,MAAM,gBAAgB,GAAI,cAAc,iBAAiB,4CAqBxD,CAAC;AAEF,eAAe,gBAAgB,CAAC"}
1
+ {"version":3,"file":"ImmersiveSession.d.ts","sourceRoot":"","sources":["../../src/immersive/ImmersiveSession.tsx"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,OAAO,CAAC;AAc/C;;GAEG;AACH,QAAA,MAAM,gBAAgB,GAAI,cAAc,iBAAiB,4CAqBxD,CAAC;AAEF,eAAe,gBAAgB,CAAC"}
package/build/index.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const A=require("react"),k=require("@react-three/fiber"),F=require("react/jsx-runtime"),T=require("@ar-js-org/ar.js/three.js/build/ar-threex"),Q=require("three"),V=require("locar"),G=require("@react-three/xr");var j=typeof document<"u"?document.currentScript:null;function Y(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const n in e)if(n!=="default"){const r=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,r.get?r:{enumerable:!0,get:()=>e[n]})}}return t.default=e,Object.freeze(t)}const M=Y(V),B=e=>{let t;const n=new Set,r=(c,f)=>{const i=typeof c=="function"?c(t):c;if(!Object.is(i,t)){const l=t;t=f??(typeof i!="object"||i===null)?i:Object.assign({},t,i),n.forEach(m=>m(t,l))}},u=()=>t,s={setState:r,getState:u,getInitialState:()=>d,subscribe:c=>(n.add(c),()=>n.delete(c))},d=t=e(r,u,s);return s},$=(e=>e?B(e):B),J=e=>e;function Z(e,t=J){const n=A.useSyncExternalStore(e.subscribe,A.useCallback(()=>t(e.getState()),[e,t]),A.useCallback(()=>t(e.getInitialState()),[e,t]));return A.useDebugValue(n),n}const ee=e=>{const t=$(e),n=r=>Z(t,r);return Object.assign(n,t),n},te=(e=>ee),ne=e=>(t,n,r)=>{const u=r.subscribe;return r.subscribe=((a,s,d)=>{let c=a;if(s){const f=d?.equalityFn||Object.is;let i=a(r.getState());c=l=>{const m=a(l);if(!f(i,m)){const g=i;s(i=m,g)}},d?.fireImmediately&&s(i,i)}return u(c)}),e(t,n,r)},re=ne,P=e=>Symbol.iterator in e,U=e=>"entries"in e,q=(e,t)=>{const n=e instanceof Map?e:new Map(e.entries()),r=t instanceof Map?t:new Map(t.entries());if(n.size!==r.size)return!1;for(const[u,o]of n)if(!r.has(u)||!Object.is(o,r.get(u)))return!1;return!0},oe=(e,t)=>{const n=e[Symbol.iterator](),r=t[Symbol.iterator]();let u=n.next(),o=r.next();for(;!u.done&&!o.done;){if(!Object.is(u.value,o.value))return!1;u=n.next(),o=r.next()}return!!u.done&&!!o.done};function se(e,t){return Object.is(e,t)?!0:typeof e!="object"||e===null||typeof t!="object"||t===null||Object.getPrototypeOf(e)!==Object.getPrototypeOf(t)?!1:P(e)&&P(t)?U(e)&&U(t)?q(e,t):oe(e,t):q({entries:()=>Object.entries(e)},{entries:()=>Object.entries(t)})}function ie(e){const t=A.useRef(void 0);return n=>{const r=e(n);return se(t.current,r)?t.current:t.current=r}}const h={FIDUCIAL:"FiducialSession",GEOLOCATION:"GeolocationSession",IMMERSIVE:"ImmersiveSession"},L=te()(re((e,t)=>({video:null,backends:[],sessionTypes:new Set,immersiveStore:null,registerBackend:async(n,r,u)=>{try{if(u){const o=t(),a=new Set([...o.sessionTypes,u]),s=a.has(h.FIDUCIAL),d=a.has(h.GEOLOCATION);if(s&&d){const c=`❌ [RDK] INCOMPATIBLE SESSIONS: ${h.FIDUCIAL} and ${h.GEOLOCATION} cannot be used together due to camera/video conflicts between AR.js and LocAR.js libraries. Use only one session type per app.`;throw console.error(c),new Error(c)}e(()=>({sessionTypes:a}))}await n.init({scene:r.scene,camera:r.camera,renderer:r.renderer}),e(o=>({backends:[...o.backends,n]}))}catch(o){throw console.error("[XRStore] Failed to register backend:",o),o}},unregisterBackend:(n,r)=>{e(u=>{const o=new Set(u.sessionTypes);r&&o.delete(r);const a=u.backends.filter(s=>s!==n);try{n.dispose?.()}catch(s){console.error("[XRStore] Error disposing backend:",s)}return{backends:a,sessionTypes:o}})},setVideo:n=>{e({video:n})},updateBackends:n=>{const{backends:r}=t();r.forEach(u=>{try{u.update?.(n)}catch(o){console.error("[XRStore] Backend update error:",o)}})},setImmersiveStore:n=>{e({immersiveStore:n})}}))),D=()=>L.getState(),ce=L.subscribe,v=e=>L(ie(n=>{const r={...n,isImmersive:n.sessionTypes.has(h.IMMERSIVE),immersive:n.immersiveStore||null};return e?e(r):r})),ae=({children:e})=>{const{updateBackends:t}=v();return k.useFrame((n,r)=>{t(r)}),e},le=({patternUrl:e,barcodeValue:t,params:n,onMarkerFound:r,onMarkerLost:u,children:o})=>{const a=A.useRef(null),s=v(i=>i.backends),d=A.useRef(!1),c=A.useRef(!1),f=A.useRef(null);return A.useEffect(()=>{let i=!1;return(async()=>{try{const m=s.find(w=>w.getInternal?.()?.arContext);if(!m||i)return;const I=m.getInternal?.()?.arContext,y=a.current;if(!I||!y)return;if(y.visible=!1,c.current=!1,!I.arController){requestAnimationFrame(()=>{if(!a.current||i)return;const p=m.getInternal?.()?.arContext;if(!p?.arController)return;const b=new T.ArMarkerControls(p,a.current,{type:e?"pattern":t?"barcode":"unknown",patternUrl:e,barcodeValue:t,...n});f.current=b,c.current=!0});return}const R=new T.ArMarkerControls(I,y,{type:e?"pattern":t?"barcode":"unknown",patternUrl:e,barcodeValue:t,...n});f.current=R,c.current=!0}catch(m){console.error("Failed to initialize fiducial backend:",m)}})(),()=>{i=!0;const m=f.current;typeof m?.dispose=="function"&&m.dispose(),c.current=!1}},[s,e,t,n]),k.useFrame(()=>{const i=a.current;if(!i||!c.current){i&&(i.visible=!1);return}const l=i.visible;l&&!d.current?(d.current=!0,r?.()):!l&&d.current&&(d.current=!1,u?.())}),F.jsx("group",{ref:a,visible:!1,children:o})},X=({options:e={},children:t})=>{const{scene:n,camera:r,gl:u}=k.useThree(),{registerBackend:o,unregisterBackend:a}=v(),s=A.useRef(null),d=A.useRef(e);return d.current=e,A.useEffect(()=>{if(s.current)return;let c=!1;return(async()=>{try{const i=N(d.current);if(c)return;await o(i,{scene:n,camera:r,renderer:u},h.FIDUCIAL),s.current=i}catch(i){console.error("[FiducialSession] Failed to initialize:",i)}})(),()=>{c=!0,s.current&&(a(s.current,h.FIDUCIAL),s.current=null)}},[n,r,u,o,a]),t};X.sessionType="FiducialSession";const N=e=>{let t,n,r;return{async init({camera:o,renderer:a}){t=new T.ArToolkitSource({sourceType:e.sourceType??"webcam"}),await new Promise((c,f)=>{const i=setTimeout(()=>{f(new Error("AR source initialization timeout"))},1e4);t.init(()=>{clearTimeout(i);const l=t.domElement;l&&(l.style.position="fixed",l.style.top="0",l.style.left="0",l.style.width="100vw",l.style.height="100vh",l.style.objectFit="cover",l.style.zIndex="-1",l.style.pointerEvents="none"),c()})});const s={cameraParametersUrl:e.cameraParametersUrl??new URL("data:application/octet-stream;base64,AAACgAAAAeBAgwrsW6bUSwAAAAAAAAAAQHQ3KqAAAAAAAAAAAAAAAAAAAAAAAAAAQIL0K3dHyf9AbbNowAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD/wAAAAAAAAAAAAAAAAAAA/uWNa4AAAAL+3lTLAAAAAv17YFWAAAAA/VYLXIAAAAECCe0YgAAAAQIJlMOAAAABAdDcqoAAAAEBts2jAAAAAP+8OmzqkDy4=",typeof document>"u"?require("url").pathToFileURL(__filename).href:j&&j.tagName.toUpperCase()==="SCRIPT"&&j.src||new URL("index.cjs",document.baseURI).href).toString(),detectionMode:e.detectionMode??"mono",patternRatio:e.patternRatio??.5,matrixCodeType:e.matrixCodeType??"3x3"};n=new T.ArToolkitContext(s);const d=()=>{t.onResizeElement();const c=window.innerWidth,f=window.innerHeight;a.setSize(c,f,!1),t.copyElementSizeTo(a.domElement),n?.arController&&t.copyElementSizeTo(n.arController.canvas)};await new Promise((c,f)=>{const i=setTimeout(()=>{f(new Error("AR context initialization timeout"))},1e4);n.init(()=>{clearTimeout(i);try{o.projectionMatrix.copy(n.getProjectionMatrix()),d(),c()}catch(l){f(l)}})}),this._arSource=t,this._arContext=n,this._camera=o,window.addEventListener("resize",d),r=d},update(){const o=this._arSource,a=this._arContext,s=this._camera;if(!(!o||!a)&&o.ready!==!1&&o.domElement)try{a.update(o.domElement),s&&a.getProjectionMatrix&&s.projectionMatrix.copy(a.getProjectionMatrix())}catch(d){console.warn("AR.js update error:",d)}},dispose(){r&&(window.removeEventListener("resize",r),r=void 0);const o=this._arSource,a=this._arContext;if(a&&typeof a.dispose=="function"&&a.dispose(),o?.domElement){const s=o.domElement.parentNode;s&&s.removeChild(o.domElement)}this._arSource=void 0,this._arContext=void 0},getInternal(){return{arSource:this._arSource,arContext:this._arContext}}}},E=new Map;let z=!1,C=null,x=null;const ue=({latitude:e,longitude:t,altitude:n=0,isBillboard:r=!0,onAttach:u,onGpsUpdate:o,children:a})=>{const s=v(g=>g.backends),{camera:d}=k.useThree(),[c]=A.useState(()=>new Q.Group),[f]=A.useState(()=>Math.random().toString(36).slice(2,11)),i=A.useRef(!1),l=A.useCallback(()=>{u?.()},[u]),m=A.useCallback((g,I)=>{o?.(g,I)},[o]);return A.useEffect(()=>{let g=!1;return(async()=>{try{const y=s.find(S=>S.getInternal?.()?.locar);if(!y||g)return;const w=y.getInternal?.()?.locar;if(!w)return;const p=S=>{try{w.add(S.anchor,S.longitude,S.latitude,S.altitude),S.isAttached=!0,S.onAttach?.()}catch(O){console.error("❌ Failed to attach anchor:",O)}},b={anchor:c,isAttached:!1,latitude:e,longitude:t,altitude:n||0,onAttach:l,onGpsUpdate:m};if(E.set(f,b),!z){x=({position:O,distMoved:K})=>{C=O,E.forEach(_=>{_.isAttached||p(_),_.onGpsUpdate?.(O,K)})};const S=w.getLastKnownLocation();S!==null&&(C={coords:S,timestamp:Date.now(),toJSON:()=>S}),C!==null&&!b.isAttached&&p(b),w.on?.("gpsupdate",x),z=!0}C!==null&&(b.isAttached||p(b),b.onGpsUpdate?.(C,0)),i.current=!1}catch(y){console.error("Failed to initialize geolocation backend:",y)}})(),()=>{if(g=!0,E.get(f)?.isAttached)try{const p=s.find(b=>b.getInternal?.()?.locar)?.getInternal?.()?.locar;typeof p?.remove=="function"?p.remove(c):c.removeFromParent()}catch(R){console.error(`⚠️ Error removing anchor ${f}:`,R)}E.delete(f),E.size===0&&x&&(s.find(b=>b.getInternal?.()?.locar)?.getInternal?.()?.locar?.off?.("gpsupdate",x),x=null,z=!1)}},[s,c,f,e,t,n,l,m]),k.useFrame(()=>{!r||!d||!E.get(f)?.isAttached||c.lookAt(d.position)}),k.createPortal(F.jsx("group",{children:a}),c)},H=({options:e={},children:t})=>{const{scene:n,camera:r,gl:u}=k.useThree(),{registerBackend:o,unregisterBackend:a}=v(),s=A.useRef(null),d=A.useRef(e);return d.current=e,A.useEffect(()=>{if(s.current)return;let c=!1;return(async()=>{try{const i=W(d.current);if(c)return;await o(i,{scene:n,camera:r,renderer:u},h.GEOLOCATION),s.current=i}catch(i){console.error("[GeolocationSession] Failed to initialize:",i)}})(),()=>{c=!0,s.current&&(a(s.current,h.GEOLOCATION),s.current=null)}},[n,r,u,o,a]),t};H.sessionType="GeolocationSession";const W=e=>{let t,n,r,u,o=null,a=null;return{async init(s){const{camera:d,renderer:c,scene:f}=s;if(!f)throw new Error("[geolocationBackend] A THREE.Scene is required for location-based AR");o=d,a=c,t=new M.LocationBased(f,d),n=new M.Webcam(e.webcamConstraints??{video:{facingMode:"environment"}},null),t.on("gpsupdate",l=>{e.onGpsUpdate?.(l.position,l.distMoved)}),n.on("webcamstarted",l=>{f.background=l.texture}),n.on("webcamerror",l=>{console.error("[geolocationBackend] webcam error:",l)}),r=new M.DeviceOrientationControls(d),r.on("deviceorientationgranted",l=>{l.target?.connect?.()}),r.on("deviceorientationerror",l=>{console.error("[geolocationBackend] Device orientation error:",l)}),r.init?.(),t.on("gpserror",l=>{console.error("[geolocationBackend] gps error:",l)}),t.startGps(),typeof e.fakeLat=="number"&&typeof e.fakeLon=="number"&&t.fakeGps(e.fakeLon,e.fakeLat);const i=()=>{if(!a||!o)return;const l=window.innerWidth,m=window.innerHeight;a.setSize(l,m,!1),o.aspect=l/m,o.updateProjectionMatrix?.()};i(),window.addEventListener("resize",i),u=i,this._locar=t,this._webcam=n,this._deviceOrientation=r,this._scene=f,this._camera=d},update(){this._deviceOrientation?.update?.()},dispose(){const s=this._locar,d=this._webcam,c=this._deviceOrientation;e?.onGpsUpdate&&s?.off("gpsupdate",e.onGpsUpdate),s?.stopGps?.(),d?.stop?.(),c?.dispose?.(),u&&(window.removeEventListener("resize",u),u=void 0),this._locar=null,this._webcam=null,this._deviceOrientation=null,this._scene=null,this._camera=null},getInternal(){return{locar:this._locar,webcam:this._webcam,deviceOrientation:this._deviceOrientation,scene:this._scene,camera:this._camera}}}},de=({children:e})=>{const t=A.useMemo(()=>G.createXRStore(),[]);return A.useEffect(()=>{const n=D();return n.sessionTypes.add(h.IMMERSIVE),n.setImmersiveStore(t),()=>{n.sessionTypes.delete(h.IMMERSIVE),n.setImmersiveStore(null)}},[t]),F.jsx(G.XR,{store:t,children:e})};exports.FiducialAnchor=le;exports.FiducialSession=X;exports.GeolocationAnchor=ue;exports.GeolocationSession=H;exports.ImmersiveSession=de;exports.XR=ae;exports.createFiducialBackend=N;exports.createGeolocationBackend=W;exports.getXRStore=D;exports.subscribeToXRStore=ce;exports.useXRStore=v;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const m=require("react"),h=require("@react-three/fiber"),C=require("react/jsx-runtime"),I=require("@ar-js-org/ar.js/three.js/build/ar-threex"),q=require("three"),E=require("locar"),x=require("@react-three/xr");var v=typeof document<"u"?document.currentScript:null;const p={FIDUCIAL:"fiducial",GEOLOCATION:"geolocation",IMMERSIVE:"immersive"},O=n=>{let e;const t=new Set,r=(i,f)=>{const l=typeof i=="function"?i(e):i;if(!Object.is(l,e)){const o=e;e=f??(typeof l!="object"||l===null)?l:Object.assign({},e,l),t.forEach(d=>d(e,o))}},c=()=>e,a={setState:r,getState:c,getInitialState:()=>u,subscribe:i=>(t.add(i),()=>t.delete(i))},u=e=n(r,c,a);return a},D=(n=>n?O(n):O),N=n=>n;function U(n,e=N){const t=m.useSyncExternalStore(n.subscribe,m.useCallback(()=>e(n.getState()),[n,e]),m.useCallback(()=>e(n.getInitialState()),[n,e]));return m.useDebugValue(t),t}const X=n=>{const e=D(n),t=r=>U(e,r);return Object.assign(t,e),t},H=(n=>X),W=n=>(e,t,r)=>{const c=r.subscribe;return r.subscribe=((A,a,u)=>{let i=A;if(a){const f=u?.equalityFn||Object.is;let l=A(r.getState());i=o=>{const d=A(o);if(!f(l,d)){const S=l;a(l=d,S)}},u?.fireImmediately&&a(l,l)}return c(i)}),n(e,t,r)},K=W,T=n=>Symbol.iterator in n,j=n=>"entries"in n,F=(n,e)=>{const t=n instanceof Map?n:new Map(n.entries()),r=e instanceof Map?e:new Map(e.entries());if(t.size!==r.size)return!1;for(const[c,s]of t)if(!r.has(c)||!Object.is(s,r.get(c)))return!1;return!0},V=(n,e)=>{const t=n[Symbol.iterator](),r=e[Symbol.iterator]();let c=t.next(),s=r.next();for(;!c.done&&!s.done;){if(!Object.is(c.value,s.value))return!1;c=t.next(),s=r.next()}return!!c.done&&!!s.done};function Y(n,e){return Object.is(n,e)?!0:typeof n!="object"||n===null||typeof e!="object"||e===null||Object.getPrototypeOf(n)!==Object.getPrototypeOf(e)?!1:T(n)&&T(e)?j(n)&&j(e)?F(n,e):V(n,e):F({entries:()=>Object.entries(n)},{entries:()=>Object.entries(e)})}function Q(n){const e=m.useRef(void 0);return t=>{const r=n(t);return Y(e.current,r)?e.current:e.current=r}}const M=H()(K((n,e)=>({video:null,backends:new Map,immersiveStore:null,registerBackend:async(t,r)=>{try{const c=e(),s=new Set(c.backends.keys()),A=s.has(p.FIDUCIAL)||t.type===p.FIDUCIAL,a=s.has(p.GEOLOCATION)||t.type===p.GEOLOCATION;if(A&&a){const u="❌ [RDK] INCOMPATIBLE SESSIONS: fiducial and geolocation backends cannot be used together due to camera/video conflicts between AR.js and LocAR.js libraries. Use only one session type per app.";throw console.error(u),new Error(u)}await t.init({scene:r.scene,camera:r.camera,renderer:r.renderer}),n(u=>{const i=new Map(u.backends);return i.set(t.type,t),{backends:i}})}catch(c){throw console.error("[XRStore] Failed to register backend:",c),c}},unregisterBackend:t=>{n(r=>{const c=new Map(r.backends);c.delete(t.type);try{t.dispose?.()}catch(s){console.error("[XRStore] Error disposing backend:",s)}return{backends:c}})},setVideo:t=>{n({video:t})},updateBackends:t=>{const{backends:r}=e();for(const c of r.values())try{c.update?.(t)}catch(s){console.error("[XRStore] Backend update error:",s)}},setImmersiveStore:t=>{n({immersiveStore:t})}}))),L=()=>M.getState(),_=M.subscribe,y=n=>M(Q(t=>{const r={...t,isImmersive:t.backends.has(p.IMMERSIVE),immersive:t.immersiveStore||null};return n?n(r):r})),J=({children:n})=>{const{updateBackends:e}=y();return h.useFrame((t,r)=>{e(r)}),n},B=()=>y(t=>t.backends).get(p.FIDUCIAL)?.getInternal()??null,$=({patternUrl:n,barcodeValue:e,params:t,onMarkerFound:r,onMarkerLost:c,children:s})=>{const A=m.useRef(null),a=B(),u=m.useRef(!1),i=m.useRef(!1),f=m.useRef(null);return m.useEffect(()=>{if(!a)return;let l=!1;return(()=>{try{const{arContext:d}=a,S=A.current;if(!d||!S||l)return;if(S.visible=!1,i.current=!1,!d.arController){requestAnimationFrame(()=>{if(!A.current||l||!a.arContext?.arController)return;const g=new I.ArMarkerControls(a.arContext,A.current,{type:n?"pattern":e?"barcode":"unknown",patternUrl:n,barcodeValue:e,...t});f.current=g,i.current=!0});return}const w=new I.ArMarkerControls(d,S,{type:n?"pattern":e?"barcode":"unknown",patternUrl:n,barcodeValue:e,...t});f.current=w,i.current=!0}catch(d){console.error("Failed to initialize fiducial anchor:",d)}})(),()=>{l=!0;const d=f.current;typeof d?.dispose=="function"&&d.dispose(),i.current=!1}},[a,n,e,t]),h.useFrame(()=>{const l=A.current;if(!l||!i.current){l&&(l.visible=!1);return}const o=l.visible;o&&!u.current?(u.current=!0,r?.()):!o&&u.current&&(u.current=!1,c?.())}),C.jsx("group",{ref:A,visible:!1,children:s})},Z=({options:n={},children:e})=>{const{scene:t,camera:r,gl:c}=h.useThree(),{registerBackend:s,unregisterBackend:A}=y(),a=m.useRef(null),u=m.useRef(n);return u.current=n,m.useEffect(()=>{if(a.current)return;let i=!1;return(async()=>{try{const l=z(u.current);if(i)return;await s(l,{scene:t,camera:r,renderer:c}),a.current=l}catch(l){console.error("[FiducialSession] Failed to initialize:",l)}})(),()=>{i=!0,a.current&&(A(a.current),a.current=null)}},[t,r,c,s,A]),e},z=n=>{let e=null,t=null,r=null,c;return{type:p.FIDUCIAL,async init({camera:s,renderer:A}){e=new I.ArToolkitSource({sourceType:n?.sourceType??"webcam"}),await new Promise((i,f)=>{const l=setTimeout(()=>{f(new Error("AR source initialization timeout"))},1e4);e?.init(()=>{clearTimeout(l);const o=e?.domElement;o&&(o.style.position="fixed",o.style.top="0",o.style.left="0",o.style.width="100vw",o.style.height="100vh",o.style.objectFit="cover",o.style.zIndex="-1",o.style.pointerEvents="none"),i()})});const a={cameraParametersUrl:n?.cameraParametersUrl??new URL("data:application/octet-stream;base64,AAACgAAAAeBAgwrsW6bUSwAAAAAAAAAAQHQ3KqAAAAAAAAAAAAAAAAAAAAAAAAAAQIL0K3dHyf9AbbNowAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD/wAAAAAAAAAAAAAAAAAAA/uWNa4AAAAL+3lTLAAAAAv17YFWAAAAA/VYLXIAAAAECCe0YgAAAAQIJlMOAAAABAdDcqoAAAAEBts2jAAAAAP+8OmzqkDy4=",typeof document>"u"?require("url").pathToFileURL(__filename).href:v&&v.tagName.toUpperCase()==="SCRIPT"&&v.src||new URL("index.cjs",document.baseURI).href).toString(),detectionMode:n?.detectionMode??"mono",patternRatio:n?.patternRatio??.5,matrixCodeType:n?.matrixCodeType??"3x3"};t=new I.ArToolkitContext(a),r=s;const u=()=>{e?.onResizeElement();const i=window.innerWidth,f=window.innerHeight;A.setSize(i,f,!1),e?.copyElementSizeTo(A.domElement),t?.arController&&e?.copyElementSizeTo(t.arController.canvas)};await new Promise((i,f)=>{const l=setTimeout(()=>{f(new Error("AR context initialization timeout"))},1e4);t?.init(()=>{clearTimeout(l);try{const o=t?.getProjectionMatrix();o&&s.projectionMatrix.copy(o),u(),i()}catch(o){f(o)}})}),window.addEventListener("resize",u),c=u},update(){if(!(!e||!t)&&!(!e.ready||!e.domElement))try{t.update(e.domElement);const s=t.getProjectionMatrix?.();r&&s&&r.projectionMatrix.copy(s)}catch(s){console.warn("AR.js update error:",s)}},dispose(){if(c&&(window.removeEventListener("resize",c),c=void 0),t&&typeof t.dispose=="function"&&t.dispose(),e?.domElement){const s=e.domElement.parentNode;s&&s.removeChild(e.domElement)}e=null,t=null,r=null},getInternal:()=>({arSource:e,arContext:t})}},G=()=>y(t=>t.backends).get(p.GEOLOCATION)?.getInternal()??null,ee=({latitude:n,longitude:e,altitude:t=0,isBillboard:r=!0,onAttach:c,onGpsUpdate:s,children:A})=>{const a=G(),{camera:u}=h.useThree(),[i]=m.useState(()=>new q.Group),f=m.useMemo(()=>Math.random().toString(36).slice(2,11),[]),l=m.useCallback(()=>{c?.()},[c]),o=m.useCallback((d,S)=>{s?.(d,S)},[s]);return m.useEffect(()=>{if(a)return a.registerAnchor(f,{anchor:i,isAttached:!1,latitude:n,longitude:e,altitude:t,onAttach:l,onGpsUpdate:o}),()=>{a.unregisterAnchor(f)}},[a,i,f,n,e,t,l,o]),h.useFrame(()=>{!r||!u||!a||!a.getAnchor(f)?.isAttached||i.lookAt(u.position)}),h.createPortal(C.jsx("group",{children:A}),i)},te=({options:n={},children:e})=>{const{scene:t,camera:r,gl:c}=h.useThree(),{registerBackend:s,unregisterBackend:A}=y(),a=m.useRef(null),u=m.useRef(n);return u.current=n,m.useEffect(()=>{if(a.current)return;let i=!1;return(async()=>{try{const l=P(u.current);if(i)return;await s(l,{scene:t,camera:r,renderer:c}),a.current=l}catch(l){console.error("[GeolocationSession] Failed to initialize:",l)}})(),()=>{i=!0,a.current&&(A(a.current),a.current=null)}},[t,r,c,s,A]),e},P=n=>{let e=null,t=null,r=null,c,s=null,A=null,a=null,u=null;const i=new Map;let f=null;const l=o=>{if(!(!e||o.isAttached))try{e.add(o.anchor,o.longitude,o.latitude,o.altitude),o.isAttached=!0,o.onAttach?.()}catch(d){console.error("❌ Failed to attach anchor:",d)}};return{type:p.GEOLOCATION,async init(o){const{camera:d,renderer:S,scene:w}=o;if(!w)throw new Error("[geolocationBackend] A THREE.Scene is required for location-based AR");A=d,a=S,u=w,e=new E.LocationBased(w,d),t=new E.Webcam(n?.webcamConstraints??{video:{facingMode:"environment"}}),s=b=>{f=b.position;for(const k of i.values())k.isAttached||l(k),k.onGpsUpdate?.(b.position,b.distMoved);n?.onGpsUpdate?.(b.position,b.distMoved)},e.on("gpsupdate",s),t.on("webcamstarted",b=>{w.background=b.texture}),t.on("webcamerror",b=>{console.error("[geolocationBackend] webcam error:",b)}),r=new E.DeviceOrientationControls(d),r.on("deviceorientationgranted",b=>{b.target?.connect?.()}),r.on("deviceorientationerror",b=>{console.error("[geolocationBackend] Device orientation error:",b)}),r.init?.(),e.on("gpserror",b=>{console.error("[geolocationBackend] gps error:",b)}),e.startGps(),typeof n?.fakeLat=="number"&&typeof n?.fakeLon=="number"&&e.fakeGps(n.fakeLon,n.fakeLat);const g=e.getLastKnownLocation();g!==null&&(f={coords:{longitude:g.longitude,latitude:g.latitude,accuracy:0,altitude:null,altitudeAccuracy:null,heading:null,speed:null,toJSON:()=>g},timestamp:Date.now(),toJSON:()=>g});const R=()=>{if(!a||!A)return;const b=window.innerWidth,k=window.innerHeight;a.setSize(b,k,!1),A.aspect=b/k,A.updateProjectionMatrix?.()};R(),window.addEventListener("resize",R),c=R},update(){r?.update?.()},dispose(){e&&s&&e.off("gpsupdate",s),e?.stopGps?.(),t?.stop?.(),r?.dispose?.(),c&&(window.removeEventListener("resize",c),c=void 0);for(const o of i.values())if(o.isAttached)try{o.anchor.removeFromParent()}catch(d){console.error("⚠️ Error removing anchor:",d)}i.clear(),e=null,t=null,r=null,A=null,a=null,u=null,s=null,f=null},getInternal:()=>({locar:e,webcam:t,deviceOrientation:r,scene:u,camera:A,lastPosition:f,registerAnchor:(o,d)=>{i.set(o,d),f!==null&&!d.isAttached&&(l(d),d.onGpsUpdate?.(f,0))},unregisterAnchor:o=>{const d=i.get(o);if(d?.isAttached)try{d.anchor.removeFromParent()}catch(S){console.error(`⚠️ Error removing anchor ${o}:`,S)}i.delete(o)},getAnchor:o=>i.get(o)})}},ne=()=>({type:p.IMMERSIVE,init:()=>{},getInternal:()=>null}),re=({children:n})=>{const e=m.useMemo(()=>x.createXRStore(),[]);return m.useEffect(()=>{const t=L(),r=ne();return t.backends.set(p.IMMERSIVE,r),t.setImmersiveStore(e),()=>{t.backends.delete(p.IMMERSIVE),t.setImmersiveStore(null)}},[e]),C.jsx(x.XR,{store:e,children:n})};exports.BACKEND_TYPES=p;exports.FiducialAnchor=$;exports.FiducialSession=Z;exports.GeolocationAnchor=ee;exports.GeolocationSession=te;exports.ImmersiveSession=re;exports.XR=J;exports.createFiducialBackend=z;exports.createGeolocationBackend=P;exports.getXRStore=L;exports.subscribeToXRStore=_;exports.useFiducialBackend=B;exports.useGeolocationBackend=G;exports.useXRStore=y;
package/build/index.d.ts CHANGED
@@ -3,6 +3,7 @@ export { getXRStore, subscribeToXRStore, } from './engine/useXRStore';
3
3
  export * from './fiducial';
4
4
  export * from './geolocation';
5
5
  export * from './immersive';
6
- export type { Backend, ContextValue, } from './lib/types/engine';
6
+ export { BACKEND_TYPES } from './lib/types/engine';
7
+ export type { Backend, BackendType, } from './lib/types/engine';
7
8
  export type { ImmersiveMode } from './lib/types/immersive';
8
9
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAC;AACzB,OAAO,EACL,UAAU,EACV,kBAAkB,GACnB,MAAM,qBAAqB,CAAC;AAC7B,cAAc,YAAY,CAAC;AAC3B,cAAc,eAAe,CAAC;AAC9B,cAAc,aAAa,CAAC;AAE5B,YAAY,EACV,OAAO,EACP,YAAY,GACb,MAAM,oBAAoB,CAAC;AAC5B,YAAY,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AAG3D,OAAO,oBAAoB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAC;AACzB,OAAO,EACL,UAAU,EACV,kBAAkB,GACnB,MAAM,qBAAqB,CAAC;AAC7B,cAAc,YAAY,CAAC;AAC3B,cAAc,eAAe,CAAC;AAC9B,cAAc,aAAa,CAAC;AAC5B,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAEnD,YAAY,EACV,OAAO,EACP,WAAW,GACZ,MAAM,oBAAoB,CAAC;AAC5B,YAAY,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AAG3D,OAAO,oBAAoB,CAAC"}