iflow-engine 2.5.2 → 2.5.3

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.
@@ -1,4 +1,4 @@
1
- (function(){"use strict";try{if(typeof document<"u"){var e=document.createElement("style");e.appendChild(document.createTextNode('.bim-engine-wrapper{position:relative;width:100%;height:100%;font-family:sans-serif;box-sizing:border-box;overflow:hidden;background:linear-gradient(to bottom,#d6e0eb,#f6faff)}.bim-engine-opt-btn-container{z-index:100}.bim-construct-tree-btn{position:absolute;top:20px;left:20px!important;z-index:100}.bim-engine-version{position:absolute;bottom:6px;left:10px;font-size:11px;color:#00000040;pointer-events:none;-webkit-user-select:none;user-select:none;z-index:1;font-family:system-ui,-apple-system,sans-serif;letter-spacing:.3px}.bim-engine-size{position:absolute;bottom:6px;left:56px;font-size:11px;color:#00000059;pointer-events:none;-webkit-user-select:none;user-select:none;z-index:1;font-family:system-ui,-apple-system,sans-serif;letter-spacing:.3px}.bim-dialog{position:absolute;background-color:var(--bim-bg-elevated);border:1px solid var(--bim-border-default);border-radius:var(--bim-panel-radius, 12px);box-shadow:var(--bim-shadow-lg);display:flex;flex-direction:column;z-index:10001;color:var(--bim-dialog-title-color, var(--bim-text-primary));overflow:hidden;min-width:200px;min-height:100px;pointer-events:auto}.bim-dialog-header{height:40px;background-color:var(--bim-bg-inset);display:flex;align-items:center;justify-content:space-between;padding:0 12px;cursor:default;-webkit-user-select:none;user-select:none;border-bottom:1px solid var(--bim-border-default);flex-shrink:0}.bim-dialog-header.draggable{cursor:move}.bim-dialog-title{font-size:14px;font-weight:500;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;color:var(--bim-dialog-title-color)}.bim-dialog-close{cursor:pointer;font-size:18px;color:var(--bim-text-tertiary);line-height:1;margin-left:8px}.bim-dialog-close:hover{color:var(--bim-text-primary)}.bim-dialog-content{flex:1;overflow:auto;font-size:14px;color:var(--bim-dialog-text-color, var(--bim-text-secondary))}.bim-dialog-resize-handle{position:absolute;width:10px;height:10px;bottom:0;right:0;cursor:se-resize;z-index:10}.bim-dialog-resize-handle:after{content:"";position:absolute;bottom:3px;right:3px;width:6px;height:6px;border-right:2px solid var(--bim-text-tertiary);border-bottom:2px solid var(--bim-text-tertiary)}.bim-dialog-resize-handle:hover:after{border-color:var(--bim-text-primary)}.originRotate{width:10px;height:10px;background-color:red}.versionText{position:absolute;right:10px;color:#86d9ff;z-index:1000;bottom:0;font-size:10px;background:transparent;pointer-events:none}.originDiv{position:absolute;top:100px;left:100px;width:30px;height:30px;border-radius:50%;z-index:1000;pointer-events:none}.tagDiv{color:gray;background:#fffc;padding:5px;font-size:12px}.catchPoint{pointer-events:none;stroke:#08dfd7;fill:transparent;stroke-width:2}.catchLine{position:absolute;width:10px;height:10px;pointer-events:none;background-color:green}.catchPlane{position:absolute;width:10px;height:10px;pointer-events:none;background-color:#ff0}.ViewCube{position:absolute;width:120px;height:120px;top:0;right:0;z-index:999}.homeViewWrapper{position:absolute;cursor:pointer;pointer-events:auto;background-image:url(/assets/viewcube/home.png);background-size:100% 100%;background-repeat:no-repeat;background-color:#fff0;color:#fff;top:10px;right:100;width:20px;height:20px;z-index:999;user-select:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none}.viewSettingWrapper{position:absolute;cursor:pointer;pointer-events:auto;background-size:100% 100%;background-repeat:no-repeat;font-weight:800;background-color:#fff0;color:#fff;top:30px;right:100;width:20px;height:20px;z-index:999;user-select:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none}.cameraToggleWrapper{position:absolute;cursor:pointer;pointer-events:auto;background-color:#ffffffe6;color:#333;font-size:26px;font-weight:700;display:none;align-items:center;justify-content:center;border-radius:4px;box-shadow:0 2px 4px #0003;transition:all .3s ease;top:70px;right:90px;width:44px;height:44px;z-index:999;user-select:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none}.cameraToggleWrapper.show{display:flex}.cameraToggleWrapper:hover{background-color:#fff;box-shadow:0 3px 6px #0000004d;transform:scale(1.1)}.screenshotWrapper{position:absolute;cursor:pointer;pointer-events:auto;background-color:#ffffffe6;color:#333;font-size:20px;display:none;align-items:center;justify-content:center;border-radius:4px;box-shadow:0 2px 4px #0003;transition:all .3s ease;top:120px;right:90px;width:44px;height:44px;z-index:999;user-select:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none}.screenshotWrapper.show{display:flex}.screenshotWrapper:hover{background-color:#fff;box-shadow:0 3px 6px #0000004d;transform:scale(1.1)}.fullscreenWrapper{position:absolute;cursor:pointer;pointer-events:auto;background-color:#ffffffe6;color:#333;font-size:26px;font-weight:700;display:none;align-items:center;justify-content:center;border-radius:4px;box-shadow:0 2px 4px #0003;transition:all .3s ease;top:170px;right:90px;width:44px;height:44px;z-index:999;user-select:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none}.fullscreenWrapper.show{display:flex}.fullscreenWrapper:hover{background-color:#fff;box-shadow:0 3px 6px #0000004d;transform:scale(1.1)}.measure-elevation{position:absolute;pointer-events:none}.measureSvg{position:absolute;width:1920px;height:1080px}.catch-point{position:absolute;width:10px;height:10px;background-color:red;border-radius:50%;pointer-events:none}.annotation-container{position:absolute;pointer-events:none;top:0;left:0}.measureLine{position:absolute;pointer-events:none;stroke:#009bea;fill:#009bea;filter:drop-shadow(1px 1px 2px rgba(0,0,0,.3))}.measureBack{cursor:pointer;pointer-events:auto;fill:#fff;padding:5px;top:-50px;rx:5;ry:5;filter:drop-shadow(1px 1px 2px rgba(0,0,0,.3))}.measureLabel{position:absolute;fill:#fff;font-size:14px;stroke:#009bea;font-weight:100;pointer-events:none}.measurePointer{fill:#009bea}.Hight{stroke:#fff;font-weight:500;filter:drop-shadow(2px 1px 2px rgba(255,255,255,1))}.allow-select{pointer-events:auto}.disallow-select{pointer-events:none}.angle-annotation{position:absolute;pointer-events:auto}.MapController{-webkit-touch-callout:none;-webkit-user-select:none;-khtml-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.engine-2d-container{position:relative;width:100%;height:100%;overflow:hidden}.engine-2d-canvas{display:block;width:100%;height:100%;outline:none}.engine-2d-cad-cursor{position:absolute;top:0;left:0;width:100%;height:100%;pointer-events:none;overflow:hidden}.engine-2d-cad-cursor__h{position:absolute;left:0;width:100%;height:1px;background:var(--e2d-cursor, rgba(255, 255, 255, .85));transform:translateY(-50%)}.engine-2d-cad-cursor__v{position:absolute;top:0;width:1px;height:100%;background:var(--e2d-cursor, rgba(255, 255, 255, .85));transform:translate(-50%)}.engine-2d-cad-cursor__box{position:absolute;width:8px;height:8px;border:1px solid var(--e2d-cursor, rgba(255, 255, 255, .85));transform:translate(-50%,-50%)}.engine-2d-context-menu{position:absolute;z-index:9999;min-width:140px;background:var(--e2d-bg2, #252526);border:1px solid var(--e2d-border, rgba(255, 255, 255, .12));border-radius:4px;box-shadow:0 4px 16px var(--e2d-shadow, rgba(0, 0, 0, .5));padding:4px 0;display:none;-webkit-user-select:none;user-select:none}.engine-2d-context-menu--visible{display:block}.engine-2d-context-menu__item{padding:7px 16px;font-size:13px;color:var(--e2d-text2, #cccccc);cursor:pointer;white-space:nowrap;transition:background .1s,color .1s}.engine-2d-context-menu__item:hover{background:var(--e2d-bg-accent, #094771);color:var(--e2d-text-accent, #ffffff)}.engine-2d-context-menu__divider{height:1px;background:var(--e2d-border, rgba(255, 255, 255, .1));margin:4px 0}.engine-2d-stats{position:absolute;top:10px;left:10px;background:var(--e2d-float-bg, rgba(0, 0, 0, .7));color:var(--e2d-text, #e0e0e0);padding:8px 12px;border-radius:4px;font-family:monospace;font-size:12px;pointer-events:none;-webkit-user-select:none;user-select:none}.engine-2d-stats div{margin:2px 0}.engine-2d-loading{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);background:var(--e2d-float-bg, rgba(0, 0, 0, .8));color:var(--e2d-text, #e0e0e0);padding:20px 40px;border-radius:8px;font-size:16px;text-align:center}.engine-2d-loading-spinner{border:3px solid var(--e2d-border, rgba(255, 255, 255, .3));border-top:3px solid var(--e2d-accent, #4fc3f7);border-radius:50%;width:40px;height:40px;animation:engine-2d-spin 1s linear infinite;margin:0 auto 10px}@keyframes engine-2d-spin{0%{transform:rotate(0)}to{transform:rotate(360deg)}}.engine-2d-error{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);background:#d32f2feb;color:#fff;padding:20px 40px;border-radius:8px;font-size:14px;max-width:80%;text-align:center}.engine-2d-controls-hint{position:absolute;bottom:10px;left:10px;background:var(--e2d-float-bg, rgba(0, 0, 0, .6));color:var(--e2d-text, #e0e0e0);border:1px solid var(--e2d-float-border, rgba(255, 255, 255, .08));padding:8px 12px;border-radius:4px;font-size:12px;pointer-events:none;-webkit-user-select:none;user-select:none}.engine-2d-controls-hint kbd{background:var(--e2d-icon-bg, rgba(255, 255, 255, .2));color:var(--e2d-text, #e0e0e0);padding:2px 6px;border-radius:3px;font-family:monospace}.engine-2d-search{position:absolute;top:0;left:0;width:100%;height:100%;pointer-events:none;z-index:9998;display:none}.engine-2d-search--visible{display:block}.engine-2d-search__box{position:absolute;top:14%;left:50%;transform:translate(-50%);width:480px;max-width:calc(100% - 40px);background:var(--e2d-bg, #1e1f22);border:1px solid var(--e2d-border, rgba(255, 255, 255, .14));border-radius:10px;box-shadow:0 8px 40px var(--e2d-shadow-lg, rgba(0, 0, 0, .65)),0 2px 8px var(--e2d-shadow, rgba(0, 0, 0, .4));overflow:hidden;pointer-events:auto;animation:engine-2d-search-in .18s cubic-bezier(.34,1.2,.64,1)}@keyframes engine-2d-search-in{0%{opacity:0;transform:translate(-50%) translateY(-8px) scale(.97)}to{opacity:1;transform:translate(-50%) translateY(0) scale(1)}}.engine-2d-search__input-row{display:flex;align-items:center;padding:0 12px;gap:8px;height:48px}.engine-2d-search__icon{flex-shrink:0;color:var(--e2d-icon, rgba(255, 255, 255, .4));display:flex;align-items:center}.engine-2d-search__input{flex:1;background:transparent;border:none;outline:none;color:var(--e2d-text, #e0e0e0);font-size:14px;line-height:1.4;caret-color:var(--e2d-accent, #4fc3f7)}.engine-2d-search__input::placeholder{color:var(--e2d-text3, rgba(255, 255, 255, .25))}.engine-2d-search__clear{flex-shrink:0;background:var(--e2d-icon-bg, rgba(255, 255, 255, .08));border:none;border-radius:4px;color:var(--e2d-icon, rgba(255, 255, 255, .5));cursor:pointer;display:flex;align-items:center;justify-content:center;width:22px;height:22px;padding:0;opacity:0;pointer-events:none;transition:opacity .15s,background .15s,color .15s}.engine-2d-search__clear:hover{background:var(--e2d-icon-bg-hover, rgba(255, 255, 255, .16));color:var(--e2d-close-hover, #ffffff)}.engine-2d-search__divider{height:1px;background:var(--e2d-border2, rgba(255, 255, 255, .08));display:none}.engine-2d-search__status{padding:6px 16px;font-size:11px;color:var(--e2d-text3, rgba(255, 255, 255, .35));display:none;-webkit-user-select:none;user-select:none}.engine-2d-search__list{list-style:none;margin:0;padding:4px 0;max-height:320px;overflow-y:auto;display:none;scrollbar-width:thin;scrollbar-color:var(--e2d-scrollbar, rgba(255, 255, 255, .15)) transparent}.engine-2d-search__list::-webkit-scrollbar{width:4px}.engine-2d-search__list::-webkit-scrollbar-track{background:transparent}.engine-2d-search__list::-webkit-scrollbar-thumb{background:var(--e2d-scrollbar, rgba(255, 255, 255, .15));border-radius:2px}.engine-2d-search__item{display:flex;align-items:center;gap:8px;padding:8px 14px;cursor:pointer;transition:background .1s;min-height:38px;flex-wrap:nowrap}.engine-2d-search__item:hover,.engine-2d-search__item--active{background:var(--e2d-bg-hover, rgba(79, 195, 247, .08))}.engine-2d-search__item-badge{flex-shrink:0;font-size:10px;font-weight:500;padding:2px 6px;border-radius:3px;letter-spacing:.03em;white-space:nowrap}.engine-2d-search__item-name{flex:1;font-size:13px;color:var(--e2d-text, #e0e0e0);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.engine-2d-search__item-layer{flex-shrink:0;font-size:11px;color:var(--e2d-text3, rgba(255, 255, 255, .3));white-space:nowrap;max-width:100px;overflow:hidden;text-overflow:ellipsis}.engine-2d-search__item-desc{flex-shrink:0;font-size:11px;color:var(--e2d-text4, rgba(255, 255, 255, .25));white-space:nowrap;max-width:120px;overflow:hidden;text-overflow:ellipsis}.engine-2d-search__mark{background:transparent;color:var(--e2d-accent, #4fc3f7);font-weight:600}.engine-2d-mouse-coord{position:absolute;bottom:10px;left:50%;transform:translate(-50%);display:flex;align-items:center;gap:12px;background:var(--e2d-float-bg, rgba(0, 0, 0, .65));color:var(--e2d-text, #e0e0e0);padding:5px 14px;border-radius:4px;font-family:monospace;font-size:12px;pointer-events:none;-webkit-user-select:none;user-select:none;border:1px solid var(--e2d-float-border, rgba(255, 255, 255, .08))}.engine-2d-mouse-coord__label{color:var(--e2d-coord-label, rgba(255, 255, 255, .45));font-size:11px;letter-spacing:.05em}.engine-2d-mouse-coord__value{min-width:90px;color:var(--e2d-coord-value, #76c8ff)}.panorama-annotation-container{position:absolute;top:0;left:0;width:100%;height:100%;pointer-events:none;z-index:1000;overflow:hidden}.panorama-annotation{position:absolute;pointer-events:auto;cursor:pointer;transform:translate(-50%,-50%);transition:opacity .2s ease,transform .2s ease;user-select:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none}.panorama-annotation:hover{z-index:1001;transform:translate(-50%,-50%) scale(1.1)}.panorama-annotation-icon{width:40px;height:40px}.panorama-annotation-icon img{width:100%;height:100%;object-fit:contain;display:block;filter:drop-shadow(0 2px 4px rgba(0,0,0,.3))}.panorama-annotation-text{max-width:200px;text-align:center;line-height:1.4}.panorama-annotation-link{transition:background-color .2s ease,transform .2s ease}.panorama-annotation-link:hover{z-index:1002}.panorama-annotation-link img{display:block;flex-shrink:0}.panorama-annotation.hidden{display:none!important}@keyframes pulse{0%,to{opacity:1}50%{opacity:.5}}.panorama-annotation.loading{animation:pulse 1.5s ease-in-out infinite}@media(max-width:768px){.panorama-annotation-icon{width:32px;height:32px}.panorama-annotation-text,.panorama-annotation-link{font-size:12px!important;padding:6px 10px!important}}.bim-right-key{position:fixed;z-index:10000;display:none;background:transparent}.bim-right-key.visible{display:block}.bim-menu{display:flex;flex-direction:column;background:var(--bim-bg-elevated);border:1px solid var(--bim-border-default);border-radius:8px;padding:6px;margin:0;list-style:none;box-shadow:var(--bim-shadow-lg);font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,sans-serif;-webkit-user-select:none;user-select:none;color:var(--bim-text-primary)}.bim-menu-group{display:flex;flex-direction:column}.bim-menu-divider{height:1px;background-color:var(--bim-divider);margin:4px 0}.bim-menu-item{display:flex;align-items:center;padding:8px 12px;cursor:pointer;transition:all .2s ease;font-size:13px;position:relative;color:var(--bim-text-primary);border-radius:6px}.bim-menu-item:hover{background-color:var(--bim-component-bg-hover)}.bim-menu-item.disabled{opacity:.5;cursor:not-allowed;pointer-events:none}.bim-menu-item-icon{display:none}.bim-menu.has-icons .bim-menu-item-icon{width:16px;height:16px;margin-right:8px;display:flex;align-items:center;justify-content:center;flex-shrink:0}.bim-menu-item-icon svg{width:100%;height:100%;fill:currentColor}.bim-menu-item-label{flex:1;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.bim-menu-item-arrow{width:12px;height:12px;margin-left:8px;display:flex;align-items:center;justify-content:center;opacity:.7}.bim-menu-item-arrow svg{width:100%;height:100%;fill:currentColor}.radial-toolbar-wrapper{position:absolute;right:20px;bottom:20px;z-index:1000;pointer-events:none}.radial-main-btn,.radial-sub-btn{border:1px solid transparent;border-radius:9999px;display:flex;align-items:center;justify-content:center;cursor:pointer;pointer-events:auto;outline:none;transition:transform .22s ease,opacity .22s ease,box-shadow .22s ease,background-color .22s ease,color .22s ease}.radial-main-btn{position:absolute;right:0;bottom:0;width:var(--rt-main-size, 70px);height:var(--rt-main-size, 70px);background:var(--rt-main-bg, rgba(255, 255, 255, .92));border-color:var(--rt-main-border, rgba(203, 213, 225, .65));box-shadow:var(--rt-main-shadow, 0 4px 12px rgba(0, 0, 0, .12));color:var(--rt-main-icon, #334155)}.radial-main-btn:hover{transform:translateZ(0) scale(1.04);background:var(--rt-main-bg-hover, #ffffff);box-shadow:var(--rt-main-shadow-hover, 0 6px 20px rgba(0, 0, 0, .14));color:var(--rt-main-icon-hover, #1e293b)}.radial-main-btn:active{transform:translateZ(0) scale(.97)}.radial-main-btn svg{width:34px;height:34px}.radial-sub-btn{position:absolute;right:var(--rt-main-offset, 10px);bottom:var(--rt-main-offset, 10px);width:var(--rt-sub-size, 50px);height:var(--rt-sub-size, 50px);background:var(--rt-sub-bg, rgba(255, 255, 255, .9));border-color:var(--rt-sub-border, rgba(203, 213, 225, .65));box-shadow:var(--rt-sub-shadow, 0 2px 8px rgba(0, 0, 0, .1));color:var(--rt-sub-icon, #334155);opacity:0;transform:translate(0) scale(.76);transform-origin:center;--rt-delay-current: var(--rt-close-delay, 0s);transition-delay:var(--rt-delay-current)}.radial-toolbar-wrapper.is-active .radial-sub-btn{--rt-delay-current: var(--rt-open-delay, 0s);opacity:1;transform:translate(var(--rt-x),var(--rt-y)) scale(1)}.radial-sub-btn:hover{background:var(--rt-sub-bg-hover, var(--bim-primary, #2563eb));box-shadow:var(--rt-sub-shadow-hover, 0 4px 14px rgba(0, 0, 0, .16));color:var(--rt-sub-icon-hover, var(--bim-text-inverse, #ffffff))}.radial-sub-btn.is-active,.radial-sub-btn[data-active=true]{background:var(--bim-primary, #2563eb);border:1px solid var(--bim-primary-active, #1d4ed8);box-shadow:var(--bim-shadow-glow, 0 0 0 2px rgba(37, 99, 235, .28));color:var(--bim-text-inverse, #ffffff)}.radial-sub-btn.is-active:hover,.radial-sub-btn[data-active=true]:hover{background:var(--bim-primary-hover, #3b82f6)}.radial-sub-btn.is-active .radial-sub-btn-icon,.radial-sub-btn[data-active=true] .radial-sub-btn-icon{color:var(--bim-icon-inverse, #ffffff)}.radial-sub-btn:active{transform:translate(var(--rt-x),var(--rt-y)) scale(.94)}.radial-sub-btn-icon{width:22px;height:22px;display:flex;align-items:center;justify-content:center}.radial-sub-btn-icon svg{width:100%;height:100%}.bottom-dock-stack{position:absolute;left:50%;bottom:20px;transform:translate(-50%);width:0;height:0;z-index:1000;pointer-events:none}.bottom-dock-panel{position:absolute;left:50%;bottom:0;transform:translate(-50%);width:fit-content;max-width:calc(100vw - 40px);pointer-events:auto;border-radius:12px;border:1px solid var(--bd-border, rgba(148, 163, 184, .35));background:var(--bd-bg, rgba(255, 255, 255, .94));box-shadow:var(--bd-shadow, 0 2px 8px rgba(15, 23, 42, .1));transition:transform .22s ease,opacity .2s ease;overflow:visible;z-index:1}.bottom-dock-panel:hover,.bottom-dock-panel:focus-within{z-index:10}.bottom-dock-panel.is-entering{opacity:0}.bottom-dock-panel.is-leaving{opacity:0;pointer-events:none}.bottom-dock-panel-close{position:absolute;top:5px;right:5px;transform:translate(35%,-35%);z-index:2;width:16px;height:16px;border-radius:6px;border:1px solid transparent;background:transparent;color:var(--bd-close-color, #475569);display:inline-flex;align-items:center;justify-content:center;cursor:pointer;transition:background-color .16s ease,color .16s ease,border-color .16s ease}.bottom-dock-panel-close:hover{background:var(--bd-close-bg-hover, rgba(15, 23, 42, .08));color:var(--bd-close-color-hover, #0f172a);border-color:var(--bd-close-border-hover, rgba(148, 163, 184, .3))}.bottom-dock-panel-close:active{transform:translate(35%,-35%) scale(.96)}.bottom-dock-panel-body{min-height:50px;padding:10px;background:var(--bd-body-bg, transparent);width:fit-content;max-width:calc(100vw - 40px);box-sizing:border-box;border-radius:inherit}.bottom-dock-placeholder{border-radius:8px;border:1px dashed var(--bd-placeholder-border, rgba(148, 163, 184, .55));padding:10px;color:var(--bd-placeholder-text, #64748b);font-size:12px;line-height:1.5;text-align:center}.measure-dock-panel{width:fit-content;max-width:100%;padding:0;border-radius:8px;border:none;box-sizing:border-box;color:var(--bim-text-secondary, #475569);font-size:13px;line-height:1.5}.measure-dock-panel-main{display:block}.measure-dock-panel-settings{display:none;flex-direction:column;gap:6px;min-height:74px;box-sizing:border-box}.measure-dock-settings-row{display:flex;align-items:center;justify-content:space-between;gap:8px}.measure-dock-settings-label{color:var(--bim-text-secondary, #64748b);font-size:12px}.measure-dock-settings-select{width:88px;height:24px;border-radius:6px;border:1px solid rgba(148,163,184,.36);background:color-mix(in srgb,var(--bim-bg-inset, #edf1f6) 90%,#ffffff 10%);color:var(--bim-text-primary, #0f172a);font-size:12px;padding:0 6px;box-sizing:border-box}.measure-dock-settings-actions{display:flex;justify-content:flex-end;gap:8px}.measure-dock-settings-btn{height:24px;min-width:52px;border-radius:6px;border:1px solid rgba(148,163,184,.36);background:color-mix(in srgb,var(--bim-bg-inset, #edf1f6) 90%,#ffffff 10%);color:var(--bim-text-secondary, #64748b);font-size:12px;line-height:1;cursor:pointer}.measure-dock-settings-btn.is-save{border-color:color-mix(in srgb,var(--bim-primary, #4f88ff) 46%,transparent 54%);color:color-mix(in srgb,var(--bim-primary, #4f88ff) 78%,#6f9dff 22%)}.measure-dock-panel-top{display:flex;align-items:center;justify-content:space-between;gap:10px}.measure-dock-clearheight-options{display:none;flex-direction:column;gap:8px;margin-bottom:10px;padding:8px;border-radius:8px;border:1px solid rgba(148,163,184,.28);background:color-mix(in srgb,var(--bim-bg-inset, #edf1f6) 90%,#ffffff 10%)}.measure-dock-clearheight-options.is-visible{display:flex}.measure-dock-clearheight-group{display:flex;align-items:center;gap:8px}.measure-dock-clearheight-label{min-width:60px;color:var(--bim-text-secondary, #64748b);font-size:12px}.measure-dock-clearheight-buttons{display:flex;gap:8px}.measure-dock-clearheight-btn{height:28px;padding:0 10px;border-radius:6px;border:1px solid rgba(148,163,184,.36);background:color-mix(in srgb,var(--bim-bg-elevated, #f8fafc) 88%,#ffffff 12%);color:var(--bim-text-secondary, #64748b);font-size:12px;line-height:1;cursor:pointer;transition:all .15s ease}.measure-dock-clearheight-btn:hover{border-color:#94a3b88f}.measure-dock-clearheight-btn.is-active{border-color:color-mix(in srgb,var(--bim-primary, #4f88ff) 70%,#9db9ff 30%);background:color-mix(in srgb,var(--bim-primary-subtle, rgba(96, 140, 255, .18)) 72%,#ffffff 28%);color:color-mix(in srgb,var(--bim-primary, #4f88ff) 78%,#6f9dff 22%)}.measure-dock-panel-mode-zone{flex:1;min-width:0;display:flex;flex-direction:column;gap:10px}.measure-dock-panel-mode-row{display:grid;grid-template-columns:repeat(5,32px);gap:10px}.measure-dock-panel-mode-row-secondary{display:none}.measure-dock-panel-mode-btn{width:32px;height:32px;border-radius:8px;border:1px solid rgba(148,163,184,.28);background:color-mix(in srgb,var(--bim-bg-inset, #edf1f6) 92%,#ffffff 8%);color:color-mix(in srgb,var(--bim-text-secondary, #64748b) 94%,#475569 6%);display:inline-flex;align-items:center;justify-content:center;padding:0;box-sizing:border-box;cursor:pointer;transition:all .15s ease}.measure-dock-panel-mode-icon{width:20px;height:20px;display:inline-flex;align-items:center;justify-content:center}.measure-dock-panel-mode-icon svg{width:100%;height:100%;fill:currentColor}.measure-dock-panel-mode-btn:hover{border-color:#94a3b880;background:color-mix(in srgb,var(--bim-component-bg-hover, #dce5f2) 64%,#ffffff 36%)}.measure-dock-panel-mode-btn.is-active{border-color:color-mix(in srgb,var(--bim-primary, #4f88ff) 70%,#9db9ff 30%);color:color-mix(in srgb,var(--bim-primary, #4f88ff) 78%,#6f9dff 22%);box-shadow:inset 0 0 0 1px color-mix(in srgb,var(--bim-primary, #4f88ff) 35%,transparent 65%)}.measure-dock-panel-actions{flex:0 0 auto;display:flex;flex-direction:row;gap:10px;align-items:center}.measure-dock-panel-action-btn{width:32px;height:32px;border-radius:6px;border:1px solid rgba(148,163,184,.22);background:color-mix(in srgb,var(--bim-bg-inset, #edf1f6) 92%,#ffffff 8%);color:var(--bim-text-secondary, #475569);padding:0;box-sizing:border-box;display:inline-flex;align-items:center;justify-content:center;cursor:pointer;transition:all .15s ease}.measure-dock-panel-action-btn:hover{border-color:#94a3b880;color:var(--bim-text-primary, #0f172a)}.measure-dock-panel-action-btn svg{width:18px;height:18px;fill:currentColor}.measure-dock-panel-action-expand{width:16px;height:32px}.measure-dock-panel-action-expand.is-expanded{height:74px}.measure-dock-panel-action-expand.is-collapsed{height:32px}.measure-dock-panel-action-clear{background:color-mix(in srgb,var(--bim-danger, #ef4444) 16%,#ffffff 84%);border-color:color-mix(in srgb,var(--bim-danger, #ef4444) 26%,transparent 74%);color:var(--bim-danger, #ef4444)}.measure-dock-panel-action-clear:hover{border-color:color-mix(in srgb,var(--bim-danger, #ef4444) 40%,transparent 60%);color:var(--bim-danger, #ef4444)}.measure-dock-panel-action-settings{color:color-mix(in srgb,var(--bim-text-primary, #0f172a) 86%,#000 14%)}.measure-dock-panel-mode-row .measure-dock-panel-action-btn{border-radius:8px}.measure-dock-panel-action-expand svg{transition:transform .15s ease}.measure-dock-panel-action-expand.is-expanded svg{transform:rotate(180deg)}.measure-dock-panel [data-tooltip]{position:relative}.measure-dock-panel [data-tooltip]:after{content:attr(data-tooltip);position:absolute;left:50%;bottom:calc(100% + 6px);transform:translate(-50%);padding:4px 8px;border-radius:6px;background:#0f172aeb;color:#f8fafc;font-size:12px;line-height:1.2;white-space:nowrap;pointer-events:none;opacity:0;visibility:hidden;z-index:8;transition:opacity 60ms ease}.measure-dock-panel [data-tooltip]:hover:after,.measure-dock-panel [data-tooltip]:focus-visible:after{opacity:1;visibility:visible}@media(max-width:720px){.measure-dock-panel-top{flex-direction:column}.measure-dock-clearheight-group{flex-direction:column;align-items:flex-start;gap:6px}.measure-dock-panel-actions{width:100%;flex-direction:row;justify-content:flex-end}.measure-dock-panel-action-btn,.measure-dock-panel-mode-btn{width:32px;height:32px}.measure-dock-panel-action-expand{width:16px;height:32px}.measure-dock-panel-action-expand.is-expanded{height:74px}}.section-dock-panel{width:fit-content;max-width:100%;display:flex;flex-direction:column;gap:10px;color:var(--bim-text-secondary, #475569)}.section-dock-axis-panel{display:none;width:fit-content;border-radius:8px;padding:0;gap:10px}.section-dock-axis-panel.is-visible{display:flex}.section-dock-axis-btn{width:32px;height:32px;border-radius:8px;border:1px solid rgba(148,163,184,.28);background:color-mix(in srgb,var(--bim-bg-inset, #edf1f6) 92%,#ffffff 8%);color:color-mix(in srgb,var(--bim-text-secondary, #64748b) 94%,#475569 6%);font-size:16px;line-height:1;box-sizing:border-box;padding:0;cursor:pointer;transition:all .15s ease}.section-dock-axis-btn:hover{border-color:#94a3b880;background:color-mix(in srgb,var(--bim-component-bg-hover, #dce5f2) 64%,#ffffff 36%)}.section-dock-axis-btn.is-active{border-color:color-mix(in srgb,var(--bim-primary, #4f88ff) 70%,#9db9ff 30%);background:color-mix(in srgb,var(--bim-primary-subtle, rgba(96, 140, 255, .18)) 72%,#ffffff 28%);color:color-mix(in srgb,var(--bim-primary, #4f88ff) 78%,#6f9dff 22%)}.section-dock-main{display:flex;align-items:center;gap:10px;padding:0;border-radius:8px}.section-dock-types,.section-dock-tools{display:flex;align-items:center;gap:10px}.section-dock-divider{width:1px;height:32px;background:color-mix(in srgb,var(--bim-border-default, #cbd5e1) 84%,transparent 16%)}.section-dock-type-btn,.section-dock-tool-btn{width:32px;height:32px;border:1px solid rgba(148,163,184,.28);border-radius:8px;background:color-mix(in srgb,var(--bim-bg-inset, #edf1f6) 92%,#ffffff 8%);color:color-mix(in srgb,var(--bim-text-secondary, #64748b) 94%,#475569 6%);display:inline-flex;align-items:center;justify-content:center;cursor:pointer;box-sizing:border-box;padding:0;transition:all .15s ease}.section-dock-type-btn:hover,.section-dock-tool-btn:hover{border-color:var(--bim-border-strong, rgba(100, 116, 139, .6));background:color-mix(in srgb,var(--bim-component-bg-hover, #dce5f2) 64%,#ffffff 36%)}.section-dock-type-btn.is-active,.section-dock-tool-btn.is-active{border-color:color-mix(in srgb,var(--bim-primary, #4f88ff) 70%,#9db9ff 30%);color:color-mix(in srgb,var(--bim-primary, #4f88ff) 78%,#6f9dff 22%)}.section-dock-type-icon,.section-dock-tool-icon{width:20px;height:20px;display:inline-flex;align-items:center;justify-content:center}.section-dock-type-icon svg,.section-dock-tool-icon svg{width:100%;height:100%;fill:currentColor}.section-dock-panel [data-tooltip]{position:relative}.section-dock-panel [data-tooltip]:after{content:attr(data-tooltip);position:absolute;left:50%;bottom:calc(100% + 6px);transform:translate(-50%);padding:4px 8px;border-radius:6px;background:#0f172aeb;color:#f8fafc;font-size:12px;line-height:1.2;white-space:nowrap;pointer-events:none;opacity:0;visibility:hidden;z-index:8;transition:opacity 60ms ease}.section-dock-panel [data-tooltip]:hover:after,.section-dock-panel [data-tooltip]:focus-visible:after{opacity:1;visibility:visible}.walk-control-panel.walk-dock-panel{gap:10px;padding:0;background:transparent;border:none;border-radius:8px;box-shadow:none;color:var(--bim-text-secondary, #64748b)}.walk-control-panel.walk-dock-panel .walk-divider{height:32px}.walk-control-panel.walk-dock-panel .walk-control-left,.walk-control-panel.walk-dock-panel .walk-control-settings{gap:10px}.walk-control-panel.walk-dock-panel .walk-icon-btn{width:32px;height:32px;padding:0;border-radius:8px;border:1px solid rgba(148,163,184,.28);background:color-mix(in srgb,var(--bim-bg-inset, #edf1f6) 92%,#ffffff 8%);color:color-mix(in srgb,var(--bim-text-secondary, #64748b) 94%,#475569 6%)}.walk-control-panel.walk-dock-panel .walk-icon-btn:hover{border-color:#94a3b880;background:color-mix(in srgb,var(--bim-component-bg-hover, #dce5f2) 64%,#ffffff 36%)}.walk-control-panel.walk-dock-panel .walk-icon-btn.active{border-color:color-mix(in srgb,var(--bim-primary, #4f88ff) 70%,#9db9ff 30%);background:color-mix(in srgb,var(--bim-primary-subtle, rgba(96, 140, 255, .18)) 72%,#ffffff 28%);color:color-mix(in srgb,var(--bim-primary, #4f88ff) 78%,#6f9dff 22%)}.walk-control-panel.walk-dock-panel .walk-icon-btn svg{width:20px;height:20px}.walk-control-panel.walk-dock-panel .walk-icon-btn.active svg{fill:currentColor}.walk-control-panel.walk-dock-panel .walk-speed-control{gap:8px}.walk-control-panel.walk-dock-panel .walk-speed-label,.walk-control-panel.walk-dock-panel .walk-checkbox-label,.walk-control-panel.walk-dock-panel .walk-select-label{font-size:12px}.walk-control-panel.walk-dock-panel .walk-speed-group{padding:2px;border:1px solid rgba(148,163,184,.28);background:color-mix(in srgb,var(--bim-bg-inset, #edf1f6) 92%,#ffffff 8%)}.walk-control-panel.walk-dock-panel .walk-speed-btn{width:24px;height:24px;font-size:14px;line-height:1;padding:0;display:inline-flex;align-items:center;justify-content:center;border:1px solid rgba(148,163,184,.28);background:color-mix(in srgb,var(--bim-bg-elevated, #f8fafc) 88%,#ffffff 12%);color:var(--bim-text-primary, #0f172a)}.walk-control-panel.walk-dock-panel .walk-speed-display{min-width:30px;font-size:12px;color:var(--bim-text-primary, #0f172a)}.walk-control-panel.walk-dock-panel .walk-checkbox{width:14px;height:14px;accent-color:var(--bim-primary, #3b82f6)}.walk-control-panel.walk-dock-panel .walk-select{min-width:90px;height:24px;padding:2px 8px;font-size:12px;border:1px solid rgba(148,163,184,.28);background:color-mix(in srgb,var(--bim-bg-inset, #edf1f6) 92%,#ffffff 8%);color:var(--bim-text-primary, #0f172a)}.walk-control-panel.walk-dock-panel .walk-exit-btn{height:32px;padding:0 12px;border-radius:8px;font-size:12px}.walk-control-panel{display:flex;align-items:center;gap:20px;padding:12px 20px;background-color:var(--bim-bg-base, #152232);border:1px solid var(--bim-border-strong, #475569);border-radius:12px;box-shadow:var(--bim-shadow-xl, 0 20px 40px rgba(0, 0, 0, .3));-webkit-user-select:none;user-select:none}.walk-divider{width:1px;height:40px;background:var(--bim-divider);flex-shrink:0}.walk-control-left{display:flex;gap:8px}.walk-icon-btn{width:48px;height:48px;display:flex;align-items:center;justify-content:center;background:var(--bim-bg-inset);border:1px solid var(--bim-border-default);border-radius:8px;cursor:pointer;transition:all .2s ease;color:var(--bim-icon-default);padding:8px}.walk-icon-btn:hover{background:var(--bim-component-bg-hover);border-color:var(--bim-border-strong)}.walk-icon-btn.active{background:var(--bim-primary-subtle);border-color:var(--bim-primary);color:var(--bim-primary)}.walk-icon-btn.active svg{fill:var(--bim-primary)}.walk-icon-btn svg{width:32px;height:32px}.walk-control-settings{display:flex;align-items:center;gap:16px;flex:1}.walk-speed-control{display:flex;align-items:center;gap:12px}.walk-speed-label{color:var(--bim-text-primary);font-size:14px;white-space:nowrap}.walk-speed-group{display:flex;align-items:center;gap:8px;background:var(--bim-bg-inset);border:1px solid var(--bim-border-subtle);border-radius:6px;padding:4px}.walk-speed-btn{width:32px;height:32px;background:var(--bim-bg-elevated);border:1px solid var(--bim-border-subtle);border-radius:4px;color:var(--bim-text-primary);font-size:18px;cursor:pointer;transition:all .2s ease}.walk-speed-btn:hover{background:var(--bim-component-bg-hover);border-color:var(--bim-border-strong)}.walk-speed-btn:disabled{opacity:.5;cursor:not-allowed}.walk-speed-display{min-width:40px;text-align:center;color:var(--bim-text-primary);font-size:14px;font-weight:700}.walk-checkbox-wrapper{display:flex;align-items:center;gap:8px;cursor:pointer}.walk-checkbox{width:18px;height:18px;cursor:pointer}.walk-checkbox:disabled{opacity:.5;cursor:not-allowed}.walk-checkbox-label{color:var(--bim-text-primary);font-size:14px;white-space:nowrap}.walk-checkbox-wrapper input:disabled+.walk-checkbox-label{opacity:.5}.walk-select-wrapper{display:flex;align-items:center;gap:8px}.walk-select-label{color:var(--bim-text-primary);font-size:14px;white-space:nowrap}.walk-select{padding:6px 12px;background:var(--bim-bg-inset);border:1px solid var(--bim-border-default);border-radius:6px;color:var(--bim-text-primary);font-size:14px;cursor:pointer;min-width:120px}.walk-select option{background:var(--bim-bg-elevated);color:var(--bim-text-primary)}.walk-exit-btn{padding:10px 24px;background:var(--bim-primary);border:none;border-radius:8px;color:var(--bim-text-inverse);font-size:14px;font-weight:600;cursor:pointer;transition:all .2s ease;white-space:nowrap}.walk-exit-btn:hover{background:var(--bim-primary-hover);transform:scale(1.02)}.walk-path-panel{padding:16px;box-sizing:border-box}.walk-path-btn{border:none;border-radius:6px;cursor:pointer;font-size:14px;transition:all .2s;box-sizing:border-box}.walk-path-btn-group{display:flex;gap:8px;margin-top:16px}.walk-path-btn-play{flex:1;height:32px;padding:0 16px;background:var(--bim-primary, #3b82f6);color:#fff}.walk-path-btn-play:hover:not(:disabled){opacity:.9}.walk-path-btn-play:disabled{opacity:.5;cursor:not-allowed}.walk-path-btn-stop{flex:1;height:32px;padding:0 16px;background:#ef4444;color:#fff}.walk-path-btn-stop:hover:not(:disabled){opacity:.9}.walk-path-btn-stop:disabled{opacity:.5;cursor:not-allowed}.walk-path-btn-small{height:28px;padding:0 12px;font-size:12px;background:var(--bim-bg-elevated, #1f2d3e);color:var(--bim-text-primary, #fff);border:1px solid var(--bim-border-default, #334155)}.walk-path-btn-small:hover{background:var(--bim-border-default, #334155)}.walk-path-btn-danger{color:#ef4444}.walk-path-settings{display:flex;flex-direction:column;gap:12px;margin-bottom:16px}.walk-path-form-group{display:flex;flex-direction:column;gap:6px}.walk-path-form-group label{font-size:12px;color:var(--bim-text-secondary, #94a3b8)}.walk-path-form-group-inline{flex-direction:row;align-items:center}.walk-path-input{padding:8px 12px;border:1px solid var(--bim-border-default, #334155);border-radius:4px;background:var(--bim-bg-elevated, #1f2d3e);color:var(--bim-text-primary, #fff);font-size:14px;width:100%;box-sizing:border-box}.walk-path-input:focus{outline:none;border-color:var(--bim-primary, #3b82f6)}.walk-path-input-wrapper{display:flex;align-items:center;gap:8px}.walk-path-input-wrapper .walk-path-input{flex:1}.walk-path-unit{color:var(--bim-text-secondary, #94a3b8);font-size:14px}.walk-path-checkbox{width:16px;height:16px;margin-right:8px}.walk-path-points-section{margin-bottom:16px}.walk-path-points-toolbar{display:flex;gap:8px;margin-bottom:12px}.walk-path-points-list{height:200px;overflow-y:auto;display:flex;flex-direction:column;gap:8px}.walk-path-empty{text-align:center;padding:32px 16px;color:var(--bim-text-secondary, #94a3b8);font-size:14px}.walk-path-point-item{display:flex;justify-content:space-between;align-items:center;padding:6px 12px;background:var(--bim-bg-elevated, #1f2d3e);border-radius:4px;transition:all .2s}.walk-path-point-item:hover{background:var(--bim-border-default, #334155)}.walk-path-point-item:hover .walk-path-point-actions{opacity:1}.walk-path-point-item-active{background:var(--bim-primary, #3b82f6)}.walk-path-point-item-active .walk-path-point-name{color:#fff}.walk-path-point-item-active .walk-path-point-actions{opacity:1}.walk-path-point-name{font-size:14px;color:var(--bim-text-primary, #fff)}.walk-path-point-actions{display:flex;gap:8px;opacity:0;transition:opacity .2s}.walk-path-btn-icon{width:28px;height:28px;border:none;border-radius:4px;background:transparent;color:var(--bim-text-primary, #fff);cursor:pointer;display:flex;align-items:center;justify-content:center;font-size:14px}.walk-path-btn-icon:hover{background:#ffffff1a}.walk-path-btn-icon-danger:hover{background:#ef444433;color:#ef4444}.bim-measure-panel{width:100%;display:flex;flex-direction:column;box-sizing:border-box;color:var(--bim-text-secondary)}.bim-measure-settings{display:none;box-sizing:border-box;color:var(--bim-text-secondary)}.bim-measure-settings-title{font-size:14px;font-weight:600;margin-bottom:10px}.bim-measure-settings-row{display:flex;align-items:center;justify-content:space-between;gap:10px;margin-bottom:10px}.bim-measure-settings-row .label{color:var(--bim-text-secondary);font-size:13px;flex:0 0 auto}.bim-measure-settings-select{flex:0 0 auto;width:120px;height:28px;border-radius:6px;border:1px solid var(--bim-border-default);background:var(--bim-bg-inset);color:var(--bim-text-primary);padding:0 8px;box-sizing:border-box;outline:none}.bim-measure-settings-hint{font-size:12px;line-height:1.4;color:var(--bim-text-tertiary);margin-top:-4px;margin-bottom:8px}.bim-measure-settings-actions{margin-top:14px;display:flex;justify-content:flex-start;gap:10px}.bim-measure-settings-save,.bim-measure-settings-cancel{flex:0 0 auto!important;width:auto;min-width:0;height:30px;padding:0 12px;border-radius:4px;cursor:pointer;box-sizing:border-box}.bim-measure-settings-save{border:none;background:var(--bim-primary);color:var(--bim-text-inverse)}.bim-measure-settings-cancel{border:1px solid var(--bim-border-default);background:transparent;color:var(--bim-text-secondary)}.bim-measure-settings-save:hover,.bim-measure-settings-save:active,.bim-measure-settings-save:focus,.bim-measure-settings-cancel:hover,.bim-measure-settings-cancel:active,.bim-measure-settings-cancel:focus{background:inherit;outline:none}.bim-measure-settings-save:hover{background:var(--bim-primary-hover)}.bim-measure-tools{display:flex;flex-direction:column;gap:8px}.bim-measure-tool-grid{display:grid;grid-template-columns:repeat(4,1fr);gap:8px}.bim-measure-tool-btn{width:100%;height:42px;border-radius:6px;border:1px solid var(--bim-border-default);background:var(--bim-bg-inset);cursor:pointer;display:flex;align-items:center;justify-content:center;transition:all .2s ease;padding:0;box-sizing:border-box}.bim-measure-tool-btn:hover{background:var(--bim-component-bg-hover);border-color:var(--bim-border-strong)}.bim-measure-tool-btn.is-active{border-color:var(--bim-primary);background:var(--bim-primary-subtle)}.bim-measure-tool-btn.is-active .bim-measure-tool-icon{color:var(--bim-primary)}.bim-measure-tool-icon{width:28px;height:28px;display:inline-flex;align-items:center;justify-content:center;color:var(--bim-icon-default)}.bim-measure-tool-icon svg{width:100%;height:100%;fill:currentColor}.bim-measure-toggle{display:flex;justify-content:flex-end}.bim-measure-toggle-btn{height:22px;border-radius:4px;border:1px solid var(--bim-border-default);background:var(--bim-bg-inset);cursor:pointer;display:inline-flex;align-items:center;justify-content:center;transition:all .2s ease;padding:0 6px;gap:4px;font-size:12px;line-height:1}.bim-measure-toggle-btn:hover{background:var(--bim-component-bg-hover);border-color:var(--bim-border-strong)}.bim-measure-toggle-text{color:var(--bim-text-secondary)}.bim-measure-toggle-icon svg{width:14px;height:14px;fill:currentColor;color:var(--bim-icon-default);transition:transform .15s ease}.bim-measure-toggle-btn.is-expanded .bim-measure-toggle-icon svg{transform:rotate(180deg)}.bim-measure-mode-options{display:none;flex-direction:column;gap:8px;margin-top:12px;padding-top:12px;border-top:1px solid var(--bim-divider)}.bim-measure-mode-options.is-visible{display:flex}.bim-measure-radio-group{display:flex;align-items:center;gap:8px;font-size:13px;line-height:1.4}.bim-measure-radio-group .bim-measure-radio-label{color:var(--bim-text-secondary);min-width:58px;flex:0 0 auto}.bim-measure-radio-group .bim-measure-radio-items{display:flex;gap:4px}.bim-measure-radio-item{display:inline-flex;align-items:center;justify-content:center;height:26px;padding:0 10px;border-radius:4px;border:1px solid var(--bim-border-default);background:var(--bim-bg-inset);color:var(--bim-text-secondary);font-size:12px;cursor:pointer;transition:all .15s ease;-webkit-user-select:none;user-select:none}.bim-measure-radio-item:hover{border-color:var(--bim-border-strong);color:var(--bim-text-primary)}.bim-measure-radio-item.is-active{background:var(--bim-primary-subtle);border-color:var(--bim-primary);color:var(--bim-primary)}.bim-measure-result{margin-top:12px;padding-top:12px;border-top:1px solid var(--bim-divider);display:flex;flex-direction:column;gap:10px}.bim-measure-row{display:flex;align-items:baseline;gap:8px;font-size:13px;line-height:1.4}.bim-measure-row .label{color:var(--bim-text-secondary);min-width:84px}.bim-measure-row .value{color:var(--bim-text-primary);flex:1;word-break:break-word}.bim-measure-main-number{color:#ffd24a}.bim-measure-main-number.is-laser-text,.bim-measure-main-unit{color:var(--bim-text-primary)}.bim-measure-xyz{display:flex;flex-direction:column;gap:6px}.bim-measure-xyz .value{font-variant-numeric:tabular-nums}.bim-measure-xyz-x{color:#ff4d4f!important}.bim-measure-xyz-y{color:#52c41a!important}.bim-measure-xyz-z{color:#1677ff!important}.bim-measure-footer{margin-top:12px;padding-top:10px;border-top:1px solid var(--bim-divider);display:flex;align-items:center;justify-content:flex-start;gap:10px}.bim-measure-clear-btn{background:transparent;border:none;color:var(--bim-danger);cursor:pointer;padding:0;font-size:13px;flex:0 0 auto!important;width:auto;min-width:0}.bim-measure-clear-btn:hover,.bim-measure-clear-btn:active,.bim-measure-clear-btn:focus{background:transparent;border:none;outline:none;text-decoration:none}.bim-measure-settings-btn{width:24px;height:24px;border-radius:4px;border:none;background:transparent;cursor:pointer;display:inline-flex;align-items:center;justify-content:center;padding:0;margin-left:auto;flex:0 0 auto!important}.bim-measure-settings-btn:hover,.bim-measure-settings-btn:active,.bim-measure-settings-btn:focus{background:transparent;border:none;outline:none}.bim-measure-settings-btn svg{width:18px;height:18px;fill:currentColor;color:var(--bim-icon-default)}.section-plane-panel{display:flex;gap:8px;padding:12px 12px 16px;box-sizing:border-box}.section-plane-btn{flex:1;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:4px;padding:10px;border:1px solid var(--bim-border-default);background:var(--bim-bg-inset);border-radius:8px;cursor:pointer;transition:all .2s ease;min-width:60px;outline:none;color:var(--bim-text-primary)}.section-plane-btn:hover{background:var(--bim-component-bg-hover);border-color:var(--bim-border-strong)}.section-plane-btn:active{background:var(--bim-primary-subtle);border-color:var(--bim-primary)}.section-plane-btn.is-active{background:var(--bim-primary-subtle);border-color:var(--bim-primary);color:var(--bim-primary)}.section-plane-btn.is-active .section-plane-btn-icon{color:var(--bim-primary)}.section-plane-btn-icon{width:24px;height:24px;display:flex;align-items:center;justify-content:center;color:var(--bim-icon-default)}.section-plane-btn-icon svg{width:100%;height:100%;fill:currentColor}.section-plane-btn-label{font-size:12px;color:inherit;text-align:center;line-height:1.2}.section-axis-panel{display:flex;flex-direction:column;gap:8px;padding:12px 12px 16px;box-sizing:border-box}.section-axis-row-1{display:flex;gap:8px;padding-bottom:8px;border-bottom:1px solid var(--bim-divider)}.section-axis-row-2{display:flex;gap:8px;padding-top:8px}.section-axis-btn{flex:1;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:4px;padding:8px;background:var(--bim-bg-inset);border:1px solid var(--bim-border-default);border-radius:8px;cursor:pointer;transition:all .2s ease;outline:none;color:var(--bim-text-primary);min-height:48px}.section-axis-btn:hover{background:var(--bim-component-bg-hover);border-color:var(--bim-border-strong)}.section-axis-btn.active{background:var(--bim-primary-subtle);border-color:var(--bim-primary);color:var(--bim-primary)}.section-axis-btn.active .section-axis-btn-icon{color:var(--bim-primary)}.section-axis-btn-icon{width:24px;height:24px;display:inline-flex;align-items:center;justify-content:center;color:var(--bim-icon-default)}.section-axis-btn-icon svg{width:100%;height:100%}.section-axis-btn-label{font-size:12px;color:inherit;text-align:center;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:100%}.section-axis-btn-text{min-height:40px}.section-axis-btn-text .section-axis-btn-label{font-size:18px;font-weight:600}.section-box-panel{display:flex;flex-direction:column;padding:12px;box-sizing:border-box;-webkit-user-select:none;user-select:none}.section-box-row-buttons{display:flex;gap:6px;padding-bottom:12px;border-bottom:1px solid var(--bim-divider)}.section-box-btn{flex:1;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:4px;padding:6px;background:var(--bim-bg-inset);border:1px solid var(--bim-border-default);border-radius:8px;cursor:pointer;color:var(--bim-text-primary);min-height:44px;transition:all .2s ease}.section-box-btn:hover{background:var(--bim-component-bg-hover);border-color:var(--bim-border-strong)}.section-box-btn.active{background:var(--bim-primary-subtle);border-color:var(--bim-primary);color:var(--bim-primary)}.section-box-btn.active .section-box-btn-icon{color:var(--bim-primary)}.section-box-btn-icon{width:24px;height:24px;color:var(--bim-icon-default)}.section-box-btn-icon svg{width:100%;height:100%}.section-box-btn-label{font-size:11px;white-space:nowrap}.section-box-sliders{display:flex;flex-direction:column;gap:16px;padding-top:16px}.section-box-slider{display:flex;align-items:center;gap:12px;position:relative;z-index:1}.section-box-slider:hover{z-index:10}.section-box-slider-label{font-size:13px;font-weight:700;color:var(--bim-text-primary);min-width:14px}.section-box-slider-track{position:relative;flex:1;height:4px;background:var(--bim-border-default);border-radius:2px}.section-box-slider-range{position:absolute;top:0;height:100%;background:var(--bim-primary);border-radius:2px;pointer-events:none}.section-box-slider-handle{position:absolute;top:50%;width:14px;height:14px;background:var(--bim-bg-elevated);border:2px solid var(--bim-primary);border-radius:50%;transform:translate(-50%,-50%);cursor:grab;z-index:5;touch-action:none;transition:transform .2s,box-shadow .2s}.section-box-slider-handle:hover{transform:translate(-50%,-50%) scale(1.2);box-shadow:0 0 0 4px var(--bim-primary-subtle)}.section-box-slider-handle.dragging{cursor:grabbing;transform:translate(-50%,-50%) scale(1.2);background:var(--bim-primary)}.bim-collapse{background-color:var(--bim-bg-elevated);border:1px solid var(--bim-border-default);border-radius:8px;font-size:14px;color:var(--bim-text-primary)}.bim-collapse.is-ghost{background-color:transparent;border:none}.bim-collapse.is-ghost .bim-collapse-item{border-bottom:none}.bim-collapse.is-ghost .bim-collapse-header{background-color:var(--bim-component-bg);padding-left:12px;padding-right:0;border-bottom:1px solid var(--bim-border-default)}.bim-collapse.is-ghost .bim-collapse-header:hover{background-color:var(--bim-component-bg-hover)}.bim-collapse.is-ghost .bim-collapse-content{background-color:transparent;border-top:none}.bim-collapse-item{border-bottom:1px solid var(--bim-border-subtle)}.bim-collapse-item:last-child{border-bottom:none}.bim-collapse-item.is-disabled .bim-collapse-header{color:var(--bim-text-disabled);cursor:not-allowed}.bim-collapse-header{display:flex;align-items:center;padding:12px 16px;background-color:var(--bim-component-bg);cursor:pointer;transition:all .2s ease;position:relative}.bim-collapse-header:hover{background-color:var(--bim-component-bg-hover)}.bim-collapse-arrow{margin-right:12px;font-size:12px;width:12px;height:12px;transition:transform .24s;display:inline-flex;align-items:center;justify-content:center}.bim-collapse-arrow svg{width:100%;height:100%;fill:currentColor}.bim-collapse-item.is-active .bim-collapse-arrow{transform:rotate(90deg)}.bim-collapse-icon{margin-right:8px;display:inline-flex;align-items:center}.bim-collapse-icon svg{width:16px;height:16px;fill:currentColor}.bim-collapse-title{flex:1;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}.bim-collapse-extra{margin-left:auto}.bim-collapse-content{overflow:hidden;background-color:var(--bim-bg-elevated);border-top:1px solid var(--bim-border-subtle);transition:height .2s ease-in-out,opacity .2s ease-in-out}.bim-collapse-content.is-hidden{display:none}.bim-ai-chat{position:absolute;width:440px;height:600px;display:flex;flex-direction:column;background:var(--bim-ai-panel, rgba(11, 18, 32, .95));border:1px solid var(--bim-ai-border, rgba(255, 255, 255, .1));border-radius:16px;backdrop-filter:blur(18px);-webkit-backdrop-filter:blur(18px);box-shadow:0 12px 32px var(--bim-ai-shadow, rgba(0, 0, 0, .4));z-index:1000;font-family:Public Sans,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,sans-serif;overflow:hidden;resize:both;min-width:360px;min-height:400px;max-width:90vw;max-height:90vh}.bim-ai-chat-header{display:flex;align-items:center;justify-content:space-between;height:56px;padding:12px 16px;border-bottom:1px solid var(--bim-ai-border, rgba(255, 255, 255, .1));flex-shrink:0;cursor:move;-webkit-user-select:none;user-select:none;border-radius:16px 16px 0 0}.bim-ai-chat-title{font-size:18px;font-weight:600;color:var(--bim-ai-text, #E5E7EB)}.bim-ai-chat-actions{display:flex;gap:8px}.bim-ai-chat-action-btn{width:32px;height:32px;border-radius:999px;border:1px solid var(--bim-ai-border, rgba(255, 255, 255, .1));background:transparent;color:var(--bim-ai-text, #E5E7EB);cursor:pointer;display:flex;align-items:center;justify-content:center;transition:all .2s ease}.bim-ai-chat-action-btn:hover{background:var(--bim-ai-subtle-fill, rgba(255, 255, 255, .05))}.bim-ai-chat-action-btn svg{width:18px;height:18px}.bim-ai-chat-messages{flex:1;overflow-y:auto;padding:12px;display:flex;flex-direction:column;gap:10px}.bim-ai-msg-ai{max-width:320px}.bim-ai-msg-ai .bim-ai-bubble{background:var(--bim-ai-panel2, rgba(15, 23, 42, .95));border:1px solid var(--bim-ai-border, rgba(255, 255, 255, .1));border-radius:16px;padding:10px}.bim-ai-msg-ai .bim-ai-bubble-content{font-size:13px;line-height:1.4;color:var(--bim-ai-text, #E5E7EB)}.bim-ai-msg-user{display:flex;justify-content:flex-end}.bim-ai-msg-user .bim-ai-bubble{max-width:300px;background:var(--bim-ai-user-bubble, rgba(29, 78, 216, .8));border-radius:16px;padding:10px;box-shadow:0 10px 26px #0003}.bim-ai-msg-user .bim-ai-bubble-content{font-size:13px;line-height:1.4;color:var(--bim-ai-user-text, #EEF2FF)}.bim-ai-step{display:flex;align-items:center;gap:10px;padding:10px;border-radius:14px;max-width:380px}.bim-ai-step-running{background:var(--bim-ai-info-soft, rgba(56, 189, 248, .1));border:1px solid rgba(56,189,248,.33)}.bim-ai-step-done{background:var(--bim-ai-success-soft, rgba(52, 211, 153, .1));border:1px solid rgba(52,211,153,.33)}.bim-ai-step-error{background:var(--bim-ai-danger-soft, rgba(239, 68, 68, .1));border:1px solid var(--bim-ai-danger-stroke, rgba(239, 68, 68, .33))}.bim-ai-step-icon{width:16px;height:16px;flex-shrink:0}.bim-ai-step-running .bim-ai-step-icon{color:var(--bim-ai-info, #38BDF8)}.bim-ai-step-done .bim-ai-step-icon{color:var(--bim-ai-success, #34D399)}.bim-ai-step-error .bim-ai-step-icon{color:var(--bim-ai-danger, #EF4444)}.bim-ai-step-text{font-size:12px;line-height:1.4;color:var(--bim-ai-text, #E5E7EB)}.bim-ai-thinking{display:flex;align-items:center;gap:10px;padding:10px;border-radius:14px;background:var(--bim-ai-panel2, rgba(15, 23, 42, .95));border:1px solid var(--bim-ai-border, rgba(255, 255, 255, .1));max-width:380px}.bim-ai-thinking-icon{width:16px;height:16px;color:var(--bim-ai-muted, #94A3B8);animation:bim-ai-spin 1s linear infinite}.bim-ai-thinking-text{font-size:12px;font-weight:600;color:var(--bim-ai-muted, #94A3B8)}@keyframes bim-ai-spin{0%{transform:rotate(0)}to{transform:rotate(360deg)}}.bim-ai-question-active{width:360px;border-radius:14px;background:var(--bim-ai-panel2, rgba(15, 23, 42, .95));border:1px solid var(--bim-ai-accent-stroke, rgba(59, 130, 246, .33));box-shadow:0 4px 16px var(--bim-ai-shadow, rgba(0, 0, 0, .4));overflow:hidden}.bim-ai-question-header{display:flex;align-items:center;gap:8px;padding:12px;border-bottom:1px solid var(--bim-ai-border, rgba(255, 255, 255, .1))}.bim-ai-question-icon{width:24px;height:24px;border-radius:6px;background:var(--bim-ai-accent-soft, rgba(59, 130, 246, .1));display:flex;align-items:center;justify-content:center;color:var(--bim-ai-accent, #3B82F6)}.bim-ai-question-icon svg{width:14px;height:14px}.bim-ai-question-title{font-size:13px;font-weight:600;color:var(--bim-ai-text, #E5E7EB)}.bim-ai-question-content{padding:12px;display:flex;flex-direction:column;gap:10px}.bim-ai-question-text{font-size:13px;line-height:1.4;color:var(--bim-ai-text, #E5E7EB)}.bim-ai-question-options{display:flex;flex-direction:column;gap:6px}.bim-ai-option{display:flex;align-items:center;gap:8px;padding:8px 10px;border-radius:8px;background:var(--bim-ai-subtle-fill, rgba(255, 255, 255, .05));border:1px solid var(--bim-ai-border, rgba(255, 255, 255, .1));cursor:pointer;transition:all .2s ease}.bim-ai-option:hover{background:var(--bim-ai-subtle-fill-hover, rgba(255, 255, 255, .08))}.bim-ai-option.selected{background:var(--bim-ai-accent-soft, rgba(59, 130, 246, .1));border-color:var(--bim-ai-accent-stroke, rgba(59, 130, 246, .33))}.bim-ai-option-radio{width:16px;height:16px;border-radius:50%;border:1.5px solid var(--bim-ai-muted, #94A3B8);flex-shrink:0;display:flex;align-items:center;justify-content:center}.bim-ai-option.selected .bim-ai-option-radio{background:var(--bim-ai-accent, #3B82F6);border-color:var(--bim-ai-accent, #3B82F6)}.bim-ai-option-radio-dot{width:6px;height:6px;border-radius:50%;background:var(--bim-ai-accent-ink, #FFFFFF);display:none}.bim-ai-option.selected .bim-ai-option-radio-dot{display:block}.bim-ai-option-text{font-size:12px;color:var(--bim-ai-text, #E5E7EB)}.bim-ai-option-input{flex:1;background:var(--bim-ai-textbox-fill, rgba(15, 23, 42, .6));border:1px solid var(--bim-ai-border, rgba(255, 255, 255, .1));border-radius:6px;padding:6px 8px;font-size:12px;color:var(--bim-ai-text, #E5E7EB);outline:none;margin-top:8px;width:100%}.bim-ai-option-input:focus{border-color:var(--bim-ai-accent-stroke, rgba(59, 130, 246, .33))}.bim-ai-question-footer{display:flex;justify-content:flex-end;padding:12px;border-top:1px solid var(--bim-ai-border, rgba(255, 255, 255, .1))}.bim-ai-question-submit{display:flex;align-items:center;gap:4px;padding:8px 12px;border-radius:8px;background:var(--bim-ai-accent, #3B82F6);color:var(--bim-ai-accent-ink, #FFFFFF);border:none;cursor:pointer;font-size:12px;font-weight:600;transition:all .2s ease}.bim-ai-question-submit:hover{filter:brightness(1.1)}.bim-ai-question-submit svg{width:12px;height:12px}.bim-ai-question-answered{max-width:340px;padding:10px;border-radius:12px;background:var(--bim-ai-panel2, rgba(15, 23, 42, .95));border:1px solid var(--bim-ai-border, rgba(255, 255, 255, .1));display:flex;flex-direction:column;gap:8px}.bim-ai-qa-row{display:flex;gap:8px;align-items:flex-start}.bim-ai-qa-badge{width:18px;height:18px;border-radius:5px;display:flex;align-items:center;justify-content:center;font-size:10px;font-weight:700;flex-shrink:0}.bim-ai-qa-badge-q{background:var(--bim-ai-accent-soft, rgba(59, 130, 246, .1));color:var(--bim-ai-accent, #3B82F6)}.bim-ai-qa-badge-a{background:var(--bim-ai-success-soft, rgba(52, 211, 153, .1));color:var(--bim-ai-success, #34D399)}.bim-ai-qa-question{font-size:12px;line-height:1.4;color:var(--bim-ai-muted, #94A3B8)}.bim-ai-qa-answer{font-size:12px;line-height:1.4;color:var(--bim-ai-text, #E5E7EB)}.bim-ai-chat-composer{padding:12px;border-top:1px solid var(--bim-ai-border, rgba(255, 255, 255, .1));display:flex;flex-direction:column;gap:8px;flex-shrink:0}.bim-ai-quick-prompts{display:flex;gap:8px;flex-wrap:wrap}.bim-ai-quick-prompt{padding:5px 8px;border-radius:999px;background:var(--bim-ai-subtle-fill, rgba(255, 255, 255, .05));border:1px solid var(--bim-ai-border, rgba(255, 255, 255, .1));color:var(--bim-ai-text, #E5E7EB);font-size:12px;font-weight:600;cursor:pointer;transition:all .2s ease}.bim-ai-quick-prompt:hover{background:var(--bim-ai-subtle-fill-hover, rgba(255, 255, 255, .08))}.bim-ai-input-row{display:flex;gap:8px;align-items:flex-end}.bim-ai-textbox{flex:1;display:flex;flex-direction:column;gap:6px;padding:10px;border-radius:16px;background:var(--bim-ai-textbox-fill, rgba(15, 23, 42, .6));border:1px solid var(--bim-ai-border, rgba(255, 255, 255, .1))}.bim-ai-textbox:focus-within{border-color:var(--bim-ai-accent-stroke, rgba(59, 130, 246, .33))}.bim-ai-textarea{background:transparent;border:none;outline:none;resize:none;font-size:13px;line-height:1.4;color:var(--bim-ai-text, #E5E7EB);min-height:20px;max-height:100px}.bim-ai-textarea::placeholder{color:var(--bim-ai-muted, #94A3B8)}.bim-ai-helper{display:flex;justify-content:space-between;font-size:11px;color:var(--bim-ai-muted, #94A3B8)}.bim-ai-send-btn{width:40px;height:40px;border-radius:14px;background:var(--bim-ai-accent, #3B82F6);border:none;cursor:pointer;display:flex;align-items:center;justify-content:center;color:var(--bim-ai-accent-ink, #FFFFFF);transition:background .2s ease;flex-shrink:0}.bim-ai-send-btn:hover{background:var(--bim-ai-accent-hover, #2563EB)}.bim-ai-send-btn svg{width:18px;height:18px}.bim-ai-chat.light{--bim-ai-panel: rgba(255, 255, 255, .95);--bim-ai-panel2: #FFFFFF;--bim-ai-border: rgba(15, 23, 42, .1);--bim-ai-text: #0F172A;--bim-ai-muted: #475569;--bim-ai-shadow: rgba(11, 18, 32, .1);--bim-ai-subtle-fill: rgba(15, 23, 42, .05);--bim-ai-subtle-fill-hover: rgba(15, 23, 42, .08);--bim-ai-textbox-fill: #F1F5F9;--bim-ai-user-bubble: #2563EB;--bim-ai-user-text: #FFFFFF;--bim-ai-accent: #2563EB;--bim-ai-accent-soft: rgba(37, 99, 235, .08);--bim-ai-accent-stroke: rgba(37, 99, 235, .2);--bim-ai-success: #059669;--bim-ai-success-soft: rgba(5, 150, 105, .08);--bim-ai-danger: #DC2626;--bim-ai-danger-soft: rgba(220, 38, 38, .08);--bim-ai-danger-stroke: rgba(220, 38, 38, .2);--bim-ai-info: #0284C7;--bim-ai-info-soft: rgba(2, 132, 199, .08)}.bim-btn-group-root{display:flex;gap:8px;z-index:1000;position:absolute;pointer-events:auto;background:transparent}.bim-btn-group-root.static{position:relative;inset:auto;transform:none}.bim-btn-group-root.dir-row{flex-direction:row;align-items:center}.bim-btn-group-root.dir-column{flex-direction:column;align-items:stretch}.bim-btn-group-section{display:flex;gap:4px;background-color:var(--bim-btn-group-section-bg, rgba(17, 17, 17, .88));border-radius:6px;padding:4px;box-shadow:0 2px 8px #0000004d,0 1px 3px #0003}.bim-btn-group-root.dir-row .bim-btn-group-section{flex-direction:row;align-items:center}.bim-btn-group-root.dir-column .bim-btn-group-section{flex-direction:column}.opt-btn-wrapper{position:relative}.opt-btn{display:flex;cursor:pointer;border-radius:4px;transition:background-color .2s,color .2s,border-color .2s;color:var(--bim-btn-text-color, #ccc);background-color:var(--bim-btn-bg, transparent);padding:6px;align-items:center;position:relative;justify-content:center;border:1px solid transparent;outline:none}.opt-btn:hover{background-color:var(--bim-btn-hover-bg, #444)}.opt-btn.active{background-color:var(--bim-btn-active-bg, rgba(255, 255, 255, .15));color:var(--bim-btn-text-active-color, #fff)}.opt-btn.disabled{opacity:.5;cursor:not-allowed}.opt-btn-icon{width:var(--bim-icon-size, 24px);height:var(--bim-icon-size, 24px);display:flex;align-items:center;justify-content:center;color:var(--bim-icon-color, #ccc);flex-shrink:0}.opt-btn-icon svg{width:100%;height:100%;fill:currentColor}.opt-btn-arrow{font-size:10px;opacity:.6;transition:transform .2s;display:inline-block;margin-left:4px}.opt-btn-arrow.rotated{transform:rotate(180deg)}.opt-btn-text-wrapper{display:flex;align-items:center;justify-content:center;pointer-events:none}.opt-btn-label{display:inline}.opt-btn.no-label .opt-btn-label{display:none}.opt-btn.align-vertical:not(.no-label){flex-direction:column;text-align:center}.opt-btn.align-vertical:not(.no-label) .opt-btn-text-wrapper{margin-top:4px}.opt-btn.align-vertical:not(.no-label) .opt-btn-label{font-size:12px;line-height:1.2}.opt-btn.align-horizontal:not(.no-label){flex-direction:row}.opt-btn.align-horizontal:not(.no-label) .opt-btn-text-wrapper{margin-left:8px}.opt-btn.align-horizontal:not(.no-label) .opt-btn-label{font-size:14px}.opt-btn.no-label .opt-btn-text-wrapper{width:0;height:0;margin:0;padding:0;overflow:visible;position:absolute;top:0;right:0}.opt-btn.no-label .opt-btn-arrow{position:absolute;top:2px;right:2px;margin:0;font-size:8px}.opt-btn-dropdown{position:absolute;background-color:var(--bim-toolbar-bg, rgba(17, 17, 17, .95));border-radius:4px;padding:4px;box-shadow:0 4px 12px #0003;z-index:1001;display:flex;flex-direction:column;border:1px solid rgba(255,255,255,.1);opacity:0;visibility:hidden;transform:translateY(-10px);transition:opacity .2s ease,transform .2s cubic-bezier(.2,0,.2,1),visibility .2s}@keyframes dropdown-fade-in{0%{opacity:0;transform:translateY(-8px) scale(.98)}to{opacity:1;transform:translateY(0) scale(1)}}.opt-btn-dropdown{animation:dropdown-fade-in .2s cubic-bezier(.2,0,.2,1) forwards;opacity:1;visibility:visible;transform:none}.opt-btn-dropdown-item{display:flex;align-items:center;padding:8px 12px;cursor:pointer;border-radius:4px;color:var(--bim-btn-text-color, #ccc);transition:background .2s,border-color .2s,color .2s;box-sizing:border-box;border:1px solid transparent;outline:none}.opt-btn-dropdown-item .opt-btn-icon{color:var(--bim-icon-color, #ccc)}.opt-btn-dropdown-item:hover{background-color:var(--bim-btn-hover-bg, #444)}.opt-btn-dropdown-item.active{background-color:var(--bim-btn-active-bg, rgba(255, 255, 255, .15));color:var(--bim-btn-text-active-color, #fff)}.opt-btn-dropdown-item.align-horizontal{flex-direction:row}.opt-btn-dropdown-item.align-horizontal .opt-btn-icon{width:18px;height:18px;margin-right:8px}.opt-btn-dropdown-item.align-vertical{flex-direction:column;text-align:center}.opt-btn-dropdown-item.align-vertical .opt-btn-icon{width:24px;height:24px;margin-bottom:4px}.opt-btn-dropdown-item.align-vertical .opt-btn-dropdown-label{font-size:12px}.bim-btn-group-root.is-bottom-toolbar .opt-btn-icon{width:32px;height:32px}.bim-btn-group-root.is-bottom-toolbar .opt-btn{padding:8px}.bim-btn-group-root.is-bottom-toolbar.dir-row{max-width:calc(100% - 40px);overflow-x:auto;overflow-y:visible;scrollbar-width:thin;scrollbar-color:rgba(255,255,255,.2) transparent}.bim-btn-group-root.is-bottom-toolbar.dir-row .bim-btn-group-section{flex-shrink:0}.bim-btn-group-root.is-bottom-toolbar.dir-row::-webkit-scrollbar{height:4px}.bim-btn-group-root.is-bottom-toolbar.dir-row::-webkit-scrollbar-track{background:transparent}.bim-btn-group-root.is-bottom-toolbar.dir-row::-webkit-scrollbar-thumb{background:#fff3;border-radius:2px}.bim-btn-group-root.is-bottom-toolbar.dir-row::-webkit-scrollbar-thumb:hover{background:#fff6}.bim-btn-group-root.type-glass-pill .bim-btn-group-section{background:var(--bim-floating-bg);backdrop-filter:blur(24px);-webkit-backdrop-filter:blur(24px);border:1px solid var(--bim-floating-border);border-radius:9999px;box-shadow:none;padding:8px;gap:10px}.bim-btn-group-root.type-glass-pill .opt-btn{width:48px;height:48px;min-width:48px;border-radius:9999px;background:var(--bim-floating-btn-bg);border:1px solid var(--bim-floating-btn-border);box-shadow:var(--bim-floating-btn-shadow);color:var(--bim-text-primary);padding:0;transition:all .2s ease-out}.bim-btn-group-root.type-glass-pill .opt-btn:hover{background:var(--bim-floating-btn-bg-hover);transform:scale(1.05);box-shadow:var(--bim-floating-btn-shadow-hover)}.bim-btn-group-root.type-glass-pill .opt-btn:active{transform:scale(.98)}.bim-btn-group-root.type-glass-pill .opt-btn.active{background:var(--bim-primary);border:1px solid var(--bim-primary-active);color:var(--bim-text-inverse);box-shadow:var(--bim-shadow-glow)}.bim-btn-group-root.type-glass-pill .opt-btn.active:hover{background:var(--bim-primary-hover);transform:scale(1.05)}.bim-btn-group-root.type-glass-pill .opt-btn.active:active{transform:scale(.98)}.bim-btn-group-root.type-glass-pill .opt-btn.active .opt-btn-icon{color:var(--bim-icon-inverse)}.bim-btn-group-root.type-glass-pill .opt-btn.disabled{opacity:.3;cursor:not-allowed;transform:none;box-shadow:none}.bim-btn-group-root.type-glass-pill .opt-btn-icon{width:18px;height:18px;color:var(--bim-floating-icon-color);transition:color .2s ease-out}.bim-btn-group-root.type-glass-pill .opt-btn-icon svg{width:18px;height:18px}.bim-btn-group-root.type-glass-pill .opt-btn:hover .opt-btn-icon{color:var(--bim-floating-icon-color-hover)}.bim-btn-group-root.type-glass-pill .opt-btn-label{display:none!important}.bim-btn-group-root.type-glass-pill .opt-btn-text-wrapper{position:absolute;top:2px;right:2px;width:0;height:0;margin:0;padding:0}.bim-btn-group-root.type-glass-pill .opt-btn-arrow{font-size:8px;position:absolute;top:0;right:0;color:var(--bim-text-tertiary)}.opt-btn-dropdown.type-glass-pill{background:#fffffff2;backdrop-filter:blur(10px);-webkit-backdrop-filter:blur(10px);border:1px solid rgba(226,232,240,.6);border-radius:12px;box-shadow:0 8px 24px #0000001f;padding:6px}.opt-btn-dropdown.type-glass-pill .opt-btn-dropdown-item{display:flex;flex-direction:row;align-items:center;gap:10px;border-radius:8px;color:#334155;padding:8px 12px;font-size:13px;font-weight:400;transition:all .1s ease-out}.opt-btn-dropdown.type-glass-pill .opt-btn-dropdown-item:hover{background:#f1f5f9}.opt-btn-dropdown.type-glass-pill .opt-btn-dropdown-item:active{background:#e2e8f0}.opt-btn-dropdown.type-glass-pill .opt-btn-dropdown-item.active{background:#3b82f6;color:#fff}.opt-btn-dropdown.type-glass-pill .opt-btn-dropdown-item.active .opt-btn-icon,.opt-btn-dropdown.type-glass-pill .opt-btn-dropdown-item.active .opt-btn-dropdown-label{color:#fff}.opt-btn-dropdown.type-glass-pill .opt-btn-dropdown-item .opt-btn-icon{width:18px;height:18px;color:#334155;flex-shrink:0}.opt-btn-dropdown.type-glass-pill .opt-btn-dropdown-item .opt-btn-icon svg{width:18px;height:18px}.opt-btn-dropdown.type-glass-pill .opt-btn-dropdown-item .opt-btn-dropdown-label{white-space:nowrap;color:#334155}.opt-btn-dropdown.type-glass-pill.theme-dark{background:var(--bim-bg-overlay);backdrop-filter:blur(10px);-webkit-backdrop-filter:blur(10px);border:1px solid var(--bim-border-default);box-shadow:var(--bim-shadow-lg)}.opt-btn-dropdown.type-glass-pill.theme-dark .opt-btn-dropdown-item{color:var(--bim-text-primary)}.opt-btn-dropdown.type-glass-pill.theme-dark .opt-btn-dropdown-item:hover{background:var(--bim-floating-btn-bg)}.opt-btn-dropdown.type-glass-pill.theme-dark .opt-btn-dropdown-item:active{background:var(--bim-floating-btn-bg-hover)}.opt-btn-dropdown.type-glass-pill.theme-dark .opt-btn-dropdown-item.active{background:var(--bim-primary);color:var(--bim-text-inverse)}.opt-btn-dropdown.type-glass-pill.theme-dark .opt-btn-dropdown-item .opt-btn-icon{color:var(--bim-floating-icon-color)}.opt-btn-dropdown.type-glass-pill.theme-dark .opt-btn-dropdown-item .opt-btn-dropdown-label{color:var(--bim-text-primary)}.bim-tree{width:100%;height:100%;display:flex;flex-direction:column;overflow:hidden;font-size:14px;color:var(--bim-text-primary);-webkit-user-select:none;user-select:none;position:relative;background:transparent}.bim-tree-search{padding:6px;background-color:transparent;flex-shrink:0;position:relative}.bim-tree-search-wrapper{position:relative;width:100%;display:flex;align-items:center}.bim-tree-search-icon{position:absolute;left:8px;width:16px;height:16px;color:var(--bim-text-secondary);pointer-events:none;display:flex;align-items:center;justify-content:center}.bim-tree-search-icon svg{width:100%;height:100%}.bim-tree-search-input{width:100%;height:30px;padding:4px 8px 4px 30px;border:1px solid var(--bim-border-default);border-radius:4px;outline:none;font-size:13px;color:inherit;background-color:var(--bim-bg-elevated);transition:all .2s;box-sizing:border-box}.bim-tree-search-input:focus{border-color:var(--bim-primary);box-shadow:var(--bim-focus-ring)}.bim-tree-search-results{position:absolute;top:100%;left:8px;right:8px;background-color:var(--bim-bg-elevated);border:1px solid var(--bim-border-default);box-shadow:var(--bim-shadow-md);border-radius:4px;max-height:200px;overflow-y:auto;z-index:10;display:none}.bim-tree-search-results.is-visible{display:block}.bim-tree-search-item{padding:8px 12px;cursor:pointer;border-bottom:1px solid rgba(0,0,0,.03)}.bim-tree-search-item:last-child{border-bottom:none}.bim-tree-search-item:hover{background-color:var(--bim-component-bg-hover)}.bim-tree-search-item-title{font-weight:500;display:block}.bim-tree-search-item-path{font-size:12px;color:var(--bim-text-secondary);margin-top:2px;display:block}.bim-tree-node-content:hover{background-color:var(--bim-component-bg-hover)}.bim-tree-switcher{width:24px;height:32px;display:flex;align-items:center;justify-content:center;cursor:pointer;color:var(--bim-text-secondary);transition:transform .2s;flex-shrink:0}.bim-tree-switcher svg{width:12px;height:12px;fill:currentColor;transition:transform .2s}.bim-tree-switcher.is-expanded svg{transform:rotate(90deg)}.bim-tree-switcher.is-hidden{visibility:hidden}.bim-tree-checkbox{width:16px;height:16px;border:1px solid var(--bim-border-default);border-radius:2px;margin-right:8px;background-color:var(--bim-bg-elevated);position:relative;cursor:pointer;flex-shrink:0;transition:all .2s}.bim-tree-checkbox:hover{border-color:var(--bim-primary)}.bim-tree-checkbox.is-checked{background-color:var(--bim-primary);border-color:var(--bim-primary)}.bim-tree-checkbox.is-checked:after{content:"";position:absolute;top:1px;left:4px;width:5px;height:9px;border:2px solid var(--bim-text-inverse);border-top:0;border-left:0;transform:rotate(45deg)}.bim-tree-checkbox.is-indeterminate{background-color:var(--bim-bg-elevated);border-color:var(--bim-primary)}.bim-tree-checkbox.is-indeterminate:after{content:"";position:absolute;top:6px;left:3px;width:8px;height:2px;background-color:var(--bim-primary)}.bim-tree-node.is-disabled .bim-tree-checkbox{background-color:var(--bim-component-bg-disabled);border-color:var(--bim-border-disabled);cursor:not-allowed}.bim-tree-node.is-disabled .bim-tree-checkbox.is-checked{background-color:var(--bim-text-disabled)}.bim-tree-node.is-disabled .bim-tree-node-content{color:var(--bim-text-disabled);cursor:not-allowed}.bim-tree-icon{width:16px;height:16px;margin-right:6px;display:flex;align-items:center;justify-content:center;flex-shrink:0}.bim-tree-icon img,.bim-tree-icon svg{width:100%;height:100%}.bim-tree-title{flex:1;white-space:nowrap}.bim-tree-children{display:none;overflow:visible}.bim-tree-children.is-visible{display:block}.bim-tree-node-content.is-selected{background-color:var(--bim-component-bg-selected);color:var(--bim-primary)}.bim-tree-node-actions{display:none;align-items:center;margin-left:8px;flex-shrink:0}.bim-tree-node-content.is-selected .bim-tree-node-actions{display:flex}.bim-tree-content{flex:1;overflow-y:auto;overflow-x:hidden;overscroll-behavior:contain;scroll-behavior:auto;padding:2px 0;min-height:0}.bim-tree-node{display:flex;flex-direction:column;width:100%}.bim-tree-node-content{display:flex;align-items:center;height:32px;cursor:pointer;transition:background-color .2s;border-radius:4px;padding-right:8px;width:100%;box-sizing:border-box}.bim-tab{display:flex;flex-direction:column;width:100%;height:100%;background:transparent;color:var(--bim-text-secondary)}.bim-tab__nav{display:flex;align-items:center;gap:4px;padding:4px;margin:8px 12px;background:var(--bim-bg-inset);border-radius:8px;border:1px solid var(--bim-border-subtle)}.bim-tab__item{flex:1;display:inline-flex;align-items:center;justify-content:center;gap:6px;padding:8px 12px;border:none;border-radius:6px;background:transparent;color:var(--bim-text-secondary);cursor:pointer;transition:all .2s ease;font-size:13px;font-weight:500}.bim-tab__item:hover{color:var(--bim-text-primary);background-color:var(--bim-component-bg-hover)}.bim-tab__item.is-active{color:var(--bim-primary);background-color:var(--bim-bg-elevated);box-shadow:0 1px 3px #0000001a}.bim-tab__item.is-disabled{opacity:.5;cursor:not-allowed}.bim-tab__icon{width:16px;height:16px;display:inline-flex;align-items:center;justify-content:center;color:var(--bim-tab-icon, currentColor)}.bim-tab__icon svg{width:100%;height:100%;fill:currentColor}.bim-tab__title{white-space:nowrap}.bim-tab__content{flex:1;display:flex;position:relative;min-height:0;overflow:hidden}.bim-tab__panel{display:none;width:100%;height:100%;flex:1}.bim-tab__panel.is-active{display:flex;flex-direction:column;height:100%}.construct-tab__container{height:100%;display:flex;flex-direction:column}.construct-tab__panel-content{flex:1;display:flex;flex-direction:column;min-height:0;overflow:hidden}.construct-tab__panel-content .bim-tree{flex:1}')),document.head.appendChild(e)}}catch(o){console.error("vite-plugin-css-injected-by-js",o)}})();
1
+ (function(){"use strict";try{if(typeof document<"u"){var e=document.createElement("style");e.appendChild(document.createTextNode('.bim-engine-wrapper{position:relative;width:100%;height:100%;font-family:sans-serif;box-sizing:border-box;overflow:hidden;background:linear-gradient(to bottom,#d6e0eb,#f6faff)}.bim-engine-opt-btn-container{z-index:100}.bim-construct-tree-btn{position:absolute;top:20px;left:20px!important;z-index:100}.bim-engine-version{position:absolute;bottom:6px;left:10px;font-size:11px;color:#00000040;pointer-events:none;-webkit-user-select:none;user-select:none;z-index:1;font-family:system-ui,-apple-system,sans-serif;letter-spacing:.3px}.bim-engine-size{position:absolute;bottom:6px;left:56px;font-size:11px;color:#00000059;pointer-events:none;-webkit-user-select:none;user-select:none;z-index:1;font-family:system-ui,-apple-system,sans-serif;letter-spacing:.3px}.bim-dialog{position:absolute;background-color:var(--bim-bg-elevated);border:1px solid var(--bim-border-default);border-radius:var(--bim-panel-radius, 12px);box-shadow:var(--bim-shadow-lg);display:flex;flex-direction:column;z-index:10001;color:var(--bim-dialog-title-color, var(--bim-text-primary));overflow:hidden;min-width:200px;min-height:100px;pointer-events:auto}.bim-dialog-header{height:40px;background-color:var(--bim-bg-inset);display:flex;align-items:center;justify-content:space-between;padding:0 12px;cursor:default;-webkit-user-select:none;user-select:none;border-bottom:1px solid var(--bim-border-default);flex-shrink:0}.bim-dialog-header.draggable{cursor:move}.bim-dialog-title{font-size:14px;font-weight:500;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;color:var(--bim-dialog-title-color)}.bim-dialog-close{cursor:pointer;font-size:18px;color:var(--bim-text-tertiary);line-height:1;margin-left:8px}.bim-dialog-close:hover{color:var(--bim-text-primary)}.bim-dialog-content{flex:1;overflow:auto;font-size:14px;color:var(--bim-dialog-text-color, var(--bim-text-secondary))}.bim-dialog-resize-handle{position:absolute;width:10px;height:10px;bottom:0;right:0;cursor:se-resize;z-index:10}.bim-dialog-resize-handle:after{content:"";position:absolute;bottom:3px;right:3px;width:6px;height:6px;border-right:2px solid var(--bim-text-tertiary);border-bottom:2px solid var(--bim-text-tertiary)}.bim-dialog-resize-handle:hover:after{border-color:var(--bim-text-primary)}.originRotate{width:10px;height:10px;background-color:red}.versionText{position:absolute;right:10px;color:#86d9ff;z-index:1000;bottom:0;font-size:10px;background:transparent;pointer-events:none}.originDiv{position:absolute;top:100px;left:100px;width:30px;height:30px;border-radius:50%;z-index:1000;pointer-events:none}.tagDiv{color:gray;background:#fffc;padding:5px;font-size:12px}.catchPoint{pointer-events:none;stroke:#08dfd7;fill:transparent;stroke-width:2}.catchLine{position:absolute;width:10px;height:10px;pointer-events:none;background-color:green}.catchPlane{position:absolute;width:10px;height:10px;pointer-events:none;background-color:#ff0}.ViewCube{position:absolute;width:120px;height:120px;top:0;right:0;z-index:999}.homeViewWrapper{position:absolute;cursor:pointer;pointer-events:auto;background-image:url(/assets/viewcube/home.png);background-size:100% 100%;background-repeat:no-repeat;background-color:#fff0;color:#fff;top:10px;right:100;width:20px;height:20px;z-index:999;user-select:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none}.viewSettingWrapper{position:absolute;cursor:pointer;pointer-events:auto;background-size:100% 100%;background-repeat:no-repeat;font-weight:800;background-color:#fff0;color:#fff;top:30px;right:100;width:20px;height:20px;z-index:999;user-select:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none}.cameraToggleWrapper{position:absolute;cursor:pointer;pointer-events:auto;background-color:#ffffffe6;color:#333;font-size:26px;font-weight:700;display:none;align-items:center;justify-content:center;border-radius:4px;box-shadow:0 2px 4px #0003;transition:all .3s ease;top:70px;right:90px;width:44px;height:44px;z-index:999;user-select:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none}.cameraToggleWrapper.show{display:flex}.cameraToggleWrapper:hover{background-color:#fff;box-shadow:0 3px 6px #0000004d;transform:scale(1.1)}.screenshotWrapper{position:absolute;cursor:pointer;pointer-events:auto;background-color:#ffffffe6;color:#333;font-size:20px;display:none;align-items:center;justify-content:center;border-radius:4px;box-shadow:0 2px 4px #0003;transition:all .3s ease;top:120px;right:90px;width:44px;height:44px;z-index:999;user-select:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none}.screenshotWrapper.show{display:flex}.screenshotWrapper:hover{background-color:#fff;box-shadow:0 3px 6px #0000004d;transform:scale(1.1)}.fullscreenWrapper{position:absolute;cursor:pointer;pointer-events:auto;background-color:#ffffffe6;color:#333;font-size:26px;font-weight:700;display:none;align-items:center;justify-content:center;border-radius:4px;box-shadow:0 2px 4px #0003;transition:all .3s ease;top:170px;right:90px;width:44px;height:44px;z-index:999;user-select:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none}.fullscreenWrapper.show{display:flex}.fullscreenWrapper:hover{background-color:#fff;box-shadow:0 3px 6px #0000004d;transform:scale(1.1)}.measure-elevation{position:absolute;pointer-events:none}.measureSvg{position:absolute;width:1920px;height:1080px}.catch-point{position:absolute;width:10px;height:10px;background-color:red;border-radius:50%;pointer-events:none}.annotation-container{position:absolute;pointer-events:none;top:0;left:0}.measureLine{position:absolute;pointer-events:none;stroke:#009bea;fill:#009bea;filter:drop-shadow(1px 1px 2px rgba(0,0,0,.3))}.measureBack{cursor:pointer;pointer-events:auto;fill:#fff;padding:5px;top:-50px;rx:5;ry:5;filter:drop-shadow(1px 1px 2px rgba(0,0,0,.3))}.measureLabel{position:absolute;fill:#fff;font-size:14px;stroke:#009bea;font-weight:100;pointer-events:none}.measurePointer{fill:#009bea}.Hight{stroke:#fff;font-weight:500;filter:drop-shadow(2px 1px 2px rgba(255,255,255,1))}.allow-select{pointer-events:auto}.disallow-select{pointer-events:none}.angle-annotation{position:absolute;pointer-events:auto}.MapController{-webkit-touch-callout:none;-webkit-user-select:none;-khtml-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.engine-2d-container{position:relative;width:100%;height:100%;overflow:hidden}.engine-2d-canvas{display:block;width:100%;height:100%;outline:none}.engine-2d-cad-cursor{position:absolute;top:0;left:0;width:100%;height:100%;pointer-events:none;overflow:hidden}.engine-2d-cad-cursor__h{position:absolute;left:0;width:100%;height:1px;background:var(--e2d-cursor, rgba(255, 255, 255, .85));transform:translateY(-50%)}.engine-2d-cad-cursor__v{position:absolute;top:0;width:1px;height:100%;background:var(--e2d-cursor, rgba(255, 255, 255, .85));transform:translate(-50%)}.engine-2d-cad-cursor__box{position:absolute;width:8px;height:8px;border:1px solid var(--e2d-cursor, rgba(255, 255, 255, .85));transform:translate(-50%,-50%)}.engine-2d-context-menu{position:absolute;z-index:9999;min-width:140px;background:var(--e2d-bg2, #252526);border:1px solid var(--e2d-border, rgba(255, 255, 255, .12));border-radius:4px;box-shadow:0 4px 16px var(--e2d-shadow, rgba(0, 0, 0, .5));padding:4px 0;display:none;-webkit-user-select:none;user-select:none}.engine-2d-context-menu--visible{display:block}.engine-2d-context-menu__item{padding:7px 16px;font-size:13px;color:var(--e2d-text2, #cccccc);cursor:pointer;white-space:nowrap;transition:background .1s,color .1s}.engine-2d-context-menu__item:hover{background:var(--e2d-bg-accent, #094771);color:var(--e2d-text-accent, #ffffff)}.engine-2d-context-menu__divider{height:1px;background:var(--e2d-border, rgba(255, 255, 255, .1));margin:4px 0}.engine-2d-stats{position:absolute;top:10px;left:10px;background:var(--e2d-float-bg, rgba(0, 0, 0, .7));color:var(--e2d-text, #e0e0e0);padding:8px 12px;border-radius:4px;font-family:monospace;font-size:12px;pointer-events:none;-webkit-user-select:none;user-select:none}.engine-2d-stats div{margin:2px 0}.engine-2d-loading{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);background:var(--e2d-float-bg, rgba(0, 0, 0, .8));color:var(--e2d-text, #e0e0e0);padding:20px 40px;border-radius:8px;font-size:16px;text-align:center}.engine-2d-loading-spinner{border:3px solid var(--e2d-border, rgba(255, 255, 255, .3));border-top:3px solid var(--e2d-accent, #4fc3f7);border-radius:50%;width:40px;height:40px;animation:engine-2d-spin 1s linear infinite;margin:0 auto 10px}@keyframes engine-2d-spin{0%{transform:rotate(0)}to{transform:rotate(360deg)}}.engine-2d-error{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);background:#d32f2feb;color:#fff;padding:20px 40px;border-radius:8px;font-size:14px;max-width:80%;text-align:center}.engine-2d-controls-hint{position:absolute;bottom:10px;left:10px;background:var(--e2d-float-bg, rgba(0, 0, 0, .6));color:var(--e2d-text, #e0e0e0);border:1px solid var(--e2d-float-border, rgba(255, 255, 255, .08));padding:8px 12px;border-radius:4px;font-size:12px;pointer-events:none;-webkit-user-select:none;user-select:none}.engine-2d-controls-hint kbd{background:var(--e2d-icon-bg, rgba(255, 255, 255, .2));color:var(--e2d-text, #e0e0e0);padding:2px 6px;border-radius:3px;font-family:monospace}.engine-2d-search{position:absolute;top:0;left:0;width:100%;height:100%;pointer-events:none;z-index:9998;display:none}.engine-2d-search--visible{display:block}.engine-2d-search__box{position:absolute;top:14%;left:50%;transform:translate(-50%);width:480px;max-width:calc(100% - 40px);background:var(--e2d-bg, #1e1f22);border:1px solid var(--e2d-border, rgba(255, 255, 255, .14));border-radius:10px;box-shadow:0 8px 40px var(--e2d-shadow-lg, rgba(0, 0, 0, .65)),0 2px 8px var(--e2d-shadow, rgba(0, 0, 0, .4));overflow:hidden;pointer-events:auto;animation:engine-2d-search-in .18s cubic-bezier(.34,1.2,.64,1)}@keyframes engine-2d-search-in{0%{opacity:0;transform:translate(-50%) translateY(-8px) scale(.97)}to{opacity:1;transform:translate(-50%) translateY(0) scale(1)}}.engine-2d-search__input-row{display:flex;align-items:center;padding:0 12px;gap:8px;height:48px}.engine-2d-search__icon{flex-shrink:0;color:var(--e2d-icon, rgba(255, 255, 255, .4));display:flex;align-items:center}.engine-2d-search__input{flex:1;background:transparent;border:none;outline:none;color:var(--e2d-text, #e0e0e0);font-size:14px;line-height:1.4;caret-color:var(--e2d-accent, #4fc3f7)}.engine-2d-search__input::placeholder{color:var(--e2d-text3, rgba(255, 255, 255, .25))}.engine-2d-search__clear{flex-shrink:0;background:var(--e2d-icon-bg, rgba(255, 255, 255, .08));border:none;border-radius:4px;color:var(--e2d-icon, rgba(255, 255, 255, .5));cursor:pointer;display:flex;align-items:center;justify-content:center;width:22px;height:22px;padding:0;opacity:0;pointer-events:none;transition:opacity .15s,background .15s,color .15s}.engine-2d-search__clear:hover{background:var(--e2d-icon-bg-hover, rgba(255, 255, 255, .16));color:var(--e2d-close-hover, #ffffff)}.engine-2d-search__divider{height:1px;background:var(--e2d-border2, rgba(255, 255, 255, .08));display:none}.engine-2d-search__status{padding:6px 16px;font-size:11px;color:var(--e2d-text3, rgba(255, 255, 255, .35));display:none;-webkit-user-select:none;user-select:none}.engine-2d-search__list{list-style:none;margin:0;padding:4px 0;max-height:320px;overflow-y:auto;display:none;scrollbar-width:thin;scrollbar-color:var(--e2d-scrollbar, rgba(255, 255, 255, .15)) transparent}.engine-2d-search__list::-webkit-scrollbar{width:4px}.engine-2d-search__list::-webkit-scrollbar-track{background:transparent}.engine-2d-search__list::-webkit-scrollbar-thumb{background:var(--e2d-scrollbar, rgba(255, 255, 255, .15));border-radius:2px}.engine-2d-search__item{display:flex;align-items:center;gap:8px;padding:8px 14px;cursor:pointer;transition:background .1s;min-height:38px;flex-wrap:nowrap}.engine-2d-search__item:hover,.engine-2d-search__item--active{background:var(--e2d-bg-hover, rgba(79, 195, 247, .08))}.engine-2d-search__item-badge{flex-shrink:0;font-size:10px;font-weight:500;padding:2px 6px;border-radius:3px;letter-spacing:.03em;white-space:nowrap}.engine-2d-search__item-name{flex:1;font-size:13px;color:var(--e2d-text, #e0e0e0);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.engine-2d-search__item-layer{flex-shrink:0;font-size:11px;color:var(--e2d-text3, rgba(255, 255, 255, .3));white-space:nowrap;max-width:100px;overflow:hidden;text-overflow:ellipsis}.engine-2d-search__item-desc{flex-shrink:0;font-size:11px;color:var(--e2d-text4, rgba(255, 255, 255, .25));white-space:nowrap;max-width:120px;overflow:hidden;text-overflow:ellipsis}.engine-2d-search__mark{background:transparent;color:var(--e2d-accent, #4fc3f7);font-weight:600}.engine-2d-mouse-coord{position:absolute;bottom:10px;left:50%;transform:translate(-50%);display:flex;align-items:center;gap:12px;background:var(--e2d-float-bg, rgba(0, 0, 0, .65));color:var(--e2d-text, #e0e0e0);padding:5px 14px;border-radius:4px;font-family:monospace;font-size:12px;pointer-events:none;-webkit-user-select:none;user-select:none;border:1px solid var(--e2d-float-border, rgba(255, 255, 255, .08))}.engine-2d-mouse-coord__label{color:var(--e2d-coord-label, rgba(255, 255, 255, .45));font-size:11px;letter-spacing:.05em}.engine-2d-mouse-coord__value{min-width:90px;color:var(--e2d-coord-value, #76c8ff)}.panorama-annotation-container{position:absolute;top:0;left:0;width:100%;height:100%;pointer-events:none;z-index:1000;overflow:hidden}.panorama-annotation{position:absolute;pointer-events:auto;cursor:pointer;transform:translate(-50%,-50%);transition:opacity .2s ease,transform .2s ease;user-select:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none}.panorama-annotation:hover{z-index:1001;transform:translate(-50%,-50%) scale(1.1)}.panorama-annotation-icon{width:40px;height:40px}.panorama-annotation-icon img{width:100%;height:100%;object-fit:contain;display:block;filter:drop-shadow(0 2px 4px rgba(0,0,0,.3))}.panorama-annotation-text{max-width:200px;text-align:center;line-height:1.4}.panorama-annotation-link{transition:background-color .2s ease,transform .2s ease}.panorama-annotation-link:hover{z-index:1002}.panorama-annotation-link img{display:block;flex-shrink:0}.panorama-annotation.hidden{display:none!important}@keyframes pulse{0%,to{opacity:1}50%{opacity:.5}}.panorama-annotation.loading{animation:pulse 1.5s ease-in-out infinite}@media(max-width:768px){.panorama-annotation-icon{width:32px;height:32px}.panorama-annotation-text,.panorama-annotation-link{font-size:12px!important;padding:6px 10px!important}}.bim-right-key{position:fixed;z-index:10000;display:none;background:transparent}.bim-right-key.visible{display:block}.bim-menu{display:flex;flex-direction:column;background:var(--bim-bg-elevated);border:1px solid var(--bim-border-default);border-radius:8px;padding:6px;margin:0;list-style:none;box-shadow:var(--bim-shadow-lg);font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,sans-serif;-webkit-user-select:none;user-select:none;color:var(--bim-text-primary)}.bim-menu-group{display:flex;flex-direction:column}.bim-menu-divider{height:1px;background-color:var(--bim-divider);margin:4px 0}.bim-menu-item{display:flex;align-items:center;padding:8px 12px;cursor:pointer;transition:all .2s ease;font-size:13px;position:relative;color:var(--bim-text-primary);border-radius:6px}.bim-menu-item:hover{background-color:var(--bim-component-bg-hover)}.bim-menu-item.disabled{opacity:.5;cursor:not-allowed;pointer-events:none}.bim-menu-item-icon{display:none}.bim-menu.has-icons .bim-menu-item-icon{width:16px;height:16px;margin-right:8px;display:flex;align-items:center;justify-content:center;flex-shrink:0}.bim-menu-item-icon svg{width:100%;height:100%;fill:currentColor}.bim-menu-item-label{flex:1;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.bim-menu-item-arrow{width:12px;height:12px;margin-left:8px;display:flex;align-items:center;justify-content:center;opacity:.7}.bim-menu-item-arrow svg{width:100%;height:100%;fill:currentColor}.radial-toolbar-wrapper{position:absolute;right:20px;bottom:20px;z-index:1000;pointer-events:none}.radial-main-btn,.radial-sub-btn{border:1px solid transparent;border-radius:9999px;display:flex;align-items:center;justify-content:center;cursor:pointer;pointer-events:auto;outline:none;transition:transform .22s ease,opacity .22s ease,box-shadow .22s ease,background-color .22s ease,color .22s ease}.radial-main-btn{position:absolute;right:0;bottom:0;width:var(--rt-main-size, 70px);height:var(--rt-main-size, 70px);background:var(--rt-main-bg, rgba(255, 255, 255, .92));border-color:var(--rt-main-border, rgba(203, 213, 225, .65));box-shadow:var(--rt-main-shadow, 0 4px 12px rgba(0, 0, 0, .12));color:var(--rt-main-icon, #334155)}.radial-main-btn:hover{transform:translateZ(0) scale(1.04);background:var(--rt-main-bg-hover, #ffffff);box-shadow:var(--rt-main-shadow-hover, 0 6px 20px rgba(0, 0, 0, .14));color:var(--rt-main-icon-hover, #1e293b)}.radial-main-btn:active{transform:translateZ(0) scale(.97)}.radial-main-btn svg{width:34px;height:34px}.radial-sub-btn{position:absolute;right:var(--rt-main-offset, 10px);bottom:var(--rt-main-offset, 10px);width:var(--rt-sub-size, 50px);height:var(--rt-sub-size, 50px);background:var(--rt-sub-bg, rgba(255, 255, 255, .9));border-color:var(--rt-sub-border, rgba(203, 213, 225, .65));box-shadow:var(--rt-sub-shadow, 0 2px 8px rgba(0, 0, 0, .1));color:var(--rt-sub-icon, #334155);opacity:0;transform:translate(0) scale(.76);transform-origin:center;--rt-delay-current: var(--rt-close-delay, 0s);transition-delay:var(--rt-delay-current)}.radial-toolbar-wrapper.is-active .radial-sub-btn{--rt-delay-current: var(--rt-open-delay, 0s);opacity:1;transform:translate(var(--rt-x),var(--rt-y)) scale(1)}.radial-sub-btn:hover{background:var(--rt-sub-bg-hover, var(--bim-primary, #2563eb));box-shadow:var(--rt-sub-shadow-hover, 0 4px 14px rgba(0, 0, 0, .16));color:var(--rt-sub-icon-hover, var(--bim-text-inverse, #ffffff))}.radial-sub-btn.is-active,.radial-sub-btn[data-active=true]{background:var(--bim-primary, #2563eb);border:1px solid var(--bim-primary-active, #1d4ed8);box-shadow:var(--bim-shadow-glow, 0 0 0 2px rgba(37, 99, 235, .28));color:var(--bim-text-inverse, #ffffff)}.radial-sub-btn.is-active:hover,.radial-sub-btn[data-active=true]:hover{background:var(--bim-primary-hover, #3b82f6)}.radial-sub-btn.is-active .radial-sub-btn-icon,.radial-sub-btn[data-active=true] .radial-sub-btn-icon{color:var(--bim-icon-inverse, #ffffff)}.radial-sub-btn:active{transform:translate(var(--rt-x),var(--rt-y)) scale(.94)}.radial-sub-btn-icon{width:22px;height:22px;display:flex;align-items:center;justify-content:center}.radial-sub-btn-icon svg{width:100%;height:100%}.bottom-dock-stack{position:absolute;left:50%;bottom:20px;transform:translate(-50%);width:0;height:0;z-index:1000;pointer-events:none}.bottom-dock-panel{position:absolute;left:50%;bottom:0;transform:translate(-50%);width:fit-content;max-width:calc(100vw - 40px);pointer-events:auto;border-radius:12px;border:1px solid var(--bd-border, rgba(148, 163, 184, .35));background:var(--bd-bg, rgba(255, 255, 255, .94));box-shadow:var(--bd-shadow, 0 2px 8px rgba(15, 23, 42, .1));transition:transform .22s ease,opacity .2s ease;overflow:visible;z-index:1}.bottom-dock-panel:hover,.bottom-dock-panel:focus-within{z-index:10}.bottom-dock-panel.is-entering{opacity:0}.bottom-dock-panel.is-leaving{opacity:0;pointer-events:none}.bottom-dock-panel-close{position:absolute;top:5px;right:5px;transform:translate(35%,-35%);z-index:2;width:16px;height:16px;border-radius:6px;border:1px solid transparent;background:transparent;color:var(--bd-close-color, #475569);display:inline-flex;align-items:center;justify-content:center;cursor:pointer;transition:background-color .16s ease,color .16s ease,border-color .16s ease}.bottom-dock-panel-close:hover{background:var(--bd-close-bg-hover, rgba(15, 23, 42, .08));color:var(--bd-close-color-hover, #0f172a);border-color:var(--bd-close-border-hover, rgba(148, 163, 184, .3))}.bottom-dock-panel-close:active{transform:translate(35%,-35%) scale(.96)}.bottom-dock-panel-body{min-height:50px;padding:10px;background:var(--bd-body-bg, transparent);width:fit-content;max-width:calc(100vw - 40px);box-sizing:border-box;border-radius:inherit}.bottom-dock-placeholder{border-radius:8px;border:1px dashed var(--bd-placeholder-border, rgba(148, 163, 184, .55));padding:10px;color:var(--bd-placeholder-text, #64748b);font-size:12px;line-height:1.5;text-align:center}.measure-dock-panel{width:fit-content;max-width:100%;padding:0;border-radius:8px;border:none;box-sizing:border-box;color:var(--bim-text-secondary, #475569);font-size:13px;line-height:1.5}.measure-dock-panel-main{display:block}.measure-dock-panel-settings{display:none;flex-direction:column;gap:6px;min-height:74px;box-sizing:border-box}.measure-dock-settings-row{display:flex;align-items:center;justify-content:space-between;gap:8px}.measure-dock-settings-label{color:var(--bim-text-secondary, #64748b);font-size:12px}.measure-dock-settings-select{width:88px;height:24px;border-radius:6px;border:1px solid rgba(148,163,184,.36);background:color-mix(in srgb,var(--bim-bg-inset, #edf1f6) 90%,#ffffff 10%);color:var(--bim-text-primary, #0f172a);font-size:12px;padding:0 6px;box-sizing:border-box}.measure-dock-settings-actions{display:flex;justify-content:flex-end;gap:8px}.measure-dock-settings-btn{height:24px;min-width:52px;border-radius:6px;border:1px solid rgba(148,163,184,.36);background:color-mix(in srgb,var(--bim-bg-inset, #edf1f6) 90%,#ffffff 10%);color:var(--bim-text-secondary, #64748b);font-size:12px;line-height:1;cursor:pointer}.measure-dock-settings-btn.is-save{border-color:color-mix(in srgb,var(--bim-primary, #4f88ff) 46%,transparent 54%);color:color-mix(in srgb,var(--bim-primary, #4f88ff) 78%,#6f9dff 22%)}.measure-dock-panel-top{display:flex;align-items:center;justify-content:space-between;gap:10px}.measure-dock-clearheight-options{display:none;flex-direction:column;gap:8px;margin-bottom:10px;padding:8px;border-radius:8px;border:1px solid rgba(148,163,184,.28);background:color-mix(in srgb,var(--bim-bg-inset, #edf1f6) 90%,#ffffff 10%)}.measure-dock-clearheight-options.is-visible{display:flex}.measure-dock-clearheight-group{display:flex;align-items:center;gap:8px}.measure-dock-clearheight-label{min-width:60px;color:var(--bim-text-secondary, #64748b);font-size:12px}.measure-dock-clearheight-buttons{display:flex;gap:8px}.measure-dock-clearheight-btn{height:28px;padding:0 10px;border-radius:6px;border:1px solid rgba(148,163,184,.36);background:color-mix(in srgb,var(--bim-bg-elevated, #f8fafc) 88%,#ffffff 12%);color:var(--bim-text-secondary, #64748b);font-size:12px;line-height:1;cursor:pointer;transition:all .15s ease}.measure-dock-clearheight-btn:hover{border-color:#94a3b88f}.measure-dock-clearheight-btn.is-active{border-color:color-mix(in srgb,var(--bim-primary, #4f88ff) 70%,#9db9ff 30%);background:color-mix(in srgb,var(--bim-primary-subtle, rgba(96, 140, 255, .18)) 72%,#ffffff 28%);color:color-mix(in srgb,var(--bim-primary, #4f88ff) 78%,#6f9dff 22%)}.measure-dock-panel-mode-zone{flex:1;min-width:0;display:flex;flex-direction:column;gap:10px}.measure-dock-panel-mode-row{display:grid;grid-template-columns:repeat(5,32px);gap:10px}.measure-dock-panel-mode-row-secondary{display:none}.measure-dock-panel-mode-btn{width:32px;height:32px;border-radius:8px;border:1px solid rgba(148,163,184,.28);background:color-mix(in srgb,var(--bim-bg-inset, #edf1f6) 92%,#ffffff 8%);color:color-mix(in srgb,var(--bim-text-secondary, #64748b) 94%,#475569 6%);display:inline-flex;align-items:center;justify-content:center;padding:0;box-sizing:border-box;cursor:pointer;transition:all .15s ease}.measure-dock-panel-mode-icon{width:20px;height:20px;display:inline-flex;align-items:center;justify-content:center}.measure-dock-panel-mode-icon svg{width:100%;height:100%;fill:currentColor}.measure-dock-panel-mode-btn:hover{border-color:#94a3b880;background:color-mix(in srgb,var(--bim-component-bg-hover, #dce5f2) 64%,#ffffff 36%)}.measure-dock-panel-mode-btn.is-active{border-color:color-mix(in srgb,var(--bim-primary, #4f88ff) 70%,#9db9ff 30%);color:color-mix(in srgb,var(--bim-primary, #4f88ff) 78%,#6f9dff 22%);box-shadow:inset 0 0 0 1px color-mix(in srgb,var(--bim-primary, #4f88ff) 35%,transparent 65%)}.measure-dock-panel-actions{flex:0 0 auto;display:flex;flex-direction:row;gap:10px;align-items:center}.measure-dock-panel-action-btn{width:32px;height:32px;border-radius:6px;border:1px solid rgba(148,163,184,.22);background:color-mix(in srgb,var(--bim-bg-inset, #edf1f6) 92%,#ffffff 8%);color:var(--bim-text-secondary, #475569);padding:0;box-sizing:border-box;display:inline-flex;align-items:center;justify-content:center;cursor:pointer;transition:all .15s ease}.measure-dock-panel-action-btn:hover{border-color:#94a3b880;color:var(--bim-text-primary, #0f172a)}.measure-dock-panel-action-btn svg{width:18px;height:18px;fill:currentColor}.measure-dock-panel-action-expand{width:16px;height:32px}.measure-dock-panel-action-expand.is-expanded{height:74px}.measure-dock-panel-action-expand.is-collapsed{height:32px}.measure-dock-panel-action-clear{background:color-mix(in srgb,var(--bim-danger, #ef4444) 16%,#ffffff 84%);border-color:color-mix(in srgb,var(--bim-danger, #ef4444) 26%,transparent 74%);color:var(--bim-danger, #ef4444)}.measure-dock-panel-action-clear:hover{border-color:color-mix(in srgb,var(--bim-danger, #ef4444) 40%,transparent 60%);color:var(--bim-danger, #ef4444)}.measure-dock-panel-action-settings{color:color-mix(in srgb,var(--bim-text-primary, #0f172a) 86%,#000 14%)}.measure-dock-panel-mode-row .measure-dock-panel-action-btn{border-radius:8px}.measure-dock-panel-action-expand svg{transition:transform .15s ease}.measure-dock-panel-action-expand.is-expanded svg{transform:rotate(180deg)}.measure-dock-panel [data-tooltip]{position:relative}.measure-dock-panel [data-tooltip]:after{content:attr(data-tooltip);position:absolute;left:50%;bottom:calc(100% + 6px);transform:translate(-50%);padding:4px 8px;border-radius:6px;background:#0f172aeb;color:#f8fafc;font-size:12px;line-height:1.2;white-space:nowrap;pointer-events:none;opacity:0;visibility:hidden;z-index:8;transition:opacity 60ms ease}.measure-dock-panel [data-tooltip]:hover:after,.measure-dock-panel [data-tooltip]:focus-visible:after{opacity:1;visibility:visible}@media(max-width:720px){.measure-dock-panel-top{flex-direction:column}.measure-dock-clearheight-group{flex-direction:column;align-items:flex-start;gap:6px}.measure-dock-panel-actions{width:100%;flex-direction:row;justify-content:flex-end}.measure-dock-panel-action-btn,.measure-dock-panel-mode-btn{width:32px;height:32px}.measure-dock-panel-action-expand{width:16px;height:32px}.measure-dock-panel-action-expand.is-expanded{height:74px}}.section-dock-panel{width:fit-content;max-width:100%;display:flex;flex-direction:column;gap:10px;color:var(--bim-text-secondary, #475569)}.section-dock-axis-panel{display:none;width:fit-content;border-radius:8px;padding:0;gap:10px}.section-dock-axis-panel.is-visible{display:flex}.section-dock-axis-btn{width:32px;height:32px;border-radius:8px;border:1px solid rgba(148,163,184,.28);background:color-mix(in srgb,var(--bim-bg-inset, #edf1f6) 92%,#ffffff 8%);color:color-mix(in srgb,var(--bim-text-secondary, #64748b) 94%,#475569 6%);font-size:16px;line-height:1;box-sizing:border-box;padding:0;cursor:pointer;transition:all .15s ease}.section-dock-axis-btn:hover{border-color:#94a3b880;background:color-mix(in srgb,var(--bim-component-bg-hover, #dce5f2) 64%,#ffffff 36%)}.section-dock-axis-btn.is-active{border-color:color-mix(in srgb,var(--bim-primary, #4f88ff) 70%,#9db9ff 30%);background:color-mix(in srgb,var(--bim-primary-subtle, rgba(96, 140, 255, .18)) 72%,#ffffff 28%);color:color-mix(in srgb,var(--bim-primary, #4f88ff) 78%,#6f9dff 22%)}.section-dock-main{display:flex;align-items:center;gap:10px;padding:0;border-radius:8px}.section-dock-types,.section-dock-tools{display:flex;align-items:center;gap:10px}.section-dock-divider{width:1px;height:32px;background:color-mix(in srgb,var(--bim-border-default, #cbd5e1) 84%,transparent 16%)}.section-dock-divider.is-hidden{display:none}.section-dock-type-btn,.section-dock-tool-btn{width:32px;height:32px;border:1px solid rgba(148,163,184,.28);border-radius:8px;background:color-mix(in srgb,var(--bim-bg-inset, #edf1f6) 92%,#ffffff 8%);color:color-mix(in srgb,var(--bim-text-secondary, #64748b) 94%,#475569 6%);display:inline-flex;align-items:center;justify-content:center;cursor:pointer;box-sizing:border-box;padding:0;transition:all .15s ease}.section-dock-type-btn:hover,.section-dock-tool-btn:hover{border-color:var(--bim-border-strong, rgba(100, 116, 139, .6));background:color-mix(in srgb,var(--bim-component-bg-hover, #dce5f2) 64%,#ffffff 36%)}.section-dock-type-btn.is-active,.section-dock-tool-btn.is-active{border-color:color-mix(in srgb,var(--bim-primary, #4f88ff) 70%,#9db9ff 30%);color:color-mix(in srgb,var(--bim-primary, #4f88ff) 78%,#6f9dff 22%)}.section-dock-type-icon,.section-dock-tool-icon{width:20px;height:20px;display:inline-flex;align-items:center;justify-content:center}.section-dock-type-icon svg,.section-dock-tool-icon svg{width:100%;height:100%;fill:currentColor}.section-dock-panel [data-tooltip]{position:relative}.section-dock-panel [data-tooltip]:after{content:attr(data-tooltip);position:absolute;left:50%;bottom:calc(100% + 6px);transform:translate(-50%);padding:4px 8px;border-radius:6px;background:#0f172aeb;color:#f8fafc;font-size:12px;line-height:1.2;white-space:nowrap;pointer-events:none;opacity:0;visibility:hidden;z-index:8;transition:opacity 60ms ease}.section-dock-panel [data-tooltip]:hover:after,.section-dock-panel [data-tooltip]:focus-visible:after{opacity:1;visibility:visible}.walk-control-panel.walk-dock-panel{gap:10px;padding:0;background:transparent;border:none;border-radius:8px;box-shadow:none;color:var(--bim-text-secondary, #64748b)}.walk-control-panel.walk-dock-panel .walk-divider{height:32px}.walk-control-panel.walk-dock-panel .walk-control-left,.walk-control-panel.walk-dock-panel .walk-control-settings{gap:10px}.walk-control-panel.walk-dock-panel .walk-icon-btn{width:32px;height:32px;padding:0;border-radius:8px;border:1px solid rgba(148,163,184,.28);background:color-mix(in srgb,var(--bim-bg-inset, #edf1f6) 92%,#ffffff 8%);color:color-mix(in srgb,var(--bim-text-secondary, #64748b) 94%,#475569 6%)}.walk-control-panel.walk-dock-panel .walk-icon-btn:hover{border-color:#94a3b880;background:color-mix(in srgb,var(--bim-component-bg-hover, #dce5f2) 64%,#ffffff 36%)}.walk-control-panel.walk-dock-panel .walk-icon-btn.active{border-color:color-mix(in srgb,var(--bim-primary, #4f88ff) 70%,#9db9ff 30%);background:color-mix(in srgb,var(--bim-primary-subtle, rgba(96, 140, 255, .18)) 72%,#ffffff 28%);color:color-mix(in srgb,var(--bim-primary, #4f88ff) 78%,#6f9dff 22%)}.walk-control-panel.walk-dock-panel .walk-icon-btn svg{width:20px;height:20px}.walk-control-panel.walk-dock-panel .walk-icon-btn.active svg{fill:currentColor}.walk-control-panel.walk-dock-panel .walk-speed-control{gap:8px}.walk-control-panel.walk-dock-panel .walk-speed-label,.walk-control-panel.walk-dock-panel .walk-checkbox-label,.walk-control-panel.walk-dock-panel .walk-select-label{font-size:12px}.walk-control-panel.walk-dock-panel .walk-speed-group{padding:2px;border:1px solid rgba(148,163,184,.28);background:color-mix(in srgb,var(--bim-bg-inset, #edf1f6) 92%,#ffffff 8%)}.walk-control-panel.walk-dock-panel .walk-speed-btn{width:24px;height:24px;font-size:14px;line-height:1;padding:0;display:inline-flex;align-items:center;justify-content:center;border:1px solid rgba(148,163,184,.28);background:color-mix(in srgb,var(--bim-bg-elevated, #f8fafc) 88%,#ffffff 12%);color:var(--bim-text-primary, #0f172a)}.walk-control-panel.walk-dock-panel .walk-speed-display{min-width:30px;font-size:12px;color:var(--bim-text-primary, #0f172a)}.walk-control-panel.walk-dock-panel .walk-checkbox{width:14px;height:14px;accent-color:var(--bim-primary, #3b82f6)}.walk-control-panel.walk-dock-panel .walk-select{min-width:90px;height:24px;padding:2px 8px;font-size:12px;border:1px solid rgba(148,163,184,.28);background:color-mix(in srgb,var(--bim-bg-inset, #edf1f6) 92%,#ffffff 8%);color:var(--bim-text-primary, #0f172a)}.walk-control-panel.walk-dock-panel .walk-exit-btn{height:32px;padding:0 12px;border-radius:8px;font-size:12px}.walk-control-panel{display:flex;align-items:center;gap:20px;padding:12px 20px;background-color:var(--bim-bg-base, #152232);border:1px solid var(--bim-border-strong, #475569);border-radius:12px;box-shadow:var(--bim-shadow-xl, 0 20px 40px rgba(0, 0, 0, .3));-webkit-user-select:none;user-select:none}.walk-divider{width:1px;height:40px;background:var(--bim-divider);flex-shrink:0}.walk-control-left{display:flex;gap:8px}.walk-icon-btn{width:48px;height:48px;display:flex;align-items:center;justify-content:center;background:var(--bim-bg-inset);border:1px solid var(--bim-border-default);border-radius:8px;cursor:pointer;transition:all .2s ease;color:var(--bim-icon-default);padding:8px}.walk-icon-btn:hover{background:var(--bim-component-bg-hover);border-color:var(--bim-border-strong)}.walk-icon-btn.active{background:var(--bim-primary-subtle);border-color:var(--bim-primary);color:var(--bim-primary)}.walk-icon-btn.active svg{fill:var(--bim-primary)}.walk-icon-btn svg{width:32px;height:32px}.walk-control-settings{display:flex;align-items:center;gap:16px;flex:1}.walk-speed-control{display:flex;align-items:center;gap:12px}.walk-speed-label{color:var(--bim-text-primary);font-size:14px;white-space:nowrap}.walk-speed-group{display:flex;align-items:center;gap:8px;background:var(--bim-bg-inset);border:1px solid var(--bim-border-subtle);border-radius:6px;padding:4px}.walk-speed-btn{width:32px;height:32px;background:var(--bim-bg-elevated);border:1px solid var(--bim-border-subtle);border-radius:4px;color:var(--bim-text-primary);font-size:18px;cursor:pointer;transition:all .2s ease}.walk-speed-btn:hover{background:var(--bim-component-bg-hover);border-color:var(--bim-border-strong)}.walk-speed-btn:disabled{opacity:.5;cursor:not-allowed}.walk-speed-display{min-width:40px;text-align:center;color:var(--bim-text-primary);font-size:14px;font-weight:700}.walk-checkbox-wrapper{display:flex;align-items:center;gap:8px;cursor:pointer}.walk-checkbox{width:18px;height:18px;cursor:pointer}.walk-checkbox:disabled{opacity:.5;cursor:not-allowed}.walk-checkbox-label{color:var(--bim-text-primary);font-size:14px;white-space:nowrap}.walk-checkbox-wrapper input:disabled+.walk-checkbox-label{opacity:.5}.walk-select-wrapper{display:flex;align-items:center;gap:8px}.walk-select-label{color:var(--bim-text-primary);font-size:14px;white-space:nowrap}.walk-select{padding:6px 12px;background:var(--bim-bg-inset);border:1px solid var(--bim-border-default);border-radius:6px;color:var(--bim-text-primary);font-size:14px;cursor:pointer;min-width:120px}.walk-select option{background:var(--bim-bg-elevated);color:var(--bim-text-primary)}.walk-exit-btn{padding:10px 24px;background:var(--bim-primary);border:none;border-radius:8px;color:var(--bim-text-inverse);font-size:14px;font-weight:600;cursor:pointer;transition:all .2s ease;white-space:nowrap}.walk-exit-btn:hover{background:var(--bim-primary-hover);transform:scale(1.02)}.walk-path-panel{padding:16px;box-sizing:border-box}.walk-path-btn{border:none;border-radius:6px;cursor:pointer;font-size:14px;transition:all .2s;box-sizing:border-box}.walk-path-btn-group{display:flex;gap:8px;margin-top:16px}.walk-path-btn-play{flex:1;height:32px;padding:0 16px;background:var(--bim-primary, #3b82f6);color:#fff}.walk-path-btn-play:hover:not(:disabled){opacity:.9}.walk-path-btn-play:disabled{opacity:.5;cursor:not-allowed}.walk-path-btn-stop{flex:1;height:32px;padding:0 16px;background:#ef4444;color:#fff}.walk-path-btn-stop:hover:not(:disabled){opacity:.9}.walk-path-btn-stop:disabled{opacity:.5;cursor:not-allowed}.walk-path-btn-small{height:28px;padding:0 12px;font-size:12px;background:var(--bim-bg-elevated, #1f2d3e);color:var(--bim-text-primary, #fff);border:1px solid var(--bim-border-default, #334155)}.walk-path-btn-small:hover{background:var(--bim-border-default, #334155)}.walk-path-btn-danger{color:#ef4444}.walk-path-settings{display:flex;flex-direction:column;gap:12px;margin-bottom:16px}.walk-path-form-group{display:flex;flex-direction:column;gap:6px}.walk-path-form-group label{font-size:12px;color:var(--bim-text-secondary, #94a3b8)}.walk-path-form-group-inline{flex-direction:row;align-items:center}.walk-path-input{padding:8px 12px;border:1px solid var(--bim-border-default, #334155);border-radius:4px;background:var(--bim-bg-elevated, #1f2d3e);color:var(--bim-text-primary, #fff);font-size:14px;width:100%;box-sizing:border-box}.walk-path-input:focus{outline:none;border-color:var(--bim-primary, #3b82f6)}.walk-path-input-wrapper{display:flex;align-items:center;gap:8px}.walk-path-input-wrapper .walk-path-input{flex:1}.walk-path-unit{color:var(--bim-text-secondary, #94a3b8);font-size:14px}.walk-path-checkbox{width:16px;height:16px;margin-right:8px}.walk-path-points-section{margin-bottom:16px}.walk-path-points-toolbar{display:flex;gap:8px;margin-bottom:12px}.walk-path-points-list{height:200px;overflow-y:auto;display:flex;flex-direction:column;gap:8px}.walk-path-empty{text-align:center;padding:32px 16px;color:var(--bim-text-secondary, #94a3b8);font-size:14px}.walk-path-point-item{display:flex;justify-content:space-between;align-items:center;padding:6px 12px;background:var(--bim-bg-elevated, #1f2d3e);border-radius:4px;transition:all .2s}.walk-path-point-item:hover{background:var(--bim-border-default, #334155)}.walk-path-point-item:hover .walk-path-point-actions{opacity:1}.walk-path-point-item-active{background:var(--bim-primary, #3b82f6)}.walk-path-point-item-active .walk-path-point-name{color:#fff}.walk-path-point-item-active .walk-path-point-actions{opacity:1}.walk-path-point-name{font-size:14px;color:var(--bim-text-primary, #fff)}.walk-path-point-actions{display:flex;gap:8px;opacity:0;transition:opacity .2s}.walk-path-btn-icon{width:28px;height:28px;border:none;border-radius:4px;background:transparent;color:var(--bim-text-primary, #fff);cursor:pointer;display:flex;align-items:center;justify-content:center;font-size:14px}.walk-path-btn-icon:hover{background:#ffffff1a}.walk-path-btn-icon-danger:hover{background:#ef444433;color:#ef4444}.bim-measure-panel{width:100%;display:flex;flex-direction:column;box-sizing:border-box;color:var(--bim-text-secondary)}.bim-measure-settings{display:none;box-sizing:border-box;color:var(--bim-text-secondary)}.bim-measure-settings-title{font-size:14px;font-weight:600;margin-bottom:10px}.bim-measure-settings-row{display:flex;align-items:center;justify-content:space-between;gap:10px;margin-bottom:10px}.bim-measure-settings-row .label{color:var(--bim-text-secondary);font-size:13px;flex:0 0 auto}.bim-measure-settings-select{flex:0 0 auto;width:120px;height:28px;border-radius:6px;border:1px solid var(--bim-border-default);background:var(--bim-bg-inset);color:var(--bim-text-primary);padding:0 8px;box-sizing:border-box;outline:none}.bim-measure-settings-hint{font-size:12px;line-height:1.4;color:var(--bim-text-tertiary);margin-top:-4px;margin-bottom:8px}.bim-measure-settings-actions{margin-top:14px;display:flex;justify-content:flex-start;gap:10px}.bim-measure-settings-save,.bim-measure-settings-cancel{flex:0 0 auto!important;width:auto;min-width:0;height:30px;padding:0 12px;border-radius:4px;cursor:pointer;box-sizing:border-box}.bim-measure-settings-save{border:none;background:var(--bim-primary);color:var(--bim-text-inverse)}.bim-measure-settings-cancel{border:1px solid var(--bim-border-default);background:transparent;color:var(--bim-text-secondary)}.bim-measure-settings-save:hover,.bim-measure-settings-save:active,.bim-measure-settings-save:focus,.bim-measure-settings-cancel:hover,.bim-measure-settings-cancel:active,.bim-measure-settings-cancel:focus{background:inherit;outline:none}.bim-measure-settings-save:hover{background:var(--bim-primary-hover)}.bim-measure-tools{display:flex;flex-direction:column;gap:8px}.bim-measure-tool-grid{display:grid;grid-template-columns:repeat(4,1fr);gap:8px}.bim-measure-tool-btn{width:100%;height:42px;border-radius:6px;border:1px solid var(--bim-border-default);background:var(--bim-bg-inset);cursor:pointer;display:flex;align-items:center;justify-content:center;transition:all .2s ease;padding:0;box-sizing:border-box}.bim-measure-tool-btn:hover{background:var(--bim-component-bg-hover);border-color:var(--bim-border-strong)}.bim-measure-tool-btn.is-active{border-color:var(--bim-primary);background:var(--bim-primary-subtle)}.bim-measure-tool-btn.is-active .bim-measure-tool-icon{color:var(--bim-primary)}.bim-measure-tool-icon{width:28px;height:28px;display:inline-flex;align-items:center;justify-content:center;color:var(--bim-icon-default)}.bim-measure-tool-icon svg{width:100%;height:100%;fill:currentColor}.bim-measure-toggle{display:flex;justify-content:flex-end}.bim-measure-toggle-btn{height:22px;border-radius:4px;border:1px solid var(--bim-border-default);background:var(--bim-bg-inset);cursor:pointer;display:inline-flex;align-items:center;justify-content:center;transition:all .2s ease;padding:0 6px;gap:4px;font-size:12px;line-height:1}.bim-measure-toggle-btn:hover{background:var(--bim-component-bg-hover);border-color:var(--bim-border-strong)}.bim-measure-toggle-text{color:var(--bim-text-secondary)}.bim-measure-toggle-icon svg{width:14px;height:14px;fill:currentColor;color:var(--bim-icon-default);transition:transform .15s ease}.bim-measure-toggle-btn.is-expanded .bim-measure-toggle-icon svg{transform:rotate(180deg)}.bim-measure-mode-options{display:none;flex-direction:column;gap:8px;margin-top:12px;padding-top:12px;border-top:1px solid var(--bim-divider)}.bim-measure-mode-options.is-visible{display:flex}.bim-measure-radio-group{display:flex;align-items:center;gap:8px;font-size:13px;line-height:1.4}.bim-measure-radio-group .bim-measure-radio-label{color:var(--bim-text-secondary);min-width:58px;flex:0 0 auto}.bim-measure-radio-group .bim-measure-radio-items{display:flex;gap:4px}.bim-measure-radio-item{display:inline-flex;align-items:center;justify-content:center;height:26px;padding:0 10px;border-radius:4px;border:1px solid var(--bim-border-default);background:var(--bim-bg-inset);color:var(--bim-text-secondary);font-size:12px;cursor:pointer;transition:all .15s ease;-webkit-user-select:none;user-select:none}.bim-measure-radio-item:hover{border-color:var(--bim-border-strong);color:var(--bim-text-primary)}.bim-measure-radio-item.is-active{background:var(--bim-primary-subtle);border-color:var(--bim-primary);color:var(--bim-primary)}.bim-measure-result{margin-top:12px;padding-top:12px;border-top:1px solid var(--bim-divider);display:flex;flex-direction:column;gap:10px}.bim-measure-row{display:flex;align-items:baseline;gap:8px;font-size:13px;line-height:1.4}.bim-measure-row .label{color:var(--bim-text-secondary);min-width:84px}.bim-measure-row .value{color:var(--bim-text-primary);flex:1;word-break:break-word}.bim-measure-main-number{color:#ffd24a}.bim-measure-main-number.is-laser-text,.bim-measure-main-unit{color:var(--bim-text-primary)}.bim-measure-xyz{display:flex;flex-direction:column;gap:6px}.bim-measure-xyz .value{font-variant-numeric:tabular-nums}.bim-measure-xyz-x{color:#ff4d4f!important}.bim-measure-xyz-y{color:#52c41a!important}.bim-measure-xyz-z{color:#1677ff!important}.bim-measure-footer{margin-top:12px;padding-top:10px;border-top:1px solid var(--bim-divider);display:flex;align-items:center;justify-content:flex-start;gap:10px}.bim-measure-clear-btn{background:transparent;border:none;color:var(--bim-danger);cursor:pointer;padding:0;font-size:13px;flex:0 0 auto!important;width:auto;min-width:0}.bim-measure-clear-btn:hover,.bim-measure-clear-btn:active,.bim-measure-clear-btn:focus{background:transparent;border:none;outline:none;text-decoration:none}.bim-measure-settings-btn{width:24px;height:24px;border-radius:4px;border:none;background:transparent;cursor:pointer;display:inline-flex;align-items:center;justify-content:center;padding:0;margin-left:auto;flex:0 0 auto!important}.bim-measure-settings-btn:hover,.bim-measure-settings-btn:active,.bim-measure-settings-btn:focus{background:transparent;border:none;outline:none}.bim-measure-settings-btn svg{width:18px;height:18px;fill:currentColor;color:var(--bim-icon-default)}.section-plane-panel{display:flex;gap:8px;padding:12px 12px 16px;box-sizing:border-box}.section-plane-btn{flex:1;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:4px;padding:10px;border:1px solid var(--bim-border-default);background:var(--bim-bg-inset);border-radius:8px;cursor:pointer;transition:all .2s ease;min-width:60px;outline:none;color:var(--bim-text-primary)}.section-plane-btn:hover{background:var(--bim-component-bg-hover);border-color:var(--bim-border-strong)}.section-plane-btn:active{background:var(--bim-primary-subtle);border-color:var(--bim-primary)}.section-plane-btn.is-active{background:var(--bim-primary-subtle);border-color:var(--bim-primary);color:var(--bim-primary)}.section-plane-btn.is-active .section-plane-btn-icon{color:var(--bim-primary)}.section-plane-btn-icon{width:24px;height:24px;display:flex;align-items:center;justify-content:center;color:var(--bim-icon-default)}.section-plane-btn-icon svg{width:100%;height:100%;fill:currentColor}.section-plane-btn-label{font-size:12px;color:inherit;text-align:center;line-height:1.2}.section-axis-panel{display:flex;flex-direction:column;gap:8px;padding:12px 12px 16px;box-sizing:border-box}.section-axis-row-1{display:flex;gap:8px;padding-bottom:8px;border-bottom:1px solid var(--bim-divider)}.section-axis-row-2{display:flex;gap:8px;padding-top:8px}.section-axis-btn{flex:1;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:4px;padding:8px;background:var(--bim-bg-inset);border:1px solid var(--bim-border-default);border-radius:8px;cursor:pointer;transition:all .2s ease;outline:none;color:var(--bim-text-primary);min-height:48px}.section-axis-btn:hover{background:var(--bim-component-bg-hover);border-color:var(--bim-border-strong)}.section-axis-btn.active{background:var(--bim-primary-subtle);border-color:var(--bim-primary);color:var(--bim-primary)}.section-axis-btn.active .section-axis-btn-icon{color:var(--bim-primary)}.section-axis-btn-icon{width:24px;height:24px;display:inline-flex;align-items:center;justify-content:center;color:var(--bim-icon-default)}.section-axis-btn-icon svg{width:100%;height:100%}.section-axis-btn-label{font-size:12px;color:inherit;text-align:center;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:100%}.section-axis-btn-text{min-height:40px}.section-axis-btn-text .section-axis-btn-label{font-size:18px;font-weight:600}.section-box-panel{display:flex;flex-direction:column;padding:12px;box-sizing:border-box;-webkit-user-select:none;user-select:none}.section-box-row-buttons{display:flex;gap:6px;padding-bottom:12px;border-bottom:1px solid var(--bim-divider)}.section-box-btn{flex:1;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:4px;padding:6px;background:var(--bim-bg-inset);border:1px solid var(--bim-border-default);border-radius:8px;cursor:pointer;color:var(--bim-text-primary);min-height:44px;transition:all .2s ease}.section-box-btn:hover{background:var(--bim-component-bg-hover);border-color:var(--bim-border-strong)}.section-box-btn.active{background:var(--bim-primary-subtle);border-color:var(--bim-primary);color:var(--bim-primary)}.section-box-btn.active .section-box-btn-icon{color:var(--bim-primary)}.section-box-btn-icon{width:24px;height:24px;color:var(--bim-icon-default)}.section-box-btn-icon svg{width:100%;height:100%}.section-box-btn-label{font-size:11px;white-space:nowrap}.section-box-sliders{display:flex;flex-direction:column;gap:16px;padding-top:16px}.section-box-slider{display:flex;align-items:center;gap:12px;position:relative;z-index:1}.section-box-slider:hover{z-index:10}.section-box-slider-label{font-size:13px;font-weight:700;color:var(--bim-text-primary);min-width:14px}.section-box-slider-track{position:relative;flex:1;height:4px;background:var(--bim-border-default);border-radius:2px}.section-box-slider-range{position:absolute;top:0;height:100%;background:var(--bim-primary);border-radius:2px;pointer-events:none}.section-box-slider-handle{position:absolute;top:50%;width:14px;height:14px;background:var(--bim-bg-elevated);border:2px solid var(--bim-primary);border-radius:50%;transform:translate(-50%,-50%);cursor:grab;z-index:5;touch-action:none;transition:transform .2s,box-shadow .2s}.section-box-slider-handle:hover{transform:translate(-50%,-50%) scale(1.2);box-shadow:0 0 0 4px var(--bim-primary-subtle)}.section-box-slider-handle.dragging{cursor:grabbing;transform:translate(-50%,-50%) scale(1.2);background:var(--bim-primary)}.bim-collapse{background-color:var(--bim-bg-elevated);border:1px solid var(--bim-border-default);border-radius:8px;font-size:14px;color:var(--bim-text-primary)}.bim-collapse.is-ghost{background-color:transparent;border:none}.bim-collapse.is-ghost .bim-collapse-item{border-bottom:none}.bim-collapse.is-ghost .bim-collapse-header{background-color:var(--bim-component-bg);padding-left:12px;padding-right:0;border-bottom:1px solid var(--bim-border-default)}.bim-collapse.is-ghost .bim-collapse-header:hover{background-color:var(--bim-component-bg-hover)}.bim-collapse.is-ghost .bim-collapse-content{background-color:transparent;border-top:none}.bim-collapse-item{border-bottom:1px solid var(--bim-border-subtle)}.bim-collapse-item:last-child{border-bottom:none}.bim-collapse-item.is-disabled .bim-collapse-header{color:var(--bim-text-disabled);cursor:not-allowed}.bim-collapse-header{display:flex;align-items:center;padding:12px 16px;background-color:var(--bim-component-bg);cursor:pointer;transition:all .2s ease;position:relative}.bim-collapse-header:hover{background-color:var(--bim-component-bg-hover)}.bim-collapse-arrow{margin-right:12px;font-size:12px;width:12px;height:12px;transition:transform .24s;display:inline-flex;align-items:center;justify-content:center}.bim-collapse-arrow svg{width:100%;height:100%;fill:currentColor}.bim-collapse-item.is-active .bim-collapse-arrow{transform:rotate(90deg)}.bim-collapse-icon{margin-right:8px;display:inline-flex;align-items:center}.bim-collapse-icon svg{width:16px;height:16px;fill:currentColor}.bim-collapse-title{flex:1;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}.bim-collapse-extra{margin-left:auto}.bim-collapse-content{overflow:hidden;background-color:var(--bim-bg-elevated);border-top:1px solid var(--bim-border-subtle);transition:height .2s ease-in-out,opacity .2s ease-in-out}.bim-collapse-content.is-hidden{display:none}.bim-ai-chat{position:absolute;width:440px;height:600px;display:flex;flex-direction:column;background:var(--bim-ai-panel, rgba(11, 18, 32, .95));border:1px solid var(--bim-ai-border, rgba(255, 255, 255, .1));border-radius:16px;backdrop-filter:blur(18px);-webkit-backdrop-filter:blur(18px);box-shadow:0 12px 32px var(--bim-ai-shadow, rgba(0, 0, 0, .4));z-index:1000;font-family:Public Sans,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,sans-serif;overflow:hidden;resize:both;min-width:360px;min-height:400px;max-width:90vw;max-height:90vh}.bim-ai-chat-header{display:flex;align-items:center;justify-content:space-between;height:56px;padding:12px 16px;border-bottom:1px solid var(--bim-ai-border, rgba(255, 255, 255, .1));flex-shrink:0;cursor:move;-webkit-user-select:none;user-select:none;border-radius:16px 16px 0 0}.bim-ai-chat-title{font-size:18px;font-weight:600;color:var(--bim-ai-text, #E5E7EB)}.bim-ai-chat-actions{display:flex;gap:8px}.bim-ai-chat-action-btn{width:32px;height:32px;border-radius:999px;border:1px solid var(--bim-ai-border, rgba(255, 255, 255, .1));background:transparent;color:var(--bim-ai-text, #E5E7EB);cursor:pointer;display:flex;align-items:center;justify-content:center;transition:all .2s ease}.bim-ai-chat-action-btn:hover{background:var(--bim-ai-subtle-fill, rgba(255, 255, 255, .05))}.bim-ai-chat-action-btn svg{width:18px;height:18px}.bim-ai-chat-messages{flex:1;overflow-y:auto;padding:12px;display:flex;flex-direction:column;gap:10px}.bim-ai-msg-ai{max-width:320px}.bim-ai-msg-ai .bim-ai-bubble{background:var(--bim-ai-panel2, rgba(15, 23, 42, .95));border:1px solid var(--bim-ai-border, rgba(255, 255, 255, .1));border-radius:16px;padding:10px}.bim-ai-msg-ai .bim-ai-bubble-content{font-size:13px;line-height:1.4;color:var(--bim-ai-text, #E5E7EB)}.bim-ai-msg-user{display:flex;justify-content:flex-end}.bim-ai-msg-user .bim-ai-bubble{max-width:300px;background:var(--bim-ai-user-bubble, rgba(29, 78, 216, .8));border-radius:16px;padding:10px;box-shadow:0 10px 26px #0003}.bim-ai-msg-user .bim-ai-bubble-content{font-size:13px;line-height:1.4;color:var(--bim-ai-user-text, #EEF2FF)}.bim-ai-step{display:flex;align-items:center;gap:10px;padding:10px;border-radius:14px;max-width:380px}.bim-ai-step-running{background:var(--bim-ai-info-soft, rgba(56, 189, 248, .1));border:1px solid rgba(56,189,248,.33)}.bim-ai-step-done{background:var(--bim-ai-success-soft, rgba(52, 211, 153, .1));border:1px solid rgba(52,211,153,.33)}.bim-ai-step-error{background:var(--bim-ai-danger-soft, rgba(239, 68, 68, .1));border:1px solid var(--bim-ai-danger-stroke, rgba(239, 68, 68, .33))}.bim-ai-step-icon{width:16px;height:16px;flex-shrink:0}.bim-ai-step-running .bim-ai-step-icon{color:var(--bim-ai-info, #38BDF8)}.bim-ai-step-done .bim-ai-step-icon{color:var(--bim-ai-success, #34D399)}.bim-ai-step-error .bim-ai-step-icon{color:var(--bim-ai-danger, #EF4444)}.bim-ai-step-text{font-size:12px;line-height:1.4;color:var(--bim-ai-text, #E5E7EB)}.bim-ai-thinking{display:flex;align-items:center;gap:10px;padding:10px;border-radius:14px;background:var(--bim-ai-panel2, rgba(15, 23, 42, .95));border:1px solid var(--bim-ai-border, rgba(255, 255, 255, .1));max-width:380px}.bim-ai-thinking-icon{width:16px;height:16px;color:var(--bim-ai-muted, #94A3B8);animation:bim-ai-spin 1s linear infinite}.bim-ai-thinking-text{font-size:12px;font-weight:600;color:var(--bim-ai-muted, #94A3B8)}@keyframes bim-ai-spin{0%{transform:rotate(0)}to{transform:rotate(360deg)}}.bim-ai-question-active{width:360px;border-radius:14px;background:var(--bim-ai-panel2, rgba(15, 23, 42, .95));border:1px solid var(--bim-ai-accent-stroke, rgba(59, 130, 246, .33));box-shadow:0 4px 16px var(--bim-ai-shadow, rgba(0, 0, 0, .4));overflow:hidden}.bim-ai-question-header{display:flex;align-items:center;gap:8px;padding:12px;border-bottom:1px solid var(--bim-ai-border, rgba(255, 255, 255, .1))}.bim-ai-question-icon{width:24px;height:24px;border-radius:6px;background:var(--bim-ai-accent-soft, rgba(59, 130, 246, .1));display:flex;align-items:center;justify-content:center;color:var(--bim-ai-accent, #3B82F6)}.bim-ai-question-icon svg{width:14px;height:14px}.bim-ai-question-title{font-size:13px;font-weight:600;color:var(--bim-ai-text, #E5E7EB)}.bim-ai-question-content{padding:12px;display:flex;flex-direction:column;gap:10px}.bim-ai-question-text{font-size:13px;line-height:1.4;color:var(--bim-ai-text, #E5E7EB)}.bim-ai-question-options{display:flex;flex-direction:column;gap:6px}.bim-ai-option{display:flex;align-items:center;gap:8px;padding:8px 10px;border-radius:8px;background:var(--bim-ai-subtle-fill, rgba(255, 255, 255, .05));border:1px solid var(--bim-ai-border, rgba(255, 255, 255, .1));cursor:pointer;transition:all .2s ease}.bim-ai-option:hover{background:var(--bim-ai-subtle-fill-hover, rgba(255, 255, 255, .08))}.bim-ai-option.selected{background:var(--bim-ai-accent-soft, rgba(59, 130, 246, .1));border-color:var(--bim-ai-accent-stroke, rgba(59, 130, 246, .33))}.bim-ai-option-radio{width:16px;height:16px;border-radius:50%;border:1.5px solid var(--bim-ai-muted, #94A3B8);flex-shrink:0;display:flex;align-items:center;justify-content:center}.bim-ai-option.selected .bim-ai-option-radio{background:var(--bim-ai-accent, #3B82F6);border-color:var(--bim-ai-accent, #3B82F6)}.bim-ai-option-radio-dot{width:6px;height:6px;border-radius:50%;background:var(--bim-ai-accent-ink, #FFFFFF);display:none}.bim-ai-option.selected .bim-ai-option-radio-dot{display:block}.bim-ai-option-text{font-size:12px;color:var(--bim-ai-text, #E5E7EB)}.bim-ai-option-input{flex:1;background:var(--bim-ai-textbox-fill, rgba(15, 23, 42, .6));border:1px solid var(--bim-ai-border, rgba(255, 255, 255, .1));border-radius:6px;padding:6px 8px;font-size:12px;color:var(--bim-ai-text, #E5E7EB);outline:none;margin-top:8px;width:100%}.bim-ai-option-input:focus{border-color:var(--bim-ai-accent-stroke, rgba(59, 130, 246, .33))}.bim-ai-question-footer{display:flex;justify-content:flex-end;padding:12px;border-top:1px solid var(--bim-ai-border, rgba(255, 255, 255, .1))}.bim-ai-question-submit{display:flex;align-items:center;gap:4px;padding:8px 12px;border-radius:8px;background:var(--bim-ai-accent, #3B82F6);color:var(--bim-ai-accent-ink, #FFFFFF);border:none;cursor:pointer;font-size:12px;font-weight:600;transition:all .2s ease}.bim-ai-question-submit:hover{filter:brightness(1.1)}.bim-ai-question-submit svg{width:12px;height:12px}.bim-ai-question-answered{max-width:340px;padding:10px;border-radius:12px;background:var(--bim-ai-panel2, rgba(15, 23, 42, .95));border:1px solid var(--bim-ai-border, rgba(255, 255, 255, .1));display:flex;flex-direction:column;gap:8px}.bim-ai-qa-row{display:flex;gap:8px;align-items:flex-start}.bim-ai-qa-badge{width:18px;height:18px;border-radius:5px;display:flex;align-items:center;justify-content:center;font-size:10px;font-weight:700;flex-shrink:0}.bim-ai-qa-badge-q{background:var(--bim-ai-accent-soft, rgba(59, 130, 246, .1));color:var(--bim-ai-accent, #3B82F6)}.bim-ai-qa-badge-a{background:var(--bim-ai-success-soft, rgba(52, 211, 153, .1));color:var(--bim-ai-success, #34D399)}.bim-ai-qa-question{font-size:12px;line-height:1.4;color:var(--bim-ai-muted, #94A3B8)}.bim-ai-qa-answer{font-size:12px;line-height:1.4;color:var(--bim-ai-text, #E5E7EB)}.bim-ai-chat-composer{padding:12px;border-top:1px solid var(--bim-ai-border, rgba(255, 255, 255, .1));display:flex;flex-direction:column;gap:8px;flex-shrink:0}.bim-ai-quick-prompts{display:flex;gap:8px;flex-wrap:wrap}.bim-ai-quick-prompt{padding:5px 8px;border-radius:999px;background:var(--bim-ai-subtle-fill, rgba(255, 255, 255, .05));border:1px solid var(--bim-ai-border, rgba(255, 255, 255, .1));color:var(--bim-ai-text, #E5E7EB);font-size:12px;font-weight:600;cursor:pointer;transition:all .2s ease}.bim-ai-quick-prompt:hover{background:var(--bim-ai-subtle-fill-hover, rgba(255, 255, 255, .08))}.bim-ai-input-row{display:flex;gap:8px;align-items:flex-end}.bim-ai-textbox{flex:1;display:flex;flex-direction:column;gap:6px;padding:10px;border-radius:16px;background:var(--bim-ai-textbox-fill, rgba(15, 23, 42, .6));border:1px solid var(--bim-ai-border, rgba(255, 255, 255, .1))}.bim-ai-textbox:focus-within{border-color:var(--bim-ai-accent-stroke, rgba(59, 130, 246, .33))}.bim-ai-textarea{background:transparent;border:none;outline:none;resize:none;font-size:13px;line-height:1.4;color:var(--bim-ai-text, #E5E7EB);min-height:20px;max-height:100px}.bim-ai-textarea::placeholder{color:var(--bim-ai-muted, #94A3B8)}.bim-ai-helper{display:flex;justify-content:space-between;font-size:11px;color:var(--bim-ai-muted, #94A3B8)}.bim-ai-send-btn{width:40px;height:40px;border-radius:14px;background:var(--bim-ai-accent, #3B82F6);border:none;cursor:pointer;display:flex;align-items:center;justify-content:center;color:var(--bim-ai-accent-ink, #FFFFFF);transition:background .2s ease;flex-shrink:0}.bim-ai-send-btn:hover{background:var(--bim-ai-accent-hover, #2563EB)}.bim-ai-send-btn svg{width:18px;height:18px}.bim-ai-chat.light{--bim-ai-panel: rgba(255, 255, 255, .95);--bim-ai-panel2: #FFFFFF;--bim-ai-border: rgba(15, 23, 42, .1);--bim-ai-text: #0F172A;--bim-ai-muted: #475569;--bim-ai-shadow: rgba(11, 18, 32, .1);--bim-ai-subtle-fill: rgba(15, 23, 42, .05);--bim-ai-subtle-fill-hover: rgba(15, 23, 42, .08);--bim-ai-textbox-fill: #F1F5F9;--bim-ai-user-bubble: #2563EB;--bim-ai-user-text: #FFFFFF;--bim-ai-accent: #2563EB;--bim-ai-accent-soft: rgba(37, 99, 235, .08);--bim-ai-accent-stroke: rgba(37, 99, 235, .2);--bim-ai-success: #059669;--bim-ai-success-soft: rgba(5, 150, 105, .08);--bim-ai-danger: #DC2626;--bim-ai-danger-soft: rgba(220, 38, 38, .08);--bim-ai-danger-stroke: rgba(220, 38, 38, .2);--bim-ai-info: #0284C7;--bim-ai-info-soft: rgba(2, 132, 199, .08)}.bim-btn-group-root{display:flex;gap:8px;z-index:1000;position:absolute;pointer-events:auto;background:transparent}.bim-btn-group-root.static{position:relative;inset:auto;transform:none}.bim-btn-group-root.dir-row{flex-direction:row;align-items:center}.bim-btn-group-root.dir-column{flex-direction:column;align-items:stretch}.bim-btn-group-section{display:flex;gap:4px;background-color:var(--bim-btn-group-section-bg, rgba(17, 17, 17, .88));border-radius:6px;padding:4px;box-shadow:0 2px 8px #0000004d,0 1px 3px #0003}.bim-btn-group-root.dir-row .bim-btn-group-section{flex-direction:row;align-items:center}.bim-btn-group-root.dir-column .bim-btn-group-section{flex-direction:column}.opt-btn-wrapper{position:relative}.opt-btn{display:flex;cursor:pointer;border-radius:4px;transition:background-color .2s,color .2s,border-color .2s;color:var(--bim-btn-text-color, #ccc);background-color:var(--bim-btn-bg, transparent);padding:6px;align-items:center;position:relative;justify-content:center;border:1px solid transparent;outline:none}.opt-btn:hover{background-color:var(--bim-btn-hover-bg, #444)}.opt-btn.active{background-color:var(--bim-btn-active-bg, rgba(255, 255, 255, .15));color:var(--bim-btn-text-active-color, #fff)}.opt-btn.disabled{opacity:.5;cursor:not-allowed}.opt-btn-icon{width:var(--bim-icon-size, 24px);height:var(--bim-icon-size, 24px);display:flex;align-items:center;justify-content:center;color:var(--bim-icon-color, #ccc);flex-shrink:0}.opt-btn-icon svg{width:100%;height:100%;fill:currentColor}.opt-btn-arrow{font-size:10px;opacity:.6;transition:transform .2s;display:inline-block;margin-left:4px}.opt-btn-arrow.rotated{transform:rotate(180deg)}.opt-btn-text-wrapper{display:flex;align-items:center;justify-content:center;pointer-events:none}.opt-btn-label{display:inline}.opt-btn.no-label .opt-btn-label{display:none}.opt-btn.align-vertical:not(.no-label){flex-direction:column;text-align:center}.opt-btn.align-vertical:not(.no-label) .opt-btn-text-wrapper{margin-top:4px}.opt-btn.align-vertical:not(.no-label) .opt-btn-label{font-size:12px;line-height:1.2}.opt-btn.align-horizontal:not(.no-label){flex-direction:row}.opt-btn.align-horizontal:not(.no-label) .opt-btn-text-wrapper{margin-left:8px}.opt-btn.align-horizontal:not(.no-label) .opt-btn-label{font-size:14px}.opt-btn.no-label .opt-btn-text-wrapper{width:0;height:0;margin:0;padding:0;overflow:visible;position:absolute;top:0;right:0}.opt-btn.no-label .opt-btn-arrow{position:absolute;top:2px;right:2px;margin:0;font-size:8px}.opt-btn-dropdown{position:absolute;background-color:var(--bim-toolbar-bg, rgba(17, 17, 17, .95));border-radius:4px;padding:4px;box-shadow:0 4px 12px #0003;z-index:1001;display:flex;flex-direction:column;border:1px solid rgba(255,255,255,.1);opacity:0;visibility:hidden;transform:translateY(-10px);transition:opacity .2s ease,transform .2s cubic-bezier(.2,0,.2,1),visibility .2s}@keyframes dropdown-fade-in{0%{opacity:0;transform:translateY(-8px) scale(.98)}to{opacity:1;transform:translateY(0) scale(1)}}.opt-btn-dropdown{animation:dropdown-fade-in .2s cubic-bezier(.2,0,.2,1) forwards;opacity:1;visibility:visible;transform:none}.opt-btn-dropdown-item{display:flex;align-items:center;padding:8px 12px;cursor:pointer;border-radius:4px;color:var(--bim-btn-text-color, #ccc);transition:background .2s,border-color .2s,color .2s;box-sizing:border-box;border:1px solid transparent;outline:none}.opt-btn-dropdown-item .opt-btn-icon{color:var(--bim-icon-color, #ccc)}.opt-btn-dropdown-item:hover{background-color:var(--bim-btn-hover-bg, #444)}.opt-btn-dropdown-item.active{background-color:var(--bim-btn-active-bg, rgba(255, 255, 255, .15));color:var(--bim-btn-text-active-color, #fff)}.opt-btn-dropdown-item.align-horizontal{flex-direction:row}.opt-btn-dropdown-item.align-horizontal .opt-btn-icon{width:18px;height:18px;margin-right:8px}.opt-btn-dropdown-item.align-vertical{flex-direction:column;text-align:center}.opt-btn-dropdown-item.align-vertical .opt-btn-icon{width:24px;height:24px;margin-bottom:4px}.opt-btn-dropdown-item.align-vertical .opt-btn-dropdown-label{font-size:12px}.bim-btn-group-root.is-bottom-toolbar .opt-btn-icon{width:32px;height:32px}.bim-btn-group-root.is-bottom-toolbar .opt-btn{padding:8px}.bim-btn-group-root.is-bottom-toolbar.dir-row{max-width:calc(100% - 40px);overflow-x:auto;overflow-y:visible;scrollbar-width:thin;scrollbar-color:rgba(255,255,255,.2) transparent}.bim-btn-group-root.is-bottom-toolbar.dir-row .bim-btn-group-section{flex-shrink:0}.bim-btn-group-root.is-bottom-toolbar.dir-row::-webkit-scrollbar{height:4px}.bim-btn-group-root.is-bottom-toolbar.dir-row::-webkit-scrollbar-track{background:transparent}.bim-btn-group-root.is-bottom-toolbar.dir-row::-webkit-scrollbar-thumb{background:#fff3;border-radius:2px}.bim-btn-group-root.is-bottom-toolbar.dir-row::-webkit-scrollbar-thumb:hover{background:#fff6}.bim-btn-group-root.type-glass-pill .bim-btn-group-section{background:var(--bim-floating-bg);backdrop-filter:blur(24px);-webkit-backdrop-filter:blur(24px);border:1px solid var(--bim-floating-border);border-radius:9999px;box-shadow:none;padding:8px;gap:10px}.bim-btn-group-root.type-glass-pill .opt-btn{width:48px;height:48px;min-width:48px;border-radius:9999px;background:var(--bim-floating-btn-bg);border:1px solid var(--bim-floating-btn-border);box-shadow:var(--bim-floating-btn-shadow);color:var(--bim-text-primary);padding:0;transition:all .2s ease-out}.bim-btn-group-root.type-glass-pill .opt-btn:hover{background:var(--bim-floating-btn-bg-hover);transform:scale(1.05);box-shadow:var(--bim-floating-btn-shadow-hover)}.bim-btn-group-root.type-glass-pill .opt-btn:active{transform:scale(.98)}.bim-btn-group-root.type-glass-pill .opt-btn.active{background:var(--bim-primary);border:1px solid var(--bim-primary-active);color:var(--bim-text-inverse);box-shadow:var(--bim-shadow-glow)}.bim-btn-group-root.type-glass-pill .opt-btn.active:hover{background:var(--bim-primary-hover);transform:scale(1.05)}.bim-btn-group-root.type-glass-pill .opt-btn.active:active{transform:scale(.98)}.bim-btn-group-root.type-glass-pill .opt-btn.active .opt-btn-icon{color:var(--bim-icon-inverse)}.bim-btn-group-root.type-glass-pill .opt-btn.disabled{opacity:.3;cursor:not-allowed;transform:none;box-shadow:none}.bim-btn-group-root.type-glass-pill .opt-btn-icon{width:18px;height:18px;color:var(--bim-floating-icon-color);transition:color .2s ease-out}.bim-btn-group-root.type-glass-pill .opt-btn-icon svg{width:18px;height:18px}.bim-btn-group-root.type-glass-pill .opt-btn:hover .opt-btn-icon{color:var(--bim-floating-icon-color-hover)}.bim-btn-group-root.type-glass-pill .opt-btn-label{display:none!important}.bim-btn-group-root.type-glass-pill .opt-btn-text-wrapper{position:absolute;top:2px;right:2px;width:0;height:0;margin:0;padding:0}.bim-btn-group-root.type-glass-pill .opt-btn-arrow{font-size:8px;position:absolute;top:0;right:0;color:var(--bim-text-tertiary)}.opt-btn-dropdown.type-glass-pill{background:#fffffff2;backdrop-filter:blur(10px);-webkit-backdrop-filter:blur(10px);border:1px solid rgba(226,232,240,.6);border-radius:12px;box-shadow:0 8px 24px #0000001f;padding:6px}.opt-btn-dropdown.type-glass-pill .opt-btn-dropdown-item{display:flex;flex-direction:row;align-items:center;gap:10px;border-radius:8px;color:#334155;padding:8px 12px;font-size:13px;font-weight:400;transition:all .1s ease-out}.opt-btn-dropdown.type-glass-pill .opt-btn-dropdown-item:hover{background:#f1f5f9}.opt-btn-dropdown.type-glass-pill .opt-btn-dropdown-item:active{background:#e2e8f0}.opt-btn-dropdown.type-glass-pill .opt-btn-dropdown-item.active{background:#3b82f6;color:#fff}.opt-btn-dropdown.type-glass-pill .opt-btn-dropdown-item.active .opt-btn-icon,.opt-btn-dropdown.type-glass-pill .opt-btn-dropdown-item.active .opt-btn-dropdown-label{color:#fff}.opt-btn-dropdown.type-glass-pill .opt-btn-dropdown-item .opt-btn-icon{width:18px;height:18px;color:#334155;flex-shrink:0}.opt-btn-dropdown.type-glass-pill .opt-btn-dropdown-item .opt-btn-icon svg{width:18px;height:18px}.opt-btn-dropdown.type-glass-pill .opt-btn-dropdown-item .opt-btn-dropdown-label{white-space:nowrap;color:#334155}.opt-btn-dropdown.type-glass-pill.theme-dark{background:var(--bim-bg-overlay);backdrop-filter:blur(10px);-webkit-backdrop-filter:blur(10px);border:1px solid var(--bim-border-default);box-shadow:var(--bim-shadow-lg)}.opt-btn-dropdown.type-glass-pill.theme-dark .opt-btn-dropdown-item{color:var(--bim-text-primary)}.opt-btn-dropdown.type-glass-pill.theme-dark .opt-btn-dropdown-item:hover{background:var(--bim-floating-btn-bg)}.opt-btn-dropdown.type-glass-pill.theme-dark .opt-btn-dropdown-item:active{background:var(--bim-floating-btn-bg-hover)}.opt-btn-dropdown.type-glass-pill.theme-dark .opt-btn-dropdown-item.active{background:var(--bim-primary);color:var(--bim-text-inverse)}.opt-btn-dropdown.type-glass-pill.theme-dark .opt-btn-dropdown-item .opt-btn-icon{color:var(--bim-floating-icon-color)}.opt-btn-dropdown.type-glass-pill.theme-dark .opt-btn-dropdown-item .opt-btn-dropdown-label{color:var(--bim-text-primary)}.bim-tree{width:100%;height:100%;display:flex;flex-direction:column;overflow:hidden;font-size:14px;color:var(--bim-text-primary);-webkit-user-select:none;user-select:none;position:relative;background:transparent}.bim-tree-search{padding:6px;background-color:transparent;flex-shrink:0;position:relative}.bim-tree-search-wrapper{position:relative;width:100%;display:flex;align-items:center}.bim-tree-search-icon{position:absolute;left:8px;width:16px;height:16px;color:var(--bim-text-secondary);pointer-events:none;display:flex;align-items:center;justify-content:center}.bim-tree-search-icon svg{width:100%;height:100%}.bim-tree-search-input{width:100%;height:30px;padding:4px 8px 4px 30px;border:1px solid var(--bim-border-default);border-radius:4px;outline:none;font-size:13px;color:inherit;background-color:var(--bim-bg-elevated);transition:all .2s;box-sizing:border-box}.bim-tree-search-input:focus{border-color:var(--bim-primary);box-shadow:var(--bim-focus-ring)}.bim-tree-search-results{position:absolute;top:100%;left:8px;right:8px;background-color:var(--bim-bg-elevated);border:1px solid var(--bim-border-default);box-shadow:var(--bim-shadow-md);border-radius:4px;max-height:200px;overflow-y:auto;z-index:10;display:none}.bim-tree-search-results.is-visible{display:block}.bim-tree-search-item{padding:8px 12px;cursor:pointer;border-bottom:1px solid rgba(0,0,0,.03)}.bim-tree-search-item:last-child{border-bottom:none}.bim-tree-search-item:hover{background-color:var(--bim-component-bg-hover)}.bim-tree-search-item-title{font-weight:500;display:block}.bim-tree-search-item-path{font-size:12px;color:var(--bim-text-secondary);margin-top:2px;display:block}.bim-tree-node-content:hover{background-color:var(--bim-component-bg-hover)}.bim-tree-switcher{width:24px;height:32px;display:flex;align-items:center;justify-content:center;cursor:pointer;color:var(--bim-text-secondary);transition:transform .2s;flex-shrink:0}.bim-tree-switcher svg{width:12px;height:12px;fill:currentColor;transition:transform .2s}.bim-tree-switcher.is-expanded svg{transform:rotate(90deg)}.bim-tree-switcher.is-hidden{visibility:hidden}.bim-tree-checkbox{width:16px;height:16px;border:1px solid var(--bim-border-default);border-radius:2px;margin-right:8px;background-color:var(--bim-bg-elevated);position:relative;cursor:pointer;flex-shrink:0;transition:all .2s}.bim-tree-checkbox:hover{border-color:var(--bim-primary)}.bim-tree-checkbox.is-checked{background-color:var(--bim-primary);border-color:var(--bim-primary)}.bim-tree-checkbox.is-checked:after{content:"";position:absolute;top:1px;left:4px;width:5px;height:9px;border:2px solid var(--bim-text-inverse);border-top:0;border-left:0;transform:rotate(45deg)}.bim-tree-checkbox.is-indeterminate{background-color:var(--bim-bg-elevated);border-color:var(--bim-primary)}.bim-tree-checkbox.is-indeterminate:after{content:"";position:absolute;top:6px;left:3px;width:8px;height:2px;background-color:var(--bim-primary)}.bim-tree-node.is-disabled .bim-tree-checkbox{background-color:var(--bim-component-bg-disabled);border-color:var(--bim-border-disabled);cursor:not-allowed}.bim-tree-node.is-disabled .bim-tree-checkbox.is-checked{background-color:var(--bim-text-disabled)}.bim-tree-node.is-disabled .bim-tree-node-content{color:var(--bim-text-disabled);cursor:not-allowed}.bim-tree-icon{width:16px;height:16px;margin-right:6px;display:flex;align-items:center;justify-content:center;flex-shrink:0}.bim-tree-icon img,.bim-tree-icon svg{width:100%;height:100%}.bim-tree-title{flex:1;white-space:nowrap}.bim-tree-children{display:none;overflow:visible}.bim-tree-children.is-visible{display:block}.bim-tree-node-content.is-selected{background-color:var(--bim-component-bg-selected);color:var(--bim-primary)}.bim-tree-node-actions{display:none;align-items:center;margin-left:8px;flex-shrink:0}.bim-tree-node-content.is-selected .bim-tree-node-actions{display:flex}.bim-tree-content{flex:1;overflow-y:auto;overflow-x:hidden;overscroll-behavior:contain;scroll-behavior:auto;padding:2px 0;min-height:0}.bim-tree-node{display:flex;flex-direction:column;width:100%}.bim-tree-node-content{display:flex;align-items:center;height:32px;cursor:pointer;transition:background-color .2s;border-radius:4px;padding-right:8px;width:100%;box-sizing:border-box}.bim-tab{display:flex;flex-direction:column;width:100%;height:100%;background:transparent;color:var(--bim-text-secondary)}.bim-tab__nav{display:flex;align-items:center;gap:4px;padding:4px;margin:8px 12px;background:var(--bim-bg-inset);border-radius:8px;border:1px solid var(--bim-border-subtle)}.bim-tab__item{flex:1;display:inline-flex;align-items:center;justify-content:center;gap:6px;padding:8px 12px;border:none;border-radius:6px;background:transparent;color:var(--bim-text-secondary);cursor:pointer;transition:all .2s ease;font-size:13px;font-weight:500}.bim-tab__item:hover{color:var(--bim-text-primary);background-color:var(--bim-component-bg-hover)}.bim-tab__item.is-active{color:var(--bim-primary);background-color:var(--bim-bg-elevated);box-shadow:0 1px 3px #0000001a}.bim-tab__item.is-disabled{opacity:.5;cursor:not-allowed}.bim-tab__icon{width:16px;height:16px;display:inline-flex;align-items:center;justify-content:center;color:var(--bim-tab-icon, currentColor)}.bim-tab__icon svg{width:100%;height:100%;fill:currentColor}.bim-tab__title{white-space:nowrap}.bim-tab__content{flex:1;display:flex;position:relative;min-height:0;overflow:hidden}.bim-tab__panel{display:none;width:100%;height:100%;flex:1}.bim-tab__panel.is-active{display:flex;flex-direction:column;height:100%}.construct-tab__container{height:100%;display:flex;flex-direction:column}.construct-tab__panel-content{flex:1;display:flex;flex-direction:column;min-height:0;overflow:hidden}.construct-tab__panel-content .bim-tree{flex:1}')),document.head.appendChild(e)}}catch(o){console.error("vite-plugin-css-injected-by-js",o)}})();
2
2
  (function(Ls,gc){typeof exports=="object"&&typeof module<"u"?gc(exports,require("opentype.js")):typeof define=="function"&&define.amd?define(["exports","opentype.js"],gc):(Ls=typeof globalThis<"u"?globalThis:Ls||self,gc(Ls.IflowEngine={},Ls["{}"]))})(this,(function(Ls,gc){"use strict";function K2(s){const e=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(s){for(const t in s)if(t!=="default"){const i=Object.getOwnPropertyDescriptor(s,t);Object.defineProperty(e,t,i.get?i:{enumerable:!0,get:()=>s[t]})}}return e.default=s,Object.freeze(e)}const J2=K2(gc),my={name:"light",primary:"#2563eb",primaryHover:"#1d4ed8",primaryActive:"#1e40af",primarySubtle:"rgba(37, 99, 235, 0.1)",success:"#16a34a",successHover:"#15803d",successSubtle:"rgba(22, 163, 74, 0.1)",warning:"#d97706",warningHover:"#b45309",warningSubtle:"rgba(217, 119, 6, 0.1)",danger:"#dc2626",dangerHover:"#b91c1c",dangerSubtle:"rgba(220, 38, 38, 0.1)",info:"#0891b2",infoHover:"#0e7490",infoSubtle:"rgba(8, 145, 178, 0.1)",bgBase:"#f8fafc",bgElevated:"#ffffff",bgOverlay:"rgba(255, 255, 255, 0.98)",bgInset:"#f1f5f9",bgGlass:"rgba(255, 255, 255, 0.8)",bgGlassBlur:"24px",textPrimary:"#0f172a",textSecondary:"#475569",textTertiary:"#94a3b8",textDisabled:"#cbd5e1",textInverse:"#ffffff",textLink:"#2563eb",textLinkHover:"#1d4ed8",iconDefault:"#64748b",iconHover:"#334155",iconActive:"#2563eb",iconDisabled:"#cbd5e1",iconInverse:"#ffffff",borderDefault:"#e2e8f0",borderSubtle:"#f1f5f9",borderStrong:"#cbd5e1",borderDisabled:"#f1f5f9",divider:"#e2e8f0",componentBg:"transparent",componentBgHover:"rgba(15, 23, 42, 0.04)",componentBgActive:"rgba(15, 23, 42, 0.08)",componentBgSelected:"rgba(37, 99, 235, 0.08)",componentBgDisabled:"#f8fafc",focusRing:"rgba(37, 99, 235, 0.5)",focusRingOffset:"#ffffff",selectionBg:"rgba(37, 99, 235, 0.15)",selectionText:"#0f172a",shadowSm:"0 2px 8px rgba(0, 0, 0, 0.1), 0 4px 12px rgba(0, 0, 0, 0.08)",shadowMd:"0 4px 12px rgba(0, 0, 0, 0.12), 0 6px 20px rgba(0, 0, 0, 0.1)",shadowLg:"0 10px 25px rgba(0, 0, 0, 0.15), 0 6px 10px rgba(0, 0, 0, 0.1)",shadowXl:"0 20px 40px rgba(0, 0, 0, 0.2), 0 10px 15px rgba(0, 0, 0, 0.1)",shadowGlow:"0 2px 8px rgba(59, 130, 246, 0.3), 0 4px 16px rgba(59, 130, 246, 0.2)",scrollbarTrack:"#f1f5f9",scrollbarThumb:"#cbd5e1",scrollbarThumbHover:"#94a3b8",floatingBg:"rgba(255, 255, 255, 0.8)",floatingBorder:"rgba(226, 232, 240, 0.5)",floatingShadow:"0 4px 24px rgba(0, 0, 0, 0.06)",floatingBtnBg:"rgba(255, 255, 255, 0.9)",floatingBtnBorder:"rgba(203, 213, 225, 0.6)",floatingBtnShadow:"0 2px 8px rgba(0, 0, 0, 0.1), 0 4px 12px rgba(0, 0, 0, 0.08)",floatingBtnBgHover:"#ffffff",floatingBtnShadowHover:"0 4px 12px rgba(0, 0, 0, 0.12), 0 6px 20px rgba(0, 0, 0, 0.1)",floatingIconColor:"#334155",floatingIconColorHover:"#1e293b",panelBg:"rgba(255, 255, 255, 0.95)",panelBorder:"rgba(226, 232, 240, 0.6)",panelHeaderBg:"rgba(248, 250, 252, 0.9)",panelRadius:"12px",tabBg:"#f1f5f9",tabItemBg:"transparent",tabItemBgHover:"rgba(255, 255, 255, 0.6)",tabItemBgActive:"#ffffff",tabItemTextActive:"#2563eb",overrides:{dialog:{headerBg:"#f8fafc"},toolbar:{bg:"rgba(255, 255, 255, 0.9)",buttonBg:"rgba(255, 255, 255, 0.95)",buttonBgHover:"#ffffff",buttonBgActive:"#2563eb"},input:{bg:"#ffffff",bgFocus:"#ffffff",placeholder:"#94a3b8"}}},Q2={name:"dark",primary:"#3b82f6",primaryHover:"#60a5fa",primaryActive:"#2563eb",primarySubtle:"rgba(59, 130, 246, 0.15)",success:"#22c55e",successHover:"#4ade80",successSubtle:"rgba(34, 197, 94, 0.15)",warning:"#f59e0b",warningHover:"#fbbf24",warningSubtle:"rgba(245, 158, 11, 0.15)",danger:"#ef4444",dangerHover:"#f87171",dangerSubtle:"rgba(239, 68, 68, 0.15)",info:"#06b6d4",infoHover:"#22d3ee",infoSubtle:"rgba(6, 182, 212, 0.15)",bgBase:"#152232",bgElevated:"#1f2d3e",bgOverlay:"rgba(21, 34, 50, 0.98)",bgInset:"#152232",bgGlass:"rgba(21, 34, 50, 0.85)",bgGlassBlur:"24px",textPrimary:"#ffffff",textSecondary:"#94a3b8",textTertiary:"#64748b",textDisabled:"#475569",textInverse:"#152232",textLink:"#60a5fa",textLinkHover:"#93c5fd",iconDefault:"#ffffff",iconHover:"#ffffff",iconActive:"#3b82f6",iconDisabled:"#475569",iconInverse:"#152232",borderDefault:"rgba(51, 65, 85, 0.5)",borderSubtle:"rgba(51, 65, 85, 0.5)",borderStrong:"#475569",borderDisabled:"#1e293b",divider:"#334155",componentBg:"transparent",componentBgHover:"rgba(248, 250, 252, 0.06)",componentBgActive:"rgba(248, 250, 252, 0.1)",componentBgSelected:"rgba(59, 130, 246, 0.2)",componentBgDisabled:"#1e293b",focusRing:"rgba(59, 130, 246, 0.5)",focusRingOffset:"#1e293b",selectionBg:"rgba(59, 130, 246, 0.3)",selectionText:"#f8fafc",shadowSm:"0 2px 8px rgba(0, 0, 0, 0.4), 0 4px 12px rgba(0, 0, 0, 0.3)",shadowMd:"0 4px 12px rgba(0, 0, 0, 0.5), 0 6px 20px rgba(0, 0, 0, 0.4)",shadowLg:"0 10px 25px rgba(0, 0, 0, 0.6), 0 6px 10px rgba(0, 0, 0, 0.4)",shadowXl:"0 20px 40px rgba(0, 0, 0, 0.7), 0 10px 15px rgba(0, 0, 0, 0.5)",shadowGlow:"0 2px 8px rgba(59, 130, 246, 0.4), 0 4px 16px rgba(59, 130, 246, 0.25)",scrollbarTrack:"#1e293b",scrollbarThumb:"#475569",scrollbarThumbHover:"#64748b",floatingBg:"rgba(15, 23, 42, 0.85)",floatingBorder:"rgba(51, 65, 85, 0.4)",floatingShadow:"0 4px 24px rgba(0, 0, 0, 0.25)",floatingBtnBg:"rgba(51, 65, 85, 0.6)",floatingBtnBorder:"rgba(100, 116, 139, 0.5)",floatingBtnShadow:"0 2px 8px rgba(0, 0, 0, 0.3), 0 4px 12px rgba(0, 0, 0, 0.25)",floatingBtnBgHover:"rgba(71, 85, 105, 0.7)",floatingBtnShadowHover:"0 4px 12px rgba(0, 0, 0, 0.35), 0 6px 20px rgba(0, 0, 0, 0.3)",floatingIconColor:"#e2e8f0",floatingIconColorHover:"#f8fafc",panelBg:"rgba(15, 23, 42, 0.95)",panelBorder:"rgba(51, 65, 85, 0.5)",panelHeaderBg:"rgba(15, 23, 42, 0.9)",panelRadius:"12px",tabBg:"rgba(30, 41, 59, 0.6)",tabItemBg:"transparent",tabItemBgHover:"rgba(51, 65, 85, 0.5)",tabItemBgActive:"rgba(51, 65, 85, 0.8)",tabItemTextActive:"#60a5fa",overrides:{dialog:{headerBg:"#0f172a"},toolbar:{bg:"rgba(30, 41, 59, 0.9)",buttonBg:"rgba(51, 65, 85, 0.6)",buttonBgHover:"rgba(71, 85, 105, 0.7)",buttonBgActive:"#3b82f6"},input:{bg:"#0f172a",bgFocus:"#1e293b",placeholder:"#64748b"}}};class eE{currentTheme=my;listeners=[];constructor(){}getTheme(){return this.currentTheme}setTheme(e){e==="light"?this.applyTheme(my):this.applyTheme(Q2)}setCustomTheme(e){this.applyTheme(e)}applyTheme(e){this.currentTheme=e,this.notifyListeners()}subscribe(e){return this.listeners.push(e),e(this.currentTheme),()=>{this.listeners=this.listeners.filter(t=>t!==e)}}notifyListeners(){this.listeners.forEach(e=>e(this.currentTheme))}}const ct=new eE,tE={common:{title:"BimEngine",description:"这是一个使用 BIM-ENGINE。",openTestDialog:"打开测试弹窗",openInfoDialog:"打开信息弹窗 (封装版)"},toolbar:{home:"首页",measure:"测量",zoomBox:"选框放大",info:"信息",location:"定位",setting:"设置",walk:"漫游",map:"地图",property:"构件详情",fullscreen:"全屏",walkMenu:"漫游菜单",walkPerson:"第一人称",walkBird:"第三人称",tree:"模型树",section:"剖切",sectionPlane:"拾取面剖切",sectionAxis:"轴向剖切",sectionBox:"剖切盒",cameraSwitch:"相机切换"},dialog:{testTitle:"测试弹窗",testContent:'<div style="padding: 10px;">这是一个 <b>可拖拽</b> 且 <b>可缩放</b> 的弹窗。<br><br>你可以尝试拖动标题栏,或者拖动右下角改变大小。</div>'},menu:{info:"信息",home:"首页",componentDetail:"构件详情",hideSelected:"隐藏选中构件",transparentSelected:"半透明选中构件",cancelTranslucent:"取消半透明",isolateSelected:"隔离选中构件",hideOthers:"其他构件隐藏",transparentOthers:"其他构件半透明",fitSectionBox:"剖切盒适应",showAll:"显示全部",quickSelect:"快速选择",selectSameType:"选择同类模型",selectSameLevel:"选择同层模型",selectSameLevelType:"选择同层同类模型"},tree:{searchPlaceholder:"请输入要搜索的内容"},constructTree:{title:"目录树"},tab:{component:"构件",system:"系统",space:"空间",type:"类型",major:"专业"},panel:{property:{title:"构件详情",base:"基本属性",material:"材质信息",advanced:"高级设置",tab:{props:"属性",material:"材质"}},componentDetail:{title:"构件详情",noSelection:"请先选中构件"}},measure:{btnName:"测量",dialogTitle:"测量",modes:{clearHeight:"净高",clearDistance:"净距",distance:"距离",elevation:"标高",point:"坐标",angle:"角度",area:"面积",slope:"坡度"},actions:{expand:"展开",collapse:"收起",clearAll:"删除全部",settings:"设置"},labels:{currentMode:"当前测量方式:",x:"X:",y:"Y:",z:"Z:",value:{clearHeight:"净高:",clearDistance:"净距:",distance:"距离:",elevation:"标高:",point:"坐标:",angle:"角度:",area:"面积:",slope:"坡度:"}},settings:{title:"设置",unit:"单位:",precision:"精度:",hint:"距离、净距、净高和标高默认使用该单位;角度和面积有各自默认单位。",save:"保存设置",cancel:"取消"},clearHeight:{direction:"朝向:",directionDown:"朝下",directionUp:"朝上",selectType:"选择对象:",selectPoint:"选择点",selectElement:"选择构件"}},sectionPlane:{dialogTitle:"拾取面剖切",actions:{hide:"隐藏",reverse:"反向",reset:"重置"}},sectionAxis:{dialogTitle:"轴向剖切",actions:{hide:"隐藏",reverse:"反向",reset:"重置",axisX:"X",axisY:"Y",axisZ:"Z"}},sectionBox:{dialogTitle:"剖切盒",actions:{hide:"隐藏",reverse:"反向",fitToModel:"适应",reset:"重置"},axes:{x:"X",y:"Y",z:"Z"}},walkControl:{speed:"移动速度:",gravity:"重力",collision:"碰撞",characterModel:{label:"建筑工人",constructionWorker:"建筑工人",officeMale:"办公室男性"},walkMode:{label:"行走模式",walk:"行走模式",run:"奔跑模式"},exit:"退出",path:{dialogTitle:"路径漫游",duration:"漫游时间",durationUnit:"秒",loop:"循环播放",addPoint:"添加漫游点",deleteAll:"删除全部",point:"漫游点",play:"播放漫游",stop:"停止漫游",noPoints:"暂无漫游点,请添加"}},info:{dialogTitle:"基本信息",meshCount:"构件数量",totalTriangles:"三角面数量",totalVertices:"顶点数量"},aiChat:{title:"AI 助手",placeholder:"输入你的问题...",quickPrompt:{summarize:"总结这个模型",explain:"解释选中的构件",generate:"生成报告"},action:{new:"新建对话",history:"历史记录",settings:"设置",close:"关闭"},helper:{newline:"Shift + Enter 换行",send:"Enter 发送"},thinking:"正在思考...",other:"其他",otherPlaceholder:"请输入自定义答案",submit:"提交"},setting:{dialogTitle:"设置",presetSelect:"选择预设",presetSelectPlaceholder:"请选择预设",defaultPresetLabel:"默认预设",savePreset:"保存预设",deletePreset:"删除预设",deletePresetForbidden:"默认预设不允许删除",presetDefaultName:"预设",presetNamePrompt:"请输入预设名称",presetNameRequired:"预设名称不能为空",presetNameDuplicate:"预设名称已存在,请使用其他名称",restorePreset:"恢复预设",saveAsNewPreset:"存为新预设",selectPresetFirst:"请先选择预设",presetButton:"预设",undoChanges:"撤销修改",saveAsDialogTitle:"存为新预设",deleteDialogTitle:"删除预设",deleteDialogMessage:"确认删除当前预设吗?删除后不可恢复。",presetNamePlaceholder:"请输入预设名称",confirm:"确定",cancel:"取消",presetPickPrompt:"请输入预设序号",presetPickInvalid:"预设序号无效",renderMode:"渲染模式",modes:{simple:"性能模式",balance:"平衡模式",advanced:"效果模式"},displaySection:"显示设置",edgeLine:"边线",edgeOpacity:"边线透明度",showGrid:"显示轴网",showLevel:"显示标高",contrast:"对比度",saturation:"饱和度",lightIntensity:"光照强度",environment:"环境背景",environmentType:{none:"无",hdr:"HDR背景",sky:"天空盒"},backgroundVisible:"显示背景",ground:"显示地面",groundElevation:"地面高度",groundElevationUnit:"m"}},iE={common:{title:"BimEngine",description:"This is a BIM-ENGINE demo.",openTestDialog:"Open Test Dialog",openInfoDialog:"Open Info Dialog (Wrapped)"},toolbar:{home:"Home",measure:"Measure",zoomBox:"Zoom Box",info:"Info",location:"Location",setting:"Settings",walk:"Walk",map:"Map",property:"Property",fullscreen:"Fullscreen",walkPerson:"Person",walkBird:"Bird Eye",walkMenu:"Menu",tree:"Tree",section:"Section",sectionPlane:"Plane Section",sectionAxis:"Axis Section",sectionBox:"Section Box",cameraSwitch:"Camera"},dialog:{testTitle:"Test Dialog",testContent:'<div style="padding: 10px;">This is a <b>draggable</b> and <b>resizable</b> dialog.<br><br>Try dragging the title bar or resizing from the bottom-right corner.</div>'},menu:{info:"Info",home:"Home",componentDetail:"Component Detail",hideSelected:"Hide Selected",transparentSelected:"Transparent Selected",cancelTranslucent:"Cancel Translucent",isolateSelected:"Isolate Selected",hideOthers:"Hide Others",transparentOthers:"Transparent Others",fitSectionBox:"Fit Section Box",showAll:"Show All",quickSelect:"Quick Select",selectSameType:"Select Same Type",selectSameLevel:"Select Same Level",selectSameLevelType:"Select Same Level & Type"},tree:{searchPlaceholder:"Please enter content to search"},constructTree:{title:"Construct Tree"},tab:{component:"Component",system:"System",space:"Space",type:"Type",major:"Major"},panel:{property:{title:"Component Details",base:"Basic Info",material:"Material",advanced:"Advanced",tab:{props:"Properties",material:"Material"}},componentDetail:{title:"Component Detail",noSelection:"Please select a component first"}},measure:{btnName:"Measure",dialogTitle:"Measure",modes:{clearHeight:"Clear Height",clearDistance:"Clear Distance",distance:"Distance",elevation:"Elevation",point:"Point",angle:"Angle",area:"Area",slope:"Slope"},actions:{expand:"Expand",collapse:"Collapse",clearAll:"Clear All",settings:"Settings"},labels:{currentMode:"Mode:",x:"X:",y:"Y:",z:"Z:",value:{clearHeight:"Clear Height:",clearDistance:"Clear Distance:",distance:"Distance:",elevation:"Elevation:",point:"Point:",angle:"Angle:",area:"Area:",slope:"Slope:"}},settings:{title:"Settings",unit:"Unit:",precision:"Precision:",hint:"Distance, clear distance, clear height and elevation use this unit by default; angle and area use their own units.",save:"Save",cancel:"Cancel"},clearHeight:{direction:"Direction:",directionDown:"Down",directionUp:"Up",selectType:"Select:",selectPoint:"Point",selectElement:"Element"}},sectionPlane:{dialogTitle:"Plane Section",actions:{hide:"Hide",reverse:"Reverse",reset:"Reset"}},sectionAxis:{dialogTitle:"Axis Section",actions:{hide:"Hide",reverse:"Reverse",reset:"Reset",axisX:"X",axisY:"Y",axisZ:"Z"}},sectionBox:{dialogTitle:"Section Box",actions:{hide:"Hide",reverse:"Reverse",fitToModel:"Fit",reset:"Reset"},axes:{x:"X",y:"Y",z:"Z"}},walkControl:{speed:"Speed:",gravity:"Gravity",collision:"Collision",characterModel:{label:"Construction Worker",constructionWorker:"Construction Worker",officeMale:"Office Male"},walkMode:{label:"Walk Mode",walk:"Walk",run:"Run"},exit:"Exit",path:{dialogTitle:"Path Roaming",duration:"Duration",durationUnit:"s",loop:"Loop",addPoint:"Add Point",deleteAll:"Delete All",point:"Point",play:"Play",stop:"Stop",noPoints:"No points yet"}},info:{dialogTitle:"Basic Info",meshCount:"Mesh Count",totalTriangles:"Total Triangles",totalVertices:"Total Vertices"},aiChat:{title:"AI Assistant",placeholder:"Ask a question...",quickPrompt:{summarize:"Summarize this model",explain:"Explain selected component",generate:"Generate report"},action:{new:"New Chat",history:"History",settings:"Settings",close:"Close"},helper:{newline:"Shift + Enter for new line",send:"Enter to send"},thinking:"Thinking...",other:"Other",otherPlaceholder:"Enter custom answer",submit:"Submit"},setting:{dialogTitle:"Settings",presetSelect:"Preset",presetSelectPlaceholder:"Select preset",defaultPresetLabel:"Default Preset",savePreset:"Save Preset",deletePreset:"Delete",deletePresetForbidden:"Default preset cannot be deleted",presetDefaultName:"Preset",presetNamePrompt:"Enter preset name",presetNameRequired:"Preset name is required",presetNameDuplicate:"Preset name already exists",restorePreset:"Restore Preset",saveAsNewPreset:"Save As Preset",selectPresetFirst:"Please select a preset first",presetButton:"Preset",undoChanges:"Undo Changes",saveAsDialogTitle:"Save As Preset",deleteDialogTitle:"Delete Preset",deleteDialogMessage:"Delete current preset? This action cannot be undone.",presetNamePlaceholder:"Enter preset name",confirm:"Confirm",cancel:"Cancel",presetPickPrompt:"Please input preset number",presetPickInvalid:"Invalid preset number",renderMode:"Render Mode",modes:{simple:"Performance",balance:"Balanced",advanced:"Quality"},displaySection:"Display",edgeLine:"Edge Lines",edgeOpacity:"Edge Opacity",showGrid:"Show Grid",showLevel:"Show Level",contrast:"Contrast",saturation:"Saturation",lightIntensity:"Light Intensity",environment:"Environment",environmentType:{none:"None",hdr:"HDR",sky:"Sky"},backgroundVisible:"Show Background",ground:"Ground",groundElevation:"Ground Elevation",groundElevationUnit:"m"}},nE={common:{title:"BimEngine",description:"這是一個使用 BIM-ENGINE。",openTestDialog:"打開測試彈窗",openInfoDialog:"打開資訊彈窗 (封裝版)"},toolbar:{home:"首頁",measure:"測量",zoomBox:"選框放大",info:"資訊",location:"定位",setting:"設定",walk:"漫遊",map:"地圖",property:"構件詳情",fullscreen:"全屏",walkMenu:"漫遊選單",walkPerson:"第一人稱",walkBird:"第三人稱",tree:"模型樹",section:"剖切",sectionPlane:"拾取面剖切",sectionAxis:"軸向剖切",sectionBox:"剖切盒",cameraSwitch:"相機切換"},dialog:{testTitle:"測試彈窗",testContent:'<div style="padding: 10px;">這是一個 <b>可拖曳</b> 且 <b>可縮放</b> 的彈窗。<br><br>你可以嘗試拖動標題欄,或者拖動右下角改變大小。</div>'},menu:{info:"資訊",home:"首頁",componentDetail:"構件詳情",hideSelected:"隱藏選中構件",transparentSelected:"半透明選中構件",cancelTranslucent:"取消半透明",isolateSelected:"隔離選中構件",hideOthers:"其他構件隱藏",transparentOthers:"其他構件半透明",fitSectionBox:"剖切盒適應",showAll:"顯示全部",quickSelect:"快速選擇",selectSameType:"選擇同類模型",selectSameLevel:"選擇同層模型",selectSameLevelType:"選擇同層同類模型"},tree:{searchPlaceholder:"請輸入要搜尋的內容"},constructTree:{title:"目錄樹"},tab:{component:"構件",system:"系統",space:"空間",type:"類型",major:"專業"},panel:{property:{title:"構件詳情",base:"基本屬性",material:"材質資訊",advanced:"進階設定",tab:{props:"屬性",material:"材質"}},componentDetail:{title:"構件詳情",noSelection:"請先選中構件"}},measure:{btnName:"測量",dialogTitle:"測量",modes:{clearHeight:"淨高",clearDistance:"淨距",distance:"距離",elevation:"標高",point:"座標",angle:"角度",area:"面積",slope:"坡度"},actions:{expand:"展開",collapse:"收起",clearAll:"刪除全部",settings:"設定"},labels:{currentMode:"當前測量方式:",x:"X:",y:"Y:",z:"Z:",value:{clearHeight:"淨高:",clearDistance:"淨距:",distance:"距離:",elevation:"標高:",point:"座標:",angle:"角度:",area:"面積:",slope:"坡度:"}},settings:{title:"設定",unit:"單位:",precision:"精度:",hint:"距離、淨距、淨高和標高預設使用該單位;角度和面積有各自預設單位。",save:"儲存設定",cancel:"取消"},clearHeight:{direction:"朝向:",directionDown:"朝下",directionUp:"朝上",selectType:"選擇對象:",selectPoint:"選擇點",selectElement:"選擇構件"}},sectionPlane:{dialogTitle:"拾取面剖切",actions:{hide:"隱藏",reverse:"反向",reset:"重設"}},sectionAxis:{dialogTitle:"軸向剖切",actions:{hide:"隱藏",reverse:"反向",reset:"重設",axisX:"X",axisY:"Y",axisZ:"Z"}},sectionBox:{dialogTitle:"剖切盒",actions:{hide:"隱藏",reverse:"反向",fitToModel:"適應",reset:"重設"},axes:{x:"X",y:"Y",z:"Z"}},walkControl:{speed:"移動速度:",gravity:"重力",collision:"碰撞",characterModel:{label:"建築工人",constructionWorker:"建築工人",officeMale:"辦公室男性"},walkMode:{label:"行走模式",walk:"行走模式",run:"奔跑模式"},exit:"退出",path:{dialogTitle:"路徑漫遊",duration:"漫遊時間",durationUnit:"秒",loop:"循環播放",addPoint:"新增漫遊點",deleteAll:"刪除全部",point:"漫遊點",play:"播放漫遊",stop:"停止漫遊",noPoints:"暫無漫遊點,請新增"}},info:{dialogTitle:"基本資訊",meshCount:"構件數量",totalTriangles:"三角面數量",totalVertices:"頂點數量"},aiChat:{title:"AI 助手",placeholder:"輸入你的問題...",quickPrompt:{summarize:"總結這個模型",explain:"解釋選中的構件",generate:"生成報告"},action:{new:"新建對話",history:"歷史記錄",settings:"設定",close:"關閉"},helper:{newline:"Shift + Enter 換行",send:"Enter 傳送"},thinking:"正在思考...",other:"其他",otherPlaceholder:"請輸入自定義答案",submit:"提交"},setting:{dialogTitle:"設定",presetSelect:"選擇預設",presetSelectPlaceholder:"請選擇預設",defaultPresetLabel:"預設預設",savePreset:"儲存預設",deletePreset:"刪除預設",deletePresetForbidden:"預設預設不允許刪除",presetDefaultName:"預設",presetNamePrompt:"請輸入預設名稱",presetNameRequired:"預設名稱不能為空",presetNameDuplicate:"預設名稱已存在,請使用其他名稱",restorePreset:"還原預設",saveAsNewPreset:"另存為新預設",selectPresetFirst:"請先選擇預設",presetButton:"預設",undoChanges:"撤銷修改",saveAsDialogTitle:"另存為新預設",deleteDialogTitle:"刪除預設",deleteDialogMessage:"確認刪除目前預設嗎?刪除後無法復原。",presetNamePlaceholder:"請輸入預設名稱",confirm:"確定",cancel:"取消",presetPickPrompt:"請輸入預設序號",presetPickInvalid:"預設序號無效",renderMode:"渲染模式",modes:{simple:"效能模式",balance:"平衡模式",advanced:"效果模式"},displaySection:"顯示設定",edgeLine:"邊線",edgeOpacity:"邊線透明度",showGrid:"顯示軸網",showLevel:"顯示標高",contrast:"對比度",saturation:"飽和度",lightIntensity:"光照強度",environment:"環境背景",environmentType:{none:"無",hdr:"HDR背景",sky:"天空盒"},backgroundVisible:"顯示背景",ground:"顯示地面",groundElevation:"地面高度",groundElevationUnit:"m"}};class sE{currentLocale="zh-CN";messages={"zh-CN":tE,"en-US":iE,"zh-TW":nE};listeners=[];constructor(){}getLocale(){return this.currentLocale}setLocale(e){this.messages[e]&&this.currentLocale!==e&&(this.currentLocale=e,this.notifyListeners())}t(e){if(!e)return"";const t=e.split(".");let i=this.messages[this.currentLocale];for(const n of t)if(i&&typeof i=="object"&&n in i)i=i[n];else return e;return i}subscribe(e){return this.listeners.push(e),()=>{this.listeners=this.listeners.filter(t=>t!==e)}}notifyListeners(){this.listeners.forEach(e=>e(this.currentLocale))}}const Zt=new sE,Se=s=>Zt.t(s);class rE{element;options;container;header;contentArea;_isDestroyed=!1;_isInitialized=!1;unsubscribeTheme=null;unsubscribeLocale=null;rafId=null;constructor(e){this.options={title:"Dialog",width:300,height:"auto",position:"center",draggable:!0,resizable:!1,minWidth:200,minHeight:100,...e},this.container=e.container,this.element=this.createDom(),this.header=this.element.querySelector(".bim-dialog-header"),this.contentArea=this.element.querySelector(".bim-dialog-content"),this.init()}setTheme(e){const t=this.element.style;this.options.backgroundColor||t.setProperty("--bim-dialog-bg",e.bgElevated),this.options.headerBackgroundColor||t.setProperty("--bim-dialog-header-bg",e.bgInset),this.options.titleColor||t.setProperty("--bim-dialog-title-color",e.textPrimary),this.options.textColor||t.setProperty("--bim-dialog-text-color",e.textSecondary),this.options.borderColor||t.setProperty("--bim-dialog-border-color",e.borderDefault),t.setProperty("--bim-bg-elevated",e.bgElevated),t.setProperty("--bim-bg-inset",e.bgInset),t.setProperty("--bim-text-primary",e.textPrimary),t.setProperty("--bim-text-secondary",e.textSecondary),t.setProperty("--bim-text-tertiary",e.textTertiary),t.setProperty("--bim-border-default",e.borderDefault),t.setProperty("--bim-shadow-lg",e.shadowLg)}init(){this._isInitialized||(this.container.appendChild(this.element),this.initPosition(),this.options.draggable&&this.initDrag(),this.options.resizable&&this.initResize(),this._isInitialized=!0,this.options.onOpen&&this.options.onOpen(),this.unsubscribeTheme=ct.subscribe(e=>{this.setTheme(e)}),this.unsubscribeLocale=Zt.subscribe(()=>{this.setLocales()}))}setLocales(){if(this.options.title){const e=this.header.querySelector(".bim-dialog-title");e&&(e.textContent=Se(this.options.title))}}createDom(){const e=document.createElement("div");e.className="bim-dialog",this.options.id&&(e.id=this.options.id);const t=e.style;this.options.backgroundColor&&t.setProperty("--bim-dialog-bg",this.options.backgroundColor),this.options.headerBackgroundColor&&t.setProperty("--bim-dialog-header-bg",this.options.headerBackgroundColor),this.options.titleColor&&t.setProperty("--bim-dialog-title-color",this.options.titleColor),this.options.textColor&&t.setProperty("--bim-dialog-text-color",this.options.textColor),this.options.borderColor&&t.setProperty("--bim-dialog-border-color",this.options.borderColor),this.setSize(e,this.options.width,this.options.height),this.options.minWidth&&(e.style.minWidth=`${this.options.minWidth}px`);const i=document.createElement("div");i.className="bim-dialog-header",this.options.draggable&&i.classList.add("draggable");const n=document.createElement("span");n.className="bim-dialog-title",n.textContent=this.options.title?Se(this.options.title):"";const r=document.createElement("span");r.className="bim-dialog-close",r.innerHTML="&times;",r.onclick=()=>{this.close()},i.appendChild(n),i.appendChild(r);const a=document.createElement("div");if(a.className="bim-dialog-content",typeof this.options.content=="string"?a.innerHTML=this.options.content:this.options.content instanceof HTMLElement&&a.appendChild(this.options.content),e.appendChild(i),e.appendChild(a),this.options.resizable){const c=document.createElement("div");c.className="bim-dialog-resize-handle",e.appendChild(c)}const o=c=>{c.stopPropagation()};return["click","dblclick","contextmenu","wheel","mousedown","mouseup","mousemove","touchstart","touchend","touchmove","pointerdown","pointerup","pointermove","pointerenter","pointerleave","pointerover","pointerout"].forEach(c=>{e.addEventListener(c,o,{passive:!1})}),e}setSize(e,t,i){t!==void 0&&(t==="auto"||t==="fit-content"?e.style.width=t:e.style.width=typeof t=="number"?`${t}px`:t),i!==void 0&&(i==="auto"||i==="fit-content"?e.style.height=i:e.style.height=typeof i=="number"?`${i}px`:i)}fitWidth(e=!1){this.element.style.width="fit-content",e&&this.initPosition()}fitHeight(e=!1){this.element.style.height="auto";const t=this.element.getBoundingClientRect().height,i=this.options.minHeight??100,n=this.container.clientHeight||0;let r=Math.max(i,t);n>0&&(r=Math.min(r,n)),this.element.style.height=`${r}px`,e?this.initPosition():this.clampToContainer()}clampToContainer(){const e=this.container.clientWidth,t=this.container.clientHeight,i=this.element.offsetWidth,n=this.element.offsetHeight,r=this.options.bottomOffset??70,a=this.element.offsetLeft,o=this.element.offsetTop,l=Math.max(0,e-i),c=Math.max(0,t-n-r),h=Math.max(0,Math.min(a,l)),d=Math.max(0,Math.min(o,c));this.element.style.left=`${h}px`,this.element.style.top=`${d}px`}initPosition(){const e=this.options.position,t=this.element.getBoundingClientRect(),i=this.options.bottomOffset??70;let n=0,r=0;const a=this.container.clientWidth,o=this.container.clientHeight,l=t.width,c=t.height;if(typeof e=="object"&&"x"in e)n=e.x,r=e.y;else switch(e){case"center":n=(a-l)/2,r=(o-c)/2;break;case"top-left":n=0,r=0;break;case"top-center":n=(a-l)/2,r=0;break;case"top-right":n=a-l,r=0;break;case"left-center":n=0,r=(o-c)/2;break;case"right-center":n=a-l,r=(o-c)/2;break;case"bottom-left":n=0,r=o-c-i;break;case"bottom-center":n=(a-l)/2,r=o-c-i;break;case"bottom-right":n=a-l,r=o-c-i;break;default:n=(a-l)/2,r=(o-c)/2}n=Math.max(0,Math.min(n,a-l)),r=Math.max(0,Math.min(r,o-c-i)),this.element.style.left=`${n}px`,this.element.style.top=`${r}px`}initDrag(){let e=0,t=0,i=0,n=0,r=0,a=0,o=0,l=0,c=0;const h=u=>{u.preventDefault(),u.stopPropagation(),e=u.clientX,t=u.clientY,i=this.element.offsetLeft,n=this.element.offsetTop,r=this.container.clientWidth,a=this.container.clientHeight,o=this.element.offsetWidth,l=this.element.offsetHeight,c=this.options.bottomOffset??70,document.addEventListener("mousemove",d,{capture:!0}),document.addEventListener("mouseup",p,{capture:!0})},d=u=>{u.preventDefault(),u.stopPropagation(),!this.rafId&&(this.rafId=requestAnimationFrame(()=>{const v=u.clientX-e,g=u.clientY-t;let m=i+v,f=n+g;const y=r-o,x=a-l-c;m=Math.max(0,Math.min(m,y)),f=Math.max(0,Math.min(f,x)),this.element.style.left=`${m}px`,this.element.style.top=`${f}px`,this.rafId=null}))},p=()=>{this.rafId&&(cancelAnimationFrame(this.rafId),this.rafId=null),document.removeEventListener("mousemove",d,{capture:!0}),document.removeEventListener("mouseup",p,{capture:!0})};this.header.addEventListener("mousedown",h)}initResize(){const e=this.element.querySelector(".bim-dialog-resize-handle");if(!e)return;let t=0,i=0,n=0,r=0,a=0,o=0,l=0,c=0;const h=u=>{u.preventDefault(),u.stopPropagation(),t=u.clientX,i=u.clientY,n=this.element.offsetWidth,r=this.element.offsetHeight,a=this.container.clientWidth,o=this.container.clientHeight,l=this.element.offsetLeft,c=this.element.offsetTop,document.addEventListener("mousemove",d,{capture:!0}),document.addEventListener("mouseup",p,{capture:!0})},d=u=>{u.preventDefault(),u.stopPropagation(),!this.rafId&&(this.rafId=requestAnimationFrame(()=>{const v=u.clientX-t,g=u.clientY-i,m=a-l,f=o-c,y=Math.min(m,Math.max(this.options.minWidth||100,n+v)),x=Math.min(f,Math.max(this.options.minHeight||50,r+g));this.element.style.width=`${y}px`,this.element.style.height=`${x}px`,this.rafId=null}))},p=()=>{this.rafId&&(cancelAnimationFrame(this.rafId),this.rafId=null),document.removeEventListener("mousemove",d,{capture:!0}),document.removeEventListener("mouseup",p,{capture:!0})};e.addEventListener("mousedown",h)}setContent(e){this.contentArea.innerHTML="",typeof e=="string"?this.contentArea.innerHTML=e:this.contentArea.appendChild(e)}close(){this._isDestroyed||(this.rafId&&(cancelAnimationFrame(this.rafId),this.rafId=null),this.unsubscribeTheme&&(this.unsubscribeTheme(),this.unsubscribeTheme=null),this.unsubscribeLocale&&(this.unsubscribeLocale(),this.unsubscribeLocale=null),this.element.remove(),this._isDestroyed=!0,this.options.onClose&&this.options.onClose())}destroy(){this.close()}}class jn{registry;subscriptions=[];constructor(e){this.registry=e}get engineComponent(){return this.registry.engine3d?.getEngineComponent?.()??null}subscribe(e,t){const i=this.registry.on(e,t);this.subscriptions.push(i)}emit(e,t){this.registry.emit(e,t)}destroy(){this.subscriptions.forEach(e=>e()),this.subscriptions=[]}}class gy extends jn{container;activeDialogs=[];constructor(e,t){super(t),this.container=e}create(e){const t=new rE({container:this.container,...e,onClose:()=>{this.activeDialogs=this.activeDialogs.filter(i=>i!==t),e.onClose&&e.onClose()}});return t.setTheme(ct.getTheme()),this.activeDialogs.push(t),t}updateTheme(e){this.activeDialogs.forEach(t=>{t.setTheme&&t.setTheme(e)})}destroy(){this.activeDialogs.forEach(e=>e.destroy()),this.activeDialogs=[],super.destroy()}}const zo="183",In={LEFT:0,MIDDLE:1,RIGHT:2,ROTATE:0,DOLLY:1,PAN:2},Dn={ROTATE:0,PAN:1,DOLLY_PAN:2,DOLLY_ROTATE:3},vy=0,Am=1,yy=2,aE=3,oE=0,vc=1,xy=2,Ho=3,_n=0,Bi=1,Ot=2,Qt=0,ba=1,od=2,Pm=3,Rm=4,ld=5,lE=6,bn=100,_y=101,by=102,My=103,Sy=104,Lr=200,wy=201,Ey=202,Ty=203,cd=204,hd=205,yc=206,Cy=207,xc=208,Ay=209,Py=210,Ry=211,Ly=212,Iy=213,Dy=214,dd=0,ud=1,pd=2,Ma=3,fd=4,md=5,gd=6,vd=7,_c=0,Ny=1,ky=2,ji=0,yd=1,xd=2,_d=3,Sa=4,bd=5,Md=6,Sd=7,Lm="attached",Oy="detached",wd=300,Is=301,Ir=302,Vo=303,bc=304,Go=306,Ji=1e3,cn=1001,Wo=1002,Yt=1003,Ed=1004,cE=1004,wa=1005,hE=1005,At=1006,Xo=1007,dE=1007,qn=1008,uE=1008,hn=1009,Im=1010,Dm=1011,jo=1012,Td=1013,Zn=1014,Pi=1015,_i=1016,Cd=1017,Ad=1018,Dr=1020,Nm=35902,km=35899,Om=1021,Um=1022,qi=1023,Ds=1026,Ns=1027,Mc=1028,Sc=1029,Ea=1030,Pd=1031,pE=1032,Rd=1033,wc=33776,Ec=33777,Tc=33778,Cc=33779,Ld=35840,Id=35841,Dd=35842,Nd=35843,kd=36196,Od=37492,Ud=37496,Bd=37488,Fd=37489,zd=37490,Hd=37491,Vd=37808,Gd=37809,Wd=37810,Xd=37811,jd=37812,qd=37813,Zd=37814,Yd=37815,$d=37816,Kd=37817,Jd=37818,Qd=37819,eu=37820,tu=37821,iu=36492,nu=36494,su=36495,ru=36283,au=36284,ou=36285,lu=36286,Uy=2200,By=2201,Fy=2202,qo=2300,Zo=2301,cu=2302,Bm=2303,Ta=2400,Ca=2401,Ac=2402,hu=2500,Fm=2501,zy=0,zm=1,du=2,Hy=3200,fE=3201,mE=3202,gE=3203,Nr=0,Vy=1,Ys="",li="srgb",Zi="srgb-linear",Pc="linear",Bt="srgb",vE="",yE="rg",xE="ga",_E=0,Aa=7680,bE=7681,ME=7682,SE=7683,wE=34055,EE=34056,TE=5386,CE=512,AE=513,PE=514,RE=515,LE=516,IE=517,DE=518,Hm=519,Gy=512,Wy=513,Xy=514,uu=515,jy=516,qy=517,pu=518,Zy=519,Rc=35044,NE=35048,kE=35040,OE=35045,UE=35049,BE=35041,FE=35046,zE=35050,HE=35042,VE="100",Vm="300 es",Nn=2e3,Pa=2001,GE={COMPUTE:"compute",RENDER:"render"},WE={PERSPECTIVE:"perspective",LINEAR:"linear",FLAT:"flat"},XE={NORMAL:"normal",CENTROID:"centroid",SAMPLE:"sample",FIRST:"first",EITHER:"either"},jE={TEXTURE_COMPARE:"depthTextureCompare"};function qE(s){for(let e=s.length-1;e>=0;--e)if(s[e]>=65535)return!0;return!1}const ZE={Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array};function Yo(s,e){return new ZE[s](e)}function Yy(s){return ArrayBuffer.isView(s)&&!(s instanceof DataView)}function Lc(s){return document.createElementNS("http://www.w3.org/1999/xhtml",s)}function $y(){const s=Lc("canvas");return s.style.display="block",s}const Ky={};let kr=null;function YE(s){kr=s}function $E(){return kr}function Ic(...s){const e="THREE."+s.shift();kr?kr("log",e,...s):console.log(e,...s)}function Jy(s){const e=s[0];if(typeof e=="string"&&e.startsWith("TSL:")){const t=s[1];t&&t.isStackTrace?s[0]+=" "+t.getLocation():s[1]='Stack trace not available. Enable "THREE.Node.captureStackTrace" to capture stack traces.'}return s}function Ye(...s){s=Jy(s);const e="THREE."+s.shift();if(kr)kr("warn",e,...s);else{const t=s[0];t&&t.isStackTrace?console.warn(t.getError(e)):console.warn(e,...s)}}function lt(...s){s=Jy(s);const e="THREE."+s.shift();if(kr)kr("error",e,...s);else{const t=s[0];t&&t.isStackTrace?console.error(t.getError(e)):console.error(e,...s)}}function Dc(...s){const e=s.join(" ");e in Ky||(Ky[e]=!0,Ye(...s))}function KE(s,e,t){return new Promise(function(i,n){function r(){switch(s.clientWaitSync(e,s.SYNC_FLUSH_COMMANDS_BIT,0)){case s.WAIT_FAILED:n();break;case s.TIMEOUT_EXPIRED:setTimeout(r,t);break;default:i()}}setTimeout(r,t)})}const JE={[dd]:ud,[pd]:gd,[fd]:vd,[Ma]:md,[ud]:dd,[gd]:pd,[vd]:fd,[md]:Ma};class hs{addEventListener(e,t){this._listeners===void 0&&(this._listeners={});const i=this._listeners;i[e]===void 0&&(i[e]=[]),i[e].indexOf(t)===-1&&i[e].push(t)}hasEventListener(e,t){const i=this._listeners;return i===void 0?!1:i[e]!==void 0&&i[e].indexOf(t)!==-1}removeEventListener(e,t){const i=this._listeners;if(i===void 0)return;const n=i[e];if(n!==void 0){const r=n.indexOf(t);r!==-1&&n.splice(r,1)}}dispatchEvent(e){const t=this._listeners;if(t===void 0)return;const i=t[e.type];if(i!==void 0){e.target=this;const n=i.slice(0);for(let r=0,a=n.length;r<a;r++)n[r].call(this,e);e.target=null}}}const Qi=["00","01","02","03","04","05","06","07","08","09","0a","0b","0c","0d","0e","0f","10","11","12","13","14","15","16","17","18","19","1a","1b","1c","1d","1e","1f","20","21","22","23","24","25","26","27","28","29","2a","2b","2c","2d","2e","2f","30","31","32","33","34","35","36","37","38","39","3a","3b","3c","3d","3e","3f","40","41","42","43","44","45","46","47","48","49","4a","4b","4c","4d","4e","4f","50","51","52","53","54","55","56","57","58","59","5a","5b","5c","5d","5e","5f","60","61","62","63","64","65","66","67","68","69","6a","6b","6c","6d","6e","6f","70","71","72","73","74","75","76","77","78","79","7a","7b","7c","7d","7e","7f","80","81","82","83","84","85","86","87","88","89","8a","8b","8c","8d","8e","8f","90","91","92","93","94","95","96","97","98","99","9a","9b","9c","9d","9e","9f","a0","a1","a2","a3","a4","a5","a6","a7","a8","a9","aa","ab","ac","ad","ae","af","b0","b1","b2","b3","b4","b5","b6","b7","b8","b9","ba","bb","bc","bd","be","bf","c0","c1","c2","c3","c4","c5","c6","c7","c8","c9","ca","cb","cc","cd","ce","cf","d0","d1","d2","d3","d4","d5","d6","d7","d8","d9","da","db","dc","dd","de","df","e0","e1","e2","e3","e4","e5","e6","e7","e8","e9","ea","eb","ec","ed","ee","ef","f0","f1","f2","f3","f4","f5","f6","f7","f8","f9","fa","fb","fc","fd","fe","ff"];let Qy=1234567;const Ra=Math.PI/180,$o=180/Math.PI;function kn(){const s=Math.random()*4294967295|0,e=Math.random()*4294967295|0,t=Math.random()*4294967295|0,i=Math.random()*4294967295|0;return(Qi[s&255]+Qi[s>>8&255]+Qi[s>>16&255]+Qi[s>>24&255]+"-"+Qi[e&255]+Qi[e>>8&255]+"-"+Qi[e>>16&15|64]+Qi[e>>24&255]+"-"+Qi[t&63|128]+Qi[t>>8&255]+"-"+Qi[t>>16&255]+Qi[t>>24&255]+Qi[i&255]+Qi[i>>8&255]+Qi[i>>16&255]+Qi[i>>24&255]).toLowerCase()}function dt(s,e,t){return Math.max(e,Math.min(t,s))}function Gm(s,e){return(s%e+e)%e}function QE(s,e,t,i,n){return i+(s-e)*(n-i)/(t-e)}function e3(s,e,t){return s!==e?(t-s)/(e-s):0}function Nc(s,e,t){return(1-t)*s+t*e}function t3(s,e,t,i){return Nc(s,e,1-Math.exp(-t*i))}function i3(s,e=1){return e-Math.abs(Gm(s,e*2)-e)}function n3(s,e,t){return s<=e?0:s>=t?1:(s=(s-e)/(t-e),s*s*(3-2*s))}function s3(s,e,t){return s<=e?0:s>=t?1:(s=(s-e)/(t-e),s*s*s*(s*(s*6-15)+10))}function r3(s,e){return s+Math.floor(Math.random()*(e-s+1))}function a3(s,e){return s+Math.random()*(e-s)}function o3(s){return s*(.5-Math.random())}function l3(s){s!==void 0&&(Qy=s);let e=Qy+=1831565813;return e=Math.imul(e^e>>>15,e|1),e^=e+Math.imul(e^e>>>7,e|61),((e^e>>>14)>>>0)/4294967296}function c3(s){return s*Ra}function h3(s){return s*$o}function d3(s){return(s&s-1)===0&&s!==0}function u3(s){return Math.pow(2,Math.ceil(Math.log(s)/Math.LN2))}function p3(s){return Math.pow(2,Math.floor(Math.log(s)/Math.LN2))}function f3(s,e,t,i,n){const r=Math.cos,a=Math.sin,o=r(t/2),l=a(t/2),c=r((e+i)/2),h=a((e+i)/2),d=r((e-i)/2),p=a((e-i)/2),u=r((i-e)/2),v=a((i-e)/2);switch(n){case"XYX":s.set(o*h,l*d,l*p,o*c);break;case"YZY":s.set(l*p,o*h,l*d,o*c);break;case"ZXZ":s.set(l*d,l*p,o*h,o*c);break;case"XZX":s.set(o*h,l*v,l*u,o*c);break;case"YXY":s.set(l*u,o*h,l*v,o*c);break;case"ZYZ":s.set(l*v,l*u,o*h,o*c);break;default:Ye("MathUtils: .setQuaternionFromProperEuler() encountered an unknown order: "+n)}}function dn(s,e){switch(e.constructor){case Float32Array:return s;case Uint32Array:return s/4294967295;case Uint16Array:return s/65535;case Uint8Array:return s/255;case Int32Array:return Math.max(s/2147483647,-1);case Int16Array:return Math.max(s/32767,-1);case Int8Array:return Math.max(s/127,-1);default:throw new Error("Invalid component type.")}}function mt(s,e){switch(e.constructor){case Float32Array:return s;case Uint32Array:return Math.round(s*4294967295);case Uint16Array:return Math.round(s*65535);case Uint8Array:return Math.round(s*255);case Int32Array:return Math.round(s*2147483647);case Int16Array:return Math.round(s*32767);case Int8Array:return Math.round(s*127);default:throw new Error("Invalid component type.")}}const It={DEG2RAD:Ra,RAD2DEG:$o,generateUUID:kn,clamp:dt,euclideanModulo:Gm,mapLinear:QE,inverseLerp:e3,lerp:Nc,damp:t3,pingpong:i3,smoothstep:n3,smootherstep:s3,randInt:r3,randFloat:a3,randFloatSpread:o3,seededRandom:l3,degToRad:c3,radToDeg:h3,isPowerOfTwo:d3,ceilPowerOfTwo:u3,floorPowerOfTwo:p3,setQuaternionFromProperEuler:f3,normalize:mt,denormalize:dn};class me{constructor(e=0,t=0){me.prototype.isVector2=!0,this.x=e,this.y=t}get width(){return this.x}set width(e){this.x=e}get height(){return this.y}set height(e){this.y=e}set(e,t){return this.x=e,this.y=t,this}setScalar(e){return this.x=e,this.y=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setComponent(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;default:throw new Error("index is out of range: "+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;default:throw new Error("index is out of range: "+e)}}clone(){return new this.constructor(this.x,this.y)}copy(e){return this.x=e.x,this.y=e.y,this}add(e){return this.x+=e.x,this.y+=e.y,this}addScalar(e){return this.x+=e,this.y+=e,this}addVectors(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this}addScaledVector(e,t){return this.x+=e.x*t,this.y+=e.y*t,this}sub(e){return this.x-=e.x,this.y-=e.y,this}subScalar(e){return this.x-=e,this.y-=e,this}subVectors(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this}multiply(e){return this.x*=e.x,this.y*=e.y,this}multiplyScalar(e){return this.x*=e,this.y*=e,this}divide(e){return this.x/=e.x,this.y/=e.y,this}divideScalar(e){return this.multiplyScalar(1/e)}applyMatrix3(e){const t=this.x,i=this.y,n=e.elements;return this.x=n[0]*t+n[3]*i+n[6],this.y=n[1]*t+n[4]*i+n[7],this}min(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this}max(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this}clamp(e,t){return this.x=dt(this.x,e.x,t.x),this.y=dt(this.y,e.y,t.y),this}clampScalar(e,t){return this.x=dt(this.x,e,t),this.y=dt(this.y,e,t),this}clampLength(e,t){const i=this.length();return this.divideScalar(i||1).multiplyScalar(dt(i,e,t))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}roundToZero(){return this.x=Math.trunc(this.x),this.y=Math.trunc(this.y),this}negate(){return this.x=-this.x,this.y=-this.y,this}dot(e){return this.x*e.x+this.y*e.y}cross(e){return this.x*e.y-this.y*e.x}lengthSq(){return this.x*this.x+this.y*this.y}length(){return Math.sqrt(this.x*this.x+this.y*this.y)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)}normalize(){return this.divideScalar(this.length()||1)}angle(){return Math.atan2(-this.y,-this.x)+Math.PI}angleTo(e){const t=Math.sqrt(this.lengthSq()*e.lengthSq());if(t===0)return Math.PI/2;const i=this.dot(e)/t;return Math.acos(dt(i,-1,1))}distanceTo(e){return Math.sqrt(this.distanceToSquared(e))}distanceToSquared(e){const t=this.x-e.x,i=this.y-e.y;return t*t+i*i}manhattanDistanceTo(e){return Math.abs(this.x-e.x)+Math.abs(this.y-e.y)}setLength(e){return this.normalize().multiplyScalar(e)}lerp(e,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this}lerpVectors(e,t,i){return this.x=e.x+(t.x-e.x)*i,this.y=e.y+(t.y-e.y)*i,this}equals(e){return e.x===this.x&&e.y===this.y}fromArray(e,t=0){return this.x=e[t],this.y=e[t+1],this}toArray(e=[],t=0){return e[t]=this.x,e[t+1]=this.y,e}fromBufferAttribute(e,t){return this.x=e.getX(t),this.y=e.getY(t),this}rotateAround(e,t){const i=Math.cos(t),n=Math.sin(t),r=this.x-e.x,a=this.y-e.y;return this.x=r*i-a*n+e.x,this.y=r*n+a*i+e.y,this}random(){return this.x=Math.random(),this.y=Math.random(),this}*[Symbol.iterator](){yield this.x,yield this.y}}class Kt{constructor(e=0,t=0,i=0,n=1){this.isQuaternion=!0,this._x=e,this._y=t,this._z=i,this._w=n}static slerpFlat(e,t,i,n,r,a,o){let l=i[n+0],c=i[n+1],h=i[n+2],d=i[n+3],p=r[a+0],u=r[a+1],v=r[a+2],g=r[a+3];if(d!==g||l!==p||c!==u||h!==v){let m=l*p+c*u+h*v+d*g;m<0&&(p=-p,u=-u,v=-v,g=-g,m=-m);let f=1-o;if(m<.9995){const y=Math.acos(m),x=Math.sin(y);f=Math.sin(f*y)/x,o=Math.sin(o*y)/x,l=l*f+p*o,c=c*f+u*o,h=h*f+v*o,d=d*f+g*o}else{l=l*f+p*o,c=c*f+u*o,h=h*f+v*o,d=d*f+g*o;const y=1/Math.sqrt(l*l+c*c+h*h+d*d);l*=y,c*=y,h*=y,d*=y}}e[t]=l,e[t+1]=c,e[t+2]=h,e[t+3]=d}static multiplyQuaternionsFlat(e,t,i,n,r,a){const o=i[n],l=i[n+1],c=i[n+2],h=i[n+3],d=r[a],p=r[a+1],u=r[a+2],v=r[a+3];return e[t]=o*v+h*d+l*u-c*p,e[t+1]=l*v+h*p+c*d-o*u,e[t+2]=c*v+h*u+o*p-l*d,e[t+3]=h*v-o*d-l*p-c*u,e}get x(){return this._x}set x(e){this._x=e,this._onChangeCallback()}get y(){return this._y}set y(e){this._y=e,this._onChangeCallback()}get z(){return this._z}set z(e){this._z=e,this._onChangeCallback()}get w(){return this._w}set w(e){this._w=e,this._onChangeCallback()}set(e,t,i,n){return this._x=e,this._y=t,this._z=i,this._w=n,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._w)}copy(e){return this._x=e.x,this._y=e.y,this._z=e.z,this._w=e.w,this._onChangeCallback(),this}setFromEuler(e,t=!0){const i=e._x,n=e._y,r=e._z,a=e._order,o=Math.cos,l=Math.sin,c=o(i/2),h=o(n/2),d=o(r/2),p=l(i/2),u=l(n/2),v=l(r/2);switch(a){case"XYZ":this._x=p*h*d+c*u*v,this._y=c*u*d-p*h*v,this._z=c*h*v+p*u*d,this._w=c*h*d-p*u*v;break;case"YXZ":this._x=p*h*d+c*u*v,this._y=c*u*d-p*h*v,this._z=c*h*v-p*u*d,this._w=c*h*d+p*u*v;break;case"ZXY":this._x=p*h*d-c*u*v,this._y=c*u*d+p*h*v,this._z=c*h*v+p*u*d,this._w=c*h*d-p*u*v;break;case"ZYX":this._x=p*h*d-c*u*v,this._y=c*u*d+p*h*v,this._z=c*h*v-p*u*d,this._w=c*h*d+p*u*v;break;case"YZX":this._x=p*h*d+c*u*v,this._y=c*u*d+p*h*v,this._z=c*h*v-p*u*d,this._w=c*h*d-p*u*v;break;case"XZY":this._x=p*h*d-c*u*v,this._y=c*u*d-p*h*v,this._z=c*h*v+p*u*d,this._w=c*h*d+p*u*v;break;default:Ye("Quaternion: .setFromEuler() encountered an unknown order: "+a)}return t===!0&&this._onChangeCallback(),this}setFromAxisAngle(e,t){const i=t/2,n=Math.sin(i);return this._x=e.x*n,this._y=e.y*n,this._z=e.z*n,this._w=Math.cos(i),this._onChangeCallback(),this}setFromRotationMatrix(e){const t=e.elements,i=t[0],n=t[4],r=t[8],a=t[1],o=t[5],l=t[9],c=t[2],h=t[6],d=t[10],p=i+o+d;if(p>0){const u=.5/Math.sqrt(p+1);this._w=.25/u,this._x=(h-l)*u,this._y=(r-c)*u,this._z=(a-n)*u}else if(i>o&&i>d){const u=2*Math.sqrt(1+i-o-d);this._w=(h-l)/u,this._x=.25*u,this._y=(n+a)/u,this._z=(r+c)/u}else if(o>d){const u=2*Math.sqrt(1+o-i-d);this._w=(r-c)/u,this._x=(n+a)/u,this._y=.25*u,this._z=(l+h)/u}else{const u=2*Math.sqrt(1+d-i-o);this._w=(a-n)/u,this._x=(r+c)/u,this._y=(l+h)/u,this._z=.25*u}return this._onChangeCallback(),this}setFromUnitVectors(e,t){let i=e.dot(t)+1;return i<1e-8?(i=0,Math.abs(e.x)>Math.abs(e.z)?(this._x=-e.y,this._y=e.x,this._z=0,this._w=i):(this._x=0,this._y=-e.z,this._z=e.y,this._w=i)):(this._x=e.y*t.z-e.z*t.y,this._y=e.z*t.x-e.x*t.z,this._z=e.x*t.y-e.y*t.x,this._w=i),this.normalize()}angleTo(e){return 2*Math.acos(Math.abs(dt(this.dot(e),-1,1)))}rotateTowards(e,t){const i=this.angleTo(e);if(i===0)return this;const n=Math.min(1,t/i);return this.slerp(e,n),this}identity(){return this.set(0,0,0,1)}invert(){return this.conjugate()}conjugate(){return this._x*=-1,this._y*=-1,this._z*=-1,this._onChangeCallback(),this}dot(e){return this._x*e._x+this._y*e._y+this._z*e._z+this._w*e._w}lengthSq(){return this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w}length(){return Math.sqrt(this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w)}normalize(){let e=this.length();return e===0?(this._x=0,this._y=0,this._z=0,this._w=1):(e=1/e,this._x=this._x*e,this._y=this._y*e,this._z=this._z*e,this._w=this._w*e),this._onChangeCallback(),this}multiply(e){return this.multiplyQuaternions(this,e)}premultiply(e){return this.multiplyQuaternions(e,this)}multiplyQuaternions(e,t){const i=e._x,n=e._y,r=e._z,a=e._w,o=t._x,l=t._y,c=t._z,h=t._w;return this._x=i*h+a*o+n*c-r*l,this._y=n*h+a*l+r*o-i*c,this._z=r*h+a*c+i*l-n*o,this._w=a*h-i*o-n*l-r*c,this._onChangeCallback(),this}slerp(e,t){let i=e._x,n=e._y,r=e._z,a=e._w,o=this.dot(e);o<0&&(i=-i,n=-n,r=-r,a=-a,o=-o);let l=1-t;if(o<.9995){const c=Math.acos(o),h=Math.sin(c);l=Math.sin(l*c)/h,t=Math.sin(t*c)/h,this._x=this._x*l+i*t,this._y=this._y*l+n*t,this._z=this._z*l+r*t,this._w=this._w*l+a*t,this._onChangeCallback()}else this._x=this._x*l+i*t,this._y=this._y*l+n*t,this._z=this._z*l+r*t,this._w=this._w*l+a*t,this.normalize();return this}slerpQuaternions(e,t,i){return this.copy(e).slerp(t,i)}random(){const e=2*Math.PI*Math.random(),t=2*Math.PI*Math.random(),i=Math.random(),n=Math.sqrt(1-i),r=Math.sqrt(i);return this.set(n*Math.sin(e),n*Math.cos(e),r*Math.sin(t),r*Math.cos(t))}equals(e){return e._x===this._x&&e._y===this._y&&e._z===this._z&&e._w===this._w}fromArray(e,t=0){return this._x=e[t],this._y=e[t+1],this._z=e[t+2],this._w=e[t+3],this._onChangeCallback(),this}toArray(e=[],t=0){return e[t]=this._x,e[t+1]=this._y,e[t+2]=this._z,e[t+3]=this._w,e}fromBufferAttribute(e,t){return this._x=e.getX(t),this._y=e.getY(t),this._z=e.getZ(t),this._w=e.getW(t),this._onChangeCallback(),this}toJSON(){return this.toArray()}_onChange(e){return this._onChangeCallback=e,this}_onChangeCallback(){}*[Symbol.iterator](){yield this._x,yield this._y,yield this._z,yield this._w}}class R{constructor(e=0,t=0,i=0){R.prototype.isVector3=!0,this.x=e,this.y=t,this.z=i}set(e,t,i){return i===void 0&&(i=this.z),this.x=e,this.y=t,this.z=i,this}setScalar(e){return this.x=e,this.y=e,this.z=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setZ(e){return this.z=e,this}setComponent(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;case 2:this.z=t;break;default:throw new Error("index is out of range: "+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;case 2:return this.z;default:throw new Error("index is out of range: "+e)}}clone(){return new this.constructor(this.x,this.y,this.z)}copy(e){return this.x=e.x,this.y=e.y,this.z=e.z,this}add(e){return this.x+=e.x,this.y+=e.y,this.z+=e.z,this}addScalar(e){return this.x+=e,this.y+=e,this.z+=e,this}addVectors(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this.z=e.z+t.z,this}addScaledVector(e,t){return this.x+=e.x*t,this.y+=e.y*t,this.z+=e.z*t,this}sub(e){return this.x-=e.x,this.y-=e.y,this.z-=e.z,this}subScalar(e){return this.x-=e,this.y-=e,this.z-=e,this}subVectors(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this.z=e.z-t.z,this}multiply(e){return this.x*=e.x,this.y*=e.y,this.z*=e.z,this}multiplyScalar(e){return this.x*=e,this.y*=e,this.z*=e,this}multiplyVectors(e,t){return this.x=e.x*t.x,this.y=e.y*t.y,this.z=e.z*t.z,this}applyEuler(e){return this.applyQuaternion(ex.setFromEuler(e))}applyAxisAngle(e,t){return this.applyQuaternion(ex.setFromAxisAngle(e,t))}applyMatrix3(e){const t=this.x,i=this.y,n=this.z,r=e.elements;return this.x=r[0]*t+r[3]*i+r[6]*n,this.y=r[1]*t+r[4]*i+r[7]*n,this.z=r[2]*t+r[5]*i+r[8]*n,this}applyNormalMatrix(e){return this.applyMatrix3(e).normalize()}applyMatrix4(e){const t=this.x,i=this.y,n=this.z,r=e.elements,a=1/(r[3]*t+r[7]*i+r[11]*n+r[15]);return this.x=(r[0]*t+r[4]*i+r[8]*n+r[12])*a,this.y=(r[1]*t+r[5]*i+r[9]*n+r[13])*a,this.z=(r[2]*t+r[6]*i+r[10]*n+r[14])*a,this}applyQuaternion(e){const t=this.x,i=this.y,n=this.z,r=e.x,a=e.y,o=e.z,l=e.w,c=2*(a*n-o*i),h=2*(o*t-r*n),d=2*(r*i-a*t);return this.x=t+l*c+a*d-o*h,this.y=i+l*h+o*c-r*d,this.z=n+l*d+r*h-a*c,this}project(e){return this.applyMatrix4(e.matrixWorldInverse).applyMatrix4(e.projectionMatrix)}unproject(e){return this.applyMatrix4(e.projectionMatrixInverse).applyMatrix4(e.matrixWorld)}transformDirection(e){const t=this.x,i=this.y,n=this.z,r=e.elements;return this.x=r[0]*t+r[4]*i+r[8]*n,this.y=r[1]*t+r[5]*i+r[9]*n,this.z=r[2]*t+r[6]*i+r[10]*n,this.normalize()}divide(e){return this.x/=e.x,this.y/=e.y,this.z/=e.z,this}divideScalar(e){return this.multiplyScalar(1/e)}min(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this.z=Math.min(this.z,e.z),this}max(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this.z=Math.max(this.z,e.z),this}clamp(e,t){return this.x=dt(this.x,e.x,t.x),this.y=dt(this.y,e.y,t.y),this.z=dt(this.z,e.z,t.z),this}clampScalar(e,t){return this.x=dt(this.x,e,t),this.y=dt(this.y,e,t),this.z=dt(this.z,e,t),this}clampLength(e,t){const i=this.length();return this.divideScalar(i||1).multiplyScalar(dt(i,e,t))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this}roundToZero(){return this.x=Math.trunc(this.x),this.y=Math.trunc(this.y),this.z=Math.trunc(this.z),this}negate(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this}dot(e){return this.x*e.x+this.y*e.y+this.z*e.z}lengthSq(){return this.x*this.x+this.y*this.y+this.z*this.z}length(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)}normalize(){return this.divideScalar(this.length()||1)}setLength(e){return this.normalize().multiplyScalar(e)}lerp(e,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this.z+=(e.z-this.z)*t,this}lerpVectors(e,t,i){return this.x=e.x+(t.x-e.x)*i,this.y=e.y+(t.y-e.y)*i,this.z=e.z+(t.z-e.z)*i,this}cross(e){return this.crossVectors(this,e)}crossVectors(e,t){const i=e.x,n=e.y,r=e.z,a=t.x,o=t.y,l=t.z;return this.x=n*l-r*o,this.y=r*a-i*l,this.z=i*o-n*a,this}projectOnVector(e){const t=e.lengthSq();if(t===0)return this.set(0,0,0);const i=e.dot(this)/t;return this.copy(e).multiplyScalar(i)}projectOnPlane(e){return Wm.copy(this).projectOnVector(e),this.sub(Wm)}reflect(e){return this.sub(Wm.copy(e).multiplyScalar(2*this.dot(e)))}angleTo(e){const t=Math.sqrt(this.lengthSq()*e.lengthSq());if(t===0)return Math.PI/2;const i=this.dot(e)/t;return Math.acos(dt(i,-1,1))}distanceTo(e){return Math.sqrt(this.distanceToSquared(e))}distanceToSquared(e){const t=this.x-e.x,i=this.y-e.y,n=this.z-e.z;return t*t+i*i+n*n}manhattanDistanceTo(e){return Math.abs(this.x-e.x)+Math.abs(this.y-e.y)+Math.abs(this.z-e.z)}setFromSpherical(e){return this.setFromSphericalCoords(e.radius,e.phi,e.theta)}setFromSphericalCoords(e,t,i){const n=Math.sin(t)*e;return this.x=n*Math.sin(i),this.y=Math.cos(t)*e,this.z=n*Math.cos(i),this}setFromCylindrical(e){return this.setFromCylindricalCoords(e.radius,e.theta,e.y)}setFromCylindricalCoords(e,t,i){return this.x=e*Math.sin(t),this.y=i,this.z=e*Math.cos(t),this}setFromMatrixPosition(e){const t=e.elements;return this.x=t[12],this.y=t[13],this.z=t[14],this}setFromMatrixScale(e){const t=this.setFromMatrixColumn(e,0).length(),i=this.setFromMatrixColumn(e,1).length(),n=this.setFromMatrixColumn(e,2).length();return this.x=t,this.y=i,this.z=n,this}setFromMatrixColumn(e,t){return this.fromArray(e.elements,t*4)}setFromMatrix3Column(e,t){return this.fromArray(e.elements,t*3)}setFromEuler(e){return this.x=e._x,this.y=e._y,this.z=e._z,this}setFromColor(e){return this.x=e.r,this.y=e.g,this.z=e.b,this}equals(e){return e.x===this.x&&e.y===this.y&&e.z===this.z}fromArray(e,t=0){return this.x=e[t],this.y=e[t+1],this.z=e[t+2],this}toArray(e=[],t=0){return e[t]=this.x,e[t+1]=this.y,e[t+2]=this.z,e}fromBufferAttribute(e,t){return this.x=e.getX(t),this.y=e.getY(t),this.z=e.getZ(t),this}random(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this}randomDirection(){const e=Math.random()*Math.PI*2,t=Math.random()*2-1,i=Math.sqrt(1-t*t);return this.x=i*Math.cos(e),this.y=t,this.z=i*Math.sin(e),this}*[Symbol.iterator](){yield this.x,yield this.y,yield this.z}}const Wm=new R,ex=new Kt;class pt{constructor(e,t,i,n,r,a,o,l,c){pt.prototype.isMatrix3=!0,this.elements=[1,0,0,0,1,0,0,0,1],e!==void 0&&this.set(e,t,i,n,r,a,o,l,c)}set(e,t,i,n,r,a,o,l,c){const h=this.elements;return h[0]=e,h[1]=n,h[2]=o,h[3]=t,h[4]=r,h[5]=l,h[6]=i,h[7]=a,h[8]=c,this}identity(){return this.set(1,0,0,0,1,0,0,0,1),this}copy(e){const t=this.elements,i=e.elements;return t[0]=i[0],t[1]=i[1],t[2]=i[2],t[3]=i[3],t[4]=i[4],t[5]=i[5],t[6]=i[6],t[7]=i[7],t[8]=i[8],this}extractBasis(e,t,i){return e.setFromMatrix3Column(this,0),t.setFromMatrix3Column(this,1),i.setFromMatrix3Column(this,2),this}setFromMatrix4(e){const t=e.elements;return this.set(t[0],t[4],t[8],t[1],t[5],t[9],t[2],t[6],t[10]),this}multiply(e){return this.multiplyMatrices(this,e)}premultiply(e){return this.multiplyMatrices(e,this)}multiplyMatrices(e,t){const i=e.elements,n=t.elements,r=this.elements,a=i[0],o=i[3],l=i[6],c=i[1],h=i[4],d=i[7],p=i[2],u=i[5],v=i[8],g=n[0],m=n[3],f=n[6],y=n[1],x=n[4],_=n[7],S=n[2],b=n[5],E=n[8];return r[0]=a*g+o*y+l*S,r[3]=a*m+o*x+l*b,r[6]=a*f+o*_+l*E,r[1]=c*g+h*y+d*S,r[4]=c*m+h*x+d*b,r[7]=c*f+h*_+d*E,r[2]=p*g+u*y+v*S,r[5]=p*m+u*x+v*b,r[8]=p*f+u*_+v*E,this}multiplyScalar(e){const t=this.elements;return t[0]*=e,t[3]*=e,t[6]*=e,t[1]*=e,t[4]*=e,t[7]*=e,t[2]*=e,t[5]*=e,t[8]*=e,this}determinant(){const e=this.elements,t=e[0],i=e[1],n=e[2],r=e[3],a=e[4],o=e[5],l=e[6],c=e[7],h=e[8];return t*a*h-t*o*c-i*r*h+i*o*l+n*r*c-n*a*l}invert(){const e=this.elements,t=e[0],i=e[1],n=e[2],r=e[3],a=e[4],o=e[5],l=e[6],c=e[7],h=e[8],d=h*a-o*c,p=o*l-h*r,u=c*r-a*l,v=t*d+i*p+n*u;if(v===0)return this.set(0,0,0,0,0,0,0,0,0);const g=1/v;return e[0]=d*g,e[1]=(n*c-h*i)*g,e[2]=(o*i-n*a)*g,e[3]=p*g,e[4]=(h*t-n*l)*g,e[5]=(n*r-o*t)*g,e[6]=u*g,e[7]=(i*l-c*t)*g,e[8]=(a*t-i*r)*g,this}transpose(){let e;const t=this.elements;return e=t[1],t[1]=t[3],t[3]=e,e=t[2],t[2]=t[6],t[6]=e,e=t[5],t[5]=t[7],t[7]=e,this}getNormalMatrix(e){return this.setFromMatrix4(e).invert().transpose()}transposeIntoArray(e){const t=this.elements;return e[0]=t[0],e[1]=t[3],e[2]=t[6],e[3]=t[1],e[4]=t[4],e[5]=t[7],e[6]=t[2],e[7]=t[5],e[8]=t[8],this}setUvTransform(e,t,i,n,r,a,o){const l=Math.cos(r),c=Math.sin(r);return this.set(i*l,i*c,-i*(l*a+c*o)+a+e,-n*c,n*l,-n*(-c*a+l*o)+o+t,0,0,1),this}scale(e,t){return this.premultiply(Xm.makeScale(e,t)),this}rotate(e){return this.premultiply(Xm.makeRotation(-e)),this}translate(e,t){return this.premultiply(Xm.makeTranslation(e,t)),this}makeTranslation(e,t){return e.isVector2?this.set(1,0,e.x,0,1,e.y,0,0,1):this.set(1,0,e,0,1,t,0,0,1),this}makeRotation(e){const t=Math.cos(e),i=Math.sin(e);return this.set(t,-i,0,i,t,0,0,0,1),this}makeScale(e,t){return this.set(e,0,0,0,t,0,0,0,1),this}equals(e){const t=this.elements,i=e.elements;for(let n=0;n<9;n++)if(t[n]!==i[n])return!1;return!0}fromArray(e,t=0){for(let i=0;i<9;i++)this.elements[i]=e[i+t];return this}toArray(e=[],t=0){const i=this.elements;return e[t]=i[0],e[t+1]=i[1],e[t+2]=i[2],e[t+3]=i[3],e[t+4]=i[4],e[t+5]=i[5],e[t+6]=i[6],e[t+7]=i[7],e[t+8]=i[8],e}clone(){return new this.constructor().fromArray(this.elements)}}const Xm=new pt,tx=new pt().set(.4123908,.3575843,.1804808,.212639,.7151687,.0721923,.0193308,.1191948,.9505322),ix=new pt().set(3.2409699,-1.5373832,-.4986108,-.9692436,1.8759675,.0415551,.0556301,-.203977,1.0569715);function m3(){const s={enabled:!0,workingColorSpace:Zi,spaces:{},convert:function(n,r,a){return this.enabled===!1||r===a||!r||!a||(this.spaces[r].transfer===Bt&&(n.r=$s(n.r),n.g=$s(n.g),n.b=$s(n.b)),this.spaces[r].primaries!==this.spaces[a].primaries&&(n.applyMatrix3(this.spaces[r].toXYZ),n.applyMatrix3(this.spaces[a].fromXYZ)),this.spaces[a].transfer===Bt&&(n.r=Ko(n.r),n.g=Ko(n.g),n.b=Ko(n.b))),n},workingToColorSpace:function(n,r){return this.convert(n,this.workingColorSpace,r)},colorSpaceToWorking:function(n,r){return this.convert(n,r,this.workingColorSpace)},getPrimaries:function(n){return this.spaces[n].primaries},getTransfer:function(n){return n===Ys?Pc:this.spaces[n].transfer},getToneMappingMode:function(n){return this.spaces[n].outputColorSpaceConfig.toneMappingMode||"standard"},getLuminanceCoefficients:function(n,r=this.workingColorSpace){return n.fromArray(this.spaces[r].luminanceCoefficients)},define:function(n){Object.assign(this.spaces,n)},_getMatrix:function(n,r,a){return n.copy(this.spaces[r].toXYZ).multiply(this.spaces[a].fromXYZ)},_getDrawingBufferColorSpace:function(n){return this.spaces[n].outputColorSpaceConfig.drawingBufferColorSpace},_getUnpackColorSpace:function(n=this.workingColorSpace){return this.spaces[n].workingColorSpaceConfig.unpackColorSpace},fromWorkingColorSpace:function(n,r){return Dc("ColorManagement: .fromWorkingColorSpace() has been renamed to .workingToColorSpace()."),s.workingToColorSpace(n,r)},toWorkingColorSpace:function(n,r){return Dc("ColorManagement: .toWorkingColorSpace() has been renamed to .colorSpaceToWorking()."),s.colorSpaceToWorking(n,r)}},e=[.64,.33,.3,.6,.15,.06],t=[.2126,.7152,.0722],i=[.3127,.329];return s.define({[Zi]:{primaries:e,whitePoint:i,transfer:Pc,toXYZ:tx,fromXYZ:ix,luminanceCoefficients:t,workingColorSpaceConfig:{unpackColorSpace:li},outputColorSpaceConfig:{drawingBufferColorSpace:li}},[li]:{primaries:e,whitePoint:i,transfer:Bt,toXYZ:tx,fromXYZ:ix,luminanceCoefficients:t,outputColorSpaceConfig:{drawingBufferColorSpace:li}}}),s}const wt=m3();function $s(s){return s<.04045?s*.0773993808:Math.pow(s*.9478672986+.0521327014,2.4)}function Ko(s){return s<.0031308?s*12.92:1.055*Math.pow(s,.41666)-.055}let Jo;class nx{static getDataURL(e,t="image/png"){if(/^data:/i.test(e.src)||typeof HTMLCanvasElement>"u")return e.src;let i;if(e instanceof HTMLCanvasElement)i=e;else{Jo===void 0&&(Jo=Lc("canvas")),Jo.width=e.width,Jo.height=e.height;const n=Jo.getContext("2d");e instanceof ImageData?n.putImageData(e,0,0):n.drawImage(e,0,0,e.width,e.height),i=Jo}return i.toDataURL(t)}static sRGBToLinear(e){if(typeof HTMLImageElement<"u"&&e instanceof HTMLImageElement||typeof HTMLCanvasElement<"u"&&e instanceof HTMLCanvasElement||typeof ImageBitmap<"u"&&e instanceof ImageBitmap){const t=Lc("canvas");t.width=e.width,t.height=e.height;const i=t.getContext("2d");i.drawImage(e,0,0,e.width,e.height);const n=i.getImageData(0,0,e.width,e.height),r=n.data;for(let a=0;a<r.length;a++)r[a]=$s(r[a]/255)*255;return i.putImageData(n,0,0),t}else if(e.data){const t=e.data.slice(0);for(let i=0;i<t.length;i++)t instanceof Uint8Array||t instanceof Uint8ClampedArray?t[i]=Math.floor($s(t[i]/255)*255):t[i]=$s(t[i]);return{data:t,width:e.width,height:e.height}}else return Ye("ImageUtils.sRGBToLinear(): Unsupported image type. No color space conversion applied."),e}}let g3=0;class Or{constructor(e=null){this.isSource=!0,Object.defineProperty(this,"id",{value:g3++}),this.uuid=kn(),this.data=e,this.dataReady=!0,this.version=0}getSize(e){const t=this.data;return typeof HTMLVideoElement<"u"&&t instanceof HTMLVideoElement?e.set(t.videoWidth,t.videoHeight,0):typeof VideoFrame<"u"&&t instanceof VideoFrame?e.set(t.displayHeight,t.displayWidth,0):t!==null?e.set(t.width,t.height,t.depth||0):e.set(0,0,0),e}set needsUpdate(e){e===!0&&this.version++}toJSON(e){const t=e===void 0||typeof e=="string";if(!t&&e.images[this.uuid]!==void 0)return e.images[this.uuid];const i={uuid:this.uuid,url:""},n=this.data;if(n!==null){let r;if(Array.isArray(n)){r=[];for(let a=0,o=n.length;a<o;a++)n[a].isDataTexture?r.push(jm(n[a].image)):r.push(jm(n[a]))}else r=jm(n);i.url=r}return t||(e.images[this.uuid]=i),i}}function jm(s){return typeof HTMLImageElement<"u"&&s instanceof HTMLImageElement||typeof HTMLCanvasElement<"u"&&s instanceof HTMLCanvasElement||typeof ImageBitmap<"u"&&s instanceof ImageBitmap?nx.getDataURL(s):s.data?{data:Array.from(s.data),width:s.width,height:s.height,type:s.data.constructor.name}:(Ye("Texture: Unable to serialize Texture."),{})}let v3=0;const qm=new R;class ei extends hs{constructor(e=ei.DEFAULT_IMAGE,t=ei.DEFAULT_MAPPING,i=cn,n=cn,r=At,a=qn,o=qi,l=hn,c=ei.DEFAULT_ANISOTROPY,h=Ys){super(),this.isTexture=!0,Object.defineProperty(this,"id",{value:v3++}),this.uuid=kn(),this.name="",this.source=new Or(e),this.mipmaps=[],this.mapping=t,this.channel=0,this.wrapS=i,this.wrapT=n,this.magFilter=r,this.minFilter=a,this.anisotropy=c,this.format=o,this.internalFormat=null,this.type=l,this.offset=new me(0,0),this.repeat=new me(1,1),this.center=new me(0,0),this.rotation=0,this.matrixAutoUpdate=!0,this.matrix=new pt,this.generateMipmaps=!0,this.premultiplyAlpha=!1,this.flipY=!0,this.unpackAlignment=4,this.colorSpace=h,this.userData={},this.updateRanges=[],this.version=0,this.onUpdate=null,this.renderTarget=null,this.isRenderTargetTexture=!1,this.isArrayTexture=!!(e&&e.depth&&e.depth>1),this.pmremVersion=0}get width(){return this.source.getSize(qm).x}get height(){return this.source.getSize(qm).y}get depth(){return this.source.getSize(qm).z}get image(){return this.source.data}set image(e=null){this.source.data=e}updateMatrix(){this.matrix.setUvTransform(this.offset.x,this.offset.y,this.repeat.x,this.repeat.y,this.rotation,this.center.x,this.center.y)}addUpdateRange(e,t){this.updateRanges.push({start:e,count:t})}clearUpdateRanges(){this.updateRanges.length=0}clone(){return new this.constructor().copy(this)}copy(e){return this.name=e.name,this.source=e.source,this.mipmaps=e.mipmaps.slice(0),this.mapping=e.mapping,this.channel=e.channel,this.wrapS=e.wrapS,this.wrapT=e.wrapT,this.magFilter=e.magFilter,this.minFilter=e.minFilter,this.anisotropy=e.anisotropy,this.format=e.format,this.internalFormat=e.internalFormat,this.type=e.type,this.offset.copy(e.offset),this.repeat.copy(e.repeat),this.center.copy(e.center),this.rotation=e.rotation,this.matrixAutoUpdate=e.matrixAutoUpdate,this.matrix.copy(e.matrix),this.generateMipmaps=e.generateMipmaps,this.premultiplyAlpha=e.premultiplyAlpha,this.flipY=e.flipY,this.unpackAlignment=e.unpackAlignment,this.colorSpace=e.colorSpace,this.renderTarget=e.renderTarget,this.isRenderTargetTexture=e.isRenderTargetTexture,this.isArrayTexture=e.isArrayTexture,this.userData=JSON.parse(JSON.stringify(e.userData)),this.needsUpdate=!0,this}setValues(e){for(const t in e){const i=e[t];if(i===void 0){Ye(`Texture.setValues(): parameter '${t}' has value of undefined.`);continue}const n=this[t];if(n===void 0){Ye(`Texture.setValues(): property '${t}' does not exist.`);continue}n&&i&&n.isVector2&&i.isVector2||n&&i&&n.isVector3&&i.isVector3||n&&i&&n.isMatrix3&&i.isMatrix3?n.copy(i):this[t]=i}}toJSON(e){const t=e===void 0||typeof e=="string";if(!t&&e.textures[this.uuid]!==void 0)return e.textures[this.uuid];const i={metadata:{version:4.7,type:"Texture",generator:"Texture.toJSON"},uuid:this.uuid,name:this.name,image:this.source.toJSON(e).uuid,mapping:this.mapping,channel:this.channel,repeat:[this.repeat.x,this.repeat.y],offset:[this.offset.x,this.offset.y],center:[this.center.x,this.center.y],rotation:this.rotation,wrap:[this.wrapS,this.wrapT],format:this.format,internalFormat:this.internalFormat,type:this.type,colorSpace:this.colorSpace,minFilter:this.minFilter,magFilter:this.magFilter,anisotropy:this.anisotropy,flipY:this.flipY,generateMipmaps:this.generateMipmaps,premultiplyAlpha:this.premultiplyAlpha,unpackAlignment:this.unpackAlignment};return Object.keys(this.userData).length>0&&(i.userData=this.userData),t||(e.textures[this.uuid]=i),i}dispose(){this.dispatchEvent({type:"dispose"})}transformUv(e){if(this.mapping!==wd)return e;if(e.applyMatrix3(this.matrix),e.x<0||e.x>1)switch(this.wrapS){case Ji:e.x=e.x-Math.floor(e.x);break;case cn:e.x=e.x<0?0:1;break;case Wo:Math.abs(Math.floor(e.x)%2)===1?e.x=Math.ceil(e.x)-e.x:e.x=e.x-Math.floor(e.x);break}if(e.y<0||e.y>1)switch(this.wrapT){case Ji:e.y=e.y-Math.floor(e.y);break;case cn:e.y=e.y<0?0:1;break;case Wo:Math.abs(Math.floor(e.y)%2)===1?e.y=Math.ceil(e.y)-e.y:e.y=e.y-Math.floor(e.y);break}return this.flipY&&(e.y=1-e.y),e}set needsUpdate(e){e===!0&&(this.version++,this.source.needsUpdate=!0)}set needsPMREMUpdate(e){e===!0&&this.pmremVersion++}}ei.DEFAULT_IMAGE=null,ei.DEFAULT_MAPPING=wd,ei.DEFAULT_ANISOTROPY=1;class Pt{constructor(e=0,t=0,i=0,n=1){Pt.prototype.isVector4=!0,this.x=e,this.y=t,this.z=i,this.w=n}get width(){return this.z}set width(e){this.z=e}get height(){return this.w}set height(e){this.w=e}set(e,t,i,n){return this.x=e,this.y=t,this.z=i,this.w=n,this}setScalar(e){return this.x=e,this.y=e,this.z=e,this.w=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setZ(e){return this.z=e,this}setW(e){return this.w=e,this}setComponent(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;case 2:this.z=t;break;case 3:this.w=t;break;default:throw new Error("index is out of range: "+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;case 2:return this.z;case 3:return this.w;default:throw new Error("index is out of range: "+e)}}clone(){return new this.constructor(this.x,this.y,this.z,this.w)}copy(e){return this.x=e.x,this.y=e.y,this.z=e.z,this.w=e.w!==void 0?e.w:1,this}add(e){return this.x+=e.x,this.y+=e.y,this.z+=e.z,this.w+=e.w,this}addScalar(e){return this.x+=e,this.y+=e,this.z+=e,this.w+=e,this}addVectors(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this.z=e.z+t.z,this.w=e.w+t.w,this}addScaledVector(e,t){return this.x+=e.x*t,this.y+=e.y*t,this.z+=e.z*t,this.w+=e.w*t,this}sub(e){return this.x-=e.x,this.y-=e.y,this.z-=e.z,this.w-=e.w,this}subScalar(e){return this.x-=e,this.y-=e,this.z-=e,this.w-=e,this}subVectors(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this.z=e.z-t.z,this.w=e.w-t.w,this}multiply(e){return this.x*=e.x,this.y*=e.y,this.z*=e.z,this.w*=e.w,this}multiplyScalar(e){return this.x*=e,this.y*=e,this.z*=e,this.w*=e,this}applyMatrix4(e){const t=this.x,i=this.y,n=this.z,r=this.w,a=e.elements;return this.x=a[0]*t+a[4]*i+a[8]*n+a[12]*r,this.y=a[1]*t+a[5]*i+a[9]*n+a[13]*r,this.z=a[2]*t+a[6]*i+a[10]*n+a[14]*r,this.w=a[3]*t+a[7]*i+a[11]*n+a[15]*r,this}divide(e){return this.x/=e.x,this.y/=e.y,this.z/=e.z,this.w/=e.w,this}divideScalar(e){return this.multiplyScalar(1/e)}setAxisAngleFromQuaternion(e){this.w=2*Math.acos(e.w);const t=Math.sqrt(1-e.w*e.w);return t<1e-4?(this.x=1,this.y=0,this.z=0):(this.x=e.x/t,this.y=e.y/t,this.z=e.z/t),this}setAxisAngleFromRotationMatrix(e){let t,i,n,r;const l=e.elements,c=l[0],h=l[4],d=l[8],p=l[1],u=l[5],v=l[9],g=l[2],m=l[6],f=l[10];if(Math.abs(h-p)<.01&&Math.abs(d-g)<.01&&Math.abs(v-m)<.01){if(Math.abs(h+p)<.1&&Math.abs(d+g)<.1&&Math.abs(v+m)<.1&&Math.abs(c+u+f-3)<.1)return this.set(1,0,0,0),this;t=Math.PI;const x=(c+1)/2,_=(u+1)/2,S=(f+1)/2,b=(h+p)/4,E=(d+g)/4,w=(v+m)/4;return x>_&&x>S?x<.01?(i=0,n=.707106781,r=.707106781):(i=Math.sqrt(x),n=b/i,r=E/i):_>S?_<.01?(i=.707106781,n=0,r=.707106781):(n=Math.sqrt(_),i=b/n,r=w/n):S<.01?(i=.707106781,n=.707106781,r=0):(r=Math.sqrt(S),i=E/r,n=w/r),this.set(i,n,r,t),this}let y=Math.sqrt((m-v)*(m-v)+(d-g)*(d-g)+(p-h)*(p-h));return Math.abs(y)<.001&&(y=1),this.x=(m-v)/y,this.y=(d-g)/y,this.z=(p-h)/y,this.w=Math.acos((c+u+f-1)/2),this}setFromMatrixPosition(e){const t=e.elements;return this.x=t[12],this.y=t[13],this.z=t[14],this.w=t[15],this}min(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this.z=Math.min(this.z,e.z),this.w=Math.min(this.w,e.w),this}max(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this.z=Math.max(this.z,e.z),this.w=Math.max(this.w,e.w),this}clamp(e,t){return this.x=dt(this.x,e.x,t.x),this.y=dt(this.y,e.y,t.y),this.z=dt(this.z,e.z,t.z),this.w=dt(this.w,e.w,t.w),this}clampScalar(e,t){return this.x=dt(this.x,e,t),this.y=dt(this.y,e,t),this.z=dt(this.z,e,t),this.w=dt(this.w,e,t),this}clampLength(e,t){const i=this.length();return this.divideScalar(i||1).multiplyScalar(dt(i,e,t))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this.w=Math.floor(this.w),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this.w=Math.ceil(this.w),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this.w=Math.round(this.w),this}roundToZero(){return this.x=Math.trunc(this.x),this.y=Math.trunc(this.y),this.z=Math.trunc(this.z),this.w=Math.trunc(this.w),this}negate(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this.w=-this.w,this}dot(e){return this.x*e.x+this.y*e.y+this.z*e.z+this.w*e.w}lengthSq(){return this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w}length(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)+Math.abs(this.w)}normalize(){return this.divideScalar(this.length()||1)}setLength(e){return this.normalize().multiplyScalar(e)}lerp(e,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this.z+=(e.z-this.z)*t,this.w+=(e.w-this.w)*t,this}lerpVectors(e,t,i){return this.x=e.x+(t.x-e.x)*i,this.y=e.y+(t.y-e.y)*i,this.z=e.z+(t.z-e.z)*i,this.w=e.w+(t.w-e.w)*i,this}equals(e){return e.x===this.x&&e.y===this.y&&e.z===this.z&&e.w===this.w}fromArray(e,t=0){return this.x=e[t],this.y=e[t+1],this.z=e[t+2],this.w=e[t+3],this}toArray(e=[],t=0){return e[t]=this.x,e[t+1]=this.y,e[t+2]=this.z,e[t+3]=this.w,e}fromBufferAttribute(e,t){return this.x=e.getX(t),this.y=e.getY(t),this.z=e.getZ(t),this.w=e.getW(t),this}random(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this.w=Math.random(),this}*[Symbol.iterator](){yield this.x,yield this.y,yield this.z,yield this.w}}class Zm extends hs{constructor(e=1,t=1,i={}){super(),i=Object.assign({generateMipmaps:!1,internalFormat:null,minFilter:At,depthBuffer:!0,stencilBuffer:!1,resolveDepthBuffer:!0,resolveStencilBuffer:!0,depthTexture:null,samples:0,count:1,depth:1,multiview:!1},i),this.isRenderTarget=!0,this.width=e,this.height=t,this.depth=i.depth,this.scissor=new Pt(0,0,e,t),this.scissorTest=!1,this.viewport=new Pt(0,0,e,t),this.textures=[];const n={width:e,height:t,depth:i.depth},r=new ei(n),a=i.count;for(let o=0;o<a;o++)this.textures[o]=r.clone(),this.textures[o].isRenderTargetTexture=!0,this.textures[o].renderTarget=this;this._setTextureOptions(i),this.depthBuffer=i.depthBuffer,this.stencilBuffer=i.stencilBuffer,this.resolveDepthBuffer=i.resolveDepthBuffer,this.resolveStencilBuffer=i.resolveStencilBuffer,this._depthTexture=null,this.depthTexture=i.depthTexture,this.samples=i.samples,this.multiview=i.multiview}_setTextureOptions(e={}){const t={minFilter:At,generateMipmaps:!1,flipY:!1,internalFormat:null};e.mapping!==void 0&&(t.mapping=e.mapping),e.wrapS!==void 0&&(t.wrapS=e.wrapS),e.wrapT!==void 0&&(t.wrapT=e.wrapT),e.wrapR!==void 0&&(t.wrapR=e.wrapR),e.magFilter!==void 0&&(t.magFilter=e.magFilter),e.minFilter!==void 0&&(t.minFilter=e.minFilter),e.format!==void 0&&(t.format=e.format),e.type!==void 0&&(t.type=e.type),e.anisotropy!==void 0&&(t.anisotropy=e.anisotropy),e.colorSpace!==void 0&&(t.colorSpace=e.colorSpace),e.flipY!==void 0&&(t.flipY=e.flipY),e.generateMipmaps!==void 0&&(t.generateMipmaps=e.generateMipmaps),e.internalFormat!==void 0&&(t.internalFormat=e.internalFormat);for(let i=0;i<this.textures.length;i++)this.textures[i].setValues(t)}get texture(){return this.textures[0]}set texture(e){this.textures[0]=e}set depthTexture(e){this._depthTexture!==null&&(this._depthTexture.renderTarget=null),e!==null&&(e.renderTarget=this),this._depthTexture=e}get depthTexture(){return this._depthTexture}setSize(e,t,i=1){if(this.width!==e||this.height!==t||this.depth!==i){this.width=e,this.height=t,this.depth=i;for(let n=0,r=this.textures.length;n<r;n++)this.textures[n].image.width=e,this.textures[n].image.height=t,this.textures[n].image.depth=i,this.textures[n].isData3DTexture!==!0&&(this.textures[n].isArrayTexture=this.textures[n].image.depth>1);this.dispose()}this.viewport.set(0,0,e,t),this.scissor.set(0,0,e,t)}clone(){return new this.constructor().copy(this)}copy(e){this.width=e.width,this.height=e.height,this.depth=e.depth,this.scissor.copy(e.scissor),this.scissorTest=e.scissorTest,this.viewport.copy(e.viewport),this.textures.length=0;for(let t=0,i=e.textures.length;t<i;t++){this.textures[t]=e.textures[t].clone(),this.textures[t].isRenderTargetTexture=!0,this.textures[t].renderTarget=this;const n=Object.assign({},e.textures[t].image);this.textures[t].source=new Or(n)}return this.depthBuffer=e.depthBuffer,this.stencilBuffer=e.stencilBuffer,this.resolveDepthBuffer=e.resolveDepthBuffer,this.resolveStencilBuffer=e.resolveStencilBuffer,e.depthTexture!==null&&(this.depthTexture=e.depthTexture.clone()),this.samples=e.samples,this}dispose(){this.dispatchEvent({type:"dispose"})}}class bi extends Zm{constructor(e=1,t=1,i={}){super(e,t,i),this.isWebGLRenderTarget=!0}}class fu extends ei{constructor(e=null,t=1,i=1,n=1){super(null),this.isDataArrayTexture=!0,this.image={data:e,width:t,height:i,depth:n},this.magFilter=Yt,this.minFilter=Yt,this.wrapR=cn,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1,this.layerUpdates=new Set}addLayerUpdate(e){this.layerUpdates.add(e)}clearLayerUpdates(){this.layerUpdates.clear()}}class y3 extends bi{constructor(e=1,t=1,i=1,n={}){super(e,t,n),this.isWebGLArrayRenderTarget=!0,this.depth=i,this.texture=new fu(null,e,t,i),this._setTextureOptions(n),this.texture.isRenderTargetTexture=!0}}class mu extends ei{constructor(e=null,t=1,i=1,n=1){super(null),this.isData3DTexture=!0,this.image={data:e,width:t,height:i,depth:n},this.magFilter=Yt,this.minFilter=Yt,this.wrapR=cn,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1}}class x3 extends bi{constructor(e=1,t=1,i=1,n={}){super(e,t,n),this.isWebGL3DRenderTarget=!0,this.depth=i,this.texture=new mu(null,e,t,i),this._setTextureOptions(n),this.texture.isRenderTargetTexture=!0}}class qe{constructor(e,t,i,n,r,a,o,l,c,h,d,p,u,v,g,m){qe.prototype.isMatrix4=!0,this.elements=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],e!==void 0&&this.set(e,t,i,n,r,a,o,l,c,h,d,p,u,v,g,m)}set(e,t,i,n,r,a,o,l,c,h,d,p,u,v,g,m){const f=this.elements;return f[0]=e,f[4]=t,f[8]=i,f[12]=n,f[1]=r,f[5]=a,f[9]=o,f[13]=l,f[2]=c,f[6]=h,f[10]=d,f[14]=p,f[3]=u,f[7]=v,f[11]=g,f[15]=m,this}identity(){return this.set(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1),this}clone(){return new qe().fromArray(this.elements)}copy(e){const t=this.elements,i=e.elements;return t[0]=i[0],t[1]=i[1],t[2]=i[2],t[3]=i[3],t[4]=i[4],t[5]=i[5],t[6]=i[6],t[7]=i[7],t[8]=i[8],t[9]=i[9],t[10]=i[10],t[11]=i[11],t[12]=i[12],t[13]=i[13],t[14]=i[14],t[15]=i[15],this}copyPosition(e){const t=this.elements,i=e.elements;return t[12]=i[12],t[13]=i[13],t[14]=i[14],this}setFromMatrix3(e){const t=e.elements;return this.set(t[0],t[3],t[6],0,t[1],t[4],t[7],0,t[2],t[5],t[8],0,0,0,0,1),this}extractBasis(e,t,i){return this.determinant()===0?(e.set(1,0,0),t.set(0,1,0),i.set(0,0,1),this):(e.setFromMatrixColumn(this,0),t.setFromMatrixColumn(this,1),i.setFromMatrixColumn(this,2),this)}makeBasis(e,t,i){return this.set(e.x,t.x,i.x,0,e.y,t.y,i.y,0,e.z,t.z,i.z,0,0,0,0,1),this}extractRotation(e){if(e.determinant()===0)return this.identity();const t=this.elements,i=e.elements,n=1/Qo.setFromMatrixColumn(e,0).length(),r=1/Qo.setFromMatrixColumn(e,1).length(),a=1/Qo.setFromMatrixColumn(e,2).length();return t[0]=i[0]*n,t[1]=i[1]*n,t[2]=i[2]*n,t[3]=0,t[4]=i[4]*r,t[5]=i[5]*r,t[6]=i[6]*r,t[7]=0,t[8]=i[8]*a,t[9]=i[9]*a,t[10]=i[10]*a,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,this}makeRotationFromEuler(e){const t=this.elements,i=e.x,n=e.y,r=e.z,a=Math.cos(i),o=Math.sin(i),l=Math.cos(n),c=Math.sin(n),h=Math.cos(r),d=Math.sin(r);if(e.order==="XYZ"){const p=a*h,u=a*d,v=o*h,g=o*d;t[0]=l*h,t[4]=-l*d,t[8]=c,t[1]=u+v*c,t[5]=p-g*c,t[9]=-o*l,t[2]=g-p*c,t[6]=v+u*c,t[10]=a*l}else if(e.order==="YXZ"){const p=l*h,u=l*d,v=c*h,g=c*d;t[0]=p+g*o,t[4]=v*o-u,t[8]=a*c,t[1]=a*d,t[5]=a*h,t[9]=-o,t[2]=u*o-v,t[6]=g+p*o,t[10]=a*l}else if(e.order==="ZXY"){const p=l*h,u=l*d,v=c*h,g=c*d;t[0]=p-g*o,t[4]=-a*d,t[8]=v+u*o,t[1]=u+v*o,t[5]=a*h,t[9]=g-p*o,t[2]=-a*c,t[6]=o,t[10]=a*l}else if(e.order==="ZYX"){const p=a*h,u=a*d,v=o*h,g=o*d;t[0]=l*h,t[4]=v*c-u,t[8]=p*c+g,t[1]=l*d,t[5]=g*c+p,t[9]=u*c-v,t[2]=-c,t[6]=o*l,t[10]=a*l}else if(e.order==="YZX"){const p=a*l,u=a*c,v=o*l,g=o*c;t[0]=l*h,t[4]=g-p*d,t[8]=v*d+u,t[1]=d,t[5]=a*h,t[9]=-o*h,t[2]=-c*h,t[6]=u*d+v,t[10]=p-g*d}else if(e.order==="XZY"){const p=a*l,u=a*c,v=o*l,g=o*c;t[0]=l*h,t[4]=-d,t[8]=c*h,t[1]=p*d+g,t[5]=a*h,t[9]=u*d-v,t[2]=v*d-u,t[6]=o*h,t[10]=g*d+p}return t[3]=0,t[7]=0,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,this}makeRotationFromQuaternion(e){return this.compose(_3,e,b3)}lookAt(e,t,i){const n=this.elements;return On.subVectors(e,t),On.lengthSq()===0&&(On.z=1),On.normalize(),Ur.crossVectors(i,On),Ur.lengthSq()===0&&(Math.abs(i.z)===1?On.x+=1e-4:On.z+=1e-4,On.normalize(),Ur.crossVectors(i,On)),Ur.normalize(),gu.crossVectors(On,Ur),n[0]=Ur.x,n[4]=gu.x,n[8]=On.x,n[1]=Ur.y,n[5]=gu.y,n[9]=On.y,n[2]=Ur.z,n[6]=gu.z,n[10]=On.z,this}multiply(e){return this.multiplyMatrices(this,e)}premultiply(e){return this.multiplyMatrices(e,this)}multiplyMatrices(e,t){const i=e.elements,n=t.elements,r=this.elements,a=i[0],o=i[4],l=i[8],c=i[12],h=i[1],d=i[5],p=i[9],u=i[13],v=i[2],g=i[6],m=i[10],f=i[14],y=i[3],x=i[7],_=i[11],S=i[15],b=n[0],E=n[4],w=n[8],M=n[12],C=n[1],L=n[5],P=n[9],k=n[13],A=n[2],B=n[6],F=n[10],H=n[14],q=n[3],G=n[7],re=n[11],Y=n[15];return r[0]=a*b+o*C+l*A+c*q,r[4]=a*E+o*L+l*B+c*G,r[8]=a*w+o*P+l*F+c*re,r[12]=a*M+o*k+l*H+c*Y,r[1]=h*b+d*C+p*A+u*q,r[5]=h*E+d*L+p*B+u*G,r[9]=h*w+d*P+p*F+u*re,r[13]=h*M+d*k+p*H+u*Y,r[2]=v*b+g*C+m*A+f*q,r[6]=v*E+g*L+m*B+f*G,r[10]=v*w+g*P+m*F+f*re,r[14]=v*M+g*k+m*H+f*Y,r[3]=y*b+x*C+_*A+S*q,r[7]=y*E+x*L+_*B+S*G,r[11]=y*w+x*P+_*F+S*re,r[15]=y*M+x*k+_*H+S*Y,this}multiplyScalar(e){const t=this.elements;return t[0]*=e,t[4]*=e,t[8]*=e,t[12]*=e,t[1]*=e,t[5]*=e,t[9]*=e,t[13]*=e,t[2]*=e,t[6]*=e,t[10]*=e,t[14]*=e,t[3]*=e,t[7]*=e,t[11]*=e,t[15]*=e,this}determinant(){const e=this.elements,t=e[0],i=e[4],n=e[8],r=e[12],a=e[1],o=e[5],l=e[9],c=e[13],h=e[2],d=e[6],p=e[10],u=e[14],v=e[3],g=e[7],m=e[11],f=e[15],y=l*u-c*p,x=o*u-c*d,_=o*p-l*d,S=a*u-c*h,b=a*p-l*h,E=a*d-o*h;return t*(g*y-m*x+f*_)-i*(v*y-m*S+f*b)+n*(v*x-g*S+f*E)-r*(v*_-g*b+m*E)}transpose(){const e=this.elements;let t;return t=e[1],e[1]=e[4],e[4]=t,t=e[2],e[2]=e[8],e[8]=t,t=e[6],e[6]=e[9],e[9]=t,t=e[3],e[3]=e[12],e[12]=t,t=e[7],e[7]=e[13],e[13]=t,t=e[11],e[11]=e[14],e[14]=t,this}setPosition(e,t,i){const n=this.elements;return e.isVector3?(n[12]=e.x,n[13]=e.y,n[14]=e.z):(n[12]=e,n[13]=t,n[14]=i),this}invert(){const e=this.elements,t=e[0],i=e[1],n=e[2],r=e[3],a=e[4],o=e[5],l=e[6],c=e[7],h=e[8],d=e[9],p=e[10],u=e[11],v=e[12],g=e[13],m=e[14],f=e[15],y=t*o-i*a,x=t*l-n*a,_=t*c-r*a,S=i*l-n*o,b=i*c-r*o,E=n*c-r*l,w=h*g-d*v,M=h*m-p*v,C=h*f-u*v,L=d*m-p*g,P=d*f-u*g,k=p*f-u*m,A=y*k-x*P+_*L+S*C-b*M+E*w;if(A===0)return this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);const B=1/A;return e[0]=(o*k-l*P+c*L)*B,e[1]=(n*P-i*k-r*L)*B,e[2]=(g*E-m*b+f*S)*B,e[3]=(p*b-d*E-u*S)*B,e[4]=(l*C-a*k-c*M)*B,e[5]=(t*k-n*C+r*M)*B,e[6]=(m*_-v*E-f*x)*B,e[7]=(h*E-p*_+u*x)*B,e[8]=(a*P-o*C+c*w)*B,e[9]=(i*C-t*P-r*w)*B,e[10]=(v*b-g*_+f*y)*B,e[11]=(d*_-h*b-u*y)*B,e[12]=(o*M-a*L-l*w)*B,e[13]=(t*L-i*M+n*w)*B,e[14]=(g*x-v*S-m*y)*B,e[15]=(h*S-d*x+p*y)*B,this}scale(e){const t=this.elements,i=e.x,n=e.y,r=e.z;return t[0]*=i,t[4]*=n,t[8]*=r,t[1]*=i,t[5]*=n,t[9]*=r,t[2]*=i,t[6]*=n,t[10]*=r,t[3]*=i,t[7]*=n,t[11]*=r,this}getMaxScaleOnAxis(){const e=this.elements,t=e[0]*e[0]+e[1]*e[1]+e[2]*e[2],i=e[4]*e[4]+e[5]*e[5]+e[6]*e[6],n=e[8]*e[8]+e[9]*e[9]+e[10]*e[10];return Math.sqrt(Math.max(t,i,n))}makeTranslation(e,t,i){return e.isVector3?this.set(1,0,0,e.x,0,1,0,e.y,0,0,1,e.z,0,0,0,1):this.set(1,0,0,e,0,1,0,t,0,0,1,i,0,0,0,1),this}makeRotationX(e){const t=Math.cos(e),i=Math.sin(e);return this.set(1,0,0,0,0,t,-i,0,0,i,t,0,0,0,0,1),this}makeRotationY(e){const t=Math.cos(e),i=Math.sin(e);return this.set(t,0,i,0,0,1,0,0,-i,0,t,0,0,0,0,1),this}makeRotationZ(e){const t=Math.cos(e),i=Math.sin(e);return this.set(t,-i,0,0,i,t,0,0,0,0,1,0,0,0,0,1),this}makeRotationAxis(e,t){const i=Math.cos(t),n=Math.sin(t),r=1-i,a=e.x,o=e.y,l=e.z,c=r*a,h=r*o;return this.set(c*a+i,c*o-n*l,c*l+n*o,0,c*o+n*l,h*o+i,h*l-n*a,0,c*l-n*o,h*l+n*a,r*l*l+i,0,0,0,0,1),this}makeScale(e,t,i){return this.set(e,0,0,0,0,t,0,0,0,0,i,0,0,0,0,1),this}makeShear(e,t,i,n,r,a){return this.set(1,i,r,0,e,1,a,0,t,n,1,0,0,0,0,1),this}compose(e,t,i){const n=this.elements,r=t._x,a=t._y,o=t._z,l=t._w,c=r+r,h=a+a,d=o+o,p=r*c,u=r*h,v=r*d,g=a*h,m=a*d,f=o*d,y=l*c,x=l*h,_=l*d,S=i.x,b=i.y,E=i.z;return n[0]=(1-(g+f))*S,n[1]=(u+_)*S,n[2]=(v-x)*S,n[3]=0,n[4]=(u-_)*b,n[5]=(1-(p+f))*b,n[6]=(m+y)*b,n[7]=0,n[8]=(v+x)*E,n[9]=(m-y)*E,n[10]=(1-(p+g))*E,n[11]=0,n[12]=e.x,n[13]=e.y,n[14]=e.z,n[15]=1,this}decompose(e,t,i){const n=this.elements;e.x=n[12],e.y=n[13],e.z=n[14];const r=this.determinant();if(r===0)return i.set(1,1,1),t.identity(),this;let a=Qo.set(n[0],n[1],n[2]).length();const o=Qo.set(n[4],n[5],n[6]).length(),l=Qo.set(n[8],n[9],n[10]).length();r<0&&(a=-a),ds.copy(this);const c=1/a,h=1/o,d=1/l;return ds.elements[0]*=c,ds.elements[1]*=c,ds.elements[2]*=c,ds.elements[4]*=h,ds.elements[5]*=h,ds.elements[6]*=h,ds.elements[8]*=d,ds.elements[9]*=d,ds.elements[10]*=d,t.setFromRotationMatrix(ds),i.x=a,i.y=o,i.z=l,this}makePerspective(e,t,i,n,r,a,o=Nn,l=!1){const c=this.elements,h=2*r/(t-e),d=2*r/(i-n),p=(t+e)/(t-e),u=(i+n)/(i-n);let v,g;if(l)v=r/(a-r),g=a*r/(a-r);else if(o===Nn)v=-(a+r)/(a-r),g=-2*a*r/(a-r);else if(o===Pa)v=-a/(a-r),g=-a*r/(a-r);else throw new Error("THREE.Matrix4.makePerspective(): Invalid coordinate system: "+o);return c[0]=h,c[4]=0,c[8]=p,c[12]=0,c[1]=0,c[5]=d,c[9]=u,c[13]=0,c[2]=0,c[6]=0,c[10]=v,c[14]=g,c[3]=0,c[7]=0,c[11]=-1,c[15]=0,this}makeOrthographic(e,t,i,n,r,a,o=Nn,l=!1){const c=this.elements,h=2/(t-e),d=2/(i-n),p=-(t+e)/(t-e),u=-(i+n)/(i-n);let v,g;if(l)v=1/(a-r),g=a/(a-r);else if(o===Nn)v=-2/(a-r),g=-(a+r)/(a-r);else if(o===Pa)v=-1/(a-r),g=-r/(a-r);else throw new Error("THREE.Matrix4.makeOrthographic(): Invalid coordinate system: "+o);return c[0]=h,c[4]=0,c[8]=0,c[12]=p,c[1]=0,c[5]=d,c[9]=0,c[13]=u,c[2]=0,c[6]=0,c[10]=v,c[14]=g,c[3]=0,c[7]=0,c[11]=0,c[15]=1,this}equals(e){const t=this.elements,i=e.elements;for(let n=0;n<16;n++)if(t[n]!==i[n])return!1;return!0}fromArray(e,t=0){for(let i=0;i<16;i++)this.elements[i]=e[i+t];return this}toArray(e=[],t=0){const i=this.elements;return e[t]=i[0],e[t+1]=i[1],e[t+2]=i[2],e[t+3]=i[3],e[t+4]=i[4],e[t+5]=i[5],e[t+6]=i[6],e[t+7]=i[7],e[t+8]=i[8],e[t+9]=i[9],e[t+10]=i[10],e[t+11]=i[11],e[t+12]=i[12],e[t+13]=i[13],e[t+14]=i[14],e[t+15]=i[15],e}}const Qo=new R,ds=new qe,_3=new R(0,0,0),b3=new R(1,1,1),Ur=new R,gu=new R,On=new R,sx=new qe,rx=new Kt;class Fi{constructor(e=0,t=0,i=0,n=Fi.DEFAULT_ORDER){this.isEuler=!0,this._x=e,this._y=t,this._z=i,this._order=n}get x(){return this._x}set x(e){this._x=e,this._onChangeCallback()}get y(){return this._y}set y(e){this._y=e,this._onChangeCallback()}get z(){return this._z}set z(e){this._z=e,this._onChangeCallback()}get order(){return this._order}set order(e){this._order=e,this._onChangeCallback()}set(e,t,i,n=this._order){return this._x=e,this._y=t,this._z=i,this._order=n,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._order)}copy(e){return this._x=e._x,this._y=e._y,this._z=e._z,this._order=e._order,this._onChangeCallback(),this}setFromRotationMatrix(e,t=this._order,i=!0){const n=e.elements,r=n[0],a=n[4],o=n[8],l=n[1],c=n[5],h=n[9],d=n[2],p=n[6],u=n[10];switch(t){case"XYZ":this._y=Math.asin(dt(o,-1,1)),Math.abs(o)<.9999999?(this._x=Math.atan2(-h,u),this._z=Math.atan2(-a,r)):(this._x=Math.atan2(p,c),this._z=0);break;case"YXZ":this._x=Math.asin(-dt(h,-1,1)),Math.abs(h)<.9999999?(this._y=Math.atan2(o,u),this._z=Math.atan2(l,c)):(this._y=Math.atan2(-d,r),this._z=0);break;case"ZXY":this._x=Math.asin(dt(p,-1,1)),Math.abs(p)<.9999999?(this._y=Math.atan2(-d,u),this._z=Math.atan2(-a,c)):(this._y=0,this._z=Math.atan2(l,r));break;case"ZYX":this._y=Math.asin(-dt(d,-1,1)),Math.abs(d)<.9999999?(this._x=Math.atan2(p,u),this._z=Math.atan2(l,r)):(this._x=0,this._z=Math.atan2(-a,c));break;case"YZX":this._z=Math.asin(dt(l,-1,1)),Math.abs(l)<.9999999?(this._x=Math.atan2(-h,c),this._y=Math.atan2(-d,r)):(this._x=0,this._y=Math.atan2(o,u));break;case"XZY":this._z=Math.asin(-dt(a,-1,1)),Math.abs(a)<.9999999?(this._x=Math.atan2(p,c),this._y=Math.atan2(o,r)):(this._x=Math.atan2(-h,u),this._y=0);break;default:Ye("Euler: .setFromRotationMatrix() encountered an unknown order: "+t)}return this._order=t,i===!0&&this._onChangeCallback(),this}setFromQuaternion(e,t,i){return sx.makeRotationFromQuaternion(e),this.setFromRotationMatrix(sx,t,i)}setFromVector3(e,t=this._order){return this.set(e.x,e.y,e.z,t)}reorder(e){return rx.setFromEuler(this),this.setFromQuaternion(rx,e)}equals(e){return e._x===this._x&&e._y===this._y&&e._z===this._z&&e._order===this._order}fromArray(e){return this._x=e[0],this._y=e[1],this._z=e[2],e[3]!==void 0&&(this._order=e[3]),this._onChangeCallback(),this}toArray(e=[],t=0){return e[t]=this._x,e[t+1]=this._y,e[t+2]=this._z,e[t+3]=this._order,e}_onChange(e){return this._onChangeCallback=e,this}_onChangeCallback(){}*[Symbol.iterator](){yield this._x,yield this._y,yield this._z,yield this._order}}Fi.DEFAULT_ORDER="XYZ";class vu{constructor(){this.mask=1}set(e){this.mask=(1<<e|0)>>>0}enable(e){this.mask|=1<<e|0}enableAll(){this.mask=-1}toggle(e){this.mask^=1<<e|0}disable(e){this.mask&=~(1<<e|0)}disableAll(){this.mask=0}test(e){return(this.mask&e.mask)!==0}isEnabled(e){return(this.mask&(1<<e|0))!==0}}let M3=0;const ax=new R,el=new Kt,Ks=new qe,yu=new R,kc=new R,S3=new R,w3=new Kt,ox=new R(1,0,0),lx=new R(0,1,0),cx=new R(0,0,1),hx={type:"added"},E3={type:"removed"},tl={type:"childadded",child:null},Ym={type:"childremoved",child:null};class Rt extends hs{constructor(){super(),this.isObject3D=!0,Object.defineProperty(this,"id",{value:M3++}),this.uuid=kn(),this.name="",this.type="Object3D",this.parent=null,this.children=[],this.up=Rt.DEFAULT_UP.clone();const e=new R,t=new Fi,i=new Kt,n=new R(1,1,1);function r(){i.setFromEuler(t,!1)}function a(){t.setFromQuaternion(i,void 0,!1)}t._onChange(r),i._onChange(a),Object.defineProperties(this,{position:{configurable:!0,enumerable:!0,value:e},rotation:{configurable:!0,enumerable:!0,value:t},quaternion:{configurable:!0,enumerable:!0,value:i},scale:{configurable:!0,enumerable:!0,value:n},modelViewMatrix:{value:new qe},normalMatrix:{value:new pt}}),this.matrix=new qe,this.matrixWorld=new qe,this.matrixAutoUpdate=Rt.DEFAULT_MATRIX_AUTO_UPDATE,this.matrixWorldAutoUpdate=Rt.DEFAULT_MATRIX_WORLD_AUTO_UPDATE,this.matrixWorldNeedsUpdate=!1,this.layers=new vu,this.visible=!0,this.castShadow=!1,this.receiveShadow=!1,this.frustumCulled=!0,this.renderOrder=0,this.animations=[],this.customDepthMaterial=void 0,this.customDistanceMaterial=void 0,this.static=!1,this.userData={},this.pivot=null}onBeforeShadow(){}onAfterShadow(){}onBeforeRender(){}onAfterRender(){}applyMatrix4(e){this.matrixAutoUpdate&&this.updateMatrix(),this.matrix.premultiply(e),this.matrix.decompose(this.position,this.quaternion,this.scale)}applyQuaternion(e){return this.quaternion.premultiply(e),this}setRotationFromAxisAngle(e,t){this.quaternion.setFromAxisAngle(e,t)}setRotationFromEuler(e){this.quaternion.setFromEuler(e,!0)}setRotationFromMatrix(e){this.quaternion.setFromRotationMatrix(e)}setRotationFromQuaternion(e){this.quaternion.copy(e)}rotateOnAxis(e,t){return el.setFromAxisAngle(e,t),this.quaternion.multiply(el),this}rotateOnWorldAxis(e,t){return el.setFromAxisAngle(e,t),this.quaternion.premultiply(el),this}rotateX(e){return this.rotateOnAxis(ox,e)}rotateY(e){return this.rotateOnAxis(lx,e)}rotateZ(e){return this.rotateOnAxis(cx,e)}translateOnAxis(e,t){return ax.copy(e).applyQuaternion(this.quaternion),this.position.add(ax.multiplyScalar(t)),this}translateX(e){return this.translateOnAxis(ox,e)}translateY(e){return this.translateOnAxis(lx,e)}translateZ(e){return this.translateOnAxis(cx,e)}localToWorld(e){return this.updateWorldMatrix(!0,!1),e.applyMatrix4(this.matrixWorld)}worldToLocal(e){return this.updateWorldMatrix(!0,!1),e.applyMatrix4(Ks.copy(this.matrixWorld).invert())}lookAt(e,t,i){e.isVector3?yu.copy(e):yu.set(e,t,i);const n=this.parent;this.updateWorldMatrix(!0,!1),kc.setFromMatrixPosition(this.matrixWorld),this.isCamera||this.isLight?Ks.lookAt(kc,yu,this.up):Ks.lookAt(yu,kc,this.up),this.quaternion.setFromRotationMatrix(Ks),n&&(Ks.extractRotation(n.matrixWorld),el.setFromRotationMatrix(Ks),this.quaternion.premultiply(el.invert()))}add(e){if(arguments.length>1){for(let t=0;t<arguments.length;t++)this.add(arguments[t]);return this}return e===this?(lt("Object3D.add: object can't be added as a child of itself.",e),this):(e&&e.isObject3D?(e.removeFromParent(),e.parent=this,this.children.push(e),e.dispatchEvent(hx),tl.child=e,this.dispatchEvent(tl),tl.child=null):lt("Object3D.add: object not an instance of THREE.Object3D.",e),this)}remove(e){if(arguments.length>1){for(let i=0;i<arguments.length;i++)this.remove(arguments[i]);return this}const t=this.children.indexOf(e);return t!==-1&&(e.parent=null,this.children.splice(t,1),e.dispatchEvent(E3),Ym.child=e,this.dispatchEvent(Ym),Ym.child=null),this}removeFromParent(){const e=this.parent;return e!==null&&e.remove(this),this}clear(){return this.remove(...this.children)}attach(e){return this.updateWorldMatrix(!0,!1),Ks.copy(this.matrixWorld).invert(),e.parent!==null&&(e.parent.updateWorldMatrix(!0,!1),Ks.multiply(e.parent.matrixWorld)),e.applyMatrix4(Ks),e.removeFromParent(),e.parent=this,this.children.push(e),e.updateWorldMatrix(!1,!0),e.dispatchEvent(hx),tl.child=e,this.dispatchEvent(tl),tl.child=null,this}getObjectById(e){return this.getObjectByProperty("id",e)}getObjectByName(e){return this.getObjectByProperty("name",e)}getObjectByProperty(e,t){if(this[e]===t)return this;for(let i=0,n=this.children.length;i<n;i++){const a=this.children[i].getObjectByProperty(e,t);if(a!==void 0)return a}}getObjectsByProperty(e,t,i=[]){this[e]===t&&i.push(this);const n=this.children;for(let r=0,a=n.length;r<a;r++)n[r].getObjectsByProperty(e,t,i);return i}getWorldPosition(e){return this.updateWorldMatrix(!0,!1),e.setFromMatrixPosition(this.matrixWorld)}getWorldQuaternion(e){return this.updateWorldMatrix(!0,!1),this.matrixWorld.decompose(kc,e,S3),e}getWorldScale(e){return this.updateWorldMatrix(!0,!1),this.matrixWorld.decompose(kc,w3,e),e}getWorldDirection(e){this.updateWorldMatrix(!0,!1);const t=this.matrixWorld.elements;return e.set(t[8],t[9],t[10]).normalize()}raycast(){}traverse(e){e(this);const t=this.children;for(let i=0,n=t.length;i<n;i++)t[i].traverse(e)}traverseVisible(e){if(this.visible===!1)return;e(this);const t=this.children;for(let i=0,n=t.length;i<n;i++)t[i].traverseVisible(e)}traverseAncestors(e){const t=this.parent;t!==null&&(e(t),t.traverseAncestors(e))}updateMatrix(){this.matrix.compose(this.position,this.quaternion,this.scale);const e=this.pivot;if(e!==null){const t=e.x,i=e.y,n=e.z,r=this.matrix.elements;r[12]+=t-r[0]*t-r[4]*i-r[8]*n,r[13]+=i-r[1]*t-r[5]*i-r[9]*n,r[14]+=n-r[2]*t-r[6]*i-r[10]*n}this.matrixWorldNeedsUpdate=!0}updateMatrixWorld(e){this.matrixAutoUpdate&&this.updateMatrix(),(this.matrixWorldNeedsUpdate||e)&&(this.matrixWorldAutoUpdate===!0&&(this.parent===null?this.matrixWorld.copy(this.matrix):this.matrixWorld.multiplyMatrices(this.parent.matrixWorld,this.matrix)),this.matrixWorldNeedsUpdate=!1,e=!0);const t=this.children;for(let i=0,n=t.length;i<n;i++)t[i].updateMatrixWorld(e)}updateWorldMatrix(e,t){const i=this.parent;if(e===!0&&i!==null&&i.updateWorldMatrix(!0,!1),this.matrixAutoUpdate&&this.updateMatrix(),this.matrixWorldAutoUpdate===!0&&(this.parent===null?this.matrixWorld.copy(this.matrix):this.matrixWorld.multiplyMatrices(this.parent.matrixWorld,this.matrix)),t===!0){const n=this.children;for(let r=0,a=n.length;r<a;r++)n[r].updateWorldMatrix(!1,!0)}}toJSON(e){const t=e===void 0||typeof e=="string",i={};t&&(e={geometries:{},materials:{},textures:{},images:{},shapes:{},skeletons:{},animations:{},nodes:{}},i.metadata={version:4.7,type:"Object",generator:"Object3D.toJSON"});const n={};n.uuid=this.uuid,n.type=this.type,this.name!==""&&(n.name=this.name),this.castShadow===!0&&(n.castShadow=!0),this.receiveShadow===!0&&(n.receiveShadow=!0),this.visible===!1&&(n.visible=!1),this.frustumCulled===!1&&(n.frustumCulled=!1),this.renderOrder!==0&&(n.renderOrder=this.renderOrder),this.static!==!1&&(n.static=this.static),Object.keys(this.userData).length>0&&(n.userData=this.userData),n.layers=this.layers.mask,n.matrix=this.matrix.toArray(),n.up=this.up.toArray(),this.pivot!==null&&(n.pivot=this.pivot.toArray()),this.matrixAutoUpdate===!1&&(n.matrixAutoUpdate=!1),this.morphTargetDictionary!==void 0&&(n.morphTargetDictionary=Object.assign({},this.morphTargetDictionary)),this.morphTargetInfluences!==void 0&&(n.morphTargetInfluences=this.morphTargetInfluences.slice()),this.isInstancedMesh&&(n.type="InstancedMesh",n.count=this.count,n.instanceMatrix=this.instanceMatrix.toJSON(),this.instanceColor!==null&&(n.instanceColor=this.instanceColor.toJSON())),this.isBatchedMesh&&(n.type="BatchedMesh",n.perObjectFrustumCulled=this.perObjectFrustumCulled,n.sortObjects=this.sortObjects,n.drawRanges=this._drawRanges,n.reservedRanges=this._reservedRanges,n.geometryInfo=this._geometryInfo.map(o=>({...o,boundingBox:o.boundingBox?o.boundingBox.toJSON():void 0,boundingSphere:o.boundingSphere?o.boundingSphere.toJSON():void 0})),n.instanceInfo=this._instanceInfo.map(o=>({...o})),n.availableInstanceIds=this._availableInstanceIds.slice(),n.availableGeometryIds=this._availableGeometryIds.slice(),n.nextIndexStart=this._nextIndexStart,n.nextVertexStart=this._nextVertexStart,n.geometryCount=this._geometryCount,n.maxInstanceCount=this._maxInstanceCount,n.maxVertexCount=this._maxVertexCount,n.maxIndexCount=this._maxIndexCount,n.geometryInitialized=this._geometryInitialized,n.matricesTexture=this._matricesTexture.toJSON(e),n.indirectTexture=this._indirectTexture.toJSON(e),this._colorsTexture!==null&&(n.colorsTexture=this._colorsTexture.toJSON(e)),this.boundingSphere!==null&&(n.boundingSphere=this.boundingSphere.toJSON()),this.boundingBox!==null&&(n.boundingBox=this.boundingBox.toJSON()));function r(o,l){return o[l.uuid]===void 0&&(o[l.uuid]=l.toJSON(e)),l.uuid}if(this.isScene)this.background&&(this.background.isColor?n.background=this.background.toJSON():this.background.isTexture&&(n.background=this.background.toJSON(e).uuid)),this.environment&&this.environment.isTexture&&this.environment.isRenderTargetTexture!==!0&&(n.environment=this.environment.toJSON(e).uuid);else if(this.isMesh||this.isLine||this.isPoints){n.geometry=r(e.geometries,this.geometry);const o=this.geometry.parameters;if(o!==void 0&&o.shapes!==void 0){const l=o.shapes;if(Array.isArray(l))for(let c=0,h=l.length;c<h;c++){const d=l[c];r(e.shapes,d)}else r(e.shapes,l)}}if(this.isSkinnedMesh&&(n.bindMode=this.bindMode,n.bindMatrix=this.bindMatrix.toArray(),this.skeleton!==void 0&&(r(e.skeletons,this.skeleton),n.skeleton=this.skeleton.uuid)),this.material!==void 0)if(Array.isArray(this.material)){const o=[];for(let l=0,c=this.material.length;l<c;l++)o.push(r(e.materials,this.material[l]));n.material=o}else n.material=r(e.materials,this.material);if(this.children.length>0){n.children=[];for(let o=0;o<this.children.length;o++)n.children.push(this.children[o].toJSON(e).object)}if(this.animations.length>0){n.animations=[];for(let o=0;o<this.animations.length;o++){const l=this.animations[o];n.animations.push(r(e.animations,l))}}if(t){const o=a(e.geometries),l=a(e.materials),c=a(e.textures),h=a(e.images),d=a(e.shapes),p=a(e.skeletons),u=a(e.animations),v=a(e.nodes);o.length>0&&(i.geometries=o),l.length>0&&(i.materials=l),c.length>0&&(i.textures=c),h.length>0&&(i.images=h),d.length>0&&(i.shapes=d),p.length>0&&(i.skeletons=p),u.length>0&&(i.animations=u),v.length>0&&(i.nodes=v)}return i.object=n,i;function a(o){const l=[];for(const c in o){const h=o[c];delete h.metadata,l.push(h)}return l}}clone(e){return new this.constructor().copy(this,e)}copy(e,t=!0){if(this.name=e.name,this.up.copy(e.up),this.position.copy(e.position),this.rotation.order=e.rotation.order,this.quaternion.copy(e.quaternion),this.scale.copy(e.scale),e.pivot!==null&&(this.pivot=e.pivot.clone()),this.matrix.copy(e.matrix),this.matrixWorld.copy(e.matrixWorld),this.matrixAutoUpdate=e.matrixAutoUpdate,this.matrixWorldAutoUpdate=e.matrixWorldAutoUpdate,this.matrixWorldNeedsUpdate=e.matrixWorldNeedsUpdate,this.layers.mask=e.layers.mask,this.visible=e.visible,this.castShadow=e.castShadow,this.receiveShadow=e.receiveShadow,this.frustumCulled=e.frustumCulled,this.renderOrder=e.renderOrder,this.static=e.static,this.animations=e.animations.slice(),this.userData=JSON.parse(JSON.stringify(e.userData)),t===!0)for(let i=0;i<e.children.length;i++){const n=e.children[i];this.add(n.clone())}return this}}Rt.DEFAULT_UP=new R(0,1,0),Rt.DEFAULT_MATRIX_AUTO_UPDATE=!0,Rt.DEFAULT_MATRIX_WORLD_AUTO_UPDATE=!0;class pi extends Rt{constructor(){super(),this.isGroup=!0,this.type="Group"}}const T3={type:"move"};class xu{constructor(){this._targetRay=null,this._grip=null,this._hand=null}getHandSpace(){return this._hand===null&&(this._hand=new pi,this._hand.matrixAutoUpdate=!1,this._hand.visible=!1,this._hand.joints={},this._hand.inputState={pinching:!1}),this._hand}getTargetRaySpace(){return this._targetRay===null&&(this._targetRay=new pi,this._targetRay.matrixAutoUpdate=!1,this._targetRay.visible=!1,this._targetRay.hasLinearVelocity=!1,this._targetRay.linearVelocity=new R,this._targetRay.hasAngularVelocity=!1,this._targetRay.angularVelocity=new R),this._targetRay}getGripSpace(){return this._grip===null&&(this._grip=new pi,this._grip.matrixAutoUpdate=!1,this._grip.visible=!1,this._grip.hasLinearVelocity=!1,this._grip.linearVelocity=new R,this._grip.hasAngularVelocity=!1,this._grip.angularVelocity=new R),this._grip}dispatchEvent(e){return this._targetRay!==null&&this._targetRay.dispatchEvent(e),this._grip!==null&&this._grip.dispatchEvent(e),this._hand!==null&&this._hand.dispatchEvent(e),this}connect(e){if(e&&e.hand){const t=this._hand;if(t)for(const i of e.hand.values())this._getHandJoint(t,i)}return this.dispatchEvent({type:"connected",data:e}),this}disconnect(e){return this.dispatchEvent({type:"disconnected",data:e}),this._targetRay!==null&&(this._targetRay.visible=!1),this._grip!==null&&(this._grip.visible=!1),this._hand!==null&&(this._hand.visible=!1),this}update(e,t,i){let n=null,r=null,a=null;const o=this._targetRay,l=this._grip,c=this._hand;if(e&&t.session.visibilityState!=="visible-blurred"){if(c&&e.hand){a=!0;for(const g of e.hand.values()){const m=t.getJointPose(g,i),f=this._getHandJoint(c,g);m!==null&&(f.matrix.fromArray(m.transform.matrix),f.matrix.decompose(f.position,f.rotation,f.scale),f.matrixWorldNeedsUpdate=!0,f.jointRadius=m.radius),f.visible=m!==null}const h=c.joints["index-finger-tip"],d=c.joints["thumb-tip"],p=h.position.distanceTo(d.position),u=.02,v=.005;c.inputState.pinching&&p>u+v?(c.inputState.pinching=!1,this.dispatchEvent({type:"pinchend",handedness:e.handedness,target:this})):!c.inputState.pinching&&p<=u-v&&(c.inputState.pinching=!0,this.dispatchEvent({type:"pinchstart",handedness:e.handedness,target:this}))}else l!==null&&e.gripSpace&&(r=t.getPose(e.gripSpace,i),r!==null&&(l.matrix.fromArray(r.transform.matrix),l.matrix.decompose(l.position,l.rotation,l.scale),l.matrixWorldNeedsUpdate=!0,r.linearVelocity?(l.hasLinearVelocity=!0,l.linearVelocity.copy(r.linearVelocity)):l.hasLinearVelocity=!1,r.angularVelocity?(l.hasAngularVelocity=!0,l.angularVelocity.copy(r.angularVelocity)):l.hasAngularVelocity=!1));o!==null&&(n=t.getPose(e.targetRaySpace,i),n===null&&r!==null&&(n=r),n!==null&&(o.matrix.fromArray(n.transform.matrix),o.matrix.decompose(o.position,o.rotation,o.scale),o.matrixWorldNeedsUpdate=!0,n.linearVelocity?(o.hasLinearVelocity=!0,o.linearVelocity.copy(n.linearVelocity)):o.hasLinearVelocity=!1,n.angularVelocity?(o.hasAngularVelocity=!0,o.angularVelocity.copy(n.angularVelocity)):o.hasAngularVelocity=!1,this.dispatchEvent(T3)))}return o!==null&&(o.visible=n!==null),l!==null&&(l.visible=r!==null),c!==null&&(c.visible=a!==null),this}_getHandJoint(e,t){if(e.joints[t.jointName]===void 0){const i=new pi;i.matrixAutoUpdate=!1,i.visible=!1,e.joints[t.jointName]=i,e.add(i)}return e.joints[t.jointName]}}const dx={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074},Br={h:0,s:0,l:0},_u={h:0,s:0,l:0};function $m(s,e,t){return t<0&&(t+=1),t>1&&(t-=1),t<1/6?s+(e-s)*6*t:t<1/2?e:t<2/3?s+(e-s)*6*(2/3-t):s}class We{constructor(e,t,i){return this.isColor=!0,this.r=1,this.g=1,this.b=1,this.set(e,t,i)}set(e,t,i){if(t===void 0&&i===void 0){const n=e;n&&n.isColor?this.copy(n):typeof n=="number"?this.setHex(n):typeof n=="string"&&this.setStyle(n)}else this.setRGB(e,t,i);return this}setScalar(e){return this.r=e,this.g=e,this.b=e,this}setHex(e,t=li){return e=Math.floor(e),this.r=(e>>16&255)/255,this.g=(e>>8&255)/255,this.b=(e&255)/255,wt.colorSpaceToWorking(this,t),this}setRGB(e,t,i,n=wt.workingColorSpace){return this.r=e,this.g=t,this.b=i,wt.colorSpaceToWorking(this,n),this}setHSL(e,t,i,n=wt.workingColorSpace){if(e=Gm(e,1),t=dt(t,0,1),i=dt(i,0,1),t===0)this.r=this.g=this.b=i;else{const r=i<=.5?i*(1+t):i+t-i*t,a=2*i-r;this.r=$m(a,r,e+1/3),this.g=$m(a,r,e),this.b=$m(a,r,e-1/3)}return wt.colorSpaceToWorking(this,n),this}setStyle(e,t=li){function i(r){r!==void 0&&parseFloat(r)<1&&Ye("Color: Alpha component of "+e+" will be ignored.")}let n;if(n=/^(\w+)\(([^\)]*)\)/.exec(e)){let r;const a=n[1],o=n[2];switch(a){case"rgb":case"rgba":if(r=/^\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(o))return i(r[4]),this.setRGB(Math.min(255,parseInt(r[1],10))/255,Math.min(255,parseInt(r[2],10))/255,Math.min(255,parseInt(r[3],10))/255,t);if(r=/^\s*(\d+)\%\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(o))return i(r[4]),this.setRGB(Math.min(100,parseInt(r[1],10))/100,Math.min(100,parseInt(r[2],10))/100,Math.min(100,parseInt(r[3],10))/100,t);break;case"hsl":case"hsla":if(r=/^\s*(\d*\.?\d+)\s*,\s*(\d*\.?\d+)\%\s*,\s*(\d*\.?\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(o))return i(r[4]),this.setHSL(parseFloat(r[1])/360,parseFloat(r[2])/100,parseFloat(r[3])/100,t);break;default:Ye("Color: Unknown color model "+e)}}else if(n=/^\#([A-Fa-f\d]+)$/.exec(e)){const r=n[1],a=r.length;if(a===3)return this.setRGB(parseInt(r.charAt(0),16)/15,parseInt(r.charAt(1),16)/15,parseInt(r.charAt(2),16)/15,t);if(a===6)return this.setHex(parseInt(r,16),t);Ye("Color: Invalid hex color "+e)}else if(e&&e.length>0)return this.setColorName(e,t);return this}setColorName(e,t=li){const i=dx[e.toLowerCase()];return i!==void 0?this.setHex(i,t):Ye("Color: Unknown color "+e),this}clone(){return new this.constructor(this.r,this.g,this.b)}copy(e){return this.r=e.r,this.g=e.g,this.b=e.b,this}copySRGBToLinear(e){return this.r=$s(e.r),this.g=$s(e.g),this.b=$s(e.b),this}copyLinearToSRGB(e){return this.r=Ko(e.r),this.g=Ko(e.g),this.b=Ko(e.b),this}convertSRGBToLinear(){return this.copySRGBToLinear(this),this}convertLinearToSRGB(){return this.copyLinearToSRGB(this),this}getHex(e=li){return wt.workingToColorSpace(en.copy(this),e),Math.round(dt(en.r*255,0,255))*65536+Math.round(dt(en.g*255,0,255))*256+Math.round(dt(en.b*255,0,255))}getHexString(e=li){return("000000"+this.getHex(e).toString(16)).slice(-6)}getHSL(e,t=wt.workingColorSpace){wt.workingToColorSpace(en.copy(this),t);const i=en.r,n=en.g,r=en.b,a=Math.max(i,n,r),o=Math.min(i,n,r);let l,c;const h=(o+a)/2;if(o===a)l=0,c=0;else{const d=a-o;switch(c=h<=.5?d/(a+o):d/(2-a-o),a){case i:l=(n-r)/d+(n<r?6:0);break;case n:l=(r-i)/d+2;break;case r:l=(i-n)/d+4;break}l/=6}return e.h=l,e.s=c,e.l=h,e}getRGB(e,t=wt.workingColorSpace){return wt.workingToColorSpace(en.copy(this),t),e.r=en.r,e.g=en.g,e.b=en.b,e}getStyle(e=li){wt.workingToColorSpace(en.copy(this),e);const t=en.r,i=en.g,n=en.b;return e!==li?`color(${e} ${t.toFixed(3)} ${i.toFixed(3)} ${n.toFixed(3)})`:`rgb(${Math.round(t*255)},${Math.round(i*255)},${Math.round(n*255)})`}offsetHSL(e,t,i){return this.getHSL(Br),this.setHSL(Br.h+e,Br.s+t,Br.l+i)}add(e){return this.r+=e.r,this.g+=e.g,this.b+=e.b,this}addColors(e,t){return this.r=e.r+t.r,this.g=e.g+t.g,this.b=e.b+t.b,this}addScalar(e){return this.r+=e,this.g+=e,this.b+=e,this}sub(e){return this.r=Math.max(0,this.r-e.r),this.g=Math.max(0,this.g-e.g),this.b=Math.max(0,this.b-e.b),this}multiply(e){return this.r*=e.r,this.g*=e.g,this.b*=e.b,this}multiplyScalar(e){return this.r*=e,this.g*=e,this.b*=e,this}lerp(e,t){return this.r+=(e.r-this.r)*t,this.g+=(e.g-this.g)*t,this.b+=(e.b-this.b)*t,this}lerpColors(e,t,i){return this.r=e.r+(t.r-e.r)*i,this.g=e.g+(t.g-e.g)*i,this.b=e.b+(t.b-e.b)*i,this}lerpHSL(e,t){this.getHSL(Br),e.getHSL(_u);const i=Nc(Br.h,_u.h,t),n=Nc(Br.s,_u.s,t),r=Nc(Br.l,_u.l,t);return this.setHSL(i,n,r),this}setFromVector3(e){return this.r=e.x,this.g=e.y,this.b=e.z,this}applyMatrix3(e){const t=this.r,i=this.g,n=this.b,r=e.elements;return this.r=r[0]*t+r[3]*i+r[6]*n,this.g=r[1]*t+r[4]*i+r[7]*n,this.b=r[2]*t+r[5]*i+r[8]*n,this}equals(e){return e.r===this.r&&e.g===this.g&&e.b===this.b}fromArray(e,t=0){return this.r=e[t],this.g=e[t+1],this.b=e[t+2],this}toArray(e=[],t=0){return e[t]=this.r,e[t+1]=this.g,e[t+2]=this.b,e}fromBufferAttribute(e,t){return this.r=e.getX(t),this.g=e.getY(t),this.b=e.getZ(t),this}toJSON(){return this.getHex()}*[Symbol.iterator](){yield this.r,yield this.g,yield this.b}}const en=new We;We.NAMES=dx;class bu{constructor(e,t=25e-5){this.isFogExp2=!0,this.name="",this.color=new We(e),this.density=t}clone(){return new bu(this.color,this.density)}toJSON(){return{type:"FogExp2",name:this.name,color:this.color.getHex(),density:this.density}}}class Mu{constructor(e,t=1,i=1e3){this.isFog=!0,this.name="",this.color=new We(e),this.near=t,this.far=i}clone(){return new Mu(this.color,this.near,this.far)}toJSON(){return{type:"Fog",name:this.name,color:this.color.getHex(),near:this.near,far:this.far}}}class La extends Rt{constructor(){super(),this.isScene=!0,this.type="Scene",this.background=null,this.environment=null,this.fog=null,this.backgroundBlurriness=0,this.backgroundIntensity=1,this.backgroundRotation=new Fi,this.environmentIntensity=1,this.environmentRotation=new Fi,this.overrideMaterial=null,typeof __THREE_DEVTOOLS__<"u"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}copy(e,t){return super.copy(e,t),e.background!==null&&(this.background=e.background.clone()),e.environment!==null&&(this.environment=e.environment.clone()),e.fog!==null&&(this.fog=e.fog.clone()),this.backgroundBlurriness=e.backgroundBlurriness,this.backgroundIntensity=e.backgroundIntensity,this.backgroundRotation.copy(e.backgroundRotation),this.environmentIntensity=e.environmentIntensity,this.environmentRotation.copy(e.environmentRotation),e.overrideMaterial!==null&&(this.overrideMaterial=e.overrideMaterial.clone()),this.matrixAutoUpdate=e.matrixAutoUpdate,this}toJSON(e){const t=super.toJSON(e);return this.fog!==null&&(t.object.fog=this.fog.toJSON()),this.backgroundBlurriness>0&&(t.object.backgroundBlurriness=this.backgroundBlurriness),this.backgroundIntensity!==1&&(t.object.backgroundIntensity=this.backgroundIntensity),t.object.backgroundRotation=this.backgroundRotation.toArray(),this.environmentIntensity!==1&&(t.object.environmentIntensity=this.environmentIntensity),t.object.environmentRotation=this.environmentRotation.toArray(),t}}const us=new R,Js=new R,Km=new R,Qs=new R,il=new R,nl=new R,ux=new R,Jm=new R,Qm=new R,eg=new R,tg=new Pt,ig=new Pt,ng=new Pt;class Ht{constructor(e=new R,t=new R,i=new R){this.a=e,this.b=t,this.c=i}static getNormal(e,t,i,n){n.subVectors(i,t),us.subVectors(e,t),n.cross(us);const r=n.lengthSq();return r>0?n.multiplyScalar(1/Math.sqrt(r)):n.set(0,0,0)}static getBarycoord(e,t,i,n,r){us.subVectors(n,t),Js.subVectors(i,t),Km.subVectors(e,t);const a=us.dot(us),o=us.dot(Js),l=us.dot(Km),c=Js.dot(Js),h=Js.dot(Km),d=a*c-o*o;if(d===0)return r.set(0,0,0),null;const p=1/d,u=(c*l-o*h)*p,v=(a*h-o*l)*p;return r.set(1-u-v,v,u)}static containsPoint(e,t,i,n){return this.getBarycoord(e,t,i,n,Qs)===null?!1:Qs.x>=0&&Qs.y>=0&&Qs.x+Qs.y<=1}static getInterpolation(e,t,i,n,r,a,o,l){return this.getBarycoord(e,t,i,n,Qs)===null?(l.x=0,l.y=0,"z"in l&&(l.z=0),"w"in l&&(l.w=0),null):(l.setScalar(0),l.addScaledVector(r,Qs.x),l.addScaledVector(a,Qs.y),l.addScaledVector(o,Qs.z),l)}static getInterpolatedAttribute(e,t,i,n,r,a){return tg.setScalar(0),ig.setScalar(0),ng.setScalar(0),tg.fromBufferAttribute(e,t),ig.fromBufferAttribute(e,i),ng.fromBufferAttribute(e,n),a.setScalar(0),a.addScaledVector(tg,r.x),a.addScaledVector(ig,r.y),a.addScaledVector(ng,r.z),a}static isFrontFacing(e,t,i,n){return us.subVectors(i,t),Js.subVectors(e,t),us.cross(Js).dot(n)<0}set(e,t,i){return this.a.copy(e),this.b.copy(t),this.c.copy(i),this}setFromPointsAndIndices(e,t,i,n){return this.a.copy(e[t]),this.b.copy(e[i]),this.c.copy(e[n]),this}setFromAttributeAndIndices(e,t,i,n){return this.a.fromBufferAttribute(e,t),this.b.fromBufferAttribute(e,i),this.c.fromBufferAttribute(e,n),this}clone(){return new this.constructor().copy(this)}copy(e){return this.a.copy(e.a),this.b.copy(e.b),this.c.copy(e.c),this}getArea(){return us.subVectors(this.c,this.b),Js.subVectors(this.a,this.b),us.cross(Js).length()*.5}getMidpoint(e){return e.addVectors(this.a,this.b).add(this.c).multiplyScalar(1/3)}getNormal(e){return Ht.getNormal(this.a,this.b,this.c,e)}getPlane(e){return e.setFromCoplanarPoints(this.a,this.b,this.c)}getBarycoord(e,t){return Ht.getBarycoord(e,this.a,this.b,this.c,t)}getInterpolation(e,t,i,n,r){return Ht.getInterpolation(e,this.a,this.b,this.c,t,i,n,r)}containsPoint(e){return Ht.containsPoint(e,this.a,this.b,this.c)}isFrontFacing(e){return Ht.isFrontFacing(this.a,this.b,this.c,e)}intersectsBox(e){return e.intersectsTriangle(this)}closestPointToPoint(e,t){const i=this.a,n=this.b,r=this.c;let a,o;il.subVectors(n,i),nl.subVectors(r,i),Jm.subVectors(e,i);const l=il.dot(Jm),c=nl.dot(Jm);if(l<=0&&c<=0)return t.copy(i);Qm.subVectors(e,n);const h=il.dot(Qm),d=nl.dot(Qm);if(h>=0&&d<=h)return t.copy(n);const p=l*d-h*c;if(p<=0&&l>=0&&h<=0)return a=l/(l-h),t.copy(i).addScaledVector(il,a);eg.subVectors(e,r);const u=il.dot(eg),v=nl.dot(eg);if(v>=0&&u<=v)return t.copy(r);const g=u*c-l*v;if(g<=0&&c>=0&&v<=0)return o=c/(c-v),t.copy(i).addScaledVector(nl,o);const m=h*v-u*d;if(m<=0&&d-h>=0&&u-v>=0)return ux.subVectors(r,n),o=(d-h)/(d-h+(u-v)),t.copy(n).addScaledVector(ux,o);const f=1/(m+g+p);return a=g*f,o=p*f,t.copy(i).addScaledVector(il,a).addScaledVector(nl,o)}equals(e){return e.a.equals(this.a)&&e.b.equals(this.b)&&e.c.equals(this.c)}}class gt{constructor(e=new R(1/0,1/0,1/0),t=new R(-1/0,-1/0,-1/0)){this.isBox3=!0,this.min=e,this.max=t}set(e,t){return this.min.copy(e),this.max.copy(t),this}setFromArray(e){this.makeEmpty();for(let t=0,i=e.length;t<i;t+=3)this.expandByPoint(ps.fromArray(e,t));return this}setFromBufferAttribute(e){this.makeEmpty();for(let t=0,i=e.count;t<i;t++)this.expandByPoint(ps.fromBufferAttribute(e,t));return this}setFromPoints(e){this.makeEmpty();for(let t=0,i=e.length;t<i;t++)this.expandByPoint(e[t]);return this}setFromCenterAndSize(e,t){const i=ps.copy(t).multiplyScalar(.5);return this.min.copy(e).sub(i),this.max.copy(e).add(i),this}setFromObject(e,t=!1){return this.makeEmpty(),this.expandByObject(e,t)}clone(){return new this.constructor().copy(this)}copy(e){return this.min.copy(e.min),this.max.copy(e.max),this}makeEmpty(){return this.min.x=this.min.y=this.min.z=1/0,this.max.x=this.max.y=this.max.z=-1/0,this}isEmpty(){return this.max.x<this.min.x||this.max.y<this.min.y||this.max.z<this.min.z}getCenter(e){return this.isEmpty()?e.set(0,0,0):e.addVectors(this.min,this.max).multiplyScalar(.5)}getSize(e){return this.isEmpty()?e.set(0,0,0):e.subVectors(this.max,this.min)}expandByPoint(e){return this.min.min(e),this.max.max(e),this}expandByVector(e){return this.min.sub(e),this.max.add(e),this}expandByScalar(e){return this.min.addScalar(-e),this.max.addScalar(e),this}expandByObject(e,t=!1){e.updateWorldMatrix(!1,!1);const i=e.geometry;if(i!==void 0){const r=i.getAttribute("position");if(t===!0&&r!==void 0&&e.isInstancedMesh!==!0)for(let a=0,o=r.count;a<o;a++)e.isMesh===!0?e.getVertexPosition(a,ps):ps.fromBufferAttribute(r,a),ps.applyMatrix4(e.matrixWorld),this.expandByPoint(ps);else e.boundingBox!==void 0?(e.boundingBox===null&&e.computeBoundingBox(),Su.copy(e.boundingBox)):(i.boundingBox===null&&i.computeBoundingBox(),Su.copy(i.boundingBox)),Su.applyMatrix4(e.matrixWorld),this.union(Su)}const n=e.children;for(let r=0,a=n.length;r<a;r++)this.expandByObject(n[r],t);return this}containsPoint(e){return e.x>=this.min.x&&e.x<=this.max.x&&e.y>=this.min.y&&e.y<=this.max.y&&e.z>=this.min.z&&e.z<=this.max.z}containsBox(e){return this.min.x<=e.min.x&&e.max.x<=this.max.x&&this.min.y<=e.min.y&&e.max.y<=this.max.y&&this.min.z<=e.min.z&&e.max.z<=this.max.z}getParameter(e,t){return t.set((e.x-this.min.x)/(this.max.x-this.min.x),(e.y-this.min.y)/(this.max.y-this.min.y),(e.z-this.min.z)/(this.max.z-this.min.z))}intersectsBox(e){return e.max.x>=this.min.x&&e.min.x<=this.max.x&&e.max.y>=this.min.y&&e.min.y<=this.max.y&&e.max.z>=this.min.z&&e.min.z<=this.max.z}intersectsSphere(e){return this.clampPoint(e.center,ps),ps.distanceToSquared(e.center)<=e.radius*e.radius}intersectsPlane(e){let t,i;return e.normal.x>0?(t=e.normal.x*this.min.x,i=e.normal.x*this.max.x):(t=e.normal.x*this.max.x,i=e.normal.x*this.min.x),e.normal.y>0?(t+=e.normal.y*this.min.y,i+=e.normal.y*this.max.y):(t+=e.normal.y*this.max.y,i+=e.normal.y*this.min.y),e.normal.z>0?(t+=e.normal.z*this.min.z,i+=e.normal.z*this.max.z):(t+=e.normal.z*this.max.z,i+=e.normal.z*this.min.z),t<=-e.constant&&i>=-e.constant}intersectsTriangle(e){if(this.isEmpty())return!1;this.getCenter(Oc),wu.subVectors(this.max,Oc),sl.subVectors(e.a,Oc),rl.subVectors(e.b,Oc),al.subVectors(e.c,Oc),Fr.subVectors(rl,sl),zr.subVectors(al,rl),Ia.subVectors(sl,al);let t=[0,-Fr.z,Fr.y,0,-zr.z,zr.y,0,-Ia.z,Ia.y,Fr.z,0,-Fr.x,zr.z,0,-zr.x,Ia.z,0,-Ia.x,-Fr.y,Fr.x,0,-zr.y,zr.x,0,-Ia.y,Ia.x,0];return!sg(t,sl,rl,al,wu)||(t=[1,0,0,0,1,0,0,0,1],!sg(t,sl,rl,al,wu))?!1:(Eu.crossVectors(Fr,zr),t=[Eu.x,Eu.y,Eu.z],sg(t,sl,rl,al,wu))}clampPoint(e,t){return t.copy(e).clamp(this.min,this.max)}distanceToPoint(e){return this.clampPoint(e,ps).distanceTo(e)}getBoundingSphere(e){return this.isEmpty()?e.makeEmpty():(this.getCenter(e.center),e.radius=this.getSize(ps).length()*.5),e}intersect(e){return this.min.max(e.min),this.max.min(e.max),this.isEmpty()&&this.makeEmpty(),this}union(e){return this.min.min(e.min),this.max.max(e.max),this}applyMatrix4(e){return this.isEmpty()?this:(er[0].set(this.min.x,this.min.y,this.min.z).applyMatrix4(e),er[1].set(this.min.x,this.min.y,this.max.z).applyMatrix4(e),er[2].set(this.min.x,this.max.y,this.min.z).applyMatrix4(e),er[3].set(this.min.x,this.max.y,this.max.z).applyMatrix4(e),er[4].set(this.max.x,this.min.y,this.min.z).applyMatrix4(e),er[5].set(this.max.x,this.min.y,this.max.z).applyMatrix4(e),er[6].set(this.max.x,this.max.y,this.min.z).applyMatrix4(e),er[7].set(this.max.x,this.max.y,this.max.z).applyMatrix4(e),this.setFromPoints(er),this)}translate(e){return this.min.add(e),this.max.add(e),this}equals(e){return e.min.equals(this.min)&&e.max.equals(this.max)}toJSON(){return{min:this.min.toArray(),max:this.max.toArray()}}fromJSON(e){return this.min.fromArray(e.min),this.max.fromArray(e.max),this}}const er=[new R,new R,new R,new R,new R,new R,new R,new R],ps=new R,Su=new gt,sl=new R,rl=new R,al=new R,Fr=new R,zr=new R,Ia=new R,Oc=new R,wu=new R,Eu=new R,Da=new R;function sg(s,e,t,i,n){for(let r=0,a=s.length-3;r<=a;r+=3){Da.fromArray(s,r);const o=n.x*Math.abs(Da.x)+n.y*Math.abs(Da.y)+n.z*Math.abs(Da.z),l=e.dot(Da),c=t.dot(Da),h=i.dot(Da);if(Math.max(-Math.max(l,c,h),Math.min(l,c,h))>o)return!1}return!0}const tr=C3();function C3(){const s=new ArrayBuffer(4),e=new Float32Array(s),t=new Uint32Array(s),i=new Uint32Array(512),n=new Uint32Array(512);for(let l=0;l<256;++l){const c=l-127;c<-27?(i[l]=0,i[l|256]=32768,n[l]=24,n[l|256]=24):c<-14?(i[l]=1024>>-c-14,i[l|256]=1024>>-c-14|32768,n[l]=-c-1,n[l|256]=-c-1):c<=15?(i[l]=c+15<<10,i[l|256]=c+15<<10|32768,n[l]=13,n[l|256]=13):c<128?(i[l]=31744,i[l|256]=64512,n[l]=24,n[l|256]=24):(i[l]=31744,i[l|256]=64512,n[l]=13,n[l|256]=13)}const r=new Uint32Array(2048),a=new Uint32Array(64),o=new Uint32Array(64);for(let l=1;l<1024;++l){let c=l<<13,h=0;for(;(c&8388608)===0;)c<<=1,h-=8388608;c&=-8388609,h+=947912704,r[l]=c|h}for(let l=1024;l<2048;++l)r[l]=939524096+(l-1024<<13);for(let l=1;l<31;++l)a[l]=l<<23;a[31]=1199570944,a[32]=2147483648;for(let l=33;l<63;++l)a[l]=2147483648+(l-32<<23);a[63]=3347054592;for(let l=1;l<64;++l)l!==32&&(o[l]=1024);return{floatView:e,uint32View:t,baseTable:i,shiftTable:n,mantissaTable:r,exponentTable:a,offsetTable:o}}function Mn(s){Math.abs(s)>65504&&Ye("DataUtils.toHalfFloat(): Value out of range."),s=dt(s,-65504,65504),tr.floatView[0]=s;const e=tr.uint32View[0],t=e>>23&511;return tr.baseTable[t]+((e&8388607)>>tr.shiftTable[t])}function Uc(s){const e=s>>10;return tr.uint32View[0]=tr.mantissaTable[tr.offsetTable[e]+(s&1023)]+tr.exponentTable[e],tr.floatView[0]}class Bc{static toHalfFloat(e){return Mn(e)}static fromHalfFloat(e){return Uc(e)}}const Mi=new R,Tu=new me;let A3=0;class Mt{constructor(e,t,i=!1){if(Array.isArray(e))throw new TypeError("THREE.BufferAttribute: array should be a Typed Array.");this.isBufferAttribute=!0,Object.defineProperty(this,"id",{value:A3++}),this.name="",this.array=e,this.itemSize=t,this.count=e!==void 0?e.length/t:0,this.normalized=i,this.usage=Rc,this.updateRanges=[],this.gpuType=Pi,this.version=0}onUploadCallback(){}set needsUpdate(e){e===!0&&this.version++}setUsage(e){return this.usage=e,this}addUpdateRange(e,t){this.updateRanges.push({start:e,count:t})}clearUpdateRanges(){this.updateRanges.length=0}copy(e){return this.name=e.name,this.array=new e.array.constructor(e.array),this.itemSize=e.itemSize,this.count=e.count,this.normalized=e.normalized,this.usage=e.usage,this.gpuType=e.gpuType,this}copyAt(e,t,i){e*=this.itemSize,i*=t.itemSize;for(let n=0,r=this.itemSize;n<r;n++)this.array[e+n]=t.array[i+n];return this}copyArray(e){return this.array.set(e),this}applyMatrix3(e){if(this.itemSize===2)for(let t=0,i=this.count;t<i;t++)Tu.fromBufferAttribute(this,t),Tu.applyMatrix3(e),this.setXY(t,Tu.x,Tu.y);else if(this.itemSize===3)for(let t=0,i=this.count;t<i;t++)Mi.fromBufferAttribute(this,t),Mi.applyMatrix3(e),this.setXYZ(t,Mi.x,Mi.y,Mi.z);return this}applyMatrix4(e){for(let t=0,i=this.count;t<i;t++)Mi.fromBufferAttribute(this,t),Mi.applyMatrix4(e),this.setXYZ(t,Mi.x,Mi.y,Mi.z);return this}applyNormalMatrix(e){for(let t=0,i=this.count;t<i;t++)Mi.fromBufferAttribute(this,t),Mi.applyNormalMatrix(e),this.setXYZ(t,Mi.x,Mi.y,Mi.z);return this}transformDirection(e){for(let t=0,i=this.count;t<i;t++)Mi.fromBufferAttribute(this,t),Mi.transformDirection(e),this.setXYZ(t,Mi.x,Mi.y,Mi.z);return this}set(e,t=0){return this.array.set(e,t),this}getComponent(e,t){let i=this.array[e*this.itemSize+t];return this.normalized&&(i=dn(i,this.array)),i}setComponent(e,t,i){return this.normalized&&(i=mt(i,this.array)),this.array[e*this.itemSize+t]=i,this}getX(e){let t=this.array[e*this.itemSize];return this.normalized&&(t=dn(t,this.array)),t}setX(e,t){return this.normalized&&(t=mt(t,this.array)),this.array[e*this.itemSize]=t,this}getY(e){let t=this.array[e*this.itemSize+1];return this.normalized&&(t=dn(t,this.array)),t}setY(e,t){return this.normalized&&(t=mt(t,this.array)),this.array[e*this.itemSize+1]=t,this}getZ(e){let t=this.array[e*this.itemSize+2];return this.normalized&&(t=dn(t,this.array)),t}setZ(e,t){return this.normalized&&(t=mt(t,this.array)),this.array[e*this.itemSize+2]=t,this}getW(e){let t=this.array[e*this.itemSize+3];return this.normalized&&(t=dn(t,this.array)),t}setW(e,t){return this.normalized&&(t=mt(t,this.array)),this.array[e*this.itemSize+3]=t,this}setXY(e,t,i){return e*=this.itemSize,this.normalized&&(t=mt(t,this.array),i=mt(i,this.array)),this.array[e+0]=t,this.array[e+1]=i,this}setXYZ(e,t,i,n){return e*=this.itemSize,this.normalized&&(t=mt(t,this.array),i=mt(i,this.array),n=mt(n,this.array)),this.array[e+0]=t,this.array[e+1]=i,this.array[e+2]=n,this}setXYZW(e,t,i,n,r){return e*=this.itemSize,this.normalized&&(t=mt(t,this.array),i=mt(i,this.array),n=mt(n,this.array),r=mt(r,this.array)),this.array[e+0]=t,this.array[e+1]=i,this.array[e+2]=n,this.array[e+3]=r,this}onUpload(e){return this.onUploadCallback=e,this}clone(){return new this.constructor(this.array,this.itemSize).copy(this)}toJSON(){const e={itemSize:this.itemSize,type:this.array.constructor.name,array:Array.from(this.array),normalized:this.normalized};return this.name!==""&&(e.name=this.name),this.usage!==Rc&&(e.usage=this.usage),e}}class P3 extends Mt{constructor(e,t,i){super(new Int8Array(e),t,i)}}class R3 extends Mt{constructor(e,t,i){super(new Uint8Array(e),t,i)}}class L3 extends Mt{constructor(e,t,i){super(new Uint8ClampedArray(e),t,i)}}class I3 extends Mt{constructor(e,t,i){super(new Int16Array(e),t,i)}}class rg extends Mt{constructor(e,t,i){super(new Uint16Array(e),t,i)}}class D3 extends Mt{constructor(e,t,i){super(new Int32Array(e),t,i)}}class ag extends Mt{constructor(e,t,i){super(new Uint32Array(e),t,i)}}class N3 extends Mt{constructor(e,t,i){super(new Uint16Array(e),t,i),this.isFloat16BufferAttribute=!0}getX(e){let t=Uc(this.array[e*this.itemSize]);return this.normalized&&(t=dn(t,this.array)),t}setX(e,t){return this.normalized&&(t=mt(t,this.array)),this.array[e*this.itemSize]=Mn(t),this}getY(e){let t=Uc(this.array[e*this.itemSize+1]);return this.normalized&&(t=dn(t,this.array)),t}setY(e,t){return this.normalized&&(t=mt(t,this.array)),this.array[e*this.itemSize+1]=Mn(t),this}getZ(e){let t=Uc(this.array[e*this.itemSize+2]);return this.normalized&&(t=dn(t,this.array)),t}setZ(e,t){return this.normalized&&(t=mt(t,this.array)),this.array[e*this.itemSize+2]=Mn(t),this}getW(e){let t=Uc(this.array[e*this.itemSize+3]);return this.normalized&&(t=dn(t,this.array)),t}setW(e,t){return this.normalized&&(t=mt(t,this.array)),this.array[e*this.itemSize+3]=Mn(t),this}setXY(e,t,i){return e*=this.itemSize,this.normalized&&(t=mt(t,this.array),i=mt(i,this.array)),this.array[e+0]=Mn(t),this.array[e+1]=Mn(i),this}setXYZ(e,t,i,n){return e*=this.itemSize,this.normalized&&(t=mt(t,this.array),i=mt(i,this.array),n=mt(n,this.array)),this.array[e+0]=Mn(t),this.array[e+1]=Mn(i),this.array[e+2]=Mn(n),this}setXYZW(e,t,i,n,r){return e*=this.itemSize,this.normalized&&(t=mt(t,this.array),i=mt(i,this.array),n=mt(n,this.array),r=mt(r,this.array)),this.array[e+0]=Mn(t),this.array[e+1]=Mn(i),this.array[e+2]=Mn(n),this.array[e+3]=Mn(r),this}}class et extends Mt{constructor(e,t,i){super(new Float32Array(e),t,i)}}const k3=new gt,Fc=new R,og=new R;class zi{constructor(e=new R,t=-1){this.isSphere=!0,this.center=e,this.radius=t}set(e,t){return this.center.copy(e),this.radius=t,this}setFromPoints(e,t){const i=this.center;t!==void 0?i.copy(t):k3.setFromPoints(e).getCenter(i);let n=0;for(let r=0,a=e.length;r<a;r++)n=Math.max(n,i.distanceToSquared(e[r]));return this.radius=Math.sqrt(n),this}copy(e){return this.center.copy(e.center),this.radius=e.radius,this}isEmpty(){return this.radius<0}makeEmpty(){return this.center.set(0,0,0),this.radius=-1,this}containsPoint(e){return e.distanceToSquared(this.center)<=this.radius*this.radius}distanceToPoint(e){return e.distanceTo(this.center)-this.radius}intersectsSphere(e){const t=this.radius+e.radius;return e.center.distanceToSquared(this.center)<=t*t}intersectsBox(e){return e.intersectsSphere(this)}intersectsPlane(e){return Math.abs(e.distanceToPoint(this.center))<=this.radius}clampPoint(e,t){const i=this.center.distanceToSquared(e);return t.copy(e),i>this.radius*this.radius&&(t.sub(this.center).normalize(),t.multiplyScalar(this.radius).add(this.center)),t}getBoundingBox(e){return this.isEmpty()?(e.makeEmpty(),e):(e.set(this.center,this.center),e.expandByScalar(this.radius),e)}applyMatrix4(e){return this.center.applyMatrix4(e),this.radius=this.radius*e.getMaxScaleOnAxis(),this}translate(e){return this.center.add(e),this}expandByPoint(e){if(this.isEmpty())return this.center.copy(e),this.radius=0,this;Fc.subVectors(e,this.center);const t=Fc.lengthSq();if(t>this.radius*this.radius){const i=Math.sqrt(t),n=(i-this.radius)*.5;this.center.addScaledVector(Fc,n/i),this.radius+=n}return this}union(e){return e.isEmpty()?this:this.isEmpty()?(this.copy(e),this):(this.center.equals(e.center)===!0?this.radius=Math.max(this.radius,e.radius):(og.subVectors(e.center,this.center).setLength(e.radius),this.expandByPoint(Fc.copy(e.center).add(og)),this.expandByPoint(Fc.copy(e.center).sub(og))),this)}equals(e){return e.center.equals(this.center)&&e.radius===this.radius}clone(){return new this.constructor().copy(this)}toJSON(){return{radius:this.radius,center:this.center.toArray()}}fromJSON(e){return this.radius=e.radius,this.center.fromArray(e.center),this}}let O3=0;const Yn=new qe,lg=new Rt,ol=new R,Un=new gt,zc=new gt,Hi=new R;class at extends hs{constructor(){super(),this.isBufferGeometry=!0,Object.defineProperty(this,"id",{value:O3++}),this.uuid=kn(),this.name="",this.type="BufferGeometry",this.index=null,this.indirect=null,this.indirectOffset=0,this.attributes={},this.morphAttributes={},this.morphTargetsRelative=!1,this.groups=[],this.boundingBox=null,this.boundingSphere=null,this.drawRange={start:0,count:1/0},this.userData={}}getIndex(){return this.index}setIndex(e){return Array.isArray(e)?this.index=new(qE(e)?ag:rg)(e,1):this.index=e,this}setIndirect(e,t=0){return this.indirect=e,this.indirectOffset=t,this}getIndirect(){return this.indirect}getAttribute(e){return this.attributes[e]}setAttribute(e,t){return this.attributes[e]=t,this}deleteAttribute(e){return delete this.attributes[e],this}hasAttribute(e){return this.attributes[e]!==void 0}addGroup(e,t,i=0){this.groups.push({start:e,count:t,materialIndex:i})}clearGroups(){this.groups=[]}setDrawRange(e,t){this.drawRange.start=e,this.drawRange.count=t}applyMatrix4(e){const t=this.attributes.position;t!==void 0&&(t.applyMatrix4(e),t.needsUpdate=!0);const i=this.attributes.normal;if(i!==void 0){const r=new pt().getNormalMatrix(e);i.applyNormalMatrix(r),i.needsUpdate=!0}const n=this.attributes.tangent;return n!==void 0&&(n.transformDirection(e),n.needsUpdate=!0),this.boundingBox!==null&&this.computeBoundingBox(),this.boundingSphere!==null&&this.computeBoundingSphere(),this}applyQuaternion(e){return Yn.makeRotationFromQuaternion(e),this.applyMatrix4(Yn),this}rotateX(e){return Yn.makeRotationX(e),this.applyMatrix4(Yn),this}rotateY(e){return Yn.makeRotationY(e),this.applyMatrix4(Yn),this}rotateZ(e){return Yn.makeRotationZ(e),this.applyMatrix4(Yn),this}translate(e,t,i){return Yn.makeTranslation(e,t,i),this.applyMatrix4(Yn),this}scale(e,t,i){return Yn.makeScale(e,t,i),this.applyMatrix4(Yn),this}lookAt(e){return lg.lookAt(e),lg.updateMatrix(),this.applyMatrix4(lg.matrix),this}center(){return this.computeBoundingBox(),this.boundingBox.getCenter(ol).negate(),this.translate(ol.x,ol.y,ol.z),this}setFromPoints(e){const t=this.getAttribute("position");if(t===void 0){const i=[];for(let n=0,r=e.length;n<r;n++){const a=e[n];i.push(a.x,a.y,a.z||0)}this.setAttribute("position",new et(i,3))}else{const i=Math.min(e.length,t.count);for(let n=0;n<i;n++){const r=e[n];t.setXYZ(n,r.x,r.y,r.z||0)}e.length>t.count&&Ye("BufferGeometry: Buffer size too small for points data. Use .dispose() and create a new geometry."),t.needsUpdate=!0}return this}computeBoundingBox(){this.boundingBox===null&&(this.boundingBox=new gt);const e=this.attributes.position,t=this.morphAttributes.position;if(e&&e.isGLBufferAttribute){lt("BufferGeometry.computeBoundingBox(): GLBufferAttribute requires a manual bounding box.",this),this.boundingBox.set(new R(-1/0,-1/0,-1/0),new R(1/0,1/0,1/0));return}if(e!==void 0){if(this.boundingBox.setFromBufferAttribute(e),t)for(let i=0,n=t.length;i<n;i++){const r=t[i];Un.setFromBufferAttribute(r),this.morphTargetsRelative?(Hi.addVectors(this.boundingBox.min,Un.min),this.boundingBox.expandByPoint(Hi),Hi.addVectors(this.boundingBox.max,Un.max),this.boundingBox.expandByPoint(Hi)):(this.boundingBox.expandByPoint(Un.min),this.boundingBox.expandByPoint(Un.max))}}else this.boundingBox.makeEmpty();(isNaN(this.boundingBox.min.x)||isNaN(this.boundingBox.min.y)||isNaN(this.boundingBox.min.z))&&lt('BufferGeometry.computeBoundingBox(): Computed min/max have NaN values. The "position" attribute is likely to have NaN values.',this)}computeBoundingSphere(){this.boundingSphere===null&&(this.boundingSphere=new zi);const e=this.attributes.position,t=this.morphAttributes.position;if(e&&e.isGLBufferAttribute){lt("BufferGeometry.computeBoundingSphere(): GLBufferAttribute requires a manual bounding sphere.",this),this.boundingSphere.set(new R,1/0);return}if(e){const i=this.boundingSphere.center;if(Un.setFromBufferAttribute(e),t)for(let r=0,a=t.length;r<a;r++){const o=t[r];zc.setFromBufferAttribute(o),this.morphTargetsRelative?(Hi.addVectors(Un.min,zc.min),Un.expandByPoint(Hi),Hi.addVectors(Un.max,zc.max),Un.expandByPoint(Hi)):(Un.expandByPoint(zc.min),Un.expandByPoint(zc.max))}Un.getCenter(i);let n=0;for(let r=0,a=e.count;r<a;r++)Hi.fromBufferAttribute(e,r),n=Math.max(n,i.distanceToSquared(Hi));if(t)for(let r=0,a=t.length;r<a;r++){const o=t[r],l=this.morphTargetsRelative;for(let c=0,h=o.count;c<h;c++)Hi.fromBufferAttribute(o,c),l&&(ol.fromBufferAttribute(e,c),Hi.add(ol)),n=Math.max(n,i.distanceToSquared(Hi))}this.boundingSphere.radius=Math.sqrt(n),isNaN(this.boundingSphere.radius)&&lt('BufferGeometry.computeBoundingSphere(): Computed radius is NaN. The "position" attribute is likely to have NaN values.',this)}}computeTangents(){const e=this.index,t=this.attributes;if(e===null||t.position===void 0||t.normal===void 0||t.uv===void 0){lt("BufferGeometry: .computeTangents() failed. Missing required attributes (index, position, normal or uv)");return}const i=t.position,n=t.normal,r=t.uv;this.hasAttribute("tangent")===!1&&this.setAttribute("tangent",new Mt(new Float32Array(4*i.count),4));const a=this.getAttribute("tangent"),o=[],l=[];for(let w=0;w<i.count;w++)o[w]=new R,l[w]=new R;const c=new R,h=new R,d=new R,p=new me,u=new me,v=new me,g=new R,m=new R;function f(w,M,C){c.fromBufferAttribute(i,w),h.fromBufferAttribute(i,M),d.fromBufferAttribute(i,C),p.fromBufferAttribute(r,w),u.fromBufferAttribute(r,M),v.fromBufferAttribute(r,C),h.sub(c),d.sub(c),u.sub(p),v.sub(p);const L=1/(u.x*v.y-v.x*u.y);isFinite(L)&&(g.copy(h).multiplyScalar(v.y).addScaledVector(d,-u.y).multiplyScalar(L),m.copy(d).multiplyScalar(u.x).addScaledVector(h,-v.x).multiplyScalar(L),o[w].add(g),o[M].add(g),o[C].add(g),l[w].add(m),l[M].add(m),l[C].add(m))}let y=this.groups;y.length===0&&(y=[{start:0,count:e.count}]);for(let w=0,M=y.length;w<M;++w){const C=y[w],L=C.start,P=C.count;for(let k=L,A=L+P;k<A;k+=3)f(e.getX(k+0),e.getX(k+1),e.getX(k+2))}const x=new R,_=new R,S=new R,b=new R;function E(w){S.fromBufferAttribute(n,w),b.copy(S);const M=o[w];x.copy(M),x.sub(S.multiplyScalar(S.dot(M))).normalize(),_.crossVectors(b,M);const L=_.dot(l[w])<0?-1:1;a.setXYZW(w,x.x,x.y,x.z,L)}for(let w=0,M=y.length;w<M;++w){const C=y[w],L=C.start,P=C.count;for(let k=L,A=L+P;k<A;k+=3)E(e.getX(k+0)),E(e.getX(k+1)),E(e.getX(k+2))}}computeVertexNormals(){const e=this.index,t=this.getAttribute("position");if(t!==void 0){let i=this.getAttribute("normal");if(i===void 0)i=new Mt(new Float32Array(t.count*3),3),this.setAttribute("normal",i);else for(let p=0,u=i.count;p<u;p++)i.setXYZ(p,0,0,0);const n=new R,r=new R,a=new R,o=new R,l=new R,c=new R,h=new R,d=new R;if(e)for(let p=0,u=e.count;p<u;p+=3){const v=e.getX(p+0),g=e.getX(p+1),m=e.getX(p+2);n.fromBufferAttribute(t,v),r.fromBufferAttribute(t,g),a.fromBufferAttribute(t,m),h.subVectors(a,r),d.subVectors(n,r),h.cross(d),o.fromBufferAttribute(i,v),l.fromBufferAttribute(i,g),c.fromBufferAttribute(i,m),o.add(h),l.add(h),c.add(h),i.setXYZ(v,o.x,o.y,o.z),i.setXYZ(g,l.x,l.y,l.z),i.setXYZ(m,c.x,c.y,c.z)}else for(let p=0,u=t.count;p<u;p+=3)n.fromBufferAttribute(t,p+0),r.fromBufferAttribute(t,p+1),a.fromBufferAttribute(t,p+2),h.subVectors(a,r),d.subVectors(n,r),h.cross(d),i.setXYZ(p+0,h.x,h.y,h.z),i.setXYZ(p+1,h.x,h.y,h.z),i.setXYZ(p+2,h.x,h.y,h.z);this.normalizeNormals(),i.needsUpdate=!0}}normalizeNormals(){const e=this.attributes.normal;for(let t=0,i=e.count;t<i;t++)Hi.fromBufferAttribute(e,t),Hi.normalize(),e.setXYZ(t,Hi.x,Hi.y,Hi.z)}toNonIndexed(){function e(o,l){const c=o.array,h=o.itemSize,d=o.normalized,p=new c.constructor(l.length*h);let u=0,v=0;for(let g=0,m=l.length;g<m;g++){o.isInterleavedBufferAttribute?u=l[g]*o.data.stride+o.offset:u=l[g]*h;for(let f=0;f<h;f++)p[v++]=c[u++]}return new Mt(p,h,d)}if(this.index===null)return Ye("BufferGeometry.toNonIndexed(): BufferGeometry is already non-indexed."),this;const t=new at,i=this.index.array,n=this.attributes;for(const o in n){const l=n[o],c=e(l,i);t.setAttribute(o,c)}const r=this.morphAttributes;for(const o in r){const l=[],c=r[o];for(let h=0,d=c.length;h<d;h++){const p=c[h],u=e(p,i);l.push(u)}t.morphAttributes[o]=l}t.morphTargetsRelative=this.morphTargetsRelative;const a=this.groups;for(let o=0,l=a.length;o<l;o++){const c=a[o];t.addGroup(c.start,c.count,c.materialIndex)}return t}toJSON(){const e={metadata:{version:4.7,type:"BufferGeometry",generator:"BufferGeometry.toJSON"}};if(e.uuid=this.uuid,e.type=this.type,this.name!==""&&(e.name=this.name),Object.keys(this.userData).length>0&&(e.userData=this.userData),this.parameters!==void 0){const l=this.parameters;for(const c in l)l[c]!==void 0&&(e[c]=l[c]);return e}e.data={attributes:{}};const t=this.index;t!==null&&(e.data.index={type:t.array.constructor.name,array:Array.prototype.slice.call(t.array)});const i=this.attributes;for(const l in i){const c=i[l];e.data.attributes[l]=c.toJSON(e.data)}const n={};let r=!1;for(const l in this.morphAttributes){const c=this.morphAttributes[l],h=[];for(let d=0,p=c.length;d<p;d++){const u=c[d];h.push(u.toJSON(e.data))}h.length>0&&(n[l]=h,r=!0)}r&&(e.data.morphAttributes=n,e.data.morphTargetsRelative=this.morphTargetsRelative);const a=this.groups;a.length>0&&(e.data.groups=JSON.parse(JSON.stringify(a)));const o=this.boundingSphere;return o!==null&&(e.data.boundingSphere=o.toJSON()),e}clone(){return new this.constructor().copy(this)}copy(e){this.index=null,this.attributes={},this.morphAttributes={},this.groups=[],this.boundingBox=null,this.boundingSphere=null;const t={};this.name=e.name;const i=e.index;i!==null&&this.setIndex(i.clone());const n=e.attributes;for(const c in n){const h=n[c];this.setAttribute(c,h.clone(t))}const r=e.morphAttributes;for(const c in r){const h=[],d=r[c];for(let p=0,u=d.length;p<u;p++)h.push(d[p].clone(t));this.morphAttributes[c]=h}this.morphTargetsRelative=e.morphTargetsRelative;const a=e.groups;for(let c=0,h=a.length;c<h;c++){const d=a[c];this.addGroup(d.start,d.count,d.materialIndex)}const o=e.boundingBox;o!==null&&(this.boundingBox=o.clone());const l=e.boundingSphere;return l!==null&&(this.boundingSphere=l.clone()),this.drawRange.start=e.drawRange.start,this.drawRange.count=e.drawRange.count,this.userData=e.userData,this}dispose(){this.dispatchEvent({type:"dispose"})}}class Hc{constructor(e,t){this.isInterleavedBuffer=!0,this.array=e,this.stride=t,this.count=e!==void 0?e.length/t:0,this.usage=Rc,this.updateRanges=[],this.version=0,this.uuid=kn()}onUploadCallback(){}set needsUpdate(e){e===!0&&this.version++}setUsage(e){return this.usage=e,this}addUpdateRange(e,t){this.updateRanges.push({start:e,count:t})}clearUpdateRanges(){this.updateRanges.length=0}copy(e){return this.array=new e.array.constructor(e.array),this.count=e.count,this.stride=e.stride,this.usage=e.usage,this}copyAt(e,t,i){e*=this.stride,i*=t.stride;for(let n=0,r=this.stride;n<r;n++)this.array[e+n]=t.array[i+n];return this}set(e,t=0){return this.array.set(e,t),this}clone(e){e.arrayBuffers===void 0&&(e.arrayBuffers={}),this.array.buffer._uuid===void 0&&(this.array.buffer._uuid=kn()),e.arrayBuffers[this.array.buffer._uuid]===void 0&&(e.arrayBuffers[this.array.buffer._uuid]=this.array.slice(0).buffer);const t=new this.array.constructor(e.arrayBuffers[this.array.buffer._uuid]),i=new this.constructor(t,this.stride);return i.setUsage(this.usage),i}onUpload(e){return this.onUploadCallback=e,this}toJSON(e){return e.arrayBuffers===void 0&&(e.arrayBuffers={}),this.array.buffer._uuid===void 0&&(this.array.buffer._uuid=kn()),e.arrayBuffers[this.array.buffer._uuid]===void 0&&(e.arrayBuffers[this.array.buffer._uuid]=Array.from(new Uint32Array(this.array.buffer))),{uuid:this.uuid,buffer:this.array.buffer._uuid,type:this.array.constructor.name,stride:this.stride}}}const un=new R;class Hr{constructor(e,t,i,n=!1){this.isInterleavedBufferAttribute=!0,this.name="",this.data=e,this.itemSize=t,this.offset=i,this.normalized=n}get count(){return this.data.count}get array(){return this.data.array}set needsUpdate(e){this.data.needsUpdate=e}applyMatrix4(e){for(let t=0,i=this.data.count;t<i;t++)un.fromBufferAttribute(this,t),un.applyMatrix4(e),this.setXYZ(t,un.x,un.y,un.z);return this}applyNormalMatrix(e){for(let t=0,i=this.count;t<i;t++)un.fromBufferAttribute(this,t),un.applyNormalMatrix(e),this.setXYZ(t,un.x,un.y,un.z);return this}transformDirection(e){for(let t=0,i=this.count;t<i;t++)un.fromBufferAttribute(this,t),un.transformDirection(e),this.setXYZ(t,un.x,un.y,un.z);return this}getComponent(e,t){let i=this.array[e*this.data.stride+this.offset+t];return this.normalized&&(i=dn(i,this.array)),i}setComponent(e,t,i){return this.normalized&&(i=mt(i,this.array)),this.data.array[e*this.data.stride+this.offset+t]=i,this}setX(e,t){return this.normalized&&(t=mt(t,this.array)),this.data.array[e*this.data.stride+this.offset]=t,this}setY(e,t){return this.normalized&&(t=mt(t,this.array)),this.data.array[e*this.data.stride+this.offset+1]=t,this}setZ(e,t){return this.normalized&&(t=mt(t,this.array)),this.data.array[e*this.data.stride+this.offset+2]=t,this}setW(e,t){return this.normalized&&(t=mt(t,this.array)),this.data.array[e*this.data.stride+this.offset+3]=t,this}getX(e){let t=this.data.array[e*this.data.stride+this.offset];return this.normalized&&(t=dn(t,this.array)),t}getY(e){let t=this.data.array[e*this.data.stride+this.offset+1];return this.normalized&&(t=dn(t,this.array)),t}getZ(e){let t=this.data.array[e*this.data.stride+this.offset+2];return this.normalized&&(t=dn(t,this.array)),t}getW(e){let t=this.data.array[e*this.data.stride+this.offset+3];return this.normalized&&(t=dn(t,this.array)),t}setXY(e,t,i){return e=e*this.data.stride+this.offset,this.normalized&&(t=mt(t,this.array),i=mt(i,this.array)),this.data.array[e+0]=t,this.data.array[e+1]=i,this}setXYZ(e,t,i,n){return e=e*this.data.stride+this.offset,this.normalized&&(t=mt(t,this.array),i=mt(i,this.array),n=mt(n,this.array)),this.data.array[e+0]=t,this.data.array[e+1]=i,this.data.array[e+2]=n,this}setXYZW(e,t,i,n,r){return e=e*this.data.stride+this.offset,this.normalized&&(t=mt(t,this.array),i=mt(i,this.array),n=mt(n,this.array),r=mt(r,this.array)),this.data.array[e+0]=t,this.data.array[e+1]=i,this.data.array[e+2]=n,this.data.array[e+3]=r,this}clone(e){if(e===void 0){Ic("InterleavedBufferAttribute.clone(): Cloning an interleaved buffer attribute will de-interleave buffer data.");const t=[];for(let i=0;i<this.count;i++){const n=i*this.data.stride+this.offset;for(let r=0;r<this.itemSize;r++)t.push(this.data.array[n+r])}return new Mt(new this.array.constructor(t),this.itemSize,this.normalized)}else return e.interleavedBuffers===void 0&&(e.interleavedBuffers={}),e.interleavedBuffers[this.data.uuid]===void 0&&(e.interleavedBuffers[this.data.uuid]=this.data.clone(e)),new Hr(e.interleavedBuffers[this.data.uuid],this.itemSize,this.offset,this.normalized)}toJSON(e){if(e===void 0){Ic("InterleavedBufferAttribute.toJSON(): Serializing an interleaved buffer attribute will de-interleave buffer data.");const t=[];for(let i=0;i<this.count;i++){const n=i*this.data.stride+this.offset;for(let r=0;r<this.itemSize;r++)t.push(this.data.array[n+r])}return{itemSize:this.itemSize,type:this.array.constructor.name,array:t,normalized:this.normalized}}else return e.interleavedBuffers===void 0&&(e.interleavedBuffers={}),e.interleavedBuffers[this.data.uuid]===void 0&&(e.interleavedBuffers[this.data.uuid]=this.data.toJSON(e)),{isInterleavedBufferAttribute:!0,itemSize:this.itemSize,data:this.data.uuid,offset:this.offset,normalized:this.normalized}}}let U3=0;class Ri extends hs{constructor(){super(),this.isMaterial=!0,Object.defineProperty(this,"id",{value:U3++}),this.uuid=kn(),this.name="",this.type="Material",this.blending=ba,this.side=_n,this.vertexColors=!1,this.opacity=1,this.transparent=!1,this.alphaHash=!1,this.blendSrc=cd,this.blendDst=hd,this.blendEquation=bn,this.blendSrcAlpha=null,this.blendDstAlpha=null,this.blendEquationAlpha=null,this.blendColor=new We(0,0,0),this.blendAlpha=0,this.depthFunc=Ma,this.depthTest=!0,this.depthWrite=!0,this.stencilWriteMask=255,this.stencilFunc=Hm,this.stencilRef=0,this.stencilFuncMask=255,this.stencilFail=Aa,this.stencilZFail=Aa,this.stencilZPass=Aa,this.stencilWrite=!1,this.clippingPlanes=null,this.clipIntersection=!1,this.clipShadows=!1,this.shadowSide=null,this.colorWrite=!0,this.precision=null,this.polygonOffset=!1,this.polygonOffsetFactor=0,this.polygonOffsetUnits=0,this.dithering=!1,this.alphaToCoverage=!1,this.premultipliedAlpha=!1,this.forceSinglePass=!1,this.allowOverride=!0,this.visible=!0,this.toneMapped=!0,this.userData={},this.version=0,this._alphaTest=0}get alphaTest(){return this._alphaTest}set alphaTest(e){this._alphaTest>0!=e>0&&this.version++,this._alphaTest=e}onBeforeRender(){}onBeforeCompile(){}customProgramCacheKey(){return this.onBeforeCompile.toString()}setValues(e){if(e!==void 0)for(const t in e){const i=e[t];if(i===void 0){Ye(`Material: parameter '${t}' has value of undefined.`);continue}const n=this[t];if(n===void 0){Ye(`Material: '${t}' is not a property of THREE.${this.type}.`);continue}n&&n.isColor?n.set(i):n&&n.isVector3&&i&&i.isVector3?n.copy(i):this[t]=i}}toJSON(e){const t=e===void 0||typeof e=="string";t&&(e={textures:{},images:{}});const i={metadata:{version:4.7,type:"Material",generator:"Material.toJSON"}};i.uuid=this.uuid,i.type=this.type,this.name!==""&&(i.name=this.name),this.color&&this.color.isColor&&(i.color=this.color.getHex()),this.roughness!==void 0&&(i.roughness=this.roughness),this.metalness!==void 0&&(i.metalness=this.metalness),this.sheen!==void 0&&(i.sheen=this.sheen),this.sheenColor&&this.sheenColor.isColor&&(i.sheenColor=this.sheenColor.getHex()),this.sheenRoughness!==void 0&&(i.sheenRoughness=this.sheenRoughness),this.emissive&&this.emissive.isColor&&(i.emissive=this.emissive.getHex()),this.emissiveIntensity!==void 0&&this.emissiveIntensity!==1&&(i.emissiveIntensity=this.emissiveIntensity),this.specular&&this.specular.isColor&&(i.specular=this.specular.getHex()),this.specularIntensity!==void 0&&(i.specularIntensity=this.specularIntensity),this.specularColor&&this.specularColor.isColor&&(i.specularColor=this.specularColor.getHex()),this.shininess!==void 0&&(i.shininess=this.shininess),this.clearcoat!==void 0&&(i.clearcoat=this.clearcoat),this.clearcoatRoughness!==void 0&&(i.clearcoatRoughness=this.clearcoatRoughness),this.clearcoatMap&&this.clearcoatMap.isTexture&&(i.clearcoatMap=this.clearcoatMap.toJSON(e).uuid),this.clearcoatRoughnessMap&&this.clearcoatRoughnessMap.isTexture&&(i.clearcoatRoughnessMap=this.clearcoatRoughnessMap.toJSON(e).uuid),this.clearcoatNormalMap&&this.clearcoatNormalMap.isTexture&&(i.clearcoatNormalMap=this.clearcoatNormalMap.toJSON(e).uuid,i.clearcoatNormalScale=this.clearcoatNormalScale.toArray()),this.sheenColorMap&&this.sheenColorMap.isTexture&&(i.sheenColorMap=this.sheenColorMap.toJSON(e).uuid),this.sheenRoughnessMap&&this.sheenRoughnessMap.isTexture&&(i.sheenRoughnessMap=this.sheenRoughnessMap.toJSON(e).uuid),this.dispersion!==void 0&&(i.dispersion=this.dispersion),this.iridescence!==void 0&&(i.iridescence=this.iridescence),this.iridescenceIOR!==void 0&&(i.iridescenceIOR=this.iridescenceIOR),this.iridescenceThicknessRange!==void 0&&(i.iridescenceThicknessRange=this.iridescenceThicknessRange),this.iridescenceMap&&this.iridescenceMap.isTexture&&(i.iridescenceMap=this.iridescenceMap.toJSON(e).uuid),this.iridescenceThicknessMap&&this.iridescenceThicknessMap.isTexture&&(i.iridescenceThicknessMap=this.iridescenceThicknessMap.toJSON(e).uuid),this.anisotropy!==void 0&&(i.anisotropy=this.anisotropy),this.anisotropyRotation!==void 0&&(i.anisotropyRotation=this.anisotropyRotation),this.anisotropyMap&&this.anisotropyMap.isTexture&&(i.anisotropyMap=this.anisotropyMap.toJSON(e).uuid),this.map&&this.map.isTexture&&(i.map=this.map.toJSON(e).uuid),this.matcap&&this.matcap.isTexture&&(i.matcap=this.matcap.toJSON(e).uuid),this.alphaMap&&this.alphaMap.isTexture&&(i.alphaMap=this.alphaMap.toJSON(e).uuid),this.lightMap&&this.lightMap.isTexture&&(i.lightMap=this.lightMap.toJSON(e).uuid,i.lightMapIntensity=this.lightMapIntensity),this.aoMap&&this.aoMap.isTexture&&(i.aoMap=this.aoMap.toJSON(e).uuid,i.aoMapIntensity=this.aoMapIntensity),this.bumpMap&&this.bumpMap.isTexture&&(i.bumpMap=this.bumpMap.toJSON(e).uuid,i.bumpScale=this.bumpScale),this.normalMap&&this.normalMap.isTexture&&(i.normalMap=this.normalMap.toJSON(e).uuid,i.normalMapType=this.normalMapType,i.normalScale=this.normalScale.toArray()),this.displacementMap&&this.displacementMap.isTexture&&(i.displacementMap=this.displacementMap.toJSON(e).uuid,i.displacementScale=this.displacementScale,i.displacementBias=this.displacementBias),this.roughnessMap&&this.roughnessMap.isTexture&&(i.roughnessMap=this.roughnessMap.toJSON(e).uuid),this.metalnessMap&&this.metalnessMap.isTexture&&(i.metalnessMap=this.metalnessMap.toJSON(e).uuid),this.emissiveMap&&this.emissiveMap.isTexture&&(i.emissiveMap=this.emissiveMap.toJSON(e).uuid),this.specularMap&&this.specularMap.isTexture&&(i.specularMap=this.specularMap.toJSON(e).uuid),this.specularIntensityMap&&this.specularIntensityMap.isTexture&&(i.specularIntensityMap=this.specularIntensityMap.toJSON(e).uuid),this.specularColorMap&&this.specularColorMap.isTexture&&(i.specularColorMap=this.specularColorMap.toJSON(e).uuid),this.envMap&&this.envMap.isTexture&&(i.envMap=this.envMap.toJSON(e).uuid,this.combine!==void 0&&(i.combine=this.combine)),this.envMapRotation!==void 0&&(i.envMapRotation=this.envMapRotation.toArray()),this.envMapIntensity!==void 0&&(i.envMapIntensity=this.envMapIntensity),this.reflectivity!==void 0&&(i.reflectivity=this.reflectivity),this.refractionRatio!==void 0&&(i.refractionRatio=this.refractionRatio),this.gradientMap&&this.gradientMap.isTexture&&(i.gradientMap=this.gradientMap.toJSON(e).uuid),this.transmission!==void 0&&(i.transmission=this.transmission),this.transmissionMap&&this.transmissionMap.isTexture&&(i.transmissionMap=this.transmissionMap.toJSON(e).uuid),this.thickness!==void 0&&(i.thickness=this.thickness),this.thicknessMap&&this.thicknessMap.isTexture&&(i.thicknessMap=this.thicknessMap.toJSON(e).uuid),this.attenuationDistance!==void 0&&this.attenuationDistance!==1/0&&(i.attenuationDistance=this.attenuationDistance),this.attenuationColor!==void 0&&(i.attenuationColor=this.attenuationColor.getHex()),this.size!==void 0&&(i.size=this.size),this.shadowSide!==null&&(i.shadowSide=this.shadowSide),this.sizeAttenuation!==void 0&&(i.sizeAttenuation=this.sizeAttenuation),this.blending!==ba&&(i.blending=this.blending),this.side!==_n&&(i.side=this.side),this.vertexColors===!0&&(i.vertexColors=!0),this.opacity<1&&(i.opacity=this.opacity),this.transparent===!0&&(i.transparent=!0),this.blendSrc!==cd&&(i.blendSrc=this.blendSrc),this.blendDst!==hd&&(i.blendDst=this.blendDst),this.blendEquation!==bn&&(i.blendEquation=this.blendEquation),this.blendSrcAlpha!==null&&(i.blendSrcAlpha=this.blendSrcAlpha),this.blendDstAlpha!==null&&(i.blendDstAlpha=this.blendDstAlpha),this.blendEquationAlpha!==null&&(i.blendEquationAlpha=this.blendEquationAlpha),this.blendColor&&this.blendColor.isColor&&(i.blendColor=this.blendColor.getHex()),this.blendAlpha!==0&&(i.blendAlpha=this.blendAlpha),this.depthFunc!==Ma&&(i.depthFunc=this.depthFunc),this.depthTest===!1&&(i.depthTest=this.depthTest),this.depthWrite===!1&&(i.depthWrite=this.depthWrite),this.colorWrite===!1&&(i.colorWrite=this.colorWrite),this.stencilWriteMask!==255&&(i.stencilWriteMask=this.stencilWriteMask),this.stencilFunc!==Hm&&(i.stencilFunc=this.stencilFunc),this.stencilRef!==0&&(i.stencilRef=this.stencilRef),this.stencilFuncMask!==255&&(i.stencilFuncMask=this.stencilFuncMask),this.stencilFail!==Aa&&(i.stencilFail=this.stencilFail),this.stencilZFail!==Aa&&(i.stencilZFail=this.stencilZFail),this.stencilZPass!==Aa&&(i.stencilZPass=this.stencilZPass),this.stencilWrite===!0&&(i.stencilWrite=this.stencilWrite),this.rotation!==void 0&&this.rotation!==0&&(i.rotation=this.rotation),this.polygonOffset===!0&&(i.polygonOffset=!0),this.polygonOffsetFactor!==0&&(i.polygonOffsetFactor=this.polygonOffsetFactor),this.polygonOffsetUnits!==0&&(i.polygonOffsetUnits=this.polygonOffsetUnits),this.linewidth!==void 0&&this.linewidth!==1&&(i.linewidth=this.linewidth),this.dashSize!==void 0&&(i.dashSize=this.dashSize),this.gapSize!==void 0&&(i.gapSize=this.gapSize),this.scale!==void 0&&(i.scale=this.scale),this.dithering===!0&&(i.dithering=!0),this.alphaTest>0&&(i.alphaTest=this.alphaTest),this.alphaHash===!0&&(i.alphaHash=!0),this.alphaToCoverage===!0&&(i.alphaToCoverage=!0),this.premultipliedAlpha===!0&&(i.premultipliedAlpha=!0),this.forceSinglePass===!0&&(i.forceSinglePass=!0),this.allowOverride===!1&&(i.allowOverride=!1),this.wireframe===!0&&(i.wireframe=!0),this.wireframeLinewidth>1&&(i.wireframeLinewidth=this.wireframeLinewidth),this.wireframeLinecap!=="round"&&(i.wireframeLinecap=this.wireframeLinecap),this.wireframeLinejoin!=="round"&&(i.wireframeLinejoin=this.wireframeLinejoin),this.flatShading===!0&&(i.flatShading=!0),this.visible===!1&&(i.visible=!1),this.toneMapped===!1&&(i.toneMapped=!1),this.fog===!1&&(i.fog=!1),Object.keys(this.userData).length>0&&(i.userData=this.userData);function n(r){const a=[];for(const o in r){const l=r[o];delete l.metadata,a.push(l)}return a}if(t){const r=n(e.textures),a=n(e.images);r.length>0&&(i.textures=r),a.length>0&&(i.images=a)}return i}clone(){return new this.constructor().copy(this)}copy(e){this.name=e.name,this.blending=e.blending,this.side=e.side,this.vertexColors=e.vertexColors,this.opacity=e.opacity,this.transparent=e.transparent,this.blendSrc=e.blendSrc,this.blendDst=e.blendDst,this.blendEquation=e.blendEquation,this.blendSrcAlpha=e.blendSrcAlpha,this.blendDstAlpha=e.blendDstAlpha,this.blendEquationAlpha=e.blendEquationAlpha,this.blendColor.copy(e.blendColor),this.blendAlpha=e.blendAlpha,this.depthFunc=e.depthFunc,this.depthTest=e.depthTest,this.depthWrite=e.depthWrite,this.stencilWriteMask=e.stencilWriteMask,this.stencilFunc=e.stencilFunc,this.stencilRef=e.stencilRef,this.stencilFuncMask=e.stencilFuncMask,this.stencilFail=e.stencilFail,this.stencilZFail=e.stencilZFail,this.stencilZPass=e.stencilZPass,this.stencilWrite=e.stencilWrite;const t=e.clippingPlanes;let i=null;if(t!==null){const n=t.length;i=new Array(n);for(let r=0;r!==n;++r)i[r]=t[r].clone()}return this.clippingPlanes=i,this.clipIntersection=e.clipIntersection,this.clipShadows=e.clipShadows,this.shadowSide=e.shadowSide,this.colorWrite=e.colorWrite,this.precision=e.precision,this.polygonOffset=e.polygonOffset,this.polygonOffsetFactor=e.polygonOffsetFactor,this.polygonOffsetUnits=e.polygonOffsetUnits,this.dithering=e.dithering,this.alphaTest=e.alphaTest,this.alphaHash=e.alphaHash,this.alphaToCoverage=e.alphaToCoverage,this.premultipliedAlpha=e.premultipliedAlpha,this.forceSinglePass=e.forceSinglePass,this.allowOverride=e.allowOverride,this.visible=e.visible,this.toneMapped=e.toneMapped,this.userData=JSON.parse(JSON.stringify(e.userData)),this}dispose(){this.dispatchEvent({type:"dispose"})}set needsUpdate(e){e===!0&&this.version++}}class Cu extends Ri{constructor(e){super(),this.isSpriteMaterial=!0,this.type="SpriteMaterial",this.color=new We(16777215),this.map=null,this.alphaMap=null,this.rotation=0,this.sizeAttenuation=!0,this.transparent=!0,this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.map=e.map,this.alphaMap=e.alphaMap,this.rotation=e.rotation,this.sizeAttenuation=e.sizeAttenuation,this.fog=e.fog,this}}let ll;const Vc=new R,cl=new R,hl=new R,dl=new me,Gc=new me,px=new qe,Au=new R,Wc=new R,Pu=new R,fx=new me,cg=new me,mx=new me;class Xc extends Rt{constructor(e=new Cu){if(super(),this.isSprite=!0,this.type="Sprite",ll===void 0){ll=new at;const t=new Float32Array([-.5,-.5,0,0,0,.5,-.5,0,1,0,.5,.5,0,1,1,-.5,.5,0,0,1]),i=new Hc(t,5);ll.setIndex([0,1,2,0,2,3]),ll.setAttribute("position",new Hr(i,3,0,!1)),ll.setAttribute("uv",new Hr(i,2,3,!1))}this.geometry=ll,this.material=e,this.center=new me(.5,.5),this.count=1}raycast(e,t){e.camera===null&&lt('Sprite: "Raycaster.camera" needs to be set in order to raycast against sprites.'),cl.setFromMatrixScale(this.matrixWorld),px.copy(e.camera.matrixWorld),this.modelViewMatrix.multiplyMatrices(e.camera.matrixWorldInverse,this.matrixWorld),hl.setFromMatrixPosition(this.modelViewMatrix),e.camera.isPerspectiveCamera&&this.material.sizeAttenuation===!1&&cl.multiplyScalar(-hl.z);const i=this.material.rotation;let n,r;i!==0&&(r=Math.cos(i),n=Math.sin(i));const a=this.center;Ru(Au.set(-.5,-.5,0),hl,a,cl,n,r),Ru(Wc.set(.5,-.5,0),hl,a,cl,n,r),Ru(Pu.set(.5,.5,0),hl,a,cl,n,r),fx.set(0,0),cg.set(1,0),mx.set(1,1);let o=e.ray.intersectTriangle(Au,Wc,Pu,!1,Vc);if(o===null&&(Ru(Wc.set(-.5,.5,0),hl,a,cl,n,r),cg.set(0,1),o=e.ray.intersectTriangle(Au,Pu,Wc,!1,Vc),o===null))return;const l=e.ray.origin.distanceTo(Vc);l<e.near||l>e.far||t.push({distance:l,point:Vc.clone(),uv:Ht.getInterpolation(Vc,Au,Wc,Pu,fx,cg,mx,new me),face:null,object:this})}copy(e,t){return super.copy(e,t),e.center!==void 0&&this.center.copy(e.center),this.material=e.material,this}}function Ru(s,e,t,i,n,r){dl.subVectors(s,t).addScalar(.5).multiply(i),n!==void 0?(Gc.x=r*dl.x-n*dl.y,Gc.y=n*dl.x+r*dl.y):Gc.copy(dl),s.copy(e),s.x+=Gc.x,s.y+=Gc.y,s.applyMatrix4(px)}const Lu=new R,gx=new R;class vx extends Rt{constructor(){super(),this.isLOD=!0,this._currentLevel=0,this.type="LOD",Object.defineProperties(this,{levels:{enumerable:!0,value:[]}}),this.autoUpdate=!0}copy(e){super.copy(e,!1);const t=e.levels;for(let i=0,n=t.length;i<n;i++){const r=t[i];this.addLevel(r.object.clone(),r.distance,r.hysteresis)}return this.autoUpdate=e.autoUpdate,this}addLevel(e,t=0,i=0){t=Math.abs(t);const n=this.levels;let r;for(r=0;r<n.length&&!(t<n[r].distance);r++);return n.splice(r,0,{distance:t,hysteresis:i,object:e}),this.add(e),this}removeLevel(e){const t=this.levels;for(let i=0;i<t.length;i++)if(t[i].distance===e){const n=t.splice(i,1);return this.remove(n[0].object),!0}return!1}getCurrentLevel(){return this._currentLevel}getObjectForDistance(e){const t=this.levels;if(t.length>0){let i,n;for(i=1,n=t.length;i<n;i++){let r=t[i].distance;if(t[i].object.visible&&(r-=r*t[i].hysteresis),e<r)break}return t[i-1].object}return null}raycast(e,t){if(this.levels.length>0){Lu.setFromMatrixPosition(this.matrixWorld);const n=e.ray.origin.distanceTo(Lu);this.getObjectForDistance(n).raycast(e,t)}}update(e){const t=this.levels;if(t.length>1){Lu.setFromMatrixPosition(e.matrixWorld),gx.setFromMatrixPosition(this.matrixWorld);const i=Lu.distanceTo(gx)/e.zoom;t[0].object.visible=!0;let n,r;for(n=1,r=t.length;n<r;n++){let a=t[n].distance;if(t[n].object.visible&&(a-=a*t[n].hysteresis),i>=a)t[n-1].object.visible=!1,t[n].object.visible=!0;else break}for(this._currentLevel=n-1;n<r;n++)t[n].object.visible=!1}}toJSON(e){const t=super.toJSON(e);this.autoUpdate===!1&&(t.object.autoUpdate=!1),t.object.levels=[];const i=this.levels;for(let n=0,r=i.length;n<r;n++){const a=i[n];t.object.levels.push({object:a.object.uuid,distance:a.distance,hysteresis:a.hysteresis})}return t}}const ir=new R,hg=new R,Iu=new R,Vr=new R,dg=new R,Du=new R,ug=new R;class ks{constructor(e=new R,t=new R(0,0,-1)){this.origin=e,this.direction=t}set(e,t){return this.origin.copy(e),this.direction.copy(t),this}copy(e){return this.origin.copy(e.origin),this.direction.copy(e.direction),this}at(e,t){return t.copy(this.origin).addScaledVector(this.direction,e)}lookAt(e){return this.direction.copy(e).sub(this.origin).normalize(),this}recast(e){return this.origin.copy(this.at(e,ir)),this}closestPointToPoint(e,t){t.subVectors(e,this.origin);const i=t.dot(this.direction);return i<0?t.copy(this.origin):t.copy(this.origin).addScaledVector(this.direction,i)}distanceToPoint(e){return Math.sqrt(this.distanceSqToPoint(e))}distanceSqToPoint(e){const t=ir.subVectors(e,this.origin).dot(this.direction);return t<0?this.origin.distanceToSquared(e):(ir.copy(this.origin).addScaledVector(this.direction,t),ir.distanceToSquared(e))}distanceSqToSegment(e,t,i,n){hg.copy(e).add(t).multiplyScalar(.5),Iu.copy(t).sub(e).normalize(),Vr.copy(this.origin).sub(hg);const r=e.distanceTo(t)*.5,a=-this.direction.dot(Iu),o=Vr.dot(this.direction),l=-Vr.dot(Iu),c=Vr.lengthSq(),h=Math.abs(1-a*a);let d,p,u,v;if(h>0)if(d=a*l-o,p=a*o-l,v=r*h,d>=0)if(p>=-v)if(p<=v){const g=1/h;d*=g,p*=g,u=d*(d+a*p+2*o)+p*(a*d+p+2*l)+c}else p=r,d=Math.max(0,-(a*p+o)),u=-d*d+p*(p+2*l)+c;else p=-r,d=Math.max(0,-(a*p+o)),u=-d*d+p*(p+2*l)+c;else p<=-v?(d=Math.max(0,-(-a*r+o)),p=d>0?-r:Math.min(Math.max(-r,-l),r),u=-d*d+p*(p+2*l)+c):p<=v?(d=0,p=Math.min(Math.max(-r,-l),r),u=p*(p+2*l)+c):(d=Math.max(0,-(a*r+o)),p=d>0?r:Math.min(Math.max(-r,-l),r),u=-d*d+p*(p+2*l)+c);else p=a>0?-r:r,d=Math.max(0,-(a*p+o)),u=-d*d+p*(p+2*l)+c;return i&&i.copy(this.origin).addScaledVector(this.direction,d),n&&n.copy(hg).addScaledVector(Iu,p),u}intersectSphere(e,t){ir.subVectors(e.center,this.origin);const i=ir.dot(this.direction),n=ir.dot(ir)-i*i,r=e.radius*e.radius;if(n>r)return null;const a=Math.sqrt(r-n),o=i-a,l=i+a;return l<0?null:o<0?this.at(l,t):this.at(o,t)}intersectsSphere(e){return e.radius<0?!1:this.distanceSqToPoint(e.center)<=e.radius*e.radius}distanceToPlane(e){const t=e.normal.dot(this.direction);if(t===0)return e.distanceToPoint(this.origin)===0?0:null;const i=-(this.origin.dot(e.normal)+e.constant)/t;return i>=0?i:null}intersectPlane(e,t){const i=this.distanceToPlane(e);return i===null?null:this.at(i,t)}intersectsPlane(e){const t=e.distanceToPoint(this.origin);return t===0||e.normal.dot(this.direction)*t<0}intersectBox(e,t){let i,n,r,a,o,l;const c=1/this.direction.x,h=1/this.direction.y,d=1/this.direction.z,p=this.origin;return c>=0?(i=(e.min.x-p.x)*c,n=(e.max.x-p.x)*c):(i=(e.max.x-p.x)*c,n=(e.min.x-p.x)*c),h>=0?(r=(e.min.y-p.y)*h,a=(e.max.y-p.y)*h):(r=(e.max.y-p.y)*h,a=(e.min.y-p.y)*h),i>a||r>n||((r>i||isNaN(i))&&(i=r),(a<n||isNaN(n))&&(n=a),d>=0?(o=(e.min.z-p.z)*d,l=(e.max.z-p.z)*d):(o=(e.max.z-p.z)*d,l=(e.min.z-p.z)*d),i>l||o>n)||((o>i||i!==i)&&(i=o),(l<n||n!==n)&&(n=l),n<0)?null:this.at(i>=0?i:n,t)}intersectsBox(e){return this.intersectBox(e,ir)!==null}intersectTriangle(e,t,i,n,r){dg.subVectors(t,e),Du.subVectors(i,e),ug.crossVectors(dg,Du);let a=this.direction.dot(ug),o;if(a>0){if(n)return null;o=1}else if(a<0)o=-1,a=-a;else return null;Vr.subVectors(this.origin,e);const l=o*this.direction.dot(Du.crossVectors(Vr,Du));if(l<0)return null;const c=o*this.direction.dot(dg.cross(Vr));if(c<0||l+c>a)return null;const h=-o*Vr.dot(ug);return h<0?null:this.at(h/a,r)}applyMatrix4(e){return this.origin.applyMatrix4(e),this.direction.transformDirection(e),this}equals(e){return e.origin.equals(this.origin)&&e.direction.equals(this.direction)}clone(){return new this.constructor().copy(this)}}class Dt extends Ri{constructor(e){super(),this.isMeshBasicMaterial=!0,this.type="MeshBasicMaterial",this.color=new We(16777215),this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.envMapRotation=new Fi,this.combine=_c,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.map=e.map,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.specularMap=e.specularMap,this.alphaMap=e.alphaMap,this.envMap=e.envMap,this.envMapRotation.copy(e.envMapRotation),this.combine=e.combine,this.reflectivity=e.reflectivity,this.refractionRatio=e.refractionRatio,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.fog=e.fog,this}}const yx=new qe,Na=new ks,Nu=new zi,xx=new R,ku=new R,Ou=new R,Uu=new R,pg=new R,Bu=new R,_x=new R,Fu=new R;class ht extends Rt{constructor(e=new at,t=new Dt){super(),this.isMesh=!0,this.type="Mesh",this.geometry=e,this.material=t,this.morphTargetDictionary=void 0,this.morphTargetInfluences=void 0,this.count=1,this.updateMorphTargets()}copy(e,t){return super.copy(e,t),e.morphTargetInfluences!==void 0&&(this.morphTargetInfluences=e.morphTargetInfluences.slice()),e.morphTargetDictionary!==void 0&&(this.morphTargetDictionary=Object.assign({},e.morphTargetDictionary)),this.material=Array.isArray(e.material)?e.material.slice():e.material,this.geometry=e.geometry,this}updateMorphTargets(){const t=this.geometry.morphAttributes,i=Object.keys(t);if(i.length>0){const n=t[i[0]];if(n!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let r=0,a=n.length;r<a;r++){const o=n[r].name||String(r);this.morphTargetInfluences.push(0),this.morphTargetDictionary[o]=r}}}}getVertexPosition(e,t){const i=this.geometry,n=i.attributes.position,r=i.morphAttributes.position,a=i.morphTargetsRelative;t.fromBufferAttribute(n,e);const o=this.morphTargetInfluences;if(r&&o){Bu.set(0,0,0);for(let l=0,c=r.length;l<c;l++){const h=o[l],d=r[l];h!==0&&(pg.fromBufferAttribute(d,e),a?Bu.addScaledVector(pg,h):Bu.addScaledVector(pg.sub(t),h))}t.add(Bu)}return t}raycast(e,t){const i=this.geometry,n=this.material,r=this.matrixWorld;n!==void 0&&(i.boundingSphere===null&&i.computeBoundingSphere(),Nu.copy(i.boundingSphere),Nu.applyMatrix4(r),Na.copy(e.ray).recast(e.near),!(Nu.containsPoint(Na.origin)===!1&&(Na.intersectSphere(Nu,xx)===null||Na.origin.distanceToSquared(xx)>(e.far-e.near)**2))&&(yx.copy(r).invert(),Na.copy(e.ray).applyMatrix4(yx),!(i.boundingBox!==null&&Na.intersectsBox(i.boundingBox)===!1)&&this._computeIntersections(e,t,Na)))}_computeIntersections(e,t,i){let n;const r=this.geometry,a=this.material,o=r.index,l=r.attributes.position,c=r.attributes.uv,h=r.attributes.uv1,d=r.attributes.normal,p=r.groups,u=r.drawRange;if(o!==null)if(Array.isArray(a))for(let v=0,g=p.length;v<g;v++){const m=p[v],f=a[m.materialIndex],y=Math.max(m.start,u.start),x=Math.min(o.count,Math.min(m.start+m.count,u.start+u.count));for(let _=y,S=x;_<S;_+=3){const b=o.getX(_),E=o.getX(_+1),w=o.getX(_+2);n=zu(this,f,e,i,c,h,d,b,E,w),n&&(n.faceIndex=Math.floor(_/3),n.face.materialIndex=m.materialIndex,t.push(n))}}else{const v=Math.max(0,u.start),g=Math.min(o.count,u.start+u.count);for(let m=v,f=g;m<f;m+=3){const y=o.getX(m),x=o.getX(m+1),_=o.getX(m+2);n=zu(this,a,e,i,c,h,d,y,x,_),n&&(n.faceIndex=Math.floor(m/3),t.push(n))}}else if(l!==void 0)if(Array.isArray(a))for(let v=0,g=p.length;v<g;v++){const m=p[v],f=a[m.materialIndex],y=Math.max(m.start,u.start),x=Math.min(l.count,Math.min(m.start+m.count,u.start+u.count));for(let _=y,S=x;_<S;_+=3){const b=_,E=_+1,w=_+2;n=zu(this,f,e,i,c,h,d,b,E,w),n&&(n.faceIndex=Math.floor(_/3),n.face.materialIndex=m.materialIndex,t.push(n))}}else{const v=Math.max(0,u.start),g=Math.min(l.count,u.start+u.count);for(let m=v,f=g;m<f;m+=3){const y=m,x=m+1,_=m+2;n=zu(this,a,e,i,c,h,d,y,x,_),n&&(n.faceIndex=Math.floor(m/3),t.push(n))}}}}function B3(s,e,t,i,n,r,a,o){let l;if(e.side===Bi?l=i.intersectTriangle(a,r,n,!0,o):l=i.intersectTriangle(n,r,a,e.side===_n,o),l===null)return null;Fu.copy(o),Fu.applyMatrix4(s.matrixWorld);const c=t.ray.origin.distanceTo(Fu);return c<t.near||c>t.far?null:{distance:c,point:Fu.clone(),object:s}}function zu(s,e,t,i,n,r,a,o,l,c){s.getVertexPosition(o,ku),s.getVertexPosition(l,Ou),s.getVertexPosition(c,Uu);const h=B3(s,e,t,i,ku,Ou,Uu,_x);if(h){const d=new R;Ht.getBarycoord(_x,ku,Ou,Uu,d),n&&(h.uv=Ht.getInterpolatedAttribute(n,o,l,c,d,new me)),r&&(h.uv1=Ht.getInterpolatedAttribute(r,o,l,c,d,new me)),a&&(h.normal=Ht.getInterpolatedAttribute(a,o,l,c,d,new R),h.normal.dot(i.direction)>0&&h.normal.multiplyScalar(-1));const p={a:o,b:l,c,normal:new R,materialIndex:0};Ht.getNormal(ku,Ou,Uu,p.normal),h.face=p,h.barycoord=d}return h}const bx=new R,Mx=new Pt,Sx=new Pt,F3=new R,wx=new qe,Hu=new R,fg=new zi,Ex=new qe,mg=new ks;class gg extends ht{constructor(e,t){super(e,t),this.isSkinnedMesh=!0,this.type="SkinnedMesh",this.bindMode=Lm,this.bindMatrix=new qe,this.bindMatrixInverse=new qe,this.boundingBox=null,this.boundingSphere=null}computeBoundingBox(){const e=this.geometry;this.boundingBox===null&&(this.boundingBox=new gt),this.boundingBox.makeEmpty();const t=e.getAttribute("position");for(let i=0;i<t.count;i++)this.getVertexPosition(i,Hu),this.boundingBox.expandByPoint(Hu)}computeBoundingSphere(){const e=this.geometry;this.boundingSphere===null&&(this.boundingSphere=new zi),this.boundingSphere.makeEmpty();const t=e.getAttribute("position");for(let i=0;i<t.count;i++)this.getVertexPosition(i,Hu),this.boundingSphere.expandByPoint(Hu)}copy(e,t){return super.copy(e,t),this.bindMode=e.bindMode,this.bindMatrix.copy(e.bindMatrix),this.bindMatrixInverse.copy(e.bindMatrixInverse),this.skeleton=e.skeleton,e.boundingBox!==null&&(this.boundingBox=e.boundingBox.clone()),e.boundingSphere!==null&&(this.boundingSphere=e.boundingSphere.clone()),this}raycast(e,t){const i=this.material,n=this.matrixWorld;i!==void 0&&(this.boundingSphere===null&&this.computeBoundingSphere(),fg.copy(this.boundingSphere),fg.applyMatrix4(n),e.ray.intersectsSphere(fg)!==!1&&(Ex.copy(n).invert(),mg.copy(e.ray).applyMatrix4(Ex),!(this.boundingBox!==null&&mg.intersectsBox(this.boundingBox)===!1)&&this._computeIntersections(e,t,mg)))}getVertexPosition(e,t){return super.getVertexPosition(e,t),this.applyBoneTransform(e,t),t}bind(e,t){this.skeleton=e,t===void 0&&(this.updateMatrixWorld(!0),this.skeleton.calculateInverses(),t=this.matrixWorld),this.bindMatrix.copy(t),this.bindMatrixInverse.copy(t).invert()}pose(){this.skeleton.pose()}normalizeSkinWeights(){const e=new Pt,t=this.geometry.attributes.skinWeight;for(let i=0,n=t.count;i<n;i++){e.fromBufferAttribute(t,i);const r=1/e.manhattanLength();r!==1/0?e.multiplyScalar(r):e.set(1,0,0,0),t.setXYZW(i,e.x,e.y,e.z,e.w)}}updateMatrixWorld(e){super.updateMatrixWorld(e),this.bindMode===Lm?this.bindMatrixInverse.copy(this.matrixWorld).invert():this.bindMode===Oy?this.bindMatrixInverse.copy(this.bindMatrix).invert():Ye("SkinnedMesh: Unrecognized bindMode: "+this.bindMode)}applyBoneTransform(e,t){const i=this.skeleton,n=this.geometry;Mx.fromBufferAttribute(n.attributes.skinIndex,e),Sx.fromBufferAttribute(n.attributes.skinWeight,e),bx.copy(t).applyMatrix4(this.bindMatrix),t.set(0,0,0);for(let r=0;r<4;r++){const a=Sx.getComponent(r);if(a!==0){const o=Mx.getComponent(r);wx.multiplyMatrices(i.bones[o].matrixWorld,i.boneInverses[o]),t.addScaledVector(F3.copy(bx).applyMatrix4(wx),a)}}return t.applyMatrix4(this.bindMatrixInverse)}}class Vu extends Rt{constructor(){super(),this.isBone=!0,this.type="Bone"}}class Sn extends ei{constructor(e=null,t=1,i=1,n,r,a,o,l,c=Yt,h=Yt,d,p){super(null,a,o,l,c,h,n,r,d,p),this.isDataTexture=!0,this.image={data:e,width:t,height:i},this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1}}const Tx=new qe,z3=new qe;class jc{constructor(e=[],t=[]){this.uuid=kn(),this.bones=e.slice(0),this.boneInverses=t,this.boneMatrices=null,this.previousBoneMatrices=null,this.boneTexture=null,this.init()}init(){const e=this.bones,t=this.boneInverses;if(this.boneMatrices=new Float32Array(e.length*16),t.length===0)this.calculateInverses();else if(e.length!==t.length){Ye("Skeleton: Number of inverse bone matrices does not match amount of bones."),this.boneInverses=[];for(let i=0,n=this.bones.length;i<n;i++)this.boneInverses.push(new qe)}}calculateInverses(){this.boneInverses.length=0;for(let e=0,t=this.bones.length;e<t;e++){const i=new qe;this.bones[e]&&i.copy(this.bones[e].matrixWorld).invert(),this.boneInverses.push(i)}}pose(){for(let e=0,t=this.bones.length;e<t;e++){const i=this.bones[e];i&&i.matrixWorld.copy(this.boneInverses[e]).invert()}for(let e=0,t=this.bones.length;e<t;e++){const i=this.bones[e];i&&(i.parent&&i.parent.isBone?(i.matrix.copy(i.parent.matrixWorld).invert(),i.matrix.multiply(i.matrixWorld)):i.matrix.copy(i.matrixWorld),i.matrix.decompose(i.position,i.quaternion,i.scale))}}update(){const e=this.bones,t=this.boneInverses,i=this.boneMatrices,n=this.boneTexture;for(let r=0,a=e.length;r<a;r++){const o=e[r]?e[r].matrixWorld:z3;Tx.multiplyMatrices(o,t[r]),Tx.toArray(i,r*16)}n!==null&&(n.needsUpdate=!0)}clone(){return new jc(this.bones,this.boneInverses)}computeBoneTexture(){let e=Math.sqrt(this.bones.length*4);e=Math.ceil(e/4)*4,e=Math.max(e,4);const t=new Float32Array(e*e*4);t.set(this.boneMatrices);const i=new Sn(t,e,e,qi,Pi);return i.needsUpdate=!0,this.boneMatrices=t,this.boneTexture=i,this}getBoneByName(e){for(let t=0,i=this.bones.length;t<i;t++){const n=this.bones[t];if(n.name===e)return n}}dispose(){this.boneTexture!==null&&(this.boneTexture.dispose(),this.boneTexture=null)}fromJSON(e,t){this.uuid=e.uuid;for(let i=0,n=e.bones.length;i<n;i++){const r=e.bones[i];let a=t[r];a===void 0&&(Ye("Skeleton: No bone found with UUID:",r),a=new Vu),this.bones.push(a),this.boneInverses.push(new qe().fromArray(e.boneInverses[i]))}return this.init(),this}toJSON(){const e={metadata:{version:4.7,type:"Skeleton",generator:"Skeleton.toJSON"},bones:[],boneInverses:[]};e.uuid=this.uuid;const t=this.bones,i=this.boneInverses;for(let n=0,r=t.length;n<r;n++){const a=t[n];e.bones.push(a.uuid);const o=i[n];e.boneInverses.push(o.toArray())}return e}}class Gr extends Mt{constructor(e,t,i,n=1){super(e,t,i),this.isInstancedBufferAttribute=!0,this.meshPerAttribute=n}copy(e){return super.copy(e),this.meshPerAttribute=e.meshPerAttribute,this}toJSON(){const e=super.toJSON();return e.meshPerAttribute=this.meshPerAttribute,e.isInstancedBufferAttribute=!0,e}}const ul=new qe,Cx=new qe,Gu=[],Ax=new gt,H3=new qe,qc=new ht,Zc=new zi;class ti extends ht{constructor(e,t,i){super(e,t),this.isInstancedMesh=!0,this.instanceMatrix=new Gr(new Float32Array(i*16),16),this.previousInstanceMatrix=null,this.instanceColor=null,this.morphTexture=null,this.count=i,this.boundingBox=null,this.boundingSphere=null;for(let n=0;n<i;n++)this.setMatrixAt(n,H3)}computeBoundingBox(){const e=this.geometry,t=this.count;this.boundingBox===null&&(this.boundingBox=new gt),e.boundingBox===null&&e.computeBoundingBox(),this.boundingBox.makeEmpty();for(let i=0;i<t;i++)this.getMatrixAt(i,ul),Ax.copy(e.boundingBox).applyMatrix4(ul),this.boundingBox.union(Ax)}computeBoundingSphere(){const e=this.geometry,t=this.count;this.boundingSphere===null&&(this.boundingSphere=new zi),e.boundingSphere===null&&e.computeBoundingSphere(),this.boundingSphere.makeEmpty();for(let i=0;i<t;i++)this.getMatrixAt(i,ul),Zc.copy(e.boundingSphere).applyMatrix4(ul),this.boundingSphere.union(Zc)}copy(e,t){return super.copy(e,t),this.instanceMatrix.copy(e.instanceMatrix),e.previousInstanceMatrix!==null&&(this.previousInstanceMatrix=e.previousInstanceMatrix.clone()),e.morphTexture!==null&&(this.morphTexture=e.morphTexture.clone()),e.instanceColor!==null&&(this.instanceColor=e.instanceColor.clone()),this.count=e.count,e.boundingBox!==null&&(this.boundingBox=e.boundingBox.clone()),e.boundingSphere!==null&&(this.boundingSphere=e.boundingSphere.clone()),this}getColorAt(e,t){t.fromArray(this.instanceColor.array,e*3)}getMatrixAt(e,t){t.fromArray(this.instanceMatrix.array,e*16)}getMorphAt(e,t){const i=t.morphTargetInfluences,n=this.morphTexture.source.data.data,r=i.length+1,a=e*r+1;for(let o=0;o<i.length;o++)i[o]=n[a+o]}raycast(e,t){const i=this.matrixWorld,n=this.count;if(qc.geometry=this.geometry,qc.material=this.material,qc.material!==void 0&&(this.boundingSphere===null&&this.computeBoundingSphere(),Zc.copy(this.boundingSphere),Zc.applyMatrix4(i),e.ray.intersectsSphere(Zc)!==!1))for(let r=0;r<n;r++){this.getMatrixAt(r,ul),Cx.multiplyMatrices(i,ul),qc.matrixWorld=Cx,qc.raycast(e,Gu);for(let a=0,o=Gu.length;a<o;a++){const l=Gu[a];l.instanceId=r,l.object=this,t.push(l)}Gu.length=0}}setColorAt(e,t){this.instanceColor===null&&(this.instanceColor=new Gr(new Float32Array(this.instanceMatrix.count*3).fill(1),3)),t.toArray(this.instanceColor.array,e*3)}setMatrixAt(e,t){t.toArray(this.instanceMatrix.array,e*16)}setMorphAt(e,t){const i=t.morphTargetInfluences,n=i.length+1;this.morphTexture===null&&(this.morphTexture=new Sn(new Float32Array(n*this.count),n,this.count,Mc,Pi));const r=this.morphTexture.source.data.data;let a=0;for(let c=0;c<i.length;c++)a+=i[c];const o=this.geometry.morphTargetsRelative?1:1-a,l=n*e;r[l]=o,r.set(i,l+1)}updateMorphTargets(){}dispose(){this.dispatchEvent({type:"dispose"}),this.morphTexture!==null&&(this.morphTexture.dispose(),this.morphTexture=null)}}const vg=new R,V3=new R,G3=new pt;class $t{constructor(e=new R(1,0,0),t=0){this.isPlane=!0,this.normal=e,this.constant=t}set(e,t){return this.normal.copy(e),this.constant=t,this}setComponents(e,t,i,n){return this.normal.set(e,t,i),this.constant=n,this}setFromNormalAndCoplanarPoint(e,t){return this.normal.copy(e),this.constant=-t.dot(this.normal),this}setFromCoplanarPoints(e,t,i){const n=vg.subVectors(i,t).cross(V3.subVectors(e,t)).normalize();return this.setFromNormalAndCoplanarPoint(n,e),this}copy(e){return this.normal.copy(e.normal),this.constant=e.constant,this}normalize(){const e=1/this.normal.length();return this.normal.multiplyScalar(e),this.constant*=e,this}negate(){return this.constant*=-1,this.normal.negate(),this}distanceToPoint(e){return this.normal.dot(e)+this.constant}distanceToSphere(e){return this.distanceToPoint(e.center)-e.radius}projectPoint(e,t){return t.copy(e).addScaledVector(this.normal,-this.distanceToPoint(e))}intersectLine(e,t){const i=e.delta(vg),n=this.normal.dot(i);if(n===0)return this.distanceToPoint(e.start)===0?t.copy(e.start):null;const r=-(e.start.dot(this.normal)+this.constant)/n;return r<0||r>1?null:t.copy(e.start).addScaledVector(i,r)}intersectsLine(e){const t=this.distanceToPoint(e.start),i=this.distanceToPoint(e.end);return t<0&&i>0||i<0&&t>0}intersectsBox(e){return e.intersectsPlane(this)}intersectsSphere(e){return e.intersectsPlane(this)}coplanarPoint(e){return e.copy(this.normal).multiplyScalar(-this.constant)}applyMatrix4(e,t){const i=t||G3.getNormalMatrix(e),n=this.coplanarPoint(vg).applyMatrix4(e),r=this.normal.applyMatrix3(i).normalize();return this.constant=-n.dot(r),this}translate(e){return this.constant-=e.dot(this.normal),this}equals(e){return e.normal.equals(this.normal)&&e.constant===this.constant}clone(){return new this.constructor().copy(this)}}const ka=new zi,W3=new me(.5,.5),Wu=new R;class pl{constructor(e=new $t,t=new $t,i=new $t,n=new $t,r=new $t,a=new $t){this.planes=[e,t,i,n,r,a]}set(e,t,i,n,r,a){const o=this.planes;return o[0].copy(e),o[1].copy(t),o[2].copy(i),o[3].copy(n),o[4].copy(r),o[5].copy(a),this}copy(e){const t=this.planes;for(let i=0;i<6;i++)t[i].copy(e.planes[i]);return this}setFromProjectionMatrix(e,t=Nn,i=!1){const n=this.planes,r=e.elements,a=r[0],o=r[1],l=r[2],c=r[3],h=r[4],d=r[5],p=r[6],u=r[7],v=r[8],g=r[9],m=r[10],f=r[11],y=r[12],x=r[13],_=r[14],S=r[15];if(n[0].setComponents(c-a,u-h,f-v,S-y).normalize(),n[1].setComponents(c+a,u+h,f+v,S+y).normalize(),n[2].setComponents(c+o,u+d,f+g,S+x).normalize(),n[3].setComponents(c-o,u-d,f-g,S-x).normalize(),i)n[4].setComponents(l,p,m,_).normalize(),n[5].setComponents(c-l,u-p,f-m,S-_).normalize();else if(n[4].setComponents(c-l,u-p,f-m,S-_).normalize(),t===Nn)n[5].setComponents(c+l,u+p,f+m,S+_).normalize();else if(t===Pa)n[5].setComponents(l,p,m,_).normalize();else throw new Error("THREE.Frustum.setFromProjectionMatrix(): Invalid coordinate system: "+t);return this}intersectsObject(e){if(e.boundingSphere!==void 0)e.boundingSphere===null&&e.computeBoundingSphere(),ka.copy(e.boundingSphere).applyMatrix4(e.matrixWorld);else{const t=e.geometry;t.boundingSphere===null&&t.computeBoundingSphere(),ka.copy(t.boundingSphere).applyMatrix4(e.matrixWorld)}return this.intersectsSphere(ka)}intersectsSprite(e){ka.center.set(0,0,0);const t=W3.distanceTo(e.center);return ka.radius=.7071067811865476+t,ka.applyMatrix4(e.matrixWorld),this.intersectsSphere(ka)}intersectsSphere(e){const t=this.planes,i=e.center,n=-e.radius;for(let r=0;r<6;r++)if(t[r].distanceToPoint(i)<n)return!1;return!0}intersectsBox(e){const t=this.planes;for(let i=0;i<6;i++){const n=t[i];if(Wu.x=n.normal.x>0?e.max.x:e.min.x,Wu.y=n.normal.y>0?e.max.y:e.min.y,Wu.z=n.normal.z>0?e.max.z:e.min.z,n.distanceToPoint(Wu)<0)return!1}return!0}containsPoint(e){const t=this.planes;for(let i=0;i<6;i++)if(t[i].distanceToPoint(e)<0)return!1;return!0}clone(){return new this.constructor().copy(this)}}const Os=new qe,Us=new pl;class Xu{constructor(){this.coordinateSystem=Nn}intersectsObject(e,t){if(!t.isArrayCamera||t.cameras.length===0)return!1;for(let i=0;i<t.cameras.length;i++){const n=t.cameras[i];if(Os.multiplyMatrices(n.projectionMatrix,n.matrixWorldInverse),Us.setFromProjectionMatrix(Os,n.coordinateSystem,n.reversedDepth),Us.intersectsObject(e))return!0}return!1}intersectsSprite(e,t){if(!t||!t.cameras||t.cameras.length===0)return!1;for(let i=0;i<t.cameras.length;i++){const n=t.cameras[i];if(Os.multiplyMatrices(n.projectionMatrix,n.matrixWorldInverse),Us.setFromProjectionMatrix(Os,n.coordinateSystem,n.reversedDepth),Us.intersectsSprite(e))return!0}return!1}intersectsSphere(e,t){if(!t||!t.cameras||t.cameras.length===0)return!1;for(let i=0;i<t.cameras.length;i++){const n=t.cameras[i];if(Os.multiplyMatrices(n.projectionMatrix,n.matrixWorldInverse),Us.setFromProjectionMatrix(Os,n.coordinateSystem,n.reversedDepth),Us.intersectsSphere(e))return!0}return!1}intersectsBox(e,t){if(!t||!t.cameras||t.cameras.length===0)return!1;for(let i=0;i<t.cameras.length;i++){const n=t.cameras[i];if(Os.multiplyMatrices(n.projectionMatrix,n.matrixWorldInverse),Us.setFromProjectionMatrix(Os,n.coordinateSystem,n.reversedDepth),Us.intersectsBox(e))return!0}return!1}containsPoint(e,t){if(!t||!t.cameras||t.cameras.length===0)return!1;for(let i=0;i<t.cameras.length;i++){const n=t.cameras[i];if(Os.multiplyMatrices(n.projectionMatrix,n.matrixWorldInverse),Us.setFromProjectionMatrix(Os,n.coordinateSystem,n.reversedDepth),Us.containsPoint(e))return!0}return!1}clone(){return new Xu}}function yg(s,e){return s-e}function X3(s,e){return s.z-e.z}function j3(s,e){return e.z-s.z}class q3{constructor(){this.index=0,this.pool=[],this.list=[]}push(e,t,i,n){const r=this.pool,a=this.list;this.index>=r.length&&r.push({start:-1,count:-1,z:-1,index:-1});const o=r[this.index];a.push(o),this.index++,o.start=e,o.count=t,o.z=i,o.index=n}reset(){this.list.length=0,this.index=0}}const wn=new qe,Z3=new We(1,1,1),Px=new pl,Y3=new Xu,ju=new gt,Oa=new zi,Yc=new R,Rx=new R,$3=new R,xg=new q3,tn=new ht,qu=[];function K3(s,e,t=0){const i=e.itemSize;if(s.isInterleavedBufferAttribute||s.array.constructor!==e.array.constructor){const n=s.count;for(let r=0;r<n;r++)for(let a=0;a<i;a++)e.setComponent(r+t,a,s.getComponent(r,a))}else e.array.set(s.array,t*i);e.needsUpdate=!0}function Ua(s,e){if(s.constructor!==e.constructor){const t=Math.min(s.length,e.length);for(let i=0;i<t;i++)e[i]=s[i]}else{const t=Math.min(s.length,e.length);e.set(new s.constructor(s.buffer,0,t))}}class Lx extends ht{constructor(e,t,i=t*2,n){super(new at,n),this.isBatchedMesh=!0,this.perObjectFrustumCulled=!0,this.sortObjects=!0,this.boundingBox=null,this.boundingSphere=null,this.customSort=null,this._instanceInfo=[],this._geometryInfo=[],this._availableInstanceIds=[],this._availableGeometryIds=[],this._nextIndexStart=0,this._nextVertexStart=0,this._geometryCount=0,this._visibilityChanged=!0,this._geometryInitialized=!1,this._maxInstanceCount=e,this._maxVertexCount=t,this._maxIndexCount=i,this._multiDrawCounts=new Int32Array(e),this._multiDrawStarts=new Int32Array(e),this._multiDrawCount=0,this._multiDrawInstances=null,this._matricesTexture=null,this._indirectTexture=null,this._colorsTexture=null,this._initMatricesTexture(),this._initIndirectTexture()}get maxInstanceCount(){return this._maxInstanceCount}get instanceCount(){return this._instanceInfo.length-this._availableInstanceIds.length}get unusedVertexCount(){return this._maxVertexCount-this._nextVertexStart}get unusedIndexCount(){return this._maxIndexCount-this._nextIndexStart}_initMatricesTexture(){let e=Math.sqrt(this._maxInstanceCount*4);e=Math.ceil(e/4)*4,e=Math.max(e,4);const t=new Float32Array(e*e*4),i=new Sn(t,e,e,qi,Pi);this._matricesTexture=i}_initIndirectTexture(){let e=Math.sqrt(this._maxInstanceCount);e=Math.ceil(e);const t=new Uint32Array(e*e),i=new Sn(t,e,e,Sc,Zn);this._indirectTexture=i}_initColorsTexture(){let e=Math.sqrt(this._maxInstanceCount);e=Math.ceil(e);const t=new Float32Array(e*e*4).fill(1),i=new Sn(t,e,e,qi,Pi);i.colorSpace=wt.workingColorSpace,this._colorsTexture=i}_initializeGeometry(e){const t=this.geometry,i=this._maxVertexCount,n=this._maxIndexCount;if(this._geometryInitialized===!1){for(const r in e.attributes){const a=e.getAttribute(r),{array:o,itemSize:l,normalized:c}=a,h=new o.constructor(i*l),d=new Mt(h,l,c);t.setAttribute(r,d)}if(e.getIndex()!==null){const r=i>65535?new Uint32Array(n):new Uint16Array(n);t.setIndex(new Mt(r,1))}this._geometryInitialized=!0}}_validateGeometry(e){const t=this.geometry;if(!!e.getIndex()!=!!t.getIndex())throw new Error('THREE.BatchedMesh: All geometries must consistently have "index".');for(const i in t.attributes){if(!e.hasAttribute(i))throw new Error(`THREE.BatchedMesh: Added geometry missing "${i}". All geometries must have consistent attributes.`);const n=e.getAttribute(i),r=t.getAttribute(i);if(n.itemSize!==r.itemSize||n.normalized!==r.normalized)throw new Error("THREE.BatchedMesh: All attributes must have a consistent itemSize and normalized value.")}}validateInstanceId(e){const t=this._instanceInfo;if(e<0||e>=t.length||t[e].active===!1)throw new Error(`THREE.BatchedMesh: Invalid instanceId ${e}. Instance is either out of range or has been deleted.`)}validateGeometryId(e){const t=this._geometryInfo;if(e<0||e>=t.length||t[e].active===!1)throw new Error(`THREE.BatchedMesh: Invalid geometryId ${e}. Geometry is either out of range or has been deleted.`)}setCustomSort(e){return this.customSort=e,this}computeBoundingBox(){this.boundingBox===null&&(this.boundingBox=new gt);const e=this.boundingBox,t=this._instanceInfo;e.makeEmpty();for(let i=0,n=t.length;i<n;i++){if(t[i].active===!1)continue;const r=t[i].geometryIndex;this.getMatrixAt(i,wn),this.getBoundingBoxAt(r,ju).applyMatrix4(wn),e.union(ju)}}computeBoundingSphere(){this.boundingSphere===null&&(this.boundingSphere=new zi);const e=this.boundingSphere,t=this._instanceInfo;e.makeEmpty();for(let i=0,n=t.length;i<n;i++){if(t[i].active===!1)continue;const r=t[i].geometryIndex;this.getMatrixAt(i,wn),this.getBoundingSphereAt(r,Oa).applyMatrix4(wn),e.union(Oa)}}addInstance(e){if(this._instanceInfo.length>=this.maxInstanceCount&&this._availableInstanceIds.length===0)throw new Error("THREE.BatchedMesh: Maximum item count reached.");const i={visible:!0,active:!0,geometryIndex:e};let n=null;this._availableInstanceIds.length>0?(this._availableInstanceIds.sort(yg),n=this._availableInstanceIds.shift(),this._instanceInfo[n]=i):(n=this._instanceInfo.length,this._instanceInfo.push(i));const r=this._matricesTexture;wn.identity().toArray(r.image.data,n*16),r.needsUpdate=!0;const a=this._colorsTexture;return a&&(Z3.toArray(a.image.data,n*4),a.needsUpdate=!0),this._visibilityChanged=!0,n}addGeometry(e,t=-1,i=-1){this._initializeGeometry(e),this._validateGeometry(e);const n={vertexStart:-1,vertexCount:-1,reservedVertexCount:-1,indexStart:-1,indexCount:-1,reservedIndexCount:-1,start:-1,count:-1,boundingBox:null,boundingSphere:null,active:!0},r=this._geometryInfo;n.vertexStart=this._nextVertexStart,n.reservedVertexCount=t===-1?e.getAttribute("position").count:t;const a=e.getIndex();if(a!==null&&(n.indexStart=this._nextIndexStart,n.reservedIndexCount=i===-1?a.count:i),n.indexStart!==-1&&n.indexStart+n.reservedIndexCount>this._maxIndexCount||n.vertexStart+n.reservedVertexCount>this._maxVertexCount)throw new Error("THREE.BatchedMesh: Reserved space request exceeds the maximum buffer size.");let l;return this._availableGeometryIds.length>0?(this._availableGeometryIds.sort(yg),l=this._availableGeometryIds.shift(),r[l]=n):(l=this._geometryCount,this._geometryCount++,r.push(n)),this.setGeometryAt(l,e),this._nextIndexStart=n.indexStart+n.reservedIndexCount,this._nextVertexStart=n.vertexStart+n.reservedVertexCount,l}setGeometryAt(e,t){if(e>=this._geometryCount)throw new Error("THREE.BatchedMesh: Maximum geometry count reached.");this._validateGeometry(t);const i=this.geometry,n=i.getIndex()!==null,r=i.getIndex(),a=t.getIndex(),o=this._geometryInfo[e];if(n&&a.count>o.reservedIndexCount||t.attributes.position.count>o.reservedVertexCount)throw new Error("THREE.BatchedMesh: Reserved space not large enough for provided geometry.");const l=o.vertexStart,c=o.reservedVertexCount;o.vertexCount=t.getAttribute("position").count;for(const h in i.attributes){const d=t.getAttribute(h),p=i.getAttribute(h);K3(d,p,l);const u=d.itemSize;for(let v=d.count,g=c;v<g;v++){const m=l+v;for(let f=0;f<u;f++)p.setComponent(m,f,0)}p.needsUpdate=!0,p.addUpdateRange(l*u,c*u)}if(n){const h=o.indexStart,d=o.reservedIndexCount;o.indexCount=t.getIndex().count;for(let p=0;p<a.count;p++)r.setX(h+p,l+a.getX(p));for(let p=a.count,u=d;p<u;p++)r.setX(h+p,l);r.needsUpdate=!0,r.addUpdateRange(h,o.reservedIndexCount)}return o.start=n?o.indexStart:o.vertexStart,o.count=n?o.indexCount:o.vertexCount,o.boundingBox=null,t.boundingBox!==null&&(o.boundingBox=t.boundingBox.clone()),o.boundingSphere=null,t.boundingSphere!==null&&(o.boundingSphere=t.boundingSphere.clone()),this._visibilityChanged=!0,e}deleteGeometry(e){const t=this._geometryInfo;if(e>=t.length||t[e].active===!1)return this;const i=this._instanceInfo;for(let n=0,r=i.length;n<r;n++)i[n].active&&i[n].geometryIndex===e&&this.deleteInstance(n);return t[e].active=!1,this._availableGeometryIds.push(e),this._visibilityChanged=!0,this}deleteInstance(e){return this.validateInstanceId(e),this._instanceInfo[e].active=!1,this._availableInstanceIds.push(e),this._visibilityChanged=!0,this}optimize(){let e=0,t=0;const i=this._geometryInfo,n=i.map((a,o)=>o).sort((a,o)=>i[a].vertexStart-i[o].vertexStart),r=this.geometry;for(let a=0,o=i.length;a<o;a++){const l=n[a],c=i[l];if(c.active!==!1){if(r.index!==null){if(c.indexStart!==t){const{indexStart:h,vertexStart:d,reservedIndexCount:p}=c,u=r.index,v=u.array,g=e-d;for(let m=h;m<h+p;m++)v[m]=v[m]+g;u.array.copyWithin(t,h,h+p),u.addUpdateRange(t,p),u.needsUpdate=!0,c.indexStart=t}t+=c.reservedIndexCount}if(c.vertexStart!==e){const{vertexStart:h,reservedVertexCount:d}=c,p=r.attributes;for(const u in p){const v=p[u],{array:g,itemSize:m}=v;g.copyWithin(e*m,h*m,(h+d)*m),v.addUpdateRange(e*m,d*m),v.needsUpdate=!0}c.vertexStart=e}e+=c.reservedVertexCount,c.start=r.index?c.indexStart:c.vertexStart}}return this._nextIndexStart=t,this._nextVertexStart=e,this._visibilityChanged=!0,this}getBoundingBoxAt(e,t){if(e>=this._geometryCount)return null;const i=this.geometry,n=this._geometryInfo[e];if(n.boundingBox===null){const r=new gt,a=i.index,o=i.attributes.position;for(let l=n.start,c=n.start+n.count;l<c;l++){let h=l;a&&(h=a.getX(h)),r.expandByPoint(Yc.fromBufferAttribute(o,h))}n.boundingBox=r}return t.copy(n.boundingBox),t}getBoundingSphereAt(e,t){if(e>=this._geometryCount)return null;const i=this.geometry,n=this._geometryInfo[e];if(n.boundingSphere===null){const r=new zi;this.getBoundingBoxAt(e,ju),ju.getCenter(r.center);const a=i.index,o=i.attributes.position;let l=0;for(let c=n.start,h=n.start+n.count;c<h;c++){let d=c;a&&(d=a.getX(d)),Yc.fromBufferAttribute(o,d),l=Math.max(l,r.center.distanceToSquared(Yc))}r.radius=Math.sqrt(l),n.boundingSphere=r}return t.copy(n.boundingSphere),t}setMatrixAt(e,t){this.validateInstanceId(e);const i=this._matricesTexture,n=this._matricesTexture.image.data;return t.toArray(n,e*16),i.needsUpdate=!0,this}getMatrixAt(e,t){return this.validateInstanceId(e),t.fromArray(this._matricesTexture.image.data,e*16)}setColorAt(e,t){return this.validateInstanceId(e),this._colorsTexture===null&&this._initColorsTexture(),t.toArray(this._colorsTexture.image.data,e*4),this._colorsTexture.needsUpdate=!0,this}getColorAt(e,t){return this.validateInstanceId(e),t.fromArray(this._colorsTexture.image.data,e*4)}setVisibleAt(e,t){return this.validateInstanceId(e),this._instanceInfo[e].visible===t?this:(this._instanceInfo[e].visible=t,this._visibilityChanged=!0,this)}getVisibleAt(e){return this.validateInstanceId(e),this._instanceInfo[e].visible}setGeometryIdAt(e,t){return this.validateInstanceId(e),this.validateGeometryId(t),this._instanceInfo[e].geometryIndex=t,this}getGeometryIdAt(e){return this.validateInstanceId(e),this._instanceInfo[e].geometryIndex}getGeometryRangeAt(e,t={}){this.validateGeometryId(e);const i=this._geometryInfo[e];return t.vertexStart=i.vertexStart,t.vertexCount=i.vertexCount,t.reservedVertexCount=i.reservedVertexCount,t.indexStart=i.indexStart,t.indexCount=i.indexCount,t.reservedIndexCount=i.reservedIndexCount,t.start=i.start,t.count=i.count,t}setInstanceCount(e){const t=this._availableInstanceIds,i=this._instanceInfo;for(t.sort(yg);t[t.length-1]===i.length-1;)i.pop(),t.pop();if(e<i.length)throw new Error(`BatchedMesh: Instance ids outside the range ${e} are being used. Cannot shrink instance count.`);const n=new Int32Array(e),r=new Int32Array(e);Ua(this._multiDrawCounts,n),Ua(this._multiDrawStarts,r),this._multiDrawCounts=n,this._multiDrawStarts=r,this._maxInstanceCount=e;const a=this._indirectTexture,o=this._matricesTexture,l=this._colorsTexture;a.dispose(),this._initIndirectTexture(),Ua(a.image.data,this._indirectTexture.image.data),o.dispose(),this._initMatricesTexture(),Ua(o.image.data,this._matricesTexture.image.data),l&&(l.dispose(),this._initColorsTexture(),Ua(l.image.data,this._colorsTexture.image.data))}setGeometrySize(e,t){const i=[...this._geometryInfo].filter(o=>o.active);if(Math.max(...i.map(o=>o.vertexStart+o.reservedVertexCount))>e)throw new Error(`BatchedMesh: Geometry vertex values are being used outside the range ${t}. Cannot shrink further.`);if(this.geometry.index&&Math.max(...i.map(l=>l.indexStart+l.reservedIndexCount))>t)throw new Error(`BatchedMesh: Geometry index values are being used outside the range ${t}. Cannot shrink further.`);const r=this.geometry;r.dispose(),this._maxVertexCount=e,this._maxIndexCount=t,this._geometryInitialized&&(this._geometryInitialized=!1,this.geometry=new at,this._initializeGeometry(r));const a=this.geometry;r.index&&Ua(r.index.array,a.index.array);for(const o in r.attributes)Ua(r.attributes[o].array,a.attributes[o].array)}raycast(e,t){const i=this._instanceInfo,n=this._geometryInfo,r=this.matrixWorld,a=this.geometry;tn.material=this.material,tn.geometry.index=a.index,tn.geometry.attributes=a.attributes,tn.geometry.boundingBox===null&&(tn.geometry.boundingBox=new gt),tn.geometry.boundingSphere===null&&(tn.geometry.boundingSphere=new zi);for(let o=0,l=i.length;o<l;o++){if(!i[o].visible||!i[o].active)continue;const c=i[o].geometryIndex,h=n[c];tn.geometry.setDrawRange(h.start,h.count),this.getMatrixAt(o,tn.matrixWorld).premultiply(r),this.getBoundingBoxAt(c,tn.geometry.boundingBox),this.getBoundingSphereAt(c,tn.geometry.boundingSphere),tn.raycast(e,qu);for(let d=0,p=qu.length;d<p;d++){const u=qu[d];u.object=this,u.batchId=o,t.push(u)}qu.length=0}tn.material=null,tn.geometry.index=null,tn.geometry.attributes={},tn.geometry.setDrawRange(0,1/0)}copy(e){return super.copy(e),this.geometry=e.geometry.clone(),this.perObjectFrustumCulled=e.perObjectFrustumCulled,this.sortObjects=e.sortObjects,this.boundingBox=e.boundingBox!==null?e.boundingBox.clone():null,this.boundingSphere=e.boundingSphere!==null?e.boundingSphere.clone():null,this._geometryInfo=e._geometryInfo.map(t=>({...t,boundingBox:t.boundingBox!==null?t.boundingBox.clone():null,boundingSphere:t.boundingSphere!==null?t.boundingSphere.clone():null})),this._instanceInfo=e._instanceInfo.map(t=>({...t})),this._availableInstanceIds=e._availableInstanceIds.slice(),this._availableGeometryIds=e._availableGeometryIds.slice(),this._nextIndexStart=e._nextIndexStart,this._nextVertexStart=e._nextVertexStart,this._geometryCount=e._geometryCount,this._maxInstanceCount=e._maxInstanceCount,this._maxVertexCount=e._maxVertexCount,this._maxIndexCount=e._maxIndexCount,this._geometryInitialized=e._geometryInitialized,this._multiDrawCounts=e._multiDrawCounts.slice(),this._multiDrawStarts=e._multiDrawStarts.slice(),this._indirectTexture=e._indirectTexture.clone(),this._indirectTexture.image.data=this._indirectTexture.image.data.slice(),this._matricesTexture=e._matricesTexture.clone(),this._matricesTexture.image.data=this._matricesTexture.image.data.slice(),this._colorsTexture!==null&&(this._colorsTexture=e._colorsTexture.clone(),this._colorsTexture.image.data=this._colorsTexture.image.data.slice()),this}dispose(){this.geometry.dispose(),this._matricesTexture.dispose(),this._matricesTexture=null,this._indirectTexture.dispose(),this._indirectTexture=null,this._colorsTexture!==null&&(this._colorsTexture.dispose(),this._colorsTexture=null)}onBeforeRender(e,t,i,n,r){if(!this._visibilityChanged&&!this.perObjectFrustumCulled&&!this.sortObjects)return;const a=n.getIndex();let o=a===null?1:a.array.BYTES_PER_ELEMENT,l=1;r.wireframe&&(l=2,o=n.attributes.position.count>65535?4:2);const c=this._instanceInfo,h=this._multiDrawStarts,d=this._multiDrawCounts,p=this._geometryInfo,u=this.perObjectFrustumCulled,v=this._indirectTexture,g=v.image.data,m=i.isArrayCamera?Y3:Px;u&&!i.isArrayCamera&&(wn.multiplyMatrices(i.projectionMatrix,i.matrixWorldInverse).multiply(this.matrixWorld),Px.setFromProjectionMatrix(wn,i.coordinateSystem,i.reversedDepth));let f=0;if(this.sortObjects){wn.copy(this.matrixWorld).invert(),Yc.setFromMatrixPosition(i.matrixWorld).applyMatrix4(wn),Rx.set(0,0,-1).transformDirection(i.matrixWorld).transformDirection(wn);for(let _=0,S=c.length;_<S;_++)if(c[_].visible&&c[_].active){const b=c[_].geometryIndex;this.getMatrixAt(_,wn),this.getBoundingSphereAt(b,Oa).applyMatrix4(wn);let E=!1;if(u&&(E=!m.intersectsSphere(Oa,i)),!E){const w=p[b],M=$3.subVectors(Oa.center,Yc).dot(Rx);xg.push(w.start,w.count,M,_)}}const y=xg.list,x=this.customSort;x===null?y.sort(r.transparent?j3:X3):x.call(this,y,i);for(let _=0,S=y.length;_<S;_++){const b=y[_];h[f]=b.start*o*l,d[f]=b.count*l,g[f]=b.index,f++}xg.reset()}else for(let y=0,x=c.length;y<x;y++)if(c[y].visible&&c[y].active){const _=c[y].geometryIndex;let S=!1;if(u&&(this.getMatrixAt(y,wn),this.getBoundingSphereAt(_,Oa).applyMatrix4(wn),S=!m.intersectsSphere(Oa,i)),!S){const b=p[_];h[f]=b.start*o*l,d[f]=b.count*l,g[f]=y,f++}}v.needsUpdate=!0,this._multiDrawCount=f,this._visibilityChanged=!1}onBeforeShadow(e,t,i,n,r,a){this.onBeforeRender(e,null,n,r,a)}}class si extends Ri{constructor(e){super(),this.isLineBasicMaterial=!0,this.type="LineBasicMaterial",this.color=new We(16777215),this.map=null,this.linewidth=1,this.linecap="round",this.linejoin="round",this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.map=e.map,this.linewidth=e.linewidth,this.linecap=e.linecap,this.linejoin=e.linejoin,this.fog=e.fog,this}}const Zu=new R,Yu=new R,Ix=new qe,$c=new ks,$u=new zi,_g=new R,Dx=new R;class pn extends Rt{constructor(e=new at,t=new si){super(),this.isLine=!0,this.type="Line",this.geometry=e,this.material=t,this.morphTargetDictionary=void 0,this.morphTargetInfluences=void 0,this.updateMorphTargets()}copy(e,t){return super.copy(e,t),this.material=Array.isArray(e.material)?e.material.slice():e.material,this.geometry=e.geometry,this}computeLineDistances(){const e=this.geometry;if(e.index===null){const t=e.attributes.position,i=[0];for(let n=1,r=t.count;n<r;n++)Zu.fromBufferAttribute(t,n-1),Yu.fromBufferAttribute(t,n),i[n]=i[n-1],i[n]+=Zu.distanceTo(Yu);e.setAttribute("lineDistance",new et(i,1))}else Ye("Line.computeLineDistances(): Computation only possible with non-indexed BufferGeometry.");return this}raycast(e,t){const i=this.geometry,n=this.matrixWorld,r=e.params.Line.threshold,a=i.drawRange;if(i.boundingSphere===null&&i.computeBoundingSphere(),$u.copy(i.boundingSphere),$u.applyMatrix4(n),$u.radius+=r,e.ray.intersectsSphere($u)===!1)return;Ix.copy(n).invert(),$c.copy(e.ray).applyMatrix4(Ix);const o=r/((this.scale.x+this.scale.y+this.scale.z)/3),l=o*o,c=this.isLineSegments?2:1,h=i.index,p=i.attributes.position;if(h!==null){const u=Math.max(0,a.start),v=Math.min(h.count,a.start+a.count);for(let g=u,m=v-1;g<m;g+=c){const f=h.getX(g),y=h.getX(g+1),x=Ku(this,e,$c,l,f,y,g);x&&t.push(x)}if(this.isLineLoop){const g=h.getX(v-1),m=h.getX(u),f=Ku(this,e,$c,l,g,m,v-1);f&&t.push(f)}}else{const u=Math.max(0,a.start),v=Math.min(p.count,a.start+a.count);for(let g=u,m=v-1;g<m;g+=c){const f=Ku(this,e,$c,l,g,g+1,g);f&&t.push(f)}if(this.isLineLoop){const g=Ku(this,e,$c,l,v-1,u,v-1);g&&t.push(g)}}}updateMorphTargets(){const t=this.geometry.morphAttributes,i=Object.keys(t);if(i.length>0){const n=t[i[0]];if(n!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let r=0,a=n.length;r<a;r++){const o=n[r].name||String(r);this.morphTargetInfluences.push(0),this.morphTargetDictionary[o]=r}}}}}function Ku(s,e,t,i,n,r,a){const o=s.geometry.attributes.position;if(Zu.fromBufferAttribute(o,n),Yu.fromBufferAttribute(o,r),t.distanceSqToSegment(Zu,Yu,_g,Dx)>i)return;_g.applyMatrix4(s.matrixWorld);const c=e.ray.origin.distanceTo(_g);if(!(c<e.near||c>e.far))return{distance:c,point:Dx.clone().applyMatrix4(s.matrixWorld),index:a,face:null,faceIndex:null,barycoord:null,object:s}}const Nx=new R,kx=new R;class fi extends pn{constructor(e,t){super(e,t),this.isLineSegments=!0,this.type="LineSegments"}computeLineDistances(){const e=this.geometry;if(e.index===null){const t=e.attributes.position,i=[];for(let n=0,r=t.count;n<r;n+=2)Nx.fromBufferAttribute(t,n),kx.fromBufferAttribute(t,n+1),i[n]=n===0?0:i[n-1],i[n+1]=i[n]+Nx.distanceTo(kx);e.setAttribute("lineDistance",new et(i,1))}else Ye("LineSegments.computeLineDistances(): Computation only possible with non-indexed BufferGeometry.");return this}}class bg extends pn{constructor(e,t){super(e,t),this.isLineLoop=!0,this.type="LineLoop"}}class Ju extends Ri{constructor(e){super(),this.isPointsMaterial=!0,this.type="PointsMaterial",this.color=new We(16777215),this.map=null,this.alphaMap=null,this.size=1,this.sizeAttenuation=!0,this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.map=e.map,this.alphaMap=e.alphaMap,this.size=e.size,this.sizeAttenuation=e.sizeAttenuation,this.fog=e.fog,this}}const Ox=new qe,Mg=new ks,Qu=new zi,ep=new R;class tp extends Rt{constructor(e=new at,t=new Ju){super(),this.isPoints=!0,this.type="Points",this.geometry=e,this.material=t,this.morphTargetDictionary=void 0,this.morphTargetInfluences=void 0,this.updateMorphTargets()}copy(e,t){return super.copy(e,t),this.material=Array.isArray(e.material)?e.material.slice():e.material,this.geometry=e.geometry,this}raycast(e,t){const i=this.geometry,n=this.matrixWorld,r=e.params.Points.threshold,a=i.drawRange;if(i.boundingSphere===null&&i.computeBoundingSphere(),Qu.copy(i.boundingSphere),Qu.applyMatrix4(n),Qu.radius+=r,e.ray.intersectsSphere(Qu)===!1)return;Ox.copy(n).invert(),Mg.copy(e.ray).applyMatrix4(Ox);const o=r/((this.scale.x+this.scale.y+this.scale.z)/3),l=o*o,c=i.index,d=i.attributes.position;if(c!==null){const p=Math.max(0,a.start),u=Math.min(c.count,a.start+a.count);for(let v=p,g=u;v<g;v++){const m=c.getX(v);ep.fromBufferAttribute(d,m),Ux(ep,m,l,n,e,t,this)}}else{const p=Math.max(0,a.start),u=Math.min(d.count,a.start+a.count);for(let v=p,g=u;v<g;v++)ep.fromBufferAttribute(d,v),Ux(ep,v,l,n,e,t,this)}}updateMorphTargets(){const t=this.geometry.morphAttributes,i=Object.keys(t);if(i.length>0){const n=t[i[0]];if(n!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let r=0,a=n.length;r<a;r++){const o=n[r].name||String(r);this.morphTargetInfluences.push(0),this.morphTargetDictionary[o]=r}}}}}function Ux(s,e,t,i,n,r,a){const o=Mg.distanceSqToPoint(s);if(o<t){const l=new R;Mg.closestPointToPoint(s,l),l.applyMatrix4(i);const c=n.ray.origin.distanceTo(l);if(c<n.near||c>n.far)return;r.push({distance:c,distanceToRay:Math.sqrt(o),point:l,index:e,face:null,faceIndex:null,barycoord:null,object:a})}}class Bx extends ei{constructor(e,t,i,n,r=At,a=At,o,l,c){super(e,t,i,n,r,a,o,l,c),this.isVideoTexture=!0,this.generateMipmaps=!1,this._requestVideoFrameCallbackId=0;const h=this;function d(){h.needsUpdate=!0,h._requestVideoFrameCallbackId=e.requestVideoFrameCallback(d)}"requestVideoFrameCallback"in e&&(this._requestVideoFrameCallbackId=e.requestVideoFrameCallback(d))}clone(){return new this.constructor(this.image).copy(this)}update(){const e=this.image;"requestVideoFrameCallback"in e===!1&&e.readyState>=e.HAVE_CURRENT_DATA&&(this.needsUpdate=!0)}dispose(){this._requestVideoFrameCallbackId!==0&&(this.source.data.cancelVideoFrameCallback(this._requestVideoFrameCallbackId),this._requestVideoFrameCallbackId=0),super.dispose()}}class J3 extends Bx{constructor(e,t,i,n,r,a,o,l){super({},e,t,i,n,r,a,o,l),this.isVideoFrameTexture=!0}update(){}clone(){return new this.constructor().copy(this)}setFrame(e){this.image=e,this.needsUpdate=!0}}class Q3 extends ei{constructor(e,t){super({width:e,height:t}),this.isFramebufferTexture=!0,this.magFilter=Yt,this.minFilter=Yt,this.generateMipmaps=!1,this.needsUpdate=!0}}class ip extends ei{constructor(e,t,i,n,r,a,o,l,c,h,d,p){super(null,a,o,l,c,h,n,r,d,p),this.isCompressedTexture=!0,this.image={width:t,height:i},this.mipmaps=e,this.flipY=!1,this.generateMipmaps=!1}}class eT extends ip{constructor(e,t,i,n,r,a){super(e,t,i,r,a),this.isCompressedArrayTexture=!0,this.image.depth=n,this.wrapR=cn,this.layerUpdates=new Set}addLayerUpdate(e){this.layerUpdates.add(e)}clearLayerUpdates(){this.layerUpdates.clear()}}class tT extends ip{constructor(e,t,i){super(void 0,e[0].width,e[0].height,t,i,Is),this.isCompressedCubeTexture=!0,this.isCubeTexture=!0,this.image=e}}class Kc extends ei{constructor(e=[],t=Is,i,n,r,a,o,l,c,h){super(e,t,i,n,r,a,o,l,c,h),this.isCubeTexture=!0,this.flipY=!1}get images(){return this.image}set images(e){this.image=e}}class Fx extends ei{constructor(e,t,i,n,r,a,o,l,c){super(e,t,i,n,r,a,o,l,c),this.isCanvasTexture=!0,this.needsUpdate=!0}}class Wr extends ei{constructor(e,t,i=Zn,n,r,a,o=Yt,l=Yt,c,h=Ds,d=1){if(h!==Ds&&h!==Ns)throw new Error("DepthTexture format must be either THREE.DepthFormat or THREE.DepthStencilFormat");const p={width:e,height:t,depth:d};super(p,n,r,a,o,l,h,i,c),this.isDepthTexture=!0,this.flipY=!1,this.generateMipmaps=!1,this.compareFunction=null}copy(e){return super.copy(e),this.source=new Or(Object.assign({},e.image)),this.compareFunction=e.compareFunction,this}toJSON(e){const t=super.toJSON(e);return this.compareFunction!==null&&(t.compareFunction=this.compareFunction),t}}class zx extends Wr{constructor(e,t=Zn,i=Is,n,r,a=Yt,o=Yt,l,c=Ds){const h={width:e,height:e,depth:1},d=[h,h,h,h,h,h];super(e,e,t,i,n,r,a,o,l,c),this.image=d,this.isCubeDepthTexture=!0,this.isCubeTexture=!0}get images(){return this.image}set images(e){this.image=e}}class Sg extends ei{constructor(e=null){super(),this.sourceTexture=e,this.isExternalTexture=!0}copy(e){return super.copy(e),this.sourceTexture=e.sourceTexture,this}}class fs extends at{constructor(e=1,t=1,i=1,n=1,r=1,a=1){super(),this.type="BoxGeometry",this.parameters={width:e,height:t,depth:i,widthSegments:n,heightSegments:r,depthSegments:a};const o=this;n=Math.floor(n),r=Math.floor(r),a=Math.floor(a);const l=[],c=[],h=[],d=[];let p=0,u=0;v("z","y","x",-1,-1,i,t,e,a,r,0),v("z","y","x",1,-1,i,t,-e,a,r,1),v("x","z","y",1,1,e,i,t,n,a,2),v("x","z","y",1,-1,e,i,-t,n,a,3),v("x","y","z",1,-1,e,t,i,n,r,4),v("x","y","z",-1,-1,e,t,-i,n,r,5),this.setIndex(l),this.setAttribute("position",new et(c,3)),this.setAttribute("normal",new et(h,3)),this.setAttribute("uv",new et(d,2));function v(g,m,f,y,x,_,S,b,E,w,M){const C=_/E,L=S/w,P=_/2,k=S/2,A=b/2,B=E+1,F=w+1;let H=0,q=0;const G=new R;for(let re=0;re<F;re++){const Y=re*L-k;for(let $=0;$<B;$++){const _e=$*C-P;G[g]=_e*y,G[m]=Y*x,G[f]=A,c.push(G.x,G.y,G.z),G[g]=0,G[m]=0,G[f]=b>0?1:-1,h.push(G.x,G.y,G.z),d.push($/E),d.push(1-re/w),H+=1}}for(let re=0;re<w;re++)for(let Y=0;Y<E;Y++){const $=p+Y+B*re,_e=p+Y+B*(re+1),Te=p+(Y+1)+B*(re+1),be=p+(Y+1)+B*re;l.push($,_e,be),l.push(_e,Te,be),q+=6}o.addGroup(u,q,M),u+=q,p+=H}}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}static fromJSON(e){return new fs(e.width,e.height,e.depth,e.widthSegments,e.heightSegments,e.depthSegments)}}class np extends at{constructor(e=1,t=1,i=4,n=8,r=1){super(),this.type="CapsuleGeometry",this.parameters={radius:e,height:t,capSegments:i,radialSegments:n,heightSegments:r},t=Math.max(0,t),i=Math.max(1,Math.floor(i)),n=Math.max(3,Math.floor(n)),r=Math.max(1,Math.floor(r));const a=[],o=[],l=[],c=[],h=t/2,d=Math.PI/2*e,p=t,u=2*d+p,v=i*2+r,g=n+1,m=new R,f=new R;for(let y=0;y<=v;y++){let x=0,_=0,S=0,b=0;if(y<=i){const M=y/i,C=M*Math.PI/2;_=-h-e*Math.cos(C),S=e*Math.sin(C),b=-e*Math.cos(C),x=M*d}else if(y<=i+r){const M=(y-i)/r;_=-h+M*t,S=e,b=0,x=d+M*p}else{const M=(y-i-r)/i,C=M*Math.PI/2;_=h+e*Math.sin(C),S=e*Math.cos(C),b=e*Math.sin(C),x=d+p+M*d}const E=Math.max(0,Math.min(1,x/u));let w=0;y===0?w=.5/n:y===v&&(w=-.5/n);for(let M=0;M<=n;M++){const C=M/n,L=C*Math.PI*2,P=Math.sin(L),k=Math.cos(L);f.x=-S*k,f.y=_,f.z=S*P,o.push(f.x,f.y,f.z),m.set(-S*k,b,S*P),m.normalize(),l.push(m.x,m.y,m.z),c.push(C+w,E)}if(y>0){const M=(y-1)*g;for(let C=0;C<n;C++){const L=M+C,P=M+C+1,k=y*g+C,A=y*g+C+1;a.push(L,P,k),a.push(P,A,k)}}}this.setIndex(a),this.setAttribute("position",new et(o,3)),this.setAttribute("normal",new et(l,3)),this.setAttribute("uv",new et(c,2))}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}static fromJSON(e){return new np(e.radius,e.height,e.capSegments,e.radialSegments,e.heightSegments)}}class sp extends at{constructor(e=1,t=32,i=0,n=Math.PI*2){super(),this.type="CircleGeometry",this.parameters={radius:e,segments:t,thetaStart:i,thetaLength:n},t=Math.max(3,t);const r=[],a=[],o=[],l=[],c=new R,h=new me;a.push(0,0,0),o.push(0,0,1),l.push(.5,.5);for(let d=0,p=3;d<=t;d++,p+=3){const u=i+d/t*n;c.x=e*Math.cos(u),c.y=e*Math.sin(u),a.push(c.x,c.y,c.z),o.push(0,0,1),h.x=(a[p]/e+1)/2,h.y=(a[p+1]/e+1)/2,l.push(h.x,h.y)}for(let d=1;d<=t;d++)r.push(d,d+1,0);this.setIndex(r),this.setAttribute("position",new et(a,3)),this.setAttribute("normal",new et(o,3)),this.setAttribute("uv",new et(l,2))}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}static fromJSON(e){return new sp(e.radius,e.segments,e.thetaStart,e.thetaLength)}}class Jc extends at{constructor(e=1,t=1,i=1,n=32,r=1,a=!1,o=0,l=Math.PI*2){super(),this.type="CylinderGeometry",this.parameters={radiusTop:e,radiusBottom:t,height:i,radialSegments:n,heightSegments:r,openEnded:a,thetaStart:o,thetaLength:l};const c=this;n=Math.floor(n),r=Math.floor(r);const h=[],d=[],p=[],u=[];let v=0;const g=[],m=i/2;let f=0;y(),a===!1&&(e>0&&x(!0),t>0&&x(!1)),this.setIndex(h),this.setAttribute("position",new et(d,3)),this.setAttribute("normal",new et(p,3)),this.setAttribute("uv",new et(u,2));function y(){const _=new R,S=new R;let b=0;const E=(t-e)/i;for(let w=0;w<=r;w++){const M=[],C=w/r,L=C*(t-e)+e;for(let P=0;P<=n;P++){const k=P/n,A=k*l+o,B=Math.sin(A),F=Math.cos(A);S.x=L*B,S.y=-C*i+m,S.z=L*F,d.push(S.x,S.y,S.z),_.set(B,E,F).normalize(),p.push(_.x,_.y,_.z),u.push(k,1-C),M.push(v++)}g.push(M)}for(let w=0;w<n;w++)for(let M=0;M<r;M++){const C=g[M][w],L=g[M+1][w],P=g[M+1][w+1],k=g[M][w+1];(e>0||M!==0)&&(h.push(C,L,k),b+=3),(t>0||M!==r-1)&&(h.push(L,P,k),b+=3)}c.addGroup(f,b,0),f+=b}function x(_){const S=v,b=new me,E=new R;let w=0;const M=_===!0?e:t,C=_===!0?1:-1;for(let P=1;P<=n;P++)d.push(0,m*C,0),p.push(0,C,0),u.push(.5,.5),v++;const L=v;for(let P=0;P<=n;P++){const A=P/n*l+o,B=Math.cos(A),F=Math.sin(A);E.x=M*F,E.y=m*C,E.z=M*B,d.push(E.x,E.y,E.z),p.push(0,C,0),b.x=B*.5+.5,b.y=F*.5*C+.5,u.push(b.x,b.y),v++}for(let P=0;P<n;P++){const k=S+P,A=L+P;_===!0?h.push(A,A+1,k):h.push(A+1,A,k),w+=3}c.addGroup(f,w,_===!0?1:2),f+=w}}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}static fromJSON(e){return new Jc(e.radiusTop,e.radiusBottom,e.height,e.radialSegments,e.heightSegments,e.openEnded,e.thetaStart,e.thetaLength)}}class Qc extends Jc{constructor(e=1,t=1,i=32,n=1,r=!1,a=0,o=Math.PI*2){super(0,e,t,i,n,r,a,o),this.type="ConeGeometry",this.parameters={radius:e,height:t,radialSegments:i,heightSegments:n,openEnded:r,thetaStart:a,thetaLength:o}}static fromJSON(e){return new Qc(e.radius,e.height,e.radialSegments,e.heightSegments,e.openEnded,e.thetaStart,e.thetaLength)}}class Xr extends at{constructor(e=[],t=[],i=1,n=0){super(),this.type="PolyhedronGeometry",this.parameters={vertices:e,indices:t,radius:i,detail:n};const r=[],a=[];o(n),c(i),h(),this.setAttribute("position",new et(r,3)),this.setAttribute("normal",new et(r.slice(),3)),this.setAttribute("uv",new et(a,2)),n===0?this.computeVertexNormals():this.normalizeNormals();function o(y){const x=new R,_=new R,S=new R;for(let b=0;b<t.length;b+=3)u(t[b+0],x),u(t[b+1],_),u(t[b+2],S),l(x,_,S,y)}function l(y,x,_,S){const b=S+1,E=[];for(let w=0;w<=b;w++){E[w]=[];const M=y.clone().lerp(_,w/b),C=x.clone().lerp(_,w/b),L=b-w;for(let P=0;P<=L;P++)P===0&&w===b?E[w][P]=M:E[w][P]=M.clone().lerp(C,P/L)}for(let w=0;w<b;w++)for(let M=0;M<2*(b-w)-1;M++){const C=Math.floor(M/2);M%2===0?(p(E[w][C+1]),p(E[w+1][C]),p(E[w][C])):(p(E[w][C+1]),p(E[w+1][C+1]),p(E[w+1][C]))}}function c(y){const x=new R;for(let _=0;_<r.length;_+=3)x.x=r[_+0],x.y=r[_+1],x.z=r[_+2],x.normalize().multiplyScalar(y),r[_+0]=x.x,r[_+1]=x.y,r[_+2]=x.z}function h(){const y=new R;for(let x=0;x<r.length;x+=3){y.x=r[x+0],y.y=r[x+1],y.z=r[x+2];const _=m(y)/2/Math.PI+.5,S=f(y)/Math.PI+.5;a.push(_,1-S)}v(),d()}function d(){for(let y=0;y<a.length;y+=6){const x=a[y+0],_=a[y+2],S=a[y+4],b=Math.max(x,_,S),E=Math.min(x,_,S);b>.9&&E<.1&&(x<.2&&(a[y+0]+=1),_<.2&&(a[y+2]+=1),S<.2&&(a[y+4]+=1))}}function p(y){r.push(y.x,y.y,y.z)}function u(y,x){const _=y*3;x.x=e[_+0],x.y=e[_+1],x.z=e[_+2]}function v(){const y=new R,x=new R,_=new R,S=new R,b=new me,E=new me,w=new me;for(let M=0,C=0;M<r.length;M+=9,C+=6){y.set(r[M+0],r[M+1],r[M+2]),x.set(r[M+3],r[M+4],r[M+5]),_.set(r[M+6],r[M+7],r[M+8]),b.set(a[C+0],a[C+1]),E.set(a[C+2],a[C+3]),w.set(a[C+4],a[C+5]),S.copy(y).add(x).add(_).divideScalar(3);const L=m(S);g(b,C+0,y,L),g(E,C+2,x,L),g(w,C+4,_,L)}}function g(y,x,_,S){S<0&&y.x===1&&(a[x]=y.x-1),_.x===0&&_.z===0&&(a[x]=S/2/Math.PI+.5)}function m(y){return Math.atan2(y.z,-y.x)}function f(y){return Math.atan2(-y.y,Math.sqrt(y.x*y.x+y.z*y.z))}}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}static fromJSON(e){return new Xr(e.vertices,e.indices,e.radius,e.detail)}}class rp extends Xr{constructor(e=1,t=0){const i=(1+Math.sqrt(5))/2,n=1/i,r=[-1,-1,-1,-1,-1,1,-1,1,-1,-1,1,1,1,-1,-1,1,-1,1,1,1,-1,1,1,1,0,-n,-i,0,-n,i,0,n,-i,0,n,i,-n,-i,0,-n,i,0,n,-i,0,n,i,0,-i,0,-n,i,0,-n,-i,0,n,i,0,n],a=[3,11,7,3,7,15,3,15,13,7,19,17,7,17,6,7,6,15,17,4,8,17,8,10,17,10,6,8,0,16,8,16,2,8,2,10,0,12,1,0,1,18,0,18,16,6,10,2,6,2,13,6,13,15,2,16,18,2,18,3,2,3,13,18,1,9,18,9,11,18,11,3,4,14,12,4,12,0,4,0,8,11,9,5,11,5,19,11,19,7,19,5,14,19,14,4,19,4,17,1,12,14,1,14,5,1,5,9];super(r,a,e,t),this.type="DodecahedronGeometry",this.parameters={radius:e,detail:t}}static fromJSON(e){return new rp(e.radius,e.detail)}}const ap=new R,op=new R,wg=new R,lp=new Ht;class Hx extends at{constructor(e=null,t=1){if(super(),this.type="EdgesGeometry",this.parameters={geometry:e,thresholdAngle:t},e!==null){const n=Math.pow(10,4),r=Math.cos(Ra*t),a=e.getIndex(),o=e.getAttribute("position"),l=a?a.count:o.count,c=[0,0,0],h=["a","b","c"],d=new Array(3),p={},u=[];for(let v=0;v<l;v+=3){a?(c[0]=a.getX(v),c[1]=a.getX(v+1),c[2]=a.getX(v+2)):(c[0]=v,c[1]=v+1,c[2]=v+2);const{a:g,b:m,c:f}=lp;if(g.fromBufferAttribute(o,c[0]),m.fromBufferAttribute(o,c[1]),f.fromBufferAttribute(o,c[2]),lp.getNormal(wg),d[0]=`${Math.round(g.x*n)},${Math.round(g.y*n)},${Math.round(g.z*n)}`,d[1]=`${Math.round(m.x*n)},${Math.round(m.y*n)},${Math.round(m.z*n)}`,d[2]=`${Math.round(f.x*n)},${Math.round(f.y*n)},${Math.round(f.z*n)}`,!(d[0]===d[1]||d[1]===d[2]||d[2]===d[0]))for(let y=0;y<3;y++){const x=(y+1)%3,_=d[y],S=d[x],b=lp[h[y]],E=lp[h[x]],w=`${_}_${S}`,M=`${S}_${_}`;M in p&&p[M]?(wg.dot(p[M].normal)<=r&&(u.push(b.x,b.y,b.z),u.push(E.x,E.y,E.z)),p[M]=null):w in p||(p[w]={index0:c[y],index1:c[x],normal:wg.clone()})}}for(const v in p)if(p[v]){const{index0:g,index1:m}=p[v];ap.fromBufferAttribute(o,g),op.fromBufferAttribute(o,m),u.push(ap.x,ap.y,ap.z),u.push(op.x,op.y,op.z)}this.setAttribute("position",new et(u,3))}}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}}class ms{constructor(){this.type="Curve",this.arcLengthDivisions=200,this.needsUpdate=!1,this.cacheArcLengths=null}getPoint(){Ye("Curve: .getPoint() not implemented.")}getPointAt(e,t){const i=this.getUtoTmapping(e);return this.getPoint(i,t)}getPoints(e=5){const t=[];for(let i=0;i<=e;i++)t.push(this.getPoint(i/e));return t}getSpacedPoints(e=5){const t=[];for(let i=0;i<=e;i++)t.push(this.getPointAt(i/e));return t}getLength(){const e=this.getLengths();return e[e.length-1]}getLengths(e=this.arcLengthDivisions){if(this.cacheArcLengths&&this.cacheArcLengths.length===e+1&&!this.needsUpdate)return this.cacheArcLengths;this.needsUpdate=!1;const t=[];let i,n=this.getPoint(0),r=0;t.push(0);for(let a=1;a<=e;a++)i=this.getPoint(a/e),r+=i.distanceTo(n),t.push(r),n=i;return this.cacheArcLengths=t,t}updateArcLengths(){this.needsUpdate=!0,this.getLengths()}getUtoTmapping(e,t=null){const i=this.getLengths();let n=0;const r=i.length;let a;t?a=t:a=e*i[r-1];let o=0,l=r-1,c;for(;o<=l;)if(n=Math.floor(o+(l-o)/2),c=i[n]-a,c<0)o=n+1;else if(c>0)l=n-1;else{l=n;break}if(n=l,i[n]===a)return n/(r-1);const h=i[n],p=i[n+1]-h,u=(a-h)/p;return(n+u)/(r-1)}getTangent(e,t){let n=e-1e-4,r=e+1e-4;n<0&&(n=0),r>1&&(r=1);const a=this.getPoint(n),o=this.getPoint(r),l=t||(a.isVector2?new me:new R);return l.copy(o).sub(a).normalize(),l}getTangentAt(e,t){const i=this.getUtoTmapping(e);return this.getTangent(i,t)}computeFrenetFrames(e,t=!1){const i=new R,n=[],r=[],a=[],o=new R,l=new qe;for(let u=0;u<=e;u++){const v=u/e;n[u]=this.getTangentAt(v,new R)}r[0]=new R,a[0]=new R;let c=Number.MAX_VALUE;const h=Math.abs(n[0].x),d=Math.abs(n[0].y),p=Math.abs(n[0].z);h<=c&&(c=h,i.set(1,0,0)),d<=c&&(c=d,i.set(0,1,0)),p<=c&&i.set(0,0,1),o.crossVectors(n[0],i).normalize(),r[0].crossVectors(n[0],o),a[0].crossVectors(n[0],r[0]);for(let u=1;u<=e;u++){if(r[u]=r[u-1].clone(),a[u]=a[u-1].clone(),o.crossVectors(n[u-1],n[u]),o.length()>Number.EPSILON){o.normalize();const v=Math.acos(dt(n[u-1].dot(n[u]),-1,1));r[u].applyMatrix4(l.makeRotationAxis(o,v))}a[u].crossVectors(n[u],r[u])}if(t===!0){let u=Math.acos(dt(r[0].dot(r[e]),-1,1));u/=e,n[0].dot(o.crossVectors(r[0],r[e]))>0&&(u=-u);for(let v=1;v<=e;v++)r[v].applyMatrix4(l.makeRotationAxis(n[v],u*v)),a[v].crossVectors(n[v],r[v])}return{tangents:n,normals:r,binormals:a}}clone(){return new this.constructor().copy(this)}copy(e){return this.arcLengthDivisions=e.arcLengthDivisions,this}toJSON(){const e={metadata:{version:4.7,type:"Curve",generator:"Curve.toJSON"}};return e.arcLengthDivisions=this.arcLengthDivisions,e.type=this.type,e}fromJSON(e){return this.arcLengthDivisions=e.arcLengthDivisions,this}}class eh extends ms{constructor(e=0,t=0,i=1,n=1,r=0,a=Math.PI*2,o=!1,l=0){super(),this.isEllipseCurve=!0,this.type="EllipseCurve",this.aX=e,this.aY=t,this.xRadius=i,this.yRadius=n,this.aStartAngle=r,this.aEndAngle=a,this.aClockwise=o,this.aRotation=l}getPoint(e,t=new me){const i=t,n=Math.PI*2;let r=this.aEndAngle-this.aStartAngle;const a=Math.abs(r)<Number.EPSILON;for(;r<0;)r+=n;for(;r>n;)r-=n;r<Number.EPSILON&&(a?r=0:r=n),this.aClockwise===!0&&!a&&(r===n?r=-n:r=r-n);const o=this.aStartAngle+e*r;let l=this.aX+this.xRadius*Math.cos(o),c=this.aY+this.yRadius*Math.sin(o);if(this.aRotation!==0){const h=Math.cos(this.aRotation),d=Math.sin(this.aRotation),p=l-this.aX,u=c-this.aY;l=p*h-u*d+this.aX,c=p*d+u*h+this.aY}return i.set(l,c)}copy(e){return super.copy(e),this.aX=e.aX,this.aY=e.aY,this.xRadius=e.xRadius,this.yRadius=e.yRadius,this.aStartAngle=e.aStartAngle,this.aEndAngle=e.aEndAngle,this.aClockwise=e.aClockwise,this.aRotation=e.aRotation,this}toJSON(){const e=super.toJSON();return e.aX=this.aX,e.aY=this.aY,e.xRadius=this.xRadius,e.yRadius=this.yRadius,e.aStartAngle=this.aStartAngle,e.aEndAngle=this.aEndAngle,e.aClockwise=this.aClockwise,e.aRotation=this.aRotation,e}fromJSON(e){return super.fromJSON(e),this.aX=e.aX,this.aY=e.aY,this.xRadius=e.xRadius,this.yRadius=e.yRadius,this.aStartAngle=e.aStartAngle,this.aEndAngle=e.aEndAngle,this.aClockwise=e.aClockwise,this.aRotation=e.aRotation,this}}class Vx extends eh{constructor(e,t,i,n,r,a){super(e,t,i,i,n,r,a),this.isArcCurve=!0,this.type="ArcCurve"}}function Eg(){let s=0,e=0,t=0,i=0;function n(r,a,o,l){s=r,e=o,t=-3*r+3*a-2*o-l,i=2*r-2*a+o+l}return{initCatmullRom:function(r,a,o,l,c){n(a,o,c*(o-r),c*(l-a))},initNonuniformCatmullRom:function(r,a,o,l,c,h,d){let p=(a-r)/c-(o-r)/(c+h)+(o-a)/h,u=(o-a)/h-(l-a)/(h+d)+(l-o)/d;p*=h,u*=h,n(a,o,p,u)},calc:function(r){const a=r*r,o=a*r;return s+e*r+t*a+i*o}}}const cp=new R,Tg=new Eg,Cg=new Eg,Ag=new Eg;class Gx extends ms{constructor(e=[],t=!1,i="centripetal",n=.5){super(),this.isCatmullRomCurve3=!0,this.type="CatmullRomCurve3",this.points=e,this.closed=t,this.curveType=i,this.tension=n}getPoint(e,t=new R){const i=t,n=this.points,r=n.length,a=(r-(this.closed?0:1))*e;let o=Math.floor(a),l=a-o;this.closed?o+=o>0?0:(Math.floor(Math.abs(o)/r)+1)*r:l===0&&o===r-1&&(o=r-2,l=1);let c,h;this.closed||o>0?c=n[(o-1)%r]:(cp.subVectors(n[0],n[1]).add(n[0]),c=cp);const d=n[o%r],p=n[(o+1)%r];if(this.closed||o+2<r?h=n[(o+2)%r]:(cp.subVectors(n[r-1],n[r-2]).add(n[r-1]),h=cp),this.curveType==="centripetal"||this.curveType==="chordal"){const u=this.curveType==="chordal"?.5:.25;let v=Math.pow(c.distanceToSquared(d),u),g=Math.pow(d.distanceToSquared(p),u),m=Math.pow(p.distanceToSquared(h),u);g<1e-4&&(g=1),v<1e-4&&(v=g),m<1e-4&&(m=g),Tg.initNonuniformCatmullRom(c.x,d.x,p.x,h.x,v,g,m),Cg.initNonuniformCatmullRom(c.y,d.y,p.y,h.y,v,g,m),Ag.initNonuniformCatmullRom(c.z,d.z,p.z,h.z,v,g,m)}else this.curveType==="catmullrom"&&(Tg.initCatmullRom(c.x,d.x,p.x,h.x,this.tension),Cg.initCatmullRom(c.y,d.y,p.y,h.y,this.tension),Ag.initCatmullRom(c.z,d.z,p.z,h.z,this.tension));return i.set(Tg.calc(l),Cg.calc(l),Ag.calc(l)),i}copy(e){super.copy(e),this.points=[];for(let t=0,i=e.points.length;t<i;t++){const n=e.points[t];this.points.push(n.clone())}return this.closed=e.closed,this.curveType=e.curveType,this.tension=e.tension,this}toJSON(){const e=super.toJSON();e.points=[];for(let t=0,i=this.points.length;t<i;t++){const n=this.points[t];e.points.push(n.toArray())}return e.closed=this.closed,e.curveType=this.curveType,e.tension=this.tension,e}fromJSON(e){super.fromJSON(e),this.points=[];for(let t=0,i=e.points.length;t<i;t++){const n=e.points[t];this.points.push(new R().fromArray(n))}return this.closed=e.closed,this.curveType=e.curveType,this.tension=e.tension,this}}function Wx(s,e,t,i,n){const r=(i-e)*.5,a=(n-t)*.5,o=s*s,l=s*o;return(2*t-2*i+r+a)*l+(-3*t+3*i-2*r-a)*o+r*s+t}function iT(s,e){const t=1-s;return t*t*e}function nT(s,e){return 2*(1-s)*s*e}function sT(s,e){return s*s*e}function th(s,e,t,i){return iT(s,e)+nT(s,t)+sT(s,i)}function rT(s,e){const t=1-s;return t*t*t*e}function aT(s,e){const t=1-s;return 3*t*t*s*e}function oT(s,e){return 3*(1-s)*s*s*e}function lT(s,e){return s*s*s*e}function ih(s,e,t,i,n){return rT(s,e)+aT(s,t)+oT(s,i)+lT(s,n)}class Pg extends ms{constructor(e=new me,t=new me,i=new me,n=new me){super(),this.isCubicBezierCurve=!0,this.type="CubicBezierCurve",this.v0=e,this.v1=t,this.v2=i,this.v3=n}getPoint(e,t=new me){const i=t,n=this.v0,r=this.v1,a=this.v2,o=this.v3;return i.set(ih(e,n.x,r.x,a.x,o.x),ih(e,n.y,r.y,a.y,o.y)),i}copy(e){return super.copy(e),this.v0.copy(e.v0),this.v1.copy(e.v1),this.v2.copy(e.v2),this.v3.copy(e.v3),this}toJSON(){const e=super.toJSON();return e.v0=this.v0.toArray(),e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e.v3=this.v3.toArray(),e}fromJSON(e){return super.fromJSON(e),this.v0.fromArray(e.v0),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this.v3.fromArray(e.v3),this}}class Xx extends ms{constructor(e=new R,t=new R,i=new R,n=new R){super(),this.isCubicBezierCurve3=!0,this.type="CubicBezierCurve3",this.v0=e,this.v1=t,this.v2=i,this.v3=n}getPoint(e,t=new R){const i=t,n=this.v0,r=this.v1,a=this.v2,o=this.v3;return i.set(ih(e,n.x,r.x,a.x,o.x),ih(e,n.y,r.y,a.y,o.y),ih(e,n.z,r.z,a.z,o.z)),i}copy(e){return super.copy(e),this.v0.copy(e.v0),this.v1.copy(e.v1),this.v2.copy(e.v2),this.v3.copy(e.v3),this}toJSON(){const e=super.toJSON();return e.v0=this.v0.toArray(),e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e.v3=this.v3.toArray(),e}fromJSON(e){return super.fromJSON(e),this.v0.fromArray(e.v0),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this.v3.fromArray(e.v3),this}}class Rg extends ms{constructor(e=new me,t=new me){super(),this.isLineCurve=!0,this.type="LineCurve",this.v1=e,this.v2=t}getPoint(e,t=new me){const i=t;return e===1?i.copy(this.v2):(i.copy(this.v2).sub(this.v1),i.multiplyScalar(e).add(this.v1)),i}getPointAt(e,t){return this.getPoint(e,t)}getTangent(e,t=new me){return t.subVectors(this.v2,this.v1).normalize()}getTangentAt(e,t){return this.getTangent(e,t)}copy(e){return super.copy(e),this.v1.copy(e.v1),this.v2.copy(e.v2),this}toJSON(){const e=super.toJSON();return e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e}fromJSON(e){return super.fromJSON(e),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this}}class jx extends ms{constructor(e=new R,t=new R){super(),this.isLineCurve3=!0,this.type="LineCurve3",this.v1=e,this.v2=t}getPoint(e,t=new R){const i=t;return e===1?i.copy(this.v2):(i.copy(this.v2).sub(this.v1),i.multiplyScalar(e).add(this.v1)),i}getPointAt(e,t){return this.getPoint(e,t)}getTangent(e,t=new R){return t.subVectors(this.v2,this.v1).normalize()}getTangentAt(e,t){return this.getTangent(e,t)}copy(e){return super.copy(e),this.v1.copy(e.v1),this.v2.copy(e.v2),this}toJSON(){const e=super.toJSON();return e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e}fromJSON(e){return super.fromJSON(e),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this}}class Lg extends ms{constructor(e=new me,t=new me,i=new me){super(),this.isQuadraticBezierCurve=!0,this.type="QuadraticBezierCurve",this.v0=e,this.v1=t,this.v2=i}getPoint(e,t=new me){const i=t,n=this.v0,r=this.v1,a=this.v2;return i.set(th(e,n.x,r.x,a.x),th(e,n.y,r.y,a.y)),i}copy(e){return super.copy(e),this.v0.copy(e.v0),this.v1.copy(e.v1),this.v2.copy(e.v2),this}toJSON(){const e=super.toJSON();return e.v0=this.v0.toArray(),e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e}fromJSON(e){return super.fromJSON(e),this.v0.fromArray(e.v0),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this}}class Ig extends ms{constructor(e=new R,t=new R,i=new R){super(),this.isQuadraticBezierCurve3=!0,this.type="QuadraticBezierCurve3",this.v0=e,this.v1=t,this.v2=i}getPoint(e,t=new R){const i=t,n=this.v0,r=this.v1,a=this.v2;return i.set(th(e,n.x,r.x,a.x),th(e,n.y,r.y,a.y),th(e,n.z,r.z,a.z)),i}copy(e){return super.copy(e),this.v0.copy(e.v0),this.v1.copy(e.v1),this.v2.copy(e.v2),this}toJSON(){const e=super.toJSON();return e.v0=this.v0.toArray(),e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e}fromJSON(e){return super.fromJSON(e),this.v0.fromArray(e.v0),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this}}class Dg extends ms{constructor(e=[]){super(),this.isSplineCurve=!0,this.type="SplineCurve",this.points=e}getPoint(e,t=new me){const i=t,n=this.points,r=(n.length-1)*e,a=Math.floor(r),o=r-a,l=n[a===0?a:a-1],c=n[a],h=n[a>n.length-2?n.length-1:a+1],d=n[a>n.length-3?n.length-1:a+2];return i.set(Wx(o,l.x,c.x,h.x,d.x),Wx(o,l.y,c.y,h.y,d.y)),i}copy(e){super.copy(e),this.points=[];for(let t=0,i=e.points.length;t<i;t++){const n=e.points[t];this.points.push(n.clone())}return this}toJSON(){const e=super.toJSON();e.points=[];for(let t=0,i=this.points.length;t<i;t++){const n=this.points[t];e.points.push(n.toArray())}return e}fromJSON(e){super.fromJSON(e),this.points=[];for(let t=0,i=e.points.length;t<i;t++){const n=e.points[t];this.points.push(new me().fromArray(n))}return this}}var hp=Object.freeze({__proto__:null,ArcCurve:Vx,CatmullRomCurve3:Gx,CubicBezierCurve:Pg,CubicBezierCurve3:Xx,EllipseCurve:eh,LineCurve:Rg,LineCurve3:jx,QuadraticBezierCurve:Lg,QuadraticBezierCurve3:Ig,SplineCurve:Dg});class qx extends ms{constructor(){super(),this.type="CurvePath",this.curves=[],this.autoClose=!1}add(e){this.curves.push(e)}closePath(){const e=this.curves[0].getPoint(0),t=this.curves[this.curves.length-1].getPoint(1);if(!e.equals(t)){const i=e.isVector2===!0?"LineCurve":"LineCurve3";this.curves.push(new hp[i](t,e))}return this}getPoint(e,t){const i=e*this.getLength(),n=this.getCurveLengths();let r=0;for(;r<n.length;){if(n[r]>=i){const a=n[r]-i,o=this.curves[r],l=o.getLength(),c=l===0?0:1-a/l;return o.getPointAt(c,t)}r++}return null}getLength(){const e=this.getCurveLengths();return e[e.length-1]}updateArcLengths(){this.needsUpdate=!0,this.cacheLengths=null,this.getCurveLengths()}getCurveLengths(){if(this.cacheLengths&&this.cacheLengths.length===this.curves.length)return this.cacheLengths;const e=[];let t=0;for(let i=0,n=this.curves.length;i<n;i++)t+=this.curves[i].getLength(),e.push(t);return this.cacheLengths=e,e}getSpacedPoints(e=40){const t=[];for(let i=0;i<=e;i++)t.push(this.getPoint(i/e));return this.autoClose&&t.push(t[0]),t}getPoints(e=12){const t=[];let i;for(let n=0,r=this.curves;n<r.length;n++){const a=r[n],o=a.isEllipseCurve?e*2:a.isLineCurve||a.isLineCurve3?1:a.isSplineCurve?e*a.points.length:e,l=a.getPoints(o);for(let c=0;c<l.length;c++){const h=l[c];i&&i.equals(h)||(t.push(h),i=h)}}return this.autoClose&&t.length>1&&!t[t.length-1].equals(t[0])&&t.push(t[0]),t}copy(e){super.copy(e),this.curves=[];for(let t=0,i=e.curves.length;t<i;t++){const n=e.curves[t];this.curves.push(n.clone())}return this.autoClose=e.autoClose,this}toJSON(){const e=super.toJSON();e.autoClose=this.autoClose,e.curves=[];for(let t=0,i=this.curves.length;t<i;t++){const n=this.curves[t];e.curves.push(n.toJSON())}return e}fromJSON(e){super.fromJSON(e),this.autoClose=e.autoClose,this.curves=[];for(let t=0,i=e.curves.length;t<i;t++){const n=e.curves[t];this.curves.push(new hp[n.type]().fromJSON(n))}return this}}class nh extends qx{constructor(e){super(),this.type="Path",this.currentPoint=new me,e&&this.setFromPoints(e)}setFromPoints(e){this.moveTo(e[0].x,e[0].y);for(let t=1,i=e.length;t<i;t++)this.lineTo(e[t].x,e[t].y);return this}moveTo(e,t){return this.currentPoint.set(e,t),this}lineTo(e,t){const i=new Rg(this.currentPoint.clone(),new me(e,t));return this.curves.push(i),this.currentPoint.set(e,t),this}quadraticCurveTo(e,t,i,n){const r=new Lg(this.currentPoint.clone(),new me(e,t),new me(i,n));return this.curves.push(r),this.currentPoint.set(i,n),this}bezierCurveTo(e,t,i,n,r,a){const o=new Pg(this.currentPoint.clone(),new me(e,t),new me(i,n),new me(r,a));return this.curves.push(o),this.currentPoint.set(r,a),this}splineThru(e){const t=[this.currentPoint.clone()].concat(e),i=new Dg(t);return this.curves.push(i),this.currentPoint.copy(e[e.length-1]),this}arc(e,t,i,n,r,a){const o=this.currentPoint.x,l=this.currentPoint.y;return this.absarc(e+o,t+l,i,n,r,a),this}absarc(e,t,i,n,r,a){return this.absellipse(e,t,i,i,n,r,a),this}ellipse(e,t,i,n,r,a,o,l){const c=this.currentPoint.x,h=this.currentPoint.y;return this.absellipse(e+c,t+h,i,n,r,a,o,l),this}absellipse(e,t,i,n,r,a,o,l){const c=new eh(e,t,i,n,r,a,o,l);if(this.curves.length>0){const d=c.getPoint(0);d.equals(this.currentPoint)||this.lineTo(d.x,d.y)}this.curves.push(c);const h=c.getPoint(1);return this.currentPoint.copy(h),this}copy(e){return super.copy(e),this.currentPoint.copy(e.currentPoint),this}toJSON(){const e=super.toJSON();return e.currentPoint=this.currentPoint.toArray(),e}fromJSON(e){return super.fromJSON(e),this.currentPoint.fromArray(e.currentPoint),this}}class nr extends nh{constructor(e){super(e),this.uuid=kn(),this.type="Shape",this.holes=[]}getPointsHoles(e){const t=[];for(let i=0,n=this.holes.length;i<n;i++)t[i]=this.holes[i].getPoints(e);return t}extractPoints(e){return{shape:this.getPoints(e),holes:this.getPointsHoles(e)}}copy(e){super.copy(e),this.holes=[];for(let t=0,i=e.holes.length;t<i;t++){const n=e.holes[t];this.holes.push(n.clone())}return this}toJSON(){const e=super.toJSON();e.uuid=this.uuid,e.holes=[];for(let t=0,i=this.holes.length;t<i;t++){const n=this.holes[t];e.holes.push(n.toJSON())}return e}fromJSON(e){super.fromJSON(e),this.uuid=e.uuid,this.holes=[];for(let t=0,i=e.holes.length;t<i;t++){const n=e.holes[t];this.holes.push(new nh().fromJSON(n))}return this}}function cT(s,e,t=2){const i=e&&e.length,n=i?e[0]*t:s.length;let r=Zx(s,0,n,t,!0);const a=[];if(!r||r.next===r.prev)return a;let o,l,c;if(i&&(r=fT(s,e,r,t)),s.length>80*t){o=s[0],l=s[1];let h=o,d=l;for(let p=t;p<n;p+=t){const u=s[p],v=s[p+1];u<o&&(o=u),v<l&&(l=v),u>h&&(h=u),v>d&&(d=v)}c=Math.max(h-o,d-l),c=c!==0?32767/c:0}return sh(r,a,t,o,l,c,0),a}function Zx(s,e,t,i,n){let r;if(n===ET(s,e,t,i)>0)for(let a=e;a<t;a+=i)r=Jx(a/i|0,s[a],s[a+1],r);else for(let a=t-i;a>=e;a-=i)r=Jx(a/i|0,s[a],s[a+1],r);return r&&fl(r,r.next)&&(oh(r),r=r.next),r}function Ba(s,e){if(!s)return s;e||(e=s);let t=s,i;do if(i=!1,!t.steiner&&(fl(t,t.next)||ri(t.prev,t,t.next)===0)){if(oh(t),t=e=t.prev,t===t.next)break;i=!0}else t=t.next;while(i||t!==e);return e}function sh(s,e,t,i,n,r,a){if(!s)return;!a&&r&&xT(s,i,n,r);let o=s;for(;s.prev!==s.next;){const l=s.prev,c=s.next;if(r?dT(s,i,n,r):hT(s)){e.push(l.i,s.i,c.i),oh(s),s=c.next,o=c.next;continue}if(s=c,s===o){a?a===1?(s=uT(Ba(s),e),sh(s,e,t,i,n,r,2)):a===2&&pT(s,e,t,i,n,r):sh(Ba(s),e,t,i,n,r,1);break}}}function hT(s){const e=s.prev,t=s,i=s.next;if(ri(e,t,i)>=0)return!1;const n=e.x,r=t.x,a=i.x,o=e.y,l=t.y,c=i.y,h=Math.min(n,r,a),d=Math.min(o,l,c),p=Math.max(n,r,a),u=Math.max(o,l,c);let v=i.next;for(;v!==e;){if(v.x>=h&&v.x<=p&&v.y>=d&&v.y<=u&&rh(n,o,r,l,a,c,v.x,v.y)&&ri(v.prev,v,v.next)>=0)return!1;v=v.next}return!0}function dT(s,e,t,i){const n=s.prev,r=s,a=s.next;if(ri(n,r,a)>=0)return!1;const o=n.x,l=r.x,c=a.x,h=n.y,d=r.y,p=a.y,u=Math.min(o,l,c),v=Math.min(h,d,p),g=Math.max(o,l,c),m=Math.max(h,d,p),f=Ng(u,v,e,t,i),y=Ng(g,m,e,t,i);let x=s.prevZ,_=s.nextZ;for(;x&&x.z>=f&&_&&_.z<=y;){if(x.x>=u&&x.x<=g&&x.y>=v&&x.y<=m&&x!==n&&x!==a&&rh(o,h,l,d,c,p,x.x,x.y)&&ri(x.prev,x,x.next)>=0||(x=x.prevZ,_.x>=u&&_.x<=g&&_.y>=v&&_.y<=m&&_!==n&&_!==a&&rh(o,h,l,d,c,p,_.x,_.y)&&ri(_.prev,_,_.next)>=0))return!1;_=_.nextZ}for(;x&&x.z>=f;){if(x.x>=u&&x.x<=g&&x.y>=v&&x.y<=m&&x!==n&&x!==a&&rh(o,h,l,d,c,p,x.x,x.y)&&ri(x.prev,x,x.next)>=0)return!1;x=x.prevZ}for(;_&&_.z<=y;){if(_.x>=u&&_.x<=g&&_.y>=v&&_.y<=m&&_!==n&&_!==a&&rh(o,h,l,d,c,p,_.x,_.y)&&ri(_.prev,_,_.next)>=0)return!1;_=_.nextZ}return!0}function uT(s,e){let t=s;do{const i=t.prev,n=t.next.next;!fl(i,n)&&$x(i,t,t.next,n)&&ah(i,n)&&ah(n,i)&&(e.push(i.i,t.i,n.i),oh(t),oh(t.next),t=s=n),t=t.next}while(t!==s);return Ba(t)}function pT(s,e,t,i,n,r){let a=s;do{let o=a.next.next;for(;o!==a.prev;){if(a.i!==o.i&&MT(a,o)){let l=Kx(a,o);a=Ba(a,a.next),l=Ba(l,l.next),sh(a,e,t,i,n,r,0),sh(l,e,t,i,n,r,0);return}o=o.next}a=a.next}while(a!==s)}function fT(s,e,t,i){const n=[];for(let r=0,a=e.length;r<a;r++){const o=e[r]*i,l=r<a-1?e[r+1]*i:s.length,c=Zx(s,o,l,i,!1);c===c.next&&(c.steiner=!0),n.push(bT(c))}n.sort(mT);for(let r=0;r<n.length;r++)t=gT(n[r],t);return t}function mT(s,e){let t=s.x-e.x;if(t===0&&(t=s.y-e.y,t===0)){const i=(s.next.y-s.y)/(s.next.x-s.x),n=(e.next.y-e.y)/(e.next.x-e.x);t=i-n}return t}function gT(s,e){const t=vT(s,e);if(!t)return e;const i=Kx(t,s);return Ba(i,i.next),Ba(t,t.next)}function vT(s,e){let t=e;const i=s.x,n=s.y;let r=-1/0,a;if(fl(s,t))return t;do{if(fl(s,t.next))return t.next;if(n<=t.y&&n>=t.next.y&&t.next.y!==t.y){const d=t.x+(n-t.y)*(t.next.x-t.x)/(t.next.y-t.y);if(d<=i&&d>r&&(r=d,a=t.x<t.next.x?t:t.next,d===i))return a}t=t.next}while(t!==e);if(!a)return null;const o=a,l=a.x,c=a.y;let h=1/0;t=a;do{if(i>=t.x&&t.x>=l&&i!==t.x&&Yx(n<c?i:r,n,l,c,n<c?r:i,n,t.x,t.y)){const d=Math.abs(n-t.y)/(i-t.x);ah(t,s)&&(d<h||d===h&&(t.x>a.x||t.x===a.x&&yT(a,t)))&&(a=t,h=d)}t=t.next}while(t!==o);return a}function yT(s,e){return ri(s.prev,s,e.prev)<0&&ri(e.next,s,s.next)<0}function xT(s,e,t,i){let n=s;do n.z===0&&(n.z=Ng(n.x,n.y,e,t,i)),n.prevZ=n.prev,n.nextZ=n.next,n=n.next;while(n!==s);n.prevZ.nextZ=null,n.prevZ=null,_T(n)}function _T(s){let e,t=1;do{let i=s,n;s=null;let r=null;for(e=0;i;){e++;let a=i,o=0;for(let c=0;c<t&&(o++,a=a.nextZ,!!a);c++);let l=t;for(;o>0||l>0&&a;)o!==0&&(l===0||!a||i.z<=a.z)?(n=i,i=i.nextZ,o--):(n=a,a=a.nextZ,l--),r?r.nextZ=n:s=n,n.prevZ=r,r=n;i=a}r.nextZ=null,t*=2}while(e>1);return s}function Ng(s,e,t,i,n){return s=(s-t)*n|0,e=(e-i)*n|0,s=(s|s<<8)&16711935,s=(s|s<<4)&252645135,s=(s|s<<2)&858993459,s=(s|s<<1)&1431655765,e=(e|e<<8)&16711935,e=(e|e<<4)&252645135,e=(e|e<<2)&858993459,e=(e|e<<1)&1431655765,s|e<<1}function bT(s){let e=s,t=s;do(e.x<t.x||e.x===t.x&&e.y<t.y)&&(t=e),e=e.next;while(e!==s);return t}function Yx(s,e,t,i,n,r,a,o){return(n-a)*(e-o)>=(s-a)*(r-o)&&(s-a)*(i-o)>=(t-a)*(e-o)&&(t-a)*(r-o)>=(n-a)*(i-o)}function rh(s,e,t,i,n,r,a,o){return!(s===a&&e===o)&&Yx(s,e,t,i,n,r,a,o)}function MT(s,e){return s.next.i!==e.i&&s.prev.i!==e.i&&!ST(s,e)&&(ah(s,e)&&ah(e,s)&&wT(s,e)&&(ri(s.prev,s,e.prev)||ri(s,e.prev,e))||fl(s,e)&&ri(s.prev,s,s.next)>0&&ri(e.prev,e,e.next)>0)}function ri(s,e,t){return(e.y-s.y)*(t.x-e.x)-(e.x-s.x)*(t.y-e.y)}function fl(s,e){return s.x===e.x&&s.y===e.y}function $x(s,e,t,i){const n=up(ri(s,e,t)),r=up(ri(s,e,i)),a=up(ri(t,i,s)),o=up(ri(t,i,e));return!!(n!==r&&a!==o||n===0&&dp(s,t,e)||r===0&&dp(s,i,e)||a===0&&dp(t,s,i)||o===0&&dp(t,e,i))}function dp(s,e,t){return e.x<=Math.max(s.x,t.x)&&e.x>=Math.min(s.x,t.x)&&e.y<=Math.max(s.y,t.y)&&e.y>=Math.min(s.y,t.y)}function up(s){return s>0?1:s<0?-1:0}function ST(s,e){let t=s;do{if(t.i!==s.i&&t.next.i!==s.i&&t.i!==e.i&&t.next.i!==e.i&&$x(t,t.next,s,e))return!0;t=t.next}while(t!==s);return!1}function ah(s,e){return ri(s.prev,s,s.next)<0?ri(s,e,s.next)>=0&&ri(s,s.prev,e)>=0:ri(s,e,s.prev)<0||ri(s,s.next,e)<0}function wT(s,e){let t=s,i=!1;const n=(s.x+e.x)/2,r=(s.y+e.y)/2;do t.y>r!=t.next.y>r&&t.next.y!==t.y&&n<(t.next.x-t.x)*(r-t.y)/(t.next.y-t.y)+t.x&&(i=!i),t=t.next;while(t!==s);return i}function Kx(s,e){const t=kg(s.i,s.x,s.y),i=kg(e.i,e.x,e.y),n=s.next,r=e.prev;return s.next=e,e.prev=s,t.next=n,n.prev=t,i.next=t,t.prev=i,r.next=i,i.prev=r,i}function Jx(s,e,t,i){const n=kg(s,e,t);return i?(n.next=i.next,n.prev=i,i.next.prev=n,i.next=n):(n.prev=n,n.next=n),n}function oh(s){s.next.prev=s.prev,s.prev.next=s.next,s.prevZ&&(s.prevZ.nextZ=s.nextZ),s.nextZ&&(s.nextZ.prevZ=s.prevZ)}function kg(s,e,t){return{i:s,x:e,y:t,prev:null,next:null,z:0,prevZ:null,nextZ:null,steiner:!1}}function ET(s,e,t,i){let n=0;for(let r=e,a=t-i;r<t;r+=i)n+=(s[a]-s[r])*(s[r+1]+s[a+1]),a=r;return n}class TT{static triangulate(e,t,i=2){return cT(e,t,i)}}class gs{static area(e){const t=e.length;let i=0;for(let n=t-1,r=0;r<t;n=r++)i+=e[n].x*e[r].y-e[r].x*e[n].y;return i*.5}static isClockWise(e){return gs.area(e)<0}static triangulateShape(e,t){const i=[],n=[],r=[];Qx(e),e_(i,e);let a=e.length;t.forEach(Qx);for(let l=0;l<t.length;l++)n.push(a),a+=t[l].length,e_(i,t[l]);const o=TT.triangulate(i,n);for(let l=0;l<o.length;l+=3)r.push(o.slice(l,l+3));return r}}function Qx(s){const e=s.length;e>2&&s[e-1].equals(s[0])&&s.pop()}function e_(s,e){for(let t=0;t<e.length;t++)s.push(e[t].x),s.push(e[t].y)}class ml extends at{constructor(e=new nr([new me(.5,.5),new me(-.5,.5),new me(-.5,-.5),new me(.5,-.5)]),t={}){super(),this.type="ExtrudeGeometry",this.parameters={shapes:e,options:t},e=Array.isArray(e)?e:[e];const i=this,n=[],r=[];for(let o=0,l=e.length;o<l;o++){const c=e[o];a(c)}this.setAttribute("position",new et(n,3)),this.setAttribute("uv",new et(r,2)),this.computeVertexNormals();function a(o){const l=[],c=t.curveSegments!==void 0?t.curveSegments:12,h=t.steps!==void 0?t.steps:1,d=t.depth!==void 0?t.depth:1;let p=t.bevelEnabled!==void 0?t.bevelEnabled:!0,u=t.bevelThickness!==void 0?t.bevelThickness:.2,v=t.bevelSize!==void 0?t.bevelSize:u-.1,g=t.bevelOffset!==void 0?t.bevelOffset:0,m=t.bevelSegments!==void 0?t.bevelSegments:3;const f=t.extrudePath,y=t.UVGenerator!==void 0?t.UVGenerator:CT;let x,_=!1,S,b,E,w;if(f){x=f.getSpacedPoints(h),_=!0,p=!1;const D=f.isCatmullRomCurve3?f.closed:!1;S=f.computeFrenetFrames(h,D),b=new R,E=new R,w=new R}p||(m=0,u=0,v=0,g=0);const M=o.extractPoints(c);let C=M.shape;const L=M.holes;if(!gs.isClockWise(C)){C=C.reverse();for(let D=0,ae=L.length;D<ae;D++){const Q=L[D];gs.isClockWise(Q)&&(L[D]=Q.reverse())}}function k(D){const Q=10000000000000001e-36;let W=D[0];for(let N=1;N<=D.length;N++){const te=N%D.length,de=D[te],V=de.x-W.x,ee=de.y-W.y,I=V*V+ee*ee,T=Math.max(Math.abs(de.x),Math.abs(de.y),Math.abs(W.x),Math.abs(W.y)),U=Q*T*T;if(I<=U){D.splice(te,1),N--;continue}W=de}}k(C),L.forEach(k);const A=L.length,B=C;for(let D=0;D<A;D++){const ae=L[D];C=C.concat(ae)}function F(D,ae,Q){return ae||lt("ExtrudeGeometry: vec does not exist"),D.clone().addScaledVector(ae,Q)}const H=C.length;function q(D,ae,Q){let W,N,te;const de=D.x-ae.x,V=D.y-ae.y,ee=Q.x-D.x,I=Q.y-D.y,T=de*de+V*V,U=de*I-V*ee;if(Math.abs(U)>Number.EPSILON){const j=Math.sqrt(T),K=Math.sqrt(ee*ee+I*I),Z=ae.x-V/j,Pe=ae.y+de/j,ve=Q.x-I/K,ke=Q.y+ee/K,Fe=((ve-Z)*I-(ke-Pe)*ee)/(de*I-V*ee);W=Z+de*Fe-D.x,N=Pe+V*Fe-D.y;const le=W*W+N*N;if(le<=2)return new me(W,N);te=Math.sqrt(le/2)}else{let j=!1;de>Number.EPSILON?ee>Number.EPSILON&&(j=!0):de<-Number.EPSILON?ee<-Number.EPSILON&&(j=!0):Math.sign(V)===Math.sign(I)&&(j=!0),j?(W=-V,N=de,te=Math.sqrt(T)):(W=de,N=V,te=Math.sqrt(T/2))}return new me(W/te,N/te)}const G=[];for(let D=0,ae=B.length,Q=ae-1,W=D+1;D<ae;D++,Q++,W++)Q===ae&&(Q=0),W===ae&&(W=0),G[D]=q(B[D],B[Q],B[W]);const re=[];let Y,$=G.concat();for(let D=0,ae=A;D<ae;D++){const Q=L[D];Y=[];for(let W=0,N=Q.length,te=N-1,de=W+1;W<N;W++,te++,de++)te===N&&(te=0),de===N&&(de=0),Y[W]=q(Q[W],Q[te],Q[de]);re.push(Y),$=$.concat(Y)}let _e;if(m===0)_e=gs.triangulateShape(B,L);else{const D=[],ae=[];for(let Q=0;Q<m;Q++){const W=Q/m,N=u*Math.cos(W*Math.PI/2),te=v*Math.sin(W*Math.PI/2)+g;for(let de=0,V=B.length;de<V;de++){const ee=F(B[de],G[de],te);Re(ee.x,ee.y,-N),W===0&&D.push(ee)}for(let de=0,V=A;de<V;de++){const ee=L[de];Y=re[de];const I=[];for(let T=0,U=ee.length;T<U;T++){const j=F(ee[T],Y[T],te);Re(j.x,j.y,-N),W===0&&I.push(j)}W===0&&ae.push(I)}}_e=gs.triangulateShape(D,ae)}const Te=_e.length,be=v+g;for(let D=0;D<H;D++){const ae=p?F(C[D],$[D],be):C[D];_?(E.copy(S.normals[0]).multiplyScalar(ae.x),b.copy(S.binormals[0]).multiplyScalar(ae.y),w.copy(x[0]).add(E).add(b),Re(w.x,w.y,w.z)):Re(ae.x,ae.y,0)}for(let D=1;D<=h;D++)for(let ae=0;ae<H;ae++){const Q=p?F(C[ae],$[ae],be):C[ae];_?(E.copy(S.normals[D]).multiplyScalar(Q.x),b.copy(S.binormals[D]).multiplyScalar(Q.y),w.copy(x[D]).add(E).add(b),Re(w.x,w.y,w.z)):Re(Q.x,Q.y,d/h*D)}for(let D=m-1;D>=0;D--){const ae=D/m,Q=u*Math.cos(ae*Math.PI/2),W=v*Math.sin(ae*Math.PI/2)+g;for(let N=0,te=B.length;N<te;N++){const de=F(B[N],G[N],W);Re(de.x,de.y,d+Q)}for(let N=0,te=L.length;N<te;N++){const de=L[N];Y=re[N];for(let V=0,ee=de.length;V<ee;V++){const I=F(de[V],Y[V],W);_?Re(I.x,I.y+x[h-1].y,x[h-1].x+Q):Re(I.x,I.y,d+Q)}}}J(),oe();function J(){const D=n.length/3;if(p){let ae=0,Q=H*ae;for(let W=0;W<Te;W++){const N=_e[W];Le(N[2]+Q,N[1]+Q,N[0]+Q)}ae=h+m*2,Q=H*ae;for(let W=0;W<Te;W++){const N=_e[W];Le(N[0]+Q,N[1]+Q,N[2]+Q)}}else{for(let ae=0;ae<Te;ae++){const Q=_e[ae];Le(Q[2],Q[1],Q[0])}for(let ae=0;ae<Te;ae++){const Q=_e[ae];Le(Q[0]+H*h,Q[1]+H*h,Q[2]+H*h)}}i.addGroup(D,n.length/3-D,0)}function oe(){const D=n.length/3;let ae=0;ue(B,ae),ae+=B.length;for(let Q=0,W=L.length;Q<W;Q++){const N=L[Q];ue(N,ae),ae+=N.length}i.addGroup(D,n.length/3-D,1)}function ue(D,ae){let Q=D.length;for(;--Q>=0;){const W=Q;let N=Q-1;N<0&&(N=D.length-1);for(let te=0,de=h+m*2;te<de;te++){const V=H*te,ee=H*(te+1),I=ae+W+V,T=ae+N+V,U=ae+N+ee,j=ae+W+ee;Ue(I,T,U,j)}}}function Re(D,ae,Q){l.push(D),l.push(ae),l.push(Q)}function Le(D,ae,Q){tt(D),tt(ae),tt(Q);const W=n.length/3,N=y.generateTopUV(i,n,W-3,W-2,W-1);je(N[0]),je(N[1]),je(N[2])}function Ue(D,ae,Q,W){tt(D),tt(ae),tt(W),tt(ae),tt(Q),tt(W);const N=n.length/3,te=y.generateSideWallUV(i,n,N-6,N-3,N-2,N-1);je(te[0]),je(te[1]),je(te[3]),je(te[1]),je(te[2]),je(te[3])}function tt(D){n.push(l[D*3+0]),n.push(l[D*3+1]),n.push(l[D*3+2])}function je(D){r.push(D.x),r.push(D.y)}}}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}toJSON(){const e=super.toJSON(),t=this.parameters.shapes,i=this.parameters.options;return AT(t,i,e)}static fromJSON(e,t){const i=[];for(let r=0,a=e.shapes.length;r<a;r++){const o=t[e.shapes[r]];i.push(o)}const n=e.options.extrudePath;return n!==void 0&&(e.options.extrudePath=new hp[n.type]().fromJSON(n)),new ml(i,e.options)}}const CT={generateTopUV:function(s,e,t,i,n){const r=e[t*3],a=e[t*3+1],o=e[i*3],l=e[i*3+1],c=e[n*3],h=e[n*3+1];return[new me(r,a),new me(o,l),new me(c,h)]},generateSideWallUV:function(s,e,t,i,n,r){const a=e[t*3],o=e[t*3+1],l=e[t*3+2],c=e[i*3],h=e[i*3+1],d=e[i*3+2],p=e[n*3],u=e[n*3+1],v=e[n*3+2],g=e[r*3],m=e[r*3+1],f=e[r*3+2];return Math.abs(o-h)<Math.abs(a-c)?[new me(a,1-l),new me(c,1-d),new me(p,1-v),new me(g,1-f)]:[new me(o,1-l),new me(h,1-d),new me(u,1-v),new me(m,1-f)]}};function AT(s,e,t){if(t.shapes=[],Array.isArray(s))for(let i=0,n=s.length;i<n;i++){const r=s[i];t.shapes.push(r.uuid)}else t.shapes.push(s.uuid);return t.options=Object.assign({},e),e.extrudePath!==void 0&&(t.options.extrudePath=e.extrudePath.toJSON()),t}class pp extends Xr{constructor(e=1,t=0){const i=(1+Math.sqrt(5))/2,n=[-1,i,0,1,i,0,-1,-i,0,1,-i,0,0,-1,i,0,1,i,0,-1,-i,0,1,-i,i,0,-1,i,0,1,-i,0,-1,-i,0,1],r=[0,11,5,0,5,1,0,1,7,0,7,10,0,10,11,1,5,9,5,11,4,11,10,2,10,7,6,7,1,8,3,9,4,3,4,2,3,2,6,3,6,8,3,8,9,4,9,5,2,4,11,6,2,10,8,6,7,9,8,1];super(n,r,e,t),this.type="IcosahedronGeometry",this.parameters={radius:e,detail:t}}static fromJSON(e){return new pp(e.radius,e.detail)}}class fp extends at{constructor(e=[new me(0,-.5),new me(.5,0),new me(0,.5)],t=12,i=0,n=Math.PI*2){super(),this.type="LatheGeometry",this.parameters={points:e,segments:t,phiStart:i,phiLength:n},t=Math.floor(t),n=dt(n,0,Math.PI*2);const r=[],a=[],o=[],l=[],c=[],h=1/t,d=new R,p=new me,u=new R,v=new R,g=new R;let m=0,f=0;for(let y=0;y<=e.length-1;y++)switch(y){case 0:m=e[y+1].x-e[y].x,f=e[y+1].y-e[y].y,u.x=f*1,u.y=-m,u.z=f*0,g.copy(u),u.normalize(),l.push(u.x,u.y,u.z);break;case e.length-1:l.push(g.x,g.y,g.z);break;default:m=e[y+1].x-e[y].x,f=e[y+1].y-e[y].y,u.x=f*1,u.y=-m,u.z=f*0,v.copy(u),u.x+=g.x,u.y+=g.y,u.z+=g.z,u.normalize(),l.push(u.x,u.y,u.z),g.copy(v)}for(let y=0;y<=t;y++){const x=i+y*h*n,_=Math.sin(x),S=Math.cos(x);for(let b=0;b<=e.length-1;b++){d.x=e[b].x*_,d.y=e[b].y,d.z=e[b].x*S,a.push(d.x,d.y,d.z),p.x=y/t,p.y=b/(e.length-1),o.push(p.x,p.y);const E=l[3*b+0]*_,w=l[3*b+1],M=l[3*b+0]*S;c.push(E,w,M)}}for(let y=0;y<t;y++)for(let x=0;x<e.length-1;x++){const _=x+y*e.length,S=_,b=_+e.length,E=_+e.length+1,w=_+1;r.push(S,b,w),r.push(E,w,b)}this.setIndex(r),this.setAttribute("position",new et(a,3)),this.setAttribute("uv",new et(o,2)),this.setAttribute("normal",new et(c,3))}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}static fromJSON(e){return new fp(e.points,e.segments,e.phiStart,e.phiLength)}}class lh extends Xr{constructor(e=1,t=0){const i=[1,0,0,-1,0,0,0,1,0,0,-1,0,0,0,1,0,0,-1],n=[0,2,4,0,4,3,0,3,5,0,5,2,1,2,5,1,5,3,1,3,4,1,4,2];super(i,n,e,t),this.type="OctahedronGeometry",this.parameters={radius:e,detail:t}}static fromJSON(e){return new lh(e.radius,e.detail)}}class vs extends at{constructor(e=1,t=1,i=1,n=1){super(),this.type="PlaneGeometry",this.parameters={width:e,height:t,widthSegments:i,heightSegments:n};const r=e/2,a=t/2,o=Math.floor(i),l=Math.floor(n),c=o+1,h=l+1,d=e/o,p=t/l,u=[],v=[],g=[],m=[];for(let f=0;f<h;f++){const y=f*p-a;for(let x=0;x<c;x++){const _=x*d-r;v.push(_,-y,0),g.push(0,0,1),m.push(x/o),m.push(1-f/l)}}for(let f=0;f<l;f++)for(let y=0;y<o;y++){const x=y+c*f,_=y+c*(f+1),S=y+1+c*(f+1),b=y+1+c*f;u.push(x,_,b),u.push(_,S,b)}this.setIndex(u),this.setAttribute("position",new et(v,3)),this.setAttribute("normal",new et(g,3)),this.setAttribute("uv",new et(m,2))}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}static fromJSON(e){return new vs(e.width,e.height,e.widthSegments,e.heightSegments)}}class mp extends at{constructor(e=.5,t=1,i=32,n=1,r=0,a=Math.PI*2){super(),this.type="RingGeometry",this.parameters={innerRadius:e,outerRadius:t,thetaSegments:i,phiSegments:n,thetaStart:r,thetaLength:a},i=Math.max(3,i),n=Math.max(1,n);const o=[],l=[],c=[],h=[];let d=e;const p=(t-e)/n,u=new R,v=new me;for(let g=0;g<=n;g++){for(let m=0;m<=i;m++){const f=r+m/i*a;u.x=d*Math.cos(f),u.y=d*Math.sin(f),l.push(u.x,u.y,u.z),c.push(0,0,1),v.x=(u.x/t+1)/2,v.y=(u.y/t+1)/2,h.push(v.x,v.y)}d+=p}for(let g=0;g<n;g++){const m=g*(i+1);for(let f=0;f<i;f++){const y=f+m,x=y,_=y+i+1,S=y+i+2,b=y+1;o.push(x,_,b),o.push(_,S,b)}}this.setIndex(o),this.setAttribute("position",new et(l,3)),this.setAttribute("normal",new et(c,3)),this.setAttribute("uv",new et(h,2))}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}static fromJSON(e){return new mp(e.innerRadius,e.outerRadius,e.thetaSegments,e.phiSegments,e.thetaStart,e.thetaLength)}}class ch extends at{constructor(e=new nr([new me(0,.5),new me(-.5,-.5),new me(.5,-.5)]),t=12){super(),this.type="ShapeGeometry",this.parameters={shapes:e,curveSegments:t};const i=[],n=[],r=[],a=[];let o=0,l=0;if(Array.isArray(e)===!1)c(e);else for(let h=0;h<e.length;h++)c(e[h]),this.addGroup(o,l,h),o+=l,l=0;this.setIndex(i),this.setAttribute("position",new et(n,3)),this.setAttribute("normal",new et(r,3)),this.setAttribute("uv",new et(a,2));function c(h){const d=n.length/3,p=h.extractPoints(t);let u=p.shape;const v=p.holes;gs.isClockWise(u)===!1&&(u=u.reverse());for(let m=0,f=v.length;m<f;m++){const y=v[m];gs.isClockWise(y)===!0&&(v[m]=y.reverse())}const g=gs.triangulateShape(u,v);for(let m=0,f=v.length;m<f;m++){const y=v[m];u=u.concat(y)}for(let m=0,f=u.length;m<f;m++){const y=u[m];n.push(y.x,y.y,0),r.push(0,0,1),a.push(y.x,y.y)}for(let m=0,f=g.length;m<f;m++){const y=g[m],x=y[0]+d,_=y[1]+d,S=y[2]+d;i.push(x,_,S),l+=3}}}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}toJSON(){const e=super.toJSON(),t=this.parameters.shapes;return PT(t,e)}static fromJSON(e,t){const i=[];for(let n=0,r=e.shapes.length;n<r;n++){const a=t[e.shapes[n]];i.push(a)}return new ch(i,e.curveSegments)}}function PT(s,e){if(e.shapes=[],Array.isArray(s))for(let t=0,i=s.length;t<i;t++){const n=s[t];e.shapes.push(n.uuid)}else e.shapes.push(s.uuid);return e}class Fa extends at{constructor(e=1,t=32,i=16,n=0,r=Math.PI*2,a=0,o=Math.PI){super(),this.type="SphereGeometry",this.parameters={radius:e,widthSegments:t,heightSegments:i,phiStart:n,phiLength:r,thetaStart:a,thetaLength:o},t=Math.max(3,Math.floor(t)),i=Math.max(2,Math.floor(i));const l=Math.min(a+o,Math.PI);let c=0;const h=[],d=new R,p=new R,u=[],v=[],g=[],m=[];for(let f=0;f<=i;f++){const y=[],x=f/i;let _=0;f===0&&a===0?_=.5/t:f===i&&l===Math.PI&&(_=-.5/t);for(let S=0;S<=t;S++){const b=S/t;d.x=-e*Math.cos(n+b*r)*Math.sin(a+x*o),d.y=e*Math.cos(a+x*o),d.z=e*Math.sin(n+b*r)*Math.sin(a+x*o),v.push(d.x,d.y,d.z),p.copy(d).normalize(),g.push(p.x,p.y,p.z),m.push(b+_,1-x),y.push(c++)}h.push(y)}for(let f=0;f<i;f++)for(let y=0;y<t;y++){const x=h[f][y+1],_=h[f][y],S=h[f+1][y],b=h[f+1][y+1];(f!==0||a>0)&&u.push(x,_,b),(f!==i-1||l<Math.PI)&&u.push(_,S,b)}this.setIndex(u),this.setAttribute("position",new et(v,3)),this.setAttribute("normal",new et(g,3)),this.setAttribute("uv",new et(m,2))}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}static fromJSON(e){return new Fa(e.radius,e.widthSegments,e.heightSegments,e.phiStart,e.phiLength,e.thetaStart,e.thetaLength)}}class gp extends Xr{constructor(e=1,t=0){const i=[1,1,1,-1,-1,1,-1,1,-1,1,-1,-1],n=[2,1,0,0,3,2,1,3,0,2,3,1];super(i,n,e,t),this.type="TetrahedronGeometry",this.parameters={radius:e,detail:t}}static fromJSON(e){return new gp(e.radius,e.detail)}}class vp extends at{constructor(e=1,t=.4,i=12,n=48,r=Math.PI*2,a=0,o=Math.PI*2){super(),this.type="TorusGeometry",this.parameters={radius:e,tube:t,radialSegments:i,tubularSegments:n,arc:r,thetaStart:a,thetaLength:o},i=Math.floor(i),n=Math.floor(n);const l=[],c=[],h=[],d=[],p=new R,u=new R,v=new R;for(let g=0;g<=i;g++){const m=a+g/i*o;for(let f=0;f<=n;f++){const y=f/n*r;u.x=(e+t*Math.cos(m))*Math.cos(y),u.y=(e+t*Math.cos(m))*Math.sin(y),u.z=t*Math.sin(m),c.push(u.x,u.y,u.z),p.x=e*Math.cos(y),p.y=e*Math.sin(y),v.subVectors(u,p).normalize(),h.push(v.x,v.y,v.z),d.push(f/n),d.push(g/i)}}for(let g=1;g<=i;g++)for(let m=1;m<=n;m++){const f=(n+1)*g+m-1,y=(n+1)*(g-1)+m-1,x=(n+1)*(g-1)+m,_=(n+1)*g+m;l.push(f,y,_),l.push(y,x,_)}this.setIndex(l),this.setAttribute("position",new et(c,3)),this.setAttribute("normal",new et(h,3)),this.setAttribute("uv",new et(d,2))}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}static fromJSON(e){return new vp(e.radius,e.tube,e.radialSegments,e.tubularSegments,e.arc)}}class yp extends at{constructor(e=1,t=.4,i=64,n=8,r=2,a=3){super(),this.type="TorusKnotGeometry",this.parameters={radius:e,tube:t,tubularSegments:i,radialSegments:n,p:r,q:a},i=Math.floor(i),n=Math.floor(n);const o=[],l=[],c=[],h=[],d=new R,p=new R,u=new R,v=new R,g=new R,m=new R,f=new R;for(let x=0;x<=i;++x){const _=x/i*r*Math.PI*2;y(_,r,a,e,u),y(_+.01,r,a,e,v),m.subVectors(v,u),f.addVectors(v,u),g.crossVectors(m,f),f.crossVectors(g,m),g.normalize(),f.normalize();for(let S=0;S<=n;++S){const b=S/n*Math.PI*2,E=-t*Math.cos(b),w=t*Math.sin(b);d.x=u.x+(E*f.x+w*g.x),d.y=u.y+(E*f.y+w*g.y),d.z=u.z+(E*f.z+w*g.z),l.push(d.x,d.y,d.z),p.subVectors(d,u).normalize(),c.push(p.x,p.y,p.z),h.push(x/i),h.push(S/n)}}for(let x=1;x<=i;x++)for(let _=1;_<=n;_++){const S=(n+1)*(x-1)+(_-1),b=(n+1)*x+(_-1),E=(n+1)*x+_,w=(n+1)*(x-1)+_;o.push(S,b,w),o.push(b,E,w)}this.setIndex(o),this.setAttribute("position",new et(l,3)),this.setAttribute("normal",new et(c,3)),this.setAttribute("uv",new et(h,2));function y(x,_,S,b,E){const w=Math.cos(x),M=Math.sin(x),C=S/_*x,L=Math.cos(C);E.x=b*(2+L)*.5*w,E.y=b*(2+L)*M*.5,E.z=b*Math.sin(C)*.5}}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}static fromJSON(e){return new yp(e.radius,e.tube,e.tubularSegments,e.radialSegments,e.p,e.q)}}class xp extends at{constructor(e=new Ig(new R(-1,-1,0),new R(-1,1,0),new R(1,1,0)),t=64,i=1,n=8,r=!1){super(),this.type="TubeGeometry",this.parameters={path:e,tubularSegments:t,radius:i,radialSegments:n,closed:r};const a=e.computeFrenetFrames(t,r);this.tangents=a.tangents,this.normals=a.normals,this.binormals=a.binormals;const o=new R,l=new R,c=new me;let h=new R;const d=[],p=[],u=[],v=[];g(),this.setIndex(v),this.setAttribute("position",new et(d,3)),this.setAttribute("normal",new et(p,3)),this.setAttribute("uv",new et(u,2));function g(){for(let x=0;x<t;x++)m(x);m(r===!1?t:0),y(),f()}function m(x){h=e.getPointAt(x/t,h);const _=a.normals[x],S=a.binormals[x];for(let b=0;b<=n;b++){const E=b/n*Math.PI*2,w=Math.sin(E),M=-Math.cos(E);l.x=M*_.x+w*S.x,l.y=M*_.y+w*S.y,l.z=M*_.z+w*S.z,l.normalize(),p.push(l.x,l.y,l.z),o.x=h.x+i*l.x,o.y=h.y+i*l.y,o.z=h.z+i*l.z,d.push(o.x,o.y,o.z)}}function f(){for(let x=1;x<=t;x++)for(let _=1;_<=n;_++){const S=(n+1)*(x-1)+(_-1),b=(n+1)*x+(_-1),E=(n+1)*x+_,w=(n+1)*(x-1)+_;v.push(S,b,w),v.push(b,E,w)}}function y(){for(let x=0;x<=t;x++)for(let _=0;_<=n;_++)c.x=x/t,c.y=_/n,u.push(c.x,c.y)}}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}toJSON(){const e=super.toJSON();return e.path=this.parameters.path.toJSON(),e}static fromJSON(e){return new xp(new hp[e.path.type]().fromJSON(e.path),e.tubularSegments,e.radius,e.radialSegments,e.closed)}}class t_ extends at{constructor(e=null){if(super(),this.type="WireframeGeometry",this.parameters={geometry:e},e!==null){const t=[],i=new Set,n=new R,r=new R;if(e.index!==null){const a=e.attributes.position,o=e.index;let l=e.groups;l.length===0&&(l=[{start:0,count:o.count,materialIndex:0}]);for(let c=0,h=l.length;c<h;++c){const d=l[c],p=d.start,u=d.count;for(let v=p,g=p+u;v<g;v+=3)for(let m=0;m<3;m++){const f=o.getX(v+m),y=o.getX(v+(m+1)%3);n.fromBufferAttribute(a,f),r.fromBufferAttribute(a,y),i_(n,r,i)===!0&&(t.push(n.x,n.y,n.z),t.push(r.x,r.y,r.z))}}}else{const a=e.attributes.position;for(let o=0,l=a.count/3;o<l;o++)for(let c=0;c<3;c++){const h=3*o+c,d=3*o+(c+1)%3;n.fromBufferAttribute(a,h),r.fromBufferAttribute(a,d),i_(n,r,i)===!0&&(t.push(n.x,n.y,n.z),t.push(r.x,r.y,r.z))}}this.setAttribute("position",new et(t,3))}}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}}function i_(s,e,t){const i=`${s.x},${s.y},${s.z}-${e.x},${e.y},${e.z}`,n=`${e.x},${e.y},${e.z}-${s.x},${s.y},${s.z}`;return t.has(i)===!0||t.has(n)===!0?!1:(t.add(i),t.add(n),!0)}var n_=Object.freeze({__proto__:null,BoxGeometry:fs,CapsuleGeometry:np,CircleGeometry:sp,ConeGeometry:Qc,CylinderGeometry:Jc,DodecahedronGeometry:rp,EdgesGeometry:Hx,ExtrudeGeometry:ml,IcosahedronGeometry:pp,LatheGeometry:fp,OctahedronGeometry:lh,PlaneGeometry:vs,PolyhedronGeometry:Xr,RingGeometry:mp,ShapeGeometry:ch,SphereGeometry:Fa,TetrahedronGeometry:gp,TorusGeometry:vp,TorusKnotGeometry:yp,TubeGeometry:xp,WireframeGeometry:t_});class s_ extends Ri{constructor(e){super(),this.isShadowMaterial=!0,this.type="ShadowMaterial",this.color=new We(0),this.transparent=!0,this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.fog=e.fog,this}}function gl(s){const e={};for(const t in s){e[t]={};for(const i in s[t]){const n=s[t][i];n&&(n.isColor||n.isMatrix3||n.isMatrix4||n.isVector2||n.isVector3||n.isVector4||n.isTexture||n.isQuaternion)?n.isRenderTargetTexture?(Ye("UniformsUtils: Textures of render targets cannot be cloned via cloneUniforms() or mergeUniforms()."),e[t][i]=null):e[t][i]=n.clone():Array.isArray(n)?e[t][i]=n.slice():e[t][i]=n}}return e}function fn(s){const e={};for(let t=0;t<s.length;t++){const i=gl(s[t]);for(const n in i)e[n]=i[n]}return e}function RT(s){const e=[];for(let t=0;t<s.length;t++)e.push(s[t].clone());return e}function r_(s){const e=s.getRenderTarget();return e===null?s.outputColorSpace:e.isXRRenderTarget===!0?e.texture.colorSpace:wt.workingColorSpace}const nn={clone:gl,merge:fn};var LT=`void main() {
3
3
  gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );
4
4
  }`,IT=`void main() {
@@ -9594,7 +9594,7 @@ ${JSON.stringify(l,null,2)}
9594
9594
  width: 16px;
9595
9595
  height: 16px;
9596
9596
  display: block;
9597
- `,e.appendChild(r)}const n=document.createElement("span");n.textContent=t.text||t.url,e.appendChild(n),t.tooltip&&(e.title=t.tooltip)}attachAnnotationEvents(e,t){e.addEventListener("click",i=>{i.stopPropagation();const n=this.annotations.get(t);n&&this.handleClickAnnotation(n)}),e.addEventListener("mouseenter",()=>{const i=this.annotations.get(t);i&&this.handleHoverAnnotation(i)}),e.addEventListener("mouseleave",()=>{this.onHoverAnnotation&&this.onHoverAnnotation(null)})}sphericalToCartesian(e){const t=e.radius??this.sphereRadius;return w2.sphericalToCartesian({...e,radius:t})}updateAnnotationPosition(e){const t=new R(e.worldPosition.x,e.worldPosition.y,e.worldPosition.z),i=this.worldToScreen.worldToScreen(t);e.screenPosition={x:i.x,y:i.y};const n=this.isPositionInFront(t),r=this.isPositionInView(i);e.visible=n&&r,e.visible?(e.element.style.display="block",e.element.style.left=`${i.x}px`,e.element.style.top=`${i.y}px`):e.element.style.display="none"}isPositionInFront(e){const t=new R;return this.camera.getWorldDirection(t),e.clone().normalize().dot(t)>0}isPositionInView(e){const t=this.renderer.domElement.clientWidth,i=this.renderer.domElement.clientHeight;return e.x>=0&&e.x<=t&&e.y>=0&&e.y<=i}update(){this.annotations.forEach(e=>{this.updateAnnotationPosition(e)})}handleClickAnnotation(e){if(e.config.type===Qh.LINK){const t=e.config;window.open(t.url,"_blank")}this.onClickAnnotation&&this.onClickAnnotation(e)}handleHoverAnnotation(e){this.onHoverAnnotation&&this.onHoverAnnotation(e)}setOnClickAnnotation(e){this.onClickAnnotation=e}setOnHoverAnnotation(e){this.onHoverAnnotation=e}removeAnnotation(e){const t=this.annotations.get(e);t&&(t.element.remove(),this.annotations.delete(e))}clearAll(){this.annotations.forEach(e=>{e.element.remove()}),this.annotations.clear()}getAnnotations(){return Array.from(this.annotations.values())}getAnnotation(e){return this.annotations.get(e)}updateCamera(e){this.camera=e,this.worldToScreen.updateCamera(e)}dispose(){this.clearAll(),this.annotationContainer.remove(),this.onClickAnnotation=void 0,this.onHoverAnnotation=void 0}generateId(){return`annotation-${Date.now()}-${Math.random().toString(36).substr(2,9)}`}}class Oz{listeners=new Map;on(e,t){const i=String(e);this.listeners.has(i)||this.listeners.set(i,[]),this.listeners.get(i).push(t)}off(e,t){const i=String(e),n=this.listeners.get(i);if(n){const r=n.indexOf(t);r!==-1&&n.splice(r,1),n.length===0&&this.listeners.delete(i)}}trigger(e,t){const i=String(e),n=this.listeners.get(i);if(n&&n.length>0){const r=[...n];for(const a of r)try{a(t)}catch(o){console.error(`EventModule: Error in event handler for "${i}":`,o)}}}removeAllListeners(e){const t=String(e);this.listeners.delete(t)}clear(){this.listeners.clear()}listenerCount(e){const t=String(e),i=this.listeners.get(t);return i?i.length:0}dispose(){this.clear()}}var Zs=(s=>(s.PanoramaLoadStart="panorama-load-start",s.PanoramaLoadProgress="panorama-load-progress",s.PanoramaLoaded="panorama-loaded",s.PanoramaLoadError="panorama-load-error",s.AnnotationClick="annotation-click",s.AnnotationHover="annotation-hover",s.AnnotationAdd="annotation-add",s.AnnotationRemove="annotation-remove",s.ViewAngleChanged="view-angle-changed",s))(Zs||{});class Uz{sceneModule;cameraModule;renderModule;controlModule;eventModule;panoramaLoader;annotationManager;worldToScreen;isInitialized=!1;version="1.0.0";constructor(e){this.initialize(e)}initialize(e){const t={fov:75,enableZoom:!0,enableRotate:!0,minFov:30,maxFov:90,sphereRadius:500,rotateSpeed:.35,zoomSpeed:.8,enableDamping:!0,dampingFactor:.08,...e},i=document.getElementById(t.containerId);if(!i)throw new Error(`Container with id "${t.containerId}" not found`);try{this.eventModule=new Oz,this.sceneModule=new Az(t.sphereRadius),this.cameraModule=new Pz(i,t.fov,t.minFov,t.maxFov),this.renderModule=new Rz(i,!0),this.controlModule=new Iz(this.cameraModule,this.renderModule.getDomElement());const n=this.controlModule.getControls();n.enableZoom=t.enableZoom,n.enableRotate=t.enableRotate,n.setRotateSpeed(t.rotateSpeed),n.setZoomSpeed(t.zoomSpeed),n.setEnableDamping(t.enableDamping),n.setDampingFactor(t.dampingFactor),n.setZoomLimits(t.minFov,t.maxFov),n.setOnViewAngleChange((r,a)=>{this.eventModule.trigger(Zs.ViewAngleChanged,{theta:r,phi:a})}),this.panoramaLoader=new Nz,this.worldToScreen=new zt(this.cameraModule.getCamera(),this.renderModule.getRenderer(),this.sceneModule.getScene()),this.annotationManager=new kz(i,this.cameraModule.getCamera(),this.renderModule.getRenderer(),t.sphereRadius),this.annotationManager.setOnClickAnnotation(r=>{this.eventModule.trigger(Zs.AnnotationClick,{id:r.id,config:r.config,metadata:r.config.metadata})}),this.annotationManager.setOnHoverAnnotation(r=>{this.eventModule.trigger(Zs.AnnotationHover,{annotation:r?{id:r.id,config:r.config,metadata:r.config.metadata}:null})}),this.setupRenderLoop(),this.isInitialized=!0,console.log("EngineKernel720: Initialized successfully")}catch(n){throw console.error("EngineKernel720: Initialization failed",n),n}}setupRenderLoop(){this.renderModule.setOnBeforeRender(()=>{this.controlModule.update(),this.annotationManager.update()}),this.renderModule.startRenderLoop(this.sceneModule.getScene(),this.cameraModule.getCamera())}async loadPanorama(e){this.checkInitialized(),this.eventModule.trigger(Zs.PanoramaLoadStart,{url:e});try{this.panoramaLoader.setOnProgress(i=>{this.eventModule.trigger(Zs.PanoramaLoadProgress,{url:e,progress:i})});const t=await this.panoramaLoader.loadTexture(e);this.sceneModule.updatePanoramaTexture(t),this.eventModule.trigger(Zs.PanoramaLoaded,{url:e,progress:100}),console.log("EngineKernel720: Panorama loaded successfully")}catch(t){throw console.error("EngineKernel720: Failed to load panorama",t),this.eventModule.trigger(Zs.PanoramaLoadError,{url:e,error:t}),t}}async preloadPanoramas(e){this.checkInitialized();try{await this.panoramaLoader.preloadPanoramas(e),console.log(`EngineKernel720: Preloaded ${e.length} panoramas`)}catch(t){throw console.error("EngineKernel720: Failed to preload panoramas",t),t}}addAnnotation(e){this.checkInitialized();const t=this.annotationManager.addAnnotation(e);return this.eventModule.trigger(Zs.AnnotationAdd,{id:t,config:e}),t}addAnnotations(e){return this.checkInitialized(),e.map(t=>this.addAnnotation(t))}removeAnnotation(e){this.checkInitialized(),this.annotationManager.removeAnnotation(e),this.eventModule.trigger(Zs.AnnotationRemove,{id:e})}clearAnnotations(){this.checkInitialized(),this.annotationManager.clearAll()}getAnnotations(){return this.checkInitialized(),this.annotationManager.getAnnotations()}updateInteractionOptions(e){this.checkInitialized(),this.controlModule.updateInteractionOptions(e)}pickPanoramaPoint(e,t){this.checkInitialized();const i=this.renderModule.getRenderer().domElement,n=i.clientWidth,r=i.clientHeight;if(n===0||r===0)return null;const a=new me(e/n*2-1,-(t/r*2-1)),o=this.cameraModule.getCamera(),l=new R(a.x,a.y,.5);l.unproject(o),l.sub(o.position).normalize();const c=this.sceneModule.getSphereRadius(),h=o.position.clone().add(l.multiplyScalar(c)),d=w2.cartesianToSpherical(h.x,h.y,h.z);return{theta:d.theta,phi:d.phi,radius:c}}lookAt(e,t,i){this.checkInitialized(),i&&console.warn("EngineKernel720: Animated lookAt not implemented yet"),this.controlModule.lookAt(e,t)}getViewAngle(){return this.checkInitialized(),this.controlModule.getViewAngle()}setFov(e){this.checkInitialized(),this.cameraModule.setFov(e)}getFov(){return this.checkInitialized(),this.cameraModule.getFov()}on(e,t){this.checkInitialized(),this.eventModule.on(e,t)}off(e,t){this.checkInitialized(),this.eventModule.off(e,t)}resize(e,t){this.checkInitialized();const i=e??this.renderModule.getRenderer().domElement.clientWidth,n=t??this.renderModule.getRenderer().domElement.clientHeight;this.renderModule.resize(i,n),this.cameraModule.updateAspectRatio(i,n),console.log("EngineKernel720: Resized to",i,"x",n)}pauseRendering(){this.checkInitialized(),this.renderModule.pauseRendering()}resumeRendering(){this.checkInitialized(),this.renderModule.resumeRendering(this.sceneModule.getScene(),this.cameraModule.getCamera())}isRenderingPausedState(){return this.isInitialized?this.renderModule.isRenderingPausedState():!0}getVersion(){return this.version}dispose(){if(this.isInitialized)try{this.renderModule.pauseRendering(),this.annotationManager.dispose(),this.panoramaLoader.dispose(),this.controlModule.dispose(),this.cameraModule.dispose(),this.renderModule.dispose(),this.sceneModule.dispose(),this.eventModule.dispose(),this.isInitialized=!1,console.log("EngineKernel720: Disposed successfully")}catch(e){console.error("EngineKernel720: Error during dispose",e)}}checkInitialized(){if(!this.isInitialized)throw new Error("EngineKernel720: Not initialized")}}function Bz(s){return new QF(s)}function Fz(s){return new Cz(s)}function zz(s){return new Uz(s)}class xa{engine=null;registry;container;containerId;options;_isInitialized=!1;_isDestroyed=!1;unsubscribeTheme=null;currentMeasureType=null;isMeasureActive=!1;currentSectionMode=null;selectedComponent=null;constructor(e,t){this.registry=t,this.container=e.container,this.container.id?this.containerId=this.container.id:(this.containerId=`engine-container-${Date.now()}-${Math.random().toString(36).substr(2,9)}`,this.container.id=this.containerId),this.options={backgroundColor:"linear-gradient(to bottom, rgb(214, 224, 235), rgb(246, 250, 255))",version:e.version??"v2",showStats:e.showStats??!1,showViewCube:e.showViewCube??!0}}init(){if(this._isInitialized){console.warn("[Engine] Engine already initialized.");return}if(this._isDestroyed){console.error("[Engine] Cannot initialize destroyed engine.");return}try{typeof this.options.backgroundColor=="string"&&(this.container.style.background=this.options.backgroundColor);const e={containerId:this.containerId,backgroundColor:this.options.backgroundColor,version:this.options.version,showStats:this.options.showStats,showViewCube:this.options.showViewCube};if(console.log("引擎配置信息:",e),this.engine=Bz(e),!this.engine)throw new Error("Failed to create engine instance");this._isInitialized=!0,this.resize(this.container.clientWidth,this.container.clientHeight),this.unsubscribeTheme=ct.subscribe(t=>{this.setTheme(t)}),this.setTheme(ct.getTheme()),this.engine?.events?.on?(this.engine.events.on("click",t=>{const i=this.registry;console.log("[Engine] 底层 click 事件触发:",t),t&&Array.isArray(t)&&t.length>0&&t[0].url?(this.selectedComponent={url:t[0].url,id:t[0].ids?.[0]},console.log("[Engine] 触发 component:selected:",this.selectedComponent),i.emit("component:selected",this.selectedComponent)):(this.selectedComponent=null,console.log("[Engine] 触发 component:deselected"),i.emit("component:deselected",{}))}),this.engine.events.on("loading_completed",()=>{console.log("[Engine] 底层 LoadingCompleted 事件触发"),this.registry.emit("engine:model-loading-completed",{})})):console.warn("[Engine] 底层引擎不支持 events.on 方法,无法监听点击事件")}catch(e){throw console.error("[Engine] Failed to initialize engine:",e),this._isInitialized=!1,e}}setTheme(e){}setLocales(){}isInitialized(){return this._isInitialized}loadModel(e,t){if(!this._isInitialized||!this.engine){console.error("[Engine] Engine not initialized. Please call init() first.");return}if(!e||e.length===0){console.error("[Engine] Model URLs are required.");return}this.engine.loaderModule.loadModels(e,t)}CameraGoHome(){this.engine.viewCube.CameraGoHome()}onRawEvent(e,t){this.engine?.events?.on(e,t)}offRawEvent(e,t){this.engine?.events?.off(e,t)}pauseRendering(){if(!this._isInitialized||!this.engine){console.warn("[Engine] Engine not initialized.");return}this.engine.pauseRendering()}resumeRendering(){if(!this._isInitialized||!this.engine){console.warn("[Engine] Engine not initialized.");return}this.engine.resumeRendering()}dispose(){if(!this._isInitialized||!this.engine){console.warn("[Engine] Engine not initialized.");return}this.engine.dispose()}resize(e,t){if(!this._isInitialized||!this.engine)return;const i=typeof e=="number"?Math.floor(e):this.container.clientWidth,n=typeof t=="number"?Math.floor(t):this.container.clientHeight;i<=0||n<=0||typeof this.engine.handleWindowResize=="function"&&this.engine.handleWindowResize(i,n)}activateMeasure(e){if(!this._isInitialized||!this.engine?.measure){console.error("[Engine] Cannot activate measure: engine not initialized.");return}if(this.currentMeasureType===e){console.log(`[Engine] Measure ${e} already active, skipping.`);return}this.isMeasureActive||(console.log("[Engine] Activating measure module"),this.engine.measure.active(),this.isMeasureActive=!0),console.log(`[Engine] Activating measure: ${e}`);const t=this.engine.measure;switch(e){case"clearHeight":t.clearHeightMeasure.active();break;case"clearDistance":t.clearDistanceMeasure.active();break;case"distance":t.distanceMeasure.active();break;case"elevation":t.elevationMeasure.active();break;case"point":t.pointMeasure.active();break;case"angle":t.angleMeasure.active();break;case"area":t.areaMeasure.active();break;case"slope":t.slopeMeasure.active();break;default:console.error(`[Engine] Unknown measure type: ${e}`);return}this.currentMeasureType=e}getCurrentMeasureType(){return this.currentMeasureType}deactivateMeasure(){!this._isInitialized||!this.engine?.measure||(console.log("[Engine] Deactivating measure"),this.engine.measure.disActive(),this.engine.measure.clearAll(),this.isMeasureActive=!1,this.currentMeasureType=null)}clearAllMeasures(){!this._isInitialized||!this.engine?.measure||(console.log("[Engine] Clearing all measures"),this.engine.measure.clearAll())}saveMeasureSetting(e){!this._isInitialized||!this.engine?.measure||this.engine.measure.saveSetting?.(e)}setClearHeightDirection(e){!this._isInitialized||!this.engine?.measure||(console.log(`[Engine] Setting clearHeight direction: ${e}`),this.engine.measure.clearHeightMeasure.setDirection(e))}setClearHeightSelectType(e){!this._isInitialized||!this.engine?.measure||(console.log(`[Engine] Setting clearHeight selectType: ${e}`),this.engine.measure.clearHeightMeasure.setSelectType(e))}activeSection(e){if(!this._isInitialized||!this.engine?.clipping){console.error("[Engine] Cannot activate section: engine not initialized.");return}if(this.currentSectionMode===e){console.log(`[Engine] Section ${e} already active, skipping.`);return}console.log(`[Engine] Activating section: ${e}`),this.engine.clipping.active(e),this.currentSectionMode=e}getCurrentSectionMode(){return this.currentSectionMode}setSectionBoxRange(e){if(!this._isInitialized||!this.engine?.clipping){console.error("[Engine] Cannot set section box range: engine not initialized.");return}this.engine.clipping.updateClippingValue(e)}deactivateSection(){!this._isInitialized||!this.engine?.clipping||(console.log("[Engine] Deactivating all sections"),this.engine.clipping.disActive(),this.currentSectionMode=null)}hideSection(){if(!this._isInitialized||!this.engine?.clipping){console.error("[Engine] Cannot hide section: engine not initialized.");return}console.log("[Engine] Hiding section"),this.engine.clipping.disabled()}recoverSection(){if(!this._isInitialized||!this.engine?.clipping){console.error("[Engine] Cannot recover section: engine not initialized.");return}console.log("[Engine] Recovering section"),this.engine.clipping.recover()}fitSectionBoxToModel(){if(!this._isInitialized||!this.engine){console.error("[Engine] Cannot fit section box: engine not initialized.");return}const e=this.engine.engineStatus?.highlightModels;e&&(console.log("[Engine] Fitting section box to model"),this.engine.clipping?.clippingModel(e))}scaleSectionBox(){if(!this._isInitialized||!this.engine?.clipping){console.error("[Engine] Cannot scale section box: engine not initialized.");return}this.engine.clipping.scaleBox()}reverseSection(){if(!this._isInitialized||!this.engine?.clipping){console.error("[Engine] Cannot reverse section: engine not initialized.");return}this.engine.clipping.reverse()}switchCamera(){if(!this._isInitialized||!this.engine?.cameraModule){console.warn("[Engine] Cannot switch camera: engine not initialized.");return}this.engine.cameraModule.switchCurrentCamera()}getCameraType(){return!this._isInitialized||!this.engine?.cameraModule?"perspective":this.engine.cameraModule.getCameraType()===1?"orthographic":"perspective"}getRenderMode(){return!this._isInitialized||!this.engine?.engineModelModule?"balance":this.engine.engineModelModule.getCurrentMode()}setRenderMode(e){if(!this._isInitialized||!this.engine?.engineModelModule){console.warn("[Engine] Cannot set render mode: engine not initialized.");return}try{this.engine.engineModelModule.setMode(e)}catch(t){console.warn("[Engine] Failed to set render mode:",t)}}normalizePercent(e,t){return Number.isFinite(e)?Math.min(100,Math.max(0,Math.round(e))):t}getSettingApi(){return!this._isInitialized||!this.engine?.setting?null:this.engine.setting}callSettingMethod(e,...t){const i=this.getSettingApi();if(!i)return;const n=i[e];if(typeof n=="function")return n.apply(this.engine.setting,t)}hasSettingMethod(e){const t=this.getSettingApi();return t?typeof t[e]=="function":!1}mergeSettingsWithDefaults(e){const t=e.display?.groundId??"0",i=typeof e.display?.showGround=="boolean"?e.display.showGround:t!=="0"&&t!=="";return{render:{mode:e.render?.mode??"advanced",contrast:this.normalizePercent(e.render?.contrast??50,50),saturation:this.normalizePercent(e.render?.saturation??50,50),shadowIntensity:this.normalizePercent(e.render?.shadowIntensity??50,50),lightIntensity:this.normalizePercent(e.render?.lightIntensity??50,50),gtaoIntensity:this.normalizePercent(e.render?.gtaoIntensity??50,50)},display:{showEdge:!!e.display?.showEdge,edgeOpacity:this.normalizePercent(e.display?.edgeOpacity??30,30),showGrid:!!e.display?.showGrid,showLevel:!!e.display?.showLevel,showGround:i,groundId:t,groundHeight:Number.isFinite(e.display?.groundHeight)?Number(e.display?.groundHeight):0},environment:{type:e.environment?.type??"none",hdrId:e.environment?.hdrId??"0",hdrIntensity:this.normalizePercent(e.environment?.hdrIntensity??20,20),skyPreset:e.environment?.skyPreset??"sunrise_clear",skyParams:e.environment?.skyParams??{},skyIntensity:this.normalizePercent(e.environment?.skyIntensity??20,20)}}}getPresetLists(){const e={ground:[],hdr:[],sky:[]},t=this.getSettingApi();if(!t)return e;const i=t.getPresetLists,n=typeof i=="function"?i.call(this.engine.setting):null,r=this.getGroundList().map(o=>({id:o.id,names:[o.name,o.name,o.name]})),a=this.getHDRBackgroundList().map(o=>({id:o.id,names:[o.name,o.name,o.name]}));return{ground:Array.isArray(n?.ground)&&n.ground.length>0?n.ground:r,hdr:Array.isArray(n?.hdr)&&n.hdr.length>0?n.hdr:a,sky:Array.isArray(n?.sky)?n.sky:[]}}getSettings(){const e=this.callSettingMethod("getSettings");return e&&typeof e=="object"?this.mergeSettingsWithDefaults(e):{render:{mode:this.getRenderMode(),contrast:this.normalizePercent(this.getSceneContrast(),50),saturation:this.normalizePercent(this.getSceneSaturation(),50),shadowIntensity:50,lightIntensity:this.normalizePercent(this.getAmbientLightIntensity(),50),gtaoIntensity:50},display:{showEdge:this.getModelEdgeActive(),edgeOpacity:30,showGrid:!1,showLevel:!1,showGround:this.getGroundId()!=="0"&&this.getGroundId()!=="",groundId:this.getGroundId()||"0",groundHeight:this.getGroundElevation()},environment:{type:this.getHDRBackgroundId()&&this.getHDRBackgroundId()!=="0"?"hdr":"none",hdrId:this.getHDRBackgroundId()||"0",hdrIntensity:20,skyPreset:"sunrise_clear",skyParams:{},skyIntensity:20}}}async setSettings(e){if(!this._isInitialized||!this.engine?.setting){console.warn("[Engine] Cannot set settings: engine not initialized.");return}if(this.hasSettingMethod("setSettings"))try{const t=this.callSettingMethod("setSettings",e);await Promise.resolve(t);return}catch(t){console.warn("[Engine] Native setSettings failed, fallback to compatibility mode.",t)}if(e.render?.mode&&this.setRenderMode(e.render.mode),typeof e.render?.lightIntensity=="number"&&this.setAmbientLightIntensity(e.render.lightIntensity),typeof e.render?.contrast=="number"&&this.setSceneContrast(e.render.contrast),typeof e.render?.saturation=="number"&&this.setSceneSaturation(e.render.saturation),typeof e.display?.showEdge=="boolean"&&(e.display.showEdge?this.activeModelEdge():this.disActiveModelEdge()),typeof e.display?.edgeOpacity=="number"&&this.callSettingMethod("setEdgeOpacity",e.display.edgeOpacity),typeof e.display?.showGrid=="boolean"&&this.callSettingMethod("setShowGrid",e.display.showGrid),typeof e.display?.showLevel=="boolean"&&this.callSettingMethod("setShowLevel",e.display.showLevel),typeof e.display?.groundId=="string"&&this.setGroundId(e.display.groundId),typeof e.display?.groundHeight=="number"&&this.setGroundElevation(e.display.groundHeight),typeof e.environment?.type=="string"){const t=this.callSettingMethod("setEnvironmentType",e.environment.type);t!==void 0?await Promise.resolve(t):e.environment.type==="none"&&this.setHDRBackgroundId("0")}if(typeof e.environment?.hdrId=="string"){const t=this.callSettingMethod("setHdrId",e.environment.hdrId);t!==void 0?await Promise.resolve(t):this.setHDRBackgroundId(e.environment.hdrId)}typeof e.environment?.hdrIntensity=="number"&&this.callSettingMethod("setHdrIntensity",e.environment.hdrIntensity),typeof e.environment?.skyPreset=="string"&&this.callSettingMethod("setSkyPreset",e.environment.skyPreset),typeof e.environment?.skyIntensity=="number"&&this.callSettingMethod("setSkyIntensity",e.environment.skyIntensity),e.environment?.skyParams&&typeof e.environment.skyParams=="object"&&this.callSettingMethod("setSkyParams",e.environment.skyParams),typeof e.render?.shadowIntensity=="number"&&this.callSettingMethod("setShadowIntensity",e.render.shadowIntensity),typeof e.render?.gtaoIntensity=="number"&&this.callSettingMethod("setGtaoIntensity",e.render.gtaoIntensity)}async resetToDefault(){const t=this.getSettingApi()?.resetToDefault;if(typeof t=="function"){await Promise.resolve(t.call(this.engine.setting));return}await this.setSettings({render:{mode:"advanced",contrast:50,saturation:50,shadowIntensity:50,lightIntensity:50,gtaoIntensity:50},display:{showEdge:!1,edgeOpacity:30,showGrid:!1,showLevel:!1,showGround:!1,groundId:"0",groundHeight:0},environment:{type:"none",hdrId:"0",hdrIntensity:20,skyPreset:"sunrise_clear",skyParams:{},skyIntensity:20}})}activeModelEdge(){if(!this._isInitialized||!this.engine?.modelEdge){console.warn("[Engine] Cannot active model edge: engine not initialized.");return}this.engine.modelEdge.active()}disActiveModelEdge(){!this._isInitialized||!this.engine?.modelEdge||this.engine.modelEdge.disActive()}getModelEdgeActive(){return!this._isInitialized||!this.engine?.modelEdge?!1:this.engine.modelEdge.getActive?.()??!1}setAmbientLightIntensity(e){if(!this._isInitialized||!this.engine?.setting){console.warn("[Engine] Cannot set ambient light intensity: engine not initialized.");return}this.engine.setting.setAmbientLightIntensity(e)}getAmbientLightIntensity(){return!this._isInitialized||!this.engine?.setting?50:this.engine.setting.getAmbientLightIntensity?.()??50}setSceneContrast(e){if(!this._isInitialized||!this.engine?.setting){console.warn("[Engine] Cannot set scene contrast: engine not initialized.");return}this.engine.setting.setSceneContrast(e)}getSceneContrast(){return!this._isInitialized||!this.engine?.setting?50:this.engine.setting.getSceneContrast?.()??50}setSceneSaturation(e){if(!this._isInitialized||!this.engine?.setting){console.warn("[Engine] Cannot set scene saturation: engine not initialized.");return}this.engine.setting.setSceneSaturation(e)}getSceneSaturation(){return!this._isInitialized||!this.engine?.setting?50:this.engine.setting.getSceneSaturation?.()??50}getHDRBackgroundList(){return!this._isInitialized||!this.engine?.setting?[]:this.engine.setting.getHDRBackground?.()??[]}setHDRBackgroundId(e){if(!this._isInitialized||!this.engine?.setting){console.warn("[Engine] Cannot set HDR background: engine not initialized.");return}this.engine.setting.setHDRBackgroundId(e)}getHDRBackgroundId(){return!this._isInitialized||!this.engine?.setting?"":this.engine.setting.getHDRBackgroundId?.()??""}setHDRBackgroundVisibility(e){if(!this._isInitialized||!this.engine?.setting){console.warn("[Engine] Cannot set HDR background visibility: engine not initialized.");return}this.engine.setting.setHDRBackgroundVisibility(e)}getHDRBackgroundVisibility(){return!this._isInitialized||!this.engine?.setting?!0:this.engine.setting.getHDRBackgroundVisibility?.()??!0}getGroundList(){return!this._isInitialized||!this.engine?.setting?[]:this.engine.setting.getGroundList?.()??[]}setGroundId(e){if(!this._isInitialized||!this.engine?.setting){console.warn("[Engine] Cannot set ground: engine not initialized.");return}this.engine.setting.setGroundId(e)}getGroundId(){return!this._isInitialized||!this.engine?.setting?"":this.engine.setting.getGroundId?.()??""}setGroundElevation(e){if(!this._isInitialized||!this.engine?.setting){console.warn("[Engine] Cannot set ground elevation: engine not initialized.");return}this.engine.setting.setGroundElevation(e)}getGroundElevation(){return!this._isInitialized||!this.engine?.setting?0:this.engine.setting.getGroundElevation?.()??0}isWalkModeActive=!1;activateFirstPersonMode(){if(!this._isInitialized||!this.engine){console.error("[Engine] Cannot activate first person mode: engine not initialized.");return}if(!this.engine.controlModule){console.error("[Engine] Control module not available.");return}if(this.isWalkModeActive){console.log("[Engine] First person mode already active, skipping.");return}console.log("[Engine] Activating first person mode"),this.engine.controlModule.switchFirstPersonMode(),this.loadWalkSettings(),this.isWalkModeActive=!0}deactivateFirstPersonMode(){!this._isInitialized||!this.engine?.controlModule||this.isWalkModeActive&&(console.log("[Engine] Deactivating first person mode"),this.engine.controlModule.switchDefaultMode(),this.isWalkModeActive=!1)}static WALK_SPEED_KEY="bim-walk-speed";static WALK_GRAVITY_KEY="bim-walk-gravity";static WALK_COLLISION_KEY="bim-walk-collision";setWalkSpeed(e){if(!this._isInitialized||!this.engine?.controlModule){console.error("[Engine] Cannot set walk speed: engine not initialized.");return}localStorage.setItem(xa.WALK_SPEED_KEY,String(e)),this.engine.controlModule.setMoveSpeed(e)}setWalkGravity(e){if(!this._isInitialized||!this.engine?.controlModule){console.error("[Engine] Cannot set walk gravity: engine not initialized.");return}localStorage.setItem(xa.WALK_GRAVITY_KEY,String(e)),this.engine.controlModule.setApplyGravity(e)}setWalkCollision(e){if(!this._isInitialized||!this.engine?.controlModule){console.error("[Engine] Cannot set walk collision: engine not initialized.");return}localStorage.setItem(xa.WALK_COLLISION_KEY,String(e)),this.engine.controlModule.setApplyCollision(e)}loadWalkSettings(){if(!this.engine?.controlModule)return;const e=localStorage.getItem(xa.WALK_SPEED_KEY),t=localStorage.getItem(xa.WALK_GRAVITY_KEY),i=localStorage.getItem(xa.WALK_COLLISION_KEY);this.engine.controlModule.setMoveSpeed(e?Number(e):1),this.engine.controlModule.setApplyGravity(t==="true"),this.engine.controlModule.setApplyCollision(i==="true")}toggleMiniMap(){if(!this._isInitialized||!this.engine){console.error("[Engine] Cannot toggle mini map: engine not initialized.");return}this.engine.minMap?.toggle()}getMiniMapState(){return!this._isInitialized||!this.engine?!1:this.engine.minMap?.getstate()??!1}isFirstPersonModeActive(){return this.isWalkModeActive}getSelectedComponent(){return this.selectedComponent}getComponentProperties(e,t,i){if(!this._isInitialized||!this.engine){console.error("[Engine] Cannot get component properties: engine not initialized.");return}if(!this.engine.modelProperties){console.error("[Engine] modelProperties not available");return}console.log("[Engine] Getting component properties:",{url:e,id:t}),this.engine.modelProperties.getModelProperties(e,t,i)}getModelPosition(e){return!this._isInitialized||!this.engine?(console.error("[Engine] Cannot get model position: engine not initialized."),null):this.engine.issueReport?.getMoldePosition?(console.log("[Engine] Getting model position:",e),this.engine.issueReport.getMoldePosition(e)):(console.error("[Engine] getMoldePosition method not available in issueReport"),null)}jumpToCamera(e){if(!this._isInitialized||!this.engine)return console.error("[Engine] Cannot jump to camera: engine not initialized."),!1;if(!this.engine.issueReport?.jumptoCamera)return console.error("[Engine] jumptoCamera method not available in issueReport"),!1;console.log("[Engine] Jumping to camera:",e);try{return this.engine.issueReport.jumptoCamera(e),!0}catch(t){return console.error("[Engine] Failed to jump to camera:",t),!1}}getTypeTreeData(){return!this._isInitialized||!this.engine?.modelTree?[]:this.engine.modelTree.getTypeTreeData()}getLevelTreeData(){return!this._isInitialized||!this.engine?.modelTree?[]:this.engine.modelTree.getLevelTreeData()}getMajorTreeData(){return!this._isInitialized||!this.engine?.modelTree?[]:this.engine.modelTree.getMajorTreeData()}activateZoomBox(){if(!this._isInitialized||!this.engine){console.warn("[Engine] Engine not initialized.");return}this.engine.rangeScale?.active()}getEngineInfo(){return!this._isInitialized||!this.engine?(console.warn("[Engine] Engine not initialized."),null):this.engine.engineInfo.getEngineInfo()}pathRoamingAddPoint(){if(!this._isInitialized||!this.engine?.pathRoaming){console.warn("[Engine] pathRoaming not available");return}this.engine.pathRoaming.addPoint(0)}pathRoamingRemovePoint(e){if(!this._isInitialized||!this.engine?.pathRoaming){console.warn("[Engine] pathRoaming not available");return}this.engine.pathRoaming.removePoint(e)}pathRoamingClearPoints(){if(!this._isInitialized||!this.engine?.pathRoaming){console.warn("[Engine] pathRoaming not available");return}this.engine.pathRoaming.clearPoints()}pathRoamingGetPoints(){return!this._isInitialized||!this.engine?.pathRoaming?(console.warn("[Engine] pathRoaming not available"),[]):this.engine.pathRoaming.getPoints()??[]}pathRoamingJumpToPoint(e){if(!this._isInitialized||!this.engine?.pathRoaming){console.warn("[Engine] pathRoaming not available");return}this.engine.pathRoaming.jumpToPoint(e)}pathRoamingPlay(e){if(!this._isInitialized||!this.engine?.pathRoaming){console.warn("[Engine] pathRoaming not available");return}this.engine.pathRoaming.play(e)}pathRoamingStop(){if(!this._isInitialized||!this.engine?.pathRoaming){console.warn("[Engine] pathRoaming not available");return}this.engine.pathRoaming.stop()}getHighlightModels(){return!this._isInitialized||!this.engine?null:this.engine.engineStatus?.highlightModels??null}highlightModel(e){if(!this._isInitialized||!this.engine?.modelToolModule){console.warn("[Engine] Cannot highlight model: engine not initialized.");return}const t=this.sanitizeModelParams(e);if(t.length)try{this.engine.modelToolModule.highlightModel(t)}catch(i){console.warn("[Engine] highlightModel failed:",i)}}unhighlightAllModels(){if(!this._isInitialized||!this.engine?.modelToolModule){console.warn("[Engine] Cannot unhighlight models: engine not initialized.");return}this.engine.modelToolModule.unhighlightAllModels()}viewScaleToModel(e){if(!this._isInitialized||!this.engine?.modelToolModule){console.warn("[Engine] Cannot view scale to model: engine not initialized.");return}const t=this.sanitizeModelParams(e);if(t.length)try{this.engine.modelToolModule.viewScaleToModel(t)}catch(i){console.warn("[Engine] viewScaleToModel failed:",i)}}hideModels(e){if(!this._isInitialized||!this.engine?.modelToolModule){console.warn("[Engine] Cannot hide models: engine not initialized.");return}const t=this.sanitizeModelParams(e);if(t.length)try{this.engine.modelToolModule.hideModel(t)}catch(i){console.warn("[Engine] hideModels failed:",i)}}showModel(e){if(!this._isInitialized||!this.engine?.modelToolModule){console.warn("[Engine] Cannot show model: engine not initialized.");return}const t=this.sanitizeModelParams(e);if(t.length)try{this.engine.modelToolModule.showModel(t)}catch(i){console.warn("[Engine] showModel failed:",i)}}sanitizeModelParams(e){if(!Array.isArray(e))return[];const t=a=>a.replace(/\/+$/,""),i=Array.isArray(this.engine?.models)?this.engine.models:[],n=new Map;for(const a of i)a?.url&&n.set(t(a.url),a);const r=[];for(const a of e){if(!a||typeof a.url!="string"||!a.url||!Array.isArray(a.ids))continue;const o=n.get(t(a.url));if(!o||!(o.nodesMap instanceof Map))continue;const l=new Set;for(const h of a.ids){if(!Number.isFinite(h))continue;const d=Number(h);if(!Number.isInteger(d))continue;const p=o.nodesMap.get(d);!p||!Array.isArray(p.indexes)||p.indexes.length===0||l.add(d)}const c=Array.from(l);c.length&&r.push({url:a.url,ids:c})}return r}translucentModels(e){if(!this._isInitialized||!this.engine?.modelToolModule){console.warn("[Engine] Cannot translucent models: engine not initialized.");return}e&&this.engine.modelToolModule.translucentModel(e)}unTranslucentModel(){if(!this._isInitialized||!this.engine?.modelToolModule){console.warn("[Engine] Cannot cancel translucent: engine not initialized.");return}this.engine.modelToolModule.unTranslucentModel()}isolateModels(e){if(!this._isInitialized||!this.engine?.modelToolModule){console.warn("[Engine] Cannot isolate models: engine not initialized.");return}e&&this.engine.modelToolModule.isolateModel(e)}translucentOtherModels(e){if(!this._isInitialized||!this.engine?.modelToolModule){console.warn("[Engine] Cannot translucent other models: engine not initialized.");return}e&&this.engine.modelToolModule.translucentOtherModel(e)}showAllModels(){if(!this._isInitialized||!this.engine?.modelToolModule){console.warn("[Engine] Cannot show all models: engine not initialized.");return}this.deactivateSection(),this.engine.modelToolModule.showAllModels()}batchSelectSameTypeModel(e){if(!this._isInitialized||!this.engine?.modelToolModule){console.warn("[Engine] Cannot batch select: engine not initialized.");return}e&&this.engine.modelToolModule.batchSelectSameTypeModel(e)}batchSelectSameLevelModel(e){if(!this._isInitialized||!this.engine?.modelToolModule){console.warn("[Engine] Cannot batch select: engine not initialized.");return}e&&this.engine.modelToolModule.batchSelectSameLevelModel(e)}batchSelectSameLevelTypeModel(e){if(!this._isInitialized||!this.engine?.modelToolModule){console.warn("[Engine] Cannot batch select: engine not initialized.");return}e&&this.engine.modelToolModule.batchSelectSameLevelTypeModel(e)}destroy(){this._isDestroyed||(this.deactivateMeasure(),this.unsubscribeTheme&&(this.unsubscribeTheme(),this.unsubscribeTheme=null),this.engine&&(this.engine.dispose(),this.engine=null),this.container.innerHTML="",this.currentMeasureType=null,this.isMeasureActive=!1,this._isDestroyed=!0,this._isInitialized=!1)}}class Hz{element;content=null;isVisible=!1;onCloseCallback;options;mouseDownTime=0;mouseDownX=0;mouseDownY=0;CLICK_THRESHOLD=200;MOVE_THRESHOLD=5;constructor(e){this.options=e,this.element=document.createElement("div"),this.element.className=`bim-right-key ${e?.className||""}`,e?.zIndex&&(this.element.style.zIndex=e.zIndex.toString()),document.body.appendChild(this.element)}init(){document.addEventListener("mousedown",this.handleGlobalClick),this.element.addEventListener("contextmenu",e=>{e.preventDefault(),e.stopPropagation()}),this.options?.container&&(this.options.container.addEventListener("mousedown",this.handleContainerMouseDown),this.options.container.addEventListener("mouseup",this.handleContainerMouseUp),this.options.container.addEventListener("contextmenu",this.handleContainerContextMenu))}setTheme(e){}setLocales(){}destroy(){document.removeEventListener("mousedown",this.handleGlobalClick),this.options?.container&&(this.options.container.removeEventListener("mousedown",this.handleContainerMouseDown),this.options.container.removeEventListener("mouseup",this.handleContainerMouseUp),this.options.container.removeEventListener("contextmenu",this.handleContainerContextMenu)),this.unmountContent(),this.element.remove()}handleContainerMouseDown=e=>{e.button===2&&(this.mouseDownTime=Date.now(),this.mouseDownX=e.clientX,this.mouseDownY=e.clientY)};handleContainerMouseUp=e=>{if(e.button!==2||Date.now()-this.mouseDownTime>this.CLICK_THRESHOLD)return;const i=e.clientX-this.mouseDownX,n=e.clientY-this.mouseDownY;i*i+n*n>this.MOVE_THRESHOLD*this.MOVE_THRESHOLD||this.options?.onContext&&this.options.onContext(e)};handleContainerContextMenu=e=>{e.preventDefault()};setOnClose(e){this.onCloseCallback=e}mount(e){this.unmountContent(),this.content=e,this.element.appendChild(e.getElement())}unmountContent(){this.content&&(this.content.destroy(),this.element.innerHTML="",this.content=null)}show(e,t){this.element.classList.add("visible"),this.isVisible=!0,this.element.style.left=`${e}px`,this.element.style.top=`${t}px`;const i=this.element.getBoundingClientRect(),n=window.innerWidth,r=window.innerHeight;let a=e,o=t;e+i.width>n&&(a=e-i.width),t+i.height>r&&(o=t-i.height),this.element.style.left=`${a}px`,this.element.style.top=`${o}px`}hide(){this.element.classList.remove("visible"),this.isVisible=!1,this.unmountContent(),this.onCloseCallback&&this.onCloseCallback()}handleGlobalClick=e=>{this.isVisible&&(this.element.contains(e.target)||this.hide())}}class ry{element;options;unsubscribeLocale=null;unsubscribeTheme=null;activeSubMenu=null;constructor(e){this.options=e,this.element=document.createElement("ul"),this.element.className="bim-menu"}init(){this.render(),this.unsubscribeLocale=Zt.subscribe(()=>{this.setLocales()}),this.unsubscribeTheme=ct.subscribe(e=>{this.setTheme(e)})}setTheme(e){const t=this.element.style;t.setProperty("--bim-bg-elevated",e.bgElevated),t.setProperty("--bim-text-primary",e.textPrimary),t.setProperty("--bim-divider",e.divider),t.setProperty("--bim-component-bg-hover",e.componentBgHover),t.setProperty("--bim-shadow-lg",e.shadowLg)}setLocales(){this.element.innerHTML="",this.render()}destroy(){this.unsubscribeLocale&&(this.unsubscribeLocale(),this.unsubscribeLocale=null),this.unsubscribeTheme&&(this.unsubscribeTheme(),this.unsubscribeTheme=null),this.closeSubMenu(),this.element.remove()}getElement(){return this.element}hasAnyIcon(e){return e.some(t=>t.icon?!0:t.children?this.hasAnyIcon(t.children):!1)}render(){const{items:e,groupOrder:t}=this.options;this.hasAnyIcon(e)?this.element.classList.add("has-icons"):this.element.classList.remove("has-icons");const i=new Map,n="default";e.forEach(a=>{const o=a.group||n;i.has(o)||i.set(o,[]),i.get(o).push(a)});let r=[];if(t){r=t.filter(a=>i.has(a));for(const a of i.keys())r.includes(a)||r.push(a)}else r=Array.from(i.keys());r.forEach((a,o)=>{if(o>0){const c=document.createElement("li");c.className="bim-menu-divider",this.element.appendChild(c)}const l=i.get(a);l.sort((c,h)=>(c.order||0)-(h.order||0)),l.forEach(c=>{if(c.visible!==!1&&(this.element.appendChild(this.createItemElement(c)),c.divider)){const h=document.createElement("li");h.className="bim-menu-divider",this.element.appendChild(h)}})})}createItemElement(e){const t=document.createElement("li"),i=!e.disabled;t.className=`bim-menu-item ${i?"":"disabled"}`;const n=document.createElement("div");n.className="bim-menu-item-icon",e.icon&&(n.innerHTML=e.icon),t.appendChild(n);const r=document.createElement("div");r.className="bim-menu-item-label",r.textContent=Se(e.label),t.appendChild(r);const a=e.children,o=a&&a.length>0;if(o){const l=document.createElement("div");l.className="bim-menu-item-arrow",l.innerHTML='<svg viewBox="0 0 24 24"><path d="M10 6L8.59 7.41 13.17 12l-4.58 4.59L10 18l6-6z"/></svg>',t.appendChild(l),t.addEventListener("mouseenter",()=>this.openSubMenu(e,t))}else t.addEventListener("mouseenter",()=>this.closeSubMenu());return i&&t.addEventListener("click",l=>{l.stopPropagation(),console.log(`[BimMenu] Clicked item: ${e.id}`),o||(e.onClick?(console.log(`[BimMenu] Executing onClick for ${e.id}`),e.onClick()):console.warn(`[BimMenu] No onClick handler for ${e.id}`))}),t}openSubMenu(e,t){const i=e.children;if(!i||i.length===0)return;this.closeSubMenu();const n=document.createElement("div");n.style.position="fixed",n.style.zIndex="10001";const r=t.getBoundingClientRect();n.style.top=`${r.top}px`,n.style.left=`${r.right}px`,n.addEventListener("mousedown",l=>l.stopPropagation());const a=new ry({items:i});a.init(),n.appendChild(a.element),document.body.appendChild(n),this.activeSubMenu={menu:a,container:n};const o=n.getBoundingClientRect();o.right>window.innerWidth&&(n.style.left=`${r.left-o.width}px`)}closeSubMenu(){this.activeSubMenu&&(this.activeSubMenu.menu.destroy(),this.activeSubMenu.container.remove(),this.activeSubMenu=null)}}class ay extends jn{container;rightKeyPanel;contextHandlers=[];constructor(e,t){super(t),this.container=e,this.rightKeyPanel=new Hz({zIndex:9e3,container:this.container,onContext:this.handleContextMenu}),this.rightKeyPanel.init()}destroy(){this.rightKeyPanel.destroy(),super.destroy()}registerHandler(e){this.contextHandlers.push(e)}showMenu(e,t,i,n){if(!i||i.length===0)return;const r=new ry({items:i,groupOrder:n});r.init(),this.rightKeyPanel.mount(r),this.rightKeyPanel.show(e,t)}hide(){this.rightKeyPanel.hide()}handleContextMenu=e=>{let t=null;for(const i of this.contextHandlers){const n=i(e);n&&n.length>0&&(t||(t=[]),t=t.concat(n))}t&&t.length>0?this.showMenu(e.clientX,e.clientY,t):this.hide()}}class E2 extends jn{container;engineInstance=null;rightKey=null;constructor(e,t){super(t),this.container=e}getEngineComponent(){return this.engineInstance}initialize(e){this.engineInstance&&this.engineInstance.isInitialized()&&(console.warn("[EngineManager] 3D Engine already initialized. Destroying old instance..."),this.engineInstance.destroy(),this.engineInstance=null);try{return this.engineInstance=new xa({container:this.container,...e},this.registry),this.engineInstance.init(),this.rightKey=new ay(this.container,this.registry),this.rightKey.registerHandler(t=>{const i=this.engineInstance?.getSelectedComponent(),n=[];return i&&(n.push({id:"componentDetail",label:"menu.componentDetail",group:"component",order:1,divider:!0,onClick:()=>{this.registry.componentDetail?.show(),this.rightKey?.hide()}}),n.push({id:"hideSelected",label:"menu.hideSelected",group:"component",order:2,onClick:()=>{const r=this.engineInstance?.getHighlightModels();r&&this.engineInstance?.hideModels(r),this.rightKey?.hide()}}),n.push({id:"transparentSelected",label:"menu.transparentSelected",group:"component",order:3,onClick:()=>{const r=this.engineInstance?.getHighlightModels();r&&this.engineInstance?.translucentModels(r),this.rightKey?.hide()}}),n.push({id:"cancelTranslucent",label:"menu.cancelTranslucent",group:"component",order:4,onClick:()=>{this.engineInstance?.unTranslucentModel(),this.rightKey?.hide()}}),n.push({id:"isolateSelected",label:"menu.isolateSelected",group:"component",order:5,divider:!0,children:[{id:"hideOthers",label:"menu.hideOthers",onClick:()=>{const r=this.engineInstance?.getHighlightModels();r&&this.engineInstance?.isolateModels(r),this.rightKey?.hide()}},{id:"transparentOthers",label:"menu.transparentOthers",onClick:()=>{const r=this.engineInstance?.getHighlightModels();r&&this.engineInstance?.translucentOtherModels(r),this.rightKey?.hide()}}]}),n.push({id:"quickSelect",label:"menu.quickSelect",group:"component",order:6,children:[{id:"selectSameType",label:"menu.selectSameType",onClick:()=>{const r=this.engineInstance?.getHighlightModels();r&&this.engineInstance?.batchSelectSameTypeModel(r),this.rightKey?.hide()}},{id:"selectSameLevel",label:"menu.selectSameLevel",onClick:()=>{const r=this.engineInstance?.getHighlightModels();r&&this.engineInstance?.batchSelectSameLevelModel(r),this.rightKey?.hide()}},{id:"selectSameLevelType",label:"menu.selectSameLevelType",onClick:()=>{const r=this.engineInstance?.getHighlightModels();r&&this.engineInstance?.batchSelectSameLevelTypeModel(r),this.rightKey?.hide()}}]}),n.push({id:"fitSectionBox",label:"menu.fitSectionBox",group:"component",order:7,onClick:()=>{this.engineInstance?.fitSectionBoxToModel(),this.rightKey?.hide()}})),n.push({id:"showAll",label:"menu.showAll",group:"component",order:8,onClick:()=>{this.engineInstance?.showAllModels(),this.emit("menu:show-all",{}),this.rightKey?.hide()}}),n}),this.engineInstance.isInitialized()}catch(t){return console.error("[EngineManager] Failed to initialize 3D engine:",t),this.engineInstance=null,!1}}isInitialized(){return this.engineInstance!==null&&this.engineInstance.isInitialized()}loadModel(e,t){if(!this.engineInstance){console.warn("[EngineManager] 3D Engine not initialized.");return}this.engineInstance.loadModel(e,t)}pauseRendering(){if(!this.engineInstance){console.warn("[EngineManager] 3D Engine not initialized.");return}this.engineInstance.pauseRendering()}resumeRendering(){if(!this.engineInstance){console.warn("[EngineManager] 3D Engine not initialized.");return}this.engineInstance.resumeRendering()}getModelPosition(e){return this.engineInstance?this.engineInstance.getModelPosition(e):(console.warn("[EngineManager] 3D Engine not initialized."),null)}jumpToCamera(e){return this.engineInstance?this.engineInstance.jumpToCamera(e):(console.warn("[EngineManager] 3D Engine not initialized."),!1)}destroy(){this.engineInstance&&(this.engineInstance.destroy(),this.engineInstance=null),this.rightKey&&(this.rightKey.destroy(),this.rightKey=null),super.destroy()}}const T2={测量:'<svg width="48" height="48" viewBox="0 0 48 48"><path fill="currentColor" d="M0,28.207H3.429v3.526H44.571V28.207H48v7.052H0ZM0,3.526v14.1a3.478,3.478,0,0,0,3.429,3.526H6.857V17.629h3.429v3.526h3.429V17.629h3.429v3.526h3.429V10.578H24V21.155h3.429V17.629h3.429v3.526h3.429V17.629h3.429v3.526h3.429V10.578h3.429V21.155A3.478,3.478,0,0,0,48,17.629V3.526A3.478,3.478,0,0,0,44.571,0H3.429A3.478,3.478,0,0,0,0,3.526Z" transform="translate(0 5.456)"/></svg>',地图:'<svg width="48" height="48" viewBox="0 0 48 48"><path fill="currentColor" d="M32.984,563.2H26.329a66.982,66.982,0,0,1-5.471,7.121l-1.455,1.61-1.455-1.61a66.978,66.978,0,0,1-5.471-7.121H5.821L0,580.662H38.8Z" transform="translate(4.598 -537.259)"/><path fill="currentColor" d="M275.4,9.7a9.7,9.7,0,1,0-19.4,0c0,6.636,9.7,17.462,9.7,17.462S275.4,16.337,275.4,9.7Zm-13.582,0a3.88,3.88,0,1,1,3.88,3.88,3.88,3.88,0,0,1-3.88-3.88Z" transform="translate(-241.701 4.598)"/></svg>',框选放大:'<svg width="48" height="48" viewBox="0 0 48 48"><path fill="currentColor" d="M336.351,336.158l-5.5.037-.037-5.5-3.665.025.037,5.5-5.491.037.025,3.665,5.491-.037.041,5.491,3.661-.025-.037-5.491,5.5-.041Z" transform="translate(-305.467 -314.477)"/><path fill="currentColor" d="M41.88,40.861l-.227-.223-7.167-7.068a14.787,14.787,0,1,0-2.832,2.4l7.4,7.3.227.223.021-.021a1.821,1.821,0,0,0,1.065.33,1.849,1.849,0,0,0,1.837-1.862,1.868,1.868,0,0,0-.343-1.061l.017-.021ZM23.648,34.668A11.1,11.1,0,1,1,34.675,23.487,11.106,11.106,0,0,1,23.648,34.668ZM3,41.492H6.241v3.241H3ZM3,15.564H6.241v3.241H3ZM3,2.6H6.241V5.841H3Zm12.964,0h3.241V5.841H15.964Zm-6.482,0h3.241V5.841H9.482Zm12.964,0h3.241V5.841H22.446Zm6.482,0h3.241V5.841H28.928Zm6.482,0h3.241V5.841H35.41Zm6.482,0h3.241V5.841H41.892Zm0,6.482h3.241v3.241H41.892Zm0,6.482h3.241v3.241H41.892Zm0,6.482h3.241v3.241H41.892ZM9.482,41.492h3.241v3.241H9.482Zm6.482,0h3.241v3.241H15.964Zm6.482,0h3.241v3.241H22.446ZM3,9.082H6.241v3.241H3ZM3,22.046H6.241v3.241H3Zm38.892,6.482h3.241v3.241H41.892ZM3,28.528H6.241v3.241H3ZM3,35.01H6.241v3.241H3Z" transform="translate(-0.067 0.333)"/></svg>',漫游:'<svg width="48" height="48" viewBox="0 0 48 48"><path fill="currentColor" d="M327.239,38.548a6.01,6.01,0,1,0-6.358-6A6.144,6.144,0,0,0,327.239,38.548Zm8.006,5.76a3.082,3.082,0,0,0-3.061-2.64h-1.648c-.471,0-.706.24-1.177.48l-2.119,1.68-2.119-1.92a1.781,1.781,0,0,0-1.177-.48h-1.648a2.914,2.914,0,0,0-3.061,2.64l-1.413,10.8c0,.48,0,.96.471,1.2a1.781,1.781,0,0,0,1.177.48h1.648l1.413,15.36a3.082,3.082,0,0,0,3.061,2.64h3.532a2.914,2.914,0,0,0,3.061-2.64l1.413-15.36h1.648a1.781,1.781,0,0,0,1.177-.48,2.2,2.2,0,0,0,.235-1.2Z" transform="translate(-303.239 -26.548)"/></svg>',目录树:'<svg width="48" height="48" viewBox="0 0 48 48"><path fill="currentColor" d="M116.8,153.474h12a1.2,1.2,0,0,0,1.2-1.185v-7.111a1.2,1.2,0,0,0-1.2-1.184h-12a1.2,1.2,0,0,0-1.2,1.184v1.629H93.553v-7.554H100a1.2,1.2,0,0,0,1.2-1.185v-7.112a1.2,1.2,0,0,0-1.2-1.185H83.2a1.2,1.2,0,0,0-1.2,1.185v7.112a1.2,1.2,0,0,0,1.2,1.185h6.45v28a2.383,2.383,0,0,0,2.4,2.37H115.6v1.63a1.2,1.2,0,0,0,1.2,1.185h12a1.2,1.2,0,0,0,1.2-1.185v-7.112a1.2,1.2,0,0,0-1.2-1.185h-12a1.2,1.2,0,0,0-1.2,1.185v1.63H93.553V150.657H115.6v1.629a1.2,1.2,0,0,0,1.2,1.185Z" transform="translate(-82 -126.874)"/></svg>',剖切:'<svg xmlns="http://www.w3.org/2000/svg" width="48" height="48" viewBox="0 0 48 48" fill="currentColor"><g transform="translate(-176.967 -101.068)"><path d="M306.33,364.55h14.737v19.115H306.33Z" transform="translate(-118.068 -248.554)"/><path d="M487.114,140.356a1.6,1.6,0,0,1-1.744-1.393V99.573a1.787,1.787,0,0,1,3.487,0v39.389A1.6,1.6,0,0,1,487.114,140.356Z" transform="translate(-285.677 6.11)"/><path d="M508.34,274.031H487.114a1.743,1.743,0,1,1,0-3.487h17.739V242.767H487.114a1.744,1.744,0,1,1,0-3.487H508.34Z" transform="translate(-285.677 -131.282)"/><path d="M201.437,274.031h-3.278a1.743,1.743,0,1,1,0-3.487h3.278a1.743,1.743,0,1,1,0,3.487Zm-8.858,0H187a1.743,1.743,0,1,1,0-3.487h5.579a1.743,1.743,0,1,1,0,3.487Zm-10.626-.532a1.743,1.743,0,0,1-1.743-1.744v-5.579a1.743,1.743,0,1,1,3.487,0v5.579A1.743,1.743,0,0,1,181.953,273.5Zm0-11.159a1.743,1.743,0,0,1-1.743-1.743v-5.579a1.743,1.743,0,1,1,3.487,0V260.6A1.743,1.743,0,0,1,181.953,262.34Zm0-11.158a1.744,1.744,0,0,1-1.743-1.744v-5.579a1.743,1.743,0,1,1,3.487,0v5.579A1.744,1.744,0,0,1,181.953,251.181Zm19.484-8.414h-5.579a1.744,1.744,0,1,1,0-3.487h5.579a1.744,1.744,0,0,1,0,3.487Zm-11.159,0H184.7a1.744,1.744,0,1,1,0-3.487h5.579a1.744,1.744,0,1,1,0,3.487Z" transform="translate(0 -131.282)"/></g></svg>',剖切盒:'<svg width="48" height="48" viewBox="0 0 48 48" fill="currentColor"><g transform="translate(-56.83 2.793)"><path d="M194.963,19.168a1.69,1.69,0,0,1-.607-.119l-19.027-8.292a1.253,1.253,0,0,1,0-2.35L191.289.112a1.592,1.592,0,0,1,1.24,0l18.663,8.294a1.267,1.267,0,0,1,.791,1.175,1.308,1.308,0,0,1-.791,1.175l-15.6,8.278a1.519,1.519,0,0,1-.633.143Zm-15.7-9.586,15.7,6.832,12.331-6.832L191.9,2.749Z" transform="translate(-109.947 0)"/><path d="M195.008,417.821a1.691,1.691,0,0,1-.607-.119l-19.025-8.294a1.253,1.253,0,0,1,0-2.35l15.958-8.294a1.592,1.592,0,0,1,1.24,0l18.657,8.294a1.267,1.267,0,0,1,.791,1.175,1.308,1.308,0,0,1-.791,1.175l-15.6,8.278c-.211.095-3.483.143-3.694.143Zm-15.6-9.588,15.6,6.832,12.329-6.832L191.948,401.4Z" transform="translate(-109.992 -382.638)"/><path d="M200.046,603.93a1.976,1.976,0,0,1-.634-.119l-18.774-8.3a1.257,1.257,0,0,1-.655-1.754,1.512,1.512,0,0,1,1.931-.595l18.131,8.013,14.971-8.007a1.51,1.51,0,0,1,1.928.6,1.256,1.256,0,0,1-.661,1.75l-15.6,8.282a1.489,1.489,0,0,1-.634.119Z" transform="translate(-115.041 -568.787)"/><path d="M101.029,216.82a1.467,1.467,0,0,1-1-.377,1.237,1.237,0,0,1-.41-.917V198.817a1.413,1.413,0,0,1,2.816,0V215.5a1.241,1.241,0,0,1-.4.931A1.472,1.472,0,0,1,101.029,216.82Zm-34.377.143a1.467,1.467,0,0,1-1-.377,1.237,1.237,0,0,1-.41-.917V198.817a1.413,1.413,0,0,1,2.816,0v16.852a1.237,1.237,0,0,1-.41.917A1.467,1.467,0,0,1,66.652,216.964Zm-5.215,2.8a1.467,1.467,0,0,1-1-.377,1.237,1.237,0,0,1-.41-.917V201.621a1.413,1.413,0,0,1,2.816,0v16.852a1.237,1.237,0,0,1-.41.917A1.467,1.467,0,0,1,61.436,219.768Z" transform="translate(-0.4 -189.683)"/><path d="M60.922,37.617A1.32,1.32,0,0,1,60,37.258a1.2,1.2,0,0,1-.378-.876V20.295a1.3,1.3,0,0,1,2.588,0V36.382a1.276,1.276,0,0,1-1.294,1.235Zm-1.175,8.411a1.341,1.341,0,0,1,1.75-.578l15.126,7.071a1.224,1.224,0,0,1,.6,1.671,1.337,1.337,0,0,1-1.75.572L60.347,47.708a1.228,1.228,0,0,1-.606-1.671Z" transform="translate(0 -18.25)"/><path d="M71.756,44.947a1.337,1.337,0,0,1,1.75-.582l15.126,7.118a1.235,1.235,0,0,1,.6,1.682,1.333,1.333,0,0,1-1.75.576L72.356,46.629a1.239,1.239,0,0,1-.606-1.682ZM59.915,12.652a1.337,1.337,0,0,1,1.75-.582L76.79,19.194a1.235,1.235,0,0,1,.6,1.682,1.333,1.333,0,0,1-1.75.576L60.515,14.334A1.247,1.247,0,0,1,59.915,12.652Z" transform="translate(-0.168 -11.442)"/><path d="M334.418,146.671a1.341,1.341,0,0,1,1.75-.578l15.126,7.073a1.224,1.224,0,0,1,.6,1.671,1.337,1.337,0,0,1-1.75.573l-15.126-7.09a1.25,1.25,0,0,1-.663-.7,1.177,1.177,0,0,1,.058-.945Zm16.3,35.276a1.32,1.32,0,0,1-.917-.36,1.2,1.2,0,0,1-.377-.875v-16.1a1.3,1.3,0,0,1,2.588,0V180.7a1.2,1.2,0,0,1-.38.878,1.321,1.321,0,0,1-.922.357Z" transform="translate(-260.918 -139.687)"/><path d="M576.438,360.4a1.288,1.288,0,0,1-1.294-1.294V342.253a1.294,1.294,0,1,1,2.588,0v16.852A1.3,1.3,0,0,1,576.438,360.4ZM572.8,344.248,573,361.1l-2.613.024-.2-16.857Z" transform="translate(-486.154 -327.316)"/><path d="M508.543,26.833l.192,16.852-2.613.024-.192-16.852Z" transform="translate(-425.253 -25.689)"/></g></svg>',全屏:'<svg width="48" height="48" viewBox="0 0 48 48"><path fill="currentColor" d="M6.241,3.671H12.85a1.734,1.734,0,0,0,1.836-1.836A1.734,1.734,0,0,0,12.85,0H1.469C1.1,0,.734.367.367.734A1.349,1.349,0,0,0,0,1.836V12.85a1.734,1.734,0,0,0,1.836,1.836A1.734,1.734,0,0,0,3.671,12.85V6.241l9.913,9.913a1.817,1.817,0,1,0,2.57-2.57ZM13.584,27.9,6.975,34.51l-3.3,3.3V31.206a1.734,1.734,0,0,0-1.836-1.836A1.734,1.734,0,0,0,0,31.206V42.22a1.734,1.734,0,0,0,1.836,1.836H12.85a1.836,1.836,0,0,0,0-3.671H6.241l3.3-3.3,6.608-6.608a1.817,1.817,0,1,0-2.57-2.57ZM42.22,29.371a1.734,1.734,0,0,0-1.836,1.836v6.608l-3.3-3.3L30.472,27.9a1.817,1.817,0,1,0-2.57,2.57L34.51,37.08l3.3,3.3H31.206a1.836,1.836,0,1,0,0,3.671H42.22a1.734,1.734,0,0,0,1.836-1.836V31.206a1.734,1.734,0,0,0-1.836-1.836ZM42.22,0H31.206a1.734,1.734,0,0,0-1.836,1.836,1.734,1.734,0,0,0,1.836,1.836h6.608l-3.3,3.3L27.9,13.584a1.817,1.817,0,1,0,2.57,2.57L37.08,9.545l3.3-3.3V12.85a1.836,1.836,0,0,0,3.671,0V1.836A1.734,1.734,0,0,0,42.22,0Z" transform="translate(1.972 1.972)"/></svg>',设置:'<svg width="48" height="48" viewBox="0 0 48 48"><path fill="currentColor" d="M112.388,106.443l-2.668-.373a1.687,1.687,0,0,1-1.306-1.031,16.337,16.337,0,0,0-2-3.475,1.681,1.681,0,0,1-.243-1.646l1.012-2.5a1.652,1.652,0,0,0-.709-2.057l-5.769-3.335a1.654,1.654,0,0,0-2.136.415L96.919,94.56a1.693,1.693,0,0,1-1.562.62,15.32,15.32,0,0,0-3.992,0,1.693,1.693,0,0,1-1.562-.62l-1.651-2.113a1.654,1.654,0,0,0-2.136-.415l-5.769,3.33a1.659,1.659,0,0,0-.709,2.057l1.012,2.5a1.679,1.679,0,0,1-.243,1.646,16.141,16.141,0,0,0-2,3.475A1.669,1.669,0,0,1,77,106.066l-2.668.373a1.663,1.663,0,0,0-1.432,1.646v6.665a1.662,1.662,0,0,0,1.427,1.642l2.668.373a1.687,1.687,0,0,1,1.306,1.031,16.338,16.338,0,0,0,2,3.475,1.681,1.681,0,0,1,.243,1.646l-1.012,2.5a1.652,1.652,0,0,0,.709,2.057l5.769,3.33a1.654,1.654,0,0,0,2.136-.415L89.8,128.27a1.693,1.693,0,0,1,1.562-.62,15.321,15.321,0,0,0,3.992,0,1.693,1.693,0,0,1,1.562.62l1.651,2.113a1.654,1.654,0,0,0,2.136.415l5.769-3.33a1.659,1.659,0,0,0,.709-2.057l-1.012-2.5a1.681,1.681,0,0,1,.243-1.646,16.141,16.141,0,0,0,2-3.475,1.669,1.669,0,0,1,1.306-1.031l2.668-.373a1.658,1.658,0,0,0,1.427-1.642v-6.665A1.639,1.639,0,0,0,112.388,106.443ZM93.36,117.893a6.478,6.478,0,1,1,6.478-6.478A6.479,6.479,0,0,1,93.36,117.893Z" transform="translate(-69.355 -87.415)"/></svg>',拾曲面剖切:'<svg xmlns="http://www.w3.org/2000/svg" width="48" height="48" viewBox="0 0 48 48" fill="currentColor"><g transform="translate(-59.63 -21.333)"><path d="M302.465,495.393l2.363-4.363a.842.842,0,0,1,1.091-.273.914.914,0,0,1,.454,1l-1.636,3,11.453-3.454c.091,0,.091,0,.182-.091a.785.785,0,1,1,.273,1.545l-11.453,3.454,3,1.545h.091a.645.645,0,0,1,.182,1,.842.842,0,0,1-1.091.273l-4.545-2.363c-.091,0-.182-.091-.273-.182A.742.742,0,0,1,302.465,495.393Z" transform="translate(205.84 -520.136) rotate(43)"/><path d="M88.23,54.014v2.86l-21.123,8.17V34l21.123-8.17V47.069h2.9l-.207-25.736L64,31.75V69.333L91.129,58.916v-4.9Z"/><path d="M199,255.9l-15.532,6.268v-21.23L199,234.667Z" transform="translate(-113.668 -202.979)"/></g></svg>',轴向剖切:'<svg xmlns="http://www.w3.org/2000/svg" width="48" height="48" viewBox="0 0 48 48" fill="currentColor"><g transform="translate(-59.63 -21.333)"><path d="M.194,3.727,2.558,8.089a.842.842,0,0,0,1.091.273.914.914,0,0,0,.454-1l-1.636-3L13.919,7.817c.091,0,.091,0,.182.091a.785.785,0,1,0,.273-1.545L2.921,2.909l3-1.545h.091a.645.645,0,0,0,.182-1A.842.842,0,0,0,5.1.091L.558,2.454c-.091,0-.182.091-.273.182A.742.742,0,0,0,.194,3.727Z" transform="translate(102.244 57.563) rotate(-178)"/><path d="M88.23,54.014v2.86l-21.123,8.17V34l21.123-8.17V47.069h2.9l-.207-25.736L64,31.75V69.333L91.129,58.916v-4.9Z"/><path d="M199,255.9l-15.532,6.268v-21.23L199,234.667Z" transform="translate(-113.668 -202.979)"/></g></svg>',主视角:'<svg width="48" height="48" viewBox="0 0 48 48"><path fill="currentColor" d="M122.32,181.835v-13.16h-9.87V163.74h19.74v18.095Zm-19.74,0V163.74h9.87v18.095ZM96,163.74,117.385,144l21.385,19.74Z" transform="translate(-93.385 -138.917)"/></svg>',文档:'<svg width="48" height="48" viewBox="0 0 48 48"><path fill="currentColor" d="M64,128h1.714v41.143H64Zm46.286,0H112v41.143h-1.714Zm-44.571,0h44.571v3.429H65.714Zm0,6.857h44.571v3.429H65.714Zm0-3.429h3.429v3.429H65.714Zm8.571,0h3.429v3.429H74.286Zm8.571,0h27.429v3.429H82.857Zm-17.143,36h44.571v1.714H65.714Zm5.143-24H76v1.714H70.857Zm10.286,0h24v1.714h-24Zm-10.286,6.857H76V152H70.857Zm10.286,0h24V152h-24Zm-10.286,6.857H76v1.714H70.857Zm10.286,0h24v1.714h-24Z" transform="translate(-64 -124.571)"/></svg>',第一人称漫游:'<svg xmlns="http://www.w3.org/2000/svg" width="48" height="48" viewBox="0 0 48 48" fill="currentColor"><path d="M178.325,132.27a6.411,6.411,0,0,0,0-9.429,7.359,7.359,0,0,0-9.984,0,6.411,6.411,0,0,0,0,9.429,7.359,7.359,0,0,0,9.984,0Zm-2-7.543a3.845,3.845,0,0,1,0,5.657,4.414,4.414,0,0,1-5.99,0,3.847,3.847,0,0,1,0-5.657,4.414,4.414,0,0,1,5.99,0Zm6.618,31.639q4.975,1.006,4.975,3.189t-4.975,3.189a57.4,57.4,0,0,1-19.226,0q-4.973-1.006-4.973-3.189t4.975-3.189q.777-.156,1.613-.284v-2.521a4.488,4.488,0,0,1-1.412.217,4.761,4.761,0,0,1-.587-.036l-.038,0a29.007,29.007,0,0,0-7.657,2.332q-3.482,1.712-3.482,3.484a2.944,2.944,0,0,0,1.3,2.116,14.359,14.359,0,0,0,4.4,2.293,46.614,46.614,0,0,0,15.477,2.258,46.614,46.614,0,0,0,15.477-2.258,14.362,14.362,0,0,0,4.4-2.293,2.943,2.943,0,0,0,1.3-2.116q0-1.772-3.482-3.484a29.007,29.007,0,0,0-7.657-2.332,4.908,4.908,0,0,1-.625.039,4.488,4.488,0,0,1-1.412-.217v2.521q.836.128,1.613.284Zm-14.788-6.588v5.979q2.391-.2,5.176-.2t5.176.2v-12.2h2.824v6.222a1.25,1.25,0,0,0,.414.942v0l.081.071q.744.1,1.457.22a1.41,1.41,0,0,0,.457-.293,1.25,1.25,0,0,0,.414-.942v-8a3.75,3.75,0,0,0-1.24-2.828,4.2,4.2,0,0,0-2.995-1.172H166.745a4.2,4.2,0,0,0-2.995,1.172,3.75,3.75,0,0,0-1.24,2.828v8a1.268,1.268,0,0,0,.414.942,1.415,1.415,0,0,0,.456.293q.715-.119,1.459-.222.041-.034.081-.071a1.25,1.25,0,0,0,.414-.942v-6.222h2.824Zm-8.471-6.222v-1.778a6.253,6.253,0,0,1,2.067-4.715,7.013,7.013,0,0,1,4.992-1.952h13.176a7.013,7.013,0,0,1,4.992,1.952,6.253,6.253,0,0,1,2.067,4.715v8a3.722,3.722,0,0,1-.484,1.881l0,.005a28.526,28.526,0,0,1,5.841,2.041q5,2.462,5,5.851,0,4.238-7.531,6.9a49.5,49.5,0,0,1-16.469,2.428,49.5,49.5,0,0,1-16.469-2.428q-7.531-2.667-7.531-6.9,0-3.388,5-5.849a28.381,28.381,0,0,1,5.841-2.044,3.707,3.707,0,0,1-.488-1.884Zm24.8,16a13.145,13.145,0,0,0-2.129-.581,54.5,54.5,0,0,0-18.044,0,13.079,13.079,0,0,0-2.127.581,13.078,13.078,0,0,0,2.127.581,54.5,54.5,0,0,0,18.044,0,13.078,13.078,0,0,0,2.127-.581Z" transform="translate(-149.333 -120.889)"/></svg>',反向:'<svg xmlns="http://www.w3.org/2000/svg" width="48" height="48" viewBox="0 0 48 48" fill="currentColor"><g transform="translate(0.364 4.658)"><path d="M0,287.1m0-.817v-2.042a.722.722,0,0,1,.817-.817H44.509a.722.722,0,0,1,.817.817v2.042a.722.722,0,0,1-.817.817H.817A.722.722,0,0,1,0,286.28Z" transform="translate(-0.001 -272.164)"/><path d="M829.7,13.238l-1.443,1.444a.817.817,0,0,1-1.155,0L815.263,2.844a.817.817,0,0,1,0-1.156L816.706.244a.817.817,0,0,1,1.155,0L829.7,12.083a.817.817,0,0,1,0,1.155Z" transform="translate(-782.667)"/><path d="M94.367,648m0,.817v2.042a.722.722,0,0,1-.817.817H49.858a.722.722,0,0,1-.817-.817v-2.042a.722.722,0,0,1,.817-.817H93.55A.722.722,0,0,1,94.367,648.816Z" transform="translate(-47.095 -622.268)"/><path d="M.239,649.97l1.443-1.444a.817.817,0,0,1,1.155,0l11.838,11.838a.817.817,0,0,1,0,1.156l-1.443,1.443a.817.817,0,0,1-1.155,0L.239,651.124a.817.817,0,0,1,0-1.155Z" transform="translate(0 -622.544)"/></g></svg>',路径漫游:'<svg xmlns="http://www.w3.org/2000/svg" width="48" height="48" viewBox="0 0 48 48" fill="currentColor"><g transform="translate(0 -4.9)"><path d="M43.755,35.8a23.352,23.352,0,0,1-8.074-3.095c-1.131-.912-2.263-1.819-2.263-3.458,0-.364-.164-.548-.486-.548-1.776-.364-2.263,0-1.935,2.183a5,5,0,0,0,1.776,3.095,14.337,14.337,0,0,0,4.521,2.551c2.1.912,4.521,1.276,6.461,2.551,1.935,1.091,2.1,2.551.809,4.37A12.572,12.572,0,0,1,37.3,48.187a30.594,30.594,0,0,1-17.115-1.455c-2.585-.912-4.2-.364-5.488,2,0,.184-.164.184-.323.548,2.1.728,3.876,1.455,5.811,2,5.811,1.639,11.786,2.367,17.76.548A14.453,14.453,0,0,0,46.663,45.1c2.422-4.2,1.613-8.381-2.908-9.293Zm-19.7-7.97a11.943,11.943,0,0,0-7.382-10.952A12.17,12.17,0,0,0,3.457,19.546a10.951,10.951,0,0,0-2.3,12.879c2.459,5.329,6.456,9.77,10.453,14.06.463.444.617.444,1.075,0,3.689-4.143,7.382-8.287,10-13.172A11.6,11.6,0,0,0,24.059,27.833Zm-4.151,3.255c-1.692,3.851-4.614,6.955-7.382,10.215-.463.444-.617.3-.921,0A44.891,44.891,0,0,1,4.228,31.088a7.684,7.684,0,0,1-.767-3.109A8.664,8.664,0,0,1,18.22,21.909a8.155,8.155,0,0,1,1.688,9.18ZM33.007,4.9c-5.685,0-9.785,6.416-7.274,11.76,1.454,3.34,4.1,5.745,6.746,8.15a.492.492,0,0,0,.795,0c2.908-2.537,5.554-5.211,7.008-8.821A8.117,8.117,0,0,0,33.007,4.9Zm4.366,10.422A16.825,16.825,0,0,1,33.4,20c-.4.269-.659.269-.926,0a16.342,16.342,0,0,1-3.969-4.545,5.033,5.033,0,1,1,8.864-.132Z"/><path d="M183.031,141.935a2.136,2.136,0,0,0,2.053-2.18,2.084,2.084,0,0,0-2.18-2.18,2.171,2.171,0,0,0-2.053,2.307A2.058,2.058,0,0,0,183.031,141.935Zm-20.094,7.854a4.7,4.7,0,0,0-4.6,4.881,4.913,4.913,0,0,0,4.74,4.881,4.882,4.882,0,0,0-.14-9.762Zm0,6.417a1.77,1.77,0,0,1-1.532-1.532A1.79,1.79,0,0,1,162.937,153a1.611,1.611,0,0,1,1.672,1.672A1.578,1.578,0,0,1,162.937,156.206Z" transform="translate(-150.629 -126.653)"/></g></svg>',适应到模型:'<svg xmlns="http://www.w3.org/2000/svg" width="48" height="48" viewBox="0 0 48 48" fill="currentColor"><g transform="translate(-84.667 -84.667)"><path d="M87.667,97V87.667H97V85.333H86.733a1.4,1.4,0,0,0-1.4,1.4V97Zm0,23.333H85.333V130.6a1.4,1.4,0,0,0,1.4,1.4H97v-2.333H87.667v-9.333Zm32.667,9.333V132H130.6a1.4,1.4,0,0,0,1.4-1.4V120.333h-2.333v9.333h-9.333ZM129.667,97H132V86.733a1.4,1.4,0,0,0-1.4-1.4H120.333v2.333h9.333Z"/><path d="M270.857,243.5l11.3-6.652V223.387l-11.3,6.361V243.5Zm-1.8,0v-13.75l-11.3-6.361v13.456l11.3,6.652Zm-10.278-21.621,11.177,6.284,11.177-6.284L269.958,215.3l-11.177,6.573Zm11.622-8.426,13.1,7.709a.919.919,0,0,1,.448.793v15.419a.926.926,0,0,1-.448.793l-13.1,7.709a.887.887,0,0,1-.9,0l-13.1-7.709a.905.905,0,0,1-.448-.793V221.954a.919.919,0,0,1,.448-.793l13.1-7.709A.887.887,0,0,1,270.4,213.452Z" transform="translate(-161.292 -120.997)"/></g></svg>',隐藏:'<svg xmlns="http://www.w3.org/2000/svg" width="48" height="48" viewBox="0 0 48 48" fill="currentColor"><path d="M61.274,76.178l0-.007-.007,0a32.458,32.458,0,0,0-7.014-9.981L51.53,68.91a28.382,28.382,0,0,1,6.124,8.635c-4.472,9.25-10.809,13.636-19.472,13.636A20.615,20.615,0,0,1,30.6,89.838l-2.937,2.933a23.916,23.916,0,0,0,10.514,2.277q15.472,0,23.088-16.116a3.229,3.229,0,0,0,0-2.755ZM57.839,58.351l-2.274-2.277a.429.429,0,0,0-.608,0l-6.265,6.262a23.775,23.775,0,0,0-10.51-2.281q-15.472,0-23.088,16.116v.007a3.236,3.236,0,0,0,0,2.765,32.617,32.617,0,0,0,7.014,9.985L16.7,94.32a.429.429,0,0,0,0,.608l2.274,2.277a.429.429,0,0,0,.608,0L57.839,58.949a.426.426,0,0,0,0-.6ZM32.113,78.915a6.011,6.011,0,0,1,7.22-7.22l-7.223,7.22Zm9.9-9.9A9.452,9.452,0,0,0,29.43,81.6l-4.6,4.6a28.424,28.424,0,0,1-6.124-8.635c4.475-9.25,10.816-13.636,19.472-13.636a20.615,20.615,0,0,1,7.577,1.343Zm-4.046,14.55a5.752,5.752,0,0,1-1.01-.086l-2.744,2.741A9.446,9.446,0,0,0,46.638,73.794L43.9,76.538a6.018,6.018,0,0,1-5.932,7.024Z" transform="translate(-14.182 -52.64)"/></svg>',重置:'<svg xmlns="http://www.w3.org/2000/svg" width="48" height="48" viewBox="0 0 48 48" fill="currentColor"><path d="M32.936,32.658a15.914,15.914,0,0,1-9.6,3.064c-.451-.006-.9-.042-1.342-.077-.182-.018-.357-.047-.539-.077-.352-.047-.7-.089-1.037-.164-.211-.036-.422-.1-.621-.148-.334-.077-.668-.154-.99-.254-.153-.059-.3-.11-.457-.177-.381-.124-.755-.26-1.113-.414-.082-.036-.162-.071-.24-.1-.422-.2-.844-.408-1.248-.627-.017-.012-.035-.018-.054-.03a16.485,16.485,0,0,1-3.732-2.9c-.017-.018-.035-.042-.054-.059-.34-.355-.668-.721-.979-1.118-.065-.083-.123-.16-.194-.254A17.286,17.286,0,0,1,7.149,18.751h3.98L6.318,9.076,0,18.874H3.942a20.809,20.809,0,0,0,3.5,11.57.871.871,0,0,0,.075.14c.225.34.486.648.724.961.1.113.177.232.274.362.354.443.746.869,1.133,1.285.043.043.075.076.108.113a19.778,19.778,0,0,0,4.436,3.446c.043.027.08.043.128.076.467.259.949.5,1.432.719.124.055.242.113.359.164.419.184.847.335,1.277.493.2.076.4.14.611.21.378.113.762.21,1.153.3.257.065.509.129.772.184a2.252,2.252,0,0,0,.316.076c.37.07.735.1,1.1.151.134.027.27.049.4.065.66.065,1.314.11,1.974.11,4.006,0,8.852-1.3,11.85-4.177a1.908,1.908,0,0,0,.333-2.484,2.228,2.228,0,0,0-2.952.023ZM44.053,20.424a20.728,20.728,0,0,0-3.47-11.537c-.032-.055-.054-.113-.08-.164-.284-.405-.574-.778-.869-1.161a1.289,1.289,0,0,1-.1-.14A19.86,19.86,0,0,0,32.168,1.7c-.086-.032-.155-.076-.242-.11-.456-.195-.922-.362-1.394-.53C30.37,1,30.2.937,30.033.883,29.62.754,29.212.651,28.792.548c-.231-.055-.467-.113-.7-.164-.113-.022-.22-.055-.338-.081-.311-.055-.617-.081-.933-.124C26.6.151,26.392.119,26.18.1,25.655.042,25.135.021,24.616.016c-.1,0-.188-.016-.284-.016-.016,0-.032.005-.049.005A19.124,19.124,0,0,0,13.02,3.695a1.682,1.682,0,0,0-.466,2.515,1.777,1.777,0,0,0,2.309.3A15.251,15.251,0,0,1,24.374,3.45c.486.006.971.03,1.441.077.147.012.287.036.432.059a11.3,11.3,0,0,1,1.16.189c.162.03.334.077.493.11.381.089.744.178,1.107.3a2.577,2.577,0,0,1,.34.124c.422.142.832.29,1.23.467.047.012.082.047.123.059a16.492,16.492,0,0,1,6.182,4.8.367.367,0,0,0,.024.036A17.308,17.308,0,0,1,40.629,20.43H36.645l5.048,9.787L48,20.424Zm0,0" transform="translate(0 4.349)"/></svg>',标高:'<svg width="32" height="32" viewBox="0 0 32 32"><path fill="currentColor" d="M84.131,193.119a1.056,1.056,0,0,1,1.116.982v7.857a1.056,1.056,0,0,1-1.116.982H54.367a1.056,1.056,0,0,1-1.116-.982V194.1a1.056,1.056,0,0,1,1.116-.982Zm-1.116,1.964H55.483v5.893H83.015Zm1.116-13.749a1.064,1.064,0,0,1,1.114.935,1.032,1.032,0,0,1-1.007,1.025l-.107,0H71.2l-7.858,6.914a1.227,1.227,0,0,1-1.578,0l-8.185-7.2-.018-.016-.032-.031.049.047a1.107,1.107,0,0,1-.092-.092l-.011-.014a.869.869,0,0,1-.182-.857l0-.008L53.31,182l.012-.029.02-.045.019-.035a1.1,1.1,0,0,1,.891-.552h.007q.053,0,.107,0ZM68.043,183.3H57.06l5.492,4.831Z" transform="translate(-53.247 -176.136)"/></svg>',距离:'<svg width="32" height="32" viewBox="0 0 32 32"><path fill="currentColor" d="M29.692,3.03,27.55.919a.529.529,0,0,1-.014-.756A.549.549,0,0,1,28.3.15l.014.013,3.067,3.023a.529.529,0,0,1,0,.756L28.317,6.966a.549.549,0,0,1-.767.013.529.529,0,0,1-.014-.756l.014-.013L29.692,4.1H2.31L4.452,6.21a.528.528,0,0,1,.013.756.547.547,0,0,1-.766.013l-.014-.013L.616,3.942a.531.531,0,0,1,0-.756L3.685.163a.548.548,0,0,1,.767.014.528.528,0,0,1,0,.742L2.31,3.03ZM24.136,15.055H23.051V18H21.966v-2.94H20.882V18H19.8v-2.94H18.712V18H17.627v-2.94H16.543v5.078H15.458V15.055H14.373V18H13.288v-2.94H12.2V18H11.119v-2.94H10.034V18H8.949v-2.94H7.865V18H6.78v-2.94H5.7v5.078H4.61V15.055H1.9a.27.27,0,0,0-.272.268v6.413A.269.269,0,0,0,1.9,22H30.1a.268.268,0,0,0,.271-.267V15.323a.269.269,0,0,0-.271-.268H27.39v5.078H26.305V15.055H25.221V18H24.136Zm5.966-1.6A1.884,1.884,0,0,1,32,15.323v6.413a1.885,1.885,0,0,1-1.9,1.871H1.9A1.885,1.885,0,0,1,0,21.736V15.323a1.885,1.885,0,0,1,1.9-1.871Z" transform="translate(0 4.197)"/></svg>',最小距离:'<svg width="32" height="32" viewBox="0 0 32 32"><path fill="currentColor" d="M-5.839,24.8H-34.16A1.875,1.875,0,0,1-36,22.933V16.52a1.887,1.887,0,0,1,1.9-1.871H-5.9A1.887,1.887,0,0,1-4,16.52v6.412A1.875,1.875,0,0,1-5.839,24.8ZM-34.1,16.252a.27.27,0,0,0-.272.268v6.412a.27.27,0,0,0,.272.267H-5.9a.269.269,0,0,0,.271-.267V16.52a.27.27,0,0,0-.271-.268H-8.61V21.33H-9.695V16.252h-1.085v2.939h-1.085V16.252h-1.085v2.939h-1.085V16.252h-1.084v2.939H-16.2V16.252h-1.085v2.939h-1.085V16.252h-1.084V21.33h-1.084V16.252h-1.085v2.939h-1.085V16.252H-23.8v2.939h-1.085V16.252h-1.085v2.939h-1.085V16.252h-1.084v2.939H-29.22V16.252H-30.3V21.33H-31.39V16.252Z" transform="translate(36 2)"/><path fill="currentColor" d="M23.716,7.947V4.875c0-.8-.232-1.085-.765-1.085a1.573,1.573,0,0,0-1.133.585V7.947H20.4V2.75h1.163l.1.687H21.7a2.547,2.547,0,0,1,1.763-.817c1.172,0,1.676.78,1.676,2.089V7.947Zm-7.26,0V2.62h1.58V7.947Zm-3.8,0V4.875c0-.8-.243-1.085-.76-1.085a1.606,1.606,0,0,0-1.049.585V7.947H9.421V4.875c0-.8-.243-1.085-.758-1.085a1.608,1.608,0,0,0-1.05.585V7.947H6.194V2.75H7.36l.1.7H7.5A2.326,2.326,0,0,1,9.169,2.62a1.486,1.486,0,0,1,1.5.91A2.445,2.445,0,0,1,12.4,2.62c1.156,0,1.691.78,1.691,2.089V7.947Zm3.8-6.849a.79.79,0,0,1,1.58,0,.79.79,0,0,1-1.58,0Z" transform="translate(0.333 3.053)"/></svg>',激光边距:'<svg width="32" height="32" viewBox="0 0 32 32"><path fill="currentColor" d="M0,1.293v31.96H32V1.293ZM30.97,32.182H1.03V2.323H30.97Z"/><path fill="currentColor" d="M160.026,291.9l1.6,1.6,7.305-7.305-7.305-7.305-1.6,1.6,4.794,4.566h-6.392v2.283h6.392Zm-5.251,0-4.566-4.566h6.164v-2.283H150.21l4.566-4.566-1.37-1.6L146.1,286.19l7.305,7.305Z" transform="translate(-141.535 -268.917)"/></svg>',角度:'<svg width="32" height="32" viewBox="0 0 32 32"><path fill="currentColor" d="M39.587,50.766h13.7a1,1,0,0,1,0,2H23.171a1,1,0,0,1,0-2h1.418l6.582-7.006v-.006a.517.517,0,0,1,.14-.357.456.456,0,0,1,.337-.144l12.1-12.876a.451.451,0,0,1,.665,0,.524.524,0,0,1,0,.708L32.883,43.355a8.3,8.3,0,0,1,6.7,7.411Zm-.949,0a7.254,7.254,0,0,0-6.611-6.5l-6.108,6.5Z" transform="translate(-22.229 -26.489)"/></svg>',坡度:'<svg width="32" height="32" viewBox="0 0 32 32"><path fill="currentColor" d="M202.1,188.337l2.629-2.191-8.447-3.106,1.533,8.871,2.629-2.194,9.341,11.209,1.656-1.379Zm-13.726-.435a1.075,1.075,0,0,0-1.07-.341,1.057,1.057,0,0,0-.5.277l-5.11,4.08a1.08,1.08,0,0,0-.406.84l-.007,17.386a1.079,1.079,0,0,0,1.077,1.077L205.7,211.2a1.078,1.078,0,0,0,.822-1.774Zm-4.934,21.164.007-15.788,3.968-3.171,15.974,18.941Z" transform="translate(-180.36 -181.131)"/></svg>',体积:'<svg width="32" height="32" viewBox="0 0 32 32"><path fill="currentColor" d="M94.74,86.658V71.189a.371.371,0,0,1,.2-.329l13.869-7.22a.371.371,0,0,1,.344,0l13.053,6.891h0l.819.431a.371.371,0,0,1,.2.328v15.3a.371.371,0,0,1-.2.328l-13.872,7.255a.371.371,0,0,1-.342,0L94.94,86.987a.371.371,0,0,1-.2-.329Zm2.119-.837,11.2,5.8a.024.024,0,0,0,.035-.022V79.483a.371.371,0,0,0-.2-.328l-11.2-5.909a.024.024,0,0,0-.035.021V85.492A.371.371,0,0,0,96.859,85.821Zm13.151-6.459v12a.12.12,0,0,0,.176.106L114,89.474l3.334-1.745,3.771-1.978a.371.371,0,0,0,.2-.328V73.5a.193.193,0,0,0-.284-.171l-10.812,5.708A.371.371,0,0,0,110.01,79.362ZM97.925,71.725l10.839,5.72a.371.371,0,0,0,.346,0L119.8,71.808a.214.214,0,0,0,0-.378l-10.649-5.621a.371.371,0,0,0-.344,0L97.925,71.47A.144.144,0,0,0,97.925,71.725Z" transform="translate(-92.982 -62.907)"/></svg>',空间体积:'<svg width="32" height="32" viewBox="0 0 32 32"><path fill="currentColor" d="M125.977,128.829l13.076-7.363v-13.6l-13.076,6.8Zm-3.126-15.655a.565.565,0,0,1-.258-.064L109.3,106.323a.567.567,0,0,1-.011-1L122.578,98a.567.567,0,0,1,.55,0l13.288,7.325a.567.567,0,0,1-.011,1l-13.292,6.79A.63.63,0,0,1,122.851,113.174ZM110.773,105.8l12.078,6.172,12.078-6.172-12.078-6.657Z" transform="translate(-1.922)"/><path fill="currentColor" d="M120.649,322.52a.58.58,0,0,1-.262-.064l-13.08-6.8a.573.573,0,0,1-.307-.5V301a.566.566,0,0,1,.273-.486.573.573,0,0,1,.558-.019l13.076,6.8a.573.573,0,0,1,.307.5v14.161a.57.57,0,0,1-.565.569Zm-12.511-7.708,11.942,6.206V308.136l-11.942-6.206Zm15.917,9.408a.585.585,0,0,1-.288-.076.567.567,0,0,1-.281-.489V309.49a.562.562,0,0,1,.307-.5l13.076-6.8a.573.573,0,0,1,.558.019.562.562,0,0,1,.273.486v13.6a.568.568,0,0,1-.288.493l-13.076,7.359A.557.557,0,0,1,124.055,324.22Zm.569-14.385V322.68l11.942-6.722V303.629Z" transform="translate(0 -194.822)"/></svg>',close:'<svg width="24" height="24" viewBox="0 0 24 24"><path fill="currentColor" d="M19 6.41L17.59 5L12 10.59L6.41 5L5 6.41L10.59 12L5 17.59L6.41 19L12 13.41L17.59 19L19 17.59L13.41 12z"/></svg>',check:'<svg width="24" height="24" viewBox="0 0 24 24"><path fill="currentColor" d="M9 16.17L4.83 12l-1.42 1.41L9 19L21 7l-1.41-1.41z"/></svg>',warning:'<svg width="24" height="24" viewBox="0 0 24 24"><path fill="currentColor" d="M1 21h22L12 2L1 21zm12-3h-2v-2h2v2zm0-4h-2v-4h2v4z"/></svg>',error:'<svg width="24" height="24" viewBox="0 0 24 24"><path fill="currentColor" d="M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10s10-4.48 10-10S17.52 2 12 2zm1 15h-2v-2h2v2zm0-4h-2V7h2v6z"/></svg>',success:'<svg width="24" height="24" viewBox="0 0 24 24"><path fill="currentColor" d="M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10s10-4.48 10-10S17.52 2 12 2zm-2 15l-5-5l1.41-1.41L10 14.17l7.59-7.59L19 8l-9 9z"/></svg>',plus:'<svg width="24" height="24" viewBox="0 0 24 24"><path fill="currentColor" d="M19 13h-6v6h-2v-6H5v-2h6V5h2v6h6v2z"/></svg>',minus:'<svg width="24" height="24" viewBox="0 0 24 24"><path fill="currentColor" d="M19 13H5v-2h14v2z"/></svg>',arrowUp:'<svg width="24" height="24" viewBox="0 0 24 24"><path fill="currentColor" d="M7.41 15.41L12 10.83l4.59 4.58L18 14l-6-6l-6 6z"/></svg>',arrowUpBold:'<svg width="24" height="24" viewBox="0 0 24 24"><path fill="currentColor" d="M4 12l1.41 1.41L11 7.83V20h2V7.83l5.58 5.59L20 12l-8-8l-8 8z"/></svg>',arrowDown:'<svg width="24" height="24" viewBox="0 0 24 24"><path fill="currentColor" d="M7.41 8.59L12 13.17l4.59-4.58L18 10l-6 6l-6-6z"/></svg>',arrowLeft:'<svg width="24" height="24" viewBox="0 0 24 24"><path fill="currentColor" d="M15.41 7.41L14 6l-6 6l6 6l1.41-1.41L10.83 12z"/></svg>',arrowRight:'<svg width="24" height="24" viewBox="0 0 24 24"><path fill="currentColor" d="M10 6L8.59 7.41L13.17 12l-4.58 4.59L10 18l6-6z"/></svg>',search:'<svg width="24" height="24" viewBox="0 0 24 24"><path fill="currentColor" d="M15.5 14h-.79l-.28-.27A6.471 6.471 0 0 0 16 9.5A6.5 6.5 0 1 0 9.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 4.99L20.49 19l-4.99-5zm-6 0C7.01 14 5 11.99 5 9.5S7.01 5 9.5 5S14 7.01 14 9.5S11.99 14 9.5 14z"/></svg>',refresh:'<svg width="24" height="24" viewBox="0 0 24 24"><path fill="currentColor" d="M17.65 6.35A7.958 7.958 0 0 0 12 4c-4.42 0-7.99 3.58-7.99 8s3.57 8 7.99 8c3.73 0 6.84-2.55 7.73-6h-2.08A5.99 5.99 0 0 1 12 18c-3.31 0-6-2.69-6-6s2.69-6 6-6c1.66 0 3.14.69 4.22 1.78L13 11h7V4l-2.35 2.35z"/></svg>',delete:'<svg width="24" height="24" viewBox="0 0 24 24"><path fill="currentColor" d="M6 19c0 1.1.9 2 2 2h8c1.1 0 2-.9 2-2V7H6v12zM19 4h-3.5l-1-1h-5l-1 1H5v2h14V4z"/></svg>',edit:'<svg width="24" height="24" viewBox="0 0 24 24"><path fill="currentColor" d="M3 17.25V21h3.75L17.81 9.94l-3.75-3.75L3 17.25zM20.71 7.04a.996.996 0 0 0 0-1.41l-2.34-2.34a.996.996 0 0 0-1.41 0l-1.83 1.83l3.75 3.75l1.83-1.83z"/></svg>',save:'<svg width="24" height="24" viewBox="0 0 24 24"><path fill="currentColor" d="M17 3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14c1.1 0 2-.9 2-2V7l-4-4zm-5 16c-1.66 0-3-1.34-3-3s1.34-3 3-3s3 1.34 3 3s-1.34 3-3 3zm3-10H5V5h10v4z"/></svg>',expand:'<svg width="24" height="24" viewBox="0 0 24 24"><path fill="currentColor" d="M16.59 8.59L12 13.17L7.41 8.59L6 10l6 6l6-6z"/></svg>',collapse:'<svg width="24" height="24" viewBox="0 0 24 24"><path fill="currentColor" d="M12 8l-6 6l1.41 1.41L12 10.83l4.59 4.58L18 14z"/></svg>',bot:'<svg width="24" height="24" viewBox="0 0 24 24"><path fill="currentColor" d="M12 2a2 2 0 0 1 2 2c0 .74-.4 1.39-1 1.73V7h1a7 7 0 0 1 7 7h1a1 1 0 0 1 1 1v3a1 1 0 0 1-1 1h-1v1a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-1H2a1 1 0 0 1-1-1v-3a1 1 0 0 1 1-1h1a7 7 0 0 1 7-7h1V5.73c-.6-.34-1-.99-1-1.73a2 2 0 0 1 2-2M7.5 13A2.5 2.5 0 0 0 5 15.5A2.5 2.5 0 0 0 7.5 18a2.5 2.5 0 0 0 2.5-2.5A2.5 2.5 0 0 0 7.5 13m9 0a2.5 2.5 0 0 0-2.5 2.5a2.5 2.5 0 0 0 2.5 2.5a2.5 2.5 0 0 0 2.5-2.5a2.5 2.5 0 0 0-2.5-2.5Z"/></svg>',history:'<svg width="24" height="24" viewBox="0 0 24 24"><path fill="currentColor" d="M13 3a9 9 0 0 0-9 9H1l3.89 3.89l.07.14L9 12H6c0-3.87 3.13-7 7-7s7 3.13 7 7s-3.13 7-7 7c-1.93 0-3.68-.79-4.94-2.06l-1.42 1.42A8.954 8.954 0 0 0 13 21a9 9 0 0 0 0-18zm-1 5v5l4.28 2.54l.72-1.21l-3.5-2.08V8H12z"/></svg>',settings:'<svg width="24" height="24" viewBox="0 0 24 24"><path fill="currentColor" d="M12 15.5A3.5 3.5 0 0 1 8.5 12A3.5 3.5 0 0 1 12 8.5a3.5 3.5 0 0 1 3.5 3.5a3.5 3.5 0 0 1-3.5 3.5m7.43-2.53c.04-.32.07-.64.07-.97c0-.33-.03-.66-.07-1l2.11-1.63c.19-.15.24-.42.12-.64l-2-3.46c-.12-.22-.39-.31-.61-.22l-2.49 1c-.52-.39-1.06-.73-1.69-.98l-.37-2.65A.506.506 0 0 0 14 2h-4c-.25 0-.46.18-.5.42l-.37 2.65c-.63.25-1.17.59-1.69.98l-2.49-1c-.22-.09-.49 0-.61.22l-2 3.46c-.13.22-.07.49.12.64L4.57 11c-.04.34-.07.67-.07 1c0 .33.03.65.07.97l-2.11 1.66c-.19.15-.25.42-.12.64l2 3.46c.12.22.39.3.61.22l2.49-1.01c.52.4 1.06.74 1.69.99l.37 2.65c.04.24.25.42.5.42h4c.25 0 .46-.18.5-.42l.37-2.65c.63-.26 1.17-.59 1.69-.99l2.49 1.01c.22.08.49 0 .61-.22l2-3.46c.12-.22.07-.49-.12-.64l-2.11-1.66Z"/></svg>',loader:'<svg width="24" height="24" viewBox="0 0 24 24"><path fill="currentColor" d="M12 4V2A10 10 0 0 0 2 12h2a8 8 0 0 1 8-8Z"><animateTransform attributeName="transform" dur="0.75s" repeatCount="indefinite" type="rotate" values="0 12 12;360 12 12"/></path></svg>',send:'<svg width="24" height="24" viewBox="0 0 24 24"><path fill="currentColor" d="M2 21l21-9L2 3v7l15 2l-15 2v7z"/></svg>',透视相机:'<svg width="48" height="48" viewBox="0 0 48 48"><path fill="currentColor" d="M24 4L4 14v20l20 10l20-10V14L24 4zm0 4.5l14 7v14l-14 7l-14-7v-14l14-7zM24 18a6 6 0 100 12a6 6 0 000-12z"/></svg>',正交相机:'<svg width="48" height="48" viewBox="0 0 48 48"><path fill="currentColor" d="M6 6h36v36H6V6zm4 4v28h28V10H10zm4 4h20v20H14V14z"/></svg>',default:'<svg width="24" height="24" viewBox="0 0 24 24"><path fill="currentColor" d="M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10s10-4.48 10-10S17.52 2 12 2zm0 18c-4.41 0-8-3.59-8-8s3.59-8 8-8s8 3.59 8 8s-3.59 8-8 8zm-1-13h2v6h-2zm0 8h2v2h-2z"/></svg>'};function Tt(s){const e=T2[s];return e||(console.warn(`[IconManager] Icon "${s}" not found, using default icon`),T2.default)}class Vz{container;wrapper;mainButton;items=[];itemElements=[];itemButtonMap=new Map;toggleStateMap=new Map;isActive=!1;timer=null;unsubscribeTheme=null;unsubscribeLocale=null;mainButtonLabel;onMainButtonClick;pointerX=Number.NaN;pointerY=Number.NaN;maxInteractiveRadius=220;closeDelay;itemsPerRing;MAIN_BUTTON_SIZE=60;SUB_BUTTON_SIZE=46;BASE_RADIUS=80;RING_GAP=40;FAN_START_DEG=170;FAN_END_DEG=280;CANVAS_PADDING=28;constructor(e){this.container=e.container,this.items=e.items===void 0?this.createDefaultItems():[...e.items],this.mainButtonLabel=e.mainButtonLabel??"toolbar.home",this.onMainButtonClick=e.onMainButtonClick,this.itemsPerRing=Math.max(3,e.itemsPerRing??5),this.closeDelay=Math.max(100,e.closeDelay??260),this.wrapper=this.createWrapper(),this.mainButton=this.createMainButton(e.mainButtonIcon),this.wrapper.appendChild(this.mainButton),this.container.appendChild(this.wrapper),this.renderItems(),this.updateLayoutMetrics(),this.bindEvents(),this.setTheme(ct.getTheme()),this.updateLocales(),this.unsubscribeTheme=ct.subscribe(t=>{this.setTheme(t)}),this.unsubscribeLocale=Zt.subscribe(()=>{this.updateLocales()})}createDefaultItems(){return[{id:"zoom",label:"toolbar.zoomBox",icon:Tt("框选放大")},{id:"measure",label:"toolbar.measure",icon:Tt("测量")},{id:"section",label:"toolbar.section",icon:Tt("剖切")},{id:"walk",label:"toolbar.walk",icon:Tt("漫游")},{id:"setting",label:"toolbar.setting",icon:Tt("设置")}]}createWrapper(){const e=document.createElement("div");return e.className="radial-toolbar-wrapper",e}createMainButton(e){const t=document.createElement("button");return t.className="radial-main-btn",t.type="button",t.innerHTML=e??Tt("主视角"),t}bindEvents(){this.mainButton.addEventListener("mouseenter",this.handlePointerEnter),this.mainButton.addEventListener("mouseleave",this.handlePointerLeave),this.mainButton.addEventListener("click",this.handleMainButtonClick),document.addEventListener("click",this.handleDocumentClick),document.addEventListener("mousemove",this.handleDocumentMouseMove),document.addEventListener("mouseleave",this.handleDocumentMouseLeave),document.addEventListener("visibilitychange",this.handleVisibilityChange),window.addEventListener("blur",this.handleWindowBlur)}handleDocumentMouseMove=e=>{this.pointerX=e.clientX,this.pointerY=e.clientY};handleDocumentMouseLeave=()=>{this.pointerX=Number.NaN,this.pointerY=Number.NaN,this.collapse()};handleVisibilityChange=()=>{document.hidden&&(this.pointerX=Number.NaN,this.pointerY=Number.NaN,this.collapse())};handleWindowBlur=()=>{this.pointerX=Number.NaN,this.pointerY=Number.NaN,this.collapse()};handlePointerEnter=()=>{this.timer&&(clearTimeout(this.timer),this.timer=null),this.expand()};handlePointerLeave=e=>{const t=e.relatedTarget;t instanceof Node&&this.wrapper.contains(t)||this.scheduleCollapse()};handleMainButtonClick=e=>{if(e.stopPropagation(),this.onMainButtonClick){this.onMainButtonClick();return}if(this.isActive){this.collapse();return}this.expand()};handleDocumentClick=e=>{const t=e.target;t instanceof Node&&(this.wrapper.contains(t)||this.collapse())};renderItems(){this.itemElements.forEach(e=>e.remove()),this.itemElements=[],this.itemButtonMap.clear(),this.toggleStateMap.clear(),this.items.forEach((e,t)=>{this.toggleStateMap.set(e.id,!!e.isActive);const i=this.createSubButton(e,t);this.wrapper.insertBefore(i,this.mainButton),this.itemElements.push(i),this.itemButtonMap.set(e.id,i)}),this.updateItemPositions()}createSubButton(e,t){const i=document.createElement("button");i.className="radial-sub-btn",i.type="button",i.dataset.index=String(t),this.applyItemActiveClass(i,e);const n=document.createElement("span");return n.className="radial-sub-btn-icon",e.icon?n.innerHTML=e.icon:n.textContent=this.getFallbackLabel(e.label),i.appendChild(n),i.addEventListener("mouseenter",this.handlePointerEnter),i.addEventListener("mouseleave",this.handlePointerLeave),i.addEventListener("click",r=>{if(r.stopPropagation(),e.isToggle){const o=!(this.toggleStateMap.get(e.id)??!1);this.toggleStateMap.set(e.id,o),e.isActive=o,this.applyItemActiveClass(i,e),e.onToggle?.(o,e),this.collapse();return}e.onClick?.(e),this.collapse()}),i}updateItemPositions(){const e=this.itemElements.length,t=this.FAN_END_DEG-this.FAN_START_DEG;this.itemElements.forEach((i,n)=>{const r=Math.floor(n/this.itemsPerRing),a=r*this.itemsPerRing,o=Math.min(this.itemsPerRing,e-a),l=n-a,c=o===1?.5:l/(o-1),d=(this.FAN_START_DEG+t*c)*Math.PI/180,p=this.getBaseRadius(o)+r*this.RING_GAP,u=Math.cos(d)*p,v=Math.sin(d)*p,g=(l+r*.5)*.045,m=(o-1-l+r*.4)*.032;i.style.setProperty("--rt-x",`${u.toFixed(2)}px`),i.style.setProperty("--rt-y",`${v.toFixed(2)}px`),i.style.setProperty("--rt-open-delay",`${g.toFixed(3)}s`),i.style.setProperty("--rt-close-delay",`${m.toFixed(3)}s`)})}updateLayoutMetrics(){const e=this.items.length,t=Math.max(1,Math.ceil(e/this.itemsPerRing)),i=Math.max(1,Math.min(e,this.itemsPerRing)),n=this.getBaseRadius(i)+(t-1)*this.RING_GAP,r=Math.ceil(n+this.MAIN_BUTTON_SIZE+this.SUB_BUTTON_SIZE+this.CANVAS_PADDING*2);this.maxInteractiveRadius=n+this.SUB_BUTTON_SIZE*.7,this.wrapper.style.width=`${r}px`,this.wrapper.style.height=`${r}px`,this.wrapper.style.setProperty("--rt-main-size",`${this.MAIN_BUTTON_SIZE}px`),this.wrapper.style.setProperty("--rt-sub-size",`${this.SUB_BUTTON_SIZE}px`),this.wrapper.style.setProperty("--rt-main-offset",`${(this.MAIN_BUTTON_SIZE-this.SUB_BUTTON_SIZE)/2}px`)}getBaseRadius(e){return this.BASE_RADIUS}scheduleCollapse(){this.timer&&clearTimeout(this.timer),this.timer=window.setTimeout(()=>{if(this.timer=null,this.isPointerInsideToolbar()){this.isActive&&this.scheduleCollapse();return}this.collapse()},this.closeDelay)}isPointerInsideToolbar(){return this.mainButton.matches(":hover")||this.itemElements.some(e=>e.matches(":hover"))?!0:this.isPointerInsideFanRegion()}isPointerInsideFanRegion(){if(!Number.isFinite(this.pointerX)||!Number.isFinite(this.pointerY))return!1;const e=this.mainButton.getBoundingClientRect(),t=e.left+e.width/2,i=e.top+e.height/2,n=this.pointerX-t,r=this.pointerY-i,a=Math.hypot(n,r);if(a<=this.MAIN_BUTTON_SIZE/2)return!0;if(a>this.maxInteractiveRadius)return!1;let o=Math.atan2(r,n)*180/Math.PI;return o<0&&(o+=360),this.FAN_START_DEG<=this.FAN_END_DEG?o>=this.FAN_START_DEG&&o<=this.FAN_END_DEG:o>=this.FAN_START_DEG||o<=this.FAN_END_DEG}expand(){this.isActive||this.items.length===0||(this.isActive=!0,this.wrapper.classList.add("is-active"))}collapse(){this.isActive&&(this.isActive=!1,this.wrapper.classList.remove("is-active"))}updateLocales(){const e=Se(this.mainButtonLabel);this.mainButton.title=e,this.mainButton.setAttribute("aria-label",e),this.itemElements.forEach((t,i)=>{const n=this.items[i];if(!n)return;const r=Se(n.label);if(t.title=r,t.setAttribute("aria-label",r),this.applyItemActiveClass(t,n),!n.icon){const a=t.querySelector(".radial-sub-btn-icon");a&&(a.textContent=this.getFallbackLabel(n.label))}})}applyItemActiveClass(e,t){if(!t.isToggle){e.classList.remove("is-active"),e.dataset.active="false";return}const i=this.toggleStateMap.get(t.id)??!!t.isActive;e.classList.toggle("is-active",i),e.dataset.active=i?"true":"false"}getFallbackLabel(e){const t=Se(e).trim();return t?t.charAt(0).toUpperCase():"?"}setTheme(e){this.wrapper.classList.remove("theme-light","theme-dark"),this.wrapper.classList.add(`theme-${e.name}`);const t=this.wrapper.style;t.setProperty("--bim-primary",e.primary),t.setProperty("--bim-primary-hover",e.primaryHover),t.setProperty("--bim-primary-active",e.primaryActive),t.setProperty("--bim-text-inverse",e.textInverse),t.setProperty("--bim-icon-inverse",e.iconInverse),t.setProperty("--bim-shadow-glow",e.shadowGlow),t.setProperty("--rt-main-bg",e.bgBase),t.setProperty("--rt-main-bg-hover",e.bgBase),t.setProperty("--rt-main-border",e.floatingBtnBorder),t.setProperty("--rt-main-shadow",e.floatingBtnShadow),t.setProperty("--rt-main-shadow-hover",e.floatingBtnShadowHover),t.setProperty("--rt-main-icon",e.floatingIconColor),t.setProperty("--rt-main-icon-hover",e.floatingIconColorHover),t.setProperty("--rt-sub-bg",e.bgBase),t.setProperty("--rt-sub-bg-hover",e.primaryHover),t.setProperty("--rt-sub-border",e.floatingBtnBorder),t.setProperty("--rt-sub-shadow",e.floatingBtnShadow),t.setProperty("--rt-sub-shadow-hover",e.floatingBtnShadowHover),t.setProperty("--rt-sub-icon",e.floatingIconColor),t.setProperty("--rt-sub-icon-hover",e.iconHover)}setItemActive(e,t){const i=this.items.find(r=>r.id===e);if(!i||!i.isToggle)return;i.isActive=t,this.toggleStateMap.set(e,t);const n=this.itemButtonMap.get(e);n&&this.applyItemActiveClass(n,i)}init(){}setLocales(){this.updateLocales()}destroy(){this.timer&&(clearTimeout(this.timer),this.timer=null),this.unsubscribeTheme&&(this.unsubscribeTheme(),this.unsubscribeTheme=null),this.unsubscribeLocale&&(this.unsubscribeLocale(),this.unsubscribeLocale=null),document.removeEventListener("click",this.handleDocumentClick),document.removeEventListener("mousemove",this.handleDocumentMouseMove),document.removeEventListener("mouseleave",this.handleDocumentMouseLeave),document.removeEventListener("visibilitychange",this.handleVisibilityChange),window.removeEventListener("blur",this.handleWindowBlur),this.mainButton.removeEventListener("mouseenter",this.handlePointerEnter),this.mainButton.removeEventListener("mouseleave",this.handlePointerLeave),this.mainButton.removeEventListener("click",this.handleMainButtonClick),this.itemElements.forEach(e=>{e.removeEventListener("mouseenter",this.handlePointerEnter),e.removeEventListener("mouseleave",this.handlePointerLeave)}),this.wrapper.parentNode&&this.wrapper.parentNode.removeChild(this.wrapper)}}const Gz=s=>({id:"measure",label:"toolbar.measure",icon:Tt("测量"),isToggle:!0,isActive:s.bottomDock?.isOpen("measure")??!1,onToggle:e=>{const t=s.bottomDock;if(!t){console.warn("[RadialToolbar] bottom dock not initialized: measure");return}e?t.open("measure"):t.close("measure"),console.log(`[RadialToolbar] 测量${e?"已打开":"已关闭"}`)}}),Wz=s=>({id:"section",label:"toolbar.section",icon:Tt("剖切"),isToggle:!0,isActive:s.bottomDock?.isOpen("section")??!1,onToggle:e=>{const t=s.bottomDock;if(!t){console.warn("[RadialToolbar] bottom dock not initialized: section");return}e?t.open("section"):t.close("section"),console.log(`[RadialToolbar] 剖切${e?"已打开":"已关闭"}`)}}),Xz=s=>({id:"setting",label:"toolbar.setting",icon:Tt("设置"),onClick:()=>{s.setting?.toggle(),console.log(`[RadialToolbar] 设置${s.setting?.isOpen()?"已打开":"已关闭"}`)}}),jz=s=>({id:"walk",label:"toolbar.walk",icon:Tt("漫游"),isToggle:!0,isActive:s.bottomDock?.isOpen("walk")??!1,onToggle:e=>{const t=s.bottomDock;if(!t){console.warn("[RadialToolbar] bottom dock not initialized: walk");return}e?t.open("walk"):t.close("walk"),console.log(`[RadialToolbar] 漫游${e?"已打开":"已关闭"}`)}});class C2 extends jn{toolbar=null;unsubscribeDockState=null;constructor(e,t,i){super(t),this.toolbar=new Vz({container:e,items:i?.items??this.createDefaultItems(),itemsPerRing:i?.itemsPerRing??4,mainButtonIcon:Tt("主视角"),mainButtonLabel:"toolbar.home",onMainButtonClick:()=>{console.log("[RadialToolbar] main: home"),this.registry.engine3d?.getEngineComponent()?.CameraGoHome()}}),this.toolbar.setTheme(ct.getTheme()),this.unsubscribeDockState=this.registry.bottomDock?.onStateChange(({id:n,open:r})=>{this.toolbar?.setItemActive(n,r)})??null,this.syncInitialToggleStates()}createDefaultItems(){return[Xz(this.registry),Gz(this.registry),Wz(this.registry),jz(this.registry)]}syncInitialToggleStates(){const e=this.registry.bottomDock;!e||!this.toolbar||(this.toolbar.setItemActive("measure",e.isOpen("measure")),this.toolbar.setItemActive("section",e.isOpen("section")),this.toolbar.setItemActive("walk",e.isOpen("walk")))}destroy(){this.unsubscribeDockState&&(this.unsubscribeDockState(),this.unsubscribeDockState=null),this.toolbar?.destroy(),this.toolbar=null,super.destroy()}}class qz{container;root;panelGap=10;panelMap=new Map;panelOrder=[];resizeObserver;handleWindowResize=()=>{this.reflow()};constructor(e){this.container=e,this.root=document.createElement("div"),this.root.className="bottom-dock-stack",this.container.appendChild(this.root),this.resizeObserver=typeof ResizeObserver<"u"?new ResizeObserver(()=>{this.reflow()}):null,this.resizeObserver||window.addEventListener("resize",this.handleWindowResize)}setTheme(e){const t=this.root.style;t.setProperty("--bd-bg",e.floatingBtnBg),t.setProperty("--bd-border",e.floatingBtnBorder),t.setProperty("--bd-shadow",e.floatingBtnShadow),t.setProperty("--bd-close-color",e.floatingIconColor),t.setProperty("--bd-close-color-hover",e.floatingIconColorHover),t.setProperty("--bd-close-bg-hover",e.floatingBtnBgHover),t.setProperty("--bd-close-border-hover",e.floatingBtnBorder),t.setProperty("--bd-body-bg",e.floatingBtnBg),t.setProperty("--bd-placeholder-border",e.borderSubtle),t.setProperty("--bd-placeholder-text",e.textSecondary)}hasPanel(e){return this.panelMap.has(e)}addPanel(e){const t=this.panelMap.get(e.id);if(t&&t.leaving){t.leaving=!1,t.element.classList.remove("is-leaving"),t.removeTimer&&(clearTimeout(t.removeTimer),t.removeTimer=null),t.bodyElement.replaceChildren(e.content),this.panelOrder.includes(e.id)||this.panelOrder.push(e.id),this.reflow();return}if(t)return;const i=document.createElement("section");i.className="bottom-dock-panel is-entering",i.dataset.panelId=e.id;let n=null;e.closable!==!1&&(n=document.createElement("button"),n.className="bottom-dock-panel-close",n.type="button",n.setAttribute("aria-label","close-panel"),n.textContent="×",n.addEventListener("click",a=>{a.stopPropagation(),e.onClose(e.id)}),i.appendChild(n));const r=document.createElement("div");r.className="bottom-dock-panel-body",r.appendChild(e.content),i.appendChild(r),this.root.appendChild(i),this.panelOrder.push(e.id),this.panelMap.set(e.id,{id:e.id,element:i,bodyElement:r,closeButton:n,leaving:!1,removeTimer:null}),this.resizeObserver?.observe(i),this.reflow(),requestAnimationFrame(()=>{i.classList.remove("is-entering")})}removePanel(e){const t=this.panelMap.get(e);if(!t||t.leaving)return;t.leaving=!0,t.element.classList.add("is-leaving");const i=this.panelOrder.indexOf(e);i>=0&&this.panelOrder.splice(i,1),this.reflow(),t.removeTimer=window.setTimeout(()=>{this.resizeObserver?.unobserve(t.element),t.element.remove(),this.panelMap.delete(e),t.removeTimer=null},220)}createPlaceholderContent(e){const t=document.createElement("div");return t.className="bottom-dock-placeholder",t.textContent=e,t}destroy(){this.resizeObserver?.disconnect(),window.removeEventListener("resize",this.handleWindowResize),this.panelMap.clear(),this.panelOrder.length=0,this.root.remove()}reflow(){let e=0,t=0;this.panelOrder.forEach(r=>{const a=this.panelMap.get(r);a&&(a.element.style.transform=`translateX(-50%) translateY(-${e}px)`,e+=a.element.offsetHeight+this.panelGap,t=Math.max(t,a.element.offsetWidth))});const i=this.panelOrder.length,n=i>0?e-this.panelGap:0;this.root.style.height=`${n}px`,this.root.style.width=i>0?`${t}px`:"0px"}}class A2 extends jn{stack;definitions=new Map;openStates=new Map;listeners=new Set;unsubscribeTheme=null;constructor(e,t){super(t),this.stack=new qz(e),this.stack.setTheme(ct.getTheme()),this.unsubscribeTheme=ct.subscribe(i=>{this.stack.setTheme(i)}),this.registerDefaultPanels()}register(e){this.definitions.set(e.id,e),this.openStates.has(e.id)||this.openStates.set(e.id,!1)}unregister(e){this.isOpen(e)&&this.close(e),this.definitions.delete(e),this.openStates.delete(e)}toggle(e){if(this.isOpen(e)){this.close(e);return}this.open(e)}open(e){const t=this.definitions.get(e);if(!t){console.warn(`[BottomDock] Unknown panel id: ${e}`);return}if(this.isOpen(e))return;const i=t.createContent?t.createContent():this.stack.createPlaceholderContent(`${t.title} 面板内容占位`);this.stack.addPanel({id:e,content:i,closable:t.closable!==!1,onClose:()=>{this.close(e)}}),this.openStates.set(e,!0),this.emitState({id:e,open:!0})}close(e){this.isOpen(e)&&(this.stack.removePanel(e),this.openStates.set(e,!1),this.emitState({id:e,open:!1}))}isOpen(e){return this.openStates.get(e)??!1}createPlaceholderContent(e){return this.stack.createPlaceholderContent(e)}onStateChange(e){return this.listeners.add(e),()=>{this.listeners.delete(e)}}destroy(){this.unsubscribeTheme&&(this.unsubscribeTheme(),this.unsubscribeTheme=null),this.listeners.clear(),this.definitions.clear(),this.openStates.clear(),this.stack.destroy(),super.destroy()}emitState(e){this.listeners.forEach(t=>{t(e)})}registerDefaultPanels(){this.register({id:"measure",title:"测量",createContent:()=>{const e=this.registry.measureDock?.getPanelElement();return e||this.stack.createPlaceholderContent("测量面板占位")}}),this.register({id:"section",title:"剖切",createContent:()=>{const e=this.registry.sectionDock?.getPanelElement();return e||this.stack.createPlaceholderContent("剖切面板占位")}}),this.register({id:"walk",title:"漫游",createContent:()=>{const e=this.registry.walkDock?.getPanelElement();return e||this.stack.createPlaceholderContent("漫游面板占位")}})}}const _a={clearHeight:'<svg aria-hidden="true" viewBox="0 0 48 48"><path d="M19.0032 32.1184C18.712 32.1184 18.4032 32.1184 18.112 32.4096C17.512 32.6992 17.8224 33.5904 18.112 33.8816L23.1472 38.6256C23.7472 38.9152 24.6192 38.9152 24.928 38.6256L29.9632 33.8816C30.2528 33.5904 30.2528 33.2816 30.2528 32.9904C30.2528 32.3904 29.6528 32.1008 29.072 32.1008L25.7856 32.1008L25.7856 16.2192L29.0256 16.2192C29.3152 16.2192 29.6256 16.2192 29.9152 15.928C30.5152 15.6368 30.2064 14.7472 29.9152 14.456L24.8816 9.7072C24.2816 9.4176 23.4096 9.4176 23.0992 9.7072L18.0656 14.4512C17.7744 14.7424 17.7744 15.0512 17.7744 15.3424C17.7744 15.9424 18.3744 16.232 18.9568 16.232L22.24 16.232L22.24 32.1328L19.0016 32.1328L19.0016 32.1184L19.0032 32.1184ZM4.75842 6.80639L43.2384 6.80639C44.128 6.80639 44.7104 6.20639 44.7104 5.33442C44.7104 4.1536 44.1088 3.2624 43.2384 3.2624L4.75678 3.2624C4.1568 3.2624 3.5744 3.8624 3.2848 4.73442C3.2848 5.62561 3.8848 6.5152 4.75678 6.80639L4.75842 6.80639ZM43.256 41.1936L4.75842 41.1936C4.1584 41.1936 3.576 41.7936 3.2864 42.6656C3.2864 43.5568 3.8864 44.4464 4.75842 44.7376L43.2384 44.7376C44.128 44.7376 44.7104 44.1376 44.7104 43.2656C44.728 42.08 44.1328 41.1936 43.256 41.1936Z" fill="currentColor"/></svg>',clearDistance:'<svg aria-hidden="true" viewBox="0 0 48 48"><path d="M15.2619 20.2135C15.2619 20.8776 14.5628 21.2125 14.0415 21.0436L4.13531 16.0541C4.10363 16.0394 4.07281 16.023 4.04285 16.005C4.0129 15.987 3.98397 15.9675 3.95607 15.9464C3.92817 15.9254 3.90144 15.9029 3.87591 15.879C3.85037 15.8552 3.82615 15.83 3.80326 15.8036L3.80909 35.8838C3.80909 36.8159 3.18577 37.4393 2.2537 37.4393C1.32163 37.4393 0.701223 36.8159 0.701223 35.8838L0.701223 9.16557C0.698312 8.2335 1.31872 7.61016 2.25079 7.61016C3.18286 7.61016 3.80618 8.2335 3.80618 9.16557L3.80035 14.8075C3.82324 14.7811 3.84746 14.7559 3.873 14.7321C3.89853 14.7082 3.92525 14.6858 3.95315 14.6647C3.98106 14.6437 4.00999 14.6242 4.03994 14.6062C4.0699 14.5881 4.10072 14.5718 4.1324 14.557L14.0444 9.56752C14.5687 9.23546 15.2619 9.56752 15.2619 10.2316L15.2619 13.9074L32.9566 13.9074C33.3644 13.9074 33.6557 13.6628 33.7314 13.2725L33.7488 13.0686L33.7488 10.2142C33.7488 9.71316 34.3838 9.20925 34.8557 9.54422L43.8938 14.5803C44.0132 14.6415 44.1181 14.7259 44.2026 14.8337L44.1968 8.07624C44.1968 7.14413 44.8201 6.52374 45.7521 6.52374C46.6842 6.52374 47.3044 7.14413 47.3044 8.07624L47.3044 36.0383C47.3044 36.0637 47.3038 36.0891 47.3025 36.1145C47.3016 36.1399 47.2998 36.1652 47.2974 36.1905C47.2948 36.2158 47.2917 36.241 47.288 36.2662C47.2842 36.2914 47.2798 36.3164 47.2749 36.3413C47.2698 36.3663 47.2642 36.3911 47.258 36.4157C47.252 36.4404 47.2453 36.4649 47.2378 36.4892C47.2303 36.5136 47.2224 36.5377 47.2139 36.5617C47.2055 36.5856 47.1964 36.6093 47.1867 36.6328C47.1767 36.6563 47.1664 36.6795 47.1558 36.7025C47.1448 36.7255 47.1334 36.7482 47.1216 36.7707C47.1094 36.7931 47.0969 36.8152 47.0841 36.837C47.0709 36.8588 47.0574 36.8803 47.0433 36.9015C47.0289 36.9226 47.0142 36.9434 46.9992 36.9638C46.9842 36.9843 46.9686 37.0043 46.9524 37.024C46.9361 37.0436 46.9195 37.0629 46.9027 37.0818C46.8855 37.1006 46.8679 37.119 46.8501 37.137C46.8321 37.155 46.8137 37.1726 46.7949 37.1897C46.7761 37.2068 46.7569 37.2234 46.7372 37.2395C46.7176 37.2557 46.6975 37.2713 46.6772 37.2865C46.6568 37.3017 46.636 37.3163 46.6149 37.3305C46.5937 37.3447 46.5723 37.3583 46.5505 37.3714C46.5287 37.3845 46.5066 37.397 46.4842 37.409C46.4618 37.4211 46.4391 37.4325 46.4161 37.4434C46.3932 37.4543 46.3699 37.4646 46.3464 37.4744C46.323 37.4842 46.2993 37.4933 46.2754 37.5019C46.2514 37.5105 46.2273 37.5186 46.203 37.526C46.1786 37.5334 46.1542 37.5402 46.1296 37.5464C46.1049 37.5526 46.0801 37.5582 46.0552 37.5632C46.0302 37.5683 46.0052 37.5726 45.9801 37.5764C45.9549 37.5802 45.9297 37.5833 45.9044 37.5859C45.8791 37.5884 45.8537 37.5903 45.8284 37.5916C45.803 37.5929 45.7775 37.5936 45.7521 37.5936C44.8201 37.5936 44.1968 36.9732 44.1968 36.0412L44.1997 15.8357C44.1783 15.8546 44.1554 15.8715 44.1309 15.8861C44.1064 15.9008 44.0807 15.9131 44.054 15.9231L35.0188 20.9562C34.544 21.2912 33.9091 20.9562 33.9091 20.2863L33.9091 17.4318C33.9091 16.9279 33.5887 16.593 33.1168 16.593L15.2619 16.59L15.2619 20.2135L15.2619 20.2135ZM41.0889 24.2796L41.0889 36.0412C41.0889 36.8975 40.3899 37.5936 39.5335 37.5936C38.6014 37.5936 37.981 36.9732 37.981 36.0412L37.981 24.2796C37.981 23.3475 38.6014 22.7243 39.5335 22.7243C40.4656 22.7243 41.0889 23.3475 41.0889 24.2796ZM28.6604 24.2796L28.6604 36.0412C28.6603 36.0665 28.6596 36.0919 28.6584 36.1173C28.657 36.1426 28.6551 36.168 28.6526 36.1932C28.6501 36.2185 28.6469 36.2437 28.6432 36.2688C28.6394 36.2939 28.6351 36.3189 28.63 36.3438C28.625 36.3687 28.6194 36.3935 28.6133 36.4181C28.607 36.4427 28.6002 36.4672 28.5929 36.4915C28.5855 36.5158 28.5774 36.5399 28.5689 36.5638C28.5603 36.5877 28.5512 36.6113 28.5414 36.6348C28.5317 36.6583 28.5213 36.6815 28.5105 36.7044C28.4996 36.7274 28.4881 36.75 28.4762 36.7724C28.4642 36.7948 28.4517 36.8168 28.4386 36.8386C28.4255 36.8604 28.4119 36.8819 28.3978 36.903C28.3837 36.9241 28.369 36.9448 28.3539 36.9652C28.3388 36.9856 28.3232 37.0056 28.3071 37.0253C28.2909 37.0449 28.2744 37.0641 28.2573 37.0829C28.2402 37.1017 28.2227 37.1201 28.2048 37.1381C28.1868 37.156 28.1684 37.1735 28.1496 37.1906C28.1308 37.2076 28.1116 37.2242 28.092 37.2404C28.0723 37.2564 28.0523 37.2721 28.032 37.2872C28.0115 37.3024 27.9908 37.317 27.9697 37.3311C27.9486 37.3452 27.9272 37.3588 27.9054 37.3719C27.8836 37.385 27.8615 37.3975 27.8391 37.4094C27.8167 37.4214 27.7941 37.4329 27.7712 37.4438C27.7482 37.4546 27.725 37.4649 27.7015 37.4747C27.6781 37.4844 27.6544 37.4936 27.6305 37.5022C27.6066 37.5107 27.5825 37.5187 27.5582 37.5261C27.5339 37.5335 27.5094 37.5403 27.4848 37.5465C27.4602 37.5527 27.4354 37.5583 27.4105 37.5633C27.3857 37.5683 27.3606 37.5727 27.3355 37.5765C27.3104 37.5802 27.2852 37.5833 27.2599 37.5859C27.2347 37.5884 27.2094 37.5903 27.184 37.5916C27.1586 37.5929 27.1333 37.5936 27.1079 37.5936C26.1758 37.5936 25.5525 36.9732 25.5525 36.0412L25.5525 24.2796C25.5525 23.3475 26.1758 22.7243 27.1079 22.7243C28.0399 22.7243 28.6604 23.3475 28.6604 24.2796ZM10.019 24.2796L10.019 36.0412C10.0189 36.0666 10.0183 36.092 10.017 36.1174C10.0156 36.1428 10.0138 36.1681 10.0112 36.1934C10.0087 36.2187 10.0055 36.2439 10.0018 36.2691C9.99798 36.2942 9.99357 36.3193 9.9886 36.3442C9.98359 36.3691 9.97796 36.3939 9.97178 36.4185C9.96554 36.4432 9.95874 36.4677 9.95134 36.492C9.94393 36.5163 9.93592 36.5404 9.92729 36.5644C9.91867 36.5883 9.90952 36.612 9.89978 36.6355C9.88998 36.659 9.87967 36.6822 9.86879 36.7051C9.85787 36.7281 9.84638 36.7508 9.83438 36.7732C9.82238 36.7956 9.80982 36.8177 9.79674 36.8395C9.78362 36.8613 9.77003 36.8828 9.75587 36.9039C9.74171 36.925 9.72704 36.9458 9.7119 36.9662C9.69671 36.9866 9.68101 37.0066 9.66488 37.0262C9.64876 37.0459 9.63212 37.0651 9.61506 37.0839C9.59795 37.1027 9.58042 37.1212 9.56242 37.1391C9.54442 37.1571 9.52599 37.1745 9.50715 37.1916C9.48826 37.2087 9.46899 37.2253 9.44935 37.2414C9.42967 37.2575 9.40965 37.2731 9.38921 37.2883C9.36878 37.3034 9.34796 37.318 9.32682 37.3321C9.30563 37.3462 9.28417 37.3598 9.26237 37.3729C9.24053 37.3859 9.2184 37.3984 9.19599 37.4104C9.17359 37.4224 9.15085 37.4338 9.12788 37.4446C9.10487 37.4555 9.08162 37.4658 9.05818 37.4755C9.03465 37.4852 9.01093 37.4944 8.98703 37.5029C8.96303 37.5115 8.93888 37.5195 8.9146 37.5268C8.89023 37.5342 8.86576 37.541 8.8411 37.5471C8.81645 37.5533 8.79165 37.5589 8.76671 37.5638C8.74178 37.5688 8.7167 37.5731 8.69157 37.5768C8.6664 37.5805 8.64118 37.5837 8.61587 37.5862C8.59056 37.5886 8.56524 37.5905 8.53984 37.5917C8.51443 37.593 8.48903 37.5936 8.46362 37.5936C7.53156 37.5936 6.90821 36.9732 6.90821 36.0412L6.90821 24.2796C6.90821 23.3475 7.53156 22.7243 8.46362 22.7243C9.39568 22.7243 10.0161 23.3475 10.0161 24.2796L10.019 24.2796ZM33.3207 29.7147C34.2527 29.7147 34.8732 30.3381 34.8732 31.2701L34.8732 36.0412C34.8731 36.0665 34.8724 36.0919 34.8712 36.1173C34.8699 36.1426 34.8679 36.168 34.8654 36.1932C34.8629 36.2185 34.8597 36.2437 34.856 36.2688C34.8522 36.2939 34.8478 36.3189 34.8429 36.3438C34.8378 36.3687 34.8323 36.3935 34.8261 36.4181C34.8198 36.4427 34.813 36.4672 34.8057 36.4915C34.7983 36.5158 34.7903 36.5399 34.7817 36.5638C34.7731 36.5877 34.7639 36.6113 34.7542 36.6348C34.7445 36.6583 34.7341 36.6815 34.7233 36.7044C34.7124 36.7274 34.701 36.75 34.689 36.7724C34.677 36.7948 34.6644 36.8168 34.6514 36.8386C34.6383 36.8604 34.6247 36.8819 34.6106 36.903C34.5965 36.9241 34.5819 36.9448 34.5668 36.9652C34.5516 36.9856 34.536 37.0056 34.5199 37.0253C34.5038 37.0449 34.4872 37.0641 34.4701 37.0829C34.453 37.1017 34.4356 37.1201 34.4176 37.1381C34.3996 37.156 34.3812 37.1735 34.3624 37.1906C34.3436 37.2076 34.3244 37.2242 34.3048 37.2404C34.2851 37.2564 34.2652 37.2721 34.2448 37.2872C34.2244 37.3024 34.2036 37.317 34.1825 37.3311C34.1614 37.3452 34.1399 37.3588 34.1182 37.3719C34.0964 37.385 34.0743 37.3975 34.0519 37.4094C34.0296 37.4214 34.0069 37.4329 33.9839 37.4438C33.961 37.4546 33.9378 37.4649 33.9144 37.4747C33.8909 37.4844 33.8672 37.4936 33.8433 37.5022C33.8194 37.5107 33.7953 37.5187 33.771 37.5261C33.7467 37.5335 33.7223 37.5403 33.6977 37.5465C33.673 37.5527 33.6482 37.5583 33.6234 37.5633C33.5984 37.5683 33.5734 37.5727 33.5484 37.5765C33.5232 37.5802 33.498 37.5833 33.4727 37.5859C33.4475 37.5884 33.4222 37.5903 33.3968 37.5916C33.3714 37.5929 33.3461 37.5936 33.3207 37.5936C32.3886 37.5936 31.7682 36.9732 31.7682 36.0412L31.7682 31.2701C31.7682 30.3381 32.3886 29.7147 33.3207 29.7147ZM22.4446 31.2701L22.4446 36.0412C22.4446 36.8975 21.7485 37.5936 20.8892 37.5936C19.9572 37.5936 19.3367 36.9732 19.3367 36.0412L19.3367 31.2701C19.3367 30.3381 19.9572 29.7147 20.8892 29.7147C21.8213 29.7147 22.4446 30.3381 22.4446 31.2701ZM16.2289 31.2701L16.2289 36.0412C16.2288 36.0665 16.2282 36.0919 16.2269 36.1173C16.2256 36.1426 16.2237 36.168 16.2211 36.1932C16.2186 36.2185 16.2155 36.2437 16.2117 36.2688C16.2079 36.2939 16.2036 36.3189 16.1986 36.3438C16.1936 36.3687 16.188 36.3935 16.1818 36.4181C16.1756 36.4427 16.1688 36.4672 16.1614 36.4915C16.154 36.5158 16.146 36.5399 16.1374 36.5638C16.1288 36.5877 16.1197 36.6113 16.11 36.6348C16.1002 36.6583 16.0899 36.6815 16.079 36.7044C16.0681 36.7274 16.0567 36.75 16.0447 36.7724C16.0328 36.7948 16.0202 36.8168 16.0072 36.8386C15.994 36.8604 15.9804 36.8819 15.9664 36.903C15.9522 36.9241 15.9376 36.9448 15.9225 36.9652C15.9073 36.9856 15.8917 37.0056 15.8756 37.0253C15.8595 37.0449 15.8429 37.0641 15.8259 37.0829C15.8088 37.1017 15.7913 37.1201 15.7734 37.1381C15.7554 37.156 15.737 37.1735 15.7182 37.1906C15.6994 37.2076 15.6801 37.2242 15.6605 37.2404C15.6409 37.2564 15.6209 37.2721 15.6005 37.2872C15.5801 37.3024 15.5594 37.317 15.5382 37.3311C15.5171 37.3452 15.4957 37.3588 15.4739 37.3719C15.4521 37.385 15.43 37.3975 15.4077 37.4094C15.3853 37.4214 15.3626 37.4329 15.3397 37.4438C15.3167 37.4546 15.2935 37.4649 15.2701 37.4747C15.2466 37.4844 15.2229 37.4936 15.199 37.5022C15.1751 37.5107 15.151 37.5187 15.1268 37.5261C15.1025 37.5335 15.078 37.5403 15.0534 37.5465C15.0287 37.5527 15.0039 37.5583 14.9791 37.5633C14.9542 37.5683 14.9292 37.5727 14.9041 37.5765C14.8789 37.5802 14.8538 37.5833 14.8285 37.5859C14.8032 37.5884 14.7779 37.5903 14.7526 37.5916C14.7271 37.5929 14.7018 37.5936 14.6764 37.5936C13.7444 37.5936 13.1239 36.9732 13.1239 36.0412L13.1239 31.2701C13.1239 30.3381 13.7444 29.7147 14.6764 29.7147C15.6085 29.7147 16.2289 30.3381 16.2289 31.2701Z" fill="currentColor"/></svg>',distance:'<svg viewBox="0 0 32 32" aria-hidden="true"><g transform="translate(0 4.197)"><path fill="currentColor" d="M29.692,3.03,27.55.919a.529.529,0,0,1-.014-.756A.549.549,0,0,1,28.3.15l.014.013,3.067,3.023a.529.529,0,0,1,0,.756L28.317,6.966a.549.549,0,0,1-.767.013.529.529,0,0,1-.014-.756l.014-.013L29.692,4.1H2.31L4.452,6.21a.528.528,0,0,1,.013.756.547.547,0,0,1-.766.013l-.014-.013L.616,3.942a.531.531,0,0,1,0-.756L3.685.163a.548.548,0,0,1,.767.014.528.528,0,0,1,0,.742L2.31,3.03ZM24.136,15.055H23.051V18H21.966v-2.94H20.882V18H19.8v-2.94H18.712V18H17.627v-2.94H16.543v5.078H15.458V15.055H14.373V18H13.288v-2.94H12.2V18H11.119v-2.94H10.034V18H8.949v-2.94H7.865V18H6.78v-2.94H5.7v5.078H4.61V15.055H1.9a.27.27,0,0,0-.272.268v6.413A.269.269,0,0,0,1.9,22H30.1a.268.268,0,0,0,.271-.267V15.323a.269.269,0,0,0-.271-.268H27.39v5.078H26.305V15.055H25.221V18H24.136Zm5.966-1.6A1.884,1.884,0,0,1,32,15.323v6.413a1.885,1.885,0,0,1-1.9,1.871H1.9A1.885,1.885,0,0,1,0,21.736V15.323a1.885,1.885,0,0,1,1.9-1.871Z"/></g></svg>',elevation:'<svg viewBox="0 0 32 32" aria-hidden="true"><path fill="currentColor" d="M84.131,193.119a1.056,1.056,0,0,1,1.116.982v7.857a1.056,1.056,0,0,1-1.116.982H54.367a1.056,1.056,0,0,1-1.116-.982V194.1a1.056,1.056,0,0,1,1.116-.982Zm-1.116,1.964H55.483v5.893H83.015Zm1.116-13.749a1.064,1.064,0,0,1,1.114.935,1.032,1.032,0,0,1-1.007,1.025l-.107,0H71.2l-7.858,6.914a1.227,1.227,0,0,1-1.578,0l-8.185-7.2-.018-.016-.032-.031.049.047a1.107,1.107,0,0,1-.092-.092l-.011-.014a.869.869,0,0,1-.182-.857l0-.008L53.31,182l.012-.029.02-.045.019-.035a1.1,1.1,0,0,1,.891-.552h.007q.053,0,.107,0ZM68.043,183.3H57.06l5.492,4.831Z" transform="translate(-53.247 -176.136)"/></svg>',point:'<svg aria-hidden="true" viewBox="0 0 48 48"><path d="M40.1698 18.0929C40.1428 20.5301 39.3645 22.7586 38.3131 24.9092C36.7378 28.1319 34.6461 31.0118 32.3727 33.7664C30.2564 36.3308 27.9853 38.7519 25.5613 41.0284C24.7143 41.8237 23.9413 41.8481 23.073 41.0687C18.5767 37.0334 14.5359 32.6092 11.4515 27.3755C10.9495 26.5238 10.4945 25.6458 10.1025 24.7372C9.73107 23.8761 10.0514 22.9753 10.8534 22.6034C11.6577 22.2304 12.582 22.5576 12.9732 23.4086C14.8167 27.4176 17.5132 30.8241 20.4598 34.0548C21.596 35.3006 22.7863 36.4939 24.0184 37.6454C24.1708 37.7877 24.2667 37.9033 24.4831 37.6853C28.5664 33.5709 32.3892 29.2509 35.1723 24.1156C35.9836 22.6186 36.66 21.0543 36.8866 19.3498C37.2281 16.7802 36.712 14.3356 35.493 12.0807C33.1715 7.78618 29.5679 5.33714 24.6496 5.16445C19.0467 4.96786 14.0685 8.58606 12.3051 13.9294C11.8621 15.2717 11.6275 16.6474 11.6092 18.061C11.5962 19.0717 10.9335 19.7853 10.0201 19.783C9.10383 19.7808 8.43479 19.0505 8.43746 18.056C8.45818 10.5393 13.6357 4.02759 20.9324 2.34148C26.9693 0.946299 33.4364 3.45514 37.0904 8.60424C39.1088 11.4483 40.1115 14.6187 40.1698 18.0929ZM6.42075 43.1971C18.363 43.1971 30.2366 43.1971 42.1204 43.1971C42.1186 42.9919 41.9834 42.8579 41.8977 42.7076C40.3484 39.9866 38.7956 37.2673 37.2401 34.5498C36.9062 33.9668 36.8856 33.3861 37.257 32.8222C37.5915 32.314 38.0819 32.0681 38.6918 32.1099C39.2399 32.1477 39.6712 32.4169 39.9425 32.8899C42.0656 36.5932 44.1915 40.2948 46.2926 44.0105C46.9411 45.1576 46.1392 46.3818 44.7752 46.3821C37.6695 46.3845 30.564 46.3832 23.4585 46.3832C16.9643 46.3832 10.4699 46.3507 3.97625 46.4082C2.51885 46.4212 1.62531 45.0904 2.42647 43.7424C4.52293 40.2152 6.51577 36.6264 8.55216 33.0634C8.99072 32.2962 9.67627 31.9592 10.3942 32.1457C11.456 32.4219 11.9181 33.5491 11.3553 34.5444C10.2685 36.467 9.16594 38.3807 8.07099 40.2987C7.53258 41.2418 6.99643 42.1859 6.42075 43.1971ZM30.6461 17.8271C30.6465 21.3322 27.7864 24.1813 24.2754 24.1734C20.7946 24.1656 17.9554 21.3147 17.9555 17.8276C17.9557 14.3185 20.8087 11.4763 24.3244 11.4829C27.8051 11.4893 30.6458 14.3402 30.6461 17.8271ZM24.3201 14.6556C22.5583 14.656 21.1314 16.0714 21.1285 17.8213C21.1256 19.591 22.5741 21.0173 24.3575 21.0005C26.0699 20.9844 27.4807 19.5391 27.4733 17.8085C27.4659 16.0808 26.0403 14.6552 24.3201 14.6556Z" fill="currentColor"/></svg>',angle:'<svg viewBox="0 0 32 32" aria-hidden="true"><path fill="currentColor" d="M39.587,50.766h13.7a1,1,0,0,1,0,2H23.171a1,1,0,0,1,0-2h1.418l6.582-7.006v-.006a.517.517,0,0,1,.14-.357.456.456,0,0,1,.337-.144l12.1-12.876a.451.451,0,0,1,.665,0,.524.524,0,0,1,0,.708L32.883,43.355a8.3,8.3,0,0,1,6.7,7.411Zm-.949,0a7.254,7.254,0,0,0-6.611-6.5l-6.108,6.5Z" transform="translate(-22.229 -26.489)"/></svg>',area:'<svg aria-hidden="true" viewBox="0 0 48 48"><path d="M28.7725 16.8582L16.6882 28.9801C16.0335 29.6368 16.0335 30.7313 16.6882 31.3881C17.0156 31.7164 17.452 31.8806 17.8885 31.8806C18.3249 31.8806 18.7614 31.7164 19.0887 31.3881L31.173 19.2662C31.8277 18.6094 31.8277 17.5149 31.173 16.8582C30.5183 16.2015 29.4272 16.2015 28.7725 16.8582Z" fill="currentColor"/><path d="M44.5667 11.9055C45.385 11.9055 46.0397 11.2488 46.0397 10.4552L46.0397 3.47761C46.0397 2.65672 45.385 2 44.5667 2L37.6107 2C36.7924 2 36.1377 2.65672 36.1377 3.47761L36.1377 5.06468L11.9418 5.06468L11.9418 3.47761C11.9418 2.65672 11.2871 2 10.4688 2L3.51277 2C2.69442 2 2.03974 2.65672 2.03974 3.47761L2.03974 10.4279C2.03974 11.2488 2.69442 11.9055 3.51277 11.9055L5.20403 11.9055L5.20403 36.0671L3.51277 36.0671C2.69442 36.0671 2.03974 36.7239 2.03974 37.5448L2.03974 44.5224C2.03974 45.3433 2.69442 46 3.51277 46L10.4688 46C11.2598 46 11.9145 45.3433 11.9418 44.5224L11.9418 42.7438L36.1377 42.7438L36.1377 44.5224C36.1377 45.3433 36.7924 46 37.6107 46L44.5667 46C45.385 46 46.0397 45.3433 46.0397 44.5224L46.0397 37.5448C46.0397 36.7239 45.385 36.0671 44.5667 36.0671L42.7936 36.0671L42.7936 11.9055L44.5667 11.9055ZM39.0837 4.92786L43.0937 4.92786L43.0937 8.95024L39.0837 8.95024L39.0837 4.92786ZM4.9858 4.92786L8.99572 4.92786L8.99572 8.95024L4.9858 8.95024L4.9858 4.92786ZM8.99572 43.0448L4.9858 43.0448L4.9858 39.0224L8.99572 39.0224L8.99572 43.0448ZM43.0937 43.0448L39.0837 43.0448L39.0837 39.0224L43.0937 39.0224L43.0937 43.0448ZM39.3838 36.0671L37.6107 36.0671C36.7924 36.0671 36.1377 36.7239 36.1377 37.5448L36.1377 39.3234L11.9418 39.3234L11.9418 37.5448C11.9418 36.7239 11.2871 36.0671 10.4688 36.0671L8.61382 36.0671L8.61382 11.9055L10.4688 11.9055C11.2598 11.9055 11.9145 11.2488 11.9418 10.4552L11.9418 8.48507L36.1377 8.48507L36.1377 10.4279C36.1377 11.2488 36.7924 11.9055 37.6107 11.9055L39.3838 11.9055L39.3838 36.0671Z" fill="currentColor"/></svg>',slope:'<svg viewBox="0 0 32 32" aria-hidden="true"><path fill="currentColor" d="M202.1,188.337l2.629-2.191-8.447-3.106,1.533,8.871,2.629-2.194,9.341,11.209,1.656-1.379Zm-13.726-.435a1.075,1.075,0,0,0-1.07-.341,1.057,1.057,0,0,0-.5.277l-5.11,4.08a1.08,1.08,0,0,0-.406.84l-.007,17.386a1.079,1.079,0,0,0,1.077,1.077L205.7,211.2a1.078,1.078,0,0,0,.822-1.774Zm-4.934,21.164.007-15.788,3.968-3.171,15.974,18.941Z" transform="translate(-180.36 -181.131)"/></svg>'},dc={distance:{key:"distance",callBackType:"distance",icon:_a.distance,order:0},clearHeight:{key:"clearHeight",callBackType:"clear-height",icon:_a.clearHeight,order:1},clearDistance:{key:"clearDistance",callBackType:"clear-distance",icon:_a.clearDistance,order:2},elevation:{key:"elevation",callBackType:"elevation",icon:_a.elevation,order:3},point:{key:"point",callBackType:"point",icon:_a.point,order:4},angle:{key:"angle",callBackType:"angle",icon:_a.angle,order:5},area:{key:"area",callBackType:"area",icon:_a.area,order:6},slope:{key:"slope",callBackType:"slope",icon:_a.slope,order:7}},P2=Object.values(dc).sort((s,e)=>s.order-e.order).map(s=>s.key);function R2(s){switch(s){case"clearHeight":case"clearDistance":case"distance":case"elevation":return"length";case"area":return"area";case"angle":return"angle";case"slope":return"percent";default:return"point"}}function L2(s){return Object.values(dc).find(e=>e.callBackType===s)?.key}const Zz=["distance","clearHeight","clearDistance","elevation"],Yz=["point","angle","area","slope"],I2="bim-engine:measure:config",$z={unit:"mm",precision:2};class Kz{element;options;modeButtons=new Map;clearBtn;expandBtn;settingsBtn;secondaryRow;clearHeightOptions;clearHeightDirectionLabel;clearHeightSelectTypeLabel;directionButtons=new Map;selectTypeButtons=new Map;mainView;settingsView;settingsUnitLabel;settingsPrecisionLabel;settingsUnitSelect;settingsPrecisionSelect;settingsSaveBtn;settingsBackBtn;activeMode;isExpanded;clearHeightDirection;clearHeightSelectType;view="main";config;lockedWidthPx=null;constructor(e={}){this.options=e,this.activeMode=e.defaultMode??"distance",this.isExpanded=e.defaultExpanded??!1,this.clearHeightDirection=e.defaultClearHeightDirection??1,this.clearHeightSelectType=e.defaultClearHeightSelectType??"point",this.config=this.loadConfigFromCache()??{...$z};const{root:t,clearBtn:i,expandBtn:n,settingsBtn:r,secondaryRow:a,clearHeightOptions:o,clearHeightDirectionLabel:l,clearHeightSelectTypeLabel:c,mainView:h,settingsView:d,settingsUnitLabel:p,settingsPrecisionLabel:u,settingsUnitSelect:v,settingsPrecisionSelect:g,settingsSaveBtn:m,settingsBackBtn:f}=this.createDom();this.element=t,this.clearBtn=i,this.expandBtn=n,this.settingsBtn=r,this.secondaryRow=a,this.clearHeightOptions=o,this.clearHeightDirectionLabel=l,this.clearHeightSelectTypeLabel=c,this.mainView=h,this.settingsView=d,this.settingsUnitLabel=p,this.settingsPrecisionLabel=u,this.settingsUnitSelect=v,this.settingsPrecisionSelect=g,this.settingsSaveBtn=m,this.settingsBackBtn=f}init(){this.setLocales(),this.syncSettingsFormFromConfig(),this.applyExpandedState(),this.applyClearHeightOptionsState(),this.applyViewState(),this.syncActiveMode(this.activeMode)}setTheme(e){const t=this.element.style;t.setProperty("--bim-text-primary",e.textPrimary),t.setProperty("--bim-text-secondary",e.textSecondary),t.setProperty("--bim-text-tertiary",e.textTertiary),t.setProperty("--bim-border-default",e.borderDefault),t.setProperty("--bim-border-strong",e.borderStrong),t.setProperty("--bim-bg-inset",e.bgInset),t.setProperty("--bim-bg-elevated",e.bgElevated),t.setProperty("--bim-primary",e.primary),t.setProperty("--bim-primary-subtle",e.primarySubtle),t.setProperty("--bim-danger",e.danger),t.setProperty("--bim-component-bg-hover",e.componentBgHover)}setLocales(){for(const[n,r]of this.modeButtons.entries()){const a=Se(`measure.modes.${n}`);r.dataset.tooltip=a,r.setAttribute("aria-label",a)}const e=Se("measure.actions.clearAll");this.clearBtn.dataset.tooltip=e,this.clearBtn.setAttribute("aria-label",e);const t=this.isExpanded?Se("measure.actions.collapse"):Se("measure.actions.expand");delete this.expandBtn.dataset.tooltip,this.expandBtn.setAttribute("aria-label",t);const i=Se("measure.actions.settings");this.settingsBtn.dataset.tooltip=i,this.settingsBtn.setAttribute("aria-label",i),this.clearHeightDirectionLabel.textContent=Se("measure.clearHeight.direction"),this.clearHeightSelectTypeLabel.textContent=Se("measure.clearHeight.selectType"),this.directionButtons.get(0).textContent=Se("measure.clearHeight.directionDown"),this.directionButtons.get(1).textContent=Se("measure.clearHeight.directionUp"),this.selectTypeButtons.get("point").textContent=Se("measure.clearHeight.selectPoint"),this.selectTypeButtons.get("element").textContent=Se("measure.clearHeight.selectElement"),this.settingsUnitLabel.textContent=Se("measure.settings.unit"),this.settingsPrecisionLabel.textContent=Se("measure.settings.precision"),this.settingsSaveBtn.textContent=Se("measure.settings.save"),this.settingsBackBtn.textContent=Se("measure.settings.cancel")}switchMode(e,t=!0){this.activeMode=e,this.syncActiveMode(e),this.applyClearHeightOptionsState(),this.closeSettingsView(),t&&this.options.onModeChange?.(e),e==="clearHeight"&&(this.options.onClearHeightDirectionChange?.(this.clearHeightDirection),this.options.onClearHeightSelectTypeChange?.(this.clearHeightSelectType))}destroy(){this.element.remove()}getConfig(){return{...this.config}}createDom(){const e=document.createElement("div");e.className="measure-dock-panel";const t=document.createElement("div");t.className="measure-dock-panel-main";const i=document.createElement("div");i.className="measure-dock-clearheight-options";const n=document.createElement("div");n.className="measure-dock-clearheight-group";const r=document.createElement("span");r.className="measure-dock-clearheight-label";const a=document.createElement("div");a.className="measure-dock-clearheight-buttons";const o=this.createClearHeightOptionButton(()=>{this.setClearHeightDirection(0)}),l=this.createClearHeightOptionButton(()=>{this.setClearHeightDirection(1)});this.directionButtons.set(0,o),this.directionButtons.set(1,l),a.appendChild(o),a.appendChild(l),n.appendChild(r),n.appendChild(a);const c=document.createElement("div");c.className="measure-dock-clearheight-group";const h=document.createElement("span");h.className="measure-dock-clearheight-label";const d=document.createElement("div");d.className="measure-dock-clearheight-buttons";const p=this.createClearHeightOptionButton(()=>{this.setClearHeightSelectType("point")}),u=this.createClearHeightOptionButton(()=>{this.setClearHeightSelectType("element")});this.selectTypeButtons.set("point",p),this.selectTypeButtons.set("element",u),d.appendChild(p),d.appendChild(u),c.appendChild(h),c.appendChild(d),i.appendChild(n),i.appendChild(c);const v=document.createElement("div");v.className="measure-dock-panel-top";const g=document.createElement("div");g.className="measure-dock-panel-mode-zone";const m=document.createElement("div");m.className="measure-dock-panel-mode-row",Zz.forEach(k=>{m.appendChild(this.createModeButton(k))});const f=document.createElement("div");f.className="measure-dock-panel-mode-row measure-dock-panel-mode-row-secondary",Yz.forEach(k=>{f.appendChild(this.createModeButton(k))});const y=this.createIconButton("measure-dock-panel-action-clear",Tt("delete"));y.addEventListener("click",()=>{this.options.onClearAll?.()});const x=this.createIconButton("measure-dock-panel-action-settings",Tt("settings"));x.addEventListener("click",()=>{this.openSettingsView(),this.options.onSettings?.()}),m.appendChild(y),f.appendChild(x),g.appendChild(m),g.appendChild(f);const _=document.createElement("div");_.className="measure-dock-panel-actions";const S=this.createIconButton("measure-dock-panel-action-expand",Tt("expand"));S.addEventListener("click",()=>{this.isExpanded=!this.isExpanded,this.applyExpandedState(),this.setLocales()}),_.appendChild(S),v.appendChild(g),v.appendChild(_),t.appendChild(i),t.appendChild(v);const{settingsView:b,settingsUnitLabel:E,settingsPrecisionLabel:w,settingsUnitSelect:M,settingsPrecisionSelect:C,settingsSaveBtn:L,settingsBackBtn:P}=this.createSettingsView();return e.appendChild(t),e.appendChild(b),{root:e,clearBtn:y,expandBtn:S,settingsBtn:x,secondaryRow:f,clearHeightOptions:i,clearHeightDirectionLabel:r,clearHeightSelectTypeLabel:h,mainView:t,settingsView:b,settingsUnitLabel:E,settingsPrecisionLabel:w,settingsUnitSelect:M,settingsPrecisionSelect:C,settingsSaveBtn:L,settingsBackBtn:P}}createSettingsView(){const e=document.createElement("div");e.className="measure-dock-panel-settings";const t=document.createElement("div");t.className="measure-dock-settings-row";const i=document.createElement("span");i.className="measure-dock-settings-label";const n=document.createElement("select");n.className="measure-dock-settings-select",["m","cm","mm","km"].forEach(d=>{const p=document.createElement("option");p.value=d,p.textContent=d,n.appendChild(p)}),t.appendChild(i),t.appendChild(n);const r=document.createElement("div");r.className="measure-dock-settings-row";const a=document.createElement("span");a.className="measure-dock-settings-label";const o=document.createElement("select");o.className="measure-dock-settings-select",[0,1,2,3].forEach(d=>{const p=document.createElement("option");p.value=String(d),p.textContent=d===0?"0":`0.${"0".repeat(d)}`,o.appendChild(p)}),r.appendChild(a),r.appendChild(o);const l=document.createElement("div");l.className="measure-dock-settings-actions";const c=document.createElement("button");c.type="button",c.className="measure-dock-settings-btn is-save",c.addEventListener("click",()=>{this.saveSettings()});const h=document.createElement("button");return h.type="button",h.className="measure-dock-settings-btn is-back",h.addEventListener("click",()=>{this.closeSettingsView()}),l.appendChild(c),l.appendChild(h),e.appendChild(t),e.appendChild(r),e.appendChild(l),{settingsView:e,settingsUnitLabel:i,settingsPrecisionLabel:a,settingsUnitSelect:n,settingsPrecisionSelect:o,settingsSaveBtn:c,settingsBackBtn:h}}createClearHeightOptionButton(e){const t=document.createElement("button");return t.type="button",t.className="measure-dock-clearheight-btn",t.addEventListener("click",e),t}createModeButton(e){const t=document.createElement("button");return t.type="button",t.className="measure-dock-panel-mode-btn",t.dataset.mode=e,t.innerHTML=`<span class="measure-dock-panel-mode-icon">${dc[e].icon}</span>`,t.addEventListener("click",()=>{this.switchMode(e)}),this.modeButtons.set(e,t),t}createIconButton(e,t){const i=document.createElement("button");return i.type="button",i.className=`measure-dock-panel-action-btn ${e}`,i.innerHTML=t,i}applyExpandedState(){this.secondaryRow.style.display=this.isExpanded?"grid":"none",this.expandBtn.classList.toggle("is-expanded",this.isExpanded),this.expandBtn.classList.toggle("is-collapsed",!this.isExpanded)}openSettingsView(){this.lockPanelWidth(),this.view="settings",this.syncSettingsFormFromConfig(),this.applyViewState()}closeSettingsView(){this.view==="settings"&&(this.view="main",this.unlockPanelWidth(),this.applyViewState())}saveSettings(){const e=this.settingsUnitSelect.value,t=Number(this.settingsPrecisionSelect.value);!this.isValidUnit(e)||!this.isValidPrecision(t)||(this.config={unit:e,precision:t},this.saveConfigToCache(this.config),this.options.onConfigSave?.(this.getConfig()),this.view="main",this.unlockPanelWidth(),this.applyViewState())}lockPanelWidth(){const e=this.element.getBoundingClientRect().width;e<=0||(this.lockedWidthPx=Math.ceil(e),this.element.style.width=`${this.lockedWidthPx}px`)}unlockPanelWidth(){this.lockedWidthPx=null,this.element.style.removeProperty("width")}syncSettingsFormFromConfig(){this.settingsUnitSelect.value=this.config.unit,this.settingsPrecisionSelect.value=String(this.config.precision)}applyViewState(){const e=this.view==="main";this.mainView.style.display=e?"block":"none",this.settingsView.style.display=e?"none":"flex"}applyClearHeightOptionsState(){this.clearHeightOptions.classList.remove("is-visible");for(const[e,t]of this.directionButtons.entries())t.classList.toggle("is-active",e===this.clearHeightDirection);for(const[e,t]of this.selectTypeButtons.entries())t.classList.toggle("is-active",e===this.clearHeightSelectType)}setClearHeightDirection(e){this.clearHeightDirection!==e&&(this.clearHeightDirection=e,this.applyClearHeightOptionsState(),this.options.onClearHeightDirectionChange?.(e))}setClearHeightSelectType(e){this.clearHeightSelectType!==e&&(this.clearHeightSelectType=e,this.applyClearHeightOptionsState(),this.options.onClearHeightSelectTypeChange?.(e))}loadConfigFromCache(){try{const e=localStorage.getItem(I2);if(!e)return null;const t=JSON.parse(e);return!t||typeof t!="object"||!this.isValidUnit(t.unit)||!this.isValidPrecision(t.precision)?null:{unit:t.unit,precision:t.precision}}catch{return null}}saveConfigToCache(e){try{localStorage.setItem(I2,JSON.stringify(e))}catch{return}}isValidUnit(e){return e==="m"||e==="cm"||e==="mm"||e==="km"}isValidPrecision(e){return e===0||e===1||e===2||e===3}syncActiveMode(e){for(const[t,i]of this.modeButtons.entries())i.classList.toggle("is-active",t===e)}}class D2 extends jn{panel=null;unsubscribeTheme=null;unsubscribeLocale=null;unsubscribeDockState=null;unsubscribeMeasureEvents=null;constructor(e){super(e)}init(){this.unsubscribeTheme||(this.unsubscribeTheme=ct.subscribe(()=>{this.applyPresentation()})),this.unsubscribeLocale||(this.unsubscribeLocale=Zt.subscribe(()=>{this.applyPresentation()})),this.unsubscribeDockState||(this.unsubscribeDockState=this.registry.bottomDock?.onStateChange(e=>{if(e.id!=="measure"||e.open){e.id==="measure"&&e.open&&this.ensureMeasureEventSubscription();return}this.engineComponent?.deactivateMeasure()})??null),this.ensureMeasureEventSubscription()}destroy(){this.unsubscribeTheme&&(this.unsubscribeTheme(),this.unsubscribeTheme=null),this.unsubscribeLocale&&(this.unsubscribeLocale(),this.unsubscribeLocale=null),this.unsubscribeDockState&&(this.unsubscribeDockState(),this.unsubscribeDockState=null),this.unsubscribeMeasureEvents&&(this.unsubscribeMeasureEvents(),this.unsubscribeMeasureEvents=null),this.panel?.destroy(),this.panel=null,super.destroy()}getPanelElement(){if(this.ensureMeasureEventSubscription(),this.panel)this.panel.switchMode("distance");else{this.panel=new Kz({defaultMode:"distance",defaultExpanded:!1,defaultClearHeightDirection:1,defaultClearHeightSelectType:"point",onModeChange:t=>{this.engineComponent?.activateMeasure(t)},onClearAll:()=>{this.engineComponent?.clearAllMeasures()},onConfigSave:t=>{this.engineComponent?.saveMeasureSetting({unit:t.unit,precision:t.precision})},onClearHeightDirectionChange:t=>{this.engineComponent?.setClearHeightDirection(t)},onClearHeightSelectTypeChange:t=>{this.engineComponent?.setClearHeightSelectType(t)}}),this.panel.init(),this.panel.switchMode("distance"),this.engineComponent?.setClearHeightDirection(1),this.engineComponent?.setClearHeightSelectType("point");const e=this.panel.getConfig();this.engineComponent?.saveMeasureSetting({unit:e.unit,precision:e.precision})}return this.applyPresentation(),this.panel.element}ensureMeasureEventSubscription(){if(this.unsubscribeMeasureEvents)return;const e=this.engineComponent;if(!e){console.warn("[MeasureDockManager] skip callback binding: engine component not ready yet");return}const t=n=>{this.handleMeasureCallback("measure-changed",n)},i=n=>{this.handleMeasureCallback("measure-click",n)};e.onRawEvent("measure-changed",t),e.onRawEvent("measure-click",i),this.unsubscribeMeasureEvents=()=>{e.offRawEvent("measure-changed",t),e.offRawEvent("measure-click",i)},console.log("[MeasureDockManager] raw event callbacks bound")}applyPresentation(){this.panel&&(this.panel.setTheme(ct.getTheme()),this.panel.setLocales())}handleMeasureCallback(e,t){const i=this.registry.bottomDock?.isOpen("measure")??!1,n=L2(t.type);if(console.log("[MeasureDockManager] callback received",{event:e,type:t.type,mode:n,dockOpen:i,hasPanel:!!this.panel}),!i){console.log("[MeasureDockManager] skip mode switch: measure dock is closed");return}if(!n||!this.panel){console.log("[MeasureDockManager] skip mode switch: invalid mode or panel not ready");return}this.panel.switchMode(n,!1),this.engineComponent?.activateMeasure(n),console.log("[MeasureDockManager] switched mode by callback",{event:e,mode:n})}}class Jz{element;options;typeButtons=new Map;axisButtons=new Map;toolContainer;axisPanel;activeType;activeAxis;isHidden;constructor(e={}){this.options=e,this.activeType=e.defaultType??"face",this.activeAxis=e.defaultAxis??"x",this.isHidden=e.defaultHidden??!1;const{root:t,toolContainer:i,axisPanel:n}=this.createDom();this.element=t,this.toolContainer=i,this.axisPanel=n}init(){this.applyTypeState(),this.applyAxisState(),this.renderTools(),this.setLocales()}setTheme(e){const t=this.element.style;t.setProperty("--bim-text-primary",e.textPrimary),t.setProperty("--bim-text-secondary",e.textSecondary),t.setProperty("--bim-border-default",e.borderDefault),t.setProperty("--bim-border-strong",e.borderStrong),t.setProperty("--bim-bg-inset",e.bgInset),t.setProperty("--bim-bg-elevated",e.bgElevated),t.setProperty("--bim-primary",e.primary),t.setProperty("--bim-primary-subtle",e.primarySubtle),t.setProperty("--bim-component-bg-hover",e.componentBgHover)}setLocales(){this.typeButtons.get("face").dataset.tooltip=Se("toolbar.sectionPlane"),this.typeButtons.get("axis").dataset.tooltip=Se("toolbar.sectionAxis"),this.typeButtons.get("box").dataset.tooltip=Se("toolbar.sectionBox"),this.axisButtons.get("x").dataset.label="X",this.axisButtons.get("y").dataset.label="Y",this.axisButtons.get("z").dataset.label="Z",this.typeButtons.forEach(e=>{e.setAttribute("aria-label",e.dataset.tooltip??"")}),this.axisButtons.forEach(e=>{e.setAttribute("aria-label",e.dataset.label??"")}),this.renderTools()}destroy(){this.element.remove()}resetForOpen(){this.activeType="face",this.isHidden=!1,this.applyTypeState(),this.renderTools(),this.options.onTypeChange?.(this.activeType,this.activeAxis),this.options.onHideToggle?.(!1)}getActiveType(){return this.activeType}getActiveAxis(){return this.activeAxis}createDom(){const e=document.createElement("div");e.className="section-dock-panel";const t=document.createElement("div");t.className="section-dock-axis-panel",["x","y","z"].forEach(h=>{const d=document.createElement("button");d.type="button",d.className="section-dock-axis-btn",d.textContent=h.toUpperCase(),d.addEventListener("click",()=>{this.handleAxisChange(h)}),this.axisButtons.set(h,d),t.appendChild(d)});const i=document.createElement("div");i.className="section-dock-main";const n=document.createElement("div");n.className="section-dock-types";const r=this.createTypeButton("face",Tt("拾曲面剖切")),a=this.createTypeButton("axis",Tt("轴向剖切")),o=this.createTypeButton("box",Tt("剖切盒"));n.appendChild(r),n.appendChild(a),n.appendChild(o);const l=document.createElement("div");l.className="section-dock-divider";const c=document.createElement("div");return c.className="section-dock-tools",i.appendChild(n),i.appendChild(l),i.appendChild(c),e.appendChild(t),e.appendChild(i),{root:e,toolContainer:c,axisPanel:t}}createTypeButton(e,t){const i=document.createElement("button");i.type="button",i.className="section-dock-type-btn";const n=document.createElement("span");return n.className="section-dock-type-icon",n.innerHTML=t,i.appendChild(n),i.addEventListener("click",()=>{this.handleTypeChange(e)}),this.typeButtons.set(e,i),i}handleTypeChange(e){this.activeType!==e&&(this.activeType=e,this.applyTypeState(),this.renderTools(),this.isHidden&&(this.isHidden=!1,this.options.onHideToggle?.(!1)),this.options.onTypeChange?.(e,this.activeAxis))}handleAxisChange(e){this.activeAxis!==e&&(this.activeAxis=e,this.applyAxisState(),this.activeType==="axis"&&this.options.onAxisChange?.(e))}applyTypeState(){this.typeButtons.forEach((t,i)=>{t.classList.toggle("is-active",i===this.activeType)});const e=this.activeType==="axis";this.axisPanel.classList.toggle("is-visible",e)}applyAxisState(){this.axisButtons.forEach((e,t)=>{e.classList.toggle("is-active",t===this.activeAxis)})}renderTools(){this.toolContainer.innerHTML="",this.getToolsForType(this.activeType).forEach(e=>{const t=document.createElement("button");t.type="button",t.className="section-dock-tool-btn",e.isActive&&t.classList.add("is-active");const i=document.createElement("span");i.className="section-dock-tool-icon",i.innerHTML=Tt(e.iconName),t.appendChild(i);const n=Se(e.textKey);t.dataset.tooltip=n,t.setAttribute("aria-label",n),t.addEventListener("click",e.onClick),this.toolContainer.appendChild(t)})}getToolsForType(e){const t={key:"hide",iconName:"隐藏",textKey:e==="box"?"sectionBox.actions.hide":e==="axis"?"sectionAxis.actions.hide":"sectionPlane.actions.hide",isActive:this.isHidden,onClick:()=>{this.isHidden=!this.isHidden,this.options.onHideToggle?.(this.isHidden),this.renderTools()}},i={key:"reverse",iconName:"反向",textKey:e==="axis"?"sectionAxis.actions.reverse":e==="box"?"sectionBox.actions.reverse":"sectionPlane.actions.reverse",onClick:()=>{this.options.onReverse?.()}};return e==="axis"?[t,i,{key:"reset",iconName:"重置",textKey:"sectionAxis.actions.reset",onClick:()=>{this.isHidden=!1,this.options.onReset?.(this.activeType,this.activeAxis),this.renderTools()}}]:e==="box"?[t,{key:"fit",iconName:"适应到模型",textKey:"sectionBox.actions.fitToModel",onClick:()=>{this.options.onFitToModel?.()}},{key:"reset",iconName:"重置",textKey:"sectionBox.actions.reset",onClick:()=>{this.isHidden=!1,this.options.onReset?.(this.activeType,this.activeAxis),this.renderTools()}}]:[t,i,{key:"reset",iconName:"重置",textKey:"sectionPlane.actions.reset",onClick:()=>{this.isHidden=!1,this.options.onReset?.(this.activeType,this.activeAxis),this.renderTools()}}]}}class N2 extends jn{panel=null;unsubscribeTheme=null;unsubscribeLocale=null;unsubscribeDockState=null;constructor(e){super(e)}init(){this.unsubscribeTheme||(this.unsubscribeTheme=ct.subscribe(()=>{this.applyPresentation()})),this.unsubscribeLocale||(this.unsubscribeLocale=Zt.subscribe(()=>{this.applyPresentation()})),this.unsubscribeDockState||(this.unsubscribeDockState=this.registry.bottomDock?.onStateChange(e=>{if(e.id==="section"){if(!e.open){console.log("deactivateSection"),this.engineComponent?.deactivateSection();return}this.panel?.resetForOpen()}})??null)}destroy(){this.unsubscribeTheme&&(this.unsubscribeTheme(),this.unsubscribeTheme=null),this.unsubscribeLocale&&(this.unsubscribeLocale(),this.unsubscribeLocale=null),this.unsubscribeDockState&&(this.unsubscribeDockState(),this.unsubscribeDockState=null),this.panel?.destroy(),this.panel=null,super.destroy()}getPanelElement(){return this.panel||(this.panel=new Jz({defaultType:"face",defaultAxis:"x",defaultHidden:!1,onTypeChange:(e,t)=>{this.activateByType(e,t)},onAxisChange:e=>{this.panel?.getActiveType()==="axis"&&this.engineComponent?.activeSection(e)},onHideToggle:e=>{if(e){this.engineComponent?.hideSection();return}this.engineComponent?.recoverSection()},onReverse:()=>{this.engineComponent?.reverseSection()},onReset:(e,t)=>{this.engineComponent?.deactivateSection(),this.activateByType(e,t)},onFitToModel:()=>{this.engineComponent?.scaleSectionBox()}}),this.panel.init()),this.panel.resetForOpen(),this.applyPresentation(),this.panel.element}activateByType(e,t){if(e==="face"){this.engineComponent?.activeSection("face");return}if(e==="box"){this.engineComponent?.activeSection("box");return}this.engineComponent?.activeSection(t)}applyPresentation(){this.panel&&(this.panel.setTheme(ct.getTheme()),this.panel.setLocales())}}class k2{element;options;state={mode:"none",isPlanViewActive:!1,speed:1,gravity:!1,collision:!1,characterModel:"construction-worker",walkMode:"walk"};planViewBtn;pathModeBtn;settingsContainer;speedControl;speedDecreaseBtn;speedIncreaseBtn;speedDisplay;gravityCheckbox;gravityLabel;collisionCheckbox;collisionLabel;characterModelSelect;characterModelLabel;walkModeSelect;walkModeLabel;exitBtn;unsubscribeLocale=null;unsubscribeTheme=null;constructor(e={}){this.options=e,this.state.speed=e.defaultSpeed??1,this.state.gravity=e.defaultGravity??!1,this.state.collision=e.defaultCollision??!1,this.state.characterModel=e.defaultCharacterModel??"construction-worker",this.state.walkMode=e.defaultWalkMode??"walk"}init(){this.element=this.createPanel(),this.updateSettingsView(),this.unsubscribeLocale=Zt.subscribe(()=>this.setLocales()),this.unsubscribeTheme=ct.subscribe(e=>this.setTheme(e)),this.setLocales(),this.setTheme(ct.getTheme())}setPlanViewActive(e){this.state.isPlanViewActive=e,this.updateButtonStates()}setPathModeActive(e){if(!e&&this.state.mode!=="path")return;const t=e?"path":"none";this.setMode(t)}getState(){return{...this.state}}createPanel(){const e=document.createElement("div");e.className="walk-control-panel";const t=this.createLeftButtons(),i=document.createElement("div");i.className="walk-divider",this.settingsContainer=this.createSettingsContainer();const n=document.createElement("div");n.className="walk-divider";const r=this.createExitButton();return e.appendChild(t),e.appendChild(i),e.appendChild(this.settingsContainer),e.appendChild(n),e.appendChild(r),e}createLeftButtons(){const e=document.createElement("div");return e.className="walk-control-left",this.planViewBtn=this.createIconButton("plan-view",()=>{this.state.isPlanViewActive=!this.state.isPlanViewActive,this.updateButtonStates(),this.options.onPlanViewToggle?.(this.state.isPlanViewActive)}),this.pathModeBtn=this.createIconButton("path",()=>{const t=this.state.mode==="path"?"none":"path";this.setMode(t),this.options.onPathModeToggle?.(t==="path")}),e.appendChild(this.planViewBtn),e.appendChild(this.pathModeBtn),e}createSettingsContainer(){const e=document.createElement("div");e.className="walk-control-settings",this.speedControl=this.createSpeedControl();const t=document.createElement("label");t.className="walk-checkbox-wrapper walk-checkbox-gravity",this.gravityCheckbox=document.createElement("input"),this.gravityCheckbox.type="checkbox",this.gravityCheckbox.className="walk-checkbox",this.gravityCheckbox.checked=this.state.gravity,this.gravityCheckbox.addEventListener("change",()=>{this.state.gravity=this.gravityCheckbox.checked,this.options.onGravityToggle?.(this.state.gravity)}),this.gravityLabel=document.createElement("span"),this.gravityLabel.className="walk-checkbox-label",t.appendChild(this.gravityCheckbox),t.appendChild(this.gravityLabel);const i=document.createElement("label");i.className="walk-checkbox-wrapper walk-checkbox-collision",this.collisionCheckbox=document.createElement("input"),this.collisionCheckbox.type="checkbox",this.collisionCheckbox.className="walk-checkbox",this.collisionCheckbox.checked=this.state.collision,this.collisionCheckbox.addEventListener("change",()=>{this.state.collision=this.collisionCheckbox.checked,this.options.onCollisionToggle?.(this.state.collision)}),this.collisionLabel=document.createElement("span"),this.collisionLabel.className="walk-checkbox-label",i.appendChild(this.collisionCheckbox),i.appendChild(this.collisionLabel);const n=document.createElement("div");n.className="walk-select-wrapper walk-select-wrapper-character-model",this.characterModelLabel=document.createElement("label"),this.characterModelLabel.className="walk-select-label",this.characterModelSelect=document.createElement("select"),this.characterModelSelect.className="walk-select walk-select-character-model",this.characterModelSelect.addEventListener("change",()=>{this.state.characterModel=this.characterModelSelect.value,this.options.onCharacterModelChange?.(this.state.characterModel)}),n.appendChild(this.characterModelLabel),n.appendChild(this.characterModelSelect);const r=document.createElement("div");return r.className="walk-select-wrapper walk-select-wrapper-walk-mode",this.walkModeLabel=document.createElement("label"),this.walkModeLabel.className="walk-select-label",this.walkModeSelect=document.createElement("select"),this.walkModeSelect.className="walk-select walk-select-walk-mode",this.walkModeSelect.addEventListener("change",()=>{this.state.walkMode=this.walkModeSelect.value,this.options.onWalkModeChange?.(this.state.walkMode)}),r.appendChild(this.walkModeLabel),r.appendChild(this.walkModeSelect),e.appendChild(this.speedControl),e.appendChild(n),e.appendChild(r),e.appendChild(t),e.appendChild(i),e}createSpeedControl(){const e=document.createElement("div");e.className="walk-speed-control";const t=document.createElement("label");t.className="walk-speed-label",t.textContent=Se("walkControl.speed");const i=document.createElement("div");return i.className="walk-speed-group",this.speedDecreaseBtn=document.createElement("button"),this.speedDecreaseBtn.className="walk-speed-btn",this.speedDecreaseBtn.textContent="-",this.speedDecreaseBtn.addEventListener("click",()=>{this.state.speed>1&&(this.state.speed--,this.updateSpeedDisplay(),this.options.onSpeedChange?.(this.state.speed))}),this.speedDisplay=document.createElement("div"),this.speedDisplay.className="walk-speed-display",this.speedDisplay.textContent=`${this.state.speed}X`,this.speedIncreaseBtn=document.createElement("button"),this.speedIncreaseBtn.className="walk-speed-btn",this.speedIncreaseBtn.textContent="+",this.speedIncreaseBtn.addEventListener("click",()=>{this.state.speed<10&&(this.state.speed++,this.updateSpeedDisplay(),this.options.onSpeedChange?.(this.state.speed))}),i.appendChild(this.speedDecreaseBtn),i.appendChild(this.speedDisplay),i.appendChild(this.speedIncreaseBtn),e.appendChild(t),e.appendChild(i),e}createIconButton(e,t){const i=document.createElement("button");return i.className=`walk-icon-btn walk-icon-btn-${e}`,i.innerHTML=this.getIconSVG(e),i.addEventListener("click",t),i}createExitButton(){const e=document.createElement("button");return e.className="walk-exit-btn",e.addEventListener("click",()=>{this.options.onExit?.()}),this.exitBtn=e,e}setMode(e){const t=this.state.mode;t==="walk"&&e!=="walk"&&this.options.onWalkModeToggle?.(!1),t==="path"&&e!=="path"&&this.options.onPathModeToggle?.(!1),this.state.mode=e,e==="path"?(this.state.gravity=!1,this.state.collision=!1,this.gravityCheckbox.checked=!1,this.gravityCheckbox.disabled=!0,this.collisionCheckbox.checked=!1,this.collisionCheckbox.disabled=!0):(this.gravityCheckbox.disabled=!1,this.collisionCheckbox.disabled=!1),this.updateButtonStates(),this.updateSettingsView(),this.updateSpeedButtonStates()}updateButtonStates(){this.planViewBtn.classList.toggle("active",this.state.isPlanViewActive),this.pathModeBtn.classList.toggle("active",this.state.mode==="path")}updateSettingsView(){const e=this.speedControl,t=this.gravityCheckbox.parentElement,i=this.collisionCheckbox.parentElement,n=this.characterModelSelect.parentElement,r=this.walkModeSelect.parentElement;this.state.mode==="walk"?(e.style.display="none",t.style.display="flex",i.style.display="flex",n.style.display="flex",r.style.display="flex"):(e.style.display="flex",t.style.display="flex",i.style.display="flex",n.style.display="none",r.style.display="none")}updateSpeedDisplay(){this.speedDisplay.textContent=`${this.state.speed}X`,this.updateSpeedButtonStates()}updateSpeedButtonStates(){this.speedDecreaseBtn.disabled=this.state.speed<=1,this.speedIncreaseBtn.disabled=this.state.speed>=10}getIconSVG(e){return{"plan-view":Tt("地图"),path:Tt("路径漫游"),walk:Tt("第一人称漫游")}[e]||""}setLocales(){const e=this.speedControl.querySelector(".walk-speed-label");e&&(e.textContent=Se("walkControl.speed")),this.gravityLabel.textContent=Se("walkControl.gravity"),this.collisionLabel.textContent=Se("walkControl.collision"),this.characterModelLabel.textContent=Se("walkControl.characterModel.label"),this.characterModelSelect.innerHTML="";const t=document.createElement("option");t.value="construction-worker",t.textContent=Se("walkControl.characterModel.constructionWorker"),t.selected=this.state.characterModel==="construction-worker",this.characterModelSelect.appendChild(t);const i=document.createElement("option");i.value="office-male",i.textContent=Se("walkControl.characterModel.officeMale"),i.selected=this.state.characterModel==="office-male",this.characterModelSelect.appendChild(i),this.walkModeLabel.textContent=Se("walkControl.walkMode.label"),this.walkModeSelect.innerHTML="";const n=document.createElement("option");n.value="walk",n.textContent=Se("walkControl.walkMode.walk"),n.selected=this.state.walkMode==="walk",this.walkModeSelect.appendChild(n);const r=document.createElement("option");r.value="run",r.textContent=Se("walkControl.walkMode.run"),r.selected=this.state.walkMode==="run",this.walkModeSelect.appendChild(r),this.exitBtn.textContent=Se("walkControl.exit")}setTheme(e){if(!this.element)return;const t=this.element.style;t.setProperty("--bim-bg-base",e.bgBase??"#152232"),t.setProperty("--bim-bg-elevated",e.bgElevated??"#1f2d3e"),t.setProperty("--bim-bg-inset",e.bgInset??"#152232"),t.setProperty("--bim-border-default",e.borderDefault??"#334155"),t.setProperty("--bim-border-strong",e.borderStrong??"#475569"),t.setProperty("--bim-border-subtle",e.borderSubtle??"#1e293b"),t.setProperty("--bim-divider",e.divider??"#334155"),t.setProperty("--bim-shadow-xl",e.shadowXl??"0 20px 40px rgba(0, 0, 0, 0.3)"),t.setProperty("--bim-primary",e.primary??"#3b82f6"),t.setProperty("--bim-primary-hover",e.primaryHover??"#60a5fa"),t.setProperty("--bim-primary-subtle",e.primarySubtle??"rgba(59, 130, 246, 0.15)"),t.setProperty("--bim-text-primary",e.textPrimary??"#ffffff"),t.setProperty("--bim-text-inverse",e.textInverse??"#152232"),t.setProperty("--bim-icon-default",e.iconDefault??"#ffffff"),t.setProperty("--bim-component-bg-hover",e.componentBgHover??"rgba(248, 250, 252, 0.06)"),t.setProperty("--bim-component-bg-active",e.componentBgActive??"rgba(248, 250, 252, 0.1)")}destroy(){this.unsubscribeLocale?.(),this.unsubscribeTheme?.(),this.element&&this.element.parentElement&&this.element.parentElement.removeChild(this.element)}}class Qz{element;panel;constructor(e={}){this.panel=new k2(e),this.panel.init(),this.element=this.panel.element,this.element.classList.add("walk-dock-panel")}init(){}setPlanViewActive(e){this.panel.setPlanViewActive(e)}setLocales(){this.panel.setLocales()}setTheme(e){this.panel.setTheme(e)}getState(){return this.panel.getState()}destroy(){this.panel.destroy()}}class No extends jn{dialog=null;isVisible=!1;constructor(e){super(e)}get dialogWidth(){return 300}get dialogHeight(){return"auto"}get dialogOptions(){return{draggable:!0,resizable:!1}}onDialogClose(){}onDialogCreated(){}onBeforeDestroy(){}getDialogPosition(){const e=this.registry.container;if(!e)return{x:100,y:100};const t=e.clientWidth,i=e.clientHeight,n=this.dialogWidth,r=typeof this.dialogHeight=="number"?this.dialogHeight:300;return{x:t-n-20,y:(i-r)/2}}show(){if(!this.registry.dialog||!this.registry.container){console.warn(`[${this.dialogId}] Dialog manager or container is not initialized`);return}this.dialog&&this.destroyDialog();const e=this.getDialogPosition(),t=this.createContent(),i=this.dialogOptions;this.dialog=this.registry.dialog.create({id:this.dialogId,title:this.dialogTitle,content:t,width:this.dialogWidth,height:this.dialogHeight,position:e,draggable:i.draggable,resizable:i.resizable,onClose:()=>{this.onDialogClose(),this.destroyDialog()}}),this.dialog.init(),this.isVisible=!0,this.onDialogCreated()}hide(){this.destroyDialog()}toggle(){this.isVisible?this.hide():this.show()}isOpen(){return this.isVisible}destroyDialog(){this.onBeforeDestroy(),this.dialog&&(this.dialog.destroy(),this.dialog=null),this.isVisible=!1}destroy(){this.destroyDialog(),super.destroy()}}class e9{element;registry;unsubscribeLocale=null;unsubscribeTheme=null;constructor(e){this.registry=e}points=[];duration=1e4;loop=!1;playingPointIndex=-1;isPlaying=!1;init(){this.element=document.createElement("div"),this.element.className="walk-path-panel",this.unsubscribeLocale=Zt.subscribe(()=>this.render()),this.unsubscribeTheme=ct.subscribe(e=>this.setTheme(e)),this.loadPointsFromEngine(),this.render(),this.setTheme(ct.getTheme())}loadPointsFromEngine(){const e=this.registry.engine3d?.getEngineComponent()?.pathRoamingGetPoints()??[];this.points=e.map((t,i)=>({index:i}))}render(){this.element.innerHTML="";const e=this.createSettingsSection();this.element.appendChild(e);const t=this.createPointsSection();this.element.appendChild(t);const i=this.createPlayButton();this.element.appendChild(i)}createSettingsSection(){const e=document.createElement("div");e.className="walk-path-settings";const t=document.createElement("div");t.className="walk-path-form-group";const i=document.createElement("label");i.textContent=Se("walkControl.path.duration");const n=document.createElement("div");n.className="walk-path-input-wrapper";const r=document.createElement("input");r.type="number",r.className="walk-path-input",r.value=String(this.duration/1e3),r.min="1",r.oninput=h=>{const d=parseInt(h.target.value)||1;this.duration=d*1e3};const a=document.createElement("span");a.className="walk-path-unit",a.textContent=Se("walkControl.path.durationUnit"),n.appendChild(r),n.appendChild(a),t.appendChild(i),t.appendChild(n);const o=document.createElement("div");o.className="walk-path-form-group walk-path-form-group-inline";const l=document.createElement("input");l.type="checkbox",l.id="walk-path-loop-checkbox",l.className="walk-path-checkbox",l.checked=this.loop,l.onchange=h=>{this.loop=h.target.checked};const c=document.createElement("label");return c.htmlFor="walk-path-loop-checkbox",c.textContent=Se("walkControl.path.loop"),o.appendChild(l),o.appendChild(c),e.appendChild(t),e.appendChild(o),e}createPointsSection(){const e=document.createElement("div");e.className="walk-path-points-section";const t=document.createElement("div");t.className="walk-path-points-toolbar";const i=document.createElement("button");i.className="walk-path-btn walk-path-btn-small",i.textContent=`+ ${Se("walkControl.path.addPoint")}`,i.onclick=()=>this.addPoint();const n=document.createElement("button");n.className="walk-path-btn walk-path-btn-small walk-path-btn-danger",n.textContent=Se("walkControl.path.deleteAll"),n.onclick=()=>this.deleteAllPoints(),t.appendChild(i),t.appendChild(n),e.appendChild(t);const r=document.createElement("div");if(r.className="walk-path-points-list",this.points.length===0){const a=document.createElement("div");a.className="walk-path-empty",a.textContent=Se("walkControl.path.noPoints"),r.appendChild(a)}else this.points.forEach((a,o)=>{const l=this.createPointItem(o);r.appendChild(l)});return e.appendChild(r),e}createPointItem(e){const t=document.createElement("div");t.className="walk-path-point-item",this.playingPointIndex===e&&t.classList.add("walk-path-point-item-active");const i=document.createElement("span");i.className="walk-path-point-name",i.textContent=`${Se("walkControl.path.point")}${e}`;const n=document.createElement("div");n.className="walk-path-point-actions";const r=document.createElement("button");r.className="walk-path-btn-icon",r.innerHTML="▶",r.title=Se("walkControl.path.play"),r.onclick=o=>{o.stopPropagation(),this.jumpToPoint(e)};const a=document.createElement("button");return a.className="walk-path-btn-icon walk-path-btn-icon-danger",a.innerHTML="×",a.onclick=o=>{o.stopPropagation(),this.deletePoint(e)},n.appendChild(r),n.appendChild(a),t.appendChild(i),t.appendChild(n),t}createPlayButton(){const e=document.createElement("div");e.className="walk-path-btn-group";const t=document.createElement("button");t.className="walk-path-btn walk-path-btn-play",t.textContent=`▶ ${Se("walkControl.path.play")}`,t.disabled=this.points.length===0||this.isPlaying,t.onclick=()=>this.playPath();const i=document.createElement("button");return i.className="walk-path-btn walk-path-btn-stop",i.textContent=`■ ${Se("walkControl.path.stop")}`,i.disabled=!this.isPlaying,i.onclick=()=>this.stopPath(),e.appendChild(t),e.appendChild(i),e}addPoint(){this.registry.engine3d?.getEngineComponent()?.pathRoamingAddPoint();const e=this.points.length;this.points.push({index:e}),this.render()}deletePoint(e){this.registry.engine3d?.getEngineComponent()?.pathRoamingRemovePoint(e),this.points.splice(e,1),this.points.forEach((t,i)=>t.index=i),this.render()}deleteAllPoints(){this.registry.engine3d?.getEngineComponent()?.pathRoamingClearPoints(),this.points=[],this.render()}jumpToPoint(e){this.registry.engine3d?.getEngineComponent()?.pathRoamingJumpToPoint(e)}playPath(){this.points.length!==0&&(this.isPlaying=!0,this.render(),console.log("[WalkPathPanel] 开始播放漫游",{duration:this.duration,loop:this.loop,pointsCount:this.points.length}),this.registry.engine3d?.getEngineComponent()?.pathRoamingPlay({duration:this.duration,loop:this.loop,onPointComplete:e=>{console.log("[WalkPathPanel] onPointComplete",{pointIndex:e}),this.playingPointIndex=e,this.render()},onComplete:()=>{console.log("[WalkPathPanel] onComplete 播放完成"),this.isPlaying=!1,this.playingPointIndex=-1,this.render()}}))}stopPath(){console.log("[WalkPathPanel] 停止漫游"),this.registry.engine3d?.getEngineComponent()?.pathRoamingStop(),this.isPlaying=!1,this.playingPointIndex=-1,this.render()}setLocales(){this.render()}setTheme(e){this.element&&(this.element.style.setProperty("--bim-text-primary",e.textPrimary??"#fff"),this.element.style.setProperty("--bim-text-secondary",e.textPrimary??"#fff"),this.element.style.setProperty("--bim-bg-elevated",e.bgElevated??"#1f2d3e"),this.element.style.setProperty("--bim-border-default",e.borderDefault??"#334155"),this.element.style.setProperty("--bim-primary",e.primary??"#3b82f6"))}destroy(){this.isPlaying&&this.stopPath(),this.unsubscribeLocale?.(),this.unsubscribeTheme?.(),this.element?.parentElement&&this.element.parentElement.removeChild(this.element)}}class O2 extends No{panel=null;constructor(e){super(e)}get dialogId(){return"walk-path-dialog"}get dialogTitle(){return"walkControl.path.dialogTitle"}get dialogWidth(){return 300}get dialogHeight(){return 450}init(){}getDialogPosition(){const e=this.registry.container;return e?{x:e.clientWidth-this.dialogWidth-20,y:20}:{x:100,y:100}}createContent(){return this.panel=new e9(this.registry),this.panel.init(),this.panel.element}onDialogClose(){this.registry.walkControl&&this.registry.walkControl.panel&&this.registry.walkControl.panel.setPathModeActive(!1)}onBeforeDestroy(){this.panel&&(this.panel.destroy(),this.panel=null)}}class U2 extends jn{panel=null;pathManager=null;unsubscribeDockState=null;constructor(e){super(e)}init(){this.pathManager=new O2(this.registry),this.pathManager.init(),this.unsubscribeDockState||(this.unsubscribeDockState=this.registry.bottomDock?.onStateChange(e=>{if(e.id==="walk"){if(e.open){this.onOpen();return}this.onClose()}})??null)}destroy(){this.unsubscribeDockState&&(this.unsubscribeDockState(),this.unsubscribeDockState=null),this.onClose(),this.pathManager?.destroy(),this.pathManager=null,super.destroy()}getPanelElement(){return this.panel||(this.panel=new Qz({onPlanViewToggle:e=>{this.engineComponent?.toggleMiniMap(),this.registry.toolbar?.setBtnActive("map",e),this.emit("walk:plan-view-toggle",{isActive:e})},onPathModeToggle:e=>{e?this.pathManager?.show():this.pathManager?.hide(),this.emit("walk:path-mode-toggle",{isActive:e})},onWalkModeToggle:e=>{e&&this.pathManager?.hide(),this.emit("walk:walk-mode-toggle",{isActive:e})},onSpeedChange:e=>{const t=e*.1;this.engineComponent?.setWalkSpeed(t),this.emit("walk:speed-change",{speed:e})},onGravityToggle:e=>{this.engineComponent?.setWalkGravity(e),this.emit("walk:gravity-toggle",{enabled:e})},onCollisionToggle:e=>{this.engineComponent?.setWalkCollision(e),this.emit("walk:collision-toggle",{enabled:e})},onCharacterModelChange:e=>{},onWalkModeChange:e=>{},onExit:()=>{this.registry.bottomDock?.close("walk")}}),this.panel.init()),this.syncMapState(),this.panel.element}onOpen(){this.engineComponent?.activateFirstPersonMode(),this.syncMapState()}onClose(){this.pathManager?.hide(),this.engineComponent?.getMiniMapState()&&this.engineComponent.toggleMiniMap(),this.engineComponent?.deactivateFirstPersonMode(),this.panel&&(this.panel.destroy(),this.panel=null),this.registry.toolbar?.setBtnActive("map",!1)}syncMapState(){const e=this.engineComponent?.getMiniMapState()??!1;this.panel?.setPlanViewActive(e)}}class ed{element;options;activeMode;isExpanded;result=null;clearHeightDirection=0;clearHeightSelectType="point";config;draftConfig=null;view="main";static CONFIG_CACHE_KEY="bim-engine:measure:config";static DEFAULT_CONFIG={unit:"mm",precision:2};toolButtons=new Map;toggleBtn;toggleTextEl;mainValueRowEl;mainValueValueEl;mainValueLabelEl;mainNumberEl;mainUnitEl;xyzBoxEl;xyzXEl;xyzYEl;xyzZEl;clearBtn;settingsBtn;modeOptionsEl;directionBtns=new Map;selectTypeBtns=new Map;mainViewEl;settingsViewEl;unitSelectEl;precisionSelectEl;saveSettingsBtn;cancelSettingsBtn;unsubscribeLocale=null;unsubscribeTheme=null;constructor(e={}){this.options=e,this.activeMode=e.defaultMode??"distance",this.isExpanded=e.defaultExpanded??!1,this.config=this.loadConfigFromCache()??{...ed.DEFAULT_CONFIG},this.element=this.createDom()}init(){this.unsubscribeLocale=Zt.subscribe(()=>{this.setLocales()}),this.unsubscribeTheme=ct.subscribe(e=>{this.setTheme(e)}),this.setLocales(),this.setTheme(ct.getTheme()),this.applyExpandedState(),this.applyActiveModeState(),this.applyClearHeightOptionsState(),this.applyViewState(),this.renderResult(),this.options.onModeChange&&this.options.onModeChange(this.activeMode)}setTheme(e){const t=this.element.style;t.setProperty("--bim-bg-inset",e.bgInset??"#152232"),t.setProperty("--bim-bg-elevated",e.bgElevated??"#1f2d3e"),t.setProperty("--bim-border-default",e.borderDefault??"#334155"),t.setProperty("--bim-border-strong",e.borderStrong??"#475569"),t.setProperty("--bim-divider",e.divider??"#334155"),t.setProperty("--bim-primary",e.primary??"#3b82f6"),t.setProperty("--bim-primary-hover",e.primaryHover??"#60a5fa"),t.setProperty("--bim-primary-subtle",e.primarySubtle??"rgba(59, 130, 246, 0.15)"),t.setProperty("--bim-danger",e.danger??"#ef4444"),t.setProperty("--bim-text-primary",e.textPrimary??"#ffffff"),t.setProperty("--bim-text-secondary",e.textSecondary??"#94a3b8"),t.setProperty("--bim-text-tertiary",e.textTertiary??"#64748b"),t.setProperty("--bim-text-inverse",e.textInverse??"#152232"),t.setProperty("--bim-icon-default",e.iconDefault??"#ffffff"),t.setProperty("--bim-component-bg-hover",e.componentBgHover??"rgba(248, 250, 252, 0.06)")}setLocales(){for(const[t,i]of this.toolButtons.entries())i.title=Se(this.getModeI18nKey(t)),i.setAttribute("aria-label",i.title);this.toggleBtn.title=this.isExpanded?Se("measure.actions.collapse"):Se("measure.actions.expand"),this.toggleBtn.setAttribute("aria-label",this.toggleBtn.title),this.toggleTextEl&&(this.toggleTextEl.textContent=this.toggleBtn.title),this.clearBtn.textContent=Se("measure.actions.clearAll"),this.settingsBtn.title=Se("measure.actions.settings"),this.settingsBtn.setAttribute("aria-label",this.settingsBtn.title),this.mainValueLabelEl.textContent=Se(this.getModeValueLabelI18nKey(this.activeMode)),this.element.querySelectorAll("[data-i18n-key]").forEach(t=>{const i=t.dataset.i18nKey;i&&(t.textContent=Se(i))}),this.saveSettingsBtn.textContent=Se("measure.settings.save"),this.cancelSettingsBtn.textContent=Se("measure.settings.cancel")}destroy(){this.unsubscribeLocale&&(this.unsubscribeLocale(),this.unsubscribeLocale=null),this.unsubscribeTheme&&(this.unsubscribeTheme(),this.unsubscribeTheme=null),this.element.remove()}getActiveMode(){return this.activeMode}switchMode(e,t=!0){this.setActiveMode(e,t)}setActiveMode(e,t=!0){this.activeMode!==e&&(this.activeMode=e,this.applyActiveModeState(),this.applyClearHeightOptionsState(),this.mainValueLabelEl.textContent=Se(this.getModeValueLabelI18nKey(this.activeMode)),t&&this.options.onModeChange&&this.options.onModeChange(e),this.renderResult(),this.options.onExpandedChange&&this.options.onExpandedChange(this.isExpanded))}setResult(e){this.result=e,this.renderResult()}clearAll(){this.result=null,this.renderResult(),this.options.onClearAll&&this.options.onClearAll()}openSettings(){this.enterSettingsView(),this.options.onSettings&&this.options.onSettings()}getConfig(){return{...this.config}}setConfig(e,t=!1){const i={unit:e.unit??this.config.unit,precision:e.precision??this.config.precision};this.config=i,t&&this.saveConfigToCache(i),this.renderResult(),this.view==="settings"&&this.syncSettingsFormFromConfig(i)}setExpanded(e){this.isExpanded!==e&&(this.isExpanded=e,this.applyExpandedState(),this.setLocales(),this.options.onExpandedChange&&this.options.onExpandedChange(this.isExpanded))}getExpanded(){return this.isExpanded}createDom(){const e=document.createElement("div");e.className="bim-measure-panel",this.mainViewEl=document.createElement("div"),this.mainViewEl.className="bim-measure-main";const t=document.createElement("div");t.className="bim-measure-tools";const i=document.createElement("div");i.className="bim-measure-tool-grid";const n=`
9597
+ `,e.appendChild(r)}const n=document.createElement("span");n.textContent=t.text||t.url,e.appendChild(n),t.tooltip&&(e.title=t.tooltip)}attachAnnotationEvents(e,t){e.addEventListener("click",i=>{i.stopPropagation();const n=this.annotations.get(t);n&&this.handleClickAnnotation(n)}),e.addEventListener("mouseenter",()=>{const i=this.annotations.get(t);i&&this.handleHoverAnnotation(i)}),e.addEventListener("mouseleave",()=>{this.onHoverAnnotation&&this.onHoverAnnotation(null)})}sphericalToCartesian(e){const t=e.radius??this.sphereRadius;return w2.sphericalToCartesian({...e,radius:t})}updateAnnotationPosition(e){const t=new R(e.worldPosition.x,e.worldPosition.y,e.worldPosition.z),i=this.worldToScreen.worldToScreen(t);e.screenPosition={x:i.x,y:i.y};const n=this.isPositionInFront(t),r=this.isPositionInView(i);e.visible=n&&r,e.visible?(e.element.style.display="block",e.element.style.left=`${i.x}px`,e.element.style.top=`${i.y}px`):e.element.style.display="none"}isPositionInFront(e){const t=new R;return this.camera.getWorldDirection(t),e.clone().normalize().dot(t)>0}isPositionInView(e){const t=this.renderer.domElement.clientWidth,i=this.renderer.domElement.clientHeight;return e.x>=0&&e.x<=t&&e.y>=0&&e.y<=i}update(){this.annotations.forEach(e=>{this.updateAnnotationPosition(e)})}handleClickAnnotation(e){if(e.config.type===Qh.LINK){const t=e.config;window.open(t.url,"_blank")}this.onClickAnnotation&&this.onClickAnnotation(e)}handleHoverAnnotation(e){this.onHoverAnnotation&&this.onHoverAnnotation(e)}setOnClickAnnotation(e){this.onClickAnnotation=e}setOnHoverAnnotation(e){this.onHoverAnnotation=e}removeAnnotation(e){const t=this.annotations.get(e);t&&(t.element.remove(),this.annotations.delete(e))}clearAll(){this.annotations.forEach(e=>{e.element.remove()}),this.annotations.clear()}getAnnotations(){return Array.from(this.annotations.values())}getAnnotation(e){return this.annotations.get(e)}updateCamera(e){this.camera=e,this.worldToScreen.updateCamera(e)}dispose(){this.clearAll(),this.annotationContainer.remove(),this.onClickAnnotation=void 0,this.onHoverAnnotation=void 0}generateId(){return`annotation-${Date.now()}-${Math.random().toString(36).substr(2,9)}`}}class Oz{listeners=new Map;on(e,t){const i=String(e);this.listeners.has(i)||this.listeners.set(i,[]),this.listeners.get(i).push(t)}off(e,t){const i=String(e),n=this.listeners.get(i);if(n){const r=n.indexOf(t);r!==-1&&n.splice(r,1),n.length===0&&this.listeners.delete(i)}}trigger(e,t){const i=String(e),n=this.listeners.get(i);if(n&&n.length>0){const r=[...n];for(const a of r)try{a(t)}catch(o){console.error(`EventModule: Error in event handler for "${i}":`,o)}}}removeAllListeners(e){const t=String(e);this.listeners.delete(t)}clear(){this.listeners.clear()}listenerCount(e){const t=String(e),i=this.listeners.get(t);return i?i.length:0}dispose(){this.clear()}}var Zs=(s=>(s.PanoramaLoadStart="panorama-load-start",s.PanoramaLoadProgress="panorama-load-progress",s.PanoramaLoaded="panorama-loaded",s.PanoramaLoadError="panorama-load-error",s.AnnotationClick="annotation-click",s.AnnotationHover="annotation-hover",s.AnnotationAdd="annotation-add",s.AnnotationRemove="annotation-remove",s.ViewAngleChanged="view-angle-changed",s))(Zs||{});class Uz{sceneModule;cameraModule;renderModule;controlModule;eventModule;panoramaLoader;annotationManager;worldToScreen;isInitialized=!1;version="1.0.0";constructor(e){this.initialize(e)}initialize(e){const t={fov:75,enableZoom:!0,enableRotate:!0,minFov:30,maxFov:90,sphereRadius:500,rotateSpeed:.35,zoomSpeed:.8,enableDamping:!0,dampingFactor:.08,...e},i=document.getElementById(t.containerId);if(!i)throw new Error(`Container with id "${t.containerId}" not found`);try{this.eventModule=new Oz,this.sceneModule=new Az(t.sphereRadius),this.cameraModule=new Pz(i,t.fov,t.minFov,t.maxFov),this.renderModule=new Rz(i,!0),this.controlModule=new Iz(this.cameraModule,this.renderModule.getDomElement());const n=this.controlModule.getControls();n.enableZoom=t.enableZoom,n.enableRotate=t.enableRotate,n.setRotateSpeed(t.rotateSpeed),n.setZoomSpeed(t.zoomSpeed),n.setEnableDamping(t.enableDamping),n.setDampingFactor(t.dampingFactor),n.setZoomLimits(t.minFov,t.maxFov),n.setOnViewAngleChange((r,a)=>{this.eventModule.trigger(Zs.ViewAngleChanged,{theta:r,phi:a})}),this.panoramaLoader=new Nz,this.worldToScreen=new zt(this.cameraModule.getCamera(),this.renderModule.getRenderer(),this.sceneModule.getScene()),this.annotationManager=new kz(i,this.cameraModule.getCamera(),this.renderModule.getRenderer(),t.sphereRadius),this.annotationManager.setOnClickAnnotation(r=>{this.eventModule.trigger(Zs.AnnotationClick,{id:r.id,config:r.config,metadata:r.config.metadata})}),this.annotationManager.setOnHoverAnnotation(r=>{this.eventModule.trigger(Zs.AnnotationHover,{annotation:r?{id:r.id,config:r.config,metadata:r.config.metadata}:null})}),this.setupRenderLoop(),this.isInitialized=!0,console.log("EngineKernel720: Initialized successfully")}catch(n){throw console.error("EngineKernel720: Initialization failed",n),n}}setupRenderLoop(){this.renderModule.setOnBeforeRender(()=>{this.controlModule.update(),this.annotationManager.update()}),this.renderModule.startRenderLoop(this.sceneModule.getScene(),this.cameraModule.getCamera())}async loadPanorama(e){this.checkInitialized(),this.eventModule.trigger(Zs.PanoramaLoadStart,{url:e});try{this.panoramaLoader.setOnProgress(i=>{this.eventModule.trigger(Zs.PanoramaLoadProgress,{url:e,progress:i})});const t=await this.panoramaLoader.loadTexture(e);this.sceneModule.updatePanoramaTexture(t),this.eventModule.trigger(Zs.PanoramaLoaded,{url:e,progress:100}),console.log("EngineKernel720: Panorama loaded successfully")}catch(t){throw console.error("EngineKernel720: Failed to load panorama",t),this.eventModule.trigger(Zs.PanoramaLoadError,{url:e,error:t}),t}}async preloadPanoramas(e){this.checkInitialized();try{await this.panoramaLoader.preloadPanoramas(e),console.log(`EngineKernel720: Preloaded ${e.length} panoramas`)}catch(t){throw console.error("EngineKernel720: Failed to preload panoramas",t),t}}addAnnotation(e){this.checkInitialized();const t=this.annotationManager.addAnnotation(e);return this.eventModule.trigger(Zs.AnnotationAdd,{id:t,config:e}),t}addAnnotations(e){return this.checkInitialized(),e.map(t=>this.addAnnotation(t))}removeAnnotation(e){this.checkInitialized(),this.annotationManager.removeAnnotation(e),this.eventModule.trigger(Zs.AnnotationRemove,{id:e})}clearAnnotations(){this.checkInitialized(),this.annotationManager.clearAll()}getAnnotations(){return this.checkInitialized(),this.annotationManager.getAnnotations()}updateInteractionOptions(e){this.checkInitialized(),this.controlModule.updateInteractionOptions(e)}pickPanoramaPoint(e,t){this.checkInitialized();const i=this.renderModule.getRenderer().domElement,n=i.clientWidth,r=i.clientHeight;if(n===0||r===0)return null;const a=new me(e/n*2-1,-(t/r*2-1)),o=this.cameraModule.getCamera(),l=new R(a.x,a.y,.5);l.unproject(o),l.sub(o.position).normalize();const c=this.sceneModule.getSphereRadius(),h=o.position.clone().add(l.multiplyScalar(c)),d=w2.cartesianToSpherical(h.x,h.y,h.z);return{theta:d.theta,phi:d.phi,radius:c}}lookAt(e,t,i){this.checkInitialized(),i&&console.warn("EngineKernel720: Animated lookAt not implemented yet"),this.controlModule.lookAt(e,t)}getViewAngle(){return this.checkInitialized(),this.controlModule.getViewAngle()}setFov(e){this.checkInitialized(),this.cameraModule.setFov(e)}getFov(){return this.checkInitialized(),this.cameraModule.getFov()}on(e,t){this.checkInitialized(),this.eventModule.on(e,t)}off(e,t){this.checkInitialized(),this.eventModule.off(e,t)}resize(e,t){this.checkInitialized();const i=e??this.renderModule.getRenderer().domElement.clientWidth,n=t??this.renderModule.getRenderer().domElement.clientHeight;this.renderModule.resize(i,n),this.cameraModule.updateAspectRatio(i,n),console.log("EngineKernel720: Resized to",i,"x",n)}pauseRendering(){this.checkInitialized(),this.renderModule.pauseRendering()}resumeRendering(){this.checkInitialized(),this.renderModule.resumeRendering(this.sceneModule.getScene(),this.cameraModule.getCamera())}isRenderingPausedState(){return this.isInitialized?this.renderModule.isRenderingPausedState():!0}getVersion(){return this.version}dispose(){if(this.isInitialized)try{this.renderModule.pauseRendering(),this.annotationManager.dispose(),this.panoramaLoader.dispose(),this.controlModule.dispose(),this.cameraModule.dispose(),this.renderModule.dispose(),this.sceneModule.dispose(),this.eventModule.dispose(),this.isInitialized=!1,console.log("EngineKernel720: Disposed successfully")}catch(e){console.error("EngineKernel720: Error during dispose",e)}}checkInitialized(){if(!this.isInitialized)throw new Error("EngineKernel720: Not initialized")}}function Bz(s){return new QF(s)}function Fz(s){return new Cz(s)}function zz(s){return new Uz(s)}class xa{engine=null;registry;container;containerId;options;_isInitialized=!1;_isDestroyed=!1;unsubscribeTheme=null;currentMeasureType=null;isMeasureActive=!1;currentSectionMode=null;selectedComponent=null;constructor(e,t){this.registry=t,this.container=e.container,this.container.id?this.containerId=this.container.id:(this.containerId=`engine-container-${Date.now()}-${Math.random().toString(36).substr(2,9)}`,this.container.id=this.containerId),this.options={backgroundColor:"linear-gradient(to bottom, rgb(214, 224, 235), rgb(246, 250, 255))",version:e.version??"v2",showStats:e.showStats??!1,showViewCube:e.showViewCube??!0}}init(){if(this._isInitialized){console.warn("[Engine] Engine already initialized.");return}if(this._isDestroyed){console.error("[Engine] Cannot initialize destroyed engine.");return}try{typeof this.options.backgroundColor=="string"&&(this.container.style.background=this.options.backgroundColor);const e={containerId:this.containerId,backgroundColor:this.options.backgroundColor,version:this.options.version,showStats:this.options.showStats,showViewCube:this.options.showViewCube};if(console.log("引擎配置信息:",e),this.engine=Bz(e),!this.engine)throw new Error("Failed to create engine instance");this._isInitialized=!0,this.resize(this.container.clientWidth,this.container.clientHeight),this.unsubscribeTheme=ct.subscribe(t=>{this.setTheme(t)}),this.setTheme(ct.getTheme()),this.engine?.events?.on?(this.engine.events.on("click",t=>{const i=this.registry;console.log("[Engine] 底层 click 事件触发:",t),t&&Array.isArray(t)&&t.length>0&&t[0].url?(this.selectedComponent={url:t[0].url,id:t[0].ids?.[0]},console.log("[Engine] 触发 component:selected:",this.selectedComponent),i.emit("component:selected",this.selectedComponent)):(this.selectedComponent=null,console.log("[Engine] 触发 component:deselected"),i.emit("component:deselected",{}))}),this.engine.events.on("loading_completed",()=>{console.log("[Engine] 底层 LoadingCompleted 事件触发"),this.registry.emit("engine:model-loading-completed",{})})):console.warn("[Engine] 底层引擎不支持 events.on 方法,无法监听点击事件")}catch(e){throw console.error("[Engine] Failed to initialize engine:",e),this._isInitialized=!1,e}}setTheme(e){}setLocales(){}isInitialized(){return this._isInitialized}loadModel(e,t){if(!this._isInitialized||!this.engine){console.error("[Engine] Engine not initialized. Please call init() first.");return}if(!e||e.length===0){console.error("[Engine] Model URLs are required.");return}this.engine.loaderModule.loadModels(e,t)}CameraGoHome(){this.engine.viewCube.CameraGoHome()}onRawEvent(e,t){this.engine?.events?.on(e,t)}offRawEvent(e,t){this.engine?.events?.off(e,t)}pauseRendering(){if(!this._isInitialized||!this.engine){console.warn("[Engine] Engine not initialized.");return}this.engine.pauseRendering()}resumeRendering(){if(!this._isInitialized||!this.engine){console.warn("[Engine] Engine not initialized.");return}this.engine.resumeRendering()}dispose(){if(!this._isInitialized||!this.engine){console.warn("[Engine] Engine not initialized.");return}this.engine.dispose()}resize(e,t){if(!this._isInitialized||!this.engine)return;const i=typeof e=="number"?Math.floor(e):this.container.clientWidth,n=typeof t=="number"?Math.floor(t):this.container.clientHeight;i<=0||n<=0||typeof this.engine.handleWindowResize=="function"&&this.engine.handleWindowResize(i,n)}activateMeasure(e){if(!this._isInitialized||!this.engine?.measure){console.error("[Engine] Cannot activate measure: engine not initialized.");return}if(this.currentMeasureType===e){console.log(`[Engine] Measure ${e} already active, skipping.`);return}this.isMeasureActive||(console.log("[Engine] Activating measure module"),this.engine.measure.active(),this.isMeasureActive=!0),console.log(`[Engine] Activating measure: ${e}`);const t=this.engine.measure;switch(e){case"clearHeight":t.clearHeightMeasure.active();break;case"clearDistance":t.clearDistanceMeasure.active();break;case"distance":t.distanceMeasure.active();break;case"elevation":t.elevationMeasure.active();break;case"point":t.pointMeasure.active();break;case"angle":t.angleMeasure.active();break;case"area":t.areaMeasure.active();break;case"slope":t.slopeMeasure.active();break;default:console.error(`[Engine] Unknown measure type: ${e}`);return}this.currentMeasureType=e}getCurrentMeasureType(){return this.currentMeasureType}deactivateMeasure(){!this._isInitialized||!this.engine?.measure||(console.log("[Engine] Deactivating measure"),this.engine.measure.disActive(),this.engine.measure.clearAll(),this.isMeasureActive=!1,this.currentMeasureType=null)}clearAllMeasures(){!this._isInitialized||!this.engine?.measure||(console.log("[Engine] Clearing all measures"),this.engine.measure.clearAll())}saveMeasureSetting(e){!this._isInitialized||!this.engine?.measure||this.engine.measure.saveSetting?.(e)}setClearHeightDirection(e){!this._isInitialized||!this.engine?.measure||(console.log(`[Engine] Setting clearHeight direction: ${e}`),this.engine.measure.clearHeightMeasure.setDirection(e))}setClearHeightSelectType(e){!this._isInitialized||!this.engine?.measure||(console.log(`[Engine] Setting clearHeight selectType: ${e}`),this.engine.measure.clearHeightMeasure.setSelectType(e))}activeSection(e){if(!this._isInitialized||!this.engine?.clipping){console.error("[Engine] Cannot activate section: engine not initialized.");return}if(this.currentSectionMode===e){console.log(`[Engine] Section ${e} already active, skipping.`);return}console.log(`[Engine] Activating section: ${e}`),this.engine.clipping.active(e),this.currentSectionMode=e}getCurrentSectionMode(){return this.currentSectionMode}setSectionBoxRange(e){if(!this._isInitialized||!this.engine?.clipping){console.error("[Engine] Cannot set section box range: engine not initialized.");return}this.engine.clipping.updateClippingValue(e)}deactivateSection(){!this._isInitialized||!this.engine?.clipping||(console.log("[Engine] Deactivating all sections"),this.engine.clipping.disActive(),this.currentSectionMode=null)}hideSection(){if(!this._isInitialized||!this.engine?.clipping){console.error("[Engine] Cannot hide section: engine not initialized.");return}console.log("[Engine] Hiding section"),this.engine.clipping.disabled()}recoverSection(){if(!this._isInitialized||!this.engine?.clipping){console.error("[Engine] Cannot recover section: engine not initialized.");return}console.log("[Engine] Recovering section"),this.engine.clipping.recover()}fitSectionBoxToModel(){if(!this._isInitialized||!this.engine){console.error("[Engine] Cannot fit section box: engine not initialized.");return}const e=this.engine.engineStatus?.highlightModels;e&&(console.log("[Engine] Fitting section box to model"),this.engine.clipping?.clippingModel(e))}scaleSectionBox(){if(!this._isInitialized||!this.engine?.clipping){console.error("[Engine] Cannot scale section box: engine not initialized.");return}this.engine.clipping.scaleBox()}reverseSection(){if(!this._isInitialized||!this.engine?.clipping){console.error("[Engine] Cannot reverse section: engine not initialized.");return}this.engine.clipping.reverse()}switchCamera(){if(!this._isInitialized||!this.engine?.cameraModule){console.warn("[Engine] Cannot switch camera: engine not initialized.");return}this.engine.cameraModule.switchCurrentCamera()}getCameraType(){return!this._isInitialized||!this.engine?.cameraModule?"perspective":this.engine.cameraModule.getCameraType()===1?"orthographic":"perspective"}getRenderMode(){return!this._isInitialized||!this.engine?.engineModelModule?"balance":this.engine.engineModelModule.getCurrentMode()}setRenderMode(e){if(!this._isInitialized||!this.engine?.engineModelModule){console.warn("[Engine] Cannot set render mode: engine not initialized.");return}try{this.engine.engineModelModule.setMode(e)}catch(t){console.warn("[Engine] Failed to set render mode:",t)}}normalizePercent(e,t){return Number.isFinite(e)?Math.min(100,Math.max(0,Math.round(e))):t}getSettingApi(){return!this._isInitialized||!this.engine?.setting?null:this.engine.setting}callSettingMethod(e,...t){const i=this.getSettingApi();if(!i)return;const n=i[e];if(typeof n=="function")return n.apply(this.engine.setting,t)}hasSettingMethod(e){const t=this.getSettingApi();return t?typeof t[e]=="function":!1}mergeSettingsWithDefaults(e){const t=e.display?.groundId??"0",i=typeof e.display?.showGround=="boolean"?e.display.showGround:t!=="0"&&t!=="";return{render:{mode:e.render?.mode??"advanced",contrast:this.normalizePercent(e.render?.contrast??50,50),saturation:this.normalizePercent(e.render?.saturation??50,50),shadowIntensity:this.normalizePercent(e.render?.shadowIntensity??50,50),lightIntensity:this.normalizePercent(e.render?.lightIntensity??50,50),gtaoIntensity:this.normalizePercent(e.render?.gtaoIntensity??50,50)},display:{showEdge:!!e.display?.showEdge,edgeOpacity:this.normalizePercent(e.display?.edgeOpacity??30,30),showGrid:!!e.display?.showGrid,showLevel:!!e.display?.showLevel,showGround:i,groundId:t,groundHeight:Number.isFinite(e.display?.groundHeight)?Number(e.display?.groundHeight):0},environment:{type:e.environment?.type??"none",hdrId:e.environment?.hdrId??"0",hdrIntensity:this.normalizePercent(e.environment?.hdrIntensity??20,20),skyPreset:e.environment?.skyPreset??"sunrise_clear",skyParams:e.environment?.skyParams??{},skyIntensity:this.normalizePercent(e.environment?.skyIntensity??20,20)}}}getPresetLists(){const e={ground:[],hdr:[],sky:[]},t=this.getSettingApi();if(!t)return e;const i=t.getPresetLists,n=typeof i=="function"?i.call(this.engine.setting):null,r=this.getGroundList().map(o=>({id:o.id,names:[o.name,o.name,o.name]})),a=this.getHDRBackgroundList().map(o=>({id:o.id,names:[o.name,o.name,o.name]}));return{ground:Array.isArray(n?.ground)&&n.ground.length>0?n.ground:r,hdr:Array.isArray(n?.hdr)&&n.hdr.length>0?n.hdr:a,sky:Array.isArray(n?.sky)?n.sky:[]}}getSettings(){const e=this.callSettingMethod("getSettings");return e&&typeof e=="object"?this.mergeSettingsWithDefaults(e):{render:{mode:this.getRenderMode(),contrast:this.normalizePercent(this.getSceneContrast(),50),saturation:this.normalizePercent(this.getSceneSaturation(),50),shadowIntensity:50,lightIntensity:this.normalizePercent(this.getAmbientLightIntensity(),50),gtaoIntensity:50},display:{showEdge:this.getModelEdgeActive(),edgeOpacity:30,showGrid:!1,showLevel:!1,showGround:this.getGroundId()!=="0"&&this.getGroundId()!=="",groundId:this.getGroundId()||"0",groundHeight:this.getGroundElevation()},environment:{type:this.getHDRBackgroundId()&&this.getHDRBackgroundId()!=="0"?"hdr":"none",hdrId:this.getHDRBackgroundId()||"0",hdrIntensity:20,skyPreset:"sunrise_clear",skyParams:{},skyIntensity:20}}}async setSettings(e){if(!this._isInitialized||!this.engine?.setting){console.warn("[Engine] Cannot set settings: engine not initialized.");return}if(this.hasSettingMethod("setSettings"))try{const t=this.callSettingMethod("setSettings",e);await Promise.resolve(t);return}catch(t){console.warn("[Engine] Native setSettings failed, fallback to compatibility mode.",t)}if(e.render?.mode&&this.setRenderMode(e.render.mode),typeof e.render?.lightIntensity=="number"&&this.setAmbientLightIntensity(e.render.lightIntensity),typeof e.render?.contrast=="number"&&this.setSceneContrast(e.render.contrast),typeof e.render?.saturation=="number"&&this.setSceneSaturation(e.render.saturation),typeof e.display?.showEdge=="boolean"&&(e.display.showEdge?this.activeModelEdge():this.disActiveModelEdge()),typeof e.display?.edgeOpacity=="number"&&this.callSettingMethod("setEdgeOpacity",e.display.edgeOpacity),typeof e.display?.showGrid=="boolean"&&this.callSettingMethod("setShowGrid",e.display.showGrid),typeof e.display?.showLevel=="boolean"&&this.callSettingMethod("setShowLevel",e.display.showLevel),typeof e.display?.groundId=="string"&&this.setGroundId(e.display.groundId),typeof e.display?.groundHeight=="number"&&this.setGroundElevation(e.display.groundHeight),typeof e.environment?.type=="string"){const t=this.callSettingMethod("setEnvironmentType",e.environment.type);t!==void 0?await Promise.resolve(t):e.environment.type==="none"&&this.setHDRBackgroundId("0")}if(typeof e.environment?.hdrId=="string"){const t=this.callSettingMethod("setHdrId",e.environment.hdrId);t!==void 0?await Promise.resolve(t):this.setHDRBackgroundId(e.environment.hdrId)}typeof e.environment?.hdrIntensity=="number"&&this.callSettingMethod("setHdrIntensity",e.environment.hdrIntensity),typeof e.environment?.skyPreset=="string"&&this.callSettingMethod("setSkyPreset",e.environment.skyPreset),typeof e.environment?.skyIntensity=="number"&&this.callSettingMethod("setSkyIntensity",e.environment.skyIntensity),e.environment?.skyParams&&typeof e.environment.skyParams=="object"&&this.callSettingMethod("setSkyParams",e.environment.skyParams),typeof e.render?.shadowIntensity=="number"&&this.callSettingMethod("setShadowIntensity",e.render.shadowIntensity),typeof e.render?.gtaoIntensity=="number"&&this.callSettingMethod("setGtaoIntensity",e.render.gtaoIntensity)}async resetToDefault(){const t=this.getSettingApi()?.resetToDefault;if(typeof t=="function"){await Promise.resolve(t.call(this.engine.setting));return}await this.setSettings({render:{mode:"advanced",contrast:50,saturation:50,shadowIntensity:50,lightIntensity:50,gtaoIntensity:50},display:{showEdge:!1,edgeOpacity:30,showGrid:!1,showLevel:!1,showGround:!1,groundId:"0",groundHeight:0},environment:{type:"none",hdrId:"0",hdrIntensity:20,skyPreset:"sunrise_clear",skyParams:{},skyIntensity:20}})}activeModelEdge(){if(!this._isInitialized||!this.engine?.modelEdge){console.warn("[Engine] Cannot active model edge: engine not initialized.");return}this.engine.modelEdge.active()}disActiveModelEdge(){!this._isInitialized||!this.engine?.modelEdge||this.engine.modelEdge.disActive()}getModelEdgeActive(){return!this._isInitialized||!this.engine?.modelEdge?!1:this.engine.modelEdge.getActive?.()??!1}setAmbientLightIntensity(e){if(!this._isInitialized||!this.engine?.setting){console.warn("[Engine] Cannot set ambient light intensity: engine not initialized.");return}this.engine.setting.setAmbientLightIntensity(e)}getAmbientLightIntensity(){return!this._isInitialized||!this.engine?.setting?50:this.engine.setting.getAmbientLightIntensity?.()??50}setSceneContrast(e){if(!this._isInitialized||!this.engine?.setting){console.warn("[Engine] Cannot set scene contrast: engine not initialized.");return}this.engine.setting.setSceneContrast(e)}getSceneContrast(){return!this._isInitialized||!this.engine?.setting?50:this.engine.setting.getSceneContrast?.()??50}setSceneSaturation(e){if(!this._isInitialized||!this.engine?.setting){console.warn("[Engine] Cannot set scene saturation: engine not initialized.");return}this.engine.setting.setSceneSaturation(e)}getSceneSaturation(){return!this._isInitialized||!this.engine?.setting?50:this.engine.setting.getSceneSaturation?.()??50}getHDRBackgroundList(){return!this._isInitialized||!this.engine?.setting?[]:this.engine.setting.getHDRBackground?.()??[]}setHDRBackgroundId(e){if(!this._isInitialized||!this.engine?.setting){console.warn("[Engine] Cannot set HDR background: engine not initialized.");return}this.engine.setting.setHDRBackgroundId(e)}getHDRBackgroundId(){return!this._isInitialized||!this.engine?.setting?"":this.engine.setting.getHDRBackgroundId?.()??""}setHDRBackgroundVisibility(e){if(!this._isInitialized||!this.engine?.setting){console.warn("[Engine] Cannot set HDR background visibility: engine not initialized.");return}this.engine.setting.setHDRBackgroundVisibility(e)}getHDRBackgroundVisibility(){return!this._isInitialized||!this.engine?.setting?!0:this.engine.setting.getHDRBackgroundVisibility?.()??!0}getGroundList(){return!this._isInitialized||!this.engine?.setting?[]:this.engine.setting.getGroundList?.()??[]}setGroundId(e){if(!this._isInitialized||!this.engine?.setting){console.warn("[Engine] Cannot set ground: engine not initialized.");return}this.engine.setting.setGroundId(e)}getGroundId(){return!this._isInitialized||!this.engine?.setting?"":this.engine.setting.getGroundId?.()??""}setGroundElevation(e){if(!this._isInitialized||!this.engine?.setting){console.warn("[Engine] Cannot set ground elevation: engine not initialized.");return}this.engine.setting.setGroundElevation(e)}getGroundElevation(){return!this._isInitialized||!this.engine?.setting?0:this.engine.setting.getGroundElevation?.()??0}isWalkModeActive=!1;activateFirstPersonMode(){if(!this._isInitialized||!this.engine){console.error("[Engine] Cannot activate first person mode: engine not initialized.");return}if(!this.engine.controlModule){console.error("[Engine] Control module not available.");return}if(this.isWalkModeActive){console.log("[Engine] First person mode already active, skipping.");return}console.log("[Engine] Activating first person mode"),this.engine.controlModule.switchFirstPersonMode(),this.loadWalkSettings(),this.isWalkModeActive=!0}deactivateFirstPersonMode(){!this._isInitialized||!this.engine?.controlModule||this.isWalkModeActive&&(console.log("[Engine] Deactivating first person mode"),this.engine.controlModule.switchDefaultMode(),this.isWalkModeActive=!1)}static WALK_SPEED_KEY="bim-walk-speed";static WALK_GRAVITY_KEY="bim-walk-gravity";static WALK_COLLISION_KEY="bim-walk-collision";setWalkSpeed(e){if(!this._isInitialized||!this.engine?.controlModule){console.error("[Engine] Cannot set walk speed: engine not initialized.");return}localStorage.setItem(xa.WALK_SPEED_KEY,String(e)),this.engine.controlModule.setMoveSpeed(e)}setWalkGravity(e){if(!this._isInitialized||!this.engine?.controlModule){console.error("[Engine] Cannot set walk gravity: engine not initialized.");return}localStorage.setItem(xa.WALK_GRAVITY_KEY,String(e)),this.engine.controlModule.setApplyGravity(e)}setWalkCollision(e){if(!this._isInitialized||!this.engine?.controlModule){console.error("[Engine] Cannot set walk collision: engine not initialized.");return}localStorage.setItem(xa.WALK_COLLISION_KEY,String(e)),this.engine.controlModule.setApplyCollision(e)}loadWalkSettings(){if(!this.engine?.controlModule)return;const e=localStorage.getItem(xa.WALK_SPEED_KEY),t=localStorage.getItem(xa.WALK_GRAVITY_KEY),i=localStorage.getItem(xa.WALK_COLLISION_KEY);this.engine.controlModule.setMoveSpeed(e?Number(e):1),this.engine.controlModule.setApplyGravity(t==="true"),this.engine.controlModule.setApplyCollision(i==="true")}toggleMiniMap(){if(!this._isInitialized||!this.engine){console.error("[Engine] Cannot toggle mini map: engine not initialized.");return}this.engine.minMap?.toggle()}getMiniMapState(){return!this._isInitialized||!this.engine?!1:this.engine.minMap?.getstate()??!1}isFirstPersonModeActive(){return this.isWalkModeActive}getSelectedComponent(){return this.selectedComponent}getComponentProperties(e,t,i){if(!this._isInitialized||!this.engine){console.error("[Engine] Cannot get component properties: engine not initialized.");return}if(!this.engine.modelProperties){console.error("[Engine] modelProperties not available");return}console.log("[Engine] Getting component properties:",{url:e,id:t}),this.engine.modelProperties.getModelProperties(e,t,i)}getModelPosition(e){return!this._isInitialized||!this.engine?(console.error("[Engine] Cannot get model position: engine not initialized."),null):this.engine.issueReport?.getMoldePosition?(console.log("[Engine] Getting model position:",e),this.engine.issueReport.getMoldePosition(e)):(console.error("[Engine] getMoldePosition method not available in issueReport"),null)}jumpToCamera(e){if(!this._isInitialized||!this.engine)return console.error("[Engine] Cannot jump to camera: engine not initialized."),!1;if(!this.engine.issueReport?.jumptoCamera)return console.error("[Engine] jumptoCamera method not available in issueReport"),!1;console.log("[Engine] Jumping to camera:",e);try{return this.engine.issueReport.jumptoCamera(e),!0}catch(t){return console.error("[Engine] Failed to jump to camera:",t),!1}}getTypeTreeData(){return!this._isInitialized||!this.engine?.modelTree?[]:this.engine.modelTree.getTypeTreeData()}getLevelTreeData(){return!this._isInitialized||!this.engine?.modelTree?[]:this.engine.modelTree.getLevelTreeData()}getMajorTreeData(){return!this._isInitialized||!this.engine?.modelTree?[]:this.engine.modelTree.getMajorTreeData()}activateZoomBox(){if(!this._isInitialized||!this.engine){console.warn("[Engine] Engine not initialized.");return}this.engine.rangeScale?.active()}getEngineInfo(){return!this._isInitialized||!this.engine?(console.warn("[Engine] Engine not initialized."),null):this.engine.engineInfo.getEngineInfo()}pathRoamingAddPoint(){if(!this._isInitialized||!this.engine?.pathRoaming){console.warn("[Engine] pathRoaming not available");return}this.engine.pathRoaming.addPoint(0)}pathRoamingRemovePoint(e){if(!this._isInitialized||!this.engine?.pathRoaming){console.warn("[Engine] pathRoaming not available");return}this.engine.pathRoaming.removePoint(e)}pathRoamingClearPoints(){if(!this._isInitialized||!this.engine?.pathRoaming){console.warn("[Engine] pathRoaming not available");return}this.engine.pathRoaming.clearPoints()}pathRoamingGetPoints(){return!this._isInitialized||!this.engine?.pathRoaming?(console.warn("[Engine] pathRoaming not available"),[]):this.engine.pathRoaming.getPoints()??[]}pathRoamingJumpToPoint(e){if(!this._isInitialized||!this.engine?.pathRoaming){console.warn("[Engine] pathRoaming not available");return}this.engine.pathRoaming.jumpToPoint(e)}pathRoamingPlay(e){if(!this._isInitialized||!this.engine?.pathRoaming){console.warn("[Engine] pathRoaming not available");return}this.engine.pathRoaming.play(e)}pathRoamingStop(){if(!this._isInitialized||!this.engine?.pathRoaming){console.warn("[Engine] pathRoaming not available");return}this.engine.pathRoaming.stop()}getHighlightModels(){return!this._isInitialized||!this.engine?null:this.engine.engineStatus?.highlightModels??null}highlightModel(e){if(!this._isInitialized||!this.engine?.modelToolModule){console.warn("[Engine] Cannot highlight model: engine not initialized.");return}const t=this.sanitizeModelParams(e);if(t.length)try{this.engine.modelToolModule.highlightModel(t)}catch(i){console.warn("[Engine] highlightModel failed:",i)}}unhighlightAllModels(){if(!this._isInitialized||!this.engine?.modelToolModule){console.warn("[Engine] Cannot unhighlight models: engine not initialized.");return}this.engine.modelToolModule.unhighlightAllModels()}viewScaleToModel(e){if(!this._isInitialized||!this.engine?.modelToolModule){console.warn("[Engine] Cannot view scale to model: engine not initialized.");return}const t=this.sanitizeModelParams(e);if(t.length)try{this.engine.modelToolModule.viewScaleToModel(t)}catch(i){console.warn("[Engine] viewScaleToModel failed:",i)}}hideModels(e){if(!this._isInitialized||!this.engine?.modelToolModule){console.warn("[Engine] Cannot hide models: engine not initialized.");return}const t=this.sanitizeModelParams(e);if(t.length)try{this.engine.modelToolModule.hideModel(t)}catch(i){console.warn("[Engine] hideModels failed:",i)}}showModel(e){if(!this._isInitialized||!this.engine?.modelToolModule){console.warn("[Engine] Cannot show model: engine not initialized.");return}const t=this.sanitizeModelParams(e);if(t.length)try{this.engine.modelToolModule.showModel(t)}catch(i){console.warn("[Engine] showModel failed:",i)}}sanitizeModelParams(e){if(!Array.isArray(e))return[];const t=a=>a.replace(/\/+$/,""),i=Array.isArray(this.engine?.models)?this.engine.models:[],n=new Map;for(const a of i)a?.url&&n.set(t(a.url),a);const r=[];for(const a of e){if(!a||typeof a.url!="string"||!a.url||!Array.isArray(a.ids))continue;const o=n.get(t(a.url));if(!o||!(o.nodesMap instanceof Map))continue;const l=new Set;for(const h of a.ids){if(!Number.isFinite(h))continue;const d=Number(h);if(!Number.isInteger(d))continue;const p=o.nodesMap.get(d);!p||!Array.isArray(p.indexes)||p.indexes.length===0||l.add(d)}const c=Array.from(l);c.length&&r.push({url:a.url,ids:c})}return r}translucentModels(e){if(!this._isInitialized||!this.engine?.modelToolModule){console.warn("[Engine] Cannot translucent models: engine not initialized.");return}e&&this.engine.modelToolModule.translucentModel(e)}unTranslucentModel(){if(!this._isInitialized||!this.engine?.modelToolModule){console.warn("[Engine] Cannot cancel translucent: engine not initialized.");return}this.engine.modelToolModule.unTranslucentModel()}isolateModels(e){if(!this._isInitialized||!this.engine?.modelToolModule){console.warn("[Engine] Cannot isolate models: engine not initialized.");return}e&&this.engine.modelToolModule.isolateModel(e)}translucentOtherModels(e){if(!this._isInitialized||!this.engine?.modelToolModule){console.warn("[Engine] Cannot translucent other models: engine not initialized.");return}e&&this.engine.modelToolModule.translucentOtherModel(e)}showAllModels(){if(!this._isInitialized||!this.engine?.modelToolModule){console.warn("[Engine] Cannot show all models: engine not initialized.");return}this.deactivateSection(),this.engine.modelToolModule.showAllModels()}batchSelectSameTypeModel(e){if(!this._isInitialized||!this.engine?.modelToolModule){console.warn("[Engine] Cannot batch select: engine not initialized.");return}e&&this.engine.modelToolModule.batchSelectSameTypeModel(e)}batchSelectSameLevelModel(e){if(!this._isInitialized||!this.engine?.modelToolModule){console.warn("[Engine] Cannot batch select: engine not initialized.");return}e&&this.engine.modelToolModule.batchSelectSameLevelModel(e)}batchSelectSameLevelTypeModel(e){if(!this._isInitialized||!this.engine?.modelToolModule){console.warn("[Engine] Cannot batch select: engine not initialized.");return}e&&this.engine.modelToolModule.batchSelectSameLevelTypeModel(e)}destroy(){this._isDestroyed||(this.deactivateMeasure(),this.unsubscribeTheme&&(this.unsubscribeTheme(),this.unsubscribeTheme=null),this.engine&&(this.engine.dispose(),this.engine=null),this.container.innerHTML="",this.currentMeasureType=null,this.isMeasureActive=!1,this._isDestroyed=!0,this._isInitialized=!1)}}class Hz{element;content=null;isVisible=!1;onCloseCallback;options;mouseDownTime=0;mouseDownX=0;mouseDownY=0;CLICK_THRESHOLD=200;MOVE_THRESHOLD=5;constructor(e){this.options=e,this.element=document.createElement("div"),this.element.className=`bim-right-key ${e?.className||""}`,e?.zIndex&&(this.element.style.zIndex=e.zIndex.toString()),document.body.appendChild(this.element)}init(){document.addEventListener("mousedown",this.handleGlobalClick),this.element.addEventListener("contextmenu",e=>{e.preventDefault(),e.stopPropagation()}),this.options?.container&&(this.options.container.addEventListener("mousedown",this.handleContainerMouseDown),this.options.container.addEventListener("mouseup",this.handleContainerMouseUp),this.options.container.addEventListener("contextmenu",this.handleContainerContextMenu))}setTheme(e){}setLocales(){}destroy(){document.removeEventListener("mousedown",this.handleGlobalClick),this.options?.container&&(this.options.container.removeEventListener("mousedown",this.handleContainerMouseDown),this.options.container.removeEventListener("mouseup",this.handleContainerMouseUp),this.options.container.removeEventListener("contextmenu",this.handleContainerContextMenu)),this.unmountContent(),this.element.remove()}handleContainerMouseDown=e=>{e.button===2&&(this.mouseDownTime=Date.now(),this.mouseDownX=e.clientX,this.mouseDownY=e.clientY)};handleContainerMouseUp=e=>{if(e.button!==2||Date.now()-this.mouseDownTime>this.CLICK_THRESHOLD)return;const i=e.clientX-this.mouseDownX,n=e.clientY-this.mouseDownY;i*i+n*n>this.MOVE_THRESHOLD*this.MOVE_THRESHOLD||this.options?.onContext&&this.options.onContext(e)};handleContainerContextMenu=e=>{e.preventDefault()};setOnClose(e){this.onCloseCallback=e}mount(e){this.unmountContent(),this.content=e,this.element.appendChild(e.getElement())}unmountContent(){this.content&&(this.content.destroy(),this.element.innerHTML="",this.content=null)}show(e,t){this.element.classList.add("visible"),this.isVisible=!0,this.element.style.left=`${e}px`,this.element.style.top=`${t}px`;const i=this.element.getBoundingClientRect(),n=window.innerWidth,r=window.innerHeight;let a=e,o=t;e+i.width>n&&(a=e-i.width),t+i.height>r&&(o=t-i.height),this.element.style.left=`${a}px`,this.element.style.top=`${o}px`}hide(){this.element.classList.remove("visible"),this.isVisible=!1,this.unmountContent(),this.onCloseCallback&&this.onCloseCallback()}handleGlobalClick=e=>{this.isVisible&&(this.element.contains(e.target)||this.hide())}}class ry{element;options;unsubscribeLocale=null;unsubscribeTheme=null;activeSubMenu=null;constructor(e){this.options=e,this.element=document.createElement("ul"),this.element.className="bim-menu"}init(){this.render(),this.unsubscribeLocale=Zt.subscribe(()=>{this.setLocales()}),this.unsubscribeTheme=ct.subscribe(e=>{this.setTheme(e)})}setTheme(e){const t=this.element.style;t.setProperty("--bim-bg-elevated",e.bgElevated),t.setProperty("--bim-text-primary",e.textPrimary),t.setProperty("--bim-divider",e.divider),t.setProperty("--bim-component-bg-hover",e.componentBgHover),t.setProperty("--bim-shadow-lg",e.shadowLg)}setLocales(){this.element.innerHTML="",this.render()}destroy(){this.unsubscribeLocale&&(this.unsubscribeLocale(),this.unsubscribeLocale=null),this.unsubscribeTheme&&(this.unsubscribeTheme(),this.unsubscribeTheme=null),this.closeSubMenu(),this.element.remove()}getElement(){return this.element}hasAnyIcon(e){return e.some(t=>t.icon?!0:t.children?this.hasAnyIcon(t.children):!1)}render(){const{items:e,groupOrder:t}=this.options;this.hasAnyIcon(e)?this.element.classList.add("has-icons"):this.element.classList.remove("has-icons");const i=new Map,n="default";e.forEach(a=>{const o=a.group||n;i.has(o)||i.set(o,[]),i.get(o).push(a)});let r=[];if(t){r=t.filter(a=>i.has(a));for(const a of i.keys())r.includes(a)||r.push(a)}else r=Array.from(i.keys());r.forEach((a,o)=>{if(o>0){const c=document.createElement("li");c.className="bim-menu-divider",this.element.appendChild(c)}const l=i.get(a);l.sort((c,h)=>(c.order||0)-(h.order||0)),l.forEach(c=>{if(c.visible!==!1&&(this.element.appendChild(this.createItemElement(c)),c.divider)){const h=document.createElement("li");h.className="bim-menu-divider",this.element.appendChild(h)}})})}createItemElement(e){const t=document.createElement("li"),i=!e.disabled;t.className=`bim-menu-item ${i?"":"disabled"}`;const n=document.createElement("div");n.className="bim-menu-item-icon",e.icon&&(n.innerHTML=e.icon),t.appendChild(n);const r=document.createElement("div");r.className="bim-menu-item-label",r.textContent=Se(e.label),t.appendChild(r);const a=e.children,o=a&&a.length>0;if(o){const l=document.createElement("div");l.className="bim-menu-item-arrow",l.innerHTML='<svg viewBox="0 0 24 24"><path d="M10 6L8.59 7.41 13.17 12l-4.58 4.59L10 18l6-6z"/></svg>',t.appendChild(l),t.addEventListener("mouseenter",()=>this.openSubMenu(e,t))}else t.addEventListener("mouseenter",()=>this.closeSubMenu());return i&&t.addEventListener("click",l=>{l.stopPropagation(),console.log(`[BimMenu] Clicked item: ${e.id}`),o||(e.onClick?(console.log(`[BimMenu] Executing onClick for ${e.id}`),e.onClick()):console.warn(`[BimMenu] No onClick handler for ${e.id}`))}),t}openSubMenu(e,t){const i=e.children;if(!i||i.length===0)return;this.closeSubMenu();const n=document.createElement("div");n.style.position="fixed",n.style.zIndex="10001";const r=t.getBoundingClientRect();n.style.top=`${r.top}px`,n.style.left=`${r.right}px`,n.addEventListener("mousedown",l=>l.stopPropagation());const a=new ry({items:i});a.init(),n.appendChild(a.element),document.body.appendChild(n),this.activeSubMenu={menu:a,container:n};const o=n.getBoundingClientRect();o.right>window.innerWidth&&(n.style.left=`${r.left-o.width}px`)}closeSubMenu(){this.activeSubMenu&&(this.activeSubMenu.menu.destroy(),this.activeSubMenu.container.remove(),this.activeSubMenu=null)}}class ay extends jn{container;rightKeyPanel;contextHandlers=[];constructor(e,t){super(t),this.container=e,this.rightKeyPanel=new Hz({zIndex:9e3,container:this.container,onContext:this.handleContextMenu}),this.rightKeyPanel.init()}destroy(){this.rightKeyPanel.destroy(),super.destroy()}registerHandler(e){this.contextHandlers.push(e)}showMenu(e,t,i,n){if(!i||i.length===0)return;const r=new ry({items:i,groupOrder:n});r.init(),this.rightKeyPanel.mount(r),this.rightKeyPanel.show(e,t)}hide(){this.rightKeyPanel.hide()}handleContextMenu=e=>{let t=null;for(const i of this.contextHandlers){const n=i(e);n&&n.length>0&&(t||(t=[]),t=t.concat(n))}t&&t.length>0?this.showMenu(e.clientX,e.clientY,t):this.hide()}}class E2 extends jn{container;engineInstance=null;rightKey=null;constructor(e,t){super(t),this.container=e}getEngineComponent(){return this.engineInstance}initialize(e){this.engineInstance&&this.engineInstance.isInitialized()&&(console.warn("[EngineManager] 3D Engine already initialized. Destroying old instance..."),this.engineInstance.destroy(),this.engineInstance=null);try{return this.engineInstance=new xa({container:this.container,...e},this.registry),this.engineInstance.init(),this.rightKey=new ay(this.container,this.registry),this.rightKey.registerHandler(t=>{const i=this.engineInstance?.getSelectedComponent(),n=[];return i&&(n.push({id:"componentDetail",label:"menu.componentDetail",group:"component",order:1,divider:!0,onClick:()=>{this.registry.componentDetail?.show(),this.rightKey?.hide()}}),n.push({id:"hideSelected",label:"menu.hideSelected",group:"component",order:2,onClick:()=>{const r=this.engineInstance?.getHighlightModels();r&&this.engineInstance?.hideModels(r),this.rightKey?.hide()}}),n.push({id:"transparentSelected",label:"menu.transparentSelected",group:"component",order:3,onClick:()=>{const r=this.engineInstance?.getHighlightModels();r&&this.engineInstance?.translucentModels(r),this.rightKey?.hide()}}),n.push({id:"cancelTranslucent",label:"menu.cancelTranslucent",group:"component",order:4,onClick:()=>{this.engineInstance?.unTranslucentModel(),this.rightKey?.hide()}}),n.push({id:"isolateSelected",label:"menu.isolateSelected",group:"component",order:5,divider:!0,children:[{id:"hideOthers",label:"menu.hideOthers",onClick:()=>{const r=this.engineInstance?.getHighlightModels();r&&this.engineInstance?.isolateModels(r),this.rightKey?.hide()}},{id:"transparentOthers",label:"menu.transparentOthers",onClick:()=>{const r=this.engineInstance?.getHighlightModels();r&&this.engineInstance?.translucentOtherModels(r),this.rightKey?.hide()}}]}),n.push({id:"quickSelect",label:"menu.quickSelect",group:"component",order:6,children:[{id:"selectSameType",label:"menu.selectSameType",onClick:()=>{const r=this.engineInstance?.getHighlightModels();r&&this.engineInstance?.batchSelectSameTypeModel(r),this.rightKey?.hide()}},{id:"selectSameLevel",label:"menu.selectSameLevel",onClick:()=>{const r=this.engineInstance?.getHighlightModels();r&&this.engineInstance?.batchSelectSameLevelModel(r),this.rightKey?.hide()}},{id:"selectSameLevelType",label:"menu.selectSameLevelType",onClick:()=>{const r=this.engineInstance?.getHighlightModels();r&&this.engineInstance?.batchSelectSameLevelTypeModel(r),this.rightKey?.hide()}}]}),n.push({id:"fitSectionBox",label:"menu.fitSectionBox",group:"component",order:7,onClick:()=>{this.engineInstance?.fitSectionBoxToModel(),this.rightKey?.hide()}})),n.push({id:"showAll",label:"menu.showAll",group:"component",order:8,onClick:()=>{this.engineInstance?.showAllModels(),this.emit("menu:show-all",{}),this.rightKey?.hide()}}),n}),this.engineInstance.isInitialized()}catch(t){return console.error("[EngineManager] Failed to initialize 3D engine:",t),this.engineInstance=null,!1}}isInitialized(){return this.engineInstance!==null&&this.engineInstance.isInitialized()}loadModel(e,t){if(!this.engineInstance){console.warn("[EngineManager] 3D Engine not initialized.");return}this.engineInstance.loadModel(e,t)}pauseRendering(){if(!this.engineInstance){console.warn("[EngineManager] 3D Engine not initialized.");return}this.engineInstance.pauseRendering()}resumeRendering(){if(!this.engineInstance){console.warn("[EngineManager] 3D Engine not initialized.");return}this.engineInstance.resumeRendering()}getModelPosition(e){return this.engineInstance?this.engineInstance.getModelPosition(e):(console.warn("[EngineManager] 3D Engine not initialized."),null)}jumpToCamera(e){return this.engineInstance?this.engineInstance.jumpToCamera(e):(console.warn("[EngineManager] 3D Engine not initialized."),!1)}destroy(){this.engineInstance&&(this.engineInstance.destroy(),this.engineInstance=null),this.rightKey&&(this.rightKey.destroy(),this.rightKey=null),super.destroy()}}const T2={测量:'<svg width="48" height="48" viewBox="0 0 48 48"><path fill="currentColor" d="M0,28.207H3.429v3.526H44.571V28.207H48v7.052H0ZM0,3.526v14.1a3.478,3.478,0,0,0,3.429,3.526H6.857V17.629h3.429v3.526h3.429V17.629h3.429v3.526h3.429V10.578H24V21.155h3.429V17.629h3.429v3.526h3.429V17.629h3.429v3.526h3.429V10.578h3.429V21.155A3.478,3.478,0,0,0,48,17.629V3.526A3.478,3.478,0,0,0,44.571,0H3.429A3.478,3.478,0,0,0,0,3.526Z" transform="translate(0 5.456)"/></svg>',地图:'<svg width="48" height="48" viewBox="0 0 48 48"><path fill="currentColor" d="M32.984,563.2H26.329a66.982,66.982,0,0,1-5.471,7.121l-1.455,1.61-1.455-1.61a66.978,66.978,0,0,1-5.471-7.121H5.821L0,580.662H38.8Z" transform="translate(4.598 -537.259)"/><path fill="currentColor" d="M275.4,9.7a9.7,9.7,0,1,0-19.4,0c0,6.636,9.7,17.462,9.7,17.462S275.4,16.337,275.4,9.7Zm-13.582,0a3.88,3.88,0,1,1,3.88,3.88,3.88,3.88,0,0,1-3.88-3.88Z" transform="translate(-241.701 4.598)"/></svg>',框选放大:'<svg width="48" height="48" viewBox="0 0 48 48"><path fill="currentColor" d="M336.351,336.158l-5.5.037-.037-5.5-3.665.025.037,5.5-5.491.037.025,3.665,5.491-.037.041,5.491,3.661-.025-.037-5.491,5.5-.041Z" transform="translate(-305.467 -314.477)"/><path fill="currentColor" d="M41.88,40.861l-.227-.223-7.167-7.068a14.787,14.787,0,1,0-2.832,2.4l7.4,7.3.227.223.021-.021a1.821,1.821,0,0,0,1.065.33,1.849,1.849,0,0,0,1.837-1.862,1.868,1.868,0,0,0-.343-1.061l.017-.021ZM23.648,34.668A11.1,11.1,0,1,1,34.675,23.487,11.106,11.106,0,0,1,23.648,34.668ZM3,41.492H6.241v3.241H3ZM3,15.564H6.241v3.241H3ZM3,2.6H6.241V5.841H3Zm12.964,0h3.241V5.841H15.964Zm-6.482,0h3.241V5.841H9.482Zm12.964,0h3.241V5.841H22.446Zm6.482,0h3.241V5.841H28.928Zm6.482,0h3.241V5.841H35.41Zm6.482,0h3.241V5.841H41.892Zm0,6.482h3.241v3.241H41.892Zm0,6.482h3.241v3.241H41.892Zm0,6.482h3.241v3.241H41.892ZM9.482,41.492h3.241v3.241H9.482Zm6.482,0h3.241v3.241H15.964Zm6.482,0h3.241v3.241H22.446ZM3,9.082H6.241v3.241H3ZM3,22.046H6.241v3.241H3Zm38.892,6.482h3.241v3.241H41.892ZM3,28.528H6.241v3.241H3ZM3,35.01H6.241v3.241H3Z" transform="translate(-0.067 0.333)"/></svg>',漫游:'<svg width="48" height="48" viewBox="0 0 48 48"><path fill="currentColor" d="M327.239,38.548a6.01,6.01,0,1,0-6.358-6A6.144,6.144,0,0,0,327.239,38.548Zm8.006,5.76a3.082,3.082,0,0,0-3.061-2.64h-1.648c-.471,0-.706.24-1.177.48l-2.119,1.68-2.119-1.92a1.781,1.781,0,0,0-1.177-.48h-1.648a2.914,2.914,0,0,0-3.061,2.64l-1.413,10.8c0,.48,0,.96.471,1.2a1.781,1.781,0,0,0,1.177.48h1.648l1.413,15.36a3.082,3.082,0,0,0,3.061,2.64h3.532a2.914,2.914,0,0,0,3.061-2.64l1.413-15.36h1.648a1.781,1.781,0,0,0,1.177-.48,2.2,2.2,0,0,0,.235-1.2Z" transform="translate(-303.239 -26.548)"/></svg>',目录树:'<svg width="48" height="48" viewBox="0 0 48 48"><path fill="currentColor" d="M116.8,153.474h12a1.2,1.2,0,0,0,1.2-1.185v-7.111a1.2,1.2,0,0,0-1.2-1.184h-12a1.2,1.2,0,0,0-1.2,1.184v1.629H93.553v-7.554H100a1.2,1.2,0,0,0,1.2-1.185v-7.112a1.2,1.2,0,0,0-1.2-1.185H83.2a1.2,1.2,0,0,0-1.2,1.185v7.112a1.2,1.2,0,0,0,1.2,1.185h6.45v28a2.383,2.383,0,0,0,2.4,2.37H115.6v1.63a1.2,1.2,0,0,0,1.2,1.185h12a1.2,1.2,0,0,0,1.2-1.185v-7.112a1.2,1.2,0,0,0-1.2-1.185h-12a1.2,1.2,0,0,0-1.2,1.185v1.63H93.553V150.657H115.6v1.629a1.2,1.2,0,0,0,1.2,1.185Z" transform="translate(-82 -126.874)"/></svg>',剖切:'<svg xmlns="http://www.w3.org/2000/svg" width="48" height="48" viewBox="0 0 48 48" fill="currentColor"><g transform="translate(-176.967 -101.068)"><path d="M306.33,364.55h14.737v19.115H306.33Z" transform="translate(-118.068 -248.554)"/><path d="M487.114,140.356a1.6,1.6,0,0,1-1.744-1.393V99.573a1.787,1.787,0,0,1,3.487,0v39.389A1.6,1.6,0,0,1,487.114,140.356Z" transform="translate(-285.677 6.11)"/><path d="M508.34,274.031H487.114a1.743,1.743,0,1,1,0-3.487h17.739V242.767H487.114a1.744,1.744,0,1,1,0-3.487H508.34Z" transform="translate(-285.677 -131.282)"/><path d="M201.437,274.031h-3.278a1.743,1.743,0,1,1,0-3.487h3.278a1.743,1.743,0,1,1,0,3.487Zm-8.858,0H187a1.743,1.743,0,1,1,0-3.487h5.579a1.743,1.743,0,1,1,0,3.487Zm-10.626-.532a1.743,1.743,0,0,1-1.743-1.744v-5.579a1.743,1.743,0,1,1,3.487,0v5.579A1.743,1.743,0,0,1,181.953,273.5Zm0-11.159a1.743,1.743,0,0,1-1.743-1.743v-5.579a1.743,1.743,0,1,1,3.487,0V260.6A1.743,1.743,0,0,1,181.953,262.34Zm0-11.158a1.744,1.744,0,0,1-1.743-1.744v-5.579a1.743,1.743,0,1,1,3.487,0v5.579A1.744,1.744,0,0,1,181.953,251.181Zm19.484-8.414h-5.579a1.744,1.744,0,1,1,0-3.487h5.579a1.744,1.744,0,0,1,0,3.487Zm-11.159,0H184.7a1.744,1.744,0,1,1,0-3.487h5.579a1.744,1.744,0,1,1,0,3.487Z" transform="translate(0 -131.282)"/></g></svg>',剖切盒:'<svg width="48" height="48" viewBox="0 0 48 48" fill="currentColor"><g transform="translate(-56.83 2.793)"><path d="M194.963,19.168a1.69,1.69,0,0,1-.607-.119l-19.027-8.292a1.253,1.253,0,0,1,0-2.35L191.289.112a1.592,1.592,0,0,1,1.24,0l18.663,8.294a1.267,1.267,0,0,1,.791,1.175,1.308,1.308,0,0,1-.791,1.175l-15.6,8.278a1.519,1.519,0,0,1-.633.143Zm-15.7-9.586,15.7,6.832,12.331-6.832L191.9,2.749Z" transform="translate(-109.947 0)"/><path d="M195.008,417.821a1.691,1.691,0,0,1-.607-.119l-19.025-8.294a1.253,1.253,0,0,1,0-2.35l15.958-8.294a1.592,1.592,0,0,1,1.24,0l18.657,8.294a1.267,1.267,0,0,1,.791,1.175,1.308,1.308,0,0,1-.791,1.175l-15.6,8.278c-.211.095-3.483.143-3.694.143Zm-15.6-9.588,15.6,6.832,12.329-6.832L191.948,401.4Z" transform="translate(-109.992 -382.638)"/><path d="M200.046,603.93a1.976,1.976,0,0,1-.634-.119l-18.774-8.3a1.257,1.257,0,0,1-.655-1.754,1.512,1.512,0,0,1,1.931-.595l18.131,8.013,14.971-8.007a1.51,1.51,0,0,1,1.928.6,1.256,1.256,0,0,1-.661,1.75l-15.6,8.282a1.489,1.489,0,0,1-.634.119Z" transform="translate(-115.041 -568.787)"/><path d="M101.029,216.82a1.467,1.467,0,0,1-1-.377,1.237,1.237,0,0,1-.41-.917V198.817a1.413,1.413,0,0,1,2.816,0V215.5a1.241,1.241,0,0,1-.4.931A1.472,1.472,0,0,1,101.029,216.82Zm-34.377.143a1.467,1.467,0,0,1-1-.377,1.237,1.237,0,0,1-.41-.917V198.817a1.413,1.413,0,0,1,2.816,0v16.852a1.237,1.237,0,0,1-.41.917A1.467,1.467,0,0,1,66.652,216.964Zm-5.215,2.8a1.467,1.467,0,0,1-1-.377,1.237,1.237,0,0,1-.41-.917V201.621a1.413,1.413,0,0,1,2.816,0v16.852a1.237,1.237,0,0,1-.41.917A1.467,1.467,0,0,1,61.436,219.768Z" transform="translate(-0.4 -189.683)"/><path d="M60.922,37.617A1.32,1.32,0,0,1,60,37.258a1.2,1.2,0,0,1-.378-.876V20.295a1.3,1.3,0,0,1,2.588,0V36.382a1.276,1.276,0,0,1-1.294,1.235Zm-1.175,8.411a1.341,1.341,0,0,1,1.75-.578l15.126,7.071a1.224,1.224,0,0,1,.6,1.671,1.337,1.337,0,0,1-1.75.572L60.347,47.708a1.228,1.228,0,0,1-.606-1.671Z" transform="translate(0 -18.25)"/><path d="M71.756,44.947a1.337,1.337,0,0,1,1.75-.582l15.126,7.118a1.235,1.235,0,0,1,.6,1.682,1.333,1.333,0,0,1-1.75.576L72.356,46.629a1.239,1.239,0,0,1-.606-1.682ZM59.915,12.652a1.337,1.337,0,0,1,1.75-.582L76.79,19.194a1.235,1.235,0,0,1,.6,1.682,1.333,1.333,0,0,1-1.75.576L60.515,14.334A1.247,1.247,0,0,1,59.915,12.652Z" transform="translate(-0.168 -11.442)"/><path d="M334.418,146.671a1.341,1.341,0,0,1,1.75-.578l15.126,7.073a1.224,1.224,0,0,1,.6,1.671,1.337,1.337,0,0,1-1.75.573l-15.126-7.09a1.25,1.25,0,0,1-.663-.7,1.177,1.177,0,0,1,.058-.945Zm16.3,35.276a1.32,1.32,0,0,1-.917-.36,1.2,1.2,0,0,1-.377-.875v-16.1a1.3,1.3,0,0,1,2.588,0V180.7a1.2,1.2,0,0,1-.38.878,1.321,1.321,0,0,1-.922.357Z" transform="translate(-260.918 -139.687)"/><path d="M576.438,360.4a1.288,1.288,0,0,1-1.294-1.294V342.253a1.294,1.294,0,1,1,2.588,0v16.852A1.3,1.3,0,0,1,576.438,360.4ZM572.8,344.248,573,361.1l-2.613.024-.2-16.857Z" transform="translate(-486.154 -327.316)"/><path d="M508.543,26.833l.192,16.852-2.613.024-.192-16.852Z" transform="translate(-425.253 -25.689)"/></g></svg>',全屏:'<svg width="48" height="48" viewBox="0 0 48 48"><path fill="currentColor" d="M6.241,3.671H12.85a1.734,1.734,0,0,0,1.836-1.836A1.734,1.734,0,0,0,12.85,0H1.469C1.1,0,.734.367.367.734A1.349,1.349,0,0,0,0,1.836V12.85a1.734,1.734,0,0,0,1.836,1.836A1.734,1.734,0,0,0,3.671,12.85V6.241l9.913,9.913a1.817,1.817,0,1,0,2.57-2.57ZM13.584,27.9,6.975,34.51l-3.3,3.3V31.206a1.734,1.734,0,0,0-1.836-1.836A1.734,1.734,0,0,0,0,31.206V42.22a1.734,1.734,0,0,0,1.836,1.836H12.85a1.836,1.836,0,0,0,0-3.671H6.241l3.3-3.3,6.608-6.608a1.817,1.817,0,1,0-2.57-2.57ZM42.22,29.371a1.734,1.734,0,0,0-1.836,1.836v6.608l-3.3-3.3L30.472,27.9a1.817,1.817,0,1,0-2.57,2.57L34.51,37.08l3.3,3.3H31.206a1.836,1.836,0,1,0,0,3.671H42.22a1.734,1.734,0,0,0,1.836-1.836V31.206a1.734,1.734,0,0,0-1.836-1.836ZM42.22,0H31.206a1.734,1.734,0,0,0-1.836,1.836,1.734,1.734,0,0,0,1.836,1.836h6.608l-3.3,3.3L27.9,13.584a1.817,1.817,0,1,0,2.57,2.57L37.08,9.545l3.3-3.3V12.85a1.836,1.836,0,0,0,3.671,0V1.836A1.734,1.734,0,0,0,42.22,0Z" transform="translate(1.972 1.972)"/></svg>',设置:'<svg width="48" height="48" viewBox="0 0 48 48"><path fill="currentColor" d="M112.388,106.443l-2.668-.373a1.687,1.687,0,0,1-1.306-1.031,16.337,16.337,0,0,0-2-3.475,1.681,1.681,0,0,1-.243-1.646l1.012-2.5a1.652,1.652,0,0,0-.709-2.057l-5.769-3.335a1.654,1.654,0,0,0-2.136.415L96.919,94.56a1.693,1.693,0,0,1-1.562.62,15.32,15.32,0,0,0-3.992,0,1.693,1.693,0,0,1-1.562-.62l-1.651-2.113a1.654,1.654,0,0,0-2.136-.415l-5.769,3.33a1.659,1.659,0,0,0-.709,2.057l1.012,2.5a1.679,1.679,0,0,1-.243,1.646,16.141,16.141,0,0,0-2,3.475A1.669,1.669,0,0,1,77,106.066l-2.668.373a1.663,1.663,0,0,0-1.432,1.646v6.665a1.662,1.662,0,0,0,1.427,1.642l2.668.373a1.687,1.687,0,0,1,1.306,1.031,16.338,16.338,0,0,0,2,3.475,1.681,1.681,0,0,1,.243,1.646l-1.012,2.5a1.652,1.652,0,0,0,.709,2.057l5.769,3.33a1.654,1.654,0,0,0,2.136-.415L89.8,128.27a1.693,1.693,0,0,1,1.562-.62,15.321,15.321,0,0,0,3.992,0,1.693,1.693,0,0,1,1.562.62l1.651,2.113a1.654,1.654,0,0,0,2.136.415l5.769-3.33a1.659,1.659,0,0,0,.709-2.057l-1.012-2.5a1.681,1.681,0,0,1,.243-1.646,16.141,16.141,0,0,0,2-3.475,1.669,1.669,0,0,1,1.306-1.031l2.668-.373a1.658,1.658,0,0,0,1.427-1.642v-6.665A1.639,1.639,0,0,0,112.388,106.443ZM93.36,117.893a6.478,6.478,0,1,1,6.478-6.478A6.479,6.479,0,0,1,93.36,117.893Z" transform="translate(-69.355 -87.415)"/></svg>',拾曲面剖切:'<svg xmlns="http://www.w3.org/2000/svg" width="48" height="48" viewBox="0 0 48 48" fill="currentColor"><g transform="translate(-59.63 -21.333)"><path d="M302.465,495.393l2.363-4.363a.842.842,0,0,1,1.091-.273.914.914,0,0,1,.454,1l-1.636,3,11.453-3.454c.091,0,.091,0,.182-.091a.785.785,0,1,1,.273,1.545l-11.453,3.454,3,1.545h.091a.645.645,0,0,1,.182,1,.842.842,0,0,1-1.091.273l-4.545-2.363c-.091,0-.182-.091-.273-.182A.742.742,0,0,1,302.465,495.393Z" transform="translate(205.84 -520.136) rotate(43)"/><path d="M88.23,54.014v2.86l-21.123,8.17V34l21.123-8.17V47.069h2.9l-.207-25.736L64,31.75V69.333L91.129,58.916v-4.9Z"/><path d="M199,255.9l-15.532,6.268v-21.23L199,234.667Z" transform="translate(-113.668 -202.979)"/></g></svg>',轴向剖切:'<svg xmlns="http://www.w3.org/2000/svg" width="48" height="48" viewBox="0 0 48 48" fill="currentColor"><g transform="translate(-59.63 -21.333)"><path d="M.194,3.727,2.558,8.089a.842.842,0,0,0,1.091.273.914.914,0,0,0,.454-1l-1.636-3L13.919,7.817c.091,0,.091,0,.182.091a.785.785,0,1,0,.273-1.545L2.921,2.909l3-1.545h.091a.645.645,0,0,0,.182-1A.842.842,0,0,0,5.1.091L.558,2.454c-.091,0-.182.091-.273.182A.742.742,0,0,0,.194,3.727Z" transform="translate(102.244 57.563) rotate(-178)"/><path d="M88.23,54.014v2.86l-21.123,8.17V34l21.123-8.17V47.069h2.9l-.207-25.736L64,31.75V69.333L91.129,58.916v-4.9Z"/><path d="M199,255.9l-15.532,6.268v-21.23L199,234.667Z" transform="translate(-113.668 -202.979)"/></g></svg>',主视角:'<svg width="48" height="48" viewBox="0 0 48 48"><path fill="currentColor" d="M122.32,181.835v-13.16h-9.87V163.74h19.74v18.095Zm-19.74,0V163.74h9.87v18.095ZM96,163.74,117.385,144l21.385,19.74Z" transform="translate(-93.385 -138.917)"/></svg>',文档:'<svg width="48" height="48" viewBox="0 0 48 48"><path fill="currentColor" d="M64,128h1.714v41.143H64Zm46.286,0H112v41.143h-1.714Zm-44.571,0h44.571v3.429H65.714Zm0,6.857h44.571v3.429H65.714Zm0-3.429h3.429v3.429H65.714Zm8.571,0h3.429v3.429H74.286Zm8.571,0h27.429v3.429H82.857Zm-17.143,36h44.571v1.714H65.714Zm5.143-24H76v1.714H70.857Zm10.286,0h24v1.714h-24Zm-10.286,6.857H76V152H70.857Zm10.286,0h24V152h-24Zm-10.286,6.857H76v1.714H70.857Zm10.286,0h24v1.714h-24Z" transform="translate(-64 -124.571)"/></svg>',第一人称漫游:'<svg xmlns="http://www.w3.org/2000/svg" width="48" height="48" viewBox="0 0 48 48" fill="currentColor"><path d="M178.325,132.27a6.411,6.411,0,0,0,0-9.429,7.359,7.359,0,0,0-9.984,0,6.411,6.411,0,0,0,0,9.429,7.359,7.359,0,0,0,9.984,0Zm-2-7.543a3.845,3.845,0,0,1,0,5.657,4.414,4.414,0,0,1-5.99,0,3.847,3.847,0,0,1,0-5.657,4.414,4.414,0,0,1,5.99,0Zm6.618,31.639q4.975,1.006,4.975,3.189t-4.975,3.189a57.4,57.4,0,0,1-19.226,0q-4.973-1.006-4.973-3.189t4.975-3.189q.777-.156,1.613-.284v-2.521a4.488,4.488,0,0,1-1.412.217,4.761,4.761,0,0,1-.587-.036l-.038,0a29.007,29.007,0,0,0-7.657,2.332q-3.482,1.712-3.482,3.484a2.944,2.944,0,0,0,1.3,2.116,14.359,14.359,0,0,0,4.4,2.293,46.614,46.614,0,0,0,15.477,2.258,46.614,46.614,0,0,0,15.477-2.258,14.362,14.362,0,0,0,4.4-2.293,2.943,2.943,0,0,0,1.3-2.116q0-1.772-3.482-3.484a29.007,29.007,0,0,0-7.657-2.332,4.908,4.908,0,0,1-.625.039,4.488,4.488,0,0,1-1.412-.217v2.521q.836.128,1.613.284Zm-14.788-6.588v5.979q2.391-.2,5.176-.2t5.176.2v-12.2h2.824v6.222a1.25,1.25,0,0,0,.414.942v0l.081.071q.744.1,1.457.22a1.41,1.41,0,0,0,.457-.293,1.25,1.25,0,0,0,.414-.942v-8a3.75,3.75,0,0,0-1.24-2.828,4.2,4.2,0,0,0-2.995-1.172H166.745a4.2,4.2,0,0,0-2.995,1.172,3.75,3.75,0,0,0-1.24,2.828v8a1.268,1.268,0,0,0,.414.942,1.415,1.415,0,0,0,.456.293q.715-.119,1.459-.222.041-.034.081-.071a1.25,1.25,0,0,0,.414-.942v-6.222h2.824Zm-8.471-6.222v-1.778a6.253,6.253,0,0,1,2.067-4.715,7.013,7.013,0,0,1,4.992-1.952h13.176a7.013,7.013,0,0,1,4.992,1.952,6.253,6.253,0,0,1,2.067,4.715v8a3.722,3.722,0,0,1-.484,1.881l0,.005a28.526,28.526,0,0,1,5.841,2.041q5,2.462,5,5.851,0,4.238-7.531,6.9a49.5,49.5,0,0,1-16.469,2.428,49.5,49.5,0,0,1-16.469-2.428q-7.531-2.667-7.531-6.9,0-3.388,5-5.849a28.381,28.381,0,0,1,5.841-2.044,3.707,3.707,0,0,1-.488-1.884Zm24.8,16a13.145,13.145,0,0,0-2.129-.581,54.5,54.5,0,0,0-18.044,0,13.079,13.079,0,0,0-2.127.581,13.078,13.078,0,0,0,2.127.581,54.5,54.5,0,0,0,18.044,0,13.078,13.078,0,0,0,2.127-.581Z" transform="translate(-149.333 -120.889)"/></svg>',反向:'<svg xmlns="http://www.w3.org/2000/svg" width="48" height="48" viewBox="0 0 48 48" fill="currentColor"><g transform="translate(0.364 4.658)"><path d="M0,287.1m0-.817v-2.042a.722.722,0,0,1,.817-.817H44.509a.722.722,0,0,1,.817.817v2.042a.722.722,0,0,1-.817.817H.817A.722.722,0,0,1,0,286.28Z" transform="translate(-0.001 -272.164)"/><path d="M829.7,13.238l-1.443,1.444a.817.817,0,0,1-1.155,0L815.263,2.844a.817.817,0,0,1,0-1.156L816.706.244a.817.817,0,0,1,1.155,0L829.7,12.083a.817.817,0,0,1,0,1.155Z" transform="translate(-782.667)"/><path d="M94.367,648m0,.817v2.042a.722.722,0,0,1-.817.817H49.858a.722.722,0,0,1-.817-.817v-2.042a.722.722,0,0,1,.817-.817H93.55A.722.722,0,0,1,94.367,648.816Z" transform="translate(-47.095 -622.268)"/><path d="M.239,649.97l1.443-1.444a.817.817,0,0,1,1.155,0l11.838,11.838a.817.817,0,0,1,0,1.156l-1.443,1.443a.817.817,0,0,1-1.155,0L.239,651.124a.817.817,0,0,1,0-1.155Z" transform="translate(0 -622.544)"/></g></svg>',路径漫游:'<svg xmlns="http://www.w3.org/2000/svg" width="48" height="48" viewBox="0 0 48 48" fill="currentColor"><g transform="translate(0 -4.9)"><path d="M43.755,35.8a23.352,23.352,0,0,1-8.074-3.095c-1.131-.912-2.263-1.819-2.263-3.458,0-.364-.164-.548-.486-.548-1.776-.364-2.263,0-1.935,2.183a5,5,0,0,0,1.776,3.095,14.337,14.337,0,0,0,4.521,2.551c2.1.912,4.521,1.276,6.461,2.551,1.935,1.091,2.1,2.551.809,4.37A12.572,12.572,0,0,1,37.3,48.187a30.594,30.594,0,0,1-17.115-1.455c-2.585-.912-4.2-.364-5.488,2,0,.184-.164.184-.323.548,2.1.728,3.876,1.455,5.811,2,5.811,1.639,11.786,2.367,17.76.548A14.453,14.453,0,0,0,46.663,45.1c2.422-4.2,1.613-8.381-2.908-9.293Zm-19.7-7.97a11.943,11.943,0,0,0-7.382-10.952A12.17,12.17,0,0,0,3.457,19.546a10.951,10.951,0,0,0-2.3,12.879c2.459,5.329,6.456,9.77,10.453,14.06.463.444.617.444,1.075,0,3.689-4.143,7.382-8.287,10-13.172A11.6,11.6,0,0,0,24.059,27.833Zm-4.151,3.255c-1.692,3.851-4.614,6.955-7.382,10.215-.463.444-.617.3-.921,0A44.891,44.891,0,0,1,4.228,31.088a7.684,7.684,0,0,1-.767-3.109A8.664,8.664,0,0,1,18.22,21.909a8.155,8.155,0,0,1,1.688,9.18ZM33.007,4.9c-5.685,0-9.785,6.416-7.274,11.76,1.454,3.34,4.1,5.745,6.746,8.15a.492.492,0,0,0,.795,0c2.908-2.537,5.554-5.211,7.008-8.821A8.117,8.117,0,0,0,33.007,4.9Zm4.366,10.422A16.825,16.825,0,0,1,33.4,20c-.4.269-.659.269-.926,0a16.342,16.342,0,0,1-3.969-4.545,5.033,5.033,0,1,1,8.864-.132Z"/><path d="M183.031,141.935a2.136,2.136,0,0,0,2.053-2.18,2.084,2.084,0,0,0-2.18-2.18,2.171,2.171,0,0,0-2.053,2.307A2.058,2.058,0,0,0,183.031,141.935Zm-20.094,7.854a4.7,4.7,0,0,0-4.6,4.881,4.913,4.913,0,0,0,4.74,4.881,4.882,4.882,0,0,0-.14-9.762Zm0,6.417a1.77,1.77,0,0,1-1.532-1.532A1.79,1.79,0,0,1,162.937,153a1.611,1.611,0,0,1,1.672,1.672A1.578,1.578,0,0,1,162.937,156.206Z" transform="translate(-150.629 -126.653)"/></g></svg>',适应到模型:'<svg xmlns="http://www.w3.org/2000/svg" width="48" height="48" viewBox="0 0 48 48" fill="currentColor"><g transform="translate(-84.667 -84.667)"><path d="M87.667,97V87.667H97V85.333H86.733a1.4,1.4,0,0,0-1.4,1.4V97Zm0,23.333H85.333V130.6a1.4,1.4,0,0,0,1.4,1.4H97v-2.333H87.667v-9.333Zm32.667,9.333V132H130.6a1.4,1.4,0,0,0,1.4-1.4V120.333h-2.333v9.333h-9.333ZM129.667,97H132V86.733a1.4,1.4,0,0,0-1.4-1.4H120.333v2.333h9.333Z"/><path d="M270.857,243.5l11.3-6.652V223.387l-11.3,6.361V243.5Zm-1.8,0v-13.75l-11.3-6.361v13.456l11.3,6.652Zm-10.278-21.621,11.177,6.284,11.177-6.284L269.958,215.3l-11.177,6.573Zm11.622-8.426,13.1,7.709a.919.919,0,0,1,.448.793v15.419a.926.926,0,0,1-.448.793l-13.1,7.709a.887.887,0,0,1-.9,0l-13.1-7.709a.905.905,0,0,1-.448-.793V221.954a.919.919,0,0,1,.448-.793l13.1-7.709A.887.887,0,0,1,270.4,213.452Z" transform="translate(-161.292 -120.997)"/></g></svg>',隐藏:'<svg xmlns="http://www.w3.org/2000/svg" width="48" height="48" viewBox="0 0 48 48" fill="currentColor"><path d="M61.274,76.178l0-.007-.007,0a32.458,32.458,0,0,0-7.014-9.981L51.53,68.91a28.382,28.382,0,0,1,6.124,8.635c-4.472,9.25-10.809,13.636-19.472,13.636A20.615,20.615,0,0,1,30.6,89.838l-2.937,2.933a23.916,23.916,0,0,0,10.514,2.277q15.472,0,23.088-16.116a3.229,3.229,0,0,0,0-2.755ZM57.839,58.351l-2.274-2.277a.429.429,0,0,0-.608,0l-6.265,6.262a23.775,23.775,0,0,0-10.51-2.281q-15.472,0-23.088,16.116v.007a3.236,3.236,0,0,0,0,2.765,32.617,32.617,0,0,0,7.014,9.985L16.7,94.32a.429.429,0,0,0,0,.608l2.274,2.277a.429.429,0,0,0,.608,0L57.839,58.949a.426.426,0,0,0,0-.6ZM32.113,78.915a6.011,6.011,0,0,1,7.22-7.22l-7.223,7.22Zm9.9-9.9A9.452,9.452,0,0,0,29.43,81.6l-4.6,4.6a28.424,28.424,0,0,1-6.124-8.635c4.475-9.25,10.816-13.636,19.472-13.636a20.615,20.615,0,0,1,7.577,1.343Zm-4.046,14.55a5.752,5.752,0,0,1-1.01-.086l-2.744,2.741A9.446,9.446,0,0,0,46.638,73.794L43.9,76.538a6.018,6.018,0,0,1-5.932,7.024Z" transform="translate(-14.182 -52.64)"/></svg>',重置:'<svg xmlns="http://www.w3.org/2000/svg" width="48" height="48" viewBox="0 0 48 48" fill="currentColor"><path d="M32.936,32.658a15.914,15.914,0,0,1-9.6,3.064c-.451-.006-.9-.042-1.342-.077-.182-.018-.357-.047-.539-.077-.352-.047-.7-.089-1.037-.164-.211-.036-.422-.1-.621-.148-.334-.077-.668-.154-.99-.254-.153-.059-.3-.11-.457-.177-.381-.124-.755-.26-1.113-.414-.082-.036-.162-.071-.24-.1-.422-.2-.844-.408-1.248-.627-.017-.012-.035-.018-.054-.03a16.485,16.485,0,0,1-3.732-2.9c-.017-.018-.035-.042-.054-.059-.34-.355-.668-.721-.979-1.118-.065-.083-.123-.16-.194-.254A17.286,17.286,0,0,1,7.149,18.751h3.98L6.318,9.076,0,18.874H3.942a20.809,20.809,0,0,0,3.5,11.57.871.871,0,0,0,.075.14c.225.34.486.648.724.961.1.113.177.232.274.362.354.443.746.869,1.133,1.285.043.043.075.076.108.113a19.778,19.778,0,0,0,4.436,3.446c.043.027.08.043.128.076.467.259.949.5,1.432.719.124.055.242.113.359.164.419.184.847.335,1.277.493.2.076.4.14.611.21.378.113.762.21,1.153.3.257.065.509.129.772.184a2.252,2.252,0,0,0,.316.076c.37.07.735.1,1.1.151.134.027.27.049.4.065.66.065,1.314.11,1.974.11,4.006,0,8.852-1.3,11.85-4.177a1.908,1.908,0,0,0,.333-2.484,2.228,2.228,0,0,0-2.952.023ZM44.053,20.424a20.728,20.728,0,0,0-3.47-11.537c-.032-.055-.054-.113-.08-.164-.284-.405-.574-.778-.869-1.161a1.289,1.289,0,0,1-.1-.14A19.86,19.86,0,0,0,32.168,1.7c-.086-.032-.155-.076-.242-.11-.456-.195-.922-.362-1.394-.53C30.37,1,30.2.937,30.033.883,29.62.754,29.212.651,28.792.548c-.231-.055-.467-.113-.7-.164-.113-.022-.22-.055-.338-.081-.311-.055-.617-.081-.933-.124C26.6.151,26.392.119,26.18.1,25.655.042,25.135.021,24.616.016c-.1,0-.188-.016-.284-.016-.016,0-.032.005-.049.005A19.124,19.124,0,0,0,13.02,3.695a1.682,1.682,0,0,0-.466,2.515,1.777,1.777,0,0,0,2.309.3A15.251,15.251,0,0,1,24.374,3.45c.486.006.971.03,1.441.077.147.012.287.036.432.059a11.3,11.3,0,0,1,1.16.189c.162.03.334.077.493.11.381.089.744.178,1.107.3a2.577,2.577,0,0,1,.34.124c.422.142.832.29,1.23.467.047.012.082.047.123.059a16.492,16.492,0,0,1,6.182,4.8.367.367,0,0,0,.024.036A17.308,17.308,0,0,1,40.629,20.43H36.645l5.048,9.787L48,20.424Zm0,0" transform="translate(0 4.349)"/></svg>',标高:'<svg width="32" height="32" viewBox="0 0 32 32"><path fill="currentColor" d="M84.131,193.119a1.056,1.056,0,0,1,1.116.982v7.857a1.056,1.056,0,0,1-1.116.982H54.367a1.056,1.056,0,0,1-1.116-.982V194.1a1.056,1.056,0,0,1,1.116-.982Zm-1.116,1.964H55.483v5.893H83.015Zm1.116-13.749a1.064,1.064,0,0,1,1.114.935,1.032,1.032,0,0,1-1.007,1.025l-.107,0H71.2l-7.858,6.914a1.227,1.227,0,0,1-1.578,0l-8.185-7.2-.018-.016-.032-.031.049.047a1.107,1.107,0,0,1-.092-.092l-.011-.014a.869.869,0,0,1-.182-.857l0-.008L53.31,182l.012-.029.02-.045.019-.035a1.1,1.1,0,0,1,.891-.552h.007q.053,0,.107,0ZM68.043,183.3H57.06l5.492,4.831Z" transform="translate(-53.247 -176.136)"/></svg>',距离:'<svg width="32" height="32" viewBox="0 0 32 32"><path fill="currentColor" d="M29.692,3.03,27.55.919a.529.529,0,0,1-.014-.756A.549.549,0,0,1,28.3.15l.014.013,3.067,3.023a.529.529,0,0,1,0,.756L28.317,6.966a.549.549,0,0,1-.767.013.529.529,0,0,1-.014-.756l.014-.013L29.692,4.1H2.31L4.452,6.21a.528.528,0,0,1,.013.756.547.547,0,0,1-.766.013l-.014-.013L.616,3.942a.531.531,0,0,1,0-.756L3.685.163a.548.548,0,0,1,.767.014.528.528,0,0,1,0,.742L2.31,3.03ZM24.136,15.055H23.051V18H21.966v-2.94H20.882V18H19.8v-2.94H18.712V18H17.627v-2.94H16.543v5.078H15.458V15.055H14.373V18H13.288v-2.94H12.2V18H11.119v-2.94H10.034V18H8.949v-2.94H7.865V18H6.78v-2.94H5.7v5.078H4.61V15.055H1.9a.27.27,0,0,0-.272.268v6.413A.269.269,0,0,0,1.9,22H30.1a.268.268,0,0,0,.271-.267V15.323a.269.269,0,0,0-.271-.268H27.39v5.078H26.305V15.055H25.221V18H24.136Zm5.966-1.6A1.884,1.884,0,0,1,32,15.323v6.413a1.885,1.885,0,0,1-1.9,1.871H1.9A1.885,1.885,0,0,1,0,21.736V15.323a1.885,1.885,0,0,1,1.9-1.871Z" transform="translate(0 4.197)"/></svg>',最小距离:'<svg width="32" height="32" viewBox="0 0 32 32"><path fill="currentColor" d="M-5.839,24.8H-34.16A1.875,1.875,0,0,1-36,22.933V16.52a1.887,1.887,0,0,1,1.9-1.871H-5.9A1.887,1.887,0,0,1-4,16.52v6.412A1.875,1.875,0,0,1-5.839,24.8ZM-34.1,16.252a.27.27,0,0,0-.272.268v6.412a.27.27,0,0,0,.272.267H-5.9a.269.269,0,0,0,.271-.267V16.52a.27.27,0,0,0-.271-.268H-8.61V21.33H-9.695V16.252h-1.085v2.939h-1.085V16.252h-1.085v2.939h-1.085V16.252h-1.084v2.939H-16.2V16.252h-1.085v2.939h-1.085V16.252h-1.084V21.33h-1.084V16.252h-1.085v2.939h-1.085V16.252H-23.8v2.939h-1.085V16.252h-1.085v2.939h-1.085V16.252h-1.084v2.939H-29.22V16.252H-30.3V21.33H-31.39V16.252Z" transform="translate(36 2)"/><path fill="currentColor" d="M23.716,7.947V4.875c0-.8-.232-1.085-.765-1.085a1.573,1.573,0,0,0-1.133.585V7.947H20.4V2.75h1.163l.1.687H21.7a2.547,2.547,0,0,1,1.763-.817c1.172,0,1.676.78,1.676,2.089V7.947Zm-7.26,0V2.62h1.58V7.947Zm-3.8,0V4.875c0-.8-.243-1.085-.76-1.085a1.606,1.606,0,0,0-1.049.585V7.947H9.421V4.875c0-.8-.243-1.085-.758-1.085a1.608,1.608,0,0,0-1.05.585V7.947H6.194V2.75H7.36l.1.7H7.5A2.326,2.326,0,0,1,9.169,2.62a1.486,1.486,0,0,1,1.5.91A2.445,2.445,0,0,1,12.4,2.62c1.156,0,1.691.78,1.691,2.089V7.947Zm3.8-6.849a.79.79,0,0,1,1.58,0,.79.79,0,0,1-1.58,0Z" transform="translate(0.333 3.053)"/></svg>',激光边距:'<svg width="32" height="32" viewBox="0 0 32 32"><path fill="currentColor" d="M0,1.293v31.96H32V1.293ZM30.97,32.182H1.03V2.323H30.97Z"/><path fill="currentColor" d="M160.026,291.9l1.6,1.6,7.305-7.305-7.305-7.305-1.6,1.6,4.794,4.566h-6.392v2.283h6.392Zm-5.251,0-4.566-4.566h6.164v-2.283H150.21l4.566-4.566-1.37-1.6L146.1,286.19l7.305,7.305Z" transform="translate(-141.535 -268.917)"/></svg>',角度:'<svg width="32" height="32" viewBox="0 0 32 32"><path fill="currentColor" d="M39.587,50.766h13.7a1,1,0,0,1,0,2H23.171a1,1,0,0,1,0-2h1.418l6.582-7.006v-.006a.517.517,0,0,1,.14-.357.456.456,0,0,1,.337-.144l12.1-12.876a.451.451,0,0,1,.665,0,.524.524,0,0,1,0,.708L32.883,43.355a8.3,8.3,0,0,1,6.7,7.411Zm-.949,0a7.254,7.254,0,0,0-6.611-6.5l-6.108,6.5Z" transform="translate(-22.229 -26.489)"/></svg>',坡度:'<svg width="32" height="32" viewBox="0 0 32 32"><path fill="currentColor" d="M202.1,188.337l2.629-2.191-8.447-3.106,1.533,8.871,2.629-2.194,9.341,11.209,1.656-1.379Zm-13.726-.435a1.075,1.075,0,0,0-1.07-.341,1.057,1.057,0,0,0-.5.277l-5.11,4.08a1.08,1.08,0,0,0-.406.84l-.007,17.386a1.079,1.079,0,0,0,1.077,1.077L205.7,211.2a1.078,1.078,0,0,0,.822-1.774Zm-4.934,21.164.007-15.788,3.968-3.171,15.974,18.941Z" transform="translate(-180.36 -181.131)"/></svg>',体积:'<svg width="32" height="32" viewBox="0 0 32 32"><path fill="currentColor" d="M94.74,86.658V71.189a.371.371,0,0,1,.2-.329l13.869-7.22a.371.371,0,0,1,.344,0l13.053,6.891h0l.819.431a.371.371,0,0,1,.2.328v15.3a.371.371,0,0,1-.2.328l-13.872,7.255a.371.371,0,0,1-.342,0L94.94,86.987a.371.371,0,0,1-.2-.329Zm2.119-.837,11.2,5.8a.024.024,0,0,0,.035-.022V79.483a.371.371,0,0,0-.2-.328l-11.2-5.909a.024.024,0,0,0-.035.021V85.492A.371.371,0,0,0,96.859,85.821Zm13.151-6.459v12a.12.12,0,0,0,.176.106L114,89.474l3.334-1.745,3.771-1.978a.371.371,0,0,0,.2-.328V73.5a.193.193,0,0,0-.284-.171l-10.812,5.708A.371.371,0,0,0,110.01,79.362ZM97.925,71.725l10.839,5.72a.371.371,0,0,0,.346,0L119.8,71.808a.214.214,0,0,0,0-.378l-10.649-5.621a.371.371,0,0,0-.344,0L97.925,71.47A.144.144,0,0,0,97.925,71.725Z" transform="translate(-92.982 -62.907)"/></svg>',空间体积:'<svg width="32" height="32" viewBox="0 0 32 32"><path fill="currentColor" d="M125.977,128.829l13.076-7.363v-13.6l-13.076,6.8Zm-3.126-15.655a.565.565,0,0,1-.258-.064L109.3,106.323a.567.567,0,0,1-.011-1L122.578,98a.567.567,0,0,1,.55,0l13.288,7.325a.567.567,0,0,1-.011,1l-13.292,6.79A.63.63,0,0,1,122.851,113.174ZM110.773,105.8l12.078,6.172,12.078-6.172-12.078-6.657Z" transform="translate(-1.922)"/><path fill="currentColor" d="M120.649,322.52a.58.58,0,0,1-.262-.064l-13.08-6.8a.573.573,0,0,1-.307-.5V301a.566.566,0,0,1,.273-.486.573.573,0,0,1,.558-.019l13.076,6.8a.573.573,0,0,1,.307.5v14.161a.57.57,0,0,1-.565.569Zm-12.511-7.708,11.942,6.206V308.136l-11.942-6.206Zm15.917,9.408a.585.585,0,0,1-.288-.076.567.567,0,0,1-.281-.489V309.49a.562.562,0,0,1,.307-.5l13.076-6.8a.573.573,0,0,1,.558.019.562.562,0,0,1,.273.486v13.6a.568.568,0,0,1-.288.493l-13.076,7.359A.557.557,0,0,1,124.055,324.22Zm.569-14.385V322.68l11.942-6.722V303.629Z" transform="translate(0 -194.822)"/></svg>',close:'<svg width="24" height="24" viewBox="0 0 24 24"><path fill="currentColor" d="M19 6.41L17.59 5L12 10.59L6.41 5L5 6.41L10.59 12L5 17.59L6.41 19L12 13.41L17.59 19L19 17.59L13.41 12z"/></svg>',check:'<svg width="24" height="24" viewBox="0 0 24 24"><path fill="currentColor" d="M9 16.17L4.83 12l-1.42 1.41L9 19L21 7l-1.41-1.41z"/></svg>',warning:'<svg width="24" height="24" viewBox="0 0 24 24"><path fill="currentColor" d="M1 21h22L12 2L1 21zm12-3h-2v-2h2v2zm0-4h-2v-4h2v4z"/></svg>',error:'<svg width="24" height="24" viewBox="0 0 24 24"><path fill="currentColor" d="M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10s10-4.48 10-10S17.52 2 12 2zm1 15h-2v-2h2v2zm0-4h-2V7h2v6z"/></svg>',success:'<svg width="24" height="24" viewBox="0 0 24 24"><path fill="currentColor" d="M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10s10-4.48 10-10S17.52 2 12 2zm-2 15l-5-5l1.41-1.41L10 14.17l7.59-7.59L19 8l-9 9z"/></svg>',plus:'<svg width="24" height="24" viewBox="0 0 24 24"><path fill="currentColor" d="M19 13h-6v6h-2v-6H5v-2h6V5h2v6h6v2z"/></svg>',minus:'<svg width="24" height="24" viewBox="0 0 24 24"><path fill="currentColor" d="M19 13H5v-2h14v2z"/></svg>',arrowUp:'<svg width="24" height="24" viewBox="0 0 24 24"><path fill="currentColor" d="M7.41 15.41L12 10.83l4.59 4.58L18 14l-6-6l-6 6z"/></svg>',arrowUpBold:'<svg width="24" height="24" viewBox="0 0 24 24"><path fill="currentColor" d="M4 12l1.41 1.41L11 7.83V20h2V7.83l5.58 5.59L20 12l-8-8l-8 8z"/></svg>',arrowDown:'<svg width="24" height="24" viewBox="0 0 24 24"><path fill="currentColor" d="M7.41 8.59L12 13.17l4.59-4.58L18 10l-6 6l-6-6z"/></svg>',arrowLeft:'<svg width="24" height="24" viewBox="0 0 24 24"><path fill="currentColor" d="M15.41 7.41L14 6l-6 6l6 6l1.41-1.41L10.83 12z"/></svg>',arrowRight:'<svg width="24" height="24" viewBox="0 0 24 24"><path fill="currentColor" d="M10 6L8.59 7.41L13.17 12l-4.58 4.59L10 18l6-6z"/></svg>',search:'<svg width="24" height="24" viewBox="0 0 24 24"><path fill="currentColor" d="M15.5 14h-.79l-.28-.27A6.471 6.471 0 0 0 16 9.5A6.5 6.5 0 1 0 9.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 4.99L20.49 19l-4.99-5zm-6 0C7.01 14 5 11.99 5 9.5S7.01 5 9.5 5S14 7.01 14 9.5S11.99 14 9.5 14z"/></svg>',refresh:'<svg width="24" height="24" viewBox="0 0 24 24"><path fill="currentColor" d="M17.65 6.35A7.958 7.958 0 0 0 12 4c-4.42 0-7.99 3.58-7.99 8s3.57 8 7.99 8c3.73 0 6.84-2.55 7.73-6h-2.08A5.99 5.99 0 0 1 12 18c-3.31 0-6-2.69-6-6s2.69-6 6-6c1.66 0 3.14.69 4.22 1.78L13 11h7V4l-2.35 2.35z"/></svg>',delete:'<svg width="24" height="24" viewBox="0 0 24 24"><path fill="currentColor" d="M6 19c0 1.1.9 2 2 2h8c1.1 0 2-.9 2-2V7H6v12zM19 4h-3.5l-1-1h-5l-1 1H5v2h14V4z"/></svg>',edit:'<svg width="24" height="24" viewBox="0 0 24 24"><path fill="currentColor" d="M3 17.25V21h3.75L17.81 9.94l-3.75-3.75L3 17.25zM20.71 7.04a.996.996 0 0 0 0-1.41l-2.34-2.34a.996.996 0 0 0-1.41 0l-1.83 1.83l3.75 3.75l1.83-1.83z"/></svg>',save:'<svg width="24" height="24" viewBox="0 0 24 24"><path fill="currentColor" d="M17 3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14c1.1 0 2-.9 2-2V7l-4-4zm-5 16c-1.66 0-3-1.34-3-3s1.34-3 3-3s3 1.34 3 3s-1.34 3-3 3zm3-10H5V5h10v4z"/></svg>',expand:'<svg width="24" height="24" viewBox="0 0 24 24"><path fill="currentColor" d="M16.59 8.59L12 13.17L7.41 8.59L6 10l6 6l6-6z"/></svg>',collapse:'<svg width="24" height="24" viewBox="0 0 24 24"><path fill="currentColor" d="M12 8l-6 6l1.41 1.41L12 10.83l4.59 4.58L18 14z"/></svg>',bot:'<svg width="24" height="24" viewBox="0 0 24 24"><path fill="currentColor" d="M12 2a2 2 0 0 1 2 2c0 .74-.4 1.39-1 1.73V7h1a7 7 0 0 1 7 7h1a1 1 0 0 1 1 1v3a1 1 0 0 1-1 1h-1v1a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-1H2a1 1 0 0 1-1-1v-3a1 1 0 0 1 1-1h1a7 7 0 0 1 7-7h1V5.73c-.6-.34-1-.99-1-1.73a2 2 0 0 1 2-2M7.5 13A2.5 2.5 0 0 0 5 15.5A2.5 2.5 0 0 0 7.5 18a2.5 2.5 0 0 0 2.5-2.5A2.5 2.5 0 0 0 7.5 13m9 0a2.5 2.5 0 0 0-2.5 2.5a2.5 2.5 0 0 0 2.5 2.5a2.5 2.5 0 0 0 2.5-2.5a2.5 2.5 0 0 0-2.5-2.5Z"/></svg>',history:'<svg width="24" height="24" viewBox="0 0 24 24"><path fill="currentColor" d="M13 3a9 9 0 0 0-9 9H1l3.89 3.89l.07.14L9 12H6c0-3.87 3.13-7 7-7s7 3.13 7 7s-3.13 7-7 7c-1.93 0-3.68-.79-4.94-2.06l-1.42 1.42A8.954 8.954 0 0 0 13 21a9 9 0 0 0 0-18zm-1 5v5l4.28 2.54l.72-1.21l-3.5-2.08V8H12z"/></svg>',settings:'<svg width="24" height="24" viewBox="0 0 24 24"><path fill="currentColor" d="M12 15.5A3.5 3.5 0 0 1 8.5 12A3.5 3.5 0 0 1 12 8.5a3.5 3.5 0 0 1 3.5 3.5a3.5 3.5 0 0 1-3.5 3.5m7.43-2.53c.04-.32.07-.64.07-.97c0-.33-.03-.66-.07-1l2.11-1.63c.19-.15.24-.42.12-.64l-2-3.46c-.12-.22-.39-.31-.61-.22l-2.49 1c-.52-.39-1.06-.73-1.69-.98l-.37-2.65A.506.506 0 0 0 14 2h-4c-.25 0-.46.18-.5.42l-.37 2.65c-.63.25-1.17.59-1.69.98l-2.49-1c-.22-.09-.49 0-.61.22l-2 3.46c-.13.22-.07.49.12.64L4.57 11c-.04.34-.07.67-.07 1c0 .33.03.65.07.97l-2.11 1.66c-.19.15-.25.42-.12.64l2 3.46c.12.22.39.3.61.22l2.49-1.01c.52.4 1.06.74 1.69.99l.37 2.65c.04.24.25.42.5.42h4c.25 0 .46-.18.5-.42l.37-2.65c.63-.26 1.17-.59 1.69-.99l2.49 1.01c.22.08.49 0 .61-.22l2-3.46c.12-.22.07-.49-.12-.64l-2.11-1.66Z"/></svg>',loader:'<svg width="24" height="24" viewBox="0 0 24 24"><path fill="currentColor" d="M12 4V2A10 10 0 0 0 2 12h2a8 8 0 0 1 8-8Z"><animateTransform attributeName="transform" dur="0.75s" repeatCount="indefinite" type="rotate" values="0 12 12;360 12 12"/></path></svg>',send:'<svg width="24" height="24" viewBox="0 0 24 24"><path fill="currentColor" d="M2 21l21-9L2 3v7l15 2l-15 2v7z"/></svg>',透视相机:'<svg width="48" height="48" viewBox="0 0 48 48"><path fill="currentColor" d="M24 4L4 14v20l20 10l20-10V14L24 4zm0 4.5l14 7v14l-14 7l-14-7v-14l14-7zM24 18a6 6 0 100 12a6 6 0 000-12z"/></svg>',正交相机:'<svg width="48" height="48" viewBox="0 0 48 48"><path fill="currentColor" d="M6 6h36v36H6V6zm4 4v28h28V10H10zm4 4h20v20H14V14z"/></svg>',default:'<svg width="24" height="24" viewBox="0 0 24 24"><path fill="currentColor" d="M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10s10-4.48 10-10S17.52 2 12 2zm0 18c-4.41 0-8-3.59-8-8s3.59-8 8-8s8 3.59 8 8s-3.59 8-8 8zm-1-13h2v6h-2zm0 8h2v2h-2z"/></svg>'};function Tt(s){const e=T2[s];return e||(console.warn(`[IconManager] Icon "${s}" not found, using default icon`),T2.default)}class Vz{container;wrapper;mainButton;items=[];itemElements=[];itemButtonMap=new Map;toggleStateMap=new Map;isActive=!1;timer=null;unsubscribeTheme=null;unsubscribeLocale=null;mainButtonLabel;onMainButtonClick;pointerX=Number.NaN;pointerY=Number.NaN;maxInteractiveRadius=220;closeDelay;itemsPerRing;MAIN_BUTTON_SIZE=60;SUB_BUTTON_SIZE=46;BASE_RADIUS=80;RING_GAP=40;FAN_START_DEG=170;FAN_END_DEG=280;CANVAS_PADDING=28;constructor(e){this.container=e.container,this.items=e.items===void 0?this.createDefaultItems():[...e.items],this.mainButtonLabel=e.mainButtonLabel??"toolbar.home",this.onMainButtonClick=e.onMainButtonClick,this.itemsPerRing=Math.max(3,e.itemsPerRing??5),this.closeDelay=Math.max(100,e.closeDelay??260),this.wrapper=this.createWrapper(),this.mainButton=this.createMainButton(e.mainButtonIcon),this.wrapper.appendChild(this.mainButton),this.container.appendChild(this.wrapper),this.renderItems(),this.updateLayoutMetrics(),this.bindEvents(),this.setTheme(ct.getTheme()),this.updateLocales(),this.unsubscribeTheme=ct.subscribe(t=>{this.setTheme(t)}),this.unsubscribeLocale=Zt.subscribe(()=>{this.updateLocales()})}createDefaultItems(){return[{id:"zoom",label:"toolbar.zoomBox",icon:Tt("框选放大")},{id:"measure",label:"toolbar.measure",icon:Tt("测量")},{id:"section",label:"toolbar.section",icon:Tt("剖切")},{id:"walk",label:"toolbar.walk",icon:Tt("漫游")},{id:"setting",label:"toolbar.setting",icon:Tt("设置")}]}createWrapper(){const e=document.createElement("div");return e.className="radial-toolbar-wrapper",e}createMainButton(e){const t=document.createElement("button");return t.className="radial-main-btn",t.type="button",t.innerHTML=e??Tt("主视角"),t}bindEvents(){this.mainButton.addEventListener("mouseenter",this.handlePointerEnter),this.mainButton.addEventListener("mouseleave",this.handlePointerLeave),this.mainButton.addEventListener("click",this.handleMainButtonClick),this.mainButton.addEventListener("dblclick",this.handleMainButtonDoubleClick),document.addEventListener("click",this.handleDocumentClick),document.addEventListener("mousemove",this.handleDocumentMouseMove),document.addEventListener("mouseleave",this.handleDocumentMouseLeave),document.addEventListener("visibilitychange",this.handleVisibilityChange),window.addEventListener("blur",this.handleWindowBlur)}handleDocumentMouseMove=e=>{this.pointerX=e.clientX,this.pointerY=e.clientY};handleDocumentMouseLeave=()=>{this.pointerX=Number.NaN,this.pointerY=Number.NaN,this.collapse()};handleVisibilityChange=()=>{document.hidden&&(this.pointerX=Number.NaN,this.pointerY=Number.NaN,this.collapse())};handleWindowBlur=()=>{this.pointerX=Number.NaN,this.pointerY=Number.NaN,this.collapse()};handlePointerEnter=()=>{this.timer&&(clearTimeout(this.timer),this.timer=null),this.expand()};handlePointerLeave=e=>{const t=e.relatedTarget;t instanceof Node&&this.wrapper.contains(t)||this.scheduleCollapse()};handleMainButtonClick=e=>{e.stopPropagation()};handleMainButtonDoubleClick=e=>{if(e.stopPropagation(),this.onMainButtonClick){this.onMainButtonClick();return}};handleDocumentClick=e=>{const t=e.target;t instanceof Node&&(this.wrapper.contains(t)||this.collapse())};renderItems(){this.itemElements.forEach(e=>e.remove()),this.itemElements=[],this.itemButtonMap.clear(),this.toggleStateMap.clear(),this.items.forEach((e,t)=>{this.toggleStateMap.set(e.id,!!e.isActive);const i=this.createSubButton(e,t);this.wrapper.insertBefore(i,this.mainButton),this.itemElements.push(i),this.itemButtonMap.set(e.id,i)}),this.updateItemPositions()}createSubButton(e,t){const i=document.createElement("button");i.className="radial-sub-btn",i.type="button",i.dataset.index=String(t),this.applyItemActiveClass(i,e);const n=document.createElement("span");return n.className="radial-sub-btn-icon",e.icon?n.innerHTML=e.icon:n.textContent=this.getFallbackLabel(e.label),i.appendChild(n),i.addEventListener("mouseenter",this.handlePointerEnter),i.addEventListener("mouseleave",this.handlePointerLeave),i.addEventListener("click",r=>{if(r.stopPropagation(),e.isToggle){const o=!(this.toggleStateMap.get(e.id)??!1);this.toggleStateMap.set(e.id,o),e.isActive=o,this.applyItemActiveClass(i,e),e.onToggle?.(o,e),this.collapse();return}e.onClick?.(e),this.collapse()}),i}updateItemPositions(){const e=this.itemElements.length,t=this.FAN_END_DEG-this.FAN_START_DEG;this.itemElements.forEach((i,n)=>{const r=Math.floor(n/this.itemsPerRing),a=r*this.itemsPerRing,o=Math.min(this.itemsPerRing,e-a),l=n-a,c=o===1?.5:l/(o-1),d=(this.FAN_START_DEG+t*c)*Math.PI/180,p=this.getBaseRadius(o)+r*this.RING_GAP,u=Math.cos(d)*p,v=Math.sin(d)*p,g=(l+r*.5)*.045,m=(o-1-l+r*.4)*.032;i.style.setProperty("--rt-x",`${u.toFixed(2)}px`),i.style.setProperty("--rt-y",`${v.toFixed(2)}px`),i.style.setProperty("--rt-open-delay",`${g.toFixed(3)}s`),i.style.setProperty("--rt-close-delay",`${m.toFixed(3)}s`)})}updateLayoutMetrics(){const e=this.items.length,t=Math.max(1,Math.ceil(e/this.itemsPerRing)),i=Math.max(1,Math.min(e,this.itemsPerRing)),n=this.getBaseRadius(i)+(t-1)*this.RING_GAP,r=Math.ceil(n+this.MAIN_BUTTON_SIZE+this.SUB_BUTTON_SIZE+this.CANVAS_PADDING*2);this.maxInteractiveRadius=n+this.SUB_BUTTON_SIZE*.7,this.wrapper.style.width=`${r}px`,this.wrapper.style.height=`${r}px`,this.wrapper.style.setProperty("--rt-main-size",`${this.MAIN_BUTTON_SIZE}px`),this.wrapper.style.setProperty("--rt-sub-size",`${this.SUB_BUTTON_SIZE}px`),this.wrapper.style.setProperty("--rt-main-offset",`${(this.MAIN_BUTTON_SIZE-this.SUB_BUTTON_SIZE)/2}px`)}getBaseRadius(e){return this.BASE_RADIUS}scheduleCollapse(){this.timer&&clearTimeout(this.timer),this.timer=window.setTimeout(()=>{if(this.timer=null,this.isPointerInsideToolbar()){this.isActive&&this.scheduleCollapse();return}this.collapse()},this.closeDelay)}isPointerInsideToolbar(){return this.mainButton.matches(":hover")||this.itemElements.some(e=>e.matches(":hover"))?!0:this.isPointerInsideFanRegion()}isPointerInsideFanRegion(){if(!Number.isFinite(this.pointerX)||!Number.isFinite(this.pointerY))return!1;const e=this.mainButton.getBoundingClientRect(),t=e.left+e.width/2,i=e.top+e.height/2,n=this.pointerX-t,r=this.pointerY-i,a=Math.hypot(n,r);if(a<=this.MAIN_BUTTON_SIZE/2)return!0;if(a>this.maxInteractiveRadius)return!1;let o=Math.atan2(r,n)*180/Math.PI;return o<0&&(o+=360),this.FAN_START_DEG<=this.FAN_END_DEG?o>=this.FAN_START_DEG&&o<=this.FAN_END_DEG:o>=this.FAN_START_DEG||o<=this.FAN_END_DEG}expand(){this.isActive||this.items.length===0||(this.isActive=!0,this.wrapper.classList.add("is-active"))}collapse(){this.isActive&&(this.isActive=!1,this.wrapper.classList.remove("is-active"))}updateLocales(){const e=Se(this.mainButtonLabel);this.mainButton.title=e,this.mainButton.setAttribute("aria-label",e),this.itemElements.forEach((t,i)=>{const n=this.items[i];if(!n)return;const r=Se(n.label);if(t.title=r,t.setAttribute("aria-label",r),this.applyItemActiveClass(t,n),!n.icon){const a=t.querySelector(".radial-sub-btn-icon");a&&(a.textContent=this.getFallbackLabel(n.label))}})}applyItemActiveClass(e,t){if(!t.isToggle){e.classList.remove("is-active"),e.dataset.active="false";return}const i=this.toggleStateMap.get(t.id)??!!t.isActive;e.classList.toggle("is-active",i),e.dataset.active=i?"true":"false"}getFallbackLabel(e){const t=Se(e).trim();return t?t.charAt(0).toUpperCase():"?"}setTheme(e){this.wrapper.classList.remove("theme-light","theme-dark"),this.wrapper.classList.add(`theme-${e.name}`);const t=this.wrapper.style;t.setProperty("--bim-primary",e.primary),t.setProperty("--bim-primary-hover",e.primaryHover),t.setProperty("--bim-primary-active",e.primaryActive),t.setProperty("--bim-text-inverse",e.textInverse),t.setProperty("--bim-icon-inverse",e.iconInverse),t.setProperty("--bim-shadow-glow",e.shadowGlow),t.setProperty("--rt-main-bg",e.bgBase),t.setProperty("--rt-main-bg-hover",e.bgBase),t.setProperty("--rt-main-border",e.floatingBtnBorder),t.setProperty("--rt-main-shadow",e.floatingBtnShadow),t.setProperty("--rt-main-shadow-hover",e.floatingBtnShadowHover),t.setProperty("--rt-main-icon",e.floatingIconColor),t.setProperty("--rt-main-icon-hover",e.floatingIconColorHover),t.setProperty("--rt-sub-bg",e.bgBase),t.setProperty("--rt-sub-bg-hover",e.primaryHover),t.setProperty("--rt-sub-border",e.floatingBtnBorder),t.setProperty("--rt-sub-shadow",e.floatingBtnShadow),t.setProperty("--rt-sub-shadow-hover",e.floatingBtnShadowHover),t.setProperty("--rt-sub-icon",e.floatingIconColor),t.setProperty("--rt-sub-icon-hover",e.iconHover)}setItemActive(e,t){const i=this.items.find(r=>r.id===e);if(!i||!i.isToggle)return;i.isActive=t,this.toggleStateMap.set(e,t);const n=this.itemButtonMap.get(e);n&&this.applyItemActiveClass(n,i)}init(){}setLocales(){this.updateLocales()}destroy(){this.timer&&(clearTimeout(this.timer),this.timer=null),this.unsubscribeTheme&&(this.unsubscribeTheme(),this.unsubscribeTheme=null),this.unsubscribeLocale&&(this.unsubscribeLocale(),this.unsubscribeLocale=null),document.removeEventListener("click",this.handleDocumentClick),document.removeEventListener("mousemove",this.handleDocumentMouseMove),document.removeEventListener("mouseleave",this.handleDocumentMouseLeave),document.removeEventListener("visibilitychange",this.handleVisibilityChange),window.removeEventListener("blur",this.handleWindowBlur),this.mainButton.removeEventListener("mouseenter",this.handlePointerEnter),this.mainButton.removeEventListener("mouseleave",this.handlePointerLeave),this.mainButton.removeEventListener("click",this.handleMainButtonClick),this.itemElements.forEach(e=>{e.removeEventListener("mouseenter",this.handlePointerEnter),e.removeEventListener("mouseleave",this.handlePointerLeave)}),this.wrapper.parentNode&&this.wrapper.parentNode.removeChild(this.wrapper)}}const Gz=s=>({id:"measure",label:"toolbar.measure",icon:Tt("测量"),isToggle:!0,isActive:s.bottomDock?.isOpen("measure")??!1,onToggle:e=>{const t=s.bottomDock;if(!t){console.warn("[RadialToolbar] bottom dock not initialized: measure");return}e?t.open("measure"):t.close("measure"),console.log(`[RadialToolbar] 测量${e?"已打开":"已关闭"}`)}}),Wz=s=>({id:"section",label:"toolbar.section",icon:Tt("剖切"),isToggle:!0,isActive:s.bottomDock?.isOpen("section")??!1,onToggle:e=>{const t=s.bottomDock;if(!t){console.warn("[RadialToolbar] bottom dock not initialized: section");return}e?t.open("section"):t.close("section"),console.log(`[RadialToolbar] 剖切${e?"已打开":"已关闭"}`)}}),Xz=s=>({id:"setting",label:"toolbar.setting",icon:Tt("设置"),onClick:()=>{s.setting?.toggle(),console.log(`[RadialToolbar] 设置${s.setting?.isOpen()?"已打开":"已关闭"}`)}}),jz=s=>({id:"walk",label:"toolbar.walk",icon:Tt("漫游"),isToggle:!0,isActive:s.bottomDock?.isOpen("walk")??!1,onToggle:e=>{const t=s.bottomDock;if(!t){console.warn("[RadialToolbar] bottom dock not initialized: walk");return}e?t.open("walk"):t.close("walk"),console.log(`[RadialToolbar] 漫游${e?"已打开":"已关闭"}`)}});class C2 extends jn{toolbar=null;unsubscribeDockState=null;constructor(e,t,i){super(t),this.toolbar=new Vz({container:e,items:i?.items??this.createDefaultItems(),itemsPerRing:i?.itemsPerRing??4,mainButtonIcon:Tt("主视角"),mainButtonLabel:"toolbar.home",onMainButtonClick:()=>{console.log("[RadialToolbar] main: home"),this.registry.engine3d?.getEngineComponent()?.CameraGoHome()}}),this.toolbar.setTheme(ct.getTheme()),this.unsubscribeDockState=this.registry.bottomDock?.onStateChange(({id:n,open:r})=>{this.toolbar?.setItemActive(n,r)})??null,this.syncInitialToggleStates()}createDefaultItems(){return[Xz(this.registry),Gz(this.registry),Wz(this.registry),jz(this.registry)]}syncInitialToggleStates(){const e=this.registry.bottomDock;!e||!this.toolbar||(this.toolbar.setItemActive("measure",e.isOpen("measure")),this.toolbar.setItemActive("section",e.isOpen("section")),this.toolbar.setItemActive("walk",e.isOpen("walk")))}destroy(){this.unsubscribeDockState&&(this.unsubscribeDockState(),this.unsubscribeDockState=null),this.toolbar?.destroy(),this.toolbar=null,super.destroy()}}class qz{container;root;panelGap=10;panelMap=new Map;panelOrder=[];resizeObserver;handleWindowResize=()=>{this.reflow()};constructor(e){this.container=e,this.root=document.createElement("div"),this.root.className="bottom-dock-stack",this.container.appendChild(this.root),this.resizeObserver=typeof ResizeObserver<"u"?new ResizeObserver(()=>{this.reflow()}):null,this.resizeObserver||window.addEventListener("resize",this.handleWindowResize)}setTheme(e){const t=this.root.style;t.setProperty("--bd-bg",e.floatingBtnBg),t.setProperty("--bd-border",e.floatingBtnBorder),t.setProperty("--bd-shadow",e.floatingBtnShadow),t.setProperty("--bd-close-color",e.floatingIconColor),t.setProperty("--bd-close-color-hover",e.floatingIconColorHover),t.setProperty("--bd-close-bg-hover",e.floatingBtnBgHover),t.setProperty("--bd-close-border-hover",e.floatingBtnBorder),t.setProperty("--bd-body-bg",e.floatingBtnBg),t.setProperty("--bd-placeholder-border",e.borderSubtle),t.setProperty("--bd-placeholder-text",e.textSecondary)}hasPanel(e){return this.panelMap.has(e)}addPanel(e){const t=this.panelMap.get(e.id);if(t&&t.leaving){t.leaving=!1,t.element.classList.remove("is-leaving"),t.removeTimer&&(clearTimeout(t.removeTimer),t.removeTimer=null),t.bodyElement.replaceChildren(e.content),this.panelOrder.includes(e.id)||this.panelOrder.push(e.id),this.reflow();return}if(t)return;const i=document.createElement("section");i.className="bottom-dock-panel is-entering",i.dataset.panelId=e.id;let n=null;e.closable!==!1&&(n=document.createElement("button"),n.className="bottom-dock-panel-close",n.type="button",n.setAttribute("aria-label","close-panel"),n.textContent="×",n.addEventListener("click",a=>{a.stopPropagation(),e.onClose(e.id)}),i.appendChild(n));const r=document.createElement("div");r.className="bottom-dock-panel-body",r.appendChild(e.content),i.appendChild(r),this.root.appendChild(i),this.panelOrder.push(e.id),this.panelMap.set(e.id,{id:e.id,element:i,bodyElement:r,closeButton:n,leaving:!1,removeTimer:null}),this.resizeObserver?.observe(i),this.reflow(),requestAnimationFrame(()=>{i.classList.remove("is-entering")})}removePanel(e){const t=this.panelMap.get(e);if(!t||t.leaving)return;t.leaving=!0,t.element.classList.add("is-leaving");const i=this.panelOrder.indexOf(e);i>=0&&this.panelOrder.splice(i,1),this.reflow(),t.removeTimer=window.setTimeout(()=>{this.resizeObserver?.unobserve(t.element),t.element.remove(),this.panelMap.delete(e),t.removeTimer=null},220)}createPlaceholderContent(e){const t=document.createElement("div");return t.className="bottom-dock-placeholder",t.textContent=e,t}destroy(){this.resizeObserver?.disconnect(),window.removeEventListener("resize",this.handleWindowResize),this.panelMap.clear(),this.panelOrder.length=0,this.root.remove()}reflow(){let e=0,t=0;this.panelOrder.forEach(r=>{const a=this.panelMap.get(r);a&&(a.element.style.transform=`translateX(-50%) translateY(-${e}px)`,e+=a.element.offsetHeight+this.panelGap,t=Math.max(t,a.element.offsetWidth))});const i=this.panelOrder.length,n=i>0?e-this.panelGap:0;this.root.style.height=`${n}px`,this.root.style.width=i>0?`${t}px`:"0px"}}class A2 extends jn{stack;definitions=new Map;openStates=new Map;listeners=new Set;unsubscribeTheme=null;constructor(e,t){super(t),this.stack=new qz(e),this.stack.setTheme(ct.getTheme()),this.unsubscribeTheme=ct.subscribe(i=>{this.stack.setTheme(i)}),this.registerDefaultPanels()}register(e){this.definitions.set(e.id,e),this.openStates.has(e.id)||this.openStates.set(e.id,!1)}unregister(e){this.isOpen(e)&&this.close(e),this.definitions.delete(e),this.openStates.delete(e)}toggle(e){if(this.isOpen(e)){this.close(e);return}this.open(e)}open(e){const t=this.definitions.get(e);if(!t){console.warn(`[BottomDock] Unknown panel id: ${e}`);return}if(this.isOpen(e))return;const i=t.createContent?t.createContent():this.stack.createPlaceholderContent(`${t.title} 面板内容占位`);this.stack.addPanel({id:e,content:i,closable:t.closable!==!1,onClose:()=>{this.close(e)}}),this.openStates.set(e,!0),this.emitState({id:e,open:!0})}close(e){this.isOpen(e)&&(this.stack.removePanel(e),this.openStates.set(e,!1),this.emitState({id:e,open:!1}))}isOpen(e){return this.openStates.get(e)??!1}createPlaceholderContent(e){return this.stack.createPlaceholderContent(e)}onStateChange(e){return this.listeners.add(e),()=>{this.listeners.delete(e)}}destroy(){this.unsubscribeTheme&&(this.unsubscribeTheme(),this.unsubscribeTheme=null),this.listeners.clear(),this.definitions.clear(),this.openStates.clear(),this.stack.destroy(),super.destroy()}emitState(e){this.listeners.forEach(t=>{t(e)})}registerDefaultPanels(){this.register({id:"measure",title:"测量",createContent:()=>{const e=this.registry.measureDock?.getPanelElement();return e||this.stack.createPlaceholderContent("测量面板占位")}}),this.register({id:"section",title:"剖切",createContent:()=>{const e=this.registry.sectionDock?.getPanelElement();return e||this.stack.createPlaceholderContent("剖切面板占位")}}),this.register({id:"walk",title:"漫游",createContent:()=>{const e=this.registry.walkDock?.getPanelElement();return e||this.stack.createPlaceholderContent("漫游面板占位")}})}}const _a={clearHeight:'<svg aria-hidden="true" viewBox="0 0 48 48"><path d="M19.0032 32.1184C18.712 32.1184 18.4032 32.1184 18.112 32.4096C17.512 32.6992 17.8224 33.5904 18.112 33.8816L23.1472 38.6256C23.7472 38.9152 24.6192 38.9152 24.928 38.6256L29.9632 33.8816C30.2528 33.5904 30.2528 33.2816 30.2528 32.9904C30.2528 32.3904 29.6528 32.1008 29.072 32.1008L25.7856 32.1008L25.7856 16.2192L29.0256 16.2192C29.3152 16.2192 29.6256 16.2192 29.9152 15.928C30.5152 15.6368 30.2064 14.7472 29.9152 14.456L24.8816 9.7072C24.2816 9.4176 23.4096 9.4176 23.0992 9.7072L18.0656 14.4512C17.7744 14.7424 17.7744 15.0512 17.7744 15.3424C17.7744 15.9424 18.3744 16.232 18.9568 16.232L22.24 16.232L22.24 32.1328L19.0016 32.1328L19.0016 32.1184L19.0032 32.1184ZM4.75842 6.80639L43.2384 6.80639C44.128 6.80639 44.7104 6.20639 44.7104 5.33442C44.7104 4.1536 44.1088 3.2624 43.2384 3.2624L4.75678 3.2624C4.1568 3.2624 3.5744 3.8624 3.2848 4.73442C3.2848 5.62561 3.8848 6.5152 4.75678 6.80639L4.75842 6.80639ZM43.256 41.1936L4.75842 41.1936C4.1584 41.1936 3.576 41.7936 3.2864 42.6656C3.2864 43.5568 3.8864 44.4464 4.75842 44.7376L43.2384 44.7376C44.128 44.7376 44.7104 44.1376 44.7104 43.2656C44.728 42.08 44.1328 41.1936 43.256 41.1936Z" fill="currentColor"/></svg>',clearDistance:'<svg aria-hidden="true" viewBox="0 0 48 48"><path d="M15.2619 20.2135C15.2619 20.8776 14.5628 21.2125 14.0415 21.0436L4.13531 16.0541C4.10363 16.0394 4.07281 16.023 4.04285 16.005C4.0129 15.987 3.98397 15.9675 3.95607 15.9464C3.92817 15.9254 3.90144 15.9029 3.87591 15.879C3.85037 15.8552 3.82615 15.83 3.80326 15.8036L3.80909 35.8838C3.80909 36.8159 3.18577 37.4393 2.2537 37.4393C1.32163 37.4393 0.701223 36.8159 0.701223 35.8838L0.701223 9.16557C0.698312 8.2335 1.31872 7.61016 2.25079 7.61016C3.18286 7.61016 3.80618 8.2335 3.80618 9.16557L3.80035 14.8075C3.82324 14.7811 3.84746 14.7559 3.873 14.7321C3.89853 14.7082 3.92525 14.6858 3.95315 14.6647C3.98106 14.6437 4.00999 14.6242 4.03994 14.6062C4.0699 14.5881 4.10072 14.5718 4.1324 14.557L14.0444 9.56752C14.5687 9.23546 15.2619 9.56752 15.2619 10.2316L15.2619 13.9074L32.9566 13.9074C33.3644 13.9074 33.6557 13.6628 33.7314 13.2725L33.7488 13.0686L33.7488 10.2142C33.7488 9.71316 34.3838 9.20925 34.8557 9.54422L43.8938 14.5803C44.0132 14.6415 44.1181 14.7259 44.2026 14.8337L44.1968 8.07624C44.1968 7.14413 44.8201 6.52374 45.7521 6.52374C46.6842 6.52374 47.3044 7.14413 47.3044 8.07624L47.3044 36.0383C47.3044 36.0637 47.3038 36.0891 47.3025 36.1145C47.3016 36.1399 47.2998 36.1652 47.2974 36.1905C47.2948 36.2158 47.2917 36.241 47.288 36.2662C47.2842 36.2914 47.2798 36.3164 47.2749 36.3413C47.2698 36.3663 47.2642 36.3911 47.258 36.4157C47.252 36.4404 47.2453 36.4649 47.2378 36.4892C47.2303 36.5136 47.2224 36.5377 47.2139 36.5617C47.2055 36.5856 47.1964 36.6093 47.1867 36.6328C47.1767 36.6563 47.1664 36.6795 47.1558 36.7025C47.1448 36.7255 47.1334 36.7482 47.1216 36.7707C47.1094 36.7931 47.0969 36.8152 47.0841 36.837C47.0709 36.8588 47.0574 36.8803 47.0433 36.9015C47.0289 36.9226 47.0142 36.9434 46.9992 36.9638C46.9842 36.9843 46.9686 37.0043 46.9524 37.024C46.9361 37.0436 46.9195 37.0629 46.9027 37.0818C46.8855 37.1006 46.8679 37.119 46.8501 37.137C46.8321 37.155 46.8137 37.1726 46.7949 37.1897C46.7761 37.2068 46.7569 37.2234 46.7372 37.2395C46.7176 37.2557 46.6975 37.2713 46.6772 37.2865C46.6568 37.3017 46.636 37.3163 46.6149 37.3305C46.5937 37.3447 46.5723 37.3583 46.5505 37.3714C46.5287 37.3845 46.5066 37.397 46.4842 37.409C46.4618 37.4211 46.4391 37.4325 46.4161 37.4434C46.3932 37.4543 46.3699 37.4646 46.3464 37.4744C46.323 37.4842 46.2993 37.4933 46.2754 37.5019C46.2514 37.5105 46.2273 37.5186 46.203 37.526C46.1786 37.5334 46.1542 37.5402 46.1296 37.5464C46.1049 37.5526 46.0801 37.5582 46.0552 37.5632C46.0302 37.5683 46.0052 37.5726 45.9801 37.5764C45.9549 37.5802 45.9297 37.5833 45.9044 37.5859C45.8791 37.5884 45.8537 37.5903 45.8284 37.5916C45.803 37.5929 45.7775 37.5936 45.7521 37.5936C44.8201 37.5936 44.1968 36.9732 44.1968 36.0412L44.1997 15.8357C44.1783 15.8546 44.1554 15.8715 44.1309 15.8861C44.1064 15.9008 44.0807 15.9131 44.054 15.9231L35.0188 20.9562C34.544 21.2912 33.9091 20.9562 33.9091 20.2863L33.9091 17.4318C33.9091 16.9279 33.5887 16.593 33.1168 16.593L15.2619 16.59L15.2619 20.2135L15.2619 20.2135ZM41.0889 24.2796L41.0889 36.0412C41.0889 36.8975 40.3899 37.5936 39.5335 37.5936C38.6014 37.5936 37.981 36.9732 37.981 36.0412L37.981 24.2796C37.981 23.3475 38.6014 22.7243 39.5335 22.7243C40.4656 22.7243 41.0889 23.3475 41.0889 24.2796ZM28.6604 24.2796L28.6604 36.0412C28.6603 36.0665 28.6596 36.0919 28.6584 36.1173C28.657 36.1426 28.6551 36.168 28.6526 36.1932C28.6501 36.2185 28.6469 36.2437 28.6432 36.2688C28.6394 36.2939 28.6351 36.3189 28.63 36.3438C28.625 36.3687 28.6194 36.3935 28.6133 36.4181C28.607 36.4427 28.6002 36.4672 28.5929 36.4915C28.5855 36.5158 28.5774 36.5399 28.5689 36.5638C28.5603 36.5877 28.5512 36.6113 28.5414 36.6348C28.5317 36.6583 28.5213 36.6815 28.5105 36.7044C28.4996 36.7274 28.4881 36.75 28.4762 36.7724C28.4642 36.7948 28.4517 36.8168 28.4386 36.8386C28.4255 36.8604 28.4119 36.8819 28.3978 36.903C28.3837 36.9241 28.369 36.9448 28.3539 36.9652C28.3388 36.9856 28.3232 37.0056 28.3071 37.0253C28.2909 37.0449 28.2744 37.0641 28.2573 37.0829C28.2402 37.1017 28.2227 37.1201 28.2048 37.1381C28.1868 37.156 28.1684 37.1735 28.1496 37.1906C28.1308 37.2076 28.1116 37.2242 28.092 37.2404C28.0723 37.2564 28.0523 37.2721 28.032 37.2872C28.0115 37.3024 27.9908 37.317 27.9697 37.3311C27.9486 37.3452 27.9272 37.3588 27.9054 37.3719C27.8836 37.385 27.8615 37.3975 27.8391 37.4094C27.8167 37.4214 27.7941 37.4329 27.7712 37.4438C27.7482 37.4546 27.725 37.4649 27.7015 37.4747C27.6781 37.4844 27.6544 37.4936 27.6305 37.5022C27.6066 37.5107 27.5825 37.5187 27.5582 37.5261C27.5339 37.5335 27.5094 37.5403 27.4848 37.5465C27.4602 37.5527 27.4354 37.5583 27.4105 37.5633C27.3857 37.5683 27.3606 37.5727 27.3355 37.5765C27.3104 37.5802 27.2852 37.5833 27.2599 37.5859C27.2347 37.5884 27.2094 37.5903 27.184 37.5916C27.1586 37.5929 27.1333 37.5936 27.1079 37.5936C26.1758 37.5936 25.5525 36.9732 25.5525 36.0412L25.5525 24.2796C25.5525 23.3475 26.1758 22.7243 27.1079 22.7243C28.0399 22.7243 28.6604 23.3475 28.6604 24.2796ZM10.019 24.2796L10.019 36.0412C10.0189 36.0666 10.0183 36.092 10.017 36.1174C10.0156 36.1428 10.0138 36.1681 10.0112 36.1934C10.0087 36.2187 10.0055 36.2439 10.0018 36.2691C9.99798 36.2942 9.99357 36.3193 9.9886 36.3442C9.98359 36.3691 9.97796 36.3939 9.97178 36.4185C9.96554 36.4432 9.95874 36.4677 9.95134 36.492C9.94393 36.5163 9.93592 36.5404 9.92729 36.5644C9.91867 36.5883 9.90952 36.612 9.89978 36.6355C9.88998 36.659 9.87967 36.6822 9.86879 36.7051C9.85787 36.7281 9.84638 36.7508 9.83438 36.7732C9.82238 36.7956 9.80982 36.8177 9.79674 36.8395C9.78362 36.8613 9.77003 36.8828 9.75587 36.9039C9.74171 36.925 9.72704 36.9458 9.7119 36.9662C9.69671 36.9866 9.68101 37.0066 9.66488 37.0262C9.64876 37.0459 9.63212 37.0651 9.61506 37.0839C9.59795 37.1027 9.58042 37.1212 9.56242 37.1391C9.54442 37.1571 9.52599 37.1745 9.50715 37.1916C9.48826 37.2087 9.46899 37.2253 9.44935 37.2414C9.42967 37.2575 9.40965 37.2731 9.38921 37.2883C9.36878 37.3034 9.34796 37.318 9.32682 37.3321C9.30563 37.3462 9.28417 37.3598 9.26237 37.3729C9.24053 37.3859 9.2184 37.3984 9.19599 37.4104C9.17359 37.4224 9.15085 37.4338 9.12788 37.4446C9.10487 37.4555 9.08162 37.4658 9.05818 37.4755C9.03465 37.4852 9.01093 37.4944 8.98703 37.5029C8.96303 37.5115 8.93888 37.5195 8.9146 37.5268C8.89023 37.5342 8.86576 37.541 8.8411 37.5471C8.81645 37.5533 8.79165 37.5589 8.76671 37.5638C8.74178 37.5688 8.7167 37.5731 8.69157 37.5768C8.6664 37.5805 8.64118 37.5837 8.61587 37.5862C8.59056 37.5886 8.56524 37.5905 8.53984 37.5917C8.51443 37.593 8.48903 37.5936 8.46362 37.5936C7.53156 37.5936 6.90821 36.9732 6.90821 36.0412L6.90821 24.2796C6.90821 23.3475 7.53156 22.7243 8.46362 22.7243C9.39568 22.7243 10.0161 23.3475 10.0161 24.2796L10.019 24.2796ZM33.3207 29.7147C34.2527 29.7147 34.8732 30.3381 34.8732 31.2701L34.8732 36.0412C34.8731 36.0665 34.8724 36.0919 34.8712 36.1173C34.8699 36.1426 34.8679 36.168 34.8654 36.1932C34.8629 36.2185 34.8597 36.2437 34.856 36.2688C34.8522 36.2939 34.8478 36.3189 34.8429 36.3438C34.8378 36.3687 34.8323 36.3935 34.8261 36.4181C34.8198 36.4427 34.813 36.4672 34.8057 36.4915C34.7983 36.5158 34.7903 36.5399 34.7817 36.5638C34.7731 36.5877 34.7639 36.6113 34.7542 36.6348C34.7445 36.6583 34.7341 36.6815 34.7233 36.7044C34.7124 36.7274 34.701 36.75 34.689 36.7724C34.677 36.7948 34.6644 36.8168 34.6514 36.8386C34.6383 36.8604 34.6247 36.8819 34.6106 36.903C34.5965 36.9241 34.5819 36.9448 34.5668 36.9652C34.5516 36.9856 34.536 37.0056 34.5199 37.0253C34.5038 37.0449 34.4872 37.0641 34.4701 37.0829C34.453 37.1017 34.4356 37.1201 34.4176 37.1381C34.3996 37.156 34.3812 37.1735 34.3624 37.1906C34.3436 37.2076 34.3244 37.2242 34.3048 37.2404C34.2851 37.2564 34.2652 37.2721 34.2448 37.2872C34.2244 37.3024 34.2036 37.317 34.1825 37.3311C34.1614 37.3452 34.1399 37.3588 34.1182 37.3719C34.0964 37.385 34.0743 37.3975 34.0519 37.4094C34.0296 37.4214 34.0069 37.4329 33.9839 37.4438C33.961 37.4546 33.9378 37.4649 33.9144 37.4747C33.8909 37.4844 33.8672 37.4936 33.8433 37.5022C33.8194 37.5107 33.7953 37.5187 33.771 37.5261C33.7467 37.5335 33.7223 37.5403 33.6977 37.5465C33.673 37.5527 33.6482 37.5583 33.6234 37.5633C33.5984 37.5683 33.5734 37.5727 33.5484 37.5765C33.5232 37.5802 33.498 37.5833 33.4727 37.5859C33.4475 37.5884 33.4222 37.5903 33.3968 37.5916C33.3714 37.5929 33.3461 37.5936 33.3207 37.5936C32.3886 37.5936 31.7682 36.9732 31.7682 36.0412L31.7682 31.2701C31.7682 30.3381 32.3886 29.7147 33.3207 29.7147ZM22.4446 31.2701L22.4446 36.0412C22.4446 36.8975 21.7485 37.5936 20.8892 37.5936C19.9572 37.5936 19.3367 36.9732 19.3367 36.0412L19.3367 31.2701C19.3367 30.3381 19.9572 29.7147 20.8892 29.7147C21.8213 29.7147 22.4446 30.3381 22.4446 31.2701ZM16.2289 31.2701L16.2289 36.0412C16.2288 36.0665 16.2282 36.0919 16.2269 36.1173C16.2256 36.1426 16.2237 36.168 16.2211 36.1932C16.2186 36.2185 16.2155 36.2437 16.2117 36.2688C16.2079 36.2939 16.2036 36.3189 16.1986 36.3438C16.1936 36.3687 16.188 36.3935 16.1818 36.4181C16.1756 36.4427 16.1688 36.4672 16.1614 36.4915C16.154 36.5158 16.146 36.5399 16.1374 36.5638C16.1288 36.5877 16.1197 36.6113 16.11 36.6348C16.1002 36.6583 16.0899 36.6815 16.079 36.7044C16.0681 36.7274 16.0567 36.75 16.0447 36.7724C16.0328 36.7948 16.0202 36.8168 16.0072 36.8386C15.994 36.8604 15.9804 36.8819 15.9664 36.903C15.9522 36.9241 15.9376 36.9448 15.9225 36.9652C15.9073 36.9856 15.8917 37.0056 15.8756 37.0253C15.8595 37.0449 15.8429 37.0641 15.8259 37.0829C15.8088 37.1017 15.7913 37.1201 15.7734 37.1381C15.7554 37.156 15.737 37.1735 15.7182 37.1906C15.6994 37.2076 15.6801 37.2242 15.6605 37.2404C15.6409 37.2564 15.6209 37.2721 15.6005 37.2872C15.5801 37.3024 15.5594 37.317 15.5382 37.3311C15.5171 37.3452 15.4957 37.3588 15.4739 37.3719C15.4521 37.385 15.43 37.3975 15.4077 37.4094C15.3853 37.4214 15.3626 37.4329 15.3397 37.4438C15.3167 37.4546 15.2935 37.4649 15.2701 37.4747C15.2466 37.4844 15.2229 37.4936 15.199 37.5022C15.1751 37.5107 15.151 37.5187 15.1268 37.5261C15.1025 37.5335 15.078 37.5403 15.0534 37.5465C15.0287 37.5527 15.0039 37.5583 14.9791 37.5633C14.9542 37.5683 14.9292 37.5727 14.9041 37.5765C14.8789 37.5802 14.8538 37.5833 14.8285 37.5859C14.8032 37.5884 14.7779 37.5903 14.7526 37.5916C14.7271 37.5929 14.7018 37.5936 14.6764 37.5936C13.7444 37.5936 13.1239 36.9732 13.1239 36.0412L13.1239 31.2701C13.1239 30.3381 13.7444 29.7147 14.6764 29.7147C15.6085 29.7147 16.2289 30.3381 16.2289 31.2701Z" fill="currentColor"/></svg>',distance:'<svg viewBox="0 0 32 32" aria-hidden="true"><g transform="translate(0 4.197)"><path fill="currentColor" d="M29.692,3.03,27.55.919a.529.529,0,0,1-.014-.756A.549.549,0,0,1,28.3.15l.014.013,3.067,3.023a.529.529,0,0,1,0,.756L28.317,6.966a.549.549,0,0,1-.767.013.529.529,0,0,1-.014-.756l.014-.013L29.692,4.1H2.31L4.452,6.21a.528.528,0,0,1,.013.756.547.547,0,0,1-.766.013l-.014-.013L.616,3.942a.531.531,0,0,1,0-.756L3.685.163a.548.548,0,0,1,.767.014.528.528,0,0,1,0,.742L2.31,3.03ZM24.136,15.055H23.051V18H21.966v-2.94H20.882V18H19.8v-2.94H18.712V18H17.627v-2.94H16.543v5.078H15.458V15.055H14.373V18H13.288v-2.94H12.2V18H11.119v-2.94H10.034V18H8.949v-2.94H7.865V18H6.78v-2.94H5.7v5.078H4.61V15.055H1.9a.27.27,0,0,0-.272.268v6.413A.269.269,0,0,0,1.9,22H30.1a.268.268,0,0,0,.271-.267V15.323a.269.269,0,0,0-.271-.268H27.39v5.078H26.305V15.055H25.221V18H24.136Zm5.966-1.6A1.884,1.884,0,0,1,32,15.323v6.413a1.885,1.885,0,0,1-1.9,1.871H1.9A1.885,1.885,0,0,1,0,21.736V15.323a1.885,1.885,0,0,1,1.9-1.871Z"/></g></svg>',elevation:'<svg viewBox="0 0 32 32" aria-hidden="true"><path fill="currentColor" d="M84.131,193.119a1.056,1.056,0,0,1,1.116.982v7.857a1.056,1.056,0,0,1-1.116.982H54.367a1.056,1.056,0,0,1-1.116-.982V194.1a1.056,1.056,0,0,1,1.116-.982Zm-1.116,1.964H55.483v5.893H83.015Zm1.116-13.749a1.064,1.064,0,0,1,1.114.935,1.032,1.032,0,0,1-1.007,1.025l-.107,0H71.2l-7.858,6.914a1.227,1.227,0,0,1-1.578,0l-8.185-7.2-.018-.016-.032-.031.049.047a1.107,1.107,0,0,1-.092-.092l-.011-.014a.869.869,0,0,1-.182-.857l0-.008L53.31,182l.012-.029.02-.045.019-.035a1.1,1.1,0,0,1,.891-.552h.007q.053,0,.107,0ZM68.043,183.3H57.06l5.492,4.831Z" transform="translate(-53.247 -176.136)"/></svg>',point:'<svg aria-hidden="true" viewBox="0 0 48 48"><path d="M40.1698 18.0929C40.1428 20.5301 39.3645 22.7586 38.3131 24.9092C36.7378 28.1319 34.6461 31.0118 32.3727 33.7664C30.2564 36.3308 27.9853 38.7519 25.5613 41.0284C24.7143 41.8237 23.9413 41.8481 23.073 41.0687C18.5767 37.0334 14.5359 32.6092 11.4515 27.3755C10.9495 26.5238 10.4945 25.6458 10.1025 24.7372C9.73107 23.8761 10.0514 22.9753 10.8534 22.6034C11.6577 22.2304 12.582 22.5576 12.9732 23.4086C14.8167 27.4176 17.5132 30.8241 20.4598 34.0548C21.596 35.3006 22.7863 36.4939 24.0184 37.6454C24.1708 37.7877 24.2667 37.9033 24.4831 37.6853C28.5664 33.5709 32.3892 29.2509 35.1723 24.1156C35.9836 22.6186 36.66 21.0543 36.8866 19.3498C37.2281 16.7802 36.712 14.3356 35.493 12.0807C33.1715 7.78618 29.5679 5.33714 24.6496 5.16445C19.0467 4.96786 14.0685 8.58606 12.3051 13.9294C11.8621 15.2717 11.6275 16.6474 11.6092 18.061C11.5962 19.0717 10.9335 19.7853 10.0201 19.783C9.10383 19.7808 8.43479 19.0505 8.43746 18.056C8.45818 10.5393 13.6357 4.02759 20.9324 2.34148C26.9693 0.946299 33.4364 3.45514 37.0904 8.60424C39.1088 11.4483 40.1115 14.6187 40.1698 18.0929ZM6.42075 43.1971C18.363 43.1971 30.2366 43.1971 42.1204 43.1971C42.1186 42.9919 41.9834 42.8579 41.8977 42.7076C40.3484 39.9866 38.7956 37.2673 37.2401 34.5498C36.9062 33.9668 36.8856 33.3861 37.257 32.8222C37.5915 32.314 38.0819 32.0681 38.6918 32.1099C39.2399 32.1477 39.6712 32.4169 39.9425 32.8899C42.0656 36.5932 44.1915 40.2948 46.2926 44.0105C46.9411 45.1576 46.1392 46.3818 44.7752 46.3821C37.6695 46.3845 30.564 46.3832 23.4585 46.3832C16.9643 46.3832 10.4699 46.3507 3.97625 46.4082C2.51885 46.4212 1.62531 45.0904 2.42647 43.7424C4.52293 40.2152 6.51577 36.6264 8.55216 33.0634C8.99072 32.2962 9.67627 31.9592 10.3942 32.1457C11.456 32.4219 11.9181 33.5491 11.3553 34.5444C10.2685 36.467 9.16594 38.3807 8.07099 40.2987C7.53258 41.2418 6.99643 42.1859 6.42075 43.1971ZM30.6461 17.8271C30.6465 21.3322 27.7864 24.1813 24.2754 24.1734C20.7946 24.1656 17.9554 21.3147 17.9555 17.8276C17.9557 14.3185 20.8087 11.4763 24.3244 11.4829C27.8051 11.4893 30.6458 14.3402 30.6461 17.8271ZM24.3201 14.6556C22.5583 14.656 21.1314 16.0714 21.1285 17.8213C21.1256 19.591 22.5741 21.0173 24.3575 21.0005C26.0699 20.9844 27.4807 19.5391 27.4733 17.8085C27.4659 16.0808 26.0403 14.6552 24.3201 14.6556Z" fill="currentColor"/></svg>',angle:'<svg viewBox="0 0 32 32" aria-hidden="true"><path fill="currentColor" d="M39.587,50.766h13.7a1,1,0,0,1,0,2H23.171a1,1,0,0,1,0-2h1.418l6.582-7.006v-.006a.517.517,0,0,1,.14-.357.456.456,0,0,1,.337-.144l12.1-12.876a.451.451,0,0,1,.665,0,.524.524,0,0,1,0,.708L32.883,43.355a8.3,8.3,0,0,1,6.7,7.411Zm-.949,0a7.254,7.254,0,0,0-6.611-6.5l-6.108,6.5Z" transform="translate(-22.229 -26.489)"/></svg>',area:'<svg aria-hidden="true" viewBox="0 0 48 48"><path d="M28.7725 16.8582L16.6882 28.9801C16.0335 29.6368 16.0335 30.7313 16.6882 31.3881C17.0156 31.7164 17.452 31.8806 17.8885 31.8806C18.3249 31.8806 18.7614 31.7164 19.0887 31.3881L31.173 19.2662C31.8277 18.6094 31.8277 17.5149 31.173 16.8582C30.5183 16.2015 29.4272 16.2015 28.7725 16.8582Z" fill="currentColor"/><path d="M44.5667 11.9055C45.385 11.9055 46.0397 11.2488 46.0397 10.4552L46.0397 3.47761C46.0397 2.65672 45.385 2 44.5667 2L37.6107 2C36.7924 2 36.1377 2.65672 36.1377 3.47761L36.1377 5.06468L11.9418 5.06468L11.9418 3.47761C11.9418 2.65672 11.2871 2 10.4688 2L3.51277 2C2.69442 2 2.03974 2.65672 2.03974 3.47761L2.03974 10.4279C2.03974 11.2488 2.69442 11.9055 3.51277 11.9055L5.20403 11.9055L5.20403 36.0671L3.51277 36.0671C2.69442 36.0671 2.03974 36.7239 2.03974 37.5448L2.03974 44.5224C2.03974 45.3433 2.69442 46 3.51277 46L10.4688 46C11.2598 46 11.9145 45.3433 11.9418 44.5224L11.9418 42.7438L36.1377 42.7438L36.1377 44.5224C36.1377 45.3433 36.7924 46 37.6107 46L44.5667 46C45.385 46 46.0397 45.3433 46.0397 44.5224L46.0397 37.5448C46.0397 36.7239 45.385 36.0671 44.5667 36.0671L42.7936 36.0671L42.7936 11.9055L44.5667 11.9055ZM39.0837 4.92786L43.0937 4.92786L43.0937 8.95024L39.0837 8.95024L39.0837 4.92786ZM4.9858 4.92786L8.99572 4.92786L8.99572 8.95024L4.9858 8.95024L4.9858 4.92786ZM8.99572 43.0448L4.9858 43.0448L4.9858 39.0224L8.99572 39.0224L8.99572 43.0448ZM43.0937 43.0448L39.0837 43.0448L39.0837 39.0224L43.0937 39.0224L43.0937 43.0448ZM39.3838 36.0671L37.6107 36.0671C36.7924 36.0671 36.1377 36.7239 36.1377 37.5448L36.1377 39.3234L11.9418 39.3234L11.9418 37.5448C11.9418 36.7239 11.2871 36.0671 10.4688 36.0671L8.61382 36.0671L8.61382 11.9055L10.4688 11.9055C11.2598 11.9055 11.9145 11.2488 11.9418 10.4552L11.9418 8.48507L36.1377 8.48507L36.1377 10.4279C36.1377 11.2488 36.7924 11.9055 37.6107 11.9055L39.3838 11.9055L39.3838 36.0671Z" fill="currentColor"/></svg>',slope:'<svg viewBox="0 0 32 32" aria-hidden="true"><path fill="currentColor" d="M202.1,188.337l2.629-2.191-8.447-3.106,1.533,8.871,2.629-2.194,9.341,11.209,1.656-1.379Zm-13.726-.435a1.075,1.075,0,0,0-1.07-.341,1.057,1.057,0,0,0-.5.277l-5.11,4.08a1.08,1.08,0,0,0-.406.84l-.007,17.386a1.079,1.079,0,0,0,1.077,1.077L205.7,211.2a1.078,1.078,0,0,0,.822-1.774Zm-4.934,21.164.007-15.788,3.968-3.171,15.974,18.941Z" transform="translate(-180.36 -181.131)"/></svg>'},dc={distance:{key:"distance",callBackType:"distance",icon:_a.distance,order:0},clearHeight:{key:"clearHeight",callBackType:"clear-height",icon:_a.clearHeight,order:1},clearDistance:{key:"clearDistance",callBackType:"clear-distance",icon:_a.clearDistance,order:2},elevation:{key:"elevation",callBackType:"elevation",icon:_a.elevation,order:3},point:{key:"point",callBackType:"point",icon:_a.point,order:4},angle:{key:"angle",callBackType:"angle",icon:_a.angle,order:5},area:{key:"area",callBackType:"area",icon:_a.area,order:6},slope:{key:"slope",callBackType:"slope",icon:_a.slope,order:7}},P2=Object.values(dc).sort((s,e)=>s.order-e.order).map(s=>s.key);function R2(s){switch(s){case"clearHeight":case"clearDistance":case"distance":case"elevation":return"length";case"area":return"area";case"angle":return"angle";case"slope":return"percent";default:return"point"}}function L2(s){return Object.values(dc).find(e=>e.callBackType===s)?.key}const Zz=["distance","clearHeight","clearDistance","elevation"],Yz=["point","angle","area","slope"],I2="bim-engine:measure:config",$z={unit:"mm",precision:2};class Kz{element;options;modeButtons=new Map;clearBtn;expandBtn;settingsBtn;secondaryRow;clearHeightOptions;clearHeightDirectionLabel;clearHeightSelectTypeLabel;directionButtons=new Map;selectTypeButtons=new Map;mainView;settingsView;settingsUnitLabel;settingsPrecisionLabel;settingsUnitSelect;settingsPrecisionSelect;settingsSaveBtn;settingsBackBtn;activeMode;isExpanded;clearHeightDirection;clearHeightSelectType;view="main";config;lockedWidthPx=null;constructor(e={}){this.options=e,this.activeMode=e.defaultMode??"distance",this.isExpanded=e.defaultExpanded??!1,this.clearHeightDirection=e.defaultClearHeightDirection??1,this.clearHeightSelectType=e.defaultClearHeightSelectType??"point",this.config=this.loadConfigFromCache()??{...$z};const{root:t,clearBtn:i,expandBtn:n,settingsBtn:r,secondaryRow:a,clearHeightOptions:o,clearHeightDirectionLabel:l,clearHeightSelectTypeLabel:c,mainView:h,settingsView:d,settingsUnitLabel:p,settingsPrecisionLabel:u,settingsUnitSelect:v,settingsPrecisionSelect:g,settingsSaveBtn:m,settingsBackBtn:f}=this.createDom();this.element=t,this.clearBtn=i,this.expandBtn=n,this.settingsBtn=r,this.secondaryRow=a,this.clearHeightOptions=o,this.clearHeightDirectionLabel=l,this.clearHeightSelectTypeLabel=c,this.mainView=h,this.settingsView=d,this.settingsUnitLabel=p,this.settingsPrecisionLabel=u,this.settingsUnitSelect=v,this.settingsPrecisionSelect=g,this.settingsSaveBtn=m,this.settingsBackBtn=f}init(){this.setLocales(),this.syncSettingsFormFromConfig(),this.applyExpandedState(),this.applyClearHeightOptionsState(),this.applyViewState(),this.syncActiveMode(this.activeMode)}setTheme(e){const t=this.element.style;t.setProperty("--bim-text-primary",e.textPrimary),t.setProperty("--bim-text-secondary",e.textSecondary),t.setProperty("--bim-text-tertiary",e.textTertiary),t.setProperty("--bim-border-default",e.borderDefault),t.setProperty("--bim-border-strong",e.borderStrong),t.setProperty("--bim-bg-inset",e.bgInset),t.setProperty("--bim-bg-elevated",e.bgElevated),t.setProperty("--bim-primary",e.primary),t.setProperty("--bim-primary-subtle",e.primarySubtle),t.setProperty("--bim-danger",e.danger),t.setProperty("--bim-component-bg-hover",e.componentBgHover)}setLocales(){for(const[n,r]of this.modeButtons.entries()){const a=Se(`measure.modes.${n}`);r.dataset.tooltip=a,r.setAttribute("aria-label",a)}const e=Se("measure.actions.clearAll");this.clearBtn.dataset.tooltip=e,this.clearBtn.setAttribute("aria-label",e);const t=this.isExpanded?Se("measure.actions.collapse"):Se("measure.actions.expand");delete this.expandBtn.dataset.tooltip,this.expandBtn.setAttribute("aria-label",t);const i=Se("measure.actions.settings");this.settingsBtn.dataset.tooltip=i,this.settingsBtn.setAttribute("aria-label",i),this.clearHeightDirectionLabel.textContent=Se("measure.clearHeight.direction"),this.clearHeightSelectTypeLabel.textContent=Se("measure.clearHeight.selectType"),this.directionButtons.get(0).textContent=Se("measure.clearHeight.directionDown"),this.directionButtons.get(1).textContent=Se("measure.clearHeight.directionUp"),this.selectTypeButtons.get("point").textContent=Se("measure.clearHeight.selectPoint"),this.selectTypeButtons.get("element").textContent=Se("measure.clearHeight.selectElement"),this.settingsUnitLabel.textContent=Se("measure.settings.unit"),this.settingsPrecisionLabel.textContent=Se("measure.settings.precision"),this.settingsSaveBtn.textContent=Se("measure.settings.save"),this.settingsBackBtn.textContent=Se("measure.settings.cancel")}switchMode(e,t=!0){this.activeMode=e,this.syncActiveMode(e),this.applyClearHeightOptionsState(),this.closeSettingsView(),t&&this.options.onModeChange?.(e),e==="clearHeight"&&(this.options.onClearHeightDirectionChange?.(this.clearHeightDirection),this.options.onClearHeightSelectTypeChange?.(this.clearHeightSelectType))}destroy(){this.element.remove()}getConfig(){return{...this.config}}createDom(){const e=document.createElement("div");e.className="measure-dock-panel";const t=document.createElement("div");t.className="measure-dock-panel-main";const i=document.createElement("div");i.className="measure-dock-clearheight-options";const n=document.createElement("div");n.className="measure-dock-clearheight-group";const r=document.createElement("span");r.className="measure-dock-clearheight-label";const a=document.createElement("div");a.className="measure-dock-clearheight-buttons";const o=this.createClearHeightOptionButton(()=>{this.setClearHeightDirection(0)}),l=this.createClearHeightOptionButton(()=>{this.setClearHeightDirection(1)});this.directionButtons.set(0,o),this.directionButtons.set(1,l),a.appendChild(o),a.appendChild(l),n.appendChild(r),n.appendChild(a);const c=document.createElement("div");c.className="measure-dock-clearheight-group";const h=document.createElement("span");h.className="measure-dock-clearheight-label";const d=document.createElement("div");d.className="measure-dock-clearheight-buttons";const p=this.createClearHeightOptionButton(()=>{this.setClearHeightSelectType("point")}),u=this.createClearHeightOptionButton(()=>{this.setClearHeightSelectType("element")});this.selectTypeButtons.set("point",p),this.selectTypeButtons.set("element",u),d.appendChild(p),d.appendChild(u),c.appendChild(h),c.appendChild(d),i.appendChild(n),i.appendChild(c);const v=document.createElement("div");v.className="measure-dock-panel-top";const g=document.createElement("div");g.className="measure-dock-panel-mode-zone";const m=document.createElement("div");m.className="measure-dock-panel-mode-row",Zz.forEach(k=>{m.appendChild(this.createModeButton(k))});const f=document.createElement("div");f.className="measure-dock-panel-mode-row measure-dock-panel-mode-row-secondary",Yz.forEach(k=>{f.appendChild(this.createModeButton(k))});const y=this.createIconButton("measure-dock-panel-action-clear",Tt("delete"));y.addEventListener("click",()=>{this.options.onClearAll?.()});const x=this.createIconButton("measure-dock-panel-action-settings",Tt("settings"));x.addEventListener("click",()=>{this.openSettingsView(),this.options.onSettings?.()}),m.appendChild(y),f.appendChild(x),g.appendChild(m),g.appendChild(f);const _=document.createElement("div");_.className="measure-dock-panel-actions";const S=this.createIconButton("measure-dock-panel-action-expand",Tt("expand"));S.addEventListener("click",()=>{this.isExpanded=!this.isExpanded,this.applyExpandedState(),this.setLocales()}),_.appendChild(S),v.appendChild(g),v.appendChild(_),t.appendChild(i),t.appendChild(v);const{settingsView:b,settingsUnitLabel:E,settingsPrecisionLabel:w,settingsUnitSelect:M,settingsPrecisionSelect:C,settingsSaveBtn:L,settingsBackBtn:P}=this.createSettingsView();return e.appendChild(t),e.appendChild(b),{root:e,clearBtn:y,expandBtn:S,settingsBtn:x,secondaryRow:f,clearHeightOptions:i,clearHeightDirectionLabel:r,clearHeightSelectTypeLabel:h,mainView:t,settingsView:b,settingsUnitLabel:E,settingsPrecisionLabel:w,settingsUnitSelect:M,settingsPrecisionSelect:C,settingsSaveBtn:L,settingsBackBtn:P}}createSettingsView(){const e=document.createElement("div");e.className="measure-dock-panel-settings";const t=document.createElement("div");t.className="measure-dock-settings-row";const i=document.createElement("span");i.className="measure-dock-settings-label";const n=document.createElement("select");n.className="measure-dock-settings-select",["m","cm","mm","km"].forEach(d=>{const p=document.createElement("option");p.value=d,p.textContent=d,n.appendChild(p)}),t.appendChild(i),t.appendChild(n);const r=document.createElement("div");r.className="measure-dock-settings-row";const a=document.createElement("span");a.className="measure-dock-settings-label";const o=document.createElement("select");o.className="measure-dock-settings-select",[0,1,2,3].forEach(d=>{const p=document.createElement("option");p.value=String(d),p.textContent=d===0?"0":`0.${"0".repeat(d)}`,o.appendChild(p)}),r.appendChild(a),r.appendChild(o);const l=document.createElement("div");l.className="measure-dock-settings-actions";const c=document.createElement("button");c.type="button",c.className="measure-dock-settings-btn is-save",c.addEventListener("click",()=>{this.saveSettings()});const h=document.createElement("button");return h.type="button",h.className="measure-dock-settings-btn is-back",h.addEventListener("click",()=>{this.closeSettingsView()}),l.appendChild(c),l.appendChild(h),e.appendChild(t),e.appendChild(r),e.appendChild(l),{settingsView:e,settingsUnitLabel:i,settingsPrecisionLabel:a,settingsUnitSelect:n,settingsPrecisionSelect:o,settingsSaveBtn:c,settingsBackBtn:h}}createClearHeightOptionButton(e){const t=document.createElement("button");return t.type="button",t.className="measure-dock-clearheight-btn",t.addEventListener("click",e),t}createModeButton(e){const t=document.createElement("button");return t.type="button",t.className="measure-dock-panel-mode-btn",t.dataset.mode=e,t.innerHTML=`<span class="measure-dock-panel-mode-icon">${dc[e].icon}</span>`,t.addEventListener("click",()=>{this.switchMode(e)}),this.modeButtons.set(e,t),t}createIconButton(e,t){const i=document.createElement("button");return i.type="button",i.className=`measure-dock-panel-action-btn ${e}`,i.innerHTML=t,i}applyExpandedState(){this.secondaryRow.style.display=this.isExpanded?"grid":"none",this.expandBtn.classList.toggle("is-expanded",this.isExpanded),this.expandBtn.classList.toggle("is-collapsed",!this.isExpanded)}openSettingsView(){this.lockPanelWidth(),this.view="settings",this.syncSettingsFormFromConfig(),this.applyViewState()}closeSettingsView(){this.view==="settings"&&(this.view="main",this.unlockPanelWidth(),this.applyViewState())}saveSettings(){const e=this.settingsUnitSelect.value,t=Number(this.settingsPrecisionSelect.value);!this.isValidUnit(e)||!this.isValidPrecision(t)||(this.config={unit:e,precision:t},this.saveConfigToCache(this.config),this.options.onConfigSave?.(this.getConfig()),this.view="main",this.unlockPanelWidth(),this.applyViewState())}lockPanelWidth(){const e=this.element.getBoundingClientRect().width;e<=0||(this.lockedWidthPx=Math.ceil(e),this.element.style.width=`${this.lockedWidthPx}px`)}unlockPanelWidth(){this.lockedWidthPx=null,this.element.style.removeProperty("width")}syncSettingsFormFromConfig(){this.settingsUnitSelect.value=this.config.unit,this.settingsPrecisionSelect.value=String(this.config.precision)}applyViewState(){const e=this.view==="main";this.mainView.style.display=e?"block":"none",this.settingsView.style.display=e?"none":"flex"}applyClearHeightOptionsState(){this.clearHeightOptions.classList.remove("is-visible");for(const[e,t]of this.directionButtons.entries())t.classList.toggle("is-active",e===this.clearHeightDirection);for(const[e,t]of this.selectTypeButtons.entries())t.classList.toggle("is-active",e===this.clearHeightSelectType)}setClearHeightDirection(e){this.clearHeightDirection!==e&&(this.clearHeightDirection=e,this.applyClearHeightOptionsState(),this.options.onClearHeightDirectionChange?.(e))}setClearHeightSelectType(e){this.clearHeightSelectType!==e&&(this.clearHeightSelectType=e,this.applyClearHeightOptionsState(),this.options.onClearHeightSelectTypeChange?.(e))}loadConfigFromCache(){try{const e=localStorage.getItem(I2);if(!e)return null;const t=JSON.parse(e);return!t||typeof t!="object"||!this.isValidUnit(t.unit)||!this.isValidPrecision(t.precision)?null:{unit:t.unit,precision:t.precision}}catch{return null}}saveConfigToCache(e){try{localStorage.setItem(I2,JSON.stringify(e))}catch{return}}isValidUnit(e){return e==="m"||e==="cm"||e==="mm"||e==="km"}isValidPrecision(e){return e===0||e===1||e===2||e===3}syncActiveMode(e){for(const[t,i]of this.modeButtons.entries())i.classList.toggle("is-active",t===e)}}class D2 extends jn{panel=null;unsubscribeTheme=null;unsubscribeLocale=null;unsubscribeDockState=null;unsubscribeMeasureEvents=null;constructor(e){super(e)}init(){this.unsubscribeTheme||(this.unsubscribeTheme=ct.subscribe(()=>{this.applyPresentation()})),this.unsubscribeLocale||(this.unsubscribeLocale=Zt.subscribe(()=>{this.applyPresentation()})),this.unsubscribeDockState||(this.unsubscribeDockState=this.registry.bottomDock?.onStateChange(e=>{if(e.id!=="measure"||e.open){e.id==="measure"&&e.open&&this.ensureMeasureEventSubscription();return}this.engineComponent?.deactivateMeasure()})??null),this.ensureMeasureEventSubscription()}destroy(){this.unsubscribeTheme&&(this.unsubscribeTheme(),this.unsubscribeTheme=null),this.unsubscribeLocale&&(this.unsubscribeLocale(),this.unsubscribeLocale=null),this.unsubscribeDockState&&(this.unsubscribeDockState(),this.unsubscribeDockState=null),this.unsubscribeMeasureEvents&&(this.unsubscribeMeasureEvents(),this.unsubscribeMeasureEvents=null),this.panel?.destroy(),this.panel=null,super.destroy()}getPanelElement(){if(this.ensureMeasureEventSubscription(),this.panel)this.panel.switchMode("distance");else{this.panel=new Kz({defaultMode:"distance",defaultExpanded:!1,defaultClearHeightDirection:1,defaultClearHeightSelectType:"point",onModeChange:t=>{this.engineComponent?.activateMeasure(t)},onClearAll:()=>{this.engineComponent?.clearAllMeasures()},onConfigSave:t=>{this.engineComponent?.saveMeasureSetting({unit:t.unit,precision:t.precision})},onClearHeightDirectionChange:t=>{this.engineComponent?.setClearHeightDirection(t)},onClearHeightSelectTypeChange:t=>{this.engineComponent?.setClearHeightSelectType(t)}}),this.panel.init(),this.panel.switchMode("distance"),this.engineComponent?.setClearHeightDirection(1),this.engineComponent?.setClearHeightSelectType("point");const e=this.panel.getConfig();this.engineComponent?.saveMeasureSetting({unit:e.unit,precision:e.precision})}return this.applyPresentation(),this.panel.element}ensureMeasureEventSubscription(){if(this.unsubscribeMeasureEvents)return;const e=this.engineComponent;if(!e){console.warn("[MeasureDockManager] skip callback binding: engine component not ready yet");return}const t=n=>{this.handleMeasureCallback("measure-changed",n)},i=n=>{this.handleMeasureCallback("measure-click",n)};e.onRawEvent("measure-changed",t),e.onRawEvent("measure-click",i),this.unsubscribeMeasureEvents=()=>{e.offRawEvent("measure-changed",t),e.offRawEvent("measure-click",i)},console.log("[MeasureDockManager] raw event callbacks bound")}applyPresentation(){this.panel&&(this.panel.setTheme(ct.getTheme()),this.panel.setLocales())}handleMeasureCallback(e,t){const i=this.registry.bottomDock?.isOpen("measure")??!1,n=L2(t.type);if(console.log("[MeasureDockManager] callback received",{event:e,type:t.type,mode:n,dockOpen:i,hasPanel:!!this.panel}),!i){console.log("[MeasureDockManager] skip mode switch: measure dock is closed");return}if(!n||!this.panel){console.log("[MeasureDockManager] skip mode switch: invalid mode or panel not ready");return}this.panel.switchMode(n,!1),this.engineComponent?.activateMeasure(n),console.log("[MeasureDockManager] switched mode by callback",{event:e,mode:n})}}class Jz{element;options;typeButtons=new Map;axisButtons=new Map;toolContainer;axisPanel;divider;activeType;activeAxis;isHidden;constructor(e={}){this.options=e,this.activeType=e.defaultType??null,this.activeAxis=e.defaultAxis??"x",this.isHidden=e.defaultHidden??!1;const{root:t,toolContainer:i,axisPanel:n,divider:r}=this.createDom();this.element=t,this.toolContainer=i,this.axisPanel=n,this.divider=r}init(){this.applyTypeState(),this.applyAxisState(),this.renderTools(),this.setLocales()}setTheme(e){const t=this.element.style;t.setProperty("--bim-text-primary",e.textPrimary),t.setProperty("--bim-text-secondary",e.textSecondary),t.setProperty("--bim-border-default",e.borderDefault),t.setProperty("--bim-border-strong",e.borderStrong),t.setProperty("--bim-bg-inset",e.bgInset),t.setProperty("--bim-bg-elevated",e.bgElevated),t.setProperty("--bim-primary",e.primary),t.setProperty("--bim-primary-subtle",e.primarySubtle),t.setProperty("--bim-component-bg-hover",e.componentBgHover)}setLocales(){this.typeButtons.get("face").dataset.tooltip=Se("toolbar.sectionPlane"),this.typeButtons.get("axis").dataset.tooltip=Se("toolbar.sectionAxis"),this.typeButtons.get("box").dataset.tooltip=Se("toolbar.sectionBox"),this.axisButtons.get("x").dataset.label="X",this.axisButtons.get("y").dataset.label="Y",this.axisButtons.get("z").dataset.label="Z",this.typeButtons.forEach(e=>{e.setAttribute("aria-label",e.dataset.tooltip??"")}),this.axisButtons.forEach(e=>{e.setAttribute("aria-label",e.dataset.label??"")}),this.renderTools()}destroy(){this.element.remove()}resetForOpen(){this.activeType=null,this.isHidden=!1,this.applyTypeState(),this.renderTools()}getActiveType(){return this.activeType}getActiveAxis(){return this.activeAxis}createDom(){const e=document.createElement("div");e.className="section-dock-panel";const t=document.createElement("div");t.className="section-dock-axis-panel",["x","y","z"].forEach(h=>{const d=document.createElement("button");d.type="button",d.className="section-dock-axis-btn",d.textContent=h.toUpperCase(),d.addEventListener("click",()=>{this.handleAxisChange(h)}),this.axisButtons.set(h,d),t.appendChild(d)});const i=document.createElement("div");i.className="section-dock-main";const n=document.createElement("div");n.className="section-dock-types";const r=this.createTypeButton("face",Tt("拾曲面剖切")),a=this.createTypeButton("axis",Tt("轴向剖切")),o=this.createTypeButton("box",Tt("剖切盒"));n.appendChild(r),n.appendChild(a),n.appendChild(o);const l=document.createElement("div");l.className="section-dock-divider";const c=document.createElement("div");return c.className="section-dock-tools",i.appendChild(n),i.appendChild(l),i.appendChild(c),e.appendChild(t),e.appendChild(i),{root:e,toolContainer:c,axisPanel:t,divider:l}}createTypeButton(e,t){const i=document.createElement("button");i.type="button",i.className="section-dock-type-btn";const n=document.createElement("span");return n.className="section-dock-type-icon",n.innerHTML=t,i.appendChild(n),i.addEventListener("click",()=>{this.handleTypeChange(e)}),this.typeButtons.set(e,i),i}handleTypeChange(e){this.activeType!==e&&(this.activeType=e,this.applyTypeState(),this.renderTools(),this.isHidden&&(this.isHidden=!1,this.options.onHideToggle?.(!1)),this.options.onTypeChange?.(e,this.activeAxis))}handleAxisChange(e){this.activeAxis!==e&&(this.activeAxis=e,this.applyAxisState(),this.activeType==="axis"&&this.options.onAxisChange?.(e))}applyTypeState(){this.typeButtons.forEach((t,i)=>{t.classList.toggle("is-active",i===this.activeType)});const e=this.activeType==="axis";this.axisPanel.classList.toggle("is-visible",e)}applyAxisState(){this.axisButtons.forEach((e,t)=>{e.classList.toggle("is-active",t===this.activeAxis)})}renderTools(){if(this.toolContainer.innerHTML="",!this.activeType){this.divider.classList.add("is-hidden");return}this.divider.classList.remove("is-hidden"),this.getToolsForType(this.activeType).forEach(e=>{const t=document.createElement("button");t.type="button",t.className="section-dock-tool-btn",e.isActive&&t.classList.add("is-active");const i=document.createElement("span");i.className="section-dock-tool-icon",i.innerHTML=Tt(e.iconName),t.appendChild(i);const n=Se(e.textKey);t.dataset.tooltip=n,t.setAttribute("aria-label",n),t.addEventListener("click",e.onClick),this.toolContainer.appendChild(t)})}getToolsForType(e){const t={key:"hide",iconName:"隐藏",textKey:e==="box"?"sectionBox.actions.hide":e==="axis"?"sectionAxis.actions.hide":"sectionPlane.actions.hide",isActive:this.isHidden,onClick:()=>{this.isHidden=!this.isHidden,this.options.onHideToggle?.(this.isHidden),this.renderTools()}},i={key:"reverse",iconName:"反向",textKey:e==="axis"?"sectionAxis.actions.reverse":e==="box"?"sectionBox.actions.reverse":"sectionPlane.actions.reverse",onClick:()=>{this.options.onReverse?.()}};return e==="axis"?[t,i,{key:"reset",iconName:"重置",textKey:"sectionAxis.actions.reset",onClick:()=>{this.isHidden=!1,this.options.onReset?.(e,this.activeAxis),this.renderTools()}}]:e==="box"?[t,{key:"fit",iconName:"适应到模型",textKey:"sectionBox.actions.fitToModel",onClick:()=>{this.options.onFitToModel?.()}},{key:"reset",iconName:"重置",textKey:"sectionBox.actions.reset",onClick:()=>{this.isHidden=!1,this.options.onReset?.(e,this.activeAxis),this.renderTools()}}]:[t,i,{key:"reset",iconName:"重置",textKey:"sectionPlane.actions.reset",onClick:()=>{this.isHidden=!1,this.options.onReset?.(e,this.activeAxis),this.renderTools()}}]}}class N2 extends jn{panel=null;unsubscribeTheme=null;unsubscribeLocale=null;unsubscribeDockState=null;constructor(e){super(e)}init(){this.unsubscribeTheme||(this.unsubscribeTheme=ct.subscribe(()=>{this.applyPresentation()})),this.unsubscribeLocale||(this.unsubscribeLocale=Zt.subscribe(()=>{this.applyPresentation()})),this.unsubscribeDockState||(this.unsubscribeDockState=this.registry.bottomDock?.onStateChange(e=>{if(e.id==="section"){if(!e.open){console.log("deactivateSection"),this.engineComponent?.deactivateSection();return}this.panel?.resetForOpen()}})??null)}destroy(){this.unsubscribeTheme&&(this.unsubscribeTheme(),this.unsubscribeTheme=null),this.unsubscribeLocale&&(this.unsubscribeLocale(),this.unsubscribeLocale=null),this.unsubscribeDockState&&(this.unsubscribeDockState(),this.unsubscribeDockState=null),this.panel?.destroy(),this.panel=null,super.destroy()}getPanelElement(){return this.panel||(this.panel=new Jz({defaultType:null,defaultAxis:"x",defaultHidden:!1,onTypeChange:(e,t)=>{this.activateByType(e,t)},onAxisChange:e=>{this.panel?.getActiveType()==="axis"&&this.engineComponent?.activeSection(e)},onHideToggle:e=>{if(e){this.engineComponent?.hideSection();return}this.engineComponent?.recoverSection()},onReverse:()=>{this.engineComponent?.reverseSection()},onReset:(e,t)=>{this.engineComponent?.deactivateSection(),this.activateByType(e,t)},onFitToModel:()=>{this.engineComponent?.scaleSectionBox()}}),this.panel.init()),this.panel.resetForOpen(),this.applyPresentation(),this.panel.element}activateByType(e,t){if(e==="face"){this.engineComponent?.activeSection("face");return}if(e==="box"){this.engineComponent?.activeSection("box");return}this.engineComponent?.activeSection(t)}applyPresentation(){this.panel&&(this.panel.setTheme(ct.getTheme()),this.panel.setLocales())}}class k2{element;options;state={mode:"none",isPlanViewActive:!1,speed:1,gravity:!1,collision:!1,characterModel:"construction-worker",walkMode:"walk"};planViewBtn;pathModeBtn;settingsContainer;speedControl;speedDecreaseBtn;speedIncreaseBtn;speedDisplay;gravityCheckbox;gravityLabel;collisionCheckbox;collisionLabel;characterModelSelect;characterModelLabel;walkModeSelect;walkModeLabel;exitBtn;unsubscribeLocale=null;unsubscribeTheme=null;constructor(e={}){this.options=e,this.state.speed=e.defaultSpeed??1,this.state.gravity=e.defaultGravity??!1,this.state.collision=e.defaultCollision??!1,this.state.characterModel=e.defaultCharacterModel??"construction-worker",this.state.walkMode=e.defaultWalkMode??"walk"}init(){this.element=this.createPanel(),this.updateSettingsView(),this.unsubscribeLocale=Zt.subscribe(()=>this.setLocales()),this.unsubscribeTheme=ct.subscribe(e=>this.setTheme(e)),this.setLocales(),this.setTheme(ct.getTheme())}setPlanViewActive(e){this.state.isPlanViewActive=e,this.updateButtonStates()}setPathModeActive(e){if(!e&&this.state.mode!=="path")return;const t=e?"path":"none";this.setMode(t)}getState(){return{...this.state}}createPanel(){const e=document.createElement("div");e.className="walk-control-panel";const t=this.createLeftButtons(),i=document.createElement("div");i.className="walk-divider",this.settingsContainer=this.createSettingsContainer();const n=document.createElement("div");n.className="walk-divider";const r=this.createExitButton();return e.appendChild(t),e.appendChild(i),e.appendChild(this.settingsContainer),e.appendChild(n),e.appendChild(r),e}createLeftButtons(){const e=document.createElement("div");return e.className="walk-control-left",this.planViewBtn=this.createIconButton("plan-view",()=>{this.state.isPlanViewActive=!this.state.isPlanViewActive,this.updateButtonStates(),this.options.onPlanViewToggle?.(this.state.isPlanViewActive)}),this.pathModeBtn=this.createIconButton("path",()=>{const t=this.state.mode==="path"?"none":"path";this.setMode(t),this.options.onPathModeToggle?.(t==="path")}),e.appendChild(this.planViewBtn),e.appendChild(this.pathModeBtn),e}createSettingsContainer(){const e=document.createElement("div");e.className="walk-control-settings",this.speedControl=this.createSpeedControl();const t=document.createElement("label");t.className="walk-checkbox-wrapper walk-checkbox-gravity",this.gravityCheckbox=document.createElement("input"),this.gravityCheckbox.type="checkbox",this.gravityCheckbox.className="walk-checkbox",this.gravityCheckbox.checked=this.state.gravity,this.gravityCheckbox.addEventListener("change",()=>{this.state.gravity=this.gravityCheckbox.checked,this.options.onGravityToggle?.(this.state.gravity)}),this.gravityLabel=document.createElement("span"),this.gravityLabel.className="walk-checkbox-label",t.appendChild(this.gravityCheckbox),t.appendChild(this.gravityLabel);const i=document.createElement("label");i.className="walk-checkbox-wrapper walk-checkbox-collision",this.collisionCheckbox=document.createElement("input"),this.collisionCheckbox.type="checkbox",this.collisionCheckbox.className="walk-checkbox",this.collisionCheckbox.checked=this.state.collision,this.collisionCheckbox.addEventListener("change",()=>{this.state.collision=this.collisionCheckbox.checked,this.options.onCollisionToggle?.(this.state.collision)}),this.collisionLabel=document.createElement("span"),this.collisionLabel.className="walk-checkbox-label",i.appendChild(this.collisionCheckbox),i.appendChild(this.collisionLabel);const n=document.createElement("div");n.className="walk-select-wrapper walk-select-wrapper-character-model",this.characterModelLabel=document.createElement("label"),this.characterModelLabel.className="walk-select-label",this.characterModelSelect=document.createElement("select"),this.characterModelSelect.className="walk-select walk-select-character-model",this.characterModelSelect.addEventListener("change",()=>{this.state.characterModel=this.characterModelSelect.value,this.options.onCharacterModelChange?.(this.state.characterModel)}),n.appendChild(this.characterModelLabel),n.appendChild(this.characterModelSelect);const r=document.createElement("div");return r.className="walk-select-wrapper walk-select-wrapper-walk-mode",this.walkModeLabel=document.createElement("label"),this.walkModeLabel.className="walk-select-label",this.walkModeSelect=document.createElement("select"),this.walkModeSelect.className="walk-select walk-select-walk-mode",this.walkModeSelect.addEventListener("change",()=>{this.state.walkMode=this.walkModeSelect.value,this.options.onWalkModeChange?.(this.state.walkMode)}),r.appendChild(this.walkModeLabel),r.appendChild(this.walkModeSelect),e.appendChild(this.speedControl),e.appendChild(n),e.appendChild(r),e.appendChild(t),e.appendChild(i),e}createSpeedControl(){const e=document.createElement("div");e.className="walk-speed-control";const t=document.createElement("label");t.className="walk-speed-label",t.textContent=Se("walkControl.speed");const i=document.createElement("div");return i.className="walk-speed-group",this.speedDecreaseBtn=document.createElement("button"),this.speedDecreaseBtn.className="walk-speed-btn",this.speedDecreaseBtn.textContent="-",this.speedDecreaseBtn.addEventListener("click",()=>{this.state.speed>1&&(this.state.speed--,this.updateSpeedDisplay(),this.options.onSpeedChange?.(this.state.speed))}),this.speedDisplay=document.createElement("div"),this.speedDisplay.className="walk-speed-display",this.speedDisplay.textContent=`${this.state.speed}X`,this.speedIncreaseBtn=document.createElement("button"),this.speedIncreaseBtn.className="walk-speed-btn",this.speedIncreaseBtn.textContent="+",this.speedIncreaseBtn.addEventListener("click",()=>{this.state.speed<10&&(this.state.speed++,this.updateSpeedDisplay(),this.options.onSpeedChange?.(this.state.speed))}),i.appendChild(this.speedDecreaseBtn),i.appendChild(this.speedDisplay),i.appendChild(this.speedIncreaseBtn),e.appendChild(t),e.appendChild(i),e}createIconButton(e,t){const i=document.createElement("button");return i.className=`walk-icon-btn walk-icon-btn-${e}`,i.innerHTML=this.getIconSVG(e),i.addEventListener("click",t),i}createExitButton(){const e=document.createElement("button");return e.className="walk-exit-btn",e.addEventListener("click",()=>{this.options.onExit?.()}),this.exitBtn=e,e}setMode(e){const t=this.state.mode;t==="walk"&&e!=="walk"&&this.options.onWalkModeToggle?.(!1),t==="path"&&e!=="path"&&this.options.onPathModeToggle?.(!1),this.state.mode=e,e==="path"?(this.state.gravity=!1,this.state.collision=!1,this.gravityCheckbox.checked=!1,this.gravityCheckbox.disabled=!0,this.collisionCheckbox.checked=!1,this.collisionCheckbox.disabled=!0):(this.gravityCheckbox.disabled=!1,this.collisionCheckbox.disabled=!1),this.updateButtonStates(),this.updateSettingsView(),this.updateSpeedButtonStates()}updateButtonStates(){this.planViewBtn.classList.toggle("active",this.state.isPlanViewActive),this.pathModeBtn.classList.toggle("active",this.state.mode==="path")}updateSettingsView(){const e=this.speedControl,t=this.gravityCheckbox.parentElement,i=this.collisionCheckbox.parentElement,n=this.characterModelSelect.parentElement,r=this.walkModeSelect.parentElement;this.state.mode==="walk"?(e.style.display="none",t.style.display="flex",i.style.display="flex",n.style.display="flex",r.style.display="flex"):(e.style.display="flex",t.style.display="flex",i.style.display="flex",n.style.display="none",r.style.display="none")}updateSpeedDisplay(){this.speedDisplay.textContent=`${this.state.speed}X`,this.updateSpeedButtonStates()}updateSpeedButtonStates(){this.speedDecreaseBtn.disabled=this.state.speed<=1,this.speedIncreaseBtn.disabled=this.state.speed>=10}getIconSVG(e){return{"plan-view":Tt("地图"),path:Tt("路径漫游"),walk:Tt("第一人称漫游")}[e]||""}setLocales(){const e=this.speedControl.querySelector(".walk-speed-label");e&&(e.textContent=Se("walkControl.speed")),this.gravityLabel.textContent=Se("walkControl.gravity"),this.collisionLabel.textContent=Se("walkControl.collision"),this.characterModelLabel.textContent=Se("walkControl.characterModel.label"),this.characterModelSelect.innerHTML="";const t=document.createElement("option");t.value="construction-worker",t.textContent=Se("walkControl.characterModel.constructionWorker"),t.selected=this.state.characterModel==="construction-worker",this.characterModelSelect.appendChild(t);const i=document.createElement("option");i.value="office-male",i.textContent=Se("walkControl.characterModel.officeMale"),i.selected=this.state.characterModel==="office-male",this.characterModelSelect.appendChild(i),this.walkModeLabel.textContent=Se("walkControl.walkMode.label"),this.walkModeSelect.innerHTML="";const n=document.createElement("option");n.value="walk",n.textContent=Se("walkControl.walkMode.walk"),n.selected=this.state.walkMode==="walk",this.walkModeSelect.appendChild(n);const r=document.createElement("option");r.value="run",r.textContent=Se("walkControl.walkMode.run"),r.selected=this.state.walkMode==="run",this.walkModeSelect.appendChild(r),this.exitBtn.textContent=Se("walkControl.exit")}setTheme(e){if(!this.element)return;const t=this.element.style;t.setProperty("--bim-bg-base",e.bgBase??"#152232"),t.setProperty("--bim-bg-elevated",e.bgElevated??"#1f2d3e"),t.setProperty("--bim-bg-inset",e.bgInset??"#152232"),t.setProperty("--bim-border-default",e.borderDefault??"#334155"),t.setProperty("--bim-border-strong",e.borderStrong??"#475569"),t.setProperty("--bim-border-subtle",e.borderSubtle??"#1e293b"),t.setProperty("--bim-divider",e.divider??"#334155"),t.setProperty("--bim-shadow-xl",e.shadowXl??"0 20px 40px rgba(0, 0, 0, 0.3)"),t.setProperty("--bim-primary",e.primary??"#3b82f6"),t.setProperty("--bim-primary-hover",e.primaryHover??"#60a5fa"),t.setProperty("--bim-primary-subtle",e.primarySubtle??"rgba(59, 130, 246, 0.15)"),t.setProperty("--bim-text-primary",e.textPrimary??"#ffffff"),t.setProperty("--bim-text-inverse",e.textInverse??"#152232"),t.setProperty("--bim-icon-default",e.iconDefault??"#ffffff"),t.setProperty("--bim-component-bg-hover",e.componentBgHover??"rgba(248, 250, 252, 0.06)"),t.setProperty("--bim-component-bg-active",e.componentBgActive??"rgba(248, 250, 252, 0.1)")}destroy(){this.unsubscribeLocale?.(),this.unsubscribeTheme?.(),this.element&&this.element.parentElement&&this.element.parentElement.removeChild(this.element)}}class Qz{element;panel;constructor(e={}){this.panel=new k2(e),this.panel.init(),this.element=this.panel.element,this.element.classList.add("walk-dock-panel")}init(){}setPlanViewActive(e){this.panel.setPlanViewActive(e)}setLocales(){this.panel.setLocales()}setTheme(e){this.panel.setTheme(e)}getState(){return this.panel.getState()}destroy(){this.panel.destroy()}}class No extends jn{dialog=null;isVisible=!1;constructor(e){super(e)}get dialogWidth(){return 300}get dialogHeight(){return"auto"}get dialogOptions(){return{draggable:!0,resizable:!1}}onDialogClose(){}onDialogCreated(){}onBeforeDestroy(){}getDialogPosition(){const e=this.registry.container;if(!e)return{x:100,y:100};const t=e.clientWidth,i=e.clientHeight,n=this.dialogWidth,r=typeof this.dialogHeight=="number"?this.dialogHeight:300;return{x:t-n-20,y:(i-r)/2}}show(){if(!this.registry.dialog||!this.registry.container){console.warn(`[${this.dialogId}] Dialog manager or container is not initialized`);return}this.dialog&&this.destroyDialog();const e=this.getDialogPosition(),t=this.createContent(),i=this.dialogOptions;this.dialog=this.registry.dialog.create({id:this.dialogId,title:this.dialogTitle,content:t,width:this.dialogWidth,height:this.dialogHeight,position:e,draggable:i.draggable,resizable:i.resizable,onClose:()=>{this.onDialogClose(),this.destroyDialog()}}),this.dialog.init(),this.isVisible=!0,this.onDialogCreated()}hide(){this.destroyDialog()}toggle(){this.isVisible?this.hide():this.show()}isOpen(){return this.isVisible}destroyDialog(){this.onBeforeDestroy(),this.dialog&&(this.dialog.destroy(),this.dialog=null),this.isVisible=!1}destroy(){this.destroyDialog(),super.destroy()}}class e9{element;registry;unsubscribeLocale=null;unsubscribeTheme=null;constructor(e){this.registry=e}points=[];duration=1e4;loop=!1;playingPointIndex=-1;isPlaying=!1;init(){this.element=document.createElement("div"),this.element.className="walk-path-panel",this.unsubscribeLocale=Zt.subscribe(()=>this.render()),this.unsubscribeTheme=ct.subscribe(e=>this.setTheme(e)),this.loadPointsFromEngine(),this.render(),this.setTheme(ct.getTheme())}loadPointsFromEngine(){const e=this.registry.engine3d?.getEngineComponent()?.pathRoamingGetPoints()??[];this.points=e.map((t,i)=>({index:i}))}render(){this.element.innerHTML="";const e=this.createSettingsSection();this.element.appendChild(e);const t=this.createPointsSection();this.element.appendChild(t);const i=this.createPlayButton();this.element.appendChild(i)}createSettingsSection(){const e=document.createElement("div");e.className="walk-path-settings";const t=document.createElement("div");t.className="walk-path-form-group";const i=document.createElement("label");i.textContent=Se("walkControl.path.duration");const n=document.createElement("div");n.className="walk-path-input-wrapper";const r=document.createElement("input");r.type="number",r.className="walk-path-input",r.value=String(this.duration/1e3),r.min="1",r.oninput=h=>{const d=parseInt(h.target.value)||1;this.duration=d*1e3};const a=document.createElement("span");a.className="walk-path-unit",a.textContent=Se("walkControl.path.durationUnit"),n.appendChild(r),n.appendChild(a),t.appendChild(i),t.appendChild(n);const o=document.createElement("div");o.className="walk-path-form-group walk-path-form-group-inline";const l=document.createElement("input");l.type="checkbox",l.id="walk-path-loop-checkbox",l.className="walk-path-checkbox",l.checked=this.loop,l.onchange=h=>{this.loop=h.target.checked};const c=document.createElement("label");return c.htmlFor="walk-path-loop-checkbox",c.textContent=Se("walkControl.path.loop"),o.appendChild(l),o.appendChild(c),e.appendChild(t),e.appendChild(o),e}createPointsSection(){const e=document.createElement("div");e.className="walk-path-points-section";const t=document.createElement("div");t.className="walk-path-points-toolbar";const i=document.createElement("button");i.className="walk-path-btn walk-path-btn-small",i.textContent=`+ ${Se("walkControl.path.addPoint")}`,i.onclick=()=>this.addPoint();const n=document.createElement("button");n.className="walk-path-btn walk-path-btn-small walk-path-btn-danger",n.textContent=Se("walkControl.path.deleteAll"),n.onclick=()=>this.deleteAllPoints(),t.appendChild(i),t.appendChild(n),e.appendChild(t);const r=document.createElement("div");if(r.className="walk-path-points-list",this.points.length===0){const a=document.createElement("div");a.className="walk-path-empty",a.textContent=Se("walkControl.path.noPoints"),r.appendChild(a)}else this.points.forEach((a,o)=>{const l=this.createPointItem(o);r.appendChild(l)});return e.appendChild(r),e}createPointItem(e){const t=document.createElement("div");t.className="walk-path-point-item",this.playingPointIndex===e&&t.classList.add("walk-path-point-item-active");const i=document.createElement("span");i.className="walk-path-point-name",i.textContent=`${Se("walkControl.path.point")}${e}`;const n=document.createElement("div");n.className="walk-path-point-actions";const r=document.createElement("button");r.className="walk-path-btn-icon",r.innerHTML="▶",r.title=Se("walkControl.path.play"),r.onclick=o=>{o.stopPropagation(),this.jumpToPoint(e)};const a=document.createElement("button");return a.className="walk-path-btn-icon walk-path-btn-icon-danger",a.innerHTML="×",a.onclick=o=>{o.stopPropagation(),this.deletePoint(e)},n.appendChild(r),n.appendChild(a),t.appendChild(i),t.appendChild(n),t}createPlayButton(){const e=document.createElement("div");e.className="walk-path-btn-group";const t=document.createElement("button");t.className="walk-path-btn walk-path-btn-play",t.textContent=`▶ ${Se("walkControl.path.play")}`,t.disabled=this.points.length===0||this.isPlaying,t.onclick=()=>this.playPath();const i=document.createElement("button");return i.className="walk-path-btn walk-path-btn-stop",i.textContent=`■ ${Se("walkControl.path.stop")}`,i.disabled=!this.isPlaying,i.onclick=()=>this.stopPath(),e.appendChild(t),e.appendChild(i),e}addPoint(){this.registry.engine3d?.getEngineComponent()?.pathRoamingAddPoint();const e=this.points.length;this.points.push({index:e}),this.render()}deletePoint(e){this.registry.engine3d?.getEngineComponent()?.pathRoamingRemovePoint(e),this.points.splice(e,1),this.points.forEach((t,i)=>t.index=i),this.render()}deleteAllPoints(){this.registry.engine3d?.getEngineComponent()?.pathRoamingClearPoints(),this.points=[],this.render()}jumpToPoint(e){this.registry.engine3d?.getEngineComponent()?.pathRoamingJumpToPoint(e)}playPath(){this.points.length!==0&&(this.isPlaying=!0,this.render(),console.log("[WalkPathPanel] 开始播放漫游",{duration:this.duration,loop:this.loop,pointsCount:this.points.length}),this.registry.engine3d?.getEngineComponent()?.pathRoamingPlay({duration:this.duration,loop:this.loop,onPointComplete:e=>{console.log("[WalkPathPanel] onPointComplete",{pointIndex:e}),this.playingPointIndex=e,this.render()},onComplete:()=>{console.log("[WalkPathPanel] onComplete 播放完成"),this.isPlaying=!1,this.playingPointIndex=-1,this.render()}}))}stopPath(){console.log("[WalkPathPanel] 停止漫游"),this.registry.engine3d?.getEngineComponent()?.pathRoamingStop(),this.isPlaying=!1,this.playingPointIndex=-1,this.render()}setLocales(){this.render()}setTheme(e){this.element&&(this.element.style.setProperty("--bim-text-primary",e.textPrimary??"#fff"),this.element.style.setProperty("--bim-text-secondary",e.textPrimary??"#fff"),this.element.style.setProperty("--bim-bg-elevated",e.bgElevated??"#1f2d3e"),this.element.style.setProperty("--bim-border-default",e.borderDefault??"#334155"),this.element.style.setProperty("--bim-primary",e.primary??"#3b82f6"))}destroy(){this.isPlaying&&this.stopPath(),this.unsubscribeLocale?.(),this.unsubscribeTheme?.(),this.element?.parentElement&&this.element.parentElement.removeChild(this.element)}}class O2 extends No{panel=null;constructor(e){super(e)}get dialogId(){return"walk-path-dialog"}get dialogTitle(){return"walkControl.path.dialogTitle"}get dialogWidth(){return 300}get dialogHeight(){return 450}init(){}getDialogPosition(){const e=this.registry.container;return e?{x:e.clientWidth-this.dialogWidth-20,y:20}:{x:100,y:100}}createContent(){return this.panel=new e9(this.registry),this.panel.init(),this.panel.element}onDialogClose(){this.registry.walkControl&&this.registry.walkControl.panel&&this.registry.walkControl.panel.setPathModeActive(!1)}onBeforeDestroy(){this.panel&&(this.panel.destroy(),this.panel=null)}}class U2 extends jn{panel=null;pathManager=null;unsubscribeDockState=null;constructor(e){super(e)}init(){this.pathManager=new O2(this.registry),this.pathManager.init(),this.unsubscribeDockState||(this.unsubscribeDockState=this.registry.bottomDock?.onStateChange(e=>{if(e.id==="walk"){if(e.open){this.onOpen();return}this.onClose()}})??null)}destroy(){this.unsubscribeDockState&&(this.unsubscribeDockState(),this.unsubscribeDockState=null),this.onClose(),this.pathManager?.destroy(),this.pathManager=null,super.destroy()}getPanelElement(){return this.panel||(this.panel=new Qz({onPlanViewToggle:e=>{this.engineComponent?.toggleMiniMap(),this.registry.toolbar?.setBtnActive("map",e),this.emit("walk:plan-view-toggle",{isActive:e})},onPathModeToggle:e=>{e?this.pathManager?.show():this.pathManager?.hide(),this.emit("walk:path-mode-toggle",{isActive:e})},onWalkModeToggle:e=>{e&&this.pathManager?.hide(),this.emit("walk:walk-mode-toggle",{isActive:e})},onSpeedChange:e=>{const t=e*.1;this.engineComponent?.setWalkSpeed(t),this.emit("walk:speed-change",{speed:e})},onGravityToggle:e=>{this.engineComponent?.setWalkGravity(e),this.emit("walk:gravity-toggle",{enabled:e})},onCollisionToggle:e=>{this.engineComponent?.setWalkCollision(e),this.emit("walk:collision-toggle",{enabled:e})},onCharacterModelChange:e=>{},onWalkModeChange:e=>{},onExit:()=>{this.registry.bottomDock?.close("walk")}}),this.panel.init()),this.syncMapState(),this.panel.element}onOpen(){this.engineComponent?.activateFirstPersonMode(),this.syncMapState()}onClose(){this.pathManager?.hide(),this.engineComponent?.getMiniMapState()&&this.engineComponent.toggleMiniMap(),this.engineComponent?.deactivateFirstPersonMode(),this.panel&&(this.panel.destroy(),this.panel=null),this.registry.toolbar?.setBtnActive("map",!1)}syncMapState(){const e=this.engineComponent?.getMiniMapState()??!1;this.panel?.setPlanViewActive(e)}}class ed{element;options;activeMode;isExpanded;result=null;clearHeightDirection=0;clearHeightSelectType="point";config;draftConfig=null;view="main";static CONFIG_CACHE_KEY="bim-engine:measure:config";static DEFAULT_CONFIG={unit:"mm",precision:2};toolButtons=new Map;toggleBtn;toggleTextEl;mainValueRowEl;mainValueValueEl;mainValueLabelEl;mainNumberEl;mainUnitEl;xyzBoxEl;xyzXEl;xyzYEl;xyzZEl;clearBtn;settingsBtn;modeOptionsEl;directionBtns=new Map;selectTypeBtns=new Map;mainViewEl;settingsViewEl;unitSelectEl;precisionSelectEl;saveSettingsBtn;cancelSettingsBtn;unsubscribeLocale=null;unsubscribeTheme=null;constructor(e={}){this.options=e,this.activeMode=e.defaultMode??"distance",this.isExpanded=e.defaultExpanded??!1,this.config=this.loadConfigFromCache()??{...ed.DEFAULT_CONFIG},this.element=this.createDom()}init(){this.unsubscribeLocale=Zt.subscribe(()=>{this.setLocales()}),this.unsubscribeTheme=ct.subscribe(e=>{this.setTheme(e)}),this.setLocales(),this.setTheme(ct.getTheme()),this.applyExpandedState(),this.applyActiveModeState(),this.applyClearHeightOptionsState(),this.applyViewState(),this.renderResult(),this.options.onModeChange&&this.options.onModeChange(this.activeMode)}setTheme(e){const t=this.element.style;t.setProperty("--bim-bg-inset",e.bgInset??"#152232"),t.setProperty("--bim-bg-elevated",e.bgElevated??"#1f2d3e"),t.setProperty("--bim-border-default",e.borderDefault??"#334155"),t.setProperty("--bim-border-strong",e.borderStrong??"#475569"),t.setProperty("--bim-divider",e.divider??"#334155"),t.setProperty("--bim-primary",e.primary??"#3b82f6"),t.setProperty("--bim-primary-hover",e.primaryHover??"#60a5fa"),t.setProperty("--bim-primary-subtle",e.primarySubtle??"rgba(59, 130, 246, 0.15)"),t.setProperty("--bim-danger",e.danger??"#ef4444"),t.setProperty("--bim-text-primary",e.textPrimary??"#ffffff"),t.setProperty("--bim-text-secondary",e.textSecondary??"#94a3b8"),t.setProperty("--bim-text-tertiary",e.textTertiary??"#64748b"),t.setProperty("--bim-text-inverse",e.textInverse??"#152232"),t.setProperty("--bim-icon-default",e.iconDefault??"#ffffff"),t.setProperty("--bim-component-bg-hover",e.componentBgHover??"rgba(248, 250, 252, 0.06)")}setLocales(){for(const[t,i]of this.toolButtons.entries())i.title=Se(this.getModeI18nKey(t)),i.setAttribute("aria-label",i.title);this.toggleBtn.title=this.isExpanded?Se("measure.actions.collapse"):Se("measure.actions.expand"),this.toggleBtn.setAttribute("aria-label",this.toggleBtn.title),this.toggleTextEl&&(this.toggleTextEl.textContent=this.toggleBtn.title),this.clearBtn.textContent=Se("measure.actions.clearAll"),this.settingsBtn.title=Se("measure.actions.settings"),this.settingsBtn.setAttribute("aria-label",this.settingsBtn.title),this.mainValueLabelEl.textContent=Se(this.getModeValueLabelI18nKey(this.activeMode)),this.element.querySelectorAll("[data-i18n-key]").forEach(t=>{const i=t.dataset.i18nKey;i&&(t.textContent=Se(i))}),this.saveSettingsBtn.textContent=Se("measure.settings.save"),this.cancelSettingsBtn.textContent=Se("measure.settings.cancel")}destroy(){this.unsubscribeLocale&&(this.unsubscribeLocale(),this.unsubscribeLocale=null),this.unsubscribeTheme&&(this.unsubscribeTheme(),this.unsubscribeTheme=null),this.element.remove()}getActiveMode(){return this.activeMode}switchMode(e,t=!0){this.setActiveMode(e,t)}setActiveMode(e,t=!0){this.activeMode!==e&&(this.activeMode=e,this.applyActiveModeState(),this.applyClearHeightOptionsState(),this.mainValueLabelEl.textContent=Se(this.getModeValueLabelI18nKey(this.activeMode)),t&&this.options.onModeChange&&this.options.onModeChange(e),this.renderResult(),this.options.onExpandedChange&&this.options.onExpandedChange(this.isExpanded))}setResult(e){this.result=e,this.renderResult()}clearAll(){this.result=null,this.renderResult(),this.options.onClearAll&&this.options.onClearAll()}openSettings(){this.enterSettingsView(),this.options.onSettings&&this.options.onSettings()}getConfig(){return{...this.config}}setConfig(e,t=!1){const i={unit:e.unit??this.config.unit,precision:e.precision??this.config.precision};this.config=i,t&&this.saveConfigToCache(i),this.renderResult(),this.view==="settings"&&this.syncSettingsFormFromConfig(i)}setExpanded(e){this.isExpanded!==e&&(this.isExpanded=e,this.applyExpandedState(),this.setLocales(),this.options.onExpandedChange&&this.options.onExpandedChange(this.isExpanded))}getExpanded(){return this.isExpanded}createDom(){const e=document.createElement("div");e.className="bim-measure-panel",this.mainViewEl=document.createElement("div"),this.mainViewEl.className="bim-measure-main";const t=document.createElement("div");t.className="bim-measure-tools";const i=document.createElement("div");i.className="bim-measure-tool-grid";const n=`
9598
9598
  <svg viewBox="0 0 24 24" aria-hidden="true">
9599
9599
  <circle cx="12" cy="12" r="9"></circle>
9600
9600
  </svg>
@@ -9881,7 +9881,7 @@ ${JSON.stringify(l,null,2)}
9881
9881
  <span class="bim-ai-qa-answer">${this.escapeHtml(i||"")}</span>
9882
9882
  </div>
9883
9883
  </div>
9884
- `}bindQuestionEvents(){this.messagesContainer?.querySelectorAll(".bim-ai-option").forEach(e=>{e.addEventListener("click",t=>{const i=t.currentTarget,n=i.dataset.questionId,r=i.dataset.optionId;if(n&&r){const a=this.messages.find(o=>o.id===n);a&&!a.answered&&(a.selectedOptionId=r,this.renderMessages())}})}),this.messagesContainer?.querySelectorAll(".bim-ai-option-input").forEach(e=>{e.addEventListener("input",t=>{const i=t.target,n=i.dataset.questionId;if(n){const r=this.messages.find(a=>a.id===n);r&&(r.customAnswer=i.value)}})}),this.messagesContainer?.querySelectorAll(".bim-ai-question-submit").forEach(e=>{e.addEventListener("click",t=>{const n=t.currentTarget.dataset.questionId;if(n){const r=this.messages.find(a=>a.id===n);r&&r.selectedOptionId&&(r.answered=!0,this.renderMessages(),this.options.onQuestionSubmit?.(n,r.selectedOptionId,r.customAnswer))}})})}scrollToBottom(){this.messagesContainer&&(this.messagesContainer.scrollTop=this.messagesContainer.scrollHeight)}escapeHtml(e){const t=document.createElement("div");return t.textContent=e,t.innerHTML}destroy(){this._isDestroyed||(this.unsubscribeTheme&&(this.unsubscribeTheme(),this.unsubscribeTheme=null),this.unsubscribeLocale&&(this.unsubscribeLocale(),this.unsubscribeLocale=null),this.element.remove(),this._isDestroyed=!0)}}class q2{aiChat=null;registry;initialized=!1;constructor(e){this.registry=e}init(){if(this.initialized)return;const e=this.registry.wrapper;if(!e){console.warn("[AiChatManager] wrapper 不存在,无法初始化");return}this.aiChat=new h9({container:e,width:440,title:"aiChat.title",placeholder:"aiChat.placeholder",quickPrompts:[{id:"summarize",label:"aiChat.quickPrompt.summarize"},{id:"explain",label:"aiChat.quickPrompt.explain"},{id:"generate",label:"aiChat.quickPrompt.generate"}],onSend:t=>{console.log("[AiChatManager] 用户发送消息:",t),this.aiChat?.addUserMessage(t),this.registry.emit("aiChat:message-sent",{message:t})},onQuestionSubmit:(t,i,n)=>{console.log("[AiChatManager] 用户回答问题:",{questionId:t,optionId:i,customAnswer:n}),this.registry.emit("aiChat:question-answered",{questionId:t,optionId:i,customAnswer:n})},onNewChat:()=>{console.log("[AiChatManager] 新建对话"),this.registry.emit("aiChat:new-chat",{})},onHistory:()=>{console.log("[AiChatManager] 打开历史"),this.registry.emit("aiChat:history-opened",{})},onSettings:()=>{console.log("[AiChatManager] 打开设置"),this.registry.emit("aiChat:settings-opened",{})},onClose:()=>{console.log("[AiChatManager] 关闭 AI 聊天"),this.registry.emit("aiChat:closed",{}),this.registry.toolbar?.setBtnActive("aiChat",!1)}}),this.initialized=!0}show(){this.aiChat||this.init(),this.aiChat?.show(),this.registry.emit("aiChat:opened",{}),this.registry.toolbar?.setBtnActive("aiChat",!0)}hide(){this.aiChat?.hide(),this.registry.emit("aiChat:closed",{}),this.registry.toolbar?.setBtnActive("aiChat",!1)}toggle(){this.aiChat?.isVisible()?this.hide():this.show()}isVisible(){return this.aiChat?.isVisible()??!1}addUserMessage(e){return this.aiChat?.addUserMessage(e)??""}addAiMessage(e){return this.aiChat?.addAiMessage(e)??""}addStepMessage(e,t){return this.aiChat?.addStepMessage(e,t)??""}addThinkingMessage(){return this.aiChat?.addThinkingMessage()??""}addQuestionMessage(e,t,i){return this.aiChat?.addQuestionMessage(e,t,i)??""}updateMessage(e,t){this.aiChat?.updateMessage(e,t)}removeMessage(e){this.aiChat?.removeMessage(e)}clearMessages(){this.aiChat?.clearMessages()}destroy(){this.aiChat&&(this.aiChat.destroy(),this.aiChat=null),this.initialized=!1}}class d9{container;options;groups=[];activeBtnIds=new Set;btnRefs=new Map;dropdownElement=null;hoverTimeout=null;customColors=new Set;unsubscribeLocale=null;unsubscribeTheme=null;DEFAULT_ICON='<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><rect x="3" y="3" width="18" height="18" rx="2" ry="2"></rect></svg>';constructor(e){const t=typeof e.container=="string"?document.getElementById(e.container):e.container;if(!t)throw new Error("Container not found");this.container=t,this.options={showLabel:!0,visibility:{},direction:"row",position:"static",align:"vertical",expand:"down",...e},["backgroundColor","btnBackgroundColor","btnHoverColor","btnActiveColor","iconColor","iconActiveColor","textColor","textActiveColor"].forEach(n=>{e[n]&&this.customColors.add(n)}),this.initContainer(),this.applyStyles()}emit(e,t){this.options.registry?.emit(e,t)}initContainer(){this.container.innerHTML="",this.container.classList.add("bim-btn-group-root"),this.options.direction==="column"?this.container.classList.add("dir-column"):this.container.classList.add("dir-row"),this.options.className&&this.container.classList.add(this.options.className),this.options.type&&this.options.type!=="default"&&this.container.classList.add(`type-${this.options.type}`),this.updatePosition(),this.setupEventInterception(this.container)}setupEventInterception(e){const t=n=>{n.stopPropagation()};["click","dblclick","contextmenu","wheel","mousedown","mouseup","mousemove","touchstart","touchend","touchmove","pointerdown","pointerup","pointermove","pointerenter","pointerleave","pointerover","pointerout"].forEach(n=>{e.addEventListener(n,t,{passive:!1})})}updatePosition(){const e=this.options.position,t=this.container.style;if(t.top="",t.bottom="",t.left="",t.right="",t.transform="",e==="static"){this.container.classList.add("static");return}if(this.container.classList.remove("static"),this.container.style.position="absolute",typeof e=="object"&&"x"in e)t.left=`${e.x}px`,t.top=`${e.y}px`;else{const i="20px";switch(e){case"top-left":t.top=i,t.left=i;break;case"top-center":t.top=i,t.left="50%",t.transform="translateX(-50%)";break;case"top-right":t.top=i,t.right=i;break;case"bottom-left":t.bottom=i,t.left=i;break;case"bottom-center":t.bottom=i,t.left="50%",t.transform="translateX(-50%)";break;case"bottom-right":t.bottom=i,t.right=i;break;case"left-center":t.left=i,t.top="50%",t.transform="translateY(-50%)";break;case"right-center":t.right=i,t.top="50%",t.transform="translateY(-50%)";break;case"center":t.top="50%",t.left="50%",t.transform="translate(-50%, -50%)";break}}}applyStyles(){const e=this.container.style;this.options.backgroundColor&&e.setProperty("--bim-btn-group-section-bg",this.options.backgroundColor),this.options.btnBackgroundColor&&e.setProperty("--bim-btn-bg",this.options.btnBackgroundColor),this.options.btnHoverColor&&e.setProperty("--bim-btn-hover-bg",this.options.btnHoverColor),this.options.btnActiveColor&&e.setProperty("--bim-btn-active-bg",this.options.btnActiveColor),this.options.iconColor&&e.setProperty("--bim-icon-color",this.options.iconColor),this.options.iconActiveColor&&e.setProperty("--bim-icon-active-color",this.options.iconActiveColor),this.options.textColor&&e.setProperty("--bim-btn-text-color",this.options.textColor),this.options.textActiveColor&&e.setProperty("--bim-btn-text-active-color",this.options.textActiveColor),document.querySelectorAll(".opt-btn-dropdown").forEach(i=>{const n=i.style;this.options.iconColor&&n.setProperty("--bim-icon-color",this.options.iconColor),this.options.iconActiveColor&&n.setProperty("--bim-icon-active-color",this.options.iconActiveColor),this.options.textColor&&n.setProperty("--bim-btn-text-color",this.options.textColor),this.options.textActiveColor&&n.setProperty("--bim-btn-text-active-color",this.options.textActiveColor),this.options.btnBackgroundColor&&n.setProperty("--bim-btn-bg",this.options.btnBackgroundColor),this.options.btnHoverColor&&n.setProperty("--bim-btn-hover-bg",this.options.btnHoverColor),this.options.btnActiveColor&&n.setProperty("--bim-btn-active-bg",this.options.btnActiveColor)})}setPrimaryColor(e){this.container.style.setProperty("--bim-primary-color",e),document.querySelectorAll(".opt-btn-dropdown").forEach(i=>{i.style.setProperty("--bim-primary-color",e)})}setTheme(e){const t={backgroundColor:e.bgElevated,btnBackgroundColor:e.componentBg,btnHoverColor:e.componentBgHover,btnActiveColor:e.componentBgActive,iconColor:e.iconDefault,iconActiveColor:e.iconActive,textColor:e.textSecondary,textActiveColor:e.textPrimary};Object.entries(t).forEach(([i,n])=>{const r=i;this.customColors.has(r)||(this.options[r]=n)}),this.container.classList.remove("theme-dark","theme-light"),this.container.classList.add(`theme-${e.name}`),this.applyStyles(),this.setPrimaryColor(e.primary),this.applyThemeCssVars(e)}applyThemeCssVars(e){const t=this.container.style;t.setProperty("--bim-primary",e.primary),t.setProperty("--bim-primary-hover",e.primaryHover),t.setProperty("--bim-primary-active",e.primaryActive),t.setProperty("--bim-bg-glass",e.bgGlass),t.setProperty("--bim-bg-glass-blur",e.bgGlassBlur),t.setProperty("--bim-bg-elevated",e.bgElevated),t.setProperty("--bim-bg-overlay",e.bgOverlay),t.setProperty("--bim-bg-inset",e.bgInset),t.setProperty("--bim-text-primary",e.textPrimary),t.setProperty("--bim-text-secondary",e.textSecondary),t.setProperty("--bim-text-tertiary",e.textTertiary),t.setProperty("--bim-text-inverse",e.textInverse),t.setProperty("--bim-icon-default",e.iconDefault),t.setProperty("--bim-icon-hover",e.iconHover),t.setProperty("--bim-icon-active",e.iconActive),t.setProperty("--bim-icon-inverse",e.iconInverse),t.setProperty("--bim-border-default",e.borderDefault),t.setProperty("--bim-border-subtle",e.borderSubtle),t.setProperty("--bim-component-bg-hover",e.componentBgHover),t.setProperty("--bim-component-bg-active",e.componentBgActive),t.setProperty("--bim-shadow-sm",e.shadowSm),t.setProperty("--bim-shadow-md",e.shadowMd),t.setProperty("--bim-shadow-lg",e.shadowLg),t.setProperty("--bim-shadow-glow",e.shadowGlow),t.setProperty("--bim-floating-bg",e.floatingBg),t.setProperty("--bim-floating-border",e.floatingBorder),t.setProperty("--bim-floating-shadow",e.floatingShadow),t.setProperty("--bim-floating-btn-bg",e.floatingBtnBg),t.setProperty("--bim-floating-btn-border",e.floatingBtnBorder),t.setProperty("--bim-floating-btn-shadow",e.floatingBtnShadow),t.setProperty("--bim-floating-btn-bg-hover",e.floatingBtnBgHover),t.setProperty("--bim-floating-btn-shadow-hover",e.floatingBtnShadowHover),t.setProperty("--bim-floating-icon-color",e.floatingIconColor),t.setProperty("--bim-floating-icon-color-hover",e.floatingIconColorHover),this.syncDropdownCssVars(e)}syncDropdownCssVars(e){document.querySelectorAll(".opt-btn-dropdown").forEach(i=>{const n=i.style;n.setProperty("--bim-primary",e.primary),n.setProperty("--bim-bg-overlay",e.bgOverlay),n.setProperty("--bim-border-default",e.borderDefault),n.setProperty("--bim-text-primary",e.textPrimary),n.setProperty("--bim-text-inverse",e.textInverse),n.setProperty("--bim-shadow-lg",e.shadowLg),n.setProperty("--bim-floating-btn-bg",e.floatingBtnBg),n.setProperty("--bim-floating-btn-bg-hover",e.floatingBtnBgHover),n.setProperty("--bim-floating-icon-color",e.floatingIconColor)})}setColors(e){this.options={...this.options,...e},Object.keys(e).forEach(t=>{this.customColors.add(t)}),this.applyStyles()}async init(){this.render(),this.unsubscribeLocale=Zt.subscribe(()=>{this.setLocales()}),this.unsubscribeTheme=ct.subscribe(e=>{this.setTheme(e)})}setLocales(){this.render()}addGroup(e,t){if(this.groups.some(n=>n.id===e))return;const i={id:e,buttons:[]};if(t){const n=this.groups.findIndex(r=>r.id===t);n!==-1?this.groups.splice(n,0,i):this.groups.push(i)}else this.groups.push(i)}addButton(e){const{groupId:t,parentId:i}=e,n=this.groups.find(a=>a.id===t);if(!n)return;const r={...e,children:e.children||[]};if(i){const a=this.findButton(n.buttons,i);a&&(a.children||(a.children=[]),a.children.push(r))}else n.buttons.push(r)}findButton(e,t){for(const i of e){if(i.id===t)return i;if(i.children){const n=this.findButton(i.children,t);if(n)return n}}}render(){this.container.innerHTML="",this.btnRefs.clear(),this.groups.forEach((e,t)=>{const i=this.renderGroup(e,t,this.groups.length);this.container.appendChild(i)})}renderGroup(e,t,i){const n=document.createElement("div");return n.className="bim-btn-group-section",t<i-1&&n.classList.add("has-divider"),e.buttons.forEach(r=>{if(this.isVisible(r.id)){const a=this.renderButton(r);n.appendChild(a)}}),n}renderButton(e){const t=document.createElement("div");t.className="opt-btn-wrapper";const i=document.createElement("div");i.className="opt-btn",e.isActive&&this.activeBtnIds.add(e.id),(e.align||this.options.align||"vertical")==="horizontal"?i.classList.add("align-horizontal"):i.classList.add("align-vertical"),this.activeBtnIds.has(e.id)&&i.classList.add("active"),e.disabled&&i.classList.add("disabled"),this.options.showLabel&&e.label||(i.classList.add("no-label"),e.label&&(i.title=Se(e.label)));const a=e.iconSize||32,o=e.minWidth||50;i.style.minWidth=`${o}px`;const l=document.createElement("div");l.className="opt-btn-icon",l.style.width=`${a}px`,l.style.height=`${a}px`,l.innerHTML=this.getIcon(e.icon),i.appendChild(l);const c=document.createElement("div");if(c.className="opt-btn-text-wrapper",this.options.showLabel&&e.label){const h=document.createElement("span");h.className="opt-btn-label",h.textContent=Se(e.label),c.appendChild(h)}return c.hasChildNodes()&&i.appendChild(c),i.addEventListener("click",()=>this.handleClick(e)),i.addEventListener("mouseenter",()=>this.handleMouseEnter(e,i)),i.addEventListener("mouseleave",()=>this.handleMouseLeave()),this.btnRefs.set(e.id,i),t.appendChild(i),t}setBtnActive(e,t){const i=this.findButtonById(e);if(!i)return;const n=t!==void 0?t:!this.activeBtnIds.has(e);n?this.activeBtnIds.add(e):this.activeBtnIds.delete(e),i.isActive=n,this.updateButtonState(e)}handleClick(e){if(!e.disabled&&(!e.children||e.children.length===0)){if(e.keepActive){const i=!this.activeBtnIds.has(e.id);this.setBtnActive(e.id,i),i&&e.exclusive&&e.groupId&&this.deactivateExclusiveSiblings(e)}this.closeDropdown(),e.onClick&&e.onClick(e)}}deactivateExclusiveSiblings(e){const t=this.groups.find(i=>i.id===e.groupId);if(t){if(e.parentId){const n=this.findButton(t.buttons,e.parentId)?.children||[];for(const r of n)r&&r.id!==e.id&&r.parentId===e.parentId&&r.groupId===e.groupId&&this.activeBtnIds.has(r.id)&&(this.setBtnActive(r.id,!1),r.onClick&&r.onClick(r));return}for(const i of t.buttons)i.id!==e.id&&i.groupId===e.groupId&&(i.parentId||this.activeBtnIds.has(i.id)&&(this.setBtnActive(i.id,!1),i.onClick&&i.onClick(i)))}}handleMouseEnter(e,t){this.hoverTimeout&&clearTimeout(this.hoverTimeout),e.children&&e.children.length>0?this.showDropdown(e,t):this.closeDropdown()}handleMouseLeave(){this.hoverTimeout=window.setTimeout(()=>this.closeDropdown(),200)}showDropdown(e,t){if(this.closeDropdown(),!e.children)return;const i=document.createElement("div");i.className="opt-btn-dropdown",this.options.backgroundColor&&i.style.setProperty("--bim-toolbar-bg",this.options.backgroundColor);const n=i.style;this.options.iconColor&&n.setProperty("--bim-icon-color",this.options.iconColor),this.options.iconActiveColor&&n.setProperty("--bim-icon-active-color",this.options.iconActiveColor),this.options.textColor&&n.setProperty("--bim-btn-text-color",this.options.textColor),this.options.textActiveColor&&n.setProperty("--bim-btn-text-active-color",this.options.textActiveColor),this.options.btnBackgroundColor&&n.setProperty("--bim-btn-bg",this.options.btnBackgroundColor),this.options.btnHoverColor&&n.setProperty("--bim-btn-hover-bg",this.options.btnHoverColor),this.options.btnActiveColor&&n.setProperty("--bim-btn-active-bg",this.options.btnActiveColor);const r=t.getBoundingClientRect(),a=this.options.expand||"down";this.options.direction==="row"?i.style.flexDirection="column":i.style.flexDirection="row",this.options.type&&this.options.type!=="default"&&i.classList.add(`type-${this.options.type}`);const o=ct.getTheme();i.classList.add(`theme-${o.name}`),n.setProperty("--bim-primary",o.primary),n.setProperty("--bim-bg-overlay",o.bgOverlay),n.setProperty("--bim-border-default",o.borderDefault),n.setProperty("--bim-text-primary",o.textPrimary),n.setProperty("--bim-text-inverse",o.textInverse),n.setProperty("--bim-shadow-lg",o.shadowLg),n.setProperty("--bim-floating-btn-bg",o.floatingBtnBg),n.setProperty("--bim-floating-btn-bg-hover",o.floatingBtnBgHover),n.setProperty("--bim-floating-icon-color",o.floatingIconColor),document.body.appendChild(i),this.setupEventInterception(i),e.children.forEach(c=>{if(this.isVisible(c.id)){const h=this.renderDropdownItem(c);i.appendChild(h)}});const l=i.getBoundingClientRect();a==="up"?(i.style.bottom=window.innerHeight-r.top+8+"px",i.style.left=r.left+(r.width-l.width)/2+"px"):a==="down"?(i.style.top=r.bottom+8+"px",i.style.left=r.left+(r.width-l.width)/2+"px"):a==="right"?(i.style.top=r.top+(r.height-l.height)/2+"px",i.style.left=r.right+8+"px"):a==="left"&&(i.style.top=r.top+(r.height-l.height)/2+"px",i.style.right=window.innerWidth-r.left+8+"px"),i.addEventListener("mouseenter",()=>{this.hoverTimeout&&clearTimeout(this.hoverTimeout)}),i.addEventListener("mouseleave",()=>this.handleMouseLeave()),this.dropdownElement=i}renderDropdownItem(e){const t=document.createElement("div");t.className="opt-btn-dropdown-item",(e.align||"horizontal")==="horizontal"?t.classList.add("align-horizontal"):t.classList.add("align-vertical"),(this.activeBtnIds.has(e.id)||e.isActive)&&t.classList.add("active");const n=e.iconSize||32,r=e.minWidth;r&&(t.style.minWidth=`${r}px`);const a=document.createElement("div");if(a.className="opt-btn-icon",a.style.width=`${n}px`,a.style.height=`${n}px`,a.innerHTML=this.getIcon(e.icon),t.appendChild(a),this.options.showLabel&&e.label){const o=document.createElement("span");o.className="opt-btn-dropdown-label",o.textContent=Se(e.label),t.appendChild(o)}else e.label&&(t.title=Se(e.label));return t.addEventListener("click",o=>{o.stopPropagation(),this.handleClick(e)}),t}closeDropdown(){this.dropdownElement&&(this.dropdownElement.remove(),this.dropdownElement=null),this.btnRefs.forEach(e=>{const t=e.querySelector(".opt-btn-arrow");t&&t.classList.remove("rotated")})}updateButtonState(e){const t=this.btnRefs.get(e);t&&(this.activeBtnIds.has(e)?t.classList.add("active"):t.classList.remove("active"))}getIcon(e){return e||this.DEFAULT_ICON}updateButtonIcon(e,t){const i=this.btnRefs.get(e);if(!i)return;const n=i.querySelector(".opt-btn-icon");n&&(n.innerHTML=this.getIcon(t));const r=this.findButtonById(e);r&&(r.icon=t)}updateButtonVisibility(e,t){this.options.visibility||(this.options.visibility={}),this.options.visibility[e]=t,this.render()}setShowLabel(e){this.options.showLabel=e,this.updateLabelsVisibility()}updateLabelsVisibility(){this.btnRefs.forEach((e,t)=>{const i=this.findButtonById(t);if(!i)return;this.options.showLabel&&i.label?(e.classList.remove("no-label"),e.removeAttribute("title")):(e.classList.add("no-label"),i.label&&(e.title=Se(i.label)))})}findButtonById(e){for(const t of this.groups){const i=this.findButton(t.buttons,e);if(i)return i}}setBackgroundColor(e){this.setColors({backgroundColor:e})}isVisible(e){return this.options.visibility?.[e]!==!1}setType(e){this.container.classList.remove("type-default","type-glass-pill"),this.options.type=e,e&&e!=="default"&&this.container.classList.add(`type-${e}`),this.render()}getType(){return this.options.type||"default"}destroy(){this.unsubscribeLocale&&(this.unsubscribeLocale(),this.unsubscribeLocale=null),this.unsubscribeTheme&&(this.unsubscribeTheme(),this.unsubscribeTheme=null),this.closeDropdown(),this.container.innerHTML="",this.btnRefs.clear()}}var ni=(s=>(s[s.Unchecked=0]="Unchecked",s[s.Checked=1]="Checked",s[s.Indeterminate=2]="Indeterminate",s))(ni||{});class u9{config;element;children=[];parent=null;checkState=ni.Unchecked;contentEl;switcherEl;checkboxEl=null;titleEl;actionsEl;childrenContainer;onExpandChange;onCheckChange;onNodeClick;renderActions;constructor(e,t,i){this.config=e,this.onExpandChange=i.onExpand,this.onCheckChange=i.onCheck,this.onNodeClick=i.onClick,this.renderActions=t.renderActions,this.checkState=e.checked?ni.Checked:ni.Unchecked,this.element=this.createDom(t)}createDom(e){const t=document.createElement("div");t.className="bim-tree-node",this.config.disabled&&t.classList.add("is-disabled"),this.contentEl=document.createElement("div"),this.contentEl.className="bim-tree-node-content",this.switcherEl=document.createElement("span"),this.switcherEl.className="bim-tree-switcher",this.switcherEl.innerHTML='<svg viewBox="0 0 1024 1024"><path d="M288 192l448 320-448 320z"></path></svg>';const i=this.config.children&&this.config.children.length>0;if(i?this.config.expanded&&this.switcherEl.classList.add("is-expanded"):this.switcherEl.classList.add("is-hidden"),this.switcherEl.addEventListener("click",r=>{r.stopPropagation(),this.toggleExpand()}),this.contentEl.appendChild(this.switcherEl),e.checkable!==!1&&(this.checkboxEl=document.createElement("span"),this.checkboxEl.className="bim-tree-checkbox",this.updateCheckboxUI(),this.checkboxEl.addEventListener("click",r=>{r.stopPropagation(),!this.config.disabled&&this.toggleCheck()}),this.contentEl.appendChild(this.checkboxEl)),this.config.icon){const r=document.createElement("span");r.className="bim-tree-icon",r.innerHTML=this.config.icon.includes("<svg")?this.config.icon:`<img src="${this.config.icon}" />`,this.contentEl.appendChild(r)}this.titleEl=document.createElement("span"),this.titleEl.className="bim-tree-title",this.updateLabel(),this.contentEl.appendChild(this.titleEl),this.actionsEl=document.createElement("div"),this.actionsEl.className="bim-tree-node-actions",this.actionsEl.addEventListener("click",r=>{r.stopPropagation()}),this.contentEl.appendChild(this.actionsEl),this.contentEl.addEventListener("click",r=>{if(r.stopPropagation(),this.config.disabled)return;(this.config.clickAction||"select")==="expand"?this.toggleExpand():this.onNodeClick(this)}),t.appendChild(this.contentEl),this.childrenContainer=document.createElement("div"),this.childrenContainer.className="bim-tree-children";const n=e.indent||24;return this.childrenContainer.style.paddingLeft=`${n}px`,this.config.expanded&&i&&this.childrenContainer.classList.add("is-visible"),t.appendChild(this.childrenContainer),t}setSelected(e){if(e){if(this.contentEl.classList.add("is-selected"),this.renderActions){const t=this.renderActions(this.config);this.actionsEl.innerHTML="",typeof t=="string"?this.actionsEl.innerHTML=t:t instanceof HTMLElement&&this.actionsEl.appendChild(t)}}else this.contentEl.classList.remove("is-selected"),this.actionsEl.innerHTML=""}updateLabel(){this.titleEl&&(this.titleEl.textContent=this.config.label)}toggleExpand(e){if(!this.config.children||this.config.children.length===0)return;const t=e!==void 0?e:!this.config.expanded;this.config.expanded=t,t?(this.switcherEl.classList.add("is-expanded"),this.childrenContainer.classList.add("is-visible")):(this.switcherEl.classList.remove("is-expanded"),this.childrenContainer.classList.remove("is-visible")),e===void 0&&this.onExpandChange(this)}toggleCheck(){const e=this.checkState!==ni.Checked;this.setChecked(e?ni.Checked:ni.Unchecked,!0)}setChecked(e,t=!1,i=!1){!i&&this.checkState===e||(this.checkState=e,this.config.checked=e===ni.Checked,this.updateCheckboxUI(),t&&this.onCheckChange(this))}updateCheckboxUI(){this.checkboxEl&&(this.checkboxEl.classList.remove("is-checked","is-indeterminate"),this.checkState===ni.Checked?this.checkboxEl.classList.add("is-checked"):this.checkState===ni.Indeterminate&&this.checkboxEl.classList.add("is-indeterminate"))}appendChild(e){e.parent=this,this.children.push(e),this.childrenContainer.appendChild(e.element),this.children.length===1&&this.switcherEl.classList.remove("is-hidden")}destroy(){this.children.forEach(e=>e.destroy()),this.children=[],this.element.remove(),this.parent=null}}class p9{element;contentElement;searchInput=null;searchResults=null;options;nodeMap=new Map;rootNodes=[];selectedNode=null;lastRevealedNodeId=null;unsubscribeLocale=null;unsubscribeTheme=null;clickOutsideHandler=null;onNodeCheck;onNodeSelect;onNodeDeselect;onNodeExpand;constructor(e){this.options={checkable:!0,checkStrictly:!0,indent:24,defaultExpandAll:!0,enableSearch:!1,searchPlaceholder:"tree.searchPlaceholder",...e},this.element=document.createElement("div"),this.element.className="bim-tree",this.options.enableSearch&&this.createSearchDOM(),this.contentElement=document.createElement("div"),this.contentElement.className="bim-tree-content",this.element.appendChild(this.contentElement),e.onNodeCheck&&(this.onNodeCheck=e.onNodeCheck),e.onNodeSelect&&(this.onNodeSelect=e.onNodeSelect),e.onNodeDeselect&&(this.onNodeDeselect=e.onNodeDeselect),e.onNodeExpand&&(this.onNodeExpand=e.onNodeExpand)}createSearchDOM(){const e=document.createElement("div");e.className="bim-tree-search";const t=document.createElement("div");t.className="bim-tree-search-wrapper";const i=document.createElement("span");i.className="bim-tree-search-icon",i.innerHTML='<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 24 24"><path fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5" d="m21 21l-4.343-4.343m0 0A8 8 0 1 0 5.343 5.343a8 8 0 0 0 11.314 11.314"/></svg>',t.appendChild(i),this.searchInput=document.createElement("input"),this.searchInput.className="bim-tree-search-input",this.searchInput.type="text",this.searchInput.placeholder=Se(this.options.searchPlaceholder||"搜索..."),this.searchInput.addEventListener("input",n=>{const r=n.target.value;this.handleSearch(r)}),t.appendChild(this.searchInput),e.appendChild(t),this.searchResults=document.createElement("div"),this.searchResults.className="bim-tree-search-results",e.appendChild(this.searchResults),this.element.appendChild(e),this.clickOutsideHandler=n=>{this.searchResults&&!this.searchResults.contains(n.target)&&!this.searchInput?.contains(n.target)&&this.searchResults.classList.remove("is-visible")},document.addEventListener("click",this.clickOutsideHandler)}init(){this.render(),this.unsubscribeLocale=Zt.subscribe(()=>this.setLocales()),this.unsubscribeTheme=ct.subscribe(e=>this.setTheme(e)),this.setTheme(ct.getTheme())}handleSearch(e){if(!this.searchResults)return;if(!e.trim()){this.searchResults.classList.remove("is-visible"),this.searchResults.innerHTML="";return}const t=[],i=e.toLowerCase();this.nodeMap.forEach(n=>{const r=n.config.label;r.toLowerCase().includes(i)&&t.push({node:n,label:r,path:this.getNodePath(n)})}),this.renderSearchResults(t)}getNodePath(e){const t=[];let i=e.parent;for(;i;)t.unshift(i.config.label),i=i.parent;return t.join(" > ")}renderSearchResults(e){if(this.searchResults){if(this.searchResults.innerHTML="",e.length===0){const t=document.createElement("div");t.className="bim-tree-search-item",t.style.cursor="default",t.style.color="#999",t.textContent="No results",this.searchResults.appendChild(t)}else e.forEach(t=>{const i=document.createElement("div");i.className="bim-tree-search-item";const n=document.createElement("span");n.className="bim-tree-search-item-title",n.textContent=t.label;const r=document.createElement("span");r.className="bim-tree-search-item-path",r.textContent=t.path,i.appendChild(n),t.path&&i.appendChild(r),i.addEventListener("click",()=>{this.revealNode(t.node)}),this.searchResults.appendChild(i)});this.searchResults.classList.add("is-visible")}}revealNode(e){if(this.lastRevealedNodeId===e.config.id&&this.isNodeFullyVisible(e))return;this.lastRevealedNodeId=e.config.id,this.searchResults&&(this.searchResults.classList.remove("is-visible"),this.searchInput&&(this.searchInput.value=""));let t=e.parent;for(;t;)t.toggleExpand(!0),t=t.parent;this.handleNodeSelect(e),requestAnimationFrame(()=>{requestAnimationFrame(()=>{this.scrollNodeIntoContentCenter(e)})})}isNodeFullyVisible(e){const t=this.contentElement;if(!t||!e?.element?.isConnected)return!1;const i=t.getBoundingClientRect(),n=e.element.getBoundingClientRect();return n.top>=i.top&&n.bottom<=i.bottom}scrollNodeIntoContentCenter(e){const t=this.contentElement;if(!t||!e?.element?.isConnected)return;const i=t.getBoundingClientRect(),n=e.element.getBoundingClientRect();if(n.top>=i.top&&n.bottom<=i.bottom)return;const r=n.top-i.top+t.scrollTop,a=Math.max(0,r-(t.clientHeight-n.height)/2);t.scrollTo({top:a,behavior:"auto"})}setTheme(e){const t=this.element.style;t.setProperty("--bim-primary",e.primary),t.setProperty("--bim-bg-elevated",e.bgElevated),t.setProperty("--bim-text-primary",e.textPrimary),t.setProperty("--bim-text-secondary",e.textSecondary),t.setProperty("--bim-text-tertiary",e.textTertiary),t.setProperty("--bim-text-disabled",e.textDisabled),t.setProperty("--bim-text-inverse",e.textInverse),t.setProperty("--bim-border-default",e.borderDefault),t.setProperty("--bim-border-disabled",e.borderDisabled),t.setProperty("--bim-component-bg-hover",e.componentBgHover),t.setProperty("--bim-component-bg-selected",e.componentBgSelected),t.setProperty("--bim-component-bg-disabled",e.componentBgDisabled),t.setProperty("--bim-shadow-md",e.shadowMd),t.setProperty("--bim-focus-ring",e.focusRing)}setLocales(){this.nodeMap.forEach(e=>e.updateLabel()),this.searchInput&&(this.searchInput.placeholder=Se(this.options.searchPlaceholder||"tree.searchPlaceholder"))}destroy(){this.unsubscribeLocale&&(this.unsubscribeLocale(),this.unsubscribeLocale=null),this.unsubscribeTheme&&(this.unsubscribeTheme(),this.unsubscribeTheme=null),this.clickOutsideHandler&&(document.removeEventListener("click",this.clickOutsideHandler),this.clickOutsideHandler=null),this.rootNodes.forEach(e=>e.destroy()),this.rootNodes=[],this.nodeMap.clear(),this.lastRevealedNodeId=null,this.element.remove(),this.selectedNode=null}render(){this.contentElement.innerHTML="",this.nodeMap.clear(),this.rootNodes=[],this.options.data.forEach(e=>{this.createNodeRecursively(e,null)})}createNodeRecursively(e,t){e.expanded===void 0&&(e.expanded=this.options.defaultExpandAll);const i=new u9(e,this.options,{onExpand:n=>{this.onNodeExpand&&this.onNodeExpand(n)},onCheck:n=>this.handleNodeCheck(n),onClick:n=>this.handleNodeSelect(n)});this.nodeMap.set(e.id,i),t?t.appendChild(i):(this.rootNodes.push(i),this.contentElement.appendChild(i.element)),e.children&&e.children.length>0&&e.children.forEach(n=>{this.createNodeRecursively(n,i)})}handleNodeSelect(e){if(this.selectedNode===e){e.setSelected(!1),this.selectedNode=null,this.onNodeDeselect&&this.onNodeDeselect(e);return}this.selectedNode&&this.selectedNode.setSelected(!1),e.setSelected(!0),this.selectedNode=e,this.onNodeSelect&&this.onNodeSelect(e)}handleNodeCheck(e){const t=e.checkState===ni.Checked;if(this.onNodeCheck&&this.onNodeCheck(e),this.options.checkStrictly===!1)return;const i=(r,a)=>{r.children.forEach(o=>{o.config.disabled||(o.setChecked(a,!1),i(o,a))})};t?i(e,ni.Checked):i(e,ni.Unchecked);let n=e.parent;for(;n;){if(n.config.disabled){n=n.parent;continue}const r=n.children,a=r.every(l=>l.checkState===ni.Checked),o=r.every(l=>l.checkState===ni.Unchecked);a?n.setChecked(ni.Checked,!1):o?n.setChecked(ni.Unchecked,!1):n.setChecked(ni.Indeterminate,!1),n=n.parent}}getNode(e){return this.nodeMap.get(e)}checkNode(e,t){const i=this.nodeMap.get(e);i&&i.setChecked(t?ni.Checked:ni.Unchecked,!0)}expandAll(e){this.nodeMap.forEach(t=>t.toggleExpand(e))}checkAllNodes(e){const t=e?ni.Checked:ni.Unchecked;this.nodeMap.forEach(i=>i.setChecked(t,!1,!0))}getCheckedNodes(e=!1){const t=[];return this.nodeMap.forEach(i=>{(i.checkState===ni.Checked||e&&i.checkState===ni.Indeterminate)&&t.push(i.config)}),t}}class f9{element;navElement;contentElement;options;activeId;tabMap=new Map;panelMap=new Map;panelTreeScrollTopMap=new Map;unsubscribeLocale=null;unsubscribeTheme=null;navClickHandler=null;constructor(e){this.options=e,this.activeId=e.activeId||(e.tabs[0]?.id??null),e.tabs.forEach(t=>this.tabMap.set(t.id,t)),this.element=document.createElement("div"),this.element.className="bim-tab",this.navElement=document.createElement("div"),this.navElement.className="bim-tab__nav",this.navElement.setAttribute("role","tablist"),this.element.appendChild(this.navElement),this.contentElement=document.createElement("div"),this.contentElement.className="bim-tab__content",this.element.appendChild(this.contentElement),this.options.container.appendChild(this.element)}init(){this.renderNav(),this.renderPanels(),this.setLocales(),this.setTheme(ct.getTheme()),this.unsubscribeLocale=Zt.subscribe(()=>this.setLocales()),this.unsubscribeTheme=ct.subscribe(e=>this.setTheme(e))}renderNav(){this.navElement.innerHTML="",this.navClickHandler=e=>{const t=e.target.closest(".bim-tab__item");if(!t)return;const i=t.dataset.id;!i||this.tabMap.get(i)?.disabled||this.activateTab(i)},this.navElement.addEventListener("click",this.navClickHandler),this.options.tabs.forEach(e=>{const t=document.createElement("button");if(t.type="button",t.className="bim-tab__item",t.dataset.id=e.id,t.setAttribute("role","tab"),t.id=`tab-${e.id}`,t.setAttribute("aria-selected",`${e.id===this.activeId}`),e.disabled&&(t.disabled=!0,t.setAttribute("aria-disabled","true"),t.classList.add("is-disabled")),e.icon){const n=document.createElement("span");n.className="bim-tab__icon",n.innerHTML=e.icon,t.appendChild(n)}const i=document.createElement("span");i.className="bim-tab__title",i.textContent=this.resolveTitle(e.title),t.appendChild(i),e.id===this.activeId&&t.classList.add("is-active"),this.navElement.appendChild(t)})}renderPanels(){this.contentElement.innerHTML="",this.panelMap.clear(),this.options.tabs.forEach(e=>{const t=document.createElement("div");t.className="bim-tab__panel",t.dataset.id=e.id,t.setAttribute("role","tabpanel"),t.setAttribute("aria-labelledby",`tab-${e.id}`),e.content instanceof HTMLElement?t.appendChild(e.content):typeof e.content=="string"&&(t.innerHTML=e.content),e.id===this.activeId?t.classList.add("is-active"):t.style.display="none",this.panelMap.set(e.id,t),this.contentElement.appendChild(t)})}activateTab(e){if(this.activeId===e)return;const t=this.tabMap.get(e);if(!t||t.disabled)return;this.activeId=e,this.navElement.querySelectorAll(".bim-tab__item").forEach(n=>{const r=n.dataset.id===e;n.classList.toggle("is-active",r),n.setAttribute("aria-selected",`${r}`)}),this.panelMap.forEach((n,r)=>{const a=r===e;a||this.savePanelTreeScrollTop(r,n),n.classList.toggle("is-active",a),n.style.display=a?"":"none",a&&this.restorePanelTreeScrollTop(r,n)}),this.options.onChange&&this.options.onChange(e,t)}setTheme(e){const t=this.element.style;t.setProperty("--bim-tab-bg",e.bgElevated),t.setProperty("--bim-tab-nav-bg",e.bgElevated),t.setProperty("--bim-tab-text",e.textPrimary),t.setProperty("--bim-tab-text-secondary",e.textSecondary),t.setProperty("--bim-tab-text-active",e.primary),t.setProperty("--bim-tab-border",e.borderDefault),t.setProperty("--bim-tab-hover-bg",e.componentBgHover),t.setProperty("--bim-tab-active-bg",e.componentBgActive),t.setProperty("--bim-tab-icon",e.iconDefault)}setLocales(){this.navElement.querySelectorAll(".bim-tab__item").forEach(t=>{const i=t.dataset.id;if(!i)return;const n=this.tabMap.get(i);if(!n)return;const r=t.querySelector(".bim-tab__title");r&&(r.textContent=this.resolveTitle(n.title))})}destroy(){this.navClickHandler&&(this.navElement.removeEventListener("click",this.navClickHandler),this.navClickHandler=null),this.unsubscribeLocale&&(this.unsubscribeLocale(),this.unsubscribeLocale=null),this.unsubscribeTheme&&(this.unsubscribeTheme(),this.unsubscribeTheme=null),this.panelMap.clear(),this.panelTreeScrollTopMap.clear(),this.tabMap.clear(),this.element.remove()}savePanelTreeScrollTop(e,t){const i=t.querySelector(".bim-tree-content");i&&this.panelTreeScrollTopMap.set(e,i.scrollTop)}restorePanelTreeScrollTop(e,t){const i=this.panelTreeScrollTopMap.get(e);if(i===void 0)return;const n=t.querySelector(".bim-tree-content");n&&requestAnimationFrame(()=>{n.scrollTop=i})}resolveTitle(e){try{return Se(e)||e}catch{return e}}}function Z2(s,e){let t=e>>>0;for(let i=0;i<s.length;i++){const n=s.charCodeAt(i);t^=n&255,t=Math.imul(t,16777619),t^=n>>>8&255,t=Math.imul(t,16777619)}return t>>>0}async function m9(s){const e=JSON.stringify(s),t=Z2(e,2166136261),i=Z2(e,522970236);return`${t.toString(16).padStart(8,"0")}${i.toString(16).padStart(8,"0")}`}function Y2(s){const e=new Map,t=n=>{const r=n.config.data,a=r?._modelUrl;if(a&&r?.ids?.length){let o=e.get(a);o||(o=new Set,e.set(a,o));for(const l of r.ids){const c=Number(l);Number.isFinite(c)&&o.add(c)}}for(const o of n.children||[])t(o)};t(s);const i=[];for(const[n,r]of e)r.size>0&&i.push({url:n,ids:Array.from(r)});return i}let g9=0;async function v9(s){if(!s||s.length===0)return[];const e=async(t,i)=>{const n=t.children&&t.children.length>0;let r;return t.ids?.length?r=await m9(t.ids):t.id?r=t.id:r=`node_${++g9}`,{id:r,label:t.name||"未命名",expanded:!1,checked:!0,children:n?await Promise.all(t.children.map(a=>e(a,i))):void 0,data:{...t,_modelUrl:i}}};return Promise.all(s.map(async t=>{const i=t.children&&t.children.length>0,n=t.url;return{id:n,label:t.name||"模型",expanded:!0,checked:!0,children:i?await Promise.all(t.children.map(r=>e(r,n))):void 0,data:{_modelUrl:n}}}))}class y9 extends jn{toolbar=null;toolbarContainer=null;container;dialog=null;constructor(e,t){super(t),this.container=e,this.init()}init(){this.toolbarContainer=document.createElement("div"),this.toolbarContainer.id="bim-construct-tree",this.container.appendChild(this.toolbarContainer),this.toolbar=new d9({container:this.toolbarContainer,showLabel:!1,direction:"column",position:"top-left",align:"vertical",expand:"up",registry:this.registry}),this.toolbar.init(),this.toolbar.addGroup("construct-tree"),this.toolbar.addButton({id:"construct-tree-btn",groupId:"construct-tree",type:"button",label:"construct-tree",icon:Tt("目录树"),onClick:()=>{this.openConstructTreeDialog()}}),this.toolbar.render()}async openConstructTreeDialog(){this.setVisible(!1);const e=this.engineComponent?.getLevelTreeData()??[],t=this.engineComponent?.getTypeTreeData()??[],i=this.engineComponent?.getMajorTreeData()??[];console.log("[ConstructTree] 原始数据 (Level):",e),console.log("[ConstructTree] 原始数据 (Type):",t),console.log("[ConstructTree] 原始数据 (Major):",i);const n=async(g,m)=>{const f=await v9(g);console.log(`[ConstructTree] 转换后数据 (${m}):`,f);const y=new p9({data:f,checkable:!0,indent:0,enableSearch:!0,checkStrictly:!0,defaultExpandAll:!0,onNodeCheck:x=>{const _=Y2(x);_.length&&(x.checkState===ni.Checked?this.engineComponent?.showModel(_):this.engineComponent?.hideModels(_))},onNodeSelect:x=>{const _=Y2(x);_.length&&(this.engineComponent?.unhighlightAllModels(),this.engineComponent?.highlightModel(_),this.engineComponent?.viewScaleToModel(_))},onNodeDeselect:()=>{this.engineComponent?.unhighlightAllModels()},onNodeExpand:()=>{this.dialog?.fitWidth()}});return y.init(),y},r=await n(e,"Level"),a=await n(t,"Type"),o=await n(i,"Major"),l=document.createElement("div");l.className="construct-tab__panel-content",l.appendChild(r.element);const c=document.createElement("div");c.className="construct-tab__panel-content",c.appendChild(a.element);const h=document.createElement("div");h.className="construct-tab__panel-content",h.appendChild(o.element);const d=document.createElement("div");d.className="construct-tab__container",d.style.height="100%",d.style.overflow="hidden";const p=()=>{this.engineComponent?.showAllModels(),r.checkAllNodes(!0),a.checkAllNodes(!0),o.checkAllNodes(!0)},u=new f9({container:d,tabs:[{id:"component",title:"tab.component",content:l},{id:"type",title:"tab.type",content:c},{id:"major",title:"tab.major",content:h}],activeId:"component",onChange:()=>{this.dialog?.fitWidth()}});u.init(),p();const v=this.registry.on("menu:show-all",()=>{p()});this.dialog=this.registry.dialog.create({title:"constructTree.title",minWidth:320,height:600,content:d,position:{x:20,y:20},resizable:!1,onClose:()=>{v(),u.destroy(),r.destroy(),a.destroy(),o.destroy(),this.setVisible(!0)}}),this.dialog?.fitWidth()}refresh(){this.toolbar?.render()}destroy(){this.toolbar?.destroy(),this.toolbar=null,super.destroy()}addGroup(e,t){this.toolbar?.addGroup(e,t),this.toolbar?.render()}addButton(e){this.toolbar?.addButton(e),this.toolbar?.render()}setButtonVisibility(e,t){this.toolbar?.updateButtonVisibility(e,t)}setShowLabel(e){this.toolbar?.setShowLabel(e)}setVisible(e){this.toolbarContainer&&(this.toolbarContainer.style.visibility=e?"visible":"hidden")}setBackgroundColor(e){this.toolbar?.setBackgroundColor(e)}setColors(e){this.toolbar?.setColors(e)}}class x9{events=new Map;on(e,t){return this.events.has(e)||this.events.set(e,[]),this.events.get(e).push(t),()=>this.off(e,t)}off(e,t){const i=this.events.get(e);if(!i)return;const n=i.indexOf(t);n!==-1&&i.splice(n,1)}emit(e,t){const i=this.events.get(e);i&&i.forEach(n=>{try{n(t)}catch(r){console.error(`[EventEmitter] Error in listener for event "${e}":`,r)}})}clear(){this.events.clear()}}class Sm{eventEmitter=new x9;container=null;wrapper=null;toolbar=null;dialog=null;engine3d=null;buttonGroup=null;rightKey=null;constructTree=null;measure=null;walkControl=null;sectionPlane=null;sectionAxis=null;sectionBox=null;walkPath=null;walkPlanView=null;engineInfo=null;componentDetail=null;aiChat=null;setting=null;radialToolbar=null;bottomDock=null;measureDock=null;sectionDock=null;walkDock=null;constructor(){}reset(){this.eventEmitter.clear(),this.container=null,this.wrapper=null,this.toolbar=null,this.dialog=null,this.engine3d=null,this.buttonGroup=null,this.rightKey=null,this.constructTree=null,this.measure=null,this.walkControl=null,this.sectionPlane=null,this.sectionAxis=null,this.sectionBox=null,this.walkPath=null,this.walkPlanView=null,this.engineInfo=null,this.componentDetail=null,this.aiChat=null,this.setting=null,this.radialToolbar=null,this.bottomDock=null,this.measureDock=null,this.sectionDock=null,this.walkDock=null}emit(e,t){this.eventEmitter.emit(e,t)}on(e,t){return this.eventEmitter.on(e,t)}off(e,t){this.eventEmitter.off(e,t)}clearEvents(){this.eventEmitter.clear()}}class _9{container;wrapper=null;sizeEl=null;resizeObserver=null;lastSyncedWidth=-1;lastSyncedHeight=-1;registry;dialog=null;engine=null;rightKey=null;radialToolbar=null;bottomDock=null;measureDock=null;sectionDock=null;walkDock=null;measure=null;sectionPlane=null;sectionAxis=null;sectionBox=null;walkControl=null;engineInfo=null;componentDetail=null;aiChat=null;setting=null;constructTreeBtn=null;handleWindowResize=()=>{this.updateClientSizeDisplay()};constructor(e,t){const i=typeof e=="string"?document.getElementById(e):e;if(!i)throw new Error("Container not found");this.container=i,this.registry=new Sm,t?.locale&&Zt.setLocale(t.locale),t?.theme&&(t.theme==="custom"?console.warn("Custom theme should be set via setCustomTheme()."):ct.setTheme(t.theme)),this.init()}emit(e,t){this.registry.emit(e,t)}on(e,t){return this.registry.on(e,t)}setLocale(e){Zt.setLocale(e)}getLocale(){return Zt.getLocale()}setTheme(e){ct.setTheme(e)}setCustomTheme(e){ct.setCustomTheme(e)}init(){this.container.innerHTML="",this.wrapper=document.createElement("div"),this.wrapper.className="bim-engine-wrapper",this.container.appendChild(this.wrapper);const e=document.createElement("div");e.className="bim-engine-version",e.textContent="v2.5.2",this.wrapper.appendChild(e),this.sizeEl=document.createElement("div"),this.sizeEl.className="bim-engine-size",this.wrapper.appendChild(this.sizeEl),this.updateClientSizeDisplay(),this.bindSizeObserver(),this.registry.container=this.container,this.registry.wrapper=this.wrapper,this.engine=new E2(this.wrapper,this.registry),this.dialog=new gy(this.wrapper,this.registry),this.rightKey=new ay(this.wrapper,this.registry),this.bottomDock=new A2(this.wrapper,this.registry),this.registry.bottomDock=this.bottomDock,this.measureDock=new D2(this.registry),this.registry.measureDock=this.measureDock,this.measureDock.init(),this.sectionDock=new N2(this.registry),this.registry.sectionDock=this.sectionDock,this.sectionDock.init(),this.walkDock=new U2(this.registry),this.registry.walkDock=this.walkDock,this.walkDock.init(),this.radialToolbar=new C2(this.wrapper,this.registry),this.measure=new B2(this.registry),this.sectionPlane=new F2(this.registry),this.sectionAxis=new z2(this.registry),this.sectionBox=new V2(this.registry),this.walkControl=new G2(this.registry),this.walkControl.init(),this.engineInfo=new W2(this.registry),this.engineInfo.init(),this.registry.engine3d=this.engine,this.registry.dialog=this.dialog,this.registry.rightKey=this.rightKey,this.registry.radialToolbar=this.radialToolbar,this.registry.measure=this.measure,this.registry.sectionPlane=this.sectionPlane,this.registry.sectionAxis=this.sectionAxis,this.registry.sectionBox=this.sectionBox,this.registry.walkControl=this.walkControl,this.registry.engineInfo=this.engineInfo,this.componentDetail=new j2(this.registry),this.registry.componentDetail=this.componentDetail,this.componentDetail.init(),this.aiChat=new q2(this.registry),this.registry.aiChat=this.aiChat,this.aiChat.init(),this.constructTreeBtn=new y9(this.wrapper,this.registry),this.registry.constructTree=this.constructTreeBtn,this.setting=new Rr(this.registry),this.registry.setting=this.setting,this.setting.init(),this.updateTheme(ct.getTheme()),ct.subscribe(t=>{this.updateTheme(t)})}updateTheme(e){this.wrapper&&(this.wrapper.style.color=e.textPrimary)}updateClientSizeDisplay(){const e=this.container.clientWidth,t=this.container.clientHeight;this.sizeEl&&(this.sizeEl.textContent=`${e}px x ${t}px`),this.syncEngineSize(e,t)}syncEngineSize(e,t){e<=0||t<=0||e===this.lastSyncedWidth&&t===this.lastSyncedHeight||(this.lastSyncedWidth=e,this.lastSyncedHeight=t,this.engine?.getEngineComponent()?.resize(e,t))}bindSizeObserver(){if(typeof ResizeObserver<"u"){this.resizeObserver=new ResizeObserver(()=>{this.updateClientSizeDisplay()}),this.resizeObserver.observe(this.container);return}window.addEventListener("resize",this.handleWindowResize)}unbindSizeObserver(){if(this.resizeObserver){this.resizeObserver.disconnect(),this.resizeObserver=null;return}window.removeEventListener("resize",this.handleWindowResize)}destroy(){this.unbindSizeObserver(),this.radialToolbar?.destroy(),this.measureDock?.destroy(),this.sectionDock?.destroy(),this.walkDock?.destroy(),this.bottomDock?.destroy(),this.engine?.destroy(),this.dialog?.destroy(),this.rightKey?.destroy(),this.measure?.destroy(),this.sectionPlane?.destroy(),this.sectionAxis?.destroy(),this.sectionBox?.destroy(),this.walkControl?.destroy(),this.constructTreeBtn?.destroy(),this.aiChat?.destroy(),this.setting?.destroy(),this.sizeEl=null,this.lastSyncedWidth=-1,this.lastSyncedHeight=-1,this.container.innerHTML="",this.registry.reset()}}class b9{container;wrapper=null;sizeEl=null;resizeObserver=null;lastSyncedWidth=-1;lastSyncedHeight=-1;unsubscribeTheme=null;registry;dialog=null;engine=null;rightKey=null;radialToolbar=null;bottomDock=null;measureDock=null;sectionDock=null;walkDock=null;measure=null;sectionPlane=null;sectionAxis=null;sectionBox=null;walkControl=null;engineInfo=null;componentDetail=null;aiChat=null;setting=null;handleWindowResize=()=>{this.updateClientSizeDisplay()};constructor(e,t){const i=typeof e=="string"?document.getElementById(e):e;if(!i)throw new Error("Container not found");this.container=i,this.registry=new Sm,t?.locale&&Zt.setLocale(t.locale),t?.theme&&(t.theme==="custom"?console.warn("Custom theme should be set via setCustomTheme()."):ct.setTheme(t.theme)),this.init()}emit(e,t){this.registry.emit(e,t)}on(e,t){return this.registry.on(e,t)}setLocale(e){Zt.setLocale(e)}getLocale(){return Zt.getLocale()}setTheme(e){ct.setTheme(e)}setCustomTheme(e){ct.setCustomTheme(e)}init(){this.container.innerHTML="",this.wrapper=document.createElement("div"),this.wrapper.className="bim-engine-wrapper",this.container.appendChild(this.wrapper);const e=document.createElement("div");e.className="bim-engine-version",e.textContent="v2.5.2",this.wrapper.appendChild(e),this.sizeEl=document.createElement("div"),this.sizeEl.className="bim-engine-size",this.wrapper.appendChild(this.sizeEl),this.updateClientSizeDisplay(),this.bindSizeObserver(),this.registry.container=this.container,this.registry.wrapper=this.wrapper,this.engine=new E2(this.wrapper,this.registry),this.dialog=new gy(this.wrapper,this.registry),this.rightKey=new ay(this.wrapper,this.registry),this.bottomDock=new A2(this.wrapper,this.registry),this.registry.bottomDock=this.bottomDock,this.registry.engine3d=this.engine,this.registry.dialog=this.dialog,this.registry.rightKey=this.rightKey,this.measureDock=new D2(this.registry),this.registry.measureDock=this.measureDock,this.measureDock.init(),this.sectionDock=new N2(this.registry),this.registry.sectionDock=this.sectionDock,this.sectionDock.init(),this.walkDock=new U2(this.registry),this.registry.walkDock=this.walkDock,this.walkDock.init(),this.radialToolbar=new C2(this.wrapper,this.registry),this.measure=new B2(this.registry),this.sectionPlane=new F2(this.registry),this.sectionAxis=new z2(this.registry),this.sectionBox=new V2(this.registry),this.walkControl=new G2(this.registry),this.walkControl.init(),this.engineInfo=new W2(this.registry),this.engineInfo.init(),this.registry.radialToolbar=this.radialToolbar,this.registry.measure=this.measure,this.registry.sectionPlane=this.sectionPlane,this.registry.sectionAxis=this.sectionAxis,this.registry.sectionBox=this.sectionBox,this.registry.walkControl=this.walkControl,this.registry.engineInfo=this.engineInfo,this.componentDetail=new j2(this.registry),this.registry.componentDetail=this.componentDetail,this.componentDetail.init(),this.aiChat=new q2(this.registry),this.registry.aiChat=this.aiChat,this.aiChat.init(),this.setting=new Rr(this.registry),this.registry.setting=this.setting,this.setting.init(),this.updateTheme(ct.getTheme()),this.unsubscribeTheme=ct.subscribe(t=>{this.updateTheme(t)})}updateTheme(e){this.wrapper&&(this.wrapper.style.color=e.textPrimary)}updateClientSizeDisplay(){const e=this.container.clientWidth,t=this.container.clientHeight;this.sizeEl&&(this.sizeEl.textContent=`${e}px x ${t}px`),this.syncEngineSize(e,t)}syncEngineSize(e,t){e<=0||t<=0||e===this.lastSyncedWidth&&t===this.lastSyncedHeight||(this.lastSyncedWidth=e,this.lastSyncedHeight=t,this.engine?.getEngineComponent()?.resize(e,t))}bindSizeObserver(){if(typeof ResizeObserver<"u"){this.resizeObserver=new ResizeObserver(()=>{this.updateClientSizeDisplay()}),this.resizeObserver.observe(this.container);return}window.addEventListener("resize",this.handleWindowResize)}unbindSizeObserver(){if(this.resizeObserver){this.resizeObserver.disconnect(),this.resizeObserver=null;return}window.removeEventListener("resize",this.handleWindowResize)}destroy(){this.unbindSizeObserver(),this.unsubscribeTheme&&(this.unsubscribeTheme(),this.unsubscribeTheme=null),this.radialToolbar?.destroy(),this.measureDock?.destroy(),this.sectionDock?.destroy(),this.walkDock?.destroy(),this.bottomDock?.destroy(),this.engine?.destroy(),this.dialog?.destroy(),this.rightKey?.destroy(),this.measure?.destroy(),this.sectionPlane?.destroy(),this.sectionAxis?.destroy(),this.sectionBox?.destroy(),this.walkControl?.destroy(),this.aiChat?.destroy(),this.setting?.destroy(),this.sizeEl=null,this.lastSyncedWidth=-1,this.lastSyncedHeight=-1,this.container.innerHTML="",this.registry.reset()}}class M9{engine=null;registry;container;containerId;options;_isInitialized=!1;_isDestroyed=!1;unsubscribeTheme=null;constructor(e,t){this.registry=t,this.container=e.container,this.container.id?this.containerId=this.container.id:(this.containerId=`engine2d-container-${Date.now()}-${Math.random().toString(36).substr(2,9)}`,this.container.id=this.containerId),this.options={backgroundColor:e.backgroundColor??1710618,gridEnabled:e.gridEnabled??!0,axesEnabled:e.axesEnabled??!0,selectionColor:e.selectionColor,highlightColor:e.highlightColor,enablePerformanceMonitoring:e.enablePerformanceMonitoring??!0}}init(){if(this._isInitialized){console.warn("[Engine2d] Engine already initialized.");return}if(this._isDestroyed){console.error("[Engine2d] Cannot initialize destroyed engine.");return}try{const e={containerId:this.containerId,backgroundColor:this.options.backgroundColor,gridEnabled:this.options.gridEnabled,axesEnabled:this.options.axesEnabled};if(this.options.selectionColor!==void 0&&(e.selectionColor=this.options.selectionColor),this.options.highlightColor!==void 0&&(e.highlightColor=this.options.highlightColor),this.options.enablePerformanceMonitoring!==void 0&&(e.enablePerformanceMonitoring=this.options.enablePerformanceMonitoring),console.log("[Engine2d] 引擎配置信息:",e),this.engine=Fz(e),!this.engine)throw new Error("Failed to create 2D engine instance");this._isInitialized=!0,this.unsubscribeTheme=ct.subscribe(t=>{this.setTheme(t)}),this.setTheme(ct.getTheme()),this.engine.events&&(this.engine.events.on("entity-click",t=>{console.log("[Engine2d] 实体点击:",t),this.registry.emit("engine2d:entity-clicked",{data:t})}),this.engine.events.on("layer-visibility-changed",t=>{console.log("[Engine2d] 图层可见性变更:",t),this.registry.emit("engine2d:layer-changed",{data:t})}))}catch(e){throw console.error("[Engine2d] Failed to initialize 2D engine:",e),this._isInitialized=!1,e}}setTheme(e){}setLocales(){}isInitialized(){return this._isInitialized}async loadDrawing(e,t){if(!this._isInitialized||!this.engine){console.error("[Engine2d] Engine not initialized. Please call init() first.");return}if(!e){console.error("[Engine2d] Drawing URL is required.");return}try{console.log("[Engine2d] 开始加载图纸:",e),await this.engine.loadModel(e,t),console.log("[Engine2d] 图纸加载完成:",e),this.registry.emit("engine2d:drawing-loaded",{url:e})}catch(i){throw console.error("[Engine2d] 图纸加载失败:",i),i}}getLayers(){if(!this._isInitialized||!this.engine)return[];try{return this.engine.getLayers?.()??[]}catch(e){return console.warn("[Engine2d] Failed to get layers:",e),[]}}setLayerVisible(e,t){if(!this._isInitialized||!this.engine){console.warn("[Engine2d] Engine not initialized.");return}try{this.engine.setLayerVisible?.(e,t)}catch(i){console.warn("[Engine2d] Failed to set layer visibility:",i)}}resetView(){if(!(!this._isInitialized||!this.engine))try{this.engine.resetView?.()}catch(e){console.warn("[Engine2d] Failed to reset view:",e)}}fitToView(){if(!(!this._isInitialized||!this.engine))try{this.engine.fitToView?.()}catch(e){console.warn("[Engine2d] Failed to fit to view:",e)}}setZoom(e){!this._isInitialized||!this.engine||this.engine.setZoom?.(e)}getZoom(){return!this._isInitialized||!this.engine?1:this.engine.getZoom?.()??1}setBackgroundColor(e){!this._isInitialized||!this.engine||this.engine.setBackgroundColor?.(e)}clearScene(){!this._isInitialized||!this.engine||this.engine.clearScene?.()}resize(){!this._isInitialized||!this.engine||this.engine.resize?.()}onRawEvent(e,t){this.engine?.events?.on(e,t)}offRawEvent(e,t){this.engine?.events?.off(e,t)}destroy(){if(!this._isDestroyed){if(this.unsubscribeTheme&&(this.unsubscribeTheme(),this.unsubscribeTheme=null),this.engine){try{this.engine.dispose?.()}catch(e){console.warn("[Engine2d] Error during dispose:",e)}this.engine=null}this.container.innerHTML="",this._isDestroyed=!0,this._isInitialized=!1}}}class S9{container;registry;engineComponent=null;constructor(e,t){const i=typeof e=="string"?document.getElementById(e):e;if(!i)throw new Error("Container not found");this.container=i,this.registry=new Sm,t?.locale&&Zt.setLocale(t.locale),t?.theme&&t.theme!=="custom"&&ct.setTheme(t.theme),this.engineComponent=new M9({container:this.container,backgroundColor:t?.backgroundColor,gridEnabled:t?.gridEnabled,axesEnabled:t?.axesEnabled,selectionColor:t?.selectionColor,highlightColor:t?.highlightColor,enablePerformanceMonitoring:t?.enablePerformanceMonitoring},this.registry),this.engineComponent.init()}async loadDrawing(e,t){return this.engineComponent?.loadDrawing(e,t)}getLayers(){return this.engineComponent?.getLayers()??[]}setLayerVisible(e,t){this.engineComponent?.setLayerVisible(e,t)}resetView(){this.engineComponent?.resetView()}fitToView(){this.engineComponent?.fitToView()}setZoom(e){this.engineComponent?.setZoom(e)}getZoom(){return this.engineComponent?.getZoom()??1}setTheme(e){ct.setTheme(e)}on(e,t){return this.registry.on(e,t)}off(e,t){this.registry.off(e,t)}onRawEvent(e,t){this.engineComponent?.onRawEvent(e,t)}offRawEvent(e,t){this.engineComponent?.offRawEvent(e,t)}destroy(){this.engineComponent?.destroy(),this.engineComponent=null,this.registry.reset()}}class w9{engine=null;registry;container;containerId;options;_isInitialized=!1;_isDestroyed=!1;unsubscribeTheme=null;constructor(e,t){this.registry=t,this.container=e.container,this.container.id?this.containerId=this.container.id:(this.containerId=`engine720-container-${Date.now()}-${Math.random().toString(36).substr(2,9)}`,this.container.id=this.containerId),this.options={fov:e.fov??75,enableZoom:e.enableZoom??!0,enableRotate:e.enableRotate??!0,sphereRadius:e.sphereRadius??500,rotateSpeed:e.rotateSpeed,zoomSpeed:e.zoomSpeed,enableDamping:e.enableDamping,dampingFactor:e.dampingFactor,minFov:e.minFov,maxFov:e.maxFov}}init(){if(this._isInitialized){console.warn("[Engine720] Engine already initialized.");return}if(this._isDestroyed){console.error("[Engine720] Cannot initialize destroyed engine.");return}try{const e={containerId:this.containerId,fov:this.options.fov,enableZoom:this.options.enableZoom,enableRotate:this.options.enableRotate,sphereRadius:this.options.sphereRadius};if(this.options.rotateSpeed!==void 0&&(e.rotateSpeed=this.options.rotateSpeed),this.options.zoomSpeed!==void 0&&(e.zoomSpeed=this.options.zoomSpeed),this.options.enableDamping!==void 0&&(e.enableDamping=this.options.enableDamping),this.options.dampingFactor!==void 0&&(e.dampingFactor=this.options.dampingFactor),this.options.minFov!==void 0&&(e.minFov=this.options.minFov),this.options.maxFov!==void 0&&(e.maxFov=this.options.maxFov),console.log("[Engine720] 引擎配置信息:",e),this.engine=zz(e),!this.engine)throw new Error("Failed to create 720 engine instance");this._isInitialized=!0,this.unsubscribeTheme=ct.subscribe(t=>{this.setTheme(t)}),this.setTheme(ct.getTheme()),this.engine.events&&(this.engine.events.on("panorama-loaded",t=>{console.log("[Engine720] 全景加载完成:",t),this.registry.emit("engine720:panorama-loaded",{data:t})}),this.engine.events.on("panorama-load-error",t=>{console.error("[Engine720] 全景加载失败:",t),this.registry.emit("engine720:load-error",{data:t})}),this.engine.events.on("annotation-click",t=>{console.log("[Engine720] 标注点击:",t),this.registry.emit("engine720:annotation-click",{data:t})}),this.engine.events.on("view-angle-changed",t=>{this.registry.emit("engine720:view-changed",{data:t})}))}catch(e){throw console.error("[Engine720] Failed to initialize 720 engine:",e),this._isInitialized=!1,e}}setTheme(e){!this._isInitialized||this.engine}setLocales(){}isInitialized(){return this._isInitialized}async loadPanorama(e,t){if(!this._isInitialized||!this.engine){console.error("[Engine720] Engine not initialized. Please call init() first.");return}if(!e){console.error("[Engine720] Panorama URL is required.");return}try{console.log("[Engine720] 开始加载全景图:",e),await this.engine.loadPanorama(e),console.log("[Engine720] 全景图加载完成:",e)}catch(i){throw console.error("[Engine720] 全景图加载失败:",i),i}}async preloadPanoramas(e){if(!(!this._isInitialized||!this.engine))try{await this.engine.preloadPanoramas?.(e)}catch(t){console.warn("[Engine720] Failed to preload panoramas:",t)}}setFov(e){!this._isInitialized||!this.engine||this.engine.setFov?.(e)}getFov(){return!this._isInitialized||!this.engine?75:this.engine.getFov?.()??75}lookAt(e,t,i){!this._isInitialized||!this.engine||this.engine.lookAt?.(e,t,i)}resetView(){if(!(!this._isInitialized||!this.engine))try{this.engine.lookAt?.(0,0,!0),this.engine.setFov?.(75)}catch(e){console.warn("[Engine720] Failed to reset view:",e)}}pauseRendering(){!this._isInitialized||!this.engine||this.engine.pauseRendering?.()}resumeRendering(){!this._isInitialized||!this.engine||this.engine.resumeRendering?.()}resize(e,t){!this._isInitialized||!this.engine||this.engine.resize?.(e,t)}onRawEvent(e,t){this.engine?.events?.on(e,t)}offRawEvent(e,t){this.engine?.events?.off(e,t)}destroy(){if(!this._isDestroyed){if(this.unsubscribeTheme&&(this.unsubscribeTheme(),this.unsubscribeTheme=null),this.engine){try{this.engine.dispose?.()}catch(e){console.warn("[Engine720] Error during dispose:",e)}this.engine=null}this.container.innerHTML="",this._isDestroyed=!0,this._isInitialized=!1}}}class E9{container;registry;engineComponent=null;constructor(e,t){const i=typeof e=="string"?document.getElementById(e):e;if(!i)throw new Error("Container not found");this.container=i,this.registry=new Sm,t?.locale&&Zt.setLocale(t.locale),t?.theme&&t.theme!=="custom"&&ct.setTheme(t.theme),this.engineComponent=new w9({container:this.container,fov:t?.fov,enableZoom:t?.enableZoom,enableRotate:t?.enableRotate,sphereRadius:t?.sphereRadius,rotateSpeed:t?.rotateSpeed,zoomSpeed:t?.zoomSpeed,enableDamping:t?.enableDamping,dampingFactor:t?.dampingFactor,minFov:t?.minFov,maxFov:t?.maxFov},this.registry),this.engineComponent.init()}async loadPanorama(e,t){return this.engineComponent?.loadPanorama(e,t)}async preloadPanoramas(e){return this.engineComponent?.preloadPanoramas(e)}setFov(e){this.engineComponent?.setFov(e)}getFov(){return this.engineComponent?.getFov()??75}lookAt(e,t,i){this.engineComponent?.lookAt(e,t,i)}resetView(){this.engineComponent?.resetView()}setTheme(e){ct.setTheme(e)}on(e,t){return this.registry.on(e,t)}off(e,t){this.registry.off(e,t)}onRawEvent(e,t){this.engineComponent?.onRawEvent(e,t)}offRawEvent(e,t){this.engineComponent?.offRawEvent(e,t)}destroy(){this.engineComponent?.destroy(),this.engineComponent=null,this.registry.reset()}}const T9=Object.freeze(Object.defineProperty({__proto__:null,default:`# BIM引擎AI助手 - 需求分析与步骤规划专家\r
9884
+ `}bindQuestionEvents(){this.messagesContainer?.querySelectorAll(".bim-ai-option").forEach(e=>{e.addEventListener("click",t=>{const i=t.currentTarget,n=i.dataset.questionId,r=i.dataset.optionId;if(n&&r){const a=this.messages.find(o=>o.id===n);a&&!a.answered&&(a.selectedOptionId=r,this.renderMessages())}})}),this.messagesContainer?.querySelectorAll(".bim-ai-option-input").forEach(e=>{e.addEventListener("input",t=>{const i=t.target,n=i.dataset.questionId;if(n){const r=this.messages.find(a=>a.id===n);r&&(r.customAnswer=i.value)}})}),this.messagesContainer?.querySelectorAll(".bim-ai-question-submit").forEach(e=>{e.addEventListener("click",t=>{const n=t.currentTarget.dataset.questionId;if(n){const r=this.messages.find(a=>a.id===n);r&&r.selectedOptionId&&(r.answered=!0,this.renderMessages(),this.options.onQuestionSubmit?.(n,r.selectedOptionId,r.customAnswer))}})})}scrollToBottom(){this.messagesContainer&&(this.messagesContainer.scrollTop=this.messagesContainer.scrollHeight)}escapeHtml(e){const t=document.createElement("div");return t.textContent=e,t.innerHTML}destroy(){this._isDestroyed||(this.unsubscribeTheme&&(this.unsubscribeTheme(),this.unsubscribeTheme=null),this.unsubscribeLocale&&(this.unsubscribeLocale(),this.unsubscribeLocale=null),this.element.remove(),this._isDestroyed=!0)}}class q2{aiChat=null;registry;initialized=!1;constructor(e){this.registry=e}init(){if(this.initialized)return;const e=this.registry.wrapper;if(!e){console.warn("[AiChatManager] wrapper 不存在,无法初始化");return}this.aiChat=new h9({container:e,width:440,title:"aiChat.title",placeholder:"aiChat.placeholder",quickPrompts:[{id:"summarize",label:"aiChat.quickPrompt.summarize"},{id:"explain",label:"aiChat.quickPrompt.explain"},{id:"generate",label:"aiChat.quickPrompt.generate"}],onSend:t=>{console.log("[AiChatManager] 用户发送消息:",t),this.aiChat?.addUserMessage(t),this.registry.emit("aiChat:message-sent",{message:t})},onQuestionSubmit:(t,i,n)=>{console.log("[AiChatManager] 用户回答问题:",{questionId:t,optionId:i,customAnswer:n}),this.registry.emit("aiChat:question-answered",{questionId:t,optionId:i,customAnswer:n})},onNewChat:()=>{console.log("[AiChatManager] 新建对话"),this.registry.emit("aiChat:new-chat",{})},onHistory:()=>{console.log("[AiChatManager] 打开历史"),this.registry.emit("aiChat:history-opened",{})},onSettings:()=>{console.log("[AiChatManager] 打开设置"),this.registry.emit("aiChat:settings-opened",{})},onClose:()=>{console.log("[AiChatManager] 关闭 AI 聊天"),this.registry.emit("aiChat:closed",{}),this.registry.toolbar?.setBtnActive("aiChat",!1)}}),this.initialized=!0}show(){this.aiChat||this.init(),this.aiChat?.show(),this.registry.emit("aiChat:opened",{}),this.registry.toolbar?.setBtnActive("aiChat",!0)}hide(){this.aiChat?.hide(),this.registry.emit("aiChat:closed",{}),this.registry.toolbar?.setBtnActive("aiChat",!1)}toggle(){this.aiChat?.isVisible()?this.hide():this.show()}isVisible(){return this.aiChat?.isVisible()??!1}addUserMessage(e){return this.aiChat?.addUserMessage(e)??""}addAiMessage(e){return this.aiChat?.addAiMessage(e)??""}addStepMessage(e,t){return this.aiChat?.addStepMessage(e,t)??""}addThinkingMessage(){return this.aiChat?.addThinkingMessage()??""}addQuestionMessage(e,t,i){return this.aiChat?.addQuestionMessage(e,t,i)??""}updateMessage(e,t){this.aiChat?.updateMessage(e,t)}removeMessage(e){this.aiChat?.removeMessage(e)}clearMessages(){this.aiChat?.clearMessages()}destroy(){this.aiChat&&(this.aiChat.destroy(),this.aiChat=null),this.initialized=!1}}class d9{container;options;groups=[];activeBtnIds=new Set;btnRefs=new Map;dropdownElement=null;hoverTimeout=null;customColors=new Set;unsubscribeLocale=null;unsubscribeTheme=null;DEFAULT_ICON='<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><rect x="3" y="3" width="18" height="18" rx="2" ry="2"></rect></svg>';constructor(e){const t=typeof e.container=="string"?document.getElementById(e.container):e.container;if(!t)throw new Error("Container not found");this.container=t,this.options={showLabel:!0,visibility:{},direction:"row",position:"static",align:"vertical",expand:"down",...e},["backgroundColor","btnBackgroundColor","btnHoverColor","btnActiveColor","iconColor","iconActiveColor","textColor","textActiveColor"].forEach(n=>{e[n]&&this.customColors.add(n)}),this.initContainer(),this.applyStyles()}emit(e,t){this.options.registry?.emit(e,t)}initContainer(){this.container.innerHTML="",this.container.classList.add("bim-btn-group-root"),this.options.direction==="column"?this.container.classList.add("dir-column"):this.container.classList.add("dir-row"),this.options.className&&this.container.classList.add(this.options.className),this.options.type&&this.options.type!=="default"&&this.container.classList.add(`type-${this.options.type}`),this.updatePosition(),this.setupEventInterception(this.container)}setupEventInterception(e){const t=n=>{n.stopPropagation()};["click","dblclick","contextmenu","wheel","mousedown","mouseup","mousemove","touchstart","touchend","touchmove","pointerdown","pointerup","pointermove","pointerenter","pointerleave","pointerover","pointerout"].forEach(n=>{e.addEventListener(n,t,{passive:!1})})}updatePosition(){const e=this.options.position,t=this.container.style;if(t.top="",t.bottom="",t.left="",t.right="",t.transform="",e==="static"){this.container.classList.add("static");return}if(this.container.classList.remove("static"),this.container.style.position="absolute",typeof e=="object"&&"x"in e)t.left=`${e.x}px`,t.top=`${e.y}px`;else{const i="20px";switch(e){case"top-left":t.top=i,t.left=i;break;case"top-center":t.top=i,t.left="50%",t.transform="translateX(-50%)";break;case"top-right":t.top=i,t.right=i;break;case"bottom-left":t.bottom=i,t.left=i;break;case"bottom-center":t.bottom=i,t.left="50%",t.transform="translateX(-50%)";break;case"bottom-right":t.bottom=i,t.right=i;break;case"left-center":t.left=i,t.top="50%",t.transform="translateY(-50%)";break;case"right-center":t.right=i,t.top="50%",t.transform="translateY(-50%)";break;case"center":t.top="50%",t.left="50%",t.transform="translate(-50%, -50%)";break}}}applyStyles(){const e=this.container.style;this.options.backgroundColor&&e.setProperty("--bim-btn-group-section-bg",this.options.backgroundColor),this.options.btnBackgroundColor&&e.setProperty("--bim-btn-bg",this.options.btnBackgroundColor),this.options.btnHoverColor&&e.setProperty("--bim-btn-hover-bg",this.options.btnHoverColor),this.options.btnActiveColor&&e.setProperty("--bim-btn-active-bg",this.options.btnActiveColor),this.options.iconColor&&e.setProperty("--bim-icon-color",this.options.iconColor),this.options.iconActiveColor&&e.setProperty("--bim-icon-active-color",this.options.iconActiveColor),this.options.textColor&&e.setProperty("--bim-btn-text-color",this.options.textColor),this.options.textActiveColor&&e.setProperty("--bim-btn-text-active-color",this.options.textActiveColor),document.querySelectorAll(".opt-btn-dropdown").forEach(i=>{const n=i.style;this.options.iconColor&&n.setProperty("--bim-icon-color",this.options.iconColor),this.options.iconActiveColor&&n.setProperty("--bim-icon-active-color",this.options.iconActiveColor),this.options.textColor&&n.setProperty("--bim-btn-text-color",this.options.textColor),this.options.textActiveColor&&n.setProperty("--bim-btn-text-active-color",this.options.textActiveColor),this.options.btnBackgroundColor&&n.setProperty("--bim-btn-bg",this.options.btnBackgroundColor),this.options.btnHoverColor&&n.setProperty("--bim-btn-hover-bg",this.options.btnHoverColor),this.options.btnActiveColor&&n.setProperty("--bim-btn-active-bg",this.options.btnActiveColor)})}setPrimaryColor(e){this.container.style.setProperty("--bim-primary-color",e),document.querySelectorAll(".opt-btn-dropdown").forEach(i=>{i.style.setProperty("--bim-primary-color",e)})}setTheme(e){const t={backgroundColor:e.bgElevated,btnBackgroundColor:e.componentBg,btnHoverColor:e.componentBgHover,btnActiveColor:e.componentBgActive,iconColor:e.iconDefault,iconActiveColor:e.iconActive,textColor:e.textSecondary,textActiveColor:e.textPrimary};Object.entries(t).forEach(([i,n])=>{const r=i;this.customColors.has(r)||(this.options[r]=n)}),this.container.classList.remove("theme-dark","theme-light"),this.container.classList.add(`theme-${e.name}`),this.applyStyles(),this.setPrimaryColor(e.primary),this.applyThemeCssVars(e)}applyThemeCssVars(e){const t=this.container.style;t.setProperty("--bim-primary",e.primary),t.setProperty("--bim-primary-hover",e.primaryHover),t.setProperty("--bim-primary-active",e.primaryActive),t.setProperty("--bim-bg-glass",e.bgGlass),t.setProperty("--bim-bg-glass-blur",e.bgGlassBlur),t.setProperty("--bim-bg-elevated",e.bgElevated),t.setProperty("--bim-bg-overlay",e.bgOverlay),t.setProperty("--bim-bg-inset",e.bgInset),t.setProperty("--bim-text-primary",e.textPrimary),t.setProperty("--bim-text-secondary",e.textSecondary),t.setProperty("--bim-text-tertiary",e.textTertiary),t.setProperty("--bim-text-inverse",e.textInverse),t.setProperty("--bim-icon-default",e.iconDefault),t.setProperty("--bim-icon-hover",e.iconHover),t.setProperty("--bim-icon-active",e.iconActive),t.setProperty("--bim-icon-inverse",e.iconInverse),t.setProperty("--bim-border-default",e.borderDefault),t.setProperty("--bim-border-subtle",e.borderSubtle),t.setProperty("--bim-component-bg-hover",e.componentBgHover),t.setProperty("--bim-component-bg-active",e.componentBgActive),t.setProperty("--bim-shadow-sm",e.shadowSm),t.setProperty("--bim-shadow-md",e.shadowMd),t.setProperty("--bim-shadow-lg",e.shadowLg),t.setProperty("--bim-shadow-glow",e.shadowGlow),t.setProperty("--bim-floating-bg",e.floatingBg),t.setProperty("--bim-floating-border",e.floatingBorder),t.setProperty("--bim-floating-shadow",e.floatingShadow),t.setProperty("--bim-floating-btn-bg",e.floatingBtnBg),t.setProperty("--bim-floating-btn-border",e.floatingBtnBorder),t.setProperty("--bim-floating-btn-shadow",e.floatingBtnShadow),t.setProperty("--bim-floating-btn-bg-hover",e.floatingBtnBgHover),t.setProperty("--bim-floating-btn-shadow-hover",e.floatingBtnShadowHover),t.setProperty("--bim-floating-icon-color",e.floatingIconColor),t.setProperty("--bim-floating-icon-color-hover",e.floatingIconColorHover),this.syncDropdownCssVars(e)}syncDropdownCssVars(e){document.querySelectorAll(".opt-btn-dropdown").forEach(i=>{const n=i.style;n.setProperty("--bim-primary",e.primary),n.setProperty("--bim-bg-overlay",e.bgOverlay),n.setProperty("--bim-border-default",e.borderDefault),n.setProperty("--bim-text-primary",e.textPrimary),n.setProperty("--bim-text-inverse",e.textInverse),n.setProperty("--bim-shadow-lg",e.shadowLg),n.setProperty("--bim-floating-btn-bg",e.floatingBtnBg),n.setProperty("--bim-floating-btn-bg-hover",e.floatingBtnBgHover),n.setProperty("--bim-floating-icon-color",e.floatingIconColor)})}setColors(e){this.options={...this.options,...e},Object.keys(e).forEach(t=>{this.customColors.add(t)}),this.applyStyles()}async init(){this.render(),this.unsubscribeLocale=Zt.subscribe(()=>{this.setLocales()}),this.unsubscribeTheme=ct.subscribe(e=>{this.setTheme(e)})}setLocales(){this.render()}addGroup(e,t){if(this.groups.some(n=>n.id===e))return;const i={id:e,buttons:[]};if(t){const n=this.groups.findIndex(r=>r.id===t);n!==-1?this.groups.splice(n,0,i):this.groups.push(i)}else this.groups.push(i)}addButton(e){const{groupId:t,parentId:i}=e,n=this.groups.find(a=>a.id===t);if(!n)return;const r={...e,children:e.children||[]};if(i){const a=this.findButton(n.buttons,i);a&&(a.children||(a.children=[]),a.children.push(r))}else n.buttons.push(r)}findButton(e,t){for(const i of e){if(i.id===t)return i;if(i.children){const n=this.findButton(i.children,t);if(n)return n}}}render(){this.container.innerHTML="",this.btnRefs.clear(),this.groups.forEach((e,t)=>{const i=this.renderGroup(e,t,this.groups.length);this.container.appendChild(i)})}renderGroup(e,t,i){const n=document.createElement("div");return n.className="bim-btn-group-section",t<i-1&&n.classList.add("has-divider"),e.buttons.forEach(r=>{if(this.isVisible(r.id)){const a=this.renderButton(r);n.appendChild(a)}}),n}renderButton(e){const t=document.createElement("div");t.className="opt-btn-wrapper";const i=document.createElement("div");i.className="opt-btn",e.isActive&&this.activeBtnIds.add(e.id),(e.align||this.options.align||"vertical")==="horizontal"?i.classList.add("align-horizontal"):i.classList.add("align-vertical"),this.activeBtnIds.has(e.id)&&i.classList.add("active"),e.disabled&&i.classList.add("disabled"),this.options.showLabel&&e.label||(i.classList.add("no-label"),e.label&&(i.title=Se(e.label)));const a=e.iconSize||32,o=e.minWidth||50;i.style.minWidth=`${o}px`;const l=document.createElement("div");l.className="opt-btn-icon",l.style.width=`${a}px`,l.style.height=`${a}px`,l.innerHTML=this.getIcon(e.icon),i.appendChild(l);const c=document.createElement("div");if(c.className="opt-btn-text-wrapper",this.options.showLabel&&e.label){const h=document.createElement("span");h.className="opt-btn-label",h.textContent=Se(e.label),c.appendChild(h)}return c.hasChildNodes()&&i.appendChild(c),i.addEventListener("click",()=>this.handleClick(e)),i.addEventListener("mouseenter",()=>this.handleMouseEnter(e,i)),i.addEventListener("mouseleave",()=>this.handleMouseLeave()),this.btnRefs.set(e.id,i),t.appendChild(i),t}setBtnActive(e,t){const i=this.findButtonById(e);if(!i)return;const n=t!==void 0?t:!this.activeBtnIds.has(e);n?this.activeBtnIds.add(e):this.activeBtnIds.delete(e),i.isActive=n,this.updateButtonState(e)}handleClick(e){if(!e.disabled&&(!e.children||e.children.length===0)){if(e.keepActive){const i=!this.activeBtnIds.has(e.id);this.setBtnActive(e.id,i),i&&e.exclusive&&e.groupId&&this.deactivateExclusiveSiblings(e)}this.closeDropdown(),e.onClick&&e.onClick(e)}}deactivateExclusiveSiblings(e){const t=this.groups.find(i=>i.id===e.groupId);if(t){if(e.parentId){const n=this.findButton(t.buttons,e.parentId)?.children||[];for(const r of n)r&&r.id!==e.id&&r.parentId===e.parentId&&r.groupId===e.groupId&&this.activeBtnIds.has(r.id)&&(this.setBtnActive(r.id,!1),r.onClick&&r.onClick(r));return}for(const i of t.buttons)i.id!==e.id&&i.groupId===e.groupId&&(i.parentId||this.activeBtnIds.has(i.id)&&(this.setBtnActive(i.id,!1),i.onClick&&i.onClick(i)))}}handleMouseEnter(e,t){this.hoverTimeout&&clearTimeout(this.hoverTimeout),e.children&&e.children.length>0?this.showDropdown(e,t):this.closeDropdown()}handleMouseLeave(){this.hoverTimeout=window.setTimeout(()=>this.closeDropdown(),200)}showDropdown(e,t){if(this.closeDropdown(),!e.children)return;const i=document.createElement("div");i.className="opt-btn-dropdown",this.options.backgroundColor&&i.style.setProperty("--bim-toolbar-bg",this.options.backgroundColor);const n=i.style;this.options.iconColor&&n.setProperty("--bim-icon-color",this.options.iconColor),this.options.iconActiveColor&&n.setProperty("--bim-icon-active-color",this.options.iconActiveColor),this.options.textColor&&n.setProperty("--bim-btn-text-color",this.options.textColor),this.options.textActiveColor&&n.setProperty("--bim-btn-text-active-color",this.options.textActiveColor),this.options.btnBackgroundColor&&n.setProperty("--bim-btn-bg",this.options.btnBackgroundColor),this.options.btnHoverColor&&n.setProperty("--bim-btn-hover-bg",this.options.btnHoverColor),this.options.btnActiveColor&&n.setProperty("--bim-btn-active-bg",this.options.btnActiveColor);const r=t.getBoundingClientRect(),a=this.options.expand||"down";this.options.direction==="row"?i.style.flexDirection="column":i.style.flexDirection="row",this.options.type&&this.options.type!=="default"&&i.classList.add(`type-${this.options.type}`);const o=ct.getTheme();i.classList.add(`theme-${o.name}`),n.setProperty("--bim-primary",o.primary),n.setProperty("--bim-bg-overlay",o.bgOverlay),n.setProperty("--bim-border-default",o.borderDefault),n.setProperty("--bim-text-primary",o.textPrimary),n.setProperty("--bim-text-inverse",o.textInverse),n.setProperty("--bim-shadow-lg",o.shadowLg),n.setProperty("--bim-floating-btn-bg",o.floatingBtnBg),n.setProperty("--bim-floating-btn-bg-hover",o.floatingBtnBgHover),n.setProperty("--bim-floating-icon-color",o.floatingIconColor),document.body.appendChild(i),this.setupEventInterception(i),e.children.forEach(c=>{if(this.isVisible(c.id)){const h=this.renderDropdownItem(c);i.appendChild(h)}});const l=i.getBoundingClientRect();a==="up"?(i.style.bottom=window.innerHeight-r.top+8+"px",i.style.left=r.left+(r.width-l.width)/2+"px"):a==="down"?(i.style.top=r.bottom+8+"px",i.style.left=r.left+(r.width-l.width)/2+"px"):a==="right"?(i.style.top=r.top+(r.height-l.height)/2+"px",i.style.left=r.right+8+"px"):a==="left"&&(i.style.top=r.top+(r.height-l.height)/2+"px",i.style.right=window.innerWidth-r.left+8+"px"),i.addEventListener("mouseenter",()=>{this.hoverTimeout&&clearTimeout(this.hoverTimeout)}),i.addEventListener("mouseleave",()=>this.handleMouseLeave()),this.dropdownElement=i}renderDropdownItem(e){const t=document.createElement("div");t.className="opt-btn-dropdown-item",(e.align||"horizontal")==="horizontal"?t.classList.add("align-horizontal"):t.classList.add("align-vertical"),(this.activeBtnIds.has(e.id)||e.isActive)&&t.classList.add("active");const n=e.iconSize||32,r=e.minWidth;r&&(t.style.minWidth=`${r}px`);const a=document.createElement("div");if(a.className="opt-btn-icon",a.style.width=`${n}px`,a.style.height=`${n}px`,a.innerHTML=this.getIcon(e.icon),t.appendChild(a),this.options.showLabel&&e.label){const o=document.createElement("span");o.className="opt-btn-dropdown-label",o.textContent=Se(e.label),t.appendChild(o)}else e.label&&(t.title=Se(e.label));return t.addEventListener("click",o=>{o.stopPropagation(),this.handleClick(e)}),t}closeDropdown(){this.dropdownElement&&(this.dropdownElement.remove(),this.dropdownElement=null),this.btnRefs.forEach(e=>{const t=e.querySelector(".opt-btn-arrow");t&&t.classList.remove("rotated")})}updateButtonState(e){const t=this.btnRefs.get(e);t&&(this.activeBtnIds.has(e)?t.classList.add("active"):t.classList.remove("active"))}getIcon(e){return e||this.DEFAULT_ICON}updateButtonIcon(e,t){const i=this.btnRefs.get(e);if(!i)return;const n=i.querySelector(".opt-btn-icon");n&&(n.innerHTML=this.getIcon(t));const r=this.findButtonById(e);r&&(r.icon=t)}updateButtonVisibility(e,t){this.options.visibility||(this.options.visibility={}),this.options.visibility[e]=t,this.render()}setShowLabel(e){this.options.showLabel=e,this.updateLabelsVisibility()}updateLabelsVisibility(){this.btnRefs.forEach((e,t)=>{const i=this.findButtonById(t);if(!i)return;this.options.showLabel&&i.label?(e.classList.remove("no-label"),e.removeAttribute("title")):(e.classList.add("no-label"),i.label&&(e.title=Se(i.label)))})}findButtonById(e){for(const t of this.groups){const i=this.findButton(t.buttons,e);if(i)return i}}setBackgroundColor(e){this.setColors({backgroundColor:e})}isVisible(e){return this.options.visibility?.[e]!==!1}setType(e){this.container.classList.remove("type-default","type-glass-pill"),this.options.type=e,e&&e!=="default"&&this.container.classList.add(`type-${e}`),this.render()}getType(){return this.options.type||"default"}destroy(){this.unsubscribeLocale&&(this.unsubscribeLocale(),this.unsubscribeLocale=null),this.unsubscribeTheme&&(this.unsubscribeTheme(),this.unsubscribeTheme=null),this.closeDropdown(),this.container.innerHTML="",this.btnRefs.clear()}}var ni=(s=>(s[s.Unchecked=0]="Unchecked",s[s.Checked=1]="Checked",s[s.Indeterminate=2]="Indeterminate",s))(ni||{});class u9{config;element;children=[];parent=null;checkState=ni.Unchecked;contentEl;switcherEl;checkboxEl=null;titleEl;actionsEl;childrenContainer;onExpandChange;onCheckChange;onNodeClick;renderActions;constructor(e,t,i){this.config=e,this.onExpandChange=i.onExpand,this.onCheckChange=i.onCheck,this.onNodeClick=i.onClick,this.renderActions=t.renderActions,this.checkState=e.checked?ni.Checked:ni.Unchecked,this.element=this.createDom(t)}createDom(e){const t=document.createElement("div");t.className="bim-tree-node",this.config.disabled&&t.classList.add("is-disabled"),this.contentEl=document.createElement("div"),this.contentEl.className="bim-tree-node-content",this.switcherEl=document.createElement("span"),this.switcherEl.className="bim-tree-switcher",this.switcherEl.innerHTML='<svg viewBox="0 0 1024 1024"><path d="M288 192l448 320-448 320z"></path></svg>';const i=this.config.children&&this.config.children.length>0;if(i?this.config.expanded&&this.switcherEl.classList.add("is-expanded"):this.switcherEl.classList.add("is-hidden"),this.switcherEl.addEventListener("click",r=>{r.stopPropagation(),this.toggleExpand()}),this.contentEl.appendChild(this.switcherEl),e.checkable!==!1&&(this.checkboxEl=document.createElement("span"),this.checkboxEl.className="bim-tree-checkbox",this.updateCheckboxUI(),this.checkboxEl.addEventListener("click",r=>{r.stopPropagation(),!this.config.disabled&&this.toggleCheck()}),this.contentEl.appendChild(this.checkboxEl)),this.config.icon){const r=document.createElement("span");r.className="bim-tree-icon",r.innerHTML=this.config.icon.includes("<svg")?this.config.icon:`<img src="${this.config.icon}" />`,this.contentEl.appendChild(r)}this.titleEl=document.createElement("span"),this.titleEl.className="bim-tree-title",this.updateLabel(),this.contentEl.appendChild(this.titleEl),this.actionsEl=document.createElement("div"),this.actionsEl.className="bim-tree-node-actions",this.actionsEl.addEventListener("click",r=>{r.stopPropagation()}),this.contentEl.appendChild(this.actionsEl),this.contentEl.addEventListener("click",r=>{if(r.stopPropagation(),this.config.disabled)return;(this.config.clickAction||"select")==="expand"?this.toggleExpand():this.onNodeClick(this)}),t.appendChild(this.contentEl),this.childrenContainer=document.createElement("div"),this.childrenContainer.className="bim-tree-children";const n=e.indent||24;return this.childrenContainer.style.paddingLeft=`${n}px`,this.config.expanded&&i&&this.childrenContainer.classList.add("is-visible"),t.appendChild(this.childrenContainer),t}setSelected(e){if(e){if(this.contentEl.classList.add("is-selected"),this.renderActions){const t=this.renderActions(this.config);this.actionsEl.innerHTML="",typeof t=="string"?this.actionsEl.innerHTML=t:t instanceof HTMLElement&&this.actionsEl.appendChild(t)}}else this.contentEl.classList.remove("is-selected"),this.actionsEl.innerHTML=""}updateLabel(){this.titleEl&&(this.titleEl.textContent=this.config.label)}toggleExpand(e){if(!this.config.children||this.config.children.length===0)return;const t=e!==void 0?e:!this.config.expanded;this.config.expanded=t,t?(this.switcherEl.classList.add("is-expanded"),this.childrenContainer.classList.add("is-visible")):(this.switcherEl.classList.remove("is-expanded"),this.childrenContainer.classList.remove("is-visible")),e===void 0&&this.onExpandChange(this)}toggleCheck(){const e=this.checkState!==ni.Checked;this.setChecked(e?ni.Checked:ni.Unchecked,!0)}setChecked(e,t=!1,i=!1){!i&&this.checkState===e||(this.checkState=e,this.config.checked=e===ni.Checked,this.updateCheckboxUI(),t&&this.onCheckChange(this))}updateCheckboxUI(){this.checkboxEl&&(this.checkboxEl.classList.remove("is-checked","is-indeterminate"),this.checkState===ni.Checked?this.checkboxEl.classList.add("is-checked"):this.checkState===ni.Indeterminate&&this.checkboxEl.classList.add("is-indeterminate"))}appendChild(e){e.parent=this,this.children.push(e),this.childrenContainer.appendChild(e.element),this.children.length===1&&this.switcherEl.classList.remove("is-hidden")}destroy(){this.children.forEach(e=>e.destroy()),this.children=[],this.element.remove(),this.parent=null}}class p9{element;contentElement;searchInput=null;searchResults=null;options;nodeMap=new Map;rootNodes=[];selectedNode=null;lastRevealedNodeId=null;unsubscribeLocale=null;unsubscribeTheme=null;clickOutsideHandler=null;onNodeCheck;onNodeSelect;onNodeDeselect;onNodeExpand;constructor(e){this.options={checkable:!0,checkStrictly:!0,indent:24,defaultExpandAll:!0,enableSearch:!1,searchPlaceholder:"tree.searchPlaceholder",...e},this.element=document.createElement("div"),this.element.className="bim-tree",this.options.enableSearch&&this.createSearchDOM(),this.contentElement=document.createElement("div"),this.contentElement.className="bim-tree-content",this.element.appendChild(this.contentElement),e.onNodeCheck&&(this.onNodeCheck=e.onNodeCheck),e.onNodeSelect&&(this.onNodeSelect=e.onNodeSelect),e.onNodeDeselect&&(this.onNodeDeselect=e.onNodeDeselect),e.onNodeExpand&&(this.onNodeExpand=e.onNodeExpand)}createSearchDOM(){const e=document.createElement("div");e.className="bim-tree-search";const t=document.createElement("div");t.className="bim-tree-search-wrapper";const i=document.createElement("span");i.className="bim-tree-search-icon",i.innerHTML='<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 24 24"><path fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5" d="m21 21l-4.343-4.343m0 0A8 8 0 1 0 5.343 5.343a8 8 0 0 0 11.314 11.314"/></svg>',t.appendChild(i),this.searchInput=document.createElement("input"),this.searchInput.className="bim-tree-search-input",this.searchInput.type="text",this.searchInput.placeholder=Se(this.options.searchPlaceholder||"搜索..."),this.searchInput.addEventListener("input",n=>{const r=n.target.value;this.handleSearch(r)}),t.appendChild(this.searchInput),e.appendChild(t),this.searchResults=document.createElement("div"),this.searchResults.className="bim-tree-search-results",e.appendChild(this.searchResults),this.element.appendChild(e),this.clickOutsideHandler=n=>{this.searchResults&&!this.searchResults.contains(n.target)&&!this.searchInput?.contains(n.target)&&this.searchResults.classList.remove("is-visible")},document.addEventListener("click",this.clickOutsideHandler)}init(){this.render(),this.unsubscribeLocale=Zt.subscribe(()=>this.setLocales()),this.unsubscribeTheme=ct.subscribe(e=>this.setTheme(e)),this.setTheme(ct.getTheme())}handleSearch(e){if(!this.searchResults)return;if(!e.trim()){this.searchResults.classList.remove("is-visible"),this.searchResults.innerHTML="";return}const t=[],i=e.toLowerCase();this.nodeMap.forEach(n=>{const r=n.config.label;r.toLowerCase().includes(i)&&t.push({node:n,label:r,path:this.getNodePath(n)})}),this.renderSearchResults(t)}getNodePath(e){const t=[];let i=e.parent;for(;i;)t.unshift(i.config.label),i=i.parent;return t.join(" > ")}renderSearchResults(e){if(this.searchResults){if(this.searchResults.innerHTML="",e.length===0){const t=document.createElement("div");t.className="bim-tree-search-item",t.style.cursor="default",t.style.color="#999",t.textContent="No results",this.searchResults.appendChild(t)}else e.forEach(t=>{const i=document.createElement("div");i.className="bim-tree-search-item";const n=document.createElement("span");n.className="bim-tree-search-item-title",n.textContent=t.label;const r=document.createElement("span");r.className="bim-tree-search-item-path",r.textContent=t.path,i.appendChild(n),t.path&&i.appendChild(r),i.addEventListener("click",()=>{this.revealNode(t.node)}),this.searchResults.appendChild(i)});this.searchResults.classList.add("is-visible")}}revealNode(e){if(this.lastRevealedNodeId===e.config.id&&this.isNodeFullyVisible(e))return;this.lastRevealedNodeId=e.config.id,this.searchResults&&(this.searchResults.classList.remove("is-visible"),this.searchInput&&(this.searchInput.value=""));let t=e.parent;for(;t;)t.toggleExpand(!0),t=t.parent;this.handleNodeSelect(e),requestAnimationFrame(()=>{requestAnimationFrame(()=>{this.scrollNodeIntoContentCenter(e)})})}isNodeFullyVisible(e){const t=this.contentElement;if(!t||!e?.element?.isConnected)return!1;const i=t.getBoundingClientRect(),n=e.element.getBoundingClientRect();return n.top>=i.top&&n.bottom<=i.bottom}scrollNodeIntoContentCenter(e){const t=this.contentElement;if(!t||!e?.element?.isConnected)return;const i=t.getBoundingClientRect(),n=e.element.getBoundingClientRect();if(n.top>=i.top&&n.bottom<=i.bottom)return;const r=n.top-i.top+t.scrollTop,a=Math.max(0,r-(t.clientHeight-n.height)/2);t.scrollTo({top:a,behavior:"auto"})}setTheme(e){const t=this.element.style;t.setProperty("--bim-primary",e.primary),t.setProperty("--bim-bg-elevated",e.bgElevated),t.setProperty("--bim-text-primary",e.textPrimary),t.setProperty("--bim-text-secondary",e.textSecondary),t.setProperty("--bim-text-tertiary",e.textTertiary),t.setProperty("--bim-text-disabled",e.textDisabled),t.setProperty("--bim-text-inverse",e.textInverse),t.setProperty("--bim-border-default",e.borderDefault),t.setProperty("--bim-border-disabled",e.borderDisabled),t.setProperty("--bim-component-bg-hover",e.componentBgHover),t.setProperty("--bim-component-bg-selected",e.componentBgSelected),t.setProperty("--bim-component-bg-disabled",e.componentBgDisabled),t.setProperty("--bim-shadow-md",e.shadowMd),t.setProperty("--bim-focus-ring",e.focusRing)}setLocales(){this.nodeMap.forEach(e=>e.updateLabel()),this.searchInput&&(this.searchInput.placeholder=Se(this.options.searchPlaceholder||"tree.searchPlaceholder"))}destroy(){this.unsubscribeLocale&&(this.unsubscribeLocale(),this.unsubscribeLocale=null),this.unsubscribeTheme&&(this.unsubscribeTheme(),this.unsubscribeTheme=null),this.clickOutsideHandler&&(document.removeEventListener("click",this.clickOutsideHandler),this.clickOutsideHandler=null),this.rootNodes.forEach(e=>e.destroy()),this.rootNodes=[],this.nodeMap.clear(),this.lastRevealedNodeId=null,this.element.remove(),this.selectedNode=null}render(){this.contentElement.innerHTML="",this.nodeMap.clear(),this.rootNodes=[],this.options.data.forEach(e=>{this.createNodeRecursively(e,null)})}createNodeRecursively(e,t){e.expanded===void 0&&(e.expanded=this.options.defaultExpandAll);const i=new u9(e,this.options,{onExpand:n=>{this.onNodeExpand&&this.onNodeExpand(n)},onCheck:n=>this.handleNodeCheck(n),onClick:n=>this.handleNodeSelect(n)});this.nodeMap.set(e.id,i),t?t.appendChild(i):(this.rootNodes.push(i),this.contentElement.appendChild(i.element)),e.children&&e.children.length>0&&e.children.forEach(n=>{this.createNodeRecursively(n,i)})}handleNodeSelect(e){if(this.selectedNode===e){e.setSelected(!1),this.selectedNode=null,this.onNodeDeselect&&this.onNodeDeselect(e);return}this.selectedNode&&this.selectedNode.setSelected(!1),e.setSelected(!0),this.selectedNode=e,this.onNodeSelect&&this.onNodeSelect(e)}handleNodeCheck(e){const t=e.checkState===ni.Checked;if(this.onNodeCheck&&this.onNodeCheck(e),this.options.checkStrictly===!1)return;const i=(r,a)=>{r.children.forEach(o=>{o.config.disabled||(o.setChecked(a,!1),i(o,a))})};t?i(e,ni.Checked):i(e,ni.Unchecked);let n=e.parent;for(;n;){if(n.config.disabled){n=n.parent;continue}const r=n.children,a=r.every(l=>l.checkState===ni.Checked),o=r.every(l=>l.checkState===ni.Unchecked);a?n.setChecked(ni.Checked,!1):o?n.setChecked(ni.Unchecked,!1):n.setChecked(ni.Indeterminate,!1),n=n.parent}}getNode(e){return this.nodeMap.get(e)}checkNode(e,t){const i=this.nodeMap.get(e);i&&i.setChecked(t?ni.Checked:ni.Unchecked,!0)}expandAll(e){this.nodeMap.forEach(t=>t.toggleExpand(e))}checkAllNodes(e){const t=e?ni.Checked:ni.Unchecked;this.nodeMap.forEach(i=>i.setChecked(t,!1,!0))}getCheckedNodes(e=!1){const t=[];return this.nodeMap.forEach(i=>{(i.checkState===ni.Checked||e&&i.checkState===ni.Indeterminate)&&t.push(i.config)}),t}}class f9{element;navElement;contentElement;options;activeId;tabMap=new Map;panelMap=new Map;panelTreeScrollTopMap=new Map;unsubscribeLocale=null;unsubscribeTheme=null;navClickHandler=null;constructor(e){this.options=e,this.activeId=e.activeId||(e.tabs[0]?.id??null),e.tabs.forEach(t=>this.tabMap.set(t.id,t)),this.element=document.createElement("div"),this.element.className="bim-tab",this.navElement=document.createElement("div"),this.navElement.className="bim-tab__nav",this.navElement.setAttribute("role","tablist"),this.element.appendChild(this.navElement),this.contentElement=document.createElement("div"),this.contentElement.className="bim-tab__content",this.element.appendChild(this.contentElement),this.options.container.appendChild(this.element)}init(){this.renderNav(),this.renderPanels(),this.setLocales(),this.setTheme(ct.getTheme()),this.unsubscribeLocale=Zt.subscribe(()=>this.setLocales()),this.unsubscribeTheme=ct.subscribe(e=>this.setTheme(e))}renderNav(){this.navElement.innerHTML="",this.navClickHandler=e=>{const t=e.target.closest(".bim-tab__item");if(!t)return;const i=t.dataset.id;!i||this.tabMap.get(i)?.disabled||this.activateTab(i)},this.navElement.addEventListener("click",this.navClickHandler),this.options.tabs.forEach(e=>{const t=document.createElement("button");if(t.type="button",t.className="bim-tab__item",t.dataset.id=e.id,t.setAttribute("role","tab"),t.id=`tab-${e.id}`,t.setAttribute("aria-selected",`${e.id===this.activeId}`),e.disabled&&(t.disabled=!0,t.setAttribute("aria-disabled","true"),t.classList.add("is-disabled")),e.icon){const n=document.createElement("span");n.className="bim-tab__icon",n.innerHTML=e.icon,t.appendChild(n)}const i=document.createElement("span");i.className="bim-tab__title",i.textContent=this.resolveTitle(e.title),t.appendChild(i),e.id===this.activeId&&t.classList.add("is-active"),this.navElement.appendChild(t)})}renderPanels(){this.contentElement.innerHTML="",this.panelMap.clear(),this.options.tabs.forEach(e=>{const t=document.createElement("div");t.className="bim-tab__panel",t.dataset.id=e.id,t.setAttribute("role","tabpanel"),t.setAttribute("aria-labelledby",`tab-${e.id}`),e.content instanceof HTMLElement?t.appendChild(e.content):typeof e.content=="string"&&(t.innerHTML=e.content),e.id===this.activeId?t.classList.add("is-active"):t.style.display="none",this.panelMap.set(e.id,t),this.contentElement.appendChild(t)})}activateTab(e){if(this.activeId===e)return;const t=this.tabMap.get(e);if(!t||t.disabled)return;this.activeId=e,this.navElement.querySelectorAll(".bim-tab__item").forEach(n=>{const r=n.dataset.id===e;n.classList.toggle("is-active",r),n.setAttribute("aria-selected",`${r}`)}),this.panelMap.forEach((n,r)=>{const a=r===e;a||this.savePanelTreeScrollTop(r,n),n.classList.toggle("is-active",a),n.style.display=a?"":"none",a&&this.restorePanelTreeScrollTop(r,n)}),this.options.onChange&&this.options.onChange(e,t)}setTheme(e){const t=this.element.style;t.setProperty("--bim-tab-bg",e.bgElevated),t.setProperty("--bim-tab-nav-bg",e.bgElevated),t.setProperty("--bim-tab-text",e.textPrimary),t.setProperty("--bim-tab-text-secondary",e.textSecondary),t.setProperty("--bim-tab-text-active",e.primary),t.setProperty("--bim-tab-border",e.borderDefault),t.setProperty("--bim-tab-hover-bg",e.componentBgHover),t.setProperty("--bim-tab-active-bg",e.componentBgActive),t.setProperty("--bim-tab-icon",e.iconDefault)}setLocales(){this.navElement.querySelectorAll(".bim-tab__item").forEach(t=>{const i=t.dataset.id;if(!i)return;const n=this.tabMap.get(i);if(!n)return;const r=t.querySelector(".bim-tab__title");r&&(r.textContent=this.resolveTitle(n.title))})}destroy(){this.navClickHandler&&(this.navElement.removeEventListener("click",this.navClickHandler),this.navClickHandler=null),this.unsubscribeLocale&&(this.unsubscribeLocale(),this.unsubscribeLocale=null),this.unsubscribeTheme&&(this.unsubscribeTheme(),this.unsubscribeTheme=null),this.panelMap.clear(),this.panelTreeScrollTopMap.clear(),this.tabMap.clear(),this.element.remove()}savePanelTreeScrollTop(e,t){const i=t.querySelector(".bim-tree-content");i&&this.panelTreeScrollTopMap.set(e,i.scrollTop)}restorePanelTreeScrollTop(e,t){const i=this.panelTreeScrollTopMap.get(e);if(i===void 0)return;const n=t.querySelector(".bim-tree-content");n&&requestAnimationFrame(()=>{n.scrollTop=i})}resolveTitle(e){try{return Se(e)||e}catch{return e}}}function Z2(s,e){let t=e>>>0;for(let i=0;i<s.length;i++){const n=s.charCodeAt(i);t^=n&255,t=Math.imul(t,16777619),t^=n>>>8&255,t=Math.imul(t,16777619)}return t>>>0}async function m9(s){const e=JSON.stringify(s),t=Z2(e,2166136261),i=Z2(e,522970236);return`${t.toString(16).padStart(8,"0")}${i.toString(16).padStart(8,"0")}`}function Y2(s){const e=new Map,t=n=>{const r=n.config.data,a=r?._modelUrl;if(a&&r?.ids?.length){let o=e.get(a);o||(o=new Set,e.set(a,o));for(const l of r.ids){const c=Number(l);Number.isFinite(c)&&o.add(c)}}for(const o of n.children||[])t(o)};t(s);const i=[];for(const[n,r]of e)r.size>0&&i.push({url:n,ids:Array.from(r)});return i}let g9=0;async function v9(s){if(!s||s.length===0)return[];const e=async(t,i)=>{const n=t.children&&t.children.length>0;let r;return t.ids?.length?r=await m9(t.ids):t.id?r=t.id:r=`node_${++g9}`,{id:r,label:t.name||"未命名",expanded:!1,checked:!0,children:n?await Promise.all(t.children.map(a=>e(a,i))):void 0,data:{...t,_modelUrl:i}}};return Promise.all(s.map(async t=>{const i=t.children&&t.children.length>0,n=t.url;return{id:n,label:t.name||"模型",expanded:!0,checked:!0,children:i?await Promise.all(t.children.map(r=>e(r,n))):void 0,data:{_modelUrl:n}}}))}class y9 extends jn{toolbar=null;toolbarContainer=null;container;dialog=null;constructor(e,t){super(t),this.container=e,this.init()}init(){this.toolbarContainer=document.createElement("div"),this.toolbarContainer.id="bim-construct-tree",this.container.appendChild(this.toolbarContainer),this.toolbar=new d9({container:this.toolbarContainer,showLabel:!1,direction:"column",position:"top-left",align:"vertical",expand:"up",registry:this.registry}),this.toolbar.init(),this.toolbar.addGroup("construct-tree"),this.toolbar.addButton({id:"construct-tree-btn",groupId:"construct-tree",type:"button",label:"construct-tree",icon:Tt("目录树"),onClick:()=>{this.openConstructTreeDialog()}}),this.toolbar.render()}async openConstructTreeDialog(){this.setVisible(!1);const e=this.engineComponent?.getLevelTreeData()??[],t=this.engineComponent?.getTypeTreeData()??[],i=this.engineComponent?.getMajorTreeData()??[];console.log("[ConstructTree] 原始数据 (Level):",e),console.log("[ConstructTree] 原始数据 (Type):",t),console.log("[ConstructTree] 原始数据 (Major):",i);const n=async(g,m)=>{const f=await v9(g);console.log(`[ConstructTree] 转换后数据 (${m}):`,f);const y=new p9({data:f,checkable:!0,indent:0,enableSearch:!0,checkStrictly:!0,defaultExpandAll:!0,onNodeCheck:x=>{const _=Y2(x);_.length&&(x.checkState===ni.Checked?this.engineComponent?.showModel(_):this.engineComponent?.hideModels(_))},onNodeSelect:x=>{const _=Y2(x);_.length&&(this.engineComponent?.unhighlightAllModels(),this.engineComponent?.highlightModel(_),this.engineComponent?.viewScaleToModel(_))},onNodeDeselect:()=>{this.engineComponent?.unhighlightAllModels()},onNodeExpand:()=>{this.dialog?.fitWidth()}});return y.init(),y},r=await n(e,"Level"),a=await n(t,"Type"),o=await n(i,"Major"),l=document.createElement("div");l.className="construct-tab__panel-content",l.appendChild(r.element);const c=document.createElement("div");c.className="construct-tab__panel-content",c.appendChild(a.element);const h=document.createElement("div");h.className="construct-tab__panel-content",h.appendChild(o.element);const d=document.createElement("div");d.className="construct-tab__container",d.style.height="100%",d.style.overflow="hidden";const p=()=>{this.engineComponent?.showAllModels(),r.checkAllNodes(!0),a.checkAllNodes(!0),o.checkAllNodes(!0)},u=new f9({container:d,tabs:[{id:"component",title:"tab.component",content:l},{id:"type",title:"tab.type",content:c},{id:"major",title:"tab.major",content:h}],activeId:"component",onChange:()=>{this.dialog?.fitWidth()}});u.init(),p();const v=this.registry.on("menu:show-all",()=>{p()});this.dialog=this.registry.dialog.create({title:"constructTree.title",minWidth:320,height:600,content:d,position:{x:20,y:20},resizable:!1,onClose:()=>{v(),u.destroy(),r.destroy(),a.destroy(),o.destroy(),this.setVisible(!0)}}),this.dialog?.fitWidth()}refresh(){this.toolbar?.render()}destroy(){this.toolbar?.destroy(),this.toolbar=null,super.destroy()}addGroup(e,t){this.toolbar?.addGroup(e,t),this.toolbar?.render()}addButton(e){this.toolbar?.addButton(e),this.toolbar?.render()}setButtonVisibility(e,t){this.toolbar?.updateButtonVisibility(e,t)}setShowLabel(e){this.toolbar?.setShowLabel(e)}setVisible(e){this.toolbarContainer&&(this.toolbarContainer.style.visibility=e?"visible":"hidden")}setBackgroundColor(e){this.toolbar?.setBackgroundColor(e)}setColors(e){this.toolbar?.setColors(e)}}class x9{events=new Map;on(e,t){return this.events.has(e)||this.events.set(e,[]),this.events.get(e).push(t),()=>this.off(e,t)}off(e,t){const i=this.events.get(e);if(!i)return;const n=i.indexOf(t);n!==-1&&i.splice(n,1)}emit(e,t){const i=this.events.get(e);i&&i.forEach(n=>{try{n(t)}catch(r){console.error(`[EventEmitter] Error in listener for event "${e}":`,r)}})}clear(){this.events.clear()}}class Sm{eventEmitter=new x9;container=null;wrapper=null;toolbar=null;dialog=null;engine3d=null;buttonGroup=null;rightKey=null;constructTree=null;measure=null;walkControl=null;sectionPlane=null;sectionAxis=null;sectionBox=null;walkPath=null;walkPlanView=null;engineInfo=null;componentDetail=null;aiChat=null;setting=null;radialToolbar=null;bottomDock=null;measureDock=null;sectionDock=null;walkDock=null;constructor(){}reset(){this.eventEmitter.clear(),this.container=null,this.wrapper=null,this.toolbar=null,this.dialog=null,this.engine3d=null,this.buttonGroup=null,this.rightKey=null,this.constructTree=null,this.measure=null,this.walkControl=null,this.sectionPlane=null,this.sectionAxis=null,this.sectionBox=null,this.walkPath=null,this.walkPlanView=null,this.engineInfo=null,this.componentDetail=null,this.aiChat=null,this.setting=null,this.radialToolbar=null,this.bottomDock=null,this.measureDock=null,this.sectionDock=null,this.walkDock=null}emit(e,t){this.eventEmitter.emit(e,t)}on(e,t){return this.eventEmitter.on(e,t)}off(e,t){this.eventEmitter.off(e,t)}clearEvents(){this.eventEmitter.clear()}}class _9{container;wrapper=null;sizeEl=null;resizeObserver=null;lastSyncedWidth=-1;lastSyncedHeight=-1;registry;dialog=null;engine=null;rightKey=null;radialToolbar=null;bottomDock=null;measureDock=null;sectionDock=null;walkDock=null;measure=null;sectionPlane=null;sectionAxis=null;sectionBox=null;walkControl=null;engineInfo=null;componentDetail=null;aiChat=null;setting=null;constructTreeBtn=null;handleWindowResize=()=>{this.updateClientSizeDisplay()};constructor(e,t){const i=typeof e=="string"?document.getElementById(e):e;if(!i)throw new Error("Container not found");this.container=i,this.registry=new Sm,t?.locale&&Zt.setLocale(t.locale),t?.theme&&(t.theme==="custom"?console.warn("Custom theme should be set via setCustomTheme()."):ct.setTheme(t.theme)),this.init()}emit(e,t){this.registry.emit(e,t)}on(e,t){return this.registry.on(e,t)}setLocale(e){Zt.setLocale(e)}getLocale(){return Zt.getLocale()}setTheme(e){ct.setTheme(e)}setCustomTheme(e){ct.setCustomTheme(e)}init(){this.container.innerHTML="",this.wrapper=document.createElement("div"),this.wrapper.className="bim-engine-wrapper",this.container.appendChild(this.wrapper);const e=document.createElement("div");e.className="bim-engine-version",e.textContent="v2.5.3",this.wrapper.appendChild(e),this.sizeEl=document.createElement("div"),this.sizeEl.className="bim-engine-size",this.wrapper.appendChild(this.sizeEl),this.updateClientSizeDisplay(),this.bindSizeObserver(),this.registry.container=this.container,this.registry.wrapper=this.wrapper,this.engine=new E2(this.wrapper,this.registry),this.dialog=new gy(this.wrapper,this.registry),this.rightKey=new ay(this.wrapper,this.registry),this.bottomDock=new A2(this.wrapper,this.registry),this.registry.bottomDock=this.bottomDock,this.measureDock=new D2(this.registry),this.registry.measureDock=this.measureDock,this.measureDock.init(),this.sectionDock=new N2(this.registry),this.registry.sectionDock=this.sectionDock,this.sectionDock.init(),this.walkDock=new U2(this.registry),this.registry.walkDock=this.walkDock,this.walkDock.init(),this.radialToolbar=new C2(this.wrapper,this.registry),this.measure=new B2(this.registry),this.sectionPlane=new F2(this.registry),this.sectionAxis=new z2(this.registry),this.sectionBox=new V2(this.registry),this.walkControl=new G2(this.registry),this.walkControl.init(),this.engineInfo=new W2(this.registry),this.engineInfo.init(),this.registry.engine3d=this.engine,this.registry.dialog=this.dialog,this.registry.rightKey=this.rightKey,this.registry.radialToolbar=this.radialToolbar,this.registry.measure=this.measure,this.registry.sectionPlane=this.sectionPlane,this.registry.sectionAxis=this.sectionAxis,this.registry.sectionBox=this.sectionBox,this.registry.walkControl=this.walkControl,this.registry.engineInfo=this.engineInfo,this.componentDetail=new j2(this.registry),this.registry.componentDetail=this.componentDetail,this.componentDetail.init(),this.aiChat=new q2(this.registry),this.registry.aiChat=this.aiChat,this.aiChat.init(),this.constructTreeBtn=new y9(this.wrapper,this.registry),this.registry.constructTree=this.constructTreeBtn,this.setting=new Rr(this.registry),this.registry.setting=this.setting,this.setting.init(),this.updateTheme(ct.getTheme()),ct.subscribe(t=>{this.updateTheme(t)})}updateTheme(e){this.wrapper&&(this.wrapper.style.color=e.textPrimary)}updateClientSizeDisplay(){const e=this.container.clientWidth,t=this.container.clientHeight;this.sizeEl&&(this.sizeEl.textContent=`${e}px x ${t}px`),this.syncEngineSize(e,t)}syncEngineSize(e,t){e<=0||t<=0||e===this.lastSyncedWidth&&t===this.lastSyncedHeight||(this.lastSyncedWidth=e,this.lastSyncedHeight=t,this.engine?.getEngineComponent()?.resize(e,t))}bindSizeObserver(){if(typeof ResizeObserver<"u"){this.resizeObserver=new ResizeObserver(()=>{this.updateClientSizeDisplay()}),this.resizeObserver.observe(this.container);return}window.addEventListener("resize",this.handleWindowResize)}unbindSizeObserver(){if(this.resizeObserver){this.resizeObserver.disconnect(),this.resizeObserver=null;return}window.removeEventListener("resize",this.handleWindowResize)}destroy(){this.unbindSizeObserver(),this.radialToolbar?.destroy(),this.measureDock?.destroy(),this.sectionDock?.destroy(),this.walkDock?.destroy(),this.bottomDock?.destroy(),this.engine?.destroy(),this.dialog?.destroy(),this.rightKey?.destroy(),this.measure?.destroy(),this.sectionPlane?.destroy(),this.sectionAxis?.destroy(),this.sectionBox?.destroy(),this.walkControl?.destroy(),this.constructTreeBtn?.destroy(),this.aiChat?.destroy(),this.setting?.destroy(),this.sizeEl=null,this.lastSyncedWidth=-1,this.lastSyncedHeight=-1,this.container.innerHTML="",this.registry.reset()}}class b9{container;wrapper=null;sizeEl=null;resizeObserver=null;lastSyncedWidth=-1;lastSyncedHeight=-1;unsubscribeTheme=null;registry;dialog=null;engine=null;rightKey=null;radialToolbar=null;bottomDock=null;measureDock=null;sectionDock=null;walkDock=null;measure=null;sectionPlane=null;sectionAxis=null;sectionBox=null;walkControl=null;engineInfo=null;componentDetail=null;aiChat=null;setting=null;handleWindowResize=()=>{this.updateClientSizeDisplay()};constructor(e,t){const i=typeof e=="string"?document.getElementById(e):e;if(!i)throw new Error("Container not found");this.container=i,this.registry=new Sm,t?.locale&&Zt.setLocale(t.locale),t?.theme&&(t.theme==="custom"?console.warn("Custom theme should be set via setCustomTheme()."):ct.setTheme(t.theme)),this.init()}emit(e,t){this.registry.emit(e,t)}on(e,t){return this.registry.on(e,t)}setLocale(e){Zt.setLocale(e)}getLocale(){return Zt.getLocale()}setTheme(e){ct.setTheme(e)}setCustomTheme(e){ct.setCustomTheme(e)}init(){this.container.innerHTML="",this.wrapper=document.createElement("div"),this.wrapper.className="bim-engine-wrapper",this.container.appendChild(this.wrapper);const e=document.createElement("div");e.className="bim-engine-version",e.textContent="v2.5.3",this.wrapper.appendChild(e),this.sizeEl=document.createElement("div"),this.sizeEl.className="bim-engine-size",this.wrapper.appendChild(this.sizeEl),this.updateClientSizeDisplay(),this.bindSizeObserver(),this.registry.container=this.container,this.registry.wrapper=this.wrapper,this.engine=new E2(this.wrapper,this.registry),this.dialog=new gy(this.wrapper,this.registry),this.rightKey=new ay(this.wrapper,this.registry),this.bottomDock=new A2(this.wrapper,this.registry),this.registry.bottomDock=this.bottomDock,this.registry.engine3d=this.engine,this.registry.dialog=this.dialog,this.registry.rightKey=this.rightKey,this.measureDock=new D2(this.registry),this.registry.measureDock=this.measureDock,this.measureDock.init(),this.sectionDock=new N2(this.registry),this.registry.sectionDock=this.sectionDock,this.sectionDock.init(),this.walkDock=new U2(this.registry),this.registry.walkDock=this.walkDock,this.walkDock.init(),this.radialToolbar=new C2(this.wrapper,this.registry),this.measure=new B2(this.registry),this.sectionPlane=new F2(this.registry),this.sectionAxis=new z2(this.registry),this.sectionBox=new V2(this.registry),this.walkControl=new G2(this.registry),this.walkControl.init(),this.engineInfo=new W2(this.registry),this.engineInfo.init(),this.registry.radialToolbar=this.radialToolbar,this.registry.measure=this.measure,this.registry.sectionPlane=this.sectionPlane,this.registry.sectionAxis=this.sectionAxis,this.registry.sectionBox=this.sectionBox,this.registry.walkControl=this.walkControl,this.registry.engineInfo=this.engineInfo,this.componentDetail=new j2(this.registry),this.registry.componentDetail=this.componentDetail,this.componentDetail.init(),this.aiChat=new q2(this.registry),this.registry.aiChat=this.aiChat,this.aiChat.init(),this.setting=new Rr(this.registry),this.registry.setting=this.setting,this.setting.init(),this.updateTheme(ct.getTheme()),this.unsubscribeTheme=ct.subscribe(t=>{this.updateTheme(t)})}updateTheme(e){this.wrapper&&(this.wrapper.style.color=e.textPrimary)}updateClientSizeDisplay(){const e=this.container.clientWidth,t=this.container.clientHeight;this.sizeEl&&(this.sizeEl.textContent=`${e}px x ${t}px`),this.syncEngineSize(e,t)}syncEngineSize(e,t){e<=0||t<=0||e===this.lastSyncedWidth&&t===this.lastSyncedHeight||(this.lastSyncedWidth=e,this.lastSyncedHeight=t,this.engine?.getEngineComponent()?.resize(e,t))}bindSizeObserver(){if(typeof ResizeObserver<"u"){this.resizeObserver=new ResizeObserver(()=>{this.updateClientSizeDisplay()}),this.resizeObserver.observe(this.container);return}window.addEventListener("resize",this.handleWindowResize)}unbindSizeObserver(){if(this.resizeObserver){this.resizeObserver.disconnect(),this.resizeObserver=null;return}window.removeEventListener("resize",this.handleWindowResize)}destroy(){this.unbindSizeObserver(),this.unsubscribeTheme&&(this.unsubscribeTheme(),this.unsubscribeTheme=null),this.radialToolbar?.destroy(),this.measureDock?.destroy(),this.sectionDock?.destroy(),this.walkDock?.destroy(),this.bottomDock?.destroy(),this.engine?.destroy(),this.dialog?.destroy(),this.rightKey?.destroy(),this.measure?.destroy(),this.sectionPlane?.destroy(),this.sectionAxis?.destroy(),this.sectionBox?.destroy(),this.walkControl?.destroy(),this.aiChat?.destroy(),this.setting?.destroy(),this.sizeEl=null,this.lastSyncedWidth=-1,this.lastSyncedHeight=-1,this.container.innerHTML="",this.registry.reset()}}class M9{engine=null;registry;container;containerId;options;_isInitialized=!1;_isDestroyed=!1;unsubscribeTheme=null;constructor(e,t){this.registry=t,this.container=e.container,this.container.id?this.containerId=this.container.id:(this.containerId=`engine2d-container-${Date.now()}-${Math.random().toString(36).substr(2,9)}`,this.container.id=this.containerId),this.options={backgroundColor:e.backgroundColor??1710618,gridEnabled:e.gridEnabled??!0,axesEnabled:e.axesEnabled??!0,selectionColor:e.selectionColor,highlightColor:e.highlightColor,enablePerformanceMonitoring:e.enablePerformanceMonitoring??!0}}init(){if(this._isInitialized){console.warn("[Engine2d] Engine already initialized.");return}if(this._isDestroyed){console.error("[Engine2d] Cannot initialize destroyed engine.");return}try{const e={containerId:this.containerId,backgroundColor:this.options.backgroundColor,gridEnabled:this.options.gridEnabled,axesEnabled:this.options.axesEnabled};if(this.options.selectionColor!==void 0&&(e.selectionColor=this.options.selectionColor),this.options.highlightColor!==void 0&&(e.highlightColor=this.options.highlightColor),this.options.enablePerformanceMonitoring!==void 0&&(e.enablePerformanceMonitoring=this.options.enablePerformanceMonitoring),console.log("[Engine2d] 引擎配置信息:",e),this.engine=Fz(e),!this.engine)throw new Error("Failed to create 2D engine instance");this._isInitialized=!0,this.unsubscribeTheme=ct.subscribe(t=>{this.setTheme(t)}),this.setTheme(ct.getTheme()),this.engine.events&&(this.engine.events.on("entity-click",t=>{console.log("[Engine2d] 实体点击:",t),this.registry.emit("engine2d:entity-clicked",{data:t})}),this.engine.events.on("layer-visibility-changed",t=>{console.log("[Engine2d] 图层可见性变更:",t),this.registry.emit("engine2d:layer-changed",{data:t})}))}catch(e){throw console.error("[Engine2d] Failed to initialize 2D engine:",e),this._isInitialized=!1,e}}setTheme(e){}setLocales(){}isInitialized(){return this._isInitialized}async loadDrawing(e,t){if(!this._isInitialized||!this.engine){console.error("[Engine2d] Engine not initialized. Please call init() first.");return}if(!e){console.error("[Engine2d] Drawing URL is required.");return}try{console.log("[Engine2d] 开始加载图纸:",e),await this.engine.loadModel(e,t),console.log("[Engine2d] 图纸加载完成:",e),this.registry.emit("engine2d:drawing-loaded",{url:e})}catch(i){throw console.error("[Engine2d] 图纸加载失败:",i),i}}getLayers(){if(!this._isInitialized||!this.engine)return[];try{return this.engine.getLayers?.()??[]}catch(e){return console.warn("[Engine2d] Failed to get layers:",e),[]}}setLayerVisible(e,t){if(!this._isInitialized||!this.engine){console.warn("[Engine2d] Engine not initialized.");return}try{this.engine.setLayerVisible?.(e,t)}catch(i){console.warn("[Engine2d] Failed to set layer visibility:",i)}}resetView(){if(!(!this._isInitialized||!this.engine))try{this.engine.resetView?.()}catch(e){console.warn("[Engine2d] Failed to reset view:",e)}}fitToView(){if(!(!this._isInitialized||!this.engine))try{this.engine.fitToView?.()}catch(e){console.warn("[Engine2d] Failed to fit to view:",e)}}setZoom(e){!this._isInitialized||!this.engine||this.engine.setZoom?.(e)}getZoom(){return!this._isInitialized||!this.engine?1:this.engine.getZoom?.()??1}setBackgroundColor(e){!this._isInitialized||!this.engine||this.engine.setBackgroundColor?.(e)}clearScene(){!this._isInitialized||!this.engine||this.engine.clearScene?.()}resize(){!this._isInitialized||!this.engine||this.engine.resize?.()}onRawEvent(e,t){this.engine?.events?.on(e,t)}offRawEvent(e,t){this.engine?.events?.off(e,t)}destroy(){if(!this._isDestroyed){if(this.unsubscribeTheme&&(this.unsubscribeTheme(),this.unsubscribeTheme=null),this.engine){try{this.engine.dispose?.()}catch(e){console.warn("[Engine2d] Error during dispose:",e)}this.engine=null}this.container.innerHTML="",this._isDestroyed=!0,this._isInitialized=!1}}}class S9{container;registry;engineComponent=null;constructor(e,t){const i=typeof e=="string"?document.getElementById(e):e;if(!i)throw new Error("Container not found");this.container=i,this.registry=new Sm,t?.locale&&Zt.setLocale(t.locale),t?.theme&&t.theme!=="custom"&&ct.setTheme(t.theme),this.engineComponent=new M9({container:this.container,backgroundColor:t?.backgroundColor,gridEnabled:t?.gridEnabled,axesEnabled:t?.axesEnabled,selectionColor:t?.selectionColor,highlightColor:t?.highlightColor,enablePerformanceMonitoring:t?.enablePerformanceMonitoring},this.registry),this.engineComponent.init()}async loadDrawing(e,t){return this.engineComponent?.loadDrawing(e,t)}getLayers(){return this.engineComponent?.getLayers()??[]}setLayerVisible(e,t){this.engineComponent?.setLayerVisible(e,t)}resetView(){this.engineComponent?.resetView()}fitToView(){this.engineComponent?.fitToView()}setZoom(e){this.engineComponent?.setZoom(e)}getZoom(){return this.engineComponent?.getZoom()??1}setTheme(e){ct.setTheme(e)}on(e,t){return this.registry.on(e,t)}off(e,t){this.registry.off(e,t)}onRawEvent(e,t){this.engineComponent?.onRawEvent(e,t)}offRawEvent(e,t){this.engineComponent?.offRawEvent(e,t)}destroy(){this.engineComponent?.destroy(),this.engineComponent=null,this.registry.reset()}}class w9{engine=null;registry;container;containerId;options;_isInitialized=!1;_isDestroyed=!1;unsubscribeTheme=null;constructor(e,t){this.registry=t,this.container=e.container,this.container.id?this.containerId=this.container.id:(this.containerId=`engine720-container-${Date.now()}-${Math.random().toString(36).substr(2,9)}`,this.container.id=this.containerId),this.options={fov:e.fov??75,enableZoom:e.enableZoom??!0,enableRotate:e.enableRotate??!0,sphereRadius:e.sphereRadius??500,rotateSpeed:e.rotateSpeed,zoomSpeed:e.zoomSpeed,enableDamping:e.enableDamping,dampingFactor:e.dampingFactor,minFov:e.minFov,maxFov:e.maxFov}}init(){if(this._isInitialized){console.warn("[Engine720] Engine already initialized.");return}if(this._isDestroyed){console.error("[Engine720] Cannot initialize destroyed engine.");return}try{const e={containerId:this.containerId,fov:this.options.fov,enableZoom:this.options.enableZoom,enableRotate:this.options.enableRotate,sphereRadius:this.options.sphereRadius};if(this.options.rotateSpeed!==void 0&&(e.rotateSpeed=this.options.rotateSpeed),this.options.zoomSpeed!==void 0&&(e.zoomSpeed=this.options.zoomSpeed),this.options.enableDamping!==void 0&&(e.enableDamping=this.options.enableDamping),this.options.dampingFactor!==void 0&&(e.dampingFactor=this.options.dampingFactor),this.options.minFov!==void 0&&(e.minFov=this.options.minFov),this.options.maxFov!==void 0&&(e.maxFov=this.options.maxFov),console.log("[Engine720] 引擎配置信息:",e),this.engine=zz(e),!this.engine)throw new Error("Failed to create 720 engine instance");this._isInitialized=!0,this.unsubscribeTheme=ct.subscribe(t=>{this.setTheme(t)}),this.setTheme(ct.getTheme()),this.engine.events&&(this.engine.events.on("panorama-loaded",t=>{console.log("[Engine720] 全景加载完成:",t),this.registry.emit("engine720:panorama-loaded",{data:t})}),this.engine.events.on("panorama-load-error",t=>{console.error("[Engine720] 全景加载失败:",t),this.registry.emit("engine720:load-error",{data:t})}),this.engine.events.on("annotation-click",t=>{console.log("[Engine720] 标注点击:",t),this.registry.emit("engine720:annotation-click",{data:t})}),this.engine.events.on("view-angle-changed",t=>{this.registry.emit("engine720:view-changed",{data:t})}))}catch(e){throw console.error("[Engine720] Failed to initialize 720 engine:",e),this._isInitialized=!1,e}}setTheme(e){!this._isInitialized||this.engine}setLocales(){}isInitialized(){return this._isInitialized}async loadPanorama(e,t){if(!this._isInitialized||!this.engine){console.error("[Engine720] Engine not initialized. Please call init() first.");return}if(!e){console.error("[Engine720] Panorama URL is required.");return}try{console.log("[Engine720] 开始加载全景图:",e),await this.engine.loadPanorama(e),console.log("[Engine720] 全景图加载完成:",e)}catch(i){throw console.error("[Engine720] 全景图加载失败:",i),i}}async preloadPanoramas(e){if(!(!this._isInitialized||!this.engine))try{await this.engine.preloadPanoramas?.(e)}catch(t){console.warn("[Engine720] Failed to preload panoramas:",t)}}setFov(e){!this._isInitialized||!this.engine||this.engine.setFov?.(e)}getFov(){return!this._isInitialized||!this.engine?75:this.engine.getFov?.()??75}lookAt(e,t,i){!this._isInitialized||!this.engine||this.engine.lookAt?.(e,t,i)}resetView(){if(!(!this._isInitialized||!this.engine))try{this.engine.lookAt?.(0,0,!0),this.engine.setFov?.(75)}catch(e){console.warn("[Engine720] Failed to reset view:",e)}}pauseRendering(){!this._isInitialized||!this.engine||this.engine.pauseRendering?.()}resumeRendering(){!this._isInitialized||!this.engine||this.engine.resumeRendering?.()}resize(e,t){!this._isInitialized||!this.engine||this.engine.resize?.(e,t)}onRawEvent(e,t){this.engine?.events?.on(e,t)}offRawEvent(e,t){this.engine?.events?.off(e,t)}destroy(){if(!this._isDestroyed){if(this.unsubscribeTheme&&(this.unsubscribeTheme(),this.unsubscribeTheme=null),this.engine){try{this.engine.dispose?.()}catch(e){console.warn("[Engine720] Error during dispose:",e)}this.engine=null}this.container.innerHTML="",this._isDestroyed=!0,this._isInitialized=!1}}}class E9{container;registry;engineComponent=null;constructor(e,t){const i=typeof e=="string"?document.getElementById(e):e;if(!i)throw new Error("Container not found");this.container=i,this.registry=new Sm,t?.locale&&Zt.setLocale(t.locale),t?.theme&&t.theme!=="custom"&&ct.setTheme(t.theme),this.engineComponent=new w9({container:this.container,fov:t?.fov,enableZoom:t?.enableZoom,enableRotate:t?.enableRotate,sphereRadius:t?.sphereRadius,rotateSpeed:t?.rotateSpeed,zoomSpeed:t?.zoomSpeed,enableDamping:t?.enableDamping,dampingFactor:t?.dampingFactor,minFov:t?.minFov,maxFov:t?.maxFov},this.registry),this.engineComponent.init()}async loadPanorama(e,t){return this.engineComponent?.loadPanorama(e,t)}async preloadPanoramas(e){return this.engineComponent?.preloadPanoramas(e)}setFov(e){this.engineComponent?.setFov(e)}getFov(){return this.engineComponent?.getFov()??75}lookAt(e,t,i){this.engineComponent?.lookAt(e,t,i)}resetView(){this.engineComponent?.resetView()}setTheme(e){ct.setTheme(e)}on(e,t){return this.registry.on(e,t)}off(e,t){this.registry.off(e,t)}onRawEvent(e,t){this.engineComponent?.onRawEvent(e,t)}offRawEvent(e,t){this.engineComponent?.offRawEvent(e,t)}destroy(){this.engineComponent?.destroy(),this.engineComponent=null,this.registry.reset()}}const T9=Object.freeze(Object.defineProperty({__proto__:null,default:`# BIM引擎AI助手 - 需求分析与步骤规划专家\r
9885
9885
  \r
9886
9886
  ## 角色定位\r
9887
9887
  \r