@vertexvis/viewer-toolkit-react 0.0.6-canary.11 → 0.0.6-canary.13

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,4 +1,4 @@
1
- import{jsx as e,jsxs as t,Fragment as n}from"react/jsx-runtime";import a from"quick-format-unescaped";import{useRecoilCallback as i,atom as o,selector as r,useRecoilValue as s,useRecoilState as l,useSetRecoilState as c,selectorFamily as d,atomFamily as u,DefaultValue as m,useRecoilValueLoadable as p,useRecoilStateLoadable as h,RecoilRoot as f}from"recoil";import{BoundingBox as g,Vector3 as v,Angle as b,Point as w,Euler as C,Matrix4 as S}from"@vertexvis/geometry";import*as k from"react";import A,{useEffect as T,useCallback as P,useRef as M,useState as E,useMemo as I}from"react";import{VertexColorPicker as N,VertexSlider as V,VertexRadioGroup as O,VertexRadio as L,VertexToggle as _,VertexTooltip as R,VertexIconButton as D,VertexDialog as B,VertexButton as j,VertexColorSwatch as H,VertexIcon as F,VertexDropdownMenu as U,VertexMenuItem as W,VertexResizable as G,VertexMenu as K,VertexMenuDivider as $,VertexDraggablePopover as q,VertexBanner as Y,VertexToast as X,VertexPopover as Z,VertexTextfield as J,VertexSelect as Q,VertexSpinner as ee}from"@vertexvis/ui-react";import{toWorldTransform as te,toLocalTransform as ne,toMatrix as ae,toRadiansTransform as ie,ColorMaterial as oe}from"@vertexvis/viewer";import{VertexViewerMeasurementDetails as re,VertexViewerMeasurementDistance as se,VertexViewerMeasurementPrecise as le,VertexSceneTreeSearch as ce,VertexSceneTreeToolbar as de,VertexSceneTreeNotificationBanner as ue,VertexSceneTreeTableColumn as me,VertexSceneTreeTableLayout as pe,VertexSceneTree as he,VertexViewerToolbarGroup as fe,VertexViewerToolbar as ge,VertexViewerTransformWidget as ye,VertexViewerBoxQueryTool as ve,VertexViewerViewCube as be,VertexViewer as we}from"@vertexvis/viewer-react";import Ce from"prop-types";import{defineCustomElements as Se}from"@vertexvis/ui/loader";import{defineCustomElements as xe}from"@vertexvis/viewer/loader";var extendStatics=function(e,t){return extendStatics=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},extendStatics(e,t)};function __extends(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function __(){this.constructor=e}extendStatics(e,t),e.prototype=null===t?Object.create(t):(__.prototype=t.prototype,new __)}var __assign=function(){return __assign=Object.assign||function __assign(e){for(var t,n=1,a=arguments.length;n<a;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},__assign.apply(this,arguments)};function __read(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var a=n.call(e),i,o=[],r;try{for(;(void 0===t||t-- >0)&&!(i=a.next()).done;)o.push(i.value)}catch(e){r={error:e}}finally{try{i&&!i.done&&(n=a.return)&&n.call(a)}finally{if(r)throw r.error}}return o}"function"==typeof SuppressedError&&SuppressedError;var ke=/rgb\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)/,Ae=/rgba\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*,\s*(.+)\s*\)/,Te=/^(#|0x)?([A-Fa-f0-9]{6})$/,create$2=function(e,t,n,a){return void 0===a&&(a=255),{r:e,g:t,b:n,a:a}},fromNumber=function(e){var t=16777215&e;return create$2(t>>16&255,t>>8&255,255&t)},fromHexString=function(e){var t=Te.exec(e);if(null!=t)return fromNumber(parseInt(t[2],16))},fromCss=function(e){var t=ke.exec(e);if(null!=t)return create$2(parseInt(t[1]),parseInt(t[2]),parseInt(t[3]));var n=Ae.exec(e);return null!=n?create$2(parseInt(n[1]),parseInt(n[2]),parseInt(n[3]),Math.floor(255*parseFloat(n[4]))):Te.test(e)?fromHexString(e):void 0},fromArray=function(e){return create$2(e[0],e[1],e[2],e[3])},isInvisible=function(e){return 0===e.a},isOpaque=function(e){return 255===e.a},toHexString=function(e){return"#".concat(componentToHex(e.r)).concat(componentToHex(e.g)).concat(componentToHex(e.b))},componentToHex=function(e){var t=e.toString(16);return 1===t.length?"0"+t:t},Pe=Object.freeze({__proto__:null,create:create$2,fromNumber:fromNumber,fromHexString:fromHexString,fromCss:fromCss,fromArray:fromArray,isInvisible:isInvisible,isOpaque:isOpaque,toHexString:toHexString});!function(e){function MapperValidationError(t){var n=e.call(this,"Validation error mapping object.")||this;return n.errors=t,Object.setPrototypeOf(n,MapperValidationError.prototype),n}__extends(MapperValidationError,e)}(Error);var Me=function equal(e,t){if(e===t)return!0;if(e&&t&&"object"==typeof e&&"object"==typeof t){if(e.constructor!==t.constructor)return!1;var n,a,i;if(Array.isArray(e)){if((n=e.length)!=t.length)return!1;for(a=n;0!=a--;)if(!equal(e[a],t[a]))return!1;return!0}if(e.constructor===RegExp)return e.source===t.source&&e.flags===t.flags;if(e.valueOf!==Object.prototype.valueOf)return e.valueOf()===t.valueOf();if(e.toString!==Object.prototype.toString)return e.toString()===t.toString();if((n=(i=Object.keys(e)).length)!==Object.keys(t).length)return!1;for(a=n;0!=a--;)if(!Object.prototype.hasOwnProperty.call(t,i[a]))return!1;for(a=n;0!=a--;){var o=i[a];if(!equal(e[o],t[o]))return!1}return!0}return e!=e&&t!=t};
1
+ import{jsx as e,jsxs as t,Fragment as n}from"react/jsx-runtime";import a from"quick-format-unescaped";import{useRecoilCallback as i,atom as o,selector as r,useRecoilValue as s,atomFamily as l,useSetRecoilState as c,selectorFamily as d,DefaultValue as u,useRecoilValueLoadable as m,useRecoilStateLoadable as p,useRecoilState as h,RecoilRoot as f}from"recoil";import{BoundingBox as g,Vector3 as v,Point as b,Euler as w,Matrix4 as C,Angle as S}from"@vertexvis/geometry";import*as k from"react";import A,{useEffect as T,useCallback as P,useRef as M,useState as E,useMemo as I}from"react";import{toWorldTransform as N,toLocalTransform as O,toMatrix as V,toRadiansTransform as L,ColorMaterial as _}from"@vertexvis/viewer";import{VertexColorPicker as R,VertexSlider as D,VertexRadioGroup as B,VertexRadio as H,VertexToggle as j,VertexTooltip as F,VertexIconButton as W,VertexDialog as U,VertexButton as G,VertexColorSwatch as K,VertexIcon as $,VertexDropdownMenu as q,VertexMenuItem as Y,VertexResizable as X,VertexMenu as Z,VertexMenuDivider as J,VertexDraggablePopover as Q,VertexBanner as ee,VertexToast as te,VertexPopover as ne,VertexTextfield as ae,VertexSelect as ie,VertexSpinner as oe}from"@vertexvis/ui-react";import{VertexViewerMeasurementDetails as re,VertexViewerMeasurementDistance as se,VertexViewerMeasurementPrecise as le,VertexSceneTreeSearch as ce,VertexSceneTreeToolbar as de,VertexSceneTreeNotificationBanner as ue,VertexSceneTreeTableColumn as me,VertexSceneTreeTableLayout as pe,VertexSceneTree as he,VertexViewerToolbarGroup as fe,VertexViewerToolbar as ge,VertexViewerTransformWidget as ye,VertexViewerBoxQueryTool as ve,VertexViewerViewCube as be,VertexViewer as we}from"@vertexvis/viewer-react";import Ce from"prop-types";import{defineCustomElements as Se}from"@vertexvis/ui/loader";import{defineCustomElements as xe}from"@vertexvis/viewer/loader";var extendStatics=function(e,t){return extendStatics=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},extendStatics(e,t)};function __extends(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function __(){this.constructor=e}extendStatics(e,t),e.prototype=null===t?Object.create(t):(__.prototype=t.prototype,new __)}var __assign=function(){return __assign=Object.assign||function __assign(e){for(var t,n=1,a=arguments.length;n<a;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},__assign.apply(this,arguments)};function __read(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var a=n.call(e),i,o=[],r;try{for(;(void 0===t||t-- >0)&&!(i=a.next()).done;)o.push(i.value)}catch(e){r={error:e}}finally{try{i&&!i.done&&(n=a.return)&&n.call(a)}finally{if(r)throw r.error}}return o}"function"==typeof SuppressedError&&SuppressedError;var ke=/rgb\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)/,Ae=/rgba\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*,\s*(.+)\s*\)/,Te=/^(#|0x)?([A-Fa-f0-9]{6})$/,create$2=function(e,t,n,a){return void 0===a&&(a=255),{r:e,g:t,b:n,a:a}},fromNumber=function(e){var t=16777215&e;return create$2(t>>16&255,t>>8&255,255&t)},fromHexString=function(e){var t=Te.exec(e);if(null!=t)return fromNumber(parseInt(t[2],16))},fromCss=function(e){var t=ke.exec(e);if(null!=t)return create$2(parseInt(t[1]),parseInt(t[2]),parseInt(t[3]));var n=Ae.exec(e);return null!=n?create$2(parseInt(n[1]),parseInt(n[2]),parseInt(n[3]),Math.floor(255*parseFloat(n[4]))):Te.test(e)?fromHexString(e):void 0},fromArray=function(e){return create$2(e[0],e[1],e[2],e[3])},isInvisible=function(e){return 0===e.a},isOpaque=function(e){return 255===e.a},toHexString=function(e){return"#".concat(componentToHex(e.r)).concat(componentToHex(e.g)).concat(componentToHex(e.b))},componentToHex=function(e){var t=e.toString(16);return 1===t.length?"0"+t:t},Pe=Object.freeze({__proto__:null,create:create$2,fromNumber:fromNumber,fromHexString:fromHexString,fromCss:fromCss,fromArray:fromArray,isInvisible:isInvisible,isOpaque:isOpaque,toHexString:toHexString});!function(e){function MapperValidationError(t){var n=e.call(this,"Validation error mapping object.")||this;return n.errors=t,Object.setPrototypeOf(n,MapperValidationError.prototype),n}__extends(MapperValidationError,e)}(Error);var Me=function equal(e,t){if(e===t)return!0;if(e&&t&&"object"==typeof e&&"object"==typeof t){if(e.constructor!==t.constructor)return!1;var n,a,i;if(Array.isArray(e)){if((n=e.length)!=t.length)return!1;for(a=n;0!=a--;)if(!equal(e[a],t[a]))return!1;return!0}if(e.constructor===RegExp)return e.source===t.source&&e.flags===t.flags;if(e.valueOf!==Object.prototype.valueOf)return e.valueOf()===t.valueOf();if(e.toString!==Object.prototype.toString)return e.toString()===t.toString();if((n=(i=Object.keys(e)).length)!==Object.keys(t).length)return!1;for(a=n;0!=a--;)if(!Object.prototype.hasOwnProperty.call(t,i[a]))return!1;for(a=n;0!=a--;){var o=i[a];if(!equal(e[o],t[o]))return!1}return!0}return e!=e&&t!=t};
2
2
  /*!
3
3
  * isobject <https://github.com/jonschlinkert/isobject>
4
4
  *
@@ -10,10 +10,10 @@ import{jsx as e,jsxs as t,Fragment as n}from"react/jsx-runtime";import a from"qu
10
10
  *
11
11
  * Copyright (c) 2014-2017, Jon Schlinkert.
12
12
  * Released under the MIT License.
13
- */function isObjectObject(e){return!0===isObject(e)&&"[object Object]"===Object.prototype.toString.call(e)}function isPlainObject$1(e){var t,n;return!1!==isObjectObject(e)&&("function"==typeof(t=e.constructor)&&(!1!==isObjectObject(n=t.prototype)&&!1!==n.hasOwnProperty("isPrototypeOf")))}function defaults(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var n=__read(e),a=n[0],i=n.slice(1),o=__assign({},a);if(0===i.length)return o;if(1===i.length){var r=i[0];for(var s in r)null==o[s]?o[s]=r[s]:isPlainObject(o[s])&&(o[s]=defaults(o[s],r[s]));return o}return i.reduce((function(e,t){return defaults(e,t)}),a)}function isPlainObject(e){return isPlainObject$1(e)}function isEqual$1(e,t){return Me(e,t)}function toPairs(e){return null!=e?Object.keys(e).map((function(t){return[t,e[t]]})):[]}function fromPairs(e){return Array.isArray(e)?e.reduce((function(e,t){var n;return null!=t?__assign(__assign({},e),((n={})[t[0]]=t[1],n)):e}),{}):{}}var Ee=Object.freeze({__proto__:null,defaults:defaults,isPlainObject:isPlainObject,isEqual:isEqual$1,toPairs:toPairs,fromPairs:fromPairs}),Ie,Ne=new Uint8Array(16);function rng(){if(!Ie&&!(Ie="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||"undefined"!=typeof msCrypto&&"function"==typeof msCrypto.getRandomValues&&msCrypto.getRandomValues.bind(msCrypto)))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return Ie(Ne)}var Ve=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i;function validate(e){return"string"==typeof e&&Ve.test(e)}for(var Oe=[],Le=0;Le<256;++Le)Oe.push((Le+256).toString(16).substr(1));function stringify(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=(Oe[e[t+0]]+Oe[e[t+1]]+Oe[e[t+2]]+Oe[e[t+3]]+"-"+Oe[e[t+4]]+Oe[e[t+5]]+"-"+Oe[e[t+6]]+Oe[e[t+7]]+"-"+Oe[e[t+8]]+Oe[e[t+9]]+"-"+Oe[e[t+10]]+Oe[e[t+11]]+Oe[e[t+12]]+Oe[e[t+13]]+Oe[e[t+14]]+Oe[e[t+15]]).toLowerCase();if(!validate(n))throw TypeError("Stringified UUID is invalid");return n}function v4(e,t,n){var a=(e=e||{}).random||(e.rng||rng)();return a[6]=15&a[6]|64,a[8]=63&a[8]|128,stringify(a)}function create$1(){return v4()}function fromMsbLsb(e,t){function digits(e,t){var n=BigInt(1)<<t*BigInt(4);return(n|e&n-BigInt(1)).toString(16).substring(1)}var n="string"==typeof e?BigInt(e):e,a="string"==typeof t?BigInt(t):t,i=digits(n>>BigInt(32),BigInt(8)),o=digits(n>>BigInt(16),BigInt(4)),r=digits(n,BigInt(4)),s=digits(a>>BigInt(48),BigInt(4)),l=digits(a,BigInt(12));return"".concat(i,"-").concat(o,"-").concat(r,"-").concat(s,"-").concat(l)}function toMsbLsb(e){var t=__read(e.split("-"),5),n=t[0],a=t[1],i=t[2],o=t[3],r=t[4];if(null==n||null==a||null==i||null==o||null==r)throw new Error("Invalid UUID string ".concat(e));var s=BigInt.asIntN(64,BigInt("0x".concat(n+a+i))),l=BigInt.asIntN(64,BigInt("0x".concat(o+r)));return{msb:s.toString(),lsb:l.toString()}}var _e=Object.freeze({__proto__:null,create:create$1,fromMsbLsb:fromMsbLsb,toMsbLsb:toMsbLsb}),Re={exports:{}};const De=a;Re.exports=pino;const ze=pfGlobalThisOrFallback().console||{},Be={mapHttpRequest:mock,mapHttpResponse:mock,wrapRequestSerializer:passthrough,wrapResponseSerializer:passthrough,wrapErrorSerializer:passthrough,req:mock,res:mock,err:asErrValue,errWithCause:asErrValue};function levelToValue(e,t){return"silent"===e?1/0:t.levels.values[e]}const je=Symbol("pino.logFuncs"),He=Symbol("pino.hierarchy"),Fe={error:"log",fatal:"error",warn:"error",info:"log",debug:"log",trace:"log"};function appendChildLogger(e,t){const n={logger:t,parent:e[He]};t[He]=n}function setupBaseLogFunctions(e,t,n){const a={};t.forEach((e=>{a[e]=n[e]?n[e]:ze[e]||ze[Fe[e]||"log"]||noop})),e[je]=a}function shouldSerialize(e,t){if(Array.isArray(e)){const t=undefined;return e.filter((function(e){return"!stdSerializers.err"!==e}))}return!0===e&&Object.keys(t)}function pino(e){(e=e||{}).browser=e.browser||{};const t=e.browser.transmit;if(t&&"function"!=typeof t.send)throw Error("pino: transmit option must have a send function");const n=e.browser.write||ze;e.browser.write&&(e.browser.asObject=!0);const a=e.serializers||{},i=shouldSerialize(e.browser.serialize,a);let o=e.browser.serialize;Array.isArray(e.browser.serialize)&&e.browser.serialize.indexOf("!stdSerializers.err")>-1&&(o=!1);const r=Object.keys(e.customLevels||{}),s=["error","fatal","warn","info","debug","trace"].concat(r);"function"==typeof n&&s.forEach((function(e){n[e]=n})),(!1===e.enabled||e.browser.disabled)&&(e.level="silent");const l=e.level||"info",c=Object.create(n);c.log||(c.log=noop),setupBaseLogFunctions(c,s,n),appendChildLogger({},c),Object.defineProperty(c,"levelVal",{get:getLevelVal}),Object.defineProperty(c,"level",{get:getLevel,set:setLevel});const d={transmit:t,serialize:i,asObject:e.browser.asObject,asObjectBindingsOnly:e.browser.asObjectBindingsOnly,formatters:e.browser.formatters,levels:s,timestamp:getTimeFunction(e),messageKey:e.messageKey||"msg",onChild:e.onChild||noop};function getLevelVal(){return levelToValue(this.level,this)}function getLevel(){return this._level}function setLevel(e){if("silent"!==e&&!this.levels.values[e])throw Error("unknown level "+e);this._level=e,set(this,d,c,"error"),set(this,d,c,"fatal"),set(this,d,c,"warn"),set(this,d,c,"info"),set(this,d,c,"debug"),set(this,d,c,"trace"),r.forEach((e=>{set(this,d,c,e)}))}function child(n,o,r){if(!o)throw new Error("missing bindings for child Pino");r=r||{},i&&o.serializers&&(r.serializers=o.serializers);const s=r.serializers;if(i&&s){var l=Object.assign({},a,s),c=!0===e.browser.serialize?Object.keys(l):i;delete o.serializers,applySerializers([o],c,l,this._stdErrSerialize)}function Child(e){this._childLevel=1+(0|e._childLevel),this.bindings=o,l&&(this.serializers=l,this._serialize=c),t&&(this._logEvent=createLogEventShape([].concat(e._logEvent.bindings,o)))}Child.prototype=this;const d=new Child(this);return appendChildLogger(this,d),d.child=function(...e){return child.call(this,n,...e)},d.level=r.level||this.level,n.onChild(d),d}return c.levels=getLevels(e),c.level=l,c.isLevelEnabled=function(e){return!!this.levels.values[e]&&this.levels.values[e]>=this.levels.values[this.level]},c.setMaxListeners=c.getMaxListeners=c.emit=c.addListener=c.on=c.prependListener=c.once=c.prependOnceListener=c.removeListener=c.removeAllListeners=c.listeners=c.listenerCount=c.eventNames=c.write=c.flush=noop,c.serializers=a,c._serialize=i,c._stdErrSerialize=o,c.child=function(...e){return child.call(this,d,...e)},t&&(c._logEvent=createLogEventShape()),c}function getLevels(e){const t=e.customLevels||{},n=undefined,a=undefined;return{values:Object.assign({},pino.levels.values,t),labels:Object.assign({},pino.levels.labels,invertObject(t))}}function invertObject(e){const t={};return Object.keys(e).forEach((function(n){t[e[n]]=n})),t}function getBindingChain(e){const t=[];e.bindings&&t.push(e.bindings);let n=e[He];for(;n.parent;)n=n.parent,n.logger.bindings&&t.push(n.logger.bindings);return t.reverse()}function set(e,t,n,a){if(Object.defineProperty(e,a,{value:levelToValue(e.level,n)>levelToValue(a,n)?noop:n[je][a],writable:!0,enumerable:!0,configurable:!0}),e[a]===noop){if(!t.transmit)return;const i=undefined,o=levelToValue(t.transmit.level||e.level,n),r=undefined;if(levelToValue(a,n)<o)return}e[a]=createWrap(e,t,n,a);const i=getBindingChain(e);0!==i.length&&(e[a]=prependBindingsInArguments(i,e[a]))}function prependBindingsInArguments(e,t){return function(){return t.apply(this,[...e,...arguments])}}function createWrap(e,t,n,a){return i=e[je][a],function LOG(){const o=t.timestamp(),r=new Array(arguments.length),s=Object.getPrototypeOf&&Object.getPrototypeOf(this)===ze?ze:this;for(var l=0;l<r.length;l++)r[l]=arguments[l];var c=!1;if(t.serialize&&(applySerializers(r,this._serialize,this.serializers,this._stdErrSerialize),c=!0),t.asObject||t.formatters?i.call(s,...asObject(this,a,r,o,t)):i.apply(s,r),t.transmit){const i=void 0,s=levelToValue(t.transmit.level||e._level,n),l=levelToValue(a,n);if(l<s)return;transmit(this,{ts:o,methodLevel:a,methodValue:l,transmitValue:n.levels.values[t.transmit.level||e._level],send:t.transmit.send,val:levelToValue(e._level,n)},r,c)}};var i}function asObject(e,t,n,a,i){const{level:o,log:r=e=>e}=i.formatters||{},s=n.slice();let l=s[0];const c={};let d=1+(0|e._childLevel);if(d<1&&(d=1),a&&(c.time=a),o){const n=o(t,e.levels.values[t]);Object.assign(c,n)}else c.level=e.levels.values[t];if(i.asObjectBindingsOnly){if(null!==l&&"object"==typeof l)for(;d--&&"object"==typeof s[0];)Object.assign(c,s.shift());const e=undefined;return[r(c),...s]}{if(null!==l&&"object"==typeof l){for(;d--&&"object"==typeof s[0];)Object.assign(c,s.shift());l=s.length?De(s.shift(),s):void 0}else"string"==typeof l&&(l=De(s.shift(),s));void 0!==l&&(c[i.messageKey]=l);const e=undefined;return[r(c)]}}function applySerializers(e,t,n,a){for(const i in e)if(a&&e[i]instanceof Error)e[i]=pino.stdSerializers.err(e[i]);else if("object"==typeof e[i]&&!Array.isArray(e[i])&&t)for(const a in e[i])t.indexOf(a)>-1&&a in n&&(e[i][a]=n[a](e[i][a]))}function transmit(e,t,n,a=!1){const i=t.send,o=t.ts,r=t.methodLevel,s=t.methodValue,l=t.val,c=e._logEvent.bindings;a||applySerializers(n,e._serialize||Object.keys(e.serializers),e.serializers,void 0===e._stdErrSerialize||e._stdErrSerialize),e._logEvent.ts=o,e._logEvent.messages=n.filter((function(e){return-1===c.indexOf(e)})),e._logEvent.level.label=r,e._logEvent.level.value=s,i(r,e._logEvent,l),e._logEvent=createLogEventShape(c)}function createLogEventShape(e){return{ts:0,messages:[],bindings:e||[],level:{label:"",value:0}}}function asErrValue(e){const t={type:e.constructor.name,msg:e.message,stack:e.stack};for(const n in e)void 0===t[n]&&(t[n]=e[n]);return t}function getTimeFunction(e){return"function"==typeof e.timestamp?e.timestamp:!1===e.timestamp?nullTime:epochTime}function mock(){return{}}function passthrough(e){return e}function noop(){}function nullTime(){return!1}function epochTime(){return Date.now()}function unixTime(){return Math.round(Date.now()/1e3)}function isoTime(){return new Date(Date.now()).toISOString()}function pfGlobalThisOrFallback(){function defd(e){return void 0!==e&&e}try{return"undefined"!=typeof globalThis||Object.defineProperty(Object.prototype,"globalThis",{get:function(){return delete Object.prototype.globalThis,this.globalThis=this},configurable:!0}),globalThis}catch(e){return defd(self)||defd(window)||defd(this)||{}}}var Ue;pino.levels={values:{fatal:60,error:50,warn:40,info:30,debug:20,trace:10},labels:{10:"trace",20:"debug",30:"info",40:"warn",50:"error",60:"fatal"}},pino.stdSerializers=Be,pino.stdTimeFunctions=Object.assign({},{nullTime:nullTime,epochTime:epochTime,unixTime:unixTime,isoTime:isoTime}),Re.exports.default=pino,Re.exports.pino=pino;const We=(0,Re.exports)({formatters:{level:e=>({level:e})}}),logger_error=(e,t)=>{null!=t?We.error(t,e):We.error(e)},logger_info=(e,t)=>{null!=t?We.info(t,e):We.info(e)},logger_warn=(e,t)=>{null!=t?We.warn(t,e):We.warn(e)},logger_debug=(e,t)=>{null!=t?We.debug(t,e):We.debug(e)};class Ge{}function useActionCallback(e,t=[]){const n=undefined;return i((t=>e({...t,snapshot:Object.defineProperties(t.snapshot,{getPromiseRequired:{configurable:!0,value:createGetPromiseRequiredWrapper(t.snapshot)},tryGetPromise:{configurable:!0,value:createTryGetPromiseWrapper(t.snapshot)}})})),t instanceof Ge?void 0:t)}function retainSnapshot(e){return({snapshot:t,...n})=>async(...a)=>{const i=t.retain();try{const i=undefined;return await e({...n,snapshot:t})(...a)}finally{i()}}}function createGetPromiseRequiredWrapper(e){return async(t,n)=>{const a=await e.getPromise(t);if(null==a)throw n??new Error(`No value present for required value ${t.key}`);return a}}function createTryGetPromiseWrapper(e){return async t=>{try{return{value:await e.getPromise(t)}}catch(e){return logger_debug(`Error encountered retrieving Recoil value. [key={${t.key}}]`,e),{error:e}}}}const Ke=3e3,$e=5e3,qe=8e3,Ye=o({key:"applicationMessageToast",default:void 0}),Xe=o({key:"applicationMessageBanner",default:void 0}),useApplicationMessageActions=()=>({setBannerMessage:useActionCallback((({set:e})=>t=>{e(Xe,null!=t?{...t,id:_e.create()}:void 0)})),setToastMessage:useActionCallback((({set:e})=>t=>{e(Ye,null!=t?{...t,id:_e.create()}:void 0)}))});var Ze=Object.freeze({__proto__:null,LOW_SEVERITY_BANNER_MESSAGE_DURATION_MS:$e,LOW_SEVERITY_TOAST_MESSAGE_DURATION_MS:Ke,MEDIUM_SEVERITY_TOAST_MESSAGE_DURATION_MS:qe,applicationMessageBanner:Xe,applicationMessageToast:Ye,useApplicationMessageActions:useApplicationMessageActions});const Je=500;function useViewerCameraActions(){const e=useApplicationMessageActions();return{flyToById:useActionCallback((({snapshot:e})=>async(t,n)=>{const a=await e.getPromise(et),i=await(a?.scene());await(i?.camera().flyTo({itemId:t}).render({animation:{milliseconds:n??Je}}))})),flyToByBoundingBox:useActionCallback((({snapshot:e})=>async(t,n)=>{const a=await e.getPromise(et),i=await(a?.scene());await(i?.camera().flyTo({boundingBox:t}).render({animation:{milliseconds:n??Je}}))})),updateCameraType:useActionCallback((({set:t,snapshot:n})=>async(a,i)=>{const o=await n.getPromise(st),r=undefined;null!=o&&g.isValid(o)||!i?t(Qe,a):e.setToastMessage({type:"error",message:"Cannot change the camera type when no geometry is visible.",duration:qe})}))}}const Qe=o({key:"viewerCameraType",default:"perspective"}),et=o({key:"viewerToolkitViewerElement",default:void 0,dangerouslyAllowMutability:!0}),tt=o({key:"viewerElementId",default:"vertex-viewer"}),nt=o({key:"viewerInitialSceneReady",default:!1}),at=o({key:"viewerBaseInteractionHandlerProvider",default:Promise.resolve(void 0),dangerouslyAllowMutability:!0}),it=o({key:"viewerPrimaryInteractionType",default:"rotate"}),ot=o({key:"viewerSceneViewId",default:void 0});function useViewerSceneActions(){const e=useActionCallback((({snapshot:e})=>async(t,n,...a)=>{const i=await e.getPromise(et),o=await(i?.scene());a.length>0&&await(o?.items((e=>a.map((t=>t(e))))).execute({suppliedCorrelationId:n}))})),t=A.useCallback(((...e)=>t=>t.where((t=>t.withItemIds(e))).select()),[]),n=A.useCallback(((...e)=>t=>t.where((t=>t.withItemIds(e))).deselect()),[]),a=A.useCallback((e=>e.where((e=>e.all())).deselect()),[]);return{executeWithCorrelationId:e,execute:useActionCallback((()=>async(t,...n)=>{const a=_e.create();await e(t,a,...n)})),selectItemsTransform:t,deselectItemsTransform:n,clearSelectionTransform:a,reset:useActionCallback((({snapshot:e})=>async t=>{const n=await e.getPromise(et),a=await(n?.scene()),i=await e.getPromiseRequired(Qe);a?.reset({includeCamera:!0,suppliedCorrelationId:t,cameraTypeOverride:i})}))}}const rt=o({key:"viewerFrameScene",default:void 0,dangerouslyAllowMutability:!0}),st=r({key:"viewerSceneVisibleBoundingBox",get:({get:e})=>e(rt)?.boundingBox});var lt=Object.freeze({__proto__:null,DEFAULT_CAMERA_ANIMATION_DURATION:Je,useViewerCameraActions:useViewerCameraActions,useViewerSceneActions:useViewerSceneActions,viewerBaseInteractionHandlerProvider:at,viewerCameraType:Qe,viewerElement:et,viewerElementId:tt,viewerFrameScene:rt,viewerInitialSceneReady:nt,viewerPrimaryInteractionType:it,viewerSceneViewId:ot,viewerSceneVisibleBoundingBox:st});class ct{api;interactionStarted=!1;initialize(e,t){this.api=t}dispose(){this.endInteraction()}async beginInteraction(){this.interactionStarted||(await(this.api?.beginInteraction()),this.interactionStarted=!0)}async endInteraction(){await(this.api?.endInteraction()),this.interactionStarted=!1}}const create=(e,t=0)=>({normal:e,offset:t}),forAxis=(e,t)=>{switch(e){case"x":return x(t);case"y":return y(t);case"z":return z(t)}},x=e=>create(v.left(),-e),y=e=>create(v.down(),-e),z=e=>create(v.forward(),-e),getAxis=(e,t)=>{switch(e){case"x":return xAxis(t);case"y":return yAxis(t);case"z":return zAxis(t)}},dt={x:v.left(),y:v.down(),z:v.forward()},xAxis=e=>e.x,yAxis=e=>e.y||v.create(e.x.z,e.x.x,e.x.y),zAxis=e=>e.z||v.create(e.x.y,e.x.z,e.x.x),axis=(e,t,n,a)=>e&&e.normal&&[["x",t],["y",n],["z",a]].filter((t=>0===v.magnitude(v.cross(e.normal,t[1])))).map((e=>e[0])).pop(),isNegativeNormal=e=>v.dot(v.create(-1,-1,-1),e.normal)>0,towardsVector=(e,t)=>{const n=undefined;return v.dot(e,t.normal)<0?invert(t):t},towardsCamera=(e,t)=>towardsVector(e.viewVector,t),invert=e=>({...e,normal:v.multiply(e.normal,v.create(-1,-1,-1)),offset:-e.offset}),fromHit=(e,t)=>{const n=v.normalize(e.normal),a=v.dot(n,e.position);return towardsCamera(t,create(n,a))},toAxis=(e,t,n,a,i)=>{const o=n.viewAll(),r=getAxis(e,t),s=null!=a&&null!=r?create(r,v.dot(r,i||g.center(a))):forAxis(e,o.lookAt[e]);return towardsCamera(n,s)};function corners(e){return[v.create(e.min.x,e.min.y,e.min.z),v.create(e.min.x,e.min.y,e.max.z),v.create(e.min.x,e.max.y,e.min.z),v.create(e.min.x,e.max.y,e.max.z),v.create(e.max.x,e.max.y,e.max.z),v.create(e.max.x,e.max.y,e.min.z),v.create(e.max.x,e.min.y,e.max.z),v.create(e.max.x,e.min.y,e.min.z)]}function equals(e,t){return e.min.x===t.min.x&&e.min.y===t.min.y&&e.min.z===t.min.z&&e.max.x===t.max.x&&e.max.y===t.max.y&&e.max.z===t.max.z}var ut;!function(e){e.PART="PART",e.SINGLE="SINGLE"}(ut||(ut={}));const mt="#616161",pt=1,ht="#BDBDBD",ft={default:5,min:0,max:10},gt=o({key:"crossSectioningEnabled",default:!1}),yt=o({key:"crossSectioningHighlightColor",default:mt}),vt=o({key:"crossSectioningBorderWidth",default:1}),bt=o({key:"endCapEnabledDefault",default:!1}),wt=o({key:"endCapEnabled",default:!1}),Ct=o({key:"endCapColorType",default:ut.PART}),St=o({key:"endCapCustomColor",default:ht}),xt=o({key:"crossSectioningPlanes",default:[]}),kt=o({key:"crossSectioningAlignment",default:{mode:"global",hitPending:!1}}),At=r({key:"crossSectioningTargetBoundingBox",get:async({get:e})=>{const t=undefined;return e(st)}}),Tt=o({key:"crossSectioningIsInteractive",default:!1}),Pt=o({key:"crossSectioningActiveAxis",default:"x"}),Mt=o({key:"crossSectioningAvailableAxes",default:dt}),Et=r({key:"crossSectioningOffsetScalar",get:({get:e})=>{const t=e(xt);return t.length>0&&isNegativeNormal(t[0])?-1:1}}),It=r({key:"crossSectioningSliderRange",get:({get:e})=>{const t=e(xt),n=e(At),a=null!=n?corners(n):[];if(t.length>0){const e=a.map((e=>v.dot(e,isNegativeNormal(t[0])?v.multiply(t[0].normal,v.create(-1,-1,-1)):t[0].normal)));return{default:t[0].offset,min:Math.min(...e)-2,max:Math.max(...e)+2}}return ft}}),Nt=r({key:"crossSectioningPlaneDisplayOffset",get:({get:e})=>{const t=e(xt),n=e(Et),a=e(It);return t.length>0?t[0].offset*n:a.default}}),Vt=o({key:"crossSectioningAdditionalToolsOpen",default:!1}),Ot=o({key:"crossSectioningAlignmentToolsOpen",default:!1}),Lt=o({key:"crossSectioningAxisToolsOpen",default:!1}),_t=o({key:"crossSectioningInteractionHandler",default:new ct,dangerouslyAllowMutability:!0});function useCrossSectioning(e,t){const n=s(_t);A.useEffect((()=>{t&&e?.registerInteractionHandler(n)}),[e,t,n])}const Rt=o({key:"hitResultsTapDetails",default:void 0}),Dt=o({key:"hitResultsLongPressDetails",default:void 0}),zt=o({key:"previousHitResult",default:void 0}),Bt=o({key:"currentHitResult",default:void 0}),jt=r({key:"hitResult",get:async({get:e})=>{const t=e(Rt),n=e(Dt),a=t??n,i=e(et),o=await(i?.scene()),r=o?.sceneViewId,s=o?.raycaster();if(null!=a&&null!=s&&null!=r){const e=await s.hitItems(a.position),t=(e?.hits||[])[0];if(null!=t)return{id:t.itemId?.hex,normal:v.create(t?.hitNormal?.x||0,t?.hitNormal?.y||0,t?.hitNormal?.z||0),position:v.create(t?.hitPoint?.x||0,t?.hitPoint?.y||0,t?.hitPoint?.z||0),meta:a.metaKey||a.ctrlKey||!1,metadata:[],ancestors:t?.ancestors?.filter((e=>null!=e.itemId?.hex)).map((e=>e.itemId?.hex))||[],annotationId:t?.annotationId?.hex}}}}),Ht=o({key:"hitResultsSkipNextTap",default:!1}),alignToNormal=(e,t,n)=>{if(e.toFrameCamera().isPerspective()){const n=v.dot(v.normalize(e.up),t),a=Math.abs(n)>.98?v.normalize(v.scale(-n,e.viewVector)):e.up,i=v.add(v.scale(v.distance(e.position,e.lookAt),v.multiply(t,v.create(-1,-1,-1))),e.lookAt);return e.update({up:a,position:i})}{const a=v.angleTo(v.normalize(e.viewVector),t),i=null!=n?g.center(n):e.lookAt,o=v.normalize(v.cross(v.normalize(e.viewVector),t));return e.rotateAroundAxisAtPoint(a,i,o)}};function isParallelTo(e,t){const n=b.toDegrees(v.angleTo(e,t));return 0===n||180===n}const Ft=500;function useCrossSectioningActions(){const e=useActionCallback((({snapshot:e})=>async()=>{const t=await e.getPromise(vt),n=await e.getPromise(yt),a=await e.getPromise(xt),i=await e.getPromise(et),o=await(i?.scene());await(o?.crossSectioning().update({sectionPlanes:a,highlightColor:n?Pe.fromHexString(n):void 0,lineWidth:t}))})),t=useActionCallback((({set:t,reset:n,snapshot:a})=>async()=>{const i=await a.getPromise(et),o=await(i?.scene());if(null!=o){const a=o.camera().viewAll();n(Mt),t(xt,[towardsCamera(o.camera(),x(a.lookAt.x))]),await e()}})),n=useActionCallback(retainSnapshot((({snapshot:t,set:n})=>async()=>{const a=await t.tryGetPromise(jt).then((e=>e.value)),i=await t.getPromise(et),o=await(i?.scene());if(null!=a&&null!=o){const t=fromHit(a,o.camera());n(xt,null!=t?[t]:[]),n(Mt,null!=t?{x:t.normal}:dt),await e()}}))),a=useActionCallback((({set:e,snapshot:n})=>async()=>{const a=await n.getPromise(xt),i=undefined;await n.getPromise(gt)||(e(gt,!0),0===a.length&&await t())})),i=useActionCallback((({reset:t,snapshot:n})=>async()=>{const a=undefined;await n.getPromise(gt)&&(t(gt),t(Vt),t(Ot),t(Lt),t(xt),t(kt),t(Pt),await e())}));return{enable:a,disable:i,reapply:useActionCallback((({snapshot:t})=>async()=>{const n=undefined;await t.getPromise(gt)&&await e()})),openAdditionalTools:useActionCallback((({set:e,snapshot:t})=>async()=>{const n=undefined;await t.getPromise(gt)||await a(),e(Vt,!0)})),closeAdditionalTools:useActionCallback((({reset:e})=>()=>{e(Vt)})),openAlignmentTools:useActionCallback((({set:e,reset:t})=>()=>{t(Lt),e(Ot,!0)})),closeAlignmentTools:useActionCallback((({reset:e})=>()=>{e(Ot)})),openAxisTools:useActionCallback((({set:e,reset:t})=>()=>{t(Ot),e(Lt,!0)})),closeAxisTools:useActionCallback((({reset:e})=>()=>{e(Lt)})),beginInteraction:useActionCallback((({set:e,snapshot:t})=>async()=>{const n=await t.getPromise(_t);e(Tt,!0),await n.beginInteraction()})),endInteraction:useActionCallback((({reset:e,snapshot:t})=>async()=>{const n=await t.getPromise(_t);e(Tt),await n.endInteraction()})),updatePlanes:useActionCallback(retainSnapshot((({set:t,snapshot:n})=>async a=>{const i=await n.getPromise(xt);if(i.length>0){const o=await n.getPromise(Et),r=await n.getPromise(It),s=o<0?-1*r.max:r.min,l=o<0?-1*r.min:r.max,c=i.map((e=>({...e,offset:Math.min(Math.max(a*o,s),l)})));t(xt,c),await e()}}))),flipPlanes:useActionCallback((({set:t,snapshot:n})=>async()=>{const a=await n.getPromise(xt);t(xt,a.map((e=>invert(e)))),await e()})),alignViewToPlane:useActionCallback((({snapshot:e})=>async()=>{const t=await e.getPromise(xt),n=await e.getPromise(et),a=await(n?.scene());t.length>0&&null!=a&&await alignToNormal(a.camera(),t[0].normal,a.boundingBox()).render({animation:{milliseconds:Ft}})})),updateAxis:useActionCallback(retainSnapshot((({set:t,reset:n,snapshot:a})=>async i=>{const o=await a.getPromise(xt),r=await a.getPromise(Mt),s=await a.getPromise(At),l=await a.getPromise(kt),c=await a.getPromise(et),d=await(c?.scene()),u=r[i],m=null!=u&&o.length>0&&isParallelTo(o[0].normal,u)&&!isNaN(v.angleTo(o[0].normal,u));if(null!=d&&!m){const e=await a.tryGetPromise(jt).then((e=>e.value));t(Pt,i),t(xt,[toAxis(i,r,d.camera(),s,"global"!==l.mode?e?.position:void 0)])}n(Lt),await e()}))),updateAlignment:useActionCallback((({set:e,reset:i})=>async(o,r)=>{i(Ot),e(kt,{mode:o,hitPending:"global"!==o&&null==r}),"global"===o?(i(Pt),i(Mt),await t()):"surface"===o&&null!=r&&(await a(),await n())})),sectionCurrentHit:useActionCallback((({set:e,snapshot:t})=>async()=>{const a=await t.getPromise(kt);a.hitPending&&(e(kt,{...a,hitPending:!1}),"surface"===a.mode&&await n())})),cancelCurrentHit:useActionCallback((({set:e,snapshot:t})=>async()=>{const n=await t.getPromise(kt);n.hitPending&&e(kt,{...n,hitPending:!1})}))}}var Ut=Object.freeze({__proto__:null,DEFAULT_ALIGN_TO_PLANE_ANIMATION_DURATION_MS:Ft,DEFAULT_CROSS_SECTION_HIGHLIGHT_COLOR:mt,DEFAULT_CROSS_SECTION_LINE_THICKNESS_VALUE:1,DEFAULT_END_CAPPING_COLOR:ht,DEFAULT_SLIDER_RANGE:ft,get EndCapColorType(){return ut},crossSectioningActiveAxis:Pt,crossSectioningAdditionalToolsOpen:Vt,crossSectioningAlignment:kt,crossSectioningAlignmentToolsOpen:Ot,crossSectioningAvailableAxes:Mt,crossSectioningAxisToolsOpen:Lt,crossSectioningBorderWidth:vt,crossSectioningEnabled:gt,crossSectioningHighlightColor:yt,crossSectioningInteractionHandler:_t,crossSectioningIsInteractive:Tt,crossSectioningOffsetScalar:Et,crossSectioningPlaneDisplayOffset:Nt,crossSectioningPlanes:xt,crossSectioningSliderRange:It,crossSectioningTargetBoundingBox:At,endCapColorType:Ct,endCapCustomColor:St,endCapEnabled:wt,endCapEnabledDefault:bt,useCrossSectioning:useCrossSectioning,useCrossSectioningActions:useCrossSectioningActions});function useDebouncedCallback(e,t){const[n,a]=A.useState();return A.useEffect((()=>()=>{null!=n&&clearTimeout(n)}),[e,t,n]),A.useCallback((i=>{const handler=()=>{e(i)};null!=n&&clearTimeout(n),a(setTimeout(handler,t))}),[e,t,n])}const VertexColorPicker=({onInput:t,...n})=>{const a=useDebouncedCallback((e=>{t?.(e)}),500),i=A.useCallback((e=>{const t=e.target;a(t.value)}),[a]);return e(N,{onInput:i,...n})},VertexCrossSectionAppearanceColorPicker=({onUpdate:t})=>{const n=useCrossSectioningActions(),[a,i]=l(yt);return e(VertexColorPicker,{"data-testid":"cross-section-highlight-color-picker",value:a,onValueChanged:e=>{t?.(e.detail)},onInput:async e=>{i(e),await n.reapply()}})};var Wt={exports:{}},Gt;
13
+ */function isObjectObject(e){return!0===isObject(e)&&"[object Object]"===Object.prototype.toString.call(e)}function isPlainObject$1(e){var t,n;return!1!==isObjectObject(e)&&("function"==typeof(t=e.constructor)&&(!1!==isObjectObject(n=t.prototype)&&!1!==n.hasOwnProperty("isPrototypeOf")))}function defaults(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var n=__read(e),a=n[0],i=n.slice(1),o=__assign({},a);if(0===i.length)return o;if(1===i.length){var r=i[0];for(var s in r)null==o[s]?o[s]=r[s]:isPlainObject(o[s])&&(o[s]=defaults(o[s],r[s]));return o}return i.reduce((function(e,t){return defaults(e,t)}),a)}function isPlainObject(e){return isPlainObject$1(e)}function isEqual$1(e,t){return Me(e,t)}function toPairs(e){return null!=e?Object.keys(e).map((function(t){return[t,e[t]]})):[]}function fromPairs(e){return Array.isArray(e)?e.reduce((function(e,t){var n;return null!=t?__assign(__assign({},e),((n={})[t[0]]=t[1],n)):e}),{}):{}}var Ee=Object.freeze({__proto__:null,defaults:defaults,isPlainObject:isPlainObject,isEqual:isEqual$1,toPairs:toPairs,fromPairs:fromPairs}),Ie,Ne=new Uint8Array(16);function rng(){if(!Ie&&!(Ie="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||"undefined"!=typeof msCrypto&&"function"==typeof msCrypto.getRandomValues&&msCrypto.getRandomValues.bind(msCrypto)))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return Ie(Ne)}var Oe=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i;function validate(e){return"string"==typeof e&&Oe.test(e)}for(var Ve=[],Le=0;Le<256;++Le)Ve.push((Le+256).toString(16).substr(1));function stringify(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=(Ve[e[t+0]]+Ve[e[t+1]]+Ve[e[t+2]]+Ve[e[t+3]]+"-"+Ve[e[t+4]]+Ve[e[t+5]]+"-"+Ve[e[t+6]]+Ve[e[t+7]]+"-"+Ve[e[t+8]]+Ve[e[t+9]]+"-"+Ve[e[t+10]]+Ve[e[t+11]]+Ve[e[t+12]]+Ve[e[t+13]]+Ve[e[t+14]]+Ve[e[t+15]]).toLowerCase();if(!validate(n))throw TypeError("Stringified UUID is invalid");return n}function v4(e,t,n){var a=(e=e||{}).random||(e.rng||rng)();return a[6]=15&a[6]|64,a[8]=63&a[8]|128,stringify(a)}function create$1(){return v4()}function fromMsbLsb(e,t){function digits(e,t){var n=BigInt(1)<<t*BigInt(4);return(n|e&n-BigInt(1)).toString(16).substring(1)}var n="string"==typeof e?BigInt(e):e,a="string"==typeof t?BigInt(t):t,i=digits(n>>BigInt(32),BigInt(8)),o=digits(n>>BigInt(16),BigInt(4)),r=digits(n,BigInt(4)),s=digits(a>>BigInt(48),BigInt(4)),l=digits(a,BigInt(12));return"".concat(i,"-").concat(o,"-").concat(r,"-").concat(s,"-").concat(l)}function toMsbLsb(e){var t=__read(e.split("-"),5),n=t[0],a=t[1],i=t[2],o=t[3],r=t[4];if(null==n||null==a||null==i||null==o||null==r)throw new Error("Invalid UUID string ".concat(e));var s=BigInt.asIntN(64,BigInt("0x".concat(n+a+i))),l=BigInt.asIntN(64,BigInt("0x".concat(o+r)));return{msb:s.toString(),lsb:l.toString()}}var _e=Object.freeze({__proto__:null,create:create$1,fromMsbLsb:fromMsbLsb,toMsbLsb:toMsbLsb}),Re={exports:{}};const De=a;Re.exports=pino;const ze=pfGlobalThisOrFallback().console||{},Be={mapHttpRequest:mock,mapHttpResponse:mock,wrapRequestSerializer:passthrough,wrapResponseSerializer:passthrough,wrapErrorSerializer:passthrough,req:mock,res:mock,err:asErrValue,errWithCause:asErrValue};function levelToValue(e,t){return"silent"===e?1/0:t.levels.values[e]}const He=Symbol("pino.logFuncs"),je=Symbol("pino.hierarchy"),Fe={error:"log",fatal:"error",warn:"error",info:"log",debug:"log",trace:"log"};function appendChildLogger(e,t){const n={logger:t,parent:e[je]};t[je]=n}function setupBaseLogFunctions(e,t,n){const a={};t.forEach((e=>{a[e]=n[e]?n[e]:ze[e]||ze[Fe[e]||"log"]||noop})),e[He]=a}function shouldSerialize(e,t){if(Array.isArray(e)){const t=undefined;return e.filter((function(e){return"!stdSerializers.err"!==e}))}return!0===e&&Object.keys(t)}function pino(e){(e=e||{}).browser=e.browser||{};const t=e.browser.transmit;if(t&&"function"!=typeof t.send)throw Error("pino: transmit option must have a send function");const n=e.browser.write||ze;e.browser.write&&(e.browser.asObject=!0);const a=e.serializers||{},i=shouldSerialize(e.browser.serialize,a);let o=e.browser.serialize;Array.isArray(e.browser.serialize)&&e.browser.serialize.indexOf("!stdSerializers.err")>-1&&(o=!1);const r=Object.keys(e.customLevels||{}),s=["error","fatal","warn","info","debug","trace"].concat(r);"function"==typeof n&&s.forEach((function(e){n[e]=n})),(!1===e.enabled||e.browser.disabled)&&(e.level="silent");const l=e.level||"info",c=Object.create(n);c.log||(c.log=noop),setupBaseLogFunctions(c,s,n),appendChildLogger({},c),Object.defineProperty(c,"levelVal",{get:getLevelVal}),Object.defineProperty(c,"level",{get:getLevel,set:setLevel});const d={transmit:t,serialize:i,asObject:e.browser.asObject,asObjectBindingsOnly:e.browser.asObjectBindingsOnly,formatters:e.browser.formatters,levels:s,timestamp:getTimeFunction(e),messageKey:e.messageKey||"msg",onChild:e.onChild||noop};function getLevelVal(){return levelToValue(this.level,this)}function getLevel(){return this._level}function setLevel(e){if("silent"!==e&&!this.levels.values[e])throw Error("unknown level "+e);this._level=e,set(this,d,c,"error"),set(this,d,c,"fatal"),set(this,d,c,"warn"),set(this,d,c,"info"),set(this,d,c,"debug"),set(this,d,c,"trace"),r.forEach((e=>{set(this,d,c,e)}))}function child(n,o,r){if(!o)throw new Error("missing bindings for child Pino");r=r||{},i&&o.serializers&&(r.serializers=o.serializers);const s=r.serializers;if(i&&s){var l=Object.assign({},a,s),c=!0===e.browser.serialize?Object.keys(l):i;delete o.serializers,applySerializers([o],c,l,this._stdErrSerialize)}function Child(e){this._childLevel=1+(0|e._childLevel),this.bindings=o,l&&(this.serializers=l,this._serialize=c),t&&(this._logEvent=createLogEventShape([].concat(e._logEvent.bindings,o)))}Child.prototype=this;const d=new Child(this);return appendChildLogger(this,d),d.child=function(...e){return child.call(this,n,...e)},d.level=r.level||this.level,n.onChild(d),d}return c.levels=getLevels(e),c.level=l,c.isLevelEnabled=function(e){return!!this.levels.values[e]&&this.levels.values[e]>=this.levels.values[this.level]},c.setMaxListeners=c.getMaxListeners=c.emit=c.addListener=c.on=c.prependListener=c.once=c.prependOnceListener=c.removeListener=c.removeAllListeners=c.listeners=c.listenerCount=c.eventNames=c.write=c.flush=noop,c.serializers=a,c._serialize=i,c._stdErrSerialize=o,c.child=function(...e){return child.call(this,d,...e)},t&&(c._logEvent=createLogEventShape()),c}function getLevels(e){const t=e.customLevels||{},n=undefined,a=undefined;return{values:Object.assign({},pino.levels.values,t),labels:Object.assign({},pino.levels.labels,invertObject(t))}}function invertObject(e){const t={};return Object.keys(e).forEach((function(n){t[e[n]]=n})),t}function getBindingChain(e){const t=[];e.bindings&&t.push(e.bindings);let n=e[je];for(;n.parent;)n=n.parent,n.logger.bindings&&t.push(n.logger.bindings);return t.reverse()}function set(e,t,n,a){if(Object.defineProperty(e,a,{value:levelToValue(e.level,n)>levelToValue(a,n)?noop:n[He][a],writable:!0,enumerable:!0,configurable:!0}),e[a]===noop){if(!t.transmit)return;const i=undefined,o=levelToValue(t.transmit.level||e.level,n),r=undefined;if(levelToValue(a,n)<o)return}e[a]=createWrap(e,t,n,a);const i=getBindingChain(e);0!==i.length&&(e[a]=prependBindingsInArguments(i,e[a]))}function prependBindingsInArguments(e,t){return function(){return t.apply(this,[...e,...arguments])}}function createWrap(e,t,n,a){return i=e[He][a],function LOG(){const o=t.timestamp(),r=new Array(arguments.length),s=Object.getPrototypeOf&&Object.getPrototypeOf(this)===ze?ze:this;for(var l=0;l<r.length;l++)r[l]=arguments[l];var c=!1;if(t.serialize&&(applySerializers(r,this._serialize,this.serializers,this._stdErrSerialize),c=!0),t.asObject||t.formatters?i.call(s,...asObject(this,a,r,o,t)):i.apply(s,r),t.transmit){const i=void 0,s=levelToValue(t.transmit.level||e._level,n),l=levelToValue(a,n);if(l<s)return;transmit(this,{ts:o,methodLevel:a,methodValue:l,transmitValue:n.levels.values[t.transmit.level||e._level],send:t.transmit.send,val:levelToValue(e._level,n)},r,c)}};var i}function asObject(e,t,n,a,i){const{level:o,log:r=e=>e}=i.formatters||{},s=n.slice();let l=s[0];const c={};let d=1+(0|e._childLevel);if(d<1&&(d=1),a&&(c.time=a),o){const n=o(t,e.levels.values[t]);Object.assign(c,n)}else c.level=e.levels.values[t];if(i.asObjectBindingsOnly){if(null!==l&&"object"==typeof l)for(;d--&&"object"==typeof s[0];)Object.assign(c,s.shift());const e=undefined;return[r(c),...s]}{if(null!==l&&"object"==typeof l){for(;d--&&"object"==typeof s[0];)Object.assign(c,s.shift());l=s.length?De(s.shift(),s):void 0}else"string"==typeof l&&(l=De(s.shift(),s));void 0!==l&&(c[i.messageKey]=l);const e=undefined;return[r(c)]}}function applySerializers(e,t,n,a){for(const i in e)if(a&&e[i]instanceof Error)e[i]=pino.stdSerializers.err(e[i]);else if("object"==typeof e[i]&&!Array.isArray(e[i])&&t)for(const a in e[i])t.indexOf(a)>-1&&a in n&&(e[i][a]=n[a](e[i][a]))}function transmit(e,t,n,a=!1){const i=t.send,o=t.ts,r=t.methodLevel,s=t.methodValue,l=t.val,c=e._logEvent.bindings;a||applySerializers(n,e._serialize||Object.keys(e.serializers),e.serializers,void 0===e._stdErrSerialize||e._stdErrSerialize),e._logEvent.ts=o,e._logEvent.messages=n.filter((function(e){return-1===c.indexOf(e)})),e._logEvent.level.label=r,e._logEvent.level.value=s,i(r,e._logEvent,l),e._logEvent=createLogEventShape(c)}function createLogEventShape(e){return{ts:0,messages:[],bindings:e||[],level:{label:"",value:0}}}function asErrValue(e){const t={type:e.constructor.name,msg:e.message,stack:e.stack};for(const n in e)void 0===t[n]&&(t[n]=e[n]);return t}function getTimeFunction(e){return"function"==typeof e.timestamp?e.timestamp:!1===e.timestamp?nullTime:epochTime}function mock(){return{}}function passthrough(e){return e}function noop(){}function nullTime(){return!1}function epochTime(){return Date.now()}function unixTime(){return Math.round(Date.now()/1e3)}function isoTime(){return new Date(Date.now()).toISOString()}function pfGlobalThisOrFallback(){function defd(e){return void 0!==e&&e}try{return"undefined"!=typeof globalThis||Object.defineProperty(Object.prototype,"globalThis",{get:function(){return delete Object.prototype.globalThis,this.globalThis=this},configurable:!0}),globalThis}catch(e){return defd(self)||defd(window)||defd(this)||{}}}var We;pino.levels={values:{fatal:60,error:50,warn:40,info:30,debug:20,trace:10},labels:{10:"trace",20:"debug",30:"info",40:"warn",50:"error",60:"fatal"}},pino.stdSerializers=Be,pino.stdTimeFunctions=Object.assign({},{nullTime:nullTime,epochTime:epochTime,unixTime:unixTime,isoTime:isoTime}),Re.exports.default=pino,Re.exports.pino=pino;const Ue=(0,Re.exports)({formatters:{level:e=>({level:e})}}),logger_error=(e,t)=>{null!=t?Ue.error(t,e):Ue.error(e)},logger_info=(e,t)=>{null!=t?Ue.info(t,e):Ue.info(e)},logger_warn=(e,t)=>{null!=t?Ue.warn(t,e):Ue.warn(e)},logger_debug=(e,t)=>{null!=t?Ue.debug(t,e):Ue.debug(e)};class Ge{}function useActionCallback(e,t=[]){const n=undefined;return i((t=>e({...t,snapshot:Object.defineProperties(t.snapshot,{getPromiseRequired:{configurable:!0,value:createGetPromiseRequiredWrapper(t.snapshot)},tryGetPromise:{configurable:!0,value:createTryGetPromiseWrapper(t.snapshot)}})})),t instanceof Ge?void 0:t)}function retainSnapshot(e){return({snapshot:t,...n})=>async(...a)=>{const i=t.retain();try{const i=undefined;return await e({...n,snapshot:t})(...a)}finally{i()}}}function createGetPromiseRequiredWrapper(e){return async(t,n)=>{const a=await e.getPromise(t);if(null==a)throw n??new Error(`No value present for required value ${t.key}`);return a}}function createTryGetPromiseWrapper(e){return async t=>{try{return{value:await e.getPromise(t)}}catch(e){return logger_debug(`Error encountered retrieving Recoil value. [key={${t.key}}]`,e),{error:e}}}}const Ke=3e3,$e=5e3,qe=8e3,Ye=o({key:"applicationMessageToast",default:void 0}),Xe=o({key:"applicationMessageBanner",default:void 0}),useApplicationMessageActions=()=>({setBannerMessage:useActionCallback((({set:e})=>t=>{e(Xe,null!=t?{...t,id:_e.create()}:void 0)})),setToastMessage:useActionCallback((({set:e})=>t=>{e(Ye,null!=t?{...t,id:_e.create()}:void 0)}))});var Ze=Object.freeze({__proto__:null,LOW_SEVERITY_BANNER_MESSAGE_DURATION_MS:$e,LOW_SEVERITY_TOAST_MESSAGE_DURATION_MS:Ke,MEDIUM_SEVERITY_TOAST_MESSAGE_DURATION_MS:qe,applicationMessageBanner:Xe,applicationMessageToast:Ye,useApplicationMessageActions:useApplicationMessageActions});const Je=500;function useViewerCameraActions(){const e=useApplicationMessageActions();return{flyToById:useActionCallback((({snapshot:e})=>async(t,n)=>{const a=await e.getPromise(et),i=await(a?.scene());await(i?.camera().flyTo({itemId:t}).render({animation:{milliseconds:n??Je}}))})),flyToByBoundingBox:useActionCallback((({snapshot:e})=>async(t,n)=>{const a=await e.getPromise(et),i=await(a?.scene());await(i?.camera().flyTo({boundingBox:t}).render({animation:{milliseconds:n??Je}}))})),updateCameraType:useActionCallback((({set:t,snapshot:n})=>async(a,i)=>{const o=await n.getPromise(st),r=undefined;null!=o&&g.isValid(o)||!i?t(Qe,a):e.setToastMessage({type:"error",message:"Cannot change the camera type when no geometry is visible.",duration:qe})}))}}const Qe=o({key:"viewerCameraType",default:"perspective"}),et=o({key:"viewerToolkitViewerElement",default:void 0,dangerouslyAllowMutability:!0}),tt=o({key:"viewerElementId",default:"vertex-viewer"}),nt=o({key:"viewerInitialSceneReady",default:!1}),at=o({key:"viewerBaseInteractionHandlerProvider",default:Promise.resolve(void 0),dangerouslyAllowMutability:!0}),it=o({key:"viewerPrimaryInteractionType",default:"rotate"}),ot=o({key:"viewerSceneViewId",default:void 0});function useViewerSceneActions(){const e=useActionCallback((({snapshot:e})=>async(t,n,...a)=>{const i=await e.getPromise(et),o=await(i?.scene());a.length>0&&await(o?.items((e=>a.map((t=>t(e))))).execute({suppliedCorrelationId:n}))})),t=A.useCallback(((...e)=>t=>t.where((t=>t.withItemIds(e))).select()),[]),n=A.useCallback(((...e)=>t=>t.where((t=>t.withItemIds(e))).deselect()),[]),a=A.useCallback((e=>e.where((e=>e.all())).deselect()),[]);return{executeWithCorrelationId:e,execute:useActionCallback((()=>async(t,...n)=>{const a=_e.create();await e(t,a,...n)})),selectItemsTransform:t,deselectItemsTransform:n,clearSelectionTransform:a,reset:useActionCallback((({snapshot:e})=>async t=>{const n=await e.getPromise(et),a=await(n?.scene()),i=await e.getPromiseRequired(Qe);a?.reset({includeCamera:!0,suppliedCorrelationId:t,cameraTypeOverride:i})}))}}const rt=o({key:"viewerFrameScene",default:void 0,dangerouslyAllowMutability:!0}),st=r({key:"viewerSceneVisibleBoundingBox",get:({get:e})=>e(rt)?.boundingBox});var lt=Object.freeze({__proto__:null,DEFAULT_CAMERA_ANIMATION_DURATION:Je,useViewerCameraActions:useViewerCameraActions,useViewerSceneActions:useViewerSceneActions,viewerBaseInteractionHandlerProvider:at,viewerCameraType:Qe,viewerElement:et,viewerElementId:tt,viewerFrameScene:rt,viewerInitialSceneReady:nt,viewerPrimaryInteractionType:it,viewerSceneViewId:ot,viewerSceneVisibleBoundingBox:st});class ct{api;interactionStarted=!1;initialize(e,t){this.api=t}dispose(){this.endInteraction()}async beginInteraction(){this.interactionStarted||(await(this.api?.beginInteraction()),this.interactionStarted=!0)}async endInteraction(){await(this.api?.endInteraction()),this.interactionStarted=!1}}const create=(e,t=0)=>({normal:e,offset:t}),forAxis=(e,t)=>{switch(e){case"x":return x(t);case"y":return y(t);case"z":return z(t)}},x=e=>create(v.left(),-e),y=e=>create(v.down(),-e),z=e=>create(v.forward(),-e),getAxis=(e,t)=>{switch(e){case"x":return xAxis(t);case"y":return yAxis(t);case"z":return zAxis(t)}},dt={x:v.left(),y:v.down(),z:v.forward()},xAxis=e=>e.x,yAxis=e=>e.y||v.create(e.x.z,e.x.x,e.x.y),zAxis=e=>e.z||v.create(e.x.y,e.x.z,e.x.x),axis=(e,t,n,a)=>e&&e.normal&&[["x",t],["y",n],["z",a]].filter((t=>0===v.magnitude(v.cross(e.normal,t[1])))).map((e=>e[0])).pop(),isNegativeNormal=e=>v.dot(v.create(-1,-1,-1),e.normal)>0,towardsVector=(e,t)=>{const n=undefined;return v.dot(e,t.normal)<0?invert(t):t},towardsCamera=(e,t)=>towardsVector(e.viewVector,t),invert=e=>({...e,normal:v.multiply(e.normal,v.create(-1,-1,-1)),offset:-e.offset}),fromHit=(e,t)=>{const n=v.normalize(e.normal),a=v.dot(n,e.position);return towardsCamera(t,create(n,a))},toAxis=(e,t,n,a,i)=>{const o=n.viewAll(),r=getAxis(e,t),s=null!=a&&null!=r?create(r,v.dot(r,i||g.center(a))):forAxis(e,o.lookAt[e]);return towardsCamera(n,s)};function corners(e){return[v.create(e.min.x,e.min.y,e.min.z),v.create(e.min.x,e.min.y,e.max.z),v.create(e.min.x,e.max.y,e.min.z),v.create(e.min.x,e.max.y,e.max.z),v.create(e.max.x,e.max.y,e.max.z),v.create(e.max.x,e.max.y,e.min.z),v.create(e.max.x,e.min.y,e.max.z),v.create(e.max.x,e.min.y,e.min.z)]}function equals(e,t){return e.min.x===t.min.x&&e.min.y===t.min.y&&e.min.z===t.min.z&&e.max.x===t.max.x&&e.max.y===t.max.y&&e.max.z===t.max.z}var ut;!function(e){e.PART="PART",e.SINGLE="SINGLE"}(ut||(ut={}));const mt="#616161",pt=1,ht="#BDBDBD",ft={default:5,min:0,max:10},gt=o({key:"crossSectioningEnabled",default:!1}),yt=o({key:"crossSectioningHighlightColor",default:mt}),vt=o({key:"crossSectioningBorderWidth",default:1}),bt=o({key:"endCapEnabledDefault",default:!0}),wt=o({key:"endCapEnabled",default:!0}),Ct=o({key:"endCapColorType",default:ut.PART}),St=o({key:"endCapCustomColor",default:ht}),xt=o({key:"crossSectioningPlanes",default:[]}),kt=o({key:"crossSectioningAlignment",default:{mode:"global",hitPending:!1}}),At=r({key:"crossSectioningTargetBoundingBox",get:async({get:e})=>{const t=undefined;return e(st)}}),Tt=o({key:"crossSectioningIsInteractive",default:!1}),Pt=o({key:"crossSectioningActiveAxis",default:"x"}),Mt=o({key:"crossSectioningAvailableAxes",default:dt}),Et=r({key:"crossSectioningOffsetScalar",get:({get:e})=>{const t=e(xt);return t.length>0&&isNegativeNormal(t[0])?-1:1}}),It=r({key:"crossSectioningSliderRange",get:({get:e})=>{const t=e(xt),n=e(At),a=null!=n?corners(n):[];if(t.length>0){const e=a.map((e=>v.dot(e,isNegativeNormal(t[0])?v.multiply(t[0].normal,v.create(-1,-1,-1)):t[0].normal)));return{default:t[0].offset,min:Math.min(...e)-2,max:Math.max(...e)+2}}return ft}}),Nt=r({key:"crossSectioningPlaneDisplayOffset",get:({get:e})=>{const t=e(xt),n=e(Et),a=e(It);return t.length>0?t[0].offset*n:a.default}}),Ot=o({key:"crossSectioningAdditionalToolsOpen",default:!1}),Vt=o({key:"crossSectioningAlignmentToolsOpen",default:!1}),Lt=o({key:"crossSectioningAxisToolsOpen",default:!1}),_t=o({key:"crossSectioningInteractionHandler",default:new ct,dangerouslyAllowMutability:!0});function useCrossSectioning(e,t){const n=s(_t);A.useEffect((()=>{t&&e?.registerInteractionHandler(n)}),[e,t,n])}const Rt=o({key:"hitResultsTapDetails",default:void 0}),Dt=o({key:"hitResultsLongPressDetails",default:void 0}),zt=o({key:"previousHitResult",default:void 0}),Bt=o({key:"currentHitResult",default:void 0}),Ht=r({key:"hitResult",get:async({get:e})=>{const t=e(Rt),n=e(Dt),a=t??n,i=e(et),o=await(i?.scene()),r=o?.sceneViewId,s=o?.raycaster();if(null!=a&&null!=s&&null!=r){const e=await s.hitItems(a.position),t=(e?.hits||[])[0];if(null!=t)return{id:t.itemId?.hex,normal:v.create(t?.hitNormal?.x||0,t?.hitNormal?.y||0,t?.hitNormal?.z||0),position:v.create(t?.hitPoint?.x||0,t?.hitPoint?.y||0,t?.hitPoint?.z||0),meta:a.metaKey||a.ctrlKey||!1,metadata:[],ancestors:t?.ancestors?.filter((e=>null!=e.itemId?.hex)).map((e=>e.itemId?.hex))||[],annotationId:t?.annotationId?.hex}}}}),jt=o({key:"hitResultsSkipNextTap",default:!1}),Ft="Scene Alteration Performance";var Wt;!function(e){e.HIDE_ITEM="Hide Item",e.SHOW_ONLY_SELECTED="Show Only Selected",e.HIDE_SELECTED="Hide Selected",e.SHOW_ONLY_ITEM="Show Only Item",e.SHOW_ALL="Show All",e.HIDE_ALL="Hide All",e.SELECT_FILTERED_ITEMS="Select Filtered Items",e.INVERT_SELECTION="Invert Selection",e.CLEAR_ALL_TRANSFORMS="Clear All Transforms",e.CLEAR_SELECTED_TRANSFORMS="Clear Selected Transforms",e.CLEAR_SELECTION="Clear Selection",e.DESELECTING_ITEMS="Deselecting Items",e.SELECTING_ITEMS="Selecting Items",e.SELECTING_ONLY_ITEM="Selecting Only Item",e.SELECTING_ANCESTOR="Selecting Ancestor",e.APPLY_MATERIAL_OVERRIDE_TO_ALL="Apply Material Override To All",e.APPLY_MATERIAL_OVERRIDE_TO_SELECTION="Apply Material Override To Selection",e.CLEAR_ALL_MATERIAL_OVERRIDES="Clear All Material Overrides",e.CLEAR_SELECTED_MATERIAL_OVERRIDES="Clear Selected Material Overrides",e.SET_PHANTOM_ALL="Set Phantom All",e.SET_PHANTOM_SELECTED_ITEMS="Set Phantom Selected Items",e.CLEAR_PHANTOM_ALL="Clear Phantom All",e.CLEAR_PHANTOM_SELECTED_ITEMS="Clear Phantom Selected Items",e.SET_PHANTOM_NON_SELECTED_ITEMS="Set Phantom Non Selected Items",e.RESTORE_PHANTOM_OVERRIDES="Restore Phantom Overrides",e.SET_ITEM_AS_END_ITEM="Set Item as End Item",e.UNSET_ITEM_AS_END_ITEM="Unset Item as End Item",e.SHOW_ANNOTATION="Show Annotation",e.HIDE_ANNOTATION="Hide Annotation"}(Wt||(Wt={}));var Ut=Object.freeze({__proto__:null,SCENE_ALTERATION_PERFORMANCE:Ft,get SceneAlterationPerformanceType(){return Wt}});const Gt=l({key:"selectionSelectedItems",default:void 0}),Kt=o({key:"selectionSelectedItemIds",default:[]}),$t=o({key:"selectionLastSelected",default:void 0}),qt=o({key:"selectionLastSelectionFromViewer",default:!1}),Yt=o({key:"selectionLastSelectWasMultiSelect",default:!1}),Xt=r({key:"selectionHasMultipleSelected",get:({get:e})=>{const t=e($t),n=undefined;return e(Kt).filter((e=>e!==t?.id&&!t?.ancestors?.includes(e))).length>0}}),Zt=o({key:"selectionIsAncestorSelection",default:!1}),Jt=o({key:"selectionFirstSelectedItemInTreeId",default:void 0}),Qt=r({key:"selectionHighestSelectedAncestor",get:({get:e})=>{const t=e($t),n=e(Kt);return t?.ancestors?.find((e=>n.includes(e)))??t?.id}}),en=o({key:"selectionPreviousVisibleSummary",default:void 0}),tn=o({key:"selectionVisibleSummary",default:void 0}),nn=r({key:"selectionVisibleCount",get:({get:e})=>e(tn)?.count??0}),an=r({key:"selectionBoundingBoxCenter",get:({get:e})=>{const t=e(tn);return null!=t?.boundingBox?g.center(t.boundingBox):v.origin()}}),on=r({key:"selectionIsActive",get:({get:e})=>{const t=e(Kt),n=undefined;return e(nn)>0||t.length>0}}),rn=r({key:"fetchedAndSelectedItems",get:async({get:e})=>{const t=e(Kt),n=undefined;return null!=e(ot)?t.map((t=>e(pa(t)))):[]}}),sn=o({key:"selectionModelViewsSelected",default:void 0});function contextMenuItemIsRow(e){return null!=e&&null!=e?.node?.id}function contextMenuItemIsElement(e){return null!=e&&e instanceof HTMLElement}const ln=o({key:"contextMenuActive",default:void 0}),cn=o({key:"contextMenuPosition",default:void 0}),dn=o({key:"contextMenuTarget",default:void 0}),un=o({key:"contextMenuItem",default:void 0}),mn=o({key:"contextMenuActions",default:[]}),pn=r({key:"contextMenuActivePosition",get:({get:e})=>null!=e(ln)?e(cn):void 0});function useContextMenuActions(){return{pointerDown:useActionCallback((({set:e})=>async t=>{if(2===t.button){const n=t.clientX,a=t?.clientY;e(cn,b.create(n,a)),e(dn,t.target)}})),pointerUp:useActionCallback((({snapshot:e,set:t})=>async(n,a,i,o)=>{const r=await e.getPromise(cn),s=await e.getPromise(ln);if(null!=r&&null==s){const e=n.clientX,s=n?.clientY,l=b.create(e,s),c=null!=r?b.distance(r,l):0,d=null==i||i(n);c<2&&d&&(o?.(n,r??l),t(ln,a))}})),contextMenu:useActionCallback((()=>(e,t)=>{(null==t||t(e))&&e.preventDefault()})),longPress:useActionCallback((({set:e})=>(t,n,a,i)=>{if(null==a||a(t)){const a=b.create(t.touches[0].clientX,t.touches[0].clientY);e(cn,a),e(dn,t.target),e(ln,n),i?.(t,a)}})),setContextMenuItem:useActionCallback((({snapshot:e,set:t,reset:n})=>async a=>{const i=await e.getPromise(mn);t(un,a),i.forEach((e=>e(a))),n(mn)})),clearActiveContextMenu:useActionCallback((({reset:e,set:t})=>n=>{t(jt,!!n),e(ln),e(mn),e(cn)})),clearDismissedState:useActionCallback((({reset:e})=>()=>e(jt)))}}function targetWithinMenu(e){return e.target instanceof Element&&isChildOf("vertex-menu",e.target)}function targetShouldSkipNextHit(e){return e.target instanceof Element&&isChildOf("vertex-viewer",e.target)}function isChildOf(e,t){return null!=t.closest(e)}var hn=Object.freeze({__proto__:null,contextMenuActions:mn,contextMenuActive:ln,contextMenuActivePosition:pn,contextMenuItem:un,contextMenuItemIsElement:contextMenuItemIsElement,contextMenuItemIsRow:contextMenuItemIsRow,contextMenuPosition:cn,contextMenuTarget:dn,targetShouldSkipNextHit:targetShouldSkipNextHit,targetWithinMenu:targetWithinMenu,useContextMenuActions:useContextMenuActions});const fn=o({key:"boxSelectionEnabled",default:!1}),gn=o({key:"boxSelectionOperationType",default:"clearAndSelect"}),useBoxSelectionActions=()=>({enable:useActionCallback((({set:e})=>()=>{e(fn,!0)})),disable:useActionCallback((({reset:e})=>async()=>{e(fn),e(gn)})),setOperationType:useActionCallback((({set:e})=>t=>{e(gn,t)}))});var yn=Object.freeze({__proto__:null,boxSelectionEnabled:fn,boxSelectionOperationType:gn,useBoxSelectionActions:useBoxSelectionActions});async function whenComponentReady(e,t,n=customElements,a=requestAnimationFrame,i=setTimeout){return null!=e&&null!=e.nodeName&&await n.whenDefined(e.nodeName.toLowerCase()),"function"==typeof e?.componentOnReady?(await(e?.componentOnReady()),t()):(await new Promise((e=>"function"==typeof a?a(e):i(e))),t())}const vn=o({key:"isEditingPointToPointMeasurement",default:!1}),bn=o({key:"pointToPointMeasurementOutcome",default:void 0}),wn=o({key:"editedPointToPointMeasurement",default:void 0});function usePointToPointMeasurement(e){const t=c(bn);T((()=>{let n;return whenComponentReady(e,(()=>{n=e?.measurementModel.onOutcomeChanged(t)})),()=>n?.dispose()}),[e,t])}const Cn=2,Sn=o({key:"isEditingPreciseMeasurement",default:!1}),xn=o({key:"preciseMeasurementOutcome",default:void 0}),kn=o({key:"preciseMeasurementController",dangerouslyAllowMutability:!0,default:void 0}),An=o({key:"preciseMeasurementOverlays",dangerouslyAllowMutability:!0,default:void 0}),Tn=o({key:"preciseMeasurementEntities",dangerouslyAllowMutability:!0,default:[]}),Pn=r({key:"preciseMeasurementMessage",get:({get:e})=>{const t=undefined;return 0===e(Tn).length?"Select a surface":void 0}});function usePreciseMeasurementModel(e,t,n){const a=c(Tn),i=c(xn),o=c(kn),r=c(An),l=s(kn);T((()=>{let n;return whenComponentReady(e,(()=>{n=e?.measurementModel.onEntitiesChanged((e=>{a(e),t?.(e)}))})),()=>n?.dispose()}),[e,a]),T((()=>{let t;return whenComponentReady(e,(()=>{t=e?.measurementModel.onOutcomeChanged((e=>{i(e),n?.(e)}))})),()=>t?.dispose()}),[e,i]),T((()=>{let t;return whenComponentReady(e,(()=>{t=e?.measurementModel.onEntitiesChanged((e=>{if(e.length>2){const t=e[2];l?.setEntities(new Set([t]))}}))})),()=>t?.dispose()}),[e,l]),T((()=>{whenComponentReady(e,(()=>{o(e?.measurementController)}))}),[e,o]),T((()=>{whenComponentReady(e,(()=>{r(e?.measurementOverlays)}))}),[e,r])}function useMeasurementActions(){const e=useBoxSelectionActions(),t=useEnablePointToPointMeasurement(),n=useDisablePointToPointMeasurement(),a=useDisablePreciseMeasurement(),i=useActionCallback((({snapshot:e})=>async()=>{const t=await e.getPromise(kn);t?.clearEntities()})),o=useActionCallback((()=>async(e={})=>{await i(),n(e),a()})),r=useActionCallback((({set:e,reset:n})=>async a=>{await o(),"point-to-point"===a?t():(n(xn),n(Tn),e(Sn,!0))}));return{disableEditMeasurement:useActionCallback((()=>async e=>{await o(e)})),enableEditMeasurement:useActionCallback((()=>async e=>{await r(e)})),resetMeasurement:useActionCallback((({snapshot:e,reset:t})=>async()=>{const n=await e.getPromise(Sn),a=await e.getPromise(vn);n?await i():a&&(t(bn),t(wn))})),clearEditedPointToPointMeasurement:useActionCallback((({reset:e})=>()=>{e(wn)})),setEditedPointToPointMeasurement:useActionCallback((({set:e})=>t=>{e(wn,t)})),toggleEditPointToPointMeasurement:useActionCallback((({snapshot:t})=>async()=>{const n=undefined;await t.getPromise(vn)?await o():await r("point-to-point"),e.disable()})),toggleEditPreciseMeasurement:useActionCallback((({snapshot:t})=>async()=>{const n=undefined;await t.getPromise(Sn)?await o():await r("precise"),e.disable()}))}}function useEnablePointToPointMeasurement(){return useActionCallback((({reset:e,set:t})=>(n={})=>{t(vn,!0),n.keepExistingMeasurement||e(bn)}))}function useDisablePointToPointMeasurement(){return useActionCallback((({reset:e})=>(t={})=>{e(vn),t.keepExistingMeasurement||(e(wn),e(bn))}))}function useDisablePreciseMeasurement(){return useActionCallback((({reset:e})=>async()=>{e(Sn),e(xn),e(Tn)}))}const Mn=r({key:"isEditingMeasurement",get:({get:e})=>e(vn)||e(Sn)}),En=r({key:"measurementPanelModel",get:({get:e})=>e(bn)||e(xn)}),In=r({key:"measurementPanelOverlays",dangerouslyAllowMutability:!0,get:({get:e})=>e(An)}),Nn=r({key:"measurementPanelMessage",get:({get:e})=>{const t=undefined;return e(Sn)?e(Pn):void 0}}),On=r({key:"measurementPanelIsResettable",get:({get:e})=>e(Mn)&&null!=e(En)});var Vn=Object.freeze({__proto__:null,editedPointToPointMeasurement:wn,isEditingMeasurement:Mn,isEditingPointToPointMeasurement:vn,isEditingPreciseMeasurement:Sn,measurementPanelIsResettable:On,measurementPanelMessage:Nn,measurementPanelOutcome:En,measurementPanelOverlays:In,pointToPointMeasurementOutcome:bn,preciseMeasurementController:kn,preciseMeasurementEntities:Tn,preciseMeasurementMessage:Pn,preciseMeasurementOutcome:xn,preciseMeasurementOverlays:An,useDisablePointToPointMeasurement:useDisablePointToPointMeasurement,useDisablePreciseMeasurement:useDisablePreciseMeasurement,useEnablePointToPointMeasurement:useEnablePointToPointMeasurement,useMeasurementActions:useMeasurementActions,usePointToPointMeasurement:usePointToPointMeasurement,usePreciseMeasurementModel:usePreciseMeasurementModel});const useHitActions=()=>{const e=useCrossSectioningActions(),t=useMeasurementActions(),n=useTransformActions(),a=useActionCallback(retainSnapshot((({snapshot:e})=>async()=>{const n=await e.tryGetPromise(Ht).then((e=>e.value)),a=await e.getPromise(wn);null==n&&null!=a?.start&&null!=a.end&&await t.resetMeasurement()}))),i=useActionCallback(retainSnapshot((({snapshot:e})=>async()=>{const t=await e.tryGetPromise(Ht).then((e=>e.value));await n.orientToHitResult(t)}))),o=useActionCallback(retainSnapshot((({set:e,snapshot:t})=>async()=>{const n=await t.tryGetPromise(Ht).then((e=>e.value));e(un,n)}))),r=useActionCallback(retainSnapshot((({snapshot:e,set:t})=>async()=>{t(Bt,await e.tryGetPromise(Ht).then((e=>e.value)))})));return{tap:useActionCallback(retainSnapshot((({snapshot:t,set:n})=>async({detail:s},...l)=>{const c=await t.getPromise(Mn),d=await t.getPromise(kt),u=2!==s?.buttons&&!s?.altKey;s.altKey||s.ctrlKey||s.metaKey||s.shiftKey;const m=u&&!d.hitPending&&!c,p=await t.tryGetPromise(Ht).then((e=>e.value));n(zt,p),n(Rt,s),await a(),m&&(l.forEach((e=>e())),await i()),await o(),await e.sectionCurrentHit(),await r()}))),longPress:useActionCallback(retainSnapshot((({snapshot:e,set:t,reset:n})=>async a=>{n(Rt),t(Dt,a.detail),await e.tryGetPromise(Ht),await o(),await r()})))}},Ln=r({key:"viewerToolkitHitState",get:({get:e})=>{const t=undefined,n=undefined,a=undefined,i=undefined,o=undefined;return{tapDetails:e(Rt),longPressDetails:e(Dt),previousHitResult:e(zt),currentHitResult:e(Bt)}}});var _n=Object.freeze({__proto__:null,currentHitResult:Bt,hitResult:Ht,hitResultsLongPressDetails:Dt,hitResultsSkipNextTap:jt,hitResultsTapDetails:Rt,hitState:Ln,previousHitResult:zt,useHitActions:useHitActions});function useSceneAnnotationsOperations(){const e=A.useCallback((async(e,t,n)=>{const a=await(t?.scene());null==n?await(a?.elements((t=>e(t.annotations.where((e=>e.all()))))).execute()):n.length>0&&await(a?.elements((t=>e(t.annotations.where((e=>e.withAnnotationIds(n)))))).execute())}),[]),t=A.useCallback((async(e,t)=>{const n=await(e?.scene());n?.elements((e=>[e.annotations.where((e=>e.all())).deselect(),e.annotations.where((e=>e.withAnnotationIds([t]))).select()])).execute()}),[]),n=A.useCallback((async e=>{const t=await(e?.scene());t?.elements((e=>[e.annotations.where((e=>e.all())).deselect()])).execute()}),[]);return{sceneAnnotationsOperation:e,selectOnlyAnnotation:t,clearAnnotationSelection:n}}function usePmiAnnotationActions(){const e=useSceneAnnotationsOperations(),t=useActionCallback((({snapshot:e,set:t})=>async n=>{const a=await e.getPromise(Aa(n));if(null!=a){t(va(n),(e=>[...e,a])),t(ba(n),(e=>[...e,...a.annotations]));const e=a?.paging?.next;t(ga(n),null!=e?()=>e:()=>{})}})),n=useActionCallback((({snapshot:e})=>async a=>{const i=document.getElementById(`annotation-entry-${a}`);if(null!=i)i.scrollIntoView();else{const i=await e.getPromise(Ca),o=i?.modelView.id;if(null==o)return;const r=undefined;await e.getPromise(Pa(o))&&(await t(o),await n(a))}}));return{fetchInitialPmiAnnotations:useActionCallback((({snapshot:e})=>async n=>{const a=undefined;0===(await e.getPromise(Ta(n))).length&&await t(n)})),fetchNextPmiAnnotations:useActionCallback((()=>async e=>{await t(e)})),selectPmiAnnotation:useActionCallback((({set:t,snapshot:a})=>async(i,o)=>{t(Ma,i);const r=await a.getPromise(et);null!=r&&await(e?.selectOnlyAnnotation(r,i)),o&&await n(i)})),clearPmiAnnotationSelection:useActionCallback((({reset:t,snapshot:n})=>async()=>{const a=await n.getPromise(Ma),i=await n.getPromise(et);null!=a&&null!=i&&(t(Ma),await(e?.clearAnnotationSelection(i)))})),scrollToSelectedPmiAnnotation:n}}const Rn=o({key:"sceneTreeLoaderVisible",default:!1}),Dn=o({key:"sceneTreeElement",default:void 0}),zn=o({key:"sceneTreeController",default:void 0,dangerouslyAllowMutability:!0}),Bn=o({key:"sceneTreeOpenPopover",default:void 0}),Hn=d({key:"sceneTreePopoverIsOpen",get:e=>({get:t})=>t(Bn)===e});function useSceneTreeActions(){const e=useSelectionActions(),t=useViewerCameraActions();return{toggleSelection:useActionCallback((({snapshot:t})=>async(n,a,i)=>{if(!n.defaultPrevented&&0===n.button&&(n.altKey||((n.ctrlKey||n.metaKey)&&a.selected?await i.deselectItem(a):a.selected?await i.selectItem(a,{recurseParent:!0}):a.selected||await i.selectItem(a,{append:n.ctrlKey||n.metaKey,range:n.shiftKey})),null!=a.id)){const i=await t.getPromise($t);e.syncSelection({id:a.id?.hex,ancestors:i?.ancestors??[]},{selected:!n.metaKey&&!n.ctrlKey||!a.selected,multiSelect:n.shiftKey||n.metaKey||n.ctrlKey})}})),toggleExpansion:useActionCallback((()=>(e,t,n)=>{n.toggleExpandItem(t)})),toggleVisibility:useActionCallback((()=>(e,t,n)=>{n.toggleItemVisibility(t)})),flyToRow:useActionCallback((({snapshot:e})=>async n=>{const a=await e.getPromise(Dn),i=await(a?.getRowAtClientY(n));null!=i?.node.id?.hex&&await t.flyToById(i.node.id.hex)})),flyToFirstSelectedItem:useActionCallback((({snapshot:e})=>async()=>{const t=await e.getPromise(Dn),n=await e.getPromise(Jt);null!=n&&t?.scrollToItem(n)})),setContextMenuItem:useActionCallback((({set:e,snapshot:t})=>async n=>{const a=await t.getPromise(Dn),i=await(a?.getRowAtClientY(n));e(un,i)})),openSceneTreePopover:useActionCallback((({set:e})=>t=>{e(Bn,t)})),closeSceneTreePopover:useActionCallback((({set:e})=>()=>{e(Bn,void 0)}))}}var jn=Object.freeze({__proto__:null,sceneTreeController:zn,sceneTreeElement:Dn,sceneTreeLoaderVisible:Rn,sceneTreeOpenPopover:Bn,sceneTreePopoverIsOpen:Hn,useSceneTreeActions:useSceneTreeActions});function useSelectionActions(){const e=usePmiAnnotationActions(),t=useSceneViewItemActions(),n=useTransformActions(),a=useViewerSceneActions(),i=useActionCallback((({snapshot:e,reset:t})=>async()=>{const n=undefined;(await e.getPromise(Kt)).forEach((e=>t(Gt(e))))})),o=useActionCallback((({snapshot:e,reset:t,set:n})=>async(i,o)=>{const r=await e.getPromise(Gt(i.id)),s=await e.getPromise(Kt),l=[...i.ancestors??[]]?.reverse().find((e=>!s.includes(e)));null!=r&&null!=l?(n(Gt(l),{id:l}),n(Kt,(e=>[...e,l])),n(Zt,!0),await a.execute(Wt.SELECTING_ANCESTOR,a.selectItemsTransform(l)),await m({id:l})):o?.clear?(n(Gt(i.id),i),n(Kt,[i.id]),await a.execute(Wt.SELECTING_ONLY_ITEM,a.clearSelectionTransform,a.selectItemsTransform(i.id)),await m(i)):(n(Gt(i.id),i),n(Kt,(e=>[...e,i.id])),await a.execute(Wt.SELECTING_ITEMS,a.selectItemsTransform(i.id)),await m(i)),n($t,i),n(qt,!0),t(Yt);try{const t=await e.getPromise(Dn);await(t?.scrollToItem(i.id))}catch(e){logger_debug(`The scene item was not found in the tree. [itemId={${i.id}}]`)}})),r=useActionCallback((({reset:e,set:t})=>async n=>{e(Gt(n)),e(Yt),e(Zt),t(Kt,(e=>e.filter((e=>e!==n)))),await a.execute(Wt.DESELECTING_ITEMS,a.deselectItemsTransform(n))})),s=useActionCallback((({snapshot:e})=>async t=>{const n=await e.getPromise(Gt(t.id));null!=n?await r(n.id):await o(t)})),l=useActionCallback((({snapshot:a,reset:i,set:r})=>async(s,l={})=>{const c=await a.getPromise(Gt(s.id)),d=await a.getPromise(Kt);if(d.filter((e=>e!==s.id&&!s.ancestors?.includes(e))).forEach((e=>i(Gt(e)))),i(Yt),i(Zt),c)if(l.ignoreAncestorSelection)i(Kt),i(Gt(c.id));else{const e=d.filter((e=>e===s.id||s.ancestors?.includes(e)));r(Kt,e)}else i(Kt);t.invalidateCachedItems(),n.clearTransformWidgetOrientation(),await e.clearPmiAnnotationSelection(),await o(s,{clear:!0})})),c=useActionCallback((({reset:t})=>async()=>{await i(),t(Kt),t($t),t(qt),t(Yt),t(Zt),n.clearTransformWidgetPosition(),n.clearTransformWidgetOrientation(),await e.clearPmiAnnotationSelection()})),d=useActionCallback((()=>async()=>{await c(),await a.execute(Wt.CLEAR_SELECTION,a.clearSelectionTransform)})),u=useActionCallback((({set:e})=>async t=>{e(Yt,t)})),m=useActionCallback((({set:e,snapshot:t})=>async n=>{const a=await t.getPromise(sn);a?.id!==n?.id&&e(sn,n)}));return{select:o,toggleSelection:s,clearAndSelect:l,selectCurrentHit:useActionCallback(retainSnapshot((({snapshot:t})=>async()=>{const n=await t.tryGetPromise(Ht).then((e=>e.value)),a=await t.getPromise(Rt),i=a?.metaKey||a?.ctrlKey||a?.shiftKey;null!=n?.annotationId?await e.selectPmiAnnotation(n.annotationId,!0):null==n||i?null!=n&&i?await s(n):await d():await l(n)}))),syncSelection:useActionCallback((({set:e,snapshot:t,reset:n})=>async(a,o)=>{if(o.selected){const n=await t.getPromise(Gt(a.id)),r=await t.getPromise(zn);if(null!=n&&null!=r){const n=undefined,i=(await(r?.fetchNodeAncestors(a.id))).map((e=>e.id?.hex)).filter((e=>null!=e)),s=await t.getPromise(Kt),l=[...i??[]]?.findLastIndex((e=>s.includes(e)));if(i.length>0&&l<i.length-1){const t=i[l+1];return e(Zt,!0),e($t,{id:t}),e(Gt(t),{id:t}),e(Kt,(e=>[...e.filter((e=>e!==t)),t])),e(qt,!1),e(Yt,!!o.multiSelect),void await m({id:t})}}await i(),e(Gt(a.id),a),o.multiSelect?e(Kt,(e=>[...e.filter((e=>e!==a.id)),a.id])):e(Kt,[a.id]),await m(a),e($t,a),e(qt,!1),e(Yt,!!o.multiSelect)}else n(Gt(a.id)),n(Yt),e(Kt,(e=>e.filter((e=>e!==a.id))))})),deselect:r,clearSelection:d,resetSelectionState:c,toggleLastSelectWasMultiSelect:u,selectForModelViewsPanel:m}}const Fn=r({key:"viewerToolkitSelectionState",get:({get:e})=>{const t=undefined,n=undefined,a=undefined,i=undefined;return{selectedItemIds:e(Kt),lastSelected:e($t),highestSelectedAncestorId:e(Qt)}}});var Wn=Object.freeze({__proto__:null,fetchedAndSelectedItems:rn,selectionBoundingBoxCenter:an,selectionFirstSelectedItemInTreeId:Jt,selectionHasMultipleSelected:Xt,selectionHighestSelectedAncestor:Qt,selectionIsActive:on,selectionIsAncestorSelection:Zt,selectionLastSelectWasMultiSelect:Yt,selectionLastSelected:$t,selectionLastSelectionFromViewer:qt,selectionModelViewsSelected:sn,selectionPreviousVisibleSummary:en,selectionSelectedItemIds:Kt,selectionSelectedItems:Gt,selectionState:Fn,selectionVisibleCount:nn,selectionVisibleSummary:tn,useSelectionActions:useSelectionActions});const Un=o({key:"lengthUnit",default:"cm"}),Gn=o({key:"decimalPlace",default:"2"});var Kn=Object.freeze({__proto__:null,decimalPlace:Gn,lengthUnit:Un}),$n,qn;!function(e){e.mm="millimeters",e.cm="centimeters",e.m="meters",e.in="inches",e.ft="feet"}($n||($n={})),function(e){e[e.mm=1]="mm",e[e.cm=.1]="cm",e[e.m=.001]="m",e[e.in=.03937007874015748]="in",e[e.ft=.0032808398950131233]="ft"}(qn||(qn={}));const convertFrom=(e,t)=>{const n=undefined;return e/qn[t]},convertTo=(e,t)=>{const n=undefined;return e*qn[t]},formatWithUnit=(e,t,n)=>`${e.toFixed(n)} ${t}`,formatDistance=(e,t,n)=>formatWithUnit(convertTo(e,t),t,n),createDistanceFormatter=(e,t)=>n=>formatDistance(n,e,t);function toUnitType(e){switch(e){case"cm":return"centimeters";case"m":return"meters";case"in":return"inches";case"ft":return"feet";default:return"millimeters"}}function pickLocalOrWorldTransform(e,t){return"local"===t?e.local:e.world}function mapItemTransforms(e,t){return{local:t(e.local),world:t(e.world)}}function makeItemTransforms(e,t,n){return"local"===n?{local:e,world:N(e,t)}:{world:e,local:O(e,t)}}function convertTransformToUnits(e,t){const{position:n,rotation:a,scale:i}=e;return{position:v.create(convertTo(n.x,t),convertTo(n.y,t),convertTo(n.z,t)),rotation:a,scale:i}}function convertTransformFromUnits(e,t){const{position:n,rotation:a,scale:i}=e;return{position:v.create(convertFrom(n.x,t),convertFrom(n.y,t),convertFrom(n.z,t)),rotation:a,scale:i}}function toValidTransform(e){const{position:t,rotation:n,scale:a}=e;return{position:{x:t.x||0,y:t.y||0,z:t.z||0},rotation:{x:n.x||0,y:n.y||0,z:n.z||0},scale:a||1}}function scale(e){const t=parseFloat(Math.sqrt(e[0]**2+e[4]**2+e[8]**2).toFixed(2)),n=parseFloat(Math.sqrt(e[1]**2+e[5]**2+e[9]**2).toFixed(2)),a=parseFloat(Math.sqrt(e[2]**2+e[6]**2+e[10]**2).toFixed(2));return t===n&&n===a?t:NaN}function translation(e){return{x:e[12],y:e[13],z:e[14]}}function rotation(e){const t=e.map((t=>t*(1/scale(e))));return t[8]<1?t[8]>-1?{x:Math.atan2(-t[9],t[10])*(180/Math.PI),y:Math.asin(t[8])*(180/Math.PI),z:Math.atan2(-t[4],t[0])*(180/Math.PI)}:{x:-Math.atan2(-t[1],t[5])*(180/Math.PI),y:-90,z:0}:{x:Math.atan2(t[1],t[5])*(180/Math.PI),y:90,z:0}}function toTransformFromApiMatrix(e){return null!=e?{position:translation(e),rotation:rotation(e),scale:scale(e)}:void 0}const Yn={position:v.create(0,0,0),rotation:v.create(0,0,0),scale:1},Xn=o({key:"transformWidgetEnabled",default:!1}),Zn=o({key:"transformWidgetPosition",default:void 0}),Jn=o({key:"transformWidgetOrientationOverride",default:void 0}),Qn=r({key:"transformWidgetOrientation",get:({get:e})=>{const t=e(Jn),n=e($t);if(null!=t)return t;if(null!=n){const t=e(la(n.id));return w.fromDegrees({x:t?.world.rotation.x,y:t?.world.rotation.y,z:t?.world.rotation.z})}}}),ea=o({key:"transformWidgetCachedOrientation",default:void 0}),ta=o({key:"transformWidgetSyncToSelection",default:!1}),na=o({key:"transformWidgetIsInteracting",default:!1}),aa=l({key:"appliedItemTransform",default:void 0}),ia=o({key:"appliedItemTransformIds",default:[]}),oa=o({key:"selectedCoordinateSpace",default:"world"}),ra=l({key:"editedItemTransform",default:void 0}),sa=d({key:"displayedItemTransform",get:e=>({get:t})=>{if(null!=e){const n=t(oa),a=t(Un),i=t(la(e)),o=t(ra(e));if(null!=o)return o.transform;if(null!=i)return pickLocalOrWorldTransform(mapItemTransforms(i,(e=>convertTransformToUnits(e,a))),n)}},set:e=>({get:t,set:n},a)=>{if(null!=e){const i=t(oa),o=t(da(e)),r=t(la(e)),s=t(Un);if(null!=r&&!(a instanceof u)&&null!=a&&null!=o){n(ra(e),{coordinateSpace:i,units:s,transform:a});const r=makeItemTransforms(convertTransformFromUnits(toValidTransform(a),s),o,i),l=t(ia);n(aa(e),r),n(ia,[...l,e])}}}}),la=d({key:"fetchedItemTransforms",get:e=>({get:t})=>{const n=t(pa(e));if(null!=n){const e=n.override?.transform?toTransformFromApiMatrix(n.override?.transform):void 0,t=n.worldTransform?toTransformFromApiMatrix(n.worldTransform):void 0;return{local:e??Yn,world:t??Yn}}}}),ca=o({key:"transformInvalidator",default:0}),da=d({key:"parentItemWorldMatrix",get:e=>({get:t})=>{const n=t(ot);if(null!=e&&null!=n){const n=t(pa(e));if(null!=n?.parentId){const e=t(la(n.parentId)),a=t(aa(n.parentId));if(null==e)throw new Error("Invalid state. Parent item state should be populated, but is undefined.");return V(L(null!=a?a.world:e.world))}}return logger_debug(`Unable to find the world matrix for the parent of ${e}. Returning the identity matrix.`),C.makeIdentity()}});function useUpdateEditedTransformWhenSettingsChange(e){const t=s(Un),n=s(oa),a=s(aa(e??"")),[i,o]=h(ra(e??""));T((()=>{if(null!=a&&(i?.coordinateSpace!==n||i?.units!==t)){const e=undefined,i=convertTransformToUnits(pickLocalOrWorldTransform(a,n),t);o({units:t,coordinateSpace:n,transform:i})}}),[t,n])}function useEditItemTransform(e){const t=useTransformActions();useUpdateEditedTransformWhenSettingsChange(e);const n=m(da(e)),[a,i]=p(sa(e));return{transform:"hasValue"===a.state?a.contents:void 0,loading:"loading"===a.state||"loading"===n.state,error:"hasError"===a.state?a.contents:void 0,async update(n){t.enableSelectionSync(),i(n),null!=e&&await t.applyTransformToItem(e)}}}const useTransformActions=()=>{const e=useApplicationMessageActions(),t=useViewerSceneActions(),n=useActionCallback((({set:e,snapshot:t})=>async()=>{const n=await t.getPromise(an);e(Zn,n)})),a=useActionCallback((({set:e,snapshot:t})=>async()=>{const a=await t.getPromise(Zn),i=await t.getPromise(Yt),o=await t.getPromise(Kt),r=await t.getPromise(nn);null==a&&(o.length>0||i||r>0)&&await n(),e(ta,!0)})),i=useActionCallback((({set:e})=>async t=>{e(Zn,t??void 0)})),o=useActionCallback(retainSnapshot((({snapshot:e,set:t,reset:n})=>async()=>{const a=await e.getPromise(Qn),i=undefined;(await e.getPromise(ia)).forEach((e=>{n(aa(e)),n(ra(e))})),n(ia),null!=a&&t(ea,a),t(ca,(e=>e+1))}))),r=useActionCallback((({set:e,reset:t})=>n=>{t(ea),e(Jn,n)})),s=useActionCallback((({set:e})=>()=>{e(Zn,void 0),e(Xn,!1)}));return{enableTransformWidget:useActionCallback((({set:t})=>async(o,r)=>{e.setToastMessage({message:"Transform manipulator enabled! Select parts to interact.",duration:Ke}),t(Xn,!0),r?await n():null==o?await a():await i(o)})),disableTransformWidget:useActionCallback((({reset:e})=>()=>{e(Xn),e(Jn)})),setTransformWidgetOrientation:r,clearTransformWidgetOrientation:useActionCallback((({reset:e})=>()=>{e(ea),e(Jn)})),setTransformWidgetPosition:i,clearTransformWidgetPosition:useActionCallback((({reset:e})=>()=>e(Zn))),invalidateTransforms:o,setIsInteractivelyTransforming:useActionCallback((({set:e})=>t=>{e(na,t)})),setDefaultWidgetPosition:a,setDefaultWidgetPositionToSelection:n,enableSelectionSync:useActionCallback((({set:e})=>()=>e(ta,!0))),disableSelectionSync:useActionCallback((({reset:e})=>()=>e(ta))),syncToSelection:useActionCallback((({snapshot:e})=>async()=>{const t=await e.getPromise(en),n=await e.getPromise(tn),a=undefined;if(await e.getPromise(ta)){const e=n?.boundingBox,a=null!=e&&null!=t?.boundingBox&&equals(e,t.boundingBox);null==e||a||await i(g.center(e))}})),orientToHitResult:useActionCallback((({reset:e})=>async t=>{e(ta),null==t?.annotationId&&(null!=t?await i(t?.position):(e(Zn),r(void 0)))})),clearSelectedTransforms:useActionCallback((()=>async()=>{await t.execute(Wt.CLEAR_SELECTED_TRANSFORMS,(e=>e.where((e=>e.withSelected())).clearTransforms())),await o(),s()})),clearAllTransforms:useActionCallback((()=>async()=>{await t.execute(Wt.CLEAR_SELECTED_TRANSFORMS,(e=>e.where((e=>e.all())).clearTransforms())),await o(),s()})),applyTransformToItem:useActionCallback((({snapshot:e})=>async t=>{const n=await e.getPromise(et),a=await(n?.scene()),i=await e.getPromise(aa(t));if(null==i)return void logger_warn(`There is no transform to apply to item ${t}.`);const o=C.transpose(V(L(i?.local)));return a?.items((e=>e.where((e=>e.withItemId(t))).transform(o))).execute()}))}};var ua=Object.freeze({__proto__:null,appliedItemTransformIds:ia,appliedItemTransforms:aa,convertTransformFromUnits:convertTransformFromUnits,convertTransformToUnits:convertTransformToUnits,displayedItemTransform:sa,editedItemTransform:ra,fetchedItemTransforms:la,identityTransform:Yn,makeItemTransforms:makeItemTransforms,mapItemTransforms:mapItemTransforms,parentItemWorldMatrix:da,pickLocalOrWorldTransform:pickLocalOrWorldTransform,selectedCoordinateSpace:oa,toValidTransform:toValidTransform,transformInvalidator:ca,transformWidgetCachedOrientation:ea,transformWidgetEnabled:Xn,transformWidgetIsInteracting:na,transformWidgetOrientation:Qn,transformWidgetOrientationOverride:Jn,transformWidgetPosition:Zn,transformWidgetSyncToSelection:ta,useEditItemTransform:useEditItemTransform,useTransformActions:useTransformActions});const ma=o({key:"fetchedItemInvalidator",default:0}),pa=d({key:"fetchedItems",get:e=>async({get:t})=>{const n=t(et),a=t(ot);if(t(ma),t(ca),null!=a)try{return await(n?.sceneItems?.getSceneViewItem(e,a,{includeOverride:!0,includeWorldTransform:!0}))}catch(t){return void logger_debug(`Error encountered get scene view item. [itemId={${e}}]`,t)}}});function useSceneViewItemActions(){return{invalidateCachedItems:useActionCallback((({set:e})=>()=>{e(ma,(e=>e+1))}))}}var ha=Object.freeze({__proto__:null,fetchedItem:pa,fetchedItemInvalidator:ma,useSceneViewItemActions:useSceneViewItemActions});const fa=l({key:"modelViewsCursor",default:void 0}),ga=l({key:"pmiAnnotationsCursor",default:void 0}),ya=l({key:"loadedModelViews",default:[]}),va=l({key:"loadedPmiAnnotations",default:[]}),ba=l({key:"visiblePmiAnnotations",default:[]}),wa=r({key:"modelViewsSceneItemName",get:async({get:e})=>{const t=e(sn);if(null!=t){const n=e(pa(t.id));return n?.name??void 0}}}),Ca=o({key:"loadedItemModelView",default:void 0}),Sa=d({key:"nextModelViews",get:e=>async({get:t})=>{const n=t(et),a=t(fa(e));return await(n?.modelViews?.listByItem(e,{cursor:a,size:100,hasAnnotations:!0}))}}),xa=d({key:"modelViews",get:e=>({get:t})=>{const n=t(ya(e)),a=t(Sa(e));return n.flatMap((e=>e.modelViews)).concat(a?.modelViews??[])}}),ka=d({key:"hasMoreModelViews",get:e=>({get:t})=>{const n=t(Sa(e));return null!=n?.paging.next}}),Aa=d({key:"nextPmiAnnotations",get:e=>async({get:t})=>{const n=t(et),a=t(ga(e));return n?.pmi?.listAnnotations({modelViewId:e,cursor:a,size:100})}}),Ta=d({key:"pmiAnnotations",get:e=>({get:t})=>{const n=undefined;return t(va(e)).flatMap((e=>e.annotations))}}),Pa=d({key:"hasMorePmiAnnotations",get:e=>({get:t})=>{const n=undefined;return null!=t(ga(e))}}),Ma=o({key:"selectedPmiAnnotationId",default:void 0}),Ea=1e3;function useModelViewActions(){const e=useCrossSectioningActions(),t=usePmiAnnotationActions(),n=useSelectionActions(),a=useActionCallback((({snapshot:e})=>async()=>{const a=undefined;if(null!=await e.getPromise(Ca)){const a=await e.getPromiseRequired(et),i=await e.getPromiseRequired(Kt);await t.clearPmiAnnotationSelection(),0!==i.length&&await n.clearSelection(),await(a?.modelViews?.unload())}}));return{fetchNextModelViews:useActionCallback((({snapshot:e,set:t})=>async n=>{const a=await e.getPromise(Sa(n));if(null!=a){const e=a?.paging?.next;null!=e&&(t(ya(n),(e=>[...e,a])),t(fa(n),(()=>e)))}})),loadModelView:useActionCallback((({set:n,snapshot:i})=>async(o,r)=>{const s=await i.getPromiseRequired(et);try{const i=await s.scene();await e.setHighlightColorAndLineWidth(),await e.disable(),await a(),null!=i&&await(i?.camera().flyTo({camera:r.camera}).render({animation:{milliseconds:Ea}})),await(s?.modelViews?.load(o,r.id)),n(Ca,{itemId:o,modelView:r}),await t.fetchInitialPmiAnnotations(r.id)}catch(e){logger_error("Failed to load model view",e)}})),clearModelView:useActionCallback((({reset:e,snapshot:t})=>async()=>{const n=undefined;if(null!=await t.getPromise(Ca))try{await a(),e(Ca)}catch(e){logger_error("Failed to remove model view",e)}}))}}var Ia=Object.freeze({__proto__:null,MODEL_VIEW_ANIMATION_DURATION:Ea,hasMoreModelViews:ka,hasMorePmiAnnotations:Pa,loadedItemModelView:Ca,loadedModelViews:ya,loadedPmiAnnotations:va,modelViews:xa,modelViewsCursor:fa,modelViewsSceneItemName:wa,nextModelViews:Sa,nextPmiAnnotations:Aa,pmiAnnotations:Ta,pmiAnnotationsCursor:ga,selectedPmiAnnotationId:Ma,useModelViewActions:useModelViewActions,visiblePmiAnnotations:ba});const alignToNormal=(e,t,n)=>{if(e.toFrameCamera().isPerspective()){const n=v.dot(v.normalize(e.up),t),a=Math.abs(n)>.98?v.normalize(v.scale(-n,e.viewVector)):e.up,i=v.add(v.scale(v.distance(e.position,e.lookAt),v.multiply(t,v.create(-1,-1,-1))),e.lookAt);return e.update({up:a,position:i})}{const a=v.angleTo(v.normalize(e.viewVector),t),i=null!=n?g.center(n):e.lookAt,o=v.normalize(v.cross(v.normalize(e.viewVector),t));return e.rotateAroundAxisAtPoint(a,i,o)}};function isParallelTo(e,t){const n=S.toDegrees(v.angleTo(e,t));return 0===n||180===n}const Na=500;function useCrossSectioningActions(){const e=useActionCallback((({snapshot:e})=>async()=>{const t=await e.getPromise(vt),n=await e.getPromise(yt),a=await e.getPromise(xt),i=await e.getPromise(et),o=await(i?.scene());await(o?.crossSectioning().update({sectionPlanes:a,highlightColor:n?Pe.fromHexString(n):void 0,lineWidth:t}))})),t=useActionCallback((({snapshot:e})=>async()=>{const t=await e.getPromise(yt),n=await e.getPromise(vt),a=await e.getPromise(et),i=await(a?.scene()),o=i?.crossSectioning().current();await(i?.crossSectioning().update({sectionPlanes:o?.sectionPlanes??[],highlightColor:t?Pe.fromHexString(t):void 0,lineWidth:n}))})),n=useActionCallback((({set:t,reset:n,snapshot:a})=>async()=>{const i=await a.getPromise(et),o=await(i?.scene());if(null!=o){const a=o.camera().viewAll();n(Mt),t(xt,[towardsCamera(o.camera(),x(a.lookAt.x))]),await e()}})),a=useActionCallback(retainSnapshot((({snapshot:t,set:n})=>async()=>{const a=await t.tryGetPromise(Ht).then((e=>e.value)),i=await t.getPromise(et),o=await(i?.scene());if(null!=a&&null!=o){const t=fromHit(a,o.camera());n(xt,null!=t?[t]:[]),n(Mt,null!=t?{x:t.normal}:dt),await e()}}))),i=useActionCallback((({set:e,snapshot:t})=>async()=>{const a=await t.getPromise(xt),i=undefined;await t.getPromise(gt)||(e(gt,!0),0===a.length&&await n())})),o=useActionCallback((({reset:t,snapshot:n})=>async()=>{const a=undefined;await n.getPromise(gt)&&(t(gt),t(Ot),t(Vt),t(Lt),t(xt),t(kt),t(Pt),await e())}));return{enable:i,disable:o,reapply:useActionCallback((({snapshot:n})=>async()=>{const a=await n.getPromise(gt),i=undefined,o=null!=await n.getPromise(Ca);a?await e():o&&await t()})),setHighlightColorAndLineWidth:t,openAdditionalTools:useActionCallback((({set:e,snapshot:t})=>async()=>{const n=undefined;await t.getPromise(gt)||await i(),e(Ot,!0)})),closeAdditionalTools:useActionCallback((({reset:e})=>()=>{e(Ot)})),openAlignmentTools:useActionCallback((({set:e,reset:t})=>()=>{t(Lt),e(Vt,!0)})),closeAlignmentTools:useActionCallback((({reset:e})=>()=>{e(Vt)})),openAxisTools:useActionCallback((({set:e,reset:t})=>()=>{t(Vt),e(Lt,!0)})),closeAxisTools:useActionCallback((({reset:e})=>()=>{e(Lt)})),beginInteraction:useActionCallback((({set:e,snapshot:t})=>async()=>{const n=await t.getPromise(_t);e(Tt,!0),await n.beginInteraction()})),endInteraction:useActionCallback((({reset:e,snapshot:t})=>async()=>{const n=await t.getPromise(_t);e(Tt),await n.endInteraction()})),updatePlanes:useActionCallback(retainSnapshot((({set:t,snapshot:n})=>async a=>{const i=await n.getPromise(xt);if(i.length>0){const o=await n.getPromise(Et),r=await n.getPromise(It),s=o<0?-1*r.max:r.min,l=o<0?-1*r.min:r.max,c=i.map((e=>({...e,offset:Math.min(Math.max(a*o,s),l)})));t(xt,c),await e()}}))),flipPlanes:useActionCallback((({set:t,snapshot:n})=>async()=>{const a=await n.getPromise(xt);t(xt,a.map((e=>invert(e)))),await e()})),alignViewToPlane:useActionCallback((({snapshot:e})=>async()=>{const t=await e.getPromise(xt),n=await e.getPromise(et),a=await(n?.scene());t.length>0&&null!=a&&await alignToNormal(a.camera(),t[0].normal,a.boundingBox()).render({animation:{milliseconds:Na}})})),updateAxis:useActionCallback(retainSnapshot((({set:t,reset:n,snapshot:a})=>async i=>{const o=await a.getPromise(xt),r=await a.getPromise(Mt),s=await a.getPromise(At),l=await a.getPromise(kt),c=await a.getPromise(et),d=await(c?.scene()),u=r[i],m=null!=u&&o.length>0&&isParallelTo(o[0].normal,u)&&!isNaN(v.angleTo(o[0].normal,u));if(null!=d&&!m){const e=await a.tryGetPromise(Ht).then((e=>e.value));t(Pt,i),t(xt,[toAxis(i,r,d.camera(),s,"global"!==l.mode?e?.position:void 0)])}n(Lt),await e()}))),updateAlignment:useActionCallback((({set:e,reset:t})=>async(o,r)=>{t(Vt),e(kt,{mode:o,hitPending:"global"!==o&&null==r}),"global"===o?(t(Pt),t(Mt),await n()):"surface"===o&&null!=r&&(await i(),await a())})),sectionCurrentHit:useActionCallback((({set:e,snapshot:t})=>async()=>{const n=await t.getPromise(kt);n.hitPending&&(e(kt,{...n,hitPending:!1}),"surface"===n.mode&&await a())})),cancelCurrentHit:useActionCallback((({set:e,snapshot:t})=>async()=>{const n=await t.getPromise(kt);n.hitPending&&e(kt,{...n,hitPending:!1})}))}}var Oa=Object.freeze({__proto__:null,DEFAULT_ALIGN_TO_PLANE_ANIMATION_DURATION_MS:Na,DEFAULT_CROSS_SECTION_HIGHLIGHT_COLOR:mt,DEFAULT_CROSS_SECTION_LINE_THICKNESS_VALUE:1,DEFAULT_END_CAPPING_COLOR:ht,DEFAULT_SLIDER_RANGE:ft,get EndCapColorType(){return ut},crossSectioningActiveAxis:Pt,crossSectioningAdditionalToolsOpen:Ot,crossSectioningAlignment:kt,crossSectioningAlignmentToolsOpen:Vt,crossSectioningAvailableAxes:Mt,crossSectioningAxisToolsOpen:Lt,crossSectioningBorderWidth:vt,crossSectioningEnabled:gt,crossSectioningHighlightColor:yt,crossSectioningInteractionHandler:_t,crossSectioningIsInteractive:Tt,crossSectioningOffsetScalar:Et,crossSectioningPlaneDisplayOffset:Nt,crossSectioningPlanes:xt,crossSectioningSliderRange:It,crossSectioningTargetBoundingBox:At,endCapColorType:Ct,endCapCustomColor:St,endCapEnabled:wt,endCapEnabledDefault:bt,useCrossSectioning:useCrossSectioning,useCrossSectioningActions:useCrossSectioningActions});function useDebouncedCallback(e,t){const[n,a]=A.useState();return A.useEffect((()=>()=>{null!=n&&clearTimeout(n)}),[e,t,n]),A.useCallback((i=>{const handler=()=>{e(i)};null!=n&&clearTimeout(n),a(setTimeout(handler,t))}),[e,t,n])}const VertexColorPicker=({onInput:t,...n})=>{const a=useDebouncedCallback((e=>{t?.(e)}),500),i=A.useCallback((e=>{const t=e.target;a(t.value)}),[a]);return e(R,{onInput:i,...n})},VertexCrossSectionAppearanceColorPicker=({onUpdate:t})=>{const n=useCrossSectioningActions(),[a,i]=h(yt);return e(VertexColorPicker,{"data-testid":"cross-section-highlight-color-picker",value:a,onValueChanged:e=>{t?.(e.detail)},onInput:async e=>{i(e),await n.reapply()}})};var Va={exports:{}},La;
14
14
  /*!
15
15
  Copyright (c) 2018 Jed Watson.
16
16
  Licensed under the MIT License (MIT), see
17
17
  http://jedwatson.github.io/classnames
18
- */Gt=Wt,function(){var e={}.hasOwnProperty;function classNames(){for(var e="",t=0;t<arguments.length;t++){var n=arguments[t];n&&(e=appendClass(e,parseValue(n)))}return e}function parseValue(t){if("string"==typeof t||"number"==typeof t)return t;if("object"!=typeof t)return"";if(Array.isArray(t))return classNames.apply(null,t);if(t.toString!==Object.prototype.toString&&!t.toString.toString().includes("[native code]"))return t.toString();var n="";for(var a in t)e.call(t,a)&&t[a]&&(n=appendClass(n,a));return n}function appendClass(e,t){return t?e?e+" "+t:e+t:e}Gt.exports?(classNames.default=classNames,Gt.exports=classNames):window.classNames=classNames}();var Kt=Wt.exports;const VertexSlider=({value:n,defaultValue:a,leftLabel:i,rightLabel:o,onChange:r,onValueChange:s,onValueInput:l,...c})=>{const[d,u]=A.useState(a);return t("div",{className:"flex w-full items-center gap-2",children:[i&&e("div",{className:"pl-0.5 text-xs text-center",children:i}),e(V,{className:Kt("w-full",{"mt-0.5":null!=i||null!=o}),value:n??d,onValueChange:e=>{u(e.detail.value),r?.(e.detail.value),s?.(e)},onValueInput:e=>{u(e.detail.value),r?.(e.detail.value),l?.(e)},...c}),o&&e("div",{className:"text-xs pr-2 flex-shrink-0 text-right",children:o})]})},VertexCrossSectionAppearanceLineThicknessSlider=({onUpdate:t})=>{const n=useCrossSectioningActions(),[a,i]=l(vt);return e(VertexSlider,{id:"cross-section-line-thickness","data-testid":"cross-section-line-thickness-slider",leftLabel:"Off",rightLabel:"Thick",min:0,max:3,step:.5,value:a,valueLabelDisplay:"auto",onValueInput:async e=>{i(e.detail.value),await n.reapply()},onValueChange:e=>{t?.(e.detail.value)}})},VertexEndCapColorOptions=({onUpdateColorType:n})=>{const[a,i]=l(Ct);return e("div",{className:"pl-2 text-sm text-neutral-700",children:t(O,{value:a,"data-testid":"end-capping-color-type-radio-group",name:"end-capping-color-type",onValueChanged:e=>{i(e.detail.toUpperCase()===ut.PART?ut.PART:ut.SINGLE),n?.(e.detail)},children:[e(L,{"data-testid":"end-capping-color-part-color",label:"Part Color",value:ut.PART}),e(L,{"data-testid":"end-capping-color-single-color",label:"Single Color",value:ut.SINGLE})]})})},VertexEndCapColorPicker=({onUpdateCustomColor:t})=>{const[n,a]=l(St);return e(VertexColorPicker,{"data-testid":"end-capping-color-picker",value:n,onValueChanged:e=>{t?.(e.detail)},onInput:e=>a(e)})},VertexEndCapToggle=({onEnabledChange:t})=>{const[n,a]=l(wt);return e(_,{className:"flex items-center","data-testid":"end-capping-enabled-toggle",variant:"switch",checked:n,onValueChanged:async e=>{a(e.detail),t?.(e.detail)}})};function VertexCrossSectionAppearanceControls({onUpdateCrossSectionColor:a,onUpdateCrossSectionLineThickness:i,onEndCapEnabledChange:o,onUpdateEndCapColorType:r,onUpdateEndCapCustomColor:l}){const c=s(Ct);return t(n,{children:[t("div",{className:"flex items-center pt-2 pb-2",children:[e(VertexEndCapToggle,{onEnabledChange:o}),e("span",{className:"pl-4 text-sm text-neutral-700",children:"Show End Cap"})]}),e("div",{className:"pt-2 pb-2 text-sm text-neutral-700",children:"Line Color"}),e(VertexCrossSectionAppearanceColorPicker,{onUpdate:a}),e("div",{className:"pt-4 pb-2 text-sm text-neutral-700",children:"Line Thickness"}),e(VertexCrossSectionAppearanceLineThicknessSlider,{onUpdate:i}),t("div",{children:[e("div",{className:"pt-4 pb-2 text-sm text-neutral-700",children:"Cap Color"}),e(VertexEndCapColorOptions,{onUpdateColorType:r}),c===ut.SINGLE&&e("div",{className:"mt-2",children:e(VertexEndCapColorPicker,{onUpdateCustomColor:l})})]})]})}function PanelSection({header:n,children:a}){return t("div",{className:"py-3 px-4 border-neutral-300 border-b",children:[e("div",{className:"my-2 text-base text-neutral-700",children:n}),a]})}const VertexCrossSectionAppearanceReset=({onReset:t})=>{const n=useCrossSectioningActions(),[a,i]=l(yt),[o,r]=l(vt),c=s(bt),[d,u]=l(wt),[m,p]=l(Ct),[h,f]=l(St),g=a!==mt||1!==o||d!==c||m!==ut.PART||h!==ht;return e("div",{className:"ml-auto",children:e(R,{content:"Reset Cross Sectioning Appearance",children:e(D,{"data-testid":"cross-section-appearance-reset",iconName:"reset",iconSize:"sm",onClick:async()=>{i(mt),r(1),u(c),p(ut.PART),f(ht),t?.(),await n.reapply()},disabled:!g})})})};function VertexCrossSectionAppearancePanelSection({onResetCrossSectionAppearance:n,onUpdateCrossSectionColor:a,onUpdateCrossSectionLineThickness:i,onEndCapEnabledChange:o,onUpdateEndCapColorType:r,onUpdateEndCapCustomColor:s}){return e(PanelSection,{header:t("div",{className:"flex items-center text-base",children:["Cross Sectioning",e(VertexCrossSectionAppearanceReset,{onReset:n})]}),children:e(VertexCrossSectionAppearanceControls,{onUpdateCrossSectionColor:a,onUpdateCrossSectionLineThickness:i,onEndCapEnabledChange:o,onUpdateEndCapColorType:r,onUpdateEndCapCustomColor:s})})}const $t=.5,qt="#444444",Yt=o({key:"featureEdgesSelectedColor",default:qt}),Xt=o({key:"featureEdgesLineThickness",default:$t}),VertexFeatureEdgesColorPicker=({onUpdate:t})=>{const[n,a]=l(Yt);return e(VertexColorPicker,{"data-testid":"feature-edges-color-picker",value:n,onValueChanged:e=>{t?.(e.detail)},onInput:e=>a(e)})},VertexFeatureEdgesThicknessSlider=({onUpdate:t})=>{const[n,a]=l(Xt);return e(VertexSlider,{id:"feature-edges-thickness","data-testid":"feature-edges-thickness-slider",leftLabel:"Off",rightLabel:"Thick",min:0,max:3,step:.5,value:n,valueLabelDisplay:"auto",onValueInput:e=>{a(e.detail.value)},onValueChange:e=>{t?.(e.detail.value)}})};function VertexFeatureEdgesControls({onUpdateFeatureEdgesColor:a,onUpdateFeatureEdgesThickness:i}){return t(n,{children:[e("div",{className:"pt-1 pb-2 text-sm text-neutral-700",children:"Color"}),e(VertexFeatureEdgesColorPicker,{onUpdate:a}),e("div",{className:"pt-4 pb-2 text-sm text-neutral-700",children:"Line Thickness"}),e(VertexFeatureEdgesThicknessSlider,{onUpdate:i})]})}const VertexFeatureEdgesReset=({onReset:t})=>{const[n,a]=l(Yt),[i,o]=l(Xt),r=undefined;return e("div",{className:"ml-auto",children:e(R,{content:"Reset Feature Edges",children:e(D,{"data-testid":"feature-edges-reset",iconName:"reset",iconSize:"sm",onClick:()=>{a(qt),o($t),t?.()},disabled:!(i!==$t||n!==qt)})})})};function VertexFeatureEdgesPanelSection({onResetFeatureEdges:n,onUpdateFeatureEdgesColor:a,onUpdateFeatureEdgesThickness:i}){return e(PanelSection,{header:t("div",{className:"flex items-center text-base",children:["Feature Edges",e(VertexFeatureEdgesReset,{onReset:n})]}),children:e(VertexFeatureEdgesControls,{onUpdateFeatureEdgesColor:a,onUpdateFeatureEdgesThickness:i})})}function contextMenuItemIsRow(e){return null!=e&&null!=e?.node?.id}function contextMenuItemIsElement(e){return null!=e&&e instanceof HTMLElement}const Zt=o({key:"contextMenuActive",default:void 0}),Jt=o({key:"contextMenuPosition",default:void 0}),Qt=o({key:"contextMenuTarget",default:void 0}),en=o({key:"contextMenuItem",default:void 0}),tn=o({key:"contextMenuActions",default:[]}),nn=r({key:"contextMenuActivePosition",get:({get:e})=>null!=e(Zt)?e(Jt):void 0});function useContextMenuActions(){return{pointerDown:useActionCallback((({set:e})=>async t=>{if(2===t.button){const n=t.clientX,a=t?.clientY;e(Jt,w.create(n,a)),e(Qt,t.target)}})),pointerUp:useActionCallback((({snapshot:e,set:t})=>async(n,a,i,o)=>{const r=await e.getPromise(Jt),s=await e.getPromise(Zt);if(null!=r&&null==s){const e=n.clientX,s=n?.clientY,l=w.create(e,s),c=null!=r?w.distance(r,l):0,d=null==i||i(n);c<2&&d&&(o?.(n,r??l),t(Zt,a))}})),contextMenu:useActionCallback((()=>(e,t)=>{(null==t||t(e))&&e.preventDefault()})),longPress:useActionCallback((({set:e})=>(t,n,a,i)=>{if(null==a||a(t)){const a=w.create(t.touches[0].clientX,t.touches[0].clientY);e(Jt,a),e(Qt,t.target),e(Zt,n),i?.(t,a)}})),setContextMenuItem:useActionCallback((({snapshot:e,set:t,reset:n})=>async a=>{const i=await e.getPromise(tn);t(en,a),i.forEach((e=>e(a))),n(tn)})),clearActiveContextMenu:useActionCallback((({reset:e,set:t})=>n=>{t(Ht,!!n),e(Zt),e(tn),e(Jt)})),clearDismissedState:useActionCallback((({reset:e})=>()=>e(Ht)))}}function targetWithinMenu(e){return e.target instanceof Element&&isChildOf("vertex-menu",e.target)}function targetShouldSkipNextHit(e){return e.target instanceof Element&&isChildOf("vertex-viewer",e.target)}function isChildOf(e,t){return null!=t.closest(e)}var an=Object.freeze({__proto__:null,contextMenuActions:tn,contextMenuActive:Zt,contextMenuActivePosition:nn,contextMenuItem:en,contextMenuItemIsElement:contextMenuItemIsElement,contextMenuItemIsRow:contextMenuItemIsRow,contextMenuPosition:Jt,contextMenuTarget:Qt,targetShouldSkipNextHit:targetShouldSkipNextHit,targetWithinMenu:targetWithinMenu,useContextMenuActions:useContextMenuActions});const on=o({key:"boxSelectionEnabled",default:!1}),rn=o({key:"boxSelectionOperationType",default:"clearAndSelect"}),useBoxSelectionActions=()=>({enable:useActionCallback((({set:e})=>()=>{e(on,!0)})),disable:useActionCallback((({reset:e})=>async()=>{e(on),e(rn)})),setOperationType:useActionCallback((({set:e})=>t=>{e(rn,t)}))});var sn=Object.freeze({__proto__:null,boxSelectionEnabled:on,boxSelectionOperationType:rn,useBoxSelectionActions:useBoxSelectionActions});async function whenComponentReady(e,t,n=customElements,a=requestAnimationFrame,i=setTimeout){return null!=e&&null!=e.nodeName&&await n.whenDefined(e.nodeName.toLowerCase()),"function"==typeof e?.componentOnReady?(await(e?.componentOnReady()),t()):(await new Promise((e=>"function"==typeof a?a(e):i(e))),t())}const ln=o({key:"isEditingPointToPointMeasurement",default:!1}),cn=o({key:"pointToPointMeasurementOutcome",default:void 0}),dn=o({key:"editedPointToPointMeasurement",default:void 0});function usePointToPointMeasurement(e){const t=c(cn);T((()=>{let n;return whenComponentReady(e,(()=>{n=e?.measurementModel.onOutcomeChanged(t)})),()=>n?.dispose()}),[e,t])}const un=2,mn=o({key:"isEditingPreciseMeasurement",default:!1}),pn=o({key:"preciseMeasurementOutcome",default:void 0}),hn=o({key:"preciseMeasurementController",dangerouslyAllowMutability:!0,default:void 0}),fn=o({key:"preciseMeasurementOverlays",dangerouslyAllowMutability:!0,default:void 0}),gn=o({key:"preciseMeasurementEntities",dangerouslyAllowMutability:!0,default:[]}),yn=r({key:"preciseMeasurementMessage",get:({get:e})=>{const t=undefined;return 0===e(gn).length?"Select a surface":void 0}});function usePreciseMeasurementModel(e,t,n){const a=c(gn),i=c(pn),o=c(hn),r=c(fn),l=s(hn);T((()=>{let n;return whenComponentReady(e,(()=>{n=e?.measurementModel.onEntitiesChanged((e=>{a(e),t?.(e)}))})),()=>n?.dispose()}),[e,a]),T((()=>{let t;return whenComponentReady(e,(()=>{t=e?.measurementModel.onOutcomeChanged((e=>{i(e),n?.(e)}))})),()=>t?.dispose()}),[e,i]),T((()=>{let t;return whenComponentReady(e,(()=>{t=e?.measurementModel.onEntitiesChanged((e=>{if(e.length>2){const t=e[2];l?.setEntities(new Set([t]))}}))})),()=>t?.dispose()}),[e,l]),T((()=>{whenComponentReady(e,(()=>{o(e?.measurementController)}))}),[e,o]),T((()=>{whenComponentReady(e,(()=>{r(e?.measurementOverlays)}))}),[e,r])}function useMeasurementActions(){const e=useBoxSelectionActions(),t=useEnablePointToPointMeasurement(),n=useDisablePointToPointMeasurement(),a=useDisablePreciseMeasurement(),i=useActionCallback((({snapshot:e})=>async()=>{const t=await e.getPromise(hn);t?.clearEntities()})),o=useActionCallback((()=>async(e={})=>{await i(),n(e),a()})),r=useActionCallback((({set:e,reset:n})=>async a=>{await o(),"point-to-point"===a?t():(n(pn),n(gn),e(mn,!0))}));return{disableEditMeasurement:useActionCallback((()=>async e=>{await o(e)})),enableEditMeasurement:useActionCallback((()=>async e=>{await r(e)})),resetMeasurement:useActionCallback((({snapshot:e,reset:t})=>async()=>{const n=await e.getPromise(mn),a=await e.getPromise(ln);n?await i():a&&(t(cn),t(dn))})),clearEditedPointToPointMeasurement:useActionCallback((({reset:e})=>()=>{e(dn)})),setEditedPointToPointMeasurement:useActionCallback((({set:e})=>t=>{e(dn,t)})),toggleEditPointToPointMeasurement:useActionCallback((({snapshot:t})=>async()=>{const n=undefined;await t.getPromise(ln)?await o():await r("point-to-point"),e.disable()})),toggleEditPreciseMeasurement:useActionCallback((({snapshot:t})=>async()=>{const n=undefined;await t.getPromise(mn)?await o():await r("precise"),e.disable()}))}}function useEnablePointToPointMeasurement(){return useActionCallback((({reset:e,set:t})=>(n={})=>{t(ln,!0),n.keepExistingMeasurement||e(cn)}))}function useDisablePointToPointMeasurement(){return useActionCallback((({reset:e})=>(t={})=>{e(ln),t.keepExistingMeasurement||(e(dn),e(cn))}))}function useDisablePreciseMeasurement(){return useActionCallback((({reset:e})=>async()=>{e(mn),e(pn),e(gn)}))}const vn=r({key:"isEditingMeasurement",get:({get:e})=>e(ln)||e(mn)}),bn=r({key:"measurementPanelModel",get:({get:e})=>e(cn)||e(pn)}),wn=r({key:"measurementPanelOverlays",dangerouslyAllowMutability:!0,get:({get:e})=>e(fn)}),Cn=r({key:"measurementPanelMessage",get:({get:e})=>{const t=undefined;return e(mn)?e(yn):void 0}}),Sn=r({key:"measurementPanelIsResettable",get:({get:e})=>e(vn)&&null!=e(bn)});var xn=Object.freeze({__proto__:null,editedPointToPointMeasurement:dn,isEditingMeasurement:vn,isEditingPointToPointMeasurement:ln,isEditingPreciseMeasurement:mn,measurementPanelIsResettable:Sn,measurementPanelMessage:Cn,measurementPanelOutcome:bn,measurementPanelOverlays:wn,pointToPointMeasurementOutcome:cn,preciseMeasurementController:hn,preciseMeasurementEntities:gn,preciseMeasurementMessage:yn,preciseMeasurementOutcome:pn,preciseMeasurementOverlays:fn,useDisablePointToPointMeasurement:useDisablePointToPointMeasurement,useDisablePreciseMeasurement:useDisablePreciseMeasurement,useEnablePointToPointMeasurement:useEnablePointToPointMeasurement,useMeasurementActions:useMeasurementActions,usePointToPointMeasurement:usePointToPointMeasurement,usePreciseMeasurementModel:usePreciseMeasurementModel});const kn="Scene Alteration Performance";var An;!function(e){e.HIDE_ITEM="Hide Item",e.SHOW_ONLY_SELECTED="Show Only Selected",e.HIDE_SELECTED="Hide Selected",e.SHOW_ONLY_ITEM="Show Only Item",e.SHOW_ALL="Show All",e.HIDE_ALL="Hide All",e.SELECT_FILTERED_ITEMS="Select Filtered Items",e.INVERT_SELECTION="Invert Selection",e.CLEAR_ALL_TRANSFORMS="Clear All Transforms",e.CLEAR_SELECTED_TRANSFORMS="Clear Selected Transforms",e.CLEAR_SELECTION="Clear Selection",e.DESELECTING_ITEMS="Deselecting Items",e.SELECTING_ITEMS="Selecting Items",e.SELECTING_ONLY_ITEM="Selecting Only Item",e.SELECTING_ANCESTOR="Selecting Ancestor",e.APPLY_MATERIAL_OVERRIDE_TO_ALL="Apply Material Override To All",e.APPLY_MATERIAL_OVERRIDE_TO_SELECTION="Apply Material Override To Selection",e.CLEAR_ALL_MATERIAL_OVERRIDES="Clear All Material Overrides",e.CLEAR_SELECTED_MATERIAL_OVERRIDES="Clear Selected Material Overrides",e.SET_PHANTOM_ALL="Set Phantom All",e.SET_PHANTOM_SELECTED_ITEMS="Set Phantom Selected Items",e.CLEAR_PHANTOM_ALL="Clear Phantom All",e.CLEAR_PHANTOM_SELECTED_ITEMS="Clear Phantom Selected Items",e.SET_PHANTOM_NON_SELECTED_ITEMS="Set Phantom Non Selected Items",e.RESTORE_PHANTOM_OVERRIDES="Restore Phantom Overrides",e.SET_ITEM_AS_END_ITEM="Set Item as End Item",e.UNSET_ITEM_AS_END_ITEM="Unset Item as End Item",e.SHOW_ANNOTATION="Show Annotation",e.HIDE_ANNOTATION="Hide Annotation"}(An||(An={}));var Tn=Object.freeze({__proto__:null,SCENE_ALTERATION_PERFORMANCE:kn,get SceneAlterationPerformanceType(){return An}});const Pn=o({key:"fetchedItemInvalidator",default:0}),Mn=d({key:"fetchedItems",get:e=>async({get:t})=>{const n=t(et),a=t(ot);if(t(Pn),t(ua),null!=a)try{return await(n?.sceneItems?.getSceneViewItem(e,a,{includeOverride:!0,includeWorldTransform:!0}))}catch(t){return void logger_debug(`Error encountered get scene view item. [itemId={${e}}]`,t)}}}),En=u({key:"selectionSelectedItems",default:void 0}),In=o({key:"selectionSelectedItemIds",default:[]}),Nn=o({key:"selectionLastSelected",default:void 0}),Vn=o({key:"selectionLastSelectionFromViewer",default:!1}),On=o({key:"selectionLastSelectWasMultiSelect",default:!1}),Ln=r({key:"selectionHasMultipleSelected",get:({get:e})=>{const t=e(Nn),n=undefined;return e(In).filter((e=>e!==t?.id&&!t?.ancestors?.includes(e))).length>0}}),_n=o({key:"selectionIsAncestorSelection",default:!1}),Rn=o({key:"selectionFirstSelectedItemInTreeId",default:void 0}),Dn=r({key:"selectionHighestSelectedAncestor",get:({get:e})=>{const t=e(Nn),n=e(In);return t?.ancestors?.find((e=>n.includes(e)))??t?.id}}),zn=o({key:"selectionPreviousVisibleSummary",default:void 0}),Bn=o({key:"selectionVisibleSummary",default:void 0}),jn=r({key:"selectionVisibleCount",get:({get:e})=>e(Bn)?.count??0}),Hn=r({key:"selectionBoundingBoxCenter",get:({get:e})=>{const t=e(Bn);return null!=t?.boundingBox?g.center(t.boundingBox):v.origin()}}),Fn=r({key:"selectionIsActive",get:({get:e})=>{const t=e(In),n=undefined;return e(jn)>0||t.length>0}}),Un=r({key:"fetchedAndSelectedItems",get:async({get:e})=>{const t=e(In),n=undefined;return null!=e(ot)?t.map((t=>e(Mn(t)))):[]}}),Wn=o({key:"selectionModelViewsSelected",default:void 0});function useSceneViewItemActions(){return{invalidateCachedItems:useActionCallback((({set:e})=>()=>{e(Pn,(e=>e+1))}))}}var Gn=Object.freeze({__proto__:null,fetchedItem:Mn,fetchedItemInvalidator:Pn,useSceneViewItemActions:useSceneViewItemActions});const Kn=o({key:"lengthUnit",default:"cm"}),$n=o({key:"decimalPlace",default:"2"});var qn=Object.freeze({__proto__:null,decimalPlace:$n,lengthUnit:Kn}),Yn,Xn;!function(e){e.mm="millimeters",e.cm="centimeters",e.m="meters",e.in="inches",e.ft="feet"}(Yn||(Yn={})),function(e){e[e.mm=1]="mm",e[e.cm=.1]="cm",e[e.m=.001]="m",e[e.in=.03937007874015748]="in",e[e.ft=.0032808398950131233]="ft"}(Xn||(Xn={}));const convertFrom=(e,t)=>{const n=undefined;return e/Xn[t]},convertTo=(e,t)=>{const n=undefined;return e*Xn[t]},formatWithUnit=(e,t,n)=>`${e.toFixed(n)} ${t}`,formatDistance=(e,t,n)=>formatWithUnit(convertTo(e,t),t,n),createDistanceFormatter=(e,t)=>n=>formatDistance(n,e,t);function toUnitType(e){switch(e){case"cm":return"centimeters";case"m":return"meters";case"in":return"inches";case"ft":return"feet";default:return"millimeters"}}function pickLocalOrWorldTransform(e,t){return"local"===t?e.local:e.world}function mapItemTransforms(e,t){return{local:t(e.local),world:t(e.world)}}function makeItemTransforms(e,t,n){return"local"===n?{local:e,world:te(e,t)}:{world:e,local:ne(e,t)}}function convertTransformToUnits(e,t){const{position:n,rotation:a,scale:i}=e;return{position:v.create(convertTo(n.x,t),convertTo(n.y,t),convertTo(n.z,t)),rotation:a,scale:i}}function convertTransformFromUnits(e,t){const{position:n,rotation:a,scale:i}=e;return{position:v.create(convertFrom(n.x,t),convertFrom(n.y,t),convertFrom(n.z,t)),rotation:a,scale:i}}function toValidTransform(e){const{position:t,rotation:n,scale:a}=e;return{position:{x:t.x||0,y:t.y||0,z:t.z||0},rotation:{x:n.x||0,y:n.y||0,z:n.z||0},scale:a||1}}function scale(e){const t=parseFloat(Math.sqrt(e[0]**2+e[4]**2+e[8]**2).toFixed(2)),n=parseFloat(Math.sqrt(e[1]**2+e[5]**2+e[9]**2).toFixed(2)),a=parseFloat(Math.sqrt(e[2]**2+e[6]**2+e[10]**2).toFixed(2));return t===n&&n===a?t:NaN}function translation(e){return{x:e[12],y:e[13],z:e[14]}}function rotation(e){const t=e.map((t=>t*(1/scale(e))));return t[8]<1?t[8]>-1?{x:Math.atan2(-t[9],t[10])*(180/Math.PI),y:Math.asin(t[8])*(180/Math.PI),z:Math.atan2(-t[4],t[0])*(180/Math.PI)}:{x:-Math.atan2(-t[1],t[5])*(180/Math.PI),y:-90,z:0}:{x:Math.atan2(t[1],t[5])*(180/Math.PI),y:90,z:0}}function toTransformFromApiMatrix(e){return null!=e?{position:translation(e),rotation:rotation(e),scale:scale(e)}:void 0}const Zn={position:v.create(0,0,0),rotation:v.create(0,0,0),scale:1},Jn=o({key:"transformWidgetEnabled",default:!1}),Qn=o({key:"transformWidgetPosition",default:void 0}),ea=o({key:"transformWidgetOrientationOverride",default:void 0}),ta=r({key:"transformWidgetOrientation",get:({get:e})=>{const t=e(ea),n=e(Nn);if(null!=t)return t;if(null!=n){const t=e(da(n.id));return C.fromDegrees({x:t?.world.rotation.x,y:t?.world.rotation.y,z:t?.world.rotation.z})}}}),na=o({key:"transformWidgetCachedOrientation",default:void 0}),aa=o({key:"transformWidgetSyncToSelection",default:!1}),ia=o({key:"transformWidgetIsInteracting",default:!1}),oa=u({key:"appliedItemTransform",default:void 0}),ra=o({key:"appliedItemTransformIds",default:[]}),sa=o({key:"selectedCoordinateSpace",default:"world"}),la=u({key:"editedItemTransform",default:void 0}),ca=d({key:"displayedItemTransform",get:e=>({get:t})=>{if(null!=e){const n=t(sa),a=t(Kn),i=t(da(e)),o=t(la(e));if(null!=o)return o.transform;if(null!=i)return pickLocalOrWorldTransform(mapItemTransforms(i,(e=>convertTransformToUnits(e,a))),n)}},set:e=>({get:t,set:n},a)=>{if(null!=e){const i=t(sa),o=t(ma(e)),r=t(da(e)),s=t(Kn);if(null!=r&&!(a instanceof m)&&null!=a&&null!=o){n(la(e),{coordinateSpace:i,units:s,transform:a});const r=makeItemTransforms(convertTransformFromUnits(toValidTransform(a),s),o,i),l=t(ra);n(oa(e),r),n(ra,[...l,e])}}}}),da=d({key:"fetchedItemTransforms",get:e=>({get:t})=>{const n=t(Mn(e));if(null!=n){const e=n.override?.transform?toTransformFromApiMatrix(n.override?.transform):void 0,t=n.worldTransform?toTransformFromApiMatrix(n.worldTransform):void 0;return{local:e??Zn,world:t??Zn}}}}),ua=o({key:"transformInvalidator",default:0}),ma=d({key:"parentItemWorldMatrix",get:e=>({get:t})=>{const n=t(ot);if(null!=e&&null!=n){const n=t(Mn(e));if(null!=n?.parentId){const e=t(da(n.parentId)),a=t(oa(n.parentId));if(null==e)throw new Error("Invalid state. Parent item state should be populated, but is undefined.");return ae(ie(null!=a?a.world:e.world))}}return logger_debug(`Unable to find the world matrix for the parent of ${e}. Returning the identity matrix.`),S.makeIdentity()}});function useUpdateEditedTransformWhenSettingsChange(e){const t=s(Kn),n=s(sa),a=s(oa(e??"")),[i,o]=l(la(e??""));T((()=>{if(null!=a&&(i?.coordinateSpace!==n||i?.units!==t)){const e=undefined,i=convertTransformToUnits(pickLocalOrWorldTransform(a,n),t);o({units:t,coordinateSpace:n,transform:i})}}),[t,n])}function useEditItemTransform(e){const t=useTransformActions();useUpdateEditedTransformWhenSettingsChange(e);const n=p(ma(e)),[a,i]=h(ca(e));return{transform:"hasValue"===a.state?a.contents:void 0,loading:"loading"===a.state||"loading"===n.state,error:"hasError"===a.state?a.contents:void 0,async update(n){t.enableSelectionSync(),i(n),null!=e&&await t.applyTransformToItem(e)}}}const useTransformActions=()=>{const e=useApplicationMessageActions(),t=useViewerSceneActions(),n=useActionCallback((({set:e,snapshot:t})=>async()=>{const n=await t.getPromise(Hn);e(Qn,n)})),a=useActionCallback((({set:e,snapshot:t})=>async()=>{const a=await t.getPromise(Qn),i=await t.getPromise(On),o=await t.getPromise(In),r=await t.getPromise(jn);null==a&&(o.length>0||i||r>0)&&await n(),e(aa,!0)})),i=useActionCallback((({set:e})=>async t=>{e(Qn,t??void 0)})),o=useActionCallback(retainSnapshot((({snapshot:e,set:t,reset:n})=>async()=>{const a=await e.getPromise(ta),i=undefined;(await e.getPromise(ra)).forEach((e=>{n(oa(e)),n(la(e))})),n(ra),null!=a&&t(na,a),t(ua,(e=>e+1))}))),r=useActionCallback((({set:e,reset:t})=>n=>{t(na),e(ea,n)})),s=useActionCallback((({set:e})=>()=>{e(Qn,void 0),e(Jn,!1)}));return{enableTransformWidget:useActionCallback((({set:t})=>async(o,r)=>{e.setToastMessage({message:"Transform manipulator enabled! Select parts to interact.",duration:Ke}),t(Jn,!0),r?await n():null==o?await a():await i(o)})),disableTransformWidget:useActionCallback((({reset:e})=>()=>{e(Jn),e(ea)})),setTransformWidgetOrientation:r,clearTransformWidgetOrientation:useActionCallback((({reset:e})=>()=>{e(na),e(ea)})),setTransformWidgetPosition:i,clearTransformWidgetPosition:useActionCallback((({reset:e})=>()=>e(Qn))),invalidateTransforms:o,setIsInteractivelyTransforming:useActionCallback((({set:e})=>t=>{e(ia,t)})),setDefaultWidgetPosition:a,setDefaultWidgetPositionToSelection:n,enableSelectionSync:useActionCallback((({set:e})=>()=>e(aa,!0))),disableSelectionSync:useActionCallback((({reset:e})=>()=>e(aa))),syncToSelection:useActionCallback((({snapshot:e})=>async()=>{const t=await e.getPromise(zn),n=await e.getPromise(Bn),a=undefined;if(await e.getPromise(aa)){const e=n?.boundingBox,a=null!=e&&null!=t?.boundingBox&&equals(e,t.boundingBox);null==e||a||await i(g.center(e))}})),orientToHitResult:useActionCallback((({reset:e})=>async t=>{e(aa),null==t?.annotationId&&(null!=t?await i(t?.position):(e(Qn),r(void 0)))})),clearSelectedTransforms:useActionCallback((()=>async()=>{await t.execute(An.CLEAR_SELECTED_TRANSFORMS,(e=>e.where((e=>e.withSelected())).clearTransforms())),await o(),s()})),clearAllTransforms:useActionCallback((()=>async()=>{await t.execute(An.CLEAR_SELECTED_TRANSFORMS,(e=>e.where((e=>e.all())).clearTransforms())),await o(),s()})),applyTransformToItem:useActionCallback((({snapshot:e})=>async t=>{const n=await e.getPromise(et),a=await(n?.scene()),i=await e.getPromise(oa(t));if(null==i)return void logger_warn(`There is no transform to apply to item ${t}.`);const o=S.transpose(ae(ie(i?.local)));return a?.items((e=>e.where((e=>e.withItemId(t))).transform(o))).execute()}))}};var pa=Object.freeze({__proto__:null,appliedItemTransformIds:ra,appliedItemTransforms:oa,convertTransformFromUnits:convertTransformFromUnits,convertTransformToUnits:convertTransformToUnits,displayedItemTransform:ca,editedItemTransform:la,fetchedItemTransforms:da,identityTransform:Zn,makeItemTransforms:makeItemTransforms,mapItemTransforms:mapItemTransforms,parentItemWorldMatrix:ma,pickLocalOrWorldTransform:pickLocalOrWorldTransform,selectedCoordinateSpace:sa,toValidTransform:toValidTransform,transformInvalidator:ua,transformWidgetCachedOrientation:na,transformWidgetEnabled:Jn,transformWidgetIsInteracting:ia,transformWidgetOrientation:ta,transformWidgetOrientationOverride:ea,transformWidgetPosition:Qn,transformWidgetSyncToSelection:aa,useEditItemTransform:useEditItemTransform,useTransformActions:useTransformActions});const useHitActions=()=>{const e=useCrossSectioningActions(),t=useMeasurementActions(),n=useTransformActions(),a=useActionCallback(retainSnapshot((({snapshot:e})=>async()=>{const n=await e.tryGetPromise(jt).then((e=>e.value)),a=await e.getPromise(dn);null==n&&null!=a?.start&&null!=a.end&&await t.resetMeasurement()}))),i=useActionCallback(retainSnapshot((({snapshot:e})=>async()=>{const t=await e.tryGetPromise(jt).then((e=>e.value));await n.orientToHitResult(t)}))),o=useActionCallback(retainSnapshot((({set:e,snapshot:t})=>async()=>{const n=await t.tryGetPromise(jt).then((e=>e.value));e(en,n)}))),r=useActionCallback(retainSnapshot((({snapshot:e,set:t})=>async()=>{t(Bt,await e.tryGetPromise(jt).then((e=>e.value)))})));return{tap:useActionCallback(retainSnapshot((({snapshot:t,set:n})=>async({detail:s},...l)=>{const c=await t.getPromise(vn),d=await t.getPromise(kt),u=2!==s?.buttons&&!s?.altKey;s.altKey||s.ctrlKey||s.metaKey||s.shiftKey;const m=u&&!d.hitPending&&!c,p=await t.tryGetPromise(jt).then((e=>e.value));n(zt,p),n(Rt,s),await a(),m&&(l.forEach((e=>e())),await i()),await o(),await e.sectionCurrentHit(),await r()}))),longPress:useActionCallback(retainSnapshot((({snapshot:e,set:t,reset:n})=>async a=>{n(Rt),t(Dt,a.detail),await e.tryGetPromise(jt),await o(),await r()})))}},ha=r({key:"viewerToolkitHitState",get:({get:e})=>{const t=undefined,n=undefined,a=undefined,i=undefined,o=undefined;return{tapDetails:e(Rt),longPressDetails:e(Dt),previousHitResult:e(zt),currentHitResult:e(Bt)}}});var fa=Object.freeze({__proto__:null,currentHitResult:Bt,hitResult:jt,hitResultsLongPressDetails:Dt,hitResultsSkipNextTap:Ht,hitResultsTapDetails:Rt,hitState:ha,previousHitResult:zt,useHitActions:useHitActions});const ga=u({key:"modelViewsCursor",default:void 0}),ya=u({key:"pmiAnnotationsCursor",default:void 0}),va=u({key:"loadedModelViews",default:[]}),ba=u({key:"loadedPmiAnnotations",default:[]}),wa=u({key:"visiblePmiAnnotations",default:[]}),Ca=r({key:"modelViewsSceneItemName",get:async({get:e})=>{const t=e(Wn);if(null!=t){const n=e(Mn(t.id));return n?.name??void 0}}}),Sa=o({key:"loadedItemModelView",default:void 0}),xa=d({key:"nextModelViews",get:e=>async({get:t})=>{const n=t(et),a=t(ga(e));return await(n?.modelViews?.listByItem(e,{cursor:a,size:100,hasAnnotations:!0}))}}),ka=d({key:"modelViews",get:e=>({get:t})=>{const n=t(va(e)),a=t(xa(e));return n.flatMap((e=>e.modelViews)).concat(a?.modelViews??[])}}),Aa=d({key:"hasMoreModelViews",get:e=>({get:t})=>{const n=t(xa(e));return null!=n?.paging.next}}),Ta=d({key:"nextPmiAnnotations",get:e=>async({get:t})=>{const n=t(et),a=t(ya(e));return n?.pmi?.listAnnotations({modelViewId:e,cursor:a,size:100})}}),Pa=d({key:"pmiAnnotations",get:e=>({get:t})=>{const n=undefined;return t(ba(e)).flatMap((e=>e.annotations))}}),Ma=d({key:"hasMorePmiAnnotations",get:e=>({get:t})=>{const n=undefined;return null!=t(ya(e))}}),Ea=o({key:"selectedPmiAnnotationId",default:void 0});function useSceneAnnotationsOperations(){const e=A.useCallback((async(e,t,n)=>{const a=await(t?.scene());null==n?await(a?.elements((t=>e(t.annotations.where((e=>e.all()))))).execute()):n.length>0&&await(a?.elements((t=>e(t.annotations.where((e=>e.withAnnotationIds(n)))))).execute())}),[]),t=A.useCallback((async(e,t)=>{const n=await(e?.scene());n?.elements((e=>[e.annotations.where((e=>e.all())).deselect(),e.annotations.where((e=>e.withAnnotationIds([t]))).select()])).execute()}),[]),n=A.useCallback((async e=>{const t=await(e?.scene());t?.elements((e=>[e.annotations.where((e=>e.all())).deselect()])).execute()}),[]);return{sceneAnnotationsOperation:e,selectOnlyAnnotation:t,clearAnnotationSelection:n}}function usePmiAnnotationActions(){const e=useSceneAnnotationsOperations(),t=useActionCallback((({snapshot:e,set:t})=>async n=>{const a=await e.getPromise(Ta(n));if(null!=a){t(ba(n),(e=>[...e,a])),t(wa(n),(e=>[...e,...a.annotations]));const e=a?.paging?.next;t(ya(n),null!=e?()=>e:()=>{})}})),n=useActionCallback((({snapshot:e})=>async a=>{const i=document.getElementById(`annotation-entry-${a}`);if(null!=i)i.scrollIntoView();else{const i=await e.getPromise(Sa),o=i?.modelView.id;if(null==o)return;const r=undefined;await e.getPromise(Ma(o))&&(await t(o),await n(a))}}));return{fetchInitialPmiAnnotations:useActionCallback((({snapshot:e})=>async n=>{const a=undefined;0===(await e.getPromise(Pa(n))).length&&await t(n)})),fetchNextPmiAnnotations:useActionCallback((()=>async e=>{await t(e)})),selectPmiAnnotation:useActionCallback((({set:t,snapshot:a})=>async(i,o)=>{t(Ea,i);const r=await a.getPromise(et);null!=r&&await(e?.selectOnlyAnnotation(r,i)),o&&await n(i)})),clearPmiAnnotationSelection:useActionCallback((({reset:t,snapshot:n})=>async()=>{const a=await n.getPromise(Ea),i=await n.getPromise(et);null!=a&&null!=i&&(t(Ea),await(e?.clearAnnotationSelection(i)))})),scrollToSelectedPmiAnnotation:n}}const Ia=o({key:"sceneTreeLoaderVisible",default:!1}),Na=o({key:"sceneTreeElement",default:void 0}),Va=o({key:"sceneTreeController",default:void 0,dangerouslyAllowMutability:!0}),Oa=o({key:"sceneTreeOpenPopover",default:void 0}),La=d({key:"sceneTreePopoverIsOpen",get:e=>({get:t})=>t(Oa)===e});function useSceneTreeActions(){const e=useSelectionActions(),t=useViewerCameraActions();return{toggleSelection:useActionCallback((({snapshot:t})=>async(n,a,i)=>{if(!n.defaultPrevented&&0===n.button&&(n.altKey||((n.ctrlKey||n.metaKey)&&a.selected?await i.deselectItem(a):a.selected?await i.selectItem(a,{recurseParent:!0}):a.selected||await i.selectItem(a,{append:n.ctrlKey||n.metaKey,range:n.shiftKey})),null!=a.id)){const i=await t.getPromise(Nn);e.syncSelection({id:a.id?.hex,ancestors:i?.ancestors??[]},{selected:!n.metaKey&&!n.ctrlKey||!a.selected,multiSelect:n.shiftKey||n.metaKey||n.ctrlKey})}})),toggleExpansion:useActionCallback((()=>(e,t,n)=>{n.toggleExpandItem(t)})),toggleVisibility:useActionCallback((()=>(e,t,n)=>{n.toggleItemVisibility(t)})),flyToRow:useActionCallback((({snapshot:e})=>async n=>{const a=await e.getPromise(Na),i=await(a?.getRowAtClientY(n));null!=i?.node.id?.hex&&await t.flyToById(i.node.id.hex)})),flyToFirstSelectedItem:useActionCallback((({snapshot:e})=>async()=>{const t=await e.getPromise(Na),n=await e.getPromise(Rn);null!=n&&t?.scrollToItem(n)})),setContextMenuItem:useActionCallback((({set:e,snapshot:t})=>async n=>{const a=await t.getPromise(Na),i=await(a?.getRowAtClientY(n));e(en,i)})),openSceneTreePopover:useActionCallback((({set:e})=>t=>{e(Oa,t)})),closeSceneTreePopover:useActionCallback((({set:e})=>()=>{e(Oa,void 0)}))}}var _a=Object.freeze({__proto__:null,sceneTreeController:Va,sceneTreeElement:Na,sceneTreeLoaderVisible:Ia,sceneTreeOpenPopover:Oa,sceneTreePopoverIsOpen:La,useSceneTreeActions:useSceneTreeActions});function useSelectionActions(){const e=usePmiAnnotationActions(),t=useSceneViewItemActions(),n=useTransformActions(),a=useViewerSceneActions(),i=useActionCallback((({snapshot:e,reset:t})=>async()=>{const n=undefined;(await e.getPromise(In)).forEach((e=>t(En(e))))})),o=useActionCallback((({snapshot:e,reset:t,set:n})=>async(i,o)=>{const r=await e.getPromise(En(i.id)),s=await e.getPromise(In),l=[...i.ancestors??[]]?.reverse().find((e=>!s.includes(e)));null!=r&&null!=l?(n(En(l),{id:l}),n(In,(e=>[...e,l])),n(_n,!0),await a.execute(An.SELECTING_ANCESTOR,a.selectItemsTransform(l)),await m({id:l})):o?.clear?(n(En(i.id),i),n(In,[i.id]),await a.execute(An.SELECTING_ONLY_ITEM,a.clearSelectionTransform,a.selectItemsTransform(i.id)),await m(i)):(n(En(i.id),i),n(In,(e=>[...e,i.id])),await a.execute(An.SELECTING_ITEMS,a.selectItemsTransform(i.id)),await m(i)),n(Nn,i),n(Vn,!0),t(On);try{const t=await e.getPromise(Na);await(t?.scrollToItem(i.id))}catch(e){logger_debug(`The scene item was not found in the tree. [itemId={${i.id}}]`)}})),r=useActionCallback((({reset:e,set:t})=>async n=>{e(En(n)),e(On),e(_n),t(In,(e=>e.filter((e=>e!==n)))),await a.execute(An.DESELECTING_ITEMS,a.deselectItemsTransform(n))})),s=useActionCallback((({snapshot:e})=>async t=>{const n=await e.getPromise(En(t.id));null!=n?await r(n.id):await o(t)})),l=useActionCallback((({snapshot:a,reset:i,set:r})=>async(s,l={})=>{const c=await a.getPromise(En(s.id)),d=await a.getPromise(In);if(d.filter((e=>e!==s.id&&!s.ancestors?.includes(e))).forEach((e=>i(En(e)))),i(On),i(_n),c)if(l.ignoreAncestorSelection)i(In),i(En(c.id));else{const e=d.filter((e=>e===s.id||s.ancestors?.includes(e)));r(In,e)}else i(In);t.invalidateCachedItems(),n.clearTransformWidgetOrientation(),await e.clearPmiAnnotationSelection(),await o(s,{clear:!0})})),c=useActionCallback((({reset:t})=>async()=>{await i(),t(In),t(Nn),t(Vn),t(On),t(_n),n.clearTransformWidgetPosition(),n.clearTransformWidgetOrientation(),await e.clearPmiAnnotationSelection()})),d=useActionCallback((()=>async()=>{await c(),await a.execute(An.CLEAR_SELECTION,a.clearSelectionTransform)})),u=useActionCallback((({set:e})=>async t=>{e(On,t)})),m=useActionCallback((({set:e,snapshot:t})=>async n=>{const a=await t.getPromise(Wn);a?.id!==n?.id&&e(Wn,n)}));return{select:o,toggleSelection:s,clearAndSelect:l,selectCurrentHit:useActionCallback(retainSnapshot((({snapshot:t})=>async()=>{const n=await t.tryGetPromise(jt).then((e=>e.value)),a=await t.getPromise(Rt),i=a?.metaKey||a?.ctrlKey||a?.shiftKey;null!=n?.annotationId?await e.selectPmiAnnotation(n.annotationId,!0):null==n||i?null!=n&&i?await s(n):await d():await l(n)}))),syncSelection:useActionCallback((({set:e,snapshot:t,reset:n})=>async(a,o)=>{if(o.selected){const n=await t.getPromise(En(a.id)),r=await t.getPromise(Va);if(null!=n&&null!=r){const n=undefined,i=(await(r?.fetchNodeAncestors(a.id))).map((e=>e.id?.hex)).filter((e=>null!=e)),s=await t.getPromise(In),l=[...i??[]]?.findLastIndex((e=>s.includes(e)));if(i.length>0&&l<i.length-1){const t=i[l+1];return e(_n,!0),e(Nn,{id:t}),e(En(t),{id:t}),e(In,(e=>[...e.filter((e=>e!==t)),t])),e(Vn,!1),e(On,!!o.multiSelect),void await m({id:t})}}await i(),e(En(a.id),a),o.multiSelect?e(In,(e=>[...e.filter((e=>e!==a.id)),a.id])):e(In,[a.id]),await m(a),e(Nn,a),e(Vn,!1),e(On,!!o.multiSelect)}else n(En(a.id)),n(On),e(In,(e=>e.filter((e=>e!==a.id))))})),deselect:r,clearSelection:d,resetSelectionState:c,toggleLastSelectWasMultiSelect:u,selectForModelViewsPanel:m}}const Ra=r({key:"viewerToolkitSelectionState",get:({get:e})=>{const t=undefined,n=undefined,a=undefined,i=undefined;return{selectedItemIds:e(In),lastSelected:e(Nn),highestSelectedAncestorId:e(Dn)}}});var Da=Object.freeze({__proto__:null,fetchedAndSelectedItems:Un,selectionBoundingBoxCenter:Hn,selectionFirstSelectedItemInTreeId:Rn,selectionHasMultipleSelected:Ln,selectionHighestSelectedAncestor:Dn,selectionIsActive:Fn,selectionIsAncestorSelection:_n,selectionLastSelectWasMultiSelect:On,selectionLastSelected:Nn,selectionLastSelectionFromViewer:Vn,selectionModelViewsSelected:Wn,selectionPreviousVisibleSummary:zn,selectionSelectedItemIds:In,selectionSelectedItems:En,selectionState:Ra,selectionVisibleCount:jn,selectionVisibleSummary:Bn,useSelectionActions:useSelectionActions});function createColorMaterialWithId(e,t=_e.create()){return{id:t,...oe.fromHex(e)}}const za=255,Ba=18,ja=o({key:"sceneItemAdjustmentsSelectedColor",default:void 0}),Ha=o({key:"sceneItemAdjustmentsRecentColors",default:[]}),Fa=o({key:"sceneItemAdjustmentsCustomColors",default:[createColorMaterialWithId("#ffffff"),createColorMaterialWithId("#616161")]}),Ua=o({key:"sceneItemAdjustmentsSelectedOpacity",default:void 0}),Wa=u({key:"appliedItemMaterialOverride",default:void 0}),Ga=o({key:"appliedItemMaterialOverrideIds",default:[]}),Ka=r({key:"sceneItemAdjustmentsLastSelectedOverride",get:({get:e})=>{const t=e(Nn);if(null!=t)return e(Wa(t.id))}}),$a=o({key:"applyMaterialToAllUserAction",default:void 0}),qa=o({key:"showConfirmDialogWhenApplyingMaterialToAll",default:!0}),Ya=o({key:"confirmApplyMaterialToAllDialogOpen",default:!1}),useSceneItemMaterialActions=()=>{const e=useViewerSceneActions(),t=useActionCallback((({snapshot:e,reset:t})=>async()=>{const n=await e.getPromise(Ga);t(ja),n.forEach((e=>t(Wa(e)))),t(Ga)}));return{updateColor:useActionCallback((({set:e})=>t=>{e(ja,t)})),saveRecentColor:useActionCallback((({set:e,snapshot:t})=>async n=>{const a=await t.getPromise(Ha),i=[n,...a.filter((e=>e!==n))],o=i.length>Ba?i.slice(0,-(i.length-Ba)):i;e(ja,n),e(Ha,o)})),removeRecentColor:useActionCallback((({set:e,snapshot:t})=>async n=>{const a=undefined,i=(await t.getPromise(Ha)).filter((e=>e.id!==n));e(Ha,i)})),setCustomColors:useActionCallback((({set:e})=>async t=>{e(Fa,t)})),saveCustomColor:useActionCallback((({set:e,snapshot:t})=>async n=>{const a=undefined,i=[...await t.getPromise(Fa),n],o=i.length>Ba?i.slice(i.length-Ba):i;e(ja,n),e(Fa,o)})),removeCustomColor:useActionCallback((({set:e,snapshot:t})=>async n=>{const a=undefined,i=(await t.getPromise(Fa)).filter((e=>e.id!==n));e(Fa,i)})),clearCurrentColor:useActionCallback((({reset:e})=>()=>{e(ja)})),clearCurrentOpacity:useActionCallback((({reset:e})=>()=>{e(Ua)})),clear:useActionCallback((({snapshot:t,set:n,reset:a})=>async()=>{const i=await t.getPromise(In);a(ja),i.forEach((e=>a(Wa(e)))),n(Ga,(e=>e.filter((e=>!i.includes(e))))),await e.execute(An.CLEAR_SELECTED_MATERIAL_OVERRIDES,(e=>e.where((e=>e.withSelected())).clearMaterialOverrides().select()))})),clearAll:useActionCallback((()=>async()=>{await t(),await e.execute(An.CLEAR_ALL_MATERIAL_OVERRIDES,(e=>e.where((e=>e.all())).clearMaterialOverrides()),(e=>e.where((e=>e.withSelected())).select()))})),clearState:t,updateOpacity:useActionCallback((({set:e})=>t=>{e(Ua,t)})),apply:useActionCallback((({snapshot:t,set:n})=>async()=>{const a=await t.getPromise(ja),i=await t.getPromise(Ua),o=await t.getPromise(In),r=await t.getPromise(Ka),s=a??r,l=i??r?.opacity;if(null!=s){const t={...s,opacity:l??s.opacity};await e.execute(An.APPLY_MATERIAL_OVERRIDE_TO_SELECTION,(e=>e.where((e=>e.withSelected())).materialOverride(t))),o.forEach((e=>n(Wa(e),t))),n(Ga,(e=>[...e,...o]))}})),confirmApplyAll:useActionCallback((({set:e})=>t=>{e(Ya,!0),e($a,(()=>t))})),cancelApplyAll:useActionCallback((({reset:e})=>()=>{e(Ya),e($a)})),applyAll:useActionCallback((({snapshot:t,reset:n})=>async()=>{const a=await t.getPromise(ja),i=await t.getPromise(Ua);if(null!=a){const o=await t.getPromise(Ga),r={...a,opacity:i??a.opacity};await e.execute(An.APPLY_MATERIAL_OVERRIDE_TO_ALL,(e=>e.where((e=>e.all())).materialOverride(r))),o.forEach((e=>n(Wa(e))));const s=await t.getPromise($a);s?.(r),n(Ya),n($a)}})),hideConfirmApplyAllDialog:useActionCallback((({set:e})=>()=>{e(qa,!1)}))}},Xa="#ffff00",Za=35,Ja=1,Qa=o({key:"selectionHighlightingSelectedColor",default:Xa}),ei=o({key:"selectionHighlightingSelectedOpacity",default:Za}),ti=o({key:"selectionHighlightingSelectedLineThickness",default:1});function elementIsColorSwatch(e){return e instanceof Element&&"VERTEX-COLOR-SWATCH"===e.nodeName}function elementHasColorAttribute(e){return"true"===e.getAttribute("data-custom-color")||"true"===e.getAttribute("data-recent-color")}const ni="#FFFFFF",ai=o({key:"viewerBackgroundSelectedColor",default:ni});var ii=Object.freeze({__proto__:null,DEFAULT_FEATURE_EDGE_COLOR:qt,DEFAULT_FEATURE_EDGE_THICKNESS_VALUE:$t,DEFAULT_SELECTION_HIGHLIGHTING_COLOR:Xa,DEFAULT_SELECTION_HIGHLIGHTING_LINE_THICKNESS:1,DEFAULT_SELECTION_HIGHLIGHTING_OPACITY:Za,DEFAULT_VIEWER_BACKGROUND_COLOR:ni,MAXIMUM_MATERIAL_OVERRIDE_OPACITY:za,MAX_STORED_COLOR_ARRAY_LENGTH:Ba,appliedItemMaterialOverride:Wa,appliedItemMaterialOverrideIds:Ga,applyMaterialToAllUserAction:$a,confirmApplyMaterialToAllDialogOpen:Ya,elementHasColorAttribute:elementHasColorAttribute,elementIsColorSwatch:elementIsColorSwatch,featureEdgesLineThickness:Xt,featureEdgesSelectedColor:Yt,sceneItemAdjustmentsCustomColors:Fa,sceneItemAdjustmentsLastSelectedOverride:Ka,sceneItemAdjustmentsRecentColors:Ha,sceneItemAdjustmentsSelectedColor:ja,sceneItemAdjustmentsSelectedOpacity:Ua,selectionHighlightingSelectedColor:Qa,selectionHighlightingSelectedLineThickness:ti,selectionHighlightingSelectedOpacity:ei,showConfirmDialogWhenApplyingMaterialToAll:qa,useSceneItemMaterialActions:useSceneItemMaterialActions,viewerBackgroundSelectedColor:ai});const VertexSceneItemMaterialApplyAll=({onApplyAll:t})=>{const n=useSceneItemMaterialActions(),a=p(Ka),i=s(ja),o=s(qa),r=k.useMemo((()=>"hasValue"===a.state?i??a.contents:i),[a,i]);return e(R,{content:"Apply to All",children:e(D,{iconName:"square-dot-outline",iconSize:"sm",color:"secondary",disabled:null==r,onClick:async()=>{o?n.confirmApplyAll(t):(await n.applyAll(),t?.(r))}})})};function SceneItemMaterialApplyAllConfirmationDialog(){const a=useSceneItemMaterialActions(),i=s(Ya),[o,r]=A.useState(!1),onCloseDialog=()=>{a.cancelApplyAll(),r(!1)};return i?t(B,{open:!0,className:"text-sm",onClosed:onCloseDialog,onBackdropClick:onCloseDialog,children:[e("div",{slot:"heading",children:"Apply to All Parts"}),e("div",{className:"max-w-lg break-words pr-2",children:"This will apply the same material to all parts in the model. Any previous material changes will be lost."}),t("div",{className:"flex mt-8 gap-2 items-center",children:[t("div",{className:"flex gap-2",children:[e(_,{"data-testid":"hide-confirmation-dialog-in-future-checkbox",variant:"check",className:"pt-0.5",checked:o,onValueChanged:e=>{r(e.detail)}}),"Don't show again this session"]}),t("div",{className:"flex ml-auto gap-2",children:[e(j,{"data-testid":"cancel-apply-material-to-all",onClick:onCloseDialog,children:"Cancel"}),e(j,{color:"primary","data-testid":"confirm-apply-material-to-all",onClick:async()=>{await a.applyAll(),o&&a.hideConfirmApplyAllDialog()},children:"Apply"})]})]})]}):e(n,{})}const VertexSceneItemMaterialColorPicker=({onApply:t})=>{const n=useSceneItemMaterialActions(),a=p(Ka),i=s(ja),o=k.useMemo((()=>"hasValue"===a.state?i??a.contents:i),[a,i]);return e(VertexColorPicker,{"data-testid":"selected-item-color-picker",value:null!=o?Pe.toHexString(o.diffuse):void 0,onValueChanged:async()=>{null!=o&&(await n.apply(),t?.(o),await n.saveRecentColor(createColorMaterialWithId(Pe.toHexString(o.diffuse))))},onInput:async e=>{n.updateColor(createColorMaterialWithId(e)),await n.apply()}})},ColorSwatch=({color:t,hideTooltip:n,onClick:a,...i})=>{const o="string"==typeof t?t:Pe.toHexString(t.diffuse);return e(R,{className:"flex-grow-0",content:o,disabled:!!n,children:e("button",{onClick:()=>a?.(t),children:e(H,{"data-testid":`color-swatch-${o}`,variant:"square",color:o,...i})})})},VertexSceneItemMaterialColorSwatches=({onAddCustomColor:a,onApplyCustomColor:i,onApplyRecentColor:o})=>{const r=useSceneItemMaterialActions(),l=s(Fa),c=s(Ha),d=l.length===Ba;return t(n,{children:[t("div",{"data-testid":"appearance-custom-colors",className:"flex flex-wrap gap-2 mt-1 mb-4",children:[l.map((t=>e(ColorSwatch,{color:t,onClick:async()=>{r.updateColor(t),await r.apply(),i?.(t)},"data-custom-color":!0,"data-color-id":t.id},t.id))),!d&&e(N,{"data-testid":"appearance-custom-colors-add",variant:"swatch",size:"md",onValueChanged:async e=>{const t=createColorMaterialWithId(e.detail);await r.saveCustomColor(t),await r.apply(),a?.(t)},children:e("div",{slot:"overlay",className:"flex items-center justify-center w-full h-full",children:e(F,{className:"bg-white p-2",name:"plus",size:"sm"})})})]}),!!c.length&&e("div",{"data-testid":"appearance-recent-colors",className:"flex flex-wrap gap-2",children:c.map((t=>e(ColorSwatch,{color:t,onClick:async()=>{r.updateColor(t),await r.apply(),o?.(t)},"data-recent-color":!0,"data-color-id":t.id},t.id)))})]})},VertexSceneItemMaterialOpacitySlider=({onApply:t})=>{const n=useSceneItemMaterialActions(),a=s(Ua),i=p(Ka),o=k.useMemo((()=>"hasValue"===i.state?a??i.contents?.opacity??za:a??za),[a,i]),r=useDebouncedCallback((()=>{n.apply()}),500),l=k.useCallback((e=>{n.updateOpacity(e.detail.value),r(e.detail.value)}),[r,n]),c=k.useMemo((()=>"hasValue"!==i.state||null==i.contents),[i]);return e(R,{className:"flex w-full",content:c?"Select a part and apply a color to enable opacity":`${Math.floor(o/za*100)}%`,placement:"top",children:e(VertexSlider,{"data-testid":"scene-item-adjustments-opacity-slider",leftLabel:"0%",rightLabel:"100%",disabled:c,value:o??za,step:5,min:0,max:za,onValueChange:e=>{n.updateOpacity(e.detail.value),n.apply(),t?.(e.detail.value)},onValueInput:l})})};function VertexMaterialControls({customColors:a,onApplyMaterial:i,onApplyMaterialToAll:o,onAddCustomColor:r,onApplyCustomColor:l,onApplyRecentColor:c,onApplyOpacity:d}){const u=useSceneItemMaterialActions(),m=s(Nn);return A.useEffect((()=>{u.clearCurrentColor(),u.clearCurrentOpacity()}),[m?.id]),A.useEffect((()=>{if(null!=a){const e=a.map((e=>({...e,id:_e.create()})));u.setCustomColors(e)}}),[a]),t(n,{children:[t("div",{className:"flex flex-col",children:[e("div",{className:"pt-1 pb-2 text-sm text-neutral-700",children:"Color"}),t("div",{className:"flex items-center gap-2",children:[e(VertexSceneItemMaterialColorPicker,{onApply:i}),e(VertexSceneItemMaterialApplyAll,{onApplyAll:o})]})]}),e("div",{className:"pt-4 pb-2 text-sm text-neutral-700",children:"Color Swatches"}),e(VertexSceneItemMaterialColorSwatches,{onAddCustomColor:r,onApplyCustomColor:l,onApplyRecentColor:c}),e("div",{className:"pt-4 pb-2 text-sm text-neutral-700",children:"Opacity"}),e(VertexSceneItemMaterialOpacitySlider,{onApply:d}),e(SceneItemMaterialApplyAllConfirmationDialog,{})]})}const ResetButton=({id:n,tooltip:a,children:i})=>{const[o,r]=A.useState(!1);return e("div",{className:"ml-auto",children:t(U,{className:"flex items-stretch h-full","data-testid":`reset-button-dropdown-menu-${n}`,placement:"bottom-end",onMenuOpened:()=>r(!0),onMenuClosed:()=>r(!1),children:[e("div",{slot:"anchor",className:"flex items-center h-full",children:e(R,{content:a,disabled:o,placement:"bottom",children:t(j,{className:Kt("p-1.5 rounded-md select-none hover:bg-neutral-300 active:bg-neutral-400 cursor-pointer",{"bg-neutral-300":o}),"data-testid":`reset-button-${n}`,variant:"plaintext",children:[e(F,{className:"px-0.5",name:"reset",size:"sm"}),e(F,{name:"chevron-down",size:"sm"})]})})}),e("div",{className:"whitespace-nowrap",children:i})]})})},VertexSceneItemMaterialClear=({onClear:n,onClearAll:a})=>{const i=useSceneItemMaterialActions(),o=s(Fn);return e("div",{className:"ml-auto",children:t(ResetButton,{id:"materials",tooltip:"Clear Materials",children:[e("div",{className:"pt-1"}),e(W,{"data-testid":"clear-selected-materials",onClick:()=>{i.clear(),n?.()},disabled:!o,children:"Clear selected materials"}),e(W,{"data-testid":"clear-all-materials",onClick:()=>{i.clearAll(),a?.()},children:"Clear all materials"})]})})};function VertexMaterialPanelSection({customColors:n,onClearMaterial:a,onClearAllMaterials:i,onApplyMaterial:o,onApplyMaterialToAll:r,onAddCustomColor:s,onApplyCustomColor:l,onApplyRecentColor:c,onApplyOpacity:d}){return e(PanelSection,{header:t("div",{className:"flex items-center text-base",children:["Material",e(VertexSceneItemMaterialClear,{onClear:a,onClearAll:i})]}),children:e(VertexMaterialControls,{customColors:n,onApplyMaterial:o,onApplyMaterialToAll:r,onAddCustomColor:s,onApplyCustomColor:l,onApplyRecentColor:c,onApplyOpacity:d})})}const VertexSelectionHighlightingColorPicker=({onUpdate:t})=>{const[n,a]=l(Qa);return e(VertexColorPicker,{"data-testid":"selection-highlighting-color-picker",value:n,onValueChanged:e=>{t?.(e.detail)},onInput:e=>a(e)})},VertexSelectionHighlightingLineThicknessSlider=({onUpdate:t})=>{const[n,a]=l(ti);return e(VertexSlider,{id:"selection-highlighting-line-thickness","data-testid":"selection-highlighting-line-thickness-slider",leftLabel:"Off",rightLabel:"Thick",min:0,max:3,step:.5,value:n,valueLabelDisplay:"auto",onValueInput:e=>{a(e.detail.value)},onValueChange:e=>{t?.(e.detail.value)}})},VertexSelectionHighlightingOpacitySlider=({onUpdate:t})=>{const[n,a]=l(ei);return e(VertexSlider,{id:"selection-highlighting-opacity","data-testid":"selection-highlighting-opacity-slider",leftLabel:"0%",rightLabel:"100%",min:0,max:100,step:5,value:n,valueLabelDisplay:"auto",onValueInput:e=>{a(e.detail.value)},onValueChange:e=>{t?.(e.detail.value)}})};function VertexSelectionHighlightingControls({onUpdateSelectionHighlightColor:a,onUpdateSelectionHighlightOpacity:i,onUpdateSelectionHighlightLineThickness:o}){return t(n,{children:[e("div",{className:"pt-1 pb-2 text-sm text-neutral-700",children:"Color"}),e(VertexSelectionHighlightingColorPicker,{onUpdate:a}),e("div",{className:"pt-4 pb-2 text-sm text-neutral-700",children:"Opacity"}),e(VertexSelectionHighlightingOpacitySlider,{onUpdate:i}),e("div",{className:"pt-4 pb-2 text-sm text-neutral-700",children:"Line Thickness"}),e(VertexSelectionHighlightingLineThicknessSlider,{onUpdate:o})]})}const VertexSelectionHighlightingReset=({onReset:t})=>{const[n,a]=l(Qa),[i,o]=l(ei),[r,s]=l(ti),c=undefined;return e("div",{className:"ml-auto",children:e(R,{content:"Reset Selection Highlighting",children:e(D,{"data-testid":"selection-highlighting-reset",iconName:"reset",iconSize:"sm",onClick:()=>{a(Xa),o(Za),s(1),t?.()},disabled:!(n!==Xa||i!==Za||1!==r)})})})};function VertexSelectionHighlightingPanelSection({onResetSelectionHighlighting:n,onUpdateSelectionHighlightColor:a,onUpdateSelectionHighlightOpacity:i,onUpdateSelectionHighlightLineThickness:o}){return e(PanelSection,{header:t("div",{className:"flex items-center text-base",children:["Selection Highlighting",e(VertexSelectionHighlightingReset,{onReset:n})]}),children:e(VertexSelectionHighlightingControls,{onUpdateSelectionHighlightColor:a,onUpdateSelectionHighlightOpacity:i,onUpdateSelectionHighlightLineThickness:o})})}const VertexViewerBackgroundColorPicker=({onUpdate:t})=>{const[n,a]=l(ai);return e(VertexColorPicker,{"data-testid":"viewer-background-color-picker",value:n,onValueChanged:e=>{t?.(e.detail)},onInput:e=>a(e)})};function VertexViewerBackgroundControls({onUpdateViewerBackgroundColor:a}){return t(n,{children:[e("div",{className:"pt-1 pb-2 text-sm text-neutral-700",children:"Color"}),e(VertexViewerBackgroundColorPicker,{onUpdate:a})]})}const VertexViewerBackgroundReset=({onReset:t})=>{const[n,a]=l(ai),i=undefined;return e("div",{className:"ml-auto",children:e(R,{content:"Reset Background Color",children:e(D,{"data-testid":"viewer-background-reset",iconName:"reset",iconSize:"sm",onClick:()=>{a(ni),t?.()},disabled:!(n!==ni)})})})};function VertexViewerBackgroundPanelSection({onResetViewerBackgroundColor:n,onUpdateViewerBackgroundColor:a}){return e(PanelSection,{header:t("div",{className:"flex items-center text-base",children:["Viewer Background",e(VertexViewerBackgroundReset,{onReset:n})]}),children:e(VertexViewerBackgroundControls,{onUpdateViewerBackgroundColor:a})})}const isInputElement=e=>{const t=e instanceof HTMLElement&&"VERTEX-AUTO-RESIZE-TEXTAREA"===e.tagName,n=e instanceof HTMLElement&&"VERTEX-TEXTFIELD"===e.tagName,a=e instanceof HTMLElement&&"true"===e.contentEditable,i=e instanceof HTMLElement&&"VERTEX-SCENE-TREE-SEARCH"===e.tagName,o=e instanceof HTMLInputElement||e instanceof HTMLTextAreaElement,r=e instanceof HTMLElement&&"VERTEX-VIEWER-PIN-TOOL"===e.tagName,s=e instanceof HTMLElement&&"VERTEX-VIEWER-TRANSFORM-WIDGET"===e.tagName;return t||n||a||i||o||r||s},useRecoilReducer=({reducer:e,atom:t})=>{const n=undefined,a=undefined;return[s(t),useRecoilReducerDispatch({reducer:e,atom:t})]},useRecoilReducerDispatch=({reducer:e,atom:t})=>{const n=i((({set:n})=>async a=>{n(t,(t=>e(t,a)))}),[]);return n},oi=o({key:"keyBindings",default:{applyBindings:[],bindings:{},pressed:{}}});function reducer(e,t){switch(t.type){case"push-key-binding":const n=e.bindings[t.binding.keyBind]?.find((e=>e.id===t.binding.id));return null!=n?e:{...e,bindings:{...e.bindings,[t.binding.keyBind]:[...e.bindings[t.binding.keyBind]??[],t.binding]}};case"remove-key-binding":const a=e.bindings[t.binding.keyBind]?.find((e=>e.id===t.binding.id));return null==a?e:{...e,bindings:{...e.bindings,[t.binding.keyBind]:(e.bindings[t.binding.keyBind]??[]).filter((e=>e.id!==t.binding.id))}};case"add-apply-key-binding":return{...e,applyBindings:[...e.applyBindings,t.binding]};case"remove-apply-key-binding":return{...e,applyBindings:e.applyBindings.filter((e=>e.id!==t.id))};case"set-key-pressed":return{...e,applyBindings:e.applyBindings.map((t=>({...t,active:null!=t.keyBind&&allPressed(t.keyBind,e.pressed)}))),pressed:{...e.pressed,[t.key]:t.pressed},lastPressed:t.pressed?t.key:void 0}}}const useKeyBindingState=()=>useRecoilReducer({reducer:reducer,atom:oi}),useKeyBindingReadonlyState=()=>s(oi);function pressedValue(e,t){return e.includes("!")?!t[e.replace("!","")]&&!t[e.replace("!","").toLowerCase()]:t[e]||t[e.toLowerCase()]}function isPressed(e,t){const n=e.split("||");return n.length>1?n.some((e=>pressedValue(e,t))):pressedValue(n[0],t)}function allPressed(e,t){const n=undefined;return e.split("+").every((e=>isPressed(e,t)))}function matchingSingleFnBindings(e,t,n){return e.filter((e=>!e.repeat)).filter((e=>null!=e.keyBind&&null!=n&&e.keyBind?.includes(n)&&allPressed(e.keyBind,t))).map((e=>e.fn))}function matchingOffBindings(e,t,n){return e.filter((e=>e.off&&e.active&&null!=e.keyBind&&null==n&&!allPressed(e.keyBind,t))).map((e=>e.off))}const useApplyKeyBinding=e=>{const[t,n]=useKeyBindingState();A.useEffect((()=>{const a=_e.create();return n({type:"add-apply-key-binding",binding:{...e,id:a,active:null!=e.keyBind&&allPressed(e.keyBind,t.pressed)}}),()=>{n({type:"remove-apply-key-binding",id:a})}}),[e.fn,e.off,e.keyBind,e.repeat])},useStackKeyBinding=(e,t=[])=>{const[,n]=useKeyBindingState();A.useEffect((()=>{const t=null==e.addPredicate||e.addPredicate(),a=null!=e.cancelPredicate&&e.cancelPredicate();t&&n({type:"push-key-binding",binding:e}),a&&n({type:"remove-key-binding",binding:e})}),t)},useKeyBindings=({keydownRepeatInterval:e=25,keydownIgnorePredicate:t=isInputElement}={})=>{const[n,a]=useKeyBindingState(),i=A.useCallback((e=>{Object.keys(n.bindings).filter((t=>t.includes(e)&&allPressed(t,{...n.pressed,[e]:!0}))).forEach((e=>{const t=n.bindings[e],i=t.length>0?t[t.length-1]:void 0;null!=i&&(i.fn(),a({type:"remove-key-binding",binding:i}))}))}),[n]);A.useEffect((()=>{const handleKeyDown=e=>{if(!e.repeat&&!t(e.target)){a({type:"set-key-pressed",key:e.key,pressed:!0}),i(e.key);const t={...n.pressed,[e.key]:!0},o=matchingSingleFnBindings(n.applyBindings,t,e.key),r=matchingOffBindings(n.applyBindings,t,e.key);(o.length>0||r.length>0)&&e.preventDefault()}},handleKeyUp=e=>{a({type:"set-key-pressed",key:e.key,pressed:!1})};return window.addEventListener("keydown",handleKeyDown),window.addEventListener("keyup",handleKeyUp),()=>{window.removeEventListener("keydown",handleKeyDown),window.removeEventListener("keyup",handleKeyUp)}}),[i,n.applyBindings,n.pressed]),A.useEffect((()=>{const e=matchingSingleFnBindings(n.applyBindings,n.pressed,n.lastPressed),t=matchingOffBindings(n.applyBindings,n.pressed,n.lastPressed);e.forEach((e=>e())),t.forEach((e=>e()))}),[n.pressed,n.lastPressed]),A.useEffect((()=>{const t=n.applyBindings.filter((e=>e.repeat&&null!=e.keyBind&&allPressed(e.keyBind,n.pressed))).map((e=>e.fn));if(t.length>0){const n=setInterval((()=>{t.forEach((e=>e()))}),e);return()=>{clearInterval(n)}}return()=>{}}),[n.applyBindings,n.lastPressed])},VertexBoxSelectionButton=()=>{const t=useBoxSelectionActions(),n=s(on);return useStackKeyBinding({id:"ExitBoxSelection",keyBind:"Escape",fn:t.disable,addPredicate:()=>n,cancelPredicate:()=>!n},[n]),e(R,{content:"Box Selection",children:e(D,{iconName:"box-cursor",iconColor:n?"primary":"secondary","data-testid":"viewer-toolbar-enable-box-selection-button",onClick:n?t.disable:t.enable})})},ri=1,VertexResizableContent=({className:n,style:a,displayShadow:i,heading:o,id:r,initialScale:s,placement:l="left",children:c,onResize:d,...u})=>{const m="left"===l||"right"===l,p="top"===l;function getHorizontalResizeDirection(){switch(l){case"left":return"right";case"right":return"left";default:return"none"}}function getVerticalResizeDirection(){return"top"===l?"top":"none"}const h=null!=s?s:1;return e(G,{id:r,"data-testid":`resizable-content-position-${l}`,className:Kt(n,"pointer-events-auto z-popover md:z-overlay bg-white bg-opacity-95 flex-grow-0 flex-shrink-0 border-neutral-300",{"border-r min-w-75 max-w-half":"left"===l,"sidebar-shadow-right":"left"===l&&i,"border-l min-w-75 max-w-half":"right"===l,"sidebar-shadow-left":"right"===l&&i,"border-t bottom-0 fixed":"top"===l,"min-h-12 sheet":p}),style:{maxHeight:"top"===l?window.innerHeight:void 0,...a},initialHorizontalScale:m?s:void 0,initialVerticalScale:p?h:void 0,horizontalDirection:getHorizontalResizeDirection(),verticalDirection:getVerticalResizeDirection(),position:"right"===l||"top"===l?"absolute":"relative",onResizeEnd:()=>d?.(),...u,children:t("div",{className:"flex flex-col h-full w-full",children:["top"===l&&e("div",{className:"flex justify-center w-full",children:e("div",{className:"block md:hidden w-20 h-0.5 mt-0.5 bg-neutral-600 rounded"})}),o,e("div",{className:Kt("w-full flex flex-col h-0 flex-grow",{"right-0":"right"===l}),children:c})]})})};function useDefaultKeybindings(){useApplyKeyBinding({fn:useActionCallback((({snapshot:e})=>async()=>{const t=await e.getPromise(et),n=await(t?.scene()),a={milliseconds:500};await(n?.camera().viewAll().render({animation:a}))})),keyBind:"f"})}function useLongPress({target:e,callback:t,delay:n=500,onMovement:a}){const[i,o]=k.useState(),[r,s]=k.useState();k.useEffect((()=>{const handleTouchStart=e=>{const a=e;null!=a.touches&&1===a.touches.length&&(null!=i&&clearTimeout(i),s(w.create(a.touches[0].clientX,a.touches[0].clientY)),o(setTimeout((()=>t?.(a)),n)))},handleTouchMove=e=>{const t=e;null!=t.touches&&t.touches.length>0&&null!=i&&null!=r&&w.distance(r,w.create(t.touches[0].clientX,t.touches[0].clientY))>=2&&(clearTimeout(i),a?.())},handleTouchEnd=()=>{null!=i&&clearTimeout(i)};return e?.addEventListener("touchstart",handleTouchStart),e?.addEventListener("touchmove",handleTouchMove),e?.addEventListener("touchend",handleTouchEnd),()=>{e?.removeEventListener("touchstart",handleTouchStart),e?.removeEventListener("touchmove",handleTouchMove),e?.removeEventListener("touchend",handleTouchEnd)}}),[e,i,r])}var si=Object.freeze({__proto__:null,isInputElement:isInputElement,keyBindings:oi,reducer:reducer,useApplyKeyBinding:useApplyKeyBinding,useDefaultKeybindings:useDefaultKeybindings,useKeyBindingReadonlyState:useKeyBindingReadonlyState,useKeyBindings:useKeyBindings,useLongPress:useLongPress,useStackKeyBinding:useStackKeyBinding});function asBooleanAttribute(e){return!!e||void 0}const VertexContextMenu=({targetElement:t,menuType:n,disableBackdrop:a,openPredicate:i,onOpen:o,onClose:r,children:l})=>{const c=useContextMenuActions(),d=s(Zt),u=s(nn),m=A.useMemo((()=>["bottom-end","top-start","top-end","right","left"]),[]),p=d===n;useStackKeyBinding({id:"ContextMenu",keyBind:"Escape",fn:c.clearActiveContextMenu,addPredicate:()=>null!=d&&d===n,cancelPredicate:()=>null==d},[d]);const h=A.useMemo((()=>null!=t?t:null!=i?window:void 0),[t,i]);return useLongPress({target:h,callback:e=>c.longPress(e,n,i,o),onMovement:()=>c.clearActiveContextMenu()}),A.useEffect((()=>{const handleWindowPointerDown=e=>{const t=undefined;if(!targetWithinMenu(e)&&2!==e.buttons&&d===n){const t=targetShouldSkipNextHit(e);c.clearActiveContextMenu(t)}};if(a)return window.addEventListener("pointerdown",handleWindowPointerDown),()=>{window.removeEventListener("pointerdown",handleWindowPointerDown)}}),[a,n,d]),A.useEffect((()=>{const handlePointerDown=e=>{c.pointerDown(e)},handlePointerUp=e=>{c.pointerUp(e,n,i,o)},handleContextMenu=e=>c.contextMenu(e,i);return h?.addEventListener("pointerdown",handlePointerDown),h?.addEventListener("pointerup",handlePointerUp),h?.addEventListener("contextmenu",handleContextMenu),()=>{h?.removeEventListener("pointerdown",handlePointerDown),h?.removeEventListener("pointerup",handlePointerUp),h?.removeEventListener("contextmenu",handleContextMenu)}}),[t,n,i]),e("div",{className:Kt({hidden:!p}),children:e(K,{"data-testid":`${n}-context-menu`,open:asBooleanAttribute(p),position:u,fallbackPlacements:m,backdrop:!a,onMenuClosed:()=>{c.clearActiveContextMenu(),r?.()},children:e("div",{className:"pt-1",children:l})})})},VertexFitSelectedMenuItem=()=>{const n=s(In),a=s(Bn),i=useViewerCameraActions();return e(W,{"data-testid":"fit-selected-menu-option",onClick:async()=>{null!=a?.boundingBox&&await i.flyToByBoundingBox(a.boundingBox)},disabled:asBooleanAttribute(0===n.length),children:t("div",{className:"flex align-middle gap-2.5",children:[e(F,{slot:"icon",name:"fit-selected",size:"sm"}),"Fit Selected"]})})},VertexFlyToMenuItem=()=>{const n=useViewerCameraActions(),a=s(en);return e(W,{"data-testid":"fly-to-part-menu-option",onClick:async()=>{const e=undefined,t=contextMenuItemIsRow(a)?a?.node.id?.hex:a?.id;null!=t&&await n.flyToById(t)},disabled:asBooleanAttribute(null==a),children:t("div",{className:"flex align-middle gap-2.5",children:[e(F,{slot:"icon",name:"paper-airplane",size:"sm"}),"Fly To"]})})};function useSceneItemsOperations(){const e=s(et),t=undefined,n=undefined,a=undefined,i=undefined,o=undefined,r=undefined;return{sceneItemsOperation:A.useCallback((async(t,n)=>{const a=await(e?.scene());null==n?await(a?.items((e=>t(e.where((e=>e.all()))))).execute()):n.length>0&&await(a?.items((e=>t(e.where((e=>e.withItemIds(n)))))).execute())}),[e]),showOnlySelected:A.useCallback((async()=>{const t=await(e?.scene());t?.items((e=>[e.where((e=>e.all())).hide(),e.where((e=>e.withSelected())).show()])).execute()}),[e]),hideSelected:A.useCallback((async()=>{const t=await(e?.scene());t?.items((e=>[e.where((e=>e.withSelected())).hide()])).execute()}),[e]),showOnlyItem:A.useCallback((async t=>{const n=await(e?.scene());n?.items((e=>[e.where((e=>e.all())).hide(),e.where((e=>e.withItemIds([t]))).show()])).execute()}),[e]),ghostSelected:A.useCallback((async()=>{const t=await(e?.scene());t?.items((e=>[e.where((e=>e.withSelected())).setPhantom(!0)])).execute()}),[e]),unGhostSelected:A.useCallback((async()=>{const t=await(e?.scene());t?.items((e=>[e.where((e=>e.withSelected())).setPhantom(!1)])).execute()}),[e])}}const VertexHideAllMenuItem=()=>{const n=useSceneItemsOperations();return e(W,{"data-testid":"hide-all-menu-option",onClick:async()=>{await n.sceneItemsOperation((e=>e.hide()))},children:t("div",{className:"flex align-middle gap-2.5",children:[e(F,{slot:"icon",name:"visibility-hidden",size:"sm"}),"Hide All Parts"]})})},VertexHidePartMenuItem=()=>{const n=s(en),a=useSceneItemsOperations();return e(W,{"data-testid":"hide-menu-option",onClick:async()=>{const e=undefined,t=contextMenuItemIsRow(n)?n?.node.id?.hex:n.id;null!=t&&await a.sceneItemsOperation((e=>e.hide()),[t])},disabled:asBooleanAttribute(null==n),children:t("div",{className:"flex align-middle gap-2.5",children:[e(F,{slot:"icon",name:"visibility-hidden",size:"sm"}),"Hide Part"]})})},VertexHideSelectedMenuItem=()=>{const n=s(In),a=useSceneItemsOperations();return e(W,{"data-testid":"hide-selected-menu-option",onClick:()=>a.hideSelected(),disabled:asBooleanAttribute(0===n.length),children:t("div",{className:"flex align-middle gap-2.5",children:[e(F,{slot:"icon",name:"visibility-hidden",size:"sm"}),"Hide Selected"]})})},VertexShowAllMenuItem=()=>{const n=useSceneItemsOperations();return e(W,{"data-testid":"show-all-menu-option",onClick:async()=>{await n.sceneItemsOperation((e=>e.show()))},children:t("div",{className:"flex align-middle gap-2.5",children:[e(F,{slot:"icon",name:"visibility-visible",size:"sm"}),"Show All Parts"]})})},VertexShowOnlyMenuItem=()=>{const n=s(en),a=useSceneItemsOperations();return e(W,{"data-testid":"show-only-menu-option",onClick:async()=>{const e=undefined,t=contextMenuItemIsRow(n)?n?.node.id?.hex:n?.id;null!=t&&await a.showOnlyItem(t)},disabled:asBooleanAttribute(null==n),children:t("div",{className:"flex align-middle gap-2.5",children:[e(F,{slot:"icon",name:"visibility-visible",size:"sm"}),"Show Only Part"]})})},VertexShowOnlySelectedMenuItem=()=>{const n=s(In),a=useSceneItemsOperations();return e(W,{"data-testid":"show-only-selected-menu-option",onClick:()=>a.showOnlySelected(),disabled:asBooleanAttribute(0===n.length),children:t("div",{className:"flex align-middle gap-2.5",children:[e(F,{slot:"icon",name:"visibility-visible",size:"sm"}),"Show Only Selected"]})})},li=o({key:"openedPanelActivePrimaryLeft",default:void 0}),ci=o({key:"openedPanelActivePrimaryRight",default:void 0}),di=o({key:"openedPanelActiveSceneTreeSecondary",default:void 0});function usePanelActions(){return{openPrimary:useActionCallback((({set:e})=>(t,n)=>{e("left"===n?li:ci,t)})),closePrimary:useActionCallback((({set:e})=>t=>{e("left"===t?li:ci,void 0)})),openSecondary:useActionCallback((({set:e})=>t=>e(di,t))),closeSecondary:useActionCallback((({reset:e})=>()=>e(di)))}}var ui=Object.freeze({__proto__:null,openedPanelActivePrimaryLeft:li,openedPanelActivePrimaryRight:ci,openedPanelActiveSceneTreeSecondary:di,usePanelActions:usePanelActions});const VertexShowPropertiesMenuItem=()=>{const n=usePanelActions(),a=useSelectionActions(),i=s(en);return e(W,{"data-testid":"show-properties-menu-option",disabled:asBooleanAttribute(null==i),onClick:()=>{const e=undefined,t=contextMenuItemIsRow(i)?i?.node.id?.hex:i?.id;null!=t&&(a.clearAndSelect({id:t}),n.openSecondary("Properties"))},children:t("div",{className:"flex align-middle gap-2.5",children:[e(F,{slot:"icon",name:"info",size:"sm"}),"Show Properties"]})})};function fromApiProperty(e){return{key:e.key?.name??"",value:apiMetadataPropertyDisplayValue(e.value)}}function apiMetadataPropertyDisplayValue(e){let t="";switch(e?.type){case"string":t=e.value??t;break;case"long":case"double":t=e.value.toString()??t;break;case"timestamp":t=e.value.seconds.toLocaleString()??t}return t}const mi=o({key:"showMetadataSceneItemProperties",default:!0}),pi=d({key:"nextMetadataSceneItemProperties",get:e=>async({get:t})=>{const n=t(et),a=t(fi(e));try{const t=await(n?.sceneItems?.listSceneItemMetadata(e,{cursor:a,size:20})),i=t?.entries?.map((e=>fromApiProperty(e))),o=undefined;return{metadata:null!=i?[...i]?.sort(((e,t)=>e.key>t.key?1:-1)):void 0,cursor:t?.paging.next}}catch(t){return void logger_debug(`Error encountered get metadata for scene item. [itemId={${e}}]`,t)}}}),hi=u({key:"loadedMetadataSceneItemProperties",default:[]}),fi=u({key:"metadataSceneItemPropertiesCursor",default:void 0}),gi=d({key:"hasMoreMetadataSceneItemProperties",get:e=>({get:t})=>{const n=undefined;return null!=t(fi(e))}}),yi=u({key:"isFetchingMetadataSceneItemProperties",default:!1}),vi=r({key:"metadataSceneItemName",get:async({get:e})=>{const t=e(Nn);if(null!=t){const n=e(Mn(t.id));return n?.name??void 0}}});var bi=Object.freeze({__proto__:null,apiMetadataPropertyDisplayValue:apiMetadataPropertyDisplayValue,fromApiProperty:fromApiProperty,hasMoreMetadataSceneItemProperties:gi,isFetchingMetadataSceneItemProperties:yi,loadedMetadataSceneItemProperties:hi,metadataSceneItemName:vi,metadataSceneItemPropertiesCursor:fi,nextMetadataSceneItemProperties:pi,showMetadataSceneItemProperties:mi});const VertexGhostSelectedMenuItem=()=>{const n=s(In),a=useSceneItemsOperations();return e(W,{"data-testid":"ghost-selected-menu-option",onClick:()=>a.ghostSelected(),disabled:asBooleanAttribute(0===n.length),children:t("div",{className:"flex align-middle gap-2.5",children:[e(F,{slot:"icon",name:"visibility-partial",size:"sm"}),"Ghost Selected"]})})};function BetaLabel({children:n,label:a="Beta",placement:i="end",borderColor:o="border-purple-400",textColor:r="text-purple-500"}){return t("div",{className:"flex items-center",children:[n,e("div",{className:Kt(`flex border ${o} rounded-md px-1.5 text-xs ${r} uppercase items-center justify-center ml-2 select-none max-h-5`,{"ml-auto":"end"===i}),style:{height:"fit-content"},children:a})]})}const VertexShowModelViewsMenuItem=()=>{const n=usePanelActions(),a=useSelectionActions(),i=s(en);return e(W,{"data-testid":"viewer-show-model-views",disabled:asBooleanAttribute(null==i),onClick:async()=>{const e=undefined,t=contextMenuItemIsRow(i)?i?.node.id?.hex:i?.id;null!=t&&(n.openPrimary("model-views","right"),a.selectForModelViewsPanel({id:t}))},children:t("div",{className:"flex align-middle gap-2.5",children:[e(F,{slot:"icon",name:"views",size:"sm"}),t("div",{className:"flex gap-2",children:["Show Model Views ",e(BetaLabel,{})]})]})})},VertexUnghostSelectedMenuItem=()=>{const n=s(In),a=useSceneItemsOperations();return e(W,{"data-testid":"unghost-selected-menu-option",onClick:()=>a.unGhostSelected(),disabled:asBooleanAttribute(0===n.length),children:t("div",{className:"flex align-middle gap-2.5",children:[e(F,{slot:"icon",name:"visibility-visible",size:"sm"}),"Unghost Selected"]})})},DefaultSceneTreeContextMenu=()=>{const n=s(mi);return t("div",{className:"w-56",children:[e(VertexHideSelectedMenuItem,{}),e(VertexHideAllMenuItem,{}),e(VertexShowOnlyMenuItem,{}),e(VertexShowOnlySelectedMenuItem,{}),e(VertexShowAllMenuItem,{}),e(VertexGhostSelectedMenuItem,{}),e(VertexUnghostSelectedMenuItem,{}),e($,{}),e(VertexFitSelectedMenuItem,{}),e(VertexFlyToMenuItem,{}),e($,{}),n&&e(VertexShowPropertiesMenuItem,{}),e(VertexShowModelViewsMenuItem,{})]})},VertexSceneTreeContextMenu=({children:t})=>{const n=useSceneTreeActions(),a=s(Na),i=undefined;return e(VertexContextMenu,{menuType:"scene-tree",targetElement:a,onOpen:async(e,t)=>{const a=e;await n.setContextMenuItem(a.clientY)},disableBackdrop:!0,children:null!=t&&!1!==t?t:e(DefaultSceneTreeContextMenu,{})})},DefaultViewerContextMenu=()=>{const n=s(mi);return t("div",{className:"w-56",children:[e(VertexHidePartMenuItem,{}),e(VertexHideSelectedMenuItem,{}),e(VertexHideAllMenuItem,{}),e(VertexShowOnlyMenuItem,{}),e(VertexShowOnlySelectedMenuItem,{}),e(VertexShowAllMenuItem,{}),e(VertexGhostSelectedMenuItem,{}),e(VertexUnghostSelectedMenuItem,{}),e($,{}),e(VertexFitSelectedMenuItem,{}),e(VertexFlyToMenuItem,{}),e($,{}),n&&e(VertexShowPropertiesMenuItem,{}),e(VertexShowModelViewsMenuItem,{})]})},VertexViewerContextMenu=({children:t})=>{const n=null!=t&&!1!==t,a=A.useCallback((e=>e.target instanceof HTMLElement&&"vertex-viewer"===e.target.id),[]);return e(VertexContextMenu,{menuType:"viewer",disableBackdrop:!0,openPredicate:a,children:n?t:e(DefaultViewerContextMenu,{})})},wi=35,Ci=o({key:"sceneItemGhostingSelectedOpacity",default:wi}),Si=u({key:"appliedItemPhantomState",default:void 0}),xi=o({key:"appliedItemPhantomStateIds",default:[]}),ki=r({key:"sceneItemGhostingLastSelectedPhantom",get:({get:e})=>{const t=e(Nn);return null!=t&&(e(Si(t.id))??!1)}}),VertexSceneItemGhostingOpacitySlider=({onApply:t})=>{const[n,a]=l(Ci);return e(VertexSlider,{id:"phantom-opacity","data-testid":"phantom-opacity-slider",leftLabel:"0%",rightLabel:"100%",min:0,max:100,step:5,value:n,valueLabelDisplay:"auto",onValueInput:e=>{a(e.detail.value)},onValueChange:e=>{t?.(e.detail.value)}})},useSceneItemPhantomActions=()=>{const e=useViewerSceneActions(),t=useActionCallback((({snapshot:e,reset:t})=>async()=>{const n=undefined;(await e.getPromise(xi)).forEach((e=>t(Si(e)))),t(xi)}));return{setPhantomState:useActionCallback((({snapshot:t,set:n})=>async a=>{const i=await t.getPromise(In);i.forEach((e=>n(Si(e),a))),n(xi,(e=>[...e,...i])),await e.execute(An.SET_PHANTOM_SELECTED_ITEMS,(e=>e.where((e=>e.withSelected())).setPhantom(a)))})),clearPhantomState:useActionCallback((({snapshot:t,set:n,reset:a})=>async()=>{const i=await t.getPromise(In);i.forEach((e=>a(Si(e)))),n(xi,(e=>e.filter((e=>!i.includes(e))))),await e.execute(An.CLEAR_PHANTOM_SELECTED_ITEMS,(e=>e.where((e=>e.withSelected())).clearPhantom()),(e=>e.where((e=>e.withSelected())).select()))})),clearAllPhantomState:useActionCallback((()=>async()=>{await t(),await e.execute(An.CLEAR_PHANTOM_ALL,(e=>e.where((e=>e.all())).clearPhantom()),(e=>e.where((e=>e.withSelected())).select()))})),resetAllPhantomState:t}};var Ai=Object.freeze({__proto__:null,DEFAULT_GHOSTING_OPACITY:wi,appliedItemPhantomState:Si,appliedItemPhantomStateIds:xi,sceneItemGhostingLastSelectedPhantom:ki,sceneItemGhostingSelectedOpacity:Ci,useSceneItemPhantomActions:useSceneItemPhantomActions});const VertexSceneItemGhostingToggle=({onApply:t})=>{const n=useSceneItemPhantomActions(),a=s(Fn),i=p(ki);return e(R,{content:"Select a part to display as ghost",disabled:a,children:e(_,{className:"flex items-center","data-testid":"phantom-state-toggle",variant:"switch",disabled:!a,checked:"hasValue"===i.state&&i.contents,onValueChanged:async e=>{await n.setPhantomState(e.detail),t?.(e.detail)}})})};function VertexGhostingControls({onApplyGhostingChange:a,onApplyOpacity:i}){return t(n,{children:[t("div",{className:"flex items-center py-3",children:[e(VertexSceneItemGhostingToggle,{onApply:a}),e("span",{className:"pl-4 text-sm text-neutral-700",children:"Display as Ghost"})]}),e("div",{className:"pt-4 pb-2 text-sm text-neutral-700",children:"Global Ghost Opacity"}),e(VertexSceneItemGhostingOpacitySlider,{onApply:i})]})}const VertexSceneItemGhostingClear=({onClear:n,onClearAll:a})=>{const i=useSceneItemPhantomActions(),o=s(ki);return e("div",{className:"ml-auto",children:t(ResetButton,{id:"phantom",tooltip:"Clear Ghosting",children:[e("div",{className:"pt-1"}),e(W,{"data-testid":"reset-selected-phantom",onClick:async()=>{await i.clearPhantomState(),n?.()},disabled:!o,children:"Clear ghosting for selected"}),e(W,{"data-testid":"reset-all-phantom",onClick:async()=>{await i.clearAllPhantomState(),a?.()},children:"Clear ghosting for all"})]})})};function VertexGhostingPanelSection({onClearGhostState:n,onClearAllGhostState:a,onApplyGhostingChange:i,onApplyOpacity:o}){return e(PanelSection,{header:t("div",{className:"flex items-center text-base",children:["Ghosting",e(VertexSceneItemGhostingClear,{onClear:n,onClearAll:a})]}),children:e(VertexGhostingControls,{onApplyGhostingChange:i,onApplyOpacity:o})})}function VertexMeasurementContextMenu({onDelete:n}){const a=s(Qt);return e(VertexContextMenu,{menuType:"measurement",openPredicate:e=>e.target instanceof HTMLElement&&"VERTEX-VIEWER-MEASUREMENT-DISTANCE"===e.target.tagName,children:t(W,{"data-testid":"measurement-delete",onClick:()=>null!=a&&n(a.id),children:[e(F,{slot:"icon",name:"delete",size:"sm"}),e("div",{className:"pl-2",children:"Delete"})]})})}function useDockedPlacement(e,t){const[n,a]=k.useState(w.create(0,0));return k.useLayoutEffect((()=>{if(null!=e){const n=e.getBoundingClientRect(),i=w.create(n.left,n.bottom),o=w.create(n.right,n.bottom);a("left"===t?i:o)}}),[e,t]),n}function VertexMeasurementDetails({placement:n,size:a}){const i=useMeasurementActions(),o=s(et),r=s(tt),l=useDockedPlacement(o??null,n),c=s(bn),d=s(wn),u=s(Cn),m=s(Sn),p=s(Kn),h=s($n);return e(q,{className:"z-popover",boundaryPadding:16,boundarySelector:`#${r}`,position:l,children:t("div",{className:Kt("flex flex-col min-w-40",{"text-xs leading-2":"sm"===a,"text-sm leading-4":"md"===a,"text-base leading-5":"lg"===a,"text-lg leading-5":"xl"===a}),children:[t("div",{className:"pb-2 flex justify-between items-center",children:[e("div",{className:Kt("w-full",{"text-sm leading-5":"sm"===a,"text-base leading-5":"md"===a,"text-lg leading-6":"lg"===a,"text-xl leading-7 mr-6":"xl"===a}),children:"Measurement"}),e("div",{className:Kt("mr-0.5",{hidden:!m}),children:e(R,{content:"Reset",placement:"left-start",children:e(D,{"data-testid":"measurement-details-reset",iconName:"reset",iconSize:"sm",onClick:i.resetMeasurement})})})]}),e(re,{"data-testid":"measurement-details-viewer-measurement-details",className:Kt("gap-y-1.5",{hidden:null==c}),measurementOutcome:c,measurementOverlays:d,distanceUnits:toUnitType(p),fractionalDigits:parseInt(h,10)}),e("div",{"data-testid":"measurement-details-message",className:Kt({hidden:null==u}),children:u})]})})}function useCallbackRef(e){const[t,n]=A.useState(e?.override??null),a=undefined;return{element:t,callback:A.useCallback((t=>n(e?.override??t)),[])}}function VertexPointToPointMeasurement({detailsPlacement:a,detailsSize:i,onPointToPointMeasurementChange:o}){const r=useMeasurementActions(),l=s(et),c=s(ln),d=s(dn),u=s(Kn),m=s($n),{callback:p,element:h}=useCallbackRef();usePointToPointMeasurement(h);const f=P((e=>{const t={start:e.detail.start,end:e.detail.end,invalid:!e.detail.valid};r.setEditedPointToPointMeasurement(t),o?.(t)}),[r]);return c?t(n,{children:[e(se,{"data-testid":"point-to-point-measurement",ref:p,viewer:l??void 0,mode:"replace",start:d?.start,end:d?.end,invalid:d?.invalid,units:toUnitType(u),fractionalDigits:parseInt(m,10),showAxisReferenceLines:!0,onEditEnd:f}),e(VertexMeasurementDetails,{placement:a,size:i}),e(VertexMeasurementContextMenu,{onDelete:r.resetMeasurement})]}):e(n,{})}function VertexPointToPointMeasurementTool(){const t=useMeasurementActions(),n=s(ln);return useStackKeyBinding({id:"ExitMeasurement",keyBind:"Escape",fn:t.disableEditMeasurement,addPredicate:()=>n,cancelPredicate:()=>!n},[n,t]),e(R,{content:"Point to Point Measurement",children:e(D,{iconName:"tape-measure","data-testid":"viewer-toolbar-point-to-point-measurement-button",iconColor:n?"primary":"secondary",onClick:t.toggleEditPointToPointMeasurement})})}const Ti=o({key:"viewerToolkitSdkConfig",default:void 0});var Pi=Object.freeze({__proto__:null,sdkConfig:Ti});const VertexPreciseMeasurement=({detailsPlacement:a,detailsSize:i,onEntitiesChanged:o,onOutcomeChanged:r})=>{const l=s(et),c=s(Ti),d=s(mn),{callback:u,element:m}=useCallbackRef();return usePreciseMeasurementModel(m,o,r),d?t(n,{children:[e(le,{"data-testid":"precise-measurement-viewer-tool",ref:u,viewer:l??void 0,config:JSON.stringify({network:{apiHost:c?.network?.apiHost,renderingHost:c?.network?.renderingHost,sceneTreeHost:c?.network?.sceneTreeHost,sceneViewHost:c?.network?.sceneViewHost}})}),e(VertexMeasurementDetails,{placement:a,size:i})]}):e(n,{})};function VertexPreciseMeasurementTool(){const t=useMeasurementActions(),n=s(mn);return e(R,{content:"Precise Measurement",children:e(D,{iconName:"ruler","data-testid":"viewer-toolbar-precise-measurement-button",iconColor:n?"primary":"secondary",onClick:t.toggleEditPreciseMeasurement})})}function VertexApplicationMessages(){const a=s(Xe),i=s(Ye);return t(n,{children:[null!=a&&e(Y,{className:"z-[16000]",duration:a.duration,open:!0,content:a.message,type:a.type},a.id),null!=i&&e(X,{placement:"bottom-left",className:"z-[16000]",duration:i.duration,open:!0,content:i.message,type:i.type},i.id)]})}const Mi={binding:"{{row.node.name}}",label:"Name",metadataKeyName:"VERTEX_SCENE_ITEM_NAME"};function mapToColumn(e,t){return{label:"name"===e.toLowerCase()?"Name (Property)":e,binding:`{{row.metadata.${e}}}`,initialWidth:t,minWidth:t/2}}const Ei=o({key:"sceneTreeColumnsRefreshTrigger",default:0}),Ii=o({key:"sceneTreeColumnsWhitelistedColumns",default:[]}),Ni=r({key:"sceneTreeColumnsAvailableColumns",get:async({get:e})=>{const t=e(Va);return e(Ei),null!=t?await t.fetchMetadataKeys():[]}}),Vi=r({key:"sceneTreeColumnsAvailableSortedColumns",get:({get:e})=>e(Ni).filter((e=>e!==Mi.metadataKeyName)).sort(((e,t)=>e.localeCompare(t)))}),Oi=o({key:"sceneTreeColumnsVisibleMetadataColumnNames",default:[]}),Li=r({key:"sceneTreeColumnsActiveColumns",get:({get:e})=>{const t=e(Oi),n=e(Na),a=n?.clientWidth;if(null!=a&&a>0){const e=1/(t.length+1)*a,n=(a-e)/t.length;return t.reduce(((e,t)=>{const a=mapToColumn(t,n);return{...e,[a.label]:a}}),{Name:{...Mi,initialWidth:e,minWidth:n}})}return{Name:Mi}}}),_i=r({key:"sceneTreeColumnsActiveColumnNames",get:({get:e})=>Object.keys(e(Li))});function useSceneTreeColumnActions(){return{setActive:useActionCallback((({set:e})=>async t=>{e(Oi,t)})),refreshKeyList:useActionCallback((({set:e})=>()=>{e(Ei,(e=>e+1))}))}}const Ri=16,Di=-8;var zi;function useOpenPositionedPopover({open:e,buttonElement:t,horizontalOffset:n,verticalOffset:a}){const[i,o]=k.useState(),[r,s]=k.useState(),l=undefined;return{position:i,direction:r,handleOpen:k.useCallback((()=>{if(!e){const e=t?.getBoundingClientRect();if(null!=e){const t=n??Ri,i=a??Di,r=e.x>window.innerWidth/2?zi.LEFT:zi.RIGHT;o({x:r===zi.LEFT?e.left-t:e.right+t,y:e.top+i}),s(r)}}}),[e,t])}}!function(e){e.LEFT="left",e.RIGHT="right"}(zi||(zi={}));var Bi=Object.freeze({__proto__:null,DEFAULT_HORIZONTAL_POSITION_OFFSET:Ri,DEFAULT_NAME_COLUMN:Mi,DEFAULT_VERTICAL_POSITION_OFFSET:Di,get PlacementDirection(){return zi},mapToColumn:mapToColumn,sceneTreeColumnsActiveColumnNames:_i,sceneTreeColumnsActiveColumns:Li,sceneTreeColumnsAvailableColumns:Ni,sceneTreeColumnsAvailableSortedColumns:Vi,sceneTreeColumnsRefreshTrigger:Ei,sceneTreeColumnsVisibleMetadataColumnNames:Oi,sceneTreeColumnsWhitelistedColumns:Ii,useOpenPositionedPopover:useOpenPositionedPopover,useSceneTreeColumnActions:useSceneTreeColumnActions});const ji=o({key:"sceneTreeSearchActive",default:!1}),Hi=o({key:"sceneTreeColumnsPartial",default:!1}),Fi=o({key:"sceneTreeSearchValue",default:void 0}),Ui=o({key:"sceneTreeSearchExactMatch",default:!1}),Wi=o({key:"sceneTreeSearchRemoveHiddenItems",default:!1}),Gi=o({key:"sceneTreeSearchResultCount",default:0}),Ki=o({key:"sceneTreeSearchActiveColumns",default:[]}),$i=r({key:"sceneTreeSearchNameColumnActive",get:({get:e})=>{const t=e(Ki);return 0===t.length||t.includes(Mi.metadataKeyName)}});function useSceneTreeSearch({sceneTreeElement:e}){const t=useSceneTreeActions(),n=s(ji),a=c(Gi),i=c(Rn);A.useEffect((()=>{let t;return whenComponentReady(e,(()=>{t=e?.controller?.stateChanged((e=>{void 0!==e?.totalFilteredRows&&a(e?.totalFilteredRows)}))})),()=>{t?.dispose()}}),[e]),A.useEffect((()=>{if(null!=e){let a;return whenComponentReady(e,(()=>{a=e?.controller?.stateChanged((e=>{if(null!=e?.filterTerm){const t=e?.rows.find((e=>e?.node?.selected));i(t?.node.id?.hex)}else n&&t.flyToFirstSelectedItem()}))})),()=>{a?.dispose()}}}),[e,e?.controller,open])}function useSceneTreePartialResults({sceneTreeElement:e}){const t=c(Hi);A.useEffect((()=>{let n;return whenComponentReady(e,(()=>{n=e?.controller?.stateChanged((e=>{t(!!e?.isPartialKeysResponse)}))})),()=>{n?.dispose()}}),[e])}const useSceneTreeSearchActions=()=>{const e=useActionCallback((({set:e})=>t=>{e(Ki,t)})),t=useActionCallback((({snapshot:t})=>async(n,a,i,o)=>{const r=await t.getPromise(Na),s=await t.getPromise(Ui),l=await t.getPromise(Wi),c=await t.getPromise(Ki),d=c.length>0?a?[...c,n]:c.filter((e=>e!==n)):[...i,Mi.metadataKeyName].filter((e=>e!==n));e(d),o&&r?.filterItems(o,{columns:d,exactMatch:s,removeHiddenItems:l})})),n=useActionCallback((({snapshot:e,set:t})=>async(n,a,i)=>{const o=await e.getPromise(Na),r=await e.getPromise(Ui),s=await e.getPromise(Wi),l=await e.getPromise(Ki),c=n.filter((e=>!a.includes(e))),d=a.filter((e=>!n.includes(e))),u=l.length>0?[...l.filter((e=>!c.includes(e))),...d]:[...a,Mi.metadataKeyName],m=u.length>0?u:[...a,Mi.metadataKeyName];t(Ki,m),i&&o?.filterItems(i,{columns:m,exactMatch:r,removeHiddenItems:s})})),a=useActionCallback((({set:e})=>t=>{e(Ui,t)})),i=useActionCallback((({set:e})=>t=>{e(Wi,t)}));return{setMetadataSearchKeys:e,updateMetadataSearchAfterSearchKeysChange:t,updateMetadataSearchAfterColumnVisibilityChange:n,setMetadataSearchExactMatch:a,setMetadataSearchRemoveHiddenItems:i}};var qi=Object.freeze({__proto__:null,sceneTreeColumnsPartial:Hi,sceneTreeSearchActive:ji,sceneTreeSearchActiveColumns:Ki,sceneTreeSearchExactMatch:Ui,sceneTreeSearchNameColumnActive:$i,sceneTreeSearchRemoveHiddenItems:Wi,sceneTreeSearchResultCount:Gi,sceneTreeSearchValue:Fi,useSceneTreePartialResults:useSceneTreePartialResults,useSceneTreeSearch:useSceneTreeSearch,useSceneTreeSearchActions:useSceneTreeSearchActions});const targetIsElement=(e,t)=>e instanceof Element&&e.tagName===t;function useRecoilRef({state:e}){const t=i((({set:t})=>n=>{t(e,n)}),[]);return t}var Yi;function styleFromOptionalFont(e){return null!=e?{"--scene-tree-default-font-family":styleFromFontFace(e.fontFace),"--scene-tree-default-font-color":e.color}:{}}function styleFromOptionalBackgroundColors(e){const t=e?.depthColors,n=null!=t?Object.keys(t).reduce(((e,n)=>({...e,[`--scene-tree-row-background-color-depth-${n}`]:t[parseInt(n)]})),{}):{};return null!=e?{...n,"--scene-tree-hovered-row-background-color":e.hovered,"--scene-tree-selected-row-background-color":e.selected,"--scene-tree-row-background-color":e.defaultColor}:{}}function styleFromFontFace(e){return e===Yi.ROBOTO_MONO?"var(--vertex-ui-font-family-monospace)":"var(--vertex-ui-font-family)"}!function(e){e.ROBOTO="ROBOTO",e.ROBOTO_MONO="ROBOTO_MONO"}(Yi||(Yi={}));const Xi=o({key:"sceneTreeAdditionalMetadataKeys",default:[]}),Zi=r({key:"sceneTreeActiveMetadataKeys",get:({get:e})=>{const t=e(Xi),n=e(Oi),a=e(Ii),i=new Set([...t,...n]),o=new Set(a);return 0===a.length?Array.from(i):Array.from(i.intersection(o))}});var Ji=Object.freeze({__proto__:null,sceneTreeActiveMetadataKeys:Zi,sceneTreeAdditionalMetadataKeys:Xi});function childrenAsArray(e){return Array.isArray(e)?e:[e]}function filterChildElements(e,t){return childrenAsArray(e).filter((e=>A.isValidElement(e)&&e.type===t))}function findChildElement(e,t){return filterChildElements(e,t)[0]}function cloneChildNodeOrFunction(e,t){return"object"==typeof e?A.cloneElement(e,t):e(t)}function useStateSyncedValue(e,t,{transform:n}={}){const[a,i]=l(e);return A.useEffect((()=>{null!=t&&i(null!=n?n(t):t)}),[t]),a}const VertexEnterSceneTreeSearchModeButton=({onEnterSearchMode:t})=>{const n=c(ji);return e(R,{className:"flex ml-auto",content:"Scene Tree Search",children:e(D,{"data-testid":"enter-scene-tree-search-mode-button",iconName:"search",iconSize:"sm",onPointerDown:e=>{e.preventDefault()},onClick:()=>{n(!0),t?.()}})})},VertexSceneTreeMetadataCheck=({checked:n,disabled:a,onChange:i,children:o})=>{const r="string"==typeof o?o.replace(" ","-"):"";return t("div",{className:"flex items-center",children:[e(_,{"data-testid":`scene-tree-metadata-check-${r}`,variant:"check",checked:n,disabled:a,onValueChanged:e=>i?.(e.detail)}),e("div",{className:"pl-2 py-1 text-[0.875rem] w-full","data-testid":`scene-tree-metadata-name-${r}`,onClick:()=>{a||i?.(!n)},children:o})]})},VertexSceneTreeSearchOptionsPopover=({onSearchedSceneTreeColumnsChange:a,onSearchForExactMatchChange:i})=>{const o=useSceneTreeActions(),r=useSceneTreeSearchActions(),l=s(Na),c=s($i),d=s(Ki),u=s(Fi),m=s(Ui),p=s(Wi),h=s(Oi),{element:f,callback:g}=useCallbackRef(),v="scene-tree-search",b=s(La(v)),{position:w,direction:C,handleOpen:S}=useOpenPositionedPopover({open:b,buttonElement:f,horizontalOffset:20}),A=k.useCallback((()=>{o.closeSceneTreePopover()}),[]),T=C===zi.LEFT?"left-end":"right-start",updateSearch=async(e,t)=>{if(u){const n=d.length>0?d:[...h,Mi.metadataKeyName];await(l?.filterItems(u,{columns:n,exactMatch:e,removeHiddenItems:t}))}};return t(n,{children:[e(R,{content:"Search Options",placement:"top",children:e(D,{"data-testid":"scene-tree-search-options-popover-button",className:"text-neutral-700",ref:g,iconName:"gear",iconSize:"sm",onClick:()=>{b?A():(S(),o.openSceneTreePopover(v))}})}),b&&e(Z,{"data-testid":"scene-tree-search-options-popover",open:b,backdrop:!1,position:w,resizeBehavior:"fixed",placement:T,className:"z-popover",children:t("div",{className:Kt("flex flex-col bg-white border border-neutral-300 rounded",{hidden:!b}),children:[t("div",{className:"flex items-center text-[0.875rem] p-3 border-b border-neutral-300 pb-2",children:[e("div",{className:"pr-2 text-[0.875rem] whitespace-nowrap",children:"Column Properties Search"}),e(D,{className:"ml-auto",iconName:"close",iconSize:"sm",onClick:()=>{A()}})]}),t("div",{className:"max-h-64 p-3 overflow-y-auto",children:[e("div",{className:"text-[0.875rem] pb-2 pr-2",children:"Select properties to perform the search on:"}),e(VertexSceneTreeMetadataCheck,{checked:c,disabled:0===d.length||d.every((e=>e===Mi.metadataKeyName)),onChange:async e=>{await r.updateMetadataSearchAfterSearchKeysChange(Mi.metadataKeyName,e,h,u),a?.()},children:Mi.label},Mi.metadataKeyName),h.map((t=>e(VertexSceneTreeMetadataCheck,{checked:d.includes(t),disabled:d.length>0&&d.every((e=>e===t)),onChange:async e=>{await r.updateMetadataSearchAfterSearchKeysChange(t,e,h,u),a?.()},children:t},t)))]}),t("div",{className:"flex p-3 border-t border-neutral-300",children:[e(_,{className:"flex items-center","data-testid":"filter-exact-match-toggle",variant:"switch",checked:m,onValueChanged:async e=>{r.setMetadataSearchExactMatch(e.detail),i?.(),await updateSearch(e.detail,p)}}),e("span",{className:"pl-4 text-[0.875rem] text-neutral-800",children:"Return only exact matches"})]}),t("div",{className:"flex px-3 pb-3",children:[e(_,{className:"flex items-center","data-testid":"filter-remove-hidden-items-toggle",variant:"switch",checked:p,onValueChanged:async e=>{r.setMetadataSearchRemoveHiddenItems(e.detail),await updateSearch(m,e.detail)}}),e("span",{className:"pl-4 text-[0.875rem] text-neutral-800",children:"Search only visible items"})]})]})})]})},VertexSceneTreeSearchBar=({onSearch:n,onClearSearch:a,onExitSearchMode:i,onSearchedSceneTreeColumnsChange:o,onSearchForExactMatchChange:r,sceneTreeSearchElement:c,children:d})=>{const u=useSceneTreeActions(),m=s(Na),[p,h]=l(ji),[f,g]=l(Fi),v=s(La("scene-tree-search"));useSceneTreeSearch({sceneTreeElement:m??null});const{element:b,callback:w}=useCallbackRef({override:c}),C=null==f||""===f;return k.useEffect((()=>{p&&b?.setFocus()}),[b,p]),t("div",{className:"flex w-full py-3 px-2",children:[e(R,{className:"self-center mr-1",content:"Exit Search",children:e(D,{"data-testid":"scene-tree-search-close-button",iconName:"caret-left",iconSize:"sm",onPointerDown:e=>{e.preventDefault()},onClick:async()=>{h(!1),g(void 0),await(b?.clear()),await(m?.filterItems("")),v&&u.closeSceneTreePopover(),await u.flyToFirstSelectedItem(),i?.()}})}),t(ce,{"data-testid":"scene-tree-search-bar",ref:w,controller:m?.controller,onBlur:()=>{C&&(h(!1),i?.(),v&&u.closeSceneTreePopover())},onSearch:()=>{g(b?.value),n?.(b?.value)},children:[d,e(F,{slot:"clear-icon",name:"close-circle-fill",size:"sm",onPointerDown:async()=>{await u.flyToFirstSelectedItem(),a?.()}})]}),e("div",{className:"self-center pl-1",onPointerDown:e=>{e.preventDefault()},children:e(VertexSceneTreeSearchOptionsPopover,{onSearchedSceneTreeColumnsChange:o,onSearchForExactMatchChange:r})})]})},VertexSceneTreeSearch=({onEnterSearchMode:n,onExitSearchMode:a,onSearch:i,onClearSearch:o,onSearchedSceneTreeColumnsChange:r,onSearchForExactMatchChange:l,children:c})=>{const d=s(ji);return t(de,{className:"h-11 p-0 border-b border-neutral-300 box-content",slot:"header",children:[d&&e(VertexSceneTreeSearchBar,{onSearch:i,onClearSearch:o,onExitSearchMode:a,onSearchedSceneTreeColumnsChange:r,onSearchForExactMatchChange:l,children:c}),!d&&e("div",{className:"ml-auto mr-2",children:e(VertexEnterSceneTreeSearchModeButton,{onEnterSearchMode:n})})]})};function useCacheableLoadable(e,t){const n=M(),[a,i]=E(0),o=p(e);T((()=>{"hasValue"===o.state&&(n.current=o.contents)}),[t,o]);const[r,s]=I((()=>"hasValue"!==o.state&&null!=n.current?[n.current,!0]:"hasValue"===o.state?[o.contents,!1]:[void 0,!1]),[o.state,o.contents,a]),l=P((()=>{n.current=void 0,i(a+1)}),[a]),c=undefined;return I((()=>({data:r,state:o.state,cached:s,invalidate:l})),[l,r,s,o.state])}const VertexSceneTreeColumnPopover=({onVisibleSceneTreeColumnsChange:a})=>{const i=useSceneTreeActions(),o=useSceneTreeColumnActions(),r=useSceneTreeSearchActions(),l=undefined;useSceneTreePartialResults({sceneTreeElement:s(Na)??null});const c=s(Fi),d=s(Ii),u=useCacheableLoadable(Vi),m=d.length>0?d:u.data,p=s(Oi),h=s(Hi),[f,g]=k.useState(p),[v,b]=k.useState(""),{element:w,callback:C}=useCallbackRef(),S="scene-tree-columns",A=s(La(S)),{position:T,direction:P,handleOpen:M}=useOpenPositionedPopover({open:A,buttonElement:w}),E=k.useCallback((()=>{i.closeSceneTreePopover()}),[]),I=P===zi.LEFT?"left-end":"right-start",N=k.useMemo((()=>{if(null!=m){const e=m.filter((e=>f.indexOf(e)<0)),t=undefined;return[...[...f].sort(((e,t)=>e.localeCompare(t))),...e]}return[]}),[f,m]),V=k.useMemo((()=>N),[A,m]);return t(n,{children:[e(R,{content:"Configure Columns",placement:"top",children:e(D,{"data-testid":"scene-tree-column-popover-button",ref:C,iconName:"columns-add",iconSize:"sm",onClick:()=>{A?E():(M(),i.openSceneTreePopover(S))}})}),A&&e(Z,{"data-testid":"scene-tree-column-popover",open:A,backdrop:!1,position:T,resizeBehavior:"fixed",placement:I,className:"z-popover",children:t("div",{className:Kt("flex flex-col bg-white border border-neutral-300 rounded",{hidden:!A}),children:[t("div",{className:"flex items-center text-[0.875rem] p-3",children:[t("div",{className:"pr-2",children:[e("div",{className:"text-[0.875rem]",children:"Assembly Properties"}),e("div",{className:"text-[0.75rem] text-neutral-700 mt-1.5",children:"Select up to six properties to appear in the Assembly panel."})]}),e(D,{"data-testid":"scene-tree-columns-popover-close-button",className:"ml-auto",iconName:"close",iconSize:"sm",onClick:()=>{b(""),E()}})]}),e(J,{className:"flex w-full px-2 overflow-hidden border-b border-neutral-300 pb-2",id:"scene-tree-available-columns-search-bar","data-testid":"scene-tree-available-columns-search-bar",multiline:!1,placeholder:"Filter properties",type:"text",onInputInput:e=>{const t=e.detail.value;null!=t&&b(t.toLowerCase())}}),h&&e(ue,{"data-testid":"partial-key-list-notification-banner",message:"loading"===u.state?"Refreshing results...":"Data loading, refresh for more.",actionLabel:"Refresh",onAction:()=>o.refreshKeyList()}),t("div",{className:"max-h-64 p-3 overflow-y-auto",children:[e(VertexSceneTreeMetadataCheck,{checked:!0,disabled:!0,children:Mi.label}),V.filter((e=>""===v||e.toLowerCase().includes(v))).map((t=>e(VertexSceneTreeMetadataCheck,{checked:f.includes(t),disabled:f.length>=6&&!f.includes(t),onChange:e=>{g(e?[...f,t]:f.filter((e=>e!==t)))},children:t},t)))]}),t("div",{className:"flex items-center p-3 border-t border-neutral-300 space-x-4",children:[e("div",{className:"text-[0.75rem] text-[var(--vertex-ui-blue-700)] cursor-pointer","data-testid":"scene-tree-column-clear-selection",onClick:()=>g([]),children:"Clear selection"}),e("div",{className:"flex-grow"}),t("div",{className:"flex space-x-2",children:[e(j,{"data-testid":"scene-tree-column-popover-cancel",color:"secondary",onClick:()=>{b(""),E()},children:"Cancel"}),e(j,{"data-testid":"scene-tree-column-popover-apply",color:"primary",onClick:async()=>{await r.updateMetadataSearchAfterColumnVisibilityChange(p,f,c),await o.setActive(f),a?.(f),b(""),E()},children:"Apply"})]})]})]})})]})};function VertexToolbarDivider(){return e("div",{"data-testid":"toolbar-divider",className:"h-6 w-px bg-neutral-300 mx-1"})}const VertexSceneTreeSearchInformationForToolbar=()=>{const a=useSelectionActions(),i=s(Na),o=s(Fi),r=s(Gi),l=undefined,c=`${r} ${1===r?"result":"results"}`;return t(n,{children:[e(VertexToolbarDivider,{}),t("div",{className:"flex flex-row items-center overflow-hidden",children:[e("div",{className:"px-2 text-[0.8125rem] leading-4 text-neutral-900 truncate","data-testid":"search-result-info",children:`${c}`}),e(R,{className:"w-auto",content:"Select Results",placement:"top",children:e(j,{className:"h-6 rounded cursor-pointer","data-testid":"select-search-results-button",color:"secondary",variant:"text",size:"sm",onClick:async()=>{null!=i&&null!=o&&(await i.selectFilteredItems(o),a.toggleLastSelectWasMultiSelect(!0))},children:t("div",{className:"flex h-6 items-center gap-1",children:[e(F,{size:"sm",name:"check-circle"}),e("span",{className:"whitespace-nowrap",children:"Select Results"})]})})})]})]})},VertexSceneTreeCollapseAll=()=>{const t=s(Na);return e(R,{className:"w-auto",content:"Collapse All",placement:"top",children:e(F,{size:"sm",className:"h-6 w-6 hover:bg-neutral-300 rounded cursor-pointer","data-testid":"collapse-all-icon",name:"collapse-all",onClick:()=>{t?.collapseAll()}})})},VertexSceneTreeExpandAll=()=>{const t=s(Na);return e(R,{className:"w-auto",content:"Expand All",placement:"top",children:e(F,{size:"sm","data-testid":"expand-all-icon",className:"h-6 w-6 hover:bg-neutral-300 rounded cursor-pointer",name:"expand-all",onClick:()=>{t?.expandAll()}})})},VertexSceneTreeToolbar=({onVisibleSceneTreeColumnsChange:n})=>{const a=s(Fi),i=null==a||""===a;return e(de,{className:"h-10 border-b border-neutral-300 box-border",children:t("div",{className:"flex w-full text-neutral-700 items-center gap mx-2",children:[e(VertexSceneTreeExpandAll,{}),e(VertexSceneTreeCollapseAll,{}),!i&&e(VertexSceneTreeSearchInformationForToolbar,{}),e("div",{className:"ml-auto",children:e(VertexSceneTreeColumnPopover,{onVisibleSceneTreeColumnsChange:n})})]})})},VertexSceneTreeHeader=({onEnterSearchMode:a,onExitSearchMode:i,onSearch:o,onClearSearch:r,onVisibleSceneTreeColumnsChange:s,children:l})=>{const c=undefined;return e("div",{slot:"header",className:"flex flex-col",children:null!=l&&!1!==l?l:t(n,{children:[e(VertexSceneTreeSearch,{onEnterSearchMode:a,onExitSearchMode:i,onSearch:o,onClearSearch:r,children:e("div",{slot:"clear-icon"})}),e(VertexSceneTreeToolbar,{onVisibleSceneTreeColumnsChange:s})]})})};function useMetadataActions(){const e=useActionCallback((({snapshot:e,set:t})=>async n=>{const a=undefined;if(await e.getPromise(yi(n)))return;t(yi(n),!0);const i=await e.getPromise(pi(n));if(null!=i?.metadata){const e=[...i.metadata];t(hi(n),(t=>[...t,...e]))}const o=i?.cursor;t(fi(n),o),t(yi(n),!1)}));return{fetchInitialMetadata:useActionCallback((({snapshot:t})=>async n=>{const a=undefined;0===(await t.getPromise(hi(n))).length&&await e(n)})),fetchNextMetadata:useActionCallback((()=>async t=>{await e(t)}))}}var Qi={exports:{}};!function(e,t){Object.defineProperty(t,"__esModule",{value:!0});var n=function(){function defineProperties(e,t){for(var n=0;n<t.length;n++){var a=t[n];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(e,a.key,a)}}return function(e,t,n){return t&&defineProperties(e.prototype,t),n&&defineProperties(e,n),e}}(),a=A,i=_interopRequireDefault(a),o,r=_interopRequireDefault(Ce);function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function _objectWithoutProperties(e,t){var n={};for(var a in e)t.indexOf(a)>=0||Object.prototype.hasOwnProperty.call(e,a)&&(n[a]=e[a]);return n}function _classCallCheck(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function _possibleConstructorReturn(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function _inherits(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var s=function(e){function InfiniteScroll(e){_classCallCheck(this,InfiniteScroll);var t=_possibleConstructorReturn(this,(InfiniteScroll.__proto__||Object.getPrototypeOf(InfiniteScroll)).call(this,e));return t.scrollListener=t.scrollListener.bind(t),t.eventListenerOptions=t.eventListenerOptions.bind(t),t.mousewheelListener=t.mousewheelListener.bind(t),t}return _inherits(InfiniteScroll,e),n(InfiniteScroll,[{key:"componentDidMount",value:function componentDidMount(){this.pageLoaded=this.props.pageStart,this.options=this.eventListenerOptions(),this.attachScrollListener()}},{key:"componentDidUpdate",value:function componentDidUpdate(){if(this.props.isReverse&&this.loadMore){var e=this.getParentElement(this.scrollComponent);e.scrollTop=e.scrollHeight-this.beforeScrollHeight+this.beforeScrollTop,this.loadMore=!1}this.attachScrollListener()}},{key:"componentWillUnmount",value:function componentWillUnmount(){this.detachScrollListener(),this.detachMousewheelListener()}},{key:"isPassiveSupported",value:function isPassiveSupported(){var e=!1,t={get passive(){e=!0}};try{document.addEventListener("test",null,t),document.removeEventListener("test",null,t)}catch(e){}return e}},{key:"eventListenerOptions",value:function eventListenerOptions(){var e=this.props.useCapture;return e=this.isPassiveSupported()?{useCapture:this.props.useCapture,passive:!0}:{passive:!1}}},{key:"setDefaultLoader",value:function setDefaultLoader(e){this.defaultLoader=e}},{key:"detachMousewheelListener",value:function detachMousewheelListener(){var e=window;!1===this.props.useWindow&&(e=this.scrollComponent.parentNode),e.removeEventListener("mousewheel",this.mousewheelListener,this.options?this.options:this.props.useCapture)}},{key:"detachScrollListener",value:function detachScrollListener(){var e=window;!1===this.props.useWindow&&(e=this.getParentElement(this.scrollComponent)),e.removeEventListener("scroll",this.scrollListener,this.options?this.options:this.props.useCapture),e.removeEventListener("resize",this.scrollListener,this.options?this.options:this.props.useCapture)}},{key:"getParentElement",value:function getParentElement(e){var t=this.props.getScrollParent&&this.props.getScrollParent();return null!=t?t:e&&e.parentNode}},{key:"filterProps",value:function filterProps(e){return e}},{key:"attachScrollListener",value:function attachScrollListener(){var e=this.getParentElement(this.scrollComponent);if(this.props.hasMore&&e){var t=window;!1===this.props.useWindow&&(t=e),t.addEventListener("mousewheel",this.mousewheelListener,this.options?this.options:this.props.useCapture),t.addEventListener("scroll",this.scrollListener,this.options?this.options:this.props.useCapture),t.addEventListener("resize",this.scrollListener,this.options?this.options:this.props.useCapture),this.props.initialLoad&&this.scrollListener()}}},{key:"mousewheelListener",value:function mousewheelListener(e){1!==e.deltaY||this.isPassiveSupported()||e.preventDefault()}},{key:"scrollListener",value:function scrollListener(){var e=this.scrollComponent,t=window,n=this.getParentElement(e),a=void 0;if(this.props.useWindow){var i=document.documentElement||document.body.parentNode||document.body,o=void 0!==t.pageYOffset?t.pageYOffset:i.scrollTop;a=this.props.isReverse?o:this.calculateOffset(e,o)}else a=this.props.isReverse?n.scrollTop:e.scrollHeight-n.scrollTop-n.clientHeight;a<Number(this.props.threshold)&&e&&null!==e.offsetParent&&(this.detachScrollListener(),this.beforeScrollHeight=n.scrollHeight,this.beforeScrollTop=n.scrollTop,"function"==typeof this.props.loadMore&&(this.props.loadMore(this.pageLoaded+=1),this.loadMore=!0))}},{key:"calculateOffset",value:function calculateOffset(e,t){return e?this.calculateTopPosition(e)+(e.offsetHeight-t-window.innerHeight):0}},{key:"calculateTopPosition",value:function calculateTopPosition(e){return e?e.offsetTop+this.calculateTopPosition(e.offsetParent):0}},{key:"render",value:function render(){var e=this,t=this.filterProps(this.props),n=t.children,a=t.element,o=t.hasMore;t.initialLoad;var r=t.isReverse,s=t.loader;t.loadMore,t.pageStart;var l=t.ref;t.threshold,t.useCapture,t.useWindow,t.getScrollParent;var c=_objectWithoutProperties(t,["children","element","hasMore","initialLoad","isReverse","loader","loadMore","pageStart","ref","threshold","useCapture","useWindow","getScrollParent"]);c.ref=function(t){e.scrollComponent=t,l&&l(t)};var d=[n];return o&&(s?r?d.unshift(s):d.push(s):this.defaultLoader&&(r?d.unshift(this.defaultLoader):d.push(this.defaultLoader))),i.default.createElement(a,c,d)}}]),InfiniteScroll}(a.Component);s.propTypes={children:r.default.node.isRequired,element:r.default.node,hasMore:r.default.bool,initialLoad:r.default.bool,isReverse:r.default.bool,loader:r.default.node,loadMore:r.default.func.isRequired,pageStart:r.default.number,ref:r.default.func,getScrollParent:r.default.func,threshold:r.default.number,useCapture:r.default.bool,useWindow:r.default.bool},s.defaultProps={element:"div",hasMore:!1,initialLoad:!0,pageStart:0,ref:null,threshold:250,useWindow:!0,isReverse:!1,useCapture:!1,loader:null,getScrollParent:null},t.default=s,e.exports=t.default}(Qi,Qi.exports);var eo=Qi.exports;const CopyButton=({id:t,textToCopy:n,iconSize:a,disableTooltip:i,onCopyValue:o})=>{const[r,s]=A.useState(!1),l=undefined,c=useDebouncedCallback((()=>{s(!1)}),2e3);return e(R,{className:"h-fit self-center z-[16000]",content:r?"Copied to Clipboard":"Copy",placement:"bottom",disabled:i,children:e("div",{className:Kt({"text-green-700":r}),children:e(D,{className:"ml-auto","data-testid":`${t}-copy-button`,iconName:r?"check":"copy",iconSize:a??"xs",onClick:e=>{e.stopPropagation(),e.preventDefault(),null!=n&&(navigator.clipboard.writeText(n),o?.(n)),s(!0),c(!0)},style:{"--hover-box-shadow":"none"}})})})};function MetadataPropertyValue({value:n,onCopyMetadataValue:a}){const[i,o]=A.useState(!1),r=""!==n.replace(/^\s*$/,"").trim();return r?t("div",{className:"flex w-full border-b border-neutral-300 pl-1 pr-3","data-testid":`${n}-metadata-property`,onMouseEnter:()=>{o(!0)},onMouseLeave:()=>o(!1),children:[e(R,{className:"w-full shrink truncate pr-2 py-1.5",content:n,placement:"bottom-start",children:e("div",{className:"truncate",children:n})}),i&&e(CopyButton,{id:n,textToCopy:n,onCopyValue:a})]}):e("div",{className:Kt("overflow-visible border-b border-neutral-300 pl-1 pr-4 py-1.5",{"text-neutral-500":!r}),children:"--"})}const MetadataPanelContents=({sceneItemId:a,onCopyMetadataValue:i})=>{const o=useMetadataActions(),r=p(vi),l=s(hi(a)),c=s(gi(a)),d=s(yi(a)),u=l?.length>0;function getMessage(){if(!d&&0===l?.length&&"hasValue"===r.state)return"This part does not contain properties"}return A.useEffect((()=>{null!=a&&o.fetchInitialMetadata(a)}),[a]),t(n,{children:[e(eo,{initialLoad:!1,hasMore:c,loadMore:async()=>{c&&await o.fetchNextMetadata(a)},useWindow:!1,children:t("div",{className:"flex w-full text-xs leading-5 grow-0",children:[e(G,{className:"w-1/2 min-w-24 max-w-full shrink-0",horizontalDirection:"right",verticalDirection:"none",initialHorizontalScale:.5,parentSelector:"#metadata-panel-wrapper",horizontalSiblingSelector:"#metadata-value-column",children:e("div",{className:"flex flex-col w-full overflow-hidden whitespace-nowrap",children:l.map(((t,n)=>e(R,{className:"border-b border-neutral-300 pl-4 pr-1 py-1.5",content:t.key,placement:"bottom-start",children:e("div",{className:"truncate",children:t.key})},n)))})}),e("div",{id:"metadata-value-column",className:"flex flex-col w-full min-w-24",children:l.map(((t,n)=>e(MetadataPropertyValue,{value:t.value,onCopyMetadataValue:i},n)))})]})}),!u&&e("div",{className:"w-full h-full flex items-center justify-center px-4 text-center text-sm",children:getMessage()})]})},MetadataPanel=({onCopyMetadataValue:n})=>{const a=usePanelActions(),i=s(Nn),o=p(vi);return t("div",{id:"metadata-panel-wrapper","data-testid":"metadata-panel-wrapper",className:"w-full h-full flex flex-col mt-auto text-neutral-800",children:[t("div",{className:"flex h-10 border-b border-neutral-300 p-3 pl-4 text-[0.875rem] items-center",children:["hasValue"===o.state&&e("span",{className:"flex flex-col w-full",children:e(R,{content:o.contents,children:e("div",{className:"truncate",children:o.contents||""})})}),"loading"===o.state&&e("div",{className:"flex items-center w-full h-full",children:e("div",{className:"w-1/2 h-1/2 bg-neutral-300 animate-pulse rounded"})}),e(F,{className:"ml-auto cursor-pointer",onClick:a.closeSecondary,name:"close",size:"sm"})]}),t("div",{className:"w-full h-full overflow-y-auto overflow-x-hidden",children:[null!=i&&e(MetadataPanelContents,{sceneItemId:i.id,onCopyMetadataValue:n}),null==i&&e("div",{className:"w-full h-full flex items-center justify-center px-4 text-center text-sm",children:"Please select a single part or assembly to view its metadata"})]})]})},SceneTreeSecondaryPanel=({panelId:t,onCopyMetadataValue:n})=>e(G,{"data-testid":"scene-tree-secondary-panel",className:"min-h-20 max-h-full flex-shrink-0 border-t border-neutral-300",horizontalDirection:"none",verticalDirection:"top",initializeWithOffset:!0,initialVerticalScale:.6,parentSelector:`#${t}`,verticalSiblingSelector:"#scene-tree-container",children:e(MetadataPanel,{onCopyMetadataValue:n})}),VertexSceneTreeCustomColumn=({label:n,rowDataBinding:a,expandToggle:i,visibilityToggle:o,isolateButton:r,modelViewsButton:l,initialWidth:c,minWidth:d})=>{const u=s(Na);return A.useEffect((()=>{u?.invalidateRows()}),[a]),t(me,{"data-testid":`scene-tree-table-column-${n}`,initialWidth:c,minWidth:d,children:[e("template",{slot:"header",dangerouslySetInnerHTML:{__html:`\n <div class="text-sm text-neutral-800 my-2">\n <div class="${Kt("truncate",{"pl-2":i,"pr-2":o})}">\n ${n}\n </div>\n </div>\n `}}),e("template",{dangerouslySetInnerHTML:{__html:`\n <vertex-scene-tree-table-cell\n prop:value="${a}"\n prop:selection-handler="{{row.data.handleSelection}}"\n prop:expansion-handler="{{row.data.handleExpansion}}"\n prop:visibility-handler="{{row.data.handleVisibility}}"\n ${i?"expand-toggle":""}\n ${o?"visibility-toggle":""}\n ${r?"isolate-button":""}\n >\n <div class="flex items-center gap-2">\n <vertex-tooltip \n class="truncate" \n prop:content="${null!=a?a:"--"}" \n placement="${o?"right":"top"}">\n <div class="flex items-center w-full">\n <div class="truncate">${a}</div>\n </div>\n </vertex-tooltip>\n\n ${l?'<div attr:style={{row.data.modelViewIndicatorStyle}}> \n <vertex-tooltip class="block w-full truncate" content="Listing Model Views" placement="bottom">\n <vertex-icon-button\n class="ml-auto mr-0.5 text-neutral-800"\n event:pointerup="{{row.data.handleShowModelViews}}"\n icon-name="views"\n icon-size="sm"\n variant="plain"\n >\n </vertex-icon-button>\n </vertex-tooltip>\n </div>':""}\n </div>\n\n <div slot="placeholder" class="flex items-center w-full truncate">\n <div> -- </div>\n </div>\n </vertex-scene-tree-table-cell>\n `}})]},n)},VertexSceneTreeMetadataColumns=({children:t})=>{const a=s(Li),i=s(_i),o=[],r=i.filter((e=>e!==Mi.label)).map((e=>a[e]));return e(n,null!=t?{children:t({columns:r.map((e=>({key:e.label,initialWidth:e.initialWidth,minWidth:e.minWidth})))})}:{children:r.map(((t,n)=>{const a=o[n]??t.initialWidth;return e(VertexSceneTreeCustomColumn,{label:t.label,visibilityToggle:n===r.length-1,isolateButton:n===r.length-1,rowDataBinding:t.binding,initialWidth:a,minWidth:t.minWidth},t.label)}))})},VertexSceneTreeTableLayout=n=>{const{children:a,...i}=n,o=s(Li),r=s(_i),l=A.useMemo((()=>findChildElement(a,NameColumn)),[a]),c=A.useMemo((()=>findChildElement(a,MetadataColumns)),[a]),d=o[Mi.label]??Mi,u=r.filter((e=>e!==Mi.label)).map((e=>o[e]));return t(pe,{"data-testid":"scene-tree-table-layout",...i,children:[l?cloneChildNodeOrFunction(l.props.children,{columnCount:r.length,initialWidth:d.initialWidth,minWidth:d.minWidth}):e(VertexSceneTreeCustomColumn,{expandToggle:!0,visibilityToggle:1===r.length,isolateButton:1===r.length,rowDataBinding:d.binding,label:d.label,initialWidth:d.initialWidth,minWidth:d.minWidth}),null!=c?cloneChildNodeOrFunction(c.props.children,{columns:u.map((e=>({key:e.label,initialWidth:e.initialWidth,minWidth:e.minWidth})))}):e(VertexSceneTreeMetadataColumns,{})]})},NameColumn=({children:t})=>e(n,{children:t}),MetadataColumns=({children:t})=>e(n,{children:t});VertexSceneTreeTableLayout.NameColumn=NameColumn,VertexSceneTreeTableLayout.MetadataColumns=MetadataColumns;const VertexSceneTree=({id:n,font:a,backgroundColors:i,additionalLoadedMetadataProperties:o,whitelistedMetadataProperties:r,allowViewingMetadataPropertiesPanel:l,children:d,style:u,onPointerDown:m,onClick:p,onToggleSelection:h,onToggleExpansion:f,onToggleVisibility:g,onCopyMetadataValue:v,className:b,rowData:w,...C})=>{const S=usePanelActions(),k=useSceneTreeActions(),T=useSelectionActions(),P=s(Ti),M=s(et),E=s(di),I=s(Zi),N=s(Ki),V=s(Ui),O=s(Wi),L=s(Fi),_=null==L||""===L,R=useRecoilRef({state:Na}),D=A.useMemo((()=>findChildElement(d,Header)),[d]),B=A.useMemo((()=>findChildElement(d,TableLayout)),[d]),j=A.useMemo((()=>findChildElement(d,ContextMenu)),[d]),wrappedExpansionHandler=(e,t,n)=>{k.toggleExpansion(e,t,n),f?.(e,t,n)},wrappedSelectionHandler=(e,t,n)=>{k.toggleSelection(e,t,n),h?.(e,t,n)},wrappedVisibilityHandler=(e,t,n)=>{k.toggleVisibility(e,t,n),g?.(e,t,n)},handleClick=async e=>{e.altKey&&await k.flyToRow(e.clientY),p?.(e)},handlePointerDown=async e=>{targetIsElement(e.target,"VERTEX-SCENE-TREE-TABLE-COLUMN")&&await T.clearSelection(),m?.(e)},H=c(Va),handleFirstRowRendered=e=>{H(e.target.controller),C?.onFirstRowRendered?.(e)},F=A.useMemo((()=>({metadataSearchKeys:N,exactMatch:V,removeHiddenItems:O})),[N,V,O]);useStateSyncedValue(Ii,r,{transform:e=>e.sort(((e,t)=>e.localeCompare(t)))}),useStateSyncedValue(mi,l),useStateSyncedValue(Xi,o);const U=s(Wn),W=A.useCallback((e=>{e.preventDefault(),e.stopPropagation(),S.openPrimary("model-views","right")}),[S]);return t("div",{id:"scene-tree-panel",className:"flex flex-col w-full h-full grow-0",children:[e("div",{id:"scene-tree-container",className:"flex group h-full min-h-32 overflow-auto",children:t(he,{id:n??"vertex-scene-tree","data-testid":"vertex-scene-tree",config:P,ref:R,className:Kt("flex-1",{filtered:!_}),style:{...styleFromOptionalFont(a),...styleFromOptionalBackgroundColors(i),...u},onConnectionError:e=>{logger_error("Scene Tree Connection Error: ",e.detail)},viewer:M,onPointerDown:handlePointerDown,onClick:handleClick,rowData:e=>{const t=w?.(e)??{};return{handleExpansion:wrappedExpansionHandler,handleSelection:wrappedSelectionHandler,handleVisibility:wrappedVisibilityHandler,handleShowModelViews:W,modelViewIndicatorStyle:e?.node.id?.hex===U?.id?"display: flex;":"display: none;",...t}},searchOptions:F,metadataKeys:I,...C,onFirstRowRendered:handleFirstRowRendered,children:[D??e(VertexSceneTreeHeader,{}),B??e(VertexSceneTreeTableLayout,{}),j??e(VertexSceneTreeContextMenu,{})]})}),void 0!==E&&e(SceneTreeSecondaryPanel,{panelId:"scene-tree-panel",onCopyMetadataValue:v})]})},Header=({children:t})=>e(n,{children:t}),TableLayout=({children:t})=>e(n,{children:t}),ContextMenu=({children:t})=>e(n,{children:t});VertexSceneTree.Header=Header,VertexSceneTree.TableLayout=TableLayout,VertexSceneTree.ContextMenu=ContextMenu;const VertexDecimalPlaceSelector=({onApply:n})=>{const[a,i]=l($n);return t(Q,{"data-testid":"decimal-place-select",className:"w-24",value:a,onOptionChanged:e=>{i(e.detail),n?.(e.detail)},children:[e("div",{className:"py-1.5 px-3",children:"0"}),e("div",{className:"py-1.5 px-3",children:"1"}),e("div",{className:"py-1.5 px-3",children:"2"}),e("div",{className:"py-1.5 px-3",children:"3"})]})},VertexLengthUnitSelector=({onApply:n})=>{const[a,i]=l(Kn);return t(Q,{"data-testid":"length-unit-select",className:"w-40",value:a,onOptionChanged:e=>{i(e.detail),n?.(e.detail)},children:[e("div",{"data-value":"cm",className:"py-1.5 px-3",children:"centimeters"}),e("div",{"data-value":"mm",className:"py-1.5 px-3",children:"millimeters"}),e("div",{"data-value":"m",className:"py-1.5 px-3",children:"meters"}),e("div",{"data-value":"in",className:"py-1.5 px-3",children:"inches"}),e("div",{"data-value":"ft",className:"py-1.5 px-3",children:"feet"})]})};function VertexUnitsControls({onUnitChange:a,onDecimalPlaceChange:i}){return t(n,{children:[t("div",{children:[e("div",{className:"pt-1 pb-2 text-sm text-neutral-700",children:"Length Unit"}),e(VertexLengthUnitSelector,{onApply:a})]}),t("div",{children:[e("div",{className:"pt-2 pb-2 text-sm text-neutral-700",children:"Decimals"}),e(VertexDecimalPlaceSelector,{onApply:i})]})]})}function VertexUnitsPanelSection({onUnitChange:t,onDecimalPlaceChange:n}){return e(PanelSection,{header:e("div",{className:"flex items-center text-base",children:"Units"}),children:e(VertexUnitsControls,{onUnitChange:t,onDecimalPlaceChange:n})})}function useModelViewActions(){const e=usePmiAnnotationActions(),t=useSelectionActions();return{fetchNextModelViews:useActionCallback((({snapshot:e,set:t})=>async n=>{const a=await e.getPromise(xa(n));if(null!=a){const e=a?.paging?.next;null!=e&&(t(va(n),(e=>[...e,a])),t(ga(n),(()=>e)))}})),loadModelView:useActionCallback((({set:n,snapshot:a})=>async(i,o)=>{const r=await a.getPromiseRequired(et),s=await a.getPromiseRequired(In);try{await(r?.modelViews?.load(i,o.id)),n(Sa,{itemId:i,modelView:o}),await e.clearPmiAnnotationSelection(),0!==s.length&&await t.clearSelection(),await e.fetchInitialPmiAnnotations(o.id)}catch(e){logger_error("Failed to load model view",e)}})),clearModelView:useActionCallback((({reset:t,snapshot:n})=>async()=>{const a=undefined;if(null!=await n.getPromise(Sa)){const a=await n.getPromiseRequired(et);try{await(a?.modelViews?.unload()),t(Sa),await e.clearPmiAnnotationSelection()}catch(e){logger_error("Failed to remove model view",e)}}}))}}var to=Object.freeze({__proto__:null,hasMoreModelViews:Aa,hasMorePmiAnnotations:Ma,loadedItemModelView:Sa,loadedModelViews:va,loadedPmiAnnotations:ba,modelViews:ka,modelViewsCursor:ga,modelViewsSceneItemName:Ca,nextModelViews:xa,nextPmiAnnotations:Ta,pmiAnnotations:Pa,pmiAnnotationsCursor:ya,selectedPmiAnnotationId:Ea,useModelViewActions:useModelViewActions,visiblePmiAnnotations:wa});function FileWithMagnifyingGlassImage(){return e("div",{children:t("svg",{xmlns:"http://www.w3.org/2000/svg",width:"160",height:"160",viewBox:"0 0 220 220",children:[e("path",{fill:"none",stroke:"#006bad","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":".75",d:"M38.84 186.31h143.29m-155.07 5.14h176.49M1 196.58h218m-205.11 5.14h185.22m-162.74 5.13h141.84"}),e("path",{fill:"#f7fcfd",d:"m150.94 50.25 20.43 19.51a3.42 3.42 0 0 1 1 2.46v121.2a5.23 5.23 0 0 1-5.23 5.23H52.78a5.23 5.23 0 0 1-5.23-5.23V54.56a5.24 5.24 0 0 1 5.23-5.24h95.81a3.44 3.44 0 0 1 2.35.93"}),e("path",{fill:"none",stroke:"#006bad","stroke-dasharray":"3 3","stroke-linecap":"round","stroke-linejoin":"round",d:"m150.94 50.25 20.43 19.51a3.42 3.42 0 0 1 1 2.46v121.2a5.23 5.23 0 0 1-5.23 5.23H52.78a5.23 5.23 0 0 1-5.23-5.23V54.56a5.24 5.24 0 0 1 5.23-5.24h95.81a3.44 3.44 0 0 1 2.35.93"}),e("path",{d:"M79.12 123.99H110v30.88H79.12z",fill:"#e0f3f9"}),e("path",{d:"M110 153.37v1.5h-1.5",fill:"none",stroke:"#006bad","stroke-linecap":"round","stroke-linejoin":"round"}),e("path",{d:"M105.4 154.87H82.17",fill:"none",stroke:"#006bad","stroke-linecap":"round","stroke-linejoin":"round","stroke-dasharray":"3.1 3.1"}),e("path",{d:"M80.62 154.87h-1.5v-1.5",fill:"none",stroke:"#006bad","stroke-linecap":"round","stroke-linejoin":"round"}),e("path",{d:"M79.12 150.27v-23.23",fill:"none",stroke:"#006bad","stroke-linecap":"round","stroke-linejoin":"round","stroke-dasharray":"3.1 3.1"}),e("path",{d:"M79.12 125.49v-1.5h1.5",fill:"none",stroke:"#006bad","stroke-linecap":"round","stroke-linejoin":"round"}),e("path",{d:"M83.72 123.99h23.23",fill:"none",stroke:"#006bad","stroke-linecap":"round","stroke-linejoin":"round","stroke-dasharray":"3.1 3.1"}),e("path",{d:"M108.5 123.99h1.5v1.5",fill:"none",stroke:"#006bad","stroke-linecap":"round","stroke-linejoin":"round"}),e("path",{d:"M110 128.59v23.23",fill:"none",stroke:"#006bad","stroke-linecap":"round","stroke-linejoin":"round","stroke-dasharray":"3.1 3.1"}),e("path",{d:"M110 123.99h30.88v30.88H110z",fill:"#e0f3f9"}),e("path",{d:"M140.88 153.37v1.5h-1.5",fill:"none",stroke:"#006bad","stroke-linecap":"round","stroke-linejoin":"round"}),e("path",{d:"M136.28 154.87h-23.23",fill:"none",stroke:"#006bad","stroke-linecap":"round","stroke-linejoin":"round","stroke-dasharray":"3.1 3.1"}),e("path",{d:"M111.5 154.87H110v-1.5",fill:"none",stroke:"#006bad","stroke-linecap":"round","stroke-linejoin":"round"}),e("path",{d:"M110 150.27v-23.23",fill:"none",stroke:"#006bad","stroke-linecap":"round","stroke-linejoin":"round","stroke-dasharray":"3.1 3.1"}),e("path",{d:"M110 125.49v-1.5h1.5",fill:"none",stroke:"#006bad","stroke-linecap":"round","stroke-linejoin":"round"}),e("path",{d:"M114.6 123.99h23.23",fill:"none",stroke:"#006bad","stroke-linecap":"round","stroke-linejoin":"round","stroke-dasharray":"3.1 3.1"}),e("path",{d:"M139.38 123.99h1.5v1.5",fill:"none",stroke:"#006bad","stroke-linecap":"round","stroke-linejoin":"round"}),e("path",{d:"M140.88 128.59v23.23",fill:"none",stroke:"#006bad","stroke-linecap":"round","stroke-linejoin":"round","stroke-dasharray":"3.1 3.1"}),e("path",{d:"M110 93.11h30.88v30.88H110z",fill:"#e0f3f9"}),e("path",{d:"M140.88 122.49v1.5h-1.5",fill:"none",stroke:"#006bad","stroke-linecap":"round","stroke-linejoin":"round"}),e("path",{d:"M136.28 123.99h-23.23",fill:"none",stroke:"#006bad","stroke-linecap":"round","stroke-linejoin":"round","stroke-dasharray":"3.1 3.1"}),e("path",{d:"M111.5 123.99H110v-1.5",fill:"none",stroke:"#006bad","stroke-linecap":"round","stroke-linejoin":"round"}),e("path",{d:"M110 119.39V96.15",fill:"none",stroke:"#006bad","stroke-linecap":"round","stroke-linejoin":"round","stroke-dasharray":"3.1 3.1"}),e("path",{d:"M110 94.61v-1.5h1.5",fill:"none",stroke:"#006bad","stroke-linecap":"round","stroke-linejoin":"round"}),e("path",{d:"M114.6 93.11h23.23",fill:"none",stroke:"#006bad","stroke-linecap":"round","stroke-linejoin":"round","stroke-dasharray":"3.1 3.1"}),e("path",{d:"M139.38 93.11h1.5v1.5",fill:"none",stroke:"#006bad","stroke-linecap":"round","stroke-linejoin":"round"}),e("path",{d:"M140.88 97.7v23.24",fill:"none",stroke:"#006bad","stroke-linecap":"round","stroke-linejoin":"round","stroke-dasharray":"3.1 3.1"}),e("path",{d:"M150.91 50.28a3.6 3.6 0 0 1 .86 1.22",fill:"none",stroke:"#006bad","stroke-linecap":"round","stroke-linejoin":"round"}),e("path",{fill:"none",stroke:"#006bad","stroke-dasharray":"2.87 2.87","stroke-linecap":"round","stroke-linejoin":"round",d:"M152.05 54.34v9.14a5.24 5.24 0 0 0 5.24 5.23h9.94"}),e("path",{d:"M168.67 68.71h.2a3.5 3.5 0 0 1 1.27.23M19.8 78.25l1.93 14.68-14.67 1.93",fill:"none",stroke:"#006bad","stroke-linecap":"round","stroke-linejoin":"round"}),e("path",{d:"M21.73 92.93S-2.15 82.45 4.05 54.82",fill:"none",stroke:"#006bad","stroke-linecap":"round","stroke-linejoin":"round"}),e("path",{fill:"none",stroke:"#b43296","stroke-linecap":"round","stroke-linejoin":"round",d:"M14.89 132.63h5.88v5.88h-5.88z"}),e("path",{fill:"none",stroke:"#f90","stroke-linecap":"round","stroke-linejoin":"round",d:"M174.49 36v5.88m-2.94-2.94h5.88"}),e("circle",{cx:"199.1",cy:"164.76",r:"2.45",fill:"none",stroke:"#0c0","stroke-linecap":"round","stroke-linejoin":"round"}),e("path",{d:"M109.68 25.74V11.9M87.12 29.74l-6.02-9.4m53.21 9.4 6.01-9.4",fill:"none",stroke:"#006bad","stroke-linecap":"round","stroke-linejoin":"round"}),e("path",{fill:"#eff9fc",stroke:"#006bad","stroke-linejoin":"round",d:"m140.43 139.69 7.22 5.8-8.28 10.31-7.22-5.8"}),e("circle",{cx:"110.2",cy:"124.35",r:"27.74",fill:"#e0f3f9",opacity:".7"}),e("path",{fill:"#fff",stroke:"#006bad","stroke-linejoin":"round",d:"M131.2 98.19a33.55 33.55 0 1 0 5.16 47.16 33.56 33.56 0 0 0-5.16-47.16Zm.63 43.52a27.73 27.73 0 1 1-4.26-39 27.73 27.73 0 0 1 4.26 39ZM187 173.84a29.8 29.8 0 0 1-4.19 7.52 29.3 29.3 0 0 1-7.24 6.71l-37.77-30.31a29.3 29.3 0 0 1 5-8.56 29.6 29.6 0 0 1 6.4-5.67Z"}),e("path",{fill:"none",stroke:"#fff","stroke-linecap":"round","stroke-miterlimit":"10",d:"m118.82 138.09 12.51-15.58m-38.56-3.68 6.94-8.65m-5.32 1.9 6.95-8.66m16.23 42.44 12.5-15.58"}),e("path",{fill:"#fff",stroke:"#006bad","stroke-linecap":"round","stroke-linejoin":"round",d:"M139.92 153.31a28.4 28.4 0 0 0-2.12 4.45m7.07-.49a38 38 0 0 0-2.35 4.28m7.3-.32c-.93 1.34-1.79 2.72-2.58 4.11m7.53-.15q-1.47 2-2.81 3.94m7.75.01-3 3.78m7.95.18c-1.07 1.24-2.16 2.45-3.26 3.61m8.21.35a54 54 0 0 1-3.49 3.44m8.44.5a37 37 0 0 1-3.72 3.26m8.67.74a29 29 0 0 1-3.95 3.09"}),e("path",{d:"m196.69 115.8-2.18 14.64 14.64 2.18",fill:"none",stroke:"#006bad","stroke-linecap":"round","stroke-linejoin":"round"}),e("path",{d:"M194.51 130.44s23.76-12 21.9-35.66",fill:"none",stroke:"#006bad","stroke-linecap":"round","stroke-linejoin":"round"})]})})}function ModelViewsEmptyState({itemSelected:n}){const a=n?"There are no model views associated with this part.":"Select a part to access model views.";return t("div",{"data-testid":"pmi-views-empty-state",className:"h-full w-full px-4 flex flex-col gap-2 justify-center items-center overflow-y-auto",children:[e(FileWithMagnifyingGlassImage,{}),e("div",{className:"text-base text-neutral-700 text-center px-3 pt-2.5 pb-1.5",children:"No Model Views"}),e("div",{className:"text-[0.8125rem] text-neutral-600 text-center px-3 pb-2.5",children:a})]})}const VertexModelViewsViewRow=({view:n,currentlyViewing:a,itemId:i,onLoadModelView:o,onClearModelView:r})=>{const s=useModelViewActions();return e("div",{"data-testid":`model-view-${n.id}`,onClick:async()=>{a?(await s.clearModelView(),r?.()):(await s.loadModelView(i,n),o?.(i,n.id))},className:Kt("flex flex-col w-full h-8 p-1 pl-4 cursor-pointer text-neutral-700 text-[0.8125rem] hover:text-[var(--vertex-ui-blue-600)]",{"bg-[var(--vertex-ui-blue-200)]":a,"hover:bg-[var(--vertex-ui-blue-100)]":!a}),children:t("div",{className:Kt("flex w-full h-full items-center",{"text-neutral-900 font-extrabold":a}),children:[t(R,{className:"flex w-20 grow","data-testid":`model-view-${n.id}-tooltip`,placement:"bottom-start",content:n.displayName,children:[e(F,{name:"views",size:"sm"}),e("div",{className:"truncate mx-2",children:n.displayName}),e("span",{className:"font-normal text-neutral-700 ml-auto pr-1",children:a&&"(Viewing)"})]}),a&&e("div",{className:"ml-auto pr-1",children:e(D,{"data-testid":"model-views-clear-selection",iconSize:"sm",iconName:"close",onClick:async()=>await s.clearModelView()})})]})},n.id)};function VertexModelViewsList({itemId:n,onLoadModelView:a,onClearModelView:i}){const o=useModelViewActions(),r=s(Sa),l=s(ka(n)),c=s(Aa(n)),d=p(Ca),u=0===l.length;return t("div",{className:"w-full h-full flex flex-col",children:[("hasValue"!==d.state||null!=d.contents)&&t("div",{className:"flex flex-row h-11 w-full border-b border-neutral-300 p-3 pl-4 mr-2 text-sm items-center",children:["hasValue"===d.state&&e("div",{className:"truncate items-center",children:e(R,{content:d.contents,children:e("div",{className:"truncate",children:d.contents||""})})}),"loading"===d.state&&e("div",{className:"flex items-center h-11 w-full",children:e("div",{className:"w-3/4 h-3 bg-neutral-300 animate-pulse rounded"})})]}),u&&e(ModelViewsEmptyState,{itemSelected:!0}),!u&&e("div",{className:"h-full overflow-y-auto",children:e(eo,{hasMore:c,loadMore:()=>{o.fetchNextModelViews(n)},useWindow:!1,children:l.map((t=>{const o=r?.modelView?.id.toString(),s=undefined;return e(VertexModelViewsViewRow,{view:t,currentlyViewing:o===t?.id,itemId:n,onLoadModelView:a,onClearModelView:i},t.id)}))})})]})}const VertexPMIAnnotationRow=({annotation:n,checked:a,onCheckedChange:i,selected:o,onSelectedChange:r})=>t("div",{id:`annotation-entry-${n.id}`,"data-testid":`annotation-entry-${n.displayName}`,className:Kt("flex items-center w-full h-7 gap-2.5 pl-4 pr-2 cursor-default hover:text-[var(--vertex-ui-blue-600)]",{"bg-[var(--vertex-ui-blue-200)]":o,"hover:bg-[var(--vertex-ui-blue-100)]":!o}),onClick:()=>r(!o),children:[e(_,{"data-testid":`annotation-entry-${n.displayName}-check`,variant:"check",checked:a,onClick:e=>e.stopPropagation(),onValueChanged:e=>{i(e.detail)}}),e("div",{className:"w-1/2 flex-grow",children:e(R,{content:n.displayName,placement:"bottom-start",children:e("div",{className:"truncate",children:n.displayName})})})]}),VertexPMIAnnotationsSecondaryPanel=({modelViewId:n,parentPanelId:a,verticalSiblingId:i,sceneAnnotationOperations:o,onToggleSelectionOfPMIAnnotation:r,onToggleVisibilityOfPMIAnnotation:c})=>{const d=usePmiAnnotationActions(),u=s(et),m=s(Pa(n)),p=s(Ma(n)),h=s(Ea),[f,g]=l(wa(n)),[v,b]=k.useState("");k.useEffect((()=>{n!==v&&(g(m),b(n))}),[m,v,n,g,b]);const toggleVisibilityOfAllAnnotations=e=>{e?(g(m),o?.sceneAnnotationsOperation((e=>e.show()),u)):(g([]),o?.sceneAnnotationsOperation((e=>e.hide()),u))};return e(G,{"data-testid":"pmi-annotation-secondary-panel",className:"min-h-28 max-h-3/4 flex-shrink-0 border-t text-sm text-neutral-700",horizontalDirection:"none",verticalDirection:"top",initializeWithOffset:!0,initialVerticalScale:.6,parentSelector:`#${a}`,verticalSiblingSelector:`#${i}`,children:t("div",{className:"flex flex-col h-full overflow-hidden",children:[e("div",{className:"flex items-center w-full h-9 border-b border-[var(--vertex-ui-neutral-300)] px-4 shrink-0",children:"3D PMI"}),t("div",{"data-testid":"display-all-annotations",className:"flex items-center w-full h-8 gap-2.5 px-4 py-1.5 cursor-default border-b border-[var(--vertex-ui-neutral-300)]",onClick:()=>{const e=m.length!==f.length;toggleVisibilityOfAllAnnotations(e)},children:[e(_,{"data-testid":"display-all-annotations-check",variant:"check",checked:m.length===f.length,onClick:e=>e.stopPropagation(),onValueChanged:e=>{toggleVisibilityOfAllAnnotations(e.detail)}}),"Display All"]}),e("div",{className:"h-full overflow-y-auto text-[0.8125rem] py-1",children:e(eo,{hasMore:p,loadMore:async()=>{p&&await d.fetchNextPmiAnnotations(n)},useWindow:!1,children:m.map(((t,a)=>e(VertexPMIAnnotationRow,{annotation:t,checked:f.includes(t),onCheckedChange:e=>{e?(g([...f,t]),o?.sceneAnnotationsOperation((e=>e.show()),u,[t.id])):(g(f.filter((e=>e!==t))),o?.sceneAnnotationsOperation((e=>e.hide()),u,[t.id])),c?.(n,t.id,e)},selected:t.id===h,onSelectedChange:async e=>{e?await d.selectPmiAnnotation(t.id,!1):await d.clearPmiAnnotationSelection(),r?.(n,t.id,e)}},a)))})})]})})},VertexModelViewsPanelSection=({onLoadModelView:n,onClearModelView:a,onToggleSelectionOfPMIAnnotation:i,onToggleVisibilityOfPMIAnnotation:o})=>{const r=useSceneAnnotationsOperations(),l=s(Wn),c=null!=l?.id,d=s(Sa),u=d?.itemId===l?.id;return t("div",{id:"model-views-panel-wrapper",className:"w-full h-full flex flex-col text-neutral-800",children:[t("div",{"data-testid":"model-views-container",className:"group h-full flex overflow-auto min-h-29 relative",children:[c&&e(k.Suspense,{fallback:e(ModelViewsItemListLoading,{}),children:e(VertexModelViewsList,{itemId:l.id,onLoadModelView:n,onClearModelView:a})}),!c&&e(ModelViewsEmptyState,{itemSelected:!1})]}),null!=d&&u&&e(k.Suspense,{fallback:e(ModelViewsItemListLoading,{}),children:e(VertexPMIAnnotationsSecondaryPanel,{modelViewId:d.modelView.id,parentPanelId:"model-views-panel-wrapper",verticalSiblingId:"model-views-container",sceneAnnotationOperations:r,onToggleSelectionOfPMIAnnotation:i,onToggleVisibilityOfPMIAnnotation:o})})]})};function ModelViewsItemListLoading(){return t("div",{className:"flex flex-col w-full h-full items-center justify-center text-[0.8125rem] overflow-y-auto",children:[e(ee,{"data-testid":"model-views-panel-spinner",size:"lg",color:"grey"}),e("div",{className:"pt-3 px-10 text-center",children:"Loading model views for the selected part..."})]})}function VertexModelViewsPanel(){return e("div",{className:"flex flex-col text-neutral-700 h-full overflow-y-auto",children:e(VertexModelViewsPanelSection,{})})}function ColorSwatchContextMenu({onRemoveCustomColor:n}){const a=useContextMenuActions(),i=useSceneItemMaterialActions(),o=s(en);return e(VertexContextMenu,{menuType:"color-swatch",onOpen:e=>{elementIsColorSwatch(e.target)&&a.setContextMenuItem(e.target)},openPredicate:e=>elementIsColorSwatch(e.target)&&elementHasColorAttribute(e.target),disableBackdrop:!0,children:e(W,{"data-testid":"color-swatch-delete",onClick:async()=>{if(contextMenuItemIsElement(o)&&elementIsColorSwatch(o)){const e=o?.getAttribute("data-color-id");null!=e&&"true"===o.getAttribute("data-custom-color")?(await i.removeCustomColor(e),n?.(e)):null!=e&&"true"===o.getAttribute("data-recent-color")&&await i.removeRecentColor(e)}},children:t("div",{className:"flex align-middle gap-2.5",children:[e(F,{slot:"icon",name:"delete",size:"sm"}),"Delete"]})})})}function DefaultAppearancePanel(){return t("div",{className:"flex flex-col text-neutral-700 h-full overflow-y-auto",children:[e(VertexMaterialPanelSection,{}),e(VertexGhostingPanelSection,{}),e(VertexFeatureEdgesPanelSection,{}),e(VertexViewerBackgroundPanelSection,{}),e(VertexSelectionHighlightingPanelSection,{}),e(VertexCrossSectionAppearancePanelSection,{}),e(ColorSwatchContextMenu,{})]})}function DefaultSettingsPanel(){return e("div",{className:"flex flex-col text-neutral-700 h-full overflow-y-auto",children:e(VertexUnitsPanelSection,{})})}const VertexTransformClear=({onClear:n,onClearAll:a})=>{const i=useTransformActions(),o=useCacheableLoadable(Un),r=s(Dn),l=useCacheableLoadable(oa(r??"")),c=A.useMemo((()=>{const e=o.data?.some((e=>null!=e?.override?.transform)),t=null!=l.data;return e||t}),[o,l]);return e("div",{className:"ml-auto",children:t(ResetButton,{id:"transforms",tooltip:"Clear Transforms",children:[e("div",{className:"pt-1"}),e(W,{"data-testid":"clear-selected-transforms",onClick:async()=>{await i.clearSelectedTransforms(),n?.()},disabled:!c,children:"Clear selected transforms"}),e(W,{"data-testid":"clear-all-transforms",onClick:async()=>{await i.clearAllTransforms(),a?.()},children:"Clear all transforms"})]})})},VertexTransformNumericField=({bottomLabel:n,value:a,step:i,min:o,max:r,disabled:l,testId:c,onBlur:d,onInput:u,onChange:m})=>{const p=A.useRef(null),h=s($n),[f,g]=A.useState(!0);A.useEffect((()=>{const e=null!=p.current&&Number.isNaN(p.current.valueAsNumber),t=f||e;null!=p.current&&t?p.current.value=a?.toFixed(Number(h))??"":g(!0)}),[a]);const v=A.useCallback((e=>{g(!1),m?.(e)}),[g,m]),b=A.useCallback((e=>{g(!0),d?.(e),null!=p.current&&null!=a&&(p.current.value=a.toFixed(Number(h)))}),[d,a,g]);return t("div",{children:[e("div",{className:"truncate rounded-md w-full",children:e("input",{ref:p,className:"w-full truncate border border-neutral-400 rounded-md px-2 py-1.5 hover:border-neutral-500 focus:border-neutral-500 focus:outline-none",type:"number",step:i,min:o,max:r,"data-testid":c,disabled:l,defaultValue:Number.isNaN(a)?"":a?.toFixed(Number(h)),onBlur:b,onInput:u,onChange:v})}),null!=n&&e("div",{className:"flex justify-center items-center pointer-events-none text-neutral-500",children:e("span",{children:n})})]})},VertexTransformInputs=({onUpdateTransform:n})=>{const a=s(Kn),i=s(Ln),o=s(On),r=i||o,l=s(Dn),{transform:c,error:d,update:u}=useEditItemTransform(l),m=r?void 0:c,p=useDebouncedCallback((async e=>{await u(e),n?.(e)}),50);function updateTransform(e){return t=>{if(null!=m){const n=parseFloat(t.currentTarget.value);Number.isNaN(n)||p?.({...m,...e(n,m)})}}}function updatePosition(e){return updateTransform(((t,n)=>({position:{...n.position,...e(t)}})))}function updateRotation(e){return updateTransform(((t,n)=>({rotation:{...n.rotation,...e(t)}})))}function updateScale(){return updateTransform((e=>e>0?{scale:e}:{}))}function updateToDefaultValueIfInvalid(e,t){return n=>{const a=parseFloat(n.currentTarget.value),i=undefined;(isNaN(a)||!!t?.(a))&&null!=m&&p(Ee.defaults(e,m))}}return t("div",{children:[t("div",{className:"mb-2 text-[0.8125rem]",children:[e("span",{className:"flex w-full items-center mt-3 mb-1",children:"Position"}),t("div",{className:"flex flex-wrap w-full gap-2",children:[t("div",{className:"flex gap-2",children:[e("span",{className:"pt-2",children:"X"}),e("div",{className:"w-26",children:e(VertexTransformNumericField,{testId:"position-x",value:null!=m?m.position.x:void 0,bottomLabel:a,disabled:null==m,onChange:updatePosition((e=>({x:e}))),onBlur:updateToDefaultValueIfInvalid({position:{x:0}})})})]}),t("div",{className:"flex gap-2",children:[e("span",{className:"pt-2",children:"Y"}),e("div",{className:"w-26",children:e(VertexTransformNumericField,{testId:"position-y",value:m?.position.y,bottomLabel:a,disabled:null==m,onChange:updatePosition((e=>({y:e}))),onBlur:updateToDefaultValueIfInvalid({position:{y:0}})})})]}),t("div",{className:"flex gap-2",children:[e("span",{className:"pt-2",children:"Z"}),e("div",{className:"w-26",children:e(VertexTransformNumericField,{testId:"position-z",value:m?.position.z,bottomLabel:a,disabled:null==m,onChange:updatePosition((e=>({z:e}))),onBlur:updateToDefaultValueIfInvalid({position:{z:0}})})})]})]})]}),t("div",{className:"mb-2 text-[0.8125rem]",children:[e("span",{className:"flex w-full items-center mt-3 mb-1",children:"Rotation"}),t("div",{className:"flex flex-wrap w-full gap-2",children:[t("div",{className:"flex gap-2",children:[e("span",{className:"pt-2",children:"X"}),e("div",{className:"w-26",children:e(VertexTransformNumericField,{testId:"rotation-x",value:m?.rotation.x,bottomLabel:"deg",disabled:null==m,onChange:updateRotation((e=>({x:e}))),onBlur:updateToDefaultValueIfInvalid({rotation:{x:0}})})})]}),t("div",{className:"flex gap-2",children:[e("span",{className:"pt-2",children:"Y"}),e("div",{className:"w-26",children:e(VertexTransformNumericField,{testId:"rotation-y",value:m?.rotation.y,bottomLabel:"deg",disabled:null==m,onChange:updateRotation((e=>({y:e}))),onBlur:updateToDefaultValueIfInvalid({rotation:{y:0}})})})]}),t("div",{className:"flex gap-2",children:[e("span",{className:"pt-2",children:"Z"}),e("div",{className:"w-26",children:e(VertexTransformNumericField,{testId:"rotation-z",value:m?.rotation.z,bottomLabel:"deg",disabled:null==m,onChange:updateRotation((e=>({z:e}))),onBlur:updateToDefaultValueIfInvalid({rotation:{z:0}})})})]})]})]}),t("div",{className:"mb-2 text-[0.8125rem]",children:[e("span",{className:"flex w-full items-center mt-3 mb-1",children:"Scale"}),e("div",{className:"w-26",children:e(VertexTransformNumericField,{testId:"scale",value:m?.scale,step:.1,min:.1,disabled:null==m,onChange:updateScale(),onBlur:updateToDefaultValueIfInvalid({scale:1},(e=>e<=0))})}),r&&e("div",{className:"bg-orange-100 rounded px-3 py-2 mt-6 mb-2",children:"Input based part transformation is not yet supported for multiple parts."}),null!=d&&e("div",{className:"bg-red-100 rounded px-3 py-2 mt-6 mb-2",children:"There was a problem retrieving data. Try selecting a different part."})]})]})},VertexTransformManipulatorToggle=({onToggleTransformsManipulator:t})=>{const n=useTransformActions(),a=s(Jn),i=c(sa);return e(_,{className:"flex items-center","data-testid":"transform-widget-toggle",variant:"switch",checked:a,onValueChanged:async()=>{a?(n.disableTransformWidget(),t?.(!1)):(i("world"),await n.enableTransformWidget(),t?.(!0))}})};function VertexTransformControls({onToggleTransformsManipulator:a,onUpdateTransform:i}){return t(n,{children:[t("div",{className:"flex items-center py-3",children:[e(VertexTransformManipulatorToggle,{onToggleTransformsManipulator:a}),e("span",{className:"pl-4 text-[0.8125rem] text-neutral-700",children:"Enable manipulator"})]}),e(VertexTransformInputs,{onUpdateTransform:i})]})}function VertexTransformPanelSection({onClearTransforms:n,onClearAllTransforms:a,onToggleTransformsManipulator:i,onUpdateTransform:o}){return e(PanelSection,{header:t("div",{className:"flex items-center text-base",children:["Manual Part Transforms",e(VertexTransformClear,{onClear:n,onClearAll:a})]}),children:e(VertexTransformControls,{onToggleTransformsManipulator:i,onUpdateTransform:o})})}function DefaultTransformsPanel(){return e("div",{className:"flex flex-col text-neutral-700 h-full overflow-y-auto",children:e(VertexTransformPanelSection,{})})}const no="Appearance",ao="Model Views",io="Settings",oo="Transforms",ViewerRightPanelHeader=({additionalHeaderMap:n})=>{const a=s(ci),i=getHeading(a,n),o=undefined;return e("div",{className:"flex flex-col w-full items-center z-overlay pointer-events-none md:pointer-events-auto py-3 px-4 border-b border-neutral-300",children:t("div",{className:"flex items-center w-full leading-6 text-md align-center font-medium text-neutral-800 gap-2",children:[i,"model-views"===a&&e(BetaLabel,{})]})})};function getHeading(e,t={}){switch(e){case"appearance":return no;case"model-views":return ao;case"settings":return io;case"transforms":return oo;default:const n=undefined;return(null!=e?t[e]:void 0)??"None"}}function VertexViewerRightOpenedPanel({children:a}){const i=s(ci),o=A.useMemo((()=>filterChildElements(a,CustomPanelContent)),[a]),r=A.useMemo((()=>o.reduce(((e,t)=>({...e,[t.props.panelName]:t.props.panelTitle})),{})),[o]),l=A.useMemo((()=>["appearance","model-views","settings","transforms",...o.map((e=>e.props.panelName))]),[o]);return e(n,{children:null!=i&&l.includes(i)&&t(VertexResizableContent,{displayShadow:!0,heading:e(ViewerRightPanelHeader,{additionalHeaderMap:r}),placement:"right",children:["appearance"===i&&e(DefaultAppearancePanel,{}),"transforms"===i&&e(DefaultTransformsPanel,{}),"settings"===i&&e(DefaultSettingsPanel,{}),"model-views"===i&&e(VertexModelViewsPanel,{}),a]})})}function CustomPanelContent({panelName:t,children:a}){const i=s(ci);return e(n,{children:i===t&&a})}function Sidebar({children:t}){return e("div",{className:"pointer-events-auto flex flex-col items-center w-full border-neutral-300 py-2",children:t})}function SidebarIcon({name:n,iconName:a,active:i,responsive:o,disabled:r,content:s,tooltipPlacement:l,children:c,onSelect:d,onDeselect:u}){return e("div",{className:Kt({"text-[var(--vertex-ui-blue-700)]":i===n&&!r,"text-neutral-700 hover:text-neutral-800":i!==n&&!r,"cursor-pointer hover:bg-neutral-200":!r,"text-neutral-400":r,"rounded-full md:p-3":o,"p-3":!o&&null==c,"px-3 py-1":null!=c}),"data-testid":`${n}-sidebar-panel`,onClick:()=>{r||(i===n?u():d())},children:t(R,{placement:l??void 0,content:A.isValidElement(s)?void 0:s,children:[e("div",{slot:"content",children:s}),e("div",{className:"flex flex-col",children:c??e(F,{name:a})})]})})}function VertexViewerRightSidebar({children:n}){const a=usePanelActions(),i=useTransformActions(),o=s(ci);return e("div",{className:"flex flex-col flex-shrink-0 items-center relative border-neutral-300 border-l bg-white h-full top-0 min-w-12 w-12",children:t(Sidebar,{children:[n,e(SidebarIcon,{name:"appearance",active:o,iconName:"adjustments",tooltipPlacement:"right",content:"Appearance",onSelect:()=>{a.openPrimary("appearance","right")},onDeselect:()=>a.closePrimary("right")}),e(SidebarIcon,{name:"transforms",active:o,iconName:"show-only-nearby",tooltipPlacement:"right",content:"Transforms",onSelect:async()=>{a.openPrimary("transforms","right"),await i.enableTransformWidget(void 0,!0)},onDeselect:()=>a.closePrimary("right")}),e(SidebarIcon,{name:"model-views",active:o,iconName:"views",tooltipPlacement:"right",content:"Model Views",onSelect:async()=>{a.openPrimary("model-views","right")},onDeselect:()=>a.closePrimary("right")}),e(SidebarIcon,{name:"settings",active:o,iconName:"gear",tooltipPlacement:"right",content:"Settings",onSelect:()=>{a.openPrimary("settings","right")},onDeselect:()=>a.closePrimary("right")})]})})}function CustomPanelIcon(t){const n=usePanelActions(),a=s(ci),{panelName:i,tooltipContent:o,iconName:r,...l}=t;if(null==r&&null==l.children)throw new Error('CustomPanelIcon must contain either a Vertex "iconName" or custom "children"');return e(SidebarIcon,{...l,name:i,iconName:r??"help",active:a,content:o,onSelect:()=>{n.openPrimary(t.panelName,"right")},onDeselect:()=>{n.closePrimary("right")}})}VertexViewerRightOpenedPanel.CustomPanelContent=CustomPanelContent,VertexViewerRightSidebar.CustomPanelIcon=CustomPanelIcon;const VertexPopupButton=({open:a,children:i,...o})=>{const r=i.find((e=>e.type===Anchor)),s=i.filter((e=>e.type!==Anchor));return null==r?e(n,{}):t(Z,{className:"flex",placement:"top",backdrop:!1,open:asBooleanAttribute(a),...o,children:[r,e("div",{className:Kt("flex mb-1.5",{hidden:!a}),"data-testid":"align-plane-popover-menu",children:s})]})},Anchor=({tooltipContent:t,children:n})=>e("div",{slot:"anchor",children:e(R,{className:"cursor-pointer",content:t,children:n})});function VertexViewerCrossSectionAlignmentPopoverMenu({disabled:n}){const a=useCrossSectioningActions(),i=s(Ot),o=s(kt),getBaseIcon=()=>`align-to-${o?.mode}`;return useStackKeyBinding({id:"CrossSectionAlignment",keyBind:"Escape",fn:a.cancelCurrentHit,addPredicate:()=>o?.hitPending??!1,cancelPredicate:()=>!o?.hitPending},[o?.hitPending]),t(VertexPopupButton,{"data-testid":"section-alignment-popover",placement:"top",backdrop:!1,open:asBooleanAttribute(i),onDismissed:a.closeAlignmentTools,children:[e(VertexPopupButton.Anchor,{tooltipContent:"Section Alignment",children:e(D,{"data-testid":"section-alignment-icon-button",iconName:getBaseIcon(),iconColor:"secondary",onClick:i?a.closeAlignmentTools:a.openAlignmentTools,disabled:n,children:e(F,{"data-testid":"section-alignment-icon-chevron",name:"chevron-up",size:"sm"})})}),t(fe,{direction:"vertical",className:"flex justify-evenly items-center py-1 my-1 ring-1 ring-neutral-200 rounded bg-neutral-100 opacity-95",children:[e(D,{iconColor:"secondary",onClick:()=>a.updateAlignment("global"),className:"w-full text-neutral-800 hover:bg-neutral-300 rounded cursor-pointer mx-0.5 py-1 px-2","data-testid":"section-alignment-align-global",iconName:"align-to-global",variant:"plain",children:e("div",{className:"text-base ml-2",children:"Align to Global"})}),e(D,{iconColor:"secondary",onClick:()=>a.updateAlignment("surface"),className:"w-full text-neutral-800 hover:bg-neutral-300 rounded cursor-pointer mx-0.5 py-1 px-2","data-testid":"section-alignment-align-surface",iconName:"align-to-surface",variant:"plain",children:e("div",{className:"text-base ml-2",children:"Align to Surface"})})]})]})}function VertexViewerCrossSectionAxisPopoverMenu({disabled:n}){const a=useCrossSectioningActions(),i=s(Lt),o=s(xt),r=p(Mt),l=A.useMemo((()=>{const e=o.length>0&&"hasValue"===r.state?axis(o[0],xAxis(r.contents),yAxis(r.contents),zAxis(r.contents)):"x";return null!=e?`axis-${e}`:"axis-x"}),[r.state,r.contents,o]);return t(VertexPopupButton,{"data-testid":"align-plane-popover",placement:"top",backdrop:!1,open:asBooleanAttribute(i),onDismissed:a.closeAxisTools,children:[e(VertexPopupButton.Anchor,{tooltipContent:"Align Plane",children:e(D,{onClick:i?a.closeAxisTools:a.openAxisTools,iconName:l,"data-testid":"align-plane-icon",iconColor:"secondary",disabled:n,children:e(F,{"data-testid":"align-plane-icon-chevron",name:"chevron-up",size:"sm"})})}),t(fe,{direction:"vertical",className:"flex justify-evenly items-center py-1 my-1 ring-1 ring-neutral-200 rounded bg-neutral-100 opacity-95",children:[e(D,{"data-testid":"align-plane-x-axis-button",className:"w-full text-neutral-800 hover:bg-neutral-300 rounded cursor-pointer mx-0.5 py-1 px-2",onClick:()=>a.updateAxis("x"),variant:"plain",iconColor:"secondary",iconName:"axis-x",children:e("div",{className:"text-base ml-2",children:"X-axis Plane"})}),e(D,{className:"w-full text-neutral-800 hover:bg-neutral-300 rounded cursor-pointer mx-0.5 py-1 px-2",variant:"plain",iconColor:"secondary",iconName:"axis-y","data-testid":"align-plane-y-axis-button",onClick:()=>a.updateAxis("y"),children:e("div",{className:"text-base ml-2",children:"Y-axis Plane"})}),e(D,{"data-testid":"align-plane-z-axis-button",className:"w-full text-neutral-800 hover:bg-neutral-300 rounded cursor-pointer mx-0.5 py-1 px-2",onClick:()=>a.updateAxis("z"),variant:"plain",iconColor:"secondary",iconName:"axis-z",children:e("div",{className:"text-base ml-2",children:"Z-axis Plane"})})]})]})}function VertexViewerCrossSectionOffsetStepper({offset:n,disabled:a,onOffsetChange:i}){const o=s(Kn),r=s($n),[l,c]=A.useState(convertTo(n,o));A.useEffect((()=>{c(convertTo(n,o))}),[o,n]);const d=createDistanceFormatter(o,parseInt(r,10)),handleIncrementalUpdate=e=>{const t=convertFrom(l+e,o);i(t)},u=undefined,handleBlur=()=>{i(convertFrom(l,o))};return e(R,{content:"Plane Offset",children:e("form",{"data-testid":"cross-section-stepper-form",onSubmit:e=>{e.preventDefault(),i(convertFrom(l,o))},children:t(J,{"data-testid":"cross-section-stepper-input",className:"viewer-toolbar-input w-32 border-none ring-0 bg-white",type:"text",value:d(parseFloat(n.toFixed(3))),onInputInput:e=>{c(null!=e.detail.value?parseFloat(e.detail.value):n)},onBlur:handleBlur,disabled:a,children:[e("div",{"data-testid":"cross-section-stepper-decrement",className:"py-1 cursor-pointer",slot:"left",onClick:()=>{a||handleIncrementalUpdate(-1)},children:e(F,{name:"chevron-left",size:"sm"})}),e("div",{"data-testid":"cross-section-stepper-increment",className:"py-1 cursor-pointer",slot:"right",onClick:()=>{a||handleIncrementalUpdate(1)},children:e(F,{name:"chevron-right",size:"sm"})})]})})})}VertexPopupButton.Anchor=Anchor;const ro=400;function VertexViewerCrossSectionPopupMenu(){const n=useCrossSectioningActions(),a=s(Vt),i=p(It),o=p(Nt),r=A.useRef(),l=A.useMemo((()=>"hasValue"===i.state&&Number.isFinite(i.contents.max)&&Number.isFinite(i.contents.min)),[i.state,i.contents]),c=A.useMemo((()=>"hasValue"===i.state?i.contents:ft),[i.state,i.contents]),d=A.useMemo((()=>"hasValue"===o.state&&Number.isFinite(o.contents)?o.contents:0),[o.state,o.contents]),handleCrossSectionValueChange=e=>{clearTimeout(r.current),r.current=window.setTimeout((()=>{n.endInteraction()}),ro),n.beginInteraction(),n.updatePlanes(e)};return t(VertexPopupButton,{"data-testid":"cross-section-popover",placement:"top",backdrop:!1,open:asBooleanAttribute(a),onDismissed:n.closeAdditionalTools,children:[e(VertexPopupButton.Anchor,{tooltipContent:"Section Tools",children:e("div",{className:"-ml-px py-1.5",children:e(F,{"data-testid":"cross-section-popover-icon",name:"chevron-up",size:"sm",onClick:a?n.closeAdditionalTools:n.openAdditionalTools})})}),t(fe,{className:"relative bottom-3 flex justify-evenly items-center p-1 ring-1 ring-neutral-200 rounded bg-neutral-100 opacity-95",children:[e(VertexViewerCrossSectionAlignmentPopoverMenu,{disabled:!l}),e(R,{className:"w-auto",content:"Reverse",children:e(D,{iconName:"flip","data-testid":"viewer-toolbar-flip-button",onClick:n.flipPlanes,iconColor:"secondary",disabled:!l})}),e(R,{className:"w-auto",content:"Align View to Plane",children:e(D,{"data-testid":"viewer-toolbar-align-view-to-plane-button",iconName:"align-view-to-plane",onClick:n.alignViewToPlane,iconColor:"secondary",disabled:!l})}),e(VertexToolbarDivider,{}),e(VertexViewerCrossSectionAxisPopoverMenu,{disabled:!l}),e("div",{className:"w-52 mx-2",children:e(VertexSlider,{value:d,defaultValue:c.default,disabled:asBooleanAttribute("hasValue"!==i.state)||!l,min:c.min,max:c.max,step:.01,onChange:handleCrossSectionValueChange})}),e("div",{className:"px-4",children:e(VertexViewerCrossSectionOffsetStepper,{offset:"hasValue"===o.state&&l?o.contents:0,disabled:!l,onOffsetChange:handleCrossSectionValueChange})})]})]})}const VertexViewerCrossSectionButton=()=>{const a=useCrossSectioningActions(),i=s(gt);return t(n,{children:[e(R,{content:i?"Hide Section":"Show Section",children:e(D,{"data-testid":"viewer-toolbar-cross-section-button",iconName:"cross-section",iconColor:i?"primary":"secondary",onClick:()=>i?a.disable():a.enable()})}),e(VertexViewerCrossSectionPopupMenu,{})]})},VertexFitAllButton=()=>{const t=s(et);return e(R,{content:"Fit All",children:e(D,{iconName:"fit-all",iconColor:"secondary","data-testid":"viewer-toolbar-fit-all-button",onClick:async()=>{const e=await(t?.scene());await(e?.camera().viewAll().render({animation:{milliseconds:500}}))}})})},VertexPanButton=()=>{const t=s(et),n=s(nt),[a,i]=l(it),[o,r]=l(at);return A.useEffect((()=>{null!=t&&n&&r(t.getBaseInteractionHandler())}),[t,n,r]),e(R,{content:"Pan",children:e(D,{iconName:"pan",iconColor:"pan"===a?"primary":"secondary","data-testid":"viewer-toolbar-pan-button",onClick:async()=>{if(i("pan"),null!=o){const e=await o;e?.setPrimaryInteractionType("pan")}}})})},VertexRotateButton=()=>{const t=s(et),n=s(nt),[a,i]=l(it),[o,r]=l(at);return A.useEffect((()=>{null!=t&&n&&r(t.getBaseInteractionHandler())}),[t,n,r]),e(R,{content:"Rotate",children:e(D,{iconName:"rotate",iconColor:"rotate"===a?"primary":"secondary","data-testid":"viewer-toolbar-rotate-button",onClick:async()=>{if(i("rotate"),null!=o){const e=await o;e?.setPrimaryInteractionType("rotate")}}})})},VertexZoomButton=()=>{const t=s(et),n=s(nt),[a,i]=l(it),[o,r]=l(at);return A.useEffect((()=>{null!=t&&n&&r(t.getBaseInteractionHandler())}),[t,n,r]),e(R,{content:"Zoom",children:e(D,{iconName:"zoom",iconColor:"zoom"===a?"primary":"secondary","data-testid":"viewer-toolbar-zoom-button",onClick:async()=>{if(i("zoom"),null!=o){const e=await o;e?.setPrimaryInteractionType("zoom")}}})})},DefaultToolbar=()=>e(ge,{placement:"bottom-center",children:t(fe,{className:"p-1 border border-neutral-200 rounded bg-neutral-100 opacity-95",children:[e(VertexRotateButton,{}),e(VertexPanButton,{}),e(VertexZoomButton,{}),e(VertexFitAllButton,{}),e(VertexToolbarDivider,{}),e(VertexBoxSelectionButton,{}),e(VertexToolbarDivider,{}),e(VertexViewerCrossSectionButton,{}),e(VertexToolbarDivider,{}),e(VertexPointToPointMeasurementTool,{}),e(VertexPreciseMeasurementTool,{})]})}),VertexToolbar=({endCapEnabledByDefault:t,children:n})=>{const a=c(wt),i=c(bt);A.useEffect((()=>{null!=t&&(a(t),i(t))}),[t]);const o=undefined;return e(ge,{placement:"bottom-center",children:null!=n&&!1!==n?e(fe,{className:"p-1 border border-neutral-200 rounded bg-neutral-100 opacity-95",children:n}):e(DefaultToolbar,{})})};function VertexTransformWidget({transformWidgetElement:t,supportUndo:a,onPositionChange:i,onRotationChange:o}){const r=useTransformActions(),l=s(aa),c=s(Jn),d=s(Qn),u=s(na),m=p(ta),h=s(Kn),f=s($n),g=A.useMemo((()=>"hasValue"===m.state?m.contents:u),[m,u]),v=A.useMemo((()=>{const e=undefined;return c&&(null!=g||l)}),[c,g,l]);return e(n,{children:v&&e(ye,{id:"transform-widget","data-testid":"viewer-transform-widget",ref:t,position:d,rotation:null!=d?g:void 0,decimalPlaces:parseInt(f,10),distanceUnit:toUnitType(h),EXPERIMENTAL_undoKeybindings:a??!0,onInteractionStarted:()=>{r.disableSelectionSync(),r.setIsInteractivelyTransforming(!0)},onInteractionEnded:()=>{r.invalidateTransforms(),r.setIsInteractivelyTransforming(!1)},onPositionChanged:async e=>{await r.setTransformWidgetPosition(e.detail),i?.(e.detail)},onRotationChanged:e=>{r.setTransformWidgetOrientation(e.detail),o?.(e.detail)}})})}const VertexViewerSceneReset=({onReset:t})=>{const n=useCrossSectioningActions(),a=useModelViewActions(),i=useSelectionActions(),o=useTransformActions(),r=useViewerSceneActions(),s=c(Wn),l=undefined;return e(R,{content:"Reset View",children:e(D,{iconName:"reset",className:"flex bg-white opacity-70 hover:opacity-100 text-neutral-900 hover:text-neutral-700 hover:bg-neutral-200 rounded p-1 cursor-pointer","data-testid":"viewer-reset-tool-button",onClick:async()=>{await n.disable(),await i.resetSelectionState(),o.clearTransformWidgetPosition(),await o.invalidateTransforms(),s(void 0),await a.clearModelView(),t?.(),await r.reset()},variant:"plain"})})};function useViewerFrameActions(){const e=useTransformActions();return{frameDrawn:useActionCallback((({set:t,snapshot:n})=>async a=>{const i=await n.getPromise(Bn);t(rt,a.detail.scene),t(Bn,a.detail.scene.sceneViewSummary.selectedVisibleSummary),t(zn,i);const o=undefined;await n.getPromise(Jn)&&await e.syncToSelection()}))}}const VertexBoxSelectionTool=()=>{const{element:t,callback:n}=useCallbackRef(),a=useBoxSelectionActions(),i=useTransformActions(),o=s(rn);return k.useEffect((()=>{const e=whenComponentReady(t,(()=>[t?.model?.onDragComplete((()=>{"clearAndSelect"===o&&(i.clearTransformWidgetOrientation(),i.clearTransformWidgetPosition(),i.enableSelectionSync())}))]));return()=>{e?.then((e=>{e?.forEach((e=>e?.dispose()))}))}}),[t,o]),useApplyKeyBinding({keyBind:"Shift",fn:k.useCallback((()=>a.setOperationType("select")),[]),off:k.useCallback((()=>a.setOperationType("clearAndSelect")),[])}),e(ve,{ref:n,"data-testid":"viewer-box-query-tool",operationType:o})};function VertexViewerCameraTypeMenu({open:n,onOpen:a,onDismiss:i,onCameraTypeChange:o}){const r=useViewerCameraActions(),l=s(Qe);return t(K,{"data-testid":"camera-types-popover",className:"flex",placement:"bottom-end",open:asBooleanAttribute(n),onMenuClosed:i,children:[e("div",{slot:"anchor",children:e("div",{className:Kt("flex bg-white hover:opacity-100 hover:text-neutral-700 hover:bg-neutral-200 rounded",{"opacity-70 text-neutral-900":!n,"opacity-100 text-neutral-700 bg-neutral-200":n}),children:e(R,{content:"Change View",children:e(D,{"data-testid":"set-camera-mode-option",className:"p-1 cursor-pointer",variant:"plain",onClick:a,iconName:"orthographic"===l?"cube-orthographic":"cube-perspective",children:e(F,{"data-testid":"change-camera-type-icon-button",name:"chevron-down",size:"sm"})})})})}),t("div",{className:"w-36",children:[e("div",{className:"pt-1"}),t(W,{"data-testid":"set-perspective-view",onClick:()=>{r.updateCameraType("perspective",!0),o?.("perspective")},children:[e(F,{slot:"icon","data-testid":"set-perspective-view-icon",name:"cube-perspective",size:"sm",className:Kt({"text-[var(--vertex-ui-blue-700)]":"perspective"===l})}),e("div",{className:Kt("ml-2 items-center",{"text-[var(--vertex-ui-blue-700)]":"perspective"===l}),children:"Perspective"})]}),t(W,{"data-testid":"set-orthographic-view",onClick:()=>{r.updateCameraType("orthographic",!0),o?.("orthographic")},children:[e(F,{slot:"icon","data-testid":"set-orthographic-view-icon",name:"cube-orthographic",size:"sm",className:Kt({"text-[var(--vertex-ui-blue-700)]":"orthographic"===l})}),e("div",{className:Kt("ml-2 items-center",{"text-[var(--vertex-ui-blue-700)]":"orthographic"===l}),children:"Orthographic"})]})]})]})}const VertexViewerViewCube=({placement:n,children:a,...i})=>{const o=Array.isArray(a)?a:[a],r=o.filter((e=>!A.isValidElement(e)||e.type!==be)).filter((e=>null!=e&&!1!==e)),s=o.find((e=>A.isValidElement(e)&&e.type===be)),[l,c]=A.useState(!1);return t(ge,{direction:"vertical","data-testid":"view-cube-toolbar",placement:n??"top-right",children:[s??e(be,{className:"m-7",...i}),0===r.length?t("div",{className:"flex items-center justify-center mt-3 gap-1",children:[e(VertexViewerSceneReset,{}),e(VertexViewerCameraTypeMenu,{open:l,onDismiss:()=>c(!1),onOpen:()=>c(!0)})]}):e("div",{className:"mt-3",children:r})]})},VertexViewer=({id:a,src:i,className:o,disableSelection:r,onTap:d,onLongpress:u,onFrameDrawn:m,onSceneReady:p,viewerRefCallback:h,children:f,...g})=>{const v=s(Ti),b=useRecoilRef({state:et}),w=useViewerCameraActions(),C=useCrossSectioningActions(),S=useHitActions(),k=useSelectionActions(),T=useViewerFrameActions(),P=s(Qe),M=s(kt),E=s(on),I=c(ot),[N,V]=l(nt);A.useEffect((()=>{N&&(V(!1),C.disable())}),[i]);const[O,L]=l(tt);A.useEffect((()=>{null!=a&&L(a)}),[a]);const _=s(Ci),R=A.useMemo((()=>({opacity:_/100})),[_]),D=s(Yt),B=s(Xt),j=A.useMemo((()=>({color:D,width:B})),[D,B]),H=s(wt),F=s(Ct),U=s(St),W=A.useMemo((()=>({endCapEnabled:H,endCapUsePartColor:F===ut.PART,...H&&F===ut.SINGLE&&{endCapColor:U}})),[H,F,U]),G=s(ai),K=s(Qa),$=s(ei),q=s(ti),Y=A.useMemo((()=>({color:K,opacity:$/100,lineWidth:q})),[K,$,q]),X=s(mn),Z=null!=f&&!1!==f;return useKeyBindings(),useDefaultKeybindings(),t(we,{id:O,"data-testid":"vertex-viewer",src:i,ref:e=>{h?.(e),b(e)},className:Kt("flex w-full h-full",o,{"cursor-crosshair":M.hitPending}),style:{"--viewer-background":G},config:v,cameraType:N?P:void 0,onCameraTypeChanged:e=>{N&&w.updateCameraType(e.detail,!1)},phantom:R,featureLines:j,selectionHighlighting:Y,crossSectioning:W,featureMaps:X?"final":void 0,onTap:e=>{const t=[...r?[]:[k.selectCurrentHit]];S.tap(e,...t),d?.(e)},onLongpress:e=>{S.longPress(e),u?.(e)},onFrameDrawn:e=>{T.frameDrawn(e),m?.(e)},onSceneReady:async e=>{if(!N){V(!0);const t=await(e?.target?.scene());I(t?.sceneViewId)}p?.(e)},...g,children:[E&&e(VertexBoxSelectionTool,{}),Z?f:t(n,{children:[e(VertexViewerViewCube,{}),e(VertexToolbar,{}),e(VertexViewerContextMenu,{})]})]})};function toSdkConfig(e){return isOnlyNetworkConfig(e)?{network:e}:e}function isOnlyNetworkConfig(e){const t=undefined;return null!=e.renderingHost}const VertexViewerToolkitEventListener=({onHitStateChange:t,onSelectionStateChange:a})=>{const i=s(ha),o=s(Ra);return A.useEffect((()=>{t?.(i)}),[i,t]),A.useEffect((()=>{a?.(o)}),[o,a]),e(n,{})},VertexViewerToolkitRoot=({override:a,autoDefineCustomElements:i,children:o,config:r,...s})=>(A.useEffect((()=>{(null==i||i)&&(xe(),Se())}),[i]),e(f,{override:a,children:t(n,{children:[e(VertexViewerToolkitEventListener,{...s}),e(VertexViewerToolkitRootConfig,{config:r,children:o})]})})),VertexViewerToolkitRootConfig=({config:t,children:a})=>{const i=c(Ti);return A.useEffect((()=>{const e=null!=t?toSdkConfig(t):void 0;i(e)}),[t,i]),e(n,{children:a})};var so=Object.freeze({__proto__:null,get AssemblyFontFace(){return Yi},Columns:Bi,Core:_a,Metadata:Ji,Search:qi});export{ii as Appearance,sn as BoxSelection,Pi as Config,an as ContextMenu,Ut as CrossSection,Ai as Ghosting,fa as Hits,si as Keybinding,xn as Measurement,Ze as Messages,bi as Metadata,to as ModelViews,ui as Panel,Tn as Performance,so as SceneTree,Gn as SceneViewItem,Da as Selection,qn as Settings,pa as Transforms,VertexApplicationMessages,VertexBoxSelectionButton,VertexContextMenu,VertexCrossSectionAppearanceColorPicker,VertexCrossSectionAppearanceControls,VertexCrossSectionAppearanceLineThicknessSlider,VertexCrossSectionAppearancePanelSection,VertexCrossSectionAppearanceReset,VertexDecimalPlaceSelector,VertexFeatureEdgesColorPicker,VertexFeatureEdgesControls,VertexFeatureEdgesPanelSection,VertexFeatureEdgesReset,VertexFeatureEdgesThicknessSlider,VertexFitAllButton,VertexFitSelectedMenuItem,VertexFlyToMenuItem,VertexGhostingControls,VertexGhostingPanelSection,VertexHideAllMenuItem,VertexHidePartMenuItem,VertexHideSelectedMenuItem,VertexLengthUnitSelector,VertexMaterialControls,VertexMaterialPanelSection,VertexMeasurementContextMenu,VertexMeasurementDetails,VertexModelViewsPanel,VertexPanButton,VertexPointToPointMeasurement,VertexPointToPointMeasurementTool,VertexPreciseMeasurement,VertexPreciseMeasurementTool,VertexResizableContent,VertexRotateButton,VertexSceneItemGhostingClear,VertexSceneItemGhostingOpacitySlider,VertexSceneItemGhostingToggle,VertexSceneItemMaterialClear,VertexSceneItemMaterialColorPicker,VertexSceneItemMaterialColorSwatches,VertexSceneItemMaterialOpacitySlider,VertexSceneTree,VertexSceneTreeColumnPopover,VertexSceneTreeContextMenu,VertexSceneTreeCustomColumn,VertexSceneTreeHeader,VertexSceneTreeMetadataColumns,VertexSceneTreeSearchBar,VertexSceneTreeSearchInformationForToolbar,VertexSceneTreeSearchOptionsPopover,VertexSceneTreeTableLayout,VertexSelectionHighlightingColorPicker,VertexSelectionHighlightingControls,VertexSelectionHighlightingLineThicknessSlider,VertexSelectionHighlightingOpacitySlider,VertexSelectionHighlightingPanelSection,VertexSelectionHighlightingReset,VertexShowAllMenuItem,VertexShowOnlyMenuItem,VertexShowOnlySelectedMenuItem,VertexShowPropertiesMenuItem,VertexToolbar,VertexToolbarDivider,VertexTransformClear,VertexTransformControls,VertexTransformInputs,VertexTransformManipulatorToggle,VertexTransformPanelSection,VertexTransformWidget,VertexUnitsControls,VertexUnitsPanelSection,VertexViewer,VertexViewerBackgroundColorPicker,VertexViewerBackgroundControls,VertexViewerBackgroundPanelSection,VertexViewerBackgroundReset,VertexViewerContextMenu,VertexViewerCrossSectionButton,VertexViewerRightOpenedPanel,VertexViewerRightSidebar,VertexViewerSceneReset,VertexViewerToolkitRoot,VertexViewerViewCube,VertexZoomButton,lt as Viewer};
18
+ */La=Va,function(){var e={}.hasOwnProperty;function classNames(){for(var e="",t=0;t<arguments.length;t++){var n=arguments[t];n&&(e=appendClass(e,parseValue(n)))}return e}function parseValue(t){if("string"==typeof t||"number"==typeof t)return t;if("object"!=typeof t)return"";if(Array.isArray(t))return classNames.apply(null,t);if(t.toString!==Object.prototype.toString&&!t.toString.toString().includes("[native code]"))return t.toString();var n="";for(var a in t)e.call(t,a)&&t[a]&&(n=appendClass(n,a));return n}function appendClass(e,t){return t?e?e+" "+t:e+t:e}La.exports?(classNames.default=classNames,La.exports=classNames):window.classNames=classNames}();var _a=Va.exports;const VertexSlider=({value:n,defaultValue:a,leftLabel:i,rightLabel:o,onChange:r,onValueChange:s,onValueInput:l,...c})=>{const[d,u]=A.useState(a);return t("div",{className:"flex w-full items-center gap-2",children:[i&&e("div",{className:"pl-0.5 text-xs text-center",children:i}),e(D,{className:_a("w-full",{"mt-0.5":null!=i||null!=o}),value:n??d,onValueChange:e=>{u(e.detail.value),r?.(e.detail.value),s?.(e)},onValueInput:e=>{u(e.detail.value),r?.(e.detail.value),l?.(e)},...c}),o&&e("div",{className:"text-xs pr-2 flex-shrink-0 text-right",children:o})]})},VertexCrossSectionAppearanceLineThicknessSlider=({onUpdate:t})=>{const n=useCrossSectioningActions(),[a,i]=h(vt);return e(VertexSlider,{id:"cross-section-line-thickness","data-testid":"cross-section-line-thickness-slider",leftLabel:"Off",rightLabel:"Thick",min:0,max:3,step:.5,value:a,valueLabelDisplay:"auto",onValueInput:async e=>{i(e.detail.value),await n.reapply()},onValueChange:e=>{t?.(e.detail.value)}})},VertexEndCapColorOptions=({onUpdateColorType:n})=>{const[a,i]=h(Ct);return e("div",{className:"pl-2 text-sm text-neutral-700",children:t(B,{value:a,"data-testid":"end-capping-color-type-radio-group",name:"end-capping-color-type",onValueChanged:e=>{i(e.detail.toUpperCase()===ut.PART?ut.PART:ut.SINGLE),n?.(e.detail)},children:[e(H,{"data-testid":"end-capping-color-part-color",label:"Part Color",value:ut.PART}),e(H,{"data-testid":"end-capping-color-single-color",label:"Single Color",value:ut.SINGLE})]})})},VertexEndCapColorPicker=({onUpdateCustomColor:t})=>{const[n,a]=h(St);return e(VertexColorPicker,{"data-testid":"end-capping-color-picker",value:n,onValueChanged:e=>{t?.(e.detail)},onInput:e=>a(e)})},VertexEndCapToggle=({onEnabledChange:t})=>{const[n,a]=h(wt);return e(j,{className:"flex items-center","data-testid":"end-capping-enabled-toggle",variant:"switch",checked:n,onValueChanged:async e=>{a(e.detail),t?.(e.detail)}})};function VertexCrossSectionAppearanceControls({onUpdateCrossSectionColor:a,onUpdateCrossSectionLineThickness:i,onEndCapEnabledChange:o,onUpdateEndCapColorType:r,onUpdateEndCapCustomColor:l}){const c=s(Ct);return t(n,{children:[t("div",{className:"flex items-center pt-2 pb-2",children:[e(VertexEndCapToggle,{onEnabledChange:o}),e("span",{className:"pl-4 text-sm text-neutral-700",children:"Show End Cap"})]}),e("div",{className:"pt-2 pb-2 text-sm text-neutral-700",children:"Line Color"}),e(VertexCrossSectionAppearanceColorPicker,{onUpdate:a}),e("div",{className:"pt-4 pb-2 text-sm text-neutral-700",children:"Line Thickness"}),e(VertexCrossSectionAppearanceLineThicknessSlider,{onUpdate:i}),t("div",{children:[e("div",{className:"pt-4 pb-2 text-sm text-neutral-700",children:"Cap Color"}),e(VertexEndCapColorOptions,{onUpdateColorType:r}),c===ut.SINGLE&&e("div",{className:"mt-2",children:e(VertexEndCapColorPicker,{onUpdateCustomColor:l})})]})]})}function PanelSection({header:n,children:a}){return t("div",{className:"py-3 px-4 border-neutral-300 border-b",children:[e("div",{className:"my-2 text-base text-neutral-700",children:n}),a]})}const VertexCrossSectionAppearanceReset=({onReset:t})=>{const n=useCrossSectioningActions(),[a,i]=h(yt),[o,r]=h(vt),l=s(bt),[c,d]=h(wt),[u,m]=h(Ct),[p,f]=h(St),g=a!==mt||1!==o||c!==l||u!==ut.PART||p!==ht;return e("div",{className:"ml-auto",children:e(F,{content:"Reset Cross Sectioning Appearance",children:e(W,{"data-testid":"cross-section-appearance-reset",iconName:"reset",iconSize:"sm",onClick:async()=>{i(mt),r(1),d(l),m(ut.PART),f(ht),t?.(),await n.reapply()},disabled:!g})})})};function VertexCrossSectionAppearancePanelSection({onResetCrossSectionAppearance:n,onUpdateCrossSectionColor:a,onUpdateCrossSectionLineThickness:i,onEndCapEnabledChange:o,onUpdateEndCapColorType:r,onUpdateEndCapCustomColor:s}){return e(PanelSection,{header:t("div",{className:"flex items-center text-base",children:["Cross Sectioning",e(VertexCrossSectionAppearanceReset,{onReset:n})]}),children:e(VertexCrossSectionAppearanceControls,{onUpdateCrossSectionColor:a,onUpdateCrossSectionLineThickness:i,onEndCapEnabledChange:o,onUpdateEndCapColorType:r,onUpdateEndCapCustomColor:s})})}const Ra=.5,Da="#444444",za=o({key:"featureEdgesSelectedColor",default:Da}),Ba=o({key:"featureEdgesLineThickness",default:Ra}),VertexFeatureEdgesColorPicker=({onUpdate:t})=>{const[n,a]=h(za);return e(VertexColorPicker,{"data-testid":"feature-edges-color-picker",value:n,onValueChanged:e=>{t?.(e.detail)},onInput:e=>a(e)})},VertexFeatureEdgesThicknessSlider=({onUpdate:t})=>{const[n,a]=h(Ba);return e(VertexSlider,{id:"feature-edges-thickness","data-testid":"feature-edges-thickness-slider",leftLabel:"Off",rightLabel:"Thick",min:0,max:3,step:.5,value:n,valueLabelDisplay:"auto",onValueInput:e=>{a(e.detail.value)},onValueChange:e=>{t?.(e.detail.value)}})};function VertexFeatureEdgesControls({onUpdateFeatureEdgesColor:a,onUpdateFeatureEdgesThickness:i}){return t(n,{children:[e("div",{className:"pt-1 pb-2 text-sm text-neutral-700",children:"Color"}),e(VertexFeatureEdgesColorPicker,{onUpdate:a}),e("div",{className:"pt-4 pb-2 text-sm text-neutral-700",children:"Line Thickness"}),e(VertexFeatureEdgesThicknessSlider,{onUpdate:i})]})}const VertexFeatureEdgesReset=({onReset:t})=>{const[n,a]=h(za),[i,o]=h(Ba),r=undefined;return e("div",{className:"ml-auto",children:e(F,{content:"Reset Feature Edges",children:e(W,{"data-testid":"feature-edges-reset",iconName:"reset",iconSize:"sm",onClick:()=>{a(Da),o(Ra),t?.()},disabled:!(i!==Ra||n!==Da)})})})};function VertexFeatureEdgesPanelSection({onResetFeatureEdges:n,onUpdateFeatureEdgesColor:a,onUpdateFeatureEdgesThickness:i}){return e(PanelSection,{header:t("div",{className:"flex items-center text-base",children:["Feature Edges",e(VertexFeatureEdgesReset,{onReset:n})]}),children:e(VertexFeatureEdgesControls,{onUpdateFeatureEdgesColor:a,onUpdateFeatureEdgesThickness:i})})}function createColorMaterialWithId(e,t=_e.create()){return{id:t,..._.fromHex(e)}}const Ha=255,ja=18,Fa=o({key:"sceneItemAdjustmentsSelectedColor",default:void 0}),Wa=o({key:"sceneItemAdjustmentsRecentColors",default:[]}),Ua=o({key:"sceneItemAdjustmentsCustomColors",default:[createColorMaterialWithId("#ffffff"),createColorMaterialWithId("#616161")]}),Ga=o({key:"sceneItemAdjustmentsSelectedOpacity",default:void 0}),Ka=l({key:"appliedItemMaterialOverride",default:void 0}),$a=o({key:"appliedItemMaterialOverrideIds",default:[]}),qa=r({key:"sceneItemAdjustmentsLastSelectedOverride",get:({get:e})=>{const t=e($t);if(null!=t)return e(Ka(t.id))}}),Ya=o({key:"applyMaterialToAllUserAction",default:void 0}),Xa=o({key:"showConfirmDialogWhenApplyingMaterialToAll",default:!0}),Za=o({key:"confirmApplyMaterialToAllDialogOpen",default:!1}),useSceneItemMaterialActions=()=>{const e=useViewerSceneActions(),t=useActionCallback((({snapshot:e,reset:t})=>async()=>{const n=await e.getPromise($a);t(Fa),n.forEach((e=>t(Ka(e)))),t($a)}));return{updateColor:useActionCallback((({set:e})=>t=>{e(Fa,t)})),saveRecentColor:useActionCallback((({set:e,snapshot:t})=>async n=>{const a=await t.getPromise(Wa),i=[n,...a.filter((e=>e!==n))],o=i.length>ja?i.slice(0,-(i.length-ja)):i;e(Fa,n),e(Wa,o)})),removeRecentColor:useActionCallback((({set:e,snapshot:t})=>async n=>{const a=undefined,i=(await t.getPromise(Wa)).filter((e=>e.id!==n));e(Wa,i)})),setCustomColors:useActionCallback((({set:e})=>async t=>{e(Ua,t)})),saveCustomColor:useActionCallback((({set:e,snapshot:t})=>async n=>{const a=undefined,i=[...await t.getPromise(Ua),n],o=i.length>ja?i.slice(i.length-ja):i;e(Fa,n),e(Ua,o)})),removeCustomColor:useActionCallback((({set:e,snapshot:t})=>async n=>{const a=undefined,i=(await t.getPromise(Ua)).filter((e=>e.id!==n));e(Ua,i)})),clearCurrentColor:useActionCallback((({reset:e})=>()=>{e(Fa)})),clearCurrentOpacity:useActionCallback((({reset:e})=>()=>{e(Ga)})),clear:useActionCallback((({snapshot:t,set:n,reset:a})=>async()=>{const i=await t.getPromise(Kt);a(Fa),i.forEach((e=>a(Ka(e)))),n($a,(e=>e.filter((e=>!i.includes(e))))),await e.execute(Wt.CLEAR_SELECTED_MATERIAL_OVERRIDES,(e=>e.where((e=>e.withSelected())).clearMaterialOverrides().select()))})),clearAll:useActionCallback((()=>async()=>{await t(),await e.execute(Wt.CLEAR_ALL_MATERIAL_OVERRIDES,(e=>e.where((e=>e.all())).clearMaterialOverrides()),(e=>e.where((e=>e.withSelected())).select()))})),clearState:t,updateOpacity:useActionCallback((({set:e})=>t=>{e(Ga,t)})),apply:useActionCallback((({snapshot:t,set:n})=>async()=>{const a=await t.getPromise(Fa),i=await t.getPromise(Ga),o=await t.getPromise(Kt),r=await t.getPromise(qa),s=a??r,l=i??r?.opacity;if(null!=s){const t={...s,opacity:l??s.opacity};await e.execute(Wt.APPLY_MATERIAL_OVERRIDE_TO_SELECTION,(e=>e.where((e=>e.withSelected())).materialOverride(t))),o.forEach((e=>n(Ka(e),t))),n($a,(e=>[...e,...o]))}})),confirmApplyAll:useActionCallback((({set:e})=>t=>{e(Za,!0),e(Ya,(()=>t))})),cancelApplyAll:useActionCallback((({reset:e})=>()=>{e(Za),e(Ya)})),applyAll:useActionCallback((({snapshot:t,reset:n})=>async()=>{const a=await t.getPromise(Fa),i=await t.getPromise(Ga);if(null!=a){const o=await t.getPromise($a),r={...a,opacity:i??a.opacity};await e.execute(Wt.APPLY_MATERIAL_OVERRIDE_TO_ALL,(e=>e.where((e=>e.all())).materialOverride(r))),o.forEach((e=>n(Ka(e))));const s=await t.getPromise(Ya);s?.(r),n(Za),n(Ya)}})),hideConfirmApplyAllDialog:useActionCallback((({set:e})=>()=>{e(Xa,!1)}))}},Ja="#ffff00",Qa=35,ei=1,ti=o({key:"selectionHighlightingSelectedColor",default:Ja}),ni=o({key:"selectionHighlightingSelectedOpacity",default:Qa}),ai=o({key:"selectionHighlightingSelectedLineThickness",default:1});function elementIsColorSwatch(e){return e instanceof Element&&"VERTEX-COLOR-SWATCH"===e.nodeName}function elementHasColorAttribute(e){return"true"===e.getAttribute("data-custom-color")||"true"===e.getAttribute("data-recent-color")}const ii="#FFFFFF",oi=o({key:"viewerBackgroundSelectedColor",default:ii});var ri=Object.freeze({__proto__:null,DEFAULT_FEATURE_EDGE_COLOR:Da,DEFAULT_FEATURE_EDGE_THICKNESS_VALUE:Ra,DEFAULT_SELECTION_HIGHLIGHTING_COLOR:Ja,DEFAULT_SELECTION_HIGHLIGHTING_LINE_THICKNESS:1,DEFAULT_SELECTION_HIGHLIGHTING_OPACITY:Qa,DEFAULT_VIEWER_BACKGROUND_COLOR:ii,MAXIMUM_MATERIAL_OVERRIDE_OPACITY:Ha,MAX_STORED_COLOR_ARRAY_LENGTH:ja,appliedItemMaterialOverride:Ka,appliedItemMaterialOverrideIds:$a,applyMaterialToAllUserAction:Ya,confirmApplyMaterialToAllDialogOpen:Za,elementHasColorAttribute:elementHasColorAttribute,elementIsColorSwatch:elementIsColorSwatch,featureEdgesLineThickness:Ba,featureEdgesSelectedColor:za,sceneItemAdjustmentsCustomColors:Ua,sceneItemAdjustmentsLastSelectedOverride:qa,sceneItemAdjustmentsRecentColors:Wa,sceneItemAdjustmentsSelectedColor:Fa,sceneItemAdjustmentsSelectedOpacity:Ga,selectionHighlightingSelectedColor:ti,selectionHighlightingSelectedLineThickness:ai,selectionHighlightingSelectedOpacity:ni,showConfirmDialogWhenApplyingMaterialToAll:Xa,useSceneItemMaterialActions:useSceneItemMaterialActions,viewerBackgroundSelectedColor:oi});const VertexSceneItemMaterialApplyAll=({onApplyAll:t})=>{const n=useSceneItemMaterialActions(),a=m(qa),i=s(Fa),o=s(Xa),r=k.useMemo((()=>"hasValue"===a.state?i??a.contents:i),[a,i]);return e(F,{content:"Apply to All",children:e(W,{iconName:"square-dot-outline",iconSize:"sm",color:"secondary",disabled:null==r,onClick:async()=>{o?n.confirmApplyAll(t):(await n.applyAll(),t?.(r))}})})};function SceneItemMaterialApplyAllConfirmationDialog(){const a=useSceneItemMaterialActions(),i=s(Za),[o,r]=A.useState(!1),onCloseDialog=()=>{a.cancelApplyAll(),r(!1)};return i?t(U,{open:!0,className:"text-sm",onClosed:onCloseDialog,onBackdropClick:onCloseDialog,children:[e("div",{slot:"heading",children:"Apply to All Parts"}),e("div",{className:"max-w-lg break-words pr-2",children:"This will apply the same material to all parts in the model. Any previous material changes will be lost."}),t("div",{className:"flex mt-8 gap-2 items-center",children:[t("div",{className:"flex gap-2",children:[e(j,{"data-testid":"hide-confirmation-dialog-in-future-checkbox",variant:"check",className:"pt-0.5",checked:o,onValueChanged:e=>{r(e.detail)}}),"Don't show again this session"]}),t("div",{className:"flex ml-auto gap-2",children:[e(G,{"data-testid":"cancel-apply-material-to-all",onClick:onCloseDialog,children:"Cancel"}),e(G,{color:"primary","data-testid":"confirm-apply-material-to-all",onClick:async()=>{await a.applyAll(),o&&a.hideConfirmApplyAllDialog()},children:"Apply"})]})]})]}):e(n,{})}const VertexSceneItemMaterialColorPicker=({onApply:t})=>{const n=useSceneItemMaterialActions(),a=m(qa),i=s(Fa),o=k.useMemo((()=>"hasValue"===a.state?i??a.contents:i),[a,i]);return e(VertexColorPicker,{"data-testid":"selected-item-color-picker",value:null!=o?Pe.toHexString(o.diffuse):void 0,onValueChanged:async()=>{null!=o&&(await n.apply(),t?.(o),await n.saveRecentColor(createColorMaterialWithId(Pe.toHexString(o.diffuse))))},onInput:async e=>{n.updateColor(createColorMaterialWithId(e)),await n.apply()}})},ColorSwatch=({color:t,hideTooltip:n,onClick:a,...i})=>{const o="string"==typeof t?t:Pe.toHexString(t.diffuse);return e(F,{className:"flex-grow-0",content:o,disabled:!!n,children:e("button",{onClick:()=>a?.(t),children:e(K,{"data-testid":`color-swatch-${o}`,variant:"square",color:o,...i})})})},VertexSceneItemMaterialColorSwatches=({onAddCustomColor:a,onApplyCustomColor:i,onApplyRecentColor:o})=>{const r=useSceneItemMaterialActions(),l=s(Ua),c=s(Wa),d=l.length===ja;return t(n,{children:[t("div",{"data-testid":"appearance-custom-colors",className:"flex flex-wrap gap-2 mt-1 mb-4",children:[l.map((t=>e(ColorSwatch,{color:t,onClick:async()=>{r.updateColor(t),await r.apply(),i?.(t)},"data-custom-color":!0,"data-color-id":t.id},t.id))),!d&&e(R,{"data-testid":"appearance-custom-colors-add",variant:"swatch",size:"md",onValueChanged:async e=>{const t=createColorMaterialWithId(e.detail);await r.saveCustomColor(t),await r.apply(),a?.(t)},children:e("div",{slot:"overlay",className:"flex items-center justify-center w-full h-full",children:e($,{className:"bg-white p-2",name:"plus",size:"sm"})})})]}),!!c.length&&e("div",{"data-testid":"appearance-recent-colors",className:"flex flex-wrap gap-2",children:c.map((t=>e(ColorSwatch,{color:t,onClick:async()=>{r.updateColor(t),await r.apply(),o?.(t)},"data-recent-color":!0,"data-color-id":t.id},t.id)))})]})},VertexSceneItemMaterialOpacitySlider=({onApply:t})=>{const n=useSceneItemMaterialActions(),a=s(Ga),i=m(qa),o=k.useMemo((()=>"hasValue"===i.state?a??i.contents?.opacity??Ha:a??Ha),[a,i]),r=useDebouncedCallback((()=>{n.apply()}),500),l=k.useCallback((e=>{n.updateOpacity(e.detail.value),r(e.detail.value)}),[r,n]),c=k.useMemo((()=>"hasValue"!==i.state||null==i.contents),[i]);return e(F,{className:"flex w-full",content:c?"Select a part and apply a color to enable opacity":`${Math.floor(o/Ha*100)}%`,placement:"top",children:e(VertexSlider,{"data-testid":"scene-item-adjustments-opacity-slider",leftLabel:"0%",rightLabel:"100%",disabled:c,value:o??Ha,step:5,min:0,max:Ha,onValueChange:e=>{n.updateOpacity(e.detail.value),n.apply(),t?.(e.detail.value)},onValueInput:l})})};function VertexMaterialControls({customColors:a,onApplyMaterial:i,onApplyMaterialToAll:o,onAddCustomColor:r,onApplyCustomColor:l,onApplyRecentColor:c,onApplyOpacity:d}){const u=useSceneItemMaterialActions(),m=s($t);return A.useEffect((()=>{u.clearCurrentColor(),u.clearCurrentOpacity()}),[m?.id]),A.useEffect((()=>{if(null!=a){const e=a.map((e=>({...e,id:_e.create()})));u.setCustomColors(e)}}),[a]),t(n,{children:[t("div",{className:"flex flex-col",children:[e("div",{className:"pt-1 pb-2 text-sm text-neutral-700",children:"Color"}),t("div",{className:"flex items-center gap-2",children:[e(VertexSceneItemMaterialColorPicker,{onApply:i}),e(VertexSceneItemMaterialApplyAll,{onApplyAll:o})]})]}),e("div",{className:"pt-4 pb-2 text-sm text-neutral-700",children:"Color Swatches"}),e(VertexSceneItemMaterialColorSwatches,{onAddCustomColor:r,onApplyCustomColor:l,onApplyRecentColor:c}),e("div",{className:"pt-4 pb-2 text-sm text-neutral-700",children:"Opacity"}),e(VertexSceneItemMaterialOpacitySlider,{onApply:d}),e(SceneItemMaterialApplyAllConfirmationDialog,{})]})}const ResetButton=({id:n,tooltip:a,children:i})=>{const[o,r]=A.useState(!1);return e("div",{className:"ml-auto",children:t(q,{className:"flex items-stretch h-full","data-testid":`reset-button-dropdown-menu-${n}`,placement:"bottom-end",onMenuOpened:()=>r(!0),onMenuClosed:()=>r(!1),children:[e("div",{slot:"anchor",className:"flex items-center h-full",children:e(F,{content:a,disabled:o,placement:"bottom",children:t(G,{className:_a("p-1.5 rounded-md select-none hover:bg-neutral-300 active:bg-neutral-400 cursor-pointer",{"bg-neutral-300":o}),"data-testid":`reset-button-${n}`,variant:"plaintext",children:[e($,{className:"px-0.5",name:"reset",size:"sm"}),e($,{name:"chevron-down",size:"sm"})]})})}),e("div",{className:"whitespace-nowrap",children:i})]})})},VertexSceneItemMaterialClear=({onClear:n,onClearAll:a})=>{const i=useSceneItemMaterialActions(),o=s(on);return e("div",{className:"ml-auto",children:t(ResetButton,{id:"materials",tooltip:"Clear Materials",children:[e("div",{className:"pt-1"}),e(Y,{"data-testid":"clear-selected-materials",onClick:()=>{i.clear(),n?.()},disabled:!o,children:"Clear selected materials"}),e(Y,{"data-testid":"clear-all-materials",onClick:()=>{i.clearAll(),a?.()},children:"Clear all materials"})]})})};function VertexMaterialPanelSection({customColors:n,onClearMaterial:a,onClearAllMaterials:i,onApplyMaterial:o,onApplyMaterialToAll:r,onAddCustomColor:s,onApplyCustomColor:l,onApplyRecentColor:c,onApplyOpacity:d}){return e(PanelSection,{header:t("div",{className:"flex items-center text-base",children:["Material",e(VertexSceneItemMaterialClear,{onClear:a,onClearAll:i})]}),children:e(VertexMaterialControls,{customColors:n,onApplyMaterial:o,onApplyMaterialToAll:r,onAddCustomColor:s,onApplyCustomColor:l,onApplyRecentColor:c,onApplyOpacity:d})})}const VertexSelectionHighlightingColorPicker=({onUpdate:t})=>{const[n,a]=h(ti);return e(VertexColorPicker,{"data-testid":"selection-highlighting-color-picker",value:n,onValueChanged:e=>{t?.(e.detail)},onInput:e=>a(e)})},VertexSelectionHighlightingLineThicknessSlider=({onUpdate:t})=>{const[n,a]=h(ai);return e(VertexSlider,{id:"selection-highlighting-line-thickness","data-testid":"selection-highlighting-line-thickness-slider",leftLabel:"Off",rightLabel:"Thick",min:0,max:3,step:.5,value:n,valueLabelDisplay:"auto",onValueInput:e=>{a(e.detail.value)},onValueChange:e=>{t?.(e.detail.value)}})},VertexSelectionHighlightingOpacitySlider=({onUpdate:t})=>{const[n,a]=h(ni);return e(VertexSlider,{id:"selection-highlighting-opacity","data-testid":"selection-highlighting-opacity-slider",leftLabel:"0%",rightLabel:"100%",min:0,max:100,step:5,value:n,valueLabelDisplay:"auto",onValueInput:e=>{a(e.detail.value)},onValueChange:e=>{t?.(e.detail.value)}})};function VertexSelectionHighlightingControls({onUpdateSelectionHighlightColor:a,onUpdateSelectionHighlightOpacity:i,onUpdateSelectionHighlightLineThickness:o}){return t(n,{children:[e("div",{className:"pt-1 pb-2 text-sm text-neutral-700",children:"Color"}),e(VertexSelectionHighlightingColorPicker,{onUpdate:a}),e("div",{className:"pt-4 pb-2 text-sm text-neutral-700",children:"Opacity"}),e(VertexSelectionHighlightingOpacitySlider,{onUpdate:i}),e("div",{className:"pt-4 pb-2 text-sm text-neutral-700",children:"Line Thickness"}),e(VertexSelectionHighlightingLineThicknessSlider,{onUpdate:o})]})}const VertexSelectionHighlightingReset=({onReset:t})=>{const[n,a]=h(ti),[i,o]=h(ni),[r,s]=h(ai),l=undefined;return e("div",{className:"ml-auto",children:e(F,{content:"Reset Selection Highlighting",children:e(W,{"data-testid":"selection-highlighting-reset",iconName:"reset",iconSize:"sm",onClick:()=>{a(Ja),o(Qa),s(1),t?.()},disabled:!(n!==Ja||i!==Qa||1!==r)})})})};function VertexSelectionHighlightingPanelSection({onResetSelectionHighlighting:n,onUpdateSelectionHighlightColor:a,onUpdateSelectionHighlightOpacity:i,onUpdateSelectionHighlightLineThickness:o}){return e(PanelSection,{header:t("div",{className:"flex items-center text-base",children:["Selection Highlighting",e(VertexSelectionHighlightingReset,{onReset:n})]}),children:e(VertexSelectionHighlightingControls,{onUpdateSelectionHighlightColor:a,onUpdateSelectionHighlightOpacity:i,onUpdateSelectionHighlightLineThickness:o})})}const VertexViewerBackgroundColorPicker=({onUpdate:t})=>{const[n,a]=h(oi);return e(VertexColorPicker,{"data-testid":"viewer-background-color-picker",value:n,onValueChanged:e=>{t?.(e.detail)},onInput:e=>a(e)})};function VertexViewerBackgroundControls({onUpdateViewerBackgroundColor:a}){return t(n,{children:[e("div",{className:"pt-1 pb-2 text-sm text-neutral-700",children:"Color"}),e(VertexViewerBackgroundColorPicker,{onUpdate:a})]})}const VertexViewerBackgroundReset=({onReset:t})=>{const[n,a]=h(oi),i=undefined;return e("div",{className:"ml-auto",children:e(F,{content:"Reset Background Color",children:e(W,{"data-testid":"viewer-background-reset",iconName:"reset",iconSize:"sm",onClick:()=>{a(ii),t?.()},disabled:!(n!==ii)})})})};function VertexViewerBackgroundPanelSection({onResetViewerBackgroundColor:n,onUpdateViewerBackgroundColor:a}){return e(PanelSection,{header:t("div",{className:"flex items-center text-base",children:["Viewer Background",e(VertexViewerBackgroundReset,{onReset:n})]}),children:e(VertexViewerBackgroundControls,{onUpdateViewerBackgroundColor:a})})}const isInputElement=e=>{const t=e instanceof HTMLElement&&"VERTEX-AUTO-RESIZE-TEXTAREA"===e.tagName,n=e instanceof HTMLElement&&"VERTEX-TEXTFIELD"===e.tagName,a=e instanceof HTMLElement&&"true"===e.contentEditable,i=e instanceof HTMLElement&&"VERTEX-SCENE-TREE-SEARCH"===e.tagName,o=e instanceof HTMLInputElement||e instanceof HTMLTextAreaElement,r=e instanceof HTMLElement&&"VERTEX-VIEWER-PIN-TOOL"===e.tagName,s=e instanceof HTMLElement&&"VERTEX-VIEWER-TRANSFORM-WIDGET"===e.tagName;return t||n||a||i||o||r||s},useRecoilReducer=({reducer:e,atom:t})=>{const n=undefined,a=undefined;return[s(t),useRecoilReducerDispatch({reducer:e,atom:t})]},useRecoilReducerDispatch=({reducer:e,atom:t})=>{const n=i((({set:n})=>async a=>{n(t,(t=>e(t,a)))}),[]);return n},si=o({key:"keyBindings",default:{applyBindings:[],bindings:{},pressed:{}}});function reducer(e,t){switch(t.type){case"push-key-binding":const n=e.bindings[t.binding.keyBind]?.find((e=>e.id===t.binding.id));return null!=n?e:{...e,bindings:{...e.bindings,[t.binding.keyBind]:[...e.bindings[t.binding.keyBind]??[],t.binding]}};case"remove-key-binding":const a=e.bindings[t.binding.keyBind]?.find((e=>e.id===t.binding.id));return null==a?e:{...e,bindings:{...e.bindings,[t.binding.keyBind]:(e.bindings[t.binding.keyBind]??[]).filter((e=>e.id!==t.binding.id))}};case"add-apply-key-binding":return{...e,applyBindings:[...e.applyBindings,t.binding]};case"remove-apply-key-binding":return{...e,applyBindings:e.applyBindings.filter((e=>e.id!==t.id))};case"set-key-pressed":return{...e,applyBindings:e.applyBindings.map((t=>({...t,active:null!=t.keyBind&&allPressed(t.keyBind,e.pressed)}))),pressed:{...e.pressed,[t.key]:t.pressed},lastPressed:t.pressed?t.key:void 0}}}const useKeyBindingState=()=>useRecoilReducer({reducer:reducer,atom:si}),useKeyBindingReadonlyState=()=>s(si);function pressedValue(e,t){return e.includes("!")?!t[e.replace("!","")]&&!t[e.replace("!","").toLowerCase()]:t[e]||t[e.toLowerCase()]}function isPressed(e,t){const n=e.split("||");return n.length>1?n.some((e=>pressedValue(e,t))):pressedValue(n[0],t)}function allPressed(e,t){const n=undefined;return e.split("+").every((e=>isPressed(e,t)))}function matchingSingleFnBindings(e,t,n){return e.filter((e=>!e.repeat)).filter((e=>null!=e.keyBind&&null!=n&&e.keyBind?.includes(n)&&allPressed(e.keyBind,t))).map((e=>e.fn))}function matchingOffBindings(e,t,n){return e.filter((e=>e.off&&e.active&&null!=e.keyBind&&null==n&&!allPressed(e.keyBind,t))).map((e=>e.off))}const useApplyKeyBinding=e=>{const[t,n]=useKeyBindingState();A.useEffect((()=>{const a=_e.create();return n({type:"add-apply-key-binding",binding:{...e,id:a,active:null!=e.keyBind&&allPressed(e.keyBind,t.pressed)}}),()=>{n({type:"remove-apply-key-binding",id:a})}}),[e.fn,e.off,e.keyBind,e.repeat])},useStackKeyBinding=(e,t=[])=>{const[,n]=useKeyBindingState();A.useEffect((()=>{const t=null==e.addPredicate||e.addPredicate(),a=null!=e.cancelPredicate&&e.cancelPredicate();t&&n({type:"push-key-binding",binding:e}),a&&n({type:"remove-key-binding",binding:e})}),t)},useKeyBindings=({keydownRepeatInterval:e=25,keydownIgnorePredicate:t=isInputElement}={})=>{const[n,a]=useKeyBindingState(),i=A.useCallback((e=>{Object.keys(n.bindings).filter((t=>t.includes(e)&&allPressed(t,{...n.pressed,[e]:!0}))).forEach((e=>{const t=n.bindings[e],i=t.length>0?t[t.length-1]:void 0;null!=i&&(i.fn(),a({type:"remove-key-binding",binding:i}))}))}),[n]);A.useEffect((()=>{const handleKeyDown=e=>{if(!e.repeat&&!t(e.target)){a({type:"set-key-pressed",key:e.key,pressed:!0}),i(e.key);const t={...n.pressed,[e.key]:!0},o=matchingSingleFnBindings(n.applyBindings,t,e.key),r=matchingOffBindings(n.applyBindings,t,e.key);(o.length>0||r.length>0)&&e.preventDefault()}},handleKeyUp=e=>{a({type:"set-key-pressed",key:e.key,pressed:!1})};return window.addEventListener("keydown",handleKeyDown),window.addEventListener("keyup",handleKeyUp),()=>{window.removeEventListener("keydown",handleKeyDown),window.removeEventListener("keyup",handleKeyUp)}}),[i,n.applyBindings,n.pressed]),A.useEffect((()=>{const e=matchingSingleFnBindings(n.applyBindings,n.pressed,n.lastPressed),t=matchingOffBindings(n.applyBindings,n.pressed,n.lastPressed);e.forEach((e=>e())),t.forEach((e=>e()))}),[n.pressed,n.lastPressed]),A.useEffect((()=>{const t=n.applyBindings.filter((e=>e.repeat&&null!=e.keyBind&&allPressed(e.keyBind,n.pressed))).map((e=>e.fn));if(t.length>0){const n=setInterval((()=>{t.forEach((e=>e()))}),e);return()=>{clearInterval(n)}}return()=>{}}),[n.applyBindings,n.lastPressed])},VertexBoxSelectionButton=()=>{const t=useBoxSelectionActions(),n=s(fn);return useStackKeyBinding({id:"ExitBoxSelection",keyBind:"Escape",fn:t.disable,addPredicate:()=>n,cancelPredicate:()=>!n},[n]),e(F,{content:"Box Selection",children:e(W,{iconName:"box-cursor",iconColor:n?"primary":"secondary","data-testid":"viewer-toolbar-enable-box-selection-button",onClick:n?t.disable:t.enable})})},li=1,VertexResizableContent=({className:n,style:a,displayShadow:i,heading:o,id:r,initialScale:s,placement:l="left",children:c,onResize:d,...u})=>{const m="left"===l||"right"===l,p="top"===l;function getHorizontalResizeDirection(){switch(l){case"left":return"right";case"right":return"left";default:return"none"}}function getVerticalResizeDirection(){return"top"===l?"top":"none"}const h=null!=s?s:1;return e(X,{id:r,"data-testid":`resizable-content-position-${l}`,className:_a(n,"pointer-events-auto z-popover md:z-overlay bg-white bg-opacity-95 flex-grow-0 flex-shrink-0 border-neutral-300",{"border-r min-w-75 max-w-half":"left"===l,"sidebar-shadow-right":"left"===l&&i,"border-l min-w-75 max-w-half":"right"===l,"sidebar-shadow-left":"right"===l&&i,"border-t bottom-0 fixed":"top"===l,"min-h-12 sheet":p}),style:{maxHeight:"top"===l?window.innerHeight:void 0,...a},initialHorizontalScale:m?s:void 0,initialVerticalScale:p?h:void 0,horizontalDirection:getHorizontalResizeDirection(),verticalDirection:getVerticalResizeDirection(),position:"right"===l||"top"===l?"absolute":"relative",onResizeEnd:()=>d?.(),...u,children:t("div",{className:"flex flex-col h-full w-full",children:["top"===l&&e("div",{className:"flex justify-center w-full",children:e("div",{className:"block md:hidden w-20 h-0.5 mt-0.5 bg-neutral-600 rounded"})}),o,e("div",{className:_a("w-full flex flex-col h-0 flex-grow",{"right-0":"right"===l}),children:c})]})})};function useDefaultKeybindings(){useApplyKeyBinding({fn:useActionCallback((({snapshot:e})=>async()=>{const t=await e.getPromise(et),n=await(t?.scene()),a={milliseconds:500};await(n?.camera().viewAll().render({animation:a}))})),keyBind:"f"})}function useLongPress({target:e,callback:t,delay:n=500,onMovement:a}){const[i,o]=k.useState(),[r,s]=k.useState();k.useEffect((()=>{const handleTouchStart=e=>{const a=e;null!=a.touches&&1===a.touches.length&&(null!=i&&clearTimeout(i),s(b.create(a.touches[0].clientX,a.touches[0].clientY)),o(setTimeout((()=>t?.(a)),n)))},handleTouchMove=e=>{const t=e;null!=t.touches&&t.touches.length>0&&null!=i&&null!=r&&b.distance(r,b.create(t.touches[0].clientX,t.touches[0].clientY))>=2&&(clearTimeout(i),a?.())},handleTouchEnd=()=>{null!=i&&clearTimeout(i)};return e?.addEventListener("touchstart",handleTouchStart),e?.addEventListener("touchmove",handleTouchMove),e?.addEventListener("touchend",handleTouchEnd),()=>{e?.removeEventListener("touchstart",handleTouchStart),e?.removeEventListener("touchmove",handleTouchMove),e?.removeEventListener("touchend",handleTouchEnd)}}),[e,i,r])}var ci=Object.freeze({__proto__:null,isInputElement:isInputElement,keyBindings:si,reducer:reducer,useApplyKeyBinding:useApplyKeyBinding,useDefaultKeybindings:useDefaultKeybindings,useKeyBindingReadonlyState:useKeyBindingReadonlyState,useKeyBindings:useKeyBindings,useLongPress:useLongPress,useStackKeyBinding:useStackKeyBinding});function asBooleanAttribute(e){return!!e||void 0}const VertexContextMenu=({targetElement:t,menuType:n,disableBackdrop:a,openPredicate:i,onOpen:o,onClose:r,children:l})=>{const c=useContextMenuActions(),d=s(ln),u=s(pn),m=A.useMemo((()=>["bottom-end","top-start","top-end","right","left"]),[]),p=d===n;useStackKeyBinding({id:"ContextMenu",keyBind:"Escape",fn:c.clearActiveContextMenu,addPredicate:()=>null!=d&&d===n,cancelPredicate:()=>null==d},[d]);const h=A.useMemo((()=>null!=t?t:null!=i?window:void 0),[t,i]);return useLongPress({target:h,callback:e=>c.longPress(e,n,i,o),onMovement:()=>c.clearActiveContextMenu()}),A.useEffect((()=>{const handleWindowPointerDown=e=>{const t=undefined;if(!targetWithinMenu(e)&&2!==e.buttons&&d===n){const t=targetShouldSkipNextHit(e);c.clearActiveContextMenu(t)}};if(a)return window.addEventListener("pointerdown",handleWindowPointerDown),()=>{window.removeEventListener("pointerdown",handleWindowPointerDown)}}),[a,n,d]),A.useEffect((()=>{const handlePointerDown=e=>{c.pointerDown(e)},handlePointerUp=e=>{c.pointerUp(e,n,i,o)},handleContextMenu=e=>c.contextMenu(e,i);return h?.addEventListener("pointerdown",handlePointerDown),h?.addEventListener("pointerup",handlePointerUp),h?.addEventListener("contextmenu",handleContextMenu),()=>{h?.removeEventListener("pointerdown",handlePointerDown),h?.removeEventListener("pointerup",handlePointerUp),h?.removeEventListener("contextmenu",handleContextMenu)}}),[t,n,i]),e("div",{className:_a({hidden:!p}),children:e(Z,{"data-testid":`${n}-context-menu`,open:asBooleanAttribute(p),position:u,fallbackPlacements:m,backdrop:!a,onMenuClosed:()=>{c.clearActiveContextMenu(),r?.()},children:e("div",{className:"pt-1",children:l})})})},VertexFitSelectedMenuItem=()=>{const n=s(Kt),a=s(tn),i=useViewerCameraActions();return e(Y,{"data-testid":"fit-selected-menu-option",onClick:async()=>{null!=a?.boundingBox&&await i.flyToByBoundingBox(a.boundingBox)},disabled:asBooleanAttribute(0===n.length),children:t("div",{className:"flex align-middle gap-2.5",children:[e($,{slot:"icon",name:"fit-selected",size:"sm"}),"Fit Selected"]})})},VertexFlyToMenuItem=()=>{const n=useViewerCameraActions(),a=s(un);return e(Y,{"data-testid":"fly-to-part-menu-option",onClick:async()=>{const e=undefined,t=contextMenuItemIsRow(a)?a?.node.id?.hex:a?.id;null!=t&&await n.flyToById(t)},disabled:asBooleanAttribute(null==a),children:t("div",{className:"flex align-middle gap-2.5",children:[e($,{slot:"icon",name:"paper-airplane",size:"sm"}),"Fly To"]})})};function useSceneItemsOperations(){const e=s(et),t=undefined,n=undefined,a=undefined,i=undefined,o=undefined,r=undefined;return{sceneItemsOperation:A.useCallback((async(t,n)=>{const a=await(e?.scene());null==n?await(a?.items((e=>t(e.where((e=>e.all()))))).execute()):n.length>0&&await(a?.items((e=>t(e.where((e=>e.withItemIds(n)))))).execute())}),[e]),showOnlySelected:A.useCallback((async()=>{const t=await(e?.scene());t?.items((e=>[e.where((e=>e.all())).hide(),e.where((e=>e.withSelected())).show()])).execute()}),[e]),hideSelected:A.useCallback((async()=>{const t=await(e?.scene());t?.items((e=>[e.where((e=>e.withSelected())).hide()])).execute()}),[e]),showOnlyItem:A.useCallback((async t=>{const n=await(e?.scene());n?.items((e=>[e.where((e=>e.all())).hide(),e.where((e=>e.withItemIds([t]))).show()])).execute()}),[e]),ghostSelected:A.useCallback((async()=>{const t=await(e?.scene());t?.items((e=>[e.where((e=>e.withSelected())).setPhantom(!0)])).execute()}),[e]),unGhostSelected:A.useCallback((async()=>{const t=await(e?.scene());t?.items((e=>[e.where((e=>e.withSelected())).setPhantom(!1)])).execute()}),[e])}}const VertexHideAllMenuItem=()=>{const n=useSceneItemsOperations();return e(Y,{"data-testid":"hide-all-menu-option",onClick:async()=>{await n.sceneItemsOperation((e=>e.hide()))},children:t("div",{className:"flex align-middle gap-2.5",children:[e($,{slot:"icon",name:"visibility-hidden",size:"sm"}),"Hide All Parts"]})})},VertexHidePartMenuItem=()=>{const n=s(un),a=useSceneItemsOperations();return e(Y,{"data-testid":"hide-menu-option",onClick:async()=>{const e=undefined,t=contextMenuItemIsRow(n)?n?.node.id?.hex:n.id;null!=t&&await a.sceneItemsOperation((e=>e.hide()),[t])},disabled:asBooleanAttribute(null==n),children:t("div",{className:"flex align-middle gap-2.5",children:[e($,{slot:"icon",name:"visibility-hidden",size:"sm"}),"Hide Part"]})})},VertexHideSelectedMenuItem=()=>{const n=s(Kt),a=useSceneItemsOperations();return e(Y,{"data-testid":"hide-selected-menu-option",onClick:()=>a.hideSelected(),disabled:asBooleanAttribute(0===n.length),children:t("div",{className:"flex align-middle gap-2.5",children:[e($,{slot:"icon",name:"visibility-hidden",size:"sm"}),"Hide Selected"]})})},VertexShowAllMenuItem=()=>{const n=useSceneItemsOperations();return e(Y,{"data-testid":"show-all-menu-option",onClick:async()=>{await n.sceneItemsOperation((e=>e.show()))},children:t("div",{className:"flex align-middle gap-2.5",children:[e($,{slot:"icon",name:"visibility-visible",size:"sm"}),"Show All Parts"]})})},VertexShowOnlyMenuItem=()=>{const n=s(un),a=useSceneItemsOperations();return e(Y,{"data-testid":"show-only-menu-option",onClick:async()=>{const e=undefined,t=contextMenuItemIsRow(n)?n?.node.id?.hex:n?.id;null!=t&&await a.showOnlyItem(t)},disabled:asBooleanAttribute(null==n),children:t("div",{className:"flex align-middle gap-2.5",children:[e($,{slot:"icon",name:"visibility-visible",size:"sm"}),"Show Only Part"]})})},VertexShowOnlySelectedMenuItem=()=>{const n=s(Kt),a=useSceneItemsOperations();return e(Y,{"data-testid":"show-only-selected-menu-option",onClick:()=>a.showOnlySelected(),disabled:asBooleanAttribute(0===n.length),children:t("div",{className:"flex align-middle gap-2.5",children:[e($,{slot:"icon",name:"visibility-visible",size:"sm"}),"Show Only Selected"]})})},di=o({key:"openedPanelActivePrimaryLeft",default:void 0}),ui=o({key:"openedPanelActivePrimaryRight",default:void 0}),mi=o({key:"openedPanelActiveSceneTreeSecondary",default:void 0});function usePanelActions(){return{openPrimary:useActionCallback((({set:e})=>(t,n)=>{e("left"===n?di:ui,t)})),closePrimary:useActionCallback((({set:e})=>t=>{e("left"===t?di:ui,void 0)})),openSecondary:useActionCallback((({set:e})=>t=>e(mi,t))),closeSecondary:useActionCallback((({reset:e})=>()=>e(mi)))}}var pi=Object.freeze({__proto__:null,openedPanelActivePrimaryLeft:di,openedPanelActivePrimaryRight:ui,openedPanelActiveSceneTreeSecondary:mi,usePanelActions:usePanelActions});const VertexShowPropertiesMenuItem=()=>{const n=usePanelActions(),a=useSelectionActions(),i=s(un);return e(Y,{"data-testid":"show-properties-menu-option",disabled:asBooleanAttribute(null==i),onClick:()=>{const e=undefined,t=contextMenuItemIsRow(i)?i?.node.id?.hex:i?.id;null!=t&&(a.clearAndSelect({id:t}),n.openSecondary("Properties"))},children:t("div",{className:"flex align-middle gap-2.5",children:[e($,{slot:"icon",name:"info",size:"sm"}),"Show Properties"]})})};function fromApiProperty(e){return{key:e.key?.name??"",value:apiMetadataPropertyDisplayValue(e.value)}}function apiMetadataPropertyDisplayValue(e){let t="";switch(e?.type){case"string":t=e.value??t;break;case"long":case"double":t=e.value.toString()??t;break;case"timestamp":t=e.value.seconds.toLocaleString()??t}return t}const hi=o({key:"showMetadataSceneItemProperties",default:!0}),fi=d({key:"nextMetadataSceneItemProperties",get:e=>async({get:t})=>{const n=t(et),a=t(yi(e));try{const t=await(n?.sceneItems?.listSceneItemMetadata(e,{cursor:a,size:20})),i=t?.entries?.map((e=>fromApiProperty(e))),o=undefined;return{metadata:null!=i?[...i]?.sort(((e,t)=>e.key>t.key?1:-1)):void 0,cursor:t?.paging.next}}catch(t){return void logger_debug(`Error encountered get metadata for scene item. [itemId={${e}}]`,t)}}}),gi=l({key:"loadedMetadataSceneItemProperties",default:[]}),yi=l({key:"metadataSceneItemPropertiesCursor",default:void 0}),vi=d({key:"hasMoreMetadataSceneItemProperties",get:e=>({get:t})=>{const n=undefined;return null!=t(yi(e))}}),bi=l({key:"isFetchingMetadataSceneItemProperties",default:!1}),wi=r({key:"metadataSceneItemName",get:async({get:e})=>{const t=e($t);if(null!=t){const n=e(pa(t.id));return n?.name??void 0}}});var Ci=Object.freeze({__proto__:null,apiMetadataPropertyDisplayValue:apiMetadataPropertyDisplayValue,fromApiProperty:fromApiProperty,hasMoreMetadataSceneItemProperties:vi,isFetchingMetadataSceneItemProperties:bi,loadedMetadataSceneItemProperties:gi,metadataSceneItemName:wi,metadataSceneItemPropertiesCursor:yi,nextMetadataSceneItemProperties:fi,showMetadataSceneItemProperties:hi});const VertexGhostSelectedMenuItem=()=>{const n=s(Kt),a=useSceneItemsOperations();return e(Y,{"data-testid":"ghost-selected-menu-option",onClick:()=>a.ghostSelected(),disabled:asBooleanAttribute(0===n.length),children:t("div",{className:"flex align-middle gap-2.5",children:[e($,{slot:"icon",name:"visibility-partial",size:"sm"}),"Ghost Selected"]})})};function BetaLabel({children:n,label:a="Beta",placement:i="end",borderColor:o="border-purple-400",textColor:r="text-purple-500"}){return t("div",{className:"flex items-center",children:[n,e("div",{className:_a(`flex border ${o} rounded-md px-1.5 text-xs ${r} uppercase items-center justify-center ml-2 select-none max-h-5`,{"ml-auto":"end"===i}),style:{height:"fit-content"},children:a})]})}const VertexShowModelViewsMenuItem=()=>{const n=usePanelActions(),a=useSelectionActions(),i=s(un);return e(Y,{"data-testid":"viewer-show-model-views",disabled:asBooleanAttribute(null==i),onClick:async()=>{const e=undefined,t=contextMenuItemIsRow(i)?i?.node.id?.hex:i?.id;null!=t&&(n.openPrimary("model-views","right"),a.selectForModelViewsPanel({id:t}))},children:t("div",{className:"flex align-middle gap-2.5",children:[e($,{slot:"icon",name:"views",size:"sm"}),t("div",{className:"flex gap-2",children:["Show Model Views ",e(BetaLabel,{})]})]})})},VertexUnghostSelectedMenuItem=()=>{const n=s(Kt),a=useSceneItemsOperations();return e(Y,{"data-testid":"unghost-selected-menu-option",onClick:()=>a.unGhostSelected(),disabled:asBooleanAttribute(0===n.length),children:t("div",{className:"flex align-middle gap-2.5",children:[e($,{slot:"icon",name:"visibility-visible",size:"sm"}),"Unghost Selected"]})})},DefaultSceneTreeContextMenu=()=>{const n=s(hi);return t("div",{className:"w-56",children:[e(VertexHideSelectedMenuItem,{}),e(VertexHideAllMenuItem,{}),e(VertexShowOnlyMenuItem,{}),e(VertexShowOnlySelectedMenuItem,{}),e(VertexShowAllMenuItem,{}),e(VertexGhostSelectedMenuItem,{}),e(VertexUnghostSelectedMenuItem,{}),e(J,{}),e(VertexFitSelectedMenuItem,{}),e(VertexFlyToMenuItem,{}),e(J,{}),n&&e(VertexShowPropertiesMenuItem,{}),e(VertexShowModelViewsMenuItem,{})]})},VertexSceneTreeContextMenu=({children:t})=>{const n=useSceneTreeActions(),a=s(Dn),i=undefined;return e(VertexContextMenu,{menuType:"scene-tree",targetElement:a,onOpen:async(e,t)=>{const a=e;await n.setContextMenuItem(a.clientY)},disableBackdrop:!0,children:null!=t&&!1!==t?t:e(DefaultSceneTreeContextMenu,{})})},DefaultViewerContextMenu=()=>{const n=s(hi);return t("div",{className:"w-56",children:[e(VertexHidePartMenuItem,{}),e(VertexHideSelectedMenuItem,{}),e(VertexHideAllMenuItem,{}),e(VertexShowOnlyMenuItem,{}),e(VertexShowOnlySelectedMenuItem,{}),e(VertexShowAllMenuItem,{}),e(VertexGhostSelectedMenuItem,{}),e(VertexUnghostSelectedMenuItem,{}),e(J,{}),e(VertexFitSelectedMenuItem,{}),e(VertexFlyToMenuItem,{}),e(J,{}),n&&e(VertexShowPropertiesMenuItem,{}),e(VertexShowModelViewsMenuItem,{})]})},VertexViewerContextMenu=({children:t})=>{const n=null!=t&&!1!==t,a=A.useCallback((e=>e.target instanceof HTMLElement&&"vertex-viewer"===e.target.id),[]);return e(VertexContextMenu,{menuType:"viewer",disableBackdrop:!0,openPredicate:a,children:n?t:e(DefaultViewerContextMenu,{})})},Si=35,xi=o({key:"sceneItemGhostingSelectedOpacity",default:Si}),ki=l({key:"appliedItemPhantomState",default:void 0}),Ai=o({key:"appliedItemPhantomStateIds",default:[]}),Ti=r({key:"sceneItemGhostingLastSelectedPhantom",get:({get:e})=>{const t=e($t);return null!=t&&(e(ki(t.id))??!1)}}),VertexSceneItemGhostingOpacitySlider=({onApply:t})=>{const[n,a]=h(xi);return e(VertexSlider,{id:"phantom-opacity","data-testid":"phantom-opacity-slider",leftLabel:"0%",rightLabel:"100%",min:0,max:100,step:5,value:n,valueLabelDisplay:"auto",onValueInput:e=>{a(e.detail.value)},onValueChange:e=>{t?.(e.detail.value)}})},useSceneItemPhantomActions=()=>{const e=useViewerSceneActions(),t=useActionCallback((({snapshot:e,reset:t})=>async()=>{const n=undefined;(await e.getPromise(Ai)).forEach((e=>t(ki(e)))),t(Ai)}));return{setPhantomState:useActionCallback((({snapshot:t,set:n})=>async a=>{const i=await t.getPromise(Kt);i.forEach((e=>n(ki(e),a))),n(Ai,(e=>[...e,...i])),await e.execute(Wt.SET_PHANTOM_SELECTED_ITEMS,(e=>e.where((e=>e.withSelected())).setPhantom(a)))})),clearPhantomState:useActionCallback((({snapshot:t,set:n,reset:a})=>async()=>{const i=await t.getPromise(Kt);i.forEach((e=>a(ki(e)))),n(Ai,(e=>e.filter((e=>!i.includes(e))))),await e.execute(Wt.CLEAR_PHANTOM_SELECTED_ITEMS,(e=>e.where((e=>e.withSelected())).clearPhantom()),(e=>e.where((e=>e.withSelected())).select()))})),clearAllPhantomState:useActionCallback((()=>async()=>{await t(),await e.execute(Wt.CLEAR_PHANTOM_ALL,(e=>e.where((e=>e.all())).clearPhantom()),(e=>e.where((e=>e.withSelected())).select()))})),resetAllPhantomState:t}};var Pi=Object.freeze({__proto__:null,DEFAULT_GHOSTING_OPACITY:Si,appliedItemPhantomState:ki,appliedItemPhantomStateIds:Ai,sceneItemGhostingLastSelectedPhantom:Ti,sceneItemGhostingSelectedOpacity:xi,useSceneItemPhantomActions:useSceneItemPhantomActions});const VertexSceneItemGhostingToggle=({onApply:t})=>{const n=useSceneItemPhantomActions(),a=s(on),i=m(Ti);return e(F,{content:"Select a part to display as ghost",disabled:a,children:e(j,{className:"flex items-center","data-testid":"phantom-state-toggle",variant:"switch",disabled:!a,checked:"hasValue"===i.state&&i.contents,onValueChanged:async e=>{await n.setPhantomState(e.detail),t?.(e.detail)}})})};function VertexGhostingControls({onApplyGhostingChange:a,onApplyOpacity:i}){return t(n,{children:[t("div",{className:"flex items-center py-3",children:[e(VertexSceneItemGhostingToggle,{onApply:a}),e("span",{className:"pl-4 text-sm text-neutral-700",children:"Display as Ghost"})]}),e("div",{className:"pt-4 pb-2 text-sm text-neutral-700",children:"Global Ghost Opacity"}),e(VertexSceneItemGhostingOpacitySlider,{onApply:i})]})}const VertexSceneItemGhostingClear=({onClear:n,onClearAll:a})=>{const i=useSceneItemPhantomActions(),o=s(Ti);return e("div",{className:"ml-auto",children:t(ResetButton,{id:"phantom",tooltip:"Clear Ghosting",children:[e("div",{className:"pt-1"}),e(Y,{"data-testid":"reset-selected-phantom",onClick:async()=>{await i.clearPhantomState(),n?.()},disabled:!o,children:"Clear ghosting for selected"}),e(Y,{"data-testid":"reset-all-phantom",onClick:async()=>{await i.clearAllPhantomState(),a?.()},children:"Clear ghosting for all"})]})})};function VertexGhostingPanelSection({onClearGhostState:n,onClearAllGhostState:a,onApplyGhostingChange:i,onApplyOpacity:o}){return e(PanelSection,{header:t("div",{className:"flex items-center text-base",children:["Ghosting",e(VertexSceneItemGhostingClear,{onClear:n,onClearAll:a})]}),children:e(VertexGhostingControls,{onApplyGhostingChange:i,onApplyOpacity:o})})}function VertexMeasurementContextMenu({onDelete:n}){const a=s(dn);return e(VertexContextMenu,{menuType:"measurement",openPredicate:e=>e.target instanceof HTMLElement&&"VERTEX-VIEWER-MEASUREMENT-DISTANCE"===e.target.tagName,children:t(Y,{"data-testid":"measurement-delete",onClick:()=>null!=a&&n(a.id),children:[e($,{slot:"icon",name:"delete",size:"sm"}),e("div",{className:"pl-2",children:"Delete"})]})})}function useDockedPlacement(e,t){const[n,a]=k.useState(b.create(0,0));return k.useLayoutEffect((()=>{if(null!=e){const n=e.getBoundingClientRect(),i=b.create(n.left,n.bottom),o=b.create(n.right,n.bottom);a("left"===t?i:o)}}),[e,t]),n}function VertexMeasurementDetails({placement:n,size:a}){const i=useMeasurementActions(),o=s(et),r=s(tt),l=useDockedPlacement(o??null,n),c=s(En),d=s(In),u=s(Nn),m=s(On),p=s(Un),h=s(Gn);return e(Q,{className:"z-popover",boundaryPadding:16,boundarySelector:`#${r}`,position:l,children:t("div",{className:_a("flex flex-col min-w-40",{"text-xs leading-2":"sm"===a,"text-sm leading-4":"md"===a,"text-base leading-5":"lg"===a,"text-lg leading-5":"xl"===a}),children:[t("div",{className:"pb-2 flex justify-between items-center",children:[e("div",{className:_a("w-full",{"text-sm leading-5":"sm"===a,"text-base leading-5":"md"===a,"text-lg leading-6":"lg"===a,"text-xl leading-7 mr-6":"xl"===a}),children:"Measurement"}),e("div",{className:_a("mr-0.5",{hidden:!m}),children:e(F,{content:"Reset",placement:"left-start",children:e(W,{"data-testid":"measurement-details-reset",iconName:"reset",iconSize:"sm",onClick:i.resetMeasurement})})})]}),e(re,{"data-testid":"measurement-details-viewer-measurement-details",className:_a("gap-y-1.5",{hidden:null==c}),measurementOutcome:c,measurementOverlays:d,distanceUnits:toUnitType(p),fractionalDigits:parseInt(h,10)}),e("div",{"data-testid":"measurement-details-message",className:_a({hidden:null==u}),children:u})]})})}function useCallbackRef(e){const[t,n]=A.useState(e?.override??null),a=undefined;return{element:t,callback:A.useCallback((t=>n(e?.override??t)),[])}}function VertexPointToPointMeasurement({detailsPlacement:a,detailsSize:i,onPointToPointMeasurementChange:o}){const r=useMeasurementActions(),l=s(et),c=s(vn),d=s(wn),u=s(Un),m=s(Gn),{callback:p,element:h}=useCallbackRef();usePointToPointMeasurement(h);const f=P((e=>{const t={start:e.detail.start,end:e.detail.end,invalid:!e.detail.valid};r.setEditedPointToPointMeasurement(t),o?.(t)}),[r]);return c?t(n,{children:[e(se,{"data-testid":"point-to-point-measurement",ref:p,viewer:l??void 0,mode:"replace",start:d?.start,end:d?.end,invalid:d?.invalid,units:toUnitType(u),fractionalDigits:parseInt(m,10),showAxisReferenceLines:!0,onEditEnd:f}),e(VertexMeasurementDetails,{placement:a,size:i}),e(VertexMeasurementContextMenu,{onDelete:r.resetMeasurement})]}):e(n,{})}function VertexPointToPointMeasurementTool(){const t=useMeasurementActions(),n=s(vn);return useStackKeyBinding({id:"ExitMeasurement",keyBind:"Escape",fn:t.disableEditMeasurement,addPredicate:()=>n,cancelPredicate:()=>!n},[n,t]),e(F,{content:"Point to Point Measurement",children:e(W,{iconName:"tape-measure","data-testid":"viewer-toolbar-point-to-point-measurement-button",iconColor:n?"primary":"secondary",onClick:t.toggleEditPointToPointMeasurement})})}const Mi=o({key:"viewerToolkitSdkConfig",default:void 0});var Ei=Object.freeze({__proto__:null,sdkConfig:Mi});const VertexPreciseMeasurement=({detailsPlacement:a,detailsSize:i,onEntitiesChanged:o,onOutcomeChanged:r})=>{const l=s(et),c=s(Mi),d=s(Sn),{callback:u,element:m}=useCallbackRef();return usePreciseMeasurementModel(m,o,r),d?t(n,{children:[e(le,{"data-testid":"precise-measurement-viewer-tool",ref:u,viewer:l??void 0,config:JSON.stringify({network:{apiHost:c?.network?.apiHost,renderingHost:c?.network?.renderingHost,sceneTreeHost:c?.network?.sceneTreeHost,sceneViewHost:c?.network?.sceneViewHost}})}),e(VertexMeasurementDetails,{placement:a,size:i})]}):e(n,{})};function VertexPreciseMeasurementTool(){const t=useMeasurementActions(),n=s(Sn);return e(F,{content:"Precise Measurement",children:e(W,{iconName:"ruler","data-testid":"viewer-toolbar-precise-measurement-button",iconColor:n?"primary":"secondary",onClick:t.toggleEditPreciseMeasurement})})}function VertexApplicationMessages(){const a=s(Xe),i=s(Ye);return t(n,{children:[null!=a&&e(ee,{className:"z-[16000]",duration:a.duration,open:!0,content:a.message,type:a.type},a.id),null!=i&&e(te,{placement:"bottom-left",className:"z-[16000]",duration:i.duration,open:!0,content:i.message,type:i.type},i.id)]})}const Ii={binding:"{{row.node.name}}",label:"Name",metadataKeyName:"VERTEX_SCENE_ITEM_NAME"};function mapToColumn(e,t){return{label:"name"===e.toLowerCase()?"Name (Property)":e,binding:`{{row.metadata.${e}}}`,initialWidth:t,minWidth:t/2}}const Ni=o({key:"sceneTreeColumnsRefreshTrigger",default:0}),Oi=o({key:"sceneTreeColumnsWhitelistedColumns",default:[]}),Vi=r({key:"sceneTreeColumnsAvailableColumns",get:async({get:e})=>{const t=e(zn);return e(Ni),null!=t?await t.fetchMetadataKeys():[]}}),Li=r({key:"sceneTreeColumnsAvailableSortedColumns",get:({get:e})=>e(Vi).filter((e=>e!==Ii.metadataKeyName)).sort(((e,t)=>e.localeCompare(t)))}),_i=o({key:"sceneTreeColumnsVisibleMetadataColumnNames",default:[]}),Ri=r({key:"sceneTreeColumnsActiveColumns",get:({get:e})=>{const t=e(_i),n=e(Dn),a=n?.clientWidth;if(null!=a&&a>0){const e=1/(t.length+1)*a,n=(a-e)/t.length;return t.reduce(((e,t)=>{const a=mapToColumn(t,n);return{...e,[a.label]:a}}),{Name:{...Ii,initialWidth:e,minWidth:n}})}return{Name:Ii}}}),Di=r({key:"sceneTreeColumnsActiveColumnNames",get:({get:e})=>Object.keys(e(Ri))});function useSceneTreeColumnActions(){return{setActive:useActionCallback((({set:e})=>async t=>{e(_i,t)})),refreshKeyList:useActionCallback((({set:e})=>()=>{e(Ni,(e=>e+1))}))}}const zi=16,Bi=-8;var Hi;function useOpenPositionedPopover({open:e,buttonElement:t,horizontalOffset:n,verticalOffset:a}){const[i,o]=k.useState(),[r,s]=k.useState(),l=undefined;return{position:i,direction:r,handleOpen:k.useCallback((()=>{if(!e){const e=t?.getBoundingClientRect();if(null!=e){const t=n??zi,i=a??Bi,r=e.x>window.innerWidth/2?Hi.LEFT:Hi.RIGHT;o({x:r===Hi.LEFT?e.left-t:e.right+t,y:e.top+i}),s(r)}}}),[e,t])}}!function(e){e.LEFT="left",e.RIGHT="right"}(Hi||(Hi={}));var ji=Object.freeze({__proto__:null,DEFAULT_HORIZONTAL_POSITION_OFFSET:zi,DEFAULT_NAME_COLUMN:Ii,DEFAULT_VERTICAL_POSITION_OFFSET:Bi,get PlacementDirection(){return Hi},mapToColumn:mapToColumn,sceneTreeColumnsActiveColumnNames:Di,sceneTreeColumnsActiveColumns:Ri,sceneTreeColumnsAvailableColumns:Vi,sceneTreeColumnsAvailableSortedColumns:Li,sceneTreeColumnsRefreshTrigger:Ni,sceneTreeColumnsVisibleMetadataColumnNames:_i,sceneTreeColumnsWhitelistedColumns:Oi,useOpenPositionedPopover:useOpenPositionedPopover,useSceneTreeColumnActions:useSceneTreeColumnActions});const Fi=o({key:"sceneTreeSearchActive",default:!1}),Wi=o({key:"sceneTreeColumnsPartial",default:!1}),Ui=o({key:"sceneTreeSearchValue",default:void 0}),Gi=o({key:"sceneTreeSearchExactMatch",default:!1}),Ki=o({key:"sceneTreeSearchRemoveHiddenItems",default:!1}),$i=o({key:"sceneTreeSearchResultCount",default:0}),qi=o({key:"sceneTreeSearchActiveColumns",default:[]}),Yi=r({key:"sceneTreeSearchNameColumnActive",get:({get:e})=>{const t=e(qi);return 0===t.length||t.includes(Ii.metadataKeyName)}});function useSceneTreeSearch({sceneTreeElement:e}){const t=useSceneTreeActions(),n=s(Fi),a=c($i),i=c(Jt);A.useEffect((()=>{let t;return whenComponentReady(e,(()=>{t=e?.controller?.stateChanged((e=>{void 0!==e?.totalFilteredRows&&a(e?.totalFilteredRows)}))})),()=>{t?.dispose()}}),[e]),A.useEffect((()=>{if(null!=e){let a;return whenComponentReady(e,(()=>{a=e?.controller?.stateChanged((e=>{if(null!=e?.filterTerm){const t=e?.rows.find((e=>e?.node?.selected));i(t?.node.id?.hex)}else n&&t.flyToFirstSelectedItem()}))})),()=>{a?.dispose()}}}),[e,e?.controller,open])}function useSceneTreePartialResults({sceneTreeElement:e}){const t=c(Wi);A.useEffect((()=>{let n;return whenComponentReady(e,(()=>{n=e?.controller?.stateChanged((e=>{t(!!e?.isPartialKeysResponse)}))})),()=>{n?.dispose()}}),[e])}const useSceneTreeSearchActions=()=>{const e=useActionCallback((({set:e})=>t=>{e(qi,t)})),t=useActionCallback((({snapshot:t})=>async(n,a,i,o)=>{const r=await t.getPromise(Dn),s=await t.getPromise(Gi),l=await t.getPromise(Ki),c=await t.getPromise(qi),d=c.length>0?a?[...c,n]:c.filter((e=>e!==n)):[...i,Ii.metadataKeyName].filter((e=>e!==n));e(d),o&&r?.filterItems(o,{columns:d,exactMatch:s,removeHiddenItems:l})})),n=useActionCallback((({snapshot:e,set:t})=>async(n,a,i)=>{const o=await e.getPromise(Dn),r=await e.getPromise(Gi),s=await e.getPromise(Ki),l=await e.getPromise(qi),c=n.filter((e=>!a.includes(e))),d=a.filter((e=>!n.includes(e))),u=l.length>0?[...l.filter((e=>!c.includes(e))),...d]:[...a,Ii.metadataKeyName],m=u.length>0?u:[...a,Ii.metadataKeyName];t(qi,m),i&&o?.filterItems(i,{columns:m,exactMatch:r,removeHiddenItems:s})})),a=useActionCallback((({set:e})=>t=>{e(Gi,t)})),i=useActionCallback((({set:e})=>t=>{e(Ki,t)}));return{setMetadataSearchKeys:e,updateMetadataSearchAfterSearchKeysChange:t,updateMetadataSearchAfterColumnVisibilityChange:n,setMetadataSearchExactMatch:a,setMetadataSearchRemoveHiddenItems:i}};var Xi=Object.freeze({__proto__:null,sceneTreeColumnsPartial:Wi,sceneTreeSearchActive:Fi,sceneTreeSearchActiveColumns:qi,sceneTreeSearchExactMatch:Gi,sceneTreeSearchNameColumnActive:Yi,sceneTreeSearchRemoveHiddenItems:Ki,sceneTreeSearchResultCount:$i,sceneTreeSearchValue:Ui,useSceneTreePartialResults:useSceneTreePartialResults,useSceneTreeSearch:useSceneTreeSearch,useSceneTreeSearchActions:useSceneTreeSearchActions});const targetIsElement=(e,t)=>e instanceof Element&&e.tagName===t;function useRecoilRef({state:e}){const t=i((({set:t})=>n=>{t(e,n)}),[]);return t}var Zi;function styleFromOptionalFont(e){return null!=e?{"--scene-tree-default-font-family":styleFromFontFace(e.fontFace),"--scene-tree-default-font-color":e.color}:{}}function styleFromOptionalBackgroundColors(e){const t=e?.depthColors,n=null!=t?Object.keys(t).reduce(((e,n)=>({...e,[`--scene-tree-row-background-color-depth-${n}`]:t[parseInt(n)]})),{}):{};return null!=e?{...n,"--scene-tree-hovered-row-background-color":e.hovered,"--scene-tree-selected-row-background-color":e.selected,"--scene-tree-row-background-color":e.defaultColor}:{}}function styleFromFontFace(e){return e===Zi.ROBOTO_MONO?"var(--vertex-ui-font-family-monospace)":"var(--vertex-ui-font-family)"}!function(e){e.ROBOTO="ROBOTO",e.ROBOTO_MONO="ROBOTO_MONO"}(Zi||(Zi={}));const Ji=o({key:"sceneTreeAdditionalMetadataKeys",default:[]}),Qi=r({key:"sceneTreeActiveMetadataKeys",get:({get:e})=>{const t=e(Ji),n=e(_i),a=e(Oi),i=new Set([...t,...n]),o=new Set(a);return 0===a.length?Array.from(i):Array.from(i.intersection(o))}});var eo=Object.freeze({__proto__:null,sceneTreeActiveMetadataKeys:Qi,sceneTreeAdditionalMetadataKeys:Ji});function childrenAsArray(e){return Array.isArray(e)?e:[e]}function filterChildElements(e,t){return childrenAsArray(e).filter((e=>A.isValidElement(e)&&e.type===t))}function findChildElement(e,t){return filterChildElements(e,t)[0]}function cloneChildNodeOrFunction(e,t){return"object"==typeof e?A.cloneElement(e,t):e(t)}function useStateSyncedValue(e,t,{transform:n}={}){const[a,i]=h(e);return A.useEffect((()=>{null!=t&&i(null!=n?n(t):t)}),[t]),a}const VertexEnterSceneTreeSearchModeButton=({onEnterSearchMode:t})=>{const n=c(Fi);return e(F,{className:"flex ml-auto",content:"Scene Tree Search",children:e(W,{"data-testid":"enter-scene-tree-search-mode-button",iconName:"search",iconSize:"sm",onPointerDown:e=>{e.preventDefault()},onClick:()=>{n(!0),t?.()}})})},VertexSceneTreeMetadataCheck=({checked:n,disabled:a,onChange:i,children:o})=>{const r="string"==typeof o?o.replace(" ","-"):"";return t("div",{className:"flex items-center",children:[e(j,{"data-testid":`scene-tree-metadata-check-${r}`,variant:"check",checked:n,disabled:a,onValueChanged:e=>i?.(e.detail)}),e("div",{className:"pl-2 py-1 text-[0.875rem] w-full","data-testid":`scene-tree-metadata-name-${r}`,onClick:()=>{a||i?.(!n)},children:o})]})},VertexSceneTreeSearchOptionsPopover=({onSearchedSceneTreeColumnsChange:a,onSearchForExactMatchChange:i})=>{const o=useSceneTreeActions(),r=useSceneTreeSearchActions(),l=s(Dn),c=s(Yi),d=s(qi),u=s(Ui),m=s(Gi),p=s(Ki),h=s(_i),{element:f,callback:g}=useCallbackRef(),v="scene-tree-search",b=s(Hn(v)),{position:w,direction:C,handleOpen:S}=useOpenPositionedPopover({open:b,buttonElement:f,horizontalOffset:20}),A=k.useCallback((()=>{o.closeSceneTreePopover()}),[]),T=C===Hi.LEFT?"left-end":"right-start",updateSearch=async(e,t)=>{if(u){const n=d.length>0?d:[...h,Ii.metadataKeyName];await(l?.filterItems(u,{columns:n,exactMatch:e,removeHiddenItems:t}))}};return t(n,{children:[e(F,{content:"Search Options",placement:"top",children:e(W,{"data-testid":"scene-tree-search-options-popover-button",className:"text-neutral-700",ref:g,iconName:"gear",iconSize:"sm",onClick:()=>{b?A():(S(),o.openSceneTreePopover(v))}})}),b&&e(ne,{"data-testid":"scene-tree-search-options-popover",open:b,backdrop:!1,position:w,resizeBehavior:"fixed",placement:T,className:"z-popover",children:t("div",{className:_a("flex flex-col bg-white border border-neutral-300 rounded",{hidden:!b}),children:[t("div",{className:"flex items-center text-[0.875rem] p-3 border-b border-neutral-300 pb-2",children:[e("div",{className:"pr-2 text-[0.875rem] whitespace-nowrap",children:"Column Properties Search"}),e(W,{className:"ml-auto",iconName:"close",iconSize:"sm",onClick:()=>{A()}})]}),t("div",{className:"max-h-64 p-3 overflow-y-auto",children:[e("div",{className:"text-[0.875rem] pb-2 pr-2",children:"Select properties to perform the search on:"}),e(VertexSceneTreeMetadataCheck,{checked:c,disabled:0===d.length||d.every((e=>e===Ii.metadataKeyName)),onChange:async e=>{await r.updateMetadataSearchAfterSearchKeysChange(Ii.metadataKeyName,e,h,u),a?.()},children:Ii.label},Ii.metadataKeyName),h.map((t=>e(VertexSceneTreeMetadataCheck,{checked:d.includes(t),disabled:d.length>0&&d.every((e=>e===t)),onChange:async e=>{await r.updateMetadataSearchAfterSearchKeysChange(t,e,h,u),a?.()},children:t},t)))]}),t("div",{className:"flex p-3 border-t border-neutral-300",children:[e(j,{className:"flex items-center","data-testid":"filter-exact-match-toggle",variant:"switch",checked:m,onValueChanged:async e=>{r.setMetadataSearchExactMatch(e.detail),i?.(),await updateSearch(e.detail,p)}}),e("span",{className:"pl-4 text-[0.875rem] text-neutral-800",children:"Return only exact matches"})]}),t("div",{className:"flex px-3 pb-3",children:[e(j,{className:"flex items-center","data-testid":"filter-remove-hidden-items-toggle",variant:"switch",checked:p,onValueChanged:async e=>{r.setMetadataSearchRemoveHiddenItems(e.detail),await updateSearch(m,e.detail)}}),e("span",{className:"pl-4 text-[0.875rem] text-neutral-800",children:"Search only visible items"})]})]})})]})},VertexSceneTreeSearchBar=({onSearch:n,onClearSearch:a,onExitSearchMode:i,onSearchedSceneTreeColumnsChange:o,onSearchForExactMatchChange:r,sceneTreeSearchElement:l,children:c})=>{const d=useSceneTreeActions(),u=s(Dn),[m,p]=h(Fi),[f,g]=h(Ui),v=s(Hn("scene-tree-search"));useSceneTreeSearch({sceneTreeElement:u??null});const{element:b,callback:w}=useCallbackRef({override:l}),C=null==f||""===f;return k.useEffect((()=>{m&&b?.setFocus()}),[b,m]),t("div",{className:"flex w-full py-3 px-2",children:[e(F,{className:"self-center mr-1",content:"Exit Search",children:e(W,{"data-testid":"scene-tree-search-close-button",iconName:"caret-left",iconSize:"sm",onPointerDown:e=>{e.preventDefault()},onClick:async()=>{p(!1),g(void 0),await(b?.clear()),await(u?.filterItems("")),v&&d.closeSceneTreePopover(),await d.flyToFirstSelectedItem(),i?.()}})}),t(ce,{"data-testid":"scene-tree-search-bar",ref:w,controller:u?.controller,onBlur:()=>{C&&(p(!1),i?.(),v&&d.closeSceneTreePopover())},onSearch:()=>{g(b?.value),n?.(b?.value)},children:[c,e($,{slot:"clear-icon",name:"close-circle-fill",size:"sm",onPointerDown:async()=>{await d.flyToFirstSelectedItem(),a?.()}})]}),e("div",{className:"self-center pl-1",onPointerDown:e=>{e.preventDefault()},children:e(VertexSceneTreeSearchOptionsPopover,{onSearchedSceneTreeColumnsChange:o,onSearchForExactMatchChange:r})})]})},VertexSceneTreeSearch=({onEnterSearchMode:n,onExitSearchMode:a,onSearch:i,onClearSearch:o,onSearchedSceneTreeColumnsChange:r,onSearchForExactMatchChange:l,children:c})=>{const d=s(Fi);return t(de,{className:"h-11 p-0 border-b border-neutral-300 box-content",slot:"header",children:[d&&e(VertexSceneTreeSearchBar,{onSearch:i,onClearSearch:o,onExitSearchMode:a,onSearchedSceneTreeColumnsChange:r,onSearchForExactMatchChange:l,children:c}),!d&&e("div",{className:"ml-auto mr-2",children:e(VertexEnterSceneTreeSearchModeButton,{onEnterSearchMode:n})})]})};function useCacheableLoadable(e,t){const n=M(),[a,i]=E(0),o=m(e);T((()=>{"hasValue"===o.state&&(n.current=o.contents)}),[t,o]);const[r,s]=I((()=>"hasValue"!==o.state&&null!=n.current?[n.current,!0]:"hasValue"===o.state?[o.contents,!1]:[void 0,!1]),[o.state,o.contents,a]),l=P((()=>{n.current=void 0,i(a+1)}),[a]),c=undefined;return I((()=>({data:r,state:o.state,cached:s,invalidate:l})),[l,r,s,o.state])}const VertexSceneTreeColumnPopover=({onVisibleSceneTreeColumnsChange:a})=>{const i=useSceneTreeActions(),o=useSceneTreeColumnActions(),r=useSceneTreeSearchActions(),l=undefined;useSceneTreePartialResults({sceneTreeElement:s(Dn)??null});const c=s(Ui),d=s(Oi),u=useCacheableLoadable(Li),m=d.length>0?d:u.data,p=s(_i),h=s(Wi),[f,g]=k.useState(p),[v,b]=k.useState(""),{element:w,callback:C}=useCallbackRef(),S="scene-tree-columns",A=s(Hn(S)),{position:T,direction:P,handleOpen:M}=useOpenPositionedPopover({open:A,buttonElement:w}),E=k.useCallback((()=>{i.closeSceneTreePopover()}),[]),I=P===Hi.LEFT?"left-end":"right-start",N=k.useMemo((()=>{if(null!=m){const e=m.filter((e=>f.indexOf(e)<0)),t=undefined;return[...[...f].sort(((e,t)=>e.localeCompare(t))),...e]}return[]}),[f,m]),O=k.useMemo((()=>N),[A,m]);return t(n,{children:[e(F,{content:"Configure Columns",placement:"top",children:e(W,{"data-testid":"scene-tree-column-popover-button",ref:C,iconName:"columns-add",iconSize:"sm",onClick:()=>{A?E():(M(),i.openSceneTreePopover(S))}})}),A&&e(ne,{"data-testid":"scene-tree-column-popover",open:A,backdrop:!1,position:T,resizeBehavior:"fixed",placement:I,className:"z-popover",children:t("div",{className:_a("flex flex-col bg-white border border-neutral-300 rounded",{hidden:!A}),children:[t("div",{className:"flex items-center text-[0.875rem] p-3",children:[t("div",{className:"pr-2",children:[e("div",{className:"text-[0.875rem]",children:"Assembly Properties"}),e("div",{className:"text-[0.75rem] text-neutral-700 mt-1.5",children:"Select up to six properties to appear in the Assembly panel."})]}),e(W,{"data-testid":"scene-tree-columns-popover-close-button",className:"ml-auto",iconName:"close",iconSize:"sm",onClick:()=>{b(""),E()}})]}),e(ae,{className:"flex w-full px-2 overflow-hidden border-b border-neutral-300 pb-2",id:"scene-tree-available-columns-search-bar","data-testid":"scene-tree-available-columns-search-bar",multiline:!1,placeholder:"Filter properties",type:"text",onInputInput:e=>{const t=e.detail.value;null!=t&&b(t.toLowerCase())}}),h&&e(ue,{"data-testid":"partial-key-list-notification-banner",message:"loading"===u.state?"Refreshing results...":"Data loading, refresh for more.",actionLabel:"Refresh",onAction:()=>o.refreshKeyList()}),t("div",{className:"max-h-64 p-3 overflow-y-auto",children:[e(VertexSceneTreeMetadataCheck,{checked:!0,disabled:!0,children:Ii.label}),O.filter((e=>""===v||e.toLowerCase().includes(v))).map((t=>e(VertexSceneTreeMetadataCheck,{checked:f.includes(t),disabled:f.length>=6&&!f.includes(t),onChange:e=>{g(e?[...f,t]:f.filter((e=>e!==t)))},children:t},t)))]}),t("div",{className:"flex items-center p-3 border-t border-neutral-300 space-x-4",children:[e("div",{className:"text-[0.75rem] text-[var(--vertex-ui-blue-700)] cursor-pointer","data-testid":"scene-tree-column-clear-selection",onClick:()=>g([]),children:"Clear selection"}),e("div",{className:"flex-grow"}),t("div",{className:"flex space-x-2",children:[e(G,{"data-testid":"scene-tree-column-popover-cancel",color:"secondary",onClick:()=>{b(""),E()},children:"Cancel"}),e(G,{"data-testid":"scene-tree-column-popover-apply",color:"primary",onClick:async()=>{await r.updateMetadataSearchAfterColumnVisibilityChange(p,f,c),await o.setActive(f),a?.(f),b(""),E()},children:"Apply"})]})]})]})})]})};function VertexToolbarDivider(){return e("div",{"data-testid":"toolbar-divider",className:"h-6 w-px bg-neutral-300 mx-1"})}const VertexSceneTreeSearchInformationForToolbar=()=>{const a=useSelectionActions(),i=s(Dn),o=s(Ui),r=s($i),l=undefined,c=`${r} ${1===r?"result":"results"}`;return t(n,{children:[e(VertexToolbarDivider,{}),t("div",{className:"flex flex-row items-center overflow-hidden",children:[e("div",{className:"px-2 text-[0.8125rem] leading-4 text-neutral-900 truncate","data-testid":"search-result-info",children:`${c}`}),e(F,{className:"w-auto",content:"Select Results",placement:"top",children:e(G,{className:"h-6 rounded cursor-pointer","data-testid":"select-search-results-button",color:"secondary",variant:"text",size:"sm",onClick:async()=>{null!=i&&null!=o&&(await i.selectFilteredItems(o),a.toggleLastSelectWasMultiSelect(!0))},children:t("div",{className:"flex h-6 items-center gap-1",children:[e($,{size:"sm",name:"check-circle"}),e("span",{className:"whitespace-nowrap",children:"Select Results"})]})})})]})]})},VertexSceneTreeCollapseAll=()=>{const t=s(Dn);return e(F,{className:"w-auto",content:"Collapse All",placement:"top",children:e($,{size:"sm",className:"h-6 w-6 hover:bg-neutral-300 rounded cursor-pointer","data-testid":"collapse-all-icon",name:"collapse-all",onClick:()=>{t?.collapseAll()}})})},VertexSceneTreeExpandAll=()=>{const t=s(Dn);return e(F,{className:"w-auto",content:"Expand All",placement:"top",children:e($,{size:"sm","data-testid":"expand-all-icon",className:"h-6 w-6 hover:bg-neutral-300 rounded cursor-pointer",name:"expand-all",onClick:()=>{t?.expandAll()}})})},VertexSceneTreeToolbar=({onVisibleSceneTreeColumnsChange:n})=>{const a=s(Ui),i=null==a||""===a;return e(de,{className:"h-10 border-b border-neutral-300 box-border",children:t("div",{className:"flex w-full text-neutral-700 items-center gap mx-2",children:[e(VertexSceneTreeExpandAll,{}),e(VertexSceneTreeCollapseAll,{}),!i&&e(VertexSceneTreeSearchInformationForToolbar,{}),e("div",{className:"ml-auto",children:e(VertexSceneTreeColumnPopover,{onVisibleSceneTreeColumnsChange:n})})]})})},VertexSceneTreeHeader=({onEnterSearchMode:a,onExitSearchMode:i,onSearch:o,onClearSearch:r,onVisibleSceneTreeColumnsChange:s,children:l})=>{const c=undefined;return e("div",{slot:"header",className:"flex flex-col",children:null!=l&&!1!==l?l:t(n,{children:[e(VertexSceneTreeSearch,{onEnterSearchMode:a,onExitSearchMode:i,onSearch:o,onClearSearch:r,children:e("div",{slot:"clear-icon"})}),e(VertexSceneTreeToolbar,{onVisibleSceneTreeColumnsChange:s})]})})};function useMetadataActions(){const e=useActionCallback((({snapshot:e,set:t})=>async n=>{const a=undefined;if(await e.getPromise(bi(n)))return;t(bi(n),!0);const i=await e.getPromise(fi(n));if(null!=i?.metadata){const e=[...i.metadata];t(gi(n),(t=>[...t,...e]))}const o=i?.cursor;t(yi(n),o),t(bi(n),!1)}));return{fetchInitialMetadata:useActionCallback((({snapshot:t})=>async n=>{const a=undefined;0===(await t.getPromise(gi(n))).length&&await e(n)})),fetchNextMetadata:useActionCallback((()=>async t=>{await e(t)}))}}var to={exports:{}};!function(e,t){Object.defineProperty(t,"__esModule",{value:!0});var n=function(){function defineProperties(e,t){for(var n=0;n<t.length;n++){var a=t[n];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(e,a.key,a)}}return function(e,t,n){return t&&defineProperties(e.prototype,t),n&&defineProperties(e,n),e}}(),a=A,i=_interopRequireDefault(a),o,r=_interopRequireDefault(Ce);function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function _objectWithoutProperties(e,t){var n={};for(var a in e)t.indexOf(a)>=0||Object.prototype.hasOwnProperty.call(e,a)&&(n[a]=e[a]);return n}function _classCallCheck(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function _possibleConstructorReturn(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function _inherits(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var s=function(e){function InfiniteScroll(e){_classCallCheck(this,InfiniteScroll);var t=_possibleConstructorReturn(this,(InfiniteScroll.__proto__||Object.getPrototypeOf(InfiniteScroll)).call(this,e));return t.scrollListener=t.scrollListener.bind(t),t.eventListenerOptions=t.eventListenerOptions.bind(t),t.mousewheelListener=t.mousewheelListener.bind(t),t}return _inherits(InfiniteScroll,e),n(InfiniteScroll,[{key:"componentDidMount",value:function componentDidMount(){this.pageLoaded=this.props.pageStart,this.options=this.eventListenerOptions(),this.attachScrollListener()}},{key:"componentDidUpdate",value:function componentDidUpdate(){if(this.props.isReverse&&this.loadMore){var e=this.getParentElement(this.scrollComponent);e.scrollTop=e.scrollHeight-this.beforeScrollHeight+this.beforeScrollTop,this.loadMore=!1}this.attachScrollListener()}},{key:"componentWillUnmount",value:function componentWillUnmount(){this.detachScrollListener(),this.detachMousewheelListener()}},{key:"isPassiveSupported",value:function isPassiveSupported(){var e=!1,t={get passive(){e=!0}};try{document.addEventListener("test",null,t),document.removeEventListener("test",null,t)}catch(e){}return e}},{key:"eventListenerOptions",value:function eventListenerOptions(){var e=this.props.useCapture;return e=this.isPassiveSupported()?{useCapture:this.props.useCapture,passive:!0}:{passive:!1}}},{key:"setDefaultLoader",value:function setDefaultLoader(e){this.defaultLoader=e}},{key:"detachMousewheelListener",value:function detachMousewheelListener(){var e=window;!1===this.props.useWindow&&(e=this.scrollComponent.parentNode),e.removeEventListener("mousewheel",this.mousewheelListener,this.options?this.options:this.props.useCapture)}},{key:"detachScrollListener",value:function detachScrollListener(){var e=window;!1===this.props.useWindow&&(e=this.getParentElement(this.scrollComponent)),e.removeEventListener("scroll",this.scrollListener,this.options?this.options:this.props.useCapture),e.removeEventListener("resize",this.scrollListener,this.options?this.options:this.props.useCapture)}},{key:"getParentElement",value:function getParentElement(e){var t=this.props.getScrollParent&&this.props.getScrollParent();return null!=t?t:e&&e.parentNode}},{key:"filterProps",value:function filterProps(e){return e}},{key:"attachScrollListener",value:function attachScrollListener(){var e=this.getParentElement(this.scrollComponent);if(this.props.hasMore&&e){var t=window;!1===this.props.useWindow&&(t=e),t.addEventListener("mousewheel",this.mousewheelListener,this.options?this.options:this.props.useCapture),t.addEventListener("scroll",this.scrollListener,this.options?this.options:this.props.useCapture),t.addEventListener("resize",this.scrollListener,this.options?this.options:this.props.useCapture),this.props.initialLoad&&this.scrollListener()}}},{key:"mousewheelListener",value:function mousewheelListener(e){1!==e.deltaY||this.isPassiveSupported()||e.preventDefault()}},{key:"scrollListener",value:function scrollListener(){var e=this.scrollComponent,t=window,n=this.getParentElement(e),a=void 0;if(this.props.useWindow){var i=document.documentElement||document.body.parentNode||document.body,o=void 0!==t.pageYOffset?t.pageYOffset:i.scrollTop;a=this.props.isReverse?o:this.calculateOffset(e,o)}else a=this.props.isReverse?n.scrollTop:e.scrollHeight-n.scrollTop-n.clientHeight;a<Number(this.props.threshold)&&e&&null!==e.offsetParent&&(this.detachScrollListener(),this.beforeScrollHeight=n.scrollHeight,this.beforeScrollTop=n.scrollTop,"function"==typeof this.props.loadMore&&(this.props.loadMore(this.pageLoaded+=1),this.loadMore=!0))}},{key:"calculateOffset",value:function calculateOffset(e,t){return e?this.calculateTopPosition(e)+(e.offsetHeight-t-window.innerHeight):0}},{key:"calculateTopPosition",value:function calculateTopPosition(e){return e?e.offsetTop+this.calculateTopPosition(e.offsetParent):0}},{key:"render",value:function render(){var e=this,t=this.filterProps(this.props),n=t.children,a=t.element,o=t.hasMore;t.initialLoad;var r=t.isReverse,s=t.loader;t.loadMore,t.pageStart;var l=t.ref;t.threshold,t.useCapture,t.useWindow,t.getScrollParent;var c=_objectWithoutProperties(t,["children","element","hasMore","initialLoad","isReverse","loader","loadMore","pageStart","ref","threshold","useCapture","useWindow","getScrollParent"]);c.ref=function(t){e.scrollComponent=t,l&&l(t)};var d=[n];return o&&(s?r?d.unshift(s):d.push(s):this.defaultLoader&&(r?d.unshift(this.defaultLoader):d.push(this.defaultLoader))),i.default.createElement(a,c,d)}}]),InfiniteScroll}(a.Component);s.propTypes={children:r.default.node.isRequired,element:r.default.node,hasMore:r.default.bool,initialLoad:r.default.bool,isReverse:r.default.bool,loader:r.default.node,loadMore:r.default.func.isRequired,pageStart:r.default.number,ref:r.default.func,getScrollParent:r.default.func,threshold:r.default.number,useCapture:r.default.bool,useWindow:r.default.bool},s.defaultProps={element:"div",hasMore:!1,initialLoad:!0,pageStart:0,ref:null,threshold:250,useWindow:!0,isReverse:!1,useCapture:!1,loader:null,getScrollParent:null},t.default=s,e.exports=t.default}(to,to.exports);var no=to.exports;const CopyButton=({id:t,textToCopy:n,iconSize:a,disableTooltip:i,onCopyValue:o})=>{const[r,s]=A.useState(!1),l=undefined,c=useDebouncedCallback((()=>{s(!1)}),2e3);return e(F,{className:"h-fit self-center z-[16000]",content:r?"Copied to Clipboard":"Copy",placement:"bottom",disabled:i,children:e("div",{className:_a({"text-green-700":r}),children:e(W,{className:"ml-auto","data-testid":`${t}-copy-button`,iconName:r?"check":"copy",iconSize:a??"xs",onClick:e=>{e.stopPropagation(),e.preventDefault(),null!=n&&(navigator.clipboard.writeText(n),o?.(n)),s(!0),c(!0)},style:{"--hover-box-shadow":"none"}})})})};function MetadataPropertyValue({value:n,onCopyMetadataValue:a}){const[i,o]=A.useState(!1),r=""!==n.replace(/^\s*$/,"").trim();return r?t("div",{className:"flex w-full border-b border-neutral-300 pl-1 pr-3","data-testid":`${n}-metadata-property`,onMouseEnter:()=>{o(!0)},onMouseLeave:()=>o(!1),children:[e(F,{className:"w-full shrink truncate pr-2 py-1.5",content:n,placement:"bottom-start",children:e("div",{className:"truncate",children:n})}),i&&e(CopyButton,{id:n,textToCopy:n,onCopyValue:a})]}):e("div",{className:_a("overflow-visible border-b border-neutral-300 pl-1 pr-4 py-1.5",{"text-neutral-500":!r}),children:"--"})}const MetadataPanelContents=({sceneItemId:a,onCopyMetadataValue:i})=>{const o=useMetadataActions(),r=m(wi),l=s(gi(a)),c=s(vi(a)),d=s(bi(a)),u=l?.length>0;function getMessage(){if(!d&&0===l?.length&&"hasValue"===r.state)return"This part does not contain properties"}return A.useEffect((()=>{null!=a&&o.fetchInitialMetadata(a)}),[a]),t(n,{children:[e(no,{initialLoad:!1,hasMore:c,loadMore:async()=>{c&&await o.fetchNextMetadata(a)},useWindow:!1,children:t("div",{className:"flex w-full text-xs leading-5 grow-0",children:[e(X,{className:"w-1/2 min-w-24 max-w-full shrink-0",horizontalDirection:"right",verticalDirection:"none",initialHorizontalScale:.5,parentSelector:"#metadata-panel-wrapper",horizontalSiblingSelector:"#metadata-value-column",children:e("div",{className:"flex flex-col w-full overflow-hidden whitespace-nowrap",children:l.map(((t,n)=>e(F,{className:"border-b border-neutral-300 pl-4 pr-1 py-1.5",content:t.key,placement:"bottom-start",children:e("div",{className:"truncate",children:t.key})},n)))})}),e("div",{id:"metadata-value-column",className:"flex flex-col w-full min-w-24",children:l.map(((t,n)=>e(MetadataPropertyValue,{value:t.value,onCopyMetadataValue:i},n)))})]})}),!u&&e("div",{className:"w-full h-full flex items-center justify-center px-4 text-center text-sm",children:getMessage()})]})},MetadataPanel=({onCopyMetadataValue:n})=>{const a=usePanelActions(),i=s($t),o=m(wi);return t("div",{id:"metadata-panel-wrapper","data-testid":"metadata-panel-wrapper",className:"w-full h-full flex flex-col mt-auto text-neutral-800",children:[t("div",{className:"flex h-10 border-b border-neutral-300 p-3 pl-4 text-[0.875rem] items-center",children:["hasValue"===o.state&&e("span",{className:"flex flex-col w-full",children:e(F,{content:o.contents,children:e("div",{className:"truncate",children:o.contents||""})})}),"loading"===o.state&&e("div",{className:"flex items-center w-full h-full",children:e("div",{className:"w-1/2 h-1/2 bg-neutral-300 animate-pulse rounded"})}),e($,{className:"ml-auto cursor-pointer",onClick:a.closeSecondary,name:"close",size:"sm"})]}),t("div",{className:"w-full h-full overflow-y-auto overflow-x-hidden",children:[null!=i&&e(MetadataPanelContents,{sceneItemId:i.id,onCopyMetadataValue:n}),null==i&&e("div",{className:"w-full h-full flex items-center justify-center px-4 text-center text-sm",children:"Please select a single part or assembly to view its metadata"})]})]})},SceneTreeSecondaryPanel=({panelId:t,onCopyMetadataValue:n})=>e(X,{"data-testid":"scene-tree-secondary-panel",className:"min-h-20 max-h-full flex-shrink-0 border-t border-neutral-300",horizontalDirection:"none",verticalDirection:"top",initializeWithOffset:!0,initialVerticalScale:.6,parentSelector:`#${t}`,verticalSiblingSelector:"#scene-tree-container",children:e(MetadataPanel,{onCopyMetadataValue:n})}),VertexSceneTreeCustomColumn=({label:n,rowDataBinding:a,expandToggle:i,visibilityToggle:o,isolateButton:r,modelViewsButton:l,initialWidth:c,minWidth:d})=>{const u=s(Dn);return A.useEffect((()=>{u?.invalidateRows()}),[a]),t(me,{"data-testid":`scene-tree-table-column-${n}`,initialWidth:c,minWidth:d,children:[e("template",{slot:"header",dangerouslySetInnerHTML:{__html:`\n <div class="text-sm text-neutral-800 my-2">\n <div class="${_a("truncate",{"pl-2":i,"pr-2":o})}">\n ${n}\n </div>\n </div>\n `}}),e("template",{dangerouslySetInnerHTML:{__html:`\n <vertex-scene-tree-table-cell\n prop:value="${a}"\n prop:selection-handler="{{row.data.handleSelection}}"\n prop:expansion-handler="{{row.data.handleExpansion}}"\n prop:visibility-handler="{{row.data.handleVisibility}}"\n ${i?"expand-toggle":""}\n ${o?"visibility-toggle":""}\n ${r?"isolate-button":""}\n >\n <div class="flex items-center gap-2">\n <vertex-tooltip \n class="truncate" \n prop:content="${null!=a?a:"--"}" \n placement="${o?"right":"top"}">\n <div class="flex items-center w-full">\n <div class="truncate">${a}</div>\n </div>\n </vertex-tooltip>\n\n ${l?'<div attr:style={{row.data.modelViewIndicatorStyle}}> \n <vertex-tooltip class="block w-full truncate" content="Listing Model Views" placement="bottom">\n <vertex-icon-button\n class="ml-auto mr-0.5 text-neutral-800"\n event:pointerup="{{row.data.handleShowModelViews}}"\n icon-name="views"\n icon-size="sm"\n variant="plain"\n >\n </vertex-icon-button>\n </vertex-tooltip>\n </div>':""}\n </div>\n\n <div slot="placeholder" class="flex items-center w-full truncate">\n <div> -- </div>\n </div>\n </vertex-scene-tree-table-cell>\n `}})]},n)},VertexSceneTreeMetadataColumns=({children:t})=>{const a=s(Ri),i=s(Di),o=[],r=i.filter((e=>e!==Ii.label)).map((e=>a[e]));return e(n,null!=t?{children:t({columns:r.map((e=>({key:e.label,initialWidth:e.initialWidth,minWidth:e.minWidth})))})}:{children:r.map(((t,n)=>{const a=o[n]??t.initialWidth;return e(VertexSceneTreeCustomColumn,{label:t.label,visibilityToggle:n===r.length-1,isolateButton:n===r.length-1,rowDataBinding:t.binding,initialWidth:a,minWidth:t.minWidth},t.label)}))})},VertexSceneTreeTableLayout=n=>{const{children:a,...i}=n,o=s(Ri),r=s(Di),l=A.useMemo((()=>findChildElement(a,NameColumn)),[a]),c=A.useMemo((()=>findChildElement(a,MetadataColumns)),[a]),d=o[Ii.label]??Ii,u=r.filter((e=>e!==Ii.label)).map((e=>o[e]));return t(pe,{"data-testid":"scene-tree-table-layout",...i,children:[l?cloneChildNodeOrFunction(l.props.children,{columnCount:r.length,initialWidth:d.initialWidth,minWidth:d.minWidth}):e(VertexSceneTreeCustomColumn,{expandToggle:!0,visibilityToggle:1===r.length,isolateButton:1===r.length,rowDataBinding:d.binding,label:d.label,initialWidth:d.initialWidth,minWidth:d.minWidth}),null!=c?cloneChildNodeOrFunction(c.props.children,{columns:u.map((e=>({key:e.label,initialWidth:e.initialWidth,minWidth:e.minWidth})))}):e(VertexSceneTreeMetadataColumns,{})]})},NameColumn=({children:t})=>e(n,{children:t}),MetadataColumns=({children:t})=>e(n,{children:t});VertexSceneTreeTableLayout.NameColumn=NameColumn,VertexSceneTreeTableLayout.MetadataColumns=MetadataColumns;const VertexSceneTree=({id:n,font:a,backgroundColors:i,additionalLoadedMetadataProperties:o,whitelistedMetadataProperties:r,allowViewingMetadataPropertiesPanel:l,children:d,style:u,onPointerDown:m,onClick:p,onToggleSelection:h,onToggleExpansion:f,onToggleVisibility:g,onCopyMetadataValue:v,className:b,rowData:w,...C})=>{const S=usePanelActions(),k=useSceneTreeActions(),T=useSelectionActions(),P=s(Mi),M=s(et),E=s(mi),I=s(Qi),N=s(qi),O=s(Gi),V=s(Ki),L=s(Ui),_=null==L||""===L,R=useRecoilRef({state:Dn}),D=A.useMemo((()=>findChildElement(d,Header)),[d]),B=A.useMemo((()=>findChildElement(d,TableLayout)),[d]),H=A.useMemo((()=>findChildElement(d,ContextMenu)),[d]),wrappedExpansionHandler=(e,t,n)=>{k.toggleExpansion(e,t,n),f?.(e,t,n)},wrappedSelectionHandler=(e,t,n)=>{k.toggleSelection(e,t,n),h?.(e,t,n)},wrappedVisibilityHandler=(e,t,n)=>{k.toggleVisibility(e,t,n),g?.(e,t,n)},handleClick=async e=>{e.altKey&&await k.flyToRow(e.clientY),p?.(e)},handlePointerDown=async e=>{targetIsElement(e.target,"VERTEX-SCENE-TREE-TABLE-COLUMN")&&await T.clearSelection(),m?.(e)},j=c(zn),handleFirstRowRendered=e=>{j(e.target.controller),C?.onFirstRowRendered?.(e)},F=A.useMemo((()=>({metadataSearchKeys:N,exactMatch:O,removeHiddenItems:V})),[N,O,V]);useStateSyncedValue(Oi,r,{transform:e=>e.sort(((e,t)=>e.localeCompare(t)))}),useStateSyncedValue(hi,l),useStateSyncedValue(Ji,o);const W=s(sn),U=A.useCallback((e=>{e.preventDefault(),e.stopPropagation(),S.openPrimary("model-views","right")}),[S]);return t("div",{id:"scene-tree-panel",className:"flex flex-col w-full h-full grow-0",children:[e("div",{id:"scene-tree-container",className:"flex group h-full min-h-32 overflow-auto",children:t(he,{id:n??"vertex-scene-tree","data-testid":"vertex-scene-tree",config:P,ref:R,className:_a("flex-1",{filtered:!_}),style:{...styleFromOptionalFont(a),...styleFromOptionalBackgroundColors(i),...u},onConnectionError:e=>{logger_error("Scene Tree Connection Error: ",e.detail)},viewer:M,onPointerDown:handlePointerDown,onClick:handleClick,rowData:e=>{const t=w?.(e)??{};return{handleExpansion:wrappedExpansionHandler,handleSelection:wrappedSelectionHandler,handleVisibility:wrappedVisibilityHandler,handleShowModelViews:U,modelViewIndicatorStyle:e?.node.id?.hex===W?.id?"display: flex;":"display: none;",...t}},searchOptions:F,metadataKeys:I,...C,onFirstRowRendered:handleFirstRowRendered,children:[D??e(VertexSceneTreeHeader,{}),B??e(VertexSceneTreeTableLayout,{}),H??e(VertexSceneTreeContextMenu,{})]})}),void 0!==E&&e(SceneTreeSecondaryPanel,{panelId:"scene-tree-panel",onCopyMetadataValue:v})]})},Header=({children:t})=>e(n,{children:t}),TableLayout=({children:t})=>e(n,{children:t}),ContextMenu=({children:t})=>e(n,{children:t});VertexSceneTree.Header=Header,VertexSceneTree.TableLayout=TableLayout,VertexSceneTree.ContextMenu=ContextMenu;const VertexDecimalPlaceSelector=({onApply:n})=>{const[a,i]=h(Gn);return t(ie,{"data-testid":"decimal-place-select",className:"w-24",value:a,onOptionChanged:e=>{i(e.detail),n?.(e.detail)},children:[e("div",{className:"py-1.5 px-3",children:"0"}),e("div",{className:"py-1.5 px-3",children:"1"}),e("div",{className:"py-1.5 px-3",children:"2"}),e("div",{className:"py-1.5 px-3",children:"3"})]})},VertexLengthUnitSelector=({onApply:n})=>{const[a,i]=h(Un);return t(ie,{"data-testid":"length-unit-select",className:"w-40",value:a,onOptionChanged:e=>{i(e.detail),n?.(e.detail)},children:[e("div",{"data-value":"cm",className:"py-1.5 px-3",children:"centimeters"}),e("div",{"data-value":"mm",className:"py-1.5 px-3",children:"millimeters"}),e("div",{"data-value":"m",className:"py-1.5 px-3",children:"meters"}),e("div",{"data-value":"in",className:"py-1.5 px-3",children:"inches"}),e("div",{"data-value":"ft",className:"py-1.5 px-3",children:"feet"})]})};function VertexUnitsControls({onUnitChange:a,onDecimalPlaceChange:i}){return t(n,{children:[t("div",{children:[e("div",{className:"pt-1 pb-2 text-sm text-neutral-700",children:"Length Unit"}),e(VertexLengthUnitSelector,{onApply:a})]}),t("div",{children:[e("div",{className:"pt-2 pb-2 text-sm text-neutral-700",children:"Decimals"}),e(VertexDecimalPlaceSelector,{onApply:i})]})]})}function VertexUnitsPanelSection({onUnitChange:t,onDecimalPlaceChange:n}){return e(PanelSection,{header:e("div",{className:"flex items-center text-base",children:"Units"}),children:e(VertexUnitsControls,{onUnitChange:t,onDecimalPlaceChange:n})})}function FileWithMagnifyingGlassImage(){return e("div",{children:t("svg",{xmlns:"http://www.w3.org/2000/svg",width:"160",height:"160",viewBox:"0 0 220 220",children:[e("path",{fill:"none",stroke:"#006bad","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":".75",d:"M38.84 186.31h143.29m-155.07 5.14h176.49M1 196.58h218m-205.11 5.14h185.22m-162.74 5.13h141.84"}),e("path",{fill:"#f7fcfd",d:"m150.94 50.25 20.43 19.51a3.42 3.42 0 0 1 1 2.46v121.2a5.23 5.23 0 0 1-5.23 5.23H52.78a5.23 5.23 0 0 1-5.23-5.23V54.56a5.24 5.24 0 0 1 5.23-5.24h95.81a3.44 3.44 0 0 1 2.35.93"}),e("path",{fill:"none",stroke:"#006bad","stroke-dasharray":"3 3","stroke-linecap":"round","stroke-linejoin":"round",d:"m150.94 50.25 20.43 19.51a3.42 3.42 0 0 1 1 2.46v121.2a5.23 5.23 0 0 1-5.23 5.23H52.78a5.23 5.23 0 0 1-5.23-5.23V54.56a5.24 5.24 0 0 1 5.23-5.24h95.81a3.44 3.44 0 0 1 2.35.93"}),e("path",{d:"M79.12 123.99H110v30.88H79.12z",fill:"#e0f3f9"}),e("path",{d:"M110 153.37v1.5h-1.5",fill:"none",stroke:"#006bad","stroke-linecap":"round","stroke-linejoin":"round"}),e("path",{d:"M105.4 154.87H82.17",fill:"none",stroke:"#006bad","stroke-linecap":"round","stroke-linejoin":"round","stroke-dasharray":"3.1 3.1"}),e("path",{d:"M80.62 154.87h-1.5v-1.5",fill:"none",stroke:"#006bad","stroke-linecap":"round","stroke-linejoin":"round"}),e("path",{d:"M79.12 150.27v-23.23",fill:"none",stroke:"#006bad","stroke-linecap":"round","stroke-linejoin":"round","stroke-dasharray":"3.1 3.1"}),e("path",{d:"M79.12 125.49v-1.5h1.5",fill:"none",stroke:"#006bad","stroke-linecap":"round","stroke-linejoin":"round"}),e("path",{d:"M83.72 123.99h23.23",fill:"none",stroke:"#006bad","stroke-linecap":"round","stroke-linejoin":"round","stroke-dasharray":"3.1 3.1"}),e("path",{d:"M108.5 123.99h1.5v1.5",fill:"none",stroke:"#006bad","stroke-linecap":"round","stroke-linejoin":"round"}),e("path",{d:"M110 128.59v23.23",fill:"none",stroke:"#006bad","stroke-linecap":"round","stroke-linejoin":"round","stroke-dasharray":"3.1 3.1"}),e("path",{d:"M110 123.99h30.88v30.88H110z",fill:"#e0f3f9"}),e("path",{d:"M140.88 153.37v1.5h-1.5",fill:"none",stroke:"#006bad","stroke-linecap":"round","stroke-linejoin":"round"}),e("path",{d:"M136.28 154.87h-23.23",fill:"none",stroke:"#006bad","stroke-linecap":"round","stroke-linejoin":"round","stroke-dasharray":"3.1 3.1"}),e("path",{d:"M111.5 154.87H110v-1.5",fill:"none",stroke:"#006bad","stroke-linecap":"round","stroke-linejoin":"round"}),e("path",{d:"M110 150.27v-23.23",fill:"none",stroke:"#006bad","stroke-linecap":"round","stroke-linejoin":"round","stroke-dasharray":"3.1 3.1"}),e("path",{d:"M110 125.49v-1.5h1.5",fill:"none",stroke:"#006bad","stroke-linecap":"round","stroke-linejoin":"round"}),e("path",{d:"M114.6 123.99h23.23",fill:"none",stroke:"#006bad","stroke-linecap":"round","stroke-linejoin":"round","stroke-dasharray":"3.1 3.1"}),e("path",{d:"M139.38 123.99h1.5v1.5",fill:"none",stroke:"#006bad","stroke-linecap":"round","stroke-linejoin":"round"}),e("path",{d:"M140.88 128.59v23.23",fill:"none",stroke:"#006bad","stroke-linecap":"round","stroke-linejoin":"round","stroke-dasharray":"3.1 3.1"}),e("path",{d:"M110 93.11h30.88v30.88H110z",fill:"#e0f3f9"}),e("path",{d:"M140.88 122.49v1.5h-1.5",fill:"none",stroke:"#006bad","stroke-linecap":"round","stroke-linejoin":"round"}),e("path",{d:"M136.28 123.99h-23.23",fill:"none",stroke:"#006bad","stroke-linecap":"round","stroke-linejoin":"round","stroke-dasharray":"3.1 3.1"}),e("path",{d:"M111.5 123.99H110v-1.5",fill:"none",stroke:"#006bad","stroke-linecap":"round","stroke-linejoin":"round"}),e("path",{d:"M110 119.39V96.15",fill:"none",stroke:"#006bad","stroke-linecap":"round","stroke-linejoin":"round","stroke-dasharray":"3.1 3.1"}),e("path",{d:"M110 94.61v-1.5h1.5",fill:"none",stroke:"#006bad","stroke-linecap":"round","stroke-linejoin":"round"}),e("path",{d:"M114.6 93.11h23.23",fill:"none",stroke:"#006bad","stroke-linecap":"round","stroke-linejoin":"round","stroke-dasharray":"3.1 3.1"}),e("path",{d:"M139.38 93.11h1.5v1.5",fill:"none",stroke:"#006bad","stroke-linecap":"round","stroke-linejoin":"round"}),e("path",{d:"M140.88 97.7v23.24",fill:"none",stroke:"#006bad","stroke-linecap":"round","stroke-linejoin":"round","stroke-dasharray":"3.1 3.1"}),e("path",{d:"M150.91 50.28a3.6 3.6 0 0 1 .86 1.22",fill:"none",stroke:"#006bad","stroke-linecap":"round","stroke-linejoin":"round"}),e("path",{fill:"none",stroke:"#006bad","stroke-dasharray":"2.87 2.87","stroke-linecap":"round","stroke-linejoin":"round",d:"M152.05 54.34v9.14a5.24 5.24 0 0 0 5.24 5.23h9.94"}),e("path",{d:"M168.67 68.71h.2a3.5 3.5 0 0 1 1.27.23M19.8 78.25l1.93 14.68-14.67 1.93",fill:"none",stroke:"#006bad","stroke-linecap":"round","stroke-linejoin":"round"}),e("path",{d:"M21.73 92.93S-2.15 82.45 4.05 54.82",fill:"none",stroke:"#006bad","stroke-linecap":"round","stroke-linejoin":"round"}),e("path",{fill:"none",stroke:"#b43296","stroke-linecap":"round","stroke-linejoin":"round",d:"M14.89 132.63h5.88v5.88h-5.88z"}),e("path",{fill:"none",stroke:"#f90","stroke-linecap":"round","stroke-linejoin":"round",d:"M174.49 36v5.88m-2.94-2.94h5.88"}),e("circle",{cx:"199.1",cy:"164.76",r:"2.45",fill:"none",stroke:"#0c0","stroke-linecap":"round","stroke-linejoin":"round"}),e("path",{d:"M109.68 25.74V11.9M87.12 29.74l-6.02-9.4m53.21 9.4 6.01-9.4",fill:"none",stroke:"#006bad","stroke-linecap":"round","stroke-linejoin":"round"}),e("path",{fill:"#eff9fc",stroke:"#006bad","stroke-linejoin":"round",d:"m140.43 139.69 7.22 5.8-8.28 10.31-7.22-5.8"}),e("circle",{cx:"110.2",cy:"124.35",r:"27.74",fill:"#e0f3f9",opacity:".7"}),e("path",{fill:"#fff",stroke:"#006bad","stroke-linejoin":"round",d:"M131.2 98.19a33.55 33.55 0 1 0 5.16 47.16 33.56 33.56 0 0 0-5.16-47.16Zm.63 43.52a27.73 27.73 0 1 1-4.26-39 27.73 27.73 0 0 1 4.26 39ZM187 173.84a29.8 29.8 0 0 1-4.19 7.52 29.3 29.3 0 0 1-7.24 6.71l-37.77-30.31a29.3 29.3 0 0 1 5-8.56 29.6 29.6 0 0 1 6.4-5.67Z"}),e("path",{fill:"none",stroke:"#fff","stroke-linecap":"round","stroke-miterlimit":"10",d:"m118.82 138.09 12.51-15.58m-38.56-3.68 6.94-8.65m-5.32 1.9 6.95-8.66m16.23 42.44 12.5-15.58"}),e("path",{fill:"#fff",stroke:"#006bad","stroke-linecap":"round","stroke-linejoin":"round",d:"M139.92 153.31a28.4 28.4 0 0 0-2.12 4.45m7.07-.49a38 38 0 0 0-2.35 4.28m7.3-.32c-.93 1.34-1.79 2.72-2.58 4.11m7.53-.15q-1.47 2-2.81 3.94m7.75.01-3 3.78m7.95.18c-1.07 1.24-2.16 2.45-3.26 3.61m8.21.35a54 54 0 0 1-3.49 3.44m8.44.5a37 37 0 0 1-3.72 3.26m8.67.74a29 29 0 0 1-3.95 3.09"}),e("path",{d:"m196.69 115.8-2.18 14.64 14.64 2.18",fill:"none",stroke:"#006bad","stroke-linecap":"round","stroke-linejoin":"round"}),e("path",{d:"M194.51 130.44s23.76-12 21.9-35.66",fill:"none",stroke:"#006bad","stroke-linecap":"round","stroke-linejoin":"round"})]})})}function ModelViewsEmptyState({itemSelected:n}){const a=n?"There are no model views associated with this part.":"Select a part to access model views.";return t("div",{"data-testid":"pmi-views-empty-state",className:"h-full w-full px-4 flex flex-col gap-2 justify-center items-center overflow-y-auto",children:[e(FileWithMagnifyingGlassImage,{}),e("div",{className:"text-base text-neutral-700 text-center px-3 pt-2.5 pb-1.5",children:"No Model Views"}),e("div",{className:"text-[0.8125rem] text-neutral-600 text-center px-3 pb-2.5",children:a})]})}const VertexModelViewsViewRow=({view:n,currentlyViewing:a,itemId:i,onLoadModelView:o,onClearModelView:r})=>{const s=useModelViewActions();return e("div",{"data-testid":`model-view-${n.id}`,onClick:async()=>{a?(await s.clearModelView(),r?.()):(await s.loadModelView(i,n),o?.(i,n.id))},className:_a("flex flex-col w-full h-8 p-1 pl-4 cursor-pointer text-neutral-700 text-[0.8125rem] hover:text-[var(--vertex-ui-blue-600)]",{"bg-[var(--vertex-ui-blue-200)]":a,"hover:bg-[var(--vertex-ui-blue-100)]":!a}),children:t("div",{className:_a("flex w-full h-full items-center",{"text-neutral-900 font-extrabold":a}),children:[t(F,{className:"flex w-20 grow","data-testid":`model-view-${n.id}-tooltip`,placement:"bottom-start",content:n.displayName,children:[e($,{name:"views",size:"sm"}),e("div",{className:"truncate mx-2",children:n.displayName}),e("span",{className:"font-normal text-neutral-700 ml-auto pr-1",children:a&&"(Viewing)"})]}),a&&e("div",{className:"ml-auto pr-1",children:e(W,{"data-testid":"model-views-clear-selection",iconSize:"sm",iconName:"close",onClick:async()=>await s.clearModelView()})})]})},n.id)};function VertexModelViewsList({itemId:n,onLoadModelView:a,onClearModelView:i}){const o=useModelViewActions(),r=s(Ca),l=s(xa(n)),c=s(ka(n)),d=m(wa),u=0===l.length;return t("div",{className:"w-full h-full flex flex-col",children:[("hasValue"!==d.state||null!=d.contents)&&t("div",{className:"flex flex-row h-11 w-full border-b border-neutral-300 p-3 pl-4 mr-2 text-sm items-center",children:["hasValue"===d.state&&e("div",{className:"truncate items-center",children:e(F,{content:d.contents,children:e("div",{className:"truncate",children:d.contents||""})})}),"loading"===d.state&&e("div",{className:"flex items-center h-11 w-full",children:e("div",{className:"w-3/4 h-3 bg-neutral-300 animate-pulse rounded"})})]}),u&&e(ModelViewsEmptyState,{itemSelected:!0}),!u&&e("div",{className:"h-full overflow-y-auto",children:e(no,{hasMore:c,loadMore:()=>{o.fetchNextModelViews(n)},useWindow:!1,children:l.map((t=>{const o=r?.modelView?.id.toString(),s=undefined;return e(VertexModelViewsViewRow,{view:t,currentlyViewing:o===t?.id,itemId:n,onLoadModelView:a,onClearModelView:i},t.id)}))})})]})}const VertexPMIAnnotationRow=({annotation:n,checked:a,onCheckedChange:i,selected:o,onSelectedChange:r})=>t("div",{id:`annotation-entry-${n.id}`,"data-testid":`annotation-entry-${n.displayName}`,className:_a("flex items-center w-full h-7 gap-2.5 pl-4 pr-2 cursor-default hover:text-[var(--vertex-ui-blue-600)]",{"bg-[var(--vertex-ui-blue-200)]":o,"hover:bg-[var(--vertex-ui-blue-100)]":!o}),onClick:()=>r(!o),children:[e(j,{"data-testid":`annotation-entry-${n.displayName}-check`,variant:"check",checked:a,onClick:e=>e.stopPropagation(),onValueChanged:e=>{i(e.detail)}}),e("div",{className:"w-1/2 flex-grow",children:e(F,{content:n.displayName,placement:"bottom-start",children:e("div",{className:"truncate",children:n.displayName})})})]}),VertexPMIAnnotationsSecondaryPanel=({modelViewId:n,parentPanelId:a,verticalSiblingId:i,sceneAnnotationOperations:o,onToggleSelectionOfPMIAnnotation:r,onToggleVisibilityOfPMIAnnotation:l})=>{const c=usePmiAnnotationActions(),d=s(et),u=s(Ta(n)),m=s(Pa(n)),p=s(Ma),[f,g]=h(ba(n)),[v,b]=k.useState("");k.useEffect((()=>{n!==v&&(g(u),b(n))}),[u,v,n,g,b]);const toggleVisibilityOfAllAnnotations=e=>{e?(g(u),o?.sceneAnnotationsOperation((e=>e.show()),d)):(g([]),o?.sceneAnnotationsOperation((e=>e.hide()),d))};return e(X,{"data-testid":"pmi-annotation-secondary-panel",className:"min-h-28 max-h-3/4 flex-shrink-0 border-t text-sm text-neutral-700",horizontalDirection:"none",verticalDirection:"top",initializeWithOffset:!0,initialVerticalScale:.6,parentSelector:`#${a}`,verticalSiblingSelector:`#${i}`,children:t("div",{className:"flex flex-col h-full overflow-hidden",children:[e("div",{className:"flex items-center w-full h-9 border-b border-[var(--vertex-ui-neutral-300)] px-4 shrink-0",children:"3D PMI"}),t("div",{"data-testid":"display-all-annotations",className:"flex items-center w-full h-8 gap-2.5 px-4 py-1.5 cursor-default border-b border-[var(--vertex-ui-neutral-300)]",onClick:()=>{const e=u.length!==f.length;toggleVisibilityOfAllAnnotations(e)},children:[e(j,{"data-testid":"display-all-annotations-check",variant:"check",checked:u.length===f.length,onClick:e=>e.stopPropagation(),onValueChanged:e=>{toggleVisibilityOfAllAnnotations(e.detail)}}),"Display All"]}),e("div",{className:"h-full overflow-y-auto text-[0.8125rem] py-1",children:e(no,{hasMore:m,loadMore:async()=>{m&&await c.fetchNextPmiAnnotations(n)},useWindow:!1,children:u.map(((t,a)=>e(VertexPMIAnnotationRow,{annotation:t,checked:f.includes(t),onCheckedChange:e=>{e?(g([...f,t]),o?.sceneAnnotationsOperation((e=>e.show()),d,[t.id])):(g(f.filter((e=>e!==t))),o?.sceneAnnotationsOperation((e=>e.hide()),d,[t.id])),l?.(n,t.id,e)},selected:t.id===p,onSelectedChange:async e=>{e?await c.selectPmiAnnotation(t.id,!1):await c.clearPmiAnnotationSelection(),r?.(n,t.id,e)}},a)))})})]})})},VertexModelViewsPanelSection=({onLoadModelView:n,onClearModelView:a,onToggleSelectionOfPMIAnnotation:i,onToggleVisibilityOfPMIAnnotation:o})=>{const r=useSceneAnnotationsOperations(),l=s(sn),c=null!=l?.id,d=s(Ca),u=d?.itemId===l?.id;return t("div",{id:"model-views-panel-wrapper",className:"w-full h-full flex flex-col text-neutral-800",children:[t("div",{"data-testid":"model-views-container",className:"group h-full flex overflow-auto min-h-29 relative",children:[c&&e(k.Suspense,{fallback:e(ModelViewsItemListLoading,{}),children:e(VertexModelViewsList,{itemId:l.id,onLoadModelView:n,onClearModelView:a})}),!c&&e(ModelViewsEmptyState,{itemSelected:!1})]}),null!=d&&u&&e(k.Suspense,{fallback:e(ModelViewsItemListLoading,{}),children:e(VertexPMIAnnotationsSecondaryPanel,{modelViewId:d.modelView.id,parentPanelId:"model-views-panel-wrapper",verticalSiblingId:"model-views-container",sceneAnnotationOperations:r,onToggleSelectionOfPMIAnnotation:i,onToggleVisibilityOfPMIAnnotation:o})})]})};function ModelViewsItemListLoading(){return t("div",{className:"flex flex-col w-full h-full items-center justify-center text-[0.8125rem] overflow-y-auto",children:[e(oe,{"data-testid":"model-views-panel-spinner",size:"lg",color:"grey"}),e("div",{className:"pt-3 px-10 text-center",children:"Loading model views for the selected part..."})]})}function VertexModelViewsPanel(){return e("div",{className:"flex flex-col text-neutral-700 h-full overflow-y-auto",children:e(VertexModelViewsPanelSection,{})})}function ColorSwatchContextMenu({onRemoveCustomColor:n}){const a=useContextMenuActions(),i=useSceneItemMaterialActions(),o=s(un);return e(VertexContextMenu,{menuType:"color-swatch",onOpen:e=>{elementIsColorSwatch(e.target)&&a.setContextMenuItem(e.target)},openPredicate:e=>elementIsColorSwatch(e.target)&&elementHasColorAttribute(e.target),disableBackdrop:!0,children:e(Y,{"data-testid":"color-swatch-delete",onClick:async()=>{if(contextMenuItemIsElement(o)&&elementIsColorSwatch(o)){const e=o?.getAttribute("data-color-id");null!=e&&"true"===o.getAttribute("data-custom-color")?(await i.removeCustomColor(e),n?.(e)):null!=e&&"true"===o.getAttribute("data-recent-color")&&await i.removeRecentColor(e)}},children:t("div",{className:"flex align-middle gap-2.5",children:[e($,{slot:"icon",name:"delete",size:"sm"}),"Delete"]})})})}function DefaultAppearancePanel(){return t("div",{className:"flex flex-col text-neutral-700 h-full overflow-y-auto",children:[e(VertexMaterialPanelSection,{}),e(VertexGhostingPanelSection,{}),e(VertexFeatureEdgesPanelSection,{}),e(VertexViewerBackgroundPanelSection,{}),e(VertexSelectionHighlightingPanelSection,{}),e(VertexCrossSectionAppearancePanelSection,{}),e(ColorSwatchContextMenu,{})]})}function DefaultSettingsPanel(){return e("div",{className:"flex flex-col text-neutral-700 h-full overflow-y-auto",children:e(VertexUnitsPanelSection,{})})}const VertexTransformClear=({onClear:n,onClearAll:a})=>{const i=useTransformActions(),o=useCacheableLoadable(rn),r=s(Qt),l=useCacheableLoadable(aa(r??"")),c=A.useMemo((()=>{const e=o.data?.some((e=>null!=e?.override?.transform)),t=null!=l.data;return e||t}),[o,l]);return e("div",{className:"ml-auto",children:t(ResetButton,{id:"transforms",tooltip:"Clear Transforms",children:[e("div",{className:"pt-1"}),e(Y,{"data-testid":"clear-selected-transforms",onClick:async()=>{await i.clearSelectedTransforms(),n?.()},disabled:!c,children:"Clear selected transforms"}),e(Y,{"data-testid":"clear-all-transforms",onClick:async()=>{await i.clearAllTransforms(),a?.()},children:"Clear all transforms"})]})})},VertexTransformNumericField=({bottomLabel:n,value:a,step:i,min:o,max:r,disabled:l,testId:c,onBlur:d,onInput:u,onChange:m})=>{const p=A.useRef(null),h=s(Gn),[f,g]=A.useState(!0);A.useEffect((()=>{const e=null!=p.current&&Number.isNaN(p.current.valueAsNumber),t=f||e;null!=p.current&&t?p.current.value=a?.toFixed(Number(h))??"":g(!0)}),[a]);const v=A.useCallback((e=>{g(!1),m?.(e)}),[g,m]),b=A.useCallback((e=>{g(!0),d?.(e),null!=p.current&&null!=a&&(p.current.value=a.toFixed(Number(h)))}),[d,a,g]);return t("div",{children:[e("div",{className:"truncate rounded-md w-full",children:e("input",{ref:p,className:"w-full truncate border border-neutral-400 rounded-md px-2 py-1.5 hover:border-neutral-500 focus:border-neutral-500 focus:outline-none",type:"number",step:i,min:o,max:r,"data-testid":c,disabled:l,defaultValue:Number.isNaN(a)?"":a?.toFixed(Number(h)),onBlur:b,onInput:u,onChange:v})}),null!=n&&e("div",{className:"flex justify-center items-center pointer-events-none text-neutral-500",children:e("span",{children:n})})]})},VertexTransformInputs=({onUpdateTransform:n})=>{const a=s(Un),i=s(Xt),o=s(Yt),r=i||o,l=s(Qt),{transform:c,error:d,update:u}=useEditItemTransform(l),m=r?void 0:c,p=useDebouncedCallback((async e=>{await u(e),n?.(e)}),50);function updateTransform(e){return t=>{if(null!=m){const n=parseFloat(t.currentTarget.value);Number.isNaN(n)||p?.({...m,...e(n,m)})}}}function updatePosition(e){return updateTransform(((t,n)=>({position:{...n.position,...e(t)}})))}function updateRotation(e){return updateTransform(((t,n)=>({rotation:{...n.rotation,...e(t)}})))}function updateScale(){return updateTransform((e=>e>0?{scale:e}:{}))}function updateToDefaultValueIfInvalid(e,t){return n=>{const a=parseFloat(n.currentTarget.value),i=undefined;(isNaN(a)||!!t?.(a))&&null!=m&&p(Ee.defaults(e,m))}}return t("div",{children:[t("div",{className:"mb-2 text-[0.8125rem]",children:[e("span",{className:"flex w-full items-center mt-3 mb-1",children:"Position"}),t("div",{className:"flex flex-wrap w-full gap-2",children:[t("div",{className:"flex gap-2",children:[e("span",{className:"pt-2",children:"X"}),e("div",{className:"w-26",children:e(VertexTransformNumericField,{testId:"position-x",value:null!=m?m.position.x:void 0,bottomLabel:a,disabled:null==m,onChange:updatePosition((e=>({x:e}))),onBlur:updateToDefaultValueIfInvalid({position:{x:0}})})})]}),t("div",{className:"flex gap-2",children:[e("span",{className:"pt-2",children:"Y"}),e("div",{className:"w-26",children:e(VertexTransformNumericField,{testId:"position-y",value:m?.position.y,bottomLabel:a,disabled:null==m,onChange:updatePosition((e=>({y:e}))),onBlur:updateToDefaultValueIfInvalid({position:{y:0}})})})]}),t("div",{className:"flex gap-2",children:[e("span",{className:"pt-2",children:"Z"}),e("div",{className:"w-26",children:e(VertexTransformNumericField,{testId:"position-z",value:m?.position.z,bottomLabel:a,disabled:null==m,onChange:updatePosition((e=>({z:e}))),onBlur:updateToDefaultValueIfInvalid({position:{z:0}})})})]})]})]}),t("div",{className:"mb-2 text-[0.8125rem]",children:[e("span",{className:"flex w-full items-center mt-3 mb-1",children:"Rotation"}),t("div",{className:"flex flex-wrap w-full gap-2",children:[t("div",{className:"flex gap-2",children:[e("span",{className:"pt-2",children:"X"}),e("div",{className:"w-26",children:e(VertexTransformNumericField,{testId:"rotation-x",value:m?.rotation.x,bottomLabel:"deg",disabled:null==m,onChange:updateRotation((e=>({x:e}))),onBlur:updateToDefaultValueIfInvalid({rotation:{x:0}})})})]}),t("div",{className:"flex gap-2",children:[e("span",{className:"pt-2",children:"Y"}),e("div",{className:"w-26",children:e(VertexTransformNumericField,{testId:"rotation-y",value:m?.rotation.y,bottomLabel:"deg",disabled:null==m,onChange:updateRotation((e=>({y:e}))),onBlur:updateToDefaultValueIfInvalid({rotation:{y:0}})})})]}),t("div",{className:"flex gap-2",children:[e("span",{className:"pt-2",children:"Z"}),e("div",{className:"w-26",children:e(VertexTransformNumericField,{testId:"rotation-z",value:m?.rotation.z,bottomLabel:"deg",disabled:null==m,onChange:updateRotation((e=>({z:e}))),onBlur:updateToDefaultValueIfInvalid({rotation:{z:0}})})})]})]})]}),t("div",{className:"mb-2 text-[0.8125rem]",children:[e("span",{className:"flex w-full items-center mt-3 mb-1",children:"Scale"}),e("div",{className:"w-26",children:e(VertexTransformNumericField,{testId:"scale",value:m?.scale,step:.1,min:.1,disabled:null==m,onChange:updateScale(),onBlur:updateToDefaultValueIfInvalid({scale:1},(e=>e<=0))})}),r&&e("div",{className:"bg-orange-100 rounded px-3 py-2 mt-6 mb-2",children:"Input based part transformation is not yet supported for multiple parts."}),null!=d&&e("div",{className:"bg-red-100 rounded px-3 py-2 mt-6 mb-2",children:"There was a problem retrieving data. Try selecting a different part."})]})]})},VertexTransformManipulatorToggle=({onToggleTransformsManipulator:t})=>{const n=useTransformActions(),a=s(Xn),i=c(oa);return e(j,{className:"flex items-center","data-testid":"transform-widget-toggle",variant:"switch",checked:a,onValueChanged:async()=>{a?(n.disableTransformWidget(),t?.(!1)):(i("world"),await n.enableTransformWidget(),t?.(!0))}})};function VertexTransformControls({onToggleTransformsManipulator:a,onUpdateTransform:i}){return t(n,{children:[t("div",{className:"flex items-center py-3",children:[e(VertexTransformManipulatorToggle,{onToggleTransformsManipulator:a}),e("span",{className:"pl-4 text-[0.8125rem] text-neutral-700",children:"Enable manipulator"})]}),e(VertexTransformInputs,{onUpdateTransform:i})]})}function VertexTransformPanelSection({onClearTransforms:n,onClearAllTransforms:a,onToggleTransformsManipulator:i,onUpdateTransform:o}){return e(PanelSection,{header:t("div",{className:"flex items-center text-base",children:["Manual Part Transforms",e(VertexTransformClear,{onClear:n,onClearAll:a})]}),children:e(VertexTransformControls,{onToggleTransformsManipulator:i,onUpdateTransform:o})})}function DefaultTransformsPanel(){return e("div",{className:"flex flex-col text-neutral-700 h-full overflow-y-auto",children:e(VertexTransformPanelSection,{})})}const ao="Appearance",io="Model Views",oo="Settings",ro="Transforms",ViewerRightPanelHeader=({additionalHeaderMap:n})=>{const a=s(ui),i=getHeading(a,n),o=undefined;return e("div",{className:"flex flex-col w-full items-center z-overlay pointer-events-none md:pointer-events-auto py-3 px-4 border-b border-neutral-300",children:t("div",{className:"flex items-center w-full leading-6 text-md align-center font-medium text-neutral-800 gap-2",children:[i,"model-views"===a&&e(BetaLabel,{})]})})};function getHeading(e,t={}){switch(e){case"appearance":return ao;case"model-views":return io;case"settings":return oo;case"transforms":return ro;default:const n=undefined;return(null!=e?t[e]:void 0)??"None"}}function VertexViewerRightOpenedPanel({children:a}){const i=s(ui),o=A.useMemo((()=>filterChildElements(a,CustomPanelContent)),[a]),r=A.useMemo((()=>o.reduce(((e,t)=>({...e,[t.props.panelName]:t.props.panelTitle})),{})),[o]),l=A.useMemo((()=>["appearance","model-views","settings","transforms",...o.map((e=>e.props.panelName))]),[o]);return e(n,{children:null!=i&&l.includes(i)&&t(VertexResizableContent,{displayShadow:!0,heading:e(ViewerRightPanelHeader,{additionalHeaderMap:r}),placement:"right",children:["appearance"===i&&e(DefaultAppearancePanel,{}),"transforms"===i&&e(DefaultTransformsPanel,{}),"settings"===i&&e(DefaultSettingsPanel,{}),"model-views"===i&&e(VertexModelViewsPanel,{}),a]})})}function CustomPanelContent({panelName:t,children:a}){const i=s(ui);return e(n,{children:i===t&&a})}function Sidebar({children:t}){return e("div",{className:"pointer-events-auto flex flex-col items-center w-full border-neutral-300 py-2",children:t})}function SidebarIcon({name:n,iconName:a,active:i,responsive:o,disabled:r,content:s,tooltipPlacement:l,children:c,onSelect:d,onDeselect:u}){return e("div",{className:_a({"text-[var(--vertex-ui-blue-700)]":i===n&&!r,"text-neutral-700 hover:text-neutral-800":i!==n&&!r,"cursor-pointer hover:bg-neutral-200":!r,"text-neutral-400":r,"rounded-full md:p-3":o,"p-3":!o&&null==c,"px-3 py-1":null!=c}),"data-testid":`${n}-sidebar-panel`,onClick:()=>{r||(i===n?u():d())},children:t(F,{placement:l??void 0,content:A.isValidElement(s)?void 0:s,children:[e("div",{slot:"content",children:s}),e("div",{className:"flex flex-col",children:c??e($,{name:a})})]})})}function VertexViewerRightSidebar({children:n}){const a=usePanelActions(),i=useTransformActions(),o=s(ui);return e("div",{className:"flex flex-col flex-shrink-0 items-center relative border-neutral-300 border-l bg-white h-full top-0 min-w-12 w-12",children:t(Sidebar,{children:[n,e(SidebarIcon,{name:"appearance",active:o,iconName:"adjustments",tooltipPlacement:"right",content:"Appearance",onSelect:()=>{a.openPrimary("appearance","right")},onDeselect:()=>a.closePrimary("right")}),e(SidebarIcon,{name:"transforms",active:o,iconName:"show-only-nearby",tooltipPlacement:"right",content:"Transforms",onSelect:async()=>{a.openPrimary("transforms","right"),await i.enableTransformWidget(void 0,!0)},onDeselect:()=>a.closePrimary("right")}),e(SidebarIcon,{name:"model-views",active:o,iconName:"views",tooltipPlacement:"right",content:"Model Views",onSelect:async()=>{a.openPrimary("model-views","right")},onDeselect:()=>a.closePrimary("right")}),e(SidebarIcon,{name:"settings",active:o,iconName:"gear",tooltipPlacement:"right",content:"Settings",onSelect:()=>{a.openPrimary("settings","right")},onDeselect:()=>a.closePrimary("right")})]})})}function CustomPanelIcon(t){const n=usePanelActions(),a=s(ui),{panelName:i,tooltipContent:o,iconName:r,...l}=t;if(null==r&&null==l.children)throw new Error('CustomPanelIcon must contain either a Vertex "iconName" or custom "children"');return e(SidebarIcon,{...l,name:i,iconName:r??"help",active:a,content:o,onSelect:()=>{n.openPrimary(t.panelName,"right")},onDeselect:()=>{n.closePrimary("right")}})}VertexViewerRightOpenedPanel.CustomPanelContent=CustomPanelContent,VertexViewerRightSidebar.CustomPanelIcon=CustomPanelIcon;const VertexPopupButton=({open:a,children:i,...o})=>{const r=i.find((e=>e.type===Anchor)),s=i.filter((e=>e.type!==Anchor));return null==r?e(n,{}):t(ne,{className:"flex",placement:"top",backdrop:!1,open:asBooleanAttribute(a),...o,children:[r,e("div",{className:_a("flex mb-1.5",{hidden:!a}),"data-testid":"align-plane-popover-menu",children:s})]})},Anchor=({tooltipContent:t,children:n})=>e("div",{slot:"anchor",children:e(F,{className:"cursor-pointer",content:t,children:n})});function VertexViewerCrossSectionAlignmentPopoverMenu({disabled:n}){const a=useCrossSectioningActions(),i=s(Vt),o=s(kt),getBaseIcon=()=>`align-to-${o?.mode}`;return useStackKeyBinding({id:"CrossSectionAlignment",keyBind:"Escape",fn:a.cancelCurrentHit,addPredicate:()=>o?.hitPending??!1,cancelPredicate:()=>!o?.hitPending},[o?.hitPending]),t(VertexPopupButton,{"data-testid":"section-alignment-popover",placement:"top",backdrop:!1,open:asBooleanAttribute(i),onDismissed:a.closeAlignmentTools,children:[e(VertexPopupButton.Anchor,{tooltipContent:"Section Alignment",children:e(W,{"data-testid":"section-alignment-icon-button",iconName:getBaseIcon(),iconColor:"secondary",onClick:i?a.closeAlignmentTools:a.openAlignmentTools,disabled:n,children:e($,{"data-testid":"section-alignment-icon-chevron",name:"chevron-up",size:"sm"})})}),t(fe,{direction:"vertical",className:"flex justify-evenly items-center py-1 my-1 ring-1 ring-neutral-200 rounded bg-neutral-100 opacity-95",children:[e(W,{iconColor:"secondary",onClick:()=>a.updateAlignment("global"),className:"w-full text-neutral-800 hover:bg-neutral-300 rounded cursor-pointer mx-0.5 py-1 px-2","data-testid":"section-alignment-align-global",iconName:"align-to-global",variant:"plain",children:e("div",{className:"text-base ml-2",children:"Align to Global"})}),e(W,{iconColor:"secondary",onClick:()=>a.updateAlignment("surface"),className:"w-full text-neutral-800 hover:bg-neutral-300 rounded cursor-pointer mx-0.5 py-1 px-2","data-testid":"section-alignment-align-surface",iconName:"align-to-surface",variant:"plain",children:e("div",{className:"text-base ml-2",children:"Align to Surface"})})]})]})}function VertexViewerCrossSectionAxisPopoverMenu({disabled:n}){const a=useCrossSectioningActions(),i=s(Lt),o=s(xt),r=m(Mt),l=A.useMemo((()=>{const e=o.length>0&&"hasValue"===r.state?axis(o[0],xAxis(r.contents),yAxis(r.contents),zAxis(r.contents)):"x";return null!=e?`axis-${e}`:"axis-x"}),[r.state,r.contents,o]);return t(VertexPopupButton,{"data-testid":"align-plane-popover",placement:"top",backdrop:!1,open:asBooleanAttribute(i),onDismissed:a.closeAxisTools,children:[e(VertexPopupButton.Anchor,{tooltipContent:"Align Plane",children:e(W,{onClick:i?a.closeAxisTools:a.openAxisTools,iconName:l,"data-testid":"align-plane-icon",iconColor:"secondary",disabled:n,children:e($,{"data-testid":"align-plane-icon-chevron",name:"chevron-up",size:"sm"})})}),t(fe,{direction:"vertical",className:"flex justify-evenly items-center py-1 my-1 ring-1 ring-neutral-200 rounded bg-neutral-100 opacity-95",children:[e(W,{"data-testid":"align-plane-x-axis-button",className:"w-full text-neutral-800 hover:bg-neutral-300 rounded cursor-pointer mx-0.5 py-1 px-2",onClick:()=>a.updateAxis("x"),variant:"plain",iconColor:"secondary",iconName:"axis-x",children:e("div",{className:"text-base ml-2",children:"X-axis Plane"})}),e(W,{className:"w-full text-neutral-800 hover:bg-neutral-300 rounded cursor-pointer mx-0.5 py-1 px-2",variant:"plain",iconColor:"secondary",iconName:"axis-y","data-testid":"align-plane-y-axis-button",onClick:()=>a.updateAxis("y"),children:e("div",{className:"text-base ml-2",children:"Y-axis Plane"})}),e(W,{"data-testid":"align-plane-z-axis-button",className:"w-full text-neutral-800 hover:bg-neutral-300 rounded cursor-pointer mx-0.5 py-1 px-2",onClick:()=>a.updateAxis("z"),variant:"plain",iconColor:"secondary",iconName:"axis-z",children:e("div",{className:"text-base ml-2",children:"Z-axis Plane"})})]})]})}function VertexViewerCrossSectionOffsetStepper({offset:n,disabled:a,onOffsetChange:i}){const o=s(Un),r=s(Gn),[l,c]=A.useState(convertTo(n,o));A.useEffect((()=>{c(convertTo(n,o))}),[o,n]);const d=createDistanceFormatter(o,parseInt(r,10)),handleIncrementalUpdate=e=>{const t=convertFrom(l+e,o);i(t)},u=undefined,handleBlur=()=>{i(convertFrom(l,o))};return e(F,{content:"Plane Offset",children:e("form",{"data-testid":"cross-section-stepper-form",onSubmit:e=>{e.preventDefault(),i(convertFrom(l,o))},children:t(ae,{"data-testid":"cross-section-stepper-input",className:"viewer-toolbar-input w-32 border-none ring-0 bg-white",type:"text",value:d(parseFloat(n.toFixed(3))),onInputInput:e=>{c(null!=e.detail.value?parseFloat(e.detail.value):n)},onBlur:handleBlur,disabled:a,children:[e("div",{"data-testid":"cross-section-stepper-decrement",className:"py-1 cursor-pointer",slot:"left",onClick:()=>{a||handleIncrementalUpdate(-1)},children:e($,{name:"chevron-left",size:"sm"})}),e("div",{"data-testid":"cross-section-stepper-increment",className:"py-1 cursor-pointer",slot:"right",onClick:()=>{a||handleIncrementalUpdate(1)},children:e($,{name:"chevron-right",size:"sm"})})]})})})}VertexPopupButton.Anchor=Anchor;const so=400;function VertexViewerCrossSectionPopupMenu(){const n=useCrossSectioningActions(),a=s(Ot),i=m(It),o=m(Nt),r=A.useRef(),l=A.useMemo((()=>"hasValue"===i.state&&Number.isFinite(i.contents.max)&&Number.isFinite(i.contents.min)),[i.state,i.contents]),c=A.useMemo((()=>"hasValue"===i.state?i.contents:ft),[i.state,i.contents]),d=A.useMemo((()=>"hasValue"===o.state&&Number.isFinite(o.contents)?o.contents:0),[o.state,o.contents]),handleCrossSectionValueChange=e=>{clearTimeout(r.current),r.current=window.setTimeout((()=>{n.endInteraction()}),so),n.beginInteraction(),n.updatePlanes(e)};return t(VertexPopupButton,{"data-testid":"cross-section-popover",placement:"top",backdrop:!1,open:asBooleanAttribute(a),onDismissed:n.closeAdditionalTools,children:[e(VertexPopupButton.Anchor,{tooltipContent:"Section Tools",children:e("div",{className:"-ml-px py-1.5",children:e($,{"data-testid":"cross-section-popover-icon",name:"chevron-up",size:"sm",onClick:a?n.closeAdditionalTools:n.openAdditionalTools})})}),t(fe,{className:"relative bottom-3 flex justify-evenly items-center p-1 ring-1 ring-neutral-200 rounded bg-neutral-100 opacity-95",children:[e(VertexViewerCrossSectionAlignmentPopoverMenu,{disabled:!l}),e(F,{className:"w-auto",content:"Reverse",children:e(W,{iconName:"flip","data-testid":"viewer-toolbar-flip-button",onClick:n.flipPlanes,iconColor:"secondary",disabled:!l})}),e(F,{className:"w-auto",content:"Align View to Plane",children:e(W,{"data-testid":"viewer-toolbar-align-view-to-plane-button",iconName:"align-view-to-plane",onClick:n.alignViewToPlane,iconColor:"secondary",disabled:!l})}),e(VertexToolbarDivider,{}),e(VertexViewerCrossSectionAxisPopoverMenu,{disabled:!l}),e("div",{className:"w-52 mx-2",children:e(VertexSlider,{value:d,defaultValue:c.default,disabled:asBooleanAttribute("hasValue"!==i.state)||!l,min:c.min,max:c.max,step:.01,onChange:handleCrossSectionValueChange})}),e("div",{className:"px-4",children:e(VertexViewerCrossSectionOffsetStepper,{offset:"hasValue"===o.state&&l?o.contents:0,disabled:!l,onOffsetChange:handleCrossSectionValueChange})})]})]})}const VertexViewerCrossSectionButton=()=>{const a=useCrossSectioningActions(),i=s(gt);return t(n,{children:[e(F,{content:i?"Hide Section":"Show Section",children:e(W,{"data-testid":"viewer-toolbar-cross-section-button",iconName:"cross-section",iconColor:i?"primary":"secondary",onClick:()=>i?a.disable():a.enable()})}),e(VertexViewerCrossSectionPopupMenu,{})]})},VertexFitAllButton=()=>{const t=s(et);return e(F,{content:"Fit All",children:e(W,{iconName:"fit-all",iconColor:"secondary","data-testid":"viewer-toolbar-fit-all-button",onClick:async()=>{const e=await(t?.scene());await(e?.camera().viewAll().render({animation:{milliseconds:500}}))}})})},VertexPanButton=()=>{const t=s(et),n=s(nt),[a,i]=h(it),[o,r]=h(at);return A.useEffect((()=>{null!=t&&n&&r(t.getBaseInteractionHandler())}),[t,n,r]),e(F,{content:"Pan",children:e(W,{iconName:"pan",iconColor:"pan"===a?"primary":"secondary","data-testid":"viewer-toolbar-pan-button",onClick:async()=>{if(i("pan"),null!=o){const e=await o;e?.setPrimaryInteractionType("pan")}}})})},VertexRotateButton=()=>{const t=s(et),n=s(nt),[a,i]=h(it),[o,r]=h(at);return A.useEffect((()=>{null!=t&&n&&r(t.getBaseInteractionHandler())}),[t,n,r]),e(F,{content:"Rotate",children:e(W,{iconName:"rotate",iconColor:"rotate"===a?"primary":"secondary","data-testid":"viewer-toolbar-rotate-button",onClick:async()=>{if(i("rotate"),null!=o){const e=await o;e?.setPrimaryInteractionType("rotate")}}})})},VertexZoomButton=()=>{const t=s(et),n=s(nt),[a,i]=h(it),[o,r]=h(at);return A.useEffect((()=>{null!=t&&n&&r(t.getBaseInteractionHandler())}),[t,n,r]),e(F,{content:"Zoom",children:e(W,{iconName:"zoom",iconColor:"zoom"===a?"primary":"secondary","data-testid":"viewer-toolbar-zoom-button",onClick:async()=>{if(i("zoom"),null!=o){const e=await o;e?.setPrimaryInteractionType("zoom")}}})})},DefaultToolbar=()=>e(ge,{placement:"bottom-center",children:t(fe,{className:"p-1 border border-neutral-200 rounded bg-neutral-100 opacity-95",children:[e(VertexRotateButton,{}),e(VertexPanButton,{}),e(VertexZoomButton,{}),e(VertexFitAllButton,{}),e(VertexToolbarDivider,{}),e(VertexBoxSelectionButton,{}),e(VertexToolbarDivider,{}),e(VertexViewerCrossSectionButton,{}),e(VertexToolbarDivider,{}),e(VertexPointToPointMeasurementTool,{}),e(VertexPreciseMeasurementTool,{})]})}),VertexToolbar=({endCapEnabledByDefault:t,children:n})=>{const a=c(wt),i=c(bt);A.useEffect((()=>{null!=t&&(a(t),i(t))}),[t]);const o=undefined;return e(ge,{placement:"bottom-center",children:null!=n&&!1!==n?e(fe,{className:"p-1 border border-neutral-200 rounded bg-neutral-100 opacity-95",children:n}):e(DefaultToolbar,{})})};function VertexTransformWidget({transformWidgetElement:t,supportUndo:a,onPositionChange:i,onRotationChange:o}){const r=useTransformActions(),l=s(ta),c=s(Xn),d=s(Zn),u=s(ea),p=m(Qn),h=s(Un),f=s(Gn),g=A.useMemo((()=>"hasValue"===p.state?p.contents:u),[p,u]),v=A.useMemo((()=>{const e=undefined;return c&&(null!=g||l)}),[c,g,l]);return e(n,{children:v&&e(ye,{id:"transform-widget","data-testid":"viewer-transform-widget",ref:t,position:d,rotation:null!=d?g:void 0,decimalPlaces:parseInt(f,10),distanceUnit:toUnitType(h),EXPERIMENTAL_undoKeybindings:a??!0,onInteractionStarted:()=>{r.disableSelectionSync(),r.setIsInteractivelyTransforming(!0)},onInteractionEnded:()=>{r.invalidateTransforms(),r.setIsInteractivelyTransforming(!1)},onPositionChanged:async e=>{await r.setTransformWidgetPosition(e.detail),i?.(e.detail)},onRotationChanged:e=>{r.setTransformWidgetOrientation(e.detail),o?.(e.detail)}})})}const VertexViewerSceneReset=({onReset:t})=>{const n=useCrossSectioningActions(),a=useModelViewActions(),i=useSelectionActions(),o=useTransformActions(),r=useViewerSceneActions(),s=c(sn),l=undefined;return e(F,{content:"Reset View",children:e(W,{iconName:"reset",className:"flex bg-white opacity-70 hover:opacity-100 text-neutral-900 hover:text-neutral-700 hover:bg-neutral-200 rounded p-1 cursor-pointer","data-testid":"viewer-reset-tool-button",onClick:async()=>{await n.disable(),await i.resetSelectionState(),o.clearTransformWidgetPosition(),await o.invalidateTransforms(),s(void 0),await a.clearModelView(),t?.(),await r.reset()},variant:"plain"})})};function useViewerFrameActions(){const e=useTransformActions();return{frameDrawn:useActionCallback((({set:t,snapshot:n})=>async a=>{const i=await n.getPromise(tn);t(rt,a.detail.scene),t(tn,a.detail.scene.sceneViewSummary.selectedVisibleSummary),t(en,i);const o=undefined;await n.getPromise(Xn)&&await e.syncToSelection()}))}}const VertexBoxSelectionTool=()=>{const{element:t,callback:n}=useCallbackRef(),a=useBoxSelectionActions(),i=useTransformActions(),o=s(gn);return k.useEffect((()=>{const e=whenComponentReady(t,(()=>[t?.model?.onDragComplete((()=>{"clearAndSelect"===o&&(i.clearTransformWidgetOrientation(),i.clearTransformWidgetPosition(),i.enableSelectionSync())}))]));return()=>{e?.then((e=>{e?.forEach((e=>e?.dispose()))}))}}),[t,o]),useApplyKeyBinding({keyBind:"Shift",fn:k.useCallback((()=>a.setOperationType("select")),[]),off:k.useCallback((()=>a.setOperationType("clearAndSelect")),[])}),e(ve,{ref:n,"data-testid":"viewer-box-query-tool",operationType:o})};function VertexViewerCameraTypeMenu({open:n,onOpen:a,onDismiss:i,onCameraTypeChange:o}){const r=useViewerCameraActions(),l=s(Qe);return t(Z,{"data-testid":"camera-types-popover",className:"flex",placement:"bottom-end",open:asBooleanAttribute(n),onMenuClosed:i,children:[e("div",{slot:"anchor",children:e("div",{className:_a("flex bg-white hover:opacity-100 hover:text-neutral-700 hover:bg-neutral-200 rounded",{"opacity-70 text-neutral-900":!n,"opacity-100 text-neutral-700 bg-neutral-200":n}),children:e(F,{content:"Change View",children:e(W,{"data-testid":"set-camera-mode-option",className:"p-1 cursor-pointer",variant:"plain",onClick:a,iconName:"orthographic"===l?"cube-orthographic":"cube-perspective",children:e($,{"data-testid":"change-camera-type-icon-button",name:"chevron-down",size:"sm"})})})})}),t("div",{className:"w-36",children:[e("div",{className:"pt-1"}),t(Y,{"data-testid":"set-perspective-view",onClick:()=>{r.updateCameraType("perspective",!0),o?.("perspective")},children:[e($,{slot:"icon","data-testid":"set-perspective-view-icon",name:"cube-perspective",size:"sm",className:_a({"text-[var(--vertex-ui-blue-700)]":"perspective"===l})}),e("div",{className:_a("ml-2 items-center",{"text-[var(--vertex-ui-blue-700)]":"perspective"===l}),children:"Perspective"})]}),t(Y,{"data-testid":"set-orthographic-view",onClick:()=>{r.updateCameraType("orthographic",!0),o?.("orthographic")},children:[e($,{slot:"icon","data-testid":"set-orthographic-view-icon",name:"cube-orthographic",size:"sm",className:_a({"text-[var(--vertex-ui-blue-700)]":"orthographic"===l})}),e("div",{className:_a("ml-2 items-center",{"text-[var(--vertex-ui-blue-700)]":"orthographic"===l}),children:"Orthographic"})]})]})]})}const VertexViewerViewCube=({placement:n,children:a,...i})=>{const o=Array.isArray(a)?a:[a],r=o.filter((e=>!A.isValidElement(e)||e.type!==be)).filter((e=>null!=e&&!1!==e)),s=o.find((e=>A.isValidElement(e)&&e.type===be)),[l,c]=A.useState(!1);return t(ge,{direction:"vertical","data-testid":"view-cube-toolbar",placement:n??"top-right",children:[s??e(be,{className:"m-7",...i}),0===r.length?t("div",{className:"flex items-center justify-center mt-3 gap-1",children:[e(VertexViewerSceneReset,{}),e(VertexViewerCameraTypeMenu,{open:l,onDismiss:()=>c(!1),onOpen:()=>c(!0)})]}):e("div",{className:"mt-3",children:r})]})},VertexViewer=({id:a,src:i,className:o,disableSelection:r,onTap:l,onLongpress:d,onFrameDrawn:u,onSceneReady:m,viewerRefCallback:p,children:f,...g})=>{const v=s(Mi),b=useRecoilRef({state:et}),w=useViewerCameraActions(),C=useCrossSectioningActions(),S=useHitActions(),k=useSelectionActions(),T=useViewerFrameActions(),P=s(Qe),M=s(kt),E=s(fn),I=c(ot),[N,O]=h(nt);A.useEffect((()=>{N&&(O(!1),C.disable())}),[i]);const[V,L]=h(tt);A.useEffect((()=>{null!=a&&L(a)}),[a]);const _=s(xi),R=A.useMemo((()=>({opacity:_/100})),[_]),D=s(za),B=s(Ba),H=A.useMemo((()=>({color:D,width:B})),[D,B]),j=s(wt),F=s(Ct),W=s(St),U=A.useMemo((()=>({endCapEnabled:j,endCapUsePartColor:F===ut.PART,...j&&F===ut.SINGLE&&{endCapColor:W}})),[j,F,W]),G=s(oi),K=s(ti),$=s(ni),q=s(ai),Y=A.useMemo((()=>({color:K,opacity:$/100,lineWidth:q})),[K,$,q]),X=s(Sn),Z=null!=f&&!1!==f;return useKeyBindings(),useDefaultKeybindings(),t(we,{id:V,"data-testid":"vertex-viewer",src:i,ref:e=>{p?.(e),b(e)},className:_a("flex w-full h-full",o,{"cursor-crosshair":M.hitPending}),style:{"--viewer-background":G},config:v,cameraType:N?P:void 0,onCameraTypeChanged:e=>{N&&w.updateCameraType(e.detail,!1)},phantom:R,featureLines:H,selectionHighlighting:Y,crossSectioning:U,featureMaps:X?"final":void 0,onTap:e=>{const t=[...r?[]:[k.selectCurrentHit]];S.tap(e,...t),l?.(e)},onLongpress:e=>{S.longPress(e),d?.(e)},onFrameDrawn:e=>{T.frameDrawn(e),u?.(e)},onSceneReady:async e=>{if(!N){O(!0);const t=await(e?.target?.scene());I(t?.sceneViewId)}m?.(e)},...g,children:[E&&e(VertexBoxSelectionTool,{}),Z?f:t(n,{children:[e(VertexViewerViewCube,{}),e(VertexToolbar,{}),e(VertexViewerContextMenu,{})]})]})};function toSdkConfig(e){return isOnlyNetworkConfig(e)?{network:e}:e}function isOnlyNetworkConfig(e){const t=undefined;return null!=e.renderingHost}const VertexViewerToolkitEventListener=({onHitStateChange:t,onSelectionStateChange:a})=>{const i=s(Ln),o=s(Fn);return A.useEffect((()=>{t?.(i)}),[i,t]),A.useEffect((()=>{a?.(o)}),[o,a]),e(n,{})},VertexViewerToolkitRoot=({override:a,autoDefineCustomElements:i,children:o,config:r,...s})=>(A.useEffect((()=>{(null==i||i)&&(xe(),Se())}),[i]),e(f,{override:a,children:t(n,{children:[e(VertexViewerToolkitEventListener,{...s}),e(VertexViewerToolkitRootConfig,{config:r,children:o})]})})),VertexViewerToolkitRootConfig=({config:t,children:a})=>{const i=c(Mi);return A.useEffect((()=>{const e=null!=t?toSdkConfig(t):void 0;i(e)}),[t,i]),e(n,{children:a})};var lo=Object.freeze({__proto__:null,get AssemblyFontFace(){return Zi},Columns:ji,Core:jn,Metadata:eo,Search:Xi});export{ri as Appearance,yn as BoxSelection,Ei as Config,hn as ContextMenu,Oa as CrossSection,Pi as Ghosting,_n as Hits,ci as Keybinding,Vn as Measurement,Ze as Messages,Ci as Metadata,Ia as ModelViews,pi as Panel,Ut as Performance,lo as SceneTree,ha as SceneViewItem,Wn as Selection,Kn as Settings,ua as Transforms,VertexApplicationMessages,VertexBoxSelectionButton,VertexContextMenu,VertexCrossSectionAppearanceColorPicker,VertexCrossSectionAppearanceControls,VertexCrossSectionAppearanceLineThicknessSlider,VertexCrossSectionAppearancePanelSection,VertexCrossSectionAppearanceReset,VertexDecimalPlaceSelector,VertexFeatureEdgesColorPicker,VertexFeatureEdgesControls,VertexFeatureEdgesPanelSection,VertexFeatureEdgesReset,VertexFeatureEdgesThicknessSlider,VertexFitAllButton,VertexFitSelectedMenuItem,VertexFlyToMenuItem,VertexGhostingControls,VertexGhostingPanelSection,VertexHideAllMenuItem,VertexHidePartMenuItem,VertexHideSelectedMenuItem,VertexLengthUnitSelector,VertexMaterialControls,VertexMaterialPanelSection,VertexMeasurementContextMenu,VertexMeasurementDetails,VertexModelViewsPanel,VertexPanButton,VertexPointToPointMeasurement,VertexPointToPointMeasurementTool,VertexPreciseMeasurement,VertexPreciseMeasurementTool,VertexResizableContent,VertexRotateButton,VertexSceneItemGhostingClear,VertexSceneItemGhostingOpacitySlider,VertexSceneItemGhostingToggle,VertexSceneItemMaterialClear,VertexSceneItemMaterialColorPicker,VertexSceneItemMaterialColorSwatches,VertexSceneItemMaterialOpacitySlider,VertexSceneTree,VertexSceneTreeColumnPopover,VertexSceneTreeContextMenu,VertexSceneTreeCustomColumn,VertexSceneTreeHeader,VertexSceneTreeMetadataColumns,VertexSceneTreeSearchBar,VertexSceneTreeSearchInformationForToolbar,VertexSceneTreeSearchOptionsPopover,VertexSceneTreeTableLayout,VertexSelectionHighlightingColorPicker,VertexSelectionHighlightingControls,VertexSelectionHighlightingLineThicknessSlider,VertexSelectionHighlightingOpacitySlider,VertexSelectionHighlightingPanelSection,VertexSelectionHighlightingReset,VertexShowAllMenuItem,VertexShowOnlyMenuItem,VertexShowOnlySelectedMenuItem,VertexShowPropertiesMenuItem,VertexToolbar,VertexToolbarDivider,VertexTransformClear,VertexTransformControls,VertexTransformInputs,VertexTransformManipulatorToggle,VertexTransformPanelSection,VertexTransformWidget,VertexUnitsControls,VertexUnitsPanelSection,VertexViewer,VertexViewerBackgroundColorPicker,VertexViewerBackgroundControls,VertexViewerBackgroundPanelSection,VertexViewerBackgroundReset,VertexViewerContextMenu,VertexViewerCrossSectionButton,VertexViewerRightOpenedPanel,VertexViewerRightSidebar,VertexViewerSceneReset,VertexViewerToolkitRoot,VertexViewerViewCube,VertexZoomButton,lt as Viewer};
19
19
  //# sourceMappingURL=bundle.esm.js.map