@reearth/core 0.0.7-alpha.12 → 0.0.7-alpha.14
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/core.js +114 -99
- package/dist/core.umd.cjs +4 -4
- package/dist/index.d.ts +2 -0
- package/package.json +1 -1
- package/src/Map/types/viewerProperty.ts +2 -0
- package/src/engines/Cesium/common.ts +8 -9
- package/src/engines/Cesium/core/labels/JapanGSIOptimalBVmapVectorMapLabel/JapanGSIOptimalBVmapLabelImagery.tsx +8 -1
- package/src/engines/Cesium/core/labels/JapanGSIOptimalBVmapVectorMapLabel/JapanGSIOptimalBVmapVectorMapLabel.tsx +14 -2
- package/src/engines/Cesium/core/labels/LabelImageryLayers.tsx +10 -1
- package/src/utils/image.ts +1 -11
package/dist/core.umd.cjs
CHANGED
|
@@ -24,7 +24,7 @@ Check the render method of \``+yu+"`."}return""}}function Kf(yu){return""}var Uf
|
|
|
24
24
|
|
|
25
25
|
Check the top-level render call using <`+df+">.")}return lf}}function jm(yu,lf){{if(!yu._store||yu._store.validated||yu.key!=null)return;yu._store.validated=!0;var df=$m(lf);if(Uf[df])return;Uf[df]=!0;var _f="";yu&&yu._owner&&yu._owner!==vm.current&&(_f=" It was passed a child from "+pi(yu._owner.type)+"."),Sf(yu),Ee('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.',df,_f),Sf(null)}}function ip(yu,lf){{if(typeof yu!="object")return;if(cf(yu))for(var df=0;df<yu.length;df++){var _f=yu[df];Nf(_f)&&jm(_f,lf)}else if(Nf(yu))yu._store&&(yu._store.validated=!0);else if(yu){var Df=nt(yu);if(typeof Df=="function"&&Df!==yu.entries)for(var Ff=Df.call(yu),Af;!(Af=Ff.next()).done;)Nf(Af.value)&&jm(Af.value,lf)}}}function rp(yu){{var lf=yu.type;if(lf==null||typeof lf=="string")return;var df;if(typeof lf=="function")df=lf.propTypes;else if(typeof lf=="object"&&(lf.$$typeof===y||lf.$$typeof===F))df=lf.propTypes;else return;if(df){var _f=pi(lf);ff(df,yu.props,"prop",_f,yu)}else if(lf.PropTypes!==void 0&&!Gf){Gf=!0;var Df=pi(lf);Ee("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",Df||"Unknown")}typeof lf.getDefaultProps=="function"&&!lf.getDefaultProps.isReactClassApproved&&Ee("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.")}}function ep(yu){{for(var lf=Object.keys(yu.props),df=0;df<lf.length;df++){var _f=lf[df];if(_f!=="children"&&_f!=="key"){Sf(yu),Ee("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",_f),Sf(null);break}}yu.ref!==null&&(Sf(yu),Ee("Invalid attribute `ref` supplied to `React.Fragment`."),Sf(null))}}function Qm(yu,lf,df,_f,Df,Ff){{var Af=ms(yu);if(!Af){var If="";(yu===void 0||typeof yu=="object"&&yu!==null&&Object.keys(yu).length===0)&&(If+=" You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");var Pm=Kf();Pm?If+=Pm:If+=qf();var Wf;yu===null?Wf="null":cf(yu)?Wf="array":yu!==void 0&&yu.$$typeof===n?(Wf="<"+(pi(yu.type)||"Unknown")+" />",If=" Did you accidentally export a JSX literal instead of a component?"):Wf=typeof yu,Ee("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",Wf,If)}var Hf=Am(yu,lf,df,Df,Ff);if(Hf==null)return Hf;if(Af){var Dm=lf.children;if(Dm!==void 0)if(_f)if(cf(Dm)){for(var vp=0;vp<Dm.length;vp++)ip(Dm[vp],yu);Object.freeze&&Object.freeze(Dm)}else Ee("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else ip(Dm,yu)}return yu===s?ep(Hf):rp(Hf),Hf}}function tp(yu,lf,df){return Qm(yu,lf,df,!0)}function op(yu,lf,df){return Qm(yu,lf,df,!1)}var yp=op,mp=tp;reactJsxRuntime_development.Fragment=s,reactJsxRuntime_development.jsx=yp,reactJsxRuntime_development.jsxs=mp}()),reactJsxRuntime_development}process.env.NODE_ENV==="production"?jsxRuntime$1.exports=requireReactJsxRuntime_production_min():jsxRuntime$1.exports=requireReactJsxRuntime_development();var jsxRuntimeExports=jsxRuntime$1.exports;const FEATURE_FLAGS={CAMERA_MOVE:1,CAMERA_ZOOM:2,CAMERA_TILT:4,CAMERA_LOOK:8,SINGLE_SELECTION:16,MULTIPLE_SELECTION:32,SKETCH:64},INTERACTION_MODES={default:FEATURE_FLAGS.CAMERA_MOVE|FEATURE_FLAGS.CAMERA_ZOOM|FEATURE_FLAGS.CAMERA_LOOK|FEATURE_FLAGS.CAMERA_TILT|FEATURE_FLAGS.SINGLE_SELECTION,move:FEATURE_FLAGS.CAMERA_MOVE|FEATURE_FLAGS.CAMERA_ZOOM|FEATURE_FLAGS.CAMERA_LOOK|FEATURE_FLAGS.CAMERA_TILT,selection:FEATURE_FLAGS.SINGLE_SELECTION|FEATURE_FLAGS.MULTIPLE_SELECTION|FEATURE_FLAGS.CAMERA_ZOOM|FEATURE_FLAGS.CAMERA_TILT,sketch:FEATURE_FLAGS.SKETCH|FEATURE_FLAGS.CAMERA_ZOOM|FEATURE_FLAGS.CAMERA_TILT};function useGet(t){const n=React.useRef(t);return n.current=t,React.useCallback(()=>n.current,[])}function wrapRef(t,n){return Object.fromEntries(Object.keys(n).map(o=>[o,(...s)=>{var c,d;return(d=(c=t.current)==null?void 0:c[o])==null?void 0:d.call(c,...s)}]))}const engineRefKeys={captureScreen:1,changeSceneMode:1,changeSpeed:1,changeTime:1,enableScreenSpaceCameraController:1,flyTo:1,flyToGround:1,getCamera:1,getCameraFovInfo:1,getClock:1,getLocationFromScreen:1,sampleTerrainHeight:1,computeGlobeHeight:1,getGlobeHeight:1,toXYZ:1,toLngLatHeight:1,convertScreenToPositionOffset:1,isPositionVisible:1,setView:1,toWindowPosition:1,getViewport:1,flyToBBox:1,rotateOnCenter:1,overrideScreenSpaceController:1,lookAt:1,lookAtLayer:1,lookHorizontal:1,lookVertical:1,moveBackward:1,moveDown:1,moveForward:1,moveLeft:1,moveOverTerrain:1,moveRight:1,moveUp:1,onClick:1,onDoubleClick:1,onMiddleClick:1,onMiddleDown:1,onMiddleUp:1,onMouseDown:1,onMouseEnter:1,onMouseLeave:1,onMouseMove:1,onMouseUp:1,onRightClick:1,onRightDown:1,onRightUp:1,onWheel:1,orbit:1,pause:1,play:1,requestRender:1,rotateRight:1,tick:1,zoomIn:1,zoomOut:1,changeStart:1,changeStop:1,inViewport:1,onTick:1,removeTickEventListener:1,findFeaturesByIds:1,findFeatureById:1,findComputedFeatureById:1,findComputedFeaturesByIds:1,selectFeatures:1,unselectFeatures:1,pickManyFromViewport:1,getExtrudedHeight:1,getSurfaceDistance:1,equalsEpsilon2d:1,equalsEpsilon3d:1,createGeometry:1,setCursor:1,bringToFront:1,sendToBack:1},layersRefKeys={add:1,addAll:1,deleteLayer:1,find:1,findAll:1,findById:1,findByIds:1,findByTagLabels:1,findByTags:1,hide:1,isLayer:1,isComputedLayer:1,layers:1,override:1,replace:1,select:1,selectFeature:1,selectFeatures:1,selectedLayer:1,selectedFeature:1,show:1,walk:1,overriddenLayers:1},sketchRefKeys={getType:1,setType:1,getOptions:1,overrideOptions:1};function mapRef({engineRef:t,layersRef:n,sketchRef:o,timelineManagerRef:s}){return{engine:wrapRef(t,engineRefKeys),layers:wrapRef(n,layersRefKeys),sketch:wrapRef(o,sketchRefKeys),timeline:s}}var escapeStringRegexp=t=>{if(typeof t!="string")throw new TypeError("Expected a string");return t.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")};const escapeStringRegexp$1=getDefaultExportFromCjs(escapeStringRegexp);class StringMatcher{constructor(){Vf(this,"commands",[])}concat(...n){const o=new StringMatcher;return o.commands.push(...this.commands),n.forEach(s=>{o.commands.push(...s.commands)}),o}static match(n,o,s=!1){const c=Array.isArray(o)?new RegExp(o.map(h=>escapeStringRegexp$1(h)).join("\\s*"),"g"):new RegExp(escapeStringRegexp$1(o),"g"),d=[...n.matchAll(c)].filter(h=>h.index!=null);if(d==null||d.length===0)throw new Error(`No matching codes found for: "${o}"`);if(!s&&d.length>1)throw new Error(`Multiple codes found for: "${o}"`);return d}replace(n,o,s=!1){return this.commands.push(c=>{const d=StringMatcher.match(c,n,s),h=[0,...d.flatMap(y=>[y.index,y.index+y[0].length]),c.length],p=[];return h.reduce((y,E,L)=>(p.push(d[(L-2)/2]!=null?o:c.slice(y,E)),E),0),p.join("")}),this}insertBefore(n,o,s){return this.commands.push(c=>{const d=StringMatcher.match(c,n,s),h=[0,...d.flatMap(y=>[y.index,y.index+y[0].length]),c.length],p=[];return h.reduce((y,E,L)=>{const F=c.slice(y,E);return p.push(d[(L-2)/2]!=null?`${o}
|
|
26
26
|
${F}`:F),E},0),p.join("")}),this}insertAfter(n,o,s){return this.commands.push(c=>{const d=StringMatcher.match(c,n,s),h=[0,...d.flatMap(y=>[y.index,y.index+y[0].length]),c.length],p=[];return h.reduce((y,E,L)=>{const F=c.slice(y,E);return p.push(d[(L-2)/2]!=null?`${F}
|
|
27
|
-
${o}`:F),E},0),p.join("")}),this}erase(n,o){return this.replace(n,"",o)}execute(n){return this.commands.reduce((o,s)=>s(o),n)}}function useConstant$2(t){const n=React.useRef();return n.current==null&&(n.current={value:t()}),n.current.value}const ctx=typeof window<"u"?window:global,requestIdleCallbackShim=(t,n)=>{const o=Date.now();return ctx.setTimeout(function(){t({didTimeout:!1,timeRemaining:function(){return Math.max(0,12-(Date.now()-o))}})})},requestIdleCallback=ctx.requestIdleCallback||requestIdleCallbackShim,requestIdleCallbackWithRequiredWork=t=>{requestIdleCallback(t,{timeout:1})},usableChars$1="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789",generateRandomString$1=t=>Array.from(window.crypto.getRandomValues(new Uint8Array(t))).map(n=>usableChars$1[n%t]).join("").toLowerCase();function objectFromGetter(t,n){const o={},s=t.reduce((c,d)=>({...c,[d]:{get(){return n.call(this,d)},configurable:!1,enumerable:!0}}),{});return Object.defineProperties(o,s),o}const convertTime=t=>{if(t){if(t instanceof Date)return isNaN(t.getTime())?void 0:t;try{const n=new Date(t);return isNaN(n.getTime())?void 0:n}catch{return}}};var ValueType=(t=>(t.Array="ARRAY",t.Bool="BOOL",t.Camera="CAMERA",t.Coordinates="COORDINATES",t.Latlng="LATLNG",t.Latlngheight="LATLNGHEIGHT",t.Number="NUMBER",t.Polygon="POLYGON",t.Rect="RECT",t.Ref="REF",t.Spacing="SPACING",t.String="STRING",t.Timeline="TIMELINE",t.Typography="TYPOGRAPHY",t.Url="URL",t))(ValueType||{});ValueType.Bool+"",ValueType.Number+"",ValueType.String+"",ValueType.Url+"",ValueType.Latlng+"",ValueType.Latlngheight+"",ValueType.Camera+"",ValueType.Typography+"",ValueType.Coordinates+"",ValueType.Polygon+"",ValueType.Rect+"",ValueType.Ref+"",ValueType.Spacing+"",ValueType.Array+"",ValueType.Timeline+"";const getCSSFontFamily=t=>t?t==="YuGothic"?'"游ゴシック体", YuGothic, "游ゴシック Medium", "Yu Gothic Medium", "游ゴシック", "Yu Gothic"':t:void 0,toCSSFont=(t,n)=>{var s;const o=(s=getCSSFontFamily((t==null?void 0:t.fontFamily)??(n==null?void 0:n.fontFamily)))==null?void 0:s.replace("'",'"').trim();return`${(t==null?void 0:t.italic)??(n==null?void 0:n.italic)?"italic ":""}${(t==null?void 0:t.bold)??(n==null?void 0:n.bold)?"bold ":((t==null?void 0:t.fontWeight)??(n==null?void 0:n.fontWeight)??"")+" "}${(t==null?void 0:t.fontSize)??(n==null?void 0:n.fontSize)??16}px ${o?o.includes('"')?o:`"${o}"`:"sans-serif"}`},toColor$2=t=>{if(!t||typeof t!="string")return;const n=t.match(/^#([A-Fa-f0-9]{6})([A-Fa-f0-9]{2})$|^#([A-Fa-f0-9]{3})([A-Fa-f0-9])$/);if(!n)return Cesium$1.Color.fromCssColorString(t);const o=parseInt(n[4]?n[4].repeat(2):n[2],16)/255;return Cesium$1.Color.fromCssColorString(`#${n[1]??n[3]}`).withAlpha(o)};var lib={};Object.defineProperty(lib,"__esModule",{value:!0});var easing=lib.easing={linear:function(t){return t},quadratic:function(t){return t*(-(t*t)*t+4*t*t-6*t+4)},cubic:function(t){return t*(4*t*t-9*t+6)},elastic:function(t){return t*(33*t*t*t*t-106*t*t*t+126*t*t-67*t+15)},inQuad:function(t){return t*t},outQuad:function(t){return t*(2-t)},inOutQuad:function(t){return t<.5?2*t*t:-1+(4-2*t)*t},inCubic:function(t){return t*t*t},outCubic:function(t){return--t*t*t+1},inOutCubic:function(t){return t<.5?4*t*t*t:(t-1)*(2*t-2)*(2*t-2)+1},inQuart:function(t){return t*t*t*t},outQuart:function(t){return 1- --t*t*t*t},inOutQuart:function(t){return t<.5?8*t*t*t*t:1-8*--t*t*t*t},inQuint:function(t){return t*t*t*t*t},outQuint:function(t){return 1+--t*t*t*t*t},inOutQuint:function(t){return t<.5?16*t*t*t*t*t:1+16*--t*t*t*t*t},inSine:function(t){return-Math.cos(t*(Math.PI/2))+1},outSine:function(t){return Math.sin(t*(Math.PI/2))},inOutSine:function(t){return-(Math.cos(Math.PI*t)-1)/2},inExpo:function(t){return Math.pow(2,10*(t-1))},outExpo:function(t){return-Math.pow(2,-10*t)+1},inOutExpo:function(t){return t/=.5,t<1?Math.pow(2,10*(t-1))/2:(t--,(-Math.pow(2,-10*t)+2)/2)},inCirc:function(t){return-Math.sqrt(1-t*t)+1},outCirc:function(t){return Math.sqrt(1-(t=t-1)*t)},inOutCirc:function(t){return t/=.5,t<1?-(Math.sqrt(1-t*t)-1)/2:(t-=2,(Math.sqrt(1-t*t)+1)/2)}};function interval(t,n){let o=0,s=0,c=0;const d=()=>{t(o===0?0:Date.now()-o)&&(s=window.requestAnimationFrame(d)),o===0&&(o=Date.now())};return s=window.requestAnimationFrame(d),()=>{window.clearTimeout(c),window.cancelAnimationFrame(s)}}function intervalDuring(t,n,o){return n<0?()=>{}:interval(s=>{const c=Math.min(1,n===0?1:s/n);return t(c),c<1})}function tweenInterval(t,n,o,s){const c=typeof n=="function"?n:easing[n];return intervalDuring(d=>{t(c(d),d)},o)}const useImage=t=>{const n=React.useRef(),[o,s]=React.useState();return React.useEffect(()=>{if(!t){s(void 0),n.current&&(n.current.src="");return}const c=new Image;c.crossOrigin="anonymous",c.onload=()=>{s(n.current)},c.src=t,n.current=c},[t]),o},useCanvas=t=>{const n=React.useMemo(()=>document.createElement("canvas"),[]),[o,s]=React.useState("");return React.useEffect(()=>{t(n),s(n.toDataURL())},[n,t]),o};function useFirstMountState(){var t=React.useRef(!0);return t.current?(t.current=!1,!0):t.current}var __assign$2=function(){return __assign$2=Object.assign||function(n){for(var o,s=1,c=arguments.length;s<c;s++){o=arguments[s];for(var d in o)Object.prototype.hasOwnProperty.call(o,d)&&(n[d]=o[d])}return n},__assign$2.apply(this,arguments)};function __spreadArrays(){for(var t=0,n=0,o=arguments.length;n<o;n++)t+=arguments[n].length;for(var s=Array(t),c=0,n=0;n<o;n++)for(var d=arguments[n],h=0,p=d.length;h<p;h++,c++)s[c]=d[h];return s}typeof SuppressedError=="function"&&SuppressedError;var strictEquals=function(t,n){return t===n};function usePreviousDistinct(t,n){n===void 0&&(n=strictEquals);var o=React.useRef(),s=React.useRef(t),c=useFirstMountState();return!c&&!n(s.current,t)&&(o.current=s.current,s.current=t),o.current}var useSet=function(t){t===void 0&&(t=new Set);var n=React.useState(t),o=n[0],s=n[1],c=React.useMemo(function(){var h=function(E){return s(function(L){return new Set(__spreadArrays(Array.from(L),[E]))})},p=function(E){return s(function(L){return new Set(Array.from(L).filter(function(F){return F!==E}))})},y=function(E){return s(function(L){return L.has(E)?new Set(Array.from(L).filter(function(F){return F!==E})):new Set(__spreadArrays(Array.from(L),[E]))})};return{add:h,remove:p,toggle:y,reset:function(){return s(t)},clear:function(){return s(new Set)}}},[s]),d=__assign$2({has:React.useCallback(function(h){return o.has(h)},[o])},c);return[o,d]};const useDelayedCount=(t=[])=>{const[n,o]=React.useState(0),s=usePreviousDistinct(n),c=React.useRef(!1),d=React.useRef(),h=React.useCallback(()=>{o(y=>Math.max(0,Math.min(t.length+1,y+(c.current?-1:1))))},[t.length]),p=React.useCallback((y,E)=>{if(d.current&&(clearTimeout(d.current),d.current=void 0),E){o(y?0:t.length+1);return}c.current=y,h()},[h,t.length]);return React.useEffect(()=>{if(d.current!==void 0&&(clearTimeout(d.current),d.current=void 0),n<=0||n>=t.length+1)return;const y=t==null?void 0:t[n-1],E=Array.isArray(y)?y[c.current?1:0]:y;d.current=window.setTimeout(()=>{d.current=void 0,h()},E??0)},[h,t,n]),React.useEffect(()=>()=>{d.current&&(clearTimeout(d.current),d.current=void 0)},[]),[n,s,p]},DEFAULT_RANGE=864e5,useTimelineManager=({init:t,engineRef:n,timelineManagerRef:o})=>{const[s,c]=React.useState({start:convertTime(t==null?void 0:t.start)??new Date,stop:convertTime(t==null?void 0:t.stop)??new Date,current:convertTime(t==null?void 0:t.current)??new Date}),[d,h]=React.useState({animation:(t==null?void 0:t.animation)??!1,stepType:(t==null?void 0:t.stepType)??"rate",multiplier:(t==null?void 0:t.stepType)==="fixed"?(t==null?void 0:t.step)??1:(t==null?void 0:t.multiplier)??1,rangeType:(t==null?void 0:t.rangeType)??"unbounded"}),p=React.useMemo(()=>{const{start:lt,stop:Ee,current:yt}=s,Ai=lt.getTime(),zi=Ee.getTime(),ha=yt.getTime(),ba=Ai>ha?ha:Ai,Sa=zi<=ha?ha+DEFAULT_RANGE:zi;return{start:new Date(ba),stop:new Date(Sa),current:new Date(ha)}},[s]),y=React.useCallback(lt=>{lt.cmd&&(lt.cmd==="PLAY"?h(Ee=>({...Ee,animation:!0})):lt.cmd==="PAUSE"?h(Ee=>({...Ee,animation:!1})):lt.cmd==="SET_TIME"?c(Ee=>({start:convertTime(lt.payload.start)??Ee.start,stop:convertTime(lt.payload.stop)??Ee.stop,current:convertTime(lt.payload.current)??Ee.current})):lt.cmd==="SET_OPTIONS"&&h(Ee=>{var yt,Ai,zi;return{...Ee,stepType:((yt=lt.payload)==null?void 0:yt.stepType)===void 0?Ee.stepType:lt.payload.stepType,multiplier:((Ai=lt.payload)==null?void 0:Ai.multiplier)===void 0?Ee.multiplier:lt.payload.multiplier,rangeType:((zi=lt.payload)==null?void 0:zi.rangeType)===void 0?Ee.rangeType:lt.payload.rangeType}}),N.current.forEach(Ee=>Ee(lt.committer)))},[]),E=React.useRef([]),L=React.useCallback(lt=>{E.current.push(lt)},[]),F=React.useCallback(lt=>{E.current=E.current.filter(Ee=>Ee!==lt)},[]),N=React.useRef([]),z=React.useCallback(lt=>{N.current.push(lt)},[]),oe=React.useCallback(lt=>{N.current=N.current.filter(Ee=>Ee!==lt)},[]),W=React.useCallback(()=>{E.current.forEach(lt=>{var yt;const Ee=(yt=n==null?void 0:n.current)==null?void 0:yt.getClock();Ee!=null&&Ee.current&&(Ee!=null&&Ee.start)&&(Ee!=null&&Ee.stop)&<(Ee.current,{start:Ee==null?void 0:Ee.start,stop:Ee==null?void 0:Ee.stop})})},[n]),nt=React.useMemo(()=>({timeline:{get start(){var lt,Ee;return(Ee=(lt=n==null?void 0:n.current)==null?void 0:lt.getClock())==null?void 0:Ee.start},get stop(){var lt,Ee;return(Ee=(lt=n==null?void 0:n.current)==null?void 0:lt.getClock())==null?void 0:Ee.stop},get current(){var lt,Ee;return(Ee=(lt=n==null?void 0:n.current)==null?void 0:lt.getClock())==null?void 0:Ee.current}},options:d,computedTimeline:p,commit:y,onTick:L,offTick:F,onCommit:z,offCommit:oe,handleTick:W,get tick(){var lt;return(lt=n==null?void 0:n.current)==null?void 0:lt.tick}}),[d,p,n,y,L,F,z,oe,W]);return o&&(o.current=nt),null},FORCE_REQUEST_RENDER=-1,NO_REQUEST_RENDER=0,REQUEST_RENDER_ONCE=1;function useHooks$b({ref:t,timelineManagerRef:n,cursor:o,onLayerSelect:s}){const c=React.useRef(null),d=React.useRef(null),h=React.useRef(null),p=React.useRef(NO_REQUEST_RENDER);React.useImperativeHandle(t,()=>mapRef({engineRef:c,layersRef:d,sketchRef:h,timelineManagerRef:n}),[n]);const[y,E]=React.useState({}),L=React.useCallback(async(N,z,oe,W,nt)=>{E({layerId:N,featureId:z,reason:W}),s==null||s(N,z,oe,W,nt)},[s]),F=React.useCallback((N,z,oe,W)=>{var nt;(nt=d.current)==null||nt.selectFeatures([{layerId:N,featureId:z?[z]:void 0}],oe,W)},[]);return useTimelineManager({engineRef:c,timelineManagerRef:n}),React.useEffect(()=>{var N;o&&((N=c.current)==null||N.setCursor(o))},[o]),{engineRef:c,layersRef:d,sketchRef:h,selectedLayer:y,requestingRenderMode:p,handleLayerSelect:L,handleEngineLayerSelect:F}}let keyCount=0;function atom$1(t,n){const o=`atom${++keyCount}`,s={toString:()=>o};return typeof t=="function"?s.read=t:(s.init=t,s.read=c=>c(s),s.write=(c,d,h)=>d(s,typeof h=="function"?h(c(s)):h)),n&&(s.write=n),s}var define_import_meta_env_default={BASE_URL:"/",MODE:"production",DEV:!1,PROD:!0,SSR:!1};const SUSPENSE_PROMISE=Symbol(),isSuspensePromise=t=>!!t[SUSPENSE_PROMISE],isSuspensePromiseAlreadyCancelled=t=>!t[SUSPENSE_PROMISE].c,cancelSuspensePromise=t=>{var n;const{b:o,c:s}=t[SUSPENSE_PROMISE];s&&(s(),(n=promiseAbortMap.get(o))==null||n())},isEqualSuspensePromise=(t,n)=>{const o=t[SUSPENSE_PROMISE].o,s=n[SUSPENSE_PROMISE].o;return o===s||t===s||isSuspensePromise(o)&&isEqualSuspensePromise(o,n)},createSuspensePromise=(t,n)=>{const o={b:t,o:n,c:null},s=new Promise(c=>{o.c=()=>{o.c=null,c()},n.finally(o.c)});return s[SUSPENSE_PROMISE]=o,s},copySuspensePromise=t=>createSuspensePromise(t[SUSPENSE_PROMISE].b,t[SUSPENSE_PROMISE].o),promiseAbortMap=new WeakMap,hasInitialValue=t=>"init"in t,READ_ATOM="r",WRITE_ATOM="w",COMMIT_ATOM="c",SUBSCRIBE_ATOM="s",RESTORE_ATOMS="h",DEV_SUBSCRIBE_STATE="n",DEV_GET_MOUNTED_ATOMS="l",DEV_GET_ATOM_STATE="a",DEV_GET_MOUNTED="m",createStore=t=>{const n=new WeakMap,o=new WeakMap,s=new Map;let c,d;(define_import_meta_env_default&&"production")!=="production"&&(c=new Set,d=new Set);const h=new WeakMap,p=(pu,gl,md)=>{let ef=h.get(gl);ef||(ef=new Map,h.set(gl,ef)),md.then(()=>{ef.get(pu)===md&&(ef.delete(pu),ef.size||h.delete(gl))}),ef.set(pu,md)},y=pu=>{const gl=new Set,md=h.get(pu);return md&&(h.delete(pu),md.forEach((ef,nf)=>{cancelSuspensePromise(ef),gl.add(nf)})),gl},E=new WeakMap,L=pu=>{let gl=E.get(pu);return gl||(gl=new Map,E.set(pu,gl)),gl},F=(pu,gl)=>{if(pu){const md=L(pu);let ef=md.get(gl);return ef||(ef=F(pu.p,gl),ef&&"p"in ef&&isSuspensePromiseAlreadyCancelled(ef.p)&&(ef=void 0),ef&&md.set(gl,ef)),ef}return n.get(gl)},N=(pu,gl,md)=>{if((define_import_meta_env_default&&"production")!=="production"&&Object.freeze(md),pu)L(pu).set(gl,md);else{const ef=n.get(gl);n.set(gl,md),s.has(gl)||s.set(gl,ef)}},z=(pu,gl=new Map,md)=>{if(!md)return gl;const ef=new Map;let nf=!1;return md.forEach(rf=>{var uf;const mf=((uf=F(pu,rf))==null?void 0:uf.r)||0;ef.set(rf,mf),gl.get(rf)!==mf&&(nf=!0)}),gl.size===ef.size&&!nf?gl:ef},oe=(pu,gl,md,ef,nf)=>{const rf=F(pu,gl);if(rf){if(nf&&(!("p"in rf)||!isEqualSuspensePromise(rf.p,nf)))return rf;"p"in rf&&cancelSuspensePromise(rf.p)}const uf={v:md,r:(rf==null?void 0:rf.r)||0,y:!0,d:z(pu,rf==null?void 0:rf.d,ef)};let mf=!(rf!=null&&rf.y);return!rf||!("v"in rf)||!Object.is(rf.v,md)?(mf=!0,++uf.r,uf.d.has(gl)&&(uf.d=new Map(uf.d).set(gl,uf.r))):uf.d!==rf.d&&(uf.d.size!==rf.d.size||!Array.from(uf.d.keys()).every(Cf=>rf.d.has(Cf)))&&(mf=!0,Promise.resolve().then(()=>{fa(pu)})),rf&&!mf?rf:(N(pu,gl,uf),uf)},W=(pu,gl,md,ef,nf)=>{const rf=F(pu,gl);if(rf){if(nf&&(!("p"in rf)||!isEqualSuspensePromise(rf.p,nf)))return rf;"p"in rf&&cancelSuspensePromise(rf.p)}const uf={e:md,r:((rf==null?void 0:rf.r)||0)+1,y:!0,d:z(pu,rf==null?void 0:rf.d,ef)};return N(pu,gl,uf),uf},nt=(pu,gl,md,ef)=>{const nf=F(pu,gl);if(nf&&"p"in nf){if(isEqualSuspensePromise(nf.p,md)&&!isSuspensePromiseAlreadyCancelled(nf.p))return nf.y?nf:{...nf,y:!0};cancelSuspensePromise(nf.p)}p(pu,gl,md);const rf={p:md,r:((nf==null?void 0:nf.r)||0)+1,y:!0,d:z(pu,nf==null?void 0:nf.d,ef)};return N(pu,gl,rf),rf},lt=(pu,gl,md,ef)=>{if(md instanceof Promise){const nf=createSuspensePromise(md,md.then(rf=>{oe(pu,gl,rf,ef,nf)}).catch(rf=>{if(rf instanceof Promise)return isSuspensePromise(rf)?rf.then(()=>{yt(pu,gl,!0)}):rf;W(pu,gl,rf,ef,nf)}));return nt(pu,gl,nf,ef)}return oe(pu,gl,md,ef)},Ee=(pu,gl)=>{const md=F(pu,gl);if(md){const ef={...md,y:!1};N(pu,gl,ef)}else(define_import_meta_env_default&&"production")!=="production"&&console.warn("[Bug] could not invalidate non existing atom",gl)},yt=(pu,gl,md)=>{if(!md){const nf=F(pu,gl);if(nf){if(nf.y&&"p"in nf&&!isSuspensePromiseAlreadyCancelled(nf.p))return nf;if(nf.d.forEach((rf,uf)=>{if(uf!==gl)if(!o.has(uf))yt(pu,uf);else{const mf=F(pu,uf);mf&&!mf.y&&yt(pu,uf)}}),Array.from(nf.d).every(([rf,uf])=>{const mf=F(pu,rf);return mf&&!("p"in mf)&&mf.r===uf}))return nf.y?nf:{...nf,y:!0}}}const ef=new Set;try{const nf=gl.read(rf=>{ef.add(rf);const uf=rf===gl?F(pu,rf):yt(pu,rf);if(uf){if("e"in uf)throw uf.e;if("p"in uf)throw uf.p;return uf.v}if(hasInitialValue(rf))return rf.init;throw new Error("no atom init")});return lt(pu,gl,nf,ef)}catch(nf){if(nf instanceof Promise){const rf=isSuspensePromise(nf)&&isSuspensePromiseAlreadyCancelled(nf)?copySuspensePromise(nf):createSuspensePromise(nf,nf);return nt(pu,gl,rf,ef)}return W(pu,gl,nf,ef)}},Ai=(pu,gl)=>yt(gl,pu),zi=(pu,gl)=>{let md=o.get(gl);return md||(md=Wa(pu,gl)),md},ha=(pu,gl)=>!gl.l.size&&(!gl.t.size||gl.t.size===1&&gl.t.has(pu)),ba=(pu,gl)=>{const md=o.get(gl);md&&ha(gl,md)&&pi(pu,gl)},Sa=(pu,gl)=>{const md=o.get(gl);md==null||md.t.forEach(ef=>{ef!==gl&&(Ee(pu,ef),Sa(pu,ef))})},ya=(pu,gl,md)=>{let ef=!0;const nf=(mf,Cf)=>{const vf=yt(pu,mf);if("e"in vf)throw vf.e;if("p"in vf){if(Cf!=null&&Cf.unstable_promise)return vf.p.then(()=>{const bf=F(pu,mf);return bf&&"p"in bf&&bf.p===vf.p?new Promise(Pf=>setTimeout(Pf)).then(()=>nf(mf,Cf)):nf(mf,Cf)});throw(define_import_meta_env_default&&"production")!=="production"&&console.info("Reading pending atom state in write operation. We throw a promise for now.",mf),vf.p}if("v"in vf)return vf.v;throw(define_import_meta_env_default&&"production")!=="production"&&console.warn("[Bug] no value found while reading atom in write operation. This is probably a bug.",mf),new Error("no value found")},rf=(mf,Cf)=>{let vf;if(mf===gl){if(!hasInitialValue(mf))throw new Error("atom not writable");y(mf).forEach(wf=>{wf!==pu&<(wf,mf,Cf)});const Pf=F(pu,mf),Lf=lt(pu,mf,Cf);Pf!==Lf&&Sa(pu,mf)}else vf=ya(pu,mf,Cf);return ef||fa(pu),vf},uf=gl.write(nf,rf,md);return ef=!1,uf},ms=(pu,gl,md)=>{const ef=ya(md,pu,gl);return fa(md),ef},Wc=pu=>!!pu.write,Wa=(pu,gl,md)=>{const ef={t:new Set(md&&[md]),l:new Set};if(o.set(gl,ef),(define_import_meta_env_default&&"production")!=="production"&&d.add(gl),yt(void 0,gl).d.forEach((rf,uf)=>{const mf=o.get(uf);mf?mf.t.add(gl):uf!==gl&&Wa(pu,uf,gl)}),Wc(gl)&&gl.onMount){const rf=mf=>ms(gl,mf,pu),uf=gl.onMount(rf);pu=void 0,uf&&(ef.u=uf)}return ef},pi=(pu,gl)=>{var md;const ef=(md=o.get(gl))==null?void 0:md.u;ef&&ef(),o.delete(gl),(define_import_meta_env_default&&"production")!=="production"&&d.delete(gl);const nf=F(pu,gl);nf?("p"in nf&&cancelSuspensePromise(nf.p),nf.d.forEach((rf,uf)=>{if(uf!==gl){const mf=o.get(uf);mf&&(mf.t.delete(gl),ha(uf,mf)&&pi(pu,uf))}})):(define_import_meta_env_default&&"production")!=="production"&&console.warn("[Bug] could not find atom state to unmount",gl)},mt=(pu,gl,md,ef)=>{const nf=new Set(md.d.keys());ef==null||ef.forEach((rf,uf)=>{if(nf.has(uf)){nf.delete(uf);return}const mf=o.get(uf);mf&&(mf.t.delete(gl),ha(uf,mf)&&pi(pu,uf))}),nf.forEach(rf=>{const uf=o.get(rf);uf?uf.t.add(gl):o.has(gl)&&Wa(pu,rf,gl)})},fa=pu=>{if(pu){L(pu).forEach((md,ef)=>{const nf=n.get(ef);if(md!==nf){const rf=o.get(ef);rf==null||rf.l.forEach(uf=>uf(pu))}});return}for(;s.size;){const gl=Array.from(s);s.clear(),gl.forEach(([md,ef])=>{const nf=F(void 0,md);if(nf&&nf.d!==(ef==null?void 0:ef.d)&&mt(void 0,md,nf,ef==null?void 0:ef.d),ef&&!ef.y&&(nf!=null&&nf.y))return;const rf=o.get(md);rf==null||rf.l.forEach(uf=>uf())})}(define_import_meta_env_default&&"production")!=="production"&&c.forEach(gl=>gl())},Ra=pu=>{L(pu).forEach((md,ef)=>{const nf=n.get(ef);(!nf||md.r>nf.r||md.y!==nf.y||md.r===nf.r&&md.d!==nf.d)&&(n.set(ef,md),md.d!==(nf==null?void 0:nf.d)&&mt(pu,ef,md,nf==null?void 0:nf.d))})},sl=(pu,gl)=>{gl&&Ra(gl),fa(void 0)},Zd=(pu,gl,md)=>{const nf=zi(md,pu).l;return nf.add(gl),()=>{nf.delete(gl),ba(md,pu)}},Xd=(pu,gl)=>{for(const[md,ef]of pu)hasInitialValue(md)&&(lt(gl,md,ef),Sa(gl,md));fa(gl)};return(define_import_meta_env_default&&"production")!=="production"?{[READ_ATOM]:Ai,[WRITE_ATOM]:ms,[COMMIT_ATOM]:sl,[SUBSCRIBE_ATOM]:Zd,[RESTORE_ATOMS]:Xd,[DEV_SUBSCRIBE_STATE]:pu=>(c.add(pu),()=>{c.delete(pu)}),[DEV_GET_MOUNTED_ATOMS]:()=>d.values(),[DEV_GET_ATOM_STATE]:pu=>n.get(pu),[DEV_GET_MOUNTED]:pu=>o.get(pu)}:{[READ_ATOM]:Ai,[WRITE_ATOM]:ms,[COMMIT_ATOM]:sl,[SUBSCRIBE_ATOM]:Zd,[RESTORE_ATOMS]:Xd}},createScopeContainer=(t,n)=>({s:n?n(t).SECRET_INTERNAL_store:createStore()}),ScopeContextMap=new Map,getScopeContext=t=>(ScopeContextMap.has(t)||ScopeContextMap.set(t,React.createContext(createScopeContainer())),ScopeContextMap.get(t));function atom(t,n){return atom$1(t,n)}function useAtomValue(t,n){const o=getScopeContext(n),s=React.useContext(o),{s:c,v:d}=s,h=N=>{const z=c[READ_ATOM](t,N);if((define_import_meta_env_default&&"production")!=="production"&&!z.y)throw new Error("should not be invalidated");if("e"in z)throw z.e;if("p"in z)throw z.p;if("v"in z)return z.v;throw new Error("no atom value")},[[p,y,E],L]=React.useReducer((N,z)=>{const oe=h(z);return Object.is(N[1],oe)&&N[2]===t?N:[z,oe,t]},d,N=>{const z=h(N);return[N,z,t]});let F=y;return E!==t&&(L(p),F=h(p)),React.useEffect(()=>{const{v:N}=s;N&&c[COMMIT_ATOM](t,N);const z=c[SUBSCRIBE_ATOM](t,L,N);return L(N),z},[c,t,s]),React.useEffect(()=>{c[COMMIT_ATOM](t,p)}),React.useDebugValue(F),F}function useSetAtom(t,n){const o=getScopeContext(n),{s,w:c}=React.useContext(o);return React.useCallback(h=>{if((define_import_meta_env_default&&"production")!=="production"&&!("write"in t))throw new Error("not writable atom");const p=y=>s[WRITE_ATOM](t,h,y);return c?c(p):p()},[s,c,t])}function useAtom(t,n){return"scope"in t&&(console.warn("atom.scope is deprecated. Please do useAtom(atom, scope) instead."),n=t.scope),[useAtomValue(t,n),useSetAtom(t,n)]}var freeGlobal=typeof global=="object"&&global&&global.Object===Object&&global,freeSelf=typeof self=="object"&&self&&self.Object===Object&&self,root=freeGlobal||freeSelf||Function("return this")(),Symbol$1=root.Symbol,objectProto$h=Object.prototype,hasOwnProperty$f=objectProto$h.hasOwnProperty,nativeObjectToString$1=objectProto$h.toString,symToStringTag$1=Symbol$1?Symbol$1.toStringTag:void 0;function getRawTag(t){var n=hasOwnProperty$f.call(t,symToStringTag$1),o=t[symToStringTag$1];try{t[symToStringTag$1]=void 0;var s=!0}catch{}var c=nativeObjectToString$1.call(t);return s&&(n?t[symToStringTag$1]=o:delete t[symToStringTag$1]),c}var objectProto$g=Object.prototype,nativeObjectToString=objectProto$g.toString;function objectToString$1(t){return nativeObjectToString.call(t)}var nullTag="[object Null]",undefinedTag="[object Undefined]",symToStringTag=Symbol$1?Symbol$1.toStringTag:void 0;function baseGetTag(t){return t==null?t===void 0?undefinedTag:nullTag:symToStringTag&&symToStringTag in Object(t)?getRawTag(t):objectToString$1(t)}function isObjectLike(t){return t!=null&&typeof t=="object"}var symbolTag$3="[object Symbol]";function isSymbol(t){return typeof t=="symbol"||isObjectLike(t)&&baseGetTag(t)==symbolTag$3}function arrayMap(t,n){for(var o=-1,s=t==null?0:t.length,c=Array(s);++o<s;)c[o]=n(t[o],o,t);return c}var isArray$4=Array.isArray,INFINITY$2=1/0,symbolProto$2=Symbol$1?Symbol$1.prototype:void 0,symbolToString=symbolProto$2?symbolProto$2.toString:void 0;function baseToString(t){if(typeof t=="string")return t;if(isArray$4(t))return arrayMap(t,baseToString)+"";if(isSymbol(t))return symbolToString?symbolToString.call(t):"";var n=t+"";return n=="0"&&1/t==-INFINITY$2?"-0":n}function isObject$2(t){var n=typeof t;return t!=null&&(n=="object"||n=="function")}function identity$2(t){return t}var asyncTag="[object AsyncFunction]",funcTag$2="[object Function]",genTag$1="[object GeneratorFunction]",proxyTag="[object Proxy]";function isFunction$2(t){if(!isObject$2(t))return!1;var n=baseGetTag(t);return n==funcTag$2||n==genTag$1||n==asyncTag||n==proxyTag}var coreJsData=root["__core-js_shared__"],maskSrcKey=function(){var t=/[^.]+$/.exec(coreJsData&&coreJsData.keys&&coreJsData.keys.IE_PROTO||"");return t?"Symbol(src)_1."+t:""}();function isMasked(t){return!!maskSrcKey&&maskSrcKey in t}var funcProto$2=Function.prototype,funcToString$2=funcProto$2.toString;function toSource(t){if(t!=null){try{return funcToString$2.call(t)}catch{}try{return t+""}catch{}}return""}var reRegExpChar=/[\\^$.*+?()[\]{}|]/g,reIsHostCtor=/^\[object .+?Constructor\]$/,funcProto$1=Function.prototype,objectProto$f=Object.prototype,funcToString$1=funcProto$1.toString,hasOwnProperty$e=objectProto$f.hasOwnProperty,reIsNative=RegExp("^"+funcToString$1.call(hasOwnProperty$e).replace(reRegExpChar,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function baseIsNative(t){if(!isObject$2(t)||isMasked(t))return!1;var n=isFunction$2(t)?reIsNative:reIsHostCtor;return n.test(toSource(t))}function getValue$1(t,n){return t==null?void 0:t[n]}function getNative(t,n){var o=getValue$1(t,n);return baseIsNative(o)?o:void 0}var WeakMap$1=getNative(root,"WeakMap"),objectCreate=Object.create,baseCreate=function(){function t(){}return function(n){if(!isObject$2(n))return{};if(objectCreate)return objectCreate(n);t.prototype=n;var o=new t;return t.prototype=void 0,o}}();function apply(t,n,o){switch(o.length){case 0:return t.call(n);case 1:return t.call(n,o[0]);case 2:return t.call(n,o[0],o[1]);case 3:return t.call(n,o[0],o[1],o[2])}return t.apply(n,o)}function noop$2(){}function copyArray(t,n){var o=-1,s=t.length;for(n||(n=Array(s));++o<s;)n[o]=t[o];return n}var HOT_COUNT=800,HOT_SPAN=16,nativeNow=Date.now;function shortOut(t){var n=0,o=0;return function(){var s=nativeNow(),c=HOT_SPAN-(s-o);if(o=s,c>0){if(++n>=HOT_COUNT)return arguments[0]}else n=0;return t.apply(void 0,arguments)}}function constant(t){return function(){return t}}var defineProperty=function(){try{var t=getNative(Object,"defineProperty");return t({},"",{}),t}catch{}}(),baseSetToString=defineProperty?function(t,n){return defineProperty(t,"toString",{configurable:!0,enumerable:!1,value:constant(n),writable:!0})}:identity$2,setToString=shortOut(baseSetToString);function arrayEach(t,n){for(var o=-1,s=t==null?0:t.length;++o<s&&n(t[o],o,t)!==!1;);return t}function baseFindIndex(t,n,o,s){for(var c=t.length,d=o+-1;++d<c;)if(n(t[d],d,t))return d;return-1}function baseIsNaN(t){return t!==t}function strictIndexOf(t,n,o){for(var s=o-1,c=t.length;++s<c;)if(t[s]===n)return s;return-1}function baseIndexOf(t,n,o){return n===n?strictIndexOf(t,n,o):baseFindIndex(t,baseIsNaN,o)}function arrayIncludes(t,n){var o=t==null?0:t.length;return!!o&&baseIndexOf(t,n,0)>-1}var MAX_SAFE_INTEGER$1=9007199254740991,reIsUint=/^(?:0|[1-9]\d*)$/;function isIndex(t,n){var o=typeof t;return n=n??MAX_SAFE_INTEGER$1,!!n&&(o=="number"||o!="symbol"&&reIsUint.test(t))&&t>-1&&t%1==0&&t<n}function baseAssignValue(t,n,o){n=="__proto__"&&defineProperty?defineProperty(t,n,{configurable:!0,enumerable:!0,value:o,writable:!0}):t[n]=o}function eq(t,n){return t===n||t!==t&&n!==n}var objectProto$e=Object.prototype,hasOwnProperty$d=objectProto$e.hasOwnProperty;function assignValue(t,n,o){var s=t[n];(!(hasOwnProperty$d.call(t,n)&&eq(s,o))||o===void 0&&!(n in t))&&baseAssignValue(t,n,o)}function copyObject(t,n,o,s){var c=!o;o||(o={});for(var d=-1,h=n.length;++d<h;){var p=n[d],y=void 0;y===void 0&&(y=t[p]),c?baseAssignValue(o,p,y):assignValue(o,p,y)}return o}var nativeMax=Math.max;function overRest(t,n,o){return n=nativeMax(n===void 0?t.length-1:n,0),function(){for(var s=arguments,c=-1,d=nativeMax(s.length-n,0),h=Array(d);++c<d;)h[c]=s[n+c];c=-1;for(var p=Array(n+1);++c<n;)p[c]=s[c];return p[n]=o(h),apply(t,this,p)}}function baseRest(t,n){return setToString(overRest(t,n,identity$2),t+"")}var MAX_SAFE_INTEGER=9007199254740991;function isLength(t){return typeof t=="number"&&t>-1&&t%1==0&&t<=MAX_SAFE_INTEGER}function isArrayLike(t){return t!=null&&isLength(t.length)&&!isFunction$2(t)}function isIterateeCall(t,n,o){if(!isObject$2(o))return!1;var s=typeof n;return(s=="number"?isArrayLike(o)&&isIndex(n,o.length):s=="string"&&n in o)?eq(o[n],t):!1}function createAssigner(t){return baseRest(function(n,o){var s=-1,c=o.length,d=c>1?o[c-1]:void 0,h=c>2?o[2]:void 0;for(d=t.length>3&&typeof d=="function"?(c--,d):void 0,h&&isIterateeCall(o[0],o[1],h)&&(d=c<3?void 0:d,c=1),n=Object(n);++s<c;){var p=o[s];p&&t(n,p,s,d)}return n})}var objectProto$d=Object.prototype;function isPrototype(t){var n=t&&t.constructor,o=typeof n=="function"&&n.prototype||objectProto$d;return t===o}function baseTimes(t,n){for(var o=-1,s=Array(t);++o<t;)s[o]=n(o);return s}var argsTag$3="[object Arguments]";function baseIsArguments(t){return isObjectLike(t)&&baseGetTag(t)==argsTag$3}var objectProto$c=Object.prototype,hasOwnProperty$c=objectProto$c.hasOwnProperty,propertyIsEnumerable$1=objectProto$c.propertyIsEnumerable,isArguments=baseIsArguments(function(){return arguments}())?baseIsArguments:function(t){return isObjectLike(t)&&hasOwnProperty$c.call(t,"callee")&&!propertyIsEnumerable$1.call(t,"callee")};function stubFalse(){return!1}var freeExports$2=typeof exports=="object"&&exports&&!exports.nodeType&&exports,freeModule$2=freeExports$2&&typeof module=="object"&&module&&!module.nodeType&&module,moduleExports$2=freeModule$2&&freeModule$2.exports===freeExports$2,Buffer$4=moduleExports$2?root.Buffer:void 0,nativeIsBuffer=Buffer$4?Buffer$4.isBuffer:void 0,isBuffer$1=nativeIsBuffer||stubFalse,argsTag$2="[object Arguments]",arrayTag$2="[object Array]",boolTag$3="[object Boolean]",dateTag$3="[object Date]",errorTag$2="[object Error]",funcTag$1="[object Function]",mapTag$5="[object Map]",numberTag$3="[object Number]",objectTag$4="[object Object]",regexpTag$3="[object RegExp]",setTag$5="[object Set]",stringTag$3="[object String]",weakMapTag$2="[object WeakMap]",arrayBufferTag$3="[object ArrayBuffer]",dataViewTag$4="[object DataView]",float32Tag$2="[object Float32Array]",float64Tag$2="[object Float64Array]",int8Tag$2="[object Int8Array]",int16Tag$2="[object Int16Array]",int32Tag$2="[object Int32Array]",uint8Tag$2="[object Uint8Array]",uint8ClampedTag$2="[object Uint8ClampedArray]",uint16Tag$2="[object Uint16Array]",uint32Tag$2="[object Uint32Array]",typedArrayTags={};typedArrayTags[float32Tag$2]=typedArrayTags[float64Tag$2]=typedArrayTags[int8Tag$2]=typedArrayTags[int16Tag$2]=typedArrayTags[int32Tag$2]=typedArrayTags[uint8Tag$2]=typedArrayTags[uint8ClampedTag$2]=typedArrayTags[uint16Tag$2]=typedArrayTags[uint32Tag$2]=!0,typedArrayTags[argsTag$2]=typedArrayTags[arrayTag$2]=typedArrayTags[arrayBufferTag$3]=typedArrayTags[boolTag$3]=typedArrayTags[dataViewTag$4]=typedArrayTags[dateTag$3]=typedArrayTags[errorTag$2]=typedArrayTags[funcTag$1]=typedArrayTags[mapTag$5]=typedArrayTags[numberTag$3]=typedArrayTags[objectTag$4]=typedArrayTags[regexpTag$3]=typedArrayTags[setTag$5]=typedArrayTags[stringTag$3]=typedArrayTags[weakMapTag$2]=!1;function baseIsTypedArray(t){return isObjectLike(t)&&isLength(t.length)&&!!typedArrayTags[baseGetTag(t)]}function baseUnary(t){return function(n){return t(n)}}var freeExports$1=typeof exports=="object"&&exports&&!exports.nodeType&&exports,freeModule$1=freeExports$1&&typeof module=="object"&&module&&!module.nodeType&&module,moduleExports$1=freeModule$1&&freeModule$1.exports===freeExports$1,freeProcess=moduleExports$1&&freeGlobal.process,nodeUtil=function(){try{var t=freeModule$1&&freeModule$1.require&&freeModule$1.require("util").types;return t||freeProcess&&freeProcess.binding&&freeProcess.binding("util")}catch{}}(),nodeIsTypedArray=nodeUtil&&nodeUtil.isTypedArray,isTypedArray=nodeIsTypedArray?baseUnary(nodeIsTypedArray):baseIsTypedArray,objectProto$b=Object.prototype,hasOwnProperty$b=objectProto$b.hasOwnProperty;function arrayLikeKeys(t,n){var o=isArray$4(t),s=!o&&isArguments(t),c=!o&&!s&&isBuffer$1(t),d=!o&&!s&&!c&&isTypedArray(t),h=o||s||c||d,p=h?baseTimes(t.length,String):[],y=p.length;for(var E in t)(n||hasOwnProperty$b.call(t,E))&&!(h&&(E=="length"||c&&(E=="offset"||E=="parent")||d&&(E=="buffer"||E=="byteLength"||E=="byteOffset")||isIndex(E,y)))&&p.push(E);return p}function overArg(t,n){return function(o){return t(n(o))}}var nativeKeys=overArg(Object.keys,Object),objectProto$a=Object.prototype,hasOwnProperty$a=objectProto$a.hasOwnProperty;function baseKeys(t){if(!isPrototype(t))return nativeKeys(t);var n=[];for(var o in Object(t))hasOwnProperty$a.call(t,o)&&o!="constructor"&&n.push(o);return n}function keys$1(t){return isArrayLike(t)?arrayLikeKeys(t):baseKeys(t)}function nativeKeysIn(t){var n=[];if(t!=null)for(var o in Object(t))n.push(o);return n}var objectProto$9=Object.prototype,hasOwnProperty$9=objectProto$9.hasOwnProperty;function baseKeysIn(t){if(!isObject$2(t))return nativeKeysIn(t);var n=isPrototype(t),o=[];for(var s in t)s=="constructor"&&(n||!hasOwnProperty$9.call(t,s))||o.push(s);return o}function keysIn(t){return isArrayLike(t)?arrayLikeKeys(t,!0):baseKeysIn(t)}var reIsDeepProp=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,reIsPlainProp=/^\w*$/;function isKey(t,n){if(isArray$4(t))return!1;var o=typeof t;return o=="number"||o=="symbol"||o=="boolean"||t==null||isSymbol(t)?!0:reIsPlainProp.test(t)||!reIsDeepProp.test(t)||n!=null&&t in Object(n)}var nativeCreate=getNative(Object,"create");function hashClear(){this.__data__=nativeCreate?nativeCreate(null):{},this.size=0}function hashDelete(t){var n=this.has(t)&&delete this.__data__[t];return this.size-=n?1:0,n}var HASH_UNDEFINED$2="__lodash_hash_undefined__",objectProto$8=Object.prototype,hasOwnProperty$8=objectProto$8.hasOwnProperty;function hashGet(t){var n=this.__data__;if(nativeCreate){var o=n[t];return o===HASH_UNDEFINED$2?void 0:o}return hasOwnProperty$8.call(n,t)?n[t]:void 0}var objectProto$7=Object.prototype,hasOwnProperty$7=objectProto$7.hasOwnProperty;function hashHas(t){var n=this.__data__;return nativeCreate?n[t]!==void 0:hasOwnProperty$7.call(n,t)}var HASH_UNDEFINED$1="__lodash_hash_undefined__";function hashSet(t,n){var o=this.__data__;return this.size+=this.has(t)?0:1,o[t]=nativeCreate&&n===void 0?HASH_UNDEFINED$1:n,this}function Hash(t){var n=-1,o=t==null?0:t.length;for(this.clear();++n<o;){var s=t[n];this.set(s[0],s[1])}}Hash.prototype.clear=hashClear,Hash.prototype.delete=hashDelete,Hash.prototype.get=hashGet,Hash.prototype.has=hashHas,Hash.prototype.set=hashSet;function listCacheClear(){this.__data__=[],this.size=0}function assocIndexOf(t,n){for(var o=t.length;o--;)if(eq(t[o][0],n))return o;return-1}var arrayProto=Array.prototype,splice=arrayProto.splice;function listCacheDelete(t){var n=this.__data__,o=assocIndexOf(n,t);if(o<0)return!1;var s=n.length-1;return o==s?n.pop():splice.call(n,o,1),--this.size,!0}function listCacheGet(t){var n=this.__data__,o=assocIndexOf(n,t);return o<0?void 0:n[o][1]}function listCacheHas(t){return assocIndexOf(this.__data__,t)>-1}function listCacheSet(t,n){var o=this.__data__,s=assocIndexOf(o,t);return s<0?(++this.size,o.push([t,n])):o[s][1]=n,this}function ListCache(t){var n=-1,o=t==null?0:t.length;for(this.clear();++n<o;){var s=t[n];this.set(s[0],s[1])}}ListCache.prototype.clear=listCacheClear,ListCache.prototype.delete=listCacheDelete,ListCache.prototype.get=listCacheGet,ListCache.prototype.has=listCacheHas,ListCache.prototype.set=listCacheSet;var Map$2=getNative(root,"Map");function mapCacheClear(){this.size=0,this.__data__={hash:new Hash,map:new(Map$2||ListCache),string:new Hash}}function isKeyable(t){var n=typeof t;return n=="string"||n=="number"||n=="symbol"||n=="boolean"?t!=="__proto__":t===null}function getMapData(t,n){var o=t.__data__;return isKeyable(n)?o[typeof n=="string"?"string":"hash"]:o.map}function mapCacheDelete(t){var n=getMapData(this,t).delete(t);return this.size-=n?1:0,n}function mapCacheGet(t){return getMapData(this,t).get(t)}function mapCacheHas(t){return getMapData(this,t).has(t)}function mapCacheSet(t,n){var o=getMapData(this,t),s=o.size;return o.set(t,n),this.size+=o.size==s?0:1,this}function MapCache(t){var n=-1,o=t==null?0:t.length;for(this.clear();++n<o;){var s=t[n];this.set(s[0],s[1])}}MapCache.prototype.clear=mapCacheClear,MapCache.prototype.delete=mapCacheDelete,MapCache.prototype.get=mapCacheGet,MapCache.prototype.has=mapCacheHas,MapCache.prototype.set=mapCacheSet;var FUNC_ERROR_TEXT$1="Expected a function";function memoize(t,n){if(typeof t!="function"||n!=null&&typeof n!="function")throw new TypeError(FUNC_ERROR_TEXT$1);var o=function(){var s=arguments,c=n?n.apply(this,s):s[0],d=o.cache;if(d.has(c))return d.get(c);var h=t.apply(this,s);return o.cache=d.set(c,h)||d,h};return o.cache=new(memoize.Cache||MapCache),o}memoize.Cache=MapCache;var MAX_MEMOIZE_SIZE=500;function memoizeCapped(t){var n=memoize(t,function(s){return o.size===MAX_MEMOIZE_SIZE&&o.clear(),s}),o=n.cache;return n}var rePropName=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,reEscapeChar=/\\(\\)?/g,stringToPath=memoizeCapped(function(t){var n=[];return t.charCodeAt(0)===46&&n.push(""),t.replace(rePropName,function(o,s,c,d){n.push(c?d.replace(reEscapeChar,"$1"):s||o)}),n});function toString$1(t){return t==null?"":baseToString(t)}function castPath(t,n){return isArray$4(t)?t:isKey(t,n)?[t]:stringToPath(toString$1(t))}var INFINITY$1=1/0;function toKey(t){if(typeof t=="string"||isSymbol(t))return t;var n=t+"";return n=="0"&&1/t==-INFINITY$1?"-0":n}function baseGet(t,n){n=castPath(n,t);for(var o=0,s=n.length;t!=null&&o<s;)t=t[toKey(n[o++])];return o&&o==s?t:void 0}function get$1(t,n,o){var s=t==null?void 0:baseGet(t,n);return s===void 0?o:s}function arrayPush(t,n){for(var o=-1,s=n.length,c=t.length;++o<s;)t[c+o]=n[o];return t}var spreadableSymbol=Symbol$1?Symbol$1.isConcatSpreadable:void 0;function isFlattenable(t){return isArray$4(t)||isArguments(t)||!!(spreadableSymbol&&t&&t[spreadableSymbol])}function baseFlatten(t,n,o,s,c){var d=-1,h=t.length;for(o||(o=isFlattenable),c||(c=[]);++d<h;){var p=t[d];o(p)?arrayPush(c,p):c[c.length]=p}return c}function flatten$1(t){var n=t==null?0:t.length;return n?baseFlatten(t):[]}function flatRest(t){return setToString(overRest(t,void 0,flatten$1),t+"")}var getPrototype=overArg(Object.getPrototypeOf,Object),objectTag$3="[object Object]",funcProto=Function.prototype,objectProto$6=Object.prototype,funcToString=funcProto.toString,hasOwnProperty$6=objectProto$6.hasOwnProperty,objectCtorString=funcToString.call(Object);function isPlainObject(t){if(!isObjectLike(t)||baseGetTag(t)!=objectTag$3)return!1;var n=getPrototype(t);if(n===null)return!0;var o=hasOwnProperty$6.call(n,"constructor")&&n.constructor;return typeof o=="function"&&o instanceof o&&funcToString.call(o)==objectCtorString}function baseSlice(t,n,o){var s=-1,c=t.length;n<0&&(n=-n>c?0:c+n),o=o>c?c:o,o<0&&(o+=c),c=n>o?0:o-n>>>0,n>>>=0;for(var d=Array(c);++s<c;)d[s]=t[s+n];return d}function stackClear(){this.__data__=new ListCache,this.size=0}function stackDelete(t){var n=this.__data__,o=n.delete(t);return this.size=n.size,o}function stackGet(t){return this.__data__.get(t)}function stackHas(t){return this.__data__.has(t)}var LARGE_ARRAY_SIZE$2=200;function stackSet(t,n){var o=this.__data__;if(o instanceof ListCache){var s=o.__data__;if(!Map$2||s.length<LARGE_ARRAY_SIZE$2-1)return s.push([t,n]),this.size=++o.size,this;o=this.__data__=new MapCache(s)}return o.set(t,n),this.size=o.size,this}function Stack$1(t){var n=this.__data__=new ListCache(t);this.size=n.size}Stack$1.prototype.clear=stackClear,Stack$1.prototype.delete=stackDelete,Stack$1.prototype.get=stackGet,Stack$1.prototype.has=stackHas,Stack$1.prototype.set=stackSet;function baseAssign(t,n){return t&©Object(n,keys$1(n),t)}function baseAssignIn(t,n){return t&©Object(n,keysIn(n),t)}var freeExports=typeof exports=="object"&&exports&&!exports.nodeType&&exports,freeModule=freeExports&&typeof module=="object"&&module&&!module.nodeType&&module,moduleExports=freeModule&&freeModule.exports===freeExports,Buffer$3=moduleExports?root.Buffer:void 0,allocUnsafe$1=Buffer$3?Buffer$3.allocUnsafe:void 0;function cloneBuffer(t,n){if(n)return t.slice();var o=t.length,s=allocUnsafe$1?allocUnsafe$1(o):new t.constructor(o);return t.copy(s),s}function arrayFilter(t,n){for(var o=-1,s=t==null?0:t.length,c=0,d=[];++o<s;){var h=t[o];n(h,o,t)&&(d[c++]=h)}return d}function stubArray(){return[]}var objectProto$5=Object.prototype,propertyIsEnumerable=objectProto$5.propertyIsEnumerable,nativeGetSymbols$1=Object.getOwnPropertySymbols,getSymbols=nativeGetSymbols$1?function(t){return t==null?[]:(t=Object(t),arrayFilter(nativeGetSymbols$1(t),function(n){return propertyIsEnumerable.call(t,n)}))}:stubArray;function copySymbols(t,n){return copyObject(t,getSymbols(t),n)}var nativeGetSymbols=Object.getOwnPropertySymbols,getSymbolsIn=nativeGetSymbols?function(t){for(var n=[];t;)arrayPush(n,getSymbols(t)),t=getPrototype(t);return n}:stubArray;function copySymbolsIn(t,n){return copyObject(t,getSymbolsIn(t),n)}function baseGetAllKeys(t,n,o){var s=n(t);return isArray$4(t)?s:arrayPush(s,o(t))}function getAllKeys(t){return baseGetAllKeys(t,keys$1,getSymbols)}function getAllKeysIn(t){return baseGetAllKeys(t,keysIn,getSymbolsIn)}var DataView$1=getNative(root,"DataView"),Promise$1=getNative(root,"Promise"),Set$1=getNative(root,"Set"),mapTag$4="[object Map]",objectTag$2="[object Object]",promiseTag="[object Promise]",setTag$4="[object Set]",weakMapTag$1="[object WeakMap]",dataViewTag$3="[object DataView]",dataViewCtorString=toSource(DataView$1),mapCtorString=toSource(Map$2),promiseCtorString=toSource(Promise$1),setCtorString=toSource(Set$1),weakMapCtorString=toSource(WeakMap$1),getTag$1=baseGetTag;(DataView$1&&getTag$1(new DataView$1(new ArrayBuffer(1)))!=dataViewTag$3||Map$2&&getTag$1(new Map$2)!=mapTag$4||Promise$1&&getTag$1(Promise$1.resolve())!=promiseTag||Set$1&&getTag$1(new Set$1)!=setTag$4||WeakMap$1&&getTag$1(new WeakMap$1)!=weakMapTag$1)&&(getTag$1=function(t){var n=baseGetTag(t),o=n==objectTag$2?t.constructor:void 0,s=o?toSource(o):"";if(s)switch(s){case dataViewCtorString:return dataViewTag$3;case mapCtorString:return mapTag$4;case promiseCtorString:return promiseTag;case setCtorString:return setTag$4;case weakMapCtorString:return weakMapTag$1}return n});var objectProto$4=Object.prototype,hasOwnProperty$5=objectProto$4.hasOwnProperty;function initCloneArray(t){var n=t.length,o=new t.constructor(n);return n&&typeof t[0]=="string"&&hasOwnProperty$5.call(t,"index")&&(o.index=t.index,o.input=t.input),o}var Uint8Array$1=root.Uint8Array;function cloneArrayBuffer(t){var n=new t.constructor(t.byteLength);return new Uint8Array$1(n).set(new Uint8Array$1(t)),n}function cloneDataView(t,n){var o=n?cloneArrayBuffer(t.buffer):t.buffer;return new t.constructor(o,t.byteOffset,t.byteLength)}var reFlags=/\w*$/;function cloneRegExp(t){var n=new t.constructor(t.source,reFlags.exec(t));return n.lastIndex=t.lastIndex,n}var symbolProto$1=Symbol$1?Symbol$1.prototype:void 0,symbolValueOf$1=symbolProto$1?symbolProto$1.valueOf:void 0;function cloneSymbol(t){return symbolValueOf$1?Object(symbolValueOf$1.call(t)):{}}function cloneTypedArray(t,n){var o=n?cloneArrayBuffer(t.buffer):t.buffer;return new t.constructor(o,t.byteOffset,t.length)}var boolTag$2="[object Boolean]",dateTag$2="[object Date]",mapTag$3="[object Map]",numberTag$2="[object Number]",regexpTag$2="[object RegExp]",setTag$3="[object Set]",stringTag$2="[object String]",symbolTag$2="[object Symbol]",arrayBufferTag$2="[object ArrayBuffer]",dataViewTag$2="[object DataView]",float32Tag$1="[object Float32Array]",float64Tag$1="[object Float64Array]",int8Tag$1="[object Int8Array]",int16Tag$1="[object Int16Array]",int32Tag$1="[object Int32Array]",uint8Tag$1="[object Uint8Array]",uint8ClampedTag$1="[object Uint8ClampedArray]",uint16Tag$1="[object Uint16Array]",uint32Tag$1="[object Uint32Array]";function initCloneByTag(t,n,o){var s=t.constructor;switch(n){case arrayBufferTag$2:return cloneArrayBuffer(t);case boolTag$2:case dateTag$2:return new s(+t);case dataViewTag$2:return cloneDataView(t,o);case float32Tag$1:case float64Tag$1:case int8Tag$1:case int16Tag$1:case int32Tag$1:case uint8Tag$1:case uint8ClampedTag$1:case uint16Tag$1:case uint32Tag$1:return cloneTypedArray(t,o);case mapTag$3:return new s;case numberTag$2:case stringTag$2:return new s(t);case regexpTag$2:return cloneRegExp(t);case setTag$3:return new s;case symbolTag$2:return cloneSymbol(t)}}function initCloneObject(t){return typeof t.constructor=="function"&&!isPrototype(t)?baseCreate(getPrototype(t)):{}}var mapTag$2="[object Map]";function baseIsMap(t){return isObjectLike(t)&&getTag$1(t)==mapTag$2}var nodeIsMap=nodeUtil&&nodeUtil.isMap,isMap=nodeIsMap?baseUnary(nodeIsMap):baseIsMap,setTag$2="[object Set]";function baseIsSet(t){return isObjectLike(t)&&getTag$1(t)==setTag$2}var nodeIsSet=nodeUtil&&nodeUtil.isSet,isSet=nodeIsSet?baseUnary(nodeIsSet):baseIsSet,CLONE_DEEP_FLAG$2=1,CLONE_FLAT_FLAG$1=2,CLONE_SYMBOLS_FLAG$2=4,argsTag$1="[object Arguments]",arrayTag$1="[object Array]",boolTag$1="[object Boolean]",dateTag$1="[object Date]",errorTag$1="[object Error]",funcTag="[object Function]",genTag="[object GeneratorFunction]",mapTag$1="[object Map]",numberTag$1="[object Number]",objectTag$1="[object Object]",regexpTag$1="[object RegExp]",setTag$1="[object Set]",stringTag$1="[object String]",symbolTag$1="[object Symbol]",weakMapTag="[object WeakMap]",arrayBufferTag$1="[object ArrayBuffer]",dataViewTag$1="[object DataView]",float32Tag="[object Float32Array]",float64Tag="[object Float64Array]",int8Tag="[object Int8Array]",int16Tag="[object Int16Array]",int32Tag="[object Int32Array]",uint8Tag="[object Uint8Array]",uint8ClampedTag="[object Uint8ClampedArray]",uint16Tag="[object Uint16Array]",uint32Tag="[object Uint32Array]",cloneableTags={};cloneableTags[argsTag$1]=cloneableTags[arrayTag$1]=cloneableTags[arrayBufferTag$1]=cloneableTags[dataViewTag$1]=cloneableTags[boolTag$1]=cloneableTags[dateTag$1]=cloneableTags[float32Tag]=cloneableTags[float64Tag]=cloneableTags[int8Tag]=cloneableTags[int16Tag]=cloneableTags[int32Tag]=cloneableTags[mapTag$1]=cloneableTags[numberTag$1]=cloneableTags[objectTag$1]=cloneableTags[regexpTag$1]=cloneableTags[setTag$1]=cloneableTags[stringTag$1]=cloneableTags[symbolTag$1]=cloneableTags[uint8Tag]=cloneableTags[uint8ClampedTag]=cloneableTags[uint16Tag]=cloneableTags[uint32Tag]=!0,cloneableTags[errorTag$1]=cloneableTags[funcTag]=cloneableTags[weakMapTag]=!1;function baseClone(t,n,o,s,c,d){var h,p=n&CLONE_DEEP_FLAG$2,y=n&CLONE_FLAT_FLAG$1,E=n&CLONE_SYMBOLS_FLAG$2;if(o&&(h=c?o(t,s,c,d):o(t)),h!==void 0)return h;if(!isObject$2(t))return t;var L=isArray$4(t);if(L){if(h=initCloneArray(t),!p)return copyArray(t,h)}else{var F=getTag$1(t),N=F==funcTag||F==genTag;if(isBuffer$1(t))return cloneBuffer(t,p);if(F==objectTag$1||F==argsTag$1||N&&!c){if(h=y||N?{}:initCloneObject(t),!p)return y?copySymbolsIn(t,baseAssignIn(h,t)):copySymbols(t,baseAssign(h,t))}else{if(!cloneableTags[F])return c?t:{};h=initCloneByTag(t,F,p)}}d||(d=new Stack$1);var z=d.get(t);if(z)return z;d.set(t,h),isSet(t)?t.forEach(function(nt){h.add(baseClone(nt,n,o,nt,t,d))}):isMap(t)&&t.forEach(function(nt,lt){h.set(lt,baseClone(nt,n,o,lt,t,d))});var oe=E?y?getAllKeysIn:getAllKeys:y?keysIn:keys$1,W=L?void 0:oe(t);return arrayEach(W||t,function(nt,lt){W&&(lt=nt,nt=t[lt]),assignValue(h,lt,baseClone(nt,n,o,lt,t,d))}),h}var CLONE_DEEP_FLAG$1=1,CLONE_SYMBOLS_FLAG$1=4;function cloneDeep(t){return baseClone(t,CLONE_DEEP_FLAG$1|CLONE_SYMBOLS_FLAG$1)}var HASH_UNDEFINED="__lodash_hash_undefined__";function setCacheAdd(t){return this.__data__.set(t,HASH_UNDEFINED),this}function setCacheHas(t){return this.__data__.has(t)}function SetCache(t){var n=-1,o=t==null?0:t.length;for(this.__data__=new MapCache;++n<o;)this.add(t[n])}SetCache.prototype.add=SetCache.prototype.push=setCacheAdd,SetCache.prototype.has=setCacheHas;function arraySome(t,n){for(var o=-1,s=t==null?0:t.length;++o<s;)if(n(t[o],o,t))return!0;return!1}function cacheHas(t,n){return t.has(n)}var COMPARE_PARTIAL_FLAG$5=1,COMPARE_UNORDERED_FLAG$3=2;function equalArrays$2(t,n,o,s,c,d){var h=o&COMPARE_PARTIAL_FLAG$5,p=t.length,y=n.length;if(p!=y&&!(h&&y>p))return!1;var E=d.get(t),L=d.get(n);if(E&&L)return E==n&&L==t;var F=-1,N=!0,z=o&COMPARE_UNORDERED_FLAG$3?new SetCache:void 0;for(d.set(t,n),d.set(n,t);++F<p;){var oe=t[F],W=n[F];if(s)var nt=h?s(W,oe,F,n,t,d):s(oe,W,F,t,n,d);if(nt!==void 0){if(nt)continue;N=!1;break}if(z){if(!arraySome(n,function(lt,Ee){if(!cacheHas(z,Ee)&&(oe===lt||c(oe,lt,o,s,d)))return z.push(Ee)})){N=!1;break}}else if(!(oe===W||c(oe,W,o,s,d))){N=!1;break}}return d.delete(t),d.delete(n),N}function mapToArray(t){var n=-1,o=Array(t.size);return t.forEach(function(s,c){o[++n]=[c,s]}),o}function setToArray(t){var n=-1,o=Array(t.size);return t.forEach(function(s){o[++n]=s}),o}var COMPARE_PARTIAL_FLAG$4=1,COMPARE_UNORDERED_FLAG$2=2,boolTag="[object Boolean]",dateTag="[object Date]",errorTag="[object Error]",mapTag="[object Map]",numberTag="[object Number]",regexpTag="[object RegExp]",setTag="[object Set]",stringTag="[object String]",symbolTag="[object Symbol]",arrayBufferTag="[object ArrayBuffer]",dataViewTag="[object DataView]",symbolProto=Symbol$1?Symbol$1.prototype:void 0,symbolValueOf=symbolProto?symbolProto.valueOf:void 0;function equalByTag(t,n,o,s,c,d,h){switch(o){case dataViewTag:if(t.byteLength!=n.byteLength||t.byteOffset!=n.byteOffset)return!1;t=t.buffer,n=n.buffer;case arrayBufferTag:return!(t.byteLength!=n.byteLength||!d(new Uint8Array$1(t),new Uint8Array$1(n)));case boolTag:case dateTag:case numberTag:return eq(+t,+n);case errorTag:return t.name==n.name&&t.message==n.message;case regexpTag:case stringTag:return t==n+"";case mapTag:var p=mapToArray;case setTag:var y=s&COMPARE_PARTIAL_FLAG$4;if(p||(p=setToArray),t.size!=n.size&&!y)return!1;var E=h.get(t);if(E)return E==n;s|=COMPARE_UNORDERED_FLAG$2,h.set(t,n);var L=equalArrays$2(p(t),p(n),s,c,d,h);return h.delete(t),L;case symbolTag:if(symbolValueOf)return symbolValueOf.call(t)==symbolValueOf.call(n)}return!1}var COMPARE_PARTIAL_FLAG$3=1,objectProto$3=Object.prototype,hasOwnProperty$4=objectProto$3.hasOwnProperty;function equalObjects(t,n,o,s,c,d){var h=o&COMPARE_PARTIAL_FLAG$3,p=getAllKeys(t),y=p.length,E=getAllKeys(n),L=E.length;if(y!=L&&!h)return!1;for(var F=y;F--;){var N=p[F];if(!(h?N in n:hasOwnProperty$4.call(n,N)))return!1}var z=d.get(t),oe=d.get(n);if(z&&oe)return z==n&&oe==t;var W=!0;d.set(t,n),d.set(n,t);for(var nt=h;++F<y;){N=p[F];var lt=t[N],Ee=n[N];if(s)var yt=h?s(Ee,lt,N,n,t,d):s(lt,Ee,N,t,n,d);if(!(yt===void 0?lt===Ee||c(lt,Ee,o,s,d):yt)){W=!1;break}nt||(nt=N=="constructor")}if(W&&!nt){var Ai=t.constructor,zi=n.constructor;Ai!=zi&&"constructor"in t&&"constructor"in n&&!(typeof Ai=="function"&&Ai instanceof Ai&&typeof zi=="function"&&zi instanceof zi)&&(W=!1)}return d.delete(t),d.delete(n),W}var COMPARE_PARTIAL_FLAG$2=1,argsTag="[object Arguments]",arrayTag="[object Array]",objectTag="[object Object]",objectProto$2=Object.prototype,hasOwnProperty$3=objectProto$2.hasOwnProperty;function baseIsEqualDeep(t,n,o,s,c,d){var h=isArray$4(t),p=isArray$4(n),y=h?arrayTag:getTag$1(t),E=p?arrayTag:getTag$1(n);y=y==argsTag?objectTag:y,E=E==argsTag?objectTag:E;var L=y==objectTag,F=E==objectTag,N=y==E;if(N&&isBuffer$1(t)){if(!isBuffer$1(n))return!1;h=!0,L=!1}if(N&&!L)return d||(d=new Stack$1),h||isTypedArray(t)?equalArrays$2(t,n,o,s,c,d):equalByTag(t,n,y,o,s,c,d);if(!(o&COMPARE_PARTIAL_FLAG$2)){var z=L&&hasOwnProperty$3.call(t,"__wrapped__"),oe=F&&hasOwnProperty$3.call(n,"__wrapped__");if(z||oe){var W=z?t.value():t,nt=oe?n.value():n;return d||(d=new Stack$1),c(W,nt,o,s,d)}}return N?(d||(d=new Stack$1),equalObjects(t,n,o,s,c,d)):!1}function baseIsEqual(t,n,o,s,c){return t===n?!0:t==null||n==null||!isObjectLike(t)&&!isObjectLike(n)?t!==t&&n!==n:baseIsEqualDeep(t,n,o,s,baseIsEqual,c)}var COMPARE_PARTIAL_FLAG$1=1,COMPARE_UNORDERED_FLAG$1=2;function baseIsMatch(t,n,o,s){var c=o.length,d=c;if(t==null)return!d;for(t=Object(t);c--;){var h=o[c];if(h[2]?h[1]!==t[h[0]]:!(h[0]in t))return!1}for(;++c<d;){h=o[c];var p=h[0],y=t[p],E=h[1];if(h[2]){if(y===void 0&&!(p in t))return!1}else{var L=new Stack$1,F;if(!(F===void 0?baseIsEqual(E,y,COMPARE_PARTIAL_FLAG$1|COMPARE_UNORDERED_FLAG$1,s,L):F))return!1}}return!0}function isStrictComparable(t){return t===t&&!isObject$2(t)}function getMatchData(t){for(var n=keys$1(t),o=n.length;o--;){var s=n[o],c=t[s];n[o]=[s,c,isStrictComparable(c)]}return n}function matchesStrictComparable(t,n){return function(o){return o==null?!1:o[t]===n&&(n!==void 0||t in Object(o))}}function baseMatches(t){var n=getMatchData(t);return n.length==1&&n[0][2]?matchesStrictComparable(n[0][0],n[0][1]):function(o){return o===t||baseIsMatch(o,t,n)}}function baseHasIn(t,n){return t!=null&&n in Object(t)}function hasPath(t,n,o){n=castPath(n,t);for(var s=-1,c=n.length,d=!1;++s<c;){var h=toKey(n[s]);if(!(d=t!=null&&o(t,h)))break;t=t[h]}return d||++s!=c?d:(c=t==null?0:t.length,!!c&&isLength(c)&&isIndex(h,c)&&(isArray$4(t)||isArguments(t)))}function hasIn(t,n){return t!=null&&hasPath(t,n,baseHasIn)}var COMPARE_PARTIAL_FLAG=1,COMPARE_UNORDERED_FLAG=2;function baseMatchesProperty(t,n){return isKey(t)&&isStrictComparable(n)?matchesStrictComparable(toKey(t),n):function(o){var s=get$1(o,t);return s===void 0&&s===n?hasIn(o,t):baseIsEqual(n,s,COMPARE_PARTIAL_FLAG|COMPARE_UNORDERED_FLAG)}}function baseProperty(t){return function(n){return n==null?void 0:n[t]}}function basePropertyDeep(t){return function(n){return baseGet(n,t)}}function property(t){return isKey(t)?baseProperty(toKey(t)):basePropertyDeep(t)}function baseIteratee(t){return typeof t=="function"?t:t==null?identity$2:typeof t=="object"?isArray$4(t)?baseMatchesProperty(t[0],t[1]):baseMatches(t):property(t)}function arrayAggregator(t,n,o,s){for(var c=-1,d=t==null?0:t.length;++c<d;){var h=t[c];n(s,h,o(h),t)}return s}function createBaseFor(t){return function(n,o,s){for(var c=-1,d=Object(n),h=s(n),p=h.length;p--;){var y=h[++c];if(o(d[y],y,d)===!1)break}return n}}var baseFor=createBaseFor();function baseForOwn(t,n){return t&&baseFor(t,n,keys$1)}function createBaseEach(t,n){return function(o,s){if(o==null)return o;if(!isArrayLike(o))return t(o,s);for(var c=o.length,d=-1,h=Object(o);++d<c&&s(h[d],d,h)!==!1;);return o}}var baseEach=createBaseEach(baseForOwn);function baseAggregator(t,n,o,s){return baseEach(t,function(c,d,h){n(s,c,o(c),h)}),s}function createAggregator(t,n){return function(o,s){var c=isArray$4(o)?arrayAggregator:baseAggregator,d={};return c(o,t,baseIteratee(s),d)}}var objectProto$1=Object.prototype,hasOwnProperty$2=objectProto$1.hasOwnProperty,defaults=baseRest(function(t,n){t=Object(t);var o=-1,s=n.length,c=s>2?n[2]:void 0;for(c&&isIterateeCall(n[0],n[1],c)&&(s=1);++o<s;)for(var d=n[o],h=keysIn(d),p=-1,y=h.length;++p<y;){var E=h[p],L=t[E];(L===void 0||eq(L,objectProto$1[E])&&!hasOwnProperty$2.call(t,E))&&(t[E]=d[E])}return t});function assignMergeValue(t,n,o){(o!==void 0&&!eq(t[n],o)||o===void 0&&!(n in t))&&baseAssignValue(t,n,o)}function isArrayLikeObject(t){return isObjectLike(t)&&isArrayLike(t)}function safeGet(t,n){if(!(n==="constructor"&&typeof t[n]=="function")&&n!="__proto__")return t[n]}function toPlainObject(t){return copyObject(t,keysIn(t))}function baseMergeDeep(t,n,o,s,c,d,h){var p=safeGet(t,o),y=safeGet(n,o),E=h.get(y);if(E){assignMergeValue(t,o,E);return}var L=d?d(p,y,o+"",t,n,h):void 0,F=L===void 0;if(F){var N=isArray$4(y),z=!N&&isBuffer$1(y),oe=!N&&!z&&isTypedArray(y);L=y,N||z||oe?isArray$4(p)?L=p:isArrayLikeObject(p)?L=copyArray(p):z?(F=!1,L=cloneBuffer(y,!0)):oe?(F=!1,L=cloneTypedArray(y,!0)):L=[]:isPlainObject(y)||isArguments(y)?(L=p,isArguments(p)?L=toPlainObject(p):(!isObject$2(p)||isFunction$2(p))&&(L=initCloneObject(y))):F=!1}F&&(h.set(y,L),c(L,y,s,d,h),h.delete(y)),assignMergeValue(t,o,L)}function baseMerge(t,n,o,s,c){t!==n&&baseFor(n,function(d,h){if(c||(c=new Stack$1),isObject$2(d))baseMergeDeep(t,n,h,o,baseMerge,s,c);else{var p=s?s(safeGet(t,h),d,h+"",t,n,c):void 0;p===void 0&&(p=d),assignMergeValue(t,h,p)}},keysIn)}var LARGE_ARRAY_SIZE$1=200;function baseDifference(t,n,o,s){var c=-1,d=arrayIncludes,h=!0,p=t.length,y=[],E=n.length;if(!p)return y;o&&(n=arrayMap(n,baseUnary(o))),n.length>=LARGE_ARRAY_SIZE$1&&(d=cacheHas,h=!1,n=new SetCache(n));e:for(;++c<p;){var L=t[c],F=o==null?L:o(L);if(L=L!==0?L:0,h&&F===F){for(var N=E;N--;)if(n[N]===F)continue e;y.push(L)}else d(n,F,s)||y.push(L)}return y}function last(t){var n=t==null?0:t.length;return n?t[n-1]:void 0}function fromPairs(t){for(var n=-1,o=t==null?0:t.length,s={};++n<o;){var c=t[n];s[c[0]]=c[1]}return s}var objectProto=Object.prototype,hasOwnProperty$1=objectProto.hasOwnProperty,groupBy=createAggregator(function(t,n,o){hasOwnProperty$1.call(t,o)?t[o].push(n):baseAssignValue(t,o,[n])});function parent(t,n){return n.length<2?t:baseGet(t,baseSlice(n,0,-1))}function isEqual(t,n){return baseIsEqual(t,n)}var merge=createAssigner(function(t,n,o){baseMerge(t,n,o)}),FUNC_ERROR_TEXT="Expected a function";function negate(t){if(typeof t!="function")throw new TypeError(FUNC_ERROR_TEXT);return function(){var n=arguments;switch(n.length){case 0:return!t.call(this);case 1:return!t.call(this,n[0]);case 2:return!t.call(this,n[0],n[1]);case 3:return!t.call(this,n[0],n[1],n[2])}return!t.apply(this,n)}}function baseUnset(t,n){return n=castPath(n,t),t=parent(t,n),t==null||delete t[toKey(last(n))]}function customOmitClone(t){return isPlainObject(t)?void 0:t}var CLONE_DEEP_FLAG=1,CLONE_FLAT_FLAG=2,CLONE_SYMBOLS_FLAG=4,omit=flatRest(function(t,n){var o={};if(t==null)return o;var s=!1;n=arrayMap(n,function(d){return d=castPath(d,t),s||(s=d.length>1),d}),copyObject(t,getAllKeysIn(t),o),s&&(o=baseClone(o,CLONE_DEEP_FLAG|CLONE_FLAT_FLAG|CLONE_SYMBOLS_FLAG,customOmitClone));for(var c=n.length;c--;)baseUnset(o,n[c]);return o});function baseSet(t,n,o,s){if(!isObject$2(t))return t;n=castPath(n,t);for(var c=-1,d=n.length,h=d-1,p=t;p!=null&&++c<d;){var y=toKey(n[c]),E=o;if(y==="__proto__"||y==="constructor"||y==="prototype")return t;if(c!=h){var L=p[y];E=void 0,E===void 0&&(E=isObject$2(L)?L:isIndex(n[c+1])?[]:{})}assignValue(p,y,E),p=p[y]}return t}function basePickBy(t,n,o){for(var s=-1,c=n.length,d={};++s<c;){var h=n[s],p=baseGet(t,h);o(p,h)&&baseSet(d,castPath(h,t),p)}return d}function pickBy(t,n){if(t==null)return{};var o=arrayMap(getAllKeysIn(t),function(s){return[s]});return n=baseIteratee(n),basePickBy(t,o,function(s,c){return n(s,c[0])})}function omitBy(t,n){return pickBy(t,negate(baseIteratee(n)))}function basePick(t,n){return basePickBy(t,n,function(o,s){return hasIn(t,s)})}var pick=flatRest(function(t,n){return t==null?{}:basePick(t,n)}),INFINITY=1/0,createSet=Set$1&&1/setToArray(new Set$1([,-0]))[1]==INFINITY?function(t){return new Set$1(t)}:noop$2,LARGE_ARRAY_SIZE=200;function baseUniq(t,n,o){var s=-1,c=arrayIncludes,d=t.length,h=!0,p=[],y=p;if(d>=LARGE_ARRAY_SIZE){var E=n?null:createSet(t);if(E)return setToArray(E);h=!1,c=cacheHas,y=new SetCache}else y=n?[]:p;e:for(;++s<d;){var L=t[s],F=n?n(L):L;if(L=L!==0?L:0,h&&F===F){for(var N=y.length;N--;)if(y[N]===F)continue e;n&&y.push(F),p.push(L)}else c(y,F,o)||(y!==p&&y.push(F),p.push(L))}return p}function uniqBy(t,n){return t&&t.length?baseUniq(t,baseIteratee(n)):[]}function baseXor(t,n,o){var s=t.length;if(s<2)return s?baseUniq(t[0]):[];for(var c=-1,d=Array(s);++c<s;)for(var h=t[c],p=-1;++p<s;)p!=c&&(d[c]=baseDifference(d[c]||h,t[p],n,o));return baseUniq(baseFlatten(d),n,o)}var xorBy=baseRest(function(t){var n=last(t);return isArrayLikeObject(n)&&(n=void 0),baseXor(arrayFilter(t,isArrayLikeObject),baseIteratee(n))}),earthRadius=63710088e-1,factors={centimeters:earthRadius*100,centimetres:earthRadius*100,degrees:earthRadius/111325,feet:earthRadius*3.28084,inches:earthRadius*39.37,kilometers:earthRadius/1e3,kilometres:earthRadius/1e3,meters:earthRadius,metres:earthRadius,miles:earthRadius/1609.344,millimeters:earthRadius*1e3,millimetres:earthRadius*1e3,nauticalmiles:earthRadius/1852,radians:1,yards:earthRadius*1.0936};function feature(t,n,o){o===void 0&&(o={});var s={type:"Feature"};return(o.id===0||o.id)&&(s.id=o.id),o.bbox&&(s.bbox=o.bbox),s.properties=n||{},s.geometry=t,s}function point(t,n,o){if(o===void 0&&(o={}),!t)throw new Error("coordinates is required");if(!Array.isArray(t))throw new Error("coordinates must be an Array");if(t.length<2)throw new Error("coordinates must be at least 2 numbers long");if(!isNumber$1(t[0])||!isNumber$1(t[1]))throw new Error("coordinates must contain numbers");var s={type:"Point",coordinates:t};return feature(s,n,o)}function polygon(t,n,o){o===void 0&&(o={});for(var s=0,c=t;s<c.length;s++){var d=c[s];if(d.length<4)throw new Error("Each LinearRing of a Polygon must have 4 or more Positions.");for(var h=0;h<d[d.length-1].length;h++)if(d[d.length-1][h]!==d[0][h])throw new Error("First and last Position are not equivalent.")}var p={type:"Polygon",coordinates:t};return feature(p,n,o)}function lineString(t,n,o){if(o===void 0&&(o={}),t.length<2)throw new Error("coordinates must be an array of two or more positions");var s={type:"LineString",coordinates:t};return feature(s,n,o)}function featureCollection(t,n){n===void 0&&(n={});var o={type:"FeatureCollection"};return n.id&&(o.id=n.id),n.bbox&&(o.bbox=n.bbox),o.features=t,o}function radiansToLength(t,n){n===void 0&&(n="kilometers");var o=factors[n];if(!o)throw new Error(n+" units is invalid");return t*o}function lengthToRadians(t,n){n===void 0&&(n="kilometers");var o=factors[n];if(!o)throw new Error(n+" units is invalid");return t/o}function radiansToDegrees(t){var n=t%(2*Math.PI);return n*180/Math.PI}function degreesToRadians(t){var n=t%360;return n*Math.PI/180}function convertLength(t,n,o){if(n===void 0&&(n="kilometers"),o===void 0&&(o="kilometers"),!(t>=0))throw new Error("length must be a positive number");return radiansToLength(lengthToRadians(t,n),o)}function isNumber$1(t){return!isNaN(t)&&t!==null&&!Array.isArray(t)}function isObject$1(t){return!!t&&t.constructor===Object}function getCoord$1(t){if(!t)throw new Error("coord is required");if(!Array.isArray(t)){if(t.type==="Feature"&&t.geometry!==null&&t.geometry.type==="Point")return t.geometry.coordinates;if(t.type==="Point")return t.coordinates}if(Array.isArray(t)&&t.length>=2&&!Array.isArray(t[0])&&!Array.isArray(t[1]))return t;throw new Error("coord must be GeoJSON Point or an Array of numbers")}function getCoords$1(t){if(Array.isArray(t))return t;if(t.type==="Feature"){if(t.geometry!==null)return t.geometry.coordinates}else if(t.coordinates)return t.coordinates;throw new Error("coords must be GeoJSON Feature, Geometry Object or an Array")}function getGeom$1(t){return t.type==="Feature"?t.geometry:t}const getCoord=wrap(getCoord$1),getCoords=wrap(getCoords$1),getGeom=t=>{if(!(typeof t!="object"||!t||!("type"in t))){if(t.type==="Feature")return getGeom(t.geometry);if(!(t.type!=="Point"&&t.type!=="MultiPoint"&&t.type!=="LineString"&&t.type!=="MultiLineString"&&t.type!=="Polygon"&&t.type!=="MultiPolygon"))return t}};function wrap(t){return n=>{try{return t(n)}catch{return}}}function objKeys$1(t){return Object.keys(t)}function defaultValue$1(t,n){return t??n}const appearanceKeyObj={marker:1,polyline:1,polygon:1,ellipsoid:1,ellipse:1,model:1,"3dtiles":1,box:1,photooverlay:1,resource:1,raster:1,heatMap:1,frustum:1,transition:1},appearanceKeys=objKeys$1(appearanceKeyObj);function convertLayer(t){return convertLayerGroup(t)??convertLayerItem(t)}function convertLayerCommon(t){var n,o,s,c;return omitBy({id:t.id,isVisible:t.visible,title:t.title,creator:t.creator,infobox:t.infobox,tags:t.tags,property:(n=t.compat)==null?void 0:n.property,propertyId:(o=t.compat)==null?void 0:o.propertyId,pluginId:(s=t.compat)!=null&&s.extensionId?"reearth":void 0,extensionId:(c=t.compat)==null?void 0:c.extensionId},d=>typeof d>"u"||d===null)}function convertLayerGroup(t){var n;if(t.type==="group")return{...convertLayerCommon(t),children:((n=t.children)==null?void 0:n.map(convertLayer).filter(o=>!!o))??[]}}function convertLayerItem(t){if(t.type==="simple")return convertLayerCommon(t)}function getCompat(t){var c,d,h,p;if(!t||typeof t!="object"||t.type!=="simple")return;const n=((c=t.data)==null?void 0:c.type)==="geojson"?t.data.value:void 0;let o,s;if("marker"in t){const y=getCoord(n);s="marker",o={default:{...t.marker,...y&&y.length>=2?{location:{lng:y[0],lat:y[1]},height:y[2]}:{}}}}else if("polyline"in t){const y=getCoords(n);s="polyline",o={default:{...t.polyline,...y?{coordinates:y.map(E=>({lng:E[0],lat:E[1],height:E[2]}))}:{}}}}else if("polygon"in t){const y=getGeom(n);s="polygon",o={default:{...t.polygon,...(y==null?void 0:y.type)==="Polygon"?{polygon:y.coordinates.map(E=>E.map(L=>({lng:L[0],lat:L[1],height:L[2]})))}:{}}}}else if("photooverlay"in t){const y=getCoord(n);s="photooverlay",o={default:{...t.photooverlay,...y&&y.length>=2?{location:{lng:y[0],lat:y[1]},height:y[2]}:{}}}}else if("ellipsoid"in t){const y=getCoord(n);s="ellipsoid",o={default:{...t.ellipsoid,...y&&y.length>=2?{position:{lng:y[0],lat:y[1]},height:y[2]}:{}}}}else if("model"in t){const y=["shadows","colorBlend","color","colorBlendAmount","lightColor","silhouette","silhouetteColor","silhouetteSize"],E=omit(t.model,...y),L=omitBy(pick(t.model,...y),N=>typeof N>"u"||N===null),F=getCoord(n);s="model",o={default:{...E,...F&&F.length>=2?{location:{lng:F[0],lat:F[1]},height:F[2]}:{}},...Object.keys(L).length?{appearance:L}:{}}}else"3dtiles"in t?(s="tileset",o={default:{...t["3dtiles"],...((d=t.data)==null?void 0:d.type)==="3dtiles"&&t.data.url?{tileset:t.data.url}:{}}}):"resource"in t&&(s="resource",o={default:{...t.resource}});return{extensionId:s,property:o,...(h=t.compat)!=null&&h.propertyId?{propertyId:(p=t.compat)==null?void 0:p.propertyId}:{}}}function convertLegacyLayer(t){return t?convertLegacyLayerGroup(t)??convertLegacyLayerItem(t):void 0}function convertLegacyLayerCommon(t){const n=omitBy({extensionId:t.extensionId,property:t.property,propertyId:t.propertyId},o=>typeof o>"u"||o===null);return omitBy({id:t.id,title:t.title,visible:t.isVisible,creator:t.creator,infobox:t.infobox,tags:t.tags,...Object.keys(n).length?{compat:n}:{}},o=>typeof o>"u"||o===null)}function convertLegacyLayerGroup(t){var n;if(Array.isArray(t.children))return{type:"group",...convertLegacyLayerCommon(t),children:((n=t.children)==null?void 0:n.map(convertLegacyLayer).filter(o=>!!o))??[]}}function convertLegacyLayerItem(t){var d,h,p,y,E,L,F,N,z,oe,W,nt,lt,Ee,yt,Ai,zi,ha,ba,Sa,ya,ms,Wc,Wa,pi,mt,fa,Ra;if(Array.isArray(t.children))return;let n,o,s;if(t.extensionId==="marker")n="marker",s=["location","height"],(h=(d=t.property)==null?void 0:d.default)!=null&&h.location&&(o={type:"geojson",value:{type:"Feature",geometry:{type:"Point",coordinates:[t.property.default.location.lng,t.property.default.location.lat,...t.property.default.height?[t.property.default.height]:[]]}}});else if(t.extensionId==="polyline")n="polyline",s=["coordinates"],(y=(p=t.property)==null?void 0:p.default)!=null&&y.coordinates&&(o={type:"geojson",value:{type:"Feature",geometry:{type:"LineString",coordinates:t.property.default.coordinates.map(sl=>[sl.lng,sl.lat,sl.height])}}});else if(t.extensionId==="polygon")n="polygon",s=["polygon"],(L=(E=t.property)==null?void 0:E.default)!=null&&L.polygon&&(o={type:"geojson",value:{type:"Feature",geometry:{type:"Polygon",coordinates:t.property.default.polygon.map(sl=>sl.map(Zd=>[Zd.lng,Zd.lat,Zd.height]))}}});else if(t.extensionId==="rect"){if(n="polygon",s=["rect","height"],(N=(F=t.property)==null?void 0:F.default)!=null&&N.rect){const sl=(oe=(z=t.property)==null?void 0:z.default)==null?void 0:oe.rect,Zd=t.property.default.height;o={type:"geojson",value:{type:"Feature",geometry:{type:"Polygon",coordinates:[[[sl.west,sl.north,Zd],[sl.east,sl.north,Zd],[sl.east,sl.south,Zd],[sl.west,sl.south,Zd],[sl.west,sl.north,Zd]]]}}}}}else if(t.extensionId==="photooverlay")n="photooverlay",s=["location","height"],(nt=(W=t.property)==null?void 0:W.default)!=null&&nt.location&&(o={type:"geojson",value:{type:"Feature",geometry:{type:"Point",coordinates:[t.property.default.location.lng,t.property.default.location.lat,...t.property.default.height?[t.property.default.height]:[]]}}});else if(t.extensionId==="ellipsoid")n="ellipsoid",s=["position","height"],(Ee=(lt=t.property)==null?void 0:lt.default)!=null&&Ee.position&&(o={type:"geojson",value:{type:"Feature",geometry:{type:"Point",coordinates:[t.property.default.position.lng,t.property.default.position.lat,...typeof t.property.default.height=="number"?[t.property.default.height]:[]]}}});else if(t.extensionId==="model")n="model",s=["location","height"],(Ai=(yt=t.property)==null?void 0:yt.default)!=null&&Ai.location&&(o={type:"geojson",value:{type:"Feature",geometry:{type:"Point",coordinates:[t.property.default.location.lng,t.property.default.location.lat,...typeof t.property.default.height=="number"?[t.property.default.height]:[]]}}});else if(t.extensionId==="tileset")n="3dtiles",s=["tileset","sourceType"],((ha=(zi=t.property)==null?void 0:zi.default)==null?void 0:ha.sourceType)==="osm"?o={type:"osm-buildings"}:(Sa=(ba=t.property)==null?void 0:ba.default)!=null&&Sa.tileset&&(o={type:"3dtiles",url:t.property.default.tileset});else if(t.extensionId==="resource")if(n="resource",(ms=(ya=t.property)==null?void 0:ya.default)!=null&&ms.url&&typeof t.property.default.url=="object"){const sl=t.property.default.url;o={type:t.property.default.type,value:sl}}else o={type:((Wa=(Wc=t.property)==null?void 0:Wc.default)==null?void 0:Wa.type)||"auto",url:(mt=(pi=t.property)==null?void 0:pi.default)==null?void 0:mt.url};else t.extensionId==="box"&&(n="box",s=["location","height"],(Ra=(fa=t.property)==null?void 0:fa.default)!=null&&Ra.location&&(o={type:"geojson",value:{type:"Feature",geometry:{type:"Point",coordinates:[t.property.default.location.lng,t.property.default.location.lat,...typeof t.property.default.location.height=="number"?[t.property.default.location.height]:[]]}}}));const c=n&&t.property?Object.fromEntries(Object.entries(t.property).flatMap(([sl,Zd])=>{if(!(Array.isArray(Zd)||sl==="id"||!Zd||typeof Zd!="object"))return Object.entries(Zd).filter(([Xd])=>!(s!=null&&s.includes(Xd)))}).filter(sl=>!!sl)):void 0;return omitBy({type:"simple",...convertLegacyLayerCommon(t),data:o,...n&&c?{[n]:c}:{}},sl=>typeof sl>"u"||sl===null)}function convertLegacyCluster(t){return t.map(n=>{var o;return{id:n.id,property:{default:n.default,layers:n.layers},layers:(o=n.layers)==null?void 0:o.map(s=>s.layer).filter(s=>!!s)}})}class Hooks{add(n,o,s){if(typeof arguments[0]!="string")for(let c in arguments[0])this.add(c,arguments[0][c],arguments[1]);else(Array.isArray(n)?n:[n]).forEach(function(c){this[c]=this[c]||[],o&&this[c][s?"unshift":"push"](o)},this)}run(n,o){this[n]=this[n]||[],this[n].forEach(function(s){s.call(o&&o.context?o.context:o,o)})}}class Plugins{constructor(n){this.jsep=n,this.registered={}}register(...n){n.forEach(o=>{if(typeof o!="object"||!o.name||!o.init)throw new Error("Invalid JSEP plugin format");this.registered[o.name]||(o.init(this.jsep),this.registered[o.name]=o)})}}class Jsep{static get version(){return"1.3.8"}static toString(){return"JavaScript Expression Parser (JSEP) v"+Jsep.version}static addUnaryOp(n){return Jsep.max_unop_len=Math.max(n.length,Jsep.max_unop_len),Jsep.unary_ops[n]=1,Jsep}static addBinaryOp(n,o,s){return Jsep.max_binop_len=Math.max(n.length,Jsep.max_binop_len),Jsep.binary_ops[n]=o,s?Jsep.right_associative.add(n):Jsep.right_associative.delete(n),Jsep}static addIdentifierChar(n){return Jsep.additional_identifier_chars.add(n),Jsep}static addLiteral(n,o){return Jsep.literals[n]=o,Jsep}static removeUnaryOp(n){return delete Jsep.unary_ops[n],n.length===Jsep.max_unop_len&&(Jsep.max_unop_len=Jsep.getMaxKeyLen(Jsep.unary_ops)),Jsep}static removeAllUnaryOps(){return Jsep.unary_ops={},Jsep.max_unop_len=0,Jsep}static removeIdentifierChar(n){return Jsep.additional_identifier_chars.delete(n),Jsep}static removeBinaryOp(n){return delete Jsep.binary_ops[n],n.length===Jsep.max_binop_len&&(Jsep.max_binop_len=Jsep.getMaxKeyLen(Jsep.binary_ops)),Jsep.right_associative.delete(n),Jsep}static removeAllBinaryOps(){return Jsep.binary_ops={},Jsep.max_binop_len=0,Jsep}static removeLiteral(n){return delete Jsep.literals[n],Jsep}static removeAllLiterals(){return Jsep.literals={},Jsep}get char(){return this.expr.charAt(this.index)}get code(){return this.expr.charCodeAt(this.index)}constructor(n){this.expr=n,this.index=0}static parse(n){return new Jsep(n).parse()}static getMaxKeyLen(n){return Math.max(0,...Object.keys(n).map(o=>o.length))}static isDecimalDigit(n){return n>=48&&n<=57}static binaryPrecedence(n){return Jsep.binary_ops[n]||0}static isIdentifierStart(n){return n>=65&&n<=90||n>=97&&n<=122||n>=128&&!Jsep.binary_ops[String.fromCharCode(n)]||Jsep.additional_identifier_chars.has(String.fromCharCode(n))}static isIdentifierPart(n){return Jsep.isIdentifierStart(n)||Jsep.isDecimalDigit(n)}throwError(n){const o=new Error(n+" at character "+this.index);throw o.index=this.index,o.description=n,o}runHook(n,o){if(Jsep.hooks[n]){const s={context:this,node:o};return Jsep.hooks.run(n,s),s.node}return o}searchHook(n){if(Jsep.hooks[n]){const o={context:this};return Jsep.hooks[n].find(function(s){return s.call(o.context,o),o.node}),o.node}}gobbleSpaces(){let n=this.code;for(;n===Jsep.SPACE_CODE||n===Jsep.TAB_CODE||n===Jsep.LF_CODE||n===Jsep.CR_CODE;)n=this.expr.charCodeAt(++this.index);this.runHook("gobble-spaces")}parse(){this.runHook("before-all");const n=this.gobbleExpressions(),o=n.length===1?n[0]:{type:Jsep.COMPOUND,body:n};return this.runHook("after-all",o)}gobbleExpressions(n){let o=[],s,c;for(;this.index<this.expr.length;)if(s=this.code,s===Jsep.SEMCOL_CODE||s===Jsep.COMMA_CODE)this.index++;else if(c=this.gobbleExpression())o.push(c);else if(this.index<this.expr.length){if(s===n)break;this.throwError('Unexpected "'+this.char+'"')}return o}gobbleExpression(){const n=this.searchHook("gobble-expression")||this.gobbleBinaryExpression();return this.gobbleSpaces(),this.runHook("after-expression",n)}gobbleBinaryOp(){this.gobbleSpaces();let n=this.expr.substr(this.index,Jsep.max_binop_len),o=n.length;for(;o>0;){if(Jsep.binary_ops.hasOwnProperty(n)&&(!Jsep.isIdentifierStart(this.code)||this.index+n.length<this.expr.length&&!Jsep.isIdentifierPart(this.expr.charCodeAt(this.index+n.length))))return this.index+=o,n;n=n.substr(0,--o)}return!1}gobbleBinaryExpression(){let n,o,s,c,d,h,p,y,E;if(h=this.gobbleToken(),!h||(o=this.gobbleBinaryOp(),!o))return h;for(d={value:o,prec:Jsep.binaryPrecedence(o),right_a:Jsep.right_associative.has(o)},p=this.gobbleToken(),p||this.throwError("Expected expression after "+o),c=[h,d,p];o=this.gobbleBinaryOp();){if(s=Jsep.binaryPrecedence(o),s===0){this.index-=o.length;break}d={value:o,prec:s,right_a:Jsep.right_associative.has(o)},E=o;const L=F=>d.right_a&&F.right_a?s>F.prec:s<=F.prec;for(;c.length>2&&L(c[c.length-2]);)p=c.pop(),o=c.pop().value,h=c.pop(),n={type:Jsep.BINARY_EXP,operator:o,left:h,right:p},c.push(n);n=this.gobbleToken(),n||this.throwError("Expected expression after "+E),c.push(d,n)}for(y=c.length-1,n=c[y];y>1;)n={type:Jsep.BINARY_EXP,operator:c[y-1].value,left:c[y-2],right:n},y-=2;return n}gobbleToken(){let n,o,s,c;if(this.gobbleSpaces(),c=this.searchHook("gobble-token"),c)return this.runHook("after-token",c);if(n=this.code,Jsep.isDecimalDigit(n)||n===Jsep.PERIOD_CODE)return this.gobbleNumericLiteral();if(n===Jsep.SQUOTE_CODE||n===Jsep.DQUOTE_CODE)c=this.gobbleStringLiteral();else if(n===Jsep.OBRACK_CODE)c=this.gobbleArray();else{for(o=this.expr.substr(this.index,Jsep.max_unop_len),s=o.length;s>0;){if(Jsep.unary_ops.hasOwnProperty(o)&&(!Jsep.isIdentifierStart(this.code)||this.index+o.length<this.expr.length&&!Jsep.isIdentifierPart(this.expr.charCodeAt(this.index+o.length)))){this.index+=s;const d=this.gobbleToken();return d||this.throwError("missing unaryOp argument"),this.runHook("after-token",{type:Jsep.UNARY_EXP,operator:o,argument:d,prefix:!0})}o=o.substr(0,--s)}Jsep.isIdentifierStart(n)?(c=this.gobbleIdentifier(),Jsep.literals.hasOwnProperty(c.name)?c={type:Jsep.LITERAL,value:Jsep.literals[c.name],raw:c.name}:c.name===Jsep.this_str&&(c={type:Jsep.THIS_EXP})):n===Jsep.OPAREN_CODE&&(c=this.gobbleGroup())}return c?(c=this.gobbleTokenProperty(c),this.runHook("after-token",c)):this.runHook("after-token",!1)}gobbleTokenProperty(n){this.gobbleSpaces();let o=this.code;for(;o===Jsep.PERIOD_CODE||o===Jsep.OBRACK_CODE||o===Jsep.OPAREN_CODE||o===Jsep.QUMARK_CODE;){let s;if(o===Jsep.QUMARK_CODE){if(this.expr.charCodeAt(this.index+1)!==Jsep.PERIOD_CODE)break;s=!0,this.index+=2,this.gobbleSpaces(),o=this.code}this.index++,o===Jsep.OBRACK_CODE?(n={type:Jsep.MEMBER_EXP,computed:!0,object:n,property:this.gobbleExpression()},this.gobbleSpaces(),o=this.code,o!==Jsep.CBRACK_CODE&&this.throwError("Unclosed ["),this.index++):o===Jsep.OPAREN_CODE?n={type:Jsep.CALL_EXP,arguments:this.gobbleArguments(Jsep.CPAREN_CODE),callee:n}:(o===Jsep.PERIOD_CODE||s)&&(s&&this.index--,this.gobbleSpaces(),n={type:Jsep.MEMBER_EXP,computed:!1,object:n,property:this.gobbleIdentifier()}),s&&(n.optional=!0),this.gobbleSpaces(),o=this.code}return n}gobbleNumericLiteral(){let n="",o,s;for(;Jsep.isDecimalDigit(this.code);)n+=this.expr.charAt(this.index++);if(this.code===Jsep.PERIOD_CODE)for(n+=this.expr.charAt(this.index++);Jsep.isDecimalDigit(this.code);)n+=this.expr.charAt(this.index++);if(o=this.char,o==="e"||o==="E"){for(n+=this.expr.charAt(this.index++),o=this.char,(o==="+"||o==="-")&&(n+=this.expr.charAt(this.index++));Jsep.isDecimalDigit(this.code);)n+=this.expr.charAt(this.index++);Jsep.isDecimalDigit(this.expr.charCodeAt(this.index-1))||this.throwError("Expected exponent ("+n+this.char+")")}return s=this.code,Jsep.isIdentifierStart(s)?this.throwError("Variable names cannot start with a number ("+n+this.char+")"):(s===Jsep.PERIOD_CODE||n.length===1&&n.charCodeAt(0)===Jsep.PERIOD_CODE)&&this.throwError("Unexpected period"),{type:Jsep.LITERAL,value:parseFloat(n),raw:n}}gobbleStringLiteral(){let n="";const o=this.index,s=this.expr.charAt(this.index++);let c=!1;for(;this.index<this.expr.length;){let d=this.expr.charAt(this.index++);if(d===s){c=!0;break}else if(d==="\\")switch(d=this.expr.charAt(this.index++),d){case"n":n+=`
|
|
27
|
+
${o}`:F),E},0),p.join("")}),this}erase(n,o){return this.replace(n,"",o)}execute(n){return this.commands.reduce((o,s)=>s(o),n)}}function useConstant$2(t){const n=React.useRef();return n.current==null&&(n.current={value:t()}),n.current.value}const ctx=typeof window<"u"?window:global,requestIdleCallbackShim=(t,n)=>{const o=Date.now();return ctx.setTimeout(function(){t({didTimeout:!1,timeRemaining:function(){return Math.max(0,12-(Date.now()-o))}})})},requestIdleCallback=ctx.requestIdleCallback||requestIdleCallbackShim,requestIdleCallbackWithRequiredWork=t=>{requestIdleCallback(t,{timeout:1})},usableChars$1="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789",generateRandomString$1=t=>Array.from(window.crypto.getRandomValues(new Uint8Array(t))).map(n=>usableChars$1[n%t]).join("").toLowerCase();function objectFromGetter(t,n){const o={},s=t.reduce((c,d)=>({...c,[d]:{get(){return n.call(this,d)},configurable:!1,enumerable:!0}}),{});return Object.defineProperties(o,s),o}const convertTime=t=>{if(t){if(t instanceof Date)return isNaN(t.getTime())?void 0:t;try{const n=new Date(t);return isNaN(n.getTime())?void 0:n}catch{return}}};var ValueType=(t=>(t.Array="ARRAY",t.Bool="BOOL",t.Camera="CAMERA",t.Coordinates="COORDINATES",t.Latlng="LATLNG",t.Latlngheight="LATLNGHEIGHT",t.Number="NUMBER",t.Polygon="POLYGON",t.Rect="RECT",t.Ref="REF",t.Spacing="SPACING",t.String="STRING",t.Timeline="TIMELINE",t.Typography="TYPOGRAPHY",t.Url="URL",t))(ValueType||{});ValueType.Bool+"",ValueType.Number+"",ValueType.String+"",ValueType.Url+"",ValueType.Latlng+"",ValueType.Latlngheight+"",ValueType.Camera+"",ValueType.Typography+"",ValueType.Coordinates+"",ValueType.Polygon+"",ValueType.Rect+"",ValueType.Ref+"",ValueType.Spacing+"",ValueType.Array+"",ValueType.Timeline+"";const getCSSFontFamily=t=>t?t==="YuGothic"?'"游ゴシック体", YuGothic, "游ゴシック Medium", "Yu Gothic Medium", "游ゴシック", "Yu Gothic"':t:void 0,toCSSFont=(t,n)=>{var s;const o=(s=getCSSFontFamily((t==null?void 0:t.fontFamily)??(n==null?void 0:n.fontFamily)))==null?void 0:s.replace("'",'"').trim();return`${(t==null?void 0:t.italic)??(n==null?void 0:n.italic)?"italic ":""}${(t==null?void 0:t.bold)??(n==null?void 0:n.bold)?"bold ":((t==null?void 0:t.fontWeight)??(n==null?void 0:n.fontWeight)??"")+" "}${(t==null?void 0:t.fontSize)??(n==null?void 0:n.fontSize)??16}px ${o?o.includes('"')?o:`"${o}"`:"sans-serif"}`},toColor$2=t=>{if(!t||typeof t!="string")return;const n=t.match(/^#([A-Fa-f0-9]{6})([A-Fa-f0-9]{2})$|^#([A-Fa-f0-9]{3})([A-Fa-f0-9])$/);if(!n)return Cesium$1.Color.fromCssColorString(t);const o=parseInt(n[4]?n[4].repeat(2):n[2],16)/255;return Cesium$1.Color.fromCssColorString(`#${n[1]??n[3]}`).withAlpha(o)};var lib={};Object.defineProperty(lib,"__esModule",{value:!0});var easing=lib.easing={linear:function(t){return t},quadratic:function(t){return t*(-(t*t)*t+4*t*t-6*t+4)},cubic:function(t){return t*(4*t*t-9*t+6)},elastic:function(t){return t*(33*t*t*t*t-106*t*t*t+126*t*t-67*t+15)},inQuad:function(t){return t*t},outQuad:function(t){return t*(2-t)},inOutQuad:function(t){return t<.5?2*t*t:-1+(4-2*t)*t},inCubic:function(t){return t*t*t},outCubic:function(t){return--t*t*t+1},inOutCubic:function(t){return t<.5?4*t*t*t:(t-1)*(2*t-2)*(2*t-2)+1},inQuart:function(t){return t*t*t*t},outQuart:function(t){return 1- --t*t*t*t},inOutQuart:function(t){return t<.5?8*t*t*t*t:1-8*--t*t*t*t},inQuint:function(t){return t*t*t*t*t},outQuint:function(t){return 1+--t*t*t*t*t},inOutQuint:function(t){return t<.5?16*t*t*t*t*t:1+16*--t*t*t*t*t},inSine:function(t){return-Math.cos(t*(Math.PI/2))+1},outSine:function(t){return Math.sin(t*(Math.PI/2))},inOutSine:function(t){return-(Math.cos(Math.PI*t)-1)/2},inExpo:function(t){return Math.pow(2,10*(t-1))},outExpo:function(t){return-Math.pow(2,-10*t)+1},inOutExpo:function(t){return t/=.5,t<1?Math.pow(2,10*(t-1))/2:(t--,(-Math.pow(2,-10*t)+2)/2)},inCirc:function(t){return-Math.sqrt(1-t*t)+1},outCirc:function(t){return Math.sqrt(1-(t=t-1)*t)},inOutCirc:function(t){return t/=.5,t<1?-(Math.sqrt(1-t*t)-1)/2:(t-=2,(Math.sqrt(1-t*t)+1)/2)}};function interval(t,n){let o=0,s=0,c=0;const d=()=>{t(o===0?0:Date.now()-o)&&(s=window.requestAnimationFrame(d)),o===0&&(o=Date.now())};return s=window.requestAnimationFrame(d),()=>{window.clearTimeout(c),window.cancelAnimationFrame(s)}}function intervalDuring(t,n,o){return n<0?()=>{}:interval(s=>{const c=Math.min(1,n===0?1:s/n);return t(c),c<1})}function tweenInterval(t,n,o,s){const c=typeof n=="function"?n:easing[n];return intervalDuring(d=>{t(c(d),d)},o)}const useImage=t=>{const n=React.useRef(),[o,s]=React.useState();return React.useEffect(()=>{if(!t){s(void 0),n.current&&(n.current.src="");return}const c=new Image;c.crossOrigin="anonymous",c.onload=()=>{s(n.current)},c.src=t,n.current=c},[t]),o};function useFirstMountState(){var t=React.useRef(!0);return t.current?(t.current=!1,!0):t.current}var __assign$2=function(){return __assign$2=Object.assign||function(n){for(var o,s=1,c=arguments.length;s<c;s++){o=arguments[s];for(var d in o)Object.prototype.hasOwnProperty.call(o,d)&&(n[d]=o[d])}return n},__assign$2.apply(this,arguments)};function __spreadArrays(){for(var t=0,n=0,o=arguments.length;n<o;n++)t+=arguments[n].length;for(var s=Array(t),c=0,n=0;n<o;n++)for(var d=arguments[n],h=0,p=d.length;h<p;h++,c++)s[c]=d[h];return s}typeof SuppressedError=="function"&&SuppressedError;var strictEquals=function(t,n){return t===n};function usePreviousDistinct(t,n){n===void 0&&(n=strictEquals);var o=React.useRef(),s=React.useRef(t),c=useFirstMountState();return!c&&!n(s.current,t)&&(o.current=s.current,s.current=t),o.current}var useSet=function(t){t===void 0&&(t=new Set);var n=React.useState(t),o=n[0],s=n[1],c=React.useMemo(function(){var h=function(E){return s(function(L){return new Set(__spreadArrays(Array.from(L),[E]))})},p=function(E){return s(function(L){return new Set(Array.from(L).filter(function(F){return F!==E}))})},y=function(E){return s(function(L){return L.has(E)?new Set(Array.from(L).filter(function(F){return F!==E})):new Set(__spreadArrays(Array.from(L),[E]))})};return{add:h,remove:p,toggle:y,reset:function(){return s(t)},clear:function(){return s(new Set)}}},[s]),d=__assign$2({has:React.useCallback(function(h){return o.has(h)},[o])},c);return[o,d]};const useDelayedCount=(t=[])=>{const[n,o]=React.useState(0),s=usePreviousDistinct(n),c=React.useRef(!1),d=React.useRef(),h=React.useCallback(()=>{o(y=>Math.max(0,Math.min(t.length+1,y+(c.current?-1:1))))},[t.length]),p=React.useCallback((y,E)=>{if(d.current&&(clearTimeout(d.current),d.current=void 0),E){o(y?0:t.length+1);return}c.current=y,h()},[h,t.length]);return React.useEffect(()=>{if(d.current!==void 0&&(clearTimeout(d.current),d.current=void 0),n<=0||n>=t.length+1)return;const y=t==null?void 0:t[n-1],E=Array.isArray(y)?y[c.current?1:0]:y;d.current=window.setTimeout(()=>{d.current=void 0,h()},E??0)},[h,t,n]),React.useEffect(()=>()=>{d.current&&(clearTimeout(d.current),d.current=void 0)},[]),[n,s,p]},DEFAULT_RANGE=864e5,useTimelineManager=({init:t,engineRef:n,timelineManagerRef:o})=>{const[s,c]=React.useState({start:convertTime(t==null?void 0:t.start)??new Date,stop:convertTime(t==null?void 0:t.stop)??new Date,current:convertTime(t==null?void 0:t.current)??new Date}),[d,h]=React.useState({animation:(t==null?void 0:t.animation)??!1,stepType:(t==null?void 0:t.stepType)??"rate",multiplier:(t==null?void 0:t.stepType)==="fixed"?(t==null?void 0:t.step)??1:(t==null?void 0:t.multiplier)??1,rangeType:(t==null?void 0:t.rangeType)??"unbounded"}),p=React.useMemo(()=>{const{start:lt,stop:Ee,current:yt}=s,Ai=lt.getTime(),zi=Ee.getTime(),ha=yt.getTime(),ba=Ai>ha?ha:Ai,Sa=zi<=ha?ha+DEFAULT_RANGE:zi;return{start:new Date(ba),stop:new Date(Sa),current:new Date(ha)}},[s]),y=React.useCallback(lt=>{lt.cmd&&(lt.cmd==="PLAY"?h(Ee=>({...Ee,animation:!0})):lt.cmd==="PAUSE"?h(Ee=>({...Ee,animation:!1})):lt.cmd==="SET_TIME"?c(Ee=>({start:convertTime(lt.payload.start)??Ee.start,stop:convertTime(lt.payload.stop)??Ee.stop,current:convertTime(lt.payload.current)??Ee.current})):lt.cmd==="SET_OPTIONS"&&h(Ee=>{var yt,Ai,zi;return{...Ee,stepType:((yt=lt.payload)==null?void 0:yt.stepType)===void 0?Ee.stepType:lt.payload.stepType,multiplier:((Ai=lt.payload)==null?void 0:Ai.multiplier)===void 0?Ee.multiplier:lt.payload.multiplier,rangeType:((zi=lt.payload)==null?void 0:zi.rangeType)===void 0?Ee.rangeType:lt.payload.rangeType}}),N.current.forEach(Ee=>Ee(lt.committer)))},[]),E=React.useRef([]),L=React.useCallback(lt=>{E.current.push(lt)},[]),F=React.useCallback(lt=>{E.current=E.current.filter(Ee=>Ee!==lt)},[]),N=React.useRef([]),z=React.useCallback(lt=>{N.current.push(lt)},[]),oe=React.useCallback(lt=>{N.current=N.current.filter(Ee=>Ee!==lt)},[]),W=React.useCallback(()=>{E.current.forEach(lt=>{var yt;const Ee=(yt=n==null?void 0:n.current)==null?void 0:yt.getClock();Ee!=null&&Ee.current&&(Ee!=null&&Ee.start)&&(Ee!=null&&Ee.stop)&<(Ee.current,{start:Ee==null?void 0:Ee.start,stop:Ee==null?void 0:Ee.stop})})},[n]),nt=React.useMemo(()=>({timeline:{get start(){var lt,Ee;return(Ee=(lt=n==null?void 0:n.current)==null?void 0:lt.getClock())==null?void 0:Ee.start},get stop(){var lt,Ee;return(Ee=(lt=n==null?void 0:n.current)==null?void 0:lt.getClock())==null?void 0:Ee.stop},get current(){var lt,Ee;return(Ee=(lt=n==null?void 0:n.current)==null?void 0:lt.getClock())==null?void 0:Ee.current}},options:d,computedTimeline:p,commit:y,onTick:L,offTick:F,onCommit:z,offCommit:oe,handleTick:W,get tick(){var lt;return(lt=n==null?void 0:n.current)==null?void 0:lt.tick}}),[d,p,n,y,L,F,z,oe,W]);return o&&(o.current=nt),null},FORCE_REQUEST_RENDER=-1,NO_REQUEST_RENDER=0,REQUEST_RENDER_ONCE=1;function useHooks$b({ref:t,timelineManagerRef:n,cursor:o,onLayerSelect:s}){const c=React.useRef(null),d=React.useRef(null),h=React.useRef(null),p=React.useRef(NO_REQUEST_RENDER);React.useImperativeHandle(t,()=>mapRef({engineRef:c,layersRef:d,sketchRef:h,timelineManagerRef:n}),[n]);const[y,E]=React.useState({}),L=React.useCallback(async(N,z,oe,W,nt)=>{E({layerId:N,featureId:z,reason:W}),s==null||s(N,z,oe,W,nt)},[s]),F=React.useCallback((N,z,oe,W)=>{var nt;(nt=d.current)==null||nt.selectFeatures([{layerId:N,featureId:z?[z]:void 0}],oe,W)},[]);return useTimelineManager({engineRef:c,timelineManagerRef:n}),React.useEffect(()=>{var N;o&&((N=c.current)==null||N.setCursor(o))},[o]),{engineRef:c,layersRef:d,sketchRef:h,selectedLayer:y,requestingRenderMode:p,handleLayerSelect:L,handleEngineLayerSelect:F}}let keyCount=0;function atom$1(t,n){const o=`atom${++keyCount}`,s={toString:()=>o};return typeof t=="function"?s.read=t:(s.init=t,s.read=c=>c(s),s.write=(c,d,h)=>d(s,typeof h=="function"?h(c(s)):h)),n&&(s.write=n),s}var define_import_meta_env_default={BASE_URL:"/",MODE:"production",DEV:!1,PROD:!0,SSR:!1};const SUSPENSE_PROMISE=Symbol(),isSuspensePromise=t=>!!t[SUSPENSE_PROMISE],isSuspensePromiseAlreadyCancelled=t=>!t[SUSPENSE_PROMISE].c,cancelSuspensePromise=t=>{var n;const{b:o,c:s}=t[SUSPENSE_PROMISE];s&&(s(),(n=promiseAbortMap.get(o))==null||n())},isEqualSuspensePromise=(t,n)=>{const o=t[SUSPENSE_PROMISE].o,s=n[SUSPENSE_PROMISE].o;return o===s||t===s||isSuspensePromise(o)&&isEqualSuspensePromise(o,n)},createSuspensePromise=(t,n)=>{const o={b:t,o:n,c:null},s=new Promise(c=>{o.c=()=>{o.c=null,c()},n.finally(o.c)});return s[SUSPENSE_PROMISE]=o,s},copySuspensePromise=t=>createSuspensePromise(t[SUSPENSE_PROMISE].b,t[SUSPENSE_PROMISE].o),promiseAbortMap=new WeakMap,hasInitialValue=t=>"init"in t,READ_ATOM="r",WRITE_ATOM="w",COMMIT_ATOM="c",SUBSCRIBE_ATOM="s",RESTORE_ATOMS="h",DEV_SUBSCRIBE_STATE="n",DEV_GET_MOUNTED_ATOMS="l",DEV_GET_ATOM_STATE="a",DEV_GET_MOUNTED="m",createStore=t=>{const n=new WeakMap,o=new WeakMap,s=new Map;let c,d;(define_import_meta_env_default&&"production")!=="production"&&(c=new Set,d=new Set);const h=new WeakMap,p=(pu,gl,md)=>{let ef=h.get(gl);ef||(ef=new Map,h.set(gl,ef)),md.then(()=>{ef.get(pu)===md&&(ef.delete(pu),ef.size||h.delete(gl))}),ef.set(pu,md)},y=pu=>{const gl=new Set,md=h.get(pu);return md&&(h.delete(pu),md.forEach((ef,nf)=>{cancelSuspensePromise(ef),gl.add(nf)})),gl},E=new WeakMap,L=pu=>{let gl=E.get(pu);return gl||(gl=new Map,E.set(pu,gl)),gl},F=(pu,gl)=>{if(pu){const md=L(pu);let ef=md.get(gl);return ef||(ef=F(pu.p,gl),ef&&"p"in ef&&isSuspensePromiseAlreadyCancelled(ef.p)&&(ef=void 0),ef&&md.set(gl,ef)),ef}return n.get(gl)},N=(pu,gl,md)=>{if((define_import_meta_env_default&&"production")!=="production"&&Object.freeze(md),pu)L(pu).set(gl,md);else{const ef=n.get(gl);n.set(gl,md),s.has(gl)||s.set(gl,ef)}},z=(pu,gl=new Map,md)=>{if(!md)return gl;const ef=new Map;let nf=!1;return md.forEach(rf=>{var uf;const mf=((uf=F(pu,rf))==null?void 0:uf.r)||0;ef.set(rf,mf),gl.get(rf)!==mf&&(nf=!0)}),gl.size===ef.size&&!nf?gl:ef},oe=(pu,gl,md,ef,nf)=>{const rf=F(pu,gl);if(rf){if(nf&&(!("p"in rf)||!isEqualSuspensePromise(rf.p,nf)))return rf;"p"in rf&&cancelSuspensePromise(rf.p)}const uf={v:md,r:(rf==null?void 0:rf.r)||0,y:!0,d:z(pu,rf==null?void 0:rf.d,ef)};let mf=!(rf!=null&&rf.y);return!rf||!("v"in rf)||!Object.is(rf.v,md)?(mf=!0,++uf.r,uf.d.has(gl)&&(uf.d=new Map(uf.d).set(gl,uf.r))):uf.d!==rf.d&&(uf.d.size!==rf.d.size||!Array.from(uf.d.keys()).every(Cf=>rf.d.has(Cf)))&&(mf=!0,Promise.resolve().then(()=>{fa(pu)})),rf&&!mf?rf:(N(pu,gl,uf),uf)},W=(pu,gl,md,ef,nf)=>{const rf=F(pu,gl);if(rf){if(nf&&(!("p"in rf)||!isEqualSuspensePromise(rf.p,nf)))return rf;"p"in rf&&cancelSuspensePromise(rf.p)}const uf={e:md,r:((rf==null?void 0:rf.r)||0)+1,y:!0,d:z(pu,rf==null?void 0:rf.d,ef)};return N(pu,gl,uf),uf},nt=(pu,gl,md,ef)=>{const nf=F(pu,gl);if(nf&&"p"in nf){if(isEqualSuspensePromise(nf.p,md)&&!isSuspensePromiseAlreadyCancelled(nf.p))return nf.y?nf:{...nf,y:!0};cancelSuspensePromise(nf.p)}p(pu,gl,md);const rf={p:md,r:((nf==null?void 0:nf.r)||0)+1,y:!0,d:z(pu,nf==null?void 0:nf.d,ef)};return N(pu,gl,rf),rf},lt=(pu,gl,md,ef)=>{if(md instanceof Promise){const nf=createSuspensePromise(md,md.then(rf=>{oe(pu,gl,rf,ef,nf)}).catch(rf=>{if(rf instanceof Promise)return isSuspensePromise(rf)?rf.then(()=>{yt(pu,gl,!0)}):rf;W(pu,gl,rf,ef,nf)}));return nt(pu,gl,nf,ef)}return oe(pu,gl,md,ef)},Ee=(pu,gl)=>{const md=F(pu,gl);if(md){const ef={...md,y:!1};N(pu,gl,ef)}else(define_import_meta_env_default&&"production")!=="production"&&console.warn("[Bug] could not invalidate non existing atom",gl)},yt=(pu,gl,md)=>{if(!md){const nf=F(pu,gl);if(nf){if(nf.y&&"p"in nf&&!isSuspensePromiseAlreadyCancelled(nf.p))return nf;if(nf.d.forEach((rf,uf)=>{if(uf!==gl)if(!o.has(uf))yt(pu,uf);else{const mf=F(pu,uf);mf&&!mf.y&&yt(pu,uf)}}),Array.from(nf.d).every(([rf,uf])=>{const mf=F(pu,rf);return mf&&!("p"in mf)&&mf.r===uf}))return nf.y?nf:{...nf,y:!0}}}const ef=new Set;try{const nf=gl.read(rf=>{ef.add(rf);const uf=rf===gl?F(pu,rf):yt(pu,rf);if(uf){if("e"in uf)throw uf.e;if("p"in uf)throw uf.p;return uf.v}if(hasInitialValue(rf))return rf.init;throw new Error("no atom init")});return lt(pu,gl,nf,ef)}catch(nf){if(nf instanceof Promise){const rf=isSuspensePromise(nf)&&isSuspensePromiseAlreadyCancelled(nf)?copySuspensePromise(nf):createSuspensePromise(nf,nf);return nt(pu,gl,rf,ef)}return W(pu,gl,nf,ef)}},Ai=(pu,gl)=>yt(gl,pu),zi=(pu,gl)=>{let md=o.get(gl);return md||(md=Wa(pu,gl)),md},ha=(pu,gl)=>!gl.l.size&&(!gl.t.size||gl.t.size===1&&gl.t.has(pu)),ba=(pu,gl)=>{const md=o.get(gl);md&&ha(gl,md)&&pi(pu,gl)},Sa=(pu,gl)=>{const md=o.get(gl);md==null||md.t.forEach(ef=>{ef!==gl&&(Ee(pu,ef),Sa(pu,ef))})},ya=(pu,gl,md)=>{let ef=!0;const nf=(mf,Cf)=>{const vf=yt(pu,mf);if("e"in vf)throw vf.e;if("p"in vf){if(Cf!=null&&Cf.unstable_promise)return vf.p.then(()=>{const bf=F(pu,mf);return bf&&"p"in bf&&bf.p===vf.p?new Promise(Pf=>setTimeout(Pf)).then(()=>nf(mf,Cf)):nf(mf,Cf)});throw(define_import_meta_env_default&&"production")!=="production"&&console.info("Reading pending atom state in write operation. We throw a promise for now.",mf),vf.p}if("v"in vf)return vf.v;throw(define_import_meta_env_default&&"production")!=="production"&&console.warn("[Bug] no value found while reading atom in write operation. This is probably a bug.",mf),new Error("no value found")},rf=(mf,Cf)=>{let vf;if(mf===gl){if(!hasInitialValue(mf))throw new Error("atom not writable");y(mf).forEach(wf=>{wf!==pu&<(wf,mf,Cf)});const Pf=F(pu,mf),Lf=lt(pu,mf,Cf);Pf!==Lf&&Sa(pu,mf)}else vf=ya(pu,mf,Cf);return ef||fa(pu),vf},uf=gl.write(nf,rf,md);return ef=!1,uf},ms=(pu,gl,md)=>{const ef=ya(md,pu,gl);return fa(md),ef},Wc=pu=>!!pu.write,Wa=(pu,gl,md)=>{const ef={t:new Set(md&&[md]),l:new Set};if(o.set(gl,ef),(define_import_meta_env_default&&"production")!=="production"&&d.add(gl),yt(void 0,gl).d.forEach((rf,uf)=>{const mf=o.get(uf);mf?mf.t.add(gl):uf!==gl&&Wa(pu,uf,gl)}),Wc(gl)&&gl.onMount){const rf=mf=>ms(gl,mf,pu),uf=gl.onMount(rf);pu=void 0,uf&&(ef.u=uf)}return ef},pi=(pu,gl)=>{var md;const ef=(md=o.get(gl))==null?void 0:md.u;ef&&ef(),o.delete(gl),(define_import_meta_env_default&&"production")!=="production"&&d.delete(gl);const nf=F(pu,gl);nf?("p"in nf&&cancelSuspensePromise(nf.p),nf.d.forEach((rf,uf)=>{if(uf!==gl){const mf=o.get(uf);mf&&(mf.t.delete(gl),ha(uf,mf)&&pi(pu,uf))}})):(define_import_meta_env_default&&"production")!=="production"&&console.warn("[Bug] could not find atom state to unmount",gl)},mt=(pu,gl,md,ef)=>{const nf=new Set(md.d.keys());ef==null||ef.forEach((rf,uf)=>{if(nf.has(uf)){nf.delete(uf);return}const mf=o.get(uf);mf&&(mf.t.delete(gl),ha(uf,mf)&&pi(pu,uf))}),nf.forEach(rf=>{const uf=o.get(rf);uf?uf.t.add(gl):o.has(gl)&&Wa(pu,rf,gl)})},fa=pu=>{if(pu){L(pu).forEach((md,ef)=>{const nf=n.get(ef);if(md!==nf){const rf=o.get(ef);rf==null||rf.l.forEach(uf=>uf(pu))}});return}for(;s.size;){const gl=Array.from(s);s.clear(),gl.forEach(([md,ef])=>{const nf=F(void 0,md);if(nf&&nf.d!==(ef==null?void 0:ef.d)&&mt(void 0,md,nf,ef==null?void 0:ef.d),ef&&!ef.y&&(nf!=null&&nf.y))return;const rf=o.get(md);rf==null||rf.l.forEach(uf=>uf())})}(define_import_meta_env_default&&"production")!=="production"&&c.forEach(gl=>gl())},Ra=pu=>{L(pu).forEach((md,ef)=>{const nf=n.get(ef);(!nf||md.r>nf.r||md.y!==nf.y||md.r===nf.r&&md.d!==nf.d)&&(n.set(ef,md),md.d!==(nf==null?void 0:nf.d)&&mt(pu,ef,md,nf==null?void 0:nf.d))})},sl=(pu,gl)=>{gl&&Ra(gl),fa(void 0)},Zd=(pu,gl,md)=>{const nf=zi(md,pu).l;return nf.add(gl),()=>{nf.delete(gl),ba(md,pu)}},Xd=(pu,gl)=>{for(const[md,ef]of pu)hasInitialValue(md)&&(lt(gl,md,ef),Sa(gl,md));fa(gl)};return(define_import_meta_env_default&&"production")!=="production"?{[READ_ATOM]:Ai,[WRITE_ATOM]:ms,[COMMIT_ATOM]:sl,[SUBSCRIBE_ATOM]:Zd,[RESTORE_ATOMS]:Xd,[DEV_SUBSCRIBE_STATE]:pu=>(c.add(pu),()=>{c.delete(pu)}),[DEV_GET_MOUNTED_ATOMS]:()=>d.values(),[DEV_GET_ATOM_STATE]:pu=>n.get(pu),[DEV_GET_MOUNTED]:pu=>o.get(pu)}:{[READ_ATOM]:Ai,[WRITE_ATOM]:ms,[COMMIT_ATOM]:sl,[SUBSCRIBE_ATOM]:Zd,[RESTORE_ATOMS]:Xd}},createScopeContainer=(t,n)=>({s:n?n(t).SECRET_INTERNAL_store:createStore()}),ScopeContextMap=new Map,getScopeContext=t=>(ScopeContextMap.has(t)||ScopeContextMap.set(t,React.createContext(createScopeContainer())),ScopeContextMap.get(t));function atom(t,n){return atom$1(t,n)}function useAtomValue(t,n){const o=getScopeContext(n),s=React.useContext(o),{s:c,v:d}=s,h=N=>{const z=c[READ_ATOM](t,N);if((define_import_meta_env_default&&"production")!=="production"&&!z.y)throw new Error("should not be invalidated");if("e"in z)throw z.e;if("p"in z)throw z.p;if("v"in z)return z.v;throw new Error("no atom value")},[[p,y,E],L]=React.useReducer((N,z)=>{const oe=h(z);return Object.is(N[1],oe)&&N[2]===t?N:[z,oe,t]},d,N=>{const z=h(N);return[N,z,t]});let F=y;return E!==t&&(L(p),F=h(p)),React.useEffect(()=>{const{v:N}=s;N&&c[COMMIT_ATOM](t,N);const z=c[SUBSCRIBE_ATOM](t,L,N);return L(N),z},[c,t,s]),React.useEffect(()=>{c[COMMIT_ATOM](t,p)}),React.useDebugValue(F),F}function useSetAtom(t,n){const o=getScopeContext(n),{s,w:c}=React.useContext(o);return React.useCallback(h=>{if((define_import_meta_env_default&&"production")!=="production"&&!("write"in t))throw new Error("not writable atom");const p=y=>s[WRITE_ATOM](t,h,y);return c?c(p):p()},[s,c,t])}function useAtom(t,n){return"scope"in t&&(console.warn("atom.scope is deprecated. Please do useAtom(atom, scope) instead."),n=t.scope),[useAtomValue(t,n),useSetAtom(t,n)]}var freeGlobal=typeof global=="object"&&global&&global.Object===Object&&global,freeSelf=typeof self=="object"&&self&&self.Object===Object&&self,root=freeGlobal||freeSelf||Function("return this")(),Symbol$1=root.Symbol,objectProto$h=Object.prototype,hasOwnProperty$f=objectProto$h.hasOwnProperty,nativeObjectToString$1=objectProto$h.toString,symToStringTag$1=Symbol$1?Symbol$1.toStringTag:void 0;function getRawTag(t){var n=hasOwnProperty$f.call(t,symToStringTag$1),o=t[symToStringTag$1];try{t[symToStringTag$1]=void 0;var s=!0}catch{}var c=nativeObjectToString$1.call(t);return s&&(n?t[symToStringTag$1]=o:delete t[symToStringTag$1]),c}var objectProto$g=Object.prototype,nativeObjectToString=objectProto$g.toString;function objectToString$1(t){return nativeObjectToString.call(t)}var nullTag="[object Null]",undefinedTag="[object Undefined]",symToStringTag=Symbol$1?Symbol$1.toStringTag:void 0;function baseGetTag(t){return t==null?t===void 0?undefinedTag:nullTag:symToStringTag&&symToStringTag in Object(t)?getRawTag(t):objectToString$1(t)}function isObjectLike(t){return t!=null&&typeof t=="object"}var symbolTag$3="[object Symbol]";function isSymbol(t){return typeof t=="symbol"||isObjectLike(t)&&baseGetTag(t)==symbolTag$3}function arrayMap(t,n){for(var o=-1,s=t==null?0:t.length,c=Array(s);++o<s;)c[o]=n(t[o],o,t);return c}var isArray$4=Array.isArray,INFINITY$2=1/0,symbolProto$2=Symbol$1?Symbol$1.prototype:void 0,symbolToString=symbolProto$2?symbolProto$2.toString:void 0;function baseToString(t){if(typeof t=="string")return t;if(isArray$4(t))return arrayMap(t,baseToString)+"";if(isSymbol(t))return symbolToString?symbolToString.call(t):"";var n=t+"";return n=="0"&&1/t==-INFINITY$2?"-0":n}function isObject$2(t){var n=typeof t;return t!=null&&(n=="object"||n=="function")}function identity$2(t){return t}var asyncTag="[object AsyncFunction]",funcTag$2="[object Function]",genTag$1="[object GeneratorFunction]",proxyTag="[object Proxy]";function isFunction$2(t){if(!isObject$2(t))return!1;var n=baseGetTag(t);return n==funcTag$2||n==genTag$1||n==asyncTag||n==proxyTag}var coreJsData=root["__core-js_shared__"],maskSrcKey=function(){var t=/[^.]+$/.exec(coreJsData&&coreJsData.keys&&coreJsData.keys.IE_PROTO||"");return t?"Symbol(src)_1."+t:""}();function isMasked(t){return!!maskSrcKey&&maskSrcKey in t}var funcProto$2=Function.prototype,funcToString$2=funcProto$2.toString;function toSource(t){if(t!=null){try{return funcToString$2.call(t)}catch{}try{return t+""}catch{}}return""}var reRegExpChar=/[\\^$.*+?()[\]{}|]/g,reIsHostCtor=/^\[object .+?Constructor\]$/,funcProto$1=Function.prototype,objectProto$f=Object.prototype,funcToString$1=funcProto$1.toString,hasOwnProperty$e=objectProto$f.hasOwnProperty,reIsNative=RegExp("^"+funcToString$1.call(hasOwnProperty$e).replace(reRegExpChar,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function baseIsNative(t){if(!isObject$2(t)||isMasked(t))return!1;var n=isFunction$2(t)?reIsNative:reIsHostCtor;return n.test(toSource(t))}function getValue$1(t,n){return t==null?void 0:t[n]}function getNative(t,n){var o=getValue$1(t,n);return baseIsNative(o)?o:void 0}var WeakMap$1=getNative(root,"WeakMap"),objectCreate=Object.create,baseCreate=function(){function t(){}return function(n){if(!isObject$2(n))return{};if(objectCreate)return objectCreate(n);t.prototype=n;var o=new t;return t.prototype=void 0,o}}();function apply(t,n,o){switch(o.length){case 0:return t.call(n);case 1:return t.call(n,o[0]);case 2:return t.call(n,o[0],o[1]);case 3:return t.call(n,o[0],o[1],o[2])}return t.apply(n,o)}function noop$2(){}function copyArray(t,n){var o=-1,s=t.length;for(n||(n=Array(s));++o<s;)n[o]=t[o];return n}var HOT_COUNT=800,HOT_SPAN=16,nativeNow=Date.now;function shortOut(t){var n=0,o=0;return function(){var s=nativeNow(),c=HOT_SPAN-(s-o);if(o=s,c>0){if(++n>=HOT_COUNT)return arguments[0]}else n=0;return t.apply(void 0,arguments)}}function constant(t){return function(){return t}}var defineProperty=function(){try{var t=getNative(Object,"defineProperty");return t({},"",{}),t}catch{}}(),baseSetToString=defineProperty?function(t,n){return defineProperty(t,"toString",{configurable:!0,enumerable:!1,value:constant(n),writable:!0})}:identity$2,setToString=shortOut(baseSetToString);function arrayEach(t,n){for(var o=-1,s=t==null?0:t.length;++o<s&&n(t[o],o,t)!==!1;);return t}function baseFindIndex(t,n,o,s){for(var c=t.length,d=o+-1;++d<c;)if(n(t[d],d,t))return d;return-1}function baseIsNaN(t){return t!==t}function strictIndexOf(t,n,o){for(var s=o-1,c=t.length;++s<c;)if(t[s]===n)return s;return-1}function baseIndexOf(t,n,o){return n===n?strictIndexOf(t,n,o):baseFindIndex(t,baseIsNaN,o)}function arrayIncludes(t,n){var o=t==null?0:t.length;return!!o&&baseIndexOf(t,n,0)>-1}var MAX_SAFE_INTEGER$1=9007199254740991,reIsUint=/^(?:0|[1-9]\d*)$/;function isIndex(t,n){var o=typeof t;return n=n??MAX_SAFE_INTEGER$1,!!n&&(o=="number"||o!="symbol"&&reIsUint.test(t))&&t>-1&&t%1==0&&t<n}function baseAssignValue(t,n,o){n=="__proto__"&&defineProperty?defineProperty(t,n,{configurable:!0,enumerable:!0,value:o,writable:!0}):t[n]=o}function eq(t,n){return t===n||t!==t&&n!==n}var objectProto$e=Object.prototype,hasOwnProperty$d=objectProto$e.hasOwnProperty;function assignValue(t,n,o){var s=t[n];(!(hasOwnProperty$d.call(t,n)&&eq(s,o))||o===void 0&&!(n in t))&&baseAssignValue(t,n,o)}function copyObject(t,n,o,s){var c=!o;o||(o={});for(var d=-1,h=n.length;++d<h;){var p=n[d],y=void 0;y===void 0&&(y=t[p]),c?baseAssignValue(o,p,y):assignValue(o,p,y)}return o}var nativeMax=Math.max;function overRest(t,n,o){return n=nativeMax(n===void 0?t.length-1:n,0),function(){for(var s=arguments,c=-1,d=nativeMax(s.length-n,0),h=Array(d);++c<d;)h[c]=s[n+c];c=-1;for(var p=Array(n+1);++c<n;)p[c]=s[c];return p[n]=o(h),apply(t,this,p)}}function baseRest(t,n){return setToString(overRest(t,n,identity$2),t+"")}var MAX_SAFE_INTEGER=9007199254740991;function isLength(t){return typeof t=="number"&&t>-1&&t%1==0&&t<=MAX_SAFE_INTEGER}function isArrayLike(t){return t!=null&&isLength(t.length)&&!isFunction$2(t)}function isIterateeCall(t,n,o){if(!isObject$2(o))return!1;var s=typeof n;return(s=="number"?isArrayLike(o)&&isIndex(n,o.length):s=="string"&&n in o)?eq(o[n],t):!1}function createAssigner(t){return baseRest(function(n,o){var s=-1,c=o.length,d=c>1?o[c-1]:void 0,h=c>2?o[2]:void 0;for(d=t.length>3&&typeof d=="function"?(c--,d):void 0,h&&isIterateeCall(o[0],o[1],h)&&(d=c<3?void 0:d,c=1),n=Object(n);++s<c;){var p=o[s];p&&t(n,p,s,d)}return n})}var objectProto$d=Object.prototype;function isPrototype(t){var n=t&&t.constructor,o=typeof n=="function"&&n.prototype||objectProto$d;return t===o}function baseTimes(t,n){for(var o=-1,s=Array(t);++o<t;)s[o]=n(o);return s}var argsTag$3="[object Arguments]";function baseIsArguments(t){return isObjectLike(t)&&baseGetTag(t)==argsTag$3}var objectProto$c=Object.prototype,hasOwnProperty$c=objectProto$c.hasOwnProperty,propertyIsEnumerable$1=objectProto$c.propertyIsEnumerable,isArguments=baseIsArguments(function(){return arguments}())?baseIsArguments:function(t){return isObjectLike(t)&&hasOwnProperty$c.call(t,"callee")&&!propertyIsEnumerable$1.call(t,"callee")};function stubFalse(){return!1}var freeExports$2=typeof exports=="object"&&exports&&!exports.nodeType&&exports,freeModule$2=freeExports$2&&typeof module=="object"&&module&&!module.nodeType&&module,moduleExports$2=freeModule$2&&freeModule$2.exports===freeExports$2,Buffer$4=moduleExports$2?root.Buffer:void 0,nativeIsBuffer=Buffer$4?Buffer$4.isBuffer:void 0,isBuffer$1=nativeIsBuffer||stubFalse,argsTag$2="[object Arguments]",arrayTag$2="[object Array]",boolTag$3="[object Boolean]",dateTag$3="[object Date]",errorTag$2="[object Error]",funcTag$1="[object Function]",mapTag$5="[object Map]",numberTag$3="[object Number]",objectTag$4="[object Object]",regexpTag$3="[object RegExp]",setTag$5="[object Set]",stringTag$3="[object String]",weakMapTag$2="[object WeakMap]",arrayBufferTag$3="[object ArrayBuffer]",dataViewTag$4="[object DataView]",float32Tag$2="[object Float32Array]",float64Tag$2="[object Float64Array]",int8Tag$2="[object Int8Array]",int16Tag$2="[object Int16Array]",int32Tag$2="[object Int32Array]",uint8Tag$2="[object Uint8Array]",uint8ClampedTag$2="[object Uint8ClampedArray]",uint16Tag$2="[object Uint16Array]",uint32Tag$2="[object Uint32Array]",typedArrayTags={};typedArrayTags[float32Tag$2]=typedArrayTags[float64Tag$2]=typedArrayTags[int8Tag$2]=typedArrayTags[int16Tag$2]=typedArrayTags[int32Tag$2]=typedArrayTags[uint8Tag$2]=typedArrayTags[uint8ClampedTag$2]=typedArrayTags[uint16Tag$2]=typedArrayTags[uint32Tag$2]=!0,typedArrayTags[argsTag$2]=typedArrayTags[arrayTag$2]=typedArrayTags[arrayBufferTag$3]=typedArrayTags[boolTag$3]=typedArrayTags[dataViewTag$4]=typedArrayTags[dateTag$3]=typedArrayTags[errorTag$2]=typedArrayTags[funcTag$1]=typedArrayTags[mapTag$5]=typedArrayTags[numberTag$3]=typedArrayTags[objectTag$4]=typedArrayTags[regexpTag$3]=typedArrayTags[setTag$5]=typedArrayTags[stringTag$3]=typedArrayTags[weakMapTag$2]=!1;function baseIsTypedArray(t){return isObjectLike(t)&&isLength(t.length)&&!!typedArrayTags[baseGetTag(t)]}function baseUnary(t){return function(n){return t(n)}}var freeExports$1=typeof exports=="object"&&exports&&!exports.nodeType&&exports,freeModule$1=freeExports$1&&typeof module=="object"&&module&&!module.nodeType&&module,moduleExports$1=freeModule$1&&freeModule$1.exports===freeExports$1,freeProcess=moduleExports$1&&freeGlobal.process,nodeUtil=function(){try{var t=freeModule$1&&freeModule$1.require&&freeModule$1.require("util").types;return t||freeProcess&&freeProcess.binding&&freeProcess.binding("util")}catch{}}(),nodeIsTypedArray=nodeUtil&&nodeUtil.isTypedArray,isTypedArray=nodeIsTypedArray?baseUnary(nodeIsTypedArray):baseIsTypedArray,objectProto$b=Object.prototype,hasOwnProperty$b=objectProto$b.hasOwnProperty;function arrayLikeKeys(t,n){var o=isArray$4(t),s=!o&&isArguments(t),c=!o&&!s&&isBuffer$1(t),d=!o&&!s&&!c&&isTypedArray(t),h=o||s||c||d,p=h?baseTimes(t.length,String):[],y=p.length;for(var E in t)(n||hasOwnProperty$b.call(t,E))&&!(h&&(E=="length"||c&&(E=="offset"||E=="parent")||d&&(E=="buffer"||E=="byteLength"||E=="byteOffset")||isIndex(E,y)))&&p.push(E);return p}function overArg(t,n){return function(o){return t(n(o))}}var nativeKeys=overArg(Object.keys,Object),objectProto$a=Object.prototype,hasOwnProperty$a=objectProto$a.hasOwnProperty;function baseKeys(t){if(!isPrototype(t))return nativeKeys(t);var n=[];for(var o in Object(t))hasOwnProperty$a.call(t,o)&&o!="constructor"&&n.push(o);return n}function keys$1(t){return isArrayLike(t)?arrayLikeKeys(t):baseKeys(t)}function nativeKeysIn(t){var n=[];if(t!=null)for(var o in Object(t))n.push(o);return n}var objectProto$9=Object.prototype,hasOwnProperty$9=objectProto$9.hasOwnProperty;function baseKeysIn(t){if(!isObject$2(t))return nativeKeysIn(t);var n=isPrototype(t),o=[];for(var s in t)s=="constructor"&&(n||!hasOwnProperty$9.call(t,s))||o.push(s);return o}function keysIn(t){return isArrayLike(t)?arrayLikeKeys(t,!0):baseKeysIn(t)}var reIsDeepProp=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,reIsPlainProp=/^\w*$/;function isKey(t,n){if(isArray$4(t))return!1;var o=typeof t;return o=="number"||o=="symbol"||o=="boolean"||t==null||isSymbol(t)?!0:reIsPlainProp.test(t)||!reIsDeepProp.test(t)||n!=null&&t in Object(n)}var nativeCreate=getNative(Object,"create");function hashClear(){this.__data__=nativeCreate?nativeCreate(null):{},this.size=0}function hashDelete(t){var n=this.has(t)&&delete this.__data__[t];return this.size-=n?1:0,n}var HASH_UNDEFINED$2="__lodash_hash_undefined__",objectProto$8=Object.prototype,hasOwnProperty$8=objectProto$8.hasOwnProperty;function hashGet(t){var n=this.__data__;if(nativeCreate){var o=n[t];return o===HASH_UNDEFINED$2?void 0:o}return hasOwnProperty$8.call(n,t)?n[t]:void 0}var objectProto$7=Object.prototype,hasOwnProperty$7=objectProto$7.hasOwnProperty;function hashHas(t){var n=this.__data__;return nativeCreate?n[t]!==void 0:hasOwnProperty$7.call(n,t)}var HASH_UNDEFINED$1="__lodash_hash_undefined__";function hashSet(t,n){var o=this.__data__;return this.size+=this.has(t)?0:1,o[t]=nativeCreate&&n===void 0?HASH_UNDEFINED$1:n,this}function Hash(t){var n=-1,o=t==null?0:t.length;for(this.clear();++n<o;){var s=t[n];this.set(s[0],s[1])}}Hash.prototype.clear=hashClear,Hash.prototype.delete=hashDelete,Hash.prototype.get=hashGet,Hash.prototype.has=hashHas,Hash.prototype.set=hashSet;function listCacheClear(){this.__data__=[],this.size=0}function assocIndexOf(t,n){for(var o=t.length;o--;)if(eq(t[o][0],n))return o;return-1}var arrayProto=Array.prototype,splice=arrayProto.splice;function listCacheDelete(t){var n=this.__data__,o=assocIndexOf(n,t);if(o<0)return!1;var s=n.length-1;return o==s?n.pop():splice.call(n,o,1),--this.size,!0}function listCacheGet(t){var n=this.__data__,o=assocIndexOf(n,t);return o<0?void 0:n[o][1]}function listCacheHas(t){return assocIndexOf(this.__data__,t)>-1}function listCacheSet(t,n){var o=this.__data__,s=assocIndexOf(o,t);return s<0?(++this.size,o.push([t,n])):o[s][1]=n,this}function ListCache(t){var n=-1,o=t==null?0:t.length;for(this.clear();++n<o;){var s=t[n];this.set(s[0],s[1])}}ListCache.prototype.clear=listCacheClear,ListCache.prototype.delete=listCacheDelete,ListCache.prototype.get=listCacheGet,ListCache.prototype.has=listCacheHas,ListCache.prototype.set=listCacheSet;var Map$2=getNative(root,"Map");function mapCacheClear(){this.size=0,this.__data__={hash:new Hash,map:new(Map$2||ListCache),string:new Hash}}function isKeyable(t){var n=typeof t;return n=="string"||n=="number"||n=="symbol"||n=="boolean"?t!=="__proto__":t===null}function getMapData(t,n){var o=t.__data__;return isKeyable(n)?o[typeof n=="string"?"string":"hash"]:o.map}function mapCacheDelete(t){var n=getMapData(this,t).delete(t);return this.size-=n?1:0,n}function mapCacheGet(t){return getMapData(this,t).get(t)}function mapCacheHas(t){return getMapData(this,t).has(t)}function mapCacheSet(t,n){var o=getMapData(this,t),s=o.size;return o.set(t,n),this.size+=o.size==s?0:1,this}function MapCache(t){var n=-1,o=t==null?0:t.length;for(this.clear();++n<o;){var s=t[n];this.set(s[0],s[1])}}MapCache.prototype.clear=mapCacheClear,MapCache.prototype.delete=mapCacheDelete,MapCache.prototype.get=mapCacheGet,MapCache.prototype.has=mapCacheHas,MapCache.prototype.set=mapCacheSet;var FUNC_ERROR_TEXT$1="Expected a function";function memoize(t,n){if(typeof t!="function"||n!=null&&typeof n!="function")throw new TypeError(FUNC_ERROR_TEXT$1);var o=function(){var s=arguments,c=n?n.apply(this,s):s[0],d=o.cache;if(d.has(c))return d.get(c);var h=t.apply(this,s);return o.cache=d.set(c,h)||d,h};return o.cache=new(memoize.Cache||MapCache),o}memoize.Cache=MapCache;var MAX_MEMOIZE_SIZE=500;function memoizeCapped(t){var n=memoize(t,function(s){return o.size===MAX_MEMOIZE_SIZE&&o.clear(),s}),o=n.cache;return n}var rePropName=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,reEscapeChar=/\\(\\)?/g,stringToPath=memoizeCapped(function(t){var n=[];return t.charCodeAt(0)===46&&n.push(""),t.replace(rePropName,function(o,s,c,d){n.push(c?d.replace(reEscapeChar,"$1"):s||o)}),n});function toString$1(t){return t==null?"":baseToString(t)}function castPath(t,n){return isArray$4(t)?t:isKey(t,n)?[t]:stringToPath(toString$1(t))}var INFINITY$1=1/0;function toKey(t){if(typeof t=="string"||isSymbol(t))return t;var n=t+"";return n=="0"&&1/t==-INFINITY$1?"-0":n}function baseGet(t,n){n=castPath(n,t);for(var o=0,s=n.length;t!=null&&o<s;)t=t[toKey(n[o++])];return o&&o==s?t:void 0}function get$1(t,n,o){var s=t==null?void 0:baseGet(t,n);return s===void 0?o:s}function arrayPush(t,n){for(var o=-1,s=n.length,c=t.length;++o<s;)t[c+o]=n[o];return t}var spreadableSymbol=Symbol$1?Symbol$1.isConcatSpreadable:void 0;function isFlattenable(t){return isArray$4(t)||isArguments(t)||!!(spreadableSymbol&&t&&t[spreadableSymbol])}function baseFlatten(t,n,o,s,c){var d=-1,h=t.length;for(o||(o=isFlattenable),c||(c=[]);++d<h;){var p=t[d];o(p)?arrayPush(c,p):c[c.length]=p}return c}function flatten$1(t){var n=t==null?0:t.length;return n?baseFlatten(t):[]}function flatRest(t){return setToString(overRest(t,void 0,flatten$1),t+"")}var getPrototype=overArg(Object.getPrototypeOf,Object),objectTag$3="[object Object]",funcProto=Function.prototype,objectProto$6=Object.prototype,funcToString=funcProto.toString,hasOwnProperty$6=objectProto$6.hasOwnProperty,objectCtorString=funcToString.call(Object);function isPlainObject(t){if(!isObjectLike(t)||baseGetTag(t)!=objectTag$3)return!1;var n=getPrototype(t);if(n===null)return!0;var o=hasOwnProperty$6.call(n,"constructor")&&n.constructor;return typeof o=="function"&&o instanceof o&&funcToString.call(o)==objectCtorString}function baseSlice(t,n,o){var s=-1,c=t.length;n<0&&(n=-n>c?0:c+n),o=o>c?c:o,o<0&&(o+=c),c=n>o?0:o-n>>>0,n>>>=0;for(var d=Array(c);++s<c;)d[s]=t[s+n];return d}function stackClear(){this.__data__=new ListCache,this.size=0}function stackDelete(t){var n=this.__data__,o=n.delete(t);return this.size=n.size,o}function stackGet(t){return this.__data__.get(t)}function stackHas(t){return this.__data__.has(t)}var LARGE_ARRAY_SIZE$2=200;function stackSet(t,n){var o=this.__data__;if(o instanceof ListCache){var s=o.__data__;if(!Map$2||s.length<LARGE_ARRAY_SIZE$2-1)return s.push([t,n]),this.size=++o.size,this;o=this.__data__=new MapCache(s)}return o.set(t,n),this.size=o.size,this}function Stack$1(t){var n=this.__data__=new ListCache(t);this.size=n.size}Stack$1.prototype.clear=stackClear,Stack$1.prototype.delete=stackDelete,Stack$1.prototype.get=stackGet,Stack$1.prototype.has=stackHas,Stack$1.prototype.set=stackSet;function baseAssign(t,n){return t&©Object(n,keys$1(n),t)}function baseAssignIn(t,n){return t&©Object(n,keysIn(n),t)}var freeExports=typeof exports=="object"&&exports&&!exports.nodeType&&exports,freeModule=freeExports&&typeof module=="object"&&module&&!module.nodeType&&module,moduleExports=freeModule&&freeModule.exports===freeExports,Buffer$3=moduleExports?root.Buffer:void 0,allocUnsafe$1=Buffer$3?Buffer$3.allocUnsafe:void 0;function cloneBuffer(t,n){if(n)return t.slice();var o=t.length,s=allocUnsafe$1?allocUnsafe$1(o):new t.constructor(o);return t.copy(s),s}function arrayFilter(t,n){for(var o=-1,s=t==null?0:t.length,c=0,d=[];++o<s;){var h=t[o];n(h,o,t)&&(d[c++]=h)}return d}function stubArray(){return[]}var objectProto$5=Object.prototype,propertyIsEnumerable=objectProto$5.propertyIsEnumerable,nativeGetSymbols$1=Object.getOwnPropertySymbols,getSymbols=nativeGetSymbols$1?function(t){return t==null?[]:(t=Object(t),arrayFilter(nativeGetSymbols$1(t),function(n){return propertyIsEnumerable.call(t,n)}))}:stubArray;function copySymbols(t,n){return copyObject(t,getSymbols(t),n)}var nativeGetSymbols=Object.getOwnPropertySymbols,getSymbolsIn=nativeGetSymbols?function(t){for(var n=[];t;)arrayPush(n,getSymbols(t)),t=getPrototype(t);return n}:stubArray;function copySymbolsIn(t,n){return copyObject(t,getSymbolsIn(t),n)}function baseGetAllKeys(t,n,o){var s=n(t);return isArray$4(t)?s:arrayPush(s,o(t))}function getAllKeys(t){return baseGetAllKeys(t,keys$1,getSymbols)}function getAllKeysIn(t){return baseGetAllKeys(t,keysIn,getSymbolsIn)}var DataView$1=getNative(root,"DataView"),Promise$1=getNative(root,"Promise"),Set$1=getNative(root,"Set"),mapTag$4="[object Map]",objectTag$2="[object Object]",promiseTag="[object Promise]",setTag$4="[object Set]",weakMapTag$1="[object WeakMap]",dataViewTag$3="[object DataView]",dataViewCtorString=toSource(DataView$1),mapCtorString=toSource(Map$2),promiseCtorString=toSource(Promise$1),setCtorString=toSource(Set$1),weakMapCtorString=toSource(WeakMap$1),getTag$1=baseGetTag;(DataView$1&&getTag$1(new DataView$1(new ArrayBuffer(1)))!=dataViewTag$3||Map$2&&getTag$1(new Map$2)!=mapTag$4||Promise$1&&getTag$1(Promise$1.resolve())!=promiseTag||Set$1&&getTag$1(new Set$1)!=setTag$4||WeakMap$1&&getTag$1(new WeakMap$1)!=weakMapTag$1)&&(getTag$1=function(t){var n=baseGetTag(t),o=n==objectTag$2?t.constructor:void 0,s=o?toSource(o):"";if(s)switch(s){case dataViewCtorString:return dataViewTag$3;case mapCtorString:return mapTag$4;case promiseCtorString:return promiseTag;case setCtorString:return setTag$4;case weakMapCtorString:return weakMapTag$1}return n});var objectProto$4=Object.prototype,hasOwnProperty$5=objectProto$4.hasOwnProperty;function initCloneArray(t){var n=t.length,o=new t.constructor(n);return n&&typeof t[0]=="string"&&hasOwnProperty$5.call(t,"index")&&(o.index=t.index,o.input=t.input),o}var Uint8Array$1=root.Uint8Array;function cloneArrayBuffer(t){var n=new t.constructor(t.byteLength);return new Uint8Array$1(n).set(new Uint8Array$1(t)),n}function cloneDataView(t,n){var o=n?cloneArrayBuffer(t.buffer):t.buffer;return new t.constructor(o,t.byteOffset,t.byteLength)}var reFlags=/\w*$/;function cloneRegExp(t){var n=new t.constructor(t.source,reFlags.exec(t));return n.lastIndex=t.lastIndex,n}var symbolProto$1=Symbol$1?Symbol$1.prototype:void 0,symbolValueOf$1=symbolProto$1?symbolProto$1.valueOf:void 0;function cloneSymbol(t){return symbolValueOf$1?Object(symbolValueOf$1.call(t)):{}}function cloneTypedArray(t,n){var o=n?cloneArrayBuffer(t.buffer):t.buffer;return new t.constructor(o,t.byteOffset,t.length)}var boolTag$2="[object Boolean]",dateTag$2="[object Date]",mapTag$3="[object Map]",numberTag$2="[object Number]",regexpTag$2="[object RegExp]",setTag$3="[object Set]",stringTag$2="[object String]",symbolTag$2="[object Symbol]",arrayBufferTag$2="[object ArrayBuffer]",dataViewTag$2="[object DataView]",float32Tag$1="[object Float32Array]",float64Tag$1="[object Float64Array]",int8Tag$1="[object Int8Array]",int16Tag$1="[object Int16Array]",int32Tag$1="[object Int32Array]",uint8Tag$1="[object Uint8Array]",uint8ClampedTag$1="[object Uint8ClampedArray]",uint16Tag$1="[object Uint16Array]",uint32Tag$1="[object Uint32Array]";function initCloneByTag(t,n,o){var s=t.constructor;switch(n){case arrayBufferTag$2:return cloneArrayBuffer(t);case boolTag$2:case dateTag$2:return new s(+t);case dataViewTag$2:return cloneDataView(t,o);case float32Tag$1:case float64Tag$1:case int8Tag$1:case int16Tag$1:case int32Tag$1:case uint8Tag$1:case uint8ClampedTag$1:case uint16Tag$1:case uint32Tag$1:return cloneTypedArray(t,o);case mapTag$3:return new s;case numberTag$2:case stringTag$2:return new s(t);case regexpTag$2:return cloneRegExp(t);case setTag$3:return new s;case symbolTag$2:return cloneSymbol(t)}}function initCloneObject(t){return typeof t.constructor=="function"&&!isPrototype(t)?baseCreate(getPrototype(t)):{}}var mapTag$2="[object Map]";function baseIsMap(t){return isObjectLike(t)&&getTag$1(t)==mapTag$2}var nodeIsMap=nodeUtil&&nodeUtil.isMap,isMap=nodeIsMap?baseUnary(nodeIsMap):baseIsMap,setTag$2="[object Set]";function baseIsSet(t){return isObjectLike(t)&&getTag$1(t)==setTag$2}var nodeIsSet=nodeUtil&&nodeUtil.isSet,isSet=nodeIsSet?baseUnary(nodeIsSet):baseIsSet,CLONE_DEEP_FLAG$2=1,CLONE_FLAT_FLAG$1=2,CLONE_SYMBOLS_FLAG$2=4,argsTag$1="[object Arguments]",arrayTag$1="[object Array]",boolTag$1="[object Boolean]",dateTag$1="[object Date]",errorTag$1="[object Error]",funcTag="[object Function]",genTag="[object GeneratorFunction]",mapTag$1="[object Map]",numberTag$1="[object Number]",objectTag$1="[object Object]",regexpTag$1="[object RegExp]",setTag$1="[object Set]",stringTag$1="[object String]",symbolTag$1="[object Symbol]",weakMapTag="[object WeakMap]",arrayBufferTag$1="[object ArrayBuffer]",dataViewTag$1="[object DataView]",float32Tag="[object Float32Array]",float64Tag="[object Float64Array]",int8Tag="[object Int8Array]",int16Tag="[object Int16Array]",int32Tag="[object Int32Array]",uint8Tag="[object Uint8Array]",uint8ClampedTag="[object Uint8ClampedArray]",uint16Tag="[object Uint16Array]",uint32Tag="[object Uint32Array]",cloneableTags={};cloneableTags[argsTag$1]=cloneableTags[arrayTag$1]=cloneableTags[arrayBufferTag$1]=cloneableTags[dataViewTag$1]=cloneableTags[boolTag$1]=cloneableTags[dateTag$1]=cloneableTags[float32Tag]=cloneableTags[float64Tag]=cloneableTags[int8Tag]=cloneableTags[int16Tag]=cloneableTags[int32Tag]=cloneableTags[mapTag$1]=cloneableTags[numberTag$1]=cloneableTags[objectTag$1]=cloneableTags[regexpTag$1]=cloneableTags[setTag$1]=cloneableTags[stringTag$1]=cloneableTags[symbolTag$1]=cloneableTags[uint8Tag]=cloneableTags[uint8ClampedTag]=cloneableTags[uint16Tag]=cloneableTags[uint32Tag]=!0,cloneableTags[errorTag$1]=cloneableTags[funcTag]=cloneableTags[weakMapTag]=!1;function baseClone(t,n,o,s,c,d){var h,p=n&CLONE_DEEP_FLAG$2,y=n&CLONE_FLAT_FLAG$1,E=n&CLONE_SYMBOLS_FLAG$2;if(o&&(h=c?o(t,s,c,d):o(t)),h!==void 0)return h;if(!isObject$2(t))return t;var L=isArray$4(t);if(L){if(h=initCloneArray(t),!p)return copyArray(t,h)}else{var F=getTag$1(t),N=F==funcTag||F==genTag;if(isBuffer$1(t))return cloneBuffer(t,p);if(F==objectTag$1||F==argsTag$1||N&&!c){if(h=y||N?{}:initCloneObject(t),!p)return y?copySymbolsIn(t,baseAssignIn(h,t)):copySymbols(t,baseAssign(h,t))}else{if(!cloneableTags[F])return c?t:{};h=initCloneByTag(t,F,p)}}d||(d=new Stack$1);var z=d.get(t);if(z)return z;d.set(t,h),isSet(t)?t.forEach(function(nt){h.add(baseClone(nt,n,o,nt,t,d))}):isMap(t)&&t.forEach(function(nt,lt){h.set(lt,baseClone(nt,n,o,lt,t,d))});var oe=E?y?getAllKeysIn:getAllKeys:y?keysIn:keys$1,W=L?void 0:oe(t);return arrayEach(W||t,function(nt,lt){W&&(lt=nt,nt=t[lt]),assignValue(h,lt,baseClone(nt,n,o,lt,t,d))}),h}var CLONE_DEEP_FLAG$1=1,CLONE_SYMBOLS_FLAG$1=4;function cloneDeep(t){return baseClone(t,CLONE_DEEP_FLAG$1|CLONE_SYMBOLS_FLAG$1)}var HASH_UNDEFINED="__lodash_hash_undefined__";function setCacheAdd(t){return this.__data__.set(t,HASH_UNDEFINED),this}function setCacheHas(t){return this.__data__.has(t)}function SetCache(t){var n=-1,o=t==null?0:t.length;for(this.__data__=new MapCache;++n<o;)this.add(t[n])}SetCache.prototype.add=SetCache.prototype.push=setCacheAdd,SetCache.prototype.has=setCacheHas;function arraySome(t,n){for(var o=-1,s=t==null?0:t.length;++o<s;)if(n(t[o],o,t))return!0;return!1}function cacheHas(t,n){return t.has(n)}var COMPARE_PARTIAL_FLAG$5=1,COMPARE_UNORDERED_FLAG$3=2;function equalArrays$2(t,n,o,s,c,d){var h=o&COMPARE_PARTIAL_FLAG$5,p=t.length,y=n.length;if(p!=y&&!(h&&y>p))return!1;var E=d.get(t),L=d.get(n);if(E&&L)return E==n&&L==t;var F=-1,N=!0,z=o&COMPARE_UNORDERED_FLAG$3?new SetCache:void 0;for(d.set(t,n),d.set(n,t);++F<p;){var oe=t[F],W=n[F];if(s)var nt=h?s(W,oe,F,n,t,d):s(oe,W,F,t,n,d);if(nt!==void 0){if(nt)continue;N=!1;break}if(z){if(!arraySome(n,function(lt,Ee){if(!cacheHas(z,Ee)&&(oe===lt||c(oe,lt,o,s,d)))return z.push(Ee)})){N=!1;break}}else if(!(oe===W||c(oe,W,o,s,d))){N=!1;break}}return d.delete(t),d.delete(n),N}function mapToArray(t){var n=-1,o=Array(t.size);return t.forEach(function(s,c){o[++n]=[c,s]}),o}function setToArray(t){var n=-1,o=Array(t.size);return t.forEach(function(s){o[++n]=s}),o}var COMPARE_PARTIAL_FLAG$4=1,COMPARE_UNORDERED_FLAG$2=2,boolTag="[object Boolean]",dateTag="[object Date]",errorTag="[object Error]",mapTag="[object Map]",numberTag="[object Number]",regexpTag="[object RegExp]",setTag="[object Set]",stringTag="[object String]",symbolTag="[object Symbol]",arrayBufferTag="[object ArrayBuffer]",dataViewTag="[object DataView]",symbolProto=Symbol$1?Symbol$1.prototype:void 0,symbolValueOf=symbolProto?symbolProto.valueOf:void 0;function equalByTag(t,n,o,s,c,d,h){switch(o){case dataViewTag:if(t.byteLength!=n.byteLength||t.byteOffset!=n.byteOffset)return!1;t=t.buffer,n=n.buffer;case arrayBufferTag:return!(t.byteLength!=n.byteLength||!d(new Uint8Array$1(t),new Uint8Array$1(n)));case boolTag:case dateTag:case numberTag:return eq(+t,+n);case errorTag:return t.name==n.name&&t.message==n.message;case regexpTag:case stringTag:return t==n+"";case mapTag:var p=mapToArray;case setTag:var y=s&COMPARE_PARTIAL_FLAG$4;if(p||(p=setToArray),t.size!=n.size&&!y)return!1;var E=h.get(t);if(E)return E==n;s|=COMPARE_UNORDERED_FLAG$2,h.set(t,n);var L=equalArrays$2(p(t),p(n),s,c,d,h);return h.delete(t),L;case symbolTag:if(symbolValueOf)return symbolValueOf.call(t)==symbolValueOf.call(n)}return!1}var COMPARE_PARTIAL_FLAG$3=1,objectProto$3=Object.prototype,hasOwnProperty$4=objectProto$3.hasOwnProperty;function equalObjects(t,n,o,s,c,d){var h=o&COMPARE_PARTIAL_FLAG$3,p=getAllKeys(t),y=p.length,E=getAllKeys(n),L=E.length;if(y!=L&&!h)return!1;for(var F=y;F--;){var N=p[F];if(!(h?N in n:hasOwnProperty$4.call(n,N)))return!1}var z=d.get(t),oe=d.get(n);if(z&&oe)return z==n&&oe==t;var W=!0;d.set(t,n),d.set(n,t);for(var nt=h;++F<y;){N=p[F];var lt=t[N],Ee=n[N];if(s)var yt=h?s(Ee,lt,N,n,t,d):s(lt,Ee,N,t,n,d);if(!(yt===void 0?lt===Ee||c(lt,Ee,o,s,d):yt)){W=!1;break}nt||(nt=N=="constructor")}if(W&&!nt){var Ai=t.constructor,zi=n.constructor;Ai!=zi&&"constructor"in t&&"constructor"in n&&!(typeof Ai=="function"&&Ai instanceof Ai&&typeof zi=="function"&&zi instanceof zi)&&(W=!1)}return d.delete(t),d.delete(n),W}var COMPARE_PARTIAL_FLAG$2=1,argsTag="[object Arguments]",arrayTag="[object Array]",objectTag="[object Object]",objectProto$2=Object.prototype,hasOwnProperty$3=objectProto$2.hasOwnProperty;function baseIsEqualDeep(t,n,o,s,c,d){var h=isArray$4(t),p=isArray$4(n),y=h?arrayTag:getTag$1(t),E=p?arrayTag:getTag$1(n);y=y==argsTag?objectTag:y,E=E==argsTag?objectTag:E;var L=y==objectTag,F=E==objectTag,N=y==E;if(N&&isBuffer$1(t)){if(!isBuffer$1(n))return!1;h=!0,L=!1}if(N&&!L)return d||(d=new Stack$1),h||isTypedArray(t)?equalArrays$2(t,n,o,s,c,d):equalByTag(t,n,y,o,s,c,d);if(!(o&COMPARE_PARTIAL_FLAG$2)){var z=L&&hasOwnProperty$3.call(t,"__wrapped__"),oe=F&&hasOwnProperty$3.call(n,"__wrapped__");if(z||oe){var W=z?t.value():t,nt=oe?n.value():n;return d||(d=new Stack$1),c(W,nt,o,s,d)}}return N?(d||(d=new Stack$1),equalObjects(t,n,o,s,c,d)):!1}function baseIsEqual(t,n,o,s,c){return t===n?!0:t==null||n==null||!isObjectLike(t)&&!isObjectLike(n)?t!==t&&n!==n:baseIsEqualDeep(t,n,o,s,baseIsEqual,c)}var COMPARE_PARTIAL_FLAG$1=1,COMPARE_UNORDERED_FLAG$1=2;function baseIsMatch(t,n,o,s){var c=o.length,d=c;if(t==null)return!d;for(t=Object(t);c--;){var h=o[c];if(h[2]?h[1]!==t[h[0]]:!(h[0]in t))return!1}for(;++c<d;){h=o[c];var p=h[0],y=t[p],E=h[1];if(h[2]){if(y===void 0&&!(p in t))return!1}else{var L=new Stack$1,F;if(!(F===void 0?baseIsEqual(E,y,COMPARE_PARTIAL_FLAG$1|COMPARE_UNORDERED_FLAG$1,s,L):F))return!1}}return!0}function isStrictComparable(t){return t===t&&!isObject$2(t)}function getMatchData(t){for(var n=keys$1(t),o=n.length;o--;){var s=n[o],c=t[s];n[o]=[s,c,isStrictComparable(c)]}return n}function matchesStrictComparable(t,n){return function(o){return o==null?!1:o[t]===n&&(n!==void 0||t in Object(o))}}function baseMatches(t){var n=getMatchData(t);return n.length==1&&n[0][2]?matchesStrictComparable(n[0][0],n[0][1]):function(o){return o===t||baseIsMatch(o,t,n)}}function baseHasIn(t,n){return t!=null&&n in Object(t)}function hasPath(t,n,o){n=castPath(n,t);for(var s=-1,c=n.length,d=!1;++s<c;){var h=toKey(n[s]);if(!(d=t!=null&&o(t,h)))break;t=t[h]}return d||++s!=c?d:(c=t==null?0:t.length,!!c&&isLength(c)&&isIndex(h,c)&&(isArray$4(t)||isArguments(t)))}function hasIn(t,n){return t!=null&&hasPath(t,n,baseHasIn)}var COMPARE_PARTIAL_FLAG=1,COMPARE_UNORDERED_FLAG=2;function baseMatchesProperty(t,n){return isKey(t)&&isStrictComparable(n)?matchesStrictComparable(toKey(t),n):function(o){var s=get$1(o,t);return s===void 0&&s===n?hasIn(o,t):baseIsEqual(n,s,COMPARE_PARTIAL_FLAG|COMPARE_UNORDERED_FLAG)}}function baseProperty(t){return function(n){return n==null?void 0:n[t]}}function basePropertyDeep(t){return function(n){return baseGet(n,t)}}function property(t){return isKey(t)?baseProperty(toKey(t)):basePropertyDeep(t)}function baseIteratee(t){return typeof t=="function"?t:t==null?identity$2:typeof t=="object"?isArray$4(t)?baseMatchesProperty(t[0],t[1]):baseMatches(t):property(t)}function arrayAggregator(t,n,o,s){for(var c=-1,d=t==null?0:t.length;++c<d;){var h=t[c];n(s,h,o(h),t)}return s}function createBaseFor(t){return function(n,o,s){for(var c=-1,d=Object(n),h=s(n),p=h.length;p--;){var y=h[++c];if(o(d[y],y,d)===!1)break}return n}}var baseFor=createBaseFor();function baseForOwn(t,n){return t&&baseFor(t,n,keys$1)}function createBaseEach(t,n){return function(o,s){if(o==null)return o;if(!isArrayLike(o))return t(o,s);for(var c=o.length,d=-1,h=Object(o);++d<c&&s(h[d],d,h)!==!1;);return o}}var baseEach=createBaseEach(baseForOwn);function baseAggregator(t,n,o,s){return baseEach(t,function(c,d,h){n(s,c,o(c),h)}),s}function createAggregator(t,n){return function(o,s){var c=isArray$4(o)?arrayAggregator:baseAggregator,d={};return c(o,t,baseIteratee(s),d)}}var objectProto$1=Object.prototype,hasOwnProperty$2=objectProto$1.hasOwnProperty,defaults=baseRest(function(t,n){t=Object(t);var o=-1,s=n.length,c=s>2?n[2]:void 0;for(c&&isIterateeCall(n[0],n[1],c)&&(s=1);++o<s;)for(var d=n[o],h=keysIn(d),p=-1,y=h.length;++p<y;){var E=h[p],L=t[E];(L===void 0||eq(L,objectProto$1[E])&&!hasOwnProperty$2.call(t,E))&&(t[E]=d[E])}return t});function assignMergeValue(t,n,o){(o!==void 0&&!eq(t[n],o)||o===void 0&&!(n in t))&&baseAssignValue(t,n,o)}function isArrayLikeObject(t){return isObjectLike(t)&&isArrayLike(t)}function safeGet(t,n){if(!(n==="constructor"&&typeof t[n]=="function")&&n!="__proto__")return t[n]}function toPlainObject(t){return copyObject(t,keysIn(t))}function baseMergeDeep(t,n,o,s,c,d,h){var p=safeGet(t,o),y=safeGet(n,o),E=h.get(y);if(E){assignMergeValue(t,o,E);return}var L=d?d(p,y,o+"",t,n,h):void 0,F=L===void 0;if(F){var N=isArray$4(y),z=!N&&isBuffer$1(y),oe=!N&&!z&&isTypedArray(y);L=y,N||z||oe?isArray$4(p)?L=p:isArrayLikeObject(p)?L=copyArray(p):z?(F=!1,L=cloneBuffer(y,!0)):oe?(F=!1,L=cloneTypedArray(y,!0)):L=[]:isPlainObject(y)||isArguments(y)?(L=p,isArguments(p)?L=toPlainObject(p):(!isObject$2(p)||isFunction$2(p))&&(L=initCloneObject(y))):F=!1}F&&(h.set(y,L),c(L,y,s,d,h),h.delete(y)),assignMergeValue(t,o,L)}function baseMerge(t,n,o,s,c){t!==n&&baseFor(n,function(d,h){if(c||(c=new Stack$1),isObject$2(d))baseMergeDeep(t,n,h,o,baseMerge,s,c);else{var p=s?s(safeGet(t,h),d,h+"",t,n,c):void 0;p===void 0&&(p=d),assignMergeValue(t,h,p)}},keysIn)}var LARGE_ARRAY_SIZE$1=200;function baseDifference(t,n,o,s){var c=-1,d=arrayIncludes,h=!0,p=t.length,y=[],E=n.length;if(!p)return y;o&&(n=arrayMap(n,baseUnary(o))),n.length>=LARGE_ARRAY_SIZE$1&&(d=cacheHas,h=!1,n=new SetCache(n));e:for(;++c<p;){var L=t[c],F=o==null?L:o(L);if(L=L!==0?L:0,h&&F===F){for(var N=E;N--;)if(n[N]===F)continue e;y.push(L)}else d(n,F,s)||y.push(L)}return y}function last(t){var n=t==null?0:t.length;return n?t[n-1]:void 0}function fromPairs(t){for(var n=-1,o=t==null?0:t.length,s={};++n<o;){var c=t[n];s[c[0]]=c[1]}return s}var objectProto=Object.prototype,hasOwnProperty$1=objectProto.hasOwnProperty,groupBy=createAggregator(function(t,n,o){hasOwnProperty$1.call(t,o)?t[o].push(n):baseAssignValue(t,o,[n])});function parent(t,n){return n.length<2?t:baseGet(t,baseSlice(n,0,-1))}function isEqual(t,n){return baseIsEqual(t,n)}var merge=createAssigner(function(t,n,o){baseMerge(t,n,o)}),FUNC_ERROR_TEXT="Expected a function";function negate(t){if(typeof t!="function")throw new TypeError(FUNC_ERROR_TEXT);return function(){var n=arguments;switch(n.length){case 0:return!t.call(this);case 1:return!t.call(this,n[0]);case 2:return!t.call(this,n[0],n[1]);case 3:return!t.call(this,n[0],n[1],n[2])}return!t.apply(this,n)}}function baseUnset(t,n){return n=castPath(n,t),t=parent(t,n),t==null||delete t[toKey(last(n))]}function customOmitClone(t){return isPlainObject(t)?void 0:t}var CLONE_DEEP_FLAG=1,CLONE_FLAT_FLAG=2,CLONE_SYMBOLS_FLAG=4,omit=flatRest(function(t,n){var o={};if(t==null)return o;var s=!1;n=arrayMap(n,function(d){return d=castPath(d,t),s||(s=d.length>1),d}),copyObject(t,getAllKeysIn(t),o),s&&(o=baseClone(o,CLONE_DEEP_FLAG|CLONE_FLAT_FLAG|CLONE_SYMBOLS_FLAG,customOmitClone));for(var c=n.length;c--;)baseUnset(o,n[c]);return o});function baseSet(t,n,o,s){if(!isObject$2(t))return t;n=castPath(n,t);for(var c=-1,d=n.length,h=d-1,p=t;p!=null&&++c<d;){var y=toKey(n[c]),E=o;if(y==="__proto__"||y==="constructor"||y==="prototype")return t;if(c!=h){var L=p[y];E=void 0,E===void 0&&(E=isObject$2(L)?L:isIndex(n[c+1])?[]:{})}assignValue(p,y,E),p=p[y]}return t}function basePickBy(t,n,o){for(var s=-1,c=n.length,d={};++s<c;){var h=n[s],p=baseGet(t,h);o(p,h)&&baseSet(d,castPath(h,t),p)}return d}function pickBy(t,n){if(t==null)return{};var o=arrayMap(getAllKeysIn(t),function(s){return[s]});return n=baseIteratee(n),basePickBy(t,o,function(s,c){return n(s,c[0])})}function omitBy(t,n){return pickBy(t,negate(baseIteratee(n)))}function basePick(t,n){return basePickBy(t,n,function(o,s){return hasIn(t,s)})}var pick=flatRest(function(t,n){return t==null?{}:basePick(t,n)}),INFINITY=1/0,createSet=Set$1&&1/setToArray(new Set$1([,-0]))[1]==INFINITY?function(t){return new Set$1(t)}:noop$2,LARGE_ARRAY_SIZE=200;function baseUniq(t,n,o){var s=-1,c=arrayIncludes,d=t.length,h=!0,p=[],y=p;if(d>=LARGE_ARRAY_SIZE){var E=n?null:createSet(t);if(E)return setToArray(E);h=!1,c=cacheHas,y=new SetCache}else y=n?[]:p;e:for(;++s<d;){var L=t[s],F=n?n(L):L;if(L=L!==0?L:0,h&&F===F){for(var N=y.length;N--;)if(y[N]===F)continue e;n&&y.push(F),p.push(L)}else c(y,F,o)||(y!==p&&y.push(F),p.push(L))}return p}function uniqBy(t,n){return t&&t.length?baseUniq(t,baseIteratee(n)):[]}function baseXor(t,n,o){var s=t.length;if(s<2)return s?baseUniq(t[0]):[];for(var c=-1,d=Array(s);++c<s;)for(var h=t[c],p=-1;++p<s;)p!=c&&(d[c]=baseDifference(d[c]||h,t[p],n,o));return baseUniq(baseFlatten(d),n,o)}var xorBy=baseRest(function(t){var n=last(t);return isArrayLikeObject(n)&&(n=void 0),baseXor(arrayFilter(t,isArrayLikeObject),baseIteratee(n))}),earthRadius=63710088e-1,factors={centimeters:earthRadius*100,centimetres:earthRadius*100,degrees:earthRadius/111325,feet:earthRadius*3.28084,inches:earthRadius*39.37,kilometers:earthRadius/1e3,kilometres:earthRadius/1e3,meters:earthRadius,metres:earthRadius,miles:earthRadius/1609.344,millimeters:earthRadius*1e3,millimetres:earthRadius*1e3,nauticalmiles:earthRadius/1852,radians:1,yards:earthRadius*1.0936};function feature(t,n,o){o===void 0&&(o={});var s={type:"Feature"};return(o.id===0||o.id)&&(s.id=o.id),o.bbox&&(s.bbox=o.bbox),s.properties=n||{},s.geometry=t,s}function point(t,n,o){if(o===void 0&&(o={}),!t)throw new Error("coordinates is required");if(!Array.isArray(t))throw new Error("coordinates must be an Array");if(t.length<2)throw new Error("coordinates must be at least 2 numbers long");if(!isNumber$1(t[0])||!isNumber$1(t[1]))throw new Error("coordinates must contain numbers");var s={type:"Point",coordinates:t};return feature(s,n,o)}function polygon(t,n,o){o===void 0&&(o={});for(var s=0,c=t;s<c.length;s++){var d=c[s];if(d.length<4)throw new Error("Each LinearRing of a Polygon must have 4 or more Positions.");for(var h=0;h<d[d.length-1].length;h++)if(d[d.length-1][h]!==d[0][h])throw new Error("First and last Position are not equivalent.")}var p={type:"Polygon",coordinates:t};return feature(p,n,o)}function lineString(t,n,o){if(o===void 0&&(o={}),t.length<2)throw new Error("coordinates must be an array of two or more positions");var s={type:"LineString",coordinates:t};return feature(s,n,o)}function featureCollection(t,n){n===void 0&&(n={});var o={type:"FeatureCollection"};return n.id&&(o.id=n.id),n.bbox&&(o.bbox=n.bbox),o.features=t,o}function radiansToLength(t,n){n===void 0&&(n="kilometers");var o=factors[n];if(!o)throw new Error(n+" units is invalid");return t*o}function lengthToRadians(t,n){n===void 0&&(n="kilometers");var o=factors[n];if(!o)throw new Error(n+" units is invalid");return t/o}function radiansToDegrees(t){var n=t%(2*Math.PI);return n*180/Math.PI}function degreesToRadians(t){var n=t%360;return n*Math.PI/180}function convertLength(t,n,o){if(n===void 0&&(n="kilometers"),o===void 0&&(o="kilometers"),!(t>=0))throw new Error("length must be a positive number");return radiansToLength(lengthToRadians(t,n),o)}function isNumber$1(t){return!isNaN(t)&&t!==null&&!Array.isArray(t)}function isObject$1(t){return!!t&&t.constructor===Object}function getCoord$1(t){if(!t)throw new Error("coord is required");if(!Array.isArray(t)){if(t.type==="Feature"&&t.geometry!==null&&t.geometry.type==="Point")return t.geometry.coordinates;if(t.type==="Point")return t.coordinates}if(Array.isArray(t)&&t.length>=2&&!Array.isArray(t[0])&&!Array.isArray(t[1]))return t;throw new Error("coord must be GeoJSON Point or an Array of numbers")}function getCoords$1(t){if(Array.isArray(t))return t;if(t.type==="Feature"){if(t.geometry!==null)return t.geometry.coordinates}else if(t.coordinates)return t.coordinates;throw new Error("coords must be GeoJSON Feature, Geometry Object or an Array")}function getGeom$1(t){return t.type==="Feature"?t.geometry:t}const getCoord=wrap(getCoord$1),getCoords=wrap(getCoords$1),getGeom=t=>{if(!(typeof t!="object"||!t||!("type"in t))){if(t.type==="Feature")return getGeom(t.geometry);if(!(t.type!=="Point"&&t.type!=="MultiPoint"&&t.type!=="LineString"&&t.type!=="MultiLineString"&&t.type!=="Polygon"&&t.type!=="MultiPolygon"))return t}};function wrap(t){return n=>{try{return t(n)}catch{return}}}function objKeys$1(t){return Object.keys(t)}function defaultValue$1(t,n){return t??n}const appearanceKeyObj={marker:1,polyline:1,polygon:1,ellipsoid:1,ellipse:1,model:1,"3dtiles":1,box:1,photooverlay:1,resource:1,raster:1,heatMap:1,frustum:1,transition:1},appearanceKeys=objKeys$1(appearanceKeyObj);function convertLayer(t){return convertLayerGroup(t)??convertLayerItem(t)}function convertLayerCommon(t){var n,o,s,c;return omitBy({id:t.id,isVisible:t.visible,title:t.title,creator:t.creator,infobox:t.infobox,tags:t.tags,property:(n=t.compat)==null?void 0:n.property,propertyId:(o=t.compat)==null?void 0:o.propertyId,pluginId:(s=t.compat)!=null&&s.extensionId?"reearth":void 0,extensionId:(c=t.compat)==null?void 0:c.extensionId},d=>typeof d>"u"||d===null)}function convertLayerGroup(t){var n;if(t.type==="group")return{...convertLayerCommon(t),children:((n=t.children)==null?void 0:n.map(convertLayer).filter(o=>!!o))??[]}}function convertLayerItem(t){if(t.type==="simple")return convertLayerCommon(t)}function getCompat(t){var c,d,h,p;if(!t||typeof t!="object"||t.type!=="simple")return;const n=((c=t.data)==null?void 0:c.type)==="geojson"?t.data.value:void 0;let o,s;if("marker"in t){const y=getCoord(n);s="marker",o={default:{...t.marker,...y&&y.length>=2?{location:{lng:y[0],lat:y[1]},height:y[2]}:{}}}}else if("polyline"in t){const y=getCoords(n);s="polyline",o={default:{...t.polyline,...y?{coordinates:y.map(E=>({lng:E[0],lat:E[1],height:E[2]}))}:{}}}}else if("polygon"in t){const y=getGeom(n);s="polygon",o={default:{...t.polygon,...(y==null?void 0:y.type)==="Polygon"?{polygon:y.coordinates.map(E=>E.map(L=>({lng:L[0],lat:L[1],height:L[2]})))}:{}}}}else if("photooverlay"in t){const y=getCoord(n);s="photooverlay",o={default:{...t.photooverlay,...y&&y.length>=2?{location:{lng:y[0],lat:y[1]},height:y[2]}:{}}}}else if("ellipsoid"in t){const y=getCoord(n);s="ellipsoid",o={default:{...t.ellipsoid,...y&&y.length>=2?{position:{lng:y[0],lat:y[1]},height:y[2]}:{}}}}else if("model"in t){const y=["shadows","colorBlend","color","colorBlendAmount","lightColor","silhouette","silhouetteColor","silhouetteSize"],E=omit(t.model,...y),L=omitBy(pick(t.model,...y),N=>typeof N>"u"||N===null),F=getCoord(n);s="model",o={default:{...E,...F&&F.length>=2?{location:{lng:F[0],lat:F[1]},height:F[2]}:{}},...Object.keys(L).length?{appearance:L}:{}}}else"3dtiles"in t?(s="tileset",o={default:{...t["3dtiles"],...((d=t.data)==null?void 0:d.type)==="3dtiles"&&t.data.url?{tileset:t.data.url}:{}}}):"resource"in t&&(s="resource",o={default:{...t.resource}});return{extensionId:s,property:o,...(h=t.compat)!=null&&h.propertyId?{propertyId:(p=t.compat)==null?void 0:p.propertyId}:{}}}function convertLegacyLayer(t){return t?convertLegacyLayerGroup(t)??convertLegacyLayerItem(t):void 0}function convertLegacyLayerCommon(t){const n=omitBy({extensionId:t.extensionId,property:t.property,propertyId:t.propertyId},o=>typeof o>"u"||o===null);return omitBy({id:t.id,title:t.title,visible:t.isVisible,creator:t.creator,infobox:t.infobox,tags:t.tags,...Object.keys(n).length?{compat:n}:{}},o=>typeof o>"u"||o===null)}function convertLegacyLayerGroup(t){var n;if(Array.isArray(t.children))return{type:"group",...convertLegacyLayerCommon(t),children:((n=t.children)==null?void 0:n.map(convertLegacyLayer).filter(o=>!!o))??[]}}function convertLegacyLayerItem(t){var d,h,p,y,E,L,F,N,z,oe,W,nt,lt,Ee,yt,Ai,zi,ha,ba,Sa,ya,ms,Wc,Wa,pi,mt,fa,Ra;if(Array.isArray(t.children))return;let n,o,s;if(t.extensionId==="marker")n="marker",s=["location","height"],(h=(d=t.property)==null?void 0:d.default)!=null&&h.location&&(o={type:"geojson",value:{type:"Feature",geometry:{type:"Point",coordinates:[t.property.default.location.lng,t.property.default.location.lat,...t.property.default.height?[t.property.default.height]:[]]}}});else if(t.extensionId==="polyline")n="polyline",s=["coordinates"],(y=(p=t.property)==null?void 0:p.default)!=null&&y.coordinates&&(o={type:"geojson",value:{type:"Feature",geometry:{type:"LineString",coordinates:t.property.default.coordinates.map(sl=>[sl.lng,sl.lat,sl.height])}}});else if(t.extensionId==="polygon")n="polygon",s=["polygon"],(L=(E=t.property)==null?void 0:E.default)!=null&&L.polygon&&(o={type:"geojson",value:{type:"Feature",geometry:{type:"Polygon",coordinates:t.property.default.polygon.map(sl=>sl.map(Zd=>[Zd.lng,Zd.lat,Zd.height]))}}});else if(t.extensionId==="rect"){if(n="polygon",s=["rect","height"],(N=(F=t.property)==null?void 0:F.default)!=null&&N.rect){const sl=(oe=(z=t.property)==null?void 0:z.default)==null?void 0:oe.rect,Zd=t.property.default.height;o={type:"geojson",value:{type:"Feature",geometry:{type:"Polygon",coordinates:[[[sl.west,sl.north,Zd],[sl.east,sl.north,Zd],[sl.east,sl.south,Zd],[sl.west,sl.south,Zd],[sl.west,sl.north,Zd]]]}}}}}else if(t.extensionId==="photooverlay")n="photooverlay",s=["location","height"],(nt=(W=t.property)==null?void 0:W.default)!=null&&nt.location&&(o={type:"geojson",value:{type:"Feature",geometry:{type:"Point",coordinates:[t.property.default.location.lng,t.property.default.location.lat,...t.property.default.height?[t.property.default.height]:[]]}}});else if(t.extensionId==="ellipsoid")n="ellipsoid",s=["position","height"],(Ee=(lt=t.property)==null?void 0:lt.default)!=null&&Ee.position&&(o={type:"geojson",value:{type:"Feature",geometry:{type:"Point",coordinates:[t.property.default.position.lng,t.property.default.position.lat,...typeof t.property.default.height=="number"?[t.property.default.height]:[]]}}});else if(t.extensionId==="model")n="model",s=["location","height"],(Ai=(yt=t.property)==null?void 0:yt.default)!=null&&Ai.location&&(o={type:"geojson",value:{type:"Feature",geometry:{type:"Point",coordinates:[t.property.default.location.lng,t.property.default.location.lat,...typeof t.property.default.height=="number"?[t.property.default.height]:[]]}}});else if(t.extensionId==="tileset")n="3dtiles",s=["tileset","sourceType"],((ha=(zi=t.property)==null?void 0:zi.default)==null?void 0:ha.sourceType)==="osm"?o={type:"osm-buildings"}:(Sa=(ba=t.property)==null?void 0:ba.default)!=null&&Sa.tileset&&(o={type:"3dtiles",url:t.property.default.tileset});else if(t.extensionId==="resource")if(n="resource",(ms=(ya=t.property)==null?void 0:ya.default)!=null&&ms.url&&typeof t.property.default.url=="object"){const sl=t.property.default.url;o={type:t.property.default.type,value:sl}}else o={type:((Wa=(Wc=t.property)==null?void 0:Wc.default)==null?void 0:Wa.type)||"auto",url:(mt=(pi=t.property)==null?void 0:pi.default)==null?void 0:mt.url};else t.extensionId==="box"&&(n="box",s=["location","height"],(Ra=(fa=t.property)==null?void 0:fa.default)!=null&&Ra.location&&(o={type:"geojson",value:{type:"Feature",geometry:{type:"Point",coordinates:[t.property.default.location.lng,t.property.default.location.lat,...typeof t.property.default.location.height=="number"?[t.property.default.location.height]:[]]}}}));const c=n&&t.property?Object.fromEntries(Object.entries(t.property).flatMap(([sl,Zd])=>{if(!(Array.isArray(Zd)||sl==="id"||!Zd||typeof Zd!="object"))return Object.entries(Zd).filter(([Xd])=>!(s!=null&&s.includes(Xd)))}).filter(sl=>!!sl)):void 0;return omitBy({type:"simple",...convertLegacyLayerCommon(t),data:o,...n&&c?{[n]:c}:{}},sl=>typeof sl>"u"||sl===null)}function convertLegacyCluster(t){return t.map(n=>{var o;return{id:n.id,property:{default:n.default,layers:n.layers},layers:(o=n.layers)==null?void 0:o.map(s=>s.layer).filter(s=>!!s)}})}class Hooks{add(n,o,s){if(typeof arguments[0]!="string")for(let c in arguments[0])this.add(c,arguments[0][c],arguments[1]);else(Array.isArray(n)?n:[n]).forEach(function(c){this[c]=this[c]||[],o&&this[c][s?"unshift":"push"](o)},this)}run(n,o){this[n]=this[n]||[],this[n].forEach(function(s){s.call(o&&o.context?o.context:o,o)})}}class Plugins{constructor(n){this.jsep=n,this.registered={}}register(...n){n.forEach(o=>{if(typeof o!="object"||!o.name||!o.init)throw new Error("Invalid JSEP plugin format");this.registered[o.name]||(o.init(this.jsep),this.registered[o.name]=o)})}}class Jsep{static get version(){return"1.3.8"}static toString(){return"JavaScript Expression Parser (JSEP) v"+Jsep.version}static addUnaryOp(n){return Jsep.max_unop_len=Math.max(n.length,Jsep.max_unop_len),Jsep.unary_ops[n]=1,Jsep}static addBinaryOp(n,o,s){return Jsep.max_binop_len=Math.max(n.length,Jsep.max_binop_len),Jsep.binary_ops[n]=o,s?Jsep.right_associative.add(n):Jsep.right_associative.delete(n),Jsep}static addIdentifierChar(n){return Jsep.additional_identifier_chars.add(n),Jsep}static addLiteral(n,o){return Jsep.literals[n]=o,Jsep}static removeUnaryOp(n){return delete Jsep.unary_ops[n],n.length===Jsep.max_unop_len&&(Jsep.max_unop_len=Jsep.getMaxKeyLen(Jsep.unary_ops)),Jsep}static removeAllUnaryOps(){return Jsep.unary_ops={},Jsep.max_unop_len=0,Jsep}static removeIdentifierChar(n){return Jsep.additional_identifier_chars.delete(n),Jsep}static removeBinaryOp(n){return delete Jsep.binary_ops[n],n.length===Jsep.max_binop_len&&(Jsep.max_binop_len=Jsep.getMaxKeyLen(Jsep.binary_ops)),Jsep.right_associative.delete(n),Jsep}static removeAllBinaryOps(){return Jsep.binary_ops={},Jsep.max_binop_len=0,Jsep}static removeLiteral(n){return delete Jsep.literals[n],Jsep}static removeAllLiterals(){return Jsep.literals={},Jsep}get char(){return this.expr.charAt(this.index)}get code(){return this.expr.charCodeAt(this.index)}constructor(n){this.expr=n,this.index=0}static parse(n){return new Jsep(n).parse()}static getMaxKeyLen(n){return Math.max(0,...Object.keys(n).map(o=>o.length))}static isDecimalDigit(n){return n>=48&&n<=57}static binaryPrecedence(n){return Jsep.binary_ops[n]||0}static isIdentifierStart(n){return n>=65&&n<=90||n>=97&&n<=122||n>=128&&!Jsep.binary_ops[String.fromCharCode(n)]||Jsep.additional_identifier_chars.has(String.fromCharCode(n))}static isIdentifierPart(n){return Jsep.isIdentifierStart(n)||Jsep.isDecimalDigit(n)}throwError(n){const o=new Error(n+" at character "+this.index);throw o.index=this.index,o.description=n,o}runHook(n,o){if(Jsep.hooks[n]){const s={context:this,node:o};return Jsep.hooks.run(n,s),s.node}return o}searchHook(n){if(Jsep.hooks[n]){const o={context:this};return Jsep.hooks[n].find(function(s){return s.call(o.context,o),o.node}),o.node}}gobbleSpaces(){let n=this.code;for(;n===Jsep.SPACE_CODE||n===Jsep.TAB_CODE||n===Jsep.LF_CODE||n===Jsep.CR_CODE;)n=this.expr.charCodeAt(++this.index);this.runHook("gobble-spaces")}parse(){this.runHook("before-all");const n=this.gobbleExpressions(),o=n.length===1?n[0]:{type:Jsep.COMPOUND,body:n};return this.runHook("after-all",o)}gobbleExpressions(n){let o=[],s,c;for(;this.index<this.expr.length;)if(s=this.code,s===Jsep.SEMCOL_CODE||s===Jsep.COMMA_CODE)this.index++;else if(c=this.gobbleExpression())o.push(c);else if(this.index<this.expr.length){if(s===n)break;this.throwError('Unexpected "'+this.char+'"')}return o}gobbleExpression(){const n=this.searchHook("gobble-expression")||this.gobbleBinaryExpression();return this.gobbleSpaces(),this.runHook("after-expression",n)}gobbleBinaryOp(){this.gobbleSpaces();let n=this.expr.substr(this.index,Jsep.max_binop_len),o=n.length;for(;o>0;){if(Jsep.binary_ops.hasOwnProperty(n)&&(!Jsep.isIdentifierStart(this.code)||this.index+n.length<this.expr.length&&!Jsep.isIdentifierPart(this.expr.charCodeAt(this.index+n.length))))return this.index+=o,n;n=n.substr(0,--o)}return!1}gobbleBinaryExpression(){let n,o,s,c,d,h,p,y,E;if(h=this.gobbleToken(),!h||(o=this.gobbleBinaryOp(),!o))return h;for(d={value:o,prec:Jsep.binaryPrecedence(o),right_a:Jsep.right_associative.has(o)},p=this.gobbleToken(),p||this.throwError("Expected expression after "+o),c=[h,d,p];o=this.gobbleBinaryOp();){if(s=Jsep.binaryPrecedence(o),s===0){this.index-=o.length;break}d={value:o,prec:s,right_a:Jsep.right_associative.has(o)},E=o;const L=F=>d.right_a&&F.right_a?s>F.prec:s<=F.prec;for(;c.length>2&&L(c[c.length-2]);)p=c.pop(),o=c.pop().value,h=c.pop(),n={type:Jsep.BINARY_EXP,operator:o,left:h,right:p},c.push(n);n=this.gobbleToken(),n||this.throwError("Expected expression after "+E),c.push(d,n)}for(y=c.length-1,n=c[y];y>1;)n={type:Jsep.BINARY_EXP,operator:c[y-1].value,left:c[y-2],right:n},y-=2;return n}gobbleToken(){let n,o,s,c;if(this.gobbleSpaces(),c=this.searchHook("gobble-token"),c)return this.runHook("after-token",c);if(n=this.code,Jsep.isDecimalDigit(n)||n===Jsep.PERIOD_CODE)return this.gobbleNumericLiteral();if(n===Jsep.SQUOTE_CODE||n===Jsep.DQUOTE_CODE)c=this.gobbleStringLiteral();else if(n===Jsep.OBRACK_CODE)c=this.gobbleArray();else{for(o=this.expr.substr(this.index,Jsep.max_unop_len),s=o.length;s>0;){if(Jsep.unary_ops.hasOwnProperty(o)&&(!Jsep.isIdentifierStart(this.code)||this.index+o.length<this.expr.length&&!Jsep.isIdentifierPart(this.expr.charCodeAt(this.index+o.length)))){this.index+=s;const d=this.gobbleToken();return d||this.throwError("missing unaryOp argument"),this.runHook("after-token",{type:Jsep.UNARY_EXP,operator:o,argument:d,prefix:!0})}o=o.substr(0,--s)}Jsep.isIdentifierStart(n)?(c=this.gobbleIdentifier(),Jsep.literals.hasOwnProperty(c.name)?c={type:Jsep.LITERAL,value:Jsep.literals[c.name],raw:c.name}:c.name===Jsep.this_str&&(c={type:Jsep.THIS_EXP})):n===Jsep.OPAREN_CODE&&(c=this.gobbleGroup())}return c?(c=this.gobbleTokenProperty(c),this.runHook("after-token",c)):this.runHook("after-token",!1)}gobbleTokenProperty(n){this.gobbleSpaces();let o=this.code;for(;o===Jsep.PERIOD_CODE||o===Jsep.OBRACK_CODE||o===Jsep.OPAREN_CODE||o===Jsep.QUMARK_CODE;){let s;if(o===Jsep.QUMARK_CODE){if(this.expr.charCodeAt(this.index+1)!==Jsep.PERIOD_CODE)break;s=!0,this.index+=2,this.gobbleSpaces(),o=this.code}this.index++,o===Jsep.OBRACK_CODE?(n={type:Jsep.MEMBER_EXP,computed:!0,object:n,property:this.gobbleExpression()},this.gobbleSpaces(),o=this.code,o!==Jsep.CBRACK_CODE&&this.throwError("Unclosed ["),this.index++):o===Jsep.OPAREN_CODE?n={type:Jsep.CALL_EXP,arguments:this.gobbleArguments(Jsep.CPAREN_CODE),callee:n}:(o===Jsep.PERIOD_CODE||s)&&(s&&this.index--,this.gobbleSpaces(),n={type:Jsep.MEMBER_EXP,computed:!1,object:n,property:this.gobbleIdentifier()}),s&&(n.optional=!0),this.gobbleSpaces(),o=this.code}return n}gobbleNumericLiteral(){let n="",o,s;for(;Jsep.isDecimalDigit(this.code);)n+=this.expr.charAt(this.index++);if(this.code===Jsep.PERIOD_CODE)for(n+=this.expr.charAt(this.index++);Jsep.isDecimalDigit(this.code);)n+=this.expr.charAt(this.index++);if(o=this.char,o==="e"||o==="E"){for(n+=this.expr.charAt(this.index++),o=this.char,(o==="+"||o==="-")&&(n+=this.expr.charAt(this.index++));Jsep.isDecimalDigit(this.code);)n+=this.expr.charAt(this.index++);Jsep.isDecimalDigit(this.expr.charCodeAt(this.index-1))||this.throwError("Expected exponent ("+n+this.char+")")}return s=this.code,Jsep.isIdentifierStart(s)?this.throwError("Variable names cannot start with a number ("+n+this.char+")"):(s===Jsep.PERIOD_CODE||n.length===1&&n.charCodeAt(0)===Jsep.PERIOD_CODE)&&this.throwError("Unexpected period"),{type:Jsep.LITERAL,value:parseFloat(n),raw:n}}gobbleStringLiteral(){let n="";const o=this.index,s=this.expr.charAt(this.index++);let c=!1;for(;this.index<this.expr.length;){let d=this.expr.charAt(this.index++);if(d===s){c=!0;break}else if(d==="\\")switch(d=this.expr.charAt(this.index++),d){case"n":n+=`
|
|
28
28
|
`;break;case"r":n+="\r";break;case"t":n+=" ";break;case"b":n+="\b";break;case"f":n+="\f";break;case"v":n+="\v";break;default:n+=d}else n+=d}return c||this.throwError('Unclosed quote after "'+n+'"'),{type:Jsep.LITERAL,value:n,raw:this.expr.substring(o,this.index)}}gobbleIdentifier(){let n=this.code,o=this.index;for(Jsep.isIdentifierStart(n)?this.index++:this.throwError("Unexpected "+this.char);this.index<this.expr.length&&(n=this.code,Jsep.isIdentifierPart(n));)this.index++;return{type:Jsep.IDENTIFIER,name:this.expr.slice(o,this.index)}}gobbleArguments(n){const o=[];let s=!1,c=0;for(;this.index<this.expr.length;){this.gobbleSpaces();let d=this.code;if(d===n){s=!0,this.index++,n===Jsep.CPAREN_CODE&&c&&c>=o.length&&this.throwError("Unexpected token "+String.fromCharCode(n));break}else if(d===Jsep.COMMA_CODE){if(this.index++,c++,c!==o.length){if(n===Jsep.CPAREN_CODE)this.throwError("Unexpected token ,");else if(n===Jsep.CBRACK_CODE)for(let h=o.length;h<c;h++)o.push(null)}}else if(o.length!==c&&c!==0)this.throwError("Expected comma");else{const h=this.gobbleExpression();(!h||h.type===Jsep.COMPOUND)&&this.throwError("Expected comma"),o.push(h)}}return s||this.throwError("Expected "+String.fromCharCode(n)),o}gobbleGroup(){this.index++;let n=this.gobbleExpressions(Jsep.CPAREN_CODE);if(this.code===Jsep.CPAREN_CODE)return this.index++,n.length===1?n[0]:n.length?{type:Jsep.SEQUENCE_EXP,expressions:n}:!1;this.throwError("Unclosed (")}gobbleArray(){return this.index++,{type:Jsep.ARRAY_EXP,elements:this.gobbleArguments(Jsep.CBRACK_CODE)}}}const hooks=new Hooks;Object.assign(Jsep,{hooks,plugins:new Plugins(Jsep),COMPOUND:"Compound",SEQUENCE_EXP:"SequenceExpression",IDENTIFIER:"Identifier",MEMBER_EXP:"MemberExpression",LITERAL:"Literal",THIS_EXP:"ThisExpression",CALL_EXP:"CallExpression",UNARY_EXP:"UnaryExpression",BINARY_EXP:"BinaryExpression",ARRAY_EXP:"ArrayExpression",TAB_CODE:9,LF_CODE:10,CR_CODE:13,SPACE_CODE:32,PERIOD_CODE:46,COMMA_CODE:44,SQUOTE_CODE:39,DQUOTE_CODE:34,OPAREN_CODE:40,CPAREN_CODE:41,OBRACK_CODE:91,CBRACK_CODE:93,QUMARK_CODE:63,SEMCOL_CODE:59,COLON_CODE:58,unary_ops:{"-":1,"!":1,"~":1,"+":1},binary_ops:{"||":1,"&&":2,"|":3,"^":4,"&":5,"==":6,"!=":6,"===":6,"!==":6,"<":7,">":7,"<=":7,">=":7,"<<":8,">>":8,">>>":8,"+":9,"-":9,"*":10,"/":10,"%":10},right_associative:new Set,additional_identifier_chars:new Set(["$","_"]),literals:{true:!0,false:!1,null:null},this_str:"this"}),Jsep.max_unop_len=Jsep.getMaxKeyLen(Jsep.unary_ops),Jsep.max_binop_len=Jsep.getMaxKeyLen(Jsep.binary_ops);const jsep=t=>new Jsep(t).parse(),staticMethods=Object.getOwnPropertyNames(Jsep);staticMethods.forEach(t=>{jsep[t]===void 0&&t!=="prototype"&&(jsep[t]=Jsep[t])}),jsep.Jsep=Jsep;const CONDITIONAL_EXP="ConditionalExpression";var ternary={name:"ternary",init(t){t.hooks.add("after-expression",function(o){if(o.node&&this.code===t.QUMARK_CODE){this.index++;const s=o.node,c=this.gobbleExpression();if(c||this.throwError("Expected expression"),this.gobbleSpaces(),this.code===t.COLON_CODE){this.index++;const d=this.gobbleExpression();if(d||this.throwError("Expected expression"),o.node={type:CONDITIONAL_EXP,test:s,consequent:c,alternate:d},s.operator&&t.binary_ops[s.operator]<=.9){let h=s;for(;h.right.operator&&t.binary_ops[h.right.operator]<=.9;)h=h.right;o.node.test=h.right,h.right=o.node,o.node=s}}else this.throwError("Expected :")}})}};jsep.plugins.register(ternary);var ExpressionNodeType=(t=>(t[t.VARIABLE=0]="VARIABLE",t[t.UNARY=1]="UNARY",t[t.BINARY=2]="BINARY",t[t.TERNARY=3]="TERNARY",t[t.CONDITIONAL=4]="CONDITIONAL",t[t.MEMBER=5]="MEMBER",t[t.FUNCTION_CALL=6]="FUNCTION_CALL",t[t.ARRAY=7]="ARRAY",t[t.REGEX=8]="REGEX",t[t.VARIABLE_IN_STRING=9]="VARIABLE_IN_STRING",t[t.LITERAL_NULL=10]="LITERAL_NULL",t[t.LITERAL_BOOLEAN=11]="LITERAL_BOOLEAN",t[t.LITERAL_NUMBER=12]="LITERAL_NUMBER",t[t.LITERAL_STRING=13]="LITERAL_STRING",t[t.LITERAL_COLOR=14]="LITERAL_COLOR",t[t.LITERAL_VECTOR=15]="LITERAL_VECTOR",t[t.LITERAL_REGEX=16]="LITERAL_REGEX",t[t.LITERAL_UNDEFINED=17]="LITERAL_UNDEFINED",t[t.BUILTIN_VARIABLE=18]="BUILTIN_VARIABLE",t))(ExpressionNodeType||{});const unaryOperators=["!","-","+"],binaryOperators=["+","-","*","/","%","===","!==",">",">=","<","<=","&&","||","!~","=~","==","!="],backslashRegex=/\\/g,backslashReplacement="@#%",replacementRegex=/@#%/g,rgbaMatcher$1=/^#([0-9a-f])([0-9a-f])([0-9a-f])([0-9a-f])?$/i,rrggbbaaMatcher$1=/^#([0-9a-f]{2})([0-9a-f]{2})([0-9a-f]{2})([0-9a-f]{2})?$/i,builtInColor={ALICEBLUE:"#F0F8FF",ANTIQUEWHITE:"#FAEBD7",AQUA:"#00FFFF",AQUAMARINE:"#7FFFD4",AZURE:"#F0FFFF",BEIGE:"#F5F5DC",BISQUE:"#FFE4C4",BLACK:"#000000",BLANCHEDALMOND:"#FFEBCD",BLUE:"#0000FF",BLUEVIOLET:"#8A2BE2",BROWN:"#A52A2A",BURLYWOOD:"#DEB887",CADETBLUE:"#5F9EA0",CHARTREUSE:"#7FFF00",CHOCOLATE:"#D2691E",CORAL:"#FF7F50",CORNFLOWERBLUE:"#6495ED",CORNSILK:"#FFF8DC",CRIMSON:"#DC143C",CYAN:"#00FFFF",DARKBLUE:"#00008B",DARKCYAN:"#008B8B",DARKGOLDENROD:"#B8860B",DARKGRAY:"#A9A9A9",DARKGREEN:"#006400",DARKGREY:"#A9A9A9",DARKKHAKI:"#BDB76B",DARKMAGENTA:"#8B008B",DARKOLIVEGREEN:"#556B2F",DARKORANGE:"#FF8C00",DARKORCHID:"#9932CC",DARKRED:"#8B0000",DARKSALMON:"#E9967A",DARKSEAGREEN:"#8FBC8F",DARKSLATEBLUE:"#483D8B",DARKSLATEGRAY:"#2F4F4F",DARKSLATEGREY:"#2F4F4F",DARKTURQUOISE:"#00CED1",DARKVIOLET:"#9400D3",DEEPPINK:"#FF1493",DEEPSKYBLUE:"#00BFFF",DIMGRAY:"#696969",DIMGREY:"#696969",DODGERBLUE:"#1E90FF",FIREBRICK:"#B22222",FLORALWHITE:"#FFFAF0",FORESTGREEN:"#228B22",FUCHSIA:"#FF00FF",GAINSBORO:"#DCDCDC",GHOSTWHITE:"#F8F8FF",GOLD:"#FFD700",GOLDENROD:"#DAA520",GRAY:"#808080",GREEN:"#008000",GREENYELLOW:"#ADFF2F",GREY:"#808080",HONEYDEW:"#F0FFF0",HOTPINK:"#FF69B4",INDIANRED:"#CD5C5C",INDIGO:"#4B0082",IVORY:"#FFFFF0",KHAKI:"#F0E68C",LAVENDER:"#E6E6FA",LAVENDAR_BLUSH:"#FFF0F5",LAWNGREEN:"#7CFC00",LEMONCHIFFON:"#FFFACD",LIGHTBLUE:"#ADD8E6",LIGHTCORAL:"#F08080",LIGHTCYAN:"#E0FFFF",LIGHTGOLDENRODYELLOW:"#FAFAD2",LIGHTGRAY:"#D3D3D3",LIGHTGREEN:"#90EE90",LIGHTGREY:"#D3D3D3",LIGHTPINK:"#FFB6C1",LIGHTSEAGREEN:"#20B2AA",LIGHTSKYBLUE:"#87CEFA",LIGHTSLATEGRAY:"#778899",LIGHTSLATEGREY:"#778899",LIGHTSTEELBLUE:"#B0C4DE",LIGHTYELLOW:"#FFFFE0",LIME:"#00FF00",LIMEGREEN:"#32CD32",LINEN:"#FAF0E6",MAGENTA:"#FF00FF",MAROON:"#800000",MEDIUMAQUAMARINE:"#66CDAA",MEDIUMBLUE:"#0000CD",MEDIUMORCHID:"#BA55D3",MEDIUMPURPLE:"#9370DB",MEDIUMSEAGREEN:"#3CB371",MEDIUMSLATEBLUE:"#7B68EE",MEDIUMSPRINGGREEN:"#00FA9A",MEDIUMTURQUOISE:"#48D1CC",MEDIUMVIOLETRED:"#C71585",MIDNIGHTBLUE:"#191970",MINTCREAM:"#F5FFFA",MISTYROSE:"#FFE4E1",MOCCASIN:"#FFE4B5",NAVAJOWHITE:"#FFDEAD",NAVY:"#000080",OLDLACE:"#FDF5E6",OLIVE:"#808000",OLIVEDRAB:"#6B8E23",ORANGE:"#FFA500",ORANGERED:"#FF4500",ORCHID:"#DA70D6",PALEGOLDENROD:"#EEE8AA",PALEGREEN:"#98FB98",PALETURQUOISE:"#AFEEEE",PALEVIOLETRED:"#DB7093",PAPAYAWHIP:"#FFEFD5",PEACHPUFF:"#FFDAB9",PERU:"#CD853F",PINK:"#FFC0CB",PLUM:"#DDA0DD",POWDERBLUE:"#B0E0E6",PURPLE:"#800080",RED:"#FF0000",ROSYBROWN:"#BC8F8F",ROYALBLUE:"#4169E1",SADDLEBROWN:"#8B4513",SALMON:"#FA8072",SANDYBROWN:"#F4A460",SEAGREEN:"#2E8B57",SEASHELL:"#FFF5EE",SIENNA:"#A0522D",SILVER:"#C0C0C0",SKYBLUE:"#87CEEB",SLATEBLUE:"#6A5ACD",SLATEGRAY:"#708090",SLATEGREY:"#708090",SNOW:"#FFFAFA",SPRINGGREEN:"#00FF7F",STEELBLUE:"#4682B4",TAN:"#D2B48C",TEAL:"#008080",THISTLE:"#D8BFD8",TOMATO:"#FF6347",TURQUOISE:"#40E0D0",VIOLET:"#EE82EE",WHEAT:"#F5DEB3",WHITE:"#FFFFFF",WHITESMOKE:"#F5F5F5",YELLOW:"#FFFF00",YELLOWGREEN:"#9ACD32"};function getEvaluateBinaryFunction(t){const n=binaryFunctions[t];return function(o){const s=this._left.evaluate(o),c=this._right.evaluate(o);return n(t,s,c)}}const binaryFunctions={atan2:getEvaluateBinaryComponentwise(Math.atan2,!1),pow:getEvaluateBinaryComponentwise(Math.pow,!1),min:getEvaluateBinaryComponentwise(Math.min,!0),max:getEvaluateBinaryComponentwise(Math.max,!0),startsWith:getEvaluateBinaryComponentwise(startsWith,!1)};function getEvaluateBinaryComponentwise(t,n){return function(o,s,c){if(n&&typeof c=="number"&&typeof s=="number"||typeof s=="number"&&typeof c=="number"||typeof s=="string"&&typeof c=="string")return t(s,c);throw new Error(`Function "${o}" requires vector or number arguments of matching types. Arguments are ${s} and ${c}.`)}}function startsWith(t,n){return t.startsWith(n)}function getEvaluateUnaryFunction(t){const n=unaryFunctions[t];return function(o){const s=this._left.evaluate(o);return n(t,s)}}const unaryFunctions={abs:getEvaluateUnaryComponentwise(Math.abs),sqrt:getEvaluateUnaryComponentwise(Math.sqrt),cos:getEvaluateUnaryComponentwise(Math.cos),sin:getEvaluateUnaryComponentwise(Math.sin),tan:getEvaluateUnaryComponentwise(Math.tan),acos:getEvaluateUnaryComponentwise(Math.acos),asin:getEvaluateUnaryComponentwise(Math.asin),atan:getEvaluateUnaryComponentwise(Math.atan),radians:getEvaluateUnaryComponentwise(Cesium$1.Math.toRadians),degrees:getEvaluateUnaryComponentwise(Cesium$1.Math.toDegrees),sign:getEvaluateUnaryComponentwise(Cesium$1.Math.sign),floor:getEvaluateUnaryComponentwise(Math.floor),ceil:getEvaluateUnaryComponentwise(Math.ceil),round:getEvaluateUnaryComponentwise(Math.round),exp2:getEvaluateUnaryComponentwise(exp2),log:getEvaluateUnaryComponentwise(Math.log),log2:getEvaluateUnaryComponentwise(log2),fract:getEvaluateUnaryComponentwise(fract)};function getEvaluateUnaryComponentwise(t){return function(n,o){if(typeof o=="number")return t(o);throw new Error(`Function "${n}" requires a vector or number argument. Argument is ${o}.`)}}function fract(t){return t-Math.floor(t)}function exp2(t){return Math.pow(2,t)}function log2(t){return Cesium$1.Math.log2(t)}const rgbParenthesesMatcher$1=/^rgba?\(\s*([0-9.]+%?)\s*,\s*([0-9.]+%?)\s*,\s*([0-9.]+%?)(?:\s*,\s*([0-9.]+))?\s*\)$/i,hslParenthesesMatcher$1=/^hsla?\(\s*([0-9.]+)\s*,\s*([0-9.]+%)\s*,\s*([0-9.]+%)(?:\s*,\s*([0-9.]+))?\s*\)$/i;let Color$2=class pp{constructor(n,o,s,c){Vf(this,"red");Vf(this,"green");Vf(this,"blue");Vf(this,"alpha");this.red=defaultValue$1(n,1),this.green=defaultValue$1(o,1),this.blue=defaultValue$1(s,1),this.alpha=defaultValue$1(c,1)}static byteToFloat(n){return n/255}static floatToByte(n){return n===1?255:n*256|0}static fromCssColorString(n){n=n.replace(/\s/g,"");const o=getColor(n);if(typeof o<"u")return o;let s=rgbaMatcher$1.exec(n);if(s!==null){const c=new pp;return c.red=parseInt(s[1],16)/15,c.green=parseInt(s[2],16)/15,c.blue=parseInt(s[3],16)/15,c.alpha=parseInt(defaultValue$1(s[4],"f"),16)/15,c}if(s=rrggbbaaMatcher$1.exec(n),s!==null){const c=new pp;return c.red=parseInt(s[1],16)/255,c.green=parseInt(s[2],16)/255,c.blue=parseInt(s[3],16)/255,c.alpha=parseInt(defaultValue$1(s[4],"ff"),16)/255,c}if(s=rgbParenthesesMatcher$1.exec(n),s!==null){const c=new pp;return c.red=parseFloat(s[1])/(s[1].substr(-1)==="%"?100:255),c.green=parseFloat(s[2])/(s[2].substr(-1)==="%"?100:255),c.blue=parseFloat(s[3])/(s[3].substr(-1)==="%"?100:255),c.alpha=parseFloat(defaultValue$1(s[4],"1.0")),c}if(s=hslParenthesesMatcher$1.exec(n),s!==null)return pp.fromHsl(parseFloat(s[1])/360,parseFloat(s[2])/100,parseFloat(s[3])/100,parseFloat(defaultValue$1(s[4],"1.0")))}static fromHsl(n,o,s,c){if(n=defaultValue$1(n,0)%1,o=defaultValue$1(o,0),s=defaultValue$1(s,0),c=defaultValue$1(c,1),n&&o&&s&&c){let d=s,h=s,p=s;const y=new pp;if(o!==0){let E;s<.5?E=s*(1+o):E=s+o-s*o;const L=2*s-E;d=hue2rgb$1(L,E,n+1/3),h=hue2rgb$1(L,E,n),p=hue2rgb$1(L,E,n-1/3)}return typeof y>"u"?new pp(d,h,p,c):(y.red=d,y.green=h,y.blue=p,y.alpha=c,y)}}toCssHexString(){let n=pp.floatToByte(this.red).toString(16);n.length<2&&(n=`0${n}`);let o=pp.floatToByte(this.green).toString(16);o.length<2&&(o=`0${o}`);let s=pp.floatToByte(this.blue).toString(16);if(s.length<2&&(s=`0${s}`),this.alpha<1){let c=pp.floatToByte(this.alpha).toString(16);return c.length<2&&(c=`0${c}`),`#${n}${o}${s}${c}`}return`#${n}${o}${s}`.toUpperCase()}static fromBytes(n,o,s,c){return n=this.byteToFloat(defaultValue$1(n,255)),o=pp.byteToFloat(defaultValue$1(o,255)),s=pp.byteToFloat(defaultValue$1(s,255)),c=pp.byteToFloat(defaultValue$1(c,255)),new pp(n,o,s,c)}};function getColor(t){if(t=t.toUpperCase(),builtInColor[t])return Color$2.fromCssColorString(builtInColor[t]);switch(t){case"TRANSPARENT":return new Color$2(0,0,0,0);default:return}}function hue2rgb$1(t,n,o){return o<0&&(o+=1),o>1&&(o-=1),o*6<1?t+(n-t)*6*o:o*2<1?n:o*3<2?t+(n-t)*(2/3-o)*6:t}class Node{constructor(n,o,s,c,d){Vf(this,"_type");Vf(this,"_value");Vf(this,"_left");Vf(this,"_right");Vf(this,"_test");Vf(this,"evaluate");this._type=n,this._value=o,this._left=s,this._right=c,this._test=d,this.setEvaluateFunction()}setEvaluateFunction(){const n=this._type,o=this._value;switch(n){case ExpressionNodeType.CONDITIONAL:this.evaluate=this._evaluateConditional;break;case ExpressionNodeType.FUNCTION_CALL:switch(o){case"toString":this.evaluate=this._evaluateToString;break}break;case ExpressionNodeType.UNARY:switch(o){case"!":this.evaluate=this._evaluateNot;break;case"-":this.evaluate=this._evaluateNegative;break;case"+":this.evaluate=this._evaluatePositive;break;case"isNaN":this.evaluate=this._evaluateNaN;break;case"isFinite":this.evaluate=this._evaluateIsFinite;break;case"Boolean":this.evaluate=this._evaluateBooleanConversion;break;case"Number":this.evaluate=this._evaluateNumberConversion;break;case"String":this.evaluate=this._evaluateStringConversion;break;default:typeof unaryFunctions[o]<"u"&&(this.evaluate=getEvaluateUnaryFunction(o));break}break;case ExpressionNodeType.BINARY:switch(o){case"+":this.evaluate=this._evaluatePlus;break;case"-":this.evaluate=this._evaluateMinus;break;case"*":this.evaluate=this._evaluateTimes;break;case"/":this.evaluate=this._evaluateDivide;break;case"%":this.evaluate=this._evaluateMod;break;case"===":this.evaluate=this._evaluateEqualsStrict;break;case"!==":this.evaluate=this._evaluateNotEqualsStrict;break;case"<":this.evaluate=this._evaluateLessThan;break;case"<=":this.evaluate=this._evaluateLessThanOrEquals;break;case">":this.evaluate=this._evaluateGreaterThan;break;case">=":this.evaluate=this._evaluateGreaterThanOrEquals;break;case"&&":this.evaluate=this._evaluateAnd;break;case"||":this.evaluate=this._evaluateOr;break;case"==":this.evaluate=this._evaluateEquals;break;case"!=":this.evaluate=this._evaluateNotEquals;break;default:typeof binaryFunctions[o]<"u"&&(this.evaluate=getEvaluateBinaryFunction(o));break}break;case ExpressionNodeType.MEMBER:o==="brackets"?this.evaluate=this._evaluateMemberBrackets:this.evaluate=this._evaluateMemberDot;break;case ExpressionNodeType.ARRAY:this.evaluate=this._evaluateArray;break;case ExpressionNodeType.VARIABLE:this.evaluate=this._evaluateVariable;break;case ExpressionNodeType.VARIABLE_IN_STRING:this.evaluate=this._evaluateVariableString;break;case ExpressionNodeType.LITERAL_COLOR:this.evaluate=this._evaluateLiteralColor;break;case ExpressionNodeType.LITERAL_STRING:this.evaluate=this._evaluateLiteralString;break;default:this.evaluate=this._evaluateLiteral;break}}_evaluateLiteral(){return this._value}_evaluateLiteralString(){return this._value}_evaluateVariableString(n){const o=/\${(.*?)}/g;let s=this._value,c=o.exec(s);for(;c!==null;){const d=c[0],h=c[1];let p=n==null?void 0:n.properties[h];typeof p>"u"&&(p=""),s=s.replace(d,p),c=o.exec(s)}return s}_evaluateVariable(n){let o;return n&&String(this._value)in n.properties?o=n.properties[String(this._value)]:String(this._value)==="id"?o=n==null?void 0:n.id:n&&String(this._value)==="rootProperties"&&(o=n.properties),typeof o>"u"&&(o=""),o}_evaluateMemberDot(n){if(checkFeature(this._left))return n==null?void 0:n.properties[this._right.evaluate(n)];const o=this._left.evaluate(n);if(typeof o>"u")return;const s=this._right.evaluate(n);return o[s]}_evaluateMemberBrackets(n){if(checkFeature(this._left))return n==null?void 0:n.properties[this._right.evaluate(n)];const o=this._left.evaluate(n);if(typeof o>"u")return;const s=this._right.evaluate(n);return o[s]}_evaluateArray(n){const o=[];for(let s=0;s<this._value.length;s++)o[s]=this._value[s].evaluate(n);return o}_evaluateNot(n){const o=this._left.evaluate(n);if(typeof o!="boolean")throw new Error(`Operator "!" requires a boolean argument. Argument is ${o}.`);return!o}_evaluateNegative(n){const o=this._left.evaluate(n);if(typeof o=="number")return-o;throw new Error(`Operator "-" requires a vector or number argument. Argument is ${o}.`)}_evaluatePositive(n){const o=this._left.evaluate(n);if(typeof o!="number")throw new Error(`Operator "+" requires a vector or number argument. Argument is ${o}.`);return o}_evaluateLessThan(n){const o=this._left.evaluate(n),s=this._right.evaluate(n);return typeof o!="number"||typeof s!="number"?(console.warn(`Operator "<" requires number arguments. Arguments are ${o} and ${s}.`),!1):o<s}_evaluateLessThanOrEquals(n){const o=this._left.evaluate(n),s=this._right.evaluate(n);return typeof o!="number"||typeof s!="number"?(console.warn(`Operator "<=" requires number arguments. Arguments are ${o} and ${s}.`),!1):o<=s}_evaluateGreaterThan(n){const o=this._left.evaluate(n),s=this._right.evaluate(n);return typeof o!="number"||typeof s!="number"?(console.warn(`Operator ">" requires number arguments. Arguments are ${o} and ${s}.`),!1):o>s}_evaluateGreaterThanOrEquals(n){const o=this._left.evaluate(n),s=this._right.evaluate(n);return typeof o!="number"||typeof s!="number"?(console.warn(`Operator ">=" requires number arguments. Arguments are ${o} and ${s}.`),!1):o>=s}_evaluateOr(n){const o=this._left.evaluate(n);if(typeof o!="boolean")return console.warn(`Operator "||" requires boolean arguments. First argument is ${o}.`),!1;if(o)return!0;const s=this._right.evaluate(n);return typeof s!="boolean"?(console.warn(`Operator "||" requires boolean arguments. Second argument is ${s}.`),!1):o||s}_evaluateAnd(n){const o=this._left.evaluate(n);if(typeof o!="boolean")return console.warn(`Operator "&&" requires boolean arguments. First argument is ${o}.`),!1;if(!o)return!1;const s=this._right.evaluate(n);return typeof s!="boolean"?(console.warn(`Operator "&&" requires boolean arguments. Second argument is ${s}.`),!1):o&&s}_evaluatePlus(n){const o=this._left.evaluate(n),s=this._right.evaluate(n);if(typeof o=="number"&&typeof s=="number")return o+s;throw new Error(`Operator "+" requires vector or number arguments of matching types, or at least one string argument. Arguments are ${o} and ${s}.`)}_evaluateMinus(n){const o=this._left.evaluate(n),s=this._right.evaluate(n);if(typeof o=="number"&&typeof s=="number")return o-s;throw new Error(`Operator "-" requires vector or number arguments of matching types. Arguments are ${o} and ${s}.`)}_evaluateTimes(n){const o=this._left.evaluate(n),s=this._right.evaluate(n);if(typeof o=="number"&&typeof s=="number")return o*s;throw new Error(`Operator "*" requires vector or number arguments. If both arguments are vectors they must be matching types. Arguments are ${o} and ${s}.`)}_evaluateDivide(n){const o=this._left.evaluate(n),s=this._right.evaluate(n);if(typeof o=="number"&&typeof s=="number")return o/s;throw new Error(`Operator "/" requires vector or number arguments of matching types, or a number as the second argument. Arguments are ${o} and ${s}.`)}_evaluateMod(n){const o=this._left.evaluate(n),s=this._right.evaluate(n);if(typeof o=="number"&&typeof s=="number")return o%s;throw new Error(`Operator "%" requires vector or number arguments of matching types. Arguments are ${o} and ${s}.`)}_evaluateEqualsStrict(n){const o=this._left.evaluate(n),s=this._right.evaluate(n);return o===s}_evaluateNotEqualsStrict(n){const o=this._left.evaluate(n),s=this._right.evaluate(n);return o!==s}_evaluateConditional(n){const o=this._test.evaluate(n);if(typeof o!="boolean")throw new Error(`Conditional argument of conditional expression must be a boolean. Argument is ${o}.`);return o?this._left.evaluate(n):this._right.evaluate(n)}_evaluateNaN(n){return isNaN(this._left.evaluate(n))}_evaluateIsFinite(n){return isFinite(this._left.evaluate(n))}_evaluateBooleanConversion(n){return!!this._left.evaluate(n)}_evaluateNumberConversion(n){const o=cleanseNumberStringInput(this._left.evaluate(n));return Number(o)}_evaluateStringConversion(n){return String(this._left.evaluate(n))}_evaluateToString(n){const o=this._left.evaluate(n);if(o instanceof RegExp)return String(o);throw new Error(`Unexpected function call "${this._value}".`)}_evaluateLiteralColor(n){const o=this._left;let s=new Color$2;if(this._value==="color")if(typeof o>"u")s=Color$2.fromBytes(255,255,255,255);else if(o.length>1){const c=Color$2.fromCssColorString(o[0].evaluate(n));if(c)s=c;else throw new Error(`wrong literalColor call "${this._value}, ${o}}"`);s.alpha=o[1].evaluate(n)}else{const c=Color$2.fromCssColorString(o[0].evaluate(n));if(c)s=c;else throw new Error(`wrong literalColor call "${this._value}, ${o}}"`)}else if(this._value==="rgb")s=Color$2.fromBytes(o[0].evaluate(n),o[1].evaluate(n),o[2].evaluate(n),255);else if(this._value==="rgba"){const c=o[3].evaluate(n)*255;s=Color$2.fromBytes(o[0].evaluate(n),o[1].evaluate(n),o[2].evaluate(n),c)}else if(this._value==="hsl"){const c=Color$2.fromHsl(o[0].evaluate(n),o[1].evaluate(n),o[2].evaluate(n),1);c&&(s=c)}else if(this._value==="hsla"){const c=Color$2.fromHsl(o[0].evaluate(n),o[1].evaluate(n),o[2].evaluate(n),o[3].evaluate(n));c&&(s=c)}return s.toCssHexString()}_evaluateEquals(n){const o=this._left.evaluate(n),s=this._right.evaluate(n);return isArray$3(o)&&!isArray$3(s)?o.includes(s):isArray$3(s)&&!isArray$3(o)?s.includes(o):(isArray$3(s)&&isArray$3(o)&&console.error("Equals left and right both can't be array at the same time"),o==s)}_evaluateNotEquals(n){const o=this._left.evaluate(n),s=this._right.evaluate(n);return isArray$3(o)&&!isArray$3(s)?!o.includes(s):isArray$3(s)&&!isArray$3(o)?!s.includes(o):(isArray$3(s)&&isArray$3(o)&&console.error("NotEquals left and right both can't be array at the same time"),o!=s)}}function cleanseNumberStringInput(t){if(typeof t!="string")return t;const n=["%"];for(const o of n)if(t.endsWith(o))return t.slice(0,-o.length).trim();return t.trim()}function checkFeature(t){return t._value==="feature"}function isArray$3(t){return Array.isArray(t)}function _typeof(t){"@babel/helpers - typeof";return _typeof=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(n){return typeof n}:function(n){return n&&typeof Symbol=="function"&&n.constructor===Symbol&&n!==Symbol.prototype?"symbol":typeof n},_typeof(t)}function _classCallCheck(t,n){if(!(t instanceof n))throw new TypeError("Cannot call a class as a function")}function _defineProperties(t,n){for(var o=0;o<n.length;o++){var s=n[o];s.enumerable=s.enumerable||!1,s.configurable=!0,"value"in s&&(s.writable=!0),Object.defineProperty(t,s.key,s)}}function _createClass(t,n,o){return n&&_defineProperties(t.prototype,n),Object.defineProperty(t,"prototype",{writable:!1}),t}function _inherits(t,n){if(typeof n!="function"&&n!==null)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(n&&n.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),n&&_setPrototypeOf(t,n)}function _getPrototypeOf(t){return _getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(o){return o.__proto__||Object.getPrototypeOf(o)},_getPrototypeOf(t)}function _setPrototypeOf(t,n){return _setPrototypeOf=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(s,c){return s.__proto__=c,s},_setPrototypeOf(t,n)}function _isNativeReflectConstruct(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function _construct(t,n,o){return _isNativeReflectConstruct()?_construct=Reflect.construct.bind():_construct=function(c,d,h){var p=[null];p.push.apply(p,d);var y=Function.bind.apply(c,p),E=new y;return h&&_setPrototypeOf(E,h.prototype),E},_construct.apply(null,arguments)}function _isNativeFunction(t){return Function.toString.call(t).indexOf("[native code]")!==-1}function _wrapNativeSuper(t){var n=typeof Map=="function"?new Map:void 0;return _wrapNativeSuper=function(s){if(s===null||!_isNativeFunction(s))return s;if(typeof s!="function")throw new TypeError("Super expression must either be null or a function");if(typeof n<"u"){if(n.has(s))return n.get(s);n.set(s,c)}function c(){return _construct(s,arguments,_getPrototypeOf(this).constructor)}return c.prototype=Object.create(s.prototype,{constructor:{value:c,enumerable:!1,writable:!0,configurable:!0}}),_setPrototypeOf(c,s)},_wrapNativeSuper(t)}function _assertThisInitialized(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function _possibleConstructorReturn(t,n){if(n&&(typeof n=="object"||typeof n=="function"))return n;if(n!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return _assertThisInitialized(t)}function _createSuper(t){var n=_isNativeReflectConstruct();return function(){var s=_getPrototypeOf(t),c;if(n){var d=_getPrototypeOf(this).constructor;c=Reflect.construct(s,arguments,d)}else c=s.apply(this,arguments);return _possibleConstructorReturn(this,c)}}function _toConsumableArray(t){return _arrayWithoutHoles(t)||_iterableToArray(t)||_unsupportedIterableToArray(t)||_nonIterableSpread()}function _arrayWithoutHoles(t){if(Array.isArray(t))return _arrayLikeToArray(t)}function _iterableToArray(t){if(typeof Symbol<"u"&&t[Symbol.iterator]!=null||t["@@iterator"]!=null)return Array.from(t)}function _unsupportedIterableToArray(t,n){if(t){if(typeof t=="string")return _arrayLikeToArray(t,n);var o=Object.prototype.toString.call(t).slice(8,-1);if(o==="Object"&&t.constructor&&(o=t.constructor.name),o==="Map"||o==="Set")return Array.from(t);if(o==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(o))return _arrayLikeToArray(t,n)}}function _arrayLikeToArray(t,n){(n==null||n>t.length)&&(n=t.length);for(var o=0,s=new Array(n);o<n;o++)s[o]=t[o];return s}function _nonIterableSpread(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
|
|
29
29
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function _createForOfIteratorHelper(t,n){var o=typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(!o){if(Array.isArray(t)||(o=_unsupportedIterableToArray(t))||n){o&&(t=o);var s=0,c=function(){};return{s:c,n:function(){return s>=t.length?{done:!0}:{done:!1,value:t[s++]}},e:function(y){throw y},f:c}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
|
|
30
30
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var d=!0,h=!1,p;return{s:function(){o=o.call(t)},n:function(){var y=o.next();return d=y.done,y},e:function(y){h=!0,p=y},f:function(){try{!d&&o.return!=null&&o.return()}finally{if(h)throw p}}}}var hasOwnProp=Object.prototype.hasOwnProperty;function push(t,n){return t=t.slice(),t.push(n),t}function unshift(t,n){return n=n.slice(),n.unshift(t),n}var NewError=function(t){_inherits(o,t);var n=_createSuper(o);function o(s){var c;return _classCallCheck(this,o),c=n.call(this,'JSONPath should not be called with "new" (it prevents return of (unwrapped) scalar values)'),c.avoidNew=!0,c.value=s,c.name="NewError",c}return _createClass(o)}(_wrapNativeSuper(Error));function JSONPath(t,n,o,s,c){if(!(this instanceof JSONPath))try{return new JSONPath(t,n,o,s,c)}catch(y){if(!y.avoidNew)throw y;return y.value}typeof t=="string"&&(c=s,s=o,o=n,n=t,t=null);var d=t&&_typeof(t)==="object";if(t=t||{},this.json=t.json||o,this.path=t.path||n,this.resultType=t.resultType||"value",this.flatten=t.flatten||!1,this.wrap=hasOwnProp.call(t,"wrap")?t.wrap:!0,this.sandbox=t.sandbox||{},this.preventEval=t.preventEval||!1,this.parent=t.parent||null,this.parentProperty=t.parentProperty||null,this.callback=t.callback||s||null,this.otherTypeCallback=t.otherTypeCallback||c||function(){throw new TypeError("You must supply an otherTypeCallback callback option with the @other() operator.")},t.autostart!==!1){var h={path:d?t.path:n};d?"json"in t&&(h.json=t.json):h.json=o;var p=this.evaluate(h);if(!p||_typeof(p)!=="object")throw new NewError(p);return p}}JSONPath.prototype.evaluate=function(t,n,o,s){var c=this,d=this.parent,h=this.parentProperty,p=this.flatten,y=this.wrap;if(this.currResultType=this.resultType,this.currPreventEval=this.preventEval,this.currSandbox=this.sandbox,o=o||this.callback,this.currOtherTypeCallback=s||this.otherTypeCallback,n=n||this.json,t=t||this.path,t&&_typeof(t)==="object"&&!Array.isArray(t)){if(!t.path&&t.path!=="")throw new TypeError('You must supply a "path" property when providing an object argument to JSONPath.evaluate().');if(!hasOwnProp.call(t,"json"))throw new TypeError('You must supply a "json" property when providing an object argument to JSONPath.evaluate().');var E=t;n=E.json,p=hasOwnProp.call(t,"flatten")?t.flatten:p,this.currResultType=hasOwnProp.call(t,"resultType")?t.resultType:this.currResultType,this.currSandbox=hasOwnProp.call(t,"sandbox")?t.sandbox:this.currSandbox,y=hasOwnProp.call(t,"wrap")?t.wrap:y,this.currPreventEval=hasOwnProp.call(t,"preventEval")?t.preventEval:this.currPreventEval,o=hasOwnProp.call(t,"callback")?t.callback:o,this.currOtherTypeCallback=hasOwnProp.call(t,"otherTypeCallback")?t.otherTypeCallback:this.currOtherTypeCallback,d=hasOwnProp.call(t,"parent")?t.parent:d,h=hasOwnProp.call(t,"parentProperty")?t.parentProperty:h,t=t.path}if(d=d||null,h=h||null,Array.isArray(t)&&(t=JSONPath.toPathString(t)),!(!t&&t!==""||!n)){var L=JSONPath.toPathArray(t);L[0]==="$"&&L.length>1&&L.shift(),this._hasParentSelector=null;var F=this._trace(L,n,["$"],d,h,o).filter(function(N){return N&&!N.isParentSelector});return F.length?!y&&F.length===1&&!F[0].hasArrExpr?this._getPreferredOutput(F[0]):F.reduce(function(N,z){var oe=c._getPreferredOutput(z);return p&&Array.isArray(oe)?N=N.concat(oe):N.push(oe),N},[]):y?[]:void 0}},JSONPath.prototype._getPreferredOutput=function(t){var n=this.currResultType;switch(n){case"all":{var o=Array.isArray(t.path)?t.path:JSONPath.toPathArray(t.path);return t.pointer=JSONPath.toPointer(o),t.path=typeof t.path=="string"?t.path:JSONPath.toPathString(t.path),t}case"value":case"parent":case"parentProperty":return t[n];case"path":return JSONPath.toPathString(t[n]);case"pointer":return JSONPath.toPointer(t.path);default:throw new TypeError("Unknown result type")}},JSONPath.prototype._handleCallback=function(t,n,o){if(n){var s=this._getPreferredOutput(t);t.path=typeof t.path=="string"?t.path:JSONPath.toPathString(t.path),n(s,o,t)}},JSONPath.prototype._trace=function(t,n,o,s,c,d,h,p){var y=this,E;if(!t.length)return E={path:o,value:n,parent:s,parentProperty:c,hasArrExpr:h},this._handleCallback(E,d,"value"),E;var L=t[0],F=t.slice(1),N=[];function z(Wc){Array.isArray(Wc)?Wc.forEach(function(Wa){N.push(Wa)}):N.push(Wc)}if((typeof L!="string"||p)&&n&&hasOwnProp.call(n,L))z(this._trace(F,n[L],push(o,L),n,L,d,h));else if(L==="*")this._walk(n,function(Wc){z(y._trace(F,n[Wc],push(o,Wc),n,Wc,d,!0,!0))});else if(L==="..")z(this._trace(F,n,o,s,c,d,h)),this._walk(n,function(Wc){_typeof(n[Wc])==="object"&&z(y._trace(t.slice(),n[Wc],push(o,Wc),n,Wc,d,!0))});else{if(L==="^")return this._hasParentSelector=!0,{path:o.slice(0,-1),expr:F,isParentSelector:!0};if(L==="~")return E={path:push(o,L),value:c,parent:s,parentProperty:null},this._handleCallback(E,d,"property"),E;if(L==="$")z(this._trace(F,n,o,null,null,d,h));else if(/^(\x2D?[0-9]*):(\x2D?[0-9]*):?([0-9]*)$/.test(L))z(this._slice(L,F,n,o,s,c,d));else if(L.indexOf("?(")===0){if(this.currPreventEval)throw new Error("Eval [?(expr)] prevented in JSONPath expression.");var oe=L.replace(/^\?\(((?:[\0-\t\x0B\f\x0E-\u2027\u202A-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])*?)\)$/,"$1");this._walk(n,function(Wc){y._eval(oe,n[Wc],Wc,o,s,c)&&z(y._trace(F,n[Wc],push(o,Wc),n,Wc,d,!0))})}else if(L[0]==="("){if(this.currPreventEval)throw new Error("Eval [(expr)] prevented in JSONPath expression.");z(this._trace(unshift(this._eval(L,n,o[o.length-1],o.slice(0,-1),s,c),F),n,o,s,c,d,h))}else if(L[0]==="@"){var W=!1,nt=L.slice(1,-2);switch(nt){case"scalar":(!n||!["object","function"].includes(_typeof(n)))&&(W=!0);break;case"boolean":case"string":case"undefined":case"function":_typeof(n)===nt&&(W=!0);break;case"integer":Number.isFinite(n)&&!(n%1)&&(W=!0);break;case"number":Number.isFinite(n)&&(W=!0);break;case"nonFinite":typeof n=="number"&&!Number.isFinite(n)&&(W=!0);break;case"object":n&&_typeof(n)===nt&&(W=!0);break;case"array":Array.isArray(n)&&(W=!0);break;case"other":W=this.currOtherTypeCallback(n,o,s,c);break;case"null":n===null&&(W=!0);break;default:throw new TypeError("Unknown value type "+nt)}if(W)return E={path:o,value:n,parent:s,parentProperty:c},this._handleCallback(E,d,"value"),E}else if(L[0]==="`"&&n&&hasOwnProp.call(n,L.slice(1))){var lt=L.slice(1);z(this._trace(F,n[lt],push(o,lt),n,lt,d,h,!0))}else if(L.includes(",")){var Ee=L.split(","),yt=_createForOfIteratorHelper(Ee),Ai;try{for(yt.s();!(Ai=yt.n()).done;){var zi=Ai.value;z(this._trace(unshift(zi,F),n,o,s,c,d,!0))}}catch(Wc){yt.e(Wc)}finally{yt.f()}}else!p&&n&&hasOwnProp.call(n,L)&&z(this._trace(F,n[L],push(o,L),n,L,d,h,!0))}if(this._hasParentSelector)for(var ha=0;ha<N.length;ha++){var ba=N[ha];if(ba&&ba.isParentSelector){var Sa=this._trace(ba.expr,n,ba.path,s,c,d,h);if(Array.isArray(Sa)){N[ha]=Sa[0];for(var ya=Sa.length,ms=1;ms<ya;ms++)ha++,N.splice(ha,0,Sa[ms])}else N[ha]=Sa}}return N},JSONPath.prototype._walk=function(t,n){if(Array.isArray(t))for(var o=t.length,s=0;s<o;s++)n(s);else t&&_typeof(t)==="object"&&Object.keys(t).forEach(function(c){n(c)})},JSONPath.prototype._slice=function(t,n,o,s,c,d,h){if(Array.isArray(o)){var p=o.length,y=t.split(":"),E=y[2]&&Number.parseInt(y[2])||1,L=y[0]&&Number.parseInt(y[0])||0,F=y[1]&&Number.parseInt(y[1])||p;L=L<0?Math.max(0,L+p):Math.min(p,L),F=F<0?Math.max(0,F+p):Math.min(p,F);for(var N=[],z=L;z<F;z+=E){var oe=this._trace(unshift(z,n),o,s,c,d,h,!0);oe.forEach(function(W){N.push(W)})}return N}},JSONPath.prototype._eval=function(t,n,o,s,c,d){this.currSandbox._$_parentProperty=d,this.currSandbox._$_parent=c,this.currSandbox._$_property=o,this.currSandbox._$_root=this.json,this.currSandbox._$_v=n;var h=t.includes("@path");h&&(this.currSandbox._$_path=JSONPath.toPathString(s.concat([o])));var p="script:"+t;if(!JSONPath.cache[p]){var y=t.replace(/@parentProperty/g,"_$_parentProperty").replace(/@parent/g,"_$_parent").replace(/@property/g,"_$_property").replace(/@root/g,"_$_root").replace(/@([\t-\r \)\.\[\xA0\u1680\u2000-\u200A\u2028\u2029\u202F\u205F\u3000\uFEFF])/g,"_$_v$1");h&&(y=y.replace(/@path/g,"_$_path")),JSONPath.cache[p]=new this.vm.Script(y)}try{return JSONPath.cache[p].runInNewContext(this.currSandbox)}catch(E){throw new Error("jsonPath: "+E.message+": "+t)}},JSONPath.cache={},JSONPath.toPathString=function(t){for(var n=t,o=n.length,s="$",c=1;c<o;c++)/^(~|\^|@(?:[\0-\t\x0B\f\x0E-\u2027\u202A-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])*?\(\))$/.test(n[c])||(s+=/^[\*0-9]+$/.test(n[c])?"["+n[c]+"]":"['"+n[c]+"']");return s},JSONPath.toPointer=function(t){for(var n=t,o=n.length,s="",c=1;c<o;c++)/^(~|\^|@(?:[\0-\t\x0B\f\x0E-\u2027\u202A-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])*?\(\))$/.test(n[c])||(s+="/"+n[c].toString().replace(/~/g,"~0").replace(/\//g,"~1"));return s},JSONPath.toPathArray=function(t){var n=JSONPath.cache;if(n[t])return n[t].concat();var o=[],s=t.replace(/@(?:null|boolean|number|string|integer|undefined|nonFinite|scalar|array|object|function|other)\(\)/g,";$&;").replace(/['\[](\??\((?:[\0-\t\x0B\f\x0E-\u2027\u202A-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])*?\))['\]]/g,function(d,h){return"[#"+(o.push(h)-1)+"]"}).replace(/\[["']((?:(?!['\]])[\s\S])*)["']\]/g,function(d,h){return"['"+h.replace(/\./g,"%@%").replace(/~/g,"%%@@%%")+"']"}).replace(/~/g,";~;").replace(/["']?\.["']?(?!(?:(?!\[)[\s\S])*\])|\[["']?/g,";").replace(/%@%/g,".").replace(/%%@@%%/g,"~").replace(/(?:;)?(\^+)(?:;)?/g,function(d,h){return";"+h.split("").join(";")+";"}).replace(/;;;|;;/g,";..;").replace(/;$|'?\]|'$/g,""),c=s.split(";").map(function(d){var h=d.match(/#([0-9]+)/);return!h||!h[1]?d:o[h[1]]});return n[t]=c,n[t].concat()};var moveToAnotherArray=function(n,o,s){for(var c=n.length,d=0;d<c;d++){var h=n[d];s(h)&&o.push(n.splice(d--,1)[0])}},Script=function(){function t(n){_classCallCheck(this,t),this.code=n}return _createClass(t,[{key:"runInNewContext",value:function(o){var s=this.code,c=Object.keys(o),d=[];moveToAnotherArray(c,d,function(L){return typeof o[L]=="function"});var h=c.map(function(L,F){return o[L]}),p=d.reduce(function(L,F){var N=o[F].toString();return/function/.test(N)||(N="function "+N),"var "+F+"="+N+";"+L},"");s=p+s,!/(["'])use strict\1/.test(s)&&!c.includes("arguments")&&(s="var arguments = undefined;"+s),s=s.replace(/;[\t-\r \xA0\u1680\u2000-\u200A\u2028\u2029\u202F\u205F\u3000\uFEFF]*$/,"");var y=s.lastIndexOf(";"),E=y>-1?s.slice(0,y+1)+" return "+s.slice(y+1):" return "+s;return _construct(Function,c.concat([E])).apply(void 0,_toConsumableArray(h))}}]),t}();JSONPath.prototype.vm={Script};const usableChars="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789",generateRandomString=t=>Array.from(window.crypto.getRandomValues(new Uint8Array(t))).map(n=>usableChars[n%t]).join("").toLowerCase(),recursiveJSONParse=t=>{if(typeof t!="object"||t===null)return t;for(const n in t)if(typeof t[n]=="string")try{t[n].startsWith("{")&&t[n].endsWith("}")&&(t[n]=JSON.parse(t[n]))}catch{console.error("Invalid JSON:",t[n])}else typeof t[n]=="object"&&(t[n]=recursiveJSONParse(t[n]));return t},VARIABLE_PREFIX="czm_";function replaceVariables(t,n){let o=t,s="";const c=[];let d=o.indexOf("${");const h=typeof n<"u",p={},y=/^\$./;for(;d>=0;)if(isInsideQuotes(o,d)){const E=findCloseQuote(o,d);s+=o.slice(0,E+1),o=o.slice(E+1),d=o.indexOf("${")}else{s+=o.slice(0,d);const E=getCloseBracketIndex(o,d),L=o.slice(d+2,E);if(y.test(L)){if(!h)return[s,[]];let F=p[L];if(!F)try{F=JSONPath({json:n,path:L}),p[L]=F}catch{return[s,[]]}if(F.length!==0){const N=generateRandomString(10);c.push({literalName:N,literalValue:F[0]}),s+=N}else return["false",[]]}else{const F=replaceReservedWord(L);s+=`${VARIABLE_PREFIX}${F}`}o=o.slice(E+1),d=o.indexOf("${")}return s+=o,[s,c]}function isInsideQuotes(t,n){const o=t.indexOf("'"),s=t.indexOf('"');return o>=0&&o<n?t.indexOf("'",o+1)>=n:s>=0&&s<n?t.indexOf('"',s+1)>=n:!1}function findCloseQuote(t,n){const o=t.indexOf("'"),s=t.indexOf('"');return o>=0&&o<n?t.indexOf("'",o+1):s>=0&&s<n?t.indexOf('"',s+1):-1}function getCloseBracketIndex(t,n){const o=t.indexOf("}",n);if(o<0)throw new Error("replaceVariable: Unmatched {.");return o}const makeReservedWord=t=>`$reearth_${t}_$`,RESERVED_WORDS={"[":makeReservedWord("opened_square_bracket"),"]":makeReservedWord("closed_square_bracket"),"{":makeReservedWord("opened_curly_bracket"),"}":makeReservedWord("closed_curly_bracket"),"(":makeReservedWord("opened_parentheses"),")":makeReservedWord("closed_parentheses"),"-":makeReservedWord("hyphen"),":":makeReservedWord("colon")},replaceReservedWord=t=>{const n=t.replace(/-/g,RESERVED_WORDS["-"]).replace(/:/g,RESERVED_WORDS[":"]);return/(\]|\)|\})[^[.]+$/.test(n)?Object.entries(RESERVED_WORDS).reduce((o,[s,c])=>o.replaceAll(s,c),n):n},restoreReservedWord=t=>Object.entries(RESERVED_WORDS).reduce((n,[o,s])=>n.replaceAll(s,o),t),UNARY_OPERATORS_SET=new Set(unaryOperators),BINARY_OPERATORS_SET=new Set(binaryOperators);function createRuntimeAst(t,n){let o=new Error("failed to parse");const s=n.type;if(s==="Literal")o=parseLiteral(n);else if(s==="CallExpression")o=parseCall(t,n);else if(s==="Identifier")o=parseKeywordsAndVariables(n);else if(s==="UnaryExpression"){const c=n.operator,d=createRuntimeAst(t,n.argument);if(UNARY_OPERATORS_SET.has(c))o=new Node(ExpressionNodeType.UNARY,c,d);else throw new Error(`Unexpected operator "${c}".`)}else if(s==="BinaryExpression"){const c=n.operator,d=createRuntimeAst(t,n.left),h=createRuntimeAst(t,n.right);if(BINARY_OPERATORS_SET.has(c))o=new Node(ExpressionNodeType.BINARY,c,d,h);else throw new Error(`Unexpected operator "${c}".`)}else if(s==="LogicalExpression"){const c=n.operator,d=createRuntimeAst(t,n.left),h=createRuntimeAst(t,n.right);BINARY_OPERATORS_SET.has(c)&&(o=new Node(ExpressionNodeType.BINARY,c,d,h))}else if(s==="ConditionalExpression"){const c=createRuntimeAst(t,n.test),d=createRuntimeAst(t,n.consequent),h=createRuntimeAst(t,n.alternate);o=new Node(ExpressionNodeType.CONDITIONAL,"?",d,h,c)}else if(s==="MemberExpression")o=parseMemberExpression(t,n);else if(s==="ArrayExpression"){const c=[];for(let d=0;d<n.elements.length;d++)c[d]=createRuntimeAst(t,n.elements[d]);o=new Node(ExpressionNodeType.ARRAY,c)}else throw s==="Compound"?new Error("Provide exactly one expression."):new Error("Cannot parse expression.");return o}function parseLiteral(t){const n=typeof t.value;if(t.value===null)return new Node(ExpressionNodeType.LITERAL_NULL,null);if(n==="boolean")return new Node(ExpressionNodeType.LITERAL_BOOLEAN,t.value);if(n==="number")return new Node(ExpressionNodeType.LITERAL_NUMBER,t.value);if(n==="string")return t.value.indexOf("${")>=0?new Node(ExpressionNodeType.VARIABLE_IN_STRING,t.value):t.value.indexOf("$reearth_")>=0?new Node(ExpressionNodeType.LITERAL_STRING,restoreReservedWord(t.value)):new Node(ExpressionNodeType.LITERAL_STRING,replaceBackslashes(t.value));throw new Error(`${t} is not a function.`)}function replaceBackslashes(t){return t.replace(replacementRegex,"\\")}function parseCall(t,n){const o=n.arguments,s=o.length;if(n.callee.type==="MemberExpression"){const d=n.callee.property.name,h=n.callee.object;if(d==="test"||d==="exec"){if(h.callee.name!=="regExp")throw new Error(`${d} is not a function.`);if(s===0)return d==="test"?new Node(ExpressionNodeType.LITERAL_BOOLEAN,!1):new Node(ExpressionNodeType.LITERAL_NULL,null);const p=createRuntimeAst(t,h),y=createRuntimeAst(t,o[0]);return new Node(ExpressionNodeType.FUNCTION_CALL,d,p,y)}else if(d==="toString"){const p=createRuntimeAst(t,h);return new Node(ExpressionNodeType.FUNCTION_CALL,d,p)}throw new Error(`Unexpected function call "${d}".`)}const c=n.callee.name;if(c==="color"){if(s===0)return new Node(ExpressionNodeType.LITERAL_COLOR,c);const d=createRuntimeAst(t,o[0]);if(typeof o[1]<"u"){const h=createRuntimeAst(t,o[1]);return new Node(ExpressionNodeType.LITERAL_COLOR,c,[d,h])}return new Node(ExpressionNodeType.LITERAL_COLOR,c,[d])}else if(c==="rgb"||c==="hsl"){if(s<3)throw new Error(`${c} requires three arguments.`);const d=[createRuntimeAst(t,o[0]),createRuntimeAst(t,o[1]),createRuntimeAst(t,o[2])];return new Node(ExpressionNodeType.LITERAL_COLOR,c,d)}else if(c==="rgba"||c==="hsla"){if(s<4)throw new Error(`${c} requires four arguments.`);const d=[createRuntimeAst(t,o[0]),createRuntimeAst(t,o[1]),createRuntimeAst(t,o[2]),createRuntimeAst(t,o[3])];return new Node(ExpressionNodeType.LITERAL_COLOR,c,d)}else if(c==="isNaN"||c==="isFinite"){if(s===0)return c==="isNaN"?new Node(ExpressionNodeType.LITERAL_BOOLEAN,!0):new Node(ExpressionNodeType.LITERAL_BOOLEAN,!1);const d=createRuntimeAst(t,o[0]);return new Node(ExpressionNodeType.UNARY,c,d)}else if(typeof unaryFunctions[c]<"u"){if(s!==1)throw new Error(`${c} requires exactly one argument.`);const d=createRuntimeAst(t,o[0]);return new Node(ExpressionNodeType.UNARY,c,d)}else if(typeof binaryFunctions[c]<"u"){if(s!==2)throw new Error(`${c} requires exactly two arguments.`);const d=createRuntimeAst(t,o[0]),h=createRuntimeAst(t,o[1]);return new Node(ExpressionNodeType.BINARY,c,d,h)}else if(c==="Boolean"){if(s===0)return new Node(ExpressionNodeType.LITERAL_BOOLEAN,!1);const d=createRuntimeAst(t,o[0]);return new Node(ExpressionNodeType.UNARY,c,d)}else if(c==="Number"){if(s===0)return new Node(ExpressionNodeType.LITERAL_NUMBER,0);const d=createRuntimeAst(t,o[0]);return new Node(ExpressionNodeType.UNARY,c,d)}else if(c==="String"){if(s===0)return new Node(ExpressionNodeType.LITERAL_STRING,"");const d=createRuntimeAst(t,o[0]);return new Node(ExpressionNodeType.UNARY,c,d)}throw new Error(`Unexpected function call "${c}".`)}function parseKeywordsAndVariables(t){const n=t.name;if(isVariable(n)){const o=getPropertyName(n);return o.substring(0,8)==="tiles3d_"?new Node(ExpressionNodeType.BUILTIN_VARIABLE,o):new Node(ExpressionNodeType.VARIABLE,o)}else{if(n==="NaN")return new Node(ExpressionNodeType.LITERAL_NUMBER,NaN);if(n==="Infinity")return new Node(ExpressionNodeType.LITERAL_NUMBER,1/0);if(n==="undefined")return new Node(ExpressionNodeType.LITERAL_UNDEFINED,void 0)}throw new Error(`${n} is not defined.`)}function parseMathConstant(t){const n=t.property.name;if(n==="PI")return new Node(ExpressionNodeType.LITERAL_NUMBER,Math.PI);if(n==="E")return new Node(ExpressionNodeType.LITERAL_NUMBER,Math.E);throw new Error(`${n} Math Constant is not supported at the moment`)}function parseNumberConstant(t){const n=t.property.name;if(n==="POSITIVE_INFINITY")return new Node(ExpressionNodeType.LITERAL_NUMBER,Number.POSITIVE_INFINITY);throw new Error(`${n} Number Constant is not supported at the moment`)}function parseMemberExpression(t,n){if(n.object.name==="Math")return parseMathConstant(n);if(n.object.name==="Number")return parseNumberConstant(n);let o;const s=createRuntimeAst(t,n.object);return n.computed?(o=createRuntimeAst(t,n.property),new Node(ExpressionNodeType.MEMBER,"brackets",s,o)):(o=new Node(ExpressionNodeType.LITERAL_STRING,n.property.name),new Node(ExpressionNodeType.MEMBER,"dot",s,o))}function isVariable(t){return t.substring(0,4)===VARIABLE_PREFIX}function getPropertyName(t){return restoreReservedWord(t).substring(4)}const EXPRESSION_CACHES=new Map,REPLACED_VARIABLES_CACHE=new Map,DEFINE_PLACEHOLDER_REGEX_CACHE=new Map,DEFINE_REPLACEMENT_CACHE=new Map;class Expression{constructor(n,o,s){Vf(this,"_expression");Vf(this,"_runtimeAst");Vf(this,"_feature");var p;this._expression=n,this._feature=o;let c=[];n=replaceDefines(n,s);const d=REPLACED_VARIABLES_CACHE.get(n);if(d)[n,c]=d;else{const y=n;[n,c]=replaceVariables(removeBackslashes(n),(p=this._feature)==null?void 0:p.properties),n.includes(VARIABLE_PREFIX)&&REPLACED_VARIABLES_CACHE.set(y,[n,c])}const h=EXPRESSION_CACHES.get(n);if(h)this._runtimeAst=h;else{if(c.length!==0)for(const E of c)jsep.addLiteral(E.literalName,E.literalValue);jsep.addBinaryOp("=~",0),jsep.addBinaryOp("!~",0);let y;try{y=jsep(n)}catch(E){throw new Error(`failed to generate ast: ${E}`)}this._runtimeAst=createRuntimeAst(this,y),EXPRESSION_CACHES.set(n,this._runtimeAst)}}evaluate(){return this._runtimeAst.evaluate(this._feature)}}function replaceDefines(t,n){if(typeof n>"u")return t;const o=JSON.stringify(Object.entries(n).sort()),s=t+o,c=DEFINE_REPLACEMENT_CACHE.get(s);if(c)return c;let d=DEFINE_PLACEHOLDER_REGEX_CACHE.get(t);d||(d=new RegExp(`\\$\\{(${Object.keys(n).join("|")})\\}`,"g"),DEFINE_PLACEHOLDER_REGEX_CACHE.set(t,d));const h=t.replace(d,(p,y)=>typeof n[y]<"u"?`(${n[y]})`:"");return DEFINE_REPLACEMENT_CACHE.set(s,h),h}function removeBackslashes(t){return t.replace(backslashRegex,backslashReplacement)}function clearExpressionCaches(t,n,o){REPLACED_VARIABLES_CACHE.delete(t),t=replaceDefines(t,o),[t]=replaceVariables(removeBackslashes(t),n==null?void 0:n.properties),EXPRESSION_CACHES.delete(t)}class ConditionalExpression{constructor(n,o,s){Vf(this,"_conditions");Vf(this,"_runtimeConditions");Vf(this,"_feature");Vf(this,"_memoizedResult");this._conditions=n.conditions,this._runtimeConditions=[],this._feature=o,this._memoizedResult=void 0,this.setRuntime(s)}setRuntime(n){var s;const o=(s=this._conditions)==null?void 0:s.map(c=>{const d=String(c[0]),h=String(c[1]);return new Statement(new Expression(d,this._feature,n),new Expression(h,this._feature,n))});this._runtimeConditions=o??[],this._memoizedResult=void 0}evaluate(){if(typeof this._memoizedResult<"u")return this._memoizedResult;const n=this._runtimeConditions,o=n.length;for(let c=0;c<o;c++){const d=n[c];if(d.condition.evaluate()){const h=d.expression.evaluate();return this._memoizedResult=h,h}}const s=void 0;return this._memoizedResult=s,s}}class Statement{constructor(n,o){Vf(this,"condition");Vf(this,"expression");this.condition=n,this.expression=o}}function evalTimeInterval(t,n){if(!t||!(n!=null&&n.property))return;const o=[];for(const s of t){const c=s.properties[n.property];if(c)try{o.push(new Date(c))}catch{}}return o.sort((s,c)=>s.getTime()-c.getTime()),o.map((s,c)=>[s,n.interval?new Date(s.getTime()+n.interval):o[c+1]])}async function evalSimpleLayer(t,n){var d;const o=t.data?await n.getAllFeatures(t.data):void 0,s=pick(t,appearanceKeys),c=evalTimeInterval(o,(d=t.data)==null?void 0:d.time);return{layer:evalLayerAppearances(s,t),features:o==null?void 0:o.map((h,p)=>evalSimpleLayerFeature(t,h,c==null?void 0:c[p]))}}const evalSimpleLayerFeature=(t,n,o)=>{const s=pick(t,appearanceKeys),c=evalJsonProperties(t,n);return{...c,...evalLayerAppearances(s,t,c),type:"computedFeature",interval:o}};function evalLayerAppearances(t,n,o){if(!o){if(!n.id)throw new Error("layer id is required");o={type:"feature",id:n.id,properties:n.properties||{}}}return Object.fromEntries(Object.entries(t).map(([s,c])=>c?[s,recursiveValEval(c,n,o)]:void 0).filter(s=>!!s))}function recursiveValEval(t,n,o){return Object.fromEntries(Object.entries(t).map(([s,c])=>hasNonExpressionObject(c)?[s,recursiveValEval(c,n,o)]:[s,evalExpression(c,n,o)]))}function clearAllExpressionCaches(t,n){const o=pick(t,appearanceKeys);Object.entries(o).forEach(([,s])=>{recursiveClear(s,t,n)})}function recursiveClear(t,n,o){Object.entries(t).forEach(([,s])=>{if(hasNonExpressionObject(s))recursiveClear(s,n,o);else if(hasExpression(s)){const c=s.expression;typeof c=="object"&&c.conditions?c.conditions.forEach(([d,h])=>{clearExpressionCaches(d,o,n==null?void 0:n.defines),clearExpressionCaches(h,o,n==null?void 0:n.defines)}):typeof c=="boolean"||typeof c=="number"?clearExpressionCaches(String(c),o,n==null?void 0:n.defines):typeof c=="string"&&clearExpressionCaches(c,o,n==null?void 0:n.defines)}})}function hasExpression(t){return typeof t=="object"&&t&&"expression"in t}function hasNonExpressionObject(t){return typeof t=="object"&&t&&!("expression"in t)&&!Array.isArray(t)}function evalExpression(t,n,o){try{if(hasExpression(t)){const s=t.expression,c=recursiveJSONParse(cloneDeep(o));return typeof s>"u"?void 0:typeof s=="object"&&s.conditions?new ConditionalExpression(s,c,n==null?void 0:n.defines).evaluate():typeof s=="boolean"||typeof s=="number"?new Expression(String(s),c,n==null?void 0:n.defines).evaluate():typeof s=="string"?new Expression(s,c,n==null?void 0:n.defines).evaluate():s}return t}catch(s){console.error(s);return}}function evalJsonProperties(t,n){var c;const o=(c=t.data)==null?void 0:c.jsonProperties;if(!n.properties||!o||!o.length)return n;const s={...n,...n!=null&&n.properties?{properties:{...n.properties}}:{}};return o.forEach(d=>{s.properties[d]=(()=>{const h=s.properties[d];try{return JSON.parse(h)}catch{return h}})()}),s}async function evalLayer(t,n){if(t.type==="simple")return evalSimpleLayer(t,n)}function evalFeature(t,n){if(t.type==="simple")return evalSimpleLayerFeature(t,n)}async function f(t,n){const o=await fetch(t,n);if(o.status!==200)throw new Error(`fetched ${t} but status code was ${o.status}`);return o}function convertToCoordinates(t){return t.split(" ").map(n=>parseFloat(n))}async function fetchGeoJSON(t,n,o){const s=t.url?await(await f(t.url,o)).json():t.value;return processGeoJSON(s,n,t.idProperty)}function processGeoJSON(t,n,o){if(t.type==="FeatureCollection")return t.features.flatMap(s=>processGeoJSON(s,n,o));if(t.type==="Feature"){const s=t.geometry;return s.type==="GeometryCollection"?s.geometries.flatMap(c=>processGeoJSON({...t,geometry:c},void 0,o)):s.type==="MultiPoint"?s.coordinates.flatMap(c=>processGeoJSON({...t,geometry:{type:"Point",coordinates:c}},void 0,o)):s.type==="MultiLineString"?s.coordinates.flatMap(c=>processGeoJSON({...t,geometry:{type:"LineString",coordinates:c}},void 0,o)):s.type==="MultiPolygon"?s.coordinates.flatMap(c=>processGeoJSON({...t,geometry:{type:"Polygon",coordinates:c}},void 0,o)):[{type:"feature",id:o&&t.properties&&t.properties[o]?t.properties[o]:generateRandomString$1(12),geometry:s.type==="Point"||s.type==="LineString"||s.type==="Polygon"?s:void 0,properties:t.properties,range:n}]}return[]}async function fetchCSV(t,n,o){if(!t.url){const c=t.value;if(typeof c!="string"){const d=makeFeature$1(c,n);return d?[d]:void 0}return await parseCSV(c,t.csv,n)}const s=await(await f(t.url,o)).text();return await parseCSV(s,t.csv,n)}const parseCSV=async(t,n,o)=>{const{parse:s}=await Promise.resolve().then(()=>index);return new Promise((c,d)=>{const h=[],p=s({delimiter:[",",";"," "]});let y;p.on("readable",()=>{let E;for(;(E=p.read())!==null;){if(!y){if(!(n!=null&&n.noHeader)){y=E;continue}y=[]}const L=makeGeoJSONFromArray(y,E,n),F=makeFeature$1(L,o);F&&h.push(F)}}),p.on("error",E=>{d(`${E.name} is occurred while parsing CSV: ${E.message}`)}),p.on("end",()=>{c(h)}),p.write(t),p.end()})},SUPPORTED_COORDINATES={lng:0,lat:1,height:2},setCoordinatesToPointGeometry=(t,n,o,s)=>{if(t===null)return null;const c=Number(n);return isNaN(c)||typeof n!="number"&&!n?s?t:null:(t.coordinates[o]=c,t)},makeGeoJSONFromArray=(t,n,o)=>{var c;const s=n.reduce((d,h,p)=>{let y=h;return o!=null&&o.disableTypeConversion||(y=filterNumericString(h)),(o==null?void 0:o.idColumn)!==void 0&&[t[p],p].includes(o.idColumn)?{...d,id:y}:(o==null?void 0:o.lngColumn)!==void 0&&[t[p],p].includes(o.lngColumn)?{...d,geometry:setCoordinatesToPointGeometry(d.geometry,y,SUPPORTED_COORDINATES.lng)}:(o==null?void 0:o.latColumn)!==void 0&&[t[p],p].includes(o.latColumn)?{...d,geometry:setCoordinatesToPointGeometry(d.geometry,y,SUPPORTED_COORDINATES.lat)}:(o==null?void 0:o.heightColumn)!==void 0&&[t[p],p].includes(o.heightColumn)?{...d,geometry:setCoordinatesToPointGeometry(d.geometry,y,SUPPORTED_COORDINATES.height,!0)}:{...d,properties:{...d.properties,...t[p]?{[t[p]]:y}:{}}}},{type:"Feature",geometry:{type:"Point",coordinates:[]},properties:{}});return(((c=s.geometry)==null?void 0:c.coordinates.length)||0)<2&&(s.geometry=null),s},makeFeature$1=(t,n)=>{if(t.type!=="Feature")return;const o=t.geometry;return{type:"feature",id:t.id&&String(t.id)||generateRandomString$1(12),geometry:o??void 0,properties:t.properties,range:n}},filterNumericString=t=>{const n=Number(t);return isNaN(n)||t===""?t:n};var validator$2={},util$3={};(function(t){const n=":A-Za-z_\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD",o=n+"\\-.\\d\\u00B7\\u0300-\\u036F\\u203F-\\u2040",s="["+n+"]["+o+"]*",c=new RegExp("^"+s+"$"),d=function(p,y){const E=[];let L=y.exec(p);for(;L;){const F=[];F.startIndex=y.lastIndex-L[0].length;const N=L.length;for(let z=0;z<N;z++)F.push(L[z]);E.push(F),L=y.exec(p)}return E},h=function(p){const y=c.exec(p);return!(y===null||typeof y>"u")};t.isExist=function(p){return typeof p<"u"},t.isEmptyObject=function(p){return Object.keys(p).length===0},t.merge=function(p,y,E){if(y){const L=Object.keys(y),F=L.length;for(let N=0;N<F;N++)E==="strict"?p[L[N]]=[y[L[N]]]:p[L[N]]=y[L[N]]}},t.getValue=function(p){return t.isExist(p)?p:""},t.isName=h,t.getAllMatches=d,t.nameRegexp=s})(util$3);const util$2=util$3,defaultOptions$3={allowBooleanAttributes:!1,unpairedTags:[]};validator$2.validate=function(t,n){n=Object.assign({},defaultOptions$3,n);const o=[];let s=!1,c=!1;t[0]==="\uFEFF"&&(t=t.substr(1));for(let d=0;d<t.length;d++)if(t[d]==="<"&&t[d+1]==="?"){if(d+=2,d=readPI(t,d),d.err)return d}else if(t[d]==="<"){let h=d;if(d++,t[d]==="!"){d=readCommentAndCDATA(t,d);continue}else{let p=!1;t[d]==="/"&&(p=!0,d++);let y="";for(;d<t.length&&t[d]!==">"&&t[d]!==" "&&t[d]!==" "&&t[d]!==`
|
|
@@ -121,7 +121,7 @@ Event: `).concat(JSON.stringify(event)));else if(this.status!==InterpreterStatus
|
|
|
121
121
|
|
|
122
122
|
Check the render method of \``+yu+"`."}return""}}function Kf(yu){return""}var Uf={};function $m(yu){{var lf=qf();if(!lf){var df=typeof yu=="string"?yu:yu.displayName||yu.name;df&&(lf=`
|
|
123
123
|
|
|
124
|
-
Check the top-level render call using <`+df+">.")}return lf}}function jm(yu,lf){{if(!yu._store||yu._store.validated||yu.key!=null)return;yu._store.validated=!0;var df=$m(lf);if(Uf[df])return;Uf[df]=!0;var _f="";yu&&yu._owner&&yu._owner!==vm.current&&(_f=" It was passed a child from "+pi(yu._owner.type)+"."),Sf(yu),Ee('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.',df,_f),Sf(null)}}function ip(yu,lf){{if(typeof yu!="object")return;if(cf(yu))for(var df=0;df<yu.length;df++){var _f=yu[df];Nf(_f)&&jm(_f,lf)}else if(Nf(yu))yu._store&&(yu._store.validated=!0);else if(yu){var Df=nt(yu);if(typeof Df=="function"&&Df!==yu.entries)for(var Ff=Df.call(yu),Af;!(Af=Ff.next()).done;)Nf(Af.value)&&jm(Af.value,lf)}}}function rp(yu){{var lf=yu.type;if(lf==null||typeof lf=="string")return;var df;if(typeof lf=="function")df=lf.propTypes;else if(typeof lf=="object"&&(lf.$$typeof===y||lf.$$typeof===F))df=lf.propTypes;else return;if(df){var _f=pi(lf);ff(df,yu.props,"prop",_f,yu)}else if(lf.PropTypes!==void 0&&!Gf){Gf=!0;var Df=pi(lf);Ee("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",Df||"Unknown")}typeof lf.getDefaultProps=="function"&&!lf.getDefaultProps.isReactClassApproved&&Ee("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.")}}function ep(yu){{for(var lf=Object.keys(yu.props),df=0;df<lf.length;df++){var _f=lf[df];if(_f!=="children"&&_f!=="key"){Sf(yu),Ee("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",_f),Sf(null);break}}yu.ref!==null&&(Sf(yu),Ee("Invalid attribute `ref` supplied to `React.Fragment`."),Sf(null))}}function Qm(yu,lf,df,_f,Df,Ff){{var Af=ms(yu);if(!Af){var If="";(yu===void 0||typeof yu=="object"&&yu!==null&&Object.keys(yu).length===0)&&(If+=" You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");var Pm=Kf();Pm?If+=Pm:If+=qf();var Wf;yu===null?Wf="null":cf(yu)?Wf="array":yu!==void 0&&yu.$$typeof===n?(Wf="<"+(pi(yu.type)||"Unknown")+" />",If=" Did you accidentally export a JSX literal instead of a component?"):Wf=typeof yu,Ee("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",Wf,If)}var Hf=Am(yu,lf,df,Df,Ff);if(Hf==null)return Hf;if(Af){var Dm=lf.children;if(Dm!==void 0)if(_f)if(cf(Dm)){for(var vp=0;vp<Dm.length;vp++)ip(Dm[vp],yu);Object.freeze&&Object.freeze(Dm)}else Ee("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else ip(Dm,yu)}return yu===s?ep(Hf):rp(Hf),Hf}}function tp(yu,lf,df){return Qm(yu,lf,df,!0)}function op(yu,lf,df){return Qm(yu,lf,df,!1)}var yp=op,mp=tp;pe$1.Fragment=s,pe$1.jsx=yp,pe$1.jsxs=mp}()),pe$1}process.env.NODE_ENV==="production"?Ae$1.exports=Ot$1():Ae$1.exports=Gt$1();var H=Ae$1.exports;function Bt$1(t,n){return n?Fe$1(t).reduce((o,[s,c])=>(ve$1(n,s)&&(o[s]=c),o),{}):{}}function Fe$1(t){return Object.keys(t).map(n=>[n,t[n]])}function ve$1(t,n){return!!t&&t.indexOf(n)!==-1}function At$1(t,n){return!!t&&!!n&&[...Object.keys(t),...Object.keys(n)].every(o=>t[o]===n[o])}function Ft$1(t){return t&&typeof t.isDestroyed=="function"&&typeof t.destroy=="function"}function It$1(t){return Ft$1(t)&&t.isDestroyed()}function J(t){return t&&typeof t=="object"&&"then"in t&&typeof t.then=="function"}const ce$1="__RESIUM_EVENT_MANAGER",Ie$1=["onClick","onDoubleClick","onMouseDown","onMouseUp","onMiddleClick","onMiddleDown","onMiddleUp","onMouseMove","onPinchEnd","onPinchMove","onPinchStart","onRightClick","onRightDown","onRightUp","onWheel","onMouseEnter","onMouseLeave"],Re$1=class rg{constructor(n){K$1(this,"scene"),K$1(this,"sshe"),K$1(this,"events",{onClick:new Map,onDoubleClick:new Map,onMouseDown:new Map,onMouseUp:new Map,onMiddleClick:new Map,onMiddleDown:new Map,onMiddleUp:new Map,onMouseMove:new Map,onPinchEnd:new Map,onPinchMove:new Map,onPinchStart:new Map,onRightClick:new Map,onRightDown:new Map,onRightUp:new Map,onWheel:new Map,onMouseEnter:new Map,onMouseLeave:new Map}),K$1(this,"hovered"),K$1(this,"onMouseMove",o=>{var s,c,d,h,p,y;const E=this.pick(o.endPosition);this.hovered!==E&&(this.hovered&&((s=this.getEventCallback("onMouseLeave",this.hovered))==null||s(o,this.hovered),(c=this.getEventCallback("onMouseLeave",null))==null||c(o,this.hovered)),E&&((d=this.getEventCallback("onMouseEnter",E))==null||d(o,E),(h=this.getEventCallback("onMouseEnter",null))==null||h(o,E))),E&&((p=this.getEventCallback("onMouseMove",E))==null||p(o,E)),(y=this.getEventCallback("onMouseMove",null))==null||y(o,E),this.hovered=E}),K$1(this,"eventCallback",o=>s=>{var c,d;const h=this.pick(s==null?void 0:s.position);h&&((c=this.getEventCallback(o,h))==null||c(s,h)),(d=this.getEventCallback(o,null))==null||d(s,h)}),this.scene=n,this.sshe=new Cesium$1.ScreenSpaceEventHandler(n==null?void 0:n.canvas)}destroy(){this.hovered=void 0,this.sshe.isDestroyed()||this.sshe.destroy()}isDestroyed(){return this.sshe.isDestroyed()}on(n,o,s){n&&o==="onWheel"||this.events[o].set(n,s)}off(n,o){this.events[o].delete(n),this.hovered===n&&(this.hovered=void 0)}setEvents(n,o){Fe$1(o).forEach(([s,c])=>{const d=s;ve$1(Ie$1,d)&&(c?this.on(n,d,c):this.off(n,d))}),this.commit()}clearEvents(n){this.hovered=void 0,Ie$1.forEach(o=>{this.off(n,o)}),this.commit()}commit(){const n=this.sshe,o=this.sshe.isDestroyed();o||(this.events.onMouseEnter.size===0&&this.events.onMouseLeave.size===0&&this.events.onMouseMove.size===0?this.sshe.removeInputAction(Cesium$1.ScreenSpaceEventType.MOUSE_MOVE):this.sshe.getInputAction(Cesium$1.ScreenSpaceEventType.MOUSE_MOVE)||this.sshe.setInputAction(this.onMouseMove,Cesium$1.ScreenSpaceEventType.MOUSE_MOVE)),Fe$1(this.events).forEach(([s,c])=>{if(s==="onMouseEnter"||s==="onMouseLeave"||s==="onMouseMove")return;const d=rg.eventTypeMap[s];o||(c.size===0?n.removeInputAction(d):n.getInputAction(d)||n.setInputAction(this.eventCallback(s),d))})}getScreenSpaceEventHandler(){return this.sshe}getEventCallback(n,o){var s,c;return o===null?this.events[n].get(null):this.events[n].get(o.id)||this.events[n].get((c=(s=o.id)==null?void 0:s.entityCollection)==null?void 0:c.owner)||this.events[n].get(o.primitive)||this.events[n].get(o.tileset)}pick(n){var o;if(n)return(o=this.scene)==null?void 0:o.pick(n)}};K$1(Re$1,"eventTypeMap",{onClick:Cesium$1.ScreenSpaceEventType.LEFT_CLICK,onDoubleClick:Cesium$1.ScreenSpaceEventType.LEFT_DOUBLE_CLICK,onMouseDown:Cesium$1.ScreenSpaceEventType.LEFT_DOWN,onMouseUp:Cesium$1.ScreenSpaceEventType.LEFT_UP,onMiddleClick:Cesium$1.ScreenSpaceEventType.MIDDLE_CLICK,onMiddleDown:Cesium$1.ScreenSpaceEventType.MIDDLE_DOWN,onMiddleUp:Cesium$1.ScreenSpaceEventType.MIDDLE_UP,onMouseMove:Cesium$1.ScreenSpaceEventType.MOUSE_MOVE,onPinchEnd:Cesium$1.ScreenSpaceEventType.PINCH_END,onPinchMove:Cesium$1.ScreenSpaceEventType.PINCH_MOVE,onPinchStart:Cesium$1.ScreenSpaceEventType.PINCH_START,onRightClick:Cesium$1.ScreenSpaceEventType.RIGHT_CLICK,onRightDown:Cesium$1.ScreenSpaceEventType.RIGHT_DOWN,onRightUp:Cesium$1.ScreenSpaceEventType.RIGHT_UP,onWheel:Cesium$1.ScreenSpaceEventType.WHEEL,onMouseEnter:Cesium$1.ScreenSpaceEventType.MOUSE_MOVE,onMouseLeave:Cesium$1.ScreenSpaceEventType.MOUSE_MOVE});let De$1=Re$1;const Wt$1=({name:t,create:n,destroy:o,provide:s,update:c,cesiumReadonlyProps:d,cesiumEventProps:h,otherProps:p,setCesiumPropsAfterCreate:y,useCommonEvent:E,useRootEvent:L},F,N)=>{const z=React.useRef(),oe=$e$1(),W=React.useRef(s?{}:void 0),nt=React.useRef({}),lt=React.useRef(si$1(F)),Ee=React.useRef({}),[yt,Ai]=React.useState(!1),zi=React.useRef(!1),ha=React.useRef(null),ba=React.useRef(),Sa=oe==null?void 0:oe[ce$1],ya=React.useRef(),ms=React.useRef(),Wc=React.useCallback(async fa=>{var Ra;if(!z.current)return;const sl=z.current,Zd=Object.keys(fa),Xd=Object.keys(h||[]),pu=Zd.concat(Object.keys(Ee.current).filter(ef=>!Zd.includes(ef))).filter(ef=>Ee.current[ef]!==fa[ef]).map(ef=>[ef,Ee.current[ef],fa[ef]]),gl=[];for(const[ef,nf,rf]of pu)if(d!=null&&d.includes(ef))gl.push(ef);else if(ve$1(Xd,ef)){const uf=h==null?void 0:h[ef],mf=sl[uf];mf instanceof Cesium$1.Event&&(typeof nf>"u"?(mf.addEventListener(rf),nt.current[uf]=rf):typeof rf>"u"?(mf.removeEventListener(nf),delete nt.current[uf]):(mf.removeEventListener(nf),mf.addEventListener(rf)))}else ef!=="children"&&!Ie$1.includes(ef)&&!(p!=null&&p.includes(ef))&&(sl[ef]=rf);const md=L?(Ra=W.current)==null?void 0:Ra[ce$1]:Sa;if(E&&md&&z.current&&md.setEvents(L?null:z.current,fa),c&&zi.current){const ef=c(z.current,fa,Ee.current,oe);J(ef)&&await ef}Ee.current=fa,lt.current=fa,zi.current&&gl.length>0&&(process.env.NODE_ENV!=="production"&&console.warn(`Warning: <${t}> is recreated because following read-only props have been updated: ${gl.join(", ")}`),pi(),await mt(),ya.current=Wa())},[]),Wa=React.useCallback(async()=>{var fa;await new Promise(Xd=>queueMicrotask(()=>Xd(void 0)));const Ra=n==null?void 0:n(oe,lt.current,ha.current);let sl;if(J(Ra)?sl=await Ra:sl=Ra,Array.isArray(sl)?(z.current=sl[0],ba.current=sl[1]):z.current=sl,y)await Wc(lt.current);else{if(z.current&&h){const Xd=z.current;for(const pu of Object.keys(lt.current)){const gl=h[pu];if(gl){const md=lt.current[pu],ef=Xd[gl];md&&ef instanceof Cesium$1.Event&&ef.addEventListener(md)}}}Ee.current=lt.current}s&&z.current&&(W.current={...oe,...s(z.current,oe,F,ba.current)});const Zd=L?(fa=W.current)==null?void 0:fa[ce$1]:Sa;E&&Zd&&z.current&&Zd.setEvents(L?null:z.current,lt.current),ms.current||Ai(!0)},[]),pi=React.useCallback(()=>{Ai(!1),zi.current=!1},[]),mt=React.useCallback(async()=>{var fa,Ra;await new Promise(Zd=>queueMicrotask(()=>Zd(void 0))),ya.current&&(await ya.current,ya.current=void 0),z.current&&o&&o(z.current,oe,ha.current,ba.current);const sl=L?(fa=W.current)==null?void 0:fa[ce$1]:Sa;if(E&&sl&&z.current&&sl.clearEvents(L?null:z.current),z.current&&!It$1(z.current)){const Zd=Object.keys(nt.current);for(const Xd of Zd){const pu=z.current[Xd];(Ra=pu==null?void 0:pu.removeEventListener)==null||Ra.call(pu,nt.current[Xd])}}nt.current={},W.current=void 0,ba.current=void 0,z.current=void 0},[]);return React.useLayoutEffect(()=>((async()=>(ms.current&&(await ms.current,ms.current=void 0),ya.current=Wa()))(),()=>{pi(),ms.current=mt()}),[Wa,mt,pi]),React.useEffect(()=>{(async()=>{var fa,Ra;ya.current&&await ya.current;const sl=si$1(F);yt?At$1(sl,Ee.current)||(await Wc(sl),(Ra=(fa=oe.__$internal)==null?void 0:fa.onUpdate)==null||Ra.call(fa)):(Ee.current=sl,lt.current=sl,zi.current=!0)})()},[oe.__$internal,yt,F,Wc]),React.useImperativeHandle(N,()=>({cesiumElement:yt?z.current:null}),[yt]),[W.current,yt,ha]};function si$1(t){const{children:n,...o}=t;return o}const l=({renderContainer:t,noChildren:n,containerProps:o,defaultProps:s,...c})=>{const d=(h,p)=>{const y={...s,...h},[E,L,F]=Wt$1(c,y,p);if(n)return null;const N=L&&"children"in y?y.children:null,z=t?H.jsx("div",{"data-testid":"resium-container",ref:F,...typeof o=="function"?o(y):Bt$1(y,o),children:N}):N?H.jsx(H.Fragment,{children:N}):null;return E?H.jsx(We$1.Provider,{value:E,children:z}):z};return d.displayName=c.name,React.forwardRef(d)},Vt$1=["enabled","selected"],U$1=t=>l({name:t.name,create(n,o){if(!n.scene)return;const s=t.create(o,n.scene.postProcessStages);return typeof o.enabled=="boolean"&&(s.enabled=o.enabled),o.selected&&"selected"in s&&(s.selected=o.selected),t.props.forEach(c=>{!ve$1(t.readonlyProps,c)&&typeof o[c]<"u"&&(s.uniforms[c]=o[c])}),!t.noMount&&n.scene&&!n.scene.isDestroyed()&&n.scene.postProcessStages.add(s),s},destroy(n,o){t.noMount?n.enabled=!1:(o.scene&&!o.scene.isDestroyed()&&o.scene.postProcessStages.remove(n),n.isDestroyed()||n.destroy())},update(n,o,s){t.props.forEach(c=>{!ve$1(t.readonlyProps,c)&&o[c]!==s[c]&&(n.uniforms[c]=o[c])})},cesiumProps:Vt$1,cesiumReadonlyProps:t.readonlyProps,defaultProps:{enabled:!0}}),Ut$1=["alignedAxis","color","disableDepthTestDistance","distanceDisplayCondition","eyeOffset","height","heightReference","horizontalOrigin","image","pixelOffset","pixelOffsetScaleByDistance","position","rotation","scale","scaleByDistance","show","sizeInMeters","translucencyByDistance","verticalOrigin","width","id"];l({name:"Billboard",create(t,n){var o;return(o=t.billboardCollection)==null?void 0:o.add(n)},destroy(t,n){n.billboardCollection&&!n.billboardCollection.isDestroyed()&&n.billboardCollection.remove(t)},cesiumProps:Ut$1,useCommonEvent:!0});const Ht=["blendOption","debugShowBoundingVolume","debugShowTextureAtlas","modelMatrix","show"];l({name:"BillboardCollection",create(t,n){if(!t.primitiveCollection)return;const o=new Cesium$1.BillboardCollection({modelMatrix:n.modelMatrix,debugShowBoundingVolume:n.debugShowBoundingVolume,scene:t.scene,blendOption:n.blendOption});return t.primitiveCollection.add(o),o},destroy(t,n){n.primitiveCollection&&!n.primitiveCollection.isDestroyed()&&n.primitiveCollection.remove(t),t.isDestroyed()||t.destroy()},provide(t){return{billboardCollection:t}},cesiumProps:Ht});const xt$1=["image","show","scale","horizontalOrigin","verticalOrigin","eyeOffset","pixelOffset","rotation","alignedAxis","width","height","color","scaleByDistance","translucencyByDistance","pixelOffsetScaleByDistance","imageSubRegion","sizeInMeters","heightReference","distanceDisplayCondition","disableDepthTestDistance"],Nt$1={onDefinitionChange:"definitionChanged"},qt$1=l({name:"BillboardGraphics",create(t,n){if(!t.entity)return;const o=new Cesium$1.BillboardGraphics(n);return t.entity.billboard=o,o},destroy(t,n){n.entity&&(n.entity.billboard=void 0)},cesiumProps:xt$1,cesiumEventProps:Nt$1}),gs$1=qt$1,Yt$1=["heightReference","dimensions","show","fill","material","outline","outlineColor","outlineWidth","shadows","distanceDisplayCondition"],Kt$1={onDefinitionChange:"definitionChanged"},Jt$1=l({name:"BoxGraphics",create(t,n){if(!t.entity)return;const o=new Cesium$1.BoxGraphics(n);return t.entity.box=o,o},destroy(t,n){n.entity&&(n.entity.box=void 0)},cesiumProps:Yt$1,cesiumEventProps:Kt$1}),Cs$1=Jt$1,Zt$1=["position","direction","up","right","frustum","defaultMoveAmount","defaultLookAmount","defaultRotateAmount","defaultZoomAmount","constrainedAxis","maximumZoomFactor","percentageChanged"],Xt$1={onChange:"changed",onMoveEnd:"moveEnd",onMoveStart:"moveStart"},Qt$1=l({name:"Camera",create:t=>{var n;return(n=t.scene)==null?void 0:n.camera},cesiumProps:Zt$1,cesiumEventProps:Xt$1,setCesiumPropsAfterCreate:!0}),Ps$1=Qt$1,rn$1=["show","modelMatrix","shadows","maximumScreenSpaceError","cullRequestsWhileMoving","cullRequestsWhileMovingMultiplier","preloadWhenHidden","preloadFlightDestinations","preferLeaves","progressiveResolutionHeightFraction","foveatedScreenSpaceError","foveatedConeSize","foveatedMinimumScreenSpaceErrorRelaxation","foveatedInterpolationCallback","foveatedTimeDelay","dynamicScreenSpaceError","dynamicScreenSpaceErrorDensity","dynamicScreenSpaceErrorFactor","dynamicScreenSpaceErrorHeightFalloff","skipLevelOfDetail","baseScreenSpaceError","skipScreenSpaceErrorFactor","skipLevels","immediatelyLoadDesiredLevelOfDetail","loadSiblings","clippingPlanes","classificationType","ellipsoid","lightColor","colorBlendAmount","colorBlendMode","debugFreezeFrame","debugColorizeTiles","debugWireframe","debugShowBoundingVolume","debugShowContentBoundingVolume","debugShowViewerRequestVolume","debugShowGeometricError","debugShowRenderingStatistics","debugShowMemoryUsage","debugShowUrl","style","backFaceCulling","vectorClassificationOnly","vectorKeepDecodedPositions","splitDirection","customShader","imageBasedLighting","showCreditsOnScreen","featureIdLabel","instanceFeatureIdLabel","imageBasedLighting","outlineColor","cacheBytes","maximumCacheOverflowBytes","enableCollision"],sn$1=["showOutline","cullWithChildrenBounds","debugHeatmapTilePropertyName","enableDebugWireframe","modelUpAxis","modelForwardAxis","projectTo2D","enableShowOutline","enablePick"],an$1={onAllTilesLoad:"allTilesLoaded",onInitialTilesLoad:"initialTilesLoaded",onLoadProgress:"loadProgress",onTileFailed:"tileFailed",onTileLoad:"tileLoad",onTileUnload:"tileUnload",onTileVisible:"tileVisible"},cn$1=["onReady","onError","url"],ln$1=l({name:"Cesium3DTileset",async create(t,n){var o,s;if(!t.primitiveCollection)return;const c=n.url;let d;J(c)?d=await c:d=c;let h;try{h=await Cesium$1.Cesium3DTileset.fromUrl(d,n),(o=n.onReady)==null||o.call(n,h)}catch(p){(s=n.onError)==null||s.call(n,p);return}return n.colorBlendAmount&&(h.colorBlendAmount=n.colorBlendAmount),n.colorBlendMode&&(h.colorBlendMode=n.colorBlendMode),n.style&&(h.style=n.style),t.primitiveCollection.add(h),h},destroy(t,n){n.primitiveCollection&&!n.primitiveCollection.isDestroyed()&&n.primitiveCollection.remove(t),t.isDestroyed()||t.destroy()},cesiumProps:rn$1,cesiumReadonlyProps:sn$1,cesiumEventProps:an$1,otherProps:cn$1,useCommonEvent:!0}),Ds$1=ln$1,un$1=["show","uri","maximumScreenSpaceError"],dn$1={onDefinitionChange:"definitionChanged"};l({name:"Cesium3DTilesetGraphics",create(t,n){if(!t.entity)return;const o=new Cesium$1.Cesium3DTilesetGraphics(n);return t.entity.tileset=o,o},destroy(t,n){n.entity&&(n.entity.tileset=void 0)},cesiumProps:un$1,cesiumEventProps:dn$1});const fn$1=["resolutionScale","useDefaultRenderLoop","targetFrameRate","useBrowserRecommendedResolution","creditDisplay"],hn$1=["clock","baseLayer","terrainProvider","skyBox","skyAtmosphere","sceneMode","scene3DOnly","orderIndependentTranslucency","mapMode2D","mapProjection","globe","showRenderLoopErrors","contextOptions","creditContainer","creditViewport","shadows","terrainShadows","terrain","requestRenderMode","maximumRenderTimeChange","msaaSamples","blurActiveElementOnCanvasFocus"],yn$1=["className","id","style","full","containerProps"];l({name:"CesiumWidget",create(t,n,o){if(!o)return;const s=new Cesium$1.CesiumWidget(o,n);if(!s)return;typeof n.resolutionScale=="number"&&(s.resolutionScale=n.resolutionScale);const c=new De$1(s.scene);return[s,c]},destroy(t,n,o,s){s&&!s.isDestroyed()&&s.destroy(),t.isDestroyed()||t.destroy()},provide(t,n,o,s){return{cesiumWidget:t,scene:t.scene,camera:t.scene.camera,imageryLayerCollection:t.scene.globe.imageryLayers,primitiveCollection:t.scene.primitives,globe:t.scene.globe,__$internal:{onUpdate:o==null?void 0:o.onUpdate},[ce$1]:s}},containerProps:({id:t,className:n,style:o,full:s,containerProps:c})=>({className:n,id:t,style:{...s?{position:"absolute",bottom:"0",left:"0",right:"0",top:"0"}:{},...o},...c}),cesiumProps:fn$1,cesiumReadonlyProps:hn$1,otherProps:yn$1,renderContainer:!0,useCommonEvent:!0,useRootEvent:!0});const vn$1=["classificationType","debugShowBoundingVolume","debugShowShadowVolume","show"],gn$1=["allowPicking","asynchronous","compressVertices","geometryInstances","interleave","releaseGeometryInstances","vertexCacheOptimize","appearance"],Cn$1=["onReady"];l({name:"ClassificationPrimitive",async create(t,n){var o;if(!t.primitiveCollection)return;const s=new Cesium$1.ClassificationPrimitive(n);if(n.onReady){const c=()=>{var d,h;s.ready&&((d=n.onReady)==null||d.call(n,s),(h=t.scene)==null||h.postRender.removeEventListener(c))};(o=t.scene)==null||o.postRender.addEventListener(c)}return t.primitiveCollection.add(s),s},destroy(t,n){n.primitiveCollection&&!n.primitiveCollection.isDestroyed()&&n.primitiveCollection.remove(t),t.isDestroyed()||t.destroy()},cesiumProps:vn$1,cesiumReadonlyProps:gn$1,otherProps:Cn$1,useCommonEvent:!0});const Sn$1={onStop:"onStop",onTick:"onTick"},En$1=["canAnimate","clockRange","clockStep","currentTime","multiplier","shouldAnimate","startTime","stopTime"],bn=l({name:"Clock",create:t=>{var n;return(n=t.cesiumWidget)==null?void 0:n.clock},cesiumProps:En$1,cesiumEventProps:Sn$1,setCesiumPropsAfterCreate:!0}),Ms$1=bn,wn$1=["noiseDetail","noiseOffset","show","debugBillboards","debugEllipsoids"];l({name:"CloudCollection",create:t=>{if(!t.primitiveCollection)return;const n=new Cesium$1.CloudCollection;return t.primitiveCollection.add(n),n},destroy(t,n){n.primitiveCollection&&!n.primitiveCollection.isDestroyed()&&n.primitiveCollection.remove(t),t.isDestroyed()||t.destroy()},provide:t=>({cloudCollection:t}),cesiumProps:wn$1,setCesiumPropsAfterCreate:!0});const Rn$1=["positions","width","cornerType","height","heightReference","extrudedHeight","extrudedHeightReference","show","fill","material","outline","outlineColor","outlineWidth","granularity","shadows","distanceDisplayCondition","zIndex","classificationType"],$n$1={onDefinitionChange:"definitionChanged"};l({name:"CorridorGraphics",create(t,n){if(!t.entity)return;const o=new Cesium$1.CorridorGraphics(n);return n.classificationType&&(o.classificationType=n.classificationType),t.entity.corridor=o,o},destroy(t,n){n.entity&&(n.entity.corridor=void 0)},cesiumProps:Rn$1,cesiumEventProps:$n$1});const Mn$1=["show","position","scale","maximumSize","slice","brightness","color"];l({name:"CumulusCloud",create:(t,n)=>{var o;return(o=t.cloudCollection)==null?void 0:o.add(n)},destroy(t,n){n.cloudCollection&&!n.cloudCollection.isDestroyed()&&n.cloudCollection.remove(t)},cesiumProps:Mn$1});const Ln$1=["clustering","name","show","clock","isLoading"],_n$1={onChange:"changedEvent",onError:"errorEvent",onLoading:"loadingEvent"},On$1=l({name:"CustomDataSource",create(t,n){if(!t.dataSourceCollection)return;const o=new Cesium$1.CustomDataSource(n.name);return n.clustering&&(o.clustering=n.clustering),typeof n.show=="boolean"&&(o.show=n.show),typeof n.clock<"u"&&(o.clock=n.clock),t.dataSourceCollection.add(o),o},destroy(t,n){n.dataSourceCollection&&!n.dataSourceCollection.isDestroyed()&&n.dataSourceCollection.remove(t)},provide(t){return{entityCollection:t.entities,dataSource:t}},cesiumProps:Ln$1,cesiumEventProps:_n$1,useCommonEvent:!0}),Os$1=On$1,Gn$1=["heightReference","length","topRadius","bottomRadius","show","fill","material","outline","outlineColor","outlineWidth","numberOfVerticalLines","slices","distanceDisplayCondition","shadows"],Bn$1={onDefinitionChange:"definitionChanged"};l({name:"CylinderGraphics",create(t,n){if(!t.entity)return;const o=new Cesium$1.CylinderGraphics(n);return t.entity.cylinder=o,o},destroy(t,n){n.entity&&(n.entity.cylinder=void 0)},cesiumProps:Gn$1,cesiumEventProps:Bn$1});const Fn$1=["clustering","show"],In$1=["name","sourceUri","credit"],Wn$1={onChange:"changedEvent",onError:"errorEvent",onLoading:"loadingEvent"},Vn$1=["onLoad","data"],ai=(t,{data:n,onLoad:o,...s})=>{n&&t.load(n,s).then(c=>{o&&o(c)})},Un$1=l({name:"CzmlDataSource",create(t,n){if(!t.dataSourceCollection)return;const o=new Cesium$1.CzmlDataSource(n.name);return n.clustering&&(o.clustering=n.clustering),typeof n.show=="boolean"&&(o.show=n.show),t.dataSourceCollection.add(o),n.data&&ai(o,n),o},update(t,n,o){n.data?o.show!==n.show&&(t.show=typeof n.show=="boolean"?n.show:!0):t.show=!1,n.data&&(o.data!==n.data||o.sourceUri!==n.sourceUri||o.credit!==n.credit)&&ai(t,n)},destroy(t,n){n.dataSourceCollection&&!n.dataSourceCollection.isDestroyed()&&n.dataSourceCollection.remove(t)},provide(t){return{dataSource:t}},cesiumProps:Fn$1,cesiumReadonlyProps:In$1,cesiumEventProps:Wn$1,otherProps:Vn$1,useCommonEvent:!0}),Bs$1=Un$1,jn$1=["semiMajorAxis","semiMinorAxis","height","heightReference","extrudedHeight","show","fill","material","outline","outlineColor","outlineWidth","numberOfVerticalLines","rotation","stRotation","granularity","shadows","distanceDisplayCondition","zIndex","classificationType","extrudedHeightReference"],Hn$1={onDefinitionChange:"definitionChanged"},zn$1=l({name:"EllipseGraphics",create(t,n){if(!t.entity)return;const o=new Cesium$1.EllipseGraphics(n);return t.entity.ellipse=o,o},destroy(t,n){n.entity&&(n.entity.ellipse=void 0)},cesiumProps:jn$1,cesiumEventProps:Hn$1}),As$1=zn$1,xn$1=["heightReference","radii","show","fill","innerRadii","material","maximumClock","maximumCone","minimumClock","minimumCone","outline","outlineColor","outlineWidth","subdivisions","stackPartitions","slicePartitions","shadows","distanceDisplayCondition"],Nn$1={onDefinitionChange:"definitionChanged"},qn$1=l({name:"EllipsoidGraphics",create(t,n){if(!t.entity)return;const o=new Cesium$1.EllipsoidGraphics(n);return t.entity.ellipsoid=o,o},destroy(t,n){n.entity&&(n.entity.ellipsoid=void 0)},cesiumProps:xn$1,cesiumEventProps:Nn$1}),Fs$1=qn$1,Yn$1=["availability","billboard","box","corridor","cylinder","description","ellipse","ellipsoid","entityCollection","label","model","name","orientation","path","plane","parent","point","polygon","polyline","polylineVolume","position","properties","rectangle","show","tileset","viewFrom","wall"],Kn$1=["id"],Jn$1={onDefinitionChange:"definitionChanged"},Zn$1=["selected","tracked"],Xn$1=l({name:"Entity",create(t,n){if(!t.entityCollection)return;const o=new Cesium$1.Entity(n);return t.viewer&&n.selected&&(t.viewer.selectedEntity=o),t.viewer&&n.tracked&&(t.viewer.trackedEntity=o),t.entityCollection.add(o),o},destroy(t,n){n.entityCollection&&n.entityCollection.remove(t)},update(t,n,o,s){s.viewer&&(n.selected!==o.selected&&(n.selected?s.viewer.selectedEntity=t:s.viewer.selectedEntity===t&&(s.viewer.selectedEntity=void 0)),n.tracked!==o.tracked&&(n.tracked?s.viewer.trackedEntity=t:s.viewer.trackedEntity===t&&(s.viewer.trackedEntity=void 0)))},provide(t,n,o){return{entity:t,__$internal:{onUpdate:o==null?void 0:o.onUpdate}}},cesiumProps:Yn$1,cesiumReadonlyProps:Kn$1,cesiumEventProps:Jn$1,otherProps:Zn$1,useCommonEvent:!0}),Is$1=Xn$1,eo$1=["density","enabled","minimumBrightness","screenSpaceErrorFactor","renderable"],io$1=l({name:"Fog",create(t){if(!t.scene)return;const n=new Cesium$1.Fog;return t.scene.fog=n,n},destroy(t,n){n.scene&&!n.scene.isDestroyed()&&(n.scene.fog=new Cesium$1.Fog)},cesiumProps:eo$1,setCesiumPropsAfterCreate:!0}),Vs=io$1,to$1=["clustering","name","show"],no$1=["clampToGround","sourceUri","credit","markerSize","markerSymbol","markerColor","stroke","strokeWidth","fill","describe"],oo$1={onChange:"changedEvent",onError:"errorEvent",onLoading:"loadingEvent"},ro$1=["onLoad","data"],ci$1=(t,{data:n,onLoad:o,...s})=>{n&&t.load(n,s).then(c=>{o&&o(c)})},so$1=l({name:"GeoJsonDataSource",create(t,n){if(!t.dataSourceCollection)return;const o=new Cesium$1.GeoJsonDataSource(n.name);return n.clustering&&(o.clustering=n.clustering),typeof n.show=="boolean"&&(o.show=n.show),t.dataSourceCollection.add(o),n.data&&ci$1(o,n),o},update(t,n,o){n.data?o.show!==n.show&&(t.show=typeof n.show=="boolean"?n.show:!0):t.show=!1,n.data&&(o.data!==n.data||o.clampToGround!==n.clampToGround||o.sourceUri!==n.sourceUri||o.credit!==n.credit||o.markerSize!==n.markerSize||o.markerSymbol!==n.markerSymbol||o.markerColor!==n.markerColor||o.stroke!==n.stroke||o.strokeWidth!==n.strokeWidth||o.fill!==n.fill)&&ci$1(t,n)},destroy(t,n){n.dataSourceCollection&&!n.dataSourceCollection.isDestroyed()&&n.dataSourceCollection.remove(t)},provide(t){return{dataSource:t}},cesiumProps:to$1,cesiumReadonlyProps:no$1,cesiumEventProps:oo$1,otherProps:ro$1,useCommonEvent:!0}),Us$1=so$1,ao$1={onImageryLayersUpdate:"imageryLayersUpdatedEvent",onTerrainProviderChange:"terrainProviderChanged",onTileLoadProgress:"tileLoadProgressEvent"},co$1=["atmosphereBrightnessShift","atmosphereHueShift","atmosphereSaturationShift","backFaceCulling","baseColor","clippingPlanes","depthTestAgainstTerrain","enableLighting","lightingFadeInDistance","lightingFadeOutDistance","material","maximumScreenSpaceError","nightFadeInDistance","nightFadeOutDistance","oceanNormalMapUrl","shadows","show","showGroundAtmosphere","showWaterEffect","tileCacheSize","loadingDescendantLimit","preloadAncestors","preloadSiblings","fillHighlightColor","dynamicAtmosphereLighting","dynamicAtmosphereLightingFromSun","showSkirts","cartographicLimitRectangle","translucency","undergroundColor","undergroundColorAlphaByDistance","lambertDiffuseMultiplier","atmosphereLightIntensity","atmosphereRayleighCoefficient","atmosphereMieCoefficient","atmosphereRayleighScaleHeight","atmosphereMieScaleHeight","atmosphereMieAnisotropy","vertexShadowDarkness"],lo=["terrainProvider"],uo$1=l({name:"Globe",create:t=>{var n;return(n=t.scene)==null?void 0:n.globe},update:async(t,n)=>{const o=n.terrainProvider;let s;J(o)?s=await o:s=o,t.terrainProvider=s},cesiumProps:co$1,cesiumEventProps:ao$1,otherProps:lo,setCesiumPropsAfterCreate:!0}),js$1=uo$1,mo$1=["appearance","classificationType","debugShowBoundingVolume","debugShowShadowVolume","show"],fo$1=["allowPicking","asynchronous","geometryInstances","interleave","releaseGeometryInstances"],ho$2=["onReady"];l({name:"GroundPolylinePrimitive",create(t,n){var o;if(!t.primitiveCollection)return;const s=new Cesium$1.GroundPolylinePrimitive(n);if(n.onReady){const c=()=>{var d,h;s.ready&&((d=n.onReady)==null||d.call(n,s),(h=t.scene)==null||h.postRender.removeEventListener(c))};(o=t.scene)==null||o.postRender.addEventListener(c)}return t.primitiveCollection.add(s),s},destroy(t,n){n.primitiveCollection&&!n.primitiveCollection.isDestroyed()&&n.primitiveCollection.remove(t),t.isDestroyed()||t.destroy()},cesiumProps:mo$1,cesiumReadonlyProps:fo$1,otherProps:ho$2,useCommonEvent:!0});const po$1=["appearance","classificationType","debugShowBoundingVolume","debugShowShadowVolume","show"],vo$2=["allowPicking","asynchronous","compressVertices","geometryInstances","interleave","releaseGeometryInstances","vertexCacheOptimize"],go$1=["onReady"];l({name:"GroundPrimitive",create(t,n){var o;if(!t.primitiveCollection)return;const s=new Cesium$1.GroundPrimitive(n);if(n.onReady){const c=()=>{var d,h;s.ready&&((d=n.onReady)==null||d.call(n,s),(h=t.scene)==null||h.postRender.removeEventListener(c))};(o=t.scene)==null||o.postRender.addEventListener(c)}return t.primitiveCollection.add(s),s},destroy(t,n){n.primitiveCollection&&!n.primitiveCollection.isDestroyed()&&n.primitiveCollection.remove(t),t.isDestroyed()||t.destroy()},cesiumProps:po$1,cesiumReadonlyProps:vo$2,otherProps:go$1,useCommonEvent:!0});const Po$1=["show","destroyPrimitives","primitiveAdded","primitiveRemoved"];l({name:"GroundPrimitiveCollection",create:t=>{var n;return(n=t.scene)==null?void 0:n.groundPrimitives},provide:t=>({primitiveCollection:t}),cesiumProps:Po$1,setCesiumPropsAfterCreate:!0});const Eo$1=["alpha","brightness","contrast","hue","saturation","gamma","splitDirection","minificationFilter","magnificationFilter","cutoutRectangle","show","nightAlpha","dayAlpha","colorToAlpha","colorToAlphaThreshold","index"],bo$1=["rectangle","maximumAnisotropy","minimumTerrainLevel","maximumTerrainLevel","readyEvent","imageryProvider"],wo$1=l({name:"ImageryLayer",async create(t,n){var o,s,c,d;if(!t.imageryLayerCollection)return;const h=J(n.imageryProvider)?n.imageryProvider:new Promise(L=>queueMicrotask(()=>L(n.imageryProvider))),p=(s=(o=t.__$internal)==null?void 0:o.imageryLayerWaitingList)==null?void 0:s.slice();(c=t.__$internal)!=null&&c.imageryLayerWaitingList&&t.__$internal.imageryLayerWaitingList.push(h),p&&await Promise.all(p.filter(L=>J(L)));const y=await h;if((d=t.__$internal)!=null&&d.imageryLayerWaitingList&&(t.__$internal.imageryLayerWaitingList=t.__$internal.imageryLayerWaitingList.filter(L=>L!==h)),!y)return;const E=new Cesium$1.ImageryLayer(y,n);return t.imageryLayerCollection.add(E,n.index),E},destroy(t,n){n.imageryLayerCollection&&n.imageryLayerCollection.remove(t)},cesiumProps:Eo$1,cesiumReadonlyProps:bo$1}),Ns$1=wo$1,Do$1={onLayerAdd:"layerAdded",onLayerMove:"layerMoved",onLayerRemove:"layerRemoved",onLayerShowOrHide:"layerShownOrHidden"};l({name:"ImageryLayerCollection",create:t=>{var n;return(n=t.globe)==null?void 0:n.imageryLayers},cesiumEventProps:Do$1});const $o$1=["clustering","name","show"],To$1=["canvas","camera","ellipsoid","clampToGround","sourceUri","credit","screenOverlayContainer"],Mo$1={onChange:"changedEvent",onError:"errorEvent",onLoading:"loadingEvent",onRefresh:"refreshEvent",onUnsupportedNode:"unsupportedNodeEvent"},ko$1=["onLoad","data"],li$1=(t,{data:n,onLoad:o,...s})=>{n&&t.load(n,s).then(c=>{o&&o(c)})},Lo$1=l({name:"KmlDataSource",create(t,n){if(!t.scene||!t.dataSourceCollection||!t.scene)return;const o=new Cesium$1.KmlDataSource({camera:n.camera||t.scene.camera,canvas:n.canvas||t.scene.canvas,ellipsoid:n.ellipsoid,credit:n.credit});return n.clustering&&(o.clustering=n.clustering),typeof n.show=="boolean"&&(o.show=n.show),typeof n.name<"u"&&(o.name=n.name),t.dataSourceCollection.add(o),n.data&&li$1(o,n),o},update(t,n,o){n.data?o.show!==n.show&&(t.show=typeof n.show=="boolean"?n.show:!0):t.show=!1,n.data&&(o.data!==n.data||o.clampToGround!==n.clampToGround||o.ellipsoid!==n.ellipsoid||o.sourceUri!==n.sourceUri||o.credit!==n.credit)&&li$1(t,n)},destroy(t,n){n.dataSourceCollection&&!n.dataSourceCollection.isDestroyed()&&n.dataSourceCollection.remove(t)},provide(t){return{dataSource:t}},cesiumProps:$o$1,cesiumReadonlyProps:To$1,cesiumEventProps:Mo$1,otherProps:ko$1,useCommonEvent:!0}),Ys$1=Lo$1,_o$1=["backgroundColor","backgroundPadding","disableDepthTestDistance","distanceDisplayCondition","eyeOffset","fillColor","font","heightReference","horizontalOrigin","id","outlineColor","outlineWidth","pixelOffset","pixelOffsetScaleByDistance","position","scale","scaleByDistance","show","showBackground","style","text","translucencyByDistance","verticalOrigin"];l({name:"Label",create:(t,n)=>{var o;return(o=t.labelCollection)==null?void 0:o.add(n)},destroy(t,n){n.labelCollection&&!n.labelCollection.isDestroyed()&&n.labelCollection.remove(t)},cesiumProps:_o$1,useCommonEvent:!0});const Go$1=["blendOption","debugShowBoundingVolume","modelMatrix","show"];l({name:"LabelCollection",create(t,n){if(!t.scene||!t.primitiveCollection)return;const o=new Cesium$1.LabelCollection({scene:t.scene,modelMatrix:n.modelMatrix,blendOption:n.blendOption,debugShowBoundingVolume:n.debugShowBoundingVolume});return t.primitiveCollection.add(o),o},destroy(t,n){n.primitiveCollection&&!n.primitiveCollection.isDestroyed()&&n.primitiveCollection.remove(t),t.isDestroyed()||t.destroy()},provide(t){return{labelCollection:t}},cesiumProps:Go$1});const Ao$1=["text","font","style","fillColor","outlineColor","outlineWidth","show","showBackground","backgroundColor","backgroundPadding","scale","horizontalOrigin","verticalOrigin","eyeOffset","pixelOffset","translucencyByDistance","pixelOffsetScaleByDistance","scaleByDistance","heightReference","distanceDisplayCondition","disableDepthTestDistance"],Fo$1={onDefinitionChange:"definitionChanged"},Io$1=l({name:"LabelGraphics",create(t,n){if(!t.entity)return;const o=new Cesium$1.LabelGraphics(n);return t.entity.label=o,o},destroy(t,n){n.entity&&(n.entity.label=void 0)},cesiumProps:Ao$1,cesiumEventProps:Fo$1}),Zs=Io$1,Wo$1=["backFaceCulling","clampAnimations","clippingPlanes","color","colorBlendAmount","colorBlendMode","customShader","debugShowBoundingVolume","debugWireframe","distanceDisplayCondition","featureIdLabel","heightReference","id","imageBasedLighting","instanceFeatureIdLabel","lightColor","maximumScale","minimumPixelSize","modelMatrix","outlineColor","scale","shadows","show","showCreditsOnScreen","showOutline","silhouetteColor","silhouetteSize","splitDirection","style"],Vo$1=["allowPicking","asynchronous","basePath","credit","enableDebugWireframe","gltf","heightReference","incrementallyLoadTextures","scene","releaseGltfJson","cull","opaquePass","upAxis","forwardAxis","content","scene","enableShowOutline","projectTo2D","classificationType","errorEvent","readyEvent","texturesReadyEvent","gltfCallback","enablePick"],Uo$1=["onReady","onError","url"];l({name:"Model",async create(t,{scene:n,url:o,colorBlendMode:s,...c}){var d;if(!t.scene||!t.primitiveCollection||!o)return;const h=o;let p;J(h)?p=await h:p=h;let y;try{y=await Cesium$1.Model.fromGltfAsync({...c,url:p,colorBlendMode:s,scene:n||t.scene})}catch(E){(d=c.onError)==null||d.call(c,E);return}return t.primitiveCollection.add(y),y},destroy(t,n){n.primitiveCollection&&!n.primitiveCollection.isDestroyed()&&n.primitiveCollection.remove(t),t.isDestroyed()||t.destroy()},cesiumEventProps:{onReady:"readyEvent"},cesiumProps:Wo$1,cesiumReadonlyProps:Vo$1,otherProps:Uo$1,useCommonEvent:!0});const Ho$1=["uri","show","scale","minimumPixelSize","maximumScale","incrementallyLoadTextures","runAnimations","clampAnimations","nodeTransformations","shadows","heightReference","distanceDisplayCondition","silhouetteColor","silhouetteSize","color","colorBlendMode","colorBlendAmount","clippingPlanes","imageBasedLightingFactor","lightColor","articulations","customShader"],zo$1={onDefinitionChange:"definitionChanged"},xo$1=l({name:"ModelGraphics",create(t,n){if(!t.entity)return;const o=new Cesium$1.ModelGraphics(n);return t.entity.model=o,o},destroy(t,n){n.entity&&(n.entity.model=void 0)},cesiumProps:Ho$1,cesiumEventProps:zo$1}),Qs$1=xo$1,No$1=["onlySunLighting","show","textureUrl"],qo$1=["ellipsoid"],Yo$1=l({name:"Moon",create(t,n){if(!t.scene)return;const o=new Cesium$1.Moon(n);return t.scene.moon=o,o},destroy(t,n){n.scene&&!n.scene.isDestroyed()&&(n.scene.moon=new Cesium$1.Moon)},cesiumProps:No$1,cesiumReadonlyProps:qo$1}),ea$1=Yo$1,Ko$1=["show","emitter","modelMatrix","emitterModelMatrix","emissionRate","bursts","loop","startScale","endScale","startColor","endColor","image","imageSize","minimumImageSize","maximumImageSize","speed","minimumSpeed","maximumSpeed","lifetime","particleLife","minimumParticleLife","maximumParticleLife","mass","minimumMass","maximumMass","sizeInMeters"],Jo$1={onComplete:"complete",onUpdate:"updateCallback"};l({name:"ParticleSystem",create(t,n){if(!t.primitiveCollection)return;const o=new Cesium$1.ParticleSystem({...n,updateCallback:n.onUpdate});return t.primitiveCollection.add(o),o},update(t,n,o){n.onUpdate!==o.onUpdate&&(t.updateCallback=n.onUpdate)},destroy(t,n){n.primitiveCollection&&!n.primitiveCollection.isDestroyed()&&n.primitiveCollection.remove(t)},cesiumProps:Ko$1,cesiumEventProps:Jo$1});const Xo$1=["leadTime","trailTime","show","width","material","resolution","distanceDisplayCondition"],Qo$1={onDefinitionChange:"definitionChanged"};l({name:"PathGraphics",create(t,n){if(!t.entity)return;const o=new Cesium$1.PathGraphics(n);return t.entity.path=o,o},destroy(t,n){n.entity&&(n.entity.path=void 0)},cesiumProps:Xo$1,cesiumEventProps:Qo$1});const ir$1=["plane","dimensions","show","fill","material","outline","outlineColor","outlineWidth","shadows","distanceDisplayCondition"],tr$1={onDefinitionChange:"definitionChanged"},nr$1=l({name:"PlaneGraphics",create(t,n){if(!t.entity)return;const o=new Cesium$1.PlaneGraphics(n);return t.entity.plane=o,o},destroy(t,n){n.entity&&(n.entity.plane=void 0)},cesiumProps:ir$1,cesiumEventProps:tr$1}),na$1=nr$1,or$1=["color","pixelSize","outlineColor","outlineWidth","show","scaleByDistance","translucencyByDistance","heightReference","distanceDisplayCondition","disableDepthTestDistance"],rr$1={onDefinitionChange:"definitionChanged"},sr$1=l({name:"PointGraphics",create(t,n){if(!t.entity)return;const o=new Cesium$1.PointGraphics(n);return t.entity.point=o,o},destroy(t,n){n.entity&&(n.entity.point=void 0)},cesiumProps:or$1,cesiumEventProps:rr$1}),oa$1=sr$1,ar$1=["color","disableDepthTestDistance","distanceDisplayCondition","id","outlineColor","outlineWidth","pixelSize","position","scaleByDistance","show","translucencyByDistance"];l({name:"PointPrimitive",create:(t,n)=>{var o;return(o=t.pointPrimitiveCollection)==null?void 0:o.add(n)},destroy(t,n){n.pointPrimitiveCollection&&!n.pointPrimitiveCollection.isDestroyed()&&n.pointPrimitiveCollection.remove(t)},cesiumProps:ar$1,useCommonEvent:!0});const lr$1=["blendOption","debugShowBoundingVolume","modelMatrix","show"];l({name:"PointPrimitveCollection",create(t,n){if(!t.primitiveCollection)return;const o=new Cesium$1.PointPrimitiveCollection(n);return t.primitiveCollection.add(o),o},destroy(t,n){n.primitiveCollection&&!n.primitiveCollection.isDestroyed()&&n.primitiveCollection.remove(t),t.isDestroyed()||t.destroy()},provide(t){return{pointPrimitiveCollection:t}},cesiumProps:lr$1});const dr$1=["arcType","hierarchy","height","heightReference","extrudedHeight","extrudedHeightReference","show","fill","material","outline","outlineColor","outlineWidth","stRotation","granularity","perPositionHeight","closeTop","closeBottom","shadows","distanceDisplayCondition","zIndex","classificationType","textureCoordinates"],mr$1={onDefinitionChange:"definitionChanged"},fr$1=l({name:"PolygonGraphics",create(t,n){if(!t.entity)return;const o=new Cesium$1.PolygonGraphics(n);return t.entity.polygon=o,o},destroy(t,n){n.entity&&(n.entity.polygon=void 0)},cesiumProps:dr$1,cesiumEventProps:mr$1}),aa$1=fr$1,hr$1=["distanceDisplayCondition","id","loop","material","positions","show","width"];l({name:"Polyline",create:(t,n)=>{var o;return(o=t.polylineCollection)==null?void 0:o.add(n)},destroy(t,n){n.polylineCollection&&!n.polylineCollection.isDestroyed()&&n.polylineCollection.remove(t)},cesiumProps:hr$1,useCommonEvent:!0});const pr$1=["debugShowBoundingVolume","length","modelMatrix","show"];l({name:"PolylineCollection",create(t,n){if(!t.primitiveCollection)return;const o=new Cesium$1.PolylineCollection({modelMatrix:n.modelMatrix,debugShowBoundingVolume:n.debugShowBoundingVolume,length:n.length,scene:t.scene});return t.primitiveCollection.add(o),o},destroy(t,n){n.primitiveCollection&&!n.primitiveCollection.isDestroyed()&&n.primitiveCollection.remove(t),t.isDestroyed()||t.destroy()},provide(t){return{polylineCollection:t}},cesiumProps:pr$1});const gr$1=["arcType","classificationType","positions","clampToGround","width","show","material","depthFailMaterial","granularity","shadows","distanceDisplayCondition","zIndex"],Cr$1={onDefinitionChange:"definitionChanged"},Pr$1=l({name:"PolylineGraphics",create(t,n){if(!t.entity)return;const o=new Cesium$1.PolylineGraphics(n);return t.entity.polyline=o,o},destroy(t,n){n.entity&&(n.entity.polyline=void 0)},cesiumProps:gr$1,cesiumEventProps:Cr$1}),ua$1=Pr$1,Sr$1=["positions","shape","cornerType","show","fill","material","outline","outlineColor","outlineWidth","granularity","shadows","distanceDisplayCondition"],Er$1={onDefinitionChange:"definitionChanged"};l({name:"PolylineVolumeGraphics",create(t,n){if(!t.entity)return;const o=new Cesium$1.PolylineVolumeGraphics(n);return t.entity.polylineVolume=o,o},destroy(t,n){n.entity&&(n.entity.polylineVolume=void 0)},cesiumProps:Sr$1,cesiumEventProps:Er$1});const wr$1=["enabled","selected"],Dr$1=["clearColor","forcePowerOfTwo","fragmentShader","name","pixelDatatype","pixelFormat","sampleMode","scissorRectangle","textureScale","uniforms"];l({name:"PostProcessStage",create(t,n){if(!t.scene)return;const o=new Cesium$1.PostProcessStage(n);return typeof n.enabled=="boolean"&&(o.enabled=n.enabled),n.selected&&(o.selected=n.selected),t.scene.postProcessStages.add(o),o},destroy(t,n){n.scene&&!n.scene.isDestroyed()&&n.scene.postProcessStages.remove(t),t.isDestroyed()||t.destroy()},cesiumProps:wr$1,cesiumReadonlyProps:Dr$1}),U$1({name:"BlackAndWhiteStage",props:["gradations"],create:()=>Cesium$1.PostProcessStageLibrary.createBlackAndWhiteStage()}),U$1({name:"BrightnessStage",props:["brightness"],create:()=>Cesium$1.PostProcessStageLibrary.createBrightnessStage()}),U$1({name:"LensFlareStage",props:["dirtTexture","starTexture","intensity","distortion","ghostDispersal","haloWidth","earthRadius"],create:()=>Cesium$1.PostProcessStageLibrary.createLensFlareStage()}),U$1({name:"Fxaa",create:(t,n)=>n.fxaa,props:[]}),U$1({name:"NightVisionStage",props:[],create:()=>Cesium$1.PostProcessStageLibrary.createNightVisionStage()});const Rr$1=["enabled","selected"],$r$1=["inputPreviousStageTexture","name","stages","uniforms"];l({name:"PostProcessStageComposite",create(t,n){if(!t.scene)return;const o=new Cesium$1.PostProcessStageComposite(n);return typeof n.enabled=="boolean"&&(o.enabled=n.enabled),n.selected&&(o.selected=n.selected),t.scene.postProcessStages.add(o),o},destroy(t,n){n.scene&&!n.scene.isDestroyed()&&n.scene.postProcessStages.remove(t),t.isDestroyed()||t.destroy()},cesiumProps:Rr$1,cesiumReadonlyProps:$r$1}),U$1({name:"AmbientOcclusion",create:(t,n)=>n.ambientOcclusion,props:["ambientOcclusionOnly","bias","delta","frustumLength","intensity","lengthCap","sigma","stepSize"],noMount:!0}),U$1({name:"Bloom",create:(t,n)=>n.bloom,props:["brightness","contrast","delta","glowOnly","sigma","stepSize"],noMount:!0}),U$1({name:"BlurStage",props:["delta","sigma","stepSize"],create:()=>Cesium$1.PostProcessStageLibrary.createBlurStage()}),U$1({name:"DepthOfFieldStage",props:["delta","focalDistance","sigma","stepSize"],create:()=>Cesium$1.PostProcessStageLibrary.createDepthOfFieldStage()}),U$1({name:"EdgeDetectionStage",props:["color","length"],create:()=>Cesium$1.PostProcessStageLibrary.createEdgeDetectionStage()}),U$1({name:"SilhouetteStage",props:["color","length"],create:()=>Cesium$1.PostProcessStageLibrary.createSilhouetteStage()});const Tr$1=["appearance","cull","debugShowBoundingVolume","depthFailAppearance","modelMatrix","shadows","show"],Mr$1=["allowPicking","asynchronous","compressVertices","geometryInstances","interleave","releaseGeometryInstances","vertexCacheOptimize"],kr$1=["onReady"],Lr$1=l({name:"Primitive",create(t,n){var o;if(!t.primitiveCollection)return;const s=new Cesium$1.Primitive(n);if(n.onReady){const c=()=>{var d,h;s.ready&&((d=n.onReady)==null||d.call(n,s),(h=t.scene)==null||h.postRender.removeEventListener(c))};(o=t.scene)==null||o.postRender.addEventListener(c)}return t.primitiveCollection.add(s),s},destroy(t,n){n.primitiveCollection&&!n.primitiveCollection.isDestroyed()&&n.primitiveCollection.remove(t),t.isDestroyed()||t.destroy()},cesiumProps:Tr$1,cesiumReadonlyProps:Mr$1,otherProps:kr$1,useCommonEvent:!0}),Da$1=Lr$1,_r$1=["classificationType","coordinates","height","heightReference","extrudedHeight","extrudedHeightReference","show","fill","material","outline","outlineColor","outlineWidth","rotation","stRotation","granularity","shadows","distanceDisplayCondition","zIndex"],Or$1={onDefinitionChange:"definitionChanged"};l({name:"RectangleGraphics",create(t,n){if(!t.entity)return;const o=new Cesium$1.RectangleGraphics(n);return t.entity.rectangle=o,o},destroy(t,n){n.entity&&(n.entity.rectangle=void 0)},cesiumProps:_r$1,cesiumEventProps:Or$1});const Br$1=["backgroundColor","completeMorphOnUserInput","debugCommandFilter","debugShowCommands","debugShowDepthFrustum","debugShowFramesPerSecond","debugShowFrustumPlanes","debugShowFrustums","eyeSeparation","farToNearRatio","focalLength","fog","gamma","globe","highDynamicRange","invertClassification","invertClassificationColor","light","logarithmicDepthBuffer","logarithmicDepthFarToNearRatio","maximumRenderTimeChange","minimumDisableDepthTestDistance","moon","morphTime","nearToFarDistance2D","pickTranslucentDepth","requestRenderMode","rethrowRenderErrors","shadowMap","skyAtmosphere","skyBox","specularEnvironmentMaps","sphericalHarmonicCoefficients","sun","sunBloom","terrainProvider","useDepthPicking","useWebVR","postProcessStages","msaaSamples","splitPosition","debugCommandFilter","verticalExaggeration","verticalExaggerationRelativeHeight","atmosphere"],Ar$1={onMorphComplete:"morphComplete",onMorphStart:"morphStart",onPostRender:"postRender",onPreRender:"preRender",onPreUpdate:"preUpdate",onPostUpdate:"postUpdate",onRenderError:"renderError",onTerrainProviderChange:"terrainProviderChanged"},Fr$1=["mode","morphDuration"],ui=(t,n,o)=>{switch(n){case Cesium$1.SceneMode.SCENE2D:t.morphTo2D(o);break;case Cesium$1.SceneMode.COLUMBUS_VIEW:t.morphToColumbusView(o);break;case Cesium$1.SceneMode.SCENE3D:t.morphTo3D(o);break}},Ir$1=l({name:"Scene",create(t,n){return t.scene&&n.mode&&ui(t.scene,n.mode,n.morphDuration),t.scene},update(t,n,o){n.mode!==o.mode&&n.mode&&ui(t,n.mode,n.morphDuration)},cesiumProps:Br$1,cesiumEventProps:Ar$1,otherProps:Fr$1,setCesiumPropsAfterCreate:!0}),$a$1=Ir$1,Wr$1=["bounceAnimationTime","enableCollisionDetection","enableInputs","enableLook","enableRotate","enableTilt","enableTranslate","enableZoom","inertiaSpin","inertiaTranslate","inertiaZoom","lookEventTypes","maximumMovementRatio","maximumZoomDistance","minimumCollisionTerrainHeight","minimumPickingTerrainHeight","minimumTrackBallHeight","minimumZoomDistance","rotateEventTypes","tiltEventTypes","translateEventTypes","zoomEventTypes","minimumPickingTerrainDistanceWithInertia"],Vr$1=l({name:"ScreenSpaceCameraController",create:t=>{var n;return(n=t.scene)==null?void 0:n.screenSpaceCameraController},cesiumProps:Wr$1,setCesiumPropsAfterCreate:!0}),Ta$1=Vr$1,Ur$1=({action:t,modifier:n,type:o})=>{const s=$e$1();return React.useEffect(()=>{if(!(!s.screenSpaceEventHandler||s.screenSpaceEventHandler.isDestroyed())){if(t)return s.screenSpaceEventHandler.setInputAction(t,o,n),()=>{!s.screenSpaceEventHandler||s.screenSpaceEventHandler.isDestroyed()||s.screenSpaceEventHandler.removeInputAction(o,n)};s.screenSpaceEventHandler.removeInputAction(o,n)}},[t,s.screenSpaceEventHandler,n,o]),null},Ma$1=Ur$1,jr$1=l({name:"ScreenSpaceEventHandler",create(t,n){var o;return n.useDefault?(o=t.cesiumWidget)==null?void 0:o.screenSpaceEventHandler:t.scene?new Cesium$1.ScreenSpaceEventHandler(t.scene.canvas):void 0},destroy(t){t.isDestroyed()||t.destroy()},provide(t){return{screenSpaceEventHandler:t}}}),ka$1=jr$1,Hr$1=["darkness","fadingEnabled","maximumDistance","enabled","normalOffset","softShadows","size"];l({name:"ShadowMap",create:t=>{var n;return(n=t.scene)==null?void 0:n.shadowMap},cesiumProps:Hr$1});const xr$1=["brightnessShift","hueShift","saturationShift","show","perFragmentAtmosphere","atmosphereLightIntensity","atmosphereRayleighCoefficient","atmosphereMieCoefficient","atmosphereRayleighScaleHeight","atmosphereMieScaleHeight","atmosphereMieAnisotropy"],Nr$1=l({name:"SkyAtmosphere",create:t=>{var n;return(n=t.scene)==null?void 0:n.skyAtmosphere},cesiumProps:xr$1,setCesiumPropsAfterCreate:!0}),_a$2=Nr$1,qr$1=["sources","show"],Yr$1=l({name:"SkyBox",create:t=>{var n;return(n=t.scene)==null?void 0:n.skyBox},cesiumProps:qr$1,setCesiumPropsAfterCreate:!0}),Oa$1=Yr$1,Kr$1=["glowFactor","show"],Jr$1=l({name:"Sun",create(t){if(!t.scene)return;const n=new Cesium$1.Sun;return t.scene.sun=n,n},destroy(t,n){n.scene&&!n.scene.isDestroyed()&&(n.scene.sun=new Cesium$1.Sun)},cesiumProps:Kr$1,setCesiumPropsAfterCreate:!0}),Ga$1=Jr$1,Zr$1=["clippingPlanes","maximumMemoryUsage","modelMatrix","shadows","show","style","intervals"],Xr$1=["clock","shading"],Qr$1=["onReady"],es$1={onFrameChange:"frameChanged"};l({name:"TimeDynamicPointCloud",create(t,n){var o;if(!t.cesiumWidget||!t.primitiveCollection||!((o=t.cesiumWidget)!=null&&o.clock))return;const s=new Cesium$1.TimeDynamicPointCloud({...n,clock:n.clock??t.cesiumWidget.clock});if(n.onReady){const c=()=>{var d;(d=n.onReady)==null||d.call(n,s),s.frameChanged.removeEventListener(c)};s.frameChanged.addEventListener(c)}return t.primitiveCollection.add(s),s},destroy(t,n){n.primitiveCollection&&!n.primitiveCollection.isDestroyed()&&n.primitiveCollection.remove(t),t.isDestroyed()||t.destroy()},cesiumProps:Zr$1,cesiumReadonlyProps:Xr$1,cesiumEventProps:es$1,otherProps:Qr$1,useCommonEvent:!0});const ts$1=["terrainShadows","clockTrackedDataSource","targetFrameRate","useDefaultRenderLoop","resolutionScale","allowDataSourcesToSuspendAnimation","trackedEntity","selectedEntity","shadows","useBrowserRecommendedResolution","creditDisplay"],ns$1=["baseLayer","animation","baseLayerPicker","fullscreenButton","vrButton","geocoder","homeButton","infoBox","sceneModePicker","selectionIndicator","timeline","navigationHelpButton","navigationInstructionsInitiallyVisible","scene3DOnly","shouldAnimate","clockViewModel","selectedImageryProviderViewModel","imageryProviderViewModels","selectedTerrainProviderViewModel","terrainProviderViewModels","skyBox","skyAtmosphere","fullscreenElement","showRenderLoopErrors","automaticallyTrackDataSourceClocks","contextOptions","sceneMode","mapProjection","globe","orderIndependentTranslucency","creditContainer","creditViewport","dataSources","mapMode2D","projectionPicker","requestRenderMode","maximumRenderTimeChange","depthPlaneEllipsoidOffset","msaaSamples","blurActiveElementOnCanvasFocus","terrain"],os$1={onSelectedEntityChange:"selectedEntityChanged",onTrackedEntityChange:"trackedEntityChanged"},rs$1=["className","id","style","full","containerProps","extend","terrainProvider"],ss$1=l({name:"Viewer",async create(t,{baseLayer:n,terrainProvider:o,...s},c){if(!c)return;let d;J(o)?d=await o:d=o;const h=new Cesium$1.Viewer(c,{...s,terrainProvider:d,baseLayer:n===!1?void 0:n});if(!h)return;n===!1&&h.imageryLayers.removeAll(),h&&s.extend&&(Array.isArray(s.extend)?s.extend.forEach(y=>{h.extend(y,{})}):h.extend(s.extend,{}));const p=new De$1(h.scene);return[h,p]},destroy(t,n,o,s){s&&!s.isDestroyed()&&s.destroy(),t.isDestroyed()||t.destroy()},provide(t,n,o,s){return{viewer:t,cesiumWidget:t.cesiumWidget,dataSourceCollection:t.dataSources,entityCollection:t.entities,scene:t.scene,camera:t.scene.camera,imageryLayerCollection:t.scene.globe.imageryLayers,primitiveCollection:t.scene.primitives,globe:t.scene.globe,__$internal:{onUpdate:o==null?void 0:o.onUpdate,imageryLayerWaitingList:[]},[ce$1]:s}},containerProps:({id:t,className:n,style:o,full:s,containerProps:c})=>({className:n,id:t,style:{...s?{position:"absolute",bottom:"0",left:"0",right:"0",top:"0"}:{},...o},...c}),cesiumProps:ts$1,cesiumReadonlyProps:ns$1,cesiumEventProps:os$1,otherProps:rs$1,renderContainer:!0,useCommonEvent:!0,useRootEvent:!0}),Aa$1=ss$1,as$1=["positions","maximumHeights","minimumHeights","show","fill","material","outline","outlineColor","outlineWidth","granularity","shadows","distanceDisplayCondition"],cs$1={onDefinitionChange:"definitionChanged"};l({name:"WallGraphics",create(t,n){if(!t.entity)return;const o=new Cesium$1.WallGraphics(n);return t.entity.wall=o,o},destroy(t,n){n.entity&&(n.entity.wall=void 0)},cesiumProps:as$1,cesiumEventProps:cs$1});const Cluster=({property:t,children:n})=>{const{clusterPixelRange:o=15,clusterMinSize:s=3,clusterLabelTypography:c={fontFamily:"sans-serif",fontSize:30,fontWeight:400,color:"#FFF",textAlign:"center",bold:!1,italic:!1,underline:!1},clusterImage:d,clusterImageWidth:h,clusterImageHeight:p}=(t==null?void 0:t.default)??{},y=React.useMemo(()=>new Cesium$1.EntityCluster({enabled:!0,pixelRange:15,minimumClusterSize:2,clusterBillboards:!0,clusterLabels:!0,clusterPoints:!0}),[]);return React.useEffect(()=>{const E=React.Children.count(n)<s,L=y==null?void 0:y.clusterEvent.addEventListener((F,N)=>{N.label.font=toCSSFont(c,{fontSize:30}),N.label.horizontalOrigin=c.textAlign==="right"?Cesium$1.HorizontalOrigin.LEFT:c.textAlign==="left"?Cesium$1.HorizontalOrigin.RIGHT:Cesium$1.HorizontalOrigin.CENTER,N.label.verticalOrigin=Cesium$1.VerticalOrigin.CENTER,N.label.fillColor=Cesium$1.Color.fromCssColorString(c.color??"#FFF"),N.label.eyeOffset=new Cesium$1.Cartesian3(0,0,-5),N.billboard.show=!0,N.billboard.image=d,N.billboard.height=p,N.billboard.width=h,y.minimumClusterSize=E?React.Children.count(n):s});return y.enabled=!E,y.pixelRange=0,y.pixelRange=o,()=>{L()}},[s,o,c,d,p,h,n,y]),y?jsxRuntimeExports.jsx(Os$1,{show:!0,clustering:y,children:n}):null};function ReearthClock({timelineManagerRef:t}){var oe,W;const{start:n,stop:o,current:s}=((oe=t==null?void 0:t.current)==null?void 0:oe.computedTimeline)??{},{animation:c,stepType:d,rangeType:h,multiplier:p}=((W=t==null?void 0:t.current)==null?void 0:W.options)??{},y=React.useMemo(()=>n?Cesium$1.JulianDate.fromDate(n):void 0,[n]),E=React.useMemo(()=>o?Cesium$1.JulianDate.fromDate(o):void 0,[o]),L=React.useMemo(()=>s?Cesium$1.JulianDate.fromDate(s):void 0,[s]),F=d==="fixed"?Cesium$1.ClockStep.TICK_DEPENDENT:Cesium$1.ClockStep.SYSTEM_CLOCK_MULTIPLIER,N=p??1,z=React.useCallback(nt=>{var yt,Ai;const lt=Cesium$1.JulianDate.toDate(nt.startTime),Ee=Cesium$1.JulianDate.toDate(nt.stopTime);(Ai=(yt=t==null?void 0:t.current)==null?void 0:yt.handleTick)==null||Ai.call(yt,Cesium$1.JulianDate.toDate(nt.currentTime),{start:lt,stop:Ee})},[t]);return jsxRuntimeExports.jsx(Ms$1,{shouldAnimate:c,canAnimate:c,startTime:y,stopTime:E,currentTime:L,clockStep:F,multiplier:N,clockRange:h?rangeTypes[h]:void 0,onTick:z})}const rangeTypes={unbounded:Cesium$1.ClockRange.UNBOUNDED,clamped:Cesium$1.ClockRange.CLAMPED,bounced:Cesium$1.ClockRange.LOOP_STOP},DEFAULT_SCREEN_SPACE_CAMERA_ASSIGNMENTS={translateEventTypes:Cesium$1.CameraEventType.LEFT_DRAG,zoomEventTypes:[Cesium$1.CameraEventType.RIGHT_DRAG,Cesium$1.CameraEventType.WHEEL,Cesium$1.CameraEventType.PINCH],rotateEventTypes:Cesium$1.CameraEventType.LEFT_DRAG,tiltEventTypes:[Cesium$1.CameraEventType.MIDDLE_DRAG,Cesium$1.CameraEventType.PINCH,{eventType:Cesium$1.CameraEventType.LEFT_DRAG,modifier:Cesium$1.KeyboardEventModifier.CTRL},{eventType:Cesium$1.CameraEventType.RIGHT_DRAG,modifier:Cesium$1.KeyboardEventModifier.CTRL}],lookEventTypes:[{eventType:Cesium$1.CameraEventType.LEFT_DRAG,modifier:Cesium$1.KeyboardEventModifier.SHIFT}]},layerIdField="__reearth_layer_id",defaultImageSize=50,drawIcon=(t,n,o,s,c="none",d=!1,h="rgba(0, 0, 0, 0.7)",p=3,y=0,E=0)=>{const L=t.getContext("2d");!n||!L||(L.save(),t.width=o+p,t.height=s+p,L.shadowBlur=p,L.shadowOffsetX=y,L.shadowOffsetY=E,L.globalCompositeOperation="source-over",L.clearRect(0,0,t.width,t.height),L.drawImage(n,(t.width-o)/2,(t.height-s)/2,o,s),c==="circle"?(L.fillStyle="black",L.globalCompositeOperation="destination-in",L.arc(o/2,s/2,Math.min(o,s)/2,0,2*Math.PI),L.fill(),d&&(L.shadowColor=h,L.globalCompositeOperation="destination-over",L.fillStyle="black",L.arc(o/2,s/2,Math.min(o,s)/2,0,2*Math.PI),L.fill())):d&&(L.shadowColor=h,L.globalCompositeOperation="destination-over",L.fillStyle="black",L.rect((t.width-o)/2,(t.height-s)/2,o,s),L.fill()),L.restore())},useIcon=({image:t,imageSize:n,crop:o,shadow:s,shadowColor:c,shadowBlur:d,shadowOffsetX:h,shadowOffsetY:p})=>{const y=useImage(t),E=y?typeof n=="number"?Math.floor(y.width*n):Math.min(defaultImageSize,y.width):0,L=y?Math.floor(typeof n=="number"?y.height*n:E/y.width*y.height):0,F=React.useCallback(z=>drawIcon(z,y,E,L,o,s,c,d,h,p),[o,L,y,s,d,c,h,p,E]);return[useCanvas(F),E,L]},ho$1=t=>({left:Cesium$1.HorizontalOrigin.LEFT,center:Cesium$1.HorizontalOrigin.CENTER,right:Cesium$1.HorizontalOrigin.RIGHT,"":void 0})[t||""],vo$1=t=>({top:Cesium$1.VerticalOrigin.TOP,center:Cesium$1.VerticalOrigin.CENTER,baseline:Cesium$1.VerticalOrigin.BASELINE,bottom:Cesium$1.VerticalOrigin.BOTTOM,"":void 0})[t||""],getLocationFromScreen=(t,n,o,s=!1)=>{if(!t)return;const c=t.camera,d=t.globe.ellipsoid;let h;if(s){const L=c.getPickRay(new Cesium$1.Cartesian2(n,o));L&&(h=t.globe.pick(L,t))}if(h||(h=c==null?void 0:c.pickEllipsoid(new Cesium$1.Cartesian2(n,o),d)),!h)return;const{latitude:p,longitude:y,height:E}=d.cartesianToCartographic(h);return{lat:Cesium$1.Math.toDegrees(p),lng:Cesium$1.Math.toDegrees(y),height:E}},getRayEllipsoidIntersection=(t,n,o)=>{const s=Cesium$1.IntersectionTests.rayEllipsoid(t,n);if(!s){const c=Cesium$1.IntersectionTests.grazingAltitudeLocation(t,n);return o?c.clone(o):c}return Cesium$1.Ray.getPoint(t,s.start,o)},createRayFromCamera=t=>{const n=new Cesium$1.Ray;return t.positionWC.clone(n.origin),t.directionWC.clone(n.direction),n},getCameraEllipsoidIntersection=(t,n,o)=>{let s;const{camera:c,globe:d}=t;if(n instanceof Cesium$1.Cartesian2){if(s=c.getPickRay(n,new Cesium$1.Ray),!s)return}else s=createRayFromCamera(c),o=n;return getRayEllipsoidIntersection(s,d.ellipsoid,o)},getCameraTerrainIntersection=t=>{const n=createRayFromCamera(t.camera);return t.globe.pick(n,t)},cartesianToLatLngHeight=(t,n)=>{const o=Cesium$1.Cartographic.fromCartesian(t,n.globe.ellipsoid);return{lng:Cesium$1.Math.toDegrees(o.longitude),lat:Cesium$1.Math.toDegrees(o.latitude),height:o.height}},flyTo=(t,n,o)=>{if(!t||!n)return()=>{};const s=animateFOV({fov:n.fov,camera:t,duration:o==null?void 0:o.duration,easing:o==null?void 0:o.easing}),c=typeof n.lat=="number"&&typeof n.lng=="number"&&typeof n.height=="number"?Cesium$1.Cartesian3.fromDegrees(n.lng,n.lat,n.height):void 0;return c&&t.flyTo({destination:c,orientation:{heading:n.heading,pitch:n.pitch,roll:n.roll},duration:(o==null?void 0:o.duration)??0,easingFunction:o==null?void 0:o.easing}),()=>{s==null||s(),t==null||t.cancelFlight()}},lookAt=(t,n,o)=>{if(!t||!n)return()=>{};const s=animateFOV({fov:n.fov,camera:t,duration:o==null?void 0:o.duration,easing:o==null?void 0:o.easing}),c=typeof n.lat=="number"&&typeof n.lng=="number"&&typeof n.height=="number"?Cesium$1.Cartesian3.fromDegrees(n.lng,n.lat,n.height):void 0;return c&&t.flyToBoundingSphere(new Cesium$1.BoundingSphere(c,n.radius),{offset:n.heading!==void 0||n.pitch!==void 0||n.range!==void 0?new Cesium$1.HeadingPitchRange(n.heading,n.pitch,n.range):void 0,duration:o==null?void 0:o.duration,easingFunction:o==null?void 0:o.easing}),()=>{s==null||s(),t==null||t.cancelFlight()}},lookAtWithoutAnimation=(t,n)=>{if(!n)return;const o=typeof n.lat=="number"&&typeof n.lng=="number"?Cesium$1.Cartesian3.fromDegrees(n.lng,n.lat,n.height):void 0;o&&t.camera.lookAtTransform(Cesium$1.Matrix4.fromTranslation(o))},animateFOV=({fov:t,camera:n,easing:o,duration:s})=>{if(typeof t=="number"&&n.frustum instanceof Cesium$1.PerspectiveFrustum&&typeof n.frustum.fov=="number"&&n.frustum.fov!==t){const c=n.frustum.fov;return tweenInterval(d=>{n.frustum instanceof Cesium$1.PerspectiveFrustum&&(n.frustum.fov=(t-c)*d+c)},o||"inOutCubic",(s??0)*1e3)}},getCenterCamera=({camera:t,scene:n})=>{const o=new Cesium$1.Cartesian3,s=t.getPickRay(t.positionWC);if(s)return s.origin=t.positionWC,s.direction=t.directionWC,n.globe.pick(s,n,o)},zoom=({viewer:t,relativeAmount:n},o)=>{const{camera:s,scene:c}=t;if(c.mode!==Cesium$1.SceneMode.SCENE3D){const N=getCamera(t);flyTo(s,{...N,height:((N==null?void 0:N.height)||1)*n},{duration:.5});return}const h=getCenterCamera({camera:s,scene:c})||Cesium$1.IntersectionTests.grazingAltitudeLocation(new Cesium$1.Ray(c.globe.ellipsoid.cartographicToCartesian(s.positionCartographic),s.directionWC),c.globe.ellipsoid);if(!h)return;const p={heading:s.heading,pitch:s.pitch,roll:s.roll},y=new Cesium$1.Cartesian3,E=Cesium$1.Cartesian3.subtract(s.position,h,y),L=Cesium$1.Cartesian3.multiplyByScalar(E,n,E),F=Cesium$1.Cartesian3.add(h,L,h);s.flyTo({destination:F,orientation:p,duration:(o==null?void 0:o.duration)||.5,convert:!1})},getCamera=t=>{if(!t||t.isDestroyed()||!t.camera||!t.scene)return;const{camera:n}=t;if(!(n.frustum instanceof Cesium$1.PerspectiveFrustum||n.frustum instanceof Cesium$1.OrthographicOffCenterFrustum))return;const{latitude:o,longitude:s,height:c}=n.positionCartographic,d=Cesium$1.Math.toDegrees(o),h=Cesium$1.Math.toDegrees(s),{heading:p,pitch:y,roll:E}=n,L=n.frustum instanceof Cesium$1.PerspectiveFrustum?n.frustum.fov:1,F=n.frustum instanceof Cesium$1.PerspectiveFrustum?n.frustum.aspectRatio:1;return{lng:h,lat:d,height:c,heading:p,pitch:y,roll:E,fov:L,aspectRatio:F}},getClock=t=>{if(t)return{get start(){return Cesium$1.JulianDate.toDate(t.startTime)},get stop(){return Cesium$1.JulianDate.toDate(t.stopTime)},get current(){return Cesium$1.JulianDate.toDate(t.currentTime)},get playing(){return t.shouldAnimate},get speed(){return t.multiplier}}},colorBlendMode=t=>({highlight:Cesium$1.ColorBlendMode.HIGHLIGHT,replace:Cesium$1.ColorBlendMode.REPLACE,mix:Cesium$1.ColorBlendMode.MIX})[t||""],colorBlendModeFor3DTile=t=>({highlight:Cesium$1.Cesium3DTileColorBlendMode.HIGHLIGHT,replace:Cesium$1.Cesium3DTileColorBlendMode.REPLACE,mix:Cesium$1.Cesium3DTileColorBlendMode.MIX})[t||""],heightReference=t=>({clamp:Cesium$1.HeightReference.CLAMP_TO_GROUND,relative:Cesium$1.HeightReference.RELATIVE_TO_GROUND,none:Cesium$1.HeightReference.NONE})[t||""],getOverriddenScreenSpaceCameraOptions=t=>{if(!t)return;const n=new Map([["left_drag",Cesium$1.CameraEventType.LEFT_DRAG],["right_drag",Cesium$1.CameraEventType.RIGHT_DRAG],["middle_drag",Cesium$1.CameraEventType.MIDDLE_DRAG],["wheel",Cesium$1.CameraEventType.WHEEL],["pinch",Cesium$1.CameraEventType.PINCH]]),o=new Map([["ctrl",Cesium$1.KeyboardEventModifier.CTRL],["shift",Cesium$1.KeyboardEventModifier.SHIFT],["alt",Cesium$1.KeyboardEventModifier.ALT]]),s=E=>{if(E)return E.map(L=>typeof L=="string"?n.get(L):{eventType:n.get(L.eventType),modifier:o.get(L.modifier)})},c=s(t.translateEventTypes),d=s(t.zoomEventTypes),h=s(t.rotateEventTypes),p=s(t.tiltEventTypes),y=s(t.lookEventTypes);return{...DEFAULT_SCREEN_SPACE_CAMERA_ASSIGNMENTS,...c&&{translateEventTypes:c},...d&&{zoomEventTypes:d},...h&&{rotateEventTypes:h},...p&&{tiltEventTypes:p},...y&&{lookEventTypes:y},...t.minimumZoomDistance!==void 0&&{minimumZoomDistance:t.minimumZoomDistance},...t.maximumZoomDistance!==void 0&&{maximumZoomDistance:t.maximumZoomDistance},...t.enableCollisionDetection!==void 0&&{enableCollisionDetection:t.enableCollisionDetection}}},classificationType=t=>({both:Cesium$1.ClassificationType.BOTH,"3dtiles":Cesium$1.ClassificationType.CESIUM_3D_TILE,terrain:Cesium$1.ClassificationType.TERRAIN})[t||""],shadowMode=t=>({enabled:Cesium$1.ShadowMode.ENABLED,cast_only:Cesium$1.ShadowMode.CAST_ONLY,receive_only:Cesium$1.ShadowMode.RECEIVE_ONLY,disabled:Cesium$1.ShadowMode.DISABLED})[t||""],unselectableTag="reearth_unselectable",draggableTag="reearth_draggable";function isSelectable(t){var n;return!((n=t==null?void 0:t.properties)!=null&&n.hasProperty(unselectableTag))}function isDraggable(t){var n;return(n=t.properties)==null?void 0:n[draggableTag]}function lookHorizontal(t,n){const o=t.camera,c=t.globe.ellipsoid.geodeticSurfaceNormal(o.position,new Cesium$1.Cartesian3);o.look(c,n)}function lookVertical(t,n){const o=t.camera,s=t.globe.ellipsoid,c=projectVectorToSurface(o.right,o.position,s),d=s.geodeticSurfaceNormal(o.position,new Cesium$1.Cartesian3),h=Cesium$1.Math.toDegrees(Cesium$1.Cartesian3.angleBetween(d,o.up)),p=rotateVectorAboutAxis(o.up,c,n),E=Cesium$1.Math.toDegrees(Cesium$1.Cartesian3.angleBetween(d,p))<h?1:(90-h)/90;o.look(c,n*E)}function moveForward(t,n){const o=projectVectorToSurface(t.camera.direction,t.camera.position,t.globe.ellipsoid);t.camera.move(o,n)}function moveBackward(t,n){const o=projectVectorToSurface(t.camera.direction,t.camera.position,t.globe.ellipsoid);t.camera.move(o,-n)}function moveUp(t,n){const o=t.globe.ellipsoid.geodeticSurfaceNormal(t.camera.position,new Cesium$1.Cartesian3);t.camera.move(o,n)}function moveDown(t,n){const o=t.globe.ellipsoid.geodeticSurfaceNormal(t.camera.position,new Cesium$1.Cartesian3);t.camera.move(o,-n)}function moveLeft(t,n){const o=projectVectorToSurface(t.camera.right,t.camera.position,t.globe.ellipsoid);t.camera.move(o,-n)}function moveRight(t,n){const o=projectVectorToSurface(t.camera.right,t.camera.position,t.globe.ellipsoid);t.camera.move(o,n)}async function moveOverTerrain(t,n=0){const o=getCamera(t);if((o==null?void 0:o.lng)===void 0||(o==null?void 0:o.lat)===void 0)return;const s=await sampleTerrainHeight(t.scene,o.lng,o.lat);if(s&&s!==0){const c=getCamera(t);c&&(c==null?void 0:c.height)<s+n&&t.scene.camera.moveUp(s+n-c.height)}}async function flyToGround(t,n,o,s,c=0){var p,y;if(o.lng===void 0||o.lat===void 0)return;const d=await sampleTerrainHeight(t.scene,o.lng,o.lat),h=d?d+c:c;(p=n.current)==null||p.call(n),n.current=flyTo((y=t.scene)==null?void 0:y.camera,{...getCamera(t),...o,height:h},s)}function projectVectorToSurface(t,n,o){const s=o.geodeticSurfaceNormal(n,new Cesium$1.Cartesian3),c=Cesium$1.Cartesian3.dot(t,s),d=Cesium$1.Cartesian3.multiplyByScalar(s,c,new Cesium$1.Cartesian3);return Cesium$1.Cartesian3.subtract(t,d,new Cesium$1.Cartesian3)}function rotateVectorAboutAxis(t,n,o){const s=Cesium$1.Quaternion.fromAxisAngle(n,-o,new Cesium$1.Quaternion),c=Cesium$1.Matrix3.fromQuaternion(s,new Cesium$1.Matrix3);return Cesium$1.Matrix3.multiplyByVector(c,t,t.clone())}async function sampleTerrainHeight(t,n,o){const s=t.terrainProvider;if(s instanceof Cesium$1.EllipsoidTerrainProvider)return 0;const[c]=await Cesium$1.sampleTerrainMostDetailed(s,[Cesium$1.Cartographic.fromDegrees(n,o)]);return c.height}async function sampleTerrainHeightFromCartesian(t,n){const o=Cesium$1.Cartographic.fromCartesian(n),[s,c]=[Cesium$1.Math.toDegrees((o==null?void 0:o.longitude)||0),Cesium$1.Math.toDegrees((o==null?void 0:o.latitude)||0)];if(!(!s||!c))return await sampleTerrainHeight(t,s,c)}const isColor=t=>t==null?void 0:t.match(/^#[A-Fa-f0-9]|^rgba?/),toColor$1=t=>{if(!t||typeof t!="string")return;const n=t.match(/^#([A-Fa-f0-9]{6})([A-Fa-f0-9]{2})$|^#([A-Fa-f0-9]{3})([A-Fa-f0-9])$/);if(!n)return Cesium$1.Color.fromCssColorString(t);const o=parseInt(n[4]?n[4].repeat(2):n[2],16)/255;return Cesium$1.Color.fromCssColorString(`#${n[1]??n[3]}`).withAlpha(o)},updateMapController=(t,n)=>{t.scene.screenSpaceCameraController.enableTranslate=n,t.scene.screenSpaceCameraController.enableRotate=n,t.scene.screenSpaceCameraController.enableLook=n,t.scene.screenSpaceCameraController.enableTilt=n,t.scene.screenSpaceCameraController.enableZoom=n};function getExtrudedHeight(t,n,o){const s=new Cesium$1.Cartesian3,c=new Cesium$1.Cartesian3,d=new Cesium$1.Ray,h=new Cesium$1.Plane(Cesium$1.Cartesian3.UNIT_X,0),p=new Cesium$1.Cartographic;let y;try{const E=t.globe.ellipsoid.geodeticSurfaceNormal(n,c),L=t.camera.getPickRay(o,d);if(L==null)return;const F=Cesium$1.Plane.fromPointNormal(n,Cesium$1.Cartesian3.normalize(Cesium$1.Cartesian3.cross(E,Cesium$1.Cartesian3.cross(E,L.direction,s),s),s),h);if(y=Cesium$1.IntersectionTests.rayPlane(L,F,s),y==null)return;const N=Cesium$1.Cartographic.fromCartesian(y,t.globe.ellipsoid,p).height,z=Cesium$1.Cartographic.fromCartesian(n,t.globe.ellipsoid,p).height;return Math.max(0,N-z)}catch(E){console.error(E)}}function Globe({property:t,cesiumIonAccessToken:n}){var d,h,p,y,E,L,F,N,z,oe,W,nt,lt,Ee,yt,Ai,zi,ha,ba,Sa,ya,ms;const o=React.useMemo(()=>({...t==null?void 0:t.terrain}),[t==null?void 0:t.terrain]),s=React.useMemo(()=>{var pi,mt,fa,Ra,sl,Zd,Xd,pu,gl;const Wc={terrain:o==null?void 0:o.enabled,terrainType:o==null?void 0:o.type,normal:o==null?void 0:o.normal,ionAccessToken:((fa=(mt=(pi=t==null?void 0:t.assets)==null?void 0:pi.cesium)==null?void 0:mt.terrain)==null?void 0:fa.ionAccessToken)||n,ionAsset:(Zd=(sl=(Ra=t==null?void 0:t.assets)==null?void 0:Ra.cesium)==null?void 0:sl.terrain)==null?void 0:Zd.ionAsset,ionUrl:(gl=(pu=(Xd=t==null?void 0:t.assets)==null?void 0:Xd.cesium)==null?void 0:pu.terrain)==null?void 0:gl.ionUrl},Wa=Wc.terrain?terrainProviders[Wc.terrainType||"cesium"]:void 0;return(typeof Wa=="function"?Wa(Wc):Wa)??defaultTerrainProvider},[o==null?void 0:o.enabled,o==null?void 0:o.type,o==null?void 0:o.normal,(p=(h=(d=t==null?void 0:t.assets)==null?void 0:d.cesium)==null?void 0:h.terrain)==null?void 0:p.ionAccessToken,(L=(E=(y=t==null?void 0:t.assets)==null?void 0:y.cesium)==null?void 0:E.terrain)==null?void 0:L.ionAsset,(z=(N=(F=t==null?void 0:t.assets)==null?void 0:F.cesium)==null?void 0:N.terrain)==null?void 0:z.ionUrl,n]),c=React.useMemo(()=>{var Wc;return toColor$1((Wc=t==null?void 0:t.globe)==null?void 0:Wc.baseColor)},[(oe=t==null?void 0:t.globe)==null?void 0:oe.baseColor]);return jsxRuntimeExports.jsx(js$1,{baseColor:c,enableLighting:!!((W=t==null?void 0:t.globe)!=null&&W.enableLighting),showGroundAtmosphere:((lt=(nt=t==null?void 0:t.globe)==null?void 0:nt.atmosphere)==null?void 0:lt.enabled)??!0,atmosphereLightIntensity:(yt=(Ee=t==null?void 0:t.globe)==null?void 0:Ee.atmosphere)==null?void 0:yt.lightIntensity,atmosphereSaturationShift:(zi=(Ai=t==null?void 0:t.globe)==null?void 0:Ai.atmosphere)==null?void 0:zi.saturationShift,atmosphereHueShift:(ba=(ha=t==null?void 0:t.globe)==null?void 0:ha.atmosphere)==null?void 0:ba.hueShift,atmosphereBrightnessShift:(ya=(Sa=t==null?void 0:t.globe)==null?void 0:Sa.atmosphere)==null?void 0:ya.brightnessShift,terrainProvider:s,depthTestAgainstTerrain:!!((ms=t==null?void 0:t.globe)!=null&&ms.depthTestAgainstTerrain)})}const defaultTerrainProvider=new Cesium$1.EllipsoidTerrainProvider,terrainProviders={cesium:({ionAccessToken:t,normal:n})=>Cesium$1.CesiumTerrainProvider.fromUrl(Cesium$1.IonResource.fromAssetId(1,{accessToken:t}),{requestVertexNormals:n,requestWaterMask:!1}),arcgis:()=>Cesium$1.ArcGISTiledElevationTerrainProvider.fromUrl("https://elevation3d.arcgis.com/arcgis/rest/services/WorldElevation3D/Terrain3D/ImageServer"),cesiumion:({ionAccessToken:t,ionAsset:n,ionUrl:o,normal:s})=>n?Cesium$1.CesiumTerrainProvider.fromUrl(o||Cesium$1.IonResource.fromAssetId(parseInt(n,10),{accessToken:t}),{requestVertexNormals:s}):null};function defined(t){return t!=null}function DeveloperError(t){this.name="DeveloperError",this.message=t;let n;try{throw new Error}catch(o){n=o.stack}this.stack=n}defined(Object.create)&&(DeveloperError.prototype=Object.create(Error.prototype),DeveloperError.prototype.constructor=DeveloperError),DeveloperError.prototype.toString=function(){let t=`${this.name}: ${this.message}`;return defined(this.stack)&&(t+=`
|
|
124
|
+
Check the top-level render call using <`+df+">.")}return lf}}function jm(yu,lf){{if(!yu._store||yu._store.validated||yu.key!=null)return;yu._store.validated=!0;var df=$m(lf);if(Uf[df])return;Uf[df]=!0;var _f="";yu&&yu._owner&&yu._owner!==vm.current&&(_f=" It was passed a child from "+pi(yu._owner.type)+"."),Sf(yu),Ee('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.',df,_f),Sf(null)}}function ip(yu,lf){{if(typeof yu!="object")return;if(cf(yu))for(var df=0;df<yu.length;df++){var _f=yu[df];Nf(_f)&&jm(_f,lf)}else if(Nf(yu))yu._store&&(yu._store.validated=!0);else if(yu){var Df=nt(yu);if(typeof Df=="function"&&Df!==yu.entries)for(var Ff=Df.call(yu),Af;!(Af=Ff.next()).done;)Nf(Af.value)&&jm(Af.value,lf)}}}function rp(yu){{var lf=yu.type;if(lf==null||typeof lf=="string")return;var df;if(typeof lf=="function")df=lf.propTypes;else if(typeof lf=="object"&&(lf.$$typeof===y||lf.$$typeof===F))df=lf.propTypes;else return;if(df){var _f=pi(lf);ff(df,yu.props,"prop",_f,yu)}else if(lf.PropTypes!==void 0&&!Gf){Gf=!0;var Df=pi(lf);Ee("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",Df||"Unknown")}typeof lf.getDefaultProps=="function"&&!lf.getDefaultProps.isReactClassApproved&&Ee("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.")}}function ep(yu){{for(var lf=Object.keys(yu.props),df=0;df<lf.length;df++){var _f=lf[df];if(_f!=="children"&&_f!=="key"){Sf(yu),Ee("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",_f),Sf(null);break}}yu.ref!==null&&(Sf(yu),Ee("Invalid attribute `ref` supplied to `React.Fragment`."),Sf(null))}}function Qm(yu,lf,df,_f,Df,Ff){{var Af=ms(yu);if(!Af){var If="";(yu===void 0||typeof yu=="object"&&yu!==null&&Object.keys(yu).length===0)&&(If+=" You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");var Pm=Kf();Pm?If+=Pm:If+=qf();var Wf;yu===null?Wf="null":cf(yu)?Wf="array":yu!==void 0&&yu.$$typeof===n?(Wf="<"+(pi(yu.type)||"Unknown")+" />",If=" Did you accidentally export a JSX literal instead of a component?"):Wf=typeof yu,Ee("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",Wf,If)}var Hf=Am(yu,lf,df,Df,Ff);if(Hf==null)return Hf;if(Af){var Dm=lf.children;if(Dm!==void 0)if(_f)if(cf(Dm)){for(var vp=0;vp<Dm.length;vp++)ip(Dm[vp],yu);Object.freeze&&Object.freeze(Dm)}else Ee("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else ip(Dm,yu)}return yu===s?ep(Hf):rp(Hf),Hf}}function tp(yu,lf,df){return Qm(yu,lf,df,!0)}function op(yu,lf,df){return Qm(yu,lf,df,!1)}var yp=op,mp=tp;pe$1.Fragment=s,pe$1.jsx=yp,pe$1.jsxs=mp}()),pe$1}process.env.NODE_ENV==="production"?Ae$1.exports=Ot$1():Ae$1.exports=Gt$1();var H=Ae$1.exports;function Bt$1(t,n){return n?Fe$1(t).reduce((o,[s,c])=>(ve$1(n,s)&&(o[s]=c),o),{}):{}}function Fe$1(t){return Object.keys(t).map(n=>[n,t[n]])}function ve$1(t,n){return!!t&&t.indexOf(n)!==-1}function At$1(t,n){return!!t&&!!n&&[...Object.keys(t),...Object.keys(n)].every(o=>t[o]===n[o])}function Ft$1(t){return t&&typeof t.isDestroyed=="function"&&typeof t.destroy=="function"}function It$1(t){return Ft$1(t)&&t.isDestroyed()}function J(t){return t&&typeof t=="object"&&"then"in t&&typeof t.then=="function"}const ce$1="__RESIUM_EVENT_MANAGER",Ie$1=["onClick","onDoubleClick","onMouseDown","onMouseUp","onMiddleClick","onMiddleDown","onMiddleUp","onMouseMove","onPinchEnd","onPinchMove","onPinchStart","onRightClick","onRightDown","onRightUp","onWheel","onMouseEnter","onMouseLeave"],Re$1=class rg{constructor(n){K$1(this,"scene"),K$1(this,"sshe"),K$1(this,"events",{onClick:new Map,onDoubleClick:new Map,onMouseDown:new Map,onMouseUp:new Map,onMiddleClick:new Map,onMiddleDown:new Map,onMiddleUp:new Map,onMouseMove:new Map,onPinchEnd:new Map,onPinchMove:new Map,onPinchStart:new Map,onRightClick:new Map,onRightDown:new Map,onRightUp:new Map,onWheel:new Map,onMouseEnter:new Map,onMouseLeave:new Map}),K$1(this,"hovered"),K$1(this,"onMouseMove",o=>{var s,c,d,h,p,y;const E=this.pick(o.endPosition);this.hovered!==E&&(this.hovered&&((s=this.getEventCallback("onMouseLeave",this.hovered))==null||s(o,this.hovered),(c=this.getEventCallback("onMouseLeave",null))==null||c(o,this.hovered)),E&&((d=this.getEventCallback("onMouseEnter",E))==null||d(o,E),(h=this.getEventCallback("onMouseEnter",null))==null||h(o,E))),E&&((p=this.getEventCallback("onMouseMove",E))==null||p(o,E)),(y=this.getEventCallback("onMouseMove",null))==null||y(o,E),this.hovered=E}),K$1(this,"eventCallback",o=>s=>{var c,d;const h=this.pick(s==null?void 0:s.position);h&&((c=this.getEventCallback(o,h))==null||c(s,h)),(d=this.getEventCallback(o,null))==null||d(s,h)}),this.scene=n,this.sshe=new Cesium$1.ScreenSpaceEventHandler(n==null?void 0:n.canvas)}destroy(){this.hovered=void 0,this.sshe.isDestroyed()||this.sshe.destroy()}isDestroyed(){return this.sshe.isDestroyed()}on(n,o,s){n&&o==="onWheel"||this.events[o].set(n,s)}off(n,o){this.events[o].delete(n),this.hovered===n&&(this.hovered=void 0)}setEvents(n,o){Fe$1(o).forEach(([s,c])=>{const d=s;ve$1(Ie$1,d)&&(c?this.on(n,d,c):this.off(n,d))}),this.commit()}clearEvents(n){this.hovered=void 0,Ie$1.forEach(o=>{this.off(n,o)}),this.commit()}commit(){const n=this.sshe,o=this.sshe.isDestroyed();o||(this.events.onMouseEnter.size===0&&this.events.onMouseLeave.size===0&&this.events.onMouseMove.size===0?this.sshe.removeInputAction(Cesium$1.ScreenSpaceEventType.MOUSE_MOVE):this.sshe.getInputAction(Cesium$1.ScreenSpaceEventType.MOUSE_MOVE)||this.sshe.setInputAction(this.onMouseMove,Cesium$1.ScreenSpaceEventType.MOUSE_MOVE)),Fe$1(this.events).forEach(([s,c])=>{if(s==="onMouseEnter"||s==="onMouseLeave"||s==="onMouseMove")return;const d=rg.eventTypeMap[s];o||(c.size===0?n.removeInputAction(d):n.getInputAction(d)||n.setInputAction(this.eventCallback(s),d))})}getScreenSpaceEventHandler(){return this.sshe}getEventCallback(n,o){var s,c;return o===null?this.events[n].get(null):this.events[n].get(o.id)||this.events[n].get((c=(s=o.id)==null?void 0:s.entityCollection)==null?void 0:c.owner)||this.events[n].get(o.primitive)||this.events[n].get(o.tileset)}pick(n){var o;if(n)return(o=this.scene)==null?void 0:o.pick(n)}};K$1(Re$1,"eventTypeMap",{onClick:Cesium$1.ScreenSpaceEventType.LEFT_CLICK,onDoubleClick:Cesium$1.ScreenSpaceEventType.LEFT_DOUBLE_CLICK,onMouseDown:Cesium$1.ScreenSpaceEventType.LEFT_DOWN,onMouseUp:Cesium$1.ScreenSpaceEventType.LEFT_UP,onMiddleClick:Cesium$1.ScreenSpaceEventType.MIDDLE_CLICK,onMiddleDown:Cesium$1.ScreenSpaceEventType.MIDDLE_DOWN,onMiddleUp:Cesium$1.ScreenSpaceEventType.MIDDLE_UP,onMouseMove:Cesium$1.ScreenSpaceEventType.MOUSE_MOVE,onPinchEnd:Cesium$1.ScreenSpaceEventType.PINCH_END,onPinchMove:Cesium$1.ScreenSpaceEventType.PINCH_MOVE,onPinchStart:Cesium$1.ScreenSpaceEventType.PINCH_START,onRightClick:Cesium$1.ScreenSpaceEventType.RIGHT_CLICK,onRightDown:Cesium$1.ScreenSpaceEventType.RIGHT_DOWN,onRightUp:Cesium$1.ScreenSpaceEventType.RIGHT_UP,onWheel:Cesium$1.ScreenSpaceEventType.WHEEL,onMouseEnter:Cesium$1.ScreenSpaceEventType.MOUSE_MOVE,onMouseLeave:Cesium$1.ScreenSpaceEventType.MOUSE_MOVE});let De$1=Re$1;const Wt$1=({name:t,create:n,destroy:o,provide:s,update:c,cesiumReadonlyProps:d,cesiumEventProps:h,otherProps:p,setCesiumPropsAfterCreate:y,useCommonEvent:E,useRootEvent:L},F,N)=>{const z=React.useRef(),oe=$e$1(),W=React.useRef(s?{}:void 0),nt=React.useRef({}),lt=React.useRef(si$1(F)),Ee=React.useRef({}),[yt,Ai]=React.useState(!1),zi=React.useRef(!1),ha=React.useRef(null),ba=React.useRef(),Sa=oe==null?void 0:oe[ce$1],ya=React.useRef(),ms=React.useRef(),Wc=React.useCallback(async fa=>{var Ra;if(!z.current)return;const sl=z.current,Zd=Object.keys(fa),Xd=Object.keys(h||[]),pu=Zd.concat(Object.keys(Ee.current).filter(ef=>!Zd.includes(ef))).filter(ef=>Ee.current[ef]!==fa[ef]).map(ef=>[ef,Ee.current[ef],fa[ef]]),gl=[];for(const[ef,nf,rf]of pu)if(d!=null&&d.includes(ef))gl.push(ef);else if(ve$1(Xd,ef)){const uf=h==null?void 0:h[ef],mf=sl[uf];mf instanceof Cesium$1.Event&&(typeof nf>"u"?(mf.addEventListener(rf),nt.current[uf]=rf):typeof rf>"u"?(mf.removeEventListener(nf),delete nt.current[uf]):(mf.removeEventListener(nf),mf.addEventListener(rf)))}else ef!=="children"&&!Ie$1.includes(ef)&&!(p!=null&&p.includes(ef))&&(sl[ef]=rf);const md=L?(Ra=W.current)==null?void 0:Ra[ce$1]:Sa;if(E&&md&&z.current&&md.setEvents(L?null:z.current,fa),c&&zi.current){const ef=c(z.current,fa,Ee.current,oe);J(ef)&&await ef}Ee.current=fa,lt.current=fa,zi.current&&gl.length>0&&(process.env.NODE_ENV!=="production"&&console.warn(`Warning: <${t}> is recreated because following read-only props have been updated: ${gl.join(", ")}`),pi(),await mt(),ya.current=Wa())},[]),Wa=React.useCallback(async()=>{var fa;await new Promise(Xd=>queueMicrotask(()=>Xd(void 0)));const Ra=n==null?void 0:n(oe,lt.current,ha.current);let sl;if(J(Ra)?sl=await Ra:sl=Ra,Array.isArray(sl)?(z.current=sl[0],ba.current=sl[1]):z.current=sl,y)await Wc(lt.current);else{if(z.current&&h){const Xd=z.current;for(const pu of Object.keys(lt.current)){const gl=h[pu];if(gl){const md=lt.current[pu],ef=Xd[gl];md&&ef instanceof Cesium$1.Event&&ef.addEventListener(md)}}}Ee.current=lt.current}s&&z.current&&(W.current={...oe,...s(z.current,oe,F,ba.current)});const Zd=L?(fa=W.current)==null?void 0:fa[ce$1]:Sa;E&&Zd&&z.current&&Zd.setEvents(L?null:z.current,lt.current),ms.current||Ai(!0)},[]),pi=React.useCallback(()=>{Ai(!1),zi.current=!1},[]),mt=React.useCallback(async()=>{var fa,Ra;await new Promise(Zd=>queueMicrotask(()=>Zd(void 0))),ya.current&&(await ya.current,ya.current=void 0),z.current&&o&&o(z.current,oe,ha.current,ba.current);const sl=L?(fa=W.current)==null?void 0:fa[ce$1]:Sa;if(E&&sl&&z.current&&sl.clearEvents(L?null:z.current),z.current&&!It$1(z.current)){const Zd=Object.keys(nt.current);for(const Xd of Zd){const pu=z.current[Xd];(Ra=pu==null?void 0:pu.removeEventListener)==null||Ra.call(pu,nt.current[Xd])}}nt.current={},W.current=void 0,ba.current=void 0,z.current=void 0},[]);return React.useLayoutEffect(()=>((async()=>(ms.current&&(await ms.current,ms.current=void 0),ya.current=Wa()))(),()=>{pi(),ms.current=mt()}),[Wa,mt,pi]),React.useEffect(()=>{(async()=>{var fa,Ra;ya.current&&await ya.current;const sl=si$1(F);yt?At$1(sl,Ee.current)||(await Wc(sl),(Ra=(fa=oe.__$internal)==null?void 0:fa.onUpdate)==null||Ra.call(fa)):(Ee.current=sl,lt.current=sl,zi.current=!0)})()},[oe.__$internal,yt,F,Wc]),React.useImperativeHandle(N,()=>({cesiumElement:yt?z.current:null}),[yt]),[W.current,yt,ha]};function si$1(t){const{children:n,...o}=t;return o}const l=({renderContainer:t,noChildren:n,containerProps:o,defaultProps:s,...c})=>{const d=(h,p)=>{const y={...s,...h},[E,L,F]=Wt$1(c,y,p);if(n)return null;const N=L&&"children"in y?y.children:null,z=t?H.jsx("div",{"data-testid":"resium-container",ref:F,...typeof o=="function"?o(y):Bt$1(y,o),children:N}):N?H.jsx(H.Fragment,{children:N}):null;return E?H.jsx(We$1.Provider,{value:E,children:z}):z};return d.displayName=c.name,React.forwardRef(d)},Vt$1=["enabled","selected"],U$1=t=>l({name:t.name,create(n,o){if(!n.scene)return;const s=t.create(o,n.scene.postProcessStages);return typeof o.enabled=="boolean"&&(s.enabled=o.enabled),o.selected&&"selected"in s&&(s.selected=o.selected),t.props.forEach(c=>{!ve$1(t.readonlyProps,c)&&typeof o[c]<"u"&&(s.uniforms[c]=o[c])}),!t.noMount&&n.scene&&!n.scene.isDestroyed()&&n.scene.postProcessStages.add(s),s},destroy(n,o){t.noMount?n.enabled=!1:(o.scene&&!o.scene.isDestroyed()&&o.scene.postProcessStages.remove(n),n.isDestroyed()||n.destroy())},update(n,o,s){t.props.forEach(c=>{!ve$1(t.readonlyProps,c)&&o[c]!==s[c]&&(n.uniforms[c]=o[c])})},cesiumProps:Vt$1,cesiumReadonlyProps:t.readonlyProps,defaultProps:{enabled:!0}}),Ut$1=["alignedAxis","color","disableDepthTestDistance","distanceDisplayCondition","eyeOffset","height","heightReference","horizontalOrigin","image","pixelOffset","pixelOffsetScaleByDistance","position","rotation","scale","scaleByDistance","show","sizeInMeters","translucencyByDistance","verticalOrigin","width","id"];l({name:"Billboard",create(t,n){var o;return(o=t.billboardCollection)==null?void 0:o.add(n)},destroy(t,n){n.billboardCollection&&!n.billboardCollection.isDestroyed()&&n.billboardCollection.remove(t)},cesiumProps:Ut$1,useCommonEvent:!0});const Ht=["blendOption","debugShowBoundingVolume","debugShowTextureAtlas","modelMatrix","show"];l({name:"BillboardCollection",create(t,n){if(!t.primitiveCollection)return;const o=new Cesium$1.BillboardCollection({modelMatrix:n.modelMatrix,debugShowBoundingVolume:n.debugShowBoundingVolume,scene:t.scene,blendOption:n.blendOption});return t.primitiveCollection.add(o),o},destroy(t,n){n.primitiveCollection&&!n.primitiveCollection.isDestroyed()&&n.primitiveCollection.remove(t),t.isDestroyed()||t.destroy()},provide(t){return{billboardCollection:t}},cesiumProps:Ht});const xt$1=["image","show","scale","horizontalOrigin","verticalOrigin","eyeOffset","pixelOffset","rotation","alignedAxis","width","height","color","scaleByDistance","translucencyByDistance","pixelOffsetScaleByDistance","imageSubRegion","sizeInMeters","heightReference","distanceDisplayCondition","disableDepthTestDistance"],Nt$1={onDefinitionChange:"definitionChanged"},qt$1=l({name:"BillboardGraphics",create(t,n){if(!t.entity)return;const o=new Cesium$1.BillboardGraphics(n);return t.entity.billboard=o,o},destroy(t,n){n.entity&&(n.entity.billboard=void 0)},cesiumProps:xt$1,cesiumEventProps:Nt$1}),gs$1=qt$1,Yt$1=["heightReference","dimensions","show","fill","material","outline","outlineColor","outlineWidth","shadows","distanceDisplayCondition"],Kt$1={onDefinitionChange:"definitionChanged"},Jt$1=l({name:"BoxGraphics",create(t,n){if(!t.entity)return;const o=new Cesium$1.BoxGraphics(n);return t.entity.box=o,o},destroy(t,n){n.entity&&(n.entity.box=void 0)},cesiumProps:Yt$1,cesiumEventProps:Kt$1}),Cs$1=Jt$1,Zt$1=["position","direction","up","right","frustum","defaultMoveAmount","defaultLookAmount","defaultRotateAmount","defaultZoomAmount","constrainedAxis","maximumZoomFactor","percentageChanged"],Xt$1={onChange:"changed",onMoveEnd:"moveEnd",onMoveStart:"moveStart"},Qt$1=l({name:"Camera",create:t=>{var n;return(n=t.scene)==null?void 0:n.camera},cesiumProps:Zt$1,cesiumEventProps:Xt$1,setCesiumPropsAfterCreate:!0}),Ps$1=Qt$1,rn$1=["show","modelMatrix","shadows","maximumScreenSpaceError","cullRequestsWhileMoving","cullRequestsWhileMovingMultiplier","preloadWhenHidden","preloadFlightDestinations","preferLeaves","progressiveResolutionHeightFraction","foveatedScreenSpaceError","foveatedConeSize","foveatedMinimumScreenSpaceErrorRelaxation","foveatedInterpolationCallback","foveatedTimeDelay","dynamicScreenSpaceError","dynamicScreenSpaceErrorDensity","dynamicScreenSpaceErrorFactor","dynamicScreenSpaceErrorHeightFalloff","skipLevelOfDetail","baseScreenSpaceError","skipScreenSpaceErrorFactor","skipLevels","immediatelyLoadDesiredLevelOfDetail","loadSiblings","clippingPlanes","classificationType","ellipsoid","lightColor","colorBlendAmount","colorBlendMode","debugFreezeFrame","debugColorizeTiles","debugWireframe","debugShowBoundingVolume","debugShowContentBoundingVolume","debugShowViewerRequestVolume","debugShowGeometricError","debugShowRenderingStatistics","debugShowMemoryUsage","debugShowUrl","style","backFaceCulling","vectorClassificationOnly","vectorKeepDecodedPositions","splitDirection","customShader","imageBasedLighting","showCreditsOnScreen","featureIdLabel","instanceFeatureIdLabel","imageBasedLighting","outlineColor","cacheBytes","maximumCacheOverflowBytes","enableCollision"],sn$1=["showOutline","cullWithChildrenBounds","debugHeatmapTilePropertyName","enableDebugWireframe","modelUpAxis","modelForwardAxis","projectTo2D","enableShowOutline","enablePick"],an$1={onAllTilesLoad:"allTilesLoaded",onInitialTilesLoad:"initialTilesLoaded",onLoadProgress:"loadProgress",onTileFailed:"tileFailed",onTileLoad:"tileLoad",onTileUnload:"tileUnload",onTileVisible:"tileVisible"},cn$1=["onReady","onError","url"],ln$1=l({name:"Cesium3DTileset",async create(t,n){var o,s;if(!t.primitiveCollection)return;const c=n.url;let d;J(c)?d=await c:d=c;let h;try{h=await Cesium$1.Cesium3DTileset.fromUrl(d,n),(o=n.onReady)==null||o.call(n,h)}catch(p){(s=n.onError)==null||s.call(n,p);return}return n.colorBlendAmount&&(h.colorBlendAmount=n.colorBlendAmount),n.colorBlendMode&&(h.colorBlendMode=n.colorBlendMode),n.style&&(h.style=n.style),t.primitiveCollection.add(h),h},destroy(t,n){n.primitiveCollection&&!n.primitiveCollection.isDestroyed()&&n.primitiveCollection.remove(t),t.isDestroyed()||t.destroy()},cesiumProps:rn$1,cesiumReadonlyProps:sn$1,cesiumEventProps:an$1,otherProps:cn$1,useCommonEvent:!0}),Ds$1=ln$1,un$1=["show","uri","maximumScreenSpaceError"],dn$1={onDefinitionChange:"definitionChanged"};l({name:"Cesium3DTilesetGraphics",create(t,n){if(!t.entity)return;const o=new Cesium$1.Cesium3DTilesetGraphics(n);return t.entity.tileset=o,o},destroy(t,n){n.entity&&(n.entity.tileset=void 0)},cesiumProps:un$1,cesiumEventProps:dn$1});const fn$1=["resolutionScale","useDefaultRenderLoop","targetFrameRate","useBrowserRecommendedResolution","creditDisplay"],hn$1=["clock","baseLayer","terrainProvider","skyBox","skyAtmosphere","sceneMode","scene3DOnly","orderIndependentTranslucency","mapMode2D","mapProjection","globe","showRenderLoopErrors","contextOptions","creditContainer","creditViewport","shadows","terrainShadows","terrain","requestRenderMode","maximumRenderTimeChange","msaaSamples","blurActiveElementOnCanvasFocus"],yn$1=["className","id","style","full","containerProps"];l({name:"CesiumWidget",create(t,n,o){if(!o)return;const s=new Cesium$1.CesiumWidget(o,n);if(!s)return;typeof n.resolutionScale=="number"&&(s.resolutionScale=n.resolutionScale);const c=new De$1(s.scene);return[s,c]},destroy(t,n,o,s){s&&!s.isDestroyed()&&s.destroy(),t.isDestroyed()||t.destroy()},provide(t,n,o,s){return{cesiumWidget:t,scene:t.scene,camera:t.scene.camera,imageryLayerCollection:t.scene.globe.imageryLayers,primitiveCollection:t.scene.primitives,globe:t.scene.globe,__$internal:{onUpdate:o==null?void 0:o.onUpdate},[ce$1]:s}},containerProps:({id:t,className:n,style:o,full:s,containerProps:c})=>({className:n,id:t,style:{...s?{position:"absolute",bottom:"0",left:"0",right:"0",top:"0"}:{},...o},...c}),cesiumProps:fn$1,cesiumReadonlyProps:hn$1,otherProps:yn$1,renderContainer:!0,useCommonEvent:!0,useRootEvent:!0});const vn$1=["classificationType","debugShowBoundingVolume","debugShowShadowVolume","show"],gn$1=["allowPicking","asynchronous","compressVertices","geometryInstances","interleave","releaseGeometryInstances","vertexCacheOptimize","appearance"],Cn$1=["onReady"];l({name:"ClassificationPrimitive",async create(t,n){var o;if(!t.primitiveCollection)return;const s=new Cesium$1.ClassificationPrimitive(n);if(n.onReady){const c=()=>{var d,h;s.ready&&((d=n.onReady)==null||d.call(n,s),(h=t.scene)==null||h.postRender.removeEventListener(c))};(o=t.scene)==null||o.postRender.addEventListener(c)}return t.primitiveCollection.add(s),s},destroy(t,n){n.primitiveCollection&&!n.primitiveCollection.isDestroyed()&&n.primitiveCollection.remove(t),t.isDestroyed()||t.destroy()},cesiumProps:vn$1,cesiumReadonlyProps:gn$1,otherProps:Cn$1,useCommonEvent:!0});const Sn$1={onStop:"onStop",onTick:"onTick"},En$1=["canAnimate","clockRange","clockStep","currentTime","multiplier","shouldAnimate","startTime","stopTime"],bn=l({name:"Clock",create:t=>{var n;return(n=t.cesiumWidget)==null?void 0:n.clock},cesiumProps:En$1,cesiumEventProps:Sn$1,setCesiumPropsAfterCreate:!0}),Ms$1=bn,wn$1=["noiseDetail","noiseOffset","show","debugBillboards","debugEllipsoids"];l({name:"CloudCollection",create:t=>{if(!t.primitiveCollection)return;const n=new Cesium$1.CloudCollection;return t.primitiveCollection.add(n),n},destroy(t,n){n.primitiveCollection&&!n.primitiveCollection.isDestroyed()&&n.primitiveCollection.remove(t),t.isDestroyed()||t.destroy()},provide:t=>({cloudCollection:t}),cesiumProps:wn$1,setCesiumPropsAfterCreate:!0});const Rn$1=["positions","width","cornerType","height","heightReference","extrudedHeight","extrudedHeightReference","show","fill","material","outline","outlineColor","outlineWidth","granularity","shadows","distanceDisplayCondition","zIndex","classificationType"],$n$1={onDefinitionChange:"definitionChanged"};l({name:"CorridorGraphics",create(t,n){if(!t.entity)return;const o=new Cesium$1.CorridorGraphics(n);return n.classificationType&&(o.classificationType=n.classificationType),t.entity.corridor=o,o},destroy(t,n){n.entity&&(n.entity.corridor=void 0)},cesiumProps:Rn$1,cesiumEventProps:$n$1});const Mn$1=["show","position","scale","maximumSize","slice","brightness","color"];l({name:"CumulusCloud",create:(t,n)=>{var o;return(o=t.cloudCollection)==null?void 0:o.add(n)},destroy(t,n){n.cloudCollection&&!n.cloudCollection.isDestroyed()&&n.cloudCollection.remove(t)},cesiumProps:Mn$1});const Ln$1=["clustering","name","show","clock","isLoading"],_n$1={onChange:"changedEvent",onError:"errorEvent",onLoading:"loadingEvent"},On$1=l({name:"CustomDataSource",create(t,n){if(!t.dataSourceCollection)return;const o=new Cesium$1.CustomDataSource(n.name);return n.clustering&&(o.clustering=n.clustering),typeof n.show=="boolean"&&(o.show=n.show),typeof n.clock<"u"&&(o.clock=n.clock),t.dataSourceCollection.add(o),o},destroy(t,n){n.dataSourceCollection&&!n.dataSourceCollection.isDestroyed()&&n.dataSourceCollection.remove(t)},provide(t){return{entityCollection:t.entities,dataSource:t}},cesiumProps:Ln$1,cesiumEventProps:_n$1,useCommonEvent:!0}),Os$1=On$1,Gn$1=["heightReference","length","topRadius","bottomRadius","show","fill","material","outline","outlineColor","outlineWidth","numberOfVerticalLines","slices","distanceDisplayCondition","shadows"],Bn$1={onDefinitionChange:"definitionChanged"};l({name:"CylinderGraphics",create(t,n){if(!t.entity)return;const o=new Cesium$1.CylinderGraphics(n);return t.entity.cylinder=o,o},destroy(t,n){n.entity&&(n.entity.cylinder=void 0)},cesiumProps:Gn$1,cesiumEventProps:Bn$1});const Fn$1=["clustering","show"],In$1=["name","sourceUri","credit"],Wn$1={onChange:"changedEvent",onError:"errorEvent",onLoading:"loadingEvent"},Vn$1=["onLoad","data"],ai=(t,{data:n,onLoad:o,...s})=>{n&&t.load(n,s).then(c=>{o&&o(c)})},Un$1=l({name:"CzmlDataSource",create(t,n){if(!t.dataSourceCollection)return;const o=new Cesium$1.CzmlDataSource(n.name);return n.clustering&&(o.clustering=n.clustering),typeof n.show=="boolean"&&(o.show=n.show),t.dataSourceCollection.add(o),n.data&&ai(o,n),o},update(t,n,o){n.data?o.show!==n.show&&(t.show=typeof n.show=="boolean"?n.show:!0):t.show=!1,n.data&&(o.data!==n.data||o.sourceUri!==n.sourceUri||o.credit!==n.credit)&&ai(t,n)},destroy(t,n){n.dataSourceCollection&&!n.dataSourceCollection.isDestroyed()&&n.dataSourceCollection.remove(t)},provide(t){return{dataSource:t}},cesiumProps:Fn$1,cesiumReadonlyProps:In$1,cesiumEventProps:Wn$1,otherProps:Vn$1,useCommonEvent:!0}),Bs$1=Un$1,jn$1=["semiMajorAxis","semiMinorAxis","height","heightReference","extrudedHeight","show","fill","material","outline","outlineColor","outlineWidth","numberOfVerticalLines","rotation","stRotation","granularity","shadows","distanceDisplayCondition","zIndex","classificationType","extrudedHeightReference"],Hn$1={onDefinitionChange:"definitionChanged"},zn$1=l({name:"EllipseGraphics",create(t,n){if(!t.entity)return;const o=new Cesium$1.EllipseGraphics(n);return t.entity.ellipse=o,o},destroy(t,n){n.entity&&(n.entity.ellipse=void 0)},cesiumProps:jn$1,cesiumEventProps:Hn$1}),As$1=zn$1,xn$1=["heightReference","radii","show","fill","innerRadii","material","maximumClock","maximumCone","minimumClock","minimumCone","outline","outlineColor","outlineWidth","subdivisions","stackPartitions","slicePartitions","shadows","distanceDisplayCondition"],Nn$1={onDefinitionChange:"definitionChanged"},qn$1=l({name:"EllipsoidGraphics",create(t,n){if(!t.entity)return;const o=new Cesium$1.EllipsoidGraphics(n);return t.entity.ellipsoid=o,o},destroy(t,n){n.entity&&(n.entity.ellipsoid=void 0)},cesiumProps:xn$1,cesiumEventProps:Nn$1}),Fs$1=qn$1,Yn$1=["availability","billboard","box","corridor","cylinder","description","ellipse","ellipsoid","entityCollection","label","model","name","orientation","path","plane","parent","point","polygon","polyline","polylineVolume","position","properties","rectangle","show","tileset","viewFrom","wall"],Kn$1=["id"],Jn$1={onDefinitionChange:"definitionChanged"},Zn$1=["selected","tracked"],Xn$1=l({name:"Entity",create(t,n){if(!t.entityCollection)return;const o=new Cesium$1.Entity(n);return t.viewer&&n.selected&&(t.viewer.selectedEntity=o),t.viewer&&n.tracked&&(t.viewer.trackedEntity=o),t.entityCollection.add(o),o},destroy(t,n){n.entityCollection&&n.entityCollection.remove(t)},update(t,n,o,s){s.viewer&&(n.selected!==o.selected&&(n.selected?s.viewer.selectedEntity=t:s.viewer.selectedEntity===t&&(s.viewer.selectedEntity=void 0)),n.tracked!==o.tracked&&(n.tracked?s.viewer.trackedEntity=t:s.viewer.trackedEntity===t&&(s.viewer.trackedEntity=void 0)))},provide(t,n,o){return{entity:t,__$internal:{onUpdate:o==null?void 0:o.onUpdate}}},cesiumProps:Yn$1,cesiumReadonlyProps:Kn$1,cesiumEventProps:Jn$1,otherProps:Zn$1,useCommonEvent:!0}),Is$1=Xn$1,eo$1=["density","enabled","minimumBrightness","screenSpaceErrorFactor","renderable"],io$1=l({name:"Fog",create(t){if(!t.scene)return;const n=new Cesium$1.Fog;return t.scene.fog=n,n},destroy(t,n){n.scene&&!n.scene.isDestroyed()&&(n.scene.fog=new Cesium$1.Fog)},cesiumProps:eo$1,setCesiumPropsAfterCreate:!0}),Vs=io$1,to$1=["clustering","name","show"],no$1=["clampToGround","sourceUri","credit","markerSize","markerSymbol","markerColor","stroke","strokeWidth","fill","describe"],oo$1={onChange:"changedEvent",onError:"errorEvent",onLoading:"loadingEvent"},ro$1=["onLoad","data"],ci$1=(t,{data:n,onLoad:o,...s})=>{n&&t.load(n,s).then(c=>{o&&o(c)})},so$1=l({name:"GeoJsonDataSource",create(t,n){if(!t.dataSourceCollection)return;const o=new Cesium$1.GeoJsonDataSource(n.name);return n.clustering&&(o.clustering=n.clustering),typeof n.show=="boolean"&&(o.show=n.show),t.dataSourceCollection.add(o),n.data&&ci$1(o,n),o},update(t,n,o){n.data?o.show!==n.show&&(t.show=typeof n.show=="boolean"?n.show:!0):t.show=!1,n.data&&(o.data!==n.data||o.clampToGround!==n.clampToGround||o.sourceUri!==n.sourceUri||o.credit!==n.credit||o.markerSize!==n.markerSize||o.markerSymbol!==n.markerSymbol||o.markerColor!==n.markerColor||o.stroke!==n.stroke||o.strokeWidth!==n.strokeWidth||o.fill!==n.fill)&&ci$1(t,n)},destroy(t,n){n.dataSourceCollection&&!n.dataSourceCollection.isDestroyed()&&n.dataSourceCollection.remove(t)},provide(t){return{dataSource:t}},cesiumProps:to$1,cesiumReadonlyProps:no$1,cesiumEventProps:oo$1,otherProps:ro$1,useCommonEvent:!0}),Us$1=so$1,ao$1={onImageryLayersUpdate:"imageryLayersUpdatedEvent",onTerrainProviderChange:"terrainProviderChanged",onTileLoadProgress:"tileLoadProgressEvent"},co$1=["atmosphereBrightnessShift","atmosphereHueShift","atmosphereSaturationShift","backFaceCulling","baseColor","clippingPlanes","depthTestAgainstTerrain","enableLighting","lightingFadeInDistance","lightingFadeOutDistance","material","maximumScreenSpaceError","nightFadeInDistance","nightFadeOutDistance","oceanNormalMapUrl","shadows","show","showGroundAtmosphere","showWaterEffect","tileCacheSize","loadingDescendantLimit","preloadAncestors","preloadSiblings","fillHighlightColor","dynamicAtmosphereLighting","dynamicAtmosphereLightingFromSun","showSkirts","cartographicLimitRectangle","translucency","undergroundColor","undergroundColorAlphaByDistance","lambertDiffuseMultiplier","atmosphereLightIntensity","atmosphereRayleighCoefficient","atmosphereMieCoefficient","atmosphereRayleighScaleHeight","atmosphereMieScaleHeight","atmosphereMieAnisotropy","vertexShadowDarkness"],lo=["terrainProvider"],uo$1=l({name:"Globe",create:t=>{var n;return(n=t.scene)==null?void 0:n.globe},update:async(t,n)=>{const o=n.terrainProvider;let s;J(o)?s=await o:s=o,t.terrainProvider=s},cesiumProps:co$1,cesiumEventProps:ao$1,otherProps:lo,setCesiumPropsAfterCreate:!0}),js$1=uo$1,mo$1=["appearance","classificationType","debugShowBoundingVolume","debugShowShadowVolume","show"],fo$1=["allowPicking","asynchronous","geometryInstances","interleave","releaseGeometryInstances"],ho$2=["onReady"];l({name:"GroundPolylinePrimitive",create(t,n){var o;if(!t.primitiveCollection)return;const s=new Cesium$1.GroundPolylinePrimitive(n);if(n.onReady){const c=()=>{var d,h;s.ready&&((d=n.onReady)==null||d.call(n,s),(h=t.scene)==null||h.postRender.removeEventListener(c))};(o=t.scene)==null||o.postRender.addEventListener(c)}return t.primitiveCollection.add(s),s},destroy(t,n){n.primitiveCollection&&!n.primitiveCollection.isDestroyed()&&n.primitiveCollection.remove(t),t.isDestroyed()||t.destroy()},cesiumProps:mo$1,cesiumReadonlyProps:fo$1,otherProps:ho$2,useCommonEvent:!0});const po$1=["appearance","classificationType","debugShowBoundingVolume","debugShowShadowVolume","show"],vo$2=["allowPicking","asynchronous","compressVertices","geometryInstances","interleave","releaseGeometryInstances","vertexCacheOptimize"],go$1=["onReady"];l({name:"GroundPrimitive",create(t,n){var o;if(!t.primitiveCollection)return;const s=new Cesium$1.GroundPrimitive(n);if(n.onReady){const c=()=>{var d,h;s.ready&&((d=n.onReady)==null||d.call(n,s),(h=t.scene)==null||h.postRender.removeEventListener(c))};(o=t.scene)==null||o.postRender.addEventListener(c)}return t.primitiveCollection.add(s),s},destroy(t,n){n.primitiveCollection&&!n.primitiveCollection.isDestroyed()&&n.primitiveCollection.remove(t),t.isDestroyed()||t.destroy()},cesiumProps:po$1,cesiumReadonlyProps:vo$2,otherProps:go$1,useCommonEvent:!0});const Po$1=["show","destroyPrimitives","primitiveAdded","primitiveRemoved"];l({name:"GroundPrimitiveCollection",create:t=>{var n;return(n=t.scene)==null?void 0:n.groundPrimitives},provide:t=>({primitiveCollection:t}),cesiumProps:Po$1,setCesiumPropsAfterCreate:!0});const Eo$1=["alpha","brightness","contrast","hue","saturation","gamma","splitDirection","minificationFilter","magnificationFilter","cutoutRectangle","show","nightAlpha","dayAlpha","colorToAlpha","colorToAlphaThreshold","index"],bo$1=["rectangle","maximumAnisotropy","minimumTerrainLevel","maximumTerrainLevel","readyEvent","imageryProvider"],wo$1=l({name:"ImageryLayer",async create(t,n){var o,s,c,d;if(!t.imageryLayerCollection)return;const h=J(n.imageryProvider)?n.imageryProvider:new Promise(L=>queueMicrotask(()=>L(n.imageryProvider))),p=(s=(o=t.__$internal)==null?void 0:o.imageryLayerWaitingList)==null?void 0:s.slice();(c=t.__$internal)!=null&&c.imageryLayerWaitingList&&t.__$internal.imageryLayerWaitingList.push(h),p&&await Promise.all(p.filter(L=>J(L)));const y=await h;if((d=t.__$internal)!=null&&d.imageryLayerWaitingList&&(t.__$internal.imageryLayerWaitingList=t.__$internal.imageryLayerWaitingList.filter(L=>L!==h)),!y)return;const E=new Cesium$1.ImageryLayer(y,n);return t.imageryLayerCollection.add(E,n.index),E},destroy(t,n){n.imageryLayerCollection&&n.imageryLayerCollection.remove(t)},cesiumProps:Eo$1,cesiumReadonlyProps:bo$1}),Ns$1=wo$1,Do$1={onLayerAdd:"layerAdded",onLayerMove:"layerMoved",onLayerRemove:"layerRemoved",onLayerShowOrHide:"layerShownOrHidden"};l({name:"ImageryLayerCollection",create:t=>{var n;return(n=t.globe)==null?void 0:n.imageryLayers},cesiumEventProps:Do$1});const $o$1=["clustering","name","show"],To$1=["canvas","camera","ellipsoid","clampToGround","sourceUri","credit","screenOverlayContainer"],Mo$1={onChange:"changedEvent",onError:"errorEvent",onLoading:"loadingEvent",onRefresh:"refreshEvent",onUnsupportedNode:"unsupportedNodeEvent"},ko$1=["onLoad","data"],li$1=(t,{data:n,onLoad:o,...s})=>{n&&t.load(n,s).then(c=>{o&&o(c)})},Lo$1=l({name:"KmlDataSource",create(t,n){if(!t.scene||!t.dataSourceCollection||!t.scene)return;const o=new Cesium$1.KmlDataSource({camera:n.camera||t.scene.camera,canvas:n.canvas||t.scene.canvas,ellipsoid:n.ellipsoid,credit:n.credit});return n.clustering&&(o.clustering=n.clustering),typeof n.show=="boolean"&&(o.show=n.show),typeof n.name<"u"&&(o.name=n.name),t.dataSourceCollection.add(o),n.data&&li$1(o,n),o},update(t,n,o){n.data?o.show!==n.show&&(t.show=typeof n.show=="boolean"?n.show:!0):t.show=!1,n.data&&(o.data!==n.data||o.clampToGround!==n.clampToGround||o.ellipsoid!==n.ellipsoid||o.sourceUri!==n.sourceUri||o.credit!==n.credit)&&li$1(t,n)},destroy(t,n){n.dataSourceCollection&&!n.dataSourceCollection.isDestroyed()&&n.dataSourceCollection.remove(t)},provide(t){return{dataSource:t}},cesiumProps:$o$1,cesiumReadonlyProps:To$1,cesiumEventProps:Mo$1,otherProps:ko$1,useCommonEvent:!0}),Ys$1=Lo$1,_o$1=["backgroundColor","backgroundPadding","disableDepthTestDistance","distanceDisplayCondition","eyeOffset","fillColor","font","heightReference","horizontalOrigin","id","outlineColor","outlineWidth","pixelOffset","pixelOffsetScaleByDistance","position","scale","scaleByDistance","show","showBackground","style","text","translucencyByDistance","verticalOrigin"];l({name:"Label",create:(t,n)=>{var o;return(o=t.labelCollection)==null?void 0:o.add(n)},destroy(t,n){n.labelCollection&&!n.labelCollection.isDestroyed()&&n.labelCollection.remove(t)},cesiumProps:_o$1,useCommonEvent:!0});const Go$1=["blendOption","debugShowBoundingVolume","modelMatrix","show"];l({name:"LabelCollection",create(t,n){if(!t.scene||!t.primitiveCollection)return;const o=new Cesium$1.LabelCollection({scene:t.scene,modelMatrix:n.modelMatrix,blendOption:n.blendOption,debugShowBoundingVolume:n.debugShowBoundingVolume});return t.primitiveCollection.add(o),o},destroy(t,n){n.primitiveCollection&&!n.primitiveCollection.isDestroyed()&&n.primitiveCollection.remove(t),t.isDestroyed()||t.destroy()},provide(t){return{labelCollection:t}},cesiumProps:Go$1});const Ao$1=["text","font","style","fillColor","outlineColor","outlineWidth","show","showBackground","backgroundColor","backgroundPadding","scale","horizontalOrigin","verticalOrigin","eyeOffset","pixelOffset","translucencyByDistance","pixelOffsetScaleByDistance","scaleByDistance","heightReference","distanceDisplayCondition","disableDepthTestDistance"],Fo$1={onDefinitionChange:"definitionChanged"},Io$1=l({name:"LabelGraphics",create(t,n){if(!t.entity)return;const o=new Cesium$1.LabelGraphics(n);return t.entity.label=o,o},destroy(t,n){n.entity&&(n.entity.label=void 0)},cesiumProps:Ao$1,cesiumEventProps:Fo$1}),Zs=Io$1,Wo$1=["backFaceCulling","clampAnimations","clippingPlanes","color","colorBlendAmount","colorBlendMode","customShader","debugShowBoundingVolume","debugWireframe","distanceDisplayCondition","featureIdLabel","heightReference","id","imageBasedLighting","instanceFeatureIdLabel","lightColor","maximumScale","minimumPixelSize","modelMatrix","outlineColor","scale","shadows","show","showCreditsOnScreen","showOutline","silhouetteColor","silhouetteSize","splitDirection","style"],Vo$1=["allowPicking","asynchronous","basePath","credit","enableDebugWireframe","gltf","heightReference","incrementallyLoadTextures","scene","releaseGltfJson","cull","opaquePass","upAxis","forwardAxis","content","scene","enableShowOutline","projectTo2D","classificationType","errorEvent","readyEvent","texturesReadyEvent","gltfCallback","enablePick"],Uo$1=["onReady","onError","url"];l({name:"Model",async create(t,{scene:n,url:o,colorBlendMode:s,...c}){var d;if(!t.scene||!t.primitiveCollection||!o)return;const h=o;let p;J(h)?p=await h:p=h;let y;try{y=await Cesium$1.Model.fromGltfAsync({...c,url:p,colorBlendMode:s,scene:n||t.scene})}catch(E){(d=c.onError)==null||d.call(c,E);return}return t.primitiveCollection.add(y),y},destroy(t,n){n.primitiveCollection&&!n.primitiveCollection.isDestroyed()&&n.primitiveCollection.remove(t),t.isDestroyed()||t.destroy()},cesiumEventProps:{onReady:"readyEvent"},cesiumProps:Wo$1,cesiumReadonlyProps:Vo$1,otherProps:Uo$1,useCommonEvent:!0});const Ho$1=["uri","show","scale","minimumPixelSize","maximumScale","incrementallyLoadTextures","runAnimations","clampAnimations","nodeTransformations","shadows","heightReference","distanceDisplayCondition","silhouetteColor","silhouetteSize","color","colorBlendMode","colorBlendAmount","clippingPlanes","imageBasedLightingFactor","lightColor","articulations","customShader"],zo$1={onDefinitionChange:"definitionChanged"},xo$1=l({name:"ModelGraphics",create(t,n){if(!t.entity)return;const o=new Cesium$1.ModelGraphics(n);return t.entity.model=o,o},destroy(t,n){n.entity&&(n.entity.model=void 0)},cesiumProps:Ho$1,cesiumEventProps:zo$1}),Qs$1=xo$1,No$1=["onlySunLighting","show","textureUrl"],qo$1=["ellipsoid"],Yo$1=l({name:"Moon",create(t,n){if(!t.scene)return;const o=new Cesium$1.Moon(n);return t.scene.moon=o,o},destroy(t,n){n.scene&&!n.scene.isDestroyed()&&(n.scene.moon=new Cesium$1.Moon)},cesiumProps:No$1,cesiumReadonlyProps:qo$1}),ea$1=Yo$1,Ko$1=["show","emitter","modelMatrix","emitterModelMatrix","emissionRate","bursts","loop","startScale","endScale","startColor","endColor","image","imageSize","minimumImageSize","maximumImageSize","speed","minimumSpeed","maximumSpeed","lifetime","particleLife","minimumParticleLife","maximumParticleLife","mass","minimumMass","maximumMass","sizeInMeters"],Jo$1={onComplete:"complete",onUpdate:"updateCallback"};l({name:"ParticleSystem",create(t,n){if(!t.primitiveCollection)return;const o=new Cesium$1.ParticleSystem({...n,updateCallback:n.onUpdate});return t.primitiveCollection.add(o),o},update(t,n,o){n.onUpdate!==o.onUpdate&&(t.updateCallback=n.onUpdate)},destroy(t,n){n.primitiveCollection&&!n.primitiveCollection.isDestroyed()&&n.primitiveCollection.remove(t)},cesiumProps:Ko$1,cesiumEventProps:Jo$1});const Xo$1=["leadTime","trailTime","show","width","material","resolution","distanceDisplayCondition"],Qo$1={onDefinitionChange:"definitionChanged"};l({name:"PathGraphics",create(t,n){if(!t.entity)return;const o=new Cesium$1.PathGraphics(n);return t.entity.path=o,o},destroy(t,n){n.entity&&(n.entity.path=void 0)},cesiumProps:Xo$1,cesiumEventProps:Qo$1});const ir$1=["plane","dimensions","show","fill","material","outline","outlineColor","outlineWidth","shadows","distanceDisplayCondition"],tr$1={onDefinitionChange:"definitionChanged"},nr$1=l({name:"PlaneGraphics",create(t,n){if(!t.entity)return;const o=new Cesium$1.PlaneGraphics(n);return t.entity.plane=o,o},destroy(t,n){n.entity&&(n.entity.plane=void 0)},cesiumProps:ir$1,cesiumEventProps:tr$1}),na$1=nr$1,or$1=["color","pixelSize","outlineColor","outlineWidth","show","scaleByDistance","translucencyByDistance","heightReference","distanceDisplayCondition","disableDepthTestDistance"],rr$1={onDefinitionChange:"definitionChanged"},sr$1=l({name:"PointGraphics",create(t,n){if(!t.entity)return;const o=new Cesium$1.PointGraphics(n);return t.entity.point=o,o},destroy(t,n){n.entity&&(n.entity.point=void 0)},cesiumProps:or$1,cesiumEventProps:rr$1}),oa$1=sr$1,ar$1=["color","disableDepthTestDistance","distanceDisplayCondition","id","outlineColor","outlineWidth","pixelSize","position","scaleByDistance","show","translucencyByDistance"];l({name:"PointPrimitive",create:(t,n)=>{var o;return(o=t.pointPrimitiveCollection)==null?void 0:o.add(n)},destroy(t,n){n.pointPrimitiveCollection&&!n.pointPrimitiveCollection.isDestroyed()&&n.pointPrimitiveCollection.remove(t)},cesiumProps:ar$1,useCommonEvent:!0});const lr$1=["blendOption","debugShowBoundingVolume","modelMatrix","show"];l({name:"PointPrimitveCollection",create(t,n){if(!t.primitiveCollection)return;const o=new Cesium$1.PointPrimitiveCollection(n);return t.primitiveCollection.add(o),o},destroy(t,n){n.primitiveCollection&&!n.primitiveCollection.isDestroyed()&&n.primitiveCollection.remove(t),t.isDestroyed()||t.destroy()},provide(t){return{pointPrimitiveCollection:t}},cesiumProps:lr$1});const dr$1=["arcType","hierarchy","height","heightReference","extrudedHeight","extrudedHeightReference","show","fill","material","outline","outlineColor","outlineWidth","stRotation","granularity","perPositionHeight","closeTop","closeBottom","shadows","distanceDisplayCondition","zIndex","classificationType","textureCoordinates"],mr$1={onDefinitionChange:"definitionChanged"},fr$1=l({name:"PolygonGraphics",create(t,n){if(!t.entity)return;const o=new Cesium$1.PolygonGraphics(n);return t.entity.polygon=o,o},destroy(t,n){n.entity&&(n.entity.polygon=void 0)},cesiumProps:dr$1,cesiumEventProps:mr$1}),aa$1=fr$1,hr$1=["distanceDisplayCondition","id","loop","material","positions","show","width"];l({name:"Polyline",create:(t,n)=>{var o;return(o=t.polylineCollection)==null?void 0:o.add(n)},destroy(t,n){n.polylineCollection&&!n.polylineCollection.isDestroyed()&&n.polylineCollection.remove(t)},cesiumProps:hr$1,useCommonEvent:!0});const pr$1=["debugShowBoundingVolume","length","modelMatrix","show"];l({name:"PolylineCollection",create(t,n){if(!t.primitiveCollection)return;const o=new Cesium$1.PolylineCollection({modelMatrix:n.modelMatrix,debugShowBoundingVolume:n.debugShowBoundingVolume,length:n.length,scene:t.scene});return t.primitiveCollection.add(o),o},destroy(t,n){n.primitiveCollection&&!n.primitiveCollection.isDestroyed()&&n.primitiveCollection.remove(t),t.isDestroyed()||t.destroy()},provide(t){return{polylineCollection:t}},cesiumProps:pr$1});const gr$1=["arcType","classificationType","positions","clampToGround","width","show","material","depthFailMaterial","granularity","shadows","distanceDisplayCondition","zIndex"],Cr$1={onDefinitionChange:"definitionChanged"},Pr$1=l({name:"PolylineGraphics",create(t,n){if(!t.entity)return;const o=new Cesium$1.PolylineGraphics(n);return t.entity.polyline=o,o},destroy(t,n){n.entity&&(n.entity.polyline=void 0)},cesiumProps:gr$1,cesiumEventProps:Cr$1}),ua$1=Pr$1,Sr$1=["positions","shape","cornerType","show","fill","material","outline","outlineColor","outlineWidth","granularity","shadows","distanceDisplayCondition"],Er$1={onDefinitionChange:"definitionChanged"};l({name:"PolylineVolumeGraphics",create(t,n){if(!t.entity)return;const o=new Cesium$1.PolylineVolumeGraphics(n);return t.entity.polylineVolume=o,o},destroy(t,n){n.entity&&(n.entity.polylineVolume=void 0)},cesiumProps:Sr$1,cesiumEventProps:Er$1});const wr$1=["enabled","selected"],Dr$1=["clearColor","forcePowerOfTwo","fragmentShader","name","pixelDatatype","pixelFormat","sampleMode","scissorRectangle","textureScale","uniforms"];l({name:"PostProcessStage",create(t,n){if(!t.scene)return;const o=new Cesium$1.PostProcessStage(n);return typeof n.enabled=="boolean"&&(o.enabled=n.enabled),n.selected&&(o.selected=n.selected),t.scene.postProcessStages.add(o),o},destroy(t,n){n.scene&&!n.scene.isDestroyed()&&n.scene.postProcessStages.remove(t),t.isDestroyed()||t.destroy()},cesiumProps:wr$1,cesiumReadonlyProps:Dr$1}),U$1({name:"BlackAndWhiteStage",props:["gradations"],create:()=>Cesium$1.PostProcessStageLibrary.createBlackAndWhiteStage()}),U$1({name:"BrightnessStage",props:["brightness"],create:()=>Cesium$1.PostProcessStageLibrary.createBrightnessStage()}),U$1({name:"LensFlareStage",props:["dirtTexture","starTexture","intensity","distortion","ghostDispersal","haloWidth","earthRadius"],create:()=>Cesium$1.PostProcessStageLibrary.createLensFlareStage()}),U$1({name:"Fxaa",create:(t,n)=>n.fxaa,props:[]}),U$1({name:"NightVisionStage",props:[],create:()=>Cesium$1.PostProcessStageLibrary.createNightVisionStage()});const Rr$1=["enabled","selected"],$r$1=["inputPreviousStageTexture","name","stages","uniforms"];l({name:"PostProcessStageComposite",create(t,n){if(!t.scene)return;const o=new Cesium$1.PostProcessStageComposite(n);return typeof n.enabled=="boolean"&&(o.enabled=n.enabled),n.selected&&(o.selected=n.selected),t.scene.postProcessStages.add(o),o},destroy(t,n){n.scene&&!n.scene.isDestroyed()&&n.scene.postProcessStages.remove(t),t.isDestroyed()||t.destroy()},cesiumProps:Rr$1,cesiumReadonlyProps:$r$1}),U$1({name:"AmbientOcclusion",create:(t,n)=>n.ambientOcclusion,props:["ambientOcclusionOnly","bias","delta","frustumLength","intensity","lengthCap","sigma","stepSize"],noMount:!0}),U$1({name:"Bloom",create:(t,n)=>n.bloom,props:["brightness","contrast","delta","glowOnly","sigma","stepSize"],noMount:!0}),U$1({name:"BlurStage",props:["delta","sigma","stepSize"],create:()=>Cesium$1.PostProcessStageLibrary.createBlurStage()}),U$1({name:"DepthOfFieldStage",props:["delta","focalDistance","sigma","stepSize"],create:()=>Cesium$1.PostProcessStageLibrary.createDepthOfFieldStage()}),U$1({name:"EdgeDetectionStage",props:["color","length"],create:()=>Cesium$1.PostProcessStageLibrary.createEdgeDetectionStage()}),U$1({name:"SilhouetteStage",props:["color","length"],create:()=>Cesium$1.PostProcessStageLibrary.createSilhouetteStage()});const Tr$1=["appearance","cull","debugShowBoundingVolume","depthFailAppearance","modelMatrix","shadows","show"],Mr$1=["allowPicking","asynchronous","compressVertices","geometryInstances","interleave","releaseGeometryInstances","vertexCacheOptimize"],kr$1=["onReady"],Lr$1=l({name:"Primitive",create(t,n){var o;if(!t.primitiveCollection)return;const s=new Cesium$1.Primitive(n);if(n.onReady){const c=()=>{var d,h;s.ready&&((d=n.onReady)==null||d.call(n,s),(h=t.scene)==null||h.postRender.removeEventListener(c))};(o=t.scene)==null||o.postRender.addEventListener(c)}return t.primitiveCollection.add(s),s},destroy(t,n){n.primitiveCollection&&!n.primitiveCollection.isDestroyed()&&n.primitiveCollection.remove(t),t.isDestroyed()||t.destroy()},cesiumProps:Tr$1,cesiumReadonlyProps:Mr$1,otherProps:kr$1,useCommonEvent:!0}),Da$1=Lr$1,_r$1=["classificationType","coordinates","height","heightReference","extrudedHeight","extrudedHeightReference","show","fill","material","outline","outlineColor","outlineWidth","rotation","stRotation","granularity","shadows","distanceDisplayCondition","zIndex"],Or$1={onDefinitionChange:"definitionChanged"};l({name:"RectangleGraphics",create(t,n){if(!t.entity)return;const o=new Cesium$1.RectangleGraphics(n);return t.entity.rectangle=o,o},destroy(t,n){n.entity&&(n.entity.rectangle=void 0)},cesiumProps:_r$1,cesiumEventProps:Or$1});const Br$1=["backgroundColor","completeMorphOnUserInput","debugCommandFilter","debugShowCommands","debugShowDepthFrustum","debugShowFramesPerSecond","debugShowFrustumPlanes","debugShowFrustums","eyeSeparation","farToNearRatio","focalLength","fog","gamma","globe","highDynamicRange","invertClassification","invertClassificationColor","light","logarithmicDepthBuffer","logarithmicDepthFarToNearRatio","maximumRenderTimeChange","minimumDisableDepthTestDistance","moon","morphTime","nearToFarDistance2D","pickTranslucentDepth","requestRenderMode","rethrowRenderErrors","shadowMap","skyAtmosphere","skyBox","specularEnvironmentMaps","sphericalHarmonicCoefficients","sun","sunBloom","terrainProvider","useDepthPicking","useWebVR","postProcessStages","msaaSamples","splitPosition","debugCommandFilter","verticalExaggeration","verticalExaggerationRelativeHeight","atmosphere"],Ar$1={onMorphComplete:"morphComplete",onMorphStart:"morphStart",onPostRender:"postRender",onPreRender:"preRender",onPreUpdate:"preUpdate",onPostUpdate:"postUpdate",onRenderError:"renderError",onTerrainProviderChange:"terrainProviderChanged"},Fr$1=["mode","morphDuration"],ui=(t,n,o)=>{switch(n){case Cesium$1.SceneMode.SCENE2D:t.morphTo2D(o);break;case Cesium$1.SceneMode.COLUMBUS_VIEW:t.morphToColumbusView(o);break;case Cesium$1.SceneMode.SCENE3D:t.morphTo3D(o);break}},Ir$1=l({name:"Scene",create(t,n){return t.scene&&n.mode&&ui(t.scene,n.mode,n.morphDuration),t.scene},update(t,n,o){n.mode!==o.mode&&n.mode&&ui(t,n.mode,n.morphDuration)},cesiumProps:Br$1,cesiumEventProps:Ar$1,otherProps:Fr$1,setCesiumPropsAfterCreate:!0}),$a$1=Ir$1,Wr$1=["bounceAnimationTime","enableCollisionDetection","enableInputs","enableLook","enableRotate","enableTilt","enableTranslate","enableZoom","inertiaSpin","inertiaTranslate","inertiaZoom","lookEventTypes","maximumMovementRatio","maximumZoomDistance","minimumCollisionTerrainHeight","minimumPickingTerrainHeight","minimumTrackBallHeight","minimumZoomDistance","rotateEventTypes","tiltEventTypes","translateEventTypes","zoomEventTypes","minimumPickingTerrainDistanceWithInertia"],Vr$1=l({name:"ScreenSpaceCameraController",create:t=>{var n;return(n=t.scene)==null?void 0:n.screenSpaceCameraController},cesiumProps:Wr$1,setCesiumPropsAfterCreate:!0}),Ta$1=Vr$1,Ur$1=({action:t,modifier:n,type:o})=>{const s=$e$1();return React.useEffect(()=>{if(!(!s.screenSpaceEventHandler||s.screenSpaceEventHandler.isDestroyed())){if(t)return s.screenSpaceEventHandler.setInputAction(t,o,n),()=>{!s.screenSpaceEventHandler||s.screenSpaceEventHandler.isDestroyed()||s.screenSpaceEventHandler.removeInputAction(o,n)};s.screenSpaceEventHandler.removeInputAction(o,n)}},[t,s.screenSpaceEventHandler,n,o]),null},Ma$1=Ur$1,jr$1=l({name:"ScreenSpaceEventHandler",create(t,n){var o;return n.useDefault?(o=t.cesiumWidget)==null?void 0:o.screenSpaceEventHandler:t.scene?new Cesium$1.ScreenSpaceEventHandler(t.scene.canvas):void 0},destroy(t){t.isDestroyed()||t.destroy()},provide(t){return{screenSpaceEventHandler:t}}}),ka$1=jr$1,Hr$1=["darkness","fadingEnabled","maximumDistance","enabled","normalOffset","softShadows","size"];l({name:"ShadowMap",create:t=>{var n;return(n=t.scene)==null?void 0:n.shadowMap},cesiumProps:Hr$1});const xr$1=["brightnessShift","hueShift","saturationShift","show","perFragmentAtmosphere","atmosphereLightIntensity","atmosphereRayleighCoefficient","atmosphereMieCoefficient","atmosphereRayleighScaleHeight","atmosphereMieScaleHeight","atmosphereMieAnisotropy"],Nr$1=l({name:"SkyAtmosphere",create:t=>{var n;return(n=t.scene)==null?void 0:n.skyAtmosphere},cesiumProps:xr$1,setCesiumPropsAfterCreate:!0}),_a$2=Nr$1,qr$1=["sources","show"],Yr$1=l({name:"SkyBox",create:t=>{var n;return(n=t.scene)==null?void 0:n.skyBox},cesiumProps:qr$1,setCesiumPropsAfterCreate:!0}),Oa$1=Yr$1,Kr$1=["glowFactor","show"],Jr$1=l({name:"Sun",create(t){if(!t.scene)return;const n=new Cesium$1.Sun;return t.scene.sun=n,n},destroy(t,n){n.scene&&!n.scene.isDestroyed()&&(n.scene.sun=new Cesium$1.Sun)},cesiumProps:Kr$1,setCesiumPropsAfterCreate:!0}),Ga$1=Jr$1,Zr$1=["clippingPlanes","maximumMemoryUsage","modelMatrix","shadows","show","style","intervals"],Xr$1=["clock","shading"],Qr$1=["onReady"],es$1={onFrameChange:"frameChanged"};l({name:"TimeDynamicPointCloud",create(t,n){var o;if(!t.cesiumWidget||!t.primitiveCollection||!((o=t.cesiumWidget)!=null&&o.clock))return;const s=new Cesium$1.TimeDynamicPointCloud({...n,clock:n.clock??t.cesiumWidget.clock});if(n.onReady){const c=()=>{var d;(d=n.onReady)==null||d.call(n,s),s.frameChanged.removeEventListener(c)};s.frameChanged.addEventListener(c)}return t.primitiveCollection.add(s),s},destroy(t,n){n.primitiveCollection&&!n.primitiveCollection.isDestroyed()&&n.primitiveCollection.remove(t),t.isDestroyed()||t.destroy()},cesiumProps:Zr$1,cesiumReadonlyProps:Xr$1,cesiumEventProps:es$1,otherProps:Qr$1,useCommonEvent:!0});const ts$1=["terrainShadows","clockTrackedDataSource","targetFrameRate","useDefaultRenderLoop","resolutionScale","allowDataSourcesToSuspendAnimation","trackedEntity","selectedEntity","shadows","useBrowserRecommendedResolution","creditDisplay"],ns$1=["baseLayer","animation","baseLayerPicker","fullscreenButton","vrButton","geocoder","homeButton","infoBox","sceneModePicker","selectionIndicator","timeline","navigationHelpButton","navigationInstructionsInitiallyVisible","scene3DOnly","shouldAnimate","clockViewModel","selectedImageryProviderViewModel","imageryProviderViewModels","selectedTerrainProviderViewModel","terrainProviderViewModels","skyBox","skyAtmosphere","fullscreenElement","showRenderLoopErrors","automaticallyTrackDataSourceClocks","contextOptions","sceneMode","mapProjection","globe","orderIndependentTranslucency","creditContainer","creditViewport","dataSources","mapMode2D","projectionPicker","requestRenderMode","maximumRenderTimeChange","depthPlaneEllipsoidOffset","msaaSamples","blurActiveElementOnCanvasFocus","terrain"],os$1={onSelectedEntityChange:"selectedEntityChanged",onTrackedEntityChange:"trackedEntityChanged"},rs$1=["className","id","style","full","containerProps","extend","terrainProvider"],ss$1=l({name:"Viewer",async create(t,{baseLayer:n,terrainProvider:o,...s},c){if(!c)return;let d;J(o)?d=await o:d=o;const h=new Cesium$1.Viewer(c,{...s,terrainProvider:d,baseLayer:n===!1?void 0:n});if(!h)return;n===!1&&h.imageryLayers.removeAll(),h&&s.extend&&(Array.isArray(s.extend)?s.extend.forEach(y=>{h.extend(y,{})}):h.extend(s.extend,{}));const p=new De$1(h.scene);return[h,p]},destroy(t,n,o,s){s&&!s.isDestroyed()&&s.destroy(),t.isDestroyed()||t.destroy()},provide(t,n,o,s){return{viewer:t,cesiumWidget:t.cesiumWidget,dataSourceCollection:t.dataSources,entityCollection:t.entities,scene:t.scene,camera:t.scene.camera,imageryLayerCollection:t.scene.globe.imageryLayers,primitiveCollection:t.scene.primitives,globe:t.scene.globe,__$internal:{onUpdate:o==null?void 0:o.onUpdate,imageryLayerWaitingList:[]},[ce$1]:s}},containerProps:({id:t,className:n,style:o,full:s,containerProps:c})=>({className:n,id:t,style:{...s?{position:"absolute",bottom:"0",left:"0",right:"0",top:"0"}:{},...o},...c}),cesiumProps:ts$1,cesiumReadonlyProps:ns$1,cesiumEventProps:os$1,otherProps:rs$1,renderContainer:!0,useCommonEvent:!0,useRootEvent:!0}),Aa$1=ss$1,as$1=["positions","maximumHeights","minimumHeights","show","fill","material","outline","outlineColor","outlineWidth","granularity","shadows","distanceDisplayCondition"],cs$1={onDefinitionChange:"definitionChanged"};l({name:"WallGraphics",create(t,n){if(!t.entity)return;const o=new Cesium$1.WallGraphics(n);return t.entity.wall=o,o},destroy(t,n){n.entity&&(n.entity.wall=void 0)},cesiumProps:as$1,cesiumEventProps:cs$1});const Cluster=({property:t,children:n})=>{const{clusterPixelRange:o=15,clusterMinSize:s=3,clusterLabelTypography:c={fontFamily:"sans-serif",fontSize:30,fontWeight:400,color:"#FFF",textAlign:"center",bold:!1,italic:!1,underline:!1},clusterImage:d,clusterImageWidth:h,clusterImageHeight:p}=(t==null?void 0:t.default)??{},y=React.useMemo(()=>new Cesium$1.EntityCluster({enabled:!0,pixelRange:15,minimumClusterSize:2,clusterBillboards:!0,clusterLabels:!0,clusterPoints:!0}),[]);return React.useEffect(()=>{const E=React.Children.count(n)<s,L=y==null?void 0:y.clusterEvent.addEventListener((F,N)=>{N.label.font=toCSSFont(c,{fontSize:30}),N.label.horizontalOrigin=c.textAlign==="right"?Cesium$1.HorizontalOrigin.LEFT:c.textAlign==="left"?Cesium$1.HorizontalOrigin.RIGHT:Cesium$1.HorizontalOrigin.CENTER,N.label.verticalOrigin=Cesium$1.VerticalOrigin.CENTER,N.label.fillColor=Cesium$1.Color.fromCssColorString(c.color??"#FFF"),N.label.eyeOffset=new Cesium$1.Cartesian3(0,0,-5),N.billboard.show=!0,N.billboard.image=d,N.billboard.height=p,N.billboard.width=h,y.minimumClusterSize=E?React.Children.count(n):s});return y.enabled=!E,y.pixelRange=0,y.pixelRange=o,()=>{L()}},[s,o,c,d,p,h,n,y]),y?jsxRuntimeExports.jsx(Os$1,{show:!0,clustering:y,children:n}):null};function ReearthClock({timelineManagerRef:t}){var oe,W;const{start:n,stop:o,current:s}=((oe=t==null?void 0:t.current)==null?void 0:oe.computedTimeline)??{},{animation:c,stepType:d,rangeType:h,multiplier:p}=((W=t==null?void 0:t.current)==null?void 0:W.options)??{},y=React.useMemo(()=>n?Cesium$1.JulianDate.fromDate(n):void 0,[n]),E=React.useMemo(()=>o?Cesium$1.JulianDate.fromDate(o):void 0,[o]),L=React.useMemo(()=>s?Cesium$1.JulianDate.fromDate(s):void 0,[s]),F=d==="fixed"?Cesium$1.ClockStep.TICK_DEPENDENT:Cesium$1.ClockStep.SYSTEM_CLOCK_MULTIPLIER,N=p??1,z=React.useCallback(nt=>{var yt,Ai;const lt=Cesium$1.JulianDate.toDate(nt.startTime),Ee=Cesium$1.JulianDate.toDate(nt.stopTime);(Ai=(yt=t==null?void 0:t.current)==null?void 0:yt.handleTick)==null||Ai.call(yt,Cesium$1.JulianDate.toDate(nt.currentTime),{start:lt,stop:Ee})},[t]);return jsxRuntimeExports.jsx(Ms$1,{shouldAnimate:c,canAnimate:c,startTime:y,stopTime:E,currentTime:L,clockStep:F,multiplier:N,clockRange:h?rangeTypes[h]:void 0,onTick:z})}const rangeTypes={unbounded:Cesium$1.ClockRange.UNBOUNDED,clamped:Cesium$1.ClockRange.CLAMPED,bounced:Cesium$1.ClockRange.LOOP_STOP},DEFAULT_SCREEN_SPACE_CAMERA_ASSIGNMENTS={translateEventTypes:Cesium$1.CameraEventType.LEFT_DRAG,zoomEventTypes:[Cesium$1.CameraEventType.RIGHT_DRAG,Cesium$1.CameraEventType.WHEEL,Cesium$1.CameraEventType.PINCH],rotateEventTypes:Cesium$1.CameraEventType.LEFT_DRAG,tiltEventTypes:[Cesium$1.CameraEventType.MIDDLE_DRAG,Cesium$1.CameraEventType.PINCH,{eventType:Cesium$1.CameraEventType.LEFT_DRAG,modifier:Cesium$1.KeyboardEventModifier.CTRL},{eventType:Cesium$1.CameraEventType.RIGHT_DRAG,modifier:Cesium$1.KeyboardEventModifier.CTRL}],lookEventTypes:[{eventType:Cesium$1.CameraEventType.LEFT_DRAG,modifier:Cesium$1.KeyboardEventModifier.SHIFT}]},layerIdField="__reearth_layer_id",defaultImageSize=50,drawIcon=(t,n,o,s="none",c=!1,d="rgba(0, 0, 0, 0.7)",h=3,p=0,y=0)=>{const E=document.createElement("canvas"),L=E.getContext("2d");if(!(!t||!L))return L.save(),E.width=n+h,E.height=o+h,L.shadowBlur=h,L.shadowOffsetX=p,L.shadowOffsetY=y,L.globalCompositeOperation="source-over",L.clearRect(0,0,E.width,E.height),L.drawImage(t,(E.width-n)/2,(E.height-o)/2,n,o),s==="circle"?(L.fillStyle="black",L.globalCompositeOperation="destination-in",L.arc(n/2,o/2,Math.min(n,o)/2,0,2*Math.PI),L.fill(),c&&(L.shadowColor=d,L.globalCompositeOperation="destination-over",L.fillStyle="black",L.arc(n/2,o/2,Math.min(n,o)/2,0,2*Math.PI),L.fill())):c&&(L.shadowColor=d,L.globalCompositeOperation="destination-over",L.fillStyle="black",L.rect((E.width-n)/2,(E.height-o)/2,n,o),L.fill()),L.restore(),E.toDataURL()},useIcon=({image:t,imageSize:n,crop:o,shadow:s,shadowColor:c,shadowBlur:d,shadowOffsetX:h,shadowOffsetY:p})=>{const y=useImage(t),E=y?typeof n=="number"?Math.floor(y.width*n):Math.min(defaultImageSize,y.width):0,L=y?Math.floor(typeof n=="number"?y.height*n:E/y.width*y.height):0;return[React.useMemo(()=>drawIcon(y,E,L,o,s,c,d,h,p),[o,L,y,s,d,c,h,p,E])??"",E,L]},ho$1=t=>({left:Cesium$1.HorizontalOrigin.LEFT,center:Cesium$1.HorizontalOrigin.CENTER,right:Cesium$1.HorizontalOrigin.RIGHT,"":void 0})[t||""],vo$1=t=>({top:Cesium$1.VerticalOrigin.TOP,center:Cesium$1.VerticalOrigin.CENTER,baseline:Cesium$1.VerticalOrigin.BASELINE,bottom:Cesium$1.VerticalOrigin.BOTTOM,"":void 0})[t||""],getLocationFromScreen=(t,n,o,s=!1)=>{if(!t)return;const c=t.camera,d=t.globe.ellipsoid;let h;if(s){const L=c.getPickRay(new Cesium$1.Cartesian2(n,o));L&&(h=t.globe.pick(L,t))}if(h||(h=c==null?void 0:c.pickEllipsoid(new Cesium$1.Cartesian2(n,o),d)),!h)return;const{latitude:p,longitude:y,height:E}=d.cartesianToCartographic(h);return{lat:Cesium$1.Math.toDegrees(p),lng:Cesium$1.Math.toDegrees(y),height:E}},getRayEllipsoidIntersection=(t,n,o)=>{const s=Cesium$1.IntersectionTests.rayEllipsoid(t,n);if(!s){const c=Cesium$1.IntersectionTests.grazingAltitudeLocation(t,n);return o?c.clone(o):c}return Cesium$1.Ray.getPoint(t,s.start,o)},createRayFromCamera=t=>{const n=new Cesium$1.Ray;return t.positionWC.clone(n.origin),t.directionWC.clone(n.direction),n},getCameraEllipsoidIntersection=(t,n,o)=>{let s;const{camera:c,globe:d}=t;if(n instanceof Cesium$1.Cartesian2){if(s=c.getPickRay(n,new Cesium$1.Ray),!s)return}else s=createRayFromCamera(c),o=n;return getRayEllipsoidIntersection(s,d.ellipsoid,o)},getCameraTerrainIntersection=t=>{const n=createRayFromCamera(t.camera);return t.globe.pick(n,t)},cartesianToLatLngHeight=(t,n)=>{const o=Cesium$1.Cartographic.fromCartesian(t,n.globe.ellipsoid);return{lng:Cesium$1.Math.toDegrees(o.longitude),lat:Cesium$1.Math.toDegrees(o.latitude),height:o.height}},flyTo=(t,n,o)=>{if(!t||!n)return()=>{};const s=animateFOV({fov:n.fov,camera:t,duration:o==null?void 0:o.duration,easing:o==null?void 0:o.easing}),c=typeof n.lat=="number"&&typeof n.lng=="number"&&typeof n.height=="number"?Cesium$1.Cartesian3.fromDegrees(n.lng,n.lat,n.height):void 0;return c&&t.flyTo({destination:c,orientation:{heading:n.heading,pitch:n.pitch,roll:n.roll},duration:(o==null?void 0:o.duration)??0,easingFunction:o==null?void 0:o.easing}),()=>{s==null||s(),t==null||t.cancelFlight()}},lookAt=(t,n,o)=>{if(!t||!n)return()=>{};const s=animateFOV({fov:n.fov,camera:t,duration:o==null?void 0:o.duration,easing:o==null?void 0:o.easing}),c=typeof n.lat=="number"&&typeof n.lng=="number"&&typeof n.height=="number"?Cesium$1.Cartesian3.fromDegrees(n.lng,n.lat,n.height):void 0;return c&&t.flyToBoundingSphere(new Cesium$1.BoundingSphere(c,n.radius),{offset:n.heading!==void 0||n.pitch!==void 0||n.range!==void 0?new Cesium$1.HeadingPitchRange(n.heading,n.pitch,n.range):void 0,duration:o==null?void 0:o.duration,easingFunction:o==null?void 0:o.easing}),()=>{s==null||s(),t==null||t.cancelFlight()}},lookAtWithoutAnimation=(t,n)=>{if(!n)return;const o=typeof n.lat=="number"&&typeof n.lng=="number"?Cesium$1.Cartesian3.fromDegrees(n.lng,n.lat,n.height):void 0;o&&t.camera.lookAtTransform(Cesium$1.Matrix4.fromTranslation(o))},animateFOV=({fov:t,camera:n,easing:o,duration:s})=>{if(typeof t=="number"&&n.frustum instanceof Cesium$1.PerspectiveFrustum&&typeof n.frustum.fov=="number"&&n.frustum.fov!==t){const c=n.frustum.fov;return tweenInterval(d=>{n.frustum instanceof Cesium$1.PerspectiveFrustum&&(n.frustum.fov=(t-c)*d+c)},o||"inOutCubic",(s??0)*1e3)}},getCenterCamera=({camera:t,scene:n})=>{const o=new Cesium$1.Cartesian3,s=t.getPickRay(t.positionWC);if(s)return s.origin=t.positionWC,s.direction=t.directionWC,n.globe.pick(s,n,o)},zoom=({viewer:t,relativeAmount:n},o)=>{const{camera:s,scene:c}=t;if(c.mode!==Cesium$1.SceneMode.SCENE3D){const N=getCamera(t);flyTo(s,{...N,height:((N==null?void 0:N.height)||1)*n},{duration:.5});return}const h=getCenterCamera({camera:s,scene:c})||Cesium$1.IntersectionTests.grazingAltitudeLocation(new Cesium$1.Ray(c.globe.ellipsoid.cartographicToCartesian(s.positionCartographic),s.directionWC),c.globe.ellipsoid);if(!h)return;const p={heading:s.heading,pitch:s.pitch,roll:s.roll},y=new Cesium$1.Cartesian3,E=Cesium$1.Cartesian3.subtract(s.position,h,y),L=Cesium$1.Cartesian3.multiplyByScalar(E,n,E),F=Cesium$1.Cartesian3.add(h,L,h);s.flyTo({destination:F,orientation:p,duration:(o==null?void 0:o.duration)||.5,convert:!1})},getCamera=t=>{if(!t||t.isDestroyed()||!t.camera||!t.scene)return;const{camera:n}=t;if(!(n.frustum instanceof Cesium$1.PerspectiveFrustum||n.frustum instanceof Cesium$1.OrthographicOffCenterFrustum))return;const{latitude:o,longitude:s,height:c}=n.positionCartographic,d=Cesium$1.Math.toDegrees(o),h=Cesium$1.Math.toDegrees(s),{heading:p,pitch:y,roll:E}=n,L=n.frustum instanceof Cesium$1.PerspectiveFrustum?n.frustum.fov:1,F=n.frustum instanceof Cesium$1.PerspectiveFrustum?n.frustum.aspectRatio:1;return{lng:h,lat:d,height:c,heading:p,pitch:y,roll:E,fov:L,aspectRatio:F}},getClock=t=>{if(t)return{get start(){return Cesium$1.JulianDate.toDate(t.startTime)},get stop(){return Cesium$1.JulianDate.toDate(t.stopTime)},get current(){return Cesium$1.JulianDate.toDate(t.currentTime)},get playing(){return t.shouldAnimate},get speed(){return t.multiplier}}},colorBlendMode=t=>({highlight:Cesium$1.ColorBlendMode.HIGHLIGHT,replace:Cesium$1.ColorBlendMode.REPLACE,mix:Cesium$1.ColorBlendMode.MIX})[t||""],colorBlendModeFor3DTile=t=>({highlight:Cesium$1.Cesium3DTileColorBlendMode.HIGHLIGHT,replace:Cesium$1.Cesium3DTileColorBlendMode.REPLACE,mix:Cesium$1.Cesium3DTileColorBlendMode.MIX})[t||""],heightReference=t=>({clamp:Cesium$1.HeightReference.CLAMP_TO_GROUND,relative:Cesium$1.HeightReference.RELATIVE_TO_GROUND,none:Cesium$1.HeightReference.NONE})[t||""],getOverriddenScreenSpaceCameraOptions=t=>{if(!t)return;const n=new Map([["left_drag",Cesium$1.CameraEventType.LEFT_DRAG],["right_drag",Cesium$1.CameraEventType.RIGHT_DRAG],["middle_drag",Cesium$1.CameraEventType.MIDDLE_DRAG],["wheel",Cesium$1.CameraEventType.WHEEL],["pinch",Cesium$1.CameraEventType.PINCH]]),o=new Map([["ctrl",Cesium$1.KeyboardEventModifier.CTRL],["shift",Cesium$1.KeyboardEventModifier.SHIFT],["alt",Cesium$1.KeyboardEventModifier.ALT]]),s=E=>{if(E)return E.map(L=>typeof L=="string"?n.get(L):{eventType:n.get(L.eventType),modifier:o.get(L.modifier)})},c=s(t.translateEventTypes),d=s(t.zoomEventTypes),h=s(t.rotateEventTypes),p=s(t.tiltEventTypes),y=s(t.lookEventTypes);return{...DEFAULT_SCREEN_SPACE_CAMERA_ASSIGNMENTS,...c&&{translateEventTypes:c},...d&&{zoomEventTypes:d},...h&&{rotateEventTypes:h},...p&&{tiltEventTypes:p},...y&&{lookEventTypes:y},...t.minimumZoomDistance!==void 0&&{minimumZoomDistance:t.minimumZoomDistance},...t.maximumZoomDistance!==void 0&&{maximumZoomDistance:t.maximumZoomDistance},...t.enableCollisionDetection!==void 0&&{enableCollisionDetection:t.enableCollisionDetection}}},classificationType=t=>({both:Cesium$1.ClassificationType.BOTH,"3dtiles":Cesium$1.ClassificationType.CESIUM_3D_TILE,terrain:Cesium$1.ClassificationType.TERRAIN})[t||""],shadowMode=t=>({enabled:Cesium$1.ShadowMode.ENABLED,cast_only:Cesium$1.ShadowMode.CAST_ONLY,receive_only:Cesium$1.ShadowMode.RECEIVE_ONLY,disabled:Cesium$1.ShadowMode.DISABLED})[t||""],unselectableTag="reearth_unselectable",draggableTag="reearth_draggable";function isSelectable(t){var n;return!((n=t==null?void 0:t.properties)!=null&&n.hasProperty(unselectableTag))}function isDraggable(t){var n;return(n=t.properties)==null?void 0:n[draggableTag]}function lookHorizontal(t,n){const o=t.camera,c=t.globe.ellipsoid.geodeticSurfaceNormal(o.position,new Cesium$1.Cartesian3);o.look(c,n)}function lookVertical(t,n){const o=t.camera,s=t.globe.ellipsoid,c=projectVectorToSurface(o.right,o.position,s),d=s.geodeticSurfaceNormal(o.position,new Cesium$1.Cartesian3),h=Cesium$1.Math.toDegrees(Cesium$1.Cartesian3.angleBetween(d,o.up)),p=rotateVectorAboutAxis(o.up,c,n),E=Cesium$1.Math.toDegrees(Cesium$1.Cartesian3.angleBetween(d,p))<h?1:(90-h)/90;o.look(c,n*E)}function moveForward(t,n){const o=projectVectorToSurface(t.camera.direction,t.camera.position,t.globe.ellipsoid);t.camera.move(o,n)}function moveBackward(t,n){const o=projectVectorToSurface(t.camera.direction,t.camera.position,t.globe.ellipsoid);t.camera.move(o,-n)}function moveUp(t,n){const o=t.globe.ellipsoid.geodeticSurfaceNormal(t.camera.position,new Cesium$1.Cartesian3);t.camera.move(o,n)}function moveDown(t,n){const o=t.globe.ellipsoid.geodeticSurfaceNormal(t.camera.position,new Cesium$1.Cartesian3);t.camera.move(o,-n)}function moveLeft(t,n){const o=projectVectorToSurface(t.camera.right,t.camera.position,t.globe.ellipsoid);t.camera.move(o,-n)}function moveRight(t,n){const o=projectVectorToSurface(t.camera.right,t.camera.position,t.globe.ellipsoid);t.camera.move(o,n)}async function moveOverTerrain(t,n=0){const o=getCamera(t);if((o==null?void 0:o.lng)===void 0||(o==null?void 0:o.lat)===void 0)return;const s=await sampleTerrainHeight(t.scene,o.lng,o.lat);if(s&&s!==0){const c=getCamera(t);c&&(c==null?void 0:c.height)<s+n&&t.scene.camera.moveUp(s+n-c.height)}}async function flyToGround(t,n,o,s,c=0){var p,y;if(o.lng===void 0||o.lat===void 0)return;const d=await sampleTerrainHeight(t.scene,o.lng,o.lat),h=d?d+c:c;(p=n.current)==null||p.call(n),n.current=flyTo((y=t.scene)==null?void 0:y.camera,{...getCamera(t),...o,height:h},s)}function projectVectorToSurface(t,n,o){const s=o.geodeticSurfaceNormal(n,new Cesium$1.Cartesian3),c=Cesium$1.Cartesian3.dot(t,s),d=Cesium$1.Cartesian3.multiplyByScalar(s,c,new Cesium$1.Cartesian3);return Cesium$1.Cartesian3.subtract(t,d,new Cesium$1.Cartesian3)}function rotateVectorAboutAxis(t,n,o){const s=Cesium$1.Quaternion.fromAxisAngle(n,-o,new Cesium$1.Quaternion),c=Cesium$1.Matrix3.fromQuaternion(s,new Cesium$1.Matrix3);return Cesium$1.Matrix3.multiplyByVector(c,t,t.clone())}async function sampleTerrainHeight(t,n,o){const s=t.terrainProvider;if(s instanceof Cesium$1.EllipsoidTerrainProvider)return 0;const[c]=await Cesium$1.sampleTerrainMostDetailed(s,[Cesium$1.Cartographic.fromDegrees(n,o)]);return c.height}async function sampleTerrainHeightFromCartesian(t,n){const o=Cesium$1.Cartographic.fromCartesian(n),[s,c]=[Cesium$1.Math.toDegrees((o==null?void 0:o.longitude)||0),Cesium$1.Math.toDegrees((o==null?void 0:o.latitude)||0)];if(!(!s||!c))return await sampleTerrainHeight(t,s,c)}const isColor=t=>t==null?void 0:t.match(/^#[A-Fa-f0-9]|^rgba?/),toColor$1=t=>{if(!t||typeof t!="string")return;const n=t.match(/^#([A-Fa-f0-9]{6})([A-Fa-f0-9]{2})$|^#([A-Fa-f0-9]{3})([A-Fa-f0-9])$/);if(!n)return Cesium$1.Color.fromCssColorString(t);const o=parseInt(n[4]?n[4].repeat(2):n[2],16)/255;return Cesium$1.Color.fromCssColorString(`#${n[1]??n[3]}`).withAlpha(o)},updateMapController=(t,n)=>{t.scene.screenSpaceCameraController.enableTranslate=n,t.scene.screenSpaceCameraController.enableRotate=n,t.scene.screenSpaceCameraController.enableLook=n,t.scene.screenSpaceCameraController.enableTilt=n,t.scene.screenSpaceCameraController.enableZoom=n};function getExtrudedHeight(t,n,o){const s=new Cesium$1.Cartesian3,c=new Cesium$1.Cartesian3,d=new Cesium$1.Ray,h=new Cesium$1.Plane(Cesium$1.Cartesian3.UNIT_X,0),p=new Cesium$1.Cartographic;let y;try{const E=t.globe.ellipsoid.geodeticSurfaceNormal(n,c),L=t.camera.getPickRay(o,d);if(L==null)return;const F=Cesium$1.Plane.fromPointNormal(n,Cesium$1.Cartesian3.normalize(Cesium$1.Cartesian3.cross(E,Cesium$1.Cartesian3.cross(E,L.direction,s),s),s),h);if(y=Cesium$1.IntersectionTests.rayPlane(L,F,s),y==null)return;const N=Cesium$1.Cartographic.fromCartesian(y,t.globe.ellipsoid,p).height,z=Cesium$1.Cartographic.fromCartesian(n,t.globe.ellipsoid,p).height;return Math.max(0,N-z)}catch(E){console.error(E)}}function Globe({property:t,cesiumIonAccessToken:n}){var d,h,p,y,E,L,F,N,z,oe,W,nt,lt,Ee,yt,Ai,zi,ha,ba,Sa,ya,ms;const o=React.useMemo(()=>({...t==null?void 0:t.terrain}),[t==null?void 0:t.terrain]),s=React.useMemo(()=>{var pi,mt,fa,Ra,sl,Zd,Xd,pu,gl;const Wc={terrain:o==null?void 0:o.enabled,terrainType:o==null?void 0:o.type,normal:o==null?void 0:o.normal,ionAccessToken:((fa=(mt=(pi=t==null?void 0:t.assets)==null?void 0:pi.cesium)==null?void 0:mt.terrain)==null?void 0:fa.ionAccessToken)||n,ionAsset:(Zd=(sl=(Ra=t==null?void 0:t.assets)==null?void 0:Ra.cesium)==null?void 0:sl.terrain)==null?void 0:Zd.ionAsset,ionUrl:(gl=(pu=(Xd=t==null?void 0:t.assets)==null?void 0:Xd.cesium)==null?void 0:pu.terrain)==null?void 0:gl.ionUrl},Wa=Wc.terrain?terrainProviders[Wc.terrainType||"cesium"]:void 0;return(typeof Wa=="function"?Wa(Wc):Wa)??defaultTerrainProvider},[o==null?void 0:o.enabled,o==null?void 0:o.type,o==null?void 0:o.normal,(p=(h=(d=t==null?void 0:t.assets)==null?void 0:d.cesium)==null?void 0:h.terrain)==null?void 0:p.ionAccessToken,(L=(E=(y=t==null?void 0:t.assets)==null?void 0:y.cesium)==null?void 0:E.terrain)==null?void 0:L.ionAsset,(z=(N=(F=t==null?void 0:t.assets)==null?void 0:F.cesium)==null?void 0:N.terrain)==null?void 0:z.ionUrl,n]),c=React.useMemo(()=>{var Wc;return toColor$1((Wc=t==null?void 0:t.globe)==null?void 0:Wc.baseColor)},[(oe=t==null?void 0:t.globe)==null?void 0:oe.baseColor]);return jsxRuntimeExports.jsx(js$1,{baseColor:c,enableLighting:!!((W=t==null?void 0:t.globe)!=null&&W.enableLighting),showGroundAtmosphere:((lt=(nt=t==null?void 0:t.globe)==null?void 0:nt.atmosphere)==null?void 0:lt.enabled)??!0,atmosphereLightIntensity:(yt=(Ee=t==null?void 0:t.globe)==null?void 0:Ee.atmosphere)==null?void 0:yt.lightIntensity,atmosphereSaturationShift:(zi=(Ai=t==null?void 0:t.globe)==null?void 0:Ai.atmosphere)==null?void 0:zi.saturationShift,atmosphereHueShift:(ba=(ha=t==null?void 0:t.globe)==null?void 0:ha.atmosphere)==null?void 0:ba.hueShift,atmosphereBrightnessShift:(ya=(Sa=t==null?void 0:t.globe)==null?void 0:Sa.atmosphere)==null?void 0:ya.brightnessShift,terrainProvider:s,depthTestAgainstTerrain:!!((ms=t==null?void 0:t.globe)!=null&&ms.depthTestAgainstTerrain)})}const defaultTerrainProvider=new Cesium$1.EllipsoidTerrainProvider,terrainProviders={cesium:({ionAccessToken:t,normal:n})=>Cesium$1.CesiumTerrainProvider.fromUrl(Cesium$1.IonResource.fromAssetId(1,{accessToken:t}),{requestVertexNormals:n,requestWaterMask:!1}),arcgis:()=>Cesium$1.ArcGISTiledElevationTerrainProvider.fromUrl("https://elevation3d.arcgis.com/arcgis/rest/services/WorldElevation3D/Terrain3D/ImageServer"),cesiumion:({ionAccessToken:t,ionAsset:n,ionUrl:o,normal:s})=>n?Cesium$1.CesiumTerrainProvider.fromUrl(o||Cesium$1.IonResource.fromAssetId(parseInt(n,10),{accessToken:t}),{requestVertexNormals:s}):null};function defined(t){return t!=null}function DeveloperError(t){this.name="DeveloperError",this.message=t;let n;try{throw new Error}catch(o){n=o.stack}this.stack=n}defined(Object.create)&&(DeveloperError.prototype=Object.create(Error.prototype),DeveloperError.prototype.constructor=DeveloperError),DeveloperError.prototype.toString=function(){let t=`${this.name}: ${this.message}`;return defined(this.stack)&&(t+=`
|
|
125
125
|
${this.stack.toString()}`),t},DeveloperError.throwInstantiationError=function(){throw new DeveloperError("This function defines an interface and should not be called directly.")};const Check={};Check.typeOf={};function getUndefinedErrorMessage(t){return`${t} is required, actual value was undefined`}function getFailedTypeErrorMessage(t,n,o){return`Expected ${o} to be typeof ${n}, actual typeof was ${t}`}Check.defined=function(t,n){if(!defined(n))throw new DeveloperError(getUndefinedErrorMessage(t))},Check.typeOf.func=function(t,n){if(typeof n!="function")throw new DeveloperError(getFailedTypeErrorMessage(typeof n,"function",t))},Check.typeOf.string=function(t,n){if(typeof n!="string")throw new DeveloperError(getFailedTypeErrorMessage(typeof n,"string",t))},Check.typeOf.number=function(t,n){if(typeof n!="number")throw new DeveloperError(getFailedTypeErrorMessage(typeof n,"number",t))},Check.typeOf.number.lessThan=function(t,n,o){if(Check.typeOf.number(t,n),n>=o)throw new DeveloperError(`Expected ${t} to be less than ${o}, actual value was ${n}`)},Check.typeOf.number.lessThanOrEquals=function(t,n,o){if(Check.typeOf.number(t,n),n>o)throw new DeveloperError(`Expected ${t} to be less than or equal to ${o}, actual value was ${n}`)},Check.typeOf.number.greaterThan=function(t,n,o){if(Check.typeOf.number(t,n),n<=o)throw new DeveloperError(`Expected ${t} to be greater than ${o}, actual value was ${n}`)},Check.typeOf.number.greaterThanOrEquals=function(t,n,o){if(Check.typeOf.number(t,n),n<o)throw new DeveloperError(`Expected ${t} to be greater than or equal to ${o}, actual value was ${n}`)},Check.typeOf.object=function(t,n){if(typeof n!="object")throw new DeveloperError(getFailedTypeErrorMessage(typeof n,"object",t))},Check.typeOf.bool=function(t,n){if(typeof n!="boolean")throw new DeveloperError(getFailedTypeErrorMessage(typeof n,"boolean",t))},Check.typeOf.bigint=function(t,n){if(typeof n!="bigint")throw new DeveloperError(getFailedTypeErrorMessage(typeof n,"bigint",t))},Check.typeOf.number.equals=function(t,n,o,s){if(Check.typeOf.number(t,o),Check.typeOf.number(n,s),o!==s)throw new DeveloperError(`${t} must be equal to ${n}, the actual values are ${o} and ${s}`)};function defaultValue(t,n){return t??n}defaultValue.EMPTY_OBJECT=Object.freeze({});var MersenneTwister=function(t){t==null&&(t=new Date().getTime()),this.N=624,this.M=397,this.MATRIX_A=2567483615,this.UPPER_MASK=2147483648,this.LOWER_MASK=2147483647,this.mt=new Array(this.N),this.mti=this.N+1,t.constructor==Array?this.init_by_array(t,t.length):this.init_seed(t)};MersenneTwister.prototype.init_seed=function(t){for(this.mt[0]=t>>>0,this.mti=1;this.mti<this.N;this.mti++){var t=this.mt[this.mti-1]^this.mt[this.mti-1]>>>30;this.mt[this.mti]=(((t&4294901760)>>>16)*1812433253<<16)+(t&65535)*1812433253+this.mti,this.mt[this.mti]>>>=0}},MersenneTwister.prototype.init_by_array=function(t,n){var o,s,c;for(this.init_seed(19650218),o=1,s=0,c=this.N>n?this.N:n;c;c--){var d=this.mt[o-1]^this.mt[o-1]>>>30;this.mt[o]=(this.mt[o]^(((d&4294901760)>>>16)*1664525<<16)+(d&65535)*1664525)+t[s]+s,this.mt[o]>>>=0,o++,s++,o>=this.N&&(this.mt[0]=this.mt[this.N-1],o=1),s>=n&&(s=0)}for(c=this.N-1;c;c--){var d=this.mt[o-1]^this.mt[o-1]>>>30;this.mt[o]=(this.mt[o]^(((d&4294901760)>>>16)*1566083941<<16)+(d&65535)*1566083941)-o,this.mt[o]>>>=0,o++,o>=this.N&&(this.mt[0]=this.mt[this.N-1],o=1)}this.mt[0]=2147483648},MersenneTwister.prototype.random_int=function(){var t,n=new Array(0,this.MATRIX_A);if(this.mti>=this.N){var o;for(this.mti==this.N+1&&this.init_seed(5489),o=0;o<this.N-this.M;o++)t=this.mt[o]&this.UPPER_MASK|this.mt[o+1]&this.LOWER_MASK,this.mt[o]=this.mt[o+this.M]^t>>>1^n[t&1];for(;o<this.N-1;o++)t=this.mt[o]&this.UPPER_MASK|this.mt[o+1]&this.LOWER_MASK,this.mt[o]=this.mt[o+(this.M-this.N)]^t>>>1^n[t&1];t=this.mt[this.N-1]&this.UPPER_MASK|this.mt[0]&this.LOWER_MASK,this.mt[this.N-1]=this.mt[this.M-1]^t>>>1^n[t&1],this.mti=0}return t=this.mt[this.mti++],t^=t>>>11,t^=t<<7&2636928640,t^=t<<15&4022730752,t^=t>>>18,t>>>0},MersenneTwister.prototype.random_int31=function(){return this.random_int()>>>1},MersenneTwister.prototype.random_incl=function(){return this.random_int()*(1/4294967295)},MersenneTwister.prototype.random=function(){return this.random_int()*(1/4294967296)},MersenneTwister.prototype.random_excl=function(){return(this.random_int()+.5)*(1/4294967296)},MersenneTwister.prototype.random_long=function(){var t=this.random_int()>>>5,n=this.random_int()>>>6;return(t*67108864+n)*(1/9007199254740992)};var mersenneTwister=MersenneTwister;const MersenneTwister$1=getDefaultExportFromCjs(mersenneTwister),CesiumMath={};CesiumMath.EPSILON1=.1,CesiumMath.EPSILON2=.01,CesiumMath.EPSILON3=.001,CesiumMath.EPSILON4=1e-4,CesiumMath.EPSILON5=1e-5,CesiumMath.EPSILON6=1e-6,CesiumMath.EPSILON7=1e-7,CesiumMath.EPSILON8=1e-8,CesiumMath.EPSILON9=1e-9,CesiumMath.EPSILON10=1e-10,CesiumMath.EPSILON11=1e-11,CesiumMath.EPSILON12=1e-12,CesiumMath.EPSILON13=1e-13,CesiumMath.EPSILON14=1e-14,CesiumMath.EPSILON15=1e-15,CesiumMath.EPSILON16=1e-16,CesiumMath.EPSILON17=1e-17,CesiumMath.EPSILON18=1e-18,CesiumMath.EPSILON19=1e-19,CesiumMath.EPSILON20=1e-20,CesiumMath.EPSILON21=1e-21,CesiumMath.GRAVITATIONALPARAMETER=3986004418e5,CesiumMath.SOLAR_RADIUS=6955e5,CesiumMath.LUNAR_RADIUS=1737400,CesiumMath.SIXTY_FOUR_KILOBYTES=64*1024,CesiumMath.FOUR_GIGABYTES=4*1024*1024*1024,CesiumMath.sign=defaultValue(Math.sign,function(n){return n=+n,n===0||n!==n?n:n>0?1:-1}),CesiumMath.signNotZero=function(t){return t<0?-1:1},CesiumMath.toSNorm=function(t,n){return n=defaultValue(n,255),Math.round((CesiumMath.clamp(t,-1,1)*.5+.5)*n)},CesiumMath.fromSNorm=function(t,n){return n=defaultValue(n,255),CesiumMath.clamp(t,0,n)/n*2-1},CesiumMath.normalize=function(t,n,o){return o=Math.max(o-n,0),o===0?0:CesiumMath.clamp((t-n)/o,0,1)},CesiumMath.sinh=defaultValue(Math.sinh,function(n){return(Math.exp(n)-Math.exp(-n))/2}),CesiumMath.cosh=defaultValue(Math.cosh,function(n){return(Math.exp(n)+Math.exp(-n))/2}),CesiumMath.lerp=function(t,n,o){return(1-o)*t+o*n},CesiumMath.PI=Math.PI,CesiumMath.ONE_OVER_PI=1/Math.PI,CesiumMath.PI_OVER_TWO=Math.PI/2,CesiumMath.PI_OVER_THREE=Math.PI/3,CesiumMath.PI_OVER_FOUR=Math.PI/4,CesiumMath.PI_OVER_SIX=Math.PI/6,CesiumMath.THREE_PI_OVER_TWO=3*Math.PI/2,CesiumMath.TWO_PI=2*Math.PI,CesiumMath.ONE_OVER_TWO_PI=1/(2*Math.PI),CesiumMath.RADIANS_PER_DEGREE=Math.PI/180,CesiumMath.DEGREES_PER_RADIAN=180/Math.PI,CesiumMath.RADIANS_PER_ARCSECOND=CesiumMath.RADIANS_PER_DEGREE/3600,CesiumMath.toRadians=function(t){if(!defined(t))throw new DeveloperError("degrees is required.");return t*CesiumMath.RADIANS_PER_DEGREE},CesiumMath.toDegrees=function(t){if(!defined(t))throw new DeveloperError("radians is required.");return t*CesiumMath.DEGREES_PER_RADIAN},CesiumMath.convertLongitudeRange=function(t){if(!defined(t))throw new DeveloperError("angle is required.");const n=CesiumMath.TWO_PI,o=t-Math.floor(t/n)*n;return o<-Math.PI?o+n:o>=Math.PI?o-n:o},CesiumMath.clampToLatitudeRange=function(t){if(!defined(t))throw new DeveloperError("angle is required.");return CesiumMath.clamp(t,-1*CesiumMath.PI_OVER_TWO,CesiumMath.PI_OVER_TWO)},CesiumMath.negativePiToPi=function(t){if(!defined(t))throw new DeveloperError("angle is required.");return t>=-CesiumMath.PI&&t<=CesiumMath.PI?t:CesiumMath.zeroToTwoPi(t+CesiumMath.PI)-CesiumMath.PI},CesiumMath.zeroToTwoPi=function(t){if(!defined(t))throw new DeveloperError("angle is required.");if(t>=0&&t<=CesiumMath.TWO_PI)return t;const n=CesiumMath.mod(t,CesiumMath.TWO_PI);return Math.abs(n)<CesiumMath.EPSILON14&&Math.abs(t)>CesiumMath.EPSILON14?CesiumMath.TWO_PI:n},CesiumMath.mod=function(t,n){if(!defined(t))throw new DeveloperError("m is required.");if(!defined(n))throw new DeveloperError("n is required.");if(n===0)throw new DeveloperError("divisor cannot be 0.");return CesiumMath.sign(t)===CesiumMath.sign(n)&&Math.abs(t)<Math.abs(n)?t:(t%n+n)%n},CesiumMath.equalsEpsilon=function(t,n,o,s){if(!defined(t))throw new DeveloperError("left is required.");if(!defined(n))throw new DeveloperError("right is required.");o=defaultValue(o,0),s=defaultValue(s,o);const c=Math.abs(t-n);return c<=s||c<=o*Math.max(Math.abs(t),Math.abs(n))},CesiumMath.lessThan=function(t,n,o){if(!defined(t))throw new DeveloperError("first is required.");if(!defined(n))throw new DeveloperError("second is required.");if(!defined(o))throw new DeveloperError("absoluteEpsilon is required.");return t-n<-o},CesiumMath.lessThanOrEquals=function(t,n,o){if(!defined(t))throw new DeveloperError("first is required.");if(!defined(n))throw new DeveloperError("second is required.");if(!defined(o))throw new DeveloperError("absoluteEpsilon is required.");return t-n<o},CesiumMath.greaterThan=function(t,n,o){if(!defined(t))throw new DeveloperError("first is required.");if(!defined(n))throw new DeveloperError("second is required.");if(!defined(o))throw new DeveloperError("absoluteEpsilon is required.");return t-n>o},CesiumMath.greaterThanOrEquals=function(t,n,o){if(!defined(t))throw new DeveloperError("first is required.");if(!defined(n))throw new DeveloperError("second is required.");if(!defined(o))throw new DeveloperError("absoluteEpsilon is required.");return t-n>-o};const factorials=[1];CesiumMath.factorial=function(t){if(typeof t!="number"||t<0)throw new DeveloperError("A number greater than or equal to 0 is required.");const n=factorials.length;if(t>=n){let o=factorials[n-1];for(let s=n;s<=t;s++){const c=o*s;factorials.push(c),o=c}}return factorials[t]},CesiumMath.incrementWrap=function(t,n,o){if(o=defaultValue(o,0),!defined(t))throw new DeveloperError("n is required.");if(n<=o)throw new DeveloperError("maximumValue must be greater than minimumValue.");return++t,t>n&&(t=o),t},CesiumMath.isPowerOfTwo=function(t){if(typeof t!="number"||t<0||t>4294967295)throw new DeveloperError("A number between 0 and (2^32)-1 is required.");return t!==0&&(t&t-1)===0},CesiumMath.nextPowerOfTwo=function(t){if(typeof t!="number"||t<0||t>2147483648)throw new DeveloperError("A number between 0 and 2^31 is required.");return--t,t|=t>>1,t|=t>>2,t|=t>>4,t|=t>>8,t|=t>>16,++t,t},CesiumMath.previousPowerOfTwo=function(t){if(typeof t!="number"||t<0||t>4294967295)throw new DeveloperError("A number between 0 and (2^32)-1 is required.");return t|=t>>1,t|=t>>2,t|=t>>4,t|=t>>8,t|=t>>16,t|=t>>32,t=(t>>>0)-(t>>>1),t},CesiumMath.clamp=function(t,n,o){return Check.typeOf.number("value",t),Check.typeOf.number("min",n),Check.typeOf.number("max",o),t<n?n:t>o?o:t};let randomNumberGenerator=new MersenneTwister$1;CesiumMath.setRandomNumberSeed=function(t){if(!defined(t))throw new DeveloperError("seed is required.");randomNumberGenerator=new MersenneTwister$1(t)},CesiumMath.nextRandomNumber=function(){return randomNumberGenerator.random()},CesiumMath.randomBetween=function(t,n){return CesiumMath.nextRandomNumber()*(n-t)+t},CesiumMath.acosClamped=function(t){if(!defined(t))throw new DeveloperError("value is required.");return Math.acos(CesiumMath.clamp(t,-1,1))},CesiumMath.asinClamped=function(t){if(!defined(t))throw new DeveloperError("value is required.");return Math.asin(CesiumMath.clamp(t,-1,1))},CesiumMath.chordLength=function(t,n){if(!defined(t))throw new DeveloperError("angle is required.");if(!defined(n))throw new DeveloperError("radius is required.");return 2*n*Math.sin(t*.5)},CesiumMath.logBase=function(t,n){if(!defined(t))throw new DeveloperError("number is required.");if(!defined(n))throw new DeveloperError("base is required.");return Math.log(t)/Math.log(n)},CesiumMath.cbrt=defaultValue(Math.cbrt,function(n){const o=Math.pow(Math.abs(n),.3333333333333333);return n<0?-o:o}),CesiumMath.log2=defaultValue(Math.log2,function(n){return Math.log(n)*Math.LOG2E}),CesiumMath.fog=function(t,n){const o=t*n;return 1-Math.exp(-(o*o))},CesiumMath.fastApproximateAtan=function(t){return Check.typeOf.number("x",t),t*(-.1784*Math.abs(t)-.0663*t*t+1.0301)},CesiumMath.fastApproximateAtan2=function(t,n){Check.typeOf.number("x",t),Check.typeOf.number("y",n);let o,s=Math.abs(t);o=Math.abs(n);const c=Math.max(s,o);o=Math.min(s,o);const d=o/c;if(isNaN(d))throw new DeveloperError("either x or y must be nonzero");return s=CesiumMath.fastApproximateAtan(d),s=Math.abs(n)>Math.abs(t)?CesiumMath.PI_OVER_TWO-s:s,s=t<0?CesiumMath.PI-s:s,s=n<0?-s:s,s};function Cartesian3(t,n,o){this.x=defaultValue(t,0),this.y=defaultValue(n,0),this.z=defaultValue(o,0)}Cartesian3.fromSpherical=function(t,n){Check.typeOf.object("spherical",t),defined(n)||(n=new Cartesian3);const o=t.clock,s=t.cone,c=defaultValue(t.magnitude,1),d=c*Math.sin(s);return n.x=d*Math.cos(o),n.y=d*Math.sin(o),n.z=c*Math.cos(s),n},Cartesian3.fromElements=function(t,n,o,s){return defined(s)?(s.x=t,s.y=n,s.z=o,s):new Cartesian3(t,n,o)},Cartesian3.clone=function(t,n){if(defined(t))return defined(n)?(n.x=t.x,n.y=t.y,n.z=t.z,n):new Cartesian3(t.x,t.y,t.z)},Cartesian3.fromCartesian4=Cartesian3.clone,Cartesian3.packedLength=3,Cartesian3.pack=function(t,n,o){return Check.typeOf.object("value",t),Check.defined("array",n),o=defaultValue(o,0),n[o++]=t.x,n[o++]=t.y,n[o]=t.z,n},Cartesian3.unpack=function(t,n,o){return Check.defined("array",t),n=defaultValue(n,0),defined(o)||(o=new Cartesian3),o.x=t[n++],o.y=t[n++],o.z=t[n],o},Cartesian3.packArray=function(t,n){Check.defined("array",t);const o=t.length,s=o*3;if(!defined(n))n=new Array(s);else{if(!Array.isArray(n)&&n.length!==s)throw new DeveloperError("If result is a typed array, it must have exactly array.length * 3 elements");n.length!==s&&(n.length=s)}for(let c=0;c<o;++c)Cartesian3.pack(t[c],n,c*3);return n},Cartesian3.unpackArray=function(t,n){if(Check.defined("array",t),Check.typeOf.number.greaterThanOrEquals("array.length",t.length,3),t.length%3!==0)throw new DeveloperError("array length must be a multiple of 3.");const o=t.length;defined(n)?n.length=o/3:n=new Array(o/3);for(let s=0;s<o;s+=3){const c=s/3;n[c]=Cartesian3.unpack(t,s,n[c])}return n},Cartesian3.fromArray=Cartesian3.unpack,Cartesian3.maximumComponent=function(t){return Check.typeOf.object("cartesian",t),Math.max(t.x,t.y,t.z)},Cartesian3.minimumComponent=function(t){return Check.typeOf.object("cartesian",t),Math.min(t.x,t.y,t.z)},Cartesian3.minimumByComponent=function(t,n,o){return Check.typeOf.object("first",t),Check.typeOf.object("second",n),Check.typeOf.object("result",o),o.x=Math.min(t.x,n.x),o.y=Math.min(t.y,n.y),o.z=Math.min(t.z,n.z),o},Cartesian3.maximumByComponent=function(t,n,o){return Check.typeOf.object("first",t),Check.typeOf.object("second",n),Check.typeOf.object("result",o),o.x=Math.max(t.x,n.x),o.y=Math.max(t.y,n.y),o.z=Math.max(t.z,n.z),o},Cartesian3.clamp=function(t,n,o,s){Check.typeOf.object("value",t),Check.typeOf.object("min",n),Check.typeOf.object("max",o),Check.typeOf.object("result",s);const c=CesiumMath.clamp(t.x,n.x,o.x),d=CesiumMath.clamp(t.y,n.y,o.y),h=CesiumMath.clamp(t.z,n.z,o.z);return s.x=c,s.y=d,s.z=h,s},Cartesian3.magnitudeSquared=function(t){return Check.typeOf.object("cartesian",t),t.x*t.x+t.y*t.y+t.z*t.z},Cartesian3.magnitude=function(t){return Math.sqrt(Cartesian3.magnitudeSquared(t))};const distanceScratch$2=new Cartesian3;Cartesian3.distance=function(t,n){return Check.typeOf.object("left",t),Check.typeOf.object("right",n),Cartesian3.subtract(t,n,distanceScratch$2),Cartesian3.magnitude(distanceScratch$2)},Cartesian3.distanceSquared=function(t,n){return Check.typeOf.object("left",t),Check.typeOf.object("right",n),Cartesian3.subtract(t,n,distanceScratch$2),Cartesian3.magnitudeSquared(distanceScratch$2)},Cartesian3.normalize=function(t,n){Check.typeOf.object("cartesian",t),Check.typeOf.object("result",n);const o=Cartesian3.magnitude(t);if(n.x=t.x/o,n.y=t.y/o,n.z=t.z/o,isNaN(n.x)||isNaN(n.y)||isNaN(n.z))throw new DeveloperError("normalized result is not a number");return n},Cartesian3.dot=function(t,n){return Check.typeOf.object("left",t),Check.typeOf.object("right",n),t.x*n.x+t.y*n.y+t.z*n.z},Cartesian3.multiplyComponents=function(t,n,o){return Check.typeOf.object("left",t),Check.typeOf.object("right",n),Check.typeOf.object("result",o),o.x=t.x*n.x,o.y=t.y*n.y,o.z=t.z*n.z,o},Cartesian3.divideComponents=function(t,n,o){return Check.typeOf.object("left",t),Check.typeOf.object("right",n),Check.typeOf.object("result",o),o.x=t.x/n.x,o.y=t.y/n.y,o.z=t.z/n.z,o},Cartesian3.add=function(t,n,o){return Check.typeOf.object("left",t),Check.typeOf.object("right",n),Check.typeOf.object("result",o),o.x=t.x+n.x,o.y=t.y+n.y,o.z=t.z+n.z,o},Cartesian3.subtract=function(t,n,o){return Check.typeOf.object("left",t),Check.typeOf.object("right",n),Check.typeOf.object("result",o),o.x=t.x-n.x,o.y=t.y-n.y,o.z=t.z-n.z,o},Cartesian3.multiplyByScalar=function(t,n,o){return Check.typeOf.object("cartesian",t),Check.typeOf.number("scalar",n),Check.typeOf.object("result",o),o.x=t.x*n,o.y=t.y*n,o.z=t.z*n,o},Cartesian3.divideByScalar=function(t,n,o){return Check.typeOf.object("cartesian",t),Check.typeOf.number("scalar",n),Check.typeOf.object("result",o),o.x=t.x/n,o.y=t.y/n,o.z=t.z/n,o},Cartesian3.negate=function(t,n){return Check.typeOf.object("cartesian",t),Check.typeOf.object("result",n),n.x=-t.x,n.y=-t.y,n.z=-t.z,n},Cartesian3.abs=function(t,n){return Check.typeOf.object("cartesian",t),Check.typeOf.object("result",n),n.x=Math.abs(t.x),n.y=Math.abs(t.y),n.z=Math.abs(t.z),n};const lerpScratch$3=new Cartesian3;Cartesian3.lerp=function(t,n,o,s){return Check.typeOf.object("start",t),Check.typeOf.object("end",n),Check.typeOf.number("t",o),Check.typeOf.object("result",s),Cartesian3.multiplyByScalar(n,o,lerpScratch$3),s=Cartesian3.multiplyByScalar(t,1-o,s),Cartesian3.add(lerpScratch$3,s,s)};const angleBetweenScratch$1=new Cartesian3,angleBetweenScratch2$1=new Cartesian3;Cartesian3.angleBetween=function(t,n){Check.typeOf.object("left",t),Check.typeOf.object("right",n),Cartesian3.normalize(t,angleBetweenScratch$1),Cartesian3.normalize(n,angleBetweenScratch2$1);const o=Cartesian3.dot(angleBetweenScratch$1,angleBetweenScratch2$1),s=Cartesian3.magnitude(Cartesian3.cross(angleBetweenScratch$1,angleBetweenScratch2$1,angleBetweenScratch$1));return Math.atan2(s,o)};const mostOrthogonalAxisScratch$2=new Cartesian3;Cartesian3.mostOrthogonalAxis=function(t,n){Check.typeOf.object("cartesian",t),Check.typeOf.object("result",n);const o=Cartesian3.normalize(t,mostOrthogonalAxisScratch$2);return Cartesian3.abs(o,o),o.x<=o.y?o.x<=o.z?n=Cartesian3.clone(Cartesian3.UNIT_X,n):n=Cartesian3.clone(Cartesian3.UNIT_Z,n):o.y<=o.z?n=Cartesian3.clone(Cartesian3.UNIT_Y,n):n=Cartesian3.clone(Cartesian3.UNIT_Z,n),n},Cartesian3.projectVector=function(t,n,o){Check.defined("a",t),Check.defined("b",n),Check.defined("result",o);const s=Cartesian3.dot(t,n)/Cartesian3.dot(n,n);return Cartesian3.multiplyByScalar(n,s,o)},Cartesian3.equals=function(t,n){return t===n||defined(t)&&defined(n)&&t.x===n.x&&t.y===n.y&&t.z===n.z},Cartesian3.equalsArray=function(t,n,o){return t.x===n[o]&&t.y===n[o+1]&&t.z===n[o+2]},Cartesian3.equalsEpsilon=function(t,n,o,s){return t===n||defined(t)&&defined(n)&&CesiumMath.equalsEpsilon(t.x,n.x,o,s)&&CesiumMath.equalsEpsilon(t.y,n.y,o,s)&&CesiumMath.equalsEpsilon(t.z,n.z,o,s)},Cartesian3.cross=function(t,n,o){Check.typeOf.object("left",t),Check.typeOf.object("right",n),Check.typeOf.object("result",o);const s=t.x,c=t.y,d=t.z,h=n.x,p=n.y,y=n.z,E=c*y-d*p,L=d*h-s*y,F=s*p-c*h;return o.x=E,o.y=L,o.z=F,o},Cartesian3.midpoint=function(t,n,o){return Check.typeOf.object("left",t),Check.typeOf.object("right",n),Check.typeOf.object("result",o),o.x=(t.x+n.x)*.5,o.y=(t.y+n.y)*.5,o.z=(t.z+n.z)*.5,o},Cartesian3.fromDegrees=function(t,n,o,s,c){return Check.typeOf.number("longitude",t),Check.typeOf.number("latitude",n),t=CesiumMath.toRadians(t),n=CesiumMath.toRadians(n),Cartesian3.fromRadians(t,n,o,s,c)};let scratchN=new Cartesian3,scratchK=new Cartesian3;const wgs84RadiiSquared=new Cartesian3(6378137*6378137,6378137*6378137,6356752314245179e-9*6356752314245179e-9);Cartesian3.fromRadians=function(t,n,o,s,c){Check.typeOf.number("longitude",t),Check.typeOf.number("latitude",n),o=defaultValue(o,0);const d=defined(s)?s.radiiSquared:wgs84RadiiSquared,h=Math.cos(n);scratchN.x=h*Math.cos(t),scratchN.y=h*Math.sin(t),scratchN.z=Math.sin(n),scratchN=Cartesian3.normalize(scratchN,scratchN),Cartesian3.multiplyComponents(d,scratchN,scratchK);const p=Math.sqrt(Cartesian3.dot(scratchN,scratchK));return scratchK=Cartesian3.divideByScalar(scratchK,p,scratchK),scratchN=Cartesian3.multiplyByScalar(scratchN,o,scratchN),defined(c)||(c=new Cartesian3),Cartesian3.add(scratchK,scratchN,c)},Cartesian3.fromDegreesArray=function(t,n,o){if(Check.defined("coordinates",t),t.length<2||t.length%2!==0)throw new DeveloperError("the number of coordinates must be a multiple of 2 and at least 2");const s=t.length;defined(o)?o.length=s/2:o=new Array(s/2);for(let c=0;c<s;c+=2){const d=t[c],h=t[c+1],p=c/2;o[p]=Cartesian3.fromDegrees(d,h,0,n,o[p])}return o},Cartesian3.fromRadiansArray=function(t,n,o){if(Check.defined("coordinates",t),t.length<2||t.length%2!==0)throw new DeveloperError("the number of coordinates must be a multiple of 2 and at least 2");const s=t.length;defined(o)?o.length=s/2:o=new Array(s/2);for(let c=0;c<s;c+=2){const d=t[c],h=t[c+1],p=c/2;o[p]=Cartesian3.fromRadians(d,h,0,n,o[p])}return o},Cartesian3.fromDegreesArrayHeights=function(t,n,o){if(Check.defined("coordinates",t),t.length<3||t.length%3!==0)throw new DeveloperError("the number of coordinates must be a multiple of 3 and at least 3");const s=t.length;defined(o)?o.length=s/3:o=new Array(s/3);for(let c=0;c<s;c+=3){const d=t[c],h=t[c+1],p=t[c+2],y=c/3;o[y]=Cartesian3.fromDegrees(d,h,p,n,o[y])}return o},Cartesian3.fromRadiansArrayHeights=function(t,n,o){if(Check.defined("coordinates",t),t.length<3||t.length%3!==0)throw new DeveloperError("the number of coordinates must be a multiple of 3 and at least 3");const s=t.length;defined(o)?o.length=s/3:o=new Array(s/3);for(let c=0;c<s;c+=3){const d=t[c],h=t[c+1],p=t[c+2],y=c/3;o[y]=Cartesian3.fromRadians(d,h,p,n,o[y])}return o},Cartesian3.ZERO=Object.freeze(new Cartesian3(0,0,0)),Cartesian3.ONE=Object.freeze(new Cartesian3(1,1,1)),Cartesian3.UNIT_X=Object.freeze(new Cartesian3(1,0,0)),Cartesian3.UNIT_Y=Object.freeze(new Cartesian3(0,1,0)),Cartesian3.UNIT_Z=Object.freeze(new Cartesian3(0,0,1)),Cartesian3.prototype.clone=function(t){return Cartesian3.clone(this,t)},Cartesian3.prototype.equals=function(t){return Cartesian3.equals(this,t)},Cartesian3.prototype.equalsEpsilon=function(t,n,o){return Cartesian3.equalsEpsilon(this,t,n,o)},Cartesian3.prototype.toString=function(){return`(${this.x}, ${this.y}, ${this.z})`};const scaleToGeodeticSurfaceIntersection=new Cartesian3,scaleToGeodeticSurfaceGradient=new Cartesian3;function scaleToGeodeticSurface(t,n,o,s,c){if(!defined(t))throw new DeveloperError("cartesian is required.");if(!defined(n))throw new DeveloperError("oneOverRadii is required.");if(!defined(o))throw new DeveloperError("oneOverRadiiSquared is required.");if(!defined(s))throw new DeveloperError("centerToleranceSquared is required.");const d=t.x,h=t.y,p=t.z,y=n.x,E=n.y,L=n.z,F=d*d*y*y,N=h*h*E*E,z=p*p*L*L,oe=F+N+z,W=Math.sqrt(1/oe),nt=Cartesian3.multiplyByScalar(t,W,scaleToGeodeticSurfaceIntersection);if(oe<s)return isFinite(W)?Cartesian3.clone(nt,c):void 0;const lt=o.x,Ee=o.y,yt=o.z,Ai=scaleToGeodeticSurfaceGradient;Ai.x=nt.x*lt*2,Ai.y=nt.y*Ee*2,Ai.z=nt.z*yt*2;let zi=(1-W)*Cartesian3.magnitude(t)/(.5*Cartesian3.magnitude(Ai)),ha=0,ba,Sa,ya,ms,Wc,Wa,pi,mt,fa,Ra,sl;do{zi-=ha,ya=1/(1+zi*lt),ms=1/(1+zi*Ee),Wc=1/(1+zi*yt),Wa=ya*ya,pi=ms*ms,mt=Wc*Wc,fa=Wa*ya,Ra=pi*ms,sl=mt*Wc,ba=F*Wa+N*pi+z*mt-1,Sa=F*fa*lt+N*Ra*Ee+z*sl*yt;const Zd=-2*Sa;ha=ba/Zd}while(Math.abs(ba)>CesiumMath.EPSILON12);return defined(c)?(c.x=d*ya,c.y=h*ms,c.z=p*Wc,c):new Cartesian3(d*ya,h*ms,p*Wc)}function Cartographic(t,n,o){this.longitude=defaultValue(t,0),this.latitude=defaultValue(n,0),this.height=defaultValue(o,0)}Cartographic.fromRadians=function(t,n,o,s){return Check.typeOf.number("longitude",t),Check.typeOf.number("latitude",n),o=defaultValue(o,0),defined(s)?(s.longitude=t,s.latitude=n,s.height=o,s):new Cartographic(t,n,o)},Cartographic.fromDegrees=function(t,n,o,s){return Check.typeOf.number("longitude",t),Check.typeOf.number("latitude",n),t=CesiumMath.toRadians(t),n=CesiumMath.toRadians(n),Cartographic.fromRadians(t,n,o,s)};const cartesianToCartographicN$1=new Cartesian3,cartesianToCartographicP$1=new Cartesian3,cartesianToCartographicH$1=new Cartesian3,wgs84OneOverRadii=new Cartesian3(1/6378137,1/6378137,1/6356752314245179e-9),wgs84OneOverRadiiSquared=new Cartesian3(1/(6378137*6378137),1/(6378137*6378137),1/(6356752314245179e-9*6356752314245179e-9)),wgs84CenterToleranceSquared=CesiumMath.EPSILON1;Cartographic.fromCartesian=function(t,n,o){const s=defined(n)?n.oneOverRadii:wgs84OneOverRadii,c=defined(n)?n.oneOverRadiiSquared:wgs84OneOverRadiiSquared,d=defined(n)?n._centerToleranceSquared:wgs84CenterToleranceSquared,h=scaleToGeodeticSurface(t,s,c,d,cartesianToCartographicP$1);if(!defined(h))return;let p=Cartesian3.multiplyComponents(h,c,cartesianToCartographicN$1);p=Cartesian3.normalize(p,p);const y=Cartesian3.subtract(t,h,cartesianToCartographicH$1),E=Math.atan2(p.y,p.x),L=Math.asin(p.z),F=CesiumMath.sign(Cartesian3.dot(y,t))*Cartesian3.magnitude(y);return defined(o)?(o.longitude=E,o.latitude=L,o.height=F,o):new Cartographic(E,L,F)},Cartographic.toCartesian=function(t,n,o){return Check.defined("cartographic",t),Cartesian3.fromRadians(t.longitude,t.latitude,t.height,n,o)},Cartographic.clone=function(t,n){if(defined(t))return defined(n)?(n.longitude=t.longitude,n.latitude=t.latitude,n.height=t.height,n):new Cartographic(t.longitude,t.latitude,t.height)},Cartographic.equals=function(t,n){return t===n||defined(t)&&defined(n)&&t.longitude===n.longitude&&t.latitude===n.latitude&&t.height===n.height},Cartographic.equalsEpsilon=function(t,n,o){return o=defaultValue(o,0),t===n||defined(t)&&defined(n)&&Math.abs(t.longitude-n.longitude)<=o&&Math.abs(t.latitude-n.latitude)<=o&&Math.abs(t.height-n.height)<=o},Cartographic.ZERO=Object.freeze(new Cartographic(0,0,0)),Cartographic.prototype.clone=function(t){return Cartographic.clone(this,t)},Cartographic.prototype.equals=function(t){return Cartographic.equals(this,t)},Cartographic.prototype.equalsEpsilon=function(t,n){return Cartographic.equalsEpsilon(this,t,n)},Cartographic.prototype.toString=function(){return`(${this.longitude}, ${this.latitude}, ${this.height})`};function Cartesian2(t,n){this.x=defaultValue(t,0),this.y=defaultValue(n,0)}Cartesian2.fromElements=function(t,n,o){return defined(o)?(o.x=t,o.y=n,o):new Cartesian2(t,n)},Cartesian2.clone=function(t,n){if(defined(t))return defined(n)?(n.x=t.x,n.y=t.y,n):new Cartesian2(t.x,t.y)},Cartesian2.fromCartesian3=Cartesian2.clone,Cartesian2.fromCartesian4=Cartesian2.clone,Cartesian2.packedLength=2,Cartesian2.pack=function(t,n,o){return Check.typeOf.object("value",t),Check.defined("array",n),o=defaultValue(o,0),n[o++]=t.x,n[o]=t.y,n},Cartesian2.unpack=function(t,n,o){return Check.defined("array",t),n=defaultValue(n,0),defined(o)||(o=new Cartesian2),o.x=t[n++],o.y=t[n],o},Cartesian2.packArray=function(t,n){Check.defined("array",t);const o=t.length,s=o*2;if(!defined(n))n=new Array(s);else{if(!Array.isArray(n)&&n.length!==s)throw new DeveloperError("If result is a typed array, it must have exactly array.length * 2 elements");n.length!==s&&(n.length=s)}for(let c=0;c<o;++c)Cartesian2.pack(t[c],n,c*2);return n},Cartesian2.unpackArray=function(t,n){if(Check.defined("array",t),Check.typeOf.number.greaterThanOrEquals("array.length",t.length,2),t.length%2!==0)throw new DeveloperError("array length must be a multiple of 2.");const o=t.length;defined(n)?n.length=o/2:n=new Array(o/2);for(let s=0;s<o;s+=2){const c=s/2;n[c]=Cartesian2.unpack(t,s,n[c])}return n},Cartesian2.fromArray=Cartesian2.unpack,Cartesian2.maximumComponent=function(t){return Check.typeOf.object("cartesian",t),Math.max(t.x,t.y)},Cartesian2.minimumComponent=function(t){return Check.typeOf.object("cartesian",t),Math.min(t.x,t.y)},Cartesian2.minimumByComponent=function(t,n,o){return Check.typeOf.object("first",t),Check.typeOf.object("second",n),Check.typeOf.object("result",o),o.x=Math.min(t.x,n.x),o.y=Math.min(t.y,n.y),o},Cartesian2.maximumByComponent=function(t,n,o){return Check.typeOf.object("first",t),Check.typeOf.object("second",n),Check.typeOf.object("result",o),o.x=Math.max(t.x,n.x),o.y=Math.max(t.y,n.y),o},Cartesian2.clamp=function(t,n,o,s){Check.typeOf.object("value",t),Check.typeOf.object("min",n),Check.typeOf.object("max",o),Check.typeOf.object("result",s);const c=CesiumMath.clamp(t.x,n.x,o.x),d=CesiumMath.clamp(t.y,n.y,o.y);return s.x=c,s.y=d,s},Cartesian2.magnitudeSquared=function(t){return Check.typeOf.object("cartesian",t),t.x*t.x+t.y*t.y},Cartesian2.magnitude=function(t){return Math.sqrt(Cartesian2.magnitudeSquared(t))};const distanceScratch$1=new Cartesian2;Cartesian2.distance=function(t,n){return Check.typeOf.object("left",t),Check.typeOf.object("right",n),Cartesian2.subtract(t,n,distanceScratch$1),Cartesian2.magnitude(distanceScratch$1)},Cartesian2.distanceSquared=function(t,n){return Check.typeOf.object("left",t),Check.typeOf.object("right",n),Cartesian2.subtract(t,n,distanceScratch$1),Cartesian2.magnitudeSquared(distanceScratch$1)},Cartesian2.normalize=function(t,n){Check.typeOf.object("cartesian",t),Check.typeOf.object("result",n);const o=Cartesian2.magnitude(t);if(n.x=t.x/o,n.y=t.y/o,isNaN(n.x)||isNaN(n.y))throw new DeveloperError("normalized result is not a number");return n},Cartesian2.dot=function(t,n){return Check.typeOf.object("left",t),Check.typeOf.object("right",n),t.x*n.x+t.y*n.y},Cartesian2.cross=function(t,n){return Check.typeOf.object("left",t),Check.typeOf.object("right",n),t.x*n.y-t.y*n.x},Cartesian2.multiplyComponents=function(t,n,o){return Check.typeOf.object("left",t),Check.typeOf.object("right",n),Check.typeOf.object("result",o),o.x=t.x*n.x,o.y=t.y*n.y,o},Cartesian2.divideComponents=function(t,n,o){return Check.typeOf.object("left",t),Check.typeOf.object("right",n),Check.typeOf.object("result",o),o.x=t.x/n.x,o.y=t.y/n.y,o},Cartesian2.add=function(t,n,o){return Check.typeOf.object("left",t),Check.typeOf.object("right",n),Check.typeOf.object("result",o),o.x=t.x+n.x,o.y=t.y+n.y,o},Cartesian2.subtract=function(t,n,o){return Check.typeOf.object("left",t),Check.typeOf.object("right",n),Check.typeOf.object("result",o),o.x=t.x-n.x,o.y=t.y-n.y,o},Cartesian2.multiplyByScalar=function(t,n,o){return Check.typeOf.object("cartesian",t),Check.typeOf.number("scalar",n),Check.typeOf.object("result",o),o.x=t.x*n,o.y=t.y*n,o},Cartesian2.divideByScalar=function(t,n,o){return Check.typeOf.object("cartesian",t),Check.typeOf.number("scalar",n),Check.typeOf.object("result",o),o.x=t.x/n,o.y=t.y/n,o},Cartesian2.negate=function(t,n){return Check.typeOf.object("cartesian",t),Check.typeOf.object("result",n),n.x=-t.x,n.y=-t.y,n},Cartesian2.abs=function(t,n){return Check.typeOf.object("cartesian",t),Check.typeOf.object("result",n),n.x=Math.abs(t.x),n.y=Math.abs(t.y),n};const lerpScratch$2=new Cartesian2;Cartesian2.lerp=function(t,n,o,s){return Check.typeOf.object("start",t),Check.typeOf.object("end",n),Check.typeOf.number("t",o),Check.typeOf.object("result",s),Cartesian2.multiplyByScalar(n,o,lerpScratch$2),s=Cartesian2.multiplyByScalar(t,1-o,s),Cartesian2.add(lerpScratch$2,s,s)};const angleBetweenScratch=new Cartesian2,angleBetweenScratch2=new Cartesian2;Cartesian2.angleBetween=function(t,n){return Check.typeOf.object("left",t),Check.typeOf.object("right",n),Cartesian2.normalize(t,angleBetweenScratch),Cartesian2.normalize(n,angleBetweenScratch2),CesiumMath.acosClamped(Cartesian2.dot(angleBetweenScratch,angleBetweenScratch2))};const mostOrthogonalAxisScratch$1=new Cartesian2;Cartesian2.mostOrthogonalAxis=function(t,n){Check.typeOf.object("cartesian",t),Check.typeOf.object("result",n);const o=Cartesian2.normalize(t,mostOrthogonalAxisScratch$1);return Cartesian2.abs(o,o),o.x<=o.y?n=Cartesian2.clone(Cartesian2.UNIT_X,n):n=Cartesian2.clone(Cartesian2.UNIT_Y,n),n},Cartesian2.equals=function(t,n){return t===n||defined(t)&&defined(n)&&t.x===n.x&&t.y===n.y},Cartesian2.equalsArray=function(t,n,o){return t.x===n[o]&&t.y===n[o+1]},Cartesian2.equalsEpsilon=function(t,n,o,s){return t===n||defined(t)&&defined(n)&&CesiumMath.equalsEpsilon(t.x,n.x,o,s)&&CesiumMath.equalsEpsilon(t.y,n.y,o,s)},Cartesian2.ZERO=Object.freeze(new Cartesian2(0,0)),Cartesian2.ONE=Object.freeze(new Cartesian2(1,1)),Cartesian2.UNIT_X=Object.freeze(new Cartesian2(1,0)),Cartesian2.UNIT_Y=Object.freeze(new Cartesian2(0,1)),Cartesian2.prototype.clone=function(t){return Cartesian2.clone(this,t)},Cartesian2.prototype.equals=function(t){return Cartesian2.equals(this,t)},Cartesian2.prototype.equalsEpsilon=function(t,n,o){return Cartesian2.equalsEpsilon(this,t,n,o)},Cartesian2.prototype.toString=function(){return`(${this.x}, ${this.y})`};function initialize$1(t,n,o,s){n=defaultValue(n,0),o=defaultValue(o,0),s=defaultValue(s,0),Check.typeOf.number.greaterThanOrEquals("x",n,0),Check.typeOf.number.greaterThanOrEquals("y",o,0),Check.typeOf.number.greaterThanOrEquals("z",s,0),t._radii=new Cartesian3(n,o,s),t._radiiSquared=new Cartesian3(n*n,o*o,s*s),t._radiiToTheFourth=new Cartesian3(n*n*n*n,o*o*o*o,s*s*s*s),t._oneOverRadii=new Cartesian3(n===0?0:1/n,o===0?0:1/o,s===0?0:1/s),t._oneOverRadiiSquared=new Cartesian3(n===0?0:1/(n*n),o===0?0:1/(o*o),s===0?0:1/(s*s)),t._minimumRadius=Math.min(n,o,s),t._maximumRadius=Math.max(n,o,s),t._centerToleranceSquared=CesiumMath.EPSILON1,t._radiiSquared.z!==0&&(t._squaredXOverSquaredZ=t._radiiSquared.x/t._radiiSquared.z)}function Ellipsoid$1(t,n,o){this._radii=void 0,this._radiiSquared=void 0,this._radiiToTheFourth=void 0,this._oneOverRadii=void 0,this._oneOverRadiiSquared=void 0,this._minimumRadius=void 0,this._maximumRadius=void 0,this._centerToleranceSquared=void 0,this._squaredXOverSquaredZ=void 0,initialize$1(this,t,n,o)}Object.defineProperties(Ellipsoid$1.prototype,{radii:{get:function(){return this._radii}},radiiSquared:{get:function(){return this._radiiSquared}},radiiToTheFourth:{get:function(){return this._radiiToTheFourth}},oneOverRadii:{get:function(){return this._oneOverRadii}},oneOverRadiiSquared:{get:function(){return this._oneOverRadiiSquared}},minimumRadius:{get:function(){return this._minimumRadius}},maximumRadius:{get:function(){return this._maximumRadius}}}),Ellipsoid$1.clone=function(t,n){if(!defined(t))return;const o=t._radii;return defined(n)?(Cartesian3.clone(o,n._radii),Cartesian3.clone(t._radiiSquared,n._radiiSquared),Cartesian3.clone(t._radiiToTheFourth,n._radiiToTheFourth),Cartesian3.clone(t._oneOverRadii,n._oneOverRadii),Cartesian3.clone(t._oneOverRadiiSquared,n._oneOverRadiiSquared),n._minimumRadius=t._minimumRadius,n._maximumRadius=t._maximumRadius,n._centerToleranceSquared=t._centerToleranceSquared,n):new Ellipsoid$1(o.x,o.y,o.z)},Ellipsoid$1.fromCartesian3=function(t,n){return defined(n)||(n=new Ellipsoid$1),defined(t)&&initialize$1(n,t.x,t.y,t.z),n},Ellipsoid$1.WGS84=Object.freeze(new Ellipsoid$1(6378137,6378137,6356752314245179e-9)),Ellipsoid$1.UNIT_SPHERE=Object.freeze(new Ellipsoid$1(1,1,1)),Ellipsoid$1.MOON=Object.freeze(new Ellipsoid$1(CesiumMath.LUNAR_RADIUS,CesiumMath.LUNAR_RADIUS,CesiumMath.LUNAR_RADIUS)),Ellipsoid$1.prototype.clone=function(t){return Ellipsoid$1.clone(this,t)},Ellipsoid$1.packedLength=Cartesian3.packedLength,Ellipsoid$1.pack=function(t,n,o){return Check.typeOf.object("value",t),Check.defined("array",n),o=defaultValue(o,0),Cartesian3.pack(t._radii,n,o),n},Ellipsoid$1.unpack=function(t,n,o){Check.defined("array",t),n=defaultValue(n,0);const s=Cartesian3.unpack(t,n);return Ellipsoid$1.fromCartesian3(s,o)},Ellipsoid$1.prototype.geocentricSurfaceNormal=Cartesian3.normalize,Ellipsoid$1.prototype.geodeticSurfaceNormalCartographic=function(t,n){Check.typeOf.object("cartographic",t);const o=t.longitude,s=t.latitude,c=Math.cos(s),d=c*Math.cos(o),h=c*Math.sin(o),p=Math.sin(s);return defined(n)||(n=new Cartesian3),n.x=d,n.y=h,n.z=p,Cartesian3.normalize(n,n)},Ellipsoid$1.prototype.geodeticSurfaceNormal=function(t,n){if(Check.typeOf.object("cartesian",t),isNaN(t.x)||isNaN(t.y)||isNaN(t.z))throw new DeveloperError("cartesian has a NaN component");if(!Cartesian3.equalsEpsilon(t,Cartesian3.ZERO,CesiumMath.EPSILON14))return defined(n)||(n=new Cartesian3),n=Cartesian3.multiplyComponents(t,this._oneOverRadiiSquared,n),Cartesian3.normalize(n,n)};const cartographicToCartesianNormal=new Cartesian3,cartographicToCartesianK=new Cartesian3;Ellipsoid$1.prototype.cartographicToCartesian=function(t,n){const o=cartographicToCartesianNormal,s=cartographicToCartesianK;this.geodeticSurfaceNormalCartographic(t,o),Cartesian3.multiplyComponents(this._radiiSquared,o,s);const c=Math.sqrt(Cartesian3.dot(o,s));return Cartesian3.divideByScalar(s,c,s),Cartesian3.multiplyByScalar(o,t.height,o),defined(n)||(n=new Cartesian3),Cartesian3.add(s,o,n)},Ellipsoid$1.prototype.cartographicArrayToCartesianArray=function(t,n){Check.defined("cartographics",t);const o=t.length;defined(n)?n.length=o:n=new Array(o);for(let s=0;s<o;s++)n[s]=this.cartographicToCartesian(t[s],n[s]);return n};const cartesianToCartographicN=new Cartesian3,cartesianToCartographicP=new Cartesian3,cartesianToCartographicH=new Cartesian3;Ellipsoid$1.prototype.cartesianToCartographic=function(t,n){const o=this.scaleToGeodeticSurface(t,cartesianToCartographicP);if(!defined(o))return;const s=this.geodeticSurfaceNormal(o,cartesianToCartographicN),c=Cartesian3.subtract(t,o,cartesianToCartographicH),d=Math.atan2(s.y,s.x),h=Math.asin(s.z),p=CesiumMath.sign(Cartesian3.dot(c,t))*Cartesian3.magnitude(c);return defined(n)?(n.longitude=d,n.latitude=h,n.height=p,n):new Cartographic(d,h,p)},Ellipsoid$1.prototype.cartesianArrayToCartographicArray=function(t,n){Check.defined("cartesians",t);const o=t.length;defined(n)?n.length=o:n=new Array(o);for(let s=0;s<o;++s)n[s]=this.cartesianToCartographic(t[s],n[s]);return n},Ellipsoid$1.prototype.scaleToGeodeticSurface=function(t,n){return scaleToGeodeticSurface(t,this._oneOverRadii,this._oneOverRadiiSquared,this._centerToleranceSquared,n)},Ellipsoid$1.prototype.scaleToGeocentricSurface=function(t,n){Check.typeOf.object("cartesian",t),defined(n)||(n=new Cartesian3);const o=t.x,s=t.y,c=t.z,d=this._oneOverRadiiSquared,h=1/Math.sqrt(o*o*d.x+s*s*d.y+c*c*d.z);return Cartesian3.multiplyByScalar(t,h,n)},Ellipsoid$1.prototype.transformPositionToScaledSpace=function(t,n){return defined(n)||(n=new Cartesian3),Cartesian3.multiplyComponents(t,this._oneOverRadii,n)},Ellipsoid$1.prototype.transformPositionFromScaledSpace=function(t,n){return defined(n)||(n=new Cartesian3),Cartesian3.multiplyComponents(t,this._radii,n)},Ellipsoid$1.prototype.equals=function(t){return this===t||defined(t)&&Cartesian3.equals(this._radii,t._radii)},Ellipsoid$1.prototype.toString=function(){return this._radii.toString()},Ellipsoid$1.prototype.getSurfaceNormalIntersectionWithZAxis=function(t,n,o){if(Check.typeOf.object("position",t),!CesiumMath.equalsEpsilon(this._radii.x,this._radii.y,CesiumMath.EPSILON15))throw new DeveloperError("Ellipsoid must be an ellipsoid of revolution (radii.x == radii.y)");Check.typeOf.number.greaterThan("Ellipsoid.radii.z",this._radii.z,0),n=defaultValue(n,0);const s=this._squaredXOverSquaredZ;if(defined(o)||(o=new Cartesian3),o.x=0,o.y=0,o.z=t.z*(1-s),!(Math.abs(o.z)>=this._radii.z-n))return o};const scratchEndpoint=new Cartesian3;Ellipsoid$1.prototype.getLocalCurvature=function(t,n){Check.typeOf.object("surfacePosition",t),defined(n)||(n=new Cartesian2);const o=this.getSurfaceNormalIntersectionWithZAxis(t,0,scratchEndpoint),s=Cartesian3.distance(t,o),c=this.minimumRadius*s/this.maximumRadius**2,d=s*c**2;return Cartesian2.fromElements(1/s,1/d,n)};const abscissas=[.14887433898163,.43339539412925,.67940956829902,.86506336668898,.97390652851717,0],weights=[.29552422471475,.26926671930999,.21908636251598,.14945134915058,.066671344308684,0];function gaussLegendreQuadrature(t,n,o){Check.typeOf.number("a",t),Check.typeOf.number("b",n),Check.typeOf.func("func",o);const s=.5*(n+t),c=.5*(n-t);let d=0;for(let h=0;h<5;h++){const p=c*abscissas[h];d+=weights[h]*(o(s+p)+o(s-p))}return d*=c,d}Ellipsoid$1.prototype.surfaceArea=function(t){Check.typeOf.object("rectangle",t);const n=t.west;let o=t.east;const s=t.south,c=t.north;for(;o<n;)o+=CesiumMath.TWO_PI;const d=this._radiiSquared,h=d.x,p=d.y,y=d.z,E=h*p;return gaussLegendreQuadrature(s,c,function(L){const F=Math.cos(L),N=Math.sin(L);return Math.cos(L)*gaussLegendreQuadrature(n,o,function(z){const oe=Math.cos(z),W=Math.sin(z);return Math.sqrt(E*N*N+y*(p*oe*oe+h*W*W)*F*F)})})};function GeographicProjection(t){this._ellipsoid=defaultValue(t,Ellipsoid$1.WGS84),this._semimajorAxis=this._ellipsoid.maximumRadius,this._oneOverSemimajorAxis=1/this._semimajorAxis}Object.defineProperties(GeographicProjection.prototype,{ellipsoid:{get:function(){return this._ellipsoid}}}),GeographicProjection.prototype.project=function(t,n){const o=this._semimajorAxis,s=t.longitude*o,c=t.latitude*o,d=t.height;return defined(n)?(n.x=s,n.y=c,n.z=d,n):new Cartesian3(s,c,d)},GeographicProjection.prototype.unproject=function(t,n){if(!defined(t))throw new DeveloperError("cartesian is required");const o=this._oneOverSemimajorAxis,s=t.x*o,c=t.y*o,d=t.z;return defined(n)?(n.longitude=s,n.latitude=c,n.height=d,n):new Cartographic(s,c,d)};const Intersect={OUTSIDE:-1,INTERSECTING:0,INSIDE:1},Intersect$1=Object.freeze(Intersect);function Interval(t,n){this.start=defaultValue(t,0),this.stop=defaultValue(n,0)}function Matrix3(t,n,o,s,c,d,h,p,y){this[0]=defaultValue(t,0),this[1]=defaultValue(s,0),this[2]=defaultValue(h,0),this[3]=defaultValue(n,0),this[4]=defaultValue(c,0),this[5]=defaultValue(p,0),this[6]=defaultValue(o,0),this[7]=defaultValue(d,0),this[8]=defaultValue(y,0)}Matrix3.packedLength=9,Matrix3.pack=function(t,n,o){return Check.typeOf.object("value",t),Check.defined("array",n),o=defaultValue(o,0),n[o++]=t[0],n[o++]=t[1],n[o++]=t[2],n[o++]=t[3],n[o++]=t[4],n[o++]=t[5],n[o++]=t[6],n[o++]=t[7],n[o++]=t[8],n},Matrix3.unpack=function(t,n,o){return Check.defined("array",t),n=defaultValue(n,0),defined(o)||(o=new Matrix3),o[0]=t[n++],o[1]=t[n++],o[2]=t[n++],o[3]=t[n++],o[4]=t[n++],o[5]=t[n++],o[6]=t[n++],o[7]=t[n++],o[8]=t[n++],o},Matrix3.packArray=function(t,n){Check.defined("array",t);const o=t.length,s=o*9;if(!defined(n))n=new Array(s);else{if(!Array.isArray(n)&&n.length!==s)throw new DeveloperError("If result is a typed array, it must have exactly array.length * 9 elements");n.length!==s&&(n.length=s)}for(let c=0;c<o;++c)Matrix3.pack(t[c],n,c*9);return n},Matrix3.unpackArray=function(t,n){if(Check.defined("array",t),Check.typeOf.number.greaterThanOrEquals("array.length",t.length,9),t.length%9!==0)throw new DeveloperError("array length must be a multiple of 9.");const o=t.length;defined(n)?n.length=o/9:n=new Array(o/9);for(let s=0;s<o;s+=9){const c=s/9;n[c]=Matrix3.unpack(t,s,n[c])}return n},Matrix3.clone=function(t,n){if(defined(t))return defined(n)?(n[0]=t[0],n[1]=t[1],n[2]=t[2],n[3]=t[3],n[4]=t[4],n[5]=t[5],n[6]=t[6],n[7]=t[7],n[8]=t[8],n):new Matrix3(t[0],t[3],t[6],t[1],t[4],t[7],t[2],t[5],t[8])},Matrix3.fromArray=Matrix3.unpack,Matrix3.fromColumnMajorArray=function(t,n){return Check.defined("values",t),Matrix3.clone(t,n)},Matrix3.fromRowMajorArray=function(t,n){return Check.defined("values",t),defined(n)?(n[0]=t[0],n[1]=t[3],n[2]=t[6],n[3]=t[1],n[4]=t[4],n[5]=t[7],n[6]=t[2],n[7]=t[5],n[8]=t[8],n):new Matrix3(t[0],t[1],t[2],t[3],t[4],t[5],t[6],t[7],t[8])},Matrix3.fromQuaternion=function(t,n){Check.typeOf.object("quaternion",t);const o=t.x*t.x,s=t.x*t.y,c=t.x*t.z,d=t.x*t.w,h=t.y*t.y,p=t.y*t.z,y=t.y*t.w,E=t.z*t.z,L=t.z*t.w,F=t.w*t.w,N=o-h-E+F,z=2*(s-L),oe=2*(c+y),W=2*(s+L),nt=-o+h-E+F,lt=2*(p-d),Ee=2*(c-y),yt=2*(p+d),Ai=-o-h+E+F;return defined(n)?(n[0]=N,n[1]=W,n[2]=Ee,n[3]=z,n[4]=nt,n[5]=yt,n[6]=oe,n[7]=lt,n[8]=Ai,n):new Matrix3(N,z,oe,W,nt,lt,Ee,yt,Ai)},Matrix3.fromHeadingPitchRoll=function(t,n){Check.typeOf.object("headingPitchRoll",t);const o=Math.cos(-t.pitch),s=Math.cos(-t.heading),c=Math.cos(t.roll),d=Math.sin(-t.pitch),h=Math.sin(-t.heading),p=Math.sin(t.roll),y=o*s,E=-c*h+p*d*s,L=p*h+c*d*s,F=o*h,N=c*s+p*d*h,z=-p*s+c*d*h,oe=-d,W=p*o,nt=c*o;return defined(n)?(n[0]=y,n[1]=F,n[2]=oe,n[3]=E,n[4]=N,n[5]=W,n[6]=L,n[7]=z,n[8]=nt,n):new Matrix3(y,E,L,F,N,z,oe,W,nt)},Matrix3.fromScale=function(t,n){return Check.typeOf.object("scale",t),defined(n)?(n[0]=t.x,n[1]=0,n[2]=0,n[3]=0,n[4]=t.y,n[5]=0,n[6]=0,n[7]=0,n[8]=t.z,n):new Matrix3(t.x,0,0,0,t.y,0,0,0,t.z)},Matrix3.fromUniformScale=function(t,n){return Check.typeOf.number("scale",t),defined(n)?(n[0]=t,n[1]=0,n[2]=0,n[3]=0,n[4]=t,n[5]=0,n[6]=0,n[7]=0,n[8]=t,n):new Matrix3(t,0,0,0,t,0,0,0,t)},Matrix3.fromCrossProduct=function(t,n){return Check.typeOf.object("vector",t),defined(n)?(n[0]=0,n[1]=t.z,n[2]=-t.y,n[3]=-t.z,n[4]=0,n[5]=t.x,n[6]=t.y,n[7]=-t.x,n[8]=0,n):new Matrix3(0,-t.z,t.y,t.z,0,-t.x,-t.y,t.x,0)},Matrix3.fromRotationX=function(t,n){Check.typeOf.number("angle",t);const o=Math.cos(t),s=Math.sin(t);return defined(n)?(n[0]=1,n[1]=0,n[2]=0,n[3]=0,n[4]=o,n[5]=s,n[6]=0,n[7]=-s,n[8]=o,n):new Matrix3(1,0,0,0,o,-s,0,s,o)},Matrix3.fromRotationY=function(t,n){Check.typeOf.number("angle",t);const o=Math.cos(t),s=Math.sin(t);return defined(n)?(n[0]=o,n[1]=0,n[2]=-s,n[3]=0,n[4]=1,n[5]=0,n[6]=s,n[7]=0,n[8]=o,n):new Matrix3(o,0,s,0,1,0,-s,0,o)},Matrix3.fromRotationZ=function(t,n){Check.typeOf.number("angle",t);const o=Math.cos(t),s=Math.sin(t);return defined(n)?(n[0]=o,n[1]=s,n[2]=0,n[3]=-s,n[4]=o,n[5]=0,n[6]=0,n[7]=0,n[8]=1,n):new Matrix3(o,-s,0,s,o,0,0,0,1)},Matrix3.toArray=function(t,n){return Check.typeOf.object("matrix",t),defined(n)?(n[0]=t[0],n[1]=t[1],n[2]=t[2],n[3]=t[3],n[4]=t[4],n[5]=t[5],n[6]=t[6],n[7]=t[7],n[8]=t[8],n):[t[0],t[1],t[2],t[3],t[4],t[5],t[6],t[7],t[8]]},Matrix3.getElementIndex=function(t,n){return Check.typeOf.number.greaterThanOrEquals("row",n,0),Check.typeOf.number.lessThanOrEquals("row",n,2),Check.typeOf.number.greaterThanOrEquals("column",t,0),Check.typeOf.number.lessThanOrEquals("column",t,2),t*3+n},Matrix3.getColumn=function(t,n,o){Check.typeOf.object("matrix",t),Check.typeOf.number.greaterThanOrEquals("index",n,0),Check.typeOf.number.lessThanOrEquals("index",n,2),Check.typeOf.object("result",o);const s=n*3,c=t[s],d=t[s+1],h=t[s+2];return o.x=c,o.y=d,o.z=h,o},Matrix3.setColumn=function(t,n,o,s){Check.typeOf.object("matrix",t),Check.typeOf.number.greaterThanOrEquals("index",n,0),Check.typeOf.number.lessThanOrEquals("index",n,2),Check.typeOf.object("cartesian",o),Check.typeOf.object("result",s),s=Matrix3.clone(t,s);const c=n*3;return s[c]=o.x,s[c+1]=o.y,s[c+2]=o.z,s},Matrix3.getRow=function(t,n,o){Check.typeOf.object("matrix",t),Check.typeOf.number.greaterThanOrEquals("index",n,0),Check.typeOf.number.lessThanOrEquals("index",n,2),Check.typeOf.object("result",o);const s=t[n],c=t[n+3],d=t[n+6];return o.x=s,o.y=c,o.z=d,o},Matrix3.setRow=function(t,n,o,s){return Check.typeOf.object("matrix",t),Check.typeOf.number.greaterThanOrEquals("index",n,0),Check.typeOf.number.lessThanOrEquals("index",n,2),Check.typeOf.object("cartesian",o),Check.typeOf.object("result",s),s=Matrix3.clone(t,s),s[n]=o.x,s[n+3]=o.y,s[n+6]=o.z,s};const scaleScratch1$2=new Cartesian3;Matrix3.setScale=function(t,n,o){Check.typeOf.object("matrix",t),Check.typeOf.object("scale",n),Check.typeOf.object("result",o);const s=Matrix3.getScale(t,scaleScratch1$2),c=n.x/s.x,d=n.y/s.y,h=n.z/s.z;return o[0]=t[0]*c,o[1]=t[1]*c,o[2]=t[2]*c,o[3]=t[3]*d,o[4]=t[4]*d,o[5]=t[5]*d,o[6]=t[6]*h,o[7]=t[7]*h,o[8]=t[8]*h,o};const scaleScratch2$2=new Cartesian3;Matrix3.setUniformScale=function(t,n,o){Check.typeOf.object("matrix",t),Check.typeOf.number("scale",n),Check.typeOf.object("result",o);const s=Matrix3.getScale(t,scaleScratch2$2),c=n/s.x,d=n/s.y,h=n/s.z;return o[0]=t[0]*c,o[1]=t[1]*c,o[2]=t[2]*c,o[3]=t[3]*d,o[4]=t[4]*d,o[5]=t[5]*d,o[6]=t[6]*h,o[7]=t[7]*h,o[8]=t[8]*h,o};const scratchColumn$2=new Cartesian3;Matrix3.getScale=function(t,n){return Check.typeOf.object("matrix",t),Check.typeOf.object("result",n),n.x=Cartesian3.magnitude(Cartesian3.fromElements(t[0],t[1],t[2],scratchColumn$2)),n.y=Cartesian3.magnitude(Cartesian3.fromElements(t[3],t[4],t[5],scratchColumn$2)),n.z=Cartesian3.magnitude(Cartesian3.fromElements(t[6],t[7],t[8],scratchColumn$2)),n};const scaleScratch3$2=new Cartesian3;Matrix3.getMaximumScale=function(t){return Matrix3.getScale(t,scaleScratch3$2),Cartesian3.maximumComponent(scaleScratch3$2)};const scaleScratch4$2=new Cartesian3;Matrix3.setRotation=function(t,n,o){Check.typeOf.object("matrix",t),Check.typeOf.object("result",o);const s=Matrix3.getScale(t,scaleScratch4$2);return o[0]=n[0]*s.x,o[1]=n[1]*s.x,o[2]=n[2]*s.x,o[3]=n[3]*s.y,o[4]=n[4]*s.y,o[5]=n[5]*s.y,o[6]=n[6]*s.z,o[7]=n[7]*s.z,o[8]=n[8]*s.z,o};const scaleScratch5$2=new Cartesian3;Matrix3.getRotation=function(t,n){Check.typeOf.object("matrix",t),Check.typeOf.object("result",n);const o=Matrix3.getScale(t,scaleScratch5$2);return n[0]=t[0]/o.x,n[1]=t[1]/o.x,n[2]=t[2]/o.x,n[3]=t[3]/o.y,n[4]=t[4]/o.y,n[5]=t[5]/o.y,n[6]=t[6]/o.z,n[7]=t[7]/o.z,n[8]=t[8]/o.z,n},Matrix3.multiply=function(t,n,o){Check.typeOf.object("left",t),Check.typeOf.object("right",n),Check.typeOf.object("result",o);const s=t[0]*n[0]+t[3]*n[1]+t[6]*n[2],c=t[1]*n[0]+t[4]*n[1]+t[7]*n[2],d=t[2]*n[0]+t[5]*n[1]+t[8]*n[2],h=t[0]*n[3]+t[3]*n[4]+t[6]*n[5],p=t[1]*n[3]+t[4]*n[4]+t[7]*n[5],y=t[2]*n[3]+t[5]*n[4]+t[8]*n[5],E=t[0]*n[6]+t[3]*n[7]+t[6]*n[8],L=t[1]*n[6]+t[4]*n[7]+t[7]*n[8],F=t[2]*n[6]+t[5]*n[7]+t[8]*n[8];return o[0]=s,o[1]=c,o[2]=d,o[3]=h,o[4]=p,o[5]=y,o[6]=E,o[7]=L,o[8]=F,o},Matrix3.add=function(t,n,o){return Check.typeOf.object("left",t),Check.typeOf.object("right",n),Check.typeOf.object("result",o),o[0]=t[0]+n[0],o[1]=t[1]+n[1],o[2]=t[2]+n[2],o[3]=t[3]+n[3],o[4]=t[4]+n[4],o[5]=t[5]+n[5],o[6]=t[6]+n[6],o[7]=t[7]+n[7],o[8]=t[8]+n[8],o},Matrix3.subtract=function(t,n,o){return Check.typeOf.object("left",t),Check.typeOf.object("right",n),Check.typeOf.object("result",o),o[0]=t[0]-n[0],o[1]=t[1]-n[1],o[2]=t[2]-n[2],o[3]=t[3]-n[3],o[4]=t[4]-n[4],o[5]=t[5]-n[5],o[6]=t[6]-n[6],o[7]=t[7]-n[7],o[8]=t[8]-n[8],o},Matrix3.multiplyByVector=function(t,n,o){Check.typeOf.object("matrix",t),Check.typeOf.object("cartesian",n),Check.typeOf.object("result",o);const s=n.x,c=n.y,d=n.z,h=t[0]*s+t[3]*c+t[6]*d,p=t[1]*s+t[4]*c+t[7]*d,y=t[2]*s+t[5]*c+t[8]*d;return o.x=h,o.y=p,o.z=y,o},Matrix3.multiplyByScalar=function(t,n,o){return Check.typeOf.object("matrix",t),Check.typeOf.number("scalar",n),Check.typeOf.object("result",o),o[0]=t[0]*n,o[1]=t[1]*n,o[2]=t[2]*n,o[3]=t[3]*n,o[4]=t[4]*n,o[5]=t[5]*n,o[6]=t[6]*n,o[7]=t[7]*n,o[8]=t[8]*n,o},Matrix3.multiplyByScale=function(t,n,o){return Check.typeOf.object("matrix",t),Check.typeOf.object("scale",n),Check.typeOf.object("result",o),o[0]=t[0]*n.x,o[1]=t[1]*n.x,o[2]=t[2]*n.x,o[3]=t[3]*n.y,o[4]=t[4]*n.y,o[5]=t[5]*n.y,o[6]=t[6]*n.z,o[7]=t[7]*n.z,o[8]=t[8]*n.z,o},Matrix3.multiplyByUniformScale=function(t,n,o){return Check.typeOf.object("matrix",t),Check.typeOf.number("scale",n),Check.typeOf.object("result",o),o[0]=t[0]*n,o[1]=t[1]*n,o[2]=t[2]*n,o[3]=t[3]*n,o[4]=t[4]*n,o[5]=t[5]*n,o[6]=t[6]*n,o[7]=t[7]*n,o[8]=t[8]*n,o},Matrix3.negate=function(t,n){return Check.typeOf.object("matrix",t),Check.typeOf.object("result",n),n[0]=-t[0],n[1]=-t[1],n[2]=-t[2],n[3]=-t[3],n[4]=-t[4],n[5]=-t[5],n[6]=-t[6],n[7]=-t[7],n[8]=-t[8],n},Matrix3.transpose=function(t,n){Check.typeOf.object("matrix",t),Check.typeOf.object("result",n);const o=t[0],s=t[3],c=t[6],d=t[1],h=t[4],p=t[7],y=t[2],E=t[5],L=t[8];return n[0]=o,n[1]=s,n[2]=c,n[3]=d,n[4]=h,n[5]=p,n[6]=y,n[7]=E,n[8]=L,n};function computeFrobeniusNorm(t){let n=0;for(let o=0;o<9;++o){const s=t[o];n+=s*s}return Math.sqrt(n)}const rowVal=[1,0,0],colVal=[2,2,1];function offDiagonalFrobeniusNorm(t){let n=0;for(let o=0;o<3;++o){const s=t[Matrix3.getElementIndex(colVal[o],rowVal[o])];n+=2*s*s}return Math.sqrt(n)}function shurDecomposition(t,n){const o=CesiumMath.EPSILON15;let s=0,c=1;for(let E=0;E<3;++E){const L=Math.abs(t[Matrix3.getElementIndex(colVal[E],rowVal[E])]);L>s&&(c=E,s=L)}let d=1,h=0;const p=rowVal[c],y=colVal[c];if(Math.abs(t[Matrix3.getElementIndex(y,p)])>o){const E=t[Matrix3.getElementIndex(y,y)],L=t[Matrix3.getElementIndex(p,p)],F=t[Matrix3.getElementIndex(y,p)],N=(E-L)/2/F;let z;N<0?z=-1/(-N+Math.sqrt(1+N*N)):z=1/(N+Math.sqrt(1+N*N)),d=1/Math.sqrt(1+z*z),h=z*d}return n=Matrix3.clone(Matrix3.IDENTITY,n),n[Matrix3.getElementIndex(p,p)]=n[Matrix3.getElementIndex(y,y)]=d,n[Matrix3.getElementIndex(y,p)]=h,n[Matrix3.getElementIndex(p,y)]=-h,n}const jMatrix=new Matrix3,jMatrixTranspose=new Matrix3;Matrix3.computeEigenDecomposition=function(t,n){Check.typeOf.object("matrix",t);const o=CesiumMath.EPSILON20,s=10;let c=0,d=0;defined(n)||(n={});const h=n.unitary=Matrix3.clone(Matrix3.IDENTITY,n.unitary),p=n.diagonal=Matrix3.clone(t,n.diagonal),y=o*computeFrobeniusNorm(p);for(;d<s&&offDiagonalFrobeniusNorm(p)>y;)shurDecomposition(p,jMatrix),Matrix3.transpose(jMatrix,jMatrixTranspose),Matrix3.multiply(p,jMatrix,p),Matrix3.multiply(jMatrixTranspose,p,p),Matrix3.multiply(h,jMatrix,h),++c>2&&(++d,c=0);return n},Matrix3.abs=function(t,n){return Check.typeOf.object("matrix",t),Check.typeOf.object("result",n),n[0]=Math.abs(t[0]),n[1]=Math.abs(t[1]),n[2]=Math.abs(t[2]),n[3]=Math.abs(t[3]),n[4]=Math.abs(t[4]),n[5]=Math.abs(t[5]),n[6]=Math.abs(t[6]),n[7]=Math.abs(t[7]),n[8]=Math.abs(t[8]),n},Matrix3.determinant=function(t){Check.typeOf.object("matrix",t);const n=t[0],o=t[3],s=t[6],c=t[1],d=t[4],h=t[7],p=t[2],y=t[5],E=t[8];return n*(d*E-y*h)+c*(y*s-o*E)+p*(o*h-d*s)},Matrix3.inverse=function(t,n){Check.typeOf.object("matrix",t),Check.typeOf.object("result",n);const o=t[0],s=t[1],c=t[2],d=t[3],h=t[4],p=t[5],y=t[6],E=t[7],L=t[8],F=Matrix3.determinant(t);if(Math.abs(F)<=CesiumMath.EPSILON15)throw new DeveloperError("matrix is not invertible");n[0]=h*L-E*p,n[1]=E*c-s*L,n[2]=s*p-h*c,n[3]=y*p-d*L,n[4]=o*L-y*c,n[5]=d*c-o*p,n[6]=d*E-y*h,n[7]=y*s-o*E,n[8]=o*h-d*s;const N=1/F;return Matrix3.multiplyByScalar(n,N,n)};const scratchTransposeMatrix$1=new Matrix3;Matrix3.inverseTranspose=function(t,n){return Check.typeOf.object("matrix",t),Check.typeOf.object("result",n),Matrix3.inverse(Matrix3.transpose(t,scratchTransposeMatrix$1),n)},Matrix3.equals=function(t,n){return t===n||defined(t)&&defined(n)&&t[0]===n[0]&&t[1]===n[1]&&t[2]===n[2]&&t[3]===n[3]&&t[4]===n[4]&&t[5]===n[5]&&t[6]===n[6]&&t[7]===n[7]&&t[8]===n[8]},Matrix3.equalsEpsilon=function(t,n,o){return o=defaultValue(o,0),t===n||defined(t)&&defined(n)&&Math.abs(t[0]-n[0])<=o&&Math.abs(t[1]-n[1])<=o&&Math.abs(t[2]-n[2])<=o&&Math.abs(t[3]-n[3])<=o&&Math.abs(t[4]-n[4])<=o&&Math.abs(t[5]-n[5])<=o&&Math.abs(t[6]-n[6])<=o&&Math.abs(t[7]-n[7])<=o&&Math.abs(t[8]-n[8])<=o},Matrix3.IDENTITY=Object.freeze(new Matrix3(1,0,0,0,1,0,0,0,1)),Matrix3.ZERO=Object.freeze(new Matrix3(0,0,0,0,0,0,0,0,0)),Matrix3.COLUMN0ROW0=0,Matrix3.COLUMN0ROW1=1,Matrix3.COLUMN0ROW2=2,Matrix3.COLUMN1ROW0=3,Matrix3.COLUMN1ROW1=4,Matrix3.COLUMN1ROW2=5,Matrix3.COLUMN2ROW0=6,Matrix3.COLUMN2ROW1=7,Matrix3.COLUMN2ROW2=8,Object.defineProperties(Matrix3.prototype,{length:{get:function(){return Matrix3.packedLength}}}),Matrix3.prototype.clone=function(t){return Matrix3.clone(this,t)},Matrix3.prototype.equals=function(t){return Matrix3.equals(this,t)},Matrix3.equalsArray=function(t,n,o){return t[0]===n[o]&&t[1]===n[o+1]&&t[2]===n[o+2]&&t[3]===n[o+3]&&t[4]===n[o+4]&&t[5]===n[o+5]&&t[6]===n[o+6]&&t[7]===n[o+7]&&t[8]===n[o+8]},Matrix3.prototype.equalsEpsilon=function(t,n){return Matrix3.equalsEpsilon(this,t,n)},Matrix3.prototype.toString=function(){return`(${this[0]}, ${this[3]}, ${this[6]})
|
|
126
126
|
(${this[1]}, ${this[4]}, ${this[7]})
|
|
127
127
|
(${this[2]}, ${this[5]}, ${this[8]})`};function Cartesian4(t,n,o,s){this.x=defaultValue(t,0),this.y=defaultValue(n,0),this.z=defaultValue(o,0),this.w=defaultValue(s,0)}Cartesian4.fromElements=function(t,n,o,s,c){return defined(c)?(c.x=t,c.y=n,c.z=o,c.w=s,c):new Cartesian4(t,n,o,s)},Cartesian4.fromColor=function(t,n){return Check.typeOf.object("color",t),defined(n)?(n.x=t.red,n.y=t.green,n.z=t.blue,n.w=t.alpha,n):new Cartesian4(t.red,t.green,t.blue,t.alpha)},Cartesian4.clone=function(t,n){if(defined(t))return defined(n)?(n.x=t.x,n.y=t.y,n.z=t.z,n.w=t.w,n):new Cartesian4(t.x,t.y,t.z,t.w)},Cartesian4.packedLength=4,Cartesian4.pack=function(t,n,o){return Check.typeOf.object("value",t),Check.defined("array",n),o=defaultValue(o,0),n[o++]=t.x,n[o++]=t.y,n[o++]=t.z,n[o]=t.w,n},Cartesian4.unpack=function(t,n,o){return Check.defined("array",t),n=defaultValue(n,0),defined(o)||(o=new Cartesian4),o.x=t[n++],o.y=t[n++],o.z=t[n++],o.w=t[n],o},Cartesian4.packArray=function(t,n){Check.defined("array",t);const o=t.length,s=o*4;if(!defined(n))n=new Array(s);else{if(!Array.isArray(n)&&n.length!==s)throw new DeveloperError("If result is a typed array, it must have exactly array.length * 4 elements");n.length!==s&&(n.length=s)}for(let c=0;c<o;++c)Cartesian4.pack(t[c],n,c*4);return n},Cartesian4.unpackArray=function(t,n){if(Check.defined("array",t),Check.typeOf.number.greaterThanOrEquals("array.length",t.length,4),t.length%4!==0)throw new DeveloperError("array length must be a multiple of 4.");const o=t.length;defined(n)?n.length=o/4:n=new Array(o/4);for(let s=0;s<o;s+=4){const c=s/4;n[c]=Cartesian4.unpack(t,s,n[c])}return n},Cartesian4.fromArray=Cartesian4.unpack,Cartesian4.maximumComponent=function(t){return Check.typeOf.object("cartesian",t),Math.max(t.x,t.y,t.z,t.w)},Cartesian4.minimumComponent=function(t){return Check.typeOf.object("cartesian",t),Math.min(t.x,t.y,t.z,t.w)},Cartesian4.minimumByComponent=function(t,n,o){return Check.typeOf.object("first",t),Check.typeOf.object("second",n),Check.typeOf.object("result",o),o.x=Math.min(t.x,n.x),o.y=Math.min(t.y,n.y),o.z=Math.min(t.z,n.z),o.w=Math.min(t.w,n.w),o},Cartesian4.maximumByComponent=function(t,n,o){return Check.typeOf.object("first",t),Check.typeOf.object("second",n),Check.typeOf.object("result",o),o.x=Math.max(t.x,n.x),o.y=Math.max(t.y,n.y),o.z=Math.max(t.z,n.z),o.w=Math.max(t.w,n.w),o},Cartesian4.clamp=function(t,n,o,s){Check.typeOf.object("value",t),Check.typeOf.object("min",n),Check.typeOf.object("max",o),Check.typeOf.object("result",s);const c=CesiumMath.clamp(t.x,n.x,o.x),d=CesiumMath.clamp(t.y,n.y,o.y),h=CesiumMath.clamp(t.z,n.z,o.z),p=CesiumMath.clamp(t.w,n.w,o.w);return s.x=c,s.y=d,s.z=h,s.w=p,s},Cartesian4.magnitudeSquared=function(t){return Check.typeOf.object("cartesian",t),t.x*t.x+t.y*t.y+t.z*t.z+t.w*t.w},Cartesian4.magnitude=function(t){return Math.sqrt(Cartesian4.magnitudeSquared(t))};const distanceScratch=new Cartesian4;Cartesian4.distance=function(t,n){return Check.typeOf.object("left",t),Check.typeOf.object("right",n),Cartesian4.subtract(t,n,distanceScratch),Cartesian4.magnitude(distanceScratch)},Cartesian4.distanceSquared=function(t,n){return Check.typeOf.object("left",t),Check.typeOf.object("right",n),Cartesian4.subtract(t,n,distanceScratch),Cartesian4.magnitudeSquared(distanceScratch)},Cartesian4.normalize=function(t,n){Check.typeOf.object("cartesian",t),Check.typeOf.object("result",n);const o=Cartesian4.magnitude(t);if(n.x=t.x/o,n.y=t.y/o,n.z=t.z/o,n.w=t.w/o,isNaN(n.x)||isNaN(n.y)||isNaN(n.z)||isNaN(n.w))throw new DeveloperError("normalized result is not a number");return n},Cartesian4.dot=function(t,n){return Check.typeOf.object("left",t),Check.typeOf.object("right",n),t.x*n.x+t.y*n.y+t.z*n.z+t.w*n.w},Cartesian4.multiplyComponents=function(t,n,o){return Check.typeOf.object("left",t),Check.typeOf.object("right",n),Check.typeOf.object("result",o),o.x=t.x*n.x,o.y=t.y*n.y,o.z=t.z*n.z,o.w=t.w*n.w,o},Cartesian4.divideComponents=function(t,n,o){return Check.typeOf.object("left",t),Check.typeOf.object("right",n),Check.typeOf.object("result",o),o.x=t.x/n.x,o.y=t.y/n.y,o.z=t.z/n.z,o.w=t.w/n.w,o},Cartesian4.add=function(t,n,o){return Check.typeOf.object("left",t),Check.typeOf.object("right",n),Check.typeOf.object("result",o),o.x=t.x+n.x,o.y=t.y+n.y,o.z=t.z+n.z,o.w=t.w+n.w,o},Cartesian4.subtract=function(t,n,o){return Check.typeOf.object("left",t),Check.typeOf.object("right",n),Check.typeOf.object("result",o),o.x=t.x-n.x,o.y=t.y-n.y,o.z=t.z-n.z,o.w=t.w-n.w,o},Cartesian4.multiplyByScalar=function(t,n,o){return Check.typeOf.object("cartesian",t),Check.typeOf.number("scalar",n),Check.typeOf.object("result",o),o.x=t.x*n,o.y=t.y*n,o.z=t.z*n,o.w=t.w*n,o},Cartesian4.divideByScalar=function(t,n,o){return Check.typeOf.object("cartesian",t),Check.typeOf.number("scalar",n),Check.typeOf.object("result",o),o.x=t.x/n,o.y=t.y/n,o.z=t.z/n,o.w=t.w/n,o},Cartesian4.negate=function(t,n){return Check.typeOf.object("cartesian",t),Check.typeOf.object("result",n),n.x=-t.x,n.y=-t.y,n.z=-t.z,n.w=-t.w,n},Cartesian4.abs=function(t,n){return Check.typeOf.object("cartesian",t),Check.typeOf.object("result",n),n.x=Math.abs(t.x),n.y=Math.abs(t.y),n.z=Math.abs(t.z),n.w=Math.abs(t.w),n};const lerpScratch$1=new Cartesian4;Cartesian4.lerp=function(t,n,o,s){return Check.typeOf.object("start",t),Check.typeOf.object("end",n),Check.typeOf.number("t",o),Check.typeOf.object("result",s),Cartesian4.multiplyByScalar(n,o,lerpScratch$1),s=Cartesian4.multiplyByScalar(t,1-o,s),Cartesian4.add(lerpScratch$1,s,s)};const mostOrthogonalAxisScratch=new Cartesian4;Cartesian4.mostOrthogonalAxis=function(t,n){Check.typeOf.object("cartesian",t),Check.typeOf.object("result",n);const o=Cartesian4.normalize(t,mostOrthogonalAxisScratch);return Cartesian4.abs(o,o),o.x<=o.y?o.x<=o.z?o.x<=o.w?n=Cartesian4.clone(Cartesian4.UNIT_X,n):n=Cartesian4.clone(Cartesian4.UNIT_W,n):o.z<=o.w?n=Cartesian4.clone(Cartesian4.UNIT_Z,n):n=Cartesian4.clone(Cartesian4.UNIT_W,n):o.y<=o.z?o.y<=o.w?n=Cartesian4.clone(Cartesian4.UNIT_Y,n):n=Cartesian4.clone(Cartesian4.UNIT_W,n):o.z<=o.w?n=Cartesian4.clone(Cartesian4.UNIT_Z,n):n=Cartesian4.clone(Cartesian4.UNIT_W,n),n},Cartesian4.equals=function(t,n){return t===n||defined(t)&&defined(n)&&t.x===n.x&&t.y===n.y&&t.z===n.z&&t.w===n.w},Cartesian4.equalsArray=function(t,n,o){return t.x===n[o]&&t.y===n[o+1]&&t.z===n[o+2]&&t.w===n[o+3]},Cartesian4.equalsEpsilon=function(t,n,o,s){return t===n||defined(t)&&defined(n)&&CesiumMath.equalsEpsilon(t.x,n.x,o,s)&&CesiumMath.equalsEpsilon(t.y,n.y,o,s)&&CesiumMath.equalsEpsilon(t.z,n.z,o,s)&&CesiumMath.equalsEpsilon(t.w,n.w,o,s)},Cartesian4.ZERO=Object.freeze(new Cartesian4(0,0,0,0)),Cartesian4.ONE=Object.freeze(new Cartesian4(1,1,1,1)),Cartesian4.UNIT_X=Object.freeze(new Cartesian4(1,0,0,0)),Cartesian4.UNIT_Y=Object.freeze(new Cartesian4(0,1,0,0)),Cartesian4.UNIT_Z=Object.freeze(new Cartesian4(0,0,1,0)),Cartesian4.UNIT_W=Object.freeze(new Cartesian4(0,0,0,1)),Cartesian4.prototype.clone=function(t){return Cartesian4.clone(this,t)},Cartesian4.prototype.equals=function(t){return Cartesian4.equals(this,t)},Cartesian4.prototype.equalsEpsilon=function(t,n,o){return Cartesian4.equalsEpsilon(this,t,n,o)},Cartesian4.prototype.toString=function(){return`(${this.x}, ${this.y}, ${this.z}, ${this.w})`};const scratchF32Array=new Float32Array(1),scratchU8Array=new Uint8Array(scratchF32Array.buffer),testU32=new Uint32Array([287454020]),testU8=new Uint8Array(testU32.buffer),littleEndian=testU8[0]===68;Cartesian4.packFloat=function(t,n){return Check.typeOf.number("value",t),defined(n)||(n=new Cartesian4),scratchF32Array[0]=t,littleEndian?(n.x=scratchU8Array[0],n.y=scratchU8Array[1],n.z=scratchU8Array[2],n.w=scratchU8Array[3]):(n.x=scratchU8Array[3],n.y=scratchU8Array[2],n.z=scratchU8Array[1],n.w=scratchU8Array[0]),n},Cartesian4.unpackFloat=function(t){return Check.typeOf.object("packedFloat",t),littleEndian?(scratchU8Array[0]=t.x,scratchU8Array[1]=t.y,scratchU8Array[2]=t.z,scratchU8Array[3]=t.w):(scratchU8Array[0]=t.w,scratchU8Array[1]=t.z,scratchU8Array[2]=t.y,scratchU8Array[3]=t.x),scratchF32Array[0]};function RuntimeError(t){this.name="RuntimeError",this.message=t;let n;try{throw new Error}catch(o){n=o.stack}this.stack=n}defined(Object.create)&&(RuntimeError.prototype=Object.create(Error.prototype),RuntimeError.prototype.constructor=RuntimeError),RuntimeError.prototype.toString=function(){let t=`${this.name}: ${this.message}`;return defined(this.stack)&&(t+=`
|
|
@@ -5829,7 +5829,7 @@ void main()
|
|
|
5829
5829
|
`;let defaultVertexShaderSource=`${PolylineCommon}
|
|
5830
5830
|
${PolylineMaterialAppearanceVS}`;const defaultFragmentShaderSource=PolylineFS;FeatureDetection.isInternetExplorer()||(defaultVertexShaderSource=`#define CLIP_POLYLINE
|
|
5831
5831
|
${defaultVertexShaderSource}`);function PolylineMaterialAppearance(t){t=defaultValue(t,defaultValue.EMPTY_OBJECT);const n=defaultValue(t.translucent,!0),o=!1,s=PolylineMaterialAppearance.VERTEX_FORMAT;this.material=defined(t.material)?t.material:Material.fromType(Material.ColorType),this.translucent=n,this._vertexShaderSource=defaultValue(t.vertexShaderSource,defaultVertexShaderSource),this._fragmentShaderSource=defaultValue(t.fragmentShaderSource,defaultFragmentShaderSource),this._renderState=Appearance.getDefaultRenderState(n,o,t.renderState),this._closed=o,this._vertexFormat=s}Object.defineProperties(PolylineMaterialAppearance.prototype,{vertexShaderSource:{get:function(){let t=this._vertexShaderSource;return this.material.shaderSource.search(/in\s+float\s+v_polylineAngle;/g)!==-1&&(t=`#define POLYLINE_DASH
|
|
5832
|
-
${t}`),t}},fragmentShaderSource:{get:function(){return this._fragmentShaderSource}},renderState:{get:function(){return this._renderState}},closed:{get:function(){return this._closed}},vertexFormat:{get:function(){return this._vertexFormat}}}),PolylineMaterialAppearance.VERTEX_FORMAT=VertexFormat.POSITION_AND_ST,PolylineMaterialAppearance.prototype.getFragmentShaderSource=Appearance.prototype.getFragmentShaderSource,PolylineMaterialAppearance.prototype.isTranslucent=Appearance.prototype.isTranslucent,PolylineMaterialAppearance.prototype.getRenderState=Appearance.prototype.getRenderState;function GroundPolylinePrimitive(t){t=defaultValue(t,defaultValue.EMPTY_OBJECT),this.geometryInstances=t.geometryInstances,this._hasPerInstanceColors=!0;let n=t.appearance;defined(n)||(n=new PolylineMaterialAppearance),this.appearance=n,this.show=defaultValue(t.show,!0),this.classificationType=defaultValue(t.classificationType,ClassificationType$1.BOTH),this.debugShowBoundingVolume=defaultValue(t.debugShowBoundingVolume,!1),this._debugShowShadowVolume=defaultValue(t.debugShowShadowVolume,!1),this._primitiveOptions={geometryInstances:void 0,appearance:void 0,vertexCacheOptimize:!1,interleave:defaultValue(t.interleave,!1),releaseGeometryInstances:defaultValue(t.releaseGeometryInstances,!0),allowPicking:defaultValue(t.allowPicking,!0),asynchronous:defaultValue(t.asynchronous,!0),compressVertices:!1,_createShaderProgramFunction:void 0,_createCommandsFunction:void 0,_updateAndQueueCommandsFunction:void 0},this._zIndex=void 0,this._ready=!1,this._primitive=void 0,this._sp=void 0,this._sp2D=void 0,this._spMorph=void 0,this._renderState=getRenderState(!1),this._renderState3DTiles=getRenderState(!0),this._renderStateMorph=RenderState.fromCache({cull:{enabled:!0,face:CullFace$1.FRONT},depthTest:{enabled:!0},blending:BlendingState$1.PRE_MULTIPLIED_ALPHA_BLEND,depthMask:!1})}Object.defineProperties(GroundPolylinePrimitive.prototype,{interleave:{get:function(){return this._primitiveOptions.interleave}},releaseGeometryInstances:{get:function(){return this._primitiveOptions.releaseGeometryInstances}},allowPicking:{get:function(){return this._primitiveOptions.allowPicking}},asynchronous:{get:function(){return this._primitiveOptions.asynchronous}},ready:{get:function(){return this._ready}},debugShowShadowVolume:{get:function(){return this._debugShowShadowVolume}}}),GroundPolylinePrimitive.initializeTerrainHeights=function(){return ApproximateTerrainHeights.initialize()};function createShaderProgram(t,n,o){const s=n.context,c=t._primitive,d=c._attributeLocations;let h=c._batchTable.getVertexShaderCallback()(PolylineShadowVolumeVS);h=Primitive._appendShowToShader(c,h),h=Primitive._appendDistanceDisplayConditionToShader(c,h),h=Primitive._modifyShaderPosition(t,h,n.scene3DOnly);let p=c._batchTable.getVertexShaderCallback()(PolylineShadowVolumeMorphVS);p=Primitive._appendShowToShader(c,p),p=Primitive._appendDistanceDisplayConditionToShader(c,p),p=Primitive._modifyShaderPosition(t,p,n.scene3DOnly);let y=c._batchTable.getVertexShaderCallback()(PolylineShadowVolumeFS);const E=[`GLOBE_MINIMUM_ALTITUDE ${n.mapProjection.ellipsoid.minimumRadius.toFixed(1)}`];let L="",F="";defined(o.material)?(F=defined(o.material)?o.material.shaderSource:"",F.search(/in\s+float\s+v_polylineAngle;/g)!==-1&&E.push("ANGLE_VARYING"),F.search(/in\s+float\s+v_width;/g)!==-1&&E.push("WIDTH_VARYING")):L="PER_INSTANCE_COLOR",E.push(L);const N=t.debugShowShadowVolume?["DEBUG_SHOW_VOLUME",L]:[L],z=new ShaderSource({defines:E,sources:[h]}),oe=new ShaderSource({defines:N,sources:[F,y]});t._sp=ShaderProgram.replaceCache({context:s,shaderProgram:c._sp,vertexShaderSource:z,fragmentShaderSource:oe,attributeLocations:d});let W=s.shaderCache.getDerivedShaderProgram(t._sp,"2dColor");if(!defined(W)){const lt=new ShaderSource({defines:E.concat(["COLUMBUS_VIEW_2D"]),sources:[h]});W=s.shaderCache.createDerivedShaderProgram(t._sp,"2dColor",{context:s,shaderProgram:t._sp2D,vertexShaderSource:lt,fragmentShaderSource:oe,attributeLocations:d})}t._sp2D=W;let nt=s.shaderCache.getDerivedShaderProgram(t._sp,"MorphColor");if(!defined(nt)){const lt=new ShaderSource({defines:E.concat([`MAX_TERRAIN_HEIGHT ${ApproximateTerrainHeights._defaultMaxTerrainHeight.toFixed(1)}`]),sources:[p]});y=c._batchTable.getVertexShaderCallback()(PolylineShadowVolumeMorphFS);const Ee=new ShaderSource({defines:N,sources:[F,y]});nt=s.shaderCache.createDerivedShaderProgram(t._sp,"MorphColor",{context:s,shaderProgram:t._spMorph,vertexShaderSource:lt,fragmentShaderSource:Ee,attributeLocations:d})}t._spMorph=nt}function getRenderState(t){return RenderState.fromCache({cull:{enabled:!0},blending:BlendingState$1.PRE_MULTIPLIED_ALPHA_BLEND,depthMask:!1,stencilTest:{enabled:t,frontFunction:StencilFunction$1.EQUAL,frontOperation:{fail:StencilOperation$1.KEEP,zFail:StencilOperation$1.KEEP,zPass:StencilOperation$1.KEEP},backFunction:StencilFunction$1.EQUAL,backOperation:{fail:StencilOperation$1.KEEP,zFail:StencilOperation$1.KEEP,zPass:StencilOperation$1.KEEP},reference:StencilConstants$1.CESIUM_3D_TILE_MASK,mask:StencilConstants$1.CESIUM_3D_TILE_MASK}})}function createCommands(t,n,o,s,c,d){const h=t._primitive,p=h._va.length;c.length=p,d.length=p;const E=n instanceof PolylineColorAppearance?{}:o._uniforms,L=h._batchTable.getUniformMapCallback()(E);for(let F=0;F<p;F++){const N=h._va[F];let z=c[F];defined(z)||(z=c[F]=new DrawCommand({owner:t,primitiveType:h._primitiveType})),z.vertexArray=N,z.renderState=t._renderState,z.shaderProgram=t._sp,z.uniformMap=L,z.pass=Pass$1.TERRAIN_CLASSIFICATION,z.pickId="czm_batchTable_pickColor(v_endPlaneNormalEcAndBatchId.w)";const oe=DrawCommand.shallowClone(z,z.derivedCommands.tileset);oe.renderState=t._renderState3DTiles,oe.pass=Pass$1.CESIUM_3D_TILE_CLASSIFICATION,z.derivedCommands.tileset=oe;const W=DrawCommand.shallowClone(z,z.derivedCommands.color2D);W.shaderProgram=t._sp2D,z.derivedCommands.color2D=W;const nt=DrawCommand.shallowClone(oe,oe.derivedCommands.color2D);nt.shaderProgram=t._sp2D,oe.derivedCommands.color2D=nt;const lt=DrawCommand.shallowClone(z,z.derivedCommands.colorMorph);lt.renderState=t._renderStateMorph,lt.shaderProgram=t._spMorph,lt.pickId="czm_batchTable_pickColor(v_batchId)",z.derivedCommands.colorMorph=lt}}function updateAndQueueCommand(t,n,o,s,c,d,h){o.mode===SceneMode$1.MORPHING?n=n.derivedCommands.colorMorph:o.mode!==SceneMode$1.SCENE3D&&(n=n.derivedCommands.color2D),n.modelMatrix=s,n.boundingVolume=d,n.cull=c,n.debugShowBoundingVolume=h,o.commandList.push(n)}function updateAndQueueCommands(t,n,o,s,c,d,h){const p=t._primitive;Primitive._updateBoundingVolumes(p,n,c);let y;n.mode===SceneMode$1.SCENE3D?y=p._boundingSphereWC:n.mode===SceneMode$1.COLUMBUS_VIEW?y=p._boundingSphereCV:n.mode===SceneMode$1.SCENE2D&&defined(p._boundingSphere2D)?y=p._boundingSphere2D:defined(p._boundingSphereMorph)&&(y=p._boundingSphereMorph);const E=n.mode===SceneMode$1.MORPHING,L=t.classificationType,F=L!==ClassificationType$1.CESIUM_3D_TILE,N=L!==ClassificationType$1.TERRAIN&&!E;let z;const oe=n.passes;if(oe.render||oe.pick&&p.allowPicking){const W=o.length;for(let nt=0;nt<W;++nt){const lt=y[nt];F&&(z=o[nt],updateAndQueueCommand(t,z,n,c,d,lt,h)),N&&(z=o[nt].derivedCommands.tileset,updateAndQueueCommand(t,z,n,c,d,lt,h))}}}GroundPolylinePrimitive.prototype.update=function(t){if(!defined(this._primitive)&&!defined(this.geometryInstances))return;if(!ApproximateTerrainHeights.initialized){if(!this.asynchronous)throw new DeveloperError("For synchronous GroundPolylinePrimitives, you must call GroundPolylinePrimitives.initializeTerrainHeights() and wait for the returned promise to resolve.");GroundPolylinePrimitive.initializeTerrainHeights();return}let n;const o=this,s=this._primitiveOptions;if(!defined(this._primitive)){const c=Array.isArray(this.geometryInstances)?this.geometryInstances:[this.geometryInstances],d=c.length,h=new Array(d);let p;for(n=0;n<d;++n)if(p=c[n].attributes,!defined(p)||!defined(p.color)){this._hasPerInstanceColors=!1;break}for(n=0;n<d;++n){const y=c[n];p={};const E=y.attributes;for(const L in E)E.hasOwnProperty(L)&&(p[L]=E[L]);defined(p.width)||(p.width=new GeometryInstanceAttribute({componentDatatype:ComponentDatatype$1.UNSIGNED_BYTE,componentsPerAttribute:1,value:[y.geometry.width]})),y.geometry._scene3DOnly=t.scene3DOnly,GroundPolylineGeometry.setProjectionAndEllipsoid(y.geometry,t.mapProjection),h[n]=new GeometryInstance({geometry:y.geometry,attributes:p,id:y.id,pickPrimitive:o})}s.geometryInstances=h,s.appearance=this.appearance,s._createShaderProgramFunction=function(y,E,L){createShaderProgram(o,E,L)},s._createCommandsFunction=function(y,E,L,F,N,z,oe){createCommands(o,E,L,F,z,oe)},s._updateAndQueueCommandsFunction=function(y,E,L,F,N,z,oe,W){updateAndQueueCommands(o,E,L,F,N,z,oe)},this._primitive=new Primitive(s)}if(this.appearance instanceof PolylineColorAppearance&&!this._hasPerInstanceColors)throw new DeveloperError("All GeometryInstances must have color attributes to use PolylineColorAppearance with GroundPolylinePrimitive.");this._primitive.appearance=this.appearance,this._primitive.show=this.show,this._primitive.debugShowBoundingVolume=this.debugShowBoundingVolume,this._primitive.update(t),t.afterRender.push(()=>{!this._ready&&defined(this._primitive)&&this._primitive.ready&&(this._ready=!0,this.releaseGeometryInstances&&(this.geometryInstances=void 0))})},GroundPolylinePrimitive.prototype.getGeometryInstanceAttributes=function(t){if(!defined(this._primitive))throw new DeveloperError("must call update before calling getGeometryInstanceAttributes");return this._primitive.getGeometryInstanceAttributes(t)},GroundPolylinePrimitive.isSupported=function(t){return t.frameState.context.depthTexture},GroundPolylinePrimitive.prototype.isDestroyed=function(){return!1},GroundPolylinePrimitive.prototype.destroy=function(){return this._primitive=this._primitive&&this._primitive.destroy(),this._sp=this._sp&&this._sp.destroy(),this._sp2D=void 0,this._spMorph=void 0,destroyObject(this)};const defaultRepeat=new Cartesian2(1,1),defaultTransparent=!1,defaultColor$1=Color$1.WHITE;function ImageMaterialProperty(t){t=defaultValue(t,defaultValue.EMPTY_OBJECT),this._definitionChanged=new Event$1,this._image=void 0,this._imageSubscription=void 0,this._repeat=void 0,this._repeatSubscription=void 0,this._color=void 0,this._colorSubscription=void 0,this._transparent=void 0,this._transparentSubscription=void 0,this.image=t.image,this.repeat=t.repeat,this.color=t.color,this.transparent=t.transparent}Object.defineProperties(ImageMaterialProperty.prototype,{isConstant:{get:function(){return Property.isConstant(this._image)&&Property.isConstant(this._repeat)}},definitionChanged:{get:function(){return this._definitionChanged}},image:createPropertyDescriptor("image"),repeat:createPropertyDescriptor("repeat"),color:createPropertyDescriptor("color"),transparent:createPropertyDescriptor("transparent")}),ImageMaterialProperty.prototype.getType=function(t){return"Image"},ImageMaterialProperty.prototype.getValue=function(t,n){return defined(n)||(n={}),n.image=Property.getValueOrUndefined(this._image,t),n.repeat=Property.getValueOrClonedDefault(this._repeat,t,defaultRepeat,n.repeat),n.color=Property.getValueOrClonedDefault(this._color,t,defaultColor$1,n.color),Property.getValueOrDefault(this._transparent,t,defaultTransparent)&&(n.color.alpha=Math.min(.99,n.color.alpha)),n},ImageMaterialProperty.prototype.equals=function(t){return this===t||t instanceof ImageMaterialProperty&&Property.equals(this._image,t._image)&&Property.equals(this._repeat,t._repeat)&&Property.equals(this._color,t._color)&&Property.equals(this._transparent,t._transparent)};function createMaterialProperty(t){if(t instanceof Color$1)return new ColorMaterialProperty(t);if(typeof t=="string"||t instanceof Resource$1||t instanceof HTMLCanvasElement||t instanceof HTMLVideoElement){const n=new ImageMaterialProperty;return n.image=t,n}throw new DeveloperError(`Unable to infer material type: ${t}`)}function createMaterialPropertyDescriptor(t,n){return createPropertyDescriptor(t,n,createMaterialProperty)}function BoxGraphics(t){this._definitionChanged=new Event$1,this._show=void 0,this._showSubscription=void 0,this._dimensions=void 0,this._dimensionsSubscription=void 0,this._heightReference=void 0,this._heightReferenceSubscription=void 0,this._fill=void 0,this._fillSubscription=void 0,this._material=void 0,this._materialSubscription=void 0,this._outline=void 0,this._outlineSubscription=void 0,this._outlineColor=void 0,this._outlineColorSubscription=void 0,this._outlineWidth=void 0,this._outlineWidthSubscription=void 0,this._shadows=void 0,this._shadowsSubscription=void 0,this._distanceDisplayCondition=void 0,this._distanceDisplayConditionSubscription=void 0,this.merge(defaultValue(t,defaultValue.EMPTY_OBJECT))}Object.defineProperties(BoxGraphics.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:createPropertyDescriptor("show"),dimensions:createPropertyDescriptor("dimensions"),heightReference:createPropertyDescriptor("heightReference"),fill:createPropertyDescriptor("fill"),material:createMaterialPropertyDescriptor("material"),outline:createPropertyDescriptor("outline"),outlineColor:createPropertyDescriptor("outlineColor"),outlineWidth:createPropertyDescriptor("outlineWidth"),shadows:createPropertyDescriptor("shadows"),distanceDisplayCondition:createPropertyDescriptor("distanceDisplayCondition")}),BoxGraphics.prototype.clone=function(t){return defined(t)?(t.show=this.show,t.dimensions=this.dimensions,t.heightReference=this.heightReference,t.fill=this.fill,t.material=this.material,t.outline=this.outline,t.outlineColor=this.outlineColor,t.outlineWidth=this.outlineWidth,t.shadows=this.shadows,t.distanceDisplayCondition=this.distanceDisplayCondition,t):new BoxGraphics(this)},BoxGraphics.prototype.merge=function(t){if(!defined(t))throw new DeveloperError("source is required.");this.show=defaultValue(this.show,t.show),this.dimensions=defaultValue(this.dimensions,t.dimensions),this.heightReference=defaultValue(this.heightReference,t.heightReference),this.fill=defaultValue(this.fill,t.fill),this.material=defaultValue(this.material,t.material),this.outline=defaultValue(this.outline,t.outline),this.outlineColor=defaultValue(this.outlineColor,t.outlineColor),this.outlineWidth=defaultValue(this.outlineWidth,t.outlineWidth),this.shadows=defaultValue(this.shadows,t.shadows),this.distanceDisplayCondition=defaultValue(this.distanceDisplayCondition,t.distanceDisplayCondition)};function PositionProperty(){DeveloperError.throwInstantiationError()}Object.defineProperties(PositionProperty.prototype,{isConstant:{get:DeveloperError.throwInstantiationError},definitionChanged:{get:DeveloperError.throwInstantiationError},referenceFrame:{get:DeveloperError.throwInstantiationError}}),PositionProperty.prototype.getValue=DeveloperError.throwInstantiationError,PositionProperty.prototype.getValueInReferenceFrame=DeveloperError.throwInstantiationError,PositionProperty.prototype.equals=DeveloperError.throwInstantiationError;const scratchMatrix3=new Matrix3;PositionProperty.convertToReferenceFrame=function(t,n,o,s,c){if(!defined(n))return n;if(defined(c)||(c=new Cartesian3),o===s)return Cartesian3.clone(n,c);let d=Transforms.computeIcrfToFixedMatrix(t,scratchMatrix3);if(defined(d)||(d=Transforms.computeTemeToPseudoFixedMatrix(t,scratchMatrix3)),o===ReferenceFrame$1.INERTIAL)return Matrix3.multiplyByVector(d,n,c);if(o===ReferenceFrame$1.FIXED)return Matrix3.multiplyByVector(Matrix3.transpose(d,scratchMatrix3),n,c)};function ConstantPositionProperty(t,n){this._definitionChanged=new Event$1,this._value=Cartesian3.clone(t),this._referenceFrame=defaultValue(n,ReferenceFrame$1.FIXED)}Object.defineProperties(ConstantPositionProperty.prototype,{isConstant:{get:function(){return!defined(this._value)||this._referenceFrame===ReferenceFrame$1.FIXED}},definitionChanged:{get:function(){return this._definitionChanged}},referenceFrame:{get:function(){return this._referenceFrame}}}),ConstantPositionProperty.prototype.getValue=function(t,n){return this.getValueInReferenceFrame(t,ReferenceFrame$1.FIXED,n)},ConstantPositionProperty.prototype.setValue=function(t,n){let o=!1;Cartesian3.equals(this._value,t)||(o=!0,this._value=Cartesian3.clone(t)),defined(n)&&this._referenceFrame!==n&&(o=!0,this._referenceFrame=n),o&&this._definitionChanged.raiseEvent(this)},ConstantPositionProperty.prototype.getValueInReferenceFrame=function(t,n,o){if(!defined(t))throw new DeveloperError("time is required.");if(!defined(n))throw new DeveloperError("referenceFrame is required.");return PositionProperty.convertToReferenceFrame(t,this._value,this._referenceFrame,n,o)},ConstantPositionProperty.prototype.equals=function(t){return this===t||t instanceof ConstantPositionProperty&&Cartesian3.equals(this._value,t._value)&&this._referenceFrame===t._referenceFrame};function CorridorGraphics(t){this._definitionChanged=new Event$1,this._show=void 0,this._showSubscription=void 0,this._positions=void 0,this._positionsSubscription=void 0,this._width=void 0,this._widthSubscription=void 0,this._height=void 0,this._heightSubscription=void 0,this._heightReference=void 0,this._heightReferenceSubscription=void 0,this._extrudedHeight=void 0,this._extrudedHeightSubscription=void 0,this._extrudedHeightReference=void 0,this._extrudedHeightReferenceSubscription=void 0,this._cornerType=void 0,this._cornerTypeSubscription=void 0,this._granularity=void 0,this._granularitySubscription=void 0,this._fill=void 0,this._fillSubscription=void 0,this._material=void 0,this._materialSubscription=void 0,this._outline=void 0,this._outlineSubscription=void 0,this._outlineColor=void 0,this._outlineColorSubscription=void 0,this._outlineWidth=void 0,this._outlineWidthSubscription=void 0,this._shadows=void 0,this._shadowsSubscription=void 0,this._distanceDisplayCondition=void 0,this._distanceDisplayConditionSubscription=void 0,this._classificationType=void 0,this._classificationTypeSubscription=void 0,this._zIndex=void 0,this._zIndexSubscription=void 0,this.merge(defaultValue(t,defaultValue.EMPTY_OBJECT))}Object.defineProperties(CorridorGraphics.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:createPropertyDescriptor("show"),positions:createPropertyDescriptor("positions"),width:createPropertyDescriptor("width"),height:createPropertyDescriptor("height"),heightReference:createPropertyDescriptor("heightReference"),extrudedHeight:createPropertyDescriptor("extrudedHeight"),extrudedHeightReference:createPropertyDescriptor("extrudedHeightReference"),cornerType:createPropertyDescriptor("cornerType"),granularity:createPropertyDescriptor("granularity"),fill:createPropertyDescriptor("fill"),material:createMaterialPropertyDescriptor("material"),outline:createPropertyDescriptor("outline"),outlineColor:createPropertyDescriptor("outlineColor"),outlineWidth:createPropertyDescriptor("outlineWidth"),shadows:createPropertyDescriptor("shadows"),distanceDisplayCondition:createPropertyDescriptor("distanceDisplayCondition"),classificationType:createPropertyDescriptor("classificationType"),zIndex:createPropertyDescriptor("zIndex")}),CorridorGraphics.prototype.clone=function(t){return defined(t)?(t.show=this.show,t.positions=this.positions,t.width=this.width,t.height=this.height,t.heightReference=this.heightReference,t.extrudedHeight=this.extrudedHeight,t.extrudedHeightReference=this.extrudedHeightReference,t.cornerType=this.cornerType,t.granularity=this.granularity,t.fill=this.fill,t.material=this.material,t.outline=this.outline,t.outlineColor=this.outlineColor,t.outlineWidth=this.outlineWidth,t.shadows=this.shadows,t.distanceDisplayCondition=this.distanceDisplayCondition,t.classificationType=this.classificationType,t.zIndex=this.zIndex,t):new CorridorGraphics(this)},CorridorGraphics.prototype.merge=function(t){if(!defined(t))throw new DeveloperError("source is required.");this.show=defaultValue(this.show,t.show),this.positions=defaultValue(this.positions,t.positions),this.width=defaultValue(this.width,t.width),this.height=defaultValue(this.height,t.height),this.heightReference=defaultValue(this.heightReference,t.heightReference),this.extrudedHeight=defaultValue(this.extrudedHeight,t.extrudedHeight),this.extrudedHeightReference=defaultValue(this.extrudedHeightReference,t.extrudedHeightReference),this.cornerType=defaultValue(this.cornerType,t.cornerType),this.granularity=defaultValue(this.granularity,t.granularity),this.fill=defaultValue(this.fill,t.fill),this.material=defaultValue(this.material,t.material),this.outline=defaultValue(this.outline,t.outline),this.outlineColor=defaultValue(this.outlineColor,t.outlineColor),this.outlineWidth=defaultValue(this.outlineWidth,t.outlineWidth),this.shadows=defaultValue(this.shadows,t.shadows),this.distanceDisplayCondition=defaultValue(this.distanceDisplayCondition,t.distanceDisplayCondition),this.classificationType=defaultValue(this.classificationType,t.classificationType),this.zIndex=defaultValue(this.zIndex,t.zIndex)};function createRawProperty(t){return t}function createRawPropertyDescriptor(t,n){return createPropertyDescriptor(t,n,createRawProperty)}function CylinderGraphics(t){this._definitionChanged=new Event$1,this._show=void 0,this._showSubscription=void 0,this._length=void 0,this._lengthSubscription=void 0,this._topRadius=void 0,this._topRadiusSubscription=void 0,this._bottomRadius=void 0,this._bottomRadiusSubscription=void 0,this._heightReference=void 0,this._heightReferenceSubscription=void 0,this._fill=void 0,this._fillSubscription=void 0,this._material=void 0,this._materialSubscription=void 0,this._outline=void 0,this._outlineSubscription=void 0,this._outlineColor=void 0,this._outlineColorSubscription=void 0,this._outlineWidth=void 0,this._outlineWidthSubscription=void 0,this._numberOfVerticalLines=void 0,this._numberOfVerticalLinesSubscription=void 0,this._slices=void 0,this._slicesSubscription=void 0,this._shadows=void 0,this._shadowsSubscription=void 0,this._distanceDisplayCondition=void 0,this._distanceDisplayConditionSubscription=void 0,this.merge(defaultValue(t,defaultValue.EMPTY_OBJECT))}Object.defineProperties(CylinderGraphics.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:createPropertyDescriptor("show"),length:createPropertyDescriptor("length"),topRadius:createPropertyDescriptor("topRadius"),bottomRadius:createPropertyDescriptor("bottomRadius"),heightReference:createPropertyDescriptor("heightReference"),fill:createPropertyDescriptor("fill"),material:createMaterialPropertyDescriptor("material"),outline:createPropertyDescriptor("outline"),outlineColor:createPropertyDescriptor("outlineColor"),outlineWidth:createPropertyDescriptor("outlineWidth"),numberOfVerticalLines:createPropertyDescriptor("numberOfVerticalLines"),slices:createPropertyDescriptor("slices"),shadows:createPropertyDescriptor("shadows"),distanceDisplayCondition:createPropertyDescriptor("distanceDisplayCondition")}),CylinderGraphics.prototype.clone=function(t){return defined(t)?(t.show=this.show,t.length=this.length,t.topRadius=this.topRadius,t.bottomRadius=this.bottomRadius,t.heightReference=this.heightReference,t.fill=this.fill,t.material=this.material,t.outline=this.outline,t.outlineColor=this.outlineColor,t.outlineWidth=this.outlineWidth,t.numberOfVerticalLines=this.numberOfVerticalLines,t.slices=this.slices,t.shadows=this.shadows,t.distanceDisplayCondition=this.distanceDisplayCondition,t):new CylinderGraphics(this)},CylinderGraphics.prototype.merge=function(t){if(!defined(t))throw new DeveloperError("source is required.");this.show=defaultValue(this.show,t.show),this.length=defaultValue(this.length,t.length),this.topRadius=defaultValue(this.topRadius,t.topRadius),this.bottomRadius=defaultValue(this.bottomRadius,t.bottomRadius),this.heightReference=defaultValue(this.heightReference,t.heightReference),this.fill=defaultValue(this.fill,t.fill),this.material=defaultValue(this.material,t.material),this.outline=defaultValue(this.outline,t.outline),this.outlineColor=defaultValue(this.outlineColor,t.outlineColor),this.outlineWidth=defaultValue(this.outlineWidth,t.outlineWidth),this.numberOfVerticalLines=defaultValue(this.numberOfVerticalLines,t.numberOfVerticalLines),this.slices=defaultValue(this.slices,t.slices),this.shadows=defaultValue(this.shadows,t.shadows),this.distanceDisplayCondition=defaultValue(this.distanceDisplayCondition,t.distanceDisplayCondition)};function EllipseGraphics(t){this._definitionChanged=new Event$1,this._show=void 0,this._showSubscription=void 0,this._semiMajorAxis=void 0,this._semiMajorAxisSubscription=void 0,this._semiMinorAxis=void 0,this._semiMinorAxisSubscription=void 0,this._height=void 0,this._heightSubscription=void 0,this._heightReference=void 0,this._heightReferenceSubscription=void 0,this._extrudedHeight=void 0,this._extrudedHeightSubscription=void 0,this._extrudedHeightReference=void 0,this._extrudedHeightReferenceSubscription=void 0,this._rotation=void 0,this._rotationSubscription=void 0,this._stRotation=void 0,this._stRotationSubscription=void 0,this._granularity=void 0,this._granularitySubscription=void 0,this._fill=void 0,this._fillSubscription=void 0,this._material=void 0,this._materialSubscription=void 0,this._outline=void 0,this._outlineSubscription=void 0,this._outlineColor=void 0,this._outlineColorSubscription=void 0,this._outlineWidth=void 0,this._outlineWidthSubscription=void 0,this._numberOfVerticalLines=void 0,this._numberOfVerticalLinesSubscription=void 0,this._shadows=void 0,this._shadowsSubscription=void 0,this._distanceDisplayCondition=void 0,this._distanceDisplayConditionSubscription=void 0,this._classificationType=void 0,this._classificationTypeSubscription=void 0,this._zIndex=void 0,this._zIndexSubscription=void 0,this.merge(defaultValue(t,defaultValue.EMPTY_OBJECT))}Object.defineProperties(EllipseGraphics.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:createPropertyDescriptor("show"),semiMajorAxis:createPropertyDescriptor("semiMajorAxis"),semiMinorAxis:createPropertyDescriptor("semiMinorAxis"),height:createPropertyDescriptor("height"),heightReference:createPropertyDescriptor("heightReference"),extrudedHeight:createPropertyDescriptor("extrudedHeight"),extrudedHeightReference:createPropertyDescriptor("extrudedHeightReference"),rotation:createPropertyDescriptor("rotation"),stRotation:createPropertyDescriptor("stRotation"),granularity:createPropertyDescriptor("granularity"),fill:createPropertyDescriptor("fill"),material:createMaterialPropertyDescriptor("material"),outline:createPropertyDescriptor("outline"),outlineColor:createPropertyDescriptor("outlineColor"),outlineWidth:createPropertyDescriptor("outlineWidth"),numberOfVerticalLines:createPropertyDescriptor("numberOfVerticalLines"),shadows:createPropertyDescriptor("shadows"),distanceDisplayCondition:createPropertyDescriptor("distanceDisplayCondition"),classificationType:createPropertyDescriptor("classificationType"),zIndex:createPropertyDescriptor("zIndex")}),EllipseGraphics.prototype.clone=function(t){return defined(t)?(t.show=this.show,t.semiMajorAxis=this.semiMajorAxis,t.semiMinorAxis=this.semiMinorAxis,t.height=this.height,t.heightReference=this.heightReference,t.extrudedHeight=this.extrudedHeight,t.extrudedHeightReference=this.extrudedHeightReference,t.rotation=this.rotation,t.stRotation=this.stRotation,t.granularity=this.granularity,t.fill=this.fill,t.material=this.material,t.outline=this.outline,t.outlineColor=this.outlineColor,t.outlineWidth=this.outlineWidth,t.numberOfVerticalLines=this.numberOfVerticalLines,t.shadows=this.shadows,t.distanceDisplayCondition=this.distanceDisplayCondition,t.classificationType=this.classificationType,t.zIndex=this.zIndex,t):new EllipseGraphics(this)},EllipseGraphics.prototype.merge=function(t){if(!defined(t))throw new DeveloperError("source is required.");this.show=defaultValue(this.show,t.show),this.semiMajorAxis=defaultValue(this.semiMajorAxis,t.semiMajorAxis),this.semiMinorAxis=defaultValue(this.semiMinorAxis,t.semiMinorAxis),this.height=defaultValue(this.height,t.height),this.heightReference=defaultValue(this.heightReference,t.heightReference),this.extrudedHeight=defaultValue(this.extrudedHeight,t.extrudedHeight),this.extrudedHeightReference=defaultValue(this.extrudedHeightReference,t.extrudedHeightReference),this.rotation=defaultValue(this.rotation,t.rotation),this.stRotation=defaultValue(this.stRotation,t.stRotation),this.granularity=defaultValue(this.granularity,t.granularity),this.fill=defaultValue(this.fill,t.fill),this.material=defaultValue(this.material,t.material),this.outline=defaultValue(this.outline,t.outline),this.outlineColor=defaultValue(this.outlineColor,t.outlineColor),this.outlineWidth=defaultValue(this.outlineWidth,t.outlineWidth),this.numberOfVerticalLines=defaultValue(this.numberOfVerticalLines,t.numberOfVerticalLines),this.shadows=defaultValue(this.shadows,t.shadows),this.distanceDisplayCondition=defaultValue(this.distanceDisplayCondition,t.distanceDisplayCondition),this.classificationType=defaultValue(this.classificationType,t.classificationType),this.zIndex=defaultValue(this.zIndex,t.zIndex)};function EllipsoidGraphics(t){this._definitionChanged=new Event$1,this._show=void 0,this._showSubscription=void 0,this._radii=void 0,this._radiiSubscription=void 0,this._innerRadii=void 0,this._innerRadiiSubscription=void 0,this._minimumClock=void 0,this._minimumClockSubscription=void 0,this._maximumClock=void 0,this._maximumClockSubscription=void 0,this._minimumCone=void 0,this._minimumConeSubscription=void 0,this._maximumCone=void 0,this._maximumConeSubscription=void 0,this._heightReference=void 0,this._heightReferenceSubscription=void 0,this._fill=void 0,this._fillSubscription=void 0,this._material=void 0,this._materialSubscription=void 0,this._outline=void 0,this._outlineSubscription=void 0,this._outlineColor=void 0,this._outlineColorSubscription=void 0,this._outlineWidth=void 0,this._outlineWidthSubscription=void 0,this._stackPartitions=void 0,this._stackPartitionsSubscription=void 0,this._slicePartitions=void 0,this._slicePartitionsSubscription=void 0,this._subdivisions=void 0,this._subdivisionsSubscription=void 0,this._shadows=void 0,this._shadowsSubscription=void 0,this._distanceDisplayCondition=void 0,this._distanceDisplayConditionSubscription=void 0,this.merge(defaultValue(t,defaultValue.EMPTY_OBJECT))}Object.defineProperties(EllipsoidGraphics.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:createPropertyDescriptor("show"),radii:createPropertyDescriptor("radii"),innerRadii:createPropertyDescriptor("innerRadii"),minimumClock:createPropertyDescriptor("minimumClock"),maximumClock:createPropertyDescriptor("maximumClock"),minimumCone:createPropertyDescriptor("minimumCone"),maximumCone:createPropertyDescriptor("maximumCone"),heightReference:createPropertyDescriptor("heightReference"),fill:createPropertyDescriptor("fill"),material:createMaterialPropertyDescriptor("material"),outline:createPropertyDescriptor("outline"),outlineColor:createPropertyDescriptor("outlineColor"),outlineWidth:createPropertyDescriptor("outlineWidth"),stackPartitions:createPropertyDescriptor("stackPartitions"),slicePartitions:createPropertyDescriptor("slicePartitions"),subdivisions:createPropertyDescriptor("subdivisions"),shadows:createPropertyDescriptor("shadows"),distanceDisplayCondition:createPropertyDescriptor("distanceDisplayCondition")}),EllipsoidGraphics.prototype.clone=function(t){return defined(t)?(t.show=this.show,t.radii=this.radii,t.innerRadii=this.innerRadii,t.minimumClock=this.minimumClock,t.maximumClock=this.maximumClock,t.minimumCone=this.minimumCone,t.maximumCone=this.maximumCone,t.heightReference=this.heightReference,t.fill=this.fill,t.material=this.material,t.outline=this.outline,t.outlineColor=this.outlineColor,t.outlineWidth=this.outlineWidth,t.stackPartitions=this.stackPartitions,t.slicePartitions=this.slicePartitions,t.subdivisions=this.subdivisions,t.shadows=this.shadows,t.distanceDisplayCondition=this.distanceDisplayCondition,t):new EllipsoidGraphics(this)},EllipsoidGraphics.prototype.merge=function(t){if(!defined(t))throw new DeveloperError("source is required.");this.show=defaultValue(this.show,t.show),this.radii=defaultValue(this.radii,t.radii),this.innerRadii=defaultValue(this.innerRadii,t.innerRadii),this.minimumClock=defaultValue(this.minimumClock,t.minimumClock),this.maximumClock=defaultValue(this.maximumClock,t.maximumClock),this.minimumCone=defaultValue(this.minimumCone,t.minimumCone),this.maximumCone=defaultValue(this.maximumCone,t.maximumCone),this.heightReference=defaultValue(this.heightReference,t.heightReference),this.fill=defaultValue(this.fill,t.fill),this.material=defaultValue(this.material,t.material),this.outline=defaultValue(this.outline,t.outline),this.outlineColor=defaultValue(this.outlineColor,t.outlineColor),this.outlineWidth=defaultValue(this.outlineWidth,t.outlineWidth),this.stackPartitions=defaultValue(this.stackPartitions,t.stackPartitions),this.slicePartitions=defaultValue(this.slicePartitions,t.slicePartitions),this.subdivisions=defaultValue(this.subdivisions,t.subdivisions),this.shadows=defaultValue(this.shadows,t.shadows),this.distanceDisplayCondition=defaultValue(this.distanceDisplayCondition,t.distanceDisplayCondition)};function LabelGraphics(t){this._definitionChanged=new Event$1,this._show=void 0,this._showSubscription=void 0,this._text=void 0,this._textSubscription=void 0,this._font=void 0,this._fontSubscription=void 0,this._style=void 0,this._styleSubscription=void 0,this._scale=void 0,this._scaleSubscription=void 0,this._showBackground=void 0,this._showBackgroundSubscription=void 0,this._backgroundColor=void 0,this._backgroundColorSubscription=void 0,this._backgroundPadding=void 0,this._backgroundPaddingSubscription=void 0,this._pixelOffset=void 0,this._pixelOffsetSubscription=void 0,this._eyeOffset=void 0,this._eyeOffsetSubscription=void 0,this._horizontalOrigin=void 0,this._horizontalOriginSubscription=void 0,this._verticalOrigin=void 0,this._verticalOriginSubscription=void 0,this._heightReference=void 0,this._heightReferenceSubscription=void 0,this._fillColor=void 0,this._fillColorSubscription=void 0,this._outlineColor=void 0,this._outlineColorSubscription=void 0,this._outlineWidth=void 0,this._outlineWidthSubscription=void 0,this._translucencyByDistance=void 0,this._translucencyByDistanceSubscription=void 0,this._pixelOffsetScaleByDistance=void 0,this._pixelOffsetScaleByDistanceSubscription=void 0,this._scaleByDistance=void 0,this._scaleByDistanceSubscription=void 0,this._distanceDisplayCondition=void 0,this._distanceDisplayConditionSubscription=void 0,this._disableDepthTestDistance=void 0,this._disableDepthTestDistanceSubscription=void 0,this.merge(defaultValue(t,defaultValue.EMPTY_OBJECT))}Object.defineProperties(LabelGraphics.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:createPropertyDescriptor("show"),text:createPropertyDescriptor("text"),font:createPropertyDescriptor("font"),style:createPropertyDescriptor("style"),scale:createPropertyDescriptor("scale"),showBackground:createPropertyDescriptor("showBackground"),backgroundColor:createPropertyDescriptor("backgroundColor"),backgroundPadding:createPropertyDescriptor("backgroundPadding"),pixelOffset:createPropertyDescriptor("pixelOffset"),eyeOffset:createPropertyDescriptor("eyeOffset"),horizontalOrigin:createPropertyDescriptor("horizontalOrigin"),verticalOrigin:createPropertyDescriptor("verticalOrigin"),heightReference:createPropertyDescriptor("heightReference"),fillColor:createPropertyDescriptor("fillColor"),outlineColor:createPropertyDescriptor("outlineColor"),outlineWidth:createPropertyDescriptor("outlineWidth"),translucencyByDistance:createPropertyDescriptor("translucencyByDistance"),pixelOffsetScaleByDistance:createPropertyDescriptor("pixelOffsetScaleByDistance"),scaleByDistance:createPropertyDescriptor("scaleByDistance"),distanceDisplayCondition:createPropertyDescriptor("distanceDisplayCondition"),disableDepthTestDistance:createPropertyDescriptor("disableDepthTestDistance")}),LabelGraphics.prototype.clone=function(t){return defined(t)?(t.show=this.show,t.text=this.text,t.font=this.font,t.style=this.style,t.scale=this.scale,t.showBackground=this.showBackground,t.backgroundColor=this.backgroundColor,t.backgroundPadding=this.backgroundPadding,t.pixelOffset=this.pixelOffset,t.eyeOffset=this.eyeOffset,t.horizontalOrigin=this.horizontalOrigin,t.verticalOrigin=this.verticalOrigin,t.heightReference=this.heightReference,t.fillColor=this.fillColor,t.outlineColor=this.outlineColor,t.outlineWidth=this.outlineWidth,t.translucencyByDistance=this.translucencyByDistance,t.pixelOffsetScaleByDistance=this.pixelOffsetScaleByDistance,t.scaleByDistance=this.scaleByDistance,t.distanceDisplayCondition=this.distanceDisplayCondition,t.disableDepthTestDistance=this.disableDepthTestDistance,t):new LabelGraphics(this)},LabelGraphics.prototype.merge=function(t){if(!defined(t))throw new DeveloperError("source is required.");this.show=defaultValue(this.show,t.show),this.text=defaultValue(this.text,t.text),this.font=defaultValue(this.font,t.font),this.style=defaultValue(this.style,t.style),this.scale=defaultValue(this.scale,t.scale),this.showBackground=defaultValue(this.showBackground,t.showBackground),this.backgroundColor=defaultValue(this.backgroundColor,t.backgroundColor),this.backgroundPadding=defaultValue(this.backgroundPadding,t.backgroundPadding),this.pixelOffset=defaultValue(this.pixelOffset,t.pixelOffset),this.eyeOffset=defaultValue(this.eyeOffset,t.eyeOffset),this.horizontalOrigin=defaultValue(this.horizontalOrigin,t.horizontalOrigin),this.verticalOrigin=defaultValue(this.verticalOrigin,t.verticalOrigin),this.heightReference=defaultValue(this.heightReference,t.heightReference),this.fillColor=defaultValue(this.fillColor,t.fillColor),this.outlineColor=defaultValue(this.outlineColor,t.outlineColor),this.outlineWidth=defaultValue(this.outlineWidth,t.outlineWidth),this.translucencyByDistance=defaultValue(this.translucencyByDistance,t.translucencyByDistance),this.pixelOffsetScaleByDistance=defaultValue(this.pixelOffsetScaleByDistance,t.pixelOffsetScaleByDistance),this.scaleByDistance=defaultValue(this.scaleByDistance,t.scaleByDistance),this.distanceDisplayCondition=defaultValue(this.distanceDisplayCondition,t.distanceDisplayCondition),this.disableDepthTestDistance=defaultValue(this.disableDepthTestDistance,t.disableDepthTestDistance)};const defaultNodeTransformation=new TranslationRotationScale;function NodeTransformationProperty(t){t=defaultValue(t,defaultValue.EMPTY_OBJECT),this._definitionChanged=new Event$1,this._translation=void 0,this._translationSubscription=void 0,this._rotation=void 0,this._rotationSubscription=void 0,this._scale=void 0,this._scaleSubscription=void 0,this.translation=t.translation,this.rotation=t.rotation,this.scale=t.scale}Object.defineProperties(NodeTransformationProperty.prototype,{isConstant:{get:function(){return Property.isConstant(this._translation)&&Property.isConstant(this._rotation)&&Property.isConstant(this._scale)}},definitionChanged:{get:function(){return this._definitionChanged}},translation:createPropertyDescriptor("translation"),rotation:createPropertyDescriptor("rotation"),scale:createPropertyDescriptor("scale")}),NodeTransformationProperty.prototype.getValue=function(t,n){return defined(n)||(n=new TranslationRotationScale),n.translation=Property.getValueOrClonedDefault(this._translation,t,defaultNodeTransformation.translation,n.translation),n.rotation=Property.getValueOrClonedDefault(this._rotation,t,defaultNodeTransformation.rotation,n.rotation),n.scale=Property.getValueOrClonedDefault(this._scale,t,defaultNodeTransformation.scale,n.scale),n},NodeTransformationProperty.prototype.equals=function(t){return this===t||t instanceof NodeTransformationProperty&&Property.equals(this._translation,t._translation)&&Property.equals(this._rotation,t._rotation)&&Property.equals(this._scale,t._scale)};function PropertyBag(t,n){this._propertyNames=[],this._definitionChanged=new Event$1,defined(t)&&this.merge(t,n)}Object.defineProperties(PropertyBag.prototype,{propertyNames:{get:function(){return this._propertyNames}},isConstant:{get:function(){const t=this._propertyNames;for(let n=0,o=t.length;n<o;n++)if(!Property.isConstant(this[t[n]]))return!1;return!0}},definitionChanged:{get:function(){return this._definitionChanged}}}),PropertyBag.prototype.hasProperty=function(t){return this._propertyNames.indexOf(t)!==-1};function createConstantProperty(t){return new ConstantProperty(t)}PropertyBag.prototype.addProperty=function(t,n,o){const s=this._propertyNames;if(!defined(t))throw new DeveloperError("propertyName is required.");if(s.indexOf(t)!==-1)throw new DeveloperError(`${t} is already a registered property.`);s.push(t),Object.defineProperty(this,t,createPropertyDescriptor(t,!0,defaultValue(o,createConstantProperty))),defined(n)&&(this[t]=n),this._definitionChanged.raiseEvent(this)},PropertyBag.prototype.removeProperty=function(t){const o=this._propertyNames.indexOf(t);if(!defined(t))throw new DeveloperError("propertyName is required.");if(o===-1)throw new DeveloperError(`${t} is not a registered property.`);this._propertyNames.splice(o,1),delete this[t],this._definitionChanged.raiseEvent(this)},PropertyBag.prototype.getValue=function(t,n){if(!defined(t))throw new DeveloperError("time is required.");defined(n)||(n={});const o=this._propertyNames;for(let s=0,c=o.length;s<c;s++){const d=o[s];n[d]=Property.getValueOrUndefined(this[d],t,n[d])}return n},PropertyBag.prototype.merge=function(t,n){if(!defined(t))throw new DeveloperError("source is required.");const o=this._propertyNames,s=defined(t._propertyNames)?t._propertyNames:Object.keys(t);for(let c=0,d=s.length;c<d;c++){const h=s[c],p=this[h],y=t[h];p===void 0&&o.indexOf(h)===-1&&this.addProperty(h,void 0,n),y!==void 0&&(p!==void 0?defined(p)&&defined(p.merge)&&p.merge(y):defined(y)&&defined(y.merge)&&defined(y.clone)?this[h]=y.clone():this[h]=y)}};function propertiesEqual(t,n){const o=t._propertyNames,s=n._propertyNames,c=o.length;if(c!==s.length)return!1;for(let d=0;d<c;++d){const h=o[d];if(s.indexOf(h)===-1||!Property.equals(t[h],n[h]))return!1}return!0}PropertyBag.prototype.equals=function(t){return this===t||t instanceof PropertyBag&&propertiesEqual(this,t)};function createNodeTransformationProperty(t){return new NodeTransformationProperty(t)}function createNodeTransformationPropertyBag(t){return new PropertyBag(t,createNodeTransformationProperty)}function createArticulationStagePropertyBag(t){return new PropertyBag(t)}function ModelGraphics(t){this._definitionChanged=new Event$1,this._show=void 0,this._showSubscription=void 0,this._uri=void 0,this._uriSubscription=void 0,this._scale=void 0,this._scaleSubscription=void 0,this._minimumPixelSize=void 0,this._minimumPixelSizeSubscription=void 0,this._maximumScale=void 0,this._maximumScaleSubscription=void 0,this._incrementallyLoadTextures=void 0,this._incrementallyLoadTexturesSubscription=void 0,this._runAnimations=void 0,this._runAnimationsSubscription=void 0,this._clampAnimations=void 0,this._clampAnimationsSubscription=void 0,this._shadows=void 0,this._shadowsSubscription=void 0,this._heightReference=void 0,this._heightReferenceSubscription=void 0,this._silhouetteColor=void 0,this._silhouetteColorSubscription=void 0,this._silhouetteSize=void 0,this._silhouetteSizeSubscription=void 0,this._color=void 0,this._colorSubscription=void 0,this._colorBlendMode=void 0,this._colorBlendModeSubscription=void 0,this._colorBlendAmount=void 0,this._colorBlendAmountSubscription=void 0,this._imageBasedLightingFactor=void 0,this._imageBasedLightingFactorSubscription=void 0,this._lightColor=void 0,this._lightColorSubscription=void 0,this._distanceDisplayCondition=void 0,this._distanceDisplayConditionSubscription=void 0,this._nodeTransformations=void 0,this._nodeTransformationsSubscription=void 0,this._articulations=void 0,this._articulationsSubscription=void 0,this._clippingPlanes=void 0,this._clippingPlanesSubscription=void 0,this._customShader=void 0,this._customShaderSubscription=void 0,this.merge(defaultValue(t,defaultValue.EMPTY_OBJECT))}Object.defineProperties(ModelGraphics.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:createPropertyDescriptor("show"),uri:createPropertyDescriptor("uri"),scale:createPropertyDescriptor("scale"),minimumPixelSize:createPropertyDescriptor("minimumPixelSize"),maximumScale:createPropertyDescriptor("maximumScale"),incrementallyLoadTextures:createPropertyDescriptor("incrementallyLoadTextures"),runAnimations:createPropertyDescriptor("runAnimations"),clampAnimations:createPropertyDescriptor("clampAnimations"),shadows:createPropertyDescriptor("shadows"),heightReference:createPropertyDescriptor("heightReference"),silhouetteColor:createPropertyDescriptor("silhouetteColor"),silhouetteSize:createPropertyDescriptor("silhouetteSize"),color:createPropertyDescriptor("color"),colorBlendMode:createPropertyDescriptor("colorBlendMode"),colorBlendAmount:createPropertyDescriptor("colorBlendAmount"),imageBasedLightingFactor:createPropertyDescriptor("imageBasedLightingFactor"),lightColor:createPropertyDescriptor("lightColor"),distanceDisplayCondition:createPropertyDescriptor("distanceDisplayCondition"),nodeTransformations:createPropertyDescriptor("nodeTransformations",void 0,createNodeTransformationPropertyBag),articulations:createPropertyDescriptor("articulations",void 0,createArticulationStagePropertyBag),clippingPlanes:createPropertyDescriptor("clippingPlanes"),customShader:createPropertyDescriptor("customShader")}),ModelGraphics.prototype.clone=function(t){return defined(t)?(t.show=this.show,t.uri=this.uri,t.scale=this.scale,t.minimumPixelSize=this.minimumPixelSize,t.maximumScale=this.maximumScale,t.incrementallyLoadTextures=this.incrementallyLoadTextures,t.runAnimations=this.runAnimations,t.clampAnimations=this.clampAnimations,t.heightReference=this._heightReference,t.silhouetteColor=this.silhouetteColor,t.silhouetteSize=this.silhouetteSize,t.color=this.color,t.colorBlendMode=this.colorBlendMode,t.colorBlendAmount=this.colorBlendAmount,t.imageBasedLightingFactor=this.imageBasedLightingFactor,t.lightColor=this.lightColor,t.distanceDisplayCondition=this.distanceDisplayCondition,t.nodeTransformations=this.nodeTransformations,t.articulations=this.articulations,t.clippingPlanes=this.clippingPlanes,t.customShader=this.customShader,t):new ModelGraphics(this)},ModelGraphics.prototype.merge=function(t){if(!defined(t))throw new DeveloperError("source is required.");this.show=defaultValue(this.show,t.show),this.uri=defaultValue(this.uri,t.uri),this.scale=defaultValue(this.scale,t.scale),this.minimumPixelSize=defaultValue(this.minimumPixelSize,t.minimumPixelSize),this.maximumScale=defaultValue(this.maximumScale,t.maximumScale),this.incrementallyLoadTextures=defaultValue(this.incrementallyLoadTextures,t.incrementallyLoadTextures),this.runAnimations=defaultValue(this.runAnimations,t.runAnimations),this.clampAnimations=defaultValue(this.clampAnimations,t.clampAnimations),this.shadows=defaultValue(this.shadows,t.shadows),this.heightReference=defaultValue(this.heightReference,t.heightReference),this.silhouetteColor=defaultValue(this.silhouetteColor,t.silhouetteColor),this.silhouetteSize=defaultValue(this.silhouetteSize,t.silhouetteSize),this.color=defaultValue(this.color,t.color),this.colorBlendMode=defaultValue(this.colorBlendMode,t.colorBlendMode),this.colorBlendAmount=defaultValue(this.colorBlendAmount,t.colorBlendAmount),this.imageBasedLightingFactor=defaultValue(this.imageBasedLightingFactor,t.imageBasedLightingFactor),this.lightColor=defaultValue(this.lightColor,t.lightColor),this.distanceDisplayCondition=defaultValue(this.distanceDisplayCondition,t.distanceDisplayCondition),this.clippingPlanes=defaultValue(this.clippingPlanes,t.clippingPlanes),this.customShader=defaultValue(this.customShader,t.customShader);const n=t.nodeTransformations;if(defined(n)){const s=this.nodeTransformations;defined(s)?s.merge(n):this.nodeTransformations=new PropertyBag(n,createNodeTransformationProperty)}const o=t.articulations;if(defined(o)){const s=this.articulations;defined(s)?s.merge(o):this.articulations=new PropertyBag(o)}};function Cesium3DTilesetGraphics(t){this._definitionChanged=new Event$1,this._show=void 0,this._showSubscription=void 0,this._uri=void 0,this._uriSubscription=void 0,this._maximumScreenSpaceError=void 0,this._maximumScreenSpaceErrorSubscription=void 0,this.merge(defaultValue(t,defaultValue.EMPTY_OBJECT))}Object.defineProperties(Cesium3DTilesetGraphics.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:createPropertyDescriptor("show"),uri:createPropertyDescriptor("uri"),maximumScreenSpaceError:createPropertyDescriptor("maximumScreenSpaceError")}),Cesium3DTilesetGraphics.prototype.clone=function(t){return defined(t)?(t.show=this.show,t.uri=this.uri,t.maximumScreenSpaceError=this.maximumScreenSpaceError,t):new Cesium3DTilesetGraphics(this)},Cesium3DTilesetGraphics.prototype.merge=function(t){if(!defined(t))throw new DeveloperError("source is required.");this.show=defaultValue(this.show,t.show),this.uri=defaultValue(this.uri,t.uri),this.maximumScreenSpaceError=defaultValue(this.maximumScreenSpaceError,t.maximumScreenSpaceError)};function PathGraphics(t){this._definitionChanged=new Event$1,this._show=void 0,this._showSubscription=void 0,this._leadTime=void 0,this._leadTimeSubscription=void 0,this._trailTime=void 0,this._trailTimeSubscription=void 0,this._width=void 0,this._widthSubscription=void 0,this._resolution=void 0,this._resolutionSubscription=void 0,this._material=void 0,this._materialSubscription=void 0,this._distanceDisplayCondition=void 0,this._distanceDisplayConditionSubscription=void 0,this.merge(defaultValue(t,defaultValue.EMPTY_OBJECT))}Object.defineProperties(PathGraphics.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:createPropertyDescriptor("show"),leadTime:createPropertyDescriptor("leadTime"),trailTime:createPropertyDescriptor("trailTime"),width:createPropertyDescriptor("width"),resolution:createPropertyDescriptor("resolution"),material:createMaterialPropertyDescriptor("material"),distanceDisplayCondition:createPropertyDescriptor("distanceDisplayCondition")}),PathGraphics.prototype.clone=function(t){return defined(t)?(t.show=this.show,t.leadTime=this.leadTime,t.trailTime=this.trailTime,t.width=this.width,t.resolution=this.resolution,t.material=this.material,t.distanceDisplayCondition=this.distanceDisplayCondition,t):new PathGraphics(this)},PathGraphics.prototype.merge=function(t){if(!defined(t))throw new DeveloperError("source is required.");this.show=defaultValue(this.show,t.show),this.leadTime=defaultValue(this.leadTime,t.leadTime),this.trailTime=defaultValue(this.trailTime,t.trailTime),this.width=defaultValue(this.width,t.width),this.resolution=defaultValue(this.resolution,t.resolution),this.material=defaultValue(this.material,t.material),this.distanceDisplayCondition=defaultValue(this.distanceDisplayCondition,t.distanceDisplayCondition)};function PlaneGraphics(t){this._definitionChanged=new Event$1,this._show=void 0,this._showSubscription=void 0,this._plane=void 0,this._planeSubscription=void 0,this._dimensions=void 0,this._dimensionsSubscription=void 0,this._fill=void 0,this._fillSubscription=void 0,this._material=void 0,this._materialSubscription=void 0,this._outline=void 0,this._outlineSubscription=void 0,this._outlineColor=void 0,this._outlineColorSubscription=void 0,this._outlineWidth=void 0,this._outlineWidthSubscription=void 0,this._shadows=void 0,this._shadowsSubscription=void 0,this._distanceDisplayCondition=void 0,this._distanceDisplayConditionSubscription=void 0,this.merge(defaultValue(t,defaultValue.EMPTY_OBJECT))}Object.defineProperties(PlaneGraphics.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:createPropertyDescriptor("show"),plane:createPropertyDescriptor("plane"),dimensions:createPropertyDescriptor("dimensions"),fill:createPropertyDescriptor("fill"),material:createMaterialPropertyDescriptor("material"),outline:createPropertyDescriptor("outline"),outlineColor:createPropertyDescriptor("outlineColor"),outlineWidth:createPropertyDescriptor("outlineWidth"),shadows:createPropertyDescriptor("shadows"),distanceDisplayCondition:createPropertyDescriptor("distanceDisplayCondition")}),PlaneGraphics.prototype.clone=function(t){return defined(t)?(t.show=this.show,t.plane=this.plane,t.dimensions=this.dimensions,t.fill=this.fill,t.material=this.material,t.outline=this.outline,t.outlineColor=this.outlineColor,t.outlineWidth=this.outlineWidth,t.shadows=this.shadows,t.distanceDisplayCondition=this.distanceDisplayCondition,t):new PlaneGraphics(this)},PlaneGraphics.prototype.merge=function(t){if(!defined(t))throw new DeveloperError("source is required.");this.show=defaultValue(this.show,t.show),this.plane=defaultValue(this.plane,t.plane),this.dimensions=defaultValue(this.dimensions,t.dimensions),this.fill=defaultValue(this.fill,t.fill),this.material=defaultValue(this.material,t.material),this.outline=defaultValue(this.outline,t.outline),this.outlineColor=defaultValue(this.outlineColor,t.outlineColor),this.outlineWidth=defaultValue(this.outlineWidth,t.outlineWidth),this.shadows=defaultValue(this.shadows,t.shadows),this.distanceDisplayCondition=defaultValue(this.distanceDisplayCondition,t.distanceDisplayCondition)};function PointGraphics(t){this._definitionChanged=new Event$1,this._show=void 0,this._showSubscription=void 0,this._pixelSize=void 0,this._pixelSizeSubscription=void 0,this._heightReference=void 0,this._heightReferenceSubscription=void 0,this._color=void 0,this._colorSubscription=void 0,this._outlineColor=void 0,this._outlineColorSubscription=void 0,this._outlineWidth=void 0,this._outlineWidthSubscription=void 0,this._scaleByDistance=void 0,this._scaleByDistanceSubscription=void 0,this._translucencyByDistance=void 0,this._translucencyByDistanceSubscription=void 0,this._distanceDisplayCondition=void 0,this._distanceDisplayConditionSubscription=void 0,this._disableDepthTestDistance=void 0,this._disableDepthTestDistanceSubscription=void 0,this.merge(defaultValue(t,defaultValue.EMPTY_OBJECT))}Object.defineProperties(PointGraphics.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:createPropertyDescriptor("show"),pixelSize:createPropertyDescriptor("pixelSize"),heightReference:createPropertyDescriptor("heightReference"),color:createPropertyDescriptor("color"),outlineColor:createPropertyDescriptor("outlineColor"),outlineWidth:createPropertyDescriptor("outlineWidth"),scaleByDistance:createPropertyDescriptor("scaleByDistance"),translucencyByDistance:createPropertyDescriptor("translucencyByDistance"),distanceDisplayCondition:createPropertyDescriptor("distanceDisplayCondition"),disableDepthTestDistance:createPropertyDescriptor("disableDepthTestDistance")}),PointGraphics.prototype.clone=function(t){return defined(t)?(t.show=this.show,t.pixelSize=this.pixelSize,t.heightReference=this.heightReference,t.color=this.color,t.outlineColor=this.outlineColor,t.outlineWidth=this.outlineWidth,t.scaleByDistance=this.scaleByDistance,t.translucencyByDistance=this._translucencyByDistance,t.distanceDisplayCondition=this.distanceDisplayCondition,t.disableDepthTestDistance=this.disableDepthTestDistance,t):new PointGraphics(this)},PointGraphics.prototype.merge=function(t){if(!defined(t))throw new DeveloperError("source is required.");this.show=defaultValue(this.show,t.show),this.pixelSize=defaultValue(this.pixelSize,t.pixelSize),this.heightReference=defaultValue(this.heightReference,t.heightReference),this.color=defaultValue(this.color,t.color),this.outlineColor=defaultValue(this.outlineColor,t.outlineColor),this.outlineWidth=defaultValue(this.outlineWidth,t.outlineWidth),this.scaleByDistance=defaultValue(this.scaleByDistance,t.scaleByDistance),this.translucencyByDistance=defaultValue(this._translucencyByDistance,t.translucencyByDistance),this.distanceDisplayCondition=defaultValue(this.distanceDisplayCondition,t.distanceDisplayCondition),this.disableDepthTestDistance=defaultValue(this.disableDepthTestDistance,t.disableDepthTestDistance)};function createPolygonHierarchyProperty(t){return Array.isArray(t)&&(t=new PolygonHierarchy(t)),new ConstantProperty(t)}function PolygonGraphics(t){this._definitionChanged=new Event$1,this._show=void 0,this._showSubscription=void 0,this._hierarchy=void 0,this._hierarchySubscription=void 0,this._height=void 0,this._heightSubscription=void 0,this._heightReference=void 0,this._heightReferenceSubscription=void 0,this._extrudedHeight=void 0,this._extrudedHeightSubscription=void 0,this._extrudedHeightReference=void 0,this._extrudedHeightReferenceSubscription=void 0,this._stRotation=void 0,this._stRotationSubscription=void 0,this._granularity=void 0,this._granularitySubscription=void 0,this._fill=void 0,this._fillSubscription=void 0,this._material=void 0,this._materialSubscription=void 0,this._outline=void 0,this._outlineSubscription=void 0,this._outlineColor=void 0,this._outlineColorSubscription=void 0,this._outlineWidth=void 0,this._outlineWidthSubscription=void 0,this._perPositionHeight=void 0,this._perPositionHeightSubscription=void 0,this._closeTop=void 0,this._closeTopSubscription=void 0,this._closeBottom=void 0,this._closeBottomSubscription=void 0,this._arcType=void 0,this._arcTypeSubscription=void 0,this._shadows=void 0,this._shadowsSubscription=void 0,this._distanceDisplayCondition=void 0,this._distanceDisplayConditionSubscription=void 0,this._classificationType=void 0,this._classificationTypeSubscription=void 0,this._zIndex=void 0,this._zIndexSubscription=void 0,this._textureCoordinates=void 0,this._textureCoordinatesSubscription=void 0,this.merge(defaultValue(t,defaultValue.EMPTY_OBJECT))}Object.defineProperties(PolygonGraphics.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:createPropertyDescriptor("show"),hierarchy:createPropertyDescriptor("hierarchy",void 0,createPolygonHierarchyProperty),height:createPropertyDescriptor("height"),heightReference:createPropertyDescriptor("heightReference"),extrudedHeight:createPropertyDescriptor("extrudedHeight"),extrudedHeightReference:createPropertyDescriptor("extrudedHeightReference"),stRotation:createPropertyDescriptor("stRotation"),granularity:createPropertyDescriptor("granularity"),fill:createPropertyDescriptor("fill"),material:createMaterialPropertyDescriptor("material"),outline:createPropertyDescriptor("outline"),outlineColor:createPropertyDescriptor("outlineColor"),outlineWidth:createPropertyDescriptor("outlineWidth"),perPositionHeight:createPropertyDescriptor("perPositionHeight"),closeTop:createPropertyDescriptor("closeTop"),closeBottom:createPropertyDescriptor("closeBottom"),arcType:createPropertyDescriptor("arcType"),shadows:createPropertyDescriptor("shadows"),distanceDisplayCondition:createPropertyDescriptor("distanceDisplayCondition"),classificationType:createPropertyDescriptor("classificationType"),zIndex:createPropertyDescriptor("zIndex"),textureCoordinates:createPropertyDescriptor("textureCoordinates")}),PolygonGraphics.prototype.clone=function(t){return defined(t)?(t.show=this.show,t.hierarchy=this.hierarchy,t.height=this.height,t.heightReference=this.heightReference,t.extrudedHeight=this.extrudedHeight,t.extrudedHeightReference=this.extrudedHeightReference,t.stRotation=this.stRotation,t.granularity=this.granularity,t.fill=this.fill,t.material=this.material,t.outline=this.outline,t.outlineColor=this.outlineColor,t.outlineWidth=this.outlineWidth,t.perPositionHeight=this.perPositionHeight,t.closeTop=this.closeTop,t.closeBottom=this.closeBottom,t.arcType=this.arcType,t.shadows=this.shadows,t.distanceDisplayCondition=this.distanceDisplayCondition,t.classificationType=this.classificationType,t.zIndex=this.zIndex,t.textureCoordinates=this.textureCoordinates,t):new PolygonGraphics(this)},PolygonGraphics.prototype.merge=function(t){if(!defined(t))throw new DeveloperError("source is required.");this.show=defaultValue(this.show,t.show),this.hierarchy=defaultValue(this.hierarchy,t.hierarchy),this.height=defaultValue(this.height,t.height),this.heightReference=defaultValue(this.heightReference,t.heightReference),this.extrudedHeight=defaultValue(this.extrudedHeight,t.extrudedHeight),this.extrudedHeightReference=defaultValue(this.extrudedHeightReference,t.extrudedHeightReference),this.stRotation=defaultValue(this.stRotation,t.stRotation),this.granularity=defaultValue(this.granularity,t.granularity),this.fill=defaultValue(this.fill,t.fill),this.material=defaultValue(this.material,t.material),this.outline=defaultValue(this.outline,t.outline),this.outlineColor=defaultValue(this.outlineColor,t.outlineColor),this.outlineWidth=defaultValue(this.outlineWidth,t.outlineWidth),this.perPositionHeight=defaultValue(this.perPositionHeight,t.perPositionHeight),this.closeTop=defaultValue(this.closeTop,t.closeTop),this.closeBottom=defaultValue(this.closeBottom,t.closeBottom),this.arcType=defaultValue(this.arcType,t.arcType),this.shadows=defaultValue(this.shadows,t.shadows),this.distanceDisplayCondition=defaultValue(this.distanceDisplayCondition,t.distanceDisplayCondition),this.classificationType=defaultValue(this.classificationType,t.classificationType),this.zIndex=defaultValue(this.zIndex,t.zIndex),this.textureCoordinates=defaultValue(this.textureCoordinates,t.textureCoordinates)};function PolylineGraphics(t){this._definitionChanged=new Event$1,this._show=void 0,this._showSubscription=void 0,this._positions=void 0,this._positionsSubscription=void 0,this._width=void 0,this._widthSubscription=void 0,this._granularity=void 0,this._granularitySubscription=void 0,this._material=void 0,this._materialSubscription=void 0,this._depthFailMaterial=void 0,this._depthFailMaterialSubscription=void 0,this._arcType=void 0,this._arcTypeSubscription=void 0,this._clampToGround=void 0,this._clampToGroundSubscription=void 0,this._shadows=void 0,this._shadowsSubscription=void 0,this._distanceDisplayCondition=void 0,this._distanceDisplayConditionSubscription=void 0,this._classificationType=void 0,this._classificationTypeSubscription=void 0,this._zIndex=void 0,this._zIndexSubscription=void 0,this.merge(defaultValue(t,defaultValue.EMPTY_OBJECT))}Object.defineProperties(PolylineGraphics.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:createPropertyDescriptor("show"),positions:createPropertyDescriptor("positions"),width:createPropertyDescriptor("width"),granularity:createPropertyDescriptor("granularity"),material:createMaterialPropertyDescriptor("material"),depthFailMaterial:createMaterialPropertyDescriptor("depthFailMaterial"),arcType:createPropertyDescriptor("arcType"),clampToGround:createPropertyDescriptor("clampToGround"),shadows:createPropertyDescriptor("shadows"),distanceDisplayCondition:createPropertyDescriptor("distanceDisplayCondition"),classificationType:createPropertyDescriptor("classificationType"),zIndex:createPropertyDescriptor("zIndex")}),PolylineGraphics.prototype.clone=function(t){return defined(t)?(t.show=this.show,t.positions=this.positions,t.width=this.width,t.granularity=this.granularity,t.material=this.material,t.depthFailMaterial=this.depthFailMaterial,t.arcType=this.arcType,t.clampToGround=this.clampToGround,t.shadows=this.shadows,t.distanceDisplayCondition=this.distanceDisplayCondition,t.classificationType=this.classificationType,t.zIndex=this.zIndex,t):new PolylineGraphics(this)},PolylineGraphics.prototype.merge=function(t){if(!defined(t))throw new DeveloperError("source is required.");this.show=defaultValue(this.show,t.show),this.positions=defaultValue(this.positions,t.positions),this.width=defaultValue(this.width,t.width),this.granularity=defaultValue(this.granularity,t.granularity),this.material=defaultValue(this.material,t.material),this.depthFailMaterial=defaultValue(this.depthFailMaterial,t.depthFailMaterial),this.arcType=defaultValue(this.arcType,t.arcType),this.clampToGround=defaultValue(this.clampToGround,t.clampToGround),this.shadows=defaultValue(this.shadows,t.shadows),this.distanceDisplayCondition=defaultValue(this.distanceDisplayCondition,t.distanceDisplayCondition),this.classificationType=defaultValue(this.classificationType,t.classificationType),this.zIndex=defaultValue(this.zIndex,t.zIndex)};function PolylineVolumeGraphics(t){this._definitionChanged=new Event$1,this._show=void 0,this._showSubscription=void 0,this._positions=void 0,this._positionsSubscription=void 0,this._shape=void 0,this._shapeSubscription=void 0,this._cornerType=void 0,this._cornerTypeSubscription=void 0,this._granularity=void 0,this._granularitySubscription=void 0,this._fill=void 0,this._fillSubscription=void 0,this._material=void 0,this._materialSubscription=void 0,this._outline=void 0,this._outlineSubscription=void 0,this._outlineColor=void 0,this._outlineColorSubscription=void 0,this._outlineWidth=void 0,this._outlineWidthSubscription=void 0,this._shadows=void 0,this._shadowsSubscription=void 0,this._distanceDisplayCondition=void 0,this._distanceDisplayConditionSubsription=void 0,this.merge(defaultValue(t,defaultValue.EMPTY_OBJECT))}Object.defineProperties(PolylineVolumeGraphics.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:createPropertyDescriptor("show"),positions:createPropertyDescriptor("positions"),shape:createPropertyDescriptor("shape"),cornerType:createPropertyDescriptor("cornerType"),granularity:createPropertyDescriptor("granularity"),fill:createPropertyDescriptor("fill"),material:createMaterialPropertyDescriptor("material"),outline:createPropertyDescriptor("outline"),outlineColor:createPropertyDescriptor("outlineColor"),outlineWidth:createPropertyDescriptor("outlineWidth"),shadows:createPropertyDescriptor("shadows"),distanceDisplayCondition:createPropertyDescriptor("distanceDisplayCondition")}),PolylineVolumeGraphics.prototype.clone=function(t){return defined(t)?(t.show=this.show,t.positions=this.positions,t.shape=this.shape,t.cornerType=this.cornerType,t.granularity=this.granularity,t.fill=this.fill,t.material=this.material,t.outline=this.outline,t.outlineColor=this.outlineColor,t.outlineWidth=this.outlineWidth,t.shadows=this.shadows,t.distanceDisplayCondition=this.distanceDisplayCondition,t):new PolylineVolumeGraphics(this)},PolylineVolumeGraphics.prototype.merge=function(t){if(!defined(t))throw new DeveloperError("source is required.");this.show=defaultValue(this.show,t.show),this.positions=defaultValue(this.positions,t.positions),this.shape=defaultValue(this.shape,t.shape),this.cornerType=defaultValue(this.cornerType,t.cornerType),this.granularity=defaultValue(this.granularity,t.granularity),this.fill=defaultValue(this.fill,t.fill),this.material=defaultValue(this.material,t.material),this.outline=defaultValue(this.outline,t.outline),this.outlineColor=defaultValue(this.outlineColor,t.outlineColor),this.outlineWidth=defaultValue(this.outlineWidth,t.outlineWidth),this.shadows=defaultValue(this.shadows,t.shadows),this.distanceDisplayCondition=defaultValue(this.distanceDisplayCondition,t.distanceDisplayCondition)};function RectangleGraphics(t){this._definitionChanged=new Event$1,this._show=void 0,this._showSubscription=void 0,this._coordinates=void 0,this._coordinatesSubscription=void 0,this._height=void 0,this._heightSubscription=void 0,this._heightReference=void 0,this._heightReferenceSubscription=void 0,this._extrudedHeight=void 0,this._extrudedHeightSubscription=void 0,this._extrudedHeightReference=void 0,this._extrudedHeightReferenceSubscription=void 0,this._rotation=void 0,this._rotationSubscription=void 0,this._stRotation=void 0,this._stRotationSubscription=void 0,this._granularity=void 0,this._granularitySubscription=void 0,this._fill=void 0,this._fillSubscription=void 0,this._material=void 0,this._materialSubscription=void 0,this._outline=void 0,this._outlineSubscription=void 0,this._outlineColor=void 0,this._outlineColorSubscription=void 0,this._outlineWidth=void 0,this._outlineWidthSubscription=void 0,this._shadows=void 0,this._shadowsSubscription=void 0,this._distanceDisplayCondition=void 0,this._distancedisplayConditionSubscription=void 0,this._classificationType=void 0,this._classificationTypeSubscription=void 0,this._zIndex=void 0,this._zIndexSubscription=void 0,this.merge(defaultValue(t,defaultValue.EMPTY_OBJECT))}Object.defineProperties(RectangleGraphics.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:createPropertyDescriptor("show"),coordinates:createPropertyDescriptor("coordinates"),height:createPropertyDescriptor("height"),heightReference:createPropertyDescriptor("heightReference"),extrudedHeight:createPropertyDescriptor("extrudedHeight"),extrudedHeightReference:createPropertyDescriptor("extrudedHeightReference"),rotation:createPropertyDescriptor("rotation"),stRotation:createPropertyDescriptor("stRotation"),granularity:createPropertyDescriptor("granularity"),fill:createPropertyDescriptor("fill"),material:createMaterialPropertyDescriptor("material"),outline:createPropertyDescriptor("outline"),outlineColor:createPropertyDescriptor("outlineColor"),outlineWidth:createPropertyDescriptor("outlineWidth"),shadows:createPropertyDescriptor("shadows"),distanceDisplayCondition:createPropertyDescriptor("distanceDisplayCondition"),classificationType:createPropertyDescriptor("classificationType"),zIndex:createPropertyDescriptor("zIndex")}),RectangleGraphics.prototype.clone=function(t){return defined(t)?(t.show=this.show,t.coordinates=this.coordinates,t.height=this.height,t.heightReference=this.heightReference,t.extrudedHeight=this.extrudedHeight,t.extrudedHeightReference=this.extrudedHeightReference,t.rotation=this.rotation,t.stRotation=this.stRotation,t.granularity=this.granularity,t.fill=this.fill,t.material=this.material,t.outline=this.outline,t.outlineColor=this.outlineColor,t.outlineWidth=this.outlineWidth,t.shadows=this.shadows,t.distanceDisplayCondition=this.distanceDisplayCondition,t.classificationType=this.classificationType,t.zIndex=this.zIndex,t):new RectangleGraphics(this)},RectangleGraphics.prototype.merge=function(t){if(!defined(t))throw new DeveloperError("source is required.");this.show=defaultValue(this.show,t.show),this.coordinates=defaultValue(this.coordinates,t.coordinates),this.height=defaultValue(this.height,t.height),this.heightReference=defaultValue(this.heightReference,t.heightReference),this.extrudedHeight=defaultValue(this.extrudedHeight,t.extrudedHeight),this.extrudedHeightReference=defaultValue(this.extrudedHeightReference,t.extrudedHeightReference),this.rotation=defaultValue(this.rotation,t.rotation),this.stRotation=defaultValue(this.stRotation,t.stRotation),this.granularity=defaultValue(this.granularity,t.granularity),this.fill=defaultValue(this.fill,t.fill),this.material=defaultValue(this.material,t.material),this.outline=defaultValue(this.outline,t.outline),this.outlineColor=defaultValue(this.outlineColor,t.outlineColor),this.outlineWidth=defaultValue(this.outlineWidth,t.outlineWidth),this.shadows=defaultValue(this.shadows,t.shadows),this.distanceDisplayCondition=defaultValue(this.distanceDisplayCondition,t.distanceDisplayCondition),this.classificationType=defaultValue(this.classificationType,t.classificationType),this.zIndex=defaultValue(this.zIndex,t.zIndex)};function WallGraphics(t){this._definitionChanged=new Event$1,this._show=void 0,this._showSubscription=void 0,this._positions=void 0,this._positionsSubscription=void 0,this._minimumHeights=void 0,this._minimumHeightsSubscription=void 0,this._maximumHeights=void 0,this._maximumHeightsSubscription=void 0,this._granularity=void 0,this._granularitySubscription=void 0,this._fill=void 0,this._fillSubscription=void 0,this._material=void 0,this._materialSubscription=void 0,this._outline=void 0,this._outlineSubscription=void 0,this._outlineColor=void 0,this._outlineColorSubscription=void 0,this._outlineWidth=void 0,this._outlineWidthSubscription=void 0,this._shadows=void 0,this._shadowsSubscription=void 0,this._distanceDisplayCondition=void 0,this._distanceDisplayConditionSubscription=void 0,this.merge(defaultValue(t,defaultValue.EMPTY_OBJECT))}Object.defineProperties(WallGraphics.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:createPropertyDescriptor("show"),positions:createPropertyDescriptor("positions"),minimumHeights:createPropertyDescriptor("minimumHeights"),maximumHeights:createPropertyDescriptor("maximumHeights"),granularity:createPropertyDescriptor("granularity"),fill:createPropertyDescriptor("fill"),material:createMaterialPropertyDescriptor("material"),outline:createPropertyDescriptor("outline"),outlineColor:createPropertyDescriptor("outlineColor"),outlineWidth:createPropertyDescriptor("outlineWidth"),shadows:createPropertyDescriptor("shadows"),distanceDisplayCondition:createPropertyDescriptor("distanceDisplayCondition")}),WallGraphics.prototype.clone=function(t){return defined(t)?(t.show=this.show,t.positions=this.positions,t.minimumHeights=this.minimumHeights,t.maximumHeights=this.maximumHeights,t.granularity=this.granularity,t.fill=this.fill,t.material=this.material,t.outline=this.outline,t.outlineColor=this.outlineColor,t.outlineWidth=this.outlineWidth,t.shadows=this.shadows,t.distanceDisplayCondition=this.distanceDisplayCondition,t):new WallGraphics(this)},WallGraphics.prototype.merge=function(t){if(!defined(t))throw new DeveloperError("source is required.");this.show=defaultValue(this.show,t.show),this.positions=defaultValue(this.positions,t.positions),this.minimumHeights=defaultValue(this.minimumHeights,t.minimumHeights),this.maximumHeights=defaultValue(this.maximumHeights,t.maximumHeights),this.granularity=defaultValue(this.granularity,t.granularity),this.fill=defaultValue(this.fill,t.fill),this.material=defaultValue(this.material,t.material),this.outline=defaultValue(this.outline,t.outline),this.outlineColor=defaultValue(this.outlineColor,t.outlineColor),this.outlineWidth=defaultValue(this.outlineWidth,t.outlineWidth),this.shadows=defaultValue(this.shadows,t.shadows),this.distanceDisplayCondition=defaultValue(this.distanceDisplayCondition,t.distanceDisplayCondition)};const cartoScratch=new Cartographic,ExtraPropertyNames=[];function createConstantPositionProperty(t){return new ConstantPositionProperty(t)}function createPositionPropertyDescriptor(t){return createPropertyDescriptor(t,void 0,createConstantPositionProperty)}function createPropertyTypeDescriptor(t,n){return createPropertyDescriptor(t,void 0,function(o){return o instanceof n?o:new n(o)})}function Entity$1(t){t=defaultValue(t,defaultValue.EMPTY_OBJECT);let n=t.id;defined(n)||(n=createGuid()),this._availability=void 0,this._id=n,this._definitionChanged=new Event$1,this._name=t.name,this._show=defaultValue(t.show,!0),this._parent=void 0,this._propertyNames=["billboard","box","corridor","cylinder","description","ellipse","ellipsoid","label","model","tileset","orientation","path","plane","point","polygon","polyline","polylineVolume","position","properties","rectangle","viewFrom","wall",...ExtraPropertyNames],this._billboard=void 0,this._billboardSubscription=void 0,this._box=void 0,this._boxSubscription=void 0,this._corridor=void 0,this._corridorSubscription=void 0,this._cylinder=void 0,this._cylinderSubscription=void 0,this._description=void 0,this._descriptionSubscription=void 0,this._ellipse=void 0,this._ellipseSubscription=void 0,this._ellipsoid=void 0,this._ellipsoidSubscription=void 0,this._label=void 0,this._labelSubscription=void 0,this._model=void 0,this._modelSubscription=void 0,this._tileset=void 0,this._tilesetSubscription=void 0,this._orientation=void 0,this._orientationSubscription=void 0,this._path=void 0,this._pathSubscription=void 0,this._plane=void 0,this._planeSubscription=void 0,this._point=void 0,this._pointSubscription=void 0,this._polygon=void 0,this._polygonSubscription=void 0,this._polyline=void 0,this._polylineSubscription=void 0,this._polylineVolume=void 0,this._polylineVolumeSubscription=void 0,this._position=void 0,this._positionSubscription=void 0,this._properties=void 0,this._propertiesSubscription=void 0,this._rectangle=void 0,this._rectangleSubscription=void 0,this._viewFrom=void 0,this._viewFromSubscription=void 0,this._wall=void 0,this._wallSubscription=void 0,this._children=[],this.entityCollection=void 0,this.parent=t.parent,this.merge(t)}function updateShow(t,n,o){const s=n.length;for(let c=0;c<s;c++){const d=n[c],h=d._show;(!o&&h)!==(o&&h)&&updateShow(d,d._children,o)}t._definitionChanged.raiseEvent(t,"isShowing",o,!o)}Object.defineProperties(Entity$1.prototype,{availability:createRawPropertyDescriptor("availability"),id:{get:function(){return this._id}},definitionChanged:{get:function(){return this._definitionChanged}},name:createRawPropertyDescriptor("name"),show:{get:function(){return this._show},set:function(t){if(!defined(t))throw new DeveloperError("value is required.");if(t===this._show)return;const n=this.isShowing;this._show=t;const o=this.isShowing;n!==o&&updateShow(this,this._children,o),this._definitionChanged.raiseEvent(this,"show",t,!t)}},isShowing:{get:function(){return this._show&&(!defined(this.entityCollection)||this.entityCollection.show)&&(!defined(this._parent)||this._parent.isShowing)}},parent:{get:function(){return this._parent},set:function(t){const n=this._parent;if(n===t)return;const o=this.isShowing;if(defined(n)){const c=n._children.indexOf(this);n._children.splice(c,1)}this._parent=t,defined(t)&&t._children.push(this);const s=this.isShowing;o!==s&&updateShow(this,this._children,s),this._definitionChanged.raiseEvent(this,"parent",t,n)}},propertyNames:{get:function(){return this._propertyNames}},billboard:createPropertyTypeDescriptor("billboard",BillboardGraphics),box:createPropertyTypeDescriptor("box",BoxGraphics),corridor:createPropertyTypeDescriptor("corridor",CorridorGraphics),cylinder:createPropertyTypeDescriptor("cylinder",CylinderGraphics),description:createPropertyDescriptor("description"),ellipse:createPropertyTypeDescriptor("ellipse",EllipseGraphics),ellipsoid:createPropertyTypeDescriptor("ellipsoid",EllipsoidGraphics),label:createPropertyTypeDescriptor("label",LabelGraphics),model:createPropertyTypeDescriptor("model",ModelGraphics),tileset:createPropertyTypeDescriptor("tileset",Cesium3DTilesetGraphics),orientation:createPropertyDescriptor("orientation"),path:createPropertyTypeDescriptor("path",PathGraphics),plane:createPropertyTypeDescriptor("plane",PlaneGraphics),point:createPropertyTypeDescriptor("point",PointGraphics),polygon:createPropertyTypeDescriptor("polygon",PolygonGraphics),polyline:createPropertyTypeDescriptor("polyline",PolylineGraphics),polylineVolume:createPropertyTypeDescriptor("polylineVolume",PolylineVolumeGraphics),properties:createPropertyTypeDescriptor("properties",PropertyBag),position:createPositionPropertyDescriptor("position"),rectangle:createPropertyTypeDescriptor("rectangle",RectangleGraphics),viewFrom:createPropertyDescriptor("viewFrom"),wall:createPropertyTypeDescriptor("wall",WallGraphics)}),Entity$1.registerEntityType=function(t,n){Object.defineProperties(Entity$1.prototype,{[t]:createPropertyTypeDescriptor(t,n)}),ExtraPropertyNames.includes(t)||ExtraPropertyNames.push(t)},Entity$1.prototype.isAvailable=function(t){if(!defined(t))throw new DeveloperError("time is required.");const n=this._availability;return!defined(n)||n.contains(t)},Entity$1.prototype.addProperty=function(t){const n=this._propertyNames;if(!defined(t))throw new DeveloperError("propertyName is required.");if(n.indexOf(t)!==-1)throw new DeveloperError(`${t} is already a registered property.`);if(t in this)throw new DeveloperError(`${t} is a reserved property name.`);n.push(t),Object.defineProperty(this,t,createRawPropertyDescriptor(t,!0))},Entity$1.prototype.removeProperty=function(t){const o=this._propertyNames.indexOf(t);if(!defined(t))throw new DeveloperError("propertyName is required.");if(o===-1)throw new DeveloperError(`${t} is not a registered property.`);this._propertyNames.splice(o,1),delete this[t]},Entity$1.prototype.merge=function(t){if(!defined(t))throw new DeveloperError("source is required.");this.name=defaultValue(this.name,t.name),this.availability=defaultValue(this.availability,t.availability);const n=this._propertyNames,o=defined(t._propertyNames)?t._propertyNames:Object.keys(t),s=o.length;for(let c=0;c<s;c++){const d=o[c];if(d==="parent"||d==="name"||d==="availability"||d==="children")continue;const h=this[d],p=t[d];!defined(h)&&n.indexOf(d)===-1&&this.addProperty(d),defined(p)&&(defined(h)?defined(h.merge)&&h.merge(p):defined(p.merge)&&defined(p.clone)?this[d]=p.clone():this[d]=p)}};const matrix3Scratch=new Matrix3,positionScratch$2=new Cartesian3,orientationScratch=new Quaternion;Entity$1.prototype.computeModelMatrix=function(t,n){Check.typeOf.object("time",t);const o=Property.getValueOrUndefined(this._position,t,positionScratch$2);if(!defined(o))return;const s=Property.getValueOrUndefined(this._orientation,t,orientationScratch);return defined(s)?n=Matrix4.fromRotationTranslation(Matrix3.fromQuaternion(s,matrix3Scratch),o,n):n=Transforms.eastNorthUpToFixedFrame(o,void 0,n),n},Entity$1.prototype.computeModelMatrixForHeightReference=function(t,n,o,s,c){Check.typeOf.object("time",t);const d=Property.getValueOrDefault(n,t,HeightReference$1.NONE);let h=Property.getValueOrUndefined(this._position,t,positionScratch$2);if(d===HeightReference$1.NONE||!defined(h)||Cartesian3.equalsEpsilon(h,Cartesian3.ZERO,CesiumMath.EPSILON8))return this.computeModelMatrix(t,c);const p=s.cartesianToCartographic(h,cartoScratch);isHeightReferenceClamp(d)?p.height=o:p.height+=o,h=s.cartographicToCartesian(p,h);const y=Property.getValueOrUndefined(this._orientation,t,orientationScratch);return defined(y)?c=Matrix4.fromRotationTranslation(Matrix3.fromQuaternion(y,matrix3Scratch),h,c):c=Transforms.eastNorthUpToFixedFrame(h,void 0,c),c},Entity$1.supportsMaterialsforEntitiesOnTerrain=function(t){return GroundPrimitive.supportsMaterials(t)},Entity$1.supportsPolylinesOnTerrain=function(t){return GroundPolylinePrimitive.isSupported(t)};function CallbackProperty(t,n){this._callback=void 0,this._isConstant=void 0,this._definitionChanged=new Event$1,this.setCallback(t,n)}Object.defineProperties(CallbackProperty.prototype,{isConstant:{get:function(){return this._isConstant}},definitionChanged:{get:function(){return this._definitionChanged}}}),CallbackProperty.prototype.getValue=function(t,n){return this._callback(t,n)},CallbackProperty.prototype.setCallback=function(t,n){if(!defined(t))throw new DeveloperError("callback is required.");if(!defined(n))throw new DeveloperError("isConstant is required.");const o=this._callback!==t||this._isConstant!==n;this._callback=t,this._isConstant=n,o&&this._definitionChanged.raiseEvent(this)},CallbackProperty.prototype.equals=function(t){return this===t||t instanceof CallbackProperty&&this._callback===t._callback&&this._isConstant===t._isConstant};const SceneTransforms={},actualPositionScratch=new Cartesian4(0,0,0,1);let positionCC=new Cartesian4;const scratchViewport=new BoundingRectangle,scratchWindowCoord0=new Cartesian2,scratchWindowCoord1=new Cartesian2;SceneTransforms.wgs84ToWindowCoordinates=function(t,n,o){return SceneTransforms.wgs84WithEyeOffsetToWindowCoordinates(t,n,Cartesian3.ZERO,o)};const scratchCartesian4=new Cartesian4,scratchEyeOffset=new Cartesian3;function worldToClip(t,n,o,s){const c=o.viewMatrix,d=Matrix4.multiplyByVector(c,Cartesian4.fromElements(t.x,t.y,t.z,1,scratchCartesian4),scratchCartesian4),h=Cartesian3.multiplyComponents(n,Cartesian3.normalize(d,scratchEyeOffset),scratchEyeOffset);return d.x+=n.x+h.x,d.y+=n.y+h.y,d.z+=h.z,Matrix4.multiplyByVector(o.frustum.projectionMatrix,d,s)}const scratchMaxCartographic=new Cartographic(Math.PI,CesiumMath.PI_OVER_TWO),scratchProjectedCartesian=new Cartesian3,scratchCameraPosition=new Cartesian3;SceneTransforms.wgs84WithEyeOffsetToWindowCoordinates=function(t,n,o,s){if(!defined(t))throw new DeveloperError("scene is required.");if(!defined(n))throw new DeveloperError("position is required.");const c=t.frameState,d=SceneTransforms.computeActualWgs84Position(c,n,actualPositionScratch);if(!defined(d))return;const h=t.canvas,p=scratchViewport;p.x=0,p.y=0,p.width=h.clientWidth,p.height=h.clientHeight;const y=t.camera;let E=!1;if(c.mode===SceneMode$1.SCENE2D){const L=t.mapProjection,F=scratchMaxCartographic,N=L.project(F,scratchProjectedCartesian),z=Cartesian3.clone(y.position,scratchCameraPosition),oe=y.frustum.clone(),W=Matrix4.computeViewportTransformation(p,0,1,new Matrix4),nt=y.frustum.projectionMatrix,lt=y.positionWC.y,Ee=Cartesian3.fromElements(CesiumMath.sign(lt)*N.x-lt,0,-y.positionWC.x),yt=Transforms.pointToGLWindowCoordinates(nt,W,Ee);if(lt===0||yt.x<=0||yt.x>=h.clientWidth)E=!0;else{if(yt.x>h.clientWidth*.5){p.width=yt.x,y.frustum.right=N.x-lt,positionCC=worldToClip(d,o,y,positionCC),SceneTransforms.clipToGLWindowCoordinates(p,positionCC,scratchWindowCoord0),p.x+=yt.x,y.position.x=-y.position.x;const Ai=y.frustum.right;y.frustum.right=-y.frustum.left,y.frustum.left=-Ai,positionCC=worldToClip(d,o,y,positionCC),SceneTransforms.clipToGLWindowCoordinates(p,positionCC,scratchWindowCoord1)}else{p.x+=yt.x,p.width-=yt.x,y.frustum.left=-N.x-lt,positionCC=worldToClip(d,o,y,positionCC),SceneTransforms.clipToGLWindowCoordinates(p,positionCC,scratchWindowCoord0),p.x=p.x-p.width,y.position.x=-y.position.x;const Ai=y.frustum.left;y.frustum.left=-y.frustum.right,y.frustum.right=-Ai,positionCC=worldToClip(d,o,y,positionCC),SceneTransforms.clipToGLWindowCoordinates(p,positionCC,scratchWindowCoord1)}Cartesian3.clone(z,y.position),y.frustum=oe.clone(),s=Cartesian2.clone(scratchWindowCoord0,s),(s.x<0||s.x>h.clientWidth)&&(s.x=scratchWindowCoord1.x)}}if(c.mode!==SceneMode$1.SCENE2D||E){if(positionCC=worldToClip(d,o,y,positionCC),positionCC.z<0&&!(y.frustum instanceof OrthographicFrustum)&&!(y.frustum instanceof OrthographicOffCenterFrustum))return;s=SceneTransforms.clipToGLWindowCoordinates(p,positionCC,s)}return s.y=h.clientHeight-s.y,s},SceneTransforms.wgs84ToDrawingBufferCoordinates=function(t,n,o){if(o=SceneTransforms.wgs84ToWindowCoordinates(t,n,o),!!defined(o))return SceneTransforms.transformWindowToDrawingBuffer(t,o,o)};const projectedPosition=new Cartesian3,positionInCartographic=new Cartographic;SceneTransforms.computeActualWgs84Position=function(t,n,o){const s=t.mode;if(s===SceneMode$1.SCENE3D)return Cartesian3.clone(n,o);const c=t.mapProjection,d=c.ellipsoid.cartesianToCartographic(n,positionInCartographic);if(!defined(d))return;if(c.project(d,projectedPosition),s===SceneMode$1.COLUMBUS_VIEW)return Cartesian3.fromElements(projectedPosition.z,projectedPosition.x,projectedPosition.y,o);if(s===SceneMode$1.SCENE2D)return Cartesian3.fromElements(0,projectedPosition.x,projectedPosition.y,o);const h=t.morphTime;return Cartesian3.fromElements(CesiumMath.lerp(projectedPosition.z,n.x,h),CesiumMath.lerp(projectedPosition.x,n.y,h),CesiumMath.lerp(projectedPosition.y,n.z,h),o)};const positionNDC=new Cartesian3,positionWC=new Cartesian3,viewportTransform=new Matrix4;SceneTransforms.clipToGLWindowCoordinates=function(t,n,o){return Cartesian3.divideByScalar(n,n.w,positionNDC),Matrix4.computeViewportTransformation(t,0,1,viewportTransform),Matrix4.multiplyByPoint(viewportTransform,positionNDC,positionWC),Cartesian2.fromCartesian3(positionWC,o)},SceneTransforms.transformWindowToDrawingBuffer=function(t,n,o){const s=t.canvas,c=t.drawingBufferWidth/s.clientWidth,d=t.drawingBufferHeight/s.clientHeight;return Cartesian2.fromElements(n.x*c,n.y*d,o)};const scratchNDC=new Cartesian4,scratchWorldCoords=new Cartesian4;SceneTransforms.drawingBufferToWgs84Coordinates=function(t,n,o,s){const d=t.context.uniformState,h=d.currentFrustum,p=h.x,y=h.y;if(t.frameState.useLogDepth){const z=o*d.log2FarDepthFromNearPlusOne,oe=Math.pow(2,z)-1;o=y*(1-p/(oe+p))/(y-p)}const E=t.view.passState.viewport,L=Cartesian4.clone(Cartesian4.UNIT_W,scratchNDC);L.x=(n.x-E.x)/E.width*2-1,L.y=(n.y-E.y)/E.height*2-1,L.z=o*2-1,L.w=1;let F,N=t.camera.frustum;if(defined(N.fovy)){F=Matrix4.multiplyByVector(d.inverseViewProjection,L,scratchWorldCoords);const z=1/F.w;Cartesian3.multiplyByScalar(F,z,F)}else{const z=N.offCenterFrustum;defined(z)&&(N=z),F=scratchWorldCoords,F.x=(L.x*(N.right-N.left)+N.left+N.right)*.5,F.y=(L.y*(N.top-N.bottom)+N.bottom+N.top)*.5,F.z=(L.z*(p-y)-p-y)*.5,F.w=1,F=Matrix4.multiplyByVector(d.inverseView,F,F)}return Cartesian3.fromCartesian4(F,s)};const LabelStyle={FILL:0,OUTLINE:1,FILL_AND_OUTLINE:2},LabelStyle$1=Object.freeze(LabelStyle),Cesium3DTilePass={RENDER:0,PICK:1,SHADOW:2,PRELOAD:3,PRELOAD_FLIGHT:4,REQUEST_RENDER_MODE_DEFER_CHECK:5,MOST_DETAILED_PRELOAD:6,MOST_DETAILED_PICK:7,NUMBER_OF_PASSES:8},passOptions=new Array(Cesium3DTilePass.NUMBER_OF_PASSES);passOptions[Cesium3DTilePass.RENDER]=Object.freeze({pass:Cesium3DTilePass.RENDER,isRender:!0,requestTiles:!0,ignoreCommands:!1}),passOptions[Cesium3DTilePass.PICK]=Object.freeze({pass:Cesium3DTilePass.PICK,isRender:!1,requestTiles:!1,ignoreCommands:!1}),passOptions[Cesium3DTilePass.SHADOW]=Object.freeze({pass:Cesium3DTilePass.SHADOW,isRender:!1,requestTiles:!0,ignoreCommands:!1}),passOptions[Cesium3DTilePass.PRELOAD]=Object.freeze({pass:Cesium3DTilePass.PRELOAD,isRender:!1,requestTiles:!0,ignoreCommands:!0}),passOptions[Cesium3DTilePass.PRELOAD_FLIGHT]=Object.freeze({pass:Cesium3DTilePass.PRELOAD_FLIGHT,isRender:!1,requestTiles:!0,ignoreCommands:!0}),passOptions[Cesium3DTilePass.REQUEST_RENDER_MODE_DEFER_CHECK]=Object.freeze({pass:Cesium3DTilePass.REQUEST_RENDER_MODE_DEFER_CHECK,isRender:!1,requestTiles:!0,ignoreCommands:!0}),passOptions[Cesium3DTilePass.MOST_DETAILED_PRELOAD]=Object.freeze({pass:Cesium3DTilePass.MOST_DETAILED_PRELOAD,isRender:!1,requestTiles:!0,ignoreCommands:!0}),passOptions[Cesium3DTilePass.MOST_DETAILED_PICK]=Object.freeze({pass:Cesium3DTilePass.MOST_DETAILED_PICK,isRender:!1,requestTiles:!1,ignoreCommands:!1}),Cesium3DTilePass.getPassOptions=function(t){return passOptions[t]};const Cesium3DTilePass$1=Object.freeze(Cesium3DTilePass),defaultColor=Color$1.WHITE,defaultGapColor=Color$1.TRANSPARENT,defaultDashLength=16,defaultDashPattern=255;function PolylineDashMaterialProperty(t){t=defaultValue(t,defaultValue.EMPTY_OBJECT),this._definitionChanged=new Event$1,this._color=void 0,this._colorSubscription=void 0,this._gapColor=void 0,this._gapColorSubscription=void 0,this._dashLength=void 0,this._dashLengthSubscription=void 0,this._dashPattern=void 0,this._dashPatternSubscription=void 0,this.color=t.color,this.gapColor=t.gapColor,this.dashLength=t.dashLength,this.dashPattern=t.dashPattern}Object.defineProperties(PolylineDashMaterialProperty.prototype,{isConstant:{get:function(){return Property.isConstant(this._color)&&Property.isConstant(this._gapColor)&&Property.isConstant(this._dashLength)&&Property.isConstant(this._dashPattern)}},definitionChanged:{get:function(){return this._definitionChanged}},color:createPropertyDescriptor("color"),gapColor:createPropertyDescriptor("gapColor"),dashLength:createPropertyDescriptor("dashLength"),dashPattern:createPropertyDescriptor("dashPattern")}),PolylineDashMaterialProperty.prototype.getType=function(t){return"PolylineDash"},PolylineDashMaterialProperty.prototype.getValue=function(t,n){return defined(n)||(n={}),n.color=Property.getValueOrClonedDefault(this._color,t,defaultColor,n.color),n.gapColor=Property.getValueOrClonedDefault(this._gapColor,t,defaultGapColor,n.gapColor),n.dashLength=Property.getValueOrDefault(this._dashLength,t,defaultDashLength,n.dashLength),n.dashPattern=Property.getValueOrDefault(this._dashPattern,t,defaultDashPattern,n.dashPattern),n},PolylineDashMaterialProperty.prototype.equals=function(t){return this===t||t instanceof PolylineDashMaterialProperty&&Property.equals(this._color,t._color)&&Property.equals(this._gapColor,t._gapColor)&&Property.equals(this._dashLength,t._dashLength)&&Property.equals(this._dashPattern,t._dashPattern)};function DiscardEmptyTileImagePolicy(t){}DiscardEmptyTileImagePolicy.prototype.isReady=function(){return!0},DiscardEmptyTileImagePolicy.prototype.shouldDiscardImage=function(t){return DiscardEmptyTileImagePolicy.EMPTY_IMAGE===t};let emptyImage;Object.defineProperties(DiscardEmptyTileImagePolicy,{EMPTY_IMAGE:{get:function(){return defined(emptyImage)||(emptyImage=new Image,emptyImage.src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR42mNkYAAAAAYAAjCB0C8AAAAASUVORK5CYII="),emptyImage}}});function Cesium3DTilePassState(t){Check.typeOf.object("options",t),Check.typeOf.number("options.pass",t.pass),this.pass=t.pass,this.commandList=t.commandList,this.camera=t.camera,this.cullingVolume=t.cullingVolume,this.ready=!1}var __create=Object.create,__defProp$1=Object.defineProperty,__getOwnPropDesc=Object.getOwnPropertyDescriptor,__getOwnPropNames=Object.getOwnPropertyNames,__getProtoOf=Object.getPrototypeOf,__hasOwnProp$1=Object.prototype.hasOwnProperty,__markAsModule=t=>__defProp$1(t,"__esModule",{value:!0}),__commonJS=(t,n)=>function(){return n||(0,t[Object.keys(t)[0]])((n={exports:{}}).exports,n),n.exports},__reExport=(t,n,o)=>{if(n&&typeof n=="object"||typeof n=="function")for(let s of __getOwnPropNames(n))!__hasOwnProp$1.call(t,s)&&s!=="default"&&__defProp$1(t,s,{get:()=>n[s],enumerable:!(o=__getOwnPropDesc(n,s))||o.enumerable});return t},__toModule=t=>__reExport(__markAsModule(__defProp$1(t!=null?__create(__getProtoOf(t)):{},"default",t&&t.__esModule&&"default"in t?{get:()=>t.default,enumerable:!0}:{value:t,enumerable:!0})),t),__async=(t,n,o)=>new Promise((s,c)=>{var d=y=>{try{p(o.next(y))}catch(E){c(E)}},h=y=>{try{p(o.throw(y))}catch(E){c(E)}},p=y=>y.done?s(y.value):Promise.resolve(y.value).then(d,h);p((o=o.apply(t,n)).next())}),require_point_geometry=__commonJS({"node_modules/@mapbox/point-geometry/index.js"(t,n){n.exports=o;function o(s,c){this.x=s,this.y=c}o.prototype={clone:function(){return new o(this.x,this.y)},add:function(s){return this.clone()._add(s)},sub:function(s){return this.clone()._sub(s)},multByPoint:function(s){return this.clone()._multByPoint(s)},divByPoint:function(s){return this.clone()._divByPoint(s)},mult:function(s){return this.clone()._mult(s)},div:function(s){return this.clone()._div(s)},rotate:function(s){return this.clone()._rotate(s)},rotateAround:function(s,c){return this.clone()._rotateAround(s,c)},matMult:function(s){return this.clone()._matMult(s)},unit:function(){return this.clone()._unit()},perp:function(){return this.clone()._perp()},round:function(){return this.clone()._round()},mag:function(){return Math.sqrt(this.x*this.x+this.y*this.y)},equals:function(s){return this.x===s.x&&this.y===s.y},dist:function(s){return Math.sqrt(this.distSqr(s))},distSqr:function(s){var c=s.x-this.x,d=s.y-this.y;return c*c+d*d},angle:function(){return Math.atan2(this.y,this.x)},angleTo:function(s){return Math.atan2(this.y-s.y,this.x-s.x)},angleWith:function(s){return this.angleWithSep(s.x,s.y)},angleWithSep:function(s,c){return Math.atan2(this.x*c-this.y*s,this.x*s+this.y*c)},_matMult:function(s){var c=s[0]*this.x+s[1]*this.y,d=s[2]*this.x+s[3]*this.y;return this.x=c,this.y=d,this},_add:function(s){return this.x+=s.x,this.y+=s.y,this},_sub:function(s){return this.x-=s.x,this.y-=s.y,this},_mult:function(s){return this.x*=s,this.y*=s,this},_div:function(s){return this.x/=s,this.y/=s,this},_multByPoint:function(s){return this.x*=s.x,this.y*=s.y,this},_divByPoint:function(s){return this.x/=s.x,this.y/=s.y,this},_unit:function(){return this._div(this.mag()),this},_perp:function(){var s=this.y;return this.y=this.x,this.x=-s,this},_rotate:function(s){var c=Math.cos(s),d=Math.sin(s),h=c*this.x-d*this.y,p=d*this.x+c*this.y;return this.x=h,this.y=p,this},_rotateAround:function(s,c){var d=Math.cos(s),h=Math.sin(s),p=c.x+d*(this.x-c.x)-h*(this.y-c.y),y=c.y+h*(this.x-c.x)+d*(this.y-c.y);return this.x=p,this.y=y,this},_round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}},o.convert=function(s){return s instanceof o?s:Array.isArray(s)?new o(s[0],s[1]):s}}}),require_vectortilefeature=__commonJS({"node_modules/@mapbox/vector-tile/lib/vectortilefeature.js"(t,n){var o=require_point_geometry();n.exports=s;function s(y,E,L,F,N){this.properties={},this.extent=L,this.type=0,this._pbf=y,this._geometry=-1,this._keys=F,this._values=N,y.readFields(c,this,E)}function c(y,E,L){y==1?E.id=L.readVarint():y==2?d(L,E):y==3?E.type=L.readVarint():y==4&&(E._geometry=L.pos)}function d(y,E){for(var L=y.readVarint()+y.pos;y.pos<L;){var F=E._keys[y.readVarint()],N=E._values[y.readVarint()];E.properties[F]=N}}s.types=["Unknown","Point","LineString","Polygon"],s.prototype.loadGeometry=function(){var y=this._pbf;y.pos=this._geometry;for(var E=y.readVarint()+y.pos,L=1,F=0,N=0,z=0,oe=[],W;y.pos<E;){if(F<=0){var nt=y.readVarint();L=nt&7,F=nt>>3}if(F--,L===1||L===2)N+=y.readSVarint(),z+=y.readSVarint(),L===1&&(W&&oe.push(W),W=[]),W.push(new o(N,z));else if(L===7)W&&W.push(W[0].clone());else throw new Error("unknown command "+L)}return W&&oe.push(W),oe},s.prototype.bbox=function(){var y=this._pbf;y.pos=this._geometry;for(var E=y.readVarint()+y.pos,L=1,F=0,N=0,z=0,oe=1/0,W=-1/0,nt=1/0,lt=-1/0;y.pos<E;){if(F<=0){var Ee=y.readVarint();L=Ee&7,F=Ee>>3}if(F--,L===1||L===2)N+=y.readSVarint(),z+=y.readSVarint(),N<oe&&(oe=N),N>W&&(W=N),z<nt&&(nt=z),z>lt&&(lt=z);else if(L!==7)throw new Error("unknown command "+L)}return[oe,nt,W,lt]},s.prototype.toGeoJSON=function(y,E,L){var F=this.extent*Math.pow(2,L),N=this.extent*y,z=this.extent*E,oe=this.loadGeometry(),W=s.types[this.type],nt,lt;function Ee(zi){for(var ha=0;ha<zi.length;ha++){var ba=zi[ha],Sa=180-(ba.y+z)*360/F;zi[ha]=[(ba.x+N)*360/F-180,360/Math.PI*Math.atan(Math.exp(Sa*Math.PI/180))-90]}}switch(this.type){case 1:var yt=[];for(nt=0;nt<oe.length;nt++)yt[nt]=oe[nt][0];oe=yt,Ee(oe);break;case 2:for(nt=0;nt<oe.length;nt++)Ee(oe[nt]);break;case 3:for(oe=h(oe),nt=0;nt<oe.length;nt++)for(lt=0;lt<oe[nt].length;lt++)Ee(oe[nt][lt]);break}oe.length===1?oe=oe[0]:W="Multi"+W;var Ai={type:"Feature",geometry:{type:W,coordinates:oe},properties:this.properties};return"id"in this&&(Ai.id=this.id),Ai};function h(y){var E=y.length;if(E<=1)return[y];for(var L=[],F,N,z=0;z<E;z++){var oe=p(y[z]);oe!==0&&(N===void 0&&(N=oe<0),N===oe<0?(F&&L.push(F),F=[y[z]]):F.push(y[z]))}return F&&L.push(F),L}function p(y){for(var E=0,L=0,F=y.length,N=F-1,z,oe;L<F;N=L++)z=y[L],oe=y[N],E+=(oe.x-z.x)*(z.y+oe.y);return E}}}),require_vectortilelayer=__commonJS({"node_modules/@mapbox/vector-tile/lib/vectortilelayer.js"(t,n){var o=require_vectortilefeature();n.exports=s;function s(h,p){this.version=1,this.name=null,this.extent=4096,this.length=0,this._pbf=h,this._keys=[],this._values=[],this._features=[],h.readFields(c,this,p),this.length=this._features.length}function c(h,p,y){h===15?p.version=y.readVarint():h===1?p.name=y.readString():h===5?p.extent=y.readVarint():h===2?p._features.push(y.pos):h===3?p._keys.push(y.readString()):h===4&&p._values.push(d(y))}function d(h){for(var p=null,y=h.readVarint()+h.pos;h.pos<y;){var E=h.readVarint()>>3;p=E===1?h.readString():E===2?h.readFloat():E===3?h.readDouble():E===4?h.readVarint64():E===5?h.readVarint():E===6?h.readSVarint():E===7?h.readBoolean():null}return p}s.prototype.feature=function(h){if(h<0||h>=this._features.length)throw new Error("feature index out of bounds");this._pbf.pos=this._features[h];var p=this._pbf.readVarint()+this._pbf.pos;return new o(this._pbf,p,this.extent,this._keys,this._values)}}}),require_vectortile=__commonJS({"node_modules/@mapbox/vector-tile/lib/vectortile.js"(t,n){var o=require_vectortilelayer();n.exports=s;function s(d,h){this.layers=d.readFields(c,{},h)}function c(d,h,p){if(d===3){var y=new o(p,p.readVarint()+p.pos);y.length&&(h[y.name]=y)}}}}),require_vector_tile=__commonJS({"node_modules/@mapbox/vector-tile/index.js"(t,n){n.exports.VectorTile=require_vectortile(),n.exports.VectorTileFeature=require_vectortilefeature(),n.exports.VectorTileLayer=require_vectortilelayer()}}),require_ieee754=__commonJS({"node_modules/ieee754/index.js"(t){t.read=function(n,o,s,c,d){var h,p,y=d*8-c-1,E=(1<<y)-1,L=E>>1,F=-7,N=s?d-1:0,z=s?-1:1,oe=n[o+N];for(N+=z,h=oe&(1<<-F)-1,oe>>=-F,F+=y;F>0;h=h*256+n[o+N],N+=z,F-=8);for(p=h&(1<<-F)-1,h>>=-F,F+=c;F>0;p=p*256+n[o+N],N+=z,F-=8);if(h===0)h=1-L;else{if(h===E)return p?NaN:(oe?-1:1)*(1/0);p=p+Math.pow(2,c),h=h-L}return(oe?-1:1)*p*Math.pow(2,h-c)},t.write=function(n,o,s,c,d,h){var p,y,E,L=h*8-d-1,F=(1<<L)-1,N=F>>1,z=d===23?Math.pow(2,-24)-Math.pow(2,-77):0,oe=c?0:h-1,W=c?1:-1,nt=o<0||o===0&&1/o<0?1:0;for(o=Math.abs(o),isNaN(o)||o===1/0?(y=isNaN(o)?1:0,p=F):(p=Math.floor(Math.log(o)/Math.LN2),o*(E=Math.pow(2,-p))<1&&(p--,E*=2),p+N>=1?o+=z/E:o+=z*Math.pow(2,1-N),o*E>=2&&(p++,E/=2),p+N>=F?(y=0,p=F):p+N>=1?(y=(o*E-1)*Math.pow(2,d),p=p+N):(y=o*Math.pow(2,N-1)*Math.pow(2,d),p=0));d>=8;n[s+oe]=y&255,oe+=W,y/=256,d-=8);for(p=p<<d|y,L+=d;L>0;n[s+oe]=p&255,oe+=W,p/=256,L-=8);n[s+oe-W]|=nt*128}}}),require_pbf=__commonJS({"node_modules/pbf/index.js"(t,n){n.exports=s;var o=require_ieee754();function s(mt){this.buf=ArrayBuffer.isView&&ArrayBuffer.isView(mt)?mt:new Uint8Array(mt||0),this.pos=0,this.type=0,this.length=this.buf.length}s.Varint=0,s.Fixed64=1,s.Bytes=2,s.Fixed32=5;var c=65536*65536,d=1/c,h=12,p=typeof TextDecoder>"u"?null:new TextDecoder("utf8");s.prototype={destroy:function(){this.buf=null},readFields:function(mt,fa,Ra){for(Ra=Ra||this.length;this.pos<Ra;){var sl=this.readVarint(),Zd=sl>>3,Xd=this.pos;this.type=sl&7,mt(Zd,fa,this),this.pos===Xd&&this.skip(sl)}return fa},readMessage:function(mt,fa){return this.readFields(mt,fa,this.readVarint()+this.pos)},readFixed32:function(){var mt=Sa(this.buf,this.pos);return this.pos+=4,mt},readSFixed32:function(){var mt=ms(this.buf,this.pos);return this.pos+=4,mt},readFixed64:function(){var mt=Sa(this.buf,this.pos)+Sa(this.buf,this.pos+4)*c;return this.pos+=8,mt},readSFixed64:function(){var mt=Sa(this.buf,this.pos)+ms(this.buf,this.pos+4)*c;return this.pos+=8,mt},readFloat:function(){var mt=o.read(this.buf,this.pos,!0,23,4);return this.pos+=4,mt},readDouble:function(){var mt=o.read(this.buf,this.pos,!0,52,8);return this.pos+=8,mt},readVarint:function(mt){var fa=this.buf,Ra,sl;return sl=fa[this.pos++],Ra=sl&127,sl<128||(sl=fa[this.pos++],Ra|=(sl&127)<<7,sl<128)||(sl=fa[this.pos++],Ra|=(sl&127)<<14,sl<128)||(sl=fa[this.pos++],Ra|=(sl&127)<<21,sl<128)?Ra:(sl=fa[this.pos],Ra|=(sl&15)<<28,y(Ra,mt,this))},readVarint64:function(){return this.readVarint(!0)},readSVarint:function(){var mt=this.readVarint();return mt%2===1?(mt+1)/-2:mt/2},readBoolean:function(){return!!this.readVarint()},readString:function(){var mt=this.readVarint()+this.pos,fa=this.pos;return this.pos=mt,mt-fa>=h&&p?Wa(this.buf,fa,mt):Wc(this.buf,fa,mt)},readBytes:function(){var mt=this.readVarint()+this.pos,fa=this.buf.subarray(this.pos,mt);return this.pos=mt,fa},readPackedVarint:function(mt,fa){if(this.type!==s.Bytes)return mt.push(this.readVarint(fa));var Ra=E(this);for(mt=mt||[];this.pos<Ra;)mt.push(this.readVarint(fa));return mt},readPackedSVarint:function(mt){if(this.type!==s.Bytes)return mt.push(this.readSVarint());var fa=E(this);for(mt=mt||[];this.pos<fa;)mt.push(this.readSVarint());return mt},readPackedBoolean:function(mt){if(this.type!==s.Bytes)return mt.push(this.readBoolean());var fa=E(this);for(mt=mt||[];this.pos<fa;)mt.push(this.readBoolean());return mt},readPackedFloat:function(mt){if(this.type!==s.Bytes)return mt.push(this.readFloat());var fa=E(this);for(mt=mt||[];this.pos<fa;)mt.push(this.readFloat());return mt},readPackedDouble:function(mt){if(this.type!==s.Bytes)return mt.push(this.readDouble());var fa=E(this);for(mt=mt||[];this.pos<fa;)mt.push(this.readDouble());return mt},readPackedFixed32:function(mt){if(this.type!==s.Bytes)return mt.push(this.readFixed32());var fa=E(this);for(mt=mt||[];this.pos<fa;)mt.push(this.readFixed32());return mt},readPackedSFixed32:function(mt){if(this.type!==s.Bytes)return mt.push(this.readSFixed32());var fa=E(this);for(mt=mt||[];this.pos<fa;)mt.push(this.readSFixed32());return mt},readPackedFixed64:function(mt){if(this.type!==s.Bytes)return mt.push(this.readFixed64());var fa=E(this);for(mt=mt||[];this.pos<fa;)mt.push(this.readFixed64());return mt},readPackedSFixed64:function(mt){if(this.type!==s.Bytes)return mt.push(this.readSFixed64());var fa=E(this);for(mt=mt||[];this.pos<fa;)mt.push(this.readSFixed64());return mt},skip:function(mt){var fa=mt&7;if(fa===s.Varint)for(;this.buf[this.pos++]>127;);else if(fa===s.Bytes)this.pos=this.readVarint()+this.pos;else if(fa===s.Fixed32)this.pos+=4;else if(fa===s.Fixed64)this.pos+=8;else throw new Error("Unimplemented type: "+fa)},writeTag:function(mt,fa){this.writeVarint(mt<<3|fa)},realloc:function(mt){for(var fa=this.length||16;fa<this.pos+mt;)fa*=2;if(fa!==this.length){var Ra=new Uint8Array(fa);Ra.set(this.buf),this.buf=Ra,this.length=fa}},finish:function(){return this.length=this.pos,this.pos=0,this.buf.subarray(0,this.length)},writeFixed32:function(mt){this.realloc(4),ya(this.buf,mt,this.pos),this.pos+=4},writeSFixed32:function(mt){this.realloc(4),ya(this.buf,mt,this.pos),this.pos+=4},writeFixed64:function(mt){this.realloc(8),ya(this.buf,mt&-1,this.pos),ya(this.buf,Math.floor(mt*d),this.pos+4),this.pos+=8},writeSFixed64:function(mt){this.realloc(8),ya(this.buf,mt&-1,this.pos),ya(this.buf,Math.floor(mt*d),this.pos+4),this.pos+=8},writeVarint:function(mt){if(mt=+mt||0,mt>268435455||mt<0){F(mt,this);return}this.realloc(4),this.buf[this.pos++]=mt&127|(mt>127?128:0),!(mt<=127)&&(this.buf[this.pos++]=(mt>>>=7)&127|(mt>127?128:0),!(mt<=127)&&(this.buf[this.pos++]=(mt>>>=7)&127|(mt>127?128:0),!(mt<=127)&&(this.buf[this.pos++]=mt>>>7&127)))},writeSVarint:function(mt){this.writeVarint(mt<0?-mt*2-1:mt*2)},writeBoolean:function(mt){this.writeVarint(!!mt)},writeString:function(mt){mt=String(mt),this.realloc(mt.length*4),this.pos++;var fa=this.pos;this.pos=pi(this.buf,mt,this.pos);var Ra=this.pos-fa;Ra>=128&&oe(fa,Ra,this),this.pos=fa-1,this.writeVarint(Ra),this.pos+=Ra},writeFloat:function(mt){this.realloc(4),o.write(this.buf,mt,this.pos,!0,23,4),this.pos+=4},writeDouble:function(mt){this.realloc(8),o.write(this.buf,mt,this.pos,!0,52,8),this.pos+=8},writeBytes:function(mt){var fa=mt.length;this.writeVarint(fa),this.realloc(fa);for(var Ra=0;Ra<fa;Ra++)this.buf[this.pos++]=mt[Ra]},writeRawMessage:function(mt,fa){this.pos++;var Ra=this.pos;mt(fa,this);var sl=this.pos-Ra;sl>=128&&oe(Ra,sl,this),this.pos=Ra-1,this.writeVarint(sl),this.pos+=sl},writeMessage:function(mt,fa,Ra){this.writeTag(mt,s.Bytes),this.writeRawMessage(fa,Ra)},writePackedVarint:function(mt,fa){fa.length&&this.writeMessage(mt,W,fa)},writePackedSVarint:function(mt,fa){fa.length&&this.writeMessage(mt,nt,fa)},writePackedBoolean:function(mt,fa){fa.length&&this.writeMessage(mt,yt,fa)},writePackedFloat:function(mt,fa){fa.length&&this.writeMessage(mt,lt,fa)},writePackedDouble:function(mt,fa){fa.length&&this.writeMessage(mt,Ee,fa)},writePackedFixed32:function(mt,fa){fa.length&&this.writeMessage(mt,Ai,fa)},writePackedSFixed32:function(mt,fa){fa.length&&this.writeMessage(mt,zi,fa)},writePackedFixed64:function(mt,fa){fa.length&&this.writeMessage(mt,ha,fa)},writePackedSFixed64:function(mt,fa){fa.length&&this.writeMessage(mt,ba,fa)},writeBytesField:function(mt,fa){this.writeTag(mt,s.Bytes),this.writeBytes(fa)},writeFixed32Field:function(mt,fa){this.writeTag(mt,s.Fixed32),this.writeFixed32(fa)},writeSFixed32Field:function(mt,fa){this.writeTag(mt,s.Fixed32),this.writeSFixed32(fa)},writeFixed64Field:function(mt,fa){this.writeTag(mt,s.Fixed64),this.writeFixed64(fa)},writeSFixed64Field:function(mt,fa){this.writeTag(mt,s.Fixed64),this.writeSFixed64(fa)},writeVarintField:function(mt,fa){this.writeTag(mt,s.Varint),this.writeVarint(fa)},writeSVarintField:function(mt,fa){this.writeTag(mt,s.Varint),this.writeSVarint(fa)},writeStringField:function(mt,fa){this.writeTag(mt,s.Bytes),this.writeString(fa)},writeFloatField:function(mt,fa){this.writeTag(mt,s.Fixed32),this.writeFloat(fa)},writeDoubleField:function(mt,fa){this.writeTag(mt,s.Fixed64),this.writeDouble(fa)},writeBooleanField:function(mt,fa){this.writeVarintField(mt,!!fa)}};function y(mt,fa,Ra){var sl=Ra.buf,Zd,Xd;if(Xd=sl[Ra.pos++],Zd=(Xd&112)>>4,Xd<128||(Xd=sl[Ra.pos++],Zd|=(Xd&127)<<3,Xd<128)||(Xd=sl[Ra.pos++],Zd|=(Xd&127)<<10,Xd<128)||(Xd=sl[Ra.pos++],Zd|=(Xd&127)<<17,Xd<128)||(Xd=sl[Ra.pos++],Zd|=(Xd&127)<<24,Xd<128)||(Xd=sl[Ra.pos++],Zd|=(Xd&1)<<31,Xd<128))return L(mt,Zd,fa);throw new Error("Expected varint not more than 10 bytes")}function E(mt){return mt.type===s.Bytes?mt.readVarint()+mt.pos:mt.pos+1}function L(mt,fa,Ra){return Ra?fa*4294967296+(mt>>>0):(fa>>>0)*4294967296+(mt>>>0)}function F(mt,fa){var Ra,sl;if(mt>=0?(Ra=mt%4294967296|0,sl=mt/4294967296|0):(Ra=~(-mt%4294967296),sl=~(-mt/4294967296),Ra^4294967295?Ra=Ra+1|0:(Ra=0,sl=sl+1|0)),mt>=18446744073709552e3||mt<-18446744073709552e3)throw new Error("Given varint doesn't fit into 10 bytes");fa.realloc(10),N(Ra,sl,fa),z(sl,fa)}function N(mt,fa,Ra){Ra.buf[Ra.pos++]=mt&127|128,mt>>>=7,Ra.buf[Ra.pos++]=mt&127|128,mt>>>=7,Ra.buf[Ra.pos++]=mt&127|128,mt>>>=7,Ra.buf[Ra.pos++]=mt&127|128,mt>>>=7,Ra.buf[Ra.pos]=mt&127}function z(mt,fa){var Ra=(mt&7)<<4;fa.buf[fa.pos++]|=Ra|((mt>>>=3)?128:0),mt&&(fa.buf[fa.pos++]=mt&127|((mt>>>=7)?128:0),mt&&(fa.buf[fa.pos++]=mt&127|((mt>>>=7)?128:0),mt&&(fa.buf[fa.pos++]=mt&127|((mt>>>=7)?128:0),mt&&(fa.buf[fa.pos++]=mt&127|((mt>>>=7)?128:0),mt&&(fa.buf[fa.pos++]=mt&127)))))}function oe(mt,fa,Ra){var sl=fa<=16383?1:fa<=2097151?2:fa<=268435455?3:Math.floor(Math.log(fa)/(Math.LN2*7));Ra.realloc(sl);for(var Zd=Ra.pos-1;Zd>=mt;Zd--)Ra.buf[Zd+sl]=Ra.buf[Zd]}function W(mt,fa){for(var Ra=0;Ra<mt.length;Ra++)fa.writeVarint(mt[Ra])}function nt(mt,fa){for(var Ra=0;Ra<mt.length;Ra++)fa.writeSVarint(mt[Ra])}function lt(mt,fa){for(var Ra=0;Ra<mt.length;Ra++)fa.writeFloat(mt[Ra])}function Ee(mt,fa){for(var Ra=0;Ra<mt.length;Ra++)fa.writeDouble(mt[Ra])}function yt(mt,fa){for(var Ra=0;Ra<mt.length;Ra++)fa.writeBoolean(mt[Ra])}function Ai(mt,fa){for(var Ra=0;Ra<mt.length;Ra++)fa.writeFixed32(mt[Ra])}function zi(mt,fa){for(var Ra=0;Ra<mt.length;Ra++)fa.writeSFixed32(mt[Ra])}function ha(mt,fa){for(var Ra=0;Ra<mt.length;Ra++)fa.writeFixed64(mt[Ra])}function ba(mt,fa){for(var Ra=0;Ra<mt.length;Ra++)fa.writeSFixed64(mt[Ra])}function Sa(mt,fa){return(mt[fa]|mt[fa+1]<<8|mt[fa+2]<<16)+mt[fa+3]*16777216}function ya(mt,fa,Ra){mt[Ra]=fa,mt[Ra+1]=fa>>>8,mt[Ra+2]=fa>>>16,mt[Ra+3]=fa>>>24}function ms(mt,fa){return(mt[fa]|mt[fa+1]<<8|mt[fa+2]<<16)+(mt[fa+3]<<24)}function Wc(mt,fa,Ra){for(var sl="",Zd=fa;Zd<Ra;){var Xd=mt[Zd],pu=null,gl=Xd>239?4:Xd>223?3:Xd>191?2:1;if(Zd+gl>Ra)break;var md,ef,nf;gl===1?Xd<128&&(pu=Xd):gl===2?(md=mt[Zd+1],(md&192)===128&&(pu=(Xd&31)<<6|md&63,pu<=127&&(pu=null))):gl===3?(md=mt[Zd+1],ef=mt[Zd+2],(md&192)===128&&(ef&192)===128&&(pu=(Xd&15)<<12|(md&63)<<6|ef&63,(pu<=2047||pu>=55296&&pu<=57343)&&(pu=null))):gl===4&&(md=mt[Zd+1],ef=mt[Zd+2],nf=mt[Zd+3],(md&192)===128&&(ef&192)===128&&(nf&192)===128&&(pu=(Xd&15)<<18|(md&63)<<12|(ef&63)<<6|nf&63,(pu<=65535||pu>=1114112)&&(pu=null))),pu===null?(pu=65533,gl=1):pu>65535&&(pu-=65536,sl+=String.fromCharCode(pu>>>10&1023|55296),pu=56320|pu&1023),sl+=String.fromCharCode(pu),Zd+=gl}return sl}function Wa(mt,fa,Ra){return p.decode(mt.subarray(fa,Ra))}function pi(mt,fa,Ra){for(var sl=0,Zd,Xd;sl<fa.length;sl++){if(Zd=fa.charCodeAt(sl),Zd>55295&&Zd<57344)if(Xd)if(Zd<56320){mt[Ra++]=239,mt[Ra++]=191,mt[Ra++]=189,Xd=Zd;continue}else Zd=Xd-55296<<10|Zd-56320|65536,Xd=null;else{Zd>56319||sl+1===fa.length?(mt[Ra++]=239,mt[Ra++]=191,mt[Ra++]=189):Xd=Zd;continue}else Xd&&(mt[Ra++]=239,mt[Ra++]=191,mt[Ra++]=189,Xd=null);Zd<128?mt[Ra++]=Zd:(Zd<2048?mt[Ra++]=Zd>>6|192:(Zd<65536?mt[Ra++]=Zd>>12|224:(mt[Ra++]=Zd>>18|240,mt[Ra++]=Zd>>12&63|128),mt[Ra++]=Zd>>6&63|128),mt[Ra++]=Zd&63|128)}return Ra}}}),require_rbush_min=__commonJS({"node_modules/rbush/rbush.min.js"(t,n){(function(o,s){typeof t=="object"&&typeof n<"u"?n.exports=s():typeof define=="function"&&define.amd?define(s):(o=o||self).RBush=s()})(t,function(){function o(Ee,yt,Ai,zi,ha){(function ba(Sa,ya,ms,Wc,Wa){for(;Wc>ms;){if(Wc-ms>600){var pi=Wc-ms+1,mt=ya-ms+1,fa=Math.log(pi),Ra=.5*Math.exp(2*fa/3),sl=.5*Math.sqrt(fa*Ra*(pi-Ra)/pi)*(mt-pi/2<0?-1:1),Zd=Math.max(ms,Math.floor(ya-mt*Ra/pi+sl)),Xd=Math.min(Wc,Math.floor(ya+(pi-mt)*Ra/pi+sl));ba(Sa,ya,Zd,Xd,Wa)}var pu=Sa[ya],gl=ms,md=Wc;for(s(Sa,ms,ya),Wa(Sa[Wc],pu)>0&&s(Sa,ms,Wc);gl<md;){for(s(Sa,gl,md),gl++,md--;Wa(Sa[gl],pu)<0;)gl++;for(;Wa(Sa[md],pu)>0;)md--}Wa(Sa[ms],pu)===0?s(Sa,ms,md):s(Sa,++md,Wc),md<=ya&&(ms=md+1),ya<=md&&(Wc=md-1)}})(Ee,yt,Ai||0,zi||Ee.length-1,ha||c)}function s(Ee,yt,Ai){var zi=Ee[yt];Ee[yt]=Ee[Ai],Ee[Ai]=zi}function c(Ee,yt){return Ee<yt?-1:Ee>yt?1:0}var d=function(Ee){Ee===void 0&&(Ee=9),this._maxEntries=Math.max(4,Ee),this._minEntries=Math.max(2,Math.ceil(.4*this._maxEntries)),this.clear()};function h(Ee,yt,Ai){if(!Ai)return yt.indexOf(Ee);for(var zi=0;zi<yt.length;zi++)if(Ai(Ee,yt[zi]))return zi;return-1}function p(Ee,yt){y(Ee,0,Ee.children.length,yt,Ee)}function y(Ee,yt,Ai,zi,ha){ha||(ha=nt(null)),ha.minX=1/0,ha.minY=1/0,ha.maxX=-1/0,ha.maxY=-1/0;for(var ba=yt;ba<Ai;ba++){var Sa=Ee.children[ba];E(ha,Ee.leaf?zi(Sa):Sa)}return ha}function E(Ee,yt){return Ee.minX=Math.min(Ee.minX,yt.minX),Ee.minY=Math.min(Ee.minY,yt.minY),Ee.maxX=Math.max(Ee.maxX,yt.maxX),Ee.maxY=Math.max(Ee.maxY,yt.maxY),Ee}function L(Ee,yt){return Ee.minX-yt.minX}function F(Ee,yt){return Ee.minY-yt.minY}function N(Ee){return(Ee.maxX-Ee.minX)*(Ee.maxY-Ee.minY)}function z(Ee){return Ee.maxX-Ee.minX+(Ee.maxY-Ee.minY)}function oe(Ee,yt){return Ee.minX<=yt.minX&&Ee.minY<=yt.minY&&yt.maxX<=Ee.maxX&&yt.maxY<=Ee.maxY}function W(Ee,yt){return yt.minX<=Ee.maxX&&yt.minY<=Ee.maxY&&yt.maxX>=Ee.minX&&yt.maxY>=Ee.minY}function nt(Ee){return{children:Ee,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function lt(Ee,yt,Ai,zi,ha){for(var ba=[yt,Ai];ba.length;)if(!((Ai=ba.pop())-(yt=ba.pop())<=zi)){var Sa=yt+Math.ceil((Ai-yt)/zi/2)*zi;o(Ee,Sa,yt,Ai,ha),ba.push(yt,Sa,Sa,Ai)}}return d.prototype.all=function(){return this._all(this.data,[])},d.prototype.search=function(Ee){var yt=this.data,Ai=[];if(!W(Ee,yt))return Ai;for(var zi=this.toBBox,ha=[];yt;){for(var ba=0;ba<yt.children.length;ba++){var Sa=yt.children[ba],ya=yt.leaf?zi(Sa):Sa;W(Ee,ya)&&(yt.leaf?Ai.push(Sa):oe(Ee,ya)?this._all(Sa,Ai):ha.push(Sa))}yt=ha.pop()}return Ai},d.prototype.collides=function(Ee){var yt=this.data;if(!W(Ee,yt))return!1;for(var Ai=[];yt;){for(var zi=0;zi<yt.children.length;zi++){var ha=yt.children[zi],ba=yt.leaf?this.toBBox(ha):ha;if(W(Ee,ba)){if(yt.leaf||oe(Ee,ba))return!0;Ai.push(ha)}}yt=Ai.pop()}return!1},d.prototype.load=function(Ee){if(!Ee||!Ee.length)return this;if(Ee.length<this._minEntries){for(var yt=0;yt<Ee.length;yt++)this.insert(Ee[yt]);return this}var Ai=this._build(Ee.slice(),0,Ee.length-1,0);if(this.data.children.length)if(this.data.height===Ai.height)this._splitRoot(this.data,Ai);else{if(this.data.height<Ai.height){var zi=this.data;this.data=Ai,Ai=zi}this._insert(Ai,this.data.height-Ai.height-1,!0)}else this.data=Ai;return this},d.prototype.insert=function(Ee){return Ee&&this._insert(Ee,this.data.height-1),this},d.prototype.clear=function(){return this.data=nt([]),this},d.prototype.remove=function(Ee,yt){if(!Ee)return this;for(var Ai,zi,ha,ba=this.data,Sa=this.toBBox(Ee),ya=[],ms=[];ba||ya.length;){if(ba||(ba=ya.pop(),zi=ya[ya.length-1],Ai=ms.pop(),ha=!0),ba.leaf){var Wc=h(Ee,ba.children,yt);if(Wc!==-1)return ba.children.splice(Wc,1),ya.push(ba),this._condense(ya),this}ha||ba.leaf||!oe(ba,Sa)?zi?(Ai++,ba=zi.children[Ai],ha=!1):ba=null:(ya.push(ba),ms.push(Ai),Ai=0,zi=ba,ba=ba.children[0])}return this},d.prototype.toBBox=function(Ee){return Ee},d.prototype.compareMinX=function(Ee,yt){return Ee.minX-yt.minX},d.prototype.compareMinY=function(Ee,yt){return Ee.minY-yt.minY},d.prototype.toJSON=function(){return this.data},d.prototype.fromJSON=function(Ee){return this.data=Ee,this},d.prototype._all=function(Ee,yt){for(var Ai=[];Ee;)Ee.leaf?yt.push.apply(yt,Ee.children):Ai.push.apply(Ai,Ee.children),Ee=Ai.pop();return yt},d.prototype._build=function(Ee,yt,Ai,zi){var ha,ba=Ai-yt+1,Sa=this._maxEntries;if(ba<=Sa)return p(ha=nt(Ee.slice(yt,Ai+1)),this.toBBox),ha;zi||(zi=Math.ceil(Math.log(ba)/Math.log(Sa)),Sa=Math.ceil(ba/Math.pow(Sa,zi-1))),(ha=nt([])).leaf=!1,ha.height=zi;var ya=Math.ceil(ba/Sa),ms=ya*Math.ceil(Math.sqrt(Sa));lt(Ee,yt,Ai,ms,this.compareMinX);for(var Wc=yt;Wc<=Ai;Wc+=ms){var Wa=Math.min(Wc+ms-1,Ai);lt(Ee,Wc,Wa,ya,this.compareMinY);for(var pi=Wc;pi<=Wa;pi+=ya){var mt=Math.min(pi+ya-1,Wa);ha.children.push(this._build(Ee,pi,mt,zi-1))}}return p(ha,this.toBBox),ha},d.prototype._chooseSubtree=function(Ee,yt,Ai,zi){for(;zi.push(yt),!yt.leaf&&zi.length-1!==Ai;){for(var ha=1/0,ba=1/0,Sa=void 0,ya=0;ya<yt.children.length;ya++){var ms=yt.children[ya],Wc=N(ms),Wa=(pi=Ee,mt=ms,(Math.max(mt.maxX,pi.maxX)-Math.min(mt.minX,pi.minX))*(Math.max(mt.maxY,pi.maxY)-Math.min(mt.minY,pi.minY))-Wc);Wa<ba?(ba=Wa,ha=Wc<ha?Wc:ha,Sa=ms):Wa===ba&&Wc<ha&&(ha=Wc,Sa=ms)}yt=Sa||yt.children[0]}var pi,mt;return yt},d.prototype._insert=function(Ee,yt,Ai){var zi=Ai?Ee:this.toBBox(Ee),ha=[],ba=this._chooseSubtree(zi,this.data,yt,ha);for(ba.children.push(Ee),E(ba,zi);yt>=0&&ha[yt].children.length>this._maxEntries;)this._split(ha,yt),yt--;this._adjustParentBBoxes(zi,ha,yt)},d.prototype._split=function(Ee,yt){var Ai=Ee[yt],zi=Ai.children.length,ha=this._minEntries;this._chooseSplitAxis(Ai,ha,zi);var ba=this._chooseSplitIndex(Ai,ha,zi),Sa=nt(Ai.children.splice(ba,Ai.children.length-ba));Sa.height=Ai.height,Sa.leaf=Ai.leaf,p(Ai,this.toBBox),p(Sa,this.toBBox),yt?Ee[yt-1].children.push(Sa):this._splitRoot(Ai,Sa)},d.prototype._splitRoot=function(Ee,yt){this.data=nt([Ee,yt]),this.data.height=Ee.height+1,this.data.leaf=!1,p(this.data,this.toBBox)},d.prototype._chooseSplitIndex=function(Ee,yt,Ai){for(var zi,ha,ba,Sa,ya,ms,Wc,Wa=1/0,pi=1/0,mt=yt;mt<=Ai-yt;mt++){var fa=y(Ee,0,mt,this.toBBox),Ra=y(Ee,mt,Ai,this.toBBox),sl=(ha=fa,ba=Ra,Sa=void 0,ya=void 0,ms=void 0,Wc=void 0,Sa=Math.max(ha.minX,ba.minX),ya=Math.max(ha.minY,ba.minY),ms=Math.min(ha.maxX,ba.maxX),Wc=Math.min(ha.maxY,ba.maxY),Math.max(0,ms-Sa)*Math.max(0,Wc-ya)),Zd=N(fa)+N(Ra);sl<Wa?(Wa=sl,zi=mt,pi=Zd<pi?Zd:pi):sl===Wa&&Zd<pi&&(pi=Zd,zi=mt)}return zi||Ai-yt},d.prototype._chooseSplitAxis=function(Ee,yt,Ai){var zi=Ee.leaf?this.compareMinX:L,ha=Ee.leaf?this.compareMinY:F;this._allDistMargin(Ee,yt,Ai,zi)<this._allDistMargin(Ee,yt,Ai,ha)&&Ee.children.sort(zi)},d.prototype._allDistMargin=function(Ee,yt,Ai,zi){Ee.children.sort(zi);for(var ha=this.toBBox,ba=y(Ee,0,yt,ha),Sa=y(Ee,Ai-yt,Ai,ha),ya=z(ba)+z(Sa),ms=yt;ms<Ai-yt;ms++){var Wc=Ee.children[ms];E(ba,Ee.leaf?ha(Wc):Wc),ya+=z(ba)}for(var Wa=Ai-yt-1;Wa>=yt;Wa--){var pi=Ee.children[Wa];E(Sa,Ee.leaf?ha(pi):pi),ya+=z(Sa)}return ya},d.prototype._adjustParentBBoxes=function(Ee,yt,Ai){for(var zi=Ai;zi>=0;zi--)E(yt[zi],Ee)},d.prototype._condense=function(Ee){for(var yt=Ee.length-1,Ai=void 0;yt>=0;yt--)Ee[yt].children.length===0?yt>0?(Ai=Ee[yt-1].children).splice(Ai.indexOf(Ee[yt]),1):this.clear():p(Ee[yt],this.toBBox)},d})}}),require_unitbezier_d=__commonJS({"src/types/unitbezier.d.ts"(){}}),require_tinyqueue=__commonJS({"node_modules/tinyqueue/tinyqueue.js"(t,n){(function(o,s){typeof t=="object"&&typeof n<"u"?n.exports=s():typeof define=="function"&&define.amd?define(s):(o=o||self,o.TinyQueue=s())})(t,function(){var o=function(d,h){if(d===void 0&&(d=[]),h===void 0&&(h=s),this.data=d,this.length=this.data.length,this.compare=h,this.length>0)for(var p=(this.length>>1)-1;p>=0;p--)this._down(p)};o.prototype.push=function(d){this.data.push(d),this.length++,this._up(this.length-1)},o.prototype.pop=function(){if(this.length!==0){var d=this.data[0],h=this.data.pop();return this.length--,this.length>0&&(this.data[0]=h,this._down(0)),d}},o.prototype.peek=function(){return this.data[0]},o.prototype._up=function(d){for(var h=this,p=h.data,y=h.compare,E=p[d];d>0;){var L=d-1>>1,F=p[L];if(y(E,F)>=0)break;p[d]=F,d=L}p[d]=E},o.prototype._down=function(d){for(var h=this,p=h.data,y=h.compare,E=this.length>>1,L=p[d];d<E;){var F=(d<<1)+1,N=p[F],z=F+1;if(z<this.length&&y(p[z],N)<0&&(F=z,N=p[z]),y(N,L)>=0)break;p[d]=N,d=F}p[d]=L};function s(c,d){return c<d?-1:c>d?1:0}return o})}}),require_polylabel=__commonJS({"node_modules/polylabel/polylabel.js"(t,n){var o=require_tinyqueue();o.default&&(o=o.default),n.exports=s,n.exports.default=s;function s(E,L,F){L=L||1;for(var N,z,oe,W,nt=0;nt<E[0].length;nt++){var lt=E[0][nt];(!nt||lt[0]<N)&&(N=lt[0]),(!nt||lt[1]<z)&&(z=lt[1]),(!nt||lt[0]>oe)&&(oe=lt[0]),(!nt||lt[1]>W)&&(W=lt[1])}var Ee=oe-N,yt=W-z,Ai=Math.min(Ee,yt),zi=Ai/2;if(Ai===0){var ha=[N,z];return ha.distance=0,ha}for(var ba=new o(void 0,c),Sa=N;Sa<oe;Sa+=Ai)for(var ya=z;ya<W;ya+=Ai)ba.push(new d(Sa+zi,ya+zi,zi,E));var ms=p(E),Wc=new d(N+Ee/2,z+yt/2,0,E);Wc.d>ms.d&&(ms=Wc);for(var Wa=ba.length;ba.length;){var pi=ba.pop();pi.d>ms.d&&(ms=pi,F&&console.log("found best %d after %d probes",Math.round(1e4*pi.d)/1e4,Wa)),!(pi.max-ms.d<=L)&&(zi=pi.h/2,ba.push(new d(pi.x-zi,pi.y-zi,zi,E)),ba.push(new d(pi.x+zi,pi.y-zi,zi,E)),ba.push(new d(pi.x-zi,pi.y+zi,zi,E)),ba.push(new d(pi.x+zi,pi.y+zi,zi,E)),Wa+=4)}F&&(console.log("num probes: "+Wa),console.log("best distance: "+ms.d));var mt=[ms.x,ms.y];return mt.distance=ms.d,mt}function c(E,L){return L.max-E.max}function d(E,L,F,N){this.x=E,this.y=L,this.h=F,this.d=h(E,L,N),this.max=this.d+this.h*Math.SQRT2}function h(E,L,F){for(var N=!1,z=1/0,oe=0;oe<F.length;oe++)for(var W=F[oe],nt=0,lt=W.length,Ee=lt-1;nt<lt;Ee=nt++){var yt=W[nt],Ai=W[Ee];yt[1]>L!=Ai[1]>L&&E<(Ai[0]-yt[0])*(L-yt[1])/(Ai[1]-yt[1])+yt[0]&&(N=!N),z=Math.min(z,y(E,L,yt,Ai))}return z===0?0:(N?1:-1)*Math.sqrt(z)}function p(E){for(var L=0,F=0,N=0,z=E[0],oe=0,W=z.length,nt=W-1;oe<W;nt=oe++){var lt=z[oe],Ee=z[nt],yt=lt[0]*Ee[1]-Ee[0]*lt[1];F+=(lt[0]+Ee[0])*yt,N+=(lt[1]+Ee[1])*yt,L+=yt*3}return L===0?new d(z[0][0],z[0][1],0,E):new d(F/L,N/L,0,E)}function y(E,L,F,N){var z=F[0],oe=F[1],W=N[0]-z,nt=N[1]-oe;if(W!==0||nt!==0){var lt=((E-z)*W+(L-oe)*nt)/(W*W+nt*nt);lt>1?(z=N[0],oe=N[1]):lt>0&&(z+=W*lt,oe+=nt*lt)}return W=E-z,nt=L-oe,W*W+nt*nt}}});__toModule(require_point_geometry()),__toModule(require_point_geometry());var import_point_geometry=__toModule(require_point_geometry()),import_vector_tile=__toModule(require_vector_tile()),import_pbf=__toModule(require_pbf()),u8=Uint8Array,u16=Uint16Array,u32=Uint32Array,fleb=new u8([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0]),fdeb=new u8([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0]),freb=function(t,n){for(var o=new u16(31),s=0;s<31;++s)o[s]=n+=1<<t[s-1];for(var c=new u32(o[30]),s=1;s<30;++s)for(var d=o[s];d<o[s+1];++d)c[d]=d-o[s]<<5|s;return[o,c]},_a$1=freb(fleb,2),fl$1=_a$1[0],revfl=_a$1[1];fl$1[28]=258,revfl[258]=28,freb(fdeb,0);var rev=new u16(32768);for(i=0;i<32768;++i)x=(i&43690)>>>1|(i&21845)<<1,x=(x&52428)>>>2|(x&13107)<<2,x=(x&61680)>>>4|(x&3855)<<4,rev[i]=((x&65280)>>>8|(x&255)<<8)>>>1;var x,i,flt=new u8(288);for(i=0;i<144;++i)flt[i]=8;var i;for(i=144;i<256;++i)flt[i]=9;var i;for(i=256;i<280;++i)flt[i]=7;var i;for(i=280;i<288;++i)flt[i]=8;var i,fdt=new u8(32);for(i=0;i<32;++i)fdt[i]=5;var i,et$1=new u8(0),td$1=typeof TextDecoder<"u"&&new TextDecoder,tds=0;try{td$1.decode(et$1,{stream:!0}),tds=1}catch(t){}var GeomType;(function(t){t[t.Point=1]="Point",t[t.Line=2]="Line",t[t.Polygon=3]="Polygon"})(GeomType||(GeomType={}));function toIndex(t){return t.x+":"+t.y+":"+t.z}var loadGeomAndBbox=(t,n,o)=>{t.pos=n;for(var s=t.readVarint()+t.pos,c=1,d=0,h=0,p=0,y=1/0,E=-1/0,L=1/0,F=-1/0,N=[],z=[];t.pos<s;){if(d<=0){var oe=t.readVarint();c=oe&7,d=oe>>3}if(d--,c===1||c===2)h+=t.readSVarint()*o,p+=t.readSVarint()*o,h<y&&(y=h),h>E&&(E=h),p<L&&(L=p),p>F&&(F=p),c===1&&(z.length>0&&N.push(z),z=[]),z.push(new import_point_geometry.default(h,p));else if(c===7)z&&z.push(z[0].clone());else throw new Error("unknown command "+c)}return z&&N.push(z),{geom:N,bbox:{minX:y,minY:L,maxX:E,maxY:F}}};function parseTile(t,n){let o=new import_vector_tile.VectorTile(new import_pbf.default(t)),s=new Map;for(let[c,d]of Object.entries(o.layers)){let h=[],p=d;for(let y=0;y<p.length;y++){let E=loadGeomAndBbox(p.feature(y)._pbf,p.feature(y)._geometry,n/p.extent),L=0;for(let F of E.geom)L+=F.length;h.push({id:p.feature(y).id,geomType:p.feature(y).type,geom:E.geom,numVertices:L,bbox:E.bbox,props:p.feature(y).properties})}s.set(c,h)}return s}var ZxySource=class{constructor(t,n){this.url=t,this.controllers=[],this.shouldCancelZooms=n}get(t,n){return __async(this,null,function*(){this.shouldCancelZooms&&(this.controllers=this.controllers.filter(d=>d[0]!=t.z?(d[1].abort(),!1):!0));let o=this.url.replace("{z}",t.z.toString()).replace("{x}",t.x.toString()).replace("{y}",t.y.toString());const s=new AbortController;this.controllers.push([t.z,s]);const c=s.signal;return new Promise((d,h)=>{fetch(o,{signal:c}).then(p=>p.arrayBuffer()).then(p=>{let y=parseTile(p,n);d(y)}).catch(p=>{h(p)})})})}},R=6378137,MAX_LATITUDE=85.0511287798,MAXCOORD=R*Math.PI,project=t=>{let n=Math.PI/180,o=Math.max(Math.min(MAX_LATITUDE,t[0]),-MAX_LATITUDE),s=Math.sin(o*n);return new import_point_geometry.default(R*t[1]*n,R*Math.log((1+s)/(1-s))/2)};function sqr(t){return t*t}function dist2(t,n){return sqr(t.x-n.x)+sqr(t.y-n.y)}function distToSegmentSquared(t,n,o){var s=dist2(n,o);if(s===0)return dist2(t,n);var c=((t.x-n.x)*(o.x-n.x)+(t.y-n.y)*(o.y-n.y))/s;return c=Math.max(0,Math.min(1,c)),dist2(t,new import_point_geometry.default(n.x+c*(o.x-n.x),n.y+c*(o.y-n.y)))}function isInRing(t,n){for(var o=!1,s=0,c=n.length-1;s<n.length;c=s++){var d=n[s].x,h=n[s].y,p=n[c].x,y=n[c].y,E=h>t.y!=y>t.y&&t.x<(p-d)*(t.y-h)/(y-h)+d;E&&(o=!o)}return o}function isCCW(t){for(var n=0,o=0;o<t.length;o++){let s=(o+1)%t.length;n+=t[o].x*t[s].y,n-=t[s].x*t[o].y}return n<0}function pointInPolygon(t,n){var o=!1;for(let s of n)if(isCCW(s))isInRing(t,s)&&(o=!1);else{if(o)return!0;isInRing(t,s)&&(o=!0)}return o}function pointMinDistToPoints(t,n){let o=1/0;for(let s of n){let c=Math.sqrt(dist2(t,s[0]));c<o&&(o=c)}return o}function pointMinDistToLines(t,n){let o=1/0;for(let c of n)for(var s=0;s<c.length-1;s++){let d=Math.sqrt(distToSegmentSquared(t,c[s],c[s+1]));d<o&&(o=d)}return o}var TileCache=class{constructor(t,n){this.source=t,this.cache=new Map,this.inflight=new Map,this.tileSize=n}queryFeatures(t,n,o,s){let c=project([n,t]);var d=new import_point_geometry.default((c.x+MAXCOORD)/(MAXCOORD*2),1-(c.y+MAXCOORD)/(MAXCOORD*2));d.x>1&&(d.x=d.x-Math.floor(d.x));let h=d.mult(1<<o),p=Math.floor(h.x),y=Math.floor(h.y);const E=toIndex({z:o,x:p,y});let L=[],F=this.cache.get(E);if(F){const N=new import_point_geometry.default((h.x-p)*this.tileSize,(h.y-y)*this.tileSize);for(let[z,oe]of F.data.entries())for(let W of oe)W.geomType==1?pointMinDistToPoints(N,W.geom)<s&&L.push({feature:W,layerName:z}):W.geomType==2?pointMinDistToLines(N,W.geom)<s&&L.push({feature:W,layerName:z}):pointInPolygon(N,W.geom)&&L.push({feature:W,layerName:z})}return L}get(t){return __async(this,null,function*(){const n=toIndex(t);return new Promise((o,s)=>{let c=this.cache.get(n);if(c)c.used=performance.now(),o(c.data);else{let d=this.inflight.get(n);d?d.push([o,s]):(this.inflight.set(n,[]),this.source.get(t,this.tileSize).then(h=>{this.cache.set(n,{used:performance.now(),data:h});let p=this.inflight.get(n);if(p&&p.forEach(y=>y[0](h)),this.inflight.delete(n),o(h),this.cache.size>=64){let y=1/0,E;this.cache.forEach((L,F)=>{L.used<y&&(y=L.used,E=F)}),E&&this.cache.delete(E)}}).catch(h=>{let p=this.inflight.get(n);p&&p.forEach(y=>y[1](h)),this.inflight.delete(n),s(h)}))}})})}};__toModule(require_point_geometry()),__toModule(require_point_geometry()),__toModule(require_rbush_min());var e=t=>parseInt(t.replace(/_/g,""),36);"1q29ehhb 1n09sgk7 1kl1ekf_ _yl4zsno 16z9eiv3 1p29lhp8 _bd9zg04 17u0____ _iw9zhe5 _to73___ _r45e31e _7l6g016 _jh8ouiv _zn3qba8 1jy4zshs 11u87k0u 1ro9yvyo 1aj3xael 1gz9zjz0 _3w8l4xo 1bf1ekf_ _ke3v___ _4rrkb__ 13j776yz _646mbhl _nrjr4__ _le6mbhl 1n37ehkb _m75f91n _qj3bzfz 1939yygw 11i5z6x8 _1k5f8xs 1509441m 15t5lwgf _ae2th1n _tg1ugcv 1lp1ugcv 16e14up_ _h55rw7n _ny9yavn _7a11xb_ 1ih442g9 _pv442g9 1mv16xof 14e6y7tu 1oo9zkds 17d1cisi _4v9y70f _y98m8kc 1019pq0v 12o9zda8 _348j4f4 1et50i2o _8epa8__ _ts6senj 1o350i2o 1mi9eiuo 1259yrp0 1ln80gnw _632xcoy 1cn9zldc _f29edu4 1n490c8q _9f9ziet 1b94vk74 _m49zkct 1kz6s73a 1eu9dtog _q58s1rz 1dy9sjiq __u89jo3 _aj5nkwg _ld89jo3 13h9z6wx _qa9z2ii _l119xgq _bs5arju 1hj4nwk9 1qt4nwk9 1ge6wau6 14j9zlcw 11p1edc_ _ms1zcxe _439shk6 _jt9y70f _754zsow 1la40eju _oq5p___ _x279qkz 1fa5r3rv _yd2d9ip _424tcku _8y1di2_ _zi2uabw _yy7rn9h 12yz980_ __39ljp6 1b59zg0x _n39zfzp 1fy9zest _b33k___ _hp9wq92 1il50hz4 _io472ub _lj9z3eo 19z9ykg0 _8t8iu3a 12b9bl4a 1ak5yw0o _896v4ku _tb8k8lv _s59zi6t _c09ze0p 1lg80oqn 1id9z8wb _238nba5 1kq6wgdi _154zssg _tn3zk49 _da9y6tc 1sg7cv4f _r12jvtt 1gq5fmkz 1cs9rvci _lp9jn1c _xw1tdnb 13f9zje6 16f6973h _vo7ir40 _bt5arjf _rc45e4t _hr4e100 10v4e100 _hc9zke2 _w91egv_ _sj2r1kk 13c87yx8 _vqpds__ _ni8ggk8 _tj9yqfb 1ia2j4r4 _7x9b10u 1fc9ld4j 1eq9zldr _5j9lhpx _ez9zl6o _md61fzm".split(" ").reduce((t,n)=>{const o=e(n.substring(0,3)),s=e(n.substring(3)).toString(16);let c="";for(let d=0;d<6-s.length;d++)c+="0";return t[o]=`${c}${s}`,t},{});var _$1=(t,n)=>Array.from(Array(n)).map(()=>t).join("");new RegExp(`^#${_$1("([a-f0-9])",3)}([a-f0-9])?$`,"i"),new RegExp(`^#${_$1("([a-f0-9]{2})",3)}([a-f0-9]{2})?$`,"i"),new RegExp(`^rgba?\\(\\s*(\\d+)\\s*${_$1(",\\s*(\\d+)\\s*",2)}(?:,\\s*([\\d.]+))?\\s*\\)$`,"i"),__toModule(require_point_geometry()),__toModule(require_unitbezier_d()),__toModule(require_polylabel()),__toModule(require_point_geometry());var Justify;(function(t){t[t.Left=1]="Left",t[t.Center=2]="Center",t[t.Right=3]="Right"})(Justify||(Justify={}));var TextPlacements;(function(t){t[t.N=1]="N",t[t.NE=2]="NE",t[t.E=3]="E",t[t.SE=4]="SE",t[t.S=5]="S",t[t.SW=6]="SW",t[t.W=7]="W",t[t.NW=8]="NW"})(TextPlacements||(TextPlacements={}));var LineLabelPlacement;(function(t){t[t.Above=1]="Above",t[t.Center=2]="Center",t[t.Below=3]="Below"})(LineLabelPlacement||(LineLabelPlacement={})),__toModule(require_point_geometry());/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> */function makeKey({x:t,y:n,level:o}){return`${o}:${t}:${n}`}function getTileCoords(t,n){if(n!=null&&t.level>n){const o=2**(t.level-n);return{x:Math.floor(t.x/o),y:Math.floor(t.y/o),z:n}}return{x:t.x,y:t.y,z:t.level}}class JapanGSIOptimalBVmapImageryProviderBase{constructor(n){Vf(this,"defaultAlpha");Vf(this,"defaultNightAlpha");Vf(this,"defaultDayAlpha");Vf(this,"defaultBrightness");Vf(this,"defaultContrast");Vf(this,"defaultHue");Vf(this,"defaultSaturation");Vf(this,"defaultGamma");Vf(this,"defaultMinificationFilter");Vf(this,"defaultMagnificationFilter");Vf(this,"ready",!0);Vf(this,"readyPromise",Promise.resolve(!0));Vf(this,"tileWidth",256);Vf(this,"tileHeight",256);Vf(this,"maximumLevel");Vf(this,"minimumLevel",0);Vf(this,"tilingScheme",new WebMercatorTilingScheme);Vf(this,"rectangle",this.tilingScheme.rectangle);Vf(this,"tileDiscardPolicy");Vf(this,"errorEvent",new Event$1);Vf(this,"credit");Vf(this,"proxy");Vf(this,"hasAlphaChannel",!0);(n==null?void 0:n.tilingScheme)!=null&&(this.tilingScheme=n.tilingScheme),(n==null?void 0:n.tileWidth)!=null&&(this.tileWidth=n.tileWidth),(n==null?void 0:n.tileHeight)!=null&&(this.tileHeight=n.tileHeight)}getTileCredits(n,o,s){}requestImage(n,o,s,c){}pickFeatures(n,o,s,c,d){}get _ready(){return this.ready}get _readyPromise(){return this.readyPromise}}class JapanGSIOptimalBVmapLabelImageryProvider extends JapanGSIOptimalBVmapImageryProviderBase{constructor(o){super(o);Vf(this,"minimumDataLevel");Vf(this,"maximumDataLevel");Vf(this,"tileCache");Vf(this,"image");Vf(this,"discardedTileCoords",new Set);this.tileDiscardPolicy=new DiscardEmptyTileImagePolicy,this.minimumDataLevel=o.minimumDataLevel,this.maximumDataLevel=o.maximumDataLevel;const s=new ZxySource(o.url,!1);this.tileCache=new TileCache(s,1024),this.image=document.createElement("canvas"),this.image.width=1,this.image.height=1}requestImage(o,s,c,d){const h=makeKey({x:o,y:s,level:c});return(async()=>c<this.minimumDataLevel||this.discardedTileCoords.has(h)?DiscardEmptyTileImagePolicy.EMPTY_IMAGE:(await this.tileCache.get(getTileCoords({x:o,y:s,level:c},this.maximumDataLevel)),this.image))().catch(()=>(this.discardedTileCoords.add(h),DiscardEmptyTileImagePolicy.EMPTY_IMAGE))}}const tiles={default:({cesiumIonAccessToken:t}={})=>Cesium$1.IonImageryProvider.fromAssetId(Cesium$1.IonWorldImageryStyle.AERIAL,{accessToken:t}).catch(console.error),default_label:({cesiumIonAccessToken:t}={})=>Cesium$1.IonImageryProvider.fromAssetId(Cesium$1.IonWorldImageryStyle.AERIAL_WITH_LABELS,{accessToken:t}).catch(console.error),default_road:({cesiumIonAccessToken:t}={})=>Cesium$1.IonImageryProvider.fromAssetId(Cesium$1.IonWorldImageryStyle.ROAD,{accessToken:t}).catch(console.error),stamen_watercolor:()=>new Cesium$1.OpenStreetMapImageryProvider({url:"https://stamen-tiles.a.ssl.fastly.net/watercolor/",credit:"Map tiles by Stamen Design, under CC BY 3.0. Data by OpenStreetMap, under CC BY SA.",fileExtension:"jpg"}),stamen_toner:()=>new Cesium$1.OpenStreetMapImageryProvider({url:"https://stamen-tiles.a.ssl.fastly.net/toner/",credit:"Map tiles by Stamen Design, under CC BY 3.0. Data by OpenStreetMap, under CC BY SA."}),open_street_map:()=>new Cesium$1.OpenStreetMapImageryProvider({url:"https://a.tile.openstreetmap.org/",credit:"Copyright: Tiles © Esri — Source: Esri, DeLorme, NAVTEQ, USGS, Intermap, iPC, NRCAN, Esri Japan, METI, Esri China (Hong Kong), Esri (Thailand), TomTom, 2012"}),esri_world_topo:()=>Cesium$1.ArcGisMapServerImageryProvider.fromUrl("https://services.arcgisonline.com/ArcGIS/rest/services/World_Topo_Map/MapServer",{credit:"Copyright: Tiles © Esri — Esri, DeLorme, NAVTEQ, TomTom, Intermap, iPC, USGS, FAO, NPS, NRCAN, GeoBase, Kadaster NL, Ordnance Survey, Esri Japan, METI, Esri China (Hong Kong), and the GIS User Communit",enablePickFeatures:!1}).catch(console.error),black_marble:({cesiumIonAccessToken:t}={})=>Cesium$1.IonImageryProvider.fromAssetId(3812,{accessToken:t}).catch(console.error),japan_gsi_standard:()=>new Cesium$1.OpenStreetMapImageryProvider({url:"https://cyberjapandata.gsi.go.jp/xyz/std/"}),url:({url:t,heatmap:n,tile_zoomLevel:o}={})=>t?new Cesium$1.UrlTemplateImageryProvider({url:t,tileDiscardPolicy:n?new Cesium$1.DiscardEmptyTileImagePolicy:void 0,minimumLevel:o==null?void 0:o[0],maximumLevel:o==null?void 0:o[1]}):null};function ImageryLayers({tiles:t,cesiumIonAccessToken:n}){const{providers:o,updated:s}=useImageryProviders({tiles:t,cesiumIonAccessToken:n,presets:tiles}),[c,d]=React.useState(0);return React.useLayoutEffect(()=>{s&&d(h=>h+1)},[o,s]),jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{children:t==null?void 0:t.map(({id:h,...p})=>{var y;return{...p,id:h,provider:(y=o[h])==null?void 0:y[2]}}).map(({id:h,opacity:p,zoomLevel:y,provider:E,heatmap:L},F)=>E?jsxRuntimeExports.jsx(Ns$1,{imageryProvider:E,minimumTerrainLevel:y==null?void 0:y[0],maximumTerrainLevel:y==null?void 0:y[1],alpha:p,index:F,colorToAlpha:L?Cesium$1.Color.WHITE:void 0,colorToAlphaThreshold:L?1:void 0,magnificationFilter:L?Cesium$1.TextureMagnificationFilter.LINEAR:void 0,minificationFilter:L?Cesium$1.TextureMinificationFilter.NEAREST:void 0},`${h}_${F}_${c}`):null)})}function useImageryProviders({tiles:t=[],cesiumIonAccessToken:n,presets:o}){const s=React.useCallback((L,F)=>o[L.type||"default"]({url:L.url,cesiumIonAccessToken:F,heatmap:L.heatmap,zoomLevel:L.zoomLevelForURL}),[o]),c=React.useRef(n),d=t.map(L=>L.id).join(","),h=React.useRef(d),p=React.useRef({}),{providers:y,updated:E}=React.useMemo(()=>{const L=c.current!==n,F=Object.keys(p.current),N=t.map(nt=>nt.id).filter(nt=>nt&&!F.includes(nt)),z=[...Object.entries(p.current),...N.map(nt=>[nt,void 0])].map(([nt,lt])=>({key:nt,added:N.includes(nt),prevType:lt==null?void 0:lt[0],prevUrl:lt==null?void 0:lt[1],prevProvider:lt==null?void 0:lt[2],tile:t.find(Ee=>Ee.id===nt)})),oe=Object.fromEntries(z.map(({key:nt,added:lt,prevType:Ee,prevUrl:yt,prevProvider:Ai,tile:zi})=>zi?[nt,lt||Ee!==zi.type||yt!==zi.url||L&&(!zi.type||zi.type==="default")?[zi.type,zi.url,s(zi,n)]:[Ee,yt,Ai]]:null).filter(nt=>!!(nt!=null&&nt[1][2]))),W=!!N.length||!!L||!isEqual(h.current,d)||z.some(nt=>nt.tile&&(nt.prevType!==nt.tile.type||nt.prevUrl!==nt.tile.url));return h.current=d,c.current=n,{providers:oe,updated:W}},[n,t,d,s]);return p.current=y,{providers:y,updated:E}}const useTransition=(t,n,o)=>{const[s,c]=React.useState(t?"entered":o&&o.mountOnEnter?"unmounted":"exited"),d=React.useRef(),h=React.useRef(),p=React.useCallback(()=>{c(t?"entered":o&&o.unmountOnExit?"unmounted":"exited"),h.current=void 0},[t,!!o&&o.unmountOnExit,h]),y=React.useCallback(()=>{c("entered"),h.current=void 0},[h]),E=React.useCallback(()=>{c(t?"entered":o&&o.unmountOnExit?"unmounted":"exited"),h.current=void 0},[t,!!o&&o.unmountOnExit,h]),L=React.useCallback(()=>{c(t?"entering":"exiting"),d.current=setTimeout(E,n),h.current=Date.now()+n},[t,n,E,d,h]);return React.useEffect(()=>{if(t?s==="entered":s==="exited"||s==="unmounted"){h.current=void 0;return}const F=Date.now(),N=typeof h.current>"u"?n:n-(h.current-F);return!t&&(s==="entered"||s==="entering")?(c("exiting"),d.current=setTimeout(p,N)):t&&(s==="exited"||s==="exiting")?(c("entering"),d.current=setTimeout(y,N)):(c(t?"exited":"entered"),d.current=setTimeout(L,30)),h.current=F+N,()=>{clearTimeout(d.current)}},[t]),s},SvgCrosshair=t=>React__namespace.createElement("svg",{width:48,height:48,viewBox:"0 0 48 48",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg",...t},React__namespace.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M25 5.02586C34.6974 5.52871 42.4713 13.3026 42.9741 23H47C47.5523 23 48 23.4477 48 24C48 24.5523 47.5523 25 47 25H42.9741C42.4713 34.6974 34.6974 42.4713 25 42.9741V47C25 47.5523 24.5523 48 24 48C23.4477 48 23 47.5523 23 47V42.9741C13.3026 42.4713 5.52871 34.6974 5.02586 25H1C0.447715 25 0 24.5523 0 24C0 23.4477 0.447715 23 1 23H5.02586C5.52871 13.3026 13.3026 5.52871 23 5.02586V1C23 0.447715 23.4477 0 24 0C24.5523 0 25 0.447715 25 1V5.02586ZM41.5 24C41.5 33.665 33.665 41.5 24 41.5C14.335 41.5 6.5 33.665 6.5 24C6.5 14.335 14.335 6.5 24 6.5C33.665 6.5 41.5 14.335 41.5 24Z",fill:"white"}));function Indicator({className:t,property:n,timelineManagerRef:o}){const{viewer:s}=$e$1(),[c,d]=React.useState(!0),[h,p]=React.useState(),y=useTransition(!!h&&c,500,{mountOnEnter:!0,unmountOnExit:!0}),{type:E,image:L,imageScale:F}=(n==null?void 0:n.indicator)??{},[N,z,oe]=useIcon({image:L,imageSize:F});return React.useEffect(()=>{!E||E==="default"?s==null||s.selectionIndicator.viewModel.selectionIndicatorElement.removeAttribute("hidden"):s==null||s.selectionIndicator.viewModel.selectionIndicatorElement.setAttribute("hidden","true")},[E,s,s==null?void 0:s.selectionIndicator]),React.useEffect(()=>{if(!s)return;const W=()=>{var ha,ba,Sa;if(s.isDestroyed())return;const lt=s.selectedEntity,Ee=(ba=(ha=o==null?void 0:o.current)==null?void 0:ha.timeline)!=null&&ba.current?Cesium$1.JulianDate.fromDate((Sa=o==null?void 0:o.current)==null?void 0:Sa.timeline.current):void 0;if(!(lt!=null&<.isShowing)||Ee&&!lt.isAvailable(Ee)||!lt.position){d(!1);return}let yt;const Ai=new Cesium$1.BoundingSphere;if(s.dataSourceDisplay.getBoundingSphere(lt,!0,Ai)!==2?yt=Ai.center:lt.position&&Ee&&(yt=lt.position.getValue(Ee,yt)),yt){const ya=Cesium$1.SceneTransforms.wgs84ToWindowCoordinates(s.scene,yt);p(ya),d(!0)}else d(!1)},nt=o==null?void 0:o.current;return nt==null||nt.onTick(W),()=>{nt==null||nt.offTick(W)}},[s,o]),y!=="unmounted"&&h?E==="crosshair"?jsxRuntimeExports.jsx("div",{className:t,style:{width:48,height:48,fontSize:0,display:"inline-block",transitionProperty:"color, background",left:h.x+"px",top:h.y+"px",position:"absolute",transform:"translate(-50%, -50%)",transition:y==="entering"||y==="exiting"?"all 0.5s ease":"",opacity:y==="entering"||y==="entered"?1:0,pointerEvents:"none"},children:jsxRuntimeExports.jsx(SvgCrosshair,{})}):E==="custom"?jsxRuntimeExports.jsx("img",{src:N,width:z,height:oe,style:{left:h.x+"px",top:h.y+"px",position:"absolute",transform:"translate(-50%, -50%)",transition:y==="entering"||y==="exiting"?"all 0.5s ease":"",opacity:y==="entering"||y==="entered"?1:0,pointerEvents:"none"}}):jsxRuntimeExports.jsx("div",{style:{left:h.x+"px",top:h.y+"px",position:"absolute",transform:"translate(-50%, -50%)",transition:y==="entering"||y==="exiting"?"all 0.5s ease":"",opacity:y==="entering"||y==="entered"?1:0,pointerEvents:"none"}}):null}const annotationTypes={municipalities:[110,140],towns:[120,130,210,220,800],roads:[411],railways:[421],stations:[422],landmarks:[412,413,423,431,432,441,511,521,522,523,531,532,533,534,611,612,613,615,621,631,632,633,634,651,653,661,662,671,673,681,860,870,880,881,882,883,884,885,886,887,888,889,890,899],topography:[311,312,313,314,315,316,321,322,323,331,332,333,341,342,343,344,345,346,347,348,351,352,353,361,810,820,822,830,831,832,840,841,842,843,850]},typeMap=fromPairs(Object.entries(annotationTypes).flatMap(([t,n])=>n.map(o=>[o,t])));function getAnnotationType(t){return typeMap[t]}function useSceneEvent(t,n){const{viewer:o}=$e$1(),s=o==null?void 0:o.scene,c=React.useRef(n);c.current=n,React.useLayoutEffect(()=>s==null?void 0:s[t].addEventListener((d,h)=>{try{c.current(d,h)}catch(p){console.error(p)}}),[t,s])}function usePreRender(t){useSceneEvent("preRender",t)}const isPromise=t=>typeof t=="object"&&typeof t.then=="function",globalCache=[];function shallowEqualArrays(t,n,o=(s,c)=>s===c){if(t===n)return!0;if(!t||!n)return!1;const s=t.length;if(n.length!==s)return!1;for(let c=0;c<s;c++)if(!o(t[c],n[c]))return!1;return!0}function query(t,n=null,o=!1,s={}){n===null&&(n=[t]);for(const d of globalCache)if(shallowEqualArrays(n,d.keys,d.equal)){if(o)return;if(Object.prototype.hasOwnProperty.call(d,"error"))throw d.error;if(Object.prototype.hasOwnProperty.call(d,"response"))return s.lifespan&&s.lifespan>0&&(d.timeout&&clearTimeout(d.timeout),d.timeout=setTimeout(d.remove,s.lifespan)),d.response;if(!o)throw d.promise}const c={keys:n,equal:s.equal,remove:()=>{const d=globalCache.indexOf(c);d!==-1&&globalCache.splice(d,1)},promise:(isPromise(t)?t:t(...n)).then(d=>{c.response=d,s.lifespan&&s.lifespan>0&&(c.timeout=setTimeout(c.remove,s.lifespan))}).catch(d=>c.error=d)};if(globalCache.push(c),!o)throw c.promise}const suspend=(t,n,o)=>query(t,n,!1,o);function coordEach(t,n,o){if(t!==null)for(var s,c,d,h,p,y,E,L=0,F=0,N,z=t.type,oe=z==="FeatureCollection",W=z==="Feature",nt=oe?t.features.length:1,lt=0;lt<nt;lt++){E=oe?t.features[lt].geometry:W?t.geometry:t,N=E?E.type==="GeometryCollection":!1,p=N?E.geometries.length:1;for(var Ee=0;Ee<p;Ee++){var yt=0,Ai=0;if(h=N?E.geometries[Ee]:E,h!==null){y=h.coordinates;var zi=h.type;switch(L=o&&(zi==="Polygon"||zi==="MultiPolygon")?1:0,zi){case null:break;case"Point":if(n(y,F,lt,yt,Ai)===!1)return!1;F++,yt++;break;case"LineString":case"MultiPoint":for(s=0;s<y.length;s++){if(n(y[s],F,lt,yt,Ai)===!1)return!1;F++,zi==="MultiPoint"&&yt++}zi==="LineString"&&yt++;break;case"Polygon":case"MultiLineString":for(s=0;s<y.length;s++){for(c=0;c<y[s].length-L;c++){if(n(y[s][c],F,lt,yt,Ai)===!1)return!1;F++}zi==="MultiLineString"&&yt++,zi==="Polygon"&&Ai++}zi==="Polygon"&&yt++;break;case"MultiPolygon":for(s=0;s<y.length;s++){for(Ai=0,c=0;c<y[s].length;c++){for(d=0;d<y[s][c].length-L;d++){if(n(y[s][c][d],F,lt,yt,Ai)===!1)return!1;F++}Ai++}yt++}break;case"GeometryCollection":for(s=0;s<h.geometries.length;s++)if(coordEach(h.geometries[s],n,o)===!1)return!1;break;default:throw new Error("Unknown Geometry Type")}}}}}function featureEach(t,n){if(t.type==="Feature")n(t,0);else if(t.type==="FeatureCollection")for(var o=0;o<t.features.length&&n(t.features[o],o)!==!1;o++);}function geomEach(t,n){var o,s,c,d,h,p,y,E,L,F,N=0,z=t.type==="FeatureCollection",oe=t.type==="Feature",W=z?t.features.length:1;for(o=0;o<W;o++){for(p=z?t.features[o].geometry:oe?t.geometry:t,E=z?t.features[o].properties:oe?t.properties:{},L=z?t.features[o].bbox:oe?t.bbox:void 0,F=z?t.features[o].id:oe?t.id:void 0,y=p?p.type==="GeometryCollection":!1,h=y?p.geometries.length:1,c=0;c<h;c++){if(d=y?p.geometries[c]:p,d===null){if(n(null,N,E,L,F)===!1)return!1;continue}switch(d.type){case"Point":case"LineString":case"MultiPoint":case"Polygon":case"MultiLineString":case"MultiPolygon":{if(n(d,N,E,L,F)===!1)return!1;break}case"GeometryCollection":{for(s=0;s<d.geometries.length;s++)if(n(d.geometries[s],N,E,L,F)===!1)return!1;break}default:throw new Error("Unknown Geometry Type")}}N++}}function geomReduce(t,n,o){var s=o;return geomEach(t,function(c,d,h,p,y){d===0&&o===void 0?s=c:s=n(s,c,d,h,p,y)}),s}function flattenEach(t,n){geomEach(t,function(o,s,c,d,h){var p=o===null?null:o.type;switch(p){case null:case"Point":case"LineString":case"Polygon":return n(feature(o,c,{bbox:d,id:h}),s,0)===!1?!1:void 0}var y;switch(p){case"MultiPoint":y="Point";break;case"MultiLineString":y="LineString";break;case"MultiPolygon":y="Polygon";break}for(var E=0;E<o.coordinates.length;E++){var L=o.coordinates[E],F={type:y,coordinates:L};if(n(feature(F,c),s,E)===!1)return!1}})}var rbush$2={exports:{}},quickselect$2={exports:{}};(function(t,n){(function(o,s){t.exports=s()})(commonjsGlobal,function(){function o(h,p,y,E,L){s(h,p,y||0,E||h.length-1,L||d)}function s(h,p,y,E,L){for(;E>y;){if(E-y>600){var F=E-y+1,N=p-y+1,z=Math.log(F),oe=.5*Math.exp(2*z/3),W=.5*Math.sqrt(z*oe*(F-oe)/F)*(N-F/2<0?-1:1),nt=Math.max(y,Math.floor(p-N*oe/F+W)),lt=Math.min(E,Math.floor(p+(F-N)*oe/F+W));s(h,p,nt,lt,L)}var Ee=h[p],yt=y,Ai=E;for(c(h,y,p),L(h[E],Ee)>0&&c(h,y,E);yt<Ai;){for(c(h,yt,Ai),yt++,Ai--;L(h[yt],Ee)<0;)yt++;for(;L(h[Ai],Ee)>0;)Ai--}L(h[y],Ee)===0?c(h,y,Ai):(Ai++,c(h,Ai,E)),Ai<=p&&(y=Ai+1),p<=Ai&&(E=Ai-1)}}function c(h,p,y){var E=h[p];h[p]=h[y],h[y]=E}function d(h,p){return h<p?-1:h>p?1:0}return o})})(quickselect$2);var quickselectExports=quickselect$2.exports;rbush$2.exports=rbush,rbush$2.exports.default=rbush;var quickselect$1=quickselectExports;function rbush(t,n){if(!(this instanceof rbush))return new rbush(t,n);this._maxEntries=Math.max(4,t||9),this._minEntries=Math.max(2,Math.ceil(this._maxEntries*.4)),n&&this._initFormat(n),this.clear()}rbush.prototype={all:function(){return this._all(this.data,[])},search:function(t){var n=this.data,o=[],s=this.toBBox;if(!intersects(t,n))return o;for(var c=[],d,h,p,y;n;){for(d=0,h=n.children.length;d<h;d++)p=n.children[d],y=n.leaf?s(p):p,intersects(t,y)&&(n.leaf?o.push(p):contains(t,y)?this._all(p,o):c.push(p));n=c.pop()}return o},collides:function(t){var n=this.data,o=this.toBBox;if(!intersects(t,n))return!1;for(var s=[],c,d,h,p;n;){for(c=0,d=n.children.length;c<d;c++)if(h=n.children[c],p=n.leaf?o(h):h,intersects(t,p)){if(n.leaf||contains(t,p))return!0;s.push(h)}n=s.pop()}return!1},load:function(t){if(!(t&&t.length))return this;if(t.length<this._minEntries){for(var n=0,o=t.length;n<o;n++)this.insert(t[n]);return this}var s=this._build(t.slice(),0,t.length-1,0);if(!this.data.children.length)this.data=s;else if(this.data.height===s.height)this._splitRoot(this.data,s);else{if(this.data.height<s.height){var c=this.data;this.data=s,s=c}this._insert(s,this.data.height-s.height-1,!0)}return this},insert:function(t){return t&&this._insert(t,this.data.height-1),this},clear:function(){return this.data=createNode([]),this},remove:function(t,n){if(!t)return this;for(var o=this.data,s=this.toBBox(t),c=[],d=[],h,p,y,E;o||c.length;){if(o||(o=c.pop(),p=c[c.length-1],h=d.pop(),E=!0),o.leaf&&(y=findItem(t,o.children,n),y!==-1))return o.children.splice(y,1),c.push(o),this._condense(c),this;!E&&!o.leaf&&contains(o,s)?(c.push(o),d.push(h),h=0,p=o,o=o.children[0]):p?(h++,o=p.children[h],E=!1):o=null}return this},toBBox:function(t){return t},compareMinX:compareNodeMinX,compareMinY:compareNodeMinY,toJSON:function(){return this.data},fromJSON:function(t){return this.data=t,this},_all:function(t,n){for(var o=[];t;)t.leaf?n.push.apply(n,t.children):o.push.apply(o,t.children),t=o.pop();return n},_build:function(t,n,o,s){var c=o-n+1,d=this._maxEntries,h;if(c<=d)return h=createNode(t.slice(n,o+1)),calcBBox(h,this.toBBox),h;s||(s=Math.ceil(Math.log(c)/Math.log(d)),d=Math.ceil(c/Math.pow(d,s-1))),h=createNode([]),h.leaf=!1,h.height=s;var p=Math.ceil(c/d),y=p*Math.ceil(Math.sqrt(d)),E,L,F,N;for(multiSelect(t,n,o,y,this.compareMinX),E=n;E<=o;E+=y)for(F=Math.min(E+y-1,o),multiSelect(t,E,F,p,this.compareMinY),L=E;L<=F;L+=p)N=Math.min(L+p-1,F),h.children.push(this._build(t,L,N,s-1));return calcBBox(h,this.toBBox),h},_chooseSubtree:function(t,n,o,s){for(var c,d,h,p,y,E,L,F;s.push(n),!(n.leaf||s.length-1===o);){for(L=F=1/0,c=0,d=n.children.length;c<d;c++)h=n.children[c],y=bboxArea(h),E=enlargedArea(t,h)-y,E<F?(F=E,L=y<L?y:L,p=h):E===F&&y<L&&(L=y,p=h);n=p||n.children[0]}return n},_insert:function(t,n,o){var s=this.toBBox,c=o?t:s(t),d=[],h=this._chooseSubtree(c,this.data,n,d);for(h.children.push(t),extend$1(h,c);n>=0&&d[n].children.length>this._maxEntries;)this._split(d,n),n--;this._adjustParentBBoxes(c,d,n)},_split:function(t,n){var o=t[n],s=o.children.length,c=this._minEntries;this._chooseSplitAxis(o,c,s);var d=this._chooseSplitIndex(o,c,s),h=createNode(o.children.splice(d,o.children.length-d));h.height=o.height,h.leaf=o.leaf,calcBBox(o,this.toBBox),calcBBox(h,this.toBBox),n?t[n-1].children.push(h):this._splitRoot(o,h)},_splitRoot:function(t,n){this.data=createNode([t,n]),this.data.height=t.height+1,this.data.leaf=!1,calcBBox(this.data,this.toBBox)},_chooseSplitIndex:function(t,n,o){var s,c,d,h,p,y,E,L;for(y=E=1/0,s=n;s<=o-n;s++)c=distBBox(t,0,s,this.toBBox),d=distBBox(t,s,o,this.toBBox),h=intersectionArea(c,d),p=bboxArea(c)+bboxArea(d),h<y?(y=h,L=s,E=p<E?p:E):h===y&&p<E&&(E=p,L=s);return L},_chooseSplitAxis:function(t,n,o){var s=t.leaf?this.compareMinX:compareNodeMinX,c=t.leaf?this.compareMinY:compareNodeMinY,d=this._allDistMargin(t,n,o,s),h=this._allDistMargin(t,n,o,c);d<h&&t.children.sort(s)},_allDistMargin:function(t,n,o,s){t.children.sort(s);var c=this.toBBox,d=distBBox(t,0,n,c),h=distBBox(t,o-n,o,c),p=bboxMargin(d)+bboxMargin(h),y,E;for(y=n;y<o-n;y++)E=t.children[y],extend$1(d,t.leaf?c(E):E),p+=bboxMargin(d);for(y=o-n-1;y>=n;y--)E=t.children[y],extend$1(h,t.leaf?c(E):E),p+=bboxMargin(h);return p},_adjustParentBBoxes:function(t,n,o){for(var s=o;s>=0;s--)extend$1(n[s],t)},_condense:function(t){for(var n=t.length-1,o;n>=0;n--)t[n].children.length===0?n>0?(o=t[n-1].children,o.splice(o.indexOf(t[n]),1)):this.clear():calcBBox(t[n],this.toBBox)},_initFormat:function(t){var n=["return a"," - b",";"];this.compareMinX=new Function("a","b",n.join(t[0])),this.compareMinY=new Function("a","b",n.join(t[1])),this.toBBox=new Function("a","return {minX: a"+t[0]+", minY: a"+t[1]+", maxX: a"+t[2]+", maxY: a"+t[3]+"};")}};function findItem(t,n,o){if(!o)return n.indexOf(t);for(var s=0;s<n.length;s++)if(o(t,n[s]))return s;return-1}function calcBBox(t,n){distBBox(t,0,t.children.length,n,t)}function distBBox(t,n,o,s,c){c||(c=createNode(null)),c.minX=1/0,c.minY=1/0,c.maxX=-1/0,c.maxY=-1/0;for(var d=n,h;d<o;d++)h=t.children[d],extend$1(c,t.leaf?s(h):h);return c}function extend$1(t,n){return t.minX=Math.min(t.minX,n.minX),t.minY=Math.min(t.minY,n.minY),t.maxX=Math.max(t.maxX,n.maxX),t.maxY=Math.max(t.maxY,n.maxY),t}function compareNodeMinX(t,n){return t.minX-n.minX}function compareNodeMinY(t,n){return t.minY-n.minY}function bboxArea(t){return(t.maxX-t.minX)*(t.maxY-t.minY)}function bboxMargin(t){return t.maxX-t.minX+(t.maxY-t.minY)}function enlargedArea(t,n){return(Math.max(n.maxX,t.maxX)-Math.min(n.minX,t.minX))*(Math.max(n.maxY,t.maxY)-Math.min(n.minY,t.minY))}function intersectionArea(t,n){var o=Math.max(t.minX,n.minX),s=Math.max(t.minY,n.minY),c=Math.min(t.maxX,n.maxX),d=Math.min(t.maxY,n.maxY);return Math.max(0,c-o)*Math.max(0,d-s)}function contains(t,n){return t.minX<=n.minX&&t.minY<=n.minY&&n.maxX<=t.maxX&&n.maxY<=t.maxY}function intersects(t,n){return n.minX<=t.maxX&&n.minY<=t.maxY&&n.maxX>=t.minX&&n.maxY>=t.minY}function createNode(t){return{children:t,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function multiSelect(t,n,o,s,c){for(var d=[n,o],h;d.length;)o=d.pop(),n=d.pop(),!(o-n<=s)&&(h=n+Math.ceil((o-n)/s/2)*s,quickselect$1(t,h,n,o,c),d.push(n,h,h,o))}var rbushExports=rbush$2.exports;const rbush$1=getDefaultExportFromCjs(rbushExports);var RADIUS=6378137;function area(t){return geomReduce(t,function(n,o){return n+calculateArea(o)},0)}function calculateArea(t){var n=0,o;switch(t.type){case"Polygon":return polygonArea(t.coordinates);case"MultiPolygon":for(o=0;o<t.coordinates.length;o++)n+=polygonArea(t.coordinates[o]);return n;case"Point":case"MultiPoint":case"LineString":case"MultiLineString":return 0}return 0}function polygonArea(t){var n=0;if(t&&t.length>0){n+=Math.abs(ringArea(t[0]));for(var o=1;o<t.length;o++)n-=Math.abs(ringArea(t[o]))}return n}function ringArea(t){var n,o,s,c,d,h,p,y=0,E=t.length;if(E>2){for(p=0;p<E;p++)p===E-2?(c=E-2,d=E-1,h=0):p===E-1?(c=E-1,d=0,h=1):(c=p,d=p+1,h=p+2),n=t[c],o=t[d],s=t[h],y+=(rad(s[0])-rad(n[0]))*Math.sin(rad(o[1]));y=y*RADIUS*RADIUS/2}return y}function rad(t){return t*Math.PI/180}function booleanPointInPolygon(t,n,o){if(o===void 0&&(o={}),!t)throw new Error("point is required");if(!n)throw new Error("polygon is required");var s=getCoord$1(t),c=getGeom$1(n),d=c.type,h=n.bbox,p=c.coordinates;if(h&&inBBox(s,h)===!1)return!1;d==="Polygon"&&(p=[p]);for(var y=!1,E=0;E<p.length&&!y;E++)if(inRing(s,p[E][0],o.ignoreBoundary)){for(var L=!1,F=1;F<p[E].length&&!L;)inRing(s,p[E][F],!o.ignoreBoundary)&&(L=!0),F++;L||(y=!0)}return y}function inRing(t,n,o){var s=!1;n[0][0]===n[n.length-1][0]&&n[0][1]===n[n.length-1][1]&&(n=n.slice(0,n.length-1));for(var c=0,d=n.length-1;c<n.length;d=c++){var h=n[c][0],p=n[c][1],y=n[d][0],E=n[d][1],L=t[1]*(h-y)+p*(y-t[0])+E*(t[0]-h)===0&&(h-t[0])*(y-t[0])<=0&&(p-t[1])*(E-t[1])<=0;if(L)return!o;var F=p>t[1]!=E>t[1]&&t[0]<(y-h)*(t[1]-p)/(E-p)+h;F&&(s=!s)}return s}function inBBox(t,n){return n[0]<=t[0]&&n[1]<=t[1]&&n[2]>=t[0]&&n[3]>=t[1]}function isects(t,n,o){if(t.geometry.type!=="Polygon")throw new Error("The input feature must be a Polygon");o===void 0&&(o=1);var s=t.geometry.coordinates,c=[],d={};if(o){for(var h=[],p=0;p<s.length;p++)for(var y=0;y<s[p].length-1;y++)h.push(nt(p,y));var E=rbush$1();E.load(h)}for(var L=0;L<s.length;L++)for(var F=0;F<s[L].length-1;F++)if(o){var N=E.search(nt(L,F));N.forEach(function(lt){var Ee=lt.ring,yt=lt.edge;W(L,F,Ee,yt)})}else for(var z=0;z<s.length;z++)for(var oe=0;oe<s[z].length-1;oe++)W(L,F,z,oe);return n||(c={type:"Feature",geometry:{type:"MultiPoint",coordinates:c}}),c;function W(lt,Ee,yt,Ai){var zi=s[lt][Ee],ha=s[lt][Ee+1],ba=s[yt][Ai],Sa=s[yt][Ai+1],ya=intersect(zi,ha,ba,Sa);if(ya!==null){var ms,Wc;if(ha[0]!==zi[0]?ms=(ya[0]-zi[0])/(ha[0]-zi[0]):ms=(ya[1]-zi[1])/(ha[1]-zi[1]),Sa[0]!==ba[0]?Wc=(ya[0]-ba[0])/(Sa[0]-ba[0]):Wc=(ya[1]-ba[1])/(Sa[1]-ba[1]),!(ms>=1||ms<=0||Wc>=1||Wc<=0)){var Wa=ya,pi=!d[Wa];pi&&(d[Wa]=!0),n?c.push(n(ya,lt,Ee,zi,ha,ms,yt,Ai,ba,Sa,Wc,pi)):c.push(ya)}}}function nt(lt,Ee){var yt=s[lt][Ee],Ai=s[lt][Ee+1],zi,ha,ba,Sa;return yt[0]<Ai[0]?(zi=yt[0],ha=Ai[0]):(zi=Ai[0],ha=yt[0]),yt[1]<Ai[1]?(ba=yt[1],Sa=Ai[1]):(ba=Ai[1],Sa=yt[1]),{minX:zi,minY:ba,maxX:ha,maxY:Sa,ring:lt,edge:Ee}}}function intersect(t,n,o,s){if(equalArrays(t,o)||equalArrays(t,s)||equalArrays(n,o)||equalArrays(s,o))return null;var c=t[0],d=t[1],h=n[0],p=n[1],y=o[0],E=o[1],L=s[0],F=s[1],N=(c-h)*(E-F)-(d-p)*(y-L);if(N===0)return null;var z=((c*p-d*h)*(y-L)-(c-h)*(y*F-E*L))/N,oe=((c*p-d*h)*(E-F)-(d-p)*(y*F-E*L))/N;return[z,oe]}function equalArrays(t,n){if(!t||!n||t.length!==n.length)return!1;for(var o=0,s=t.length;o<s;o++)if(t[o]instanceof Array&&n[o]instanceof Array){if(!equalArrays(t[o],n[o]))return!1}else if(t[o]!==n[o])return!1;return!0}function simplepolygon(t){if(t.type!="Feature")throw new Error("The input must a geojson object of type Feature");if(t.geometry===void 0||t.geometry==null)throw new Error("The input must a geojson object with a non-empty geometry");if(t.geometry.type!="Polygon")throw new Error("The input must be a geojson Polygon");for(var n=t.geometry.coordinates.length,o=[],Ee=0;Ee<n;Ee++){var s=t.geometry.coordinates[Ee];equalArrays$1(s[0],s[s.length-1])||s.push(s[0]),o.push.apply(o,s.slice(0,s.length-1))}if(!isUnique(o))throw new Error("The input polygon may not have duplicate vertices (except for the first and last vertex of each ring)");var c=o.length,d=isects(t,function(nf,rf,uf,mf,Cf,vf,bf,Pf,Lf,wf,bs,af){return[nf,rf,uf,mf,Cf,vf,bf,Pf,Lf,wf,bs,af]}),h=d.length;if(h==0){for(var ba=[],Ee=0;Ee<n;Ee++)ba.push(polygon([t.geometry.coordinates[Ee]],{parent:-1,winding:windingOfRing(t.geometry.coordinates[Ee])}));var Xd=featureCollection(ba);return pu(),gl(),Xd}for(var p=[],y=[],Ee=0;Ee<n;Ee++){p.push([]);for(var E=0;E<t.geometry.coordinates[Ee].length-1;E++)p[Ee].push([new PseudoVtx(t.geometry.coordinates[Ee][modulo(E+1,t.geometry.coordinates[Ee].length-1)],1,[Ee,E],[Ee,modulo(E+1,t.geometry.coordinates[Ee].length-1)],void 0)]),y.push(new Isect(t.geometry.coordinates[Ee][E],[Ee,modulo(E-1,t.geometry.coordinates[Ee].length-1)],[Ee,E],void 0,void 0,!1,!0))}for(var Ee=0;Ee<h;Ee++)p[d[Ee][1]][d[Ee][2]].push(new PseudoVtx(d[Ee][0],d[Ee][5],[d[Ee][1],d[Ee][2]],[d[Ee][6],d[Ee][7]],void 0)),d[Ee][11]&&y.push(new Isect(d[Ee][0],[d[Ee][1],d[Ee][2]],[d[Ee][6],d[Ee][7]],void 0,void 0,!0,!0));for(var L=y.length,Ee=0;Ee<p.length;Ee++)for(var E=0;E<p[Ee].length;E++)p[Ee][E].sort(function(rf,uf){return rf.param<uf.param?-1:1});for(var F=[],Ee=0;Ee<L;Ee++)F.push({minX:y[Ee].coord[0],minY:y[Ee].coord[1],maxX:y[Ee].coord[0],maxY:y[Ee].coord[1],index:Ee});var N=rbush$1();N.load(F);for(var Ee=0;Ee<p.length;Ee++)for(var E=0;E<p[Ee].length;E++)for(var z=0;z<p[Ee][E].length;z++){var oe;z==p[Ee][E].length-1?oe=p[Ee][modulo(E+1,t.geometry.coordinates[Ee].length-1)][0].coord:oe=p[Ee][E][z+1].coord;var W=N.search({minX:oe[0],minY:oe[1],maxX:oe[0],maxY:oe[1]})[0];p[Ee][E][z].nxtIsectAlongEdgeIn=W.index}for(var Ee=0;Ee<p.length;Ee++)for(var E=0;E<p[Ee].length;E++)for(var z=0;z<p[Ee][E].length;z++){var oe=p[Ee][E][z].coord,W=N.search({minX:oe[0],minY:oe[1],maxX:oe[0],maxY:oe[1]})[0],nt=W.index;nt<c?y[nt].nxtIsectAlongRingAndEdge2=p[Ee][E][z].nxtIsectAlongEdgeIn:equalArrays$1(y[nt].ringAndEdge1,p[Ee][E][z].ringAndEdgeIn)?y[nt].nxtIsectAlongRingAndEdge1=p[Ee][E][z].nxtIsectAlongEdgeIn:y[nt].nxtIsectAlongRingAndEdge2=p[Ee][E][z].nxtIsectAlongEdgeIn}for(var lt=[],Ee=0,E=0;E<n;E++){for(var yt=Ee,z=0;z<t.geometry.coordinates[E].length-1;z++)y[Ee].coord[0]<y[yt].coord[0]&&(yt=Ee),Ee++;for(var Ai=y[yt].nxtIsectAlongRingAndEdge2,z=0;z<y.length;z++)if(y[z].nxtIsectAlongRingAndEdge1==yt||y[z].nxtIsectAlongRingAndEdge2==yt){var zi=z;break}var ha=isConvex([y[zi].coord,y[yt].coord,y[Ai].coord],!0)?1:-1;lt.push({isect:yt,parent:-1,winding:ha})}lt.sort(function(ef,nf){return y[ef.isect].coord>y[nf.isect].coord?-1:1});for(var ba=[];lt.length>0;){var Sa=lt.pop(),ya=Sa.isect,ms=Sa.parent,Wc=Sa.winding,Wa=ba.length,pi=[y[ya].coord],mt=ya;if(y[ya].ringAndEdge1Walkable)var fa=y[ya].ringAndEdge1,Ra=y[ya].nxtIsectAlongRingAndEdge1;else var fa=y[ya].ringAndEdge2,Ra=y[ya].nxtIsectAlongRingAndEdge2;for(;!equalArrays$1(y[ya].coord,y[Ra].coord);){pi.push(y[Ra].coord);for(var sl=void 0,Ee=0;Ee<lt.length;Ee++)if(lt[Ee].isect==Ra){sl=Ee;break}if(sl!=null&<.splice(sl,1),equalArrays$1(fa,y[Ra].ringAndEdge1)){if(fa=y[Ra].ringAndEdge2,y[Ra].ringAndEdge2Walkable=!1,y[Ra].ringAndEdge1Walkable){var Zd={isect:Ra};isConvex([y[mt].coord,y[Ra].coord,y[y[Ra].nxtIsectAlongRingAndEdge2].coord],Wc==1)?(Zd.parent=ms,Zd.winding=-Wc):(Zd.parent=Wa,Zd.winding=Wc),lt.push(Zd)}mt=Ra,Ra=y[Ra].nxtIsectAlongRingAndEdge2}else{if(fa=y[Ra].ringAndEdge1,y[Ra].ringAndEdge1Walkable=!1,y[Ra].ringAndEdge2Walkable){var Zd={isect:Ra};isConvex([y[mt].coord,y[Ra].coord,y[y[Ra].nxtIsectAlongRingAndEdge1].coord],Wc==1)?(Zd.parent=ms,Zd.winding=-Wc):(Zd.parent=Wa,Zd.winding=Wc),lt.push(Zd)}mt=Ra,Ra=y[Ra].nxtIsectAlongRingAndEdge1}}pi.push(y[Ra].coord),ba.push(polygon([pi],{index:Wa,parent:ms,winding:Wc,netWinding:void 0}))}var Xd=featureCollection(ba);pu(),gl();function pu(){for(var ef=[],nf=0;nf<Xd.features.length;nf++)Xd.features[nf].properties.parent==-1&&ef.push(nf);if(ef.length>1)for(var nf=0;nf<ef.length;nf++){for(var rf=-1,uf=1/0,mf=0;mf<Xd.features.length;mf++)ef[nf]!=mf&&booleanPointInPolygon(Xd.features[ef[nf]].geometry.coordinates[0][0],Xd.features[mf],{ignoreBoundary:!0})&&area(Xd.features[mf])<uf&&(rf=mf);Xd.features[ef[nf]].properties.parent=rf}}function gl(){for(var ef=0;ef<Xd.features.length;ef++)if(Xd.features[ef].properties.parent==-1){var nf=Xd.features[ef].properties.winding;Xd.features[ef].properties.netWinding=nf,md(ef,nf)}}function md(ef,nf){for(var rf=0;rf<Xd.features.length;rf++)if(Xd.features[rf].properties.parent==ef){var uf=nf+Xd.features[rf].properties.winding;Xd.features[rf].properties.netWinding=uf,md(rf,uf)}}return Xd}var PseudoVtx=function(t,n,o,s,c){this.coord=t,this.param=n,this.ringAndEdgeIn=o,this.ringAndEdgeOut=s,this.nxtIsectAlongEdgeIn=c},Isect=function(t,n,o,s,c,d,h){this.coord=t,this.ringAndEdge1=n,this.ringAndEdge2=o,this.nxtIsectAlongRingAndEdge1=s,this.nxtIsectAlongRingAndEdge2=c,this.ringAndEdge1Walkable=d,this.ringAndEdge2Walkable=h};function isConvex(t,n){if(typeof n>"u"&&(n=!0),t.length!=3)throw new Error("This function requires an array of three points [x,y]");var o=(t[1][0]-t[0][0])*(t[2][1]-t[0][1])-(t[1][1]-t[0][1])*(t[2][0]-t[0][0]);return o>=0==n}function windingOfRing(t){for(var n=0,o=0;o<t.length-1;o++)t[o][0]<t[n][0]&&(n=o);if(isConvex([t[modulo(n-1,t.length-1)],t[n],t[modulo(n+1,t.length-1)]],!0))var s=1;else var s=-1;return s}function equalArrays$1(t,n){if(!t||!n||t.length!=n.length)return!1;for(var o=0,s=t.length;o<s;o++)if(t[o]instanceof Array&&n[o]instanceof Array){if(!equalArrays$1(t[o],n[o]))return!1}else if(t[o]!=n[o])return!1;return!0}function modulo(t,n){return(t%n+n)%n}function isUnique(t){for(var n={},o=1,s=0,c=t.length;s<c;++s){if(Object.prototype.hasOwnProperty.call(n,t[s])){o=0;break}n[t[s]]=1}return o}function unkinkPolygon(t){var n=[];return flattenEach(t,function(o){o.geometry.type==="Polygon"&&featureEach(simplepolygon(o),function(s){n.push(polygon(s.geometry.coordinates,o.properties))})}),featureCollection(n)}function isNotNullish(t){return t!=null}function coordinatesToPositionsArray(t){return t.map(n=>n.map(([o,s])=>Cartesian3.fromDegrees(o,s,0)))}function convertGeometryToPositionsArray(t){return(t.type==="LineString"?coordinatesToPositionsArray([t.coordinates]):t.type==="Polygon"?coordinatesToPositionsArray(t.coordinates):t.coordinates.flatMap(n=>coordinatesToPositionsArray(n))).filter(({length:n})=>n>0)}function coordinatesToHierarchy(t){return t.length>0?{positions:t[0].map(([n,o])=>Cartesian3.fromDegrees(n,o,0)),holes:t.slice(1).map(n=>({positions:n.map(([o,s])=>Cartesian3.fromDegrees(o,s,0)),holes:[]}))}:void 0}function convertPolygonToHierarchyArray(t){return unkinkPolygon(t).features.map(o=>coordinatesToHierarchy(o.geometry.coordinates)).filter(isNotNullish)}const fontScale=5,scaleByDistance=new NearFarScalar(0,1/fontScale,Number.POSITIVE_INFINITY,1/fontScale),defaultStyle={default:{fontFamily:"sans-serif",fillColor:Color$1.BLACK,outlineColor:Color$1.WHITE.withAlpha(.8),outlineWidth:5},municipalities:{fontSize:12},towns:{fontSize:8,fillColor:Color$1.BLACK.withAlpha(.6)},roads:{fontSize:8},railways:{fontSize:8},stations:{fontSize:9},landmarks:{fontSize:8},topography:{fontSize:8,fillColor:Color$1.BLACK.withAlpha(.6)}};function resolveStyle(t,n){const o=getAnnotationType(t);if(o==null)return;const s=n==null?void 0:n[o];if(s===!1)return;const c=merge({},defaultStyle.default,defaultStyle[o],n==null?void 0:n.default,s),d=Object.fromEntries(Object.entries(c).map(([h,p])=>[h,typeof p=="string"&&isColor(p)?toColor$1(p):p]));return{scaleByDistance,...omit(d,["fontSize","fontFamily"]),font:(d==null?void 0:d.fontSize)!=null&&d.fontFamily!=null?`${d.fontSize*fontScale}pt ${d.fontFamily}`:void 0}}const positionScratch$1=new Cartesian3,cartographicScratch$1=new Cartographic;function getPosition(t,n,o,s,c,d,h,p=new Cartesian3){let y=n.geom[0][0].x/c,E=n.geom[0][0].y/c;if(t.level===17&&(y=y*2-t.x%2,E=E*2-t.y%2),y<0||y>1||E<0||E>1)return;const L=Cartographic.fromRadians(o.west+o.width*y,o.south+o.height*(1-E),d,cartographicScratch$1);if((s==null?void 0:s.some(F=>Rectangle.contains(F,L)))!==!0)return Cartographic.toCartesian(L,h,p)}const JapanGSIOptimalBVmapLabelImagery=React.memo(({imageryProvider:t,imagery:n,descendants:o,height:s=50,style:c=defaultStyle,labelCollection:d})=>{const h=$e$1(),p=suspend(async()=>await t.tileCache.get(getTileCoords(n,16)),[JapanGSIOptimalBVmapLabelImagery,n.key]),y=React.useMemo(()=>t.tilingScheme.tileXYToRectangle(n.x,n.y,n.level),[t,n]),E=React.useMemo(()=>o==null?void 0:o.map(W=>t.tilingScheme.tileXYToRectangle(W.x,W.y,W.level)),[t,o]),L=React.useMemo(()=>{const W=p.get("Anno");return W==null?[]:W.filter(nt=>typeof nt.props.vt_code=="number"&&`${nt.props.vt_code}`.length===3&&typeof nt.props.vt_text=="string"&&(nt.props.vt_arrng==null||typeof nt.props.vt_arrng=="number")&&(nt.props.vt_arrngagl==null||typeof nt.props.vt_arrngagl=="number")&&(n.level<16||n.level===16&&nt.props.vt_flag17!==2||n.level===17&&nt.props.vr_flag17!==0))},[p,n]),F=React.useRef(),N=h==null?void 0:h.scene,z=React.useCallback(()=>{const W=F.current;W!=null&&(W.forEach(([nt,lt])=>{var yt;const Ee=getPosition(n,nt,y,E,t.tileCache.tileSize,s,(yt=N==null?void 0:N.globe)==null?void 0:yt.ellipsoid,positionScratch$1);Ee!=null?(lt.position=Ee,lt.show=!0):lt.show=!1}),N==null||N.requestRender())},[t,n,s,y,E,N]),oe=React.useRef(z);return oe.current=z,React.useEffect(()=>{if(!N||!d)return;const W=[],nt=L.map(Ee=>{const yt=resolveStyle(Ee.props.vt_code,c);if(yt==null)return;const Ai=Ee.props.vt_text;if(W.includes(Ai))return;W.push(Ai);const zi={text:Ai,style:LabelStyle$1.FILL_AND_OUTLINE,horizontalOrigin:HorizontalOrigin$1.CENTER,verticalOrigin:VerticalOrigin$1.BOTTOM,heightReference:HeightReference$1.CLAMP_TO_GROUND,disableDepthTestDistance:1/0,...yt};return[Ee,d.add(zi)]}).filter(isNotNullish);F.current=nt,oe.current();const lt=()=>{d.isDestroyed()||nt.forEach(([,Ee])=>{d.remove(Ee)}),N.isDestroyed()||N==null||N.postRender.removeEventListener(lt)};return()=>{F.current=void 0,N.isDestroyed()||N==null||N.postRender.addEventListener(lt)}},[c,L,N,d]),React.useEffect(()=>{z()},[z]),null});JapanGSIOptimalBVmapLabelImagery.displayName="JapanGSIOptimalBVmapLabelImagery";const hasMethod=t=>n=>n!=null&&typeof n=="object"&&t in n&&typeof n[t]=="function";function createDestructor(t,n){if(t.owner!=null){invariant$1(t.transferOwnership!=null);const o=t.owner,s=t.transferOwnership(n,t.owner);return()=>{(!hasMethod("isDestroyed")(o)||!o.isDestroyed())&&s()}}else{const o=t.destroy;return()=>{typeof o=="function"?o(n):o!==null&&hasMethod("destroy")(n)&&n.destroy()}}}function useInstance(t){const[n,o]=React.useState(),s=React.useRef();return s.current==null&&(s.current=t.create()),React.useEffect(()=>{s.current==null&&(s.current=t.create(),o(s.current));const c=s.current,d=createDestructor(t,c);return()=>{d(),s.current=void 0,o(void 0)}},[t.owner,...t.keys]),n??s.current}const LabelImageryLayer=React.forwardRef(function({url:n,tilingScheme:o,tileWidth:s,tileHeight:c,minimumLevel:d,maximumLevel:h,minimumDataLevel:p,maximumDataLevel:y,...E},L){const F=useInstance({keys:[n,o,s,c,p,y],create:()=>new JapanGSIOptimalBVmapLabelImageryProvider({url:n,tilingScheme:o??new Cesium$1.WebMercatorTilingScheme,tileWidth:s,tileHeight:c,minimumDataLevel:p,maximumDataLevel:y})});return Object.assign(F,{minimumLevel:d,maximumLevel:h}),jsxRuntimeExports.jsx(Ns$1,{ref:L,imageryProvider:F,...E})});function getAncestorKeys(t,n){if(t.level===n)return[];const o=2**t.level,s=t.x/o,c=t.y/o;return[...Array(t.level-n)].map((d,h)=>{const p=t.level-(h+1),y=2**p;return makeKey({x:Math.floor(s*y),y:Math.floor(c*y),level:p})})}function isEqualKeys(t,n){return n!=null&&t.length===n.length&&xorBy(t,n,"key").length===0}function getImageriesToRender(t,n){const o=t.globe;let s=1/0,c=-1/0;const d=uniqBy(o._surface._tilesToRender.flatMap(p=>{var y;return((y=p.data)==null?void 0:y.imagery.map(E=>E.readyImagery).filter(E=>(E==null?void 0:E.imageryLayer.imageryProvider)!==n?!1:(E.key=makeKey(E),E.level<s&&(s=E.level),E.level>c&&(c=E.level),!0)))??[]}),"key").sort((p,y)=>p.key.localeCompare(y.key));if(s===c||s===1/0||c===-1/0)return d;const h=fromPairs(d.map(p=>[p.key,{imagery:p,children:[],descendants:[]}]));return d.forEach(p=>{getAncestorKeys(p,s).forEach(E=>{const L=h[E];L!=null&&(L.descendants.push(p),p.level-L.imagery.level===1&&L.children.push(p))})}),Object.values(h).forEach(({imagery:p,children:y,descendants:E})=>{isEqualKeys(y,p.children)||(p.children=y),isEqualKeys(E,p.descendants)||(p.descendants=E)}),d.filter(p=>p.children!=null&&p.children.length<4)}const LabelImageryCollection=({imageryProvider:t,imageriesAtom:n,style:o,labelCollection:s})=>{const c=useAtomValue(n);return jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{children:c.map(d=>jsxRuntimeExports.jsx(React.Suspense,{children:jsxRuntimeExports.jsx(JapanGSIOptimalBVmapLabelImagery,{imageryProvider:t,imagery:d,descendants:d.descendants,style:o,labelCollection:s})},d.key))})},JapanGSIOptimalBVmapVectorMapLabel=({style:t})=>{const[n,o]=React.useState(),s=React.useCallback(F=>{var N;o(((N=F==null?void 0:F.cesiumElement)==null?void 0:N.imageryProvider)instanceof JapanGSIOptimalBVmapLabelImageryProvider?F.cesiumElement.imageryProvider:void 0)},[]),c=React.useMemo(()=>{const F=atom([]);return atom(N=>N(F),(N,z,oe)=>{const W=N(F),nt=typeof oe=="function"?oe(W):oe;W.length!==nt.length&&xorBy(W,nt,"key").length>0&&z(F,nt)})},[]),d=useSetAtom(c);usePreRender(F=>{if(n==null)return;const N=getImageriesToRender(F,n);d(N)});const{labelCollection:h,scene:p}=$e$1(),y=React.useRef(!1),E=React.useMemo(()=>h??(p?new Cesium$1.LabelCollection({scene:p}):void 0),[p,h]);React.useEffect(()=>{!h&&p&&!y.current&&(p.primitives.add(E),y.current=!0)},[h,E,p]);const L=React.useRef(0);return usePreRender(F=>{E&&L.current!==E._labelsToUpdate.length&&(F.requestRender(),L.current=E._labelsToUpdate.length)}),React.useEffect(()=>()=>{p!=null&&p.isDestroyed()||p==null||p.requestRender()},[p]),jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx(LabelImageryLayer,{ref:s,url:"https://cyberjapandata.gsi.go.jp/xyz/optimal_bvmap-v1/{z}/{x}/{y}.pbf",tileWidth:1024,tileHeight:1024,maximumLevel:17,minimumDataLevel:4,maximumDataLevel:16}),n!=null&&jsxRuntimeExports.jsx(LabelImageryCollection,{imageryProvider:n,imageriesAtom:c,style:t,labelCollection:E})]})},LabelImageryLayers=React.memo(({tileLabels:t=[]})=>jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{children:t.map(n=>{if(!n)return null;switch(n.labelType){case"japan_gsi_optimal_bvmap":return jsxRuntimeExports.jsx(JapanGSIOptimalBVmapVectorMapLabel,{style:n.style},n.id);default:return null}})}),(t,n)=>isEqual(t.tileLabels,n.tileLabels));LabelImageryLayers.displayName="LabelImageryLayers";function Event({onMount:t,onUnmount:n}){return React.useEffect(()=>(t==null||t(),()=>n==null?void 0:n()),[t,n]),null}const perf=typeof performance=="object"&&performance&&typeof performance.now=="function"?performance:Date,warned$1=new Set,emitWarning$1=(t,n,o,s)=>{typeof process=="object"&&process&&typeof process.emitWarning=="function"?process.emitWarning(t,n,o,s):console.error(`[${o}] ${n}: ${t}`)},shouldWarn=t=>!warned$1.has(t),isPosInt=t=>t&&t===Math.floor(t)&&t>0&&isFinite(t),getUintArray=t=>isPosInt(t)?t<=Math.pow(2,8)?Uint8Array:t<=Math.pow(2,16)?Uint16Array:t<=Math.pow(2,32)?Uint32Array:t<=Number.MAX_SAFE_INTEGER?ZeroArray:null:null;class ZeroArray extends Array{constructor(n){super(n),this.fill(0)}}const Qf=class Qf{constructor(n,o){Vf(this,"heap");Vf(this,"length");if(!sf(Qf,Jf))throw new TypeError("instantiate Stack using Stack.create(n)");this.heap=new o(n),this.length=0}static create(n){const o=getUintArray(n);if(!o)return[];Xf(Qf,Jf,!0);const s=new Qf(n,o);return Xf(Qf,Jf,!1),s}push(n){this.heap[this.length++]=n}pop(){return this.heap[--this.length]}};Jf=new WeakMap,Yf(Qf,Jf,!1);let Stack=Qf;const qp=class qp{constructor(n){Yf(this,Wp);Yf(this,Yp);Yf(this,wp);Yf(this,Mp);Yf(this,Bp);Yf(this,zp);Yf(this,Up);Yf(this,zm);Yf(this,$p);Yf(this,Dp);Yf(this,Om,void 0);Yf(this,lp,void 0);Yf(this,_p,void 0);Yf(this,xp,void 0);Yf(this,Np,void 0);Vf(this,"ttl");Vf(this,"ttlResolution");Vf(this,"ttlAutopurge");Vf(this,"updateAgeOnGet");Vf(this,"updateAgeOnHas");Vf(this,"allowStale");Vf(this,"noDisposeOnSet");Vf(this,"noUpdateTTL");Vf(this,"maxEntrySize");Vf(this,"sizeCalculation");Vf(this,"noDeleteOnFetchRejection");Vf(this,"noDeleteOnStaleGet");Vf(this,"allowStaleOnFetchAbort");Vf(this,"allowStaleOnFetchRejection");Vf(this,"ignoreFetchAbort");Yf(this,ap,void 0);Yf(this,Sp,void 0);Yf(this,sp,void 0);Yf(this,Bm,void 0);Yf(this,jf,void 0);Yf(this,fp,void 0);Yf(this,bp,void 0);Yf(this,hp,void 0);Yf(this,up,void 0);Yf(this,Ep,void 0);Yf(this,dp,void 0);Yf(this,Pp,void 0);Yf(this,Ip,void 0);Yf(this,Tp,void 0);Yf(this,Rp,void 0);Yf(this,Op,void 0);Yf(this,gp,void 0);Yf(this,Ap,()=>{});Yf(this,Vp,()=>{});Yf(this,Xp,()=>{});Yf(this,Cp,()=>!1);Yf(this,Gp,n=>{});Yf(this,kp,(n,o,s)=>{});Yf(this,Zp,(n,o,s,c)=>{if(s||c)throw new TypeError("cannot set size without setting maxSize or maxEntrySize on cache");return 0});const{max:o=0,ttl:s,ttlResolution:c=1,ttlAutopurge:d,updateAgeOnGet:h,updateAgeOnHas:p,allowStale:y,dispose:E,disposeAfter:L,noDisposeOnSet:F,noUpdateTTL:N,maxSize:z=0,maxEntrySize:oe=0,sizeCalculation:W,fetchMethod:nt,noDeleteOnFetchRejection:lt,noDeleteOnStaleGet:Ee,allowStaleOnFetchRejection:yt,allowStaleOnFetchAbort:Ai,ignoreFetchAbort:zi}=n;if(o!==0&&!isPosInt(o))throw new TypeError("max option must be a nonnegative integer");const ha=o?getUintArray(o):Array;if(!ha)throw new Error("invalid max value: "+o);if(Xf(this,Om,o),Xf(this,lp,z),this.maxEntrySize=oe||sf(this,lp),this.sizeCalculation=W,this.sizeCalculation){if(!sf(this,lp)&&!this.maxEntrySize)throw new TypeError("cannot set sizeCalculation without setting maxSize or maxEntrySize");if(typeof this.sizeCalculation!="function")throw new TypeError("sizeCalculation set to non-function")}if(nt!==void 0&&typeof nt!="function")throw new TypeError("fetchMethod must be a function if specified");if(Xf(this,Np,nt),Xf(this,Op,!!nt),Xf(this,sp,new Map),Xf(this,Bm,new Array(o).fill(void 0)),Xf(this,jf,new Array(o).fill(void 0)),Xf(this,fp,new ha(o)),Xf(this,bp,new ha(o)),Xf(this,hp,0),Xf(this,up,0),Xf(this,Ep,Stack.create(o)),Xf(this,ap,0),Xf(this,Sp,0),typeof E=="function"&&Xf(this,_p,E),typeof L=="function"?(Xf(this,xp,L),Xf(this,dp,[])):(Xf(this,xp,void 0),Xf(this,dp,void 0)),Xf(this,Rp,!!sf(this,_p)),Xf(this,gp,!!sf(this,xp)),this.noDisposeOnSet=!!F,this.noUpdateTTL=!!N,this.noDeleteOnFetchRejection=!!lt,this.allowStaleOnFetchRejection=!!yt,this.allowStaleOnFetchAbort=!!Ai,this.ignoreFetchAbort=!!zi,this.maxEntrySize!==0){if(sf(this,lp)!==0&&!isPosInt(sf(this,lp)))throw new TypeError("maxSize must be a positive integer if specified");if(!isPosInt(this.maxEntrySize))throw new TypeError("maxEntrySize must be a positive integer if specified");kf(this,Yp,og).call(this)}if(this.allowStale=!!y,this.noDeleteOnStaleGet=!!Ee,this.updateAgeOnGet=!!h,this.updateAgeOnHas=!!p,this.ttlResolution=isPosInt(c)||c===0?c:1,this.ttlAutopurge=!!d,this.ttl=s||0,this.ttl){if(!isPosInt(this.ttl))throw new TypeError("ttl must be a positive integer if specified");kf(this,Wp,tg).call(this)}if(sf(this,Om)===0&&this.ttl===0&&sf(this,lp)===0)throw new TypeError("At least one of max, maxSize, or ttl is required");if(!this.ttlAutopurge&&!sf(this,Om)&&!sf(this,lp)){const ba="LRU_CACHE_UNBOUNDED";shouldWarn(ba)&&(warned$1.add(ba),emitWarning$1("TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption.","UnboundedCacheWarning",ba,qp))}}static unsafeExposeInternals(n){return{starts:sf(n,Ip),ttls:sf(n,Tp),sizes:sf(n,Pp),keyMap:sf(n,sp),keyList:sf(n,Bm),valList:sf(n,jf),next:sf(n,fp),prev:sf(n,bp),get head(){return sf(n,hp)},get tail(){return sf(n,up)},free:sf(n,Ep),isBackgroundFetch:o=>{var s;return kf(s=n,zm,qm).call(s,o)},backgroundFetch:(o,s,c,d)=>{var h;return kf(h=n,Up,Qp).call(h,o,s,c,d)},moveToTail:o=>{var s;return kf(s=n,Dp,jp).call(s,o)},indexes:o=>{var s;return kf(s=n,wp,Lp).call(s,o)},rindexes:o=>{var s;return kf(s=n,Mp,Fp).call(s,o)},isStale:o=>{var s;return sf(s=n,Cp).call(s,o)}}}get max(){return sf(this,Om)}get maxSize(){return sf(this,lp)}get calculatedSize(){return sf(this,Sp)}get size(){return sf(this,ap)}get fetchMethod(){return sf(this,Np)}get dispose(){return sf(this,_p)}get disposeAfter(){return sf(this,xp)}getRemainingTTL(n){return sf(this,sp).has(n)?1/0:0}*entries(){for(const n of kf(this,wp,Lp).call(this))sf(this,jf)[n]!==void 0&&sf(this,Bm)[n]!==void 0&&!kf(this,zm,qm).call(this,sf(this,jf)[n])&&(yield[sf(this,Bm)[n],sf(this,jf)[n]])}*rentries(){for(const n of kf(this,Mp,Fp).call(this))sf(this,jf)[n]!==void 0&&sf(this,Bm)[n]!==void 0&&!kf(this,zm,qm).call(this,sf(this,jf)[n])&&(yield[sf(this,Bm)[n],sf(this,jf)[n]])}*keys(){for(const n of kf(this,wp,Lp).call(this)){const o=sf(this,Bm)[n];o!==void 0&&!kf(this,zm,qm).call(this,sf(this,jf)[n])&&(yield o)}}*rkeys(){for(const n of kf(this,Mp,Fp).call(this)){const o=sf(this,Bm)[n];o!==void 0&&!kf(this,zm,qm).call(this,sf(this,jf)[n])&&(yield o)}}*values(){for(const n of kf(this,wp,Lp).call(this))sf(this,jf)[n]!==void 0&&!kf(this,zm,qm).call(this,sf(this,jf)[n])&&(yield sf(this,jf)[n])}*rvalues(){for(const n of kf(this,Mp,Fp).call(this))sf(this,jf)[n]!==void 0&&!kf(this,zm,qm).call(this,sf(this,jf)[n])&&(yield sf(this,jf)[n])}[Symbol.iterator](){return this.entries()}find(n,o={}){for(const s of kf(this,wp,Lp).call(this)){const c=sf(this,jf)[s],d=kf(this,zm,qm).call(this,c)?c.__staleWhileFetching:c;if(d!==void 0&&n(d,sf(this,Bm)[s],this))return this.get(sf(this,Bm)[s],o)}}forEach(n,o=this){for(const s of kf(this,wp,Lp).call(this)){const c=sf(this,jf)[s],d=kf(this,zm,qm).call(this,c)?c.__staleWhileFetching:c;d!==void 0&&n.call(o,d,sf(this,Bm)[s],this)}}rforEach(n,o=this){for(const s of kf(this,Mp,Fp).call(this)){const c=sf(this,jf)[s],d=kf(this,zm,qm).call(this,c)?c.__staleWhileFetching:c;d!==void 0&&n.call(o,d,sf(this,Bm)[s],this)}}purgeStale(){let n=!1;for(const o of kf(this,Mp,Fp).call(this,{allowStale:!0}))sf(this,Cp).call(this,o)&&(this.delete(sf(this,Bm)[o]),n=!0);return n}dump(){const n=[];for(const o of kf(this,wp,Lp).call(this,{allowStale:!0})){const s=sf(this,Bm)[o],c=sf(this,jf)[o],d=kf(this,zm,qm).call(this,c)?c.__staleWhileFetching:c;if(d===void 0||s===void 0)continue;const h={value:d};if(sf(this,Tp)&&sf(this,Ip)){h.ttl=sf(this,Tp)[o];const p=perf.now()-sf(this,Ip)[o];h.start=Math.floor(Date.now()-p)}sf(this,Pp)&&(h.size=sf(this,Pp)[o]),n.unshift([s,h])}return n}load(n){this.clear();for(const[o,s]of n){if(s.start){const c=Date.now()-s.start;s.start=perf.now()-c}this.set(o,s.value,s)}}set(n,o,s={}){var N,z,oe;const{ttl:c=this.ttl,start:d,noDisposeOnSet:h=this.noDisposeOnSet,sizeCalculation:p=this.sizeCalculation,status:y}=s;let{noUpdateTTL:E=this.noUpdateTTL}=s;const L=sf(this,Zp).call(this,n,o,s.size||0,p);if(this.maxEntrySize&&L>this.maxEntrySize)return y&&(y.set="miss",y.maxEntrySizeExceeded=!0),this.delete(n),this;let F=sf(this,ap)===0?void 0:sf(this,sp).get(n);if(F===void 0)F=sf(this,ap)===0?sf(this,up):sf(this,Ep).length!==0?sf(this,Ep).pop():sf(this,ap)===sf(this,Om)?kf(this,zp,Jp).call(this,!1):sf(this,ap),sf(this,Bm)[F]=n,sf(this,jf)[F]=o,sf(this,sp).set(n,F),sf(this,fp)[sf(this,up)]=F,sf(this,bp)[F]=sf(this,up),Xf(this,up,F),Kp(this,ap)._++,sf(this,kp).call(this,F,L,y),y&&(y.set="add"),E=!1;else{kf(this,Dp,jp).call(this,F);const W=sf(this,jf)[F];if(o!==W){if(sf(this,Op)&&kf(this,zm,qm).call(this,W)?W.__abortController.abort(new Error("replaced")):h||(sf(this,Rp)&&((N=sf(this,_p))==null||N.call(this,W,n,"set")),sf(this,gp)&&((z=sf(this,dp))==null||z.push([W,n,"set"]))),sf(this,Gp).call(this,F),sf(this,kp).call(this,F,L,y),sf(this,jf)[F]=o,y){y.set="replace";const nt=W&&kf(this,zm,qm).call(this,W)?W.__staleWhileFetching:W;nt!==void 0&&(y.oldValue=nt)}}else y&&(y.set="update")}if(c!==0&&!sf(this,Tp)&&kf(this,Wp,tg).call(this),sf(this,Tp)&&(E||sf(this,Xp).call(this,F,c,d),y&&sf(this,Vp).call(this,y,F)),!h&&sf(this,gp)&&sf(this,dp)){const W=sf(this,dp);let nt;for(;nt=W==null?void 0:W.shift();)(oe=sf(this,xp))==null||oe.call(this,...nt)}return this}pop(){var n;try{for(;sf(this,ap);){const o=sf(this,jf)[sf(this,hp)];if(kf(this,zp,Jp).call(this,!0),kf(this,zm,qm).call(this,o)){if(o.__staleWhileFetching)return o.__staleWhileFetching}else if(o!==void 0)return o}}finally{if(sf(this,gp)&&sf(this,dp)){const o=sf(this,dp);let s;for(;s=o==null?void 0:o.shift();)(n=sf(this,xp))==null||n.call(this,...s)}}}has(n,o={}){const{updateAgeOnHas:s=this.updateAgeOnHas,status:c}=o,d=sf(this,sp).get(n);if(d!==void 0){const h=sf(this,jf)[d];if(kf(this,zm,qm).call(this,h)&&h.__staleWhileFetching===void 0)return!1;if(sf(this,Cp).call(this,d))c&&(c.has="stale",sf(this,Vp).call(this,c,d));else return s&&sf(this,Ap).call(this,d),c&&(c.has="hit",sf(this,Vp).call(this,c,d)),!0}else c&&(c.has="miss");return!1}peek(n,o={}){const{allowStale:s=this.allowStale}=o,c=sf(this,sp).get(n);if(c!==void 0&&(s||!sf(this,Cp).call(this,c))){const d=sf(this,jf)[c];return kf(this,zm,qm).call(this,d)?d.__staleWhileFetching:d}}async fetch(n,o={}){const{allowStale:s=this.allowStale,updateAgeOnGet:c=this.updateAgeOnGet,noDeleteOnStaleGet:d=this.noDeleteOnStaleGet,ttl:h=this.ttl,noDisposeOnSet:p=this.noDisposeOnSet,size:y=0,sizeCalculation:E=this.sizeCalculation,noUpdateTTL:L=this.noUpdateTTL,noDeleteOnFetchRejection:F=this.noDeleteOnFetchRejection,allowStaleOnFetchRejection:N=this.allowStaleOnFetchRejection,ignoreFetchAbort:z=this.ignoreFetchAbort,allowStaleOnFetchAbort:oe=this.allowStaleOnFetchAbort,context:W,forceRefresh:nt=!1,status:lt,signal:Ee}=o;if(!sf(this,Op))return lt&&(lt.fetch="get"),this.get(n,{allowStale:s,updateAgeOnGet:c,noDeleteOnStaleGet:d,status:lt});const yt={allowStale:s,updateAgeOnGet:c,noDeleteOnStaleGet:d,ttl:h,noDisposeOnSet:p,size:y,sizeCalculation:E,noUpdateTTL:L,noDeleteOnFetchRejection:F,allowStaleOnFetchRejection:N,allowStaleOnFetchAbort:oe,ignoreFetchAbort:z,status:lt,signal:Ee};let Ai=sf(this,sp).get(n);if(Ai===void 0){lt&&(lt.fetch="miss");const zi=kf(this,Up,Qp).call(this,n,Ai,yt,W);return zi.__returned=zi}else{const zi=sf(this,jf)[Ai];if(kf(this,zm,qm).call(this,zi)){const ms=s&&zi.__staleWhileFetching!==void 0;return lt&&(lt.fetch="inflight",ms&&(lt.returnedStale=!0)),ms?zi.__staleWhileFetching:zi.__returned=zi}const ha=sf(this,Cp).call(this,Ai);if(!nt&&!ha)return lt&&(lt.fetch="hit"),kf(this,Dp,jp).call(this,Ai),c&&sf(this,Ap).call(this,Ai),lt&&sf(this,Vp).call(this,lt,Ai),zi;const ba=kf(this,Up,Qp).call(this,n,Ai,yt,W),ya=ba.__staleWhileFetching!==void 0&&s;return lt&&(lt.fetch=ha?"stale":"refresh",ya&&ha&&(lt.returnedStale=!0)),ya?ba.__staleWhileFetching:ba.__returned=ba}}get(n,o={}){const{allowStale:s=this.allowStale,updateAgeOnGet:c=this.updateAgeOnGet,noDeleteOnStaleGet:d=this.noDeleteOnStaleGet,status:h}=o,p=sf(this,sp).get(n);if(p!==void 0){const y=sf(this,jf)[p],E=kf(this,zm,qm).call(this,y);return h&&sf(this,Vp).call(this,h,p),sf(this,Cp).call(this,p)?(h&&(h.get="stale"),E?(h&&s&&y.__staleWhileFetching!==void 0&&(h.returnedStale=!0),s?y.__staleWhileFetching:void 0):(d||this.delete(n),h&&s&&(h.returnedStale=!0),s?y:void 0)):(h&&(h.get="hit"),E?y.__staleWhileFetching:(kf(this,Dp,jp).call(this,p),c&&sf(this,Ap).call(this,p),y))}else h&&(h.get="miss")}delete(n){var s,c,d,h;let o=!1;if(sf(this,ap)!==0){const p=sf(this,sp).get(n);if(p!==void 0)if(o=!0,sf(this,ap)===1)this.clear();else{sf(this,Gp).call(this,p);const y=sf(this,jf)[p];kf(this,zm,qm).call(this,y)?y.__abortController.abort(new Error("deleted")):(sf(this,Rp)||sf(this,gp))&&(sf(this,Rp)&&((s=sf(this,_p))==null||s.call(this,y,n,"delete")),sf(this,gp)&&((c=sf(this,dp))==null||c.push([y,n,"delete"]))),sf(this,sp).delete(n),sf(this,Bm)[p]=void 0,sf(this,jf)[p]=void 0,p===sf(this,up)?Xf(this,up,sf(this,bp)[p]):p===sf(this,hp)?Xf(this,hp,sf(this,fp)[p]):(sf(this,fp)[sf(this,bp)[p]]=sf(this,fp)[p],sf(this,bp)[sf(this,fp)[p]]=sf(this,bp)[p]),Kp(this,ap)._--,sf(this,Ep).push(p)}}if(sf(this,gp)&&((d=sf(this,dp))!=null&&d.length)){const p=sf(this,dp);let y;for(;y=p==null?void 0:p.shift();)(h=sf(this,xp))==null||h.call(this,...y)}return o}clear(){var n,o,s;for(const c of kf(this,Mp,Fp).call(this,{allowStale:!0})){const d=sf(this,jf)[c];if(kf(this,zm,qm).call(this,d))d.__abortController.abort(new Error("deleted"));else{const h=sf(this,Bm)[c];sf(this,Rp)&&((n=sf(this,_p))==null||n.call(this,d,h,"delete")),sf(this,gp)&&((o=sf(this,dp))==null||o.push([d,h,"delete"]))}}if(sf(this,sp).clear(),sf(this,jf).fill(void 0),sf(this,Bm).fill(void 0),sf(this,Tp)&&sf(this,Ip)&&(sf(this,Tp).fill(0),sf(this,Ip).fill(0)),sf(this,Pp)&&sf(this,Pp).fill(0),Xf(this,hp,0),Xf(this,up,0),sf(this,Ep).length=0,Xf(this,Sp,0),Xf(this,ap,0),sf(this,gp)&&sf(this,dp)){const c=sf(this,dp);let d;for(;d=c==null?void 0:c.shift();)(s=sf(this,xp))==null||s.call(this,...d)}}};Om=new WeakMap,lp=new WeakMap,_p=new WeakMap,xp=new WeakMap,Np=new WeakMap,ap=new WeakMap,Sp=new WeakMap,sp=new WeakMap,Bm=new WeakMap,jf=new WeakMap,fp=new WeakMap,bp=new WeakMap,hp=new WeakMap,up=new WeakMap,Ep=new WeakMap,dp=new WeakMap,Pp=new WeakMap,Ip=new WeakMap,Tp=new WeakMap,Rp=new WeakMap,Op=new WeakMap,gp=new WeakMap,Wp=new WeakSet,tg=function(){const n=new ZeroArray(sf(this,Om)),o=new ZeroArray(sf(this,Om));Xf(this,Tp,n),Xf(this,Ip,o),Xf(this,Xp,(d,h,p=perf.now())=>{if(o[d]=h!==0?p:0,n[d]=h,h!==0&&this.ttlAutopurge){const y=setTimeout(()=>{sf(this,Cp).call(this,d)&&this.delete(sf(this,Bm)[d])},h+1);y.unref&&y.unref()}}),Xf(this,Ap,d=>{o[d]=n[d]!==0?perf.now():0}),Xf(this,Vp,(d,h)=>{if(n[h]){const p=n[h],y=o[h];d.ttl=p,d.start=y,d.now=s||c(),d.remainingTTL=d.now+p-y}});let s=0;const c=()=>{const d=perf.now();if(this.ttlResolution>0){s=d;const h=setTimeout(()=>s=0,this.ttlResolution);h.unref&&h.unref()}return d};this.getRemainingTTL=d=>{const h=sf(this,sp).get(d);return h===void 0?0:n[h]===0||o[h]===0?1/0:o[h]+n[h]-(s||c())},Xf(this,Cp,d=>n[d]!==0&&o[d]!==0&&(s||c())-o[d]>n[d])},Ap=new WeakMap,Vp=new WeakMap,Xp=new WeakMap,Cp=new WeakMap,Yp=new WeakSet,og=function(){const n=new ZeroArray(sf(this,Om));Xf(this,Sp,0),Xf(this,Pp,n),Xf(this,Gp,o=>{Xf(this,Sp,sf(this,Sp)-n[o]),n[o]=0}),Xf(this,Zp,(o,s,c,d)=>{if(kf(this,zm,qm).call(this,s))return 0;if(!isPosInt(c))if(d){if(typeof d!="function")throw new TypeError("sizeCalculation must be a function");if(c=d(s,o),!isPosInt(c))throw new TypeError("sizeCalculation return invalid (expect positive integer)")}else throw new TypeError("invalid size value (must be positive integer). When maxSize or maxEntrySize is used, sizeCalculation or size must be set.");return c}),Xf(this,kp,(o,s,c)=>{if(n[o]=s,sf(this,lp)){const d=sf(this,lp)-n[o];for(;sf(this,Sp)>d;)kf(this,zp,Jp).call(this,!0)}Xf(this,Sp,sf(this,Sp)+n[o]),c&&(c.entrySize=s,c.totalCalculatedSize=sf(this,Sp))})},Gp=new WeakMap,kp=new WeakMap,Zp=new WeakMap,wp=new WeakSet,Lp=function*({allowStale:n=this.allowStale}={}){if(sf(this,ap))for(let o=sf(this,up);!(!kf(this,Bp,ng).call(this,o)||((n||!sf(this,Cp).call(this,o))&&(yield o),o===sf(this,hp)));)o=sf(this,bp)[o]},Mp=new WeakSet,Fp=function*({allowStale:n=this.allowStale}={}){if(sf(this,ap))for(let o=sf(this,hp);!(!kf(this,Bp,ng).call(this,o)||((n||!sf(this,Cp).call(this,o))&&(yield o),o===sf(this,up)));)o=sf(this,fp)[o]},Bp=new WeakSet,ng=function(n){return n!==void 0&&sf(this,sp).get(sf(this,Bm)[n])===n},zp=new WeakSet,Jp=function(n){var d,h;const o=sf(this,hp),s=sf(this,Bm)[o],c=sf(this,jf)[o];return sf(this,Op)&&kf(this,zm,qm).call(this,c)?c.__abortController.abort(new Error("evicted")):(sf(this,Rp)||sf(this,gp))&&(sf(this,Rp)&&((d=sf(this,_p))==null||d.call(this,c,s,"evict")),sf(this,gp)&&((h=sf(this,dp))==null||h.push([c,s,"evict"]))),sf(this,Gp).call(this,o),n&&(sf(this,Bm)[o]=void 0,sf(this,jf)[o]=void 0,sf(this,Ep).push(o)),sf(this,ap)===1?(Xf(this,hp,Xf(this,up,0)),sf(this,Ep).length=0):Xf(this,hp,sf(this,fp)[o]),sf(this,sp).delete(s),Kp(this,ap)._--,o},Up=new WeakSet,Qp=function(n,o,s,c){const d=o===void 0?void 0:sf(this,jf)[o];if(kf(this,zm,qm).call(this,d))return d;const h=new AbortController,{signal:p}=s;p==null||p.addEventListener("abort",()=>h.abort(p.reason),{signal:h.signal});const y={signal:h.signal,options:s,context:c},E=(W,nt=!1)=>{const{aborted:lt}=h.signal,Ee=s.ignoreFetchAbort&&W!==void 0;if(s.status&&(lt&&!nt?(s.status.fetchAborted=!0,s.status.fetchError=h.signal.reason,Ee&&(s.status.fetchAbortIgnored=!0)):s.status.fetchResolved=!0),lt&&!Ee&&!nt)return F(h.signal.reason);const yt=z;return sf(this,jf)[o]===z&&(W===void 0?yt.__staleWhileFetching?sf(this,jf)[o]=yt.__staleWhileFetching:this.delete(n):(s.status&&(s.status.fetchUpdated=!0),this.set(n,W,y.options))),W},L=W=>(s.status&&(s.status.fetchRejected=!0,s.status.fetchError=W),F(W)),F=W=>{const{aborted:nt}=h.signal,lt=nt&&s.allowStaleOnFetchAbort,Ee=lt||s.allowStaleOnFetchRejection,yt=Ee||s.noDeleteOnFetchRejection,Ai=z;if(sf(this,jf)[o]===z&&(!yt||Ai.__staleWhileFetching===void 0?this.delete(n):lt||(sf(this,jf)[o]=Ai.__staleWhileFetching)),Ee)return s.status&&Ai.__staleWhileFetching!==void 0&&(s.status.returnedStale=!0),Ai.__staleWhileFetching;if(Ai.__returned===Ai)throw W},N=(W,nt)=>{var Ee;const lt=(Ee=sf(this,Np))==null?void 0:Ee.call(this,n,d,y);lt&< instanceof Promise&<.then(yt=>W(yt),nt),h.signal.addEventListener("abort",()=>{(!s.ignoreFetchAbort||s.allowStaleOnFetchAbort)&&(W(),s.allowStaleOnFetchAbort&&(W=yt=>E(yt,!0)))})};s.status&&(s.status.fetchDispatched=!0);const z=new Promise(N).then(E,L),oe=Object.assign(z,{__abortController:h,__staleWhileFetching:d,__returned:void 0});return o===void 0?(this.set(n,oe,{...y.options,status:void 0}),o=sf(this,sp).get(n)):sf(this,jf)[o]=oe,oe},zm=new WeakSet,qm=function(n){if(!sf(this,Op))return!1;const o=n;return!!o&&o instanceof Promise&&o.hasOwnProperty("__staleWhileFetching")&&o.__abortController instanceof AbortController},$p=new WeakSet,ig=function(n,o){sf(this,bp)[o]=n,sf(this,fp)[n]=o},Dp=new WeakSet,jp=function(n){n!==sf(this,up)&&(n===sf(this,hp)?Xf(this,hp,sf(this,fp)[n]):kf(this,$p,ig).call(this,sf(this,bp)[n],sf(this,fp)[n]),kf(this,$p,ig).call(this,sf(this,up),n),Xf(this,up,n))};let LRUCache=qp;const SIDE_PLANES=[new Cesium$1.Plane(new Cesium$1.Cartesian3(0,0,1),.5),new Cesium$1.Plane(new Cesium$1.Cartesian3(0,0,-1),.5),new Cesium$1.Plane(new Cesium$1.Cartesian3(0,1,0),.5),new Cesium$1.Plane(new Cesium$1.Cartesian3(0,-1,0),.5),new Cesium$1.Plane(new Cesium$1.Cartesian3(1,0,0),.5),new Cesium$1.Plane(new Cesium$1.Cartesian3(-1,0,0),.5)],CORNER_POINT_VECTORS=[new Cesium$1.Cartesian3(.5,.5,.5),new Cesium$1.Cartesian3(.5,-.5,.5),new Cesium$1.Cartesian3(-.5,-.5,.5),new Cesium$1.Cartesian3(-.5,.5,.5)],FACE_POINT_VECTORS=[new Cesium$1.Cartesian3(.5,0,0),new Cesium$1.Cartesian3(0,.5,0),new Cesium$1.Cartesian3(0,0,.5)],SCALE_POINT_VECTORS=[...CORNER_POINT_VECTORS,...FACE_POINT_VECTORS],SCALE_POINTS=SCALE_POINT_VECTORS.map(t=>({point:t,oppositePoint:Cesium$1.Cartesian3.multiplyByScalar(t,-1,new Cesium$1.Cartesian3)})),BOX_EDGES=CORNER_POINT_VECTORS.flatMap((t,n)=>{const o=t,s=Cesium$1.Cartesian3.clone(o,new Cesium$1.Cartesian3);s.z*=-1;const c=CORNER_POINT_VECTORS[(n+1)%4],d=Cesium$1.Cartesian3.clone(c,new Cesium$1.Cartesian3);return d.z*=-1,[{start:o,end:s,isDraggable:!0},{start:c,end:o},{start:d,end:s}]}),SIDE_PLANE_NAMES=["bottom","top","front","back","left","right"];var composeRefs$1={};Object.defineProperty(composeRefs$1,"__esModule",{value:!0});function composeRefs(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];if(t.length===2)return composeTwoRefs(t[0],t[1])||null;var o=t.slice(1).reduce(function(s,c){return composeTwoRefs(s,c)},t[0]);return o||null}var _default=composeRefs$1.default=composeRefs,composedRefCache=new WeakMap;function composeTwoRefs(t,n){if(t&&n){var o=composedRefCache.get(t)||new WeakMap;composedRefCache.set(t,o);var s=o.get(n)||function(c){updateRef(t,c),updateRef(n,c)};return o.set(n,s),s}return t||n}function updateRef(t,n){typeof t=="function"?t(n):t.current=n}var md5$1={exports:{}};/**
|
|
5832
|
+
${t}`),t}},fragmentShaderSource:{get:function(){return this._fragmentShaderSource}},renderState:{get:function(){return this._renderState}},closed:{get:function(){return this._closed}},vertexFormat:{get:function(){return this._vertexFormat}}}),PolylineMaterialAppearance.VERTEX_FORMAT=VertexFormat.POSITION_AND_ST,PolylineMaterialAppearance.prototype.getFragmentShaderSource=Appearance.prototype.getFragmentShaderSource,PolylineMaterialAppearance.prototype.isTranslucent=Appearance.prototype.isTranslucent,PolylineMaterialAppearance.prototype.getRenderState=Appearance.prototype.getRenderState;function GroundPolylinePrimitive(t){t=defaultValue(t,defaultValue.EMPTY_OBJECT),this.geometryInstances=t.geometryInstances,this._hasPerInstanceColors=!0;let n=t.appearance;defined(n)||(n=new PolylineMaterialAppearance),this.appearance=n,this.show=defaultValue(t.show,!0),this.classificationType=defaultValue(t.classificationType,ClassificationType$1.BOTH),this.debugShowBoundingVolume=defaultValue(t.debugShowBoundingVolume,!1),this._debugShowShadowVolume=defaultValue(t.debugShowShadowVolume,!1),this._primitiveOptions={geometryInstances:void 0,appearance:void 0,vertexCacheOptimize:!1,interleave:defaultValue(t.interleave,!1),releaseGeometryInstances:defaultValue(t.releaseGeometryInstances,!0),allowPicking:defaultValue(t.allowPicking,!0),asynchronous:defaultValue(t.asynchronous,!0),compressVertices:!1,_createShaderProgramFunction:void 0,_createCommandsFunction:void 0,_updateAndQueueCommandsFunction:void 0},this._zIndex=void 0,this._ready=!1,this._primitive=void 0,this._sp=void 0,this._sp2D=void 0,this._spMorph=void 0,this._renderState=getRenderState(!1),this._renderState3DTiles=getRenderState(!0),this._renderStateMorph=RenderState.fromCache({cull:{enabled:!0,face:CullFace$1.FRONT},depthTest:{enabled:!0},blending:BlendingState$1.PRE_MULTIPLIED_ALPHA_BLEND,depthMask:!1})}Object.defineProperties(GroundPolylinePrimitive.prototype,{interleave:{get:function(){return this._primitiveOptions.interleave}},releaseGeometryInstances:{get:function(){return this._primitiveOptions.releaseGeometryInstances}},allowPicking:{get:function(){return this._primitiveOptions.allowPicking}},asynchronous:{get:function(){return this._primitiveOptions.asynchronous}},ready:{get:function(){return this._ready}},debugShowShadowVolume:{get:function(){return this._debugShowShadowVolume}}}),GroundPolylinePrimitive.initializeTerrainHeights=function(){return ApproximateTerrainHeights.initialize()};function createShaderProgram(t,n,o){const s=n.context,c=t._primitive,d=c._attributeLocations;let h=c._batchTable.getVertexShaderCallback()(PolylineShadowVolumeVS);h=Primitive._appendShowToShader(c,h),h=Primitive._appendDistanceDisplayConditionToShader(c,h),h=Primitive._modifyShaderPosition(t,h,n.scene3DOnly);let p=c._batchTable.getVertexShaderCallback()(PolylineShadowVolumeMorphVS);p=Primitive._appendShowToShader(c,p),p=Primitive._appendDistanceDisplayConditionToShader(c,p),p=Primitive._modifyShaderPosition(t,p,n.scene3DOnly);let y=c._batchTable.getVertexShaderCallback()(PolylineShadowVolumeFS);const E=[`GLOBE_MINIMUM_ALTITUDE ${n.mapProjection.ellipsoid.minimumRadius.toFixed(1)}`];let L="",F="";defined(o.material)?(F=defined(o.material)?o.material.shaderSource:"",F.search(/in\s+float\s+v_polylineAngle;/g)!==-1&&E.push("ANGLE_VARYING"),F.search(/in\s+float\s+v_width;/g)!==-1&&E.push("WIDTH_VARYING")):L="PER_INSTANCE_COLOR",E.push(L);const N=t.debugShowShadowVolume?["DEBUG_SHOW_VOLUME",L]:[L],z=new ShaderSource({defines:E,sources:[h]}),oe=new ShaderSource({defines:N,sources:[F,y]});t._sp=ShaderProgram.replaceCache({context:s,shaderProgram:c._sp,vertexShaderSource:z,fragmentShaderSource:oe,attributeLocations:d});let W=s.shaderCache.getDerivedShaderProgram(t._sp,"2dColor");if(!defined(W)){const lt=new ShaderSource({defines:E.concat(["COLUMBUS_VIEW_2D"]),sources:[h]});W=s.shaderCache.createDerivedShaderProgram(t._sp,"2dColor",{context:s,shaderProgram:t._sp2D,vertexShaderSource:lt,fragmentShaderSource:oe,attributeLocations:d})}t._sp2D=W;let nt=s.shaderCache.getDerivedShaderProgram(t._sp,"MorphColor");if(!defined(nt)){const lt=new ShaderSource({defines:E.concat([`MAX_TERRAIN_HEIGHT ${ApproximateTerrainHeights._defaultMaxTerrainHeight.toFixed(1)}`]),sources:[p]});y=c._batchTable.getVertexShaderCallback()(PolylineShadowVolumeMorphFS);const Ee=new ShaderSource({defines:N,sources:[F,y]});nt=s.shaderCache.createDerivedShaderProgram(t._sp,"MorphColor",{context:s,shaderProgram:t._spMorph,vertexShaderSource:lt,fragmentShaderSource:Ee,attributeLocations:d})}t._spMorph=nt}function getRenderState(t){return RenderState.fromCache({cull:{enabled:!0},blending:BlendingState$1.PRE_MULTIPLIED_ALPHA_BLEND,depthMask:!1,stencilTest:{enabled:t,frontFunction:StencilFunction$1.EQUAL,frontOperation:{fail:StencilOperation$1.KEEP,zFail:StencilOperation$1.KEEP,zPass:StencilOperation$1.KEEP},backFunction:StencilFunction$1.EQUAL,backOperation:{fail:StencilOperation$1.KEEP,zFail:StencilOperation$1.KEEP,zPass:StencilOperation$1.KEEP},reference:StencilConstants$1.CESIUM_3D_TILE_MASK,mask:StencilConstants$1.CESIUM_3D_TILE_MASK}})}function createCommands(t,n,o,s,c,d){const h=t._primitive,p=h._va.length;c.length=p,d.length=p;const E=n instanceof PolylineColorAppearance?{}:o._uniforms,L=h._batchTable.getUniformMapCallback()(E);for(let F=0;F<p;F++){const N=h._va[F];let z=c[F];defined(z)||(z=c[F]=new DrawCommand({owner:t,primitiveType:h._primitiveType})),z.vertexArray=N,z.renderState=t._renderState,z.shaderProgram=t._sp,z.uniformMap=L,z.pass=Pass$1.TERRAIN_CLASSIFICATION,z.pickId="czm_batchTable_pickColor(v_endPlaneNormalEcAndBatchId.w)";const oe=DrawCommand.shallowClone(z,z.derivedCommands.tileset);oe.renderState=t._renderState3DTiles,oe.pass=Pass$1.CESIUM_3D_TILE_CLASSIFICATION,z.derivedCommands.tileset=oe;const W=DrawCommand.shallowClone(z,z.derivedCommands.color2D);W.shaderProgram=t._sp2D,z.derivedCommands.color2D=W;const nt=DrawCommand.shallowClone(oe,oe.derivedCommands.color2D);nt.shaderProgram=t._sp2D,oe.derivedCommands.color2D=nt;const lt=DrawCommand.shallowClone(z,z.derivedCommands.colorMorph);lt.renderState=t._renderStateMorph,lt.shaderProgram=t._spMorph,lt.pickId="czm_batchTable_pickColor(v_batchId)",z.derivedCommands.colorMorph=lt}}function updateAndQueueCommand(t,n,o,s,c,d,h){o.mode===SceneMode$1.MORPHING?n=n.derivedCommands.colorMorph:o.mode!==SceneMode$1.SCENE3D&&(n=n.derivedCommands.color2D),n.modelMatrix=s,n.boundingVolume=d,n.cull=c,n.debugShowBoundingVolume=h,o.commandList.push(n)}function updateAndQueueCommands(t,n,o,s,c,d,h){const p=t._primitive;Primitive._updateBoundingVolumes(p,n,c);let y;n.mode===SceneMode$1.SCENE3D?y=p._boundingSphereWC:n.mode===SceneMode$1.COLUMBUS_VIEW?y=p._boundingSphereCV:n.mode===SceneMode$1.SCENE2D&&defined(p._boundingSphere2D)?y=p._boundingSphere2D:defined(p._boundingSphereMorph)&&(y=p._boundingSphereMorph);const E=n.mode===SceneMode$1.MORPHING,L=t.classificationType,F=L!==ClassificationType$1.CESIUM_3D_TILE,N=L!==ClassificationType$1.TERRAIN&&!E;let z;const oe=n.passes;if(oe.render||oe.pick&&p.allowPicking){const W=o.length;for(let nt=0;nt<W;++nt){const lt=y[nt];F&&(z=o[nt],updateAndQueueCommand(t,z,n,c,d,lt,h)),N&&(z=o[nt].derivedCommands.tileset,updateAndQueueCommand(t,z,n,c,d,lt,h))}}}GroundPolylinePrimitive.prototype.update=function(t){if(!defined(this._primitive)&&!defined(this.geometryInstances))return;if(!ApproximateTerrainHeights.initialized){if(!this.asynchronous)throw new DeveloperError("For synchronous GroundPolylinePrimitives, you must call GroundPolylinePrimitives.initializeTerrainHeights() and wait for the returned promise to resolve.");GroundPolylinePrimitive.initializeTerrainHeights();return}let n;const o=this,s=this._primitiveOptions;if(!defined(this._primitive)){const c=Array.isArray(this.geometryInstances)?this.geometryInstances:[this.geometryInstances],d=c.length,h=new Array(d);let p;for(n=0;n<d;++n)if(p=c[n].attributes,!defined(p)||!defined(p.color)){this._hasPerInstanceColors=!1;break}for(n=0;n<d;++n){const y=c[n];p={};const E=y.attributes;for(const L in E)E.hasOwnProperty(L)&&(p[L]=E[L]);defined(p.width)||(p.width=new GeometryInstanceAttribute({componentDatatype:ComponentDatatype$1.UNSIGNED_BYTE,componentsPerAttribute:1,value:[y.geometry.width]})),y.geometry._scene3DOnly=t.scene3DOnly,GroundPolylineGeometry.setProjectionAndEllipsoid(y.geometry,t.mapProjection),h[n]=new GeometryInstance({geometry:y.geometry,attributes:p,id:y.id,pickPrimitive:o})}s.geometryInstances=h,s.appearance=this.appearance,s._createShaderProgramFunction=function(y,E,L){createShaderProgram(o,E,L)},s._createCommandsFunction=function(y,E,L,F,N,z,oe){createCommands(o,E,L,F,z,oe)},s._updateAndQueueCommandsFunction=function(y,E,L,F,N,z,oe,W){updateAndQueueCommands(o,E,L,F,N,z,oe)},this._primitive=new Primitive(s)}if(this.appearance instanceof PolylineColorAppearance&&!this._hasPerInstanceColors)throw new DeveloperError("All GeometryInstances must have color attributes to use PolylineColorAppearance with GroundPolylinePrimitive.");this._primitive.appearance=this.appearance,this._primitive.show=this.show,this._primitive.debugShowBoundingVolume=this.debugShowBoundingVolume,this._primitive.update(t),t.afterRender.push(()=>{!this._ready&&defined(this._primitive)&&this._primitive.ready&&(this._ready=!0,this.releaseGeometryInstances&&(this.geometryInstances=void 0))})},GroundPolylinePrimitive.prototype.getGeometryInstanceAttributes=function(t){if(!defined(this._primitive))throw new DeveloperError("must call update before calling getGeometryInstanceAttributes");return this._primitive.getGeometryInstanceAttributes(t)},GroundPolylinePrimitive.isSupported=function(t){return t.frameState.context.depthTexture},GroundPolylinePrimitive.prototype.isDestroyed=function(){return!1},GroundPolylinePrimitive.prototype.destroy=function(){return this._primitive=this._primitive&&this._primitive.destroy(),this._sp=this._sp&&this._sp.destroy(),this._sp2D=void 0,this._spMorph=void 0,destroyObject(this)};const defaultRepeat=new Cartesian2(1,1),defaultTransparent=!1,defaultColor$1=Color$1.WHITE;function ImageMaterialProperty(t){t=defaultValue(t,defaultValue.EMPTY_OBJECT),this._definitionChanged=new Event$1,this._image=void 0,this._imageSubscription=void 0,this._repeat=void 0,this._repeatSubscription=void 0,this._color=void 0,this._colorSubscription=void 0,this._transparent=void 0,this._transparentSubscription=void 0,this.image=t.image,this.repeat=t.repeat,this.color=t.color,this.transparent=t.transparent}Object.defineProperties(ImageMaterialProperty.prototype,{isConstant:{get:function(){return Property.isConstant(this._image)&&Property.isConstant(this._repeat)}},definitionChanged:{get:function(){return this._definitionChanged}},image:createPropertyDescriptor("image"),repeat:createPropertyDescriptor("repeat"),color:createPropertyDescriptor("color"),transparent:createPropertyDescriptor("transparent")}),ImageMaterialProperty.prototype.getType=function(t){return"Image"},ImageMaterialProperty.prototype.getValue=function(t,n){return defined(n)||(n={}),n.image=Property.getValueOrUndefined(this._image,t),n.repeat=Property.getValueOrClonedDefault(this._repeat,t,defaultRepeat,n.repeat),n.color=Property.getValueOrClonedDefault(this._color,t,defaultColor$1,n.color),Property.getValueOrDefault(this._transparent,t,defaultTransparent)&&(n.color.alpha=Math.min(.99,n.color.alpha)),n},ImageMaterialProperty.prototype.equals=function(t){return this===t||t instanceof ImageMaterialProperty&&Property.equals(this._image,t._image)&&Property.equals(this._repeat,t._repeat)&&Property.equals(this._color,t._color)&&Property.equals(this._transparent,t._transparent)};function createMaterialProperty(t){if(t instanceof Color$1)return new ColorMaterialProperty(t);if(typeof t=="string"||t instanceof Resource$1||t instanceof HTMLCanvasElement||t instanceof HTMLVideoElement){const n=new ImageMaterialProperty;return n.image=t,n}throw new DeveloperError(`Unable to infer material type: ${t}`)}function createMaterialPropertyDescriptor(t,n){return createPropertyDescriptor(t,n,createMaterialProperty)}function BoxGraphics(t){this._definitionChanged=new Event$1,this._show=void 0,this._showSubscription=void 0,this._dimensions=void 0,this._dimensionsSubscription=void 0,this._heightReference=void 0,this._heightReferenceSubscription=void 0,this._fill=void 0,this._fillSubscription=void 0,this._material=void 0,this._materialSubscription=void 0,this._outline=void 0,this._outlineSubscription=void 0,this._outlineColor=void 0,this._outlineColorSubscription=void 0,this._outlineWidth=void 0,this._outlineWidthSubscription=void 0,this._shadows=void 0,this._shadowsSubscription=void 0,this._distanceDisplayCondition=void 0,this._distanceDisplayConditionSubscription=void 0,this.merge(defaultValue(t,defaultValue.EMPTY_OBJECT))}Object.defineProperties(BoxGraphics.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:createPropertyDescriptor("show"),dimensions:createPropertyDescriptor("dimensions"),heightReference:createPropertyDescriptor("heightReference"),fill:createPropertyDescriptor("fill"),material:createMaterialPropertyDescriptor("material"),outline:createPropertyDescriptor("outline"),outlineColor:createPropertyDescriptor("outlineColor"),outlineWidth:createPropertyDescriptor("outlineWidth"),shadows:createPropertyDescriptor("shadows"),distanceDisplayCondition:createPropertyDescriptor("distanceDisplayCondition")}),BoxGraphics.prototype.clone=function(t){return defined(t)?(t.show=this.show,t.dimensions=this.dimensions,t.heightReference=this.heightReference,t.fill=this.fill,t.material=this.material,t.outline=this.outline,t.outlineColor=this.outlineColor,t.outlineWidth=this.outlineWidth,t.shadows=this.shadows,t.distanceDisplayCondition=this.distanceDisplayCondition,t):new BoxGraphics(this)},BoxGraphics.prototype.merge=function(t){if(!defined(t))throw new DeveloperError("source is required.");this.show=defaultValue(this.show,t.show),this.dimensions=defaultValue(this.dimensions,t.dimensions),this.heightReference=defaultValue(this.heightReference,t.heightReference),this.fill=defaultValue(this.fill,t.fill),this.material=defaultValue(this.material,t.material),this.outline=defaultValue(this.outline,t.outline),this.outlineColor=defaultValue(this.outlineColor,t.outlineColor),this.outlineWidth=defaultValue(this.outlineWidth,t.outlineWidth),this.shadows=defaultValue(this.shadows,t.shadows),this.distanceDisplayCondition=defaultValue(this.distanceDisplayCondition,t.distanceDisplayCondition)};function PositionProperty(){DeveloperError.throwInstantiationError()}Object.defineProperties(PositionProperty.prototype,{isConstant:{get:DeveloperError.throwInstantiationError},definitionChanged:{get:DeveloperError.throwInstantiationError},referenceFrame:{get:DeveloperError.throwInstantiationError}}),PositionProperty.prototype.getValue=DeveloperError.throwInstantiationError,PositionProperty.prototype.getValueInReferenceFrame=DeveloperError.throwInstantiationError,PositionProperty.prototype.equals=DeveloperError.throwInstantiationError;const scratchMatrix3=new Matrix3;PositionProperty.convertToReferenceFrame=function(t,n,o,s,c){if(!defined(n))return n;if(defined(c)||(c=new Cartesian3),o===s)return Cartesian3.clone(n,c);let d=Transforms.computeIcrfToFixedMatrix(t,scratchMatrix3);if(defined(d)||(d=Transforms.computeTemeToPseudoFixedMatrix(t,scratchMatrix3)),o===ReferenceFrame$1.INERTIAL)return Matrix3.multiplyByVector(d,n,c);if(o===ReferenceFrame$1.FIXED)return Matrix3.multiplyByVector(Matrix3.transpose(d,scratchMatrix3),n,c)};function ConstantPositionProperty(t,n){this._definitionChanged=new Event$1,this._value=Cartesian3.clone(t),this._referenceFrame=defaultValue(n,ReferenceFrame$1.FIXED)}Object.defineProperties(ConstantPositionProperty.prototype,{isConstant:{get:function(){return!defined(this._value)||this._referenceFrame===ReferenceFrame$1.FIXED}},definitionChanged:{get:function(){return this._definitionChanged}},referenceFrame:{get:function(){return this._referenceFrame}}}),ConstantPositionProperty.prototype.getValue=function(t,n){return this.getValueInReferenceFrame(t,ReferenceFrame$1.FIXED,n)},ConstantPositionProperty.prototype.setValue=function(t,n){let o=!1;Cartesian3.equals(this._value,t)||(o=!0,this._value=Cartesian3.clone(t)),defined(n)&&this._referenceFrame!==n&&(o=!0,this._referenceFrame=n),o&&this._definitionChanged.raiseEvent(this)},ConstantPositionProperty.prototype.getValueInReferenceFrame=function(t,n,o){if(!defined(t))throw new DeveloperError("time is required.");if(!defined(n))throw new DeveloperError("referenceFrame is required.");return PositionProperty.convertToReferenceFrame(t,this._value,this._referenceFrame,n,o)},ConstantPositionProperty.prototype.equals=function(t){return this===t||t instanceof ConstantPositionProperty&&Cartesian3.equals(this._value,t._value)&&this._referenceFrame===t._referenceFrame};function CorridorGraphics(t){this._definitionChanged=new Event$1,this._show=void 0,this._showSubscription=void 0,this._positions=void 0,this._positionsSubscription=void 0,this._width=void 0,this._widthSubscription=void 0,this._height=void 0,this._heightSubscription=void 0,this._heightReference=void 0,this._heightReferenceSubscription=void 0,this._extrudedHeight=void 0,this._extrudedHeightSubscription=void 0,this._extrudedHeightReference=void 0,this._extrudedHeightReferenceSubscription=void 0,this._cornerType=void 0,this._cornerTypeSubscription=void 0,this._granularity=void 0,this._granularitySubscription=void 0,this._fill=void 0,this._fillSubscription=void 0,this._material=void 0,this._materialSubscription=void 0,this._outline=void 0,this._outlineSubscription=void 0,this._outlineColor=void 0,this._outlineColorSubscription=void 0,this._outlineWidth=void 0,this._outlineWidthSubscription=void 0,this._shadows=void 0,this._shadowsSubscription=void 0,this._distanceDisplayCondition=void 0,this._distanceDisplayConditionSubscription=void 0,this._classificationType=void 0,this._classificationTypeSubscription=void 0,this._zIndex=void 0,this._zIndexSubscription=void 0,this.merge(defaultValue(t,defaultValue.EMPTY_OBJECT))}Object.defineProperties(CorridorGraphics.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:createPropertyDescriptor("show"),positions:createPropertyDescriptor("positions"),width:createPropertyDescriptor("width"),height:createPropertyDescriptor("height"),heightReference:createPropertyDescriptor("heightReference"),extrudedHeight:createPropertyDescriptor("extrudedHeight"),extrudedHeightReference:createPropertyDescriptor("extrudedHeightReference"),cornerType:createPropertyDescriptor("cornerType"),granularity:createPropertyDescriptor("granularity"),fill:createPropertyDescriptor("fill"),material:createMaterialPropertyDescriptor("material"),outline:createPropertyDescriptor("outline"),outlineColor:createPropertyDescriptor("outlineColor"),outlineWidth:createPropertyDescriptor("outlineWidth"),shadows:createPropertyDescriptor("shadows"),distanceDisplayCondition:createPropertyDescriptor("distanceDisplayCondition"),classificationType:createPropertyDescriptor("classificationType"),zIndex:createPropertyDescriptor("zIndex")}),CorridorGraphics.prototype.clone=function(t){return defined(t)?(t.show=this.show,t.positions=this.positions,t.width=this.width,t.height=this.height,t.heightReference=this.heightReference,t.extrudedHeight=this.extrudedHeight,t.extrudedHeightReference=this.extrudedHeightReference,t.cornerType=this.cornerType,t.granularity=this.granularity,t.fill=this.fill,t.material=this.material,t.outline=this.outline,t.outlineColor=this.outlineColor,t.outlineWidth=this.outlineWidth,t.shadows=this.shadows,t.distanceDisplayCondition=this.distanceDisplayCondition,t.classificationType=this.classificationType,t.zIndex=this.zIndex,t):new CorridorGraphics(this)},CorridorGraphics.prototype.merge=function(t){if(!defined(t))throw new DeveloperError("source is required.");this.show=defaultValue(this.show,t.show),this.positions=defaultValue(this.positions,t.positions),this.width=defaultValue(this.width,t.width),this.height=defaultValue(this.height,t.height),this.heightReference=defaultValue(this.heightReference,t.heightReference),this.extrudedHeight=defaultValue(this.extrudedHeight,t.extrudedHeight),this.extrudedHeightReference=defaultValue(this.extrudedHeightReference,t.extrudedHeightReference),this.cornerType=defaultValue(this.cornerType,t.cornerType),this.granularity=defaultValue(this.granularity,t.granularity),this.fill=defaultValue(this.fill,t.fill),this.material=defaultValue(this.material,t.material),this.outline=defaultValue(this.outline,t.outline),this.outlineColor=defaultValue(this.outlineColor,t.outlineColor),this.outlineWidth=defaultValue(this.outlineWidth,t.outlineWidth),this.shadows=defaultValue(this.shadows,t.shadows),this.distanceDisplayCondition=defaultValue(this.distanceDisplayCondition,t.distanceDisplayCondition),this.classificationType=defaultValue(this.classificationType,t.classificationType),this.zIndex=defaultValue(this.zIndex,t.zIndex)};function createRawProperty(t){return t}function createRawPropertyDescriptor(t,n){return createPropertyDescriptor(t,n,createRawProperty)}function CylinderGraphics(t){this._definitionChanged=new Event$1,this._show=void 0,this._showSubscription=void 0,this._length=void 0,this._lengthSubscription=void 0,this._topRadius=void 0,this._topRadiusSubscription=void 0,this._bottomRadius=void 0,this._bottomRadiusSubscription=void 0,this._heightReference=void 0,this._heightReferenceSubscription=void 0,this._fill=void 0,this._fillSubscription=void 0,this._material=void 0,this._materialSubscription=void 0,this._outline=void 0,this._outlineSubscription=void 0,this._outlineColor=void 0,this._outlineColorSubscription=void 0,this._outlineWidth=void 0,this._outlineWidthSubscription=void 0,this._numberOfVerticalLines=void 0,this._numberOfVerticalLinesSubscription=void 0,this._slices=void 0,this._slicesSubscription=void 0,this._shadows=void 0,this._shadowsSubscription=void 0,this._distanceDisplayCondition=void 0,this._distanceDisplayConditionSubscription=void 0,this.merge(defaultValue(t,defaultValue.EMPTY_OBJECT))}Object.defineProperties(CylinderGraphics.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:createPropertyDescriptor("show"),length:createPropertyDescriptor("length"),topRadius:createPropertyDescriptor("topRadius"),bottomRadius:createPropertyDescriptor("bottomRadius"),heightReference:createPropertyDescriptor("heightReference"),fill:createPropertyDescriptor("fill"),material:createMaterialPropertyDescriptor("material"),outline:createPropertyDescriptor("outline"),outlineColor:createPropertyDescriptor("outlineColor"),outlineWidth:createPropertyDescriptor("outlineWidth"),numberOfVerticalLines:createPropertyDescriptor("numberOfVerticalLines"),slices:createPropertyDescriptor("slices"),shadows:createPropertyDescriptor("shadows"),distanceDisplayCondition:createPropertyDescriptor("distanceDisplayCondition")}),CylinderGraphics.prototype.clone=function(t){return defined(t)?(t.show=this.show,t.length=this.length,t.topRadius=this.topRadius,t.bottomRadius=this.bottomRadius,t.heightReference=this.heightReference,t.fill=this.fill,t.material=this.material,t.outline=this.outline,t.outlineColor=this.outlineColor,t.outlineWidth=this.outlineWidth,t.numberOfVerticalLines=this.numberOfVerticalLines,t.slices=this.slices,t.shadows=this.shadows,t.distanceDisplayCondition=this.distanceDisplayCondition,t):new CylinderGraphics(this)},CylinderGraphics.prototype.merge=function(t){if(!defined(t))throw new DeveloperError("source is required.");this.show=defaultValue(this.show,t.show),this.length=defaultValue(this.length,t.length),this.topRadius=defaultValue(this.topRadius,t.topRadius),this.bottomRadius=defaultValue(this.bottomRadius,t.bottomRadius),this.heightReference=defaultValue(this.heightReference,t.heightReference),this.fill=defaultValue(this.fill,t.fill),this.material=defaultValue(this.material,t.material),this.outline=defaultValue(this.outline,t.outline),this.outlineColor=defaultValue(this.outlineColor,t.outlineColor),this.outlineWidth=defaultValue(this.outlineWidth,t.outlineWidth),this.numberOfVerticalLines=defaultValue(this.numberOfVerticalLines,t.numberOfVerticalLines),this.slices=defaultValue(this.slices,t.slices),this.shadows=defaultValue(this.shadows,t.shadows),this.distanceDisplayCondition=defaultValue(this.distanceDisplayCondition,t.distanceDisplayCondition)};function EllipseGraphics(t){this._definitionChanged=new Event$1,this._show=void 0,this._showSubscription=void 0,this._semiMajorAxis=void 0,this._semiMajorAxisSubscription=void 0,this._semiMinorAxis=void 0,this._semiMinorAxisSubscription=void 0,this._height=void 0,this._heightSubscription=void 0,this._heightReference=void 0,this._heightReferenceSubscription=void 0,this._extrudedHeight=void 0,this._extrudedHeightSubscription=void 0,this._extrudedHeightReference=void 0,this._extrudedHeightReferenceSubscription=void 0,this._rotation=void 0,this._rotationSubscription=void 0,this._stRotation=void 0,this._stRotationSubscription=void 0,this._granularity=void 0,this._granularitySubscription=void 0,this._fill=void 0,this._fillSubscription=void 0,this._material=void 0,this._materialSubscription=void 0,this._outline=void 0,this._outlineSubscription=void 0,this._outlineColor=void 0,this._outlineColorSubscription=void 0,this._outlineWidth=void 0,this._outlineWidthSubscription=void 0,this._numberOfVerticalLines=void 0,this._numberOfVerticalLinesSubscription=void 0,this._shadows=void 0,this._shadowsSubscription=void 0,this._distanceDisplayCondition=void 0,this._distanceDisplayConditionSubscription=void 0,this._classificationType=void 0,this._classificationTypeSubscription=void 0,this._zIndex=void 0,this._zIndexSubscription=void 0,this.merge(defaultValue(t,defaultValue.EMPTY_OBJECT))}Object.defineProperties(EllipseGraphics.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:createPropertyDescriptor("show"),semiMajorAxis:createPropertyDescriptor("semiMajorAxis"),semiMinorAxis:createPropertyDescriptor("semiMinorAxis"),height:createPropertyDescriptor("height"),heightReference:createPropertyDescriptor("heightReference"),extrudedHeight:createPropertyDescriptor("extrudedHeight"),extrudedHeightReference:createPropertyDescriptor("extrudedHeightReference"),rotation:createPropertyDescriptor("rotation"),stRotation:createPropertyDescriptor("stRotation"),granularity:createPropertyDescriptor("granularity"),fill:createPropertyDescriptor("fill"),material:createMaterialPropertyDescriptor("material"),outline:createPropertyDescriptor("outline"),outlineColor:createPropertyDescriptor("outlineColor"),outlineWidth:createPropertyDescriptor("outlineWidth"),numberOfVerticalLines:createPropertyDescriptor("numberOfVerticalLines"),shadows:createPropertyDescriptor("shadows"),distanceDisplayCondition:createPropertyDescriptor("distanceDisplayCondition"),classificationType:createPropertyDescriptor("classificationType"),zIndex:createPropertyDescriptor("zIndex")}),EllipseGraphics.prototype.clone=function(t){return defined(t)?(t.show=this.show,t.semiMajorAxis=this.semiMajorAxis,t.semiMinorAxis=this.semiMinorAxis,t.height=this.height,t.heightReference=this.heightReference,t.extrudedHeight=this.extrudedHeight,t.extrudedHeightReference=this.extrudedHeightReference,t.rotation=this.rotation,t.stRotation=this.stRotation,t.granularity=this.granularity,t.fill=this.fill,t.material=this.material,t.outline=this.outline,t.outlineColor=this.outlineColor,t.outlineWidth=this.outlineWidth,t.numberOfVerticalLines=this.numberOfVerticalLines,t.shadows=this.shadows,t.distanceDisplayCondition=this.distanceDisplayCondition,t.classificationType=this.classificationType,t.zIndex=this.zIndex,t):new EllipseGraphics(this)},EllipseGraphics.prototype.merge=function(t){if(!defined(t))throw new DeveloperError("source is required.");this.show=defaultValue(this.show,t.show),this.semiMajorAxis=defaultValue(this.semiMajorAxis,t.semiMajorAxis),this.semiMinorAxis=defaultValue(this.semiMinorAxis,t.semiMinorAxis),this.height=defaultValue(this.height,t.height),this.heightReference=defaultValue(this.heightReference,t.heightReference),this.extrudedHeight=defaultValue(this.extrudedHeight,t.extrudedHeight),this.extrudedHeightReference=defaultValue(this.extrudedHeightReference,t.extrudedHeightReference),this.rotation=defaultValue(this.rotation,t.rotation),this.stRotation=defaultValue(this.stRotation,t.stRotation),this.granularity=defaultValue(this.granularity,t.granularity),this.fill=defaultValue(this.fill,t.fill),this.material=defaultValue(this.material,t.material),this.outline=defaultValue(this.outline,t.outline),this.outlineColor=defaultValue(this.outlineColor,t.outlineColor),this.outlineWidth=defaultValue(this.outlineWidth,t.outlineWidth),this.numberOfVerticalLines=defaultValue(this.numberOfVerticalLines,t.numberOfVerticalLines),this.shadows=defaultValue(this.shadows,t.shadows),this.distanceDisplayCondition=defaultValue(this.distanceDisplayCondition,t.distanceDisplayCondition),this.classificationType=defaultValue(this.classificationType,t.classificationType),this.zIndex=defaultValue(this.zIndex,t.zIndex)};function EllipsoidGraphics(t){this._definitionChanged=new Event$1,this._show=void 0,this._showSubscription=void 0,this._radii=void 0,this._radiiSubscription=void 0,this._innerRadii=void 0,this._innerRadiiSubscription=void 0,this._minimumClock=void 0,this._minimumClockSubscription=void 0,this._maximumClock=void 0,this._maximumClockSubscription=void 0,this._minimumCone=void 0,this._minimumConeSubscription=void 0,this._maximumCone=void 0,this._maximumConeSubscription=void 0,this._heightReference=void 0,this._heightReferenceSubscription=void 0,this._fill=void 0,this._fillSubscription=void 0,this._material=void 0,this._materialSubscription=void 0,this._outline=void 0,this._outlineSubscription=void 0,this._outlineColor=void 0,this._outlineColorSubscription=void 0,this._outlineWidth=void 0,this._outlineWidthSubscription=void 0,this._stackPartitions=void 0,this._stackPartitionsSubscription=void 0,this._slicePartitions=void 0,this._slicePartitionsSubscription=void 0,this._subdivisions=void 0,this._subdivisionsSubscription=void 0,this._shadows=void 0,this._shadowsSubscription=void 0,this._distanceDisplayCondition=void 0,this._distanceDisplayConditionSubscription=void 0,this.merge(defaultValue(t,defaultValue.EMPTY_OBJECT))}Object.defineProperties(EllipsoidGraphics.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:createPropertyDescriptor("show"),radii:createPropertyDescriptor("radii"),innerRadii:createPropertyDescriptor("innerRadii"),minimumClock:createPropertyDescriptor("minimumClock"),maximumClock:createPropertyDescriptor("maximumClock"),minimumCone:createPropertyDescriptor("minimumCone"),maximumCone:createPropertyDescriptor("maximumCone"),heightReference:createPropertyDescriptor("heightReference"),fill:createPropertyDescriptor("fill"),material:createMaterialPropertyDescriptor("material"),outline:createPropertyDescriptor("outline"),outlineColor:createPropertyDescriptor("outlineColor"),outlineWidth:createPropertyDescriptor("outlineWidth"),stackPartitions:createPropertyDescriptor("stackPartitions"),slicePartitions:createPropertyDescriptor("slicePartitions"),subdivisions:createPropertyDescriptor("subdivisions"),shadows:createPropertyDescriptor("shadows"),distanceDisplayCondition:createPropertyDescriptor("distanceDisplayCondition")}),EllipsoidGraphics.prototype.clone=function(t){return defined(t)?(t.show=this.show,t.radii=this.radii,t.innerRadii=this.innerRadii,t.minimumClock=this.minimumClock,t.maximumClock=this.maximumClock,t.minimumCone=this.minimumCone,t.maximumCone=this.maximumCone,t.heightReference=this.heightReference,t.fill=this.fill,t.material=this.material,t.outline=this.outline,t.outlineColor=this.outlineColor,t.outlineWidth=this.outlineWidth,t.stackPartitions=this.stackPartitions,t.slicePartitions=this.slicePartitions,t.subdivisions=this.subdivisions,t.shadows=this.shadows,t.distanceDisplayCondition=this.distanceDisplayCondition,t):new EllipsoidGraphics(this)},EllipsoidGraphics.prototype.merge=function(t){if(!defined(t))throw new DeveloperError("source is required.");this.show=defaultValue(this.show,t.show),this.radii=defaultValue(this.radii,t.radii),this.innerRadii=defaultValue(this.innerRadii,t.innerRadii),this.minimumClock=defaultValue(this.minimumClock,t.minimumClock),this.maximumClock=defaultValue(this.maximumClock,t.maximumClock),this.minimumCone=defaultValue(this.minimumCone,t.minimumCone),this.maximumCone=defaultValue(this.maximumCone,t.maximumCone),this.heightReference=defaultValue(this.heightReference,t.heightReference),this.fill=defaultValue(this.fill,t.fill),this.material=defaultValue(this.material,t.material),this.outline=defaultValue(this.outline,t.outline),this.outlineColor=defaultValue(this.outlineColor,t.outlineColor),this.outlineWidth=defaultValue(this.outlineWidth,t.outlineWidth),this.stackPartitions=defaultValue(this.stackPartitions,t.stackPartitions),this.slicePartitions=defaultValue(this.slicePartitions,t.slicePartitions),this.subdivisions=defaultValue(this.subdivisions,t.subdivisions),this.shadows=defaultValue(this.shadows,t.shadows),this.distanceDisplayCondition=defaultValue(this.distanceDisplayCondition,t.distanceDisplayCondition)};function LabelGraphics(t){this._definitionChanged=new Event$1,this._show=void 0,this._showSubscription=void 0,this._text=void 0,this._textSubscription=void 0,this._font=void 0,this._fontSubscription=void 0,this._style=void 0,this._styleSubscription=void 0,this._scale=void 0,this._scaleSubscription=void 0,this._showBackground=void 0,this._showBackgroundSubscription=void 0,this._backgroundColor=void 0,this._backgroundColorSubscription=void 0,this._backgroundPadding=void 0,this._backgroundPaddingSubscription=void 0,this._pixelOffset=void 0,this._pixelOffsetSubscription=void 0,this._eyeOffset=void 0,this._eyeOffsetSubscription=void 0,this._horizontalOrigin=void 0,this._horizontalOriginSubscription=void 0,this._verticalOrigin=void 0,this._verticalOriginSubscription=void 0,this._heightReference=void 0,this._heightReferenceSubscription=void 0,this._fillColor=void 0,this._fillColorSubscription=void 0,this._outlineColor=void 0,this._outlineColorSubscription=void 0,this._outlineWidth=void 0,this._outlineWidthSubscription=void 0,this._translucencyByDistance=void 0,this._translucencyByDistanceSubscription=void 0,this._pixelOffsetScaleByDistance=void 0,this._pixelOffsetScaleByDistanceSubscription=void 0,this._scaleByDistance=void 0,this._scaleByDistanceSubscription=void 0,this._distanceDisplayCondition=void 0,this._distanceDisplayConditionSubscription=void 0,this._disableDepthTestDistance=void 0,this._disableDepthTestDistanceSubscription=void 0,this.merge(defaultValue(t,defaultValue.EMPTY_OBJECT))}Object.defineProperties(LabelGraphics.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:createPropertyDescriptor("show"),text:createPropertyDescriptor("text"),font:createPropertyDescriptor("font"),style:createPropertyDescriptor("style"),scale:createPropertyDescriptor("scale"),showBackground:createPropertyDescriptor("showBackground"),backgroundColor:createPropertyDescriptor("backgroundColor"),backgroundPadding:createPropertyDescriptor("backgroundPadding"),pixelOffset:createPropertyDescriptor("pixelOffset"),eyeOffset:createPropertyDescriptor("eyeOffset"),horizontalOrigin:createPropertyDescriptor("horizontalOrigin"),verticalOrigin:createPropertyDescriptor("verticalOrigin"),heightReference:createPropertyDescriptor("heightReference"),fillColor:createPropertyDescriptor("fillColor"),outlineColor:createPropertyDescriptor("outlineColor"),outlineWidth:createPropertyDescriptor("outlineWidth"),translucencyByDistance:createPropertyDescriptor("translucencyByDistance"),pixelOffsetScaleByDistance:createPropertyDescriptor("pixelOffsetScaleByDistance"),scaleByDistance:createPropertyDescriptor("scaleByDistance"),distanceDisplayCondition:createPropertyDescriptor("distanceDisplayCondition"),disableDepthTestDistance:createPropertyDescriptor("disableDepthTestDistance")}),LabelGraphics.prototype.clone=function(t){return defined(t)?(t.show=this.show,t.text=this.text,t.font=this.font,t.style=this.style,t.scale=this.scale,t.showBackground=this.showBackground,t.backgroundColor=this.backgroundColor,t.backgroundPadding=this.backgroundPadding,t.pixelOffset=this.pixelOffset,t.eyeOffset=this.eyeOffset,t.horizontalOrigin=this.horizontalOrigin,t.verticalOrigin=this.verticalOrigin,t.heightReference=this.heightReference,t.fillColor=this.fillColor,t.outlineColor=this.outlineColor,t.outlineWidth=this.outlineWidth,t.translucencyByDistance=this.translucencyByDistance,t.pixelOffsetScaleByDistance=this.pixelOffsetScaleByDistance,t.scaleByDistance=this.scaleByDistance,t.distanceDisplayCondition=this.distanceDisplayCondition,t.disableDepthTestDistance=this.disableDepthTestDistance,t):new LabelGraphics(this)},LabelGraphics.prototype.merge=function(t){if(!defined(t))throw new DeveloperError("source is required.");this.show=defaultValue(this.show,t.show),this.text=defaultValue(this.text,t.text),this.font=defaultValue(this.font,t.font),this.style=defaultValue(this.style,t.style),this.scale=defaultValue(this.scale,t.scale),this.showBackground=defaultValue(this.showBackground,t.showBackground),this.backgroundColor=defaultValue(this.backgroundColor,t.backgroundColor),this.backgroundPadding=defaultValue(this.backgroundPadding,t.backgroundPadding),this.pixelOffset=defaultValue(this.pixelOffset,t.pixelOffset),this.eyeOffset=defaultValue(this.eyeOffset,t.eyeOffset),this.horizontalOrigin=defaultValue(this.horizontalOrigin,t.horizontalOrigin),this.verticalOrigin=defaultValue(this.verticalOrigin,t.verticalOrigin),this.heightReference=defaultValue(this.heightReference,t.heightReference),this.fillColor=defaultValue(this.fillColor,t.fillColor),this.outlineColor=defaultValue(this.outlineColor,t.outlineColor),this.outlineWidth=defaultValue(this.outlineWidth,t.outlineWidth),this.translucencyByDistance=defaultValue(this.translucencyByDistance,t.translucencyByDistance),this.pixelOffsetScaleByDistance=defaultValue(this.pixelOffsetScaleByDistance,t.pixelOffsetScaleByDistance),this.scaleByDistance=defaultValue(this.scaleByDistance,t.scaleByDistance),this.distanceDisplayCondition=defaultValue(this.distanceDisplayCondition,t.distanceDisplayCondition),this.disableDepthTestDistance=defaultValue(this.disableDepthTestDistance,t.disableDepthTestDistance)};const defaultNodeTransformation=new TranslationRotationScale;function NodeTransformationProperty(t){t=defaultValue(t,defaultValue.EMPTY_OBJECT),this._definitionChanged=new Event$1,this._translation=void 0,this._translationSubscription=void 0,this._rotation=void 0,this._rotationSubscription=void 0,this._scale=void 0,this._scaleSubscription=void 0,this.translation=t.translation,this.rotation=t.rotation,this.scale=t.scale}Object.defineProperties(NodeTransformationProperty.prototype,{isConstant:{get:function(){return Property.isConstant(this._translation)&&Property.isConstant(this._rotation)&&Property.isConstant(this._scale)}},definitionChanged:{get:function(){return this._definitionChanged}},translation:createPropertyDescriptor("translation"),rotation:createPropertyDescriptor("rotation"),scale:createPropertyDescriptor("scale")}),NodeTransformationProperty.prototype.getValue=function(t,n){return defined(n)||(n=new TranslationRotationScale),n.translation=Property.getValueOrClonedDefault(this._translation,t,defaultNodeTransformation.translation,n.translation),n.rotation=Property.getValueOrClonedDefault(this._rotation,t,defaultNodeTransformation.rotation,n.rotation),n.scale=Property.getValueOrClonedDefault(this._scale,t,defaultNodeTransformation.scale,n.scale),n},NodeTransformationProperty.prototype.equals=function(t){return this===t||t instanceof NodeTransformationProperty&&Property.equals(this._translation,t._translation)&&Property.equals(this._rotation,t._rotation)&&Property.equals(this._scale,t._scale)};function PropertyBag(t,n){this._propertyNames=[],this._definitionChanged=new Event$1,defined(t)&&this.merge(t,n)}Object.defineProperties(PropertyBag.prototype,{propertyNames:{get:function(){return this._propertyNames}},isConstant:{get:function(){const t=this._propertyNames;for(let n=0,o=t.length;n<o;n++)if(!Property.isConstant(this[t[n]]))return!1;return!0}},definitionChanged:{get:function(){return this._definitionChanged}}}),PropertyBag.prototype.hasProperty=function(t){return this._propertyNames.indexOf(t)!==-1};function createConstantProperty(t){return new ConstantProperty(t)}PropertyBag.prototype.addProperty=function(t,n,o){const s=this._propertyNames;if(!defined(t))throw new DeveloperError("propertyName is required.");if(s.indexOf(t)!==-1)throw new DeveloperError(`${t} is already a registered property.`);s.push(t),Object.defineProperty(this,t,createPropertyDescriptor(t,!0,defaultValue(o,createConstantProperty))),defined(n)&&(this[t]=n),this._definitionChanged.raiseEvent(this)},PropertyBag.prototype.removeProperty=function(t){const o=this._propertyNames.indexOf(t);if(!defined(t))throw new DeveloperError("propertyName is required.");if(o===-1)throw new DeveloperError(`${t} is not a registered property.`);this._propertyNames.splice(o,1),delete this[t],this._definitionChanged.raiseEvent(this)},PropertyBag.prototype.getValue=function(t,n){if(!defined(t))throw new DeveloperError("time is required.");defined(n)||(n={});const o=this._propertyNames;for(let s=0,c=o.length;s<c;s++){const d=o[s];n[d]=Property.getValueOrUndefined(this[d],t,n[d])}return n},PropertyBag.prototype.merge=function(t,n){if(!defined(t))throw new DeveloperError("source is required.");const o=this._propertyNames,s=defined(t._propertyNames)?t._propertyNames:Object.keys(t);for(let c=0,d=s.length;c<d;c++){const h=s[c],p=this[h],y=t[h];p===void 0&&o.indexOf(h)===-1&&this.addProperty(h,void 0,n),y!==void 0&&(p!==void 0?defined(p)&&defined(p.merge)&&p.merge(y):defined(y)&&defined(y.merge)&&defined(y.clone)?this[h]=y.clone():this[h]=y)}};function propertiesEqual(t,n){const o=t._propertyNames,s=n._propertyNames,c=o.length;if(c!==s.length)return!1;for(let d=0;d<c;++d){const h=o[d];if(s.indexOf(h)===-1||!Property.equals(t[h],n[h]))return!1}return!0}PropertyBag.prototype.equals=function(t){return this===t||t instanceof PropertyBag&&propertiesEqual(this,t)};function createNodeTransformationProperty(t){return new NodeTransformationProperty(t)}function createNodeTransformationPropertyBag(t){return new PropertyBag(t,createNodeTransformationProperty)}function createArticulationStagePropertyBag(t){return new PropertyBag(t)}function ModelGraphics(t){this._definitionChanged=new Event$1,this._show=void 0,this._showSubscription=void 0,this._uri=void 0,this._uriSubscription=void 0,this._scale=void 0,this._scaleSubscription=void 0,this._minimumPixelSize=void 0,this._minimumPixelSizeSubscription=void 0,this._maximumScale=void 0,this._maximumScaleSubscription=void 0,this._incrementallyLoadTextures=void 0,this._incrementallyLoadTexturesSubscription=void 0,this._runAnimations=void 0,this._runAnimationsSubscription=void 0,this._clampAnimations=void 0,this._clampAnimationsSubscription=void 0,this._shadows=void 0,this._shadowsSubscription=void 0,this._heightReference=void 0,this._heightReferenceSubscription=void 0,this._silhouetteColor=void 0,this._silhouetteColorSubscription=void 0,this._silhouetteSize=void 0,this._silhouetteSizeSubscription=void 0,this._color=void 0,this._colorSubscription=void 0,this._colorBlendMode=void 0,this._colorBlendModeSubscription=void 0,this._colorBlendAmount=void 0,this._colorBlendAmountSubscription=void 0,this._imageBasedLightingFactor=void 0,this._imageBasedLightingFactorSubscription=void 0,this._lightColor=void 0,this._lightColorSubscription=void 0,this._distanceDisplayCondition=void 0,this._distanceDisplayConditionSubscription=void 0,this._nodeTransformations=void 0,this._nodeTransformationsSubscription=void 0,this._articulations=void 0,this._articulationsSubscription=void 0,this._clippingPlanes=void 0,this._clippingPlanesSubscription=void 0,this._customShader=void 0,this._customShaderSubscription=void 0,this.merge(defaultValue(t,defaultValue.EMPTY_OBJECT))}Object.defineProperties(ModelGraphics.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:createPropertyDescriptor("show"),uri:createPropertyDescriptor("uri"),scale:createPropertyDescriptor("scale"),minimumPixelSize:createPropertyDescriptor("minimumPixelSize"),maximumScale:createPropertyDescriptor("maximumScale"),incrementallyLoadTextures:createPropertyDescriptor("incrementallyLoadTextures"),runAnimations:createPropertyDescriptor("runAnimations"),clampAnimations:createPropertyDescriptor("clampAnimations"),shadows:createPropertyDescriptor("shadows"),heightReference:createPropertyDescriptor("heightReference"),silhouetteColor:createPropertyDescriptor("silhouetteColor"),silhouetteSize:createPropertyDescriptor("silhouetteSize"),color:createPropertyDescriptor("color"),colorBlendMode:createPropertyDescriptor("colorBlendMode"),colorBlendAmount:createPropertyDescriptor("colorBlendAmount"),imageBasedLightingFactor:createPropertyDescriptor("imageBasedLightingFactor"),lightColor:createPropertyDescriptor("lightColor"),distanceDisplayCondition:createPropertyDescriptor("distanceDisplayCondition"),nodeTransformations:createPropertyDescriptor("nodeTransformations",void 0,createNodeTransformationPropertyBag),articulations:createPropertyDescriptor("articulations",void 0,createArticulationStagePropertyBag),clippingPlanes:createPropertyDescriptor("clippingPlanes"),customShader:createPropertyDescriptor("customShader")}),ModelGraphics.prototype.clone=function(t){return defined(t)?(t.show=this.show,t.uri=this.uri,t.scale=this.scale,t.minimumPixelSize=this.minimumPixelSize,t.maximumScale=this.maximumScale,t.incrementallyLoadTextures=this.incrementallyLoadTextures,t.runAnimations=this.runAnimations,t.clampAnimations=this.clampAnimations,t.heightReference=this._heightReference,t.silhouetteColor=this.silhouetteColor,t.silhouetteSize=this.silhouetteSize,t.color=this.color,t.colorBlendMode=this.colorBlendMode,t.colorBlendAmount=this.colorBlendAmount,t.imageBasedLightingFactor=this.imageBasedLightingFactor,t.lightColor=this.lightColor,t.distanceDisplayCondition=this.distanceDisplayCondition,t.nodeTransformations=this.nodeTransformations,t.articulations=this.articulations,t.clippingPlanes=this.clippingPlanes,t.customShader=this.customShader,t):new ModelGraphics(this)},ModelGraphics.prototype.merge=function(t){if(!defined(t))throw new DeveloperError("source is required.");this.show=defaultValue(this.show,t.show),this.uri=defaultValue(this.uri,t.uri),this.scale=defaultValue(this.scale,t.scale),this.minimumPixelSize=defaultValue(this.minimumPixelSize,t.minimumPixelSize),this.maximumScale=defaultValue(this.maximumScale,t.maximumScale),this.incrementallyLoadTextures=defaultValue(this.incrementallyLoadTextures,t.incrementallyLoadTextures),this.runAnimations=defaultValue(this.runAnimations,t.runAnimations),this.clampAnimations=defaultValue(this.clampAnimations,t.clampAnimations),this.shadows=defaultValue(this.shadows,t.shadows),this.heightReference=defaultValue(this.heightReference,t.heightReference),this.silhouetteColor=defaultValue(this.silhouetteColor,t.silhouetteColor),this.silhouetteSize=defaultValue(this.silhouetteSize,t.silhouetteSize),this.color=defaultValue(this.color,t.color),this.colorBlendMode=defaultValue(this.colorBlendMode,t.colorBlendMode),this.colorBlendAmount=defaultValue(this.colorBlendAmount,t.colorBlendAmount),this.imageBasedLightingFactor=defaultValue(this.imageBasedLightingFactor,t.imageBasedLightingFactor),this.lightColor=defaultValue(this.lightColor,t.lightColor),this.distanceDisplayCondition=defaultValue(this.distanceDisplayCondition,t.distanceDisplayCondition),this.clippingPlanes=defaultValue(this.clippingPlanes,t.clippingPlanes),this.customShader=defaultValue(this.customShader,t.customShader);const n=t.nodeTransformations;if(defined(n)){const s=this.nodeTransformations;defined(s)?s.merge(n):this.nodeTransformations=new PropertyBag(n,createNodeTransformationProperty)}const o=t.articulations;if(defined(o)){const s=this.articulations;defined(s)?s.merge(o):this.articulations=new PropertyBag(o)}};function Cesium3DTilesetGraphics(t){this._definitionChanged=new Event$1,this._show=void 0,this._showSubscription=void 0,this._uri=void 0,this._uriSubscription=void 0,this._maximumScreenSpaceError=void 0,this._maximumScreenSpaceErrorSubscription=void 0,this.merge(defaultValue(t,defaultValue.EMPTY_OBJECT))}Object.defineProperties(Cesium3DTilesetGraphics.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:createPropertyDescriptor("show"),uri:createPropertyDescriptor("uri"),maximumScreenSpaceError:createPropertyDescriptor("maximumScreenSpaceError")}),Cesium3DTilesetGraphics.prototype.clone=function(t){return defined(t)?(t.show=this.show,t.uri=this.uri,t.maximumScreenSpaceError=this.maximumScreenSpaceError,t):new Cesium3DTilesetGraphics(this)},Cesium3DTilesetGraphics.prototype.merge=function(t){if(!defined(t))throw new DeveloperError("source is required.");this.show=defaultValue(this.show,t.show),this.uri=defaultValue(this.uri,t.uri),this.maximumScreenSpaceError=defaultValue(this.maximumScreenSpaceError,t.maximumScreenSpaceError)};function PathGraphics(t){this._definitionChanged=new Event$1,this._show=void 0,this._showSubscription=void 0,this._leadTime=void 0,this._leadTimeSubscription=void 0,this._trailTime=void 0,this._trailTimeSubscription=void 0,this._width=void 0,this._widthSubscription=void 0,this._resolution=void 0,this._resolutionSubscription=void 0,this._material=void 0,this._materialSubscription=void 0,this._distanceDisplayCondition=void 0,this._distanceDisplayConditionSubscription=void 0,this.merge(defaultValue(t,defaultValue.EMPTY_OBJECT))}Object.defineProperties(PathGraphics.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:createPropertyDescriptor("show"),leadTime:createPropertyDescriptor("leadTime"),trailTime:createPropertyDescriptor("trailTime"),width:createPropertyDescriptor("width"),resolution:createPropertyDescriptor("resolution"),material:createMaterialPropertyDescriptor("material"),distanceDisplayCondition:createPropertyDescriptor("distanceDisplayCondition")}),PathGraphics.prototype.clone=function(t){return defined(t)?(t.show=this.show,t.leadTime=this.leadTime,t.trailTime=this.trailTime,t.width=this.width,t.resolution=this.resolution,t.material=this.material,t.distanceDisplayCondition=this.distanceDisplayCondition,t):new PathGraphics(this)},PathGraphics.prototype.merge=function(t){if(!defined(t))throw new DeveloperError("source is required.");this.show=defaultValue(this.show,t.show),this.leadTime=defaultValue(this.leadTime,t.leadTime),this.trailTime=defaultValue(this.trailTime,t.trailTime),this.width=defaultValue(this.width,t.width),this.resolution=defaultValue(this.resolution,t.resolution),this.material=defaultValue(this.material,t.material),this.distanceDisplayCondition=defaultValue(this.distanceDisplayCondition,t.distanceDisplayCondition)};function PlaneGraphics(t){this._definitionChanged=new Event$1,this._show=void 0,this._showSubscription=void 0,this._plane=void 0,this._planeSubscription=void 0,this._dimensions=void 0,this._dimensionsSubscription=void 0,this._fill=void 0,this._fillSubscription=void 0,this._material=void 0,this._materialSubscription=void 0,this._outline=void 0,this._outlineSubscription=void 0,this._outlineColor=void 0,this._outlineColorSubscription=void 0,this._outlineWidth=void 0,this._outlineWidthSubscription=void 0,this._shadows=void 0,this._shadowsSubscription=void 0,this._distanceDisplayCondition=void 0,this._distanceDisplayConditionSubscription=void 0,this.merge(defaultValue(t,defaultValue.EMPTY_OBJECT))}Object.defineProperties(PlaneGraphics.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:createPropertyDescriptor("show"),plane:createPropertyDescriptor("plane"),dimensions:createPropertyDescriptor("dimensions"),fill:createPropertyDescriptor("fill"),material:createMaterialPropertyDescriptor("material"),outline:createPropertyDescriptor("outline"),outlineColor:createPropertyDescriptor("outlineColor"),outlineWidth:createPropertyDescriptor("outlineWidth"),shadows:createPropertyDescriptor("shadows"),distanceDisplayCondition:createPropertyDescriptor("distanceDisplayCondition")}),PlaneGraphics.prototype.clone=function(t){return defined(t)?(t.show=this.show,t.plane=this.plane,t.dimensions=this.dimensions,t.fill=this.fill,t.material=this.material,t.outline=this.outline,t.outlineColor=this.outlineColor,t.outlineWidth=this.outlineWidth,t.shadows=this.shadows,t.distanceDisplayCondition=this.distanceDisplayCondition,t):new PlaneGraphics(this)},PlaneGraphics.prototype.merge=function(t){if(!defined(t))throw new DeveloperError("source is required.");this.show=defaultValue(this.show,t.show),this.plane=defaultValue(this.plane,t.plane),this.dimensions=defaultValue(this.dimensions,t.dimensions),this.fill=defaultValue(this.fill,t.fill),this.material=defaultValue(this.material,t.material),this.outline=defaultValue(this.outline,t.outline),this.outlineColor=defaultValue(this.outlineColor,t.outlineColor),this.outlineWidth=defaultValue(this.outlineWidth,t.outlineWidth),this.shadows=defaultValue(this.shadows,t.shadows),this.distanceDisplayCondition=defaultValue(this.distanceDisplayCondition,t.distanceDisplayCondition)};function PointGraphics(t){this._definitionChanged=new Event$1,this._show=void 0,this._showSubscription=void 0,this._pixelSize=void 0,this._pixelSizeSubscription=void 0,this._heightReference=void 0,this._heightReferenceSubscription=void 0,this._color=void 0,this._colorSubscription=void 0,this._outlineColor=void 0,this._outlineColorSubscription=void 0,this._outlineWidth=void 0,this._outlineWidthSubscription=void 0,this._scaleByDistance=void 0,this._scaleByDistanceSubscription=void 0,this._translucencyByDistance=void 0,this._translucencyByDistanceSubscription=void 0,this._distanceDisplayCondition=void 0,this._distanceDisplayConditionSubscription=void 0,this._disableDepthTestDistance=void 0,this._disableDepthTestDistanceSubscription=void 0,this.merge(defaultValue(t,defaultValue.EMPTY_OBJECT))}Object.defineProperties(PointGraphics.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:createPropertyDescriptor("show"),pixelSize:createPropertyDescriptor("pixelSize"),heightReference:createPropertyDescriptor("heightReference"),color:createPropertyDescriptor("color"),outlineColor:createPropertyDescriptor("outlineColor"),outlineWidth:createPropertyDescriptor("outlineWidth"),scaleByDistance:createPropertyDescriptor("scaleByDistance"),translucencyByDistance:createPropertyDescriptor("translucencyByDistance"),distanceDisplayCondition:createPropertyDescriptor("distanceDisplayCondition"),disableDepthTestDistance:createPropertyDescriptor("disableDepthTestDistance")}),PointGraphics.prototype.clone=function(t){return defined(t)?(t.show=this.show,t.pixelSize=this.pixelSize,t.heightReference=this.heightReference,t.color=this.color,t.outlineColor=this.outlineColor,t.outlineWidth=this.outlineWidth,t.scaleByDistance=this.scaleByDistance,t.translucencyByDistance=this._translucencyByDistance,t.distanceDisplayCondition=this.distanceDisplayCondition,t.disableDepthTestDistance=this.disableDepthTestDistance,t):new PointGraphics(this)},PointGraphics.prototype.merge=function(t){if(!defined(t))throw new DeveloperError("source is required.");this.show=defaultValue(this.show,t.show),this.pixelSize=defaultValue(this.pixelSize,t.pixelSize),this.heightReference=defaultValue(this.heightReference,t.heightReference),this.color=defaultValue(this.color,t.color),this.outlineColor=defaultValue(this.outlineColor,t.outlineColor),this.outlineWidth=defaultValue(this.outlineWidth,t.outlineWidth),this.scaleByDistance=defaultValue(this.scaleByDistance,t.scaleByDistance),this.translucencyByDistance=defaultValue(this._translucencyByDistance,t.translucencyByDistance),this.distanceDisplayCondition=defaultValue(this.distanceDisplayCondition,t.distanceDisplayCondition),this.disableDepthTestDistance=defaultValue(this.disableDepthTestDistance,t.disableDepthTestDistance)};function createPolygonHierarchyProperty(t){return Array.isArray(t)&&(t=new PolygonHierarchy(t)),new ConstantProperty(t)}function PolygonGraphics(t){this._definitionChanged=new Event$1,this._show=void 0,this._showSubscription=void 0,this._hierarchy=void 0,this._hierarchySubscription=void 0,this._height=void 0,this._heightSubscription=void 0,this._heightReference=void 0,this._heightReferenceSubscription=void 0,this._extrudedHeight=void 0,this._extrudedHeightSubscription=void 0,this._extrudedHeightReference=void 0,this._extrudedHeightReferenceSubscription=void 0,this._stRotation=void 0,this._stRotationSubscription=void 0,this._granularity=void 0,this._granularitySubscription=void 0,this._fill=void 0,this._fillSubscription=void 0,this._material=void 0,this._materialSubscription=void 0,this._outline=void 0,this._outlineSubscription=void 0,this._outlineColor=void 0,this._outlineColorSubscription=void 0,this._outlineWidth=void 0,this._outlineWidthSubscription=void 0,this._perPositionHeight=void 0,this._perPositionHeightSubscription=void 0,this._closeTop=void 0,this._closeTopSubscription=void 0,this._closeBottom=void 0,this._closeBottomSubscription=void 0,this._arcType=void 0,this._arcTypeSubscription=void 0,this._shadows=void 0,this._shadowsSubscription=void 0,this._distanceDisplayCondition=void 0,this._distanceDisplayConditionSubscription=void 0,this._classificationType=void 0,this._classificationTypeSubscription=void 0,this._zIndex=void 0,this._zIndexSubscription=void 0,this._textureCoordinates=void 0,this._textureCoordinatesSubscription=void 0,this.merge(defaultValue(t,defaultValue.EMPTY_OBJECT))}Object.defineProperties(PolygonGraphics.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:createPropertyDescriptor("show"),hierarchy:createPropertyDescriptor("hierarchy",void 0,createPolygonHierarchyProperty),height:createPropertyDescriptor("height"),heightReference:createPropertyDescriptor("heightReference"),extrudedHeight:createPropertyDescriptor("extrudedHeight"),extrudedHeightReference:createPropertyDescriptor("extrudedHeightReference"),stRotation:createPropertyDescriptor("stRotation"),granularity:createPropertyDescriptor("granularity"),fill:createPropertyDescriptor("fill"),material:createMaterialPropertyDescriptor("material"),outline:createPropertyDescriptor("outline"),outlineColor:createPropertyDescriptor("outlineColor"),outlineWidth:createPropertyDescriptor("outlineWidth"),perPositionHeight:createPropertyDescriptor("perPositionHeight"),closeTop:createPropertyDescriptor("closeTop"),closeBottom:createPropertyDescriptor("closeBottom"),arcType:createPropertyDescriptor("arcType"),shadows:createPropertyDescriptor("shadows"),distanceDisplayCondition:createPropertyDescriptor("distanceDisplayCondition"),classificationType:createPropertyDescriptor("classificationType"),zIndex:createPropertyDescriptor("zIndex"),textureCoordinates:createPropertyDescriptor("textureCoordinates")}),PolygonGraphics.prototype.clone=function(t){return defined(t)?(t.show=this.show,t.hierarchy=this.hierarchy,t.height=this.height,t.heightReference=this.heightReference,t.extrudedHeight=this.extrudedHeight,t.extrudedHeightReference=this.extrudedHeightReference,t.stRotation=this.stRotation,t.granularity=this.granularity,t.fill=this.fill,t.material=this.material,t.outline=this.outline,t.outlineColor=this.outlineColor,t.outlineWidth=this.outlineWidth,t.perPositionHeight=this.perPositionHeight,t.closeTop=this.closeTop,t.closeBottom=this.closeBottom,t.arcType=this.arcType,t.shadows=this.shadows,t.distanceDisplayCondition=this.distanceDisplayCondition,t.classificationType=this.classificationType,t.zIndex=this.zIndex,t.textureCoordinates=this.textureCoordinates,t):new PolygonGraphics(this)},PolygonGraphics.prototype.merge=function(t){if(!defined(t))throw new DeveloperError("source is required.");this.show=defaultValue(this.show,t.show),this.hierarchy=defaultValue(this.hierarchy,t.hierarchy),this.height=defaultValue(this.height,t.height),this.heightReference=defaultValue(this.heightReference,t.heightReference),this.extrudedHeight=defaultValue(this.extrudedHeight,t.extrudedHeight),this.extrudedHeightReference=defaultValue(this.extrudedHeightReference,t.extrudedHeightReference),this.stRotation=defaultValue(this.stRotation,t.stRotation),this.granularity=defaultValue(this.granularity,t.granularity),this.fill=defaultValue(this.fill,t.fill),this.material=defaultValue(this.material,t.material),this.outline=defaultValue(this.outline,t.outline),this.outlineColor=defaultValue(this.outlineColor,t.outlineColor),this.outlineWidth=defaultValue(this.outlineWidth,t.outlineWidth),this.perPositionHeight=defaultValue(this.perPositionHeight,t.perPositionHeight),this.closeTop=defaultValue(this.closeTop,t.closeTop),this.closeBottom=defaultValue(this.closeBottom,t.closeBottom),this.arcType=defaultValue(this.arcType,t.arcType),this.shadows=defaultValue(this.shadows,t.shadows),this.distanceDisplayCondition=defaultValue(this.distanceDisplayCondition,t.distanceDisplayCondition),this.classificationType=defaultValue(this.classificationType,t.classificationType),this.zIndex=defaultValue(this.zIndex,t.zIndex),this.textureCoordinates=defaultValue(this.textureCoordinates,t.textureCoordinates)};function PolylineGraphics(t){this._definitionChanged=new Event$1,this._show=void 0,this._showSubscription=void 0,this._positions=void 0,this._positionsSubscription=void 0,this._width=void 0,this._widthSubscription=void 0,this._granularity=void 0,this._granularitySubscription=void 0,this._material=void 0,this._materialSubscription=void 0,this._depthFailMaterial=void 0,this._depthFailMaterialSubscription=void 0,this._arcType=void 0,this._arcTypeSubscription=void 0,this._clampToGround=void 0,this._clampToGroundSubscription=void 0,this._shadows=void 0,this._shadowsSubscription=void 0,this._distanceDisplayCondition=void 0,this._distanceDisplayConditionSubscription=void 0,this._classificationType=void 0,this._classificationTypeSubscription=void 0,this._zIndex=void 0,this._zIndexSubscription=void 0,this.merge(defaultValue(t,defaultValue.EMPTY_OBJECT))}Object.defineProperties(PolylineGraphics.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:createPropertyDescriptor("show"),positions:createPropertyDescriptor("positions"),width:createPropertyDescriptor("width"),granularity:createPropertyDescriptor("granularity"),material:createMaterialPropertyDescriptor("material"),depthFailMaterial:createMaterialPropertyDescriptor("depthFailMaterial"),arcType:createPropertyDescriptor("arcType"),clampToGround:createPropertyDescriptor("clampToGround"),shadows:createPropertyDescriptor("shadows"),distanceDisplayCondition:createPropertyDescriptor("distanceDisplayCondition"),classificationType:createPropertyDescriptor("classificationType"),zIndex:createPropertyDescriptor("zIndex")}),PolylineGraphics.prototype.clone=function(t){return defined(t)?(t.show=this.show,t.positions=this.positions,t.width=this.width,t.granularity=this.granularity,t.material=this.material,t.depthFailMaterial=this.depthFailMaterial,t.arcType=this.arcType,t.clampToGround=this.clampToGround,t.shadows=this.shadows,t.distanceDisplayCondition=this.distanceDisplayCondition,t.classificationType=this.classificationType,t.zIndex=this.zIndex,t):new PolylineGraphics(this)},PolylineGraphics.prototype.merge=function(t){if(!defined(t))throw new DeveloperError("source is required.");this.show=defaultValue(this.show,t.show),this.positions=defaultValue(this.positions,t.positions),this.width=defaultValue(this.width,t.width),this.granularity=defaultValue(this.granularity,t.granularity),this.material=defaultValue(this.material,t.material),this.depthFailMaterial=defaultValue(this.depthFailMaterial,t.depthFailMaterial),this.arcType=defaultValue(this.arcType,t.arcType),this.clampToGround=defaultValue(this.clampToGround,t.clampToGround),this.shadows=defaultValue(this.shadows,t.shadows),this.distanceDisplayCondition=defaultValue(this.distanceDisplayCondition,t.distanceDisplayCondition),this.classificationType=defaultValue(this.classificationType,t.classificationType),this.zIndex=defaultValue(this.zIndex,t.zIndex)};function PolylineVolumeGraphics(t){this._definitionChanged=new Event$1,this._show=void 0,this._showSubscription=void 0,this._positions=void 0,this._positionsSubscription=void 0,this._shape=void 0,this._shapeSubscription=void 0,this._cornerType=void 0,this._cornerTypeSubscription=void 0,this._granularity=void 0,this._granularitySubscription=void 0,this._fill=void 0,this._fillSubscription=void 0,this._material=void 0,this._materialSubscription=void 0,this._outline=void 0,this._outlineSubscription=void 0,this._outlineColor=void 0,this._outlineColorSubscription=void 0,this._outlineWidth=void 0,this._outlineWidthSubscription=void 0,this._shadows=void 0,this._shadowsSubscription=void 0,this._distanceDisplayCondition=void 0,this._distanceDisplayConditionSubsription=void 0,this.merge(defaultValue(t,defaultValue.EMPTY_OBJECT))}Object.defineProperties(PolylineVolumeGraphics.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:createPropertyDescriptor("show"),positions:createPropertyDescriptor("positions"),shape:createPropertyDescriptor("shape"),cornerType:createPropertyDescriptor("cornerType"),granularity:createPropertyDescriptor("granularity"),fill:createPropertyDescriptor("fill"),material:createMaterialPropertyDescriptor("material"),outline:createPropertyDescriptor("outline"),outlineColor:createPropertyDescriptor("outlineColor"),outlineWidth:createPropertyDescriptor("outlineWidth"),shadows:createPropertyDescriptor("shadows"),distanceDisplayCondition:createPropertyDescriptor("distanceDisplayCondition")}),PolylineVolumeGraphics.prototype.clone=function(t){return defined(t)?(t.show=this.show,t.positions=this.positions,t.shape=this.shape,t.cornerType=this.cornerType,t.granularity=this.granularity,t.fill=this.fill,t.material=this.material,t.outline=this.outline,t.outlineColor=this.outlineColor,t.outlineWidth=this.outlineWidth,t.shadows=this.shadows,t.distanceDisplayCondition=this.distanceDisplayCondition,t):new PolylineVolumeGraphics(this)},PolylineVolumeGraphics.prototype.merge=function(t){if(!defined(t))throw new DeveloperError("source is required.");this.show=defaultValue(this.show,t.show),this.positions=defaultValue(this.positions,t.positions),this.shape=defaultValue(this.shape,t.shape),this.cornerType=defaultValue(this.cornerType,t.cornerType),this.granularity=defaultValue(this.granularity,t.granularity),this.fill=defaultValue(this.fill,t.fill),this.material=defaultValue(this.material,t.material),this.outline=defaultValue(this.outline,t.outline),this.outlineColor=defaultValue(this.outlineColor,t.outlineColor),this.outlineWidth=defaultValue(this.outlineWidth,t.outlineWidth),this.shadows=defaultValue(this.shadows,t.shadows),this.distanceDisplayCondition=defaultValue(this.distanceDisplayCondition,t.distanceDisplayCondition)};function RectangleGraphics(t){this._definitionChanged=new Event$1,this._show=void 0,this._showSubscription=void 0,this._coordinates=void 0,this._coordinatesSubscription=void 0,this._height=void 0,this._heightSubscription=void 0,this._heightReference=void 0,this._heightReferenceSubscription=void 0,this._extrudedHeight=void 0,this._extrudedHeightSubscription=void 0,this._extrudedHeightReference=void 0,this._extrudedHeightReferenceSubscription=void 0,this._rotation=void 0,this._rotationSubscription=void 0,this._stRotation=void 0,this._stRotationSubscription=void 0,this._granularity=void 0,this._granularitySubscription=void 0,this._fill=void 0,this._fillSubscription=void 0,this._material=void 0,this._materialSubscription=void 0,this._outline=void 0,this._outlineSubscription=void 0,this._outlineColor=void 0,this._outlineColorSubscription=void 0,this._outlineWidth=void 0,this._outlineWidthSubscription=void 0,this._shadows=void 0,this._shadowsSubscription=void 0,this._distanceDisplayCondition=void 0,this._distancedisplayConditionSubscription=void 0,this._classificationType=void 0,this._classificationTypeSubscription=void 0,this._zIndex=void 0,this._zIndexSubscription=void 0,this.merge(defaultValue(t,defaultValue.EMPTY_OBJECT))}Object.defineProperties(RectangleGraphics.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:createPropertyDescriptor("show"),coordinates:createPropertyDescriptor("coordinates"),height:createPropertyDescriptor("height"),heightReference:createPropertyDescriptor("heightReference"),extrudedHeight:createPropertyDescriptor("extrudedHeight"),extrudedHeightReference:createPropertyDescriptor("extrudedHeightReference"),rotation:createPropertyDescriptor("rotation"),stRotation:createPropertyDescriptor("stRotation"),granularity:createPropertyDescriptor("granularity"),fill:createPropertyDescriptor("fill"),material:createMaterialPropertyDescriptor("material"),outline:createPropertyDescriptor("outline"),outlineColor:createPropertyDescriptor("outlineColor"),outlineWidth:createPropertyDescriptor("outlineWidth"),shadows:createPropertyDescriptor("shadows"),distanceDisplayCondition:createPropertyDescriptor("distanceDisplayCondition"),classificationType:createPropertyDescriptor("classificationType"),zIndex:createPropertyDescriptor("zIndex")}),RectangleGraphics.prototype.clone=function(t){return defined(t)?(t.show=this.show,t.coordinates=this.coordinates,t.height=this.height,t.heightReference=this.heightReference,t.extrudedHeight=this.extrudedHeight,t.extrudedHeightReference=this.extrudedHeightReference,t.rotation=this.rotation,t.stRotation=this.stRotation,t.granularity=this.granularity,t.fill=this.fill,t.material=this.material,t.outline=this.outline,t.outlineColor=this.outlineColor,t.outlineWidth=this.outlineWidth,t.shadows=this.shadows,t.distanceDisplayCondition=this.distanceDisplayCondition,t.classificationType=this.classificationType,t.zIndex=this.zIndex,t):new RectangleGraphics(this)},RectangleGraphics.prototype.merge=function(t){if(!defined(t))throw new DeveloperError("source is required.");this.show=defaultValue(this.show,t.show),this.coordinates=defaultValue(this.coordinates,t.coordinates),this.height=defaultValue(this.height,t.height),this.heightReference=defaultValue(this.heightReference,t.heightReference),this.extrudedHeight=defaultValue(this.extrudedHeight,t.extrudedHeight),this.extrudedHeightReference=defaultValue(this.extrudedHeightReference,t.extrudedHeightReference),this.rotation=defaultValue(this.rotation,t.rotation),this.stRotation=defaultValue(this.stRotation,t.stRotation),this.granularity=defaultValue(this.granularity,t.granularity),this.fill=defaultValue(this.fill,t.fill),this.material=defaultValue(this.material,t.material),this.outline=defaultValue(this.outline,t.outline),this.outlineColor=defaultValue(this.outlineColor,t.outlineColor),this.outlineWidth=defaultValue(this.outlineWidth,t.outlineWidth),this.shadows=defaultValue(this.shadows,t.shadows),this.distanceDisplayCondition=defaultValue(this.distanceDisplayCondition,t.distanceDisplayCondition),this.classificationType=defaultValue(this.classificationType,t.classificationType),this.zIndex=defaultValue(this.zIndex,t.zIndex)};function WallGraphics(t){this._definitionChanged=new Event$1,this._show=void 0,this._showSubscription=void 0,this._positions=void 0,this._positionsSubscription=void 0,this._minimumHeights=void 0,this._minimumHeightsSubscription=void 0,this._maximumHeights=void 0,this._maximumHeightsSubscription=void 0,this._granularity=void 0,this._granularitySubscription=void 0,this._fill=void 0,this._fillSubscription=void 0,this._material=void 0,this._materialSubscription=void 0,this._outline=void 0,this._outlineSubscription=void 0,this._outlineColor=void 0,this._outlineColorSubscription=void 0,this._outlineWidth=void 0,this._outlineWidthSubscription=void 0,this._shadows=void 0,this._shadowsSubscription=void 0,this._distanceDisplayCondition=void 0,this._distanceDisplayConditionSubscription=void 0,this.merge(defaultValue(t,defaultValue.EMPTY_OBJECT))}Object.defineProperties(WallGraphics.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:createPropertyDescriptor("show"),positions:createPropertyDescriptor("positions"),minimumHeights:createPropertyDescriptor("minimumHeights"),maximumHeights:createPropertyDescriptor("maximumHeights"),granularity:createPropertyDescriptor("granularity"),fill:createPropertyDescriptor("fill"),material:createMaterialPropertyDescriptor("material"),outline:createPropertyDescriptor("outline"),outlineColor:createPropertyDescriptor("outlineColor"),outlineWidth:createPropertyDescriptor("outlineWidth"),shadows:createPropertyDescriptor("shadows"),distanceDisplayCondition:createPropertyDescriptor("distanceDisplayCondition")}),WallGraphics.prototype.clone=function(t){return defined(t)?(t.show=this.show,t.positions=this.positions,t.minimumHeights=this.minimumHeights,t.maximumHeights=this.maximumHeights,t.granularity=this.granularity,t.fill=this.fill,t.material=this.material,t.outline=this.outline,t.outlineColor=this.outlineColor,t.outlineWidth=this.outlineWidth,t.shadows=this.shadows,t.distanceDisplayCondition=this.distanceDisplayCondition,t):new WallGraphics(this)},WallGraphics.prototype.merge=function(t){if(!defined(t))throw new DeveloperError("source is required.");this.show=defaultValue(this.show,t.show),this.positions=defaultValue(this.positions,t.positions),this.minimumHeights=defaultValue(this.minimumHeights,t.minimumHeights),this.maximumHeights=defaultValue(this.maximumHeights,t.maximumHeights),this.granularity=defaultValue(this.granularity,t.granularity),this.fill=defaultValue(this.fill,t.fill),this.material=defaultValue(this.material,t.material),this.outline=defaultValue(this.outline,t.outline),this.outlineColor=defaultValue(this.outlineColor,t.outlineColor),this.outlineWidth=defaultValue(this.outlineWidth,t.outlineWidth),this.shadows=defaultValue(this.shadows,t.shadows),this.distanceDisplayCondition=defaultValue(this.distanceDisplayCondition,t.distanceDisplayCondition)};const cartoScratch=new Cartographic,ExtraPropertyNames=[];function createConstantPositionProperty(t){return new ConstantPositionProperty(t)}function createPositionPropertyDescriptor(t){return createPropertyDescriptor(t,void 0,createConstantPositionProperty)}function createPropertyTypeDescriptor(t,n){return createPropertyDescriptor(t,void 0,function(o){return o instanceof n?o:new n(o)})}function Entity$1(t){t=defaultValue(t,defaultValue.EMPTY_OBJECT);let n=t.id;defined(n)||(n=createGuid()),this._availability=void 0,this._id=n,this._definitionChanged=new Event$1,this._name=t.name,this._show=defaultValue(t.show,!0),this._parent=void 0,this._propertyNames=["billboard","box","corridor","cylinder","description","ellipse","ellipsoid","label","model","tileset","orientation","path","plane","point","polygon","polyline","polylineVolume","position","properties","rectangle","viewFrom","wall",...ExtraPropertyNames],this._billboard=void 0,this._billboardSubscription=void 0,this._box=void 0,this._boxSubscription=void 0,this._corridor=void 0,this._corridorSubscription=void 0,this._cylinder=void 0,this._cylinderSubscription=void 0,this._description=void 0,this._descriptionSubscription=void 0,this._ellipse=void 0,this._ellipseSubscription=void 0,this._ellipsoid=void 0,this._ellipsoidSubscription=void 0,this._label=void 0,this._labelSubscription=void 0,this._model=void 0,this._modelSubscription=void 0,this._tileset=void 0,this._tilesetSubscription=void 0,this._orientation=void 0,this._orientationSubscription=void 0,this._path=void 0,this._pathSubscription=void 0,this._plane=void 0,this._planeSubscription=void 0,this._point=void 0,this._pointSubscription=void 0,this._polygon=void 0,this._polygonSubscription=void 0,this._polyline=void 0,this._polylineSubscription=void 0,this._polylineVolume=void 0,this._polylineVolumeSubscription=void 0,this._position=void 0,this._positionSubscription=void 0,this._properties=void 0,this._propertiesSubscription=void 0,this._rectangle=void 0,this._rectangleSubscription=void 0,this._viewFrom=void 0,this._viewFromSubscription=void 0,this._wall=void 0,this._wallSubscription=void 0,this._children=[],this.entityCollection=void 0,this.parent=t.parent,this.merge(t)}function updateShow(t,n,o){const s=n.length;for(let c=0;c<s;c++){const d=n[c],h=d._show;(!o&&h)!==(o&&h)&&updateShow(d,d._children,o)}t._definitionChanged.raiseEvent(t,"isShowing",o,!o)}Object.defineProperties(Entity$1.prototype,{availability:createRawPropertyDescriptor("availability"),id:{get:function(){return this._id}},definitionChanged:{get:function(){return this._definitionChanged}},name:createRawPropertyDescriptor("name"),show:{get:function(){return this._show},set:function(t){if(!defined(t))throw new DeveloperError("value is required.");if(t===this._show)return;const n=this.isShowing;this._show=t;const o=this.isShowing;n!==o&&updateShow(this,this._children,o),this._definitionChanged.raiseEvent(this,"show",t,!t)}},isShowing:{get:function(){return this._show&&(!defined(this.entityCollection)||this.entityCollection.show)&&(!defined(this._parent)||this._parent.isShowing)}},parent:{get:function(){return this._parent},set:function(t){const n=this._parent;if(n===t)return;const o=this.isShowing;if(defined(n)){const c=n._children.indexOf(this);n._children.splice(c,1)}this._parent=t,defined(t)&&t._children.push(this);const s=this.isShowing;o!==s&&updateShow(this,this._children,s),this._definitionChanged.raiseEvent(this,"parent",t,n)}},propertyNames:{get:function(){return this._propertyNames}},billboard:createPropertyTypeDescriptor("billboard",BillboardGraphics),box:createPropertyTypeDescriptor("box",BoxGraphics),corridor:createPropertyTypeDescriptor("corridor",CorridorGraphics),cylinder:createPropertyTypeDescriptor("cylinder",CylinderGraphics),description:createPropertyDescriptor("description"),ellipse:createPropertyTypeDescriptor("ellipse",EllipseGraphics),ellipsoid:createPropertyTypeDescriptor("ellipsoid",EllipsoidGraphics),label:createPropertyTypeDescriptor("label",LabelGraphics),model:createPropertyTypeDescriptor("model",ModelGraphics),tileset:createPropertyTypeDescriptor("tileset",Cesium3DTilesetGraphics),orientation:createPropertyDescriptor("orientation"),path:createPropertyTypeDescriptor("path",PathGraphics),plane:createPropertyTypeDescriptor("plane",PlaneGraphics),point:createPropertyTypeDescriptor("point",PointGraphics),polygon:createPropertyTypeDescriptor("polygon",PolygonGraphics),polyline:createPropertyTypeDescriptor("polyline",PolylineGraphics),polylineVolume:createPropertyTypeDescriptor("polylineVolume",PolylineVolumeGraphics),properties:createPropertyTypeDescriptor("properties",PropertyBag),position:createPositionPropertyDescriptor("position"),rectangle:createPropertyTypeDescriptor("rectangle",RectangleGraphics),viewFrom:createPropertyDescriptor("viewFrom"),wall:createPropertyTypeDescriptor("wall",WallGraphics)}),Entity$1.registerEntityType=function(t,n){Object.defineProperties(Entity$1.prototype,{[t]:createPropertyTypeDescriptor(t,n)}),ExtraPropertyNames.includes(t)||ExtraPropertyNames.push(t)},Entity$1.prototype.isAvailable=function(t){if(!defined(t))throw new DeveloperError("time is required.");const n=this._availability;return!defined(n)||n.contains(t)},Entity$1.prototype.addProperty=function(t){const n=this._propertyNames;if(!defined(t))throw new DeveloperError("propertyName is required.");if(n.indexOf(t)!==-1)throw new DeveloperError(`${t} is already a registered property.`);if(t in this)throw new DeveloperError(`${t} is a reserved property name.`);n.push(t),Object.defineProperty(this,t,createRawPropertyDescriptor(t,!0))},Entity$1.prototype.removeProperty=function(t){const o=this._propertyNames.indexOf(t);if(!defined(t))throw new DeveloperError("propertyName is required.");if(o===-1)throw new DeveloperError(`${t} is not a registered property.`);this._propertyNames.splice(o,1),delete this[t]},Entity$1.prototype.merge=function(t){if(!defined(t))throw new DeveloperError("source is required.");this.name=defaultValue(this.name,t.name),this.availability=defaultValue(this.availability,t.availability);const n=this._propertyNames,o=defined(t._propertyNames)?t._propertyNames:Object.keys(t),s=o.length;for(let c=0;c<s;c++){const d=o[c];if(d==="parent"||d==="name"||d==="availability"||d==="children")continue;const h=this[d],p=t[d];!defined(h)&&n.indexOf(d)===-1&&this.addProperty(d),defined(p)&&(defined(h)?defined(h.merge)&&h.merge(p):defined(p.merge)&&defined(p.clone)?this[d]=p.clone():this[d]=p)}};const matrix3Scratch=new Matrix3,positionScratch$2=new Cartesian3,orientationScratch=new Quaternion;Entity$1.prototype.computeModelMatrix=function(t,n){Check.typeOf.object("time",t);const o=Property.getValueOrUndefined(this._position,t,positionScratch$2);if(!defined(o))return;const s=Property.getValueOrUndefined(this._orientation,t,orientationScratch);return defined(s)?n=Matrix4.fromRotationTranslation(Matrix3.fromQuaternion(s,matrix3Scratch),o,n):n=Transforms.eastNorthUpToFixedFrame(o,void 0,n),n},Entity$1.prototype.computeModelMatrixForHeightReference=function(t,n,o,s,c){Check.typeOf.object("time",t);const d=Property.getValueOrDefault(n,t,HeightReference$1.NONE);let h=Property.getValueOrUndefined(this._position,t,positionScratch$2);if(d===HeightReference$1.NONE||!defined(h)||Cartesian3.equalsEpsilon(h,Cartesian3.ZERO,CesiumMath.EPSILON8))return this.computeModelMatrix(t,c);const p=s.cartesianToCartographic(h,cartoScratch);isHeightReferenceClamp(d)?p.height=o:p.height+=o,h=s.cartographicToCartesian(p,h);const y=Property.getValueOrUndefined(this._orientation,t,orientationScratch);return defined(y)?c=Matrix4.fromRotationTranslation(Matrix3.fromQuaternion(y,matrix3Scratch),h,c):c=Transforms.eastNorthUpToFixedFrame(h,void 0,c),c},Entity$1.supportsMaterialsforEntitiesOnTerrain=function(t){return GroundPrimitive.supportsMaterials(t)},Entity$1.supportsPolylinesOnTerrain=function(t){return GroundPolylinePrimitive.isSupported(t)};function CallbackProperty(t,n){this._callback=void 0,this._isConstant=void 0,this._definitionChanged=new Event$1,this.setCallback(t,n)}Object.defineProperties(CallbackProperty.prototype,{isConstant:{get:function(){return this._isConstant}},definitionChanged:{get:function(){return this._definitionChanged}}}),CallbackProperty.prototype.getValue=function(t,n){return this._callback(t,n)},CallbackProperty.prototype.setCallback=function(t,n){if(!defined(t))throw new DeveloperError("callback is required.");if(!defined(n))throw new DeveloperError("isConstant is required.");const o=this._callback!==t||this._isConstant!==n;this._callback=t,this._isConstant=n,o&&this._definitionChanged.raiseEvent(this)},CallbackProperty.prototype.equals=function(t){return this===t||t instanceof CallbackProperty&&this._callback===t._callback&&this._isConstant===t._isConstant};const SceneTransforms={},actualPositionScratch=new Cartesian4(0,0,0,1);let positionCC=new Cartesian4;const scratchViewport=new BoundingRectangle,scratchWindowCoord0=new Cartesian2,scratchWindowCoord1=new Cartesian2;SceneTransforms.wgs84ToWindowCoordinates=function(t,n,o){return SceneTransforms.wgs84WithEyeOffsetToWindowCoordinates(t,n,Cartesian3.ZERO,o)};const scratchCartesian4=new Cartesian4,scratchEyeOffset=new Cartesian3;function worldToClip(t,n,o,s){const c=o.viewMatrix,d=Matrix4.multiplyByVector(c,Cartesian4.fromElements(t.x,t.y,t.z,1,scratchCartesian4),scratchCartesian4),h=Cartesian3.multiplyComponents(n,Cartesian3.normalize(d,scratchEyeOffset),scratchEyeOffset);return d.x+=n.x+h.x,d.y+=n.y+h.y,d.z+=h.z,Matrix4.multiplyByVector(o.frustum.projectionMatrix,d,s)}const scratchMaxCartographic=new Cartographic(Math.PI,CesiumMath.PI_OVER_TWO),scratchProjectedCartesian=new Cartesian3,scratchCameraPosition=new Cartesian3;SceneTransforms.wgs84WithEyeOffsetToWindowCoordinates=function(t,n,o,s){if(!defined(t))throw new DeveloperError("scene is required.");if(!defined(n))throw new DeveloperError("position is required.");const c=t.frameState,d=SceneTransforms.computeActualWgs84Position(c,n,actualPositionScratch);if(!defined(d))return;const h=t.canvas,p=scratchViewport;p.x=0,p.y=0,p.width=h.clientWidth,p.height=h.clientHeight;const y=t.camera;let E=!1;if(c.mode===SceneMode$1.SCENE2D){const L=t.mapProjection,F=scratchMaxCartographic,N=L.project(F,scratchProjectedCartesian),z=Cartesian3.clone(y.position,scratchCameraPosition),oe=y.frustum.clone(),W=Matrix4.computeViewportTransformation(p,0,1,new Matrix4),nt=y.frustum.projectionMatrix,lt=y.positionWC.y,Ee=Cartesian3.fromElements(CesiumMath.sign(lt)*N.x-lt,0,-y.positionWC.x),yt=Transforms.pointToGLWindowCoordinates(nt,W,Ee);if(lt===0||yt.x<=0||yt.x>=h.clientWidth)E=!0;else{if(yt.x>h.clientWidth*.5){p.width=yt.x,y.frustum.right=N.x-lt,positionCC=worldToClip(d,o,y,positionCC),SceneTransforms.clipToGLWindowCoordinates(p,positionCC,scratchWindowCoord0),p.x+=yt.x,y.position.x=-y.position.x;const Ai=y.frustum.right;y.frustum.right=-y.frustum.left,y.frustum.left=-Ai,positionCC=worldToClip(d,o,y,positionCC),SceneTransforms.clipToGLWindowCoordinates(p,positionCC,scratchWindowCoord1)}else{p.x+=yt.x,p.width-=yt.x,y.frustum.left=-N.x-lt,positionCC=worldToClip(d,o,y,positionCC),SceneTransforms.clipToGLWindowCoordinates(p,positionCC,scratchWindowCoord0),p.x=p.x-p.width,y.position.x=-y.position.x;const Ai=y.frustum.left;y.frustum.left=-y.frustum.right,y.frustum.right=-Ai,positionCC=worldToClip(d,o,y,positionCC),SceneTransforms.clipToGLWindowCoordinates(p,positionCC,scratchWindowCoord1)}Cartesian3.clone(z,y.position),y.frustum=oe.clone(),s=Cartesian2.clone(scratchWindowCoord0,s),(s.x<0||s.x>h.clientWidth)&&(s.x=scratchWindowCoord1.x)}}if(c.mode!==SceneMode$1.SCENE2D||E){if(positionCC=worldToClip(d,o,y,positionCC),positionCC.z<0&&!(y.frustum instanceof OrthographicFrustum)&&!(y.frustum instanceof OrthographicOffCenterFrustum))return;s=SceneTransforms.clipToGLWindowCoordinates(p,positionCC,s)}return s.y=h.clientHeight-s.y,s},SceneTransforms.wgs84ToDrawingBufferCoordinates=function(t,n,o){if(o=SceneTransforms.wgs84ToWindowCoordinates(t,n,o),!!defined(o))return SceneTransforms.transformWindowToDrawingBuffer(t,o,o)};const projectedPosition=new Cartesian3,positionInCartographic=new Cartographic;SceneTransforms.computeActualWgs84Position=function(t,n,o){const s=t.mode;if(s===SceneMode$1.SCENE3D)return Cartesian3.clone(n,o);const c=t.mapProjection,d=c.ellipsoid.cartesianToCartographic(n,positionInCartographic);if(!defined(d))return;if(c.project(d,projectedPosition),s===SceneMode$1.COLUMBUS_VIEW)return Cartesian3.fromElements(projectedPosition.z,projectedPosition.x,projectedPosition.y,o);if(s===SceneMode$1.SCENE2D)return Cartesian3.fromElements(0,projectedPosition.x,projectedPosition.y,o);const h=t.morphTime;return Cartesian3.fromElements(CesiumMath.lerp(projectedPosition.z,n.x,h),CesiumMath.lerp(projectedPosition.x,n.y,h),CesiumMath.lerp(projectedPosition.y,n.z,h),o)};const positionNDC=new Cartesian3,positionWC=new Cartesian3,viewportTransform=new Matrix4;SceneTransforms.clipToGLWindowCoordinates=function(t,n,o){return Cartesian3.divideByScalar(n,n.w,positionNDC),Matrix4.computeViewportTransformation(t,0,1,viewportTransform),Matrix4.multiplyByPoint(viewportTransform,positionNDC,positionWC),Cartesian2.fromCartesian3(positionWC,o)},SceneTransforms.transformWindowToDrawingBuffer=function(t,n,o){const s=t.canvas,c=t.drawingBufferWidth/s.clientWidth,d=t.drawingBufferHeight/s.clientHeight;return Cartesian2.fromElements(n.x*c,n.y*d,o)};const scratchNDC=new Cartesian4,scratchWorldCoords=new Cartesian4;SceneTransforms.drawingBufferToWgs84Coordinates=function(t,n,o,s){const d=t.context.uniformState,h=d.currentFrustum,p=h.x,y=h.y;if(t.frameState.useLogDepth){const z=o*d.log2FarDepthFromNearPlusOne,oe=Math.pow(2,z)-1;o=y*(1-p/(oe+p))/(y-p)}const E=t.view.passState.viewport,L=Cartesian4.clone(Cartesian4.UNIT_W,scratchNDC);L.x=(n.x-E.x)/E.width*2-1,L.y=(n.y-E.y)/E.height*2-1,L.z=o*2-1,L.w=1;let F,N=t.camera.frustum;if(defined(N.fovy)){F=Matrix4.multiplyByVector(d.inverseViewProjection,L,scratchWorldCoords);const z=1/F.w;Cartesian3.multiplyByScalar(F,z,F)}else{const z=N.offCenterFrustum;defined(z)&&(N=z),F=scratchWorldCoords,F.x=(L.x*(N.right-N.left)+N.left+N.right)*.5,F.y=(L.y*(N.top-N.bottom)+N.bottom+N.top)*.5,F.z=(L.z*(p-y)-p-y)*.5,F.w=1,F=Matrix4.multiplyByVector(d.inverseView,F,F)}return Cartesian3.fromCartesian4(F,s)};const LabelStyle={FILL:0,OUTLINE:1,FILL_AND_OUTLINE:2},LabelStyle$1=Object.freeze(LabelStyle),Cesium3DTilePass={RENDER:0,PICK:1,SHADOW:2,PRELOAD:3,PRELOAD_FLIGHT:4,REQUEST_RENDER_MODE_DEFER_CHECK:5,MOST_DETAILED_PRELOAD:6,MOST_DETAILED_PICK:7,NUMBER_OF_PASSES:8},passOptions=new Array(Cesium3DTilePass.NUMBER_OF_PASSES);passOptions[Cesium3DTilePass.RENDER]=Object.freeze({pass:Cesium3DTilePass.RENDER,isRender:!0,requestTiles:!0,ignoreCommands:!1}),passOptions[Cesium3DTilePass.PICK]=Object.freeze({pass:Cesium3DTilePass.PICK,isRender:!1,requestTiles:!1,ignoreCommands:!1}),passOptions[Cesium3DTilePass.SHADOW]=Object.freeze({pass:Cesium3DTilePass.SHADOW,isRender:!1,requestTiles:!0,ignoreCommands:!1}),passOptions[Cesium3DTilePass.PRELOAD]=Object.freeze({pass:Cesium3DTilePass.PRELOAD,isRender:!1,requestTiles:!0,ignoreCommands:!0}),passOptions[Cesium3DTilePass.PRELOAD_FLIGHT]=Object.freeze({pass:Cesium3DTilePass.PRELOAD_FLIGHT,isRender:!1,requestTiles:!0,ignoreCommands:!0}),passOptions[Cesium3DTilePass.REQUEST_RENDER_MODE_DEFER_CHECK]=Object.freeze({pass:Cesium3DTilePass.REQUEST_RENDER_MODE_DEFER_CHECK,isRender:!1,requestTiles:!0,ignoreCommands:!0}),passOptions[Cesium3DTilePass.MOST_DETAILED_PRELOAD]=Object.freeze({pass:Cesium3DTilePass.MOST_DETAILED_PRELOAD,isRender:!1,requestTiles:!0,ignoreCommands:!0}),passOptions[Cesium3DTilePass.MOST_DETAILED_PICK]=Object.freeze({pass:Cesium3DTilePass.MOST_DETAILED_PICK,isRender:!1,requestTiles:!1,ignoreCommands:!1}),Cesium3DTilePass.getPassOptions=function(t){return passOptions[t]};const Cesium3DTilePass$1=Object.freeze(Cesium3DTilePass),defaultColor=Color$1.WHITE,defaultGapColor=Color$1.TRANSPARENT,defaultDashLength=16,defaultDashPattern=255;function PolylineDashMaterialProperty(t){t=defaultValue(t,defaultValue.EMPTY_OBJECT),this._definitionChanged=new Event$1,this._color=void 0,this._colorSubscription=void 0,this._gapColor=void 0,this._gapColorSubscription=void 0,this._dashLength=void 0,this._dashLengthSubscription=void 0,this._dashPattern=void 0,this._dashPatternSubscription=void 0,this.color=t.color,this.gapColor=t.gapColor,this.dashLength=t.dashLength,this.dashPattern=t.dashPattern}Object.defineProperties(PolylineDashMaterialProperty.prototype,{isConstant:{get:function(){return Property.isConstant(this._color)&&Property.isConstant(this._gapColor)&&Property.isConstant(this._dashLength)&&Property.isConstant(this._dashPattern)}},definitionChanged:{get:function(){return this._definitionChanged}},color:createPropertyDescriptor("color"),gapColor:createPropertyDescriptor("gapColor"),dashLength:createPropertyDescriptor("dashLength"),dashPattern:createPropertyDescriptor("dashPattern")}),PolylineDashMaterialProperty.prototype.getType=function(t){return"PolylineDash"},PolylineDashMaterialProperty.prototype.getValue=function(t,n){return defined(n)||(n={}),n.color=Property.getValueOrClonedDefault(this._color,t,defaultColor,n.color),n.gapColor=Property.getValueOrClonedDefault(this._gapColor,t,defaultGapColor,n.gapColor),n.dashLength=Property.getValueOrDefault(this._dashLength,t,defaultDashLength,n.dashLength),n.dashPattern=Property.getValueOrDefault(this._dashPattern,t,defaultDashPattern,n.dashPattern),n},PolylineDashMaterialProperty.prototype.equals=function(t){return this===t||t instanceof PolylineDashMaterialProperty&&Property.equals(this._color,t._color)&&Property.equals(this._gapColor,t._gapColor)&&Property.equals(this._dashLength,t._dashLength)&&Property.equals(this._dashPattern,t._dashPattern)};function DiscardEmptyTileImagePolicy(t){}DiscardEmptyTileImagePolicy.prototype.isReady=function(){return!0},DiscardEmptyTileImagePolicy.prototype.shouldDiscardImage=function(t){return DiscardEmptyTileImagePolicy.EMPTY_IMAGE===t};let emptyImage;Object.defineProperties(DiscardEmptyTileImagePolicy,{EMPTY_IMAGE:{get:function(){return defined(emptyImage)||(emptyImage=new Image,emptyImage.src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR42mNkYAAAAAYAAjCB0C8AAAAASUVORK5CYII="),emptyImage}}});function Cesium3DTilePassState(t){Check.typeOf.object("options",t),Check.typeOf.number("options.pass",t.pass),this.pass=t.pass,this.commandList=t.commandList,this.camera=t.camera,this.cullingVolume=t.cullingVolume,this.ready=!1}var __create=Object.create,__defProp$1=Object.defineProperty,__getOwnPropDesc=Object.getOwnPropertyDescriptor,__getOwnPropNames=Object.getOwnPropertyNames,__getProtoOf=Object.getPrototypeOf,__hasOwnProp$1=Object.prototype.hasOwnProperty,__markAsModule=t=>__defProp$1(t,"__esModule",{value:!0}),__commonJS=(t,n)=>function(){return n||(0,t[Object.keys(t)[0]])((n={exports:{}}).exports,n),n.exports},__reExport=(t,n,o)=>{if(n&&typeof n=="object"||typeof n=="function")for(let s of __getOwnPropNames(n))!__hasOwnProp$1.call(t,s)&&s!=="default"&&__defProp$1(t,s,{get:()=>n[s],enumerable:!(o=__getOwnPropDesc(n,s))||o.enumerable});return t},__toModule=t=>__reExport(__markAsModule(__defProp$1(t!=null?__create(__getProtoOf(t)):{},"default",t&&t.__esModule&&"default"in t?{get:()=>t.default,enumerable:!0}:{value:t,enumerable:!0})),t),__async=(t,n,o)=>new Promise((s,c)=>{var d=y=>{try{p(o.next(y))}catch(E){c(E)}},h=y=>{try{p(o.throw(y))}catch(E){c(E)}},p=y=>y.done?s(y.value):Promise.resolve(y.value).then(d,h);p((o=o.apply(t,n)).next())}),require_point_geometry=__commonJS({"node_modules/@mapbox/point-geometry/index.js"(t,n){n.exports=o;function o(s,c){this.x=s,this.y=c}o.prototype={clone:function(){return new o(this.x,this.y)},add:function(s){return this.clone()._add(s)},sub:function(s){return this.clone()._sub(s)},multByPoint:function(s){return this.clone()._multByPoint(s)},divByPoint:function(s){return this.clone()._divByPoint(s)},mult:function(s){return this.clone()._mult(s)},div:function(s){return this.clone()._div(s)},rotate:function(s){return this.clone()._rotate(s)},rotateAround:function(s,c){return this.clone()._rotateAround(s,c)},matMult:function(s){return this.clone()._matMult(s)},unit:function(){return this.clone()._unit()},perp:function(){return this.clone()._perp()},round:function(){return this.clone()._round()},mag:function(){return Math.sqrt(this.x*this.x+this.y*this.y)},equals:function(s){return this.x===s.x&&this.y===s.y},dist:function(s){return Math.sqrt(this.distSqr(s))},distSqr:function(s){var c=s.x-this.x,d=s.y-this.y;return c*c+d*d},angle:function(){return Math.atan2(this.y,this.x)},angleTo:function(s){return Math.atan2(this.y-s.y,this.x-s.x)},angleWith:function(s){return this.angleWithSep(s.x,s.y)},angleWithSep:function(s,c){return Math.atan2(this.x*c-this.y*s,this.x*s+this.y*c)},_matMult:function(s){var c=s[0]*this.x+s[1]*this.y,d=s[2]*this.x+s[3]*this.y;return this.x=c,this.y=d,this},_add:function(s){return this.x+=s.x,this.y+=s.y,this},_sub:function(s){return this.x-=s.x,this.y-=s.y,this},_mult:function(s){return this.x*=s,this.y*=s,this},_div:function(s){return this.x/=s,this.y/=s,this},_multByPoint:function(s){return this.x*=s.x,this.y*=s.y,this},_divByPoint:function(s){return this.x/=s.x,this.y/=s.y,this},_unit:function(){return this._div(this.mag()),this},_perp:function(){var s=this.y;return this.y=this.x,this.x=-s,this},_rotate:function(s){var c=Math.cos(s),d=Math.sin(s),h=c*this.x-d*this.y,p=d*this.x+c*this.y;return this.x=h,this.y=p,this},_rotateAround:function(s,c){var d=Math.cos(s),h=Math.sin(s),p=c.x+d*(this.x-c.x)-h*(this.y-c.y),y=c.y+h*(this.x-c.x)+d*(this.y-c.y);return this.x=p,this.y=y,this},_round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}},o.convert=function(s){return s instanceof o?s:Array.isArray(s)?new o(s[0],s[1]):s}}}),require_vectortilefeature=__commonJS({"node_modules/@mapbox/vector-tile/lib/vectortilefeature.js"(t,n){var o=require_point_geometry();n.exports=s;function s(y,E,L,F,N){this.properties={},this.extent=L,this.type=0,this._pbf=y,this._geometry=-1,this._keys=F,this._values=N,y.readFields(c,this,E)}function c(y,E,L){y==1?E.id=L.readVarint():y==2?d(L,E):y==3?E.type=L.readVarint():y==4&&(E._geometry=L.pos)}function d(y,E){for(var L=y.readVarint()+y.pos;y.pos<L;){var F=E._keys[y.readVarint()],N=E._values[y.readVarint()];E.properties[F]=N}}s.types=["Unknown","Point","LineString","Polygon"],s.prototype.loadGeometry=function(){var y=this._pbf;y.pos=this._geometry;for(var E=y.readVarint()+y.pos,L=1,F=0,N=0,z=0,oe=[],W;y.pos<E;){if(F<=0){var nt=y.readVarint();L=nt&7,F=nt>>3}if(F--,L===1||L===2)N+=y.readSVarint(),z+=y.readSVarint(),L===1&&(W&&oe.push(W),W=[]),W.push(new o(N,z));else if(L===7)W&&W.push(W[0].clone());else throw new Error("unknown command "+L)}return W&&oe.push(W),oe},s.prototype.bbox=function(){var y=this._pbf;y.pos=this._geometry;for(var E=y.readVarint()+y.pos,L=1,F=0,N=0,z=0,oe=1/0,W=-1/0,nt=1/0,lt=-1/0;y.pos<E;){if(F<=0){var Ee=y.readVarint();L=Ee&7,F=Ee>>3}if(F--,L===1||L===2)N+=y.readSVarint(),z+=y.readSVarint(),N<oe&&(oe=N),N>W&&(W=N),z<nt&&(nt=z),z>lt&&(lt=z);else if(L!==7)throw new Error("unknown command "+L)}return[oe,nt,W,lt]},s.prototype.toGeoJSON=function(y,E,L){var F=this.extent*Math.pow(2,L),N=this.extent*y,z=this.extent*E,oe=this.loadGeometry(),W=s.types[this.type],nt,lt;function Ee(zi){for(var ha=0;ha<zi.length;ha++){var ba=zi[ha],Sa=180-(ba.y+z)*360/F;zi[ha]=[(ba.x+N)*360/F-180,360/Math.PI*Math.atan(Math.exp(Sa*Math.PI/180))-90]}}switch(this.type){case 1:var yt=[];for(nt=0;nt<oe.length;nt++)yt[nt]=oe[nt][0];oe=yt,Ee(oe);break;case 2:for(nt=0;nt<oe.length;nt++)Ee(oe[nt]);break;case 3:for(oe=h(oe),nt=0;nt<oe.length;nt++)for(lt=0;lt<oe[nt].length;lt++)Ee(oe[nt][lt]);break}oe.length===1?oe=oe[0]:W="Multi"+W;var Ai={type:"Feature",geometry:{type:W,coordinates:oe},properties:this.properties};return"id"in this&&(Ai.id=this.id),Ai};function h(y){var E=y.length;if(E<=1)return[y];for(var L=[],F,N,z=0;z<E;z++){var oe=p(y[z]);oe!==0&&(N===void 0&&(N=oe<0),N===oe<0?(F&&L.push(F),F=[y[z]]):F.push(y[z]))}return F&&L.push(F),L}function p(y){for(var E=0,L=0,F=y.length,N=F-1,z,oe;L<F;N=L++)z=y[L],oe=y[N],E+=(oe.x-z.x)*(z.y+oe.y);return E}}}),require_vectortilelayer=__commonJS({"node_modules/@mapbox/vector-tile/lib/vectortilelayer.js"(t,n){var o=require_vectortilefeature();n.exports=s;function s(h,p){this.version=1,this.name=null,this.extent=4096,this.length=0,this._pbf=h,this._keys=[],this._values=[],this._features=[],h.readFields(c,this,p),this.length=this._features.length}function c(h,p,y){h===15?p.version=y.readVarint():h===1?p.name=y.readString():h===5?p.extent=y.readVarint():h===2?p._features.push(y.pos):h===3?p._keys.push(y.readString()):h===4&&p._values.push(d(y))}function d(h){for(var p=null,y=h.readVarint()+h.pos;h.pos<y;){var E=h.readVarint()>>3;p=E===1?h.readString():E===2?h.readFloat():E===3?h.readDouble():E===4?h.readVarint64():E===5?h.readVarint():E===6?h.readSVarint():E===7?h.readBoolean():null}return p}s.prototype.feature=function(h){if(h<0||h>=this._features.length)throw new Error("feature index out of bounds");this._pbf.pos=this._features[h];var p=this._pbf.readVarint()+this._pbf.pos;return new o(this._pbf,p,this.extent,this._keys,this._values)}}}),require_vectortile=__commonJS({"node_modules/@mapbox/vector-tile/lib/vectortile.js"(t,n){var o=require_vectortilelayer();n.exports=s;function s(d,h){this.layers=d.readFields(c,{},h)}function c(d,h,p){if(d===3){var y=new o(p,p.readVarint()+p.pos);y.length&&(h[y.name]=y)}}}}),require_vector_tile=__commonJS({"node_modules/@mapbox/vector-tile/index.js"(t,n){n.exports.VectorTile=require_vectortile(),n.exports.VectorTileFeature=require_vectortilefeature(),n.exports.VectorTileLayer=require_vectortilelayer()}}),require_ieee754=__commonJS({"node_modules/ieee754/index.js"(t){t.read=function(n,o,s,c,d){var h,p,y=d*8-c-1,E=(1<<y)-1,L=E>>1,F=-7,N=s?d-1:0,z=s?-1:1,oe=n[o+N];for(N+=z,h=oe&(1<<-F)-1,oe>>=-F,F+=y;F>0;h=h*256+n[o+N],N+=z,F-=8);for(p=h&(1<<-F)-1,h>>=-F,F+=c;F>0;p=p*256+n[o+N],N+=z,F-=8);if(h===0)h=1-L;else{if(h===E)return p?NaN:(oe?-1:1)*(1/0);p=p+Math.pow(2,c),h=h-L}return(oe?-1:1)*p*Math.pow(2,h-c)},t.write=function(n,o,s,c,d,h){var p,y,E,L=h*8-d-1,F=(1<<L)-1,N=F>>1,z=d===23?Math.pow(2,-24)-Math.pow(2,-77):0,oe=c?0:h-1,W=c?1:-1,nt=o<0||o===0&&1/o<0?1:0;for(o=Math.abs(o),isNaN(o)||o===1/0?(y=isNaN(o)?1:0,p=F):(p=Math.floor(Math.log(o)/Math.LN2),o*(E=Math.pow(2,-p))<1&&(p--,E*=2),p+N>=1?o+=z/E:o+=z*Math.pow(2,1-N),o*E>=2&&(p++,E/=2),p+N>=F?(y=0,p=F):p+N>=1?(y=(o*E-1)*Math.pow(2,d),p=p+N):(y=o*Math.pow(2,N-1)*Math.pow(2,d),p=0));d>=8;n[s+oe]=y&255,oe+=W,y/=256,d-=8);for(p=p<<d|y,L+=d;L>0;n[s+oe]=p&255,oe+=W,p/=256,L-=8);n[s+oe-W]|=nt*128}}}),require_pbf=__commonJS({"node_modules/pbf/index.js"(t,n){n.exports=s;var o=require_ieee754();function s(mt){this.buf=ArrayBuffer.isView&&ArrayBuffer.isView(mt)?mt:new Uint8Array(mt||0),this.pos=0,this.type=0,this.length=this.buf.length}s.Varint=0,s.Fixed64=1,s.Bytes=2,s.Fixed32=5;var c=65536*65536,d=1/c,h=12,p=typeof TextDecoder>"u"?null:new TextDecoder("utf8");s.prototype={destroy:function(){this.buf=null},readFields:function(mt,fa,Ra){for(Ra=Ra||this.length;this.pos<Ra;){var sl=this.readVarint(),Zd=sl>>3,Xd=this.pos;this.type=sl&7,mt(Zd,fa,this),this.pos===Xd&&this.skip(sl)}return fa},readMessage:function(mt,fa){return this.readFields(mt,fa,this.readVarint()+this.pos)},readFixed32:function(){var mt=Sa(this.buf,this.pos);return this.pos+=4,mt},readSFixed32:function(){var mt=ms(this.buf,this.pos);return this.pos+=4,mt},readFixed64:function(){var mt=Sa(this.buf,this.pos)+Sa(this.buf,this.pos+4)*c;return this.pos+=8,mt},readSFixed64:function(){var mt=Sa(this.buf,this.pos)+ms(this.buf,this.pos+4)*c;return this.pos+=8,mt},readFloat:function(){var mt=o.read(this.buf,this.pos,!0,23,4);return this.pos+=4,mt},readDouble:function(){var mt=o.read(this.buf,this.pos,!0,52,8);return this.pos+=8,mt},readVarint:function(mt){var fa=this.buf,Ra,sl;return sl=fa[this.pos++],Ra=sl&127,sl<128||(sl=fa[this.pos++],Ra|=(sl&127)<<7,sl<128)||(sl=fa[this.pos++],Ra|=(sl&127)<<14,sl<128)||(sl=fa[this.pos++],Ra|=(sl&127)<<21,sl<128)?Ra:(sl=fa[this.pos],Ra|=(sl&15)<<28,y(Ra,mt,this))},readVarint64:function(){return this.readVarint(!0)},readSVarint:function(){var mt=this.readVarint();return mt%2===1?(mt+1)/-2:mt/2},readBoolean:function(){return!!this.readVarint()},readString:function(){var mt=this.readVarint()+this.pos,fa=this.pos;return this.pos=mt,mt-fa>=h&&p?Wa(this.buf,fa,mt):Wc(this.buf,fa,mt)},readBytes:function(){var mt=this.readVarint()+this.pos,fa=this.buf.subarray(this.pos,mt);return this.pos=mt,fa},readPackedVarint:function(mt,fa){if(this.type!==s.Bytes)return mt.push(this.readVarint(fa));var Ra=E(this);for(mt=mt||[];this.pos<Ra;)mt.push(this.readVarint(fa));return mt},readPackedSVarint:function(mt){if(this.type!==s.Bytes)return mt.push(this.readSVarint());var fa=E(this);for(mt=mt||[];this.pos<fa;)mt.push(this.readSVarint());return mt},readPackedBoolean:function(mt){if(this.type!==s.Bytes)return mt.push(this.readBoolean());var fa=E(this);for(mt=mt||[];this.pos<fa;)mt.push(this.readBoolean());return mt},readPackedFloat:function(mt){if(this.type!==s.Bytes)return mt.push(this.readFloat());var fa=E(this);for(mt=mt||[];this.pos<fa;)mt.push(this.readFloat());return mt},readPackedDouble:function(mt){if(this.type!==s.Bytes)return mt.push(this.readDouble());var fa=E(this);for(mt=mt||[];this.pos<fa;)mt.push(this.readDouble());return mt},readPackedFixed32:function(mt){if(this.type!==s.Bytes)return mt.push(this.readFixed32());var fa=E(this);for(mt=mt||[];this.pos<fa;)mt.push(this.readFixed32());return mt},readPackedSFixed32:function(mt){if(this.type!==s.Bytes)return mt.push(this.readSFixed32());var fa=E(this);for(mt=mt||[];this.pos<fa;)mt.push(this.readSFixed32());return mt},readPackedFixed64:function(mt){if(this.type!==s.Bytes)return mt.push(this.readFixed64());var fa=E(this);for(mt=mt||[];this.pos<fa;)mt.push(this.readFixed64());return mt},readPackedSFixed64:function(mt){if(this.type!==s.Bytes)return mt.push(this.readSFixed64());var fa=E(this);for(mt=mt||[];this.pos<fa;)mt.push(this.readSFixed64());return mt},skip:function(mt){var fa=mt&7;if(fa===s.Varint)for(;this.buf[this.pos++]>127;);else if(fa===s.Bytes)this.pos=this.readVarint()+this.pos;else if(fa===s.Fixed32)this.pos+=4;else if(fa===s.Fixed64)this.pos+=8;else throw new Error("Unimplemented type: "+fa)},writeTag:function(mt,fa){this.writeVarint(mt<<3|fa)},realloc:function(mt){for(var fa=this.length||16;fa<this.pos+mt;)fa*=2;if(fa!==this.length){var Ra=new Uint8Array(fa);Ra.set(this.buf),this.buf=Ra,this.length=fa}},finish:function(){return this.length=this.pos,this.pos=0,this.buf.subarray(0,this.length)},writeFixed32:function(mt){this.realloc(4),ya(this.buf,mt,this.pos),this.pos+=4},writeSFixed32:function(mt){this.realloc(4),ya(this.buf,mt,this.pos),this.pos+=4},writeFixed64:function(mt){this.realloc(8),ya(this.buf,mt&-1,this.pos),ya(this.buf,Math.floor(mt*d),this.pos+4),this.pos+=8},writeSFixed64:function(mt){this.realloc(8),ya(this.buf,mt&-1,this.pos),ya(this.buf,Math.floor(mt*d),this.pos+4),this.pos+=8},writeVarint:function(mt){if(mt=+mt||0,mt>268435455||mt<0){F(mt,this);return}this.realloc(4),this.buf[this.pos++]=mt&127|(mt>127?128:0),!(mt<=127)&&(this.buf[this.pos++]=(mt>>>=7)&127|(mt>127?128:0),!(mt<=127)&&(this.buf[this.pos++]=(mt>>>=7)&127|(mt>127?128:0),!(mt<=127)&&(this.buf[this.pos++]=mt>>>7&127)))},writeSVarint:function(mt){this.writeVarint(mt<0?-mt*2-1:mt*2)},writeBoolean:function(mt){this.writeVarint(!!mt)},writeString:function(mt){mt=String(mt),this.realloc(mt.length*4),this.pos++;var fa=this.pos;this.pos=pi(this.buf,mt,this.pos);var Ra=this.pos-fa;Ra>=128&&oe(fa,Ra,this),this.pos=fa-1,this.writeVarint(Ra),this.pos+=Ra},writeFloat:function(mt){this.realloc(4),o.write(this.buf,mt,this.pos,!0,23,4),this.pos+=4},writeDouble:function(mt){this.realloc(8),o.write(this.buf,mt,this.pos,!0,52,8),this.pos+=8},writeBytes:function(mt){var fa=mt.length;this.writeVarint(fa),this.realloc(fa);for(var Ra=0;Ra<fa;Ra++)this.buf[this.pos++]=mt[Ra]},writeRawMessage:function(mt,fa){this.pos++;var Ra=this.pos;mt(fa,this);var sl=this.pos-Ra;sl>=128&&oe(Ra,sl,this),this.pos=Ra-1,this.writeVarint(sl),this.pos+=sl},writeMessage:function(mt,fa,Ra){this.writeTag(mt,s.Bytes),this.writeRawMessage(fa,Ra)},writePackedVarint:function(mt,fa){fa.length&&this.writeMessage(mt,W,fa)},writePackedSVarint:function(mt,fa){fa.length&&this.writeMessage(mt,nt,fa)},writePackedBoolean:function(mt,fa){fa.length&&this.writeMessage(mt,yt,fa)},writePackedFloat:function(mt,fa){fa.length&&this.writeMessage(mt,lt,fa)},writePackedDouble:function(mt,fa){fa.length&&this.writeMessage(mt,Ee,fa)},writePackedFixed32:function(mt,fa){fa.length&&this.writeMessage(mt,Ai,fa)},writePackedSFixed32:function(mt,fa){fa.length&&this.writeMessage(mt,zi,fa)},writePackedFixed64:function(mt,fa){fa.length&&this.writeMessage(mt,ha,fa)},writePackedSFixed64:function(mt,fa){fa.length&&this.writeMessage(mt,ba,fa)},writeBytesField:function(mt,fa){this.writeTag(mt,s.Bytes),this.writeBytes(fa)},writeFixed32Field:function(mt,fa){this.writeTag(mt,s.Fixed32),this.writeFixed32(fa)},writeSFixed32Field:function(mt,fa){this.writeTag(mt,s.Fixed32),this.writeSFixed32(fa)},writeFixed64Field:function(mt,fa){this.writeTag(mt,s.Fixed64),this.writeFixed64(fa)},writeSFixed64Field:function(mt,fa){this.writeTag(mt,s.Fixed64),this.writeSFixed64(fa)},writeVarintField:function(mt,fa){this.writeTag(mt,s.Varint),this.writeVarint(fa)},writeSVarintField:function(mt,fa){this.writeTag(mt,s.Varint),this.writeSVarint(fa)},writeStringField:function(mt,fa){this.writeTag(mt,s.Bytes),this.writeString(fa)},writeFloatField:function(mt,fa){this.writeTag(mt,s.Fixed32),this.writeFloat(fa)},writeDoubleField:function(mt,fa){this.writeTag(mt,s.Fixed64),this.writeDouble(fa)},writeBooleanField:function(mt,fa){this.writeVarintField(mt,!!fa)}};function y(mt,fa,Ra){var sl=Ra.buf,Zd,Xd;if(Xd=sl[Ra.pos++],Zd=(Xd&112)>>4,Xd<128||(Xd=sl[Ra.pos++],Zd|=(Xd&127)<<3,Xd<128)||(Xd=sl[Ra.pos++],Zd|=(Xd&127)<<10,Xd<128)||(Xd=sl[Ra.pos++],Zd|=(Xd&127)<<17,Xd<128)||(Xd=sl[Ra.pos++],Zd|=(Xd&127)<<24,Xd<128)||(Xd=sl[Ra.pos++],Zd|=(Xd&1)<<31,Xd<128))return L(mt,Zd,fa);throw new Error("Expected varint not more than 10 bytes")}function E(mt){return mt.type===s.Bytes?mt.readVarint()+mt.pos:mt.pos+1}function L(mt,fa,Ra){return Ra?fa*4294967296+(mt>>>0):(fa>>>0)*4294967296+(mt>>>0)}function F(mt,fa){var Ra,sl;if(mt>=0?(Ra=mt%4294967296|0,sl=mt/4294967296|0):(Ra=~(-mt%4294967296),sl=~(-mt/4294967296),Ra^4294967295?Ra=Ra+1|0:(Ra=0,sl=sl+1|0)),mt>=18446744073709552e3||mt<-18446744073709552e3)throw new Error("Given varint doesn't fit into 10 bytes");fa.realloc(10),N(Ra,sl,fa),z(sl,fa)}function N(mt,fa,Ra){Ra.buf[Ra.pos++]=mt&127|128,mt>>>=7,Ra.buf[Ra.pos++]=mt&127|128,mt>>>=7,Ra.buf[Ra.pos++]=mt&127|128,mt>>>=7,Ra.buf[Ra.pos++]=mt&127|128,mt>>>=7,Ra.buf[Ra.pos]=mt&127}function z(mt,fa){var Ra=(mt&7)<<4;fa.buf[fa.pos++]|=Ra|((mt>>>=3)?128:0),mt&&(fa.buf[fa.pos++]=mt&127|((mt>>>=7)?128:0),mt&&(fa.buf[fa.pos++]=mt&127|((mt>>>=7)?128:0),mt&&(fa.buf[fa.pos++]=mt&127|((mt>>>=7)?128:0),mt&&(fa.buf[fa.pos++]=mt&127|((mt>>>=7)?128:0),mt&&(fa.buf[fa.pos++]=mt&127)))))}function oe(mt,fa,Ra){var sl=fa<=16383?1:fa<=2097151?2:fa<=268435455?3:Math.floor(Math.log(fa)/(Math.LN2*7));Ra.realloc(sl);for(var Zd=Ra.pos-1;Zd>=mt;Zd--)Ra.buf[Zd+sl]=Ra.buf[Zd]}function W(mt,fa){for(var Ra=0;Ra<mt.length;Ra++)fa.writeVarint(mt[Ra])}function nt(mt,fa){for(var Ra=0;Ra<mt.length;Ra++)fa.writeSVarint(mt[Ra])}function lt(mt,fa){for(var Ra=0;Ra<mt.length;Ra++)fa.writeFloat(mt[Ra])}function Ee(mt,fa){for(var Ra=0;Ra<mt.length;Ra++)fa.writeDouble(mt[Ra])}function yt(mt,fa){for(var Ra=0;Ra<mt.length;Ra++)fa.writeBoolean(mt[Ra])}function Ai(mt,fa){for(var Ra=0;Ra<mt.length;Ra++)fa.writeFixed32(mt[Ra])}function zi(mt,fa){for(var Ra=0;Ra<mt.length;Ra++)fa.writeSFixed32(mt[Ra])}function ha(mt,fa){for(var Ra=0;Ra<mt.length;Ra++)fa.writeFixed64(mt[Ra])}function ba(mt,fa){for(var Ra=0;Ra<mt.length;Ra++)fa.writeSFixed64(mt[Ra])}function Sa(mt,fa){return(mt[fa]|mt[fa+1]<<8|mt[fa+2]<<16)+mt[fa+3]*16777216}function ya(mt,fa,Ra){mt[Ra]=fa,mt[Ra+1]=fa>>>8,mt[Ra+2]=fa>>>16,mt[Ra+3]=fa>>>24}function ms(mt,fa){return(mt[fa]|mt[fa+1]<<8|mt[fa+2]<<16)+(mt[fa+3]<<24)}function Wc(mt,fa,Ra){for(var sl="",Zd=fa;Zd<Ra;){var Xd=mt[Zd],pu=null,gl=Xd>239?4:Xd>223?3:Xd>191?2:1;if(Zd+gl>Ra)break;var md,ef,nf;gl===1?Xd<128&&(pu=Xd):gl===2?(md=mt[Zd+1],(md&192)===128&&(pu=(Xd&31)<<6|md&63,pu<=127&&(pu=null))):gl===3?(md=mt[Zd+1],ef=mt[Zd+2],(md&192)===128&&(ef&192)===128&&(pu=(Xd&15)<<12|(md&63)<<6|ef&63,(pu<=2047||pu>=55296&&pu<=57343)&&(pu=null))):gl===4&&(md=mt[Zd+1],ef=mt[Zd+2],nf=mt[Zd+3],(md&192)===128&&(ef&192)===128&&(nf&192)===128&&(pu=(Xd&15)<<18|(md&63)<<12|(ef&63)<<6|nf&63,(pu<=65535||pu>=1114112)&&(pu=null))),pu===null?(pu=65533,gl=1):pu>65535&&(pu-=65536,sl+=String.fromCharCode(pu>>>10&1023|55296),pu=56320|pu&1023),sl+=String.fromCharCode(pu),Zd+=gl}return sl}function Wa(mt,fa,Ra){return p.decode(mt.subarray(fa,Ra))}function pi(mt,fa,Ra){for(var sl=0,Zd,Xd;sl<fa.length;sl++){if(Zd=fa.charCodeAt(sl),Zd>55295&&Zd<57344)if(Xd)if(Zd<56320){mt[Ra++]=239,mt[Ra++]=191,mt[Ra++]=189,Xd=Zd;continue}else Zd=Xd-55296<<10|Zd-56320|65536,Xd=null;else{Zd>56319||sl+1===fa.length?(mt[Ra++]=239,mt[Ra++]=191,mt[Ra++]=189):Xd=Zd;continue}else Xd&&(mt[Ra++]=239,mt[Ra++]=191,mt[Ra++]=189,Xd=null);Zd<128?mt[Ra++]=Zd:(Zd<2048?mt[Ra++]=Zd>>6|192:(Zd<65536?mt[Ra++]=Zd>>12|224:(mt[Ra++]=Zd>>18|240,mt[Ra++]=Zd>>12&63|128),mt[Ra++]=Zd>>6&63|128),mt[Ra++]=Zd&63|128)}return Ra}}}),require_rbush_min=__commonJS({"node_modules/rbush/rbush.min.js"(t,n){(function(o,s){typeof t=="object"&&typeof n<"u"?n.exports=s():typeof define=="function"&&define.amd?define(s):(o=o||self).RBush=s()})(t,function(){function o(Ee,yt,Ai,zi,ha){(function ba(Sa,ya,ms,Wc,Wa){for(;Wc>ms;){if(Wc-ms>600){var pi=Wc-ms+1,mt=ya-ms+1,fa=Math.log(pi),Ra=.5*Math.exp(2*fa/3),sl=.5*Math.sqrt(fa*Ra*(pi-Ra)/pi)*(mt-pi/2<0?-1:1),Zd=Math.max(ms,Math.floor(ya-mt*Ra/pi+sl)),Xd=Math.min(Wc,Math.floor(ya+(pi-mt)*Ra/pi+sl));ba(Sa,ya,Zd,Xd,Wa)}var pu=Sa[ya],gl=ms,md=Wc;for(s(Sa,ms,ya),Wa(Sa[Wc],pu)>0&&s(Sa,ms,Wc);gl<md;){for(s(Sa,gl,md),gl++,md--;Wa(Sa[gl],pu)<0;)gl++;for(;Wa(Sa[md],pu)>0;)md--}Wa(Sa[ms],pu)===0?s(Sa,ms,md):s(Sa,++md,Wc),md<=ya&&(ms=md+1),ya<=md&&(Wc=md-1)}})(Ee,yt,Ai||0,zi||Ee.length-1,ha||c)}function s(Ee,yt,Ai){var zi=Ee[yt];Ee[yt]=Ee[Ai],Ee[Ai]=zi}function c(Ee,yt){return Ee<yt?-1:Ee>yt?1:0}var d=function(Ee){Ee===void 0&&(Ee=9),this._maxEntries=Math.max(4,Ee),this._minEntries=Math.max(2,Math.ceil(.4*this._maxEntries)),this.clear()};function h(Ee,yt,Ai){if(!Ai)return yt.indexOf(Ee);for(var zi=0;zi<yt.length;zi++)if(Ai(Ee,yt[zi]))return zi;return-1}function p(Ee,yt){y(Ee,0,Ee.children.length,yt,Ee)}function y(Ee,yt,Ai,zi,ha){ha||(ha=nt(null)),ha.minX=1/0,ha.minY=1/0,ha.maxX=-1/0,ha.maxY=-1/0;for(var ba=yt;ba<Ai;ba++){var Sa=Ee.children[ba];E(ha,Ee.leaf?zi(Sa):Sa)}return ha}function E(Ee,yt){return Ee.minX=Math.min(Ee.minX,yt.minX),Ee.minY=Math.min(Ee.minY,yt.minY),Ee.maxX=Math.max(Ee.maxX,yt.maxX),Ee.maxY=Math.max(Ee.maxY,yt.maxY),Ee}function L(Ee,yt){return Ee.minX-yt.minX}function F(Ee,yt){return Ee.minY-yt.minY}function N(Ee){return(Ee.maxX-Ee.minX)*(Ee.maxY-Ee.minY)}function z(Ee){return Ee.maxX-Ee.minX+(Ee.maxY-Ee.minY)}function oe(Ee,yt){return Ee.minX<=yt.minX&&Ee.minY<=yt.minY&&yt.maxX<=Ee.maxX&&yt.maxY<=Ee.maxY}function W(Ee,yt){return yt.minX<=Ee.maxX&&yt.minY<=Ee.maxY&&yt.maxX>=Ee.minX&&yt.maxY>=Ee.minY}function nt(Ee){return{children:Ee,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function lt(Ee,yt,Ai,zi,ha){for(var ba=[yt,Ai];ba.length;)if(!((Ai=ba.pop())-(yt=ba.pop())<=zi)){var Sa=yt+Math.ceil((Ai-yt)/zi/2)*zi;o(Ee,Sa,yt,Ai,ha),ba.push(yt,Sa,Sa,Ai)}}return d.prototype.all=function(){return this._all(this.data,[])},d.prototype.search=function(Ee){var yt=this.data,Ai=[];if(!W(Ee,yt))return Ai;for(var zi=this.toBBox,ha=[];yt;){for(var ba=0;ba<yt.children.length;ba++){var Sa=yt.children[ba],ya=yt.leaf?zi(Sa):Sa;W(Ee,ya)&&(yt.leaf?Ai.push(Sa):oe(Ee,ya)?this._all(Sa,Ai):ha.push(Sa))}yt=ha.pop()}return Ai},d.prototype.collides=function(Ee){var yt=this.data;if(!W(Ee,yt))return!1;for(var Ai=[];yt;){for(var zi=0;zi<yt.children.length;zi++){var ha=yt.children[zi],ba=yt.leaf?this.toBBox(ha):ha;if(W(Ee,ba)){if(yt.leaf||oe(Ee,ba))return!0;Ai.push(ha)}}yt=Ai.pop()}return!1},d.prototype.load=function(Ee){if(!Ee||!Ee.length)return this;if(Ee.length<this._minEntries){for(var yt=0;yt<Ee.length;yt++)this.insert(Ee[yt]);return this}var Ai=this._build(Ee.slice(),0,Ee.length-1,0);if(this.data.children.length)if(this.data.height===Ai.height)this._splitRoot(this.data,Ai);else{if(this.data.height<Ai.height){var zi=this.data;this.data=Ai,Ai=zi}this._insert(Ai,this.data.height-Ai.height-1,!0)}else this.data=Ai;return this},d.prototype.insert=function(Ee){return Ee&&this._insert(Ee,this.data.height-1),this},d.prototype.clear=function(){return this.data=nt([]),this},d.prototype.remove=function(Ee,yt){if(!Ee)return this;for(var Ai,zi,ha,ba=this.data,Sa=this.toBBox(Ee),ya=[],ms=[];ba||ya.length;){if(ba||(ba=ya.pop(),zi=ya[ya.length-1],Ai=ms.pop(),ha=!0),ba.leaf){var Wc=h(Ee,ba.children,yt);if(Wc!==-1)return ba.children.splice(Wc,1),ya.push(ba),this._condense(ya),this}ha||ba.leaf||!oe(ba,Sa)?zi?(Ai++,ba=zi.children[Ai],ha=!1):ba=null:(ya.push(ba),ms.push(Ai),Ai=0,zi=ba,ba=ba.children[0])}return this},d.prototype.toBBox=function(Ee){return Ee},d.prototype.compareMinX=function(Ee,yt){return Ee.minX-yt.minX},d.prototype.compareMinY=function(Ee,yt){return Ee.minY-yt.minY},d.prototype.toJSON=function(){return this.data},d.prototype.fromJSON=function(Ee){return this.data=Ee,this},d.prototype._all=function(Ee,yt){for(var Ai=[];Ee;)Ee.leaf?yt.push.apply(yt,Ee.children):Ai.push.apply(Ai,Ee.children),Ee=Ai.pop();return yt},d.prototype._build=function(Ee,yt,Ai,zi){var ha,ba=Ai-yt+1,Sa=this._maxEntries;if(ba<=Sa)return p(ha=nt(Ee.slice(yt,Ai+1)),this.toBBox),ha;zi||(zi=Math.ceil(Math.log(ba)/Math.log(Sa)),Sa=Math.ceil(ba/Math.pow(Sa,zi-1))),(ha=nt([])).leaf=!1,ha.height=zi;var ya=Math.ceil(ba/Sa),ms=ya*Math.ceil(Math.sqrt(Sa));lt(Ee,yt,Ai,ms,this.compareMinX);for(var Wc=yt;Wc<=Ai;Wc+=ms){var Wa=Math.min(Wc+ms-1,Ai);lt(Ee,Wc,Wa,ya,this.compareMinY);for(var pi=Wc;pi<=Wa;pi+=ya){var mt=Math.min(pi+ya-1,Wa);ha.children.push(this._build(Ee,pi,mt,zi-1))}}return p(ha,this.toBBox),ha},d.prototype._chooseSubtree=function(Ee,yt,Ai,zi){for(;zi.push(yt),!yt.leaf&&zi.length-1!==Ai;){for(var ha=1/0,ba=1/0,Sa=void 0,ya=0;ya<yt.children.length;ya++){var ms=yt.children[ya],Wc=N(ms),Wa=(pi=Ee,mt=ms,(Math.max(mt.maxX,pi.maxX)-Math.min(mt.minX,pi.minX))*(Math.max(mt.maxY,pi.maxY)-Math.min(mt.minY,pi.minY))-Wc);Wa<ba?(ba=Wa,ha=Wc<ha?Wc:ha,Sa=ms):Wa===ba&&Wc<ha&&(ha=Wc,Sa=ms)}yt=Sa||yt.children[0]}var pi,mt;return yt},d.prototype._insert=function(Ee,yt,Ai){var zi=Ai?Ee:this.toBBox(Ee),ha=[],ba=this._chooseSubtree(zi,this.data,yt,ha);for(ba.children.push(Ee),E(ba,zi);yt>=0&&ha[yt].children.length>this._maxEntries;)this._split(ha,yt),yt--;this._adjustParentBBoxes(zi,ha,yt)},d.prototype._split=function(Ee,yt){var Ai=Ee[yt],zi=Ai.children.length,ha=this._minEntries;this._chooseSplitAxis(Ai,ha,zi);var ba=this._chooseSplitIndex(Ai,ha,zi),Sa=nt(Ai.children.splice(ba,Ai.children.length-ba));Sa.height=Ai.height,Sa.leaf=Ai.leaf,p(Ai,this.toBBox),p(Sa,this.toBBox),yt?Ee[yt-1].children.push(Sa):this._splitRoot(Ai,Sa)},d.prototype._splitRoot=function(Ee,yt){this.data=nt([Ee,yt]),this.data.height=Ee.height+1,this.data.leaf=!1,p(this.data,this.toBBox)},d.prototype._chooseSplitIndex=function(Ee,yt,Ai){for(var zi,ha,ba,Sa,ya,ms,Wc,Wa=1/0,pi=1/0,mt=yt;mt<=Ai-yt;mt++){var fa=y(Ee,0,mt,this.toBBox),Ra=y(Ee,mt,Ai,this.toBBox),sl=(ha=fa,ba=Ra,Sa=void 0,ya=void 0,ms=void 0,Wc=void 0,Sa=Math.max(ha.minX,ba.minX),ya=Math.max(ha.minY,ba.minY),ms=Math.min(ha.maxX,ba.maxX),Wc=Math.min(ha.maxY,ba.maxY),Math.max(0,ms-Sa)*Math.max(0,Wc-ya)),Zd=N(fa)+N(Ra);sl<Wa?(Wa=sl,zi=mt,pi=Zd<pi?Zd:pi):sl===Wa&&Zd<pi&&(pi=Zd,zi=mt)}return zi||Ai-yt},d.prototype._chooseSplitAxis=function(Ee,yt,Ai){var zi=Ee.leaf?this.compareMinX:L,ha=Ee.leaf?this.compareMinY:F;this._allDistMargin(Ee,yt,Ai,zi)<this._allDistMargin(Ee,yt,Ai,ha)&&Ee.children.sort(zi)},d.prototype._allDistMargin=function(Ee,yt,Ai,zi){Ee.children.sort(zi);for(var ha=this.toBBox,ba=y(Ee,0,yt,ha),Sa=y(Ee,Ai-yt,Ai,ha),ya=z(ba)+z(Sa),ms=yt;ms<Ai-yt;ms++){var Wc=Ee.children[ms];E(ba,Ee.leaf?ha(Wc):Wc),ya+=z(ba)}for(var Wa=Ai-yt-1;Wa>=yt;Wa--){var pi=Ee.children[Wa];E(Sa,Ee.leaf?ha(pi):pi),ya+=z(Sa)}return ya},d.prototype._adjustParentBBoxes=function(Ee,yt,Ai){for(var zi=Ai;zi>=0;zi--)E(yt[zi],Ee)},d.prototype._condense=function(Ee){for(var yt=Ee.length-1,Ai=void 0;yt>=0;yt--)Ee[yt].children.length===0?yt>0?(Ai=Ee[yt-1].children).splice(Ai.indexOf(Ee[yt]),1):this.clear():p(Ee[yt],this.toBBox)},d})}}),require_unitbezier_d=__commonJS({"src/types/unitbezier.d.ts"(){}}),require_tinyqueue=__commonJS({"node_modules/tinyqueue/tinyqueue.js"(t,n){(function(o,s){typeof t=="object"&&typeof n<"u"?n.exports=s():typeof define=="function"&&define.amd?define(s):(o=o||self,o.TinyQueue=s())})(t,function(){var o=function(d,h){if(d===void 0&&(d=[]),h===void 0&&(h=s),this.data=d,this.length=this.data.length,this.compare=h,this.length>0)for(var p=(this.length>>1)-1;p>=0;p--)this._down(p)};o.prototype.push=function(d){this.data.push(d),this.length++,this._up(this.length-1)},o.prototype.pop=function(){if(this.length!==0){var d=this.data[0],h=this.data.pop();return this.length--,this.length>0&&(this.data[0]=h,this._down(0)),d}},o.prototype.peek=function(){return this.data[0]},o.prototype._up=function(d){for(var h=this,p=h.data,y=h.compare,E=p[d];d>0;){var L=d-1>>1,F=p[L];if(y(E,F)>=0)break;p[d]=F,d=L}p[d]=E},o.prototype._down=function(d){for(var h=this,p=h.data,y=h.compare,E=this.length>>1,L=p[d];d<E;){var F=(d<<1)+1,N=p[F],z=F+1;if(z<this.length&&y(p[z],N)<0&&(F=z,N=p[z]),y(N,L)>=0)break;p[d]=N,d=F}p[d]=L};function s(c,d){return c<d?-1:c>d?1:0}return o})}}),require_polylabel=__commonJS({"node_modules/polylabel/polylabel.js"(t,n){var o=require_tinyqueue();o.default&&(o=o.default),n.exports=s,n.exports.default=s;function s(E,L,F){L=L||1;for(var N,z,oe,W,nt=0;nt<E[0].length;nt++){var lt=E[0][nt];(!nt||lt[0]<N)&&(N=lt[0]),(!nt||lt[1]<z)&&(z=lt[1]),(!nt||lt[0]>oe)&&(oe=lt[0]),(!nt||lt[1]>W)&&(W=lt[1])}var Ee=oe-N,yt=W-z,Ai=Math.min(Ee,yt),zi=Ai/2;if(Ai===0){var ha=[N,z];return ha.distance=0,ha}for(var ba=new o(void 0,c),Sa=N;Sa<oe;Sa+=Ai)for(var ya=z;ya<W;ya+=Ai)ba.push(new d(Sa+zi,ya+zi,zi,E));var ms=p(E),Wc=new d(N+Ee/2,z+yt/2,0,E);Wc.d>ms.d&&(ms=Wc);for(var Wa=ba.length;ba.length;){var pi=ba.pop();pi.d>ms.d&&(ms=pi,F&&console.log("found best %d after %d probes",Math.round(1e4*pi.d)/1e4,Wa)),!(pi.max-ms.d<=L)&&(zi=pi.h/2,ba.push(new d(pi.x-zi,pi.y-zi,zi,E)),ba.push(new d(pi.x+zi,pi.y-zi,zi,E)),ba.push(new d(pi.x-zi,pi.y+zi,zi,E)),ba.push(new d(pi.x+zi,pi.y+zi,zi,E)),Wa+=4)}F&&(console.log("num probes: "+Wa),console.log("best distance: "+ms.d));var mt=[ms.x,ms.y];return mt.distance=ms.d,mt}function c(E,L){return L.max-E.max}function d(E,L,F,N){this.x=E,this.y=L,this.h=F,this.d=h(E,L,N),this.max=this.d+this.h*Math.SQRT2}function h(E,L,F){for(var N=!1,z=1/0,oe=0;oe<F.length;oe++)for(var W=F[oe],nt=0,lt=W.length,Ee=lt-1;nt<lt;Ee=nt++){var yt=W[nt],Ai=W[Ee];yt[1]>L!=Ai[1]>L&&E<(Ai[0]-yt[0])*(L-yt[1])/(Ai[1]-yt[1])+yt[0]&&(N=!N),z=Math.min(z,y(E,L,yt,Ai))}return z===0?0:(N?1:-1)*Math.sqrt(z)}function p(E){for(var L=0,F=0,N=0,z=E[0],oe=0,W=z.length,nt=W-1;oe<W;nt=oe++){var lt=z[oe],Ee=z[nt],yt=lt[0]*Ee[1]-Ee[0]*lt[1];F+=(lt[0]+Ee[0])*yt,N+=(lt[1]+Ee[1])*yt,L+=yt*3}return L===0?new d(z[0][0],z[0][1],0,E):new d(F/L,N/L,0,E)}function y(E,L,F,N){var z=F[0],oe=F[1],W=N[0]-z,nt=N[1]-oe;if(W!==0||nt!==0){var lt=((E-z)*W+(L-oe)*nt)/(W*W+nt*nt);lt>1?(z=N[0],oe=N[1]):lt>0&&(z+=W*lt,oe+=nt*lt)}return W=E-z,nt=L-oe,W*W+nt*nt}}});__toModule(require_point_geometry()),__toModule(require_point_geometry());var import_point_geometry=__toModule(require_point_geometry()),import_vector_tile=__toModule(require_vector_tile()),import_pbf=__toModule(require_pbf()),u8=Uint8Array,u16=Uint16Array,u32=Uint32Array,fleb=new u8([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0]),fdeb=new u8([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0]),freb=function(t,n){for(var o=new u16(31),s=0;s<31;++s)o[s]=n+=1<<t[s-1];for(var c=new u32(o[30]),s=1;s<30;++s)for(var d=o[s];d<o[s+1];++d)c[d]=d-o[s]<<5|s;return[o,c]},_a$1=freb(fleb,2),fl$1=_a$1[0],revfl=_a$1[1];fl$1[28]=258,revfl[258]=28,freb(fdeb,0);var rev=new u16(32768);for(i=0;i<32768;++i)x=(i&43690)>>>1|(i&21845)<<1,x=(x&52428)>>>2|(x&13107)<<2,x=(x&61680)>>>4|(x&3855)<<4,rev[i]=((x&65280)>>>8|(x&255)<<8)>>>1;var x,i,flt=new u8(288);for(i=0;i<144;++i)flt[i]=8;var i;for(i=144;i<256;++i)flt[i]=9;var i;for(i=256;i<280;++i)flt[i]=7;var i;for(i=280;i<288;++i)flt[i]=8;var i,fdt=new u8(32);for(i=0;i<32;++i)fdt[i]=5;var i,et$1=new u8(0),td$1=typeof TextDecoder<"u"&&new TextDecoder,tds=0;try{td$1.decode(et$1,{stream:!0}),tds=1}catch(t){}var GeomType;(function(t){t[t.Point=1]="Point",t[t.Line=2]="Line",t[t.Polygon=3]="Polygon"})(GeomType||(GeomType={}));function toIndex(t){return t.x+":"+t.y+":"+t.z}var loadGeomAndBbox=(t,n,o)=>{t.pos=n;for(var s=t.readVarint()+t.pos,c=1,d=0,h=0,p=0,y=1/0,E=-1/0,L=1/0,F=-1/0,N=[],z=[];t.pos<s;){if(d<=0){var oe=t.readVarint();c=oe&7,d=oe>>3}if(d--,c===1||c===2)h+=t.readSVarint()*o,p+=t.readSVarint()*o,h<y&&(y=h),h>E&&(E=h),p<L&&(L=p),p>F&&(F=p),c===1&&(z.length>0&&N.push(z),z=[]),z.push(new import_point_geometry.default(h,p));else if(c===7)z&&z.push(z[0].clone());else throw new Error("unknown command "+c)}return z&&N.push(z),{geom:N,bbox:{minX:y,minY:L,maxX:E,maxY:F}}};function parseTile(t,n){let o=new import_vector_tile.VectorTile(new import_pbf.default(t)),s=new Map;for(let[c,d]of Object.entries(o.layers)){let h=[],p=d;for(let y=0;y<p.length;y++){let E=loadGeomAndBbox(p.feature(y)._pbf,p.feature(y)._geometry,n/p.extent),L=0;for(let F of E.geom)L+=F.length;h.push({id:p.feature(y).id,geomType:p.feature(y).type,geom:E.geom,numVertices:L,bbox:E.bbox,props:p.feature(y).properties})}s.set(c,h)}return s}var ZxySource=class{constructor(t,n){this.url=t,this.controllers=[],this.shouldCancelZooms=n}get(t,n){return __async(this,null,function*(){this.shouldCancelZooms&&(this.controllers=this.controllers.filter(d=>d[0]!=t.z?(d[1].abort(),!1):!0));let o=this.url.replace("{z}",t.z.toString()).replace("{x}",t.x.toString()).replace("{y}",t.y.toString());const s=new AbortController;this.controllers.push([t.z,s]);const c=s.signal;return new Promise((d,h)=>{fetch(o,{signal:c}).then(p=>p.arrayBuffer()).then(p=>{let y=parseTile(p,n);d(y)}).catch(p=>{h(p)})})})}},R=6378137,MAX_LATITUDE=85.0511287798,MAXCOORD=R*Math.PI,project=t=>{let n=Math.PI/180,o=Math.max(Math.min(MAX_LATITUDE,t[0]),-MAX_LATITUDE),s=Math.sin(o*n);return new import_point_geometry.default(R*t[1]*n,R*Math.log((1+s)/(1-s))/2)};function sqr(t){return t*t}function dist2(t,n){return sqr(t.x-n.x)+sqr(t.y-n.y)}function distToSegmentSquared(t,n,o){var s=dist2(n,o);if(s===0)return dist2(t,n);var c=((t.x-n.x)*(o.x-n.x)+(t.y-n.y)*(o.y-n.y))/s;return c=Math.max(0,Math.min(1,c)),dist2(t,new import_point_geometry.default(n.x+c*(o.x-n.x),n.y+c*(o.y-n.y)))}function isInRing(t,n){for(var o=!1,s=0,c=n.length-1;s<n.length;c=s++){var d=n[s].x,h=n[s].y,p=n[c].x,y=n[c].y,E=h>t.y!=y>t.y&&t.x<(p-d)*(t.y-h)/(y-h)+d;E&&(o=!o)}return o}function isCCW(t){for(var n=0,o=0;o<t.length;o++){let s=(o+1)%t.length;n+=t[o].x*t[s].y,n-=t[s].x*t[o].y}return n<0}function pointInPolygon(t,n){var o=!1;for(let s of n)if(isCCW(s))isInRing(t,s)&&(o=!1);else{if(o)return!0;isInRing(t,s)&&(o=!0)}return o}function pointMinDistToPoints(t,n){let o=1/0;for(let s of n){let c=Math.sqrt(dist2(t,s[0]));c<o&&(o=c)}return o}function pointMinDistToLines(t,n){let o=1/0;for(let c of n)for(var s=0;s<c.length-1;s++){let d=Math.sqrt(distToSegmentSquared(t,c[s],c[s+1]));d<o&&(o=d)}return o}var TileCache=class{constructor(t,n){this.source=t,this.cache=new Map,this.inflight=new Map,this.tileSize=n}queryFeatures(t,n,o,s){let c=project([n,t]);var d=new import_point_geometry.default((c.x+MAXCOORD)/(MAXCOORD*2),1-(c.y+MAXCOORD)/(MAXCOORD*2));d.x>1&&(d.x=d.x-Math.floor(d.x));let h=d.mult(1<<o),p=Math.floor(h.x),y=Math.floor(h.y);const E=toIndex({z:o,x:p,y});let L=[],F=this.cache.get(E);if(F){const N=new import_point_geometry.default((h.x-p)*this.tileSize,(h.y-y)*this.tileSize);for(let[z,oe]of F.data.entries())for(let W of oe)W.geomType==1?pointMinDistToPoints(N,W.geom)<s&&L.push({feature:W,layerName:z}):W.geomType==2?pointMinDistToLines(N,W.geom)<s&&L.push({feature:W,layerName:z}):pointInPolygon(N,W.geom)&&L.push({feature:W,layerName:z})}return L}get(t){return __async(this,null,function*(){const n=toIndex(t);return new Promise((o,s)=>{let c=this.cache.get(n);if(c)c.used=performance.now(),o(c.data);else{let d=this.inflight.get(n);d?d.push([o,s]):(this.inflight.set(n,[]),this.source.get(t,this.tileSize).then(h=>{this.cache.set(n,{used:performance.now(),data:h});let p=this.inflight.get(n);if(p&&p.forEach(y=>y[0](h)),this.inflight.delete(n),o(h),this.cache.size>=64){let y=1/0,E;this.cache.forEach((L,F)=>{L.used<y&&(y=L.used,E=F)}),E&&this.cache.delete(E)}}).catch(h=>{let p=this.inflight.get(n);p&&p.forEach(y=>y[1](h)),this.inflight.delete(n),s(h)}))}})})}};__toModule(require_point_geometry()),__toModule(require_point_geometry()),__toModule(require_rbush_min());var e=t=>parseInt(t.replace(/_/g,""),36);"1q29ehhb 1n09sgk7 1kl1ekf_ _yl4zsno 16z9eiv3 1p29lhp8 _bd9zg04 17u0____ _iw9zhe5 _to73___ _r45e31e _7l6g016 _jh8ouiv _zn3qba8 1jy4zshs 11u87k0u 1ro9yvyo 1aj3xael 1gz9zjz0 _3w8l4xo 1bf1ekf_ _ke3v___ _4rrkb__ 13j776yz _646mbhl _nrjr4__ _le6mbhl 1n37ehkb _m75f91n _qj3bzfz 1939yygw 11i5z6x8 _1k5f8xs 1509441m 15t5lwgf _ae2th1n _tg1ugcv 1lp1ugcv 16e14up_ _h55rw7n _ny9yavn _7a11xb_ 1ih442g9 _pv442g9 1mv16xof 14e6y7tu 1oo9zkds 17d1cisi _4v9y70f _y98m8kc 1019pq0v 12o9zda8 _348j4f4 1et50i2o _8epa8__ _ts6senj 1o350i2o 1mi9eiuo 1259yrp0 1ln80gnw _632xcoy 1cn9zldc _f29edu4 1n490c8q _9f9ziet 1b94vk74 _m49zkct 1kz6s73a 1eu9dtog _q58s1rz 1dy9sjiq __u89jo3 _aj5nkwg _ld89jo3 13h9z6wx _qa9z2ii _l119xgq _bs5arju 1hj4nwk9 1qt4nwk9 1ge6wau6 14j9zlcw 11p1edc_ _ms1zcxe _439shk6 _jt9y70f _754zsow 1la40eju _oq5p___ _x279qkz 1fa5r3rv _yd2d9ip _424tcku _8y1di2_ _zi2uabw _yy7rn9h 12yz980_ __39ljp6 1b59zg0x _n39zfzp 1fy9zest _b33k___ _hp9wq92 1il50hz4 _io472ub _lj9z3eo 19z9ykg0 _8t8iu3a 12b9bl4a 1ak5yw0o _896v4ku _tb8k8lv _s59zi6t _c09ze0p 1lg80oqn 1id9z8wb _238nba5 1kq6wgdi _154zssg _tn3zk49 _da9y6tc 1sg7cv4f _r12jvtt 1gq5fmkz 1cs9rvci _lp9jn1c _xw1tdnb 13f9zje6 16f6973h _vo7ir40 _bt5arjf _rc45e4t _hr4e100 10v4e100 _hc9zke2 _w91egv_ _sj2r1kk 13c87yx8 _vqpds__ _ni8ggk8 _tj9yqfb 1ia2j4r4 _7x9b10u 1fc9ld4j 1eq9zldr _5j9lhpx _ez9zl6o _md61fzm".split(" ").reduce((t,n)=>{const o=e(n.substring(0,3)),s=e(n.substring(3)).toString(16);let c="";for(let d=0;d<6-s.length;d++)c+="0";return t[o]=`${c}${s}`,t},{});var _$1=(t,n)=>Array.from(Array(n)).map(()=>t).join("");new RegExp(`^#${_$1("([a-f0-9])",3)}([a-f0-9])?$`,"i"),new RegExp(`^#${_$1("([a-f0-9]{2})",3)}([a-f0-9]{2})?$`,"i"),new RegExp(`^rgba?\\(\\s*(\\d+)\\s*${_$1(",\\s*(\\d+)\\s*",2)}(?:,\\s*([\\d.]+))?\\s*\\)$`,"i"),__toModule(require_point_geometry()),__toModule(require_unitbezier_d()),__toModule(require_polylabel()),__toModule(require_point_geometry());var Justify;(function(t){t[t.Left=1]="Left",t[t.Center=2]="Center",t[t.Right=3]="Right"})(Justify||(Justify={}));var TextPlacements;(function(t){t[t.N=1]="N",t[t.NE=2]="NE",t[t.E=3]="E",t[t.SE=4]="SE",t[t.S=5]="S",t[t.SW=6]="SW",t[t.W=7]="W",t[t.NW=8]="NW"})(TextPlacements||(TextPlacements={}));var LineLabelPlacement;(function(t){t[t.Above=1]="Above",t[t.Center=2]="Center",t[t.Below=3]="Below"})(LineLabelPlacement||(LineLabelPlacement={})),__toModule(require_point_geometry());/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> */function makeKey({x:t,y:n,level:o}){return`${o}:${t}:${n}`}function getTileCoords(t,n){if(n!=null&&t.level>n){const o=2**(t.level-n);return{x:Math.floor(t.x/o),y:Math.floor(t.y/o),z:n}}return{x:t.x,y:t.y,z:t.level}}class JapanGSIOptimalBVmapImageryProviderBase{constructor(n){Vf(this,"defaultAlpha");Vf(this,"defaultNightAlpha");Vf(this,"defaultDayAlpha");Vf(this,"defaultBrightness");Vf(this,"defaultContrast");Vf(this,"defaultHue");Vf(this,"defaultSaturation");Vf(this,"defaultGamma");Vf(this,"defaultMinificationFilter");Vf(this,"defaultMagnificationFilter");Vf(this,"ready",!0);Vf(this,"readyPromise",Promise.resolve(!0));Vf(this,"tileWidth",256);Vf(this,"tileHeight",256);Vf(this,"maximumLevel");Vf(this,"minimumLevel",0);Vf(this,"tilingScheme",new WebMercatorTilingScheme);Vf(this,"rectangle",this.tilingScheme.rectangle);Vf(this,"tileDiscardPolicy");Vf(this,"errorEvent",new Event$1);Vf(this,"credit");Vf(this,"proxy");Vf(this,"hasAlphaChannel",!0);(n==null?void 0:n.tilingScheme)!=null&&(this.tilingScheme=n.tilingScheme),(n==null?void 0:n.tileWidth)!=null&&(this.tileWidth=n.tileWidth),(n==null?void 0:n.tileHeight)!=null&&(this.tileHeight=n.tileHeight)}getTileCredits(n,o,s){}requestImage(n,o,s,c){}pickFeatures(n,o,s,c,d){}get _ready(){return this.ready}get _readyPromise(){return this.readyPromise}}class JapanGSIOptimalBVmapLabelImageryProvider extends JapanGSIOptimalBVmapImageryProviderBase{constructor(o){super(o);Vf(this,"minimumDataLevel");Vf(this,"maximumDataLevel");Vf(this,"tileCache");Vf(this,"image");Vf(this,"discardedTileCoords",new Set);this.tileDiscardPolicy=new DiscardEmptyTileImagePolicy,this.minimumDataLevel=o.minimumDataLevel,this.maximumDataLevel=o.maximumDataLevel;const s=new ZxySource(o.url,!1);this.tileCache=new TileCache(s,1024),this.image=document.createElement("canvas"),this.image.width=1,this.image.height=1}requestImage(o,s,c,d){const h=makeKey({x:o,y:s,level:c});return(async()=>c<this.minimumDataLevel||this.discardedTileCoords.has(h)?DiscardEmptyTileImagePolicy.EMPTY_IMAGE:(await this.tileCache.get(getTileCoords({x:o,y:s,level:c},this.maximumDataLevel)),this.image))().catch(()=>(this.discardedTileCoords.add(h),DiscardEmptyTileImagePolicy.EMPTY_IMAGE))}}const tiles={default:({cesiumIonAccessToken:t}={})=>Cesium$1.IonImageryProvider.fromAssetId(Cesium$1.IonWorldImageryStyle.AERIAL,{accessToken:t}).catch(console.error),default_label:({cesiumIonAccessToken:t}={})=>Cesium$1.IonImageryProvider.fromAssetId(Cesium$1.IonWorldImageryStyle.AERIAL_WITH_LABELS,{accessToken:t}).catch(console.error),default_road:({cesiumIonAccessToken:t}={})=>Cesium$1.IonImageryProvider.fromAssetId(Cesium$1.IonWorldImageryStyle.ROAD,{accessToken:t}).catch(console.error),stamen_watercolor:()=>new Cesium$1.OpenStreetMapImageryProvider({url:"https://stamen-tiles.a.ssl.fastly.net/watercolor/",credit:"Map tiles by Stamen Design, under CC BY 3.0. Data by OpenStreetMap, under CC BY SA.",fileExtension:"jpg"}),stamen_toner:()=>new Cesium$1.OpenStreetMapImageryProvider({url:"https://stamen-tiles.a.ssl.fastly.net/toner/",credit:"Map tiles by Stamen Design, under CC BY 3.0. Data by OpenStreetMap, under CC BY SA."}),open_street_map:()=>new Cesium$1.OpenStreetMapImageryProvider({url:"https://a.tile.openstreetmap.org/",credit:"Copyright: Tiles © Esri — Source: Esri, DeLorme, NAVTEQ, USGS, Intermap, iPC, NRCAN, Esri Japan, METI, Esri China (Hong Kong), Esri (Thailand), TomTom, 2012"}),esri_world_topo:()=>Cesium$1.ArcGisMapServerImageryProvider.fromUrl("https://services.arcgisonline.com/ArcGIS/rest/services/World_Topo_Map/MapServer",{credit:"Copyright: Tiles © Esri — Esri, DeLorme, NAVTEQ, TomTom, Intermap, iPC, USGS, FAO, NPS, NRCAN, GeoBase, Kadaster NL, Ordnance Survey, Esri Japan, METI, Esri China (Hong Kong), and the GIS User Communit",enablePickFeatures:!1}).catch(console.error),black_marble:({cesiumIonAccessToken:t}={})=>Cesium$1.IonImageryProvider.fromAssetId(3812,{accessToken:t}).catch(console.error),japan_gsi_standard:()=>new Cesium$1.OpenStreetMapImageryProvider({url:"https://cyberjapandata.gsi.go.jp/xyz/std/"}),url:({url:t,heatmap:n,tile_zoomLevel:o}={})=>t?new Cesium$1.UrlTemplateImageryProvider({url:t,tileDiscardPolicy:n?new Cesium$1.DiscardEmptyTileImagePolicy:void 0,minimumLevel:o==null?void 0:o[0],maximumLevel:o==null?void 0:o[1]}):null};function ImageryLayers({tiles:t,cesiumIonAccessToken:n}){const{providers:o,updated:s}=useImageryProviders({tiles:t,cesiumIonAccessToken:n,presets:tiles}),[c,d]=React.useState(0);return React.useLayoutEffect(()=>{s&&d(h=>h+1)},[o,s]),jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{children:t==null?void 0:t.map(({id:h,...p})=>{var y;return{...p,id:h,provider:(y=o[h])==null?void 0:y[2]}}).map(({id:h,opacity:p,zoomLevel:y,provider:E,heatmap:L},F)=>E?jsxRuntimeExports.jsx(Ns$1,{imageryProvider:E,minimumTerrainLevel:y==null?void 0:y[0],maximumTerrainLevel:y==null?void 0:y[1],alpha:p,index:F,colorToAlpha:L?Cesium$1.Color.WHITE:void 0,colorToAlphaThreshold:L?1:void 0,magnificationFilter:L?Cesium$1.TextureMagnificationFilter.LINEAR:void 0,minificationFilter:L?Cesium$1.TextureMinificationFilter.NEAREST:void 0},`${h}_${F}_${c}`):null)})}function useImageryProviders({tiles:t=[],cesiumIonAccessToken:n,presets:o}){const s=React.useCallback((L,F)=>o[L.type||"default"]({url:L.url,cesiumIonAccessToken:F,heatmap:L.heatmap,zoomLevel:L.zoomLevelForURL}),[o]),c=React.useRef(n),d=t.map(L=>L.id).join(","),h=React.useRef(d),p=React.useRef({}),{providers:y,updated:E}=React.useMemo(()=>{const L=c.current!==n,F=Object.keys(p.current),N=t.map(nt=>nt.id).filter(nt=>nt&&!F.includes(nt)),z=[...Object.entries(p.current),...N.map(nt=>[nt,void 0])].map(([nt,lt])=>({key:nt,added:N.includes(nt),prevType:lt==null?void 0:lt[0],prevUrl:lt==null?void 0:lt[1],prevProvider:lt==null?void 0:lt[2],tile:t.find(Ee=>Ee.id===nt)})),oe=Object.fromEntries(z.map(({key:nt,added:lt,prevType:Ee,prevUrl:yt,prevProvider:Ai,tile:zi})=>zi?[nt,lt||Ee!==zi.type||yt!==zi.url||L&&(!zi.type||zi.type==="default")?[zi.type,zi.url,s(zi,n)]:[Ee,yt,Ai]]:null).filter(nt=>!!(nt!=null&&nt[1][2]))),W=!!N.length||!!L||!isEqual(h.current,d)||z.some(nt=>nt.tile&&(nt.prevType!==nt.tile.type||nt.prevUrl!==nt.tile.url));return h.current=d,c.current=n,{providers:oe,updated:W}},[n,t,d,s]);return p.current=y,{providers:y,updated:E}}const useTransition=(t,n,o)=>{const[s,c]=React.useState(t?"entered":o&&o.mountOnEnter?"unmounted":"exited"),d=React.useRef(),h=React.useRef(),p=React.useCallback(()=>{c(t?"entered":o&&o.unmountOnExit?"unmounted":"exited"),h.current=void 0},[t,!!o&&o.unmountOnExit,h]),y=React.useCallback(()=>{c("entered"),h.current=void 0},[h]),E=React.useCallback(()=>{c(t?"entered":o&&o.unmountOnExit?"unmounted":"exited"),h.current=void 0},[t,!!o&&o.unmountOnExit,h]),L=React.useCallback(()=>{c(t?"entering":"exiting"),d.current=setTimeout(E,n),h.current=Date.now()+n},[t,n,E,d,h]);return React.useEffect(()=>{if(t?s==="entered":s==="exited"||s==="unmounted"){h.current=void 0;return}const F=Date.now(),N=typeof h.current>"u"?n:n-(h.current-F);return!t&&(s==="entered"||s==="entering")?(c("exiting"),d.current=setTimeout(p,N)):t&&(s==="exited"||s==="exiting")?(c("entering"),d.current=setTimeout(y,N)):(c(t?"exited":"entered"),d.current=setTimeout(L,30)),h.current=F+N,()=>{clearTimeout(d.current)}},[t]),s},SvgCrosshair=t=>React__namespace.createElement("svg",{width:48,height:48,viewBox:"0 0 48 48",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg",...t},React__namespace.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M25 5.02586C34.6974 5.52871 42.4713 13.3026 42.9741 23H47C47.5523 23 48 23.4477 48 24C48 24.5523 47.5523 25 47 25H42.9741C42.4713 34.6974 34.6974 42.4713 25 42.9741V47C25 47.5523 24.5523 48 24 48C23.4477 48 23 47.5523 23 47V42.9741C13.3026 42.4713 5.52871 34.6974 5.02586 25H1C0.447715 25 0 24.5523 0 24C0 23.4477 0.447715 23 1 23H5.02586C5.52871 13.3026 13.3026 5.52871 23 5.02586V1C23 0.447715 23.4477 0 24 0C24.5523 0 25 0.447715 25 1V5.02586ZM41.5 24C41.5 33.665 33.665 41.5 24 41.5C14.335 41.5 6.5 33.665 6.5 24C6.5 14.335 14.335 6.5 24 6.5C33.665 6.5 41.5 14.335 41.5 24Z",fill:"white"}));function Indicator({className:t,property:n,timelineManagerRef:o}){const{viewer:s}=$e$1(),[c,d]=React.useState(!0),[h,p]=React.useState(),y=useTransition(!!h&&c,500,{mountOnEnter:!0,unmountOnExit:!0}),{type:E,image:L,imageScale:F}=(n==null?void 0:n.indicator)??{},[N,z,oe]=useIcon({image:L,imageSize:F});return React.useEffect(()=>{!E||E==="default"?s==null||s.selectionIndicator.viewModel.selectionIndicatorElement.removeAttribute("hidden"):s==null||s.selectionIndicator.viewModel.selectionIndicatorElement.setAttribute("hidden","true")},[E,s,s==null?void 0:s.selectionIndicator]),React.useEffect(()=>{if(!s)return;const W=()=>{var ha,ba,Sa;if(s.isDestroyed())return;const lt=s.selectedEntity,Ee=(ba=(ha=o==null?void 0:o.current)==null?void 0:ha.timeline)!=null&&ba.current?Cesium$1.JulianDate.fromDate((Sa=o==null?void 0:o.current)==null?void 0:Sa.timeline.current):void 0;if(!(lt!=null&<.isShowing)||Ee&&!lt.isAvailable(Ee)||!lt.position){d(!1);return}let yt;const Ai=new Cesium$1.BoundingSphere;if(s.dataSourceDisplay.getBoundingSphere(lt,!0,Ai)!==2?yt=Ai.center:lt.position&&Ee&&(yt=lt.position.getValue(Ee,yt)),yt){const ya=Cesium$1.SceneTransforms.wgs84ToWindowCoordinates(s.scene,yt);p(ya),d(!0)}else d(!1)},nt=o==null?void 0:o.current;return nt==null||nt.onTick(W),()=>{nt==null||nt.offTick(W)}},[s,o]),y!=="unmounted"&&h?E==="crosshair"?jsxRuntimeExports.jsx("div",{className:t,style:{width:48,height:48,fontSize:0,display:"inline-block",transitionProperty:"color, background",left:h.x+"px",top:h.y+"px",position:"absolute",transform:"translate(-50%, -50%)",transition:y==="entering"||y==="exiting"?"all 0.5s ease":"",opacity:y==="entering"||y==="entered"?1:0,pointerEvents:"none"},children:jsxRuntimeExports.jsx(SvgCrosshair,{})}):E==="custom"?jsxRuntimeExports.jsx("img",{src:N,width:z,height:oe,style:{left:h.x+"px",top:h.y+"px",position:"absolute",transform:"translate(-50%, -50%)",transition:y==="entering"||y==="exiting"?"all 0.5s ease":"",opacity:y==="entering"||y==="entered"?1:0,pointerEvents:"none"}}):jsxRuntimeExports.jsx("div",{style:{left:h.x+"px",top:h.y+"px",position:"absolute",transform:"translate(-50%, -50%)",transition:y==="entering"||y==="exiting"?"all 0.5s ease":"",opacity:y==="entering"||y==="entered"?1:0,pointerEvents:"none"}}):null}const annotationTypes={municipalities:[110,140],towns:[120,130,210,220,800],roads:[411],railways:[421],stations:[422],landmarks:[412,413,423,431,432,441,511,521,522,523,531,532,533,534,611,612,613,615,621,631,632,633,634,651,653,661,662,671,673,681,860,870,880,881,882,883,884,885,886,887,888,889,890,899],topography:[311,312,313,314,315,316,321,322,323,331,332,333,341,342,343,344,345,346,347,348,351,352,353,361,810,820,822,830,831,832,840,841,842,843,850]},typeMap=fromPairs(Object.entries(annotationTypes).flatMap(([t,n])=>n.map(o=>[o,t])));function getAnnotationType(t){return typeMap[t]}function useSceneEvent(t,n){const{viewer:o}=$e$1(),s=o==null?void 0:o.scene,c=React.useRef(n);c.current=n,React.useLayoutEffect(()=>s==null?void 0:s[t].addEventListener((d,h)=>{try{c.current(d,h)}catch(p){console.error(p)}}),[t,s])}function usePreRender(t){useSceneEvent("preRender",t)}const isPromise=t=>typeof t=="object"&&typeof t.then=="function",globalCache=[];function shallowEqualArrays(t,n,o=(s,c)=>s===c){if(t===n)return!0;if(!t||!n)return!1;const s=t.length;if(n.length!==s)return!1;for(let c=0;c<s;c++)if(!o(t[c],n[c]))return!1;return!0}function query(t,n=null,o=!1,s={}){n===null&&(n=[t]);for(const d of globalCache)if(shallowEqualArrays(n,d.keys,d.equal)){if(o)return;if(Object.prototype.hasOwnProperty.call(d,"error"))throw d.error;if(Object.prototype.hasOwnProperty.call(d,"response"))return s.lifespan&&s.lifespan>0&&(d.timeout&&clearTimeout(d.timeout),d.timeout=setTimeout(d.remove,s.lifespan)),d.response;if(!o)throw d.promise}const c={keys:n,equal:s.equal,remove:()=>{const d=globalCache.indexOf(c);d!==-1&&globalCache.splice(d,1)},promise:(isPromise(t)?t:t(...n)).then(d=>{c.response=d,s.lifespan&&s.lifespan>0&&(c.timeout=setTimeout(c.remove,s.lifespan))}).catch(d=>c.error=d)};if(globalCache.push(c),!o)throw c.promise}const suspend=(t,n,o)=>query(t,n,!1,o);function coordEach(t,n,o){if(t!==null)for(var s,c,d,h,p,y,E,L=0,F=0,N,z=t.type,oe=z==="FeatureCollection",W=z==="Feature",nt=oe?t.features.length:1,lt=0;lt<nt;lt++){E=oe?t.features[lt].geometry:W?t.geometry:t,N=E?E.type==="GeometryCollection":!1,p=N?E.geometries.length:1;for(var Ee=0;Ee<p;Ee++){var yt=0,Ai=0;if(h=N?E.geometries[Ee]:E,h!==null){y=h.coordinates;var zi=h.type;switch(L=o&&(zi==="Polygon"||zi==="MultiPolygon")?1:0,zi){case null:break;case"Point":if(n(y,F,lt,yt,Ai)===!1)return!1;F++,yt++;break;case"LineString":case"MultiPoint":for(s=0;s<y.length;s++){if(n(y[s],F,lt,yt,Ai)===!1)return!1;F++,zi==="MultiPoint"&&yt++}zi==="LineString"&&yt++;break;case"Polygon":case"MultiLineString":for(s=0;s<y.length;s++){for(c=0;c<y[s].length-L;c++){if(n(y[s][c],F,lt,yt,Ai)===!1)return!1;F++}zi==="MultiLineString"&&yt++,zi==="Polygon"&&Ai++}zi==="Polygon"&&yt++;break;case"MultiPolygon":for(s=0;s<y.length;s++){for(Ai=0,c=0;c<y[s].length;c++){for(d=0;d<y[s][c].length-L;d++){if(n(y[s][c][d],F,lt,yt,Ai)===!1)return!1;F++}Ai++}yt++}break;case"GeometryCollection":for(s=0;s<h.geometries.length;s++)if(coordEach(h.geometries[s],n,o)===!1)return!1;break;default:throw new Error("Unknown Geometry Type")}}}}}function featureEach(t,n){if(t.type==="Feature")n(t,0);else if(t.type==="FeatureCollection")for(var o=0;o<t.features.length&&n(t.features[o],o)!==!1;o++);}function geomEach(t,n){var o,s,c,d,h,p,y,E,L,F,N=0,z=t.type==="FeatureCollection",oe=t.type==="Feature",W=z?t.features.length:1;for(o=0;o<W;o++){for(p=z?t.features[o].geometry:oe?t.geometry:t,E=z?t.features[o].properties:oe?t.properties:{},L=z?t.features[o].bbox:oe?t.bbox:void 0,F=z?t.features[o].id:oe?t.id:void 0,y=p?p.type==="GeometryCollection":!1,h=y?p.geometries.length:1,c=0;c<h;c++){if(d=y?p.geometries[c]:p,d===null){if(n(null,N,E,L,F)===!1)return!1;continue}switch(d.type){case"Point":case"LineString":case"MultiPoint":case"Polygon":case"MultiLineString":case"MultiPolygon":{if(n(d,N,E,L,F)===!1)return!1;break}case"GeometryCollection":{for(s=0;s<d.geometries.length;s++)if(n(d.geometries[s],N,E,L,F)===!1)return!1;break}default:throw new Error("Unknown Geometry Type")}}N++}}function geomReduce(t,n,o){var s=o;return geomEach(t,function(c,d,h,p,y){d===0&&o===void 0?s=c:s=n(s,c,d,h,p,y)}),s}function flattenEach(t,n){geomEach(t,function(o,s,c,d,h){var p=o===null?null:o.type;switch(p){case null:case"Point":case"LineString":case"Polygon":return n(feature(o,c,{bbox:d,id:h}),s,0)===!1?!1:void 0}var y;switch(p){case"MultiPoint":y="Point";break;case"MultiLineString":y="LineString";break;case"MultiPolygon":y="Polygon";break}for(var E=0;E<o.coordinates.length;E++){var L=o.coordinates[E],F={type:y,coordinates:L};if(n(feature(F,c),s,E)===!1)return!1}})}var rbush$2={exports:{}},quickselect$2={exports:{}};(function(t,n){(function(o,s){t.exports=s()})(commonjsGlobal,function(){function o(h,p,y,E,L){s(h,p,y||0,E||h.length-1,L||d)}function s(h,p,y,E,L){for(;E>y;){if(E-y>600){var F=E-y+1,N=p-y+1,z=Math.log(F),oe=.5*Math.exp(2*z/3),W=.5*Math.sqrt(z*oe*(F-oe)/F)*(N-F/2<0?-1:1),nt=Math.max(y,Math.floor(p-N*oe/F+W)),lt=Math.min(E,Math.floor(p+(F-N)*oe/F+W));s(h,p,nt,lt,L)}var Ee=h[p],yt=y,Ai=E;for(c(h,y,p),L(h[E],Ee)>0&&c(h,y,E);yt<Ai;){for(c(h,yt,Ai),yt++,Ai--;L(h[yt],Ee)<0;)yt++;for(;L(h[Ai],Ee)>0;)Ai--}L(h[y],Ee)===0?c(h,y,Ai):(Ai++,c(h,Ai,E)),Ai<=p&&(y=Ai+1),p<=Ai&&(E=Ai-1)}}function c(h,p,y){var E=h[p];h[p]=h[y],h[y]=E}function d(h,p){return h<p?-1:h>p?1:0}return o})})(quickselect$2);var quickselectExports=quickselect$2.exports;rbush$2.exports=rbush,rbush$2.exports.default=rbush;var quickselect$1=quickselectExports;function rbush(t,n){if(!(this instanceof rbush))return new rbush(t,n);this._maxEntries=Math.max(4,t||9),this._minEntries=Math.max(2,Math.ceil(this._maxEntries*.4)),n&&this._initFormat(n),this.clear()}rbush.prototype={all:function(){return this._all(this.data,[])},search:function(t){var n=this.data,o=[],s=this.toBBox;if(!intersects(t,n))return o;for(var c=[],d,h,p,y;n;){for(d=0,h=n.children.length;d<h;d++)p=n.children[d],y=n.leaf?s(p):p,intersects(t,y)&&(n.leaf?o.push(p):contains(t,y)?this._all(p,o):c.push(p));n=c.pop()}return o},collides:function(t){var n=this.data,o=this.toBBox;if(!intersects(t,n))return!1;for(var s=[],c,d,h,p;n;){for(c=0,d=n.children.length;c<d;c++)if(h=n.children[c],p=n.leaf?o(h):h,intersects(t,p)){if(n.leaf||contains(t,p))return!0;s.push(h)}n=s.pop()}return!1},load:function(t){if(!(t&&t.length))return this;if(t.length<this._minEntries){for(var n=0,o=t.length;n<o;n++)this.insert(t[n]);return this}var s=this._build(t.slice(),0,t.length-1,0);if(!this.data.children.length)this.data=s;else if(this.data.height===s.height)this._splitRoot(this.data,s);else{if(this.data.height<s.height){var c=this.data;this.data=s,s=c}this._insert(s,this.data.height-s.height-1,!0)}return this},insert:function(t){return t&&this._insert(t,this.data.height-1),this},clear:function(){return this.data=createNode([]),this},remove:function(t,n){if(!t)return this;for(var o=this.data,s=this.toBBox(t),c=[],d=[],h,p,y,E;o||c.length;){if(o||(o=c.pop(),p=c[c.length-1],h=d.pop(),E=!0),o.leaf&&(y=findItem(t,o.children,n),y!==-1))return o.children.splice(y,1),c.push(o),this._condense(c),this;!E&&!o.leaf&&contains(o,s)?(c.push(o),d.push(h),h=0,p=o,o=o.children[0]):p?(h++,o=p.children[h],E=!1):o=null}return this},toBBox:function(t){return t},compareMinX:compareNodeMinX,compareMinY:compareNodeMinY,toJSON:function(){return this.data},fromJSON:function(t){return this.data=t,this},_all:function(t,n){for(var o=[];t;)t.leaf?n.push.apply(n,t.children):o.push.apply(o,t.children),t=o.pop();return n},_build:function(t,n,o,s){var c=o-n+1,d=this._maxEntries,h;if(c<=d)return h=createNode(t.slice(n,o+1)),calcBBox(h,this.toBBox),h;s||(s=Math.ceil(Math.log(c)/Math.log(d)),d=Math.ceil(c/Math.pow(d,s-1))),h=createNode([]),h.leaf=!1,h.height=s;var p=Math.ceil(c/d),y=p*Math.ceil(Math.sqrt(d)),E,L,F,N;for(multiSelect(t,n,o,y,this.compareMinX),E=n;E<=o;E+=y)for(F=Math.min(E+y-1,o),multiSelect(t,E,F,p,this.compareMinY),L=E;L<=F;L+=p)N=Math.min(L+p-1,F),h.children.push(this._build(t,L,N,s-1));return calcBBox(h,this.toBBox),h},_chooseSubtree:function(t,n,o,s){for(var c,d,h,p,y,E,L,F;s.push(n),!(n.leaf||s.length-1===o);){for(L=F=1/0,c=0,d=n.children.length;c<d;c++)h=n.children[c],y=bboxArea(h),E=enlargedArea(t,h)-y,E<F?(F=E,L=y<L?y:L,p=h):E===F&&y<L&&(L=y,p=h);n=p||n.children[0]}return n},_insert:function(t,n,o){var s=this.toBBox,c=o?t:s(t),d=[],h=this._chooseSubtree(c,this.data,n,d);for(h.children.push(t),extend$1(h,c);n>=0&&d[n].children.length>this._maxEntries;)this._split(d,n),n--;this._adjustParentBBoxes(c,d,n)},_split:function(t,n){var o=t[n],s=o.children.length,c=this._minEntries;this._chooseSplitAxis(o,c,s);var d=this._chooseSplitIndex(o,c,s),h=createNode(o.children.splice(d,o.children.length-d));h.height=o.height,h.leaf=o.leaf,calcBBox(o,this.toBBox),calcBBox(h,this.toBBox),n?t[n-1].children.push(h):this._splitRoot(o,h)},_splitRoot:function(t,n){this.data=createNode([t,n]),this.data.height=t.height+1,this.data.leaf=!1,calcBBox(this.data,this.toBBox)},_chooseSplitIndex:function(t,n,o){var s,c,d,h,p,y,E,L;for(y=E=1/0,s=n;s<=o-n;s++)c=distBBox(t,0,s,this.toBBox),d=distBBox(t,s,o,this.toBBox),h=intersectionArea(c,d),p=bboxArea(c)+bboxArea(d),h<y?(y=h,L=s,E=p<E?p:E):h===y&&p<E&&(E=p,L=s);return L},_chooseSplitAxis:function(t,n,o){var s=t.leaf?this.compareMinX:compareNodeMinX,c=t.leaf?this.compareMinY:compareNodeMinY,d=this._allDistMargin(t,n,o,s),h=this._allDistMargin(t,n,o,c);d<h&&t.children.sort(s)},_allDistMargin:function(t,n,o,s){t.children.sort(s);var c=this.toBBox,d=distBBox(t,0,n,c),h=distBBox(t,o-n,o,c),p=bboxMargin(d)+bboxMargin(h),y,E;for(y=n;y<o-n;y++)E=t.children[y],extend$1(d,t.leaf?c(E):E),p+=bboxMargin(d);for(y=o-n-1;y>=n;y--)E=t.children[y],extend$1(h,t.leaf?c(E):E),p+=bboxMargin(h);return p},_adjustParentBBoxes:function(t,n,o){for(var s=o;s>=0;s--)extend$1(n[s],t)},_condense:function(t){for(var n=t.length-1,o;n>=0;n--)t[n].children.length===0?n>0?(o=t[n-1].children,o.splice(o.indexOf(t[n]),1)):this.clear():calcBBox(t[n],this.toBBox)},_initFormat:function(t){var n=["return a"," - b",";"];this.compareMinX=new Function("a","b",n.join(t[0])),this.compareMinY=new Function("a","b",n.join(t[1])),this.toBBox=new Function("a","return {minX: a"+t[0]+", minY: a"+t[1]+", maxX: a"+t[2]+", maxY: a"+t[3]+"};")}};function findItem(t,n,o){if(!o)return n.indexOf(t);for(var s=0;s<n.length;s++)if(o(t,n[s]))return s;return-1}function calcBBox(t,n){distBBox(t,0,t.children.length,n,t)}function distBBox(t,n,o,s,c){c||(c=createNode(null)),c.minX=1/0,c.minY=1/0,c.maxX=-1/0,c.maxY=-1/0;for(var d=n,h;d<o;d++)h=t.children[d],extend$1(c,t.leaf?s(h):h);return c}function extend$1(t,n){return t.minX=Math.min(t.minX,n.minX),t.minY=Math.min(t.minY,n.minY),t.maxX=Math.max(t.maxX,n.maxX),t.maxY=Math.max(t.maxY,n.maxY),t}function compareNodeMinX(t,n){return t.minX-n.minX}function compareNodeMinY(t,n){return t.minY-n.minY}function bboxArea(t){return(t.maxX-t.minX)*(t.maxY-t.minY)}function bboxMargin(t){return t.maxX-t.minX+(t.maxY-t.minY)}function enlargedArea(t,n){return(Math.max(n.maxX,t.maxX)-Math.min(n.minX,t.minX))*(Math.max(n.maxY,t.maxY)-Math.min(n.minY,t.minY))}function intersectionArea(t,n){var o=Math.max(t.minX,n.minX),s=Math.max(t.minY,n.minY),c=Math.min(t.maxX,n.maxX),d=Math.min(t.maxY,n.maxY);return Math.max(0,c-o)*Math.max(0,d-s)}function contains(t,n){return t.minX<=n.minX&&t.minY<=n.minY&&n.maxX<=t.maxX&&n.maxY<=t.maxY}function intersects(t,n){return n.minX<=t.maxX&&n.minY<=t.maxY&&n.maxX>=t.minX&&n.maxY>=t.minY}function createNode(t){return{children:t,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function multiSelect(t,n,o,s,c){for(var d=[n,o],h;d.length;)o=d.pop(),n=d.pop(),!(o-n<=s)&&(h=n+Math.ceil((o-n)/s/2)*s,quickselect$1(t,h,n,o,c),d.push(n,h,h,o))}var rbushExports=rbush$2.exports;const rbush$1=getDefaultExportFromCjs(rbushExports);var RADIUS=6378137;function area(t){return geomReduce(t,function(n,o){return n+calculateArea(o)},0)}function calculateArea(t){var n=0,o;switch(t.type){case"Polygon":return polygonArea(t.coordinates);case"MultiPolygon":for(o=0;o<t.coordinates.length;o++)n+=polygonArea(t.coordinates[o]);return n;case"Point":case"MultiPoint":case"LineString":case"MultiLineString":return 0}return 0}function polygonArea(t){var n=0;if(t&&t.length>0){n+=Math.abs(ringArea(t[0]));for(var o=1;o<t.length;o++)n-=Math.abs(ringArea(t[o]))}return n}function ringArea(t){var n,o,s,c,d,h,p,y=0,E=t.length;if(E>2){for(p=0;p<E;p++)p===E-2?(c=E-2,d=E-1,h=0):p===E-1?(c=E-1,d=0,h=1):(c=p,d=p+1,h=p+2),n=t[c],o=t[d],s=t[h],y+=(rad(s[0])-rad(n[0]))*Math.sin(rad(o[1]));y=y*RADIUS*RADIUS/2}return y}function rad(t){return t*Math.PI/180}function booleanPointInPolygon(t,n,o){if(o===void 0&&(o={}),!t)throw new Error("point is required");if(!n)throw new Error("polygon is required");var s=getCoord$1(t),c=getGeom$1(n),d=c.type,h=n.bbox,p=c.coordinates;if(h&&inBBox(s,h)===!1)return!1;d==="Polygon"&&(p=[p]);for(var y=!1,E=0;E<p.length&&!y;E++)if(inRing(s,p[E][0],o.ignoreBoundary)){for(var L=!1,F=1;F<p[E].length&&!L;)inRing(s,p[E][F],!o.ignoreBoundary)&&(L=!0),F++;L||(y=!0)}return y}function inRing(t,n,o){var s=!1;n[0][0]===n[n.length-1][0]&&n[0][1]===n[n.length-1][1]&&(n=n.slice(0,n.length-1));for(var c=0,d=n.length-1;c<n.length;d=c++){var h=n[c][0],p=n[c][1],y=n[d][0],E=n[d][1],L=t[1]*(h-y)+p*(y-t[0])+E*(t[0]-h)===0&&(h-t[0])*(y-t[0])<=0&&(p-t[1])*(E-t[1])<=0;if(L)return!o;var F=p>t[1]!=E>t[1]&&t[0]<(y-h)*(t[1]-p)/(E-p)+h;F&&(s=!s)}return s}function inBBox(t,n){return n[0]<=t[0]&&n[1]<=t[1]&&n[2]>=t[0]&&n[3]>=t[1]}function isects(t,n,o){if(t.geometry.type!=="Polygon")throw new Error("The input feature must be a Polygon");o===void 0&&(o=1);var s=t.geometry.coordinates,c=[],d={};if(o){for(var h=[],p=0;p<s.length;p++)for(var y=0;y<s[p].length-1;y++)h.push(nt(p,y));var E=rbush$1();E.load(h)}for(var L=0;L<s.length;L++)for(var F=0;F<s[L].length-1;F++)if(o){var N=E.search(nt(L,F));N.forEach(function(lt){var Ee=lt.ring,yt=lt.edge;W(L,F,Ee,yt)})}else for(var z=0;z<s.length;z++)for(var oe=0;oe<s[z].length-1;oe++)W(L,F,z,oe);return n||(c={type:"Feature",geometry:{type:"MultiPoint",coordinates:c}}),c;function W(lt,Ee,yt,Ai){var zi=s[lt][Ee],ha=s[lt][Ee+1],ba=s[yt][Ai],Sa=s[yt][Ai+1],ya=intersect(zi,ha,ba,Sa);if(ya!==null){var ms,Wc;if(ha[0]!==zi[0]?ms=(ya[0]-zi[0])/(ha[0]-zi[0]):ms=(ya[1]-zi[1])/(ha[1]-zi[1]),Sa[0]!==ba[0]?Wc=(ya[0]-ba[0])/(Sa[0]-ba[0]):Wc=(ya[1]-ba[1])/(Sa[1]-ba[1]),!(ms>=1||ms<=0||Wc>=1||Wc<=0)){var Wa=ya,pi=!d[Wa];pi&&(d[Wa]=!0),n?c.push(n(ya,lt,Ee,zi,ha,ms,yt,Ai,ba,Sa,Wc,pi)):c.push(ya)}}}function nt(lt,Ee){var yt=s[lt][Ee],Ai=s[lt][Ee+1],zi,ha,ba,Sa;return yt[0]<Ai[0]?(zi=yt[0],ha=Ai[0]):(zi=Ai[0],ha=yt[0]),yt[1]<Ai[1]?(ba=yt[1],Sa=Ai[1]):(ba=Ai[1],Sa=yt[1]),{minX:zi,minY:ba,maxX:ha,maxY:Sa,ring:lt,edge:Ee}}}function intersect(t,n,o,s){if(equalArrays(t,o)||equalArrays(t,s)||equalArrays(n,o)||equalArrays(s,o))return null;var c=t[0],d=t[1],h=n[0],p=n[1],y=o[0],E=o[1],L=s[0],F=s[1],N=(c-h)*(E-F)-(d-p)*(y-L);if(N===0)return null;var z=((c*p-d*h)*(y-L)-(c-h)*(y*F-E*L))/N,oe=((c*p-d*h)*(E-F)-(d-p)*(y*F-E*L))/N;return[z,oe]}function equalArrays(t,n){if(!t||!n||t.length!==n.length)return!1;for(var o=0,s=t.length;o<s;o++)if(t[o]instanceof Array&&n[o]instanceof Array){if(!equalArrays(t[o],n[o]))return!1}else if(t[o]!==n[o])return!1;return!0}function simplepolygon(t){if(t.type!="Feature")throw new Error("The input must a geojson object of type Feature");if(t.geometry===void 0||t.geometry==null)throw new Error("The input must a geojson object with a non-empty geometry");if(t.geometry.type!="Polygon")throw new Error("The input must be a geojson Polygon");for(var n=t.geometry.coordinates.length,o=[],Ee=0;Ee<n;Ee++){var s=t.geometry.coordinates[Ee];equalArrays$1(s[0],s[s.length-1])||s.push(s[0]),o.push.apply(o,s.slice(0,s.length-1))}if(!isUnique(o))throw new Error("The input polygon may not have duplicate vertices (except for the first and last vertex of each ring)");var c=o.length,d=isects(t,function(nf,rf,uf,mf,Cf,vf,bf,Pf,Lf,wf,bs,af){return[nf,rf,uf,mf,Cf,vf,bf,Pf,Lf,wf,bs,af]}),h=d.length;if(h==0){for(var ba=[],Ee=0;Ee<n;Ee++)ba.push(polygon([t.geometry.coordinates[Ee]],{parent:-1,winding:windingOfRing(t.geometry.coordinates[Ee])}));var Xd=featureCollection(ba);return pu(),gl(),Xd}for(var p=[],y=[],Ee=0;Ee<n;Ee++){p.push([]);for(var E=0;E<t.geometry.coordinates[Ee].length-1;E++)p[Ee].push([new PseudoVtx(t.geometry.coordinates[Ee][modulo(E+1,t.geometry.coordinates[Ee].length-1)],1,[Ee,E],[Ee,modulo(E+1,t.geometry.coordinates[Ee].length-1)],void 0)]),y.push(new Isect(t.geometry.coordinates[Ee][E],[Ee,modulo(E-1,t.geometry.coordinates[Ee].length-1)],[Ee,E],void 0,void 0,!1,!0))}for(var Ee=0;Ee<h;Ee++)p[d[Ee][1]][d[Ee][2]].push(new PseudoVtx(d[Ee][0],d[Ee][5],[d[Ee][1],d[Ee][2]],[d[Ee][6],d[Ee][7]],void 0)),d[Ee][11]&&y.push(new Isect(d[Ee][0],[d[Ee][1],d[Ee][2]],[d[Ee][6],d[Ee][7]],void 0,void 0,!0,!0));for(var L=y.length,Ee=0;Ee<p.length;Ee++)for(var E=0;E<p[Ee].length;E++)p[Ee][E].sort(function(rf,uf){return rf.param<uf.param?-1:1});for(var F=[],Ee=0;Ee<L;Ee++)F.push({minX:y[Ee].coord[0],minY:y[Ee].coord[1],maxX:y[Ee].coord[0],maxY:y[Ee].coord[1],index:Ee});var N=rbush$1();N.load(F);for(var Ee=0;Ee<p.length;Ee++)for(var E=0;E<p[Ee].length;E++)for(var z=0;z<p[Ee][E].length;z++){var oe;z==p[Ee][E].length-1?oe=p[Ee][modulo(E+1,t.geometry.coordinates[Ee].length-1)][0].coord:oe=p[Ee][E][z+1].coord;var W=N.search({minX:oe[0],minY:oe[1],maxX:oe[0],maxY:oe[1]})[0];p[Ee][E][z].nxtIsectAlongEdgeIn=W.index}for(var Ee=0;Ee<p.length;Ee++)for(var E=0;E<p[Ee].length;E++)for(var z=0;z<p[Ee][E].length;z++){var oe=p[Ee][E][z].coord,W=N.search({minX:oe[0],minY:oe[1],maxX:oe[0],maxY:oe[1]})[0],nt=W.index;nt<c?y[nt].nxtIsectAlongRingAndEdge2=p[Ee][E][z].nxtIsectAlongEdgeIn:equalArrays$1(y[nt].ringAndEdge1,p[Ee][E][z].ringAndEdgeIn)?y[nt].nxtIsectAlongRingAndEdge1=p[Ee][E][z].nxtIsectAlongEdgeIn:y[nt].nxtIsectAlongRingAndEdge2=p[Ee][E][z].nxtIsectAlongEdgeIn}for(var lt=[],Ee=0,E=0;E<n;E++){for(var yt=Ee,z=0;z<t.geometry.coordinates[E].length-1;z++)y[Ee].coord[0]<y[yt].coord[0]&&(yt=Ee),Ee++;for(var Ai=y[yt].nxtIsectAlongRingAndEdge2,z=0;z<y.length;z++)if(y[z].nxtIsectAlongRingAndEdge1==yt||y[z].nxtIsectAlongRingAndEdge2==yt){var zi=z;break}var ha=isConvex([y[zi].coord,y[yt].coord,y[Ai].coord],!0)?1:-1;lt.push({isect:yt,parent:-1,winding:ha})}lt.sort(function(ef,nf){return y[ef.isect].coord>y[nf.isect].coord?-1:1});for(var ba=[];lt.length>0;){var Sa=lt.pop(),ya=Sa.isect,ms=Sa.parent,Wc=Sa.winding,Wa=ba.length,pi=[y[ya].coord],mt=ya;if(y[ya].ringAndEdge1Walkable)var fa=y[ya].ringAndEdge1,Ra=y[ya].nxtIsectAlongRingAndEdge1;else var fa=y[ya].ringAndEdge2,Ra=y[ya].nxtIsectAlongRingAndEdge2;for(;!equalArrays$1(y[ya].coord,y[Ra].coord);){pi.push(y[Ra].coord);for(var sl=void 0,Ee=0;Ee<lt.length;Ee++)if(lt[Ee].isect==Ra){sl=Ee;break}if(sl!=null&<.splice(sl,1),equalArrays$1(fa,y[Ra].ringAndEdge1)){if(fa=y[Ra].ringAndEdge2,y[Ra].ringAndEdge2Walkable=!1,y[Ra].ringAndEdge1Walkable){var Zd={isect:Ra};isConvex([y[mt].coord,y[Ra].coord,y[y[Ra].nxtIsectAlongRingAndEdge2].coord],Wc==1)?(Zd.parent=ms,Zd.winding=-Wc):(Zd.parent=Wa,Zd.winding=Wc),lt.push(Zd)}mt=Ra,Ra=y[Ra].nxtIsectAlongRingAndEdge2}else{if(fa=y[Ra].ringAndEdge1,y[Ra].ringAndEdge1Walkable=!1,y[Ra].ringAndEdge2Walkable){var Zd={isect:Ra};isConvex([y[mt].coord,y[Ra].coord,y[y[Ra].nxtIsectAlongRingAndEdge1].coord],Wc==1)?(Zd.parent=ms,Zd.winding=-Wc):(Zd.parent=Wa,Zd.winding=Wc),lt.push(Zd)}mt=Ra,Ra=y[Ra].nxtIsectAlongRingAndEdge1}}pi.push(y[Ra].coord),ba.push(polygon([pi],{index:Wa,parent:ms,winding:Wc,netWinding:void 0}))}var Xd=featureCollection(ba);pu(),gl();function pu(){for(var ef=[],nf=0;nf<Xd.features.length;nf++)Xd.features[nf].properties.parent==-1&&ef.push(nf);if(ef.length>1)for(var nf=0;nf<ef.length;nf++){for(var rf=-1,uf=1/0,mf=0;mf<Xd.features.length;mf++)ef[nf]!=mf&&booleanPointInPolygon(Xd.features[ef[nf]].geometry.coordinates[0][0],Xd.features[mf],{ignoreBoundary:!0})&&area(Xd.features[mf])<uf&&(rf=mf);Xd.features[ef[nf]].properties.parent=rf}}function gl(){for(var ef=0;ef<Xd.features.length;ef++)if(Xd.features[ef].properties.parent==-1){var nf=Xd.features[ef].properties.winding;Xd.features[ef].properties.netWinding=nf,md(ef,nf)}}function md(ef,nf){for(var rf=0;rf<Xd.features.length;rf++)if(Xd.features[rf].properties.parent==ef){var uf=nf+Xd.features[rf].properties.winding;Xd.features[rf].properties.netWinding=uf,md(rf,uf)}}return Xd}var PseudoVtx=function(t,n,o,s,c){this.coord=t,this.param=n,this.ringAndEdgeIn=o,this.ringAndEdgeOut=s,this.nxtIsectAlongEdgeIn=c},Isect=function(t,n,o,s,c,d,h){this.coord=t,this.ringAndEdge1=n,this.ringAndEdge2=o,this.nxtIsectAlongRingAndEdge1=s,this.nxtIsectAlongRingAndEdge2=c,this.ringAndEdge1Walkable=d,this.ringAndEdge2Walkable=h};function isConvex(t,n){if(typeof n>"u"&&(n=!0),t.length!=3)throw new Error("This function requires an array of three points [x,y]");var o=(t[1][0]-t[0][0])*(t[2][1]-t[0][1])-(t[1][1]-t[0][1])*(t[2][0]-t[0][0]);return o>=0==n}function windingOfRing(t){for(var n=0,o=0;o<t.length-1;o++)t[o][0]<t[n][0]&&(n=o);if(isConvex([t[modulo(n-1,t.length-1)],t[n],t[modulo(n+1,t.length-1)]],!0))var s=1;else var s=-1;return s}function equalArrays$1(t,n){if(!t||!n||t.length!=n.length)return!1;for(var o=0,s=t.length;o<s;o++)if(t[o]instanceof Array&&n[o]instanceof Array){if(!equalArrays$1(t[o],n[o]))return!1}else if(t[o]!=n[o])return!1;return!0}function modulo(t,n){return(t%n+n)%n}function isUnique(t){for(var n={},o=1,s=0,c=t.length;s<c;++s){if(Object.prototype.hasOwnProperty.call(n,t[s])){o=0;break}n[t[s]]=1}return o}function unkinkPolygon(t){var n=[];return flattenEach(t,function(o){o.geometry.type==="Polygon"&&featureEach(simplepolygon(o),function(s){n.push(polygon(s.geometry.coordinates,o.properties))})}),featureCollection(n)}function isNotNullish(t){return t!=null}function coordinatesToPositionsArray(t){return t.map(n=>n.map(([o,s])=>Cartesian3.fromDegrees(o,s,0)))}function convertGeometryToPositionsArray(t){return(t.type==="LineString"?coordinatesToPositionsArray([t.coordinates]):t.type==="Polygon"?coordinatesToPositionsArray(t.coordinates):t.coordinates.flatMap(n=>coordinatesToPositionsArray(n))).filter(({length:n})=>n>0)}function coordinatesToHierarchy(t){return t.length>0?{positions:t[0].map(([n,o])=>Cartesian3.fromDegrees(n,o,0)),holes:t.slice(1).map(n=>({positions:n.map(([o,s])=>Cartesian3.fromDegrees(o,s,0)),holes:[]}))}:void 0}function convertPolygonToHierarchyArray(t){return unkinkPolygon(t).features.map(o=>coordinatesToHierarchy(o.geometry.coordinates)).filter(isNotNullish)}const fontScale=5,scaleByDistance=new NearFarScalar(0,1/fontScale,Number.POSITIVE_INFINITY,1/fontScale),defaultStyle={default:{fontFamily:"sans-serif",fillColor:Color$1.BLACK,outlineColor:Color$1.WHITE.withAlpha(.8),outlineWidth:5},municipalities:{fontSize:12},towns:{fontSize:8,fillColor:Color$1.BLACK.withAlpha(.6)},roads:{fontSize:8},railways:{fontSize:8},stations:{fontSize:9},landmarks:{fontSize:8},topography:{fontSize:8,fillColor:Color$1.BLACK.withAlpha(.6)}};function resolveStyle(t,n){const o=getAnnotationType(t);if(o==null)return;const s=n==null?void 0:n[o];if(s===!1)return;const c=merge({},defaultStyle.default,defaultStyle[o],n==null?void 0:n.default,s),d=Object.fromEntries(Object.entries(c).map(([h,p])=>[h,typeof p=="string"&&isColor(p)?toColor$1(p):p]));return{scaleByDistance,...omit(d,["fontSize","fontFamily"]),font:(d==null?void 0:d.fontSize)!=null&&d.fontFamily!=null?`${d.fontSize*fontScale}pt ${d.fontFamily}`:void 0}}const positionScratch$1=new Cartesian3,cartographicScratch$1=new Cartographic;function getPosition(t,n,o,s,c,d,h,p=new Cartesian3){let y=n.geom[0][0].x/c,E=n.geom[0][0].y/c;if(t.level===17&&(y=y*2-t.x%2,E=E*2-t.y%2),y<0||y>1||E<0||E>1)return;const L=Cartographic.fromRadians(o.west+o.width*y,o.south+o.height*(1-E),d,cartographicScratch$1);if((s==null?void 0:s.some(F=>Rectangle.contains(F,L)))!==!0)return Cartographic.toCartesian(L,h,p)}const JapanGSIOptimalBVmapLabelImagery=React.memo(({imageryProvider:t,imagery:n,descendants:o,height:s=50,style:c=defaultStyle,labelCollection:d,near:h,far:p})=>{const y=$e$1(),E=suspend(async()=>await t.tileCache.get(getTileCoords(n,16)),[JapanGSIOptimalBVmapLabelImagery,n.key]),L=React.useMemo(()=>t.tilingScheme.tileXYToRectangle(n.x,n.y,n.level),[t,n]),F=React.useMemo(()=>o==null?void 0:o.map(lt=>t.tilingScheme.tileXYToRectangle(lt.x,lt.y,lt.level)),[t,o]),N=React.useMemo(()=>{const lt=E.get("Anno");return lt==null?[]:lt.filter(Ee=>typeof Ee.props.vt_code=="number"&&`${Ee.props.vt_code}`.length===3&&typeof Ee.props.vt_text=="string"&&(Ee.props.vt_arrng==null||typeof Ee.props.vt_arrng=="number")&&(Ee.props.vt_arrngagl==null||typeof Ee.props.vt_arrngagl=="number")&&(n.level<16||n.level===16&&Ee.props.vt_flag17!==2||n.level===17&&Ee.props.vr_flag17!==0))},[E,n]),z=React.useRef(),oe=y==null?void 0:y.scene,W=React.useCallback(()=>{const lt=z.current;lt!=null&&(lt.forEach(([Ee,yt])=>{var zi;const Ai=getPosition(n,Ee,L,F,t.tileCache.tileSize,s,(zi=oe==null?void 0:oe.globe)==null?void 0:zi.ellipsoid,positionScratch$1);Ai!=null?(yt.position=Ai,yt.show=!0):yt.show=!1}),oe==null||oe.requestRender())},[t,n,s,L,F,oe]),nt=React.useRef(W);return nt.current=W,React.useEffect(()=>{if(!oe||!d)return;const lt=[],Ee=N.map(Ai=>{const zi=resolveStyle(Ai.props.vt_code,c);if(zi==null)return;const ha=Ai.props.vt_text;if(lt.includes(ha))return;lt.push(ha);const ba={text:ha,style:LabelStyle$1.FILL_AND_OUTLINE,horizontalOrigin:HorizontalOrigin$1.CENTER,verticalOrigin:VerticalOrigin$1.BOTTOM,heightReference:HeightReference$1.CLAMP_TO_GROUND,distanceDisplayCondition:h||p?new Cesium$1.DistanceDisplayCondition(h,p):void 0,disableDepthTestDistance:1/0,...zi};return[Ai,d.add(ba)]}).filter(isNotNullish);z.current=Ee,nt.current();const yt=()=>{d.isDestroyed()||Ee.forEach(([,Ai])=>{d.remove(Ai)}),oe.isDestroyed()||oe==null||oe.postRender.removeEventListener(yt)};return()=>{z.current=void 0,oe.isDestroyed()||oe==null||oe.postRender.addEventListener(yt)}},[c,N,oe,d,h,p]),React.useEffect(()=>{W()},[W]),null});JapanGSIOptimalBVmapLabelImagery.displayName="JapanGSIOptimalBVmapLabelImagery";const hasMethod=t=>n=>n!=null&&typeof n=="object"&&t in n&&typeof n[t]=="function";function createDestructor(t,n){if(t.owner!=null){invariant$1(t.transferOwnership!=null);const o=t.owner,s=t.transferOwnership(n,t.owner);return()=>{(!hasMethod("isDestroyed")(o)||!o.isDestroyed())&&s()}}else{const o=t.destroy;return()=>{typeof o=="function"?o(n):o!==null&&hasMethod("destroy")(n)&&n.destroy()}}}function useInstance(t){const[n,o]=React.useState(),s=React.useRef();return s.current==null&&(s.current=t.create()),React.useEffect(()=>{s.current==null&&(s.current=t.create(),o(s.current));const c=s.current,d=createDestructor(t,c);return()=>{d(),s.current=void 0,o(void 0)}},[t.owner,...t.keys]),n??s.current}const LabelImageryLayer=React.forwardRef(function({url:n,tilingScheme:o,tileWidth:s,tileHeight:c,minimumLevel:d,maximumLevel:h,minimumDataLevel:p,maximumDataLevel:y,...E},L){const F=useInstance({keys:[n,o,s,c,p,y],create:()=>new JapanGSIOptimalBVmapLabelImageryProvider({url:n,tilingScheme:o??new Cesium$1.WebMercatorTilingScheme,tileWidth:s,tileHeight:c,minimumDataLevel:p,maximumDataLevel:y})});return Object.assign(F,{minimumLevel:d,maximumLevel:h}),jsxRuntimeExports.jsx(Ns$1,{ref:L,imageryProvider:F,...E})});function getAncestorKeys(t,n){if(t.level===n)return[];const o=2**t.level,s=t.x/o,c=t.y/o;return[...Array(t.level-n)].map((d,h)=>{const p=t.level-(h+1),y=2**p;return makeKey({x:Math.floor(s*y),y:Math.floor(c*y),level:p})})}function isEqualKeys(t,n){return n!=null&&t.length===n.length&&xorBy(t,n,"key").length===0}function getImageriesToRender(t,n){const o=t.globe;let s=1/0,c=-1/0;const d=uniqBy(o._surface._tilesToRender.flatMap(p=>{var y;return((y=p.data)==null?void 0:y.imagery.map(E=>E.readyImagery).filter(E=>(E==null?void 0:E.imageryLayer.imageryProvider)!==n?!1:(E.key=makeKey(E),E.level<s&&(s=E.level),E.level>c&&(c=E.level),!0)))??[]}),"key").sort((p,y)=>p.key.localeCompare(y.key));if(s===c||s===1/0||c===-1/0)return d;const h=fromPairs(d.map(p=>[p.key,{imagery:p,children:[],descendants:[]}]));return d.forEach(p=>{getAncestorKeys(p,s).forEach(E=>{const L=h[E];L!=null&&(L.descendants.push(p),p.level-L.imagery.level===1&&L.children.push(p))})}),Object.values(h).forEach(({imagery:p,children:y,descendants:E})=>{isEqualKeys(y,p.children)||(p.children=y),isEqualKeys(E,p.descendants)||(p.descendants=E)}),d.filter(p=>p.children!=null&&p.children.length<4)}const LabelImageryCollection=({imageryProvider:t,imageriesAtom:n,style:o,labelCollection:s,near:c,far:d})=>{const h=useAtomValue(n);return jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{children:h.map(p=>jsxRuntimeExports.jsx(React.Suspense,{children:jsxRuntimeExports.jsx(JapanGSIOptimalBVmapLabelImagery,{imageryProvider:t,imagery:p,descendants:p.descendants,style:o,labelCollection:s,near:c,far:d})},p.key))})},JapanGSIOptimalBVmapVectorMapLabel=({style:t,near:n,far:o})=>{const[s,c]=React.useState(),d=React.useCallback(z=>{var oe;c(((oe=z==null?void 0:z.cesiumElement)==null?void 0:oe.imageryProvider)instanceof JapanGSIOptimalBVmapLabelImageryProvider?z.cesiumElement.imageryProvider:void 0)},[]),h=React.useMemo(()=>{const z=atom([]);return atom(oe=>oe(z),(oe,W,nt)=>{const lt=oe(z),Ee=typeof nt=="function"?nt(lt):nt;lt.length!==Ee.length&&xorBy(lt,Ee,"key").length>0&&W(z,Ee)})},[]),p=useSetAtom(h);usePreRender(z=>{if(s==null)return;const oe=getImageriesToRender(z,s);p(oe)});const{labelCollection:y,scene:E}=$e$1(),L=React.useRef(!1),F=React.useMemo(()=>y??(E?new Cesium$1.LabelCollection({scene:E}):void 0),[E,y]);React.useEffect(()=>{!y&&E&&!L.current&&(E.primitives.add(F),L.current=!0)},[y,F,E]);const N=React.useRef(0);return usePreRender(z=>{F&&N.current!==F._labelsToUpdate.length&&(z.requestRender(),N.current=F._labelsToUpdate.length)}),React.useEffect(()=>()=>{E!=null&&E.isDestroyed()||E==null||E.requestRender()},[E]),jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx(LabelImageryLayer,{ref:d,url:"https://cyberjapandata.gsi.go.jp/xyz/optimal_bvmap-v1/{z}/{x}/{y}.pbf",tileWidth:1024,tileHeight:1024,maximumLevel:17,minimumDataLevel:4,maximumDataLevel:16}),s!=null&&jsxRuntimeExports.jsx(LabelImageryCollection,{imageryProvider:s,imageriesAtom:h,style:t,labelCollection:F,near:n,far:o})]})},LabelImageryLayers=React.memo(({tileLabels:t=[]})=>jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{children:t.map(n=>{if(!n)return null;switch(n.labelType){case"japan_gsi_optimal_bvmap":return jsxRuntimeExports.jsx(JapanGSIOptimalBVmapVectorMapLabel,{style:n.style,near:n.near,far:n.far},n.id);default:return null}})}),(t,n)=>isEqual(t.tileLabels,n.tileLabels));LabelImageryLayers.displayName="LabelImageryLayers";function Event({onMount:t,onUnmount:n}){return React.useEffect(()=>(t==null||t(),()=>n==null?void 0:n()),[t,n]),null}const perf=typeof performance=="object"&&performance&&typeof performance.now=="function"?performance:Date,warned$1=new Set,emitWarning$1=(t,n,o,s)=>{typeof process=="object"&&process&&typeof process.emitWarning=="function"?process.emitWarning(t,n,o,s):console.error(`[${o}] ${n}: ${t}`)},shouldWarn=t=>!warned$1.has(t),isPosInt=t=>t&&t===Math.floor(t)&&t>0&&isFinite(t),getUintArray=t=>isPosInt(t)?t<=Math.pow(2,8)?Uint8Array:t<=Math.pow(2,16)?Uint16Array:t<=Math.pow(2,32)?Uint32Array:t<=Number.MAX_SAFE_INTEGER?ZeroArray:null:null;class ZeroArray extends Array{constructor(n){super(n),this.fill(0)}}const Qf=class Qf{constructor(n,o){Vf(this,"heap");Vf(this,"length");if(!sf(Qf,Jf))throw new TypeError("instantiate Stack using Stack.create(n)");this.heap=new o(n),this.length=0}static create(n){const o=getUintArray(n);if(!o)return[];Xf(Qf,Jf,!0);const s=new Qf(n,o);return Xf(Qf,Jf,!1),s}push(n){this.heap[this.length++]=n}pop(){return this.heap[--this.length]}};Jf=new WeakMap,Yf(Qf,Jf,!1);let Stack=Qf;const qp=class qp{constructor(n){Yf(this,Wp);Yf(this,Yp);Yf(this,wp);Yf(this,Mp);Yf(this,Bp);Yf(this,zp);Yf(this,Up);Yf(this,zm);Yf(this,$p);Yf(this,Dp);Yf(this,Om,void 0);Yf(this,lp,void 0);Yf(this,_p,void 0);Yf(this,xp,void 0);Yf(this,Np,void 0);Vf(this,"ttl");Vf(this,"ttlResolution");Vf(this,"ttlAutopurge");Vf(this,"updateAgeOnGet");Vf(this,"updateAgeOnHas");Vf(this,"allowStale");Vf(this,"noDisposeOnSet");Vf(this,"noUpdateTTL");Vf(this,"maxEntrySize");Vf(this,"sizeCalculation");Vf(this,"noDeleteOnFetchRejection");Vf(this,"noDeleteOnStaleGet");Vf(this,"allowStaleOnFetchAbort");Vf(this,"allowStaleOnFetchRejection");Vf(this,"ignoreFetchAbort");Yf(this,ap,void 0);Yf(this,Sp,void 0);Yf(this,sp,void 0);Yf(this,Bm,void 0);Yf(this,jf,void 0);Yf(this,fp,void 0);Yf(this,bp,void 0);Yf(this,hp,void 0);Yf(this,up,void 0);Yf(this,Ep,void 0);Yf(this,dp,void 0);Yf(this,Pp,void 0);Yf(this,Ip,void 0);Yf(this,Tp,void 0);Yf(this,Rp,void 0);Yf(this,Op,void 0);Yf(this,gp,void 0);Yf(this,Ap,()=>{});Yf(this,Vp,()=>{});Yf(this,Xp,()=>{});Yf(this,Cp,()=>!1);Yf(this,Gp,n=>{});Yf(this,kp,(n,o,s)=>{});Yf(this,Zp,(n,o,s,c)=>{if(s||c)throw new TypeError("cannot set size without setting maxSize or maxEntrySize on cache");return 0});const{max:o=0,ttl:s,ttlResolution:c=1,ttlAutopurge:d,updateAgeOnGet:h,updateAgeOnHas:p,allowStale:y,dispose:E,disposeAfter:L,noDisposeOnSet:F,noUpdateTTL:N,maxSize:z=0,maxEntrySize:oe=0,sizeCalculation:W,fetchMethod:nt,noDeleteOnFetchRejection:lt,noDeleteOnStaleGet:Ee,allowStaleOnFetchRejection:yt,allowStaleOnFetchAbort:Ai,ignoreFetchAbort:zi}=n;if(o!==0&&!isPosInt(o))throw new TypeError("max option must be a nonnegative integer");const ha=o?getUintArray(o):Array;if(!ha)throw new Error("invalid max value: "+o);if(Xf(this,Om,o),Xf(this,lp,z),this.maxEntrySize=oe||sf(this,lp),this.sizeCalculation=W,this.sizeCalculation){if(!sf(this,lp)&&!this.maxEntrySize)throw new TypeError("cannot set sizeCalculation without setting maxSize or maxEntrySize");if(typeof this.sizeCalculation!="function")throw new TypeError("sizeCalculation set to non-function")}if(nt!==void 0&&typeof nt!="function")throw new TypeError("fetchMethod must be a function if specified");if(Xf(this,Np,nt),Xf(this,Op,!!nt),Xf(this,sp,new Map),Xf(this,Bm,new Array(o).fill(void 0)),Xf(this,jf,new Array(o).fill(void 0)),Xf(this,fp,new ha(o)),Xf(this,bp,new ha(o)),Xf(this,hp,0),Xf(this,up,0),Xf(this,Ep,Stack.create(o)),Xf(this,ap,0),Xf(this,Sp,0),typeof E=="function"&&Xf(this,_p,E),typeof L=="function"?(Xf(this,xp,L),Xf(this,dp,[])):(Xf(this,xp,void 0),Xf(this,dp,void 0)),Xf(this,Rp,!!sf(this,_p)),Xf(this,gp,!!sf(this,xp)),this.noDisposeOnSet=!!F,this.noUpdateTTL=!!N,this.noDeleteOnFetchRejection=!!lt,this.allowStaleOnFetchRejection=!!yt,this.allowStaleOnFetchAbort=!!Ai,this.ignoreFetchAbort=!!zi,this.maxEntrySize!==0){if(sf(this,lp)!==0&&!isPosInt(sf(this,lp)))throw new TypeError("maxSize must be a positive integer if specified");if(!isPosInt(this.maxEntrySize))throw new TypeError("maxEntrySize must be a positive integer if specified");kf(this,Yp,og).call(this)}if(this.allowStale=!!y,this.noDeleteOnStaleGet=!!Ee,this.updateAgeOnGet=!!h,this.updateAgeOnHas=!!p,this.ttlResolution=isPosInt(c)||c===0?c:1,this.ttlAutopurge=!!d,this.ttl=s||0,this.ttl){if(!isPosInt(this.ttl))throw new TypeError("ttl must be a positive integer if specified");kf(this,Wp,tg).call(this)}if(sf(this,Om)===0&&this.ttl===0&&sf(this,lp)===0)throw new TypeError("At least one of max, maxSize, or ttl is required");if(!this.ttlAutopurge&&!sf(this,Om)&&!sf(this,lp)){const ba="LRU_CACHE_UNBOUNDED";shouldWarn(ba)&&(warned$1.add(ba),emitWarning$1("TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption.","UnboundedCacheWarning",ba,qp))}}static unsafeExposeInternals(n){return{starts:sf(n,Ip),ttls:sf(n,Tp),sizes:sf(n,Pp),keyMap:sf(n,sp),keyList:sf(n,Bm),valList:sf(n,jf),next:sf(n,fp),prev:sf(n,bp),get head(){return sf(n,hp)},get tail(){return sf(n,up)},free:sf(n,Ep),isBackgroundFetch:o=>{var s;return kf(s=n,zm,qm).call(s,o)},backgroundFetch:(o,s,c,d)=>{var h;return kf(h=n,Up,Qp).call(h,o,s,c,d)},moveToTail:o=>{var s;return kf(s=n,Dp,jp).call(s,o)},indexes:o=>{var s;return kf(s=n,wp,Lp).call(s,o)},rindexes:o=>{var s;return kf(s=n,Mp,Fp).call(s,o)},isStale:o=>{var s;return sf(s=n,Cp).call(s,o)}}}get max(){return sf(this,Om)}get maxSize(){return sf(this,lp)}get calculatedSize(){return sf(this,Sp)}get size(){return sf(this,ap)}get fetchMethod(){return sf(this,Np)}get dispose(){return sf(this,_p)}get disposeAfter(){return sf(this,xp)}getRemainingTTL(n){return sf(this,sp).has(n)?1/0:0}*entries(){for(const n of kf(this,wp,Lp).call(this))sf(this,jf)[n]!==void 0&&sf(this,Bm)[n]!==void 0&&!kf(this,zm,qm).call(this,sf(this,jf)[n])&&(yield[sf(this,Bm)[n],sf(this,jf)[n]])}*rentries(){for(const n of kf(this,Mp,Fp).call(this))sf(this,jf)[n]!==void 0&&sf(this,Bm)[n]!==void 0&&!kf(this,zm,qm).call(this,sf(this,jf)[n])&&(yield[sf(this,Bm)[n],sf(this,jf)[n]])}*keys(){for(const n of kf(this,wp,Lp).call(this)){const o=sf(this,Bm)[n];o!==void 0&&!kf(this,zm,qm).call(this,sf(this,jf)[n])&&(yield o)}}*rkeys(){for(const n of kf(this,Mp,Fp).call(this)){const o=sf(this,Bm)[n];o!==void 0&&!kf(this,zm,qm).call(this,sf(this,jf)[n])&&(yield o)}}*values(){for(const n of kf(this,wp,Lp).call(this))sf(this,jf)[n]!==void 0&&!kf(this,zm,qm).call(this,sf(this,jf)[n])&&(yield sf(this,jf)[n])}*rvalues(){for(const n of kf(this,Mp,Fp).call(this))sf(this,jf)[n]!==void 0&&!kf(this,zm,qm).call(this,sf(this,jf)[n])&&(yield sf(this,jf)[n])}[Symbol.iterator](){return this.entries()}find(n,o={}){for(const s of kf(this,wp,Lp).call(this)){const c=sf(this,jf)[s],d=kf(this,zm,qm).call(this,c)?c.__staleWhileFetching:c;if(d!==void 0&&n(d,sf(this,Bm)[s],this))return this.get(sf(this,Bm)[s],o)}}forEach(n,o=this){for(const s of kf(this,wp,Lp).call(this)){const c=sf(this,jf)[s],d=kf(this,zm,qm).call(this,c)?c.__staleWhileFetching:c;d!==void 0&&n.call(o,d,sf(this,Bm)[s],this)}}rforEach(n,o=this){for(const s of kf(this,Mp,Fp).call(this)){const c=sf(this,jf)[s],d=kf(this,zm,qm).call(this,c)?c.__staleWhileFetching:c;d!==void 0&&n.call(o,d,sf(this,Bm)[s],this)}}purgeStale(){let n=!1;for(const o of kf(this,Mp,Fp).call(this,{allowStale:!0}))sf(this,Cp).call(this,o)&&(this.delete(sf(this,Bm)[o]),n=!0);return n}dump(){const n=[];for(const o of kf(this,wp,Lp).call(this,{allowStale:!0})){const s=sf(this,Bm)[o],c=sf(this,jf)[o],d=kf(this,zm,qm).call(this,c)?c.__staleWhileFetching:c;if(d===void 0||s===void 0)continue;const h={value:d};if(sf(this,Tp)&&sf(this,Ip)){h.ttl=sf(this,Tp)[o];const p=perf.now()-sf(this,Ip)[o];h.start=Math.floor(Date.now()-p)}sf(this,Pp)&&(h.size=sf(this,Pp)[o]),n.unshift([s,h])}return n}load(n){this.clear();for(const[o,s]of n){if(s.start){const c=Date.now()-s.start;s.start=perf.now()-c}this.set(o,s.value,s)}}set(n,o,s={}){var N,z,oe;const{ttl:c=this.ttl,start:d,noDisposeOnSet:h=this.noDisposeOnSet,sizeCalculation:p=this.sizeCalculation,status:y}=s;let{noUpdateTTL:E=this.noUpdateTTL}=s;const L=sf(this,Zp).call(this,n,o,s.size||0,p);if(this.maxEntrySize&&L>this.maxEntrySize)return y&&(y.set="miss",y.maxEntrySizeExceeded=!0),this.delete(n),this;let F=sf(this,ap)===0?void 0:sf(this,sp).get(n);if(F===void 0)F=sf(this,ap)===0?sf(this,up):sf(this,Ep).length!==0?sf(this,Ep).pop():sf(this,ap)===sf(this,Om)?kf(this,zp,Jp).call(this,!1):sf(this,ap),sf(this,Bm)[F]=n,sf(this,jf)[F]=o,sf(this,sp).set(n,F),sf(this,fp)[sf(this,up)]=F,sf(this,bp)[F]=sf(this,up),Xf(this,up,F),Kp(this,ap)._++,sf(this,kp).call(this,F,L,y),y&&(y.set="add"),E=!1;else{kf(this,Dp,jp).call(this,F);const W=sf(this,jf)[F];if(o!==W){if(sf(this,Op)&&kf(this,zm,qm).call(this,W)?W.__abortController.abort(new Error("replaced")):h||(sf(this,Rp)&&((N=sf(this,_p))==null||N.call(this,W,n,"set")),sf(this,gp)&&((z=sf(this,dp))==null||z.push([W,n,"set"]))),sf(this,Gp).call(this,F),sf(this,kp).call(this,F,L,y),sf(this,jf)[F]=o,y){y.set="replace";const nt=W&&kf(this,zm,qm).call(this,W)?W.__staleWhileFetching:W;nt!==void 0&&(y.oldValue=nt)}}else y&&(y.set="update")}if(c!==0&&!sf(this,Tp)&&kf(this,Wp,tg).call(this),sf(this,Tp)&&(E||sf(this,Xp).call(this,F,c,d),y&&sf(this,Vp).call(this,y,F)),!h&&sf(this,gp)&&sf(this,dp)){const W=sf(this,dp);let nt;for(;nt=W==null?void 0:W.shift();)(oe=sf(this,xp))==null||oe.call(this,...nt)}return this}pop(){var n;try{for(;sf(this,ap);){const o=sf(this,jf)[sf(this,hp)];if(kf(this,zp,Jp).call(this,!0),kf(this,zm,qm).call(this,o)){if(o.__staleWhileFetching)return o.__staleWhileFetching}else if(o!==void 0)return o}}finally{if(sf(this,gp)&&sf(this,dp)){const o=sf(this,dp);let s;for(;s=o==null?void 0:o.shift();)(n=sf(this,xp))==null||n.call(this,...s)}}}has(n,o={}){const{updateAgeOnHas:s=this.updateAgeOnHas,status:c}=o,d=sf(this,sp).get(n);if(d!==void 0){const h=sf(this,jf)[d];if(kf(this,zm,qm).call(this,h)&&h.__staleWhileFetching===void 0)return!1;if(sf(this,Cp).call(this,d))c&&(c.has="stale",sf(this,Vp).call(this,c,d));else return s&&sf(this,Ap).call(this,d),c&&(c.has="hit",sf(this,Vp).call(this,c,d)),!0}else c&&(c.has="miss");return!1}peek(n,o={}){const{allowStale:s=this.allowStale}=o,c=sf(this,sp).get(n);if(c!==void 0&&(s||!sf(this,Cp).call(this,c))){const d=sf(this,jf)[c];return kf(this,zm,qm).call(this,d)?d.__staleWhileFetching:d}}async fetch(n,o={}){const{allowStale:s=this.allowStale,updateAgeOnGet:c=this.updateAgeOnGet,noDeleteOnStaleGet:d=this.noDeleteOnStaleGet,ttl:h=this.ttl,noDisposeOnSet:p=this.noDisposeOnSet,size:y=0,sizeCalculation:E=this.sizeCalculation,noUpdateTTL:L=this.noUpdateTTL,noDeleteOnFetchRejection:F=this.noDeleteOnFetchRejection,allowStaleOnFetchRejection:N=this.allowStaleOnFetchRejection,ignoreFetchAbort:z=this.ignoreFetchAbort,allowStaleOnFetchAbort:oe=this.allowStaleOnFetchAbort,context:W,forceRefresh:nt=!1,status:lt,signal:Ee}=o;if(!sf(this,Op))return lt&&(lt.fetch="get"),this.get(n,{allowStale:s,updateAgeOnGet:c,noDeleteOnStaleGet:d,status:lt});const yt={allowStale:s,updateAgeOnGet:c,noDeleteOnStaleGet:d,ttl:h,noDisposeOnSet:p,size:y,sizeCalculation:E,noUpdateTTL:L,noDeleteOnFetchRejection:F,allowStaleOnFetchRejection:N,allowStaleOnFetchAbort:oe,ignoreFetchAbort:z,status:lt,signal:Ee};let Ai=sf(this,sp).get(n);if(Ai===void 0){lt&&(lt.fetch="miss");const zi=kf(this,Up,Qp).call(this,n,Ai,yt,W);return zi.__returned=zi}else{const zi=sf(this,jf)[Ai];if(kf(this,zm,qm).call(this,zi)){const ms=s&&zi.__staleWhileFetching!==void 0;return lt&&(lt.fetch="inflight",ms&&(lt.returnedStale=!0)),ms?zi.__staleWhileFetching:zi.__returned=zi}const ha=sf(this,Cp).call(this,Ai);if(!nt&&!ha)return lt&&(lt.fetch="hit"),kf(this,Dp,jp).call(this,Ai),c&&sf(this,Ap).call(this,Ai),lt&&sf(this,Vp).call(this,lt,Ai),zi;const ba=kf(this,Up,Qp).call(this,n,Ai,yt,W),ya=ba.__staleWhileFetching!==void 0&&s;return lt&&(lt.fetch=ha?"stale":"refresh",ya&&ha&&(lt.returnedStale=!0)),ya?ba.__staleWhileFetching:ba.__returned=ba}}get(n,o={}){const{allowStale:s=this.allowStale,updateAgeOnGet:c=this.updateAgeOnGet,noDeleteOnStaleGet:d=this.noDeleteOnStaleGet,status:h}=o,p=sf(this,sp).get(n);if(p!==void 0){const y=sf(this,jf)[p],E=kf(this,zm,qm).call(this,y);return h&&sf(this,Vp).call(this,h,p),sf(this,Cp).call(this,p)?(h&&(h.get="stale"),E?(h&&s&&y.__staleWhileFetching!==void 0&&(h.returnedStale=!0),s?y.__staleWhileFetching:void 0):(d||this.delete(n),h&&s&&(h.returnedStale=!0),s?y:void 0)):(h&&(h.get="hit"),E?y.__staleWhileFetching:(kf(this,Dp,jp).call(this,p),c&&sf(this,Ap).call(this,p),y))}else h&&(h.get="miss")}delete(n){var s,c,d,h;let o=!1;if(sf(this,ap)!==0){const p=sf(this,sp).get(n);if(p!==void 0)if(o=!0,sf(this,ap)===1)this.clear();else{sf(this,Gp).call(this,p);const y=sf(this,jf)[p];kf(this,zm,qm).call(this,y)?y.__abortController.abort(new Error("deleted")):(sf(this,Rp)||sf(this,gp))&&(sf(this,Rp)&&((s=sf(this,_p))==null||s.call(this,y,n,"delete")),sf(this,gp)&&((c=sf(this,dp))==null||c.push([y,n,"delete"]))),sf(this,sp).delete(n),sf(this,Bm)[p]=void 0,sf(this,jf)[p]=void 0,p===sf(this,up)?Xf(this,up,sf(this,bp)[p]):p===sf(this,hp)?Xf(this,hp,sf(this,fp)[p]):(sf(this,fp)[sf(this,bp)[p]]=sf(this,fp)[p],sf(this,bp)[sf(this,fp)[p]]=sf(this,bp)[p]),Kp(this,ap)._--,sf(this,Ep).push(p)}}if(sf(this,gp)&&((d=sf(this,dp))!=null&&d.length)){const p=sf(this,dp);let y;for(;y=p==null?void 0:p.shift();)(h=sf(this,xp))==null||h.call(this,...y)}return o}clear(){var n,o,s;for(const c of kf(this,Mp,Fp).call(this,{allowStale:!0})){const d=sf(this,jf)[c];if(kf(this,zm,qm).call(this,d))d.__abortController.abort(new Error("deleted"));else{const h=sf(this,Bm)[c];sf(this,Rp)&&((n=sf(this,_p))==null||n.call(this,d,h,"delete")),sf(this,gp)&&((o=sf(this,dp))==null||o.push([d,h,"delete"]))}}if(sf(this,sp).clear(),sf(this,jf).fill(void 0),sf(this,Bm).fill(void 0),sf(this,Tp)&&sf(this,Ip)&&(sf(this,Tp).fill(0),sf(this,Ip).fill(0)),sf(this,Pp)&&sf(this,Pp).fill(0),Xf(this,hp,0),Xf(this,up,0),sf(this,Ep).length=0,Xf(this,Sp,0),Xf(this,ap,0),sf(this,gp)&&sf(this,dp)){const c=sf(this,dp);let d;for(;d=c==null?void 0:c.shift();)(s=sf(this,xp))==null||s.call(this,...d)}}};Om=new WeakMap,lp=new WeakMap,_p=new WeakMap,xp=new WeakMap,Np=new WeakMap,ap=new WeakMap,Sp=new WeakMap,sp=new WeakMap,Bm=new WeakMap,jf=new WeakMap,fp=new WeakMap,bp=new WeakMap,hp=new WeakMap,up=new WeakMap,Ep=new WeakMap,dp=new WeakMap,Pp=new WeakMap,Ip=new WeakMap,Tp=new WeakMap,Rp=new WeakMap,Op=new WeakMap,gp=new WeakMap,Wp=new WeakSet,tg=function(){const n=new ZeroArray(sf(this,Om)),o=new ZeroArray(sf(this,Om));Xf(this,Tp,n),Xf(this,Ip,o),Xf(this,Xp,(d,h,p=perf.now())=>{if(o[d]=h!==0?p:0,n[d]=h,h!==0&&this.ttlAutopurge){const y=setTimeout(()=>{sf(this,Cp).call(this,d)&&this.delete(sf(this,Bm)[d])},h+1);y.unref&&y.unref()}}),Xf(this,Ap,d=>{o[d]=n[d]!==0?perf.now():0}),Xf(this,Vp,(d,h)=>{if(n[h]){const p=n[h],y=o[h];d.ttl=p,d.start=y,d.now=s||c(),d.remainingTTL=d.now+p-y}});let s=0;const c=()=>{const d=perf.now();if(this.ttlResolution>0){s=d;const h=setTimeout(()=>s=0,this.ttlResolution);h.unref&&h.unref()}return d};this.getRemainingTTL=d=>{const h=sf(this,sp).get(d);return h===void 0?0:n[h]===0||o[h]===0?1/0:o[h]+n[h]-(s||c())},Xf(this,Cp,d=>n[d]!==0&&o[d]!==0&&(s||c())-o[d]>n[d])},Ap=new WeakMap,Vp=new WeakMap,Xp=new WeakMap,Cp=new WeakMap,Yp=new WeakSet,og=function(){const n=new ZeroArray(sf(this,Om));Xf(this,Sp,0),Xf(this,Pp,n),Xf(this,Gp,o=>{Xf(this,Sp,sf(this,Sp)-n[o]),n[o]=0}),Xf(this,Zp,(o,s,c,d)=>{if(kf(this,zm,qm).call(this,s))return 0;if(!isPosInt(c))if(d){if(typeof d!="function")throw new TypeError("sizeCalculation must be a function");if(c=d(s,o),!isPosInt(c))throw new TypeError("sizeCalculation return invalid (expect positive integer)")}else throw new TypeError("invalid size value (must be positive integer). When maxSize or maxEntrySize is used, sizeCalculation or size must be set.");return c}),Xf(this,kp,(o,s,c)=>{if(n[o]=s,sf(this,lp)){const d=sf(this,lp)-n[o];for(;sf(this,Sp)>d;)kf(this,zp,Jp).call(this,!0)}Xf(this,Sp,sf(this,Sp)+n[o]),c&&(c.entrySize=s,c.totalCalculatedSize=sf(this,Sp))})},Gp=new WeakMap,kp=new WeakMap,Zp=new WeakMap,wp=new WeakSet,Lp=function*({allowStale:n=this.allowStale}={}){if(sf(this,ap))for(let o=sf(this,up);!(!kf(this,Bp,ng).call(this,o)||((n||!sf(this,Cp).call(this,o))&&(yield o),o===sf(this,hp)));)o=sf(this,bp)[o]},Mp=new WeakSet,Fp=function*({allowStale:n=this.allowStale}={}){if(sf(this,ap))for(let o=sf(this,hp);!(!kf(this,Bp,ng).call(this,o)||((n||!sf(this,Cp).call(this,o))&&(yield o),o===sf(this,up)));)o=sf(this,fp)[o]},Bp=new WeakSet,ng=function(n){return n!==void 0&&sf(this,sp).get(sf(this,Bm)[n])===n},zp=new WeakSet,Jp=function(n){var d,h;const o=sf(this,hp),s=sf(this,Bm)[o],c=sf(this,jf)[o];return sf(this,Op)&&kf(this,zm,qm).call(this,c)?c.__abortController.abort(new Error("evicted")):(sf(this,Rp)||sf(this,gp))&&(sf(this,Rp)&&((d=sf(this,_p))==null||d.call(this,c,s,"evict")),sf(this,gp)&&((h=sf(this,dp))==null||h.push([c,s,"evict"]))),sf(this,Gp).call(this,o),n&&(sf(this,Bm)[o]=void 0,sf(this,jf)[o]=void 0,sf(this,Ep).push(o)),sf(this,ap)===1?(Xf(this,hp,Xf(this,up,0)),sf(this,Ep).length=0):Xf(this,hp,sf(this,fp)[o]),sf(this,sp).delete(s),Kp(this,ap)._--,o},Up=new WeakSet,Qp=function(n,o,s,c){const d=o===void 0?void 0:sf(this,jf)[o];if(kf(this,zm,qm).call(this,d))return d;const h=new AbortController,{signal:p}=s;p==null||p.addEventListener("abort",()=>h.abort(p.reason),{signal:h.signal});const y={signal:h.signal,options:s,context:c},E=(W,nt=!1)=>{const{aborted:lt}=h.signal,Ee=s.ignoreFetchAbort&&W!==void 0;if(s.status&&(lt&&!nt?(s.status.fetchAborted=!0,s.status.fetchError=h.signal.reason,Ee&&(s.status.fetchAbortIgnored=!0)):s.status.fetchResolved=!0),lt&&!Ee&&!nt)return F(h.signal.reason);const yt=z;return sf(this,jf)[o]===z&&(W===void 0?yt.__staleWhileFetching?sf(this,jf)[o]=yt.__staleWhileFetching:this.delete(n):(s.status&&(s.status.fetchUpdated=!0),this.set(n,W,y.options))),W},L=W=>(s.status&&(s.status.fetchRejected=!0,s.status.fetchError=W),F(W)),F=W=>{const{aborted:nt}=h.signal,lt=nt&&s.allowStaleOnFetchAbort,Ee=lt||s.allowStaleOnFetchRejection,yt=Ee||s.noDeleteOnFetchRejection,Ai=z;if(sf(this,jf)[o]===z&&(!yt||Ai.__staleWhileFetching===void 0?this.delete(n):lt||(sf(this,jf)[o]=Ai.__staleWhileFetching)),Ee)return s.status&&Ai.__staleWhileFetching!==void 0&&(s.status.returnedStale=!0),Ai.__staleWhileFetching;if(Ai.__returned===Ai)throw W},N=(W,nt)=>{var Ee;const lt=(Ee=sf(this,Np))==null?void 0:Ee.call(this,n,d,y);lt&< instanceof Promise&<.then(yt=>W(yt),nt),h.signal.addEventListener("abort",()=>{(!s.ignoreFetchAbort||s.allowStaleOnFetchAbort)&&(W(),s.allowStaleOnFetchAbort&&(W=yt=>E(yt,!0)))})};s.status&&(s.status.fetchDispatched=!0);const z=new Promise(N).then(E,L),oe=Object.assign(z,{__abortController:h,__staleWhileFetching:d,__returned:void 0});return o===void 0?(this.set(n,oe,{...y.options,status:void 0}),o=sf(this,sp).get(n)):sf(this,jf)[o]=oe,oe},zm=new WeakSet,qm=function(n){if(!sf(this,Op))return!1;const o=n;return!!o&&o instanceof Promise&&o.hasOwnProperty("__staleWhileFetching")&&o.__abortController instanceof AbortController},$p=new WeakSet,ig=function(n,o){sf(this,bp)[o]=n,sf(this,fp)[n]=o},Dp=new WeakSet,jp=function(n){n!==sf(this,up)&&(n===sf(this,hp)?Xf(this,hp,sf(this,fp)[n]):kf(this,$p,ig).call(this,sf(this,bp)[n],sf(this,fp)[n]),kf(this,$p,ig).call(this,sf(this,up),n),Xf(this,up,n))};let LRUCache=qp;const SIDE_PLANES=[new Cesium$1.Plane(new Cesium$1.Cartesian3(0,0,1),.5),new Cesium$1.Plane(new Cesium$1.Cartesian3(0,0,-1),.5),new Cesium$1.Plane(new Cesium$1.Cartesian3(0,1,0),.5),new Cesium$1.Plane(new Cesium$1.Cartesian3(0,-1,0),.5),new Cesium$1.Plane(new Cesium$1.Cartesian3(1,0,0),.5),new Cesium$1.Plane(new Cesium$1.Cartesian3(-1,0,0),.5)],CORNER_POINT_VECTORS=[new Cesium$1.Cartesian3(.5,.5,.5),new Cesium$1.Cartesian3(.5,-.5,.5),new Cesium$1.Cartesian3(-.5,-.5,.5),new Cesium$1.Cartesian3(-.5,.5,.5)],FACE_POINT_VECTORS=[new Cesium$1.Cartesian3(.5,0,0),new Cesium$1.Cartesian3(0,.5,0),new Cesium$1.Cartesian3(0,0,.5)],SCALE_POINT_VECTORS=[...CORNER_POINT_VECTORS,...FACE_POINT_VECTORS],SCALE_POINTS=SCALE_POINT_VECTORS.map(t=>({point:t,oppositePoint:Cesium$1.Cartesian3.multiplyByScalar(t,-1,new Cesium$1.Cartesian3)})),BOX_EDGES=CORNER_POINT_VECTORS.flatMap((t,n)=>{const o=t,s=Cesium$1.Cartesian3.clone(o,new Cesium$1.Cartesian3);s.z*=-1;const c=CORNER_POINT_VECTORS[(n+1)%4],d=Cesium$1.Cartesian3.clone(c,new Cesium$1.Cartesian3);return d.z*=-1,[{start:o,end:s,isDraggable:!0},{start:c,end:o},{start:d,end:s}]}),SIDE_PLANE_NAMES=["bottom","top","front","back","left","right"];var composeRefs$1={};Object.defineProperty(composeRefs$1,"__esModule",{value:!0});function composeRefs(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];if(t.length===2)return composeTwoRefs(t[0],t[1])||null;var o=t.slice(1).reduce(function(s,c){return composeTwoRefs(s,c)},t[0]);return o||null}var _default=composeRefs$1.default=composeRefs,composedRefCache=new WeakMap;function composeTwoRefs(t,n){if(t&&n){var o=composedRefCache.get(t)||new WeakMap;composedRefCache.set(t,o);var s=o.get(n)||function(c){updateRef(t,c),updateRef(n,c)};return o.set(n,s),s}return t||n}function updateRef(t,n){typeof t=="function"?t(n):t.current=n}var md5$1={exports:{}};/**
|
|
5833
5833
|
* [js-md5]{@link https://github.com/emn178/js-md5}
|
|
5834
5834
|
*
|
|
5835
5835
|
* @namespace md5
|
|
@@ -6742,7 +6742,7 @@ vec3 getTurboColormap(const float v) {
|
|
|
6742
6742
|
${reconstructPosition}
|
|
6743
6743
|
${turboColorMap}
|
|
6744
6744
|
${ambientOcclusionModulate}
|
|
6745
|
-
`,uniforms:{...pick(L,["color","frustumLength","blackPoint","whitePoint","gamma"]),globeDepthTexture:()=>(y==null?void 0:y())??N._depthTexture}});if(c){const z=createBilateralFilterStage({prefix:t,outputType:h,useGlobeDepth:p,getGlobeDepthTexture:y,uniforms:{textureScale:n,...pick(L,["frustumLength","normalExponent","depthExponent"])}}),oe=new Cesium$1.PostProcessStageComposite({name:`${t}_ambient_occlusion_generate_and_filter`,stages:[F,z]});return N.uniforms.ambientOcclusionTexture=oe.name,new Cesium$1.PostProcessStageComposite({name:`${t}_ambient_occlusion`,stages:[oe,N],inputPreviousStageTexture:!1,uniforms:createUniforms([{stage:F,uniforms:["intensity","maxRadius","bias","frustumLength","focalLength"]},{stage:z,uniforms:["frustumLength","normalExponent","depthExponent"]},{stage:N,uniforms:["color","blackPoint","whitePoint","gamma"]}])})}else return N.uniforms.ambientOcclusionTexture=F.name,new Cesium$1.PostProcessStageComposite({name:`${t}_ambient_occlusion`,stages:[F,N],inputPreviousStageTexture:!1,uniforms:createUniforms([{stage:F,uniforms:["intensity","maxRadius","bias","frustumLength","focalLength"]},{stage:N,uniforms:["color","blackPoint","whitePoint","gamma"]}])})}const AmbientOcclusionStage=({enabled:t=!0,textureScale:n,directions:o,steps:s,denoise:c,accurateNormalReconstruction:d,outputType:h,useGlobeDepth:p,...y})=>{const{viewer:E}=$e$1(),L=E==null?void 0:E.scene,F=useInstance({owner:L==null?void 0:L.postProcessStages,keys:[n,s,o,c,d,h,p],create:()=>{const N=createAmbientOcclusionStage({textureScale:n,steps:s,directions:o,denoise:c,accurateNormalReconstruction:d,outputType:h,useGlobeDepth:p,getGlobeDepthTexture:()=>L.context.uniformState.globeDepthTexture,uniforms:y});return N.enabled=t,N},transferOwnership:(N,z)=>(z==null||z.add(N),()=>{z==null||z.remove(N)})});return F.enabled=t,Object.assign(F.uniforms,y),L==null||L.requestRender(),usePreRender(()=>{const N=L==null?void 0:L.camera.frustum;if(N instanceof Cesium$1.PerspectiveFrustum){const z=1/Math.tan(N.fovy/2);F.uniforms.focalLength.x=z*N.aspectRatio,F.uniforms.focalLength.y=z}}),null},AmbientOcclusion=t=>{const n=$e$1(),[o,s]=React.useState(!1);return usePreRender(()=>{const c=n.scene;s(!(c!=null&&c.globe.depthTestAgainstTerrain));const{globeHeight:d}=c;if(!c||d==null)return;const h=c.camera.positionCartographic.height-d,p=c==null?void 0:c.camera.frustum;p instanceof Cesium$1.PerspectiveFrustum&&(c.camera.frustum.near=Cesium$1.Math.clamp(h-1,1,5)/Math.tan(p.fov/2))}),jsxRuntimeExports.jsx(AmbientOcclusionStage,{...t,useGlobeDepth:o})};var AmbientOcclusionOutputType=(t=>(t[t.Occlusion=1]="Occlusion",t[t.Normal=2]="Normal",t[t.Depth=3]="Depth",t[t.Weight=4]="Weight",t[t.Shade=5]="Shade",t))(AmbientOcclusionOutputType||{});const AMBIENT_OCCLUSION_QUALITY={low:{directions:4,steps:4,textureScale:.5,maxRadius:30},medium:{directions:4,steps:8,textureScale:.5,maxRadius:40},high:{directions:8,steps:8,textureScale:1,maxRadius:40},extreme:{directions:16,steps:16,textureScale:1,maxRadius:40}};let image;function getImage(){if(image!=null)return image;image=document.createElement("canvas"),image.width=16,image.height=16;const t=image.getContext("2d");return invariant$1(t!=null),t.fillStyle="white",t.fillRect(3,3,10,10),t.strokeStyle="black",t.lineWidth=2,t.strokeRect(3,3,10,10),image}const ControlPoint=({position:t,clampToGround:n=!1})=>{const o=React.useRef(t);o.current=t;const s=useConstant$2(()=>new CallbackProperty((d,h)=>"getValue"in o.current?o.current.getValue(d,h):o.current,!1)),c=React.useMemo(()=>({position:s,billboard:{image:getImage(),width:8,height:8,heightReference:n?HeightReference$1.CLAMP_TO_GROUND:HeightReference$1.NONE,disableDepthTestDistance:1/0}}),[n,s]);return jsxRuntimeExports.jsx(Is$1,{...c})};function assignForwardedRef(t,n){if(typeof t=="function")return t(n),()=>{t(null)};if(t!=null)return t.current=n,()=>{t.current=null}}const Entity=React.memo(React.forwardRef(({entities:t,...n},o)=>{const{viewer:s}=$e$1(),c=s==null?void 0:s.scene,d=s==null?void 0:s.entities,h=t??d,[p,y]=React.useState(()=>new Entity$1(n));return React.useEffect(()=>{y(new Entity$1(n))},[n.id]),React.useEffect(()=>(h==null||h.add(p),()=>{h==null||h.remove(p),c==null||c.requestRender()}),[c,h,p]),React.useEffect(()=>assignForwardedRef(o,p),[o,p]),Object.assign(p,omit(n,"id")),c==null||c.requestRender(),null})),textStyle={padding:"5px",color:"#fff",backgroundColor:"#000",borderRadius:"5px",lineHeight:1},MeasurementText=({children:t})=>jsxRuntimeExports.jsx("div",{style:textStyle,children:t}),MotionConfigContext=React.createContext({transformPagePoint:t=>t,isStatic:!1,reducedMotion:"never"}),MotionContext=React.createContext({}),PresenceContext=React.createContext(null),isBrowser=typeof document<"u",useIsomorphicLayoutEffect$1=isBrowser?React.useLayoutEffect:React.useEffect,LazyContext=React.createContext({strict:!1}),camelToDash=t=>t.replace(/([a-z])([A-Z])/gu,"$1-$2").toLowerCase(),optimizedAppearDataId="framerAppearId",optimizedAppearDataAttribute="data-"+camelToDash(optimizedAppearDataId),MotionGlobalConfig={skipAnimations:!1,useManualTiming:!1};class Queue{constructor(){this.order=[],this.scheduled=new Set}add(n){if(!this.scheduled.has(n))return this.scheduled.add(n),this.order.push(n),!0}remove(n){const o=this.order.indexOf(n);o!==-1&&(this.order.splice(o,1),this.scheduled.delete(n))}clear(){this.order.length=0,this.scheduled.clear()}}function createRenderStep(t){let n=new Queue,o=new Queue,s=0,c=!1,d=!1;const h=new WeakSet,p={schedule:(y,E=!1,L=!1)=>{const F=L&&c,N=F?n:o;return E&&h.add(y),N.add(y)&&F&&c&&(s=n.order.length),y},cancel:y=>{o.remove(y),h.delete(y)},process:y=>{if(c){d=!0;return}if(c=!0,[n,o]=[o,n],o.clear(),s=n.order.length,s)for(let E=0;E<s;E++){const L=n.order[E];h.has(L)&&(p.schedule(L),t()),L(y)}c=!1,d&&(d=!1,p.process(y))}};return p}const stepsOrder=["read","resolveKeyframes","update","preRender","render","postRender"],maxElapsed=40;function createRenderBatcher(t,n){let o=!1,s=!0;const c={delta:0,timestamp:0,isProcessing:!1},d=stepsOrder.reduce((F,N)=>(F[N]=createRenderStep(()=>o=!0),F),{}),h=F=>{d[F].process(c)},p=()=>{const F=performance.now();o=!1,c.delta=s?1e3/60:Math.max(Math.min(F-c.timestamp,maxElapsed),1),c.timestamp=F,c.isProcessing=!0,stepsOrder.forEach(h),c.isProcessing=!1,o&&n&&(s=!1,t(p))},y=()=>{o=!0,s=!0,c.isProcessing||t(p)};return{schedule:stepsOrder.reduce((F,N)=>{const z=d[N];return F[N]=(oe,W=!1,nt=!1)=>(o||y(),z.schedule(oe,W,nt)),F},{}),cancel:F=>stepsOrder.forEach(N=>d[N].cancel(F)),state:c,steps:d}}const{schedule:microtask,cancel:cancelMicrotask}=createRenderBatcher(queueMicrotask,!1);function useVisualElement(t,n,o,s){const{visualElement:c}=React.useContext(MotionContext),d=React.useContext(LazyContext),h=React.useContext(PresenceContext),p=React.useContext(MotionConfigContext).reducedMotion,y=React.useRef();s=s||d.renderer,!y.current&&s&&(y.current=s(t,{visualState:n,parent:c,props:o,presenceContext:h,blockInitialAnimation:h?h.initial===!1:!1,reducedMotionConfig:p}));const E=y.current;React.useInsertionEffect(()=>{E&&E.update(o,h)});const L=React.useRef(!!(o[optimizedAppearDataAttribute]&&!window.HandoffComplete));return useIsomorphicLayoutEffect$1(()=>{E&&(microtask.postRender(E.render),L.current&&E.animationState&&E.animationState.animateChanges())}),React.useEffect(()=>{E&&(E.updateFeatures(),!L.current&&E.animationState&&E.animationState.animateChanges(),L.current&&(L.current=!1,window.HandoffComplete=!0))}),E}function isRefObject(t){return t&&typeof t=="object"&&Object.prototype.hasOwnProperty.call(t,"current")}function useMotionRef(t,n,o){return React.useCallback(s=>{s&&t.mount&&t.mount(s),n&&(s?n.mount(s):n.unmount()),o&&(typeof o=="function"?o(s):isRefObject(o)&&(o.current=s))},[n])}function isVariantLabel(t){return typeof t=="string"||Array.isArray(t)}function isAnimationControls(t){return t!==null&&typeof t=="object"&&typeof t.start=="function"}const variantPriorityOrder=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],variantProps=["initial",...variantPriorityOrder];function isControllingVariants(t){return isAnimationControls(t.animate)||variantProps.some(n=>isVariantLabel(t[n]))}function isVariantNode(t){return!!(isControllingVariants(t)||t.variants)}function getCurrentTreeVariants(t,n){if(isControllingVariants(t)){const{initial:o,animate:s}=t;return{initial:o===!1||isVariantLabel(o)?o:void 0,animate:isVariantLabel(s)?s:void 0}}return t.inherit!==!1?n:{}}function useCreateMotionContext(t){const{initial:n,animate:o}=getCurrentTreeVariants(t,React.useContext(MotionContext));return React.useMemo(()=>({initial:n,animate:o}),[variantLabelsAsDependency(n),variantLabelsAsDependency(o)])}function variantLabelsAsDependency(t){return Array.isArray(t)?t.join(" "):t}const featureProps={animation:["animate","variants","whileHover","whileTap","exit","whileInView","whileFocus","whileDrag"],exit:["exit"],drag:["drag","dragControls"],focus:["whileFocus"],hover:["whileHover","onHoverStart","onHoverEnd"],tap:["whileTap","onTap","onTapStart","onTapCancel"],pan:["onPan","onPanStart","onPanSessionStart","onPanEnd"],inView:["whileInView","onViewportEnter","onViewportLeave"],layout:["layout","layoutId"]},featureDefinitions={};for(const t in featureProps)featureDefinitions[t]={isEnabled:n=>featureProps[t].some(o=>!!n[o])};function loadFeatures(t){for(const n in t)featureDefinitions[n]={...featureDefinitions[n],...t[n]}}const LayoutGroupContext=React.createContext({}),SwitchLayoutGroupContext=React.createContext({}),motionComponentSymbol=Symbol.for("motionComponentSymbol");function createMotionComponent({preloadedFeatures:t,createVisualElement:n,useRender:o,useVisualState:s,Component:c}){t&&loadFeatures(t);function d(p,y){let E;const L={...React.useContext(MotionConfigContext),...p,layoutId:useLayoutId(p)},{isStatic:F}=L,N=useCreateMotionContext(p),z=s(p,F);if(!F&&isBrowser){N.visualElement=useVisualElement(c,z,L,n);const oe=React.useContext(SwitchLayoutGroupContext),W=React.useContext(LazyContext).strict;N.visualElement&&(E=N.visualElement.loadFeatures(L,W,t,oe))}return React__namespace.createElement(MotionContext.Provider,{value:N},E&&N.visualElement?React__namespace.createElement(E,{visualElement:N.visualElement,...L}):null,o(c,p,useMotionRef(z,N.visualElement,y),z,F,N.visualElement))}const h=React.forwardRef(d);return h[motionComponentSymbol]=c,h}function useLayoutId({layoutId:t}){const n=React.useContext(LayoutGroupContext).id;return n&&t!==void 0?n+"-"+t:t}function createMotionProxy(t){function n(s,c={}){return createMotionComponent(t(s,c))}if(typeof Proxy>"u")return n;const o=new Map;return new Proxy(n,{get:(s,c)=>(o.has(c)||o.set(c,n(c)),o.get(c))})}const lowercaseSVGElements=["animate","circle","defs","desc","ellipse","g","image","line","filter","marker","mask","metadata","path","pattern","polygon","polyline","rect","stop","switch","symbol","svg","text","tspan","use","view"];function isSVGComponent(t){return typeof t!="string"||t.includes("-")?!1:!!(lowercaseSVGElements.indexOf(t)>-1||/[A-Z]/u.test(t))}const scaleCorrectors={};function addScaleCorrector(t){Object.assign(scaleCorrectors,t)}const transformPropOrder=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],transformProps=new Set(transformPropOrder);function isForcedMotionValue(t,{layout:n,layoutId:o}){return transformProps.has(t)||t.startsWith("origin")||(n||o!==void 0)&&(!!scaleCorrectors[t]||t==="opacity")}const isMotionValue=t=>!!(t&&t.getVelocity),translateAlias={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},numTransforms=transformPropOrder.length;function buildTransform(t,{enableHardwareAcceleration:n=!0,allowTransformNone:o=!0},s,c){let d="";for(let h=0;h<numTransforms;h++){const p=transformPropOrder[h];if(t[p]!==void 0){const y=translateAlias[p]||p;d+=`${y}(${t[p]}) `}}return n&&!t.z&&(d+="translateZ(0)"),d=d.trim(),c?d=c(t,s?"":d):o&&s&&(d="none"),d}const checkStringStartsWith=t=>n=>typeof n=="string"&&n.startsWith(t),isCSSVariableName=checkStringStartsWith("--"),startsAsVariableToken=checkStringStartsWith("var(--"),isCSSVariableToken=t=>startsAsVariableToken(t)?singleCssVariableRegex.test(t.split("/*")[0].trim()):!1,singleCssVariableRegex=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu,getValueAsType=(t,n)=>n&&typeof t=="number"?n.transform(t):t,clamp=(t,n,o)=>o>n?n:o<t?t:o,number={test:t=>typeof t=="number",parse:parseFloat,transform:t=>t},alpha={...number,transform:t=>clamp(0,1,t)},scale={...number,default:1},sanitize=t=>Math.round(t*1e5)/1e5,floatRegex=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu,colorRegex=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu,singleColorRegex=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu;function isString$1(t){return typeof t=="string"}const createUnitType=t=>({test:n=>isString$1(n)&&n.endsWith(t)&&n.split(" ").length===1,parse:parseFloat,transform:n=>`${n}${t}`}),degrees=createUnitType("deg"),percent=createUnitType("%"),px=createUnitType("px"),vh=createUnitType("vh"),vw=createUnitType("vw"),progressPercentage={...percent,parse:t=>percent.parse(t)/100,transform:t=>percent.transform(t*100)},int={...number,transform:Math.round},numberValueTypes={borderWidth:px,borderTopWidth:px,borderRightWidth:px,borderBottomWidth:px,borderLeftWidth:px,borderRadius:px,radius:px,borderTopLeftRadius:px,borderTopRightRadius:px,borderBottomRightRadius:px,borderBottomLeftRadius:px,width:px,maxWidth:px,height:px,maxHeight:px,size:px,top:px,right:px,bottom:px,left:px,padding:px,paddingTop:px,paddingRight:px,paddingBottom:px,paddingLeft:px,margin:px,marginTop:px,marginRight:px,marginBottom:px,marginLeft:px,rotate:degrees,rotateX:degrees,rotateY:degrees,rotateZ:degrees,scale,scaleX:scale,scaleY:scale,scaleZ:scale,skew:degrees,skewX:degrees,skewY:degrees,distance:px,translateX:px,translateY:px,translateZ:px,x:px,y:px,z:px,perspective:px,transformPerspective:px,opacity:alpha,originX:progressPercentage,originY:progressPercentage,originZ:px,zIndex:int,backgroundPositionX:px,backgroundPositionY:px,fillOpacity:alpha,strokeOpacity:alpha,numOctaves:int};function buildHTMLStyles(t,n,o,s){const{style:c,vars:d,transform:h,transformOrigin:p}=t;let y=!1,E=!1,L=!0;for(const F in n){const N=n[F];if(isCSSVariableName(F)){d[F]=N;continue}const z=numberValueTypes[F],oe=getValueAsType(N,z);if(transformProps.has(F)){if(y=!0,h[F]=oe,!L)continue;N!==(z.default||0)&&(L=!1)}else F.startsWith("origin")?(E=!0,p[F]=oe):c[F]=oe}if(n.transform||(y||s?c.transform=buildTransform(t.transform,o,L,s):c.transform&&(c.transform="none")),E){const{originX:F="50%",originY:N="50%",originZ:z=0}=p;c.transformOrigin=`${F} ${N} ${z}`}}const createHtmlRenderState=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function copyRawValuesOnly(t,n,o){for(const s in n)!isMotionValue(n[s])&&!isForcedMotionValue(s,o)&&(t[s]=n[s])}function useInitialMotionValues({transformTemplate:t},n,o){return React.useMemo(()=>{const s=createHtmlRenderState();return buildHTMLStyles(s,n,{enableHardwareAcceleration:!o},t),Object.assign({},s.vars,s.style)},[n])}function useStyle(t,n,o){const s=t.style||{},c={};return copyRawValuesOnly(c,s,t),Object.assign(c,useInitialMotionValues(t,n,o)),c}function useHTMLProps(t,n,o){const s={},c=useStyle(t,n,o);return t.drag&&t.dragListener!==!1&&(s.draggable=!1,c.userSelect=c.WebkitUserSelect=c.WebkitTouchCallout="none",c.touchAction=t.drag===!0?"none":`pan-${t.drag==="x"?"y":"x"}`),t.tabIndex===void 0&&(t.onTap||t.onTapStart||t.whileTap)&&(s.tabIndex=0),s.style=c,s}const validMotionProps=new Set(["animate","exit","variants","initial","style","values","variants","transition","transformTemplate","custom","inherit","onBeforeLayoutMeasure","onAnimationStart","onAnimationComplete","onUpdate","onDragStart","onDrag","onDragEnd","onMeasureDragConstraints","onDirectionLock","onDragTransitionEnd","_dragX","_dragY","onHoverStart","onHoverEnd","onViewportEnter","onViewportLeave","globalTapTarget","ignoreStrict","viewport"]);function isValidMotionProp(t){return t.startsWith("while")||t.startsWith("drag")&&t!=="draggable"||t.startsWith("layout")||t.startsWith("onTap")||t.startsWith("onPan")||t.startsWith("onLayout")||validMotionProps.has(t)}let shouldForward=t=>!isValidMotionProp(t);function loadExternalIsValidProp(t){t&&(shouldForward=n=>n.startsWith("on")?!isValidMotionProp(n):t(n))}try{loadExternalIsValidProp(require("@emotion/is-prop-valid").default)}catch(t){}function filterProps(t,n,o){const s={};for(const c in t)c==="values"&&typeof t.values=="object"||(shouldForward(c)||o===!0&&isValidMotionProp(c)||!n&&!isValidMotionProp(c)||t.draggable&&c.startsWith("onDrag"))&&(s[c]=t[c]);return s}function calcOrigin$1(t,n,o){return typeof t=="string"?t:px.transform(n+o*t)}function calcSVGTransformOrigin(t,n,o){const s=calcOrigin$1(n,t.x,t.width),c=calcOrigin$1(o,t.y,t.height);return`${s} ${c}`}const dashKeys={offset:"stroke-dashoffset",array:"stroke-dasharray"},camelKeys={offset:"strokeDashoffset",array:"strokeDasharray"};function buildSVGPath(t,n,o=1,s=0,c=!0){t.pathLength=1;const d=c?dashKeys:camelKeys;t[d.offset]=px.transform(-s);const h=px.transform(n),p=px.transform(o);t[d.array]=`${h} ${p}`}function buildSVGAttrs(t,{attrX:n,attrY:o,attrScale:s,originX:c,originY:d,pathLength:h,pathSpacing:p=1,pathOffset:y=0,...E},L,F,N){if(buildHTMLStyles(t,E,L,N),F){t.style.viewBox&&(t.attrs.viewBox=t.style.viewBox);return}t.attrs=t.style,t.style={};const{attrs:z,style:oe,dimensions:W}=t;z.transform&&(W&&(oe.transform=z.transform),delete z.transform),W&&(c!==void 0||d!==void 0||oe.transform)&&(oe.transformOrigin=calcSVGTransformOrigin(W,c!==void 0?c:.5,d!==void 0?d:.5)),n!==void 0&&(z.x=n),o!==void 0&&(z.y=o),s!==void 0&&(z.scale=s),h!==void 0&&buildSVGPath(z,h,p,y,!1)}const createSvgRenderState=()=>({...createHtmlRenderState(),attrs:{}}),isSVGTag=t=>typeof t=="string"&&t.toLowerCase()==="svg";function useSVGProps(t,n,o,s){const c=React.useMemo(()=>{const d=createSvgRenderState();return buildSVGAttrs(d,n,{enableHardwareAcceleration:!1},isSVGTag(s),t.transformTemplate),{...d.attrs,style:{...d.style}}},[n]);if(t.style){const d={};copyRawValuesOnly(d,t.style,t),c.style={...d,...c.style}}return c}function createUseRender(t=!1){return(o,s,c,{latestValues:d},h)=>{const y=(isSVGComponent(o)?useSVGProps:useHTMLProps)(s,d,h,o),E=filterProps(s,typeof o=="string",t),L=o!==React.Fragment?{...E,...y,ref:c}:{},{children:F}=s,N=React.useMemo(()=>isMotionValue(F)?F.get():F,[F]);return React.createElement(o,{...L,children:N})}}function renderHTML(t,{style:n,vars:o},s,c){Object.assign(t.style,n,c&&c.getProjectionStyles(s));for(const d in o)t.style.setProperty(d,o[d])}const camelCaseAttributes=new Set(["baseFrequency","diffuseConstant","kernelMatrix","kernelUnitLength","keySplines","keyTimes","limitingConeAngle","markerHeight","markerWidth","numOctaves","targetX","targetY","surfaceScale","specularConstant","specularExponent","stdDeviation","tableValues","viewBox","gradientTransform","pathLength","startOffset","textLength","lengthAdjust"]);function renderSVG(t,n,o,s){renderHTML(t,n,void 0,s);for(const c in n.attrs)t.setAttribute(camelCaseAttributes.has(c)?c:camelToDash(c),n.attrs[c])}function scrapeMotionValuesFromProps$1(t,n,o){var s;const{style:c}=t,d={};for(const h in c)(isMotionValue(c[h])||n.style&&isMotionValue(n.style[h])||isForcedMotionValue(h,t)||((s=o==null?void 0:o.getValue(h))===null||s===void 0?void 0:s.liveStyle)!==void 0)&&(d[h]=c[h]);return d}function scrapeMotionValuesFromProps(t,n,o){const s=scrapeMotionValuesFromProps$1(t,n,o);for(const c in t)if(isMotionValue(t[c])||isMotionValue(n[c])){const d=transformPropOrder.indexOf(c)!==-1?"attr"+c.charAt(0).toUpperCase()+c.substring(1):c;s[d]=t[c]}return s}function resolveVariantFromProps(t,n,o,s={},c={}){return typeof n=="function"&&(n=n(o!==void 0?o:t.custom,s,c)),typeof n=="string"&&(n=t.variants&&t.variants[n]),typeof n=="function"&&(n=n(o!==void 0?o:t.custom,s,c)),n}function useConstant(t){const n=React.useRef(null);return n.current===null&&(n.current=t()),n.current}const isKeyframesTarget=t=>Array.isArray(t),isCustomValue=t=>!!(t&&typeof t=="object"&&t.mix&&t.toValue),resolveFinalValueInKeyframes=t=>isKeyframesTarget(t)?t[t.length-1]||0:t;function resolveMotionValue(t){const n=isMotionValue(t)?t.get():t;return isCustomValue(n)?n.toValue():n}function makeState({scrapeMotionValuesFromProps:t,createRenderState:n,onMount:o},s,c,d){const h={latestValues:makeLatestValues(s,c,d,t),renderState:n()};return o&&(h.mount=p=>o(s,p,h)),h}const makeUseVisualState=t=>(n,o)=>{const s=React.useContext(MotionContext),c=React.useContext(PresenceContext),d=()=>makeState(t,n,s,c);return o?d():useConstant(d)};function makeLatestValues(t,n,o,s){const c={},d=s(t,{});for(const N in d)c[N]=resolveMotionValue(d[N]);let{initial:h,animate:p}=t;const y=isControllingVariants(t),E=isVariantNode(t);n&&E&&!y&&t.inherit!==!1&&(h===void 0&&(h=n.initial),p===void 0&&(p=n.animate));let L=o?o.initial===!1:!1;L=L||h===!1;const F=L?p:h;return F&&typeof F!="boolean"&&!isAnimationControls(F)&&(Array.isArray(F)?F:[F]).forEach(z=>{const oe=resolveVariantFromProps(t,z);if(!oe)return;const{transitionEnd:W,transition:nt,...lt}=oe;for(const Ee in lt){let yt=lt[Ee];if(Array.isArray(yt)){const Ai=L?yt.length-1:0;yt=yt[Ai]}yt!==null&&(c[Ee]=yt)}for(const Ee in W)c[Ee]=W[Ee]}),c}const noop$1=t=>t,{schedule:frame,cancel:cancelFrame,state:frameData,steps}=createRenderBatcher(typeof requestAnimationFrame<"u"?requestAnimationFrame:noop$1,!0),svgMotionConfig={useVisualState:makeUseVisualState({scrapeMotionValuesFromProps,createRenderState:createSvgRenderState,onMount:(t,n,{renderState:o,latestValues:s})=>{frame.read(()=>{try{o.dimensions=typeof n.getBBox=="function"?n.getBBox():n.getBoundingClientRect()}catch{o.dimensions={x:0,y:0,width:0,height:0}}}),frame.render(()=>{buildSVGAttrs(o,s,{enableHardwareAcceleration:!1},isSVGTag(n.tagName),t.transformTemplate),renderSVG(n,o)})}})},htmlMotionConfig={useVisualState:makeUseVisualState({scrapeMotionValuesFromProps:scrapeMotionValuesFromProps$1,createRenderState:createHtmlRenderState})};function createDomMotionConfig(t,{forwardMotionProps:n=!1},o,s){return{...isSVGComponent(t)?svgMotionConfig:htmlMotionConfig,preloadedFeatures:o,useRender:createUseRender(n),createVisualElement:s,Component:t}}function addDomEvent(t,n,o,s={passive:!0}){return t.addEventListener(n,o,s),()=>t.removeEventListener(n,o)}const isPrimaryPointer=t=>t.pointerType==="mouse"?typeof t.button!="number"||t.button<=0:t.isPrimary!==!1;function extractEventInfo(t,n="page"){return{point:{x:t[n+"X"],y:t[n+"Y"]}}}const addPointerInfo=t=>n=>isPrimaryPointer(n)&&t(n,extractEventInfo(n));function addPointerEvent(t,n,o,s){return addDomEvent(t,n,addPointerInfo(o),s)}const combineFunctions=(t,n)=>o=>n(t(o)),pipe=(...t)=>t.reduce(combineFunctions);function createLock(t){let n=null;return()=>{const o=()=>{n=null};return n===null?(n=t,o):!1}}const globalHorizontalLock=createLock("dragHorizontal"),globalVerticalLock=createLock("dragVertical");function getGlobalLock(t){let n=!1;if(t==="y")n=globalVerticalLock();else if(t==="x")n=globalHorizontalLock();else{const o=globalHorizontalLock(),s=globalVerticalLock();o&&s?n=()=>{o(),s()}:(o&&o(),s&&s())}return n}function isDragActive(){const t=getGlobalLock(!0);return t?(t(),!1):!0}class Feature{constructor(n){this.isMounted=!1,this.node=n}update(){}}function addHoverEvent(t,n){const o="pointer"+(n?"enter":"leave"),s="onHover"+(n?"Start":"End"),c=(d,h)=>{if(d.pointerType==="touch"||isDragActive())return;const p=t.getProps();t.animationState&&p.whileHover&&t.animationState.setActive("whileHover",n),p[s]&&p[s](d,h)};return addPointerEvent(t.current,o,c,{passive:!t.getProps()[s]})}class HoverGesture extends Feature{mount(){this.unmount=pipe(addHoverEvent(this.node,!0),addHoverEvent(this.node,!1))}unmount(){}}class FocusGesture extends Feature{constructor(){super(...arguments),this.isActive=!1}onFocus(){let n=!1;try{n=this.node.current.matches(":focus-visible")}catch{n=!0}!n||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!0),this.isActive=!0)}onBlur(){!this.isActive||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!1),this.isActive=!1)}mount(){this.unmount=pipe(addDomEvent(this.node.current,"focus",()=>this.onFocus()),addDomEvent(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}const isNodeOrChild=(t,n)=>n?t===n?!0:isNodeOrChild(t,n.parentElement):!1;function fireSyntheticPointerEvent(t,n){if(!n)return;const o=new PointerEvent("pointer"+t);n(o,extractEventInfo(o))}class PressGesture extends Feature{constructor(){super(...arguments),this.removeStartListeners=noop$1,this.removeEndListeners=noop$1,this.removeAccessibleListeners=noop$1,this.startPointerPress=(n,o)=>{if(this.isPressing)return;this.removeEndListeners();const s=this.node.getProps(),d=addPointerEvent(window,"pointerup",(p,y)=>{if(!this.checkPressEnd())return;const{onTap:E,onTapCancel:L,globalTapTarget:F}=this.node.getProps();!F&&!isNodeOrChild(this.node.current,p.target)?L&&L(p,y):E&&E(p,y)},{passive:!(s.onTap||s.onPointerUp)}),h=addPointerEvent(window,"pointercancel",(p,y)=>this.cancelPress(p,y),{passive:!(s.onTapCancel||s.onPointerCancel)});this.removeEndListeners=pipe(d,h),this.startPress(n,o)},this.startAccessiblePress=()=>{const n=d=>{if(d.key!=="Enter"||this.isPressing)return;const h=p=>{p.key!=="Enter"||!this.checkPressEnd()||fireSyntheticPointerEvent("up",(y,E)=>{const{onTap:L}=this.node.getProps();L&&L(y,E)})};this.removeEndListeners(),this.removeEndListeners=addDomEvent(this.node.current,"keyup",h),fireSyntheticPointerEvent("down",(p,y)=>{this.startPress(p,y)})},o=addDomEvent(this.node.current,"keydown",n),s=()=>{this.isPressing&&fireSyntheticPointerEvent("cancel",(d,h)=>this.cancelPress(d,h))},c=addDomEvent(this.node.current,"blur",s);this.removeAccessibleListeners=pipe(o,c)}}startPress(n,o){this.isPressing=!0;const{onTapStart:s,whileTap:c}=this.node.getProps();c&&this.node.animationState&&this.node.animationState.setActive("whileTap",!0),s&&s(n,o)}checkPressEnd(){return this.removeEndListeners(),this.isPressing=!1,this.node.getProps().whileTap&&this.node.animationState&&this.node.animationState.setActive("whileTap",!1),!isDragActive()}cancelPress(n,o){if(!this.checkPressEnd())return;const{onTapCancel:s}=this.node.getProps();s&&s(n,o)}mount(){const n=this.node.getProps(),o=addPointerEvent(n.globalTapTarget?window:this.node.current,"pointerdown",this.startPointerPress,{passive:!(n.onTapStart||n.onPointerStart)}),s=addDomEvent(this.node.current,"focus",this.startAccessiblePress);this.removeStartListeners=pipe(o,s)}unmount(){this.removeStartListeners(),this.removeEndListeners(),this.removeAccessibleListeners()}}const observerCallbacks=new WeakMap,observers=new WeakMap,fireObserverCallback=t=>{const n=observerCallbacks.get(t.target);n&&n(t)},fireAllObserverCallbacks=t=>{t.forEach(fireObserverCallback)};function initIntersectionObserver({root:t,...n}){const o=t||document;observers.has(o)||observers.set(o,{});const s=observers.get(o),c=JSON.stringify(n);return s[c]||(s[c]=new IntersectionObserver(fireAllObserverCallbacks,{root:t,...n})),s[c]}function observeIntersection(t,n,o){const s=initIntersectionObserver(n);return observerCallbacks.set(t,o),s.observe(t),()=>{observerCallbacks.delete(t),s.unobserve(t)}}const thresholdNames={some:0,all:1};class InViewFeature extends Feature{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.unmount();const{viewport:n={}}=this.node.getProps(),{root:o,margin:s,amount:c="some",once:d}=n,h={root:o?o.current:void 0,rootMargin:s,threshold:typeof c=="number"?c:thresholdNames[c]},p=y=>{const{isIntersecting:E}=y;if(this.isInView===E||(this.isInView=E,d&&!E&&this.hasEnteredView))return;E&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",E);const{onViewportEnter:L,onViewportLeave:F}=this.node.getProps(),N=E?L:F;N&&N(y)};return observeIntersection(this.node.current,h,p)}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>"u")return;const{props:n,prevProps:o}=this.node;["amount","margin","root"].some(hasViewportOptionChanged(n,o))&&this.startObserver()}unmount(){}}function hasViewportOptionChanged({viewport:t={}},{viewport:n={}}={}){return o=>t[o]!==n[o]}const gestureAnimations={inView:{Feature:InViewFeature},tap:{Feature:PressGesture},focus:{Feature:FocusGesture},hover:{Feature:HoverGesture}};function shallowCompare(t,n){if(!Array.isArray(n))return!1;const o=n.length;if(o!==t.length)return!1;for(let s=0;s<o;s++)if(n[s]!==t[s])return!1;return!0}function getCurrent(t){const n={};return t.values.forEach((o,s)=>n[s]=o.get()),n}function getVelocity$1(t){const n={};return t.values.forEach((o,s)=>n[s]=o.getVelocity()),n}function resolveVariant(t,n,o){const s=t.getProps();return resolveVariantFromProps(s,n,o!==void 0?o:s.custom,getCurrent(t),getVelocity$1(t))}const secondsToMilliseconds=t=>t*1e3,millisecondsToSeconds=t=>t/1e3,underDampedSpring={type:"spring",stiffness:500,damping:25,restSpeed:10},criticallyDampedSpring=t=>({type:"spring",stiffness:550,damping:t===0?2*Math.sqrt(550):30,restSpeed:10}),keyframesTransition={type:"keyframes",duration:.8},ease={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},getDefaultTransition=(t,{keyframes:n})=>n.length>2?keyframesTransition:transformProps.has(t)?t.startsWith("scale")?criticallyDampedSpring(n[1]):underDampedSpring:ease;function isTransitionDefined({when:t,delay:n,delayChildren:o,staggerChildren:s,staggerDirection:c,repeat:d,repeatType:h,repeatDelay:p,from:y,elapsed:E,...L}){return!!Object.keys(L).length}function getValueTransition(t,n){return t[n]||t.default||t}const isNotNull=t=>t!==null;function getFinalKeyframe(t,{repeat:n,repeatType:o="loop"},s){const c=t.filter(isNotNull),d=n&&o!=="loop"&&n%2===1?0:c.length-1;return!d||s===void 0?c[d]:s}let now;function clearTime(){now=void 0}const time={now:()=>(now===void 0&&time.set(frameData.isProcessing||MotionGlobalConfig.useManualTiming?frameData.timestamp:performance.now()),now),set:t=>{now=t,queueMicrotask(clearTime)}},isZeroValueString=t=>/^0[^.\s]+$/u.test(t);function isNone(t){return typeof t=="number"?t===0:t!==null?t==="none"||t==="0"||isZeroValueString(t):!0}let warning=noop$1,invariant=noop$1;process.env.NODE_ENV!=="production"&&(warning=(t,n)=>{!t&&typeof console<"u"&&console.warn(n)},invariant=(t,n)=>{if(!t)throw new Error(n)});const isNumericalString=t=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(t),splitCSSVariableRegex=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function parseCSSVariable(t){const n=splitCSSVariableRegex.exec(t);if(!n)return[,];const[,o,s,c]=n;return[`--${o??s}`,c]}const maxDepth=4;function getVariableValue(t,n,o=1){invariant(o<=maxDepth,`Max CSS variable fallback depth detected in property "${t}". This may indicate a circular fallback dependency.`);const[s,c]=parseCSSVariable(t);if(!s)return;const d=window.getComputedStyle(n).getPropertyValue(s);if(d){const h=d.trim();return isNumericalString(h)?parseFloat(h):h}return isCSSVariableToken(c)?getVariableValue(c,n,o+1):c}const positionalKeys=new Set(["width","height","top","left","right","bottom","x","y","translateX","translateY"]),isNumOrPxType=t=>t===number||t===px,getPosFromMatrix=(t,n)=>parseFloat(t.split(", ")[n]),getTranslateFromMatrix=(t,n)=>(o,{transform:s})=>{if(s==="none"||!s)return 0;const c=s.match(/^matrix3d\((.+)\)$/u);if(c)return getPosFromMatrix(c[1],n);{const d=s.match(/^matrix\((.+)\)$/u);return d?getPosFromMatrix(d[1],t):0}},transformKeys=new Set(["x","y","z"]),nonTranslationalTransformKeys=transformPropOrder.filter(t=>!transformKeys.has(t));function removeNonTranslationalTransform(t){const n=[];return nonTranslationalTransformKeys.forEach(o=>{const s=t.getValue(o);s!==void 0&&(n.push([o,s.get()]),s.set(o.startsWith("scale")?1:0))}),n}const positionalValues={width:({x:t},{paddingLeft:n="0",paddingRight:o="0"})=>t.max-t.min-parseFloat(n)-parseFloat(o),height:({y:t},{paddingTop:n="0",paddingBottom:o="0"})=>t.max-t.min-parseFloat(n)-parseFloat(o),top:(t,{top:n})=>parseFloat(n),left:(t,{left:n})=>parseFloat(n),bottom:({y:t},{top:n})=>parseFloat(n)+(t.max-t.min),right:({x:t},{left:n})=>parseFloat(n)+(t.max-t.min),x:getTranslateFromMatrix(4,13),y:getTranslateFromMatrix(5,14)};positionalValues.translateX=positionalValues.x,positionalValues.translateY=positionalValues.y;const testValueType=t=>n=>n.test(t),auto={test:t=>t==="auto",parse:t=>t},dimensionValueTypes=[number,px,percent,degrees,vw,vh,auto],findDimensionValueType=t=>dimensionValueTypes.find(testValueType(t)),toResolve=new Set;let isScheduled=!1,anyNeedsMeasurement=!1;function measureAllKeyframes(){if(anyNeedsMeasurement){const t=Array.from(toResolve).filter(s=>s.needsMeasurement),n=new Set(t.map(s=>s.element)),o=new Map;n.forEach(s=>{removeNonTranslationalTransform(s).length&&(o.set(s,removeNonTranslationalTransform(s)),s.render())}),t.forEach(s=>s.measureInitialState()),n.forEach(s=>{s.render()}),t.forEach(s=>s.measureEndState()),t.forEach(s=>{s.suspendedScrollY!==void 0&&window.scrollTo(0,s.suspendedScrollY)})}anyNeedsMeasurement=!1,isScheduled=!1,toResolve.forEach(t=>t.complete()),toResolve.clear()}function readAllKeyframes(){toResolve.forEach(t=>{t.readKeyframes(),t.needsMeasurement&&(anyNeedsMeasurement=!0)})}function flushKeyframeResolvers(){readAllKeyframes(),measureAllKeyframes()}class KeyframeResolver{constructor(n,o,s,c,d,h=!1){this.isComplete=!1,this.isAsync=!1,this.needsMeasurement=!1,this.isScheduled=!1,this.unresolvedKeyframes=[...n],this.onComplete=o,this.name=s,this.motionValue=c,this.element=d,this.isAsync=h}scheduleResolve(){this.isScheduled=!0,this.isAsync?(toResolve.add(this),isScheduled||(isScheduled=!0,frame.read(readAllKeyframes),frame.resolveKeyframes(measureAllKeyframes))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:n,name:o,element:s,motionValue:c}=this;for(let d=0;d<n.length;d++)if(n[d]===null)if(d===0){const h=c==null?void 0:c.get(),p=n[n.length-1];if(h!==void 0)n[0]=h;else if(s&&o){const y=s.readValue(o,p);y!=null&&(n[0]=y)}n[0]===void 0&&(n[0]=p),c&&h===void 0&&c.set(n[0])}else n[d]=n[d-1]}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(){this.isComplete=!0,this.onComplete(this.unresolvedKeyframes,this.finalKeyframe),toResolve.delete(this)}cancel(){this.isComplete||(this.isScheduled=!1,toResolve.delete(this))}resume(){this.isComplete||this.scheduleResolve()}}const isColorString=(t,n)=>o=>!!(isString$1(o)&&singleColorRegex.test(o)&&o.startsWith(t)||n&&Object.prototype.hasOwnProperty.call(o,n)),splitColor=(t,n,o)=>s=>{if(!isString$1(s))return s;const[c,d,h,p]=s.match(floatRegex);return{[t]:parseFloat(c),[n]:parseFloat(d),[o]:parseFloat(h),alpha:p!==void 0?parseFloat(p):1}},clampRgbUnit=t=>clamp(0,255,t),rgbUnit={...number,transform:t=>Math.round(clampRgbUnit(t))},rgba={test:isColorString("rgb","red"),parse:splitColor("red","green","blue"),transform:({red:t,green:n,blue:o,alpha:s=1})=>"rgba("+rgbUnit.transform(t)+", "+rgbUnit.transform(n)+", "+rgbUnit.transform(o)+", "+sanitize(alpha.transform(s))+")"};function parseHex(t){let n="",o="",s="",c="";return t.length>5?(n=t.substring(1,3),o=t.substring(3,5),s=t.substring(5,7),c=t.substring(7,9)):(n=t.substring(1,2),o=t.substring(2,3),s=t.substring(3,4),c=t.substring(4,5),n+=n,o+=o,s+=s,c+=c),{red:parseInt(n,16),green:parseInt(o,16),blue:parseInt(s,16),alpha:c?parseInt(c,16)/255:1}}const hex={test:isColorString("#"),parse:parseHex,transform:rgba.transform},hsla={test:isColorString("hsl","hue"),parse:splitColor("hue","saturation","lightness"),transform:({hue:t,saturation:n,lightness:o,alpha:s=1})=>"hsla("+Math.round(t)+", "+percent.transform(sanitize(n))+", "+percent.transform(sanitize(o))+", "+sanitize(alpha.transform(s))+")"},color={test:t=>rgba.test(t)||hex.test(t)||hsla.test(t),parse:t=>rgba.test(t)?rgba.parse(t):hsla.test(t)?hsla.parse(t):hex.parse(t),transform:t=>isString$1(t)?t:t.hasOwnProperty("red")?rgba.transform(t):hsla.transform(t)};function test(t){var n,o;return isNaN(t)&&isString$1(t)&&(((n=t.match(floatRegex))===null||n===void 0?void 0:n.length)||0)+(((o=t.match(colorRegex))===null||o===void 0?void 0:o.length)||0)>0}const NUMBER_TOKEN="number",COLOR_TOKEN="color",VAR_TOKEN="var",VAR_FUNCTION_TOKEN="var(",SPLIT_TOKEN="${}",complexRegex=/var\s*\(\s*--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)|#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\)|-?(?:\d+(?:\.\d+)?|\.\d+)/giu;function analyseComplexValue(t){const n=t.toString(),o=[],s={color:[],number:[],var:[]},c=[];let d=0;const p=n.replace(complexRegex,y=>(color.test(y)?(s.color.push(d),c.push(COLOR_TOKEN),o.push(color.parse(y))):y.startsWith(VAR_FUNCTION_TOKEN)?(s.var.push(d),c.push(VAR_TOKEN),o.push(y)):(s.number.push(d),c.push(NUMBER_TOKEN),o.push(parseFloat(y))),++d,SPLIT_TOKEN)).split(SPLIT_TOKEN);return{values:o,split:p,indexes:s,types:c}}function parseComplexValue(t){return analyseComplexValue(t).values}function createTransformer(t){const{split:n,types:o}=analyseComplexValue(t),s=n.length;return c=>{let d="";for(let h=0;h<s;h++)if(d+=n[h],c[h]!==void 0){const p=o[h];p===NUMBER_TOKEN?d+=sanitize(c[h]):p===COLOR_TOKEN?d+=color.transform(c[h]):d+=c[h]}return d}}const convertNumbersToZero=t=>typeof t=="number"?0:t;function getAnimatableNone$1(t){const n=parseComplexValue(t);return createTransformer(t)(n.map(convertNumbersToZero))}const complex={test,parse:parseComplexValue,createTransformer,getAnimatableNone:getAnimatableNone$1},maxDefaults=new Set(["brightness","contrast","saturate","opacity"]);function applyDefaultFilter(t){const[n,o]=t.slice(0,-1).split("(");if(n==="drop-shadow")return t;const[s]=o.match(floatRegex)||[];if(!s)return t;const c=o.replace(s,"");let d=maxDefaults.has(n)?1:0;return s!==o&&(d*=100),n+"("+d+c+")"}const functionRegex=/\b([a-z-]*)\(.*?\)/gu,filter={...complex,getAnimatableNone:t=>{const n=t.match(functionRegex);return n?n.map(applyDefaultFilter).join(" "):t}},defaultValueTypes={...numberValueTypes,color,backgroundColor:color,outlineColor:color,fill:color,stroke:color,borderColor:color,borderTopColor:color,borderRightColor:color,borderBottomColor:color,borderLeftColor:color,filter,WebkitFilter:filter},getDefaultValueType=t=>defaultValueTypes[t];function getAnimatableNone(t,n){let o=getDefaultValueType(t);return o!==filter&&(o=complex),o.getAnimatableNone?o.getAnimatableNone(n):void 0}function makeNoneKeyframesAnimatable(t,n,o){let s=0,c;for(;s<t.length&&!c;)typeof t[s]=="string"&&t[s]!=="none"&&t[s]!=="0"&&(c=t[s]),s++;if(c&&o)for(const d of n)t[d]=getAnimatableNone(o,c)}class DOMKeyframesResolver extends KeyframeResolver{constructor(n,o,s,c){super(n,o,s,c,c==null?void 0:c.owner,!0)}readKeyframes(){const{unresolvedKeyframes:n,element:o,name:s}=this;if(!o.current)return;super.readKeyframes();for(let y=0;y<n.length;y++){const E=n[y];if(typeof E=="string"&&isCSSVariableToken(E)){const L=getVariableValue(E,o.current);L!==void 0&&(n[y]=L)}}if(!positionalKeys.has(s)||n.length!==2)return this.resolveNoneKeyframes();const[c,d]=n,h=findDimensionValueType(c),p=findDimensionValueType(d);if(h!==p)if(isNumOrPxType(h)&&isNumOrPxType(p))for(let y=0;y<n.length;y++){const E=n[y];typeof E=="string"&&(n[y]=parseFloat(E))}else this.needsMeasurement=!0}resolveNoneKeyframes(){const{unresolvedKeyframes:n,name:o}=this,s=[];for(let c=0;c<n.length;c++)isNone(n[c])&&s.push(c);s.length&&makeNoneKeyframesAnimatable(n,s,o)}measureInitialState(){const{element:n,unresolvedKeyframes:o,name:s}=this;if(!n.current)return;s==="height"&&(this.suspendedScrollY=window.pageYOffset),this.measuredOrigin=positionalValues[s](n.measureViewportBox(),window.getComputedStyle(n.current)),o[0]=this.measuredOrigin;const c=o[o.length-1];c!==void 0&&n.getValue(s,c).jump(c,!1)}measureEndState(){var n;const{element:o,name:s,unresolvedKeyframes:c}=this;if(!o.current)return;const d=o.getValue(s);d&&d.jump(this.measuredOrigin,!1);const h=c.length-1,p=c[h];c[h]=positionalValues[s](o.measureViewportBox(),window.getComputedStyle(o.current)),p!==null&&(this.finalKeyframe=p),!((n=this.removedTransforms)===null||n===void 0)&&n.length&&this.removedTransforms.forEach(([y,E])=>{o.getValue(y).set(E)}),this.resolveNoneKeyframes()}}function memo(t){let n;return()=>(n===void 0&&(n=t()),n)}const isAnimatable=(t,n)=>n==="zIndex"?!1:!!(typeof t=="number"||Array.isArray(t)||typeof t=="string"&&(complex.test(t)||t==="0")&&!t.startsWith("url("));function hasKeyframesChanged(t){const n=t[0];if(t.length===1)return!0;for(let o=0;o<t.length;o++)if(t[o]!==n)return!0}function canAnimate(t,n,o,s){const c=t[0];if(c===null)return!1;const d=t[t.length-1],h=isAnimatable(c,n),p=isAnimatable(d,n);return warning(h===p,`You are trying to animate ${n} from "${c}" to "${d}". ${c} is not an animatable value - to enable this animation set ${c} to a value animatable to ${d} via the \`style\` property.`),!h||!p?!1:hasKeyframesChanged(t)||o==="spring"&&s}class BaseAnimation{constructor({autoplay:n=!0,delay:o=0,type:s="keyframes",repeat:c=0,repeatDelay:d=0,repeatType:h="loop",...p}){this.isStopped=!1,this.hasAttemptedResolve=!1,this.options={autoplay:n,delay:o,type:s,repeat:c,repeatDelay:d,repeatType:h,...p},this.updateFinishedPromise()}get resolved(){return!this._resolved&&!this.hasAttemptedResolve&&flushKeyframeResolvers(),this._resolved}onKeyframesResolved(n,o){this.hasAttemptedResolve=!0;const{name:s,type:c,velocity:d,delay:h,onComplete:p,onUpdate:y,isGenerator:E}=this.options;if(!E&&!canAnimate(n,s,c,d))if(h)this.options.duration=0;else{y==null||y(getFinalKeyframe(n,this.options,o)),p==null||p(),this.resolveFinishedPromise();return}const L=this.initPlayback(n,o);L!==!1&&(this._resolved={keyframes:n,finalKeyframe:o,...L},this.onPostResolved())}onPostResolved(){}then(n,o){return this.currentFinishedPromise.then(n,o)}updateFinishedPromise(){this.currentFinishedPromise=new Promise(n=>{this.resolveFinishedPromise=n})}}function velocityPerSecond(t,n){return n?t*(1e3/n):0}const velocitySampleDuration=5;function calcGeneratorVelocity(t,n,o){const s=Math.max(n-velocitySampleDuration,0);return velocityPerSecond(o-t(s),n-s)}const safeMin=.001,minDuration=.01,maxDuration$1=10,minDamping=.05,maxDamping=1;function findSpring({duration:t=800,bounce:n=.25,velocity:o=0,mass:s=1}){let c,d;warning(t<=secondsToMilliseconds(maxDuration$1),"Spring duration must be 10 seconds or less");let h=1-n;h=clamp(minDamping,maxDamping,h),t=clamp(minDuration,maxDuration$1,millisecondsToSeconds(t)),h<1?(c=E=>{const L=E*h,F=L*t,N=L-o,z=calcAngularFreq(E,h),oe=Math.exp(-F);return safeMin-N/z*oe},d=E=>{const F=E*h*t,N=F*o+o,z=Math.pow(h,2)*Math.pow(E,2)*t,oe=Math.exp(-F),W=calcAngularFreq(Math.pow(E,2),h);return(-c(E)+safeMin>0?-1:1)*((N-z)*oe)/W}):(c=E=>{const L=Math.exp(-E*t),F=(E-o)*t+1;return-safeMin+L*F},d=E=>{const L=Math.exp(-E*t),F=(o-E)*(t*t);return L*F});const p=5/t,y=approximateRoot(c,d,p);if(t=secondsToMilliseconds(t),isNaN(y))return{stiffness:100,damping:10,duration:t};{const E=Math.pow(y,2)*s;return{stiffness:E,damping:h*2*Math.sqrt(s*E),duration:t}}}const rootIterations=12;function approximateRoot(t,n,o){let s=o;for(let c=1;c<rootIterations;c++)s=s-t(s)/n(s);return s}function calcAngularFreq(t,n){return t*Math.sqrt(1-n*n)}const durationKeys=["duration","bounce"],physicsKeys=["stiffness","damping","mass"];function isSpringType(t,n){return n.some(o=>t[o]!==void 0)}function getSpringOptions(t){let n={velocity:0,stiffness:100,damping:10,mass:1,isResolvedFromDuration:!1,...t};if(!isSpringType(t,physicsKeys)&&isSpringType(t,durationKeys)){const o=findSpring(t);n={...n,...o,mass:1},n.isResolvedFromDuration=!0}return n}function spring({keyframes:t,restDelta:n,restSpeed:o,...s}){const c=t[0],d=t[t.length-1],h={done:!1,value:c},{stiffness:p,damping:y,mass:E,duration:L,velocity:F,isResolvedFromDuration:N}=getSpringOptions({...s,velocity:-millisecondsToSeconds(s.velocity||0)}),z=F||0,oe=y/(2*Math.sqrt(p*E)),W=d-c,nt=millisecondsToSeconds(Math.sqrt(p/E)),lt=Math.abs(W)<5;o||(o=lt?.01:2),n||(n=lt?.005:.5);let Ee;if(oe<1){const yt=calcAngularFreq(nt,oe);Ee=Ai=>{const zi=Math.exp(-oe*nt*Ai);return d-zi*((z+oe*nt*W)/yt*Math.sin(yt*Ai)+W*Math.cos(yt*Ai))}}else if(oe===1)Ee=yt=>d-Math.exp(-nt*yt)*(W+(z+nt*W)*yt);else{const yt=nt*Math.sqrt(oe*oe-1);Ee=Ai=>{const zi=Math.exp(-oe*nt*Ai),ha=Math.min(yt*Ai,300);return d-zi*((z+oe*nt*W)*Math.sinh(ha)+yt*W*Math.cosh(ha))/yt}}return{calculatedDuration:N&&L||null,next:yt=>{const Ai=Ee(yt);if(N)h.done=yt>=L;else{let zi=z;yt!==0&&(oe<1?zi=calcGeneratorVelocity(Ee,yt,Ai):zi=0);const ha=Math.abs(zi)<=o,ba=Math.abs(d-Ai)<=n;h.done=ha&&ba}return h.value=h.done?d:Ai,h}}}function inertia({keyframes:t,velocity:n=0,power:o=.8,timeConstant:s=325,bounceDamping:c=10,bounceStiffness:d=500,modifyTarget:h,min:p,max:y,restDelta:E=.5,restSpeed:L}){const F=t[0],N={done:!1,value:F},z=Sa=>p!==void 0&&Sa<p||y!==void 0&&Sa>y,oe=Sa=>p===void 0?y:y===void 0||Math.abs(p-Sa)<Math.abs(y-Sa)?p:y;let W=o*n;const nt=F+W,lt=h===void 0?nt:h(nt);lt!==nt&&(W=lt-F);const Ee=Sa=>-W*Math.exp(-Sa/s),yt=Sa=>lt+Ee(Sa),Ai=Sa=>{const ya=Ee(Sa),ms=yt(Sa);N.done=Math.abs(ya)<=E,N.value=N.done?lt:ms};let zi,ha;const ba=Sa=>{z(N.value)&&(zi=Sa,ha=spring({keyframes:[N.value,oe(N.value)],velocity:calcGeneratorVelocity(yt,Sa,N.value),damping:c,stiffness:d,restDelta:E,restSpeed:L}))};return ba(0),{calculatedDuration:null,next:Sa=>{let ya=!1;return!ha&&zi===void 0&&(ya=!0,Ai(Sa),ba(Sa)),zi!==void 0&&Sa>=zi?ha.next(Sa-zi):(!ya&&Ai(Sa),N)}}}const calcBezier=(t,n,o)=>(((1-3*o+3*n)*t+(3*o-6*n))*t+3*n)*t,subdivisionPrecision=1e-7,subdivisionMaxIterations=12;function binarySubdivide(t,n,o,s,c){let d,h,p=0;do h=n+(o-n)/2,d=calcBezier(h,s,c)-t,d>0?o=h:n=h;while(Math.abs(d)>subdivisionPrecision&&++p<subdivisionMaxIterations);return h}function cubicBezier(t,n,o,s){if(t===n&&o===s)return noop$1;const c=d=>binarySubdivide(d,0,1,t,o);return d=>d===0||d===1?d:calcBezier(c(d),n,s)}const easeIn=cubicBezier(.42,0,1,1),easeOut=cubicBezier(0,0,.58,1),easeInOut=cubicBezier(.42,0,.58,1),isEasingArray=t=>Array.isArray(t)&&typeof t[0]!="number",mirrorEasing=t=>n=>n<=.5?t(2*n)/2:(2-t(2*(1-n)))/2,reverseEasing=t=>n=>1-t(1-n),circIn=t=>1-Math.sin(Math.acos(t)),circOut=reverseEasing(circIn),circInOut=mirrorEasing(circIn),backOut=cubicBezier(.33,1.53,.69,.99),backIn=reverseEasing(backOut),backInOut=mirrorEasing(backIn),anticipate=t=>(t*=2)<1?.5*backIn(t):.5*(2-Math.pow(2,-10*(t-1))),easingLookup={linear:noop$1,easeIn,easeInOut,easeOut,circIn,circInOut,circOut,backIn,backInOut,backOut,anticipate},easingDefinitionToFunction=t=>{if(Array.isArray(t)){invariant(t.length===4,"Cubic bezier arrays must contain four numerical values.");const[n,o,s,c]=t;return cubicBezier(n,o,s,c)}else if(typeof t=="string")return invariant(easingLookup[t]!==void 0,`Invalid easing type '${t}'`),easingLookup[t];return t},progress=(t,n,o)=>{const s=n-t;return s===0?1:(o-t)/s},mixNumber$1=(t,n,o)=>t+(n-t)*o;function hueToRgb(t,n,o){return o<0&&(o+=1),o>1&&(o-=1),o<1/6?t+(n-t)*6*o:o<1/2?n:o<2/3?t+(n-t)*(2/3-o)*6:t}function hslaToRgba({hue:t,saturation:n,lightness:o,alpha:s}){t/=360,n/=100,o/=100;let c=0,d=0,h=0;if(!n)c=d=h=o;else{const p=o<.5?o*(1+n):o+n-o*n,y=2*o-p;c=hueToRgb(y,p,t+1/3),d=hueToRgb(y,p,t),h=hueToRgb(y,p,t-1/3)}return{red:Math.round(c*255),green:Math.round(d*255),blue:Math.round(h*255),alpha:s}}const mixLinearColor=(t,n,o)=>{const s=t*t,c=o*(n*n-s)+s;return c<0?0:Math.sqrt(c)},colorTypes=[hex,rgba,hsla],getColorType=t=>colorTypes.find(n=>n.test(t));function asRGBA(t){const n=getColorType(t);invariant(!!n,`'${t}' is not an animatable color. Use the equivalent color code instead.`);let o=n.parse(t);return n===hsla&&(o=hslaToRgba(o)),o}const mixColor=(t,n)=>{const o=asRGBA(t),s=asRGBA(n),c={...o};return d=>(c.red=mixLinearColor(o.red,s.red,d),c.green=mixLinearColor(o.green,s.green,d),c.blue=mixLinearColor(o.blue,s.blue,d),c.alpha=mixNumber$1(o.alpha,s.alpha,d),rgba.transform(c))};function mixImmediate(t,n){return o=>o>0?n:t}function mixNumber(t,n){return o=>mixNumber$1(t,n,o)}function getMixer(t){return typeof t=="number"?mixNumber:typeof t=="string"?isCSSVariableToken(t)?mixImmediate:color.test(t)?mixColor:mixComplex:Array.isArray(t)?mixArray:typeof t=="object"?color.test(t)?mixColor:mixObject:mixImmediate}function mixArray(t,n){const o=[...t],s=o.length,c=t.map((d,h)=>getMixer(d)(d,n[h]));return d=>{for(let h=0;h<s;h++)o[h]=c[h](d);return o}}function mixObject(t,n){const o={...t,...n},s={};for(const c in o)t[c]!==void 0&&n[c]!==void 0&&(s[c]=getMixer(t[c])(t[c],n[c]));return c=>{for(const d in s)o[d]=s[d](c);return o}}function matchOrder(t,n){var o;const s=[],c={color:0,var:0,number:0};for(let d=0;d<n.values.length;d++){const h=n.types[d],p=t.indexes[h][c[h]],y=(o=t.values[p])!==null&&o!==void 0?o:0;s[d]=y,c[h]++}return s}const mixComplex=(t,n)=>{const o=complex.createTransformer(n),s=analyseComplexValue(t),c=analyseComplexValue(n);return s.indexes.var.length===c.indexes.var.length&&s.indexes.color.length===c.indexes.color.length&&s.indexes.number.length>=c.indexes.number.length?pipe(mixArray(matchOrder(s,c),c.values),o):(warning(!0,`Complex values '${t}' and '${n}' too different to mix. Ensure all colors are of the same type, and that each contains the same quantity of number and color values. Falling back to instant transition.`),mixImmediate(t,n))};function mix(t,n,o){return typeof t=="number"&&typeof n=="number"&&typeof o=="number"?mixNumber$1(t,n,o):getMixer(t)(t,n)}function createMixers(t,n,o){const s=[],c=o||mix,d=t.length-1;for(let h=0;h<d;h++){let p=c(t[h],t[h+1]);if(n){const y=Array.isArray(n)?n[h]||noop$1:n;p=pipe(y,p)}s.push(p)}return s}function interpolate(t,n,{clamp:o=!0,ease:s,mixer:c}={}){const d=t.length;if(invariant(d===n.length,"Both input and output ranges must be the same length"),d===1)return()=>n[0];if(d===2&&t[0]===t[1])return()=>n[1];t[0]>t[d-1]&&(t=[...t].reverse(),n=[...n].reverse());const h=createMixers(n,s,c),p=h.length,y=E=>{let L=0;if(p>1)for(;L<t.length-2&&!(E<t[L+1]);L++);const F=progress(t[L],t[L+1],E);return h[L](F)};return o?E=>y(clamp(t[0],t[d-1],E)):y}function fillOffset(t,n){const o=t[t.length-1];for(let s=1;s<=n;s++){const c=progress(0,n,s);t.push(mixNumber$1(o,1,c))}}function defaultOffset(t){const n=[0];return fillOffset(n,t.length-1),n}function convertOffsetToTimes(t,n){return t.map(o=>o*n)}function defaultEasing(t,n){return t.map(()=>n||easeInOut).splice(0,t.length-1)}function keyframes({duration:t=300,keyframes:n,times:o,ease:s="easeInOut"}){const c=isEasingArray(s)?s.map(easingDefinitionToFunction):easingDefinitionToFunction(s),d={done:!1,value:n[0]},h=convertOffsetToTimes(o&&o.length===n.length?o:defaultOffset(n),t),p=interpolate(h,n,{ease:Array.isArray(c)?c:defaultEasing(n,c)});return{calculatedDuration:t,next:y=>(d.value=p(y),d.done=y>=t,d)}}const maxGeneratorDuration=2e4;function calcGeneratorDuration(t){let n=0;const o=50;let s=t.next(n);for(;!s.done&&n<maxGeneratorDuration;)n+=o,s=t.next(n);return n>=maxGeneratorDuration?1/0:n}const frameloopDriver=t=>{const n=({timestamp:o})=>t(o);return{start:()=>frame.update(n,!0),stop:()=>cancelFrame(n),now:()=>frameData.isProcessing?frameData.timestamp:time.now()}},generators={decay:inertia,inertia,tween:keyframes,keyframes,spring},percentToProgress=t=>t/100;class MainThreadAnimation extends BaseAnimation{constructor({KeyframeResolver:n=KeyframeResolver,...o}){super(o),this.holdTime=null,this.startTime=null,this.cancelTime=null,this.currentTime=0,this.playbackSpeed=1,this.pendingPlayState="running",this.state="idle";const{name:s,motionValue:c,keyframes:d}=this.options,h=(p,y)=>this.onKeyframesResolved(p,y);s&&c&&c.owner?this.resolver=c.owner.resolveKeyframes(d,h,s,c):this.resolver=new n(d,h,s,c),this.resolver.scheduleResolve()}initPlayback(n){const{type:o="keyframes",repeat:s=0,repeatDelay:c=0,repeatType:d,velocity:h=0}=this.options,p=generators[o]||keyframes;let y,E;p!==keyframes&&typeof n[0]!="number"&&(process.env.NODE_ENV!=="production"&&invariant(n.length===2,`Only two keyframes currently supported with spring and inertia animations. Trying to animate ${n}`),y=pipe(percentToProgress,mix(n[0],n[1])),n=[0,100]);const L=p({...this.options,keyframes:n});d==="mirror"&&(E=p({...this.options,keyframes:[...n].reverse(),velocity:-h})),L.calculatedDuration===null&&(L.calculatedDuration=calcGeneratorDuration(L));const{calculatedDuration:F}=L,N=F+c,z=N*(s+1)-c;return{generator:L,mirroredGenerator:E,mapPercentToKeyframes:y,calculatedDuration:F,resolvedDuration:N,totalDuration:z}}onPostResolved(){const{autoplay:n=!0}=this.options;this.play(),this.pendingPlayState==="paused"||!n?this.pause():this.state=this.pendingPlayState}tick(n,o=!1){const{resolved:s}=this;if(!s){const{keyframes:Sa}=this.options;return{done:!0,value:Sa[Sa.length-1]}}const{finalKeyframe:c,generator:d,mirroredGenerator:h,mapPercentToKeyframes:p,keyframes:y,calculatedDuration:E,totalDuration:L,resolvedDuration:F}=s;if(this.startTime===null)return d.next(0);const{delay:N,repeat:z,repeatType:oe,repeatDelay:W,onUpdate:nt}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,n):this.speed<0&&(this.startTime=Math.min(n-L/this.speed,this.startTime)),o?this.currentTime=n:this.holdTime!==null?this.currentTime=this.holdTime:this.currentTime=Math.round(n-this.startTime)*this.speed;const lt=this.currentTime-N*(this.speed>=0?1:-1),Ee=this.speed>=0?lt<0:lt>L;this.currentTime=Math.max(lt,0),this.state==="finished"&&this.holdTime===null&&(this.currentTime=L);let yt=this.currentTime,Ai=d;if(z){const Sa=Math.min(this.currentTime,L)/F;let ya=Math.floor(Sa),ms=Sa%1;!ms&&Sa>=1&&(ms=1),ms===1&&ya--,ya=Math.min(ya,z+1),!!(ya%2)&&(oe==="reverse"?(ms=1-ms,W&&(ms-=W/F)):oe==="mirror"&&(Ai=h)),yt=clamp(0,1,ms)*F}const zi=Ee?{done:!1,value:y[0]}:Ai.next(yt);p&&(zi.value=p(zi.value));let{done:ha}=zi;!Ee&&E!==null&&(ha=this.speed>=0?this.currentTime>=L:this.currentTime<=0);const ba=this.holdTime===null&&(this.state==="finished"||this.state==="running"&&ha);return ba&&c!==void 0&&(zi.value=getFinalKeyframe(y,this.options,c)),nt&&nt(zi.value),ba&&this.finish(),zi}get duration(){const{resolved:n}=this;return n?millisecondsToSeconds(n.calculatedDuration):0}get time(){return millisecondsToSeconds(this.currentTime)}set time(n){n=secondsToMilliseconds(n),this.currentTime=n,this.holdTime!==null||this.speed===0?this.holdTime=n:this.driver&&(this.startTime=this.driver.now()-n/this.speed)}get speed(){return this.playbackSpeed}set speed(n){const o=this.playbackSpeed!==n;this.playbackSpeed=n,o&&(this.time=millisecondsToSeconds(this.currentTime))}play(){if(this.resolver.isScheduled||this.resolver.resume(),!this._resolved){this.pendingPlayState="running";return}if(this.isStopped)return;const{driver:n=frameloopDriver,onPlay:o}=this.options;this.driver||(this.driver=n(c=>this.tick(c))),o&&o();const s=this.driver.now();this.holdTime!==null?this.startTime=s-this.holdTime:(!this.startTime||this.state==="finished")&&(this.startTime=s),this.state==="finished"&&this.updateFinishedPromise(),this.cancelTime=this.startTime,this.holdTime=null,this.state="running",this.driver.start()}pause(){var n;if(!this._resolved){this.pendingPlayState="paused";return}this.state="paused",this.holdTime=(n=this.currentTime)!==null&&n!==void 0?n:0}stop(){if(this.resolver.cancel(),this.isStopped=!0,this.state==="idle")return;this.teardown();const{onStop:n}=this.options;n&&n()}complete(){this.state!=="running"&&this.play(),this.pendingPlayState=this.state="finished",this.holdTime=null}finish(){this.teardown(),this.state="finished";const{onComplete:n}=this.options;n&&n()}cancel(){this.cancelTime!==null&&this.tick(this.cancelTime),this.teardown(),this.updateFinishedPromise()}teardown(){this.state="idle",this.stopDriver(),this.resolveFinishedPromise(),this.updateFinishedPromise(),this.startTime=this.cancelTime=null,this.resolver.cancel()}stopDriver(){this.driver&&(this.driver.stop(),this.driver=void 0)}sample(n){return this.startTime=0,this.tick(n,!0)}}const isBezierDefinition=t=>Array.isArray(t)&&typeof t[0]=="number";function isWaapiSupportedEasing(t){return!!(!t||typeof t=="string"&&supportedWaapiEasing[t]||isBezierDefinition(t)||Array.isArray(t)&&t.every(isWaapiSupportedEasing))}const cubicBezierAsString=([t,n,o,s])=>`cubic-bezier(${t}, ${n}, ${o}, ${s})`,supportedWaapiEasing={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:cubicBezierAsString([0,.65,.55,1]),circOut:cubicBezierAsString([.55,0,1,.45]),backIn:cubicBezierAsString([.31,.01,.66,-.59]),backOut:cubicBezierAsString([.33,1.53,.69,.99])};function mapEasingToNativeEasing(t){if(t)return isBezierDefinition(t)?cubicBezierAsString(t):Array.isArray(t)?t.map(mapEasingToNativeEasing):supportedWaapiEasing[t]}function animateStyle(t,n,o,{delay:s=0,duration:c=300,repeat:d=0,repeatType:h="loop",ease:p,times:y}={}){const E={[n]:o};y&&(E.offset=y);const L=mapEasingToNativeEasing(p);return Array.isArray(L)&&(E.easing=L),t.animate(E,{delay:s,duration:c,easing:Array.isArray(L)?"linear":L,fill:"both",iterations:d+1,direction:h==="reverse"?"alternate":"normal"})}const supportsWaapi=memo(()=>Object.hasOwnProperty.call(Element.prototype,"animate")),acceleratedValues=new Set(["opacity","clipPath","filter","transform"]),sampleDelta=10,maxDuration=2e4;function requiresPregeneratedKeyframes(t){return t.type==="spring"||t.name==="backgroundColor"||!isWaapiSupportedEasing(t.ease)}function pregenerateKeyframes(t,n){const o=new MainThreadAnimation({...n,keyframes:t,repeat:0,delay:0,isGenerator:!0});let s={done:!1,value:t[0]};const c=[];let d=0;for(;!s.done&&d<maxDuration;)s=o.sample(d),c.push(s.value),d+=sampleDelta;return{times:void 0,keyframes:c,duration:d-sampleDelta,ease:"linear"}}class AcceleratedAnimation extends BaseAnimation{constructor(n){super(n);const{name:o,motionValue:s,keyframes:c}=this.options;this.resolver=new DOMKeyframesResolver(c,(d,h)=>this.onKeyframesResolved(d,h),o,s),this.resolver.scheduleResolve()}initPlayback(n,o){var s;let{duration:c=300,times:d,ease:h,type:p,motionValue:y,name:E}=this.options;if(!(!((s=y.owner)===null||s===void 0)&&s.current))return!1;if(requiresPregeneratedKeyframes(this.options)){const{onComplete:F,onUpdate:N,motionValue:z,...oe}=this.options,W=pregenerateKeyframes(n,oe);n=W.keyframes,n.length===1&&(n[1]=n[0]),c=W.duration,d=W.times,h=W.ease,p="keyframes"}const L=animateStyle(y.owner.current,E,n,{...this.options,duration:c,times:d,ease:h});return L.startTime=time.now(),this.pendingTimeline?(L.timeline=this.pendingTimeline,this.pendingTimeline=void 0):L.onfinish=()=>{const{onComplete:F}=this.options;y.set(getFinalKeyframe(n,this.options,o)),F&&F(),this.cancel(),this.resolveFinishedPromise()},{animation:L,duration:c,times:d,type:p,ease:h,keyframes:n}}get duration(){const{resolved:n}=this;if(!n)return 0;const{duration:o}=n;return millisecondsToSeconds(o)}get time(){const{resolved:n}=this;if(!n)return 0;const{animation:o}=n;return millisecondsToSeconds(o.currentTime||0)}set time(n){const{resolved:o}=this;if(!o)return;const{animation:s}=o;s.currentTime=secondsToMilliseconds(n)}get speed(){const{resolved:n}=this;if(!n)return 1;const{animation:o}=n;return o.playbackRate}set speed(n){const{resolved:o}=this;if(!o)return;const{animation:s}=o;s.playbackRate=n}get state(){const{resolved:n}=this;if(!n)return"idle";const{animation:o}=n;return o.playState}attachTimeline(n){if(!this._resolved)this.pendingTimeline=n;else{const{resolved:o}=this;if(!o)return noop$1;const{animation:s}=o;s.timeline=n,s.onfinish=null}return noop$1}play(){if(this.isStopped)return;const{resolved:n}=this;if(!n)return;const{animation:o}=n;o.playState==="finished"&&this.updateFinishedPromise(),o.play()}pause(){const{resolved:n}=this;if(!n)return;const{animation:o}=n;o.pause()}stop(){if(this.resolver.cancel(),this.isStopped=!0,this.state==="idle")return;const{resolved:n}=this;if(!n)return;const{animation:o,keyframes:s,duration:c,type:d,ease:h,times:p}=n;if(!(o.playState==="idle"||o.playState==="finished")){if(this.time){const{motionValue:y,onUpdate:E,onComplete:L,...F}=this.options,N=new MainThreadAnimation({...F,keyframes:s,duration:c,type:d,ease:h,times:p,isGenerator:!0}),z=secondsToMilliseconds(this.time);y.setWithVelocity(N.sample(z-sampleDelta).value,N.sample(z).value,sampleDelta)}this.cancel()}}complete(){const{resolved:n}=this;n&&n.animation.finish()}cancel(){const{resolved:n}=this;n&&n.animation.cancel()}static supports(n){const{motionValue:o,name:s,repeatDelay:c,repeatType:d,damping:h,type:p}=n;return supportsWaapi()&&s&&acceleratedValues.has(s)&&o&&o.owner&&o.owner.current instanceof HTMLElement&&!o.owner.getProps().onUpdate&&!c&&d!=="mirror"&&h!==0&&p!=="inertia"}}const animateMotionValue=(t,n,o,s={},c,d)=>h=>{const p=getValueTransition(s,t)||{},y=p.delay||s.delay||0;let{elapsed:E=0}=s;E=E-secondsToMilliseconds(y);let L={keyframes:Array.isArray(o)?o:[null,o],ease:"easeOut",velocity:n.getVelocity(),...p,delay:-E,onUpdate:N=>{n.set(N),p.onUpdate&&p.onUpdate(N)},onComplete:()=>{h(),p.onComplete&&p.onComplete()},name:t,motionValue:n,element:d?void 0:c};isTransitionDefined(p)||(L={...L,...getDefaultTransition(t,L)}),L.duration&&(L.duration=secondsToMilliseconds(L.duration)),L.repeatDelay&&(L.repeatDelay=secondsToMilliseconds(L.repeatDelay)),L.from!==void 0&&(L.keyframes[0]=L.from);let F=!1;if((L.type===!1||L.duration===0&&!L.repeatDelay)&&(L.duration=0,L.delay===0&&(F=!0)),F&&!d&&n.get()!==void 0){const N=getFinalKeyframe(L.keyframes,p);if(N!==void 0){frame.update(()=>{L.onUpdate(N),L.onComplete()});return}}return!d&&AcceleratedAnimation.supports(L)?new AcceleratedAnimation(L):new MainThreadAnimation(L)};function isWillChangeMotionValue(t){return!!(isMotionValue(t)&&t.add)}function addUniqueItem(t,n){t.indexOf(n)===-1&&t.push(n)}function removeItem(t,n){const o=t.indexOf(n);o>-1&&t.splice(o,1)}class SubscriptionManager{constructor(){this.subscriptions=[]}add(n){return addUniqueItem(this.subscriptions,n),()=>removeItem(this.subscriptions,n)}notify(n,o,s){const c=this.subscriptions.length;if(c)if(c===1)this.subscriptions[0](n,o,s);else for(let d=0;d<c;d++){const h=this.subscriptions[d];h&&h(n,o,s)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}}const warned=new Set;function warnOnce(t,n,o){t||warned.has(n)||(console.warn(n),warned.add(n))}const MAX_VELOCITY_DELTA=30,isFloat=t=>!isNaN(parseFloat(t));class MotionValue{constructor(n,o={}){this.version="11.0.27",this.canTrackVelocity=!1,this.events={},this.updateAndNotify=(s,c=!0)=>{const d=time.now();this.updatedAt!==d&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(s),this.current!==this.prev&&this.events.change&&this.events.change.notify(this.current),c&&this.events.renderRequest&&this.events.renderRequest.notify(this.current)},this.hasAnimated=!1,this.setCurrent(n),this.canTrackVelocity=isFloat(this.current),this.owner=o.owner}setCurrent(n){this.current=n,this.updatedAt=time.now()}setPrevFrameValue(n=this.current){this.prevFrameValue=n,this.prevUpdatedAt=this.updatedAt}onChange(n){return process.env.NODE_ENV!=="production"&&warnOnce(!1,'value.onChange(callback) is deprecated. Switch to value.on("change", callback).'),this.on("change",n)}on(n,o){this.events[n]||(this.events[n]=new SubscriptionManager);const s=this.events[n].add(o);return n==="change"?()=>{s(),frame.read(()=>{this.events.change.getSize()||this.stop()})}:s}clearListeners(){for(const n in this.events)this.events[n].clear()}attach(n,o){this.passiveEffect=n,this.stopPassiveEffect=o}set(n,o=!0){!o||!this.passiveEffect?this.updateAndNotify(n,o):this.passiveEffect(n,this.updateAndNotify)}setWithVelocity(n,o,s){this.set(o),this.prev=void 0,this.prevFrameValue=n,this.prevUpdatedAt=this.updatedAt-s}jump(n,o=!0){this.updateAndNotify(n),this.prev=n,this.prevUpdatedAt=this.prevFrameValue=void 0,o&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}get(){return this.current}getPrevious(){return this.prev}getVelocity(){const n=time.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||n-this.updatedAt>MAX_VELOCITY_DELTA)return 0;const o=Math.min(this.updatedAt-this.prevUpdatedAt,MAX_VELOCITY_DELTA);return velocityPerSecond(parseFloat(this.current)-parseFloat(this.prevFrameValue),o)}start(n){return this.stop(),new Promise(o=>{this.hasAnimated=!0,this.animation=n(o),this.events.animationStart&&this.events.animationStart.notify()}).then(()=>{this.events.animationComplete&&this.events.animationComplete.notify(),this.clearAnimation()})}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel&&this.events.animationCancel.notify()),this.clearAnimation()}isAnimating(){return!!this.animation}clearAnimation(){delete this.animation}destroy(){this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}}function motionValue(t,n){return new MotionValue(t,n)}function setMotionValue(t,n,o){t.hasValue(n)?t.getValue(n).set(o):t.addValue(n,motionValue(o))}function setTarget(t,n){const o=resolveVariant(t,n);let{transitionEnd:s={},transition:c={},...d}=o||{};d={...d,...s};for(const h in d){const p=resolveFinalValueInKeyframes(d[h]);setMotionValue(t,h,p)}}function shouldBlockAnimation({protectedKeys:t,needsAnimating:n},o){const s=t.hasOwnProperty(o)&&n[o]!==!0;return n[o]=!1,s}function animateTarget(t,n,{delay:o=0,transitionOverride:s,type:c}={}){var d;let{transition:h=t.getDefaultTransition(),transitionEnd:p,...y}=n;const E=t.getValue("willChange");s&&(h=s);const L=[],F=c&&t.animationState&&t.animationState.getState()[c];for(const N in y){const z=t.getValue(N,(d=t.latestValues[N])!==null&&d!==void 0?d:null),oe=y[N];if(oe===void 0||F&&shouldBlockAnimation(F,N))continue;const W={delay:o,elapsed:0,...getValueTransition(h||{},N)};let nt=!1;if(window.HandoffAppearAnimations){const Ee=t.getProps()[optimizedAppearDataAttribute];if(Ee){const yt=window.HandoffAppearAnimations(Ee,N);yt!==null&&(W.elapsed=yt,nt=!0)}}z.start(animateMotionValue(N,z,oe,t.shouldReduceMotion&&transformProps.has(N)?{type:!1}:W,t,nt));const lt=z.animation;lt&&(isWillChangeMotionValue(E)&&(E.add(N),lt.then(()=>E.remove(N))),L.push(lt))}return p&&Promise.all(L).then(()=>{frame.update(()=>{p&&setTarget(t,p)})}),L}function animateVariant(t,n,o={}){var s;const c=resolveVariant(t,n,o.type==="exit"?(s=t.presenceContext)===null||s===void 0?void 0:s.custom:void 0);let{transition:d=t.getDefaultTransition()||{}}=c||{};o.transitionOverride&&(d=o.transitionOverride);const h=c?()=>Promise.all(animateTarget(t,c,o)):()=>Promise.resolve(),p=t.variantChildren&&t.variantChildren.size?(E=0)=>{const{delayChildren:L=0,staggerChildren:F,staggerDirection:N}=d;return animateChildren(t,n,L+E,F,N,o)}:()=>Promise.resolve(),{when:y}=d;if(y){const[E,L]=y==="beforeChildren"?[h,p]:[p,h];return E().then(()=>L())}else return Promise.all([h(),p(o.delay)])}function animateChildren(t,n,o=0,s=0,c=1,d){const h=[],p=(t.variantChildren.size-1)*s,y=c===1?(E=0)=>E*s:(E=0)=>p-E*s;return Array.from(t.variantChildren).sort(sortByTreeOrder).forEach((E,L)=>{E.notify("AnimationStart",n),h.push(animateVariant(E,n,{...d,delay:o+y(L)}).then(()=>E.notify("AnimationComplete",n)))}),Promise.all(h)}function sortByTreeOrder(t,n){return t.sortNodePosition(n)}function animateVisualElement(t,n,o={}){t.notify("AnimationStart",n);let s;if(Array.isArray(n)){const c=n.map(d=>animateVariant(t,d,o));s=Promise.all(c)}else if(typeof n=="string")s=animateVariant(t,n,o);else{const c=typeof n=="function"?resolveVariant(t,n,o.custom):n;s=Promise.all(animateTarget(t,c,o))}return s.then(()=>{frame.postRender(()=>{t.notify("AnimationComplete",n)})})}const reversePriorityOrder=[...variantPriorityOrder].reverse(),numAnimationTypes=variantPriorityOrder.length;function animateList(t){return n=>Promise.all(n.map(({animation:o,options:s})=>animateVisualElement(t,o,s)))}function createAnimationState(t){let n=animateList(t);const o=createState();let s=!0;const c=y=>(E,L)=>{var F;const N=resolveVariant(t,L,y==="exit"?(F=t.presenceContext)===null||F===void 0?void 0:F.custom:void 0);if(N){const{transition:z,transitionEnd:oe,...W}=N;E={...E,...W,...oe}}return E};function d(y){n=y(t)}function h(y){const E=t.getProps(),L=t.getVariantContext(!0)||{},F=[],N=new Set;let z={},oe=1/0;for(let nt=0;nt<numAnimationTypes;nt++){const lt=reversePriorityOrder[nt],Ee=o[lt],yt=E[lt]!==void 0?E[lt]:L[lt],Ai=isVariantLabel(yt),zi=lt===y?Ee.isActive:null;zi===!1&&(oe=nt);let ha=yt===L[lt]&&yt!==E[lt]&&Ai;if(ha&&s&&t.manuallyAnimateOnMount&&(ha=!1),Ee.protectedKeys={...z},!Ee.isActive&&zi===null||!yt&&!Ee.prevProp||isAnimationControls(yt)||typeof yt=="boolean")continue;let Sa=checkVariantsDidChange(Ee.prevProp,yt)||lt===y&&Ee.isActive&&!ha&&Ai||nt>oe&&Ai,ya=!1;const ms=Array.isArray(yt)?yt:[yt];let Wc=ms.reduce(c(lt),{});zi===!1&&(Wc={});const{prevResolvedValues:Wa={}}=Ee,pi={...Wa,...Wc},mt=fa=>{Sa=!0,N.has(fa)&&(ya=!0,N.delete(fa)),Ee.needsAnimating[fa]=!0;const Ra=t.getValue(fa);Ra&&(Ra.liveStyle=!1)};for(const fa in pi){const Ra=Wc[fa],sl=Wa[fa];if(z.hasOwnProperty(fa))continue;let Zd=!1;isKeyframesTarget(Ra)&&isKeyframesTarget(sl)?Zd=!shallowCompare(Ra,sl):Zd=Ra!==sl,Zd?Ra!=null?mt(fa):N.add(fa):Ra!==void 0&&N.has(fa)?mt(fa):Ee.protectedKeys[fa]=!0}Ee.prevProp=yt,Ee.prevResolvedValues=Wc,Ee.isActive&&(z={...z,...Wc}),s&&t.blockInitialAnimation&&(Sa=!1),Sa&&(!ha||ya)&&F.push(...ms.map(fa=>({animation:fa,options:{type:lt}})))}if(N.size){const nt={};N.forEach(lt=>{const Ee=t.getBaseTarget(lt),yt=t.getValue(lt);yt&&(yt.liveStyle=!0),nt[lt]=Ee===void 0?null:Ee}),F.push({animation:nt})}let W=!!F.length;return s&&(E.initial===!1||E.initial===E.animate)&&!t.manuallyAnimateOnMount&&(W=!1),s=!1,W?n(F):Promise.resolve()}function p(y,E){var L;if(o[y].isActive===E)return Promise.resolve();(L=t.variantChildren)===null||L===void 0||L.forEach(N=>{var z;return(z=N.animationState)===null||z===void 0?void 0:z.setActive(y,E)}),o[y].isActive=E;const F=h(y);for(const N in o)o[N].protectedKeys={};return F}return{animateChanges:h,setActive:p,setAnimateFunction:d,getState:()=>o}}function checkVariantsDidChange(t,n){return typeof n=="string"?n!==t:Array.isArray(n)?!shallowCompare(n,t):!1}function createTypeState(t=!1){return{isActive:t,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function createState(){return{animate:createTypeState(!0),whileInView:createTypeState(),whileHover:createTypeState(),whileTap:createTypeState(),whileDrag:createTypeState(),whileFocus:createTypeState(),exit:createTypeState()}}class AnimationFeature extends Feature{constructor(n){super(n),n.animationState||(n.animationState=createAnimationState(n))}updateAnimationControlsSubscription(){const{animate:n}=this.node.getProps();this.unmount(),isAnimationControls(n)&&(this.unmount=n.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){const{animate:n}=this.node.getProps(),{animate:o}=this.node.prevProps||{};n!==o&&this.updateAnimationControlsSubscription()}unmount(){}}let id$1=0;class ExitAnimationFeature extends Feature{constructor(){super(...arguments),this.id=id$1++}update(){if(!this.node.presenceContext)return;const{isPresent:n,onExitComplete:o}=this.node.presenceContext,{isPresent:s}=this.node.prevPresenceContext||{};if(!this.node.animationState||n===s)return;const c=this.node.animationState.setActive("exit",!n);o&&!n&&c.then(()=>o(this.id))}mount(){const{register:n}=this.node.presenceContext||{};n&&(this.unmount=n(this.id))}unmount(){}}const animations={animation:{Feature:AnimationFeature},exit:{Feature:ExitAnimationFeature}},distance=(t,n)=>Math.abs(t-n);function distance2D(t,n){const o=distance(t.x,n.x),s=distance(t.y,n.y);return Math.sqrt(o**2+s**2)}class PanSession{constructor(n,o,{transformPagePoint:s,contextWindow:c,dragSnapToOrigin:d=!1}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.handlers={},this.contextWindow=window,this.updatePoint=()=>{if(!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const F=getPanInfo(this.lastMoveEventInfo,this.history),N=this.startEvent!==null,z=distance2D(F.offset,{x:0,y:0})>=3;if(!N&&!z)return;const{point:oe}=F,{timestamp:W}=frameData;this.history.push({...oe,timestamp:W});const{onStart:nt,onMove:lt}=this.handlers;N||(nt&&nt(this.lastMoveEvent,F),this.startEvent=this.lastMoveEvent),lt&<(this.lastMoveEvent,F)},this.handlePointerMove=(F,N)=>{this.lastMoveEvent=F,this.lastMoveEventInfo=transformPoint(N,this.transformPagePoint),frame.update(this.updatePoint,!0)},this.handlePointerUp=(F,N)=>{this.end();const{onEnd:z,onSessionEnd:oe,resumeAnimation:W}=this.handlers;if(this.dragSnapToOrigin&&W&&W(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const nt=getPanInfo(F.type==="pointercancel"?this.lastMoveEventInfo:transformPoint(N,this.transformPagePoint),this.history);this.startEvent&&z&&z(F,nt),oe&&oe(F,nt)},!isPrimaryPointer(n))return;this.dragSnapToOrigin=d,this.handlers=o,this.transformPagePoint=s,this.contextWindow=c||window;const h=extractEventInfo(n),p=transformPoint(h,this.transformPagePoint),{point:y}=p,{timestamp:E}=frameData;this.history=[{...y,timestamp:E}];const{onSessionStart:L}=o;L&&L(n,getPanInfo(p,this.history)),this.removeListeners=pipe(addPointerEvent(this.contextWindow,"pointermove",this.handlePointerMove),addPointerEvent(this.contextWindow,"pointerup",this.handlePointerUp),addPointerEvent(this.contextWindow,"pointercancel",this.handlePointerUp))}updateHandlers(n){this.handlers=n}end(){this.removeListeners&&this.removeListeners(),cancelFrame(this.updatePoint)}}function transformPoint(t,n){return n?{point:n(t.point)}:t}function subtractPoint(t,n){return{x:t.x-n.x,y:t.y-n.y}}function getPanInfo({point:t},n){return{point:t,delta:subtractPoint(t,lastDevicePoint(n)),offset:subtractPoint(t,startDevicePoint(n)),velocity:getVelocity(n,.1)}}function startDevicePoint(t){return t[0]}function lastDevicePoint(t){return t[t.length-1]}function getVelocity(t,n){if(t.length<2)return{x:0,y:0};let o=t.length-1,s=null;const c=lastDevicePoint(t);for(;o>=0&&(s=t[o],!(c.timestamp-s.timestamp>secondsToMilliseconds(n)));)o--;if(!s)return{x:0,y:0};const d=millisecondsToSeconds(c.timestamp-s.timestamp);if(d===0)return{x:0,y:0};const h={x:(c.x-s.x)/d,y:(c.y-s.y)/d};return h.x===1/0&&(h.x=0),h.y===1/0&&(h.y=0),h}function calcLength(t){return t.max-t.min}function isNear(t,n=0,o=.01){return Math.abs(t-n)<=o}function calcAxisDelta(t,n,o,s=.5){t.origin=s,t.originPoint=mixNumber$1(n.min,n.max,t.origin),t.scale=calcLength(o)/calcLength(n),(isNear(t.scale,1,1e-4)||isNaN(t.scale))&&(t.scale=1),t.translate=mixNumber$1(o.min,o.max,t.origin)-t.originPoint,(isNear(t.translate)||isNaN(t.translate))&&(t.translate=0)}function calcBoxDelta(t,n,o,s){calcAxisDelta(t.x,n.x,o.x,s?s.originX:void 0),calcAxisDelta(t.y,n.y,o.y,s?s.originY:void 0)}function calcRelativeAxis(t,n,o){t.min=o.min+n.min,t.max=t.min+calcLength(n)}function calcRelativeBox(t,n,o){calcRelativeAxis(t.x,n.x,o.x),calcRelativeAxis(t.y,n.y,o.y)}function calcRelativeAxisPosition(t,n,o){t.min=n.min-o.min,t.max=t.min+calcLength(n)}function calcRelativePosition(t,n,o){calcRelativeAxisPosition(t.x,n.x,o.x),calcRelativeAxisPosition(t.y,n.y,o.y)}function applyConstraints(t,{min:n,max:o},s){return n!==void 0&&t<n?t=s?mixNumber$1(n,t,s.min):Math.max(t,n):o!==void 0&&t>o&&(t=s?mixNumber$1(o,t,s.max):Math.min(t,o)),t}function calcRelativeAxisConstraints(t,n,o){return{min:n!==void 0?t.min+n:void 0,max:o!==void 0?t.max+o-(t.max-t.min):void 0}}function calcRelativeConstraints(t,{top:n,left:o,bottom:s,right:c}){return{x:calcRelativeAxisConstraints(t.x,o,c),y:calcRelativeAxisConstraints(t.y,n,s)}}function calcViewportAxisConstraints(t,n){let o=n.min-t.min,s=n.max-t.max;return n.max-n.min<t.max-t.min&&([o,s]=[s,o]),{min:o,max:s}}function calcViewportConstraints(t,n){return{x:calcViewportAxisConstraints(t.x,n.x),y:calcViewportAxisConstraints(t.y,n.y)}}function calcOrigin(t,n){let o=.5;const s=calcLength(t),c=calcLength(n);return c>s?o=progress(n.min,n.max-s,t.min):s>c&&(o=progress(t.min,t.max-c,n.min)),clamp(0,1,o)}function rebaseAxisConstraints(t,n){const o={};return n.min!==void 0&&(o.min=n.min-t.min),n.max!==void 0&&(o.max=n.max-t.min),o}const defaultElastic=.35;function resolveDragElastic(t=defaultElastic){return t===!1?t=0:t===!0&&(t=defaultElastic),{x:resolveAxisElastic(t,"left","right"),y:resolveAxisElastic(t,"top","bottom")}}function resolveAxisElastic(t,n,o){return{min:resolvePointElastic(t,n),max:resolvePointElastic(t,o)}}function resolvePointElastic(t,n){return typeof t=="number"?t:t[n]||0}const createAxisDelta=()=>({translate:0,scale:1,origin:0,originPoint:0}),createDelta=()=>({x:createAxisDelta(),y:createAxisDelta()}),createAxis=()=>({min:0,max:0}),createBox=()=>({x:createAxis(),y:createAxis()});function eachAxis(t){return[t("x"),t("y")]}function convertBoundingBoxToBox({top:t,left:n,right:o,bottom:s}){return{x:{min:n,max:o},y:{min:t,max:s}}}function convertBoxToBoundingBox({x:t,y:n}){return{top:n.min,right:t.max,bottom:n.max,left:t.min}}function transformBoxPoints(t,n){if(!n)return t;const o=n({x:t.left,y:t.top}),s=n({x:t.right,y:t.bottom});return{top:o.y,left:o.x,bottom:s.y,right:s.x}}function isIdentityScale(t){return t===void 0||t===1}function hasScale({scale:t,scaleX:n,scaleY:o}){return!isIdentityScale(t)||!isIdentityScale(n)||!isIdentityScale(o)}function hasTransform(t){return hasScale(t)||has2DTranslate(t)||t.z||t.rotate||t.rotateX||t.rotateY||t.skewX||t.skewY}function has2DTranslate(t){return is2DTranslate(t.x)||is2DTranslate(t.y)}function is2DTranslate(t){return t&&t!=="0%"}function scalePoint(t,n,o){const s=t-o,c=n*s;return o+c}function applyPointDelta(t,n,o,s,c){return c!==void 0&&(t=scalePoint(t,c,s)),scalePoint(t,o,s)+n}function applyAxisDelta(t,n=0,o=1,s,c){t.min=applyPointDelta(t.min,n,o,s,c),t.max=applyPointDelta(t.max,n,o,s,c)}function applyBoxDelta(t,{x:n,y:o}){applyAxisDelta(t.x,n.translate,n.scale,n.originPoint),applyAxisDelta(t.y,o.translate,o.scale,o.originPoint)}function applyTreeDeltas(t,n,o,s=!1){const c=o.length;if(!c)return;n.x=n.y=1;let d,h;for(let p=0;p<c;p++){d=o[p],h=d.projectionDelta;const y=d.instance;y&&y.style&&y.style.display==="contents"||(s&&d.options.layoutScroll&&d.scroll&&d!==d.root&&transformBox(t,{x:-d.scroll.offset.x,y:-d.scroll.offset.y}),h&&(n.x*=h.x.scale,n.y*=h.y.scale,applyBoxDelta(t,h)),s&&hasTransform(d.latestValues)&&transformBox(t,d.latestValues))}n.x=snapToDefault(n.x),n.y=snapToDefault(n.y)}function snapToDefault(t){return Number.isInteger(t)||t>1.0000000000001||t<.999999999999?t:1}function translateAxis(t,n){t.min=t.min+n,t.max=t.max+n}function transformAxis(t,n,[o,s,c]){const d=n[c]!==void 0?n[c]:.5,h=mixNumber$1(t.min,t.max,d);applyAxisDelta(t,n[o],n[s],h,n.scale)}const xKeys$1=["x","scaleX","originX"],yKeys$1=["y","scaleY","originY"];function transformBox(t,n){transformAxis(t.x,n,xKeys$1),transformAxis(t.y,n,yKeys$1)}function measureViewportBox(t,n){return convertBoundingBoxToBox(transformBoxPoints(t.getBoundingClientRect(),n))}function measurePageBox(t,n,o){const s=measureViewportBox(t,o),{scroll:c}=n;return c&&(translateAxis(s.x,c.offset.x),translateAxis(s.y,c.offset.y)),s}const getContextWindow=({current:t})=>t?t.ownerDocument.defaultView:null,elementDragControls=new WeakMap;class VisualElementDragControls{constructor(n){this.openGlobalLock=null,this.isDragging=!1,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=!1,this.hasMutatedConstraints=!1,this.elastic=createBox(),this.visualElement=n}start(n,{snapToCursor:o=!1}={}){const{presenceContext:s}=this.visualElement;if(s&&s.isPresent===!1)return;const c=L=>{const{dragSnapToOrigin:F}=this.getProps();F?this.pauseAnimation():this.stopAnimation(),o&&this.snapToCursor(extractEventInfo(L,"page").point)},d=(L,F)=>{const{drag:N,dragPropagation:z,onDragStart:oe}=this.getProps();if(N&&!z&&(this.openGlobalLock&&this.openGlobalLock(),this.openGlobalLock=getGlobalLock(N),!this.openGlobalLock))return;this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),eachAxis(nt=>{let lt=this.getAxisMotionValue(nt).get()||0;if(percent.test(lt)){const{projection:Ee}=this.visualElement;if(Ee&&Ee.layout){const yt=Ee.layout.layoutBox[nt];yt&&(lt=calcLength(yt)*(parseFloat(lt)/100))}}this.originPoint[nt]=lt}),oe&&oe(L,F);const{animationState:W}=this.visualElement;W&&W.setActive("whileDrag",!0)},h=(L,F)=>{const{dragPropagation:N,dragDirectionLock:z,onDirectionLock:oe,onDrag:W}=this.getProps();if(!N&&!this.openGlobalLock)return;const{offset:nt}=F;if(z&&this.currentDirection===null){this.currentDirection=getCurrentDirection(nt),this.currentDirection!==null&&oe&&oe(this.currentDirection);return}this.updateAxis("x",F.point,nt),this.updateAxis("y",F.point,nt),this.visualElement.render(),W&&W(L,F)},p=(L,F)=>this.stop(L,F),y=()=>eachAxis(L=>{var F;return this.getAnimationState(L)==="paused"&&((F=this.getAxisMotionValue(L).animation)===null||F===void 0?void 0:F.play())}),{dragSnapToOrigin:E}=this.getProps();this.panSession=new PanSession(n,{onSessionStart:c,onStart:d,onMove:h,onSessionEnd:p,resumeAnimation:y},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:E,contextWindow:getContextWindow(this.visualElement)})}stop(n,o){const s=this.isDragging;if(this.cancel(),!s)return;const{velocity:c}=o;this.startAnimation(c);const{onDragEnd:d}=this.getProps();d&&d(n,o)}cancel(){this.isDragging=!1;const{projection:n,animationState:o}=this.visualElement;n&&(n.isAnimationBlocked=!1),this.panSession&&this.panSession.end(),this.panSession=void 0;const{dragPropagation:s}=this.getProps();!s&&this.openGlobalLock&&(this.openGlobalLock(),this.openGlobalLock=null),o&&o.setActive("whileDrag",!1)}updateAxis(n,o,s){const{drag:c}=this.getProps();if(!s||!shouldDrag(n,c,this.currentDirection))return;const d=this.getAxisMotionValue(n);let h=this.originPoint[n]+s[n];this.constraints&&this.constraints[n]&&(h=applyConstraints(h,this.constraints[n],this.elastic[n])),d.set(h)}resolveConstraints(){var n;const{dragConstraints:o,dragElastic:s}=this.getProps(),c=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):(n=this.visualElement.projection)===null||n===void 0?void 0:n.layout,d=this.constraints;o&&isRefObject(o)?this.constraints||(this.constraints=this.resolveRefConstraints()):o&&c?this.constraints=calcRelativeConstraints(c.layoutBox,o):this.constraints=!1,this.elastic=resolveDragElastic(s),d!==this.constraints&&c&&this.constraints&&!this.hasMutatedConstraints&&eachAxis(h=>{this.getAxisMotionValue(h)&&(this.constraints[h]=rebaseAxisConstraints(c.layoutBox[h],this.constraints[h]))})}resolveRefConstraints(){const{dragConstraints:n,onMeasureDragConstraints:o}=this.getProps();if(!n||!isRefObject(n))return!1;const s=n.current;invariant(s!==null,"If `dragConstraints` is set as a React ref, that ref must be passed to another component's `ref` prop.");const{projection:c}=this.visualElement;if(!c||!c.layout)return!1;const d=measurePageBox(s,c.root,this.visualElement.getTransformPagePoint());let h=calcViewportConstraints(c.layout.layoutBox,d);if(o){const p=o(convertBoxToBoundingBox(h));this.hasMutatedConstraints=!!p,p&&(h=convertBoundingBoxToBox(p))}return h}startAnimation(n){const{drag:o,dragMomentum:s,dragElastic:c,dragTransition:d,dragSnapToOrigin:h,onDragTransitionEnd:p}=this.getProps(),y=this.constraints||{},E=eachAxis(L=>{if(!shouldDrag(L,o,this.currentDirection))return;let F=y&&y[L]||{};h&&(F={min:0,max:0});const N=c?200:1e6,z=c?40:1e7,oe={type:"inertia",velocity:s?n[L]:0,bounceStiffness:N,bounceDamping:z,timeConstant:750,restDelta:1,restSpeed:10,...d,...F};return this.startAxisValueAnimation(L,oe)});return Promise.all(E).then(p)}startAxisValueAnimation(n,o){const s=this.getAxisMotionValue(n);return s.start(animateMotionValue(n,s,0,o,this.visualElement))}stopAnimation(){eachAxis(n=>this.getAxisMotionValue(n).stop())}pauseAnimation(){eachAxis(n=>{var o;return(o=this.getAxisMotionValue(n).animation)===null||o===void 0?void 0:o.pause()})}getAnimationState(n){var o;return(o=this.getAxisMotionValue(n).animation)===null||o===void 0?void 0:o.state}getAxisMotionValue(n){const o="_drag"+n.toUpperCase(),s=this.visualElement.getProps(),c=s[o];return c||this.visualElement.getValue(n,(s.initial?s.initial[n]:void 0)||0)}snapToCursor(n){eachAxis(o=>{const{drag:s}=this.getProps();if(!shouldDrag(o,s,this.currentDirection))return;const{projection:c}=this.visualElement,d=this.getAxisMotionValue(o);if(c&&c.layout){const{min:h,max:p}=c.layout.layoutBox[o];d.set(n[o]-mixNumber$1(h,p,.5))}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:n,dragConstraints:o}=this.getProps(),{projection:s}=this.visualElement;if(!isRefObject(o)||!s||!this.constraints)return;this.stopAnimation();const c={x:0,y:0};eachAxis(h=>{const p=this.getAxisMotionValue(h);if(p){const y=p.get();c[h]=calcOrigin({min:y,max:y},this.constraints[h])}});const{transformTemplate:d}=this.visualElement.getProps();this.visualElement.current.style.transform=d?d({},""):"none",s.root&&s.root.updateScroll(),s.updateLayout(),this.resolveConstraints(),eachAxis(h=>{if(!shouldDrag(h,n,null))return;const p=this.getAxisMotionValue(h),{min:y,max:E}=this.constraints[h];p.set(mixNumber$1(y,E,c[h]))})}addListeners(){if(!this.visualElement.current)return;elementDragControls.set(this.visualElement,this);const n=this.visualElement.current,o=addPointerEvent(n,"pointerdown",y=>{const{drag:E,dragListener:L=!0}=this.getProps();E&&L&&this.start(y)}),s=()=>{const{dragConstraints:y}=this.getProps();isRefObject(y)&&(this.constraints=this.resolveRefConstraints())},{projection:c}=this.visualElement,d=c.addEventListener("measure",s);c&&!c.layout&&(c.root&&c.root.updateScroll(),c.updateLayout()),s();const h=addDomEvent(window,"resize",()=>this.scalePositionWithinConstraints()),p=c.addEventListener("didUpdate",({delta:y,hasLayoutChanged:E})=>{this.isDragging&&E&&(eachAxis(L=>{const F=this.getAxisMotionValue(L);F&&(this.originPoint[L]+=y[L].translate,F.set(F.get()+y[L].translate))}),this.visualElement.render())});return()=>{h(),o(),d(),p&&p()}}getProps(){const n=this.visualElement.getProps(),{drag:o=!1,dragDirectionLock:s=!1,dragPropagation:c=!1,dragConstraints:d=!1,dragElastic:h=defaultElastic,dragMomentum:p=!0}=n;return{...n,drag:o,dragDirectionLock:s,dragPropagation:c,dragConstraints:d,dragElastic:h,dragMomentum:p}}}function shouldDrag(t,n,o){return(n===!0||n===t)&&(o===null||o===t)}function getCurrentDirection(t,n=10){let o=null;return Math.abs(t.y)>n?o="y":Math.abs(t.x)>n&&(o="x"),o}class DragGesture extends Feature{constructor(n){super(n),this.removeGroupControls=noop$1,this.removeListeners=noop$1,this.controls=new VisualElementDragControls(n)}mount(){const{dragControls:n}=this.node.getProps();n&&(this.removeGroupControls=n.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||noop$1}unmount(){this.removeGroupControls(),this.removeListeners()}}const asyncHandler=t=>(n,o)=>{t&&t(n,o)};class PanGesture extends Feature{constructor(){super(...arguments),this.removePointerDownListener=noop$1}onPointerDown(n){this.session=new PanSession(n,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:getContextWindow(this.node)})}createPanHandlers(){const{onPanSessionStart:n,onPanStart:o,onPan:s,onPanEnd:c}=this.node.getProps();return{onSessionStart:asyncHandler(n),onStart:asyncHandler(o),onMove:s,onEnd:(d,h)=>{delete this.session,c&&c(d,h)}}}mount(){this.removePointerDownListener=addPointerEvent(this.node.current,"pointerdown",n=>this.onPointerDown(n))}update(){this.session&&this.session.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}}function usePresence(){const t=React.useContext(PresenceContext);if(t===null)return[!0,null];const{isPresent:n,onExitComplete:o,register:s}=t,c=React.useId();return React.useEffect(()=>s(c),[]),!n&&o?[!1,()=>o&&o(c)]:[!0]}const globalProjectionState={hasAnimatedSinceResize:!0,hasEverUpdated:!1};function pixelsToPercent(t,n){return n.max===n.min?0:t/(n.max-n.min)*100}const correctBorderRadius={correct:(t,n)=>{if(!n.target)return t;if(typeof t=="string")if(px.test(t))t=parseFloat(t);else return t;const o=pixelsToPercent(t,n.target.x),s=pixelsToPercent(t,n.target.y);return`${o}% ${s}%`}},correctBoxShadow={correct:(t,{treeScale:n,projectionDelta:o})=>{const s=t,c=complex.parse(t);if(c.length>5)return s;const d=complex.createTransformer(t),h=typeof c[0]!="number"?1:0,p=o.x.scale*n.x,y=o.y.scale*n.y;c[0+h]/=p,c[1+h]/=y;const E=mixNumber$1(p,y,.5);return typeof c[2+h]=="number"&&(c[2+h]/=E),typeof c[3+h]=="number"&&(c[3+h]/=E),d(c)}};class MeasureLayoutWithContext extends React.Component{componentDidMount(){const{visualElement:n,layoutGroup:o,switchLayoutGroup:s,layoutId:c}=this.props,{projection:d}=n;addScaleCorrector(defaultScaleCorrectors),d&&(o.group&&o.group.add(d),s&&s.register&&c&&s.register(d),d.root.didUpdate(),d.addEventListener("animationComplete",()=>{this.safeToRemove()}),d.setOptions({...d.options,onExitComplete:()=>this.safeToRemove()})),globalProjectionState.hasEverUpdated=!0}getSnapshotBeforeUpdate(n){const{layoutDependency:o,visualElement:s,drag:c,isPresent:d}=this.props,h=s.projection;return h&&(h.isPresent=d,c||n.layoutDependency!==o||o===void 0?h.willUpdate():this.safeToRemove(),n.isPresent!==d&&(d?h.promote():h.relegate()||frame.postRender(()=>{const p=h.getStack();(!p||!p.members.length)&&this.safeToRemove()}))),null}componentDidUpdate(){const{projection:n}=this.props.visualElement;n&&(n.root.didUpdate(),microtask.postRender(()=>{!n.currentAnimation&&n.isLead()&&this.safeToRemove()}))}componentWillUnmount(){const{visualElement:n,layoutGroup:o,switchLayoutGroup:s}=this.props,{projection:c}=n;c&&(c.scheduleCheckAfterUnmount(),o&&o.group&&o.group.remove(c),s&&s.deregister&&s.deregister(c))}safeToRemove(){const{safeToRemove:n}=this.props;n&&n()}render(){return null}}function MeasureLayout(t){const[n,o]=usePresence(),s=React.useContext(LayoutGroupContext);return React.createElement(MeasureLayoutWithContext,{...t,layoutGroup:s,switchLayoutGroup:React.useContext(SwitchLayoutGroupContext),isPresent:n,safeToRemove:o})}const defaultScaleCorrectors={borderRadius:{...correctBorderRadius,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:correctBorderRadius,borderTopRightRadius:correctBorderRadius,borderBottomLeftRadius:correctBorderRadius,borderBottomRightRadius:correctBorderRadius,boxShadow:correctBoxShadow},borders=["TopLeft","TopRight","BottomLeft","BottomRight"],numBorders=borders.length,asNumber=t=>typeof t=="string"?parseFloat(t):t,isPx=t=>typeof t=="number"||px.test(t);function mixValues(t,n,o,s,c,d){c?(t.opacity=mixNumber$1(0,o.opacity!==void 0?o.opacity:1,easeCrossfadeIn(s)),t.opacityExit=mixNumber$1(n.opacity!==void 0?n.opacity:1,0,easeCrossfadeOut(s))):d&&(t.opacity=mixNumber$1(n.opacity!==void 0?n.opacity:1,o.opacity!==void 0?o.opacity:1,s));for(let h=0;h<numBorders;h++){const p=`border${borders[h]}Radius`;let y=getRadius(n,p),E=getRadius(o,p);if(y===void 0&&E===void 0)continue;y||(y=0),E||(E=0),y===0||E===0||isPx(y)===isPx(E)?(t[p]=Math.max(mixNumber$1(asNumber(y),asNumber(E),s),0),(percent.test(E)||percent.test(y))&&(t[p]+="%")):t[p]=E}(n.rotate||o.rotate)&&(t.rotate=mixNumber$1(n.rotate||0,o.rotate||0,s))}function getRadius(t,n){return t[n]!==void 0?t[n]:t.borderRadius}const easeCrossfadeIn=compress(0,.5,circOut),easeCrossfadeOut=compress(.5,.95,noop$1);function compress(t,n,o){return s=>s<t?0:s>n?1:o(progress(t,n,s))}function copyAxisInto(t,n){t.min=n.min,t.max=n.max}function copyBoxInto(t,n){copyAxisInto(t.x,n.x),copyAxisInto(t.y,n.y)}function removePointDelta(t,n,o,s,c){return t-=n,t=scalePoint(t,1/o,s),c!==void 0&&(t=scalePoint(t,1/c,s)),t}function removeAxisDelta(t,n=0,o=1,s=.5,c,d=t,h=t){if(percent.test(n)&&(n=parseFloat(n),n=mixNumber$1(h.min,h.max,n/100)-h.min),typeof n!="number")return;let p=mixNumber$1(d.min,d.max,s);t===d&&(p-=n),t.min=removePointDelta(t.min,n,o,p,c),t.max=removePointDelta(t.max,n,o,p,c)}function removeAxisTransforms(t,n,[o,s,c],d,h){removeAxisDelta(t,n[o],n[s],n[c],n.scale,d,h)}const xKeys=["x","scaleX","originX"],yKeys=["y","scaleY","originY"];function removeBoxTransforms(t,n,o,s){removeAxisTransforms(t.x,n,xKeys,o?o.x:void 0,s?s.x:void 0),removeAxisTransforms(t.y,n,yKeys,o?o.y:void 0,s?s.y:void 0)}function isAxisDeltaZero(t){return t.translate===0&&t.scale===1}function isDeltaZero(t){return isAxisDeltaZero(t.x)&&isAxisDeltaZero(t.y)}function boxEquals(t,n){return t.x.min===n.x.min&&t.x.max===n.x.max&&t.y.min===n.y.min&&t.y.max===n.y.max}function boxEqualsRounded(t,n){return Math.round(t.x.min)===Math.round(n.x.min)&&Math.round(t.x.max)===Math.round(n.x.max)&&Math.round(t.y.min)===Math.round(n.y.min)&&Math.round(t.y.max)===Math.round(n.y.max)}function aspectRatio(t){return calcLength(t.x)/calcLength(t.y)}class NodeStack{constructor(){this.members=[]}add(n){addUniqueItem(this.members,n),n.scheduleRender()}remove(n){if(removeItem(this.members,n),n===this.prevLead&&(this.prevLead=void 0),n===this.lead){const o=this.members[this.members.length-1];o&&this.promote(o)}}relegate(n){const o=this.members.findIndex(c=>n===c);if(o===0)return!1;let s;for(let c=o;c>=0;c--){const d=this.members[c];if(d.isPresent!==!1){s=d;break}}return s?(this.promote(s),!0):!1}promote(n,o){const s=this.lead;if(n!==s&&(this.prevLead=s,this.lead=n,n.show(),s)){s.instance&&s.scheduleRender(),n.scheduleRender(),n.resumeFrom=s,o&&(n.resumeFrom.preserveOpacity=!0),s.snapshot&&(n.snapshot=s.snapshot,n.snapshot.latestValues=s.animationValues||s.latestValues),n.root&&n.root.isUpdating&&(n.isLayoutDirty=!0);const{crossfade:c}=n.options;c===!1&&s.hide()}}exitAnimationComplete(){this.members.forEach(n=>{const{options:o,resumingFrom:s}=n;o.onExitComplete&&o.onExitComplete(),s&&s.options.onExitComplete&&s.options.onExitComplete()})}scheduleRender(){this.members.forEach(n=>{n.instance&&n.scheduleRender(!1)})}removeLeadSnapshot(){this.lead&&this.lead.snapshot&&(this.lead.snapshot=void 0)}}function buildProjectionTransform(t,n,o){let s="";const c=t.x.translate/n.x,d=t.y.translate/n.y,h=(o==null?void 0:o.z)||0;if((c||d||h)&&(s=`translate3d(${c}px, ${d}px, ${h}px) `),(n.x!==1||n.y!==1)&&(s+=`scale(${1/n.x}, ${1/n.y}) `),o){const{transformPerspective:E,rotate:L,rotateX:F,rotateY:N,skewX:z,skewY:oe}=o;E&&(s=`perspective(${E}px) ${s}`),L&&(s+=`rotate(${L}deg) `),F&&(s+=`rotateX(${F}deg) `),N&&(s+=`rotateY(${N}deg) `),z&&(s+=`skewX(${z}deg) `),oe&&(s+=`skewY(${oe}deg) `)}const p=t.x.scale*n.x,y=t.y.scale*n.y;return(p!==1||y!==1)&&(s+=`scale(${p}, ${y})`),s||"none"}const compareByDepth=(t,n)=>t.depth-n.depth;class FlatTree{constructor(){this.children=[],this.isDirty=!1}add(n){addUniqueItem(this.children,n),this.isDirty=!0}remove(n){removeItem(this.children,n),this.isDirty=!0}forEach(n){this.isDirty&&this.children.sort(compareByDepth),this.isDirty=!1,this.children.forEach(n)}}function delay(t,n){const o=time.now(),s=({timestamp:c})=>{const d=c-o;d>=n&&(cancelFrame(s),t(d-n))};return frame.read(s,!0),()=>cancelFrame(s)}function record(t){window.MotionDebug&&window.MotionDebug.record(t)}function isSVGElement(t){return t instanceof SVGElement&&t.tagName!=="svg"}function animateSingleValue(t,n,o){const s=isMotionValue(t)?t:motionValue(t);return s.start(animateMotionValue("",s,n,o)),s.animation}const transformAxes=["","X","Y","Z"],hiddenVisibility={visibility:"hidden"},animationTarget=1e3;let id=0;const projectionFrameData={type:"projectionFrame",totalNodes:0,resolvedTargetDeltas:0,recalculatedProjection:0};function resetDistortingTransform(t,n,o,s){const{latestValues:c}=n;c[t]&&(o[t]=c[t],n.setStaticValue(t,0),s&&(s[t]=0))}function createProjectionNode({attachResizeListener:t,defaultParent:n,measureScroll:o,checkIsScrollRoot:s,resetTransform:c}){return class{constructor(h={},p=n==null?void 0:n()){this.id=id++,this.animationId=0,this.children=new Set,this.options={},this.isTreeAnimating=!1,this.isAnimationBlocked=!1,this.isLayoutDirty=!1,this.isProjectionDirty=!1,this.isSharedProjectionDirty=!1,this.isTransformDirty=!1,this.updateManuallyBlocked=!1,this.updateBlockedByResize=!1,this.isUpdating=!1,this.isSVG=!1,this.needsReset=!1,this.shouldResetTransform=!1,this.treeScale={x:1,y:1},this.eventHandlers=new Map,this.hasTreeAnimated=!1,this.updateScheduled=!1,this.projectionUpdateScheduled=!1,this.checkUpdateFailed=()=>{this.isUpdating&&(this.isUpdating=!1,this.clearAllSnapshots())},this.updateProjection=()=>{this.projectionUpdateScheduled=!1,projectionFrameData.totalNodes=projectionFrameData.resolvedTargetDeltas=projectionFrameData.recalculatedProjection=0,this.nodes.forEach(propagateDirtyNodes),this.nodes.forEach(resolveTargetDelta),this.nodes.forEach(calcProjection),this.nodes.forEach(cleanDirtyNodes),record(projectionFrameData)},this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=h,this.root=p?p.root||p:this,this.path=p?[...p.path,p]:[],this.parent=p,this.depth=p?p.depth+1:0;for(let y=0;y<this.path.length;y++)this.path[y].shouldResetTransform=!0;this.root===this&&(this.nodes=new FlatTree)}addEventListener(h,p){return this.eventHandlers.has(h)||this.eventHandlers.set(h,new SubscriptionManager),this.eventHandlers.get(h).add(p)}notifyListeners(h,...p){const y=this.eventHandlers.get(h);y&&y.notify(...p)}hasListeners(h){return this.eventHandlers.has(h)}mount(h,p=this.root.hasTreeAnimated){if(this.instance)return;this.isSVG=isSVGElement(h),this.instance=h;const{layoutId:y,layout:E,visualElement:L}=this.options;if(L&&!L.current&&L.mount(h),this.root.nodes.add(this),this.parent&&this.parent.children.add(this),p&&(E||y)&&(this.isLayoutDirty=!0),t){let F;const N=()=>this.root.updateBlockedByResize=!1;t(h,()=>{this.root.updateBlockedByResize=!0,F&&F(),F=delay(N,250),globalProjectionState.hasAnimatedSinceResize&&(globalProjectionState.hasAnimatedSinceResize=!1,this.nodes.forEach(finishAnimation))})}y&&this.root.registerSharedNode(y,this),this.options.animate!==!1&&L&&(y||E)&&this.addEventListener("didUpdate",({delta:F,hasLayoutChanged:N,hasRelativeTargetChanged:z,layout:oe})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}const W=this.options.transition||L.getDefaultTransition()||defaultLayoutTransition,{onLayoutAnimationStart:nt,onLayoutAnimationComplete:lt}=L.getProps(),Ee=!this.targetLayout||!boxEqualsRounded(this.targetLayout,oe)||z,yt=!N&&z;if(this.options.layoutRoot||this.resumeFrom&&this.resumeFrom.instance||yt||N&&(Ee||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0),this.setAnimationOrigin(F,yt);const Ai={...getValueTransition(W,"layout"),onPlay:nt,onComplete:lt};(L.shouldReduceMotion||this.options.layoutRoot)&&(Ai.delay=0,Ai.type=!1),this.startAnimation(Ai)}else N||finishAnimation(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=oe})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);const h=this.getStack();h&&h.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,cancelFrame(this.updateProjection)}blockUpdate(){this.updateManuallyBlocked=!0}unblockUpdate(){this.updateManuallyBlocked=!1}isUpdateBlocked(){return this.updateManuallyBlocked||this.updateBlockedByResize}isTreeAnimationBlocked(){return this.isAnimationBlocked||this.parent&&this.parent.isTreeAnimationBlocked()||!1}startUpdate(){this.isUpdateBlocked()||(this.isUpdating=!0,this.nodes&&this.nodes.forEach(resetSkewAndRotation),this.animationId++)}getTransformTemplate(){const{visualElement:h}=this.options;return h&&h.getProps().transformTemplate}willUpdate(h=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked()){this.options.onExitComplete&&this.options.onExitComplete();return}if(!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let L=0;L<this.path.length;L++){const F=this.path[L];F.shouldResetTransform=!0,F.updateScroll("snapshot"),F.options.layoutRoot&&F.willUpdate(!1)}const{layoutId:p,layout:y}=this.options;if(p===void 0&&!y)return;const E=this.getTransformTemplate();this.prevTransformTemplateValue=E?E(this.latestValues,""):void 0,this.updateSnapshot(),h&&this.notifyListeners("willUpdate")}update(){if(this.updateScheduled=!1,this.isUpdateBlocked()){this.unblockUpdate(),this.clearAllSnapshots(),this.nodes.forEach(clearMeasurements);return}this.isUpdating||this.nodes.forEach(clearIsLayoutDirty),this.isUpdating=!1,window.HandoffCancelAllAnimations&&window.HandoffCancelAllAnimations(),this.nodes.forEach(resetTransformStyle),this.nodes.forEach(updateLayout),this.nodes.forEach(notifyLayoutUpdate),this.clearAllSnapshots();const p=time.now();frameData.delta=clamp(0,1e3/60,p-frameData.timestamp),frameData.timestamp=p,frameData.isProcessing=!0,steps.update.process(frameData),steps.preRender.process(frameData),steps.render.process(frameData),frameData.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,microtask.read(()=>this.update()))}clearAllSnapshots(){this.nodes.forEach(clearSnapshot),this.sharedNodes.forEach(removeLeadSnapshots)}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,frame.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){frame.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){this.snapshot||!this.instance||(this.snapshot=this.measure())}updateLayout(){if(!this.instance||(this.updateScroll(),!(this.options.alwaysMeasureLayout&&this.isLead())&&!this.isLayoutDirty))return;if(this.resumeFrom&&!this.resumeFrom.instance)for(let y=0;y<this.path.length;y++)this.path[y].updateScroll();const h=this.layout;this.layout=this.measure(!1),this.layoutCorrected=createBox(),this.isLayoutDirty=!1,this.projectionDelta=void 0,this.notifyListeners("measure",this.layout.layoutBox);const{visualElement:p}=this.options;p&&p.notify("LayoutMeasure",this.layout.layoutBox,h?h.layoutBox:void 0)}updateScroll(h="measure"){let p=!!(this.options.layoutScroll&&this.instance);this.scroll&&this.scroll.animationId===this.root.animationId&&this.scroll.phase===h&&(p=!1),p&&(this.scroll={animationId:this.root.animationId,phase:h,isRoot:s(this.instance),offset:o(this.instance)})}resetTransform(){if(!c)return;const h=this.isLayoutDirty||this.shouldResetTransform,p=this.projectionDelta&&!isDeltaZero(this.projectionDelta),y=this.getTransformTemplate(),E=y?y(this.latestValues,""):void 0,L=E!==this.prevTransformTemplateValue;h&&(p||hasTransform(this.latestValues)||L)&&(c(this.instance,E),this.shouldResetTransform=!1,this.scheduleRender())}measure(h=!0){const p=this.measurePageBox();let y=this.removeElementScroll(p);return h&&(y=this.removeTransform(y)),roundBox(y),{animationId:this.root.animationId,measuredBox:p,layoutBox:y,latestValues:{},source:this.id}}measurePageBox(){const{visualElement:h}=this.options;if(!h)return createBox();const p=h.measureViewportBox(),{scroll:y}=this.root;return y&&(translateAxis(p.x,y.offset.x),translateAxis(p.y,y.offset.y)),p}removeElementScroll(h){const p=createBox();copyBoxInto(p,h);for(let y=0;y<this.path.length;y++){const E=this.path[y],{scroll:L,options:F}=E;if(E!==this.root&&L&&F.layoutScroll){if(L.isRoot){copyBoxInto(p,h);const{scroll:N}=this.root;N&&(translateAxis(p.x,-N.offset.x),translateAxis(p.y,-N.offset.y))}translateAxis(p.x,L.offset.x),translateAxis(p.y,L.offset.y)}}return p}applyTransform(h,p=!1){const y=createBox();copyBoxInto(y,h);for(let E=0;E<this.path.length;E++){const L=this.path[E];!p&&L.options.layoutScroll&&L.scroll&&L!==L.root&&transformBox(y,{x:-L.scroll.offset.x,y:-L.scroll.offset.y}),hasTransform(L.latestValues)&&transformBox(y,L.latestValues)}return hasTransform(this.latestValues)&&transformBox(y,this.latestValues),y}removeTransform(h){const p=createBox();copyBoxInto(p,h);for(let y=0;y<this.path.length;y++){const E=this.path[y];if(!E.instance||!hasTransform(E.latestValues))continue;hasScale(E.latestValues)&&E.updateSnapshot();const L=createBox(),F=E.measurePageBox();copyBoxInto(L,F),removeBoxTransforms(p,E.latestValues,E.snapshot?E.snapshot.layoutBox:void 0,L)}return hasTransform(this.latestValues)&&removeBoxTransforms(p,this.latestValues),p}setTargetDelta(h){this.targetDelta=h,this.root.scheduleUpdateProjection(),this.isProjectionDirty=!0}setOptions(h){this.options={...this.options,...h,crossfade:h.crossfade!==void 0?h.crossfade:!0}}clearMeasurements(){this.scroll=void 0,this.layout=void 0,this.snapshot=void 0,this.prevTransformTemplateValue=void 0,this.targetDelta=void 0,this.target=void 0,this.isLayoutDirty=!1}forceRelativeParentToResolveTarget(){this.relativeParent&&this.relativeParent.resolvedRelativeTargetAt!==frameData.timestamp&&this.relativeParent.resolveTargetDelta(!0)}resolveTargetDelta(h=!1){var p;const y=this.getLead();this.isProjectionDirty||(this.isProjectionDirty=y.isProjectionDirty),this.isTransformDirty||(this.isTransformDirty=y.isTransformDirty),this.isSharedProjectionDirty||(this.isSharedProjectionDirty=y.isSharedProjectionDirty);const E=!!this.resumingFrom||this!==y;if(!(h||E&&this.isSharedProjectionDirty||this.isProjectionDirty||!((p=this.parent)===null||p===void 0)&&p.isProjectionDirty||this.attemptToResolveRelativeTarget))return;const{layout:F,layoutId:N}=this.options;if(!(!this.layout||!(F||N))){if(this.resolvedRelativeTargetAt=frameData.timestamp,!this.targetDelta&&!this.relativeTarget){const z=this.getClosestProjectingParent();z&&z.layout&&this.animationProgress!==1?(this.relativeParent=z,this.forceRelativeParentToResolveTarget(),this.relativeTarget=createBox(),this.relativeTargetOrigin=createBox(),calcRelativePosition(this.relativeTargetOrigin,this.layout.layoutBox,z.layout.layoutBox),copyBoxInto(this.relativeTarget,this.relativeTargetOrigin)):this.relativeParent=this.relativeTarget=void 0}if(!(!this.relativeTarget&&!this.targetDelta)){if(this.target||(this.target=createBox(),this.targetWithTransforms=createBox()),this.relativeTarget&&this.relativeTargetOrigin&&this.relativeParent&&this.relativeParent.target?(this.forceRelativeParentToResolveTarget(),calcRelativeBox(this.target,this.relativeTarget,this.relativeParent.target)):this.targetDelta?(this.resumingFrom?this.target=this.applyTransform(this.layout.layoutBox):copyBoxInto(this.target,this.layout.layoutBox),applyBoxDelta(this.target,this.targetDelta)):copyBoxInto(this.target,this.layout.layoutBox),this.attemptToResolveRelativeTarget){this.attemptToResolveRelativeTarget=!1;const z=this.getClosestProjectingParent();z&&!!z.resumingFrom==!!this.resumingFrom&&!z.options.layoutScroll&&z.target&&this.animationProgress!==1?(this.relativeParent=z,this.forceRelativeParentToResolveTarget(),this.relativeTarget=createBox(),this.relativeTargetOrigin=createBox(),calcRelativePosition(this.relativeTargetOrigin,this.target,z.target),copyBoxInto(this.relativeTarget,this.relativeTargetOrigin)):this.relativeParent=this.relativeTarget=void 0}projectionFrameData.resolvedTargetDeltas++}}}getClosestProjectingParent(){if(!(!this.parent||hasScale(this.parent.latestValues)||has2DTranslate(this.parent.latestValues)))return this.parent.isProjecting()?this.parent:this.parent.getClosestProjectingParent()}isProjecting(){return!!((this.relativeTarget||this.targetDelta||this.options.layoutRoot)&&this.layout)}calcProjection(){var h;const p=this.getLead(),y=!!this.resumingFrom||this!==p;let E=!0;if((this.isProjectionDirty||!((h=this.parent)===null||h===void 0)&&h.isProjectionDirty)&&(E=!1),y&&(this.isSharedProjectionDirty||this.isTransformDirty)&&(E=!1),this.resolvedRelativeTargetAt===frameData.timestamp&&(E=!1),E)return;const{layout:L,layoutId:F}=this.options;if(this.isTreeAnimating=!!(this.parent&&this.parent.isTreeAnimating||this.currentAnimation||this.pendingAnimation),this.isTreeAnimating||(this.targetDelta=this.relativeTarget=void 0),!this.layout||!(L||F))return;copyBoxInto(this.layoutCorrected,this.layout.layoutBox);const N=this.treeScale.x,z=this.treeScale.y;applyTreeDeltas(this.layoutCorrected,this.treeScale,this.path,y),p.layout&&!p.target&&(this.treeScale.x!==1||this.treeScale.y!==1)&&(p.target=p.layout.layoutBox,p.targetWithTransforms=createBox());const{target:oe}=p;if(!oe){this.projectionTransform&&(this.projectionDelta=createDelta(),this.projectionTransform="none",this.scheduleRender());return}this.projectionDelta||(this.projectionDelta=createDelta(),this.projectionDeltaWithTransform=createDelta());const W=this.projectionTransform;calcBoxDelta(this.projectionDelta,this.layoutCorrected,oe,this.latestValues),this.projectionTransform=buildProjectionTransform(this.projectionDelta,this.treeScale),(this.projectionTransform!==W||this.treeScale.x!==N||this.treeScale.y!==z)&&(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners("projectionUpdate",oe)),projectionFrameData.recalculatedProjection++}hide(){this.isVisible=!1}show(){this.isVisible=!0}scheduleRender(h=!0){if(this.options.scheduleRender&&this.options.scheduleRender(),h){const p=this.getStack();p&&p.scheduleRender()}this.resumingFrom&&!this.resumingFrom.instance&&(this.resumingFrom=void 0)}setAnimationOrigin(h,p=!1){const y=this.snapshot,E=y?y.latestValues:{},L={...this.latestValues},F=createDelta();(!this.relativeParent||!this.relativeParent.options.layoutRoot)&&(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!p;const N=createBox(),z=y?y.source:void 0,oe=this.layout?this.layout.source:void 0,W=z!==oe,nt=this.getStack(),lt=!nt||nt.members.length<=1,Ee=!!(W&&!lt&&this.options.crossfade===!0&&!this.path.some(hasOpacityCrossfade));this.animationProgress=0;let yt;this.mixTargetDelta=Ai=>{const zi=Ai/1e3;mixAxisDelta(F.x,h.x,zi),mixAxisDelta(F.y,h.y,zi),this.setTargetDelta(F),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(calcRelativePosition(N,this.layout.layoutBox,this.relativeParent.layout.layoutBox),mixBox(this.relativeTarget,this.relativeTargetOrigin,N,zi),yt&&boxEquals(this.relativeTarget,yt)&&(this.isProjectionDirty=!1),yt||(yt=createBox()),copyBoxInto(yt,this.relativeTarget)),W&&(this.animationValues=L,mixValues(L,E,this.latestValues,zi,Ee,lt)),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=zi},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(h){this.notifyListeners("animationStart"),this.currentAnimation&&this.currentAnimation.stop(),this.resumingFrom&&this.resumingFrom.currentAnimation&&this.resumingFrom.currentAnimation.stop(),this.pendingAnimation&&(cancelFrame(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=frame.update(()=>{globalProjectionState.hasAnimatedSinceResize=!0,this.currentAnimation=animateSingleValue(0,animationTarget,{...h,onUpdate:p=>{this.mixTargetDelta(p),h.onUpdate&&h.onUpdate(p)},onComplete:()=>{h.onComplete&&h.onComplete(),this.completeAnimation()}}),this.resumingFrom&&(this.resumingFrom.currentAnimation=this.currentAnimation),this.pendingAnimation=void 0})}completeAnimation(){this.resumingFrom&&(this.resumingFrom.currentAnimation=void 0,this.resumingFrom.preserveOpacity=void 0);const h=this.getStack();h&&h.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(animationTarget),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const h=this.getLead();let{targetWithTransforms:p,target:y,layout:E,latestValues:L}=h;if(!(!p||!y||!E)){if(this!==h&&this.layout&&E&&shouldAnimatePositionOnly(this.options.animationType,this.layout.layoutBox,E.layoutBox)){y=this.target||createBox();const F=calcLength(this.layout.layoutBox.x);y.x.min=h.target.x.min,y.x.max=y.x.min+F;const N=calcLength(this.layout.layoutBox.y);y.y.min=h.target.y.min,y.y.max=y.y.min+N}copyBoxInto(p,y),transformBox(p,L),calcBoxDelta(this.projectionDeltaWithTransform,this.layoutCorrected,p,L)}}registerSharedNode(h,p){this.sharedNodes.has(h)||this.sharedNodes.set(h,new NodeStack),this.sharedNodes.get(h).add(p);const E=p.options.initialPromotionConfig;p.promote({transition:E?E.transition:void 0,preserveFollowOpacity:E&&E.shouldPreserveFollowOpacity?E.shouldPreserveFollowOpacity(p):void 0})}isLead(){const h=this.getStack();return h?h.lead===this:!0}getLead(){var h;const{layoutId:p}=this.options;return p?((h=this.getStack())===null||h===void 0?void 0:h.lead)||this:this}getPrevLead(){var h;const{layoutId:p}=this.options;return p?(h=this.getStack())===null||h===void 0?void 0:h.prevLead:void 0}getStack(){const{layoutId:h}=this.options;if(h)return this.root.sharedNodes.get(h)}promote({needsReset:h,transition:p,preserveFollowOpacity:y}={}){const E=this.getStack();E&&E.promote(this,y),h&&(this.projectionDelta=void 0,this.needsReset=!0),p&&this.setOptions({transition:p})}relegate(){const h=this.getStack();return h?h.relegate(this):!1}resetSkewAndRotation(){const{visualElement:h}=this.options;if(!h)return;let p=!1;const{latestValues:y}=h;if((y.z||y.rotate||y.rotateX||y.rotateY||y.rotateZ||y.skewX||y.skewY)&&(p=!0),!p)return;const E={};y.z&&resetDistortingTransform("z",h,E,this.animationValues);for(let L=0;L<transformAxes.length;L++)resetDistortingTransform(`rotate${transformAxes[L]}`,h,E,this.animationValues),resetDistortingTransform(`skew${transformAxes[L]}`,h,E,this.animationValues);h.render();for(const L in E)h.setStaticValue(L,E[L]),this.animationValues&&(this.animationValues[L]=E[L]);h.scheduleRender()}getProjectionStyles(h){var p,y;if(!this.instance||this.isSVG)return;if(!this.isVisible)return hiddenVisibility;const E={visibility:""},L=this.getTransformTemplate();if(this.needsReset)return this.needsReset=!1,E.opacity="",E.pointerEvents=resolveMotionValue(h==null?void 0:h.pointerEvents)||"",E.transform=L?L(this.latestValues,""):"none",E;const F=this.getLead();if(!this.projectionDelta||!this.layout||!F.target){const W={};return this.options.layoutId&&(W.opacity=this.latestValues.opacity!==void 0?this.latestValues.opacity:1,W.pointerEvents=resolveMotionValue(h==null?void 0:h.pointerEvents)||""),this.hasProjected&&!hasTransform(this.latestValues)&&(W.transform=L?L({},""):"none",this.hasProjected=!1),W}const N=F.animationValues||F.latestValues;this.applyTransformsToTarget(),E.transform=buildProjectionTransform(this.projectionDeltaWithTransform,this.treeScale,N),L&&(E.transform=L(N,E.transform));const{x:z,y:oe}=this.projectionDelta;E.transformOrigin=`${z.origin*100}% ${oe.origin*100}% 0`,F.animationValues?E.opacity=F===this?(y=(p=N.opacity)!==null&&p!==void 0?p:this.latestValues.opacity)!==null&&y!==void 0?y:1:this.preserveOpacity?this.latestValues.opacity:N.opacityExit:E.opacity=F===this?N.opacity!==void 0?N.opacity:"":N.opacityExit!==void 0?N.opacityExit:0;for(const W in scaleCorrectors){if(N[W]===void 0)continue;const{correct:nt,applyTo:lt}=scaleCorrectors[W],Ee=E.transform==="none"?N[W]:nt(N[W],F);if(lt){const yt=lt.length;for(let Ai=0;Ai<yt;Ai++)E[lt[Ai]]=Ee}else E[W]=Ee}return this.options.layoutId&&(E.pointerEvents=F===this?resolveMotionValue(h==null?void 0:h.pointerEvents)||"":"none"),E}clearSnapshot(){this.resumeFrom=this.snapshot=void 0}resetTree(){this.root.nodes.forEach(h=>{var p;return(p=h.currentAnimation)===null||p===void 0?void 0:p.stop()}),this.root.nodes.forEach(clearMeasurements),this.root.sharedNodes.clear()}}}function updateLayout(t){t.updateLayout()}function notifyLayoutUpdate(t){var n;const o=((n=t.resumeFrom)===null||n===void 0?void 0:n.snapshot)||t.snapshot;if(t.isLead()&&t.layout&&o&&t.hasListeners("didUpdate")){const{layoutBox:s,measuredBox:c}=t.layout,{animationType:d}=t.options,h=o.source!==t.layout.source;d==="size"?eachAxis(F=>{const N=h?o.measuredBox[F]:o.layoutBox[F],z=calcLength(N);N.min=s[F].min,N.max=N.min+z}):shouldAnimatePositionOnly(d,o.layoutBox,s)&&eachAxis(F=>{const N=h?o.measuredBox[F]:o.layoutBox[F],z=calcLength(s[F]);N.max=N.min+z,t.relativeTarget&&!t.currentAnimation&&(t.isProjectionDirty=!0,t.relativeTarget[F].max=t.relativeTarget[F].min+z)});const p=createDelta();calcBoxDelta(p,s,o.layoutBox);const y=createDelta();h?calcBoxDelta(y,t.applyTransform(c,!0),o.measuredBox):calcBoxDelta(y,s,o.layoutBox);const E=!isDeltaZero(p);let L=!1;if(!t.resumeFrom){const F=t.getClosestProjectingParent();if(F&&!F.resumeFrom){const{snapshot:N,layout:z}=F;if(N&&z){const oe=createBox();calcRelativePosition(oe,o.layoutBox,N.layoutBox);const W=createBox();calcRelativePosition(W,s,z.layoutBox),boxEqualsRounded(oe,W)||(L=!0),F.options.layoutRoot&&(t.relativeTarget=W,t.relativeTargetOrigin=oe,t.relativeParent=F)}}}t.notifyListeners("didUpdate",{layout:s,snapshot:o,delta:y,layoutDelta:p,hasLayoutChanged:E,hasRelativeTargetChanged:L})}else if(t.isLead()){const{onExitComplete:s}=t.options;s&&s()}t.options.transition=void 0}function propagateDirtyNodes(t){projectionFrameData.totalNodes++,t.parent&&(t.isProjecting()||(t.isProjectionDirty=t.parent.isProjectionDirty),t.isSharedProjectionDirty||(t.isSharedProjectionDirty=!!(t.isProjectionDirty||t.parent.isProjectionDirty||t.parent.isSharedProjectionDirty)),t.isTransformDirty||(t.isTransformDirty=t.parent.isTransformDirty))}function cleanDirtyNodes(t){t.isProjectionDirty=t.isSharedProjectionDirty=t.isTransformDirty=!1}function clearSnapshot(t){t.clearSnapshot()}function clearMeasurements(t){t.clearMeasurements()}function clearIsLayoutDirty(t){t.isLayoutDirty=!1}function resetTransformStyle(t){const{visualElement:n}=t.options;n&&n.getProps().onBeforeLayoutMeasure&&n.notify("BeforeLayoutMeasure"),t.resetTransform()}function finishAnimation(t){t.finishAnimation(),t.targetDelta=t.relativeTarget=t.target=void 0,t.isProjectionDirty=!0}function resolveTargetDelta(t){t.resolveTargetDelta()}function calcProjection(t){t.calcProjection()}function resetSkewAndRotation(t){t.resetSkewAndRotation()}function removeLeadSnapshots(t){t.removeLeadSnapshot()}function mixAxisDelta(t,n,o){t.translate=mixNumber$1(n.translate,0,o),t.scale=mixNumber$1(n.scale,1,o),t.origin=n.origin,t.originPoint=n.originPoint}function mixAxis(t,n,o,s){t.min=mixNumber$1(n.min,o.min,s),t.max=mixNumber$1(n.max,o.max,s)}function mixBox(t,n,o,s){mixAxis(t.x,n.x,o.x,s),mixAxis(t.y,n.y,o.y,s)}function hasOpacityCrossfade(t){return t.animationValues&&t.animationValues.opacityExit!==void 0}const defaultLayoutTransition={duration:.45,ease:[.4,0,.1,1]},userAgentContains=t=>typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(t),roundPoint=userAgentContains("applewebkit/")&&!userAgentContains("chrome/")?Math.round:noop$1;function roundAxis(t){t.min=roundPoint(t.min),t.max=roundPoint(t.max)}function roundBox(t){roundAxis(t.x),roundAxis(t.y)}function shouldAnimatePositionOnly(t,n,o){return t==="position"||t==="preserve-aspect"&&!isNear(aspectRatio(n),aspectRatio(o),.2)}const DocumentProjectionNode=createProjectionNode({attachResizeListener:(t,n)=>addDomEvent(t,"resize",n),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body.scrollLeft,y:document.documentElement.scrollTop||document.body.scrollTop}),checkIsScrollRoot:()=>!0}),rootProjectionNode={current:void 0},HTMLProjectionNode=createProjectionNode({measureScroll:t=>({x:t.scrollLeft,y:t.scrollTop}),defaultParent:()=>{if(!rootProjectionNode.current){const t=new DocumentProjectionNode({});t.mount(window),t.setOptions({layoutScroll:!0}),rootProjectionNode.current=t}return rootProjectionNode.current},resetTransform:(t,n)=>{t.style.transform=n!==void 0?n:"none"},checkIsScrollRoot:t=>window.getComputedStyle(t).position==="fixed"}),drag={pan:{Feature:PanGesture},drag:{Feature:DragGesture,ProjectionNode:HTMLProjectionNode,MeasureLayout}},prefersReducedMotion={current:null},hasReducedMotionListener={current:!1};function initPrefersReducedMotion(){if(hasReducedMotionListener.current=!0,!!isBrowser)if(window.matchMedia){const t=window.matchMedia("(prefers-reduced-motion)"),n=()=>prefersReducedMotion.current=t.matches;t.addListener(n),n()}else prefersReducedMotion.current=!1}function updateMotionValuesFromProps(t,n,o){const{willChange:s}=n;for(const c in n){const d=n[c],h=o[c];if(isMotionValue(d))t.addValue(c,d),isWillChangeMotionValue(s)&&s.add(c),process.env.NODE_ENV==="development"&&warnOnce(d.version==="11.0.27",`Attempting to mix Framer Motion versions ${d.version} with 11.0.27 may not work as expected.`);else if(isMotionValue(h))t.addValue(c,motionValue(d,{owner:t})),isWillChangeMotionValue(s)&&s.remove(c);else if(h!==d)if(t.hasValue(c)){const p=t.getValue(c);p.liveStyle===!0?p.jump(d):p.hasAnimated||p.set(d)}else{const p=t.getStaticValue(c);t.addValue(c,motionValue(p!==void 0?p:d,{owner:t}))}}for(const c in o)n[c]===void 0&&t.removeValue(c);return n}const visualElementStore=new WeakMap,valueTypes=[...dimensionValueTypes,color,complex],findValueType=t=>valueTypes.find(testValueType(t)),featureNames=Object.keys(featureDefinitions),numFeatures=featureNames.length,propEventHandlers=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"],numVariantProps=variantProps.length;function getClosestProjectingNode(t){if(t)return t.options.allowProjection!==!1?t.projection:getClosestProjectingNode(t.parent)}class VisualElement{constructor({parent:n,props:o,presenceContext:s,reducedMotionConfig:c,blockInitialAnimation:d,visualState:h},p={}){this.resolveKeyframes=(N,z,oe,W)=>new this.KeyframeResolver(N,z,oe,W,this),this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.values=new Map,this.KeyframeResolver=KeyframeResolver,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},this.events={},this.propEventSubscriptions={},this.notifyUpdate=()=>this.notify("Update",this.latestValues),this.render=()=>{this.current&&(this.triggerBuild(),this.renderInstance(this.current,this.renderState,this.props.style,this.projection))},this.scheduleRender=()=>frame.render(this.render,!1,!0);const{latestValues:y,renderState:E}=h;this.latestValues=y,this.baseTarget={...y},this.initialValues=o.initial?{...y}:{},this.renderState=E,this.parent=n,this.props=o,this.presenceContext=s,this.depth=n?n.depth+1:0,this.reducedMotionConfig=c,this.options=p,this.blockInitialAnimation=!!d,this.isControllingVariants=isControllingVariants(o),this.isVariantNode=isVariantNode(o),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=!!(n&&n.current);const{willChange:L,...F}=this.scrapeMotionValuesFromProps(o,{},this);for(const N in F){const z=F[N];y[N]!==void 0&&isMotionValue(z)&&(z.set(y[N],!1),isWillChangeMotionValue(L)&&L.add(N))}}scrapeMotionValuesFromProps(n,o,s){return{}}mount(n){this.current=n,visualElementStore.set(n,this),this.projection&&!this.projection.instance&&this.projection.mount(n),this.parent&&this.isVariantNode&&!this.isControllingVariants&&(this.removeFromVariantTree=this.parent.addVariantChild(this)),this.values.forEach((o,s)=>this.bindToMotionValue(s,o)),hasReducedMotionListener.current||initPrefersReducedMotion(),this.shouldReduceMotion=this.reducedMotionConfig==="never"?!1:this.reducedMotionConfig==="always"?!0:prefersReducedMotion.current,process.env.NODE_ENV!=="production"&&warnOnce(this.shouldReduceMotion!==!0,"You have Reduced Motion enabled on your device. Animations may not appear as expected."),this.parent&&this.parent.children.add(this),this.update(this.props,this.presenceContext)}unmount(){visualElementStore.delete(this.current),this.projection&&this.projection.unmount(),cancelFrame(this.notifyUpdate),cancelFrame(this.render),this.valueSubscriptions.forEach(n=>n()),this.removeFromVariantTree&&this.removeFromVariantTree(),this.parent&&this.parent.children.delete(this);for(const n in this.events)this.events[n].clear();for(const n in this.features)this.features[n].unmount();this.current=null}bindToMotionValue(n,o){const s=transformProps.has(n),c=o.on("change",h=>{this.latestValues[n]=h,this.props.onUpdate&&frame.preRender(this.notifyUpdate),s&&this.projection&&(this.projection.isTransformDirty=!0)}),d=o.on("renderRequest",this.scheduleRender);this.valueSubscriptions.set(n,()=>{c(),d(),o.owner&&o.stop()})}sortNodePosition(n){return!this.current||!this.sortInstanceNodePosition||this.type!==n.type?0:this.sortInstanceNodePosition(this.current,n.current)}loadFeatures({children:n,...o},s,c,d){let h,p;if(process.env.NODE_ENV!=="production"&&c&&s){const y="You have rendered a `motion` component within a `LazyMotion` component. This will break tree shaking. Import and render a `m` component instead.";o.ignoreStrict?warning(!1,y):invariant(!1,y)}for(let y=0;y<numFeatures;y++){const E=featureNames[y],{isEnabled:L,Feature:F,ProjectionNode:N,MeasureLayout:z}=featureDefinitions[E];N&&(h=N),L(o)&&(!this.features[E]&&F&&(this.features[E]=new F(this)),z&&(p=z))}if((this.type==="html"||this.type==="svg")&&!this.projection&&h){this.projection=new h(this.latestValues,getClosestProjectingNode(this.parent));const{layoutId:y,layout:E,drag:L,dragConstraints:F,layoutScroll:N,layoutRoot:z}=o;this.projection.setOptions({layoutId:y,layout:E,alwaysMeasureLayout:!!L||F&&isRefObject(F),visualElement:this,scheduleRender:()=>this.scheduleRender(),animationType:typeof E=="string"?E:"both",initialPromotionConfig:d,layoutScroll:N,layoutRoot:z})}return p}updateFeatures(){for(const n in this.features){const o=this.features[n];o.isMounted?o.update():(o.mount(),o.isMounted=!0)}}triggerBuild(){this.build(this.renderState,this.latestValues,this.options,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):createBox()}getStaticValue(n){return this.latestValues[n]}setStaticValue(n,o){this.latestValues[n]=o}update(n,o){(n.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=n,this.prevPresenceContext=this.presenceContext,this.presenceContext=o;for(let s=0;s<propEventHandlers.length;s++){const c=propEventHandlers[s];this.propEventSubscriptions[c]&&(this.propEventSubscriptions[c](),delete this.propEventSubscriptions[c]);const d=n["on"+c];d&&(this.propEventSubscriptions[c]=this.on(c,d))}this.prevMotionValues=updateMotionValuesFromProps(this,this.scrapeMotionValuesFromProps(n,this.prevProps,this),this.prevMotionValues),this.handleChildMotionValue&&this.handleChildMotionValue()}getProps(){return this.props}getVariant(n){return this.props.variants?this.props.variants[n]:void 0}getDefaultTransition(){return this.props.transition}getTransformPagePoint(){return this.props.transformPagePoint}getClosestVariantNode(){return this.isVariantNode?this:this.parent?this.parent.getClosestVariantNode():void 0}getVariantContext(n=!1){if(n)return this.parent?this.parent.getVariantContext():void 0;if(!this.isControllingVariants){const s=this.parent?this.parent.getVariantContext()||{}:{};return this.props.initial!==void 0&&(s.initial=this.props.initial),s}const o={};for(let s=0;s<numVariantProps;s++){const c=variantProps[s],d=this.props[c];(isVariantLabel(d)||d===!1)&&(o[c]=d)}return o}addVariantChild(n){const o=this.getClosestVariantNode();if(o)return o.variantChildren&&o.variantChildren.add(n),()=>o.variantChildren.delete(n)}addValue(n,o){o!==this.values.get(n)&&(this.removeValue(n),this.bindToMotionValue(n,o)),this.values.set(n,o),this.latestValues[n]=o.get()}removeValue(n){this.values.delete(n);const o=this.valueSubscriptions.get(n);o&&(o(),this.valueSubscriptions.delete(n)),delete this.latestValues[n],this.removeValueFromRenderState(n,this.renderState)}hasValue(n){return this.values.has(n)}getValue(n,o){if(this.props.values&&this.props.values[n])return this.props.values[n];let s=this.values.get(n);return s===void 0&&o!==void 0&&(s=motionValue(o===null?void 0:o,{owner:this}),this.addValue(n,s)),s}readValue(n,o){var s;let c=this.latestValues[n]!==void 0||!this.current?this.latestValues[n]:(s=this.getBaseTargetFromProps(this.props,n))!==null&&s!==void 0?s:this.readValueFromInstance(this.current,n,this.options);return c!=null&&(typeof c=="string"&&(isNumericalString(c)||isZeroValueString(c))?c=parseFloat(c):!findValueType(c)&&complex.test(o)&&(c=getAnimatableNone(n,o)),this.setBaseTarget(n,isMotionValue(c)?c.get():c)),isMotionValue(c)?c.get():c}setBaseTarget(n,o){this.baseTarget[n]=o}getBaseTarget(n){var o,s;const{initial:c}=this.props,d=typeof c=="string"||typeof c=="object"?(s=resolveVariantFromProps(this.props,c,(o=this.presenceContext)===null||o===void 0?void 0:o.custom))===null||s===void 0?void 0:s[n]:void 0;if(c&&d!==void 0)return d;const h=this.getBaseTargetFromProps(this.props,n);return h!==void 0&&!isMotionValue(h)?h:this.initialValues[n]!==void 0&&d===void 0?void 0:this.baseTarget[n]}on(n,o){return this.events[n]||(this.events[n]=new SubscriptionManager),this.events[n].add(o)}notify(n,...o){this.events[n]&&this.events[n].notify(...o)}}class DOMVisualElement extends VisualElement{constructor(){super(...arguments),this.KeyframeResolver=DOMKeyframesResolver}sortInstanceNodePosition(n,o){return n.compareDocumentPosition(o)&2?1:-1}getBaseTargetFromProps(n,o){return n.style?n.style[o]:void 0}removeValueFromRenderState(n,{vars:o,style:s}){delete o[n],delete s[n]}}function getComputedStyle(t){return window.getComputedStyle(t)}class HTMLVisualElement extends DOMVisualElement{constructor(){super(...arguments),this.type="html"}readValueFromInstance(n,o){if(transformProps.has(o)){const s=getDefaultValueType(o);return s&&s.default||0}else{const s=getComputedStyle(n),c=(isCSSVariableName(o)?s.getPropertyValue(o):s[o])||0;return typeof c=="string"?c.trim():c}}measureInstanceViewportBox(n,{transformPagePoint:o}){return measureViewportBox(n,o)}build(n,o,s,c){buildHTMLStyles(n,o,s,c.transformTemplate)}scrapeMotionValuesFromProps(n,o,s){return scrapeMotionValuesFromProps$1(n,o,s)}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:n}=this.props;isMotionValue(n)&&(this.childSubscription=n.on("change",o=>{this.current&&(this.current.textContent=`${o}`)}))}renderInstance(n,o,s,c){renderHTML(n,o,s,c)}}class SVGVisualElement extends DOMVisualElement{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1}getBaseTargetFromProps(n,o){return n[o]}readValueFromInstance(n,o){if(transformProps.has(o)){const s=getDefaultValueType(o);return s&&s.default||0}return o=camelCaseAttributes.has(o)?o:camelToDash(o),n.getAttribute(o)}measureInstanceViewportBox(){return createBox()}scrapeMotionValuesFromProps(n,o){return scrapeMotionValuesFromProps(n,o,this)}build(n,o,s,c){buildSVGAttrs(n,o,s,this.isSVGTag,c.transformTemplate)}renderInstance(n,o,s,c){renderSVG(n,o,s,c)}mount(n){this.isSVGTag=isSVGTag(n.tagName),super.mount(n)}}const createDomVisualElement=(t,n)=>isSVGComponent(t)?new SVGVisualElement(n,{enableHardwareAcceleration:!1}):new HTMLVisualElement(n,{allowProjection:t!==React.Fragment,enableHardwareAcceleration:!0}),layout={layout:{ProjectionNode:HTMLProjectionNode,MeasureLayout}},preloadedFeatures={...animations,...gestureAnimations,...drag,...layout},motion=createMotionProxy((t,n)=>createDomMotionConfig(t,n,preloadedFeatures,createDomVisualElement));function useMotionValue(t){const n=useConstant(()=>motionValue(t)),{isStatic:o}=React.useContext(MotionConfigContext);if(o){const[,s]=React.useState(t);React.useEffect(()=>n.on("change",s),[])}return n}function assignRef(t,n){return typeof t=="function"?t(n):t&&(t.current=n),t}function useCallbackRef(t,n){var o=React.useState(function(){return{value:t,callback:n,facade:{get current(){return o.value},set current(s){var c=o.value;c!==s&&(o.value=s,o.callback(s,c))}}}})[0];return o.callback=n,o.facade}var useIsomorphicLayoutEffect=typeof window<"u"?React__namespace.useLayoutEffect:React__namespace.useEffect,currentValues=new WeakMap;function useMergeRefs(t,n){var o=useCallbackRef(null,function(s){return t.forEach(function(c){return assignRef(c,s)})});return useIsomorphicLayoutEffect(function(){var s=currentValues.get(o);if(s){var c=new Set(s),d=new Set(t),h=o.current;c.forEach(function(p){d.has(p)||assignRef(p,null)}),d.forEach(function(p){c.has(p)||assignRef(p,h)})}currentValues.set(o,t)},[t]),o}const occluder=new EllipsoidalOccluder(Ellipsoid$1.WGS84,Cartesian3.ZERO),ScreenSpaceElement=React.forwardRef(({position:t,children:n,...o},s)=>{const c=useConstant$2(()=>new Cartesian3);t==null||t.clone(c);const d=useMotionValue(""),h=useMotionValue("none"),{toWindowPosition:p,getCamera:y,toXYZ:E,isPositionVisible:L}=useContext(),F=React.useRef(null);usePreRender(()=>{if(F.current==null)return;let z;try{const Ee=p==null?void 0:p([c.x,c.y,c.z]);z=new Cartesian2(Ee==null?void 0:Ee[0],Ee==null?void 0:Ee[1])}catch{h.set("none");return}const oe=y==null?void 0:y();if(!oe)return;const W=E==null?void 0:E(oe==null?void 0:oe.lng,oe==null?void 0:oe.lat,oe==null?void 0:oe.height);if(!W)return;if(occluder.cameraPosition=new Cartesian3(W[0],W[1],W[2]),z==null||z.x<0||z.y<0||z.x>window.innerWidth||z.y>window.innerHeight||!(L!=null&&L([c.x,c.y,c.z]))){h.set("none");return}const nt=`calc(${z.x}px - 50%)`,lt=`calc(${z.y}px - 50%)`;d.set(`translate(${nt}, ${lt})`),h.set("block")});const N=useMergeRefs([F,s]);return jsxRuntimeExports.jsx(motion.div,{ref:N,...o,style:{...o.style,transform:d,display:h,position:"absolute",pointerEvents:"none",left:0,top:0},children:n})});ScreenSpaceElement.displayName="ScreenSpaceElement";const MeasurementLine$1=({a:t,b:n,color:o})=>{const s=React.useRef([t,n]);s.current=[t,n];const c=useConstant$2(()=>new CallbackProperty(()=>s.current,!1)),d=React.useMemo(()=>({polyline:{positions:c,width:1.5,material:new PolylineDashMaterialProperty({color:o,dashLength:8})}}),[o,c]);return jsxRuntimeExports.jsx(Entity,{...d})},ExtrudedMeasurement=({a:t,b:n,extrudedHeight:o,color:s})=>{const c=useConstant$2(()=>new Cartesian3);return jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx(ScreenSpaceElement,{position:Cartesian3.midpoint(t,n,c),children:jsxRuntimeExports.jsx(MeasurementText,{children:o<1e3?`${o.toFixed(1)} m`:`${(o/1e3).toFixed(1)} km`})}),jsxRuntimeExports.jsx(MeasurementLine$1,{a:t,b:n,color:s})]})},cartesianScratch=new Cartesian3,ExtrudedControlPoints=React.memo(({geometryOptions:{controlPoints:t},extrudedHeight:n,color:o})=>{var p;const{viewer:s}=$e$1(),c=t[t.length-1],d=(p=s==null?void 0:s.scene)==null?void 0:p.globe.ellipsoid.geodeticSurfaceNormal(c,cartesianScratch);invariant$1(d!==void 0);const h=Cartesian3.add(c,Cartesian3.multiplyByScalar(d,n,cartesianScratch),cartesianScratch);return jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx(ControlPoint,{position:c,clampToGround:!0}),jsxRuntimeExports.jsx(ControlPoint,{position:h}),jsxRuntimeExports.jsx(ExtrudedMeasurement,{a:c,b:h,extrudedHeight:n,color:o})]})});ExtrudedControlPoints.displayName="ExtrudedControlPoints";const ExtrudedPolygonEntity=({dynamic:t=!1,id:n,hierarchy:o,extrudedHeight:s,color:c,disableShadow:d=!1,enableRelativeHeight:h=!1})=>{const p=React.useRef(o);p.current=o;const y=useConstant$2(()=>new CallbackProperty(()=>p.current,!1)),E=t?y:o,L=React.useRef(s);L.current=s;const F=useConstant$2(()=>new CallbackProperty(()=>L.current,!1)),N=t?F:s,z=React.useMemo(()=>({polygon:{hierarchy:E,extrudedHeight:N,extrudedHeightReference:HeightReference$1.RELATIVE_TO_GROUND,fill:!0,outline:!0,outlineWidth:1,outlineColor:c==null?void 0:c.withAlpha(1),material:new ColorMaterialProperty(c),classificationType:ClassificationType$1.TERRAIN,shadows:d?ShadowMode$1.DISABLED:ShadowMode$1.ENABLED,...h?{height:0,heightReference:HeightReference$1.RELATIVE_TO_GROUND}:void 0}}),[N,d,E,c,h]),{requestRender:oe}=useContext();return oe==null||oe(),jsxRuntimeExports.jsx(Entity,{id:n,...z})},PolygonEntity=({dynamic:t=!1,hierarchy:n,color:o})=>{const s=React.useRef(n);s.current=n;const c=useConstant$2(()=>new CallbackProperty(()=>s.current,!1)),d=t?c:n,h=React.useMemo(()=>({polygon:{hierarchy:d,fill:!0,material:o==null?void 0:o.withAlpha(.5),classificationType:ClassificationType$1.TERRAIN}}),[o,d]),{requestRender:p}=useContext();return p==null||p(),jsxRuntimeExports.jsx(Entity,{...h})},PolylineEntity=({dynamic:t=!1,positions:n,color:o})=>{const s=React.useRef(n);s.current=n;const c=useConstant$2(()=>new CallbackProperty(()=>s.current,!t)),d=t?c:n,h=React.useMemo(()=>({polyline:{positions:d,width:1.5,material:o,classificationType:ClassificationType$1.TERRAIN,clampToGround:!0}}),[o,d]),{requestRender:p}=useContext();return p==null||p(),jsxRuntimeExports.jsx(Entity,{...h})},MeasurementLine=({a:t,b:n,color:o})=>{const s=React.useRef([t,n]);s.current=[t,n];const c=useConstant$2(()=>new CallbackProperty(()=>s.current,!1)),d=React.useMemo(()=>({polyline:{positions:c,width:1.5,material:new PolylineDashMaterialProperty({color:o,dashLength:8}),classificationType:ClassificationType$1.TERRAIN,clampToGround:!0}}),[o,c]),{requestRender:h}=useContext();return h==null||h(),jsxRuntimeExports.jsx(Entity,{...d})},SurfaceMeasurement=({a:t,b:n,color:o,showLine:s=!1})=>{const c=useConstant$2(()=>new Cartesian3),{getSurfaceDistance:d}=useContext(),h=d==null?void 0:d(t,n);return h!==void 0?jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx(ScreenSpaceElement,{position:Cartesian3.midpoint(t,n,c),children:jsxRuntimeExports.jsx(MeasurementText,{children:h<1e3?`${h.toFixed(1)} m`:`${(h/1e3).toFixed(1)} km`})}),s&&jsxRuntimeExports.jsx(MeasurementLine,{a:t,b:n,color:o})]}):null},cartesianScratch1=new Cartesian3,cartesianScratch2=new Cartesian3,SurfaceControlPoints=React.memo(({geometryOptions:{type:t,controlPoints:n},color:o})=>{let s=[...n],c,d=!1;if(t==="rectangle"&&s.length===3){const[h,p,y]=s,E=Cartesian3.projectVector(Cartesian3.subtract(y,h,cartesianScratch1),Cartesian3.subtract(p,h,cartesianScratch2),cartesianScratch1),L=Cartesian3.subtract(y,Cartesian3.add(h,E,cartesianScratch1),cartesianScratch2),F=Cartesian3.midpoint(h,p,cartesianScratch1),N=Cartesian3.add(F,L,cartesianScratch2);s=[h,p,N],c=[F,N],d=!0}else t==="marker"?(c=void 0,s=[]):s.length>=2&&(c=s.slice(-2),d=t==="circle");return jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[s.map((h,p)=>jsxRuntimeExports.jsx(ControlPoint,{position:h,clampToGround:!0},p)),c!=null&&jsxRuntimeExports.jsx(SurfaceMeasurement,{a:c[0],b:c[1],color:o,showLine:d})]})});SurfaceControlPoints.displayName="SurfaceControlPoints";const DEFAULT_SKETCH_COLOR="#00bebe",SketchComponent=React.memo(({geometry:t,geometryOptions:n,extrudedHeight:o,disableShadow:s,color:c,enableRelativeHeight:d})=>{const h=React.useMemo(()=>n?{...n,controlPoints:n==null?void 0:n.controlPoints.map(F=>new Cesium$1.Cartesian3(...F))}:null,[n]),p=React.useMemo(()=>t??(h?createGeometry(h):null),[t,h]),{positionsArray:y,hierarchyArray:E}=React.useMemo(()=>(p==null?void 0:p.type)==="Point"?{}:(p==null?void 0:p.type)==="LineString"?{positionsArray:convertGeometryToPositionsArray(p)}:p!=null?{positionsArray:convertGeometryToPositionsArray(p),hierarchyArray:convertPolygonToHierarchyArray(p)}:{},[p]),L=React.useMemo(()=>Color$1.fromCssColorString(c??DEFAULT_SKETCH_COLOR),[c]);return jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[y==null?void 0:y.map((F,N)=>jsxRuntimeExports.jsx(PolylineEntity,{dynamic:!0,positions:F,color:L},N)),E==null?void 0:E.map((F,N)=>jsxRuntimeExports.jsx(PolygonEntity,{dynamic:!0,hierarchy:F,color:L},N)),h!=null&&o==null&&jsxRuntimeExports.jsx(SurfaceControlPoints,{geometryOptions:h,color:L}),h!=null&&o!=null&&jsxRuntimeExports.jsx(ExtrudedControlPoints,{geometryOptions:h,extrudedHeight:o,color:L}),o!=null&&(E==null?void 0:E.map((F,N)=>jsxRuntimeExports.jsx(ExtrudedPolygonEntity,{dynamic:!0,hierarchy:F,extrudedHeight:o,disableShadow:s,color:L,enableRelativeHeight:d},N)))]})});SketchComponent.displayName="SketchComponent";const Cesium=({className:t,style:n,property:o,time:s,camera:c,small:d,ready:h,children:p,selectedLayerId:y,isLayerDraggable:E,isLayerDragging:L,shouldRender:F,layerSelectionReason:N,meta:z,layersRef:oe,featureFlags:W,requestingRenderMode:nt,timelineManagerRef:lt,cameraForceHorizontalRoll:Ee,onLayerSelect:yt,onCameraChange:Ai,onLayerDrag:zi,onLayerDrop:ha,onLayerEdit:ba,onLayerSelectWithRectStart:Sa,onLayerSelectWithRectMove:ya,onLayerSelectWithRectEnd:ms,onMount:Wc,onLayerVisibility:Wa,onLayerLoad:pi},mt)=>{var wf,bs,af,of,Vd,Gd,tf,ff,hf,cf,pf,xf,yf,Rf,gf,Ef,Bf,Zf,zf,Tf,Of,$f,_m,Em,wm,Am,vm,Mf,Sf,Gf,Nf,qf,Kf,Uf,$m,jm,ip,rp,ep,Qm,tp,op;const{cesium:fa,mouseEventHandles:Ra,cesiumIonAccessToken:sl,context:Zd,layerSelectWithRectEventHandlers:Xd,sceneLight:pu,sceneBackgroundColor:gl,sceneMsaaSamples:md,sceneMode:ef,cameraViewBoundaries:nf,cameraViewOuterBoundaries:rf,cameraViewBoundariesMaterial:uf,handleCameraChange:mf,handleCameraMoveEnd:Cf,handleUpdate:vf,handleClick:bf,handleMount:Pf,handleUnmount:Lf}=useHooks$1({ref:mt,property:o,time:s,selectedLayerId:y,selectionReason:N,meta:z,layersRef:oe,featureFlags:W,timelineManagerRef:lt,isLayerDraggable:E,isLayerDragging:L,shouldRender:F,requestingRenderMode:nt,camera:c,cameraForceHorizontalRoll:Ee,onLayerDrag:zi,onLayerDrop:ha,onLayerSelect:yt,onLayerEdit:ba,onLayerSelectWithRectStart:Sa,onLayerSelectWithRectMove:ya,onLayerSelectWithRectEnd:ms,onLayerVisibility:Wa,onLayerLoad:pi,onCameraChange:Ai,onMount:Wc});return jsxRuntimeExports.jsxs(Aa$1,{ref:fa,onUpdate:vf,className:t,requestRenderMode:!0,animation:!1,timeline:!1,baseLayer:!1,fullscreenButton:!1,homeButton:!1,geocoder:!1,infoBox:!1,baseLayerPicker:!1,navigationHelpButton:!1,projectionPicker:!1,sceneModePicker:!1,creditContainer,style:{width:d?"300px":"auto",height:d?"300px":"100%",display:h?void 0:"none",cursor:L?"grab":void 0,...n},shadows:!!((bs=(wf=o==null?void 0:o.scene)==null?void 0:wf.shadow)!=null&&bs.enabled),onClick:bf,onDoubleClick:Ra.doubleClick,onMouseDown:Ra.mouseDown,onMouseUp:Ra.mouseUp,onRightClick:Ra.rightClick,onRightDown:Ra.rightDown,onRightUp:Ra.rightUp,onMiddleClick:Ra.middleClick,onMiddleDown:Ra.middleDown,onMiddleUp:Ra.middleUp,onMouseMove:Ra.mouseMove,onMouseEnter:Ra.mouseEnter,onMouseLeave:Ra.mouseLeave,onWheel:Ra.wheel,children:[jsxRuntimeExports.jsx(Event,{onMount:Pf,onUnmount:Lf}),jsxRuntimeExports.jsx(ReearthClock,{timelineManagerRef:lt}),jsxRuntimeExports.jsx(ImageryLayers,{tiles:o==null?void 0:o.tiles,cesiumIonAccessToken:sl}),jsxRuntimeExports.jsx(LabelImageryLayers,{tileLabels:o==null?void 0:o.tileLabels}),jsxRuntimeExports.jsx(Indicator,{property:o,timelineManagerRef:lt}),jsxRuntimeExports.jsxs(ka$1,{useDefault:!0,children:[jsxRuntimeExports.jsx(Ma$1,{type:Cesium$1.ScreenSpaceEventType.LEFT_CLICK}),jsxRuntimeExports.jsx(Ma$1,{type:Cesium$1.ScreenSpaceEventType.LEFT_DOUBLE_CLICK})]}),jsxRuntimeExports.jsxs(ka$1,{children:[jsxRuntimeExports.jsx(Ma$1,{type:Cesium$1.ScreenSpaceEventType.LEFT_DOWN,action:Xd.start.handler}),jsxRuntimeExports.jsx(Ma$1,{type:Cesium$1.ScreenSpaceEventType.LEFT_DOWN,modifier:Cesium$1.KeyboardEventModifier.SHIFT,action:Xd.start.shift}),jsxRuntimeExports.jsx(Ma$1,{type:Cesium$1.ScreenSpaceEventType.MOUSE_MOVE,action:Xd.move.handler}),jsxRuntimeExports.jsx(Ma$1,{type:Cesium$1.ScreenSpaceEventType.MOUSE_MOVE,modifier:Cesium$1.KeyboardEventModifier.SHIFT,action:Xd.move.shift}),jsxRuntimeExports.jsx(Ma$1,{type:Cesium$1.ScreenSpaceEventType.LEFT_UP,action:Xd.end.handler}),jsxRuntimeExports.jsx(Ma$1,{type:Cesium$1.ScreenSpaceEventType.LEFT_UP,modifier:Cesium$1.KeyboardEventModifier.SHIFT,action:Xd.end.shift})]}),jsxRuntimeExports.jsx(Ta$1,{maximumZoomDistance:(of=(af=o==null?void 0:o.camera)==null?void 0:af.limiter)!=null&&of.enabled?((tf=(Gd=(Vd=o.camera)==null?void 0:Vd.limiter)==null?void 0:Gd.targetArea)==null?void 0:tf.height)??Number.POSITIVE_INFINITY:Number.POSITIVE_INFINITY,enableCollisionDetection:!((ff=o==null?void 0:o.camera)!=null&&ff.allowEnterGround)}),jsxRuntimeExports.jsx(Ps$1,{percentageChanged:.2,onChange:mf,onMoveEnd:Cf}),nf&&((cf=(hf=o==null?void 0:o.camera)==null?void 0:hf.limiter)==null?void 0:cf.showHelper)&&jsxRuntimeExports.jsx(Is$1,{children:jsxRuntimeExports.jsx(ua$1,{positions:nf,width:1,material:Cesium$1.Color.RED,arcType:Cesium$1.ArcType.RHUMB})}),rf&&((xf=(pf=o==null?void 0:o.camera)==null?void 0:pf.limiter)==null?void 0:xf.showHelper)&&jsxRuntimeExports.jsx(Is$1,{children:jsxRuntimeExports.jsx(ua$1,{positions:rf,width:1,material:uf,arcType:Cesium$1.ArcType.RHUMB})}),jsxRuntimeExports.jsx($a$1,{backgroundColor:gl,light:pu,mode:ef,msaaSamples:md,useDepthPicking:!1,useWebVR:!!((yf=o==null?void 0:o.scene)!=null&&yf.vr)||void 0,debugShowFramesPerSecond:!!((Rf=o==null?void 0:o.debug)!=null&&Rf.showFramesPerSecond),verticalExaggerationRelativeHeight:(gf=o==null?void 0:o.scene)==null?void 0:gf.verticalExaggerationRelativeHeight,verticalExaggeration:(Ef=o==null?void 0:o.scene)==null?void 0:Ef.verticalExaggeration}),jsxRuntimeExports.jsx(Oa$1,{show:((Zf=(Bf=o==null?void 0:o.sky)==null?void 0:Bf.skyBox)==null?void 0:Zf.show)??!0}),jsxRuntimeExports.jsx(Vs,{enabled:((Tf=(zf=o==null?void 0:o.sky)==null?void 0:zf.fog)==null?void 0:Tf.enabled)??!0,density:($f=(Of=o==null?void 0:o.sky)==null?void 0:Of.fog)==null?void 0:$f.density}),jsxRuntimeExports.jsx(Ga$1,{show:((Em=(_m=o==null?void 0:o.sky)==null?void 0:_m.sun)==null?void 0:Em.show)??!0}),jsxRuntimeExports.jsx(ea$1,{show:((Am=(wm=o==null?void 0:o.sky)==null?void 0:wm.moon)==null?void 0:Am.show)??!0}),jsxRuntimeExports.jsx(_a$2,{show:((Mf=(vm=o==null?void 0:o.sky)==null?void 0:vm.skyAtmosphere)==null?void 0:Mf.show)??!0,atmosphereLightIntensity:(Gf=(Sf=o==null?void 0:o.sky)==null?void 0:Sf.skyAtmosphere)==null?void 0:Gf.lightIntensity,saturationShift:(qf=(Nf=o==null?void 0:o.sky)==null?void 0:Nf.skyAtmosphere)==null?void 0:qf.saturationShift,brightnessShift:(Uf=(Kf=o==null?void 0:o.sky)==null?void 0:Kf.skyAtmosphere)==null?void 0:Uf.brightnessShift}),jsxRuntimeExports.jsx(Globe,{property:o,cesiumIonAccessToken:sl}),jsxRuntimeExports.jsx(context.Provider,{value:Zd,children:h?p:null}),jsxRuntimeExports.jsx(AmbientOcclusion,{...AMBIENT_OCCLUSION_QUALITY[((jm=($m=o==null?void 0:o.render)==null?void 0:$m.ambientOcclusion)==null?void 0:jm.quality)||"low"],enabled:!!((rp=(ip=o==null?void 0:o.render)==null?void 0:ip.ambientOcclusion)!=null&&rp.enabled),intensity:((Qm=(ep=o==null?void 0:o.render)==null?void 0:ep.ambientOcclusion)==null?void 0:Qm.intensity)??100,outputType:(op=(tp=o==null?void 0:o.render)==null?void 0:tp.ambientOcclusion)!=null&&op.ambientOcclusionOnly?AmbientOcclusionOutputType.Occlusion:null})]})},creditContainer=document.createElement("div"),Component=React.forwardRef(Cesium),engine={component:Component,featureComponent:Feature$1,clusterComponent:Cluster,sketchComponent:SketchComponent,delegatedDataTypes:["czml","wms","mvt","3dtiles","osm-buildings","kml"]},engines={cesium:engine};function Error$1({error:t,resetErrorBoundary:n}){return jsxRuntimeExports.jsxs("div",{children:[jsxRuntimeExports.jsx("h1",{children:"Oops! An Error Occurred"}),jsxRuntimeExports.jsx("p",{children:t.message}),jsxRuntimeExports.jsx("p",{children:jsxRuntimeExports.jsx("button",{style:{color:"#fff"},onClick:n,children:"Retry"})})]})}const version$1="0.0.7-alpha.12",useCoreAPI=({viewerProperty:t})=>{const n=React.useRef(t);n.current=t;const o=React.useMemo(()=>({get version(){return version$1},get viewerProperty(){return n.current}}),[]);React.useEffect(()=>{window.reearth_core=o},[o])},viewportMobileMaxWidth=768,useViewport=({wrapperRef:t})=>{const n=React.useMemo(()=>paramsToObject(new URLSearchParams(window.location.search)),[]),[o,s]=React.useState({width:void 0,height:void 0,isMobile:void 0,query:n});return React.useEffect(()=>{const c=new ResizeObserver(d=>{var E,L;const[h]=d;let p,y;if(h.contentBoxSize){const F=Array.isArray(h.contentBoxSize)?h.contentBoxSize[0]:h.contentBoxSize;p=F.inlineSize,y=F.blockSize}else h.contentRect?(p=h.contentRect.width,y=h.contentRect.height):(p=(E=t.current)==null?void 0:E.clientWidth,y=(L=t.current)==null?void 0:L.clientHeight);s(F=>({width:p,height:y,isMobile:p?p<=viewportMobileMaxWidth:void 0,query:F.query}))});return t.current&&c.observe(t.current),()=>{c.disconnect()}},[t]),o};function paramsToObject(t){const n={};for(const[o,s]of t)n[o]=s;return n}function useHooks({camera:t,interactionMode:n,zoomedLayerId:o,viewerProperty:s,onLayerSelect:c,onCameraChange:d,onInteractionModeChange:h,onZoomToLayer:p,onLayerDrop:y,onSketchTypeChangeProp:E},L){const F=React.useRef(null);React.useImperativeHandle(L,()=>F.current,[]);const N=React.useRef(null),z=useViewport({wrapperRef:N}),[oe,W]=React.useState({}),[nt,lt]=React.useState(),[Ee,yt]=React.useState(),Ai=React.useCallback(async(gf,Ef,Bf,Zf,zf)=>{var _m,Em,wm,Am,vm,Mf,Sf,Gf,Nf,qf,Kf;const Tf=((_m=oe.layer)==null?void 0:_m.layer.type)==="simple"&&((Am=(wm=(Em=oe.layer)==null?void 0:Em.layer)==null?void 0:wm.data)==null?void 0:Am.isSketchLayer);if(oe.layerId===gf&&oe.featureId===Ef&&!Tf)return;const Of=await(Bf==null?void 0:Bf()),$f=gf&&Ef?(Tf?(vm=Of==null?void 0:Of.features)==null?void 0:vm.find(Uf=>Uf.id===Ef):(Gf=(Mf=F.current)==null?void 0:(Sf=Mf.engine).findComputedFeatureById)==null?void 0:Gf.call(Sf,gf,Ef))??(zf==null?void 0:zf.feature):void 0;lt(gf&&Ef?(Kf=(Nf=F.current)==null?void 0:(qf=Nf.engine).findFeatureById)==null?void 0:Kf.call(qf,gf,Ef):void 0),yt($f),W(Uf=>Uf.layerId===gf&&Uf.featureId===Ef?Uf:{layerId:gf,featureId:Ef,layer:Of,reason:Zf}),c==null||c(gf,Bf,$f,Zf)},[oe,c]),zi=React.useRef(),[ha,ba]=useValue(t,d),[Sa,ya]=React.useState(!1),ms=React.useCallback(gf=>{ya(!!gf)},[]),[Wc,Wa]=useValue(n,h),pi=Wc||"default",[mt,fa]=React.useState("auto");React.useEffect(()=>{fa(pi==="sketch"?"crosshair":pi==="move"?"grab":"auto")},[pi]);const Ra=INTERACTION_MODES[pi],sl=React.useRef(),Zd=React.useCallback(gf=>{sl.current=gf},[]),Xd=React.useCallback(gf=>{var Ef;(Ef=sl.current)==null||Ef.call(sl,gf)},[]),pu=React.useRef(),gl=React.useCallback(gf=>{pu.current=gf},[]),md=React.useCallback(gf=>{var Ef;(Ef=pu.current)==null||Ef.call(pu,gf)},[]),ef=React.useRef(),nf=React.useCallback(gf=>{ef.current=gf},[]),rf=React.useCallback(gf=>{var Ef;(Ef=ef.current)==null||Ef.call(ef,gf)},[]),uf=React.useRef(),mf=React.useCallback(gf=>{uf.current=gf},[]),Cf=React.useCallback(gf=>{var Ef;(Ef=uf.current)==null||Ef.call(uf,gf)},[]),vf=React.useRef(),bf=React.useCallback(gf=>{vf.current=gf},[]),Pf=React.useCallback(gf=>{var Ef;(Ef=vf.current)==null||Ef.call(vf,gf)},[]),Lf=React.useRef(),wf=React.useCallback(gf=>{Lf.current=gf},[]),bs=React.useCallback(gf=>{var Ef;(Ef=Lf.current)==null||Ef.call(Lf,gf)},[]),af=React.useRef([]),of=React.useCallback(gf=>{af.current.push(gf)},[]),Vd=React.useCallback(gf=>{af.current.forEach(Ef=>Ef(gf))},[]),Gd=React.useRef([]),tf=React.useCallback(gf=>{Gd.current.push(gf)},[]),ff=React.useCallback((gf,Ef)=>{Gd.current.forEach(Bf=>Bf(gf)),E==null||E(gf,Ef)},[E]);React.useEffect(()=>{var gf,Ef;o&&((Ef=(gf=F.current)==null?void 0:gf.engine)==null||Ef.lookAtLayer(o),p==null||p(void 0))},[o,p]);const[hf,cf]=React.useState(!1),pf=React.useCallback(()=>{cf(!0)},[]),xf=React.useCallback((gf,Ef,Bf)=>{var Tf;cf(!1);const Zf=(Tf=F.current)==null?void 0:Tf.layers.findById(gf),zf=Zf!=null&&Zf.property.default.location?"default.location":Zf!=null&&Zf.property.default.position?"default.position":void 0;Bf&&Zf&&Zf.propertyId&&zf&&(y==null||y(Zf.propertyId,zf,Bf))},[y,F]),yf=React.useMemo(()=>({interactionMode:pi,selectedLayer:oe,selectedComputedFeature:Ee,viewport:z,handleCameraForceHorizontalRollChange:ms,handleInteractionModeChange:Wa,onSketchPluginFeatureCreate:of,onSketchTypeChange:tf,onLayerVisibility:gl,onLayerLoad:nf,onLayerEdit:Zd,onLayerSelectWithRectStart:mf,onLayerSelectWithRectMove:bf,onLayerSelectWithRectEnd:wf}),[pi,oe,Ee,z,Wa,ms,Zd,of,tf,gl,nf,mf,bf,wf]),Rf=React.useMemo(()=>({position:"relative",width:"100%",height:"100%",overflow:"hidden"}),[]);return useCoreAPI({viewerProperty:s}),{mapRef:F,wrapperRef:N,selectedFeature:nt,camera:ha,featureFlags:Ra,isLayerDragging:hf,timelineManagerRef:zi,cursor:mt,cameraForceHorizontalRoll:Sa,coreContextValue:yf,containerStyle:Rf,handleLayerSelect:Ai,handleLayerDrag:pf,handleLayerDrop:xf,handleLayerEdit:Xd,handleCameraChange:ba,handleInteractionModeChange:Wa,handleSketchPluginFeatureCreate:Vd,handleSketchTypeChange:ff,handleLayerVisibility:md,handleLayerLoad:rf,handleLayerSelectWithRectStart:Cf,handleLayerSelectWithRectMove:Pf,handleLayerSelectWithRectEnd:bs}}function useValue(t,n){const[o,s]=React.useState(t),c=React.useCallback(d=>{d&&(s(d),n==null||n(d))},[n]);return React.useEffect(()=>{s(t)},[t]),[o,c]}const CoreVisualizer=React.memo(React.forwardRef(({engine:t,isBuilt:n,isEditable:o,viewerProperty:s,layers:c,clusters:d,small:h,ready:p,hiddenLayers:y,camera:E,time:L,interactionMode:F,shouldRender:N,meta:z,style:oe,zoomedLayerId:W,children:nt,onLayerDrop:lt,onLayerSelect:Ee,onCameraChange:yt,onZoomToLayer:Ai,onInteractionModeChange:zi,onMount:ha,onSketchTypeChangeProp:ba,onSketchFeatureCreate:Sa},ya)=>{const{mapRef:ms,wrapperRef:Wc,selectedFeature:Wa,camera:pi,featureFlags:mt,isLayerDragging:fa,timelineManagerRef:Ra,cursor:sl,cameraForceHorizontalRoll:Zd,coreContextValue:Xd,containerStyle:pu,handleLayerSelect:gl,handleLayerDrag:md,handleLayerDrop:ef,handleLayerEdit:nf,handleCameraChange:rf,handleInteractionModeChange:uf,handleSketchPluginFeatureCreate:mf,handleSketchTypeChange:Cf,handleLayerVisibility:vf,handleLayerLoad:bf,handleLayerSelectWithRectStart:Pf,handleLayerSelectWithRectMove:Lf,handleLayerSelectWithRectEnd:wf}=useHooks({camera:E,interactionMode:F,zoomedLayerId:W,viewerProperty:s,onLayerSelect:Ee,onCameraChange:yt,onZoomToLayer:Ai,onLayerDrop:lt,onInteractionModeChange:zi,onSketchTypeChangeProp:ba},ya);return jsxRuntimeExports.jsx(ErrorBoundary,{FallbackComponent:Error$1,children:jsxRuntimeExports.jsx(VisualizerProvider,{mapRef:ms,children:jsxRuntimeExports.jsxs("div",{ref:Wc,style:pu,children:[jsxRuntimeExports.jsx(Map$1,{ref:ms,isBuilt:n,isEditable:o,engine:t,layers:c,engines,camera:pi,cameraForceHorizontalRoll:Zd,clusters:d,hiddenLayers:y,isLayerDragging:fa,isLayerDraggable:o,meta:z,style:oe,featureFlags:mt,shouldRender:N,property:s,time:L,small:h,ready:p,timelineManagerRef:Ra,interactionMode:F,selectedFeature:Wa,cursor:sl,onCameraChange:rf,onLayerDrag:md,onLayerDrop:ef,onLayerSelect:gl,onLayerEdit:nf,overrideInteractionMode:uf,onSketchFeatureCreate:Sa,onSketchPluginFeatureCreate:mf,onSketchTypeChange:Cf,onMount:ha,onLayerVisibility:vf,onLayerLoad:bf,onLayerSelectWithRectStart:Pf,onLayerSelectWithRectMove:Lf,onLayerSelectWithRectEnd:wf}),jsxRuntimeExports.jsx(coreContext.Provider,{value:Xd,children:nt})]})})})}));var global$1=typeof global<"u"?global:typeof self<"u"?self:typeof window<"u"?window:{},lookup=[],revLookup=[],Arr=typeof Uint8Array<"u"?Uint8Array:Array,inited=!1;function init(){inited=!0;for(var t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",n=0,o=t.length;n<o;++n)lookup[n]=t[n],revLookup[t.charCodeAt(n)]=n;revLookup[45]=62,revLookup[95]=63}function toByteArray(t){inited||init();var n,o,s,c,d,h,p=t.length;if(p%4>0)throw new Error("Invalid string. Length must be a multiple of 4");d=t[p-2]==="="?2:t[p-1]==="="?1:0,h=new Arr(p*3/4-d),s=d>0?p-4:p;var y=0;for(n=0,o=0;n<s;n+=4,o+=3)c=revLookup[t.charCodeAt(n)]<<18|revLookup[t.charCodeAt(n+1)]<<12|revLookup[t.charCodeAt(n+2)]<<6|revLookup[t.charCodeAt(n+3)],h[y++]=c>>16&255,h[y++]=c>>8&255,h[y++]=c&255;return d===2?(c=revLookup[t.charCodeAt(n)]<<2|revLookup[t.charCodeAt(n+1)]>>4,h[y++]=c&255):d===1&&(c=revLookup[t.charCodeAt(n)]<<10|revLookup[t.charCodeAt(n+1)]<<4|revLookup[t.charCodeAt(n+2)]>>2,h[y++]=c>>8&255,h[y++]=c&255),h}function tripletToBase64(t){return lookup[t>>18&63]+lookup[t>>12&63]+lookup[t>>6&63]+lookup[t&63]}function encodeChunk(t,n,o){for(var s,c=[],d=n;d<o;d+=3)s=(t[d]<<16)+(t[d+1]<<8)+t[d+2],c.push(tripletToBase64(s));return c.join("")}function fromByteArray(t){inited||init();for(var n,o=t.length,s=o%3,c="",d=[],h=16383,p=0,y=o-s;p<y;p+=h)d.push(encodeChunk(t,p,p+h>y?y:p+h));return s===1?(n=t[o-1],c+=lookup[n>>2],c+=lookup[n<<4&63],c+="=="):s===2&&(n=(t[o-2]<<8)+t[o-1],c+=lookup[n>>10],c+=lookup[n>>4&63],c+=lookup[n<<2&63],c+="="),d.push(c),d.join("")}function read(t,n,o,s,c){var d,h,p=c*8-s-1,y=(1<<p)-1,E=y>>1,L=-7,F=o?c-1:0,N=o?-1:1,z=t[n+F];for(F+=N,d=z&(1<<-L)-1,z>>=-L,L+=p;L>0;d=d*256+t[n+F],F+=N,L-=8);for(h=d&(1<<-L)-1,d>>=-L,L+=s;L>0;h=h*256+t[n+F],F+=N,L-=8);if(d===0)d=1-E;else{if(d===y)return h?NaN:(z?-1:1)*(1/0);h=h+Math.pow(2,s),d=d-E}return(z?-1:1)*h*Math.pow(2,d-s)}function write(t,n,o,s,c,d){var h,p,y,E=d*8-c-1,L=(1<<E)-1,F=L>>1,N=c===23?Math.pow(2,-24)-Math.pow(2,-77):0,z=s?0:d-1,oe=s?1:-1,W=n<0||n===0&&1/n<0?1:0;for(n=Math.abs(n),isNaN(n)||n===1/0?(p=isNaN(n)?1:0,h=L):(h=Math.floor(Math.log(n)/Math.LN2),n*(y=Math.pow(2,-h))<1&&(h--,y*=2),h+F>=1?n+=N/y:n+=N*Math.pow(2,1-F),n*y>=2&&(h++,y/=2),h+F>=L?(p=0,h=L):h+F>=1?(p=(n*y-1)*Math.pow(2,c),h=h+F):(p=n*Math.pow(2,F-1)*Math.pow(2,c),h=0));c>=8;t[o+z]=p&255,z+=oe,p/=256,c-=8);for(h=h<<c|p,E+=c;E>0;t[o+z]=h&255,z+=oe,h/=256,E-=8);t[o+z-oe]|=W*128}var toString={}.toString,isArray$1=Array.isArray||function(t){return toString.call(t)=="[object Array]"},INSPECT_MAX_BYTES=50;Buffer$1.TYPED_ARRAY_SUPPORT=global$1.TYPED_ARRAY_SUPPORT!==void 0?global$1.TYPED_ARRAY_SUPPORT:!0,kMaxLength();function kMaxLength(){return Buffer$1.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function createBuffer(t,n){if(kMaxLength()<n)throw new RangeError("Invalid typed array length");return Buffer$1.TYPED_ARRAY_SUPPORT?(t=new Uint8Array(n),t.__proto__=Buffer$1.prototype):(t===null&&(t=new Buffer$1(n)),t.length=n),t}function Buffer$1(t,n,o){if(!Buffer$1.TYPED_ARRAY_SUPPORT&&!(this instanceof Buffer$1))return new Buffer$1(t,n,o);if(typeof t=="number"){if(typeof n=="string")throw new Error("If encoding is specified then the first argument must be a string");return allocUnsafe(this,t)}return from(this,t,n,o)}Buffer$1.poolSize=8192,Buffer$1._augment=function(t){return t.__proto__=Buffer$1.prototype,t};function from(t,n,o,s){if(typeof n=="number")throw new TypeError('"value" argument must not be a number');return typeof ArrayBuffer<"u"&&n instanceof ArrayBuffer?fromArrayBuffer(t,n,o,s):typeof n=="string"?fromString(t,n,o):fromObject(t,n)}Buffer$1.from=function(t,n,o){return from(null,t,n,o)},Buffer$1.TYPED_ARRAY_SUPPORT&&(Buffer$1.prototype.__proto__=Uint8Array.prototype,Buffer$1.__proto__=Uint8Array,typeof Symbol<"u"&&Symbol.species&&Buffer$1[Symbol.species]);function assertSize(t){if(typeof t!="number")throw new TypeError('"size" argument must be a number');if(t<0)throw new RangeError('"size" argument must not be negative')}function alloc(t,n,o,s){return assertSize(n),n<=0?createBuffer(t,n):o!==void 0?typeof s=="string"?createBuffer(t,n).fill(o,s):createBuffer(t,n).fill(o):createBuffer(t,n)}Buffer$1.alloc=function(t,n,o){return alloc(null,t,n,o)};function allocUnsafe(t,n){if(assertSize(n),t=createBuffer(t,n<0?0:checked(n)|0),!Buffer$1.TYPED_ARRAY_SUPPORT)for(var o=0;o<n;++o)t[o]=0;return t}Buffer$1.allocUnsafe=function(t){return allocUnsafe(null,t)},Buffer$1.allocUnsafeSlow=function(t){return allocUnsafe(null,t)};function fromString(t,n,o){if((typeof o!="string"||o==="")&&(o="utf8"),!Buffer$1.isEncoding(o))throw new TypeError('"encoding" must be a valid string encoding');var s=byteLength(n,o)|0;t=createBuffer(t,s);var c=t.write(n,o);return c!==s&&(t=t.slice(0,c)),t}function fromArrayLike(t,n){var o=n.length<0?0:checked(n.length)|0;t=createBuffer(t,o);for(var s=0;s<o;s+=1)t[s]=n[s]&255;return t}function fromArrayBuffer(t,n,o,s){if(n.byteLength,o<0||n.byteLength<o)throw new RangeError("'offset' is out of bounds");if(n.byteLength<o+(s||0))throw new RangeError("'length' is out of bounds");return o===void 0&&s===void 0?n=new Uint8Array(n):s===void 0?n=new Uint8Array(n,o):n=new Uint8Array(n,o,s),Buffer$1.TYPED_ARRAY_SUPPORT?(t=n,t.__proto__=Buffer$1.prototype):t=fromArrayLike(t,n),t}function fromObject(t,n){if(internalIsBuffer(n)){var o=checked(n.length)|0;return t=createBuffer(t,o),t.length===0||n.copy(t,0,0,o),t}if(n){if(typeof ArrayBuffer<"u"&&n.buffer instanceof ArrayBuffer||"length"in n)return typeof n.length!="number"||isnan(n.length)?createBuffer(t,0):fromArrayLike(t,n);if(n.type==="Buffer"&&isArray$1(n.data))return fromArrayLike(t,n.data)}throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}function checked(t){if(t>=kMaxLength())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+kMaxLength().toString(16)+" bytes");return t|0}Buffer$1.isBuffer=isBuffer;function internalIsBuffer(t){return!!(t!=null&&t._isBuffer)}Buffer$1.compare=function t(n,o){if(!internalIsBuffer(n)||!internalIsBuffer(o))throw new TypeError("Arguments must be Buffers");if(n===o)return 0;for(var s=n.length,c=o.length,d=0,h=Math.min(s,c);d<h;++d)if(n[d]!==o[d]){s=n[d],c=o[d];break}return s<c?-1:c<s?1:0},Buffer$1.isEncoding=function t(n){switch(String(n).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},Buffer$1.concat=function t(n,o){if(!isArray$1(n))throw new TypeError('"list" argument must be an Array of Buffers');if(n.length===0)return Buffer$1.alloc(0);var s;if(o===void 0)for(o=0,s=0;s<n.length;++s)o+=n[s].length;var c=Buffer$1.allocUnsafe(o),d=0;for(s=0;s<n.length;++s){var h=n[s];if(!internalIsBuffer(h))throw new TypeError('"list" argument must be an Array of Buffers');h.copy(c,d),d+=h.length}return c};function byteLength(t,n){if(internalIsBuffer(t))return t.length;if(typeof ArrayBuffer<"u"&&typeof ArrayBuffer.isView=="function"&&(ArrayBuffer.isView(t)||t instanceof ArrayBuffer))return t.byteLength;typeof t!="string"&&(t=""+t);var o=t.length;if(o===0)return 0;for(var s=!1;;)switch(n){case"ascii":case"latin1":case"binary":return o;case"utf8":case"utf-8":case void 0:return utf8ToBytes(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return o*2;case"hex":return o>>>1;case"base64":return base64ToBytes(t).length;default:if(s)return utf8ToBytes(t).length;n=(""+n).toLowerCase(),s=!0}}Buffer$1.byteLength=byteLength;function slowToString(t,n,o){var s=!1;if((n===void 0||n<0)&&(n=0),n>this.length||((o===void 0||o>this.length)&&(o=this.length),o<=0)||(o>>>=0,n>>>=0,o<=n))return"";for(t||(t="utf8");;)switch(t){case"hex":return hexSlice(this,n,o);case"utf8":case"utf-8":return utf8Slice(this,n,o);case"ascii":return asciiSlice(this,n,o);case"latin1":case"binary":return latin1Slice(this,n,o);case"base64":return base64Slice(this,n,o);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return utf16leSlice(this,n,o);default:if(s)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),s=!0}}Buffer$1.prototype._isBuffer=!0;function swap(t,n,o){var s=t[n];t[n]=t[o],t[o]=s}Buffer$1.prototype.swap16=function t(){var n=this.length;if(n%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var o=0;o<n;o+=2)swap(this,o,o+1);return this},Buffer$1.prototype.swap32=function t(){var n=this.length;if(n%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var o=0;o<n;o+=4)swap(this,o,o+3),swap(this,o+1,o+2);return this},Buffer$1.prototype.swap64=function t(){var n=this.length;if(n%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var o=0;o<n;o+=8)swap(this,o,o+7),swap(this,o+1,o+6),swap(this,o+2,o+5),swap(this,o+3,o+4);return this},Buffer$1.prototype.toString=function t(){var n=this.length|0;return n===0?"":arguments.length===0?utf8Slice(this,0,n):slowToString.apply(this,arguments)},Buffer$1.prototype.equals=function t(n){if(!internalIsBuffer(n))throw new TypeError("Argument must be a Buffer");return this===n?!0:Buffer$1.compare(this,n)===0},Buffer$1.prototype.inspect=function t(){var n="",o=INSPECT_MAX_BYTES;return this.length>0&&(n=this.toString("hex",0,o).match(/.{2}/g).join(" "),this.length>o&&(n+=" ... ")),"<Buffer "+n+">"},Buffer$1.prototype.compare=function t(n,o,s,c,d){if(!internalIsBuffer(n))throw new TypeError("Argument must be a Buffer");if(o===void 0&&(o=0),s===void 0&&(s=n?n.length:0),c===void 0&&(c=0),d===void 0&&(d=this.length),o<0||s>n.length||c<0||d>this.length)throw new RangeError("out of range index");if(c>=d&&o>=s)return 0;if(c>=d)return-1;if(o>=s)return 1;if(o>>>=0,s>>>=0,c>>>=0,d>>>=0,this===n)return 0;for(var h=d-c,p=s-o,y=Math.min(h,p),E=this.slice(c,d),L=n.slice(o,s),F=0;F<y;++F)if(E[F]!==L[F]){h=E[F],p=L[F];break}return h<p?-1:p<h?1:0};function bidirectionalIndexOf(t,n,o,s,c){if(t.length===0)return-1;if(typeof o=="string"?(s=o,o=0):o>2147483647?o=2147483647:o<-2147483648&&(o=-2147483648),o=+o,isNaN(o)&&(o=c?0:t.length-1),o<0&&(o=t.length+o),o>=t.length){if(c)return-1;o=t.length-1}else if(o<0)if(c)o=0;else return-1;if(typeof n=="string"&&(n=Buffer$1.from(n,s)),internalIsBuffer(n))return n.length===0?-1:arrayIndexOf(t,n,o,s,c);if(typeof n=="number")return n=n&255,Buffer$1.TYPED_ARRAY_SUPPORT&&typeof Uint8Array.prototype.indexOf=="function"?c?Uint8Array.prototype.indexOf.call(t,n,o):Uint8Array.prototype.lastIndexOf.call(t,n,o):arrayIndexOf(t,[n],o,s,c);throw new TypeError("val must be string, number or Buffer")}function arrayIndexOf(t,n,o,s,c){var d=1,h=t.length,p=n.length;if(s!==void 0&&(s=String(s).toLowerCase(),s==="ucs2"||s==="ucs-2"||s==="utf16le"||s==="utf-16le")){if(t.length<2||n.length<2)return-1;d=2,h/=2,p/=2,o/=2}function y(z,oe){return d===1?z[oe]:z.readUInt16BE(oe*d)}var E;if(c){var L=-1;for(E=o;E<h;E++)if(y(t,E)===y(n,L===-1?0:E-L)){if(L===-1&&(L=E),E-L+1===p)return L*d}else L!==-1&&(E-=E-L),L=-1}else for(o+p>h&&(o=h-p),E=o;E>=0;E--){for(var F=!0,N=0;N<p;N++)if(y(t,E+N)!==y(n,N)){F=!1;break}if(F)return E}return-1}Buffer$1.prototype.includes=function t(n,o,s){return this.indexOf(n,o,s)!==-1},Buffer$1.prototype.indexOf=function t(n,o,s){return bidirectionalIndexOf(this,n,o,s,!0)},Buffer$1.prototype.lastIndexOf=function t(n,o,s){return bidirectionalIndexOf(this,n,o,s,!1)};function hexWrite(t,n,o,s){o=Number(o)||0;var c=t.length-o;s?(s=Number(s),s>c&&(s=c)):s=c;var d=n.length;if(d%2!==0)throw new TypeError("Invalid hex string");s>d/2&&(s=d/2);for(var h=0;h<s;++h){var p=parseInt(n.substr(h*2,2),16);if(isNaN(p))return h;t[o+h]=p}return h}function utf8Write(t,n,o,s){return blitBuffer(utf8ToBytes(n,t.length-o),t,o,s)}function asciiWrite(t,n,o,s){return blitBuffer(asciiToBytes(n),t,o,s)}function latin1Write(t,n,o,s){return asciiWrite(t,n,o,s)}function base64Write(t,n,o,s){return blitBuffer(base64ToBytes(n),t,o,s)}function ucs2Write(t,n,o,s){return blitBuffer(utf16leToBytes(n,t.length-o),t,o,s)}Buffer$1.prototype.write=function t(n,o,s,c){if(o===void 0)c="utf8",s=this.length,o=0;else if(s===void 0&&typeof o=="string")c=o,s=this.length,o=0;else if(isFinite(o))o=o|0,isFinite(s)?(s=s|0,c===void 0&&(c="utf8")):(c=s,s=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");var d=this.length-o;if((s===void 0||s>d)&&(s=d),n.length>0&&(s<0||o<0)||o>this.length)throw new RangeError("Attempt to write outside buffer bounds");c||(c="utf8");for(var h=!1;;)switch(c){case"hex":return hexWrite(this,n,o,s);case"utf8":case"utf-8":return utf8Write(this,n,o,s);case"ascii":return asciiWrite(this,n,o,s);case"latin1":case"binary":return latin1Write(this,n,o,s);case"base64":return base64Write(this,n,o,s);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return ucs2Write(this,n,o,s);default:if(h)throw new TypeError("Unknown encoding: "+c);c=(""+c).toLowerCase(),h=!0}},Buffer$1.prototype.toJSON=function t(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function base64Slice(t,n,o){return n===0&&o===t.length?fromByteArray(t):fromByteArray(t.slice(n,o))}function utf8Slice(t,n,o){o=Math.min(t.length,o);for(var s=[],c=n;c<o;){var d=t[c],h=null,p=d>239?4:d>223?3:d>191?2:1;if(c+p<=o){var y,E,L,F;switch(p){case 1:d<128&&(h=d);break;case 2:y=t[c+1],(y&192)===128&&(F=(d&31)<<6|y&63,F>127&&(h=F));break;case 3:y=t[c+1],E=t[c+2],(y&192)===128&&(E&192)===128&&(F=(d&15)<<12|(y&63)<<6|E&63,F>2047&&(F<55296||F>57343)&&(h=F));break;case 4:y=t[c+1],E=t[c+2],L=t[c+3],(y&192)===128&&(E&192)===128&&(L&192)===128&&(F=(d&15)<<18|(y&63)<<12|(E&63)<<6|L&63,F>65535&&F<1114112&&(h=F))}}h===null?(h=65533,p=1):h>65535&&(h-=65536,s.push(h>>>10&1023|55296),h=56320|h&1023),s.push(h),c+=p}return decodeCodePointsArray(s)}var MAX_ARGUMENTS_LENGTH=4096;function decodeCodePointsArray(t){var n=t.length;if(n<=MAX_ARGUMENTS_LENGTH)return String.fromCharCode.apply(String,t);for(var o="",s=0;s<n;)o+=String.fromCharCode.apply(String,t.slice(s,s+=MAX_ARGUMENTS_LENGTH));return o}function asciiSlice(t,n,o){var s="";o=Math.min(t.length,o);for(var c=n;c<o;++c)s+=String.fromCharCode(t[c]&127);return s}function latin1Slice(t,n,o){var s="";o=Math.min(t.length,o);for(var c=n;c<o;++c)s+=String.fromCharCode(t[c]);return s}function hexSlice(t,n,o){var s=t.length;(!n||n<0)&&(n=0),(!o||o<0||o>s)&&(o=s);for(var c="",d=n;d<o;++d)c+=toHex(t[d]);return c}function utf16leSlice(t,n,o){for(var s=t.slice(n,o),c="",d=0;d<s.length;d+=2)c+=String.fromCharCode(s[d]+s[d+1]*256);return c}Buffer$1.prototype.slice=function t(n,o){var s=this.length;n=~~n,o=o===void 0?s:~~o,n<0?(n+=s,n<0&&(n=0)):n>s&&(n=s),o<0?(o+=s,o<0&&(o=0)):o>s&&(o=s),o<n&&(o=n);var c;if(Buffer$1.TYPED_ARRAY_SUPPORT)c=this.subarray(n,o),c.__proto__=Buffer$1.prototype;else{var d=o-n;c=new Buffer$1(d,void 0);for(var h=0;h<d;++h)c[h]=this[h+n]}return c};function checkOffset(t,n,o){if(t%1!==0||t<0)throw new RangeError("offset is not uint");if(t+n>o)throw new RangeError("Trying to access beyond buffer length")}Buffer$1.prototype.readUIntLE=function t(n,o,s){n=n|0,o=o|0,s||checkOffset(n,o,this.length);for(var c=this[n],d=1,h=0;++h<o&&(d*=256);)c+=this[n+h]*d;return c},Buffer$1.prototype.readUIntBE=function t(n,o,s){n=n|0,o=o|0,s||checkOffset(n,o,this.length);for(var c=this[n+--o],d=1;o>0&&(d*=256);)c+=this[n+--o]*d;return c},Buffer$1.prototype.readUInt8=function t(n,o){return o||checkOffset(n,1,this.length),this[n]},Buffer$1.prototype.readUInt16LE=function t(n,o){return o||checkOffset(n,2,this.length),this[n]|this[n+1]<<8},Buffer$1.prototype.readUInt16BE=function t(n,o){return o||checkOffset(n,2,this.length),this[n]<<8|this[n+1]},Buffer$1.prototype.readUInt32LE=function t(n,o){return o||checkOffset(n,4,this.length),(this[n]|this[n+1]<<8|this[n+2]<<16)+this[n+3]*16777216},Buffer$1.prototype.readUInt32BE=function t(n,o){return o||checkOffset(n,4,this.length),this[n]*16777216+(this[n+1]<<16|this[n+2]<<8|this[n+3])},Buffer$1.prototype.readIntLE=function t(n,o,s){n=n|0,o=o|0,s||checkOffset(n,o,this.length);for(var c=this[n],d=1,h=0;++h<o&&(d*=256);)c+=this[n+h]*d;return d*=128,c>=d&&(c-=Math.pow(2,8*o)),c},Buffer$1.prototype.readIntBE=function t(n,o,s){n=n|0,o=o|0,s||checkOffset(n,o,this.length);for(var c=o,d=1,h=this[n+--c];c>0&&(d*=256);)h+=this[n+--c]*d;return d*=128,h>=d&&(h-=Math.pow(2,8*o)),h},Buffer$1.prototype.readInt8=function t(n,o){return o||checkOffset(n,1,this.length),this[n]&128?(255-this[n]+1)*-1:this[n]},Buffer$1.prototype.readInt16LE=function t(n,o){o||checkOffset(n,2,this.length);var s=this[n]|this[n+1]<<8;return s&32768?s|4294901760:s},Buffer$1.prototype.readInt16BE=function t(n,o){o||checkOffset(n,2,this.length);var s=this[n+1]|this[n]<<8;return s&32768?s|4294901760:s},Buffer$1.prototype.readInt32LE=function t(n,o){return o||checkOffset(n,4,this.length),this[n]|this[n+1]<<8|this[n+2]<<16|this[n+3]<<24},Buffer$1.prototype.readInt32BE=function t(n,o){return o||checkOffset(n,4,this.length),this[n]<<24|this[n+1]<<16|this[n+2]<<8|this[n+3]},Buffer$1.prototype.readFloatLE=function t(n,o){return o||checkOffset(n,4,this.length),read(this,n,!0,23,4)},Buffer$1.prototype.readFloatBE=function t(n,o){return o||checkOffset(n,4,this.length),read(this,n,!1,23,4)},Buffer$1.prototype.readDoubleLE=function t(n,o){return o||checkOffset(n,8,this.length),read(this,n,!0,52,8)},Buffer$1.prototype.readDoubleBE=function t(n,o){return o||checkOffset(n,8,this.length),read(this,n,!1,52,8)};function checkInt(t,n,o,s,c,d){if(!internalIsBuffer(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(n>c||n<d)throw new RangeError('"value" argument is out of bounds');if(o+s>t.length)throw new RangeError("Index out of range")}Buffer$1.prototype.writeUIntLE=function t(n,o,s,c){if(n=+n,o=o|0,s=s|0,!c){var d=Math.pow(2,8*s)-1;checkInt(this,n,o,s,d,0)}var h=1,p=0;for(this[o]=n&255;++p<s&&(h*=256);)this[o+p]=n/h&255;return o+s},Buffer$1.prototype.writeUIntBE=function t(n,o,s,c){if(n=+n,o=o|0,s=s|0,!c){var d=Math.pow(2,8*s)-1;checkInt(this,n,o,s,d,0)}var h=s-1,p=1;for(this[o+h]=n&255;--h>=0&&(p*=256);)this[o+h]=n/p&255;return o+s},Buffer$1.prototype.writeUInt8=function t(n,o,s){return n=+n,o=o|0,s||checkInt(this,n,o,1,255,0),Buffer$1.TYPED_ARRAY_SUPPORT||(n=Math.floor(n)),this[o]=n&255,o+1};function objectWriteUInt16(t,n,o,s){n<0&&(n=65535+n+1);for(var c=0,d=Math.min(t.length-o,2);c<d;++c)t[o+c]=(n&255<<8*(s?c:1-c))>>>(s?c:1-c)*8}Buffer$1.prototype.writeUInt16LE=function t(n,o,s){return n=+n,o=o|0,s||checkInt(this,n,o,2,65535,0),Buffer$1.TYPED_ARRAY_SUPPORT?(this[o]=n&255,this[o+1]=n>>>8):objectWriteUInt16(this,n,o,!0),o+2},Buffer$1.prototype.writeUInt16BE=function t(n,o,s){return n=+n,o=o|0,s||checkInt(this,n,o,2,65535,0),Buffer$1.TYPED_ARRAY_SUPPORT?(this[o]=n>>>8,this[o+1]=n&255):objectWriteUInt16(this,n,o,!1),o+2};function objectWriteUInt32(t,n,o,s){n<0&&(n=4294967295+n+1);for(var c=0,d=Math.min(t.length-o,4);c<d;++c)t[o+c]=n>>>(s?c:3-c)*8&255}Buffer$1.prototype.writeUInt32LE=function t(n,o,s){return n=+n,o=o|0,s||checkInt(this,n,o,4,4294967295,0),Buffer$1.TYPED_ARRAY_SUPPORT?(this[o+3]=n>>>24,this[o+2]=n>>>16,this[o+1]=n>>>8,this[o]=n&255):objectWriteUInt32(this,n,o,!0),o+4},Buffer$1.prototype.writeUInt32BE=function t(n,o,s){return n=+n,o=o|0,s||checkInt(this,n,o,4,4294967295,0),Buffer$1.TYPED_ARRAY_SUPPORT?(this[o]=n>>>24,this[o+1]=n>>>16,this[o+2]=n>>>8,this[o+3]=n&255):objectWriteUInt32(this,n,o,!1),o+4},Buffer$1.prototype.writeIntLE=function t(n,o,s,c){if(n=+n,o=o|0,!c){var d=Math.pow(2,8*s-1);checkInt(this,n,o,s,d-1,-d)}var h=0,p=1,y=0;for(this[o]=n&255;++h<s&&(p*=256);)n<0&&y===0&&this[o+h-1]!==0&&(y=1),this[o+h]=(n/p>>0)-y&255;return o+s},Buffer$1.prototype.writeIntBE=function t(n,o,s,c){if(n=+n,o=o|0,!c){var d=Math.pow(2,8*s-1);checkInt(this,n,o,s,d-1,-d)}var h=s-1,p=1,y=0;for(this[o+h]=n&255;--h>=0&&(p*=256);)n<0&&y===0&&this[o+h+1]!==0&&(y=1),this[o+h]=(n/p>>0)-y&255;return o+s},Buffer$1.prototype.writeInt8=function t(n,o,s){return n=+n,o=o|0,s||checkInt(this,n,o,1,127,-128),Buffer$1.TYPED_ARRAY_SUPPORT||(n=Math.floor(n)),n<0&&(n=255+n+1),this[o]=n&255,o+1},Buffer$1.prototype.writeInt16LE=function t(n,o,s){return n=+n,o=o|0,s||checkInt(this,n,o,2,32767,-32768),Buffer$1.TYPED_ARRAY_SUPPORT?(this[o]=n&255,this[o+1]=n>>>8):objectWriteUInt16(this,n,o,!0),o+2},Buffer$1.prototype.writeInt16BE=function t(n,o,s){return n=+n,o=o|0,s||checkInt(this,n,o,2,32767,-32768),Buffer$1.TYPED_ARRAY_SUPPORT?(this[o]=n>>>8,this[o+1]=n&255):objectWriteUInt16(this,n,o,!1),o+2},Buffer$1.prototype.writeInt32LE=function t(n,o,s){return n=+n,o=o|0,s||checkInt(this,n,o,4,2147483647,-2147483648),Buffer$1.TYPED_ARRAY_SUPPORT?(this[o]=n&255,this[o+1]=n>>>8,this[o+2]=n>>>16,this[o+3]=n>>>24):objectWriteUInt32(this,n,o,!0),o+4},Buffer$1.prototype.writeInt32BE=function t(n,o,s){return n=+n,o=o|0,s||checkInt(this,n,o,4,2147483647,-2147483648),n<0&&(n=4294967295+n+1),Buffer$1.TYPED_ARRAY_SUPPORT?(this[o]=n>>>24,this[o+1]=n>>>16,this[o+2]=n>>>8,this[o+3]=n&255):objectWriteUInt32(this,n,o,!1),o+4};function checkIEEE754(t,n,o,s,c,d){if(o+s>t.length)throw new RangeError("Index out of range");if(o<0)throw new RangeError("Index out of range")}function writeFloat(t,n,o,s,c){return c||checkIEEE754(t,n,o,4),write(t,n,o,s,23,4),o+4}Buffer$1.prototype.writeFloatLE=function t(n,o,s){return writeFloat(this,n,o,!0,s)},Buffer$1.prototype.writeFloatBE=function t(n,o,s){return writeFloat(this,n,o,!1,s)};function writeDouble(t,n,o,s,c){return c||checkIEEE754(t,n,o,8),write(t,n,o,s,52,8),o+8}Buffer$1.prototype.writeDoubleLE=function t(n,o,s){return writeDouble(this,n,o,!0,s)},Buffer$1.prototype.writeDoubleBE=function t(n,o,s){return writeDouble(this,n,o,!1,s)},Buffer$1.prototype.copy=function t(n,o,s,c){if(s||(s=0),!c&&c!==0&&(c=this.length),o>=n.length&&(o=n.length),o||(o=0),c>0&&c<s&&(c=s),c===s||n.length===0||this.length===0)return 0;if(o<0)throw new RangeError("targetStart out of bounds");if(s<0||s>=this.length)throw new RangeError("sourceStart out of bounds");if(c<0)throw new RangeError("sourceEnd out of bounds");c>this.length&&(c=this.length),n.length-o<c-s&&(c=n.length-o+s);var d=c-s,h;if(this===n&&s<o&&o<c)for(h=d-1;h>=0;--h)n[h+o]=this[h+s];else if(d<1e3||!Buffer$1.TYPED_ARRAY_SUPPORT)for(h=0;h<d;++h)n[h+o]=this[h+s];else Uint8Array.prototype.set.call(n,this.subarray(s,s+d),o);return d},Buffer$1.prototype.fill=function t(n,o,s,c){if(typeof n=="string"){if(typeof o=="string"?(c=o,o=0,s=this.length):typeof s=="string"&&(c=s,s=this.length),n.length===1){var d=n.charCodeAt(0);d<256&&(n=d)}if(c!==void 0&&typeof c!="string")throw new TypeError("encoding must be a string");if(typeof c=="string"&&!Buffer$1.isEncoding(c))throw new TypeError("Unknown encoding: "+c)}else typeof n=="number"&&(n=n&255);if(o<0||this.length<o||this.length<s)throw new RangeError("Out of range index");if(s<=o)return this;o=o>>>0,s=s===void 0?this.length:s>>>0,n||(n=0);var h;if(typeof n=="number")for(h=o;h<s;++h)this[h]=n;else{var p=internalIsBuffer(n)?n:utf8ToBytes(new Buffer$1(n,c).toString()),y=p.length;for(h=0;h<s-o;++h)this[h+o]=p[h%y]}return this};var INVALID_BASE64_RE=/[^+\/0-9A-Za-z-_]/g;function base64clean(t){if(t=stringtrim(t).replace(INVALID_BASE64_RE,""),t.length<2)return"";for(;t.length%4!==0;)t=t+"=";return t}function stringtrim(t){return t.trim?t.trim():t.replace(/^\s+|\s+$/g,"")}function toHex(t){return t<16?"0"+t.toString(16):t.toString(16)}function utf8ToBytes(t,n){n=n||1/0;for(var o,s=t.length,c=null,d=[],h=0;h<s;++h){if(o=t.charCodeAt(h),o>55295&&o<57344){if(!c){if(o>56319){(n-=3)>-1&&d.push(239,191,189);continue}else if(h+1===s){(n-=3)>-1&&d.push(239,191,189);continue}c=o;continue}if(o<56320){(n-=3)>-1&&d.push(239,191,189),c=o;continue}o=(c-55296<<10|o-56320)+65536}else c&&(n-=3)>-1&&d.push(239,191,189);if(c=null,o<128){if((n-=1)<0)break;d.push(o)}else if(o<2048){if((n-=2)<0)break;d.push(o>>6|192,o&63|128)}else if(o<65536){if((n-=3)<0)break;d.push(o>>12|224,o>>6&63|128,o&63|128)}else if(o<1114112){if((n-=4)<0)break;d.push(o>>18|240,o>>12&63|128,o>>6&63|128,o&63|128)}else throw new Error("Invalid code point")}return d}function asciiToBytes(t){for(var n=[],o=0;o<t.length;++o)n.push(t.charCodeAt(o)&255);return n}function utf16leToBytes(t,n){for(var o,s,c,d=[],h=0;h<t.length&&!((n-=2)<0);++h)o=t.charCodeAt(h),s=o>>8,c=o%256,d.push(c),d.push(s);return d}function base64ToBytes(t){return toByteArray(base64clean(t))}function blitBuffer(t,n,o,s){for(var c=0;c<s&&!(c+o>=n.length||c>=t.length);++c)n[c+o]=t[c];return c}function isnan(t){return t!==t}function isBuffer(t){return t!=null&&(!!t._isBuffer||isFastBuffer(t)||isSlowBuffer(t))}function isFastBuffer(t){return!!t.constructor&&typeof t.constructor.isBuffer=="function"&&t.constructor.isBuffer(t)}function isSlowBuffer(t){return typeof t.readFloatLE=="function"&&typeof t.slice=="function"&&isFastBuffer(t.slice(0,0))}var domain;function EventHandlers(){}EventHandlers.prototype=Object.create(null);function EventEmitter(){EventEmitter.init.call(this)}EventEmitter.EventEmitter=EventEmitter,EventEmitter.usingDomains=!1,EventEmitter.prototype.domain=void 0,EventEmitter.prototype._events=void 0,EventEmitter.prototype._maxListeners=void 0,EventEmitter.defaultMaxListeners=10,EventEmitter.init=function(){this.domain=null,EventEmitter.usingDomains&&domain.active,(!this._events||this._events===Object.getPrototypeOf(this)._events)&&(this._events=new EventHandlers,this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},EventEmitter.prototype.setMaxListeners=function t(n){if(typeof n!="number"||n<0||isNaN(n))throw new TypeError('"n" argument must be a positive number');return this._maxListeners=n,this};function $getMaxListeners(t){return t._maxListeners===void 0?EventEmitter.defaultMaxListeners:t._maxListeners}EventEmitter.prototype.getMaxListeners=function t(){return $getMaxListeners(this)};function emitNone(t,n,o){if(n)t.call(o);else for(var s=t.length,c=arrayClone(t,s),d=0;d<s;++d)c[d].call(o)}function emitOne(t,n,o,s){if(n)t.call(o,s);else for(var c=t.length,d=arrayClone(t,c),h=0;h<c;++h)d[h].call(o,s)}function emitTwo(t,n,o,s,c){if(n)t.call(o,s,c);else for(var d=t.length,h=arrayClone(t,d),p=0;p<d;++p)h[p].call(o,s,c)}function emitThree(t,n,o,s,c,d){if(n)t.call(o,s,c,d);else for(var h=t.length,p=arrayClone(t,h),y=0;y<h;++y)p[y].call(o,s,c,d)}function emitMany(t,n,o,s){if(n)t.apply(o,s);else for(var c=t.length,d=arrayClone(t,c),h=0;h<c;++h)d[h].apply(o,s)}EventEmitter.prototype.emit=function t(n){var o,s,c,d,h,p,y,E=n==="error";if(p=this._events,p)E=E&&p.error==null;else if(!E)return!1;if(y=this.domain,E){if(o=arguments[1],y)o||(o=new Error('Uncaught, unspecified "error" event')),o.domainEmitter=this,o.domain=y,o.domainThrown=!1,y.emit("error",o);else{if(o instanceof Error)throw o;var L=new Error('Uncaught, unspecified "error" event. ('+o+")");throw L.context=o,L}return!1}if(s=p[n],!s)return!1;var F=typeof s=="function";switch(c=arguments.length,c){case 1:emitNone(s,F,this);break;case 2:emitOne(s,F,this,arguments[1]);break;case 3:emitTwo(s,F,this,arguments[1],arguments[2]);break;case 4:emitThree(s,F,this,arguments[1],arguments[2],arguments[3]);break;default:for(d=new Array(c-1),h=1;h<c;h++)d[h-1]=arguments[h];emitMany(s,F,this,d)}return!0};function _addListener(t,n,o,s){var c,d,h;if(typeof o!="function")throw new TypeError('"listener" argument must be a function');if(d=t._events,d?(d.newListener&&(t.emit("newListener",n,o.listener?o.listener:o),d=t._events),h=d[n]):(d=t._events=new EventHandlers,t._eventsCount=0),!h)h=d[n]=o,++t._eventsCount;else if(typeof h=="function"?h=d[n]=s?[o,h]:[h,o]:s?h.unshift(o):h.push(o),!h.warned&&(c=$getMaxListeners(t),c&&c>0&&h.length>c)){h.warned=!0;var p=new Error("Possible EventEmitter memory leak detected. "+h.length+" "+n+" listeners added. Use emitter.setMaxListeners() to increase limit");p.name="MaxListenersExceededWarning",p.emitter=t,p.type=n,p.count=h.length,emitWarning(p)}return t}function emitWarning(t){typeof console.warn=="function"?console.warn(t):console.log(t)}EventEmitter.prototype.addListener=function t(n,o){return _addListener(this,n,o,!1)},EventEmitter.prototype.on=EventEmitter.prototype.addListener,EventEmitter.prototype.prependListener=function t(n,o){return _addListener(this,n,o,!0)};function _onceWrap(t,n,o){var s=!1;function c(){t.removeListener(n,c),s||(s=!0,o.apply(t,arguments))}return c.listener=o,c}EventEmitter.prototype.once=function t(n,o){if(typeof o!="function")throw new TypeError('"listener" argument must be a function');return this.on(n,_onceWrap(this,n,o)),this},EventEmitter.prototype.prependOnceListener=function t(n,o){if(typeof o!="function")throw new TypeError('"listener" argument must be a function');return this.prependListener(n,_onceWrap(this,n,o)),this},EventEmitter.prototype.removeListener=function t(n,o){var s,c,d,h,p;if(typeof o!="function")throw new TypeError('"listener" argument must be a function');if(c=this._events,!c)return this;if(s=c[n],!s)return this;if(s===o||s.listener&&s.listener===o)--this._eventsCount===0?this._events=new EventHandlers:(delete c[n],c.removeListener&&this.emit("removeListener",n,s.listener||o));else if(typeof s!="function"){for(d=-1,h=s.length;h-- >0;)if(s[h]===o||s[h].listener&&s[h].listener===o){p=s[h].listener,d=h;break}if(d<0)return this;if(s.length===1){if(s[0]=void 0,--this._eventsCount===0)return this._events=new EventHandlers,this;delete c[n]}else spliceOne(s,d);c.removeListener&&this.emit("removeListener",n,p||o)}return this},EventEmitter.prototype.removeAllListeners=function t(n){var o,s;if(s=this._events,!s)return this;if(!s.removeListener)return arguments.length===0?(this._events=new EventHandlers,this._eventsCount=0):s[n]&&(--this._eventsCount===0?this._events=new EventHandlers:delete s[n]),this;if(arguments.length===0){for(var c=Object.keys(s),d=0,h;d<c.length;++d)h=c[d],h!=="removeListener"&&this.removeAllListeners(h);return this.removeAllListeners("removeListener"),this._events=new EventHandlers,this._eventsCount=0,this}if(o=s[n],typeof o=="function")this.removeListener(n,o);else if(o)do this.removeListener(n,o[o.length-1]);while(o[0]);return this},EventEmitter.prototype.listeners=function t(n){var o,s,c=this._events;return c?(o=c[n],o?typeof o=="function"?s=[o.listener||o]:s=unwrapListeners(o):s=[]):s=[],s},EventEmitter.listenerCount=function(t,n){return typeof t.listenerCount=="function"?t.listenerCount(n):listenerCount$1.call(t,n)},EventEmitter.prototype.listenerCount=listenerCount$1;function listenerCount$1(t){var n=this._events;if(n){var o=n[t];if(typeof o=="function")return 1;if(o)return o.length}return 0}EventEmitter.prototype.eventNames=function t(){return this._eventsCount>0?Reflect.ownKeys(this._events):[]};function spliceOne(t,n){for(var o=n,s=o+1,c=t.length;s<c;o+=1,s+=1)t[o]=t[s];t.pop()}function arrayClone(t,n){for(var o=new Array(n);n--;)o[n]=t[n];return o}function unwrapListeners(t){for(var n=new Array(t.length),o=0;o<n.length;++o)n[o]=t[o].listener||t[o];return n}function defaultSetTimout(){throw new Error("setTimeout has not been defined")}function defaultClearTimeout(){throw new Error("clearTimeout has not been defined")}var cachedSetTimeout=defaultSetTimout,cachedClearTimeout=defaultClearTimeout;typeof global$1.setTimeout=="function"&&(cachedSetTimeout=setTimeout),typeof global$1.clearTimeout=="function"&&(cachedClearTimeout=clearTimeout);function runTimeout(t){if(cachedSetTimeout===setTimeout)return setTimeout(t,0);if((cachedSetTimeout===defaultSetTimout||!cachedSetTimeout)&&setTimeout)return cachedSetTimeout=setTimeout,setTimeout(t,0);try{return cachedSetTimeout(t,0)}catch{try{return cachedSetTimeout.call(null,t,0)}catch{return cachedSetTimeout.call(this,t,0)}}}function runClearTimeout(t){if(cachedClearTimeout===clearTimeout)return clearTimeout(t);if((cachedClearTimeout===defaultClearTimeout||!cachedClearTimeout)&&clearTimeout)return cachedClearTimeout=clearTimeout,clearTimeout(t);try{return cachedClearTimeout(t)}catch{try{return cachedClearTimeout.call(null,t)}catch{return cachedClearTimeout.call(this,t)}}}var queue=[],draining=!1,currentQueue,queueIndex=-1;function cleanUpNextTick(){!draining||!currentQueue||(draining=!1,currentQueue.length?queue=currentQueue.concat(queue):queueIndex=-1,queue.length&&drainQueue())}function drainQueue(){if(!draining){var t=runTimeout(cleanUpNextTick);draining=!0;for(var n=queue.length;n;){for(currentQueue=queue,queue=[];++queueIndex<n;)currentQueue&¤tQueue[queueIndex].run();queueIndex=-1,n=queue.length}currentQueue=null,draining=!1,runClearTimeout(t)}}function nextTick(t){var n=new Array(arguments.length-1);if(arguments.length>1)for(var o=1;o<arguments.length;o++)n[o-1]=arguments[o];queue.push(new Item(t,n)),queue.length===1&&!draining&&runTimeout(drainQueue)}function Item(t,n){this.fun=t,this.array=n}Item.prototype.run=function(){this.fun.apply(null,this.array)};var title="browser",platform="browser",browser=!0,env={},argv=[],version="",versions={},release={},config={};function noop(){}var on=noop,addListener=noop,once=noop,off=noop,removeListener=noop,removeAllListeners=noop,emit=noop;function binding(t){throw new Error("process.binding is not supported")}function cwd(){return"/"}function chdir(t){throw new Error("process.chdir is not supported")}function umask(){return 0}var performance$1=global$1.performance||{},performanceNow=performance$1.now||performance$1.mozNow||performance$1.msNow||performance$1.oNow||performance$1.webkitNow||function(){return new Date().getTime()};function hrtime(t){var n=performanceNow.call(performance$1)*.001,o=Math.floor(n),s=Math.floor(n%1*1e9);return t&&(o=o-t[0],s=s-t[1],s<0&&(o--,s+=1e9)),[o,s]}var startTime=new Date;function uptime(){var t=new Date,n=t-startTime;return n/1e3}var process$1={nextTick,title,browser,env,argv,version,versions,on,addListener,once,off,removeListener,removeAllListeners,emit,binding,cwd,chdir,umask,hrtime,platform,release,config,uptime},inherits;typeof Object.create=="function"?inherits=function(n,o){n.super_=o,n.prototype=Object.create(o.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}})}:inherits=function(n,o){n.super_=o;var s=function(){};s.prototype=o.prototype,n.prototype=new s,n.prototype.constructor=n};var inherits$1=inherits,formatRegExp=/%[sdj%]/g;function format(t){if(!isString(t)){for(var n=[],o=0;o<arguments.length;o++)n.push(inspect(arguments[o]));return n.join(" ")}for(var o=1,s=arguments,c=s.length,d=String(t).replace(formatRegExp,function(p){if(p==="%%")return"%";if(o>=c)return p;switch(p){case"%s":return String(s[o++]);case"%d":return Number(s[o++]);case"%j":try{return JSON.stringify(s[o++])}catch{return"[Circular]"}default:return p}}),h=s[o];o<c;h=s[++o])isNull(h)||!isObject(h)?d+=" "+h:d+=" "+inspect(h);return d}function deprecate(t,n){if(isUndefined(global$1.process))return function(){return deprecate(t,n).apply(this,arguments)};if(process$1.noDeprecation===!0)return t;var o=!1;function s(){if(!o){if(process$1.throwDeprecation)throw new Error(n);process$1.traceDeprecation?console.trace(n):console.error(n),o=!0}return t.apply(this,arguments)}return s}var debugs={},debugEnviron;function debuglog(t){if(isUndefined(debugEnviron)&&(debugEnviron=process$1.env.NODE_DEBUG||""),t=t.toUpperCase(),!debugs[t])if(new RegExp("\\b"+t+"\\b","i").test(debugEnviron)){var n=0;debugs[t]=function(){var o=format.apply(null,arguments);console.error("%s %d: %s",t,n,o)}}else debugs[t]=function(){};return debugs[t]}function inspect(t,n){var o={seen:[],stylize:stylizeNoColor};return arguments.length>=3&&(o.depth=arguments[2]),arguments.length>=4&&(o.colors=arguments[3]),isBoolean(n)?o.showHidden=n:n&&_extend(o,n),isUndefined(o.showHidden)&&(o.showHidden=!1),isUndefined(o.depth)&&(o.depth=2),isUndefined(o.colors)&&(o.colors=!1),isUndefined(o.customInspect)&&(o.customInspect=!0),o.colors&&(o.stylize=stylizeWithColor),formatValue(o,t,o.depth)}inspect.colors={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[30,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[31,39],yellow:[33,39]},inspect.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"};function stylizeWithColor(t,n){var o=inspect.styles[n];return o?"\x1B["+inspect.colors[o][0]+"m"+t+"\x1B["+inspect.colors[o][1]+"m":t}function stylizeNoColor(t,n){return t}function arrayToHash(t){var n={};return t.forEach(function(o,s){n[o]=!0}),n}function formatValue(t,n,o){if(t.customInspect&&n&&isFunction(n.inspect)&&n.inspect!==inspect&&!(n.constructor&&n.constructor.prototype===n)){var s=n.inspect(o,t);return isString(s)||(s=formatValue(t,s,o)),s}var c=formatPrimitive(t,n);if(c)return c;var d=Object.keys(n),h=arrayToHash(d);if(t.showHidden&&(d=Object.getOwnPropertyNames(n)),isError(n)&&(d.indexOf("message")>=0||d.indexOf("description")>=0))return formatError(n);if(d.length===0){if(isFunction(n)){var p=n.name?": "+n.name:"";return t.stylize("[Function"+p+"]","special")}if(isRegExp(n))return t.stylize(RegExp.prototype.toString.call(n),"regexp");if(isDate(n))return t.stylize(Date.prototype.toString.call(n),"date");if(isError(n))return formatError(n)}var y="",E=!1,L=["{","}"];if(isArray(n)&&(E=!0,L=["[","]"]),isFunction(n)){var F=n.name?": "+n.name:"";y=" [Function"+F+"]"}if(isRegExp(n)&&(y=" "+RegExp.prototype.toString.call(n)),isDate(n)&&(y=" "+Date.prototype.toUTCString.call(n)),isError(n)&&(y=" "+formatError(n)),d.length===0&&(!E||n.length==0))return L[0]+y+L[1];if(o<0)return isRegExp(n)?t.stylize(RegExp.prototype.toString.call(n),"regexp"):t.stylize("[Object]","special");t.seen.push(n);var N;return E?N=formatArray(t,n,o,h,d):N=d.map(function(z){return formatProperty(t,n,o,h,z,E)}),t.seen.pop(),reduceToSingleString(N,y,L)}function formatPrimitive(t,n){if(isUndefined(n))return t.stylize("undefined","undefined");if(isString(n)){var o="'"+JSON.stringify(n).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return t.stylize(o,"string")}if(isNumber(n))return t.stylize(""+n,"number");if(isBoolean(n))return t.stylize(""+n,"boolean");if(isNull(n))return t.stylize("null","null")}function formatError(t){return"["+Error.prototype.toString.call(t)+"]"}function formatArray(t,n,o,s,c){for(var d=[],h=0,p=n.length;h<p;++h)hasOwnProperty(n,String(h))?d.push(formatProperty(t,n,o,s,String(h),!0)):d.push("");return c.forEach(function(y){y.match(/^\d+$/)||d.push(formatProperty(t,n,o,s,y,!0))}),d}function formatProperty(t,n,o,s,c,d){var h,p,y;if(y=Object.getOwnPropertyDescriptor(n,c)||{value:n[c]},y.get?y.set?p=t.stylize("[Getter/Setter]","special"):p=t.stylize("[Getter]","special"):y.set&&(p=t.stylize("[Setter]","special")),hasOwnProperty(s,c)||(h="["+c+"]"),p||(t.seen.indexOf(y.value)<0?(isNull(o)?p=formatValue(t,y.value,null):p=formatValue(t,y.value,o-1),p.indexOf(`
|
|
6745
|
+
`,uniforms:{...pick(L,["color","frustumLength","blackPoint","whitePoint","gamma"]),globeDepthTexture:()=>(y==null?void 0:y())??N._depthTexture}});if(c){const z=createBilateralFilterStage({prefix:t,outputType:h,useGlobeDepth:p,getGlobeDepthTexture:y,uniforms:{textureScale:n,...pick(L,["frustumLength","normalExponent","depthExponent"])}}),oe=new Cesium$1.PostProcessStageComposite({name:`${t}_ambient_occlusion_generate_and_filter`,stages:[F,z]});return N.uniforms.ambientOcclusionTexture=oe.name,new Cesium$1.PostProcessStageComposite({name:`${t}_ambient_occlusion`,stages:[oe,N],inputPreviousStageTexture:!1,uniforms:createUniforms([{stage:F,uniforms:["intensity","maxRadius","bias","frustumLength","focalLength"]},{stage:z,uniforms:["frustumLength","normalExponent","depthExponent"]},{stage:N,uniforms:["color","blackPoint","whitePoint","gamma"]}])})}else return N.uniforms.ambientOcclusionTexture=F.name,new Cesium$1.PostProcessStageComposite({name:`${t}_ambient_occlusion`,stages:[F,N],inputPreviousStageTexture:!1,uniforms:createUniforms([{stage:F,uniforms:["intensity","maxRadius","bias","frustumLength","focalLength"]},{stage:N,uniforms:["color","blackPoint","whitePoint","gamma"]}])})}const AmbientOcclusionStage=({enabled:t=!0,textureScale:n,directions:o,steps:s,denoise:c,accurateNormalReconstruction:d,outputType:h,useGlobeDepth:p,...y})=>{const{viewer:E}=$e$1(),L=E==null?void 0:E.scene,F=useInstance({owner:L==null?void 0:L.postProcessStages,keys:[n,s,o,c,d,h,p],create:()=>{const N=createAmbientOcclusionStage({textureScale:n,steps:s,directions:o,denoise:c,accurateNormalReconstruction:d,outputType:h,useGlobeDepth:p,getGlobeDepthTexture:()=>L.context.uniformState.globeDepthTexture,uniforms:y});return N.enabled=t,N},transferOwnership:(N,z)=>(z==null||z.add(N),()=>{z==null||z.remove(N)})});return F.enabled=t,Object.assign(F.uniforms,y),L==null||L.requestRender(),usePreRender(()=>{const N=L==null?void 0:L.camera.frustum;if(N instanceof Cesium$1.PerspectiveFrustum){const z=1/Math.tan(N.fovy/2);F.uniforms.focalLength.x=z*N.aspectRatio,F.uniforms.focalLength.y=z}}),null},AmbientOcclusion=t=>{const n=$e$1(),[o,s]=React.useState(!1);return usePreRender(()=>{const c=n.scene;s(!(c!=null&&c.globe.depthTestAgainstTerrain));const{globeHeight:d}=c;if(!c||d==null)return;const h=c.camera.positionCartographic.height-d,p=c==null?void 0:c.camera.frustum;p instanceof Cesium$1.PerspectiveFrustum&&(c.camera.frustum.near=Cesium$1.Math.clamp(h-1,1,5)/Math.tan(p.fov/2))}),jsxRuntimeExports.jsx(AmbientOcclusionStage,{...t,useGlobeDepth:o})};var AmbientOcclusionOutputType=(t=>(t[t.Occlusion=1]="Occlusion",t[t.Normal=2]="Normal",t[t.Depth=3]="Depth",t[t.Weight=4]="Weight",t[t.Shade=5]="Shade",t))(AmbientOcclusionOutputType||{});const AMBIENT_OCCLUSION_QUALITY={low:{directions:4,steps:4,textureScale:.5,maxRadius:30},medium:{directions:4,steps:8,textureScale:.5,maxRadius:40},high:{directions:8,steps:8,textureScale:1,maxRadius:40},extreme:{directions:16,steps:16,textureScale:1,maxRadius:40}};let image;function getImage(){if(image!=null)return image;image=document.createElement("canvas"),image.width=16,image.height=16;const t=image.getContext("2d");return invariant$1(t!=null),t.fillStyle="white",t.fillRect(3,3,10,10),t.strokeStyle="black",t.lineWidth=2,t.strokeRect(3,3,10,10),image}const ControlPoint=({position:t,clampToGround:n=!1})=>{const o=React.useRef(t);o.current=t;const s=useConstant$2(()=>new CallbackProperty((d,h)=>"getValue"in o.current?o.current.getValue(d,h):o.current,!1)),c=React.useMemo(()=>({position:s,billboard:{image:getImage(),width:8,height:8,heightReference:n?HeightReference$1.CLAMP_TO_GROUND:HeightReference$1.NONE,disableDepthTestDistance:1/0}}),[n,s]);return jsxRuntimeExports.jsx(Is$1,{...c})};function assignForwardedRef(t,n){if(typeof t=="function")return t(n),()=>{t(null)};if(t!=null)return t.current=n,()=>{t.current=null}}const Entity=React.memo(React.forwardRef(({entities:t,...n},o)=>{const{viewer:s}=$e$1(),c=s==null?void 0:s.scene,d=s==null?void 0:s.entities,h=t??d,[p,y]=React.useState(()=>new Entity$1(n));return React.useEffect(()=>{y(new Entity$1(n))},[n.id]),React.useEffect(()=>(h==null||h.add(p),()=>{h==null||h.remove(p),c==null||c.requestRender()}),[c,h,p]),React.useEffect(()=>assignForwardedRef(o,p),[o,p]),Object.assign(p,omit(n,"id")),c==null||c.requestRender(),null})),textStyle={padding:"5px",color:"#fff",backgroundColor:"#000",borderRadius:"5px",lineHeight:1},MeasurementText=({children:t})=>jsxRuntimeExports.jsx("div",{style:textStyle,children:t}),MotionConfigContext=React.createContext({transformPagePoint:t=>t,isStatic:!1,reducedMotion:"never"}),MotionContext=React.createContext({}),PresenceContext=React.createContext(null),isBrowser=typeof document<"u",useIsomorphicLayoutEffect$1=isBrowser?React.useLayoutEffect:React.useEffect,LazyContext=React.createContext({strict:!1}),camelToDash=t=>t.replace(/([a-z])([A-Z])/gu,"$1-$2").toLowerCase(),optimizedAppearDataId="framerAppearId",optimizedAppearDataAttribute="data-"+camelToDash(optimizedAppearDataId),MotionGlobalConfig={skipAnimations:!1,useManualTiming:!1};class Queue{constructor(){this.order=[],this.scheduled=new Set}add(n){if(!this.scheduled.has(n))return this.scheduled.add(n),this.order.push(n),!0}remove(n){const o=this.order.indexOf(n);o!==-1&&(this.order.splice(o,1),this.scheduled.delete(n))}clear(){this.order.length=0,this.scheduled.clear()}}function createRenderStep(t){let n=new Queue,o=new Queue,s=0,c=!1,d=!1;const h=new WeakSet,p={schedule:(y,E=!1,L=!1)=>{const F=L&&c,N=F?n:o;return E&&h.add(y),N.add(y)&&F&&c&&(s=n.order.length),y},cancel:y=>{o.remove(y),h.delete(y)},process:y=>{if(c){d=!0;return}if(c=!0,[n,o]=[o,n],o.clear(),s=n.order.length,s)for(let E=0;E<s;E++){const L=n.order[E];h.has(L)&&(p.schedule(L),t()),L(y)}c=!1,d&&(d=!1,p.process(y))}};return p}const stepsOrder=["read","resolveKeyframes","update","preRender","render","postRender"],maxElapsed=40;function createRenderBatcher(t,n){let o=!1,s=!0;const c={delta:0,timestamp:0,isProcessing:!1},d=stepsOrder.reduce((F,N)=>(F[N]=createRenderStep(()=>o=!0),F),{}),h=F=>{d[F].process(c)},p=()=>{const F=performance.now();o=!1,c.delta=s?1e3/60:Math.max(Math.min(F-c.timestamp,maxElapsed),1),c.timestamp=F,c.isProcessing=!0,stepsOrder.forEach(h),c.isProcessing=!1,o&&n&&(s=!1,t(p))},y=()=>{o=!0,s=!0,c.isProcessing||t(p)};return{schedule:stepsOrder.reduce((F,N)=>{const z=d[N];return F[N]=(oe,W=!1,nt=!1)=>(o||y(),z.schedule(oe,W,nt)),F},{}),cancel:F=>stepsOrder.forEach(N=>d[N].cancel(F)),state:c,steps:d}}const{schedule:microtask,cancel:cancelMicrotask}=createRenderBatcher(queueMicrotask,!1);function useVisualElement(t,n,o,s){const{visualElement:c}=React.useContext(MotionContext),d=React.useContext(LazyContext),h=React.useContext(PresenceContext),p=React.useContext(MotionConfigContext).reducedMotion,y=React.useRef();s=s||d.renderer,!y.current&&s&&(y.current=s(t,{visualState:n,parent:c,props:o,presenceContext:h,blockInitialAnimation:h?h.initial===!1:!1,reducedMotionConfig:p}));const E=y.current;React.useInsertionEffect(()=>{E&&E.update(o,h)});const L=React.useRef(!!(o[optimizedAppearDataAttribute]&&!window.HandoffComplete));return useIsomorphicLayoutEffect$1(()=>{E&&(microtask.postRender(E.render),L.current&&E.animationState&&E.animationState.animateChanges())}),React.useEffect(()=>{E&&(E.updateFeatures(),!L.current&&E.animationState&&E.animationState.animateChanges(),L.current&&(L.current=!1,window.HandoffComplete=!0))}),E}function isRefObject(t){return t&&typeof t=="object"&&Object.prototype.hasOwnProperty.call(t,"current")}function useMotionRef(t,n,o){return React.useCallback(s=>{s&&t.mount&&t.mount(s),n&&(s?n.mount(s):n.unmount()),o&&(typeof o=="function"?o(s):isRefObject(o)&&(o.current=s))},[n])}function isVariantLabel(t){return typeof t=="string"||Array.isArray(t)}function isAnimationControls(t){return t!==null&&typeof t=="object"&&typeof t.start=="function"}const variantPriorityOrder=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],variantProps=["initial",...variantPriorityOrder];function isControllingVariants(t){return isAnimationControls(t.animate)||variantProps.some(n=>isVariantLabel(t[n]))}function isVariantNode(t){return!!(isControllingVariants(t)||t.variants)}function getCurrentTreeVariants(t,n){if(isControllingVariants(t)){const{initial:o,animate:s}=t;return{initial:o===!1||isVariantLabel(o)?o:void 0,animate:isVariantLabel(s)?s:void 0}}return t.inherit!==!1?n:{}}function useCreateMotionContext(t){const{initial:n,animate:o}=getCurrentTreeVariants(t,React.useContext(MotionContext));return React.useMemo(()=>({initial:n,animate:o}),[variantLabelsAsDependency(n),variantLabelsAsDependency(o)])}function variantLabelsAsDependency(t){return Array.isArray(t)?t.join(" "):t}const featureProps={animation:["animate","variants","whileHover","whileTap","exit","whileInView","whileFocus","whileDrag"],exit:["exit"],drag:["drag","dragControls"],focus:["whileFocus"],hover:["whileHover","onHoverStart","onHoverEnd"],tap:["whileTap","onTap","onTapStart","onTapCancel"],pan:["onPan","onPanStart","onPanSessionStart","onPanEnd"],inView:["whileInView","onViewportEnter","onViewportLeave"],layout:["layout","layoutId"]},featureDefinitions={};for(const t in featureProps)featureDefinitions[t]={isEnabled:n=>featureProps[t].some(o=>!!n[o])};function loadFeatures(t){for(const n in t)featureDefinitions[n]={...featureDefinitions[n],...t[n]}}const LayoutGroupContext=React.createContext({}),SwitchLayoutGroupContext=React.createContext({}),motionComponentSymbol=Symbol.for("motionComponentSymbol");function createMotionComponent({preloadedFeatures:t,createVisualElement:n,useRender:o,useVisualState:s,Component:c}){t&&loadFeatures(t);function d(p,y){let E;const L={...React.useContext(MotionConfigContext),...p,layoutId:useLayoutId(p)},{isStatic:F}=L,N=useCreateMotionContext(p),z=s(p,F);if(!F&&isBrowser){N.visualElement=useVisualElement(c,z,L,n);const oe=React.useContext(SwitchLayoutGroupContext),W=React.useContext(LazyContext).strict;N.visualElement&&(E=N.visualElement.loadFeatures(L,W,t,oe))}return React__namespace.createElement(MotionContext.Provider,{value:N},E&&N.visualElement?React__namespace.createElement(E,{visualElement:N.visualElement,...L}):null,o(c,p,useMotionRef(z,N.visualElement,y),z,F,N.visualElement))}const h=React.forwardRef(d);return h[motionComponentSymbol]=c,h}function useLayoutId({layoutId:t}){const n=React.useContext(LayoutGroupContext).id;return n&&t!==void 0?n+"-"+t:t}function createMotionProxy(t){function n(s,c={}){return createMotionComponent(t(s,c))}if(typeof Proxy>"u")return n;const o=new Map;return new Proxy(n,{get:(s,c)=>(o.has(c)||o.set(c,n(c)),o.get(c))})}const lowercaseSVGElements=["animate","circle","defs","desc","ellipse","g","image","line","filter","marker","mask","metadata","path","pattern","polygon","polyline","rect","stop","switch","symbol","svg","text","tspan","use","view"];function isSVGComponent(t){return typeof t!="string"||t.includes("-")?!1:!!(lowercaseSVGElements.indexOf(t)>-1||/[A-Z]/u.test(t))}const scaleCorrectors={};function addScaleCorrector(t){Object.assign(scaleCorrectors,t)}const transformPropOrder=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],transformProps=new Set(transformPropOrder);function isForcedMotionValue(t,{layout:n,layoutId:o}){return transformProps.has(t)||t.startsWith("origin")||(n||o!==void 0)&&(!!scaleCorrectors[t]||t==="opacity")}const isMotionValue=t=>!!(t&&t.getVelocity),translateAlias={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},numTransforms=transformPropOrder.length;function buildTransform(t,{enableHardwareAcceleration:n=!0,allowTransformNone:o=!0},s,c){let d="";for(let h=0;h<numTransforms;h++){const p=transformPropOrder[h];if(t[p]!==void 0){const y=translateAlias[p]||p;d+=`${y}(${t[p]}) `}}return n&&!t.z&&(d+="translateZ(0)"),d=d.trim(),c?d=c(t,s?"":d):o&&s&&(d="none"),d}const checkStringStartsWith=t=>n=>typeof n=="string"&&n.startsWith(t),isCSSVariableName=checkStringStartsWith("--"),startsAsVariableToken=checkStringStartsWith("var(--"),isCSSVariableToken=t=>startsAsVariableToken(t)?singleCssVariableRegex.test(t.split("/*")[0].trim()):!1,singleCssVariableRegex=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu,getValueAsType=(t,n)=>n&&typeof t=="number"?n.transform(t):t,clamp=(t,n,o)=>o>n?n:o<t?t:o,number={test:t=>typeof t=="number",parse:parseFloat,transform:t=>t},alpha={...number,transform:t=>clamp(0,1,t)},scale={...number,default:1},sanitize=t=>Math.round(t*1e5)/1e5,floatRegex=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu,colorRegex=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu,singleColorRegex=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu;function isString$1(t){return typeof t=="string"}const createUnitType=t=>({test:n=>isString$1(n)&&n.endsWith(t)&&n.split(" ").length===1,parse:parseFloat,transform:n=>`${n}${t}`}),degrees=createUnitType("deg"),percent=createUnitType("%"),px=createUnitType("px"),vh=createUnitType("vh"),vw=createUnitType("vw"),progressPercentage={...percent,parse:t=>percent.parse(t)/100,transform:t=>percent.transform(t*100)},int={...number,transform:Math.round},numberValueTypes={borderWidth:px,borderTopWidth:px,borderRightWidth:px,borderBottomWidth:px,borderLeftWidth:px,borderRadius:px,radius:px,borderTopLeftRadius:px,borderTopRightRadius:px,borderBottomRightRadius:px,borderBottomLeftRadius:px,width:px,maxWidth:px,height:px,maxHeight:px,size:px,top:px,right:px,bottom:px,left:px,padding:px,paddingTop:px,paddingRight:px,paddingBottom:px,paddingLeft:px,margin:px,marginTop:px,marginRight:px,marginBottom:px,marginLeft:px,rotate:degrees,rotateX:degrees,rotateY:degrees,rotateZ:degrees,scale,scaleX:scale,scaleY:scale,scaleZ:scale,skew:degrees,skewX:degrees,skewY:degrees,distance:px,translateX:px,translateY:px,translateZ:px,x:px,y:px,z:px,perspective:px,transformPerspective:px,opacity:alpha,originX:progressPercentage,originY:progressPercentage,originZ:px,zIndex:int,backgroundPositionX:px,backgroundPositionY:px,fillOpacity:alpha,strokeOpacity:alpha,numOctaves:int};function buildHTMLStyles(t,n,o,s){const{style:c,vars:d,transform:h,transformOrigin:p}=t;let y=!1,E=!1,L=!0;for(const F in n){const N=n[F];if(isCSSVariableName(F)){d[F]=N;continue}const z=numberValueTypes[F],oe=getValueAsType(N,z);if(transformProps.has(F)){if(y=!0,h[F]=oe,!L)continue;N!==(z.default||0)&&(L=!1)}else F.startsWith("origin")?(E=!0,p[F]=oe):c[F]=oe}if(n.transform||(y||s?c.transform=buildTransform(t.transform,o,L,s):c.transform&&(c.transform="none")),E){const{originX:F="50%",originY:N="50%",originZ:z=0}=p;c.transformOrigin=`${F} ${N} ${z}`}}const createHtmlRenderState=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function copyRawValuesOnly(t,n,o){for(const s in n)!isMotionValue(n[s])&&!isForcedMotionValue(s,o)&&(t[s]=n[s])}function useInitialMotionValues({transformTemplate:t},n,o){return React.useMemo(()=>{const s=createHtmlRenderState();return buildHTMLStyles(s,n,{enableHardwareAcceleration:!o},t),Object.assign({},s.vars,s.style)},[n])}function useStyle(t,n,o){const s=t.style||{},c={};return copyRawValuesOnly(c,s,t),Object.assign(c,useInitialMotionValues(t,n,o)),c}function useHTMLProps(t,n,o){const s={},c=useStyle(t,n,o);return t.drag&&t.dragListener!==!1&&(s.draggable=!1,c.userSelect=c.WebkitUserSelect=c.WebkitTouchCallout="none",c.touchAction=t.drag===!0?"none":`pan-${t.drag==="x"?"y":"x"}`),t.tabIndex===void 0&&(t.onTap||t.onTapStart||t.whileTap)&&(s.tabIndex=0),s.style=c,s}const validMotionProps=new Set(["animate","exit","variants","initial","style","values","variants","transition","transformTemplate","custom","inherit","onBeforeLayoutMeasure","onAnimationStart","onAnimationComplete","onUpdate","onDragStart","onDrag","onDragEnd","onMeasureDragConstraints","onDirectionLock","onDragTransitionEnd","_dragX","_dragY","onHoverStart","onHoverEnd","onViewportEnter","onViewportLeave","globalTapTarget","ignoreStrict","viewport"]);function isValidMotionProp(t){return t.startsWith("while")||t.startsWith("drag")&&t!=="draggable"||t.startsWith("layout")||t.startsWith("onTap")||t.startsWith("onPan")||t.startsWith("onLayout")||validMotionProps.has(t)}let shouldForward=t=>!isValidMotionProp(t);function loadExternalIsValidProp(t){t&&(shouldForward=n=>n.startsWith("on")?!isValidMotionProp(n):t(n))}try{loadExternalIsValidProp(require("@emotion/is-prop-valid").default)}catch(t){}function filterProps(t,n,o){const s={};for(const c in t)c==="values"&&typeof t.values=="object"||(shouldForward(c)||o===!0&&isValidMotionProp(c)||!n&&!isValidMotionProp(c)||t.draggable&&c.startsWith("onDrag"))&&(s[c]=t[c]);return s}function calcOrigin$1(t,n,o){return typeof t=="string"?t:px.transform(n+o*t)}function calcSVGTransformOrigin(t,n,o){const s=calcOrigin$1(n,t.x,t.width),c=calcOrigin$1(o,t.y,t.height);return`${s} ${c}`}const dashKeys={offset:"stroke-dashoffset",array:"stroke-dasharray"},camelKeys={offset:"strokeDashoffset",array:"strokeDasharray"};function buildSVGPath(t,n,o=1,s=0,c=!0){t.pathLength=1;const d=c?dashKeys:camelKeys;t[d.offset]=px.transform(-s);const h=px.transform(n),p=px.transform(o);t[d.array]=`${h} ${p}`}function buildSVGAttrs(t,{attrX:n,attrY:o,attrScale:s,originX:c,originY:d,pathLength:h,pathSpacing:p=1,pathOffset:y=0,...E},L,F,N){if(buildHTMLStyles(t,E,L,N),F){t.style.viewBox&&(t.attrs.viewBox=t.style.viewBox);return}t.attrs=t.style,t.style={};const{attrs:z,style:oe,dimensions:W}=t;z.transform&&(W&&(oe.transform=z.transform),delete z.transform),W&&(c!==void 0||d!==void 0||oe.transform)&&(oe.transformOrigin=calcSVGTransformOrigin(W,c!==void 0?c:.5,d!==void 0?d:.5)),n!==void 0&&(z.x=n),o!==void 0&&(z.y=o),s!==void 0&&(z.scale=s),h!==void 0&&buildSVGPath(z,h,p,y,!1)}const createSvgRenderState=()=>({...createHtmlRenderState(),attrs:{}}),isSVGTag=t=>typeof t=="string"&&t.toLowerCase()==="svg";function useSVGProps(t,n,o,s){const c=React.useMemo(()=>{const d=createSvgRenderState();return buildSVGAttrs(d,n,{enableHardwareAcceleration:!1},isSVGTag(s),t.transformTemplate),{...d.attrs,style:{...d.style}}},[n]);if(t.style){const d={};copyRawValuesOnly(d,t.style,t),c.style={...d,...c.style}}return c}function createUseRender(t=!1){return(o,s,c,{latestValues:d},h)=>{const y=(isSVGComponent(o)?useSVGProps:useHTMLProps)(s,d,h,o),E=filterProps(s,typeof o=="string",t),L=o!==React.Fragment?{...E,...y,ref:c}:{},{children:F}=s,N=React.useMemo(()=>isMotionValue(F)?F.get():F,[F]);return React.createElement(o,{...L,children:N})}}function renderHTML(t,{style:n,vars:o},s,c){Object.assign(t.style,n,c&&c.getProjectionStyles(s));for(const d in o)t.style.setProperty(d,o[d])}const camelCaseAttributes=new Set(["baseFrequency","diffuseConstant","kernelMatrix","kernelUnitLength","keySplines","keyTimes","limitingConeAngle","markerHeight","markerWidth","numOctaves","targetX","targetY","surfaceScale","specularConstant","specularExponent","stdDeviation","tableValues","viewBox","gradientTransform","pathLength","startOffset","textLength","lengthAdjust"]);function renderSVG(t,n,o,s){renderHTML(t,n,void 0,s);for(const c in n.attrs)t.setAttribute(camelCaseAttributes.has(c)?c:camelToDash(c),n.attrs[c])}function scrapeMotionValuesFromProps$1(t,n,o){var s;const{style:c}=t,d={};for(const h in c)(isMotionValue(c[h])||n.style&&isMotionValue(n.style[h])||isForcedMotionValue(h,t)||((s=o==null?void 0:o.getValue(h))===null||s===void 0?void 0:s.liveStyle)!==void 0)&&(d[h]=c[h]);return d}function scrapeMotionValuesFromProps(t,n,o){const s=scrapeMotionValuesFromProps$1(t,n,o);for(const c in t)if(isMotionValue(t[c])||isMotionValue(n[c])){const d=transformPropOrder.indexOf(c)!==-1?"attr"+c.charAt(0).toUpperCase()+c.substring(1):c;s[d]=t[c]}return s}function resolveVariantFromProps(t,n,o,s={},c={}){return typeof n=="function"&&(n=n(o!==void 0?o:t.custom,s,c)),typeof n=="string"&&(n=t.variants&&t.variants[n]),typeof n=="function"&&(n=n(o!==void 0?o:t.custom,s,c)),n}function useConstant(t){const n=React.useRef(null);return n.current===null&&(n.current=t()),n.current}const isKeyframesTarget=t=>Array.isArray(t),isCustomValue=t=>!!(t&&typeof t=="object"&&t.mix&&t.toValue),resolveFinalValueInKeyframes=t=>isKeyframesTarget(t)?t[t.length-1]||0:t;function resolveMotionValue(t){const n=isMotionValue(t)?t.get():t;return isCustomValue(n)?n.toValue():n}function makeState({scrapeMotionValuesFromProps:t,createRenderState:n,onMount:o},s,c,d){const h={latestValues:makeLatestValues(s,c,d,t),renderState:n()};return o&&(h.mount=p=>o(s,p,h)),h}const makeUseVisualState=t=>(n,o)=>{const s=React.useContext(MotionContext),c=React.useContext(PresenceContext),d=()=>makeState(t,n,s,c);return o?d():useConstant(d)};function makeLatestValues(t,n,o,s){const c={},d=s(t,{});for(const N in d)c[N]=resolveMotionValue(d[N]);let{initial:h,animate:p}=t;const y=isControllingVariants(t),E=isVariantNode(t);n&&E&&!y&&t.inherit!==!1&&(h===void 0&&(h=n.initial),p===void 0&&(p=n.animate));let L=o?o.initial===!1:!1;L=L||h===!1;const F=L?p:h;return F&&typeof F!="boolean"&&!isAnimationControls(F)&&(Array.isArray(F)?F:[F]).forEach(z=>{const oe=resolveVariantFromProps(t,z);if(!oe)return;const{transitionEnd:W,transition:nt,...lt}=oe;for(const Ee in lt){let yt=lt[Ee];if(Array.isArray(yt)){const Ai=L?yt.length-1:0;yt=yt[Ai]}yt!==null&&(c[Ee]=yt)}for(const Ee in W)c[Ee]=W[Ee]}),c}const noop$1=t=>t,{schedule:frame,cancel:cancelFrame,state:frameData,steps}=createRenderBatcher(typeof requestAnimationFrame<"u"?requestAnimationFrame:noop$1,!0),svgMotionConfig={useVisualState:makeUseVisualState({scrapeMotionValuesFromProps,createRenderState:createSvgRenderState,onMount:(t,n,{renderState:o,latestValues:s})=>{frame.read(()=>{try{o.dimensions=typeof n.getBBox=="function"?n.getBBox():n.getBoundingClientRect()}catch{o.dimensions={x:0,y:0,width:0,height:0}}}),frame.render(()=>{buildSVGAttrs(o,s,{enableHardwareAcceleration:!1},isSVGTag(n.tagName),t.transformTemplate),renderSVG(n,o)})}})},htmlMotionConfig={useVisualState:makeUseVisualState({scrapeMotionValuesFromProps:scrapeMotionValuesFromProps$1,createRenderState:createHtmlRenderState})};function createDomMotionConfig(t,{forwardMotionProps:n=!1},o,s){return{...isSVGComponent(t)?svgMotionConfig:htmlMotionConfig,preloadedFeatures:o,useRender:createUseRender(n),createVisualElement:s,Component:t}}function addDomEvent(t,n,o,s={passive:!0}){return t.addEventListener(n,o,s),()=>t.removeEventListener(n,o)}const isPrimaryPointer=t=>t.pointerType==="mouse"?typeof t.button!="number"||t.button<=0:t.isPrimary!==!1;function extractEventInfo(t,n="page"){return{point:{x:t[n+"X"],y:t[n+"Y"]}}}const addPointerInfo=t=>n=>isPrimaryPointer(n)&&t(n,extractEventInfo(n));function addPointerEvent(t,n,o,s){return addDomEvent(t,n,addPointerInfo(o),s)}const combineFunctions=(t,n)=>o=>n(t(o)),pipe=(...t)=>t.reduce(combineFunctions);function createLock(t){let n=null;return()=>{const o=()=>{n=null};return n===null?(n=t,o):!1}}const globalHorizontalLock=createLock("dragHorizontal"),globalVerticalLock=createLock("dragVertical");function getGlobalLock(t){let n=!1;if(t==="y")n=globalVerticalLock();else if(t==="x")n=globalHorizontalLock();else{const o=globalHorizontalLock(),s=globalVerticalLock();o&&s?n=()=>{o(),s()}:(o&&o(),s&&s())}return n}function isDragActive(){const t=getGlobalLock(!0);return t?(t(),!1):!0}class Feature{constructor(n){this.isMounted=!1,this.node=n}update(){}}function addHoverEvent(t,n){const o="pointer"+(n?"enter":"leave"),s="onHover"+(n?"Start":"End"),c=(d,h)=>{if(d.pointerType==="touch"||isDragActive())return;const p=t.getProps();t.animationState&&p.whileHover&&t.animationState.setActive("whileHover",n),p[s]&&p[s](d,h)};return addPointerEvent(t.current,o,c,{passive:!t.getProps()[s]})}class HoverGesture extends Feature{mount(){this.unmount=pipe(addHoverEvent(this.node,!0),addHoverEvent(this.node,!1))}unmount(){}}class FocusGesture extends Feature{constructor(){super(...arguments),this.isActive=!1}onFocus(){let n=!1;try{n=this.node.current.matches(":focus-visible")}catch{n=!0}!n||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!0),this.isActive=!0)}onBlur(){!this.isActive||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!1),this.isActive=!1)}mount(){this.unmount=pipe(addDomEvent(this.node.current,"focus",()=>this.onFocus()),addDomEvent(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}const isNodeOrChild=(t,n)=>n?t===n?!0:isNodeOrChild(t,n.parentElement):!1;function fireSyntheticPointerEvent(t,n){if(!n)return;const o=new PointerEvent("pointer"+t);n(o,extractEventInfo(o))}class PressGesture extends Feature{constructor(){super(...arguments),this.removeStartListeners=noop$1,this.removeEndListeners=noop$1,this.removeAccessibleListeners=noop$1,this.startPointerPress=(n,o)=>{if(this.isPressing)return;this.removeEndListeners();const s=this.node.getProps(),d=addPointerEvent(window,"pointerup",(p,y)=>{if(!this.checkPressEnd())return;const{onTap:E,onTapCancel:L,globalTapTarget:F}=this.node.getProps();!F&&!isNodeOrChild(this.node.current,p.target)?L&&L(p,y):E&&E(p,y)},{passive:!(s.onTap||s.onPointerUp)}),h=addPointerEvent(window,"pointercancel",(p,y)=>this.cancelPress(p,y),{passive:!(s.onTapCancel||s.onPointerCancel)});this.removeEndListeners=pipe(d,h),this.startPress(n,o)},this.startAccessiblePress=()=>{const n=d=>{if(d.key!=="Enter"||this.isPressing)return;const h=p=>{p.key!=="Enter"||!this.checkPressEnd()||fireSyntheticPointerEvent("up",(y,E)=>{const{onTap:L}=this.node.getProps();L&&L(y,E)})};this.removeEndListeners(),this.removeEndListeners=addDomEvent(this.node.current,"keyup",h),fireSyntheticPointerEvent("down",(p,y)=>{this.startPress(p,y)})},o=addDomEvent(this.node.current,"keydown",n),s=()=>{this.isPressing&&fireSyntheticPointerEvent("cancel",(d,h)=>this.cancelPress(d,h))},c=addDomEvent(this.node.current,"blur",s);this.removeAccessibleListeners=pipe(o,c)}}startPress(n,o){this.isPressing=!0;const{onTapStart:s,whileTap:c}=this.node.getProps();c&&this.node.animationState&&this.node.animationState.setActive("whileTap",!0),s&&s(n,o)}checkPressEnd(){return this.removeEndListeners(),this.isPressing=!1,this.node.getProps().whileTap&&this.node.animationState&&this.node.animationState.setActive("whileTap",!1),!isDragActive()}cancelPress(n,o){if(!this.checkPressEnd())return;const{onTapCancel:s}=this.node.getProps();s&&s(n,o)}mount(){const n=this.node.getProps(),o=addPointerEvent(n.globalTapTarget?window:this.node.current,"pointerdown",this.startPointerPress,{passive:!(n.onTapStart||n.onPointerStart)}),s=addDomEvent(this.node.current,"focus",this.startAccessiblePress);this.removeStartListeners=pipe(o,s)}unmount(){this.removeStartListeners(),this.removeEndListeners(),this.removeAccessibleListeners()}}const observerCallbacks=new WeakMap,observers=new WeakMap,fireObserverCallback=t=>{const n=observerCallbacks.get(t.target);n&&n(t)},fireAllObserverCallbacks=t=>{t.forEach(fireObserverCallback)};function initIntersectionObserver({root:t,...n}){const o=t||document;observers.has(o)||observers.set(o,{});const s=observers.get(o),c=JSON.stringify(n);return s[c]||(s[c]=new IntersectionObserver(fireAllObserverCallbacks,{root:t,...n})),s[c]}function observeIntersection(t,n,o){const s=initIntersectionObserver(n);return observerCallbacks.set(t,o),s.observe(t),()=>{observerCallbacks.delete(t),s.unobserve(t)}}const thresholdNames={some:0,all:1};class InViewFeature extends Feature{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.unmount();const{viewport:n={}}=this.node.getProps(),{root:o,margin:s,amount:c="some",once:d}=n,h={root:o?o.current:void 0,rootMargin:s,threshold:typeof c=="number"?c:thresholdNames[c]},p=y=>{const{isIntersecting:E}=y;if(this.isInView===E||(this.isInView=E,d&&!E&&this.hasEnteredView))return;E&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",E);const{onViewportEnter:L,onViewportLeave:F}=this.node.getProps(),N=E?L:F;N&&N(y)};return observeIntersection(this.node.current,h,p)}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>"u")return;const{props:n,prevProps:o}=this.node;["amount","margin","root"].some(hasViewportOptionChanged(n,o))&&this.startObserver()}unmount(){}}function hasViewportOptionChanged({viewport:t={}},{viewport:n={}}={}){return o=>t[o]!==n[o]}const gestureAnimations={inView:{Feature:InViewFeature},tap:{Feature:PressGesture},focus:{Feature:FocusGesture},hover:{Feature:HoverGesture}};function shallowCompare(t,n){if(!Array.isArray(n))return!1;const o=n.length;if(o!==t.length)return!1;for(let s=0;s<o;s++)if(n[s]!==t[s])return!1;return!0}function getCurrent(t){const n={};return t.values.forEach((o,s)=>n[s]=o.get()),n}function getVelocity$1(t){const n={};return t.values.forEach((o,s)=>n[s]=o.getVelocity()),n}function resolveVariant(t,n,o){const s=t.getProps();return resolveVariantFromProps(s,n,o!==void 0?o:s.custom,getCurrent(t),getVelocity$1(t))}const secondsToMilliseconds=t=>t*1e3,millisecondsToSeconds=t=>t/1e3,underDampedSpring={type:"spring",stiffness:500,damping:25,restSpeed:10},criticallyDampedSpring=t=>({type:"spring",stiffness:550,damping:t===0?2*Math.sqrt(550):30,restSpeed:10}),keyframesTransition={type:"keyframes",duration:.8},ease={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},getDefaultTransition=(t,{keyframes:n})=>n.length>2?keyframesTransition:transformProps.has(t)?t.startsWith("scale")?criticallyDampedSpring(n[1]):underDampedSpring:ease;function isTransitionDefined({when:t,delay:n,delayChildren:o,staggerChildren:s,staggerDirection:c,repeat:d,repeatType:h,repeatDelay:p,from:y,elapsed:E,...L}){return!!Object.keys(L).length}function getValueTransition(t,n){return t[n]||t.default||t}const isNotNull=t=>t!==null;function getFinalKeyframe(t,{repeat:n,repeatType:o="loop"},s){const c=t.filter(isNotNull),d=n&&o!=="loop"&&n%2===1?0:c.length-1;return!d||s===void 0?c[d]:s}let now;function clearTime(){now=void 0}const time={now:()=>(now===void 0&&time.set(frameData.isProcessing||MotionGlobalConfig.useManualTiming?frameData.timestamp:performance.now()),now),set:t=>{now=t,queueMicrotask(clearTime)}},isZeroValueString=t=>/^0[^.\s]+$/u.test(t);function isNone(t){return typeof t=="number"?t===0:t!==null?t==="none"||t==="0"||isZeroValueString(t):!0}let warning=noop$1,invariant=noop$1;process.env.NODE_ENV!=="production"&&(warning=(t,n)=>{!t&&typeof console<"u"&&console.warn(n)},invariant=(t,n)=>{if(!t)throw new Error(n)});const isNumericalString=t=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(t),splitCSSVariableRegex=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function parseCSSVariable(t){const n=splitCSSVariableRegex.exec(t);if(!n)return[,];const[,o,s,c]=n;return[`--${o??s}`,c]}const maxDepth=4;function getVariableValue(t,n,o=1){invariant(o<=maxDepth,`Max CSS variable fallback depth detected in property "${t}". This may indicate a circular fallback dependency.`);const[s,c]=parseCSSVariable(t);if(!s)return;const d=window.getComputedStyle(n).getPropertyValue(s);if(d){const h=d.trim();return isNumericalString(h)?parseFloat(h):h}return isCSSVariableToken(c)?getVariableValue(c,n,o+1):c}const positionalKeys=new Set(["width","height","top","left","right","bottom","x","y","translateX","translateY"]),isNumOrPxType=t=>t===number||t===px,getPosFromMatrix=(t,n)=>parseFloat(t.split(", ")[n]),getTranslateFromMatrix=(t,n)=>(o,{transform:s})=>{if(s==="none"||!s)return 0;const c=s.match(/^matrix3d\((.+)\)$/u);if(c)return getPosFromMatrix(c[1],n);{const d=s.match(/^matrix\((.+)\)$/u);return d?getPosFromMatrix(d[1],t):0}},transformKeys=new Set(["x","y","z"]),nonTranslationalTransformKeys=transformPropOrder.filter(t=>!transformKeys.has(t));function removeNonTranslationalTransform(t){const n=[];return nonTranslationalTransformKeys.forEach(o=>{const s=t.getValue(o);s!==void 0&&(n.push([o,s.get()]),s.set(o.startsWith("scale")?1:0))}),n}const positionalValues={width:({x:t},{paddingLeft:n="0",paddingRight:o="0"})=>t.max-t.min-parseFloat(n)-parseFloat(o),height:({y:t},{paddingTop:n="0",paddingBottom:o="0"})=>t.max-t.min-parseFloat(n)-parseFloat(o),top:(t,{top:n})=>parseFloat(n),left:(t,{left:n})=>parseFloat(n),bottom:({y:t},{top:n})=>parseFloat(n)+(t.max-t.min),right:({x:t},{left:n})=>parseFloat(n)+(t.max-t.min),x:getTranslateFromMatrix(4,13),y:getTranslateFromMatrix(5,14)};positionalValues.translateX=positionalValues.x,positionalValues.translateY=positionalValues.y;const testValueType=t=>n=>n.test(t),auto={test:t=>t==="auto",parse:t=>t},dimensionValueTypes=[number,px,percent,degrees,vw,vh,auto],findDimensionValueType=t=>dimensionValueTypes.find(testValueType(t)),toResolve=new Set;let isScheduled=!1,anyNeedsMeasurement=!1;function measureAllKeyframes(){if(anyNeedsMeasurement){const t=Array.from(toResolve).filter(s=>s.needsMeasurement),n=new Set(t.map(s=>s.element)),o=new Map;n.forEach(s=>{removeNonTranslationalTransform(s).length&&(o.set(s,removeNonTranslationalTransform(s)),s.render())}),t.forEach(s=>s.measureInitialState()),n.forEach(s=>{s.render()}),t.forEach(s=>s.measureEndState()),t.forEach(s=>{s.suspendedScrollY!==void 0&&window.scrollTo(0,s.suspendedScrollY)})}anyNeedsMeasurement=!1,isScheduled=!1,toResolve.forEach(t=>t.complete()),toResolve.clear()}function readAllKeyframes(){toResolve.forEach(t=>{t.readKeyframes(),t.needsMeasurement&&(anyNeedsMeasurement=!0)})}function flushKeyframeResolvers(){readAllKeyframes(),measureAllKeyframes()}class KeyframeResolver{constructor(n,o,s,c,d,h=!1){this.isComplete=!1,this.isAsync=!1,this.needsMeasurement=!1,this.isScheduled=!1,this.unresolvedKeyframes=[...n],this.onComplete=o,this.name=s,this.motionValue=c,this.element=d,this.isAsync=h}scheduleResolve(){this.isScheduled=!0,this.isAsync?(toResolve.add(this),isScheduled||(isScheduled=!0,frame.read(readAllKeyframes),frame.resolveKeyframes(measureAllKeyframes))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:n,name:o,element:s,motionValue:c}=this;for(let d=0;d<n.length;d++)if(n[d]===null)if(d===0){const h=c==null?void 0:c.get(),p=n[n.length-1];if(h!==void 0)n[0]=h;else if(s&&o){const y=s.readValue(o,p);y!=null&&(n[0]=y)}n[0]===void 0&&(n[0]=p),c&&h===void 0&&c.set(n[0])}else n[d]=n[d-1]}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(){this.isComplete=!0,this.onComplete(this.unresolvedKeyframes,this.finalKeyframe),toResolve.delete(this)}cancel(){this.isComplete||(this.isScheduled=!1,toResolve.delete(this))}resume(){this.isComplete||this.scheduleResolve()}}const isColorString=(t,n)=>o=>!!(isString$1(o)&&singleColorRegex.test(o)&&o.startsWith(t)||n&&Object.prototype.hasOwnProperty.call(o,n)),splitColor=(t,n,o)=>s=>{if(!isString$1(s))return s;const[c,d,h,p]=s.match(floatRegex);return{[t]:parseFloat(c),[n]:parseFloat(d),[o]:parseFloat(h),alpha:p!==void 0?parseFloat(p):1}},clampRgbUnit=t=>clamp(0,255,t),rgbUnit={...number,transform:t=>Math.round(clampRgbUnit(t))},rgba={test:isColorString("rgb","red"),parse:splitColor("red","green","blue"),transform:({red:t,green:n,blue:o,alpha:s=1})=>"rgba("+rgbUnit.transform(t)+", "+rgbUnit.transform(n)+", "+rgbUnit.transform(o)+", "+sanitize(alpha.transform(s))+")"};function parseHex(t){let n="",o="",s="",c="";return t.length>5?(n=t.substring(1,3),o=t.substring(3,5),s=t.substring(5,7),c=t.substring(7,9)):(n=t.substring(1,2),o=t.substring(2,3),s=t.substring(3,4),c=t.substring(4,5),n+=n,o+=o,s+=s,c+=c),{red:parseInt(n,16),green:parseInt(o,16),blue:parseInt(s,16),alpha:c?parseInt(c,16)/255:1}}const hex={test:isColorString("#"),parse:parseHex,transform:rgba.transform},hsla={test:isColorString("hsl","hue"),parse:splitColor("hue","saturation","lightness"),transform:({hue:t,saturation:n,lightness:o,alpha:s=1})=>"hsla("+Math.round(t)+", "+percent.transform(sanitize(n))+", "+percent.transform(sanitize(o))+", "+sanitize(alpha.transform(s))+")"},color={test:t=>rgba.test(t)||hex.test(t)||hsla.test(t),parse:t=>rgba.test(t)?rgba.parse(t):hsla.test(t)?hsla.parse(t):hex.parse(t),transform:t=>isString$1(t)?t:t.hasOwnProperty("red")?rgba.transform(t):hsla.transform(t)};function test(t){var n,o;return isNaN(t)&&isString$1(t)&&(((n=t.match(floatRegex))===null||n===void 0?void 0:n.length)||0)+(((o=t.match(colorRegex))===null||o===void 0?void 0:o.length)||0)>0}const NUMBER_TOKEN="number",COLOR_TOKEN="color",VAR_TOKEN="var",VAR_FUNCTION_TOKEN="var(",SPLIT_TOKEN="${}",complexRegex=/var\s*\(\s*--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)|#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\)|-?(?:\d+(?:\.\d+)?|\.\d+)/giu;function analyseComplexValue(t){const n=t.toString(),o=[],s={color:[],number:[],var:[]},c=[];let d=0;const p=n.replace(complexRegex,y=>(color.test(y)?(s.color.push(d),c.push(COLOR_TOKEN),o.push(color.parse(y))):y.startsWith(VAR_FUNCTION_TOKEN)?(s.var.push(d),c.push(VAR_TOKEN),o.push(y)):(s.number.push(d),c.push(NUMBER_TOKEN),o.push(parseFloat(y))),++d,SPLIT_TOKEN)).split(SPLIT_TOKEN);return{values:o,split:p,indexes:s,types:c}}function parseComplexValue(t){return analyseComplexValue(t).values}function createTransformer(t){const{split:n,types:o}=analyseComplexValue(t),s=n.length;return c=>{let d="";for(let h=0;h<s;h++)if(d+=n[h],c[h]!==void 0){const p=o[h];p===NUMBER_TOKEN?d+=sanitize(c[h]):p===COLOR_TOKEN?d+=color.transform(c[h]):d+=c[h]}return d}}const convertNumbersToZero=t=>typeof t=="number"?0:t;function getAnimatableNone$1(t){const n=parseComplexValue(t);return createTransformer(t)(n.map(convertNumbersToZero))}const complex={test,parse:parseComplexValue,createTransformer,getAnimatableNone:getAnimatableNone$1},maxDefaults=new Set(["brightness","contrast","saturate","opacity"]);function applyDefaultFilter(t){const[n,o]=t.slice(0,-1).split("(");if(n==="drop-shadow")return t;const[s]=o.match(floatRegex)||[];if(!s)return t;const c=o.replace(s,"");let d=maxDefaults.has(n)?1:0;return s!==o&&(d*=100),n+"("+d+c+")"}const functionRegex=/\b([a-z-]*)\(.*?\)/gu,filter={...complex,getAnimatableNone:t=>{const n=t.match(functionRegex);return n?n.map(applyDefaultFilter).join(" "):t}},defaultValueTypes={...numberValueTypes,color,backgroundColor:color,outlineColor:color,fill:color,stroke:color,borderColor:color,borderTopColor:color,borderRightColor:color,borderBottomColor:color,borderLeftColor:color,filter,WebkitFilter:filter},getDefaultValueType=t=>defaultValueTypes[t];function getAnimatableNone(t,n){let o=getDefaultValueType(t);return o!==filter&&(o=complex),o.getAnimatableNone?o.getAnimatableNone(n):void 0}function makeNoneKeyframesAnimatable(t,n,o){let s=0,c;for(;s<t.length&&!c;)typeof t[s]=="string"&&t[s]!=="none"&&t[s]!=="0"&&(c=t[s]),s++;if(c&&o)for(const d of n)t[d]=getAnimatableNone(o,c)}class DOMKeyframesResolver extends KeyframeResolver{constructor(n,o,s,c){super(n,o,s,c,c==null?void 0:c.owner,!0)}readKeyframes(){const{unresolvedKeyframes:n,element:o,name:s}=this;if(!o.current)return;super.readKeyframes();for(let y=0;y<n.length;y++){const E=n[y];if(typeof E=="string"&&isCSSVariableToken(E)){const L=getVariableValue(E,o.current);L!==void 0&&(n[y]=L)}}if(!positionalKeys.has(s)||n.length!==2)return this.resolveNoneKeyframes();const[c,d]=n,h=findDimensionValueType(c),p=findDimensionValueType(d);if(h!==p)if(isNumOrPxType(h)&&isNumOrPxType(p))for(let y=0;y<n.length;y++){const E=n[y];typeof E=="string"&&(n[y]=parseFloat(E))}else this.needsMeasurement=!0}resolveNoneKeyframes(){const{unresolvedKeyframes:n,name:o}=this,s=[];for(let c=0;c<n.length;c++)isNone(n[c])&&s.push(c);s.length&&makeNoneKeyframesAnimatable(n,s,o)}measureInitialState(){const{element:n,unresolvedKeyframes:o,name:s}=this;if(!n.current)return;s==="height"&&(this.suspendedScrollY=window.pageYOffset),this.measuredOrigin=positionalValues[s](n.measureViewportBox(),window.getComputedStyle(n.current)),o[0]=this.measuredOrigin;const c=o[o.length-1];c!==void 0&&n.getValue(s,c).jump(c,!1)}measureEndState(){var n;const{element:o,name:s,unresolvedKeyframes:c}=this;if(!o.current)return;const d=o.getValue(s);d&&d.jump(this.measuredOrigin,!1);const h=c.length-1,p=c[h];c[h]=positionalValues[s](o.measureViewportBox(),window.getComputedStyle(o.current)),p!==null&&(this.finalKeyframe=p),!((n=this.removedTransforms)===null||n===void 0)&&n.length&&this.removedTransforms.forEach(([y,E])=>{o.getValue(y).set(E)}),this.resolveNoneKeyframes()}}function memo(t){let n;return()=>(n===void 0&&(n=t()),n)}const isAnimatable=(t,n)=>n==="zIndex"?!1:!!(typeof t=="number"||Array.isArray(t)||typeof t=="string"&&(complex.test(t)||t==="0")&&!t.startsWith("url("));function hasKeyframesChanged(t){const n=t[0];if(t.length===1)return!0;for(let o=0;o<t.length;o++)if(t[o]!==n)return!0}function canAnimate(t,n,o,s){const c=t[0];if(c===null)return!1;const d=t[t.length-1],h=isAnimatable(c,n),p=isAnimatable(d,n);return warning(h===p,`You are trying to animate ${n} from "${c}" to "${d}". ${c} is not an animatable value - to enable this animation set ${c} to a value animatable to ${d} via the \`style\` property.`),!h||!p?!1:hasKeyframesChanged(t)||o==="spring"&&s}class BaseAnimation{constructor({autoplay:n=!0,delay:o=0,type:s="keyframes",repeat:c=0,repeatDelay:d=0,repeatType:h="loop",...p}){this.isStopped=!1,this.hasAttemptedResolve=!1,this.options={autoplay:n,delay:o,type:s,repeat:c,repeatDelay:d,repeatType:h,...p},this.updateFinishedPromise()}get resolved(){return!this._resolved&&!this.hasAttemptedResolve&&flushKeyframeResolvers(),this._resolved}onKeyframesResolved(n,o){this.hasAttemptedResolve=!0;const{name:s,type:c,velocity:d,delay:h,onComplete:p,onUpdate:y,isGenerator:E}=this.options;if(!E&&!canAnimate(n,s,c,d))if(h)this.options.duration=0;else{y==null||y(getFinalKeyframe(n,this.options,o)),p==null||p(),this.resolveFinishedPromise();return}const L=this.initPlayback(n,o);L!==!1&&(this._resolved={keyframes:n,finalKeyframe:o,...L},this.onPostResolved())}onPostResolved(){}then(n,o){return this.currentFinishedPromise.then(n,o)}updateFinishedPromise(){this.currentFinishedPromise=new Promise(n=>{this.resolveFinishedPromise=n})}}function velocityPerSecond(t,n){return n?t*(1e3/n):0}const velocitySampleDuration=5;function calcGeneratorVelocity(t,n,o){const s=Math.max(n-velocitySampleDuration,0);return velocityPerSecond(o-t(s),n-s)}const safeMin=.001,minDuration=.01,maxDuration$1=10,minDamping=.05,maxDamping=1;function findSpring({duration:t=800,bounce:n=.25,velocity:o=0,mass:s=1}){let c,d;warning(t<=secondsToMilliseconds(maxDuration$1),"Spring duration must be 10 seconds or less");let h=1-n;h=clamp(minDamping,maxDamping,h),t=clamp(minDuration,maxDuration$1,millisecondsToSeconds(t)),h<1?(c=E=>{const L=E*h,F=L*t,N=L-o,z=calcAngularFreq(E,h),oe=Math.exp(-F);return safeMin-N/z*oe},d=E=>{const F=E*h*t,N=F*o+o,z=Math.pow(h,2)*Math.pow(E,2)*t,oe=Math.exp(-F),W=calcAngularFreq(Math.pow(E,2),h);return(-c(E)+safeMin>0?-1:1)*((N-z)*oe)/W}):(c=E=>{const L=Math.exp(-E*t),F=(E-o)*t+1;return-safeMin+L*F},d=E=>{const L=Math.exp(-E*t),F=(o-E)*(t*t);return L*F});const p=5/t,y=approximateRoot(c,d,p);if(t=secondsToMilliseconds(t),isNaN(y))return{stiffness:100,damping:10,duration:t};{const E=Math.pow(y,2)*s;return{stiffness:E,damping:h*2*Math.sqrt(s*E),duration:t}}}const rootIterations=12;function approximateRoot(t,n,o){let s=o;for(let c=1;c<rootIterations;c++)s=s-t(s)/n(s);return s}function calcAngularFreq(t,n){return t*Math.sqrt(1-n*n)}const durationKeys=["duration","bounce"],physicsKeys=["stiffness","damping","mass"];function isSpringType(t,n){return n.some(o=>t[o]!==void 0)}function getSpringOptions(t){let n={velocity:0,stiffness:100,damping:10,mass:1,isResolvedFromDuration:!1,...t};if(!isSpringType(t,physicsKeys)&&isSpringType(t,durationKeys)){const o=findSpring(t);n={...n,...o,mass:1},n.isResolvedFromDuration=!0}return n}function spring({keyframes:t,restDelta:n,restSpeed:o,...s}){const c=t[0],d=t[t.length-1],h={done:!1,value:c},{stiffness:p,damping:y,mass:E,duration:L,velocity:F,isResolvedFromDuration:N}=getSpringOptions({...s,velocity:-millisecondsToSeconds(s.velocity||0)}),z=F||0,oe=y/(2*Math.sqrt(p*E)),W=d-c,nt=millisecondsToSeconds(Math.sqrt(p/E)),lt=Math.abs(W)<5;o||(o=lt?.01:2),n||(n=lt?.005:.5);let Ee;if(oe<1){const yt=calcAngularFreq(nt,oe);Ee=Ai=>{const zi=Math.exp(-oe*nt*Ai);return d-zi*((z+oe*nt*W)/yt*Math.sin(yt*Ai)+W*Math.cos(yt*Ai))}}else if(oe===1)Ee=yt=>d-Math.exp(-nt*yt)*(W+(z+nt*W)*yt);else{const yt=nt*Math.sqrt(oe*oe-1);Ee=Ai=>{const zi=Math.exp(-oe*nt*Ai),ha=Math.min(yt*Ai,300);return d-zi*((z+oe*nt*W)*Math.sinh(ha)+yt*W*Math.cosh(ha))/yt}}return{calculatedDuration:N&&L||null,next:yt=>{const Ai=Ee(yt);if(N)h.done=yt>=L;else{let zi=z;yt!==0&&(oe<1?zi=calcGeneratorVelocity(Ee,yt,Ai):zi=0);const ha=Math.abs(zi)<=o,ba=Math.abs(d-Ai)<=n;h.done=ha&&ba}return h.value=h.done?d:Ai,h}}}function inertia({keyframes:t,velocity:n=0,power:o=.8,timeConstant:s=325,bounceDamping:c=10,bounceStiffness:d=500,modifyTarget:h,min:p,max:y,restDelta:E=.5,restSpeed:L}){const F=t[0],N={done:!1,value:F},z=Sa=>p!==void 0&&Sa<p||y!==void 0&&Sa>y,oe=Sa=>p===void 0?y:y===void 0||Math.abs(p-Sa)<Math.abs(y-Sa)?p:y;let W=o*n;const nt=F+W,lt=h===void 0?nt:h(nt);lt!==nt&&(W=lt-F);const Ee=Sa=>-W*Math.exp(-Sa/s),yt=Sa=>lt+Ee(Sa),Ai=Sa=>{const ya=Ee(Sa),ms=yt(Sa);N.done=Math.abs(ya)<=E,N.value=N.done?lt:ms};let zi,ha;const ba=Sa=>{z(N.value)&&(zi=Sa,ha=spring({keyframes:[N.value,oe(N.value)],velocity:calcGeneratorVelocity(yt,Sa,N.value),damping:c,stiffness:d,restDelta:E,restSpeed:L}))};return ba(0),{calculatedDuration:null,next:Sa=>{let ya=!1;return!ha&&zi===void 0&&(ya=!0,Ai(Sa),ba(Sa)),zi!==void 0&&Sa>=zi?ha.next(Sa-zi):(!ya&&Ai(Sa),N)}}}const calcBezier=(t,n,o)=>(((1-3*o+3*n)*t+(3*o-6*n))*t+3*n)*t,subdivisionPrecision=1e-7,subdivisionMaxIterations=12;function binarySubdivide(t,n,o,s,c){let d,h,p=0;do h=n+(o-n)/2,d=calcBezier(h,s,c)-t,d>0?o=h:n=h;while(Math.abs(d)>subdivisionPrecision&&++p<subdivisionMaxIterations);return h}function cubicBezier(t,n,o,s){if(t===n&&o===s)return noop$1;const c=d=>binarySubdivide(d,0,1,t,o);return d=>d===0||d===1?d:calcBezier(c(d),n,s)}const easeIn=cubicBezier(.42,0,1,1),easeOut=cubicBezier(0,0,.58,1),easeInOut=cubicBezier(.42,0,.58,1),isEasingArray=t=>Array.isArray(t)&&typeof t[0]!="number",mirrorEasing=t=>n=>n<=.5?t(2*n)/2:(2-t(2*(1-n)))/2,reverseEasing=t=>n=>1-t(1-n),circIn=t=>1-Math.sin(Math.acos(t)),circOut=reverseEasing(circIn),circInOut=mirrorEasing(circIn),backOut=cubicBezier(.33,1.53,.69,.99),backIn=reverseEasing(backOut),backInOut=mirrorEasing(backIn),anticipate=t=>(t*=2)<1?.5*backIn(t):.5*(2-Math.pow(2,-10*(t-1))),easingLookup={linear:noop$1,easeIn,easeInOut,easeOut,circIn,circInOut,circOut,backIn,backInOut,backOut,anticipate},easingDefinitionToFunction=t=>{if(Array.isArray(t)){invariant(t.length===4,"Cubic bezier arrays must contain four numerical values.");const[n,o,s,c]=t;return cubicBezier(n,o,s,c)}else if(typeof t=="string")return invariant(easingLookup[t]!==void 0,`Invalid easing type '${t}'`),easingLookup[t];return t},progress=(t,n,o)=>{const s=n-t;return s===0?1:(o-t)/s},mixNumber$1=(t,n,o)=>t+(n-t)*o;function hueToRgb(t,n,o){return o<0&&(o+=1),o>1&&(o-=1),o<1/6?t+(n-t)*6*o:o<1/2?n:o<2/3?t+(n-t)*(2/3-o)*6:t}function hslaToRgba({hue:t,saturation:n,lightness:o,alpha:s}){t/=360,n/=100,o/=100;let c=0,d=0,h=0;if(!n)c=d=h=o;else{const p=o<.5?o*(1+n):o+n-o*n,y=2*o-p;c=hueToRgb(y,p,t+1/3),d=hueToRgb(y,p,t),h=hueToRgb(y,p,t-1/3)}return{red:Math.round(c*255),green:Math.round(d*255),blue:Math.round(h*255),alpha:s}}const mixLinearColor=(t,n,o)=>{const s=t*t,c=o*(n*n-s)+s;return c<0?0:Math.sqrt(c)},colorTypes=[hex,rgba,hsla],getColorType=t=>colorTypes.find(n=>n.test(t));function asRGBA(t){const n=getColorType(t);invariant(!!n,`'${t}' is not an animatable color. Use the equivalent color code instead.`);let o=n.parse(t);return n===hsla&&(o=hslaToRgba(o)),o}const mixColor=(t,n)=>{const o=asRGBA(t),s=asRGBA(n),c={...o};return d=>(c.red=mixLinearColor(o.red,s.red,d),c.green=mixLinearColor(o.green,s.green,d),c.blue=mixLinearColor(o.blue,s.blue,d),c.alpha=mixNumber$1(o.alpha,s.alpha,d),rgba.transform(c))};function mixImmediate(t,n){return o=>o>0?n:t}function mixNumber(t,n){return o=>mixNumber$1(t,n,o)}function getMixer(t){return typeof t=="number"?mixNumber:typeof t=="string"?isCSSVariableToken(t)?mixImmediate:color.test(t)?mixColor:mixComplex:Array.isArray(t)?mixArray:typeof t=="object"?color.test(t)?mixColor:mixObject:mixImmediate}function mixArray(t,n){const o=[...t],s=o.length,c=t.map((d,h)=>getMixer(d)(d,n[h]));return d=>{for(let h=0;h<s;h++)o[h]=c[h](d);return o}}function mixObject(t,n){const o={...t,...n},s={};for(const c in o)t[c]!==void 0&&n[c]!==void 0&&(s[c]=getMixer(t[c])(t[c],n[c]));return c=>{for(const d in s)o[d]=s[d](c);return o}}function matchOrder(t,n){var o;const s=[],c={color:0,var:0,number:0};for(let d=0;d<n.values.length;d++){const h=n.types[d],p=t.indexes[h][c[h]],y=(o=t.values[p])!==null&&o!==void 0?o:0;s[d]=y,c[h]++}return s}const mixComplex=(t,n)=>{const o=complex.createTransformer(n),s=analyseComplexValue(t),c=analyseComplexValue(n);return s.indexes.var.length===c.indexes.var.length&&s.indexes.color.length===c.indexes.color.length&&s.indexes.number.length>=c.indexes.number.length?pipe(mixArray(matchOrder(s,c),c.values),o):(warning(!0,`Complex values '${t}' and '${n}' too different to mix. Ensure all colors are of the same type, and that each contains the same quantity of number and color values. Falling back to instant transition.`),mixImmediate(t,n))};function mix(t,n,o){return typeof t=="number"&&typeof n=="number"&&typeof o=="number"?mixNumber$1(t,n,o):getMixer(t)(t,n)}function createMixers(t,n,o){const s=[],c=o||mix,d=t.length-1;for(let h=0;h<d;h++){let p=c(t[h],t[h+1]);if(n){const y=Array.isArray(n)?n[h]||noop$1:n;p=pipe(y,p)}s.push(p)}return s}function interpolate(t,n,{clamp:o=!0,ease:s,mixer:c}={}){const d=t.length;if(invariant(d===n.length,"Both input and output ranges must be the same length"),d===1)return()=>n[0];if(d===2&&t[0]===t[1])return()=>n[1];t[0]>t[d-1]&&(t=[...t].reverse(),n=[...n].reverse());const h=createMixers(n,s,c),p=h.length,y=E=>{let L=0;if(p>1)for(;L<t.length-2&&!(E<t[L+1]);L++);const F=progress(t[L],t[L+1],E);return h[L](F)};return o?E=>y(clamp(t[0],t[d-1],E)):y}function fillOffset(t,n){const o=t[t.length-1];for(let s=1;s<=n;s++){const c=progress(0,n,s);t.push(mixNumber$1(o,1,c))}}function defaultOffset(t){const n=[0];return fillOffset(n,t.length-1),n}function convertOffsetToTimes(t,n){return t.map(o=>o*n)}function defaultEasing(t,n){return t.map(()=>n||easeInOut).splice(0,t.length-1)}function keyframes({duration:t=300,keyframes:n,times:o,ease:s="easeInOut"}){const c=isEasingArray(s)?s.map(easingDefinitionToFunction):easingDefinitionToFunction(s),d={done:!1,value:n[0]},h=convertOffsetToTimes(o&&o.length===n.length?o:defaultOffset(n),t),p=interpolate(h,n,{ease:Array.isArray(c)?c:defaultEasing(n,c)});return{calculatedDuration:t,next:y=>(d.value=p(y),d.done=y>=t,d)}}const maxGeneratorDuration=2e4;function calcGeneratorDuration(t){let n=0;const o=50;let s=t.next(n);for(;!s.done&&n<maxGeneratorDuration;)n+=o,s=t.next(n);return n>=maxGeneratorDuration?1/0:n}const frameloopDriver=t=>{const n=({timestamp:o})=>t(o);return{start:()=>frame.update(n,!0),stop:()=>cancelFrame(n),now:()=>frameData.isProcessing?frameData.timestamp:time.now()}},generators={decay:inertia,inertia,tween:keyframes,keyframes,spring},percentToProgress=t=>t/100;class MainThreadAnimation extends BaseAnimation{constructor({KeyframeResolver:n=KeyframeResolver,...o}){super(o),this.holdTime=null,this.startTime=null,this.cancelTime=null,this.currentTime=0,this.playbackSpeed=1,this.pendingPlayState="running",this.state="idle";const{name:s,motionValue:c,keyframes:d}=this.options,h=(p,y)=>this.onKeyframesResolved(p,y);s&&c&&c.owner?this.resolver=c.owner.resolveKeyframes(d,h,s,c):this.resolver=new n(d,h,s,c),this.resolver.scheduleResolve()}initPlayback(n){const{type:o="keyframes",repeat:s=0,repeatDelay:c=0,repeatType:d,velocity:h=0}=this.options,p=generators[o]||keyframes;let y,E;p!==keyframes&&typeof n[0]!="number"&&(process.env.NODE_ENV!=="production"&&invariant(n.length===2,`Only two keyframes currently supported with spring and inertia animations. Trying to animate ${n}`),y=pipe(percentToProgress,mix(n[0],n[1])),n=[0,100]);const L=p({...this.options,keyframes:n});d==="mirror"&&(E=p({...this.options,keyframes:[...n].reverse(),velocity:-h})),L.calculatedDuration===null&&(L.calculatedDuration=calcGeneratorDuration(L));const{calculatedDuration:F}=L,N=F+c,z=N*(s+1)-c;return{generator:L,mirroredGenerator:E,mapPercentToKeyframes:y,calculatedDuration:F,resolvedDuration:N,totalDuration:z}}onPostResolved(){const{autoplay:n=!0}=this.options;this.play(),this.pendingPlayState==="paused"||!n?this.pause():this.state=this.pendingPlayState}tick(n,o=!1){const{resolved:s}=this;if(!s){const{keyframes:Sa}=this.options;return{done:!0,value:Sa[Sa.length-1]}}const{finalKeyframe:c,generator:d,mirroredGenerator:h,mapPercentToKeyframes:p,keyframes:y,calculatedDuration:E,totalDuration:L,resolvedDuration:F}=s;if(this.startTime===null)return d.next(0);const{delay:N,repeat:z,repeatType:oe,repeatDelay:W,onUpdate:nt}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,n):this.speed<0&&(this.startTime=Math.min(n-L/this.speed,this.startTime)),o?this.currentTime=n:this.holdTime!==null?this.currentTime=this.holdTime:this.currentTime=Math.round(n-this.startTime)*this.speed;const lt=this.currentTime-N*(this.speed>=0?1:-1),Ee=this.speed>=0?lt<0:lt>L;this.currentTime=Math.max(lt,0),this.state==="finished"&&this.holdTime===null&&(this.currentTime=L);let yt=this.currentTime,Ai=d;if(z){const Sa=Math.min(this.currentTime,L)/F;let ya=Math.floor(Sa),ms=Sa%1;!ms&&Sa>=1&&(ms=1),ms===1&&ya--,ya=Math.min(ya,z+1),!!(ya%2)&&(oe==="reverse"?(ms=1-ms,W&&(ms-=W/F)):oe==="mirror"&&(Ai=h)),yt=clamp(0,1,ms)*F}const zi=Ee?{done:!1,value:y[0]}:Ai.next(yt);p&&(zi.value=p(zi.value));let{done:ha}=zi;!Ee&&E!==null&&(ha=this.speed>=0?this.currentTime>=L:this.currentTime<=0);const ba=this.holdTime===null&&(this.state==="finished"||this.state==="running"&&ha);return ba&&c!==void 0&&(zi.value=getFinalKeyframe(y,this.options,c)),nt&&nt(zi.value),ba&&this.finish(),zi}get duration(){const{resolved:n}=this;return n?millisecondsToSeconds(n.calculatedDuration):0}get time(){return millisecondsToSeconds(this.currentTime)}set time(n){n=secondsToMilliseconds(n),this.currentTime=n,this.holdTime!==null||this.speed===0?this.holdTime=n:this.driver&&(this.startTime=this.driver.now()-n/this.speed)}get speed(){return this.playbackSpeed}set speed(n){const o=this.playbackSpeed!==n;this.playbackSpeed=n,o&&(this.time=millisecondsToSeconds(this.currentTime))}play(){if(this.resolver.isScheduled||this.resolver.resume(),!this._resolved){this.pendingPlayState="running";return}if(this.isStopped)return;const{driver:n=frameloopDriver,onPlay:o}=this.options;this.driver||(this.driver=n(c=>this.tick(c))),o&&o();const s=this.driver.now();this.holdTime!==null?this.startTime=s-this.holdTime:(!this.startTime||this.state==="finished")&&(this.startTime=s),this.state==="finished"&&this.updateFinishedPromise(),this.cancelTime=this.startTime,this.holdTime=null,this.state="running",this.driver.start()}pause(){var n;if(!this._resolved){this.pendingPlayState="paused";return}this.state="paused",this.holdTime=(n=this.currentTime)!==null&&n!==void 0?n:0}stop(){if(this.resolver.cancel(),this.isStopped=!0,this.state==="idle")return;this.teardown();const{onStop:n}=this.options;n&&n()}complete(){this.state!=="running"&&this.play(),this.pendingPlayState=this.state="finished",this.holdTime=null}finish(){this.teardown(),this.state="finished";const{onComplete:n}=this.options;n&&n()}cancel(){this.cancelTime!==null&&this.tick(this.cancelTime),this.teardown(),this.updateFinishedPromise()}teardown(){this.state="idle",this.stopDriver(),this.resolveFinishedPromise(),this.updateFinishedPromise(),this.startTime=this.cancelTime=null,this.resolver.cancel()}stopDriver(){this.driver&&(this.driver.stop(),this.driver=void 0)}sample(n){return this.startTime=0,this.tick(n,!0)}}const isBezierDefinition=t=>Array.isArray(t)&&typeof t[0]=="number";function isWaapiSupportedEasing(t){return!!(!t||typeof t=="string"&&supportedWaapiEasing[t]||isBezierDefinition(t)||Array.isArray(t)&&t.every(isWaapiSupportedEasing))}const cubicBezierAsString=([t,n,o,s])=>`cubic-bezier(${t}, ${n}, ${o}, ${s})`,supportedWaapiEasing={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:cubicBezierAsString([0,.65,.55,1]),circOut:cubicBezierAsString([.55,0,1,.45]),backIn:cubicBezierAsString([.31,.01,.66,-.59]),backOut:cubicBezierAsString([.33,1.53,.69,.99])};function mapEasingToNativeEasing(t){if(t)return isBezierDefinition(t)?cubicBezierAsString(t):Array.isArray(t)?t.map(mapEasingToNativeEasing):supportedWaapiEasing[t]}function animateStyle(t,n,o,{delay:s=0,duration:c=300,repeat:d=0,repeatType:h="loop",ease:p,times:y}={}){const E={[n]:o};y&&(E.offset=y);const L=mapEasingToNativeEasing(p);return Array.isArray(L)&&(E.easing=L),t.animate(E,{delay:s,duration:c,easing:Array.isArray(L)?"linear":L,fill:"both",iterations:d+1,direction:h==="reverse"?"alternate":"normal"})}const supportsWaapi=memo(()=>Object.hasOwnProperty.call(Element.prototype,"animate")),acceleratedValues=new Set(["opacity","clipPath","filter","transform"]),sampleDelta=10,maxDuration=2e4;function requiresPregeneratedKeyframes(t){return t.type==="spring"||t.name==="backgroundColor"||!isWaapiSupportedEasing(t.ease)}function pregenerateKeyframes(t,n){const o=new MainThreadAnimation({...n,keyframes:t,repeat:0,delay:0,isGenerator:!0});let s={done:!1,value:t[0]};const c=[];let d=0;for(;!s.done&&d<maxDuration;)s=o.sample(d),c.push(s.value),d+=sampleDelta;return{times:void 0,keyframes:c,duration:d-sampleDelta,ease:"linear"}}class AcceleratedAnimation extends BaseAnimation{constructor(n){super(n);const{name:o,motionValue:s,keyframes:c}=this.options;this.resolver=new DOMKeyframesResolver(c,(d,h)=>this.onKeyframesResolved(d,h),o,s),this.resolver.scheduleResolve()}initPlayback(n,o){var s;let{duration:c=300,times:d,ease:h,type:p,motionValue:y,name:E}=this.options;if(!(!((s=y.owner)===null||s===void 0)&&s.current))return!1;if(requiresPregeneratedKeyframes(this.options)){const{onComplete:F,onUpdate:N,motionValue:z,...oe}=this.options,W=pregenerateKeyframes(n,oe);n=W.keyframes,n.length===1&&(n[1]=n[0]),c=W.duration,d=W.times,h=W.ease,p="keyframes"}const L=animateStyle(y.owner.current,E,n,{...this.options,duration:c,times:d,ease:h});return L.startTime=time.now(),this.pendingTimeline?(L.timeline=this.pendingTimeline,this.pendingTimeline=void 0):L.onfinish=()=>{const{onComplete:F}=this.options;y.set(getFinalKeyframe(n,this.options,o)),F&&F(),this.cancel(),this.resolveFinishedPromise()},{animation:L,duration:c,times:d,type:p,ease:h,keyframes:n}}get duration(){const{resolved:n}=this;if(!n)return 0;const{duration:o}=n;return millisecondsToSeconds(o)}get time(){const{resolved:n}=this;if(!n)return 0;const{animation:o}=n;return millisecondsToSeconds(o.currentTime||0)}set time(n){const{resolved:o}=this;if(!o)return;const{animation:s}=o;s.currentTime=secondsToMilliseconds(n)}get speed(){const{resolved:n}=this;if(!n)return 1;const{animation:o}=n;return o.playbackRate}set speed(n){const{resolved:o}=this;if(!o)return;const{animation:s}=o;s.playbackRate=n}get state(){const{resolved:n}=this;if(!n)return"idle";const{animation:o}=n;return o.playState}attachTimeline(n){if(!this._resolved)this.pendingTimeline=n;else{const{resolved:o}=this;if(!o)return noop$1;const{animation:s}=o;s.timeline=n,s.onfinish=null}return noop$1}play(){if(this.isStopped)return;const{resolved:n}=this;if(!n)return;const{animation:o}=n;o.playState==="finished"&&this.updateFinishedPromise(),o.play()}pause(){const{resolved:n}=this;if(!n)return;const{animation:o}=n;o.pause()}stop(){if(this.resolver.cancel(),this.isStopped=!0,this.state==="idle")return;const{resolved:n}=this;if(!n)return;const{animation:o,keyframes:s,duration:c,type:d,ease:h,times:p}=n;if(!(o.playState==="idle"||o.playState==="finished")){if(this.time){const{motionValue:y,onUpdate:E,onComplete:L,...F}=this.options,N=new MainThreadAnimation({...F,keyframes:s,duration:c,type:d,ease:h,times:p,isGenerator:!0}),z=secondsToMilliseconds(this.time);y.setWithVelocity(N.sample(z-sampleDelta).value,N.sample(z).value,sampleDelta)}this.cancel()}}complete(){const{resolved:n}=this;n&&n.animation.finish()}cancel(){const{resolved:n}=this;n&&n.animation.cancel()}static supports(n){const{motionValue:o,name:s,repeatDelay:c,repeatType:d,damping:h,type:p}=n;return supportsWaapi()&&s&&acceleratedValues.has(s)&&o&&o.owner&&o.owner.current instanceof HTMLElement&&!o.owner.getProps().onUpdate&&!c&&d!=="mirror"&&h!==0&&p!=="inertia"}}const animateMotionValue=(t,n,o,s={},c,d)=>h=>{const p=getValueTransition(s,t)||{},y=p.delay||s.delay||0;let{elapsed:E=0}=s;E=E-secondsToMilliseconds(y);let L={keyframes:Array.isArray(o)?o:[null,o],ease:"easeOut",velocity:n.getVelocity(),...p,delay:-E,onUpdate:N=>{n.set(N),p.onUpdate&&p.onUpdate(N)},onComplete:()=>{h(),p.onComplete&&p.onComplete()},name:t,motionValue:n,element:d?void 0:c};isTransitionDefined(p)||(L={...L,...getDefaultTransition(t,L)}),L.duration&&(L.duration=secondsToMilliseconds(L.duration)),L.repeatDelay&&(L.repeatDelay=secondsToMilliseconds(L.repeatDelay)),L.from!==void 0&&(L.keyframes[0]=L.from);let F=!1;if((L.type===!1||L.duration===0&&!L.repeatDelay)&&(L.duration=0,L.delay===0&&(F=!0)),F&&!d&&n.get()!==void 0){const N=getFinalKeyframe(L.keyframes,p);if(N!==void 0){frame.update(()=>{L.onUpdate(N),L.onComplete()});return}}return!d&&AcceleratedAnimation.supports(L)?new AcceleratedAnimation(L):new MainThreadAnimation(L)};function isWillChangeMotionValue(t){return!!(isMotionValue(t)&&t.add)}function addUniqueItem(t,n){t.indexOf(n)===-1&&t.push(n)}function removeItem(t,n){const o=t.indexOf(n);o>-1&&t.splice(o,1)}class SubscriptionManager{constructor(){this.subscriptions=[]}add(n){return addUniqueItem(this.subscriptions,n),()=>removeItem(this.subscriptions,n)}notify(n,o,s){const c=this.subscriptions.length;if(c)if(c===1)this.subscriptions[0](n,o,s);else for(let d=0;d<c;d++){const h=this.subscriptions[d];h&&h(n,o,s)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}}const warned=new Set;function warnOnce(t,n,o){t||warned.has(n)||(console.warn(n),warned.add(n))}const MAX_VELOCITY_DELTA=30,isFloat=t=>!isNaN(parseFloat(t));class MotionValue{constructor(n,o={}){this.version="11.0.27",this.canTrackVelocity=!1,this.events={},this.updateAndNotify=(s,c=!0)=>{const d=time.now();this.updatedAt!==d&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(s),this.current!==this.prev&&this.events.change&&this.events.change.notify(this.current),c&&this.events.renderRequest&&this.events.renderRequest.notify(this.current)},this.hasAnimated=!1,this.setCurrent(n),this.canTrackVelocity=isFloat(this.current),this.owner=o.owner}setCurrent(n){this.current=n,this.updatedAt=time.now()}setPrevFrameValue(n=this.current){this.prevFrameValue=n,this.prevUpdatedAt=this.updatedAt}onChange(n){return process.env.NODE_ENV!=="production"&&warnOnce(!1,'value.onChange(callback) is deprecated. Switch to value.on("change", callback).'),this.on("change",n)}on(n,o){this.events[n]||(this.events[n]=new SubscriptionManager);const s=this.events[n].add(o);return n==="change"?()=>{s(),frame.read(()=>{this.events.change.getSize()||this.stop()})}:s}clearListeners(){for(const n in this.events)this.events[n].clear()}attach(n,o){this.passiveEffect=n,this.stopPassiveEffect=o}set(n,o=!0){!o||!this.passiveEffect?this.updateAndNotify(n,o):this.passiveEffect(n,this.updateAndNotify)}setWithVelocity(n,o,s){this.set(o),this.prev=void 0,this.prevFrameValue=n,this.prevUpdatedAt=this.updatedAt-s}jump(n,o=!0){this.updateAndNotify(n),this.prev=n,this.prevUpdatedAt=this.prevFrameValue=void 0,o&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}get(){return this.current}getPrevious(){return this.prev}getVelocity(){const n=time.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||n-this.updatedAt>MAX_VELOCITY_DELTA)return 0;const o=Math.min(this.updatedAt-this.prevUpdatedAt,MAX_VELOCITY_DELTA);return velocityPerSecond(parseFloat(this.current)-parseFloat(this.prevFrameValue),o)}start(n){return this.stop(),new Promise(o=>{this.hasAnimated=!0,this.animation=n(o),this.events.animationStart&&this.events.animationStart.notify()}).then(()=>{this.events.animationComplete&&this.events.animationComplete.notify(),this.clearAnimation()})}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel&&this.events.animationCancel.notify()),this.clearAnimation()}isAnimating(){return!!this.animation}clearAnimation(){delete this.animation}destroy(){this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}}function motionValue(t,n){return new MotionValue(t,n)}function setMotionValue(t,n,o){t.hasValue(n)?t.getValue(n).set(o):t.addValue(n,motionValue(o))}function setTarget(t,n){const o=resolveVariant(t,n);let{transitionEnd:s={},transition:c={},...d}=o||{};d={...d,...s};for(const h in d){const p=resolveFinalValueInKeyframes(d[h]);setMotionValue(t,h,p)}}function shouldBlockAnimation({protectedKeys:t,needsAnimating:n},o){const s=t.hasOwnProperty(o)&&n[o]!==!0;return n[o]=!1,s}function animateTarget(t,n,{delay:o=0,transitionOverride:s,type:c}={}){var d;let{transition:h=t.getDefaultTransition(),transitionEnd:p,...y}=n;const E=t.getValue("willChange");s&&(h=s);const L=[],F=c&&t.animationState&&t.animationState.getState()[c];for(const N in y){const z=t.getValue(N,(d=t.latestValues[N])!==null&&d!==void 0?d:null),oe=y[N];if(oe===void 0||F&&shouldBlockAnimation(F,N))continue;const W={delay:o,elapsed:0,...getValueTransition(h||{},N)};let nt=!1;if(window.HandoffAppearAnimations){const Ee=t.getProps()[optimizedAppearDataAttribute];if(Ee){const yt=window.HandoffAppearAnimations(Ee,N);yt!==null&&(W.elapsed=yt,nt=!0)}}z.start(animateMotionValue(N,z,oe,t.shouldReduceMotion&&transformProps.has(N)?{type:!1}:W,t,nt));const lt=z.animation;lt&&(isWillChangeMotionValue(E)&&(E.add(N),lt.then(()=>E.remove(N))),L.push(lt))}return p&&Promise.all(L).then(()=>{frame.update(()=>{p&&setTarget(t,p)})}),L}function animateVariant(t,n,o={}){var s;const c=resolveVariant(t,n,o.type==="exit"?(s=t.presenceContext)===null||s===void 0?void 0:s.custom:void 0);let{transition:d=t.getDefaultTransition()||{}}=c||{};o.transitionOverride&&(d=o.transitionOverride);const h=c?()=>Promise.all(animateTarget(t,c,o)):()=>Promise.resolve(),p=t.variantChildren&&t.variantChildren.size?(E=0)=>{const{delayChildren:L=0,staggerChildren:F,staggerDirection:N}=d;return animateChildren(t,n,L+E,F,N,o)}:()=>Promise.resolve(),{when:y}=d;if(y){const[E,L]=y==="beforeChildren"?[h,p]:[p,h];return E().then(()=>L())}else return Promise.all([h(),p(o.delay)])}function animateChildren(t,n,o=0,s=0,c=1,d){const h=[],p=(t.variantChildren.size-1)*s,y=c===1?(E=0)=>E*s:(E=0)=>p-E*s;return Array.from(t.variantChildren).sort(sortByTreeOrder).forEach((E,L)=>{E.notify("AnimationStart",n),h.push(animateVariant(E,n,{...d,delay:o+y(L)}).then(()=>E.notify("AnimationComplete",n)))}),Promise.all(h)}function sortByTreeOrder(t,n){return t.sortNodePosition(n)}function animateVisualElement(t,n,o={}){t.notify("AnimationStart",n);let s;if(Array.isArray(n)){const c=n.map(d=>animateVariant(t,d,o));s=Promise.all(c)}else if(typeof n=="string")s=animateVariant(t,n,o);else{const c=typeof n=="function"?resolveVariant(t,n,o.custom):n;s=Promise.all(animateTarget(t,c,o))}return s.then(()=>{frame.postRender(()=>{t.notify("AnimationComplete",n)})})}const reversePriorityOrder=[...variantPriorityOrder].reverse(),numAnimationTypes=variantPriorityOrder.length;function animateList(t){return n=>Promise.all(n.map(({animation:o,options:s})=>animateVisualElement(t,o,s)))}function createAnimationState(t){let n=animateList(t);const o=createState();let s=!0;const c=y=>(E,L)=>{var F;const N=resolveVariant(t,L,y==="exit"?(F=t.presenceContext)===null||F===void 0?void 0:F.custom:void 0);if(N){const{transition:z,transitionEnd:oe,...W}=N;E={...E,...W,...oe}}return E};function d(y){n=y(t)}function h(y){const E=t.getProps(),L=t.getVariantContext(!0)||{},F=[],N=new Set;let z={},oe=1/0;for(let nt=0;nt<numAnimationTypes;nt++){const lt=reversePriorityOrder[nt],Ee=o[lt],yt=E[lt]!==void 0?E[lt]:L[lt],Ai=isVariantLabel(yt),zi=lt===y?Ee.isActive:null;zi===!1&&(oe=nt);let ha=yt===L[lt]&&yt!==E[lt]&&Ai;if(ha&&s&&t.manuallyAnimateOnMount&&(ha=!1),Ee.protectedKeys={...z},!Ee.isActive&&zi===null||!yt&&!Ee.prevProp||isAnimationControls(yt)||typeof yt=="boolean")continue;let Sa=checkVariantsDidChange(Ee.prevProp,yt)||lt===y&&Ee.isActive&&!ha&&Ai||nt>oe&&Ai,ya=!1;const ms=Array.isArray(yt)?yt:[yt];let Wc=ms.reduce(c(lt),{});zi===!1&&(Wc={});const{prevResolvedValues:Wa={}}=Ee,pi={...Wa,...Wc},mt=fa=>{Sa=!0,N.has(fa)&&(ya=!0,N.delete(fa)),Ee.needsAnimating[fa]=!0;const Ra=t.getValue(fa);Ra&&(Ra.liveStyle=!1)};for(const fa in pi){const Ra=Wc[fa],sl=Wa[fa];if(z.hasOwnProperty(fa))continue;let Zd=!1;isKeyframesTarget(Ra)&&isKeyframesTarget(sl)?Zd=!shallowCompare(Ra,sl):Zd=Ra!==sl,Zd?Ra!=null?mt(fa):N.add(fa):Ra!==void 0&&N.has(fa)?mt(fa):Ee.protectedKeys[fa]=!0}Ee.prevProp=yt,Ee.prevResolvedValues=Wc,Ee.isActive&&(z={...z,...Wc}),s&&t.blockInitialAnimation&&(Sa=!1),Sa&&(!ha||ya)&&F.push(...ms.map(fa=>({animation:fa,options:{type:lt}})))}if(N.size){const nt={};N.forEach(lt=>{const Ee=t.getBaseTarget(lt),yt=t.getValue(lt);yt&&(yt.liveStyle=!0),nt[lt]=Ee===void 0?null:Ee}),F.push({animation:nt})}let W=!!F.length;return s&&(E.initial===!1||E.initial===E.animate)&&!t.manuallyAnimateOnMount&&(W=!1),s=!1,W?n(F):Promise.resolve()}function p(y,E){var L;if(o[y].isActive===E)return Promise.resolve();(L=t.variantChildren)===null||L===void 0||L.forEach(N=>{var z;return(z=N.animationState)===null||z===void 0?void 0:z.setActive(y,E)}),o[y].isActive=E;const F=h(y);for(const N in o)o[N].protectedKeys={};return F}return{animateChanges:h,setActive:p,setAnimateFunction:d,getState:()=>o}}function checkVariantsDidChange(t,n){return typeof n=="string"?n!==t:Array.isArray(n)?!shallowCompare(n,t):!1}function createTypeState(t=!1){return{isActive:t,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function createState(){return{animate:createTypeState(!0),whileInView:createTypeState(),whileHover:createTypeState(),whileTap:createTypeState(),whileDrag:createTypeState(),whileFocus:createTypeState(),exit:createTypeState()}}class AnimationFeature extends Feature{constructor(n){super(n),n.animationState||(n.animationState=createAnimationState(n))}updateAnimationControlsSubscription(){const{animate:n}=this.node.getProps();this.unmount(),isAnimationControls(n)&&(this.unmount=n.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){const{animate:n}=this.node.getProps(),{animate:o}=this.node.prevProps||{};n!==o&&this.updateAnimationControlsSubscription()}unmount(){}}let id$1=0;class ExitAnimationFeature extends Feature{constructor(){super(...arguments),this.id=id$1++}update(){if(!this.node.presenceContext)return;const{isPresent:n,onExitComplete:o}=this.node.presenceContext,{isPresent:s}=this.node.prevPresenceContext||{};if(!this.node.animationState||n===s)return;const c=this.node.animationState.setActive("exit",!n);o&&!n&&c.then(()=>o(this.id))}mount(){const{register:n}=this.node.presenceContext||{};n&&(this.unmount=n(this.id))}unmount(){}}const animations={animation:{Feature:AnimationFeature},exit:{Feature:ExitAnimationFeature}},distance=(t,n)=>Math.abs(t-n);function distance2D(t,n){const o=distance(t.x,n.x),s=distance(t.y,n.y);return Math.sqrt(o**2+s**2)}class PanSession{constructor(n,o,{transformPagePoint:s,contextWindow:c,dragSnapToOrigin:d=!1}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.handlers={},this.contextWindow=window,this.updatePoint=()=>{if(!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const F=getPanInfo(this.lastMoveEventInfo,this.history),N=this.startEvent!==null,z=distance2D(F.offset,{x:0,y:0})>=3;if(!N&&!z)return;const{point:oe}=F,{timestamp:W}=frameData;this.history.push({...oe,timestamp:W});const{onStart:nt,onMove:lt}=this.handlers;N||(nt&&nt(this.lastMoveEvent,F),this.startEvent=this.lastMoveEvent),lt&<(this.lastMoveEvent,F)},this.handlePointerMove=(F,N)=>{this.lastMoveEvent=F,this.lastMoveEventInfo=transformPoint(N,this.transformPagePoint),frame.update(this.updatePoint,!0)},this.handlePointerUp=(F,N)=>{this.end();const{onEnd:z,onSessionEnd:oe,resumeAnimation:W}=this.handlers;if(this.dragSnapToOrigin&&W&&W(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const nt=getPanInfo(F.type==="pointercancel"?this.lastMoveEventInfo:transformPoint(N,this.transformPagePoint),this.history);this.startEvent&&z&&z(F,nt),oe&&oe(F,nt)},!isPrimaryPointer(n))return;this.dragSnapToOrigin=d,this.handlers=o,this.transformPagePoint=s,this.contextWindow=c||window;const h=extractEventInfo(n),p=transformPoint(h,this.transformPagePoint),{point:y}=p,{timestamp:E}=frameData;this.history=[{...y,timestamp:E}];const{onSessionStart:L}=o;L&&L(n,getPanInfo(p,this.history)),this.removeListeners=pipe(addPointerEvent(this.contextWindow,"pointermove",this.handlePointerMove),addPointerEvent(this.contextWindow,"pointerup",this.handlePointerUp),addPointerEvent(this.contextWindow,"pointercancel",this.handlePointerUp))}updateHandlers(n){this.handlers=n}end(){this.removeListeners&&this.removeListeners(),cancelFrame(this.updatePoint)}}function transformPoint(t,n){return n?{point:n(t.point)}:t}function subtractPoint(t,n){return{x:t.x-n.x,y:t.y-n.y}}function getPanInfo({point:t},n){return{point:t,delta:subtractPoint(t,lastDevicePoint(n)),offset:subtractPoint(t,startDevicePoint(n)),velocity:getVelocity(n,.1)}}function startDevicePoint(t){return t[0]}function lastDevicePoint(t){return t[t.length-1]}function getVelocity(t,n){if(t.length<2)return{x:0,y:0};let o=t.length-1,s=null;const c=lastDevicePoint(t);for(;o>=0&&(s=t[o],!(c.timestamp-s.timestamp>secondsToMilliseconds(n)));)o--;if(!s)return{x:0,y:0};const d=millisecondsToSeconds(c.timestamp-s.timestamp);if(d===0)return{x:0,y:0};const h={x:(c.x-s.x)/d,y:(c.y-s.y)/d};return h.x===1/0&&(h.x=0),h.y===1/0&&(h.y=0),h}function calcLength(t){return t.max-t.min}function isNear(t,n=0,o=.01){return Math.abs(t-n)<=o}function calcAxisDelta(t,n,o,s=.5){t.origin=s,t.originPoint=mixNumber$1(n.min,n.max,t.origin),t.scale=calcLength(o)/calcLength(n),(isNear(t.scale,1,1e-4)||isNaN(t.scale))&&(t.scale=1),t.translate=mixNumber$1(o.min,o.max,t.origin)-t.originPoint,(isNear(t.translate)||isNaN(t.translate))&&(t.translate=0)}function calcBoxDelta(t,n,o,s){calcAxisDelta(t.x,n.x,o.x,s?s.originX:void 0),calcAxisDelta(t.y,n.y,o.y,s?s.originY:void 0)}function calcRelativeAxis(t,n,o){t.min=o.min+n.min,t.max=t.min+calcLength(n)}function calcRelativeBox(t,n,o){calcRelativeAxis(t.x,n.x,o.x),calcRelativeAxis(t.y,n.y,o.y)}function calcRelativeAxisPosition(t,n,o){t.min=n.min-o.min,t.max=t.min+calcLength(n)}function calcRelativePosition(t,n,o){calcRelativeAxisPosition(t.x,n.x,o.x),calcRelativeAxisPosition(t.y,n.y,o.y)}function applyConstraints(t,{min:n,max:o},s){return n!==void 0&&t<n?t=s?mixNumber$1(n,t,s.min):Math.max(t,n):o!==void 0&&t>o&&(t=s?mixNumber$1(o,t,s.max):Math.min(t,o)),t}function calcRelativeAxisConstraints(t,n,o){return{min:n!==void 0?t.min+n:void 0,max:o!==void 0?t.max+o-(t.max-t.min):void 0}}function calcRelativeConstraints(t,{top:n,left:o,bottom:s,right:c}){return{x:calcRelativeAxisConstraints(t.x,o,c),y:calcRelativeAxisConstraints(t.y,n,s)}}function calcViewportAxisConstraints(t,n){let o=n.min-t.min,s=n.max-t.max;return n.max-n.min<t.max-t.min&&([o,s]=[s,o]),{min:o,max:s}}function calcViewportConstraints(t,n){return{x:calcViewportAxisConstraints(t.x,n.x),y:calcViewportAxisConstraints(t.y,n.y)}}function calcOrigin(t,n){let o=.5;const s=calcLength(t),c=calcLength(n);return c>s?o=progress(n.min,n.max-s,t.min):s>c&&(o=progress(t.min,t.max-c,n.min)),clamp(0,1,o)}function rebaseAxisConstraints(t,n){const o={};return n.min!==void 0&&(o.min=n.min-t.min),n.max!==void 0&&(o.max=n.max-t.min),o}const defaultElastic=.35;function resolveDragElastic(t=defaultElastic){return t===!1?t=0:t===!0&&(t=defaultElastic),{x:resolveAxisElastic(t,"left","right"),y:resolveAxisElastic(t,"top","bottom")}}function resolveAxisElastic(t,n,o){return{min:resolvePointElastic(t,n),max:resolvePointElastic(t,o)}}function resolvePointElastic(t,n){return typeof t=="number"?t:t[n]||0}const createAxisDelta=()=>({translate:0,scale:1,origin:0,originPoint:0}),createDelta=()=>({x:createAxisDelta(),y:createAxisDelta()}),createAxis=()=>({min:0,max:0}),createBox=()=>({x:createAxis(),y:createAxis()});function eachAxis(t){return[t("x"),t("y")]}function convertBoundingBoxToBox({top:t,left:n,right:o,bottom:s}){return{x:{min:n,max:o},y:{min:t,max:s}}}function convertBoxToBoundingBox({x:t,y:n}){return{top:n.min,right:t.max,bottom:n.max,left:t.min}}function transformBoxPoints(t,n){if(!n)return t;const o=n({x:t.left,y:t.top}),s=n({x:t.right,y:t.bottom});return{top:o.y,left:o.x,bottom:s.y,right:s.x}}function isIdentityScale(t){return t===void 0||t===1}function hasScale({scale:t,scaleX:n,scaleY:o}){return!isIdentityScale(t)||!isIdentityScale(n)||!isIdentityScale(o)}function hasTransform(t){return hasScale(t)||has2DTranslate(t)||t.z||t.rotate||t.rotateX||t.rotateY||t.skewX||t.skewY}function has2DTranslate(t){return is2DTranslate(t.x)||is2DTranslate(t.y)}function is2DTranslate(t){return t&&t!=="0%"}function scalePoint(t,n,o){const s=t-o,c=n*s;return o+c}function applyPointDelta(t,n,o,s,c){return c!==void 0&&(t=scalePoint(t,c,s)),scalePoint(t,o,s)+n}function applyAxisDelta(t,n=0,o=1,s,c){t.min=applyPointDelta(t.min,n,o,s,c),t.max=applyPointDelta(t.max,n,o,s,c)}function applyBoxDelta(t,{x:n,y:o}){applyAxisDelta(t.x,n.translate,n.scale,n.originPoint),applyAxisDelta(t.y,o.translate,o.scale,o.originPoint)}function applyTreeDeltas(t,n,o,s=!1){const c=o.length;if(!c)return;n.x=n.y=1;let d,h;for(let p=0;p<c;p++){d=o[p],h=d.projectionDelta;const y=d.instance;y&&y.style&&y.style.display==="contents"||(s&&d.options.layoutScroll&&d.scroll&&d!==d.root&&transformBox(t,{x:-d.scroll.offset.x,y:-d.scroll.offset.y}),h&&(n.x*=h.x.scale,n.y*=h.y.scale,applyBoxDelta(t,h)),s&&hasTransform(d.latestValues)&&transformBox(t,d.latestValues))}n.x=snapToDefault(n.x),n.y=snapToDefault(n.y)}function snapToDefault(t){return Number.isInteger(t)||t>1.0000000000001||t<.999999999999?t:1}function translateAxis(t,n){t.min=t.min+n,t.max=t.max+n}function transformAxis(t,n,[o,s,c]){const d=n[c]!==void 0?n[c]:.5,h=mixNumber$1(t.min,t.max,d);applyAxisDelta(t,n[o],n[s],h,n.scale)}const xKeys$1=["x","scaleX","originX"],yKeys$1=["y","scaleY","originY"];function transformBox(t,n){transformAxis(t.x,n,xKeys$1),transformAxis(t.y,n,yKeys$1)}function measureViewportBox(t,n){return convertBoundingBoxToBox(transformBoxPoints(t.getBoundingClientRect(),n))}function measurePageBox(t,n,o){const s=measureViewportBox(t,o),{scroll:c}=n;return c&&(translateAxis(s.x,c.offset.x),translateAxis(s.y,c.offset.y)),s}const getContextWindow=({current:t})=>t?t.ownerDocument.defaultView:null,elementDragControls=new WeakMap;class VisualElementDragControls{constructor(n){this.openGlobalLock=null,this.isDragging=!1,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=!1,this.hasMutatedConstraints=!1,this.elastic=createBox(),this.visualElement=n}start(n,{snapToCursor:o=!1}={}){const{presenceContext:s}=this.visualElement;if(s&&s.isPresent===!1)return;const c=L=>{const{dragSnapToOrigin:F}=this.getProps();F?this.pauseAnimation():this.stopAnimation(),o&&this.snapToCursor(extractEventInfo(L,"page").point)},d=(L,F)=>{const{drag:N,dragPropagation:z,onDragStart:oe}=this.getProps();if(N&&!z&&(this.openGlobalLock&&this.openGlobalLock(),this.openGlobalLock=getGlobalLock(N),!this.openGlobalLock))return;this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),eachAxis(nt=>{let lt=this.getAxisMotionValue(nt).get()||0;if(percent.test(lt)){const{projection:Ee}=this.visualElement;if(Ee&&Ee.layout){const yt=Ee.layout.layoutBox[nt];yt&&(lt=calcLength(yt)*(parseFloat(lt)/100))}}this.originPoint[nt]=lt}),oe&&oe(L,F);const{animationState:W}=this.visualElement;W&&W.setActive("whileDrag",!0)},h=(L,F)=>{const{dragPropagation:N,dragDirectionLock:z,onDirectionLock:oe,onDrag:W}=this.getProps();if(!N&&!this.openGlobalLock)return;const{offset:nt}=F;if(z&&this.currentDirection===null){this.currentDirection=getCurrentDirection(nt),this.currentDirection!==null&&oe&&oe(this.currentDirection);return}this.updateAxis("x",F.point,nt),this.updateAxis("y",F.point,nt),this.visualElement.render(),W&&W(L,F)},p=(L,F)=>this.stop(L,F),y=()=>eachAxis(L=>{var F;return this.getAnimationState(L)==="paused"&&((F=this.getAxisMotionValue(L).animation)===null||F===void 0?void 0:F.play())}),{dragSnapToOrigin:E}=this.getProps();this.panSession=new PanSession(n,{onSessionStart:c,onStart:d,onMove:h,onSessionEnd:p,resumeAnimation:y},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:E,contextWindow:getContextWindow(this.visualElement)})}stop(n,o){const s=this.isDragging;if(this.cancel(),!s)return;const{velocity:c}=o;this.startAnimation(c);const{onDragEnd:d}=this.getProps();d&&d(n,o)}cancel(){this.isDragging=!1;const{projection:n,animationState:o}=this.visualElement;n&&(n.isAnimationBlocked=!1),this.panSession&&this.panSession.end(),this.panSession=void 0;const{dragPropagation:s}=this.getProps();!s&&this.openGlobalLock&&(this.openGlobalLock(),this.openGlobalLock=null),o&&o.setActive("whileDrag",!1)}updateAxis(n,o,s){const{drag:c}=this.getProps();if(!s||!shouldDrag(n,c,this.currentDirection))return;const d=this.getAxisMotionValue(n);let h=this.originPoint[n]+s[n];this.constraints&&this.constraints[n]&&(h=applyConstraints(h,this.constraints[n],this.elastic[n])),d.set(h)}resolveConstraints(){var n;const{dragConstraints:o,dragElastic:s}=this.getProps(),c=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):(n=this.visualElement.projection)===null||n===void 0?void 0:n.layout,d=this.constraints;o&&isRefObject(o)?this.constraints||(this.constraints=this.resolveRefConstraints()):o&&c?this.constraints=calcRelativeConstraints(c.layoutBox,o):this.constraints=!1,this.elastic=resolveDragElastic(s),d!==this.constraints&&c&&this.constraints&&!this.hasMutatedConstraints&&eachAxis(h=>{this.getAxisMotionValue(h)&&(this.constraints[h]=rebaseAxisConstraints(c.layoutBox[h],this.constraints[h]))})}resolveRefConstraints(){const{dragConstraints:n,onMeasureDragConstraints:o}=this.getProps();if(!n||!isRefObject(n))return!1;const s=n.current;invariant(s!==null,"If `dragConstraints` is set as a React ref, that ref must be passed to another component's `ref` prop.");const{projection:c}=this.visualElement;if(!c||!c.layout)return!1;const d=measurePageBox(s,c.root,this.visualElement.getTransformPagePoint());let h=calcViewportConstraints(c.layout.layoutBox,d);if(o){const p=o(convertBoxToBoundingBox(h));this.hasMutatedConstraints=!!p,p&&(h=convertBoundingBoxToBox(p))}return h}startAnimation(n){const{drag:o,dragMomentum:s,dragElastic:c,dragTransition:d,dragSnapToOrigin:h,onDragTransitionEnd:p}=this.getProps(),y=this.constraints||{},E=eachAxis(L=>{if(!shouldDrag(L,o,this.currentDirection))return;let F=y&&y[L]||{};h&&(F={min:0,max:0});const N=c?200:1e6,z=c?40:1e7,oe={type:"inertia",velocity:s?n[L]:0,bounceStiffness:N,bounceDamping:z,timeConstant:750,restDelta:1,restSpeed:10,...d,...F};return this.startAxisValueAnimation(L,oe)});return Promise.all(E).then(p)}startAxisValueAnimation(n,o){const s=this.getAxisMotionValue(n);return s.start(animateMotionValue(n,s,0,o,this.visualElement))}stopAnimation(){eachAxis(n=>this.getAxisMotionValue(n).stop())}pauseAnimation(){eachAxis(n=>{var o;return(o=this.getAxisMotionValue(n).animation)===null||o===void 0?void 0:o.pause()})}getAnimationState(n){var o;return(o=this.getAxisMotionValue(n).animation)===null||o===void 0?void 0:o.state}getAxisMotionValue(n){const o="_drag"+n.toUpperCase(),s=this.visualElement.getProps(),c=s[o];return c||this.visualElement.getValue(n,(s.initial?s.initial[n]:void 0)||0)}snapToCursor(n){eachAxis(o=>{const{drag:s}=this.getProps();if(!shouldDrag(o,s,this.currentDirection))return;const{projection:c}=this.visualElement,d=this.getAxisMotionValue(o);if(c&&c.layout){const{min:h,max:p}=c.layout.layoutBox[o];d.set(n[o]-mixNumber$1(h,p,.5))}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:n,dragConstraints:o}=this.getProps(),{projection:s}=this.visualElement;if(!isRefObject(o)||!s||!this.constraints)return;this.stopAnimation();const c={x:0,y:0};eachAxis(h=>{const p=this.getAxisMotionValue(h);if(p){const y=p.get();c[h]=calcOrigin({min:y,max:y},this.constraints[h])}});const{transformTemplate:d}=this.visualElement.getProps();this.visualElement.current.style.transform=d?d({},""):"none",s.root&&s.root.updateScroll(),s.updateLayout(),this.resolveConstraints(),eachAxis(h=>{if(!shouldDrag(h,n,null))return;const p=this.getAxisMotionValue(h),{min:y,max:E}=this.constraints[h];p.set(mixNumber$1(y,E,c[h]))})}addListeners(){if(!this.visualElement.current)return;elementDragControls.set(this.visualElement,this);const n=this.visualElement.current,o=addPointerEvent(n,"pointerdown",y=>{const{drag:E,dragListener:L=!0}=this.getProps();E&&L&&this.start(y)}),s=()=>{const{dragConstraints:y}=this.getProps();isRefObject(y)&&(this.constraints=this.resolveRefConstraints())},{projection:c}=this.visualElement,d=c.addEventListener("measure",s);c&&!c.layout&&(c.root&&c.root.updateScroll(),c.updateLayout()),s();const h=addDomEvent(window,"resize",()=>this.scalePositionWithinConstraints()),p=c.addEventListener("didUpdate",({delta:y,hasLayoutChanged:E})=>{this.isDragging&&E&&(eachAxis(L=>{const F=this.getAxisMotionValue(L);F&&(this.originPoint[L]+=y[L].translate,F.set(F.get()+y[L].translate))}),this.visualElement.render())});return()=>{h(),o(),d(),p&&p()}}getProps(){const n=this.visualElement.getProps(),{drag:o=!1,dragDirectionLock:s=!1,dragPropagation:c=!1,dragConstraints:d=!1,dragElastic:h=defaultElastic,dragMomentum:p=!0}=n;return{...n,drag:o,dragDirectionLock:s,dragPropagation:c,dragConstraints:d,dragElastic:h,dragMomentum:p}}}function shouldDrag(t,n,o){return(n===!0||n===t)&&(o===null||o===t)}function getCurrentDirection(t,n=10){let o=null;return Math.abs(t.y)>n?o="y":Math.abs(t.x)>n&&(o="x"),o}class DragGesture extends Feature{constructor(n){super(n),this.removeGroupControls=noop$1,this.removeListeners=noop$1,this.controls=new VisualElementDragControls(n)}mount(){const{dragControls:n}=this.node.getProps();n&&(this.removeGroupControls=n.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||noop$1}unmount(){this.removeGroupControls(),this.removeListeners()}}const asyncHandler=t=>(n,o)=>{t&&t(n,o)};class PanGesture extends Feature{constructor(){super(...arguments),this.removePointerDownListener=noop$1}onPointerDown(n){this.session=new PanSession(n,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:getContextWindow(this.node)})}createPanHandlers(){const{onPanSessionStart:n,onPanStart:o,onPan:s,onPanEnd:c}=this.node.getProps();return{onSessionStart:asyncHandler(n),onStart:asyncHandler(o),onMove:s,onEnd:(d,h)=>{delete this.session,c&&c(d,h)}}}mount(){this.removePointerDownListener=addPointerEvent(this.node.current,"pointerdown",n=>this.onPointerDown(n))}update(){this.session&&this.session.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}}function usePresence(){const t=React.useContext(PresenceContext);if(t===null)return[!0,null];const{isPresent:n,onExitComplete:o,register:s}=t,c=React.useId();return React.useEffect(()=>s(c),[]),!n&&o?[!1,()=>o&&o(c)]:[!0]}const globalProjectionState={hasAnimatedSinceResize:!0,hasEverUpdated:!1};function pixelsToPercent(t,n){return n.max===n.min?0:t/(n.max-n.min)*100}const correctBorderRadius={correct:(t,n)=>{if(!n.target)return t;if(typeof t=="string")if(px.test(t))t=parseFloat(t);else return t;const o=pixelsToPercent(t,n.target.x),s=pixelsToPercent(t,n.target.y);return`${o}% ${s}%`}},correctBoxShadow={correct:(t,{treeScale:n,projectionDelta:o})=>{const s=t,c=complex.parse(t);if(c.length>5)return s;const d=complex.createTransformer(t),h=typeof c[0]!="number"?1:0,p=o.x.scale*n.x,y=o.y.scale*n.y;c[0+h]/=p,c[1+h]/=y;const E=mixNumber$1(p,y,.5);return typeof c[2+h]=="number"&&(c[2+h]/=E),typeof c[3+h]=="number"&&(c[3+h]/=E),d(c)}};class MeasureLayoutWithContext extends React.Component{componentDidMount(){const{visualElement:n,layoutGroup:o,switchLayoutGroup:s,layoutId:c}=this.props,{projection:d}=n;addScaleCorrector(defaultScaleCorrectors),d&&(o.group&&o.group.add(d),s&&s.register&&c&&s.register(d),d.root.didUpdate(),d.addEventListener("animationComplete",()=>{this.safeToRemove()}),d.setOptions({...d.options,onExitComplete:()=>this.safeToRemove()})),globalProjectionState.hasEverUpdated=!0}getSnapshotBeforeUpdate(n){const{layoutDependency:o,visualElement:s,drag:c,isPresent:d}=this.props,h=s.projection;return h&&(h.isPresent=d,c||n.layoutDependency!==o||o===void 0?h.willUpdate():this.safeToRemove(),n.isPresent!==d&&(d?h.promote():h.relegate()||frame.postRender(()=>{const p=h.getStack();(!p||!p.members.length)&&this.safeToRemove()}))),null}componentDidUpdate(){const{projection:n}=this.props.visualElement;n&&(n.root.didUpdate(),microtask.postRender(()=>{!n.currentAnimation&&n.isLead()&&this.safeToRemove()}))}componentWillUnmount(){const{visualElement:n,layoutGroup:o,switchLayoutGroup:s}=this.props,{projection:c}=n;c&&(c.scheduleCheckAfterUnmount(),o&&o.group&&o.group.remove(c),s&&s.deregister&&s.deregister(c))}safeToRemove(){const{safeToRemove:n}=this.props;n&&n()}render(){return null}}function MeasureLayout(t){const[n,o]=usePresence(),s=React.useContext(LayoutGroupContext);return React.createElement(MeasureLayoutWithContext,{...t,layoutGroup:s,switchLayoutGroup:React.useContext(SwitchLayoutGroupContext),isPresent:n,safeToRemove:o})}const defaultScaleCorrectors={borderRadius:{...correctBorderRadius,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:correctBorderRadius,borderTopRightRadius:correctBorderRadius,borderBottomLeftRadius:correctBorderRadius,borderBottomRightRadius:correctBorderRadius,boxShadow:correctBoxShadow},borders=["TopLeft","TopRight","BottomLeft","BottomRight"],numBorders=borders.length,asNumber=t=>typeof t=="string"?parseFloat(t):t,isPx=t=>typeof t=="number"||px.test(t);function mixValues(t,n,o,s,c,d){c?(t.opacity=mixNumber$1(0,o.opacity!==void 0?o.opacity:1,easeCrossfadeIn(s)),t.opacityExit=mixNumber$1(n.opacity!==void 0?n.opacity:1,0,easeCrossfadeOut(s))):d&&(t.opacity=mixNumber$1(n.opacity!==void 0?n.opacity:1,o.opacity!==void 0?o.opacity:1,s));for(let h=0;h<numBorders;h++){const p=`border${borders[h]}Radius`;let y=getRadius(n,p),E=getRadius(o,p);if(y===void 0&&E===void 0)continue;y||(y=0),E||(E=0),y===0||E===0||isPx(y)===isPx(E)?(t[p]=Math.max(mixNumber$1(asNumber(y),asNumber(E),s),0),(percent.test(E)||percent.test(y))&&(t[p]+="%")):t[p]=E}(n.rotate||o.rotate)&&(t.rotate=mixNumber$1(n.rotate||0,o.rotate||0,s))}function getRadius(t,n){return t[n]!==void 0?t[n]:t.borderRadius}const easeCrossfadeIn=compress(0,.5,circOut),easeCrossfadeOut=compress(.5,.95,noop$1);function compress(t,n,o){return s=>s<t?0:s>n?1:o(progress(t,n,s))}function copyAxisInto(t,n){t.min=n.min,t.max=n.max}function copyBoxInto(t,n){copyAxisInto(t.x,n.x),copyAxisInto(t.y,n.y)}function removePointDelta(t,n,o,s,c){return t-=n,t=scalePoint(t,1/o,s),c!==void 0&&(t=scalePoint(t,1/c,s)),t}function removeAxisDelta(t,n=0,o=1,s=.5,c,d=t,h=t){if(percent.test(n)&&(n=parseFloat(n),n=mixNumber$1(h.min,h.max,n/100)-h.min),typeof n!="number")return;let p=mixNumber$1(d.min,d.max,s);t===d&&(p-=n),t.min=removePointDelta(t.min,n,o,p,c),t.max=removePointDelta(t.max,n,o,p,c)}function removeAxisTransforms(t,n,[o,s,c],d,h){removeAxisDelta(t,n[o],n[s],n[c],n.scale,d,h)}const xKeys=["x","scaleX","originX"],yKeys=["y","scaleY","originY"];function removeBoxTransforms(t,n,o,s){removeAxisTransforms(t.x,n,xKeys,o?o.x:void 0,s?s.x:void 0),removeAxisTransforms(t.y,n,yKeys,o?o.y:void 0,s?s.y:void 0)}function isAxisDeltaZero(t){return t.translate===0&&t.scale===1}function isDeltaZero(t){return isAxisDeltaZero(t.x)&&isAxisDeltaZero(t.y)}function boxEquals(t,n){return t.x.min===n.x.min&&t.x.max===n.x.max&&t.y.min===n.y.min&&t.y.max===n.y.max}function boxEqualsRounded(t,n){return Math.round(t.x.min)===Math.round(n.x.min)&&Math.round(t.x.max)===Math.round(n.x.max)&&Math.round(t.y.min)===Math.round(n.y.min)&&Math.round(t.y.max)===Math.round(n.y.max)}function aspectRatio(t){return calcLength(t.x)/calcLength(t.y)}class NodeStack{constructor(){this.members=[]}add(n){addUniqueItem(this.members,n),n.scheduleRender()}remove(n){if(removeItem(this.members,n),n===this.prevLead&&(this.prevLead=void 0),n===this.lead){const o=this.members[this.members.length-1];o&&this.promote(o)}}relegate(n){const o=this.members.findIndex(c=>n===c);if(o===0)return!1;let s;for(let c=o;c>=0;c--){const d=this.members[c];if(d.isPresent!==!1){s=d;break}}return s?(this.promote(s),!0):!1}promote(n,o){const s=this.lead;if(n!==s&&(this.prevLead=s,this.lead=n,n.show(),s)){s.instance&&s.scheduleRender(),n.scheduleRender(),n.resumeFrom=s,o&&(n.resumeFrom.preserveOpacity=!0),s.snapshot&&(n.snapshot=s.snapshot,n.snapshot.latestValues=s.animationValues||s.latestValues),n.root&&n.root.isUpdating&&(n.isLayoutDirty=!0);const{crossfade:c}=n.options;c===!1&&s.hide()}}exitAnimationComplete(){this.members.forEach(n=>{const{options:o,resumingFrom:s}=n;o.onExitComplete&&o.onExitComplete(),s&&s.options.onExitComplete&&s.options.onExitComplete()})}scheduleRender(){this.members.forEach(n=>{n.instance&&n.scheduleRender(!1)})}removeLeadSnapshot(){this.lead&&this.lead.snapshot&&(this.lead.snapshot=void 0)}}function buildProjectionTransform(t,n,o){let s="";const c=t.x.translate/n.x,d=t.y.translate/n.y,h=(o==null?void 0:o.z)||0;if((c||d||h)&&(s=`translate3d(${c}px, ${d}px, ${h}px) `),(n.x!==1||n.y!==1)&&(s+=`scale(${1/n.x}, ${1/n.y}) `),o){const{transformPerspective:E,rotate:L,rotateX:F,rotateY:N,skewX:z,skewY:oe}=o;E&&(s=`perspective(${E}px) ${s}`),L&&(s+=`rotate(${L}deg) `),F&&(s+=`rotateX(${F}deg) `),N&&(s+=`rotateY(${N}deg) `),z&&(s+=`skewX(${z}deg) `),oe&&(s+=`skewY(${oe}deg) `)}const p=t.x.scale*n.x,y=t.y.scale*n.y;return(p!==1||y!==1)&&(s+=`scale(${p}, ${y})`),s||"none"}const compareByDepth=(t,n)=>t.depth-n.depth;class FlatTree{constructor(){this.children=[],this.isDirty=!1}add(n){addUniqueItem(this.children,n),this.isDirty=!0}remove(n){removeItem(this.children,n),this.isDirty=!0}forEach(n){this.isDirty&&this.children.sort(compareByDepth),this.isDirty=!1,this.children.forEach(n)}}function delay(t,n){const o=time.now(),s=({timestamp:c})=>{const d=c-o;d>=n&&(cancelFrame(s),t(d-n))};return frame.read(s,!0),()=>cancelFrame(s)}function record(t){window.MotionDebug&&window.MotionDebug.record(t)}function isSVGElement(t){return t instanceof SVGElement&&t.tagName!=="svg"}function animateSingleValue(t,n,o){const s=isMotionValue(t)?t:motionValue(t);return s.start(animateMotionValue("",s,n,o)),s.animation}const transformAxes=["","X","Y","Z"],hiddenVisibility={visibility:"hidden"},animationTarget=1e3;let id=0;const projectionFrameData={type:"projectionFrame",totalNodes:0,resolvedTargetDeltas:0,recalculatedProjection:0};function resetDistortingTransform(t,n,o,s){const{latestValues:c}=n;c[t]&&(o[t]=c[t],n.setStaticValue(t,0),s&&(s[t]=0))}function createProjectionNode({attachResizeListener:t,defaultParent:n,measureScroll:o,checkIsScrollRoot:s,resetTransform:c}){return class{constructor(h={},p=n==null?void 0:n()){this.id=id++,this.animationId=0,this.children=new Set,this.options={},this.isTreeAnimating=!1,this.isAnimationBlocked=!1,this.isLayoutDirty=!1,this.isProjectionDirty=!1,this.isSharedProjectionDirty=!1,this.isTransformDirty=!1,this.updateManuallyBlocked=!1,this.updateBlockedByResize=!1,this.isUpdating=!1,this.isSVG=!1,this.needsReset=!1,this.shouldResetTransform=!1,this.treeScale={x:1,y:1},this.eventHandlers=new Map,this.hasTreeAnimated=!1,this.updateScheduled=!1,this.projectionUpdateScheduled=!1,this.checkUpdateFailed=()=>{this.isUpdating&&(this.isUpdating=!1,this.clearAllSnapshots())},this.updateProjection=()=>{this.projectionUpdateScheduled=!1,projectionFrameData.totalNodes=projectionFrameData.resolvedTargetDeltas=projectionFrameData.recalculatedProjection=0,this.nodes.forEach(propagateDirtyNodes),this.nodes.forEach(resolveTargetDelta),this.nodes.forEach(calcProjection),this.nodes.forEach(cleanDirtyNodes),record(projectionFrameData)},this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=h,this.root=p?p.root||p:this,this.path=p?[...p.path,p]:[],this.parent=p,this.depth=p?p.depth+1:0;for(let y=0;y<this.path.length;y++)this.path[y].shouldResetTransform=!0;this.root===this&&(this.nodes=new FlatTree)}addEventListener(h,p){return this.eventHandlers.has(h)||this.eventHandlers.set(h,new SubscriptionManager),this.eventHandlers.get(h).add(p)}notifyListeners(h,...p){const y=this.eventHandlers.get(h);y&&y.notify(...p)}hasListeners(h){return this.eventHandlers.has(h)}mount(h,p=this.root.hasTreeAnimated){if(this.instance)return;this.isSVG=isSVGElement(h),this.instance=h;const{layoutId:y,layout:E,visualElement:L}=this.options;if(L&&!L.current&&L.mount(h),this.root.nodes.add(this),this.parent&&this.parent.children.add(this),p&&(E||y)&&(this.isLayoutDirty=!0),t){let F;const N=()=>this.root.updateBlockedByResize=!1;t(h,()=>{this.root.updateBlockedByResize=!0,F&&F(),F=delay(N,250),globalProjectionState.hasAnimatedSinceResize&&(globalProjectionState.hasAnimatedSinceResize=!1,this.nodes.forEach(finishAnimation))})}y&&this.root.registerSharedNode(y,this),this.options.animate!==!1&&L&&(y||E)&&this.addEventListener("didUpdate",({delta:F,hasLayoutChanged:N,hasRelativeTargetChanged:z,layout:oe})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}const W=this.options.transition||L.getDefaultTransition()||defaultLayoutTransition,{onLayoutAnimationStart:nt,onLayoutAnimationComplete:lt}=L.getProps(),Ee=!this.targetLayout||!boxEqualsRounded(this.targetLayout,oe)||z,yt=!N&&z;if(this.options.layoutRoot||this.resumeFrom&&this.resumeFrom.instance||yt||N&&(Ee||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0),this.setAnimationOrigin(F,yt);const Ai={...getValueTransition(W,"layout"),onPlay:nt,onComplete:lt};(L.shouldReduceMotion||this.options.layoutRoot)&&(Ai.delay=0,Ai.type=!1),this.startAnimation(Ai)}else N||finishAnimation(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=oe})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);const h=this.getStack();h&&h.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,cancelFrame(this.updateProjection)}blockUpdate(){this.updateManuallyBlocked=!0}unblockUpdate(){this.updateManuallyBlocked=!1}isUpdateBlocked(){return this.updateManuallyBlocked||this.updateBlockedByResize}isTreeAnimationBlocked(){return this.isAnimationBlocked||this.parent&&this.parent.isTreeAnimationBlocked()||!1}startUpdate(){this.isUpdateBlocked()||(this.isUpdating=!0,this.nodes&&this.nodes.forEach(resetSkewAndRotation),this.animationId++)}getTransformTemplate(){const{visualElement:h}=this.options;return h&&h.getProps().transformTemplate}willUpdate(h=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked()){this.options.onExitComplete&&this.options.onExitComplete();return}if(!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let L=0;L<this.path.length;L++){const F=this.path[L];F.shouldResetTransform=!0,F.updateScroll("snapshot"),F.options.layoutRoot&&F.willUpdate(!1)}const{layoutId:p,layout:y}=this.options;if(p===void 0&&!y)return;const E=this.getTransformTemplate();this.prevTransformTemplateValue=E?E(this.latestValues,""):void 0,this.updateSnapshot(),h&&this.notifyListeners("willUpdate")}update(){if(this.updateScheduled=!1,this.isUpdateBlocked()){this.unblockUpdate(),this.clearAllSnapshots(),this.nodes.forEach(clearMeasurements);return}this.isUpdating||this.nodes.forEach(clearIsLayoutDirty),this.isUpdating=!1,window.HandoffCancelAllAnimations&&window.HandoffCancelAllAnimations(),this.nodes.forEach(resetTransformStyle),this.nodes.forEach(updateLayout),this.nodes.forEach(notifyLayoutUpdate),this.clearAllSnapshots();const p=time.now();frameData.delta=clamp(0,1e3/60,p-frameData.timestamp),frameData.timestamp=p,frameData.isProcessing=!0,steps.update.process(frameData),steps.preRender.process(frameData),steps.render.process(frameData),frameData.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,microtask.read(()=>this.update()))}clearAllSnapshots(){this.nodes.forEach(clearSnapshot),this.sharedNodes.forEach(removeLeadSnapshots)}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,frame.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){frame.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){this.snapshot||!this.instance||(this.snapshot=this.measure())}updateLayout(){if(!this.instance||(this.updateScroll(),!(this.options.alwaysMeasureLayout&&this.isLead())&&!this.isLayoutDirty))return;if(this.resumeFrom&&!this.resumeFrom.instance)for(let y=0;y<this.path.length;y++)this.path[y].updateScroll();const h=this.layout;this.layout=this.measure(!1),this.layoutCorrected=createBox(),this.isLayoutDirty=!1,this.projectionDelta=void 0,this.notifyListeners("measure",this.layout.layoutBox);const{visualElement:p}=this.options;p&&p.notify("LayoutMeasure",this.layout.layoutBox,h?h.layoutBox:void 0)}updateScroll(h="measure"){let p=!!(this.options.layoutScroll&&this.instance);this.scroll&&this.scroll.animationId===this.root.animationId&&this.scroll.phase===h&&(p=!1),p&&(this.scroll={animationId:this.root.animationId,phase:h,isRoot:s(this.instance),offset:o(this.instance)})}resetTransform(){if(!c)return;const h=this.isLayoutDirty||this.shouldResetTransform,p=this.projectionDelta&&!isDeltaZero(this.projectionDelta),y=this.getTransformTemplate(),E=y?y(this.latestValues,""):void 0,L=E!==this.prevTransformTemplateValue;h&&(p||hasTransform(this.latestValues)||L)&&(c(this.instance,E),this.shouldResetTransform=!1,this.scheduleRender())}measure(h=!0){const p=this.measurePageBox();let y=this.removeElementScroll(p);return h&&(y=this.removeTransform(y)),roundBox(y),{animationId:this.root.animationId,measuredBox:p,layoutBox:y,latestValues:{},source:this.id}}measurePageBox(){const{visualElement:h}=this.options;if(!h)return createBox();const p=h.measureViewportBox(),{scroll:y}=this.root;return y&&(translateAxis(p.x,y.offset.x),translateAxis(p.y,y.offset.y)),p}removeElementScroll(h){const p=createBox();copyBoxInto(p,h);for(let y=0;y<this.path.length;y++){const E=this.path[y],{scroll:L,options:F}=E;if(E!==this.root&&L&&F.layoutScroll){if(L.isRoot){copyBoxInto(p,h);const{scroll:N}=this.root;N&&(translateAxis(p.x,-N.offset.x),translateAxis(p.y,-N.offset.y))}translateAxis(p.x,L.offset.x),translateAxis(p.y,L.offset.y)}}return p}applyTransform(h,p=!1){const y=createBox();copyBoxInto(y,h);for(let E=0;E<this.path.length;E++){const L=this.path[E];!p&&L.options.layoutScroll&&L.scroll&&L!==L.root&&transformBox(y,{x:-L.scroll.offset.x,y:-L.scroll.offset.y}),hasTransform(L.latestValues)&&transformBox(y,L.latestValues)}return hasTransform(this.latestValues)&&transformBox(y,this.latestValues),y}removeTransform(h){const p=createBox();copyBoxInto(p,h);for(let y=0;y<this.path.length;y++){const E=this.path[y];if(!E.instance||!hasTransform(E.latestValues))continue;hasScale(E.latestValues)&&E.updateSnapshot();const L=createBox(),F=E.measurePageBox();copyBoxInto(L,F),removeBoxTransforms(p,E.latestValues,E.snapshot?E.snapshot.layoutBox:void 0,L)}return hasTransform(this.latestValues)&&removeBoxTransforms(p,this.latestValues),p}setTargetDelta(h){this.targetDelta=h,this.root.scheduleUpdateProjection(),this.isProjectionDirty=!0}setOptions(h){this.options={...this.options,...h,crossfade:h.crossfade!==void 0?h.crossfade:!0}}clearMeasurements(){this.scroll=void 0,this.layout=void 0,this.snapshot=void 0,this.prevTransformTemplateValue=void 0,this.targetDelta=void 0,this.target=void 0,this.isLayoutDirty=!1}forceRelativeParentToResolveTarget(){this.relativeParent&&this.relativeParent.resolvedRelativeTargetAt!==frameData.timestamp&&this.relativeParent.resolveTargetDelta(!0)}resolveTargetDelta(h=!1){var p;const y=this.getLead();this.isProjectionDirty||(this.isProjectionDirty=y.isProjectionDirty),this.isTransformDirty||(this.isTransformDirty=y.isTransformDirty),this.isSharedProjectionDirty||(this.isSharedProjectionDirty=y.isSharedProjectionDirty);const E=!!this.resumingFrom||this!==y;if(!(h||E&&this.isSharedProjectionDirty||this.isProjectionDirty||!((p=this.parent)===null||p===void 0)&&p.isProjectionDirty||this.attemptToResolveRelativeTarget))return;const{layout:F,layoutId:N}=this.options;if(!(!this.layout||!(F||N))){if(this.resolvedRelativeTargetAt=frameData.timestamp,!this.targetDelta&&!this.relativeTarget){const z=this.getClosestProjectingParent();z&&z.layout&&this.animationProgress!==1?(this.relativeParent=z,this.forceRelativeParentToResolveTarget(),this.relativeTarget=createBox(),this.relativeTargetOrigin=createBox(),calcRelativePosition(this.relativeTargetOrigin,this.layout.layoutBox,z.layout.layoutBox),copyBoxInto(this.relativeTarget,this.relativeTargetOrigin)):this.relativeParent=this.relativeTarget=void 0}if(!(!this.relativeTarget&&!this.targetDelta)){if(this.target||(this.target=createBox(),this.targetWithTransforms=createBox()),this.relativeTarget&&this.relativeTargetOrigin&&this.relativeParent&&this.relativeParent.target?(this.forceRelativeParentToResolveTarget(),calcRelativeBox(this.target,this.relativeTarget,this.relativeParent.target)):this.targetDelta?(this.resumingFrom?this.target=this.applyTransform(this.layout.layoutBox):copyBoxInto(this.target,this.layout.layoutBox),applyBoxDelta(this.target,this.targetDelta)):copyBoxInto(this.target,this.layout.layoutBox),this.attemptToResolveRelativeTarget){this.attemptToResolveRelativeTarget=!1;const z=this.getClosestProjectingParent();z&&!!z.resumingFrom==!!this.resumingFrom&&!z.options.layoutScroll&&z.target&&this.animationProgress!==1?(this.relativeParent=z,this.forceRelativeParentToResolveTarget(),this.relativeTarget=createBox(),this.relativeTargetOrigin=createBox(),calcRelativePosition(this.relativeTargetOrigin,this.target,z.target),copyBoxInto(this.relativeTarget,this.relativeTargetOrigin)):this.relativeParent=this.relativeTarget=void 0}projectionFrameData.resolvedTargetDeltas++}}}getClosestProjectingParent(){if(!(!this.parent||hasScale(this.parent.latestValues)||has2DTranslate(this.parent.latestValues)))return this.parent.isProjecting()?this.parent:this.parent.getClosestProjectingParent()}isProjecting(){return!!((this.relativeTarget||this.targetDelta||this.options.layoutRoot)&&this.layout)}calcProjection(){var h;const p=this.getLead(),y=!!this.resumingFrom||this!==p;let E=!0;if((this.isProjectionDirty||!((h=this.parent)===null||h===void 0)&&h.isProjectionDirty)&&(E=!1),y&&(this.isSharedProjectionDirty||this.isTransformDirty)&&(E=!1),this.resolvedRelativeTargetAt===frameData.timestamp&&(E=!1),E)return;const{layout:L,layoutId:F}=this.options;if(this.isTreeAnimating=!!(this.parent&&this.parent.isTreeAnimating||this.currentAnimation||this.pendingAnimation),this.isTreeAnimating||(this.targetDelta=this.relativeTarget=void 0),!this.layout||!(L||F))return;copyBoxInto(this.layoutCorrected,this.layout.layoutBox);const N=this.treeScale.x,z=this.treeScale.y;applyTreeDeltas(this.layoutCorrected,this.treeScale,this.path,y),p.layout&&!p.target&&(this.treeScale.x!==1||this.treeScale.y!==1)&&(p.target=p.layout.layoutBox,p.targetWithTransforms=createBox());const{target:oe}=p;if(!oe){this.projectionTransform&&(this.projectionDelta=createDelta(),this.projectionTransform="none",this.scheduleRender());return}this.projectionDelta||(this.projectionDelta=createDelta(),this.projectionDeltaWithTransform=createDelta());const W=this.projectionTransform;calcBoxDelta(this.projectionDelta,this.layoutCorrected,oe,this.latestValues),this.projectionTransform=buildProjectionTransform(this.projectionDelta,this.treeScale),(this.projectionTransform!==W||this.treeScale.x!==N||this.treeScale.y!==z)&&(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners("projectionUpdate",oe)),projectionFrameData.recalculatedProjection++}hide(){this.isVisible=!1}show(){this.isVisible=!0}scheduleRender(h=!0){if(this.options.scheduleRender&&this.options.scheduleRender(),h){const p=this.getStack();p&&p.scheduleRender()}this.resumingFrom&&!this.resumingFrom.instance&&(this.resumingFrom=void 0)}setAnimationOrigin(h,p=!1){const y=this.snapshot,E=y?y.latestValues:{},L={...this.latestValues},F=createDelta();(!this.relativeParent||!this.relativeParent.options.layoutRoot)&&(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!p;const N=createBox(),z=y?y.source:void 0,oe=this.layout?this.layout.source:void 0,W=z!==oe,nt=this.getStack(),lt=!nt||nt.members.length<=1,Ee=!!(W&&!lt&&this.options.crossfade===!0&&!this.path.some(hasOpacityCrossfade));this.animationProgress=0;let yt;this.mixTargetDelta=Ai=>{const zi=Ai/1e3;mixAxisDelta(F.x,h.x,zi),mixAxisDelta(F.y,h.y,zi),this.setTargetDelta(F),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(calcRelativePosition(N,this.layout.layoutBox,this.relativeParent.layout.layoutBox),mixBox(this.relativeTarget,this.relativeTargetOrigin,N,zi),yt&&boxEquals(this.relativeTarget,yt)&&(this.isProjectionDirty=!1),yt||(yt=createBox()),copyBoxInto(yt,this.relativeTarget)),W&&(this.animationValues=L,mixValues(L,E,this.latestValues,zi,Ee,lt)),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=zi},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(h){this.notifyListeners("animationStart"),this.currentAnimation&&this.currentAnimation.stop(),this.resumingFrom&&this.resumingFrom.currentAnimation&&this.resumingFrom.currentAnimation.stop(),this.pendingAnimation&&(cancelFrame(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=frame.update(()=>{globalProjectionState.hasAnimatedSinceResize=!0,this.currentAnimation=animateSingleValue(0,animationTarget,{...h,onUpdate:p=>{this.mixTargetDelta(p),h.onUpdate&&h.onUpdate(p)},onComplete:()=>{h.onComplete&&h.onComplete(),this.completeAnimation()}}),this.resumingFrom&&(this.resumingFrom.currentAnimation=this.currentAnimation),this.pendingAnimation=void 0})}completeAnimation(){this.resumingFrom&&(this.resumingFrom.currentAnimation=void 0,this.resumingFrom.preserveOpacity=void 0);const h=this.getStack();h&&h.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(animationTarget),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const h=this.getLead();let{targetWithTransforms:p,target:y,layout:E,latestValues:L}=h;if(!(!p||!y||!E)){if(this!==h&&this.layout&&E&&shouldAnimatePositionOnly(this.options.animationType,this.layout.layoutBox,E.layoutBox)){y=this.target||createBox();const F=calcLength(this.layout.layoutBox.x);y.x.min=h.target.x.min,y.x.max=y.x.min+F;const N=calcLength(this.layout.layoutBox.y);y.y.min=h.target.y.min,y.y.max=y.y.min+N}copyBoxInto(p,y),transformBox(p,L),calcBoxDelta(this.projectionDeltaWithTransform,this.layoutCorrected,p,L)}}registerSharedNode(h,p){this.sharedNodes.has(h)||this.sharedNodes.set(h,new NodeStack),this.sharedNodes.get(h).add(p);const E=p.options.initialPromotionConfig;p.promote({transition:E?E.transition:void 0,preserveFollowOpacity:E&&E.shouldPreserveFollowOpacity?E.shouldPreserveFollowOpacity(p):void 0})}isLead(){const h=this.getStack();return h?h.lead===this:!0}getLead(){var h;const{layoutId:p}=this.options;return p?((h=this.getStack())===null||h===void 0?void 0:h.lead)||this:this}getPrevLead(){var h;const{layoutId:p}=this.options;return p?(h=this.getStack())===null||h===void 0?void 0:h.prevLead:void 0}getStack(){const{layoutId:h}=this.options;if(h)return this.root.sharedNodes.get(h)}promote({needsReset:h,transition:p,preserveFollowOpacity:y}={}){const E=this.getStack();E&&E.promote(this,y),h&&(this.projectionDelta=void 0,this.needsReset=!0),p&&this.setOptions({transition:p})}relegate(){const h=this.getStack();return h?h.relegate(this):!1}resetSkewAndRotation(){const{visualElement:h}=this.options;if(!h)return;let p=!1;const{latestValues:y}=h;if((y.z||y.rotate||y.rotateX||y.rotateY||y.rotateZ||y.skewX||y.skewY)&&(p=!0),!p)return;const E={};y.z&&resetDistortingTransform("z",h,E,this.animationValues);for(let L=0;L<transformAxes.length;L++)resetDistortingTransform(`rotate${transformAxes[L]}`,h,E,this.animationValues),resetDistortingTransform(`skew${transformAxes[L]}`,h,E,this.animationValues);h.render();for(const L in E)h.setStaticValue(L,E[L]),this.animationValues&&(this.animationValues[L]=E[L]);h.scheduleRender()}getProjectionStyles(h){var p,y;if(!this.instance||this.isSVG)return;if(!this.isVisible)return hiddenVisibility;const E={visibility:""},L=this.getTransformTemplate();if(this.needsReset)return this.needsReset=!1,E.opacity="",E.pointerEvents=resolveMotionValue(h==null?void 0:h.pointerEvents)||"",E.transform=L?L(this.latestValues,""):"none",E;const F=this.getLead();if(!this.projectionDelta||!this.layout||!F.target){const W={};return this.options.layoutId&&(W.opacity=this.latestValues.opacity!==void 0?this.latestValues.opacity:1,W.pointerEvents=resolveMotionValue(h==null?void 0:h.pointerEvents)||""),this.hasProjected&&!hasTransform(this.latestValues)&&(W.transform=L?L({},""):"none",this.hasProjected=!1),W}const N=F.animationValues||F.latestValues;this.applyTransformsToTarget(),E.transform=buildProjectionTransform(this.projectionDeltaWithTransform,this.treeScale,N),L&&(E.transform=L(N,E.transform));const{x:z,y:oe}=this.projectionDelta;E.transformOrigin=`${z.origin*100}% ${oe.origin*100}% 0`,F.animationValues?E.opacity=F===this?(y=(p=N.opacity)!==null&&p!==void 0?p:this.latestValues.opacity)!==null&&y!==void 0?y:1:this.preserveOpacity?this.latestValues.opacity:N.opacityExit:E.opacity=F===this?N.opacity!==void 0?N.opacity:"":N.opacityExit!==void 0?N.opacityExit:0;for(const W in scaleCorrectors){if(N[W]===void 0)continue;const{correct:nt,applyTo:lt}=scaleCorrectors[W],Ee=E.transform==="none"?N[W]:nt(N[W],F);if(lt){const yt=lt.length;for(let Ai=0;Ai<yt;Ai++)E[lt[Ai]]=Ee}else E[W]=Ee}return this.options.layoutId&&(E.pointerEvents=F===this?resolveMotionValue(h==null?void 0:h.pointerEvents)||"":"none"),E}clearSnapshot(){this.resumeFrom=this.snapshot=void 0}resetTree(){this.root.nodes.forEach(h=>{var p;return(p=h.currentAnimation)===null||p===void 0?void 0:p.stop()}),this.root.nodes.forEach(clearMeasurements),this.root.sharedNodes.clear()}}}function updateLayout(t){t.updateLayout()}function notifyLayoutUpdate(t){var n;const o=((n=t.resumeFrom)===null||n===void 0?void 0:n.snapshot)||t.snapshot;if(t.isLead()&&t.layout&&o&&t.hasListeners("didUpdate")){const{layoutBox:s,measuredBox:c}=t.layout,{animationType:d}=t.options,h=o.source!==t.layout.source;d==="size"?eachAxis(F=>{const N=h?o.measuredBox[F]:o.layoutBox[F],z=calcLength(N);N.min=s[F].min,N.max=N.min+z}):shouldAnimatePositionOnly(d,o.layoutBox,s)&&eachAxis(F=>{const N=h?o.measuredBox[F]:o.layoutBox[F],z=calcLength(s[F]);N.max=N.min+z,t.relativeTarget&&!t.currentAnimation&&(t.isProjectionDirty=!0,t.relativeTarget[F].max=t.relativeTarget[F].min+z)});const p=createDelta();calcBoxDelta(p,s,o.layoutBox);const y=createDelta();h?calcBoxDelta(y,t.applyTransform(c,!0),o.measuredBox):calcBoxDelta(y,s,o.layoutBox);const E=!isDeltaZero(p);let L=!1;if(!t.resumeFrom){const F=t.getClosestProjectingParent();if(F&&!F.resumeFrom){const{snapshot:N,layout:z}=F;if(N&&z){const oe=createBox();calcRelativePosition(oe,o.layoutBox,N.layoutBox);const W=createBox();calcRelativePosition(W,s,z.layoutBox),boxEqualsRounded(oe,W)||(L=!0),F.options.layoutRoot&&(t.relativeTarget=W,t.relativeTargetOrigin=oe,t.relativeParent=F)}}}t.notifyListeners("didUpdate",{layout:s,snapshot:o,delta:y,layoutDelta:p,hasLayoutChanged:E,hasRelativeTargetChanged:L})}else if(t.isLead()){const{onExitComplete:s}=t.options;s&&s()}t.options.transition=void 0}function propagateDirtyNodes(t){projectionFrameData.totalNodes++,t.parent&&(t.isProjecting()||(t.isProjectionDirty=t.parent.isProjectionDirty),t.isSharedProjectionDirty||(t.isSharedProjectionDirty=!!(t.isProjectionDirty||t.parent.isProjectionDirty||t.parent.isSharedProjectionDirty)),t.isTransformDirty||(t.isTransformDirty=t.parent.isTransformDirty))}function cleanDirtyNodes(t){t.isProjectionDirty=t.isSharedProjectionDirty=t.isTransformDirty=!1}function clearSnapshot(t){t.clearSnapshot()}function clearMeasurements(t){t.clearMeasurements()}function clearIsLayoutDirty(t){t.isLayoutDirty=!1}function resetTransformStyle(t){const{visualElement:n}=t.options;n&&n.getProps().onBeforeLayoutMeasure&&n.notify("BeforeLayoutMeasure"),t.resetTransform()}function finishAnimation(t){t.finishAnimation(),t.targetDelta=t.relativeTarget=t.target=void 0,t.isProjectionDirty=!0}function resolveTargetDelta(t){t.resolveTargetDelta()}function calcProjection(t){t.calcProjection()}function resetSkewAndRotation(t){t.resetSkewAndRotation()}function removeLeadSnapshots(t){t.removeLeadSnapshot()}function mixAxisDelta(t,n,o){t.translate=mixNumber$1(n.translate,0,o),t.scale=mixNumber$1(n.scale,1,o),t.origin=n.origin,t.originPoint=n.originPoint}function mixAxis(t,n,o,s){t.min=mixNumber$1(n.min,o.min,s),t.max=mixNumber$1(n.max,o.max,s)}function mixBox(t,n,o,s){mixAxis(t.x,n.x,o.x,s),mixAxis(t.y,n.y,o.y,s)}function hasOpacityCrossfade(t){return t.animationValues&&t.animationValues.opacityExit!==void 0}const defaultLayoutTransition={duration:.45,ease:[.4,0,.1,1]},userAgentContains=t=>typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(t),roundPoint=userAgentContains("applewebkit/")&&!userAgentContains("chrome/")?Math.round:noop$1;function roundAxis(t){t.min=roundPoint(t.min),t.max=roundPoint(t.max)}function roundBox(t){roundAxis(t.x),roundAxis(t.y)}function shouldAnimatePositionOnly(t,n,o){return t==="position"||t==="preserve-aspect"&&!isNear(aspectRatio(n),aspectRatio(o),.2)}const DocumentProjectionNode=createProjectionNode({attachResizeListener:(t,n)=>addDomEvent(t,"resize",n),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body.scrollLeft,y:document.documentElement.scrollTop||document.body.scrollTop}),checkIsScrollRoot:()=>!0}),rootProjectionNode={current:void 0},HTMLProjectionNode=createProjectionNode({measureScroll:t=>({x:t.scrollLeft,y:t.scrollTop}),defaultParent:()=>{if(!rootProjectionNode.current){const t=new DocumentProjectionNode({});t.mount(window),t.setOptions({layoutScroll:!0}),rootProjectionNode.current=t}return rootProjectionNode.current},resetTransform:(t,n)=>{t.style.transform=n!==void 0?n:"none"},checkIsScrollRoot:t=>window.getComputedStyle(t).position==="fixed"}),drag={pan:{Feature:PanGesture},drag:{Feature:DragGesture,ProjectionNode:HTMLProjectionNode,MeasureLayout}},prefersReducedMotion={current:null},hasReducedMotionListener={current:!1};function initPrefersReducedMotion(){if(hasReducedMotionListener.current=!0,!!isBrowser)if(window.matchMedia){const t=window.matchMedia("(prefers-reduced-motion)"),n=()=>prefersReducedMotion.current=t.matches;t.addListener(n),n()}else prefersReducedMotion.current=!1}function updateMotionValuesFromProps(t,n,o){const{willChange:s}=n;for(const c in n){const d=n[c],h=o[c];if(isMotionValue(d))t.addValue(c,d),isWillChangeMotionValue(s)&&s.add(c),process.env.NODE_ENV==="development"&&warnOnce(d.version==="11.0.27",`Attempting to mix Framer Motion versions ${d.version} with 11.0.27 may not work as expected.`);else if(isMotionValue(h))t.addValue(c,motionValue(d,{owner:t})),isWillChangeMotionValue(s)&&s.remove(c);else if(h!==d)if(t.hasValue(c)){const p=t.getValue(c);p.liveStyle===!0?p.jump(d):p.hasAnimated||p.set(d)}else{const p=t.getStaticValue(c);t.addValue(c,motionValue(p!==void 0?p:d,{owner:t}))}}for(const c in o)n[c]===void 0&&t.removeValue(c);return n}const visualElementStore=new WeakMap,valueTypes=[...dimensionValueTypes,color,complex],findValueType=t=>valueTypes.find(testValueType(t)),featureNames=Object.keys(featureDefinitions),numFeatures=featureNames.length,propEventHandlers=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"],numVariantProps=variantProps.length;function getClosestProjectingNode(t){if(t)return t.options.allowProjection!==!1?t.projection:getClosestProjectingNode(t.parent)}class VisualElement{constructor({parent:n,props:o,presenceContext:s,reducedMotionConfig:c,blockInitialAnimation:d,visualState:h},p={}){this.resolveKeyframes=(N,z,oe,W)=>new this.KeyframeResolver(N,z,oe,W,this),this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.values=new Map,this.KeyframeResolver=KeyframeResolver,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},this.events={},this.propEventSubscriptions={},this.notifyUpdate=()=>this.notify("Update",this.latestValues),this.render=()=>{this.current&&(this.triggerBuild(),this.renderInstance(this.current,this.renderState,this.props.style,this.projection))},this.scheduleRender=()=>frame.render(this.render,!1,!0);const{latestValues:y,renderState:E}=h;this.latestValues=y,this.baseTarget={...y},this.initialValues=o.initial?{...y}:{},this.renderState=E,this.parent=n,this.props=o,this.presenceContext=s,this.depth=n?n.depth+1:0,this.reducedMotionConfig=c,this.options=p,this.blockInitialAnimation=!!d,this.isControllingVariants=isControllingVariants(o),this.isVariantNode=isVariantNode(o),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=!!(n&&n.current);const{willChange:L,...F}=this.scrapeMotionValuesFromProps(o,{},this);for(const N in F){const z=F[N];y[N]!==void 0&&isMotionValue(z)&&(z.set(y[N],!1),isWillChangeMotionValue(L)&&L.add(N))}}scrapeMotionValuesFromProps(n,o,s){return{}}mount(n){this.current=n,visualElementStore.set(n,this),this.projection&&!this.projection.instance&&this.projection.mount(n),this.parent&&this.isVariantNode&&!this.isControllingVariants&&(this.removeFromVariantTree=this.parent.addVariantChild(this)),this.values.forEach((o,s)=>this.bindToMotionValue(s,o)),hasReducedMotionListener.current||initPrefersReducedMotion(),this.shouldReduceMotion=this.reducedMotionConfig==="never"?!1:this.reducedMotionConfig==="always"?!0:prefersReducedMotion.current,process.env.NODE_ENV!=="production"&&warnOnce(this.shouldReduceMotion!==!0,"You have Reduced Motion enabled on your device. Animations may not appear as expected."),this.parent&&this.parent.children.add(this),this.update(this.props,this.presenceContext)}unmount(){visualElementStore.delete(this.current),this.projection&&this.projection.unmount(),cancelFrame(this.notifyUpdate),cancelFrame(this.render),this.valueSubscriptions.forEach(n=>n()),this.removeFromVariantTree&&this.removeFromVariantTree(),this.parent&&this.parent.children.delete(this);for(const n in this.events)this.events[n].clear();for(const n in this.features)this.features[n].unmount();this.current=null}bindToMotionValue(n,o){const s=transformProps.has(n),c=o.on("change",h=>{this.latestValues[n]=h,this.props.onUpdate&&frame.preRender(this.notifyUpdate),s&&this.projection&&(this.projection.isTransformDirty=!0)}),d=o.on("renderRequest",this.scheduleRender);this.valueSubscriptions.set(n,()=>{c(),d(),o.owner&&o.stop()})}sortNodePosition(n){return!this.current||!this.sortInstanceNodePosition||this.type!==n.type?0:this.sortInstanceNodePosition(this.current,n.current)}loadFeatures({children:n,...o},s,c,d){let h,p;if(process.env.NODE_ENV!=="production"&&c&&s){const y="You have rendered a `motion` component within a `LazyMotion` component. This will break tree shaking. Import and render a `m` component instead.";o.ignoreStrict?warning(!1,y):invariant(!1,y)}for(let y=0;y<numFeatures;y++){const E=featureNames[y],{isEnabled:L,Feature:F,ProjectionNode:N,MeasureLayout:z}=featureDefinitions[E];N&&(h=N),L(o)&&(!this.features[E]&&F&&(this.features[E]=new F(this)),z&&(p=z))}if((this.type==="html"||this.type==="svg")&&!this.projection&&h){this.projection=new h(this.latestValues,getClosestProjectingNode(this.parent));const{layoutId:y,layout:E,drag:L,dragConstraints:F,layoutScroll:N,layoutRoot:z}=o;this.projection.setOptions({layoutId:y,layout:E,alwaysMeasureLayout:!!L||F&&isRefObject(F),visualElement:this,scheduleRender:()=>this.scheduleRender(),animationType:typeof E=="string"?E:"both",initialPromotionConfig:d,layoutScroll:N,layoutRoot:z})}return p}updateFeatures(){for(const n in this.features){const o=this.features[n];o.isMounted?o.update():(o.mount(),o.isMounted=!0)}}triggerBuild(){this.build(this.renderState,this.latestValues,this.options,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):createBox()}getStaticValue(n){return this.latestValues[n]}setStaticValue(n,o){this.latestValues[n]=o}update(n,o){(n.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=n,this.prevPresenceContext=this.presenceContext,this.presenceContext=o;for(let s=0;s<propEventHandlers.length;s++){const c=propEventHandlers[s];this.propEventSubscriptions[c]&&(this.propEventSubscriptions[c](),delete this.propEventSubscriptions[c]);const d=n["on"+c];d&&(this.propEventSubscriptions[c]=this.on(c,d))}this.prevMotionValues=updateMotionValuesFromProps(this,this.scrapeMotionValuesFromProps(n,this.prevProps,this),this.prevMotionValues),this.handleChildMotionValue&&this.handleChildMotionValue()}getProps(){return this.props}getVariant(n){return this.props.variants?this.props.variants[n]:void 0}getDefaultTransition(){return this.props.transition}getTransformPagePoint(){return this.props.transformPagePoint}getClosestVariantNode(){return this.isVariantNode?this:this.parent?this.parent.getClosestVariantNode():void 0}getVariantContext(n=!1){if(n)return this.parent?this.parent.getVariantContext():void 0;if(!this.isControllingVariants){const s=this.parent?this.parent.getVariantContext()||{}:{};return this.props.initial!==void 0&&(s.initial=this.props.initial),s}const o={};for(let s=0;s<numVariantProps;s++){const c=variantProps[s],d=this.props[c];(isVariantLabel(d)||d===!1)&&(o[c]=d)}return o}addVariantChild(n){const o=this.getClosestVariantNode();if(o)return o.variantChildren&&o.variantChildren.add(n),()=>o.variantChildren.delete(n)}addValue(n,o){o!==this.values.get(n)&&(this.removeValue(n),this.bindToMotionValue(n,o)),this.values.set(n,o),this.latestValues[n]=o.get()}removeValue(n){this.values.delete(n);const o=this.valueSubscriptions.get(n);o&&(o(),this.valueSubscriptions.delete(n)),delete this.latestValues[n],this.removeValueFromRenderState(n,this.renderState)}hasValue(n){return this.values.has(n)}getValue(n,o){if(this.props.values&&this.props.values[n])return this.props.values[n];let s=this.values.get(n);return s===void 0&&o!==void 0&&(s=motionValue(o===null?void 0:o,{owner:this}),this.addValue(n,s)),s}readValue(n,o){var s;let c=this.latestValues[n]!==void 0||!this.current?this.latestValues[n]:(s=this.getBaseTargetFromProps(this.props,n))!==null&&s!==void 0?s:this.readValueFromInstance(this.current,n,this.options);return c!=null&&(typeof c=="string"&&(isNumericalString(c)||isZeroValueString(c))?c=parseFloat(c):!findValueType(c)&&complex.test(o)&&(c=getAnimatableNone(n,o)),this.setBaseTarget(n,isMotionValue(c)?c.get():c)),isMotionValue(c)?c.get():c}setBaseTarget(n,o){this.baseTarget[n]=o}getBaseTarget(n){var o,s;const{initial:c}=this.props,d=typeof c=="string"||typeof c=="object"?(s=resolveVariantFromProps(this.props,c,(o=this.presenceContext)===null||o===void 0?void 0:o.custom))===null||s===void 0?void 0:s[n]:void 0;if(c&&d!==void 0)return d;const h=this.getBaseTargetFromProps(this.props,n);return h!==void 0&&!isMotionValue(h)?h:this.initialValues[n]!==void 0&&d===void 0?void 0:this.baseTarget[n]}on(n,o){return this.events[n]||(this.events[n]=new SubscriptionManager),this.events[n].add(o)}notify(n,...o){this.events[n]&&this.events[n].notify(...o)}}class DOMVisualElement extends VisualElement{constructor(){super(...arguments),this.KeyframeResolver=DOMKeyframesResolver}sortInstanceNodePosition(n,o){return n.compareDocumentPosition(o)&2?1:-1}getBaseTargetFromProps(n,o){return n.style?n.style[o]:void 0}removeValueFromRenderState(n,{vars:o,style:s}){delete o[n],delete s[n]}}function getComputedStyle(t){return window.getComputedStyle(t)}class HTMLVisualElement extends DOMVisualElement{constructor(){super(...arguments),this.type="html"}readValueFromInstance(n,o){if(transformProps.has(o)){const s=getDefaultValueType(o);return s&&s.default||0}else{const s=getComputedStyle(n),c=(isCSSVariableName(o)?s.getPropertyValue(o):s[o])||0;return typeof c=="string"?c.trim():c}}measureInstanceViewportBox(n,{transformPagePoint:o}){return measureViewportBox(n,o)}build(n,o,s,c){buildHTMLStyles(n,o,s,c.transformTemplate)}scrapeMotionValuesFromProps(n,o,s){return scrapeMotionValuesFromProps$1(n,o,s)}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:n}=this.props;isMotionValue(n)&&(this.childSubscription=n.on("change",o=>{this.current&&(this.current.textContent=`${o}`)}))}renderInstance(n,o,s,c){renderHTML(n,o,s,c)}}class SVGVisualElement extends DOMVisualElement{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1}getBaseTargetFromProps(n,o){return n[o]}readValueFromInstance(n,o){if(transformProps.has(o)){const s=getDefaultValueType(o);return s&&s.default||0}return o=camelCaseAttributes.has(o)?o:camelToDash(o),n.getAttribute(o)}measureInstanceViewportBox(){return createBox()}scrapeMotionValuesFromProps(n,o){return scrapeMotionValuesFromProps(n,o,this)}build(n,o,s,c){buildSVGAttrs(n,o,s,this.isSVGTag,c.transformTemplate)}renderInstance(n,o,s,c){renderSVG(n,o,s,c)}mount(n){this.isSVGTag=isSVGTag(n.tagName),super.mount(n)}}const createDomVisualElement=(t,n)=>isSVGComponent(t)?new SVGVisualElement(n,{enableHardwareAcceleration:!1}):new HTMLVisualElement(n,{allowProjection:t!==React.Fragment,enableHardwareAcceleration:!0}),layout={layout:{ProjectionNode:HTMLProjectionNode,MeasureLayout}},preloadedFeatures={...animations,...gestureAnimations,...drag,...layout},motion=createMotionProxy((t,n)=>createDomMotionConfig(t,n,preloadedFeatures,createDomVisualElement));function useMotionValue(t){const n=useConstant(()=>motionValue(t)),{isStatic:o}=React.useContext(MotionConfigContext);if(o){const[,s]=React.useState(t);React.useEffect(()=>n.on("change",s),[])}return n}function assignRef(t,n){return typeof t=="function"?t(n):t&&(t.current=n),t}function useCallbackRef(t,n){var o=React.useState(function(){return{value:t,callback:n,facade:{get current(){return o.value},set current(s){var c=o.value;c!==s&&(o.value=s,o.callback(s,c))}}}})[0];return o.callback=n,o.facade}var useIsomorphicLayoutEffect=typeof window<"u"?React__namespace.useLayoutEffect:React__namespace.useEffect,currentValues=new WeakMap;function useMergeRefs(t,n){var o=useCallbackRef(null,function(s){return t.forEach(function(c){return assignRef(c,s)})});return useIsomorphicLayoutEffect(function(){var s=currentValues.get(o);if(s){var c=new Set(s),d=new Set(t),h=o.current;c.forEach(function(p){d.has(p)||assignRef(p,null)}),d.forEach(function(p){c.has(p)||assignRef(p,h)})}currentValues.set(o,t)},[t]),o}const occluder=new EllipsoidalOccluder(Ellipsoid$1.WGS84,Cartesian3.ZERO),ScreenSpaceElement=React.forwardRef(({position:t,children:n,...o},s)=>{const c=useConstant$2(()=>new Cartesian3);t==null||t.clone(c);const d=useMotionValue(""),h=useMotionValue("none"),{toWindowPosition:p,getCamera:y,toXYZ:E,isPositionVisible:L}=useContext(),F=React.useRef(null);usePreRender(()=>{if(F.current==null)return;let z;try{const Ee=p==null?void 0:p([c.x,c.y,c.z]);z=new Cartesian2(Ee==null?void 0:Ee[0],Ee==null?void 0:Ee[1])}catch{h.set("none");return}const oe=y==null?void 0:y();if(!oe)return;const W=E==null?void 0:E(oe==null?void 0:oe.lng,oe==null?void 0:oe.lat,oe==null?void 0:oe.height);if(!W)return;if(occluder.cameraPosition=new Cartesian3(W[0],W[1],W[2]),z==null||z.x<0||z.y<0||z.x>window.innerWidth||z.y>window.innerHeight||!(L!=null&&L([c.x,c.y,c.z]))){h.set("none");return}const nt=`calc(${z.x}px - 50%)`,lt=`calc(${z.y}px - 50%)`;d.set(`translate(${nt}, ${lt})`),h.set("block")});const N=useMergeRefs([F,s]);return jsxRuntimeExports.jsx(motion.div,{ref:N,...o,style:{...o.style,transform:d,display:h,position:"absolute",pointerEvents:"none",left:0,top:0},children:n})});ScreenSpaceElement.displayName="ScreenSpaceElement";const MeasurementLine$1=({a:t,b:n,color:o})=>{const s=React.useRef([t,n]);s.current=[t,n];const c=useConstant$2(()=>new CallbackProperty(()=>s.current,!1)),d=React.useMemo(()=>({polyline:{positions:c,width:1.5,material:new PolylineDashMaterialProperty({color:o,dashLength:8})}}),[o,c]);return jsxRuntimeExports.jsx(Entity,{...d})},ExtrudedMeasurement=({a:t,b:n,extrudedHeight:o,color:s})=>{const c=useConstant$2(()=>new Cartesian3);return jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx(ScreenSpaceElement,{position:Cartesian3.midpoint(t,n,c),children:jsxRuntimeExports.jsx(MeasurementText,{children:o<1e3?`${o.toFixed(1)} m`:`${(o/1e3).toFixed(1)} km`})}),jsxRuntimeExports.jsx(MeasurementLine$1,{a:t,b:n,color:s})]})},cartesianScratch=new Cartesian3,ExtrudedControlPoints=React.memo(({geometryOptions:{controlPoints:t},extrudedHeight:n,color:o})=>{var p;const{viewer:s}=$e$1(),c=t[t.length-1],d=(p=s==null?void 0:s.scene)==null?void 0:p.globe.ellipsoid.geodeticSurfaceNormal(c,cartesianScratch);invariant$1(d!==void 0);const h=Cartesian3.add(c,Cartesian3.multiplyByScalar(d,n,cartesianScratch),cartesianScratch);return jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx(ControlPoint,{position:c,clampToGround:!0}),jsxRuntimeExports.jsx(ControlPoint,{position:h}),jsxRuntimeExports.jsx(ExtrudedMeasurement,{a:c,b:h,extrudedHeight:n,color:o})]})});ExtrudedControlPoints.displayName="ExtrudedControlPoints";const ExtrudedPolygonEntity=({dynamic:t=!1,id:n,hierarchy:o,extrudedHeight:s,color:c,disableShadow:d=!1,enableRelativeHeight:h=!1})=>{const p=React.useRef(o);p.current=o;const y=useConstant$2(()=>new CallbackProperty(()=>p.current,!1)),E=t?y:o,L=React.useRef(s);L.current=s;const F=useConstant$2(()=>new CallbackProperty(()=>L.current,!1)),N=t?F:s,z=React.useMemo(()=>({polygon:{hierarchy:E,extrudedHeight:N,extrudedHeightReference:HeightReference$1.RELATIVE_TO_GROUND,fill:!0,outline:!0,outlineWidth:1,outlineColor:c==null?void 0:c.withAlpha(1),material:new ColorMaterialProperty(c),classificationType:ClassificationType$1.TERRAIN,shadows:d?ShadowMode$1.DISABLED:ShadowMode$1.ENABLED,...h?{height:0,heightReference:HeightReference$1.RELATIVE_TO_GROUND}:void 0}}),[N,d,E,c,h]),{requestRender:oe}=useContext();return oe==null||oe(),jsxRuntimeExports.jsx(Entity,{id:n,...z})},PolygonEntity=({dynamic:t=!1,hierarchy:n,color:o})=>{const s=React.useRef(n);s.current=n;const c=useConstant$2(()=>new CallbackProperty(()=>s.current,!1)),d=t?c:n,h=React.useMemo(()=>({polygon:{hierarchy:d,fill:!0,material:o==null?void 0:o.withAlpha(.5),classificationType:ClassificationType$1.TERRAIN}}),[o,d]),{requestRender:p}=useContext();return p==null||p(),jsxRuntimeExports.jsx(Entity,{...h})},PolylineEntity=({dynamic:t=!1,positions:n,color:o})=>{const s=React.useRef(n);s.current=n;const c=useConstant$2(()=>new CallbackProperty(()=>s.current,!t)),d=t?c:n,h=React.useMemo(()=>({polyline:{positions:d,width:1.5,material:o,classificationType:ClassificationType$1.TERRAIN,clampToGround:!0}}),[o,d]),{requestRender:p}=useContext();return p==null||p(),jsxRuntimeExports.jsx(Entity,{...h})},MeasurementLine=({a:t,b:n,color:o})=>{const s=React.useRef([t,n]);s.current=[t,n];const c=useConstant$2(()=>new CallbackProperty(()=>s.current,!1)),d=React.useMemo(()=>({polyline:{positions:c,width:1.5,material:new PolylineDashMaterialProperty({color:o,dashLength:8}),classificationType:ClassificationType$1.TERRAIN,clampToGround:!0}}),[o,c]),{requestRender:h}=useContext();return h==null||h(),jsxRuntimeExports.jsx(Entity,{...d})},SurfaceMeasurement=({a:t,b:n,color:o,showLine:s=!1})=>{const c=useConstant$2(()=>new Cartesian3),{getSurfaceDistance:d}=useContext(),h=d==null?void 0:d(t,n);return h!==void 0?jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx(ScreenSpaceElement,{position:Cartesian3.midpoint(t,n,c),children:jsxRuntimeExports.jsx(MeasurementText,{children:h<1e3?`${h.toFixed(1)} m`:`${(h/1e3).toFixed(1)} km`})}),s&&jsxRuntimeExports.jsx(MeasurementLine,{a:t,b:n,color:o})]}):null},cartesianScratch1=new Cartesian3,cartesianScratch2=new Cartesian3,SurfaceControlPoints=React.memo(({geometryOptions:{type:t,controlPoints:n},color:o})=>{let s=[...n],c,d=!1;if(t==="rectangle"&&s.length===3){const[h,p,y]=s,E=Cartesian3.projectVector(Cartesian3.subtract(y,h,cartesianScratch1),Cartesian3.subtract(p,h,cartesianScratch2),cartesianScratch1),L=Cartesian3.subtract(y,Cartesian3.add(h,E,cartesianScratch1),cartesianScratch2),F=Cartesian3.midpoint(h,p,cartesianScratch1),N=Cartesian3.add(F,L,cartesianScratch2);s=[h,p,N],c=[F,N],d=!0}else t==="marker"?(c=void 0,s=[]):s.length>=2&&(c=s.slice(-2),d=t==="circle");return jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[s.map((h,p)=>jsxRuntimeExports.jsx(ControlPoint,{position:h,clampToGround:!0},p)),c!=null&&jsxRuntimeExports.jsx(SurfaceMeasurement,{a:c[0],b:c[1],color:o,showLine:d})]})});SurfaceControlPoints.displayName="SurfaceControlPoints";const DEFAULT_SKETCH_COLOR="#00bebe",SketchComponent=React.memo(({geometry:t,geometryOptions:n,extrudedHeight:o,disableShadow:s,color:c,enableRelativeHeight:d})=>{const h=React.useMemo(()=>n?{...n,controlPoints:n==null?void 0:n.controlPoints.map(F=>new Cesium$1.Cartesian3(...F))}:null,[n]),p=React.useMemo(()=>t??(h?createGeometry(h):null),[t,h]),{positionsArray:y,hierarchyArray:E}=React.useMemo(()=>(p==null?void 0:p.type)==="Point"?{}:(p==null?void 0:p.type)==="LineString"?{positionsArray:convertGeometryToPositionsArray(p)}:p!=null?{positionsArray:convertGeometryToPositionsArray(p),hierarchyArray:convertPolygonToHierarchyArray(p)}:{},[p]),L=React.useMemo(()=>Color$1.fromCssColorString(c??DEFAULT_SKETCH_COLOR),[c]);return jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[y==null?void 0:y.map((F,N)=>jsxRuntimeExports.jsx(PolylineEntity,{dynamic:!0,positions:F,color:L},N)),E==null?void 0:E.map((F,N)=>jsxRuntimeExports.jsx(PolygonEntity,{dynamic:!0,hierarchy:F,color:L},N)),h!=null&&o==null&&jsxRuntimeExports.jsx(SurfaceControlPoints,{geometryOptions:h,color:L}),h!=null&&o!=null&&jsxRuntimeExports.jsx(ExtrudedControlPoints,{geometryOptions:h,extrudedHeight:o,color:L}),o!=null&&(E==null?void 0:E.map((F,N)=>jsxRuntimeExports.jsx(ExtrudedPolygonEntity,{dynamic:!0,hierarchy:F,extrudedHeight:o,disableShadow:s,color:L,enableRelativeHeight:d},N)))]})});SketchComponent.displayName="SketchComponent";const Cesium=({className:t,style:n,property:o,time:s,camera:c,small:d,ready:h,children:p,selectedLayerId:y,isLayerDraggable:E,isLayerDragging:L,shouldRender:F,layerSelectionReason:N,meta:z,layersRef:oe,featureFlags:W,requestingRenderMode:nt,timelineManagerRef:lt,cameraForceHorizontalRoll:Ee,onLayerSelect:yt,onCameraChange:Ai,onLayerDrag:zi,onLayerDrop:ha,onLayerEdit:ba,onLayerSelectWithRectStart:Sa,onLayerSelectWithRectMove:ya,onLayerSelectWithRectEnd:ms,onMount:Wc,onLayerVisibility:Wa,onLayerLoad:pi},mt)=>{var wf,bs,af,of,Vd,Gd,tf,ff,hf,cf,pf,xf,yf,Rf,gf,Ef,Bf,Zf,zf,Tf,Of,$f,_m,Em,wm,Am,vm,Mf,Sf,Gf,Nf,qf,Kf,Uf,$m,jm,ip,rp,ep,Qm,tp,op;const{cesium:fa,mouseEventHandles:Ra,cesiumIonAccessToken:sl,context:Zd,layerSelectWithRectEventHandlers:Xd,sceneLight:pu,sceneBackgroundColor:gl,sceneMsaaSamples:md,sceneMode:ef,cameraViewBoundaries:nf,cameraViewOuterBoundaries:rf,cameraViewBoundariesMaterial:uf,handleCameraChange:mf,handleCameraMoveEnd:Cf,handleUpdate:vf,handleClick:bf,handleMount:Pf,handleUnmount:Lf}=useHooks$1({ref:mt,property:o,time:s,selectedLayerId:y,selectionReason:N,meta:z,layersRef:oe,featureFlags:W,timelineManagerRef:lt,isLayerDraggable:E,isLayerDragging:L,shouldRender:F,requestingRenderMode:nt,camera:c,cameraForceHorizontalRoll:Ee,onLayerDrag:zi,onLayerDrop:ha,onLayerSelect:yt,onLayerEdit:ba,onLayerSelectWithRectStart:Sa,onLayerSelectWithRectMove:ya,onLayerSelectWithRectEnd:ms,onLayerVisibility:Wa,onLayerLoad:pi,onCameraChange:Ai,onMount:Wc});return jsxRuntimeExports.jsxs(Aa$1,{ref:fa,onUpdate:vf,className:t,requestRenderMode:!0,animation:!1,timeline:!1,baseLayer:!1,fullscreenButton:!1,homeButton:!1,geocoder:!1,infoBox:!1,baseLayerPicker:!1,navigationHelpButton:!1,projectionPicker:!1,sceneModePicker:!1,creditContainer,style:{width:d?"300px":"auto",height:d?"300px":"100%",display:h?void 0:"none",cursor:L?"grab":void 0,...n},shadows:!!((bs=(wf=o==null?void 0:o.scene)==null?void 0:wf.shadow)!=null&&bs.enabled),onClick:bf,onDoubleClick:Ra.doubleClick,onMouseDown:Ra.mouseDown,onMouseUp:Ra.mouseUp,onRightClick:Ra.rightClick,onRightDown:Ra.rightDown,onRightUp:Ra.rightUp,onMiddleClick:Ra.middleClick,onMiddleDown:Ra.middleDown,onMiddleUp:Ra.middleUp,onMouseMove:Ra.mouseMove,onMouseEnter:Ra.mouseEnter,onMouseLeave:Ra.mouseLeave,onWheel:Ra.wheel,children:[jsxRuntimeExports.jsx(Event,{onMount:Pf,onUnmount:Lf}),jsxRuntimeExports.jsx(ReearthClock,{timelineManagerRef:lt}),jsxRuntimeExports.jsx(ImageryLayers,{tiles:o==null?void 0:o.tiles,cesiumIonAccessToken:sl}),jsxRuntimeExports.jsx(LabelImageryLayers,{tileLabels:o==null?void 0:o.tileLabels}),jsxRuntimeExports.jsx(Indicator,{property:o,timelineManagerRef:lt}),jsxRuntimeExports.jsxs(ka$1,{useDefault:!0,children:[jsxRuntimeExports.jsx(Ma$1,{type:Cesium$1.ScreenSpaceEventType.LEFT_CLICK}),jsxRuntimeExports.jsx(Ma$1,{type:Cesium$1.ScreenSpaceEventType.LEFT_DOUBLE_CLICK})]}),jsxRuntimeExports.jsxs(ka$1,{children:[jsxRuntimeExports.jsx(Ma$1,{type:Cesium$1.ScreenSpaceEventType.LEFT_DOWN,action:Xd.start.handler}),jsxRuntimeExports.jsx(Ma$1,{type:Cesium$1.ScreenSpaceEventType.LEFT_DOWN,modifier:Cesium$1.KeyboardEventModifier.SHIFT,action:Xd.start.shift}),jsxRuntimeExports.jsx(Ma$1,{type:Cesium$1.ScreenSpaceEventType.MOUSE_MOVE,action:Xd.move.handler}),jsxRuntimeExports.jsx(Ma$1,{type:Cesium$1.ScreenSpaceEventType.MOUSE_MOVE,modifier:Cesium$1.KeyboardEventModifier.SHIFT,action:Xd.move.shift}),jsxRuntimeExports.jsx(Ma$1,{type:Cesium$1.ScreenSpaceEventType.LEFT_UP,action:Xd.end.handler}),jsxRuntimeExports.jsx(Ma$1,{type:Cesium$1.ScreenSpaceEventType.LEFT_UP,modifier:Cesium$1.KeyboardEventModifier.SHIFT,action:Xd.end.shift})]}),jsxRuntimeExports.jsx(Ta$1,{maximumZoomDistance:(of=(af=o==null?void 0:o.camera)==null?void 0:af.limiter)!=null&&of.enabled?((tf=(Gd=(Vd=o.camera)==null?void 0:Vd.limiter)==null?void 0:Gd.targetArea)==null?void 0:tf.height)??Number.POSITIVE_INFINITY:Number.POSITIVE_INFINITY,enableCollisionDetection:!((ff=o==null?void 0:o.camera)!=null&&ff.allowEnterGround)}),jsxRuntimeExports.jsx(Ps$1,{percentageChanged:.2,onChange:mf,onMoveEnd:Cf}),nf&&((cf=(hf=o==null?void 0:o.camera)==null?void 0:hf.limiter)==null?void 0:cf.showHelper)&&jsxRuntimeExports.jsx(Is$1,{children:jsxRuntimeExports.jsx(ua$1,{positions:nf,width:1,material:Cesium$1.Color.RED,arcType:Cesium$1.ArcType.RHUMB})}),rf&&((xf=(pf=o==null?void 0:o.camera)==null?void 0:pf.limiter)==null?void 0:xf.showHelper)&&jsxRuntimeExports.jsx(Is$1,{children:jsxRuntimeExports.jsx(ua$1,{positions:rf,width:1,material:uf,arcType:Cesium$1.ArcType.RHUMB})}),jsxRuntimeExports.jsx($a$1,{backgroundColor:gl,light:pu,mode:ef,msaaSamples:md,useDepthPicking:!1,useWebVR:!!((yf=o==null?void 0:o.scene)!=null&&yf.vr)||void 0,debugShowFramesPerSecond:!!((Rf=o==null?void 0:o.debug)!=null&&Rf.showFramesPerSecond),verticalExaggerationRelativeHeight:(gf=o==null?void 0:o.scene)==null?void 0:gf.verticalExaggerationRelativeHeight,verticalExaggeration:(Ef=o==null?void 0:o.scene)==null?void 0:Ef.verticalExaggeration}),jsxRuntimeExports.jsx(Oa$1,{show:((Zf=(Bf=o==null?void 0:o.sky)==null?void 0:Bf.skyBox)==null?void 0:Zf.show)??!0}),jsxRuntimeExports.jsx(Vs,{enabled:((Tf=(zf=o==null?void 0:o.sky)==null?void 0:zf.fog)==null?void 0:Tf.enabled)??!0,density:($f=(Of=o==null?void 0:o.sky)==null?void 0:Of.fog)==null?void 0:$f.density}),jsxRuntimeExports.jsx(Ga$1,{show:((Em=(_m=o==null?void 0:o.sky)==null?void 0:_m.sun)==null?void 0:Em.show)??!0}),jsxRuntimeExports.jsx(ea$1,{show:((Am=(wm=o==null?void 0:o.sky)==null?void 0:wm.moon)==null?void 0:Am.show)??!0}),jsxRuntimeExports.jsx(_a$2,{show:((Mf=(vm=o==null?void 0:o.sky)==null?void 0:vm.skyAtmosphere)==null?void 0:Mf.show)??!0,atmosphereLightIntensity:(Gf=(Sf=o==null?void 0:o.sky)==null?void 0:Sf.skyAtmosphere)==null?void 0:Gf.lightIntensity,saturationShift:(qf=(Nf=o==null?void 0:o.sky)==null?void 0:Nf.skyAtmosphere)==null?void 0:qf.saturationShift,brightnessShift:(Uf=(Kf=o==null?void 0:o.sky)==null?void 0:Kf.skyAtmosphere)==null?void 0:Uf.brightnessShift}),jsxRuntimeExports.jsx(Globe,{property:o,cesiumIonAccessToken:sl}),jsxRuntimeExports.jsx(context.Provider,{value:Zd,children:h?p:null}),jsxRuntimeExports.jsx(AmbientOcclusion,{...AMBIENT_OCCLUSION_QUALITY[((jm=($m=o==null?void 0:o.render)==null?void 0:$m.ambientOcclusion)==null?void 0:jm.quality)||"low"],enabled:!!((rp=(ip=o==null?void 0:o.render)==null?void 0:ip.ambientOcclusion)!=null&&rp.enabled),intensity:((Qm=(ep=o==null?void 0:o.render)==null?void 0:ep.ambientOcclusion)==null?void 0:Qm.intensity)??100,outputType:(op=(tp=o==null?void 0:o.render)==null?void 0:tp.ambientOcclusion)!=null&&op.ambientOcclusionOnly?AmbientOcclusionOutputType.Occlusion:null})]})},creditContainer=document.createElement("div"),Component=React.forwardRef(Cesium),engine={component:Component,featureComponent:Feature$1,clusterComponent:Cluster,sketchComponent:SketchComponent,delegatedDataTypes:["czml","wms","mvt","3dtiles","osm-buildings","kml"]},engines={cesium:engine};function Error$1({error:t,resetErrorBoundary:n}){return jsxRuntimeExports.jsxs("div",{children:[jsxRuntimeExports.jsx("h1",{children:"Oops! An Error Occurred"}),jsxRuntimeExports.jsx("p",{children:t.message}),jsxRuntimeExports.jsx("p",{children:jsxRuntimeExports.jsx("button",{style:{color:"#fff"},onClick:n,children:"Retry"})})]})}const version$1="0.0.7-alpha.14",useCoreAPI=({viewerProperty:t})=>{const n=React.useRef(t);n.current=t;const o=React.useMemo(()=>({get version(){return version$1},get viewerProperty(){return n.current}}),[]);React.useEffect(()=>{window.reearth_core=o},[o])},viewportMobileMaxWidth=768,useViewport=({wrapperRef:t})=>{const n=React.useMemo(()=>paramsToObject(new URLSearchParams(window.location.search)),[]),[o,s]=React.useState({width:void 0,height:void 0,isMobile:void 0,query:n});return React.useEffect(()=>{const c=new ResizeObserver(d=>{var E,L;const[h]=d;let p,y;if(h.contentBoxSize){const F=Array.isArray(h.contentBoxSize)?h.contentBoxSize[0]:h.contentBoxSize;p=F.inlineSize,y=F.blockSize}else h.contentRect?(p=h.contentRect.width,y=h.contentRect.height):(p=(E=t.current)==null?void 0:E.clientWidth,y=(L=t.current)==null?void 0:L.clientHeight);s(F=>({width:p,height:y,isMobile:p?p<=viewportMobileMaxWidth:void 0,query:F.query}))});return t.current&&c.observe(t.current),()=>{c.disconnect()}},[t]),o};function paramsToObject(t){const n={};for(const[o,s]of t)n[o]=s;return n}function useHooks({camera:t,interactionMode:n,zoomedLayerId:o,viewerProperty:s,onLayerSelect:c,onCameraChange:d,onInteractionModeChange:h,onZoomToLayer:p,onLayerDrop:y,onSketchTypeChangeProp:E},L){const F=React.useRef(null);React.useImperativeHandle(L,()=>F.current,[]);const N=React.useRef(null),z=useViewport({wrapperRef:N}),[oe,W]=React.useState({}),[nt,lt]=React.useState(),[Ee,yt]=React.useState(),Ai=React.useCallback(async(gf,Ef,Bf,Zf,zf)=>{var _m,Em,wm,Am,vm,Mf,Sf,Gf,Nf,qf,Kf;const Tf=((_m=oe.layer)==null?void 0:_m.layer.type)==="simple"&&((Am=(wm=(Em=oe.layer)==null?void 0:Em.layer)==null?void 0:wm.data)==null?void 0:Am.isSketchLayer);if(oe.layerId===gf&&oe.featureId===Ef&&!Tf)return;const Of=await(Bf==null?void 0:Bf()),$f=gf&&Ef?(Tf?(vm=Of==null?void 0:Of.features)==null?void 0:vm.find(Uf=>Uf.id===Ef):(Gf=(Mf=F.current)==null?void 0:(Sf=Mf.engine).findComputedFeatureById)==null?void 0:Gf.call(Sf,gf,Ef))??(zf==null?void 0:zf.feature):void 0;lt(gf&&Ef?(Kf=(Nf=F.current)==null?void 0:(qf=Nf.engine).findFeatureById)==null?void 0:Kf.call(qf,gf,Ef):void 0),yt($f),W(Uf=>Uf.layerId===gf&&Uf.featureId===Ef?Uf:{layerId:gf,featureId:Ef,layer:Of,reason:Zf}),c==null||c(gf,Bf,$f,Zf)},[oe,c]),zi=React.useRef(),[ha,ba]=useValue(t,d),[Sa,ya]=React.useState(!1),ms=React.useCallback(gf=>{ya(!!gf)},[]),[Wc,Wa]=useValue(n,h),pi=Wc||"default",[mt,fa]=React.useState("auto");React.useEffect(()=>{fa(pi==="sketch"?"crosshair":pi==="move"?"grab":"auto")},[pi]);const Ra=INTERACTION_MODES[pi],sl=React.useRef(),Zd=React.useCallback(gf=>{sl.current=gf},[]),Xd=React.useCallback(gf=>{var Ef;(Ef=sl.current)==null||Ef.call(sl,gf)},[]),pu=React.useRef(),gl=React.useCallback(gf=>{pu.current=gf},[]),md=React.useCallback(gf=>{var Ef;(Ef=pu.current)==null||Ef.call(pu,gf)},[]),ef=React.useRef(),nf=React.useCallback(gf=>{ef.current=gf},[]),rf=React.useCallback(gf=>{var Ef;(Ef=ef.current)==null||Ef.call(ef,gf)},[]),uf=React.useRef(),mf=React.useCallback(gf=>{uf.current=gf},[]),Cf=React.useCallback(gf=>{var Ef;(Ef=uf.current)==null||Ef.call(uf,gf)},[]),vf=React.useRef(),bf=React.useCallback(gf=>{vf.current=gf},[]),Pf=React.useCallback(gf=>{var Ef;(Ef=vf.current)==null||Ef.call(vf,gf)},[]),Lf=React.useRef(),wf=React.useCallback(gf=>{Lf.current=gf},[]),bs=React.useCallback(gf=>{var Ef;(Ef=Lf.current)==null||Ef.call(Lf,gf)},[]),af=React.useRef([]),of=React.useCallback(gf=>{af.current.push(gf)},[]),Vd=React.useCallback(gf=>{af.current.forEach(Ef=>Ef(gf))},[]),Gd=React.useRef([]),tf=React.useCallback(gf=>{Gd.current.push(gf)},[]),ff=React.useCallback((gf,Ef)=>{Gd.current.forEach(Bf=>Bf(gf)),E==null||E(gf,Ef)},[E]);React.useEffect(()=>{var gf,Ef;o&&((Ef=(gf=F.current)==null?void 0:gf.engine)==null||Ef.lookAtLayer(o),p==null||p(void 0))},[o,p]);const[hf,cf]=React.useState(!1),pf=React.useCallback(()=>{cf(!0)},[]),xf=React.useCallback((gf,Ef,Bf)=>{var Tf;cf(!1);const Zf=(Tf=F.current)==null?void 0:Tf.layers.findById(gf),zf=Zf!=null&&Zf.property.default.location?"default.location":Zf!=null&&Zf.property.default.position?"default.position":void 0;Bf&&Zf&&Zf.propertyId&&zf&&(y==null||y(Zf.propertyId,zf,Bf))},[y,F]),yf=React.useMemo(()=>({interactionMode:pi,selectedLayer:oe,selectedComputedFeature:Ee,viewport:z,handleCameraForceHorizontalRollChange:ms,handleInteractionModeChange:Wa,onSketchPluginFeatureCreate:of,onSketchTypeChange:tf,onLayerVisibility:gl,onLayerLoad:nf,onLayerEdit:Zd,onLayerSelectWithRectStart:mf,onLayerSelectWithRectMove:bf,onLayerSelectWithRectEnd:wf}),[pi,oe,Ee,z,Wa,ms,Zd,of,tf,gl,nf,mf,bf,wf]),Rf=React.useMemo(()=>({position:"relative",width:"100%",height:"100%",overflow:"hidden"}),[]);return useCoreAPI({viewerProperty:s}),{mapRef:F,wrapperRef:N,selectedFeature:nt,camera:ha,featureFlags:Ra,isLayerDragging:hf,timelineManagerRef:zi,cursor:mt,cameraForceHorizontalRoll:Sa,coreContextValue:yf,containerStyle:Rf,handleLayerSelect:Ai,handleLayerDrag:pf,handleLayerDrop:xf,handleLayerEdit:Xd,handleCameraChange:ba,handleInteractionModeChange:Wa,handleSketchPluginFeatureCreate:Vd,handleSketchTypeChange:ff,handleLayerVisibility:md,handleLayerLoad:rf,handleLayerSelectWithRectStart:Cf,handleLayerSelectWithRectMove:Pf,handleLayerSelectWithRectEnd:bs}}function useValue(t,n){const[o,s]=React.useState(t),c=React.useCallback(d=>{d&&(s(d),n==null||n(d))},[n]);return React.useEffect(()=>{s(t)},[t]),[o,c]}const CoreVisualizer=React.memo(React.forwardRef(({engine:t,isBuilt:n,isEditable:o,viewerProperty:s,layers:c,clusters:d,small:h,ready:p,hiddenLayers:y,camera:E,time:L,interactionMode:F,shouldRender:N,meta:z,style:oe,zoomedLayerId:W,children:nt,onLayerDrop:lt,onLayerSelect:Ee,onCameraChange:yt,onZoomToLayer:Ai,onInteractionModeChange:zi,onMount:ha,onSketchTypeChangeProp:ba,onSketchFeatureCreate:Sa},ya)=>{const{mapRef:ms,wrapperRef:Wc,selectedFeature:Wa,camera:pi,featureFlags:mt,isLayerDragging:fa,timelineManagerRef:Ra,cursor:sl,cameraForceHorizontalRoll:Zd,coreContextValue:Xd,containerStyle:pu,handleLayerSelect:gl,handleLayerDrag:md,handleLayerDrop:ef,handleLayerEdit:nf,handleCameraChange:rf,handleInteractionModeChange:uf,handleSketchPluginFeatureCreate:mf,handleSketchTypeChange:Cf,handleLayerVisibility:vf,handleLayerLoad:bf,handleLayerSelectWithRectStart:Pf,handleLayerSelectWithRectMove:Lf,handleLayerSelectWithRectEnd:wf}=useHooks({camera:E,interactionMode:F,zoomedLayerId:W,viewerProperty:s,onLayerSelect:Ee,onCameraChange:yt,onZoomToLayer:Ai,onLayerDrop:lt,onInteractionModeChange:zi,onSketchTypeChangeProp:ba},ya);return jsxRuntimeExports.jsx(ErrorBoundary,{FallbackComponent:Error$1,children:jsxRuntimeExports.jsx(VisualizerProvider,{mapRef:ms,children:jsxRuntimeExports.jsxs("div",{ref:Wc,style:pu,children:[jsxRuntimeExports.jsx(Map$1,{ref:ms,isBuilt:n,isEditable:o,engine:t,layers:c,engines,camera:pi,cameraForceHorizontalRoll:Zd,clusters:d,hiddenLayers:y,isLayerDragging:fa,isLayerDraggable:o,meta:z,style:oe,featureFlags:mt,shouldRender:N,property:s,time:L,small:h,ready:p,timelineManagerRef:Ra,interactionMode:F,selectedFeature:Wa,cursor:sl,onCameraChange:rf,onLayerDrag:md,onLayerDrop:ef,onLayerSelect:gl,onLayerEdit:nf,overrideInteractionMode:uf,onSketchFeatureCreate:Sa,onSketchPluginFeatureCreate:mf,onSketchTypeChange:Cf,onMount:ha,onLayerVisibility:vf,onLayerLoad:bf,onLayerSelectWithRectStart:Pf,onLayerSelectWithRectMove:Lf,onLayerSelectWithRectEnd:wf}),jsxRuntimeExports.jsx(coreContext.Provider,{value:Xd,children:nt})]})})})}));var global$1=typeof global<"u"?global:typeof self<"u"?self:typeof window<"u"?window:{},lookup=[],revLookup=[],Arr=typeof Uint8Array<"u"?Uint8Array:Array,inited=!1;function init(){inited=!0;for(var t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",n=0,o=t.length;n<o;++n)lookup[n]=t[n],revLookup[t.charCodeAt(n)]=n;revLookup[45]=62,revLookup[95]=63}function toByteArray(t){inited||init();var n,o,s,c,d,h,p=t.length;if(p%4>0)throw new Error("Invalid string. Length must be a multiple of 4");d=t[p-2]==="="?2:t[p-1]==="="?1:0,h=new Arr(p*3/4-d),s=d>0?p-4:p;var y=0;for(n=0,o=0;n<s;n+=4,o+=3)c=revLookup[t.charCodeAt(n)]<<18|revLookup[t.charCodeAt(n+1)]<<12|revLookup[t.charCodeAt(n+2)]<<6|revLookup[t.charCodeAt(n+3)],h[y++]=c>>16&255,h[y++]=c>>8&255,h[y++]=c&255;return d===2?(c=revLookup[t.charCodeAt(n)]<<2|revLookup[t.charCodeAt(n+1)]>>4,h[y++]=c&255):d===1&&(c=revLookup[t.charCodeAt(n)]<<10|revLookup[t.charCodeAt(n+1)]<<4|revLookup[t.charCodeAt(n+2)]>>2,h[y++]=c>>8&255,h[y++]=c&255),h}function tripletToBase64(t){return lookup[t>>18&63]+lookup[t>>12&63]+lookup[t>>6&63]+lookup[t&63]}function encodeChunk(t,n,o){for(var s,c=[],d=n;d<o;d+=3)s=(t[d]<<16)+(t[d+1]<<8)+t[d+2],c.push(tripletToBase64(s));return c.join("")}function fromByteArray(t){inited||init();for(var n,o=t.length,s=o%3,c="",d=[],h=16383,p=0,y=o-s;p<y;p+=h)d.push(encodeChunk(t,p,p+h>y?y:p+h));return s===1?(n=t[o-1],c+=lookup[n>>2],c+=lookup[n<<4&63],c+="=="):s===2&&(n=(t[o-2]<<8)+t[o-1],c+=lookup[n>>10],c+=lookup[n>>4&63],c+=lookup[n<<2&63],c+="="),d.push(c),d.join("")}function read(t,n,o,s,c){var d,h,p=c*8-s-1,y=(1<<p)-1,E=y>>1,L=-7,F=o?c-1:0,N=o?-1:1,z=t[n+F];for(F+=N,d=z&(1<<-L)-1,z>>=-L,L+=p;L>0;d=d*256+t[n+F],F+=N,L-=8);for(h=d&(1<<-L)-1,d>>=-L,L+=s;L>0;h=h*256+t[n+F],F+=N,L-=8);if(d===0)d=1-E;else{if(d===y)return h?NaN:(z?-1:1)*(1/0);h=h+Math.pow(2,s),d=d-E}return(z?-1:1)*h*Math.pow(2,d-s)}function write(t,n,o,s,c,d){var h,p,y,E=d*8-c-1,L=(1<<E)-1,F=L>>1,N=c===23?Math.pow(2,-24)-Math.pow(2,-77):0,z=s?0:d-1,oe=s?1:-1,W=n<0||n===0&&1/n<0?1:0;for(n=Math.abs(n),isNaN(n)||n===1/0?(p=isNaN(n)?1:0,h=L):(h=Math.floor(Math.log(n)/Math.LN2),n*(y=Math.pow(2,-h))<1&&(h--,y*=2),h+F>=1?n+=N/y:n+=N*Math.pow(2,1-F),n*y>=2&&(h++,y/=2),h+F>=L?(p=0,h=L):h+F>=1?(p=(n*y-1)*Math.pow(2,c),h=h+F):(p=n*Math.pow(2,F-1)*Math.pow(2,c),h=0));c>=8;t[o+z]=p&255,z+=oe,p/=256,c-=8);for(h=h<<c|p,E+=c;E>0;t[o+z]=h&255,z+=oe,h/=256,E-=8);t[o+z-oe]|=W*128}var toString={}.toString,isArray$1=Array.isArray||function(t){return toString.call(t)=="[object Array]"},INSPECT_MAX_BYTES=50;Buffer$1.TYPED_ARRAY_SUPPORT=global$1.TYPED_ARRAY_SUPPORT!==void 0?global$1.TYPED_ARRAY_SUPPORT:!0,kMaxLength();function kMaxLength(){return Buffer$1.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function createBuffer(t,n){if(kMaxLength()<n)throw new RangeError("Invalid typed array length");return Buffer$1.TYPED_ARRAY_SUPPORT?(t=new Uint8Array(n),t.__proto__=Buffer$1.prototype):(t===null&&(t=new Buffer$1(n)),t.length=n),t}function Buffer$1(t,n,o){if(!Buffer$1.TYPED_ARRAY_SUPPORT&&!(this instanceof Buffer$1))return new Buffer$1(t,n,o);if(typeof t=="number"){if(typeof n=="string")throw new Error("If encoding is specified then the first argument must be a string");return allocUnsafe(this,t)}return from(this,t,n,o)}Buffer$1.poolSize=8192,Buffer$1._augment=function(t){return t.__proto__=Buffer$1.prototype,t};function from(t,n,o,s){if(typeof n=="number")throw new TypeError('"value" argument must not be a number');return typeof ArrayBuffer<"u"&&n instanceof ArrayBuffer?fromArrayBuffer(t,n,o,s):typeof n=="string"?fromString(t,n,o):fromObject(t,n)}Buffer$1.from=function(t,n,o){return from(null,t,n,o)},Buffer$1.TYPED_ARRAY_SUPPORT&&(Buffer$1.prototype.__proto__=Uint8Array.prototype,Buffer$1.__proto__=Uint8Array,typeof Symbol<"u"&&Symbol.species&&Buffer$1[Symbol.species]);function assertSize(t){if(typeof t!="number")throw new TypeError('"size" argument must be a number');if(t<0)throw new RangeError('"size" argument must not be negative')}function alloc(t,n,o,s){return assertSize(n),n<=0?createBuffer(t,n):o!==void 0?typeof s=="string"?createBuffer(t,n).fill(o,s):createBuffer(t,n).fill(o):createBuffer(t,n)}Buffer$1.alloc=function(t,n,o){return alloc(null,t,n,o)};function allocUnsafe(t,n){if(assertSize(n),t=createBuffer(t,n<0?0:checked(n)|0),!Buffer$1.TYPED_ARRAY_SUPPORT)for(var o=0;o<n;++o)t[o]=0;return t}Buffer$1.allocUnsafe=function(t){return allocUnsafe(null,t)},Buffer$1.allocUnsafeSlow=function(t){return allocUnsafe(null,t)};function fromString(t,n,o){if((typeof o!="string"||o==="")&&(o="utf8"),!Buffer$1.isEncoding(o))throw new TypeError('"encoding" must be a valid string encoding');var s=byteLength(n,o)|0;t=createBuffer(t,s);var c=t.write(n,o);return c!==s&&(t=t.slice(0,c)),t}function fromArrayLike(t,n){var o=n.length<0?0:checked(n.length)|0;t=createBuffer(t,o);for(var s=0;s<o;s+=1)t[s]=n[s]&255;return t}function fromArrayBuffer(t,n,o,s){if(n.byteLength,o<0||n.byteLength<o)throw new RangeError("'offset' is out of bounds");if(n.byteLength<o+(s||0))throw new RangeError("'length' is out of bounds");return o===void 0&&s===void 0?n=new Uint8Array(n):s===void 0?n=new Uint8Array(n,o):n=new Uint8Array(n,o,s),Buffer$1.TYPED_ARRAY_SUPPORT?(t=n,t.__proto__=Buffer$1.prototype):t=fromArrayLike(t,n),t}function fromObject(t,n){if(internalIsBuffer(n)){var o=checked(n.length)|0;return t=createBuffer(t,o),t.length===0||n.copy(t,0,0,o),t}if(n){if(typeof ArrayBuffer<"u"&&n.buffer instanceof ArrayBuffer||"length"in n)return typeof n.length!="number"||isnan(n.length)?createBuffer(t,0):fromArrayLike(t,n);if(n.type==="Buffer"&&isArray$1(n.data))return fromArrayLike(t,n.data)}throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}function checked(t){if(t>=kMaxLength())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+kMaxLength().toString(16)+" bytes");return t|0}Buffer$1.isBuffer=isBuffer;function internalIsBuffer(t){return!!(t!=null&&t._isBuffer)}Buffer$1.compare=function t(n,o){if(!internalIsBuffer(n)||!internalIsBuffer(o))throw new TypeError("Arguments must be Buffers");if(n===o)return 0;for(var s=n.length,c=o.length,d=0,h=Math.min(s,c);d<h;++d)if(n[d]!==o[d]){s=n[d],c=o[d];break}return s<c?-1:c<s?1:0},Buffer$1.isEncoding=function t(n){switch(String(n).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},Buffer$1.concat=function t(n,o){if(!isArray$1(n))throw new TypeError('"list" argument must be an Array of Buffers');if(n.length===0)return Buffer$1.alloc(0);var s;if(o===void 0)for(o=0,s=0;s<n.length;++s)o+=n[s].length;var c=Buffer$1.allocUnsafe(o),d=0;for(s=0;s<n.length;++s){var h=n[s];if(!internalIsBuffer(h))throw new TypeError('"list" argument must be an Array of Buffers');h.copy(c,d),d+=h.length}return c};function byteLength(t,n){if(internalIsBuffer(t))return t.length;if(typeof ArrayBuffer<"u"&&typeof ArrayBuffer.isView=="function"&&(ArrayBuffer.isView(t)||t instanceof ArrayBuffer))return t.byteLength;typeof t!="string"&&(t=""+t);var o=t.length;if(o===0)return 0;for(var s=!1;;)switch(n){case"ascii":case"latin1":case"binary":return o;case"utf8":case"utf-8":case void 0:return utf8ToBytes(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return o*2;case"hex":return o>>>1;case"base64":return base64ToBytes(t).length;default:if(s)return utf8ToBytes(t).length;n=(""+n).toLowerCase(),s=!0}}Buffer$1.byteLength=byteLength;function slowToString(t,n,o){var s=!1;if((n===void 0||n<0)&&(n=0),n>this.length||((o===void 0||o>this.length)&&(o=this.length),o<=0)||(o>>>=0,n>>>=0,o<=n))return"";for(t||(t="utf8");;)switch(t){case"hex":return hexSlice(this,n,o);case"utf8":case"utf-8":return utf8Slice(this,n,o);case"ascii":return asciiSlice(this,n,o);case"latin1":case"binary":return latin1Slice(this,n,o);case"base64":return base64Slice(this,n,o);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return utf16leSlice(this,n,o);default:if(s)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),s=!0}}Buffer$1.prototype._isBuffer=!0;function swap(t,n,o){var s=t[n];t[n]=t[o],t[o]=s}Buffer$1.prototype.swap16=function t(){var n=this.length;if(n%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var o=0;o<n;o+=2)swap(this,o,o+1);return this},Buffer$1.prototype.swap32=function t(){var n=this.length;if(n%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var o=0;o<n;o+=4)swap(this,o,o+3),swap(this,o+1,o+2);return this},Buffer$1.prototype.swap64=function t(){var n=this.length;if(n%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var o=0;o<n;o+=8)swap(this,o,o+7),swap(this,o+1,o+6),swap(this,o+2,o+5),swap(this,o+3,o+4);return this},Buffer$1.prototype.toString=function t(){var n=this.length|0;return n===0?"":arguments.length===0?utf8Slice(this,0,n):slowToString.apply(this,arguments)},Buffer$1.prototype.equals=function t(n){if(!internalIsBuffer(n))throw new TypeError("Argument must be a Buffer");return this===n?!0:Buffer$1.compare(this,n)===0},Buffer$1.prototype.inspect=function t(){var n="",o=INSPECT_MAX_BYTES;return this.length>0&&(n=this.toString("hex",0,o).match(/.{2}/g).join(" "),this.length>o&&(n+=" ... ")),"<Buffer "+n+">"},Buffer$1.prototype.compare=function t(n,o,s,c,d){if(!internalIsBuffer(n))throw new TypeError("Argument must be a Buffer");if(o===void 0&&(o=0),s===void 0&&(s=n?n.length:0),c===void 0&&(c=0),d===void 0&&(d=this.length),o<0||s>n.length||c<0||d>this.length)throw new RangeError("out of range index");if(c>=d&&o>=s)return 0;if(c>=d)return-1;if(o>=s)return 1;if(o>>>=0,s>>>=0,c>>>=0,d>>>=0,this===n)return 0;for(var h=d-c,p=s-o,y=Math.min(h,p),E=this.slice(c,d),L=n.slice(o,s),F=0;F<y;++F)if(E[F]!==L[F]){h=E[F],p=L[F];break}return h<p?-1:p<h?1:0};function bidirectionalIndexOf(t,n,o,s,c){if(t.length===0)return-1;if(typeof o=="string"?(s=o,o=0):o>2147483647?o=2147483647:o<-2147483648&&(o=-2147483648),o=+o,isNaN(o)&&(o=c?0:t.length-1),o<0&&(o=t.length+o),o>=t.length){if(c)return-1;o=t.length-1}else if(o<0)if(c)o=0;else return-1;if(typeof n=="string"&&(n=Buffer$1.from(n,s)),internalIsBuffer(n))return n.length===0?-1:arrayIndexOf(t,n,o,s,c);if(typeof n=="number")return n=n&255,Buffer$1.TYPED_ARRAY_SUPPORT&&typeof Uint8Array.prototype.indexOf=="function"?c?Uint8Array.prototype.indexOf.call(t,n,o):Uint8Array.prototype.lastIndexOf.call(t,n,o):arrayIndexOf(t,[n],o,s,c);throw new TypeError("val must be string, number or Buffer")}function arrayIndexOf(t,n,o,s,c){var d=1,h=t.length,p=n.length;if(s!==void 0&&(s=String(s).toLowerCase(),s==="ucs2"||s==="ucs-2"||s==="utf16le"||s==="utf-16le")){if(t.length<2||n.length<2)return-1;d=2,h/=2,p/=2,o/=2}function y(z,oe){return d===1?z[oe]:z.readUInt16BE(oe*d)}var E;if(c){var L=-1;for(E=o;E<h;E++)if(y(t,E)===y(n,L===-1?0:E-L)){if(L===-1&&(L=E),E-L+1===p)return L*d}else L!==-1&&(E-=E-L),L=-1}else for(o+p>h&&(o=h-p),E=o;E>=0;E--){for(var F=!0,N=0;N<p;N++)if(y(t,E+N)!==y(n,N)){F=!1;break}if(F)return E}return-1}Buffer$1.prototype.includes=function t(n,o,s){return this.indexOf(n,o,s)!==-1},Buffer$1.prototype.indexOf=function t(n,o,s){return bidirectionalIndexOf(this,n,o,s,!0)},Buffer$1.prototype.lastIndexOf=function t(n,o,s){return bidirectionalIndexOf(this,n,o,s,!1)};function hexWrite(t,n,o,s){o=Number(o)||0;var c=t.length-o;s?(s=Number(s),s>c&&(s=c)):s=c;var d=n.length;if(d%2!==0)throw new TypeError("Invalid hex string");s>d/2&&(s=d/2);for(var h=0;h<s;++h){var p=parseInt(n.substr(h*2,2),16);if(isNaN(p))return h;t[o+h]=p}return h}function utf8Write(t,n,o,s){return blitBuffer(utf8ToBytes(n,t.length-o),t,o,s)}function asciiWrite(t,n,o,s){return blitBuffer(asciiToBytes(n),t,o,s)}function latin1Write(t,n,o,s){return asciiWrite(t,n,o,s)}function base64Write(t,n,o,s){return blitBuffer(base64ToBytes(n),t,o,s)}function ucs2Write(t,n,o,s){return blitBuffer(utf16leToBytes(n,t.length-o),t,o,s)}Buffer$1.prototype.write=function t(n,o,s,c){if(o===void 0)c="utf8",s=this.length,o=0;else if(s===void 0&&typeof o=="string")c=o,s=this.length,o=0;else if(isFinite(o))o=o|0,isFinite(s)?(s=s|0,c===void 0&&(c="utf8")):(c=s,s=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");var d=this.length-o;if((s===void 0||s>d)&&(s=d),n.length>0&&(s<0||o<0)||o>this.length)throw new RangeError("Attempt to write outside buffer bounds");c||(c="utf8");for(var h=!1;;)switch(c){case"hex":return hexWrite(this,n,o,s);case"utf8":case"utf-8":return utf8Write(this,n,o,s);case"ascii":return asciiWrite(this,n,o,s);case"latin1":case"binary":return latin1Write(this,n,o,s);case"base64":return base64Write(this,n,o,s);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return ucs2Write(this,n,o,s);default:if(h)throw new TypeError("Unknown encoding: "+c);c=(""+c).toLowerCase(),h=!0}},Buffer$1.prototype.toJSON=function t(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function base64Slice(t,n,o){return n===0&&o===t.length?fromByteArray(t):fromByteArray(t.slice(n,o))}function utf8Slice(t,n,o){o=Math.min(t.length,o);for(var s=[],c=n;c<o;){var d=t[c],h=null,p=d>239?4:d>223?3:d>191?2:1;if(c+p<=o){var y,E,L,F;switch(p){case 1:d<128&&(h=d);break;case 2:y=t[c+1],(y&192)===128&&(F=(d&31)<<6|y&63,F>127&&(h=F));break;case 3:y=t[c+1],E=t[c+2],(y&192)===128&&(E&192)===128&&(F=(d&15)<<12|(y&63)<<6|E&63,F>2047&&(F<55296||F>57343)&&(h=F));break;case 4:y=t[c+1],E=t[c+2],L=t[c+3],(y&192)===128&&(E&192)===128&&(L&192)===128&&(F=(d&15)<<18|(y&63)<<12|(E&63)<<6|L&63,F>65535&&F<1114112&&(h=F))}}h===null?(h=65533,p=1):h>65535&&(h-=65536,s.push(h>>>10&1023|55296),h=56320|h&1023),s.push(h),c+=p}return decodeCodePointsArray(s)}var MAX_ARGUMENTS_LENGTH=4096;function decodeCodePointsArray(t){var n=t.length;if(n<=MAX_ARGUMENTS_LENGTH)return String.fromCharCode.apply(String,t);for(var o="",s=0;s<n;)o+=String.fromCharCode.apply(String,t.slice(s,s+=MAX_ARGUMENTS_LENGTH));return o}function asciiSlice(t,n,o){var s="";o=Math.min(t.length,o);for(var c=n;c<o;++c)s+=String.fromCharCode(t[c]&127);return s}function latin1Slice(t,n,o){var s="";o=Math.min(t.length,o);for(var c=n;c<o;++c)s+=String.fromCharCode(t[c]);return s}function hexSlice(t,n,o){var s=t.length;(!n||n<0)&&(n=0),(!o||o<0||o>s)&&(o=s);for(var c="",d=n;d<o;++d)c+=toHex(t[d]);return c}function utf16leSlice(t,n,o){for(var s=t.slice(n,o),c="",d=0;d<s.length;d+=2)c+=String.fromCharCode(s[d]+s[d+1]*256);return c}Buffer$1.prototype.slice=function t(n,o){var s=this.length;n=~~n,o=o===void 0?s:~~o,n<0?(n+=s,n<0&&(n=0)):n>s&&(n=s),o<0?(o+=s,o<0&&(o=0)):o>s&&(o=s),o<n&&(o=n);var c;if(Buffer$1.TYPED_ARRAY_SUPPORT)c=this.subarray(n,o),c.__proto__=Buffer$1.prototype;else{var d=o-n;c=new Buffer$1(d,void 0);for(var h=0;h<d;++h)c[h]=this[h+n]}return c};function checkOffset(t,n,o){if(t%1!==0||t<0)throw new RangeError("offset is not uint");if(t+n>o)throw new RangeError("Trying to access beyond buffer length")}Buffer$1.prototype.readUIntLE=function t(n,o,s){n=n|0,o=o|0,s||checkOffset(n,o,this.length);for(var c=this[n],d=1,h=0;++h<o&&(d*=256);)c+=this[n+h]*d;return c},Buffer$1.prototype.readUIntBE=function t(n,o,s){n=n|0,o=o|0,s||checkOffset(n,o,this.length);for(var c=this[n+--o],d=1;o>0&&(d*=256);)c+=this[n+--o]*d;return c},Buffer$1.prototype.readUInt8=function t(n,o){return o||checkOffset(n,1,this.length),this[n]},Buffer$1.prototype.readUInt16LE=function t(n,o){return o||checkOffset(n,2,this.length),this[n]|this[n+1]<<8},Buffer$1.prototype.readUInt16BE=function t(n,o){return o||checkOffset(n,2,this.length),this[n]<<8|this[n+1]},Buffer$1.prototype.readUInt32LE=function t(n,o){return o||checkOffset(n,4,this.length),(this[n]|this[n+1]<<8|this[n+2]<<16)+this[n+3]*16777216},Buffer$1.prototype.readUInt32BE=function t(n,o){return o||checkOffset(n,4,this.length),this[n]*16777216+(this[n+1]<<16|this[n+2]<<8|this[n+3])},Buffer$1.prototype.readIntLE=function t(n,o,s){n=n|0,o=o|0,s||checkOffset(n,o,this.length);for(var c=this[n],d=1,h=0;++h<o&&(d*=256);)c+=this[n+h]*d;return d*=128,c>=d&&(c-=Math.pow(2,8*o)),c},Buffer$1.prototype.readIntBE=function t(n,o,s){n=n|0,o=o|0,s||checkOffset(n,o,this.length);for(var c=o,d=1,h=this[n+--c];c>0&&(d*=256);)h+=this[n+--c]*d;return d*=128,h>=d&&(h-=Math.pow(2,8*o)),h},Buffer$1.prototype.readInt8=function t(n,o){return o||checkOffset(n,1,this.length),this[n]&128?(255-this[n]+1)*-1:this[n]},Buffer$1.prototype.readInt16LE=function t(n,o){o||checkOffset(n,2,this.length);var s=this[n]|this[n+1]<<8;return s&32768?s|4294901760:s},Buffer$1.prototype.readInt16BE=function t(n,o){o||checkOffset(n,2,this.length);var s=this[n+1]|this[n]<<8;return s&32768?s|4294901760:s},Buffer$1.prototype.readInt32LE=function t(n,o){return o||checkOffset(n,4,this.length),this[n]|this[n+1]<<8|this[n+2]<<16|this[n+3]<<24},Buffer$1.prototype.readInt32BE=function t(n,o){return o||checkOffset(n,4,this.length),this[n]<<24|this[n+1]<<16|this[n+2]<<8|this[n+3]},Buffer$1.prototype.readFloatLE=function t(n,o){return o||checkOffset(n,4,this.length),read(this,n,!0,23,4)},Buffer$1.prototype.readFloatBE=function t(n,o){return o||checkOffset(n,4,this.length),read(this,n,!1,23,4)},Buffer$1.prototype.readDoubleLE=function t(n,o){return o||checkOffset(n,8,this.length),read(this,n,!0,52,8)},Buffer$1.prototype.readDoubleBE=function t(n,o){return o||checkOffset(n,8,this.length),read(this,n,!1,52,8)};function checkInt(t,n,o,s,c,d){if(!internalIsBuffer(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(n>c||n<d)throw new RangeError('"value" argument is out of bounds');if(o+s>t.length)throw new RangeError("Index out of range")}Buffer$1.prototype.writeUIntLE=function t(n,o,s,c){if(n=+n,o=o|0,s=s|0,!c){var d=Math.pow(2,8*s)-1;checkInt(this,n,o,s,d,0)}var h=1,p=0;for(this[o]=n&255;++p<s&&(h*=256);)this[o+p]=n/h&255;return o+s},Buffer$1.prototype.writeUIntBE=function t(n,o,s,c){if(n=+n,o=o|0,s=s|0,!c){var d=Math.pow(2,8*s)-1;checkInt(this,n,o,s,d,0)}var h=s-1,p=1;for(this[o+h]=n&255;--h>=0&&(p*=256);)this[o+h]=n/p&255;return o+s},Buffer$1.prototype.writeUInt8=function t(n,o,s){return n=+n,o=o|0,s||checkInt(this,n,o,1,255,0),Buffer$1.TYPED_ARRAY_SUPPORT||(n=Math.floor(n)),this[o]=n&255,o+1};function objectWriteUInt16(t,n,o,s){n<0&&(n=65535+n+1);for(var c=0,d=Math.min(t.length-o,2);c<d;++c)t[o+c]=(n&255<<8*(s?c:1-c))>>>(s?c:1-c)*8}Buffer$1.prototype.writeUInt16LE=function t(n,o,s){return n=+n,o=o|0,s||checkInt(this,n,o,2,65535,0),Buffer$1.TYPED_ARRAY_SUPPORT?(this[o]=n&255,this[o+1]=n>>>8):objectWriteUInt16(this,n,o,!0),o+2},Buffer$1.prototype.writeUInt16BE=function t(n,o,s){return n=+n,o=o|0,s||checkInt(this,n,o,2,65535,0),Buffer$1.TYPED_ARRAY_SUPPORT?(this[o]=n>>>8,this[o+1]=n&255):objectWriteUInt16(this,n,o,!1),o+2};function objectWriteUInt32(t,n,o,s){n<0&&(n=4294967295+n+1);for(var c=0,d=Math.min(t.length-o,4);c<d;++c)t[o+c]=n>>>(s?c:3-c)*8&255}Buffer$1.prototype.writeUInt32LE=function t(n,o,s){return n=+n,o=o|0,s||checkInt(this,n,o,4,4294967295,0),Buffer$1.TYPED_ARRAY_SUPPORT?(this[o+3]=n>>>24,this[o+2]=n>>>16,this[o+1]=n>>>8,this[o]=n&255):objectWriteUInt32(this,n,o,!0),o+4},Buffer$1.prototype.writeUInt32BE=function t(n,o,s){return n=+n,o=o|0,s||checkInt(this,n,o,4,4294967295,0),Buffer$1.TYPED_ARRAY_SUPPORT?(this[o]=n>>>24,this[o+1]=n>>>16,this[o+2]=n>>>8,this[o+3]=n&255):objectWriteUInt32(this,n,o,!1),o+4},Buffer$1.prototype.writeIntLE=function t(n,o,s,c){if(n=+n,o=o|0,!c){var d=Math.pow(2,8*s-1);checkInt(this,n,o,s,d-1,-d)}var h=0,p=1,y=0;for(this[o]=n&255;++h<s&&(p*=256);)n<0&&y===0&&this[o+h-1]!==0&&(y=1),this[o+h]=(n/p>>0)-y&255;return o+s},Buffer$1.prototype.writeIntBE=function t(n,o,s,c){if(n=+n,o=o|0,!c){var d=Math.pow(2,8*s-1);checkInt(this,n,o,s,d-1,-d)}var h=s-1,p=1,y=0;for(this[o+h]=n&255;--h>=0&&(p*=256);)n<0&&y===0&&this[o+h+1]!==0&&(y=1),this[o+h]=(n/p>>0)-y&255;return o+s},Buffer$1.prototype.writeInt8=function t(n,o,s){return n=+n,o=o|0,s||checkInt(this,n,o,1,127,-128),Buffer$1.TYPED_ARRAY_SUPPORT||(n=Math.floor(n)),n<0&&(n=255+n+1),this[o]=n&255,o+1},Buffer$1.prototype.writeInt16LE=function t(n,o,s){return n=+n,o=o|0,s||checkInt(this,n,o,2,32767,-32768),Buffer$1.TYPED_ARRAY_SUPPORT?(this[o]=n&255,this[o+1]=n>>>8):objectWriteUInt16(this,n,o,!0),o+2},Buffer$1.prototype.writeInt16BE=function t(n,o,s){return n=+n,o=o|0,s||checkInt(this,n,o,2,32767,-32768),Buffer$1.TYPED_ARRAY_SUPPORT?(this[o]=n>>>8,this[o+1]=n&255):objectWriteUInt16(this,n,o,!1),o+2},Buffer$1.prototype.writeInt32LE=function t(n,o,s){return n=+n,o=o|0,s||checkInt(this,n,o,4,2147483647,-2147483648),Buffer$1.TYPED_ARRAY_SUPPORT?(this[o]=n&255,this[o+1]=n>>>8,this[o+2]=n>>>16,this[o+3]=n>>>24):objectWriteUInt32(this,n,o,!0),o+4},Buffer$1.prototype.writeInt32BE=function t(n,o,s){return n=+n,o=o|0,s||checkInt(this,n,o,4,2147483647,-2147483648),n<0&&(n=4294967295+n+1),Buffer$1.TYPED_ARRAY_SUPPORT?(this[o]=n>>>24,this[o+1]=n>>>16,this[o+2]=n>>>8,this[o+3]=n&255):objectWriteUInt32(this,n,o,!1),o+4};function checkIEEE754(t,n,o,s,c,d){if(o+s>t.length)throw new RangeError("Index out of range");if(o<0)throw new RangeError("Index out of range")}function writeFloat(t,n,o,s,c){return c||checkIEEE754(t,n,o,4),write(t,n,o,s,23,4),o+4}Buffer$1.prototype.writeFloatLE=function t(n,o,s){return writeFloat(this,n,o,!0,s)},Buffer$1.prototype.writeFloatBE=function t(n,o,s){return writeFloat(this,n,o,!1,s)};function writeDouble(t,n,o,s,c){return c||checkIEEE754(t,n,o,8),write(t,n,o,s,52,8),o+8}Buffer$1.prototype.writeDoubleLE=function t(n,o,s){return writeDouble(this,n,o,!0,s)},Buffer$1.prototype.writeDoubleBE=function t(n,o,s){return writeDouble(this,n,o,!1,s)},Buffer$1.prototype.copy=function t(n,o,s,c){if(s||(s=0),!c&&c!==0&&(c=this.length),o>=n.length&&(o=n.length),o||(o=0),c>0&&c<s&&(c=s),c===s||n.length===0||this.length===0)return 0;if(o<0)throw new RangeError("targetStart out of bounds");if(s<0||s>=this.length)throw new RangeError("sourceStart out of bounds");if(c<0)throw new RangeError("sourceEnd out of bounds");c>this.length&&(c=this.length),n.length-o<c-s&&(c=n.length-o+s);var d=c-s,h;if(this===n&&s<o&&o<c)for(h=d-1;h>=0;--h)n[h+o]=this[h+s];else if(d<1e3||!Buffer$1.TYPED_ARRAY_SUPPORT)for(h=0;h<d;++h)n[h+o]=this[h+s];else Uint8Array.prototype.set.call(n,this.subarray(s,s+d),o);return d},Buffer$1.prototype.fill=function t(n,o,s,c){if(typeof n=="string"){if(typeof o=="string"?(c=o,o=0,s=this.length):typeof s=="string"&&(c=s,s=this.length),n.length===1){var d=n.charCodeAt(0);d<256&&(n=d)}if(c!==void 0&&typeof c!="string")throw new TypeError("encoding must be a string");if(typeof c=="string"&&!Buffer$1.isEncoding(c))throw new TypeError("Unknown encoding: "+c)}else typeof n=="number"&&(n=n&255);if(o<0||this.length<o||this.length<s)throw new RangeError("Out of range index");if(s<=o)return this;o=o>>>0,s=s===void 0?this.length:s>>>0,n||(n=0);var h;if(typeof n=="number")for(h=o;h<s;++h)this[h]=n;else{var p=internalIsBuffer(n)?n:utf8ToBytes(new Buffer$1(n,c).toString()),y=p.length;for(h=0;h<s-o;++h)this[h+o]=p[h%y]}return this};var INVALID_BASE64_RE=/[^+\/0-9A-Za-z-_]/g;function base64clean(t){if(t=stringtrim(t).replace(INVALID_BASE64_RE,""),t.length<2)return"";for(;t.length%4!==0;)t=t+"=";return t}function stringtrim(t){return t.trim?t.trim():t.replace(/^\s+|\s+$/g,"")}function toHex(t){return t<16?"0"+t.toString(16):t.toString(16)}function utf8ToBytes(t,n){n=n||1/0;for(var o,s=t.length,c=null,d=[],h=0;h<s;++h){if(o=t.charCodeAt(h),o>55295&&o<57344){if(!c){if(o>56319){(n-=3)>-1&&d.push(239,191,189);continue}else if(h+1===s){(n-=3)>-1&&d.push(239,191,189);continue}c=o;continue}if(o<56320){(n-=3)>-1&&d.push(239,191,189),c=o;continue}o=(c-55296<<10|o-56320)+65536}else c&&(n-=3)>-1&&d.push(239,191,189);if(c=null,o<128){if((n-=1)<0)break;d.push(o)}else if(o<2048){if((n-=2)<0)break;d.push(o>>6|192,o&63|128)}else if(o<65536){if((n-=3)<0)break;d.push(o>>12|224,o>>6&63|128,o&63|128)}else if(o<1114112){if((n-=4)<0)break;d.push(o>>18|240,o>>12&63|128,o>>6&63|128,o&63|128)}else throw new Error("Invalid code point")}return d}function asciiToBytes(t){for(var n=[],o=0;o<t.length;++o)n.push(t.charCodeAt(o)&255);return n}function utf16leToBytes(t,n){for(var o,s,c,d=[],h=0;h<t.length&&!((n-=2)<0);++h)o=t.charCodeAt(h),s=o>>8,c=o%256,d.push(c),d.push(s);return d}function base64ToBytes(t){return toByteArray(base64clean(t))}function blitBuffer(t,n,o,s){for(var c=0;c<s&&!(c+o>=n.length||c>=t.length);++c)n[c+o]=t[c];return c}function isnan(t){return t!==t}function isBuffer(t){return t!=null&&(!!t._isBuffer||isFastBuffer(t)||isSlowBuffer(t))}function isFastBuffer(t){return!!t.constructor&&typeof t.constructor.isBuffer=="function"&&t.constructor.isBuffer(t)}function isSlowBuffer(t){return typeof t.readFloatLE=="function"&&typeof t.slice=="function"&&isFastBuffer(t.slice(0,0))}var domain;function EventHandlers(){}EventHandlers.prototype=Object.create(null);function EventEmitter(){EventEmitter.init.call(this)}EventEmitter.EventEmitter=EventEmitter,EventEmitter.usingDomains=!1,EventEmitter.prototype.domain=void 0,EventEmitter.prototype._events=void 0,EventEmitter.prototype._maxListeners=void 0,EventEmitter.defaultMaxListeners=10,EventEmitter.init=function(){this.domain=null,EventEmitter.usingDomains&&domain.active,(!this._events||this._events===Object.getPrototypeOf(this)._events)&&(this._events=new EventHandlers,this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},EventEmitter.prototype.setMaxListeners=function t(n){if(typeof n!="number"||n<0||isNaN(n))throw new TypeError('"n" argument must be a positive number');return this._maxListeners=n,this};function $getMaxListeners(t){return t._maxListeners===void 0?EventEmitter.defaultMaxListeners:t._maxListeners}EventEmitter.prototype.getMaxListeners=function t(){return $getMaxListeners(this)};function emitNone(t,n,o){if(n)t.call(o);else for(var s=t.length,c=arrayClone(t,s),d=0;d<s;++d)c[d].call(o)}function emitOne(t,n,o,s){if(n)t.call(o,s);else for(var c=t.length,d=arrayClone(t,c),h=0;h<c;++h)d[h].call(o,s)}function emitTwo(t,n,o,s,c){if(n)t.call(o,s,c);else for(var d=t.length,h=arrayClone(t,d),p=0;p<d;++p)h[p].call(o,s,c)}function emitThree(t,n,o,s,c,d){if(n)t.call(o,s,c,d);else for(var h=t.length,p=arrayClone(t,h),y=0;y<h;++y)p[y].call(o,s,c,d)}function emitMany(t,n,o,s){if(n)t.apply(o,s);else for(var c=t.length,d=arrayClone(t,c),h=0;h<c;++h)d[h].apply(o,s)}EventEmitter.prototype.emit=function t(n){var o,s,c,d,h,p,y,E=n==="error";if(p=this._events,p)E=E&&p.error==null;else if(!E)return!1;if(y=this.domain,E){if(o=arguments[1],y)o||(o=new Error('Uncaught, unspecified "error" event')),o.domainEmitter=this,o.domain=y,o.domainThrown=!1,y.emit("error",o);else{if(o instanceof Error)throw o;var L=new Error('Uncaught, unspecified "error" event. ('+o+")");throw L.context=o,L}return!1}if(s=p[n],!s)return!1;var F=typeof s=="function";switch(c=arguments.length,c){case 1:emitNone(s,F,this);break;case 2:emitOne(s,F,this,arguments[1]);break;case 3:emitTwo(s,F,this,arguments[1],arguments[2]);break;case 4:emitThree(s,F,this,arguments[1],arguments[2],arguments[3]);break;default:for(d=new Array(c-1),h=1;h<c;h++)d[h-1]=arguments[h];emitMany(s,F,this,d)}return!0};function _addListener(t,n,o,s){var c,d,h;if(typeof o!="function")throw new TypeError('"listener" argument must be a function');if(d=t._events,d?(d.newListener&&(t.emit("newListener",n,o.listener?o.listener:o),d=t._events),h=d[n]):(d=t._events=new EventHandlers,t._eventsCount=0),!h)h=d[n]=o,++t._eventsCount;else if(typeof h=="function"?h=d[n]=s?[o,h]:[h,o]:s?h.unshift(o):h.push(o),!h.warned&&(c=$getMaxListeners(t),c&&c>0&&h.length>c)){h.warned=!0;var p=new Error("Possible EventEmitter memory leak detected. "+h.length+" "+n+" listeners added. Use emitter.setMaxListeners() to increase limit");p.name="MaxListenersExceededWarning",p.emitter=t,p.type=n,p.count=h.length,emitWarning(p)}return t}function emitWarning(t){typeof console.warn=="function"?console.warn(t):console.log(t)}EventEmitter.prototype.addListener=function t(n,o){return _addListener(this,n,o,!1)},EventEmitter.prototype.on=EventEmitter.prototype.addListener,EventEmitter.prototype.prependListener=function t(n,o){return _addListener(this,n,o,!0)};function _onceWrap(t,n,o){var s=!1;function c(){t.removeListener(n,c),s||(s=!0,o.apply(t,arguments))}return c.listener=o,c}EventEmitter.prototype.once=function t(n,o){if(typeof o!="function")throw new TypeError('"listener" argument must be a function');return this.on(n,_onceWrap(this,n,o)),this},EventEmitter.prototype.prependOnceListener=function t(n,o){if(typeof o!="function")throw new TypeError('"listener" argument must be a function');return this.prependListener(n,_onceWrap(this,n,o)),this},EventEmitter.prototype.removeListener=function t(n,o){var s,c,d,h,p;if(typeof o!="function")throw new TypeError('"listener" argument must be a function');if(c=this._events,!c)return this;if(s=c[n],!s)return this;if(s===o||s.listener&&s.listener===o)--this._eventsCount===0?this._events=new EventHandlers:(delete c[n],c.removeListener&&this.emit("removeListener",n,s.listener||o));else if(typeof s!="function"){for(d=-1,h=s.length;h-- >0;)if(s[h]===o||s[h].listener&&s[h].listener===o){p=s[h].listener,d=h;break}if(d<0)return this;if(s.length===1){if(s[0]=void 0,--this._eventsCount===0)return this._events=new EventHandlers,this;delete c[n]}else spliceOne(s,d);c.removeListener&&this.emit("removeListener",n,p||o)}return this},EventEmitter.prototype.removeAllListeners=function t(n){var o,s;if(s=this._events,!s)return this;if(!s.removeListener)return arguments.length===0?(this._events=new EventHandlers,this._eventsCount=0):s[n]&&(--this._eventsCount===0?this._events=new EventHandlers:delete s[n]),this;if(arguments.length===0){for(var c=Object.keys(s),d=0,h;d<c.length;++d)h=c[d],h!=="removeListener"&&this.removeAllListeners(h);return this.removeAllListeners("removeListener"),this._events=new EventHandlers,this._eventsCount=0,this}if(o=s[n],typeof o=="function")this.removeListener(n,o);else if(o)do this.removeListener(n,o[o.length-1]);while(o[0]);return this},EventEmitter.prototype.listeners=function t(n){var o,s,c=this._events;return c?(o=c[n],o?typeof o=="function"?s=[o.listener||o]:s=unwrapListeners(o):s=[]):s=[],s},EventEmitter.listenerCount=function(t,n){return typeof t.listenerCount=="function"?t.listenerCount(n):listenerCount$1.call(t,n)},EventEmitter.prototype.listenerCount=listenerCount$1;function listenerCount$1(t){var n=this._events;if(n){var o=n[t];if(typeof o=="function")return 1;if(o)return o.length}return 0}EventEmitter.prototype.eventNames=function t(){return this._eventsCount>0?Reflect.ownKeys(this._events):[]};function spliceOne(t,n){for(var o=n,s=o+1,c=t.length;s<c;o+=1,s+=1)t[o]=t[s];t.pop()}function arrayClone(t,n){for(var o=new Array(n);n--;)o[n]=t[n];return o}function unwrapListeners(t){for(var n=new Array(t.length),o=0;o<n.length;++o)n[o]=t[o].listener||t[o];return n}function defaultSetTimout(){throw new Error("setTimeout has not been defined")}function defaultClearTimeout(){throw new Error("clearTimeout has not been defined")}var cachedSetTimeout=defaultSetTimout,cachedClearTimeout=defaultClearTimeout;typeof global$1.setTimeout=="function"&&(cachedSetTimeout=setTimeout),typeof global$1.clearTimeout=="function"&&(cachedClearTimeout=clearTimeout);function runTimeout(t){if(cachedSetTimeout===setTimeout)return setTimeout(t,0);if((cachedSetTimeout===defaultSetTimout||!cachedSetTimeout)&&setTimeout)return cachedSetTimeout=setTimeout,setTimeout(t,0);try{return cachedSetTimeout(t,0)}catch{try{return cachedSetTimeout.call(null,t,0)}catch{return cachedSetTimeout.call(this,t,0)}}}function runClearTimeout(t){if(cachedClearTimeout===clearTimeout)return clearTimeout(t);if((cachedClearTimeout===defaultClearTimeout||!cachedClearTimeout)&&clearTimeout)return cachedClearTimeout=clearTimeout,clearTimeout(t);try{return cachedClearTimeout(t)}catch{try{return cachedClearTimeout.call(null,t)}catch{return cachedClearTimeout.call(this,t)}}}var queue=[],draining=!1,currentQueue,queueIndex=-1;function cleanUpNextTick(){!draining||!currentQueue||(draining=!1,currentQueue.length?queue=currentQueue.concat(queue):queueIndex=-1,queue.length&&drainQueue())}function drainQueue(){if(!draining){var t=runTimeout(cleanUpNextTick);draining=!0;for(var n=queue.length;n;){for(currentQueue=queue,queue=[];++queueIndex<n;)currentQueue&¤tQueue[queueIndex].run();queueIndex=-1,n=queue.length}currentQueue=null,draining=!1,runClearTimeout(t)}}function nextTick(t){var n=new Array(arguments.length-1);if(arguments.length>1)for(var o=1;o<arguments.length;o++)n[o-1]=arguments[o];queue.push(new Item(t,n)),queue.length===1&&!draining&&runTimeout(drainQueue)}function Item(t,n){this.fun=t,this.array=n}Item.prototype.run=function(){this.fun.apply(null,this.array)};var title="browser",platform="browser",browser=!0,env={},argv=[],version="",versions={},release={},config={};function noop(){}var on=noop,addListener=noop,once=noop,off=noop,removeListener=noop,removeAllListeners=noop,emit=noop;function binding(t){throw new Error("process.binding is not supported")}function cwd(){return"/"}function chdir(t){throw new Error("process.chdir is not supported")}function umask(){return 0}var performance$1=global$1.performance||{},performanceNow=performance$1.now||performance$1.mozNow||performance$1.msNow||performance$1.oNow||performance$1.webkitNow||function(){return new Date().getTime()};function hrtime(t){var n=performanceNow.call(performance$1)*.001,o=Math.floor(n),s=Math.floor(n%1*1e9);return t&&(o=o-t[0],s=s-t[1],s<0&&(o--,s+=1e9)),[o,s]}var startTime=new Date;function uptime(){var t=new Date,n=t-startTime;return n/1e3}var process$1={nextTick,title,browser,env,argv,version,versions,on,addListener,once,off,removeListener,removeAllListeners,emit,binding,cwd,chdir,umask,hrtime,platform,release,config,uptime},inherits;typeof Object.create=="function"?inherits=function(n,o){n.super_=o,n.prototype=Object.create(o.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}})}:inherits=function(n,o){n.super_=o;var s=function(){};s.prototype=o.prototype,n.prototype=new s,n.prototype.constructor=n};var inherits$1=inherits,formatRegExp=/%[sdj%]/g;function format(t){if(!isString(t)){for(var n=[],o=0;o<arguments.length;o++)n.push(inspect(arguments[o]));return n.join(" ")}for(var o=1,s=arguments,c=s.length,d=String(t).replace(formatRegExp,function(p){if(p==="%%")return"%";if(o>=c)return p;switch(p){case"%s":return String(s[o++]);case"%d":return Number(s[o++]);case"%j":try{return JSON.stringify(s[o++])}catch{return"[Circular]"}default:return p}}),h=s[o];o<c;h=s[++o])isNull(h)||!isObject(h)?d+=" "+h:d+=" "+inspect(h);return d}function deprecate(t,n){if(isUndefined(global$1.process))return function(){return deprecate(t,n).apply(this,arguments)};if(process$1.noDeprecation===!0)return t;var o=!1;function s(){if(!o){if(process$1.throwDeprecation)throw new Error(n);process$1.traceDeprecation?console.trace(n):console.error(n),o=!0}return t.apply(this,arguments)}return s}var debugs={},debugEnviron;function debuglog(t){if(isUndefined(debugEnviron)&&(debugEnviron=process$1.env.NODE_DEBUG||""),t=t.toUpperCase(),!debugs[t])if(new RegExp("\\b"+t+"\\b","i").test(debugEnviron)){var n=0;debugs[t]=function(){var o=format.apply(null,arguments);console.error("%s %d: %s",t,n,o)}}else debugs[t]=function(){};return debugs[t]}function inspect(t,n){var o={seen:[],stylize:stylizeNoColor};return arguments.length>=3&&(o.depth=arguments[2]),arguments.length>=4&&(o.colors=arguments[3]),isBoolean(n)?o.showHidden=n:n&&_extend(o,n),isUndefined(o.showHidden)&&(o.showHidden=!1),isUndefined(o.depth)&&(o.depth=2),isUndefined(o.colors)&&(o.colors=!1),isUndefined(o.customInspect)&&(o.customInspect=!0),o.colors&&(o.stylize=stylizeWithColor),formatValue(o,t,o.depth)}inspect.colors={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[30,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[31,39],yellow:[33,39]},inspect.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"};function stylizeWithColor(t,n){var o=inspect.styles[n];return o?"\x1B["+inspect.colors[o][0]+"m"+t+"\x1B["+inspect.colors[o][1]+"m":t}function stylizeNoColor(t,n){return t}function arrayToHash(t){var n={};return t.forEach(function(o,s){n[o]=!0}),n}function formatValue(t,n,o){if(t.customInspect&&n&&isFunction(n.inspect)&&n.inspect!==inspect&&!(n.constructor&&n.constructor.prototype===n)){var s=n.inspect(o,t);return isString(s)||(s=formatValue(t,s,o)),s}var c=formatPrimitive(t,n);if(c)return c;var d=Object.keys(n),h=arrayToHash(d);if(t.showHidden&&(d=Object.getOwnPropertyNames(n)),isError(n)&&(d.indexOf("message")>=0||d.indexOf("description")>=0))return formatError(n);if(d.length===0){if(isFunction(n)){var p=n.name?": "+n.name:"";return t.stylize("[Function"+p+"]","special")}if(isRegExp(n))return t.stylize(RegExp.prototype.toString.call(n),"regexp");if(isDate(n))return t.stylize(Date.prototype.toString.call(n),"date");if(isError(n))return formatError(n)}var y="",E=!1,L=["{","}"];if(isArray(n)&&(E=!0,L=["[","]"]),isFunction(n)){var F=n.name?": "+n.name:"";y=" [Function"+F+"]"}if(isRegExp(n)&&(y=" "+RegExp.prototype.toString.call(n)),isDate(n)&&(y=" "+Date.prototype.toUTCString.call(n)),isError(n)&&(y=" "+formatError(n)),d.length===0&&(!E||n.length==0))return L[0]+y+L[1];if(o<0)return isRegExp(n)?t.stylize(RegExp.prototype.toString.call(n),"regexp"):t.stylize("[Object]","special");t.seen.push(n);var N;return E?N=formatArray(t,n,o,h,d):N=d.map(function(z){return formatProperty(t,n,o,h,z,E)}),t.seen.pop(),reduceToSingleString(N,y,L)}function formatPrimitive(t,n){if(isUndefined(n))return t.stylize("undefined","undefined");if(isString(n)){var o="'"+JSON.stringify(n).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return t.stylize(o,"string")}if(isNumber(n))return t.stylize(""+n,"number");if(isBoolean(n))return t.stylize(""+n,"boolean");if(isNull(n))return t.stylize("null","null")}function formatError(t){return"["+Error.prototype.toString.call(t)+"]"}function formatArray(t,n,o,s,c){for(var d=[],h=0,p=n.length;h<p;++h)hasOwnProperty(n,String(h))?d.push(formatProperty(t,n,o,s,String(h),!0)):d.push("");return c.forEach(function(y){y.match(/^\d+$/)||d.push(formatProperty(t,n,o,s,y,!0))}),d}function formatProperty(t,n,o,s,c,d){var h,p,y;if(y=Object.getOwnPropertyDescriptor(n,c)||{value:n[c]},y.get?y.set?p=t.stylize("[Getter/Setter]","special"):p=t.stylize("[Getter]","special"):y.set&&(p=t.stylize("[Setter]","special")),hasOwnProperty(s,c)||(h="["+c+"]"),p||(t.seen.indexOf(y.value)<0?(isNull(o)?p=formatValue(t,y.value,null):p=formatValue(t,y.value,o-1),p.indexOf(`
|
|
6746
6746
|
`)>-1&&(d?p=p.split(`
|
|
6747
6747
|
`).map(function(E){return" "+E}).join(`
|
|
6748
6748
|
`).substr(2):p=`
|