gaesup-world 1.0.25 → 1.0.26
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.
- package/dist/editor.cjs +1 -1
- package/dist/editor.js +2 -2
- package/dist/index.cjs +1 -1
- package/dist/index.js +2 -2
- package/dist/{plugin-w_f3FagE.js → plugin-B4mz3orW.js} +2736 -2719
- package/dist/{plugin-BrYtGVb8.cjs → plugin-DSEonzhm.cjs} +24 -24
- package/package.json +1 -1
package/dist/editor.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require("reflect-metadata");const e=require("./plugin-BrYtGVb8.cjs"),T=require("react"),S=require("@react-three/fiber"),I=require("three"),r=require("./index-CHq2GX18.cjs"),l=require("./gaesupStore-CRQ-tcIz.cjs"),E=require("./loader-D7cEHkCq.cjs");function g(t){const i=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t){for(const n in t)if(n!=="default"){const o=Object.getOwnPropertyDescriptor(t,n);Object.defineProperty(i,n,o.get?o:{enumerable:!0,get:()=>t[n]})}}return i.default=t,Object.freeze(i)}const _=g(I);var B=Object.defineProperty,D=Object.getOwnPropertyDescriptor,u=(t,i,n,o)=>{for(var d=D(i,n),s=t.length-1,c;s>=0;s--)(c=t[s])&&(d=c(i,n,d)||d);return d&&B(i,n,d),d};class a{static convertLegacyPosition(i){return{x:i[0],y:i[1],z:i[2]}}static convertLegacyRotation(i){return{x:i[0],y:i[1],z:i[2]}}static convertToLegacyPosition(i){return[i.x,i.y,i.z]}static convertToLegacyRotation(i){return[i.x,i.y,i.z]}static convertLegacyWall(i){return{id:i.id||`wall-${Date.now()}`,position:this.convertLegacyPosition(i.position),rotation:this.convertLegacyRotation(i.rotation),wallGroupId:i.wall_parent_id||"default",width:4,height:4,depth:.5}}static convertLegacyTile(i){return{id:i.id||`tile-${Date.now()}`,position:this.convertLegacyPosition(i.position),tileGroupId:i.tile_parent_id||"default",size:4}}static convertLegacyMesh(i){const n={id:i.id||`mesh-${Date.now()}`,color:i.color||"#ffffff",material:i.material==="GLASS"?"GLASS":"STANDARD",roughness:i.roughness||.5,metalness:i.metalness||0,opacity:i.opacity||1,transparent:i.transparent||!1};return i.map_texture_url&&(n.mapTextureUrl=i.map_texture_url),i.normal_texture_url&&(n.normalTextureUrl=i.normal_texture_url),n}}u([l.HandleError(),l.Profile()],a,"convertLegacyPosition");u([l.HandleError(),l.Profile()],a,"convertLegacyRotation");u([l.HandleError()],a,"convertToLegacyPosition");u([l.HandleError()],a,"convertToLegacyRotation");u([l.HandleError(),l.Profile()],a,"convertLegacyWall");u([l.HandleError(),l.Profile()],a,"convertLegacyTile");u([l.HandleError(),l.Profile()],a,"convertLegacyMesh");function L(){const t=T.useMemo(()=>({frustum:new _.Frustum,matrix:new _.Matrix4,camPos:new _.Vector3}),[]);return S.useFrame((i,n)=>{const o=i.camera;e.getGrassManager().size()!==0&&(t.matrix.multiplyMatrices(o.projectionMatrix,o.matrixWorldInverse),t.frustum.setFromProjectionMatrix(t.matrix),t.camPos.copy(o.position),e.getGrassManager().tick({elapsedTime:i.clock.elapsedTime,delta:n,cameraPosition:t.camPos,frustum:t.frustum}))}),null}exports.AnimationPanel=e.AnimationPanel;exports.Billboard=e.index;exports.BlockSystem=e.BlockSystem;exports.BuildingController=e.BuildingController;exports.BuildingGpuCullingDriver=e.BuildingGpuCullingDriver;exports.BuildingGpuMirrorDriver=e.BuildingGpuMirrorDriver;exports.BuildingGpuUploadDriver=e.BuildingGpuUploadDriver;exports.BuildingIndirectArgsUploadDriver=e.BuildingIndirectArgsUploadDriver;exports.BuildingIndirectDrawDriver=e.BuildingIndirectDrawDriver;exports.BuildingNavigationObstacleDriver=e.BuildingNavigationObstacleDriver;exports.BuildingPanel=e.BuildingPanel;exports.BuildingRenderStateDriver=e.BuildingRenderStateDriver;exports.BuildingSystem=e.BuildingSystem;exports.BuildingUI=e.BuildingUI;exports.BuildingVisibilityDriver=e.BuildingVisibilityDriver;exports.CameraPanel=e.CameraPanel;exports.DEFAULT_BUILDING_GRID_EXTENSION_ID=e.DEFAULT_BUILDING_GRID_EXTENSION_ID;exports.DEFAULT_BUILDING_OBJECT_CATALOG=e.DEFAULT_BUILDING_OBJECT_CATALOG;exports.DEFAULT_BUILDING_PLACEMENT_EXTENSION_ID=e.DEFAULT_BUILDING_PLACEMENT_EXTENSION_ID;exports.DEFAULT_BUILDING_SAVE_EXTENSION_ID=e.DEFAULT_BUILDING_SAVE_EXTENSION_ID;exports.DEFAULT_BUILDING_STORE_SERVICE_ID=e.DEFAULT_BUILDING_STORE_SERVICE_ID;exports.DRAW_CLUSTER_BILLBOARD=e.DRAW_CLUSTER_BILLBOARD;exports.DRAW_CLUSTER_BLOCK=e.DRAW_CLUSTER_BLOCK;exports.DRAW_CLUSTER_COUNT=e.DRAW_CLUSTER_COUNT;exports.DRAW_CLUSTER_DESCRIPTORS=e.DRAW_CLUSTER_DESCRIPTORS;exports.DRAW_CLUSTER_FIRE=e.DRAW_CLUSTER_FIRE;exports.DRAW_CLUSTER_FLAG=e.DRAW_CLUSTER_FLAG;exports.DRAW_CLUSTER_GRASS=e.DRAW_CLUSTER_GRASS;exports.DRAW_CLUSTER_MODEL=e.DRAW_CLUSTER_MODEL;exports.DRAW_CLUSTER_SAKURA=e.DRAW_CLUSTER_SAKURA;exports.DRAW_CLUSTER_SAND=e.DRAW_CLUSTER_SAND;exports.DRAW_CLUSTER_SNOWFIELD=e.DRAW_CLUSTER_SNOWFIELD;exports.DRAW_CLUSTER_TILE=e.DRAW_CLUSTER_TILE;exports.DRAW_CLUSTER_WALL=e.DRAW_CLUSTER_WALL;exports.DRAW_CLUSTER_WATER=e.DRAW_CLUSTER_WATER;exports.EDITOR_PANEL_COMPONENT_KIND=e.EDITOR_PANEL_COMPONENT_KIND;exports.Editor=e.Editor;exports.EditorLayout=e.EditorLayout;exports.Fire=e.index$1;exports.GPU_META_STRIDE=e.GPU_META_STRIDE;exports.GPU_SPATIAL_STRIDE=e.GPU_SPATIAL_STRIDE;exports.GameplayEventPanel=e.GameplayEventPanel;exports.Grass=e.Grass;exports.GridHelper=e.GridHelper;exports.INDIRECT_DRAW_STRIDE=e.INDIRECT_DRAW_STRIDE;exports.MotionPanel=e.MotionPanel;exports.PerformancePanel=e.PerformancePanel;exports.ResizablePanel=e.ResizablePanel;exports.Sakura=e.Sakura;exports.SakuraBatch=e.SakuraBatch;exports.Sand=e.Sand;exports.SandBatch=e.SandBatch;exports.Snow=e.Snow;exports.Snowfield=e.Snowfield;exports.SnowfieldBatch=e.SnowfieldBatch;exports.StudioPanel=e.StudioPanel;exports.TileSystem=e.TileSystem;exports.VehiclePanel=e.VehiclePanel;exports.WallSystem=e.WallSystem;exports.Water=e.Ocean;exports.applyBuildingNavigationObstacles=e.applyBuildingNavigationObstacles;exports.buildBuildingGpuMirror=e.buildBuildingGpuMirror;exports.buildBuildingIndirectDrawMirror=e.buildBuildingIndirectDrawMirror;exports.buildingPlugin=e.buildingPlugin;exports.createBuildingGpuUploadPlan=e.createBuildingGpuUploadPlan;exports.createBuildingIndirectDrawUploadPlan=e.createBuildingIndirectDrawUploadPlan;exports.createBuildingPlugin=e.createBuildingPlugin;exports.createBuildingScopeId=e.createBuildingScopeId;exports.createCustomMeshId=e.createCustomMeshId;exports.createEditorCommandStack=e.createEditorCommandStack;exports.createEditorShell=e.createEditorShell;exports.createEditorSlice=e.createEditorSlice;exports.createEmptyBuildingGpuUploadResources=e.createEmptyBuildingGpuUploadResources;exports.createEmptyBuildingIndirectDrawMirror=e.createEmptyBuildingIndirectDrawMirror;exports.createEmptyGpuMirror=e.createEmptyGpuMirror;exports.createTerrainBlockMaterial=e.createTerrainBlockMaterial;exports.destroyBuildingGpuUploadResources=e.destroyBuildingGpuUploadResources;exports.editorSlice=e.editorSlice;exports.findTerrainBlockMaterial=e.findTerrainBlockMaterial;exports.getDefaultBuildingObject=e.getDefaultBuildingObject;exports.getDrawClusterForSnapshotEntry=e.getDrawClusterForSnapshotEntry;exports.getGrassManager=e.getGrassManager;exports.getIndirectInstanceCount=e.getIndirectInstanceCount;exports.getWallMaterialKey=e.getWallMaterialKey;exports.getWebGPUDeviceFromRenderer=e.getWebGPUDeviceFromRenderer;exports.isEditorPanelComponentExtension=e.isEditorPanelComponentExtension;exports.parseBuildingGpuVisibilityFlags=e.parseBuildingGpuVisibilityFlags;exports.resolveEditorPanelComponentExtensions=e.resolveEditorPanelComponentExtensions;exports.syncBuildingGpuBuffers=e.syncBuildingGpuBuffers;exports.syncBuildingIndirectArgsBuffer=e.syncBuildingIndirectArgsBuffer;exports.useBuildingEditor=e.useBuildingEditor;exports.useBuildingGpuCullingStore=e.useBuildingGpuCullingStore;exports.useBuildingRenderStateStore=e.useBuildingRenderStateStore;exports.useBuildingVisibilityStore=e.useBuildingVisibilityStore;exports.useEditor=e.useEditor;exports.useEditorStore=e.useEditorStore;exports.BUILDING_BASIC_OBJECT_OPTIONS=r.BUILDING_BASIC_OBJECT_OPTIONS;exports.BUILDING_FLAG_STYLE_OPTIONS=r.BUILDING_FLAG_STYLE_OPTIONS;exports.BUILDING_PLACED_OBJECT_OPTIONS=r.BUILDING_PLACED_OBJECT_OPTIONS;exports.BUILDING_TILE_OBJECT_OPTIONS=r.BUILDING_TILE_OBJECT_OPTIONS;exports.BUILDING_TILE_PRESETS=r.BUILDING_TILE_PRESETS;exports.BUILDING_TILE_SHAPE_OPTIONS=r.BUILDING_TILE_SHAPE_OPTIONS;exports.BUILDING_TREE_COLOR_PRESETS=r.BUILDING_TREE_COLOR_PRESETS;exports.BUILDING_TREE_OPTIONS=r.BUILDING_TREE_OPTIONS;exports.BUILDING_WALL_KIND_OPTIONS=r.BUILDING_WALL_KIND_OPTIONS;exports.BUILDING_WALL_PRESETS=r.BUILDING_WALL_PRESETS;exports.BUILDING_WEATHER_EFFECT_OPTIONS=r.BUILDING_WEATHER_EFFECT_OPTIONS;exports.FLAG_STYLE_META=r.FLAG_STYLE_META;exports.blockToPlacementEntry=r.blockToPlacementEntry;exports.buildingCellToWorld=r.buildingCellToWorld;exports.buildingGridAdapter=r.buildingGridAdapter;exports.buildingGroupsToPlacementEntries=r.buildingGroupsToPlacementEntries;exports.buildingPlacementAdapter=r.buildingPlacementAdapter;exports.cellToTilePosition=r.cellToTilePosition;exports.createBlockFootprint=r.createBlockFootprint;exports.createBuildingPlacementEngine=r.createBuildingPlacementEngine;exports.createTileFootprint=r.createTileFootprint;exports.edgeKey=r.edgeKey;exports.edgeSideToWallRotation=r.edgeSideToWallRotation;exports.edgeToWallTransform=r.edgeToWallTransform;exports.getTileSupportHeight=r.getTileSupportHeight;exports.hasTileCollision=r.hasTileCollision;exports.hasWallCollision=r.hasWallCollision;exports.indexAabb=r.indexAabb;exports.normalizeQuarterTurnRotation=r.normalizeQuarterTurnRotation;exports.pair=r.pair;exports.queryAabbIds=r.queryAabbIds;exports.snapBuildingPosition=r.snapBuildingPosition;exports.tileFootprintKeys=r.tileFootprintKeys;exports.tileGroupToPlacementEntries=r.tileGroupToPlacementEntries;exports.tileHalfSize=r.tileHalfSize;exports.tileOverlaps=r.tileOverlaps;exports.tilePositionToCell=r.tilePositionToCell;exports.tileToPlacementEntry=r.tileToPlacementEntry;exports.unindexId=r.unindexId;exports.useBuildingStore=r.useBuildingStore;exports.wallGroupToPlacementEntries=r.wallGroupToPlacementEntries;exports.wallToPlacementEntry=r.wallToPlacementEntry;exports.wallTransformToEdge=r.wallTransformToEdge;exports.worldToBuildingCell=r.worldToBuildingCell;exports.zigZag=r.zigZag;exports.CONTENT_SCHEMA_VERSION=E.CONTENT_SCHEMA_VERSION;exports.HttpContentBundleSource=E.HttpContentBundleSource;exports.createContentBundleFromSaveSystem=E.createContentBundleFromSaveSystem;exports.loadContentBundleFromManifest=E.loadContentBundleFromManifest;exports.validateContentBundle=E.validateContentBundle;exports.validateContentBundleManifest=E.validateContentBundleManifest;exports.BuildingBridge=a;exports.GrassDriver=L;
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require("reflect-metadata");const e=require("./plugin-DSEonzhm.cjs"),T=require("react"),S=require("@react-three/fiber"),I=require("three"),r=require("./index-CHq2GX18.cjs"),l=require("./gaesupStore-CRQ-tcIz.cjs"),E=require("./loader-D7cEHkCq.cjs");function g(t){const i=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t){for(const n in t)if(n!=="default"){const o=Object.getOwnPropertyDescriptor(t,n);Object.defineProperty(i,n,o.get?o:{enumerable:!0,get:()=>t[n]})}}return i.default=t,Object.freeze(i)}const _=g(I);var B=Object.defineProperty,D=Object.getOwnPropertyDescriptor,u=(t,i,n,o)=>{for(var d=D(i,n),s=t.length-1,c;s>=0;s--)(c=t[s])&&(d=c(i,n,d)||d);return d&&B(i,n,d),d};class a{static convertLegacyPosition(i){return{x:i[0],y:i[1],z:i[2]}}static convertLegacyRotation(i){return{x:i[0],y:i[1],z:i[2]}}static convertToLegacyPosition(i){return[i.x,i.y,i.z]}static convertToLegacyRotation(i){return[i.x,i.y,i.z]}static convertLegacyWall(i){return{id:i.id||`wall-${Date.now()}`,position:this.convertLegacyPosition(i.position),rotation:this.convertLegacyRotation(i.rotation),wallGroupId:i.wall_parent_id||"default",width:4,height:4,depth:.5}}static convertLegacyTile(i){return{id:i.id||`tile-${Date.now()}`,position:this.convertLegacyPosition(i.position),tileGroupId:i.tile_parent_id||"default",size:4}}static convertLegacyMesh(i){const n={id:i.id||`mesh-${Date.now()}`,color:i.color||"#ffffff",material:i.material==="GLASS"?"GLASS":"STANDARD",roughness:i.roughness||.5,metalness:i.metalness||0,opacity:i.opacity||1,transparent:i.transparent||!1};return i.map_texture_url&&(n.mapTextureUrl=i.map_texture_url),i.normal_texture_url&&(n.normalTextureUrl=i.normal_texture_url),n}}u([l.HandleError(),l.Profile()],a,"convertLegacyPosition");u([l.HandleError(),l.Profile()],a,"convertLegacyRotation");u([l.HandleError()],a,"convertToLegacyPosition");u([l.HandleError()],a,"convertToLegacyRotation");u([l.HandleError(),l.Profile()],a,"convertLegacyWall");u([l.HandleError(),l.Profile()],a,"convertLegacyTile");u([l.HandleError(),l.Profile()],a,"convertLegacyMesh");function L(){const t=T.useMemo(()=>({frustum:new _.Frustum,matrix:new _.Matrix4,camPos:new _.Vector3}),[]);return S.useFrame((i,n)=>{const o=i.camera;e.getGrassManager().size()!==0&&(t.matrix.multiplyMatrices(o.projectionMatrix,o.matrixWorldInverse),t.frustum.setFromProjectionMatrix(t.matrix),t.camPos.copy(o.position),e.getGrassManager().tick({elapsedTime:i.clock.elapsedTime,delta:n,cameraPosition:t.camPos,frustum:t.frustum}))}),null}exports.AnimationPanel=e.AnimationPanel;exports.Billboard=e.index;exports.BlockSystem=e.BlockSystem;exports.BuildingController=e.BuildingController;exports.BuildingGpuCullingDriver=e.BuildingGpuCullingDriver;exports.BuildingGpuMirrorDriver=e.BuildingGpuMirrorDriver;exports.BuildingGpuUploadDriver=e.BuildingGpuUploadDriver;exports.BuildingIndirectArgsUploadDriver=e.BuildingIndirectArgsUploadDriver;exports.BuildingIndirectDrawDriver=e.BuildingIndirectDrawDriver;exports.BuildingNavigationObstacleDriver=e.BuildingNavigationObstacleDriver;exports.BuildingPanel=e.BuildingPanel;exports.BuildingRenderStateDriver=e.BuildingRenderStateDriver;exports.BuildingSystem=e.BuildingSystem;exports.BuildingUI=e.BuildingUI;exports.BuildingVisibilityDriver=e.BuildingVisibilityDriver;exports.CameraPanel=e.CameraPanel;exports.DEFAULT_BUILDING_GRID_EXTENSION_ID=e.DEFAULT_BUILDING_GRID_EXTENSION_ID;exports.DEFAULT_BUILDING_OBJECT_CATALOG=e.DEFAULT_BUILDING_OBJECT_CATALOG;exports.DEFAULT_BUILDING_PLACEMENT_EXTENSION_ID=e.DEFAULT_BUILDING_PLACEMENT_EXTENSION_ID;exports.DEFAULT_BUILDING_SAVE_EXTENSION_ID=e.DEFAULT_BUILDING_SAVE_EXTENSION_ID;exports.DEFAULT_BUILDING_STORE_SERVICE_ID=e.DEFAULT_BUILDING_STORE_SERVICE_ID;exports.DRAW_CLUSTER_BILLBOARD=e.DRAW_CLUSTER_BILLBOARD;exports.DRAW_CLUSTER_BLOCK=e.DRAW_CLUSTER_BLOCK;exports.DRAW_CLUSTER_COUNT=e.DRAW_CLUSTER_COUNT;exports.DRAW_CLUSTER_DESCRIPTORS=e.DRAW_CLUSTER_DESCRIPTORS;exports.DRAW_CLUSTER_FIRE=e.DRAW_CLUSTER_FIRE;exports.DRAW_CLUSTER_FLAG=e.DRAW_CLUSTER_FLAG;exports.DRAW_CLUSTER_GRASS=e.DRAW_CLUSTER_GRASS;exports.DRAW_CLUSTER_MODEL=e.DRAW_CLUSTER_MODEL;exports.DRAW_CLUSTER_SAKURA=e.DRAW_CLUSTER_SAKURA;exports.DRAW_CLUSTER_SAND=e.DRAW_CLUSTER_SAND;exports.DRAW_CLUSTER_SNOWFIELD=e.DRAW_CLUSTER_SNOWFIELD;exports.DRAW_CLUSTER_TILE=e.DRAW_CLUSTER_TILE;exports.DRAW_CLUSTER_WALL=e.DRAW_CLUSTER_WALL;exports.DRAW_CLUSTER_WATER=e.DRAW_CLUSTER_WATER;exports.EDITOR_PANEL_COMPONENT_KIND=e.EDITOR_PANEL_COMPONENT_KIND;exports.Editor=e.Editor;exports.EditorLayout=e.EditorLayout;exports.Fire=e.index$1;exports.GPU_META_STRIDE=e.GPU_META_STRIDE;exports.GPU_SPATIAL_STRIDE=e.GPU_SPATIAL_STRIDE;exports.GameplayEventPanel=e.GameplayEventPanel;exports.Grass=e.Grass;exports.GridHelper=e.GridHelper;exports.INDIRECT_DRAW_STRIDE=e.INDIRECT_DRAW_STRIDE;exports.MotionPanel=e.MotionPanel;exports.PerformancePanel=e.PerformancePanel;exports.ResizablePanel=e.ResizablePanel;exports.Sakura=e.Sakura;exports.SakuraBatch=e.SakuraBatch;exports.Sand=e.Sand;exports.SandBatch=e.SandBatch;exports.Snow=e.Snow;exports.Snowfield=e.Snowfield;exports.SnowfieldBatch=e.SnowfieldBatch;exports.StudioPanel=e.StudioPanel;exports.TileSystem=e.TileSystem;exports.VehiclePanel=e.VehiclePanel;exports.WallSystem=e.WallSystem;exports.Water=e.Ocean;exports.applyBuildingNavigationObstacles=e.applyBuildingNavigationObstacles;exports.buildBuildingGpuMirror=e.buildBuildingGpuMirror;exports.buildBuildingIndirectDrawMirror=e.buildBuildingIndirectDrawMirror;exports.buildingPlugin=e.buildingPlugin;exports.createBuildingGpuUploadPlan=e.createBuildingGpuUploadPlan;exports.createBuildingIndirectDrawUploadPlan=e.createBuildingIndirectDrawUploadPlan;exports.createBuildingPlugin=e.createBuildingPlugin;exports.createBuildingScopeId=e.createBuildingScopeId;exports.createCustomMeshId=e.createCustomMeshId;exports.createEditorCommandStack=e.createEditorCommandStack;exports.createEditorShell=e.createEditorShell;exports.createEditorSlice=e.createEditorSlice;exports.createEmptyBuildingGpuUploadResources=e.createEmptyBuildingGpuUploadResources;exports.createEmptyBuildingIndirectDrawMirror=e.createEmptyBuildingIndirectDrawMirror;exports.createEmptyGpuMirror=e.createEmptyGpuMirror;exports.createTerrainBlockMaterial=e.createTerrainBlockMaterial;exports.destroyBuildingGpuUploadResources=e.destroyBuildingGpuUploadResources;exports.editorSlice=e.editorSlice;exports.findTerrainBlockMaterial=e.findTerrainBlockMaterial;exports.getDefaultBuildingObject=e.getDefaultBuildingObject;exports.getDrawClusterForSnapshotEntry=e.getDrawClusterForSnapshotEntry;exports.getGrassManager=e.getGrassManager;exports.getIndirectInstanceCount=e.getIndirectInstanceCount;exports.getWallMaterialKey=e.getWallMaterialKey;exports.getWebGPUDeviceFromRenderer=e.getWebGPUDeviceFromRenderer;exports.isEditorPanelComponentExtension=e.isEditorPanelComponentExtension;exports.parseBuildingGpuVisibilityFlags=e.parseBuildingGpuVisibilityFlags;exports.resolveEditorPanelComponentExtensions=e.resolveEditorPanelComponentExtensions;exports.syncBuildingGpuBuffers=e.syncBuildingGpuBuffers;exports.syncBuildingIndirectArgsBuffer=e.syncBuildingIndirectArgsBuffer;exports.useBuildingEditor=e.useBuildingEditor;exports.useBuildingGpuCullingStore=e.useBuildingGpuCullingStore;exports.useBuildingRenderStateStore=e.useBuildingRenderStateStore;exports.useBuildingVisibilityStore=e.useBuildingVisibilityStore;exports.useEditor=e.useEditor;exports.useEditorStore=e.useEditorStore;exports.BUILDING_BASIC_OBJECT_OPTIONS=r.BUILDING_BASIC_OBJECT_OPTIONS;exports.BUILDING_FLAG_STYLE_OPTIONS=r.BUILDING_FLAG_STYLE_OPTIONS;exports.BUILDING_PLACED_OBJECT_OPTIONS=r.BUILDING_PLACED_OBJECT_OPTIONS;exports.BUILDING_TILE_OBJECT_OPTIONS=r.BUILDING_TILE_OBJECT_OPTIONS;exports.BUILDING_TILE_PRESETS=r.BUILDING_TILE_PRESETS;exports.BUILDING_TILE_SHAPE_OPTIONS=r.BUILDING_TILE_SHAPE_OPTIONS;exports.BUILDING_TREE_COLOR_PRESETS=r.BUILDING_TREE_COLOR_PRESETS;exports.BUILDING_TREE_OPTIONS=r.BUILDING_TREE_OPTIONS;exports.BUILDING_WALL_KIND_OPTIONS=r.BUILDING_WALL_KIND_OPTIONS;exports.BUILDING_WALL_PRESETS=r.BUILDING_WALL_PRESETS;exports.BUILDING_WEATHER_EFFECT_OPTIONS=r.BUILDING_WEATHER_EFFECT_OPTIONS;exports.FLAG_STYLE_META=r.FLAG_STYLE_META;exports.blockToPlacementEntry=r.blockToPlacementEntry;exports.buildingCellToWorld=r.buildingCellToWorld;exports.buildingGridAdapter=r.buildingGridAdapter;exports.buildingGroupsToPlacementEntries=r.buildingGroupsToPlacementEntries;exports.buildingPlacementAdapter=r.buildingPlacementAdapter;exports.cellToTilePosition=r.cellToTilePosition;exports.createBlockFootprint=r.createBlockFootprint;exports.createBuildingPlacementEngine=r.createBuildingPlacementEngine;exports.createTileFootprint=r.createTileFootprint;exports.edgeKey=r.edgeKey;exports.edgeSideToWallRotation=r.edgeSideToWallRotation;exports.edgeToWallTransform=r.edgeToWallTransform;exports.getTileSupportHeight=r.getTileSupportHeight;exports.hasTileCollision=r.hasTileCollision;exports.hasWallCollision=r.hasWallCollision;exports.indexAabb=r.indexAabb;exports.normalizeQuarterTurnRotation=r.normalizeQuarterTurnRotation;exports.pair=r.pair;exports.queryAabbIds=r.queryAabbIds;exports.snapBuildingPosition=r.snapBuildingPosition;exports.tileFootprintKeys=r.tileFootprintKeys;exports.tileGroupToPlacementEntries=r.tileGroupToPlacementEntries;exports.tileHalfSize=r.tileHalfSize;exports.tileOverlaps=r.tileOverlaps;exports.tilePositionToCell=r.tilePositionToCell;exports.tileToPlacementEntry=r.tileToPlacementEntry;exports.unindexId=r.unindexId;exports.useBuildingStore=r.useBuildingStore;exports.wallGroupToPlacementEntries=r.wallGroupToPlacementEntries;exports.wallToPlacementEntry=r.wallToPlacementEntry;exports.wallTransformToEdge=r.wallTransformToEdge;exports.worldToBuildingCell=r.worldToBuildingCell;exports.zigZag=r.zigZag;exports.CONTENT_SCHEMA_VERSION=E.CONTENT_SCHEMA_VERSION;exports.HttpContentBundleSource=E.HttpContentBundleSource;exports.createContentBundleFromSaveSystem=E.createContentBundleFromSaveSystem;exports.loadContentBundleFromManifest=E.loadContentBundleFromManifest;exports.validateContentBundle=E.validateContentBundle;exports.validateContentBundleManifest=E.validateContentBundleManifest;exports.BuildingBridge=a;exports.GrassDriver=L;
|
package/dist/editor.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import "reflect-metadata";
|
|
2
|
-
import { g as _ } from "./plugin-
|
|
3
|
-
import { A, s as C, y as G, w as U, F as f, z as N, D as O, I as v, H as y, K as W, B as x, x as w, v as F, U as b, J as h, C as M, _ as z, X as H, $ as k, a0 as K, a1 as V, ac as j, ad as J, ae as q, a8 as X, af as $, ag as Q, ah as Y, ai as Z, aj as aa, ak as ea, al as ia, am as ta, an as ra, ao as sa, E as na, a as oa, b as la, t as ua, aq as da, ap as ca, G as _a, q as Ea, N as Ta, a6 as Sa, M as Ia, P as La, R as ma, j as Da, k as pa, l as Ba, m as ga, p as Ra, n as Pa, o as Aa, S as Ca, T as Ga, V as Ua, W as fa, O as Na, a4 as Oa, as as va, aa as ya, a3 as Wa, at as xa, ab as wa, a2 as Fa, Z as ba, Q as ha, c as Ma, d as za, h as Ha, ax as ka, a9 as Ka, ar as Va, aD as ja, az as Ja, e as qa, aE as Xa, Y as $a, au as Qa, a7 as Ya, L as Za, ay as ae, i as ee, av as ie, r as te, aA as re, aB as se, aF as ne, aw as oe, a5 as le, aC as ue, u as de, f as ce } from "./plugin-
|
|
2
|
+
import { g as _ } from "./plugin-B4mz3orW.js";
|
|
3
|
+
import { A, s as C, y as G, w as U, F as f, z as N, D as O, I as v, H as y, K as W, B as x, x as w, v as F, U as b, J as h, C as M, _ as z, X as H, $ as k, a0 as K, a1 as V, ac as j, ad as J, ae as q, a8 as X, af as $, ag as Q, ah as Y, ai as Z, aj as aa, ak as ea, al as ia, am as ta, an as ra, ao as sa, E as na, a as oa, b as la, t as ua, aq as da, ap as ca, G as _a, q as Ea, N as Ta, a6 as Sa, M as Ia, P as La, R as ma, j as Da, k as pa, l as Ba, m as ga, p as Ra, n as Pa, o as Aa, S as Ca, T as Ga, V as Ua, W as fa, O as Na, a4 as Oa, as as va, aa as ya, a3 as Wa, at as xa, ab as wa, a2 as Fa, Z as ba, Q as ha, c as Ma, d as za, h as Ha, ax as ka, a9 as Ka, ar as Va, aD as ja, az as Ja, e as qa, aE as Xa, Y as $a, au as Qa, a7 as Ya, L as Za, ay as ae, i as ee, av as ie, r as te, aA as re, aB as se, aF as ne, aw as oe, a5 as le, aC as ue, u as de, f as ce } from "./plugin-B4mz3orW.js";
|
|
4
4
|
import { useMemo as E } from "react";
|
|
5
5
|
import { useFrame as T } from "@react-three/fiber";
|
|
6
6
|
import * as d from "three";
|
package/dist/index.cjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require("reflect-metadata");const je=require("./index-BqQVctx5.cjs"),P=require("./index-CHq2GX18.cjs"),L=require("./index-BaJuQ3eD.cjs"),X=require("./runtimeFilter-W6iMw1pL.cjs"),b=require("./plugin-BrYtGVb8.cjs"),le=require("./index-DDcqrZur.cjs"),ue=require("./index-H2VCOZxB.cjs"),kn=require("three"),A=require("./gaesupStore-CRQ-tcIz.cjs"),i=require("react/jsx-runtime"),m=require("react"),Y=require("@react-three/fiber"),ct=require("./index-BhSman4a.cjs"),ee=require("./index-qg4wXy51.cjs"),j=require("./timeStore-CDN035t4.cjs"),S=require("./eventsStore-Cipkf938.cjs"),O=require("./plugins.cjs"),q=require("zustand"),se=require("./authority-BOPCXUrV.cjs"),k=require("./loader-D7cEHkCq.cjs"),B=require("./weatherStore-1unmwIen.cjs"),ye=require("./assetStore-DVPge_2j.cjs"),lt=require("./index-DCa_lUwq.cjs"),Tn=require("./api-B58jaq5T.cjs"),ut=require("./serverHost-C_bhbyiP.cjs");function Rn(e){const n=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const t in e)if(t!=="default"){const r=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(n,t,r.get?r:{enumerable:!0,get:()=>e[t]})}}return n.default=e,Object.freeze(n)}const I=Rn(kn),Pn=()=>({position:new I.Vector3(0,0,0),velocity:new I.Vector3(0,0,0),rotation:new I.Euler(0,0,0),isMoving:!1,isGrounded:!1,speed:0,height:2});function te(e={}){const{updateInterval:n=0,entityId:t}=e,r=m.useRef(null);r.current||(r.current=Pn());const[,s]=m.useState(0),o=m.useRef(0),a=m.useRef(0),c=m.useRef({x:0,y:0,z:0}),u=m.useRef(void 0),l=m.useRef(null),{activeState:f,gameStates:d}=P.useStateSystem(),p=y=>{if(t)return t;if(u.current)return u.current;const h=y.getActiveEntities();return u.current=h[0],u.current};return m.useEffect(()=>{u.current=void 0,l.current=A.BridgeFactory.getOrCreate("motion");const y=l.current;if(!y)return;const h=y.subscribe((E,w)=>{const g=p(y);if(!g||w!==g)return;const v=performance.now();if(a.current=v,n>0&&v-o.current<n)return;o.current=v;const C=r.current;C.position.copy(E.position),C.velocity.copy(E.velocity),C.rotation.copy(E.rotation),C.isMoving=E.isMoving,C.isGrounded=E.isGrounded,C.speed=E.speed,C.height=2,s(R=>R+1)});return()=>{h()}},[t,n]),Y.useFrame(()=>{const y=performance.now();if(n>0&&y-o.current<n)return;const h=r.current,E=l.current,w=g=>{const v=c.current,C=g.x-v.x,R=g.y-v.y,D=g.z-v.z;return C*C+R*R+D*D>1e-6?(v.x=g.x,v.y=g.y,v.z=g.z,!0):!1};if(E){const g=p(E);if(!(y-a.current<16)&&g){const C=E.snapshot(g);if(C){h.position.copy(C.position),h.velocity.copy(C.velocity),h.rotation.copy(C.rotation),h.isMoving=C.isMoving,h.isGrounded=C.isGrounded,h.speed=C.speed,h.height=2,o.current=y,w(h.position)&&s(R=>R+1);return}}}f?.position&&(h.position.copy(f.position),f.velocity?h.velocity.copy(f.velocity):h.velocity.set(0,0,0),f.euler?h.rotation.copy(f.euler):h.rotation.set(0,0,0),h.isMoving=d?.isMoving||!1,h.isGrounded=d?.isOnTheGround||!1,h.speed=f.velocity?f.velocity.length():0,h.height=2,o.current=y,w(h.position)&&s(g=>g+1))}),r.current}const Z=q.create((e,n)=>({entries:new Map,current:null,register:t=>{const r=new Map(n().entries);r.set(t.id,t),e({entries:r})},unregister:t=>{const r=n().entries;if(!r.has(t))return;const s=new Map(r);s.delete(t),e({entries:s})},updatePosition:(t,r)=>{const s=n().entries.get(t);s&&s.position.copy(r)},getAll:()=>Array.from(n().entries.values()),setCurrent:t=>{const r=n().current;r!==t&&(r&&t&&r.id===t.id&&Math.abs(r.distance-t.distance)<.05||e({current:t}))},activateCurrent:()=>{const t=n().current;if(!t)return;const r=n().entries.get(t.id);r&&r.onActivate()}})),Ue=new I.Vector3;function Oe(){return Z(e=>e.current)}function dt(e=!0){const n=Oe(),t=Z(o=>o.activateCurrent),r=P.useInputBackend(),s=m.useRef(!1);m.useEffect(()=>{if(s.current=!1,!e||!n)return;const o=u=>{u&&!s.current&&t(),s.current=u},a=_n(n.key);if(a&&r.subscribe)return o(!!r.getKeyboard()[a]),r.subscribe(({keyboard:u})=>{o(!!u[a])});const c=u=>{const l=u.target?.tagName?.toLowerCase();l==="input"||l==="textarea"||u.key.toLowerCase()===n.key.toLowerCase()&&t()};return window.addEventListener("keydown",c),()=>window.removeEventListener("keydown",c)},[n,e,t,r])}function _n(e){switch(e.toLowerCase()){case"w":return"forward";case"a":return"leftward";case"s":return"backward";case"d":return"rightward";case"shift":return"shift";case" ":case"space":return"space";case"z":return"keyZ";case"r":return"keyR";case"f":return"keyF";case"e":return"keyE";case"escape":return"escape";default:return null}}function jn({throttleMs:e=80}={}){const{position:n}=te({updateInterval:16}),t=Z(o=>o.entries),r=Z(o=>o.setCurrent),s=m.useRef(0);return Y.useFrame((o,a)=>{if(s.current+=a*1e3,s.current<e)return;s.current=0;let c=null,u=1/0,l="",f="e";for(const d of t.values()){Ue.copy(d.position).sub(n);const p=Ue.lengthSq(),y=d.range*d.range;p>y||p<u&&(u=p,c=d.id,l=d.label,f=d.key)}if(!c){r(null);return}r({id:c,label:l,key:f,distance:Math.sqrt(u)})}),null}function Dn({advanceKey:e="e",closeKey:n="Escape"}){const t=k.useDialogStore(u=>u.node),r=k.useDialogStore(u=>u.runner),s=k.useDialogStore(u=>u.advance),o=k.useDialogStore(u=>u.choose),a=k.useDialogStore(u=>u.close),c=r?.visibleChoices()??[];return m.useEffect(()=>{if(!t)return;const u=l=>{if(l.key===n){a();return}if(c.length===0&&l.key.toLowerCase()===e.toLowerCase()){s();return}const f=parseInt(l.key,10);!Number.isNaN(f)&&f>=1&&f<=c.length&&o(f-1)};return window.addEventListener("keydown",u),()=>window.removeEventListener("keydown",u)},[t,c.length,s,o,a,e,n]),t?i.jsxs("div",{style:{position:"fixed",left:"50%",bottom:110,transform:"translateX(-50%)",width:"min(720px, 92vw)",zIndex:120,background:"rgba(18,20,28,0.62)",color:"#f3f4f8",borderRadius:14,border:"1px solid rgba(255,255,255,0.12)",boxShadow:"0 12px 28px rgba(0,0,0,0.5), inset 0 1px 0 rgba(255,255,255,0.06)",backdropFilter:"blur(20px) saturate(140%)",WebkitBackdropFilter:"blur(20px) saturate(140%)",fontFamily:"'Pretendard', system-ui, sans-serif",fontSize:14,padding:14},children:[t.speaker&&i.jsx("div",{style:{display:"inline-block",padding:"3px 8px",background:"#ffd84a",color:"#1a1a1a",borderRadius:6,fontWeight:700,fontSize:12,marginBottom:6},children:t.speaker}),i.jsx("div",{style:{lineHeight:1.55,whiteSpace:"pre-wrap"},children:t.text}),c.length===0?i.jsxs("div",{style:{marginTop:10,fontSize:12,opacity:.65,textAlign:"right"},children:["[",e.toUpperCase(),"] 다음"]}):i.jsx("div",{style:{marginTop:10,display:"flex",flexDirection:"column",gap:6},children:c.map((u,l)=>i.jsxs("button",{onClick:()=>o(l),style:{textAlign:"left",padding:"9px 12px",background:"rgba(255,255,255,0.06)",color:"#f3f4f8",border:"1px solid rgba(255,255,255,0.12)",borderRadius:8,cursor:"pointer",fontFamily:"'Pretendard', system-ui, sans-serif",fontSize:13,fontWeight:500},children:[i.jsxs("span",{style:{display:"inline-block",width:18,color:"#ffd84a",marginRight:6},children:[l+1,"."]}),u.text]},l))})]}):null}const Mn="gaesup.events",An="events",Ln="events.store";function ft(){return S.useEventsStore.getState().serialize()}function pt(e){S.useEventsStore.getState().hydrate(e)}function mt(e={}){return O.createStoreDomainPlugin({id:e.id??Mn,name:"GaeSup Events",saveExtensionId:e.saveExtensionId??An,storeServiceId:e.storeServiceId??Ln,store:S.useEventsStore,readyEvent:"events:ready",capabilities:["events"],serialize:ft,hydrate:pt})}const On=mt();function Nn(e=!0,n={}){m.useEffect(()=>{if(!e)return;const t=()=>{const s=j.useTimeStore.getState().time,{started:o,ended:a}=S.useEventsStore.getState().refresh(s);o.length&&n.onStarted&&n.onStarted(o),a.length&&n.onEnded&&n.onEnded(a)};return t(),j.useTimeStore.subscribe((s,o)=>{(s.time.day!==o.time.day||s.time.month!==o.time.month||s.time.season!==o.time.season||s.time.weekday!==o.time.weekday)&&t()})},[e,n.onStarted,n.onEnded])}function Fn({position:e="top-left",excludeIds:n=[]}){const t=S.useEventsStore(a=>a.active),r=S.getEventRegistry(),s=t.filter(a=>!n.includes(a));if(s.length===0)return null;const o=e==="top-right"?{top:88,right:12}:{top:88,left:12};return i.jsx("div",{style:{position:"fixed",zIndex:90,display:"flex",flexDirection:"column",gap:4,pointerEvents:"none",userSelect:"none",...o},children:s.map(a=>{const c=r.get(a);if(!c)return null;const u=c.tags?.some(l=>l==="festival"||l==="tourney");return i.jsxs("div",{style:{padding:"4px 10px",background:"rgba(20,20,28,0.85)",color:"#fff",fontFamily:"'Pretendard', system-ui, sans-serif",fontSize:11,borderRadius:999,boxShadow:`inset 0 0 0 1px ${u?"#ffd84a55":"#7adf9055"}`,display:"inline-flex",alignItems:"center",gap:6},children:[i.jsx("span",{style:{width:8,height:8,borderRadius:"50%",background:u?"#ffd84a":"#7adf90"}}),i.jsx("span",{children:c.name})]},a)})})}const zn=[{id:"season.spring",name:"봄",summary:"꽃이 피고 벌레가 깨어납니다.",triggers:[{kind:"season",seasons:["spring"]}],tags:["season:spring","fish:bass","bug:butterfly"]},{id:"season.summer",name:"여름",summary:"낚시와 곤충채집의 계절.",triggers:[{kind:"season",seasons:["summer"]}],tags:["season:summer","fish:tuna","bug:beetle","bug:stag"]},{id:"season.autumn",name:"가을",summary:"단풍이 들고 낚시 보너스.",triggers:[{kind:"season",seasons:["autumn"]}],tags:["season:autumn","fish:koi","bug:butterfly"]},{id:"season.winter",name:"겨울",summary:"눈이 내리고 곤충은 사라집니다.",triggers:[{kind:"season",seasons:["winter"]}],tags:["season:winter","fish:bass"]},{id:"event.cherryblossom",name:"벚꽃 축제",summary:"봄 한정 — 벚꽃 잎이 흩날립니다.",triggers:[{kind:"monthRange",month:4,fromDay:1,toDay:10}],tags:["festival","visual:sakura"]},{id:"event.fishing-tourney",name:"낚시 대회",summary:"주말 한정 낚시 대회 — 보너스 종 출현.",triggers:[{kind:"weekday",weekdays:["sat","sun"]}],tags:["tourney","fish:koi","fish:tuna"]}];let Be=!1;function Un(){Be||(Be=!0,S.getEventRegistry().registerAll(zn))}const Bn="gaesup.inventory",Gn="inventory",Vn="inventory.store";function gt(){return S.useInventoryStore.getState().serialize()}function yt(e){S.useInventoryStore.getState().hydrate(e)}function ht(e={}){return O.createStoreDomainPlugin({id:e.id??Bn,name:"GaeSup Inventory",saveExtensionId:e.saveExtensionId??Gn,storeServiceId:e.storeServiceId??Vn,store:S.useInventoryStore,readyEvent:"inventory:ready",capabilities:["inventory"],serialize:gt,hydrate:yt})}const Wn=ht();function $n(){return S.useInventoryStore(e=>({slots:e.slots,add:e.add,remove:e.remove,removeById:e.removeById,move:e.move,countOf:e.countOf,has:e.has}))}function qn(){return S.useInventoryStore(e=>{const n=e.hotbar[e.equippedHotbar];return n==null?null:e.slots[n]??null})}function St(){const e=S.useInventoryStore(s=>s.hotbar),n=S.useInventoryStore(s=>s.slots),t=S.useInventoryStore(s=>s.equippedHotbar),r=S.useInventoryStore(s=>s.setEquippedHotbar);return{hotbar:e,slots:e.map(s=>n[s]??null),equipped:t,setEquipped:r}}function Hn(e=!0){const n=S.useInventoryStore(s=>s.setEquippedHotbar),t=S.useInventoryStore(s=>s.equippedHotbar),r=S.useInventoryStore(s=>s.hotbar);m.useEffect(()=>{if(!e)return;const s=o=>{const a=o.target?.tagName?.toLowerCase();if(a==="input"||a==="textarea")return;const c=Number(o.key);if(Number.isInteger(c)&&c>=1&&c<=r.length){n(c-1);return}(o.key==="q"||o.key==="Q")&&n(t-1),(o.key==="e"||o.key==="E")&&n(t+1)};return window.addEventListener("keydown",s),()=>window.removeEventListener("keydown",s)},[e,n,t,r.length])}function Xn(){const{slots:e,equipped:n,setEquipped:t}=St(),r=S.getItemRegistry();return i.jsx("div",{style:{position:"fixed",bottom:16,left:"50%",transform:"translateX(-50%)",zIndex:95,display:"flex",gap:6,padding:8,background:"rgba(18,20,28,0.55)",border:"1px solid rgba(255,255,255,0.12)",borderRadius:14,boxShadow:"0 8px 28px rgba(0,0,0,0.32), inset 0 1px 0 rgba(255,255,255,0.05)",backdropFilter:"blur(20px) saturate(140%)",WebkitBackdropFilter:"blur(20px) saturate(140%)"},children:e.map((s,o)=>{const a=s?r.get(s.itemId):void 0,c=o===n;return i.jsxs("button",{onClick:()=>t(o),title:a?.name??"",style:{width:54,height:54,borderRadius:10,border:c?"1.5px solid #ffd84a":"1px solid rgba(255,255,255,0.14)",background:c?"rgba(255,216,74,0.10)":"rgba(255,255,255,0.04)",color:"#f3f4f8",position:"relative",cursor:"pointer",padding:0,fontFamily:"'Pretendard', system-ui, sans-serif",fontSize:11,boxShadow:c?"0 0 16px rgba(255,216,74,0.45)":"none",transition:"background 0.18s ease, border-color 0.18s ease"},children:[i.jsx("div",{style:{position:"absolute",top:4,left:4,width:14,height:14,borderRadius:3,background:"rgba(0,0,0,0.5)",display:"flex",alignItems:"center",justifyContent:"center",fontSize:10,opacity:.85},children:o+1}),s&&a?i.jsxs(i.Fragment,{children:[i.jsx("div",{style:{position:"absolute",inset:14,borderRadius:6,background:a.color??"#888",boxShadow:"inset 0 0 8px rgba(0,0,0,0.4)"}}),a.stackable&&s.count>1&&i.jsx("div",{style:{position:"absolute",bottom:2,right:4,fontSize:11,fontWeight:700,textShadow:"0 0 3px black"},children:s.count})]}):null]},o)})})}function Yn({toggleKey:e="i",initiallyOpen:n=!1}){const[t,r]=m.useState(n),s=S.useInventoryStore(l=>l.slots),o=S.useInventoryStore(l=>l.move),a=S.getItemRegistry(),[c,u]=m.useState(null);return m.useEffect(()=>{const l=f=>{const d=f.target?.tagName?.toLowerCase();d==="input"||d==="textarea"||f.key.toLowerCase()===e.toLowerCase()&&r(p=>!p)};return window.addEventListener("keydown",l),()=>window.removeEventListener("keydown",l)},[e]),t?i.jsx("div",{style:{position:"fixed",inset:0,zIndex:100,display:"flex",alignItems:"center",justifyContent:"center",background:"rgba(0,0,0,0.4)",backdropFilter:"blur(4px)"},onClick:()=>r(!1),children:i.jsxs("div",{onClick:l=>l.stopPropagation(),style:{background:"rgba(20,20,20,0.95)",borderRadius:12,padding:16,minWidth:460,color:"#fff",fontFamily:"'Pretendard', system-ui, sans-serif",boxShadow:"0 12px 32px rgba(0,0,0,0.6)"},children:[i.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",marginBottom:12},children:[i.jsx("div",{style:{fontSize:14,opacity:.9},children:"Inventory"}),i.jsx("button",{onClick:()=>r(!1),style:{background:"transparent",border:"none",color:"#fff",cursor:"pointer",fontSize:14},children:"×"})]}),i.jsx("div",{style:{display:"grid",gridTemplateColumns:"repeat(5, 64px)",gap:6},children:s.map((l,f)=>{const d=l?a.get(l.itemId):void 0;return i.jsx("div",{draggable:!!l,onDragStart:()=>u(f),onDragOver:p=>{p.preventDefault()},onDrop:()=>{c!==null&&c!==f&&o(c,f),u(null)},title:d?.name??"",style:{width:64,height:64,borderRadius:6,border:"1px solid rgba(255,255,255,0.15)",background:"rgba(0,0,0,0.5)",position:"relative",cursor:l?"grab":"default",fontSize:11},children:l&&d?i.jsxs(i.Fragment,{children:[i.jsx("div",{style:{position:"absolute",inset:8,borderRadius:6,background:d.color??"#888",boxShadow:"inset 0 0 8px rgba(0,0,0,0.4)"}}),d.stackable&&l.count>1&&i.jsx("div",{style:{position:"absolute",bottom:2,right:4,fontSize:11,fontWeight:700,textShadow:"0 0 3px black"},children:l.count})]}):null},f)})}),i.jsx("div",{style:{marginTop:12,opacity:.6,fontSize:11},children:`[${e.toUpperCase()}] 닫기 / 드래그로 이동`})]})}):null}const Kn="gaesup.quests",Qn="quests",Zn="quests.store";function bt(){return k.useQuestStore.getState().serialize()}function xt(e){k.useQuestStore.getState().hydrate(e)}function vt(e={}){return O.createStoreDomainPlugin({id:e.id??Kn,name:"GaeSup Quests",saveExtensionId:e.saveExtensionId??Qn,storeServiceId:e.storeServiceId??Zn,store:k.useQuestStore,readyEvent:"quests:ready",capabilities:["quests"],serialize:bt,hydrate:xt})}const Jn=vt();function er({toggleKey:e="j"}){const[n,t]=m.useState(!1),r=k.useQuestStore(l=>l.state),s=k.useQuestStore(l=>l.complete),o=k.useQuestStore(l=>l.isObjectiveComplete),a=k.useQuestStore(l=>l.isAllObjectivesComplete);if(m.useEffect(()=>{const l=f=>{const d=f.target?.tagName?.toLowerCase();d==="input"||d==="textarea"||(f.key.toLowerCase()===e.toLowerCase()&&t(p=>!p),f.key==="Escape"&&t(!1))};return window.addEventListener("keydown",l),()=>window.removeEventListener("keydown",l)},[e]),!n)return null;const c=Object.values(r).filter(l=>l.status==="active"),u=Object.values(r).filter(l=>l.status==="completed");return i.jsx("div",{style:{position:"fixed",inset:0,zIndex:130,background:"rgba(0,0,0,0.55)",display:"flex",alignItems:"center",justifyContent:"center"},onClick:()=>t(!1),children:i.jsxs("div",{onClick:l=>l.stopPropagation(),style:{width:560,maxHeight:"76vh",overflow:"hidden",display:"flex",flexDirection:"column",background:"#1a1a1a",color:"#fff",borderRadius:12,boxShadow:"0 16px 36px rgba(0,0,0,0.5), inset 0 0 0 1px rgba(122,166,255,0.35)",fontFamily:"'Pretendard', system-ui, sans-serif",fontSize:13},children:[i.jsxs("div",{style:{padding:"10px 14px",borderBottom:"1px solid #333",display:"flex",justifyContent:"space-between"},children:[i.jsx("strong",{style:{fontSize:15},children:"Quest Log"}),i.jsxs("button",{onClick:()=>t(!1),style:It(),children:["Close [",e.toUpperCase(),"]"]})]}),i.jsxs("div",{style:{overflowY:"auto",padding:10},children:[i.jsx(Ge,{title:`Active (${c.length})`,children:c.length===0?i.jsx(tr,{children:"No active quests."}):c.map(l=>i.jsx(Ve,{progress:l,renderObjective:f=>o(k.getQuestRegistry().require(l.questId),l,f),...a(l.questId)?{onComplete:()=>{s(l.questId)}}:{}},l.questId))}),u.length>0&&i.jsx(Ge,{title:`Completed (${u.length})`,children:u.map(l=>i.jsx(Ve,{progress:l,renderObjective:()=>!0,muted:!0},l.questId))})]})]})})}function Ge({title:e,children:n}){return i.jsxs("div",{style:{marginBottom:10},children:[i.jsx("div",{style:{padding:"6px 6px 4px",color:"#7aa6ff",fontSize:12},children:e}),n]})}function tr({children:e}){return i.jsx("div",{style:{padding:"8px 10px",opacity:.6},children:e})}function Ve({progress:e,renderObjective:n,onComplete:t,muted:r}){const s=k.getQuestRegistry().get(e.questId);return s?i.jsxs("div",{style:{padding:10,marginBottom:6,background:"#222",borderRadius:8,opacity:r?.6:1},children:[i.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",marginBottom:4},children:[i.jsx("strong",{children:s.name}),t&&i.jsx("button",{onClick:t,style:It(!0),children:"Report Complete"})]}),i.jsx("div",{style:{opacity:.75,marginBottom:6},children:s.summary}),i.jsx("ul",{style:{margin:0,padding:"0 0 0 16px"},children:s.objectives.map(o=>{const a=n(o),c=e.progress[o.id]??0,u=o.type==="collect"||o.type==="deliver"?o.count:1,l=o.type==="collect"?Math.min(S.useInventoryStore.getState().countOf(o.itemId),u):c,f=o.type==="collect"||o.type==="deliver"?S.getItemRegistry().get(o.itemId)?.name??o.itemId:"";return i.jsxs("li",{style:{color:a?"#7adf90":"#ddd",listStyle:"square"},children:[o.description??nr(o,f)," ",u>1?`(${l}/${u})`:""]},o.id)})}),i.jsxs("div",{style:{marginTop:6,fontSize:11,color:"#ffd84a"},children:["Rewards: ",s.rewards.map(o=>rr(o)).join(", ")]})]}):null}function nr(e,n){switch(e.type){case"collect":return`Collect ${n??e.itemId}`;case"deliver":return`Deliver ${n??e.itemId} to ${e.npcId}`;case"talk":return`Talk to ${e.npcId}`;case"visit":return`Visit ${e.tag}`;case"flag":return"Meet the required condition";default:return""}}function rr(e){switch(e.type){case"item":return`${e.itemId} x${e.count??1}`;case"bells":return`${e.amount} B`;case"friendship":return`Friendship +${e.amount}`;default:return""}}function It(e){return{padding:"4px 10px",background:e?"#7aa6ff":"#444",color:e?"#0d1424":"#fff",border:"none",borderRadius:6,cursor:"pointer",fontFamily:"'Pretendard', system-ui, sans-serif",fontSize:12,fontWeight:e?700:400}}function sr(e=!0){m.useEffect(()=>e?S.useInventoryStore.subscribe((t,r)=>{if(t.slots===r.slots)return;const s=k.useQuestStore.getState().active();for(const o of s)k.useQuestStore.getState().recheck(o.questId)}):void 0,[e])}const or=5,ir=.5,ar=20,cr=200,lr=e=>{const{activeState:n}=P.useStateSystem(),t=P.useBuildingStore(g=>g.tileGroups),r=m.useRef(new Map),s=m.useRef(ee.MinimapSystem.getInstance()),{scale:o=or,blockRotate:a=!1,updateInterval:c=33}=e,u=m.useRef(null),[l,f]=m.useState(o),d=!!(n.position&&e);m.useEffect(()=>{const g=u.current;return g&&s.current.setCanvas(g),()=>{s.current.setCanvas(null)}},[]);const p=m.useCallback(()=>{e.blockScale||f(g=>Math.min(ar,g+.1))},[e.blockScale]),y=m.useCallback(()=>{e.blockScale||f(g=>Math.max(ir,g-.1))},[e.blockScale]),h=m.useCallback(g=>{e.blockScale||(g.preventDefault(),g.deltaY<0?p():y())},[e.blockScale,p,y]),E=m.useCallback(()=>{const g=u.current;if(!g)return;const v=C=>{e.blockScale||(C.preventDefault(),C.deltaY<0?p():y())};return g.addEventListener("wheel",v,{passive:!1}),()=>{g.removeEventListener("wheel",v)}},[e.blockScale,p,y]),w=m.useCallback(()=>{const{position:g,euler:v}=n;!g||!v||s.current.render({size:cr,scale:l,position:g,rotation:v.y,blockRotate:a,tileGroups:t,sceneObjects:r.current})},[n,l,a,t]);return m.useEffect(()=>{if(!d)return;const g=setInterval(()=>{const{position:v,euler:C}=n;v&&C&&(s.current.checkForUpdates(v,C.y),w())},c);return()=>{clearInterval(g)}},[w,c,d,n]),m.useEffect(()=>{w()},[l,w]),{canvasRef:u,scale:l,upscale:p,downscale:y,handleWheel:h,setupWheelListener:E,updateCanvas:w,isReady:d}},We=200;function ur({scale:e=5,minScale:n=.5,maxScale:t=20,blockScale:r=!1,blockScaleControl:s=!1,blockRotate:o=!1,angle:a=0,minimapStyle:c,scaleStyle:u,plusMinusStyle:l,position:f="top-right",showZoom:d=!0,showCompass:p=!0,markers:y=[]}){const{canvasRef:h,scale:E,upscale:w,downscale:g,handleWheel:v}=lr({blockScale:r,blockRotate:o}),C=f?`minimap--${f}`:"";return i.jsxs("div",{className:`minimap ${C}`,style:c,children:[i.jsx("canvas",{ref:h,className:"minimap__canvas",width:We,height:We,onWheel:v}),p&&i.jsx("div",{className:"minimap__compass",children:i.jsx("div",{style:{transform:`rotate(${a}deg)`},children:"N"})}),y.map((R,D)=>i.jsx("div",{className:`minimap__marker minimap__marker--${R.type||"normal"}`,style:{left:`${R.x}%`,top:`${R.y}%`},children:R.label&&i.jsx("div",{className:"minimap__marker-label",children:R.label})},R.id||D)),d&&!s&&i.jsx("div",{className:"minimap__controls",style:u,children:i.jsxs("div",{className:"minimap__zoom-controls",children:[i.jsx("button",{className:"minimap__control-button",onClick:w,disabled:E>=t,style:l,children:"+"}),i.jsx("button",{className:"minimap__control-button",onClick:g,disabled:E<=n,style:l,children:"-"})]})})]})}function dr({id:e,position:n,size:t=[2,2,2],text:r="",type:s="normal",children:o}){return m.useEffect(()=>{const a=ee.MinimapSystem.getInstance(),c=Array.isArray(n)?n:[n.x,n.y,n.z],u=Array.isArray(t)?t:[t.x,t.y,t.z];return a.addMarker(e,s,r||"",new I.Vector3(c[0],c[1],c[2]),new I.Vector3(u[0],u[1],u[2])),()=>{a.removeMarker(e)}},[e,n,t,s,r]),i.jsx(i.Fragment,{children:o})}function fr({id:e,position:n,size:t,label:r,children:s}){return i.jsx(dr,{id:e,position:n,size:t,text:r,type:"ground",children:s})}const pr={info:{bg:"rgba(20,30,50,0.55)",ring:"#7aa6ff",icon:"i"},success:{bg:"rgba(20,40,30,0.55)",ring:"#7adf90",icon:"+"},warn:{bg:"rgba(50,40,20,0.55)",ring:"#ffd84a",icon:"!"},error:{bg:"rgba(50,20,20,0.55)",ring:"#ff7a7a",icon:"x"},reward:{bg:"rgba(40,30,10,0.55)",ring:"#ffc24a",icon:"*"},mail:{bg:"rgba(30,20,40,0.55)",ring:"#cf9aff",icon:"M"}};function mr({position:e="top-right",max:n=5}){const t=S.useToastStore(a=>a.toasts),r=S.useToastStore(a=>a.dismiss);m.useEffect(()=>{if(!t.length)return;const a=t.map(c=>window.setTimeout(()=>r(c.id),Math.max(500,c.durationMs)));return()=>{a.forEach(c=>window.clearTimeout(c))}},[t,r]);const s=e==="top-center"?{top:64,left:"50%",transform:"translateX(-50%)"}:{top:64,right:12},o=t.slice(-n);return i.jsxs("div",{style:{position:"fixed",zIndex:110,display:"flex",flexDirection:"column",gap:8,pointerEvents:"none",...s},children:[o.map(a=>{const c=pr[a.kind];return i.jsxs("div",{style:{minWidth:220,maxWidth:360,padding:"9px 14px",borderRadius:12,background:c.bg,color:"#f3f4f8",fontFamily:"'Pretendard', system-ui, sans-serif",fontSize:13,fontWeight:500,display:"flex",alignItems:"center",gap:10,border:`1px solid ${c.ring}55`,boxShadow:"0 8px 22px rgba(0,0,0,0.32), inset 0 1px 0 rgba(255,255,255,0.05)",backdropFilter:"blur(18px) saturate(140%)",WebkitBackdropFilter:"blur(18px) saturate(140%)",animation:"gaesup-toast-in 220ms ease-out both"},children:[i.jsx("span",{style:{display:"inline-flex",alignItems:"center",justifyContent:"center",width:22,height:22,borderRadius:6,background:c.ring,color:"#1a1a1a",fontWeight:700},children:a.icon??c.icon}),i.jsx("span",{children:a.text})]},a.id)}),i.jsx("style",{children:`@keyframes gaesup-toast-in {
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require("reflect-metadata");const je=require("./index-BqQVctx5.cjs"),P=require("./index-CHq2GX18.cjs"),L=require("./index-BaJuQ3eD.cjs"),X=require("./runtimeFilter-W6iMw1pL.cjs"),b=require("./plugin-DSEonzhm.cjs"),le=require("./index-DDcqrZur.cjs"),ue=require("./index-H2VCOZxB.cjs"),kn=require("three"),A=require("./gaesupStore-CRQ-tcIz.cjs"),i=require("react/jsx-runtime"),m=require("react"),Y=require("@react-three/fiber"),ct=require("./index-BhSman4a.cjs"),ee=require("./index-qg4wXy51.cjs"),j=require("./timeStore-CDN035t4.cjs"),S=require("./eventsStore-Cipkf938.cjs"),O=require("./plugins.cjs"),q=require("zustand"),se=require("./authority-BOPCXUrV.cjs"),k=require("./loader-D7cEHkCq.cjs"),B=require("./weatherStore-1unmwIen.cjs"),ye=require("./assetStore-DVPge_2j.cjs"),lt=require("./index-DCa_lUwq.cjs"),Tn=require("./api-B58jaq5T.cjs"),ut=require("./serverHost-C_bhbyiP.cjs");function Rn(e){const n=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const t in e)if(t!=="default"){const r=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(n,t,r.get?r:{enumerable:!0,get:()=>e[t]})}}return n.default=e,Object.freeze(n)}const I=Rn(kn),Pn=()=>({position:new I.Vector3(0,0,0),velocity:new I.Vector3(0,0,0),rotation:new I.Euler(0,0,0),isMoving:!1,isGrounded:!1,speed:0,height:2});function te(e={}){const{updateInterval:n=0,entityId:t}=e,r=m.useRef(null);r.current||(r.current=Pn());const[,s]=m.useState(0),o=m.useRef(0),a=m.useRef(0),c=m.useRef({x:0,y:0,z:0}),u=m.useRef(void 0),l=m.useRef(null),{activeState:f,gameStates:d}=P.useStateSystem(),p=y=>{if(t)return t;if(u.current)return u.current;const h=y.getActiveEntities();return u.current=h[0],u.current};return m.useEffect(()=>{u.current=void 0,l.current=A.BridgeFactory.getOrCreate("motion");const y=l.current;if(!y)return;const h=y.subscribe((E,w)=>{const g=p(y);if(!g||w!==g)return;const v=performance.now();if(a.current=v,n>0&&v-o.current<n)return;o.current=v;const C=r.current;C.position.copy(E.position),C.velocity.copy(E.velocity),C.rotation.copy(E.rotation),C.isMoving=E.isMoving,C.isGrounded=E.isGrounded,C.speed=E.speed,C.height=2,s(R=>R+1)});return()=>{h()}},[t,n]),Y.useFrame(()=>{const y=performance.now();if(n>0&&y-o.current<n)return;const h=r.current,E=l.current,w=g=>{const v=c.current,C=g.x-v.x,R=g.y-v.y,D=g.z-v.z;return C*C+R*R+D*D>1e-6?(v.x=g.x,v.y=g.y,v.z=g.z,!0):!1};if(E){const g=p(E);if(!(y-a.current<16)&&g){const C=E.snapshot(g);if(C){h.position.copy(C.position),h.velocity.copy(C.velocity),h.rotation.copy(C.rotation),h.isMoving=C.isMoving,h.isGrounded=C.isGrounded,h.speed=C.speed,h.height=2,o.current=y,w(h.position)&&s(R=>R+1);return}}}f?.position&&(h.position.copy(f.position),f.velocity?h.velocity.copy(f.velocity):h.velocity.set(0,0,0),f.euler?h.rotation.copy(f.euler):h.rotation.set(0,0,0),h.isMoving=d?.isMoving||!1,h.isGrounded=d?.isOnTheGround||!1,h.speed=f.velocity?f.velocity.length():0,h.height=2,o.current=y,w(h.position)&&s(g=>g+1))}),r.current}const Z=q.create((e,n)=>({entries:new Map,current:null,register:t=>{const r=new Map(n().entries);r.set(t.id,t),e({entries:r})},unregister:t=>{const r=n().entries;if(!r.has(t))return;const s=new Map(r);s.delete(t),e({entries:s})},updatePosition:(t,r)=>{const s=n().entries.get(t);s&&s.position.copy(r)},getAll:()=>Array.from(n().entries.values()),setCurrent:t=>{const r=n().current;r!==t&&(r&&t&&r.id===t.id&&Math.abs(r.distance-t.distance)<.05||e({current:t}))},activateCurrent:()=>{const t=n().current;if(!t)return;const r=n().entries.get(t.id);r&&r.onActivate()}})),Ue=new I.Vector3;function Oe(){return Z(e=>e.current)}function dt(e=!0){const n=Oe(),t=Z(o=>o.activateCurrent),r=P.useInputBackend(),s=m.useRef(!1);m.useEffect(()=>{if(s.current=!1,!e||!n)return;const o=u=>{u&&!s.current&&t(),s.current=u},a=_n(n.key);if(a&&r.subscribe)return o(!!r.getKeyboard()[a]),r.subscribe(({keyboard:u})=>{o(!!u[a])});const c=u=>{const l=u.target?.tagName?.toLowerCase();l==="input"||l==="textarea"||u.key.toLowerCase()===n.key.toLowerCase()&&t()};return window.addEventListener("keydown",c),()=>window.removeEventListener("keydown",c)},[n,e,t,r])}function _n(e){switch(e.toLowerCase()){case"w":return"forward";case"a":return"leftward";case"s":return"backward";case"d":return"rightward";case"shift":return"shift";case" ":case"space":return"space";case"z":return"keyZ";case"r":return"keyR";case"f":return"keyF";case"e":return"keyE";case"escape":return"escape";default:return null}}function jn({throttleMs:e=80}={}){const{position:n}=te({updateInterval:16}),t=Z(o=>o.entries),r=Z(o=>o.setCurrent),s=m.useRef(0);return Y.useFrame((o,a)=>{if(s.current+=a*1e3,s.current<e)return;s.current=0;let c=null,u=1/0,l="",f="e";for(const d of t.values()){Ue.copy(d.position).sub(n);const p=Ue.lengthSq(),y=d.range*d.range;p>y||p<u&&(u=p,c=d.id,l=d.label,f=d.key)}if(!c){r(null);return}r({id:c,label:l,key:f,distance:Math.sqrt(u)})}),null}function Dn({advanceKey:e="e",closeKey:n="Escape"}){const t=k.useDialogStore(u=>u.node),r=k.useDialogStore(u=>u.runner),s=k.useDialogStore(u=>u.advance),o=k.useDialogStore(u=>u.choose),a=k.useDialogStore(u=>u.close),c=r?.visibleChoices()??[];return m.useEffect(()=>{if(!t)return;const u=l=>{if(l.key===n){a();return}if(c.length===0&&l.key.toLowerCase()===e.toLowerCase()){s();return}const f=parseInt(l.key,10);!Number.isNaN(f)&&f>=1&&f<=c.length&&o(f-1)};return window.addEventListener("keydown",u),()=>window.removeEventListener("keydown",u)},[t,c.length,s,o,a,e,n]),t?i.jsxs("div",{style:{position:"fixed",left:"50%",bottom:110,transform:"translateX(-50%)",width:"min(720px, 92vw)",zIndex:120,background:"rgba(18,20,28,0.62)",color:"#f3f4f8",borderRadius:14,border:"1px solid rgba(255,255,255,0.12)",boxShadow:"0 12px 28px rgba(0,0,0,0.5), inset 0 1px 0 rgba(255,255,255,0.06)",backdropFilter:"blur(20px) saturate(140%)",WebkitBackdropFilter:"blur(20px) saturate(140%)",fontFamily:"'Pretendard', system-ui, sans-serif",fontSize:14,padding:14},children:[t.speaker&&i.jsx("div",{style:{display:"inline-block",padding:"3px 8px",background:"#ffd84a",color:"#1a1a1a",borderRadius:6,fontWeight:700,fontSize:12,marginBottom:6},children:t.speaker}),i.jsx("div",{style:{lineHeight:1.55,whiteSpace:"pre-wrap"},children:t.text}),c.length===0?i.jsxs("div",{style:{marginTop:10,fontSize:12,opacity:.65,textAlign:"right"},children:["[",e.toUpperCase(),"] 다음"]}):i.jsx("div",{style:{marginTop:10,display:"flex",flexDirection:"column",gap:6},children:c.map((u,l)=>i.jsxs("button",{onClick:()=>o(l),style:{textAlign:"left",padding:"9px 12px",background:"rgba(255,255,255,0.06)",color:"#f3f4f8",border:"1px solid rgba(255,255,255,0.12)",borderRadius:8,cursor:"pointer",fontFamily:"'Pretendard', system-ui, sans-serif",fontSize:13,fontWeight:500},children:[i.jsxs("span",{style:{display:"inline-block",width:18,color:"#ffd84a",marginRight:6},children:[l+1,"."]}),u.text]},l))})]}):null}const Mn="gaesup.events",An="events",Ln="events.store";function ft(){return S.useEventsStore.getState().serialize()}function pt(e){S.useEventsStore.getState().hydrate(e)}function mt(e={}){return O.createStoreDomainPlugin({id:e.id??Mn,name:"GaeSup Events",saveExtensionId:e.saveExtensionId??An,storeServiceId:e.storeServiceId??Ln,store:S.useEventsStore,readyEvent:"events:ready",capabilities:["events"],serialize:ft,hydrate:pt})}const On=mt();function Nn(e=!0,n={}){m.useEffect(()=>{if(!e)return;const t=()=>{const s=j.useTimeStore.getState().time,{started:o,ended:a}=S.useEventsStore.getState().refresh(s);o.length&&n.onStarted&&n.onStarted(o),a.length&&n.onEnded&&n.onEnded(a)};return t(),j.useTimeStore.subscribe((s,o)=>{(s.time.day!==o.time.day||s.time.month!==o.time.month||s.time.season!==o.time.season||s.time.weekday!==o.time.weekday)&&t()})},[e,n.onStarted,n.onEnded])}function Fn({position:e="top-left",excludeIds:n=[]}){const t=S.useEventsStore(a=>a.active),r=S.getEventRegistry(),s=t.filter(a=>!n.includes(a));if(s.length===0)return null;const o=e==="top-right"?{top:88,right:12}:{top:88,left:12};return i.jsx("div",{style:{position:"fixed",zIndex:90,display:"flex",flexDirection:"column",gap:4,pointerEvents:"none",userSelect:"none",...o},children:s.map(a=>{const c=r.get(a);if(!c)return null;const u=c.tags?.some(l=>l==="festival"||l==="tourney");return i.jsxs("div",{style:{padding:"4px 10px",background:"rgba(20,20,28,0.85)",color:"#fff",fontFamily:"'Pretendard', system-ui, sans-serif",fontSize:11,borderRadius:999,boxShadow:`inset 0 0 0 1px ${u?"#ffd84a55":"#7adf9055"}`,display:"inline-flex",alignItems:"center",gap:6},children:[i.jsx("span",{style:{width:8,height:8,borderRadius:"50%",background:u?"#ffd84a":"#7adf90"}}),i.jsx("span",{children:c.name})]},a)})})}const zn=[{id:"season.spring",name:"봄",summary:"꽃이 피고 벌레가 깨어납니다.",triggers:[{kind:"season",seasons:["spring"]}],tags:["season:spring","fish:bass","bug:butterfly"]},{id:"season.summer",name:"여름",summary:"낚시와 곤충채집의 계절.",triggers:[{kind:"season",seasons:["summer"]}],tags:["season:summer","fish:tuna","bug:beetle","bug:stag"]},{id:"season.autumn",name:"가을",summary:"단풍이 들고 낚시 보너스.",triggers:[{kind:"season",seasons:["autumn"]}],tags:["season:autumn","fish:koi","bug:butterfly"]},{id:"season.winter",name:"겨울",summary:"눈이 내리고 곤충은 사라집니다.",triggers:[{kind:"season",seasons:["winter"]}],tags:["season:winter","fish:bass"]},{id:"event.cherryblossom",name:"벚꽃 축제",summary:"봄 한정 — 벚꽃 잎이 흩날립니다.",triggers:[{kind:"monthRange",month:4,fromDay:1,toDay:10}],tags:["festival","visual:sakura"]},{id:"event.fishing-tourney",name:"낚시 대회",summary:"주말 한정 낚시 대회 — 보너스 종 출현.",triggers:[{kind:"weekday",weekdays:["sat","sun"]}],tags:["tourney","fish:koi","fish:tuna"]}];let Be=!1;function Un(){Be||(Be=!0,S.getEventRegistry().registerAll(zn))}const Bn="gaesup.inventory",Gn="inventory",Vn="inventory.store";function gt(){return S.useInventoryStore.getState().serialize()}function yt(e){S.useInventoryStore.getState().hydrate(e)}function ht(e={}){return O.createStoreDomainPlugin({id:e.id??Bn,name:"GaeSup Inventory",saveExtensionId:e.saveExtensionId??Gn,storeServiceId:e.storeServiceId??Vn,store:S.useInventoryStore,readyEvent:"inventory:ready",capabilities:["inventory"],serialize:gt,hydrate:yt})}const Wn=ht();function $n(){return S.useInventoryStore(e=>({slots:e.slots,add:e.add,remove:e.remove,removeById:e.removeById,move:e.move,countOf:e.countOf,has:e.has}))}function qn(){return S.useInventoryStore(e=>{const n=e.hotbar[e.equippedHotbar];return n==null?null:e.slots[n]??null})}function St(){const e=S.useInventoryStore(s=>s.hotbar),n=S.useInventoryStore(s=>s.slots),t=S.useInventoryStore(s=>s.equippedHotbar),r=S.useInventoryStore(s=>s.setEquippedHotbar);return{hotbar:e,slots:e.map(s=>n[s]??null),equipped:t,setEquipped:r}}function Hn(e=!0){const n=S.useInventoryStore(s=>s.setEquippedHotbar),t=S.useInventoryStore(s=>s.equippedHotbar),r=S.useInventoryStore(s=>s.hotbar);m.useEffect(()=>{if(!e)return;const s=o=>{const a=o.target?.tagName?.toLowerCase();if(a==="input"||a==="textarea")return;const c=Number(o.key);if(Number.isInteger(c)&&c>=1&&c<=r.length){n(c-1);return}(o.key==="q"||o.key==="Q")&&n(t-1),(o.key==="e"||o.key==="E")&&n(t+1)};return window.addEventListener("keydown",s),()=>window.removeEventListener("keydown",s)},[e,n,t,r.length])}function Xn(){const{slots:e,equipped:n,setEquipped:t}=St(),r=S.getItemRegistry();return i.jsx("div",{style:{position:"fixed",bottom:16,left:"50%",transform:"translateX(-50%)",zIndex:95,display:"flex",gap:6,padding:8,background:"rgba(18,20,28,0.55)",border:"1px solid rgba(255,255,255,0.12)",borderRadius:14,boxShadow:"0 8px 28px rgba(0,0,0,0.32), inset 0 1px 0 rgba(255,255,255,0.05)",backdropFilter:"blur(20px) saturate(140%)",WebkitBackdropFilter:"blur(20px) saturate(140%)"},children:e.map((s,o)=>{const a=s?r.get(s.itemId):void 0,c=o===n;return i.jsxs("button",{onClick:()=>t(o),title:a?.name??"",style:{width:54,height:54,borderRadius:10,border:c?"1.5px solid #ffd84a":"1px solid rgba(255,255,255,0.14)",background:c?"rgba(255,216,74,0.10)":"rgba(255,255,255,0.04)",color:"#f3f4f8",position:"relative",cursor:"pointer",padding:0,fontFamily:"'Pretendard', system-ui, sans-serif",fontSize:11,boxShadow:c?"0 0 16px rgba(255,216,74,0.45)":"none",transition:"background 0.18s ease, border-color 0.18s ease"},children:[i.jsx("div",{style:{position:"absolute",top:4,left:4,width:14,height:14,borderRadius:3,background:"rgba(0,0,0,0.5)",display:"flex",alignItems:"center",justifyContent:"center",fontSize:10,opacity:.85},children:o+1}),s&&a?i.jsxs(i.Fragment,{children:[i.jsx("div",{style:{position:"absolute",inset:14,borderRadius:6,background:a.color??"#888",boxShadow:"inset 0 0 8px rgba(0,0,0,0.4)"}}),a.stackable&&s.count>1&&i.jsx("div",{style:{position:"absolute",bottom:2,right:4,fontSize:11,fontWeight:700,textShadow:"0 0 3px black"},children:s.count})]}):null]},o)})})}function Yn({toggleKey:e="i",initiallyOpen:n=!1}){const[t,r]=m.useState(n),s=S.useInventoryStore(l=>l.slots),o=S.useInventoryStore(l=>l.move),a=S.getItemRegistry(),[c,u]=m.useState(null);return m.useEffect(()=>{const l=f=>{const d=f.target?.tagName?.toLowerCase();d==="input"||d==="textarea"||f.key.toLowerCase()===e.toLowerCase()&&r(p=>!p)};return window.addEventListener("keydown",l),()=>window.removeEventListener("keydown",l)},[e]),t?i.jsx("div",{style:{position:"fixed",inset:0,zIndex:100,display:"flex",alignItems:"center",justifyContent:"center",background:"rgba(0,0,0,0.4)",backdropFilter:"blur(4px)"},onClick:()=>r(!1),children:i.jsxs("div",{onClick:l=>l.stopPropagation(),style:{background:"rgba(20,20,20,0.95)",borderRadius:12,padding:16,minWidth:460,color:"#fff",fontFamily:"'Pretendard', system-ui, sans-serif",boxShadow:"0 12px 32px rgba(0,0,0,0.6)"},children:[i.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",marginBottom:12},children:[i.jsx("div",{style:{fontSize:14,opacity:.9},children:"Inventory"}),i.jsx("button",{onClick:()=>r(!1),style:{background:"transparent",border:"none",color:"#fff",cursor:"pointer",fontSize:14},children:"×"})]}),i.jsx("div",{style:{display:"grid",gridTemplateColumns:"repeat(5, 64px)",gap:6},children:s.map((l,f)=>{const d=l?a.get(l.itemId):void 0;return i.jsx("div",{draggable:!!l,onDragStart:()=>u(f),onDragOver:p=>{p.preventDefault()},onDrop:()=>{c!==null&&c!==f&&o(c,f),u(null)},title:d?.name??"",style:{width:64,height:64,borderRadius:6,border:"1px solid rgba(255,255,255,0.15)",background:"rgba(0,0,0,0.5)",position:"relative",cursor:l?"grab":"default",fontSize:11},children:l&&d?i.jsxs(i.Fragment,{children:[i.jsx("div",{style:{position:"absolute",inset:8,borderRadius:6,background:d.color??"#888",boxShadow:"inset 0 0 8px rgba(0,0,0,0.4)"}}),d.stackable&&l.count>1&&i.jsx("div",{style:{position:"absolute",bottom:2,right:4,fontSize:11,fontWeight:700,textShadow:"0 0 3px black"},children:l.count})]}):null},f)})}),i.jsx("div",{style:{marginTop:12,opacity:.6,fontSize:11},children:`[${e.toUpperCase()}] 닫기 / 드래그로 이동`})]})}):null}const Kn="gaesup.quests",Qn="quests",Zn="quests.store";function bt(){return k.useQuestStore.getState().serialize()}function xt(e){k.useQuestStore.getState().hydrate(e)}function vt(e={}){return O.createStoreDomainPlugin({id:e.id??Kn,name:"GaeSup Quests",saveExtensionId:e.saveExtensionId??Qn,storeServiceId:e.storeServiceId??Zn,store:k.useQuestStore,readyEvent:"quests:ready",capabilities:["quests"],serialize:bt,hydrate:xt})}const Jn=vt();function er({toggleKey:e="j"}){const[n,t]=m.useState(!1),r=k.useQuestStore(l=>l.state),s=k.useQuestStore(l=>l.complete),o=k.useQuestStore(l=>l.isObjectiveComplete),a=k.useQuestStore(l=>l.isAllObjectivesComplete);if(m.useEffect(()=>{const l=f=>{const d=f.target?.tagName?.toLowerCase();d==="input"||d==="textarea"||(f.key.toLowerCase()===e.toLowerCase()&&t(p=>!p),f.key==="Escape"&&t(!1))};return window.addEventListener("keydown",l),()=>window.removeEventListener("keydown",l)},[e]),!n)return null;const c=Object.values(r).filter(l=>l.status==="active"),u=Object.values(r).filter(l=>l.status==="completed");return i.jsx("div",{style:{position:"fixed",inset:0,zIndex:130,background:"rgba(0,0,0,0.55)",display:"flex",alignItems:"center",justifyContent:"center"},onClick:()=>t(!1),children:i.jsxs("div",{onClick:l=>l.stopPropagation(),style:{width:560,maxHeight:"76vh",overflow:"hidden",display:"flex",flexDirection:"column",background:"#1a1a1a",color:"#fff",borderRadius:12,boxShadow:"0 16px 36px rgba(0,0,0,0.5), inset 0 0 0 1px rgba(122,166,255,0.35)",fontFamily:"'Pretendard', system-ui, sans-serif",fontSize:13},children:[i.jsxs("div",{style:{padding:"10px 14px",borderBottom:"1px solid #333",display:"flex",justifyContent:"space-between"},children:[i.jsx("strong",{style:{fontSize:15},children:"Quest Log"}),i.jsxs("button",{onClick:()=>t(!1),style:It(),children:["Close [",e.toUpperCase(),"]"]})]}),i.jsxs("div",{style:{overflowY:"auto",padding:10},children:[i.jsx(Ge,{title:`Active (${c.length})`,children:c.length===0?i.jsx(tr,{children:"No active quests."}):c.map(l=>i.jsx(Ve,{progress:l,renderObjective:f=>o(k.getQuestRegistry().require(l.questId),l,f),...a(l.questId)?{onComplete:()=>{s(l.questId)}}:{}},l.questId))}),u.length>0&&i.jsx(Ge,{title:`Completed (${u.length})`,children:u.map(l=>i.jsx(Ve,{progress:l,renderObjective:()=>!0,muted:!0},l.questId))})]})]})})}function Ge({title:e,children:n}){return i.jsxs("div",{style:{marginBottom:10},children:[i.jsx("div",{style:{padding:"6px 6px 4px",color:"#7aa6ff",fontSize:12},children:e}),n]})}function tr({children:e}){return i.jsx("div",{style:{padding:"8px 10px",opacity:.6},children:e})}function Ve({progress:e,renderObjective:n,onComplete:t,muted:r}){const s=k.getQuestRegistry().get(e.questId);return s?i.jsxs("div",{style:{padding:10,marginBottom:6,background:"#222",borderRadius:8,opacity:r?.6:1},children:[i.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",marginBottom:4},children:[i.jsx("strong",{children:s.name}),t&&i.jsx("button",{onClick:t,style:It(!0),children:"Report Complete"})]}),i.jsx("div",{style:{opacity:.75,marginBottom:6},children:s.summary}),i.jsx("ul",{style:{margin:0,padding:"0 0 0 16px"},children:s.objectives.map(o=>{const a=n(o),c=e.progress[o.id]??0,u=o.type==="collect"||o.type==="deliver"?o.count:1,l=o.type==="collect"?Math.min(S.useInventoryStore.getState().countOf(o.itemId),u):c,f=o.type==="collect"||o.type==="deliver"?S.getItemRegistry().get(o.itemId)?.name??o.itemId:"";return i.jsxs("li",{style:{color:a?"#7adf90":"#ddd",listStyle:"square"},children:[o.description??nr(o,f)," ",u>1?`(${l}/${u})`:""]},o.id)})}),i.jsxs("div",{style:{marginTop:6,fontSize:11,color:"#ffd84a"},children:["Rewards: ",s.rewards.map(o=>rr(o)).join(", ")]})]}):null}function nr(e,n){switch(e.type){case"collect":return`Collect ${n??e.itemId}`;case"deliver":return`Deliver ${n??e.itemId} to ${e.npcId}`;case"talk":return`Talk to ${e.npcId}`;case"visit":return`Visit ${e.tag}`;case"flag":return"Meet the required condition";default:return""}}function rr(e){switch(e.type){case"item":return`${e.itemId} x${e.count??1}`;case"bells":return`${e.amount} B`;case"friendship":return`Friendship +${e.amount}`;default:return""}}function It(e){return{padding:"4px 10px",background:e?"#7aa6ff":"#444",color:e?"#0d1424":"#fff",border:"none",borderRadius:6,cursor:"pointer",fontFamily:"'Pretendard', system-ui, sans-serif",fontSize:12,fontWeight:e?700:400}}function sr(e=!0){m.useEffect(()=>e?S.useInventoryStore.subscribe((t,r)=>{if(t.slots===r.slots)return;const s=k.useQuestStore.getState().active();for(const o of s)k.useQuestStore.getState().recheck(o.questId)}):void 0,[e])}const or=5,ir=.5,ar=20,cr=200,lr=e=>{const{activeState:n}=P.useStateSystem(),t=P.useBuildingStore(g=>g.tileGroups),r=m.useRef(new Map),s=m.useRef(ee.MinimapSystem.getInstance()),{scale:o=or,blockRotate:a=!1,updateInterval:c=33}=e,u=m.useRef(null),[l,f]=m.useState(o),d=!!(n.position&&e);m.useEffect(()=>{const g=u.current;return g&&s.current.setCanvas(g),()=>{s.current.setCanvas(null)}},[]);const p=m.useCallback(()=>{e.blockScale||f(g=>Math.min(ar,g+.1))},[e.blockScale]),y=m.useCallback(()=>{e.blockScale||f(g=>Math.max(ir,g-.1))},[e.blockScale]),h=m.useCallback(g=>{e.blockScale||(g.preventDefault(),g.deltaY<0?p():y())},[e.blockScale,p,y]),E=m.useCallback(()=>{const g=u.current;if(!g)return;const v=C=>{e.blockScale||(C.preventDefault(),C.deltaY<0?p():y())};return g.addEventListener("wheel",v,{passive:!1}),()=>{g.removeEventListener("wheel",v)}},[e.blockScale,p,y]),w=m.useCallback(()=>{const{position:g,euler:v}=n;!g||!v||s.current.render({size:cr,scale:l,position:g,rotation:v.y,blockRotate:a,tileGroups:t,sceneObjects:r.current})},[n,l,a,t]);return m.useEffect(()=>{if(!d)return;const g=setInterval(()=>{const{position:v,euler:C}=n;v&&C&&(s.current.checkForUpdates(v,C.y),w())},c);return()=>{clearInterval(g)}},[w,c,d,n]),m.useEffect(()=>{w()},[l,w]),{canvasRef:u,scale:l,upscale:p,downscale:y,handleWheel:h,setupWheelListener:E,updateCanvas:w,isReady:d}},We=200;function ur({scale:e=5,minScale:n=.5,maxScale:t=20,blockScale:r=!1,blockScaleControl:s=!1,blockRotate:o=!1,angle:a=0,minimapStyle:c,scaleStyle:u,plusMinusStyle:l,position:f="top-right",showZoom:d=!0,showCompass:p=!0,markers:y=[]}){const{canvasRef:h,scale:E,upscale:w,downscale:g,handleWheel:v}=lr({blockScale:r,blockRotate:o}),C=f?`minimap--${f}`:"";return i.jsxs("div",{className:`minimap ${C}`,style:c,children:[i.jsx("canvas",{ref:h,className:"minimap__canvas",width:We,height:We,onWheel:v}),p&&i.jsx("div",{className:"minimap__compass",children:i.jsx("div",{style:{transform:`rotate(${a}deg)`},children:"N"})}),y.map((R,D)=>i.jsx("div",{className:`minimap__marker minimap__marker--${R.type||"normal"}`,style:{left:`${R.x}%`,top:`${R.y}%`},children:R.label&&i.jsx("div",{className:"minimap__marker-label",children:R.label})},R.id||D)),d&&!s&&i.jsx("div",{className:"minimap__controls",style:u,children:i.jsxs("div",{className:"minimap__zoom-controls",children:[i.jsx("button",{className:"minimap__control-button",onClick:w,disabled:E>=t,style:l,children:"+"}),i.jsx("button",{className:"minimap__control-button",onClick:g,disabled:E<=n,style:l,children:"-"})]})})]})}function dr({id:e,position:n,size:t=[2,2,2],text:r="",type:s="normal",children:o}){return m.useEffect(()=>{const a=ee.MinimapSystem.getInstance(),c=Array.isArray(n)?n:[n.x,n.y,n.z],u=Array.isArray(t)?t:[t.x,t.y,t.z];return a.addMarker(e,s,r||"",new I.Vector3(c[0],c[1],c[2]),new I.Vector3(u[0],u[1],u[2])),()=>{a.removeMarker(e)}},[e,n,t,s,r]),i.jsx(i.Fragment,{children:o})}function fr({id:e,position:n,size:t,label:r,children:s}){return i.jsx(dr,{id:e,position:n,size:t,text:r,type:"ground",children:s})}const pr={info:{bg:"rgba(20,30,50,0.55)",ring:"#7aa6ff",icon:"i"},success:{bg:"rgba(20,40,30,0.55)",ring:"#7adf90",icon:"+"},warn:{bg:"rgba(50,40,20,0.55)",ring:"#ffd84a",icon:"!"},error:{bg:"rgba(50,20,20,0.55)",ring:"#ff7a7a",icon:"x"},reward:{bg:"rgba(40,30,10,0.55)",ring:"#ffc24a",icon:"*"},mail:{bg:"rgba(30,20,40,0.55)",ring:"#cf9aff",icon:"M"}};function mr({position:e="top-right",max:n=5}){const t=S.useToastStore(a=>a.toasts),r=S.useToastStore(a=>a.dismiss);m.useEffect(()=>{if(!t.length)return;const a=t.map(c=>window.setTimeout(()=>r(c.id),Math.max(500,c.durationMs)));return()=>{a.forEach(c=>window.clearTimeout(c))}},[t,r]);const s=e==="top-center"?{top:64,left:"50%",transform:"translateX(-50%)"}:{top:64,right:12},o=t.slice(-n);return i.jsxs("div",{style:{position:"fixed",zIndex:110,display:"flex",flexDirection:"column",gap:8,pointerEvents:"none",...s},children:[o.map(a=>{const c=pr[a.kind];return i.jsxs("div",{style:{minWidth:220,maxWidth:360,padding:"9px 14px",borderRadius:12,background:c.bg,color:"#f3f4f8",fontFamily:"'Pretendard', system-ui, sans-serif",fontSize:13,fontWeight:500,display:"flex",alignItems:"center",gap:10,border:`1px solid ${c.ring}55`,boxShadow:"0 8px 22px rgba(0,0,0,0.32), inset 0 1px 0 rgba(255,255,255,0.05)",backdropFilter:"blur(18px) saturate(140%)",WebkitBackdropFilter:"blur(18px) saturate(140%)",animation:"gaesup-toast-in 220ms ease-out both"},children:[i.jsx("span",{style:{display:"inline-flex",alignItems:"center",justifyContent:"center",width:22,height:22,borderRadius:6,background:c.ring,color:"#1a1a1a",fontWeight:700},children:a.icon??c.icon}),i.jsx("span",{children:a.text})]},a.id)}),i.jsx("style",{children:`@keyframes gaesup-toast-in {
|
|
2
2
|
0% { opacity: 0; transform: translateY(-6px); }
|
|
3
3
|
100% { opacity: 1; transform: translateY(0); }
|
|
4
4
|
}`})]})}function Et(e){return`${e.phase==="serialize"?"저장":"불러오기"} 실패: ${e.key} - ${e.errorMessage}`}function gr({enabled:e=!0,includeExisting:n=!1,durationMs:t=6500,kind:r="error",icon:s,formatMessage:o=Et}){const a=P.useGaesupRuntime(),c=P.useGaesupRuntimeRevision();return m.useEffect(()=>{if(!e||!a)return;const u=new Set,l=d=>{if(u.has(d.id))return;u.add(d.id);const p=$e(r,d),y=s?$e(s,d):void 0;S.notify(p,o(d),{durationMs:t,...y?{icon:y}:{}})},f=a.saveDiagnostics.getDiagnostics();return n?f.forEach(l):f.forEach(d=>u.add(d.id)),a.saveDiagnostics.subscribe(l)},[t,e,o,s,n,r,c,a]),null}function $e(e,n){return typeof e=="function"?e(n):e}function yr(e,n,t){return n===t?!0:n<t?e>=n&&e<t:e>=n||e<t}function hr(e,n){return e.weekdays&&e.weekdays.length>0&&!e.weekdays.includes(n.weekday)||e.seasons&&e.seasons.length>0&&!e.seasons.includes(n.season)?!1:yr(n.hour,e.startHour,e.endHour)}function wt(e,n){for(const r of e.entries)if(hr(r,n))return{position:r.position,activity:r.activity??"idle",...r.rotationY!==void 0?{rotationY:r.rotationY}:{},...r.dialogTreeId?{dialogTreeId:r.dialogTreeId}:{},source:r};const t=e.defaultEntry;return{position:t?.position??[0,0,0],activity:t?.activity??"idle",...t?.rotationY!==void 0?{rotationY:t.rotationY}:{},...t?.dialogTreeId?{dialogTreeId:t.dialogTreeId}:{},source:null}}class Sr{map=new Map;register(n){this.map.set(n.npcId,n)}unregister(n){this.map.delete(n)}get(n){return this.map.get(n)}resolve(n,t){const r=this.map.get(n);return r?wt(r,t):null}all(){return Array.from(this.map.values())}clear(){this.map.clear()}}let Ee=null;function De(){return Ee||(Ee=new Sr),Ee}const br="gaesup.npc",xr="npc",vr="npc.store";function U(e){return typeof structuredClone=="function"?structuredClone(e):JSON.parse(JSON.stringify(e))}function Ct(){const e=b.useNPCStore.getState();return{version:1,templates:Array.from(e.templates.values(),U),instances:Array.from(e.instances.values(),U),categories:Array.from(e.categories.values(),U),clothingSets:Array.from(e.clothingSets.values(),U),clothingCategories:Array.from(e.clothingCategories.values(),U),animations:Array.from(e.animations.values(),U),brainBlueprints:Array.from(e.brainBlueprints.values(),U),editMode:e.editMode}}function kt(e){if(!e)return;const n=Array.isArray(e)?e:e.instances;b.useNPCStore.setState(t=>{Array.isArray(e)||(e.templates&&(t.templates=new Map(e.templates.map(r=>[r.id,U(r)]))),e.categories&&(t.categories=new Map(e.categories.map(r=>[r.id,U(r)]))),e.clothingSets&&(t.clothingSets=new Map(e.clothingSets.map(r=>[r.id,U(r)]))),e.clothingCategories&&(t.clothingCategories=new Map(e.clothingCategories.map(r=>[r.id,U(r)]))),e.animations&&(t.animations=new Map(e.animations.map(r=>[r.id,U(r)]))),e.brainBlueprints&&(t.brainBlueprints=new Map(e.brainBlueprints.map(r=>[r.id,U(r)]))),typeof e.editMode=="boolean"&&(t.editMode=e.editMode)),n&&(t.instances=new Map(n.map(r=>[r.id,U(r)])))})}function Tt(e={}){const n=e.id??br,t=e.saveExtensionId??xr,r=e.storeServiceId??vr;return{id:n,name:"GaeSup NPC",version:"0.1.0",runtime:"client",capabilities:["npc"],setup(s){s.save.register(t,{key:t,serialize:Ct,hydrate:kt},n),s.services.register(r,{useStore:b.useNPCStore,getState:b.useNPCStore.getState,setState:b.useNPCStore.setState},n),s.events.emit("npc:ready",{pluginId:n,saveExtensionId:t,storeServiceId:r})},dispose(s){s.save.remove(t),s.services.remove(r)}}}const Ir=Tt();function Er(e){const[n,t]=m.useState(()=>{const r=j.useTimeStore.getState();return De().resolve(e,r.time)});return m.useEffect(()=>{let r=-1;const s=()=>{const a=j.useTimeStore.getState();if(a.time.hour===r)return;r=a.time.hour;const c=De().resolve(e,a.time);t(c)};return s(),j.useTimeStore.subscribe((a,c)=>{(a.time.hour!==c.time.hour||a.time.day!==c.time.day||a.time.weekday!==c.time.weekday)&&s()})},[e]),n}const wr="gaesup.camera",Rt="camera.system",Pt="camera",_t="camera.store",Cr=new Set(["offset","target","position","focusTarget","fixedPosition"]);function Me(e){if(e instanceof I.Vector3)return{x:e.x,y:e.y,z:e.z};if(e instanceof I.Euler)return{x:e.x,y:e.y,z:e.z,order:e.order};if(Array.isArray(e))return e.map(Me);if(e&&typeof e=="object")return Object.fromEntries(Object.entries(e).map(([n,t])=>[n,Me(t)]));if(e==null||typeof e=="string"||typeof e=="number"||typeof e=="boolean")return e}function jt(e){if(!e||typeof e!="object")return!1;const n=e;return typeof n.x=="number"&&typeof n.y=="number"&&typeof n.z=="number"}function kr(e){return jt(e)?typeof e.order=="string":!1}function Tr(e){const n={};for(const[t,r]of Object.entries(e)){if(Cr.has(t)&&jt(r)){Object.assign(n,{[t]:new I.Vector3(r.x,r.y,r.z)});continue}if(t==="rotation"&&kr(r)){Object.assign(n,{rotation:new I.Euler(r.x,r.y,r.z,r.order)});continue}Object.assign(n,{[t]:r})}return n}function qe(){const e=A.useGaesupStore.getState();return{mode:{...e.mode},cameraOption:Me(e.cameraOption)}}function Rr(e){if(!e||typeof e!="object")return;const n=A.useGaesupStore.getState();e.mode&&typeof e.mode=="object"&&n.setMode(e.mode),e.cameraOption&&typeof e.cameraOption=="object"&&n.setCameraOption(Tr(e.cameraOption))}function Dt(e={}){const n=e.id??wr,t=e.systemExtensionId??Rt,r=e.saveExtensionId??Pt,s=e.storeServiceId??_t;return{id:n,name:"GaeSup Camera",version:"0.1.0",runtime:"client",capabilities:["camera"],setup(o){o.systems.register(t,{System:je.CameraSystem,create:a=>new je.CameraSystem(a)},n),o.save.register(r,{key:r,serialize:qe,hydrate:Rr},n),o.services.register(s,{useStore:A.useGaesupStore,getState:qe,setMode:a=>A.useGaesupStore.getState().setMode(a),setCameraOption:a=>A.useGaesupStore.getState().setCameraOption(a)},n),o.events.emit("camera:ready",{pluginId:n,systemExtensionId:t,saveExtensionId:r,storeServiceId:s})},dispose(o){o.systems.remove(t),o.save.remove(r),o.services.remove(s)}}}const Pr=Dt();function _r(){const{activeState:e,gameStates:n}=P.useStateSystem(),t=A.useGaesupStore(a=>a.mode),r=A.useGaesupStore(a=>a.controllerOptions),s=A.useGaesupStore.getState();return{state:e||null,mode:t,states:n,control:r,context:{mode:t,states:n,control:r},controller:s}}function Ne(){const{activeState:e,updateActiveState:n}=P.useStateSystem(),t=!!e;return{teleport:m.useCallback((s,o)=>{if(!e){console.warn("[useTeleport]: Cannot teleport - activeState not available");return}n({position:s.clone(),euler:o||e.euler})},[e,n]),canTeleport:t}}function jr({value:e,name:n,gamePadButtonStyle:t}){const[r,s]=m.useState(!1),{pushKey:o}=ue.useKeyboard(),a=()=>{o(e,!0),s(!0)},c=()=>{o(e,!1),s(!1)};return i.jsx("button",{className:`pad-button ${r?"is-clicked":""}`,onMouseDown:a,onMouseUp:c,onMouseLeave:c,onContextMenu:u=>{u.preventDefault(),c()},onPointerDown:a,onPointerUp:c,style:t,children:n})}function Dr(e){const{gamePadStyle:n,gamePadButtonStyle:t,label:r}=e,s=A.useGaesupStore(c=>c.interaction?.keyboard),{mode:o}=A.useGaesupStore();ue.useKeyboard();const a=Object.keys(s||{}).map(c=>{const u=r?.[c]||c;return c==="forward"||c==="backward"||c==="leftward"||c==="rightward"?{key:c,name:u,type:"direction",active:s?.[c]||!1}:{key:c,name:u,type:"action",active:s?.[c]||!1}}).filter(Boolean);return i.jsx("div",{className:"gamepad-container",style:{...n,display:o?.controller==="gamepad"?"flex":"none"},children:a.map(c=>i.jsx(jr,{value:c.key,name:c.name,gamePadButtonStyle:t},c.key))})}function Mr(){const{cameraOption:e,setCameraOption:n}=A.useGaesupStore.getState();e?.focus&&n({focus:!1})}const Mt=m.forwardRef(({children:e,position:n,focusDistance:t=10,focusDuration:r=1,onFocus:s,onBlur:o,...a},c)=>{const u=A.useGaesupStore(h=>h.setCameraOption),l=A.useGaesupStore(h=>h.cameraOption),f=h=>{if(h.stopPropagation(),!l?.enableFocus)return;if(l.focus){Mr(),o&&o(h);return}const E=h.object.getWorldPosition(new I.Vector3);u({focusTarget:E,focusDuration:r,focusDistance:t,focus:!0}),s&&s(h)},d=()=>{l?.enableFocus&&(document.body.style.cursor="pointer")},p=h=>{document.body.style.cursor="default",o&&!l?.focus&&o(h)},y={...a,...n?{position:n}:{}};return i.jsx("group",{ref:c,onClick:f,onPointerOver:d,onPointerOut:p,...y,children:e})});Mt.displayName="FocusableObject";function Ar({id:e,kind:n="misc",label:t,range:r=2.2,activationKey:s="e",data:o,onActivate:a,position:c,children:u}){const l=m.useId(),f=e??l,d=Z(w=>w.register),p=Z(w=>w.unregister),y=Z(w=>w.updatePosition),h=m.useRef(null),E=m.useMemo(()=>new I.Vector3(...c),[c]);return m.useEffect(()=>(d({id:f,kind:n,label:t,position:E.clone(),range:r,key:s,...o?{data:o}:{},onActivate:a}),()=>p(f)),[f,n,t,r,s,o,a,d,p,E]),m.useEffect(()=>{y(f,E)},[f,E,y]),i.jsx("group",{ref:h,position:c,children:u})}function Lr({enabled:e=!0}){const n=Oe();return dt(e),!e||!n?null:i.jsxs("div",{style:{position:"fixed",bottom:96,left:"50%",transform:"translateX(-50%)",zIndex:96,padding:"8px 14px",background:"rgba(18,20,28,0.55)",color:"#f3f4f8",fontFamily:"'Pretendard', system-ui, sans-serif",fontSize:13,fontWeight:500,borderRadius:999,border:"1px solid rgba(255,255,255,0.12)",display:"flex",alignItems:"center",gap:10,boxShadow:"0 8px 22px rgba(0,0,0,0.32)",backdropFilter:"blur(18px) saturate(140%)",WebkitBackdropFilter:"blur(18px) saturate(140%)",pointerEvents:"none",userSelect:"none"},children:[i.jsx("span",{style:{display:"inline-flex",alignItems:"center",justifyContent:"center",minWidth:22,height:22,padding:"0 6px",borderRadius:6,background:"#ffd84a",color:"#222",fontWeight:700},children:n.key.toUpperCase()}),i.jsx("span",{children:n.label}),i.jsxs("span",{style:{opacity:.5,fontSize:11},children:[n.distance.toFixed(1),"m"]})]})}function Or({showController:e=!0,showDebugPanel:n=!0,controllerProps:t={},debugPanelProps:r={}}){return i.jsxs(i.Fragment,{children:[e&&i.jsx(b.MotionController,{position:"bottom-left",showLabels:!0,compact:!1,...t}),n&&i.jsx(b.MotionDebugPanel,{position:"top-right",updateInterval:100,precision:2,compact:!1,...r})]})}function Nr({text:e,position:n,teleportStyle:t}){const{teleport:r,canTeleport:s}=Ne(),o=()=>{r(n)};return i.jsxs("div",{className:`teleport ${s?"":"teleport--disabled"}`,onClick:o,style:t,title:s?"Click to teleport":"Teleport not available",children:[e||"Teleport",!s&&i.jsx("span",{className:"teleport__cooldown",children:"⏱️"})]})}const Fr="gaesup.time",zr="time",Ur="time.store";function At(){return j.useTimeStore.getState().serialize()}function Lt(e){j.useTimeStore.getState().hydrate(e)}function Ot(e={}){const n=e.id??Fr,t=e.saveExtensionId??zr,r=e.storeServiceId??Ur;return{id:n,name:"GaeSup Time",version:"0.1.0",runtime:"client",capabilities:["time"],setup(s){s.save.register(t,{key:t,serialize:At,hydrate:Lt},n),s.services.register(r,{useStore:j.useTimeStore,getState:j.useTimeStore.getState,setState:j.useTimeStore.setState},n),s.events.emit("time:ready",{pluginId:n,saveExtensionId:t,storeServiceId:r})},dispose(s){s.save.remove(t),s.services.remove(r)}}}const Br=Ot();function Nt(){return j.useTimeStore(e=>e.time)}function Gr(){return j.useTimeStore(e=>({hour:e.time.hour,minute:e.time.minute}))}function Vr(e=!0){const n=j.useTimeStore(r=>r.tick),t=m.useRef(0);m.useEffect(()=>{if(!e)return;let r=0,s=!0;const o=a=>{if(!s)return;const c=t.current||a,u=a-c;t.current=a,n(u),r=requestAnimationFrame(o)};return r=requestAnimationFrame(o),()=>{s=!1,cancelAnimationFrame(r)}},[e,n])}function Wr(e){const n=j.useTimeStore(t=>t.addListener);m.useEffect(()=>n(t=>{t.kind==="newDay"&&e(t.time)}),[n,e])}function $r(e){const n=j.useTimeStore(t=>t.addListener);m.useEffect(()=>n(t=>{t.kind==="newHour"&&e(t.time)}),[n,e])}const qr={spring:"#ffb6c1",summer:"#9bd97a",autumn:"#e0a060",winter:"#cfe2ff"},Hr={sun:"일",mon:"월",tue:"화",wed:"수",thu:"목",fri:"금",sat:"토"};function Xr(){const e=Nt(),n=String(e.hour).padStart(2,"0"),t=String(e.minute).padStart(2,"0");return i.jsx("div",{style:{position:"fixed",top:10,left:10,zIndex:90,padding:"6px 10px",background:"rgba(0,0,0,0.55)",color:"#fff",fontFamily:"'Pretendard', system-ui, sans-serif",fontSize:13,borderRadius:6,userSelect:"none",pointerEvents:"none",backdropFilter:"blur(4px)"},children:i.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8},children:[i.jsx("span",{style:{display:"inline-block",width:8,height:8,borderRadius:"50%",background:qr[e.season]??"#fff"}}),i.jsxs("span",{children:["Y",e.year," M",String(e.month).padStart(2,"0")," D",String(e.day).padStart(2,"0")," ","(",Hr[e.weekday],")"]}),i.jsxs("span",{style:{opacity:.85},children:[n,":",t]})]})})}const Ft=[{id:"apple",name:"사과",icon:"apple",category:"food",stackable:!0,maxStack:99,buyPrice:100,sellPrice:50,color:"#e54b4b",rarity:"common",description:"아삭한 사과. 그냥 먹어도, 팔아도 좋다."},{id:"wood",name:"목재",icon:"wood",category:"material",stackable:!0,maxStack:99,sellPrice:30,color:"#a07a4a",rarity:"common",description:"나무를 베면 얻을 수 있는 기본 재료."},{id:"stone",name:"돌",icon:"stone",category:"material",stackable:!0,maxStack:99,sellPrice:25,color:"#7a7a7a",rarity:"common"},{id:"flower-pink",name:"분홍 꽃",icon:"flower",category:"material",stackable:!0,maxStack:99,sellPrice:40,color:"#ff8fb1"},{id:"axe",name:"도끼",icon:"axe",category:"tool",stackable:!1,maxStack:1,buyPrice:800,color:"#9b6b3a",toolKind:"axe",durability:60,description:"나무를 벨 수 있다."},{id:"shovel",name:"삽",icon:"shovel",category:"tool",stackable:!1,maxStack:1,buyPrice:600,color:"#777777",toolKind:"shovel",durability:80,description:"땅을 팔 수 있다."},{id:"water-can",name:"물뿌리개",icon:"water-can",category:"tool",stackable:!1,maxStack:1,buyPrice:500,color:"#4aa8ff",toolKind:"water",durability:100,description:"꽃에 물을 줄 수 있다."},{id:"net",name:"곤충채집망",icon:"net",category:"tool",stackable:!1,maxStack:1,buyPrice:700,color:"#d8d8d8",toolKind:"net",durability:50},{id:"rod",name:"낚싯대",icon:"rod",category:"tool",stackable:!1,maxStack:1,buyPrice:900,color:"#5a3a2a",toolKind:"rod",durability:50},{id:"shell",name:"조개",icon:"shell",category:"material",stackable:!0,maxStack:99,sellPrice:60,color:"#ffd9c2"},{id:"fish-bass",name:"배스",icon:"fish",category:"fish",stackable:!0,maxStack:99,sellPrice:200,color:"#5a8a8a",rarity:"common"},{id:"fish-tuna",name:"참다랑어",icon:"fish",category:"fish",stackable:!0,maxStack:99,sellPrice:700,color:"#3a5a8a",rarity:"rare"},{id:"fish-koi",name:"비단잉어",icon:"fish",category:"fish",stackable:!0,maxStack:99,sellPrice:1200,color:"#ff8a4a",rarity:"epic"},{id:"bug-butterfly",name:"나비",icon:"bug",category:"bug",stackable:!0,maxStack:99,sellPrice:160,color:"#ffd0e0",rarity:"common"},{id:"bug-beetle",name:"풍뎅이",icon:"bug",category:"bug",stackable:!0,maxStack:99,sellPrice:400,color:"#3a3a8a",rarity:"uncommon"},{id:"bug-stag",name:"사슴벌레",icon:"bug",category:"bug",stackable:!0,maxStack:99,sellPrice:900,color:"#5a2a1a",rarity:"rare"},{id:"seed-turnip",name:"순무 씨앗",icon:"seed",category:"material",stackable:!0,maxStack:99,buyPrice:80,sellPrice:20,color:"#cfeeb6",toolKind:"seed"},{id:"seed-tomato",name:"토마토 씨앗",icon:"seed",category:"material",stackable:!0,maxStack:99,buyPrice:120,sellPrice:30,color:"#9adf90",toolKind:"seed"},{id:"turnip",name:"순무",icon:"turnip",category:"food",stackable:!0,maxStack:99,sellPrice:220,color:"#ffeeaa",rarity:"common"},{id:"tomato",name:"토마토",icon:"tomato",category:"food",stackable:!0,maxStack:99,sellPrice:360,color:"#e54b4b",rarity:"uncommon"}];function Yr(){S.getItemRegistry().registerAll(Ft)}const Kr=["axe","shovel","water-can","net","rod","apple"];function Qr(e,n,t){const r=e.slice();for(let s=r.length-1;s>0;s--){const o=Math.floor(t()*(s+1));[r[s],r[o]]=[r[o],r[s]]}return r.slice(0,Math.min(n,r.length))}function Zr(e){let n=e|0||1;return()=>(n=n*1664525+1013904223|0,(n>>>0)/4294967295)}const H=q.create((e,n)=>({catalog:Kr,dailyStock:[],lastRolledDay:-1,setCatalog:t=>e({catalog:t.slice()}),rollDailyStock:(t,r=4)=>{const s=n();if(s.lastRolledDay===t&&s.dailyStock.length>0)return;const o=Zr(t*9301+49297),c=Qr(s.catalog,r,o).map(u=>{const l=S.getItemRegistry().get(u),f=l?.stackable?5+Math.floor(o()*6):1;return{itemId:u,price:l?.buyPrice??100,stock:f}});e({dailyStock:c,lastRolledDay:t})},buy:(t,r=1)=>{if(r<=0)return{ok:!1,reason:"invalid count"};const s=n(),o=s.dailyStock.findIndex(p=>p.itemId===t);if(o<0)return{ok:!1,reason:"not in stock"};const a=s.dailyStock[o],c=a.stock??0;if(c<r)return{ok:!1,reason:"insufficient stock"};const u=(a.price??n().priceOf(t))*r,l=k.useWalletStore.getState();if(l.bells<u)return{ok:!1,reason:"insufficient bells"};if(!l.spend(u))return{ok:!1,reason:"spend failed"};if(S.useInventoryStore.getState().add(t,r)>0)return l.add(u),{ok:!1,reason:"inventory full"};const d=s.dailyStock.slice();return d[o]={...a,stock:c-r},e({dailyStock:d}),{ok:!0}},sell:(t,r=1)=>{if(r<=0)return{ok:!1,reason:"invalid count"};if(S.useInventoryStore.getState().countOf(t)<r)return{ok:!1,reason:"not enough items"};const o=S.useInventoryStore.getState().removeById(t,r);if(o<r)return{ok:!1,reason:"remove failed"};const a=n().sellPriceOf(t)*o;return a>0&&k.useWalletStore.getState().add(a),{ok:!0}},priceOf:t=>{const s=n().dailyStock.find(o=>o.itemId===t);return s?.price!=null?s.price:S.getItemRegistry().get(t)?.buyPrice??0},sellPriceOf:t=>S.getItemRegistry().get(t)?.sellPrice??0,serialize:()=>{const t=n();return{version:1,lastRolledDay:t.lastRolledDay,dailyStock:t.dailyStock.map(r=>({...r}))}},hydrate:t=>{t&&e({lastRolledDay:typeof t.lastRolledDay=="number"?t.lastRolledDay:-1,dailyStock:Array.isArray(t.dailyStock)?t.dailyStock.map(r=>({...r})):[]})}})),Jr="gaesup.economy",es="wallet",ts="shop",ns="wallet.store",rs="shop.store";function zt(){return k.useWalletStore.getState().serialize()}function Ut(e){k.useWalletStore.getState().hydrate(e)}function Bt(){return H.getState().serialize()}function Gt(e){H.getState().hydrate(e)}function Vt(e={}){const n=e.id??Jr,t=e.walletSaveExtensionId??es,r=e.shopSaveExtensionId??ts,s=e.walletStoreServiceId??ns,o=e.shopStoreServiceId??rs;return{id:n,name:"GaeSup Economy",version:"0.1.0",runtime:"client",capabilities:["economy","wallet","shop"],setup(a){a.save.register(t,{key:t,serialize:zt,hydrate:Ut},n),a.save.register(r,{key:r,serialize:Bt,hydrate:Gt},n),a.services.register(s,{useStore:k.useWalletStore,getState:k.useWalletStore.getState,setState:k.useWalletStore.setState},n),a.services.register(o,{useStore:H,getState:H.getState,setState:H.setState},n),a.events.emit("economy:ready",{pluginId:n,walletSaveExtensionId:t,shopSaveExtensionId:r,walletStoreServiceId:s,shopStoreServiceId:o})},dispose(a){a.save.remove(t),a.save.remove(r),a.services.remove(s),a.services.remove(o)}}}const ss=Vt();function os({position:e="top-center"}){const n=k.useWalletStore(r=>r.bells),t=e==="bottom-right"?{bottom:96,right:12}:{top:10,left:"50%",transform:"translateX(-50%)"};return i.jsxs("div",{style:{position:"fixed",zIndex:90,padding:"6px 12px",background:"rgba(40,30,10,0.85)",color:"#ffd84a",fontFamily:"'Pretendard', system-ui, sans-serif",fontSize:13,borderRadius:999,display:"flex",alignItems:"center",gap:8,boxShadow:"inset 0 0 0 1px rgba(255,216,74,0.4)",pointerEvents:"none",userSelect:"none",...t},children:[i.jsx("span",{style:{width:16,height:16,borderRadius:"50%",background:"#ffd84a",color:"#3a2a08",display:"inline-flex",alignItems:"center",justifyContent:"center",fontWeight:800,fontSize:11},children:"B"}),i.jsx("span",{style:{fontWeight:700},children:n.toLocaleString()})]})}function is({open:e,onClose:n,title:t="Shop"}){const[r,s]=m.useState("buy"),o=H(p=>p.dailyStock),a=H(p=>p.buy),c=H(p=>p.sell),u=H(p=>p.sellPriceOf),l=k.useWalletStore(p=>p.bells),f=S.useInventoryStore(p=>p.slots);if(!e)return null;const d=(()=>{const p=new Map;for(const y of f)y&&p.set(y.itemId,(p.get(y.itemId)??0)+y.count);return Array.from(p.entries()).filter(([y])=>u(y)>0)})();return i.jsx("div",{style:{position:"fixed",inset:0,zIndex:130,display:"flex",alignItems:"center",justifyContent:"center",background:"rgba(0,0,0,0.55)"},onClick:n,children:i.jsxs("div",{onClick:p=>p.stopPropagation(),style:{width:520,maxHeight:"70vh",overflow:"hidden",background:"#1a1a1a",color:"#fff",borderRadius:12,boxShadow:"0 16px 36px rgba(0,0,0,0.5), inset 0 0 0 1px rgba(255,216,74,0.35)",fontFamily:"'Pretendard', system-ui, sans-serif",fontSize:13,display:"flex",flexDirection:"column"},children:[i.jsxs("div",{style:{padding:"10px 14px",display:"flex",alignItems:"center",justifyContent:"space-between",borderBottom:"1px solid #333"},children:[i.jsx("strong",{style:{fontSize:15},children:t}),i.jsxs("span",{style:{color:"#ffd84a"},children:[l.toLocaleString()," B"]}),i.jsx("button",{onClick:n,style:Wt(),children:"닫기"})]}),i.jsxs("div",{style:{display:"flex",borderBottom:"1px solid #333"},children:[i.jsx(He,{active:r==="buy",onClick:()=>s("buy"),children:"구매"}),i.jsx(He,{active:r==="sell",onClick:()=>s("sell"),children:"판매"})]}),i.jsxs("div",{style:{overflowY:"auto",padding:10},children:[r==="buy"&&(o.length===0?i.jsx("div",{style:{opacity:.7,padding:12},children:"오늘 상품이 없습니다."}):o.map(p=>{const y=S.getItemRegistry().get(p.itemId),h=p.price??y?.buyPrice??0,E=p.stock??0;return i.jsx(Xe,{...y?.color?{color:y.color}:{},name:y?.name??p.itemId,sub:`재고 ${E}`,price:h,disabled:E<=0||l<h,actionLabel:"구매",onAction:()=>{const w=a(p.itemId,1);w.ok?S.notify("success",`${y?.name??p.itemId} 구매`):S.notify("warn",`구매 실패: ${w.reason??""}`)}},p.itemId)})),r==="sell"&&(d.length===0?i.jsx("div",{style:{opacity:.7,padding:12},children:"판매할 아이템이 없습니다."}):d.map(([p,y])=>{const h=S.getItemRegistry().get(p),E=u(p);return i.jsx(Xe,{...h?.color?{color:h.color}:{},name:h?.name??p,sub:`보유 ${y}`,price:E,actionLabel:"판매",onAction:()=>{const w=c(p,1);w.ok?S.notify("reward",`${h?.name??p} 판매 +${E} B`):S.notify("warn",`판매 실패: ${w.reason??""}`)}},p)}))]})]})})}function He({active:e,onClick:n,children:t}){return i.jsx("button",{onClick:n,style:{flex:1,padding:"8px 10px",background:e?"#262626":"transparent",color:e?"#ffd84a":"#ddd",border:"none",cursor:"pointer",fontFamily:"'Pretendard', system-ui, sans-serif",fontSize:13},children:t})}function Xe({color:e,name:n,sub:t,price:r,actionLabel:s,onAction:o,disabled:a}){return i.jsxs("div",{style:{display:"flex",alignItems:"center",gap:10,padding:"8px 6px",borderBottom:"1px solid #2a2a2a"},children:[i.jsx("span",{style:{width:22,height:22,borderRadius:6,background:e??"#888"}}),i.jsxs("div",{style:{flex:1},children:[i.jsx("div",{children:n}),t&&i.jsx("div",{style:{fontSize:11,opacity:.7},children:t})]}),i.jsxs("div",{style:{color:"#ffd84a",minWidth:64,textAlign:"right"},children:[r.toLocaleString()," B"]}),i.jsx("button",{onClick:o,disabled:a,style:Wt(a),children:s})]})}function Wt(e){return{padding:"6px 10px",background:e?"#333":"#444",color:e?"#777":"#fff",border:"none",borderRadius:6,cursor:e?"not-allowed":"pointer",fontFamily:"'Pretendard', system-ui, sans-serif",fontSize:12}}function as({useKey:e="f",range:n=2.4,cooldownMs:t=350}={}){const{position:r,rotation:s}=te({updateInterval:16}),o=m.useRef(0);return m.useEffect(()=>{const a=`Key${e.toUpperCase()}`,c=e.toLowerCase(),u=l=>{const f=l.target?.tagName?.toLowerCase();if(f==="input"||f==="textarea"||l.code!==a&&l.key.toLowerCase()!==c)return;const d=performance.now();if(d-o.current<t)return;const p=S.useInventoryStore.getState().getEquipped();if(!p)return;const y=S.getItemRegistry().get(p.itemId);if(!y?.toolKind)return;const h=y.toolKind,E=s?.y??0,w=new I.Vector3(Math.sin(E),0,Math.cos(E)).normalize();o.current=d,L.getToolEvents().emit({kind:h,origin:[r.x,r.y,r.z],direction:[w.x,w.y,w.z],range:n,timestamp:d})};return window.addEventListener("keydown",u),()=>window.removeEventListener("keydown",u)},[e,t,n,r,s]),null}const cs="gaesup.relations",ls="relations",us="relations.store";function $t(){return k.useFriendshipStore.getState().serialize()}function qt(e){k.useFriendshipStore.getState().hydrate(e)}function Ht(e={}){return O.createStoreDomainPlugin({id:e.id??cs,name:"GaeSup Relations",saveExtensionId:e.saveExtensionId??ls,storeServiceId:e.storeServiceId??us,store:k.useFriendshipStore,readyEvent:"relations:ready",capabilities:["relations"],serialize:$t,hydrate:qt})}const ds=Ht();let fs=0;function ps(){return`mail_${Date.now().toString(36)}_${(++fs).toString(36)}`}function ms(e){return e.itemId!==void 0}const Q=q.create((e,n)=>({messages:[],send:t=>{const r=t.id??ps(),s={id:r,from:t.from,subject:t.subject,body:t.body,sentDay:t.sentDay,...t.attachments?{attachments:t.attachments}:{},read:!1,claimed:!t.attachments||t.attachments.length===0};return e({messages:[...n().messages,s]}),S.notify("mail",`새 우편: ${t.subject}`),r},markRead:t=>{e({messages:n().messages.map(r=>r.id===t?{...r,read:!0}:r)})},markAllRead:()=>{e({messages:n().messages.map(t=>({...t,read:!0}))})},claim:t=>{const r=n().messages.find(o=>o.id===t);if(!r||r.claimed||!r.attachments)return!1;let s=!0;for(const o of r.attachments)if(ms(o)){if(S.useInventoryStore.getState().add(o.itemId,o.count??1)>0){s=!1,S.notify("warn","인벤토리 부족, 일부 우편물 미수령");break}}else k.useWalletStore.getState().add(o.bells);return s&&(e({messages:n().messages.map(o=>o.id===t?{...o,claimed:!0,read:!0}:o)}),S.notify("reward","우편 첨부물 수령")),s},delete:t=>{e({messages:n().messages.filter(r=>r.id!==t)})},unreadCount:()=>n().messages.reduce((t,r)=>t+(r.read?0:1),0),hasUnclaimedAttachments:()=>n().messages.some(t=>!t.claimed&&(t.attachments?.length??0)>0),serialize:()=>({version:1,messages:n().messages.map(t=>({...t,...t.attachments?{attachments:t.attachments.map(r=>({...r}))}:{}}))}),hydrate:t=>{!t||!Array.isArray(t.messages)||e({messages:t.messages.map(r=>({...r}))})}})),gs="gaesup.mail",ys="mail",hs="mail.store";function Xt(){return Q.getState().serialize()}function Yt(e){Q.getState().hydrate(e)}function Kt(e={}){return O.createStoreDomainPlugin({id:e.id??gs,name:"GaeSup Mail",saveExtensionId:e.saveExtensionId??ys,storeServiceId:e.storeServiceId??hs,store:Q,readyEvent:"mail:ready",capabilities:["mail"],serialize:Xt,hydrate:Yt})}const Ss=Kt();function bs({toggleKey:e="m"}){const[n,t]=m.useState(!1),[r,s]=m.useState(null),o=Q(d=>d.messages),a=Q(d=>d.markRead),c=Q(d=>d.claim),u=Q(d=>d.delete);if(m.useEffect(()=>{const d=p=>{const y=p.target?.tagName?.toLowerCase();y==="input"||y==="textarea"||(p.key.toLowerCase()===e.toLowerCase()&&t(h=>!h),p.key==="Escape"&&t(!1))};return window.addEventListener("keydown",d),()=>window.removeEventListener("keydown",d)},[e]),!n)return null;const l=o.slice().sort((d,p)=>p.sentDay-d.sentDay),f=r?l.find(d=>d.id===r)??null:null;return i.jsx("div",{style:{position:"fixed",inset:0,zIndex:130,background:"rgba(0,0,0,0.55)",display:"flex",alignItems:"center",justifyContent:"center"},onClick:()=>t(!1),children:i.jsxs("div",{onClick:d=>d.stopPropagation(),style:{width:720,height:460,display:"flex",background:"#1a1a1a",color:"#fff",borderRadius:12,boxShadow:"0 16px 36px rgba(0,0,0,0.5), inset 0 0 0 1px rgba(207,154,255,0.35)",fontFamily:"'Pretendard', system-ui, sans-serif",fontSize:13,overflow:"hidden"},children:[i.jsxs("div",{style:{width:260,borderRight:"1px solid #333",display:"flex",flexDirection:"column"},children:[i.jsxs("div",{style:{padding:"10px 12px",borderBottom:"1px solid #333",display:"flex",justifyContent:"space-between"},children:[i.jsx("strong",{children:"우편함"}),i.jsx("span",{style:{fontSize:12,opacity:.7},children:l.length})]}),i.jsx("div",{style:{flex:1,overflowY:"auto"},children:l.length===0?i.jsx(vs,{children:"우편이 없습니다."}):l.map(d=>i.jsxs("div",{onClick:()=>{s(d.id),d.read||a(d.id)},style:{padding:"8px 12px",cursor:"pointer",background:r===d.id?"#262626":"transparent",borderBottom:"1px solid #2a2a2a",opacity:d.read?.7:1},children:[i.jsxs("div",{style:{display:"flex",alignItems:"center",gap:6},children:[!d.read&&i.jsx("span",{style:{width:6,height:6,borderRadius:"50%",background:"#cf9aff"}}),i.jsx("strong",{style:{fontSize:13},children:d.subject})]}),i.jsxs("div",{style:{fontSize:11,opacity:.6},children:[d.from," · day ",d.sentDay]}),d.attachments&&d.attachments.length>0&&!d.claimed&&i.jsx("div",{style:{fontSize:11,color:"#ffd84a"},children:"* 첨부물"})]},d.id))})]}),i.jsxs("div",{style:{flex:1,display:"flex",flexDirection:"column"},children:[i.jsxs("div",{style:{padding:"10px 12px",borderBottom:"1px solid #333",display:"flex",justifyContent:"space-between"},children:[i.jsx("span",{children:f?f.subject:"메시지를 선택하세요"}),i.jsxs("button",{onClick:()=>t(!1),style:Ae(),children:["닫기 [",e.toUpperCase(),"]"]})]}),i.jsx("div",{style:{flex:1,padding:12,overflowY:"auto"},children:f?i.jsx(xs,{msg:f,onClaim:()=>c(f.id),onDelete:()=>{u(f.id),s(null)}}):i.jsx("div",{style:{opacity:.6},children:"왼쪽에서 메시지를 선택하세요."})})]})]})})}function xs({msg:e,onClaim:n,onDelete:t}){return i.jsxs("div",{children:[i.jsxs("div",{style:{marginBottom:6,opacity:.75},children:["From. ",e.from]}),i.jsx("div",{style:{whiteSpace:"pre-wrap",lineHeight:1.6,marginBottom:12},children:e.body}),e.attachments&&e.attachments.length>0&&i.jsxs("div",{style:{padding:10,background:"#222",borderRadius:8,marginBottom:8},children:[i.jsx("div",{style:{marginBottom:6,color:"#ffd84a",fontSize:12},children:"첨부물"}),i.jsx("ul",{style:{margin:0,paddingLeft:18},children:e.attachments.map((r,s)=>{if("itemId"in r){const o=S.getItemRegistry().get(r.itemId);return i.jsxs("li",{children:[o?.name??r.itemId," x",r.count??1]},s)}return i.jsxs("li",{children:[r.bells," B"]},s)})}),i.jsx("div",{style:{marginTop:8,display:"flex",gap:6,justifyContent:"flex-end"},children:e.claimed?i.jsx("span",{style:{fontSize:12,opacity:.6},children:"수령 완료"}):i.jsx("button",{onClick:n,style:Ae(!0),children:"받기"})})]}),i.jsx("div",{style:{display:"flex",justifyContent:"flex-end"},children:i.jsx("button",{onClick:t,style:Ae(),children:"삭제"})})]})}function vs({children:e}){return i.jsx("div",{style:{padding:14,opacity:.6},children:e})}function Ae(e){return{padding:"6px 10px",background:e?"#cf9aff":"#444",color:e?"#1a0d24":"#fff",border:"none",borderRadius:6,cursor:"pointer",fontFamily:"'Pretendard', system-ui, sans-serif",fontSize:12,fontWeight:e?700:400}}const Le=["fish","bug","food","material","furniture","tool","misc"],ae=q.create((e,n)=>({entries:{},record:(t,r,s)=>{if(r<=0)return;const o=n().entries[t],a=o?{...o,totalCollected:o.totalCollected+r}:{itemId:t,firstSeenDay:s,totalCollected:r};e({entries:{...n().entries,[t]:a}})},has:t=>!!n().entries[t],get:t=>n().entries[t],size:()=>Object.keys(n().entries).length,serialize:()=>({version:1,entries:Object.fromEntries(Object.entries(n().entries).map(([t,r])=>[t,{...r}]))}),hydrate:t=>{if(!t||typeof t!="object")return;const r={};if(t.entries&&typeof t.entries=="object")for(const[s,o]of Object.entries(t.entries))!o||typeof o!="object"||(r[s]={itemId:s,firstSeenDay:typeof o.firstSeenDay=="number"?o.firstSeenDay:0,totalCollected:typeof o.totalCollected=="number"?o.totalCollected:0});e({entries:r})}})),Is="gaesup.catalog",Es="catalog",ws="catalog.store";function Qt(){return ae.getState().serialize()}function Zt(e){ae.getState().hydrate(e)}function Jt(e={}){return O.createStoreDomainPlugin({id:e.id??Is,name:"GaeSup Catalog",saveExtensionId:e.saveExtensionId??Es,storeServiceId:e.storeServiceId??ws,store:ae,readyEvent:"catalog:ready",capabilities:["catalog"],serialize:Qt,hydrate:Zt})}const Cs=Jt();function ks(e=!0){m.useEffect(()=>e?S.useInventoryStore.subscribe((t,r)=>{if(t.slots===r.slots)return;const s=Math.floor(j.useTimeStore.getState().totalMinutes/(60*24)),o=new Map;for(const c of r.slots)c&&o.set(c.itemId,(o.get(c.itemId)??0)+c.count);const a=new Map;for(const c of t.slots)c&&a.set(c.itemId,(a.get(c.itemId)??0)+c.count);for(const[c,u]of a.entries()){const l=u-(o.get(c)??0);l>0&&ae.getState().record(c,l,s)}}):void 0,[e])}function Ts({toggleKey:e="k"}){const[n,t]=m.useState(!1),[r,s]=m.useState("fish"),o=ae(f=>f.entries);m.useEffect(()=>{const f=d=>{const p=d.target?.tagName?.toLowerCase();p==="input"||p==="textarea"||(d.key.toLowerCase()===e.toLowerCase()&&t(y=>!y),d.key==="Escape"&&t(!1))};return window.addEventListener("keydown",f),()=>window.removeEventListener("keydown",f)},[e]);const a=m.useMemo(()=>S.getItemRegistry().all(),[]),c=m.useMemo(()=>{const f=new Map;for(const d of Le)f.set(d,[]);for(const d of a){const p=f.get(d.category);p&&p.push(d)}return f},[a]);if(!n)return null;const u=c.get(r)??[],l=u.filter(f=>o[f.id]).length;return i.jsx("div",{style:{position:"fixed",inset:0,zIndex:130,background:"rgba(0,0,0,0.55)",display:"flex",alignItems:"center",justifyContent:"center"},onClick:()=>t(!1),children:i.jsxs("div",{onClick:f=>f.stopPropagation(),style:{width:760,height:520,display:"flex",flexDirection:"column",background:"#1a1a1a",color:"#fff",borderRadius:12,boxShadow:"0 16px 36px rgba(0,0,0,0.5), inset 0 0 0 1px rgba(122,223,144,0.35)",fontFamily:"'Pretendard', system-ui, sans-serif",fontSize:13,overflow:"hidden"},children:[i.jsxs("div",{style:{padding:"10px 14px",borderBottom:"1px solid #333",display:"flex",justifyContent:"space-between"},children:[i.jsx("strong",{style:{fontSize:15},children:"도감"}),i.jsxs("button",{onClick:()=>t(!1),style:Rs(),children:["닫기 [",e.toUpperCase(),"]"]})]}),i.jsx("div",{style:{display:"flex",borderBottom:"1px solid #333"},children:Le.map(f=>{const d=c.get(f)??[];if(d.length===0)return null;const p=d.filter(y=>o[y.id]).length;return i.jsxs("button",{onClick:()=>s(f),style:{flex:1,padding:"8px 4px",background:r===f?"#262626":"transparent",color:r===f?"#7adf90":"#ddd",border:"none",cursor:"pointer",fontFamily:"'Pretendard', system-ui, sans-serif",fontSize:12},children:[Ye(f)," (",p,"/",d.length,")"]},f)})}),i.jsxs("div",{style:{padding:"6px 14px",fontSize:12,opacity:.7},children:[Ye(r)," — ",l,"/",u.length," 수집"]}),i.jsxs("div",{style:{flex:1,overflowY:"auto",padding:10,display:"grid",gridTemplateColumns:"repeat(auto-fill, minmax(140px, 1fr))",gap:8},children:[u.map(f=>{const d=o[f.id],p=!!d;return i.jsxs("div",{style:{padding:10,borderRadius:8,background:p?"#222":"#181818",border:p?"1px solid #2e3":"1px solid #2a2a2a",opacity:p?1:.4},children:[i.jsxs("div",{style:{display:"flex",alignItems:"center",gap:6,marginBottom:4},children:[i.jsx("span",{style:{width:16,height:16,borderRadius:4,background:f.color??"#888"}}),i.jsx("strong",{style:{fontSize:13},children:p?f.name:"???"})]}),p&&i.jsxs("div",{style:{fontSize:11,opacity:.7},children:["수집 ",d.totalCollected," · day ",d.firstSeenDay]})]},f.id)}),u.length===0&&i.jsx("div",{style:{opacity:.6},children:"이 카테고리에는 항목이 없습니다."})]})]})})}function Ye(e){switch(e){case"fish":return"물고기";case"bug":return"곤충";case"food":return"음식";case"material":return"재료";case"furniture":return"가구";case"tool":return"도구";case"misc":return"기타"}}function Rs(){return{padding:"4px 10px",background:"#444",color:"#fff",border:"none",borderRadius:6,cursor:"pointer",fontFamily:"'Pretendard', system-ui, sans-serif",fontSize:12}}class Ps{defs=new Map;register(n){this.defs.has(n.id)||this.defs.set(n.id,n)}registerAll(n){for(const t of n)this.register(t)}get(n){return this.defs.get(n)}require(n){const t=this.defs.get(n);if(!t)throw new Error(`Unknown RecipeId: ${n}`);return t}all(){return Array.from(this.defs.values())}has(n){return this.defs.has(n)}clear(){this.defs.clear()}}let we=null;function ie(){return we||(we=new Ps),we}const re=q.create((e,n)=>({unlocked:new Set,unlock:t=>{const r=ie().get(t);if(!r||n().unlocked.has(t))return;const s=new Set(n().unlocked);s.add(t),e({unlocked:s}),S.notify("info",`레시피 해금: ${r.name}`)},isUnlocked:t=>{const r=ie().get(t);return r?r.unlockedByDefault?!0:n().unlocked.has(t):!1},canCraft:t=>{const r=ie().get(t);if(!r)return{ok:!1,reason:"unknown recipe"};if(!n().isUnlocked(t))return{ok:!1,reason:"locked"};const s=S.useInventoryStore.getState();for(const o of r.ingredients)if(s.countOf(o.itemId)<o.count)return{ok:!1,reason:"missing ingredients"};return r.requireBells&&k.useWalletStore.getState().bells<r.requireBells?{ok:!1,reason:"insufficient bells"}:{ok:!0}},craft:t=>{const r=n().canCraft(t);if(!r.ok)return r;const s=ie().require(t),o=S.useInventoryStore.getState();for(const c of s.ingredients)if(o.removeById(c.itemId,c.count)<c.count)return{ok:!1,reason:"remove failed"};return s.requireBells&&!k.useWalletStore.getState().spend(s.requireBells)?{ok:!1,reason:"spend failed"}:(o.add(s.output.itemId,s.output.count)>0?S.notify("warn","인벤토리 부족, 일부 결과물 폐기"):S.notify("reward",`제작 완료: ${s.name}`),{ok:!0})},serialize:()=>({version:1,unlocked:Array.from(n().unlocked)}),hydrate:t=>{!t||!Array.isArray(t.unlocked)||e({unlocked:new Set(t.unlocked)})}})),_s="gaesup.crafting",js="crafting",Ds="crafting.store";function en(){return re.getState().serialize()}function tn(e){re.getState().hydrate(e)}function nn(e={}){return O.createStoreDomainPlugin({id:e.id??_s,name:"GaeSup Crafting",saveExtensionId:e.saveExtensionId??js,storeServiceId:e.storeServiceId??Ds,store:re,readyEvent:"crafting:ready",capabilities:["crafting"],serialize:en,hydrate:tn})}const Ms=nn();function As({toggleKey:e="c",title:n="제작대",open:t,onClose:r}){const[s,o]=m.useState(!1),a=t!==void 0,c=a?t:s,u=()=>{a?r?.():o(!1)},l=()=>{a?c&&r?.():o(g=>!g)},f=re(g=>g.isUnlocked),d=re(g=>g.canCraft),p=re(g=>g.craft),y=S.useInventoryStore(g=>g.slots),h=k.useWalletStore(g=>g.bells);if(m.useEffect(()=>{const g=v=>{const C=v.target?.tagName?.toLowerCase();C==="input"||C==="textarea"||(v.key.toLowerCase()===e.toLowerCase()&&l(),v.key==="Escape"&&u())};return window.addEventListener("keydown",g),()=>window.removeEventListener("keydown",g)},[e,a,c]),!c)return null;const E=ie().all(),w=(()=>{const g=new Map;for(const v of y)v&&g.set(v.itemId,(g.get(v.itemId)??0)+v.count);return g})();return i.jsx("div",{style:{position:"fixed",inset:0,zIndex:130,background:"rgba(0,0,0,0.55)",display:"flex",alignItems:"center",justifyContent:"center"},onClick:u,children:i.jsxs("div",{onClick:g=>g.stopPropagation(),style:{width:600,maxHeight:"76vh",overflow:"hidden",display:"flex",flexDirection:"column",background:"#1a1a1a",color:"#fff",borderRadius:12,boxShadow:"0 16px 36px rgba(0,0,0,0.5), inset 0 0 0 1px rgba(255,200,120,0.35)",fontFamily:"'Pretendard', system-ui, sans-serif",fontSize:13},children:[i.jsxs("div",{style:{padding:"10px 14px",borderBottom:"1px solid #333",display:"flex",justifyContent:"space-between"},children:[i.jsx("strong",{style:{fontSize:15},children:n}),i.jsxs("span",{style:{color:"#ffd84a"},children:[h.toLocaleString()," B"]}),i.jsxs("button",{onClick:u,style:Ke(),children:["닫기 [",e.toUpperCase(),"]"]})]}),i.jsxs("div",{style:{overflowY:"auto",padding:10},children:[E.length===0&&i.jsx(Ls,{children:"레시피가 없습니다."}),E.map(g=>{const v=f(g.id),C=d(g.id),R=S.getItemRegistry().get(g.output.itemId);return i.jsxs("div",{style:{padding:10,marginBottom:6,background:"#222",borderRadius:8,opacity:v?1:.45},children:[i.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",marginBottom:4},children:[i.jsxs("div",{style:{display:"flex",alignItems:"center",gap:6},children:[i.jsx("span",{style:{width:16,height:16,borderRadius:4,background:R?.color??"#888"}}),i.jsx("strong",{children:v?g.name:"???"}),g.output.count>1&&i.jsxs("span",{style:{opacity:.7},children:["x",g.output.count]})]}),i.jsx("button",{onClick:()=>p(g.id),disabled:!C.ok,style:Ke(C.ok),children:"제작"})]}),v&&i.jsxs("div",{style:{fontSize:12,opacity:.85},children:["재료: ",g.ingredients.map(D=>{const F=w.get(D.itemId)??0,x=F>=D.count,_=S.getItemRegistry().get(D.itemId);return i.jsxs("span",{style:{marginRight:8,color:x?"#7adf90":"#ff8a8a"},children:[_?.name??D.itemId," ",F,"/",D.count]},D.itemId)}),g.requireBells?i.jsxs("span",{style:{color:"#ffd84a"},children:["· ",g.requireBells," B"]}):null]})]},g.id)})]})]})})}function Ls({children:e}){return i.jsx("div",{style:{padding:14,opacity:.6},children:e})}function Ke(e){return{padding:"5px 10px",background:e?"#ffc878":"#333",color:e?"#1a1a1a":"#777",border:"none",borderRadius:6,cursor:e?"pointer":"not-allowed",fontFamily:"'Pretendard', system-ui, sans-serif",fontSize:12,fontWeight:e?700:400}}class Os{defs=new Map;register(n){this.defs.has(n.id)||this.defs.set(n.id,n)}registerAll(n){for(const t of n)this.register(t)}get(n){return this.defs.get(n)}require(n){const t=this.defs.get(n);if(!t)throw new Error(`Unknown CropId: ${n}`);return t}bySeedItemId(n){for(const t of this.defs.values())if(t.seedItemId===n)return t}all(){return Array.from(this.defs.values())}has(n){return this.defs.has(n)}clear(){this.defs.clear()}}let Ce=null;function J(){return Ce||(Ce=new Os),Ce}function Qe(e,n){return{id:e,position:n,state:"empty",stageIndex:0}}function Ns(e,n){if(e.state!=="planted"&&e.state!=="mature")return e.stageIndex;const t=e.cropId?J().get(e.cropId):void 0;if(!t||e.plantedAt===void 0)return e.stageIndex;let r=n-e.plantedAt;for(let s=0;s<t.stages.length;s++){const o=t.stages[s];if(o.durationMinutes<=0||r<o.durationMinutes)return s;r-=o.durationMinutes}return t.stages.length-1}const V=q.create((e,n)=>({plots:{},registerPlot:t=>{if(n().plots[t.id])return;const s={...Qe(t.id,t.position),...t};e({plots:{...n().plots,[t.id]:s}})},unregisterPlot:t=>{if(!n().plots[t])return;const r={...n().plots};delete r[t],e({plots:r})},till:t=>{const r=n().plots[t];return!r||r.state!=="empty"?!1:(e({plots:{...n().plots,[t]:{...r,state:"tilled",stageIndex:0}}}),!0)},plant:(t,r,s)=>{const o=n().plots[t],a=J().get(r);if(!o||!a||o.state!=="tilled")return!1;const c=S.useInventoryStore.getState();return c.countOf(a.seedItemId)<1?(S.notify("warn",`${a.name} 씨앗 부족`),!1):(c.removeById(a.seedItemId,1),e({plots:{...n().plots,[t]:{...o,state:"planted",cropId:r,plantedAt:s,lastWateredAt:s,stageIndex:0}}}),S.notify("success",`${a.name} 심음`),!0)},water:(t,r)=>{const s=n().plots[t];if(!s||s.state!=="planted"&&s.state!=="dried")return!1;let o={...s,lastWateredAt:r};return s.state==="dried"&&(o={...o,state:"planted"}),e({plots:{...n().plots,[t]:o}}),!0},harvest:t=>{const r=n().plots[t];if(!r||r.state!=="mature"||!r.cropId)return!1;const s=J().get(r.cropId);return s?S.useInventoryStore.getState().add(s.yieldItemId,s.yieldCount)>0?(S.notify("warn","인벤토리가 가득 찼습니다"),!1):(S.notify("reward",`${s.name} +${s.yieldCount}`),e({plots:{...n().plots,[t]:{...Qe(r.id,r.position),state:"tilled"}}}),!0):!1},tick:t=>{const r=n().plots,s={};let o=!1;for(const[a,c]of Object.entries(r)){let u=c;if(u.state==="planted"||u.state==="mature"){const l=u.cropId?J().get(u.cropId):void 0;if(l&&u.plantedAt!==void 0){const f=u.lastWateredAt??u.plantedAt;if(t-f>=l.driedOutMinutes)u={...u,state:"dried"},o=!0;else{const d=Ns(u,t),p=l.stages.length-1,y=d>=p?"mature":"planted";(d!==u.stageIndex||y!==u.state)&&(u={...u,stageIndex:d,state:y},o=!0)}}}s[a]=u}o&&e({plots:s})},near:(t,r,s)=>{const o=s*s;let a=null,c=1/0;for(const u of Object.values(n().plots)){const l=u.position[0]-t,f=u.position[2]-r,d=l*l+f*f;d<o&&d<c&&(c=d,a=u)}return a},serialize:()=>({version:1,plots:Object.values(n().plots).map(t=>({...t}))}),hydrate:t=>{if(!t||!Array.isArray(t.plots))return;const r={};for(const s of t.plots)s?.id&&(r[s.id]={...s});e({plots:r})}})),Fs="gaesup.farming",zs="farming",Us="farming.store";function rn(){return V.getState().serialize()}function sn(e){V.getState().hydrate(e)}function on(e={}){return O.createStoreDomainPlugin({id:e.id??Fs,name:"GaeSup Farming",saveExtensionId:e.saveExtensionId??zs,storeServiceId:e.storeServiceId??Us,store:V,readyEvent:"farming:ready",capabilities:["farming"],serialize:rn,hydrate:sn})}const Bs=on();function Gs(e,n,t){const r=n.origin[0]-e.position[0],s=n.origin[2]-e.position[2];return r*r+s*s<=t*t}let fe=0,pe=0,me=null;const he=new Map;function Ze(){let e=0;for(const n of he.values())e=Math.max(e,n);pe=e}function Fe(e){if(pe<=0)return null;const n=V.getState().near(e.origin[0],e.origin[2],pe);if(!n)return null;const t=he.get(n.id)??pe;return Gs(n,e,t)?n:null}function Vs(e){const n=Fe(e);if(!n)return;const t=V.getState(),r=t.plots[n.id];if(!r)return;if(r.state==="mature")return t.harvest(r.id)?!0:void 0;if(r.state!=="empty")return;const s=t.till(r.id);return s&&S.notify("info","땅을 갈았다"),s?!0:void 0}function Ws(e){const n=Fe(e);if(!n||n.state!=="tilled")return;const t=S.useInventoryStore.getState().getEquipped();if(!t)return;const r=J().bySeedItemId(t.itemId);if(!r)return;const s=j.useTimeStore.getState().totalMinutes;return V.getState().plant(n.id,r.id,s)?!0:void 0}function $s(e){const n=Fe(e);if(!n||n.state!=="planted"&&n.state!=="dried")return;const t=j.useTimeStore.getState().totalMinutes,r=V.getState().water(n.id,t);return r&&S.notify("info","물을 줬다"),r?!0:void 0}function qs(){if(fe+=1,me)return;const e=L.getToolEvents().on("shovel",Vs),n=L.getToolEvents().on("seed",Ws),t=L.getToolEvents().on("water",$s);let r=Number.NaN;const s=a=>{a!==r&&(r=a,V.getState().tick(a))},o=j.useTimeStore.subscribe(a=>{s(a.totalMinutes)});s(j.useTimeStore.getState().totalMinutes),me=()=>{e(),n(),t(),o(),me=null}}function Hs(){fe=Math.max(0,fe-1),!(fe>0)&&me?.()}function Xs({id:e,position:n,size:t=1.4,hitRange:r=1.6}){const s=V(d=>d.registerPlot),o=V(d=>d.unregisterPlot),a=V(d=>d.plots[e]);m.useEffect(()=>(s({id:e,position:n}),he.set(e,r),Ze(),qs(),()=>{Hs(),he.delete(e),Ze(),o(e)}),[e,n,r,s,o]);const c=a?.cropId?J().get(a.cropId):void 0,u=c?c.stages[a.stageIndex]:void 0,l=m.useMemo(()=>!a||a.state==="empty"?"#5a3f24":a.state==="tilled"?"#4a2f18":a.state==="dried"?"#6b5230":"#3a2810",[a]),f=m.useRef(null);return Y.useFrame(({clock:d})=>{const p=f.current;if(!p)return;const y=d.elapsedTime;p.rotation.y=Math.sin(y*.4)*.05,p.position.y=(u?.scale??.3)*.5+Math.sin(y*1.2)*.01}),i.jsxs("group",{position:n,children:[i.jsxs("mesh",{receiveShadow:!0,rotation:[-Math.PI/2,0,0],position:[0,.005,0],children:[i.jsx("planeGeometry",{args:[t,t]}),i.jsx("meshToonMaterial",{color:l})]}),a&&(a.state==="planted"||a.state==="mature"||a.state==="dried")&&c&&u&&i.jsxs("mesh",{ref:f,castShadow:!0,position:[0,u.scale*.5,0],children:[i.jsx("coneGeometry",{args:[Math.max(.08,u.scale*.35),Math.max(.16,u.scale*.9),10]}),i.jsx("meshToonMaterial",{color:a.state==="dried"?"#7a6a4a":u.color??"#9adf90"})]}),a?.state==="mature"&&i.jsxs("mesh",{position:[0,1,0],children:[i.jsx("ringGeometry",{args:[.18,.24,16]}),i.jsx("meshBasicMaterial",{color:"#ffd84a",transparent:!0,opacity:.85,depthWrite:!1})]})]})}const Ys=[{id:"crop.turnip",name:"순무",seedItemId:"seed-turnip",yieldItemId:"turnip",yieldCount:2,waterIntervalMinutes:60*8,driedOutMinutes:60*16,stages:[{durationMinutes:60*6,scale:.3,color:"#8acf8a"},{durationMinutes:60*8,scale:.6,color:"#a8df9c",needsWater:!0},{durationMinutes:60*10,scale:.9,color:"#cfeeb6",needsWater:!0},{durationMinutes:0,scale:1,color:"#ffeeaa"}]},{id:"crop.tomato",name:"토마토",seedItemId:"seed-tomato",yieldItemId:"tomato",yieldCount:3,waterIntervalMinutes:60*6,driedOutMinutes:60*12,stages:[{durationMinutes:60*8,scale:.3,color:"#7adf90"},{durationMinutes:60*12,scale:.6,color:"#9adf90",needsWater:!0},{durationMinutes:60*12,scale:.9,color:"#cfdf90",needsWater:!0},{durationMinutes:0,scale:1.1,color:"#e54b4b"}]}];let Je=!1;function Ks(){Je||(Je=!0,J().registerAll(Ys))}const Qs="gaesup.weather",Zs="weather",Js="weather.store";function an(){return B.useWeatherStore.getState().serialize()}function cn(e){B.useWeatherStore.getState().hydrate(e)}function ln(e={}){const n=e.id??Qs,t=e.saveExtensionId??Zs,r=e.storeServiceId??Js;return{id:n,name:"GaeSup Weather",version:"0.1.0",runtime:"client",capabilities:["weather"],setup(s){s.save.register(t,{key:t,serialize:an,hydrate:cn},n),s.services.register(r,{useStore:B.useWeatherStore,getState:B.useWeatherStore.getState,setState:B.useWeatherStore.setState},n),s.events.emit("weather:ready",{pluginId:n,saveExtensionId:t,storeServiceId:r})},dispose(s){s.save.remove(t),s.services.remove(r)}}}const eo=ln(),to={sunny:{sym:"O",color:"#ffd84a",label:"맑음"},cloudy:{sym:"c",color:"#aab2bc",label:"흐림"},rain:{sym:"r",color:"#4aa8ff",label:"비"},snow:{sym:"*",color:"#dff0ff",label:"눈"},storm:{sym:"!",color:"#7f7fff",label:"폭풍"}};function no({position:e="top-left"}){const n=B.useWeatherStore(s=>s.current);if(!n)return null;const t=to[n.kind],r=e==="top-right"?{top:50,right:12}:{top:50,left:12};return i.jsxs("div",{style:{position:"fixed",zIndex:90,padding:"4px 10px",background:"rgba(20,20,28,0.85)",color:"#fff",fontFamily:"'Pretendard', system-ui, sans-serif",fontSize:12,borderRadius:999,display:"flex",alignItems:"center",gap:8,boxShadow:`inset 0 0 0 1px ${t.color}55`,pointerEvents:"none",userSelect:"none",...r},children:[i.jsx("span",{style:{width:18,height:18,borderRadius:"50%",background:t.color,color:"#1a1a1a",display:"inline-flex",alignItems:"center",justifyContent:"center",fontWeight:800,fontSize:11},children:t.sym}),i.jsx("span",{children:t.label})]})}function ro(e=!0){m.useEffect(()=>{if(!e)return;const n=()=>{const r=j.useTimeStore.getState(),s=Math.floor(r.totalMinutes/(60*24)),o=B.useWeatherStore.getState().current;(!o||o.day!==s)&&B.useWeatherStore.getState().rollForDay(s,r.time.season)};return n(),j.useTimeStore.subscribe((r,s)=>{const o=Math.floor(r.totalMinutes/1440),a=Math.floor(s.totalMinutes/(60*24));o!==a&&n()})},[e])}function et(e,n){return{id:e,position:n,size:[4,4],state:"empty"}}const G=q.create((e,n)=>({houses:{},residents:{},decorationScore:0,registerHouse:t=>{if(n().houses[t.id])return;const s={...et(t.id,t.position),...t};e({houses:{...n().houses,[t.id]:s}})},unregisterHouse:t=>{const r={...n().houses};r[t]&&(delete r[t],e({houses:r}))},registerResident:t=>{n().residents[t.id]||e({residents:{...n().residents,[t.id]:t}})},removeResident:t=>{const r={...n().residents};if(r[t]){delete r[t],e({residents:r});for(const s of Object.values(n().houses))s.residentId===t&&n().moveOut(s.id),s.reservedFor===t&&n().cancelReservation(s.id)}},reserveHouse:(t,r,s)=>{const o=n().houses[t];return!o||o.state!=="empty"?!1:(e({houses:{...n().houses,[t]:{...o,state:"reserved",reservedFor:r,...s!==void 0?{reservedUntilDay:s}:{}}}}),!0)},cancelReservation:t=>{const r=n().houses[t];if(!r||r.state!=="reserved")return;const s={...r,state:"empty"};delete s.reservedFor,delete s.reservedUntilDay,e({houses:{...n().houses,[t]:s}})},moveIn:(t,r,s)=>{const o=n().houses[t],a=n().residents[r];return!o||!a||o.state==="occupied"?!1:(e({houses:{...n().houses,[t]:{...o,state:"occupied",residentId:r}},residents:{...n().residents,[r]:{...a,movedInDay:s}}}),S.notify("reward",`${a.name}이(가) 이사 왔다!`),!0)},moveOut:t=>{const r=n().houses[t];if(!r||r.state!=="occupied")return!1;const s=r.residentId?n().residents[r.residentId]:null;return e({houses:{...n().houses,[t]:et(t,r.position)}}),s&&S.notify("info",`${s.name}이(가) 떠났다`),!0},setDecorationScore:t=>e({decorationScore:Math.max(0,Math.floor(t))}),stats:()=>{const t=Object.values(n().houses),r=t.filter(s=>s.state==="occupied").length;return{decorationScore:n().decorationScore,residentCount:Object.keys(n().residents).length,occupiedHouses:r,totalHouses:t.length}},serialize:()=>({version:1,houses:Object.values(n().houses).map(t=>({...t})),residents:Object.values(n().residents).map(t=>({...t}))}),hydrate:t=>{if(!t)return;const r={},s={};if(Array.isArray(t.houses))for(const o of t.houses)o?.id&&(r[o.id]={...o});if(Array.isArray(t.residents))for(const o of t.residents)o?.id&&(s[o.id]={...o});e({houses:r,residents:s})}})),so="gaesup.town",oo="town",io="town.store";function un(){return G.getState().serialize()}function dn(e){G.getState().hydrate(e)}function fn(e={}){return O.createStoreDomainPlugin({id:e.id??so,name:"GaeSup Town",saveExtensionId:e.saveExtensionId??oo,storeServiceId:e.storeServiceId??io,store:G,readyEvent:"town:ready",capabilities:["town"],serialize:un,hydrate:dn})}const ao=fn(),co={tile:2,wall:1,placedObject:5,base:0};function lo(e=!0,n={}){m.useEffect(()=>{if(!e)return;const t={...co,...n},r=o=>{let a=0,c=0;const u=o.objects.length;for(const f of o.tileGroups.values())a+=f.tiles.length;for(const f of o.wallGroups.values())c+=f.walls.length;const l=t.base+a*t.tile+c*t.wall+u*t.placedObject;G.getState().setDecorationScore(l)};return r(P.useBuildingStore.getState()),P.useBuildingStore.subscribe(o=>r(o))},[e,n.tile,n.wall,n.placedObject,n.base])}function uo({id:e,position:n,size:t=[4,4],emptyColor:r="#705038",reservedColor:s="#c8a85a",occupiedColor:o="#5a8acf"}){const a=G(y=>y.registerHouse),c=G(y=>y.unregisterHouse),u=G(y=>y.houses[e]),l=G(y=>y.residents);m.useEffect(()=>(a({id:e,position:n,size:t}),()=>c(e)),[e,n,t,a,c]);const f=u?u.state==="occupied"?o:u.state==="reserved"?s:r:r,d=u?.residentId?l[u.residentId]:null,p=m.useMemo(()=>new I.PlaneGeometry(t[0],t[1]),[t[0],t[1]]);return i.jsxs("group",{position:n,children:[i.jsx("mesh",{geometry:p,rotation:[-Math.PI/2,0,0],position:[0,.005,0],children:i.jsx("meshToonMaterial",{color:f,transparent:!0,opacity:.7})}),u?.state==="occupied"&&d&&i.jsxs(i.Fragment,{children:[i.jsxs("mesh",{position:[0,.6,0],castShadow:!0,children:[i.jsx("boxGeometry",{args:[Math.max(1.4,t[0]*.6),1.2,Math.max(1.4,t[1]*.6)]}),i.jsx("meshToonMaterial",{color:d.bodyColor??"#e8d8b8"})]}),i.jsxs("mesh",{position:[0,1.5,0],castShadow:!0,children:[i.jsx("coneGeometry",{args:[Math.max(1,t[0]*.45),.7,4]}),i.jsx("meshToonMaterial",{color:d.hatColor??"#a85a5a"})]})]}),u?.state==="reserved"&&i.jsxs("mesh",{position:[0,.5,0],children:[i.jsx("boxGeometry",{args:[.4,1,.4]}),i.jsx("meshToonMaterial",{color:s})]})]})}function fo({position:e="top-right",offset:n}){const t=G(f=>f.decorationScore),r=G(f=>f.houses),s=G(f=>f.residents),o=Object.keys(r).length,a=Object.values(r).filter(f=>f.state==="occupied").length,c=Object.keys(s).length,l={...e==="bottom-right"?{bottom:12,right:100}:e==="top-left"?{top:160,left:12}:e==="bottom-left"?{bottom:12,left:240}:{top:50,right:12},...n??{}};return i.jsxs("div",{style:{position:"fixed",zIndex:90,padding:"6px 10px",background:"rgba(20,20,28,0.85)",color:"#fff",fontFamily:"'Pretendard', system-ui, sans-serif",fontSize:11,borderRadius:8,display:"flex",flexDirection:"column",gap:2,pointerEvents:"none",userSelect:"none",...l},children:[i.jsxs("div",{children:["마을 점수 ",i.jsx("span",{style:{color:"#ffd84a",fontWeight:700},children:t})]}),i.jsxs("div",{children:["주민 ",a,"/",o," (등록 ",c,")"]})]})}class po{ctx=null;masterGain=null;bgmGain=null;sfxGain=null;bgmInterval=null;bgmStep=0;currentBgm=null;bufferCache=new Map;ensure(){if(this.ctx)return!0;if(typeof window>"u"||typeof window.AudioContext>"u")return!1;try{return this.ctx=new window.AudioContext,this.masterGain=this.ctx.createGain(),this.masterGain.connect(this.ctx.destination),this.bgmGain=this.ctx.createGain(),this.sfxGain=this.ctx.createGain(),this.bgmGain.connect(this.masterGain),this.sfxGain.connect(this.masterGain),!0}catch{return!1}}resume(){this.ctx?.state==="suspended"&&this.ctx.resume()}setMasterVolume(n){!this.ensure()||!this.masterGain||(this.masterGain.gain.value=Math.max(0,Math.min(1,n)))}setBgmVolume(n){!this.ensure()||!this.bgmGain||(this.bgmGain.gain.value=Math.max(0,Math.min(1,n)))}setSfxVolume(n){!this.ensure()||!this.sfxGain||(this.sfxGain.gain.value=Math.max(0,Math.min(1,n)))}playSfx(n){if(!this.ensure()||!this.ctx||!this.sfxGain)return;if(n.url){this.playFromUrl(n.url,this.sfxGain,n.volume??1);return}const t=this.ctx.createOscillator(),r=this.ctx.createGain();t.type=n.type??"sine",t.frequency.value=n.freq??440;const s=n.duration??.12,o=this.ctx.currentTime;r.gain.setValueAtTime(0,o),r.gain.linearRampToValueAtTime((n.volume??1)*.3,o+.005),r.gain.exponentialRampToValueAtTime(1e-4,o+s),t.connect(r),r.connect(this.sfxGain),t.start(o),t.stop(o+s+.05)}playBgm(n){if(!this.ensure()||!this.ctx||!this.bgmGain||(this.stopBgm(),!n))return;if(this.currentBgm=n,n.url){this.playFromUrl(n.url,this.bgmGain,n.volume??1,!0);return}const t=n.pattern??[0,4,7,4],r=n.intervalMs??800,s=n.baseFreq??220;this.bgmStep=0;const o=()=>{if(!this.ctx||!this.bgmGain)return;const a=t[this.bgmStep%t.length]??0,c=s*Math.pow(2,a/12),u=this.ctx.createOscillator(),l=this.ctx.createGain();u.type="triangle",u.frequency.value=c;const f=this.ctx.currentTime;l.gain.setValueAtTime(0,f),l.gain.linearRampToValueAtTime((n.volume??1)*.18,f+.04),l.gain.exponentialRampToValueAtTime(1e-4,f+r/1e3*.95),u.connect(l),l.connect(this.bgmGain),u.start(f),u.stop(f+r/1e3+.05),this.bgmStep+=1};o(),this.bgmInterval=window.setInterval(o,r)}stopBgm(){this.bgmInterval!==null&&(window.clearInterval(this.bgmInterval),this.bgmInterval=null),this.currentBgm=null}getCurrentBgmId(){return this.currentBgm?.id??null}async playFromUrl(n,t,r,s=!1){if(this.ctx)try{let o=this.bufferCache.get(n);if(!o){const l=await(await fetch(n)).arrayBuffer();o=await this.ctx.decodeAudioData(l),this.bufferCache.set(n,o)}const a=this.ctx.createBufferSource();a.buffer=o,a.loop=s;const c=this.ctx.createGain();c.gain.value=r,a.connect(c),c.connect(t),a.start()}catch{}}}let ke=null;function ne(){return ke||(ke=new po),ke}const z=q.create((e,n)=>({masterMuted:!1,bgmMuted:!1,sfxMuted:!1,masterVolume:.6,bgmVolume:.4,sfxVolume:.7,currentBgmId:null,setMaster:t=>{e({masterVolume:Math.max(0,Math.min(1,t))}),n().apply()},setBgm:t=>{e({bgmVolume:Math.max(0,Math.min(1,t))}),n().apply()},setSfx:t=>{e({sfxVolume:Math.max(0,Math.min(1,t))}),n().apply()},toggleMaster:()=>{e({masterMuted:!n().masterMuted}),n().apply()},toggleBgm:()=>{e({bgmMuted:!n().bgmMuted}),n().apply()},toggleSfx:()=>{e({sfxMuted:!n().sfxMuted}),n().apply()},playSfx:t=>{const r=n();r.masterMuted||r.sfxMuted||(ne().resume(),ne().playSfx(t))},playBgm:t=>{ne().resume(),ne().playBgm(t),e({currentBgmId:t?.id??null}),n().apply()},stopBgm:()=>{ne().stopBgm(),e({currentBgmId:null})},apply:()=>{const t=n(),r=ne();r.setMasterVolume(t.masterMuted?0:t.masterVolume),r.setBgmVolume(t.bgmMuted?0:t.bgmVolume),r.setSfxVolume(t.sfxMuted?0:t.sfxVolume)},serialize:()=>{const t=n();return{version:1,masterMuted:t.masterMuted,bgmMuted:t.bgmMuted,sfxMuted:t.sfxMuted,masterVolume:t.masterVolume,bgmVolume:t.bgmVolume,sfxVolume:t.sfxVolume}},hydrate:t=>{t&&(e({masterMuted:!!t.masterMuted,bgmMuted:!!t.bgmMuted,sfxMuted:!!t.sfxMuted,masterVolume:typeof t.masterVolume=="number"?t.masterVolume:.6,bgmVolume:typeof t.bgmVolume=="number"?t.bgmVolume:.4,sfxVolume:typeof t.sfxVolume=="number"?t.sfxVolume:.7}),n().apply())}})),mo="gaesup.audio",go="audio",yo="audio.store";function pn(){return z.getState().serialize()}function mn(e){z.getState().hydrate(e)}function gn(e={}){const n=e.id??mo,t=e.saveExtensionId??go,r=e.storeServiceId??yo;return{id:n,name:"GaeSup Audio",version:"0.1.0",runtime:"client",capabilities:["audio"],setup(s){s.save.register(t,{key:t,serialize:pn,hydrate:mn},n),s.services.register(r,{useStore:z,getState:z.getState,setState:z.setState},n),s.events.emit("audio:ready",{pluginId:n,saveExtensionId:t,storeServiceId:r})},dispose(s){s.save.remove(t),s.services.remove(r)}}}const ho=gn(),So=[0,2,4,5,7,9,11],bo=[0,2,3,5,7,8,10];function xo(e){return e==="rain"||e==="storm"||e==="snow"?bo:So}function vo(e){return e<6?"night":e<10?"dawn":e<18?"day":e<22?"dusk":"night"}function Io(e,n){const t=vo(e),r=xo(n),s=t==="night"?174.6:t==="dawn"?220:t==="dusk"?196:261.6,o=t==="day"?700:950,a=[r[0],r[2],r[4],r[2],r[0],r[3],r[1],r[4]];return{id:`bgm.${t}.${n??"unknown"}`,baseFreq:s,intervalMs:o,pattern:a,volume:n==="storm"?.6:1}}function Eo(e=!0){m.useEffect(()=>{if(!e)return;const n=()=>{const s=j.useTimeStore.getState(),o=B.useWeatherStore.getState().current,a=Io(s.time.hour,o?.kind);z.getState().currentBgmId!==a.id&&z.getState().playBgm(a)},t=j.useTimeStore.subscribe((s,o)=>{s.time.hour!==o.time.hour&&n()}),r=B.useWeatherStore.subscribe((s,o)=>{s.current?.kind!==o.current?.kind&&n()});return n(),()=>{t(),r(),z.getState().stopBgm()}},[e])}function wo({position:e="bottom-right",offset:n}){const t=z(d=>d.masterMuted),r=z(d=>d.bgmMuted),s=z(d=>d.sfxMuted),o=z(d=>d.toggleMaster),a=z(d=>d.toggleBgm),c=z(d=>d.toggleSfx),l={...e==="top-right"?{top:50,right:200}:e==="bottom-left"?{bottom:12,left:240}:e==="top-left"?{top:220,left:12}:{bottom:12,right:110},...n??{}},f=(d,p,y)=>i.jsxs("button",{onClick:y,style:{padding:"4px 8px",background:p?"rgba(80,30,30,0.85)":"rgba(20,20,28,0.85)",color:p?"#ff8a8a":"#fff",fontFamily:"'Pretendard', system-ui, sans-serif",fontSize:11,border:"1px solid rgba(255,255,255,0.18)",borderRadius:6,cursor:"pointer"},children:[d,p?" OFF":""]});return i.jsxs("div",{style:{position:"fixed",zIndex:95,display:"flex",gap:4,pointerEvents:"auto",...l},children:[f("M",t,o),f("Bgm",r,a),f("Sfx",s,c)]})}const Co={grass:{freq:320,duration:.07,type:"triangle",volume:.18},sand:{freq:220,duration:.1,type:"sine",volume:.2},snow:{freq:380,duration:.1,type:"triangle",volume:.22},wood:{freq:540,duration:.06,type:"square",volume:.14},stone:{freq:760,duration:.05,type:"square",volume:.16},water:{freq:180,duration:.13,type:"sine",volume:.24}};function ko(e,n){const t=P.TILE_CONSTANTS.GRID_CELL_SIZE,r=P.useBuildingStore.getState().tileGroups;for(const s of r.values())for(const o of s.tiles){const a=(o.size||1)*t/2;if(!(Math.abs(o.position.x-e)>a)&&!(Math.abs(o.position.z-n)>a)){switch(o.objectType){case"water":return"water";case"sand":return"sand";case"snowfield":return"snow";case"grass":return"grass"}return o.shape==="stairs"||o.shape==="ramp"?"wood":"stone"}}return"grass"}function To({strideMeters:e=.65,maxStepsPerSecond:n=6,volume:t=1,resolveSurface:r=ko,enabled:s=!0}={}){const{position:o,isGrounded:a,isMoving:c,speed:u}=te({updateInterval:32}),l=m.useRef({x:o.x,z:o.z}),f=m.useRef(0),d=m.useRef(0);return m.useEffect(()=>{l.current.x=o.x,l.current.z=o.z},[]),Y.useFrame(()=>{if(!s)return;const p=performance.now(),y=o.x-l.current.x,h=o.z-l.current.z;if(l.current.x=o.x,l.current.z=o.z,!a||!c){f.current=0;return}const E=Math.hypot(y,h);if(E<=0||(f.current+=E,f.current<e)||p-d.current<1e3/n)return;f.current=0,d.current=p;const w=r(o.x,o.z),g=Co[w],v=Math.min(1.4,.7+u*.06);z.getState().playSfx({id:`footstep-${w}`,type:g.type??"sine",freq:g.freq??320,duration:g.duration??.08,volume:(g.volume??.2)*t*v})}),null}const Ro="gaesup.character",Po="character",_o="character.store";function yn(){return b.useCharacterStore.getState().serialize()}function hn(e){b.useCharacterStore.getState().hydrate(e)}function Sn(e={}){return O.createStoreDomainPlugin({id:e.id??Ro,name:"GaeSup Character",saveExtensionId:e.saveExtensionId??Po,storeServiceId:e.storeServiceId??_o,store:b.useCharacterStore,readyEvent:"character:ready",capabilities:["character"],serialize:yn,hydrate:hn})}const jo=Sn(),Do=[{key:"body",label:"피부"},{key:"hair",label:"머리"},{key:"hat",label:"모자"},{key:"top",label:"상의"},{key:"bottom",label:"하의"},{key:"shoes",label:"신발"}],Mo=["short","long","cap","bun","spiky"],Ao=["default","smile","wink","sleepy","surprised"],tt=["hat","top","bottom","shoes","face","weapon","accessory"],Lo=(e,n)=>n==="weapon"?e.kind==="weapon"||e.slot==="weapon":e.slot===n&&(e.kind==="characterPart"||e.kind==="weapon");function Oo({toggleKey:e,open:n,onClose:t}={}){const r=typeof n=="boolean",[s,o]=m.useState(!1),a=r?n:s,c=b.useCharacterStore(x=>x.appearance),u=b.useCharacterStore(x=>x.outfits),l=b.useCharacterStore(x=>x.setName),f=b.useCharacterStore(x=>x.setColor),d=b.useCharacterStore(x=>x.setHair),p=b.useCharacterStore(x=>x.setFace),y=b.useCharacterStore(x=>x.equipOutfit),h=b.useCharacterStore(x=>x.resetAppearance),E=ye.useAssetStore(x=>x.ids),w=ye.useAssetStore(x=>x.records),[g,v]=m.useState(""),[C,R]=m.useState(!1),D=m.useMemo(()=>{const x=g.trim().toLowerCase();return tt.reduce((_,N)=>(_[N]=E.map(T=>w[T]).filter(T=>!!T).filter(T=>Lo(T,N)).filter(T=>x?T.tags?.some(M=>M.toLowerCase().includes(x))??!1:!0).filter(T=>!C||T.metadata?.owned!==!1),_),{})},[E,w,C,g]);if(m.useEffect(()=>{if(!e||r)return;const x=_=>{const N=_.target?.tagName?.toLowerCase();if(N==="input"||N==="textarea")return;const T=e.toLowerCase(),M=`Key${e.toUpperCase()}`;_.code!==M&&_.key.toLowerCase()!==T||o(oe=>!oe)};return window.addEventListener("keydown",x),()=>window.removeEventListener("keydown",x)},[e,r]),!a)return null;const F=()=>{r?t?.():o(!1)};return i.jsx("div",{style:{position:"fixed",inset:0,zIndex:130,display:"flex",alignItems:"center",justifyContent:"center",background:"rgba(0,0,0,0.32)",backdropFilter:"blur(4px)",WebkitBackdropFilter:"blur(4px)"},onClick:F,children:i.jsxs("div",{onClick:x=>x.stopPropagation(),style:{width:"min(760px, 92vw)",maxHeight:"88vh",overflowY:"auto",background:"rgba(18,20,28,0.62)",color:"#f3f4f8",borderRadius:14,border:"1px solid rgba(255,255,255,0.12)",boxShadow:"0 12px 28px rgba(0,0,0,0.5), inset 0 1px 0 rgba(255,255,255,0.06)",backdropFilter:"blur(20px) saturate(140%)",WebkitBackdropFilter:"blur(20px) saturate(140%)",fontFamily:"'Pretendard', system-ui, sans-serif",fontSize:13,padding:18},children:[i.jsxs("header",{style:{display:"flex",alignItems:"center",gap:12,marginBottom:14},children:[i.jsx("h2",{style:{margin:0,fontSize:16,fontWeight:600,flex:1},children:"캐릭터 만들기"}),i.jsx("button",{onClick:h,style:Te,children:"기본값"}),i.jsx("button",{onClick:F,style:Te,children:"닫기"})]}),i.jsxs("section",{style:{marginBottom:16},children:[i.jsx("label",{style:ce,children:"이름"}),i.jsx("input",{value:c.name,onChange:x=>l(x.target.value),maxLength:16,style:{width:"100%",padding:"8px 10px",borderRadius:8,border:"1px solid rgba(255,255,255,0.14)",background:"rgba(255,255,255,0.06)",color:"#f3f4f8",fontFamily:"inherit",fontSize:13}})]}),i.jsxs("section",{style:{marginBottom:16},children:[i.jsx("label",{style:ce,children:"색상"}),i.jsx("div",{style:nt,children:Do.map(({key:x,label:_})=>i.jsxs("div",{style:No,children:[i.jsx("span",{style:{flex:1},children:_}),i.jsx("input",{type:"color",value:c.colors[x],onChange:N=>f(x,N.target.value),style:{width:36,height:28,border:"1px solid rgba(255,255,255,0.14)",borderRadius:6,background:"transparent",cursor:"pointer"}})]},x))})]}),i.jsxs("section",{style:{marginBottom:16},children:[i.jsx("label",{style:ce,children:"헤어"}),i.jsx("div",{style:rt,children:Mo.map(x=>i.jsx("button",{onClick:()=>d(x),style:st(c.hair===x),children:b.HAIR_STYLE_LABEL[x]},x))})]}),i.jsxs("section",{style:{marginBottom:16},children:[i.jsx("label",{style:ce,children:"표정"}),i.jsx("div",{style:rt,children:Ao.map(x=>i.jsx("button",{onClick:()=>p(x),style:st(c.face===x),children:b.FACE_STYLE_LABEL[x]},x))})]}),i.jsxs("section",{children:[i.jsxs("div",{style:Fo,children:[i.jsx("label",{style:{...ce,marginBottom:0},children:"장착 슬롯"}),i.jsx("input",{value:g,onChange:x=>v(x.target.value),placeholder:"태그 검색",style:zo}),i.jsxs("label",{style:Uo,children:[i.jsx("input",{type:"checkbox",checked:C,onChange:x=>R(x.target.checked)}),"보유만"]})]}),i.jsx("div",{style:nt,children:tt.map(x=>i.jsxs("div",{style:Bo,children:[i.jsxs("div",{style:Go,children:[i.jsx("span",{children:b.OUTFIT_SLOT_LABEL[x]}),i.jsx("span",{style:{color:u[x]?"#7adf90":"rgba(243,244,248,0.45)"},children:u[x]??"비어있음"}),i.jsx("button",{onClick:()=>y(x,null),style:Te,children:"비우기"})]}),i.jsxs("div",{style:Vo,children:[D[x].map(_=>i.jsxs("button",{onClick:()=>y(x,_.id),style:Wo(u[x]===_.id),children:[i.jsx(lt.AssetPreviewCanvas,{asset:_,size:58}),i.jsx("span",{style:$o,children:_.name})]},_.id)),D[x].length===0&&i.jsx("span",{style:qo,children:"사용 가능한 에셋 없음"})]})]},x))})]})]})})}const ce={display:"block",marginBottom:6,fontSize:11.5,fontWeight:600,letterSpacing:.4,textTransform:"uppercase",color:"rgba(243,244,248,0.62)"},nt={display:"grid",gridTemplateColumns:"repeat(2, minmax(0, 1fr))",gap:6},No={display:"flex",alignItems:"center",gap:8,padding:"6px 10px",background:"rgba(255,255,255,0.04)",border:"1px solid rgba(255,255,255,0.10)",borderRadius:8},rt={display:"flex",flexWrap:"wrap",gap:6},st=e=>({padding:"6px 12px",borderRadius:999,border:e?"1px solid #ffd84a":"1px solid rgba(255,255,255,0.14)",background:e?"rgba(255,216,74,0.12)":"rgba(255,255,255,0.04)",color:"#f3f4f8",cursor:"pointer",fontFamily:"inherit",fontSize:12,fontWeight:500}),Te={padding:"6px 12px",borderRadius:8,border:"1px solid rgba(255,255,255,0.14)",background:"rgba(255,255,255,0.06)",color:"#f3f4f8",cursor:"pointer",fontFamily:"inherit",fontSize:12,fontWeight:500},Fo={display:"flex",alignItems:"center",gap:8,marginBottom:8},zo={flex:1,minWidth:120,padding:"6px 9px",borderRadius:8,border:"1px solid rgba(255,255,255,0.14)",background:"rgba(255,255,255,0.06)",color:"#f3f4f8",fontFamily:"inherit",fontSize:12},Uo={display:"inline-flex",alignItems:"center",gap:5,color:"rgba(243,244,248,0.72)",fontSize:12},Bo={padding:8,background:"rgba(255,255,255,0.04)",border:"1px solid rgba(255,255,255,0.10)",borderRadius:10},Go={display:"flex",alignItems:"center",gap:8,marginBottom:8},Vo={display:"grid",gridTemplateColumns:"repeat(2, minmax(0, 1fr))",gap:6},Wo=e=>({display:"grid",gridTemplateColumns:"58px minmax(0, 1fr)",alignItems:"center",gap:8,minHeight:70,padding:6,borderRadius:10,border:e?"1px solid #7bd3a7":"1px solid rgba(255,255,255,0.10)",background:e?"rgba(123,211,167,0.14)":"rgba(255,255,255,0.035)",color:"#f3f4f8",cursor:"pointer",fontFamily:"inherit",textAlign:"left"}),$o={overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",fontSize:12,fontWeight:600},qo={gridColumn:"1 / -1",padding:"10px 8px",color:"rgba(243,244,248,0.45)",fontSize:12};function Ho(e){return m.useMemo(()=>{switch(e){case"long":return{geometry:new I.SphereGeometry(.28,12,10,0,Math.PI*2,0,Math.PI*.65),position:[0,-.05,0],scale:[1.05,1.55,1.05]};case"cap":return{geometry:new I.CylinderGeometry(.32,.34,.18,16),position:[0,.1,0],scale:[1,1,1]};case"bun":return{geometry:new I.SphereGeometry(.22,12,10),position:[0,.18,-.05],scale:[1,1,1]};case"spiky":return{geometry:new I.ConeGeometry(.32,.36,8),position:[0,.15,0],scale:[1,1,1]};case"short":default:return{geometry:new I.SphereGeometry(.3,12,10,0,Math.PI*2,0,Math.PI*.5),position:[0,.05,0],scale:[1,1,1]}}},[e])}function Xo({headHeight:e=1.55,enabled:n=!0,opacity:t=1}={}){const r=m.useRef(null),s=b.useCharacterStore(d=>d.appearance),o=b.useCharacterStore(d=>d.outfits),{position:a,rotation:c}=te({updateInterval:16}),u=Ho(s.hair);if(Y.useFrame(()=>{const d=r.current;d&&(d.position.set(a.x,a.y+e,a.z),d.rotation.set(0,c.y,0))}),!n)return null;const l=!!o.hat,f=I.MathUtils.clamp(t,0,1);return i.jsxs("group",{ref:r,dispose:null,children:[!l&&i.jsxs("mesh",{position:u.position,scale:u.scale,castShadow:!0,children:[i.jsx("primitive",{object:u.geometry,attach:"geometry"}),i.jsx("meshStandardMaterial",{color:s.colors.hair,roughness:.85,metalness:.05,transparent:f<1,opacity:f})]}),l&&i.jsxs("group",{position:[0,.1,0],children:[i.jsxs("mesh",{castShadow:!0,children:[i.jsx("cylinderGeometry",{args:[.34,.34,.22,18]}),i.jsx("meshStandardMaterial",{color:s.colors.hat,roughness:.7,metalness:.05,transparent:f<1,opacity:f})]}),i.jsxs("mesh",{position:[0,-.1,0],children:[i.jsx("cylinderGeometry",{args:[.5,.5,.04,24]}),i.jsx("meshStandardMaterial",{color:s.colors.hat,roughness:.7,metalness:.05,transparent:f<1,opacity:f})]})]}),i.jsx(Yo,{style:s.face,opacity:f})]})}function Yo({style:e,opacity:n}){const t=m.useMemo(()=>{switch(e){case"smile":return"#ff8aa0";case"wink":return"#ffb04a";case"sleepy":return"#7d8ec8";case"surprised":return"#ffe066";default:return"#ffb6a8"}},[e]);return i.jsxs("group",{position:[0,-.18,.32],children:[i.jsxs("mesh",{position:[-.13,0,0],children:[i.jsx("sphereGeometry",{args:[.045,8,8]}),i.jsx("meshBasicMaterial",{color:t,transparent:!0,opacity:n*.6})]}),i.jsxs("mesh",{position:[.13,0,0],children:[i.jsx("sphereGeometry",{args:[.045,8,8]}),i.jsx("meshBasicMaterial",{color:t,transparent:!0,opacity:n*.6})]})]})}const Ko=e=>e?.url?e.kind==="characterPart"||e.kind==="weapon":!1,Qo=e=>({id:e.id,...e.slot?{slot:e.slot}:{},url:e.url,...e.colors?.primary?{color:e.colors.primary}:{}});function Zo({baseParts:e=[],outfits:n,assets:t}){const r=Object.values(n).map(a=>a?t[a]:void 0).filter(Ko).map(Qo);if(r.length===0)return e.map(a=>({...a}));const s=new Set(r.map(a=>a.slot).filter(Boolean)),o=e.filter(a=>!a.slot||!s.has(a.slot)).map(a=>({...a}));for(const a of r)o.some(c=>c.url===a.url&&c.slot===a.slot)||o.push(a);return o}function Jo({capacity:e=64,step:n=.55,lifetime:t=9,size:r=.34,y:s=.02,color:o="#1a1612"}={}){const a=m.useRef(null),{position:c,isMoving:u,isGrounded:l}=te({updateInterval:32}),f=m.useMemo(()=>new I.Color(o),[o]),d=m.useMemo(()=>Array.from({length:e},()=>({x:0,z:0,bornAt:-1/0,side:1})),[e]),p=m.useRef(null),y=m.useRef(0),h=m.useRef(1),E=m.useMemo(()=>{const C=new I.PlaneGeometry(1,1);return C.rotateX(-Math.PI/2),C},[]),w=m.useMemo(()=>new I.MeshBasicMaterial({color:f,transparent:!0,opacity:.42,depthWrite:!1,polygonOffset:!0,polygonOffsetFactor:-1,polygonOffsetUnits:-1}),[f]);m.useEffect(()=>()=>{E.dispose(),w.dispose()},[E,w]);const g=m.useMemo(()=>new I.Object3D,[]),v=m.useMemo(()=>new I.Color,[]);return Y.useFrame(C=>{const R=a.current;if(!R)return;const D=C.clock.elapsedTime;if(l&&u){const x=p.current,_=c.x-(x?.x??c.x),N=c.z-(x?.z??c.z),T=Math.hypot(_,N);if(!x||T>=n){const M=d[y.current];M&&(M.x=c.x,M.z=c.z,M.bornAt=D,M.side=h.current,h.current=h.current===1?-1:1,y.current=(y.current+1)%e,p.current={x:c.x,z:c.z})}}let F=0;for(let x=0;x<e;x++){const _=d[x];if(!_)continue;const N=D-_.bornAt;if(N<0||N>t)continue;const T=1-N/t;g.position.set(_.x+_.side*.07,s,_.z),g.rotation.set(0,0,0),g.scale.set(r,1,r*1.4),g.updateMatrix(),R.setMatrixAt(F,g.matrix),v.copy(f).multiplyScalar(.6+T*.4),R.setColorAt(F,v),F++}R.count=F,R.instanceMatrix.needsUpdate=!0,R.instanceColor&&(R.instanceColor.needsUpdate=!0)}),i.jsx("instancedMesh",{ref:a,args:[E,w,e],frustumCulled:!1,renderOrder:1})}const ei={ko:"한국어",en:"English",ja:"日本語"},ge="ko";function ti(){if(typeof navigator>"u")return ge;const e=(navigator.language||ge).slice(0,2).toLowerCase();return e==="ko"||e==="en"||e==="ja"?e:ge}function Re(e,n){return n?e.replace(/\{(\w+)\}/g,(t,r)=>{const s=n[r];return s==null?`{${r}}`:String(s)}):e}const K=q.create((e,n)=>({locale:ti(),bundle:{ko:{},en:{},ja:{}},setLocale:t=>e({locale:t}),registerMessages:(t,r)=>{const s=n().bundle;e({bundle:{...s,[t]:{...s[t],...r}}})},registerBundle:t=>{const r=n().bundle,s={...r};Object.keys(t).forEach(o=>{const a=t[o];a&&(s[o]={...r[o],...a})}),e({bundle:s})},t:(t,r)=>{const{locale:s,bundle:o}=n(),a=o[s]?.[t];if(a!==void 0)return Re(a,r);const c=o[ge]?.[t];return Re(c!==void 0?c:t,r)},serialize:()=>({version:1,locale:n().locale}),hydrate:t=>{!t||t.version!==1||e({locale:t.locale})}}));function ni(e,n){return K.getState().t(e,n)}const ri="gaesup.i18n",si="i18n",oi="i18n.store";function bn(){return K.getState().serialize()}function xn(e){K.getState().hydrate(e)}function vn(e={}){return O.createStoreDomainPlugin({id:e.id??ri,name:"GaeSup i18n",saveExtensionId:e.saveExtensionId??si,storeServiceId:e.storeServiceId??oi,store:K,readyEvent:"i18n:ready",capabilities:["i18n"],serialize:bn,hydrate:xn})}const ii=vn();function ai(){const e=K(t=>t.locale),n=K(t=>t.bundle);return m.useCallback((t,r)=>{const s=n[e]?.[t];if(s!==void 0)return Pe(s,r);const o=n.ko?.[t];return Pe(o!==void 0?o:t,r)},[e,n])}function ci(){const e=K(t=>t.locale),n=K(t=>t.setLocale);return{locale:e,setLocale:n}}function Pe(e,n){return n?e.replace(/\{(\w+)\}/g,(t,r)=>{const s=n[r];return s==null?`{${r}}`:String(s)}):e}const li=[{id:"jump",label:"점프",key:" "},{id:"use",label:"사용",key:"F"}];function ui(){return typeof window>"u"||typeof window.matchMedia!="function"?!1:window.matchMedia("(pointer: coarse)").matches}function ot(e,n){if(typeof window>"u")return;const t=/^[a-zA-Z]$/.test(n)?`Key${n.toUpperCase()}`:n===" "?"Space":n,r=new KeyboardEvent(e,{key:n===" "?" ":n.toLowerCase(),code:t,bubbles:!0});window.dispatchEvent(r)}function di({forceVisible:e=!1,radius:n=60,deadzone:t=.18,runThreshold:r=.8,actions:s=li}={}){const[o,a]=m.useState(!1),c=P.useInputBackend(),u=m.useRef(null),l=m.useRef(null),f=m.useRef({pointerId:-1,cx:0,cy:0,forward:!1,backward:!1,leftward:!1,rightward:!1,run:!1});return m.useEffect(()=>{a(e||ui())},[e]),m.useEffect(()=>{if(!o)return;const d=u.current,p=l.current;if(!d||!p)return;const y=()=>{const g=f.current,v={};g.forward&&(v.forward=!1),g.backward&&(v.backward=!1),g.leftward&&(v.leftward=!1),g.rightward&&(v.rightward=!1),g.run&&(v.shift=!1),g.forward=g.backward=g.leftward=g.rightward=g.run=!1,Object.keys(v).length>0&&c.updateKeyboard(v),p.style.transform="translate(-50%, -50%)",f.current.pointerId=-1},h=g=>{g.preventDefault();const v=d.getBoundingClientRect();f.current.cx=v.left+v.width/2,f.current.cy=v.top+v.height/2,f.current.pointerId=g.pointerId,d.setPointerCapture(g.pointerId),E(g)},E=g=>{if(g.pointerId!==f.current.pointerId)return;const v=g.clientX-f.current.cx,C=g.clientY-f.current.cy,R=Math.hypot(v,C),D=Math.min(R,n),F=Math.atan2(C,v),x=Math.cos(F)*D,_=Math.sin(F)*D;p.style.transform=`translate(calc(-50% + ${x}px), calc(-50% + ${_}px))`;const N=D/n,T=f.current,M={};if(N<t)T.forward&&(M.forward=!1,T.forward=!1),T.backward&&(M.backward=!1,T.backward=!1),T.leftward&&(M.leftward=!1,T.leftward=!1),T.rightward&&(M.rightward=!1,T.rightward=!1),T.run&&(M.shift=!1,T.run=!1);else{const oe=Math.cos(F),ze=Math.sin(F),Se=ze<-.35,be=ze>.35,xe=oe<-.35,ve=oe>.35,Ie=N>=r;T.forward!==Se&&(M.forward=Se,T.forward=Se),T.backward!==be&&(M.backward=be,T.backward=be),T.leftward!==xe&&(M.leftward=xe,T.leftward=xe),T.rightward!==ve&&(M.rightward=ve,T.rightward=ve),T.run!==Ie&&(M.shift=Ie,T.run=Ie)}Object.keys(M).length>0&&c.updateKeyboard(M)},w=g=>{g.pointerId===f.current.pointerId&&y()};return d.addEventListener("pointerdown",h),d.addEventListener("pointermove",E),d.addEventListener("pointerup",w),d.addEventListener("pointercancel",w),d.addEventListener("pointerleave",w),()=>{d.removeEventListener("pointerdown",h),d.removeEventListener("pointermove",E),d.removeEventListener("pointerup",w),d.removeEventListener("pointercancel",w),d.removeEventListener("pointerleave",w),y()}},[o,n,t,r,c]),o?i.jsxs("div",{style:{position:"fixed",inset:0,zIndex:90,pointerEvents:"none",fontFamily:"'Pretendard', system-ui, sans-serif"},children:[i.jsx("div",{ref:u,style:{position:"absolute",left:24,bottom:24,width:n*2,height:n*2,borderRadius:"50%",border:"1px solid rgba(255,255,255,0.25)",background:"rgba(20,22,30,0.32)",backdropFilter:"blur(14px) saturate(140%)",WebkitBackdropFilter:"blur(14px) saturate(140%)",touchAction:"none",pointerEvents:"auto"},children:i.jsx("div",{ref:l,style:{position:"absolute",left:"50%",top:"50%",width:n*.85,height:n*.85,borderRadius:"50%",background:"rgba(255,255,255,0.55)",boxShadow:"0 4px 12px rgba(0,0,0,0.28)",transform:"translate(-50%, -50%)",transition:"transform 0.04s linear",pointerEvents:"none"}})}),i.jsx("div",{style:{position:"absolute",right:20,bottom:32,display:"grid",gridTemplateColumns:"repeat(2, auto)",gap:12,pointerEvents:"auto"},children:s.map(d=>i.jsx(fi,{action:d},d.id))})]}):null}function fi({action:e}){const[n,t]=m.useState(!1),r=()=>{t(!0),e.key&&ot("keydown",e.key),e.onPress?.()},s=()=>{t(!1),e.key&&ot("keyup",e.key),e.onRelease?.()};return i.jsx("button",{type:"button",onPointerDown:o=>{o.preventDefault(),r()},onPointerUp:o=>{o.preventDefault(),s()},onPointerCancel:s,onPointerLeave:()=>{n&&s()},style:{width:64,height:64,borderRadius:"50%",border:"1px solid rgba(255,255,255,0.22)",background:n?"rgba(255,216,74,0.32)":"rgba(20,22,30,0.42)",color:"#f3f4f8",backdropFilter:"blur(14px) saturate(140%)",WebkitBackdropFilter:"blur(14px) saturate(140%)",fontFamily:"inherit",fontSize:13,fontWeight:600,cursor:"pointer",touchAction:"none",userSelect:"none"},children:e.label})}const de="outdoor",_e=e=>new Promise(n=>setTimeout(n,e)),pi=220,mi=80,gi=240,W=q.create((e,n)=>({current:de,pending:null,scenes:{[de]:{id:de,name:"Outdoor",interior:!1}},transition:{progress:0,color:"#000000",active:!1},lastReturnPoint:null,registerScene:t=>e(r=>r.scenes[t.id]?r:{scenes:{...r.scenes,[t.id]:t}}),unregisterScene:t=>e(r=>{if(t===de||!r.scenes[t])return r;const s={...r.scenes};return delete s[t],{scenes:s}}),setTransition:t=>e(r=>({transition:{...r.transition,...t}})),setReturnPoint:t=>e({lastReturnPoint:t}),goTo:async(t,r)=>{const s=n();if(s.pending||t===s.current&&!r?.entry)return;const o=s.scenes[t];if(!o){console.warn(`[scene] Unknown scene "${t}". Did you forget to register it?`);return}const c=o.interior??!1?"#0d0d10":"#f5f5f5";e({pending:t,transition:{active:!0,color:c,progress:0}});const u=performance.now();for(;;){const f=Math.min(1,(performance.now()-u)/pi);if(n().setTransition({progress:f}),f>=1)break;await _e(16)}r?.saveReturn&&e({lastReturnPoint:r.saveReturn}),e({current:t}),await _e(mi);const l=performance.now();for(;;){const f=Math.min(1,(performance.now()-l)/gi);if(n().setTransition({progress:1-f}),f>=1)break;await _e(16)}e({pending:null,transition:{active:!1,color:c,progress:0}})},serialize:()=>({version:1,current:n().current}),hydrate:t=>{!t||t.version!==1||n().scenes[t.current]&&e({current:t.current,pending:null})}})),yi="gaesup.scene",hi="scene",Si="scene.store";function In(){return W.getState().serialize()}function En(e){W.getState().hydrate(e)}function wn(e={}){return O.createStoreDomainPlugin({id:e.id??yi,name:"GaeSup Scene",saveExtensionId:e.saveExtensionId??hi,storeServiceId:e.storeServiceId??Si,store:W,readyEvent:"scene:ready",capabilities:["scene"],serialize:In,hydrate:En})}const bi=wn();function xi(e,n){if(e===n)return!0;if(e.size!==n.size)return!1;for(const t of e)if(!n.has(t))return!1;return!0}const $=q.create(e=>({rooms:new Map,portals:new Map,currentRoomId:null,visibleRoomIds:new Set,initializedSceneId:null,registerRoom:n=>e(t=>{const r=new Map(t.rooms);return r.set(n.id,n),{rooms:r}}),unregisterRoom:n=>e(t=>{if(!t.rooms.has(n))return t;const r=new Map(t.rooms);return r.delete(n),{rooms:r,currentRoomId:t.currentRoomId===n?null:t.currentRoomId}}),registerPortal:n=>e(t=>{const r=new Map(t.portals);return r.set(n.id,n),{portals:r}}),unregisterPortal:n=>e(t=>{if(!t.portals.has(n))return t;const r=new Map(t.portals);return r.delete(n),{portals:r}}),setVisibleRooms:(n,t,r)=>e(s=>s.initializedSceneId===n&&s.currentRoomId===t&&xi(s.visibleRoomIds,r)?s:{initializedSceneId:n,currentRoomId:t,visibleRoomIds:r}),reset:()=>e({currentRoomId:null,visibleRoomIds:new Set,initializedSceneId:null})}));function vi({zIndex:e=9999}={}){const n=W(t=>t.transition);return!n.active&&n.progress<=.001?null:i.jsx("div",{"aria-hidden":!0,style:{position:"fixed",inset:0,background:n.color,opacity:n.progress,pointerEvents:n.progress>.5?"auto":"none",zIndex:e,transition:"background-color 80ms linear"}})}function Ii({scene:e,children:n}){const t=W(o=>o.registerScene),r=W(o=>o.unregisterScene),s=W(o=>o.current);return m.useEffect(()=>(t(e),()=>r(e.id)),[e,t,r]),s!==e.id?null:i.jsx(i.Fragment,{children:n})}function Ei({position:e,sceneId:n,entry:t,exitOverride:r,radius:s=1.4,cooldownMs:o=800,color:a="#5a8acf",label:c}){const u=W(E=>E.goTo),l=W(E=>E.current),{teleport:f}=Ne(),{position:d}=te({updateInterval:50}),p=m.useRef(0),y=m.useMemo(()=>new I.CylinderGeometry(s,s,.08,28),[s]);m.useEffect(()=>()=>y.dispose(),[y]),Y.useFrame(()=>{const E=performance.now();if(E-p.current<o)return;const w=d.x-e[0],g=d.z-e[2];w*w+g*g>s*s||(p.current=E,l!==n&&h())});async function h(){const E=r??{position:[e[0],e[1],e[2]]};await u(n,{entry:t,saveReturn:E});const w=new I.Vector3(t.position[0],t.position[1],t.position[2]);f(w)}return i.jsxs("group",{position:e,children:[i.jsx("mesh",{rotation:[0,0,0],geometry:y,children:i.jsx("meshStandardMaterial",{color:a,emissive:a,emissiveIntensity:.35,transparent:!0,opacity:.6})}),c&&i.jsxs("mesh",{position:[0,1.3,0],children:[i.jsx("boxGeometry",{args:[.04,.6,.04]}),i.jsx("meshStandardMaterial",{color:a,emissive:a,emissiveIntensity:.4})]})]})}function wi({sceneId:e,roomId:n,bounds:t,children:r}){const s=W(l=>l.current),o=$(l=>l.registerRoom),a=$(l=>l.unregisterRoom),c=$(l=>l.initializedSceneId),u=$(l=>l.visibleRoomIds);return m.useEffect(()=>(o({id:n,sceneId:e,bounds:t}),()=>a(n)),[n,e,t,o,a]),s!==e?null:c!==e?i.jsx(i.Fragment,{children:r}):u.has(n)?i.jsx(i.Fragment,{children:r}):null}function Ci({id:e,sceneId:n,fromRoomId:t,toRoomId:r,position:s,radius:o,revealDistance:a}){const c=$(l=>l.registerPortal),u=$(l=>l.unregisterPortal);return m.useEffect(()=>(c({id:e,sceneId:n,fromRoomId:t,toRoomId:r,position:s,...o!==void 0?{radius:o}:{},...a!==void 0?{revealDistance:a}:{}}),()=>u(e)),[e,n,t,r,s,o,a,c,u]),null}const ki=.12;function Ti(e,n){return e.x>=n.min[0]&&e.x<=n.max[0]&&e.y>=n.min[1]&&e.y<=n.max[1]&&e.z>=n.min[2]&&e.z<=n.max[2]}function Cn(e,n,t){for(const r of n)if(r.sceneId===e&&Ti(t,r.bounds))return r.id;return null}function Ri(e){const n=e.rooms.filter(o=>o.sceneId===e.sceneId);if(n.length===0)return new Set;const t=Cn(e.sceneId,n,e.position);if(!t)return new Set(n.map(o=>o.id));const r=new Set([t]),s=e.portals.filter(o=>o.sceneId===e.sceneId);for(const o of s){const a=o.revealDistance??3.8,c=e.position.x-o.position[0],u=e.position.y-o.position[1],l=e.position.z-o.position[2];c*c+u*u+l*l>a*a||(o.fromRoomId===t?r.add(o.toRoomId):o.toRoomId===t&&r.add(o.fromRoomId))}return r}function Pi(){const e=W(c=>c.current),n=$(c=>c.rooms),t=$(c=>c.portals),r=$(c=>c.setVisibleRooms),s=$(c=>c.reset),{position:o}=te({updateInterval:50}),a=m.useRef(0);return m.useEffect(()=>s,[s]),Y.useFrame((c,u)=>{if(a.current+=Math.max(0,u),a.current<ki)return;a.current=0;const l=Array.from(n.values()),f=Array.from(t.values()),d=Cn(e,l,o),p=Ri({sceneId:e,rooms:l,portals:f,position:o});r(e,d,p)}),null}const _i=new I.Color("#0a1430"),ji=new I.Color("#ffb377"),Di=new I.Color("#ff7a52"),Mi=new I.Color("#5b6975"),Ai=new I.Color("#dde7f0"),Li=new I.Color("#3b4452");function Oi(e,n){const t=e+n/60;return t<5?{t:0,phase:"night"}:t<7?{t:(t-5)/2,phase:"dawn"}:t<17?{t:1,phase:"day"}:t<19?{t:1-(t-17)/2,phase:"dusk"}:{t:0,phase:"night"}}function Ni({color:e="#cfd8e3",near:n=35,far:t=220,enabled:r=!0}={}){const s=Y.useThree(l=>l.scene),o=j.useTimeStore(l=>l.time.hour),a=j.useTimeStore(l=>l.time.minute),c=B.useWeatherStore(l=>l.current),u=m.useRef(void 0);return m.useEffect(()=>{if(u.current===void 0&&(u.current=s.fog instanceof I.Fog?s.fog.clone():null),!r){s.fog=u.current?u.current.clone():null;return}const l=new I.Color(e),f=Oi(o,a),d=l.clone();f.phase==="night"?d.lerp(_i,.25):f.phase==="dawn"?d.lerp(ji,.18*(1-f.t)):f.phase==="dusk"&&d.lerp(Di,.18*(1-f.t));let p=n,y=t;if(f.phase==="night"?(p=n*.45,y=t*.55):(f.phase==="dawn"||f.phase==="dusk")&&(p=n*(.55+.45*f.t),y=t*(.7+.3*f.t)),c){const h=Math.max(0,Math.min(1,c.intensity));c.kind==="rain"?(d.lerp(Mi,.12+h*.1),p*=.7-h*.2,y*=.65-h*.2):c.kind==="storm"?(d.lerp(Li,.16+h*.12),p*=.55-h*.2,y*=.5-h*.2):c.kind==="snow"&&(d.lerp(Ai,.12+h*.08),p*=.75,y*=.7)}p=Math.max(2,p),y=Math.max(p+5,y),s.fog instanceof I.Fog?(s.fog.color.copy(d),s.fog.near=p,s.fog.far=y):s.fog=new I.Fog(d.getHex(),p,y)},[s,e,n,t,r,o,a,c?.kind,c?.intensity]),m.useEffect(()=>()=>{s.fog=u.current?u.current.clone():null},[s]),null}const Fi=[{hour:0,sunColor:"#1f2a48",ambientColor:"#1a1f2e",sunIntensity:.05,ambientIntensity:.18,azimuth:-Math.PI/2,elevation:-.3},{hour:5,sunColor:"#3b3a5a",ambientColor:"#28304a",sunIntensity:.15,ambientIntensity:.22,azimuth:-Math.PI/3,elevation:-.05},{hour:7,sunColor:"#ffb27a",ambientColor:"#7a8aa6",sunIntensity:.55,ambientIntensity:.3,azimuth:-Math.PI/4,elevation:.25},{hour:10,sunColor:"#fff1c8",ambientColor:"#aab4c8",sunIntensity:.85,ambientIntensity:.34,azimuth:-Math.PI/8,elevation:.7},{hour:13,sunColor:"#ffffff",ambientColor:"#b6c2d8",sunIntensity:1.05,ambientIntensity:.38,azimuth:0,elevation:1.05},{hour:16,sunColor:"#ffe0a8",ambientColor:"#a8b4cc",sunIntensity:.85,ambientIntensity:.34,azimuth:Math.PI/6,elevation:.65},{hour:18,sunColor:"#ff9a5a",ambientColor:"#806a8a",sunIntensity:.55,ambientIntensity:.28,azimuth:Math.PI/3,elevation:.18},{hour:20,sunColor:"#5a3f6a",ambientColor:"#34304a",sunIntensity:.18,ambientIntensity:.22,azimuth:Math.PI/2,elevation:-.05},{hour:24,sunColor:"#1f2a48",ambientColor:"#1a1f2e",sunIntensity:.05,ambientIntensity:.18,azimuth:3*Math.PI/4,elevation:-.3}],it={spring:new I.Color("#fff0f5"),summer:new I.Color("#fff5d8"),autumn:new I.Color("#ffd9b0"),winter:new I.Color("#dfe8f5")},at={sunny:{sun:1,ambient:1,tint:new I.Color("#ffffff")},cloudy:{sun:.55,ambient:.95,tint:new I.Color("#cfd6e2")},rain:{sun:.3,ambient:.85,tint:new I.Color("#90a0b8")},snow:{sun:.65,ambient:1.1,tint:new I.Color("#dfeaf5")},storm:{sun:.2,ambient:.75,tint:new I.Color("#5a6a82")}};function zi(e,n){const t=e,r=(n%24+24)%24;let s=t[0],o=t[t.length-1];for(let u=0;u<t.length-1;u+=1){const l=t[u],f=t[u+1];if(r>=l.hour&&r<=f.hour){s=l,o=f;break}}const a=Math.max(1e-4,o.hour-s.hour),c=I.MathUtils.clamp((r-s.hour)/a,0,1);return{hour:r,sunColor:s.sunColor,ambientColor:s.ambientColor,sunIntensity:I.MathUtils.lerp(s.sunIntensity,o.sunIntensity,c),ambientIntensity:I.MathUtils.lerp(s.ambientIntensity,o.ambientIntensity,c),azimuth:I.MathUtils.lerp(s.azimuth,o.azimuth,c),elevation:I.MathUtils.lerp(s.elevation,o.elevation,c)}}function Ui({rigDistance:e=60,castShadow:n=!0,shadowMapSize:t=1024,keyframes:r,damping:s=.12}={}){const o=m.useRef(null),a=m.useRef(null),c=m.useMemo(()=>(r??Fi).slice().sort((y,h)=>y.hour-h.hour),[r]),u=m.useMemo(()=>new I.Color,[]),l=m.useMemo(()=>new I.Color,[]),f=m.useMemo(()=>new I.Color,[]),d=m.useMemo(()=>new I.Color,[]);return Y.useFrame(()=>{const p=o.current,y=a.current;if(!p||!y)return;const h=j.useTimeStore.getState().time,E=B.useWeatherStore.getState().current,w=E?.kind??"sunny",g=I.MathUtils.clamp(E?.intensity??.5,0,1),v=at[w]??at.sunny,C=it[h.season]??it.spring,R=zi(c,h.hour+h.minute/60);f.set(R.sunColor).lerp(C,.18).lerp(v.tint,.35+.25*g),d.set(R.ambientColor).lerp(C,.2).lerp(v.tint,.3+.3*g);const D=I.MathUtils.clamp(s,.01,1);u.copy(p.color).lerp(f,D),l.copy(y.color).lerp(d,D),p.color.copy(u),y.color.copy(l);const F=I.MathUtils.lerp(1,v.sun,.5+.5*g),x=I.MathUtils.lerp(1,v.ambient,.5+.5*g);p.intensity=I.MathUtils.lerp(p.intensity,R.sunIntensity*F,D),y.intensity=I.MathUtils.lerp(y.intensity,R.ambientIntensity*x,D);const _=Math.cos(R.elevation),N=Math.sin(R.elevation),T=Math.cos(R.azimuth)*_*e,M=Math.sin(R.azimuth)*_*e,oe=Math.max(2,N*e);p.position.set(T,oe,M),p.target.position.set(0,0,0),p.target.updateMatrixWorld()}),i.jsxs(i.Fragment,{children:[i.jsx("ambientLight",{ref:a,intensity:.3,color:"#b6c2d8"}),i.jsx("directionalLight",{ref:o,castShadow:n,"shadow-mapSize":[t,t],"shadow-normalBias":.06,"shadow-camera-near":1,"shadow-camera-far":Math.max(120,e*2),"shadow-camera-top":90,"shadow-camera-right":90,"shadow-camera-bottom":-90,"shadow-camera-left":-90,intensity:.8,color:"#ffffff",position:[20,30,10]})]})}exports.Camera=je.Camera;exports.DEFAULT_MOTIONS_INPUT_EXTENSION_ID=P.DEFAULT_MOTIONS_INPUT_EXTENSION_ID;exports.DEFAULT_MOTIONS_PHYSICS_EXTENSION_ID=P.DEFAULT_MOTIONS_PHYSICS_EXTENSION_ID;exports.DEFAULT_MOTIONS_RUNTIME_SERVICE_ID=P.DEFAULT_MOTIONS_RUNTIME_SERVICE_ID;exports.GaesupRuntimeProvider=P.GaesupRuntimeProvider;exports.MOTIONS_TELEPORT_EVENT=P.MOTIONS_TELEPORT_EVENT;exports.applyToonToScene=P.applyToonToScene;exports.createMotionsPlugin=P.createMotionsPlugin;exports.createMotionsRuntime=P.createMotionsRuntime;exports.createToonMaterial=P.createToonMaterial;exports.disposeToonGradients=P.disposeToonGradients;exports.getDefaultToonMode=P.getDefaultToonMode;exports.getToonGradient=P.getToonGradient;exports.motionsPlugin=P.motionsPlugin;exports.requestMotionsTeleport=P.requestMotionsTeleport;exports.resolveRuntimeInputBackend=P.resolveRuntimeInputBackend;exports.setDefaultToonMode=P.setDefaultToonMode;exports.useBuildingStore=P.useBuildingStore;exports.useGaesupRuntime=P.useGaesupRuntime;exports.useGaesupRuntimeRevision=P.useGaesupRuntimeRevision;exports.useInputBackend=P.useInputBackend;exports.useStateSystem=P.useStateSystem;exports.BugSpot=L.BugSpot;exports.DEFAULT_RUNTIME_SAVE_DIAGNOSTICS_SERVICE_ID=L.DEFAULT_RUNTIME_SAVE_DIAGNOSTICS_SERVICE_ID;exports.DEFAULT_WORLD_SAVE_ENVIRONMENT=L.DEFAULT_WORLD_SAVE_ENVIRONMENT;exports.FishSpot=L.FishSpot;exports.RUNTIME_SAVE_DIAGNOSTIC_EVENT=L.RUNTIME_SAVE_DIAGNOSTIC_EVENT;exports.TreeObject=L.TreeObject;exports.createCameraSaveDataFromDomain=L.createCameraSaveDataFromDomain;exports.createGaesupRuntime=L.createGaesupRuntime;exports.createRuntimeSaveDiagnostics=L.createRuntimeSaveDiagnostics;exports.createSaveDataFromSaveSystem=L.createSaveDataFromSaveSystem;exports.createWorldDataFromSaveDomains=L.createWorldDataFromSaveDomains;exports.formatRuntimeSaveDiagnostic=L.formatRuntimeSaveDiagnostic;exports.getToolEvents=L.getToolEvents;exports.useAutoSave=L.useAutoSave;exports.useEquippedToolKind=L.useEquippedToolKind;exports.useLoadOnMount=L.useLoadOnMount;exports.useToolUse=L.useToolUse;exports.DuplicateExtensionError=X.DuplicateExtensionError;exports.DuplicatePluginError=X.DuplicatePluginError;exports.InMemoryExtensionRegistry=X.InMemoryExtensionRegistry;exports.MissingExtensionError=X.MissingExtensionError;exports.MissingPluginDependencyError=X.MissingPluginDependencyError;exports.PluginManifestValidationError=X.PluginManifestValidationError;exports.PluginRegistry=X.PluginRegistry;exports.PluginVersionMismatchError=X.PluginVersionMismatchError;exports.createPluginRegistry=X.createPluginRegistry;exports.shouldSetupPluginForRuntime=X.shouldSetupPluginForRuntime;exports.AnimationPanel=b.AnimationPanel;exports.BuildingController=b.BuildingController;exports.BuildingPanel=b.BuildingPanel;exports.BuildingSystem=b.BuildingSystem;exports.BuildingUI=b.BuildingUI;exports.CameraPanel=b.CameraPanel;exports.CameraPresets=b.CameraPresets;exports.DEFAULT_BUILDING_GRID_EXTENSION_ID=b.DEFAULT_BUILDING_GRID_EXTENSION_ID;exports.DEFAULT_BUILDING_PLACEMENT_EXTENSION_ID=b.DEFAULT_BUILDING_PLACEMENT_EXTENSION_ID;exports.DEFAULT_BUILDING_SAVE_EXTENSION_ID=b.DEFAULT_BUILDING_SAVE_EXTENSION_ID;exports.DEFAULT_BUILDING_STORE_SERVICE_ID=b.DEFAULT_BUILDING_STORE_SERVICE_ID;exports.EDITOR_PANEL_COMPONENT_KIND=b.EDITOR_PANEL_COMPONENT_KIND;exports.Editor=b.Editor;exports.EditorLayout=b.EditorLayout;exports.GameplayEventPanel=b.GameplayEventPanel;exports.GridHelper=b.GridHelper;exports.MotionController=b.MotionController;exports.MotionPanel=b.MotionPanel;exports.NPCInstance=b.NPCInstance;exports.NPCSystem=b.NPCSystem;exports.PerformancePanel=b.PerformancePanel;exports.ResizablePanel=b.ResizablePanel;exports.StudioPanel=b.StudioPanel;exports.TileSystem=b.TileSystem;exports.VehiclePanel=b.VehiclePanel;exports.WallSystem=b.WallSystem;exports.WeatherEffect=b.WeatherEffect;exports.autoDetectProfile=b.autoDetectProfile;exports.buildingPlugin=b.buildingPlugin;exports.classifyTier=b.classifyTier;exports.compileNPCBrainBlueprint=b.compileNPCBrainBlueprint;exports.createBuildingPlugin=b.createBuildingPlugin;exports.createEditorCommandStack=b.createEditorCommandStack;exports.createEditorShell=b.createEditorShell;exports.createEditorSlice=b.createEditorSlice;exports.createNPCObservation=b.createNPCObservation;exports.detectCapabilities=b.detectCapabilities;exports.editorSlice=b.editorSlice;exports.isEditorPanelComponentExtension=b.isEditorPanelComponentExtension;exports.profileForTier=b.profileForTier;exports.registerNPCBrainAdapter=b.registerNPCBrainAdapter;exports.registerNPCBrainBlueprint=b.registerNPCBrainBlueprint;exports.resolveEditorPanelComponentExtensions=b.resolveEditorPanelComponentExtensions;exports.resolveNPCBrainDecision=b.resolveNPCBrainDecision;exports.useBuildingEditor=b.useBuildingEditor;exports.useCharacterStore=b.useCharacterStore;exports.useEditor=b.useEditor;exports.useEditorStore=b.useEditorStore;exports.useNPCStore=b.useNPCStore;exports.usePerfStore=b.usePerfStore;exports.GaesupWorld=le.WorldContainer;exports.GaesupWorldContent=le.GaesupWorldContent;exports.World=le.WorldContainer;exports.WorldConfigProvider=le.WorldConfigProvider;exports.WorldContainer=le.WorldContainer;exports.Clicker=ue.Clicker;exports.GaesupController=ue.ControllerWrapper;exports.GroundClicker=ue.GroundClicker;exports.DEFAULT_INTERACTION_INPUT_EXTENSION_ID=A.DEFAULT_INTERACTION_INPUT_EXTENSION_ID;exports.V3=A.V3;exports.V30=A.V30;exports.V31=A.V31;exports.createInteractionInputAdapter=A.createInteractionInputAdapter;exports.createInteractionSystemInputBackend=A.createInteractionSystemInputBackend;exports.createMemoryInputBackend=A.createMemoryInputBackend;exports.useGaesupStore=A.useGaesupStore;exports.SpeechBalloon=ct.SpeechBalloon;exports.useUIConfigStore=ct.useUIConfigStore;exports.GaeSupProps=ee.WorldProps;exports.IndexedDBAdapter=ee.IndexedDBAdapter;exports.LocalStorageAdapter=ee.LocalStorageAdapter;exports.SaveSystem=ee.SaveSystem;exports.createDefaultSaveSystem=ee.createDefaultSaveSystem;exports.getSaveSystem=ee.getSaveSystem;exports.useTimeStore=j.useTimeStore;exports.getEventRegistry=S.getEventRegistry;exports.getItemRegistry=S.getItemRegistry;exports.isEventActive=S.isEventActive;exports.notify=S.notify;exports.useEventsStore=S.useEventsStore;exports.useInventoryStore=S.useInventoryStore;exports.useToastStore=S.useToastStore;exports.PluginValidationAssertionError=O.PluginValidationAssertionError;exports.assertValidGaesupPlugin=O.assertValidGaesupPlugin;exports.createCozyLifeSamplePlugin=O.createCozyLifeSamplePlugin;exports.createHighGraphicsSamplePlugin=O.createHighGraphicsSamplePlugin;exports.createShooterKitSamplePlugin=O.createShooterKitSamplePlugin;exports.defineGaesupPlugin=O.defineGaesupPlugin;exports.validateGaesupPlugin=O.validateGaesupPlugin;exports.createCommandAcceptedResult=se.createCommandAcceptedResult;exports.createCommandAuthorityRouter=se.createCommandAuthorityRouter;exports.createCommandRejectedResult=se.createCommandRejectedResult;exports.createGameCommand=se.createGameCommand;exports.createServerEvent=se.createServerEvent;exports.createSnapshotAck=se.createSnapshotAck;exports.createStateDelta=se.createStateDelta;exports.CONTENT_SCHEMA_VERSION=k.CONTENT_SCHEMA_VERSION;exports.DAILY_FRIENDSHIP_CAP=k.DAILY_FRIENDSHIP_CAP;exports.DialogRunner=k.DialogRunner;exports.FRIENDSHIP_LEVELS=k.FRIENDSHIP_LEVELS;exports.HttpContentBundleSource=k.HttpContentBundleSource;exports.createContentBundleFromSaveSystem=k.createContentBundleFromSaveSystem;exports.getDialogRegistry=k.getDialogRegistry;exports.getQuestRegistry=k.getQuestRegistry;exports.loadContentBundleFromManifest=k.loadContentBundleFromManifest;exports.useDialogStore=k.useDialogStore;exports.useFriendshipStore=k.useFriendshipStore;exports.useQuestStore=k.useQuestStore;exports.useWalletStore=k.useWalletStore;exports.validateContentBundle=k.validateContentBundle;exports.validateContentBundleManifest=k.validateContentBundleManifest;exports.useWeatherStore=B.useWeatherStore;exports.SEED_ASSETS=ye.SEED_ASSETS;exports.useAssetStore=ye.useAssetStore;exports.AssetPreviewCanvas=lt.AssetPreviewCanvas;exports.HttpAssetSource=Tn.HttpAssetSource;exports.DEFAULT_SERVER_COMMAND_AUTHORITY_SERVICE_ID=ut.DEFAULT_SERVER_COMMAND_AUTHORITY_SERVICE_ID;exports.createServerPluginHost=ut.createServerPluginHost;exports.AudioControls=wo;exports.CATALOG_CATEGORIES=Le;exports.CatalogUI=Ts;exports.CharacterCreator=Oo;exports.CraftingUI=As;exports.CropPlot=Xs;exports.DEFAULT_CAMERA_SAVE_EXTENSION_ID=Pt;exports.DEFAULT_CAMERA_STORE_SERVICE_ID=_t;exports.DEFAULT_CAMERA_SYSTEM_EXTENSION_ID=Rt;exports.DialogBox=Dn;exports.DynamicFog=Ni;exports.DynamicSky=Ui;exports.EventsHUD=Fn;exports.FocusableObject=Mt;exports.Footprints=Jo;exports.Footsteps=To;exports.Gamepad=Dr;exports.HotbarUI=Xn;exports.HouseDoor=Ei;exports.HousePlot=uo;exports.Interactable=Ar;exports.InteractionPrompt=Lr;exports.InteractionTracker=jn;exports.InventoryUI=Yn;exports.LOCALE_LABEL=ei;exports.MailboxUI=bs;exports.MiniMap=ur;exports.MinimapPlatform=fr;exports.MotionUI=Or;exports.OutfitAvatar=Xo;exports.QuestLogUI=er;exports.RoomPortal=Ci;exports.RoomRoot=wi;exports.RoomVisibilityDriver=Pi;exports.RuntimeSaveDiagnosticsToaster=gr;exports.SEED_ITEMS=Ft;exports.SceneFader=vi;exports.SceneRoot=Ii;exports.ShopUI=is;exports.Teleport=Nr;exports.TimeHUD=Xr;exports.ToastHost=mr;exports.ToolUseController=as;exports.TouchControls=di;exports.TownHUD=fo;exports.WalletHUD=os;exports.WeatherHUD=no;exports.audioPlugin=ho;exports.cameraPlugin=Pr;exports.catalogPlugin=Cs;exports.characterPlugin=jo;exports.craftingPlugin=Ms;exports.createAudioPlugin=gn;exports.createCameraPlugin=Dt;exports.createCatalogPlugin=Jt;exports.createCharacterPlugin=Sn;exports.createCraftingPlugin=nn;exports.createEconomyPlugin=Vt;exports.createEventsPlugin=mt;exports.createFarmingPlugin=on;exports.createI18nPlugin=vn;exports.createInventoryPlugin=ht;exports.createMailPlugin=Kt;exports.createNPCPlugin=Tt;exports.createQuestsPlugin=vt;exports.createRelationsPlugin=Ht;exports.createScenePlugin=wn;exports.createTimePlugin=Ot;exports.createTownPlugin=fn;exports.createWeatherPlugin=ln;exports.economyPlugin=ss;exports.eventsPlugin=On;exports.farmingPlugin=Bs;exports.formatRuntimeSaveDiagnosticToastMessage=Et;exports.getAudioEngine=ne;exports.getCropRegistry=J;exports.getNPCScheduler=De;exports.getRecipeRegistry=ie;exports.hydrateAudioState=mn;exports.hydrateCatalogState=Zt;exports.hydrateCharacterState=hn;exports.hydrateCraftingState=tn;exports.hydrateEventsState=pt;exports.hydrateFarmingState=sn;exports.hydrateI18nState=xn;exports.hydrateInventoryState=yt;exports.hydrateMailState=Yt;exports.hydrateNPCState=kt;exports.hydrateQuestsState=xt;exports.hydrateRelationsState=qt;exports.hydrateSceneState=En;exports.hydrateShopState=Gt;exports.hydrateTimeState=Lt;exports.hydrateTownState=dn;exports.hydrateWalletState=Ut;exports.hydrateWeatherState=cn;exports.i18nPlugin=ii;exports.inventoryPlugin=Wn;exports.mailPlugin=Ss;exports.npcPlugin=Ir;exports.questsPlugin=Jn;exports.registerSeedCrops=Ks;exports.registerSeedEvents=Un;exports.registerSeedItems=Yr;exports.relationsPlugin=ds;exports.resolveCharacterParts=Zo;exports.resolveSchedule=wt;exports.scenePlugin=bi;exports.serializeAudioState=pn;exports.serializeCatalogState=Qt;exports.serializeCharacterState=yn;exports.serializeCraftingState=en;exports.serializeEventsState=ft;exports.serializeFarmingState=rn;exports.serializeI18nState=bn;exports.serializeInventoryState=gt;exports.serializeMailState=Xt;exports.serializeNPCState=Ct;exports.serializeQuestsState=bt;exports.serializeRelationsState=$t;exports.serializeSceneState=In;exports.serializeShopState=Bt;exports.serializeTimeState=At;exports.serializeTownState=un;exports.serializeWalletState=zt;exports.serializeWeatherState=an;exports.t=ni;exports.timePlugin=Br;exports.townPlugin=ao;exports.useAmbientBgm=Eo;exports.useAudioStore=z;exports.useCatalogStore=ae;exports.useCatalogTracker=ks;exports.useCraftingStore=re;exports.useCurrentInteraction=Oe;exports.useDayChange=Wr;exports.useDecorationScore=lo;exports.useEquippedItem=qn;exports.useEventsTicker=Nn;exports.useGaesupController=_r;exports.useGameClock=Vr;exports.useGameTime=Nt;exports.useHotbar=St;exports.useHotbarKeyboard=Hn;exports.useHourChange=$r;exports.useI18nStore=K;exports.useInteractablesStore=Z;exports.useInteractionKey=dt;exports.useInventory=$n;exports.useLocale=ci;exports.useMailStore=Q;exports.useNpcSchedule=Er;exports.usePlayerPosition=te;exports.usePlotStore=V;exports.useQuestObjectiveTracker=sr;exports.useRoomVisibilityStore=$;exports.useSceneStore=W;exports.useShopStore=H;exports.useTeleport=Ne;exports.useTimeOfDay=Gr;exports.useTownStore=G;exports.useTranslate=ai;exports.useWeatherTicker=ro;exports.weatherPlugin=eo;
|
package/dist/index.js
CHANGED
|
@@ -6,8 +6,8 @@ import { ac as Da, ad as Aa, ae as La, T as Oa, af as za, an as Fa, aa as Na, ab
|
|
|
6
6
|
import { j as ye } from "./index-De2C3Tc7.js";
|
|
7
7
|
import { B as Ya, d as Ka, D as Qa, F as Za, R as Ja, T as ec, g as tc, b as nc, e as rc, a as oc, c as sc, f as ic, u as ac, l as cc, i as lc, k as uc } from "./index-De2C3Tc7.js";
|
|
8
8
|
import { D as fc, b as pc, I as mc, M as gc, d as hc, P as yc, e as bc, g as Sc, a as vc, s as xc } from "./runtimeFilter-CS35UPHd.js";
|
|
9
|
-
import { aG as pe, aH as Tt, aI as Pt, aJ as G, aK as Dt, aL as At, aM as Lt } from "./plugin-
|
|
10
|
-
import { A as wc, w as Ec, B as kc, v as Cc, U as _c, C as Mc, aT as Rc, _ as Tc, $ as Pc, a0 as Dc, a1 as Ac, E as Lc, a as Oc, b as zc, G as Fc, N as Nc, M as Uc, aN as Bc, aU as Gc, P as Vc, R as $c, S as Wc, T as jc, V as qc, W as Hc, aV as Xc, aY as Yc, a3 as Kc, a_ as Qc, aO as Zc, a2 as Jc, c as el, d as tl, h as nl, aP as rl, aX as ol, e as sl, i as il, aZ as al, aQ as cl, aR as ll, r as ul, aS as dl, aF as fl, u as pl, f as ml, aW as gl } from "./plugin-
|
|
9
|
+
import { aG as pe, aH as Tt, aI as Pt, aJ as G, aK as Dt, aL as At, aM as Lt } from "./plugin-B4mz3orW.js";
|
|
10
|
+
import { A as wc, w as Ec, B as kc, v as Cc, U as _c, C as Mc, aT as Rc, _ as Tc, $ as Pc, a0 as Dc, a1 as Ac, E as Lc, a as Oc, b as zc, G as Fc, N as Nc, M as Uc, aN as Bc, aU as Gc, P as Vc, R as $c, S as Wc, T as jc, V as qc, W as Hc, aV as Xc, aY as Yc, a3 as Kc, a_ as Qc, aO as Zc, a2 as Jc, c as el, d as tl, h as nl, aP as rl, aX as ol, e as sl, i as il, aZ as al, aQ as cl, aR as ll, r as ul, aS as dl, aF as fl, u as pl, f as ml, aW as gl } from "./plugin-B4mz3orW.js";
|
|
11
11
|
import { W as yl, G as bl, W as Sl, a as vl, W as xl } from "./index-BIS0XpNW.js";
|
|
12
12
|
import { u as yt } from "./index-f0IJPBnb.js";
|
|
13
13
|
import { a as wl, C as El, G as kl } from "./index-f0IJPBnb.js";
|