@deck.gl/widgets 9.3.0-alpha.3 → 9.3.0-alpha.6

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.min.js CHANGED
@@ -4,7 +4,7 @@
4
4
  else if (typeof define === 'function' && define.amd) define([], factory);
5
5
  else if (typeof exports === 'object') exports['deck'] = factory();
6
6
  else root['deck'] = factory();})(globalThis, function () {
7
- "use strict";var __exports__=(()=>{var Yn=Object.create;var vt=Object.defineProperty;var jn=Object.getOwnPropertyDescriptor;var Kn=Object.getOwnPropertyNames;var Zn=Object.getPrototypeOf,Qn=Object.prototype.hasOwnProperty;var Do=(t,o)=>()=>(o||t((o={exports:{}}).exports,o),o.exports),ei=(t,o)=>{for(var e in o)vt(t,e,{get:o[e],enumerable:!0})},ht=(t,o,e,n)=>{if(o&&typeof o=="object"||typeof o=="function")for(let i of Kn(o))!Qn.call(t,i)&&i!==e&&vt(t,i,{get:()=>o[i],enumerable:!(n=jn(o,i))||n.enumerable});return t},re=(t,o,e)=>(ht(t,o,"default"),e&&ht(e,o,"default")),E=(t,o,e)=>(e=t!=null?Yn(Zn(t)):{},ht(o||!t||!t.__esModule?vt(e,"default",{value:t,enumerable:!0}):e,t)),ti=t=>ht(vt({},"__esModule",{value:!0}),t);var R=Do((Zi,Ho)=>{Ho.exports=globalThis.deck});var Gn=Do((Ca,zn)=>{zn.exports=globalThis.luma});var gt={};ei(gt,{CompassWidget:()=>Fe,ContextMenuWidget:()=>nt,DarkGlassTheme:()=>qt,DarkTheme:()=>Fn,FullscreenWidget:()=>Ue,GimbalWidget:()=>$e,IconWidget:()=>at,InfoWidget:()=>tt,LightGlassTheme:()=>Ut,LightTheme:()=>Bn,LoadingWidget:()=>mt,PopupWidget:()=>ot,ResetViewWidget:()=>Ne,ScreenshotWidget:()=>pt,ScrollbarWidget:()=>st,SelectorWidget:()=>ct,ThemeWidget:()=>ut,ToggleWidget:()=>lt,ZoomWidget:()=>He,_ButtonGroup:()=>Pt,_CoordinatesGeocoder:()=>Me,_CurrentLocationGeocoder:()=>Et,_DropdownMenu:()=>Ct,_GeocoderWidget:()=>Ge,_GoogleGeocoder:()=>Lt,_IconButton:()=>M,_MapboxGeocoder:()=>It,_OpenCageGeocoder:()=>Wt,_RangeInput:()=>Oe,_ScaleWidget:()=>ze,_SimpleMenu:()=>he,_SplitterWidget:()=>Xe,_StatsWidget:()=>ft,_TimelineWidget:()=>dt});var K={},No=E(R(),1);re(K,E(R(),1));if(!No.Layer)throw new Error("@deck.gl/core is not found");re(gt,K);var ge=E(R(),1);var xt,W,Go,oi,me,$o,Uo,Jt,Zt,Yt,jt,ni,Ve={},qo=[],ii=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,Qt=Array.isArray;function se(t,o){for(var e in o)t[e]=o[e];return t}function Xo(t){var o=t.parentNode;o&&o.removeChild(t)}function ri(t,o,e){var n,i,r,s={};for(r in o)r=="key"?n=o[r]:r=="ref"?i=o[r]:s[r]=o[r];if(arguments.length>2&&(s.children=arguments.length>3?xt.call(arguments,2):e),typeof t=="function"&&t.defaultProps!=null)for(r in t.defaultProps)s[r]===void 0&&(s[r]=t.defaultProps[r]);return _t(t,s,n,i,null)}function _t(t,o,e,n,i){var r={type:t,props:o,key:e,ref:n,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,constructor:void 0,__v:i??++Go,__i:-1,__u:0};return i==null&&W.vnode!=null&&W.vnode(r),r}function ae(t){return t.children}function bt(t,o){this.props=t,this.context=o}function fe(t,o){if(o==null)return t.__?fe(t.__,t.__i+1):null;for(var e;o<t.__k.length;o++)if((e=t.__k[o])!=null&&e.__e!=null)return e.__e;return typeof t.type=="function"?fe(t):null}function Jo(t){var o,e;if((t=t.__)!=null&&t.__c!=null){for(t.__e=t.__c.base=null,o=0;o<t.__k.length;o++)if((e=t.__k[o])!=null&&e.__e!=null){t.__e=t.__c.base=e.__e;break}return Jo(t)}}function Bo(t){(!t.__d&&(t.__d=!0)&&me.push(t)&&!yt.__r++||$o!==W.debounceRendering)&&(($o=W.debounceRendering)||Uo)(yt)}function yt(){var t,o,e,n,i,r,s,a;for(me.sort(Jt);t=me.shift();)t.__d&&(o=me.length,n=void 0,r=(i=(e=t).__v).__e,s=[],a=[],e.__P&&((n=se({},i)).__v=i.__v+1,W.vnode&&W.vnode(n),eo(e.__P,n,i,e.__n,e.__P.namespaceURI,32&i.__u?[r]:null,s,r??fe(i),!!(32&i.__u),a),n.__v=i.__v,n.__.__k[n.__i]=n,Ko(s,n,a),n.__e!=r&&Jo(n)),me.length>o&&me.sort(Jt));yt.__r=0}function Yo(t,o,e,n,i,r,s,a,c,d,m){var l,g,u,f,_,w=n&&n.__k||qo,h=o.length;for(e.__d=c,si(e,o,w),c=e.__d,l=0;l<h;l++)(u=e.__k[l])!=null&&typeof u!="boolean"&&typeof u!="function"&&(g=u.__i===-1?Ve:w[u.__i]||Ve,u.__i=l,eo(t,u,g,i,r,s,a,c,d,m),f=u.__e,u.ref&&g.ref!=u.ref&&(g.ref&&to(g.ref,null,u),m.push(u.ref,u.__c||f,u)),_==null&&f!=null&&(_=f),65536&u.__u||g.__k===u.__k?c=jo(u,c,t):typeof u.type=="function"&&u.__d!==void 0?c=u.__d:f&&(c=f.nextSibling),u.__d=void 0,u.__u&=-196609);e.__d=c,e.__e=_}function si(t,o,e){var n,i,r,s,a,c=o.length,d=e.length,m=d,l=0;for(t.__k=[],n=0;n<c;n++)s=n+l,(i=t.__k[n]=(i=o[n])==null||typeof i=="boolean"||typeof i=="function"?null:typeof i=="string"||typeof i=="number"||typeof i=="bigint"||i.constructor==String?_t(null,i,null,null,null):Qt(i)?_t(ae,{children:i},null,null,null):i.constructor===void 0&&i.__b>0?_t(i.type,i.props,i.key,i.ref?i.ref:null,i.__v):i)!=null?(i.__=t,i.__b=t.__b+1,a=ai(i,e,s,m),i.__i=a,r=null,a!==-1&&(m--,(r=e[a])&&(r.__u|=131072)),r==null||r.__v===null?(a==-1&&l--,typeof i.type!="function"&&(i.__u|=65536)):a!==s&&(a==s-1?l--:a==s+1?l++:a>s?m>c-s?l+=a-s:l--:a<s&&(a==s-l?l-=a-s:l++),a!==n+l&&(i.__u|=65536))):(r=e[s])&&r.key==null&&r.__e&&!(131072&r.__u)&&(r.__e==t.__d&&(t.__d=fe(r)),Kt(r,r,!1),e[s]=null,m--);if(m)for(n=0;n<d;n++)(r=e[n])!=null&&!(131072&r.__u)&&(r.__e==t.__d&&(t.__d=fe(r)),Kt(r,r))}function jo(t,o,e){var n,i;if(typeof t.type=="function"){for(n=t.__k,i=0;n&&i<n.length;i++)n[i]&&(n[i].__=t,o=jo(n[i],o,e));return o}t.__e!=o&&(o&&t.type&&!e.contains(o)&&(o=fe(t)),e.insertBefore(t.__e,o||null),o=t.__e);do o=o&&o.nextSibling;while(o!=null&&o.nodeType===8);return o}function ai(t,o,e,n){var i=t.key,r=t.type,s=e-1,a=e+1,c=o[e];if(c===null||c&&i==c.key&&r===c.type&&!(131072&c.__u))return e;if(n>(c!=null&&!(131072&c.__u)?1:0))for(;s>=0||a<o.length;){if(s>=0){if((c=o[s])&&!(131072&c.__u)&&i==c.key&&r===c.type)return s;s--}if(a<o.length){if((c=o[a])&&!(131072&c.__u)&&i==c.key&&r===c.type)return a;a++}}return-1}function Fo(t,o,e){o[0]==="-"?t.setProperty(o,e??""):t[o]=e==null?"":typeof e!="number"||ii.test(o)?e:e+"px"}function wt(t,o,e,n,i){var r;e:if(o==="style")if(typeof e=="string")t.style.cssText=e;else{if(typeof n=="string"&&(t.style.cssText=n=""),n)for(o in n)e&&o in e||Fo(t.style,o,"");if(e)for(o in e)n&&e[o]===n[o]||Fo(t.style,o,e[o])}else if(o[0]==="o"&&o[1]==="n")r=o!==(o=o.replace(/(PointerCapture)$|Capture$/i,"$1")),o=o.toLowerCase()in t||o==="onFocusOut"||o==="onFocusIn"?o.toLowerCase().slice(2):o.slice(2),t.l||(t.l={}),t.l[o+r]=e,e?n?e.u=n.u:(e.u=Zt,t.addEventListener(o,r?jt:Yt,r)):t.removeEventListener(o,r?jt:Yt,r);else{if(i=="http://www.w3.org/2000/svg")o=o.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if(o!="width"&&o!="height"&&o!="href"&&o!="list"&&o!="form"&&o!="tabIndex"&&o!="download"&&o!="rowSpan"&&o!="colSpan"&&o!="role"&&o!="popover"&&o in t)try{t[o]=e??"";break e}catch{}typeof e=="function"||(e==null||e===!1&&o[4]!=="-"?t.removeAttribute(o):t.setAttribute(o,o=="popover"&&e==1?"":e))}}function zo(t){return function(o){if(this.l){var e=this.l[o.type+t];if(o.t==null)o.t=Zt++;else if(o.t<e.u)return;return e(W.event?W.event(o):o)}}}function eo(t,o,e,n,i,r,s,a,c,d){var m,l,g,u,f,_,w,h,b,P,k,y,S,L,I,D,O=o.type;if(o.constructor!==void 0)return null;128&e.__u&&(c=!!(32&e.__u),r=[a=o.__e=e.__e]),(m=W.__b)&&m(o);e:if(typeof O=="function")try{if(h=o.props,b="prototype"in O&&O.prototype.render,P=(m=O.contextType)&&n[m.__c],k=m?P?P.props.value:m.__:n,e.__c?w=(l=o.__c=e.__c).__=l.__E:(b?o.__c=l=new O(h,k):(o.__c=l=new bt(h,k),l.constructor=O,l.render=ci),P&&P.sub(l),l.props=h,l.state||(l.state={}),l.context=k,l.__n=n,g=l.__d=!0,l.__h=[],l._sb=[]),b&&l.__s==null&&(l.__s=l.state),b&&O.getDerivedStateFromProps!=null&&(l.__s==l.state&&(l.__s=se({},l.__s)),se(l.__s,O.getDerivedStateFromProps(h,l.__s))),u=l.props,f=l.state,l.__v=o,g)b&&O.getDerivedStateFromProps==null&&l.componentWillMount!=null&&l.componentWillMount(),b&&l.componentDidMount!=null&&l.__h.push(l.componentDidMount);else{if(b&&O.getDerivedStateFromProps==null&&h!==u&&l.componentWillReceiveProps!=null&&l.componentWillReceiveProps(h,k),!l.__e&&(l.shouldComponentUpdate!=null&&l.shouldComponentUpdate(h,l.__s,k)===!1||o.__v===e.__v)){for(o.__v!==e.__v&&(l.props=h,l.state=l.__s,l.__d=!1),o.__e=e.__e,o.__k=e.__k,o.__k.forEach(function(C){C&&(C.__=o)}),y=0;y<l._sb.length;y++)l.__h.push(l._sb[y]);l._sb=[],l.__h.length&&s.push(l);break e}l.componentWillUpdate!=null&&l.componentWillUpdate(h,l.__s,k),b&&l.componentDidUpdate!=null&&l.__h.push(function(){l.componentDidUpdate(u,f,_)})}if(l.context=k,l.props=h,l.__P=t,l.__e=!1,S=W.__r,L=0,b){for(l.state=l.__s,l.__d=!1,S&&S(o),m=l.render(l.props,l.state,l.context),I=0;I<l._sb.length;I++)l.__h.push(l._sb[I]);l._sb=[]}else do l.__d=!1,S&&S(o),m=l.render(l.props,l.state,l.context),l.state=l.__s;while(l.__d&&++L<25);l.state=l.__s,l.getChildContext!=null&&(n=se(se({},n),l.getChildContext())),b&&!g&&l.getSnapshotBeforeUpdate!=null&&(_=l.getSnapshotBeforeUpdate(u,f)),Yo(t,Qt(D=m!=null&&m.type===ae&&m.key==null?m.props.children:m)?D:[D],o,e,n,i,r,s,a,c,d),l.base=o.__e,o.__u&=-161,l.__h.length&&s.push(l),w&&(l.__E=l.__=null)}catch(C){if(o.__v=null,c||r!=null){for(o.__u|=c?160:32;a&&a.nodeType===8&&a.nextSibling;)a=a.nextSibling;r[r.indexOf(a)]=null,o.__e=a}else o.__e=e.__e,o.__k=e.__k;W.__e(C,o,e)}else r==null&&o.__v===e.__v?(o.__k=e.__k,o.__e=e.__e):o.__e=li(e.__e,o,e,n,i,r,s,c,d);(m=W.diffed)&&m(o)}function Ko(t,o,e){o.__d=void 0;for(var n=0;n<e.length;n++)to(e[n],e[++n],e[++n]);W.__c&&W.__c(o,t),t.some(function(i){try{t=i.__h,i.__h=[],t.some(function(r){r.call(i)})}catch(r){W.__e(r,i.__v)}})}function li(t,o,e,n,i,r,s,a,c){var d,m,l,g,u,f,_,w=e.props,h=o.props,b=o.type;if(b==="svg"?i="http://www.w3.org/2000/svg":b==="math"?i="http://www.w3.org/1998/Math/MathML":i||(i="http://www.w3.org/1999/xhtml"),r!=null){for(d=0;d<r.length;d++)if((u=r[d])&&"setAttribute"in u==!!b&&(b?u.localName===b:u.nodeType===3)){t=u,r[d]=null;break}}if(t==null){if(b===null)return document.createTextNode(h);t=document.createElementNS(i,b,h.is&&h),r=null,a=!1}if(b===null)w===h||a&&t.data===h||(t.data=h);else{if(r=r&&xt.call(t.childNodes),w=e.props||Ve,!a&&r!=null)for(w={},d=0;d<t.attributes.length;d++)w[(u=t.attributes[d]).name]=u.value;for(d in w)if(u=w[d],d!="children"){if(d=="dangerouslySetInnerHTML")l=u;else if(d!=="key"&&!(d in h)){if(d=="value"&&"defaultValue"in h||d=="checked"&&"defaultChecked"in h)continue;wt(t,d,null,u,i)}}for(d in h)u=h[d],d=="children"?g=u:d=="dangerouslySetInnerHTML"?m=u:d=="value"?f=u:d=="checked"?_=u:d==="key"||a&&typeof u!="function"||w[d]===u||wt(t,d,u,w[d],i);if(m)a||l&&(m.__html===l.__html||m.__html===t.innerHTML)||(t.innerHTML=m.__html),o.__k=[];else if(l&&(t.innerHTML=""),Yo(t,Qt(g)?g:[g],o,e,n,b==="foreignObject"?"http://www.w3.org/1999/xhtml":i,r,s,r?r[0]:e.__k&&fe(e,0),a,c),r!=null)for(d=r.length;d--;)r[d]!=null&&Xo(r[d]);a||(d="value",f!==void 0&&(f!==t[d]||b==="progress"&&!f||b==="option"&&f!==w[d])&&wt(t,d,f,w[d],i),d="checked",_!==void 0&&_!==t[d]&&wt(t,d,_,w[d],i))}return t}function to(t,o,e){try{if(typeof t=="function"){var n=typeof t.__u=="function";n&&t.__u(),n&&o==null||(t.__u=t(o))}else t.current=o}catch(i){W.__e(i,e)}}function Kt(t,o,e){var n,i;if(W.unmount&&W.unmount(t),(n=t.ref)&&(n.current&&n.current!==t.__e||to(n,null,o)),(n=t.__c)!=null){if(n.componentWillUnmount)try{n.componentWillUnmount()}catch(r){W.__e(r,o)}n.base=n.__P=null}if(n=t.__k)for(i=0;i<n.length;i++)n[i]&&Kt(n[i],o,e||typeof t.type!="function");e||t.__e==null||Xo(t.__e),t.__c=t.__=t.__e=t.__d=void 0}function ci(t,o,e){return this.constructor(t,e)}function x(t,o,e){var n,i,r,s;W.__&&W.__(t,o),i=(n=typeof e=="function")?null:e&&e.__k||o.__k,r=[],s=[],eo(o,t=(!n&&e||o).__k=ri(ae,null,[t]),i||Ve,Ve,o.namespaceURI,!n&&e?[e]:i?null:o.firstChild?xt.call(o.childNodes):null,r,!n&&e?e:i?i.__e:o.firstChild,n,s),Ko(r,t,s)}xt=qo.slice,W={__e:function(t,o,e,n){for(var i,r,s;o=o.__;)if((i=o.__c)&&!i.__)try{if((r=i.constructor)&&r.getDerivedStateFromError!=null&&(i.setState(r.getDerivedStateFromError(t)),s=i.__d),i.componentDidCatch!=null&&(i.componentDidCatch(t,n||{}),s=i.__d),s)return i.__E=i}catch(a){t=a}throw t}},Go=0,oi=function(t){return t!=null&&t.constructor==null},bt.prototype.setState=function(t,o){var e;e=this.__s!=null&&this.__s!==this.state?this.__s:this.__s=se({},this.state),typeof t=="function"&&(t=t(se({},e),this.props)),t&&se(e,t),t!=null&&this.__v&&(o&&this._sb.push(o),Bo(this))},bt.prototype.forceUpdate=function(t){this.__v&&(this.__e=!0,t&&this.__h.push(t),Bo(this))},bt.prototype.render=ae,me=[],Uo=typeof Promise=="function"?Promise.prototype.then.bind(Promise.resolve()):setTimeout,Jt=function(t,o){return t.__v.__b-o.__v.__b},yt.__r=0,Zt=0,Yt=zo(!1),jt=zo(!0),ni=0;var di=0,or=Array.isArray;function p(t,o,e,n,i,r){o||(o={});var s,a,c=o;if("ref"in c)for(a in c={},o)a=="ref"?s=o[a]:c[a]=o[a];var d={type:t,props:c,key:e,ref:s,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,constructor:void 0,__v:--di,__i:-1,__u:0,__source:i,__self:r};if(typeof t=="function"&&(s=t.defaultProps))for(a in s)c[a]===void 0&&(c[a]=s[a]);return W.vnode&&W.vnode(d),d}var Pt=t=>{let{children:o,orientation:e="horizontal"}=t;return p("div",{className:`deck-widget-button-group ${e}`,children:o})};var Ce,A,oo,Zo,De=0,an=[],V=W,Qo=V.__b,en=V.__r,tn=V.diffed,on=V.__c,nn=V.unmount,rn=V.__;function Tt(t,o){V.__h&&V.__h(A,t,De||o),De=0;var e=A.__H||(A.__H={__:[],__h:[]});return t>=e.__.length&&e.__.push({}),e.__[t]}function le(t){return De=1,pi(ln,t)}function pi(t,o,e){var n=Tt(Ce++,2);if(n.t=t,!n.__c&&(n.__=[e?e(o):ln(void 0,o),function(a){var c=n.__N?n.__N[0]:n.__[0],d=n.t(c,a);c!==d&&(n.__N=[d,n.__[1]],n.__c.setState({}))}],n.__c=A,!A.u)){var i=function(a,c,d){if(!n.__c.__H)return!0;var m=n.__c.__H.__.filter(function(g){return!!g.__c});if(m.every(function(g){return!g.__N}))return!r||r.call(this,a,c,d);var l=!1;return m.forEach(function(g){if(g.__N){var u=g.__[0];g.__=g.__N,g.__N=void 0,u!==g.__[0]&&(l=!0)}}),!(!l&&n.__c.props===a)&&(!r||r.call(this,a,c,d))};A.u=!0;var r=A.shouldComponentUpdate,s=A.componentWillUpdate;A.componentWillUpdate=function(a,c,d){if(this.__e){var m=r;r=void 0,i(a,c,d),r=m}s&&s.call(this,a,c,d)},A.shouldComponentUpdate=i}return n.__N||n.__}function G(t,o){var e=Tt(Ce++,3);!V.__s&&ro(e.__H,o)&&(e.__=t,e.i=o,A.__H.__h.push(e))}function io(t,o){var e=Tt(Ce++,4);!V.__s&&ro(e.__H,o)&&(e.__=t,e.i=o,A.__h.push(e))}function N(t){return De=5,ee(function(){return{current:t}},[])}function ee(t,o){var e=Tt(Ce++,7);return ro(e.__H,o)&&(e.__=t(),e.__H=o,e.__h=t),e.__}function te(t,o){return De=8,ee(function(){return t},o)}function ui(){for(var t;t=an.shift();)if(t.__P&&t.__H)try{t.__H.__h.forEach(kt),t.__H.__h.forEach(no),t.__H.__h=[]}catch(o){t.__H.__h=[],V.__e(o,t.__v)}}V.__b=function(t){A=null,Qo&&Qo(t)},V.__=function(t,o){t&&o.__k&&o.__k.__m&&(t.__m=o.__k.__m),rn&&rn(t,o)},V.__r=function(t){en&&en(t),Ce=0;var o=(A=t.__c).__H;o&&(oo===A?(o.__h=[],A.__h=[],o.__.forEach(function(e){e.__N&&(e.__=e.__N),e.i=e.__N=void 0})):(o.__h.forEach(kt),o.__h.forEach(no),o.__h=[],Ce=0)),oo=A},V.diffed=function(t){tn&&tn(t);var o=t.__c;o&&o.__H&&(o.__H.__h.length&&(an.push(o)!==1&&Zo===V.requestAnimationFrame||((Zo=V.requestAnimationFrame)||mi)(ui)),o.__H.__.forEach(function(e){e.i&&(e.__H=e.i),e.i=void 0})),oo=A=null},V.__c=function(t,o){o.some(function(e){try{e.__h.forEach(kt),e.__h=e.__h.filter(function(n){return!n.__||no(n)})}catch(n){o.some(function(i){i.__h&&(i.__h=[])}),o=[],V.__e(n,e.__v)}}),on&&on(t,o)},V.unmount=function(t){nn&&nn(t);var o,e=t.__c;e&&e.__H&&(e.__H.__.forEach(function(n){try{kt(n)}catch(i){o=i}}),e.__H=void 0,o&&V.__e(o,e.__v))};var sn=typeof requestAnimationFrame=="function";function mi(t){var o,e=function(){clearTimeout(n),sn&&cancelAnimationFrame(o),setTimeout(t)},n=setTimeout(e,100);sn&&(o=requestAnimationFrame(e))}function kt(t){var o=A,e=t.__c;typeof e=="function"&&(t.__c=void 0,e()),A=o}function no(t){var o=A;t.__c=t.__(),A=o}function ro(t,o){return!t||t.length!==o.length||o.some(function(e,n){return e!==t[n]})}function ln(t,o){return typeof o=="function"?o(t):o}function St(t){if(!t)return;let o=`url("${t.replace(/"/g,"'")}")`;return{maskImage:o,WebkitMaskImage:o}}var M=t=>{let{className:o="",style:e,color:n,icon:i,label:r,onClick:s,children:a}=t,c=ee(()=>{let d=St(i);return n?{...d,backgroundColor:n}:d},[n,i]);return p("div",{className:"deck-widget-button",style:e,children:p("button",{className:`deck-widget-icon-button ${o}`,type:"button",onClick:s,title:r,children:a||p("div",{className:"deck-widget-icon",style:c})})})};var He=class extends ge.Widget{constructor(e={}){super(e);this.className="deck-widget-zoom";this.placement="top-left";this.setProps(this.props)}setProps(e){this.placement=e.placement??this.placement,this.viewId=e.viewId??this.viewId,super.setProps(e)}onRenderHTML(e){let n=p(Pt,{orientation:this.props.orientation,children:[p(M,{onClick:()=>this.handleZoomIn(),label:this.props.zoomInLabel,className:"deck-widget-zoom-in"}),p(M,{onClick:()=>this.handleZoomOut(),label:this.props.zoomOutLabel,className:"deck-widget-zoom-out"})]});x(n,e)}handleZoom(e,n){let i=this.getViewState(e);if(i){let{minZoom:s,maxZoom:a}=i;Number.isFinite(s)&&(n=Math.max(s,n)),Number.isFinite(a)&&(n=Math.min(a,n))}let r={...i,zoom:n};this.props.transitionDuration>0&&(r.transitionDuration=this.props.transitionDuration,r.transitionInterpolator="latitude"in r?new ge.FlyToInterpolator:new ge.LinearInterpolator({transitionProps:["zoom"]})),this.setViewState(e,r)}handleZoomIn(){let e=this.viewId?[this.viewId]:this.deck?.getViews().map(n=>n.id)??[];for(let n of e){let i=this.getViewState(n);this.handleZoom(n,i.zoom+1)}}handleZoomOut(){let e=this.viewId?[this.viewId]:this.deck?.getViews().map(n=>n.id)??[];for(let n of e){let i=this.getViewState(n);this.handleZoom(n,i.zoom-1)}}};He.defaultProps={...ge.Widget.defaultProps,id:"zoom",placement:"top-left",orientation:"vertical",transitionDuration:200,zoomInLabel:"Zoom In",zoomOutLabel:"Zoom Out",viewId:null};var so=E(R(),1);var Ne=class extends so.Widget{constructor(e={}){super(e);this.className="deck-widget-reset-view";this.placement="top-left";this.setProps(this.props)}setProps(e){this.placement=e.placement??this.placement,this.viewId=e.viewId??this.viewId,super.setProps(e)}onRenderHTML(e){x(p(M,{className:"deck-widget-reset-focus",label:this.props.label,onClick:this.handleClick.bind(this)}),e)}handleClick(){let e=this.props.initialViewState||this.deck?.props.initialViewState;this.resetViewState(e)}resetViewState(e){let n=this.viewId?[this.viewId]:this.deck?.getViews().map(i=>i.id)??[];for(let i of n){let r={...e?.[i]??e};this.setViewState(i,r)}}};Ne.defaultProps={...so.Widget.defaultProps,id:"reset-view",placement:"top-left",label:"Reset View",initialViewState:void 0,viewId:null};var Be=E(R(),1);var $e=class extends Be.Widget{constructor(e={}){super(e);this.className="deck-widget-gimbal";this.placement="top-left";this.viewports={};this.setProps(this.props)}setProps(e){this.placement=e.placement??this.placement,this.viewId=e.viewId??this.viewId,super.setProps(e)}onRenderHTML(e){let n=this.viewId||Object.values(this.viewports)[0]?.id||"default-view",i=this.viewports[n],{rotationOrbit:r,rotationX:s}=this.getNormalizedRotation(i),a=p("div",{className:"deck-widget-button",style:{perspective:100,pointerEvents:"auto"},children:p("button",{type:"button",onClick:()=>{for(let c of Object.values(this.viewports))this.resetOrbitView(c)},title:this.props.label,style:{position:"relative",width:26,height:26},children:[p("svg",{className:"gimbal-outer-ring",width:"100%",height:"100%",viewBox:"0 0 26 26",style:{position:"absolute",top:0,left:0,transform:`rotateY(${r}deg)`},children:p("circle",{cx:"13",cy:"13",r:"10",stroke:"var(--icon-gimbal-outer-color, rgb(68, 92, 204))",strokeWidth:this.props.strokeWidth,fill:"none"})}),p("svg",{className:"gimbal-inner-ring",width:"100%",height:"100%",viewBox:"0 0 26 26",style:{position:"absolute",top:0,left:0,transform:`rotateX(${s}deg)`},children:p("circle",{cx:"13",cy:"13",r:"7",stroke:"var(--icon-gimbal-inner-color, rgb(240, 92, 68))",strokeWidth:this.props.strokeWidth,fill:"none"})})]})});x(a,e)}onViewportChange(e){this.viewports[e.id]=e,this.updateHTML()}resetOrbitView(e){let n=this.viewId||e?.id||"OrbitView",i=this.getViewState(n);if("rotationOrbit"in i||"rotationX"in i){let r={...i,rotationOrbit:0,rotationX:0,transitionDuration:this.props.transitionDuration,transitionInterpolator:new Be.LinearInterpolator({transitionProps:["rotationOrbit","rotationX"]})};this.setViewState(n,r)}}getNormalizedRotation(e){let n=this.viewId||e?.id||"OrbitView",i=this.getViewState(n),[r,s]=this.getRotation(i),a=cn(r),c=cn(s);return{rotationOrbit:a,rotationX:c}}getRotation(e){return e&&("rotationOrbit"in e||"rotationX"in e)?[-(e.rotationOrbit||0),e.rotationX||0]:[0,0]}};$e.defaultProps={...Be.Widget.defaultProps,id:"gimbal",placement:"top-left",viewId:null,label:"Gimbal",strokeWidth:1.5,transitionDuration:200};function cn(t){let o=((t+180)%360+360)%360-180,e=10,n=o-90;return Math.abs(n)<e&&(n<e?o=90+e:n>-e&&(o=90-e)),o}var Z=E(R(),1);var Fe=class extends Z.Widget{constructor(e={}){super(e);this.className="deck-widget-compass";this.placement="top-left";this.viewports={};this.setProps(this.props)}setProps(e){this.placement=e.placement??this.placement,this.viewId=e.viewId??this.viewId,super.setProps(e)}onRenderHTML(e){let n=this.viewId||Object.values(this.viewports)[0]?.id,i=this.viewports[n],[r,s]=this.getRotation(i),a=p("div",{className:"deck-widget-button",style:{perspective:100},children:p("button",{type:"button",onClick:()=>{for(let c of Object.values(this.viewports))this.handleCompassReset(c)},title:this.props.label,style:{transform:`rotateX(${s}deg)`},children:p("svg",{fill:"none",width:"100%",height:"100%",viewBox:"0 0 26 26",children:p("g",{transform:`rotate(${r},13,13)`,children:[p("path",{d:"M10 13.0001L12.9999 5L15.9997 13.0001H10Z",fill:"var(--icon-compass-north-color, rgb(240, 92, 68))"}),p("path",{d:"M16.0002 12.9999L13.0004 21L10.0005 12.9999H16.0002Z",fill:"var(--icon-compass-south-color, rgb(204, 204, 204))"})]})})})});x(a,e)}onViewportChange(e){e.equals(this.viewports[e.id])||(this.viewports[e.id]=e,this.updateHTML())}getRotation(e){return e instanceof Z.WebMercatorViewport?[-e.bearing,e.pitch]:e instanceof Z._GlobeViewport?[0,Math.max(-80,Math.min(80,e.latitude))]:[0,0]}handleCompassReset(e){let n=this.viewId||e.id;if(e instanceof Z.WebMercatorViewport){let r={...this.getViewState(n),bearing:0,...this.getRotation(e)[0]===0?{pitch:0}:{},transitionDuration:this.props.transitionDuration,transitionInterpolator:new Z.FlyToInterpolator};this.setViewState(n,r)}}};Fe.defaultProps={...Z.Widget.defaultProps,id:"compass",placement:"top-left",viewId:null,label:"Reset Compass",transitionDuration:200};var ao=E(R(),1);var ze=class extends ao.Widget{constructor(e={}){super(e);this.className="deck-widget-scale";this.placement="bottom-left";this.scaleWidth=10;this.scaleValue=0;this.scaleText="";this.setProps(this.props)}setProps(e){this.placement=e.placement??this.placement,this.viewId=e.viewId??this.viewId,super.setProps(e)}onRenderHTML(e){let i=50+this.scaleWidth,r=10;x(p("svg",{className:"deck-widget-scale",width:i,height:30,style:{overflow:"visible",background:"transparent"},onClick:this.handleClick.bind(this),children:[p("text",{x:50+5,y:"10",textAnchor:"end",alignmentBaseline:"middle",style:{fontSize:"16px",fill:"black",fontWeight:"bold",fontFamily:"sans-serif"},children:this.scaleText}),p("line",{x1:50,y1:"15",x2:50+this.scaleWidth,y2:"15",stroke:"black",strokeWidth:"6"}),p("line",{x1:50,y1:"15",x2:50,y2:15-r,stroke:"black",strokeWidth:"6"}),p("line",{x1:50+this.scaleWidth,y1:"15",x2:50+this.scaleWidth,y2:15-r,stroke:"black",strokeWidth:"6"})]}),e)}onViewportChange(e){if(!("latitude"in e))return;let{latitude:n,zoom:i}=e,r=fi(n,i),{candidate:s,candidatePixels:a}=gi(r);this.scaleValue=s,this.scaleWidth=a,s>=1e3?this.scaleText=`${(s/1e3).toFixed(1)} km`:this.scaleText=`${s} m`,this.updateHTML()}handleClick(){}};ze.defaultProps={...ao.Widget.defaultProps,id:"scale",placement:"bottom-left",label:"Scale",viewId:null};function fi(t,o){return 40075016686e-3*Math.cos(t*Math.PI/180)/Math.pow(2,o+8)}function gi(t){let i=150*t,r=Math.floor(Math.log10(i)),s=Math.pow(10,r),a=[1,2,5],c=a[0]*s,d=c/t;for(let m=0;m<a.length;m++){let l=a[m]*s,g=l/t;if(g>=100&&g<=200){c=l,d=g;break}if(g>200){c=m>0?a[m-1]*s:l,d=c/t;break}m===a.length-1&&g<100&&(c=a[0]*s*10,d=c/t)}return{candidate:c,candidatePixels:d}}var co=E(R(),1),Rt=E(R(),1);function hi(t){return typeof t=="string"?t:t.value}function vi(t){return typeof t=="string"?t:t.label}function wi(t){return typeof t=="string"?void 0:t.icon}var Ct=t=>{let[o,e]=le(!1);return p(he,{...t,style:{...t.style,position:"absolute"},isOpen:o,onClose:()=>e(!1),trigger:p("button",{className:"deck-widget-dropdown-button",onClick:()=>e(!o),children:p("span",{className:`deck-widget-dropdown-icon ${o?"open":""}`})})})},he=t=>{let o=N(null);G(()=>{let n=i=>{o.current&&!o.current.contains(i.target)&&t.onClose()};return document.addEventListener("mousedown",n),()=>{document.removeEventListener("mousedown",n)}},[]);let e=(n,i)=>{n&&(typeof i=="object"&&i.onSelect?.(),t.onSelect?.(n),t.onClose())};return t.menuItems.length===0?null:p("div",{className:"deck-widget-dropdown-container",ref:o,children:[t.trigger,t.isOpen&&p("ul",{className:"deck-widget-dropdown-menu",style:t.style,children:t.menuItems.map((n,i)=>{let r=hi(n),s=wi(n);return p("li",{className:`deck-widget-dropdown-item ${r?"":"disabled"}`,onClick:()=>e(r,n),children:[s&&p("span",{className:"deck-widget-dropdown-item-icon",style:St(s)}),vi(n)]},i)})})]})};var _i="current",dn="deck-geocoder-history",Mt=class{constructor(o){this.addressText="";this.errorText="";this.addressHistory=[];this.props={maxEntries:5,...o},this.addressHistory=this.loadPreviousAddresses()}async geocode(o,e,n){this.errorText="",this.addressText=e;try{let i=await o.geocode(e,n);if(i)return this.storeAddress(this.addressText),i;this.errorText="Invalid address"}catch(i){this.errorText=`${i.message}`}return null}loadPreviousAddresses(){try{let o=window.localStorage.getItem(dn),e=o&&JSON.parse(o);return Array.isArray(e)?e.filter(i=>typeof i=="string"):[]}catch{}return[]}storeAddress(o){let e=o.trim();if(!e||e===_i)return;let n=[e,...this.addressHistory.filter(i=>i!==e)];this.addressHistory=n.slice(0,this.props.maxEntries);try{window.localStorage.setItem(dn,JSON.stringify(this.addressHistory))}catch{}}};var bi="https://maps.googleapis.com/maps/api/geocode/json",yi="https://api.mapbox.com/geocoding/v5/mapbox.places",xi="https://api.opencagedata.com/geocode/v1/json",Lt={name:"google",requiresApiKey:!0,async geocode(t,o){let e=encodeURIComponent(t),n=await lo(`${bi}?address=${e}&key=${o}`);switch(n.status){case"OK":let i=n.results.length>0&&n.results[0].geometry.location;return i?{longitude:i.lng,latitude:i.lat}:null;default:throw new Error(`Google Geocoder failed: ${n.status}`)}}},It={name:"google",requiresApiKey:!0,async geocode(t,o){let e=encodeURIComponent(t),n=await lo(`${yi}/${e}.json?access_token=${o}`);if(Array.isArray(n.features)&&n.features.length>0){let i=n.features[0].center;if(Array.isArray(i)&&i.length>=2)return{longitude:i[0],latitude:i[1]}}return null}},Wt={name:"opencage",requiresApiKey:!0,async geocode(t,o){let e=encodeURIComponent(t),n=await lo(`${xi}?q=${e}&key=${o}`);if(Array.isArray(n.results)&&n.results.length>0){let i=n.results[0].geometry;return{longitude:i.lng,latitude:i.lat}}return null}},Et={name:"current",requiresApiKey:!1,async geocode(){if(!navigator.geolocation)throw new Error("Geolocation not supported");return new Promise((t,o)=>{navigator.geolocation.getCurrentPosition(e=>{let{longitude:n,latitude:i}=e.coords;t({longitude:n,latitude:i})},e=>o(new Error(e.message)))})}};async function lo(t){let o;try{o=await fetch(t)}catch(n){throw new Error(`CORS error? ${n}. ${t}: `)}if(!o.ok)throw new Error(`${o.statusText}. ${t}: `);let e=await o.json();if(!e)throw new Error(`No data returned. ${t}`);return e}var Me={name:"coordinates",requiresApiKey:!1,placeholderLocation:"-122.45, 37.8 or 37\xB048'N, 122\xB027'W",async geocode(t){return Pi(t)||null}};function Pi(t){t=t.trim();let o=t.split(/[,;]/).map(i=>i.trim());if(o.length<2)return null;let e=pn(o[0]),n=pn(o[1]);return e===null||n===null?null:Math.abs(e)>90&&Math.abs(n)<=90?{longitude:e,latitude:n}:Math.abs(n)>90&&Math.abs(e)<=90?{longitude:n,latitude:e}:{latitude:e,longitude:n}}function pn(t){if(t=t.trim(),t.includes("\xB0")||t.includes("'")||t.includes('"')){let n=ki(t);return isNaN(n)?null:n}let o=1;/[SW]/i.test(t)&&(o=-1),t=t.replace(/[NSEW]/gi,"");let e=parseFloat(t);return isNaN(e)?null:o*e}function ki(t){let o=/(\d+)[°d]\s*(\d+)?['′m]?\s*(\d+(?:\.\d+)?)?[\"″s]?\s*([NSEW])?/i,e=t.match(o);if(!e)return NaN;let n=parseFloat(e[1])||0,i=parseFloat(e[2])||0,r=parseFloat(e[3])||0,s=e[4]||"",a=n+i/60+r/3600;return/[SW]/i.test(s)&&(a=-a),a}var un="current",Ti="data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 -960 960 960'%3E%3Cpath d='M480-480q33 0 56.5-23.5T560-560q0-33-23.5-56.5T480-640q-33 0-56.5 23.5T400-560q0 33 23.5 56.5T480-480Zm0 294q122-112 181-203.5T720-552q0-109-69.5-178.5T480-800q-101 0-170.5 69.5T240-552q0 71 59 162.5T480-186Zm0 106Q319-217 239.5-334.5T160-552q0-150 96.5-239T480-880q127 0 223.5 89T800-552q0 100-79.5 217.5T480-80Z'/%3E%3C/svg%3E",Si={label:"Current location",value:un,icon:Ti},Ge=class extends co.Widget{constructor(e={}){super(e);this.className="deck-widget-geocoder";this.placement="top-left";this.geocodeHistory=new Mt({});this.addressText="";this.geocoder=Me;this.isGettingLocation=!1;this.setInput=e=>{this.addressText=e};this.handleKeyPress=e=>{e.key==="Enter"&&this.handleSubmit()};this.handleSelect=e=>{e===un?this.getCurrentLocation():(this.setInput(e),this.handleSubmit())};this.handleSubmit=()=>{this.geocode(this.addressText)};this.getCurrentLocation=async()=>{this.isGettingLocation=!0,this.rootElement&&this.updateHTML();try{let e=await Et.geocode();e&&this.flyTo(e)}catch(e){this.geocodeHistory.errorText=e instanceof Error?e.message:"Location error"}finally{this.isGettingLocation=!1,this.rootElement&&this.updateHTML()}};this.geocode=async e=>{let n=await this.geocodeHistory.geocode(this.geocoder,this.addressText,this.props.apiKey);this.rootElement&&this.updateHTML(),n&&this.flyTo(n)};this.setProps(this.props)}setProps(e){if(this.placement=e.placement??this.placement,this.viewId=e.viewId??this.viewId,this.geocoder=Ci(this.props),this.geocoder.requiresApiKey&&!this.props.apiKey)throw new Error(`API key is required for the ${this.geocoder.name} geocoder`);super.setProps(e)}onRenderHTML(e){let n=this.props._geolocation?[Si,...this.geocodeHistory.addressHistory]:[...this.geocodeHistory.addressHistory];x(p("div",{className:"deck-widget-geocoder",children:[p("input",{className:"deck-widget-geocoder-input",type:"text",placeholder:this.isGettingLocation?"Finding your location...":this.geocoder.placeholderLocation??"Enter address or location",value:this.geocodeHistory.addressText,onInput:i=>this.setInput(i.target?.value||""),onKeyPress:this.handleKeyPress}),p(Ct,{menuItems:n,onSelect:this.handleSelect}),this.geocodeHistory.errorText&&p("div",{className:"deck-widget-geocoder-error",children:this.geocodeHistory.errorText})]}),e)}flyTo(e){let n=this.viewId?[this.viewId]:this.deck?.getViews().map(i=>i.id)??[];for(let i of n){let s={...this.getViewState(i),...e};this.props.transitionDuration>0&&(s.transitionDuration=this.props.transitionDuration,s.transitionInterpolator="latitude"in s?new Rt.FlyToInterpolator:new Rt.LinearInterpolator),this.setViewState(i,s)}}};Ge.defaultProps={...co.Widget.defaultProps,id:"geocoder",viewId:null,placement:"top-left",label:"Geocoder",transitionDuration:200,geocoder:"coordinates",customGeocoder:Me,apiKey:"",_geolocation:!1};function Ci(t){switch(t.geocoder){case"google":return Lt;case"mapbox":return It;case"opencage":return Wt;case"coordinates":return Me;case"custom":if(!t.customGeocoder)throw new Error("Custom geocoder is not defined");return t.customGeocoder;default:throw new Error(`Unknown geocoder: ${t.geocoder}`)}}var qe=E(R(),1);var Ue=class extends qe.Widget{constructor(e={}){super(e);this.className="deck-widget-fullscreen";this.placement="top-left";this.fullscreen=!1;this.setProps(this.props)}onAdd(){document.addEventListener("fullscreenchange",this.onFullscreenChange.bind(this))}onRemove(){document.removeEventListener("fullscreenchange",this.onFullscreenChange.bind(this))}onRenderHTML(e){x(p(M,{onClick:()=>{this.handleClick().catch(n=>qe.log.error(n)())},label:this.fullscreen?this.props.exitLabel:this.props.enterLabel,className:this.fullscreen?"deck-widget-fullscreen-exit":"deck-widget-fullscreen-enter"}),e)}setProps(e){this.placement=e.placement??this.placement,this.viewId=e.viewId??this.viewId,super.setProps(e)}getContainer(){return this.props.container||this.deck?.props.parent||this.deck?.getCanvas()?.parentElement}onFullscreenChange(){let e=this.fullscreen,n=document.fullscreenElement===this.getContainer();e!==n&&(this.fullscreen=!this.fullscreen),this.updateHTML()}async handleClick(){this.fullscreen?await this.exitFullscreen():await this.requestFullscreen(),this.updateHTML()}async requestFullscreen(){let e=this.getContainer();e?.requestFullscreen?await e.requestFullscreen({navigationUI:"hide"}):this.togglePseudoFullscreen()}async exitFullscreen(){document.exitFullscreen?await document.exitFullscreen():this.togglePseudoFullscreen()}togglePseudoFullscreen(){this.getContainer()?.classList.toggle("deck-pseudo-fullscreen")}};Ue.defaultProps={...qe.Widget.defaultProps,id:"fullscreen",placement:"top-left",viewId:null,enterLabel:"Enter Fullscreen",exitLabel:"Exit Fullscreen",container:void 0};var Je=E(R(),1);function mn(t){let o=[],e=i=>"views"in i;function n(i){let r=o.length,s=i.minSplit??.05,a=i.maxSplit??.95,c=Math.min(Math.max(i.initialSplit??.5,s),a),d={id:r,orientation:i.orientation,views:i.views,split:c,editable:i.editable??!0,minSplit:s,maxSplit:a,x:0,y:0,width:0,height:0};return o.push(d),d.views=[e(i.views[0])?n(i.views[0]):i.views[0],e(i.views[1])?n(i.views[1]):i.views[1]],d}return n(t),o}function fn(t){let o=[];function e(n,i,r,s,a){n.x=i,n.y=r,n.width=s,n.height=a;let c=i,d=r,m=s,l=a,g=i,u=r,f=s,_=a;n.orientation==="horizontal"?(m=s*n.split,g=i+m,f=s-m):(l=a*n.split,u=r+l,_=a-l);let[w,h]=n.views;"views"in w?e(w,c,d,m,l):o.push(w.clone({x:`${c}%`,y:`${d}%`,width:`${m}%`,height:`${l}%`})),"views"in h?e(h,g,u,f,_):o.push(h.clone({x:`${g}%`,y:`${u}%`,width:`${f}%`,height:`${_}%`}))}return e(t,0,0,100,100),o}var Xe=class extends Je.Widget{constructor(e){super(e);this.className="deck-widget-splitter";this.placement="fill";this.needsUpdate=!0;this.viewLayouts=mn(this.props.viewLayout)}setProps(e){e.viewLayout&&!(0,Je._deepEqual)(e.viewLayout,this.props.viewLayout,-1)&&(this.viewLayouts=mn(e.viewLayout),this.views=void 0),super.setProps(e)}onRedraw(){super.updateHTML()}updateHTML(){this.views||(this.views=fn(this.viewLayouts[0]),this.props.onChange(this.views.slice())),requestAnimationFrame(()=>{this.doUpdate()})}doUpdate(){if(this.deck){let e=this.deck.props.views;!(e&&e!==this.lastViews)&&this.lastViews!==this.views&&(this.lastViews=this.views,this.deck.setProps({views:this.views}))}}onChange(e,n){n.split=e,this.views=fn(this.viewLayouts[0]),this.props.onChange(this.views.slice()),this.doUpdate()}onRenderHTML(e){x(p(ae,{children:this.viewLayouts.map(n=>n.editable&&p(Mi,{...n,onChange:i=>this.onChange(i,n),onDragStart:()=>this.props.onDragStart(),onDragEnd:()=>this.props.onDragStart()}))}),e)}};Xe.defaultProps={...Je.Widget.defaultProps,id:"splitter-widget",viewLayout:void 0,onChange:()=>{},onDragStart:()=>{},onDragEnd:()=>{}};function Mi({orientation:t,x:o,y:e,width:n,height:i,split:r,minSplit:s,maxSplit:a,onChange:c,onDragStart:d,onDragEnd:m}){let[l,g]=le(!1),u=N(null);G(()=>{if(!l)return;let h=P=>{if(!u.current)return;let k=u.current.getBoundingClientRect(),y;t==="horizontal"?y=(P.clientX-k.left)/k.width:y=(P.clientY-k.top)/k.height,y=Math.min(Math.max(y,s),a),c?.(y)},b=()=>{m?.(),g(!1)};return document.addEventListener("pointermove",h),document.addEventListener("pointerup",b),document.addEventListener("pointerleave",b),()=>{document.removeEventListener("pointermove",h),document.removeEventListener("pointerup",b),document.removeEventListener("pointerleave",b)}},[l]);let f=h=>{g(!0),d?.(),h.preventDefault()},_=t==="horizontal"?{left:`${r*100}%`}:{top:`${r*100}%`},w={position:"absolute",top:`${e}%`,left:`${o}%`,width:`${n}%`,height:`${i}%`};return p("div",{ref:u,style:w,children:p("div",{className:`deck-widget-splitter-handle deck-widget-splitter-handle--${t} ${l?"active":""}`,style:_,onPointerDown:f})})}var bo=E(R(),1);var At=Math.min,gn=Math.max;var Li={left:"right",right:"left",bottom:"top",top:"bottom"},Ii={start:"end",end:"start"};function Vt(t,o,e){return gn(t,At(o,e))}function Le(t,o){return typeof t=="function"?t(o):t}function ce(t){return t.split("-")[0]}function Ie(t){return t.split("-")[1]}function po(t){return t==="x"?"y":"x"}function Dt(t){return t==="y"?"height":"width"}function ve(t){return["top","bottom"].includes(ce(t))?"y":"x"}function Ht(t){return po(ve(t))}function hn(t,o,e){e===void 0&&(e=!1);let n=Ie(t),i=Ht(t),r=Dt(i),s=i==="x"?n===(e?"end":"start")?"right":"left":n==="start"?"bottom":"top";return o.reference[r]>o.floating[r]&&(s=Ye(s)),[s,Ye(s)]}function vn(t){let o=Ye(t);return[Ot(t),o,Ot(o)]}function Ot(t){return t.replace(/start|end/g,o=>Ii[o])}function Wi(t,o,e){let n=["left","right"],i=["right","left"],r=["top","bottom"],s=["bottom","top"];switch(t){case"top":case"bottom":return e?o?i:n:o?n:i;case"left":case"right":return o?r:s;default:return[]}}function wn(t,o,e,n){let i=Ie(t),r=Wi(ce(t),e==="start",n);return i&&(r=r.map(s=>s+"-"+i),o&&(r=r.concat(r.map(Ot)))),r}function Ye(t){return t.replace(/left|right|bottom|top/g,o=>Li[o])}function Ei(t){return{top:0,right:0,bottom:0,left:0,...t}}function uo(t){return typeof t!="number"?Ei(t):{top:t,right:t,bottom:t,left:t}}function we(t){let{x:o,y:e,width:n,height:i}=t;return{width:n,height:i,top:e,left:o,right:o+n,bottom:e+i,x:o,y:e}}function _n(t,o,e){let{reference:n,floating:i}=t,r=ve(o),s=Ht(o),a=Dt(s),c=ce(o),d=r==="y",m=n.x+n.width/2-i.width/2,l=n.y+n.height/2-i.height/2,g=n[a]/2-i[a]/2,u;switch(c){case"top":u={x:m,y:n.y-i.height};break;case"bottom":u={x:m,y:n.y+n.height};break;case"right":u={x:n.x+n.width,y:l};break;case"left":u={x:n.x-i.width,y:l};break;default:u={x:n.x,y:n.y}}switch(Ie(o)){case"start":u[s]-=g*(e&&d?-1:1);break;case"end":u[s]+=g*(e&&d?-1:1);break}return u}var bn=async(t,o,e)=>{let{placement:n="bottom",strategy:i="absolute",middleware:r=[],platform:s}=e,a=r.filter(Boolean),c=await(s.isRTL==null?void 0:s.isRTL(o)),d=await s.getElementRects({reference:t,floating:o,strategy:i}),{x:m,y:l}=_n(d,n,c),g=n,u={},f=0;for(let _=0;_<a.length;_++){let{name:w,fn:h}=a[_],{x:b,y:P,data:k,reset:y}=await h({x:m,y:l,initialPlacement:n,placement:g,strategy:i,middlewareData:u,rects:d,platform:s,elements:{reference:t,floating:o}});m=b??m,l=P??l,u={...u,[w]:{...u[w],...k}},y&&f<=50&&(f++,typeof y=="object"&&(y.placement&&(g=y.placement),y.rects&&(d=y.rects===!0?await s.getElementRects({reference:t,floating:o,strategy:i}):y.rects),{x:m,y:l}=_n(d,g,c)),_=-1)}return{x:m,y:l,placement:g,strategy:i,middlewareData:u}};async function mo(t,o){var e;o===void 0&&(o={});let{x:n,y:i,platform:r,rects:s,elements:a,strategy:c}=t,{boundary:d="clippingAncestors",rootBoundary:m="viewport",elementContext:l="floating",altBoundary:g=!1,padding:u=0}=Le(o,t),f=uo(u),w=a[g?l==="floating"?"reference":"floating":l],h=we(await r.getClippingRect({element:(e=await(r.isElement==null?void 0:r.isElement(w)))==null||e?w:w.contextElement||await(r.getDocumentElement==null?void 0:r.getDocumentElement(a.floating)),boundary:d,rootBoundary:m,strategy:c})),b=l==="floating"?{x:n,y:i,width:s.floating.width,height:s.floating.height}:s.reference,P=await(r.getOffsetParent==null?void 0:r.getOffsetParent(a.floating)),k=await(r.isElement==null?void 0:r.isElement(P))?await(r.getScale==null?void 0:r.getScale(P))||{x:1,y:1}:{x:1,y:1},y=we(r.convertOffsetParentRelativeRectToViewportRelativeRect?await r.convertOffsetParentRelativeRectToViewportRelativeRect({elements:a,rect:b,offsetParent:P,strategy:c}):b);return{top:(h.top-y.top+f.top)/k.y,bottom:(y.bottom-h.bottom+f.bottom)/k.y,left:(h.left-y.left+f.left)/k.x,right:(y.right-h.right+f.right)/k.x}}var yn=t=>({name:"arrow",options:t,async fn(o){let{x:e,y:n,placement:i,rects:r,platform:s,elements:a,middlewareData:c}=o,{element:d,padding:m=0}=Le(t,o)||{};if(d==null)return{};let l=uo(m),g={x:e,y:n},u=Ht(i),f=Dt(u),_=await s.getDimensions(d),w=u==="y",h=w?"top":"left",b=w?"bottom":"right",P=w?"clientHeight":"clientWidth",k=r.reference[f]+r.reference[u]-g[u]-r.floating[f],y=g[u]-r.reference[u],S=await(s.getOffsetParent==null?void 0:s.getOffsetParent(d)),L=S?S[P]:0;(!L||!await(s.isElement==null?void 0:s.isElement(S)))&&(L=a.floating[P]||r.floating[f]);let I=k/2-y/2,D=L/2-_[f]/2-1,O=At(l[h],D),C=At(l[b],D),Q=O,ue=L-_[f]-C,H=L/2-_[f]/2+I,ie=Vt(Q,H,ue),X=!c.arrow&&Ie(i)!=null&&H!==ie&&r.reference[f]/2-(H<Q?O:C)-_[f]/2<0,B=X?H<Q?H-Q:H-ue:0;return{[u]:g[u]+B,data:{[u]:ie,centerOffset:H-ie-B,...X&&{alignmentOffset:B}},reset:X}}});var xn=function(t){return t===void 0&&(t={}),{name:"flip",options:t,async fn(o){var e,n;let{placement:i,middlewareData:r,rects:s,initialPlacement:a,platform:c,elements:d}=o,{mainAxis:m=!0,crossAxis:l=!0,fallbackPlacements:g,fallbackStrategy:u="bestFit",fallbackAxisSideDirection:f="none",flipAlignment:_=!0,...w}=Le(t,o);if((e=r.arrow)!=null&&e.alignmentOffset)return{};let h=ce(i),b=ve(a),P=ce(a)===a,k=await(c.isRTL==null?void 0:c.isRTL(d.floating)),y=g||(P||!_?[Ye(a)]:vn(a)),S=f!=="none";!g&&S&&y.push(...wn(a,_,f,k));let L=[a,...y],I=await mo(o,w),D=[],O=((n=r.flip)==null?void 0:n.overflows)||[];if(m&&D.push(I[h]),l){let H=hn(i,s,k);D.push(I[H[0]],I[H[1]])}if(O=[...O,{placement:i,overflows:D}],!D.every(H=>H<=0)){var C,Q;let H=(((C=r.flip)==null?void 0:C.index)||0)+1,ie=L[H];if(ie)return{data:{index:H,overflows:O},reset:{placement:ie}};let X=(Q=O.filter(B=>B.overflows[0]<=0).sort((B,F)=>B.overflows[1]-F.overflows[1])[0])==null?void 0:Q.placement;if(!X)switch(u){case"bestFit":{var ue;let B=(ue=O.filter(F=>{if(S){let z=ve(F.placement);return z===b||z==="y"}return!0}).map(F=>[F.placement,F.overflows.filter(z=>z>0).reduce((z,Xt)=>z+Xt,0)]).sort((F,z)=>F[1]-z[1])[0])==null?void 0:ue[0];B&&(X=B);break}case"initialPlacement":X=a;break}if(i!==X)return{reset:{placement:X}}}return{}}}};async function Ri(t,o){let{placement:e,platform:n,elements:i}=t,r=await(n.isRTL==null?void 0:n.isRTL(i.floating)),s=ce(e),a=Ie(e),c=ve(e)==="y",d=["left","top"].includes(s)?-1:1,m=r&&c?-1:1,l=Le(o,t),{mainAxis:g,crossAxis:u,alignmentAxis:f}=typeof l=="number"?{mainAxis:l,crossAxis:0,alignmentAxis:null}:{mainAxis:0,crossAxis:0,alignmentAxis:null,...l};return a&&typeof f=="number"&&(u=a==="end"?f*-1:f),c?{x:u*m,y:g*d}:{x:g*d,y:u*m}}var Pn=function(t){return t===void 0&&(t=0),{name:"offset",options:t,async fn(o){var e,n;let{x:i,y:r,placement:s,middlewareData:a}=o,c=await Ri(o,t);return s===((e=a.offset)==null?void 0:e.placement)&&(n=a.arrow)!=null&&n.alignmentOffset?{}:{x:i+c.x,y:r+c.y,data:{...c,placement:s}}}}},kn=function(t){return t===void 0&&(t={}),{name:"shift",options:t,async fn(o){let{x:e,y:n,placement:i}=o,{mainAxis:r=!0,crossAxis:s=!1,limiter:a={fn:w=>{let{x:h,y:b}=w;return{x:h,y:b}}},...c}=Le(t,o),d={x:e,y:n},m=await mo(o,c),l=ve(ce(i)),g=po(l),u=d[g],f=d[l];if(r){let w=g==="y"?"top":"left",h=g==="y"?"bottom":"right",b=u+m[w],P=u-m[h];u=Vt(b,u,P)}if(s){let w=l==="y"?"top":"left",h=l==="y"?"bottom":"right",b=f+m[w],P=f-m[h];f=Vt(b,f,P)}let _=a.fn({...o,[g]:u,[l]:f});return{..._,data:{x:_.x-e,y:_.y-n}}}}};var Nt=Math.min,_e=Math.max,je=Math.round,Ke=Math.floor,oe=t=>({x:t,y:t});function $t(){return typeof window<"u"}function be(t){return Sn(t)?(t.nodeName||"").toLowerCase():"#document"}function $(t){var o;return(t==null||(o=t.ownerDocument)==null?void 0:o.defaultView)||window}function J(t){var o;return(o=(Sn(t)?t.ownerDocument:t.document)||window.document)==null?void 0:o.documentElement}function Sn(t){return $t()?t instanceof Node||t instanceof $(t).Node:!1}function U(t){return $t()?t instanceof Element||t instanceof $(t).Element:!1}function Y(t){return $t()?t instanceof HTMLElement||t instanceof $(t).HTMLElement:!1}function Tn(t){return!$t()||typeof ShadowRoot>"u"?!1:t instanceof ShadowRoot||t instanceof $(t).ShadowRoot}function Ee(t){let{overflow:o,overflowX:e,overflowY:n,display:i}=q(t);return/auto|scroll|overlay|hidden|clip/.test(o+n+e)&&!["inline","contents"].includes(i)}function Cn(t){return["table","td","th"].includes(be(t))}function Ze(t){return[":popover-open",":modal"].some(o=>{try{return t.matches(o)}catch{return!1}})}function Bt(t){let o=Ft(),e=U(t)?q(t):t;return["transform","translate","scale","rotate","perspective"].some(n=>e[n]?e[n]!=="none":!1)||(e.containerType?e.containerType!=="normal":!1)||!o&&(e.backdropFilter?e.backdropFilter!=="none":!1)||!o&&(e.filter?e.filter!=="none":!1)||["transform","translate","scale","rotate","perspective","filter"].some(n=>(e.willChange||"").includes(n))||["paint","layout","strict","content"].some(n=>(e.contain||"").includes(n))}function Mn(t){let o=ne(t);for(;Y(o)&&!ye(o);){if(Bt(o))return o;if(Ze(o))return null;o=ne(o)}return null}function Ft(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function ye(t){return["html","body","#document"].includes(be(t))}function q(t){return $(t).getComputedStyle(t)}function Qe(t){return U(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.scrollX,scrollTop:t.scrollY}}function ne(t){if(be(t)==="html")return t;let o=t.assignedSlot||t.parentNode||Tn(t)&&t.host||J(t);return Tn(o)?o.host:o}function Ln(t){let o=ne(t);return ye(o)?t.ownerDocument?t.ownerDocument.body:t.body:Y(o)&&Ee(o)?o:Ln(o)}function We(t,o,e){var n;o===void 0&&(o=[]),e===void 0&&(e=!0);let i=Ln(t),r=i===((n=t.ownerDocument)==null?void 0:n.body),s=$(i);if(r){let a=zt(s);return o.concat(s,s.visualViewport||[],Ee(i)?i:[],a&&e?We(a):[])}return o.concat(i,We(i,[],e))}function zt(t){return t.parent&&Object.getPrototypeOf(t.parent)?t.frameElement:null}function En(t){let o=q(t),e=parseFloat(o.width)||0,n=parseFloat(o.height)||0,i=Y(t),r=i?t.offsetWidth:e,s=i?t.offsetHeight:n,a=je(e)!==r||je(n)!==s;return a&&(e=r,n=s),{width:e,height:n,$:a}}function ho(t){return U(t)?t:t.contextElement}function Re(t){let o=ho(t);if(!Y(o))return oe(1);let e=o.getBoundingClientRect(),{width:n,height:i,$:r}=En(o),s=(r?je(e.width):e.width)/n,a=(r?je(e.height):e.height)/i;return(!s||!Number.isFinite(s))&&(s=1),(!a||!Number.isFinite(a))&&(a=1),{x:s,y:a}}var Oi=oe(0);function Rn(t){let o=$(t);return!Ft()||!o.visualViewport?Oi:{x:o.visualViewport.offsetLeft,y:o.visualViewport.offsetTop}}function Ai(t,o,e){return o===void 0&&(o=!1),!e||o&&e!==$(t)?!1:o}function xe(t,o,e,n){o===void 0&&(o=!1),e===void 0&&(e=!1);let i=t.getBoundingClientRect(),r=ho(t),s=oe(1);o&&(n?U(n)&&(s=Re(n)):s=Re(t));let a=Ai(r,e,n)?Rn(r):oe(0),c=(i.left+a.x)/s.x,d=(i.top+a.y)/s.y,m=i.width/s.x,l=i.height/s.y;if(r){let g=$(r),u=n&&U(n)?$(n):n,f=g,_=zt(f);for(;_&&n&&u!==f;){let w=Re(_),h=_.getBoundingClientRect(),b=q(_),P=h.left+(_.clientLeft+parseFloat(b.paddingLeft))*w.x,k=h.top+(_.clientTop+parseFloat(b.paddingTop))*w.y;c*=w.x,d*=w.y,m*=w.x,l*=w.y,c+=P,d+=k,f=$(_),_=zt(f)}}return we({width:m,height:l,x:c,y:d})}function Vi(t){let{elements:o,rect:e,offsetParent:n,strategy:i}=t,r=i==="fixed",s=J(n),a=o?Ze(o.floating):!1;if(n===s||a&&r)return e;let c={scrollLeft:0,scrollTop:0},d=oe(1),m=oe(0),l=Y(n);if((l||!l&&!r)&&((be(n)!=="body"||Ee(s))&&(c=Qe(n)),Y(n))){let g=xe(n);d=Re(n),m.x=g.x+n.clientLeft,m.y=g.y+n.clientTop}return{width:e.width*d.x,height:e.height*d.y,x:e.x*d.x-c.scrollLeft*d.x+m.x,y:e.y*d.y-c.scrollTop*d.y+m.y}}function Di(t){return Array.from(t.getClientRects())}function go(t,o){let e=Qe(t).scrollLeft;return o?o.left+e:xe(J(t)).left+e}function Hi(t){let o=J(t),e=Qe(t),n=t.ownerDocument.body,i=_e(o.scrollWidth,o.clientWidth,n.scrollWidth,n.clientWidth),r=_e(o.scrollHeight,o.clientHeight,n.scrollHeight,n.clientHeight),s=-e.scrollLeft+go(t),a=-e.scrollTop;return q(n).direction==="rtl"&&(s+=_e(o.clientWidth,n.clientWidth)-i),{width:i,height:r,x:s,y:a}}function Ni(t,o){let e=$(t),n=J(t),i=e.visualViewport,r=n.clientWidth,s=n.clientHeight,a=0,c=0;if(i){r=i.width,s=i.height;let d=Ft();(!d||d&&o==="fixed")&&(a=i.offsetLeft,c=i.offsetTop)}return{width:r,height:s,x:a,y:c}}function $i(t,o){let e=xe(t,!0,o==="fixed"),n=e.top+t.clientTop,i=e.left+t.clientLeft,r=Y(t)?Re(t):oe(1),s=t.clientWidth*r.x,a=t.clientHeight*r.y,c=i*r.x,d=n*r.y;return{width:s,height:a,x:c,y:d}}function In(t,o,e){let n;if(o==="viewport")n=Ni(t,e);else if(o==="document")n=Hi(J(t));else if(U(o))n=$i(o,e);else{let i=Rn(t);n={...o,x:o.x-i.x,y:o.y-i.y}}return we(n)}function On(t,o){let e=ne(t);return e===o||!U(e)||ye(e)?!1:q(e).position==="fixed"||On(e,o)}function Bi(t,o){let e=o.get(t);if(e)return e;let n=We(t,[],!1).filter(a=>U(a)&&be(a)!=="body"),i=null,r=q(t).position==="fixed",s=r?ne(t):t;for(;U(s)&&!ye(s);){let a=q(s),c=Bt(s);!c&&a.position==="fixed"&&(i=null),(r?!c&&!i:!c&&a.position==="static"&&!!i&&["absolute","fixed"].includes(i.position)||Ee(s)&&!c&&On(t,s))?n=n.filter(m=>m!==s):i=a,s=ne(s)}return o.set(t,n),n}function Fi(t){let{element:o,boundary:e,rootBoundary:n,strategy:i}=t,s=[...e==="clippingAncestors"?Ze(o)?[]:Bi(o,this._c):[].concat(e),n],a=s[0],c=s.reduce((d,m)=>{let l=In(o,m,i);return d.top=_e(l.top,d.top),d.right=Nt(l.right,d.right),d.bottom=Nt(l.bottom,d.bottom),d.left=_e(l.left,d.left),d},In(o,a,i));return{width:c.right-c.left,height:c.bottom-c.top,x:c.left,y:c.top}}function zi(t){let{width:o,height:e}=En(t);return{width:o,height:e}}function Gi(t,o,e){let n=Y(o),i=J(o),r=e==="fixed",s=xe(t,!0,r,o),a={scrollLeft:0,scrollTop:0},c=oe(0);if(n||!n&&!r)if((be(o)!=="body"||Ee(i))&&(a=Qe(o)),n){let u=xe(o,!0,r,o);c.x=u.x+o.clientLeft,c.y=u.y+o.clientTop}else i&&(c.x=go(i));let d=0,m=0;if(i&&!n&&!r){let u=i.getBoundingClientRect();m=u.top+a.scrollTop,d=u.left+a.scrollLeft-go(i,u)}let l=s.left+a.scrollLeft-c.x-d,g=s.top+a.scrollTop-c.y-m;return{x:l,y:g,width:s.width,height:s.height}}function fo(t){return q(t).position==="static"}function Wn(t,o){if(!Y(t)||q(t).position==="fixed")return null;if(o)return o(t);let e=t.offsetParent;return J(t)===e&&(e=e.ownerDocument.body),e}function An(t,o){let e=$(t);if(Ze(t))return e;if(!Y(t)){let i=ne(t);for(;i&&!ye(i);){if(U(i)&&!fo(i))return i;i=ne(i)}return e}let n=Wn(t,o);for(;n&&Cn(n)&&fo(n);)n=Wn(n,o);return n&&ye(n)&&fo(n)&&!Bt(n)?e:n||Mn(t)||e}var Ui=async function(t){let o=this.getOffsetParent||An,e=this.getDimensions,n=await e(t.floating);return{reference:Gi(t.reference,await o(t.floating),t.strategy),floating:{x:0,y:0,width:n.width,height:n.height}}};function qi(t){return q(t).direction==="rtl"}var Xi={convertOffsetParentRelativeRectToViewportRelativeRect:Vi,getDocumentElement:J,getClippingRect:Fi,getOffsetParent:An,getElementRects:Ui,getClientRects:Di,getDimensions:zi,getScale:Re,isElement:U,isRTL:qi};function Ji(t,o){let e=null,n,i=J(t);function r(){var a;clearTimeout(n),(a=e)==null||a.disconnect(),e=null}function s(a,c){a===void 0&&(a=!1),c===void 0&&(c=1),r();let{left:d,top:m,width:l,height:g}=t.getBoundingClientRect();if(a||o(),!l||!g)return;let u=Ke(m),f=Ke(i.clientWidth-(d+l)),_=Ke(i.clientHeight-(m+g)),w=Ke(d),b={rootMargin:-u+"px "+-f+"px "+-_+"px "+-w+"px",threshold:_e(0,Nt(1,c))||1},P=!0;function k(y){let S=y[0].intersectionRatio;if(S!==c){if(!P)return s();S?s(!1,S):n=setTimeout(()=>{s(!1,1e-7)},1e3)}P=!1}try{e=new IntersectionObserver(k,{...b,root:i.ownerDocument})}catch{e=new IntersectionObserver(k,b)}e.observe(t)}return s(!0),r}function Vn(t,o,e,n){n===void 0&&(n={});let{ancestorScroll:i=!0,ancestorResize:r=!0,elementResize:s=typeof ResizeObserver=="function",layoutShift:a=typeof IntersectionObserver=="function",animationFrame:c=!1}=n,d=ho(t),m=i||r?[...d?We(d):[],...We(o)]:[];m.forEach(h=>{i&&h.addEventListener("scroll",e,{passive:!0}),r&&h.addEventListener("resize",e)});let l=d&&a?Ji(d,e):null,g=-1,u=null;s&&(u=new ResizeObserver(h=>{let[b]=h;b&&b.target===d&&u&&(u.unobserve(o),cancelAnimationFrame(g),g=requestAnimationFrame(()=>{var P;(P=u)==null||P.observe(o)})),e()}),d&&!c&&u.observe(d),u.observe(o));let f,_=c?xe(t):null;c&&w();function w(){let h=xe(t);_&&(h.x!==_.x||h.y!==_.y||h.width!==_.width||h.height!==_.height)&&e(),_=h,f=requestAnimationFrame(w)}return e(),()=>{var h;m.forEach(b=>{i&&b.removeEventListener("scroll",e),r&&b.removeEventListener("resize",e)}),l?.(),(h=u)==null||h.disconnect(),u=null,c&&cancelAnimationFrame(f)}}var vo=Pn;var wo=kn,_o=xn;var Dn=yn;var Hn=(t,o,e)=>{let n=new Map,i={platform:Xi,...e},r={...i.platform,_c:n};return bn(t,o,{...i,platform:r})};var de=({x:t,y:o,placement:e="right",offset:n=0,arrow:i=!1,arrowColor:r="white",children:s})=>{let a=N(null),c=N(null),d=N(null),m=N();return m.current=()=>{if(!a.current||!c.current)return;let l=Array.isArray(i)?i[0]:i||0,g=Array.isArray(i)?i[1]:i||0,u=n+Math.max(g,l),f=e.includes("-")?[vo(u),_o(),wo()]:[vo(u),wo(),_o()];d.current&&f.push(Dn({element:d.current})),Hn(a.current,c.current,{placement:e,strategy:"fixed",middleware:f}).then(_=>{c.current&&Object.assign(c.current.style,{left:`${_.x}px`,top:`${_.y}px`});let w=_.middlewareData.arrow;if(w&&d.current){let h=Yi(l,g,r,_.placement);h.transform=`translate(${w.x||0}px, ${w.y||0}px)`,Object.assign(d.current.style,h)}})},ee(()=>{m.current?.()},[t,o,e,i,n]),G(()=>{c.current&&(c.current.style.visibility="visible");let l=Vn(a.current,c.current,()=>m.current?.());return()=>{l()}},[]),p("div",{style:{position:"absolute",left:t,top:o},ref:a,children:p("div",{className:"deck-widget deck-widget-popover",style:{position:"fixed",visibility:"hidden",pointerEvents:"none"},ref:c,children:[Boolean(i)&&p("div",{className:"deck-widget-popover-arrow",style:{position:"absolute"},ref:d}),s]})})};function Yi(t,o,e,n){let i={width:0,height:0,top:"",bottom:"",left:"",right:""};return n.startsWith("bottom")?(i.borderLeft=`${t/2}px solid transparent`,i.borderRight=`${t/2}px solid transparent`,i.borderBottom=`${o}px solid ${e}`,i.borderTop="",i.top=`${-o}px`):n.startsWith("top")?(i.borderLeft=`${t/2}px solid transparent`,i.borderRight=`${t/2}px solid transparent`,i.borderTop=`${o}px solid ${e}`,i.borderBottom="",i.bottom=`${-o}px`):n.startsWith("right")?(i.borderTop=`${t/2}px solid transparent`,i.borderBottom=`${t/2}px solid transparent`,i.borderRight=`${o}px solid ${e}`,i.borderLeft="",i.left=`${-o}px`):n.startsWith("left")&&(i.borderTop=`${t/2}px solid transparent`,i.borderBottom=`${t/2}px solid transparent`,i.borderLeft=`${o}px solid ${e}`,i.borderRight="",i.right=`${-o}px`),i}var et=({text:t,html:o,element:e,...n})=>{let i=N(null);return G(()=>(i.current&&e&&i.current.append(e),()=>{e?.remove()}),[e]),p("div",{ref:i,...n,dangerouslySetInnerHTML:o?{__html:o}:void 0,children:t})};var tt=class extends bo.Widget{constructor(e){super(e);this.className="deck-widget-info";this.placement="fill";this.tooltip=null;this.setProps(this.props)}setProps(e){this.viewId=e.viewId??this.viewId,super.setProps(e)}onAdd({deck:e}){this.deck=e}onRemove(){this.rootElement&&x(null,this.rootElement)}onViewportChange(e){this.viewport=e,this.updateHTML()}onHover(e){this.props.mode==="hover"&&(this.tooltip=this._getTooltip(e))}onClick(e){this.props.mode==="click"&&(this.tooltip=this._getTooltip(e))}_getTooltip(e){if(!this.props.getTooltip)return null;let n=this.props.getTooltip(e,this)??null;if(n===null)return null;let i=typeof n=="string"?{text:n}:n,r=i.position||e.coordinate;return r?{position:r,text:"",html:"",element:null,className:"",style:{},...i}:null}onRenderHTML(e){if(!this.viewport||this.tooltip===null){x(null,e);return}let n={...this.props.style,...this.tooltip.style},[i,r]=this.viewport.project(this.tooltip.position),s=p(de,{x:i,y:r,placement:this.props.placement,arrow:this.props.arrow,arrowColor:"var(--menu-background, #fff)",offset:this.props.offset,children:p(et,{className:`deck-widget-popup-content ${this.tooltip.className} ${this.props.className}`,style:n,html:this.tooltip.html,text:this.tooltip.text,element:this.tooltip.element})});x(s,e)}};tt.defaultProps={...bo.Widget.defaultProps,id:"info",viewId:null,mode:"hover",getTooltip:void 0,placement:"right",offset:10,arrow:10};var yo=E(R(),1);var ot=class extends yo.Widget{constructor(e){super(e);this.className="deck-widget-popup";this.placement="fill";this.setProps(this.props),this.isOpen=this.props.defaultIsOpen}setProps(e){this.viewId=e.viewId??this.viewId,super.setProps(e)}onAdd({deck:e}){this.deck=e}onRemove(){this.rootElement&&x(null,this.rootElement)}onViewportChange(e){this.viewport=e,this.updateHTML()}onClick(){this.props.closeOnClickOutside&&this._setIsOpen(!1)}_setIsOpen(e){this.isOpen!==e&&(this.isOpen=e,this.props.onOpenChange?.(e),this.updateHTML())}onRenderHTML(e){if(!this.viewport){x(null,e);return}let{marker:n,content:i,style:r}=this.props,[s,a]=this.viewport.project(this.props.position),c=p("div",{children:[n&&p("div",{style:{position:"absolute",left:s,top:a,pointerEvents:"all",cursor:"pointer"},children:p(et,{...n,onClick:()=>this._setIsOpen(!0)})}),this.isOpen&&p(de,{x:s,y:a,placement:this.props.placement,arrow:this.props.arrow,arrowColor:"var(--menu-background, #fff)",offset:this.props.offset,children:p("div",{className:`deck-widget-popup-content ${this.props.className}`,style:r,children:[this.props.closeButton&&p("div",{className:"deck-widget-popup-controls",style:{width:"100%",display:"flex",justifyContent:"end"},children:p(M,{className:"deck-widget-popup-close-button",onClick:()=>this._setIsOpen(!1)})}),p(et,{...typeof i=="string"?{text:i}:i})]})})]});x(c,e)}};ot.defaultProps={...yo.Widget.defaultProps,id:"info",viewId:null,position:[0,0],marker:null,defaultIsOpen:!0,content:"",placement:"right",offset:10,arrow:10,closeButton:!0,closeOnClickOutside:!1,onOpenChange:()=>{}};var xo=E(R(),1);var nt=class extends xo.Widget{constructor(e){super(e);this.className="deck-widget-context-menu";this.placement="fill";this.menu=null;this.setProps(this.props)}onAdd({deck:e}){e.getCanvas()?.addEventListener("contextmenu",n=>this.handleContextMenu(n))}handleContextMenu(e){let n=e.target.getBoundingClientRect(),i=e.clientX-n.x,r=e.clientY-n.y,s=this.deck?.pickObject({x:i,y:r})||{x:i,y:r,picked:!1,layer:null,color:null,index:-1,pixelRatio:1},a=this.props.getMenuItems?.(s,this)||this.props.menuItems;this.menu=a.length>0?{items:a,pickInfo:s}:null,e.preventDefault(),this.updateHTML()}onRenderHTML(e){if(!this.menu){x(null,e);return}let{items:n,pickInfo:i}=this.menu,r={pointerEvents:"auto",position:"static",...this.props.style},s=p(de,{x:i.x,y:i.y,placement:this.props.placement,arrow:this.props.arrow,arrowColor:"var(--menu-background, #fff)",offset:this.props.offset,children:p(he,{menuItems:n,onSelect:a=>this.props.onMenuItemSelected(a,i),style:r,isOpen:!0,onClose:()=>this.hide()})});x(s,e)}hide(){this.menu=null,this.updateHTML()}};nt.defaultProps={...xo.Widget.defaultProps,id:"context",viewId:null,menuItems:[],getMenuItems:void 0,onMenuItemSelected:()=>{},placement:"bottom-start",offset:10,arrow:!1};var To=E(R(),1);var Nn={passive:!1},it=(t,o,e)=>t<o?o:t>e?e:t,Gt=(t,o)=>{if(!t||!t.firstElementChild)return[0,0];let e=t.firstElementChild.getBoundingClientRect();return o?[e.top,e.height]:o?[e.top,e.height]:[e.left,e.width]},rt=(t,o)=>typeof t=="number"&&!Number.isNaN(t)&&t>0?t:Math.max(1,o/10||1),Po=(t,o)=>typeof t=="number"&&!Number.isNaN(t)&&t>0?t:Math.max(1,o||1);function Oe(t){let{className:o="",min:e,max:n,step:i,value:r,orientation:s,pageSize:a,stepButtons:c=!1,startButtonAriaLabel:d,endButtonAriaLabel:m,eventTarget:l,decorations:g=[],onChange:u}=t,f=s!=="horizontal",_=N(null),w=N(null),h=N(null),b=N(null),[P,k]=le(0),y=n-e,S=Math.max(0,r[1]-r[0]),L=Math.max(0,y-S),I=it(r[0],e,e+L),{thumbLength:D,thumbOffset:O}=ee(()=>{if(P<=0||y<=0)return{thumbLength:0,thumbOffset:0};if(y<=S)return{thumbLength:1,thumbOffset:0};let v=S/y,T=Math.max(0,1-v),j=L<=0?0:it((I-e)/L,0,1);return{thumbLength:Math.max(0,Math.min(v,1)),thumbOffset:T*j}},[P,y,S,L,I,e]),C=te(v=>{if(!u)return;let T=it(v,e,e+L);u([T,T+S])},[u,e,L,S]),Q=te(v=>{v.stopPropagation(),C(I-rt(i,y))},[C,I,i,y]),ue=te(v=>{v.stopPropagation(),C(I+rt(i,y))},[C,I,i,y]),H=te(v=>{if(v.button!==0||v.target?.dataset.scrollbarThumb==="true")return;let j=w.current;if(!j)return;v.preventDefault(),v.stopPropagation();let[Pe]=Gt(j,f),Ae=f?v.clientY-Pe:v.clientX-Pe,ke=Math.max(1,1-D)*P,Te=D/2*P,Se=ke<=0?0:it((Ae-Te)/ke,0,1);C(e+Se*L)},[f,P,D,C,e,L]),ie=v=>{v.button!==0||!w.current||(b.current={pointerId:v.pointerId,startCoord:f?v.clientY:v.clientX,startRatio:O,min:e,max:n,maxStart:L},v.currentTarget.setPointerCapture(v.pointerId),v.preventDefault(),v.stopPropagation())},X=te(v=>{let T=b.current;if(!T||T.pointerId!==v.pointerId)return;let[j,Pe]=Gt(w.current,f),ke=(f?v.clientY:v.clientX)-T.startCoord,Te=T.startRatio+ke/Pe,Se=it(Te*(T.max-T.min),0,T.maxStart)+T.min;C(Se),v.preventDefault()},[C,f]),B=te(v=>{let T=b.current;T&&T.pointerId===v.pointerId&&(b.current=null,h.current?.releasePointerCapture(v.pointerId),v.preventDefault())},[]),F=te(v=>{switch(v.key){case"ArrowUp":case"ArrowLeft":(f&&v.key==="ArrowUp"||!f&&v.key==="ArrowLeft")&&(C(I-rt(i,y)),v.preventDefault());break;case"ArrowDown":case"ArrowRight":(f&&v.key==="ArrowDown"||!f&&v.key==="ArrowRight")&&(C(I+rt(i,y)),v.preventDefault());break;case"PageUp":C(I-Po(a,S)),v.preventDefault();break;case"PageDown":C(I+Po(a,S)),v.preventDefault();break;case"Home":C(e),v.preventDefault();break;case"End":C(e+L),v.preventDefault();break;default:break}},[f,C,I,i,y,a,S,e,L]),z=te(v=>{if(v.preventDefault(),v.stopPropagation(),L===0)return;let T=f?v.deltaY:v.deltaX;!f&&T===0&&(T=v.deltaY),v.deltaMode===WheelEvent.DOM_DELTA_LINE?T*=rt(i,y):v.deltaMode===WheelEvent.DOM_DELTA_PAGE&&(T*=Po(a,S)),T!==0&&C(I+T)},[C,I,L,f,i,y,a,S]);io(()=>{k(Gt(w.current,f)[1])},[f]),io(()=>{let v=w.current;if(!v)return;let T=()=>{k(Gt(v,f)[1])};if(T(),typeof ResizeObserver<"u"){let j=new ResizeObserver(T);return j.observe(v),()=>j.disconnect()}if(typeof window<"u")return window.addEventListener("resize",T),()=>window.removeEventListener("resize",T)},[f]),G(()=>{let v=l??_.current;if(v)return v.addEventListener("keydown",F),v.addEventListener("wheel",z,Nn),()=>{v.removeEventListener("keydown",F),v.removeEventListener("wheel",z,Nn)}},[l,F,z]);let Xt=ee(()=>!g.length||y<=0?[]:g.map((v,T)=>{let[j,Pe]=v.position,Ae=(j-e)/y,ke=(Pe-e)/y,Te=Math.round(Ae*1e3)/10,Se=Math.max(0,Math.round((ke-Ae)*1e3)/10),Jn=f?{left:"0",width:"100%",top:`${Te}%`,height:`${Se}%`}:{top:"0",height:"100%",left:`${Te}%`,width:`${Se}%`};return p("div",{className:"deck-widget-range__decoration",style:Jn,children:v.element},`decoration-${T}`)}),[g,y,e,f]);return p("div",{ref:_,tabIndex:0,role:"scrollbar","aria-valuemin":e,"aria-valuemax":e+L,"aria-valuenow":I,"aria-orientation":s,className:`${o} deck-widget-range deck-widget-range--${s} ${L===0?"deck-widget-range--disabled":""}`,children:[c&&p("button",{type:"button",className:"deck-widget-range__button deck-widget-range__button--start","aria-label":d,disabled:I<=e,onClick:Q,children:p("span",{className:"deck-widget-icon"})}),p("div",{className:"deck-widget-range__track",ref:w,onClick:H,children:[p("div",{className:"deck-widget-range__decorations",children:Xt}),p("div",{className:"deck-widget-range__thumb","data-scrollbar-thumb":"true",ref:h,style:f?{height:`${D*100}%`,top:`${O*100}%`}:{width:`${D*100}%`,left:`${O*100}%`},onPointerDown:ie,onPointerMove:X,onPointerUp:B,onPointerCancel:B})]}),c&&p("button",{type:"button",className:"deck-widget-range__button deck-widget-range__button--end","aria-label":m,disabled:I>=e+L,onClick:ue,children:p("span",{className:"deck-widget-icon"})})]})}var $n=(t,o,e)=>t<o?o:t>e?e:t,So=class extends To.Widget{constructor(e){let n={...So.defaultProps,...e};super(n);this.className="deck-widget-scrollbar";this.placement="fill";this.contentSize=0;this.viewportSize=0;this.scrollOffset=0;this.handleRangeChange=e=>{this.emitScroll(e[0])};this.viewId=n.viewId??null}onViewportChange(e){this.viewport=e,this.onRenderHTML()}onRenderHTML(){let e=this.rootElement;if(!e)return;e.dataset.placement=this.props.placement;let n=this.viewport;this.updateViewport(n);let i=this.getClampedOffset(),r=this.getWheelEventTarget(this.props.captureWheel?"global":"local"),s=this.getDecorations(n),a=this.isVertical(),c=this.props.startButtonAriaLabel??(a?"Scroll up":"Scroll left"),d=this.props.endButtonAriaLabel??(a?"Scroll down":"Scroll right"),m=p(Oe,{min:0,max:Math.max(0,this.contentSize),step:this.getEffectiveStep(),pageSize:this.getEffectivePage(),value:[i,i+this.viewportSize],orientation:this.props.orientation,stepButtons:!0,startButtonAriaLabel:c,endButtonAriaLabel:d,eventTarget:r,decorations:s,onChange:this.handleRangeChange});x(m,e)}onRemove(){this.rootElement&&x(null,this.rootElement),super.onRemove()}updateViewport(e){if(!e){this.contentSize=0,this.scrollOffset=0,this.viewportSize=0;return}let{contentBounds:n}=this.props,i=this.isVertical(),r=n?ko(n,e,i):[0,0];this.contentSize=r[1]-r[0],this.scrollOffset=-r[0],this.viewportSize=i?e.height:e.width}getDecorations(e){let{decorations:n=[],contentBounds:i}=this.props;if(!e||!i||n.length===0)return[];let r=this.isVertical(),[s]=ko(i,e,r);return n.map(a=>{let[c,d]=ko(a.contentBounds,e,r),m=a.onClick?l=>{a.onClick?.(l)&&(l.stopPropagation(),l.preventDefault())}:void 0;return{position:[c-s,d-s],element:p("div",{style:{pointerEvents:m?"all":"none",width:"100%",height:"100%",backgroundColor:a.color},title:a.title,onClick:m})}})}getWheelEventTarget(e){return e===null?null:e==="local"?this.rootElement:this.deck?.props.parent||this.deck?.getCanvas()?.parentElement||this.rootElement}getMaxScroll(){return Math.max(0,this.contentSize-this.viewportSize)}getClampedOffset(){let e=this.getMaxScroll();return $n(this.scrollOffset,0,e)}isVertical(){return this.props.orientation!=="horizontal"}getEffectiveStep(){return typeof this.props.stepSize=="number"&&!Number.isNaN(this.props.stepSize)?this.props.stepSize:Math.max(1,this.viewportSize/10||1)}getEffectivePage(){return typeof this.props.pageSize=="number"&&!Number.isNaN(this.props.pageSize)?this.props.pageSize:this.viewportSize}emitScroll(e){let n=this.getMaxScroll(),i=$n(Math.round(e),0,n),r=this.viewport;if(r&&i!==this.getClampedOffset()){let s=r.project(r.position);this.isVertical()?s[1]-=i-this.scrollOffset:s[0]-=i-this.scrollOffset;let{target:a}=r.panByPosition(r.position,s);this.deck._onViewStateChange({viewId:r.id,viewState:{...this.getViewState(r.id),target:a},interactionState:{}})}}},st=So;st.defaultProps={...To.Widget.defaultProps,contentBounds:null,placement:"top-right",viewId:null,orientation:"vertical",stepSize:null,pageSize:null,startButtonAriaLabel:"",endButtonAriaLabel:"",captureWheel:!1,decorations:[]};function ko(t,o,e){return t.map(([n,i])=>o.project([n,i,0])).reduce((n,[i,r])=>{let s=e?r:i;return n[0]=Math.min(n[0],s),n[1]=Math.max(n[1],s),n},[1/0,-1/0])}var Co=E(R(),1);var at=class extends Co.Widget{constructor(e){super(e);this.className="";this.placement="top-left";this.setProps(this.props)}setProps(e){this.placement=e.placement??this.placement,this.viewId=e.viewId,super.setProps(e)}onRenderHTML(e){let{className:n,style:i,icon:r,color:s,label:a,onClick:c}=this.props;x(p(M,{className:n,style:i,color:s,icon:r,label:a,onClick:c}),e)}};at.defaultProps={...Co.Widget.defaultProps,id:"icon",placement:"top-left",viewId:null,icon:"",label:"",color:"",onClick:void 0};var Mo=E(R(),1);var lt=class extends Mo.Widget{constructor(e){super(e);this.className="deck-widget-toggle";this.placement="top-left";this._toggle=()=>{this.checked=!this.checked,this.props.onChange?.(this.checked),this.updateHTML()};this.checked=this.props.initialChecked,this.setProps(this.props)}setProps(e){this.placement=e.placement??this.placement,this.viewId=e.viewId,super.setProps(e)}onRenderHTML(e){let{className:n,style:i,icon:r,label:s,color:a,onIcon:c=r,onLabel:d=s,onColor:m=a}=this.props,l=this.checked;e.dataset.checked=String(l),x(p(M,{className:n,style:i,icon:l?c:r,label:l?d:s,color:l?m:a,onClick:this._toggle}),e)}};lt.defaultProps={...Mo.Widget.defaultProps,id:"icon",placement:"top-left",viewId:null,initialChecked:!1,icon:"",onIcon:void 0,label:"",onLabel:void 0,color:"",onColor:void 0,onChange:void 0};var Lo=E(R(),1);var ct=class extends Lo.Widget{constructor(e){super(e);this.className="deck-widget-selector";this.placement="top-left";this.isOpen=!1;this._toggleMenu=()=>{this.isOpen?this.isOpen=!1:this.rootElement&&(this.isOpen={x:this.rootElement.offsetLeft,y:this.rootElement.offsetTop,placement:this.props.placement.includes("right")?"left-start":"right-start"}),this.updateHTML()};this._handleSelectMode=e=>{this.value=e,this.props.onChange(e),this.updateHTML()};this.value=this.props.initialValue,this.setProps(this.props)}setProps(e){this.placement=e.placement??this.placement,this.viewId=e.viewId??this.viewId,super.setProps(e)}onRenderHTML(e){let n=this.props.options.find(i=>i.value===this.value)??this.props.options[0];x(p("div",{children:[p(M,{icon:n.icon,label:n.label,onClick:this._toggleMenu}),this.isOpen&&p(de,{...this.isOpen,children:p(he,{isOpen:!0,style:{pointerEvents:"auto",position:"static"},menuItems:this.props.options,onSelect:this._handleSelectMode,onClose:this._toggleMenu})})]}),e)}};ct.defaultProps={...Lo.Widget.defaultProps,id:"view-selector",placement:"top-left",viewId:null,initialValue:"",options:[],onChange:()=>{}};var Io=E(R(),1);var dt=class extends Io.Widget{constructor(e={}){super(e);this.id="timeline";this.className="deck-widget-timeline";this.placement="fill";this.playing=!1;this.timerId=null;this.handlePlayPause=()=>{this.playing?this.stop():this.play()};this.handleTimeChange=([e])=>{this.currentTime=e,this.props.timeline?.setTime(e),this.props.onTimeChange(e),this.updateHTML()};this.tick=()=>{let{timeRange:[e,n],step:i,loop:r}=this.props;if(i>0){let s=Math.round(this.currentTime/i)*i+i;s>n&&(this.currentTime<n?s=n:r?s=e:(s=n,this.playing=!1)),this.currentTime=s,this.props.onTimeChange(s),this.updateHTML()}this.playing?this.timerId=window.setTimeout(this.tick,this.props.playInterval):this.timerId=null};this.currentTime=this.props.initialTime??this.props.timeRange[0],this.props.timeline?.setTime(this.currentTime),this.setProps(this.props)}setProps(e){this.viewId=e.viewId??this.viewId,super.setProps(e)}onAdd(){this.playing=!1,this.timerId=null,this.props.autoPlay&&this.play()}onRemove(){this.stop()}onRenderHTML(e){let{timeRange:n,step:i,formatLabel:r}=this.props,s=this.currentTime;e.dataset.placement=this.props.placement,x(p("div",{className:"deck-widget-button-group",children:[this.playing?p(M,{label:"Pause",className:"deck-widget-timeline-pause",onClick:this.handlePlayPause}):p(M,{label:"Play",className:"deck-widget-timeline-play",onClick:this.handlePlayPause}),p(Oe,{min:n[0],max:n[1],orientation:"horizontal",step:i,value:[s,s],onChange:this.handleTimeChange,decorations:[{position:[s,s+i],element:p("div",{className:"deck-widget-timeline-label deck-widget-timeline-label--current",children:r(s)})}]})]}),e)}play(){this.playing=!0;let{timeRange:[e,n]}=this.props;this.currentTime>=n&&(this.currentTime=e,this.props.onTimeChange(e)),this.updateHTML(),this.tick()}stop(){this.playing=!1,this.timerId!==null&&(window.clearTimeout(this.timerId),this.timerId=null),this.updateHTML()}};dt.defaultProps={...Io.Widget.defaultProps,id:"timeline",placement:"bottom-left",viewId:null,timeline:null,timeRange:[0,100],step:1,initialTime:void 0,onTimeChange:()=>{},autoPlay:!1,loop:!1,playInterval:1e3,formatLabel:String};var Wo=E(R(),1);var pt=class extends Wo.Widget{constructor(e={}){super(e);this.className="deck-widget-screenshot";this.placement="top-left";this.setProps(this.props)}setProps(e){this.placement=e.placement??this.placement,this.viewId=e.viewId??this.viewId,super.setProps(e)}onRenderHTML(e){x(p(M,{className:"deck-widget-camera",label:this.props.label,onClick:this.handleClick.bind(this)}),e)}handleClick(){if(this.props.onCapture){this.props.onCapture(this);return}let e=this.captureScreenToDataURL(this.props.imageFormat);e&&this.downloadDataURL(e,this.props.filename)}captureScreenToDataURL(e){return this.deck?.getCanvas()?.toDataURL(e)}downloadDataURL(e,n){let i=document.createElement("a");i.href=e,i.download=n,i.click()}};pt.defaultProps={...Wo.Widget.defaultProps,id:"screenshot",placement:"top-left",viewId:null,label:"Screenshot",filename:"screenshot.png",imageFormat:"image/png",onCapture:void 0};var pe=E(R(),1),Eo=E(R(),1);var Bn={"--widget-margin":"12px","--button-size":"28px","--button-corner-radius":"8px","--button-background":"#fff","--button-stroke":"rgba(255, 255, 255, 0.3)","--button-inner-stroke":"unset","--button-shadow":"0px 0px 8px 0px rgba(0, 0, 0, 0.25)","--button-backdrop-filter":"unset","--button-icon-idle":"rgba(97, 97, 102, 1)","--button-icon-hover":"rgba(24, 24, 26, 1)","--button-text":"rgb(24, 24, 26, 1)","--icon-compass-north-color":"rgb(240, 92, 68)","--icon-compass-south-color":"rgb(204, 204, 204)","--menu-gap":"4px","--menu-background":"#fff","--menu-backdrop-filter":"unset","--menu-border":"unset","--menu-shadow":"0px 0px 8px 0px rgba(0, 0, 0, 0.25)","--menu-text":"rgb(24, 24, 26, 1)","--menu-item-hover":"rgba(0, 0, 0, 0.08)","--range-step-button-size":"24px","--range-track-size":"16px","--range-thumb-size":"10px","--range-track-color":"#d8d8e5","--range-thumb-color":"#616166","--range-decoration-active-color":"#f8dd50"},Fn={"--widget-margin":"12px","--button-size":"28px","--button-corner-radius":"8px","--button-background":"rgba(18, 18, 20, 1)","--button-stroke":"rgba(18, 18, 20, 0.30)","--button-inner-stroke":"unset","--button-shadow":"0px 0px 8px 0px rgba(0, 0, 0, 0.25)","--button-backdrop-filter":"unset","--button-icon-idle":"rgba(158, 157, 168, 1)","--button-icon-hover":"rgba(215, 214, 229, 1)","--button-text":"rgb(215, 214, 229, 1)","--icon-compass-north-color":"rgb(240, 92, 68)","--icon-compass-south-color":"rgb(200, 199, 209)","--menu-gap":"4px","--menu-background":"rgba(18, 18, 20, 1)","--menu-backdrop-filter":"unset","--menu-border":"unset","--menu-shadow":"0px 0px 8px 0px rgba(0, 0, 0, 0.25)","--menu-text":"rgb(215, 214, 229, 1)","--menu-item-hover":"rgba(255, 255, 255, 0.1)","--range-step-button-size":"24px","--range-track-size":"16px","--range-thumb-size":"10px","--range-track-color":"#2c2c30","--range-thumb-color":"#9e9da8","--range-decoration-active-color":"#dd7d2c"},Ut={"--widget-margin":"12px","--button-size":"28px","--button-corner-radius":"8px","--button-background":"rgba(255, 255, 255, 0.6)","--button-stroke":"rgba(255, 255, 255, 0.3)","--button-inner-stroke":"1px solid rgba(255, 255, 255, 0.6)","--button-shadow":"0px 0px 8px 0px rgba(0, 0, 0, 0.25), 0px 0px 8px 0px rgba(0, 0, 0, 0.1) inset","--button-backdrop-filter":"blur(4px)","--button-icon-idle":"rgba(97, 97, 102, 1)","--button-icon-hover":"rgba(24, 24, 26, 1)","--button-text":"rgb(24, 24, 26, 1)","--icon-compass-north-color":"rgb(240, 92, 68)","--icon-compass-south-color":"rgb(204, 204, 204)","--menu-gap":"4px","--menu-background":"rgba(255, 255, 255, 0.6)","--menu-backdrop-filter":"blur(4px)","--menu-border":"1px solid rgba(255, 255, 255, 0.6)","--menu-shadow":"0px 0px 8px 0px rgba(0, 0, 0, 0.25), 0px 0px 8px 0px rgba(0, 0, 0, 0.1) inset","--menu-text":"rgb(24, 24, 26, 1)","--menu-item-hover":"rgba(0, 0, 0, 0.08)","--range-step-button-size":"24px","--range-track-size":"16px","--range-thumb-size":"10px","--range-track-color":"rgba(215, 214, 229, 0.3)","--range-thumb-color":"rgba(97, 97, 102, 1)","--range-decoration-active-color":"rgba(255, 215, 0, 0.6)"},qt={"--widget-margin":"12px","--button-size":"28px","--button-corner-radius":"8px","--button-background":"rgba(18, 18, 20, 0.75)","--button-stroke":"rgba(18, 18, 20, 0.30)","--button-inner-stroke":"1px solid rgba(18, 18, 20, 0.75)","--button-shadow":"0px 0px 8px 0px rgba(0, 0, 0, 0.25), 0px 0px 8px 0px rgba(0, 0, 0, 0.1) inset","--button-backdrop-filter":"blur(4px)","--button-icon-idle":"rgba(158, 157, 168, 1)","--button-icon-hover":"rgba(215, 214, 229, 1)","--button-text":"rgb(215, 214, 229, 1)","--icon-compass-north-color":"rgb(240, 92, 68)","--icon-compass-south-color":"rgb(200, 199, 209)","--menu-gap":"4px","--menu-background":"rgba(18, 18, 20, 0.75)","--menu-backdrop-filter":"blur(4px)","--menu-border":"1px solid rgba(18, 18, 20, 0.75)","--menu-shadow":"0px 0px 8px 0px rgba(0, 0, 0, 0.25), 0px 0px 8px 0px rgba(0, 0, 0, 0.1) inset","--menu-text":"rgb(215, 214, 229, 1)","--menu-item-hover":"rgba(255, 255, 255, 0.1)","--range-step-button-size":"24px","--range-track-size":"16px","--range-thumb-size":"10px","--range-track-color":"rgba(24, 24, 26, 0.3)","--range-thumb-color":"rgba(158, 157, 168, 1)","--range-decoration-active-color":"rgba(255, 145, 0, 0.6)"};var ut=class extends Eo.Widget{constructor(e={}){super(e);this.className="deck-widget-theme";this.placement="top-left";this.themeMode="dark";this.themeMode=this._getInitialThemeMode(),this.setProps(this.props)}setProps(e){let{lightModeTheme:n,darkModeTheme:i}=this.props;switch(this.placement=e.placement??this.placement,this.viewId=e.viewId??this.viewId,super.setProps(e),this.themeMode){case"light":e.lightModeTheme&&!(0,pe._deepEqual)(e.lightModeTheme,n,1)&&this._setThemeMode("light");break;case"dark":e.darkModeTheme&&!(0,pe._deepEqual)(e.darkModeTheme,i,1)&&this._setThemeMode("dark");break;default:pe.log.warn(`Invalid theme mode ${this.themeMode}`)()}}onRenderHTML(e){let{lightModeLabel:n,darkModeLabel:i}=this.props;x(p(M,{onClick:this._handleClick.bind(this),label:this.themeMode==="dark"?i:n,className:this.themeMode==="dark"?"deck-widget-moon":"deck-widget-sun"}),e)}onAdd(){this._setThemeMode(this.themeMode)}_handleClick(){let e=this.themeMode==="dark"?"light":"dark";this._setThemeMode(e)}_setThemeMode(e){this.themeMode=e;let n=this.rootElement?.closest(".deck-widget-container");if(n){let i=e==="dark"?this.props.darkModeTheme:this.props.lightModeTheme;(0,pe._applyStyles)(n,i);let r=this.themeMode==="dark"?this.props.darkModeLabel:this.props.lightModeLabel;pe.log.log(1,`Switched theme to ${r}`,i)(),this.updateHTML()}}_getInitialThemeMode(){let{initialThemeMode:e}=this.props;return e!=="auto"?e:typeof window>"u"?"light":window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"}};ut.defaultProps={...Eo.Widget.defaultProps,id:"theme",placement:"top-left",viewId:null,lightModeLabel:"Light Mode",lightModeTheme:Ut,darkModeLabel:"Dark Mode",darkModeTheme:qt,initialThemeMode:"auto"};var Ro=E(R(),1);var mt=class extends Ro.Widget{constructor(e={}){super(e);this.className="deck-widget-loading";this.placement="top-left";this.loading=!0;this.setProps(this.props)}setProps(e){this.placement=e.placement??this.placement,this.viewId=e.viewId??this.viewId,super.setProps(e)}onRenderHTML(e){x(this.loading&&p(M,{className:"deck-widget-spinner",label:this.props.label,onClick:this.handleClick.bind(this)}),e)}onRedraw({layers:e}){let n=e.some(i=>!i.isLoaded);n!==this.loading&&(this.loading=n,this.updateHTML())}handleClick(){}};mt.defaultProps={...Ro.Widget.defaultProps,id:"loading",placement:"top-left",viewId:null,label:"Loading layer data"};var Oo=E(R(),1),qn=E(Gn(),1);var Ao=t=>`${t.name}: ${t.count}`;function Vo(t){return t<1e3?`${t.toFixed(2)}ms`:`${(t/1e3).toFixed(2)}s`}function Xn(t){return`${(t/1e6).toFixed(1)} MB`}var Un={count:Ao,averageTime:t=>`${t.name}: ${Vo(t.getAverageTime())}`,totalTime:t=>`${t.name}: ${Vo(t.time)}`,fps:t=>`${t.name}: ${Math.round(t.getHz())}fps`,memory:t=>`${t.name}: ${Xn(t.count)}`},ft=class extends Oo.Widget{constructor(e={}){super(e);this.className="deck-widget-stats";this.placement="top-left";this._counter=0;this.collapsed=!0;this._toggleCollapsed=()=>{this.collapsed=!this.collapsed,this.updateHTML()};this._getFps=()=>Math.round(this.deck?.metrics.fps??0);this._formatters={...Un},this._resetOnUpdate={...this.props.resetOnUpdate},this.collapsed=!e.defaultIsExpanded,this.setProps(e)}setProps(e){if(this.placement=e.placement??this.placement,this.viewId=e.viewId??this.viewId,e.formatters)for(let n in e.formatters){let i=e.formatters[n];this._formatters[n]=typeof i=="string"?Un[i]||Ao:i}e.resetOnUpdate&&(this._resetOnUpdate={...e.resetOnUpdate}),super.setProps(e)}onRemove(){this.rootElement&&x(null,this.rootElement)}onRenderHTML(e){if(this.collapsed){x(p(ji,{getFps:this._getFps,onClick:this._toggleCollapsed}),e);return}let i=this._getStats(),r=this.props.title||("id"in i?i.id:null)||"Stats",s=[];i&&i.forEach(a=>{let c=this._getLines(a).split(`
8
- `);this._resetOnUpdate&&this._resetOnUpdate[a.name]&&a.reset(),c.forEach((d,m)=>{s.push(p("div",{style:{whiteSpace:"pre"},children:d},`${a.name}-${m}`))})}),x(p("div",{className:"deck-widget-stats-container",style:{cursor:"default"},children:[p("div",{className:"deck-widget-stats-header",style:{cursor:"pointer",pointerEvents:"auto"},onClick:this._toggleCollapsed,children:[p("b",{children:r}),p("button",{className:"deck-widget-dropdown-button",children:p("span",{className:"deck-widget-dropdown-icon open"})})]}),p("div",{className:"deck-widget-stats-content",children:s})]}),e)}onRedraw(){if(!this.collapsed){let e=Math.max(1,this.props.framesPerUpdate||1);this._counter++%e===0&&this.updateHTML()}}_getStats(){switch(this.props.type){case"deck":let e=this.deck?.metrics??{};return Object.entries(e);case"luma":return Array.from(qn.luma.stats.stats.values())[0];case"device":let i=this.deck?.device?.statsManager.stats.values();return i?Array.from(i)[0]:[];case"custom":return this.props.stats;default:throw new Error(`Unknown stats type: ${this.props.type}`)}}_getLines(e){if("count"in e)return(this._formatters[e.name]||this._formatters[e.type||""]||Ao)(e);let[n,i]=e,r=n.endsWith("Memory")?Xn(i):n.includes("Time")?Vo(i):`${i.toFixed(2)}`;return`${n}: ${r}`}};ft.defaultProps={...Oo.Widget.defaultProps,type:"deck",placement:"top-left",viewId:null,defaultIsExpanded:!1,stats:void 0,title:"Stats",framesPerUpdate:1,formatters:{},resetOnUpdate:{},id:"stats"};function ji({getFps:t,onClick:o}){let[e,n]=le(t());return G(()=>{let i=()=>{n(t()),r=requestAnimationFrame(i)},r=requestAnimationFrame(i);return()=>{cancelAnimationFrame(r)}},[t]),p(M,{onClick:o,children:p("div",{className:"text",children:["FPS",p("br",{}),e]})})}return ti(gt);})();
7
+ "use strict";var __exports__=(()=>{var ei=Object.create;var _t=Object.defineProperty;var ti=Object.getOwnPropertyDescriptor;var oi=Object.getOwnPropertyNames;var ni=Object.getPrototypeOf,ii=Object.prototype.hasOwnProperty;var Do=(t,o)=>()=>(o||t((o={exports:{}}).exports,o),o.exports),ri=(t,o)=>{for(var e in o)_t(t,e,{get:o[e],enumerable:!0})},vt=(t,o,e,n)=>{if(o&&typeof o=="object"||typeof o=="function")for(let i of oi(o))!ii.call(t,i)&&i!==e&&_t(t,i,{get:()=>o[i],enumerable:!(n=ti(o,i))||n.enumerable});return t},ae=(t,o,e)=>(vt(t,o,"default"),e&&vt(e,o,"default")),R=(t,o,e)=>(e=t!=null?ei(ni(t)):{},vt(o||!t||!t.__esModule?_t(e,"default",{value:t,enumerable:!0}):e,t)),si=t=>vt(_t({},"__esModule",{value:!0}),t);var E=Do((lr,No)=>{No.exports=globalThis.deck});var Kn=Do((Va,Jn)=>{Jn.exports=globalThis.luma});var wt={};ri(wt,{CompassWidget:()=>Ge,ContextMenuWidget:()=>rt,DarkGlassTheme:()=>Xt,DarkTheme:()=>Xn,FullscreenWidget:()=>Xe,GimbalWidget:()=>Fe,IconWidget:()=>ct,InfoWidget:()=>nt,LightGlassTheme:()=>qt,LightTheme:()=>qn,LoadingWidget:()=>gt,PopupWidget:()=>it,ResetViewWidget:()=>Be,ScreenshotWidget:()=>mt,ScrollbarWidget:()=>lt,SelectorWidget:()=>pt,ThemeWidget:()=>ft,ToggleWidget:()=>dt,ZoomWidget:()=>$e,_ButtonGroup:()=>St,_CoordinatesGeocoder:()=>We,_CurrentLocationGeocoder:()=>Ot,_DropdownMenu:()=>Mt,_GeocoderWidget:()=>qe,_GoogleGeocoder:()=>It,_IconButton:()=>M,_MapboxGeocoder:()=>Rt,_OpenCageGeocoder:()=>Et,_RangeInput:()=>Ve,_ScaleWidget:()=>Ue,_SimpleMenu:()=>_e,_SplitterWidget:()=>Ke,_StatsWidget:()=>ht,_TimelineWidget:()=>ut});var Z={},Ho=R(E(),1);ae(Z,R(E(),1));if(!Ho.Layer)throw new Error("@deck.gl/core is not found");ae(wt,Z);var ve=R(E(),1);var kt,I,Go,ai,he,$o,Uo,Kt,Qt,Yt,Zt,li,Ne={},qo=[],ci=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,eo=Array.isArray;function le(t,o){for(var e in o)t[e]=o[e];return t}function Xo(t){var o=t.parentNode;o&&o.removeChild(t)}function di(t,o,e){var n,i,r,s={};for(r in o)r=="key"?n=o[r]:r=="ref"?i=o[r]:s[r]=o[r];if(arguments.length>2&&(s.children=arguments.length>3?kt.call(arguments,2):e),typeof t=="function"&&t.defaultProps!=null)for(r in t.defaultProps)s[r]===void 0&&(s[r]=t.defaultProps[r]);return yt(t,s,n,i,null)}function yt(t,o,e,n,i){var r={type:t,props:o,key:e,ref:n,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,constructor:void 0,__v:i??++Go,__i:-1,__u:0};return i==null&&I.vnode!=null&&I.vnode(r),r}function ce(t){return t.children}function xt(t,o){this.props=t,this.context=o}function we(t,o){if(o==null)return t.__?we(t.__,t.__i+1):null;for(var e;o<t.__k.length;o++)if((e=t.__k[o])!=null&&e.__e!=null)return e.__e;return typeof t.type=="function"?we(t):null}function Jo(t){var o,e;if((t=t.__)!=null&&t.__c!=null){for(t.__e=t.__c.base=null,o=0;o<t.__k.length;o++)if((e=t.__k[o])!=null&&e.__e!=null){t.__e=t.__c.base=e.__e;break}return Jo(t)}}function Bo(t){(!t.__d&&(t.__d=!0)&&he.push(t)&&!Pt.__r++||$o!==I.debounceRendering)&&(($o=I.debounceRendering)||Uo)(Pt)}function Pt(){var t,o,e,n,i,r,s,a;for(he.sort(Kt);t=he.shift();)t.__d&&(o=he.length,n=void 0,r=(i=(e=t).__v).__e,s=[],a=[],e.__P&&((n=le({},i)).__v=i.__v+1,I.vnode&&I.vnode(n),to(e.__P,n,i,e.__n,e.__P.namespaceURI,32&i.__u?[r]:null,s,r??we(i),!!(32&i.__u),a),n.__v=i.__v,n.__.__k[n.__i]=n,Zo(s,n,a),n.__e!=r&&Jo(n)),he.length>o&&he.sort(Kt));Pt.__r=0}function Ko(t,o,e,n,i,r,s,a,c,d,m){var l,f,u,g,_,v=n&&n.__k||qo,h=o.length;for(e.__d=c,pi(e,o,v),c=e.__d,l=0;l<h;l++)(u=e.__k[l])!=null&&typeof u!="boolean"&&typeof u!="function"&&(f=u.__i===-1?Ne:v[u.__i]||Ne,u.__i=l,to(t,u,f,i,r,s,a,c,d,m),g=u.__e,u.ref&&f.ref!=u.ref&&(f.ref&&oo(f.ref,null,u),m.push(u.ref,u.__c||g,u)),_==null&&g!=null&&(_=g),65536&u.__u||f.__k===u.__k?c=Yo(u,c,t):typeof u.type=="function"&&u.__d!==void 0?c=u.__d:g&&(c=g.nextSibling),u.__d=void 0,u.__u&=-196609);e.__d=c,e.__e=_}function pi(t,o,e){var n,i,r,s,a,c=o.length,d=e.length,m=d,l=0;for(t.__k=[],n=0;n<c;n++)s=n+l,(i=t.__k[n]=(i=o[n])==null||typeof i=="boolean"||typeof i=="function"?null:typeof i=="string"||typeof i=="number"||typeof i=="bigint"||i.constructor==String?yt(null,i,null,null,null):eo(i)?yt(ce,{children:i},null,null,null):i.constructor===void 0&&i.__b>0?yt(i.type,i.props,i.key,i.ref?i.ref:null,i.__v):i)!=null?(i.__=t,i.__b=t.__b+1,a=ui(i,e,s,m),i.__i=a,r=null,a!==-1&&(m--,(r=e[a])&&(r.__u|=131072)),r==null||r.__v===null?(a==-1&&l--,typeof i.type!="function"&&(i.__u|=65536)):a!==s&&(a==s-1?l--:a==s+1?l++:a>s?m>c-s?l+=a-s:l--:a<s&&(a==s-l?l-=a-s:l++),a!==n+l&&(i.__u|=65536))):(r=e[s])&&r.key==null&&r.__e&&!(131072&r.__u)&&(r.__e==t.__d&&(t.__d=we(r)),jt(r,r,!1),e[s]=null,m--);if(m)for(n=0;n<d;n++)(r=e[n])!=null&&!(131072&r.__u)&&(r.__e==t.__d&&(t.__d=we(r)),jt(r,r))}function Yo(t,o,e){var n,i;if(typeof t.type=="function"){for(n=t.__k,i=0;n&&i<n.length;i++)n[i]&&(n[i].__=t,o=Yo(n[i],o,e));return o}t.__e!=o&&(o&&t.type&&!e.contains(o)&&(o=we(t)),e.insertBefore(t.__e,o||null),o=t.__e);do o=o&&o.nextSibling;while(o!=null&&o.nodeType===8);return o}function ui(t,o,e,n){var i=t.key,r=t.type,s=e-1,a=e+1,c=o[e];if(c===null||c&&i==c.key&&r===c.type&&!(131072&c.__u))return e;if(n>(c!=null&&!(131072&c.__u)?1:0))for(;s>=0||a<o.length;){if(s>=0){if((c=o[s])&&!(131072&c.__u)&&i==c.key&&r===c.type)return s;s--}if(a<o.length){if((c=o[a])&&!(131072&c.__u)&&i==c.key&&r===c.type)return a;a++}}return-1}function Fo(t,o,e){o[0]==="-"?t.setProperty(o,e??""):t[o]=e==null?"":typeof e!="number"||ci.test(o)?e:e+"px"}function bt(t,o,e,n,i){var r;e:if(o==="style")if(typeof e=="string")t.style.cssText=e;else{if(typeof n=="string"&&(t.style.cssText=n=""),n)for(o in n)e&&o in e||Fo(t.style,o,"");if(e)for(o in e)n&&e[o]===n[o]||Fo(t.style,o,e[o])}else if(o[0]==="o"&&o[1]==="n")r=o!==(o=o.replace(/(PointerCapture)$|Capture$/i,"$1")),o=o.toLowerCase()in t||o==="onFocusOut"||o==="onFocusIn"?o.toLowerCase().slice(2):o.slice(2),t.l||(t.l={}),t.l[o+r]=e,e?n?e.u=n.u:(e.u=Qt,t.addEventListener(o,r?Zt:Yt,r)):t.removeEventListener(o,r?Zt:Yt,r);else{if(i=="http://www.w3.org/2000/svg")o=o.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if(o!="width"&&o!="height"&&o!="href"&&o!="list"&&o!="form"&&o!="tabIndex"&&o!="download"&&o!="rowSpan"&&o!="colSpan"&&o!="role"&&o!="popover"&&o in t)try{t[o]=e??"";break e}catch{}typeof e=="function"||(e==null||e===!1&&o[4]!=="-"?t.removeAttribute(o):t.setAttribute(o,o=="popover"&&e==1?"":e))}}function zo(t){return function(o){if(this.l){var e=this.l[o.type+t];if(o.t==null)o.t=Qt++;else if(o.t<e.u)return;return e(I.event?I.event(o):o)}}}function to(t,o,e,n,i,r,s,a,c,d){var m,l,f,u,g,_,v,h,b,P,k,x,S,T,W,D,O=o.type;if(o.constructor!==void 0)return null;128&e.__u&&(c=!!(32&e.__u),r=[a=o.__e=e.__e]),(m=I.__b)&&m(o);e:if(typeof O=="function")try{if(h=o.props,b="prototype"in O&&O.prototype.render,P=(m=O.contextType)&&n[m.__c],k=m?P?P.props.value:m.__:n,e.__c?v=(l=o.__c=e.__c).__=l.__E:(b?o.__c=l=new O(h,k):(o.__c=l=new xt(h,k),l.constructor=O,l.render=fi),P&&P.sub(l),l.props=h,l.state||(l.state={}),l.context=k,l.__n=n,f=l.__d=!0,l.__h=[],l._sb=[]),b&&l.__s==null&&(l.__s=l.state),b&&O.getDerivedStateFromProps!=null&&(l.__s==l.state&&(l.__s=le({},l.__s)),le(l.__s,O.getDerivedStateFromProps(h,l.__s))),u=l.props,g=l.state,l.__v=o,f)b&&O.getDerivedStateFromProps==null&&l.componentWillMount!=null&&l.componentWillMount(),b&&l.componentDidMount!=null&&l.__h.push(l.componentDidMount);else{if(b&&O.getDerivedStateFromProps==null&&h!==u&&l.componentWillReceiveProps!=null&&l.componentWillReceiveProps(h,k),!l.__e&&(l.shouldComponentUpdate!=null&&l.shouldComponentUpdate(h,l.__s,k)===!1||o.__v===e.__v)){for(o.__v!==e.__v&&(l.props=h,l.state=l.__s,l.__d=!1),o.__e=e.__e,o.__k=e.__k,o.__k.forEach(function(L){L&&(L.__=o)}),x=0;x<l._sb.length;x++)l.__h.push(l._sb[x]);l._sb=[],l.__h.length&&s.push(l);break e}l.componentWillUpdate!=null&&l.componentWillUpdate(h,l.__s,k),b&&l.componentDidUpdate!=null&&l.__h.push(function(){l.componentDidUpdate(u,g,_)})}if(l.context=k,l.props=h,l.__P=t,l.__e=!1,S=I.__r,T=0,b){for(l.state=l.__s,l.__d=!1,S&&S(o),m=l.render(l.props,l.state,l.context),W=0;W<l._sb.length;W++)l.__h.push(l._sb[W]);l._sb=[]}else do l.__d=!1,S&&S(o),m=l.render(l.props,l.state,l.context),l.state=l.__s;while(l.__d&&++T<25);l.state=l.__s,l.getChildContext!=null&&(n=le(le({},n),l.getChildContext())),b&&!f&&l.getSnapshotBeforeUpdate!=null&&(_=l.getSnapshotBeforeUpdate(u,g)),Ko(t,eo(D=m!=null&&m.type===ce&&m.key==null?m.props.children:m)?D:[D],o,e,n,i,r,s,a,c,d),l.base=o.__e,o.__u&=-161,l.__h.length&&s.push(l),v&&(l.__E=l.__=null)}catch(L){if(o.__v=null,c||r!=null){for(o.__u|=c?160:32;a&&a.nodeType===8&&a.nextSibling;)a=a.nextSibling;r[r.indexOf(a)]=null,o.__e=a}else o.__e=e.__e,o.__k=e.__k;I.__e(L,o,e)}else r==null&&o.__v===e.__v?(o.__k=e.__k,o.__e=e.__e):o.__e=mi(e.__e,o,e,n,i,r,s,c,d);(m=I.diffed)&&m(o)}function Zo(t,o,e){o.__d=void 0;for(var n=0;n<e.length;n++)oo(e[n],e[++n],e[++n]);I.__c&&I.__c(o,t),t.some(function(i){try{t=i.__h,i.__h=[],t.some(function(r){r.call(i)})}catch(r){I.__e(r,i.__v)}})}function mi(t,o,e,n,i,r,s,a,c){var d,m,l,f,u,g,_,v=e.props,h=o.props,b=o.type;if(b==="svg"?i="http://www.w3.org/2000/svg":b==="math"?i="http://www.w3.org/1998/Math/MathML":i||(i="http://www.w3.org/1999/xhtml"),r!=null){for(d=0;d<r.length;d++)if((u=r[d])&&"setAttribute"in u==!!b&&(b?u.localName===b:u.nodeType===3)){t=u,r[d]=null;break}}if(t==null){if(b===null)return document.createTextNode(h);t=document.createElementNS(i,b,h.is&&h),r=null,a=!1}if(b===null)v===h||a&&t.data===h||(t.data=h);else{if(r=r&&kt.call(t.childNodes),v=e.props||Ne,!a&&r!=null)for(v={},d=0;d<t.attributes.length;d++)v[(u=t.attributes[d]).name]=u.value;for(d in v)if(u=v[d],d!="children"){if(d=="dangerouslySetInnerHTML")l=u;else if(d!=="key"&&!(d in h)){if(d=="value"&&"defaultValue"in h||d=="checked"&&"defaultChecked"in h)continue;bt(t,d,null,u,i)}}for(d in h)u=h[d],d=="children"?f=u:d=="dangerouslySetInnerHTML"?m=u:d=="value"?g=u:d=="checked"?_=u:d==="key"||a&&typeof u!="function"||v[d]===u||bt(t,d,u,v[d],i);if(m)a||l&&(m.__html===l.__html||m.__html===t.innerHTML)||(t.innerHTML=m.__html),o.__k=[];else if(l&&(t.innerHTML=""),Ko(t,eo(f)?f:[f],o,e,n,b==="foreignObject"?"http://www.w3.org/1999/xhtml":i,r,s,r?r[0]:e.__k&&we(e,0),a,c),r!=null)for(d=r.length;d--;)r[d]!=null&&Xo(r[d]);a||(d="value",g!==void 0&&(g!==t[d]||b==="progress"&&!g||b==="option"&&g!==v[d])&&bt(t,d,g,v[d],i),d="checked",_!==void 0&&_!==t[d]&&bt(t,d,_,v[d],i))}return t}function oo(t,o,e){try{if(typeof t=="function"){var n=typeof t.__u=="function";n&&t.__u(),n&&o==null||(t.__u=t(o))}else t.current=o}catch(i){I.__e(i,e)}}function jt(t,o,e){var n,i;if(I.unmount&&I.unmount(t),(n=t.ref)&&(n.current&&n.current!==t.__e||oo(n,null,o)),(n=t.__c)!=null){if(n.componentWillUnmount)try{n.componentWillUnmount()}catch(r){I.__e(r,o)}n.base=n.__P=null}if(n=t.__k)for(i=0;i<n.length;i++)n[i]&&jt(n[i],o,e||typeof t.type!="function");e||t.__e==null||Xo(t.__e),t.__c=t.__=t.__e=t.__d=void 0}function fi(t,o,e){return this.constructor(t,e)}function y(t,o,e){var n,i,r,s;I.__&&I.__(t,o),i=(n=typeof e=="function")?null:e&&e.__k||o.__k,r=[],s=[],to(o,t=(!n&&e||o).__k=di(ce,null,[t]),i||Ne,Ne,o.namespaceURI,!n&&e?[e]:i?null:o.firstChild?kt.call(o.childNodes):null,r,!n&&e?e:i?i.__e:o.firstChild,n,s),Zo(r,t,s)}kt=qo.slice,I={__e:function(t,o,e,n){for(var i,r,s;o=o.__;)if((i=o.__c)&&!i.__)try{if((r=i.constructor)&&r.getDerivedStateFromError!=null&&(i.setState(r.getDerivedStateFromError(t)),s=i.__d),i.componentDidCatch!=null&&(i.componentDidCatch(t,n||{}),s=i.__d),s)return i.__E=i}catch(a){t=a}throw t}},Go=0,ai=function(t){return t!=null&&t.constructor==null},xt.prototype.setState=function(t,o){var e;e=this.__s!=null&&this.__s!==this.state?this.__s:this.__s=le({},this.state),typeof t=="function"&&(t=t(le({},e),this.props)),t&&le(e,t),t!=null&&this.__v&&(o&&this._sb.push(o),Bo(this))},xt.prototype.forceUpdate=function(t){this.__v&&(this.__e=!0,t&&this.__h.push(t),Bo(this))},xt.prototype.render=ce,he=[],Uo=typeof Promise=="function"?Promise.prototype.then.bind(Promise.resolve()):setTimeout,Kt=function(t,o){return t.__v.__b-o.__v.__b},Pt.__r=0,Qt=0,Yt=zo(!1),Zt=zo(!0),li=0;var gi=0,ur=Array.isArray;function p(t,o,e,n,i,r){o||(o={});var s,a,c=o;if("ref"in c)for(a in c={},o)a=="ref"?s=o[a]:c[a]=o[a];var d={type:t,props:c,key:e,ref:s,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,constructor:void 0,__v:--gi,__i:-1,__u:0,__source:i,__self:r};if(typeof t=="function"&&(s=t.defaultProps))for(a in s)c[a]===void 0&&(c[a]=s[a]);return I.vnode&&I.vnode(d),d}var St=t=>{let{children:o,orientation:e="horizontal"}=t;return p("div",{className:`deck-widget-button-group ${e}`,children:o})};var Me,A,no,jo,He=0,an=[],V=I,Qo=V.__b,en=V.__r,tn=V.diffed,on=V.__c,nn=V.unmount,rn=V.__;function Ct(t,o){V.__h&&V.__h(A,t,He||o),He=0;var e=A.__H||(A.__H={__:[],__h:[]});return t>=e.__.length&&e.__.push({}),e.__[t]}function de(t){return He=1,hi(ln,t)}function hi(t,o,e){var n=Ct(Me++,2);if(n.t=t,!n.__c&&(n.__=[e?e(o):ln(void 0,o),function(a){var c=n.__N?n.__N[0]:n.__[0],d=n.t(c,a);c!==d&&(n.__N=[d,n.__[1]],n.__c.setState({}))}],n.__c=A,!A.u)){var i=function(a,c,d){if(!n.__c.__H)return!0;var m=n.__c.__H.__.filter(function(f){return!!f.__c});if(m.every(function(f){return!f.__N}))return!r||r.call(this,a,c,d);var l=!1;return m.forEach(function(f){if(f.__N){var u=f.__[0];f.__=f.__N,f.__N=void 0,u!==f.__[0]&&(l=!0)}}),!(!l&&n.__c.props===a)&&(!r||r.call(this,a,c,d))};A.u=!0;var r=A.shouldComponentUpdate,s=A.componentWillUpdate;A.componentWillUpdate=function(a,c,d){if(this.__e){var m=r;r=void 0,i(a,c,d),r=m}s&&s.call(this,a,c,d)},A.shouldComponentUpdate=i}return n.__N||n.__}function G(t,o){var e=Ct(Me++,3);!V.__s&&so(e.__H,o)&&(e.__=t,e.i=o,A.__H.__h.push(e))}function ro(t,o){var e=Ct(Me++,4);!V.__s&&so(e.__H,o)&&(e.__=t,e.i=o,A.__h.push(e))}function H(t){return He=5,oe(function(){return{current:t}},[])}function oe(t,o){var e=Ct(Me++,7);return so(e.__H,o)&&(e.__=t(),e.__H=o,e.__h=t),e.__}function ne(t,o){return He=8,oe(function(){return t},o)}function wi(){for(var t;t=an.shift();)if(t.__P&&t.__H)try{t.__H.__h.forEach(Tt),t.__H.__h.forEach(io),t.__H.__h=[]}catch(o){t.__H.__h=[],V.__e(o,t.__v)}}V.__b=function(t){A=null,Qo&&Qo(t)},V.__=function(t,o){t&&o.__k&&o.__k.__m&&(t.__m=o.__k.__m),rn&&rn(t,o)},V.__r=function(t){en&&en(t),Me=0;var o=(A=t.__c).__H;o&&(no===A?(o.__h=[],A.__h=[],o.__.forEach(function(e){e.__N&&(e.__=e.__N),e.i=e.__N=void 0})):(o.__h.forEach(Tt),o.__h.forEach(io),o.__h=[],Me=0)),no=A},V.diffed=function(t){tn&&tn(t);var o=t.__c;o&&o.__H&&(o.__H.__h.length&&(an.push(o)!==1&&jo===V.requestAnimationFrame||((jo=V.requestAnimationFrame)||vi)(wi)),o.__H.__.forEach(function(e){e.i&&(e.__H=e.i),e.i=void 0})),no=A=null},V.__c=function(t,o){o.some(function(e){try{e.__h.forEach(Tt),e.__h=e.__h.filter(function(n){return!n.__||io(n)})}catch(n){o.some(function(i){i.__h&&(i.__h=[])}),o=[],V.__e(n,e.__v)}}),on&&on(t,o)},V.unmount=function(t){nn&&nn(t);var o,e=t.__c;e&&e.__H&&(e.__H.__.forEach(function(n){try{Tt(n)}catch(i){o=i}}),e.__H=void 0,o&&V.__e(o,e.__v))};var sn=typeof requestAnimationFrame=="function";function vi(t){var o,e=function(){clearTimeout(n),sn&&cancelAnimationFrame(o),setTimeout(t)},n=setTimeout(e,100);sn&&(o=requestAnimationFrame(e))}function Tt(t){var o=A,e=t.__c;typeof e=="function"&&(t.__c=void 0,e()),A=o}function io(t){var o=A;t.__c=t.__(),A=o}function so(t,o){return!t||t.length!==o.length||o.some(function(e,n){return e!==t[n]})}function ln(t,o){return typeof o=="function"?o(t):o}function Lt(t){if(!t)return;let o=`url("${t.replace(/"/g,"'")}")`;return{maskImage:o,WebkitMaskImage:o}}var M=t=>{let{className:o="",style:e,color:n,icon:i,label:r,onClick:s,children:a}=t,c=oe(()=>{let d=Lt(i);return n?{...d,backgroundColor:n}:d},[n,i]);return p("div",{className:"deck-widget-button",style:e,children:p("button",{className:`deck-widget-icon-button ${o}`,type:"button",onClick:s,title:r,children:a||p("div",{className:"deck-widget-icon",style:c})})})};var $e=class extends ve.Widget{constructor(e={}){super(e);this.className="deck-widget-zoom";this.placement="top-left";this.setProps(this.props)}setProps(e){this.placement=e.placement??this.placement,this.viewId=e.viewId??this.viewId,super.setProps(e)}onRenderHTML(e){let n=p(St,{orientation:this.props.orientation,children:[p(M,{onClick:()=>this.handleZoomIn(),label:this.props.zoomInLabel,className:"deck-widget-zoom-in"}),p(M,{onClick:()=>this.handleZoomOut(),label:this.props.zoomOutLabel,className:"deck-widget-zoom-out"})]});y(n,e)}handleZoom(e,n){let i=this.getViewState(e);if(i){let{minZoom:s,maxZoom:a}=i;Number.isFinite(s)&&(n=Math.max(s,n)),Number.isFinite(a)&&(n=Math.min(a,n))}let r={...i,zoom:n};this.props.transitionDuration>0&&(r.transitionDuration=this.props.transitionDuration,r.transitionInterpolator="latitude"in r?new ve.FlyToInterpolator:new ve.LinearInterpolator({transitionProps:["zoom"]})),this.setViewState(e,r)}handleZoomIn(){let e=this.viewId?[this.viewId]:this.deck?.getViews().map(n=>n.id)??[];for(let n of e){let i=this.getViewState(n);this.handleZoom(n,i.zoom+1)}}handleZoomOut(){let e=this.viewId?[this.viewId]:this.deck?.getViews().map(n=>n.id)??[];for(let n of e){let i=this.getViewState(n);this.handleZoom(n,i.zoom-1)}}};$e.defaultProps={...ve.Widget.defaultProps,id:"zoom",placement:"top-left",orientation:"vertical",transitionDuration:200,zoomInLabel:"Zoom In",zoomOutLabel:"Zoom Out",viewId:null};var ao=R(E(),1);var Be=class extends ao.Widget{constructor(e={}){super(e);this.className="deck-widget-reset-view";this.placement="top-left";this.setProps(this.props)}setProps(e){this.placement=e.placement??this.placement,this.viewId=e.viewId??this.viewId,super.setProps(e)}onRenderHTML(e){y(p(M,{className:"deck-widget-reset-focus",label:this.props.label,onClick:this.handleClick.bind(this)}),e)}handleClick(){let e=this.props.initialViewState||this.deck?.props.initialViewState;this.resetViewState(e)}resetViewState(e){let n=this.viewId?[this.viewId]:this.deck?.getViews().map(i=>i.id)??[];for(let i of n){let r={...e?.[i]??e};this.setViewState(i,r)}}};Be.defaultProps={...ao.Widget.defaultProps,id:"reset-view",placement:"top-left",label:"Reset View",initialViewState:void 0,viewId:null};var ze=R(E(),1);var Fe=class extends ze.Widget{constructor(e={}){super(e);this.className="deck-widget-gimbal";this.placement="top-left";this.viewports={};this.setProps(this.props)}setProps(e){this.placement=e.placement??this.placement,this.viewId=e.viewId??this.viewId,super.setProps(e)}onRenderHTML(e){let n=this.viewId||Object.values(this.viewports)[0]?.id||"default-view",i=this.viewports[n],{rotationOrbit:r,rotationX:s}=this.getNormalizedRotation(i),a=p("div",{className:"deck-widget-button",style:{perspective:100,pointerEvents:"auto"},children:p("button",{type:"button",onClick:()=>{for(let c of Object.values(this.viewports))this.resetOrbitView(c)},title:this.props.label,style:{position:"relative",width:26,height:26},children:[p("svg",{className:"gimbal-outer-ring",width:"100%",height:"100%",viewBox:"0 0 26 26",style:{position:"absolute",top:0,left:0,transform:`rotateY(${r}deg)`},children:p("circle",{cx:"13",cy:"13",r:"10",stroke:"var(--icon-gimbal-outer-color, rgb(68, 92, 204))",strokeWidth:this.props.strokeWidth,fill:"none"})}),p("svg",{className:"gimbal-inner-ring",width:"100%",height:"100%",viewBox:"0 0 26 26",style:{position:"absolute",top:0,left:0,transform:`rotateX(${s}deg)`},children:p("circle",{cx:"13",cy:"13",r:"7",stroke:"var(--icon-gimbal-inner-color, rgb(240, 92, 68))",strokeWidth:this.props.strokeWidth,fill:"none"})})]})});y(a,e)}onViewportChange(e){this.viewports[e.id]=e,this.updateHTML()}resetOrbitView(e){let n=this.viewId||e?.id||"OrbitView",i=this.getViewState(n);if("rotationOrbit"in i||"rotationX"in i){let r={...i,rotationOrbit:0,rotationX:0,transitionDuration:this.props.transitionDuration,transitionInterpolator:new ze.LinearInterpolator({transitionProps:["rotationOrbit","rotationX"]})};this.setViewState(n,r)}}getNormalizedRotation(e){let n=this.viewId||e?.id||"OrbitView",i=this.getViewState(n),[r,s]=this.getRotation(i),a=cn(r),c=cn(s);return{rotationOrbit:a,rotationX:c}}getRotation(e){return e&&("rotationOrbit"in e||"rotationX"in e)?[-(e.rotationOrbit||0),e.rotationX||0]:[0,0]}};Fe.defaultProps={...ze.Widget.defaultProps,id:"gimbal",placement:"top-left",viewId:null,label:"Gimbal",strokeWidth:1.5,transitionDuration:200};function cn(t){let o=((t+180)%360+360)%360-180,e=10,n=o-90;return Math.abs(n)<e&&(n<e?o=90+e:n>-e&&(o=90-e)),o}var j=R(E(),1);var Ge=class extends j.Widget{constructor(e={}){super(e);this.className="deck-widget-compass";this.placement="top-left";this.viewports={};this.setProps(this.props)}setProps(e){this.placement=e.placement??this.placement,this.viewId=e.viewId??this.viewId,super.setProps(e)}onRenderHTML(e){let n=this.viewId||Object.values(this.viewports)[0]?.id,i=this.viewports[n],[r,s]=this.getRotation(i),a=p("div",{className:"deck-widget-button",style:{perspective:100},children:p("button",{type:"button",onClick:()=>{for(let c of Object.values(this.viewports))this.handleCompassReset(c)},title:this.props.label,style:{transform:`rotateX(${s}deg)`},children:p("svg",{fill:"none",width:"100%",height:"100%",viewBox:"0 0 26 26",children:p("g",{transform:`rotate(${r},13,13)`,children:[p("path",{d:"M10 13.0001L12.9999 5L15.9997 13.0001H10Z",fill:"var(--icon-compass-north-color, rgb(240, 92, 68))"}),p("path",{d:"M16.0002 12.9999L13.0004 21L10.0005 12.9999H16.0002Z",fill:"var(--icon-compass-south-color, rgb(204, 204, 204))"})]})})})});y(a,e)}onViewportChange(e){e.equals(this.viewports[e.id])||(this.viewports[e.id]=e,this.updateHTML())}getRotation(e){return e instanceof j.WebMercatorViewport?[-e.bearing,e.pitch]:e instanceof j._GlobeViewport?[0,Math.max(-80,Math.min(80,e.latitude))]:[0,0]}handleCompassReset(e){let n=this.viewId||e.id;if(e instanceof j.WebMercatorViewport){let r={...this.getViewState(n),bearing:0,...this.getRotation(e)[0]===0?{pitch:0}:{},transitionDuration:this.props.transitionDuration,transitionInterpolator:new j.FlyToInterpolator};this.setViewState(n,r)}}};Ge.defaultProps={...j.Widget.defaultProps,id:"compass",placement:"top-left",viewId:null,label:"Reset Compass",transitionDuration:200};var lo=R(E(),1);var Ue=class extends lo.Widget{constructor(e={}){super(e);this.className="deck-widget-scale";this.placement="bottom-left";this.scaleWidth=10;this.scaleValue=0;this.scaleText="";this.setProps(this.props)}setProps(e){this.placement=e.placement??this.placement,this.viewId=e.viewId??this.viewId,super.setProps(e)}onRenderHTML(e){let i=50+this.scaleWidth,r=10;y(p("svg",{className:"deck-widget-scale",width:i,height:30,style:{overflow:"visible",background:"transparent"},onClick:this.handleClick.bind(this),children:[p("text",{x:50+5,y:"10",textAnchor:"end",alignmentBaseline:"middle",style:{fontSize:"16px",fill:"black",fontWeight:"bold",fontFamily:"sans-serif"},children:this.scaleText}),p("line",{x1:50,y1:"15",x2:50+this.scaleWidth,y2:"15",stroke:"black",strokeWidth:"6"}),p("line",{x1:50,y1:"15",x2:50,y2:15-r,stroke:"black",strokeWidth:"6"}),p("line",{x1:50+this.scaleWidth,y1:"15",x2:50+this.scaleWidth,y2:15-r,stroke:"black",strokeWidth:"6"})]}),e)}onViewportChange(e){if(!("latitude"in e))return;let{latitude:n,zoom:i}=e,r=_i(n,i),{candidate:s,candidatePixels:a}=bi(r);this.scaleValue=s,this.scaleWidth=a,s>=1e3?this.scaleText=`${(s/1e3).toFixed(1)} km`:this.scaleText=`${s} m`,this.updateHTML()}handleClick(){}};Ue.defaultProps={...lo.Widget.defaultProps,id:"scale",placement:"bottom-left",label:"Scale",viewId:null};function _i(t,o){return 40075016686e-3*Math.cos(t*Math.PI/180)/Math.pow(2,o+8)}function bi(t){let i=150*t,r=Math.floor(Math.log10(i)),s=Math.pow(10,r),a=[1,2,5],c=a[0]*s,d=c/t;for(let m=0;m<a.length;m++){let l=a[m]*s,f=l/t;if(f>=100&&f<=200){c=l,d=f;break}if(f>200){c=m>0?a[m-1]*s:l,d=c/t;break}m===a.length-1&&f<100&&(c=a[0]*s*10,d=c/t)}return{candidate:c,candidatePixels:d}}var po=R(E(),1),At=R(E(),1);function yi(t){return typeof t=="string"?t:t.value}function xi(t){return typeof t=="string"?t:t.label}function Pi(t){return typeof t=="string"?void 0:t.icon}var Mt=t=>{let[o,e]=de(!1);return p(_e,{...t,style:{...t.style,position:"absolute"},isOpen:o,onClose:()=>e(!1),trigger:p("button",{className:"deck-widget-dropdown-button",onClick:()=>e(!o),children:p("span",{className:`deck-widget-dropdown-icon ${o?"open":""}`})})})},_e=t=>{let o=H(null);G(()=>{let n=i=>{o.current&&!o.current.contains(i.target)&&t.onClose()};return document.addEventListener("mousedown",n),()=>{document.removeEventListener("mousedown",n)}},[]);let e=(n,i)=>{n&&(typeof i=="object"&&i.onSelect?.(),t.onSelect?.(n),t.onClose())};return t.menuItems.length===0?null:p("div",{className:"deck-widget-dropdown-container",ref:o,children:[t.trigger,t.isOpen&&p("ul",{className:"deck-widget-dropdown-menu",style:t.style,children:t.menuItems.map((n,i)=>{let r=yi(n),s=Pi(n);return p("li",{className:`deck-widget-dropdown-item ${r?"":"disabled"}`,onClick:()=>e(r,n),children:[s&&p("span",{className:"deck-widget-dropdown-item-icon",style:Lt(s)}),xi(n)]},i)})})]})};var ki="current",dn="deck-geocoder-history",Wt=class{constructor(o){this.addressText="";this.errorText="";this.addressHistory=[];this.props={maxEntries:5,...o},this.addressHistory=this.loadPreviousAddresses()}async geocode(o,e,n){this.errorText="",this.addressText=e;try{let i=await o.geocode(e,n);if(i)return this.storeAddress(this.addressText),i;this.errorText="Invalid address"}catch(i){this.errorText=`${i.message}`}return null}loadPreviousAddresses(){try{let o=window.localStorage.getItem(dn),e=o&&JSON.parse(o);return Array.isArray(e)?e.filter(i=>typeof i=="string"):[]}catch{}return[]}storeAddress(o){let e=o.trim();if(!e||e===ki)return;let n=[e,...this.addressHistory.filter(i=>i!==e)];this.addressHistory=n.slice(0,this.props.maxEntries);try{window.localStorage.setItem(dn,JSON.stringify(this.addressHistory))}catch{}}};var Si="https://maps.googleapis.com/maps/api/geocode/json",Ti="https://api.mapbox.com/geocoding/v5/mapbox.places",Ci="https://api.opencagedata.com/geocode/v1/json",It={name:"google",requiresApiKey:!0,async geocode(t,o){let e=encodeURIComponent(t),n=await co(`${Si}?address=${e}&key=${o}`);switch(n.status){case"OK":let i=n.results.length>0&&n.results[0].geometry.location;return i?{longitude:i.lng,latitude:i.lat}:null;default:throw new Error(`Google Geocoder failed: ${n.status}`)}}},Rt={name:"google",requiresApiKey:!0,async geocode(t,o){let e=encodeURIComponent(t),n=await co(`${Ti}/${e}.json?access_token=${o}`);if(Array.isArray(n.features)&&n.features.length>0){let i=n.features[0].center;if(Array.isArray(i)&&i.length>=2)return{longitude:i[0],latitude:i[1]}}return null}},Et={name:"opencage",requiresApiKey:!0,async geocode(t,o){let e=encodeURIComponent(t),n=await co(`${Ci}?q=${e}&key=${o}`);if(Array.isArray(n.results)&&n.results.length>0){let i=n.results[0].geometry;return{longitude:i.lng,latitude:i.lat}}return null}},Ot={name:"current",requiresApiKey:!1,async geocode(){if(!navigator.geolocation)throw new Error("Geolocation not supported");return new Promise((t,o)=>{navigator.geolocation.getCurrentPosition(e=>{let{longitude:n,latitude:i}=e.coords;t({longitude:n,latitude:i})},e=>o(new Error(e.message)))})}};async function co(t){let o;try{o=await fetch(t)}catch(n){throw new Error(`CORS error? ${n}. ${t}: `)}if(!o.ok)throw new Error(`${o.statusText}. ${t}: `);let e=await o.json();if(!e)throw new Error(`No data returned. ${t}`);return e}var We={name:"coordinates",requiresApiKey:!1,placeholderLocation:"-122.45, 37.8 or 37\xB048'N, 122\xB027'W",async geocode(t){return Li(t)||null}};function Li(t){t=t.trim();let o=t.split(/[,;]/).map(i=>i.trim());if(o.length<2)return null;let e=pn(o[0]),n=pn(o[1]);return e===null||n===null?null:Math.abs(e)>90&&Math.abs(n)<=90?{longitude:e,latitude:n}:Math.abs(n)>90&&Math.abs(e)<=90?{longitude:n,latitude:e}:{latitude:e,longitude:n}}function pn(t){if(t=t.trim(),t.includes("\xB0")||t.includes("'")||t.includes('"')){let n=Mi(t);return isNaN(n)?null:n}let o=1;/[SW]/i.test(t)&&(o=-1),t=t.replace(/[NSEW]/gi,"");let e=parseFloat(t);return isNaN(e)?null:o*e}function Mi(t){let o=/(\d+)[°d]\s*(\d+)?['′m]?\s*(\d+(?:\.\d+)?)?[\"″s]?\s*([NSEW])?/i,e=t.match(o);if(!e)return NaN;let n=parseFloat(e[1])||0,i=parseFloat(e[2])||0,r=parseFloat(e[3])||0,s=e[4]||"",a=n+i/60+r/3600;return/[SW]/i.test(s)&&(a=-a),a}var un="current",Wi="data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 -960 960 960'%3E%3Cpath d='M480-480q33 0 56.5-23.5T560-560q0-33-23.5-56.5T480-640q-33 0-56.5 23.5T400-560q0 33 23.5 56.5T480-480Zm0 294q122-112 181-203.5T720-552q0-109-69.5-178.5T480-800q-101 0-170.5 69.5T240-552q0 71 59 162.5T480-186Zm0 106Q319-217 239.5-334.5T160-552q0-150 96.5-239T480-880q127 0 223.5 89T800-552q0 100-79.5 217.5T480-80Z'/%3E%3C/svg%3E",Ii={label:"Current location",value:un,icon:Wi},qe=class extends po.Widget{constructor(e={}){super(e);this.className="deck-widget-geocoder";this.placement="top-left";this.geocodeHistory=new Wt({});this.addressText="";this.geocoder=We;this.isGettingLocation=!1;this.setInput=e=>{this.addressText=e};this.handleKeyPress=e=>{e.key==="Enter"&&this.handleSubmit()};this.handleSelect=e=>{e===un?this.getCurrentLocation():(this.setInput(e),this.handleSubmit())};this.handleSubmit=()=>{this.geocode(this.addressText)};this.getCurrentLocation=async()=>{this.isGettingLocation=!0,this.rootElement&&this.updateHTML();try{let e=await Ot.geocode();e&&this.flyTo(e)}catch(e){this.geocodeHistory.errorText=e instanceof Error?e.message:"Location error"}finally{this.isGettingLocation=!1,this.rootElement&&this.updateHTML()}};this.geocode=async e=>{let n=await this.geocodeHistory.geocode(this.geocoder,this.addressText,this.props.apiKey);this.rootElement&&this.updateHTML(),n&&this.flyTo(n)};this.setProps(this.props)}setProps(e){if(this.placement=e.placement??this.placement,this.viewId=e.viewId??this.viewId,this.geocoder=Ri(this.props),this.geocoder.requiresApiKey&&!this.props.apiKey)throw new Error(`API key is required for the ${this.geocoder.name} geocoder`);super.setProps(e)}onRenderHTML(e){let n=this.props._geolocation?[Ii,...this.geocodeHistory.addressHistory]:[...this.geocodeHistory.addressHistory];y(p("div",{className:"deck-widget-geocoder",children:[p("input",{className:"deck-widget-geocoder-input",type:"text",placeholder:this.isGettingLocation?"Finding your location...":this.geocoder.placeholderLocation??"Enter address or location",value:this.geocodeHistory.addressText,onInput:i=>this.setInput(i.target?.value||""),onKeyPress:this.handleKeyPress}),p(Mt,{menuItems:n,onSelect:this.handleSelect}),this.geocodeHistory.errorText&&p("div",{className:"deck-widget-geocoder-error",children:this.geocodeHistory.errorText})]}),e)}flyTo(e){let n=this.viewId?[this.viewId]:this.deck?.getViews().map(i=>i.id)??[];for(let i of n){let s={...this.getViewState(i),...e};this.props.transitionDuration>0&&(s.transitionDuration=this.props.transitionDuration,s.transitionInterpolator="latitude"in s?new At.FlyToInterpolator:new At.LinearInterpolator),this.setViewState(i,s)}}};qe.defaultProps={...po.Widget.defaultProps,id:"geocoder",viewId:null,placement:"top-left",label:"Geocoder",transitionDuration:200,geocoder:"coordinates",customGeocoder:We,apiKey:"",_geolocation:!1};function Ri(t){switch(t.geocoder){case"google":return It;case"mapbox":return Rt;case"opencage":return Et;case"coordinates":return We;case"custom":if(!t.customGeocoder)throw new Error("Custom geocoder is not defined");return t.customGeocoder;default:throw new Error(`Unknown geocoder: ${t.geocoder}`)}}var Je=R(E(),1);var Xe=class extends Je.Widget{constructor(e={}){super(e);this.className="deck-widget-fullscreen";this.placement="top-left";this.fullscreen=!1;this.setProps(this.props)}onAdd(){document.addEventListener("fullscreenchange",this.onFullscreenChange.bind(this))}onRemove(){document.removeEventListener("fullscreenchange",this.onFullscreenChange.bind(this))}onRenderHTML(e){y(p(M,{onClick:()=>{this.handleClick().catch(n=>Je.log.error(n)())},label:this.fullscreen?this.props.exitLabel:this.props.enterLabel,className:this.fullscreen?"deck-widget-fullscreen-exit":"deck-widget-fullscreen-enter"}),e)}setProps(e){this.placement=e.placement??this.placement,this.viewId=e.viewId??this.viewId,super.setProps(e)}getContainer(){return this.props.container||this.deck?.props.parent||this.deck?.getCanvas()?.parentElement}onFullscreenChange(){let e=this.fullscreen,n=document.fullscreenElement===this.getContainer();e!==n&&(this.fullscreen=!this.fullscreen),this.updateHTML()}async handleClick(){this.fullscreen?await this.exitFullscreen():await this.requestFullscreen(),this.updateHTML()}async requestFullscreen(){let e=this.getContainer();e?.requestFullscreen?await e.requestFullscreen({navigationUI:"hide"}):this.togglePseudoFullscreen()}async exitFullscreen(){document.exitFullscreen?await document.exitFullscreen():this.togglePseudoFullscreen()}togglePseudoFullscreen(){this.getContainer()?.classList.toggle("deck-pseudo-fullscreen")}};Xe.defaultProps={...Je.Widget.defaultProps,id:"fullscreen",placement:"top-left",viewId:null,enterLabel:"Enter Fullscreen",exitLabel:"Exit Fullscreen",container:void 0};var Ye=R(E(),1);function mn(t){let o=[],e=i=>"views"in i;function n(i){let r=o.length,s=i.minSplit??.05,a=i.maxSplit??.95,c=Math.min(Math.max(i.initialSplit??.5,s),a),d={id:r,orientation:i.orientation,views:i.views,split:c,editable:i.editable??!0,minSplit:s,maxSplit:a,x:0,y:0,width:0,height:0};return o.push(d),d.views=[e(i.views[0])?n(i.views[0]):i.views[0],e(i.views[1])?n(i.views[1]):i.views[1]],d}return n(t),o}function fn(t){let o=[];function e(n,i,r,s,a){n.x=i,n.y=r,n.width=s,n.height=a;let c=i,d=r,m=s,l=a,f=i,u=r,g=s,_=a;n.orientation==="horizontal"?(m=s*n.split,f=i+m,g=s-m):(l=a*n.split,u=r+l,_=a-l);let[v,h]=n.views;"views"in v?e(v,c,d,m,l):o.push(v.clone({x:`${c}%`,y:`${d}%`,width:`${m}%`,height:`${l}%`})),"views"in h?e(h,f,u,g,_):o.push(h.clone({x:`${f}%`,y:`${u}%`,width:`${g}%`,height:`${_}%`}))}return e(t,0,0,100,100),o}var Ke=class extends Ye.Widget{constructor(e){super(e);this.className="deck-widget-splitter";this.placement="fill";this.needsUpdate=!0;this.viewLayouts=mn(this.props.viewLayout)}setProps(e){e.viewLayout&&!(0,Ye._deepEqual)(e.viewLayout,this.props.viewLayout,-1)&&(this.viewLayouts=mn(e.viewLayout),this.views=void 0),super.setProps(e)}onRedraw(){super.updateHTML()}updateHTML(){this.views||(this.views=fn(this.viewLayouts[0]),this.props.onChange(this.views.slice())),requestAnimationFrame(()=>{this.doUpdate()})}doUpdate(){if(this.deck){let e=this.deck.props.views;!(e&&e!==this.lastViews)&&this.lastViews!==this.views&&(this.lastViews=this.views,this.deck.setProps({views:this.views}))}}onChange(e,n){n.split=e,this.views=fn(this.viewLayouts[0]),this.props.onChange(this.views.slice()),this.doUpdate()}onRenderHTML(e){y(p(ce,{children:this.viewLayouts.map(n=>n.editable&&p(Ei,{...n,onChange:i=>this.onChange(i,n),onDragStart:()=>this.props.onDragStart(),onDragEnd:()=>this.props.onDragStart()}))}),e)}};Ke.defaultProps={...Ye.Widget.defaultProps,id:"splitter-widget",viewLayout:void 0,onChange:()=>{},onDragStart:()=>{},onDragEnd:()=>{}};function Ei({orientation:t,x:o,y:e,width:n,height:i,split:r,minSplit:s,maxSplit:a,onChange:c,onDragStart:d,onDragEnd:m}){let[l,f]=de(!1),u=H(null);G(()=>{if(!l)return;let h=P=>{if(!u.current)return;let k=u.current.getBoundingClientRect(),x;t==="horizontal"?x=(P.clientX-k.left)/k.width:x=(P.clientY-k.top)/k.height,x=Math.min(Math.max(x,s),a),c?.(x)},b=()=>{m?.(),f(!1)};return document.addEventListener("pointermove",h),document.addEventListener("pointerup",b),document.addEventListener("pointerleave",b),()=>{document.removeEventListener("pointermove",h),document.removeEventListener("pointerup",b),document.removeEventListener("pointerleave",b)}},[l]);let g=h=>{f(!0),d?.(),h.preventDefault()},_=t==="horizontal"?{left:`${r*100}%`}:{top:`${r*100}%`},v={position:"absolute",top:`${e}%`,left:`${o}%`,width:`${n}%`,height:`${i}%`};return p("div",{ref:u,style:v,children:p("div",{className:`deck-widget-splitter-handle deck-widget-splitter-handle--${t} ${l?"active":""}`,style:_,onPointerDown:g})})}var bo=R(E(),1);var pe=Math.min,ie=Math.max,je=Math.round,Qe=Math.floor,J=t=>({x:t,y:t}),Oi={left:"right",right:"left",bottom:"top",top:"bottom"};function Dt(t,o,e){return ie(t,pe(o,e))}function Ie(t,o){return typeof t=="function"?t(o):t}function ue(t){return t.split("-")[0]}function Re(t){return t.split("-")[1]}function uo(t){return t==="x"?"y":"x"}function Nt(t){return t==="y"?"height":"width"}function re(t){let o=t[0];return o==="t"||o==="b"?"y":"x"}function Ht(t){return uo(re(t))}function wn(t,o,e){e===void 0&&(e=!1);let n=Re(t),i=Ht(t),r=Nt(i),s=i==="x"?n===(e?"end":"start")?"right":"left":n==="start"?"bottom":"top";return o.reference[r]>o.floating[r]&&(s=Ze(s)),[s,Ze(s)]}function vn(t){let o=Ze(t);return[Vt(t),o,Vt(o)]}function Vt(t){return t.includes("start")?t.replace("start","end"):t.replace("end","start")}var gn=["left","right"],hn=["right","left"],Ai=["top","bottom"],Vi=["bottom","top"];function Di(t,o,e){switch(t){case"top":case"bottom":return e?o?hn:gn:o?gn:hn;case"left":case"right":return o?Ai:Vi;default:return[]}}function _n(t,o,e,n){let i=Re(t),r=Di(ue(t),e==="start",n);return i&&(r=r.map(s=>s+"-"+i),o&&(r=r.concat(r.map(Vt)))),r}function Ze(t){let o=ue(t);return Oi[o]+t.slice(o.length)}function Ni(t){return{top:0,right:0,bottom:0,left:0,...t}}function mo(t){return typeof t!="number"?Ni(t):{top:t,right:t,bottom:t,left:t}}function be(t){let{x:o,y:e,width:n,height:i}=t;return{width:n,height:i,top:e,left:o,right:o+n,bottom:e+i,x:o,y:e}}function bn(t,o,e){let{reference:n,floating:i}=t,r=re(o),s=Ht(o),a=Nt(s),c=ue(o),d=r==="y",m=n.x+n.width/2-i.width/2,l=n.y+n.height/2-i.height/2,f=n[a]/2-i[a]/2,u;switch(c){case"top":u={x:m,y:n.y-i.height};break;case"bottom":u={x:m,y:n.y+n.height};break;case"right":u={x:n.x+n.width,y:l};break;case"left":u={x:n.x-i.width,y:l};break;default:u={x:n.x,y:n.y}}switch(Re(o)){case"start":u[s]-=f*(e&&d?-1:1);break;case"end":u[s]+=f*(e&&d?-1:1);break}return u}async function yn(t,o){var e;o===void 0&&(o={});let{x:n,y:i,platform:r,rects:s,elements:a,strategy:c}=t,{boundary:d="clippingAncestors",rootBoundary:m="viewport",elementContext:l="floating",altBoundary:f=!1,padding:u=0}=Ie(o,t),g=mo(u),v=a[f?l==="floating"?"reference":"floating":l],h=be(await r.getClippingRect({element:(e=await(r.isElement==null?void 0:r.isElement(v)))==null||e?v:v.contextElement||await(r.getDocumentElement==null?void 0:r.getDocumentElement(a.floating)),boundary:d,rootBoundary:m,strategy:c})),b=l==="floating"?{x:n,y:i,width:s.floating.width,height:s.floating.height}:s.reference,P=await(r.getOffsetParent==null?void 0:r.getOffsetParent(a.floating)),k=await(r.isElement==null?void 0:r.isElement(P))?await(r.getScale==null?void 0:r.getScale(P))||{x:1,y:1}:{x:1,y:1},x=be(r.convertOffsetParentRelativeRectToViewportRelativeRect?await r.convertOffsetParentRelativeRectToViewportRelativeRect({elements:a,rect:b,offsetParent:P,strategy:c}):b);return{top:(h.top-x.top+g.top)/k.y,bottom:(x.bottom-h.bottom+g.bottom)/k.y,left:(h.left-x.left+g.left)/k.x,right:(x.right-h.right+g.right)/k.x}}var Hi=50,xn=async(t,o,e)=>{let{placement:n="bottom",strategy:i="absolute",middleware:r=[],platform:s}=e,a=s.detectOverflow?s:{...s,detectOverflow:yn},c=await(s.isRTL==null?void 0:s.isRTL(o)),d=await s.getElementRects({reference:t,floating:o,strategy:i}),{x:m,y:l}=bn(d,n,c),f=n,u=0,g={};for(let _=0;_<r.length;_++){let v=r[_];if(!v)continue;let{name:h,fn:b}=v,{x:P,y:k,data:x,reset:S}=await b({x:m,y:l,initialPlacement:n,placement:f,strategy:i,middlewareData:g,rects:d,platform:a,elements:{reference:t,floating:o}});m=P??m,l=k??l,g[h]={...g[h],...x},S&&u<Hi&&(u++,typeof S=="object"&&(S.placement&&(f=S.placement),S.rects&&(d=S.rects===!0?await s.getElementRects({reference:t,floating:o,strategy:i}):S.rects),{x:m,y:l}=bn(d,f,c)),_=-1)}return{x:m,y:l,placement:f,strategy:i,middlewareData:g}},Pn=t=>({name:"arrow",options:t,async fn(o){let{x:e,y:n,placement:i,rects:r,platform:s,elements:a,middlewareData:c}=o,{element:d,padding:m=0}=Ie(t,o)||{};if(d==null)return{};let l=mo(m),f={x:e,y:n},u=Ht(i),g=Nt(u),_=await s.getDimensions(d),v=u==="y",h=v?"top":"left",b=v?"bottom":"right",P=v?"clientHeight":"clientWidth",k=r.reference[g]+r.reference[u]-f[u]-r.floating[g],x=f[u]-r.reference[u],S=await(s.getOffsetParent==null?void 0:s.getOffsetParent(d)),T=S?S[P]:0;(!T||!await(s.isElement==null?void 0:s.isElement(S)))&&(T=a.floating[P]||r.floating[g]);let W=k/2-x/2,D=T/2-_[g]/2-1,O=pe(l[h],D),L=pe(l[b],D),ee=O,ge=T-_[g]-L,N=T/2-_[g]/2+W,te=Dt(ee,N,ge),X=!c.arrow&&Re(i)!=null&&N!==te&&r.reference[g]/2-(N<ee?O:L)-_[g]/2<0,B=X?N<ee?N-ee:N-ge:0;return{[u]:f[u]+B,data:{[u]:te,centerOffset:N-te-B,...X&&{alignmentOffset:B}},reset:X}}});var kn=function(t){return t===void 0&&(t={}),{name:"flip",options:t,async fn(o){var e,n;let{placement:i,middlewareData:r,rects:s,initialPlacement:a,platform:c,elements:d}=o,{mainAxis:m=!0,crossAxis:l=!0,fallbackPlacements:f,fallbackStrategy:u="bestFit",fallbackAxisSideDirection:g="none",flipAlignment:_=!0,...v}=Ie(t,o);if((e=r.arrow)!=null&&e.alignmentOffset)return{};let h=ue(i),b=re(a),P=ue(a)===a,k=await(c.isRTL==null?void 0:c.isRTL(d.floating)),x=f||(P||!_?[Ze(a)]:vn(a)),S=g!=="none";!f&&S&&x.push(..._n(a,_,g,k));let T=[a,...x],W=await c.detectOverflow(o,v),D=[],O=((n=r.flip)==null?void 0:n.overflows)||[];if(m&&D.push(W[h]),l){let N=wn(i,s,k);D.push(W[N[0]],W[N[1]])}if(O=[...O,{placement:i,overflows:D}],!D.every(N=>N<=0)){var L,ee;let N=(((L=r.flip)==null?void 0:L.index)||0)+1,te=T[N];if(te&&(!(l==="alignment"?b!==re(te):!1)||O.every($=>re($.placement)===b?$.overflows[0]>0:!0)))return{data:{index:N,overflows:O},reset:{placement:te}};let X=(ee=O.filter(B=>B.overflows[0]<=0).sort((B,$)=>B.overflows[1]-$.overflows[1])[0])==null?void 0:ee.placement;if(!X)switch(u){case"bestFit":{var ge;let B=(ge=O.filter($=>{if(S){let z=re($.placement);return z===b||z==="y"}return!0}).map($=>[$.placement,$.overflows.filter(z=>z>0).reduce((z,Jt)=>z+Jt,0)]).sort(($,z)=>$[1]-z[1])[0])==null?void 0:ge[0];B&&(X=B);break}case"initialPlacement":X=a;break}if(i!==X)return{reset:{placement:X}}}return{}}}};var $i=new Set(["left","top"]);async function Bi(t,o){let{placement:e,platform:n,elements:i}=t,r=await(n.isRTL==null?void 0:n.isRTL(i.floating)),s=ue(e),a=Re(e),c=re(e)==="y",d=$i.has(s)?-1:1,m=r&&c?-1:1,l=Ie(o,t),{mainAxis:f,crossAxis:u,alignmentAxis:g}=typeof l=="number"?{mainAxis:l,crossAxis:0,alignmentAxis:null}:{mainAxis:l.mainAxis||0,crossAxis:l.crossAxis||0,alignmentAxis:l.alignmentAxis};return a&&typeof g=="number"&&(u=a==="end"?g*-1:g),c?{x:u*m,y:f*d}:{x:f*d,y:u*m}}var Sn=function(t){return t===void 0&&(t=0),{name:"offset",options:t,async fn(o){var e,n;let{x:i,y:r,placement:s,middlewareData:a}=o,c=await Bi(o,t);return s===((e=a.offset)==null?void 0:e.placement)&&(n=a.arrow)!=null&&n.alignmentOffset?{}:{x:i+c.x,y:r+c.y,data:{...c,placement:s}}}}},Tn=function(t){return t===void 0&&(t={}),{name:"shift",options:t,async fn(o){let{x:e,y:n,placement:i,platform:r}=o,{mainAxis:s=!0,crossAxis:a=!1,limiter:c={fn:h=>{let{x:b,y:P}=h;return{x:b,y:P}}},...d}=Ie(t,o),m={x:e,y:n},l=await r.detectOverflow(o,d),f=re(ue(i)),u=uo(f),g=m[u],_=m[f];if(s){let h=u==="y"?"top":"left",b=u==="y"?"bottom":"right",P=g+l[h],k=g-l[b];g=Dt(P,g,k)}if(a){let h=f==="y"?"top":"left",b=f==="y"?"bottom":"right",P=_+l[h],k=_-l[b];_=Dt(P,_,k)}let v=c.fn({...o,[u]:g,[f]:_});return{...v,data:{x:v.x-e,y:v.y-n,enabled:{[u]:s,[f]:a}}}}}};function $t(){return typeof window<"u"}function xe(t){return Ln(t)?(t.nodeName||"").toLowerCase():"#document"}function F(t){var o;return(t==null||(o=t.ownerDocument)==null?void 0:o.defaultView)||window}function K(t){var o;return(o=(Ln(t)?t.ownerDocument:t.document)||window.document)==null?void 0:o.documentElement}function Ln(t){return $t()?t instanceof Node||t instanceof F(t).Node:!1}function U(t){return $t()?t instanceof Element||t instanceof F(t).Element:!1}function Q(t){return $t()?t instanceof HTMLElement||t instanceof F(t).HTMLElement:!1}function Cn(t){return!$t()||typeof ShadowRoot>"u"?!1:t instanceof ShadowRoot||t instanceof F(t).ShadowRoot}function Oe(t){let{overflow:o,overflowX:e,overflowY:n,display:i}=q(t);return/auto|scroll|overlay|hidden|clip/.test(o+n+e)&&i!=="inline"&&i!=="contents"}function Mn(t){return/^(table|td|th)$/.test(xe(t))}function et(t){try{if(t.matches(":popover-open"))return!0}catch{}try{return t.matches(":modal")}catch{return!1}}var Fi=/transform|translate|scale|rotate|perspective|filter/,zi=/paint|layout|strict|content/,ye=t=>!!t&&t!=="none",fo;function Bt(t){let o=U(t)?q(t):t;return ye(o.transform)||ye(o.translate)||ye(o.scale)||ye(o.rotate)||ye(o.perspective)||!Ft()&&(ye(o.backdropFilter)||ye(o.filter))||Fi.test(o.willChange||"")||zi.test(o.contain||"")}function Wn(t){let o=se(t);for(;Q(o)&&!Pe(o);){if(Bt(o))return o;if(et(o))return null;o=se(o)}return null}function Ft(){return fo==null&&(fo=typeof CSS<"u"&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),fo}function Pe(t){return/^(html|body|#document)$/.test(xe(t))}function q(t){return F(t).getComputedStyle(t)}function tt(t){return U(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.scrollX,scrollTop:t.scrollY}}function se(t){if(xe(t)==="html")return t;let o=t.assignedSlot||t.parentNode||Cn(t)&&t.host||K(t);return Cn(o)?o.host:o}function In(t){let o=se(t);return Pe(o)?t.ownerDocument?t.ownerDocument.body:t.body:Q(o)&&Oe(o)?o:In(o)}function Ee(t,o,e){var n;o===void 0&&(o=[]),e===void 0&&(e=!0);let i=In(t),r=i===((n=t.ownerDocument)==null?void 0:n.body),s=F(i);if(r){let a=zt(s);return o.concat(s,s.visualViewport||[],Oe(i)?i:[],a&&e?Ee(a):[])}else return o.concat(i,Ee(i,[],e))}function zt(t){return t.parent&&Object.getPrototypeOf(t.parent)?t.frameElement:null}function An(t){let o=q(t),e=parseFloat(o.width)||0,n=parseFloat(o.height)||0,i=Q(t),r=i?t.offsetWidth:e,s=i?t.offsetHeight:n,a=je(e)!==r||je(n)!==s;return a&&(e=r,n=s),{width:e,height:n,$:a}}function ho(t){return U(t)?t:t.contextElement}function Ae(t){let o=ho(t);if(!Q(o))return J(1);let e=o.getBoundingClientRect(),{width:n,height:i,$:r}=An(o),s=(r?je(e.width):e.width)/n,a=(r?je(e.height):e.height)/i;return(!s||!Number.isFinite(s))&&(s=1),(!a||!Number.isFinite(a))&&(a=1),{x:s,y:a}}var Gi=J(0);function Vn(t){let o=F(t);return!Ft()||!o.visualViewport?Gi:{x:o.visualViewport.offsetLeft,y:o.visualViewport.offsetTop}}function Ui(t,o,e){return o===void 0&&(o=!1),!e||o&&e!==F(t)?!1:o}function ke(t,o,e,n){o===void 0&&(o=!1),e===void 0&&(e=!1);let i=t.getBoundingClientRect(),r=ho(t),s=J(1);o&&(n?U(n)&&(s=Ae(n)):s=Ae(t));let a=Ui(r,e,n)?Vn(r):J(0),c=(i.left+a.x)/s.x,d=(i.top+a.y)/s.y,m=i.width/s.x,l=i.height/s.y;if(r){let f=F(r),u=n&&U(n)?F(n):n,g=f,_=zt(g);for(;_&&n&&u!==g;){let v=Ae(_),h=_.getBoundingClientRect(),b=q(_),P=h.left+(_.clientLeft+parseFloat(b.paddingLeft))*v.x,k=h.top+(_.clientTop+parseFloat(b.paddingTop))*v.y;c*=v.x,d*=v.y,m*=v.x,l*=v.y,c+=P,d+=k,g=F(_),_=zt(g)}}return be({width:m,height:l,x:c,y:d})}function Gt(t,o){let e=tt(t).scrollLeft;return o?o.left+e:ke(K(t)).left+e}function Dn(t,o){let e=t.getBoundingClientRect(),n=e.left+o.scrollLeft-Gt(t,e),i=e.top+o.scrollTop;return{x:n,y:i}}function qi(t){let{elements:o,rect:e,offsetParent:n,strategy:i}=t,r=i==="fixed",s=K(n),a=o?et(o.floating):!1;if(n===s||a&&r)return e;let c={scrollLeft:0,scrollTop:0},d=J(1),m=J(0),l=Q(n);if((l||!l&&!r)&&((xe(n)!=="body"||Oe(s))&&(c=tt(n)),l)){let u=ke(n);d=Ae(n),m.x=u.x+n.clientLeft,m.y=u.y+n.clientTop}let f=s&&!l&&!r?Dn(s,c):J(0);return{width:e.width*d.x,height:e.height*d.y,x:e.x*d.x-c.scrollLeft*d.x+m.x+f.x,y:e.y*d.y-c.scrollTop*d.y+m.y+f.y}}function Xi(t){return Array.from(t.getClientRects())}function Ji(t){let o=K(t),e=tt(t),n=t.ownerDocument.body,i=ie(o.scrollWidth,o.clientWidth,n.scrollWidth,n.clientWidth),r=ie(o.scrollHeight,o.clientHeight,n.scrollHeight,n.clientHeight),s=-e.scrollLeft+Gt(t),a=-e.scrollTop;return q(n).direction==="rtl"&&(s+=ie(o.clientWidth,n.clientWidth)-i),{width:i,height:r,x:s,y:a}}var Rn=25;function Ki(t,o){let e=F(t),n=K(t),i=e.visualViewport,r=n.clientWidth,s=n.clientHeight,a=0,c=0;if(i){r=i.width,s=i.height;let m=Ft();(!m||m&&o==="fixed")&&(a=i.offsetLeft,c=i.offsetTop)}let d=Gt(n);if(d<=0){let m=n.ownerDocument,l=m.body,f=getComputedStyle(l),u=m.compatMode==="CSS1Compat"&&parseFloat(f.marginLeft)+parseFloat(f.marginRight)||0,g=Math.abs(n.clientWidth-l.clientWidth-u);g<=Rn&&(r-=g)}else d<=Rn&&(r+=d);return{width:r,height:s,x:a,y:c}}function Yi(t,o){let e=ke(t,!0,o==="fixed"),n=e.top+t.clientTop,i=e.left+t.clientLeft,r=Q(t)?Ae(t):J(1),s=t.clientWidth*r.x,a=t.clientHeight*r.y,c=i*r.x,d=n*r.y;return{width:s,height:a,x:c,y:d}}function En(t,o,e){let n;if(o==="viewport")n=Ki(t,e);else if(o==="document")n=Ji(K(t));else if(U(o))n=Yi(o,e);else{let i=Vn(t);n={x:o.x-i.x,y:o.y-i.y,width:o.width,height:o.height}}return be(n)}function Nn(t,o){let e=se(t);return e===o||!U(e)||Pe(e)?!1:q(e).position==="fixed"||Nn(e,o)}function Zi(t,o){let e=o.get(t);if(e)return e;let n=Ee(t,[],!1).filter(a=>U(a)&&xe(a)!=="body"),i=null,r=q(t).position==="fixed",s=r?se(t):t;for(;U(s)&&!Pe(s);){let a=q(s),c=Bt(s);!c&&a.position==="fixed"&&(i=null),(r?!c&&!i:!c&&a.position==="static"&&!!i&&(i.position==="absolute"||i.position==="fixed")||Oe(s)&&!c&&Nn(t,s))?n=n.filter(m=>m!==s):i=a,s=se(s)}return o.set(t,n),n}function ji(t){let{element:o,boundary:e,rootBoundary:n,strategy:i}=t,s=[...e==="clippingAncestors"?et(o)?[]:Zi(o,this._c):[].concat(e),n],a=En(o,s[0],i),c=a.top,d=a.right,m=a.bottom,l=a.left;for(let f=1;f<s.length;f++){let u=En(o,s[f],i);c=ie(u.top,c),d=pe(u.right,d),m=pe(u.bottom,m),l=ie(u.left,l)}return{width:d-l,height:m-c,x:l,y:c}}function Qi(t){let{width:o,height:e}=An(t);return{width:o,height:e}}function er(t,o,e){let n=Q(o),i=K(o),r=e==="fixed",s=ke(t,!0,r,o),a={scrollLeft:0,scrollTop:0},c=J(0);function d(){c.x=Gt(i)}if(n||!n&&!r)if((xe(o)!=="body"||Oe(i))&&(a=tt(o)),n){let u=ke(o,!0,r,o);c.x=u.x+o.clientLeft,c.y=u.y+o.clientTop}else i&&d();r&&!n&&i&&d();let m=i&&!n&&!r?Dn(i,a):J(0),l=s.left+a.scrollLeft-c.x-m.x,f=s.top+a.scrollTop-c.y-m.y;return{x:l,y:f,width:s.width,height:s.height}}function go(t){return q(t).position==="static"}function On(t,o){if(!Q(t)||q(t).position==="fixed")return null;if(o)return o(t);let e=t.offsetParent;return K(t)===e&&(e=e.ownerDocument.body),e}function Hn(t,o){let e=F(t);if(et(t))return e;if(!Q(t)){let i=se(t);for(;i&&!Pe(i);){if(U(i)&&!go(i))return i;i=se(i)}return e}let n=On(t,o);for(;n&&Mn(n)&&go(n);)n=On(n,o);return n&&Pe(n)&&go(n)&&!Bt(n)?e:n||Wn(t)||e}var tr=async function(t){let o=this.getOffsetParent||Hn,e=this.getDimensions,n=await e(t.floating);return{reference:er(t.reference,await o(t.floating),t.strategy),floating:{x:0,y:0,width:n.width,height:n.height}}};function or(t){return q(t).direction==="rtl"}var nr={convertOffsetParentRelativeRectToViewportRelativeRect:qi,getDocumentElement:K,getClippingRect:ji,getOffsetParent:Hn,getElementRects:tr,getClientRects:Xi,getDimensions:Qi,getScale:Ae,isElement:U,isRTL:or};function $n(t,o){return t.x===o.x&&t.y===o.y&&t.width===o.width&&t.height===o.height}function ir(t,o){let e=null,n,i=K(t);function r(){var a;clearTimeout(n),(a=e)==null||a.disconnect(),e=null}function s(a,c){a===void 0&&(a=!1),c===void 0&&(c=1),r();let d=t.getBoundingClientRect(),{left:m,top:l,width:f,height:u}=d;if(a||o(),!f||!u)return;let g=Qe(l),_=Qe(i.clientWidth-(m+f)),v=Qe(i.clientHeight-(l+u)),h=Qe(m),P={rootMargin:-g+"px "+-_+"px "+-v+"px "+-h+"px",threshold:ie(0,pe(1,c))||1},k=!0;function x(S){let T=S[0].intersectionRatio;if(T!==c){if(!k)return s();T?s(!1,T):n=setTimeout(()=>{s(!1,1e-7)},1e3)}T===1&&!$n(d,t.getBoundingClientRect())&&s(),k=!1}try{e=new IntersectionObserver(x,{...P,root:i.ownerDocument})}catch{e=new IntersectionObserver(x,P)}e.observe(t)}return s(!0),r}function Bn(t,o,e,n){n===void 0&&(n={});let{ancestorScroll:i=!0,ancestorResize:r=!0,elementResize:s=typeof ResizeObserver=="function",layoutShift:a=typeof IntersectionObserver=="function",animationFrame:c=!1}=n,d=ho(t),m=i||r?[...d?Ee(d):[],...o?Ee(o):[]]:[];m.forEach(h=>{i&&h.addEventListener("scroll",e,{passive:!0}),r&&h.addEventListener("resize",e)});let l=d&&a?ir(d,e):null,f=-1,u=null;s&&(u=new ResizeObserver(h=>{let[b]=h;b&&b.target===d&&u&&o&&(u.unobserve(o),cancelAnimationFrame(f),f=requestAnimationFrame(()=>{var P;(P=u)==null||P.observe(o)})),e()}),d&&!c&&u.observe(d),o&&u.observe(o));let g,_=c?ke(t):null;c&&v();function v(){let h=ke(t);_&&!$n(_,h)&&e(),_=h,g=requestAnimationFrame(v)}return e(),()=>{var h;m.forEach(b=>{i&&b.removeEventListener("scroll",e),r&&b.removeEventListener("resize",e)}),l?.(),(h=u)==null||h.disconnect(),u=null,c&&cancelAnimationFrame(g)}}var wo=Sn;var vo=Tn,_o=kn;var Fn=Pn;var zn=(t,o,e)=>{let n=new Map,i={platform:nr,...e},r={...i.platform,_c:n};return xn(t,o,{...i,platform:r})};var me=({x:t,y:o,placement:e="right",offset:n=0,arrow:i=!1,arrowColor:r="white",children:s})=>{let a=H(null),c=H(null),d=H(null),m=H();return m.current=()=>{if(!a.current||!c.current)return;let l=Array.isArray(i)?i[0]:i||0,f=Array.isArray(i)?i[1]:i||0,u=n+Math.max(f,l),g=e.includes("-")?[wo(u),_o(),vo()]:[wo(u),vo(),_o()];d.current&&g.push(Fn({element:d.current})),zn(a.current,c.current,{placement:e,strategy:"fixed",middleware:g}).then(_=>{c.current&&Object.assign(c.current.style,{left:`${_.x}px`,top:`${_.y}px`});let v=_.middlewareData.arrow;if(v&&d.current){let h=rr(l,f,r,_.placement);h.transform=`translate(${v.x||0}px, ${v.y||0}px)`,Object.assign(d.current.style,h)}})},oe(()=>{m.current?.()},[t,o,e,i,n]),G(()=>{let l=a.current,f=c.current;if(!l||!f)return;f.style.visibility="visible";let u=Bn(l,f,()=>m.current?.());return()=>{u()}},[]),p("div",{style:{position:"absolute",left:t,top:o},ref:a,children:p("div",{className:"deck-widget deck-widget-popover",style:{position:"fixed",visibility:"hidden",pointerEvents:"none"},ref:c,children:[Boolean(i)&&p("div",{className:"deck-widget-popover-arrow",style:{position:"absolute"},ref:d}),s]})})};function rr(t,o,e,n){let i={width:0,height:0,top:"",bottom:"",left:"",right:""};return n.startsWith("bottom")?(i.borderLeft=`${t/2}px solid transparent`,i.borderRight=`${t/2}px solid transparent`,i.borderBottom=`${o}px solid ${e}`,i.borderTop="",i.top=`${-o}px`):n.startsWith("top")?(i.borderLeft=`${t/2}px solid transparent`,i.borderRight=`${t/2}px solid transparent`,i.borderTop=`${o}px solid ${e}`,i.borderBottom="",i.bottom=`${-o}px`):n.startsWith("right")?(i.borderTop=`${t/2}px solid transparent`,i.borderBottom=`${t/2}px solid transparent`,i.borderRight=`${o}px solid ${e}`,i.borderLeft="",i.left=`${-o}px`):n.startsWith("left")&&(i.borderTop=`${t/2}px solid transparent`,i.borderBottom=`${t/2}px solid transparent`,i.borderLeft=`${o}px solid ${e}`,i.borderRight="",i.right=`${-o}px`),i}var ot=({text:t,html:o,element:e,...n})=>{let i=H(null);return G(()=>(i.current&&e&&i.current.append(e),()=>{e?.remove()}),[e]),p("div",{ref:i,...n,dangerouslySetInnerHTML:o?{__html:o}:void 0,children:t})};var nt=class extends bo.Widget{constructor(e){super(e);this.className="deck-widget-info";this.placement="fill";this.tooltip=null;this.setProps(this.props)}setProps(e){this.viewId=e.viewId??this.viewId,super.setProps(e)}onAdd({deck:e}){this.deck=e}onRemove(){this.rootElement&&y(null,this.rootElement)}onViewportChange(e){this.viewport=e,this.updateHTML()}onHover(e){this.props.mode==="hover"&&(this.tooltip=this._getTooltip(e))}onClick(e){this.props.mode==="click"&&(this.tooltip=this._getTooltip(e))}_getTooltip(e){if(!this.props.getTooltip)return null;let n=this.props.getTooltip(e,this)??null;if(n===null)return null;let i=typeof n=="string"?{text:n}:n,r=i.position||e.coordinate;return r?{position:r,text:"",html:"",element:null,className:"",style:{},...i}:null}onRenderHTML(e){if(!this.viewport||this.tooltip===null){y(null,e);return}let n={...this.props.style,...this.tooltip.style},[i,r]=this.viewport.project(this.tooltip.position),s=p(me,{x:i,y:r,placement:this.props.placement,arrow:this.props.arrow,arrowColor:"var(--menu-background, #fff)",offset:this.props.offset,children:p(ot,{className:`deck-widget-popup-content ${this.tooltip.className} ${this.props.className}`,style:n,html:this.tooltip.html,text:this.tooltip.text,element:this.tooltip.element})});y(s,e)}};nt.defaultProps={...bo.Widget.defaultProps,id:"info",viewId:null,mode:"hover",getTooltip:void 0,placement:"right",offset:10,arrow:10};var yo=R(E(),1);var it=class extends yo.Widget{constructor(e){super(e);this.className="deck-widget-popup";this.placement="fill";this.setProps(this.props),this.isOpen=this.props.defaultIsOpen}setProps(e){this.viewId=e.viewId??this.viewId,super.setProps(e)}onAdd({deck:e}){this.deck=e}onRemove(){this.rootElement&&y(null,this.rootElement)}onViewportChange(e){this.viewport=e,this.updateHTML()}onClick(){this.props.closeOnClickOutside&&this._setIsOpen(!1)}_setIsOpen(e){this.isOpen!==e&&(this.isOpen=e,this.props.onOpenChange?.(e),this.updateHTML())}onRenderHTML(e){if(!this.viewport){y(null,e);return}let{marker:n,content:i,style:r}=this.props,[s,a]=this.viewport.project(this.props.position),c=p("div",{children:[n&&p("div",{style:{position:"absolute",left:s,top:a,pointerEvents:"all",cursor:"pointer"},children:p(ot,{...n,onClick:()=>this._setIsOpen(!0)})}),this.isOpen&&p(me,{x:s,y:a,placement:this.props.placement,arrow:this.props.arrow,arrowColor:"var(--menu-background, #fff)",offset:this.props.offset,children:p("div",{className:`deck-widget-popup-content ${this.props.className}`,style:r,children:[this.props.closeButton&&p("div",{className:"deck-widget-popup-controls",style:{width:"100%",display:"flex",justifyContent:"end"},children:p(M,{className:"deck-widget-popup-close-button",onClick:()=>this._setIsOpen(!1)})}),p(ot,{...typeof i=="string"?{text:i}:i})]})})]});y(c,e)}};it.defaultProps={...yo.Widget.defaultProps,id:"info",viewId:null,position:[0,0],marker:null,defaultIsOpen:!0,content:"",placement:"right",offset:10,arrow:10,closeButton:!0,closeOnClickOutside:!1,onOpenChange:()=>{}};var xo=R(E(),1);var rt=class extends xo.Widget{constructor(e){super(e);this.className="deck-widget-context-menu";this.placement="fill";this.menu=null;this.setProps(this.props)}onAdd({deck:e}){e.getCanvas()?.addEventListener("contextmenu",n=>this.handleContextMenu(n))}handleContextMenu(e){let n=e.target.getBoundingClientRect(),i=e.clientX-n.x,r=e.clientY-n.y,s=this.deck?.pickObject({x:i,y:r})||{x:i,y:r,picked:!1,layer:null,color:null,index:-1,pixelRatio:1},a=this.props.getMenuItems?.(s,this)||this.props.menuItems;this.menu=a.length>0?{items:a,pickInfo:s}:null,e.preventDefault(),this.updateHTML()}onRenderHTML(e){if(!this.menu){y(null,e);return}let{items:n,pickInfo:i}=this.menu,r={pointerEvents:"auto",position:"static",...this.props.style},s=p(me,{x:i.x,y:i.y,placement:this.props.placement,arrow:this.props.arrow,arrowColor:"var(--menu-background, #fff)",offset:this.props.offset,children:p(_e,{menuItems:n,onSelect:a=>this.props.onMenuItemSelected(a,i),style:r,isOpen:!0,onClose:()=>this.hide()})});y(s,e)}hide(){this.menu=null,this.updateHTML()}};rt.defaultProps={...xo.Widget.defaultProps,id:"context",viewId:null,menuItems:[],getMenuItems:void 0,onMenuItemSelected:()=>{},placement:"bottom-start",offset:10,arrow:!1};var So=R(E(),1);var Gn={passive:!1},st=(t,o,e)=>t<o?o:t>e?e:t,Ut=(t,o)=>{if(!t||!t.firstElementChild)return[0,0];let e=t.firstElementChild.getBoundingClientRect();return o?[e.top,e.height]:o?[e.top,e.height]:[e.left,e.width]},at=(t,o)=>typeof t=="number"&&!Number.isNaN(t)&&t>0?t:Math.max(1,o/10||1),Po=(t,o)=>typeof t=="number"&&!Number.isNaN(t)&&t>0?t:Math.max(1,o||1);function Ve(t){let{className:o="",min:e,max:n,step:i,value:r,orientation:s,pageSize:a,stepButtons:c=!1,startButtonAriaLabel:d,endButtonAriaLabel:m,eventTarget:l,decorations:f=[],onChange:u}=t,g=s!=="horizontal",_=H(null),v=H(null),h=H(null),b=H(null),[P,k]=de(0),x=n-e,S=Math.max(0,r[1]-r[0]),T=Math.max(0,x-S),W=st(r[0],e,e+T),{thumbLength:D,thumbOffset:O}=oe(()=>{if(P<=0||x<=0)return{thumbLength:0,thumbOffset:0};if(x<=S)return{thumbLength:1,thumbOffset:0};let w=S/x,C=Math.max(0,1-w),Y=T<=0?0:st((W-e)/T,0,1);return{thumbLength:Math.max(0,Math.min(w,1)),thumbOffset:C*Y}},[P,x,S,T,W,e]),L=ne(w=>{if(!u)return;let C=st(w,e,e+T);u([C,C+S])},[u,e,T,S]),ee=ne(w=>{w.stopPropagation(),L(W-at(i,x))},[L,W,i,x]),ge=ne(w=>{w.stopPropagation(),L(W+at(i,x))},[L,W,i,x]),N=ne(w=>{if(w.button!==0||w.target?.dataset.scrollbarThumb==="true")return;let Y=v.current;if(!Y)return;w.preventDefault(),w.stopPropagation();let[Se]=Ut(Y,g),De=g?w.clientY-Se:w.clientX-Se,Te=Math.max(1,1-D)*P,Ce=D/2*P,Le=Te<=0?0:st((De-Ce)/Te,0,1);L(e+Le*T)},[g,P,D,L,e,T]),te=w=>{w.button!==0||!v.current||(b.current={pointerId:w.pointerId,startCoord:g?w.clientY:w.clientX,startRatio:O,min:e,max:n,maxStart:T},w.currentTarget.setPointerCapture(w.pointerId),w.preventDefault(),w.stopPropagation())},X=ne(w=>{let C=b.current;if(!C||C.pointerId!==w.pointerId)return;let[Y,Se]=Ut(v.current,g),Te=(g?w.clientY:w.clientX)-C.startCoord,Ce=C.startRatio+Te/Se,Le=st(Ce*(C.max-C.min),0,C.maxStart)+C.min;L(Le),w.preventDefault()},[L,g]),B=ne(w=>{let C=b.current;C&&C.pointerId===w.pointerId&&(b.current=null,h.current?.releasePointerCapture(w.pointerId),w.preventDefault())},[]),$=ne(w=>{switch(w.key){case"ArrowUp":case"ArrowLeft":(g&&w.key==="ArrowUp"||!g&&w.key==="ArrowLeft")&&(L(W-at(i,x)),w.preventDefault());break;case"ArrowDown":case"ArrowRight":(g&&w.key==="ArrowDown"||!g&&w.key==="ArrowRight")&&(L(W+at(i,x)),w.preventDefault());break;case"PageUp":L(W-Po(a,S)),w.preventDefault();break;case"PageDown":L(W+Po(a,S)),w.preventDefault();break;case"Home":L(e),w.preventDefault();break;case"End":L(e+T),w.preventDefault();break;default:break}},[g,L,W,i,x,a,S,e,T]),z=ne(w=>{if(w.preventDefault(),w.stopPropagation(),T===0)return;let C=g?w.deltaY:w.deltaX;!g&&C===0&&(C=w.deltaY),w.deltaMode===WheelEvent.DOM_DELTA_LINE?C*=at(i,x):w.deltaMode===WheelEvent.DOM_DELTA_PAGE&&(C*=Po(a,S)),C!==0&&L(W+C)},[L,W,T,g,i,x,a,S]);ro(()=>{k(Ut(v.current,g)[1])},[g]),ro(()=>{let w=v.current;if(!w)return;let C=()=>{k(Ut(w,g)[1])};if(C(),typeof ResizeObserver<"u"){let Y=new ResizeObserver(C);return Y.observe(w),()=>Y.disconnect()}if(typeof window<"u")return window.addEventListener("resize",C),()=>window.removeEventListener("resize",C)},[g]),G(()=>{let w=l??_.current;if(w)return w.addEventListener("keydown",$),w.addEventListener("wheel",z,Gn),()=>{w.removeEventListener("keydown",$),w.removeEventListener("wheel",z,Gn)}},[l,$,z]);let Jt=oe(()=>!f.length||x<=0?[]:f.map((w,C)=>{let[Y,Se]=w.position,De=(Y-e)/x,Te=(Se-e)/x,Ce=Math.round(De*1e3)/10,Le=Math.max(0,Math.round((Te-De)*1e3)/10),Qn=g?{left:"0",width:"100%",top:`${Ce}%`,height:`${Le}%`}:{top:"0",height:"100%",left:`${Ce}%`,width:`${Le}%`};return p("div",{className:"deck-widget-range__decoration",style:Qn,children:w.element},`decoration-${C}`)}),[f,x,e,g]);return p("div",{ref:_,tabIndex:0,role:"scrollbar","aria-valuemin":e,"aria-valuemax":e+T,"aria-valuenow":W,"aria-orientation":s,className:`${o} deck-widget-range deck-widget-range--${s} ${T===0?"deck-widget-range--disabled":""}`,children:[c&&p("button",{type:"button",className:"deck-widget-range__button deck-widget-range__button--start","aria-label":d,disabled:W<=e,onClick:ee,children:p("span",{className:"deck-widget-icon"})}),p("div",{className:"deck-widget-range__track",ref:v,onClick:N,children:[p("div",{className:"deck-widget-range__decorations",children:Jt}),p("div",{className:"deck-widget-range__thumb","data-scrollbar-thumb":"true",ref:h,style:g?{height:`${D*100}%`,top:`${O*100}%`}:{width:`${D*100}%`,left:`${O*100}%`},onPointerDown:te,onPointerMove:X,onPointerUp:B,onPointerCancel:B})]}),c&&p("button",{type:"button",className:"deck-widget-range__button deck-widget-range__button--end","aria-label":m,disabled:W>=e+T,onClick:ge,children:p("span",{className:"deck-widget-icon"})})]})}var Un=(t,o,e)=>t<o?o:t>e?e:t,To=class extends So.Widget{constructor(e){let n={...To.defaultProps,...e};super(n);this.className="deck-widget-scrollbar";this.placement="fill";this.contentSize=0;this.viewportSize=0;this.scrollOffset=0;this.handleRangeChange=e=>{this.emitScroll(e[0])};this.viewId=n.viewId??null}onViewportChange(e){this.viewport=e,this.onRenderHTML()}onRenderHTML(){let e=this.rootElement;if(!e)return;e.dataset.placement=this.props.placement;let n=this.viewport;this.updateViewport(n);let i=this.getClampedOffset(),r=this.getWheelEventTarget(this.props.captureWheel?"global":"local"),s=this.getDecorations(n),a=this.isVertical(),c=this.props.startButtonAriaLabel??(a?"Scroll up":"Scroll left"),d=this.props.endButtonAriaLabel??(a?"Scroll down":"Scroll right"),m=p(Ve,{min:0,max:Math.max(0,this.contentSize),step:this.getEffectiveStep(),pageSize:this.getEffectivePage(),value:[i,i+this.viewportSize],orientation:this.props.orientation,stepButtons:!0,startButtonAriaLabel:c,endButtonAriaLabel:d,eventTarget:r,decorations:s,onChange:this.handleRangeChange});y(m,e)}onRemove(){this.rootElement&&y(null,this.rootElement),super.onRemove()}updateViewport(e){if(!e){this.contentSize=0,this.scrollOffset=0,this.viewportSize=0;return}let{contentBounds:n}=this.props,i=this.isVertical(),r=n?ko(n,e,i):[0,0];this.contentSize=r[1]-r[0],this.scrollOffset=-r[0],this.viewportSize=i?e.height:e.width}getDecorations(e){let{decorations:n=[],contentBounds:i}=this.props;if(!e||!i||n.length===0)return[];let r=this.isVertical(),[s]=ko(i,e,r);return n.map(a=>{let[c,d]=ko(a.contentBounds,e,r),m=a.onClick?l=>{a.onClick?.(l)&&(l.stopPropagation(),l.preventDefault())}:void 0;return{position:[c-s,d-s],element:p("div",{style:{pointerEvents:m?"all":"none",width:"100%",height:"100%",backgroundColor:a.color},title:a.title,onClick:m})}})}getWheelEventTarget(e){return e===null?null:e==="local"?this.rootElement:this.deck?.props.parent||this.deck?.getCanvas()?.parentElement||this.rootElement}getMaxScroll(){return Math.max(0,this.contentSize-this.viewportSize)}getClampedOffset(){let e=this.getMaxScroll();return Un(this.scrollOffset,0,e)}isVertical(){return this.props.orientation!=="horizontal"}getEffectiveStep(){return typeof this.props.stepSize=="number"&&!Number.isNaN(this.props.stepSize)?this.props.stepSize:Math.max(1,this.viewportSize/10||1)}getEffectivePage(){return typeof this.props.pageSize=="number"&&!Number.isNaN(this.props.pageSize)?this.props.pageSize:this.viewportSize}emitScroll(e){let n=this.getMaxScroll(),i=Un(Math.round(e),0,n),r=this.viewport;if(r&&i!==this.getClampedOffset()){let s=r.project(r.position);this.isVertical()?s[1]-=i-this.scrollOffset:s[0]-=i-this.scrollOffset;let{target:a}=r.panByPosition(r.position,s);this.deck._onViewStateChange({viewId:r.id,viewState:{...this.getViewState(r.id),target:a},interactionState:{}})}}},lt=To;lt.defaultProps={...So.Widget.defaultProps,contentBounds:null,placement:"top-right",viewId:null,orientation:"vertical",stepSize:null,pageSize:null,startButtonAriaLabel:"",endButtonAriaLabel:"",captureWheel:!1,decorations:[]};function ko(t,o,e){return t.map(([n,i])=>o.project([n,i,0])).reduce((n,[i,r])=>{let s=e?r:i;return n[0]=Math.min(n[0],s),n[1]=Math.max(n[1],s),n},[1/0,-1/0])}var Co=R(E(),1);var ct=class extends Co.Widget{constructor(e){super(e);this.className="";this.placement="top-left";this.setProps(this.props)}setProps(e){this.placement=e.placement??this.placement,this.viewId=e.viewId,super.setProps(e)}onRenderHTML(e){let{className:n,style:i,icon:r,color:s,label:a,onClick:c}=this.props;y(p(M,{className:n,style:i,color:s,icon:r,label:a,onClick:c}),e)}};ct.defaultProps={...Co.Widget.defaultProps,id:"icon",placement:"top-left",viewId:null,icon:"",label:"",color:"",onClick:void 0};var Lo=R(E(),1);var dt=class extends Lo.Widget{constructor(e){super(e);this.className="deck-widget-toggle";this.placement="top-left";this._toggle=()=>{this.checked=!this.checked,this.props.onChange?.(this.checked),this.updateHTML()};this.checked=this.props.initialChecked,this.setProps(this.props)}setProps(e){this.placement=e.placement??this.placement,this.viewId=e.viewId,super.setProps(e)}onRenderHTML(e){let{className:n,style:i,icon:r,label:s,color:a,onIcon:c=r,onLabel:d=s,onColor:m=a}=this.props,l=this.checked;e.dataset.checked=String(l),y(p(M,{className:n,style:i,icon:l?c:r,label:l?d:s,color:l?m:a,onClick:this._toggle}),e)}};dt.defaultProps={...Lo.Widget.defaultProps,id:"icon",placement:"top-left",viewId:null,initialChecked:!1,icon:"",onIcon:void 0,label:"",onLabel:void 0,color:"",onColor:void 0,onChange:void 0};var Mo=R(E(),1);var pt=class extends Mo.Widget{constructor(e){super(e);this.className="deck-widget-selector";this.placement="top-left";this.isOpen=!1;this._toggleMenu=()=>{this.isOpen?this.isOpen=!1:this.rootElement&&(this.isOpen={x:this.rootElement.offsetLeft,y:this.rootElement.offsetTop,placement:this.props.placement.includes("right")?"left-start":"right-start"}),this.updateHTML()};this._handleSelectMode=e=>{this.value=e,this.props.onChange(e),this.updateHTML()};this.value=this.props.initialValue,this.setProps(this.props)}setProps(e){this.placement=e.placement??this.placement,this.viewId=e.viewId??this.viewId,super.setProps(e)}onRenderHTML(e){let n=this.props.options.find(i=>i.value===this.value)??this.props.options[0];y(p("div",{children:[p(M,{icon:n.icon,label:n.label,onClick:this._toggleMenu}),this.isOpen&&p(me,{...this.isOpen,children:p(_e,{isOpen:!0,style:{pointerEvents:"auto",position:"static"},menuItems:this.props.options,onSelect:this._handleSelectMode,onClose:this._toggleMenu})})]}),e)}};pt.defaultProps={...Mo.Widget.defaultProps,id:"view-selector",placement:"top-left",viewId:null,initialValue:"",options:[],onChange:()=>{}};var Wo=R(E(),1);var ut=class extends Wo.Widget{constructor(e={}){super(e);this.id="timeline";this.className="deck-widget-timeline";this.placement="fill";this.playing=!1;this.timerId=null;this.handlePlayPause=()=>{this.playing?this.stop():this.play()};this.handleTimeChange=([e])=>{this.currentTime=e,this.props.timeline?.setTime(e),this.props.onTimeChange(e),this.updateHTML()};this.tick=()=>{let{timeRange:[e,n],step:i,loop:r}=this.props;if(i>0){let s=Math.round(this.currentTime/i)*i+i;s>n&&(this.currentTime<n?s=n:r?s=e:(s=n,this.playing=!1)),this.currentTime=s,this.props.onTimeChange(s),this.updateHTML()}this.playing?this.timerId=window.setTimeout(this.tick,this.props.playInterval):this.timerId=null};this.currentTime=this.props.initialTime??this.props.timeRange[0],this.props.timeline?.setTime(this.currentTime),this.setProps(this.props)}setProps(e){this.viewId=e.viewId??this.viewId,super.setProps(e)}onAdd(){this.playing=!1,this.timerId=null,this.props.autoPlay&&this.play()}onRemove(){this.stop()}onRenderHTML(e){let{timeRange:n,step:i,formatLabel:r}=this.props,s=this.currentTime;e.dataset.placement=this.props.placement,y(p("div",{className:"deck-widget-button-group",children:[this.playing?p(M,{label:"Pause",className:"deck-widget-timeline-pause",onClick:this.handlePlayPause}):p(M,{label:"Play",className:"deck-widget-timeline-play",onClick:this.handlePlayPause}),p(Ve,{min:n[0],max:n[1],orientation:"horizontal",step:i,value:[s,s],onChange:this.handleTimeChange,decorations:[{position:[s,s+i],element:p("div",{className:"deck-widget-timeline-label deck-widget-timeline-label--current",children:r(s)})}]})]}),e)}play(){this.playing=!0;let{timeRange:[e,n]}=this.props;this.currentTime>=n&&(this.currentTime=e,this.props.onTimeChange(e)),this.updateHTML(),this.tick()}stop(){this.playing=!1,this.timerId!==null&&(window.clearTimeout(this.timerId),this.timerId=null),this.updateHTML()}};ut.defaultProps={...Wo.Widget.defaultProps,id:"timeline",placement:"bottom-left",viewId:null,timeline:null,timeRange:[0,100],step:1,initialTime:void 0,onTimeChange:()=>{},autoPlay:!1,loop:!1,playInterval:1e3,formatLabel:String};var Io=R(E(),1);var mt=class extends Io.Widget{constructor(e={}){super(e);this.className="deck-widget-screenshot";this.placement="top-left";this.setProps(this.props)}setProps(e){this.placement=e.placement??this.placement,this.viewId=e.viewId??this.viewId,super.setProps(e)}onRenderHTML(e){y(p(M,{className:"deck-widget-camera",label:this.props.label,onClick:this.handleClick.bind(this)}),e)}handleClick(){if(this.props.onCapture){this.props.onCapture(this);return}let e=this.captureScreenToDataURL(this.props.imageFormat);e&&this.downloadDataURL(e,this.props.filename)}captureScreenToDataURL(e){return this.deck?.getCanvas()?.toDataURL(e)}downloadDataURL(e,n){let i=document.createElement("a");i.href=e,i.download=n,i.click()}};mt.defaultProps={...Io.Widget.defaultProps,id:"screenshot",placement:"top-left",viewId:null,label:"Screenshot",filename:"screenshot.png",imageFormat:"image/png",onCapture:void 0};var fe=R(E(),1),Ro=R(E(),1);var qn={"--widget-margin":"12px","--button-size":"28px","--button-corner-radius":"8px","--button-background":"#fff","--button-stroke":"rgba(255, 255, 255, 0.3)","--button-inner-stroke":"unset","--button-shadow":"0px 0px 8px 0px rgba(0, 0, 0, 0.25)","--button-backdrop-filter":"unset","--button-icon-idle":"rgba(97, 97, 102, 1)","--button-icon-hover":"rgba(24, 24, 26, 1)","--button-text":"rgb(24, 24, 26, 1)","--icon-compass-north-color":"rgb(240, 92, 68)","--icon-compass-south-color":"rgb(204, 204, 204)","--menu-gap":"4px","--menu-background":"#fff","--menu-backdrop-filter":"unset","--menu-border":"unset","--menu-shadow":"0px 0px 8px 0px rgba(0, 0, 0, 0.25)","--menu-text":"rgb(24, 24, 26, 1)","--menu-item-hover":"rgba(0, 0, 0, 0.08)","--range-step-button-size":"24px","--range-track-size":"16px","--range-thumb-size":"10px","--range-track-color":"#d8d8e5","--range-thumb-color":"#616166","--range-decoration-active-color":"#f8dd50"},Xn={"--widget-margin":"12px","--button-size":"28px","--button-corner-radius":"8px","--button-background":"rgba(18, 18, 20, 1)","--button-stroke":"rgba(18, 18, 20, 0.30)","--button-inner-stroke":"unset","--button-shadow":"0px 0px 8px 0px rgba(0, 0, 0, 0.25)","--button-backdrop-filter":"unset","--button-icon-idle":"rgba(158, 157, 168, 1)","--button-icon-hover":"rgba(215, 214, 229, 1)","--button-text":"rgb(215, 214, 229, 1)","--icon-compass-north-color":"rgb(240, 92, 68)","--icon-compass-south-color":"rgb(200, 199, 209)","--menu-gap":"4px","--menu-background":"rgba(18, 18, 20, 1)","--menu-backdrop-filter":"unset","--menu-border":"unset","--menu-shadow":"0px 0px 8px 0px rgba(0, 0, 0, 0.25)","--menu-text":"rgb(215, 214, 229, 1)","--menu-item-hover":"rgba(255, 255, 255, 0.1)","--range-step-button-size":"24px","--range-track-size":"16px","--range-thumb-size":"10px","--range-track-color":"#2c2c30","--range-thumb-color":"#9e9da8","--range-decoration-active-color":"#dd7d2c"},qt={"--widget-margin":"12px","--button-size":"28px","--button-corner-radius":"8px","--button-background":"rgba(255, 255, 255, 0.6)","--button-stroke":"rgba(255, 255, 255, 0.3)","--button-inner-stroke":"1px solid rgba(255, 255, 255, 0.6)","--button-shadow":"0px 0px 8px 0px rgba(0, 0, 0, 0.25), 0px 0px 8px 0px rgba(0, 0, 0, 0.1) inset","--button-backdrop-filter":"blur(4px)","--button-icon-idle":"rgba(97, 97, 102, 1)","--button-icon-hover":"rgba(24, 24, 26, 1)","--button-text":"rgb(24, 24, 26, 1)","--icon-compass-north-color":"rgb(240, 92, 68)","--icon-compass-south-color":"rgb(204, 204, 204)","--menu-gap":"4px","--menu-background":"rgba(255, 255, 255, 0.6)","--menu-backdrop-filter":"blur(4px)","--menu-border":"1px solid rgba(255, 255, 255, 0.6)","--menu-shadow":"0px 0px 8px 0px rgba(0, 0, 0, 0.25), 0px 0px 8px 0px rgba(0, 0, 0, 0.1) inset","--menu-text":"rgb(24, 24, 26, 1)","--menu-item-hover":"rgba(0, 0, 0, 0.08)","--range-step-button-size":"24px","--range-track-size":"16px","--range-thumb-size":"10px","--range-track-color":"rgba(215, 214, 229, 0.3)","--range-thumb-color":"rgba(97, 97, 102, 1)","--range-decoration-active-color":"rgba(255, 215, 0, 0.6)"},Xt={"--widget-margin":"12px","--button-size":"28px","--button-corner-radius":"8px","--button-background":"rgba(18, 18, 20, 0.75)","--button-stroke":"rgba(18, 18, 20, 0.30)","--button-inner-stroke":"1px solid rgba(18, 18, 20, 0.75)","--button-shadow":"0px 0px 8px 0px rgba(0, 0, 0, 0.25), 0px 0px 8px 0px rgba(0, 0, 0, 0.1) inset","--button-backdrop-filter":"blur(4px)","--button-icon-idle":"rgba(158, 157, 168, 1)","--button-icon-hover":"rgba(215, 214, 229, 1)","--button-text":"rgb(215, 214, 229, 1)","--icon-compass-north-color":"rgb(240, 92, 68)","--icon-compass-south-color":"rgb(200, 199, 209)","--menu-gap":"4px","--menu-background":"rgba(18, 18, 20, 0.75)","--menu-backdrop-filter":"blur(4px)","--menu-border":"1px solid rgba(18, 18, 20, 0.75)","--menu-shadow":"0px 0px 8px 0px rgba(0, 0, 0, 0.25), 0px 0px 8px 0px rgba(0, 0, 0, 0.1) inset","--menu-text":"rgb(215, 214, 229, 1)","--menu-item-hover":"rgba(255, 255, 255, 0.1)","--range-step-button-size":"24px","--range-track-size":"16px","--range-thumb-size":"10px","--range-track-color":"rgba(24, 24, 26, 0.3)","--range-thumb-color":"rgba(158, 157, 168, 1)","--range-decoration-active-color":"rgba(255, 145, 0, 0.6)"};var ft=class extends Ro.Widget{constructor(e={}){super(e);this.className="deck-widget-theme";this.placement="top-left";this.themeMode="dark";this.themeMode=this._getInitialThemeMode(),this.setProps(this.props)}setProps(e){let{lightModeTheme:n,darkModeTheme:i}=this.props;switch(this.placement=e.placement??this.placement,this.viewId=e.viewId??this.viewId,super.setProps(e),this.themeMode){case"light":e.lightModeTheme&&!(0,fe._deepEqual)(e.lightModeTheme,n,1)&&this._setThemeMode("light");break;case"dark":e.darkModeTheme&&!(0,fe._deepEqual)(e.darkModeTheme,i,1)&&this._setThemeMode("dark");break;default:fe.log.warn(`Invalid theme mode ${this.themeMode}`)()}}onRenderHTML(e){let{lightModeLabel:n,darkModeLabel:i}=this.props;y(p(M,{onClick:this._handleClick.bind(this),label:this.themeMode==="dark"?i:n,className:this.themeMode==="dark"?"deck-widget-moon":"deck-widget-sun"}),e)}onAdd(){this._setThemeMode(this.themeMode)}_handleClick(){let e=this.themeMode==="dark"?"light":"dark";this._setThemeMode(e)}_setThemeMode(e){this.themeMode=e;let n=this.rootElement?.closest(".deck-widget-container");if(n){let i=e==="dark"?this.props.darkModeTheme:this.props.lightModeTheme;(0,fe._applyStyles)(n,i);let r=this.themeMode==="dark"?this.props.darkModeLabel:this.props.lightModeLabel;fe.log.log(1,`Switched theme to ${r}`,i)(),this.updateHTML()}}_getInitialThemeMode(){let{initialThemeMode:e}=this.props;return e!=="auto"?e:typeof window>"u"?"light":window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"}};ft.defaultProps={...Ro.Widget.defaultProps,id:"theme",placement:"top-left",viewId:null,lightModeLabel:"Light Mode",lightModeTheme:qt,darkModeLabel:"Dark Mode",darkModeTheme:Xt,initialThemeMode:"auto"};var Eo=R(E(),1);var gt=class extends Eo.Widget{constructor(e={}){super(e);this.className="deck-widget-loading";this.placement="top-left";this.loading=!0;this.setProps(this.props)}setProps(e){this.placement=e.placement??this.placement,this.viewId=e.viewId??this.viewId,super.setProps(e)}onRenderHTML(e){y(this.loading&&p(M,{className:"deck-widget-spinner",label:this.props.label,onClick:this.handleClick.bind(this)}),e)}onRedraw({layers:e}){let n=e.some(i=>!i.isLoaded);n!==this.loading&&(this.loading=n,this.updateHTML())}handleClick(){}};gt.defaultProps={...Eo.Widget.defaultProps,id:"loading",placement:"top-left",viewId:null,label:"Loading layer data"};var Oo=R(E(),1),Zn=R(Kn(),1);var Ao=t=>`${t.name}: ${t.count}`;function Vo(t){return t<1e3?`${t.toFixed(2)}ms`:`${(t/1e3).toFixed(2)}s`}function jn(t){return`${(t/1e6).toFixed(1)} MB`}var Yn={count:Ao,averageTime:t=>`${t.name}: ${Vo(t.getAverageTime())}`,totalTime:t=>`${t.name}: ${Vo(t.time)}`,fps:t=>`${t.name}: ${Math.round(t.getHz())}fps`,memory:t=>`${t.name}: ${jn(t.count)}`},ht=class extends Oo.Widget{constructor(e={}){super(e);this.className="deck-widget-stats";this.placement="top-left";this._counter=0;this.collapsed=!0;this._toggleCollapsed=()=>{this.collapsed=!this.collapsed,this.updateHTML()};this._getFps=()=>Math.round(this.deck?.metrics.fps??0);this._formatters={...Yn},this._resetOnUpdate={...this.props.resetOnUpdate},this.collapsed=!e.defaultIsExpanded,this.setProps(e)}setProps(e){if(this.placement=e.placement??this.placement,this.viewId=e.viewId??this.viewId,e.formatters)for(let n in e.formatters){let i=e.formatters[n];this._formatters[n]=typeof i=="string"?Yn[i]||Ao:i}e.resetOnUpdate&&(this._resetOnUpdate={...e.resetOnUpdate}),super.setProps(e)}onRemove(){this.rootElement&&y(null,this.rootElement)}onRenderHTML(e){if(this.collapsed){y(p(sr,{getFps:this._getFps,onClick:this._toggleCollapsed}),e);return}let i=this._getStats(),r=this.props.title||("id"in i?i.id:null)||"Stats",s=this._getDeviceLabel(),a=[];i&&i.forEach(c=>{let d=this._getLines(c).split(`
8
+ `);this._resetOnUpdate&&this._resetOnUpdate[c.name]&&c.reset(),d.forEach((m,l)=>{a.push(p("div",{style:{whiteSpace:"pre"},children:m},`${c.name}-${l}`))})}),y(p("div",{className:"deck-widget-stats-container",style:{cursor:"default"},children:[p("div",{className:"deck-widget-stats-header",style:{cursor:"pointer",pointerEvents:"auto"},onClick:this._toggleCollapsed,children:[p("b",{children:r}),s&&p("span",{className:"deck-widget-stats-device",children:s}),p("button",{className:"deck-widget-dropdown-button",children:p("span",{className:"deck-widget-dropdown-icon open"})})]}),p("div",{className:"deck-widget-stats-content",children:a})]}),e)}onRedraw(){if(!this.collapsed){let e=Math.max(1,this.props.framesPerUpdate||1);this._counter++%e===0&&this.updateHTML()}}_getStats(){switch(this.props.type){case"deck":let e=this.deck?.metrics??{};return Object.entries(e);case"luma":return Array.from(Zn.luma.stats.stats.values())[0];case"device":let i=this.deck?.device?.statsManager.stats.values();return i?Array.from(i)[0]:[];case"custom":return this.props.stats;default:throw new Error(`Unknown stats type: ${this.props.type}`)}}_getDeviceLabel(){let e=this.deck?.device?.type;if(!e)return null;switch(e){case"webgpu":return"WebGPU";case"webgl":return"WebGL";default:return String(e)}}_getLines(e){if("count"in e)return(this._formatters[e.name]||this._formatters[e.type||""]||Ao)(e);let[n,i]=e,r=n.endsWith("Memory")?jn(i):n.includes("Time")?Vo(i):`${i.toFixed(2)}`;return`${n}: ${r}`}};ht.defaultProps={...Oo.Widget.defaultProps,type:"deck",placement:"top-left",viewId:null,defaultIsExpanded:!1,stats:void 0,title:"Stats",framesPerUpdate:1,formatters:{},resetOnUpdate:{},id:"stats"};function sr({getFps:t,onClick:o}){let[e,n]=de(t());return G(()=>{let i=()=>{n(t()),r=requestAnimationFrame(i)},r=requestAnimationFrame(i);return()=>{cancelAnimationFrame(r)}},[t]),p(M,{onClick:o,children:p("div",{className:"text",children:["FPS",p("br",{}),e]})})}return si(wt);})();
9
9
  return __exports__;
10
10
  });
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "description": "UI widgets for deck.gl",
4
4
  "license": "MIT",
5
5
  "type": "module",
6
- "version": "9.3.0-alpha.3",
6
+ "version": "9.3.0-alpha.6",
7
7
  "publishConfig": {
8
8
  "access": "public"
9
9
  },
@@ -45,9 +45,9 @@
45
45
  "preact": "^10.17.0"
46
46
  },
47
47
  "peerDependencies": {
48
- "@deck.gl/core": "~9.2.0",
48
+ "@deck.gl/core": "~9.3.0-alpha.1",
49
49
  "@floating-ui/dom": "^1.7.5",
50
- "@luma.gl/core": "~9.3.0-alpha.6"
50
+ "@luma.gl/core": "~9.3.2"
51
51
  },
52
- "gitHead": "25b39cfc26abd50aa900796fae75c2b5fedada69"
52
+ "gitHead": "6aff0d4eccd01a06a388ab1c07042a94daa3eb31"
53
53
  }
@@ -93,12 +93,13 @@ export const Popover = ({
93
93
 
94
94
  useEffect(() => {
95
95
  // initial mount
96
- if (contentRef.current) {
97
- contentRef.current.style.visibility = 'visible';
96
+ const anchor = anchorRef.current;
97
+ const content = contentRef.current;
98
+ if (!anchor || !content) {
99
+ return undefined;
98
100
  }
99
- const cleanup = autoUpdate(anchorRef.current!, contentRef.current!, () =>
100
- updaterRef.current?.()
101
- );
101
+ content.style.visibility = 'visible';
102
+ const cleanup = autoUpdate(anchor, content, () => updaterRef.current?.());
102
103
  return () => {
103
104
  cleanup();
104
105
  };
@@ -115,6 +115,7 @@ export class StatsWidget extends Widget<StatsWidgetProps> {
115
115
 
116
116
  const stats = this._getStats();
117
117
  const title = this.props.title || ('id' in stats ? stats.id : null) || 'Stats';
118
+ const deviceLabel = this._getDeviceLabel();
118
119
  const items: JSX.Element[] = [];
119
120
 
120
121
  if (stats) {
@@ -141,6 +142,7 @@ export class StatsWidget extends Widget<StatsWidgetProps> {
141
142
  onClick={this._toggleCollapsed}
142
143
  >
143
144
  <b>{title}</b>
145
+ {deviceLabel && <span className="deck-widget-stats-device">{deviceLabel}</span>}
144
146
  <button className="deck-widget-dropdown-button">
145
147
  <span className="deck-widget-dropdown-icon open" />
146
148
  </button>
@@ -190,6 +192,22 @@ export class StatsWidget extends Widget<StatsWidgetProps> {
190
192
  return Math.round(this.deck?.metrics.fps ?? 0);
191
193
  };
192
194
 
195
+ protected _getDeviceLabel(): string | null {
196
+ // @ts-expect-error device is protected
197
+ const deviceType = this.deck?.device?.type;
198
+ if (!deviceType) {
199
+ return null;
200
+ }
201
+ switch (deviceType) {
202
+ case 'webgpu':
203
+ return 'WebGPU';
204
+ case 'webgl':
205
+ return 'WebGL';
206
+ default:
207
+ return String(deviceType);
208
+ }
209
+ }
210
+
193
211
  protected _getLines(stat: Stat | [key: string, value: number]): string {
194
212
  if ('count' in stat) {
195
213
  const formatter =
@@ -463,6 +463,14 @@
463
463
  align-items: center;
464
464
  gap: 4px;
465
465
  }
466
+ .deck-widget-stats-device {
467
+ padding: 1px 6px;
468
+ border-radius: 999px;
469
+ font-size: 0.65rem;
470
+ line-height: 1.2;
471
+ background: color-mix(in srgb, currentColor 12%, transparent);
472
+ color: inherit;
473
+ }
466
474
  .deck-widget-stats-header:hover {
467
475
  color: var(--button-icon-hover, rgb(24, 24, 26));
468
476
  }