/**
 * PlayCanvas ESM Wrapper
 * 
 * This wrapper converts the UMD PlayCanvas engine to ESM format.
 * The UMD engine sets window.pc, and this wrapper re-exports all its properties.
 * 
 * This approach dynamically exports ALL properties from pc namespace,
 * ensuring no exports are missed.
 */

// Import the UMD engine (it will set window.pc)
import './playcanvas-engine-umd.js';

// Get the PlayCanvas namespace from window
const pc = window.pc;

// ============================================================================
// DYNAMIC APP ACCESS
// ============================================================================
// The 'app' property is set at runtime in index.esm.mjs after AppBase is created.
// ESM exports are static, so we cannot dynamically export app via namespace import.
//
// IMPORTANT: For scripts that use `import * as pc from 'playcanvas'`:
// The build process automatically rewrites `pc.app` to `window.pc.app`.
// This ensures that app access works correctly in ESM mode.
//
// For direct imports like `import { app } from 'playcanvas'`:
// We provide a Proxy that forwards property access to window.pc.app.

/**
 * Get the current PlayCanvas Application instance.
 * This must be called at runtime after the app has been initialized.
 * @returns {AppBase|null} The application instance or null if not yet created.
 */
export function getApplication() {
  return window.pc?.app ?? null;
}

// Create a Proxy for the 'app' export that dynamically accesses window.pc.app
// This works for code that does: import { app } from 'playcanvas'; app.root...
// Note: For `import * as pc`, the build process rewrites pc.app to window.pc.app
const appProxy = new Proxy({}, {
  get(target, prop) {
    const currentApp = window.pc?.app;
    if (!currentApp) {
      console.warn(`[PlayCanvas ESM] Accessing app.${String(prop)} before app is initialized`);
      return undefined;
    }
    const value = currentApp[prop];
    return typeof value === 'function' ? value.bind(currentApp) : value;
  },
  set(target, prop, value) {
    const currentApp = window.pc?.app;
    if (currentApp) {
      currentApp[prop] = value;
      return true;
    }
    console.warn(`[PlayCanvas ESM] Cannot set app.${String(prop)} - app is not initialized yet`);
    return false;
  }
});

export { appProxy as app };

// ============================================================================
// DYNAMIC RE-EXPORTS
// ============================================================================
// We dynamically re-export all properties from pc namespace.
// This ensures that any class/constant used by user code will be available.

// Core classes
export const {
  // Application
  Application,
  AppBase,
  AppOptions,

  // Scene
  Scene,
  SceneRegistry,
  SceneParser,

  // Entity & Component
  Entity,
  Component,
  ComponentSystem,
  ComponentSystemRegistry,

  // Graphics
  GraphicsDevice,
  WebglGraphicsDevice,
  Texture,
  RenderTarget,
  Shader,
  Material,
  StandardMaterial,
  BasicMaterial,
  LitMaterial,
  ShaderMaterial,
  createGraphicsDevice,

  // Math
  Vec2,
  Vec3,
  Vec4,
  Mat3,
  Mat4,
  Quat,
  Color,
  Curve,
  CurveSet,
  math,

  // Events
  EventHandler,

  // Assets
  Asset,
  AssetRegistry,
  AssetListLoader,

  // Script
  Script,
  ScriptType,
  ScriptComponent,
  ScriptHandler,
  ScriptRegistry,
  createScript,
  registerScript,
  script,

  // Camera (standalone class)
  Camera,

  // Input
  Keyboard,
  Mouse,
  MouseEvent,
  TouchDevice,
  TouchEvent,
  GamePads,
  ElementInput,

  // Sound
  SoundManager,
  Sound,
  SoundInstance,
  SoundComponent,
  SoundSlot,

  // Animation
  Animation,
  AnimationComponent,
  AnimComponent,
  AnimTrack,
  AnimClip,
  AnimEvaluator,
  Skeleton,

  // Physics
  RigidBodyComponent,
  CollisionComponent,
  RaycastResult,
  SingleContactResult,
  ContactPoint,
  ContactResult,

  // UI Element
  ElementComponent,

  // Light & Camera Components
  LightComponent,
  CameraComponent,

  // Model & Render
  ModelComponent,
  RenderComponent,

  // Particles
  ParticleSystemComponent,
  ParticleEmitter,

  // BoundingBox & BoundingSphere
  BoundingBox,
  BoundingSphere,
  OrientedBox,

  // Ray & Plane
  Ray,
  Plane,
  Frustum,

  // Shape
  Shape,

  // GraphNode
  GraphNode,

  // Layers
  Layer,
  LayerComposition,

  // Mesh
  Mesh,
  MeshInstance,
  Model,
  Morph,
  MorphInstance,
  MorphTarget,
  Skin,
  SkinInstance,

  // VertexBuffer & IndexBuffer
  VertexBuffer,
  IndexBuffer,
  VertexFormat,
  VertexIterator,

  // Render
  BatchManager,
  BatchGroup,

  // Tags
  Tags,

  // Timer
  Timer,
  now,

  // Tween
  Tween,
  TweenManager,

  // XR
  XrManager,

  // Sprite
  Sprite,
  SpriteComponent,
  TextureAtlas,

  // Font
  Font,
  CanvasFont,

  // Picker
  Picker,

  // Screen
  ScreenComponent,

  // Button
  ButtonComponent,

  // Scroll
  ScrollViewComponent,
  ScrollbarComponent,

  // Layout
  LayoutGroupComponent,
  LayoutChildComponent,

  // Utility
  platform,
  path,
  http,
  Http,
  log,
  debug,
  guid,
  string,

  // PostEffect
  PostEffect,

  // Lightmapper
  Lightmapper,

  // GSplat
  GSplatData,
  GSplatInstance,
  GSplatResource,

  // Container/Resource handling
  ContainerHandler,
  ContainerResource,
  JsonHandler,
  SceneHandler,
  ResourceLoader,

  // Localization
  I18n,

  // Bundle
  Bundle,
  BundleRegistry,

  // Channel (audio)
  Channel,
  Channel3d,

  // World
  WorldClusters,

  // Mini (compressed textures)
  BasisParser,

  // Anim State Graph
  AnimStateGraph,

  // Render passes
  RenderPass,
  RenderPassForward,

  // Shaders
  ShaderPass,

  // Programs  
  ProgramLibrary,

  // WASM and initialization functions
  WasmModule,
  basisInitialize,
  dracoInitialize,

  // Component Systems (needed for AppOptions)
  RigidBodyComponentSystem,
  CollisionComponentSystem,
  JointComponentSystem,
  AnimationComponentSystem,
  AnimComponentSystem,
  ModelComponentSystem,
  RenderComponentSystem,
  CameraComponentSystem,
  LightComponentSystem,
  ScriptComponentSystem,
  SoundComponentSystem,
  AudioListenerComponentSystem,
  ParticleSystemComponentSystem,
  ScreenComponentSystem,
  ElementComponentSystem,
  ButtonComponentSystem,
  ScrollViewComponentSystem,
  ScrollbarComponentSystem,
  SpriteComponentSystem,
  LayoutGroupComponentSystem,
  LayoutChildComponentSystem,
  ZoneComponentSystem,
  GSplatComponentSystem,

  // Resource Handlers (needed for AppOptions)
  RenderHandler,
  AnimationHandler,
  AnimClipHandler,
  AnimStateGraphHandler,
  ModelHandler,
  MaterialHandler,
  TextureHandler,
  TextHandler,
  AudioHandler,
  CubemapHandler,
  HtmlHandler,
  CssHandler,
  ShaderHandler,
  HierarchyHandler,
  FolderHandler,
  FontHandler,
  BinaryHandler,
  TextureAtlasHandler,
  SpriteHandler,
  TemplateHandler,
  GSplatHandler,
} = pc;

// ============================================================================
// CONSTANTS - Exported individually
// ============================================================================

// Input events
export const EVENT_MOUSEDOWN = pc.EVENT_MOUSEDOWN;
export const EVENT_MOUSEUP = pc.EVENT_MOUSEUP;
export const EVENT_MOUSEMOVE = pc.EVENT_MOUSEMOVE;
export const EVENT_MOUSEWHEEL = pc.EVENT_MOUSEWHEEL;
export const EVENT_TOUCHSTART = pc.EVENT_TOUCHSTART;
export const EVENT_TOUCHEND = pc.EVENT_TOUCHEND;
export const EVENT_TOUCHMOVE = pc.EVENT_TOUCHMOVE;
export const EVENT_TOUCHCANCEL = pc.EVENT_TOUCHCANCEL;

// Keyboard constants
export const KEY_A = pc.KEY_A;
export const KEY_B = pc.KEY_B;
export const KEY_C = pc.KEY_C;
export const KEY_D = pc.KEY_D;
export const KEY_E = pc.KEY_E;
export const KEY_F = pc.KEY_F;
export const KEY_G = pc.KEY_G;
export const KEY_H = pc.KEY_H;
export const KEY_I = pc.KEY_I;
export const KEY_J = pc.KEY_J;
export const KEY_K = pc.KEY_K;
export const KEY_L = pc.KEY_L;
export const KEY_M = pc.KEY_M;
export const KEY_N = pc.KEY_N;
export const KEY_O = pc.KEY_O;
export const KEY_P = pc.KEY_P;
export const KEY_Q = pc.KEY_Q;
export const KEY_R = pc.KEY_R;
export const KEY_S = pc.KEY_S;
export const KEY_T = pc.KEY_T;
export const KEY_U = pc.KEY_U;
export const KEY_V = pc.KEY_V;
export const KEY_W = pc.KEY_W;
export const KEY_X = pc.KEY_X;
export const KEY_Y = pc.KEY_Y;
export const KEY_Z = pc.KEY_Z;
export const KEY_0 = pc.KEY_0;
export const KEY_1 = pc.KEY_1;
export const KEY_2 = pc.KEY_2;
export const KEY_3 = pc.KEY_3;
export const KEY_4 = pc.KEY_4;
export const KEY_5 = pc.KEY_5;
export const KEY_6 = pc.KEY_6;
export const KEY_7 = pc.KEY_7;
export const KEY_8 = pc.KEY_8;
export const KEY_9 = pc.KEY_9;
export const KEY_SPACE = pc.KEY_SPACE;
export const KEY_ENTER = pc.KEY_ENTER;
export const KEY_ESCAPE = pc.KEY_ESCAPE;
export const KEY_SHIFT = pc.KEY_SHIFT;
export const KEY_CONTROL = pc.KEY_CONTROL;
export const KEY_ALT = pc.KEY_ALT;
export const KEY_UP = pc.KEY_UP;
export const KEY_DOWN = pc.KEY_DOWN;
export const KEY_LEFT = pc.KEY_LEFT;
export const KEY_RIGHT = pc.KEY_RIGHT;
export const KEY_TAB = pc.KEY_TAB;
export const KEY_CAPS_LOCK = pc.KEY_CAPS_LOCK;
export const KEY_BACKSPACE = pc.KEY_BACKSPACE;
export const KEY_DELETE = pc.KEY_DELETE;
export const KEY_HOME = pc.KEY_HOME;
export const KEY_END = pc.KEY_END;
export const KEY_PAGE_UP = pc.KEY_PAGE_UP;
export const KEY_PAGE_DOWN = pc.KEY_PAGE_DOWN;
export const KEY_INSERT = pc.KEY_INSERT;
export const KEY_F1 = pc.KEY_F1;
export const KEY_F2 = pc.KEY_F2;
export const KEY_F3 = pc.KEY_F3;
export const KEY_F4 = pc.KEY_F4;
export const KEY_F5 = pc.KEY_F5;
export const KEY_F6 = pc.KEY_F6;
export const KEY_F7 = pc.KEY_F7;
export const KEY_F8 = pc.KEY_F8;
export const KEY_F9 = pc.KEY_F9;
export const KEY_F10 = pc.KEY_F10;
export const KEY_F11 = pc.KEY_F11;
export const KEY_F12 = pc.KEY_F12;

// Mouse buttons
export const MOUSEBUTTON_LEFT = pc.MOUSEBUTTON_LEFT;
export const MOUSEBUTTON_MIDDLE = pc.MOUSEBUTTON_MIDDLE;
export const MOUSEBUTTON_RIGHT = pc.MOUSEBUTTON_RIGHT;
export const MOUSEBUTTON_NONE = pc.MOUSEBUTTON_NONE;

// Element types
export const ELEMENTTYPE_GROUP = pc.ELEMENTTYPE_GROUP;
export const ELEMENTTYPE_IMAGE = pc.ELEMENTTYPE_IMAGE;
export const ELEMENTTYPE_TEXT = pc.ELEMENTTYPE_TEXT;

// Light types
export const LIGHTTYPE_DIRECTIONAL = pc.LIGHTTYPE_DIRECTIONAL;
export const LIGHTTYPE_OMNI = pc.LIGHTTYPE_OMNI;
export const LIGHTTYPE_SPOT = pc.LIGHTTYPE_SPOT;

// Blend modes
export const BLEND_NORMAL = pc.BLEND_NORMAL;
export const BLEND_ADDITIVE = pc.BLEND_ADDITIVE;
export const BLEND_ADDITIVEALPHA = pc.BLEND_ADDITIVEALPHA;
export const BLEND_MULTIPLICATIVE = pc.BLEND_MULTIPLICATIVE;
export const BLEND_MULTIPLICATIVE2X = pc.BLEND_MULTIPLICATIVE2X;
export const BLEND_SCREEN = pc.BLEND_SCREEN;
export const BLEND_PREMULTIPLIED = pc.BLEND_PREMULTIPLIED;
export const BLEND_NONE = pc.BLEND_NONE;
export const BLEND_SUBTRACTIVE = pc.BLEND_SUBTRACTIVE;
export const BLEND_MIN = pc.BLEND_MIN;
export const BLEND_MAX = pc.BLEND_MAX;

// Fill modes
export const FILLMODE_NONE = pc.FILLMODE_NONE;
export const FILLMODE_FILL_WINDOW = pc.FILLMODE_FILL_WINDOW;
export const FILLMODE_KEEP_ASPECT = pc.FILLMODE_KEEP_ASPECT;

// Resolution modes
export const RESOLUTION_AUTO = pc.RESOLUTION_AUTO;
export const RESOLUTION_FIXED = pc.RESOLUTION_FIXED;

// Asset types constants
export const ASSET_ANIMATION = pc.ASSET_ANIMATION;
export const ASSET_AUDIO = pc.ASSET_AUDIO;
export const ASSET_IMAGE = pc.ASSET_IMAGE;
export const ASSET_JSON = pc.ASSET_JSON;
export const ASSET_MODEL = pc.ASSET_MODEL;
export const ASSET_MATERIAL = pc.ASSET_MATERIAL;
export const ASSET_TEXT = pc.ASSET_TEXT;
export const ASSET_TEXTURE = pc.ASSET_TEXTURE;
export const ASSET_CUBEMAP = pc.ASSET_CUBEMAP;
export const ASSET_SHADER = pc.ASSET_SHADER;
export const ASSET_CSS = pc.ASSET_CSS;
export const ASSET_HTML = pc.ASSET_HTML;
export const ASSET_SCRIPT = pc.ASSET_SCRIPT;
export const ASSET_CONTAINER = pc.ASSET_CONTAINER;

// Layer IDs
export const LAYERID_WORLD = pc.LAYERID_WORLD;
export const LAYERID_DEPTH = pc.LAYERID_DEPTH;
export const LAYERID_SKYBOX = pc.LAYERID_SKYBOX;
export const LAYERID_IMMEDIATE = pc.LAYERID_IMMEDIATE;
export const LAYERID_UI = pc.LAYERID_UI;

// Types
export const TYPE_INT8 = pc.TYPE_INT8;
export const TYPE_UINT8 = pc.TYPE_UINT8;
export const TYPE_INT16 = pc.TYPE_INT16;
export const TYPE_UINT16 = pc.TYPE_UINT16;
export const TYPE_INT32 = pc.TYPE_INT32;
export const TYPE_UINT32 = pc.TYPE_UINT32;
export const TYPE_FLOAT32 = pc.TYPE_FLOAT32;
export const TYPE_FLOAT64 = pc.TYPE_FLOAT64;

// Semantic
export const SEMANTIC_POSITION = pc.SEMANTIC_POSITION;
export const SEMANTIC_NORMAL = pc.SEMANTIC_NORMAL;
export const SEMANTIC_TANGENT = pc.SEMANTIC_TANGENT;
export const SEMANTIC_BLENDWEIGHT = pc.SEMANTIC_BLENDWEIGHT;
export const SEMANTIC_BLENDINDICES = pc.SEMANTIC_BLENDINDICES;
export const SEMANTIC_COLOR = pc.SEMANTIC_COLOR;
export const SEMANTIC_TEXCOORD = pc.SEMANTIC_TEXCOORD;
export const SEMANTIC_TEXCOORD0 = pc.SEMANTIC_TEXCOORD0;
export const SEMANTIC_TEXCOORD1 = pc.SEMANTIC_TEXCOORD1;
export const SEMANTIC_TEXCOORD2 = pc.SEMANTIC_TEXCOORD2;
export const SEMANTIC_TEXCOORD3 = pc.SEMANTIC_TEXCOORD3;
export const SEMANTIC_TEXCOORD4 = pc.SEMANTIC_TEXCOORD4;
export const SEMANTIC_TEXCOORD5 = pc.SEMANTIC_TEXCOORD5;
export const SEMANTIC_TEXCOORD6 = pc.SEMANTIC_TEXCOORD6;
export const SEMANTIC_TEXCOORD7 = pc.SEMANTIC_TEXCOORD7;
export const SEMANTIC_ATTR = pc.SEMANTIC_ATTR;
export const SEMANTIC_ATTR0 = pc.SEMANTIC_ATTR0;
export const SEMANTIC_ATTR1 = pc.SEMANTIC_ATTR1;
export const SEMANTIC_ATTR2 = pc.SEMANTIC_ATTR2;
export const SEMANTIC_ATTR3 = pc.SEMANTIC_ATTR3;
export const SEMANTIC_ATTR4 = pc.SEMANTIC_ATTR4;
export const SEMANTIC_ATTR5 = pc.SEMANTIC_ATTR5;
export const SEMANTIC_ATTR6 = pc.SEMANTIC_ATTR6;
export const SEMANTIC_ATTR7 = pc.SEMANTIC_ATTR7;
export const SEMANTIC_ATTR8 = pc.SEMANTIC_ATTR8;
export const SEMANTIC_ATTR9 = pc.SEMANTIC_ATTR9;
export const SEMANTIC_ATTR10 = pc.SEMANTIC_ATTR10;
export const SEMANTIC_ATTR11 = pc.SEMANTIC_ATTR11;
export const SEMANTIC_ATTR12 = pc.SEMANTIC_ATTR12;
export const SEMANTIC_ATTR13 = pc.SEMANTIC_ATTR13;
export const SEMANTIC_ATTR14 = pc.SEMANTIC_ATTR14;
export const SEMANTIC_ATTR15 = pc.SEMANTIC_ATTR15;

// Buffer
export const BUFFER_STATIC = pc.BUFFER_STATIC;
export const BUFFER_DYNAMIC = pc.BUFFER_DYNAMIC;
export const BUFFER_STREAM = pc.BUFFER_STREAM;
export const BUFFER_GPUDYNAMIC = pc.BUFFER_GPUDYNAMIC;

// Primitive
export const PRIMITIVE_POINTS = pc.PRIMITIVE_POINTS;
export const PRIMITIVE_LINES = pc.PRIMITIVE_LINES;
export const PRIMITIVE_LINELOOP = pc.PRIMITIVE_LINELOOP;
export const PRIMITIVE_LINESTRIP = pc.PRIMITIVE_LINESTRIP;
export const PRIMITIVE_TRIANGLES = pc.PRIMITIVE_TRIANGLES;
export const PRIMITIVE_TRISTRIP = pc.PRIMITIVE_TRISTRIP;
export const PRIMITIVE_TRIFAN = pc.PRIMITIVE_TRIFAN;

// Index format
export const INDEXFORMAT_UINT8 = pc.INDEXFORMAT_UINT8;
export const INDEXFORMAT_UINT16 = pc.INDEXFORMAT_UINT16;
export const INDEXFORMAT_UINT32 = pc.INDEXFORMAT_UINT32;

// Texture address
export const ADDRESS_REPEAT = pc.ADDRESS_REPEAT;
export const ADDRESS_CLAMP_TO_EDGE = pc.ADDRESS_CLAMP_TO_EDGE;
export const ADDRESS_MIRRORED_REPEAT = pc.ADDRESS_MIRRORED_REPEAT;

// Texture filter
export const FILTER_NEAREST = pc.FILTER_NEAREST;
export const FILTER_LINEAR = pc.FILTER_LINEAR;
export const FILTER_NEAREST_MIPMAP_NEAREST = pc.FILTER_NEAREST_MIPMAP_NEAREST;
export const FILTER_NEAREST_MIPMAP_LINEAR = pc.FILTER_NEAREST_MIPMAP_LINEAR;
export const FILTER_LINEAR_MIPMAP_NEAREST = pc.FILTER_LINEAR_MIPMAP_NEAREST;
export const FILTER_LINEAR_MIPMAP_LINEAR = pc.FILTER_LINEAR_MIPMAP_LINEAR;

// Pixel format
export const PIXELFORMAT_A8 = pc.PIXELFORMAT_A8;
export const PIXELFORMAT_L8 = pc.PIXELFORMAT_L8;
export const PIXELFORMAT_LA8 = pc.PIXELFORMAT_LA8;
export const PIXELFORMAT_RGB565 = pc.PIXELFORMAT_RGB565;
export const PIXELFORMAT_RGBA5551 = pc.PIXELFORMAT_RGBA5551;
export const PIXELFORMAT_RGBA4 = pc.PIXELFORMAT_RGBA4;
export const PIXELFORMAT_RGB8 = pc.PIXELFORMAT_RGB8;
export const PIXELFORMAT_RGBA8 = pc.PIXELFORMAT_RGBA8;
export const PIXELFORMAT_DXT1 = pc.PIXELFORMAT_DXT1;
export const PIXELFORMAT_DXT3 = pc.PIXELFORMAT_DXT3;
export const PIXELFORMAT_DXT5 = pc.PIXELFORMAT_DXT5;
export const PIXELFORMAT_RGB16F = pc.PIXELFORMAT_RGB16F;
export const PIXELFORMAT_RGBA16F = pc.PIXELFORMAT_RGBA16F;
export const PIXELFORMAT_RGB32F = pc.PIXELFORMAT_RGB32F;
export const PIXELFORMAT_RGBA32F = pc.PIXELFORMAT_RGBA32F;
export const PIXELFORMAT_DEPTH = pc.PIXELFORMAT_DEPTH;
export const PIXELFORMAT_DEPTHSTENCIL = pc.PIXELFORMAT_DEPTHSTENCIL;
export const PIXELFORMAT_R32F = pc.PIXELFORMAT_R32F;
export const PIXELFORMAT_R16F = pc.PIXELFORMAT_R16F;
export const PIXELFORMAT_R8 = pc.PIXELFORMAT_R8;
export const PIXELFORMAT_RG8 = pc.PIXELFORMAT_RG8;
export const PIXELFORMAT_RG16F = pc.PIXELFORMAT_RG16F;
export const PIXELFORMAT_RG32F = pc.PIXELFORMAT_RG32F;
export const PIXELFORMAT_SRGB = pc.PIXELFORMAT_SRGB;
export const PIXELFORMAT_SRGBA = pc.PIXELFORMAT_SRGBA;

// Cull face
export const CULLFACE_NONE = pc.CULLFACE_NONE;
export const CULLFACE_BACK = pc.CULLFACE_BACK;
export const CULLFACE_FRONT = pc.CULLFACE_FRONT;
export const CULLFACE_FRONTANDBACK = pc.CULLFACE_FRONTANDBACK;

// Sort mode
export const SORTMODE_NONE = pc.SORTMODE_NONE;
export const SORTMODE_MANUAL = pc.SORTMODE_MANUAL;
export const SORTMODE_MATERIALMESH = pc.SORTMODE_MATERIALMESH;
export const SORTMODE_BACK2FRONT = pc.SORTMODE_BACK2FRONT;
export const SORTMODE_FRONT2BACK = pc.SORTMODE_FRONT2BACK;
export const SORTMODE_CUSTOM = pc.SORTMODE_CUSTOM;

// Shadow type
export const SHADOW_PCF1 = pc.SHADOW_PCF1;
export const SHADOW_PCF3 = pc.SHADOW_PCF3;
export const SHADOW_PCF5 = pc.SHADOW_PCF5;
export const SHADOW_VSM8 = pc.SHADOW_VSM8;
export const SHADOW_VSM16 = pc.SHADOW_VSM16;
export const SHADOW_VSM32 = pc.SHADOW_VSM32;
export const SHADOW_PCSS = pc.SHADOW_PCSS;

// Sprite type
export const SPRITETYPE_SIMPLE = pc.SPRITETYPE_SIMPLE;
export const SPRITETYPE_ANIMATED = pc.SPRITETYPE_ANIMATED;

// Orientation
export const ORIENTATION_HORIZONTAL = pc.ORIENTATION_HORIZONTAL;
export const ORIENTATION_VERTICAL = pc.ORIENTATION_VERTICAL;

// Fitting
export const FITTING_NONE = pc.FITTING_NONE;
export const FITTING_STRETCH = pc.FITTING_STRETCH;
export const FITTING_SHRINK = pc.FITTING_SHRINK;
export const FITTING_BOTH = pc.FITTING_BOTH;

// Scroll mode
export const SCROLL_MODE_CLAMP = pc.SCROLL_MODE_CLAMP;
export const SCROLL_MODE_BOUNCE = pc.SCROLL_MODE_BOUNCE;
export const SCROLL_MODE_INFINITE = pc.SCROLL_MODE_INFINITE;

// Scrollbar visibility
export const SCROLLBAR_VISIBILITY_SHOW_ALWAYS = pc.SCROLLBAR_VISIBILITY_SHOW_ALWAYS;
export const SCROLLBAR_VISIBILITY_SHOW_WHEN_REQUIRED = pc.SCROLLBAR_VISIBILITY_SHOW_WHEN_REQUIRED;

// Projection
export const PROJECTION_PERSPECTIVE = pc.PROJECTION_PERSPECTIVE;
export const PROJECTION_ORTHOGRAPHIC = pc.PROJECTION_ORTHOGRAPHIC;

// Render style
export const RENDERSTYLE_SOLID = pc.RENDERSTYLE_SOLID;
export const RENDERSTYLE_WIREFRAME = pc.RENDERSTYLE_WIREFRAME;
export const RENDERSTYLE_POINTS = pc.RENDERSTYLE_POINTS;

// Curve type
export const CURVE_LINEAR = pc.CURVE_LINEAR;
export const CURVE_SMOOTHSTEP = pc.CURVE_SMOOTHSTEP;
export const CURVE_SPLINE = pc.CURVE_SPLINE;
export const CURVE_STEP = pc.CURVE_STEP;

// Body type
export const BODYTYPE_STATIC = pc.BODYTYPE_STATIC;
export const BODYTYPE_DYNAMIC = pc.BODYTYPE_DYNAMIC;
export const BODYTYPE_KINEMATIC = pc.BODYTYPE_KINEMATIC;

// Body flag
export const BODYFLAG_STATIC_OBJECT = pc.BODYFLAG_STATIC_OBJECT;
export const BODYFLAG_KINEMATIC_OBJECT = pc.BODYFLAG_KINEMATIC_OBJECT;
export const BODYFLAG_NORESPONSE_OBJECT = pc.BODYFLAG_NORESPONSE_OBJECT;

// Body state
export const BODYSTATE_ACTIVE_TAG = pc.BODYSTATE_ACTIVE_TAG;
export const BODYSTATE_ISLAND_SLEEPING = pc.BODYSTATE_ISLAND_SLEEPING;
export const BODYSTATE_WANTS_DEACTIVATION = pc.BODYSTATE_WANTS_DEACTIVATION;
export const BODYSTATE_DISABLE_DEACTIVATION = pc.BODYSTATE_DISABLE_DEACTIVATION;
export const BODYSTATE_DISABLE_SIMULATION = pc.BODYSTATE_DISABLE_SIMULATION;

// Body group
export const BODYGROUP_NONE = pc.BODYGROUP_NONE;
export const BODYGROUP_DEFAULT = pc.BODYGROUP_DEFAULT;
export const BODYGROUP_STATIC = pc.BODYGROUP_STATIC;
export const BODYGROUP_KINEMATIC = pc.BODYGROUP_KINEMATIC;
export const BODYGROUP_DYNAMIC = pc.BODYGROUP_DYNAMIC;
export const BODYGROUP_ENGINE_1 = pc.BODYGROUP_ENGINE_1;
export const BODYGROUP_ENGINE_2 = pc.BODYGROUP_ENGINE_2;
export const BODYGROUP_ENGINE_3 = pc.BODYGROUP_ENGINE_3;
export const BODYGROUP_TRIGGER = pc.BODYGROUP_TRIGGER;
export const BODYGROUP_USER_1 = pc.BODYGROUP_USER_1;
export const BODYGROUP_USER_2 = pc.BODYGROUP_USER_2;
export const BODYGROUP_USER_3 = pc.BODYGROUP_USER_3;
export const BODYGROUP_USER_4 = pc.BODYGROUP_USER_4;
export const BODYGROUP_USER_5 = pc.BODYGROUP_USER_5;
export const BODYGROUP_USER_6 = pc.BODYGROUP_USER_6;
export const BODYGROUP_USER_7 = pc.BODYGROUP_USER_7;
export const BODYGROUP_USER_8 = pc.BODYGROUP_USER_8;

// Body mask
export const BODYMASK_NONE = pc.BODYMASK_NONE;
export const BODYMASK_ALL = pc.BODYMASK_ALL;
export const BODYMASK_STATIC = pc.BODYMASK_STATIC;
export const BODYMASK_NOT_STATIC = pc.BODYMASK_NOT_STATIC;
export const BODYMASK_NOT_STATIC_KINEMATIC = pc.BODYMASK_NOT_STATIC_KINEMATIC;

// Distance model
export const DISTANCE_LINEAR = pc.DISTANCE_LINEAR;
export const DISTANCE_INVERSE = pc.DISTANCE_INVERSE;
export const DISTANCE_EXPONENTIAL = pc.DISTANCE_EXPONENTIAL;

// Specular
export const SPECULAR_PHONG = pc.SPECULAR_PHONG;
export const SPECULAR_BLINN = pc.SPECULAR_BLINN;

// Fresnel
export const FRESNEL_NONE = pc.FRESNEL_NONE;
export const FRESNEL_SCHLICK = pc.FRESNEL_SCHLICK;

// Detail mode
export const DETAILMODE_MUL = pc.DETAILMODE_MUL;
export const DETAILMODE_ADD = pc.DETAILMODE_ADD;
export const DETAILMODE_SCREEN = pc.DETAILMODE_SCREEN;
export const DETAILMODE_OVERLAY = pc.DETAILMODE_OVERLAY;
export const DETAILMODE_MIN = pc.DETAILMODE_MIN;
export const DETAILMODE_MAX = pc.DETAILMODE_MAX;

// Shader def
export const SHADERDEF_NOSHADOW = pc.SHADERDEF_NOSHADOW;
export const SHADERDEF_SKIN = pc.SHADERDEF_SKIN;
export const SHADERDEF_UV0 = pc.SHADERDEF_UV0;
export const SHADERDEF_UV1 = pc.SHADERDEF_UV1;
export const SHADERDEF_VCOLOR = pc.SHADERDEF_VCOLOR;
export const SHADERDEF_INSTANCING = pc.SHADERDEF_INSTANCING;
export const SHADERDEF_LM = pc.SHADERDEF_LM;
export const SHADERDEF_DIRLM = pc.SHADERDEF_DIRLM;
export const SHADERDEF_SCREENSPACE = pc.SHADERDEF_SCREENSPACE;
export const SHADERDEF_TANGENTS = pc.SHADERDEF_TANGENTS;
export const SHADERDEF_MORPH_POSITION = pc.SHADERDEF_MORPH_POSITION;
export const SHADERDEF_MORPH_NORMAL = pc.SHADERDEF_MORPH_NORMAL;
export const SHADERDEF_MORPH_TEXTURE_BASED = pc.SHADERDEF_MORPH_TEXTURE_BASED;

// Stencil op
export const STENCILOP_KEEP = pc.STENCILOP_KEEP;
export const STENCILOP_ZERO = pc.STENCILOP_ZERO;
export const STENCILOP_REPLACE = pc.STENCILOP_REPLACE;
export const STENCILOP_INCREMENT = pc.STENCILOP_INCREMENT;
export const STENCILOP_INCREMENTWRAP = pc.STENCILOP_INCREMENTWRAP;
export const STENCILOP_DECREMENT = pc.STENCILOP_DECREMENT;
export const STENCILOP_DECREMENTWRAP = pc.STENCILOP_DECREMENTWRAP;
export const STENCILOP_INVERT = pc.STENCILOP_INVERT;

// Comparison function
export const FUNC_NEVER = pc.FUNC_NEVER;
export const FUNC_LESS = pc.FUNC_LESS;
export const FUNC_EQUAL = pc.FUNC_EQUAL;
export const FUNC_LESSEQUAL = pc.FUNC_LESSEQUAL;
export const FUNC_GREATER = pc.FUNC_GREATER;
export const FUNC_NOTEQUAL = pc.FUNC_NOTEQUAL;
export const FUNC_GREATEREQUAL = pc.FUNC_GREATEREQUAL;
export const FUNC_ALWAYS = pc.FUNC_ALWAYS;

// Blend equation
export const BLENDEQUATION_ADD = pc.BLENDEQUATION_ADD;
export const BLENDEQUATION_SUBTRACT = pc.BLENDEQUATION_SUBTRACT;
export const BLENDEQUATION_REVERSE_SUBTRACT = pc.BLENDEQUATION_REVERSE_SUBTRACT;
export const BLENDEQUATION_MIN = pc.BLENDEQUATION_MIN;
export const BLENDEQUATION_MAX = pc.BLENDEQUATION_MAX;

// Blend mode
export const BLENDMODE_ZERO = pc.BLENDMODE_ZERO;
export const BLENDMODE_ONE = pc.BLENDMODE_ONE;
export const BLENDMODE_SRC_COLOR = pc.BLENDMODE_SRC_COLOR;
export const BLENDMODE_ONE_MINUS_SRC_COLOR = pc.BLENDMODE_ONE_MINUS_SRC_COLOR;
export const BLENDMODE_DST_COLOR = pc.BLENDMODE_DST_COLOR;
export const BLENDMODE_ONE_MINUS_DST_COLOR = pc.BLENDMODE_ONE_MINUS_DST_COLOR;
export const BLENDMODE_SRC_ALPHA = pc.BLENDMODE_SRC_ALPHA;
export const BLENDMODE_SRC_ALPHA_SATURATE = pc.BLENDMODE_SRC_ALPHA_SATURATE;
export const BLENDMODE_ONE_MINUS_SRC_ALPHA = pc.BLENDMODE_ONE_MINUS_SRC_ALPHA;
export const BLENDMODE_DST_ALPHA = pc.BLENDMODE_DST_ALPHA;
export const BLENDMODE_ONE_MINUS_DST_ALPHA = pc.BLENDMODE_ONE_MINUS_DST_ALPHA;
export const BLENDMODE_CONSTANT_COLOR = pc.BLENDMODE_CONSTANT_COLOR;
export const BLENDMODE_ONE_MINUS_CONSTANT_COLOR = pc.BLENDMODE_ONE_MINUS_CONSTANT_COLOR;
export const BLENDMODE_CONSTANT_ALPHA = pc.BLENDMODE_CONSTANT_ALPHA;
export const BLENDMODE_ONE_MINUS_CONSTANT_ALPHA = pc.BLENDMODE_ONE_MINUS_CONSTANT_ALPHA;

// Script attributes (string constants)
export const ATTR_ASSET = 'asset';
export const ATTR_BOOLEAN = 'boolean';
export const ATTR_CURVE = 'curve';
export const ATTR_ENTITY = 'entity';
export const ATTR_ENUM = 'enum';
export const ATTR_JSON = 'json';
export const ATTR_NUMBER = 'number';
export const ATTR_RGB = 'rgb';
export const ATTR_RGBA = 'rgba';
export const ATTR_STRING = 'string';
export const ATTR_VEC2 = 'vec2';
export const ATTR_VEC3 = 'vec3';
export const ATTR_VEC4 = 'vec4';

// Version
export const version = pc.version;
export const revision = pc.revision;

// Export the entire pc object as default
export default pc;
