iflow-engine 2.4.4 → 2.4.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/iflow-engine.umd.js
CHANGED
|
@@ -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-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-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}.measureBack{cursor:pointer;pointer-events:auto;fill:orange;padding:5px;top:-50px;rx:5;ry:5}.measureLabel{position:absolute;fill:#fff;font-size:14px;font-family:Arial,sans-serif;pointer-events:none}.measurePointer{fill:orange}.Hight{stroke:#fff;stroke-width:2}.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}.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}.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)}.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-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)}')),document.head.appendChild(e)}}catch(i){console.error("vite-plugin-css-injected-by-js",i)}})();
|
|
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-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-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}.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}.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)}.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-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)}')),document.head.appendChild(e)}}catch(i){console.error("vite-plugin-css-injected-by-js",i)}})();
|
|
2
2
|
(function(Zs,dc){typeof exports=="object"&&typeof module<"u"?dc(exports,require("opentype.js")):typeof define=="function"&&define.amd?define(["exports","opentype.js"],dc):(Zs=typeof globalThis<"u"?globalThis:Zs||self,dc(Zs.IflowEngine={},Zs["{}"]))})(this,(function(Zs,dc){"use strict";function Ew(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 Tw=Ew(dc),Cw={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:"反向",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:"设置",renderMode:"渲染模式",modes:{simple:"性能模式",balance:"平衡模式",advanced:"效果模式"},edgeLine:"边线",contrast:"对比度",saturation:"饱和度",lightIntensity:"光照强度",environment:"环境背景",backgroundVisible:"显示背景",ground:"显示地面",groundElevation:"地面高度",groundElevationUnit:"m"}},Aw={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",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",renderMode:"Render Mode",modes:{simple:"Performance",balance:"Balanced",advanced:"Quality"},edgeLine:"Edge Lines",contrast:"Contrast",saturation:"Saturation",lightIntensity:"Light Intensity",environment:"Environment",backgroundVisible:"Show Background",ground:"Ground",groundElevation:"Ground Elevation",groundElevationUnit:"m"}};class Pw{currentLocale="zh-CN";messages={"zh-CN":Cw,"en-US":Aw};listeners=[];constructor(){}getLocale(){return this.currentLocale}setLocale(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 Ai=new Pw,He=s=>Ai.t(s),dx={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"}}},Rw={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 Lw{currentTheme=dx;listeners=[];constructor(){}getTheme(){return this.currentTheme}setTheme(e){e==="light"?this.applyTheme(dx):this.applyTheme(Rw)}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 bt=new Lw;class wm{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=Ai.subscribe(()=>{this.setLocales()}),this.unsubscribeTheme=bt.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=He(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=He(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=bt.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=He(e.label),t.appendChild(o)}else e.label&&(t.title=He(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=He(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()}}class Iw extends wm{async init(){await super.init();const e=this.options.registry,{createHomeButton:t}=await Promise.resolve().then(()=>iz),{createZoomBoxButton:i}=await Promise.resolve().then(()=>nz),{createWalkMenuButton:n}=await Promise.resolve().then(()=>sz),{createMapButton:r}=await Promise.resolve().then(()=>rz),{createPropertyButton:a}=await Promise.resolve().then(()=>az),{createSettingButton:o}=await Promise.resolve().then(()=>oz),{createInfoButton:l}=await Promise.resolve().then(()=>lz),{createFullscreenButton:c}=await Promise.resolve().then(()=>cz),{createMeasureButton:h}=await Promise.resolve().then(()=>hz),{createSectionMenuButton:d}=await Promise.resolve().then(()=>dz),{createSectionPlaneButton:p}=await Promise.resolve().then(()=>uz),{createSectionAxisButton:u}=await Promise.resolve().then(()=>pz),{createSectionBoxButton:v}=await Promise.resolve().then(()=>fz),{createAiChatButton:g}=await Promise.resolve().then(()=>mz),{createCameraSwitchButton:m}=await Promise.resolve().then(()=>gz);this.addGroup("group-1"),this.addButton(t(e)),this.addButton(m(e)),this.addButton(i(e)),this.addButton(h(e)),this.addButton(d(e)),this.addButton(p(e)),this.addButton(u(e)),this.addButton(v(e)),this.addButton(n(e)),this.addButton(r(e)),this.addButton(a(e)),this.addGroup("group-2"),this.addButton(g(e)),this.addButton(o(e)),this.addButton(l(e)),this.addButton(c(e)),this.render()}}class Ys{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 Dw extends Ys{toolbar=null;toolbarContainer=null;container;constructor(e,t){super(t),this.container=e,this.init()}init(){this.toolbarContainer=document.createElement("div"),this.toolbarContainer.id="opt-btn-groups",this.toolbarContainer.className="bim-engine-opt-btn-container is-bottom-toolbar",this.container.appendChild(this.toolbarContainer),this.toolbar=new Iw({container:this.toolbarContainer,type:"glass-pill",showLabel:!0,direction:"row",position:"bottom-right",align:"vertical",expand:"up",registry:this.registry}),this.toolbar.init()}updateTheme(e){this.toolbar?.setTheme(e)}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)}setBtnActive(e,t){this.toolbar?.setBtnActive(e,t)}updateButtonIcon(e,t){this.toolbar?.updateButtonIcon(e,t)}setVisible(e){this.toolbarContainer&&(this.toolbarContainer.style.visibility=e?"visible":"hidden")}setBackgroundColor(e){this.toolbar?.setBackgroundColor(e)}setColors(e){this.toolbar?.setColors(e)}hide(){this.toolbarContainer&&(this.toolbarContainer.style.display="none")}show(){this.toolbarContainer&&(this.toolbarContainer.style.display="")}getContainer(){return this.toolbarContainer}setType(e){this.toolbar?.setType(e)}getType(){return this.toolbar?.getType()||"default"}}class Nw extends Ys{groups=new Map;container;constructor(e,t){super(t),this.container=e}create(e,t){const i=new wm({container:this.container,registry:this.registry,...t});return i.init(),this.groups.set(e,i),i}get(e){return this.groups.get(e)}updateTheme(e){this.groups.forEach(t=>t.setTheme(e))}destroy(){this.groups.forEach(e=>e.destroy()),this.groups.clear(),super.destroy()}}class Uw{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=bt.subscribe(e=>{this.setTheme(e)}),this.unsubscribeLocale=Ai.subscribe(()=>{this.setLocales()}))}setLocales(){if(this.options.title){const e=this.header.querySelector(".bim-dialog-title");e&&(e.textContent=He(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?He(this.options.title):"";const r=document.createElement("span");r.className="bim-dialog-close",r.innerHTML="×",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 x=r-o,y=a-l-c;m=Math.max(0,Math.min(m,x)),f=Math.max(0,Math.min(f,y)),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,x=Math.min(m,Math.max(this.options.minWidth||100,n+v)),y=Math.min(f,Math.max(this.options.minHeight||50,r+g));this.element.style.width=`${x}px`,this.element.style.height=`${y}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 Ow extends Ys{container;activeDialogs=[];constructor(e,t){super(t),this.container=e}create(e){const t=new Uw({container:this.container,...e,onClose:()=>{this.activeDialogs=this.activeDialogs.filter(i=>i!==t),e.onClose&&e.onClose()}});return t.setTheme(bt.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 Bo="183",Dn={LEFT:0,MIDDLE:1,RIGHT:2,ROTATE:0,DOLLY:1,PAN:2},Nn={ROTATE:0,PAN:1,DOLLY_PAN:2,DOLLY_ROTATE:3},ux=0,Em=1,px=2,Bw=3,kw=0,uc=1,fx=2,ko=3,_n=0,ki=1,It=2,Jt=0,ya=1,id=2,Tm=3,Cm=4,nd=5,Fw=6,bn=100,mx=101,gx=102,vx=103,xx=104,Rr=200,yx=201,_x=202,bx=203,sd=204,rd=205,pc=206,Mx=207,fc=208,Sx=209,wx=210,Ex=211,Tx=212,Cx=213,Ax=214,ad=0,od=1,ld=2,_a=3,cd=4,hd=5,dd=6,ud=7,mc=0,Px=1,Rx=2,ji=0,pd=1,fd=2,md=3,ba=4,gd=5,vd=6,xd=7,Am="attached",Lx="detached",yd=300,Rs=301,Lr=302,Fo=303,gc=304,zo=306,Ji=1e3,cn=1001,Ho=1002,Zt=1003,_d=1004,zw=1004,Ma=1005,Hw=1005,Ct=1006,Vo=1007,Vw=1007,jn=1008,Gw=1008,hn=1009,Pm=1010,Rm=1011,Go=1012,bd=1013,qn=1014,Pi=1015,yi=1016,Md=1017,Sd=1018,Ir=1020,Lm=35902,Im=35899,Dm=1021,Nm=1022,qi=1023,Ls=1026,Is=1027,vc=1028,xc=1029,Sa=1030,wd=1031,Ww=1032,Ed=1033,yc=33776,_c=33777,bc=33778,Mc=33779,Td=35840,Cd=35841,Ad=35842,Pd=35843,Rd=36196,Ld=37492,Id=37496,Dd=37488,Nd=37489,Ud=37490,Od=37491,Bd=37808,kd=37809,Fd=37810,zd=37811,Hd=37812,Vd=37813,Gd=37814,Wd=37815,Xd=37816,jd=37817,qd=37818,Zd=37819,Yd=37820,$d=37821,Kd=36492,Jd=36494,Qd=36495,eu=36283,tu=36284,iu=36285,nu=36286,Ix=2200,Dx=2201,Nx=2202,Wo=2300,Xo=2301,su=2302,Um=2303,wa=2400,Ea=2401,Sc=2402,ru=2500,Om=2501,Ux=0,Bm=1,au=2,Ox=3200,Xw=3201,jw=3202,qw=3203,Dr=0,Bx=1,$s="",oi="srgb",Zi="srgb-linear",wc="linear",kt="srgb",Zw="",Yw="rg",$w="ga",Kw=0,Ta=7680,Jw=7681,Qw=7682,eE=7683,tE=34055,iE=34056,nE=5386,sE=512,rE=513,aE=514,oE=515,lE=516,cE=517,hE=518,km=519,kx=512,Fx=513,zx=514,ou=515,Hx=516,Vx=517,lu=518,Gx=519,Ec=35044,dE=35048,uE=35040,pE=35045,fE=35049,mE=35041,gE=35046,vE=35050,xE=35042,yE="100",Fm="300 es",Un=2e3,Ca=2001,_E={COMPUTE:"compute",RENDER:"render"},bE={PERSPECTIVE:"perspective",LINEAR:"linear",FLAT:"flat"},ME={NORMAL:"normal",CENTROID:"centroid",SAMPLE:"sample",FIRST:"first",EITHER:"either"},SE={TEXTURE_COMPARE:"depthTextureCompare"};function wE(s){for(let e=s.length-1;e>=0;--e)if(s[e]>=65535)return!0;return!1}const EE={Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array};function jo(s,e){return new EE[s](e)}function Wx(s){return ArrayBuffer.isView(s)&&!(s instanceof DataView)}function Tc(s){return document.createElementNS("http://www.w3.org/1999/xhtml",s)}function Xx(){const s=Tc("canvas");return s.style.display="block",s}const jx={};let Nr=null;function TE(s){Nr=s}function CE(){return Nr}function Cc(...s){const e="THREE."+s.shift();Nr?Nr("log",e,...s):console.log(e,...s)}function qx(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=qx(s);const e="THREE."+s.shift();if(Nr)Nr("warn",e,...s);else{const t=s[0];t&&t.isStackTrace?console.warn(t.getError(e)):console.warn(e,...s)}}function lt(...s){s=qx(s);const e="THREE."+s.shift();if(Nr)Nr("error",e,...s);else{const t=s[0];t&&t.isStackTrace?console.error(t.getError(e)):console.error(e,...s)}}function Ac(...s){const e=s.join(" ");e in jx||(jx[e]=!0,Ye(...s))}function AE(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 PE={[ad]:od,[ld]:dd,[cd]:ud,[_a]:hd,[od]:ad,[dd]:ld,[ud]:cd,[hd]:_a};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 Zx=1234567;const Aa=Math.PI/180,qo=180/Math.PI;function On(){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 ht(s,e,t){return Math.max(e,Math.min(t,s))}function zm(s,e){return(s%e+e)%e}function RE(s,e,t,i,n){return i+(s-e)*(n-i)/(t-e)}function LE(s,e,t){return s!==e?(t-s)/(e-s):0}function Pc(s,e,t){return(1-t)*s+t*e}function IE(s,e,t,i){return Pc(s,e,1-Math.exp(-t*i))}function DE(s,e=1){return e-Math.abs(zm(s,e*2)-e)}function NE(s,e,t){return s<=e?0:s>=t?1:(s=(s-e)/(t-e),s*s*(3-2*s))}function UE(s,e,t){return s<=e?0:s>=t?1:(s=(s-e)/(t-e),s*s*s*(s*(s*6-15)+10))}function OE(s,e){return s+Math.floor(Math.random()*(e-s+1))}function BE(s,e){return s+Math.random()*(e-s)}function kE(s){return s*(.5-Math.random())}function FE(s){s!==void 0&&(Zx=s);let e=Zx+=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 zE(s){return s*Aa}function HE(s){return s*qo}function VE(s){return(s&s-1)===0&&s!==0}function GE(s){return Math.pow(2,Math.ceil(Math.log(s)/Math.LN2))}function WE(s){return Math.pow(2,Math.floor(Math.log(s)/Math.LN2))}function XE(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 ft(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 Dt={DEG2RAD:Aa,RAD2DEG:qo,generateUUID:On,clamp:ht,euclideanModulo:zm,mapLinear:RE,inverseLerp:LE,lerp:Pc,damp:IE,pingpong:DE,smoothstep:NE,smootherstep:UE,randInt:OE,randFloat:BE,randFloatSpread:kE,seededRandom:FE,degToRad:zE,radToDeg:HE,isPowerOfTwo:VE,ceilPowerOfTwo:GE,floorPowerOfTwo:WE,setQuaternionFromProperEuler:XE,normalize:ft,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=ht(this.x,e.x,t.x),this.y=ht(this.y,e.y,t.y),this}clampScalar(e,t){return this.x=ht(this.x,e,t),this.y=ht(this.y,e,t),this}clampLength(e,t){const i=this.length();return this.divideScalar(i||1).multiplyScalar(ht(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(ht(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 $t{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 x=Math.acos(m),y=Math.sin(x);f=Math.sin(f*x)/y,o=Math.sin(o*x)/y,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 x=1/Math.sqrt(l*l+c*c+h*h+d*d);l*=x,c*=x,h*=x,d*=x}}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(ht(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(Yx.setFromEuler(e))}applyAxisAngle(e,t){return this.applyQuaternion(Yx.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=ht(this.x,e.x,t.x),this.y=ht(this.y,e.y,t.y),this.z=ht(this.z,e.z,t.z),this}clampScalar(e,t){return this.x=ht(this.x,e,t),this.y=ht(this.y,e,t),this.z=ht(this.z,e,t),this}clampLength(e,t){const i=this.length();return this.divideScalar(i||1).multiplyScalar(ht(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 Hm.copy(this).projectOnVector(e),this.sub(Hm)}reflect(e){return this.sub(Hm.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(ht(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 Hm=new R,Yx=new $t;class ut{constructor(e,t,i,n,r,a,o,l,c){ut.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],x=n[1],y=n[4],_=n[7],S=n[2],b=n[5],E=n[8];return r[0]=a*g+o*x+l*S,r[3]=a*m+o*y+l*b,r[6]=a*f+o*_+l*E,r[1]=c*g+h*x+d*S,r[4]=c*m+h*y+d*b,r[7]=c*f+h*_+d*E,r[2]=p*g+u*x+v*S,r[5]=p*m+u*y+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(Vm.makeScale(e,t)),this}rotate(e){return this.premultiply(Vm.makeRotation(-e)),this}translate(e,t){return this.premultiply(Vm.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 Vm=new ut,$x=new ut().set(.4123908,.3575843,.1804808,.212639,.7151687,.0721923,.0193308,.1191948,.9505322),Kx=new ut().set(3.2409699,-1.5373832,-.4986108,-.9692436,1.8759675,.0415551,.0556301,-.203977,1.0569715);function jE(){const s={enabled:!0,workingColorSpace:Zi,spaces:{},convert:function(n,r,a){return this.enabled===!1||r===a||!r||!a||(this.spaces[r].transfer===kt&&(n.r=Ks(n.r),n.g=Ks(n.g),n.b=Ks(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===kt&&(n.r=Zo(n.r),n.g=Zo(n.g),n.b=Zo(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===$s?wc: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 Ac("ColorManagement: .fromWorkingColorSpace() has been renamed to .workingToColorSpace()."),s.workingToColorSpace(n,r)},toWorkingColorSpace:function(n,r){return Ac("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:wc,toXYZ:$x,fromXYZ:Kx,luminanceCoefficients:t,workingColorSpaceConfig:{unpackColorSpace:oi},outputColorSpaceConfig:{drawingBufferColorSpace:oi}},[oi]:{primaries:e,whitePoint:i,transfer:kt,toXYZ:$x,fromXYZ:Kx,luminanceCoefficients:t,outputColorSpaceConfig:{drawingBufferColorSpace:oi}}}),s}const wt=jE();function Ks(s){return s<.04045?s*.0773993808:Math.pow(s*.9478672986+.0521327014,2.4)}function Zo(s){return s<.0031308?s*12.92:1.055*Math.pow(s,.41666)-.055}let Yo;class Jx{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{Yo===void 0&&(Yo=Tc("canvas")),Yo.width=e.width,Yo.height=e.height;const n=Yo.getContext("2d");e instanceof ImageData?n.putImageData(e,0,0):n.drawImage(e,0,0,e.width,e.height),i=Yo}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=Tc("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]=Ks(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(Ks(t[i]/255)*255):t[i]=Ks(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 qE=0;class Ur{constructor(e=null){this.isSource=!0,Object.defineProperty(this,"id",{value:qE++}),this.uuid=On(),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(Gm(n[a].image)):r.push(Gm(n[a]))}else r=Gm(n);i.url=r}return t||(e.images[this.uuid]=i),i}}function Gm(s){return typeof HTMLImageElement<"u"&&s instanceof HTMLImageElement||typeof HTMLCanvasElement<"u"&&s instanceof HTMLCanvasElement||typeof ImageBitmap<"u"&&s instanceof ImageBitmap?Jx.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 ZE=0;const Wm=new R;class Qt extends hs{constructor(e=Qt.DEFAULT_IMAGE,t=Qt.DEFAULT_MAPPING,i=cn,n=cn,r=Ct,a=jn,o=qi,l=hn,c=Qt.DEFAULT_ANISOTROPY,h=$s){super(),this.isTexture=!0,Object.defineProperty(this,"id",{value:ZE++}),this.uuid=On(),this.name="",this.source=new Ur(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 ut,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(Wm).x}get height(){return this.source.getSize(Wm).y}get depth(){return this.source.getSize(Wm).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!==yd)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 Ho: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 Ho: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++}}Qt.DEFAULT_IMAGE=null,Qt.DEFAULT_MAPPING=yd,Qt.DEFAULT_ANISOTROPY=1;class At{constructor(e=0,t=0,i=0,n=1){At.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 y=(c+1)/2,_=(u+1)/2,S=(f+1)/2,b=(h+p)/4,E=(d+g)/4,w=(v+m)/4;return y>_&&y>S?y<.01?(i=0,n=.707106781,r=.707106781):(i=Math.sqrt(y),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 x=Math.sqrt((m-v)*(m-v)+(d-g)*(d-g)+(p-h)*(p-h));return Math.abs(x)<.001&&(x=1),this.x=(m-v)/x,this.y=(d-g)/x,this.z=(p-h)/x,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=ht(this.x,e.x,t.x),this.y=ht(this.y,e.y,t.y),this.z=ht(this.z,e.z,t.z),this.w=ht(this.w,e.w,t.w),this}clampScalar(e,t){return this.x=ht(this.x,e,t),this.y=ht(this.y,e,t),this.z=ht(this.z,e,t),this.w=ht(this.w,e,t),this}clampLength(e,t){const i=this.length();return this.divideScalar(i||1).multiplyScalar(ht(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 Xm extends hs{constructor(e=1,t=1,i={}){super(),i=Object.assign({generateMipmaps:!1,internalFormat:null,minFilter:Ct,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 At(0,0,e,t),this.scissorTest=!1,this.viewport=new At(0,0,e,t),this.textures=[];const n={width:e,height:t,depth:i.depth},r=new Qt(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:Ct,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 Ur(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 _i extends Xm{constructor(e=1,t=1,i={}){super(e,t,i),this.isWebGLRenderTarget=!0}}class cu extends Qt{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=Zt,this.minFilter=Zt,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 YE extends _i{constructor(e=1,t=1,i=1,n={}){super(e,t,n),this.isWebGLArrayRenderTarget=!0,this.depth=i,this.texture=new cu(null,e,t,i),this._setTextureOptions(n),this.texture.isRenderTargetTexture=!0}}class hu extends Qt{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=Zt,this.minFilter=Zt,this.wrapR=cn,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1}}class $E extends _i{constructor(e=1,t=1,i=1,n={}){super(e,t,n),this.isWebGL3DRenderTarget=!0,this.depth=i,this.texture=new hu(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/$o.setFromMatrixColumn(e,0).length(),r=1/$o.setFromMatrixColumn(e,1).length(),a=1/$o.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(KE,e,JE)}lookAt(e,t,i){const n=this.elements;return Bn.subVectors(e,t),Bn.lengthSq()===0&&(Bn.z=1),Bn.normalize(),Or.crossVectors(i,Bn),Or.lengthSq()===0&&(Math.abs(i.z)===1?Bn.x+=1e-4:Bn.z+=1e-4,Bn.normalize(),Or.crossVectors(i,Bn)),Or.normalize(),du.crossVectors(Bn,Or),n[0]=Or.x,n[4]=du.x,n[8]=Bn.x,n[1]=Or.y,n[5]=du.y,n[9]=Bn.y,n[2]=Or.z,n[6]=du.z,n[10]=Bn.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],x=i[3],y=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],U=n[13],A=n[2],k=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*k+c*G,r[8]=a*w+o*P+l*F+c*re,r[12]=a*M+o*U+l*H+c*Y,r[1]=h*b+d*C+p*A+u*q,r[5]=h*E+d*L+p*k+u*G,r[9]=h*w+d*P+p*F+u*re,r[13]=h*M+d*U+p*H+u*Y,r[2]=v*b+g*C+m*A+f*q,r[6]=v*E+g*L+m*k+f*G,r[10]=v*w+g*P+m*F+f*re,r[14]=v*M+g*U+m*H+f*Y,r[3]=x*b+y*C+_*A+S*q,r[7]=x*E+y*L+_*k+S*G,r[11]=x*w+y*P+_*F+S*re,r[15]=x*M+y*U+_*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],x=l*u-c*p,y=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*x-m*y+f*_)-i*(v*x-m*S+f*b)+n*(v*y-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],x=t*o-i*a,y=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,U=p*f-u*m,A=x*U-y*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 k=1/A;return e[0]=(o*U-l*P+c*L)*k,e[1]=(n*P-i*U-r*L)*k,e[2]=(g*E-m*b+f*S)*k,e[3]=(p*b-d*E-u*S)*k,e[4]=(l*C-a*U-c*M)*k,e[5]=(t*U-n*C+r*M)*k,e[6]=(m*_-v*E-f*y)*k,e[7]=(h*E-p*_+u*y)*k,e[8]=(a*P-o*C+c*w)*k,e[9]=(i*C-t*P-r*w)*k,e[10]=(v*b-g*_+f*x)*k,e[11]=(d*_-h*b-u*x)*k,e[12]=(o*M-a*L-l*w)*k,e[13]=(t*L-i*M+n*w)*k,e[14]=(g*y-v*S-m*x)*k,e[15]=(h*S-d*y+p*x)*k,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,x=l*c,y=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-y)*S,n[3]=0,n[4]=(u-_)*b,n[5]=(1-(p+f))*b,n[6]=(m+x)*b,n[7]=0,n[8]=(v+y)*E,n[9]=(m-x)*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=$o.set(n[0],n[1],n[2]).length();const o=$o.set(n[4],n[5],n[6]).length(),l=$o.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=Un,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===Un)v=-(a+r)/(a-r),g=-2*a*r/(a-r);else if(o===Ca)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=Un,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===Un)v=-2/(a-r),g=-(a+r)/(a-r);else if(o===Ca)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 $o=new R,ds=new qe,KE=new R(0,0,0),JE=new R(1,1,1),Or=new R,du=new R,Bn=new R,Qx=new qe,ey=new $t;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(ht(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(-ht(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(ht(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(-ht(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(ht(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(-ht(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 Qx.makeRotationFromQuaternion(e),this.setFromRotationMatrix(Qx,t,i)}setFromVector3(e,t=this._order){return this.set(e.x,e.y,e.z,t)}reorder(e){return ey.setFromEuler(this),this.setFromQuaternion(ey,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 uu{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 QE=0;const ty=new R,Ko=new $t,Js=new qe,pu=new R,Rc=new R,e3=new R,t3=new $t,iy=new R(1,0,0),ny=new R(0,1,0),sy=new R(0,0,1),ry={type:"added"},i3={type:"removed"},Jo={type:"childadded",child:null},jm={type:"childremoved",child:null};class Pt extends hs{constructor(){super(),this.isObject3D=!0,Object.defineProperty(this,"id",{value:QE++}),this.uuid=On(),this.name="",this.type="Object3D",this.parent=null,this.children=[],this.up=Pt.DEFAULT_UP.clone();const e=new R,t=new Fi,i=new $t,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 ut}}),this.matrix=new qe,this.matrixWorld=new qe,this.matrixAutoUpdate=Pt.DEFAULT_MATRIX_AUTO_UPDATE,this.matrixWorldAutoUpdate=Pt.DEFAULT_MATRIX_WORLD_AUTO_UPDATE,this.matrixWorldNeedsUpdate=!1,this.layers=new uu,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 Ko.setFromAxisAngle(e,t),this.quaternion.multiply(Ko),this}rotateOnWorldAxis(e,t){return Ko.setFromAxisAngle(e,t),this.quaternion.premultiply(Ko),this}rotateX(e){return this.rotateOnAxis(iy,e)}rotateY(e){return this.rotateOnAxis(ny,e)}rotateZ(e){return this.rotateOnAxis(sy,e)}translateOnAxis(e,t){return ty.copy(e).applyQuaternion(this.quaternion),this.position.add(ty.multiplyScalar(t)),this}translateX(e){return this.translateOnAxis(iy,e)}translateY(e){return this.translateOnAxis(ny,e)}translateZ(e){return this.translateOnAxis(sy,e)}localToWorld(e){return this.updateWorldMatrix(!0,!1),e.applyMatrix4(this.matrixWorld)}worldToLocal(e){return this.updateWorldMatrix(!0,!1),e.applyMatrix4(Js.copy(this.matrixWorld).invert())}lookAt(e,t,i){e.isVector3?pu.copy(e):pu.set(e,t,i);const n=this.parent;this.updateWorldMatrix(!0,!1),Rc.setFromMatrixPosition(this.matrixWorld),this.isCamera||this.isLight?Js.lookAt(Rc,pu,this.up):Js.lookAt(pu,Rc,this.up),this.quaternion.setFromRotationMatrix(Js),n&&(Js.extractRotation(n.matrixWorld),Ko.setFromRotationMatrix(Js),this.quaternion.premultiply(Ko.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(ry),Jo.child=e,this.dispatchEvent(Jo),Jo.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(i3),jm.child=e,this.dispatchEvent(jm),jm.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),Js.copy(this.matrixWorld).invert(),e.parent!==null&&(e.parent.updateWorldMatrix(!0,!1),Js.multiply(e.parent.matrixWorld)),e.applyMatrix4(Js),e.removeFromParent(),e.parent=this,this.children.push(e),e.updateWorldMatrix(!1,!0),e.dispatchEvent(ry),Jo.child=e,this.dispatchEvent(Jo),Jo.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(Rc,e,e3),e}getWorldScale(e){return this.updateWorldMatrix(!0,!1),this.matrixWorld.decompose(Rc,t3,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}}Pt.DEFAULT_UP=new R(0,1,0),Pt.DEFAULT_MATRIX_AUTO_UPDATE=!0,Pt.DEFAULT_MATRIX_WORLD_AUTO_UPDATE=!0;class ui extends Pt{constructor(){super(),this.isGroup=!0,this.type="Group"}}const n3={type:"move"};class fu{constructor(){this._targetRay=null,this._grip=null,this._hand=null}getHandSpace(){return this._hand===null&&(this._hand=new ui,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 ui,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 ui,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(n3)))}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 ui;i.matrixAutoUpdate=!1,i.visible=!1,e.joints[t.jointName]=i,e.add(i)}return e.joints[t.jointName]}}const ay={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},mu={h:0,s:0,l:0};function qm(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=oi){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=zm(e,1),t=ht(t,0,1),i=ht(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=qm(a,r,e+1/3),this.g=qm(a,r,e),this.b=qm(a,r,e-1/3)}return wt.colorSpaceToWorking(this,n),this}setStyle(e,t=oi){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=oi){const i=ay[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=Ks(e.r),this.g=Ks(e.g),this.b=Ks(e.b),this}copyLinearToSRGB(e){return this.r=Zo(e.r),this.g=Zo(e.g),this.b=Zo(e.b),this}convertSRGBToLinear(){return this.copySRGBToLinear(this),this}convertLinearToSRGB(){return this.copyLinearToSRGB(this),this}getHex(e=oi){return wt.workingToColorSpace(en.copy(this),e),Math.round(ht(en.r*255,0,255))*65536+Math.round(ht(en.g*255,0,255))*256+Math.round(ht(en.b*255,0,255))}getHexString(e=oi){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=oi){wt.workingToColorSpace(en.copy(this),e);const t=en.r,i=en.g,n=en.b;return e!==oi?`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(mu);const i=Pc(Br.h,mu.h,t),n=Pc(Br.s,mu.s,t),r=Pc(Br.l,mu.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=ay;class gu{constructor(e,t=25e-5){this.isFogExp2=!0,this.name="",this.color=new We(e),this.density=t}clone(){return new gu(this.color,this.density)}toJSON(){return{type:"FogExp2",name:this.name,color:this.color.getHex(),density:this.density}}}class vu{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 vu(this.color,this.near,this.far)}toJSON(){return{type:"Fog",name:this.name,color:this.color.getHex(),near:this.near,far:this.far}}}class Pa extends Pt{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,Qs=new R,Zm=new R,er=new R,Qo=new R,el=new R,oy=new R,Ym=new R,$m=new R,Km=new R,Jm=new At,Qm=new At,eg=new At;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),Qs.subVectors(i,t),Zm.subVectors(e,t);const a=us.dot(us),o=us.dot(Qs),l=us.dot(Zm),c=Qs.dot(Qs),h=Qs.dot(Zm),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,er)===null?!1:er.x>=0&&er.y>=0&&er.x+er.y<=1}static getInterpolation(e,t,i,n,r,a,o,l){return this.getBarycoord(e,t,i,n,er)===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,er.x),l.addScaledVector(a,er.y),l.addScaledVector(o,er.z),l)}static getInterpolatedAttribute(e,t,i,n,r,a){return Jm.setScalar(0),Qm.setScalar(0),eg.setScalar(0),Jm.fromBufferAttribute(e,t),Qm.fromBufferAttribute(e,i),eg.fromBufferAttribute(e,n),a.setScalar(0),a.addScaledVector(Jm,r.x),a.addScaledVector(Qm,r.y),a.addScaledVector(eg,r.z),a}static isFrontFacing(e,t,i,n){return us.subVectors(i,t),Qs.subVectors(e,t),us.cross(Qs).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),Qs.subVectors(this.a,this.b),us.cross(Qs).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;Qo.subVectors(n,i),el.subVectors(r,i),Ym.subVectors(e,i);const l=Qo.dot(Ym),c=el.dot(Ym);if(l<=0&&c<=0)return t.copy(i);$m.subVectors(e,n);const h=Qo.dot($m),d=el.dot($m);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(Qo,a);Km.subVectors(e,r);const u=Qo.dot(Km),v=el.dot(Km);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(el,o);const m=h*v-u*d;if(m<=0&&d-h>=0&&u-v>=0)return oy.subVectors(r,n),o=(d-h)/(d-h+(u-v)),t.copy(n).addScaledVector(oy,o);const f=1/(m+g+p);return a=g*f,o=p*f,t.copy(i).addScaledVector(Qo,a).addScaledVector(el,o)}equals(e){return e.a.equals(this.a)&&e.b.equals(this.b)&&e.c.equals(this.c)}}class mt{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(),xu.copy(e.boundingBox)):(i.boundingBox===null&&i.computeBoundingBox(),xu.copy(i.boundingBox)),xu.applyMatrix4(e.matrixWorld),this.union(xu)}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(Lc),yu.subVectors(this.max,Lc),tl.subVectors(e.a,Lc),il.subVectors(e.b,Lc),nl.subVectors(e.c,Lc),kr.subVectors(il,tl),Fr.subVectors(nl,il),Ra.subVectors(tl,nl);let t=[0,-kr.z,kr.y,0,-Fr.z,Fr.y,0,-Ra.z,Ra.y,kr.z,0,-kr.x,Fr.z,0,-Fr.x,Ra.z,0,-Ra.x,-kr.y,kr.x,0,-Fr.y,Fr.x,0,-Ra.y,Ra.x,0];return!tg(t,tl,il,nl,yu)||(t=[1,0,0,0,1,0,0,0,1],!tg(t,tl,il,nl,yu))?!1:(_u.crossVectors(kr,Fr),t=[_u.x,_u.y,_u.z],tg(t,tl,il,nl,yu))}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:(tr[0].set(this.min.x,this.min.y,this.min.z).applyMatrix4(e),tr[1].set(this.min.x,this.min.y,this.max.z).applyMatrix4(e),tr[2].set(this.min.x,this.max.y,this.min.z).applyMatrix4(e),tr[3].set(this.min.x,this.max.y,this.max.z).applyMatrix4(e),tr[4].set(this.max.x,this.min.y,this.min.z).applyMatrix4(e),tr[5].set(this.max.x,this.min.y,this.max.z).applyMatrix4(e),tr[6].set(this.max.x,this.max.y,this.min.z).applyMatrix4(e),tr[7].set(this.max.x,this.max.y,this.max.z).applyMatrix4(e),this.setFromPoints(tr),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 tr=[new R,new R,new R,new R,new R,new R,new R,new R],ps=new R,xu=new mt,tl=new R,il=new R,nl=new R,kr=new R,Fr=new R,Ra=new R,Lc=new R,yu=new R,_u=new R,La=new R;function tg(s,e,t,i,n){for(let r=0,a=s.length-3;r<=a;r+=3){La.fromArray(s,r);const o=n.x*Math.abs(La.x)+n.y*Math.abs(La.y)+n.z*Math.abs(La.z),l=e.dot(La),c=t.dot(La),h=i.dot(La);if(Math.max(-Math.max(l,c,h),Math.min(l,c,h))>o)return!1}return!0}const ir=s3();function s3(){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=ht(s,-65504,65504),ir.floatView[0]=s;const e=ir.uint32View[0],t=e>>23&511;return ir.baseTable[t]+((e&8388607)>>ir.shiftTable[t])}function Ic(s){const e=s>>10;return ir.uint32View[0]=ir.mantissaTable[ir.offsetTable[e]+(s&1023)]+ir.exponentTable[e],ir.floatView[0]}class Dc{static toHalfFloat(e){return Mn(e)}static fromHalfFloat(e){return Ic(e)}}const bi=new R,bu=new me;let r3=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:r3++}),this.name="",this.array=e,this.itemSize=t,this.count=e!==void 0?e.length/t:0,this.normalized=i,this.usage=Ec,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++)bu.fromBufferAttribute(this,t),bu.applyMatrix3(e),this.setXY(t,bu.x,bu.y);else if(this.itemSize===3)for(let t=0,i=this.count;t<i;t++)bi.fromBufferAttribute(this,t),bi.applyMatrix3(e),this.setXYZ(t,bi.x,bi.y,bi.z);return this}applyMatrix4(e){for(let t=0,i=this.count;t<i;t++)bi.fromBufferAttribute(this,t),bi.applyMatrix4(e),this.setXYZ(t,bi.x,bi.y,bi.z);return this}applyNormalMatrix(e){for(let t=0,i=this.count;t<i;t++)bi.fromBufferAttribute(this,t),bi.applyNormalMatrix(e),this.setXYZ(t,bi.x,bi.y,bi.z);return this}transformDirection(e){for(let t=0,i=this.count;t<i;t++)bi.fromBufferAttribute(this,t),bi.transformDirection(e),this.setXYZ(t,bi.x,bi.y,bi.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=ft(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=ft(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=ft(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=ft(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=ft(t,this.array)),this.array[e*this.itemSize+3]=t,this}setXY(e,t,i){return e*=this.itemSize,this.normalized&&(t=ft(t,this.array),i=ft(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=ft(t,this.array),i=ft(i,this.array),n=ft(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=ft(t,this.array),i=ft(i,this.array),n=ft(n,this.array),r=ft(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!==Ec&&(e.usage=this.usage),e}}class a3 extends Mt{constructor(e,t,i){super(new Int8Array(e),t,i)}}class o3 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 c3 extends Mt{constructor(e,t,i){super(new Int16Array(e),t,i)}}class ig extends Mt{constructor(e,t,i){super(new Uint16Array(e),t,i)}}class h3 extends Mt{constructor(e,t,i){super(new Int32Array(e),t,i)}}class ng extends Mt{constructor(e,t,i){super(new Uint32Array(e),t,i)}}class d3 extends Mt{constructor(e,t,i){super(new Uint16Array(e),t,i),this.isFloat16BufferAttribute=!0}getX(e){let t=Ic(this.array[e*this.itemSize]);return this.normalized&&(t=dn(t,this.array)),t}setX(e,t){return this.normalized&&(t=ft(t,this.array)),this.array[e*this.itemSize]=Mn(t),this}getY(e){let t=Ic(this.array[e*this.itemSize+1]);return this.normalized&&(t=dn(t,this.array)),t}setY(e,t){return this.normalized&&(t=ft(t,this.array)),this.array[e*this.itemSize+1]=Mn(t),this}getZ(e){let t=Ic(this.array[e*this.itemSize+2]);return this.normalized&&(t=dn(t,this.array)),t}setZ(e,t){return this.normalized&&(t=ft(t,this.array)),this.array[e*this.itemSize+2]=Mn(t),this}getW(e){let t=Ic(this.array[e*this.itemSize+3]);return this.normalized&&(t=dn(t,this.array)),t}setW(e,t){return this.normalized&&(t=ft(t,this.array)),this.array[e*this.itemSize+3]=Mn(t),this}setXY(e,t,i){return e*=this.itemSize,this.normalized&&(t=ft(t,this.array),i=ft(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=ft(t,this.array),i=ft(i,this.array),n=ft(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=ft(t,this.array),i=ft(i,this.array),n=ft(n,this.array),r=ft(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 u3=new mt,Nc=new R,sg=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):u3.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;Nc.subVectors(e,this.center);const t=Nc.lengthSq();if(t>this.radius*this.radius){const i=Math.sqrt(t),n=(i-this.radius)*.5;this.center.addScaledVector(Nc,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):(sg.subVectors(e.center,this.center).setLength(e.radius),this.expandByPoint(Nc.copy(e.center).add(sg)),this.expandByPoint(Nc.copy(e.center).sub(sg))),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 p3=0;const Zn=new qe,rg=new Pt,sl=new R,kn=new mt,Uc=new mt,Hi=new R;class at extends hs{constructor(){super(),this.isBufferGeometry=!0,Object.defineProperty(this,"id",{value:p3++}),this.uuid=On(),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(wE(e)?ng:ig)(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 ut().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 Zn.makeRotationFromQuaternion(e),this.applyMatrix4(Zn),this}rotateX(e){return Zn.makeRotationX(e),this.applyMatrix4(Zn),this}rotateY(e){return Zn.makeRotationY(e),this.applyMatrix4(Zn),this}rotateZ(e){return Zn.makeRotationZ(e),this.applyMatrix4(Zn),this}translate(e,t,i){return Zn.makeTranslation(e,t,i),this.applyMatrix4(Zn),this}scale(e,t,i){return Zn.makeScale(e,t,i),this.applyMatrix4(Zn),this}lookAt(e){return rg.lookAt(e),rg.updateMatrix(),this.applyMatrix4(rg.matrix),this}center(){return this.computeBoundingBox(),this.boundingBox.getCenter(sl).negate(),this.translate(sl.x,sl.y,sl.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 mt);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];kn.setFromBufferAttribute(r),this.morphTargetsRelative?(Hi.addVectors(this.boundingBox.min,kn.min),this.boundingBox.expandByPoint(Hi),Hi.addVectors(this.boundingBox.max,kn.max),this.boundingBox.expandByPoint(Hi)):(this.boundingBox.expandByPoint(kn.min),this.boundingBox.expandByPoint(kn.max))}}else this.boundingBox.makeEmpty();(isNaN(this.boundingBox.min.x)||isNaN(this.boundingBox.min.y)||isNaN(this.boundingBox.min.z))&<('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(kn.setFromBufferAttribute(e),t)for(let r=0,a=t.length;r<a;r++){const o=t[r];Uc.setFromBufferAttribute(o),this.morphTargetsRelative?(Hi.addVectors(kn.min,Uc.min),kn.expandByPoint(Hi),Hi.addVectors(kn.max,Uc.max),kn.expandByPoint(Hi)):(kn.expandByPoint(Uc.min),kn.expandByPoint(Uc.max))}kn.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&&(sl.fromBufferAttribute(e,c),Hi.add(sl)),n=Math.max(n,i.distanceToSquared(Hi))}this.boundingSphere.radius=Math.sqrt(n),isNaN(this.boundingSphere.radius)&<('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 x=this.groups;x.length===0&&(x=[{start:0,count:e.count}]);for(let w=0,M=x.length;w<M;++w){const C=x[w],L=C.start,P=C.count;for(let U=L,A=L+P;U<A;U+=3)f(e.getX(U+0),e.getX(U+1),e.getX(U+2))}const y=new R,_=new R,S=new R,b=new R;function E(w){S.fromBufferAttribute(n,w),b.copy(S);const M=o[w];y.copy(M),y.sub(S.multiplyScalar(S.dot(M))).normalize(),_.crossVectors(b,M);const L=_.dot(l[w])<0?-1:1;a.setXYZW(w,y.x,y.y,y.z,L)}for(let w=0,M=x.length;w<M;++w){const C=x[w],L=C.start,P=C.count;for(let U=L,A=L+P;U<A;U+=3)E(e.getX(U+0)),E(e.getX(U+1)),E(e.getX(U+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 Oc{constructor(e,t){this.isInterleavedBuffer=!0,this.array=e,this.stride=t,this.count=e!==void 0?e.length/t:0,this.usage=Ec,this.updateRanges=[],this.version=0,this.uuid=On()}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=On()),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=On()),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 zr{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=ft(i,this.array)),this.data.array[e*this.data.stride+this.offset+t]=i,this}setX(e,t){return this.normalized&&(t=ft(t,this.array)),this.data.array[e*this.data.stride+this.offset]=t,this}setY(e,t){return this.normalized&&(t=ft(t,this.array)),this.data.array[e*this.data.stride+this.offset+1]=t,this}setZ(e,t){return this.normalized&&(t=ft(t,this.array)),this.data.array[e*this.data.stride+this.offset+2]=t,this}setW(e,t){return this.normalized&&(t=ft(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=ft(t,this.array),i=ft(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=ft(t,this.array),i=ft(i,this.array),n=ft(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=ft(t,this.array),i=ft(i,this.array),n=ft(n,this.array),r=ft(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){Cc("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 zr(e.interleavedBuffers[this.data.uuid],this.itemSize,this.offset,this.normalized)}toJSON(e){if(e===void 0){Cc("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 f3=0;class Ri extends hs{constructor(){super(),this.isMaterial=!0,Object.defineProperty(this,"id",{value:f3++}),this.uuid=On(),this.name="",this.type="Material",this.blending=ya,this.side=_n,this.vertexColors=!1,this.opacity=1,this.transparent=!1,this.alphaHash=!1,this.blendSrc=sd,this.blendDst=rd,this.blendEquation=bn,this.blendSrcAlpha=null,this.blendDstAlpha=null,this.blendEquationAlpha=null,this.blendColor=new We(0,0,0),this.blendAlpha=0,this.depthFunc=_a,this.depthTest=!0,this.depthWrite=!0,this.stencilWriteMask=255,this.stencilFunc=km,this.stencilRef=0,this.stencilFuncMask=255,this.stencilFail=Ta,this.stencilZFail=Ta,this.stencilZPass=Ta,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!==ya&&(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!==sd&&(i.blendSrc=this.blendSrc),this.blendDst!==rd&&(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!==_a&&(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!==km&&(i.stencilFunc=this.stencilFunc),this.stencilRef!==0&&(i.stencilRef=this.stencilRef),this.stencilFuncMask!==255&&(i.stencilFuncMask=this.stencilFuncMask),this.stencilFail!==Ta&&(i.stencilFail=this.stencilFail),this.stencilZFail!==Ta&&(i.stencilZFail=this.stencilZFail),this.stencilZPass!==Ta&&(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 Mu 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 rl;const Bc=new R,al=new R,ol=new R,ll=new me,kc=new me,ly=new qe,Su=new R,Fc=new R,wu=new R,cy=new me,ag=new me,hy=new me;class zc extends Pt{constructor(e=new Mu){if(super(),this.isSprite=!0,this.type="Sprite",rl===void 0){rl=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 Oc(t,5);rl.setIndex([0,1,2,0,2,3]),rl.setAttribute("position",new zr(i,3,0,!1)),rl.setAttribute("uv",new zr(i,2,3,!1))}this.geometry=rl,this.material=e,this.center=new me(.5,.5),this.count=1}raycast(e,t){e.camera===null&<('Sprite: "Raycaster.camera" needs to be set in order to raycast against sprites.'),al.setFromMatrixScale(this.matrixWorld),ly.copy(e.camera.matrixWorld),this.modelViewMatrix.multiplyMatrices(e.camera.matrixWorldInverse,this.matrixWorld),ol.setFromMatrixPosition(this.modelViewMatrix),e.camera.isPerspectiveCamera&&this.material.sizeAttenuation===!1&&al.multiplyScalar(-ol.z);const i=this.material.rotation;let n,r;i!==0&&(r=Math.cos(i),n=Math.sin(i));const a=this.center;Eu(Su.set(-.5,-.5,0),ol,a,al,n,r),Eu(Fc.set(.5,-.5,0),ol,a,al,n,r),Eu(wu.set(.5,.5,0),ol,a,al,n,r),cy.set(0,0),ag.set(1,0),hy.set(1,1);let o=e.ray.intersectTriangle(Su,Fc,wu,!1,Bc);if(o===null&&(Eu(Fc.set(-.5,.5,0),ol,a,al,n,r),ag.set(0,1),o=e.ray.intersectTriangle(Su,wu,Fc,!1,Bc),o===null))return;const l=e.ray.origin.distanceTo(Bc);l<e.near||l>e.far||t.push({distance:l,point:Bc.clone(),uv:Ht.getInterpolation(Bc,Su,Fc,wu,cy,ag,hy,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 Eu(s,e,t,i,n,r){ll.subVectors(s,t).addScalar(.5).multiply(i),n!==void 0?(kc.x=r*ll.x-n*ll.y,kc.y=n*ll.x+r*ll.y):kc.copy(ll),s.copy(e),s.x+=kc.x,s.y+=kc.y,s.applyMatrix4(ly)}const Tu=new R,dy=new R;class uy extends Pt{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){Tu.setFromMatrixPosition(this.matrixWorld);const n=e.ray.origin.distanceTo(Tu);this.getObjectForDistance(n).raycast(e,t)}}update(e){const t=this.levels;if(t.length>1){Tu.setFromMatrixPosition(e.matrixWorld),dy.setFromMatrixPosition(this.matrixWorld);const i=Tu.distanceTo(dy)/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 nr=new R,og=new R,Cu=new R,Hr=new R,lg=new R,Au=new R,cg=new R;class Ds{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,nr)),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=nr.subVectors(e,this.origin).dot(this.direction);return t<0?this.origin.distanceToSquared(e):(nr.copy(this.origin).addScaledVector(this.direction,t),nr.distanceToSquared(e))}distanceSqToSegment(e,t,i,n){og.copy(e).add(t).multiplyScalar(.5),Cu.copy(t).sub(e).normalize(),Hr.copy(this.origin).sub(og);const r=e.distanceTo(t)*.5,a=-this.direction.dot(Cu),o=Hr.dot(this.direction),l=-Hr.dot(Cu),c=Hr.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(og).addScaledVector(Cu,p),u}intersectSphere(e,t){nr.subVectors(e.center,this.origin);const i=nr.dot(this.direction),n=nr.dot(nr)-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,nr)!==null}intersectTriangle(e,t,i,n,r){lg.subVectors(t,e),Au.subVectors(i,e),cg.crossVectors(lg,Au);let a=this.direction.dot(cg),o;if(a>0){if(n)return null;o=1}else if(a<0)o=-1,a=-a;else return null;Hr.subVectors(this.origin,e);const l=o*this.direction.dot(Au.crossVectors(Hr,Au));if(l<0)return null;const c=o*this.direction.dot(lg.cross(Hr));if(c<0||l+c>a)return null;const h=-o*Hr.dot(cg);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 Nt 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=mc,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 py=new qe,Ia=new Ds,Pu=new zi,fy=new R,Ru=new R,Lu=new R,Iu=new R,hg=new R,Du=new R,my=new R,Nu=new R;class ct extends Pt{constructor(e=new at,t=new Nt){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){Du.set(0,0,0);for(let l=0,c=r.length;l<c;l++){const h=o[l],d=r[l];h!==0&&(hg.fromBufferAttribute(d,e),a?Du.addScaledVector(hg,h):Du.addScaledVector(hg.sub(t),h))}t.add(Du)}return t}raycast(e,t){const i=this.geometry,n=this.material,r=this.matrixWorld;n!==void 0&&(i.boundingSphere===null&&i.computeBoundingSphere(),Pu.copy(i.boundingSphere),Pu.applyMatrix4(r),Ia.copy(e.ray).recast(e.near),!(Pu.containsPoint(Ia.origin)===!1&&(Ia.intersectSphere(Pu,fy)===null||Ia.origin.distanceToSquared(fy)>(e.far-e.near)**2))&&(py.copy(r).invert(),Ia.copy(e.ray).applyMatrix4(py),!(i.boundingBox!==null&&Ia.intersectsBox(i.boundingBox)===!1)&&this._computeIntersections(e,t,Ia)))}_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],x=Math.max(m.start,u.start),y=Math.min(o.count,Math.min(m.start+m.count,u.start+u.count));for(let _=x,S=y;_<S;_+=3){const b=o.getX(_),E=o.getX(_+1),w=o.getX(_+2);n=Uu(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 x=o.getX(m),y=o.getX(m+1),_=o.getX(m+2);n=Uu(this,a,e,i,c,h,d,x,y,_),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],x=Math.max(m.start,u.start),y=Math.min(l.count,Math.min(m.start+m.count,u.start+u.count));for(let _=x,S=y;_<S;_+=3){const b=_,E=_+1,w=_+2;n=Uu(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 x=m,y=m+1,_=m+2;n=Uu(this,a,e,i,c,h,d,x,y,_),n&&(n.faceIndex=Math.floor(m/3),t.push(n))}}}}function m3(s,e,t,i,n,r,a,o){let l;if(e.side===ki?l=i.intersectTriangle(a,r,n,!0,o):l=i.intersectTriangle(n,r,a,e.side===_n,o),l===null)return null;Nu.copy(o),Nu.applyMatrix4(s.matrixWorld);const c=t.ray.origin.distanceTo(Nu);return c<t.near||c>t.far?null:{distance:c,point:Nu.clone(),object:s}}function Uu(s,e,t,i,n,r,a,o,l,c){s.getVertexPosition(o,Ru),s.getVertexPosition(l,Lu),s.getVertexPosition(c,Iu);const h=m3(s,e,t,i,Ru,Lu,Iu,my);if(h){const d=new R;Ht.getBarycoord(my,Ru,Lu,Iu,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(Ru,Lu,Iu,p.normal),h.face=p,h.barycoord=d}return h}const gy=new R,vy=new At,xy=new At,g3=new R,yy=new qe,Ou=new R,dg=new zi,_y=new qe,ug=new Ds;class pg extends ct{constructor(e,t){super(e,t),this.isSkinnedMesh=!0,this.type="SkinnedMesh",this.bindMode=Am,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 mt),this.boundingBox.makeEmpty();const t=e.getAttribute("position");for(let i=0;i<t.count;i++)this.getVertexPosition(i,Ou),this.boundingBox.expandByPoint(Ou)}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,Ou),this.boundingSphere.expandByPoint(Ou)}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(),dg.copy(this.boundingSphere),dg.applyMatrix4(n),e.ray.intersectsSphere(dg)!==!1&&(_y.copy(n).invert(),ug.copy(e.ray).applyMatrix4(_y),!(this.boundingBox!==null&&ug.intersectsBox(this.boundingBox)===!1)&&this._computeIntersections(e,t,ug)))}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 At,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===Am?this.bindMatrixInverse.copy(this.matrixWorld).invert():this.bindMode===Lx?this.bindMatrixInverse.copy(this.bindMatrix).invert():Ye("SkinnedMesh: Unrecognized bindMode: "+this.bindMode)}applyBoneTransform(e,t){const i=this.skeleton,n=this.geometry;vy.fromBufferAttribute(n.attributes.skinIndex,e),xy.fromBufferAttribute(n.attributes.skinWeight,e),gy.copy(t).applyMatrix4(this.bindMatrix),t.set(0,0,0);for(let r=0;r<4;r++){const a=xy.getComponent(r);if(a!==0){const o=vy.getComponent(r);yy.multiplyMatrices(i.bones[o].matrixWorld,i.boneInverses[o]),t.addScaledVector(g3.copy(gy).applyMatrix4(yy),a)}}return t.applyMatrix4(this.bindMatrixInverse)}}class Bu extends Pt{constructor(){super(),this.isBone=!0,this.type="Bone"}}class Sn extends Qt{constructor(e=null,t=1,i=1,n,r,a,o,l,c=Zt,h=Zt,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 by=new qe,v3=new qe;class Hc{constructor(e=[],t=[]){this.uuid=On(),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:v3;by.multiplyMatrices(o,t[r]),by.toArray(i,r*16)}n!==null&&(n.needsUpdate=!0)}clone(){return new Hc(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 Bu),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 Vr 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 cl=new qe,My=new qe,ku=[],Sy=new mt,x3=new qe,Vc=new ct,Gc=new zi;class ei extends ct{constructor(e,t,i){super(e,t),this.isInstancedMesh=!0,this.instanceMatrix=new Vr(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,x3)}computeBoundingBox(){const e=this.geometry,t=this.count;this.boundingBox===null&&(this.boundingBox=new mt),e.boundingBox===null&&e.computeBoundingBox(),this.boundingBox.makeEmpty();for(let i=0;i<t;i++)this.getMatrixAt(i,cl),Sy.copy(e.boundingBox).applyMatrix4(cl),this.boundingBox.union(Sy)}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,cl),Gc.copy(e.boundingSphere).applyMatrix4(cl),this.boundingSphere.union(Gc)}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(Vc.geometry=this.geometry,Vc.material=this.material,Vc.material!==void 0&&(this.boundingSphere===null&&this.computeBoundingSphere(),Gc.copy(this.boundingSphere),Gc.applyMatrix4(i),e.ray.intersectsSphere(Gc)!==!1))for(let r=0;r<n;r++){this.getMatrixAt(r,cl),My.multiplyMatrices(i,cl),Vc.matrixWorld=My,Vc.raycast(e,ku);for(let a=0,o=ku.length;a<o;a++){const l=ku[a];l.instanceId=r,l.object=this,t.push(l)}ku.length=0}}setColorAt(e,t){this.instanceColor===null&&(this.instanceColor=new Vr(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,vc,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 fg=new R,y3=new R,_3=new ut;class Yt{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=fg.subVectors(i,t).cross(y3.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(fg),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||_3.getNormalMatrix(e),n=this.coplanarPoint(fg).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 Da=new zi,b3=new me(.5,.5),Fu=new R;class hl{constructor(e=new Yt,t=new Yt,i=new Yt,n=new Yt,r=new Yt,a=new Yt){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=Un,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],x=r[12],y=r[13],_=r[14],S=r[15];if(n[0].setComponents(c-a,u-h,f-v,S-x).normalize(),n[1].setComponents(c+a,u+h,f+v,S+x).normalize(),n[2].setComponents(c+o,u+d,f+g,S+y).normalize(),n[3].setComponents(c-o,u-d,f-g,S-y).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===Un)n[5].setComponents(c+l,u+p,f+m,S+_).normalize();else if(t===Ca)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(),Da.copy(e.boundingSphere).applyMatrix4(e.matrixWorld);else{const t=e.geometry;t.boundingSphere===null&&t.computeBoundingSphere(),Da.copy(t.boundingSphere).applyMatrix4(e.matrixWorld)}return this.intersectsSphere(Da)}intersectsSprite(e){Da.center.set(0,0,0);const t=b3.distanceTo(e.center);return Da.radius=.7071067811865476+t,Da.applyMatrix4(e.matrixWorld),this.intersectsSphere(Da)}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(Fu.x=n.normal.x>0?e.max.x:e.min.x,Fu.y=n.normal.y>0?e.max.y:e.min.y,Fu.z=n.normal.z>0?e.max.z:e.min.z,n.distanceToPoint(Fu)<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 Ns=new qe,Us=new hl;class zu{constructor(){this.coordinateSystem=Un}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(Ns.multiplyMatrices(n.projectionMatrix,n.matrixWorldInverse),Us.setFromProjectionMatrix(Ns,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(Ns.multiplyMatrices(n.projectionMatrix,n.matrixWorldInverse),Us.setFromProjectionMatrix(Ns,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(Ns.multiplyMatrices(n.projectionMatrix,n.matrixWorldInverse),Us.setFromProjectionMatrix(Ns,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(Ns.multiplyMatrices(n.projectionMatrix,n.matrixWorldInverse),Us.setFromProjectionMatrix(Ns,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(Ns.multiplyMatrices(n.projectionMatrix,n.matrixWorldInverse),Us.setFromProjectionMatrix(Ns,n.coordinateSystem,n.reversedDepth),Us.containsPoint(e))return!0}return!1}clone(){return new zu}}function mg(s,e){return s-e}function M3(s,e){return s.z-e.z}function S3(s,e){return e.z-s.z}class w3{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,E3=new We(1,1,1),wy=new hl,T3=new zu,Hu=new mt,Na=new zi,Wc=new R,Ey=new R,C3=new R,gg=new w3,tn=new ct,Vu=[];function A3(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 Ty extends ct{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,xc,qn);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 mt);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,Hu).applyMatrix4(wn),e.union(Hu)}}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,Na).applyMatrix4(wn),e.union(Na)}}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(mg),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&&(E3.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(mg),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);A3(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 mt,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(Wc.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,Hu),Hu.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)),Wc.fromBufferAttribute(o,d),l=Math.max(l,r.center.distanceToSquared(Wc))}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(mg);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 mt),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,Vu);for(let d=0,p=Vu.length;d<p;d++){const u=Vu[d];u.object=this,u.batchId=o,t.push(u)}Vu.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?T3:wy;u&&!i.isArrayCamera&&(wn.multiplyMatrices(i.projectionMatrix,i.matrixWorldInverse).multiply(this.matrixWorld),wy.setFromProjectionMatrix(wn,i.coordinateSystem,i.reversedDepth));let f=0;if(this.sortObjects){wn.copy(this.matrixWorld).invert(),Wc.setFromMatrixPosition(i.matrixWorld).applyMatrix4(wn),Ey.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,Na).applyMatrix4(wn);let E=!1;if(u&&(E=!m.intersectsSphere(Na,i)),!E){const w=p[b],M=C3.subVectors(Na.center,Wc).dot(Ey);gg.push(w.start,w.count,M,_)}}const x=gg.list,y=this.customSort;y===null?x.sort(r.transparent?S3:M3):y.call(this,x,i);for(let _=0,S=x.length;_<S;_++){const b=x[_];h[f]=b.start*o*l,d[f]=b.count*l,g[f]=b.index,f++}gg.reset()}else for(let x=0,y=c.length;x<y;x++)if(c[x].visible&&c[x].active){const _=c[x].geometryIndex;let S=!1;if(u&&(this.getMatrixAt(x,wn),this.getBoundingSphereAt(_,Na).applyMatrix4(wn),S=!m.intersectsSphere(Na,i)),!S){const b=p[_];h[f]=b.start*o*l,d[f]=b.count*l,g[f]=x,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 ni 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 Gu=new R,Wu=new R,Cy=new qe,Xc=new Ds,Xu=new zi,vg=new R,Ay=new R;class pn extends Pt{constructor(e=new at,t=new ni){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++)Gu.fromBufferAttribute(t,n-1),Wu.fromBufferAttribute(t,n),i[n]=i[n-1],i[n]+=Gu.distanceTo(Wu);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(),Xu.copy(i.boundingSphere),Xu.applyMatrix4(n),Xu.radius+=r,e.ray.intersectsSphere(Xu)===!1)return;Cy.copy(n).invert(),Xc.copy(e.ray).applyMatrix4(Cy);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),x=h.getX(g+1),y=ju(this,e,Xc,l,f,x,g);y&&t.push(y)}if(this.isLineLoop){const g=h.getX(v-1),m=h.getX(u),f=ju(this,e,Xc,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=ju(this,e,Xc,l,g,g+1,g);f&&t.push(f)}if(this.isLineLoop){const g=ju(this,e,Xc,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 ju(s,e,t,i,n,r,a){const o=s.geometry.attributes.position;if(Gu.fromBufferAttribute(o,n),Wu.fromBufferAttribute(o,r),t.distanceSqToSegment(Gu,Wu,vg,Ay)>i)return;vg.applyMatrix4(s.matrixWorld);const c=e.ray.origin.distanceTo(vg);if(!(c<e.near||c>e.far))return{distance:c,point:Ay.clone().applyMatrix4(s.matrixWorld),index:a,face:null,faceIndex:null,barycoord:null,object:s}}const Py=new R,Ry=new R;class pi 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)Py.fromBufferAttribute(t,n),Ry.fromBufferAttribute(t,n+1),i[n]=n===0?0:i[n-1],i[n+1]=i[n]+Py.distanceTo(Ry);e.setAttribute("lineDistance",new et(i,1))}else Ye("LineSegments.computeLineDistances(): Computation only possible with non-indexed BufferGeometry.");return this}}class xg extends pn{constructor(e,t){super(e,t),this.isLineLoop=!0,this.type="LineLoop"}}class qu 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 Ly=new qe,yg=new Ds,Zu=new zi,Yu=new R;class $u extends Pt{constructor(e=new at,t=new qu){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(),Zu.copy(i.boundingSphere),Zu.applyMatrix4(n),Zu.radius+=r,e.ray.intersectsSphere(Zu)===!1)return;Ly.copy(n).invert(),yg.copy(e.ray).applyMatrix4(Ly);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);Yu.fromBufferAttribute(d,m),Iy(Yu,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++)Yu.fromBufferAttribute(d,v),Iy(Yu,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 Iy(s,e,t,i,n,r,a){const o=yg.distanceSqToPoint(s);if(o<t){const l=new R;yg.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 Dy extends Qt{constructor(e,t,i,n,r=Ct,a=Ct,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 P3 extends Dy{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 R3 extends Qt{constructor(e,t){super({width:e,height:t}),this.isFramebufferTexture=!0,this.magFilter=Zt,this.minFilter=Zt,this.generateMipmaps=!1,this.needsUpdate=!0}}class Ku extends Qt{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 L3 extends Ku{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 I3 extends Ku{constructor(e,t,i){super(void 0,e[0].width,e[0].height,t,i,Rs),this.isCompressedCubeTexture=!0,this.isCubeTexture=!0,this.image=e}}class jc extends Qt{constructor(e=[],t=Rs,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 Ny extends Qt{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 Gr extends Qt{constructor(e,t,i=qn,n,r,a,o=Zt,l=Zt,c,h=Ls,d=1){if(h!==Ls&&h!==Is)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 Ur(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 Uy extends Gr{constructor(e,t=qn,i=Rs,n,r,a=Zt,o=Zt,l,c=Ls){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 _g extends Qt{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,x,y,_,S,b,E,w,M){const C=_/E,L=S/w,P=_/2,U=S/2,A=b/2,k=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-U;for(let $=0;$<k;$++){const _e=$*C-P;G[g]=_e*x,G[m]=Y*y,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+k*re,_e=p+Y+k*(re+1),Ee=p+(Y+1)+k*(re+1),be=p+(Y+1)+k*re;l.push($,_e,be),l.push(_e,Ee,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 Ju 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 x=0;x<=v;x++){let y=0,_=0,S=0,b=0;if(x<=i){const M=x/i,C=M*Math.PI/2;_=-h-e*Math.cos(C),S=e*Math.sin(C),b=-e*Math.cos(C),y=M*d}else if(x<=i+r){const M=(x-i)/r;_=-h+M*t,S=e,b=0,y=d+M*p}else{const M=(x-i-r)/i,C=M*Math.PI/2;_=h+e*Math.sin(C),S=e*Math.cos(C),b=e*Math.sin(C),y=d+p+M*d}const E=Math.max(0,Math.min(1,y/u));let w=0;x===0?w=.5/n:x===v&&(w=-.5/n);for(let M=0;M<=n;M++){const C=M/n,L=C*Math.PI*2,P=Math.sin(L),U=Math.cos(L);f.x=-S*U,f.y=_,f.z=S*P,o.push(f.x,f.y,f.z),m.set(-S*U,b,S*P),m.normalize(),l.push(m.x,m.y,m.z),c.push(C+w,E)}if(x>0){const M=(x-1)*g;for(let C=0;C<n;C++){const L=M+C,P=M+C+1,U=x*g+C,A=x*g+C+1;a.push(L,P,U),a.push(P,A,U)}}}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 Ju(e.radius,e.height,e.capSegments,e.radialSegments,e.heightSegments)}}class Qu 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 Qu(e.radius,e.segments,e.thetaStart,e.thetaLength)}}class qc 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;x(),a===!1&&(e>0&&y(!0),t>0&&y(!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 x(){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 U=P/n,A=U*l+o,k=Math.sin(A),F=Math.cos(A);S.x=L*k,S.y=-C*i+m,S.z=L*F,d.push(S.x,S.y,S.z),_.set(k,E,F).normalize(),p.push(_.x,_.y,_.z),u.push(U,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],U=g[M][w+1];(e>0||M!==0)&&(h.push(C,L,U),b+=3),(t>0||M!==r-1)&&(h.push(L,P,U),b+=3)}c.addGroup(f,b,0),f+=b}function y(_){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,k=Math.cos(A),F=Math.sin(A);E.x=M*F,E.y=m*C,E.z=M*k,d.push(E.x,E.y,E.z),p.push(0,C,0),b.x=k*.5+.5,b.y=F*.5*C+.5,u.push(b.x,b.y),v++}for(let P=0;P<n;P++){const U=S+P,A=L+P;_===!0?h.push(A,A+1,U):h.push(A+1,A,U),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 qc(e.radiusTop,e.radiusBottom,e.height,e.radialSegments,e.heightSegments,e.openEnded,e.thetaStart,e.thetaLength)}}class Zc extends qc{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 Zc(e.radius,e.height,e.radialSegments,e.heightSegments,e.openEnded,e.thetaStart,e.thetaLength)}}class Wr 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(x){const y=new R,_=new R,S=new R;for(let b=0;b<t.length;b+=3)u(t[b+0],y),u(t[b+1],_),u(t[b+2],S),l(y,_,S,x)}function l(x,y,_,S){const b=S+1,E=[];for(let w=0;w<=b;w++){E[w]=[];const M=x.clone().lerp(_,w/b),C=y.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(x){const y=new R;for(let _=0;_<r.length;_+=3)y.x=r[_+0],y.y=r[_+1],y.z=r[_+2],y.normalize().multiplyScalar(x),r[_+0]=y.x,r[_+1]=y.y,r[_+2]=y.z}function h(){const x=new R;for(let y=0;y<r.length;y+=3){x.x=r[y+0],x.y=r[y+1],x.z=r[y+2];const _=m(x)/2/Math.PI+.5,S=f(x)/Math.PI+.5;a.push(_,1-S)}v(),d()}function d(){for(let x=0;x<a.length;x+=6){const y=a[x+0],_=a[x+2],S=a[x+4],b=Math.max(y,_,S),E=Math.min(y,_,S);b>.9&&E<.1&&(y<.2&&(a[x+0]+=1),_<.2&&(a[x+2]+=1),S<.2&&(a[x+4]+=1))}}function p(x){r.push(x.x,x.y,x.z)}function u(x,y){const _=x*3;y.x=e[_+0],y.y=e[_+1],y.z=e[_+2]}function v(){const x=new R,y=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){x.set(r[M+0],r[M+1],r[M+2]),y.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(x).add(y).add(_).divideScalar(3);const L=m(S);g(b,C+0,x,L),g(E,C+2,y,L),g(w,C+4,_,L)}}function g(x,y,_,S){S<0&&x.x===1&&(a[y]=x.x-1),_.x===0&&_.z===0&&(a[y]=S/2/Math.PI+.5)}function m(x){return Math.atan2(x.z,-x.x)}function f(x){return Math.atan2(-x.y,Math.sqrt(x.x*x.x+x.z*x.z))}}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}static fromJSON(e){return new Wr(e.vertices,e.indices,e.radius,e.detail)}}class ep extends Wr{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 ep(e.radius,e.detail)}}const tp=new R,ip=new R,bg=new R,np=new Ht;class Oy 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(Aa*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}=np;if(g.fromBufferAttribute(o,c[0]),m.fromBufferAttribute(o,c[1]),f.fromBufferAttribute(o,c[2]),np.getNormal(bg),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 x=0;x<3;x++){const y=(x+1)%3,_=d[x],S=d[y],b=np[h[x]],E=np[h[y]],w=`${_}_${S}`,M=`${S}_${_}`;M in p&&p[M]?(bg.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[x],index1:c[y],normal:bg.clone()})}}for(const v in p)if(p[v]){const{index0:g,index1:m}=p[v];tp.fromBufferAttribute(o,g),ip.fromBufferAttribute(o,m),u.push(tp.x,tp.y,tp.z),u.push(ip.x,ip.y,ip.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(ht(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(ht(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 Yc 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 By extends Yc{constructor(e,t,i,n,r,a){super(e,t,i,i,n,r,a),this.isArcCurve=!0,this.type="ArcCurve"}}function Mg(){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 sp=new R,Sg=new Mg,wg=new Mg,Eg=new Mg;class ky 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]:(sp.subVectors(n[0],n[1]).add(n[0]),c=sp);const d=n[o%r],p=n[(o+1)%r];if(this.closed||o+2<r?h=n[(o+2)%r]:(sp.subVectors(n[r-1],n[r-2]).add(n[r-1]),h=sp),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),Sg.initNonuniformCatmullRom(c.x,d.x,p.x,h.x,v,g,m),wg.initNonuniformCatmullRom(c.y,d.y,p.y,h.y,v,g,m),Eg.initNonuniformCatmullRom(c.z,d.z,p.z,h.z,v,g,m)}else this.curveType==="catmullrom"&&(Sg.initCatmullRom(c.x,d.x,p.x,h.x,this.tension),wg.initCatmullRom(c.y,d.y,p.y,h.y,this.tension),Eg.initCatmullRom(c.z,d.z,p.z,h.z,this.tension));return i.set(Sg.calc(l),wg.calc(l),Eg.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 Fy(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 D3(s,e){const t=1-s;return t*t*e}function N3(s,e){return 2*(1-s)*s*e}function U3(s,e){return s*s*e}function $c(s,e,t,i){return D3(s,e)+N3(s,t)+U3(s,i)}function O3(s,e){const t=1-s;return t*t*t*e}function B3(s,e){const t=1-s;return 3*t*t*s*e}function k3(s,e){return 3*(1-s)*s*s*e}function F3(s,e){return s*s*s*e}function Kc(s,e,t,i,n){return O3(s,e)+B3(s,t)+k3(s,i)+F3(s,n)}class Tg 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(Kc(e,n.x,r.x,a.x,o.x),Kc(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 zy 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(Kc(e,n.x,r.x,a.x,o.x),Kc(e,n.y,r.y,a.y,o.y),Kc(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 Cg 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 Hy 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 Ag 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($c(e,n.x,r.x,a.x),$c(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 Pg 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($c(e,n.x,r.x,a.x),$c(e,n.y,r.y,a.y),$c(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 Rg 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(Fy(o,l.x,c.x,h.x,d.x),Fy(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 rp=Object.freeze({__proto__:null,ArcCurve:By,CatmullRomCurve3:ky,CubicBezierCurve:Tg,CubicBezierCurve3:zy,EllipseCurve:Yc,LineCurve:Cg,LineCurve3:Hy,QuadraticBezierCurve:Ag,QuadraticBezierCurve3:Pg,SplineCurve:Rg});class Vy 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 rp[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 rp[n.type]().fromJSON(n))}return this}}class Jc extends Vy{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 Cg(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 Ag(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 Tg(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 Rg(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 Yc(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 sr extends Jc{constructor(e){super(e),this.uuid=On(),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 Jc().fromJSON(n))}return this}}function z3(s,e,t=2){const i=e&&e.length,n=i?e[0]*t:s.length;let r=Gy(s,0,n,t,!0);const a=[];if(!r||r.next===r.prev)return a;let o,l,c;if(i&&(r=X3(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 Qc(r,a,t,o,l,c,0),a}function Gy(s,e,t,i,n){let r;if(n===iT(s,e,t,i)>0)for(let a=e;a<t;a+=i)r=qy(a/i|0,s[a],s[a+1],r);else for(let a=t-i;a>=e;a-=i)r=qy(a/i|0,s[a],s[a+1],r);return r&&dl(r,r.next)&&(ih(r),r=r.next),r}function Oa(s,e){if(!s)return s;e||(e=s);let t=s,i;do if(i=!1,!t.steiner&&(dl(t,t.next)||si(t.prev,t,t.next)===0)){if(ih(t),t=e=t.prev,t===t.next)break;i=!0}else t=t.next;while(i||t!==e);return e}function Qc(s,e,t,i,n,r,a){if(!s)return;!a&&r&&$3(s,i,n,r);let o=s;for(;s.prev!==s.next;){const l=s.prev,c=s.next;if(r?V3(s,i,n,r):H3(s)){e.push(l.i,s.i,c.i),ih(s),s=c.next,o=c.next;continue}if(s=c,s===o){a?a===1?(s=G3(Oa(s),e),Qc(s,e,t,i,n,r,2)):a===2&&W3(s,e,t,i,n,r):Qc(Oa(s),e,t,i,n,r,1);break}}}function H3(s){const e=s.prev,t=s,i=s.next;if(si(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&&eh(n,o,r,l,a,c,v.x,v.y)&&si(v.prev,v,v.next)>=0)return!1;v=v.next}return!0}function V3(s,e,t,i){const n=s.prev,r=s,a=s.next;if(si(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=Lg(u,v,e,t,i),x=Lg(g,m,e,t,i);let y=s.prevZ,_=s.nextZ;for(;y&&y.z>=f&&_&&_.z<=x;){if(y.x>=u&&y.x<=g&&y.y>=v&&y.y<=m&&y!==n&&y!==a&&eh(o,h,l,d,c,p,y.x,y.y)&&si(y.prev,y,y.next)>=0||(y=y.prevZ,_.x>=u&&_.x<=g&&_.y>=v&&_.y<=m&&_!==n&&_!==a&&eh(o,h,l,d,c,p,_.x,_.y)&&si(_.prev,_,_.next)>=0))return!1;_=_.nextZ}for(;y&&y.z>=f;){if(y.x>=u&&y.x<=g&&y.y>=v&&y.y<=m&&y!==n&&y!==a&&eh(o,h,l,d,c,p,y.x,y.y)&&si(y.prev,y,y.next)>=0)return!1;y=y.prevZ}for(;_&&_.z<=x;){if(_.x>=u&&_.x<=g&&_.y>=v&&_.y<=m&&_!==n&&_!==a&&eh(o,h,l,d,c,p,_.x,_.y)&&si(_.prev,_,_.next)>=0)return!1;_=_.nextZ}return!0}function G3(s,e){let t=s;do{const i=t.prev,n=t.next.next;!dl(i,n)&&Xy(i,t,t.next,n)&&th(i,n)&&th(n,i)&&(e.push(i.i,t.i,n.i),ih(t),ih(t.next),t=s=n),t=t.next}while(t!==s);return Oa(t)}function W3(s,e,t,i,n,r){let a=s;do{let o=a.next.next;for(;o!==a.prev;){if(a.i!==o.i&&Q3(a,o)){let l=jy(a,o);a=Oa(a,a.next),l=Oa(l,l.next),Qc(a,e,t,i,n,r,0),Qc(l,e,t,i,n,r,0);return}o=o.next}a=a.next}while(a!==s)}function X3(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=Gy(s,o,l,i,!1);c===c.next&&(c.steiner=!0),n.push(J3(c))}n.sort(j3);for(let r=0;r<n.length;r++)t=q3(n[r],t);return t}function j3(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 q3(s,e){const t=Z3(s,e);if(!t)return e;const i=jy(t,s);return Oa(i,i.next),Oa(t,t.next)}function Z3(s,e){let t=e;const i=s.x,n=s.y;let r=-1/0,a;if(dl(s,t))return t;do{if(dl(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&&Wy(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);th(t,s)&&(d<h||d===h&&(t.x>a.x||t.x===a.x&&Y3(a,t)))&&(a=t,h=d)}t=t.next}while(t!==o);return a}function Y3(s,e){return si(s.prev,s,e.prev)<0&&si(e.next,s,s.next)<0}function $3(s,e,t,i){let n=s;do n.z===0&&(n.z=Lg(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,K3(n)}function K3(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 Lg(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 J3(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 Wy(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 eh(s,e,t,i,n,r,a,o){return!(s===a&&e===o)&&Wy(s,e,t,i,n,r,a,o)}function Q3(s,e){return s.next.i!==e.i&&s.prev.i!==e.i&&!eT(s,e)&&(th(s,e)&&th(e,s)&&tT(s,e)&&(si(s.prev,s,e.prev)||si(s,e.prev,e))||dl(s,e)&&si(s.prev,s,s.next)>0&&si(e.prev,e,e.next)>0)}function si(s,e,t){return(e.y-s.y)*(t.x-e.x)-(e.x-s.x)*(t.y-e.y)}function dl(s,e){return s.x===e.x&&s.y===e.y}function Xy(s,e,t,i){const n=op(si(s,e,t)),r=op(si(s,e,i)),a=op(si(t,i,s)),o=op(si(t,i,e));return!!(n!==r&&a!==o||n===0&&ap(s,t,e)||r===0&&ap(s,i,e)||a===0&&ap(t,s,i)||o===0&&ap(t,e,i))}function ap(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 op(s){return s>0?1:s<0?-1:0}function eT(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&&Xy(t,t.next,s,e))return!0;t=t.next}while(t!==s);return!1}function th(s,e){return si(s.prev,s,s.next)<0?si(s,e,s.next)>=0&&si(s,s.prev,e)>=0:si(s,e,s.prev)<0||si(s,s.next,e)<0}function tT(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 jy(s,e){const t=Ig(s.i,s.x,s.y),i=Ig(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 qy(s,e,t,i){const n=Ig(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 ih(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 Ig(s,e,t){return{i:s,x:e,y:t,prev:null,next:null,z:0,prevZ:null,nextZ:null,steiner:!1}}function iT(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 nT{static triangulate(e,t,i=2){return z3(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=[];Zy(e),Yy(i,e);let a=e.length;t.forEach(Zy);for(let l=0;l<t.length;l++)n.push(a),a+=t[l].length,Yy(i,t[l]);const o=nT.triangulate(i,n);for(let l=0;l<o.length;l+=3)r.push(o.slice(l,l+3));return r}}function Zy(s){const e=s.length;e>2&&s[e-1].equals(s[0])&&s.pop()}function Yy(s,e){for(let t=0;t<e.length;t++)s.push(e[t].x),s.push(e[t].y)}class ul extends at{constructor(e=new sr([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,x=t.UVGenerator!==void 0?t.UVGenerator:sT;let y,_=!1,S,b,E,w;if(f){y=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 U(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)),B=Q*T*T;if(I<=B){D.splice(te,1),N--;continue}W=de}}U(C),L.forEach(U);const A=L.length,k=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,B=de*I-V*ee;if(Math.abs(B)>Number.EPSILON){const j=Math.sqrt(T),K=Math.sqrt(ee*ee+I*I),Z=ae.x-V/j,Ae=ae.y+de/j,ve=Q.x-I/K,Ne=Q.y+ee/K,ke=((ve-Z)*I-(Ne-Ae)*ee)/(de*I-V*ee);W=Z+de*ke-D.x,N=Ae+V*ke-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=k.length,Q=ae-1,W=D+1;D<ae;D++,Q++,W++)Q===ae&&(Q=0),W===ae&&(W=0),G[D]=q(k[D],k[Q],k[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(k,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=k.length;de<V;de++){const ee=F(k[de],G[de],te);Pe(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,B=ee.length;T<B;T++){const j=F(ee[T],Y[T],te);Pe(j.x,j.y,-N),W===0&&I.push(j)}W===0&&ae.push(I)}}_e=gs.triangulateShape(D,ae)}const Ee=_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(y[0]).add(E).add(b),Pe(w.x,w.y,w.z)):Pe(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(y[D]).add(E).add(b),Pe(w.x,w.y,w.z)):Pe(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=k.length;N<te;N++){const de=F(k[N],G[N],W);Pe(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);_?Pe(I.x,I.y+y[h-1].y,y[h-1].x+Q):Pe(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<Ee;W++){const N=_e[W];Re(N[2]+Q,N[1]+Q,N[0]+Q)}ae=h+m*2,Q=H*ae;for(let W=0;W<Ee;W++){const N=_e[W];Re(N[0]+Q,N[1]+Q,N[2]+Q)}}else{for(let ae=0;ae<Ee;ae++){const Q=_e[ae];Re(Q[2],Q[1],Q[0])}for(let ae=0;ae<Ee;ae++){const Q=_e[ae];Re(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(k,ae),ae+=k.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,B=ae+N+ee,j=ae+W+ee;Oe(I,T,B,j)}}}function Pe(D,ae,Q){l.push(D),l.push(ae),l.push(Q)}function Re(D,ae,Q){tt(D),tt(ae),tt(Q);const W=n.length/3,N=x.generateTopUV(i,n,W-3,W-2,W-1);je(N[0]),je(N[1]),je(N[2])}function Oe(D,ae,Q,W){tt(D),tt(ae),tt(W),tt(ae),tt(Q),tt(W);const N=n.length/3,te=x.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 rT(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 rp[n.type]().fromJSON(n)),new ul(i,e.options)}}const sT={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 rT(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 lp extends Wr{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 lp(e.radius,e.detail)}}class cp 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=ht(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 x=0;x<=e.length-1;x++)switch(x){case 0:m=e[x+1].x-e[x].x,f=e[x+1].y-e[x].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[x+1].x-e[x].x,f=e[x+1].y-e[x].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 x=0;x<=t;x++){const y=i+x*h*n,_=Math.sin(y),S=Math.cos(y);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=x/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 x=0;x<t;x++)for(let y=0;y<e.length-1;y++){const _=y+x*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 cp(e.points,e.segments,e.phiStart,e.phiLength)}}class nh extends Wr{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 nh(e.radius,e.detail)}}class Yn 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 x=f*p-a;for(let y=0;y<c;y++){const _=y*d-r;v.push(_,-x,0),g.push(0,0,1),m.push(y/o),m.push(1-f/l)}}for(let f=0;f<l;f++)for(let x=0;x<o;x++){const y=x+c*f,_=x+c*(f+1),S=x+1+c*(f+1),b=x+1+c*f;u.push(y,_,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 Yn(e.width,e.height,e.widthSegments,e.heightSegments)}}class hp 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 x=f+m,y=x,_=x+i+1,S=x+i+2,b=x+1;o.push(y,_,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 hp(e.innerRadius,e.outerRadius,e.thetaSegments,e.phiSegments,e.thetaStart,e.thetaLength)}}class sh extends at{constructor(e=new sr([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 x=v[m];gs.isClockWise(x)===!0&&(v[m]=x.reverse())}const g=gs.triangulateShape(u,v);for(let m=0,f=v.length;m<f;m++){const x=v[m];u=u.concat(x)}for(let m=0,f=u.length;m<f;m++){const x=u[m];n.push(x.x,x.y,0),r.push(0,0,1),a.push(x.x,x.y)}for(let m=0,f=g.length;m<f;m++){const x=g[m],y=x[0]+d,_=x[1]+d,S=x[2]+d;i.push(y,_,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 aT(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 sh(i,e.curveSegments)}}function aT(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 Ba 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 x=[],y=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+y*o),d.y=e*Math.cos(a+y*o),d.z=e*Math.sin(n+b*r)*Math.sin(a+y*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-y),x.push(c++)}h.push(x)}for(let f=0;f<i;f++)for(let x=0;x<t;x++){const y=h[f][x+1],_=h[f][x],S=h[f+1][x],b=h[f+1][x+1];(f!==0||a>0)&&u.push(y,_,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 Ba(e.radius,e.widthSegments,e.heightSegments,e.phiStart,e.phiLength,e.thetaStart,e.thetaLength)}}class dp extends Wr{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 dp(e.radius,e.detail)}}class up 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 x=f/n*r;u.x=(e+t*Math.cos(m))*Math.cos(x),u.y=(e+t*Math.cos(m))*Math.sin(x),u.z=t*Math.sin(m),c.push(u.x,u.y,u.z),p.x=e*Math.cos(x),p.y=e*Math.sin(x),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,x=(n+1)*(g-1)+m-1,y=(n+1)*(g-1)+m,_=(n+1)*g+m;l.push(f,x,_),l.push(x,y,_)}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 up(e.radius,e.tube,e.radialSegments,e.tubularSegments,e.arc)}}class pp 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 y=0;y<=i;++y){const _=y/i*r*Math.PI*2;x(_,r,a,e,u),x(_+.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(y/i),h.push(S/n)}}for(let y=1;y<=i;y++)for(let _=1;_<=n;_++){const S=(n+1)*(y-1)+(_-1),b=(n+1)*y+(_-1),E=(n+1)*y+_,w=(n+1)*(y-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 x(y,_,S,b,E){const w=Math.cos(y),M=Math.sin(y),C=S/_*y,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 pp(e.radius,e.tube,e.tubularSegments,e.radialSegments,e.p,e.q)}}class fp extends at{constructor(e=new Pg(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 y=0;y<t;y++)m(y);m(r===!1?t:0),x(),f()}function m(y){h=e.getPointAt(y/t,h);const _=a.normals[y],S=a.binormals[y];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 y=1;y<=t;y++)for(let _=1;_<=n;_++){const S=(n+1)*(y-1)+(_-1),b=(n+1)*y+(_-1),E=(n+1)*y+_,w=(n+1)*(y-1)+_;v.push(S,b,w),v.push(b,E,w)}}function x(){for(let y=0;y<=t;y++)for(let _=0;_<=n;_++)c.x=y/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 fp(new rp[e.path.type]().fromJSON(e.path),e.tubularSegments,e.radius,e.radialSegments,e.closed)}}class $y 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),x=o.getX(v+(m+1)%3);n.fromBufferAttribute(a,f),r.fromBufferAttribute(a,x),Ky(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),Ky(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 Ky(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 Jy=Object.freeze({__proto__:null,BoxGeometry:fs,CapsuleGeometry:Ju,CircleGeometry:Qu,ConeGeometry:Zc,CylinderGeometry:qc,DodecahedronGeometry:ep,EdgesGeometry:Oy,ExtrudeGeometry:ul,IcosahedronGeometry:lp,LatheGeometry:cp,OctahedronGeometry:nh,PlaneGeometry:Yn,PolyhedronGeometry:Wr,RingGeometry:hp,ShapeGeometry:sh,SphereGeometry:Ba,TetrahedronGeometry:dp,TorusGeometry:up,TorusKnotGeometry:pp,TubeGeometry:fp,WireframeGeometry:$y});class Qy 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 pl(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=pl(s[t]);for(const n in i)e[n]=i[n]}return e}function oT(s){const e=[];for(let t=0;t<s.length;t++)e.push(s[t].clone());return e}function e_(s){const e=s.getRenderTarget();return e===null?s.outputColorSpace:e.isXRRenderTarget===!0?e.texture.colorSpace:wt.workingColorSpace}const nn={clone:pl,merge:fn};var lT=`void main() {
|
|
3
3
|
gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );
|
|
4
4
|
}`,cT=`void main() {
|
|
@@ -9794,7 +9794,7 @@ ${JSON.stringify(l,null,2)}
|
|
|
9794
9794
|
<span class="bim-ai-qa-answer">${this.escapeHtml(i||"")}</span>
|
|
9795
9795
|
</div>
|
|
9796
9796
|
</div>
|
|
9797
|
-
`}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 Y9{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 Z9({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 $9{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 ax{eventEmitter=new $9;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;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}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 K9{container;wrapper=null;sizeEl=null;resizeObserver=null;lastSyncedWidth=-1;lastSyncedHeight=-1;registry;toolbar=null;constructTreeBtn=null;buttonGroup=null;dialog=null;engine=null;rightKey=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 ax,t?.locale&&Ai.setLocale(t.locale),t?.theme&&(t.theme==="custom"?console.warn("Custom theme should be set via setCustomTheme()."):bt.setTheme(t.theme)),this.init()}emit(e,t){this.registry.emit(e,t)}on(e,t){return this.registry.on(e,t)}setLocale(e){Ai.setLocale(e)}getLocale(){return Ai.getLocale()}setTheme(e){bt.setTheme(e)}setCustomTheme(e){bt.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.4.4",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 y9(this.wrapper,this.registry),this.dialog=new Ow(this.wrapper,this.registry),this.toolbar=new Dw(this.wrapper,this.registry),this.buttonGroup=new Nw(this.wrapper,this.registry),this.rightKey=new gw(this.wrapper,this.registry),this.constructTreeBtn=new T9(this.wrapper,this.registry),this.measure=new A9(this.registry),this.sectionPlane=new R9(this.registry),this.sectionAxis=new I9(this.registry),this.sectionBox=new N9(this.registry),this.walkControl=new k9(this.registry),this.walkControl.init(),this.engineInfo=new F9(this.registry),this.engineInfo.init(),this.registry.engine3d=this.engine,this.registry.dialog=this.dialog,this.registry.toolbar=this.toolbar,this.registry.buttonGroup=this.buttonGroup,this.registry.rightKey=this.rightKey,this.registry.constructTree=this.constructTreeBtn,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 q9(this.registry),this.registry.componentDetail=this.componentDetail,this.componentDetail.init(),this.aiChat=new Y9(this.registry),this.registry.aiChat=this.aiChat,this.aiChat.init(),this.setting=new W9(this.registry),this.registry.setting=this.setting,this.setting.init(),this.updateTheme(bt.getTheme()),bt.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.toolbar?.destroy(),this.buttonGroup?.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 J9{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=g9(e),!this.engine)throw new Error("Failed to create 2D engine instance");this._isInitialized=!0,this.unsubscribeTheme=bt.subscribe(t=>{this.setTheme(t)}),this.setTheme(bt.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 Q9{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 ax,t?.locale&&Ai.setLocale(t.locale),t?.theme&&t.theme!=="custom"&&bt.setTheme(t.theme),this.engineComponent=new J9({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){bt.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 ez{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=v9(e),!this.engine)throw new Error("Failed to create 720 engine instance");this._isInitialized=!0,this.unsubscribeTheme=bt.subscribe(t=>{this.setTheme(t)}),this.setTheme(bt.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 tz{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 ax,t?.locale&&Ai.setLocale(t.locale),t?.theme&&t.theme!=="custom"&&bt.setTheme(t.theme),this.engineComponent=new ez({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){bt.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 iz=Object.freeze(Object.defineProperty({__proto__:null,createHomeButton:s=>({id:"home",groupId:"group-1",type:"button",label:"toolbar.home",icon:Lt("主视角"),keepActive:!1,onClick:e=>{console.log("首页按钮被点击:",e.id),s.engine3d?.getEngineComponent()?.CameraGoHome()}})},Symbol.toStringTag,{value:"Module"})),nz=Object.freeze(Object.defineProperty({__proto__:null,createZoomBoxButton:s=>({id:"zoom-box",groupId:"group-1",keepActive:!1,type:"button",label:"toolbar.zoomBox",icon:Lt("框选放大"),onClick:()=>{s.engine3d?.getEngineComponent()?.activateZoomBox()}})},Symbol.toStringTag,{value:"Module"})),sz=Object.freeze(Object.defineProperty({__proto__:null,createWalkMenuButton:s=>({id:"walk",groupId:"group-1",type:"button",label:"toolbar.walk",align:"vertical",icon:Lt("漫游"),onClick:()=>{console.log("漫游按钮被点击"),s.walkControl?.show()}})},Symbol.toStringTag,{value:"Module"})),rz=Object.freeze(Object.defineProperty({__proto__:null,createMapButton:s=>({id:"map",groupId:"group-1",type:"button",label:"toolbar.map",align:"vertical",keepActive:!0,icon:Lt("地图"),onClick:()=>{s.engine3d?.getEngineComponent()?.toggleMiniMap();const e=s.engine3d?.getEngineComponent()?.getMiniMapState()??!1;s.walkControl?.panel?.setPlanViewActive(e)}})},Symbol.toStringTag,{value:"Module"})),az=Object.freeze(Object.defineProperty({__proto__:null,createPropertyButton:s=>({id:"property",groupId:"group-1",type:"button",label:"toolbar.property",align:"vertical",icon:Lt("文档"),onClick:()=>{console.log("构件详情按钮被点击"),s.componentDetail?.show()}})},Symbol.toStringTag,{value:"Module"})),oz=Object.freeze(Object.defineProperty({__proto__:null,createSettingButton:s=>({id:"setting",groupId:"group-2",type:"button",label:"toolbar.setting",icon:Lt("设置"),keepActive:!1,onClick:e=>{s?.setting?.toggle()}})},Symbol.toStringTag,{value:"Module"})),lz=Object.freeze(Object.defineProperty({__proto__:null,createInfoButton:s=>({id:"info",groupId:"group-2",type:"button",label:"toolbar.info",icon:Lt("信息"),keepActive:!1,onClick:()=>{s.engineInfo?.show()}})},Symbol.toStringTag,{value:"Module"})),cz=Object.freeze(Object.defineProperty({__proto__:null,createFullscreenButton:s=>({id:"fullscreen",groupId:"group-2",type:"button",label:"toolbar.fullscreen",align:"vertical",icon:Lt("全屏"),onClick:async()=>{console.log("全屏按钮被点击"),window.self!==window.top&&console.warn('检测到在 Iframe 中运行,请确保父级 iframe 标签拥有 allow="fullscreen" 属性');try{const t=document,n=!!(t.fullscreenElement||t.webkitFullscreenElement||t.mozFullScreenElement||t.msFullscreenElement);console.log("当前是否全屏:",n);const a=document.querySelector(".bim-engine-container")||document.body,o=a;if(n){console.log("准备退出全屏...");const l=t.exitFullscreen||t.webkitExitFullscreen||t.mozCancelFullScreen||t.msExitFullscreen;l&&(await l.call(t),console.log("退出全屏请求已发送"))}else{console.log("准备进入全屏..."),(a.style.backgroundColor===""||a.style.backgroundColor==="transparent")&&(a.style.backgroundColor="#ffffff");const l=o.requestFullscreen||o.webkitRequestFullscreen||o.mozRequestFullScreen||o.msRequestFullscreen;l?(await l.call(o,{navigationUI:"hide"}),console.log("全屏请求已发送")):(console.warn("当前浏览器不支持全屏 API"),alert("当前浏览器不支持全屏功能"))}}catch(t){console.error("全屏操作失败:",t),t&&t.message&&t.message.includes("denied")&&console.error('全屏请求被拒绝。如果是 Iframe,请检查 allow="fullscreen"。如果是自动触发,请确保由用户点击触发。')}}})},Symbol.toStringTag,{value:"Module"})),hz=Object.freeze(Object.defineProperty({__proto__:null,createMeasureButton:s=>({id:"measure",groupId:"group-1",type:"button",label:"toolbar.measure",icon:Lt("测量"),keepActive:!0,onClick:e=>{e.isActive?s.measure?.show():s.measure?.destroy()}})},Symbol.toStringTag,{value:"Module"})),dz=Object.freeze(Object.defineProperty({__proto__:null,createSectionMenuButton:s=>({id:"section",groupId:"group-1",type:"menu",label:"toolbar.section",align:"vertical",icon:Lt("剖切"),keepActive:!0,onClick:e=>{console.log("剖切按钮被点击:",e.id)}})},Symbol.toStringTag,{value:"Module"})),uz=Object.freeze(Object.defineProperty({__proto__:null,createSectionPlaneButton:s=>({id:"section-plane",groupId:"group-1",parentId:"section",type:"button",keepActive:!0,exclusive:!0,align:"vertical",label:"toolbar.sectionPlane",icon:Lt("拾曲面剖切"),onClick:e=>{console.log("拾取面剖切被点击:",e.id,"激活状态:",e.isActive),e.isActive?s.sectionPlane?.show():s.sectionPlane?.hide()}})},Symbol.toStringTag,{value:"Module"})),pz=Object.freeze(Object.defineProperty({__proto__:null,createSectionAxisButton:s=>({id:"section-axis",groupId:"group-1",parentId:"section",type:"button",keepActive:!0,exclusive:!0,align:"vertical",label:"toolbar.sectionAxis",icon:Lt("轴向剖切"),onClick:e=>{e.isActive?s.sectionAxis?.show():s.sectionAxis?.destroy()}})},Symbol.toStringTag,{value:"Module"})),fz=Object.freeze(Object.defineProperty({__proto__:null,createSectionBoxButton:s=>({id:"section-box",groupId:"group-1",parentId:"section",type:"button",keepActive:!0,exclusive:!0,align:"vertical",label:"toolbar.sectionBox",icon:Lt("剖切盒"),onClick:e=>{console.log("剖切盒被点击:",e.id,"激活状态:",e.isActive),e.isActive?s.sectionBox?.show():s.sectionBox?.hide()}})},Symbol.toStringTag,{value:"Module"})),mz=Object.freeze(Object.defineProperty({__proto__:null,createAiChatButton:s=>(s.on("aiChat:opened",()=>{s.toolbar?.setBtnActive("aiChat",!0)}),s.on("aiChat:closed",()=>{s.toolbar?.setBtnActive("aiChat",!1)}),{id:"aiChat",groupId:"group-2",type:"button",label:"aiChat.title",align:"vertical",keepActive:!0,icon:Lt("bot"),onClick:()=>{s.aiChat?.toggle()}})},Symbol.toStringTag,{value:"Module"})),gz=Object.freeze(Object.defineProperty({__proto__:null,createCameraSwitchButton:s=>({id:"camera-switch",groupId:"group-1",type:"button",label:"toolbar.cameraSwitch",icon:Lt("透视相机"),keepActive:!1,onClick:()=>{const e=s.engine3d?.getEngineComponent();if(!e)return;e.switchCamera();const t=e.getCameraType(),i=Lt(t==="orthographic"?"正交相机":"透视相机");s.toolbar?.updateButtonIcon("camera-switch",i)}})},Symbol.toStringTag,{value:"Module"})),vz=Object.freeze(Object.defineProperty({__proto__:null,default:`# BIM引擎AI助手 - 需求分析与步骤规划专家\r
|
|
9797
|
+
`}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 Y9{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 Z9({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 $9{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 ax{eventEmitter=new $9;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;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}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 K9{container;wrapper=null;sizeEl=null;resizeObserver=null;lastSyncedWidth=-1;lastSyncedHeight=-1;registry;toolbar=null;constructTreeBtn=null;buttonGroup=null;dialog=null;engine=null;rightKey=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 ax,t?.locale&&Ai.setLocale(t.locale),t?.theme&&(t.theme==="custom"?console.warn("Custom theme should be set via setCustomTheme()."):bt.setTheme(t.theme)),this.init()}emit(e,t){this.registry.emit(e,t)}on(e,t){return this.registry.on(e,t)}setLocale(e){Ai.setLocale(e)}getLocale(){return Ai.getLocale()}setTheme(e){bt.setTheme(e)}setCustomTheme(e){bt.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.4.5",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 y9(this.wrapper,this.registry),this.dialog=new Ow(this.wrapper,this.registry),this.toolbar=new Dw(this.wrapper,this.registry),this.buttonGroup=new Nw(this.wrapper,this.registry),this.rightKey=new gw(this.wrapper,this.registry),this.constructTreeBtn=new T9(this.wrapper,this.registry),this.measure=new A9(this.registry),this.sectionPlane=new R9(this.registry),this.sectionAxis=new I9(this.registry),this.sectionBox=new N9(this.registry),this.walkControl=new k9(this.registry),this.walkControl.init(),this.engineInfo=new F9(this.registry),this.engineInfo.init(),this.registry.engine3d=this.engine,this.registry.dialog=this.dialog,this.registry.toolbar=this.toolbar,this.registry.buttonGroup=this.buttonGroup,this.registry.rightKey=this.rightKey,this.registry.constructTree=this.constructTreeBtn,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 q9(this.registry),this.registry.componentDetail=this.componentDetail,this.componentDetail.init(),this.aiChat=new Y9(this.registry),this.registry.aiChat=this.aiChat,this.aiChat.init(),this.setting=new W9(this.registry),this.registry.setting=this.setting,this.setting.init(),this.updateTheme(bt.getTheme()),bt.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.toolbar?.destroy(),this.buttonGroup?.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 J9{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=g9(e),!this.engine)throw new Error("Failed to create 2D engine instance");this._isInitialized=!0,this.unsubscribeTheme=bt.subscribe(t=>{this.setTheme(t)}),this.setTheme(bt.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 Q9{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 ax,t?.locale&&Ai.setLocale(t.locale),t?.theme&&t.theme!=="custom"&&bt.setTheme(t.theme),this.engineComponent=new J9({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){bt.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 ez{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=v9(e),!this.engine)throw new Error("Failed to create 720 engine instance");this._isInitialized=!0,this.unsubscribeTheme=bt.subscribe(t=>{this.setTheme(t)}),this.setTheme(bt.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 tz{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 ax,t?.locale&&Ai.setLocale(t.locale),t?.theme&&t.theme!=="custom"&&bt.setTheme(t.theme),this.engineComponent=new ez({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){bt.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 iz=Object.freeze(Object.defineProperty({__proto__:null,createHomeButton:s=>({id:"home",groupId:"group-1",type:"button",label:"toolbar.home",icon:Lt("主视角"),keepActive:!1,onClick:e=>{console.log("首页按钮被点击:",e.id),s.engine3d?.getEngineComponent()?.CameraGoHome()}})},Symbol.toStringTag,{value:"Module"})),nz=Object.freeze(Object.defineProperty({__proto__:null,createZoomBoxButton:s=>({id:"zoom-box",groupId:"group-1",keepActive:!1,type:"button",label:"toolbar.zoomBox",icon:Lt("框选放大"),onClick:()=>{s.engine3d?.getEngineComponent()?.activateZoomBox()}})},Symbol.toStringTag,{value:"Module"})),sz=Object.freeze(Object.defineProperty({__proto__:null,createWalkMenuButton:s=>({id:"walk",groupId:"group-1",type:"button",label:"toolbar.walk",align:"vertical",icon:Lt("漫游"),onClick:()=>{console.log("漫游按钮被点击"),s.walkControl?.show()}})},Symbol.toStringTag,{value:"Module"})),rz=Object.freeze(Object.defineProperty({__proto__:null,createMapButton:s=>({id:"map",groupId:"group-1",type:"button",label:"toolbar.map",align:"vertical",keepActive:!0,icon:Lt("地图"),onClick:()=>{s.engine3d?.getEngineComponent()?.toggleMiniMap();const e=s.engine3d?.getEngineComponent()?.getMiniMapState()??!1;s.walkControl?.panel?.setPlanViewActive(e)}})},Symbol.toStringTag,{value:"Module"})),az=Object.freeze(Object.defineProperty({__proto__:null,createPropertyButton:s=>({id:"property",groupId:"group-1",type:"button",label:"toolbar.property",align:"vertical",icon:Lt("文档"),onClick:()=>{console.log("构件详情按钮被点击"),s.componentDetail?.show()}})},Symbol.toStringTag,{value:"Module"})),oz=Object.freeze(Object.defineProperty({__proto__:null,createSettingButton:s=>({id:"setting",groupId:"group-2",type:"button",label:"toolbar.setting",icon:Lt("设置"),keepActive:!1,onClick:e=>{s?.setting?.toggle()}})},Symbol.toStringTag,{value:"Module"})),lz=Object.freeze(Object.defineProperty({__proto__:null,createInfoButton:s=>({id:"info",groupId:"group-2",type:"button",label:"toolbar.info",icon:Lt("信息"),keepActive:!1,onClick:()=>{s.engineInfo?.show()}})},Symbol.toStringTag,{value:"Module"})),cz=Object.freeze(Object.defineProperty({__proto__:null,createFullscreenButton:s=>({id:"fullscreen",groupId:"group-2",type:"button",label:"toolbar.fullscreen",align:"vertical",icon:Lt("全屏"),onClick:async()=>{console.log("全屏按钮被点击"),window.self!==window.top&&console.warn('检测到在 Iframe 中运行,请确保父级 iframe 标签拥有 allow="fullscreen" 属性');try{const t=document,n=!!(t.fullscreenElement||t.webkitFullscreenElement||t.mozFullScreenElement||t.msFullscreenElement);console.log("当前是否全屏:",n);const a=document.querySelector(".bim-engine-container")||document.body,o=a;if(n){console.log("准备退出全屏...");const l=t.exitFullscreen||t.webkitExitFullscreen||t.mozCancelFullScreen||t.msExitFullscreen;l&&(await l.call(t),console.log("退出全屏请求已发送"))}else{console.log("准备进入全屏..."),(a.style.backgroundColor===""||a.style.backgroundColor==="transparent")&&(a.style.backgroundColor="#ffffff");const l=o.requestFullscreen||o.webkitRequestFullscreen||o.mozRequestFullScreen||o.msRequestFullscreen;l?(await l.call(o,{navigationUI:"hide"}),console.log("全屏请求已发送")):(console.warn("当前浏览器不支持全屏 API"),alert("当前浏览器不支持全屏功能"))}}catch(t){console.error("全屏操作失败:",t),t&&t.message&&t.message.includes("denied")&&console.error('全屏请求被拒绝。如果是 Iframe,请检查 allow="fullscreen"。如果是自动触发,请确保由用户点击触发。')}}})},Symbol.toStringTag,{value:"Module"})),hz=Object.freeze(Object.defineProperty({__proto__:null,createMeasureButton:s=>({id:"measure",groupId:"group-1",type:"button",label:"toolbar.measure",icon:Lt("测量"),keepActive:!0,onClick:e=>{e.isActive?s.measure?.show():s.measure?.destroy()}})},Symbol.toStringTag,{value:"Module"})),dz=Object.freeze(Object.defineProperty({__proto__:null,createSectionMenuButton:s=>({id:"section",groupId:"group-1",type:"menu",label:"toolbar.section",align:"vertical",icon:Lt("剖切"),keepActive:!0,onClick:e=>{console.log("剖切按钮被点击:",e.id)}})},Symbol.toStringTag,{value:"Module"})),uz=Object.freeze(Object.defineProperty({__proto__:null,createSectionPlaneButton:s=>({id:"section-plane",groupId:"group-1",parentId:"section",type:"button",keepActive:!0,exclusive:!0,align:"vertical",label:"toolbar.sectionPlane",icon:Lt("拾曲面剖切"),onClick:e=>{console.log("拾取面剖切被点击:",e.id,"激活状态:",e.isActive),e.isActive?s.sectionPlane?.show():s.sectionPlane?.hide()}})},Symbol.toStringTag,{value:"Module"})),pz=Object.freeze(Object.defineProperty({__proto__:null,createSectionAxisButton:s=>({id:"section-axis",groupId:"group-1",parentId:"section",type:"button",keepActive:!0,exclusive:!0,align:"vertical",label:"toolbar.sectionAxis",icon:Lt("轴向剖切"),onClick:e=>{e.isActive?s.sectionAxis?.show():s.sectionAxis?.destroy()}})},Symbol.toStringTag,{value:"Module"})),fz=Object.freeze(Object.defineProperty({__proto__:null,createSectionBoxButton:s=>({id:"section-box",groupId:"group-1",parentId:"section",type:"button",keepActive:!0,exclusive:!0,align:"vertical",label:"toolbar.sectionBox",icon:Lt("剖切盒"),onClick:e=>{console.log("剖切盒被点击:",e.id,"激活状态:",e.isActive),e.isActive?s.sectionBox?.show():s.sectionBox?.hide()}})},Symbol.toStringTag,{value:"Module"})),mz=Object.freeze(Object.defineProperty({__proto__:null,createAiChatButton:s=>(s.on("aiChat:opened",()=>{s.toolbar?.setBtnActive("aiChat",!0)}),s.on("aiChat:closed",()=>{s.toolbar?.setBtnActive("aiChat",!1)}),{id:"aiChat",groupId:"group-2",type:"button",label:"aiChat.title",align:"vertical",keepActive:!0,icon:Lt("bot"),onClick:()=>{s.aiChat?.toggle()}})},Symbol.toStringTag,{value:"Module"})),gz=Object.freeze(Object.defineProperty({__proto__:null,createCameraSwitchButton:s=>({id:"camera-switch",groupId:"group-1",type:"button",label:"toolbar.cameraSwitch",icon:Lt("透视相机"),keepActive:!1,onClick:()=>{const e=s.engine3d?.getEngineComponent();if(!e)return;e.switchCamera();const t=e.getCameraType(),i=Lt(t==="orthographic"?"正交相机":"透视相机");s.toolbar?.updateButtonIcon("camera-switch",i)}})},Symbol.toStringTag,{value:"Module"})),vz=Object.freeze(Object.defineProperty({__proto__:null,default:`# BIM引擎AI助手 - 需求分析与步骤规划专家\r
|
|
9798
9798
|
\r
|
|
9799
9799
|
## 角色定位\r
|
|
9800
9800
|
\r
|