@arcgis/core 5.2.0-next.118 → 5.2.0-next.119

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.
Files changed (41) hide show
  1. package/assets/esri/core/workers/RemoteClient.js +1 -1
  2. package/assets/esri/core/workers/chunks/{62b1f94f4fa978d4da48.js → 354912041363502c6a89.js} +1 -1
  3. package/assets/esri/core/workers/chunks/{4925d0b29a166cc8fee1.js → 3c3e5e952fd6740bb234.js} +1 -1
  4. package/assets/esri/core/workers/chunks/5938d5f6e37f49867d5a.js +1 -0
  5. package/assets/esri/core/workers/chunks/{0dc317d022807af92e3f.js → 723478607badcde5706b.js} +2 -2
  6. package/assets/esri/core/workers/chunks/{42c4d0c1c08bf111e5a4.js → 731ec5de16753e10b963.js} +1 -1
  7. package/assets/esri/core/workers/chunks/{5965a947f68b707eaa6b.js → 82ce034b5ba54de9b970.js} +1 -1
  8. package/assets/esri/core/workers/chunks/97fea852f8e93e1286e4.js +1 -0
  9. package/chunks/Water.glsl.js +36 -47
  10. package/config.js +1 -1
  11. package/kernel.js +1 -1
  12. package/layers/video/VideoController.js +1 -1
  13. package/package.json +3 -3
  14. package/support/revision.js +1 -1
  15. package/symbols/cim/animationUtils.js +1 -1
  16. package/views/2d/engine/webgl/animations/instructions.js +1 -1
  17. package/views/3d/analysis/LineOfSight/LineOfSightEditTool.js +1 -1
  18. package/views/3d/analysis/LineOfSight/LineOfSightItemTool.js +1 -1
  19. package/views/3d/analysis/LineOfSight/LineOfSightTool.js +1 -1
  20. package/views/3d/analysis/LineOfSightAnalysisView3D.js +1 -1
  21. package/views/3d/camera/constraintUtils.js +1 -1
  22. package/views/3d/state/controllers/GroundNavigationController.js +1 -1
  23. package/views/3d/state/controllers/InteractiveController.js +1 -1
  24. package/views/3d/state/controllers/momentum/GroundNavigationMomentumController.js +1 -1
  25. package/views/3d/state/controllers/momentum/MomentumController.js +1 -1
  26. package/views/3d/state/utils/OffsetCorrectionController.js +2 -0
  27. package/views/3d/webgl-engine/core/shaderLibrary/ShaderOutput.js +1 -1
  28. package/views/3d/webgl-engine/core/shaderLibrary/shading/NormalUtils.glsl.js +3 -3
  29. package/views/3d/webgl-engine/materials/Water.glsl.js +1 -1
  30. package/views/3d/webgl-engine/materials/WaterMaterial.js +1 -1
  31. package/views/3d/webgl-engine/materials/WaterTechniqueConfiguration.js +1 -1
  32. package/widgets/Measurement.d.ts +1 -2
  33. package/widgets/Measurement.js +1 -1
  34. package/widgets/OrientedImageryViewer/OrientedImageryViewerViewModel.js +1 -1
  35. package/widgets/Sketch/SketchViewModel.d.ts +13 -0
  36. package/widgets/Sketch/SketchViewModel.js +1 -1
  37. package/widgets/Sketch/VisibleElements.d.ts +8 -1
  38. package/widgets/Sketch/VisibleElements.js +1 -1
  39. package/widgets/Sketch/support/PluginManager.d.ts +11 -1
  40. package/assets/esri/core/workers/chunks/21c0743b2f612e7e7de3.js +0 -1
  41. package/assets/esri/core/workers/chunks/b961e0aaa6b3ea75315c.js +0 -1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@arcgis/core",
3
- "version": "5.2.0-next.118",
3
+ "version": "5.2.0-next.119",
4
4
  "description": "ArcGIS Maps SDK for JavaScript: A complete 2D and 3D mapping and data visualization API",
5
5
  "keywords": [
6
6
  "ArcGIS",
@@ -20,11 +20,11 @@
20
20
  "license": "SEE LICENSE IN LICENSE.md",
21
21
  "dependencies": {
22
22
  "@amcharts/amcharts5": "~5.20.6",
23
- "@arcgis/toolkit": "5.2.0-next.118",
23
+ "@arcgis/toolkit": "5.2.0-next.119",
24
24
  "@esri/arcgis-html-sanitizer": "~4.1.0",
25
25
  "@esri/calcite-components": "^5.2.0-next.73",
26
26
  "@vaadin/grid": "~25.2.11",
27
- "@zip.js/zip.js": "~2.15.0",
27
+ "@zip.js/zip.js": "~2.16.0",
28
28
  "luxon": "~3.7.2",
29
29
  "marked": "~18.0.13",
30
30
  "tslib": "^2.8.1"
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- const e="20260921",a="00a434e749187fa2ce04fd4431be5902dc3d7a19";export{e as buildDate,a as revision};
2
+ const a="20260922",c="6c596a651220d9f1c2b8a49eae5ac848e6dd8ac9";export{a as buildDate,c as revision};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import t from"../../core/Logger.js";import{animationDebugFlags as e}from"./animationDebugFlags.js";import{defaultCIMValues as n}from"./defaultCIMValues.js";import{getExtent as o}from"./SDFHelper.js";import{getProcessParam as i,getValue as r,hasProcessParam as a,getSize as s}from"./utils.js";function l(t,e,n){return{transform:T(t,e,n.transform),fromColor:I(t,e,n.fromColor),toColor:v(t,e,n.toColor),colorMix:D(t,e,n.colorMix),toOpacity:R(t,e,n.toOpacity),opacityMix:L(t,e,n.opacityMix),shift:w(t,e,n.shift),hasAnimations:n.hasAnimations||c(e),hasShiftAnimation:n.hasShiftAnimation||m(e),hasMotionAnimations:n.hasMotionAnimations||f(e)}}function c(t){return"animations"in t&&!!t.animations&&t.animations.length>0}function m(t){return"animations"in t&&!!t.animations&&t.animations.some(t=>"CIMSymbolAnimationMoveAlongLine"===t.type)}const p=new Set(["CIMSymbolAnimationOffset","CIMSymbolAnimationRotation","CIMSymbolAnimationSize","CIMSymbolAnimationScale"]);function f(t){return"animations"in t&&!!t.animations&&t.animations.some(t=>p.has(t.type))}function y(t){return!e.forceStaticPath&&(e.forceAnimatedPath||t.hasAnimations)}function u(e,n,o){if("CIMCharacterMarker"===n.type)return t.getLogger("animationUtils").error("#handleMarker()","CIM character markers do not support animations"),o;const r=i(e,n,"OffsetX"),a=i(e,n,"OffsetY");if("CIMPictureMarker"===n.type)return{...o,transform:{type:"AnimatedTransform",relativeTranslation:!1,absoluteScale:!0,selectGlobalRotation:!1,translation:V([r,a]),rotation:V(0),scale:V(i(e,n,"Size")),parent:o.transform}};const s=n.frame,l=s.ymax-s.ymin;return{...o,transform:{type:"AnimatedTransform",relativeTranslation:!1,absoluteScale:!1,selectGlobalRotation:!1,translation:V([r,a]),rotation:V(0),scale:V({type:"Process",op:"Divide",left:i(e,n,"Size"),right:l}),parent:o.transform}}}function d(t,e){let n=0,o=0;const i="Absolute"!==t.anchorPointUnits;return t.anchorPoint&&(n=-t.anchorPoint.x,o=-t.anchorPoint.y),{...e,transform:{type:"AnimatedTransform",relativeTranslation:i,absoluteScale:!1,selectGlobalRotation:!1,translation:V([n,o]),rotation:V(0),scale:V(1),parent:e.transform}}}function S(t,e){return"Absolute"===t.anchorPointUnits?e:d(t,e)}function C(t,e){return"Absolute"!==t.anchorPointUnits?e:d(t,e)}function M(t,e,n){return{...t,transform:{type:"AnimatedTransform",relativeTranslation:!1,absoluteScale:!1,selectGlobalRotation:!1,translation:V([e,n]),rotation:V(0),scale:V(1),parent:t.transform}}}function h(t){return{...t,transform:{type:"AnimatedTransform",relativeTranslation:!1,absoluteScale:!1,selectGlobalRotation:!0,translation:V([0,0]),rotation:V(0),scale:V(1),parent:t.transform}}}function A(t,e){const n=e?.5*-(e.xmin+e.xmax):0,i=e?.5*-(e.ymin+e.ymax):0;let r=0,a=0;if("x"in t&&"y"in t)r=t.x+n,a=t.y+i;else{const e=o(t);if(e){r=(e[0]+e[2])/2+n,a=(e[1]+e[3])/2+i}}return[r,a]}function g(t,e){switch(e.type){case"CIMPictureMarker":case"CIMVectorMarker":return i(t,e,"Rotation")}return 0}function b(t,e){switch(e.type){case"CIMPictureMarker":case"CIMVectorMarker":return i(t,e,"RotateClockwise")}return 0}function P(t,e){switch(e.type){case"CIMPointSymbol":case"CIMVectorMarker":return[1,1,1,1];case"CIMSolidStroke":case"CIMSolidFill":return i(t,e,"Color");case"CIMPictureMarker":case"CIMPictureStroke":case"CIMPictureFill":return i(t,e,"TintColor")}return[1,1,1,1]}function T(t,e,n){return{type:"AnimatedTransform",relativeTranslation:!1,absoluteScale:!1,selectGlobalRotation:!1,translation:F(t,e),rotation:G(t,e),scale:z(t,e),parent:n}}function I(t,e,n){return{type:"AnimatedColor",color:V(P(t,e)),opacity:V(1),parent:n,applyToChildren:!1}}function v(t,e,n){const o=j(e);let r,a=k(n);if(a)r=[1,1,1,1];else{r=P(t,e);const n=o?.find(t=>"CIMSymbolAnimationColor"===t.type);n&&(r=i(t,n,"ToColor"),a="Override"===n.colorMode)}return{type:"AnimatedColor",color:V(r),opacity:V(1),parent:n,applyToChildren:a}}function D(t,e,n){const o=j(e),i=o?.find(t=>"CIMSymbolAnimationColor"===t.type);return i?{type:"AnimatedColor",color:V([1,1,1,1]),opacity:{from:0,to:1,timing:x(t,i?.animatedSymbolProperties)},parent:[1,1,1,1],applyToChildren:!1}:n}function k(t){return"object"==typeof t&&"applyToChildren"in t&&t.applyToChildren}function R(t,e,n){const o=j(e);let r=V(1);const a=o?.find(t=>"CIMSymbolAnimationTransparency"===t.type);if(a){r=V({type:"Process",op:"Transparency",value:i(t,a,"ToTransparency")})}return{type:"AnimatedColor",color:V([1,1,1,1]),opacity:r,parent:n,applyToChildren:!1}}function L(t,e,n){const o=j(e),i=o?.find(t=>"CIMSymbolAnimationTransparency"===t.type);return i?{type:"AnimatedColor",color:V([1,1,1,1]),opacity:{from:0,to:1,timing:x(t,i?.animatedSymbolProperties)},parent:[1,1,1,1],applyToChildren:!1}:n}const O=120;function w(t,e,o){const s=j(e),l=s?.find(t=>"CIMSymbolAnimationMoveAlongLine"===t.type);if(!l)return o;const c=r(l.movementType,n.CIMSymbolAnimationMoveAlongLine.movementtype);let m,p=!1,f=!1,y=x(t,l.animatedSymbolProperties);const u=a(t,l,"DistanceAlong"),d=a(t,l,"Speed"),S=u&&i(t,l,"DistanceAlong"),C=d&&i(t,l,"Speed"),M=!0===l.continuous;if("Distance"===c){if(!1===S)throw new Error("distanceAlong must be specified when movementType is 'Distance'.");m={type:"Process",op:"Divide",left:S,right:100},p=!0,C&&(f=!0,y={...y,duration:{type:"Process",op:"Divide",left:m,right:C}})}else{if("Speed"!==c)throw new Error("movementType is required; allowed values are 'Distance' and 'Speed'.");if(!1===C)throw new Error("speed must be specified when movementType is 'Speed'.");m={type:"Process",op:"Multiply",left:C,right:y.duration}}return M&&(m={type:"Process",op:"Multiply",left:m,right:O},y={...y,duration:{type:"Process",op:"Multiply",left:y.duration,right:O}}),{type:"AnimatedShift",multiplyToByLineLength:p,multiplyDurationByLineLength:f,shift:{from:0,to:m,timing:y},parent:o}}function x(t,e){if(!e)return{duration:1,startTimeOffset:0,repeatDelay:0,timeOriginSelector:"Local",repeatType:"Loop",easing:"Linear",playAnimation:1,reverseAnimation:0};const o=i(t,e,"Duration");let a;if(i(t,e,"RandomizeStartTime")){a={type:"Process",op:"Random",min:0,max:o,seed:i(t,e,"RandomizeStartSeed")}}else a=i(t,e,"StartTimeOffset");const s=i(t,e,"RepeatDelay"),l=i(t,e,"PlayAnimation"),c=i(t,e,"ReverseAnimation"),m=r(e.repeatType,n.CIMAnimatedSymbolProperties.repeattype);return{duration:o,startTimeOffset:a,repeatDelay:s,timeOriginSelector:"None"===m?"Local":"Global",repeatType:m,easing:r(e.easing,n.CIMAnimatedSymbolProperties.easing),playAnimation:l,reverseAnimation:c}}function z(t,e){const n=j(e);let o;o="CIMPictureMarker"===e.type||"CIMVectorMarker"===e.type?i(t,e,"Size"):"CIMSolidStroke"===e.type||"CIMPictureStroke"===e.type?i(t,e,"Width"):s(e)||10;const r=n?.find(t=>"CIMSymbolAnimationScale"===t.type);if(!r){const e=n?.find(t=>"CIMSymbolAnimationSize"===t.type);if(!e)return V(1);return{from:1,to:{type:"Process",op:"Divide",left:i(t,e,"ToSize"),right:o},timing:x(t,e.animatedSymbolProperties)}}return{from:1,to:i(t,r,"ScaleFactor"),timing:x(t,r.animatedSymbolProperties)}}function j(t){return"animations"in t&&t.animations||[]}function F(t,e){const n=j(e),o=n?.find(t=>"CIMSymbolAnimationOffset"===t.type);if(!o)return V([0,0]);return{from:[0,0],to:[i(t,o,"OffsetX"),i(t,o,"OffsetY")],timing:x(t,o.animatedSymbolProperties)}}function G(t,e){const n=j(e),o=b(t,e),r={type:"Process",op:"Divide",left:g(t,e),right:{type:"Process",op:"Cond",condition:o,ifTrue:-1,ifFalse:1}},a=n?.find(t=>"CIMSymbolAnimationRotation"===t.type);if(!a)return V(r);const s={type:"Process",op:"Add",left:i(t,a,"ToRotation"),right:{type:"Process",op:"Divide",left:r,right:-1}};return{from:r,to:{type:"Process",op:"Add",left:r,right:{type:"Process",op:"Cond",condition:i(t,a,"RotateClockwise"),ifTrue:{type:"Process",op:"MatchWinding",sign:-1,angle:s},ifFalse:{type:"Process",op:"MatchWinding",sign:1,angle:s}}},timing:x(t,a.animatedSymbolProperties)}}function V(t){return{from:t,to:t,timing:{duration:1,startTimeOffset:0,repeatDelay:0,timeOriginSelector:"Local",repeatType:"Loop",easing:"Linear",playAnimation:1,reverseAnimation:0}}}function U(t){if(null==t)return!1;if("object"!=typeof t)return!1;if(t.animations&&Array.isArray(t.animations)&&t.animations.length>0)return!0;for(const e in t)if(U(t[e]))return!0;return!1}export{U as checkForAnimations,l as getAnimationParams,A as getFrameTranslation,V as getStaticParam,h as globalRotation,C as handleAbsoluteAnchor,d as handleAnchor,u as handleMarker,S as handleRelativeAnchor,y as shouldUseAnimatedPath,M as translate};
2
+ import t from"../../core/Logger.js";import{animationDebugFlags as e}from"./animationDebugFlags.js";import{defaultCIMValues as n}from"./defaultCIMValues.js";import{getExtent as o}from"./SDFHelper.js";import{getProcessParam as i,getValue as r,hasProcessParam as a,getSize as s}from"./utils.js";function l(t,e,n){return{transform:P(t,e,n.transform),fromColor:I(t,e,n.fromColor),toColor:v(t,e,n.toColor),colorMix:D(t,e,n.colorMix),toOpacity:R(t,e,n.toOpacity),opacityMix:L(t,e,n.opacityMix),shift:O(t,e,n.shift),hasAnimations:n.hasAnimations||m(e),hasShiftAnimation:n.hasShiftAnimation||c(e),hasMotionAnimations:n.hasMotionAnimations||f(e)}}function m(t){return"animations"in t&&!!t.animations&&t.animations.length>0}function c(t){return"animations"in t&&!!t.animations&&t.animations.some(t=>"CIMSymbolAnimationMoveAlongLine"===t.type)}const p=new Set(["CIMSymbolAnimationOffset","CIMSymbolAnimationRotation","CIMSymbolAnimationSize","CIMSymbolAnimationScale"]);function f(t){return"animations"in t&&!!t.animations&&t.animations.some(t=>p.has(t.type))}function y(t){return!e.forceStaticPath&&(e.forceAnimatedPath||t.hasAnimations)}function u(e,n,o){if("CIMCharacterMarker"===n.type)return t.getLogger("animationUtils").error("#handleMarker()","CIM character markers do not support animations"),o;const r=i(e,n,"OffsetX"),a=i(e,n,"OffsetY");if("CIMPictureMarker"===n.type)return{...o,transform:{type:"AnimatedTransform",relativeTranslation:!1,absoluteScale:!0,selectGlobalRotation:!1,translation:G([r,a]),rotation:G(0),scale:G(i(e,n,"Size")),parent:o.transform}};const s=n.frame,l=s.ymax-s.ymin;return{...o,transform:{type:"AnimatedTransform",relativeTranslation:!1,absoluteScale:!1,selectGlobalRotation:!1,translation:G([r,a]),rotation:G(0),scale:G({type:"Process",op:"Divide",left:i(e,n,"Size"),right:l}),parent:o.transform}}}function d(t,e){let n=0,o=0;const i="Absolute"!==t.anchorPointUnits;return t.anchorPoint&&(n=-t.anchorPoint.x,o=-t.anchorPoint.y),{...e,transform:{type:"AnimatedTransform",relativeTranslation:i,absoluteScale:!1,selectGlobalRotation:!1,translation:G([n,o]),rotation:G(0),scale:G(1),parent:e.transform}}}function S(t,e){return"Absolute"===t.anchorPointUnits?e:d(t,e)}function C(t,e){return"Absolute"!==t.anchorPointUnits?e:d(t,e)}function M(t,e,n){return{...t,transform:{type:"AnimatedTransform",relativeTranslation:!1,absoluteScale:!1,selectGlobalRotation:!1,translation:G([e,n]),rotation:G(0),scale:G(1),parent:t.transform}}}function A(t){return{...t,transform:{type:"AnimatedTransform",relativeTranslation:!1,absoluteScale:!1,selectGlobalRotation:!0,translation:G([0,0]),rotation:G(0),scale:G(1),parent:t.transform}}}function h(t,e){const n=e?.5*-(e.xmin+e.xmax):0,i=e?.5*-(e.ymin+e.ymax):0;let r=0,a=0;if("x"in t&&"y"in t)r=t.x+n,a=t.y+i;else{const e=o(t);if(e){r=(e[0]+e[2])/2+n,a=(e[1]+e[3])/2+i}}return[r,a]}function g(t,e){switch(e.type){case"CIMPictureMarker":case"CIMVectorMarker":return i(t,e,"Rotation")}return 0}function b(t,e){switch(e.type){case"CIMPictureMarker":case"CIMVectorMarker":return i(t,e,"RotateClockwise")}return 0}function T(t,e){switch(e.type){case"CIMPointSymbol":case"CIMVectorMarker":return[1,1,1,1];case"CIMSolidStroke":case"CIMSolidFill":return i(t,e,"Color");case"CIMPictureMarker":case"CIMPictureStroke":case"CIMPictureFill":return i(t,e,"TintColor")}return[1,1,1,1]}function P(t,e,n){return{type:"AnimatedTransform",relativeTranslation:!1,absoluteScale:!1,selectGlobalRotation:!1,translation:j(t,e),rotation:F(t,e),scale:x(t,e),parent:n}}function I(t,e,n){return{type:"AnimatedColor",color:G(T(t,e)),opacity:G(1),parent:n,applyToChildren:!1}}function v(t,e,n){const o=z(e);let r,a=k(n);if(a)r=[1,1,1,1];else{r=T(t,e);const n=o?.find(t=>"CIMSymbolAnimationColor"===t.type);n&&(r=i(t,n,"ToColor"),a="Override"===n.colorMode)}return{type:"AnimatedColor",color:G(r),opacity:G(1),parent:n,applyToChildren:a}}function D(t,e,n){const o=z(e),i=o?.find(t=>"CIMSymbolAnimationColor"===t.type);return i?{type:"AnimatedColor",color:G([1,1,1,1]),opacity:{from:0,to:1,timing:w(t,i?.animatedSymbolProperties)},parent:[1,1,1,1],applyToChildren:!1}:n}function k(t){return"object"==typeof t&&"applyToChildren"in t&&t.applyToChildren}function R(t,e,n){const o=z(e);let r=G(1);const a=o?.find(t=>"CIMSymbolAnimationTransparency"===t.type);if(a){r=G({type:"Process",op:"Transparency",value:i(t,a,"ToTransparency")})}return{type:"AnimatedColor",color:G([1,1,1,1]),opacity:r,parent:n,applyToChildren:!1}}function L(t,e,n){const o=z(e),i=o?.find(t=>"CIMSymbolAnimationTransparency"===t.type);return i?{type:"AnimatedColor",color:G([1,1,1,1]),opacity:{from:0,to:1,timing:w(t,i?.animatedSymbolProperties)},parent:[1,1,1,1],applyToChildren:!1}:n}function O(t,e,o){const s=z(e),l=s?.find(t=>"CIMSymbolAnimationMoveAlongLine"===t.type);if(!l)return o;const m=r(l.movementType,n.CIMSymbolAnimationMoveAlongLine.movementtype);let c,p=!1,f=!1,y=w(t,l.animatedSymbolProperties);const u=a(t,l,"DistanceAlong"),d=a(t,l,"Speed"),S=u&&i(t,l,"DistanceAlong"),C=d&&i(t,l,"Speed"),M=!0===l.continuous;if("Distance"===m){if(!1===S)throw new Error("distanceAlong must be specified when movementType is 'Distance'.");c={type:"Process",op:"Divide",left:S,right:100},p=!0,C&&(f=!0,y={...y,duration:{type:"Process",op:"Divide",left:c,right:C}})}else{if("Speed"!==m)throw new Error("movementType is required; allowed values are 'Distance' and 'Speed'.");if(!1===C)throw new Error("speed must be specified when movementType is 'Speed'.");c={type:"Process",op:"Multiply",left:C,right:y.duration}}return{type:"AnimatedShift",continuous:M,multiplyToByLineLength:p,multiplyDurationByLineLength:f,shift:{from:0,to:c,timing:y},parent:o}}function w(t,e){if(!e)return{duration:1,startTimeOffset:0,repeatDelay:0,timeOriginSelector:"Local",repeatType:"Loop",easing:"Linear",playAnimation:1,reverseAnimation:0};const o=i(t,e,"Duration");let a;if(i(t,e,"RandomizeStartTime")){a={type:"Process",op:"Random",min:0,max:o,seed:i(t,e,"RandomizeStartSeed")}}else a=i(t,e,"StartTimeOffset");const s=i(t,e,"RepeatDelay"),l=i(t,e,"PlayAnimation"),m=i(t,e,"ReverseAnimation"),c=r(e.repeatType,n.CIMAnimatedSymbolProperties.repeattype);return{duration:o,startTimeOffset:a,repeatDelay:s,timeOriginSelector:"None"===c?"Local":"Global",repeatType:c,easing:r(e.easing,n.CIMAnimatedSymbolProperties.easing),playAnimation:l,reverseAnimation:m}}function x(t,e){const n=z(e);let o;o="CIMPictureMarker"===e.type||"CIMVectorMarker"===e.type?i(t,e,"Size"):"CIMSolidStroke"===e.type||"CIMPictureStroke"===e.type?i(t,e,"Width"):s(e)||10;const r=n?.find(t=>"CIMSymbolAnimationScale"===t.type);if(!r){const e=n?.find(t=>"CIMSymbolAnimationSize"===t.type);if(!e)return G(1);return{from:1,to:{type:"Process",op:"Divide",left:i(t,e,"ToSize"),right:o},timing:w(t,e.animatedSymbolProperties)}}return{from:1,to:i(t,r,"ScaleFactor"),timing:w(t,r.animatedSymbolProperties)}}function z(t){return"animations"in t&&t.animations||[]}function j(t,e){const n=z(e),o=n?.find(t=>"CIMSymbolAnimationOffset"===t.type);if(!o)return G([0,0]);return{from:[0,0],to:[i(t,o,"OffsetX"),i(t,o,"OffsetY")],timing:w(t,o.animatedSymbolProperties)}}function F(t,e){const n=z(e),o=b(t,e),r={type:"Process",op:"Divide",left:g(t,e),right:{type:"Process",op:"Cond",condition:o,ifTrue:-1,ifFalse:1}},a=n?.find(t=>"CIMSymbolAnimationRotation"===t.type);if(!a)return G(r);const s={type:"Process",op:"Add",left:i(t,a,"ToRotation"),right:{type:"Process",op:"Divide",left:r,right:-1}};return{from:r,to:{type:"Process",op:"Add",left:r,right:{type:"Process",op:"Cond",condition:i(t,a,"RotateClockwise"),ifTrue:{type:"Process",op:"MatchWinding",sign:-1,angle:s},ifFalse:{type:"Process",op:"MatchWinding",sign:1,angle:s}}},timing:w(t,a.animatedSymbolProperties)}}function G(t){return{from:t,to:t,timing:{duration:1,startTimeOffset:0,repeatDelay:0,timeOriginSelector:"Local",repeatType:"Loop",easing:"Linear",playAnimation:1,reverseAnimation:0}}}function V(t){if(null==t)return!1;if("object"!=typeof t)return!1;if(t.animations&&Array.isArray(t.animations)&&t.animations.length>0)return!0;for(const e in t)if(V(t[e]))return!0;return!1}export{V as checkForAnimations,l as getAnimationParams,h as getFrameTranslation,G as getStaticParam,A as globalRotation,C as handleAbsoluteAnchor,d as handleAnchor,u as handleMarker,S as handleRelativeAnchor,y as shouldUseAnimatedPath,M as translate};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- class t{generateSource(t){const o=[];for(let a=1;a<this.length;a++)o.push(`vec4 atom${a} = texture(${t.animationTexture}, (pointer + 0.5) / size);`),o.push("pointer.x += 1.0;");for(let a=0;a<this.ins;a++)o.push("top--;"),o.push(`vec4 in${this.ins-a-1} = stack[top];`);for(let a=0;a<this.outs;a++)o.push(`vec4 out${a};`);const{microcode:e}=this;for(const a of e)o.push(a);for(let a=0;a<this.outs;a++)o.push(`stack[top] = out${a};`),o.push("top++;"),o.push(`if (top >= ${d}) { top = ${d-1}; }`);return o}}let o=128;class e extends t{constructor(){super(...arguments),this.opcode=++o,this.length=1,this.ins=0,this.outs=0,this.microcode=["break;"]}encode(){return[[this.opcode,0,0,0]]}}class a extends t{constructor(){super(...arguments),this.opcode=++o,this.length=1,this.ins=0,this.outs=1,this.microcode=["out0 = vec4(atom0.y, atom0.y, atom0.y, atom0.y);"]}encode(t){return[[this.opcode,t,0,0]]}}class i extends t{constructor(){super(...arguments),this.opcode=++o,this.length=1,this.ins=0,this.outs=1,this.microcode=["out0 = vec4(atom0.yzw, 0.0);"]}encode(t){return[[this.opcode,t[0]||0,t[1]||0,t[2]||0]]}}class n extends t{constructor(){super(...arguments),this.opcode=++o,this.length=2,this.ins=0,this.outs=1,this.microcode=["out0 = atom1;"]}encode(t){return[[this.opcode,0,0,0],t]}}function r(t){return[`float duration = clamp(${t.duration}, 0.05, 3600.0);`,`float startTimeOffset = ${t.startTimeOffset};`,`float repeatDelay = ${t.repeatDelay};`,`float timeOriginSelector = ${t.timeOriginSelector};`,`float repeatType = ${t.repeatType};`,`float easing = ${t.easing};`,`float playAnimation = ${t.playAnimation} * (1.0 - step(0.0, -${t.duration}));`,`float reverseAnimation = ${t.reverseAnimation};`,"float time = globalTime - (timeOriginSelector == 1.0 ? localTimeOrigin : 0.0);","time *= playAnimation;","time *= 1.0 - reverseAnimation * 2.0;","float period = duration + repeatDelay;","time += reverseAnimation == 1.0 ? (period - startTimeOffset - 0.001) : startTimeOffset + 0.001;","float omega = time / period;","float oi = floor(omega);","omega = repeatType == 1.0 || repeatType == 3.0 ? omega - oi : omega;","float of = omega * period;","of = (clamp(of, reverseAnimation * repeatDelay, period - (1.0 - reverseAnimation) * repeatDelay) - reverseAnimation * repeatDelay) / duration;","of = easing == 2.0 ? pow(of, 3.0) : of;","of = easing == 3.0 ? 1.0 - pow(1.0 - of, 3.0) : of;","of = easing == 4.0 ? of < 0.5 ? 4.0 * pow(of, 3.0) : 1.0 - pow(-2.0 * of + 2.0, 3.0) / 2.0 : of;","bool oscillate = repeatType == 3.0 && mod(oi, 2.0) == 1.0;",`${t.out} = oscillate ? 1.0 - of : of;`]}const s={Linear:1,EaseIn:2,EaseOut:3,EaseInOut:4},l={Loop:1,None:2,Oscillate:3},m={Local:1,Global:2};function c(t){const o=s[t.easing],e=l[t.repeatType],a=m[t.timeOriginSelector];return[[t.duration,t.startTimeOffset,t.repeatDelay,a],[e,o,t.playAnimation,t.reverseAnimation]]}class f extends t{constructor(){super(...arguments),this.opcode=++o,this.length=10,this.ins=1,this.outs=1,this.microcode=["vec2 fromTranslation = atom1.xy;","vec2 toTranslation = atom1.zw;","float fromRotation = atom2.x;","float toRotation = atom2.y;","float fromScale = atom2.z;","float toScale = atom2.w;","bool relativeTranslation = atom9.x == 1.0;","bool absoluteScale = atom9.y == 1.0;","bool selectGlobalRotation = atom9.z == 1.0;","vec2 translationMultiplier = relativeTranslation ? pixelDimensions : vec2(1.0, 1.0);","float scaleDivisor = absoluteScale ? pixelDimensions.y : 1.0;","float fTranslation;","{",...r({duration:"atom3.x",startTimeOffset:"atom3.y",repeatDelay:"atom3.z",timeOriginSelector:"atom3.w",repeatType:"atom4.x",easing:"atom4.y",playAnimation:"atom4.z",reverseAnimation:"atom4.w",out:"fTranslation"}),"}","float fRotation;","{",...r({duration:"atom5.x",startTimeOffset:"atom5.y",repeatDelay:"atom5.z",timeOriginSelector:"atom5.w",repeatType:"atom6.x",easing:"atom6.y",playAnimation:"atom6.z",reverseAnimation:"atom6.w",out:"fRotation"}),"}","float fScale;","{",...r({duration:"atom7.x",startTimeOffset:"atom7.y",repeatDelay:"atom7.z",timeOriginSelector:"atom7.w",repeatType:"atom8.x",easing:"atom8.y",playAnimation:"atom8.z",reverseAnimation:"atom8.w",out:"fScale"}),"}","vec2 aTranslation = mix(fromTranslation, toTranslation, fTranslation);","float aRotation = mix(fromRotation, toRotation, fRotation);","float aScale = mix(fromScale, toScale, fScale);","vec2 pTranslation = in0.xy;","float pRotation = in0.z;","float pScale = in0.w;","aTranslation *= translationMultiplier;","aScale /= scaleDivisor;","float rotation = pRotation + aRotation;","\n if (selectGlobalRotation) {\n rotation = globalRotation;\n }\n ","float scale = pScale * aScale;","float sin1 = sin(pRotation);","float cos1 = cos(pRotation);","float s1 = pScale;","float x1 = pTranslation.x;","float y1 = pTranslation.y;","float x2 = aTranslation.x;","float y2 = aTranslation.y;","\n vec2 translation = vec2(\n cos1 * s1 * x2 - sin1 * s1 * y2 + x1,\n sin1 * s1 * x2 + cos1 * s1 * y2 + y1\n );\n ","out0 = vec4(translation, rotation, scale);"]}encode(t){return[[this.opcode,0,0,0],[t.translation.from[0],t.translation.from[1],t.translation.to[0],t.translation.to[1]],[t.rotation.from,t.rotation.to,t.scale.from,t.scale.to],...c(t.translation.timing),...c(t.rotation.timing),...c(t.scale.timing),[t.relativeTranslation?1:0,t.absoluteScale?1:0,t.selectGlobalRotation?1:0,0]]}}class p extends t{constructor(){super(...arguments),this.opcode=++o,this.length=7,this.ins=1,this.outs=1,this.microcode=["float fromOpacity = atom0.y;","float toOpacity = atom0.z;","vec4 fromColor = atom1;","vec4 toColor = atom2;","float fColor;","{",...r({duration:"atom3.x",startTimeOffset:"atom3.y",repeatDelay:"atom3.z",timeOriginSelector:"atom3.w",repeatType:"atom4.x",easing:"atom4.y",playAnimation:"atom4.z",reverseAnimation:"atom4.w",out:"fColor"}),"}","float fOpacity;","{",...r({duration:"atom5.x",startTimeOffset:"atom5.y",repeatDelay:"atom5.z",timeOriginSelector:"atom5.w",repeatType:"atom6.x",easing:"atom6.y",playAnimation:"atom6.z",reverseAnimation:"atom6.w",out:"fOpacity"}),"}","vec4 aColor = mix(fromColor, toColor, fColor);","aColor.a *= mix(fromOpacity, toOpacity, fOpacity);","vec4 pColor = in0;","out0 = aColor * pColor;"]}encode(t){return[[this.opcode,t.opacity.from,t.opacity.to,0],[t.color.from[0],t.color.from[1],t.color.from[2],t.color.from[3]],[t.color.to[0],t.color.to[1],t.color.to[2],t.color.to[3]],...c(t.color.timing),...c(t.opacity.timing)]}}class u extends t{constructor(){super(...arguments),this.opcode=++o,this.length=4,this.ins=1,this.outs=1,this.microcode=["float fromShift = atom0.y;","float toShift = atom0.z;","float duration = atom1.x;","bool multiplyToByLineLength = atom3.x == 1.0;","bool multiplyDurationByLineLength = atom3.y == 1.0;","duration *= multiplyDurationByLineLength ? lineLength : 1.0;","float fShift;","{",...r({duration:"duration",startTimeOffset:"atom1.y",repeatDelay:"atom1.z",timeOriginSelector:"atom1.w",repeatType:"atom2.x",easing:"atom2.y",playAnimation:"atom2.z",reverseAnimation:"atom2.w",out:"fShift"}),"}","toShift *= multiplyToByLineLength ? lineLength : 1.0;","float aShift = mix(fromShift, toShift, fShift);","vec4 pShift = in0;","out0 = mod(aShift + pShift, lineLength);"]}encode(t){return[[this.opcode,t.shift.from,t.shift.to,0],...c(t.shift.timing),[t.multiplyToByLineLength?1:0,t.multiplyDurationByLineLength?1:0,0,0]]}}const h={scalar:new a,vector3:new i,vector4:new n,animatedTransform:new f,animatedColor:new p,animatedShift:new u,ret:new e},y=40,d=4;function g(t){const o=[];o.push(`float globalTime = ${t.globalTime};`),o.push(`float localTimeOrigin = ${t.localTimeOrigin};`),o.push(`float lineLength = ${t.lineLength};`),o.push(`float globalRotation = ${t.globalRotation};`),o.push(`vec2 pointer = ${t.animationPointer};`),o.push(`vec2 size = ${t.animationTextureSize};`),o.push("int top = 0;"),o.push(`vec4 stack[${d}];`),o.push(`for (int counter = 0; counter < ${y}; counter++) {`),o.push(`vec4 atom0 = texture(${t.animationTexture}, (pointer + 0.5) / size);`),o.push("pointer.x += 1.0;"),o.push(`vec2 pixelDimensions = ${t.pixelDimensions};`),o.push("if (false) {");for(const e in h){const a=h[e];o.push(`} else if (int(atom0.x) == ${a.opcode}) {`);for(const e of a.generateSource(t))o.push(e)}return o.push("} // End if-else."),o.push("} // End for."),o.push(`${t.out} = top > 0 ? stack[top - 1] : vec4(0.0);`),o.join("\n")}export{t as AAnimationInstruction,p as AnimatedColorInstruction,u as AnimatedShiftInstruction,f as AnimatedTransformInstruction,e as RetInstruction,a as ScalarInstruction,i as Vector3Instruction,n as Vector4Instruction,s as easingCodes,g as generateVirtualMachineSource,r as getTweenFactor,h as instructions,l as repeatTypeCodes,m as timeOriginSelectorCodes};
2
+ class t{generateSource(t){const o=[];for(let a=1;a<this.length;a++)o.push(`vec4 atom${a} = texture(${t.animationTexture}, (pointer + 0.5) / size);`),o.push("pointer.x += 1.0;");for(let a=0;a<this.ins;a++)o.push("top--;"),o.push(`vec4 in${this.ins-a-1} = stack[top];`);for(let a=0;a<this.outs;a++)o.push(`vec4 out${a};`);const{microcode:e}=this;for(const a of e)o.push(a);for(let a=0;a<this.outs;a++)o.push(`stack[top] = out${a};`),o.push("top++;"),o.push(`if (top >= ${x}) { top = ${x-1}; }`);return o}}let o=128;class e extends t{constructor(){super(...arguments),this.opcode=++o,this.length=1,this.ins=0,this.outs=0,this.microcode=["break;"]}encode(){return[[this.opcode,0,0,0]]}}class a extends t{constructor(){super(...arguments),this.opcode=++o,this.length=1,this.ins=0,this.outs=1,this.microcode=["out0 = vec4(atom0.y, atom0.y, atom0.y, atom0.y);"]}encode(t){return[[this.opcode,t,0,0]]}}class i extends t{constructor(){super(...arguments),this.opcode=++o,this.length=1,this.ins=0,this.outs=1,this.microcode=["out0 = vec4(atom0.yzw, 0.0);"]}encode(t){return[[this.opcode,t[0]||0,t[1]||0,t[2]||0]]}}class n extends t{constructor(){super(...arguments),this.opcode=++o,this.length=2,this.ins=0,this.outs=1,this.microcode=["out0 = atom1;"]}encode(t){return[[this.opcode,0,0,0],t]}}function r(t){return[`float duration = clamp(${t.duration}, 0.05, 3600.0);`,`float startTimeOffset = ${t.startTimeOffset};`,`float repeatDelay = ${t.repeatDelay};`,`float timeOriginSelector = ${t.timeOriginSelector};`,`float easing = ${t.easing};`,`float playAnimation = ${t.playAnimation} * (1.0 - step(0.0, -${t.duration}));`,`float reverseAnimation = ${t.reverseAnimation};`,"float time = globalTime - (timeOriginSelector == 1.0 ? localTimeOrigin : 0.0);","time *= playAnimation;","time *= 1.0 - reverseAnimation * 2.0;","float period = duration + repeatDelay;","time += reverseAnimation == 1.0 ? (period - startTimeOffset - 0.001) : startTimeOffset + 0.001;","float omega = time / period;","float oi = floor(omega);"]}const s=["float of = omega * period;","of = (clamp(of, reverseAnimation * repeatDelay, period - (1.0 - reverseAnimation) * repeatDelay) - reverseAnimation * repeatDelay) / duration;","of = easing == 2.0 ? pow(of, 3.0) : of;","of = easing == 3.0 ? 1.0 - pow(1.0 - of, 3.0) : of;","of = easing == 4.0 ? of < 0.5 ? 4.0 * pow(of, 3.0) : 1.0 - pow(-2.0 * of + 2.0, 3.0) / 2.0 : of;"];function l(t){return[`float repeatType = ${t.repeatType};`,...r(t),"omega = repeatType == 1.0 || repeatType == 3.0 ? omega - oi : omega;",...s,"bool oscillate = repeatType == 3.0 && mod(oi, 2.0) == 1.0;",`${t.out} = oscillate ? 1.0 - of : of;`]}function m(t){return[...r(t),"omega -= oi;",...s,`${t.out} = oi + of;`]}const c={Linear:1,EaseIn:2,EaseOut:3,EaseInOut:4},f={Loop:1,None:2,Oscillate:3},p={Local:1,Global:2};function u(t){const o=c[t.easing],e=f[t.repeatType],a=p[t.timeOriginSelector];return[[t.duration,t.startTimeOffset,t.repeatDelay,a],[e,o,t.playAnimation,t.reverseAnimation]]}class h extends t{constructor(){super(...arguments),this.opcode=++o,this.length=10,this.ins=1,this.outs=1,this.microcode=["vec2 fromTranslation = atom1.xy;","vec2 toTranslation = atom1.zw;","float fromRotation = atom2.x;","float toRotation = atom2.y;","float fromScale = atom2.z;","float toScale = atom2.w;","bool relativeTranslation = atom9.x == 1.0;","bool absoluteScale = atom9.y == 1.0;","bool selectGlobalRotation = atom9.z == 1.0;","vec2 translationMultiplier = relativeTranslation ? pixelDimensions : vec2(1.0, 1.0);","float scaleDivisor = absoluteScale ? pixelDimensions.y : 1.0;","float fTranslation;","{",...l({duration:"atom3.x",startTimeOffset:"atom3.y",repeatDelay:"atom3.z",timeOriginSelector:"atom3.w",repeatType:"atom4.x",easing:"atom4.y",playAnimation:"atom4.z",reverseAnimation:"atom4.w",out:"fTranslation"}),"}","float fRotation;","{",...l({duration:"atom5.x",startTimeOffset:"atom5.y",repeatDelay:"atom5.z",timeOriginSelector:"atom5.w",repeatType:"atom6.x",easing:"atom6.y",playAnimation:"atom6.z",reverseAnimation:"atom6.w",out:"fRotation"}),"}","float fScale;","{",...l({duration:"atom7.x",startTimeOffset:"atom7.y",repeatDelay:"atom7.z",timeOriginSelector:"atom7.w",repeatType:"atom8.x",easing:"atom8.y",playAnimation:"atom8.z",reverseAnimation:"atom8.w",out:"fScale"}),"}","vec2 aTranslation = mix(fromTranslation, toTranslation, fTranslation);","float aRotation = mix(fromRotation, toRotation, fRotation);","float aScale = mix(fromScale, toScale, fScale);","vec2 pTranslation = in0.xy;","float pRotation = in0.z;","float pScale = in0.w;","aTranslation *= translationMultiplier;","aScale /= scaleDivisor;","float rotation = pRotation + aRotation;","\n if (selectGlobalRotation) {\n rotation = globalRotation;\n }\n ","float scale = pScale * aScale;","float sin1 = sin(pRotation);","float cos1 = cos(pRotation);","float s1 = pScale;","float x1 = pTranslation.x;","float y1 = pTranslation.y;","float x2 = aTranslation.x;","float y2 = aTranslation.y;","\n vec2 translation = vec2(\n cos1 * s1 * x2 - sin1 * s1 * y2 + x1,\n sin1 * s1 * x2 + cos1 * s1 * y2 + y1\n );\n ","out0 = vec4(translation, rotation, scale);"]}encode(t){return[[this.opcode,0,0,0],[t.translation.from[0],t.translation.from[1],t.translation.to[0],t.translation.to[1]],[t.rotation.from,t.rotation.to,t.scale.from,t.scale.to],...u(t.translation.timing),...u(t.rotation.timing),...u(t.scale.timing),[t.relativeTranslation?1:0,t.absoluteScale?1:0,t.selectGlobalRotation?1:0,0]]}}class y extends t{constructor(){super(...arguments),this.opcode=++o,this.length=7,this.ins=1,this.outs=1,this.microcode=["float fromOpacity = atom0.y;","float toOpacity = atom0.z;","vec4 fromColor = atom1;","vec4 toColor = atom2;","float fColor;","{",...l({duration:"atom3.x",startTimeOffset:"atom3.y",repeatDelay:"atom3.z",timeOriginSelector:"atom3.w",repeatType:"atom4.x",easing:"atom4.y",playAnimation:"atom4.z",reverseAnimation:"atom4.w",out:"fColor"}),"}","float fOpacity;","{",...l({duration:"atom5.x",startTimeOffset:"atom5.y",repeatDelay:"atom5.z",timeOriginSelector:"atom5.w",repeatType:"atom6.x",easing:"atom6.y",playAnimation:"atom6.z",reverseAnimation:"atom6.w",out:"fOpacity"}),"}","vec4 aColor = mix(fromColor, toColor, fColor);","aColor.a *= mix(fromOpacity, toOpacity, fOpacity);","vec4 pColor = in0;","out0 = aColor * pColor;"]}encode(t){return[[this.opcode,t.opacity.from,t.opacity.to,0],[t.color.from[0],t.color.from[1],t.color.from[2],t.color.from[3]],[t.color.to[0],t.color.to[1],t.color.to[2],t.color.to[3]],...u(t.color.timing),...u(t.opacity.timing)]}}class g extends t{constructor(){super(...arguments),this.opcode=++o,this.length=4,this.ins=1,this.outs=1,this.microcode=["float fromShift = atom0.y;","float toShift = atom0.z;","float duration = atom1.x;","bool multiplyToByLineLength = atom3.x == 1.0;","bool multiplyDurationByLineLength = atom3.y == 1.0;","bool continuous = atom3.z == 1.0;","toShift *= multiplyToByLineLength ? lineLength : 1.0;","duration *= multiplyDurationByLineLength ? lineLength : 1.0;","float fShift;","if (continuous) {",...m({duration:"duration",startTimeOffset:"atom1.y",repeatDelay:"atom1.z",timeOriginSelector:"atom1.w",easing:"atom2.y",playAnimation:"atom2.z",reverseAnimation:"atom2.w",out:"fShift"}),"} else {",...l({duration:"duration",startTimeOffset:"atom1.y",repeatDelay:"atom1.z",timeOriginSelector:"atom1.w",repeatType:"atom2.x",easing:"atom2.y",playAnimation:"atom2.z",reverseAnimation:"atom2.w",out:"fShift"}),"}","float aShift = mix(fromShift, toShift, fShift);","vec4 pShift = in0;","out0 = mod(aShift + pShift, lineLength);"]}encode(t){return[[this.opcode,t.shift.from,t.shift.to,0],...u(t.shift.timing),[t.multiplyToByLineLength?1:0,t.multiplyDurationByLineLength?1:0,t.continuous?1:0,0]]}}const d={scalar:new a,vector3:new i,vector4:new n,animatedTransform:new h,animatedColor:new y,animatedShift:new g,ret:new e},T=40,x=4;function v(t){const o=[];o.push(`float globalTime = ${t.globalTime};`),o.push(`float localTimeOrigin = ${t.localTimeOrigin};`),o.push(`float lineLength = ${t.lineLength};`),o.push(`float globalRotation = ${t.globalRotation};`),o.push(`vec2 pointer = ${t.animationPointer};`),o.push(`vec2 size = ${t.animationTextureSize};`),o.push("int top = 0;"),o.push(`vec4 stack[${x}];`),o.push(`for (int counter = 0; counter < ${T}; counter++) {`),o.push(`vec4 atom0 = texture(${t.animationTexture}, (pointer + 0.5) / size);`),o.push("pointer.x += 1.0;"),o.push(`vec2 pixelDimensions = ${t.pixelDimensions};`),o.push("if (false) {");for(const e in d){const a=d[e];o.push(`} else if (int(atom0.x) == ${a.opcode}) {`);for(const e of a.generateSource(t))o.push(e)}return o.push("} // End if-else."),o.push("} // End for."),o.push(`${t.out} = top > 0 ? stack[top - 1] : vec4(0.0);`),o.join("\n")}export{t as AAnimationInstruction,y as AnimatedColorInstruction,g as AnimatedShiftInstruction,h as AnimatedTransformInstruction,e as RetInstruction,a as ScalarInstruction,i as Vector3Instruction,n as Vector4Instruction,c as easingCodes,v as generateVirtualMachineSource,l as getTweenFactor,m as getUnclampedTweenFactor,d as instructions,f as repeatTypeCodes,p as timeOriginSelectorCodes};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import{__decorate as t}from"tslib";import e from"../../../../core/Accessor.js";import{watch as i,syncAndInitial as s}from"../../../../core/reactiveUtils.js";import{property as o,subclass as n}from"../../../../core/accessorSupport/decorators.js";import{snapshotLineOfSightTargetState as l,restoreLineOfSightTargetState as r}from"./LineOfSightAuthoringUtils.js";import{LineOfSightItemManipulatedObject3D as a}from"./LineOfSightItemManipulatedObject3D.js";import{LineOfSightItemTool as h}from"./LineOfSightItemTool.js";import{discRadiusSmall as c}from"../../interactive/editingTools/manipulations/config.js";import{MoveTool3D as m}from"../../interactive/editingTools/move/MoveTool3D.js";import d from"../../../interactive/options/InteractiveToolOptions.js";let u=class extends e{get visible(){return this._get("visible")??!0}set visible(t){this._set("visible",t),this._itemTool.visible=t,this._moveTool.visible=t}get manipulatorsInteractive(){return this._get("manipulatorsInteractive")??!0}set manipulatorsInteractive(t){this._set("manipulatorsInteractive",t),this._itemTool.manipulatorsInteractive=t}constructor(t){super(t),this._selectedItem=null,this._objectByItem=new Map,this._undoStack=[],this._redoStack=[],this._itemTool=new h({analysisViewData:t.analysisViewData,snappingManager:t.snappingManager,view:t.view}),this._moveTool=new m({enableVisualElements:!1,manipulatorRadius:c,snappingManager:t.snappingManager,toolOptions:new d({tooltips:{enabled:!0}}),view:t.view})}initialize(){this.view.tools.add(this._itemTool),this.view.tools.add(this._moveTool),this._itemTool.visible=this.visible,this._moveTool.visible=this.visible,this._itemTool.manipulatorsInteractive=this.manipulatorsInteractive;const t=t=>{const e=t.at(0);null!=e&&this._itemTool.showInteractionVisuals(e)},e=()=>this._itemTool.hideInteractionVisuals();this.addHandles([i(()=>({observer:this.analysis.observer,targets:this.analysis.targets.toArray()}),({observer:t,targets:e})=>this._syncObjects(t,e),s),this._itemTool.events.on("select-item",({item:t})=>this._setSelectedItem(t)),this._itemTool.events.on("selection-cleared",()=>{if(this._moveTool.hasFocusedManipulators){const t=null==this._selectedItem?null:this._objectByItem.get(this._selectedItem);this._itemTool.selectObject(t)}else this._setSelectedItem(null)}),this._itemTool.events.on("delete-item",({target:t})=>this._deleteTarget(t)),this._itemTool.events.on("record-undo",({record:t})=>this._recordHistory(_([t]))),this._moveTool.events.on("record-undo",({updates:t})=>this._recordHistory(_(t))),this._moveTool.events.on("hold",({objects:e})=>t(e)),this._moveTool.events.on("move-start",({objects:e})=>t(e)),this._moveTool.events.on("move-stop",e),i(()=>this._moveTool.firstGrabbedManipulator,t=>{null==t&&e()})])}destroy(){this.stop(),this.view.tools.remove(this._itemTool),this.view.tools.remove(this._moveTool),this._itemTool.destroy(),this._moveTool.destroy();for(const t of this._objectByItem.values())this.removeHandles(t),t.destroy();this._objectByItem.clear(),this._undoStack.length=0,this._redoStack.length=0}get active(){return this._itemTool.active||this._moveTool.active}get canRedo(){return this._redoStack.length>0}get canUndo(){return this._undoStack.length>0}get hasSelection(){return null!=this._selectedItem}get updating(){return this._itemTool.updating||this._moveTool.updating}get laserLineVisualElement(){return this._itemTool.laserLineVisualElement}get verticalLineVisualElement(){return this._itemTool.verticalLineVisualElement}selectItem(t){return!!this._objectByItem.has(t)&&(this._setSelectedItem(t),!0)}clearSelection(){return!!this.hasSelection&&(this._setSelectedItem(null),!0)}deleteSelectedItem(){const t=this._selectedItem;if(null==t)return!1;const e=this.analysis.targets.find(e=>e===t);return null!=e&&this._deleteTarget(e)}getObserverManipulator(){const t=this.analysis.observer,e=null==t?null:this._itemTool.getManipulator(t);return null!=e&&v(e)?e:null}getTargetManipulator(t){const e=this._itemTool.getManipulator(t);return null!=e&&p(e)?e:null}hasManipulatorAt(t,e){return this._itemTool.hasManipulatorAt(t,e)}redo(){const t=this._redoStack.pop();null!=t&&(t.redo()?(this._undoStack.push(t),this._notifyHistoryChanged()):this._redoStack.push(t))}setEditableFlag(t,e){this._itemTool.setEditableFlag(t,e),this._moveTool.setEditableFlag(t,e)}stop(){this.view.activeTool!==this._itemTool&&this.view.activeTool!==this._moveTool||(this.view.activeTool=null),this._itemTool.hideInteractionVisuals(),this.snappingManager.doneSnapping(),this.clearSelection()}undo(){const t=this._undoStack.pop();null!=t&&(t.undo(),this._redoStack.push(t),this._notifyHistoryChanged())}_syncObjects(t,e){const i=new Set(null==t?e:[t,...e]);for(const[s,o]of this._objectByItem)i.has(s)||(this._selectedItem===s&&this._setSelectedItem(null),this.removeHandles(o),this._itemTool.removeObject(o),this._objectByItem.delete(s),o.destroy());null!=t&&this._ensureObject(t,"observer");for(const s of e)this._ensureObject(s,"target");this._setSelectedItem(this._selectedItem)}_ensureObject(t,e){if(this._objectByItem.has(t))return;const i=new a({analysisViewData:this.analysisViewData,intersector:this.intersector,item:t,itemType:e,view:this.view});this._objectByItem.set(t,i),this._itemTool.addObject(i),this.addHandles(i.on("modified-externally",()=>{this._selectedItem===t&&this._setSelectedItem(t)}),i)}_setSelectedItem(t){const e=null==t?null:this._objectByItem.get(t);this._selectedItem=null==e?null:t,this._itemTool.selectObject(e),this._moveTool.objects.removeAll(),null!=e&&this._moveTool.objects.add(e),this._itemTool.interacting=null!=this._selectedItem}_deleteTarget(t){if(this.analysis.targets.length<=1)return!1;const e=this.analysis.targets.indexOf(t);if(e<0)return!1;const i=l(t),s=this._selectedItem===t;return this.analysis.targets.remove(t),this._recordHistory({undo:()=>{r(i,t),this.analysis.targets.add(t,Math.min(e,this.analysis.targets.length)),s&&this._setSelectedItem(t)},redo:()=>!(this.analysis.targets.includes(t)&&this.analysis.targets.length<=1)&&(this.analysis.targets.remove(t),this._selectedItem===t&&this._setSelectedItem(null),!0)}),!0}_recordHistory(t){this._undoStack.push(t),this._redoStack.length=0,this._notifyHistoryChanged()}_notifyHistoryChanged(){this.notifyChange("canUndo"),this.notifyChange("canRedo")}get testInfo(){return{moveTooltip:this._moveTool.tooltip}}};function _(t){return{undo:()=>{for(let e=t.length-1;e>=0;e--)t[e].undo(null)},redo:()=>{for(const e of t)e.redo(null);return!0}}}function v(t){return"observer"===t.metadata.type}function p(t){return"target"===t.metadata.type}t([o({constructOnly:!0})],u.prototype,"analysisViewData",void 0),t([o({constructOnly:!0})],u.prototype,"analysis",void 0),t([o({constructOnly:!0})],u.prototype,"intersector",void 0),t([o({constructOnly:!0})],u.prototype,"snappingManager",void 0),t([o({constructOnly:!0})],u.prototype,"view",void 0),t([o()],u.prototype,"visible",null),t([o()],u.prototype,"manipulatorsInteractive",null),t([o()],u.prototype,"active",null),t([o()],u.prototype,"canRedo",null),t([o()],u.prototype,"canUndo",null),t([o()],u.prototype,"updating",null),u=t([n("esri.views.3d.analysis.LineOfSight.LineOfSightEditTool")],u);export{u as LineOfSightEditTool};
2
+ import{__decorate as t}from"tslib";import e from"../../../../core/Accessor.js";import{watch as i,syncAndInitial as s}from"../../../../core/reactiveUtils.js";import{property as o,subclass as n}from"../../../../core/accessorSupport/decorators.js";import{snapshotLineOfSightTargetState as l,restoreLineOfSightTargetState as r}from"./LineOfSightAuthoringUtils.js";import{LineOfSightItemManipulatedObject3D as a}from"./LineOfSightItemManipulatedObject3D.js";import{LineOfSightItemTool as h}from"./LineOfSightItemTool.js";import{discRadiusSmall as c}from"../../interactive/editingTools/manipulations/config.js";import{MoveTool3D as m}from"../../interactive/editingTools/move/MoveTool3D.js";import d from"../../../interactive/options/InteractiveToolOptions.js";let u=class extends e{get visible(){return this._get("visible")??!0}set visible(t){this._set("visible",t),this._itemTool.visible=t,this._moveTool.visible=t}get manipulatorsInteractive(){return this._get("manipulatorsInteractive")??!0}set manipulatorsInteractive(t){this._set("manipulatorsInteractive",t),this._itemTool.manipulatorsInteractive=t}constructor(t){super(t),this._selectedItem=null,this._objectByItem=new Map,this._undoStack=[],this._redoStack=[],this._itemTool=new h({analysisViewData:t.analysisViewData,snappingManager:t.snappingManager,view:t.view}),this._moveTool=new m({enableVisualElements:!1,manipulatorRadius:c,snappingManager:t.snappingManager,toolOptions:new d({tooltips:{enabled:!0}}),view:t.view})}initialize(){this.view.tools.add(this._itemTool),this.view.tools.add(this._moveTool),this._itemTool.visible=this.visible,this._moveTool.visible=this.visible,this._itemTool.manipulatorsInteractive=this.manipulatorsInteractive;const t=t=>{const e=t.at(0);null!=e&&this._itemTool.showInteractionVisuals(e)},e=()=>this._itemTool.hideInteractionVisuals();this.addHandles([i(()=>({observer:this.analysis.observer,targets:this.analysis.targets.toArray()}),({observer:t,targets:e})=>this._syncObjects(t,e),s),this._itemTool.events.on("select-item",({item:t})=>this._setSelectedItem(t)),this._itemTool.events.on("selection-cleared",()=>{if(this._moveTool.hasFocusedManipulators){const t=null==this._selectedItem?null:this._objectByItem.get(this._selectedItem);this._itemTool.selectObject(t)}else this._setSelectedItem(null)}),this._itemTool.events.on("delete-item",({target:t})=>this._deleteTarget(t)),this._itemTool.events.on("record-undo",({record:t})=>this._recordHistory(_([t]))),this._moveTool.events.on("record-undo",({updates:t})=>this._recordHistory(_(t))),this._moveTool.events.on("hold",({objects:e})=>t(e)),this._moveTool.events.on("move-start",({objects:e})=>t(e)),this._moveTool.events.on("move-stop",e),i(()=>this._moveTool.firstGrabbedManipulator,t=>{null==t&&e()})])}destroy(){this.stop(),this.view.tools.remove(this._itemTool),this.view.tools.remove(this._moveTool),this._itemTool.destroy(),this._moveTool.destroy();for(const t of this._objectByItem.values())this.removeHandles(t),t.destroy();this._objectByItem.clear(),this._undoStack.length=0,this._redoStack.length=0}get active(){return this._itemTool.active||this._moveTool.active}get canRedo(){return this._redoStack.length>0}get canUndo(){return this._undoStack.length>0}get hasSelection(){return null!=this._selectedItem}get selectedItem(){return this._selectedItem}get updating(){return this._itemTool.updating||this._moveTool.updating}get laserLineVisualElement(){return this._itemTool.laserLineVisualElement}get verticalLineVisualElement(){return this._itemTool.verticalLineVisualElement}selectItem(t){return!!this._objectByItem.has(t)&&(this._setSelectedItem(t),!0)}clearSelection(){return!!this.hasSelection&&(this._setSelectedItem(null),!0)}deleteSelectedItem(){const t=this._selectedItem;if(null==t)return!1;const e=this.analysis.targets.find(e=>e===t);return null!=e&&this._deleteTarget(e)}getObserverManipulator(){const t=this.analysis.observer,e=null==t?null:this._itemTool.getManipulator(t);return null!=e&&v(e)?e:null}getTargetManipulator(t){const e=this._itemTool.getManipulator(t);return null!=e&&p(e)?e:null}hasManipulatorAt(t,e){return this._itemTool.hasManipulatorAt(t,e)}redo(){const t=this._redoStack.pop();null!=t&&(t.redo()?(this._undoStack.push(t),this._notifyHistoryChanged()):this._redoStack.push(t))}setEditableFlag(t,e){this._itemTool.setEditableFlag(t,e),this._moveTool.setEditableFlag(t,e)}stop(){this.view.activeTool!==this._itemTool&&this.view.activeTool!==this._moveTool||(this.view.activeTool=null),this._itemTool.hideInteractionVisuals(),this.snappingManager.doneSnapping(),this.clearSelection()}undo(){const t=this._undoStack.pop();null!=t&&(t.undo(),this._redoStack.push(t),this._notifyHistoryChanged())}_syncObjects(t,e){const i=new Set(null==t?e:[t,...e]);for(const[s,o]of this._objectByItem)i.has(s)||(this._selectedItem===s&&this._setSelectedItem(null),this.removeHandles(o),this._itemTool.removeObject(o),this._objectByItem.delete(s),o.destroy());null!=t&&this._ensureObject(t,"observer");for(const s of e)this._ensureObject(s,"target");this._setSelectedItem(this._selectedItem)}_ensureObject(t,e){if(this._objectByItem.has(t))return;const i=new a({analysisViewData:this.analysisViewData,intersector:this.intersector,item:t,itemType:e,view:this.view});this._objectByItem.set(t,i),this._itemTool.addObject(i),this.addHandles(i.on("modified-externally",()=>{this._selectedItem===t&&this._setSelectedItem(t)}),i)}_setSelectedItem(t){const e=null==t?null:this._objectByItem.get(t);this._selectedItem=null==e?null:t,this._itemTool.selectObject(e),this._moveTool.objects.removeAll(),null!=e&&this._moveTool.objects.add(e),this._itemTool.interacting=null!=this._selectedItem}_deleteTarget(t){if(this.analysis.targets.length<=1)return!1;const e=this.analysis.targets.indexOf(t);if(e<0)return!1;const i=l(t),s=this._selectedItem===t;return this.analysis.targets.remove(t),this._recordHistory({undo:()=>{r(i,t),this.analysis.targets.add(t,Math.min(e,this.analysis.targets.length)),s&&this._setSelectedItem(t)},redo:()=>!(this.analysis.targets.includes(t)&&this.analysis.targets.length<=1)&&(this.analysis.targets.remove(t),this._selectedItem===t&&this._setSelectedItem(null),!0)}),!0}_recordHistory(t){this._undoStack.push(t),this._redoStack.length=0,this._notifyHistoryChanged()}_notifyHistoryChanged(){this.notifyChange("canUndo"),this.notifyChange("canRedo")}get testInfo(){return{moveTooltip:this._moveTool.tooltip}}};function _(t){return{undo:()=>{for(let e=t.length-1;e>=0;e--)t[e].undo(null)},redo:()=>{for(const e of t)e.redo(null);return!0}}}function v(t){return"observer"===t.metadata.type}function p(t){return"target"===t.metadata.type}t([o({constructOnly:!0})],u.prototype,"analysisViewData",void 0),t([o({constructOnly:!0})],u.prototype,"analysis",void 0),t([o({constructOnly:!0})],u.prototype,"intersector",void 0),t([o({constructOnly:!0})],u.prototype,"snappingManager",void 0),t([o({constructOnly:!0})],u.prototype,"view",void 0),t([o()],u.prototype,"visible",null),t([o()],u.prototype,"manipulatorsInteractive",null),t([o()],u.prototype,"_selectedItem",void 0),t([o()],u.prototype,"active",null),t([o()],u.prototype,"canRedo",null),t([o()],u.prototype,"canUndo",null),t([o()],u.prototype,"selectedItem",null),t([o()],u.prototype,"updating",null),u=t([n("esri.views.3d.analysis.LineOfSight.LineOfSightEditTool")],u);export{u as LineOfSightEditTool};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import{__decorate as t}from"tslib";import{EventEmitter as i}from"../../../../core/Evented.js";import{handlesGroup as e}from"../../../../core/handleUtils.js";import{destroyMaybe as n,removeMaybe as o}from"../../../../core/maybe.js";import{initial as a,watch as s}from"../../../../core/reactiveUtils.js";import{property as r,subclass as l}from"../../../../core/accessorSupport/decorators.js";import{UpdatingHandles as p}from"../../../../core/support/UpdatingHandles.js";import c from"../../../../geometry/Point.js";import{create as u,fromPoints as d}from"../../../../geometry/support/lineSegment.js";import{clonePoint as m}from"../../../../layers/graphics/hydratedFeatures.js";import{LineOfSightInteractionVisuals as h}from"./LineOfSightInteractionVisuals.js";import{LineOfSightObserverManipulator as v,LineOfSightTargetManipulator as g,LineOfSightTargetManipulatorState as _,getInteractiveLineOfSightTargetManipulatorState as y}from"./LineOfSightManipulators.js";import{SnappingVisualizer3D as b}from"../../interactive/SnappingVisualizer3D.js";import{screenToMapAtSceneSurface as f}from"../../interactive/editingTools/dragEventPipeline3D.js";import{connectTooltipToManipulatedObject as j}from"../../interactive/editingTools/tooltipUtils3D.js";import{mouseButtons as I}from"../../../input/mouseButtons.js";import{createManipulatorDragEventPipeline as M,dragAtLocation as V,sceneSnappingAtLocation as O}from"../../../interactive/dragEventPipeline.js";import{InteractiveToolBase as w}from"../../../interactive/InteractiveToolBase.js";import S from"../../../interactive/options/InteractiveToolOptions.js";import{SnappingContext as T}from"../../../interactive/snapping/SnappingContext.js";import{createSnapDragEventPipelineStep as B}from"../../../interactive/snapping/SnappingDragPipelineStep.js";import{makeTooltip as R,enterInputModeIfAvailable as H}from"../../../interactive/tooltip/tooltipCommonUtils.js";import{MovePointTooltipInfo as U}from"../../../interactive/tooltip/infos/MovePointTooltipInfo.js";const D=u();let x=class extends w{constructor(t){super(t),this.events=new i,this.automaticManipulatorSelection=!1,this.removeIncompleteOnCancel=!1,this.interacting=!1,this.manipulatorsInteractive=!0,this._objectByItem=new Map,this._manipulatorByObject=new Map,this._updatingHandles=new p,this._toolOptions=new S({tooltips:{enabled:!0}}),this._interactionVisuals=null,this._grabbedManipulator=null,this._moveInteractionManipulator=null,this._tooltipHandle=null,this._tooltipUndoRecord=null,this._tooltipInfo=new U({toolOptions:this._toolOptions,viewType:"3d"})}initialize(){const{view:t}=this;this._tooltip=R(()=>({view:t,options:this._toolOptions.tooltips})),this._interactionVisuals=new h({view:t}),this.addHandles([this._updatingHandles.add(()=>({analysisVisible:this.analysisViewData.visible,computations:this.analysisViewData.computations.toArray().map(t=>({isTargetVisible:t.computationResult.isTargetVisible,isValid:t.computationResult.isValid,target:t.target})),interacting:this.interacting,manipulatorsInteractive:this.manipulatorsInteractive,visible:this.visible}),()=>this._syncManipulators(),a),s(()=>this._grabbedManipulator,t=>{null==t&&this._syncInteractionVisuals()},a)]),this.finishToolCreation()}destroy(){this._disconnectTooltip(),this._tooltip=n(this._tooltip),this._interactionVisuals=n(this._interactionVisuals),this._updatingHandles.destroy(),this._objectByItem.clear(),this._manipulatorByObject.clear(),super.destroy()}get updating(){return this._updatingHandles.updating||this.snappingManager.updating}get laserLineVisualElement(){return this._interactionVisuals?.laserLineVisualElement??null}get verticalLineVisualElement(){return this._interactionVisuals?.verticalLineVisualElement??null}showInteractionVisuals(t){this._moveInteractionManipulator=this._manipulatorByObject.get(t),this._syncInteractionVisuals()}hideInteractionVisuals(){this._moveInteractionManipulator=null,this._syncInteractionVisuals()}addObject(t){if(this._manipulatorByObject.has(t))return;const i="observer"===t.itemType?new v(this.view,{deleting:!1,intersection:null,type:"observer"}):new g(this.view,{deleting:!1,target:t.item,type:"target"});i.cursor="move",this._objectByItem.set(t.item,t),this._manipulatorByObject.set(t,i),this.manipulators.add(i),this.addHandles(this._connectManipulator(t,i),t),this._syncManipulator(t,i)}removeObject(t){const i=this._manipulatorByObject.get(t);null!=i&&(this._grabbedManipulator===i&&(this._grabbedManipulator=null,this._disconnectTooltip()),this.removeHandles(t),this.manipulators.remove(i),i.destroy(),this._objectByItem.delete(t.item),this._manipulatorByObject.delete(t))}getManipulator(t){const i=this._objectByItem.get(t);return null==i?null:this._manipulatorByObject.get(i)}hasManipulatorAt(t,i){for(const e of this._manipulatorByObject.values())if(e.consumesClicks&&null!=e.intersectionDistance(t,i))return!0;return!1}selectObject(t){let i=!1;for(const[e,n]of this._manipulatorByObject){const o=e===t;n.selected=o,i||=o}return i}onInputEvent(t){"hold"===t.type&&this._syncInteractionVisuals(),H(t,this._tooltip)}onManipulatorSelectionChanged(){[...this._manipulatorByObject.values()].some(t=>t.selected)||this.events.emit("selection-cleared")}_connectManipulator(t,i){const n=()=>this._syncManipulator(t,i);return e([t.on("committed",n),t.on("modified-externally",n),i.events.on("immediate-click",e=>{this.events.emit("select-item",{item:t.item}),e.button===I.Right&&"target"===i.metadata.type&&this.events.emit("delete-item",{target:i.metadata.target}),e.stopPropagation()}),i.events.on("grab-changed",({action:e})=>{"start"===e?(this.events.emit("select-item",{item:t.item}),this._grabbedManipulator=i,this._connectTooltip(t)):this._grabbedManipulator===i&&(this._grabbedManipulator=null,this._disconnectTooltip())}),i.events.on("drag",i=>{t.updateDragIntersection(i),"start"===i.action&&this._syncInteractionVisuals()}),i.events.on("location-update",()=>this._syncInteractionVisuals()),this._createDragHandle(t,i)])}_createDragHandle(t,i){return M(i,(e,n,o,a)=>{const s=t.operations;if(null==s)return;let r=null;const{cancelSnapping:l,snappingStep:p}=B({snappingContext:new T({editGeometryOperations:s,elevationInfo:t.elevationInfo,pointer:a,visualizer:new b}),snappingManager:this.snappingManager,updatingHandles:this._updatingHandles,useZ:!0});o.next(t=>(r?.undo(null),r=null,t)).next(l);const u=s.data.allVerticesUnordered.at(0);n.next(i=>("start"===i.action&&(r=t.createUndoRecord()),{...i,snapOrigin:u?.pos})).next(V(this.view,i.elevationAlignedLocation)).next(f(this.view,s.data.geometry,t.elevationInfo,s.data.spatialReference)).next(O(this.view,t.elevationInfo)).next(...p).next(t=>(s.trySetGeometry(m(t.mapEnd,new c),"start"===t.action?0:1),"end"===t.action&&null!=r&&(this.events.emit("record-undo",{record:r}),r=null),t))})}_connectTooltip(t){this._disconnectTooltip(),this._tooltipHandle=j(this._tooltip,t,()=>({activeTooltipInfo:this._tooltipInfo,callbacks:{onBeforeUpdate:()=>this.endDrag(),onMoveStart:()=>{this._tooltipUndoRecord=t.createUndoRecord()},onMove:()=>{},onMoveStop:()=>{null!=this._tooltipUndoRecord&&(this.events.emit("record-undo",{record:this._tooltipUndoRecord}),this._tooltipUndoRecord=null)},onRotateStart:()=>{},onRotate:()=>{},onRotateStop:()=>{},onScaleStart:()=>{},onScale:()=>{},onScaleStop:()=>{}},toolOptions:this._toolOptions}))}_disconnectTooltip(){this._tooltipHandle=o(this._tooltipHandle),this._tooltipUndoRecord=null,this._tooltip.clear()}_syncManipulators(){for(const[t,i]of this._manipulatorByObject)this._syncManipulator(t,i);this._syncInteractionVisuals()}_syncManipulator(t,i){const e=t.origin;if(i.available=this.visible&&t.visible&&null!=e,i.interactive=this.manipulatorsInteractive,null!=e&&(i.elevationAlignedLocation=e),"target"!==t.itemType)return;const n=this.analysisViewData.computations.find(i=>i.target===t.item),o=null!=n&&n.computationResult.isValid?n.computationResult.isTargetVisible?_.visible:_.occluded:_.undefined;i.state=this.interacting?y(o):o}_syncInteractionVisuals(){const t=this._interactionVisuals,i=this._grabbedManipulator??this._moveInteractionManipulator,e=this.active||null!=this._moveInteractionManipulator,n=this.visible&&this.analysisViewData.visible;if(null==t||null==i||!e||!n)return void t?.hide();const o=[...this._manipulatorByObject.entries()].find(([t])=>"observer"===t.itemType)?.[1];if(null==o)return void t.hide();const a=i===o?null:d(o.renderLocation,i.renderLocation,D);t.update({target:i.renderLocation,lineVerticalPlaneSegment:a,visible:!0})}};t([r({constructOnly:!0})],x.prototype,"analysisViewData",void 0),t([r({constructOnly:!0})],x.prototype,"snappingManager",void 0),t([r({constructOnly:!0})],x.prototype,"view",void 0),t([r()],x.prototype,"automaticManipulatorSelection",void 0),t([r()],x.prototype,"removeIncompleteOnCancel",void 0),t([r()],x.prototype,"interacting",void 0),t([r()],x.prototype,"manipulatorsInteractive",void 0),t([r()],x.prototype,"_grabbedManipulator",void 0),t([r()],x.prototype,"updating",null),x=t([l("esri.views.3d.analysis.LineOfSight.LineOfSightItemTool")],x);export{x as LineOfSightItemTool};
2
+ import{__decorate as t}from"tslib";import{EventEmitter as i}from"../../../../core/Evented.js";import{handlesGroup as e}from"../../../../core/handleUtils.js";import{destroyMaybe as n,removeMaybe as o}from"../../../../core/maybe.js";import{initial as s}from"../../../../core/reactiveUtils.js";import{property as a,subclass as r}from"../../../../core/accessorSupport/decorators.js";import{UpdatingHandles as l}from"../../../../core/support/UpdatingHandles.js";import p from"../../../../geometry/Point.js";import{create as c,fromPoints as u}from"../../../../geometry/support/lineSegment.js";import{clonePoint as d}from"../../../../layers/graphics/hydratedFeatures.js";import{LineOfSightInteractionVisuals as h}from"./LineOfSightInteractionVisuals.js";import{LineOfSightObserverManipulator as m,LineOfSightTargetManipulator as v,LineOfSightTargetManipulatorState as g,getInteractiveLineOfSightTargetManipulatorState as _}from"./LineOfSightManipulators.js";import{SnappingVisualizer3D as y}from"../../interactive/SnappingVisualizer3D.js";import{screenToMapAtSceneSurface as b}from"../../interactive/editingTools/dragEventPipeline3D.js";import{connectTooltipToManipulatedObject as f}from"../../interactive/editingTools/tooltipUtils3D.js";import{mouseButtons as j}from"../../../input/mouseButtons.js";import{createManipulatorDragEventPipeline as M,dragAtLocation as V,sceneSnappingAtLocation as I}from"../../../interactive/dragEventPipeline.js";import{InteractiveToolBase as O}from"../../../interactive/InteractiveToolBase.js";import w from"../../../interactive/options/InteractiveToolOptions.js";import{SnappingContext as S}from"../../../interactive/snapping/SnappingContext.js";import{createSnapDragEventPipelineStep as T}from"../../../interactive/snapping/SnappingDragPipelineStep.js";import{makeTooltip as B,enterInputModeIfAvailable as R}from"../../../interactive/tooltip/tooltipCommonUtils.js";import{MovePointTooltipInfo as H}from"../../../interactive/tooltip/infos/MovePointTooltipInfo.js";const U=c();let D=class extends O{constructor(t){super(t),this.events=new i,this.automaticManipulatorSelection=!1,this.removeIncompleteOnCancel=!1,this.interacting=!1,this.manipulatorsInteractive=!0,this._objectByItem=new Map,this._manipulatorByObject=new Map,this._updatingHandles=new l,this._toolOptions=new w({tooltips:{enabled:!0}}),this._interactionVisuals=null,this._grabbedManipulator=null,this._visualsManipulator=null,this._tooltipHandle=null,this._tooltipUndoRecord=null,this._tooltipInfo=new H({toolOptions:this._toolOptions,viewType:"3d"})}initialize(){const{view:t}=this;this._tooltip=B(()=>({view:t,options:this._toolOptions.tooltips})),this._interactionVisuals=new h({view:t}),this.addHandles([this._updatingHandles.add(()=>({analysisVisible:this.analysisViewData.visible,computations:this.analysisViewData.computations.toArray().map(t=>({isTargetVisible:t.computationResult.isTargetVisible,isValid:t.computationResult.isValid,target:t.target})),interacting:this.interacting,manipulatorsInteractive:this.manipulatorsInteractive,visible:this.visible}),()=>this._syncManipulators(),s)]),this.finishToolCreation()}destroy(){this._disconnectTooltip(),this._tooltip=n(this._tooltip),this._interactionVisuals=n(this._interactionVisuals),this._updatingHandles.destroy(),this._objectByItem.clear(),this._manipulatorByObject.clear(),super.destroy()}get updating(){return this._updatingHandles.updating||this.snappingManager.updating}get laserLineVisualElement(){return this._interactionVisuals?.laserLineVisualElement??null}get verticalLineVisualElement(){return this._interactionVisuals?.verticalLineVisualElement??null}showInteractionVisuals(t){this._visualsManipulator=this._manipulatorByObject.get(t),this._syncInteractionVisuals()}hideInteractionVisuals(){this._visualsManipulator=null,this._syncInteractionVisuals()}addObject(t){if(this._manipulatorByObject.has(t))return;const i="observer"===t.itemType?new m(this.view,{deleting:!1,intersection:null,type:"observer"}):new v(this.view,{deleting:!1,target:t.item,type:"target"});i.cursor="move",this._objectByItem.set(t.item,t),this._manipulatorByObject.set(t,i),this.manipulators.add(i),this.addHandles(this._connectManipulator(t,i),t),this._syncManipulator(t,i)}removeObject(t){const i=this._manipulatorByObject.get(t);null!=i&&(this._grabbedManipulator===i&&(this._grabbedManipulator=null,this._disconnectTooltip()),this._visualsManipulator===i&&this.hideInteractionVisuals(),this.removeHandles(t),this.manipulators.remove(i),i.destroy(),this._objectByItem.delete(t.item),this._manipulatorByObject.delete(t))}getManipulator(t){const i=this._objectByItem.get(t);return null==i?null:this._manipulatorByObject.get(i)}hasManipulatorAt(t,i){for(const e of this._manipulatorByObject.values())if(e.consumesClicks&&null!=e.intersectionDistance(t,i))return!0;return!1}selectObject(t){let i=!1;for(const[e,n]of this._manipulatorByObject){const o=e===t;n.selected=o,i||=o}return i}onInputEvent(t){"hold"===t.type&&null!=this._grabbedManipulator&&(this._visualsManipulator=this._grabbedManipulator,this._syncInteractionVisuals()),R(t,this._tooltip)}onManipulatorSelectionChanged(){[...this._manipulatorByObject.values()].some(t=>t.selected)||this.events.emit("selection-cleared")}_connectManipulator(t,i){const n=()=>this._syncManipulator(t,i);return e([t.on("committed",n),t.on("modified-externally",n),i.events.on("immediate-click",e=>{this.events.emit("select-item",{item:t.item}),e.button===j.Right&&"target"===i.metadata.type&&this.events.emit("delete-item",{target:i.metadata.target}),e.stopPropagation()}),i.events.on("grab-changed",({action:e})=>{"start"===e?(this.events.emit("select-item",{item:t.item}),this._grabbedManipulator=i,this._connectTooltip(t)):this._grabbedManipulator===i&&(this._grabbedManipulator=null,this.hideInteractionVisuals(),this._disconnectTooltip())}),i.events.on("drag",i=>{t.updateDragIntersection(i),"start"===i.action&&this.showInteractionVisuals(t)}),i.events.on("location-update",()=>this._syncInteractionVisuals()),this._createDragHandle(t,i)])}_createDragHandle(t,i){return M(i,(e,n,o,s)=>{const a=t.operations;if(null==a)return;let r=null;const{cancelSnapping:l,snappingStep:c}=T({snappingContext:new S({editGeometryOperations:a,elevationInfo:t.elevationInfo,pointer:s,visualizer:new y}),snappingManager:this.snappingManager,updatingHandles:this._updatingHandles,useZ:!0});o.next(t=>(r?.undo(null),r=null,t)).next(l);const u=a.data.allVerticesUnordered.at(0);n.next(i=>("start"===i.action&&(r=t.createUndoRecord()),{...i,snapOrigin:u?.pos})).next(V(this.view,i.elevationAlignedLocation)).next(b(this.view,a.data.geometry,t.elevationInfo,a.data.spatialReference)).next(I(this.view,t.elevationInfo)).next(...c).next(t=>(a.trySetGeometry(d(t.mapEnd,new p),"start"===t.action?0:1),"end"===t.action&&null!=r&&(this.events.emit("record-undo",{record:r}),r=null),t))})}_connectTooltip(t){this._disconnectTooltip(),this._tooltipHandle=f(this._tooltip,t,()=>({activeTooltipInfo:this._tooltipInfo,callbacks:{onBeforeUpdate:()=>this.endDrag(),onMoveStart:()=>{this._tooltipUndoRecord=t.createUndoRecord()},onMove:()=>{},onMoveStop:()=>{null!=this._tooltipUndoRecord&&(this.events.emit("record-undo",{record:this._tooltipUndoRecord}),this._tooltipUndoRecord=null)},onRotateStart:()=>{},onRotate:()=>{},onRotateStop:()=>{},onScaleStart:()=>{},onScale:()=>{},onScaleStop:()=>{}},toolOptions:this._toolOptions}))}_disconnectTooltip(){this._tooltipHandle=o(this._tooltipHandle),this._tooltipUndoRecord=null,this._tooltip.clear()}_syncManipulators(){for(const[t,i]of this._manipulatorByObject)this._syncManipulator(t,i);this._syncInteractionVisuals()}_syncManipulator(t,i){const e=t.origin;if(i.available=this.visible&&t.visible&&null!=e,i.interactive=this.manipulatorsInteractive,null!=e&&(i.elevationAlignedLocation=e),"target"!==t.itemType)return;const n=this.analysisViewData.computations.find(i=>i.target===t.item),o=null!=n&&n.computationResult.isValid?n.computationResult.isTargetVisible?g.visible:g.occluded:g.undefined;i.state=this.interacting?_(o):o}_syncInteractionVisuals(){const t=this._interactionVisuals,i=this._visualsManipulator,e=this.visible&&this.analysisViewData.visible;if(null==t||null==i||!e)return void t?.hide();const n=[...this._manipulatorByObject.entries()].find(([t])=>"observer"===t.itemType)?.[1];if(null==n)return void t.hide();const o=i===n?null:u(n.renderLocation,i.renderLocation,U);t.update({target:i.renderLocation,lineVerticalPlaneSegment:o,visible:!0})}};t([a({constructOnly:!0})],D.prototype,"analysisViewData",void 0),t([a({constructOnly:!0})],D.prototype,"snappingManager",void 0),t([a({constructOnly:!0})],D.prototype,"view",void 0),t([a()],D.prototype,"automaticManipulatorSelection",void 0),t([a()],D.prototype,"removeIncompleteOnCancel",void 0),t([a()],D.prototype,"interacting",void 0),t([a()],D.prototype,"manipulatorsInteractive",void 0),t([a()],D.prototype,"updating",null),D=t([r("esri.views.3d.analysis.LineOfSight.LineOfSightItemTool")],D);export{D as LineOfSightItemTool};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import{__decorate as t}from"tslib";import{makeHandle as e}from"../../../../core/handleUtils.js";import"../../../../core/has.js";import{watch as i,syncAndInitial as o}from"../../../../core/reactiveUtils.js";import{property as s,subclass as n}from"../../../../core/accessorSupport/decorators.js";import a from"../../../../symbols/support/ElevationInfo.js";import{LineOfSightEditTool as l}from"./LineOfSightEditTool.js";import{LineOfSightPlacementController as r}from"./LineOfSightPlacementController.js";import{LineOfSightRayIntersector as c}from"./LineOfSightRayIntersector.js";import{ExclusiveOperationManager as p}from"../../../analysis/ExclusiveOperationManager.js";import{ViewEventPriorities as h}from"../../../input/InputManager.js";import{AnalysisToolBase as d}from"../../../interactive/AnalysisToolBase.js";import{deactivateTool as v}from"../../../interactive/interactiveToolUtils.js";import{sketchKeys as u}from"../../../interactive/keybindings.js";import{acquire as _}from"../../../interactive/snapping/SnappingManagerPool.js";import{setupSnappingToggleHandles as g}from"../../../interactive/snapping/snappingUtils.js";const m={ready:"ready",creating:"creating",created:"created"};let y=class extends d{constructor(t){super(t),this._operationManager=new p,this._syncingActiveTool=!1,this.analysisViewData=null,this.removeIncompleteOnCancel=!1;const{snappingManager:e}=this._snappingManagerResult=_(t.view);this._editIntersector=new c({view:t.view}),this._editTool=new l({analysis:t.analysis,analysisViewData:t.analysisViewData,intersector:this._editIntersector,snappingManager:e,view:t.view}),this._placementController=new r({...t,parent:this,snappingManager:e,shouldPreventVertexAdd:(t,e)=>this._editTool.hasManipulatorAt(t,e)})}get active(){return this._editTool.active||this._placementController.active}get canRedo(){return this._activeUndoRedoComponent?.canRedo??!1}get canUndo(){return this._activeUndoRedoComponent?.canUndo??!1}get state(){return this._placementController.active?m.creating:null!=this.analysis.observer?.position?m.created:m.ready}get cursor(){return this._placementController.active?"crosshair":null}get updating(){return this._editTool.updating||this._placementController.updating}initialize(){g(this),this.addHandles([this._snappingManagerResult,this.view.on("key-down",t=>this._onKeyDown(t),h.WIDGET),i(()=>({editable:this.editable,interactive:this.analysisViewData.interactive,placementActive:this._placementController.active,valid:this.analysis.valid,visible:this.visible}),()=>this._syncActiveTool(),o),i(()=>this.state===m.created,t=>{t?this.finishToolCreation():this._set("created",!1)},o),i(()=>this.analysisViewData.visible,t=>{this.visible=t},o),i(()=>this.editable,t=>{this.analysisViewData.editable=t},o)])}destroy(){this._operationManager.destroy(),this._editTool.stop(),this._placementController.stop(),this._editTool.destroy(),this._placementController.destroy(),this._editIntersector.destroy()}place(t){return this.analysisViewData.interactive=!0,this._operationManager.start("place",async(s,n)=>{const{elevationInfo:a}=t??{},l=a&&"observer"in a?a.observer:a,r=a&&"targets"in a?a.targets:a;this._placementController.observerPlacementElevationInfo=f(l),this._placementController.targetPlacementElevationInfo=f(r);const c=this.analysis.clone();let p=!1,h=!1;const d=()=>{if(h)return;if(h=!0,this.stop(),!this.analysis.valid)return this.analysis.clear(),void s.reject();if(n.aborted||this.analysis.equals(c))return void s.reject();const t=this.analysis.targets.at(-1);null!=t&&this._editTool.selectItem(t),s.resolve({})};s.handles.push(e(()=>this.stop()),i(()=>this._placementController.active,t=>{t?p=!0:p&&d()},o)),this.continue()},t)}activate(){this.view.focus(),this.analysisViewData.interactive=!0,this._syncActiveTool(),this.analysis.valid||this._placementController.active||this.continue()}deactivate(){this.onDeactivate()}continue(){this.analysisViewData.interactive=!0,this._placementController.continue()}stop(){this._placementController.stop(),this._placementController.observerPlacementElevationInfo=null,this._placementController.targetPlacementElevationInfo=null,this._syncActiveTool()}redo(){this._activeUndoRedoComponent?.redo()}undo(){this._activeUndoRedoComponent?.undo()}get testInfo(){}get snappingOptions(){return this._snappingManager.options}set snappingOptions(t){this._snappingManager.options=t}get _snappingManager(){return this._snappingManagerResult.snappingManager}onEditableChange(){this.analysisViewData.editable=this.editable,this._editTool.setEditableFlag(1,!0),this._editTool.setEditableFlag(0,this.editable),this._syncActiveTool()}_hideEditTool(){this._editTool.stop(),this._editTool.visible=!1}_onKeyDown(t){const e=t.key;if(e===u.undo&&this.canUndo)t.stopPropagation(),this.undo();else if(e===u.redo&&this.canRedo)t.stopPropagation(),this.redo();else if(u.delete.includes(e)&&!this.active){this._editTool.deleteSelectedItem()&&t.stopPropagation()}else if(e===u.cancel&&!this.active){this._editTool.clearSelection()&&t.stopPropagation()}}get _activeUndoRedoComponent(){return this.analysisViewData.interactive?this._placementController.active||!this._canActivateEditTool?this._placementController.active?this._placementController:null:this._editTool:null}get _canActivateEditTool(){return this.visible&&this.editable&&this.analysis.valid&&null!=this.analysis.observer?.position}_syncActiveTool(){if(!this._syncingActiveTool){this._syncingActiveTool=!0;try{const t=this.analysisViewData.interactive,e=this._canActivateEditTool;if(this._placementController.visible=this.visible&&t,this._editTool.manipulatorsInteractive=t&&!this._placementController.active,!t)return this._placementController.stop(),this._hideEditTool(),this.analysisViewData.cursorTarget=null,void v(this.view,this);if(!this.visible)return this._editTool.stop(),this._editTool.visible=!0,void v(this.view,this);if(this._placementController.active)return this._editTool.stop(),this._editTool.visible=this.visible,void v(this.view,this);if(!e)return this._hideEditTool(),void v(this.view,this);this._editTool.visible=!0,this.analysisViewData.cursorTarget=null,v(this.view,this)}finally{this._syncingActiveTool=!1}}}};function f(t){if(null==t)return null;const{featureExpressionInfo:e,mode:i,offset:o,unit:s}=t;return new a({featureExpressionInfo:e,mode:i,offset:o,unit:s})}t([s({constructOnly:!0})],y.prototype,"view",void 0),t([s({constructOnly:!0})],y.prototype,"analysis",void 0),t([s({constructOnly:!0})],y.prototype,"analysisViewData",void 0),t([s()],y.prototype,"active",null),t([s()],y.prototype,"canRedo",null),t([s()],y.prototype,"canUndo",null),t([s()],y.prototype,"state",null),t([s()],y.prototype,"cursor",null),t([s()],y.prototype,"updating",null),t([s()],y.prototype,"removeIncompleteOnCancel",void 0),t([s()],y.prototype,"snappingOptions",null),t([s()],y.prototype,"_canActivateEditTool",null),y=t([n("esri.views.3d.analysis.LineOfSight.LineOfSightTool")],y);export{y as LineOfSightTool};
2
+ import{__decorate as t}from"tslib";import{makeHandle as e}from"../../../../core/handleUtils.js";import"../../../../core/has.js";import{watch as i,syncAndInitial as o}from"../../../../core/reactiveUtils.js";import{property as s,subclass as n}from"../../../../core/accessorSupport/decorators.js";import a from"../../../../symbols/support/ElevationInfo.js";import{LineOfSightEditTool as l}from"./LineOfSightEditTool.js";import{LineOfSightPlacementController as r}from"./LineOfSightPlacementController.js";import{LineOfSightRayIntersector as c}from"./LineOfSightRayIntersector.js";import{ExclusiveOperationManager as p}from"../../../analysis/ExclusiveOperationManager.js";import{ViewEventPriorities as h}from"../../../input/InputManager.js";import{AnalysisToolBase as d}from"../../../interactive/AnalysisToolBase.js";import{deactivateTool as v}from"../../../interactive/interactiveToolUtils.js";import{sketchKeys as u}from"../../../interactive/keybindings.js";import{acquire as _}from"../../../interactive/snapping/SnappingManagerPool.js";import{setupSnappingToggleHandles as m}from"../../../interactive/snapping/snappingUtils.js";const g={ready:"ready",creating:"creating",created:"created"};let y=class extends d{constructor(t){super(t),this._operationManager=new p,this._syncingActiveTool=!1,this.analysisViewData=null,this.removeIncompleteOnCancel=!1;const{snappingManager:e}=this._snappingManagerResult=_(t.view);this._editIntersector=new c({view:t.view}),this._editTool=new l({analysis:t.analysis,analysisViewData:t.analysisViewData,intersector:this._editIntersector,snappingManager:e,view:t.view}),this._placementController=new r({...t,parent:this,snappingManager:e,shouldPreventVertexAdd:(t,e)=>this._editTool.hasManipulatorAt(t,e)})}get active(){return this._editTool.active||this._placementController.active}get canRedo(){return this._activeUndoRedoComponent?.canRedo??!1}get canUndo(){return this._activeUndoRedoComponent?.canUndo??!1}get selectedItem(){return this._editTool.selectedItem}get state(){return this._placementController.active?g.creating:null!=this.analysis.observer?.position?g.created:g.ready}get cursor(){return this._placementController.active?"crosshair":null}get updating(){return this._editTool.updating||this._placementController.updating}initialize(){m(this),this.addHandles([this._snappingManagerResult,this.view.on("key-down",t=>this._onKeyDown(t),h.WIDGET),i(()=>({editable:this.editable,interactive:this.analysisViewData.interactive,placementActive:this._placementController.active,valid:this.analysis.valid,visible:this.visible}),()=>this._syncActiveTool(),o),i(()=>this.state===g.created,t=>{t?this.finishToolCreation():this._set("created",!1)},o),i(()=>this.analysisViewData.visible,t=>{this.visible=t},o),i(()=>this.editable,t=>{this.analysisViewData.editable=t},o)])}destroy(){this._operationManager.destroy(),this._editTool.stop(),this._placementController.stop(),this._editTool.destroy(),this._placementController.destroy(),this._editIntersector.destroy()}place(t){return this.analysisViewData.interactive=!0,this._operationManager.start("place",async(s,n)=>{const{elevationInfo:a}=t??{},l=a&&"observer"in a?a.observer:a,r=a&&"targets"in a?a.targets:a;this._placementController.observerPlacementElevationInfo=f(l),this._placementController.targetPlacementElevationInfo=f(r);const c=this.analysis.clone();let p=!1,h=!1;const d=()=>{if(h)return;if(h=!0,this.stop(),!this.analysis.valid)return this.analysis.clear(),void s.reject();if(n.aborted||this.analysis.equals(c))return void s.reject();const t=this.analysis.targets.at(-1);null!=t&&this._editTool.selectItem(t),s.resolve({})};s.handles.push(e(()=>this.stop()),i(()=>this._placementController.active,t=>{t?p=!0:p&&d()},o)),this.continue()},t)}activate(){this.view.focus(),this.analysisViewData.interactive=!0,this._syncActiveTool(),this.analysis.valid||this._placementController.active||this.continue()}deactivate(){this.onDeactivate()}continue(){this.analysisViewData.interactive=!0,this._placementController.continue()}stop(){this._placementController.stop(),this._placementController.observerPlacementElevationInfo=null,this._placementController.targetPlacementElevationInfo=null,this._syncActiveTool()}redo(){this._activeUndoRedoComponent?.redo()}undo(){this._activeUndoRedoComponent?.undo()}get testInfo(){}get snappingOptions(){return this._snappingManager.options}set snappingOptions(t){this._snappingManager.options=t}get _snappingManager(){return this._snappingManagerResult.snappingManager}onEditableChange(){this.analysisViewData.editable=this.editable,this._editTool.setEditableFlag(1,!0),this._editTool.setEditableFlag(0,this.editable),this._syncActiveTool()}_hideEditTool(){this._editTool.stop(),this._editTool.visible=!1}_onKeyDown(t){const e=t.key;if(e===u.undo&&this.canUndo)t.stopPropagation(),this.undo();else if(e===u.redo&&this.canRedo)t.stopPropagation(),this.redo();else if(u.delete.includes(e)&&!this.active){this._editTool.deleteSelectedItem()&&t.stopPropagation()}else if(e===u.cancel&&!this.active){this._editTool.clearSelection()&&t.stopPropagation()}}get _activeUndoRedoComponent(){return this.analysisViewData.interactive?this._placementController.active||!this._canActivateEditTool?this._placementController.active?this._placementController:null:this._editTool:null}get _canActivateEditTool(){return this.visible&&this.editable&&this.analysis.valid&&null!=this.analysis.observer?.position}_syncActiveTool(){if(!this._syncingActiveTool){this._syncingActiveTool=!0;try{const t=this.analysisViewData.interactive,e=this._canActivateEditTool;if(this._placementController.visible=this.visible&&t,this._editTool.manipulatorsInteractive=t&&!this._placementController.active,!t)return this._placementController.stop(),this._hideEditTool(),this.analysisViewData.cursorTarget=null,void v(this.view,this);if(!this.visible)return this._editTool.stop(),this._editTool.visible=!0,void v(this.view,this);if(this._placementController.active)return this._editTool.stop(),this._editTool.visible=this.visible,void v(this.view,this);if(!e)return this._hideEditTool(),void v(this.view,this);this._editTool.visible=!0,this.analysisViewData.cursorTarget=null,v(this.view,this)}finally{this._syncingActiveTool=!1}}}};function f(t){if(null==t)return null;const{featureExpressionInfo:e,mode:i,offset:o,unit:s}=t;return new a({featureExpressionInfo:e,mode:i,offset:o,unit:s})}t([s({constructOnly:!0})],y.prototype,"view",void 0),t([s({constructOnly:!0})],y.prototype,"analysis",void 0),t([s({constructOnly:!0})],y.prototype,"analysisViewData",void 0),t([s()],y.prototype,"active",null),t([s()],y.prototype,"canRedo",null),t([s()],y.prototype,"canUndo",null),t([s()],y.prototype,"selectedItem",null),t([s()],y.prototype,"state",null),t([s()],y.prototype,"cursor",null),t([s()],y.prototype,"updating",null),t([s()],y.prototype,"removeIncompleteOnCancel",void 0),t([s()],y.prototype,"snappingOptions",null),t([s()],y.prototype,"_canActivateEditTool",null),y=t([n("esri.views.3d.analysis.LineOfSight.LineOfSightTool")],y);export{y as LineOfSightTool};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import{__decorate as t}from"tslib";import i from"../../../core/Collection.js";import"../../../core/has.js";import{destroyMaybe as s}from"../../../core/maybe.js";import{property as e,subclass as o}from"../../../core/accessorSupport/decorators.js";import{create as r}from"../../../core/libs/gl-matrix-2/factories/vec3f64.js";import a from"./AnalysisView3D.js";import{LineOfSightController as l}from"./LineOfSight/LineOfSightController.js";import{LineOfSightTool as n}from"./LineOfSight/LineOfSightTool.js";import{LineOfSightVisualization as p}from"./LineOfSight/LineOfSightVisualization.js";import{connectAnalysisViewToTool as y,removeAnalysisViewTool as u}from"../../analysis/analysisViewUtils.js";let h=class extends a{constructor(t){super(t),this.type="line-of-sight-view-3d",this.analysis=null,this.tool=null,this.computations=new i,this.cursorTarget=null,this.editable=!0,this.elevationAlignedObserver=null,this.observerEngineLocation=r()}initialize(){const t=this.view,i=this.analysis;this._analysisController=new l({analysis:i,analysisViewData:this,view:t}),this._analysisVisualization=new p({analysis:i,analysisViewData:this,view:t,isDecoration:!this.parent}),this.addHandles([this._analysisController.on("result-changed",t=>{t.target!==this.cursorTarget&&this.emit("result-changed",t)}),y(this,n)])}destroy(){u(this),this.tool=s(this.tool),this._analysisController=s(this._analysisController),this._analysisVisualization=s(this._analysisVisualization)}get visible(){return super.visible}set visible(t){super.visible=t}get interactive(){return super.interactive}set interactive(t){super.interactive=t}get results(){return this.computations.map(t=>t.result)}get priority(){return this._analysisController.priority}set priority(t){this._analysisController.priority=t}get updating(){return null!=this._analysisController&&this._analysisController.updating||null!=this._analysisVisualization&&this._analysisVisualization.updating}place(t){return this.interactive=!0,this.tool.place(t)}getResultForTarget(t){return this.computations.find(i=>i.target===t)?.result}get testInfo(){}};t([e({readOnly:!0})],h.prototype,"type",void 0),t([e({constructOnly:!0,nonNullable:!0})],h.prototype,"analysis",void 0),t([e()],h.prototype,"tool",void 0),t([e({readOnly:!0})],h.prototype,"results",null),t([e()],h.prototype,"priority",null),t([e()],h.prototype,"computations",void 0),t([e()],h.prototype,"cursorTarget",void 0),t([e()],h.prototype,"editable",void 0),t([e()],h.prototype,"elevationAlignedObserver",void 0),t([e()],h.prototype,"observerEngineLocation",void 0),t([e()],h.prototype,"updating",null),t([e()],h.prototype,"_analysisController",void 0),t([e()],h.prototype,"_analysisVisualization",void 0),h=t([o("esri.views.3d.analysis.LineOfSightAnalysisView3D")],h);const c=h;export{c as default};
2
+ import{__decorate as t}from"tslib";import i from"../../../core/Collection.js";import"../../../core/has.js";import{destroyMaybe as s}from"../../../core/maybe.js";import{property as e,subclass as o}from"../../../core/accessorSupport/decorators.js";import{create as r}from"../../../core/libs/gl-matrix-2/factories/vec3f64.js";import l from"./AnalysisView3D.js";import{LineOfSightController as a}from"./LineOfSight/LineOfSightController.js";import{LineOfSightTool as n}from"./LineOfSight/LineOfSightTool.js";import{LineOfSightVisualization as p}from"./LineOfSight/LineOfSightVisualization.js";import{connectAnalysisViewToTool as u,removeAnalysisViewTool as y}from"../../analysis/analysisViewUtils.js";let h=class extends l{constructor(t){super(t),this.type="line-of-sight-view-3d",this.analysis=null,this.tool=null,this.computations=new i,this.cursorTarget=null,this.editable=!0,this.elevationAlignedObserver=null,this.observerEngineLocation=r()}initialize(){const t=this.view,i=this.analysis;this._analysisController=new a({analysis:i,analysisViewData:this,view:t}),this._analysisVisualization=new p({analysis:i,analysisViewData:this,view:t,isDecoration:!this.parent}),this.addHandles([this._analysisController.on("result-changed",t=>{t.target!==this.cursorTarget&&this.emit("result-changed",t)}),u(this,n)])}destroy(){y(this),this.tool=s(this.tool),this._analysisController=s(this._analysisController),this._analysisVisualization=s(this._analysisVisualization)}get visible(){return super.visible}set visible(t){super.visible=t}get interactive(){return super.interactive}set interactive(t){super.interactive=t}get selectedItem(){return this.tool?.selectedItem}get results(){return this.computations.map(t=>t.result)}get priority(){return this._analysisController.priority}set priority(t){this._analysisController.priority=t}get updating(){return null!=this._analysisController&&this._analysisController.updating||null!=this._analysisVisualization&&this._analysisVisualization.updating}place(t){return this.interactive=!0,this.tool.place(t)}getResultForTarget(t){return this.computations.find(i=>i.target===t)?.result}get testInfo(){}};t([e({readOnly:!0})],h.prototype,"type",void 0),t([e({constructOnly:!0,nonNullable:!0})],h.prototype,"analysis",void 0),t([e()],h.prototype,"tool",void 0),t([e()],h.prototype,"selectedItem",null),t([e({readOnly:!0})],h.prototype,"results",null),t([e()],h.prototype,"priority",null),t([e()],h.prototype,"computations",void 0),t([e()],h.prototype,"cursorTarget",void 0),t([e()],h.prototype,"editable",void 0),t([e()],h.prototype,"elevationAlignedObserver",void 0),t([e()],h.prototype,"observerEngineLocation",void 0),t([e()],h.prototype,"updating",null),t([e()],h.prototype,"_analysisController",void 0),t([e()],h.prototype,"_analysisVisualization",void 0),h=t([o("esri.views.3d.analysis.LineOfSightAnalysisView3D")],h);const c=h;export{c as default};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import{applyAltitudeConstraint as t,getAltitudeConstraintError as o}from"./constraintUtils/altitude.js";import{hasConstraintType as r}from"./constraintUtils/common.js";import{ConstraintOptions as n}from"./constraintUtils/ConstraintOptions.js";import{applyDistanceConstraint as i,getDistanceConstraintError as e}from"./constraintUtils/distance.js";import{applySurfaceCollisionConstraint as s}from"./constraintUtils/surfaceCollision.js";import{applyTiltConstraint as a,getTiltConstraintError as c}from"./constraintUtils/tilt.js";import{inOutCubic as p}from"../../animation/easing.js";function l(t,o,n=U,i=o,e=null){i!==o&&i.copyFrom(o),i.computeUp(t.state.viewingMode);let a=!1;for(let s=0;s<j;s++){let o=0;for(const e of y)if(r(n.selection,e.type)){const r=Math.abs(e.error(t,i,n));e.apply(t,i,n)&&(a=!0,o+=r)}if(0===o)break}e?.copyFrom(i);const c=r(n.selection,8),p=m(n.interactionType,t);return c&&s(t,null,i,p)&&(a=!0),a&&i.computeUp(t.state.viewingMode),a}function m(t,o){switch(t){case 4:case 6:return 1;case 5:return o.state.isGlobal?2:1;default:return 0}}function f(t){const o=Math.min(1,t/150);return p(o)}function u(t,o,r){return c(t,o,r)*o.distance}const y=[{type:1,error:u,apply:a},{type:2,error:o,apply:t},{type:4,error:e,apply:i}],U=new n,j=5;export{l as applyAll,f as pixelDistanceToInteractionFactor};
2
+ import{add as t,subtract as o}from"../../../core/libs/gl-matrix-2/math/vec3.js";import{clone as r,create as e}from"../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{applyAltitudeConstraint as n,getAltitudeConstraintError as i}from"./constraintUtils/altitude.js";import{hasConstraintType as s}from"./constraintUtils/common.js";import{ConstraintOptions as c}from"./constraintUtils/ConstraintOptions.js";import{applyDistanceConstraint as a,getDistanceConstraintError as l}from"./constraintUtils/distance.js";import{applySurfaceCollisionConstraint as p}from"./constraintUtils/surfaceCollision.js";import{applyTiltConstraint as m,getTiltConstraintError as f}from"./constraintUtils/tilt.js";import{inOutCubic as u}from"../../animation/easing.js";function y(t,o,r=h,e=o,n=null){e!==o&&e.copyFrom(o),e.computeUp(t.state.viewingMode);let i=!1;for(let l=0;l<v;l++){let o=0;for(const n of g)if(s(r.selection,n.type)){const s=Math.abs(n.error(t,e,r));n.apply(t,e,r)&&(i=!0,o+=s)}if(0===o)break}n?.copyFrom(e);const c=s(r.selection,8),a=j(r.interactionType,t);return c&&p(t,null,e,a)&&(i=!0),i&&e.computeUp(t.state.viewingMode),i}function j(t,o){switch(t){case 4:case 6:return 1;case 5:return o.state.isGlobal?2:1;default:return 0}}function U(t){const o=Math.min(1,t/150);return u(o)}function d(t,o,r){return f(t,o,r)*o.distance}function b(n,i,s){const c=r(i.eye);y(n,i,s),i.center=t(e(),i.center,o(e(),i.eye,c))}const g=[{type:1,error:d,apply:m},{type:2,error:i,apply:n},{type:4,error:l,apply:a}],h=new c,v=5;export{y as applyAll,b as applyConstraintsAndUpdateCenterRenderCamera,U as pixelDistanceToInteractionFactor};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import{__decorate as t}from"tslib";import{prefersReducedMotion as i}from"../../../../core/a11yUtils.js";import{createScreenPointArray as e,screenPointObjectToArray as r}from"../../../../core/screenUtils.js";import{subclass as o}from"../../../../core/accessorSupport/decorators.js";import{copy as n,distance as s}from"../../../../core/libs/gl-matrix-2/math/vec2.js";import{scaleAndAdd as a,dot as h,crossAndNormalize as m,scale as l,add as p}from"../../../../core/libs/gl-matrix-2/math/vec3.js";import{create as c}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{getReferenceEllipsoid as _}from"../../../../geometry/ellipsoidUtils.js";import{create as d,fromPositionAndNormal as u}from"../../../../geometry/support/plane.js";import{Sphere as g}from"../../../../geometry/support/sphere.js";import{pixelDistanceToInteractionFactor as C,applyAll as P}from"../../camera/constraintUtils.js";import{ConstraintOptions as v}from"../../camera/constraintUtils/ConstraintOptions.js";import{InteractiveController as f}from"./InteractiveController.js";import{GroundNavigationMomentumController as w}from"./momentum/GroundNavigationMomentumController.js";import{groundNavigationConstants as z,findSphereHorizonY as S,computeHorizonPaddingLimits as b,findPlaneHorizonY as j,findGroundNavigationGrabLocation as y}from"../utils/groundNavigationUtils.js";import H from"../../webgl/RenderCamera.js";import{GroundNavigationMomentumEstimator as E}from"../../../navigation/GroundNavigationMomentumEstimator.js";let M=class extends f{constructor(t){super(t),this._validState=!0,this._adjustedScenePoint=c(),this._momentumEstimator=new E,this._referenceSphere=new g,this._referencePlane=d(),this._tmp3d=c(),this._screenPointArray=e(),this._forwardRopeComponent=c(),this._sidewaysRopeComponent=c(),this._ropeTranslation=c(),this._beginScreenPoint=e(),this._screenPickPoint=e(),this._horizonY=null,this._horizonPadding=null,this._ropeScreenHeight=1,this._ropePlane=d(),this._pointerOverHorizonVelocityAdjustment=1,this._pointerCount=0,this._beginCamera=new H,this._constraintOptions=new v(15,6,0,this._beginCamera)}get isGlobalMode(){return 1===this.view.state.viewingMode}get momentumEnabled(){return this.view.navigation.momentumEnabled&&this.view.animationsEnabled&&!i()}begin(t){this.running&&(this._pointerCount=t.pointers.size,r(t.center,this._screenPickPoint),Math.abs(this._screenPickPoint[0]-this.view.width/2)<.1&&(this._screenPickPoint[0]+=1),n(this._beginScreenPoint,this._screenPickPoint),this.startCamera.relativeElevation>z.maxElevation?this._validState=!1:(this._prepareGroundNavigation(),this._beginCamera.copyFrom(this.startCamera)))}update(t){this.running&&this._validState&&(this.currentCamera.copyFrom(this.startCamera),this._panningRopePull(t),this.commitCamera())}end(t){return t.pointers.size===this._pointerCount&&this.update(t),this.finishController(),this.createMomentum()}_initHorizonValues(){this.isGlobalMode?this._globalInitHorizonValues():this._localInitHorizonValues()}_globalInitHorizonValues(){this._referenceSphere.radius=_(this.view.spatialReference).radius,this._horizonY=S(this.startCamera,this._referenceSphere,this._screenPickPoint),this._horizonPadding=null!=this._horizonY?b(this.startCamera,this._horizonY):null}_localInitHorizonValues(){const t=c();this.view.renderCoordsHelper.worldUpAtPosition(this.startCamera.eye,t);const i=c();a(i,this.startCamera.eye,t,-this.startCamera.relativeElevation),u(i,t,this._referencePlane),this._horizonY=j(this.startCamera,this._referencePlane),this._horizonPadding=b(this.startCamera,this._horizonY)}_prepareGroundNavigation(){if(this._initHorizonValues(),!this._horizonY||!this._horizonPadding)return;this._momentumEstimator.reset(),this._ropeScreenHeight=this.startCamera.fullHeight/this.startCamera.pixelRatio;if(!y({view:this.view,originalScreenPoint:this._beginScreenPoint,horizonY:this._horizonY,horizonPadding:this._horizonPadding,outTranslation:this._ropeTranslation,outGrabLocation:this._adjustedScenePoint}))return void(this._validState=!1);const t=c();this.view.renderCoordsHelper.worldUpAtPosition(this.startCamera.eye,t);const i=this.startCamera.viewRight,e=h(this._ropeTranslation,i),r=m(c(),t,i),o=h(this._ropeTranslation,r);l(this._forwardRopeComponent,r,o),l(this._sidewaysRopeComponent,i,e),u(this._adjustedScenePoint,t,this._ropePlane);const n=this._ropeScreenHeight-this._beginScreenPoint[1],s=this._ropeScreenHeight-this._horizonPadding[0];this._pointerOverHorizonVelocityAdjustment=Math.max(n/s,1)}_panningRopePull(t){if(!this._horizonY||!this._horizonPadding)return;const i=r(t.center,this._screenPointArray),e=this.startCamera.fullWidth/this.startCamera.pixelRatio*.5,o=(this._ropeScreenHeight-i[1])/(this._ropeScreenHeight-this._beginScreenPoint[1]),n=1-o,h=(i[0]-e)/(this._beginScreenPoint[0]-e),m=n*z.ySpeedMultiplier*this._pointerOverHorizonVelocityAdjustment,c=(n*z.xSpeedMultiplier+o*((1-h)*z.xSpeedMultiplier))*this._pointerOverHorizonVelocityAdjustment;l(this._ropeTranslation,this._forwardRopeComponent,m),a(this._ropeTranslation,this._ropeTranslation,this._sidewaysRopeComponent,c),this.currentCamera.eye=p(this._tmp3d,this.startCamera.eye,this._ropeTranslation),this.currentCamera.center=p(this._tmp3d,this.startCamera.center,this._ropeTranslation),this.momentumEnabled&&this._momentumEstimator.update(i,this._ropeTranslation,.001*t.timestamp),this._constraintOptions.interactionFactor=C(s(this._beginScreenPoint,i)),this._constraintOptions.interactionDirection=this._ropeTranslation,P(this.view,this.currentCamera,this._constraintOptions),this._constraintOptions.interactionDirection=null}createMomentum(){const t=this.momentumEnabled&&this._momentumEstimator.createMomentum();return t?new w({view:this.view,momentum:t}):null}};M=t([o("esri.views.3d.state.controllers.GroundNavigationController")],M);export{M as GroundNavigationController};
2
+ import{__decorate as t}from"tslib";import{prefersReducedMotion as i}from"../../../../core/a11yUtils.js";import{createScreenPointArray as e,screenPointObjectToArray as r}from"../../../../core/screenUtils.js";import{subclass as o}from"../../../../core/accessorSupport/decorators.js";import{copy as n,distance as s}from"../../../../core/libs/gl-matrix-2/math/vec2.js";import{scaleAndAdd as a,dot as h,crossAndNormalize as m,scale as l,add as c}from"../../../../core/libs/gl-matrix-2/math/vec3.js";import{create as p}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{getReferenceEllipsoid as _}from"../../../../geometry/ellipsoidUtils.js";import{create as d,fromPositionAndNormal as u}from"../../../../geometry/support/plane.js";import{Sphere as g}from"../../../../geometry/support/sphere.js";import{pixelDistanceToInteractionFactor as C}from"../../camera/constraintUtils.js";import{ConstraintOptions as v}from"../../camera/constraintUtils/ConstraintOptions.js";import{InteractiveController as f}from"./InteractiveController.js";import{GroundNavigationMomentumController as P}from"./momentum/GroundNavigationMomentumController.js";import{groundNavigationConstants as w,findSphereHorizonY as z,computeHorizonPaddingLimits as S,findPlaneHorizonY as b,findGroundNavigationGrabLocation as j}from"../utils/groundNavigationUtils.js";import{OffsetCorrectionController as y}from"../utils/OffsetCorrectionController.js";import H from"../../webgl/RenderCamera.js";import{GroundNavigationMomentumEstimator as E}from"../../../navigation/GroundNavigationMomentumEstimator.js";let M=class extends f{constructor(t){super(t),this._drag=null,this._validState=!0,this._adjustedScenePoint=p(),this._momentumEstimator=new E,this._referenceSphere=new g,this._referencePlane=d(),this._tmp3d=p(),this._screenPointArray=e(),this._forwardRopeComponent=p(),this._sidewaysRopeComponent=p(),this._ropeTranslation=p(),this._beginScreenPoint=e(),this._screenPickPoint=e(),this._horizonY=null,this._horizonPadding=null,this._ropeScreenHeight=1,this._ropePlane=d(),this._pointerOverHorizonVelocityAdjustment=1,this._beginCamera=new H,this._constraintOptions=new v(15,6,0,this._beginCamera)}initialize(){this._offsetCorrectionController=new y(this.view)}stepController(t,i){this._drag&&(this.currentCamera.copyFrom(this.startCamera),this._panningRopePull(this._drag,t),i.copyFrom(this.currentCamera),this._drag=null)}get isGlobalMode(){return 1===this.view.state.viewingMode}get momentumEnabled(){return this.view.navigation.momentumEnabled&&this.view.animationsEnabled&&!i()}begin(t){this.running&&(r(t.center,this._screenPickPoint),Math.abs(this._screenPickPoint[0]-this.view.width/2)<.1&&(this._screenPickPoint[0]+=1),n(this._beginScreenPoint,this._screenPickPoint),this.startCamera.relativeElevation>w.maxElevation?this._validState=!1:(this._prepareGroundNavigation(),this._beginCamera.copyFrom(this.startCamera)))}update(t){this.running&&this._validState&&(this._drag=t,this.updateInteractive())}end(t){return this.finishController(),this.createMomentum()}_initHorizonValues(){this.isGlobalMode?this._globalInitHorizonValues():this._localInitHorizonValues()}_globalInitHorizonValues(){this._referenceSphere.radius=_(this.view.spatialReference).radius,this._horizonY=z(this.startCamera,this._referenceSphere,this._screenPickPoint),this._horizonPadding=null!=this._horizonY?S(this.startCamera,this._horizonY):null}_localInitHorizonValues(){const t=p();this.view.renderCoordsHelper.worldUpAtPosition(this.startCamera.eye,t);const i=p();a(i,this.startCamera.eye,t,-this.startCamera.relativeElevation),u(i,t,this._referencePlane),this._horizonY=b(this.startCamera,this._referencePlane),this._horizonPadding=S(this.startCamera,this._horizonY)}_prepareGroundNavigation(){if(this._initHorizonValues(),!this._horizonY||!this._horizonPadding)return;this._momentumEstimator.reset(),this._ropeScreenHeight=this.startCamera.fullHeight/this.startCamera.pixelRatio;if(!j({view:this.view,originalScreenPoint:this._beginScreenPoint,horizonY:this._horizonY,horizonPadding:this._horizonPadding,outTranslation:this._ropeTranslation,outGrabLocation:this._adjustedScenePoint}))return void(this._validState=!1);const t=p();this.view.renderCoordsHelper.worldUpAtPosition(this.startCamera.eye,t);const i=this.startCamera.viewRight,e=h(this._ropeTranslation,i),r=m(p(),t,i),o=h(this._ropeTranslation,r);l(this._forwardRopeComponent,r,o),l(this._sidewaysRopeComponent,i,e),u(this._adjustedScenePoint,t,this._ropePlane);const n=this._ropeScreenHeight-this._beginScreenPoint[1],s=this._ropeScreenHeight-this._horizonPadding[0];this._pointerOverHorizonVelocityAdjustment=Math.max(n/s,1)}_panningRopePull(t,i){if(!this._horizonY||!this._horizonPadding)return;const e=r(t.center,this._screenPointArray),o=this.startCamera.fullWidth/this.startCamera.pixelRatio*.5,n=(this._ropeScreenHeight-e[1])/(this._ropeScreenHeight-this._beginScreenPoint[1]),h=1-n,m=(e[0]-o)/(this._beginScreenPoint[0]-o),p=h*w.ySpeedMultiplier*this._pointerOverHorizonVelocityAdjustment,_=(h*w.xSpeedMultiplier+n*((1-m)*w.xSpeedMultiplier))*this._pointerOverHorizonVelocityAdjustment;l(this._ropeTranslation,this._forwardRopeComponent,p),a(this._ropeTranslation,this._ropeTranslation,this._sidewaysRopeComponent,_),this.currentCamera.eye=c(this._tmp3d,this.startCamera.eye,this._ropeTranslation),this.currentCamera.center=c(this._tmp3d,this.startCamera.center,this._ropeTranslation),this.momentumEnabled&&this._momentumEstimator.update(e,this._ropeTranslation,.001*t.timestamp),this._constraintOptions.interactionFactor=C(s(this._beginScreenPoint,e)),this._constraintOptions.interactionDirection=this._ropeTranslation,this._offsetCorrectionController.smoothlyCorrectGroundElevation(this.currentCamera,i,this._constraintOptions),this._constraintOptions.interactionDirection=null}createMomentum(){const t=this.momentumEnabled&&this._momentumEstimator.createMomentum();return t?new P({view:this.view,momentum:t}):null}};M=t([o("esri.views.3d.state.controllers.GroundNavigationController")],M);export{M as GroundNavigationController};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import{__decorate as t}from"tslib";import{clock as e}from"../../../../core/clock.js";import{Seconds as r}from"../../../../core/time.js";import{property as i,subclass as o}from"../../../../core/accessorSupport/decorators.js";import{interactingTimeout as a}from"../ViewStateManager.js";import{CameraController as s}from"./CameraController.js";import n from"../../webgl/RenderCamera.js";let m=class extends s{constructor(){super(...arguments),this.startCamera=new n,this.currentCamera=new n,this._isInteractive=!1,this._interactingTimeoutHandle=void 0}get isInteractive(){return this._isInteractive}stepController(t,e){e.copyViewFrom(this.currentCamera),this.currentCamera.copyFrom(e)}onControllerStart(t){this.state=2,this.startCamera.copyFrom(t),this.currentCamera.copyFrom(t)}onControllerEnd(t){t.copyViewFrom(this.currentCamera)}commitCamera(){this._isInteractive=!0,this._interactingTimeoutHandle?.remove(),this._interactingTimeoutHandle=e.setTimeout(()=>{this._isInteractive=!1,this._interactingTimeoutHandle=void 0},a),this.view.state.updateCamera(t=>this.stepController(r(0),t))}};t([i({readOnly:!0})],m.prototype,"isInteractive",null),t([i()],m.prototype,"_isInteractive",void 0),m=t([o("esri.views.3d.state.controllers.InteractiveController")],m);export{m as InteractiveController};
2
+ import{__decorate as t}from"tslib";import{clock as e}from"../../../../core/clock.js";import{Seconds as r}from"../../../../core/time.js";import{property as i,subclass as o}from"../../../../core/accessorSupport/decorators.js";import{interactingTimeout as a}from"../ViewStateManager.js";import{CameraController as s}from"./CameraController.js";import n from"../../webgl/RenderCamera.js";let m=class extends s{constructor(){super(...arguments),this.startCamera=new n,this.currentCamera=new n,this._isInteractive=!1,this._interactingTimeoutHandle=void 0}get isInteractive(){return this._isInteractive}stepController(t,e){e.copyViewFrom(this.currentCamera),this.currentCamera.copyFrom(e)}onControllerStart(t){this.state=2,this.startCamera.copyFrom(t),this.currentCamera.copyFrom(t)}onControllerEnd(t){t.copyViewFrom(this.currentCamera)}commitCamera(){this.updateInteractive(),this.view.state.updateCamera(t=>this.stepController(r(0),t))}updateInteractive(){this._isInteractive=!0,this._interactingTimeoutHandle?.remove(),this._interactingTimeoutHandle=e.setTimeout(()=>{this._isInteractive=!1,this._interactingTimeoutHandle=void 0},a)}};t([i({readOnly:!0})],m.prototype,"isInteractive",null),t([i()],m.prototype,"_isInteractive",void 0),m=t([o("esri.views.3d.state.controllers.InteractiveController")],m);export{m as InteractiveController};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import{__decorate as t}from"tslib";import{property as o,subclass as e}from"../../../../../core/accessorSupport/decorators.js";import{scale as r,add as m}from"../../../../../core/libs/gl-matrix-2/math/vec3.js";import{create as i}from"../../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{MomentumController as n}from"./MomentumController.js";let s=class extends n{constructor(t){super(t),this.interactionType=6,this._tmpPan=i()}momentumStep(t,o){const e=this.momentum.value(t);r(this._tmpPan,this.momentum.direction,e),o.eye=m(c,o.eye,this._tmpPan),o.center=m(c,o.center,this._tmpPan),this.constraintOptions.interactionDirection=this._tmpPan}};t([o({constructOnly:!0})],s.prototype,"momentum",void 0),s=t([e("esri.views.3d.state.controllers.momentum.GroundNavigationMomentumController")],s);const c=i();export{s as GroundNavigationMomentumController};
2
+ import{__decorate as t}from"tslib";import{Seconds as o}from"../../../../../core/time.js";import{property as r,subclass as e}from"../../../../../core/accessorSupport/decorators.js";import{scale as i,add as n}from"../../../../../core/libs/gl-matrix-2/math/vec3.js";import{create as s}from"../../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{MomentumController as m}from"./MomentumController.js";import{OffsetCorrectionController as c}from"../../utils/OffsetCorrectionController.js";const a=.01;let l=class extends m{constructor(t){super(t),this.interactionType=6,this._tmpPan=s(),this._lastUpdateTime=0,this._remainingGroundCorrection=0}initialize(){this._offsetCorrectionController=new c(this.view)}momentumStep(t,r){const e=this.momentum.value(t);i(this._tmpPan,this.momentum.direction,e),r.eye=n(p,r.eye,this._tmpPan),r.center=n(p,r.center,this._tmpPan);const s=o(t-this._lastUpdateTime);this.constraintOptions.interactionDirection=this._tmpPan,this._remainingGroundCorrection=this._offsetCorrectionController.smoothlyCorrectGroundElevation(r,s),this._lastUpdateTime=t}get finished(){return super.finished&&this._remainingGroundCorrection<=a}};t([r({constructOnly:!0})],l.prototype,"momentum",void 0),l=t([e("esri.views.3d.state.controllers.momentum.GroundNavigationMomentumController")],l);const p=s();export{l as GroundNavigationMomentumController};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import{__decorate as t}from"tslib";import{Seconds as i}from"../../../../../core/time.js";import{subclass as e}from"../../../../../core/accessorSupport/decorators.js";import o from"../../../../ViewAnimation.js";import{applyAll as r}from"../../../camera/constraintUtils.js";import{ConstraintOptions as s}from"../../../camera/constraintUtils/ConstraintOptions.js";import{AnimationController as n}from"../AnimationController.js";import m from"../../../webgl/RenderCamera.js";let a=class extends n{constructor(){super(...arguments),this._beginCamera=new m,this._elapsedTime=i(0),this.constraintOptions=new s(15,4,0,this._beginCamera)}initialize(){this.constraintOptions.interactionType=this.interactionType,this.viewAnimation=new o}onControllerStart(t){this._beginCamera.copyFrom(t),super.onControllerStart(t)}stepController(t,e){e.copyViewFrom(this._beginCamera),this._elapsedTime=i(this._elapsedTime+t),this.momentumStep(this._elapsedTime,e),r(this.view,e,this.constraintOptions),this.momentum.isFinished(this._elapsedTime)&&this.finishController()}};a=t([e("esri.views.3d.state.controllers.momentum.MomentumController")],a);export{a as MomentumController};
2
+ import{__decorate as t}from"tslib";import{Seconds as i}from"../../../../../core/time.js";import{subclass as e}from"../../../../../core/accessorSupport/decorators.js";import o from"../../../../ViewAnimation.js";import{applyAll as r}from"../../../camera/constraintUtils.js";import{ConstraintOptions as s}from"../../../camera/constraintUtils/ConstraintOptions.js";import{AnimationController as n}from"../AnimationController.js";import m from"../../../webgl/RenderCamera.js";let a=class extends n{constructor(){super(...arguments),this._beginCamera=new m,this._elapsedTime=i(0),this.constraintOptions=new s(15,4,0,this._beginCamera)}initialize(){this.constraintOptions.interactionType=this.interactionType,this.viewAnimation=new o}onControllerStart(t){this._beginCamera.copyFrom(t),super.onControllerStart(t)}stepController(t,e){e.copyViewFrom(this._beginCamera),this._elapsedTime=i(this._elapsedTime+t),this.momentumStep(this._elapsedTime,e),r(this.view,e,this.constraintOptions),this.finished&&this.finishController()}get finished(){return this.momentum.isFinished(this._elapsedTime)}};a=t([e("esri.views.3d.state.controllers.momentum.MomentumController")],a);export{a as MomentumController};
@@ -0,0 +1,2 @@
1
+ /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
+ import{clamp as t}from"../../../../core/mathUtils.js";import{dot as e,distance as i,subtract as r,scale as s,add as n,copy as o,normalize as a,cross as m,scaleAndAdd as c}from"../../../../core/libs/gl-matrix-2/math/vec3.js";import{create as p,clone as h}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{create as _}from"../../../../geometry/support/ray.js";import{applyConstraintsAndUpdateCenterRenderCamera as d}from"../../camera/constraintUtils.js";import{Intersector as u}from"../../webgl-engine/lib/Intersector.js";const l=.5,y=1e-5,f=5;class v{constructor(t){this._view=t,this._tmpRay=_(),this._tmpWorldUp=p(),this._tmpScaledUp=p(),this._tmpCorrectionOffset=p(),this._tmpUpdatedCameraPos=p(),this._tmpCenterDiff=p(),this._tmpMovementDelta=p(),this._tmpPerpendicularMovementDelta=p(),this._tmpGroundIntersections=[p(),p(),p()],this._tmpGroundIntersectionHits=[!1,!1,!1],this._tmpRayOrigins=[p(),p(),p()],this._tmpRayDirection=p(),this._previousCameraPosition=null,this._intersector=new u(this._view.state.viewingMode)}smoothlyCorrectGroundElevation(t,i,r,s){const n=this._prepareMode(s);if(!n)return 0;const o=this._view.renderCoordsHelper.worldUpAtPosition(t.eye,this._tmpWorldUp),a=this._prepareCameraAndPreviousIterationPosition(t,o,this._previousCameraPosition),m=this._prepareRays(t,o,a),c=this._intersectRays(n,o,m);if(!c.hasIntersection){const e=this._adjustCameraElevation(t,o,0,r);return this._previousCameraPosition=h(e),0}const p=this._filterRayResults(o,a,c),_=this._getSmoothedElevationCorrection(n,p,t,o,a,i),d=this._adjustCameraElevation(t,o,_,r);return this._previousCameraPosition=h(d),Math.abs(p-e(d,o))}immediatelyCorrectGroundElevation(t,s=Number.POSITIVE_INFINITY,n,o){const a=this._prepareMode(o);if(!a)return;const m=this._view.renderCoordsHelper.worldUpAtPosition(t.eye,this._tmpWorldUp),c=this._prepareRays(t,m),p=this._intersectRays(a,m,c),h=p.intersections[0];!p.hasIntersection||i(t.eye,h)>s?this._adjustCameraElevation(t,m,0,n):this._adjustCameraElevation(t,m,e(m,r(this._tmpCorrectionOffset,h,t.eye)),n)}_prepareMode(t){const e=t??this._view.navigation.mode;return"ground"===e.type&&e.offset?e:null}_prepareCameraAndPreviousIterationPosition(t,i,r){if(r){const o=e(i,t.eye),a=e(i,r);return s(this._tmpCorrectionOffset,i,a-o),t.eye=n(this._tmpUpdatedCameraPos,t.eye,this._tmpCorrectionOffset),t.center=n(this._tmpUpdatedCameraPos,t.center,this._tmpCorrectionOffset),r}return t.eye}_prepareRays(t,e,i){const r=s(this._tmpRayDirection,e,-1e5);if(o(this._tmpRayOrigins[0],t.eye),!i)return{origins:this._tmpRayOrigins,direction:r,count:1};const{forwardMovementDirection:n,rightMovementDirection:a}=this._getMovementDirections(t.eye,i,e);return this._getLeftRayOrigin(t.eye,n,a,this._tmpRayOrigins[1]),this._getRightRayOrigin(t.eye,n,a,this._tmpRayOrigins[2]),{origins:this._tmpRayOrigins,direction:r,count:this._tmpRayOrigins.length}}_getMovementDirections(t,i,n){const o=r(this._tmpMovementDelta,t,i);r(o,o,s(this._tmpScaledUp,n,e(n,o))),a(o,o);return{forwardMovementDirection:o,rightMovementDirection:m(this._tmpPerpendicularMovementDelta,o,n)}}_getLeftRayOrigin(t,e,i,r){return c(r,t,e,l),c(r,r,i,-l),r}_getRightRayOrigin(t,e,i,r){return c(r,t,e,l),c(r,r,i,l),r}_intersectRays(t,e,i){const r=t.offset,s=this._view.sceneIntersectionHelper,n=g(t);o(this._tmpRay.direction,i.direction);for(let m=0;m<i.count;m++)o(this._tmpRay.origin,i.origins[m]),this._tmpGroundIntersectionHits[m]=s.intersectRay(this._tmpRay,this._intersector,this._tmpGroundIntersections[m],n),this._tmpGroundIntersectionHits[m]&&c(this._tmpGroundIntersections[m],this._tmpGroundIntersections[m],e,r);const a=this._tmpGroundIntersectionHits.some((t,e)=>e<i.count&&t);return{intersections:this._tmpGroundIntersections,hits:this._tmpGroundIntersectionHits,count:i.count,hasIntersection:a}}_filterRayResults(t,i,r){const s=e(i,t);let n=null;for(let o=0;o<r.count;o++){if(!r.hits[o])continue;const i=r.intersections[o],a=e(i,t);(null==n||Math.abs(a-s)<Math.abs(n-s))&&(n=a)}return n}_getSmoothedElevationCorrection(i,r,s,n,o,a){const m=y**a,c=e(o,n)*m+r*(1-m),p=e(s.eye,n),h=f*a*(i.offset??0);return t(c-p,-h,h)}_adjustCameraElevation(t,e,i,s){return 0!==i&&(c(this._tmpUpdatedCameraPos,t.eye,e,i),r(this._tmpCenterDiff,t.center,t.eye),t.eye=this._tmpUpdatedCameraPos,t.center=n(this._tmpUpdatedCameraPos,this._tmpUpdatedCameraPos,this._tmpCenterDiff)),d(this._view,t,s),t.eye}}function g(t){const e=C(t.include)?t.include:void 0,i=C(t.exclude)?t.exclude:void 0;return e||i?{include:e,exclude:i}:void 0}function C(t){return null!=t&&t.size>0}export{v as OffsetCorrectionController};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- function n(n){return 5===n||6===n||7===n}function r(r){return n(r)||8===r||9===r}function t(n){return d(n)||4===n}function u(n){return t(n)||r(n)}function e(n){return 10===n||11===n}function o(n){return p(n)||e(n)}function c(n){return 1===n}function f(n){return 2===n}function i(n){return c(n)||f(n)}function p(n){return 0===n||i(n)}function x(n){return 10===n}function a(n){return p(n)||11===n}function b(n){return p(n)||e(n)}function d(n){return b(n)||g(n)}function g(n){return 3===n}export{o as is2DGeometryOutput,t as is3DGeometry,u as is3DGeometryOrShadowLike,p as isColor,d as isColorHighlightOLIDOrDepth,b as isColorHighlightOrOLID,a as isColorOrOLID,g as isDepth,x as isHighlight,e as isHighlightOrOLID,i as isOIT,c as isOITColorAlpha,f as isOITFrontFace,n as isShadow,r as isShadowLike};
2
+ function n(n){return 5===n||6===n||7===n}function r(r){return n(r)||8===r||9===r}function t(n){return g(n)||u(n)}function u(n){return 4===n}function e(n){return t(n)||r(n)}function o(n){return 10===n||11===n}function c(n){return x(n)||o(n)}function f(n){return 1===n}function i(n){return 2===n}function p(n){return f(n)||i(n)}function x(n){return 0===n||p(n)}function a(n){return 10===n}function b(n){return x(n)||11===n}function d(n){return x(n)||o(n)}function g(n){return d(n)||h(n)}function h(n){return 3===n}export{c as is2DGeometryOutput,t as is3DGeometry,e as is3DGeometryOrShadowLike,x as isColor,g as isColorHighlightOLIDOrDepth,d as isColorHighlightOrOLID,b as isColorOrOLID,h as isDepth,a as isHighlight,o as isHighlightOrOLID,u as isNormals,p as isOIT,f as isOITColorAlpha,i as isOITFrontFace,n as isShadow,r as isShadowLike};
@@ -1,10 +1,10 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import{glsl as e}from"../../shaderModules/glsl.js";function n(n,{spherical:c}){n.code.add(c?"vec3 getLocalUp(in vec3 pos, in vec3 origin) { return normalize(pos + origin); }\n vec3 getLocalUp(in vec3 pos) { return normalize(pos); }":"vec3 getLocalUp(in vec3 pos, in vec3 origin) { return vec3(0.0, 0.0, 1.0); }\n vec3 getLocalUp(in vec3 pos) { return vec3(0.0, 0.0, 1.0); }"),c?n.code.add(e`mat3 getTBNMatrix(in vec3 n) {
2
+ import{glsl as e}from"../../shaderModules/glsl.js";function c(c,{spherical:r}){c.code.add("vec3 normalize4(vec4 vector){ return normalize(vector.xyz / vector.w); }"),c.code.add(r?"vec3 getLocalUp(in vec3 pos, in vec3 origin) { return normalize(pos + origin); }\n vec3 getLocalUp(in vec3 pos) { return normalize(pos); }":"vec3 getLocalUp(in vec3 pos, in vec3 origin) { return vec3(0.0, 0.0, 1.0); }\n vec3 getLocalUp(in vec3 pos) { return vec3(0.0, 0.0, 1.0); }"),r?c.code.add(e`mat3 getTBNMatrix(in vec3 n) {
3
3
  vec3 t = normalize(cross(vec3(0.0, 0.0, 1.0), n));
4
4
  vec3 b = normalize(cross(n, t));
5
5
  return mat3(t, b, n);
6
- }`):n.code.add(e`mat3 getTBNMatrix(in vec3 n) {
6
+ }`):c.code.add(e`mat3 getTBNMatrix(in vec3 n) {
7
7
  vec3 t = vec3(1.0, 0.0, 0.0);
8
8
  vec3 b = normalize(cross(n, t));
9
9
  return mat3(t, b, n);
10
- }`)}export{n as NormalUtils};
10
+ }`)}export{c as NormalUtils};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import"../../../../core/Error.js";import"../core/shaderLibrary/ShaderOutput.js";import"../core/shaderLibrary/Slice.glsl.js";import"../core/shaderLibrary/Transform.glsl.js";import"../core/shaderLibrary/attributes/ObjectAndLayerIdColor.glsl.js";import"../core/shaderLibrary/output/OutputHighlight.glsl.js";import"../core/shaderLibrary/shading/MainLighting.glsl.js";import"../core/shaderLibrary/shading/NormalUtils.glsl.js";import"../core/shaderLibrary/shading/ReadShadowMap.glsl.js";import"../core/shaderLibrary/shading/WaterColor.glsl.js";import"../core/shaderLibrary/shading/WaterDistortion.glsl.js";import"../core/shaderLibrary/util/ColorConversion.glsl.js";import"../core/shaderLibrary/util/View.glsl.js";import"../core/shaderModules/Float4PassUniform.js";import"../core/shaderModules/FloatPassUniform.js";import"../core/shaderModules/glsl.js";import"../shaders/OutputColorHighlightOLID.glsl.js";import"../../../webgl/ShaderBuilder.js";import"../../../../webscene/support/AlphaCutoff.js";export{b as build}from"../../../../chunks/Water.glsl.js";
2
+ import"../../../../core/Error.js";import"../core/shaderLibrary/Slice.glsl.js";import"../core/shaderLibrary/Transform.glsl.js";import"../core/shaderLibrary/attributes/ObjectAndLayerIdColor.glsl.js";import"../core/shaderLibrary/output/OutputHighlight.glsl.js";import"../core/shaderLibrary/shading/MainLighting.glsl.js";import"../core/shaderLibrary/shading/NormalUtils.glsl.js";import"../core/shaderLibrary/shading/ReadShadowMap.glsl.js";import"../core/shaderLibrary/shading/WaterColor.glsl.js";import"../core/shaderLibrary/shading/WaterDistortion.glsl.js";import"../core/shaderLibrary/util/cameraUniforms.js";import"../core/shaderLibrary/util/ColorConversion.glsl.js";import"../core/shaderLibrary/util/View.glsl.js";import"../core/shaderModules/Float4PassUniform.js";import"../core/shaderModules/FloatPassUniform.js";import"../core/shaderModules/glsl.js";import"../shaders/OutputColorHighlightOLID.glsl.js";import"../../../webgl/ShaderBuilder.js";import"../../../../webscene/support/AlphaCutoff.js";export{b as build}from"../../../../chunks/Water.glsl.js";
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import"../../../../core/has.js";import{secondsFromMilliseconds as t}from"../../../../core/time.js";import{fromValues as e}from"../../../../core/libs/gl-matrix-2/factories/vec2f64.js";import{create as r}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{fromValues as i}from"../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{is3DGeometry as a,isColor as s}from"../core/shaderLibrary/ShaderOutput.js";import{olidEnabled as o}from"../effects/geometry/olidUtils.js";import{DefaultBufferWriter as n}from"./DefaultBufferWriter.js";import{PositionUvf32OlidLayout as h,PositionUvf32Layout as c}from"./DefaultLayouts.js";import{TriangleMaterialParameters as p,TriangleMaterial as m}from"./TriangleMaterial.js";import{WaterGLMaterial as f}from"./WaterGLMaterial.js";import{WaterTechniqueConfiguration as l}from"./WaterTechniqueConfiguration.js";import{hasShadowHighlights as u}from"../shaders/ReceiveShadowsConfiguration.js";class d extends m{constructor(t,e){super(t,g),this.visible=!0,this.produces=new Map([[2,t=>a(t)&&!this.transparent],[4,t=>a(t)&&this.transparent],[18,t=>this.parameters.draped&&a(t)],[19,t=>4===t]]),this._configuration=new l(e.spherical)}updateConfiguration(t){super.updateConfiguration(t),this._configuration.writeDepth=!0,this._configuration.receiveShadows=s(t.output)&&t.shadowMap.enabled,this._configuration.hasShadowHighlights=u(this._configuration,t),this._configuration.hasSlicePlane=this.parameters.hasSlicePlane,this._configuration.screenSpaceReflections=t.hasScreenSpaceReflections,this._configuration.cloudReflections=null!=t.clouds.data,this._configuration.draped=this.parameters.draped}update(e){return this.setParameters({timeElapsed:t(e.time)*this.parameters.animationSpeed},!1),this._animationEnabled(e.camera)&&e.dt>0}_animationEnabled(t){const e=Math.min(t.relativeElevation,t.distance);return Math.sqrt(this.parameters.waveTextureRepeat/this.parameters.waveStrength)*e<w}get transparent(){return this.parameters.transparent}createGLMaterial(t){return new f(t)}createBufferWriter(){return new n(o()?h:c)}get test(){}}class g extends p{constructor(){super(...arguments),this.waveStrength=.06,this.waveTextureRepeat=32,this.waveDirection=e(1,0),this.waveVelocity=.05,this.flowStrength=.015,this.flowOffset=-.5,this.animationSpeed=.35,this.timeElapsed=0,this.color=i(0,0,0,0),this.transparent=!0,this.hasSlicePlane=!1,this.draped=!1,this.origin=r(),this.modelTransformation=null}}const w=35e3;export{g as Parameters,d as WaterMaterial};
2
+ import"../../../../core/has.js";import{secondsFromMilliseconds as t}from"../../../../core/time.js";import{fromValues as e}from"../../../../core/libs/gl-matrix-2/factories/vec2f64.js";import{create as r}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{fromValues as i}from"../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{is3DGeometry as a,isColor as s,isNormals as o}from"../core/shaderLibrary/ShaderOutput.js";import{olidEnabled as n}from"../effects/geometry/olidUtils.js";import{DefaultBufferWriter as h}from"./DefaultBufferWriter.js";import{PositionUvf32OlidLayout as c,PositionUvf32Layout as p}from"./DefaultLayouts.js";import{TriangleMaterialParameters as m,TriangleMaterial as l}from"./TriangleMaterial.js";import{WaterGLMaterial as f}from"./WaterGLMaterial.js";import{WaterTechniqueConfiguration as u}from"./WaterTechniqueConfiguration.js";import{hasShadowHighlights as d}from"../shaders/ReceiveShadowsConfiguration.js";class g extends l{constructor(t,e){super(t,w),this.visible=!0,this.produces=new Map([[2,t=>a(t)&&!this.transparent],[4,t=>a(t)&&this.transparent],[18,t=>this.parameters.draped&&a(t)],[19,t=>4===t]]),this._configuration=new u(e.spherical)}updateConfiguration(t){super.updateConfiguration(t),this._configuration.receiveShadows=s(t.output)&&t.shadowMap.enabled,this._configuration.hasShadowHighlights=d(this._configuration,t),this._configuration.hasSlicePlane=this.parameters.hasSlicePlane,this._configuration.screenSpaceReflections=t.hasScreenSpaceReflections,this._configuration.cloudReflections=null!=t.clouds.data,this._configuration.draped=this.parameters.draped,this._configuration.drapedNormals=o(t.output)&&19===t.slot}update(e){return this.setParameters({timeElapsed:t(e.time)*this.parameters.animationSpeed},!1),this._animationEnabled(e.camera)&&e.dt>0}_animationEnabled(t){const e=Math.min(t.relativeElevation,t.distance);return Math.sqrt(this.parameters.waveTextureRepeat/this.parameters.waveStrength)*e<S}get transparent(){return this.parameters.transparent}createGLMaterial(t){return new f(t)}createBufferWriter(){return new h(n()?c:p)}get test(){}}class w extends m{constructor(){super(...arguments),this.waveStrength=.06,this.waveTextureRepeat=32,this.waveDirection=e(1,0),this.waveVelocity=.05,this.flowStrength=.015,this.flowOffset=-.5,this.animationSpeed=.35,this.timeElapsed=0,this.color=i(0,0,0,0),this.transparent=!0,this.hasSlicePlane=!1,this.draped=!1,this.origin=r(),this.modelTransformation=null}}const S=35e3;export{w as Parameters,g as WaterMaterial};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import{__decorate as e}from"tslib";import{parameter as t}from"../core/shaderTechnique/ShaderTechniqueConfiguration.js";import{TriangleTechniqueConfiguration as i}from"./TriangleTechniqueConfiguration.js";class o extends i{constructor(e){super(),this.spherical=e,this.receiveGlobalIllumination=!1,this.receiveShadows=!1,this.hasShadowHighlights=!1,this.writeDepth=!1,this.screenSpaceReflections=!1,this.cloudReflections=!1,this.draped=!1,this.textureCoordinateType=0,this.emissionSource=0,this.pbrMode=3,this.occlusionPass=!1,this.useCustomDTRExponentForWater=!0,this.rayMarchMaxReach=1,this.rayMarchMaxSteps=150,this.useProjectedRayLength=!1,this.clampRayToScreen=!0,this.useFillLights=!1,this.overlayEnabled=!1,this.snowCover=!1,this.renderOccluded=!1}}e([t()],o.prototype,"receiveGlobalIllumination",void 0),e([t()],o.prototype,"receiveShadows",void 0),e([t()],o.prototype,"hasShadowHighlights",void 0),e([t()],o.prototype,"writeDepth",void 0),e([t()],o.prototype,"screenSpaceReflections",void 0),e([t()],o.prototype,"cloudReflections",void 0),e([t()],o.prototype,"draped",void 0);export{o as WaterTechniqueConfiguration};
2
+ import{__decorate as e}from"tslib";import{parameter as o}from"../core/shaderTechnique/ShaderTechniqueConfiguration.js";import{TriangleTechniqueConfiguration as i}from"./TriangleTechniqueConfiguration.js";class t extends i{constructor(e){super(),this.spherical=e,this.receiveGlobalIllumination=!1,this.receiveShadows=!1,this.hasShadowHighlights=!1,this.screenSpaceReflections=!1,this.cloudReflections=!1,this.draped=!1,this.drapedNormals=!1,this.textureCoordinateType=0,this.emissionSource=0,this.pbrMode=3,this.occlusionPass=!1,this.useCustomDTRExponentForWater=!0,this.rayMarchMaxReach=1,this.rayMarchMaxSteps=150,this.useProjectedRayLength=!1,this.clampRayToScreen=!0,this.useFillLights=!1,this.overlayEnabled=!1,this.snowCover=!1,this.renderOccluded=!1}}e([o()],t.prototype,"receiveGlobalIllumination",void 0),e([o()],t.prototype,"receiveShadows",void 0),e([o()],t.prototype,"hasShadowHighlights",void 0),e([o()],t.prototype,"screenSpaceReflections",void 0),e([o()],t.prototype,"cloudReflections",void 0),e([o()],t.prototype,"draped",void 0),e([o()],t.prototype,"drapedNormals",void 0);export{t as WaterTechniqueConfiguration};
@@ -86,10 +86,9 @@ export type MeasurementWidget = AreaMeasurement | DistanceMeasurement;
86
86
  * - all three distances (direct, horizontal, and vertical), areas, and perimeters are computed in
87
87
  * a Euclidean manner (in their respective PCS).
88
88
  *
89
- * @deprecated since version 5.0. Use the [Area Measurement 2D](https://developers.arcgis.com/javascript/latest/references/map-components/components/arcgis-area-measurement-2d/), [Area Measurement 3D](https://developers.arcgis.com/javascript/latest/references/map-components/components/arcgis-area-measurement-3d/), [Direct Line Measurement 3D](https://developers.arcgis.com/javascript/latest/references/map-components/components/arcgis-direct-line-measurement-3d/), or [Distance Measurement 2D](https://developers.arcgis.com/javascript/latest/references/map-components/components/arcgis-distance-measurement-2d/) components instead. For information on widget deprecation, read about [Esri's move to web components](https://developers.arcgis.com/javascript/latest/components-transition-plan/).
89
+ * @deprecated since version 5.0. Use the [Exploratory Analysis](https://developers.arcgis.com/javascript/latest/references/map-components/components/arcgis-exploratory-analysis/) component instead. For information on widget deprecation, read about [Esri's move to web components](https://developers.arcgis.com/javascript/latest/components-transition-plan/).
90
90
  * @since 4.13
91
91
  * @see [MeasurementViewModel](https://developers.arcgis.com/javascript/latest/references/core/widgets/Measurement/MeasurementViewModel/)
92
- * @see [Sample - Measurement widget](https://developers.arcgis.com/javascript/latest/sample-code/widgets-measurement/)
93
92
  * @see [DefaultUI](https://developers.arcgis.com/javascript/latest/references/core/views/ui/DefaultUI/)
94
93
  * @see [AreaMeasurement2D](https://developers.arcgis.com/javascript/latest/references/core/widgets/AreaMeasurement2D/)
95
94
  * @see [DistanceMeasurement2D](https://developers.arcgis.com/javascript/latest/references/core/widgets/DistanceMeasurement2D/)
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import{__decorate as e}from"tslib";import{deprecatedModule as t}from"../core/deprecate.js";import i from"../core/Logger.js";import{ignoreAbortErrors as s}from"../core/promiseUtils.js";import{watch as r}from"../core/reactiveUtils.js";import{property as n,subclass as a}from"../core/accessorSupport/decorators.js";import o from"./Widget.js";import l from"./Measurement/MeasurementViewModel.js";import{messageBundle as d,tsx as u}from"./support/widget.js";const c={base:"esri-measurement"};function g(e){return"esri.widgets.AreaMeasurement2D"===e?.declaredClass||"esri.widgets.AreaMeasurement3D"===e?.declaredClass}let w=class extends o{constructor(e,s){super(e,s),this._widgets=new Map,this.activeWidget=null,this.messages=null,this.viewModel=new l,t(i.getLogger("esri.widgets.Measurement"),"esri.widgets.Measurement",{replacement:"Measurement components - Area Measurement 2D, Distance Measurement 2D, Area Measurement 3D, Direct Line Measurement 3D",version:"5.0",see:"https://www.esriurl.com/components-transition-plan/",warnOnce:!0})}initialize(){this.activeWidget&&this.viewModel.set("activeViewModel",this.activeWidget.viewModel),this.view&&this.activeTool&&this._getActiveWidget().then(e=>{this._set("activeWidget",e)}),this.addHandles([r(()=>[this.view,this.activeTool],async()=>{this._set("activeWidget",await this._getActiveWidget())}),r(()=>this.activeWidget,(e,t)=>{this.viewModel.set("activeViewModel",e?e.viewModel:null),t&&(t.visible=!1)}),r(()=>[this.areaUnit,this.linearUnit,this.uiStrings],()=>this._updateSubWidgetProperties())])}destroy(){this._destroyWidgets()}get activeTool(){return this.viewModel.activeTool}set activeTool(e){this.viewModel.activeTool=e}get areaUnit(){return this.viewModel.areaUnit}set areaUnit(e){this.viewModel.areaUnit=e}get icon(){return"measure"}set icon(e){this._overrideIfSome("icon",e)}get label(){return this.messages?.widgetLabel??""}set label(e){this._overrideIfSome("label",e)}get linearUnit(){return this.viewModel.linearUnit}set linearUnit(e){this.viewModel.linearUnit=e}get view(){return this.viewModel.view}set view(e){this.viewModel.view=e}render(){const{activeWidget:e}=this,t=e&&!e.destroyed?e.render():null;return u("div",{class:c.base},t)}clear(){this.activeTool=null,this._destroyWidgets()}startMeasurement(){const{activeViewModel:e}=this.viewModel;e&&s(e.start())}async _createWidget(e){const{areaUnit:t,linearUnit:i,view:s}=this;if(!s)return null;switch(e){case"area":{const{type:i}=s;switch(i){case"2d":return new(0,(await(import("./AreaMeasurement2D.js"))).default)({view:s,unit:t,uiStrings:this._createUIStringsForWidget(e)});case"3d":return new(0,(await(import("./AreaMeasurement3D.js"))).default)({view:s,unit:t,uiStrings:this._createUIStringsForWidget(e)});default:return null}}case"distance":{const{type:t}=s;if("2d"===t){return new(0,(await(import("./DistanceMeasurement2D.js"))).default)({view:s,unit:i,uiStrings:this._createUIStringsForWidget(e)})}return null}case"direct-line":{const{type:t}=s;if("3d"===t){return new(0,(await(import("./DirectLineMeasurement3D.js"))).default)({view:s,unit:i,uiStrings:this._createUIStringsForWidget(e)})}return null}default:return null}}_destroyWidgets(){this._widgets.forEach(e=>e.destroy()),this._widgets.clear()}async _getActiveWidget(){const{activeTool:e,view:t}=this;if(!t||!e)return null;let i=null;if(this._widgets.has(e))i=this._widgets.get(e),i.visible=!0;else{if(i=await this._createWidget(e),!i)return null;await i.viewModel.start(),this._widgets.set(e,i)}return i}_createUIStringsForWidget(e){if(!this.uiStrings)return;const t=e+"-"+this.view?.type;return this.uiStrings[t]}_updateSubWidgetProperties(){this._widgets.forEach((e,t)=>{const{areaUnit:i,linearUnit:s}=this;e.unit=g(e)?i:s,e.uiStrings=this._createUIStringsForWidget(t)})}};e([n()],w.prototype,"activeTool",null),e([n({readOnly:!0})],w.prototype,"activeWidget",void 0),e([n()],w.prototype,"areaUnit",null),e([n()],w.prototype,"icon",null),e([n()],w.prototype,"label",null),e([n()],w.prototype,"linearUnit",null),e([n(),d("esri/widgets/Measurement/t9n/Measurement")],w.prototype,"messages",void 0),e([n()],w.prototype,"uiStrings",void 0),e([n()],w.prototype,"view",null),e([n({type:l})],w.prototype,"viewModel",void 0),w=e([a("esri.widgets.Measurement")],w);const v=w;export{v as default};
2
+ import{__decorate as e}from"tslib";import{deprecateWidget as t}from"../core/deprecate.js";import i from"../core/Logger.js";import{ignoreAbortErrors as s}from"../core/promiseUtils.js";import{watch as r}from"../core/reactiveUtils.js";import{property as a,subclass as o}from"../core/accessorSupport/decorators.js";import n from"./Widget.js";import l from"./Measurement/MeasurementViewModel.js";import{messageBundle as d,tsx as u}from"./support/widget.js";const c={base:"esri-measurement"};function g(e){return"esri.widgets.AreaMeasurement2D"===e?.declaredClass||"esri.widgets.AreaMeasurement3D"===e?.declaredClass}let v=class extends n{constructor(e,s){super(e,s),this._widgets=new Map,this.activeWidget=null,this.messages=null,this.viewModel=new l,t(i.getLogger(this),"Exploratory Analysis","arcgis-exploratory-analysis",{version:"5.0"})}initialize(){this.activeWidget&&this.viewModel.set("activeViewModel",this.activeWidget.viewModel),this.view&&this.activeTool&&this._getActiveWidget().then(e=>{this._set("activeWidget",e)}),this.addHandles([r(()=>[this.view,this.activeTool],async()=>{this._set("activeWidget",await this._getActiveWidget())}),r(()=>this.activeWidget,(e,t)=>{this.viewModel.set("activeViewModel",e?e.viewModel:null),t&&(t.visible=!1)}),r(()=>[this.areaUnit,this.linearUnit,this.uiStrings],()=>this._updateSubWidgetProperties())])}destroy(){this._destroyWidgets()}get activeTool(){return this.viewModel.activeTool}set activeTool(e){this.viewModel.activeTool=e}get areaUnit(){return this.viewModel.areaUnit}set areaUnit(e){this.viewModel.areaUnit=e}get icon(){return"measure"}set icon(e){this._overrideIfSome("icon",e)}get label(){return this.messages?.widgetLabel??""}set label(e){this._overrideIfSome("label",e)}get linearUnit(){return this.viewModel.linearUnit}set linearUnit(e){this.viewModel.linearUnit=e}get view(){return this.viewModel.view}set view(e){this.viewModel.view=e}render(){const{activeWidget:e}=this,t=e&&!e.destroyed?e.render():null;return u("div",{class:c.base},t)}clear(){this.activeTool=null,this._destroyWidgets()}startMeasurement(){const{activeViewModel:e}=this.viewModel;e&&s(e.start())}async _createWidget(e){const{areaUnit:t,linearUnit:i,view:s}=this;if(!s)return null;switch(e){case"area":{const{type:i}=s;switch(i){case"2d":return new(0,(await(import("./AreaMeasurement2D.js"))).default)({view:s,unit:t,uiStrings:this._createUIStringsForWidget(e)});case"3d":return new(0,(await(import("./AreaMeasurement3D.js"))).default)({view:s,unit:t,uiStrings:this._createUIStringsForWidget(e)});default:return null}}case"distance":{const{type:t}=s;if("2d"===t){return new(0,(await(import("./DistanceMeasurement2D.js"))).default)({view:s,unit:i,uiStrings:this._createUIStringsForWidget(e)})}return null}case"direct-line":{const{type:t}=s;if("3d"===t){return new(0,(await(import("./DirectLineMeasurement3D.js"))).default)({view:s,unit:i,uiStrings:this._createUIStringsForWidget(e)})}return null}default:return null}}_destroyWidgets(){this._widgets.forEach(e=>e.destroy()),this._widgets.clear()}async _getActiveWidget(){const{activeTool:e,view:t}=this;if(!t||!e)return null;let i=null;if(this._widgets.has(e))i=this._widgets.get(e),i.visible=!0;else{if(i=await this._createWidget(e),!i)return null;await i.viewModel.start(),this._widgets.set(e,i)}return i}_createUIStringsForWidget(e){if(!this.uiStrings)return;const t=e+"-"+this.view?.type;return this.uiStrings[t]}_updateSubWidgetProperties(){this._widgets.forEach((e,t)=>{const{areaUnit:i,linearUnit:s}=this;e.unit=g(e)?i:s,e.uiStrings=this._createUIStringsForWidget(t)})}};e([a()],v.prototype,"activeTool",null),e([a({readOnly:!0})],v.prototype,"activeWidget",void 0),e([a()],v.prototype,"areaUnit",null),e([a()],v.prototype,"icon",null),e([a()],v.prototype,"label",null),e([a()],v.prototype,"linearUnit",null),e([a(),d("esri/widgets/Measurement/t9n/Measurement")],v.prototype,"messages",void 0),e([a()],v.prototype,"uiStrings",void 0),e([a()],v.prototype,"view",null),e([a({type:l})],v.prototype,"viewModel",void 0),v=e([o("esri.widgets.Measurement")],v);const h=v;export{h as default};